(function(j){j.toJSON=function(w){if(typeof JSON=="object"&&JSON.stringify)return JSON.stringify(w);var u=typeof w;if(w===null)return"null";if(u!="undefined"){if(u=="number"||u=="boolean")return w+"";if(u=="string")return j.quoteString(w);if(u=="object"){if(typeof w.toJSON=="function")return j.toJSON(w.toJSON());if(w.constructor===Date){var g=w.getUTCMonth()+1;if(g<10)g="0"+g;var l=w.getUTCDate();if(l<10)l="0"+l;u=w.getUTCFullYear();var q=w.getUTCHours();if(q<10)q="0"+q;var v=w.getUTCMinutes();if(v<
10)v="0"+v;var A=w.getUTCSeconds();if(A<10)A="0"+A;w=w.getUTCMilliseconds();if(w<100)w="0"+w;if(w<10)w="0"+w;return'"'+u+"-"+g+"-"+l+"T"+q+":"+v+":"+A+"."+w+'Z"'}if(w.constructor===Array){g=[];for(l=0;l<w.length;l++)g.push(j.toJSON(w[l])||"null");return"["+g.join(",")+"]"}g=[];for(l in w){u=typeof l;if(u=="number")u='"'+l+'"';else if(u=="string")u=j.quoteString(l);else continue;if(typeof w[l]!="function"){q=j.toJSON(w[l]);g.push(u+":"+q)}}return"{"+g.join(", ")+"}"}}};j.evalJSON=function(w){if(typeof JSON==
"object"&&JSON.parse)return JSON.parse(w);return eval("("+w+")")};j.secureEvalJSON=function(w){if(typeof JSON=="object"&&JSON.parse)return JSON.parse(w);var u;u=w.replace(/\\["\\\/bfnrtu]/g,"@");u=u.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");u=u.replace(/(?:^|:|,)(?:\s*\[)+/g,"");if(/^[\],:{}\s]*$/.test(u))return eval("("+w+")");else throw new SyntaxError("Error parsing JSON, source is not valid.");};j.quoteString=function(w){if(w.match(ca))return'"'+w.replace(ca,
function(u){var g=X[u];if(typeof g==="string")return g;g=u.charCodeAt();return"\\u00"+Math.floor(g/16).toString(16)+(g%16).toString(16)})+'"';return'"'+w+'"'};var ca=/["\\\x00-\x1f\x7f-\x9f]/g,X={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"}})(jQuery);(function(j){function ca(){this._settings=[];this._extensions=[];this.regional=[];this.regional[""]={errorLoadingText:"Error loading"};this.local=this.regional[""];this._uuid=(new Date).getTime();this._ie=!!window.ActiveXObject}function X(g,l){this._svg=g;this._container=l;for(var q=0;q<j.svg._extensions.length;q++){var v=j.svg._extensions[q];this[v[0]]=new v[1](this)}}function w(){this._path=""}function u(){this._parts=[]}j.extend(ca.prototype,{markerClassName:"hasSVG",propertyName:"svgwrapper",
svgNS:"http://www.w3.org/2000/svg",xlinkNS:"http://www.w3.org/1999/xlink",_wrapperClass:X,_attrNames:{class_:"class",in_:"in",alignmentBaseline:"alignment-baseline",baselineShift:"baseline-shift",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorRendering:"color-rendering",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",
floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",
markerStart:"marker-start",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",underlinePosition:"underline-position",
underlineThickness:"underline-thickness",vertAdvY:"vert-adv-y",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode"},_attachSVG:function(g,l){var q=g.namespaceURI===this.svgNS?g:null;g=q?null:g;if(!j(g||q).hasClass(this.markerClassName)){if(typeof l==="string")l={loadURL:l};else if(typeof l==="function")l={onLoad:l};j(g||q).addClass(this.markerClassName);try{if(!q){q=document.createElementNS(this.svgNS,"svg");q.setAttribute("version","1.1");g.clientWidth>0&&q.setAttribute("width",
g.clientWidth);g.clientHeight>0&&q.setAttribute("height",g.clientHeight);g.appendChild(q)}this._afterLoad(g,q,l||{})}catch(v){j(g).html("<p>SVG is not supported natively on this browser</p>")}}},_afterLoad:function(g,l,q){q=q||this._settings[g.id];this._settings[g?g.id:""]=null;var v=new this._wrapperClass(l,g);j.data(g||l,j.svg.propertyName,v);try{q.loadURL&&v.load(q.loadURL,q);q.settings&&v.configure(q.settings);if(q.onLoad&&!q.loadURL)q.onLoad.apply(g||l,[v])}catch(A){alert(A)}},_getSVG:function(g){return j(g).data(this.propertyName)},
_destroySVG:function(g){g=j(g);if(g.hasClass(this.markerClassName)){g.removeClass(this.markerClassName).removeData(this.propertyName);g[0].namespaceURI!==this.svgNS&&g.empty()}},addExtension:function(g,l){this._extensions.push([g,l])},isSVGElem:function(g){return g.nodeType===1&&g.namespaceURI===j.svg.svgNS}});j.extend(X.prototype,{width:function(){return this._container?this._container.clientWidth:this._svg.width},height:function(){return this._container?this._container.clientHeight:this._svg.height},
root:function(){return this._svg},configure:function(g,l,q){if(!g.nodeName){q=l;l=g;g=this._svg}if(q)for(q=g.attributes.length-1;q>=0;q--){var v=g.attributes.item(q);v.nodeName==="onload"||v.nodeName==="version"||v.nodeName.substring(0,5)==="xmlns"||g.attributes.removeNamedItem(v.nodeName)}for(var A in l)g.setAttribute(j.svg._attrNames[A]||A,l[A]);return this},getElementById:function(g){return this._svg.ownerDocument.getElementById(g)},change:function(g,l){if(g)for(var q in l)l[q]==null?g.removeAttribute(j.svg._attrNames[q]||
q):g.setAttribute(j.svg._attrNames[q]||q,l[q]);return this},_args:function(g,l,q){l.splice(0,0,"parent");l.splice(l.length,0,"settings");var v={},A=0;if(g[0]!=null&&g[0].jquery)g[0]=g[0][0];if(g[0]!=null&&!(typeof g[0]==="object"&&g[0].nodeName)){v.parent=null;A=1}for(var M=0;M<g.length;M++)v[l[M+A]]=g[M];q&&j.each(q,function(x,J){if(typeof v[J]==="object"){v.settings=v[J];v[J]=null}});return v},title:function(){var g=this._args(arguments,["text"]),l=this._makeNode(g.parent,"title",g.settings||{});
l.appendChild(this._svg.ownerDocument.createTextNode(g.text));return l},describe:function(){var g=this._args(arguments,["text"]),l=this._makeNode(g.parent,"desc",g.settings||{});l.appendChild(this._svg.ownerDocument.createTextNode(g.text));return l},defs:function(){var g=this._args(arguments,["id"],["id"]);return this._makeNode(g.parent,"defs",j.extend(g.id?{id:g.id}:{},g.settings||{}))},symbol:function(){var g=this._args(arguments,["id","x1","y1","width","height"]);return this._makeNode(g.parent,
"symbol",j.extend({id:g.id,viewBox:g.x1+" "+g.y1+" "+g.width+" "+g.height},g.settings||{}))},marker:function(){var g=this._args(arguments,["id","refX","refY","mWidth","mHeight","orient"],["orient"]);return this._makeNode(g.parent,"marker",j.extend({id:g.id,refX:g.refX,refY:g.refY,markerWidth:g.mWidth,markerHeight:g.mHeight,orient:g.orient||"auto"},g.settings||{}))},style:function(){var g=this._args(arguments,["styles"]),l=this._makeNode(g.parent,"style",j.extend({type:"text/css"},g.settings||{}));
l.appendChild(this._svg.ownerDocument.createTextNode(g.styles));return l},script:function(){var g=this._args(arguments,["script","type"],["type"]),l=this._makeNode(g.parent,"script",j.extend({type:g.type||"text/javascript"},g.settings||{}));l.appendChild(this._svg.ownerDocument.createTextNode(g.script));j.svg._ie&&j.globalEval(g.script);return l},linearGradient:function(){var g=this._args(arguments,["id","stops","x1","y1","x2","y2"],["x1"]),l=j.extend({id:g.id},g.x1!=null?{x1:g.x1,y1:g.y1,x2:g.x2,
y2:g.y2}:{});return this._gradient(g.parent,"linearGradient",j.extend(l,g.settings||{}),g.stops)},radialGradient:function(){var g=this._args(arguments,["id","stops","cx","cy","r","fx","fy"],["cx"]),l=j.extend({id:g.id},g.cx!=null?{cx:g.cx,cy:g.cy,r:g.r,fx:g.fx,fy:g.fy}:{});return this._gradient(g.parent,"radialGradient",j.extend(l,g.settings||{}),g.stops)},_gradient:function(g,l,q,v){g=this._makeNode(g,l,q);for(l=0;l<v.length;l++){q=v[l];this._makeNode(g,"stop",j.extend({offset:q[0],stopColor:q[1]},
q[2]!=null?{stopOpacity:q[2]}:{}))}return g},pattern:function(){var g=this._args(arguments,["id","x","y","width","height","vx","vy","vwidth","vheight"],["vx"]),l=j.extend({id:g.id,x:g.x,y:g.y,width:g.width,height:g.height},g.vx!=null?{viewBox:g.vx+" "+g.vy+" "+g.vwidth+" "+g.vheight}:{});return this._makeNode(g.parent,"pattern",j.extend(l,g.settings||{}))},clipPath:function(){var g=this._args(arguments,["id","units"]);g.units=g.units||"userSpaceOnUse";return this._makeNode(g.parent,"clipPath",j.extend({id:g.id,
clipPathUnits:g.units},g.settings||{}))},mask:function(){var g=this._args(arguments,["id","x","y","width","height"]);return this._makeNode(g.parent,"mask",j.extend({id:g.id,x:g.x,y:g.y,width:g.width,height:g.height},g.settings||{}))},createPath:function(){return new w},createText:function(){return new u},svg:function(){var g=this._args(arguments,["x","y","width","height","vx","vy","vwidth","vheight"],["vx"]),l=j.extend({x:g.x,y:g.y,width:g.width,height:g.height},g.vx!=null?{viewBox:g.vx+" "+g.vy+
" "+g.vwidth+" "+g.vheight}:{});return this._makeNode(g.parent,"svg",j.extend(l,g.settings||{}))},group:function(){var g=this._args(arguments,["id"],["id"]);return this._makeNode(g.parent,"g",j.extend({id:g.id},g.settings||{}))},use:function(){var g=this._args(arguments,["x","y","width","height","ref"]);if(typeof g.x==="string"){g.ref=g.x;g.settings=g.y;g.x=g.y=g.width=g.height=null}var l=this._makeNode(g.parent,"use",j.extend({x:g.x,y:g.y,width:g.width,height:g.height},g.settings||{}));l.setAttributeNS(j.svg.xlinkNS,
"href",g.ref);return l},link:function(){var g=this._args(arguments,["ref"]),l=this._makeNode(g.parent,"a",g.settings);l.setAttributeNS(j.svg.xlinkNS,"href",g.ref);return l},image:function(){var g=this._args(arguments,["x","y","width","height","ref"]),l=this._makeNode(g.parent,"image",j.extend({x:g.x,y:g.y,width:g.width,height:g.height},g.settings||{}));l.setAttributeNS(j.svg.xlinkNS,"href",g.ref);return l},path:function(){var g=this._args(arguments,["path"]);return this._makeNode(g.parent,"path",
j.extend({d:g.path.path?g.path.path():g.path},g.settings||{}))},rect:function(){var g=this._args(arguments,["x","y","width","height","rx","ry"],["rx"]);return this._makeNode(g.parent,"rect",j.extend({x:g.x,y:g.y,width:g.width,height:g.height},g.rx?{rx:g.rx,ry:g.ry}:{},g.settings||{}))},circle:function(){var g=this._args(arguments,["cx","cy","r"]);return this._makeNode(g.parent,"circle",j.extend({cx:g.cx,cy:g.cy,r:g.r},g.settings||{}))},ellipse:function(){var g=this._args(arguments,["cx","cy","rx",
"ry"]);return this._makeNode(g.parent,"ellipse",j.extend({cx:g.cx,cy:g.cy,rx:g.rx,ry:g.ry},g.settings||{}))},line:function(){var g=this._args(arguments,["x1","y1","x2","y2"]);return this._makeNode(g.parent,"line",j.extend({x1:g.x1,y1:g.y1,x2:g.x2,y2:g.y2},g.settings||{}))},polyline:function(){var g=this._args(arguments,["points"]);return this._poly(g.parent,"polyline",g.points,g.settings)},polygon:function(){var g=this._args(arguments,["points"]);return this._poly(g.parent,"polygon",g.points,g.settings)},
_poly:function(g,l,q,v){for(var A="",M=0;M<q.length;M++)A+=q[M].join()+" ";return this._makeNode(g,l,j.extend({points:j.trim(A)},v||{}))},text:function(){var g=this._args(arguments,["x","y","value"]);if(typeof g.x==="string"&&arguments.length<4){g.value=g.x;g.settings=g.y;g.x=g.y=null}return this._text(g.parent,"text",g.value,j.extend({x:g.x&&j.isArray(g.x)?g.x.join(" "):g.x,y:g.y&&j.isArray(g.y)?g.y.join(" "):g.y},g.settings||{}))},textpath:function(){var g=this._args(arguments,["path","value"]),
l=this._text(g.parent,"textPath",g.value,g.settings||{});l.setAttributeNS(j.svg.xlinkNS,"href",g.path);return l},_text:function(g,l,q,v){g=this._makeNode(g,l,v);if(typeof q==="string")g.appendChild(g.ownerDocument.createTextNode(q));else for(l=0;l<q._parts.length;l++){v=q._parts[l];if(v[0]==="tspan"){var A=this._makeNode(g,v[0],v[2]);A.appendChild(g.ownerDocument.createTextNode(v[1]));g.appendChild(A)}else if(v[0]==="tref"){A=this._makeNode(g,v[0],v[2]);A.setAttributeNS(j.svg.xlinkNS,"href",v[1]);
g.appendChild(A)}else if(v[0]==="textpath"){A=j.extend({},v[2]);A.href=null;A=this._makeNode(g,v[0],A);A.setAttributeNS(j.svg.xlinkNS,"href",v[2].href);A.appendChild(g.ownerDocument.createTextNode(v[1]));g.appendChild(A)}else g.appendChild(g.ownerDocument.createTextNode(v[1]))}return g},other:function(){var g=this._args(arguments,["name"]);return this._makeNode(g.parent,g.name,g.settings||{})},_makeNode:function(g,l,q){g=g||this._svg;var v=this._svg.ownerDocument.createElementNS(j.svg.svgNS,l);for(l in q){var A=
q[l];if(A!=null&&(typeof A!=="string"||A!==""))v.setAttribute(j.svg._attrNames[l]||l,A)}g.appendChild(v);return v},add:function(g){var l=this._args(arguments.length===1?[null,g]:arguments,["node"]),q=this;l.parent=l.parent||this._svg;l.node=l.node.jquery?l.node:j(l.node);try{l.parent.appendChild(l.node.cloneNode(true))}catch(v){l.node.each(function(){var A=q._cloneAsSVG(this);A&&l.parent.appendChild(A)})}return this},clone:function(g){var l=this,q=this._args(arguments.length===1?[null,g]:arguments,
["node"]);q.parent=q.parent||this._svg;q.node=q.node.jquery?q.node:j(q.node);var v=[];q.node.each(function(){var A=l._cloneAsSVG(this);if(A){A.id="";q.parent.appendChild(A);v.push(A)}});return v},_cloneAsSVG:function(g){var l=null;if(g.nodeType===1){l=this._svg.ownerDocument.createElementNS(j.svg.svgNS,this._checkName(g.nodeName));for(var q=0;q<g.attributes.length;q++){var v=g.attributes.item(q);if(v.nodeName!=="xmlns"&&v.nodeValue)v.prefix==="xlink"?l.setAttributeNS(j.svg.xlinkNS,v.localName||v.baseName,
v.nodeValue):l.setAttribute(this._checkName(v.nodeName),v.nodeValue)}for(q=0;q<g.childNodes.length;q++)(v=this._cloneAsSVG(g.childNodes[q]))&&l.appendChild(v)}else if(g.nodeType===3){if(j.trim(g.nodeValue))l=this._svg.ownerDocument.createTextNode(g.nodeValue)}else if(g.nodeType===4)if(j.trim(g.nodeValue))try{l=this._svg.ownerDocument.createCDATASection(g.nodeValue)}catch(A){l=this._svg.ownerDocument.createTextNode(g.nodeValue.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"))}return l},
_checkName:function(g){g=g.substring(0,1)>="A"&&g.substring(0,1)<="Z"?g.toLowerCase():g;return g.substring(0,4)==="svg:"?g.substring(4):g},load:function(g,l){l=typeof l==="boolean"?{addTo:l}:typeof l==="function"?{onLoad:l}:typeof l==="string"?{parent:l}:typeof l==="object"&&l.nodeName?{parent:l}:typeof l==="object"&&l.jquery?{parent:l}:l||{};!l.parent&&!l.addTo&&this.clear(false);var q=[this._svg.getAttribute("width"),this._svg.getAttribute("height")],v=this,A=function(J){J=j.svg.local.errorLoadingText+
": "+J;l.onLoad?l.onLoad.apply(v._container||v._svg,[v,J]):v.text(null,10,20,J)},M=function(J){if(J)if(J.documentElement.nodeName!=="svg"){var H=J.getElementsByTagName("parsererror"),E=H.length?H[0].getElementsByTagName("div"):[];A(!H.length?"???":(E.length?E[0]:H[0]).firstChild.nodeValue)}else{H=l.parent?j(l.parent)[0]:v._svg;var B={};for(E=0;E<J.documentElement.attributes.length;E++){var z=J.documentElement.attributes.item(E);if(!(z.nodeName==="version"||z.nodeName.substring(0,5)==="xmlns"))B[z.nodeName]=
z.nodeValue}v.configure(H,B,!l.parent);J=J.documentElement.childNodes;for(E=0;E<J.length;E++)try{H.appendChild(v._svg.ownerDocument.importNode(J[E],true));J[E].nodeName==="script"&&j.globalEval(J[E].textContent)}catch(y){v.add(H,J[E])}if(!l.keepRelativeLinks&&g.match("/")){var Q=g.replace(/\/[^\/]*$/,"/");j("*",H).each(function(){var $=j(this).attr("xlink:href");$&&!$.match(/(^[a-z][-a-z0-9+.]*:.*$)|(^\/.*$)|(^#.*$)/i)&&j(this).attr("xlink:href",Q+$)})}l.changeSize||v.configure(H,{width:q[0],height:q[1]});
if(l.onLoad)l.onLoad.apply(v._container||v._svg,[v])}};if(g.match("<svg"))try{M((new DOMParser).parseFromString(g,"text/xml"))}catch(x){A(x)}else j.ajax({url:g,dataType:"xml",success:function(J){M(J)},error:function(J,H,E){A(H+(E?" "+E.message:""))}});return this},remove:function(g){g=g.jquery?g[0]:g;g.parentNode.removeChild(g);return this},clear:function(g){for(g&&this.configure({},true);this._svg.firstChild;)this._svg.removeChild(this._svg.firstChild);return this},toSVG:function(g){g=g||this._svg;
return typeof XMLSerializer==="undefined"?this._toSVG(g):(new XMLSerializer).serializeToString(g)},_toSVG:function(g){var l="";if(!g)return l;if(g.nodeType===3)l=g.nodeValue;else if(g.nodeType===4)l="<![CDATA["+g.nodeValue+"]]\>";else{l="<"+g.nodeName;if(g.attributes)for(var q=0;q<g.attributes.length;q++){var v=g.attributes.item(q);j.trim(v.nodeValue)===""||v.nodeValue.match(/^\[object/)||v.nodeValue.match(/^function/)||(l+=" "+(v.namespaceURI===j.svg.xlinkNS?"xlink:":"")+v.nodeName+'="'+v.nodeValue+
'"')}if(g.firstChild){l+=">";for(q=g.firstChild;q;){l+=this._toSVG(q);q=q.nextSibling}l+="</"+g.nodeName+">"}else l+="/>"}return l}});j.extend(w.prototype,{reset:function(){this._path="";return this},move:function(g,l,q){q=j.isArray(g)?l:q;return this._coords(q?"m":"M",g,l)},line:function(g,l,q){q=j.isArray(g)?l:q;return this._coords(q?"l":"L",g,l)},horiz:function(g,l){this._path+=(l?"h":"H")+(j.isArray(g)?g.join(" "):g);return this},vert:function(g,l){this._path+=(l?"v":"V")+(j.isArray(g)?g.join(" "):
g);return this},curveC:function(g,l,q,v,A,M,x){x=j.isArray(g)?l:x;return this._coords(x?"c":"C",g,l,q,v,A,M)},smoothC:function(g,l,q,v,A){A=j.isArray(g)?l:A;return this._coords(A?"s":"S",g,l,q,v)},curveQ:function(g,l,q,v,A){A=j.isArray(g)?l:A;return this._coords(A?"q":"Q",g,l,q,v)},smoothQ:function(g,l,q){q=j.isArray(g)?l:q;return this._coords(q?"t":"T",g,l)},_coords:function(g,l,q,v,A,M,x){if(j.isArray(l))for(q=0;q<l.length;q++){v=l[q];this._path+=(q===0?g:" ")+v[0]+","+v[1]+(v.length<4?"":" "+v[2]+
","+v[3]+(v.length<6?"":" "+v[4]+","+v[5]))}else this._path+=g+l+","+q+(v==null?"":" "+v+","+A+(M==null?"":" "+M+","+x));return this},arc:function(g,l,q,v,A,M,x,J){J=j.isArray(g)?l:J;this._path+=J?"a":"A";if(j.isArray(g))for(l=0;l<g.length;l++){q=g[l];this._path+=(l===0?"":" ")+q[0]+","+q[1]+" "+q[2]+" "+(q[3]?"1":"0")+","+(q[4]?"1":"0")+" "+q[5]+","+q[6]}else this._path+=g+","+l+" "+q+" "+(v?"1":"0")+","+(A?"1":"0")+" "+M+","+x;return this},close:function(){this._path+="z";return this},path:function(){return this._path}});
w.prototype.moveTo=w.prototype.move;w.prototype.lineTo=w.prototype.line;w.prototype.horizTo=w.prototype.horiz;w.prototype.vertTo=w.prototype.vert;w.prototype.curveCTo=w.prototype.curveC;w.prototype.smoothCTo=w.prototype.smoothC;w.prototype.curveQTo=w.prototype.curveQ;w.prototype.smoothQTo=w.prototype.smoothQ;w.prototype.arcTo=w.prototype.arc;j.extend(u.prototype,{reset:function(){this._parts=[];return this},string:function(g){this._parts.push(["text",g]);return this},span:function(g,l){this._parts.push(["tspan",
g,l]);return this},ref:function(g,l){this._parts.push(["tref",g,l]);return this},path:function(g,l,q){this._parts.push(["textpath",l,j.extend({href:g},q||{})]);return this}});j.fn.svg=function(g){var l=Array.prototype.slice.call(arguments,1);if(typeof g==="string"&&g==="get")return j.svg["_"+g+"SVG"].apply(j.svg,[this[0]].concat(l));return this.each(function(){typeof g==="string"?j.svg["_"+g+"SVG"].apply(j.svg,[this].concat(l)):j.svg._attachSVG(this,g||{})})};j.svg=new ca})(jQuery);(function(j){function ca(w){return(!j.svg.isSVGElem(w)?w.className:w.className?w.className.baseVal:w.getAttribute("class"))||""}function X(w,u){w.className?w.className.baseVal=u:w.setAttribute("class",u)}j.fn.addClass=function(w){return function(u){if(j.isFunction(u))return this.each(function(l){j(this).addClass(u.call(this,l,ca(this)))});var g=arguments;u=u||"";return this.each(function(){if(j.svg.isSVGElem(this)){var l=this;j.each(u.split(/\s+/),function(q,v){var A=ca(l);if(j.inArray(v,A.split(/\s+/))===
-1)X(l,A+((A?" ":"")+v))})}else w.apply(j(this),g)})}}(j.fn.addClass);j.fn.removeClass=function(w){return function(u){if(j.isFunction(u))return this.each(function(l){j(this).removeClass(u.call(this,l,ca(this)))});var g=arguments;u=u||"";return this.each(function(){if(j.svg.isSVGElem(this)){var l=this;j.each(u.split(/\s+/),function(q,v){var A=ca(l);A=j.grep(A.split(/\s+/),function(M){return M!==v}).join(" ");X(l,A)})}else w.apply(j(this),g)})}}(j.fn.removeClass);j.fn.toggleClass=function(w){return function(u,
g){if(j.isFunction(u))return this.each(function(v){j(this).toggleClass(u.call(this,v,ca(this),g),g)});var l=arguments,q=typeof g==="boolean";return this.each(function(){if(j.svg.isSVGElem(this))if(typeof u==="string"){var v=j(this);j.each(u.split(/\s+/),function(M,x){q||(g=!v.hasClass(x));v[(g?"add":"remove")+"Class"](x)})}else{var A=ca(this);A&&j._data(this,"__className__",A);X(this,A||u===false?"":j._data(this,"__className__")||"")}else w.apply(j(this),l)})}}(j.fn.toggleClass);j.fn.hasClass=function(w){return function(u){u=
u||"";var g=false;this.each(function(){g=j.svg.isSVGElem(this)?j.inArray(u,ca(this).split(/\s+/))>-1:w.apply(j(this),[u]);return!g});return g}}(j.fn.hasClass);j.fn.attr=function(w){return function(u,g,l){if(typeof u==="string"&&g===undefined){var q=w.apply(this,arguments);if(q&&q.baseVal&&q.baseVal.numberOfItems!=null){g="";q=q.baseVal;if(u==="transform"){for(var v=0;v<q.numberOfItems;v++){var A=q.getItem(v);switch(A.type){case 1:g+=" matrix("+A.matrix.a+","+A.matrix.b+","+A.matrix.c+","+A.matrix.d+
","+A.matrix.e+","+A.matrix.f+")";break;case 2:g+=" translate("+A.matrix.e+","+A.matrix.f+")";break;case 3:g+=" scale("+A.matrix.a+","+A.matrix.d+")";break;case 4:g+=" rotate("+A.angle+")";break;case 5:g+=" skewX("+A.angle+")";break;case 6:g+=" skewY("+A.angle+")"}}q=g.substring(1)}else q=q.getItem(0).valueAsString}return q&&q.baseVal?q.baseVal.valueAsString:q}var M=u;if(typeof u==="string"){M={};M[u]=g}if(j.isFunction(g))return j(this).each(function(J){j(this).attr(u,g.call(this,J,j(this).attr(u)))});
var x=arguments;return j(this).each(function(){if(j.svg.isSVGElem(this))for(var J in M)l?this.style[J]=M[J]:this.setAttribute(J,M[J]);else w.apply(j(this),x)})}}(j.fn.attr);j.fn.removeAttr=function(w){return function(u){var g=arguments;return this.each(function(){if(j.svg.isSVGElem(this)){var l=this;j.each(u.split(/\s+/),function(q,v){l[v]&&l[v].baseVal?l[v].baseVal.value=null:l.removeAttribute(v)})}else w.apply(j(this),g)})}}(j.fn.removeAttr);j.extend(j.cssNumber,{stopOpacity:true,strokeMitrelimit:true,
strokeOpacity:true});if(j.cssProps)j.css=function(w){return function(u,g,l,q){return(g.match(/^svg.*/)?j(u).attr(j.cssProps[g]||g):"")||w(u,g,l,q)}}(j.css)})(jQuery);(function(j){if(typeof exports=="object"&&typeof module=="object")module.exports=j();else if(typeof define=="function"&&define.amd)return define([],j);else this.CodeMirror=j()})(function(){function j(a,b){if(!(this instanceof j))return new j(a,b);this.options=b=b?zb(b):{};zb(wf,b,false);J(b);var c=b.value;if(typeof c=="string")c=new Ya(c,b.mode);this.doc=c;var d=this.display=new ca(a,c);d.wrapper.CodeMirror=this;v(this);l(this);if(b.lineWrapping)this.display.wrapper.className+=" CodeMirror-wrap";
b.autofocus&&!Gd&&$a(this);z(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:false,focused:false,suppressEdits:false,pasteIncoming:false,cutIncoming:false,draggingText:false,highlight:new Tc,keySeq:null};va&&Fa<11&&setTimeout(ob(gb,this,true),20);xf(this);if(!le){yf();le=true}Lb(this);this.curOp.forceUpdate=true;me(this,c);b.autofocus&&!Gd||Ab()==d.input?setTimeout(ob(Hd,this),20):Uc(this);for(var e in $b)if($b.hasOwnProperty(e))$b[e](this,b[e],ne);cb(this);for(c=0;c<Id.length;++c)Id[c](this);
Mb(this);if(Na&&b.lineWrapping&&getComputedStyle(d.lineDiv).textRendering=="optimizelegibility")d.lineDiv.style.textRendering="auto"}function ca(a,b){var c=this.input=ga("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none");if(Na)c.style.width="1000px";else c.setAttribute("wrap","off");if(rc)c.style.border="1px solid black";c.setAttribute("autocorrect","off");c.setAttribute("autocapitalize","off");c.setAttribute("spellcheck","false");this.inputDiv=ga("div",
[c],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");this.scrollbarFiller=ga("div",null,"CodeMirror-scrollbar-filler");this.scrollbarFiller.setAttribute("not-content","true");this.gutterFiller=ga("div",null,"CodeMirror-gutter-filler");this.gutterFiller.setAttribute("not-content","true");this.lineDiv=ga("div",null,"CodeMirror-code");this.selectionDiv=ga("div",null,null,"position: relative; z-index: 1");this.cursorDiv=ga("div",null,"CodeMirror-cursors");this.measure=ga("div",null,
"CodeMirror-measure");this.lineMeasure=ga("div",null,"CodeMirror-measure");this.lineSpace=ga("div",[this.measure,this.lineMeasure,this.selectionDiv,this.cursorDiv,this.lineDiv],null,"position: relative; outline: none");this.mover=ga("div",[ga("div",[this.lineSpace],"CodeMirror-lines")],null,"position: relative");this.sizer=ga("div",[this.mover],"CodeMirror-sizer");this.sizerWidth=null;this.heightForcer=ga("div",null,null,"position: absolute; height: "+oe+"px; width: 1px;");this.gutters=ga("div",null,
"CodeMirror-gutters");this.lineGutter=null;this.scroller=ga("div",[this.sizer,this.heightForcer,this.gutters],"CodeMirror-scroll");this.scroller.setAttribute("tabIndex","-1");this.wrapper=ga("div",[this.inputDiv,this.scrollbarFiller,this.gutterFiller,this.scroller],"CodeMirror");if(va&&Fa<8){this.gutters.style.zIndex=-1;this.scroller.style.paddingRight=0}if(rc)c.style.width="0px";if(!Na)this.scroller.draggable=true;if(Jd){this.inputDiv.style.height="1px";this.inputDiv.style.position="absolute"}if(a)a.appendChild?
a.appendChild(this.wrapper):a(this.wrapper);this.reportedViewFrom=this.reportedViewTo=this.viewFrom=this.viewTo=b.first;this.view=[];this.externalMeasured=this.renderedView=null;this.lastWrapHeight=this.lastWrapWidth=this.viewOffset=0;this.updateLineNumbers=null;this.nativeBarWidth=this.barHeight=this.barWidth=0;this.scrollbarsClipped=false;this.lineNumWidth=this.lineNumInnerWidth=this.lineNumChars=null;this.prevInput="";this.pollingFast=this.alignWidgets=false;this.poll=new Tc;this.cachedCharWidth=
this.cachedTextHeight=this.cachedPaddingH=null;this.inaccurateSelection=false;this.maxLine=null;this.maxLineLength=0;this.maxLineChanged=false;this.wheelDX=this.wheelDY=this.wheelStartX=this.wheelStartY=null;this.shift=false;this.selForContextMenu=null}function X(a){a.doc.mode=j.getMode(a.options,a.doc.modeOption);w(a)}function w(a){a.doc.iter(function(b){if(b.stateAfter)b.stateAfter=null;if(b.styles)b.styles=null});a.doc.frontier=a.doc.first;db(a,100);a.state.modeGen++;a.curOp&&ab(a)}function u(a){var b=
vb(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/sc(a.display)-3);return function(e){if(Nb(a.doc,e))return 0;var f=0;if(e.widgets)for(var h=0;h<e.widgets.length;h++)if(e.widgets[h].height)f+=e.widgets[h].height;return c?f+(Math.ceil(e.text.length/d)||1)*b:f+b}}function g(a){var b=a.doc,c=u(a);b.iter(function(d){var e=c(d);e!=d.height&&pb(d,e)})}function l(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g,
" cm-s-");aa(a)}function q(a){v(a);ab(a);setTimeout(function(){Ga(a)},20)}function v(a){var b=a.display.gutters,c=a.options.gutters;Ob(b);for(var d=0;d<c.length;++d){var e=c[d],f=b.appendChild(ga("div",null,"CodeMirror-gutter "+e));if(e=="CodeMirror-linenumbers"){a.display.lineGutter=f;f.style.width=(a.display.lineNumWidth||1)+"px"}}b.style.display=d?"":"none";A(a)}function A(a){a.display.sizer.style.marginLeft=a.display.gutters.offsetWidth+"px"}function M(a){if(a.height==0)return 0;for(var b=a.text.length,
c,d=a;c=Pb(d,true);){c=c.find(0,true);d=c.from.line;b+=c.from.ch-c.to.ch}for(d=a;c=Pb(d,false);){c=c.find(0,true);b-=d.text.length-c.from.ch;d=c.to.line;b+=d.text.length-c.to.ch}return b}function x(a){var b=a.display;a=a.doc;b.maxLine=ha(a,a.first);b.maxLineLength=M(b.maxLine);b.maxLineChanged=true;a.iter(function(c){var d=M(c);if(d>b.maxLineLength){b.maxLineLength=d;b.maxLine=c}})}function J(a){var b=Ua(a.gutters,"CodeMirror-linenumbers");if(b==-1&&a.lineNumbers)a.gutters=a.gutters.concat(["CodeMirror-linenumbers"]);
else if(b>-1&&!a.lineNumbers){a.gutters=a.gutters.slice(0);a.gutters.splice(b,1)}}function H(a){var b=a.display,c=b.gutters.offsetWidth,d=Math.round(a.doc.height+(a.display.mover.offsetHeight-a.display.lineSpace.offsetHeight));return{clientHeight:b.scroller.clientHeight,viewHeight:b.wrapper.clientHeight,scrollWidth:b.scroller.scrollWidth,clientWidth:b.scroller.clientWidth,viewWidth:b.wrapper.clientWidth,barLeft:a.options.fixedGutter?c:0,docHeight:d,scrollHeight:d+Za(a)+b.barHeight,nativeBarWidth:b.nativeBarWidth,
gutterWidth:c}}function E(a,b,c){this.cm=c;var d=this.vert=ga("div",[ga("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),e=this.horiz=ga("div",[ga("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");a(d);a(e);qa(d,"scroll",function(){d.clientHeight&&b(d.scrollTop,"vertical")});qa(e,"scroll",function(){e.clientWidth&&b(e.scrollLeft,"horizontal")});this.checkedOverlay=false;if(va&&Fa<8)this.horiz.style.minHeight=this.vert.style.minWidth="18px"}function B(){}function z(a){if(a.display.scrollbars){a.display.scrollbars.clear();
a.display.scrollbars.addClass&&tc(a.display.wrapper,a.display.scrollbars.addClass)}a.display.scrollbars=new j.scrollbarModel[a.options.scrollbarStyle](function(b){a.display.wrapper.insertBefore(b,a.display.scrollbarFiller);qa(b,"mousedown",function(){a.state.focused&&setTimeout(ob($a,a),0)});b.setAttribute("not-content","true")},function(b,c){c=="horizontal"?ac(a,b):uc(a,b)},a);a.display.scrollbars.addClass&&vc(a.display.wrapper,a.display.scrollbars.addClass)}function y(a,b){b||(b=H(a));var c=a.display.barWidth,
d=a.display.barHeight;Q(a,b);for(var e=0;e<4&&c!=a.display.barWidth||d!=a.display.barHeight;e++){c!=a.display.barWidth&&a.options.lineWrapping&&G(a);Q(a,H(a));c=a.display.barWidth;d=a.display.barHeight}}function Q(a,b){var c=a.display,d=c.scrollbars.update(b);c.sizer.style.paddingRight=(c.barWidth=d.right)+"px";c.sizer.style.paddingBottom=(c.barHeight=d.bottom)+"px";if(d.right&&d.bottom){c.scrollbarFiller.style.display="block";c.scrollbarFiller.style.height=d.bottom+"px";c.scrollbarFiller.style.width=
d.right+"px"}else c.scrollbarFiller.style.display="";if(d.bottom&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter){c.gutterFiller.style.display="block";c.gutterFiller.style.height=d.bottom+"px";c.gutterFiller.style.width=b.gutterWidth+"px"}else c.gutterFiller.style.display=""}function $(a,b,c){var d=c&&c.top!=null?Math.max(0,c.top):a.scroller.scrollTop;d=Math.floor(d-a.lineSpace.offsetTop);var e=c&&c.bottom!=null?c.bottom:d+a.wrapper.clientHeight;d=Qb(b,d);e=Qb(b,e);if(c&&c.ensure){var f=
c.ensure.from.line;c=c.ensure.to.line;if(f<d){d=f;e=Qb(b,wb(ha(b,f))+a.wrapper.clientHeight)}else if(Math.min(c,b.lastLine())>=e){d=Qb(b,wb(ha(b,c))-a.wrapper.clientHeight);e=c}}return{from:d,to:Math.max(e,d+1)}}function Ga(a){var b=a.display,c=b.view;if(!(!b.alignWidgets&&(!b.gutters.firstChild||!a.options.fixedGutter))){for(var d=Va(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,f=d+"px",h=0;h<c.length;h++)if(!c[h].hidden){if(a.options.fixedGutter&&c[h].gutter)c[h].gutter.style.left=
f;var i=c[h].alignable;if(i)for(var k=0;k<i.length;k++)i[k].style.left=f}if(a.options.fixedGutter)b.gutters.style.left=d+e+"px"}}function cb(a){if(!a.options.lineNumbers)return false;var b=a.doc;b=String(a.options.lineNumberFormatter(b.first+b.size-1+a.options.firstLineNumber));var c=a.display;if(b.length!=c.lineNumChars){var d=c.measure.appendChild(ga("div",[ga("div",b)],"CodeMirror-linenumber CodeMirror-gutter-elt")),e=d.firstChild.offsetWidth;d=d.offsetWidth-e;c.lineGutter.style.width="";c.lineNumInnerWidth=
Math.max(e,c.lineGutter.offsetWidth-d);c.lineNumWidth=c.lineNumInnerWidth+d;c.lineNumChars=c.lineNumInnerWidth?b.length:-1;c.lineGutter.style.width=c.lineNumWidth+"px";A(a);return true}return false}function Va(a){return a.scroller.getBoundingClientRect().left-a.sizer.getBoundingClientRect().left}function Ja(a,b,c){var d=a.display;this.viewport=b;this.visible=$(d,a.doc,b);this.editorIsHidden=!d.wrapper.offsetWidth;this.wrapperHeight=d.wrapper.clientHeight;this.wrapperWidth=d.wrapper.clientWidth;this.oldDisplayWidth=
hb(a);this.force=c;this.dims=ba(a)}function Ea(a,b){var c=a.display,d=a.doc;if(b.editorIsHidden){Bb(a);return false}if(!b.force&&b.visible.from>=c.viewFrom&&b.visible.to<=c.viewTo&&(c.updateLineNumbers==null||c.updateLineNumbers>=c.viewTo)&&c.renderedView==c.view&&pe(a)==0)return false;if(cb(a)){Bb(a);b.dims=ba(a)}var e=d.first+d.size,f=Math.max(b.visible.from-a.options.viewportMargin,d.first),h=Math.min(e,b.visible.to+a.options.viewportMargin);if(c.viewFrom<f&&f-c.viewFrom<20)f=Math.max(d.first,
c.viewFrom);if(c.viewTo>h&&c.viewTo-h<20)h=Math.min(e,c.viewTo);if(Cb){f=Kd(a.doc,f);h=qe(a.doc,h)}d=f!=c.viewFrom||h!=c.viewTo||c.lastWrapHeight!=b.wrapperHeight||c.lastWrapWidth!=b.wrapperWidth;e=a.display;if(e.view.length==0||f>=e.viewTo||h<=e.viewFrom){e.view=Vc(a,f,h);e.viewFrom=f}else{if(e.viewFrom>f)e.view=Vc(a,f,e.viewFrom).concat(e.view);else if(e.viewFrom<f)e.view=e.view.slice(wc(a,f));e.viewFrom=f;if(e.viewTo<h)e.view=e.view.concat(Vc(a,e.viewTo,h));else if(e.viewTo>h)e.view=e.view.slice(0,
wc(a,h))}e.viewTo=h;c.viewOffset=wb(ha(a.doc,c.viewFrom));a.display.mover.style.top=c.viewOffset+"px";h=pe(a);if(!d&&h==0&&!b.force&&c.renderedView==c.view&&(c.updateLineNumbers==null||c.updateLineNumbers>=c.viewTo))return false;f=Ab();if(h>4)c.lineDiv.style.display="none";wa(a,c.updateLineNumbers,b.dims);if(h>4)c.lineDiv.style.display="";c.renderedView=c.view;f&&Ab()!=f&&f.offsetHeight&&f.focus();Ob(c.cursorDiv);Ob(c.selectionDiv);c.gutters.style.height=0;if(d){c.lastWrapHeight=b.wrapperHeight;c.lastWrapWidth=
b.wrapperWidth;db(a,400)}c.updateLineNumbers=null;return true}function S(a,b){for(var c=b.viewport,d=true;;d=false){if(!(d&&a.options.lineWrapping&&b.oldDisplayWidth!=hb(a))){if(c&&c.top!=null)c={top:Math.min(a.doc.height+(a.display.mover.offsetHeight-a.display.lineSpace.offsetHeight)-Db(a),c.top)};b.visible=$(a.display,a.doc,c);if(b.visible.from>=a.display.viewFrom&&b.visible.to<=a.display.viewTo)break}if(!Ea(a,b))break;G(a);d=H(a);Rb(a);C(a,d);y(a,d)}Qa(a,"update",a);if(a.display.viewFrom!=a.display.reportedViewFrom||
a.display.viewTo!=a.display.reportedViewTo){Qa(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo);a.display.reportedViewFrom=a.display.viewFrom;a.display.reportedViewTo=a.display.viewTo}}function T(a,b){var c=new Ja(a,b);if(Ea(a,c)){G(a);S(a,c);c=H(a);Rb(a);C(a,c);y(a,c)}}function C(a,b){a.display.sizer.style.minHeight=b.docHeight+"px";var c=b.docHeight+a.display.barHeight;a.display.heightForcer.style.top=c+"px";a.display.gutters.style.height=Math.max(c+Za(a),b.clientHeight)+"px"}function G(a){a=
a.display;for(var b=a.lineDiv.offsetTop,c=0;c<a.view.length;c++){var d=a.view[c],e;if(!d.hidden){if(va&&Fa<8){var f=d.node.offsetTop+d.node.offsetHeight;e=f-b;b=f}else{e=d.node.getBoundingClientRect();e=e.bottom-e.top}f=d.line.height-e;if(e<2)e=vb(a);if(f>0.001||f<-0.001){pb(d.line,e);O(d.line);if(d.rest)for(e=0;e<d.rest.length;e++)O(d.rest[e])}}}}function O(a){if(a.widgets)for(var b=0;b<a.widgets.length;++b)a.widgets[b].height=a.widgets[b].node.offsetHeight}function ba(a){for(var b=a.display,c={},
d={},e=b.gutters.clientLeft,f=b.gutters.firstChild,h=0;f;f=f.nextSibling,++h){c[a.options.gutters[h]]=f.offsetLeft+f.clientLeft+e;d[a.options.gutters[h]]=f.clientWidth}return{fixedPos:Va(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:c,gutterWidth:d,wrapperWidth:b.wrapper.clientWidth}}function wa(a,b,c){function d(p){var D=p.nextSibling;if(Na&&ib&&a.display.currentWheelTarget==p)p.style.display="none";else p.parentNode.removeChild(p);return D}var e=a.display,f=a.options.lineNumbers,h=e.lineDiv,
i=h.firstChild,k=e.view;e=e.viewFrom;for(var m=0;m<k.length;m++){var o=k[m];if(!o.hidden)if(o.node){for(;i!=o.node;)i=d(i);i=f&&b!=null&&b<=e&&o.lineNumber;if(o.changes){if(Ua(o.changes,"gutter")>-1)i=false;ra(a,o,e,c)}if(i){Ob(o.lineNumber);o.lineNumber.appendChild(document.createTextNode(String(a.options.lineNumberFormatter(e+a.options.firstLineNumber))))}i=o.node.nextSibling}else{var t=ua(a,o,e,c);h.insertBefore(t,i)}e+=o.size}for(;i;)i=d(i)}function ra(a,b,c,d){for(var e=0;e<b.changes.length;e++){var f=
b.changes[e];if(f=="text"){f=b;var h=f.text.className,i=Z(a,f);if(f.text==f.node)f.node=i.pre;f.text.parentNode.replaceChild(i.pre,f.text);f.text=i.pre;if(i.bgClass!=f.bgClass||i.textClass!=f.textClass){f.bgClass=i.bgClass;f.textClass=i.textClass;ma(f)}else if(h)f.text.className=h}else if(f=="gutter")Aa(a,b,c,d);else if(f=="class")ma(b);else if(f=="widget"){f=b;h=d;if(f.alignable)f.alignable=null;i=f.node.firstChild;for(var k=void 0;i;i=k){k=i.nextSibling;i.className=="CodeMirror-linewidget"&&f.node.removeChild(i)}P(f,
h)}}b.changes=null}function la(a){if(a.node==a.text){a.node=ga("div",null,null,"position: relative");a.text.parentNode&&a.text.parentNode.replaceChild(a.node,a.text);a.node.appendChild(a.text);if(va&&Fa<8)a.node.style.zIndex=2}return a.node}function Z(a,b){var c=a.display.externalMeasured;if(c&&c.line==b.line){a.display.externalMeasured=null;b.measure=c.measure;return c.built}return re(a,b)}function ma(a){var b=a.bgClass?a.bgClass+" "+(a.line.bgClass||""):a.line.bgClass;if(b)b+=" CodeMirror-linebackground";
if(a.background)if(b)a.background.className=b;else{a.background.parentNode.removeChild(a.background);a.background=null}else if(b){var c=la(a);a.background=c.insertBefore(ga("div",null,b),c.firstChild)}if(a.line.wrapClass)la(a).className=a.line.wrapClass;else if(a.node!=a.text)a.node.className="";a.text.className=(a.textClass?a.textClass+" "+(a.line.textClass||""):a.line.textClass)||""}function Aa(a,b,c,d){if(b.gutter){b.node.removeChild(b.gutter);b.gutter=null}var e=b.line.gutterMarkers;if(a.options.lineNumbers||
e){var f=la(b);f=b.gutter=f.insertBefore(ga("div",null,"CodeMirror-gutter-wrapper","left: "+(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px; width: "+d.gutterTotalWidth+"px"),b.text);if(b.line.gutterClass)f.className+=" "+b.line.gutterClass;if(a.options.lineNumbers&&(!e||!e["CodeMirror-linenumbers"]))b.lineNumber=f.appendChild(ga("div",String(a.options.lineNumberFormatter(c+a.options.firstLineNumber)),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+d.gutterLeft["CodeMirror-linenumbers"]+
"px; width: "+a.display.lineNumInnerWidth+"px"));if(e)for(b=0;b<a.options.gutters.length;++b){c=a.options.gutters[b];var h=e.hasOwnProperty(c)&&e[c];h&&f.appendChild(ga("div",[h],"CodeMirror-gutter-elt","left: "+d.gutterLeft[c]+"px; width: "+d.gutterWidth[c]+"px"))}}}function ua(a,b,c,d){var e=Z(a,b);b.text=b.node=e.pre;if(e.bgClass)b.bgClass=e.bgClass;if(e.textClass)b.textClass=e.textClass;ma(b);Aa(a,b,c,d);P(b,d);return b.node}function P(a,b){V(a.line,a,b,true);if(a.rest)for(var c=0;c<a.rest.length;c++)V(a.rest[c],
a,b,false)}function V(a,b,c,d){if(a.widgets){var e=la(b),f=0;for(a=a.widgets;f<a.length;++f){var h=a[f],i=ga("div",[h.node],"CodeMirror-linewidget");h.handleMouseEvents||i.setAttribute("cm-ignore-events","true");var k=h,m=i,o=c;if(k.noHScroll){(b.alignable||(b.alignable=[])).push(m);var t=o.wrapperWidth;m.style.left=o.fixedPos+"px";if(!k.coverGutter){t-=o.gutterTotalWidth;m.style.paddingLeft=o.gutterTotalWidth+"px"}m.style.width=t+"px"}if(k.coverGutter){m.style.zIndex=5;m.style.position="relative";
if(!k.noHScroll)m.style.marginLeft=-o.gutterTotalWidth+"px"}d&&h.above?e.insertBefore(i,b.gutter||b.text):e.appendChild(i);Qa(h,"redraw")}}}function R(a,b){return sa(a,b)<0?b:a}function r(a,b){return sa(a,b)<0?a:b}function F(a,b){this.ranges=a;this.primIndex=b}function s(a,b){this.anchor=a;this.head=b}function U(a,b){var c=a[b];a.sort(function(i,k){return sa(i.from(),k.from())});b=Ua(a,c);for(c=1;c<a.length;c++){var d=a[c],e=a[c-1];if(sa(e.to(),d.from())>=0){var f=r(e.from(),d.from()),h=R(e.to(),
d.to());d=e.empty()?d.from()==d.head:e.from()==e.head;c<=b&&--b;a.splice(--c,2,new s(d?h:f,d?f:h))}}return new F(a,b)}function ja(a,b){return new F([new s(a,b||a)],0)}function Y(a,b){if(b.line<a.first)return W(a.first,0);var c=a.first+a.size-1;if(b.line>c)return W(c,ha(a,c).text.length);c=ha(a,b.line).text.length;var d=b.ch;return d==null||d>c?W(b.line,c):d<0?W(b.line,0):b}function Ka(a,b){return b>=a.first&&b<a.first+a.size}function Ha(a,b,c,d){if(a.cm&&a.cm.display.shift||a.extend){a=b.anchor;if(d){b=
sa(c,a)<0;if(b!=sa(d,a)<0){a=c;c=d}else if(b!=sa(c,d)<0)c=d}return new s(a,c)}else return new s(d||c,c)}function xa(a,b,c,d){Ma(a,new F([Ha(a,a.sel.primary(),b,c)],0),d)}function eb(a,b,c){for(var d=[],e=0;e<a.sel.ranges.length;e++)d[e]=Ha(a,a.sel.ranges[e],b[e],null);b=U(d,a.sel.primIndex);Ma(a,b,c)}function Ba(a,b,c,d){var e=a.sel.ranges.slice(0);e[b]=c;Ma(a,U(e,a.sel.primIndex),d)}function bc(a,b){var c={ranges:b.ranges,update:function(d){this.ranges=[];for(var e=0;e<d.length;e++)this.ranges[e]=
new s(Y(a,d[e].anchor),Y(a,d[e].head))}};Oa(a,"beforeSelectionChange",a,c);a.cm&&Oa(a.cm,"beforeSelectionChange",a.cm,c);return c.ranges!=b.ranges?U(c.ranges,c.ranges.length-1):b}function cc(a,b,c){var d=a.history.done,e=Ia(d);if(e&&e.ranges){d[d.length-1]=b;qb(a,b,c)}else Ma(a,b,c)}function Ma(a,b,c){qb(a,b,c);b=a.sel;var d=a.cm?a.cm.curOp.id:NaN,e=a.history,f=c&&c.origin,h;if(!(h=d==e.lastSelOp))if(h=f)if(h=e.lastSelOrigin==f)if(!(h=e.lastModTime==e.lastSelTime&&e.lastOrigin==f)){h=Ia(e.done);var i=
f.charAt(0);h=i=="*"||i=="+"&&h.ranges.length==b.ranges.length&&h.somethingSelected()==b.somethingSelected()&&new Date-a.history.lastSelTime<=(a.cm?a.cm.options.historyEventDelay:500)}if(h)e.done[e.done.length-1]=b;else Wc(b,e.done);e.lastSelTime=+new Date;e.lastSelOrigin=f;e.lastSelOp=d;c&&c.clearRedo!==false&&se(e.undone)}function qb(a,b,c){if(jb(a,"beforeSelectionChange")||a.cm&&jb(a.cm,"beforeSelectionChange"))b=bc(a,b);var d=c&&c.bias||(sa(b.primary().head,a.sel.primary().head)<0?-1:1);Xc(a,
Yc(a,b,d,true));!(c&&c.scroll===false)&&a.cm&&dc(a.cm)}function Xc(a,b){if(!b.equals(a.sel)){a.sel=b;if(a.cm){a.cm.curOp.updateInput=a.cm.curOp.selectionChanged=true;te(a.cm)}Qa(a,"cursorActivity",a)}}function Zc(a){Xc(a,Yc(a,a.sel,null,false),Eb)}function Yc(a,b,c,d){for(var e,f=0;f<b.ranges.length;f++){var h=b.ranges[f],i=ec(a,h.anchor,c,d),k=ec(a,h.head,c,d);if(e||i!=h.anchor||k!=h.head){e||(e=b.ranges.slice(0,f));e[f]=new s(i,k)}}return e?U(e,b.primIndex):b}function ec(a,b,c,d){var e=false,f=
b,h=c||1;a.cantEdit=false;a:for(;;){var i=ha(a,f.line);if(i.markedSpans)for(var k=0;k<i.markedSpans.length;++k){var m=i.markedSpans[k],o=m.marker;if((m.from==null||(o.inclusiveLeft?m.from<=f.ch:m.from<f.ch))&&(m.to==null||(o.inclusiveRight?m.to>=f.ch:m.to>f.ch))){if(d){Oa(o,"beforeCursorEnter");if(o.explicitlyCleared)if(i.markedSpans){--k;continue}else break}if(o.atomic){k=o.find(h<0?-1:1);if(sa(k,f)==0){k.ch+=h;if(k.ch<0)k=k.line>a.first?Y(a,W(k.line-1)):null;else if(k.ch>i.text.length)k=k.line<
a.first+a.size-1?W(k.line+1,0):null;if(!k){if(e){if(!d)return ec(a,b,c,true);a.cantEdit=true;return W(a.first,0)}e=true;k=b;h=-h}}f=k;continue a}}}return f}}function xc(a){for(var b=a.display,c=a.doc,d={},e=d.cursors=document.createDocumentFragment(),f=d.selection=document.createDocumentFragment(),h=0;h<c.sel.ranges.length;h++){var i=c.sel.ranges[h],k=i.empty();if(k||a.options.showCursorWhenSelecting){var m=a,o=e,t=N(m,i.head,"div",null,null,!m.options.singleCursorHeightPerLine),p=o.appendChild(ga("div",
"\u00a0","CodeMirror-cursor"));p.style.left=t.left+"px";p.style.top=t.top+"px";p.style.height=Math.max(0,t.bottom-t.top)*m.options.cursorHeight+"px";if(t.other){m=o.appendChild(ga("div","\u00a0","CodeMirror-cursor CodeMirror-secondarycursor"));m.style.display="";m.style.left=t.other.left+"px";m.style.top=t.other.top+"px";m.style.height=(t.other.bottom-t.other.top)*0.85+"px"}}k||Ld(a,i,f)}if(a.options.moveInputWithCursor){a=N(a,c.sel.primary().head,"div");c=b.wrapper.getBoundingClientRect();e=b.lineDiv.getBoundingClientRect();
d.teTop=Math.max(0,Math.min(b.wrapper.clientHeight-10,a.top+e.top-c.top));d.teLeft=Math.max(0,Math.min(b.wrapper.clientWidth-10,a.left+e.left-c.left))}return d}function fc(a,b){rb(a.display.cursorDiv,b.cursors);rb(a.display.selectionDiv,b.selection);if(b.teTop!=null){a.display.inputDiv.style.top=b.teTop+"px";a.display.inputDiv.style.left=b.teLeft+"px"}}function Rb(a){fc(a,xc(a))}function Ld(a,b,c){function d(p,D,L,ea){if(D<0)D=0;D=Math.round(D);ea=Math.round(ea);i.appendChild(ga("div",null,"CodeMirror-selected",
"position: absolute; left: "+p+"px; top: "+D+"px; width: "+(L==null?o-p:L)+"px; height: "+(ea-D)+"px"))}function e(p,D,L){var ea=ha(h,p),fa=ea.text.length,na,ia;zf(sb(ea),D||0,L==null?fa:L,function(da,Ca,pa){var ya=I(a,W(p,da),"div",ea,"left"),ta,Da;if(da==Ca){ta=ya;pa=Da=ya.left}else{ta=I(a,W(p,Ca-1),"div",ea,"right");if(pa=="rtl"){pa=ya;ya=ta;ta=pa}pa=ya.left;Da=ta.right}if(D==null&&da==0)pa=m;if(ta.top-ya.top>3){d(pa,ya.top,null,ya.bottom);pa=m;ya.bottom<ta.top&&d(pa,ya.bottom,null,ta.top)}if(L==
null&&Ca==fa)Da=o;if(!na||ya.top<na.top||ya.top==na.top&&ya.left<na.left)na=ya;if(!ia||ta.bottom>ia.bottom||ta.bottom==ia.bottom&&ta.right>ia.right)ia=ta;if(pa<m+1)pa=m;d(pa,ta.top,Da-pa,ta.bottom)});return{start:na,end:ia}}var f=a.display,h=a.doc,i=document.createDocumentFragment(),k=yc(a.display),m=k.left,o=Math.max(f.sizerWidth,hb(a)-f.sizer.offsetLeft)-k.right;f=b.from();b=b.to();if(f.line==b.line)e(f.line,f.ch,b.ch);else{var t=ha(h,f.line);k=ha(h,b.line);k=tb(t)==tb(k);f=e(f.line,f.ch,k?t.text.length+
1:null).end;b=e(b.line,k?0:null,b.ch).start;if(k)if(f.top<b.top-2){d(f.right,f.top,null,f.bottom);d(m,b.top,b.left,b.bottom)}else d(f.right,f.top,b.left-f.right,f.bottom);f.bottom<b.top&&d(m,f.bottom,null,b.top)}c.appendChild(i)}function Fb(a){if(a.state.focused){var b=a.display;clearInterval(b.blinker);var c=true;b.cursorDiv.style.visibility="";if(a.options.cursorBlinkRate>0)b.blinker=setInterval(function(){b.cursorDiv.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate);else if(a.options.cursorBlinkRate<
0)b.cursorDiv.style.visibility="hidden"}}function db(a,b){a.doc.mode.startState&&a.doc.frontier<a.display.viewTo&&a.state.highlight.set(b,ob($c,a))}function $c(a){var b=a.doc;if(b.frontier<b.first)b.frontier=b.first;if(!(b.frontier>=a.display.viewTo)){var c=+new Date+a.options.workTime,d=gc(b.mode,fb(a,b.frontier)),e=[];b.iter(b.frontier,Math.min(b.first+b.size,a.display.viewTo+500),function(f){if(b.frontier>=a.display.viewFrom){var h=f.styles,i=ue(a,f,d,true);f.styles=i.styles;var k=f.styleClasses;
if(i=i.classes)f.styleClasses=i;else if(k)f.styleClasses=null;k=!h||h.length!=f.styles.length||k!=i&&(!k||!i||k.bgClass!=i.bgClass||k.textClass!=i.textClass);for(i=0;!k&&i<h.length;++i)k=h[i]!=f.styles[i];k&&e.push(b.frontier);f.stateAfter=gc(b.mode,d)}else{Md(a,f.text,d);f.stateAfter=b.frontier%5==0?gc(b.mode,d):null}++b.frontier;if(+new Date>c){db(a,a.options.workDelay);return true}});e.length&&Gb(a,function(){for(var f=0;f<e.length;f++)xb(a,e[f],"text")})}}function hc(a,b,c){for(var d,e,f=a.doc,
h=c?-1:b-(a.doc.mode.innerMode?1E3:100);b>h;--b){if(b<=f.first)return f.first;var i=ha(f,b-1);if(i.stateAfter&&(!c||b<=f.frontier))return b;i=kb(i.text,null,a.options.tabSize);if(e==null||d>i){e=b-1;d=i}}return e}function fb(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return true;var f=hc(a,b,c),h=f>d.first&&ha(d,f-1).stateAfter;h=h?gc(d.mode,h):Af(d.mode);d.iter(f,b,function(i){Md(a,i.text,h);i.stateAfter=f==b-1||f%5==0||f>=e.viewFrom&&f<e.viewTo?gc(d.mode,h):null;++f});if(c)d.frontier=
f;return h}function yc(a){if(a.cachedPaddingH)return a.cachedPaddingH;var b=rb(a.measure,ga("pre","x"));b=window.getComputedStyle?window.getComputedStyle(b):b.currentStyle;b={left:parseInt(b.paddingLeft),right:parseInt(b.paddingRight)};if(!isNaN(b.left)&&!isNaN(b.right))a.cachedPaddingH=b;return b}function Za(a){return oe-a.display.nativeBarWidth}function hb(a){return a.display.scroller.clientWidth-Za(a)-a.display.barWidth}function Db(a){return a.display.scroller.clientHeight-Za(a)-a.display.barHeight}
function ad(a,b){if(b>=a.display.viewFrom&&b<a.display.viewTo)return a.display.view[wc(a,b)];var c=a.display.externalMeasured;if(c&&b>=c.lineN&&b<c.lineN+c.size)return c}function ub(a,b){var c=La(b),d=ad(a,c);if(d&&!d.text)d=null;else d&&d.changes&&ra(a,d,c,ba(a));if(!d){var e;e=tb(b);d=La(e);e=a.display.externalMeasured=new ve(a.doc,e,d);e.lineN=d;d=e.built=re(a,e);e.text=d.pre;rb(a.display.lineMeasure,d.pre);d=e}a:{e=d;if(e.line==b)c={map:e.measure.map,cache:e.measure.cache};else{for(var f=0;f<
e.rest.length;f++)if(e.rest[f]==b){c={map:e.measure.maps[f],cache:e.measure.caches[f]};break a}for(f=0;f<e.rest.length;f++)if(La(e.rest[f])>c){c={map:e.measure.maps[f],cache:e.measure.caches[f],before:true};break a}c=void 0}}return{line:b,view:d,rect:null,map:c.map,cache:c.cache,before:c.before,hasHeights:false}}function Hb(a,b,c,d,e){if(b.before)c=-1;var f=c+(d||"");if(b.cache.hasOwnProperty(f))a=b.cache[f];else{if(!b.rect)b.rect=b.view.text.getBoundingClientRect();if(!b.hasHeights){var h=b.view,
i=b.rect,k=a.options.lineWrapping,m=k&&hb(a);if(!h.measure.heights||k&&h.measure.width!=m){var o=h.measure.heights=[];if(k){h.measure.width=m;h=h.text.firstChild.getClientRects();for(k=0;k<h.length-1;k++){m=h[k];var t=h[k+1];Math.abs(m.bottom-t.bottom)>2&&o.push((m.bottom+t.top)/2-i.top)}}o.push(i.bottom-i.top)}b.hasHeights=true}i=d;o=b.map;var p,D,L,ea;for(d=0;d<o.length;d+=3){var fa=o[d],na=o[d+1];if(c<fa){D=0;L=1;ea="left"}else if(c<na){D=c-fa;L=D+1}else if(d==o.length-3||c==na&&o[d+3]>c){L=na-
fa;D=L-1;if(c>=na)ea="right"}if(D!=null){p=o[d+2];if(fa==na&&i==(p.insertLeft?"left":"right"))ea=i;if(i=="left"&&D==0)for(;d&&o[d-2]==o[d-3]&&o[d-1].insertLeft;){p=o[(d-=3)+2];ea="left"}if(i=="right"&&D==na-fa)for(;d<o.length-3&&o[d+3]==o[d+4]&&!o[d+5].insertLeft;){p=o[(d+=3)+2];ea="right"}break}}var ia;if(p.nodeType==3){for(d=0;d<4;d++){for(;D&&zc(b.line.text.charAt(fa+D));)--D;for(;fa+L<na&&zc(b.line.text.charAt(fa+L));)++L;if(va&&Fa<9&&D==0&&L==na-fa)ia=p.parentNode.getBoundingClientRect();else if(va&&
a.options.lineWrapping){var da=ic(p,D,L).getClientRects();ia=da.length?da[i=="right"?da.length-1:0]:Nd}else ia=ic(p,D,L).getBoundingClientRect()||Nd;if(ia.left||ia.right||D==0)break;L=D;D-=1;ea="right"}if(va&&Fa<11){if(!(c=!window.screen))if(!(c=screen.logicalXDPI==null))if(!(c=screen.logicalXDPI==screen.deviceXDPI)){if(Od!=null)c=Od;else{L=rb(a.display.measure,ga("span","x"));c=L.getBoundingClientRect();L=ic(L,0,1).getBoundingClientRect();c=Od=Math.abs(c.left-L.left)>1}c=!c}if(!c){c=screen.logicalXDPI/
screen.deviceXDPI;L=screen.logicalYDPI/screen.deviceYDPI;ia={left:ia.left*c,right:ia.right*c,top:ia.top*L,bottom:ia.bottom*L}}}}else{if(D>0)ea=i="right";ia=a.options.lineWrapping&&(da=p.getClientRects()).length>1?da[i=="right"?da.length-1:0]:p.getBoundingClientRect()}if(va&&Fa<9&&!D&&(!ia||!ia.left&&!ia.right))ia=(p=p.parentNode.getClientRects()[0])?{left:p.left,right:p.left+sc(a.display),top:p.top,bottom:p.bottom}:Nd;p=ia.top-b.rect.top;D=ia.bottom-b.rect.top;c=(p+D)/2;L=b.view.measure.heights;for(d=
0;d<L.length-1;d++)if(c<L[d])break;ea={left:(ea=="right"?ia.right:ia.left)-b.rect.left,right:(ea=="left"?ia.left:ia.right)-b.rect.left,top:d?L[d-1]:0,bottom:L[d]};if(!ia.left&&!ia.right)ea.bogus=true;if(!a.options.singleCursorHeightPerLine){ea.rtop=p;ea.rbottom=D}a=ea;a.bogus||(b.cache[f]=a)}return{left:a.left,right:a.right,top:e?a.rtop:a.top,bottom:e?a.rbottom:a.bottom}}function bd(a){if(a.measure){a.measure.cache={};a.measure.heights=null;if(a.rest)for(var b=0;b<a.rest.length;b++)a.measure.caches[b]=
{}}}function cd(a){a.display.externalMeasure=null;Ob(a.display.lineMeasure);for(var b=0;b<a.display.view.length;b++)bd(a.display.view[b])}function aa(a){cd(a);a.display.cachedCharWidth=a.display.cachedTextHeight=a.display.cachedPaddingH=null;if(!a.options.lineWrapping)a.display.maxLineChanged=true;a.display.lineNumChars=null}function Ac(a,b,c,d){if(b.widgets)for(var e=0;e<b.widgets.length;++e)if(b.widgets[e].above){var f=Bc(b.widgets[e]);c.top+=f;c.bottom+=f}if(d=="line")return c;d||(d="local");b=
wb(b);if(d=="local")b+=a.display.lineSpace.offsetTop;else b-=a.display.viewOffset;if(d=="page"||d=="window"){a=a.display.lineSpace.getBoundingClientRect();b+=a.top+(d=="window"?0:window.pageYOffset||(document.documentElement||document.body).scrollTop);d=a.left+(d=="window"?0:window.pageXOffset||(document.documentElement||document.body).scrollLeft);c.left+=d;c.right+=d}c.top+=b;c.bottom+=b;return c}function n(a,b,c){if(c=="div")return b;var d=b.left;b=b.top;if(c=="page"){d-=window.pageXOffset||(document.documentElement||
document.body).scrollLeft;b-=window.pageYOffset||(document.documentElement||document.body).scrollTop}else if(c=="local"||!c){c=a.display.sizer.getBoundingClientRect();d+=c.left;b+=c.top}a=a.display.lineSpace.getBoundingClientRect();return{left:d-a.left,top:b-a.top}}function I(a,b,c,d,e){d||(d=ha(a.doc,b.line));return Ac(a,d,Hb(a,ub(a,d),b.ch,e),c)}function N(a,b,c,d,e,f){function h(o,t){var p=Hb(a,e,o,t?"right":"left",f);if(t)p.left=p.right;else p.right=p.left;return Ac(a,d,p,c)}function i(o,t){var p=
k[t],D=p.level%2;if(o==(p.level%2?p.to:p.from)&&t&&p.level<k[t-1].level){p=k[--t];o=Pd(p)-(p.level%2?0:1);D=true}else if(o==Pd(p)&&t<k.length-1&&p.level<k[t+1].level){p=k[++t];o=(p.level%2?p.to:p.from)-p.level%2;D=false}if(D&&o==p.to&&o>p.from)return h(o-1);return h(o,D)}d=d||ha(a.doc,b.line);e||(e=ub(a,d));var k=sb(d);b=b.ch;if(!k)return h(b);var m=Qd(k,b);m=i(b,m);if(Cc!=null)m.other=i(b,Cc);return m}function K(a,b){var c=0;b=Y(a.doc,b);a.options.lineWrapping||(c=sc(a.display)*b.ch);var d=ha(a.doc,
b.line),e=wb(d)+a.display.lineSpace.offsetTop;return{left:c,right:c,top:e,bottom:e+d.height}}function ka(a,b,c,d){a=W(a,b);a.xRel=d;if(c)a.outside=true;return a}function za(a,b,c){var d=a.doc;c+=a.display.viewOffset;if(c<0)return ka(d.first,0,true,-1);var e=Qb(d,c),f=d.first+d.size-1;if(e>f)return ka(d.first+d.size-1,ha(d,f).text.length,true,1);if(b<0)b=0;for(d=ha(d,e);;){e=Ra(a,d,e,b,c);f=(d=Pb(d,false))&&d.find(0,true);if(d&&(e.ch>f.from.ch||e.ch==f.from.ch&&e.xRel>0))e=La(d=f.to.line);else return e}}
function Ra(a,b,c,d,e){function f(Ca){Ca=N(a,W(c,Ca),"line",b,m);i=true;if(h>Ca.bottom)return Ca.left-k;else if(h<Ca.top)return Ca.left+k;else i=false;return Ca.left}var h=e-wb(b),i=false,k=2*a.display.wrapper.clientWidth,m=ub(a,b),o=sb(b),t=b.text.length;e=dd(b);var p=ed(b),D=f(e),L=i,ea=f(p),fa=i;if(d>ea)return ka(c,p,fa,1);for(;;){if(o?p==e||p==Rd(b,e,1):p-e<=1){o=d<D||d-D<=ea-d?e:p;for(d-=o==e?D:ea;zc(b.text.charAt(o));)++o;return ka(c,o,o==e?L:fa,d<-1?-1:d>1?1:0)}var na=Math.ceil(t/2),ia=e+na;
if(o){ia=e;for(var da=0;da<na;++da)ia=Rd(b,ia,1)}da=f(ia);if(da>d){p=ia;ea=da;if(fa=i)ea+=1E3;t=na}else{e=ia;D=da;L=i;t-=na}}}function vb(a){if(a.cachedTextHeight!=null)return a.cachedTextHeight;if(Sb==null){Sb=ga("pre");for(var b=0;b<49;++b){Sb.appendChild(document.createTextNode("x"));Sb.appendChild(ga("br"))}Sb.appendChild(document.createTextNode("x"))}rb(a.measure,Sb);b=Sb.offsetHeight/50;if(b>3)a.cachedTextHeight=b;Ob(a.measure);return b||1}function sc(a){if(a.cachedCharWidth!=null)return a.cachedCharWidth;
var b=ga("span","xxxxxxxxxx"),c=ga("pre",[b]);rb(a.measure,c);b=b.getBoundingClientRect();b=(b.right-b.left)/10;if(b>2)a.cachedCharWidth=b;return b||10}function Lb(a){a.curOp={cm:a,viewChanged:false,startHeight:a.doc.height,forceUpdate:false,updateInput:null,typing:false,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:false,updateMaxLine:false,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++Bf};if(jc)jc.ops.push(a.curOp);else a.curOp.ownsGroup=jc={ops:[a.curOp],
delayedCallbacks:[]}}function Mb(a){if(a=a.curOp.ownsGroup)try{var b=a.delayedCallbacks,c=0;do{for(;c<b.length;c++)b[c]();for(var d=0;d<a.ops.length;d++){var e=a.ops[d];if(e.cursorActivityHandlers)for(;e.cursorActivityCalled<e.cursorActivityHandlers.length;)e.cursorActivityHandlers[e.cursorActivityCalled++](e.cm)}}while(c<b.length)}finally{jc=null;for(b=0;b<a.ops.length;b++)a.ops[b].cm.curOp=null;a=a.ops;for(b=0;b<a.length;b++){e=a[b];c=e.cm;d=c.display;var f=c,h=f.display;if(!h.scrollbarsClipped&&
h.scroller.offsetWidth){h.nativeBarWidth=h.scroller.offsetWidth-h.scroller.clientWidth;h.heightForcer.style.height=Za(f)+"px";h.sizer.style.marginBottom=-h.nativeBarWidth+"px";h.sizer.style.borderRightWidth=Za(f)+"px";h.scrollbarsClipped=true}e.updateMaxLine&&x(c);e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<d.viewFrom||e.scrollToPos.to.line>=d.viewTo)||d.maxLineChanged&&c.options.lineWrapping;e.update=e.mustUpdate&&new Ja(c,e.mustUpdate&&{top:e.scrollTop,
ensure:e.scrollToPos},e.forceUpdate)}for(b=0;b<a.length;b++){e=a[b];e.updatedDisplay=e.mustUpdate&&Ea(e.cm,e.update)}for(b=0;b<a.length;b++){e=a[b];c=e.cm;d=c.display;e.updatedDisplay&&G(c);e.barMeasure=H(c);if(d.maxLineChanged&&!c.options.lineWrapping){e.adjustWidthTo=Hb(c,ub(c,d.maxLine),d.maxLine.text.length,void 0).left+3;c.display.sizerWidth=e.adjustWidthTo;e.barMeasure.scrollWidth=Math.max(d.scroller.clientWidth,d.sizer.offsetLeft+e.adjustWidthTo+Za(c)+c.display.barWidth);e.maxScrollLeft=Math.max(0,
d.sizer.offsetLeft+e.adjustWidthTo-hb(c))}if(e.updatedDisplay||e.selectionChanged)e.newSelectionNodes=xc(c)}for(b=0;b<a.length;b++){e=a[b];c=e.cm;if(e.adjustWidthTo!=null){c.display.sizer.style.minWidth=e.adjustWidthTo+"px";e.maxScrollLeft<c.doc.scrollLeft&&ac(c,Math.min(c.display.scroller.scrollLeft,e.maxScrollLeft),true);c.display.maxLineChanged=false}e.newSelectionNodes&&fc(c,e.newSelectionNodes);e.updatedDisplay&&C(c,e.barMeasure);if(e.updatedDisplay||e.startHeight!=c.doc.height)y(c,e.barMeasure);
e.selectionChanged&&Fb(c);c.state.focused&&e.updateInput&&gb(c,e.typing)}for(b=0;b<a.length;b++){e=a[b];c=e.cm;d=c.display;f=c.doc;e.updatedDisplay&&S(c,e.update);if(d.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos))d.wheelStartX=d.wheelStartY=null;if(e.scrollTop!=null&&(d.scroller.scrollTop!=e.scrollTop||e.forceScroll)){f.scrollTop=Math.max(0,Math.min(d.scroller.scrollHeight-d.scroller.clientHeight,e.scrollTop));d.scrollbars.setScrollTop(f.scrollTop);d.scroller.scrollTop=
f.scrollTop}if(e.scrollLeft!=null&&(d.scroller.scrollLeft!=e.scrollLeft||e.forceScroll)){f.scrollLeft=Math.max(0,Math.min(d.scroller.scrollWidth-hb(c),e.scrollLeft));d.scrollbars.setScrollLeft(f.scrollLeft);d.scroller.scrollLeft=f.scrollLeft;Ga(c)}if(e.scrollToPos){var i=void 0;h=Y(f,e.scrollToPos.from);i=Y(f,e.scrollToPos.to);var k=e.scrollToPos.margin;if(k==null)k=0;for(var m=0;m<5;m++){var o=false,t=N(c,h),p=!i||i==h?t:N(c,i);p=fd(c,Math.min(t.left,p.left),Math.min(t.top,p.top)-k,Math.max(t.left,
p.left),Math.max(t.bottom,p.bottom)+k);var D=c.doc.scrollTop,L=c.doc.scrollLeft;if(p.scrollTop!=null){uc(c,p.scrollTop);if(Math.abs(c.doc.scrollTop-D)>1)o=true}if(p.scrollLeft!=null){ac(c,p.scrollLeft);if(Math.abs(c.doc.scrollLeft-L)>1)o=true}if(!o)break}i=t;if(e.scrollToPos.isCursor&&c.state.focused)if(!lb(c,"scrollCursorIntoView")){k=c.display;m=k.sizer.getBoundingClientRect();h=null;if(i.top+m.top<0)h=true;else if(i.bottom+m.top>(window.innerHeight||document.documentElement.clientHeight))h=false;
if(h!=null&&!Cf){i=ga("div","\u200b",null,"position: absolute; top: "+(i.top-k.viewOffset-c.display.lineSpace.offsetTop)+"px; height: "+(i.bottom-i.top+Za(c)+k.barHeight)+"px; left: "+i.left+"px; width: 2px;");c.display.lineSpace.appendChild(i);i.scrollIntoView(h);c.display.lineSpace.removeChild(i)}}}h=e.maybeHiddenMarkers;i=e.maybeUnhiddenMarkers;if(h)for(k=0;k<h.length;++k)h[k].lines.length||Oa(h[k],"hide");if(i)for(k=0;k<i.length;++k)i[k].lines.length&&Oa(i[k],"unhide");if(d.wrapper.offsetHeight)f.scrollTop=
c.display.scroller.scrollTop;e.changeObjs&&Oa(c,"changes",c,e.changeObjs)}}}function Gb(a,b){if(a.curOp)return b();Lb(a);try{return b()}finally{Mb(a)}}function Pa(a,b){return function(){if(a.curOp)return b.apply(a,arguments);Lb(a);try{return b.apply(a,arguments)}finally{Mb(a)}}}function Sa(a){return function(){if(this.curOp)return a.apply(this,arguments);Lb(this);try{return a.apply(this,arguments)}finally{Mb(this)}}}function Wa(a){return function(){var b=this.cm;if(!b||b.curOp)return a.apply(this,
arguments);Lb(b);try{return a.apply(this,arguments)}finally{Mb(b)}}}function ve(a,b,c){for(var d=this.line=b,e;d=Pb(d,false);){d=d.find(1,true).line;(e||(e=[])).push(d)}this.size=(this.rest=e)?La(Ia(this.rest))-c+1:1;this.node=this.text=null;this.hidden=Nb(a,b)}function Vc(a,b,c){var d=[],e;for(e=b;e<c;){b=new ve(a.doc,ha(a.doc,e),e);e+=b.size;d.push(b)}return d}function ab(a,b,c,d){if(b==null)b=a.doc.first;if(c==null)c=a.doc.first+a.doc.size;d||(d=0);var e=a.display;if(d&&c<e.viewTo&&(e.updateLineNumbers==
null||e.updateLineNumbers>b))e.updateLineNumbers=b;a.curOp.viewChanged=true;if(b>=e.viewTo)Cb&&Kd(a.doc,b)<e.viewTo&&Bb(a);else if(c<=e.viewFrom)if(Cb&&qe(a.doc,c+d)>e.viewFrom)Bb(a);else{e.viewFrom+=d;e.viewTo+=d}else if(b<=e.viewFrom&&c>=e.viewTo)Bb(a);else if(b<=e.viewFrom){var f=gd(a,c,c+d,1);if(f){e.view=e.view.slice(f.index);e.viewFrom=f.lineN;e.viewTo+=d}else Bb(a)}else if(c>=e.viewTo)if(f=gd(a,b,b,-1)){e.view=e.view.slice(0,f.index);e.viewTo=f.lineN}else Bb(a);else{f=gd(a,b,b,-1);var h=gd(a,
c,c+d,1);if(f&&h){e.view=e.view.slice(0,f.index).concat(Vc(a,f.lineN,h.lineN)).concat(e.view.slice(h.index));e.viewTo+=d}else Bb(a)}if(a=e.externalMeasured)if(c<a.lineN)a.lineN+=d;else if(b<a.lineN+a.size)e.externalMeasured=null}function xb(a,b,c){a.curOp.viewChanged=true;var d=a.display,e=a.display.externalMeasured;if(e&&b>=e.lineN&&b<e.lineN+e.size)d.externalMeasured=null;if(!(b<d.viewFrom||b>=d.viewTo)){a=d.view[wc(a,b)];if(a.node!=null){a=a.changes||(a.changes=[]);Ua(a,c)==-1&&a.push(c)}}}function Bb(a){a.display.viewFrom=
a.display.viewTo=a.doc.first;a.display.view=[];a.display.viewOffset=0}function wc(a,b){if(b>=a.display.viewTo)return null;b-=a.display.viewFrom;if(b<0)return null;for(var c=a.display.view,d=0;d<c.length;d++){b-=c[d].size;if(b<0)return d}}function gd(a,b,c,d){var e=wc(a,b),f=a.display.view;if(!Cb||c==a.doc.first+a.doc.size)return{index:e,lineN:c};for(var h=0,i=a.display.viewFrom;h<e;h++)i+=f[h].size;if(i!=b){if(d>0){if(e==f.length-1)return null;b=i+f[e].size-b;e++}else b=i-b;c+=b}for(;Kd(a.doc,c)!=
c;){if(e==(d<0?0:f.length-1))return null;c+=d*f[e-(d<0?1:0)].size;e+=d}return{index:e,lineN:c}}function pe(a){a=a.display.view;for(var b=0,c=0;c<a.length;c++){var d=a[c];if(!d.hidden&&(!d.node||d.changes))++b}return b}function hd(a){a.display.pollingFast||a.display.poll.set(a.options.pollInterval,function(){id(a);a.state.focused&&hd(a)})}function jd(a){function b(){if(!id(a)&&!c){c=true;a.display.poll.set(60,b)}else{a.display.pollingFast=false;hd(a)}}var c=false;a.display.pollingFast=true;a.display.poll.set(20,
b)}function id(a){var b=a.display.input,c=a.display.prevInput,d=a.doc;if(!a.state.focused||Df(b)&&!c||kd(a)||a.options.disableInput||a.state.keySeq)return false;if(a.state.pasteIncoming&&a.state.fakedLastChar){b.value=b.value.substring(0,b.value.length-1);a.state.fakedLastChar=false}var e=b.value;if(e==c&&!a.somethingSelected())return false;if(va&&Fa>=9&&a.display.inputHasSelection===e||ib&&/[\uf700-\uf7ff]/.test(e)){gb(a);return false}var f=!a.curOp;f&&Lb(a);a.display.shift=false;if(e.charCodeAt(0)==
8203&&d.sel==a.display.selForContextMenu&&!c)c="\u200b";for(var h=0,i=Math.min(c.length,e.length);h<i&&c.charCodeAt(h)==e.charCodeAt(h);)++h;i=e.slice(h);var k=Tb(i),m=null;if(a.state.pasteIncoming&&d.sel.ranges.length>1)if(Ub&&Ub.join("\n")==i)m=d.sel.ranges.length%Ub.length==0&&Dc(Ub,Tb);else if(k.length==d.sel.ranges.length)m=Dc(k,function(ea){return[ea]});for(var o=d.sel.ranges.length-1;o>=0;o--){var t=d.sel.ranges[o],p=t.from(),D=t.to();if(h<c.length)p=W(p.line,p.ch-(c.length-h));else if(a.state.overwrite&&
t.empty()&&!a.state.pasteIncoming)D=W(D.line,Math.min(ha(d,D.line).text.length,D.ch+Ia(k).length));var L=a.curOp.updateInput;p={from:p,to:D,text:m?m[o%m.length]:k,origin:a.state.pasteIncoming?"paste":a.state.cutIncoming?"cut":"+input"};kc(a.doc,p);Qa(a,"inputRead",a,p);if(i&&!a.state.pasteIncoming&&a.options.electricChars&&a.options.smartIndent&&t.head.ch<100&&(!o||d.sel.ranges[o-1].head.line!=t.head.line)){t=a.getModeAt(t.head);p=Ib(p);if(t.electricChars)for(D=0;D<t.electricChars.length;D++){if(i.indexOf(t.electricChars.charAt(D))>
-1){Ec(a,p.line,"smart");break}}else t.electricInput&&t.electricInput.test(ha(d,p.line).text.slice(0,p.ch))&&Ec(a,p.line,"smart")}}dc(a);a.curOp.updateInput=L;a.curOp.typing=true;if(e.length>1E3||e.indexOf("\n")>-1)b.value=a.display.prevInput="";else a.display.prevInput=e;f&&Mb(a);a.state.pasteIncoming=a.state.cutIncoming=false;return true}function gb(a,b){if(!a.display.contextMenuPending){var c,d,e=a.doc;if(a.somethingSelected()){a.display.prevInput="";c=e.sel.primary();d=(c=we&&(c.to().line-c.from().line>
100||(d=a.getSelection()).length>1E3))?"-":d||a.getSelection();a.display.input.value=d;a.state.focused&&Fc(a.display.input);if(va&&Fa>=9)a.display.inputHasSelection=d}else if(!b){a.display.prevInput=a.display.input.value="";if(va&&Fa>=9)a.display.inputHasSelection=null}a.display.inaccurateSelection=c}}function $a(a){if(a.options.readOnly!="nocursor"&&(!Gd||Ab()!=a.display.input))a.display.input.focus()}function Sd(a){if(!a.state.focused){$a(a);Hd(a)}}function kd(a){return a.options.readOnly||a.doc.cantEdit}
function xf(a){function b(e){lb(a,e)||Td(e)}function c(e){if(a.somethingSelected()){Ub=a.getSelections();if(d.inaccurateSelection){d.prevInput="";d.inaccurateSelection=false;d.input.value=Ub.join("\n");Fc(d.input)}}else{for(var f=[],h=[],i=0;i<a.doc.sel.ranges.length;i++){var k=a.doc.sel.ranges[i].head.line;k={anchor:W(k,0),head:W(k+1,0)};h.push(k);f.push(a.getRange(k.anchor,k.head))}if(e.type=="cut")a.setSelections(h,null,Eb);else{d.prevInput="";d.input.value=f.join("\n");Fc(d.input)}Ub=f}if(e.type==
"cut")a.state.cutIncoming=true}var d=a.display;qa(d.scroller,"mousedown",Pa(a,xe));va&&Fa<11?qa(d.scroller,"dblclick",Pa(a,function(e){if(!lb(a,e)){var f=lc(a,e);if(!(!f||Ud(a,e,"gutterClick",true,Qa)||Vb(a.display,e))){Xa(e);e=a.findWordAt(f);xa(a.doc,e.anchor,e.head)}}})):qa(d.scroller,"dblclick",function(e){lb(a,e)||Xa(e)});qa(d.lineSpace,"selectstart",function(e){Vb(d,e)||Xa(e)});Vd||qa(d.scroller,"contextmenu",function(e){ye(a,e)});qa(d.scroller,"scroll",function(){if(d.scroller.clientHeight){uc(a,
d.scroller.scrollTop);ac(a,d.scroller.scrollLeft,true);Oa(a,"scroll",a)}});qa(d.scroller,"mousewheel",function(e){ze(a,e)});qa(d.scroller,"DOMMouseScroll",function(e){ze(a,e)});qa(d.wrapper,"scroll",function(){d.wrapper.scrollTop=d.wrapper.scrollLeft=0});qa(d.input,"keyup",function(e){Ae.call(a,e)});qa(d.input,"input",function(){if(va&&Fa>=9&&a.display.inputHasSelection)a.display.inputHasSelection=null;id(a)});qa(d.input,"keydown",Pa(a,Be));qa(d.input,"keypress",Pa(a,Ce));qa(d.input,"focus",ob(Hd,
a));qa(d.input,"blur",ob(Uc,a));if(a.options.dragDrop){qa(d.scroller,"dragstart",function(e){var f=a;if(va&&(!f.state.draggingText||+new Date-De<100))Td(e);else if(!(lb(f,e)||Vb(f.display,e))){e.dataTransfer.setData("Text",f.getSelection());if(e.dataTransfer.setDragImage&&!Ee){var h=ga("img",null,null,"position: fixed; left: 0; top: 0;");h.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";if(mb){h.width=h.height=1;f.display.wrapper.appendChild(h);h._top=h.offsetTop}e.dataTransfer.setDragImage(h,
0,0);mb&&h.parentNode.removeChild(h)}}});qa(d.scroller,"dragenter",b);qa(d.scroller,"dragover",b);qa(d.scroller,"drop",Pa(a,Ef))}qa(d.scroller,"paste",function(e){if(!Vb(d,e)){a.state.pasteIncoming=true;$a(a);jd(a)}});qa(d.input,"paste",function(){if(Na&&!a.state.fakedLastChar&&!(new Date-a.state.lastMiddleDown<200)){var e=d.input.selectionStart,f=d.input.selectionEnd;d.input.value+="$";d.input.selectionEnd=f;d.input.selectionStart=e;a.state.fakedLastChar=true}a.state.pasteIncoming=true;jd(a)});qa(d.input,
"cut",c);qa(d.input,"copy",c);Jd&&qa(d.sizer,"mouseup",function(){Ab()==d.input&&d.input.blur();$a(a)})}function Ff(a){var b=a.display;if(!(b.lastWrapHeight==b.wrapper.clientHeight&&b.lastWrapWidth==b.wrapper.clientWidth)){b.cachedCharWidth=b.cachedTextHeight=b.cachedPaddingH=null;b.scrollbarsClipped=false;a.setSize()}}function Vb(a,b){for(var c=b.target||b.srcElement;c!=a.wrapper;c=c.parentNode)if(!c||c.nodeType==1&&c.getAttribute("cm-ignore-events")=="true"||c.parentNode==a.sizer&&c!=a.mover)return true}
function lc(a,b,c,d){var e=a.display;if(!c&&(b.target||b.srcElement).getAttribute("not-content")=="true")return null;var f,h;c=e.lineSpace.getBoundingClientRect();try{f=b.clientX-c.left;h=b.clientY-c.top}catch(i){return null}b=za(a,f,h);var k;if(d&&b.xRel==1&&(k=ha(a.doc,b.line).text).length==b.ch){d=kb(k,k.length,a.options.tabSize)-k.length;b=W(b.line,Math.max(0,Math.round((f-yc(a.display).left)/sc(a.display))-d))}return b}function xe(a){if(!lb(this,a)){var b=this.display;b.shift=a.shiftKey;if(Vb(b,
a)){if(!Na){b.scroller.draggable=false;setTimeout(function(){b.scroller.draggable=true},100)}}else if(!Ud(this,a,"gutterClick",true,Qa)){var c=lc(this,a);window.focus();switch(Fe(a)){case 1:if(c)Gf(this,a,c);else(a.target||a.srcElement)==b.scroller&&Xa(a);break;case 2:if(Na)this.state.lastMiddleDown=+new Date;c&&xa(this.doc,c);setTimeout(ob($a,this),20);Xa(a);break;case 3:Vd&&ye(this,a)}}}}function Gf(a,b,c){setTimeout(ob(Sd,a),0);var d=+new Date,e;if(ld&&ld.time>d-400&&sa(ld.pos,c)==0)e="triple";
else if(md&&md.time>d-400&&sa(md.pos,c)==0){e="double";ld={time:d,pos:c}}else{e="single";md={time:d,pos:c}}d=a.doc.sel;var f=ib?b.metaKey:b.ctrlKey,h;a.options.dragDrop&&Hf&&!kd(a)&&e=="single"&&(h=d.contains(c))>-1&&!d.ranges[h].empty()?If(a,b,c,f):Jf(a,b,c,e,f)}function If(a,b,c,d){var e=a.display,f=Pa(a,function(h){if(Na)e.scroller.draggable=false;a.state.draggingText=false;yb(document,"mouseup",f);yb(e.scroller,"drop",f);if(Math.abs(b.clientX-h.clientX)+Math.abs(b.clientY-h.clientY)<10){Xa(h);
d||xa(a.doc,c);$a(a);va&&Fa==9&&setTimeout(function(){document.body.focus();$a(a)},20)}});if(Na)e.scroller.draggable=true;a.state.draggingText=f;e.scroller.dragDrop&&e.scroller.dragDrop();qa(document,"mouseup",f);qa(e.scroller,"drop",f)}function Jf(a,b,c,d,e){function f(da){if(sa(L,da)!=0){L=da;if(d=="rect"){var Ca=[],pa=a.options.tabSize,ya=kb(ha(m,c.line).text,c.ch,pa),ta=kb(ha(m,da.line).text,da.ch,pa),Da=Math.min(ya,ta);ya=Math.max(ya,ta);ta=Math.min(c.line,da.line);for(var Ta=Math.min(a.lastLine(),
Math.max(c.line,da.line));ta<=Ta;ta++){var nb=ha(m,ta).text,nd=Ge(nb,Da,pa);if(Da==ya)Ca.push(new s(W(ta,nd),W(ta,nd)));else nb.length>nd&&Ca.push(new s(W(ta,nd),W(ta,Ge(nb,ya,pa))))}Ca.length||Ca.push(new s(c,c));Ma(m,U(p.ranges.slice(0,t).concat(Ca),t),{origin:"*mouse",scroll:false});a.scrollIntoView(da)}else{Ca=o;pa=Ca.anchor;Da=da;if(d!="single"){da=d=="double"?a.findWordAt(da):new s(W(da.line,0),Y(m,W(da.line+1,0)));if(sa(da.anchor,pa)>0){Da=da.head;pa=r(Ca.from(),da.anchor)}else{Da=da.anchor;
pa=R(Ca.to(),da.head)}}Ca=p.ranges.slice(0);Ca[t]=new s(Y(m,pa),Da);Ma(m,U(Ca,t),Wd)}}}function h(da){var Ca=++fa,pa=lc(a,da,true,d=="rect");if(pa)if(sa(pa,L)!=0){Sd(a);f(pa);var ya=$(k,m);if(pa.line>=ya.to||pa.line<ya.from)setTimeout(Pa(a,function(){fa==Ca&&h(da)}),150)}else{var ta=da.clientY<ea.top?-20:da.clientY>ea.bottom?20:0;ta&&setTimeout(Pa(a,function(){if(fa==Ca){k.scroller.scrollTop+=ta;h(da)}}),50)}}function i(da){fa=Infinity;Xa(da);$a(a);yb(document,"mousemove",na);yb(document,"mouseup",
ia);m.history.lastSelOrigin=null}var k=a.display,m=a.doc;Xa(b);var o,t,p=m.sel,D=p.ranges;if(e&&!b.shiftKey){t=m.sel.contains(c);o=t>-1?D[t]:new s(c,c)}else o=m.sel.primary();if(b.altKey){d="rect";e||(o=new s(c,c));c=lc(a,b,true,true);t=-1}else if(d=="double"){b=a.findWordAt(c);o=a.display.shift||m.extend?Ha(m,o,b.anchor,b.head):b}else if(d=="triple"){b=new s(W(c.line,0),Y(m,W(c.line+1,0)));o=a.display.shift||m.extend?Ha(m,o,b.anchor,b.head):b}else o=Ha(m,o,c);if(e)if(t==-1){t=D.length;Ma(m,U(D.concat([o]),
t),{scroll:false,origin:"*mouse"})}else if(D.length>1&&D[t].empty()&&d=="single"){Ma(m,U(D.slice(0,t).concat(D.slice(t+1)),0));p=m.sel}else Ba(m,t,o,Wd);else{t=0;Ma(m,new F([o],0),Wd);p=m.sel}var L=c,ea=k.wrapper.getBoundingClientRect(),fa=0,na=Pa(a,function(da){Fe(da)?h(da):i(da)}),ia=Pa(a,i);qa(document,"mousemove",na);qa(document,"mouseup",ia)}function Ud(a,b,c,d,e){try{var f=b.clientX,h=b.clientY}catch(i){return false}if(f>=Math.floor(a.display.gutters.getBoundingClientRect().right))return false;
d&&Xa(b);d=a.display;var k=d.lineDiv.getBoundingClientRect();if(h>k.bottom||!jb(a,c))return Xd(b);h-=k.top-d.viewOffset;for(k=0;k<a.options.gutters.length;++k){var m=d.gutters.childNodes[k];if(m&&m.getBoundingClientRect().right>=f){f=Qb(a.doc,h);e(a,c,a,f,a.options.gutters[k],b);return Xd(b)}}}function Ef(a){var b=this;if(!(lb(b,a)||Vb(b.display,a))){Xa(a);if(va)De=+new Date;var c=lc(b,a,true),d=a.dataTransfer.files;if(!(!c||kd(b)))if(d&&d.length&&window.FileReader&&window.File){var e=d.length,f=
Array(e),h=0;a=function(o,t){var p=new FileReader;p.onload=Pa(b,function(){f[t]=p.result;if(++h==e){c=Y(b.doc,c);var D={from:c,to:c,text:Tb(f.join("\n")),origin:"paste"};kc(b.doc,D);cc(b.doc,ja(c,Ib(D)))}});p.readAsText(o)};for(var i=0;i<e;++i)a(d[i],i)}else if(b.state.draggingText&&b.doc.sel.contains(c)>-1){b.state.draggingText(a);setTimeout(ob($a,b),20)}else try{if(f=a.dataTransfer.getData("Text")){if(b.state.draggingText&&!(ib?a.metaKey:a.ctrlKey))var k=b.listSelections();qb(b.doc,ja(c,c));if(k)for(i=
0;i<k.length;++i)od(b.doc,"",k[i].anchor,k[i].head,"drag");b.replaceSelection(f,"around","paste");$a(b)}}catch(m){}}}function uc(a,b){if(!(Math.abs(a.doc.scrollTop-b)<2)){a.doc.scrollTop=b;Gc||T(a,{top:b});if(a.display.scroller.scrollTop!=b)a.display.scroller.scrollTop=b;a.display.scrollbars.setScrollTop(b);Gc&&T(a);db(a,100)}}function ac(a,b,c){if(!(c?b==a.doc.scrollLeft:Math.abs(a.doc.scrollLeft-b)<2)){b=Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth);a.doc.scrollLeft=
b;Ga(a);if(a.display.scroller.scrollLeft!=b)a.display.scroller.scrollLeft=b;a.display.scrollbars.setScrollLeft(b)}}function ze(a,b){var c=He(b),d=c.x;c=c.y;var e=a.display,f=e.scroller;if(d&&f.scrollWidth>f.clientWidth||c&&f.scrollHeight>f.clientHeight){if(c&&ib&&Na){var h=b.target,i=e.view;a:for(;h!=f;h=h.parentNode)for(var k=0;k<i.length;k++)if(i[k].node==h){a.display.currentWheelTarget=h;break a}}if(d&&!Gc&&!mb&&bb!=null){c&&uc(a,Math.max(0,Math.min(f.scrollTop+c*bb,f.scrollHeight-f.clientHeight)));
ac(a,Math.max(0,Math.min(f.scrollLeft+d*bb,f.scrollWidth-f.clientWidth)));Xa(b);e.wheelStartX=null}else{if(c&&bb!=null){h=c*bb;i=a.doc.scrollTop;k=i+e.wrapper.clientHeight;if(h<0)i=Math.max(0,i+h-50);else k=Math.min(a.doc.height,k+h+50);T(a,{top:i,bottom:k})}if(pd<20)if(e.wheelStartX==null){e.wheelStartX=f.scrollLeft;e.wheelStartY=f.scrollTop;e.wheelDX=d;e.wheelDY=c;setTimeout(function(){if(e.wheelStartX!=null){var m=f.scrollLeft-e.wheelStartX,o=f.scrollTop-e.wheelStartY;m=o&&e.wheelDY&&o/e.wheelDY||
m&&e.wheelDX&&m/e.wheelDX;e.wheelStartX=e.wheelStartY=null;if(m){bb=(bb*pd+m)/(pd+1);++pd}}},200)}else{e.wheelDX+=d;e.wheelDY+=c}}}}function qd(a,b,c){if(typeof b=="string"){b=rd[b];if(!b)return false}if(a.display.pollingFast&&id(a))a.display.pollingFast=false;var d=a.display.shift,e=false;try{if(kd(a))a.state.suppressEdits=true;if(c)a.display.shift=false;e=b(a)!=Ie}finally{a.display.shift=d;a.state.suppressEdits=false}return e}function Kf(a,b,c){for(var d=0;d<a.state.keyMaps.length;d++){var e=Hc(b,
a.state.keyMaps[d],c,a);if(e)return e}return a.options.extraKeys&&Hc(b,a.options.extraKeys,c,a)||Hc(b,a.options.keyMap,c,a)}function sd(a,b,c,d){var e=a.state.keySeq;if(e){if(Lf(b))return"handled";Mf.set(50,function(){if(a.state.keySeq==e){a.state.keySeq=null;gb(a)}});b=e+" "+b}d=Kf(a,b,d);if(d=="multi")a.state.keySeq=b;d=="handled"&&Qa(a,"keyHandled",a,b,c);if(d=="handled"||d=="multi"){Xa(c);Fb(a)}if(e&&!d&&/\'$/.test(b)){Xa(c);return true}return!!d}function Je(a,b){var c=Nf(b,true);if(!c)return false;
return b.shiftKey&&!a.state.keySeq?sd(a,"Shift-"+c,b,function(d){return qd(a,d,true)})||sd(a,c,b,function(d){if(typeof d=="string"?/^go[A-Z]/.test(d):d.motion)return qd(a,d)}):sd(a,c,b,function(d){return qd(a,d)})}function Of(a,b,c){return sd(a,"'"+c+"'",b,function(d){return qd(a,d,true)})}function Be(a){Sd(this);if(!lb(this,a)){if(va&&Fa<11&&a.keyCode==27)a.returnValue=false;var b=a.keyCode;this.display.shift=b==16||a.shiftKey;var c=Je(this,a);if(mb){Yd=c?b:null;if(!c&&b==88&&!we&&(ib?a.metaKey:
a.ctrlKey))this.replaceSelection("",null,"cut")}b==18&&!/\bCodeMirror-crosshair\b/.test(this.display.lineDiv.className)&&Pf(this)}}function Pf(a){function b(d){if(d.keyCode==18||!d.altKey){tc(c,"CodeMirror-crosshair");yb(document,"keyup",b);yb(document,"mouseover",b)}}var c=a.display.lineDiv;vc(c,"CodeMirror-crosshair");qa(document,"keyup",b);qa(document,"mouseover",b)}function Ae(a){if(a.keyCode==16)this.doc.sel.shift=false;lb(this,a)}function Ce(a){if(!(lb(this,a)||a.ctrlKey&&!a.altKey||ib&&a.metaKey)){var b=
a.keyCode,c=a.charCode;if(mb&&b==Yd){Yd=null;Xa(a)}else if(!((mb&&(!a.which||a.which<10)||Jd)&&Je(this,a))){b=String.fromCharCode(c==null?b:c);if(!Of(this,a,b)){if(va&&Fa>=9)this.display.inputHasSelection=null;jd(this)}}}}function Hd(a){if(a.options.readOnly!="nocursor"){if(!a.state.focused){Oa(a,"focus",a);a.state.focused=true;vc(a.display.wrapper,"CodeMirror-focused");if(!a.curOp&&a.display.selForContextMenu!=a.doc.sel){gb(a);Na&&setTimeout(ob(gb,a,true),0)}}hd(a);Fb(a)}}function Uc(a){if(a.state.focused){Oa(a,
"blur",a);a.state.focused=false;tc(a.display.wrapper,"CodeMirror-focused")}clearInterval(a.display.blinker);setTimeout(function(){if(!a.state.focused)a.display.shift=false},150)}function ye(a,b){function c(){if(e.input.selectionStart!=null){var o=a.somethingSelected(),t=e.input.value="\u200b"+(o?e.input.value:"");e.prevInput=o?"":"\u200b";e.input.selectionStart=1;e.input.selectionEnd=t.length;e.selForContextMenu=a.doc.sel}}function d(){e.contextMenuPending=false;e.inputDiv.style.position="relative";
e.input.style.cssText=i;if(va&&Fa<9)e.scrollbars.setScrollTop(e.scroller.scrollTop=h);hd(a);if(e.input.selectionStart!=null){if(!va||va&&Fa<9)c();var o=0,t=function(){if(e.selForContextMenu==a.doc.sel&&e.input.selectionStart==0)Pa(a,rd.selectAll)(a);else if(o++<10)e.detectingSelectAll=setTimeout(t,500);else gb(a)};e.detectingSelectAll=setTimeout(t,200)}}if(!lb(a,b,"contextmenu")){var e=a.display;if(!(Vb(e,b)||Qf(a,b))){var f=lc(a,b),h=e.scroller.scrollTop;if(!(!f||mb)){a.options.resetSelectionOnContextMenu&&
a.doc.sel.contains(f)==-1&&Pa(a,Ma)(a.doc,ja(f),Eb);var i=e.input.style.cssText;e.inputDiv.style.position="absolute";e.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(b.clientY-5)+"px; left: "+(b.clientX-5)+"px; z-index: 1000; background: "+(va?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";if(Na)var k=window.scrollY;$a(a);Na&&window.scrollTo(null,k);gb(a);if(!a.somethingSelected())e.input.value=
e.prevInput=" ";e.contextMenuPending=true;e.selForContextMenu=a.doc.sel;clearTimeout(e.detectingSelectAll);va&&Fa>=9&&c();if(Vd){Td(b);var m=function(){yb(window,"mouseup",m);setTimeout(d,20)};qa(window,"mouseup",m)}else setTimeout(d,50)}}}}function Qf(a,b){if(!jb(a,"gutterContextMenu"))return false;return Ud(a,b,"gutterContextMenu",false,Oa)}function Ke(a,b){if(sa(a,b.from)<0)return a;if(sa(a,b.to)<=0)return Ib(b);var c=a.line+b.text.length-(b.to.line-b.from.line)-1,d=a.ch;if(a.line==b.to.line)d+=
Ib(b).ch-b.to.ch;return W(c,d)}function Zd(a,b){for(var c=[],d=0;d<a.sel.ranges.length;d++){var e=a.sel.ranges[d];c.push(new s(Ke(e.anchor,b),Ke(e.head,b)))}return U(c,a.sel.primIndex)}function Le(a,b,c){return a.line==b.line?W(c.line,a.ch-b.ch+c.ch):W(c.line+(a.line-b.line),a.ch)}function Me(a,b,c){b={canceled:false,from:b.from,to:b.to,text:b.text,origin:b.origin,cancel:function(){this.canceled=true}};if(c)b.update=function(d,e,f,h){if(d)this.from=Y(a,d);if(e)this.to=Y(a,e);if(f)this.text=f;if(h!==
undefined)this.origin=h};Oa(a,"beforeChange",a,b);a.cm&&Oa(a.cm,"beforeChange",a.cm,b);if(b.canceled)return null;return{from:b.from,to:b.to,text:b.text,origin:b.origin}}function kc(a,b,c){if(a.cm){if(!a.cm.curOp)return Pa(a.cm,kc)(a,b,c);if(a.cm.state.suppressEdits)return}if(jb(a,"beforeChange")||a.cm&&jb(a.cm,"beforeChange")){b=Me(a,b,true);if(!b)return}if(c=Ne&&!c&&Rf(a,b.from,b.to))for(var d=c.length-1;d>=0;--d)Oe(a,{from:c[d].from,to:c[d].to,text:d?[""]:b.text});else Oe(a,b)}function Oe(a,b){if(!(b.text.length==
1&&b.text[0]==""&&sa(b.from,b.to)==0)){var c=Zd(a,b);Pe(a,b,c,a.cm?a.cm.curOp.id:NaN);Ic(a,b,c,$d(a,b));var d=[];Wb(a,function(e,f){if(!f&&Ua(d,e.history)==-1){Qe(e.history,b);d.push(e.history)}Ic(e,b,null,$d(e,b))})}}function td(a,b,c){if(!(a.cm&&a.cm.state.suppressEdits)){for(var d=a.history,e,f=a.sel,h=b=="undo"?d.done:d.undone,i=b=="undo"?d.undone:d.done,k=0;k<h.length;k++){e=h[k];if(c?e.ranges&&!e.equals(a.sel):!e.ranges)break}if(k!=h.length){for(d.lastOrigin=d.lastSelOrigin=null;;){e=h.pop();
if(e.ranges){Wc(e,i);if(c&&!e.equals(a.sel)){Ma(a,e,{clearRedo:false});return}f=e}else break}c=[];Wc(f,i);i.push({changes:c,generation:d.generation});d.generation=e.generation||++d.maxGeneration;d=jb(a,"beforeChange")||a.cm&&jb(a.cm,"beforeChange");for(k=e.changes.length-1;k>=0;--k){var m=e.changes[k];m.origin=b;if(d&&!Me(a,m,false)){h.length=0;break}c.push(ae(a,m));f=k?Zd(a,m):Ia(h);Ic(a,m,f,Re(a,m));!k&&a.cm&&a.cm.scrollIntoView({from:m.from,to:Ib(m)});var o=[];Wb(a,function(t,p){if(!p&&Ua(o,t.history)==
-1){Qe(t.history,m);o.push(t.history)}Ic(t,m,null,Re(t,m))})}}}}function Se(a,b){if(b!=0){a.first+=b;a.sel=new F(Dc(a.sel.ranges,function(e){return new s(W(e.anchor.line+b,e.anchor.ch),W(e.head.line+b,e.head.ch))}),a.sel.primIndex);if(a.cm){ab(a.cm,a.first,a.first-b,b);for(var c=a.cm.display,d=c.viewFrom;d<c.viewTo;d++)xb(a.cm,d,"gutter")}}}function Ic(a,b,c,d){if(a.cm&&!a.cm.curOp)return Pa(a.cm,Ic)(a,b,c,d);if(b.to.line<a.first)Se(a,b.text.length-1-(b.to.line-b.from.line));else if(!(b.from.line>
a.lastLine())){if(b.from.line<a.first){var e=b.text.length-1-(a.first-b.from.line);Se(a,e);b={from:W(a.first,0),to:W(b.to.line+e,b.to.ch),text:[Ia(b.text)],origin:b.origin}}e=a.lastLine();if(b.to.line>e)b={from:b.from,to:W(e,ha(a,e).text.length),text:[b.text[0]],origin:b.origin};b.removed=Jc(a,b.from,b.to);c||(c=Zd(a,b));a.cm?Sf(a.cm,b,d):be(a,b,d);qb(a,c,Eb)}}function Sf(a,b,c){var d=a.doc,e=a.display,f=b.from,h=b.to,i=false,k=f.line;if(!a.options.lineWrapping){k=La(tb(ha(d,f.line)));d.iter(k,h.line+
1,function(m){if(m==e.maxLine)return i=true})}d.sel.contains(b.from,b.to)>-1&&te(a);be(d,b,c,u(a));if(!a.options.lineWrapping){d.iter(k,f.line+b.text.length,function(m){var o=M(m);if(o>e.maxLineLength){e.maxLine=m;e.maxLineLength=o;e.maxLineChanged=true;i=false}});if(i)a.curOp.updateMaxLine=true}d.frontier=Math.min(d.frontier,f.line);db(a,400);c=b.text.length-(h.line-f.line)-1;if(b.full)ab(a);else f.line==h.line&&b.text.length==1&&!Te(a.doc,b)?xb(a,f.line,"text"):ab(a,f.line,h.line+1,c);c=jb(a,"changes");
if((d=jb(a,"change"))||c){b={from:f,to:h,text:b.text,removed:b.removed,origin:b.origin};d&&Qa(a,"change",a,b);if(c)(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(b)}a.display.selForContextMenu=null}function od(a,b,c,d,e){d||(d=c);if(sa(d,c)<0){var f=d;d=c;c=f}if(typeof b=="string")b=Tb(b);kc(a,{from:c,to:d,text:b,origin:e})}function fd(a,b,c,d,e){var f=a.display,h=vb(a.display);if(c<0)c=0;var i=a.curOp&&a.curOp.scrollTop!=null?a.curOp.scrollTop:f.scroller.scrollTop,k=Db(a),m={};if(e-c>k)e=c+k;
var o=a.doc.height+(f.mover.offsetHeight-f.lineSpace.offsetHeight),t=c<h;h=e>o-h;if(c<i)m.scrollTop=t?0:c;else if(e>i+k){c=Math.min(c,(h?o:e)-k);if(c!=i)m.scrollTop=c}i=a.curOp&&a.curOp.scrollLeft!=null?a.curOp.scrollLeft:f.scroller.scrollLeft;a=hb(a)-(a.options.fixedGutter?f.gutters.offsetWidth:0);if(f=d-b>a)d=b+a;if(b<10)m.scrollLeft=0;else if(b<i)m.scrollLeft=Math.max(0,b-(f?0:10));else if(d>a+i-3)m.scrollLeft=d+(f?0:10)-a;return m}function ce(a,b,c){if(b!=null||c!=null)ud(a);if(b!=null)a.curOp.scrollLeft=
(a.curOp.scrollLeft==null?a.doc.scrollLeft:a.curOp.scrollLeft)+b;if(c!=null)a.curOp.scrollTop=(a.curOp.scrollTop==null?a.doc.scrollTop:a.curOp.scrollTop)+c}function dc(a){ud(a);var b=a.getCursor(),c=b,d=b;if(!a.options.lineWrapping){c=b.ch?W(b.line,b.ch-1):b;d=W(b.line,b.ch+1)}a.curOp.scrollToPos={from:c,to:d,margin:a.options.cursorScrollMargin,isCursor:true}}function ud(a){var b=a.curOp.scrollToPos;if(b){a.curOp.scrollToPos=null;var c=K(a,b.from),d=K(a,b.to);b=fd(a,Math.min(c.left,d.left),Math.min(c.top,
d.top)-b.margin,Math.max(c.right,d.right),Math.max(c.bottom,d.bottom)+b.margin);a.scrollTo(b.scrollLeft,b.scrollTop)}}function Ec(a,b,c,d){var e=a.doc,f;if(c==null)c="add";if(c=="smart")if(e.mode.indent)f=fb(a,b);else c="prev";var h=a.options.tabSize,i=ha(e,b),k=kb(i.text,null,h);if(i.stateAfter)i.stateAfter=null;var m=i.text.match(/^\s*/)[0],o;if(!d&&!/\S/.test(i.text)){o=0;c="not"}else if(c=="smart"){o=e.mode.indent(f,i.text.slice(m.length),i.text);if(o==Ie||o>150){if(!d)return;c="prev"}}if(c==
"prev")o=b>e.first?kb(ha(e,b-1).text,null,h):0;else if(c=="add")o=k+a.options.indentUnit;else if(c=="subtract")o=k-a.options.indentUnit;else if(typeof c=="number")o=k+c;o=Math.max(0,o);c="";d=0;if(a.options.indentWithTabs)for(a=Math.floor(o/h);a;--a){d+=h;c+="\t"}if(d<o)c+=Ue(o-d);if(c!=m)od(e,c,W(b,0),W(b,m.length),"+input");else for(a=0;a<e.sel.ranges.length;a++){h=e.sel.ranges[a];if(h.head.line==b&&h.head.ch<m.length){d=W(b,m.length);Ba(e,a,new s(d,d));break}}i.stateAfter=null}function vd(a,b,
c,d){var e=b,f=b;if(typeof b=="number")f=ha(a,Math.max(a.first,Math.min(b,a.first+a.size-1)));else e=La(b);if(e==null)return null;d(f,e)&&a.cm&&xb(a.cm,e,c);return f}function mc(a,b){for(var c=a.doc.sel.ranges,d=[],e=0;e<c.length;e++){for(var f=b(c[e]);d.length&&sa(f.from,Ia(d).to)<=0;){var h=d.pop();if(sa(h.from,f.from)<0){f.from=h.from;break}}d.push(f)}Gb(a,function(){for(var i=d.length-1;i>=0;i--)od(a.doc,"",d[i].from,d[i].to,"+delete");dc(a)})}function de(a,b,c,d,e){function f(L){var ea=(e?Rd:
Ve)(m,i,c,true);if(ea==null){if(L=!L){L=h+c;if(L<a.first||L>=a.first+a.size)L=o=false;else{h=L;L=m=ha(a,L)}}if(L)i=e?(c<0?ed:dd)(m):c<0?m.text.length:0;else return o=false}else i=ea;return true}var h=b.line,i=b.ch,k=c,m=ha(a,h),o=true;if(d=="char")f();else if(d=="column")f(true);else if(d=="word"||d=="group"){var t=null;d=d=="group";b=a.cm&&a.cm.getHelper(b,"wordChars");for(var p=true;;p=false){if(c<0&&!f(!p))break;var D=m.text.charAt(i)||"\n";D=wd(D,b)?"w":d&&D=="\n"?"n":!d||/\s/.test(D)?null:"p";
if(d&&!p&&!D)D="s";if(t&&t!=D){if(c<0){c=1;f()}break}if(D)t=D;if(c>0&&!f(!p))break}}k=ec(a,W(h,i),k,true);if(!o)k.hitSide=true;return k}function We(a,b,c,d){var e=a.doc,f=b.left,h;if(d=="page")h=b.top+c*(Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight)-(c<0?1.5:0.5)*vb(a.display));else if(d=="line")h=c>0?b.bottom+3:b.top-3;for(;;){var i=za(a,f,h);if(!i.outside)break;if(c<0?h<=0:h>=e.height){i.hitSide=true;break}h+=c*5}return i}function oa(a,b,c,d){j.defaults[a]=
b;if(c)$b[a]=d?function(e,f,h){h!=ne&&c(e,f,h)}:c}function Tf(a){var b=a.split(/-(?!$)/);a=b[b.length-1];for(var c,d,e,f,h=0;h<b.length-1;h++){var i=b[h];if(/^(cmd|meta|m)$/i.test(i))f=true;else if(/^a(lt)?$/i.test(i))c=true;else if(/^(c|ctrl|control)$/i.test(i))d=true;else if(/^s(hift)$/i.test(i))e=true;else throw Error("Unrecognized modifier name: "+i);}if(c)a="Alt-"+a;if(d)a="Ctrl-"+a;if(f)a="Cmd-"+a;if(e)a="Shift-"+a;return a}function xd(a){return typeof a=="string"?Jb[a]:a}function nc(a,b,c,
d,e){if(d&&d.shared)return Uf(a,b,c,d,e);if(a.cm&&!a.cm.curOp)return Pa(a.cm,nc)(a,b,c,d,e);var f=new Xb(a,e);e=sa(b,c);d&&zb(d,f,false);if(e>0||e==0&&f.clearWhenEmpty!==false)return f;if(f.replacedWith){f.collapsed=true;f.widgetNode=ga("span",[f.replacedWith],"CodeMirror-widget");d.handleMouseEvents||f.widgetNode.setAttribute("cm-ignore-events","true");if(d.insertLeft)f.widgetNode.insertLeft=true}if(f.collapsed){if(Xe(a,b.line,b,c,f)||b.line!=c.line&&Xe(a,c.line,b,c,f))throw Error("Inserting collapsed marker partially overlapping an existing one");
Cb=true}f.addToHistory&&Pe(a,{from:b,to:c,origin:"markText"},a.sel,NaN);var h=b.line,i=a.cm,k;a.iter(h,c.line+1,function(m){if(i&&f.collapsed&&!i.options.lineWrapping&&tb(m)==i.display.maxLine)k=true;f.collapsed&&h!=b.line&&pb(m,0);var o=new yd(f,h==b.line?b.ch:null,h==c.line?c.ch:null);m.markedSpans=m.markedSpans?m.markedSpans.concat([o]):[o];o.marker.attachLine(m);++h});f.collapsed&&a.iter(b.line,c.line+1,function(m){Nb(a,m)&&pb(m,0)});f.clearOnEnter&&qa(f,"beforeCursorEnter",function(){f.clear()});
if(f.readOnly){Ne=true;if(a.history.done.length||a.history.undone.length)a.clearHistory()}if(f.collapsed){f.id=++Vf;f.atomic=true}if(i){if(k)i.curOp.updateMaxLine=true;if(f.collapsed)ab(i,b.line,c.line+1);else if(f.className||f.title||f.startStyle||f.endStyle||f.css)for(d=b.line;d<=c.line;d++)xb(i,d,"text");f.atomic&&Zc(i.doc);Qa(i,"markerAdded",i,f)}return f}function Uf(a,b,c,d,e){d=zb(d);d.shared=false;var f=[nc(a,b,c,d,e)],h=f[0],i=d.widgetNode;Wb(a,function(k){if(i)d.widgetNode=i.cloneNode(true);
f.push(nc(k,Y(k,b),Y(k,c),d,e));for(var m=0;m<k.linked.length;++m)if(k.linked[m].isParent)return;h=Ia(f)});return new zd(f,h)}function Ye(a){return a.findMarks(W(a.first,0),a.clipPos(W(a.lastLine())),function(b){return b.parent})}function Wf(a){for(var b=0;b<a.length;b++){var c=a[b],d=[c.primary.doc];Wb(c.primary.doc,function(h){d.push(h)});for(var e=0;e<c.markers.length;e++){var f=c.markers[e];if(Ua(d,f.doc)==-1){f.parent=null;c.markers.splice(e--,1)}}}}function yd(a,b,c){this.marker=a;this.from=
b;this.to=c}function Kc(a,b){if(a)for(var c=0;c<a.length;++c){var d=a[c];if(d.marker==b)return d}}function $d(a,b){if(b.full)return null;var c=Ka(a,b.from.line)&&ha(a,b.from.line).markedSpans,d=Ka(a,b.to.line)&&ha(a,b.to.line).markedSpans;if(!c&&!d)return null;var e=b.from.ch,f=b.to.ch,h=sa(b.from,b.to)==0;if(c)for(var i=0,k;i<c.length;++i){var m=c[i],o=m.marker;if(m.from==null||(o.inclusiveLeft?m.from<=e:m.from<e)||m.from==e&&o.type=="bookmark"&&(!h||!m.marker.insertLeft)){var t=m.to==null||(o.inclusiveRight?
m.to>=e:m.to>e);(k||(k=[])).push(new yd(o,m.from,t?null:m.to))}}c=k;if(d){i=0;for(var p;i<d.length;++i){k=d[i];m=k.marker;if(k.to==null||(m.inclusiveRight?k.to>=f:k.to>f)||k.from==f&&m.type=="bookmark"&&(!h||k.marker.insertLeft)){o=k.from==null||(m.inclusiveLeft?k.from<=f:k.from<f);(p||(p=[])).push(new yd(m,o?null:k.from-f,k.to==null?null:k.to-f))}}}d=p;h=b.text.length==1;p=Ia(b.text).length+(h?e:0);if(c)for(f=0;f<c.length;++f){i=c[f];if(i.to==null)if(k=Kc(d,i.marker)){if(h)i.to=k.to==null?null:k.to+
p}else i.to=e}if(d)for(f=0;f<d.length;++f){i=d[f];if(i.to!=null)i.to+=p;if(i.from==null){k=Kc(c,i.marker);if(!k){i.from=p;if(h)(c||(c=[])).push(i)}}else{i.from+=p;if(h)(c||(c=[])).push(i)}}if(c)c=Ze(c);if(d&&d!=c)d=Ze(d);e=[c];if(!h){h=b.text.length-2;var D;if(h>0&&c)for(f=0;f<c.length;++f)if(c[f].to==null)(D||(D=[])).push(new yd(c[f].marker,null,null));for(f=0;f<h;++f)e.push(D);e.push(d)}return e}function Ze(a){for(var b=0;b<a.length;++b){var c=a[b];c.from!=null&&c.from==c.to&&c.marker.clearWhenEmpty!==
false&&a.splice(b--,1)}if(!a.length)return null;return a}function Re(a,b){var c;if(c=b["spans_"+a.id]){for(var d=0,e=[];d<b.text.length;++d)e.push(Xf(c[d]));c=e}else c=null;d=$d(a,b);if(!c)return d;if(!d)return c;for(e=0;e<c.length;++e){var f=c[e],h=d[e];if(f&&h){var i=0;a:for(;i<h.length;++i){for(var k=h[i],m=0;m<f.length;++m)if(f[m].marker==k.marker)continue a;f.push(k)}}else if(h)c[e]=h}return c}function Rf(a,b,c){var d=null;a.iter(b.line,c.line+1,function(o){if(o.markedSpans)for(var t=0;t<o.markedSpans.length;++t){var p=
o.markedSpans[t].marker;if(p.readOnly&&(!d||Ua(d,p)==-1))(d||(d=[])).push(p)}});if(!d)return null;a=[{from:b,to:c}];for(b=0;b<d.length;++b){c=d[b];for(var e=c.find(0),f=0;f<a.length;++f){var h=a[f];if(!(sa(h.to,e.from)<0||sa(h.from,e.to)>0)){var i=[f,1],k=sa(h.from,e.from),m=sa(h.to,e.to);if(k<0||!c.inclusiveLeft&&!k)i.push({from:h.from,to:e.from});if(m>0||!c.inclusiveRight&&!m)i.push({from:e.to,to:h.to});a.splice.apply(a,i);f+=i.length-1}}}return a}function $e(a){var b=a.markedSpans;if(b){for(var c=
0;c<b.length;++c)b[c].marker.detachLine(a);a.markedSpans=null}}function af(a,b){if(b){for(var c=0;c<b.length;++c)b[c].marker.attachLine(a);a.markedSpans=b}}function bf(a,b){var c=a.lines.length-b.lines.length;if(c!=0)return c;c=a.find();var d=b.find(),e=sa(c.from,d.from)||(a.inclusiveLeft?-1:0)-(b.inclusiveLeft?-1:0);if(e)return-e;if(c=sa(c.to,d.to)||(a.inclusiveRight?1:0)-(b.inclusiveRight?1:0))return c;return b.id-a.id}function Pb(a,b){var c=Cb&&a.markedSpans,d;if(c)for(var e,f=0;f<c.length;++f){e=
c[f];if(e.marker.collapsed&&(b?e.from:e.to)==null&&(!d||bf(d,e.marker)<0))d=e.marker}return d}function Xe(a,b,c,d,e){a=ha(a,b);if(a=Cb&&a.markedSpans)for(b=0;b<a.length;++b){var f=a[b];if(f.marker.collapsed){var h=f.marker.find(0),i=sa(h.from,c)||(f.marker.inclusiveLeft?-1:0)-(e.inclusiveLeft?-1:0),k=sa(h.to,d)||(f.marker.inclusiveRight?1:0)-(e.inclusiveRight?1:0);if(!(i>=0&&k<=0||i<=0&&k>=0))if(i<=0&&(sa(h.to,c)>0||f.marker.inclusiveRight&&e.inclusiveLeft)||i>=0&&(sa(h.from,d)<0||f.marker.inclusiveLeft&&
e.inclusiveRight))return true}}}function tb(a){for(var b;b=Pb(a,true);)a=b.find(-1,true).line;return a}function Kd(a,b){var c=ha(a,b),d=tb(c);if(c==d)return b;return La(d)}function qe(a,b){if(b>a.lastLine())return b;var c=ha(a,b),d;if(!Nb(a,c))return b;for(;d=Pb(c,false);)c=d.find(1,true).line;return La(c)+1}function Nb(a,b){var c=Cb&&b.markedSpans;if(c)for(var d,e=0;e<c.length;++e){d=c[e];if(d.marker.collapsed){if(d.from==null)return true;if(!d.marker.widgetNode)if(d.from==0&&d.marker.inclusiveLeft&&
ee(a,b,d))return true}}}function ee(a,b,c){if(c.to==null){b=c.marker.find(1,true);return ee(a,b.line,Kc(b.line.markedSpans,c.marker))}if(c.marker.inclusiveRight&&c.to==b.text.length)return true;for(var d,e=0;e<b.markedSpans.length;++e){d=b.markedSpans[e];if(d.marker.collapsed&&!d.marker.widgetNode&&d.from==c.to&&(d.to==null||d.to!=c.from)&&(d.marker.inclusiveLeft||c.marker.inclusiveRight)&&ee(a,b,d))return true}}function cf(a,b,c){if(wb(b)<(a.curOp&&a.curOp.scrollTop||a.doc.scrollTop))ce(a,null,c)}
function Bc(a){if(a.height!=null)return a.height;var b;a:{var c=document.body,d=a.node;if(c.contains)b=c.contains(d);else for(;d=d.parentNode;)if(d==c){b=true;break a}}if(!b){b="position: relative;";if(a.coverGutter)b+="margin-left: -"+a.cm.display.gutters.offsetWidth+"px;";if(a.noHScroll)b+="width: "+a.cm.display.wrapper.clientWidth+"px;";rb(a.cm.display.measure,ga("div",[a.node],null,b))}return a.height=a.node.offsetHeight}function Yf(a,b,c,d){var e=new Ad(a,c,d);if(e.noHScroll)a.display.alignWidgets=
true;vd(a.doc,b,"widget",function(f){var h=f.widgets||(f.widgets=[]);e.insertAt==null?h.push(e):h.splice(Math.min(h.length-1,Math.max(0,e.insertAt)),0,e);e.line=f;if(!Nb(a.doc,f)){h=wb(f)<a.doc.scrollTop;pb(f,f.height+Bc(e));h&&ce(a,null,e.height);a.curOp.forceUpdate=true}return true});return e}function df(a,b){if(a)for(;;){var c=a.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!c)break;a=a.slice(0,c.index)+a.slice(c.index+c[0].length);var d=c[1]?"bgClass":"textClass";if(b[d]==null)b[d]=c[2];else RegExp("(?:^|s)"+
c[2]+"(?:$|s)").test(b[d])||(b[d]+=" "+c[2])}return a}function ef(a,b){if(a.blankLine)return a.blankLine(b);if(a.innerMode){var c=j.innerMode(a,b);if(c.mode.blankLine)return c.mode.blankLine(c.state)}}function fe(a,b,c,d){for(var e=0;e<10;e++){if(d)d[0]=j.innerMode(a,c).mode;var f=a.token(b,c);if(b.pos>b.start)return f}throw Error("Mode "+a.name+" failed to advance stream.");}function ff(a,b,c,d){function e(p){return{start:o.start,end:o.pos,string:o.current(),type:i||null,state:p?gc(f.mode,m):m}}
var f=a.doc,h=f.mode,i;b=Y(f,b);var k=ha(f,b.line),m=fb(a,b.line,c),o=new Bd(k.text,a.options.tabSize),t;if(d)t=[];for(;(d||o.pos<b.ch)&&!o.eol();){o.start=o.pos;i=fe(h,o,m);d&&t.push(e(true))}return d?t:e()}function gf(a,b,c,d,e,f,h){var i=c.flattenSpans;if(i==null)i=a.options.flattenSpans;var k=0,m=null,o=new Bd(b,a.options.tabSize),t,p=a.options.addModeClass&&[null];for(b==""&&df(ef(c,d),f);!o.eol();){if(o.pos>a.options.maxHighlightLength){i=false;h&&Md(a,b,d,o.pos);o.pos=b.length;t=null}else t=
df(fe(c,o,d,p),f);if(p){var D=p[0].name;if(D)t="m-"+(t?D+" "+t:D)}if(!i||m!=t){for(;k<o.start;){k=Math.min(o.start,k+5E4);e(k,m)}m=t}o.start=o.pos}for(;k<o.pos;){a=Math.min(o.pos,k+5E4);e(a,m);k=a}}function ue(a,b,c,d){var e=[a.state.modeGen],f={};gf(a,b.text,a.doc.mode,c,function(m,o){e.push(m,o)},f,d);for(c=0;c<a.state.overlays.length;++c){var h=a.state.overlays[c],i=1,k=0;gf(a,b.text,h.mode,true,function(m,o){for(var t=i;k<m;){var p=e[i];p>m&&e.splice(i,1,m,e[i+1],p);i+=2;k=Math.min(m,p)}if(o)if(h.opaque){e.splice(t,
i-t,m,"cm-overlay "+o);i=t+2}else for(;t<i;t+=2){p=e[t+1];e[t+1]=(p?p+" ":"")+"cm-overlay "+o}},f)}return{styles:e,classes:f.bgClass||f.textClass?f:null}}function hf(a,b,c){if(!b.styles||b.styles[0]!=a.state.modeGen){var d=ue(a,b,b.stateAfter=fb(a,La(b)));b.styles=d.styles;if(d.classes)b.styleClasses=d.classes;else if(b.styleClasses)b.styleClasses=null;c===a.doc.frontier&&a.doc.frontier++}return b.styles}function Md(a,b,c,d){var e=a.doc.mode,f=new Bd(b,a.options.tabSize);f.start=f.pos=d||0;for(b==
""&&ef(e,c);!f.eol()&&f.pos<=a.options.maxHighlightLength;){fe(e,f,c);f.start=f.pos}}function jf(a,b){if(!a||/^\s*$/.test(a))return null;var c=b.addModeClass?Zf:$f;return c[a]||(c[a]=a.replace(/\S+/g,"cm-$&"))}function re(a,b){var c=ga("span",null,null,Na?"padding-right: .1px":null);c={pre:ga("pre",[c]),content:c,col:0,pos:0,cm:a};b.measure={};for(var d=0;d<=(b.rest?b.rest.length:0);d++){var e=d?b.rest[d-1]:b.line,f;c.pos=0;c.addToken=ag;if((va||Na)&&a.getOption("lineWrapping"))c.addToken=bg(c.addToken);
var h;if(ge!=null)h=ge;else{h=rb(a.display.measure,document.createTextNode("A\u062eA"));var i=ic(h,0,1).getBoundingClientRect();h=!i||i.left==i.right?false:ge=ic(h,1,2).getBoundingClientRect().right-i.right<3}if(h&&(f=sb(e)))c.addToken=cg(c.addToken,f);c.map=[];i=b!=a.display.externalMeasured&&La(e);h=c;i=hf(a,e,i);var k=e.markedSpans,m=e.text,o=0;if(k){var t=m.length,p=0;nb=1;for(var D="",L=void 0,ea=void 0,fa=0,na=void 0,ia=void 0,da=void 0,Ca=void 0,pa=void 0;;){if(fa==p){na=ia=da=Ca=ea="";pa=
null;fa=Infinity;for(var ya=[],ta=0;ta<k.length;++ta){var Da=k[ta],Ta=Da.marker;if(Da.from<=p&&(Da.to==null||Da.to>p)){if(Da.to!=null&&fa>Da.to){fa=Da.to;ia=""}if(Ta.className)na+=" "+Ta.className;if(Ta.css)ea=Ta.css;if(Ta.startStyle&&Da.from==p)da+=" "+Ta.startStyle;if(Ta.endStyle&&Da.to==fa)ia+=" "+Ta.endStyle;if(Ta.title&&!Ca)Ca=Ta.title;if(Ta.collapsed&&(!pa||bf(pa.marker,Ta)<0))pa=Da}else if(Da.from>p&&fa>Da.from)fa=Da.from;Ta.type=="bookmark"&&Da.from==p&&Ta.widgetNode&&ya.push(Ta)}if(pa&&(pa.from||
0)==p){kf(h,(pa.to==null?t+1:pa.to)-p,pa.marker,pa.from==null);if(pa.to==null)break}if(!pa&&ya.length)for(ta=0;ta<ya.length;++ta)kf(h,0,ya[ta])}if(p>=t)break;for(ya=Math.min(t,fa);;){if(D){ta=p+D.length;if(!pa){Da=ta>ya?D.slice(0,ya-p):D;h.addToken(h,Da,L?L+na:na,da,p+Da.length==fa?ia:"",Ca,ea)}if(ta>=ya){D=D.slice(ya-p);p=ya;break}p=ta;da=""}D=m.slice(o,o=i[nb++]);L=jf(i[nb++],h.cm.options)}}}else for(var nb=1;nb<i.length;nb+=2)h.addToken(h,m.slice(o,o=i[nb]),jf(i[nb+1],h.cm.options));if(e.styleClasses){if(e.styleClasses.bgClass)c.bgClass=
he(e.styleClasses.bgClass,c.bgClass||"");if(e.styleClasses.textClass)c.textClass=he(e.styleClasses.textClass,c.textClass||"")}c.map.length==0&&c.map.push(0,0,c.content.appendChild(dg(a.display.measure)));if(d==0){b.measure.map=c.map;b.measure.cache={}}else{(b.measure.maps||(b.measure.maps=[])).push(c.map);(b.measure.caches||(b.measure.caches=[])).push({})}}if(Na&&/\bcm-tab\b/.test(c.content.lastChild.className))c.content.className="cm-tab-wrap-hack";Oa(a,"renderLine",a,b.line,c.pre);if(c.pre.className)c.textClass=
he(c.pre.className,c.textClass||"");return c}function ag(a,b,c,d,e,f,h){if(b){var i=a.cm.options.specialChars,k=false;if(i.test(b)){D=document.createDocumentFragment();for(var m=0;;){i.lastIndex=m;var o=i.exec(b),t=o?o.index-m:b.length-m;if(t){var p=document.createTextNode(b.slice(m,m+t));va&&Fa<9?D.appendChild(ga("span",[p])):D.appendChild(p);a.map.push(a.pos,a.pos+t,p);a.col+=t;a.pos+=t}if(!o)break;m+=t+1;if(o[0]=="\t"){p=a.cm.options.tabSize;o=p-a.col%p;p=D.appendChild(ga("span",Ue(o),"cm-tab"));
a.col+=o}else{p=a.cm.options.specialCharPlaceholder(o[0]);va&&Fa<9?D.appendChild(ga("span",[p])):D.appendChild(p);a.col+=1}a.map.push(a.pos,a.pos+1,p);a.pos++}}else{a.col+=b.length;var D=document.createTextNode(b);a.map.push(a.pos,a.pos+b.length,D);if(va&&Fa<9)k=true;a.pos+=b.length}if(c||d||e||k||h){b=c||"";if(d)b+=d;if(e)b+=e;d=ga("span",[D],b,h);if(f)d.title=f;return a.content.appendChild(d)}a.content.appendChild(D)}}function bg(a){function b(c){for(var d=" ",e=0;e<c.length-2;++e)d+=e%2?" ":"\u00a0";
d+=" ";return d}return function(c,d,e,f,h,i){a(c,d.replace(/ {3,}/g,b),e,f,h,i)}}function cg(a,b){return function(c,d,e,f,h,i){e=e?e+" cm-force-border":"cm-force-border";for(var k=c.pos,m=k+d.length;;){for(var o=0;o<b.length;o++){var t=b[o];if(t.to>k&&t.from<=k)break}if(t.to>=m)return a(c,d,e,f,h,i);a(c,d.slice(0,t.to-k),e,f,null,i);f=null;d=d.slice(t.to-k);k=t.to}}}function kf(a,b,c,d){if(c=!d&&c.widgetNode){a.map.push(a.pos,a.pos+b,c);a.content.appendChild(c)}a.pos+=b}function Te(a,b){return b.from.ch==
0&&b.to.ch==0&&Ia(b.text)==""&&(!a.cm||a.cm.options.wholeLineUpdateBefore)}function be(a,b,c,d){function e(fa){return c?c[fa]:null}function f(fa,na,ia){var da=d;fa.text=na;if(fa.stateAfter)fa.stateAfter=null;if(fa.styles)fa.styles=null;if(fa.order!=null)fa.order=null;$e(fa);af(fa,ia);na=da?da(fa):1;na!=fa.height&&pb(fa,na);Qa(fa,"change",fa,b)}function h(fa,na){for(var ia=fa,da=[];ia<na;++ia)da.push(new Lc(m[ia],e(ia),d));return da}var i=b.from,k=b.to,m=b.text,o=ha(a,i.line),t=ha(a,k.line),p=Ia(m),
D=e(m.length-1),L=k.line-i.line;if(b.full){a.insert(0,h(0,m.length));a.remove(m.length,a.size-m.length)}else if(Te(a,b)){var ea=h(0,m.length-1);f(t,t.text,D);L&&a.remove(i.line,L);ea.length&&a.insert(i.line,ea)}else if(o==t)if(m.length==1)f(o,o.text.slice(0,i.ch)+p+o.text.slice(k.ch),D);else{ea=h(1,m.length-1);ea.push(new Lc(p+o.text.slice(k.ch),D,d));f(o,o.text.slice(0,i.ch)+m[0],e(0));a.insert(i.line+1,ea)}else if(m.length==1){f(o,o.text.slice(0,i.ch)+m[0]+t.text.slice(k.ch),e(0));a.remove(i.line+
1,L)}else{f(o,o.text.slice(0,i.ch)+m[0],e(0));f(t,p+t.text.slice(k.ch),D);ea=h(1,m.length-1);L>1&&a.remove(i.line+1,L-1);a.insert(i.line+1,ea)}Qa(a,"change",a,b)}function Mc(a){this.lines=a;this.parent=null;for(var b=0,c=0;b<a.length;++b){a[b].parent=this;c+=a[b].height}this.height=c}function Nc(a){this.children=a;for(var b=0,c=0,d=0;d<a.length;++d){var e=a[d];b+=e.chunkSize();c+=e.height;e.parent=this}this.size=b;this.height=c;this.parent=null}function Wb(a,b,c){function d(e,f,h){if(e.linked)for(var i=
0;i<e.linked.length;++i){var k=e.linked[i];if(k.doc!=f){var m=h&&k.sharedHist;if(!(c&&!m)){b(k.doc,m);d(k.doc,e,m)}}}}d(a,null,true)}function me(a,b){if(b.cm)throw Error("This document is already in use.");a.doc=b;b.cm=a;g(a);X(a);a.options.lineWrapping||x(a);a.options.mode=b.modeOption;ab(a)}function ha(a,b){b-=a.first;if(b<0||b>=a.size)throw Error("There is no line "+(b+a.first)+" in the document.");for(var c=a;!c.lines;)for(var d=0;;++d){var e=c.children[d],f=e.chunkSize();if(b<f){c=e;break}b-=
f}return c.lines[b]}function Jc(a,b,c){var d=[],e=b.line;a.iter(b.line,c.line+1,function(f){f=f.text;if(e==c.line)f=f.slice(0,c.ch);if(e==b.line)f=f.slice(b.ch);d.push(f);++e});return d}function ie(a,b,c){var d=[];a.iter(b,c,function(e){d.push(e.text)});return d}function pb(a,b){var c=b-a.height;if(c)for(var d=a;d;d=d.parent)d.height+=c}function La(a){if(a.parent==null)return null;var b=a.parent;a=Ua(b.lines,a);for(var c=b.parent;c;b=c,c=c.parent)for(var d=0;;++d){if(c.children[d]==b)break;a+=c.children[d].chunkSize()}return a+
b.first}function Qb(a,b){var c=a.first;a:do{for(var d=0;d<a.children.length;++d){var e=a.children[d],f=e.height;if(b<f){a=e;continue a}b-=f;c+=e.chunkSize()}return c}while(!a.lines);for(d=0;d<a.lines.length;++d){e=a.lines[d].height;if(b<e)break;b-=e}return c+d}function wb(a){a=tb(a);for(var b=0,c=a.parent,d=0;d<c.lines.length;++d){var e=c.lines[d];if(e==a)break;else b+=e.height}for(a=c.parent;a;c=a,a=c.parent)for(d=0;d<a.children.length;++d){e=a.children[d];if(e==c)break;else b+=e.height}return b}
function sb(a){var b=a.order;if(b==null)b=a.order=eg(a.text);return b}function Cd(a){this.done=[];this.undone=[];this.undoDepth=Infinity;this.lastModTime=this.lastSelTime=0;this.lastOrigin=this.lastSelOrigin=this.lastOp=this.lastSelOp=null;this.generation=this.maxGeneration=a||1}function ae(a,b){var c={from:W(b.from.line,b.from.ch),to:Ib(b),text:Jc(a,b.from,b.to)};lf(a,c,b.from.line,b.to.line+1);Wb(a,function(d){lf(d,c,b.from.line,b.to.line+1)},true);return c}function se(a){for(;a.length;)if(Ia(a).ranges)a.pop();
else break}function Pe(a,b,c,d){var e=a.history;e.undone.length=0;var f=+new Date,h,i;if(i=e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&(b.origin.charAt(0)=="+"&&a.cm&&e.lastModTime>f-a.cm.options.historyEventDelay||b.origin.charAt(0)=="*")){var k;if(e.lastOp==d){se(e.done);k=Ia(e.done)}else if(e.done.length&&!Ia(e.done).ranges)k=Ia(e.done);else if(e.done.length>1&&!e.done[e.done.length-2].ranges){e.done.pop();k=Ia(e.done)}i=h=k}if(i){var m=Ia(h.changes);if(sa(b.from,b.to)==0&&sa(b.from,m.to)==
0)m.to=Ib(b);else h.changes.push(ae(a,b))}else{h=Ia(e.done);if(!h||!h.ranges)Wc(a.sel,e.done);h={changes:[ae(a,b)],generation:e.generation};for(e.done.push(h);e.done.length>e.undoDepth;){e.done.shift();e.done[0].ranges||e.done.shift()}}e.done.push(c);e.generation=++e.maxGeneration;e.lastModTime=e.lastSelTime=f;e.lastOp=e.lastSelOp=d;e.lastOrigin=e.lastSelOrigin=b.origin;m||Oa(a,"historyAdded")}function Wc(a,b){var c=Ia(b);c&&c.ranges&&c.equals(a)||b.push(a)}function lf(a,b,c,d){var e=b["spans_"+a.id],
f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(h){if(h.markedSpans)(e||(e=b["spans_"+a.id]={}))[f]=h.markedSpans;++f})}function Xf(a){if(!a)return null;for(var b=0,c;b<a.length;++b)if(a[b].marker.explicitlyCleared)c||(c=a.slice(0,b));else c&&c.push(a[b]);return!c?a:c.length?c:null}function oc(a,b,c){for(var d=0,e=[];d<a.length;++d){var f=a[d];if(f.ranges)e.push(c?F.prototype.deepCopy.call(f):f);else{f=f.changes;var h=[];e.push({changes:h});for(var i=0;i<f.length;++i){var k=f[i],
m;h.push({from:k.from,to:k.to,text:k.text});if(b)for(var o in k)if(m=o.match(/^spans_(\d+)$/))if(Ua(b,Number(m[1]))>-1){Ia(h)[o]=k[o];delete k[o]}}}}return e}function mf(a,b,c,d){if(c<a.line)a.line+=d;else if(b<a.line){a.line=b;a.ch=0}}function nf(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e],h=true;if(f.ranges){if(!f.copied){f=a[e]=f.deepCopy();f.copied=true}for(var i=0;i<f.ranges.length;i++){mf(f.ranges[i].anchor,b,c,d);mf(f.ranges[i].head,b,c,d)}}else{for(i=0;i<f.changes.length;++i){var k=f.changes[i];
if(c<k.from.line){k.from=W(k.from.line+d,k.from.ch);k.to=W(k.to.line+d,k.to.ch)}else if(b<=k.to.line){h=false;break}}if(!h){a.splice(0,e+1);e=0}}}}function Qe(a,b){var c=b.from.line,d=b.to.line,e=b.text.length-(d-c)-1;nf(a.done,c,d,e);nf(a.undone,c,d,e)}function Xd(a){return a.defaultPrevented!=null?a.defaultPrevented:a.returnValue==false}function Fe(a){var b=a.which;if(b==null)if(a.button&1)b=1;else if(a.button&2)b=3;else if(a.button&4)b=2;if(ib&&a.ctrlKey&&b==1)b=3;return b}function Qa(a,b){function c(i){return function(){i.apply(null,
e)}}var d=a._handlers&&a._handlers[b];if(d){var e=Array.prototype.slice.call(arguments,2),f;if(jc)f=jc.delayedCallbacks;else if(Oc)f=Oc;else{f=Oc=[];setTimeout(fg,0)}for(var h=0;h<d.length;++h)f.push(c(d[h]))}}function fg(){var a=Oc;Oc=null;for(var b=0;b<a.length;++b)a[b]()}function lb(a,b,c){if(typeof b=="string")b={type:b,preventDefault:function(){this.defaultPrevented=true}};Oa(a,c||b.type,a,b);return Xd(b)||b.codemirrorIgnore}function te(a){var b=a._handlers&&a._handlers.cursorActivity;if(b){a=
a.curOp.cursorActivityHandlers||(a.curOp.cursorActivityHandlers=[]);for(var c=0;c<b.length;++c)Ua(a,b[c])==-1&&a.push(b[c])}}function jb(a,b){var c=a._handlers&&a._handlers[b];return c&&c.length>0}function pc(a){a.prototype.on=function(b,c){qa(this,b,c)};a.prototype.off=function(b,c){yb(this,b,c)}}function Tc(){this.id=null}function Ge(a,b,c){for(var d=0,e=0;;){var f=a.indexOf("\t",d);if(f==-1)f=a.length;var h=f-d;if(f==a.length||e+h>=b)return d+Math.min(h,b-e);e+=f-d;e+=c-e%c;d=f+1;if(e>=b)return d}}
function Ue(a){for(;Dd.length<=a;)Dd.push(Ia(Dd)+" ");return Dd[a]}function Ia(a){return a[a.length-1]}function Ua(a,b){for(var c=0;c<a.length;++c)if(a[c]==b)return c;return-1}function Dc(a,b){for(var c=[],d=0;d<a.length;d++)c[d]=b(a[d],d);return c}function of(a,b){var c;if(Object.create)c=Object.create(a);else{c=function(){};c.prototype=a;c=new c}b&&zb(b,c);return c}function zb(a,b,c){b||(b={});for(var d in a)if(a.hasOwnProperty(d)&&(c!==false||!b.hasOwnProperty(d)))b[d]=a[d];return b}function ob(a){var b=
Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b)}}function wd(a,b){if(!b)return pf(a);if(b.source.indexOf("\\w")>-1&&pf(a))return true;return b.test(a)}function qf(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return false;return true}function zc(a){return a.charCodeAt(0)>=768&&gg.test(a)}function ga(a,b,c,d){a=document.createElement(a);if(c)a.className=c;if(d)a.style.cssText=d;if(typeof b=="string")a.appendChild(document.createTextNode(b));else if(b)for(c=0;c<b.length;++c)a.appendChild(b[c]);
return a}function Ob(a){for(var b=a.childNodes.length;b>0;--b)a.removeChild(a.firstChild);return a}function rb(a,b){return Ob(a).appendChild(b)}function Ab(){return document.activeElement}function Pc(a){return RegExp("(^|\\s)"+a+"(?:$|\\s)\\s*")}function he(a,b){for(var c=a.split(" "),d=0;d<c.length;d++)if(c[d]&&!Pc(c[d]).test(b))b+=" "+c[d];return b}function rf(a){if(document.body.getElementsByClassName)for(var b=document.body.getElementsByClassName("CodeMirror"),c=0;c<b.length;c++){var d=b[c].CodeMirror;
d&&a(d)}}function yf(){var a;qa(window,"resize",function(){if(a==null)a=setTimeout(function(){a=null;rf(Ff)},100)});qa(window,"blur",function(){rf(Uc)})}function dg(a){if(je==null){var b=ga("span","\u200b");rb(a,ga("span",[b,document.createTextNode("x")]));if(a.firstChild.offsetHeight!=0)je=b.offsetWidth<=1&&b.offsetHeight>2&&!(va&&Fa<8)}return je?ga("span","\u200b"):ga("span","\u00a0",null,"display: inline-block; width: 1px; margin-right: -1px")}function zf(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=
false,f=0;f<a.length;++f){var h=a[f];if(h.from<c&&h.to>b||b==c&&h.to==b){d(Math.max(h.from,b),Math.min(h.to,c),h.level==1?"rtl":"ltr");e=true}}e||d(b,c,"ltr")}function Pd(a){return a.level%2?a.from:a.to}function dd(a){return(a=sb(a))?a[0].level%2?a[0].to:a[0].from:0}function ed(a){var b=sb(a);if(!b)return a.text.length;return Pd(Ia(b))}function sf(a,b){var c=ha(a.doc,b),d=tb(c);if(d!=c)b=La(d);c=sb(d);d=!c?0:c[0].level%2?ed(d):dd(d);return W(b,d)}function tf(a,b){var c=sf(a,b.line),d=ha(a.doc,c.line),
e=sb(d);if(!e||e[0].level==0){d=Math.max(0,d.text.search(/\S/));return W(c.line,b.line==c.line&&b.ch<=d&&b.ch?0:d)}return c}function Qd(a,b){Cc=null;for(var c=0,d;c<a.length;++c){var e=a[c];if(e.from<b&&e.to>b)return c;if(e.from==b||e.to==b)if(d==null)d=c;else{var f;f=e.level;var h=a[d].level,i=a[0].level;f=f==i?true:h==i?false:f<h;if(f){if(e.from!=e.to)Cc=d;return c}else{if(e.from!=e.to)Cc=c;break}}}return d}function ke(a,b,c,d){if(!d)return b+c;do b+=c;while(b>0&&zc(a.text.charAt(b)));return b}
function Rd(a,b,c,d){var e=sb(a);if(!e)return Ve(a,b,c,d);var f=Qd(e,b),h=e[f];for(b=ke(a,b,h.level%2?-c:c,d);;){if(b>h.from&&b<h.to)return b;if(b==h.from||b==h.to){if(Qd(e,b)==f)return b;h=e[f+c];return c>0==h.level%2?h.to:h.from}else{h=e[f+=c];if(!h)return null;b=c>0==h.level%2?ke(a,h.to,-1,d):ke(a,h.from,1,d)}}}function Ve(a,b,c,d){b+=c;if(d)for(;b>0&&zc(a.text.charAt(b));)b+=c;return b<0||b>a.text.length?null:b}var Gc=/gecko\/\d/i.test(navigator.userAgent),qc=/MSIE \d/.test(navigator.userAgent),
Ed=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),va=qc||Ed,Fa=va&&(qc?document.documentMode||6:Ed[1]),Na=/WebKit\//.test(navigator.userAgent);qc=Na&&/Qt\/\d+\.\d+/.test(navigator.userAgent);Ed=/Chrome\//.test(navigator.userAgent);var mb=/Opera\//.test(navigator.userAgent),Ee=/Apple Computer/.test(navigator.vendor),Jd=/KHTML\//.test(navigator.userAgent),hg=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),Cf=/PhantomJS/.test(navigator.userAgent),rc=/AppleWebKit/.test(navigator.userAgent)&&
/Mobile\/\w+/.test(navigator.userAgent),Gd=rc||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),ib=rc||/Mac/.test(navigator.platform),ig=/win/i.test(navigator.platform),Yb=mb&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);if(Yb)Yb=Number(Yb[1]);if(Yb&&Yb>=15){mb=false;Na=true}var uf=ib&&(qc||mb&&(Yb==null||Yb<12.11)),Vd=Gc||va&&Fa>=9,Ne=false,Cb=false;E.prototype=zb({update:function(a){a||(a=H(this.cm));var b=a.scrollWidth>a.clientWidth+1,c=a.scrollHeight>a.clientHeight+
1,d=a.nativeBarWidth;if(c){this.vert.style.display="block";this.vert.style.bottom=b?d+"px":"0";this.vert.firstChild.style.height=Math.max(0,a.scrollHeight-a.clientHeight+(a.viewHeight-(b?d:0)))+"px"}else{this.vert.style.display="";this.vert.firstChild.style.height="0"}if(b){this.horiz.style.display="block";this.horiz.style.right=c?d+"px":"0";this.horiz.style.left=a.barLeft+"px";this.horiz.firstChild.style.width=a.scrollWidth-a.clientWidth+(a.viewWidth-a.barLeft-(c?d:0))+"px"}else{this.horiz.style.display=
"";this.horiz.firstChild.style.width="0"}if(!this.checkedOverlay&&a.clientHeight>0){d==0&&this.overlayHack();this.checkedOverlay=true}return{right:c?d:0,bottom:b?d:0}},setScrollLeft:function(a){if(this.horiz.scrollLeft!=a)this.horiz.scrollLeft=a},setScrollTop:function(a){if(this.vert.scrollTop!=a)this.vert.scrollTop=a},overlayHack:function(){this.horiz.style.minHeight=this.vert.style.minWidth=ib&&!hg?"12px":"18px";var a=this,b=function(c){(c.target||c.srcElement)!=a.vert&&(c.target||c.srcElement)!=
a.horiz&&Pa(a.cm,xe)(c)};qa(this.vert,"mousedown",b);qa(this.horiz,"mousedown",b)},clear:function(){var a=this.horiz.parentNode;a.removeChild(this.horiz);a.removeChild(this.vert)}},E.prototype);B.prototype=zb({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},B.prototype);j.scrollbarModel={"native":E,"null":B};var W=j.Pos=function(a,b){if(!(this instanceof W))return new W(a,b);this.line=a;this.ch=b},sa=j.cmpPos=function(a,b){return a.line-
b.line||a.ch-b.ch};F.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(a){if(a==this)return true;if(a.primIndex!=this.primIndex||a.ranges.length!=this.ranges.length)return false;for(var b=0;b<this.ranges.length;b++){var c=this.ranges[b],d=a.ranges[b];if(sa(c.anchor,d.anchor)!=0||sa(c.head,d.head)!=0)return false}return true},deepCopy:function(){for(var a=[],b=0;b<this.ranges.length;b++)a[b]=new s(W(this.ranges[b].anchor.line,this.ranges[b].anchor.ch),W(this.ranges[b].head.line,
this.ranges[b].head.ch));return new F(a,this.primIndex)},somethingSelected:function(){for(var a=0;a<this.ranges.length;a++)if(!this.ranges[a].empty())return true;return false},contains:function(a,b){b||(b=a);for(var c=0;c<this.ranges.length;c++){var d=this.ranges[c];if(sa(b,d.from())>=0&&sa(a,d.to())<=0)return c}return-1}};s.prototype={from:function(){return r(this.anchor,this.head)},to:function(){return R(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==
this.anchor.ch}};var Nd={left:0,right:0,top:0,bottom:0},Sb,jc=null,Bf=0,Ub=null,md,ld,De=0,pd=0,bb=null;if(va)bb=-0.53;else if(Gc)bb=15;else if(Ed)bb=-0.7;else if(Ee)bb=-1/3;var He=function(a){var b=a.wheelDeltaX,c=a.wheelDeltaY;if(b==null&&a.detail&&a.axis==a.HORIZONTAL_AXIS)b=a.detail;if(c==null&&a.detail&&a.axis==a.VERTICAL_AXIS)c=a.detail;else if(c==null)c=a.wheelDelta;return{x:b,y:c}};j.wheelEventPixels=function(a){a=He(a);a.x*=bb;a.y*=bb;return a};var Mf=new Tc,Yd=null,Ib=j.changeEnd=function(a){if(!a.text)return a.to;
return W(a.from.line+a.text.length-1,Ia(a.text).length+(a.text.length==1?a.from.ch:0))};j.prototype={constructor:j,focus:function(){window.focus();$a(this);jd(this)},setOption:function(a,b){var c=this.options,d=c[a];if(!(c[a]==b&&a!="mode")){c[a]=b;$b.hasOwnProperty(a)&&Pa(this,$b[a])(this,b,d)}},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](xd(a))},removeKeyMap:function(a){for(var b=this.state.keyMaps,
c=0;c<b.length;++c)if(b[c]==a||b[c].name==a){b.splice(c,1);return true}},addOverlay:Sa(function(a,b){var c=a.token?a:j.getMode(this.options,a);if(c.startState)throw Error("Overlays may not be stateful.");this.state.overlays.push({mode:c,modeSpec:a,opaque:b&&b.opaque});this.state.modeGen++;ab(this)}),removeOverlay:Sa(function(a){for(var b=this.state.overlays,c=0;c<b.length;++c){var d=b[c].modeSpec;if(d==a||typeof a=="string"&&d.name==a){b.splice(c,1);this.state.modeGen++;ab(this);break}}}),indentLine:Sa(function(a,
b,c){if(typeof b!="string"&&typeof b!="number")b=b==null?this.options.smartIndent?"smart":"prev":b?"add":"subtract";Ka(this.doc,a)&&Ec(this,a,b,c)}),indentSelection:Sa(function(a){for(var b=this.doc.sel.ranges,c=-1,d=0;d<b.length;d++){var e=b[d];if(e.empty()){if(e.head.line>c){Ec(this,e.head.line,a,true);c=e.head.line;d==this.doc.sel.primIndex&&dc(this)}}else{var f=e.from();e=e.to();var h=Math.max(c,f.line);c=Math.min(this.lastLine(),e.line-(e.ch?0:1))+1;for(e=h;e<c;++e)Ec(this,e,a);e=this.doc.sel.ranges;
f.ch==0&&b.length==e.length&&e[d].from().ch>0&&Ba(this.doc,d,new s(f,e[d].to()),Eb)}}}),getTokenAt:function(a,b){return ff(this,a,b)},getLineTokens:function(a,b){return ff(this,W(a),b,true)},getTokenTypeAt:function(a){a=Y(this.doc,a);var b=hf(this,ha(this.doc,a.line)),c=0,d=(b.length-1)/2;a=a.ch;var e;if(a==0)e=b[2];else for(;;){var f=c+d>>1;if((f?b[f*2-1]:0)>=a)d=f;else if(b[f*2+1]<a)c=f+1;else{e=b[f*2+2];break}}b=e?e.indexOf("cm-overlay "):-1;return b<0?e:b==0?null:e.slice(0,b-1)},getModeAt:function(a){var b=
this.doc.mode;if(!b.innerMode)return b;return j.innerMode(b,this.getTokenAt(a).state).mode},getHelper:function(a,b){return this.getHelpers(a,b)[0]},getHelpers:function(a,b){var c=[];if(!Zb.hasOwnProperty(b))return Zb;var d=Zb[b],e=this.getModeAt(a);if(typeof e[b]=="string")d[e[b]]&&c.push(d[e[b]]);else if(e[b])for(var f=0;f<e[b].length;f++){var h=d[e[b][f]];h&&c.push(h)}else if(e.helperType&&d[e.helperType])c.push(d[e.helperType]);else d[e.name]&&c.push(d[e.name]);for(f=0;f<d._global.length;f++){h=
d._global[f];h.pred(e,this)&&Ua(c,h.val)==-1&&c.push(h.val)}return c},getStateAfter:function(a,b){var c=this.doc;a=Math.max(c.first,Math.min(a==null?c.first+c.size-1:a,c.first+c.size-1));return fb(this,a+1,b)},cursorCoords:function(a,b){var c;c=this.doc.sel.primary();c=a==null?c.head:typeof a=="object"?Y(this.doc,a):a?c.from():c.to();return N(this,c,b||"page")},charCoords:function(a,b){return I(this,Y(this.doc,a),b||"page")},coordsChar:function(a,b){a=n(this,a,b||"page");return za(this,a.left,a.top)},
lineAtHeight:function(a,b){a=n(this,{top:a,left:0},b||"page").top;return Qb(this.doc,a+this.display.viewOffset)},heightAtLine:function(a,b){var c=false,d=this.doc.first+this.doc.size-1;if(a<this.doc.first)a=this.doc.first;else if(a>d){a=d;c=true}d=ha(this.doc,a);return Ac(this,d,{top:0,left:0},b||"page").top+(c?this.doc.height-wb(d):0)},defaultTextHeight:function(){return vb(this.display)},defaultCharWidth:function(){return sc(this.display)},setGutterMarker:Sa(function(a,b,c){return vd(this.doc,a,
"gutter",function(d){var e=d.gutterMarkers||(d.gutterMarkers={});e[b]=c;if(!c&&qf(e))d.gutterMarkers=null;return true})}),clearGutter:Sa(function(a){var b=this,c=b.doc,d=c.first;c.iter(function(e){if(e.gutterMarkers&&e.gutterMarkers[a]){e.gutterMarkers[a]=null;xb(b,d,"gutter");if(qf(e.gutterMarkers))e.gutterMarkers=null}++d})}),addLineWidget:Sa(function(a,b,c){return Yf(this,a,b,c)}),removeLineWidget:function(a){a.clear()},lineInfo:function(a){if(typeof a=="number"){if(!Ka(this.doc,a))return null;
var b=a;a=ha(this.doc,a);if(!a)return null}else{b=La(a);if(b==null)return null}return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=N(this,Y(this.doc,a));var h=a.bottom,i=a.left;b.style.position="absolute";b.setAttribute("cm-ignore-events","true");f.sizer.appendChild(b);if(d==
"over")h=a.top;else if(d=="above"||d=="near"){var k=Math.max(f.wrapper.clientHeight,this.doc.height),m=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);if((d=="above"||a.bottom+b.offsetHeight>k)&&a.top>b.offsetHeight)h=a.top-b.offsetHeight;else if(a.bottom+b.offsetHeight<=k)h=a.bottom;if(i+b.offsetWidth>m)i=m-b.offsetWidth}b.style.top=h+"px";b.style.left=b.style.right="";if(e=="right"){i=f.sizer.clientWidth-b.offsetWidth;b.style.right="0px"}else{if(e=="left")i=0;else if(e=="middle")i=(f.sizer.clientWidth-
b.offsetWidth)/2;b.style.left=i+"px"}if(c){a=fd(this,i,h,i+b.offsetWidth,h+b.offsetHeight);a.scrollTop!=null&&uc(this,a.scrollTop);a.scrollLeft!=null&&ac(this,a.scrollLeft)}},triggerOnKeyDown:Sa(Be),triggerOnKeyPress:Sa(Ce),triggerOnKeyUp:Ae,execCommand:function(a){if(rd.hasOwnProperty(a))return rd[a](this)},findPosH:function(a,b,c,d){var e=1;if(b<0){e=-1;b=-b}var f=0;for(a=Y(this.doc,a);f<b;++f){a=de(this.doc,a,e,c,d);if(a.hitSide)break}return a},moveH:Sa(function(a,b){var c=this;c.extendSelectionsBy(function(d){return c.display.shift||
c.doc.extend||d.empty()?de(c.doc,d.head,a,b,c.options.rtlMoveVisually):a<0?d.from():d.to()},Qc)}),deleteH:Sa(function(a,b){var c=this.doc;this.doc.sel.somethingSelected()?c.replaceSelection("",null,"+delete"):mc(this,function(d){var e=de(c,d.head,a,b,false);return a<0?{from:e,to:d.head}:{from:d.head,to:e}})}),findPosV:function(a,b,c,d){var e=1;if(b<0){e=-1;b=-b}var f=0;for(a=Y(this.doc,a);f<b;++f){a=N(this,a,"div");if(d==null)d=a.left;else a.left=d;a=We(this,a,e,c);if(a.hitSide)break}return a},moveV:Sa(function(a,
b){var c=this,d=this.doc,e=[],f=!c.display.shift&&!d.extend&&d.sel.somethingSelected();d.extendSelectionsBy(function(i){if(f)return a<0?i.from():i.to();var k=N(c,i.head,"div");if(i.goalColumn!=null)k.left=i.goalColumn;e.push(k.left);var m=We(c,k,a,b);b=="page"&&i==d.sel.primary()&&ce(c,null,I(c,m,"div").top-k.top);return m},Qc);if(e.length)for(var h=0;h<d.sel.ranges.length;h++)d.sel.ranges[h].goalColumn=e[h]}),findWordAt:function(a){var b=ha(this.doc,a.line).text,c=a.ch,d=a.ch;if(b){var e=this.getHelper(a,
"wordChars");if((a.xRel<0||d==b.length)&&c)--c;else++d;var f=b.charAt(c);for(f=wd(f,e)?function(h){return wd(h,e)}:/\s/.test(f)?function(h){return/\s/.test(h)}:function(h){return!/\s/.test(h)&&!wd(h)};c>0&&f(b.charAt(c-1));)--c;for(;d<b.length&&f(b.charAt(d));)++d}return new s(W(a.line,c),W(a.line,d))},toggleOverwrite:function(a){if(!(a!=null&&a==this.state.overwrite)){(this.state.overwrite=!this.state.overwrite)?vc(this.display.cursorDiv,"CodeMirror-overwrite"):tc(this.display.cursorDiv,"CodeMirror-overwrite");
Oa(this,"overwriteToggle",this,this.state.overwrite)}},hasFocus:function(){return Ab()==this.display.input},scrollTo:Sa(function(a,b){if(a!=null||b!=null)ud(this);if(a!=null)this.curOp.scrollLeft=a;if(b!=null)this.curOp.scrollTop=b}),getScrollInfo:function(){var a=this.display.scroller;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-Za(this)-this.display.barHeight,width:a.scrollWidth-Za(this)-this.display.barWidth,clientHeight:Db(this),clientWidth:hb(this)}},scrollIntoView:Sa(function(a,
b){if(a==null){a={from:this.doc.sel.primary().head,to:null};if(b==null)b=this.options.cursorScrollMargin}else if(typeof a=="number")a={from:W(a,0),to:null};else if(a.from==null)a={from:a,to:null};if(!a.to)a.to=a.from;a.margin=b||0;if(a.from.line!=null){ud(this);this.curOp.scrollToPos=a}else{var c=fd(this,Math.min(a.from.left,a.to.left),Math.min(a.from.top,a.to.top)-a.margin,Math.max(a.from.right,a.to.right),Math.max(a.from.bottom,a.to.bottom)+a.margin);this.scrollTo(c.scrollLeft,c.scrollTop)}}),setSize:Sa(function(a,
b){function c(f){return typeof f=="number"||/^\d+$/.test(String(f))?f+"px":f}var d=this;if(a!=null)d.display.wrapper.style.width=c(a);if(b!=null)d.display.wrapper.style.height=c(b);d.options.lineWrapping&&cd(this);var e=d.display.viewFrom;d.doc.iter(e,d.display.viewTo,function(f){if(f.widgets)for(var h=0;h<f.widgets.length;h++)if(f.widgets[h].noHScroll){xb(d,e,"widget");break}++e});d.curOp.forceUpdate=true;Oa(d,"refresh",this)}),operation:function(a){return Gb(this,a)},refresh:Sa(function(){var a=
this.display.cachedTextHeight;ab(this);this.curOp.forceUpdate=true;aa(this);this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop);A(this);if(a==null||Math.abs(a-vb(this.display))>0.5)g(this);Oa(this,"refresh",this)}),swapDoc:Sa(function(a){var b=this.doc;b.cm=null;me(this,a);aa(this);gb(this);this.scrollTo(a.scrollLeft,a.scrollTop);this.curOp.forceScroll=true;Qa(this,"swapDoc",this,b);return b}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},
getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};pc(j);var wf=j.defaults={},$b=j.optionHandlers={},ne=j.Init={toString:function(){return"CodeMirror.Init"}};oa("value","",function(a,b){a.setValue(b)},true);oa("mode",null,function(a,b){a.doc.modeOption=b;X(a)},true);oa("indentUnit",2,X,true);oa("indentWithTabs",false);oa("smartIndent",true);oa("tabSize",4,function(a){w(a);aa(a);ab(a)},true);oa("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,
function(a,b){a.options.specialChars=RegExp(b.source+(b.test("\t")?"":"|\t"),"g");a.refresh()},true);oa("specialCharPlaceholder",function(a){var b=ga("span","\u2022","cm-invalidchar");b.title="\\u"+a.charCodeAt(0).toString(16);return b},function(a){a.refresh()},true);oa("electricChars",true);oa("rtlMoveVisually",!ig);oa("wholeLineUpdateBefore",true);oa("theme","default",function(a){l(a);q(a)},true);oa("keyMap","default",function(a,b,c){b=xd(b);(c=c!=j.Init&&xd(c))&&c.detach&&c.detach(a,b);if(b.attach)b.attach(a,
c||null)});oa("extraKeys",null);oa("lineWrapping",false,function(a){if(a.options.lineWrapping){vc(a.display.wrapper,"CodeMirror-wrap");a.display.sizer.style.minWidth="";a.display.sizerWidth=null}else{tc(a.display.wrapper,"CodeMirror-wrap");x(a)}g(a);ab(a);aa(a);setTimeout(function(){y(a)},100)},true);oa("gutters",[],function(a){J(a.options);q(a)},true);oa("fixedGutter",true,function(a,b){a.display.gutters.style.left=b?Va(a.display)+"px":"0";a.refresh()},true);oa("coverGutterNextToScrollbar",false,
function(a){y(a)},true);oa("scrollbarStyle","native",function(a){z(a);y(a);a.display.scrollbars.setScrollTop(a.doc.scrollTop);a.display.scrollbars.setScrollLeft(a.doc.scrollLeft)},true);oa("lineNumbers",false,function(a){J(a.options);q(a)},true);oa("firstLineNumber",1,q,true);oa("lineNumberFormatter",function(a){return a},q,true);oa("showCursorWhenSelecting",false,Rb,true);oa("resetSelectionOnContextMenu",true);oa("readOnly",false,function(a,b){if(b=="nocursor"){Uc(a);a.display.input.blur();a.display.disabled=
true}else{a.display.disabled=false;b||gb(a)}});oa("disableInput",false,function(a,b){b||gb(a)},true);oa("dragDrop",true);oa("cursorBlinkRate",530);oa("cursorScrollMargin",0);oa("cursorHeight",1,Rb,true);oa("singleCursorHeightPerLine",true,Rb,true);oa("workTime",100);oa("workDelay",100);oa("flattenSpans",true,w,true);oa("addModeClass",false,w,true);oa("pollInterval",100);oa("undoDepth",200,function(a,b){a.doc.history.undoDepth=b});oa("historyEventDelay",1250);oa("viewportMargin",10,function(a){a.refresh()},
true);oa("maxHighlightLength",1E4,w,true);oa("moveInputWithCursor",true,function(a,b){if(!b)a.display.inputDiv.style.top=a.display.inputDiv.style.left=0});oa("tabindex",null,function(a,b){a.display.input.tabIndex=b||""});oa("autofocus",null);var vf=j.modes={},Rc=j.mimeModes={};j.defineMode=function(a,b){if(!j.defaults.mode&&a!="null")j.defaults.mode=a;if(arguments.length>2)b.dependencies=Array.prototype.slice.call(arguments,2);vf[a]=b};j.defineMIME=function(a,b){Rc[a]=b};j.resolveMode=function(a){if(typeof a==
"string"&&Rc.hasOwnProperty(a))a=Rc[a];else if(a&&typeof a.name=="string"&&Rc.hasOwnProperty(a.name)){var b=Rc[a.name];if(typeof b=="string")b={name:b};a=of(b,a);a.name=b.name}else if(typeof a=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(a))return j.resolveMode("application/xml");return typeof a=="string"?{name:a}:a||{name:"null"}};j.getMode=function(a,b){b=j.resolveMode(b);var c=vf[b.name];if(!c)return j.getMode(a,"text/plain");c=c(a,b);if(Sc.hasOwnProperty(b.name)){var d=Sc[b.name],e;for(e in d)if(d.hasOwnProperty(e)){if(c.hasOwnProperty(e))c["_"+
e]=c[e];c[e]=d[e]}}c.name=b.name;if(b.helperType)c.helperType=b.helperType;if(b.modeProps)for(e in b.modeProps)c[e]=b.modeProps[e];return c};j.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}});j.defineMIME("text/plain","null");var Sc=j.modeExtensions={};j.extendMode=function(a,b){var c=Sc.hasOwnProperty(a)?Sc[a]:Sc[a]={};zb(b,c)};j.defineExtension=function(a,b){j.prototype[a]=b};j.defineDocExtension=function(a,b){Ya.prototype[a]=b};j.defineOption=oa;var Id=[];j.defineInitHook=
function(a){Id.push(a)};var Zb=j.helpers={};j.registerHelper=function(a,b,c){Zb.hasOwnProperty(a)||(Zb[a]=j[a]={_global:[]});Zb[a][b]=c};j.registerGlobalHelper=function(a,b,c,d){j.registerHelper(a,b,d);Zb[a]._global.push({pred:c,val:d})};var gc=j.copyState=function(a,b){if(b===true)return b;if(a.copyState)return a.copyState(b);var c={},d;for(d in b){var e=b[d];if(e instanceof Array)e=e.concat([]);c[d]=e}return c},Af=j.startState=function(a,b,c){return a.startState?a.startState(b,c):true};j.innerMode=
function(a,b){for(;a.innerMode;){var c=a.innerMode(b);if(!c||c.mode==a)break;b=c.state;a=c.mode}return c||{mode:a,state:b}};var rd=j.commands={selectAll:function(a){a.setSelection(W(a.firstLine(),0),W(a.lastLine()),Eb)},singleSelection:function(a){a.setSelection(a.getCursor("anchor"),a.getCursor("head"),Eb)},killLine:function(a){mc(a,function(b){if(b.empty()){var c=ha(a.doc,b.head.line).text.length;return b.head.ch==c&&b.head.line<a.lastLine()?{from:b.head,to:W(b.head.line+1,0)}:{from:b.head,to:W(b.head.line,
c)}}else return{from:b.from(),to:b.to()}})},deleteLine:function(a){mc(a,function(b){return{from:W(b.from().line,0),to:Y(a.doc,W(b.to().line+1,0))}})},delLineLeft:function(a){mc(a,function(b){return{from:W(b.from().line,0),to:b.from()}})},delWrappedLineLeft:function(a){mc(a,function(b){var c=a.charCoords(b.head,"div").top+5;return{from:a.coordsChar({left:0,top:c},"div"),to:b.from()}})},delWrappedLineRight:function(a){mc(a,function(b){var c=a.charCoords(b.head,"div").top+5;c=a.coordsChar({left:a.display.lineDiv.offsetWidth+
100,top:c},"div");return{from:b.from(),to:c}})},undo:function(a){a.undo()},redo:function(a){a.redo()},undoSelection:function(a){a.undoSelection()},redoSelection:function(a){a.redoSelection()},goDocStart:function(a){a.extendSelection(W(a.firstLine(),0))},goDocEnd:function(a){a.extendSelection(W(a.lastLine()))},goLineStart:function(a){a.extendSelectionsBy(function(b){return sf(a,b.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(a){a.extendSelectionsBy(function(b){return tf(a,b.head)},
{origin:"+move",bias:1})},goLineEnd:function(a){a.extendSelectionsBy(function(b){b=b.head.line;for(var c,d=ha(a.doc,b);c=Pb(d,false);){d=c.find(1,true).line;b=null}c=sb(d);c=!c?d.text.length:c[0].level%2?dd(d):ed(d);return W(b==null?La(d):b,c)},{origin:"+move",bias:-1})},goLineRight:function(a){a.extendSelectionsBy(function(b){b=a.charCoords(b.head,"div").top+5;return a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:b},"div")},Qc)},goLineLeft:function(a){a.extendSelectionsBy(function(b){b=
a.charCoords(b.head,"div").top+5;return a.coordsChar({left:0,top:b},"div")},Qc)},goLineLeftSmart:function(a){a.extendSelectionsBy(function(b){var c=a.charCoords(b.head,"div").top+5;c=a.coordsChar({left:0,top:c},"div");if(c.ch<a.getLine(c.line).search(/\S/))return tf(a,b.head);return c},Qc)},goLineUp:function(a){a.moveV(-1,"line")},goLineDown:function(a){a.moveV(1,"line")},goPageUp:function(a){a.moveV(-1,"page")},goPageDown:function(a){a.moveV(1,"page")},goCharLeft:function(a){a.moveH(-1,"char")},
goCharRight:function(a){a.moveH(1,"char")},goColumnLeft:function(a){a.moveH(-1,"column")},goColumnRight:function(a){a.moveH(1,"column")},goWordLeft:function(a){a.moveH(-1,"word")},goGroupRight:function(a){a.moveH(1,"group")},goGroupLeft:function(a){a.moveH(-1,"group")},goWordRight:function(a){a.moveH(1,"word")},delCharBefore:function(a){a.deleteH(-1,"char")},delCharAfter:function(a){a.deleteH(1,"char")},delWordBefore:function(a){a.deleteH(-1,"word")},delWordAfter:function(a){a.deleteH(1,"word")},
delGroupBefore:function(a){a.deleteH(-1,"group")},delGroupAfter:function(a){a.deleteH(1,"group")},indentAuto:function(a){a.indentSelection("smart")},indentMore:function(a){a.indentSelection("add")},indentLess:function(a){a.indentSelection("subtract")},insertTab:function(a){a.replaceSelection("\t")},insertSoftTab:function(a){for(var b=[],c=a.listSelections(),d=a.options.tabSize,e=0;e<c.length;e++){var f=c[e].from();f=kb(a.getLine(f.line),f.ch,d);b.push(Array(d-f%d+1).join(" "))}a.replaceSelections(b)},
defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.execCommand("insertTab")},transposeChars:function(a){Gb(a,function(){for(var b=a.listSelections(),c=[],d=0;d<b.length;d++){var e=b[d].head,f=ha(a.doc,e.line).text;if(f){if(e.ch==f.length)e=new W(e.line,e.ch-1);if(e.ch>0){e=new W(e.line,e.ch+1);a.replaceRange(f.charAt(e.ch-1)+f.charAt(e.ch-2),W(e.line,e.ch-2),e,"+transpose")}else if(e.line>a.doc.first){var h=ha(a.doc,e.line-1).text;h&&a.replaceRange(f.charAt(0)+"\n"+h.charAt(h.length-
1),W(e.line-1,h.length-1),W(e.line,1),"+transpose")}}c.push(new s(e,e))}a.setSelections(c)})},newlineAndIndent:function(a){Gb(a,function(){for(var b=a.listSelections().length,c=0;c<b;c++){var d=a.listSelections()[c];a.replaceRange("\n",d.anchor,d.head,"+input");a.indentLine(d.from().line+1,null,true);dc(a)}})},toggleOverwrite:function(a){a.toggleOverwrite()}},Jb=j.keyMap={};Jb.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"};Jb.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"};Jb.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft",
"Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"};Jb.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"]};Jb["default"]=
ib?Jb.macDefault:Jb.pcDefault;j.normalizeKeyMap=function(a){var b={},c;for(c in a)if(a.hasOwnProperty(c)){var d=a[c];if(!/^(name|fallthrough|(de|at)tach)$/.test(c)){if(d!="...")for(var e=Dc(c.split(" "),Tf),f=0;f<e.length;f++){var h,i;if(f==e.length-1){i=c;h=d}else{i=e.slice(0,f+1).join(" ");h="..."}var k=b[i];if(k){if(k!=h)throw Error("Inconsistent bindings for "+i);}else b[i]=h}delete a[c]}}for(var m in b)a[m]=b[m];return a};var Hc=j.lookupKey=function(a,b,c,d){b=xd(b);var e=b.call?b.call(a,d):
b[a];if(e===false)return"nothing";if(e==="...")return"multi";if(e!=null&&c(e))return"handled";if(b.fallthrough){if(Object.prototype.toString.call(b.fallthrough)!="[object Array]")return Hc(a,b.fallthrough,c,d);for(e=0;e<b.fallthrough.length;e++){var f=Hc(a,b.fallthrough[e],c,d);if(f)return f}}},Lf=j.isModifierKey=function(a){a=typeof a=="string"?a:Kb[a.keyCode];return a=="Ctrl"||a=="Alt"||a=="Shift"||a=="Mod"},Nf=j.keyName=function(a,b){if(mb&&a.keyCode==34&&a["char"])return false;var c=Kb[a.keyCode],
d=c;if(d==null||a.altGraphKey)return false;if(a.altKey&&c!="Alt")d="Alt-"+d;if((uf?a.metaKey:a.ctrlKey)&&c!="Ctrl")d="Ctrl-"+d;if((uf?a.ctrlKey:a.metaKey)&&c!="Cmd")d="Cmd-"+d;if(!b&&a.shiftKey&&c!="Shift")d="Shift-"+d;return d};j.fromTextArea=function(a,b){function c(){a.value=k.getValue()}b||(b={});b.value=a.value;if(!b.tabindex&&a.tabindex)b.tabindex=a.tabindex;if(!b.placeholder&&a.placeholder)b.placeholder=a.placeholder;if(b.autofocus==null){var d=Ab();b.autofocus=d==a||a.getAttribute("autofocus")!=
null&&d==document.body}if(a.form){qa(a.form,"submit",c);if(!b.leaveSubmitMethodAlone){var e=a.form,f=e.submit;try{var h=e.submit=function(){c();e.submit=f;e.submit();e.submit=h}}catch(i){}}}a.style.display="none";var k=j(function(m){a.parentNode.insertBefore(m,a.nextSibling)},b);k.save=c;k.getTextArea=function(){return a};k.toTextArea=function(){k.toTextArea=isNaN;c();a.parentNode.removeChild(k.getWrapperElement());a.style.display="";if(a.form){yb(a.form,"submit",c);if(typeof a.form.submit=="function")a.form.submit=
f}};return k};var Bd=j.StringStream=function(a,b){this.pos=this.start=0;this.string=a;this.tabSize=b||8;this.lineStart=this.lastColumnPos=this.lastColumnValue=0};Bd.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||undefined},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(a){var b=this.string.charAt(this.pos);if(typeof a=="string"?b==
a:b&&(a.test?a.test(b):a(b))){++this.pos;return b}},eatWhile:function(a){for(var b=this.pos;this.eat(a););return this.pos>b},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){a=this.string.indexOf(a,this.pos);if(a>-1){this.pos=a;return true}},backUp:function(a){this.pos-=a},column:function(){if(this.lastColumnPos<this.start){this.lastColumnValue=kb(this.string,this.start,
this.tabSize,this.lastColumnPos,this.lastColumnValue);this.lastColumnPos=this.start}return this.lastColumnValue-(this.lineStart?kb(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return kb(this.string,null,this.tabSize)-(this.lineStart?kb(this.string,this.lineStart,this.tabSize):0)},match:function(a,b,c){if(typeof a=="string"){var d=this.string.substr(this.pos,a.length);if((c?d.toLowerCase():d)==(c?a.toLowerCase():a)){if(b!==false)this.pos+=a.length;return true}}else{if((a=this.string.slice(this.pos).match(a))&&
a.index>0)return null;if(a&&b!==false)this.pos+=a[0].length;return a}},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=a}}};var Xb=j.TextMarker=function(a,b){this.lines=[];this.type=b;this.doc=a};pc(Xb);Xb.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;b&&Lb(a);if(jb(this,"clear")){var c=this.find();c&&Qa(this,"clear",c.from,c.to)}for(var d=c=null,e=0;e<this.lines.length;++e){var f=
this.lines[e],h=Kc(f.markedSpans,this);if(a&&!this.collapsed)xb(a,La(f),"text");else if(a){if(h.to!=null)d=La(f);if(h.from!=null)c=La(f)}for(var i=f,k=f.markedSpans,m=h,o=void 0,t=0;t<k.length;++t)if(k[t]!=m)(o||(o=[])).push(k[t]);i.markedSpans=o;h.from==null&&this.collapsed&&!Nb(this.doc,f)&&a&&pb(f,vb(a.display))}if(a&&this.collapsed&&!a.options.lineWrapping)for(e=0;e<this.lines.length;++e){f=tb(this.lines[e]);h=M(f);if(h>a.display.maxLineLength){a.display.maxLine=f;a.display.maxLineLength=h;a.display.maxLineChanged=
true}}c!=null&&a&&this.collapsed&&ab(a,c,d+1);this.lines.length=0;this.explicitlyCleared=true;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=false;a&&Zc(a.doc)}a&&Qa(a,"markerCleared",a,this);b&&Mb(a);this.parent&&this.parent.clear()}};Xb.prototype.find=function(a,b){if(a==null&&this.type=="bookmark")a=1;for(var c,d,e=0;e<this.lines.length;++e){var f=this.lines[e],h=Kc(f.markedSpans,this);if(h.from!=null){c=W(b?f:La(f),h.from);if(a==-1)return c}if(h.to!=null){d=W(b?f:La(f),h.to);if(a==1)return d}}return c&&
{from:c,to:d}};Xb.prototype.changed=function(){var a=this.find(-1,true),b=this,c=this.doc.cm;a&&c&&Gb(c,function(){var d=a.line,e=La(a.line);if(e=ad(c,e)){bd(e);c.curOp.selectionChanged=c.curOp.forceUpdate=true}c.curOp.updateMaxLine=true;if(!Nb(b.doc,d)&&b.height!=null){e=b.height;b.height=null;(e=Bc(b)-e)&&pb(d,d.height+e)}})};Xb.prototype.attachLine=function(a){if(!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;if(!b.maybeHiddenMarkers||Ua(b.maybeHiddenMarkers,this)==-1)(b.maybeUnhiddenMarkers||
(b.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(a)};Xb.prototype.detachLine=function(a){this.lines.splice(Ua(this.lines,a),1);if(!this.lines.length&&this.doc.cm){a=this.doc.cm.curOp;(a.maybeHiddenMarkers||(a.maybeHiddenMarkers=[])).push(this)}};var Vf=0,zd=j.SharedTextMarker=function(a,b){this.markers=a;this.primary=b;for(var c=0;c<a.length;++c)a[c].parent=this};pc(zd);zd.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=true;for(var a=0;a<this.markers.length;++a)this.markers[a].clear();
Qa(this,"clear")}};zd.prototype.find=function(a,b){return this.primary.find(a,b)};var Ad=j.LineWidget=function(a,b,c){if(c)for(var d in c)if(c.hasOwnProperty(d))this[d]=c[d];this.cm=a;this.node=b};pc(Ad);Ad.prototype.clear=function(){var a=this.cm,b=this.line.widgets,c=this.line,d=La(c);if(!(d==null||!b)){for(var e=0;e<b.length;++e)b[e]==this&&b.splice(e--,1);if(!b.length)c.widgets=null;var f=Bc(this);Gb(a,function(){cf(a,c,-f);xb(a,d,"widget");pb(c,Math.max(0,c.height-f))})}};Ad.prototype.changed=
function(){var a=this.height,b=this.cm,c=this.line;this.height=null;var d=Bc(this)-a;d&&Gb(b,function(){b.curOp.forceUpdate=true;cf(b,c,d);pb(c,c.height+d)})};var Lc=j.Line=function(a,b,c){this.text=a;af(this,b);this.height=c?c(this):1};pc(Lc);Lc.prototype.lineNo=function(){return La(this)};var $f={},Zf={};Mc.prototype={chunkSize:function(){return this.lines.length},removeInner:function(a,b){for(var c=a,d=a+b;c<d;++c){var e=this.lines[c];this.height-=e.height;var f=e;f.parent=null;$e(f);Qa(e,"delete")}this.lines.splice(a,
b)},collapse:function(a){a.push.apply(a,this.lines)},insertInner:function(a,b,c){this.height+=c;this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));for(a=0;a<b.length;++a)b[a].parent=this},iterN:function(a,b,c){for(b=a+b;a<b;++a)if(c(this.lines[a]))return true}};Nc.prototype={chunkSize:function(){return this.size},removeInner:function(a,b){this.size-=b;for(var c=0;c<this.children.length;++c){var d=this.children[c],e=d.chunkSize();if(a<e){var f=Math.min(b,e-a),h=d.height;d.removeInner(a,
f);this.height-=h-d.height;if(e==f){this.children.splice(c--,1);d.parent=null}if((b-=f)==0)break;a=0}else a-=e}if(this.size-b<25&&(this.children.length>1||!(this.children[0]instanceof Mc))){c=[];this.collapse(c);this.children=[new Mc(c)];this.children[0].parent=this}},collapse:function(a){for(var b=0;b<this.children.length;++b)this.children[b].collapse(a)},insertInner:function(a,b,c){this.size+=b.length;this.height+=c;for(var d=0;d<this.children.length;++d){var e=this.children[d],f=e.chunkSize();
if(a<=f){e.insertInner(a,b,c);if(e.lines&&e.lines.length>50){for(;e.lines.length>50;){a=e.lines.splice(e.lines.length-25,25);a=new Mc(a);e.height-=a.height;this.children.splice(d+1,0,a);a.parent=this}this.maybeSpill()}break}a-=f}},maybeSpill:function(){if(!(this.children.length<=10)){var a=this;do{var b=a.children.splice(a.children.length-5,5);b=new Nc(b);if(a.parent){a.size-=b.size;a.height-=b.height;var c=Ua(a.parent.children,a);a.parent.children.splice(c+1,0,b)}else{c=new Nc(a.children);c.parent=
a;a.children=[c,b];a=c}b.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=0;d<this.children.length;++d){var e=this.children[d],f=e.chunkSize();if(a<f){f=Math.min(b,f-a);if(e.iterN(a,f,c))return true;if((b-=f)==0)break;a=0}else a-=f}}};var jg=0,Ya=j.Doc=function(a,b,c){if(!(this instanceof Ya))return new Ya(a,b,c);if(c==null)c=0;Nc.call(this,[new Mc([new Lc("",null)])]);this.first=c;this.scrollTop=this.scrollLeft=0;this.cantEdit=false;this.cleanGeneration=
1;this.frontier=c;c=W(c,0);this.sel=ja(c);this.history=new Cd(null);this.id=++jg;this.modeOption=b;if(typeof a=="string")a=Tb(a);be(this,{from:c,to:c,text:a});Ma(this,ja(c),Eb)};Ya.prototype=of(Nc.prototype,{constructor:Ya,iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=0,d=0;d<b.length;++d)c+=b[d].height;this.insertInner(a-this.first,b,c)},remove:function(a,b){this.removeInner(a-this.first,b)},getValue:function(a){var b=
ie(this,this.first,this.first+this.size);if(a===false)return b;return b.join(a||"\n")},setValue:Wa(function(a){var b=W(this.first,0),c=this.first+this.size-1;kc(this,{from:b,to:W(c,ha(this,c).text.length),text:Tb(a),origin:"setValue",full:true},true);Ma(this,ja(b))}),replaceRange:function(a,b,c,d){b=Y(this,b);c=c?Y(this,c):b;od(this,a,b,c,d)},getRange:function(a,b,c){a=Jc(this,Y(this,a),Y(this,b));if(c===false)return a;return a.join(c||"\n")},getLine:function(a){return(a=this.getLineHandle(a))&&a.text},
getLineHandle:function(a){if(Ka(this,a))return ha(this,a)},getLineNumber:function(a){return La(a)},getLineHandleVisualStart:function(a){if(typeof a=="number")a=ha(this,a);return tb(a)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(a){return Y(this,a)},getCursor:function(a){var b=this.sel.primary();return a==null||a=="head"?b.head:a=="anchor"?b.anchor:a=="end"||a=="to"||a===false?b.to():b.from()},listSelections:function(){return this.sel.ranges},
somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Wa(function(a,b,c){a=Y(this,typeof a=="number"?W(a,b||0):a);Ma(this,ja(a,null),c)}),setSelection:Wa(function(a,b,c){var d=Y(this,a);a=Y(this,b||a);Ma(this,ja(d,a),c)}),extendSelection:Wa(function(a,b,c){xa(this,Y(this,a),b&&Y(this,b),c)}),extendSelections:Wa(function(a){for(var b=[],c=0;c<a.length;c++)b[c]=Y(this,a[c]);eb(this,b)}),extendSelectionsBy:Wa(function(a,b){eb(this,Dc(this.sel.ranges,a),b)}),setSelections:Wa(function(a,
b,c){if(a.length){for(var d=0,e=[];d<a.length;d++)e[d]=new s(Y(this,a[d].anchor),Y(this,a[d].head));if(b==null)b=Math.min(a.length-1,this.sel.primIndex);Ma(this,U(e,b),c)}}),addSelection:Wa(function(a,b,c){var d=this.sel.ranges.slice(0);d.push(new s(Y(this,a),Y(this,b||a)));Ma(this,U(d,d.length-1),c)}),getSelection:function(a){for(var b=this.sel.ranges,c,d=0;d<b.length;d++){var e=Jc(this,b[d].from(),b[d].to());c=c?c.concat(e):e}return a===false?c:c.join(a||"\n")},getSelections:function(a){for(var b=
[],c=this.sel.ranges,d=0;d<c.length;d++){var e=Jc(this,c[d].from(),c[d].to());if(a!==false)e=e.join(a||"\n");b[d]=e}return b},replaceSelection:function(a,b,c){for(var d=[],e=0;e<this.sel.ranges.length;e++)d[e]=a;this.replaceSelections(d,b,c||"+input")},replaceSelections:Wa(function(a,b,c){for(var d=[],e=this.sel,f=0;f<e.ranges.length;f++){var h=e.ranges[f];d[f]={from:h.from(),to:h.to(),text:Tb(a[f]),origin:c}}if(f=b)if(f=b!="end"){f=[];c=a=W(this.first,0);for(e=0;e<d.length;e++){var i=d[e];h=Le(i.from,
a,c);var k=Le(Ib(i),a,c);a=i.to;c=k;if(b=="around"){i=this.sel.ranges[e];i=sa(i.head,i.anchor)<0;f[e]=new s(i?k:h,i?h:k)}else f[e]=new s(h,h)}f=new F(f,this.sel.primIndex)}b=f;for(f=d.length-1;f>=0;f--)kc(this,d[f]);if(b)cc(this,b);else this.cm&&dc(this.cm)}),undo:Wa(function(){td(this,"undo")}),redo:Wa(function(){td(this,"redo")}),undoSelection:Wa(function(){td(this,"undo",true)}),redoSelection:Wa(function(){td(this,"redo",true)}),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},
historySize:function(){for(var a=this.history,b=0,c=0,d=0;d<a.done.length;d++)a.done[d].ranges||++b;for(d=0;d<a.undone.length;d++)a.undone[d].ranges||++c;return{undo:b,redo:c}},clearHistory:function(){this.history=new Cd(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(true)},changeGeneration:function(a){if(a)this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null;return this.history.generation},isClean:function(a){return this.history.generation==
(a||this.cleanGeneration)},getHistory:function(){return{done:oc(this.history.done),undone:oc(this.history.undone)}},setHistory:function(a){var b=this.history=new Cd(this.history.maxGeneration);b.done=oc(a.done.slice(0),null,true);b.undone=oc(a.undone.slice(0),null,true)},addLineClass:Wa(function(a,b,c){return vd(this,a,b=="gutter"?"gutter":"class",function(d){var e=b=="text"?"textClass":b=="background"?"bgClass":b=="gutter"?"gutterClass":"wrapClass";if(d[e])if(Pc(c).test(d[e]))return false;else d[e]+=
" "+c;else d[e]=c;return true})}),removeLineClass:Wa(function(a,b,c){return vd(this,a,b=="gutter"?"gutter":"class",function(d){var e=b=="text"?"textClass":b=="background"?"bgClass":b=="gutter"?"gutterClass":"wrapClass",f=d[e];if(f)if(c==null)d[e]=null;else{var h=f.match(Pc(c));if(!h)return false;var i=h.index+h[0].length;d[e]=f.slice(0,h.index)+(!h.index||i==f.length?"":" ")+f.slice(i)||null}else return false;return true})}),markText:function(a,b,c){return nc(this,Y(this,a),Y(this,b),c,"range")},
setBookmark:function(a,b){var c={replacedWith:b&&(b.nodeType==null?b.widget:b),insertLeft:b&&b.insertLeft,clearWhenEmpty:false,shared:b&&b.shared};a=Y(this,a);return nc(this,a,a,c,"bookmark")},findMarksAt:function(a){a=Y(this,a);var b=[],c=ha(this,a.line).markedSpans;if(c)for(var d=0;d<c.length;++d){var e=c[d];if((e.from==null||e.from<=a.ch)&&(e.to==null||e.to>=a.ch))b.push(e.marker.parent||e.marker)}return b},findMarks:function(a,b,c){a=Y(this,a);b=Y(this,b);var d=[],e=a.line;this.iter(a.line,b.line+
1,function(f){if(f=f.markedSpans)for(var h=0;h<f.length;h++){var i=f[h];if(!(e==a.line&&a.ch>i.to||i.from==null&&e!=a.line||e==b.line&&i.from>b.ch)&&(!c||c(i.marker)))d.push(i.marker.parent||i.marker)}++e});return d},getAllMarks:function(){var a=[];this.iter(function(b){if(b=b.markedSpans)for(var c=0;c<b.length;++c)b[c].from!=null&&a.push(b[c].marker)});return a},posFromIndex:function(a){var b,c=this.first;this.iter(function(d){d=d.text.length+1;if(d>a){b=a;return true}a-=d;++c});return Y(this,W(c,
b))},indexFromPos:function(a){a=Y(this,a);var b=a.ch;if(a.line<this.first||a.ch<0)return 0;this.iter(this.first,a.line,function(c){b+=c.text.length+1});return b},copy:function(a){var b=new Ya(ie(this,this.first,this.first+this.size),this.modeOption,this.first);b.scrollTop=this.scrollTop;b.scrollLeft=this.scrollLeft;b.sel=this.sel;b.extend=false;if(a){b.history.undoDepth=this.history.undoDepth;b.setHistory(this.getHistory())}return b},linkedDoc:function(a){a||(a={});var b=this.first,c=this.first+this.size;
if(a.from!=null&&a.from>b)b=a.from;if(a.to!=null&&a.to<c)c=a.to;b=new Ya(ie(this,b,c),a.mode||this.modeOption,b);if(a.sharedHist)b.history=this.history;(this.linked||(this.linked=[])).push({doc:b,sharedHist:a.sharedHist});b.linked=[{doc:this,isParent:true,sharedHist:a.sharedHist}];a=Ye(this);for(c=0;c<a.length;c++){var d=a[c],e=d.find(),f=b.clipPos(e.from);e=b.clipPos(e.to);if(sa(f,e)){f=nc(b,f,e,d.primary,d.primary.type);d.markers.push(f);f.parent=d}}return b},unlinkDoc:function(a){if(a instanceof
j)a=a.doc;if(this.linked)for(var b=0;b<this.linked.length;++b)if(this.linked[b].doc==a){this.linked.splice(b,1);a.unlinkDoc(this);Wf(Ye(this));break}if(a.history==this.history){var c=[a.id];Wb(a,function(d){c.push(d.id)},true);a.history=new Cd(null);a.history.done=oc(this.history.done,c);a.history.undone=oc(this.history.undone,c)}},iterLinkedDocs:function(a){Wb(this,a)},getMode:function(){return this.mode},getEditor:function(){return this.cm}});Ya.prototype.eachLine=Ya.prototype.iter;qc="iter insert remove copy getEditor".split(" ");
for(var Fd in Ya.prototype)if(Ya.prototype.hasOwnProperty(Fd)&&Ua(qc,Fd)<0)j.prototype[Fd]=function(a){return function(){return a.apply(this.doc,arguments)}}(Ya.prototype[Fd]);pc(Ya);var Xa=j.e_preventDefault=function(a){if(a.preventDefault)a.preventDefault();else a.returnValue=false},kg=j.e_stopPropagation=function(a){if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true},Td=j.e_stop=function(a){Xa(a);kg(a)},qa=j.on=function(a,b,c){if(a.addEventListener)a.addEventListener(b,c,false);
else if(a.attachEvent)a.attachEvent("on"+b,c);else{a=a._handlers||(a._handlers={});(a[b]||(a[b]=[])).push(c)}},yb=j.off=function(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,false);else if(a.detachEvent)a.detachEvent("on"+b,c);else if(a=a._handlers&&a._handlers[b])for(b=0;b<a.length;++b)if(a[b]==c){a.splice(b,1);break}},Oa=j.signal=function(a,b){var c=a._handlers&&a._handlers[b];if(c)for(var d=Array.prototype.slice.call(arguments,2),e=0;e<c.length;++e)c[e].apply(null,d)},Oc=null,oe=30,
Ie=j.Pass={toString:function(){return"CodeMirror.Pass"}},Eb={scroll:false},Wd={origin:"*mouse"},Qc={origin:"+move"};Tc.prototype.set=function(a,b){clearTimeout(this.id);this.id=setTimeout(b,a)};var kb=j.countColumn=function(a,b,c,d,e){if(b==null){b=a.search(/[^\s\u00a0]/);if(b==-1)b=a.length}d=d||0;for(e=e||0;;){var f=a.indexOf("\t",d);if(f<0||f>=b)return e+(b-d);e+=f-d;e+=c-e%c;d=f+1}},Dd=[""],Fc=function(a){a.select()};if(rc)Fc=function(a){a.selectionStart=0;a.selectionEnd=a.value.length};else if(va)Fc=
function(a){try{a.select()}catch(b){}};var lg=/[\u00df\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,pf=j.isWordChar=function(a){return/\w/.test(a)||a>"\u0080"&&(a.toUpperCase()!=a.toLowerCase()||lg.test(a))},gg=/[\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]/,
ic;ic=document.createRange?function(a,b,c){var d=document.createRange();d.setEnd(a,c);d.setStart(a,b);return d}:function(a,b,c){var d=document.body.createTextRange();try{d.moveToElementText(a.parentNode)}catch(e){return d}d.collapse(true);d.moveEnd("character",c);d.moveStart("character",b);return d};if(va&&Fa<11)Ab=function(){try{return document.activeElement}catch(a){return document.body}};var tc=j.rmClass=function(a,b){var c=a.className,d=Pc(b).exec(c);if(d){var e=c.slice(d.index+d[0].length);a.className=
c.slice(0,d.index)+(e?d[1]+e:"")}},vc=j.addClass=function(a,b){var c=a.className;Pc(b).test(c)||(a.className+=(c?" ":"")+b)},le=false,Hf=function(){if(va&&Fa<9)return false;var a=ga("div");return"draggable"in a||"dragDrop"in a}(),je,ge,Tb=j.splitLines="\n\nb".split(/\n/).length!=3?function(a){for(var b=0,c=[],d=a.length;b<=d;){var e=a.indexOf("\n",b);if(e==-1)e=a.length;var f=a.slice(b,a.charAt(e-1)=="\r"?e-1:e),h=f.indexOf("\r");if(h!=-1){c.push(f.slice(0,h));b+=h+1}else{c.push(f);b=e+1}}return c}:
function(a){return a.split(/\r\n?|\n/)},Df=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return false}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}if(!b||b.parentElement()!=a)return false;return b.compareEndPoints("StartToEnd",b)!=0},we=function(){var a=ga("div");if("oncopy"in a)return true;a.setAttribute("oncopy","return;");return typeof a.oncopy=="function"}(),Od=null,Kb={3:"Enter",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",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};j.keyNames=Kb;(function(){for(var a=
0;a<10;a++)Kb[a+48]=Kb[a+96]=String(a);for(a=65;a<=90;a++)Kb[a]=String.fromCharCode(a);for(a=1;a<=12;a++)Kb[a+111]=Kb[a+63235]="F"+a})();var Cc,eg=function(){function a(m){return m<=247?c.charAt(m):1424<=m&&m<=1524?"R":1536<=m&&m<=1773?d.charAt(m-1536):1774<=m&&m<=2220?"r":8192<=m&&m<=8203?"w":m==8204?"b":"L"}function b(m,o,t){this.level=m;this.from=o;this.to=t}var c="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",
d="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,h=/[LRr]/,i=/[Lb1n]/,k=/[1n]/;return function(m){if(!e.test(m))return false;for(var o=m.length,t=[],p=0,D;p<o;++p)t.push(a(m.charCodeAt(p)));p=0;for(var L="L";p<o;++p){D=t[p];if(D=="m")t[p]=L;else L=D}p=
0;for(L="L";p<o;++p){D=t[p];if(D=="1"&&L=="r")t[p]="n";else if(h.test(D)){L=D;if(D=="r")t[p]="R"}}p=1;for(L=t[0];p<o-1;++p){D=t[p];if(D=="+"&&L=="1"&&t[p+1]=="1")t[p]="1";else if(D==","&&L==t[p+1]&&(L=="1"||L=="n"))t[p]=L;L=D}for(p=0;p<o;++p){D=t[p];if(D==",")t[p]="N";else if(D=="%"){for(L=p+1;L<o&&t[L]=="%";++L);var ea=p&&t[p-1]=="!"||L<o&&t[L]=="1"?"1":"N";for(D=p;D<L;++D)t[D]=ea;p=L-1}}p=0;for(L="L";p<o;++p){D=t[p];if(L=="L"&&D=="1")t[p]="L";else if(h.test(D))L=D}for(p=0;p<o;++p)if(f.test(t[p])){for(L=
p+1;L<o&&f.test(t[L]);++L);D=(L<o?t[L]:"L")=="L";ea=(p?t[p-1]:"L")=="L"||D?"L":"R";for(D=p;D<L;++D)t[D]=ea;p=L-1}L=[];var fa;for(p=0;p<o;)if(i.test(t[p])){D=p;for(++p;p<o&&i.test(t[p]);++p);L.push(new b(0,D,p))}else{var na=p;ea=L.length;for(++p;p<o&&t[p]!="L";++p);for(D=na;D<p;)if(k.test(t[D])){na<D&&L.splice(ea,0,new b(1,na,D));na=D;for(++D;D<p&&k.test(t[D]);++D);L.splice(ea,0,new b(2,na,D));na=D}else++D;na<p&&L.splice(ea,0,new b(1,na,p))}if(L[0].level==1&&(fa=m.match(/^\s+/))){L[0].from=fa[0].length;
L.unshift(new b(0,0,fa[0].length))}if(Ia(L).level==1&&(fa=m.match(/\s+$/))){Ia(L).to-=fa[0].length;L.push(new b(0,o-fa[0].length,o))}L[0].level!=Ia(L).level&&L.push(new b(L[0].level,o,o));return L}}();j.version="4.11.1";return j});CodeMirror.defineMode("hl7",function(j,ca){var X=ca.DelimiterRegex||/(\\|&|~|\^|\|)/;return{token:function(w){if(w.string===ca.LfToken||w.string===ca.CrToken||w.string===ca.CrToken+ca.LfToken){w.next();return null}var u=w.peek();if(w.sol())if(/\w/.test(u)){w.eatWhile(/\w/);return"keyword"}if(u.match(X)){w.next();return"delim"}w.next();return null}}});(function(j){if(typeof exports=="object"&&typeof module=="object")j(require("../../lib/codemirror"));else typeof define=="function"&&define.amd?define(["../../lib/codemirror"],j):j(CodeMirror)})(function(j){function ca(y){for(var Q={},$=0;$<y.length;++$)Q[y[$]]=true;return Q}function X(y,Q){for(var $=false,Ga;(Ga=y.next())!=null;){if($&&Ga=="/"){Q.tokenize=null;break}$=Ga=="*"}return["comment","comment"]}function w(y,Q){if(y.skipTo("--\>")){y.match("--\>");Q.tokenize=null}else y.skipToEnd();return["comment",
"comment"]}j.defineMode("css",function(y,Q){function $(r,F){P=F;return r}function Ga(r,F){var s=r.next();if(O[s]){var U=O[s](r,F);if(U!==false)return U}if(s=="@"){r.eatWhile(/[\w\\\-]/);return $("def",r.current())}else if(s=="="||(s=="~"||s=="|")&&r.eat("="))return $(null,"compare");else if(s=='"'||s=="'"){F.tokenize=cb(s);return F.tokenize(r,F)}else if(s=="#"){r.eatWhile(/[\w\\\-]/);return $("atom","hash")}else if(s=="!"){r.match(/^\s*\w*/);return $("keyword","important")}else if(/\d/.test(s)||s==
"."&&r.eat(/\d/)){r.eatWhile(/[\w.%]/);return $("number","unit")}else if(s==="-")if(/[\d.]/.test(r.peek())){r.eatWhile(/[\w.%]/);return $("number","unit")}else{if(r.match(/^\w+-/))return $("meta","meta")}else if(/[,+>*\/]/.test(s))return $(null,"select-op");else if(s=="."&&r.match(/^-?[_a-z][_a-z0-9-]*/i))return $("qualifier","qualifier");else if(/[:;{}\[\]\(\)]/.test(s))return $(null,s);else if(s=="u"&&r.match("rl(")){r.backUp(1);F.tokenize=Va;return $("property","word")}else if(/[\w\\\-]/.test(s)){r.eatWhile(/[\w\\\-]/);
return $("property","word")}else return $(null,null)}function cb(r){return function(F,s){for(var U=false,ja;(ja=F.next())!=null;){if(ja==r&&!U){r==")"&&F.backUp(1);break}U=!U&&ja=="\\"}if(ja==r||!U&&r!=")")s.tokenize=null;return $("string","string")}}function Va(r,F){r.next();F.tokenize=r.match(/\s*[\"\')]/,false)?null:cb(")");return $(null,"(")}function Ja(r,F,s){this.type=r;this.indent=F;this.prev=s}function Ea(r,F,s){r.context=new Ja(s,F.indentation()+G,r.context);return s}function S(r){r.context=
r.context.prev;return r.context.type}function T(r,F,s,U){for(U=U||1;U>0;U--)s.context=s.context.prev;return R[s.context.type](r,F,s)}function C(r){r=r.current().toLowerCase();V=ma.hasOwnProperty(r)?"atom":Z.hasOwnProperty(r)?"keyword":"variable"}Q.propertyKeywords||(Q=j.resolveMode("text/css"));var G=y.indentUnit,O=Q.tokenHooks,ba=Q.mediaTypes||{},wa=Q.mediaFeatures||{},ra=Q.propertyKeywords||{},la=Q.nonStandardPropertyKeywords||{},Z=Q.colorKeywords||{},ma=Q.valueKeywords||{},Aa=Q.fontProperties||
{},ua=Q.allowNested,P,V,R={};R.top=function(r,F,s){if(r=="{")return Ea(s,F,"block");else if(r=="}"&&s.context.prev)return S(s);else if(r=="@media")return Ea(s,F,"media");else if(r=="@font-face")return"font_face_before";else if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(r))return"keyframes";else if(r&&r.charAt(0)=="@")return Ea(s,F,"at");else if(r=="hash")V="builtin";else if(r=="word")V="tag";else if(r=="variable-definition")return"maybeprop";else if(r=="interpolation")return Ea(s,F,"interpolation");
else if(r==":")return"pseudo";else if(ua&&r=="(")return Ea(s,F,"parens");return s.context.type};R.block=function(r,F,s){if(r=="word"){r=F.current().toLowerCase();if(ra.hasOwnProperty(r)){V="property";return"maybeprop"}else if(la.hasOwnProperty(r)){V="string-2";return"maybeprop"}else if(ua){V=F.match(/^\s*:(?:\s|$)/,false)?"property":"tag";return"block"}else{V+=" error";return"maybeprop"}}else if(r=="meta")return"block";else if(!ua&&(r=="hash"||r=="qualifier")){V="error";return"block"}else return R.top(r,
F,s)};R.maybeprop=function(r,F,s){if(r==":")return Ea(s,F,"prop");return R[s.context.type](r,F,s)};R.prop=function(r,F,s){if(r==";")return S(s);if(r=="{"&&ua)return Ea(s,F,"propBlock");if(r=="}"||r=="{")return T(r,F,s);if(r=="(")return Ea(s,F,"parens");if(r=="hash"&&!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(F.current()))V+=" error";else if(r=="word")C(F);else if(r=="interpolation")return Ea(s,F,"interpolation");return"prop"};R.propBlock=function(r,F,s){if(r=="}")return S(s);if(r=="word"){V="property";
return"maybeprop"}return s.context.type};R.parens=function(r,F,s){if(r=="{"||r=="}")return T(r,F,s);if(r==")")return S(s);if(r=="(")return Ea(s,F,"parens");r=="word"&&C(F);return"parens"};R.pseudo=function(r,F,s){if(r=="word"){V="variable-3";return s.context.type}return R[s.context.type](r,F,s)};R.media=function(r,F,s){if(r=="(")return Ea(s,F,"media_parens");if(r=="}")return T(r,F,s);if(r=="{")return S(s)&&Ea(s,F,ua?"block":"top");if(r=="word"){r=F.current().toLowerCase();V=r=="only"||r=="not"||r==
"and"?"keyword":ba.hasOwnProperty(r)?"attribute":wa.hasOwnProperty(r)?"property":"error"}return s.context.type};R.media_parens=function(r,F,s){if(r==")")return S(s);if(r=="{"||r=="}")return T(r,F,s,2);return R.media(r,F,s)};R.font_face_before=function(r,F,s){if(r=="{")return Ea(s,F,"font_face");return R[s.context.type](r,F,s)};R.font_face=function(r,F,s){if(r=="}")return S(s);if(r=="word"){V=Aa.hasOwnProperty(F.current().toLowerCase())?"property":"error";return"maybeprop"}return"font_face"};R.keyframes=
function(r,F,s){if(r=="word"){V="variable";return"keyframes"}if(r=="{")return Ea(s,F,"top");return R[s.context.type](r,F,s)};R.at=function(r,F,s){if(r==";")return S(s);if(r=="{"||r=="}")return T(r,F,s);if(r=="word")V="tag";else if(r=="hash")V="builtin";return"at"};R.interpolation=function(r,F,s){if(r=="}")return S(s);if(r=="{"||r==";")return T(r,F,s);if(r!="variable")V="error";return"interpolation"};return{startState:function(r){return{tokenize:null,state:"top",context:new Ja("top",r||0,null)}},token:function(r,
F){if(!F.tokenize&&r.eatSpace())return null;var s=(F.tokenize||Ga)(r,F);if(s&&typeof s=="object"){P=s[1];s=s[0]}V=s;F.state=R[F.state](P,r,F);return V},indent:function(r,F){var s=r.context,U=F&&F.charAt(0),ja=s.indent;if(s.type=="prop"&&(U=="}"||U==")"))s=s.prev;if(s.prev&&(U=="}"&&(s.type=="block"||s.type=="top"||s.type=="interpolation"||s.type=="font_face")||U==")"&&(s.type=="parens"||s.type=="media_parens")||U=="{"&&(s.type=="at"||s.type=="media")))ja=s.indent-G;return ja},electricChars:"}",blockCommentStart:"/*",
blockCommentEnd:"*/",fold:"brace"}});var u=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],g=ca(u),l=["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"],q=ca(l),v=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment",
"background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice",
"border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear",
"clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit",
"fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area",
"grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift",
"line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style",
"outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent",
"resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line",
"text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align",
"visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker",
"marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],A=ca(v),M=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color",
"scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],x=ca(M),J=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta",
"darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray",
"lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred",
"papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],H=ca(J),E=["above","absolute","activeborder","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alternate","always",
"amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","cambodian","capitalize","caps-lock-indicator","caption","captiontext",
"caret","cell","center","checkbox","circle","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","cover","crop","cross","crosshair","currentcolor","cursive","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","document","dot-dash",
"dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig",
"ew-resize","expanded","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline",
"inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","justify","kannada","katakana","katakana-iroha","keep-all","khmer","landscape","lao","large","larger","left","level","lighter","line-through","linear","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","malayalam","match","media-controls-background",
"media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian",
"monospace","move","multiple","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","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap",
"preserve-3d","progress","push-button","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show",
"sidama","single","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group",
"table-row","table-row-group","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","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url",
"vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","x-large","x-small","xor","xx-large","xx-small"],B=ca(E),z=ca(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]);u=u.concat(l).concat(v).concat(M).concat(J).concat(E);j.registerHelper("hintWords","css",u);j.defineMIME("text/css",{mediaTypes:g,mediaFeatures:q,propertyKeywords:A,
nonStandardPropertyKeywords:x,colorKeywords:H,valueKeywords:B,fontProperties:z,tokenHooks:{"<":function(y,Q){if(!y.match("!--"))return false;Q.tokenize=w;return w(y,Q)},"/":function(y,Q){if(!y.eat("*"))return false;Q.tokenize=X;return X(y,Q)}},name:"css"});j.defineMIME("text/x-scss",{mediaTypes:g,mediaFeatures:q,propertyKeywords:A,nonStandardPropertyKeywords:x,colorKeywords:H,valueKeywords:B,fontProperties:z,allowNested:true,tokenHooks:{"/":function(y,Q){if(y.eat("/")){y.skipToEnd();return["comment",
"comment"]}else if(y.eat("*")){Q.tokenize=X;return X(y,Q)}else return["operator","operator"]},":":function(y){if(y.match(/\s*\{/))return[null,"{"];return false},$:function(y){y.match(/^[\w-]+/);if(y.match(/^\s*:/,false))return["variable-2","variable-definition"];return["variable-2","variable"]},"#":function(y){if(!y.eat("{"))return false;return[null,"interpolation"]}},name:"css",helperType:"scss"});j.defineMIME("text/x-less",{mediaTypes:g,mediaFeatures:q,propertyKeywords:A,nonStandardPropertyKeywords:x,
colorKeywords:H,valueKeywords:B,fontProperties:z,allowNested:true,tokenHooks:{"/":function(y,Q){if(y.eat("/")){y.skipToEnd();return["comment","comment"]}else if(y.eat("*")){Q.tokenize=X;return X(y,Q)}else return["operator","operator"]},"@":function(y){if(y.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,false))return false;y.eatWhile(/[\w\\\-]/);if(y.match(/^\s*:/,false))return["variable-2","variable-definition"];return["variable-2","variable"]},
"&":function(){return["atom","atom"]}},name:"css",helperType:"less"})});CodeMirror.defineMode("dbs",function(j,ca){function X(J,H){var E=J.next();if(E=='"'||E=="'"){E=w(E);H.tokenize=E;return E(J,H)}else if(!/[\[\]{}\(\),;\.]/.test(E))if(/\d/.test(E)){J.eatWhile(/[\w\.]/);return"number"}else if(E=="/")if(J.eat("*")){E=u;H.tokenize=E;return E(J,H)}else{J.eatWhile(x);return"operator"}else if(E=="-")if(J.eat("-")){J.skipToEnd();return"comment"}else{J.eatWhile(x);return"operator"}else if(E=="@"||E=="$"){J.eatWhile(/[\w\d\$_]/);return"variable"}else if(x.test(E)){J.eatWhile(x);
return"operator"}else{J.eatWhile(/[\w\$_]/);if(l&&l.propertyIsEnumerable(J.current().toLowerCase()))return"keyword";if(q&&q.propertyIsEnumerable(J.current().toLowerCase()))return"builtin";if(v&&v.propertyIsEnumerable(J.current().toLowerCase()))return"variable-2";if(A&&A.propertyIsEnumerable(J.current().toLowerCase()))return"variable-3";return"dbs-word"}}function w(J){return function(H,E){for(var B=false,z,y=false;(z=H.next())!=null;){if(z==J&&!B){y=true;break}B=!B&&z=="\\"}if(y||!(B||M))E.tokenize=
X;return"dbs-string"}}function u(J,H){for(var E=false,B;B=J.next();){if(B=="/"&&E){H.tokenize=X;break}E=B=="*"}return"dbs-comment"}function g(J){var H={};J=J.split(" ");for(var E=0;E<J.length;++E)H[J[E]]=true;return H}var l=g("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),
q=g("abs acos add_months ascii asin atan atan2 average bfilename ceil chartorowid chr concat convert cos cosh count decode deref dual dump dup_val_on_index empty error exp false floor found glb greatest hextoraw initcap instr instrb isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mod months_between new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null nvl others power rawtohex reftohex round rowcount rowidtochar rpad rtrim sign sin sinh soundex sqlcode sqlerrm sqrt stddev substr substrb sum sysdate tan tanh to_char to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid upper user userenv variance vsize"),
v=g("bfile blob character clob dec float int integer mlslabel natural naturaln nchar nclob number numeric nvarchar2 real rowtype signtype smallint string varchar varchar2"),A=g("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),
M=ca.multiLineStrings,x=/[+\-*&%=<>!?:\/|]/;return{startState:function(){return{tokenize:X,startOfLine:true}},token:function(J,H){if(J.eatSpace())return null;return H.tokenize(J,H)}}});(function(j){if(typeof exports=="object"&&typeof module=="object")j(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css"));else typeof define=="function"&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],j):j(CodeMirror)})(function(j){j.defineMode("htmlmixed",function(ca,X){function w(H,E){var B=E.htmlState.tagName;if(B)B=B.toLowerCase();var z=q.token(H,E.htmlState);if(B=="script"&&/\btag\b/.test(z)&&
H.current()==">"){if((B=(B=H.string.slice(Math.max(0,H.pos-100),H.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i))?B[1]:"")&&/[\"\']/.test(B.charAt(0)))B=B.slice(1,B.length-1);for(var y=0;y<A.length;++y){var Q=A[y];if(typeof Q.matches=="string"?B==Q.matches:Q.matches.test(B)){if(Q.mode){E.token=g;E.localMode=Q.mode;E.localState=Q.mode.startState&&Q.mode.startState(q.indent(E.htmlState,""))}break}}}else if(B=="style"&&/\btag\b/.test(z)&&H.current()==">"){E.token=l;E.localMode=v;E.localState=
v.startState(q.indent(E.htmlState,""))}return z}function u(H,E,B){var z=H.current(),y=z.search(E);if(y>-1)H.backUp(z.length-y);else if(z.match(/<\/?$/)){H.backUp(z.length);H.match(E,false)||H.match(z)}return B}function g(H,E){if(H.match(/^<\/\s*script\s*>/i,false)){E.token=w;return E.localState=E.localMode=null}return u(H,/<\/\s*script\s*>/,E.localMode.token(H,E.localState))}function l(H,E){if(H.match(/^<\/\s*style\s*>/i,false)){E.token=w;return E.localState=E.localMode=null}return u(H,/<\/\s*style\s*>/,
v.token(H,E.localState))}var q=j.getMode(ca,{name:"xml",htmlMode:true,multilineTagIndentFactor:X.multilineTagIndentFactor,multilineTagIndentPastTag:X.multilineTagIndentPastTag}),v=j.getMode(ca,"css"),A=[],M=X&&X.scriptTypes;A.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:j.getMode(ca,"javascript")});if(M)for(var x=0;x<M.length;++x){var J=M[x];A.push({matches:J.matches,mode:J.mode&&j.getMode(ca,J.mode)})}A.push({matches:/./,mode:j.getMode(ca,"text/plain")});return{startState:function(){var H=
q.startState();return{token:w,localMode:null,localState:null,htmlState:H}},copyState:function(H){if(H.localState)var E=j.copyState(H.localMode,H.localState);return{token:H.token,localMode:H.localMode,localState:E,htmlState:j.copyState(q,H.htmlState)}},token:function(H,E){return E.token(H,E)},indent:function(H,E){return!H.localMode||/^\s*<\//.test(E)?q.indent(H.htmlState,E):H.localMode.indent?H.localMode.indent(H.localState,E):j.Pass},innerMode:function(H){return{state:H.localState||H.htmlState,mode:H.localMode||
q}}}},"xml","javascript","css");j.defineMIME("text/html","htmlmixed")});(function(j){if(typeof exports=="object"&&typeof module=="object")j(require("../../lib/codemirror"));else typeof define=="function"&&define.amd?define(["../../lib/codemirror"],j):j(CodeMirror)})(function(j){j.defineMode("javascript",function(ca,X){function w(n,I,N){ub=n;Hb=N;return I}function u(n,I){var N=n.next();if(N=='"'||N=="'"){I.tokenize=g(N);return I.tokenize(n,I)}else if(N=="."&&n.match(/^\d+(?:[eE][+\-]?\d+)?/))return w("number","number");else if(N=="."&&n.match(".."))return w("spread","meta");
else if(/[\[\]{}\(\),;\:\.]/.test(N))return w(N);else if(N=="="&&n.eat(">"))return w("=>","operator");else if(N=="0"&&n.eat(/x/i)){n.eatWhile(/[\da-f]/i);return w("number","number")}else if(/\d/.test(N)){n.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);return w("number","number")}else if(N=="/")if(n.eat("*")){I.tokenize=l;return l(n,I)}else if(n.eat("/")){n.skipToEnd();return w("comment","comment")}else if(I.lastType=="operator"||I.lastType=="keyword c"||I.lastType=="sof"||/^[\[{}\(,;:]$/.test(I.lastType)){N=
false;for(var K,ka=false;(K=n.next())!=null;){if(!N){if(K=="/"&&!ka)break;if(K=="[")ka=true;else if(ka&&K=="]")ka=false}N=!N&&K=="\\"}n.eatWhile(/[gimy]/);return w("regexp","string-2")}else{n.eatWhile(Db);return w("operator","operator",n.current())}else if(N=="`"){I.tokenize=q;return q(n,I)}else if(N=="#"){n.skipToEnd();return w("error","error")}else if(Db.test(N)){n.eatWhile(Db);return w("operator","operator",n.current())}else if(Za.test(N)){n.eatWhile(Za);N=n.current();return(K=hb.propertyIsEnumerable(N)&&
hb[N])&&I.lastType!="."?w(K.type,K.style,N):w("variable","variable",N)}}function g(n){return function(I,N){var K=false,ka;if(hc&&I.peek()=="@"&&I.match(ad)){N.tokenize=u;return w("jsonld-keyword","meta")}for(;(ka=I.next())!=null;){if(ka==n&&!K)break;K=!K&&ka=="\\"}if(!K)N.tokenize=u;return w("string","string")}}function l(n,I){for(var N=false,K;K=n.next();){if(K=="/"&&N){I.tokenize=u;break}N=K=="*"}return w("comment","comment")}function q(n,I){for(var N=false,K;(K=n.next())!=null;){if(!N&&(K=="`"||
K=="$"&&n.eat("{"))){I.tokenize=u;break}N=!N&&K=="\\"}return w("quasi","string-2",n.current())}function v(n,I){if(I.fatArrowAt)I.fatArrowAt=null;var N=n.string.indexOf("=>",n.start);if(!(N<0)){var K=0,ka=false;for(N-=1;N>=0;--N){var za=n.string.charAt(N),Ra=bd.indexOf(za);if(Ra>=0&&Ra<3){if(!K){++N;break}if(--K==0)break}else if(Ra>=3&&Ra<6)++K;else if(Za.test(za))ka=true;else if(/["'\/]/.test(za))return;else if(ka&&!K){++N;break}}if(ka&&!K)I.fatArrowAt=N}}function A(n,I,N,K,ka,za){this.indented=n;
this.column=I;this.type=N;this.prev=ka;this.info=za;if(K!=null)this.align=K}function M(){for(var n=arguments.length-1;n>=0;n--)aa.cc.push(arguments[n])}function x(){M.apply(null,arguments);return true}function J(n){function I(K){for(;K;K=K.next)if(K.name==n)return true;return false}var N=aa.state;if(N.context){aa.marked="def";if(!I(N.localVars))N.localVars={name:n,next:N.localVars}}else if(!I(N.globalVars))if(X.globalVars)N.globalVars={name:n,next:N.globalVars}}function H(){aa.state.context={prev:aa.state.context,
vars:aa.state.localVars};aa.state.localVars=Ac}function E(){aa.state.localVars=aa.state.context.vars;aa.state.context=aa.state.context.prev}function B(n,I){var N=function(){var K=aa.state,ka=K.indented;if(K.lexical.type=="stat")ka=K.lexical.indented;else for(var za=K.lexical;za&&za.type==")"&&za.align;za=za.prev)ka=za.indented;K.lexical=new A(ka,aa.stream.column(),n,null,K.lexical,I)};N.lex=true;return N}function z(){var n=aa.state;if(n.lexical.prev){if(n.lexical.type==")")n.indented=n.lexical.indented;
n.lexical=n.lexical.prev}}function y(n){function I(N){return N==n?x():n==";"?M():x(I)}return I}function Q(n,I){if(n=="var")return x(B("vardef",I.length),R,y(";"),z);if(n=="keyword a")return x(B("form"),$,Q,z);if(n=="keyword b")return x(B("form"),Q,z);if(n=="{")return x(B("}"),ua,z);if(n==";")return x();if(n=="if"){aa.state.lexical.info=="else"&&aa.state.cc[aa.state.cc.length-1]==z&&aa.state.cc.pop()();return x(B("form"),$,Q,z,ja)}if(n=="function")return x(Ba);if(n=="for")return x(B("form"),Y,Q,z);
if(n=="variable")return x(B("stat"),ba);if(n=="switch")return x(B("form"),$,B("}","switch"),y("{"),ua,z,z);if(n=="case")return x($,y(":"));if(n=="default")return x(y(":"));if(n=="catch")return x(B("form"),H,y("("),bc,y(")"),Q,z,E);if(n=="module")return x(B("form"),H,Zc,E,z);if(n=="class")return x(B("form"),cc,z);if(n=="export")return x(B("form"),Yc,z);if(n=="import")return x(B("form"),ec,z);return M(B("stat"),$,y(";"),z)}function $(n){return cb(n,false)}function Ga(n){return cb(n,true)}function cb(n,
I){if(aa.state.fatArrowAt==aa.stream.start){var N=I?O:G;if(n=="(")return x(H,B(")"),ma(r,")"),z,y("=>"),N,E);else if(n=="variable")return M(H,r,y("=>"),N,E)}N=I?S:Ea;if(cd.hasOwnProperty(n))return x(N);if(n=="function")return x(Ba,N);if(n=="keyword c")return x(I?Ja:Va);if(n=="(")return x(B(")"),Va,Fb,y(")"),z,N);if(n=="operator"||n=="spread")return x(I?Ga:$);if(n=="[")return x(B("]"),Rb,z,N);if(n=="{")return Aa(ra,"}",null,N);if(n=="quasi")return M(T,N);return x()}function Va(n){if(n.match(/[;\}\)\],]/))return M();
return M($)}function Ja(n){if(n.match(/[;\}\)\],]/))return M();return M(Ga)}function Ea(n,I){if(n==",")return x($);return S(n,I,false)}function S(n,I,N){var K=N==false?Ea:S,ka=N==false?$:Ga;if(n=="=>")return x(H,N?O:G,E);if(n=="operator"){if(/\+\+|--/.test(I))return x(K);if(I=="?")return x($,y(":"),ka);return x(ka)}if(n=="quasi")return M(T,K);if(n!=";"){if(n=="(")return Aa(Ga,")","call",K);if(n==".")return x(wa,K);if(n=="[")return x(B("]"),Va,y("]"),z,K)}}function T(n,I){if(n!="quasi")return M();
if(I.slice(I.length-2)!="${")return x(T);return x($,C)}function C(n){if(n=="}"){aa.marked="string-2";aa.state.tokenize=q;return x(T)}}function G(n){v(aa.stream,aa.state);return M(n=="{"?Q:$)}function O(n){v(aa.stream,aa.state);return M(n=="{"?Q:Ga)}function ba(n){if(n==":")return x(z,Q);return M(Ea,y(";"),z)}function wa(n){if(n=="variable"){aa.marked="property";return x()}}function ra(n,I){if(n=="variable"||aa.style=="keyword"){aa.marked="property";if(I=="get"||I=="set")return x(la);return x(Z)}else if(n==
"number"||n=="string"){aa.marked=hc?"property":aa.style+" property";return x(Z)}else if(n=="jsonld-keyword")return x(Z);else if(n=="[")return x($,y("]"),Z)}function la(n){if(n!="variable")return M(Z);aa.marked="property";return x(Ba)}function Z(n){if(n==":")return x(Ga);if(n=="(")return M(Ba)}function ma(n,I){function N(K){if(K==","){K=aa.state.lexical;if(K.info=="call")K.pos=(K.pos||0)+1;return x(n,N)}if(K==I)return x();return x(y(I))}return function(K){if(K==I)return x();return M(n,N)}}function Aa(n,
I,N){for(var K=3;K<arguments.length;K++)aa.cc.push(arguments[K]);return x(B(I,N),ma(n,I),z)}function ua(n){if(n=="}")return x();return M(Q,ua)}function P(n){if(yc&&n==":")return x(V)}function V(n){if(n=="variable"){aa.marked="variable-3";return x()}}function R(){return M(r,P,s,U)}function r(n,I){if(n=="variable"){J(I);return x()}if(n=="[")return Aa(r,"]");if(n=="{")return Aa(F,"}")}function F(n,I){if(n=="variable"&&!aa.stream.match(/^\s*:/,false)){J(I);return x(s)}if(n=="variable")aa.marked="property";
return x(y(":"),r,s)}function s(n,I){if(I=="=")return x(Ga)}function U(n){if(n==",")return x(R)}function ja(n,I){if(n=="keyword b"&&I=="else")return x(B("form","else"),Q,z)}function Y(n){if(n=="(")return x(B(")"),Ka,y(")"),z)}function Ka(n){if(n=="var")return x(R,y(";"),xa);if(n==";")return x(xa);if(n=="variable")return x(Ha);return M($,y(";"),xa)}function Ha(n,I){if(I=="in"||I=="of"){aa.marked="keyword";return x($)}return x(Ea,xa)}function xa(n,I){if(n==";")return x(eb);if(I=="in"||I=="of"){aa.marked=
"keyword";return x($)}return M($,y(";"),eb)}function eb(n){n!=")"&&x($)}function Ba(n,I){if(I=="*"){aa.marked="keyword";return x(Ba)}if(n=="variable"){J(I);return x(Ba)}if(n=="(")return x(H,B(")"),ma(bc,")"),z,Q,E)}function bc(n){if(n=="spread")return x(bc);return M(r,P)}function cc(n,I){if(n=="variable"){J(I);return x(Ma)}}function Ma(n,I){if(I=="extends")return x($,Ma);if(n=="{")return x(B("}"),qb,z)}function qb(n,I){if(n=="variable"||aa.style=="keyword"){aa.marked="property";if(I=="get"||I=="set")return x(Xc,
Ba,qb);return x(Ba,qb)}if(I=="*"){aa.marked="keyword";return x(qb)}if(n==";")return x(qb);if(n=="}")return x()}function Xc(n){if(n!="variable")return M();aa.marked="property";return x()}function Zc(n,I){if(n=="string")return x(Q);if(n=="variable"){J(I);return x(fc)}}function Yc(n,I){if(I=="*"){aa.marked="keyword";return x(fc,y(";"))}if(I=="default"){aa.marked="keyword";return x($,y(";"))}return M(Q)}function ec(n){if(n=="string")return x();return M(xc,fc)}function xc(n,I){if(n=="{")return Aa(xc,"}");
n=="variable"&&J(I);return x()}function fc(n,I){if(I=="from"){aa.marked="keyword";return x($)}}function Rb(n){if(n=="]")return x();return M(Ga,Ld)}function Ld(n){if(n=="for")return M(Fb,y("]"));if(n==",")return x(ma(Ja,"]"));return M(ma(Ga,"]"))}function Fb(n){if(n=="for")return x(Y,Fb);if(n=="if")return x($,Fb)}var db=ca.indentUnit,$c=X.statementIndent,hc=X.jsonld,fb=X.json||hc,yc=X.typescript,Za=X.wordCharacters||/[\w$\xa1-\uffff]/,hb=function(){function n(vb){return{type:vb,style:"keyword"}}var I=
n("keyword a"),N=n("keyword b"),K=n("keyword c"),ka=n("operator"),za={type:"atom",style:"atom"};I={"if":n("if"),"while":I,"with":I,"else":N,"do":N,"try":N,"finally":N,"return":K,"break":K,"continue":K,"new":K,"delete":K,"throw":K,"debugger":K,"var":n("var"),"const":n("var"),let:n("var"),"function":n("function"),"catch":n("catch"),"for":n("for"),"switch":n("switch"),"case":n("case"),"default":n("default"),"in":ka,"typeof":ka,"instanceof":ka,"true":za,"false":za,"null":za,undefined:za,NaN:za,Infinity:za,
"this":n("this"),module:n("module"),"class":n("class"),"super":n("atom"),yield:K,"export":n("export"),"import":n("import"),"extends":K};if(yc){N={type:"variable",style:"variable-3"};N={"interface":n("interface"),"extends":n("extends"),constructor:n("constructor"),"public":n("public"),"private":n("private"),"protected":n("protected"),"static":n("static"),string:N,number:N,bool:N,any:N};for(var Ra in N)I[Ra]=N[Ra]}return I}(),Db=/[+\-*&%=<>!?|~^]/,ad=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,
ub,Hb,bd="([{}])",cd={atom:true,number:true,variable:true,string:true,regexp:true,"this":true,"jsonld-keyword":true},aa={state:null,column:null,marked:null,cc:null},Ac={name:"this",next:{name:"arguments"}};z.lex=true;return{startState:function(n){n={tokenize:u,lastType:"sof",cc:[],lexical:new A((n||0)-db,0,"block",false),localVars:X.localVars,context:X.localVars&&{vars:X.localVars},indented:0};if(X.globalVars&&typeof X.globalVars=="object")n.globalVars=X.globalVars;return n},token:function(n,I){if(n.sol()){if(!I.lexical.hasOwnProperty("align"))I.lexical.align=
false;I.indented=n.indentation();v(n,I)}if(I.tokenize!=l&&n.eatSpace())return null;var N=I.tokenize(n,I);if(ub=="comment")return N;I.lastType=ub=="operator"&&(Hb=="++"||Hb=="--")?"incdec":ub;var K;a:{var ka=ub,za=Hb,Ra=I.cc;aa.state=I;aa.stream=n;aa.marked=null;aa.cc=Ra;aa.style=N;if(!I.lexical.hasOwnProperty("align"))I.lexical.align=true;for(;;)if((Ra.length?Ra.pop():fb?$:Q)(ka,za)){for(;Ra.length&&Ra[Ra.length-1].lex;)Ra.pop()();if(aa.marked){K=aa.marked;break a}if(K=ka=="variable")b:{for(K=I.localVars;K;K=
K.next)if(K.name==za){K=true;break b}for(ka=I.context;ka;ka=ka.prev)for(K=ka.vars;K;K=K.next)if(K.name==za){K=true;break b}K=void 0}if(K){K="variable-2";break a}K=N;break a}}return K},indent:function(n,I){if(n.tokenize==l)return j.Pass;if(n.tokenize!=u)return 0;var N=I&&I.charAt(0),K=n.lexical;if(!/^\s*else\b/.test(I))for(var ka=n.cc.length-1;ka>=0;--ka){var za=n.cc[ka];if(za==z)K=K.prev;else if(za!=ja)break}if(K.type=="stat"&&N=="}")K=K.prev;if($c&&K.type==")"&&K.prev.type=="stat")K=K.prev;ka=K.type;
za=N==ka;return ka=="vardef"?K.indented+(n.lastType=="operator"||n.lastType==","?K.info+1:0):ka=="form"&&N=="{"?K.indented:ka=="form"?K.indented+db:ka=="stat"?K.indented+(n.lastType=="operator"||n.lastType==","||Db.test(I.charAt(0))||/[,.]/.test(I.charAt(0))?$c||db:0):K.info=="switch"&&!za&&X.doubleIndentSwitch!=false?K.indented+(/^(?:case|default)\b/.test(I)?db:2*db):K.align?K.column+(za?0:1):K.indented+(za?0:db)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:fb?null:"/*",blockCommentEnd:fb?
null:"*/",lineComment:fb?null:"//",fold:"brace",helperType:fb?"json":"javascript",jsonldMode:hc,jsonMode:fb}});j.registerHelper("wordChars","javascript",/[\w$]/);j.defineMIME("text/javascript","javascript");j.defineMIME("text/ecmascript","javascript");j.defineMIME("application/javascript","javascript");j.defineMIME("application/x-javascript","javascript");j.defineMIME("application/ecmascript","javascript");j.defineMIME("application/json",{name:"javascript",json:true});j.defineMIME("application/x-json",
{name:"javascript",json:true});j.defineMIME("application/ld+json",{name:"javascript",jsonld:true});j.defineMIME("text/typescript",{name:"javascript",typescript:true});j.defineMIME("application/typescript",{name:"javascript",typescript:true})});(function(j){if(typeof exports=="object"&&typeof module=="object")j(require("../../lib/codemirror"));else typeof define=="function"&&define.amd?define(["../../lib/codemirror"],j):j(CodeMirror)})(function(j){j.defineMode("lua",function(ca,X){function w(E){return RegExp("^(?:"+E.join("|")+")$","i")}function u(E,B){var z=E.next();if(z=="-"&&E.eat("-")){if(E.eat("[")){for(z={level:0,isBlock:false};E.eat("=");)++z.level;if(E.next()=="[")z.isBlock=true;if(z.isBlock){E.backUp(z.level);return(B.cur=g(z.level,
"comment"))(E,B)}}E.skipToEnd();return"comment"}if(z=='"'||z=="'")return(B.cur=l(z))(E,B);if(z=="["&&/[\[=]/.test(E.peek())){z=g;for(var y=0;E.eat("=");)++y;E.eat("[");return(B.cur=z(y,"string"))(E,B)}if(/\d/.test(z)){E.eatWhile(/[\w.%]/);return"number"}if(/[\w_]/.test(z)){E.eatWhile(/[\w\\\-_.]/);return"variable"}return null}function g(E,B){return function(z,y){for(var Q=null,$;($=z.next())!=null;)if(Q==null){if($=="]")Q=0}else if($=="=")++Q;else if($=="]"&&Q==E){y.cur=u;break}else Q=null;return B}}
function l(E){return function(B,z){for(var y=false,Q;(Q=B.next())!=null;){if(Q==E&&!y)break;y=!y&&Q=="\\"}if(!y)z.cur=u;return"string"}}var q=ca.indentUnit,v=w(X.specials||[]),A=w(["_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load","loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require","select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall","coroutine.create","coroutine.resume",
"coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield","debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable","debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable","debug.setupvalue","debug.traceback","close","flush","lines","read","seek","setvbuf","write","io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin","io.stdout","io.tmpfile",
"io.type","io.write","math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg","math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max","math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh","math.sqrt","math.tan","math.tanh","os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale","os.time","os.tmpname",
"package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload","package.seeall","string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub","string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper","table.concat","table.insert","table.maxn","table.remove","table.sort"]),M=w(["and","break","elseif","false","nil","not","or","return","true","function","end","if","then","else","do",
"while","repeat","until","for","in","local"]),x=w(["function","if","repeat","do","\\(","{"]),J=w(["end","until","\\)","}"]),H=/^(?:end|until|\)|}|else|elseif)/i;return{startState:function(E){return{basecol:E||0,indentDepth:0,cur:u}},token:function(E,B){if(E.eatSpace())return null;var z=B.cur(E,B),y=E.current();if(z=="variable")if(M.test(y))z="keyword";else if(A.test(y))z="builtin";else if(v.test(y))z="variable-2";if(z!="comment"&&z!="string")if(x.test(y))++B.indentDepth;else J.test(y)&&--B.indentDepth;
return z},indent:function(E,B){var z=H.test(B);return E.basecol+q*(E.indentDepth-(z?1:0))},lineComment:"--",blockCommentStart:"--[[",blockCommentEnd:"]]"}});j.defineMIME("text/x-lua","lua")});(function(j){if(typeof exports=="object"&&typeof module=="object")j(require("../../lib/codemirror"));else typeof define=="function"&&define.amd?define(["../../lib/codemirror"],j):j(CodeMirror)})(function(j){j.defineMode("sql",function(ca,X){function w(B,z){var y=B.next();if(H[y]){var Q=H[y](B,z);if(Q!==false)return Q}if(J.hexNumber==true&&(y=="0"&&B.match(/^[xX][0-9a-fA-F]+/)||(y=="x"||y=="X")&&B.match(/^'[0-9a-fA-F]+'/)))return"number";else if(J.binaryNumber==true&&((y=="b"||y=="B")&&B.match(/^'[01]+'/)||
y=="0"&&B.match(/^b[01]+/)))return"number";else if(y.charCodeAt(0)>47&&y.charCodeAt(0)<58){B.match(/^[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/);J.decimallessFloat==true&&B.eat(".");return"number"}else if(y=="?"&&(B.eatSpace()||B.eol()||B.eat(";")))return"variable-3";else if(y=="'"||y=='"'&&J.doubleQuote){z.tokenize=u(y);return z.tokenize(B,z)}else if((J.nCharCast==true&&(y=="n"||y=="N")||J.charsetCast==true&&y=="_"&&B.match(/[a-z][a-z0-9]*/i))&&(B.peek()=="'"||B.peek()=='"'))return"keyword";else if(/^[\(\),\;\[\]]/.test(y))return null;
else if(J.commentSlashSlash&&y=="/"&&B.eat("/")){B.skipToEnd();return"comment"}else if(J.commentHash&&y=="#"||y=="-"&&B.eat("-")&&(!J.commentSpaceRequired||B.eat(" "))){B.skipToEnd();return"comment"}else if(y=="/"&&B.eat("*")){z.tokenize=g;return z.tokenize(B,z)}else if(y=="."){if(J.zerolessFloat==true&&B.match(/^(?:\d+(?:e[+-]?\d+)?)/i))return"number";if(J.ODBCdotTable==true&&B.match(/^[a-zA-Z_]+/))return"variable-2"}else if(x.test(y)){B.eatWhile(x);return null}else if(y=="{"&&(B.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||
B.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";else{B.eatWhile(/^[_\w\d]/);y=B.current().toLowerCase();if(E.hasOwnProperty(y)&&(B.match(/^( )+'[^']*'/)||B.match(/^( )+"[^"]*"/)))return"number";if(v.hasOwnProperty(y))return"atom";if(A.hasOwnProperty(y))return"builtin";if(M.hasOwnProperty(y))return"keyword";if(q.hasOwnProperty(y))return"string-2";return null}}function u(B){return function(z,y){for(var Q=false,$;($=z.next())!=null;){if($==B&&!Q){y.tokenize=w;break}Q=!Q&&$=="\\"}return"string"}}
function g(B,z){for(;;)if(B.skipTo("*")){B.next();if(B.eat("/")){z.tokenize=w;break}}else{B.skipToEnd();break}return"comment"}function l(B,z,y){z.context={prev:z.context,indent:B.indentation(),col:B.column(),type:y}}var q=X.client||{},v=X.atoms||{"false":true,"true":true,"null":true},A=X.builtin||{},M=X.keywords||{},x=X.operatorChars||/^[*+\-%<>!=&|~^]/,J=X.support||{},H=X.hooks||{},E=X.dateSQL||{date:true,time:true,timestamp:true};return{startState:function(){return{tokenize:w,context:null}},token:function(B,
z){if(B.sol())if(z.context&&z.context.align==null)z.context.align=false;if(B.eatSpace())return null;var y=z.tokenize(B,z);if(y=="comment")return y;if(z.context&&z.context.align==null)z.context.align=true;var Q=B.current();if(Q=="(")l(B,z,")");else if(Q=="[")l(B,z,"]");else if(z.context&&z.context.type==Q){z.indent=z.context.indent;z.context=z.context.prev}return y},indent:function(B,z){var y=B.context;if(!y)return 0;var Q=z.charAt(0)==y.type;return y.align?y.col+(Q?0:1):y.indent+(Q?0:ca.indentUnit)},
blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:J.commentSlashSlash?"//":J.commentHash?"#":null}});(function(){function ca(g){for(var l;(l=g.next())!=null;)if(l=="`"&&!g.eat("`"))return"variable-2";g.backUp(g.current().length-1);return g.eatWhile(/\w/)?"variable-2":null}function X(g){if(g.eat("@")){g.match(/^session\./);g.match(/^local\./);g.match(/^global\./)}if(g.eat("'")){g.match(/^.*'/);return"variable-2"}else if(g.eat('"')){g.match(/^.*"/);return"variable-2"}else if(g.eat("`")){g.match(/^.*`/);
return"variable-2"}else if(g.match(/^[0-9a-zA-Z$\.\_]+/))return"variable-2";return null}function w(g){if(g.eat("N"))return"atom";return g.match(/^[a-zA-Z.#!?]/)?"variable-2":null}function u(g){var l={};g=g.split(" ");for(var q=0;q<g.length;++q)l[g[q]]=true;return l}j.defineMIME("text/x-sql",{name:"sql",keywords:u("alter and as asc between by count create delete desc distinct drop from having in insert into is join like not on or order select set table union update values where begin"),builtin:u("bool boolean bit blob enum long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision real date datetime year unsigned signed decimal numeric"),
atoms:u("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:u("date time timestamp"),support:u("ODBCdotTable doubleQuote binaryNumber hexNumber")});j.defineMIME("text/x-mssql",{name:"sql",client:u("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:u("alter and as asc between by count create delete desc distinct drop from having in insert into is join like not on or order select set table union update values where begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered"),
builtin:u("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "),atoms:u("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:u("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":X}});j.defineMIME("text/x-mysql",{name:"sql",client:u("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),
keywords:u("alter and as asc between by count create delete desc distinct drop from having in insert into is join like not on or order select set table union update values where accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group groupby_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),
builtin:u("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:u("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:u("date time timestamp"),support:u("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),
hooks:{"@":X,"`":ca,"\\":w}});j.defineMIME("text/x-mariadb",{name:"sql",client:u("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:u("alter and as asc between by count create delete desc distinct drop from having in insert into is join like not on or order select set table union update values where accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),
builtin:u("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:u("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:u("date time timestamp"),support:u("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),
hooks:{"@":X,"`":ca,"\\":w}});j.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:u("use select from using consistency where limit first reversed first and in insert into values using consistency ttl update set delete truncate begin batch apply create keyspace with columnfamily primary key index on drop alter type add any one quorum all local_quorum each_quorum"),builtin:u("ascii bigint blob boolean counter decimal double float int text timestamp uuid varchar varint"),atoms:u("false true"),
operatorChars:/^[<>=]/,dateSQL:{},support:u("commentSlashSlash decimallessFloat"),hooks:{}});j.defineMIME("text/x-plsql",{name:"sql",client:u("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),
keywords:u("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),
builtin:u("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),
operatorChars:/^[*+\-%<>!=~]/,dateSQL:u("date time timestamp"),support:u("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")});j.defineMIME("text/x-hive",{name:"sql",keywords:u("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with"),
builtin:u("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"),atoms:u("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:u("date timestamp"),support:u("ODBCdotTable doubleQuote binaryNumber hexNumber")})})()});(function(j){if(typeof exports=="object"&&typeof module=="object")j(require("../../lib/codemirror"));else typeof define=="function"&&define.amd?define(["../../lib/codemirror"],j):j(CodeMirror)})(function(j){j.defineMode("xml",function(ca,X){function w(C,G){function O(wa){G.tokenize=wa;return wa(C,G)}var ba=C.next();if(ba=="<")if(C.eat("!"))if(C.eat("["))return C.match("CDATA[")?O(l("atom","]]\>")):null;else if(C.match("--"))return O(l("comment","--\>"));else if(C.match("DOCTYPE",true,true)){C.eatWhile(/[\w\._\-]/);
return O(q(1))}else return null;else if(C.eat("?")){C.eatWhile(/[\w\._\-]/);G.tokenize=l("meta","?>");return"meta"}else{S=C.eat("/")?"closeTag":"openTag";G.tokenize=u;return"tag bracket"}else if(ba=="&")return(C.eat("#")?C.eat("x")?C.eatWhile(/[a-fA-F\d]/)&&C.eat(";"):C.eatWhile(/[\d]/)&&C.eat(";"):C.eatWhile(/[\w\.\-:]/)&&C.eat(";"))?"atom":"error";else{C.eatWhile(/[^&<]/);return null}}function u(C,G){var O=C.next();if(O==">"||O=="/"&&C.eat(">")){G.tokenize=w;S=O==">"?"endTag":"selfcloseTag";return"tag bracket"}else if(O==
"="){S="equals";return null}else if(O=="<"){G.tokenize=w;G.state=x;G.tagName=G.tagStart=null;return(O=G.tokenize(C,G))?O+" tag error":"tag error"}else if(/[\'\"]/.test(O)){G.tokenize=g(O);G.stringStartCol=C.column();return G.tokenize(C,G)}else{C.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);return"word"}}function g(C){var G=function(O,ba){for(;!O.eol();)if(O.next()==C){ba.tokenize=u;break}return"string"};G.isInAttribute=true;return G}function l(C,G){return function(O,ba){for(;!O.eol();){if(O.match(G)){ba.tokenize=
w;break}O.next()}return C}}function q(C){return function(G,O){for(var ba;(ba=G.next())!=null;)if(ba=="<"){O.tokenize=q(C+1);return O.tokenize(G,O)}else if(ba==">")if(C==1){O.tokenize=w;break}else{O.tokenize=q(C-1);return O.tokenize(G,O)}return"meta"}}function v(C,G,O){this.prev=C.context;this.tagName=G;this.indent=C.indented;this.startOfLine=O;if(Ja.doNotIndent.hasOwnProperty(G)||C.context&&C.context.noIndent)this.noIndent=true}function A(C){if(C.context)C.context=C.context.prev}function M(C,G){for(var O;;){if(!C.context)break;
O=C.context.tagName;if(!Ja.contextGrabbers.hasOwnProperty(O)||!Ja.contextGrabbers[O].hasOwnProperty(G))break;A(C)}}function x(C,G,O){if(C=="openTag"){O.tagStart=G.column();return J}else return C=="closeTag"?H:x}function J(C,G,O){if(C=="word"){O.tagName=G.current();T="tag";return z}else{T="error";return J}}function H(C,G,O){if(C=="word"){C=G.current();O.context&&O.context.tagName!=C&&Ja.implicitlyClosed.hasOwnProperty(O.context.tagName)&&A(O);if(O.context&&O.context.tagName==C){T="tag";return E}else{T=
"tag error";return B}}else{T="error";return B}}function E(C,G,O){if(C!="endTag"){T="error";return E}A(O);return x}function B(C,G,O){T="error";return E(C,G,O)}function z(C,G,O){if(C=="word"){T="attribute";return y}else if(C=="endTag"||C=="selfcloseTag"){G=O.tagName;var ba=O.tagStart;O.tagName=O.tagStart=null;if(C=="selfcloseTag"||Ja.autoSelfClosers.hasOwnProperty(G))M(O,G);else{M(O,G);O.context=new v(O,G,ba==O.indented)}return x}T="error";return z}function y(C,G,O){if(C=="equals")return Q;Ja.allowMissing||
(T="error");return z(C,G,O)}function Q(C,G,O){if(C=="string")return $;if(C=="word"&&Ja.allowUnquoted){T="string";return z}T="error";return z(C,G,O)}function $(C,G,O){if(C=="string")return $;return z(C,G,O)}var Ga=ca.indentUnit,cb=X.multilineTagIndentFactor||1,Va=X.multilineTagIndentPastTag;if(Va==null)Va=true;var Ja=X.htmlMode?{autoSelfClosers:{area:true,base:true,br:true,col:true,command:true,embed:true,frame:true,hr:true,img:true,input:true,keygen:true,link:true,meta:true,param:true,source:true,
track:true,wbr:true,menuitem:true},implicitlyClosed:{dd:true,li:true,optgroup:true,option:true,p:true,rp:true,rt:true,tbody:true,td:true,tfoot:true,th:true,tr:true},contextGrabbers:{dd:{dd:true,dt:true},dt:{dd:true,dt:true},li:{li:true},option:{option:true,optgroup:true},optgroup:{optgroup:true},p:{address:true,article:true,aside:true,blockquote:true,dir:true,div:true,dl:true,fieldset:true,footer:true,form:true,h1:true,h2:true,h3:true,h4:true,h5:true,h6:true,header:true,hgroup:true,hr:true,menu:true,
nav:true,ol:true,p:true,pre:true,section:true,table:true,ul:true},rp:{rp:true,rt:true},rt:{rp:true,rt:true},tbody:{tbody:true,tfoot:true},td:{td:true,th:true},tfoot:{tbody:true},th:{td:true,th:true},thead:{tbody:true,tfoot:true},tr:{tr:true}},doNotIndent:{pre:true},allowUnquoted:true,allowMissing:true,caseFold:true}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:false,allowMissing:false,caseFold:false},Ea=X.alignCDATA,S,T;return{startState:function(){return{tokenize:w,
state:x,indented:0,tagName:null,tagStart:null,context:null}},token:function(C,G){if(!G.tagName&&C.sol())G.indented=C.indentation();if(C.eatSpace())return null;S=null;var O=G.tokenize(C,G);if((O||S)&&O!="comment"){T=null;G.state=G.state(S||O,C,G);if(T)O=T=="error"?O+" error":T}return O},indent:function(C,G,O){var ba=C.context;if(C.tokenize.isInAttribute)return C.tagStart==C.indented?C.stringStartCol+1:C.indented+Ga;if(ba&&ba.noIndent)return j.Pass;if(C.tokenize!=u&&C.tokenize!=w)return O?O.match(/^(\s*)/)[0].length:
0;if(C.tagName)return Va?C.tagStart+C.tagName.length+2:C.tagStart+Ga*cb;if(Ea&&/<!\[CDATA\[/.test(G))return 0;if((C=G&&/^<(\/)?([\w_:\.-]*)/.exec(G))&&C[1])for(;ba;)if(ba.tagName==C[2]){ba=ba.prev;break}else if(Ja.implicitlyClosed.hasOwnProperty(ba.tagName))ba=ba.prev;else break;else if(C)for(;ba;)if((G=Ja.contextGrabbers[ba.tagName])&&G.hasOwnProperty(C[2]))ba=ba.prev;else break;for(;ba&&!ba.startOfLine;)ba=ba.prev;return ba?ba.indent+Ga:0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<\!--",
blockCommentEnd:"--\>",configuration:X.htmlMode?"html":"xml",helperType:X.htmlMode?"html":"xml"}});j.defineMIME("text/xml","xml");j.defineMIME("application/xml","xml");j.mimeModes.hasOwnProperty("text/html")||j.defineMIME("text/html",{name:"xml",htmlMode:true})});(function(j){if(typeof exports=="object"&&typeof module=="object")j(require("../../lib/codemirror"));else typeof define=="function"&&define.amd?define(["../../lib/codemirror"],j):j(CodeMirror)})(function(j){j.defineMode("http",function(){function ca(A,M){A.skipToEnd();M.cur=q;return"error"}function X(A,M){if(A.match(/^HTTP\/\d\.\d/)){M.cur=w;return"keyword"}else if(A.match(/^[A-Z]+/)&&/[ \t]/.test(A.peek())){M.cur=g;return"keyword"}else return ca(A,M)}function w(A,M){var x=A.match(/^\d+/);if(!x)return ca(A,
M);M.cur=u;x=Number(x[0]);return x>=100&&x<200?"positive informational":x>=200&&x<300?"positive success":x>=300&&x<400?"positive redirect":x>=400&&x<500?"negative client-error":x>=500&&x<600?"negative server-error":"error"}function u(A,M){A.skipToEnd();M.cur=q;return null}function g(A,M){A.eatWhile(/\S/);M.cur=l;return"string-2"}function l(A,M){if(A.match(/^HTTP\/\d\.\d$/)){M.cur=q;return"keyword"}else return ca(A,M)}function q(A){if(A.sol()&&!A.eat(/[ \t]/))if(A.match(/^.*?:/))return"atom";else{A.skipToEnd();
return"error"}else{A.skipToEnd();return"string"}}function v(A){A.skipToEnd();return null}return{token:function(A,M){var x=M.cur;if(x!=q&&x!=v&&A.eatSpace())return null;return x(A,M)},blankLine:function(A){A.cur=v},startState:function(){return{cur:X}}}});j.defineMIME("message/http","http")});(function(j){if(typeof exports=="object"&&typeof module=="object")j(require("../../lib/codemirror"));else typeof define=="function"&&define.amd?define(["../../lib/codemirror"],j):j(CodeMirror)})(function(j){function ca(u,g,l,q){this.atOccurrence=false;this.doc=u;if(q==null&&typeof g=="string")q=false;l=l?u.clipPos(l):w(0,0);this.pos={from:l,to:l};if(typeof g!="string"){g.global||(g=RegExp(g.source,g.ignoreCase?"ig":"g"));this.matches=function(J,H){if(J){g.lastIndex=0;for(var E=u.getLine(H.line).slice(0,
H.ch),B=0,z,y;;){g.lastIndex=B;B=g.exec(E);if(!B)break;z=B;y=z.index;B=z.index+(z[0].length||1);if(B==E.length)break}B=z&&z[0].length||0;if(!B)if(y==0&&E.length==0)z=undefined;else y!=u.getLine(H.line).length&&B++}else{g.lastIndex=H.ch;E=u.getLine(H.line);B=(z=g.exec(E))&&z[0].length||0;y=z&&z.index;if(y+B!=E.length&&!B)B=1}if(z&&B)return{from:w(H.line,y),to:w(H.line,y+B),match:z}}}else{var v=g;if(q)g=g.toLowerCase();var A=q?function(J){return J.toLowerCase()}:function(J){return J},M=g.split("\n");
if(M.length==1)this.matches=g.length?function(J,H){if(J){var E=u.getLine(H.line).slice(0,H.ch),B=A(E),z=B.lastIndexOf(g);if(z>-1){z=X(E,B,z);return{from:w(H.line,z),to:w(H.line,z+v.length)}}}else{E=u.getLine(H.line).slice(H.ch);B=A(E);z=B.indexOf(g);if(z>-1){z=X(E,B,z)+H.ch;return{from:w(H.line,z),to:w(H.line,z+v.length)}}}}:function(){};else{var x=v.split("\n");this.matches=function(J,H){var E=M.length-1;if(J){if(!(H.line-(M.length-1)<u.firstLine()))if(A(u.getLine(H.line).slice(0,x[E].length))==
M[M.length-1]){for(var B=w(H.line,x[E].length),z=H.line-1,y=E-1;y>=1;--y,--z)if(M[y]!=A(u.getLine(z)))return;y=u.getLine(z);var Q=y.length-x[0].length;if(A(y.slice(Q))==M[0])return{from:w(z,Q),to:B}}}else if(!(H.line+(M.length-1)>u.lastLine())){y=u.getLine(H.line);Q=y.length-x[0].length;if(A(y.slice(Q))==M[0]){B=w(H.line,Q);z=H.line+1;for(y=1;y<E;++y,++z)if(M[y]!=A(u.getLine(z)))return;if(A(u.getLine(z).slice(0,x[E].length))==M[E])return{from:B,to:w(z,x[E].length)}}}}}}}function X(u,g,l){if(u.length==
g.length)return l;for(g=Math.min(l,u.length);;){var q=u.slice(0,g).toLowerCase().length;if(q<l)++g;else if(q>l)--g;else return g}}var w=j.Pos;ca.prototype={findNext:function(){return this.find(false)},findPrevious:function(){return this.find(true)},find:function(u){function g(A){A=w(A,0);l.pos={from:A,to:A};return l.atOccurrence=false}for(var l=this,q=this.doc.clipPos(u?this.pos.from:this.pos.to);;){if(this.pos=this.matches(u,q)){this.atOccurrence=true;return this.pos.match||true}if(u){if(!q.line)return g(0);
q=w(q.line-1,this.doc.getLine(q.line-1).length)}else{var v=this.doc.lineCount();if(q.line==v-1)return g(v);q=w(q.line+1,0)}}},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(u){if(this.atOccurrence){u=j.splitLines(u);this.doc.replaceRange(u,this.pos.from,this.pos.to);this.pos.to=w(this.pos.from.line+u.length-1,u[u.length-1].length+(u.length==1?this.pos.from.ch:0))}}};j.defineExtension("getSearchCursor",function(u,g,
l){return new ca(this.doc,u,g,l)});j.defineDocExtension("getSearchCursor",function(u,g,l){return new ca(this,u,g,l)});j.defineExtension("selectMatches",function(u,g){for(var l=[],q=this.getSearchCursor(u,this.getCursor("from"),g);q.findNext();){if(j.cmpPos(q.to(),this.getCursor("to"))>0)break;l.push({anchor:q.from(),head:q.to()})}l.length&&this.setSelections(l,0)})});(function(){var j=null;window.PR_SHOULD_USE_CONTINUATION=true;(function(){function ca(S){function T(P){var V=P.charCodeAt(0);if(V!==92)return V;var R=P.charAt(1);return(V=Aa[R])?V:"0"<=R&&R<="7"?parseInt(P.substring(1),8):R==="u"||R==="x"?parseInt(P.substring(2),16):P.charCodeAt(1)}function C(P){if(P<32)return(P<16?"\\x0":"\\x")+P.toString(16);P=String.fromCharCode(P);return P==="\\"||P==="-"||P==="]"||P==="^"?"\\"+P:P}function G(P){var V=P.substring(1,P.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g);
P=[];var R=V[0]==="^",r=["["];R&&r.push("^");R=R?1:0;for(var F=V.length;R<F;++R){var s=V[R];if(/\\[bdsw]/i.test(s))r.push(s);else{s=T(s);var U;R+2<F&&"-"===V[R+1]?(U=T(V[R+2]),R+=2):U=s;P.push([s,U]);U<65||s>122||(U<65||s>90||P.push([Math.max(65,s)|32,Math.min(U,90)|32]),U<97||s>122||P.push([Math.max(97,s)&-33,Math.min(U,122)&-33]))}}P.sort(function(ja,Y){return ja[0]-Y[0]||Y[1]-ja[1]});V=[];F=[];for(R=0;R<P.length;++R){s=P[R];s[0]<=F[1]+1?F[1]=Math.max(F[1],s[1]):V.push(F=s)}for(R=0;R<V.length;++R){s=
V[R];r.push(C(s[0]));s[1]>s[0]&&(s[1]+1>s[0]&&r.push("-"),r.push(C(s[1])))}r.push("]");return r.join("")}function O(P){for(var V=P.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),R=V.length,r=[],F=0,s=0;F<R;++F){var U=V[F];U==="("?++s:"\\"===U.charAt(0)&&(U=+U.substring(1))&&(U<=s?r[U]=-1:V[F]=C(U))}for(F=1;F<r.length;++F)-1===r[F]&&(r[F]=++ba);for(s=F=0;F<R;++F){U=V[F];U==="("?(++s,r[s]||(V[F]="(?:")):"\\"===U.charAt(0)&&(U=+U.substring(1))&&
U<=s&&(V[F]="\\"+r[U])}for(F=0;F<R;++F)"^"===V[F]&&"^"!==V[F+1]&&(V[F]="");if(P.ignoreCase&&wa)for(F=0;F<R;++F){U=V[F];P=U.charAt(0);U.length>=2&&P==="["?V[F]=G(U):P!=="\\"&&(V[F]=U.replace(/[A-Za-z]/g,function(ja){ja=ja.charCodeAt(0);return"["+String.fromCharCode(ja&-33,ja|32)+"]"}))}return V.join("")}for(var ba=0,wa=false,ra=false,la=0,Z=S.length;la<Z;++la){var ma=S[la];if(ma.ignoreCase)ra=true;else if(/[a-z]/i.test(ma.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){wa=true;ra=false;
break}}var Aa={b:8,t:9,n:10,v:11,f:12,r:13},ua=[];la=0;for(Z=S.length;la<Z;++la){ma=S[la];if(ma.global||ma.multiline)throw Error(""+ma);ua.push("(?:"+O(ma)+")")}return RegExp(ua.join("|"),ra?"gi":"g")}function X(S,T){function C(la){var Z=la.nodeType;if(Z==1){if(!G.test(la.className)){for(Z=la.firstChild;Z;Z=Z.nextSibling)C(Z);Z=la.nodeName.toLowerCase();if("br"===Z||"li"===Z){O[ra]="\n";wa[ra<<1]=ba++;wa[ra++<<1|1]=la}}}else if(Z==3||Z==4){Z=la.nodeValue;Z.length&&(Z=T?Z.replace(/\r\n?/g,"\n"):Z.replace(/[\t\n\r ]+/g,
" "),O[ra]=Z,wa[ra<<1]=ba,ba+=Z.length,wa[ra++<<1|1]=la)}}var G=/(?:^|\s)nocode(?:\s|$)/,O=[],ba=0,wa=[],ra=0;C(S);return{a:O.join("").replace(/\n$/,""),d:wa}}function w(S,T,C,G){T&&(S={a:T,e:S},C(S),G.push.apply(G,S.g))}function u(S){for(var T=void 0,C=S.firstChild;C;C=C.nextSibling){var G=C.nodeType;T=G===1?T?S:C:G===3?cb.test(C.nodeValue)?S:T:T}return T===S?void 0:T}function g(S,T){function C(wa){for(var ra=wa.e,la=[ra,"pln"],Z=0,ma=wa.a.match(O)||[],Aa={},ua=0,P=ma.length;ua<P;++ua){var V=ma[ua],
R=Aa[V],r=void 0,F;if(typeof R==="string")F=false;else{var s=G[V.charAt(0)];if(s){r=V.match(s[1]);R=s[0]}else{for(F=0;F<ba;++F)if(s=T[F],r=V.match(s[1])){R=s[0];break}r||(R="pln")}if((F=R.length>=5&&"lang-"===R.substring(0,5))&&!(r&&typeof r[1]==="string")){F=false;R="src"}F||(Aa[V]=R)}s=Z;Z+=V.length;if(F){F=r[1];var U=V.indexOf(F),ja=U+F.length;r[2]&&(ja=V.length-r[2].length,U=ja-F.length);R=R.substring(5);w(ra+s,V.substring(0,U),C,la);w(ra+s+U,F,A(R,F),la);w(ra+s+ja,V.substring(ja),C,la)}else la.push(ra+
s,R)}wa.g=la}var G={},O;(function(){for(var wa=S.concat(T),ra=[],la={},Z=0,ma=wa.length;Z<ma;++Z){var Aa=wa[Z],ua=Aa[3];if(ua)for(var P=ua.length;--P>=0;)G[ua.charAt(P)]=Aa;Aa=Aa[1];ua=""+Aa;la.hasOwnProperty(ua)||(ra.push(Aa),la[ua]=j)}ra.push(/[\S\s]/);O=ca(ra)})();var ba=T.length;return C}function l(S){var T=[],C=[];S.tripleQuotedStrings?T.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,
j,"'\""]):S.multiLineStrings?T.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,j,"'\"`"]):T.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,j,"\"'"]);S.verbatimStrings&&C.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,j]);var G=S.hashComments;G&&(S.cStyleComments?(G>1?T.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,j,"#"]):T.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\n\r]*)/,
j,"#"]),C.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,j])):T.push(["com",/^#[^\n\r]*/,j,"#"]));S.cStyleComments&&(C.push(["com",/^\/\/[^\n\r]*/,j]),C.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,j]));if(G=S.regexLiterals){var O=(G=G>1?"":"\n\r")?".":"[\\S\\s]";C.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+
("/(?=[^/*"+G+"])(?:[^/\\x5B\\x5C"+G+"]|\\x5C"+O+"|\\x5B(?:[^\\x5C\\x5D"+G+"]|\\x5C"+O+")*(?:\\x5D|$))+/")+")")])}(G=S.types)&&C.push(["typ",G]);G=(""+S.keywords).replace(/^ | $/g,"");G.length&&C.push(["kwd",RegExp("^(?:"+G.replace(/[\s,]+/g,"|")+")\\b"),j]);T.push(["pln",/^\s+/,j," \r\n\t\u00a0"]);G="^.[^\\s\\w.$@'\"`/\\\\]*";S.regexLiterals&&(G+="(?!s*/)");C.push(["lit",/^@[$_a-z][\w$@]*/i,j],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,j],["pln",/^[$_a-z][\w$@]*/i,j],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,
j,"0123456789"],["pln",/^\\[\S\s]?/,j],["pun",RegExp(G),j]);return g(T,C)}function q(S,T,C){function G(P){var V=P.nodeType;if(V==1&&!ba.test(P.className))if("br"===P.nodeName){O(P);P.parentNode&&P.parentNode.removeChild(P)}else for(P=P.firstChild;P;P=P.nextSibling)G(P);else if((V==3||V==4)&&C){var R=P.nodeValue,r=R.match(wa);if(r){V=R.substring(0,r.index);P.nodeValue=V;(R=R.substring(r.index+r[0].length))&&P.parentNode.insertBefore(ra.createTextNode(R),P.nextSibling);O(P);V||P.parentNode.removeChild(P)}}}
function O(P){function V(r,F){var s=F?r.cloneNode(false):r,U=r.parentNode;if(U){U=V(U,1);var ja=r.nextSibling;U.appendChild(s);for(var Y=ja;Y;Y=ja){ja=Y.nextSibling;U.appendChild(Y)}}return s}for(;!P.nextSibling;)if(P=P.parentNode,!P)return;P=V(P.nextSibling,0);for(var R;(R=P.parentNode)&&R.nodeType===1;)P=R;Z.push(P)}for(var ba=/(?:^|\s)nocode(?:\s|$)/,wa=/\r\n?|\n/,ra=S.ownerDocument,la=ra.createElement("li");S.firstChild;)la.appendChild(S.firstChild);for(var Z=[la],ma=0;ma<Z.length;++ma)G(Z[ma]);
T===(T|0)&&Z[0].setAttribute("value",T);var Aa=ra.createElement("ol");Aa.className="linenums";T=Math.max(0,T-1|0)||0;ma=0;for(var ua=Z.length;ma<ua;++ma){la=Z[ma];la.className="L"+(ma+T)%10;la.firstChild||la.appendChild(ra.createTextNode("\u00a0"));Aa.appendChild(la)}S.appendChild(Aa)}function v(S,T){for(var C=T.length;--C>=0;){var G=T[C];Ja.hasOwnProperty(G)?x.console&&console.warn("cannot override language handler %s",G):Ja[G]=S}}function A(S,T){if(!S||!Ja.hasOwnProperty(S))S=/^\s*</.test(T)?"default-markup":
"default-code";return Ja[S]}function M(S){var T=S.h;try{var C=X(S.c,S.i),G=C.a;S.a=G;S.d=C.d;S.e=0;A(T,G)(S);var O=/\bMSIE\s(\d+)/.exec(navigator.userAgent);O=O&&+O[1]<=8;T=/\n/g;var ba=S.a,wa=ba.length;C=0;var ra=S.d,la=ra.length;G=0;var Z=S.g,ma=Z.length,Aa=0;Z[ma]=wa;var ua,P;for(P=ua=0;P<ma;)Z[P]!==Z[P+2]?(Z[ua++]=Z[P++],Z[ua++]=Z[P++]):P+=2;ma=ua;for(P=ua=0;P<ma;){for(var V=Z[P],R=Z[P+1],r=P+2;r+2<=ma&&Z[r+1]===R;)r+=2;Z[ua++]=V;Z[ua++]=R;P=r}Z.length=ua;var F=S.c,s;if(F){s=F.style.display;F.style.display=
"none"}try{for(;G<la;){var U=ra[G+2]||wa,ja=Z[Aa+2]||wa;r=Math.min(U,ja);var Y=ra[G+1],Ka;if(Y.nodeType!==1&&(Ka=ba.substring(C,r))){O&&(Ka=Ka.replace(T,"\r"));Y.nodeValue=Ka;var Ha=Y.ownerDocument,xa=Ha.createElement("span");xa.className=Z[Aa+1];var eb=Y.parentNode;eb.replaceChild(xa,Y);xa.appendChild(Y);C<U&&(ra[G+1]=Y=Ha.createTextNode(ba.substring(r,U)),eb.insertBefore(Y,xa.nextSibling))}C=r;C>=U&&(G+=2);C>=ja&&(Aa+=2)}}finally{if(F)F.style.display=s}}catch(Ba){x.console&&console.log(Ba&&Ba.stack||
Ba)}}var x=window,J=["break,continue,do,else,for,if,return,while"],H=[[J,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],E=[H,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],
B=[H,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],z=[B,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];H=[H,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];
var y=[J,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],Q=[J,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],$=[J,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"];J=[J,
"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var Ga=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,cb=/\S/,Va=l({keywords:[E,z,H,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",y,Q,J],hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true}),Ja={};v(Va,["default-code"]);
v(g([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);v(g([["pln",/^\s+/,j," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,
j,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);v(g([],[["atv",/^[\S\s]+/]]),["uq.val"]);v(l({keywords:E,hashComments:true,
cStyleComments:true,types:Ga}),["c","cc","cpp","cxx","cyc","m"]);v(l({keywords:"null,true,false"}),["json"]);v(l({keywords:z,hashComments:true,cStyleComments:true,verbatimStrings:true,types:Ga}),["cs"]);v(l({keywords:B,cStyleComments:true}),["java"]);v(l({keywords:J,hashComments:true,multiLineStrings:true}),["bash","bsh","csh","sh"]);v(l({keywords:y,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py","python"]);v(l({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",
hashComments:true,multiLineStrings:true,regexLiterals:2}),["perl","pl","pm"]);v(l({keywords:Q,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb","ruby"]);v(l({keywords:H,cStyleComments:true,regexLiterals:true}),["javascript","js"]);v(l({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,
regexLiterals:true}),["coffee"]);v(l({keywords:$,cStyleComments:true,multilineStrings:true}),["rc","rs","rust"]);v(g([],[["str",/^[\S\s]+/]]),["regex"]);var Ea=x.PR={createSimpleLexer:g,registerLangHandler:v,sourceDecorator:l,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:x.prettyPrintOne=function(S,T,C){var G=
document.createElement("div");G.innerHTML="<pre>"+S+"</pre>";G=G.firstChild;C&&q(G,C,true);M({h:T,j:C,c:G,i:1});return G.innerHTML},prettyPrint:x.prettyPrint=function(S,T){function C(){for(var U=x.PR_SHOULD_USE_CONTINUATION?Z.now()+250:Infinity;ma<ba.length&&Z.now()<U;ma++){for(var ja=ba[ma],Y=s,Ka=ja;Ka=Ka.previousSibling;){var Ha=Ka.nodeType,xa=(Ha===7||Ha===8)&&Ka.nodeValue;if(xa?!/^\??prettify\b/.test(xa):Ha!==3||/\S/.test(Ka.nodeValue))break;if(xa){Y={};xa.replace(/\b(\w+)=([\w%+\-.:]+)/g,function(bc,
cc,Ma){Y[cc]=Ma});break}}Ka=ja.className;if((Y!==s||P.test(Ka))&&!V.test(Ka)){Ha=false;for(xa=ja.parentNode;xa;xa=xa.parentNode)if(F.test(xa.tagName)&&xa.className&&P.test(xa.className)){Ha=true;break}if(!Ha){ja.className+=" prettyprinted";Ha=Y.lang;if(!Ha){Ha=Ka.match(ua);var eb;if(!Ha&&(eb=u(ja))&&r.test(eb.tagName))Ha=eb.className.match(ua);Ha&&(Ha=Ha[1])}if(R.test(ja.tagName))xa=1;else{xa=ja.currentStyle;var Ba=O.defaultView;xa=(xa=xa?xa.whiteSpace:Ba&&Ba.getComputedStyle?Ba.getComputedStyle(ja,
j).getPropertyValue("white-space"):0)&&"pre"===xa.substring(0,3)}Ba=Y.linenums;if(!(Ba=Ba==="true"||+Ba))Ba=(Ba=Ka.match(/\blinenums\b(?::(\d+))?/))?Ba[1]&&Ba[1].length?+Ba[1]:true:false;Ba&&q(ja,Ba,xa);Aa={h:Ha,c:ja,j:Ba,i:xa};M(Aa)}}}ma<ba.length?setTimeout(C,250):"function"===typeof S&&S()}var G=T||document.body,O=G.ownerDocument||document;G=[G.getElementsByTagName("pre"),G.getElementsByTagName("code"),G.getElementsByTagName("xmp")];for(var ba=[],wa=0;wa<G.length;++wa)for(var ra=0,la=G[wa].length;ra<
la;++ra)ba.push(G[wa][ra]);G=j;var Z=Date;Z.now||(Z={now:function(){return+new Date}});var ma=0,Aa,ua=/\blang(?:uage)?-([\w.]+)(?!\S)/,P=/\bprettyprint\b/,V=/\bprettyprinted\b/,R=/pre|xmp/i,r=/^code$/i,F=/^(?:pre|code|xmp)$/i,s={};C()}};typeof define==="function"&&define.amd&&define("google-code-prettify",[],function(){return Ea})})()})();
