text: webpackJsonp([5],{"/n6Q":function(e,t,n){n("zQR9"),n("+tPU"),e.exports=n("Kh4W").f("iterator")},"06OY":function(e,t,n){var r=n("3Eo+")("meta"),i=n("EqjI"),o=n("D2L2"),a=n("evD5").f,l=0,s=Object.isExtensible||function(){return!0},u=!n("S82l")(function(){return s(Object.preventExtensions({}))}),c=function(e){a(e,r,{value:{i:"O"+ ++l,w:{}}})},f=e.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,r)){if(!s(e))return"F";if(!t)return"E";c(e)}return e[r].i},getWeak:function(e,t){if(!o(e,r)){if(!s(e))return!0;if(!t)return!1;c(e)}return e[r].w},onFreeze:function(e){return u&&f.NEED&&s(e)&&!o(e,r)&&c(e),e}}},"4/hK":function(e,t){},"5QVw":function(e,t,n){e.exports={default:n("BwfY"),__esModule:!0}},"6S2o":function(e,t,n){!function(e){e(n("8U58"))}(function(e){"use strict";function t(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.info=r,this.align=i,this.prev=o}function n(e,n,r,i){var o=e.indented;return e.context&&"statement"==e.context.type&&"statement"!=r&&(o=e.context.indented),e.context=new t(o,n,r,i,null,e.context)}function r(e){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}function i(e,t,n){return"variable"==t.prevToken||"type"==t.prevToken||(!!/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(e.string.slice(0,n))||(!(!t.typeAtEndOfLine||e.column()!=e.indentation())||void 0))}function o(e){for(;;){if(!e||"top"==e.type)return!0;if("}"==e.type&&"namespace"!=e.prev.info)return!1;e=e.prev}}function a(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function l(e,t){return"function"==typeof e?e(t):e.propertyIsEnumerable(t)}e.defineMode("clike",function(a,s){var u,c,f=a.indentUnit,d=s.statementIndentUnit||f,h=s.dontAlignCalls,p=s.keywords||{},m=s.types||{},g=s.builtin||{},v=s.blockKeywords||{},y=s.defKeywords||{},b=s.atoms||{},x=s.hooks||{},w=s.multiLineStrings,C=!1!==s.indentStatements,S=!1!==s.indentSwitch,k=s.namespaceSeparator,L=s.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,T=s.numberStart||/[\d\.]/,M=s.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,_=s.isOperatorChar||/[+\-*&%=<>!?|\/]/,O=s.isIdentifierChar||/[\w\$_\xa1-\uffff]/,N=s.isReservedIdentifier||!1;function D(e,t){var n=e.next();if(x[n]){var r=x[n](e,t);if(!1!==r)return r}if('"'==n||"'"==n)return t.tokenize=function(e){return function(t,n){for(var r,i=!1,o=!1;null!=(r=t.next());){if(r==e&&!i){o=!0;break}i=!i&&"\\"==r}return(o||!i&&!w)&&(n.tokenize=null),"string"}}(n),t.tokenize(e,t);if(L.test(n))return u=n,null;if(T.test(n)){if(e.backUp(1),e.match(M))return"number";e.next()}if("/"==n){if(e.eat("*"))return t.tokenize=A,A(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(_.test(n)){for(;!e.match(/^\/[\/*]/,!1)&&e.eat(_););return"operator"}if(e.eatWhile(O),k)for(;e.match(k);)e.eatWhile(O);var i=e.current();return l(p,i)?(l(v,i)&&(u="newstatement"),l(y,i)&&(c=!0),"keyword"):l(m,i)?"type":l(g,i)||N&&N(i)?(l(v,i)&&(u="newstatement"),"builtin"):l(b,i)?"atom":"variable"}function A(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=null;break}r="*"==n}return"comment"}function I(e,t){s.typeFirstDefinitions&&e.eol()&&o(t.context)&&(t.typeAtEndOfLine=i(e,t,e.pos))}return{startState:function(e){return{tokenize:null,context:new t((e||0)-f,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(e,t){var a=t.context;if(e.sol()&&(null==a.align&&(a.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return I(e,t),null;u=c=null;var l=(t.tokenize||D)(e,t);if("comment"==l||"meta"==l)return l;if(null==a.align&&(a.align=!0),";"==u||":"==u||","==u&&e.match(/^\s*(?:\/\/.*)?$/,!1))for(;"statement"==t.context.type;)r(t);else if("{"==u)n(t,e.column(),"}");else if("["==u)n(t,e.column(),"]");else if("("==u)n(t,e.column(),")");else if("}"==u){for(;"statement"==a.type;)a=r(t);for("}"==a.type&&(a=r(t));"statement"==a.type;)a=r(t)}else u==a.type?r(t):C&&(("}"==a.type||"top"==a.type)&&";"!=u||"statement"==a.type&&"newstatement"==u)&&n(t,e.column(),"statement",e.current());if("variable"==l&&("def"==t.prevToken||s.typeFirstDefinitions&&i(e,t,e.start)&&o(t.context)&&e.match(/^\s*\(/,!1))&&(l="def"),x.token){var f=x.token(e,t,l);void 0!==f&&(l=f)}return"def"==l&&!1===s.styleDefs&&(l="variable"),t.startOfLine=!1,t.prevToken=c?"def":l||u,I(e,t),l},indent:function(t,n){if(t.tokenize!=D&&null!=t.tokenize||t.typeAtEndOfLine)return e.Pass;var r=t.context,i=n&&n.charAt(0),o=i==r.type;if("statement"==r.type&&"}"==i&&(r=r.prev),s.dontIndentStatements)for(;"statement"==r.type&&s.dontIndentStatements.test(r.info);)r=r.prev;if(x.indent){var a=x.indent(t,r,n,f);if("number"==typeof a)return a}var l=r.prev&&"switch"==r.prev.info;if(s.allmanIndentation&&/[{(]/.test(i)){for(;"top"!=r.type&&"}"!=r.type;)r=r.prev;return r.indented}return"statement"==r.type?r.indented+("{"==i?0:d):!r.align||h&&")"==r.type?")"!=r.type||o?r.indented+(o?0:f)+(o||!l||/^(?:case|default)\b/.test(n)?0:f):r.indented+d:r.column+(o?0:1)},electricInput:S?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}});var s="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile inline restrict asm fortran",u=a("int long char short double float unsigned signed void bool"),c=a("SEL instancetype id Class Protocol BOOL");function f(e){return l(u,e)||/.+_t/.test(e)}var d="case do else for if switch while struct enum union";function h(e,t){if(!t.startOfLine)return!1;for(var n,r=null;n=e.peek();){if("\\"==n&&e.match(/^.$/)){r=h;break}if("/"==n&&e.match(/^\/[\/\*]/,!1))break;e.next()}return t.tokenize=r,"meta"}function p(e,t){return"type"==t.prevToken&&"type"}function m(e){return!(!e||e.length<2)&&("_"==e[0]&&("_"==e[1]||e[1]!==e[1].toLowerCase()))}function g(e){return e.eatWhile(/[\w\.']/),"number"}function v(e,t){if(e.backUp(1),e.match(/(R|u8R|uR|UR|LR)/)){var n=e.match(/"([^\s\\()]{0,16})\(/);return!!n&&(t.cpp11RawStringDelim=n[1],t.tokenize=b,b(e,t))}return e.match(/(u8|u|U|L)/)?!!e.match(/["']/,!1)&&"string":(e.next(),!1)}function y(e,t){for(var n;null!=(n=e.next());)if('"'==n&&!e.eat('"')){t.tokenize=null;break}return"string"}function b(e,t){var n=t.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&");return e.match(new RegExp(".*?\\)"+n+'"'))?t.tokenize=null:e.skipToEnd(),"string"}function x(t,n){"string"==typeof t&&(t=[t]);var r=[];function i(e){if(e)for(var t in e)e.hasOwnProperty(t)&&r.push(t)}i(n.keywords),i(n.types),i(n.builtin),i(n.atoms),r.length&&(n.helperType=t[0],e.registerHelper("hintWords",t[0],r));for(var o=0;o<t.length;++o)e.defineMIME(t[o],n)}function w(e,t){for(var n=!1;!e.eol();){if(!n&&e.match('"""')){t.tokenize=null;break}n="\\"==e.next()&&!n}return"string"}x(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:a(s),types:f,blockKeywords:a(d),defKeywords:a("struct enum union"),typeFirstDefinitions:!0,atoms:a("NULL true false"),isReservedIdentifier:m,hooks:{"#":h,"*":p},modeProps:{fold:["brace","include"]}}),x(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:a(s+"alignas alignof and and_eq audit axiom bitand bitor catch class compl concept constexpr const_cast decltype delete dynamic_cast explicit export final friend import module mutable namespace new noexcept not not_eq operator or or_eq override private protected public reinterpret_cast requires static_assert static_cast template this thread_local throw try typeid typename using virtual xor xor_eq"),types:f,blockKeywords:a(d+" class try catch"),defKeywords:a("struct enum union class namespace"),typeFirstDefinitions:!0,atoms:a("true false NULL nullptr"),dontIndentStatements:/^template$/,isIdentifierChar:/[\w\$_~\xa1-\uffff]/,isReservedIdentifier:m,hooks:{"#":h,"*":p,u:v,U:v,L:v,R:v,0:g,1:g,2:g,3:g,4:g,5:g,6:g,7:g,8:g,9:g,token:function(e,t,n){if("variable"==n&&"("==e.peek()&&(";"==t.prevToken||null==t.prevToken||"}"==t.prevToken)&&function(e){var t=/(\w+)::~?(\w+)$/.exec(e);return t&&t[1]==t[2]}(e.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),x("text/x-java",{name:"clike",keywords:a("abstract assert break case catch class const continue default do else enum extends final finally float for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while @interface"),types:a("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:a("catch class do else finally for if switch try while"),defKeywords:a("class interface enum @interface"),typeFirstDefinitions:!0,atoms:a("true false null"),number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(e){return!e.match("interface",!1)&&(e.eatWhile(/[\w\$_]/),"meta")}},modeProps:{fold:["brace","import"]}}),x("text/x-csharp",{name:"clike",keywords:a("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:a("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:a("catch class do else finally for foreach if struct switch try while"),defKeywords:a("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:a("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=y,y(e,t)):(e.eatWhile(/[\w\$_]/),"meta")}}}),x("text/x-scala",{name:"clike",keywords:a("abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble"),types:a("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:a("catch class enum do else finally for forSome if match switch try while"),defKeywords:a("class enum def object package trait type val var"),atoms:a("true false null"),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return!!e.match('""')&&(t.tokenize=w,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},"=":function(e,n){var r=n.context;return!("}"!=r.type||!r.align||!e.eat(">"))&&(n.context=new t(r.indented,r.column,r.type,r.info,null,r.prev),"operator")},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=function e(t){return function(n,r){for(var i;i=n.next();){if("*"==i&&n.eat("/")){if(1==t){r.tokenize=null;break}return r.tokenize=e(t-1),r.tokenize(n,r)}if("/"==i&&n.eat("*"))return r.tokenize=e(t+1),r.tokenize(n,r)}return"comment"}}(1),t.tokenize(e,t))}},modeProps:{closeBrackets:{pairs:'()[]{}""',triples:'"'}}}),x("text/x-kotlin",{name:"clike",keywords:a("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam"),types:a("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:a("catch class do else finally for if where try while enum"),defKeywords:a("class val var object interface fun"),atoms:a("true false null this"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},"*":function(e,t){return"."==t.prevToken?"variable":"operator"},'"':function(e,t){return t.tokenize=function(e){return function(t,n){for(var r,i=!1,o=!1;!t.eol();){if(!e&&!i&&t.match('"')){o=!0;break}if(e&&t.match('"""')){o=!0;break}r=t.next(),!i&&"$"==r&&t.match("{")&&t.skipTo("}"),i=!i&&"\\"==r&&!e}return!o&&e||(n.tokenize=null),"string"}}(e.match('""')),t.tokenize(e,t)},indent:function(e,t,n,r){var i=n&&n.charAt(0);return"}"!=e.prevToken&&")"!=e.prevToken||""!=n?"operator"==e.prevToken&&"}"!=n||"variable"==e.prevToken&&"."==i||("}"==e.prevToken||")"==e.prevToken)&&"."==i?2*r+t.indented:t.align&&"}"==t.type?t.indented+(e.context.type==(n||"").charAt(0)?0:r):void 0:e.indented}},modeProps:{closeBrackets:{triples:'"'}}}),x(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:a("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:a("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:a("for while do if else struct"),builtin:a("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:a("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":h},modeProps:{fold:["brace","include"]}}),x("text/x-nesc",{name:"clike",keywords:a(s+" as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:f,blockKeywords:a(d),atoms:a("null true false"),hooks:{"#":h},modeProps:{fold:["brace","include"]}}),x("text/x-objectivec",{name:"clike",keywords:a(s+" bycopy byref in inout oneway out self super atomic nonatomic retain copy readwrite readonly strong weak assign typeof nullable nonnull null_resettable _cmd @interface @implementation @end @protocol @encode @property @synthesize @dynamic @class @public @package @private @protected @required @optional @try @catch @finally @import @selector @encode @defs @synchronized @autoreleasepool @compatibility_alias @available"),types:function(e){return f(e)||l(c,e)},builtin:a("FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION NS_RETURNS_RETAINED NS_ERROR_ENUM NS_RETURNS_NOT_RETAINED NS_RETURNS_INNER_POINTER NS_DESIGNATED_INITIALIZER NS_ENUM NS_OPTIONS NS_REQUIRES_NIL_TERMINATION NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_SWIFT_NAME NS_REFINED_FOR_SWIFT"),blockKeywords:a(d+" @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:a("struct enum union @interface @implementation @protocol @class"),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:a("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:m,hooks:{"#":h,"*":p},modeProps:{fold:["brace","include"]}}),x("text/x-squirrel",{name:"clike",keywords:a("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:f,blockKeywords:a("case catch class else for foreach if switch try while"),defKeywords:a("function local class"),typeFirstDefinitions:!0,atoms:a("true false null"),hooks:{"#":h},modeProps:{fold:["brace","include"]}});var C=null;x("text/x-ceylon",{name:"clike",keywords:a("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(e){var t=e.charAt(0);return t===t.toUpperCase()&&t!==t.toLowerCase()},blockKeywords:a("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:a("class dynamic function interface module object package value"),builtin:a("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:a("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return t.tokenize=function e(t){return function(n,r){for(var i,o=!1,a=!1;!n.eol();){if(!o&&n.match('"')&&("single"==t||n.match('""'))){a=!0;break}if(!o&&n.match("``")){C=e(t),a=!0;break}i=n.next(),o="single"==t&&!o&&"\\"==i}return a&&(r.tokenize=null),"string"}}(e.match('""')?"triple":"single"),t.tokenize(e,t)},"`":function(e,t){return!(!C||!e.match("`"))&&(t.tokenize=C,C=null,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(e,t,n){if(("variable"==n||"type"==n)&&"."==t.prevToken)return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})})},"7UMu":function(e,t,n){var r=n("R9M2");e.exports=Array.isArray||function(e){return"Array"==r(e)}},"8U58":function(e,t,n){!function(t,n){e.exports=n()}(0,function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=r||i||o,l=a&&(r?document.documentMode||6:+(o||i)[1]),s=!o&&/WebKit\//.test(e),u=s&&/Qt\/\d+\.\d+/.test(e),c=!o&&/Chrome\//.test(e),f=/Opera\//.test(e),d=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),m=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),g=/Android/.test(e),v=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=m||/Mac/.test(t),b=/\bCrOS\b/.test(e),x=/win/i.test(t),w=f&&e.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(f=!1,s=!0);var C=y&&(u||f&&(null==w||w<12.11)),S=n||a&&l>=9;function k(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var L,T=function(e,t){var n=e.className,r=k(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function M(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function _(e,t){return M(e).appendChild(t)}function O(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function N(e,t,n,r){var i=O(e,t,n,r);return i.setAttribute("role","presentation"),i}function D(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function A(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function I(e,t){var n=e.className;k(t).test(n)||(e.className+=(n?" ":"")+t)}function E(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!k(n[r]).test(t)&&(t+=" "+n[r]);return t}L=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var P=function(e){e.select()};function F(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function W(e,t,n){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function z(e,t,n,r,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=r||0,a=i||0;;){var l=e.indexOf("\t",o);if(l<0||l>=t)return a+(t-o);a+=l-o,a+=n-a%n,o=l+1}}m?P=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(P=function(e){try{e.select()}catch(e){}});var R=function(){this.id=null};function H(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}R.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var B=30,U={toString:function(){return"CodeMirror.Pass"}},V={scroll:!1},j={origin:"*mouse"},$={origin:"+move"};function G(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);-1==o&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}var K=[""];function q(e){for(;K.length<=e;)K.push(Y(K)+" ");return K[e]}function Y(e){return e[e.length-1]}function X(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Z(){}function Q(e,t){var n;return Object.create?n=Object.create(e):(Z.prototype=e,n=new Z),t&&W(t,n),n}var J=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ee(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||J.test(e))}function te(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ee(e))||t.test(e):ee(e)}function ne(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var re=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ie(e){return e.charCodeAt(0)>=768&&re.test(e)}function oe(e,t,n){for(;(n<0?t>0:t<e.length)&&ie(e.charAt(t));)t+=n;return t}function ae(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function le(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function se(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i}),r}function ue(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function ce(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function fe(e){if(null==e.parent)return null;for(var t=e.parent,n=H(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function de(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var l=e.lines[a].height;if(t<l)break;t-=l}return n+a}function he(e,t){return t>=e.first&&t<e.first+e.size}function pe(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function me(e,t,n){if(void 0===n&&(n=null),!(this instanceof me))return new me(e,t,n);this.line=e,this.ch=t,this.sticky=n}function ge(e,t){return e.line-t.line||e.ch-t.ch}function ve(e,t){return e.sticky==t.sticky&&0==ge(e,t)}function ye(e){return me(e.line,e.ch)}function be(e,t){return ge(e,t)<0?t:e}function xe(e,t){return ge(e,t)<0?e:t}function we(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Ce(e,t){if(t.line<e.first)return me(e.first,0);var n=e.first+e.size-1;return t.line>n?me(n,le(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?me(e.line,t):n<0?me(e.line,0):e}(t,le(e,t.line).text.length)}function Se(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=Ce(e,t[r]);return n}var ke=!1,Le=!1;function Te(e,t,n){this.marker=e,this.from=t,this.to=n}function Me(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function _e(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Oe(e,t){if(t.full)return null;var n=he(e,t.from.line)&&le(e,t.from.line).markedSpans,r=he(e,t.to.line)&&le(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=0==ge(t.from,t.to),l=function(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Te(a,o.from,l?null:o.to))}}return r}(n,i,a),s=function(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Te(a,l?null:o.from-t,null==o.to?null:o.to-t))}}return r}(r,o,a),u=1==t.text.length,c=Y(t.text).length+(u?i:0);if(l)for(var f=0;f<l.length;++f){var d=l[f];if(null==d.to){var h=Me(s,d.marker);h?u&&(d.to=null==h.to?null:h.to+c):d.to=i}}if(s)for(var p=0;p<s.length;++p){var m=s[p];if(null!=m.to&&(m.to+=c),null==m.from)Me(l,m.marker)||(m.from=c,u&&(l||(l=[])).push(m));else m.from+=c,u&&(l||(l=[])).push(m)}l&&(l=Ne(l)),s&&s!=l&&(s=Ne(s));var g=[l];if(!u){var v,y=t.text.length-2;if(y>0&&l)for(var b=0;b<l.length;++b)null==l[b].to&&(v||(v=[])).push(new Te(l[b].marker,null,null));for(var x=0;x<y;++x)g.push(v);g.push(s)}return g}function Ne(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function De(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Ae(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Ie(e){return e.inclusiveLeft?-1:0}function Ee(e){return e.inclusiveRight?1:0}function Pe(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=ge(r.from,i.from)||Ie(e)-Ie(t);if(o)return-o;var a=ge(r.to,i.to)||Ee(e)-Ee(t);return a||t.id-e.id}function Fe(e,t){var n,r=Le&&e.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)(i=r[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!n||Pe(n,i.marker)<0)&&(n=i.marker);return n}function We(e){return Fe(e,!0)}function ze(e){return Fe(e,!1)}function Re(e,t){var n,r=Le&&e.markedSpans;if(r)for(var i=0;i<r.length;++i){var o=r[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!n||Pe(n,o.marker)<0)&&(n=o.marker)}return n}function He(e,t,n,r,i){var o=le(e,t),a=Le&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var u=s.marker.find(0),c=ge(u.from,n)||Ie(s.marker)-Ie(i),f=ge(u.to,r)||Ee(s.marker)-Ee(i);if(!(c>=0&&f<=0||c<=0&&f>=0)&&(c<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?ge(u.to,n)>=0:ge(u.to,n)>0)||c>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?ge(u.from,r)<=0:ge(u.from,r)<0)))return!0}}}function Be(e){for(var t;t=We(e);)e=t.find(-1,!0).line;return e}function Ue(e,t){var n=le(e,t),r=Be(n);return n==r?t:fe(r)}function Ve(e,t){if(t>e.lastLine())return t;var n,r=le(e,t);if(!je(e,r))return t;for(;n=ze(r);)r=n.find(1,!0).line;return fe(r)+1}function je(e,t){var n=Le&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if((r=n[i]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&$e(e,t,r))return!0}}function $e(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return $e(e,r.line,Me(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&$e(e,t,i))return!0}function Ge(e){for(var t=0,n=(e=Be(e)).parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;o=(n=o).parent)for(var a=0;a<o.children.length;++a){var l=o.children[a];if(l==n)break;t+=l.height}return t}function Ke(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=We(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=ze(r);){var o=t.find(0,!0);n-=r.text.length-o.from.ch,n+=(r=o.to.line).text.length-o.to.ch}return n}function qe(e){var t=e.display,n=e.doc;t.maxLine=le(n,n.first),t.maxLineLength=Ke(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=Ke(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}var Ye=null;function Xe(e,t,n){var r;Ye=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:Ye=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:Ye=i)}return null!=r?r:Ye}var Ze=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?t.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,l=/[1n]/;function s(e,t,n){this.level=e,this.from=t,this.to=n}return function(e,t){var u="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!r.test(e))return!1;for(var c=e.length,f=[],d=0;d<c;++d)f.push(n(e.charCodeAt(d)));for(var h=0,p=u;h<c;++h){var m=f[h];"m"==m?f[h]=p:p=m}for(var g=0,v=u;g<c;++g){var y=f[g];"1"==y&&"r"==v?f[g]="n":o.test(y)&&(v=y,"r"==y&&(f[g]="R"))}for(var b=1,x=f[0];b<c-1;++b){var w=f[b];"+"==w&&"1"==x&&"1"==f[b+1]?f[b]="1":","!=w||x!=f[b+1]||"1"!=x&&"n"!=x||(f[b]=x),x=w}for(var C=0;C<c;++C){var S=f[C];if(","==S)f[C]="N";else if("%"==S){var k=void 0;for(k=C+1;k<c&&"%"==f[k];++k);for(var L=C&&"!"==f[C-1]||k<c&&"1"==f[k]?"1":"N",T=C;T<k;++T)f[T]=L;C=k-1}}for(var M=0,_=u;M<c;++M){var O=f[M];"L"==_&&"1"==O?f[M]="L":o.test(O)&&(_=O)}for(var N=0;N<c;++N)if(i.test(f[N])){var D=void 0;for(D=N+1;D<c&&i.test(f[D]);++D);for(var A="L"==(N?f[N-1]:u),I=A==("L"==(D<c?f[D]:u))?A?"L":"R":u,E=N;E<D;++E)f[E]=I;N=D-1}for(var P,F=[],W=0;W<c;)if(a.test(f[W])){var z=W;for(++W;W<c&&a.test(f[W]);++W);F.push(new s(0,z,W))}else{var R=W,H=F.length;for(++W;W<c&&"L"!=f[W];++W);for(var B=R;B<W;)if(l.test(f[B])){R<B&&F.splice(H,0,new s(1,R,B));var U=B;for(++B;B<W&&l.test(f[B]);++B);F.splice(H,0,new s(2,U,B)),R=B}else++B;R<W&&F.splice(H,0,new s(1,R,W))}return"ltr"==t&&(1==F[0].level&&(P=e.match(/^\s+/))&&(F[0].from=P[0].length,F.unshift(new s(0,0,P[0].length))),1==Y(F).level&&(P=e.match(/\s+$/))&&(Y(F).to-=P[0].length,F.push(new s(0,c-P[0].length,c)))),"rtl"==t?F.reverse():F}}();function Qe(e,t){var n=e.order;return null==n&&(n=e.order=Ze(e.text,t)),n}var Je=[],et=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Je).concat(n)}};function tt(e,t){return e._handlers&&e._handlers[t]||Je}function nt(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=H(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function rt(e,t){var n=tt(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function it(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),rt(e,n||t.type,e,t),ct(t)||t.codemirrorIgnore}function ot(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==H(n,t[r])&&n.push(t[r])}function at(e,t){return tt(e,t).length>0}function lt(e){e.prototype.on=function(e,t){et(this,e,t)},e.prototype.off=function(e,t){nt(this,e,t)}}function st(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ut(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ct(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function ft(e){st(e),ut(e)}function dt(e){return e.target||e.srcElement}function ht(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var pt,mt,gt=function(){if(a&&l<9)return!1;var e=O("div");return"draggable"in e||"dragDrop"in e}();function vt(e){if(null==pt){var t=O("span","​");_(e,O("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(pt=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&l<8))}var n=pt?O("span","​"):O("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function yt(e){if(null!=mt)return mt;var t=_(e,document.createTextNode("AخA")),n=L(t,0,1).getBoundingClientRect(),r=L(t,1,2).getBoundingClientRect();return M(e),!(!n||n.left==n.right)&&(mt=r.right-n.right<3)}var bt=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},xt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},wt=function(){var e=O("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Ct=null;var St={},kt={};function Lt(e){if("string"==typeof e&&kt.hasOwnProperty(e))e=kt[e];else if(e&&"string"==typeof e.name&&kt.hasOwnProperty(e.name)){var t=kt[e.name];"string"==typeof t&&(t={name:t}),(e=Q(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Lt("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Lt("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Tt(e,t){t=Lt(t);var n=St[t.name];if(!n)return Tt(e,"text/plain");var r=n(e,t);if(Mt.hasOwnProperty(t.name)){var i=Mt[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var Mt={};function _t(e,t){W(t,Mt.hasOwnProperty(e)?Mt[e]:Mt[e]={})}function Ot(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Nt(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Dt(e,t,n){return!e.startState||e.startState(t,n)}var At=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};At.prototype.eol=function(){return this.pos>=this.string.length},At.prototype.sol=function(){return this.pos==this.lineStart},At.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},At.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},At.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},At.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},At.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},At.prototype.skipToEnd=function(){this.pos=this.string.length},At.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},At.prototype.backUp=function(e){this.pos-=e},At.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=z(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},At.prototype.indentation=function(){return z(this.string,null,this.tabSize)-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},At.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},At.prototype.current=function(){return this.string.slice(this.start,this.pos)},At.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},At.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},At.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var It=function(e,t){this.state=e,this.lookAhead=t},Et=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function Pt(e,t,n,r){var i=[e.state.modeGen],o={};jt(e,t.text,e.doc.mode,n,function(e,t){return i.push(e,t)},o,r);for(var a=n.state,l=function(r){n.baseTokens=i;var l=e.state.overlays[r],s=1,u=0;n.state=!0,jt(e,t.text,l.mode,n,function(e,t){for(var n=s;u<e;){var r=i[s];r>e&&i.splice(s,1,e,i[s+1],r),s+=2,u=Math.min(e,r)}if(t)if(l.opaque)i.splice(n,s-n,e,"overlay "+t),s=n+2;else for(;n<s;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+t}},o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)l(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Ft(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Wt(e,fe(t)),i=t.text.length>e.options.maxHighlightLength&&Ot(e.doc.mode,r.state),o=Pt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Wt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Et(r,!0,t);var o=function(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=le(o,l-1),u=s.stateAfter;if(u&&(!n||l+(u instanceof It?u.lookAhead:0)<=o.modeFrontier))return l;var c=z(s.text,null,e.options.tabSize);(null==i||r>c)&&(i=l-1,r=c)}return i}(e,t,n),a=o>r.first&&le(r,o-1).stateAfter,l=a?Et.fromSaved(r,a,o):new Et(r,Dt(r.mode),o);return r.iter(o,t,function(n){zt(e,n.text,l);var r=l.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?l.save():null,l.nextLine()}),n&&(r.modeFrontier=l.line),l}function zt(e,t,n,r){var i=e.doc.mode,o=new At(t,e.options.tabSize,n);for(o.start=o.pos=r||0,""==t&&Rt(i,n.state);!o.eol();)Ht(i,o,n.state),o.start=o.pos}function Rt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Nt(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function Ht(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=Nt(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}Et.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Et.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Et.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Et.fromSaved=function(e,t,n){return t instanceof It?new Et(e,Ot(e.mode,t.state),n,t.lookAhead):new Et(e,Ot(e.mode,t),n)},Et.prototype.save=function(e){var t=!1!==e?Ot(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new It(t,this.maxLookAhead):t};var Bt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Ut(e,t,n,r){var i,o,a=e.doc,l=a.mode,s=le(a,(t=Ce(a,t)).line),u=Wt(e,t.line,n),c=new At(s.text,e.options.tabSize,u);for(r&&(o=[]);(r||c.pos<t.ch)&&!c.eol();)c.start=c.pos,i=Ht(l,c,u.state),r&&o.push(new Bt(c,i,Ot(a.mode,u.state)));return r?o:new Bt(c,i,u.state)}function Vt(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[r])||(t[r]+=" "+n[2])}return e}function jt(e,t,n,r,i,o,a){var l=n.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,u=0,c=null,f=new At(t,e.options.tabSize,r),d=e.options.addModeClass&&[null];for(""==t&&Vt(Rt(n,r.state),o);!f.eol();){if(f.pos>e.options.maxHighlightLength?(l=!1,a&&zt(e,t,r,f.pos),f.pos=t.length,s=null):s=Vt(Ht(n,f,r.state,d),o),d){var h=d[0].name;h&&(s="m-"+(s?h+" "+s:h))}if(!l||c!=s){for(;u<f.start;)i(u=Math.min(f.start,u+5e3),c);c=s}f.start=f.pos}for(;u<f.pos;){var p=Math.min(f.pos,u+5e3);i(p,c),u=p}}var $t=function(e,t,n){this.text=e,Ae(this,t),this.height=n?n(this):1};function Gt(e){e.parent=null,De(e)}$t.prototype.lineNo=function(){return fe(this)},lt($t);var Kt={},qt={};function Yt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?qt:Kt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Xt(e,t){var n=N("span",null,null,s?"padding-right: .1px":null),r={pre:N("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=Qt,yt(e.display.measure)&&(a=Qe(o,e.doc.direction))&&(r.addToken=Jt(r.addToken,a)),r.map=[],tn(o,r,Ft(e,o,t!=e.display.externalMeasured&&fe(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=E(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=E(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(vt(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(s){var l=r.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return rt(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=E(r.pre.className,r.textClass||"")),r}function Zt(e){var t=O("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Qt(e,t,n,r,i,o,s){if(t){var u,c=e.splitSpaces?function(e,t){if(e.length>1&&!/  /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o}return r}(t,e.trailingSpace):t,f=e.cm.state.specialChars,d=!1;if(f.test(t)){u=document.createDocumentFragment();for(var h=0;;){f.lastIndex=h;var p=f.exec(t),m=p?p.index-h:t.length-h;if(m){var g=document.createTextNode(c.slice(h,h+m));a&&l<9?u.appendChild(O("span",[g])):u.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!p)break;h+=m+1;var v=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(v=u.appendChild(O("span",q(b),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?((v=u.appendChild(O("span","\r"==p[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",p[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),a&&l<9?u.appendChild(O("span",[v])):u.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,u=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,u),a&&l<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),n||r||i||d||o){var x=n||"";r&&(x+=r),i&&(x+=i);var w=O("span",[u],x,o);if(s)for(var C in s)s.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&w.setAttribute(C,s[C]);return e.content.appendChild(w)}e.content.appendChild(u)}}function Jt(e,t){return function(n,r,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var u=n.pos,c=u+r.length;;){for(var f=void 0,d=0;d<t.length&&!((f=t[d]).to>u&&f.from<=u);d++);if(f.to>=c)return e(n,r,i,o,a,l,s);e(n,r.slice(0,f.to-u),i,o,null,l,s),o=null,r=r.slice(f.to-u),u=f.to}}}function en(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function tn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,l,s,u,c,f,d,h=i.length,p=0,m=1,g="",v=0;;){if(v==p){s=u=c=l="",d=null,f=null,v=1/0;for(var y=[],b=void 0,x=0;x<r.length;++x){var w=r[x],C=w.marker;if("bookmark"==C.type&&w.from==p&&C.widgetNode)y.push(C);else if(w.from<=p&&(null==w.to||w.to>p||C.collapsed&&w.to==p&&w.from==p)){if(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,u=""),C.className&&(s+=" "+C.className),C.css&&(l=(l?l+";":"")+C.css),C.startStyle&&w.from==p&&(c+=" "+C.startStyle),C.endStyle&&w.to==v&&(b||(b=[])).push(C.endStyle,w.to),C.title&&((d||(d={})).title=C.title),C.attributes)for(var S in C.attributes)(d||(d={}))[S]=C.attributes[S];C.collapsed&&(!f||Pe(f.marker,C)<0)&&(f=w)}else w.from>p&&v>w.from&&(v=w.from)}if(b)for(var k=0;k<b.length;k+=2)b[k+1]==v&&(u+=" "+b[k]);if(!f||f.from==p)for(var L=0;L<y.length;++L)en(t,0,y[L]);if(f&&(f.from||0)==p){if(en(t,(null==f.to?h+1:f.to)-p,f.marker,null==f.from),null==f.to)return;f.to==p&&(f=!1)}}if(p>=h)break;for(var T=Math.min(h,v);;){if(g){var M=p+g.length;if(!f){var _=M>T?g.slice(0,T-p):g;t.addToken(t,_,a?a+s:s,c,p+_.length==v?u:"",l,d)}if(M>=T){g=g.slice(T-p),p=T;break}p=M,c=""}g=i.slice(o,o=n[m++]),a=Yt(n[m++],t.cm.options)}}else for(var O=1;O<n.length;O+=2)t.addToken(t,i.slice(o,o=n[O]),Yt(n[O+1],t.cm.options))}function nn(e,t,n){this.line=t,this.rest=function(e){for(var t,n;t=ze(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}(t),this.size=this.rest?fe(Y(this.rest))-n+1:1,this.node=this.text=null,this.hidden=je(e,t)}function rn(e,t,n){for(var r,i=[],o=t;o<n;o=r){var a=new nn(e.doc,le(e.doc,o),o);r=o+a.size,i.push(a)}return i}var on=null;var an=null;function ln(e,t){var n=tt(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);on?r=on.delayedCallbacks:an?r=an:(r=an=[],setTimeout(sn,0));for(var o=function(e){r.push(function(){return n[e].apply(null,i)})},a=0;a<n.length;++a)o(a)}}function sn(){var e=an;an=null;for(var t=0;t<e.length;++t)e[t]()}function un(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?dn(e,t):"gutter"==o?pn(e,t,n,r):"class"==o?hn(e,t):"widget"==o&&mn(e,t,r)}t.changes=null}function cn(e){return e.node==e.text&&(e.node=O("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),a&&l<8&&(e.node.style.zIndex=2)),e.node}function fn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Xt(e,t)}function dn(e,t){var n=t.text.className,r=fn(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,hn(e,t)):n&&(t.text.className=n)}function hn(e,t){!function(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=cn(t);t.background=r.insertBefore(O("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?cn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function pn(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=cn(t);t.gutterBackground=O("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=cn(t),l=t.gutter=O("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(l),a.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(O("div",pe(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.options.gutters.length;++s){var u=e.options.gutters[s],c=o.hasOwnProperty(u)&&o[u];c&&l.appendChild(O("div",[c],"CodeMirror-gutter-elt","left: "+r.gutterLeft[u]+"px; width: "+r.gutterWidth[u]+"px"))}}}function mn(e,t,n){t.alignable&&(t.alignable=null);for(var r=t.node.firstChild,i=void 0;r;r=i)i=r.nextSibling,"CodeMirror-linewidget"==r.className&&t.node.removeChild(r);vn(e,t,n)}function gn(e,t,n,r){var i=fn(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),hn(e,t),pn(e,t,n,r),vn(e,t,r),t.node}function vn(e,t,n){if(yn(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)yn(e,t.rest[r],t,n,!1)}function yn(e,t,n,r,i){if(t.widgets)for(var o=cn(n),a=0,l=t.widgets;a<l.length;++a){var s=l[a],u=O("div",[s.node],"CodeMirror-linewidget");s.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),bn(s,u,n,r),e.display.input.setUneditable(u),i&&s.above?o.insertBefore(u,n.gutter||n.text):o.appendChild(u),ln(s,"redraw")}}function bn(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function xn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!D(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),_(t.display.measure,O("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function wn(e,t){for(var n=dt(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Cn(e){return e.lineSpace.offsetTop}function Sn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function kn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=_(e.measure,O("pre","x")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Ln(e){return B-e.display.nativeBarWidth}function Tn(e){return e.display.scroller.clientWidth-Ln(e)-e.display.barWidth}function Mn(e){return e.display.scroller.clientHeight-Ln(e)-e.display.barHeight}function _n(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(fe(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function On(e,t,n,r){return An(e,Dn(e,t),n,r)}function Nn(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[lr(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function Dn(e,t){var n=fe(t),r=Nn(e,n);r&&!r.text?r=null:r&&r.changes&&(un(e,r,n,nr(e)),e.curOp.forceUpdate=!0),r||(r=function(e,t){var n=fe(t=Be(t)),r=e.display.externalMeasured=new nn(e.doc,t,n);r.lineN=n;var i=r.built=Xt(e,r);return r.text=i.pre,_(e.display.lineMeasure,i.pre),r}(e,t));var i=_n(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function An(e,t,n,r,i){t.before&&(n=-1);var o,s=n+(r||"");return t.cache.hasOwnProperty(s)?o=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(!function(e,t,n){var r=e.options.lineWrapping,i=r&&Tn(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],u=a[l+1];Math.abs(s.bottom-u.bottom)>2&&o.push((s.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,n,r){var i,o=Pn(t.map,n,r),s=o.node,u=o.start,c=o.end,f=o.collapse;if(3==s.nodeType){for(var d=0;d<4;d++){for(;u&&ie(t.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c<o.coverEnd&&ie(t.line.text.charAt(o.coverStart+c));)++c;if((i=a&&l<9&&0==u&&c==o.coverEnd-o.coverStart?s.parentNode.getBoundingClientRect():Fn(L(s,u,c).getClientRects(),r)).left||i.right||0==u)break;c=u,u-=1,f="right"}a&&l<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Ct)return Ct;var t=_(e,O("span","x")),n=t.getBoundingClientRect(),r=L(t,0,1).getBoundingClientRect();return Ct=Math.abs(n.left-r.left)>1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,i))}else{var h;u>0&&(f=r="right"),i=e.options.lineWrapping&&(h=s.getClientRects()).length>1?h["right"==r?h.length-1:0]:s.getBoundingClientRect()}if(a&&l<9&&!u&&(!i||!i.left&&!i.right)){var p=s.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+tr(e.display),top:p.top,bottom:p.bottom}:En}for(var m=i.top-t.rect.top,g=i.bottom-t.rect.top,v=(m+g)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(v<y[b]);b++);var x=b?y[b-1]:0,w=y[b],C={left:("right"==f?i.right:i.left)-t.rect.left,right:("left"==f?i.left:i.right)-t.rect.left,top:x,bottom:w};i.left||i.right||(C.bogus=!0);e.options.singleCursorHeightPerLine||(C.rtop=m,C.rbottom=g);return C}(e,t,n,r)).bogus||(t.cache[s]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var In,En={left:0,right:0,top:0,bottom:0};function Pn(e,t,n){for(var r,i,o,a,l,s,u=0;u<e.length;u+=3)if(l=e[u],s=e[u+1],t<l?(i=0,o=1,a="left"):t<s?o=(i=t-l)+1:(u==e.length-3||t==s&&e[u+3]>t)&&(i=(o=s-l)-1,t>=s&&(a="right")),null!=i){if(r=e[u+2],l==s&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[2+(u-=3)],a="left";if("right"==n&&i==s-l)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)r=e[(u+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function Fn(e,t){var n=En;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function Wn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function zn(e){e.display.externalMeasure=null,M(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Wn(e.display.view[t])}function Rn(e){zn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Hn(){return c&&g?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Bn(){return c&&g?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Un(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=xn(e.widgets[n]));return t}function Vn(e,t,n,r,i){if(!i){var o=Un(t);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=Ge(t);if("local"==r?a+=Cn(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+("window"==r?0:Bn());var s=l.left+("window"==r?0:Hn());n.left+=s,n.right+=s}return n.top+=a,n.bottom+=a,n}function jn(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=Hn(),i-=Bn();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function $n(e,t,n,r,i){return r||(r=le(e.doc,t.line)),Vn(e,r,On(e,r,t.ch,i),n)}function Gn(e,t,n,r,i,o){function a(t,a){var l=An(e,i,t,a?"right":"left",o);return a?l.left=l.right:l.right=l.left,Vn(e,r,l,n)}r=r||le(e.doc,t.line),i||(i=Dn(e,r));var l=Qe(r,e.doc.direction),s=t.ch,u=t.sticky;if(s>=r.text.length?(s=r.text.length,u="before"):s<=0&&(s=0,u="after"),!l)return a("before"==u?s-1:s,"before"==u);function c(e,t,n){var r=1==l[t].level;return a(n?e-1:e,r!=n)}var f=Xe(l,s,u),d=Ye,h=c(s,f,"before"==u);return null!=d&&(h.other=c(s,d,"before"!=u)),h}function Kn(e,t){var n=0;t=Ce(e.doc,t),e.options.lineWrapping||(n=tr(e.display)*t.ch);var r=le(e.doc,t.line),i=Ge(r)+Cn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function qn(e,t,n,r,i){var o=me(e,t,n);return o.xRel=i,r&&(o.outside=!0),o}function Yn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return qn(r.first,0,null,!0,-1);var i=de(r,n),o=r.first+r.size-1;if(i>o)return qn(r.first+r.size-1,le(r,o).text.length,null,!0,1);t<0&&(t=0);for(var a=le(r,i);;){var l=Jn(e,a,i,t,n),s=Re(a,l.ch+(l.xRel>0?1:0));if(!s)return l;var u=s.find(1);if(u.line==i)return u;a=le(r,i=u.line)}}function Xn(e,t,n,r){r-=Un(t);var i=t.text.length,o=ae(function(t){return An(e,n,t-1).bottom<=r},i,0);return{begin:o,end:i=ae(function(t){return An(e,n,t).top>r},o,i)}}function Zn(e,t,n,r){return n||(n=Dn(e,t)),Xn(e,t,n,Vn(e,t,An(e,n,r),"line").top)}function Qn(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function Jn(e,t,n,r,i){i-=Ge(t);var o=Dn(e,t),a=Un(t),l=0,s=t.text.length,u=!0,c=Qe(t,e.doc.direction);if(c){var f=(e.options.lineWrapping?function(e,t,n,r,i,o,a){var l=Xn(e,t,r,a),s=l.begin,u=l.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,f=null,d=0;d<i.length;d++){var h=i[d];if(!(h.from>=u||h.to<=s)){var p=1!=h.level,m=An(e,r,p?Math.min(u,h.to)-1:Math.max(s,h.from)).right,g=m<o?o-m+1e9:m-o;(!c||f>g)&&(c=h,f=g)}}c||(c=i[i.length-1]);c.from<s&&(c={from:s,to:c.to,level:c.level});c.to>u&&(c={from:c.from,to:u,level:c.level});return c}:function(e,t,n,r,i,o,a){var l=ae(function(l){var s=i[l],u=1!=s.level;return Qn(Gn(e,me(n,u?s.to:s.from,u?"before":"after"),"line",t,r),o,a,!0)},0,i.length-1),s=i[l];if(l>0){var u=1!=s.level,c=Gn(e,me(n,u?s.from:s.to,u?"after":"before"),"line",t,r);Qn(c,o,a,!0)&&c.top>a&&(s=i[l-1])}return s})(e,t,n,o,c,r,i);l=(u=1!=f.level)?f.from:f.to-1,s=u?f.to:f.from-1}var d,h,p=null,m=null,g=ae(function(t){var n=An(e,o,t);return n.top+=a,n.bottom+=a,!!Qn(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=t,m=n),!0)},l,s),v=!1;if(m){var y=r-m.left<m.right-r,b=y==u;g=p+(b?0:1),h=b?"after":"before",d=y?m.left:m.right}else{u||g!=s&&g!=l||g++,h=0==g?"after":g==t.text.length?"before":An(e,o,g-(u?1:0)).bottom+a<=i==u?"after":"before";var x=Gn(e,me(n,g,h),"line",t,o);d=x.left,v=i<x.top||i>=x.bottom}return qn(n,g=oe(t.text,g,1),h,v,r-d)}function er(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==In){In=O("pre");for(var t=0;t<49;++t)In.appendChild(document.createTextNode("x")),In.appendChild(O("br"));In.appendChild(document.createTextNode("x"))}_(e.measure,In);var n=In.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),M(e.measure),n||1}function tr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=O("span","xxxxxxxxxx"),n=O("pre",[t]);_(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function nr(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)n[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,r[e.options.gutters[a]]=o.clientWidth;return{fixedPos:rr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function rr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ir(e){var t=er(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/tr(e.display)-3);return function(i){if(je(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function or(e){var t=e.doc,n=ir(e);t.iter(function(e){var t=n(e);t!=e.height&&ce(e,t)})}function ar(e,t,n,r){var i=e.display;if(!n&&"true"==dt(t).getAttribute("cm-not-content"))return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(t){return null}var s,u=Yn(e,o,a);if(r&&1==u.xRel&&(s=le(e.doc,u.line).text).length==u.ch){var c=z(s,s.length,e.options.tabSize)-s.length;u=me(u.line,Math.max(0,Math.round((o-kn(e.display).left)/tr(e.display))-c))}return u}function lr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if((t-=n[r].size)<0)return r}function sr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ur(e,t){void 0===t&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(t||a!=n.sel.primIndex){var l=n.sel.ranges[a];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var s=l.empty();(s||e.options.showCursorWhenSelecting)&&cr(e,l.head,i),s||dr(e,l,o)}}return r}function cr(e,t,n){var r=Gn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(O("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var o=n.appendChild(O("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function fr(e,t){return e.top-t.top||e.left-t.left}function dr(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=kn(e.display),l=a.left,s=Math.max(r.sizerWidth,Tn(e)-r.sizer.offsetLeft)-a.right,u="ltr"==i.direction;function c(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),o.appendChild(O("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n                             top: "+t+"px; width: "+(null==n?s-e:n)+"px;\n                             height: "+(r-t)+"px"))}function f(t,n,r){var o,a,f=le(i,t),d=f.text.length;function h(n,r){return $n(e,me(t,n),"div",f,r)}function p(t,n,r){var i=Zn(e,f,null,t),o="ltr"==n==("after"==r)?"left":"right";return h("after"==r?i.begin:i.end-(/\s/.test(f.text.charAt(i.end-1))?2:1),o)[o]}var m=Qe(f,i.direction);return function(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}(m,n||0,null==r?d:r,function(e,t,i,f){var g="ltr"==i,v=h(e,g?"left":"right"),y=h(t-1,g?"right":"left"),b=null==n&&0==e,x=null==r&&t==d,w=0==f,C=!m||f==m.length-1;if(y.top-v.top<=3){var S=(u?x:b)&&C,k=(u?b:x)&&w?l:(g?v:y).left,L=S?s:(g?y:v).right;c(k,v.top,L-k,v.bottom)}else{var T,M,_,O;g?(T=u&&b&&w?l:v.left,M=u?s:p(e,i,"before"),_=u?l:p(t,i,"after"),O=u&&x&&C?s:y.right):(T=u?p(e,i,"before"):l,M=!u&&b&&w?s:v.right,_=!u&&x&&C?l:y.left,O=u?p(t,i,"after"):s),c(T,v.top,M-T,v.bottom),v.bottom<y.top&&c(l,v.bottom,null,y.top),c(_,y.top,O-_,y.bottom)}(!o||fr(v,o)<0)&&(o=v),fr(y,o)<0&&(o=y),(!a||fr(v,a)<0)&&(a=v),fr(y,a)<0&&(a=y)}),{start:o,end:a}}var d=t.from(),h=t.to();if(d.line==h.line)f(d.line,d.ch,h.ch);else{var p=le(i,d.line),m=le(i,h.line),g=Be(p)==Be(m),v=f(d.line,d.ch,g?p.text.length+1:null).end,y=f(h.line,g?0:null,h.ch).start;g&&(v.top<y.top-2?(c(v.right,v.top,null,v.bottom),c(l,y.top,y.left,y.bottom)):c(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&c(l,v.bottom,null,y.top)}n.appendChild(o)}function hr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function pr(e){e.state.focused||(e.display.input.focus(),gr(e))}function mr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,vr(e))},100)}function gr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(rt(e,"focus",e,t),e.state.focused=!0,I(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),s&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),hr(e))}function vr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(rt(e,"blur",e,t),e.state.focused=!1,T(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function yr(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],o=e.options.lineWrapping,s=void 0,u=0;if(!i.hidden){if(a&&l<8){var c=i.node.offsetTop+i.node.offsetHeight;s=c-n,n=c}else{var f=i.node.getBoundingClientRect();s=f.bottom-f.top,!o&&i.text.firstChild&&(u=i.text.firstChild.getBoundingClientRect().right-f.left-1)}var d=i.line.height-s;if(s<2&&(s=er(t)),(d>.005||d<-.005)&&(ce(i.line,s),br(i.line),i.rest))for(var h=0;h<i.rest.length;h++)br(i.rest[h]);if(u>e.display.sizerWidth){var p=Math.ceil(u/tr(e.display));p>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function br(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function xr(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Cn(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=de(t,r),a=de(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;l<o?(o=l,a=de(t,Ge(le(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=de(t,Ge(le(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function wr(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=rr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var l=n[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function Cr(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=pe(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(O("div",[O("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",si(e),!0}return!1}function Sr(e,t){var n=e.display,r=er(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Mn(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+Sn(n),s=t.top<r,u=t.bottom>l-r;if(t.top<i)a.scrollTop=s?0:t.top;else if(t.bottom>i+o){var c=Math.min(t.top,(u?l:t.bottom)-o);c!=i&&(a.scrollTop=c)}var f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft,d=Tn(e)-(e.options.fixedGutter?n.gutters.offsetWidth:0),h=t.right-t.left>d;return h&&(t.right=t.left+d),t.left<10?a.scrollLeft=0:t.left<f?a.scrollLeft=Math.max(0,t.left-(h?0:10)):t.right>d+f-3&&(a.scrollLeft=t.right+(h?0:10)-d),a}function kr(e,t){null!=t&&(Mr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Lr(e){Mr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Tr(e,t,n){null==t&&null==n||Mr(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Mr(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,_r(e,Kn(e,t.from),Kn(e,t.to),t.margin))}function _r(e,t,n,r){var i=Sr(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Tr(e,i.scrollLeft,i.scrollTop)}function Or(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||li(e,{top:t}),Nr(e,t,!0),n&&li(e),ni(e,100))}function Nr(e,t,n){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Dr(e,t,n,r){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,wr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Ar(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Sn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Ln(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Ir=function(e,t,n){this.cm=n;var r=this.vert=O("div",[O("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=O("div",[O("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),et(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),et(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,a&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ir.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Ir.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Ir.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Ir.prototype.zeroWidthHack=function(){var e=y&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new R,this.disableVert=new R},Ir.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)})},Ir.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Er=function(){};function Pr(e,t){t||(t=Ar(e));var n=e.display.barWidth,r=e.display.barHeight;Fr(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&yr(e),Fr(e,Ar(e)),n=e.display.barWidth,r=e.display.barHeight}function Fr(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}Er.prototype.update=function(){return{bottom:0,right:0}},Er.prototype.setScrollLeft=function(){},Er.prototype.setScrollTop=function(){},Er.prototype.clear=function(){};var Wr={native:Ir,null:Er};function zr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&T(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Wr[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),et(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){"horizontal"==n?Dr(e,t):Or(e,t)},e),e.display.scrollbars.addClass&&I(e.display.wrapper,e.display.scrollbars.addClass)}var Rr=0;function Hr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Rr},function(e){on?on.ops.push(e):e.ownsGroup=on={ops:[e],delayedCallbacks:[]}}(e.curOp)}function Br(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}(n)}finally{on=null,t(n)}}(t,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,n=0;n<t.length;n++)Ur(t[n]);for(var r=0;r<t.length;r++)Vr(t[r]);for(var i=0;i<t.length;i++)jr(t[i]);for(var o=0;o<t.length;o++)$r(t[o]);for(var a=0;a<t.length;a++)Gr(t[a])}(e)})}function Ur(e){var t=e.cm,n=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Ln(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ln(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&qe(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ii(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Vr(e){e.updatedDisplay=e.mustUpdate&&oi(e.cm,e.update)}function jr(e){var t=e.cm,n=t.display;e.updatedDisplay&&yr(t),e.barMeasure=Ar(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=On(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Ln(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Tn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function $r(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Dr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==A();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Pr(t,e.barMeasure),e.updatedDisplay&&ui(t,e.barMeasure),e.selectionChanged&&hr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&pr(e.cm)}function Gr(e){var t=e.cm,n=t.display,r=t.doc;(e.updatedDisplay&&ai(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&Nr(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Dr(t,e.scrollLeft,!0,!0),e.scrollToPos)&&function(e,t){if(!it(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=O("div","​",null,"position: absolute;\n                         top: "+(t.top-n.viewOffset-Cn(e.display))+"px;\n                         height: "+(t.bottom-t.top+Ln(e)+n.barHeight)+"px;\n                         left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?me(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?me(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,l=Gn(e,t),s=n&&n!=t?Gn(e,n):l,u=Sr(e,i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-r,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+r}),c=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=u.scrollTop&&(Or(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=u.scrollLeft&&(Dr(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(a=!0)),!a)break}return i}(t,Ce(r,e.scrollToPos.from),Ce(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;a<i.length;++a)i[a].lines.length||rt(i[a],"hide");if(o)for(var l=0;l<o.length;++l)o[l].lines.length&&rt(o[l],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&rt(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Kr(e,t){if(e.curOp)return t();Hr(e);try{return t()}finally{Br(e)}}function qr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Hr(e);try{return t.apply(e,arguments)}finally{Br(e)}}}function Yr(e){return function(){if(this.curOp)return e.apply(this,arguments);Hr(this);try{return e.apply(this,arguments)}finally{Br(this)}}}function Xr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Hr(t);try{return e.apply(this,arguments)}finally{Br(t)}}}function Zr(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Le&&Ue(e.doc,t)<i.viewTo&&Jr(e);else if(n<=i.viewFrom)Le&&Ve(e.doc,n+r)>i.viewFrom?Jr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Jr(e);else if(t<=i.viewFrom){var o=ei(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Jr(e)}else if(n>=i.viewTo){var a=ei(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):Jr(e)}else{var l=ei(e,t,t,-1),s=ei(e,n,n+r,1);l&&s?(i.view=i.view.slice(0,l.index).concat(rn(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):Jr(e)}var u=i.externalMeasured;u&&(n<u.lineN?u.lineN+=r:t<u.lineN+u.size&&(i.externalMeasured=null))}function Qr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[lr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==H(a,n)&&a.push(n)}}}function Jr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ei(e,t,n,r){var i,o=lr(e,t),a=e.display.view;if(!Le||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var l=e.display.viewFrom,s=0;s<o;s++)l+=a[s].size;if(l!=t){if(r>0){if(o==a.length-1)return null;i=l+a[o].size-t,o++}else i=l-t;t+=i,n+=i}for(;Ue(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function ti(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function ni(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,F(ri,e))}function ri(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=Wt(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength?Ot(t.mode,r.state):null,s=Pt(e,o,r,!0);l&&(r.state=l),o.styles=s.styles;var u=o.styleClasses,c=s.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var f=!a||a.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),d=0;!f&&d<a.length;++d)f=a[d]!=o.styles[d];f&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&zt(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return ni(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Kr(e,function(){for(var t=0;t<i.length;t++)Qr(e,i[t],"text")})}}var ii=function(e,t,n){var r=e.display;this.viewport=t,this.visible=xr(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Tn(e),this.force=n,this.dims=nr(e),this.events=[]};function oi(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return Jr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==ti(e))return!1;Cr(e)&&(Jr(e),t.dims=nr(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Le&&(o=Ue(e.doc,o),a=Ve(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=rn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=rn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(lr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(rn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,lr(e,n)))),r.viewTo=n}(e,o,a),n.viewOffset=Ge(le(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var u=ti(e);if(!l&&0==u&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=function(e){if(e.hasFocus())return null;var t=A();if(!t||!D(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&D(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return u>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function l(t){var n=t.nextSibling;return s&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var u=r.view,c=r.viewFrom,f=0;f<u.length;f++){var d=u[f];if(d.hidden);else if(d.node&&d.node.parentNode==o){for(;a!=d.node;)a=l(a);var h=i&&null!=t&&t<=c&&d.lineNumber;d.changes&&(H(d.changes,"gutter")>-1&&(h=!1),un(e,d,c,n)),h&&(M(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(pe(e.options,c)))),a=d.node.nextSibling}else{var p=gn(e,d,c,n);o.insertBefore(p,a)}c+=d.size}for(;a;)a=l(a)}(e,n.updateLineNumbers,t.dims),u>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=A()&&(e.activeElt.focus(),e.anchorNode&&D(document.body,e.anchorNode)&&D(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(c),M(n.cursorDiv),M(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ni(e,400)),n.updateLineNumbers=null,!0}function ai(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Tn(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Sn(e.display)-Mn(e),n.top)}),t.visible=xr(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&oi(e,t);r=!1){yr(e);var i=Ar(e);sr(e),Pr(e,i),ui(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function li(e,t){var n=new ii(e,t);if(oi(e,n)){yr(e),ai(e,n);var r=Ar(e);sr(e),Pr(e,r),ui(e,r),n.finish()}}function si(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function ui(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Ln(e)+"px"}function ci(e){var t=e.display.gutters,n=e.options.gutters;M(t);for(var r=0;r<n.length;++r){var i=n[r],o=t.appendChild(O("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&(e.display.lineGutter=o,o.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=r?"":"none",si(e)}function fi(e){var t=H(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}ii.prototype.signal=function(e,t){at(e,t)&&this.events.push(arguments)},ii.prototype.finish=function(){for(var e=0;e<this.events.length;e++)rt.apply(null,this.events[e])};var di=0,hi=null;function pi(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function mi(e){var t=pi(e);return t.x*=hi,t.y*=hi,t}function gi(e,t){var r=pi(t),i=r.x,o=r.y,a=e.display,l=a.scroller,u=l.scrollWidth>l.clientWidth,c=l.scrollHeight>l.clientHeight;if(i&&u||o&&c){if(o&&y&&s)e:for(var d=t.target,h=a.view;d!=l;d=d.parentNode)for(var p=0;p<h.length;p++)if(h[p].node==d){e.display.currentWheelTarget=d;break e}if(i&&!n&&!f&&null!=hi)return o&&c&&Or(e,Math.max(0,l.scrollTop+o*hi)),Dr(e,Math.max(0,l.scrollLeft+i*hi)),(!o||o&&c)&&st(t),void(a.wheelStartX=null);if(o&&null!=hi){var m=o*hi,g=e.doc.scrollTop,v=g+a.wrapper.clientHeight;m<0?g=Math.max(0,g+m-50):v=Math.min(e.doc.height,v+m+50),li(e,{top:g,bottom:v})}di<20&&(null==a.wheelStartX?(a.wheelStartX=l.scrollLeft,a.wheelStartY=l.scrollTop,a.wheelDX=i,a.wheelDY=o,setTimeout(function(){if(null!=a.wheelStartX){var e=l.scrollLeft-a.wheelStartX,t=l.scrollTop-a.wheelStartY,n=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&(hi=(hi*di+n)/(di+1),++di)}},200)):(a.wheelDX+=i,a.wheelDY+=o))}}a?hi=-.53:n?hi=15:c?hi=-.7:d&&(hi=-1/3);var vi=function(e,t){this.ranges=e,this.primIndex=t};vi.prototype.primary=function(){return this.ranges[this.primIndex]},vi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!ve(n.anchor,r.anchor)||!ve(n.head,r.head))return!1}return!0},vi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new yi(ye(this.ranges[t].anchor),ye(this.ranges[t].head));return new vi(e,this.primIndex)},vi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},vi.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(ge(t,r.from())>=0&&ge(e,r.to())<=0)return n}return-1};var yi=function(e,t){this.anchor=e,this.head=t};function bi(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(e,t){return ge(e.from(),t.from())}),n=H(t,i);for(var o=1;o<t.length;o++){var a=t[o],l=t[o-1],s=ge(l.to(),a.from());if(r&&!a.empty()?s>0:s>=0){var u=xe(l.from(),a.from()),c=be(l.to(),a.to()),f=l.empty()?a.from()==a.head:l.from()==l.head;o<=n&&--n,t.splice(--o,2,new yi(f?c:u,f?u:c))}}return new vi(t,n)}function xi(e,t){return new vi([new yi(e,t||e)],0)}function wi(e){return e.text?me(e.from.line+e.text.length-1,Y(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Ci(e,t){if(ge(e,t.from)<0)return e;if(ge(e,t.to)<=0)return wi(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=wi(t).ch-t.to.ch),me(n,r)}function Si(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new yi(Ci(i.anchor,t),Ci(i.head,t)))}return bi(e.cm,n,e.sel.primIndex)}function ki(e,t,n){return e.line==t.line?me(n.line,e.ch-t.ch+n.ch):me(n.line+(e.line-t.line),e.ch)}function Li(e){e.doc.mode=Tt(e.options,e.doc.modeOption),Ti(e)}function Ti(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ni(e,100),e.state.modeGen++,e.curOp&&Zr(e)}function Mi(e,t){return 0==t.from.ch&&0==t.to.ch&&""==Y(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function _i(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){!function(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),De(e),Ae(e,n);var i=r?r(e):1;i!=e.height&&ce(e,i)}(e,n,i,r),ln(e,"change",e,t)}function a(e,t){for(var n=[],o=e;o<t;++o)n.push(new $t(u[o],i(o),r));return n}var l=t.from,s=t.to,u=t.text,c=le(e,l.line),f=le(e,s.line),d=Y(u),h=i(u.length-1),p=s.line-l.line;if(t.full)e.insert(0,a(0,u.length)),e.remove(u.length,e.size-u.length);else if(Mi(e,t)){var m=a(0,u.length-1);o(f,f.text,h),p&&e.remove(l.line,p),m.length&&e.insert(l.line,m)}else if(c==f)if(1==u.length)o(c,c.text.slice(0,l.ch)+d+c.text.slice(s.ch),h);else{var g=a(1,u.length-1);g.push(new $t(d+c.text.slice(s.ch),h,r)),o(c,c.text.slice(0,l.ch)+u[0],i(0)),e.insert(l.line+1,g)}else if(1==u.length)o(c,c.text.slice(0,l.ch)+u[0]+f.text.slice(s.ch),i(0)),e.remove(l.line+1,p);else{o(c,c.text.slice(0,l.ch)+u[0],i(0)),o(f,d+f.text.slice(s.ch),h);var v=a(1,u.length-1);p>1&&e.remove(l.line+1,p-1),e.insert(l.line+1,v)}ln(e,"change",e,t)}function Oi(e,t,n){!function e(r,i,o){if(r.linked)for(var a=0;a<r.linked.length;++a){var l=r.linked[a];if(l.doc!=i){var s=o&&l.sharedHist;n&&!s||(t(l.doc,s),e(l.doc,r,s))}}}(e,null,!0)}function Ni(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,or(e),Li(e),Di(e),e.options.lineWrapping||qe(e),e.options.mode=t.modeOption,Zr(e)}function Di(e){("rtl"==e.doc.direction?I:T)(e.display.lineDiv,"CodeMirror-rtl")}function Ai(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Ii(e,t){var n={from:ye(t.from),to:wi(t),text:se(e,t.from,t.to)};return zi(e,n,t.from.line,t.to.line+1),Oi(e,function(e){return zi(e,n,t.from.line,t.to.line+1)},!0),n}function Ei(e){for(;e.length;){if(!Y(e).ranges)break;e.pop()}}function Pi(e,t,n,r){var i=e.history;i.undone.length=0;var o,a,l=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>l-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(Ei(e.done),Y(e.done)):e.done.length&&!Y(e.done).ranges?Y(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Y(e.done)):void 0}(i,i.lastOp==r)))a=Y(o.changes),0==ge(t.from,t.to)&&0==ge(t.from,a.to)?a.to=wi(t):o.changes.push(Ii(e,t));else{var s=Y(i.done);for(s&&s.ranges||Wi(e.sel,i.done),o={changes:[Ii(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||rt(e,"historyAdded")}function Fi(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,Y(i.done),t))?i.done[i.done.length-1]=t:Wi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Ei(i.undone)}function Wi(e,t){var n=Y(t);n&&n.ranges&&n.equals(e)||t.push(e)}function zi(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o})}function Ri(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Hi(e,t){var n=function(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Ri(n[i]));return r}(e,t),r=Oe(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],u=0;u<o.length;++u)if(o[u].marker==s.marker)continue e;o.push(s)}else a&&(n[i]=a)}return n}function Bi(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)r.push(n?vi.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];r.push({changes:l});for(var s=0;s<a.length;++s){var u=a[s],c=void 0;if(l.push({from:u.from,to:u.to,text:u.text}),t)for(var f in u)(c=f.match(/^spans_(\d+)$/))&&H(t,Number(c[1]))>-1&&(Y(l)[f]=u[f],delete u[f])}}}return r}function Ui(e,t,n,r){if(r){var i=e.anchor;if(n){var o=ge(t,i)<0;o!=ge(n,i)<0?(i=t,t=n):o!=ge(t,n)<0&&(t=n)}return new yi(i,t)}return new yi(n||t,t)}function Vi(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),qi(e,new vi([Ui(e.sel.primary(),t,n,i)],0),r)}function ji(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=Ui(e.sel.ranges[o],t[o],null,i);qi(e,bi(e.cm,r,e.sel.primIndex),n)}function $i(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,qi(e,bi(e.cm,i,e.sel.primIndex),r)}function Gi(e,t,n,r){qi(e,xi(t,n),r)}function Ki(e,t,n){var r=e.history.done,i=Y(r);i&&i.ranges?(r[r.length-1]=t,Yi(e,t,n)):qi(e,t,n)}function qi(e,t,n){Yi(e,t,n),Fi(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Yi(e,t,n){(at(e,"beforeSelectionChange")||e.cm&&at(e.cm,"beforeSelectionChange"))&&(t=function(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new yi(Ce(e,t[n].anchor),Ce(e,t[n].head))},origin:n&&n.origin};return rt(e,"beforeSelectionChange",e,r),e.cm&&rt(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?bi(e.cm,r.ranges,r.ranges.length-1):t}(e,t,n)),Xi(e,Qi(e,t,n&&n.bias||(ge(t.primary().head,e.sel.primary().head)<0?-1:1),!0)),n&&!1===n.scroll||!e.cm||Lr(e.cm)}function Xi(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,ot(e.cm)),ln(e,"cursorActivity",e))}function Zi(e){Xi(e,Qi(e,e.sel,null,!1))}function Qi(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=eo(e,a.anchor,l&&l.anchor,n,r),u=eo(e,a.head,l&&l.head,n,r);(i||s!=a.anchor||u!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new yi(s,u))}return i?bi(e.cm,i,t.primIndex):t}function Ji(e,t,n,r,i){var o=le(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker;if((null==l.from||(s.inclusiveLeft?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(s.inclusiveRight?l.to>=t.ch:l.to>t.ch))){if(i&&(rt(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(n){var u=s.find(r<0?1:-1),c=void 0;if((r<0?s.inclusiveRight:s.inclusiveLeft)&&(u=to(e,u,-r,u&&u.line==t.line?o:null)),u&&u.line==t.line&&(c=ge(u,n))&&(r<0?c<0:c>0))return Ji(e,u,t,r,i)}var f=s.find(r<0?-1:1);return(r<0?s.inclusiveLeft:s.inclusiveRight)&&(f=to(e,f,r,f.line==t.line?o:null)),f?Ji(e,f,t,r,i):null}}return t}function eo(e,t,n,r,i){var o=r||1,a=Ji(e,t,n,o,i)||!i&&Ji(e,t,n,o,!0)||Ji(e,t,n,-o,i)||!i&&Ji(e,t,n,-o,!0);return a||(e.cantEdit=!0,me(e.first,0))}function to(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?Ce(e,me(t.line-1)):null:n>0&&t.ch==(r||le(e,t.line)).text.length?t.line<e.first+e.size-1?me(t.line+1,0):null:new me(t.line,t.ch+n)}function no(e){e.setSelection(me(e.firstLine(),0),me(e.lastLine()),V)}function ro(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,o){t&&(r.from=Ce(e,t)),n&&(r.to=Ce(e,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),rt(e,"beforeChange",e,r),e.cm&&rt(e.cm,"beforeChange",e.cm,r),r.canceled?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function io(e,t,n){if(e.cm){if(!e.cm.curOp)return qr(e.cm,io)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(at(e,"beforeChange")||e.cm&&at(e.cm,"beforeChange"))||(t=ro(e,t,!0))){var r=ke&&!n&&function(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=H(r,n)||(r||(r=[])).push(n)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],l=a.find(0),s=0;s<i.length;++s){var u=i[s];if(!(ge(u.to,l.from)<0||ge(u.from,l.to)>0)){var c=[s,1],f=ge(u.from,l.from),d=ge(u.to,l.to);(f<0||!a.inclusiveLeft&&!f)&&c.push({from:u.from,to:l.from}),(d>0||!a.inclusiveRight&&!d)&&c.push({from:l.to,to:u.to}),i.splice.apply(i,c),s+=c.length-3}}return i}(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)oo(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else oo(e,t)}}function oo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=ge(t.from,t.to)){var n=Si(e,t);Pi(e,t,n,e.cm?e.cm.curOp.id:NaN),so(e,t,n,Oe(e,t));var r=[];Oi(e,function(e,n){n||-1!=H(r,e.history)||(ho(e.history,t),r.push(e.history)),so(e,t,null,Oe(e,t))})}}function ao(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,a=e.sel,l="undo"==t?o.done:o.undone,s="undo"==t?o.undone:o.done,u=0;u<l.length&&(i=l[u],n?!i.ranges||i.equals(e.sel):i.ranges);u++);if(u!=l.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=l.pop()).ranges){if(r)return void l.push(i);break}if(Wi(i,s),n&&!i.equals(e.sel))return void qi(e,i,{clearRedo:!1});a=i}var c=[];Wi(a,s),s.push({changes:c,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var f=at(e,"beforeChange")||e.cm&&at(e.cm,"beforeChange"),d=function(n){var r=i.changes[n];if(r.origin=t,f&&!ro(e,r,!1))return l.length=0,{};c.push(Ii(e,r));var o=n?Si(e,r):Y(l);so(e,r,o,Hi(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:wi(r)});var a=[];Oi(e,function(e,t){t||-1!=H(a,e.history)||(ho(e.history,r),a.push(e.history)),so(e,r,null,Hi(e,r))})},h=i.changes.length-1;h>=0;--h){var p=d(h);if(p)return p.v}}}}function lo(e,t){if(0!=t&&(e.first+=t,e.sel=new vi(X(e.sel.ranges,function(e){return new yi(me(e.anchor.line+t,e.anchor.ch),me(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Zr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Qr(e.cm,r,"gutter")}}function so(e,t,n,r){if(e.cm&&!e.cm.curOp)return qr(e.cm,so)(e,t,n,r);if(t.to.line<e.first)lo(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);lo(e,i),t={from:me(e.first,0),to:me(t.to.line+i,t.to.ch),text:[Y(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:me(o,le(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=se(e,t.from,t.to),n||(n=Si(e,t)),e.cm?function(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=fe(Be(le(r,o.line))),r.iter(s,a.line+1,function(e){if(e==i.maxLine)return l=!0,!0}));r.sel.contains(t.from,t.to)>-1&&ot(e);_i(r,t,n,ir(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,function(e){var t=Ke(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0));(function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=le(e,r).stateAfter;if(i&&(!(i instanceof It)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}})(r,o.line),ni(e,400);var u=t.text.length-(a.line-o.line)-1;t.full?Zr(e):o.line!=a.line||1!=t.text.length||Mi(e.doc,t)?Zr(e,o.line,a.line+1,u):Qr(e,o.line,"text");var c=at(e,"changes"),f=at(e,"change");if(f||c){var d={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};f&&ln(e,"change",e,d),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}(e.cm,t,r):_i(e,t,r),Yi(e,n,V)}}function uo(e,t,n,r,i){var o;r||(r=n),ge(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),io(e,{from:n,to:r,text:t,origin:i})}function co(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function fo(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var l=0;l<o.ranges.length;l++)co(o.ranges[l].anchor,t,n,r),co(o.ranges[l].head,t,n,r)}else{for(var s=0;s<o.changes.length;++s){var u=o.changes[s];if(n<u.from.line)u.from=me(u.from.line+r,u.from.ch),u.to=me(u.to.line+r,u.to.ch);else if(t<=u.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function ho(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;fo(e.done,n,r,i),fo(e.undone,n,r,i)}function po(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=le(e,we(e,t)):i=fe(t),null==i?null:(r(o,i)&&e.cm&&Qr(e.cm,i,n),o)}function mo(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function go(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}yi.prototype.from=function(){return xe(this.anchor,this.head)},yi.prototype.to=function(){return be(this.anchor,this.head)},yi.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},mo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,Gt(i),ln(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},go.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof mo))){var l=[];this.collapse(l),this.children=[new mo(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,l=a;l<i.lines.length;){var s=new mo(i.lines.slice(l,l+=25));i.height-=s.height,this.children.splice(++r,0,s),s.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new go(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=H(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new go(e.children);r.parent=e,e.children=[r,t],e=r}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var vo=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};function yo(e,t,n){Ge(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&kr(e,n)}vo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=fe(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=xn(this);ce(n,Math.max(0,n.height-o)),e&&(Kr(e,function(){yo(e,n,-o),Qr(e,r,"widget")}),ln(e,"lineWidgetCleared",e,this,r))}},vo.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=xn(this)-t;i&&(je(this.doc,r)||ce(r,r.height+i),n&&Kr(n,function(){n.curOp.forceUpdate=!0,yo(n,r,i),ln(n,"lineWidgetChanged",n,e,fe(r))}))},lt(vo);var bo=0,xo=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++bo};function wo(e,t,n,r,i){if(r&&r.shared)return function(e,t,n,r,i){(r=W(r)).shared=!1;var o=[wo(e,t,n,r,i)],a=o[0],l=r.widgetNode;return Oi(e,function(e){l&&(r.widgetNode=l.cloneNode(!0)),o.push(wo(e,Ce(e,t),Ce(e,n),r,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;a=Y(o)}),new Co(o,a)}(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return qr(e.cm,wo)(e,t,n,r,i);var o=new xo(e,i),a=ge(t,n);if(r&&W(r,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=N("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(He(e,t.line,t,n,o)||t.line!=n.line&&He(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Le=!0}o.addToHistory&&Pi(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l,s=t.line,u=e.cm;if(e.iter(s,n.line+1,function(e){u&&o.collapsed&&!u.options.lineWrapping&&Be(e)==u.display.maxLine&&(l=!0),o.collapsed&&s!=t.line&&ce(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new Te(o,s==t.line?t.ch:null,s==n.line?n.ch:null)),++s}),o.collapsed&&e.iter(t.line,n.line+1,function(t){je(e,t)&&ce(t,0)}),o.clearOnEnter&&et(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(ke=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++bo,o.atomic=!0),u){if(l&&(u.curOp.updateMaxLine=!0),o.collapsed)Zr(u,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=n.line;c++)Qr(u,c,"text");o.atomic&&Zi(u.doc),ln(u,"markerAdded",u,o)}return o}xo.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Hr(e),at(this,"clear")){var n=this.find();n&&ln(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],l=Me(a.markedSpans,this);e&&!this.collapsed?Qr(e,fe(a),"text"):e&&(null!=l.to&&(i=fe(a)),null!=l.from&&(r=fe(a))),a.markedSpans=_e(a.markedSpans,l),null==l.from&&this.collapsed&&!je(this.doc,a)&&e&&ce(a,er(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var u=Be(this.lines[s]),c=Ke(u);c>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Zr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Zi(e.doc)),e&&ln(e,"markerCleared",e,this,r,i),t&&Br(e),this.parent&&this.parent.clear()}},xo.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=Me(o.markedSpans,this);if(null!=a.from&&(n=me(t?o:fe(o),a.from),-1==e))return n;if(null!=a.to&&(r=me(t?o:fe(o),a.to),1==e))return r}return n&&{from:n,to:r}},xo.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&Kr(r,function(){var i=t.line,o=fe(t.line),a=Nn(r,o);if(a&&(Wn(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!je(n.doc,i)&&null!=n.height){var l=n.height;n.height=null;var s=xn(n)-l;s&&ce(i,i.height+s)}ln(r,"markerChanged",r,e)})},xo.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=H(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},xo.prototype.detachLine=function(e){if(this.lines.splice(H(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},lt(xo);var Co=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function So(e){return e.findMarks(me(e.first,0),e.clipPos(me(e.lastLine())),function(e){return e.parent})}function ko(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];Oi(n.primary.doc,function(e){return r.push(e)});for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==H(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}},n=0;n<e.length;n++)t(n)}Co.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ln(this,"clear")}},Co.prototype.find=function(e,t){return this.primary.find(e,t)},lt(Co);var Lo=0,To=function(e,t,n,r,i){if(!(this instanceof To))return new To(e,t,n,r,i);null==n&&(n=0),go.call(this,[new mo([new $t("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=me(n,0);this.sel=xi(o),this.history=new Ai(null),this.id=++Lo,this.modeOption=t,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),_i(this,{from:o,to:o,text:e}),qi(this,xi(o),V)};To.prototype=Q(go.prototype,{constructor:To,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=ue(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:Xr(function(e){var t=me(this.first,0),n=this.first+this.size-1;io(this,{from:t,to:me(n,le(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Tr(this.cm,0,0),qi(this,xi(t),V)}),replaceRange:function(e,t,n,r){uo(this,e,t=Ce(this,t),n=n?Ce(this,n):t,r)},getRange:function(e,t,n){var r=se(this,Ce(this,e),Ce(this,t));return!1===n?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(he(this,e))return le(this,e)},getLineNumber:function(e){return fe(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=le(this,e)),Be(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Ce(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Xr(function(e,t,n){Gi(this,Ce(this,"number"==typeof e?me(e,t||0):e),null,n)}),setSelection:Xr(function(e,t,n){Gi(this,Ce(this,e),Ce(this,t||e),n)}),extendSelection:Xr(function(e,t,n){Vi(this,Ce(this,e),t&&Ce(this,t),n)}),extendSelections:Xr(function(e,t){ji(this,Se(this,e),t)}),extendSelectionsBy:Xr(function(e,t){ji(this,Se(this,X(this.sel.ranges,e)),t)}),setSelections:Xr(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new yi(Ce(this,e[i].anchor),Ce(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),qi(this,bi(this.cm,r,t),n)}}),addSelection:Xr(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new yi(Ce(this,e),Ce(this,t||e))),qi(this,bi(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=se(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=se(this,n[r].from(),n[r].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:Xr(function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var l=t&&"end"!=t&&function(e,t,n){for(var r=[],i=me(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=ki(l.from,i,o),u=ki(wi(l),i,o);if(i=l.to,o=u,"around"==n){var c=e.sel.ranges[a],f=ge(c.head,c.anchor)<0;r[a]=new yi(f?u:s,f?s:u)}else r[a]=new yi(s,s)}return new vi(r,e.sel.primIndex)}(this,r,t),s=r.length-1;s>=0;s--)io(this,r[s]);l?Ki(this,l):this.cm&&Lr(this.cm)}),undo:Xr(function(){ao(this,"undo")}),redo:Xr(function(){ao(this,"redo")}),undoSelection:Xr(function(){ao(this,"undo",!0)}),redoSelection:Xr(function(){ao(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new Ai(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Bi(this.history.done),undone:Bi(this.history.undone)}},setHistory:function(e){var t=this.history=new Ai(this.history.maxGeneration);t.done=Bi(e.done.slice(0),null,!0),t.undone=Bi(e.undone.slice(0),null,!0)},setGutterMarker:Xr(function(e,t,n){return po(this,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&ne(r)&&(e.gutterMarkers=null),!0})}),clearGutter:Xr(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&po(t,n,"gutter",function(){return n.gutterMarkers[e]=null,ne(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!he(this,e))return null;if(t=e,!(e=le(this,e)))return null}else if(null==(t=fe(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Xr(function(e,t,n){return po(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(k(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0})}),removeLineClass:Xr(function(e,t,n){return po(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(k(n));if(!o)return!1;var a=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0})}),addLineWidget:Xr(function(e,t,n){return function(e,t,n,r){var i=new vo(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),po(e,t,"widget",function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!je(e,t)){var r=Ge(t)<e.scrollTop;ce(t,t.height+xn(i)),r&&kr(o,i.height),o.curOp.forceUpdate=!0}return!0}),o&&ln(o,"lineWidgetAdded",o,i,"number"==typeof t?t:fe(t)),i}(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return wo(this,Ce(this,e),Ce(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return wo(this,e=Ce(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=le(this,(e=Ce(this,e)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=Ce(this,e),t=Ce(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];null!=s.to&&i==e.line&&e.ch>=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||n&&!n(s.marker)||r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n}),Ce(this,me(n,t))},indexFromPos:function(e){var t=(e=Ce(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new To(ue(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new To(ue(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(ge(o,a)){var l=wo(e,o,a,r.primary,r.primary.type);r.markers.push(l),l.parent=r}}}(r,So(this)),r},unlinkDoc:function(e){if(e instanceof Sa&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),ko(So(this));break}}if(e.history==this.history){var n=[e.id];Oi(e,function(e){return n.push(e.id)},!0),e.history=new Ai(null),e.history.done=Bi(this.history.done,n),e.history.undone=Bi(this.history.undone,n)}},iterLinkedDocs:function(e){Oi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):bt(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Xr(function(e){"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&function(e){Kr(e,function(){Di(e),Zr(e)})}(this.cm))})}),To.prototype.eachLine=To.prototype.iter;var Mo=0;function _o(e){var t=this;if(Oo(t),!it(t,e)&&!wn(t.display,e)){st(e),a&&(Mo=+new Date);var n=ar(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),l=0,s=function(e,r){if(!t.options.allowDropFileTypes||-1!=H(t.options.allowDropFileTypes,e.type)){var a=new FileReader;a.onload=qr(t,function(){var e=a.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[r]=e,++l==i){var s={from:n=Ce(t.doc,n),to:n,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};io(t.doc,s),Ki(t.doc,xi(n,wi(s)))}}),a.readAsText(e)}},u=0;u<i;++u)s(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var c=e.dataTransfer.getData("Text");if(c){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),Yi(t.doc,xi(n,n)),f)for(var d=0;d<f.length;++d)uo(t.doc,"",f[d].anchor,f[d].head,"drag");t.replaceSelection(c,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Oo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function No(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var t=0;t<n.length;t++)e(n[t])})}}var Do=!1;function Ao(){Do||(!function(){var e;et(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,No(Io)},100))}),et(window,"blur",function(){return No(vr)})}(),Do=!0)}function Io(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Eo={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Po=0;Po<10;Po++)Eo[Po+48]=Eo[Po+96]=String(Po);for(var Fo=65;Fo<=90;Fo++)Eo[Fo]=String.fromCharCode(Fo);for(var Wo=1;Wo<=12;Wo++)Eo[Wo+111]=Eo[Wo+63235]="F"+Wo;var zo={};function Ro(e){var t,n,r,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var a=0;a<o.length-1;a++){var l=o[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else{if(!/^s(hift)?$/i.test(l))throw new Error("Unrecognized modifier name: "+l);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Ho(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=X(n.split(" "),Ro),o=0;o<i.length;o++){var a=void 0,l=void 0;o==i.length-1?(l=i.join(" "),a=r):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[n]}for(var u in t)e[u]=t[u];return e}function Bo(e,t,n,r){var i=(t=$o(t)).call?t.call(e,r):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Bo(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=Bo(e,t.fallthrough[o],n,r);if(a)return a}}}function Uo(e){var t="string"==typeof e?e:Eo[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Vo(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(C?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(C?t.ctrlKey:t.metaKey)&&"Cmd"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function jo(e,t){if(f&&34==e.keyCode&&e.char)return!1;var n=Eo[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),Vo(n,e,t))}function $o(e){return"string"==typeof e?zo[e]:e}function Go(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&ge(o.from,Y(r).to)<=0;){var a=r.pop();if(ge(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}Kr(e,function(){for(var t=r.length-1;t>=0;t--)uo(e.doc,"",r[t].from,r[t].to,"+delete");Lr(e)})}function Ko(e,t,n){var r=oe(e.text,t+n,n);return r<0||r>e.text.length?null:r}function qo(e,t,n){var r=Ko(e,t.ch,n);return null==r?null:new me(t.line,r,n<0?"after":"before")}function Yo(e,t,n,r,i){if(e){var o=Qe(n,t.doc.direction);if(o){var a,l=i<0?Y(o):o[0],s=i<0==(1==l.level)?"after":"before";if(l.level>0||"rtl"==t.doc.direction){var u=Dn(t,n);a=i<0?n.text.length-1:0;var c=An(t,u,a).top;a=ae(function(e){return An(t,u,e).top==c},i<0==(1==l.level)?l.from:l.to-1,a),"before"==s&&(a=Ko(n,a,1))}else a=i<0?l.to:l.from;return new me(r,a,s)}}return new me(r,i<0?n.text.length:0,i<0?"before":"after")}zo.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"},zo.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"},zo.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},zo.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"]},zo.default=y?zo.macDefault:zo.pcDefault;var Xo={selectAll:no,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),V)},killLine:function(e){return Go(e,function(t){if(t.empty()){var n=le(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:me(t.head.line+1,0)}:{from:t.head,to:me(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Go(e,function(t){return{from:me(t.from().line,0),to:Ce(e.doc,me(t.to().line+1,0))}})},delLineLeft:function(e){return Go(e,function(e){return{from:me(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return Go(e,function(t){var n=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:n},"div"),to:t.from()}})},delWrappedLineRight:function(e){return Go(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(me(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(me(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Zo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Qo(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return function(e,t){var n=le(e.doc,t),r=function(e){for(var t;t=ze(e);)e=t.find(1,!0).line;return e}(n);r!=n&&(t=fe(r));return Yo(!0,e,n,t,-1)}(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},$)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},$)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?Qo(e,t.head):r},$)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=z(e.getLine(o.line),o.ch,r);t.push(q(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Kr(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=le(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new me(i.line,i.ch-1)),i.ch>0)i=new me(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),me(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=le(e.doc,i.line-1).text;a&&(i=new me(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),me(i.line-1,a.length-1),i,"+transpose"))}n.push(new yi(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return Kr(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Lr(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Zo(e,t){var n=le(e.doc,t),r=Be(n);return r!=n&&(t=fe(r)),Yo(!0,e,r,t,1)}function Qo(e,t){var n=Zo(e,t.line),r=le(e.doc,n.line),i=Qe(r,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return me(n.line,a?0:o,n.sticky)}return n}function Jo(e,t,n){if("string"==typeof t&&!(t=Xo[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=U}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}var ea=new R;function ta(e,t,n,r){var i=e.state.keySeq;if(i){if(Uo(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:ea.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),na(e,i+" "+t,n,r))return!0}return na(e,t,n,r)}function na(e,t,n,r){var i=function(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Bo(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Bo(t,e.options.extraKeys,n,e)||Bo(t,e.options.keyMap,n,e)}(e,t,r);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&ln(e,"keyHandled",e,t,n),"handled"!=i&&"multi"!=i||(st(n),hr(e)),!!i}function ra(e,t){var n=jo(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?ta(e,"Shift-"+n,t,function(t){return Jo(e,t,!0)})||ta(e,n,t,function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return Jo(e,t)}):ta(e,n,t,function(t){return Jo(e,t)}))}var ia=null;function oa(e){var t=this;if(t.curOp.focus=A(),!it(t,e)){a&&l<11&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var r=ra(t,e);f&&(ia=r?n:null,!r&&88==n&&!wt&&(y?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(T(t,"CodeMirror-crosshair"),nt(document,"keyup",n),nt(document,"mouseover",n))}I(t,"CodeMirror-crosshair"),et(document,"keyup",n),et(document,"mouseover",n)}(t)}}function aa(e){16==e.keyCode&&(this.doc.sel.shift=!1),it(this,e)}function la(e){var t=this;if(!(wn(t.display,e)||it(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(f&&n==ia)return ia=null,void st(e);if(!f||e.which&&!(e.which<10)||!ra(t,e)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(function(e,t,n){return ta(e,"'"+n+"'",t,function(t){return Jo(e,t,!0)})}(t,e,i)||t.display.input.onKeyPress(e))}}}var sa,ua,ca=function(e,t,n){this.time=e,this.pos=t,this.button=n};function fa(e){var t=this,n=t.display;if(!(it(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,wn(n,e))s||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));else if(!pa(t,e)){var r=ar(t,e),i=ht(e),o=r?function(e,t){var n=+new Date;return ua&&ua.compare(n,e,t)?(sa=ua=null,"triple"):sa&&sa.compare(n,e,t)?(ua=new ca(n,e,t),sa=null,"double"):(sa=new ca(n,e,t),ua=null,"single")}(r,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),r&&function(e,t,n,r,i){var o="Click";"double"==r?o="Double"+o:"triple"==r&&(o="Triple"+o);return ta(e,Vo(o=(1==t?"Left":2==t?"Middle":"Right")+o,i),i,function(t){if("string"==typeof t&&(t=Xo[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=U}finally{e.state.suppressEdits=!1}return r})}(t,i,r,o,e)||(1==i?r?function(e,t,n,r){a?setTimeout(F(pr,e),0):e.curOp.focus=A();var i,o=function(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(null==i.unit){var o=b?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey);null==i.addNew&&(i.addNew=y?n.metaKey:n.ctrlKey);null==i.moveOnDrag&&(i.moveOnDrag=!(y?n.altKey:n.ctrlKey));return i}(e,n,r),u=e.doc.sel;e.options.dragDrop&&gt&&!e.isReadOnly()&&"single"==n&&(i=u.contains(t))>-1&&(ge((i=u.ranges[i]).from(),t)<0||t.xRel>0)&&(ge(i.to(),t)>0||t.xRel<0)?function(e,t,n,r){var i=e.display,o=!1,u=qr(e,function(t){s&&(i.scroller.draggable=!1),e.state.draggingText=!1,nt(i.wrapper.ownerDocument,"mouseup",u),nt(i.wrapper.ownerDocument,"mousemove",c),nt(i.scroller,"dragstart",f),nt(i.scroller,"drop",u),o||(st(t),r.addNew||Vi(e.doc,n,null,null,r.extend),s||a&&9==l?setTimeout(function(){i.wrapper.ownerDocument.body.focus(),i.input.focus()},20):i.input.focus())}),c=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},f=function(){return o=!0};s&&(i.scroller.draggable=!0);e.state.draggingText=u,u.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop();et(i.wrapper.ownerDocument,"mouseup",u),et(i.wrapper.ownerDocument,"mousemove",c),et(i.scroller,"dragstart",f),et(i.scroller,"drop",u),mr(e),setTimeout(function(){return i.input.focus()},20)}(e,r,t,o):function(e,t,n,r){var i=e.display,o=e.doc;st(t);var a,l,s=o.sel,u=s.ranges;r.addNew&&!r.extend?(l=o.sel.contains(n),a=l>-1?u[l]:new yi(n,n)):(a=o.sel.primary(),l=o.sel.primIndex);if("rectangle"==r.unit)r.addNew||(a=new yi(n,n)),n=ar(e,t,!0,!0),l=-1;else{var c=da(e,n,r.unit);a=r.extend?Ui(a,c.anchor,c.head,r.extend):c}r.addNew?-1==l?(l=u.length,qi(o,bi(e,u.concat([a]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&"char"==r.unit&&!r.extend?(qi(o,bi(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):$i(o,l,a,j):(l=0,qi(o,new vi([a],0),j),s=o.sel);var f=n;function d(t){if(0!=ge(f,t))if(f=t,"rectangle"==r.unit){for(var i=[],u=e.options.tabSize,c=z(le(o,n.line).text,n.ch,u),d=z(le(o,t.line).text,t.ch,u),h=Math.min(c,d),p=Math.max(c,d),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var v=le(o,m).text,y=G(v,h,u);h==p?i.push(new yi(me(m,y),me(m,y))):v.length>y&&i.push(new yi(me(m,y),me(m,G(v,p,u))))}i.length||i.push(new yi(n,n)),qi(o,bi(e,s.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,x=a,w=da(e,t,r.unit),C=x.anchor;ge(w.anchor,C)>0?(b=w.head,C=xe(x.from(),w.anchor)):(b=w.anchor,C=be(x.to(),w.head));var S=s.ranges.slice(0);S[l]=function(e,t){var n=t.anchor,r=t.head,i=le(e.doc,n.line);if(0==ge(n,r)&&n.sticky==r.sticky)return t;var o=Qe(i);if(!o)return t;var a=Xe(o,n.ch,n.sticky),l=o[a];if(l.from!=n.ch&&l.to!=n.ch)return t;var s,u=a+(l.from==n.ch==(1!=l.level)?0:1);if(0==u||u==o.length)return t;if(r.line!=n.line)s=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=Xe(o,r.ch,r.sticky),f=c-a||(r.ch-n.ch)*(1==l.level?-1:1);s=c==u-1||c==u?f<0:f>0}var d=o[u+(s?-1:0)],h=s==(1==d.level),p=h?d.from:d.to,m=h?"after":"before";return n.ch==p&&n.sticky==m?t:new yi(new me(n.line,p,m),r)}(e,new yi(Ce(o,C),b)),qi(o,bi(e,S,l),j)}}var h=i.wrapper.getBoundingClientRect(),p=0;function m(t){e.state.selectingText=!1,p=1/0,st(t),i.input.focus(),nt(i.wrapper.ownerDocument,"mousemove",g),nt(i.wrapper.ownerDocument,"mouseup",v),o.history.lastSelOrigin=null}var g=qr(e,function(t){0!==t.buttons&&ht(t)?function t(n){var a=++p;var l=ar(e,n,!0,"rectangle"==r.unit);if(!l)return;if(0!=ge(l,f)){e.curOp.focus=A(),d(l);var s=xr(i,o);(l.line>=s.to||l.line<s.from)&&setTimeout(qr(e,function(){p==a&&t(n)}),150)}else{var u=n.clientY<h.top?-20:n.clientY>h.bottom?20:0;u&&setTimeout(qr(e,function(){p==a&&(i.scroller.scrollTop+=u,t(n))}),50)}}(t):m(t)}),v=qr(e,m);e.state.selectingText=v,et(i.wrapper.ownerDocument,"mousemove",g),et(i.wrapper.ownerDocument,"mouseup",v)}(e,r,t,o)}(t,r,o,e):dt(e)==n.scroller&&st(e):2==i?(r&&Vi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):3==i&&(S?t.display.input.onContextMenu(e):mr(t)))}}function da(e,t,n){if("char"==n)return new yi(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new yi(me(t.line,0),Ce(e.doc,me(t.line+1,0)));var r=n(e,t);return new yi(r.from,r.to)}function ha(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&st(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!at(e,n))return ct(t);o-=l.top-a.viewOffset;for(var s=0;s<e.options.gutters.length;++s){var u=a.gutters.childNodes[s];if(u&&u.getBoundingClientRect().right>=i)return rt(e,n,e,de(e.doc,o),e.options.gutters[s],t),ct(t)}}function pa(e,t){return ha(e,t,"gutterClick",!0)}function ma(e,t){wn(e.display,t)||function(e,t){if(!at(e,"gutterContextMenu"))return!1;return ha(e,t,"gutterContextMenu",!1)}(e,t)||it(e,t,"contextmenu")||S||e.display.input.onContextMenu(t)}function ga(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Rn(e)}ca.prototype.compare=function(e,t,n){return this.time+400>e&&0==ge(t,this.pos)&&n==this.button};var va={toString:function(){return"CodeMirror.Init"}},ya={},ba={};function xa(e){ci(e),Zr(e),wr(e)}function wa(e,t,n){if(!t!=!(n&&n!=va)){var r=e.display.dragFunctions,i=t?et:nt;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Ca(e){e.options.lineWrapping?(I(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(T(e.display.wrapper,"CodeMirror-wrap"),qe(e)),or(e),Zr(e),Rn(e),setTimeout(function(){return Pr(e)},100)}function Sa(e,t){var r=this;if(!(this instanceof Sa))return new Sa(e,t);this.options=t=t?W(t):{},W(ya,t,!1),fi(t);var i=t.value;"string"==typeof i?i=new To(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var o=new Sa.inputStyles[t.inputStyle](this),u=this.display=new function(e,t,r){var i=this;this.input=r,i.scrollbarFiller=O("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=O("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=N("div",null,"CodeMirror-code"),i.selectionDiv=O("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=O("div",null,"CodeMirror-cursors"),i.measure=O("div",null,"CodeMirror-measure"),i.lineMeasure=O("div",null,"CodeMirror-measure"),i.lineSpace=N("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=N("div",[i.lineSpace],"CodeMirror-lines");i.mover=O("div",[o],null,"position: relative"),i.sizer=O("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=O("div",null,null,"position: absolute; height: "+B+"px; width: 1px;"),i.gutters=O("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=O("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=O("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),a&&l<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),s||n&&v||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,r.init(i)}(e,i,o);for(var c in u.wrapper.CodeMirror=this,ci(this),ga(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),zr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new R,keySeq:null,specialChars:null},t.autofocus&&!v&&u.input.focus(),a&&l<11&&setTimeout(function(){return r.display.input.reset(!0)},20),function(e){var t=e.display;et(t.scroller,"mousedown",qr(e,fa)),et(t.scroller,"dblclick",a&&l<11?qr(e,function(t){if(!it(e,t)){var n=ar(e,t);if(n&&!pa(e,t)&&!wn(e.display,t)){st(t);var r=e.findWordAt(n);Vi(e.doc,r.anchor,r.head)}}}):function(t){return it(e,t)||st(t)});et(t.scroller,"contextmenu",function(t){return ma(e,t)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),(r=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}et(t.scroller,"touchstart",function(i){if(!it(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)&&!pa(e,i)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}}),et(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),et(t.scroller,"touchend",function(n){var r=t.activeTouch;if(r&&!wn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var a,l=e.coordsChar(t.activeTouch,"page");a=!r.prev||o(r,r.prev)?new yi(l,l):!r.prev.prev||o(r,r.prev.prev)?e.findWordAt(l):new yi(me(l.line,0),Ce(e.doc,me(l.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),st(n)}i()}),et(t.scroller,"touchcancel",i),et(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Or(e,t.scroller.scrollTop),Dr(e,t.scroller.scrollLeft,!0),rt(e,"scroll",e))}),et(t.scroller,"mousewheel",function(t){return gi(e,t)}),et(t.scroller,"DOMMouseScroll",function(t){return gi(e,t)}),et(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){it(e,t)||ft(t)},over:function(t){it(e,t)||(!function(e,t){var n=ar(e,t);if(n){var r=document.createDocumentFragment();cr(e,n,r),e.display.dragCursor||(e.display.dragCursor=O("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),_(e.display.dragCursor,r)}}(e,t),ft(t))},start:function(t){return function(e,t){if(a&&(!e.state.draggingText||+new Date-Mo<100))ft(t);else if(!it(e,t)&&!wn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d)){var n=O("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),f&&n.parentNode.removeChild(n)}}(e,t)},drop:qr(e,_o),leave:function(t){it(e,t)||Oo(e)}};var s=t.input.getField();et(s,"keyup",function(t){return aa.call(e,t)}),et(s,"keydown",qr(e,oa)),et(s,"keypress",qr(e,la)),et(s,"focus",function(t){return gr(e,t)}),et(s,"blur",function(t){return vr(e,t)})}(this),Ao(),Hr(this),this.curOp.forceUpdate=!0,Ni(this,i),t.autofocus&&!v||this.hasFocus()?setTimeout(F(gr,this),20):vr(this),ba)ba.hasOwnProperty(c)&&ba[c](r,t[c],va);Cr(this),t.finishInit&&t.finishInit(this);for(var h=0;h<ka.length;++h)ka[h](r);Br(this),s&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(u.lineDiv).textRendering&&(u.lineDiv.style.textRendering="auto")}Sa.defaults=ya,Sa.optionHandlers=ba;var ka=[];function La(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=Wt(e,t).state:n="prev");var a=e.options.tabSize,l=le(o,t),s=z(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var u,c=l.text.match(/^\s*/)[0];if(r||/\S/.test(l.text)){if("smart"==n&&((u=o.mode.indent(i,l.text.slice(c.length),l.text))==U||u>150)){if(!r)return;n="prev"}}else u=0,n="not";"prev"==n?u=t>o.first?z(le(o,t-1).text,null,a):0:"add"==n?u=s+e.options.indentUnit:"subtract"==n?u=s-e.options.indentUnit:"number"==typeof n&&(u=s+n),u=Math.max(0,u);var f="",d=0;if(e.options.indentWithTabs)for(var h=Math.floor(u/a);h;--h)d+=a,f+="\t";if(d<u&&(f+=q(u-d)),f!=c)return uo(o,f,me(t,0),me(t,c.length),"+input"),l.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var m=o.sel.ranges[p];if(m.head.line==t&&m.head.ch<c.length){var g=me(t,c.length);$i(o,p,new yi(g,g));break}}}Sa.defineInitHook=function(e){return ka.push(e)};var Ta=null;function Ma(e){Ta=e}function _a(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a,l=e.state.pasteIncoming||"paste"==i,s=bt(t),u=null;if(l&&r.ranges.length>1)if(Ta&&Ta.text.join("\n")==t){if(r.ranges.length%Ta.text.length==0){u=[];for(var c=0;c<Ta.text.length;c++)u.push(o.splitLines(Ta.text[c]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=X(s,function(e){return[e]}));for(var f=r.ranges.length-1;f>=0;f--){var d=r.ranges[f],h=d.from(),p=d.to();d.empty()&&(n&&n>0?h=me(h.line,h.ch-n):e.state.overwrite&&!l?p=me(p.line,Math.min(le(o,p.line).text.length,p.ch+Y(s).length)):l&&Ta&&Ta.lineWise&&Ta.text.join("\n")==t&&(h=p=me(h.line,0))),a=e.curOp.updateInput;var m={from:h,to:p,text:u?u[f%u.length]:s,origin:i||(l?"paste":e.state.cutIncoming?"cut":"+input")};io(e.doc,m),ln(e,"inputRead",e,m)}t&&!l&&Na(e,t),Lr(e),e.curOp.updateInput=a,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Oa(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Kr(t,function(){return _a(t,n,0,null,"paste")}),!0}function Na(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=La(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(le(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=La(e,i.head.line,"smart"));a&&ln(e,"electricInput",e,i.head.line)}}}function Da(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:me(i,0),head:me(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function Aa(e,t){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck",!!t)}function Ia(){var e=O("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=O("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return s?e.style.width="1000px":e.setAttribute("wrap","off"),m&&(e.style.border="1px solid black"),Aa(e),t}function Ea(e,t,n,r,i){var o=t,a=n,l=le(e,t.line);function s(r){var o;if(null==(o=i?function(e,t,n,r){var i=Qe(t,e.doc.direction);if(!i)return qo(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=Xe(i,n.ch,n.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return qo(t,n,r);var l,s=function(e,n){return Ko(t,e instanceof me?e.ch:e,n)},u=function(n){return e.options.lineWrapping?(l=l||Dn(e,t),Zn(e,t,l,n)):{begin:0,end:t.text.length}},c=u("before"==n.sticky?s(n,-1):n.ch);if("rtl"==e.doc.direction||1==a.level){var f=1==a.level==r<0,d=s(n,f?1:-1);if(null!=d&&(f?d<=a.to&&d<=c.end:d>=a.from&&d>=c.begin)){var h=f?"before":"after";return new me(n.line,d,h)}}var p=function(e,t,r){for(var o=function(e,t){return t?new me(n.line,s(e,1),"before"):new me(n.line,e,"after")};e>=0&&e<i.length;e+=t){var a=i[e],l=t>0==(1!=a.level),u=l?r.begin:s(r.end,-1);if(a.from<=u&&u<a.to)return o(u,l);if(u=l?a.from:s(a.to,-1),r.begin<=u&&u<r.end)return o(u,l)}},m=p(o+r,r,c);if(m)return m;var g=r>0?c.end:s(c.begin,-1);return null==g||r>0&&g==t.text.length||!(m=p(r>0?0:i.length-1,r,u(g)))?null:m}(e.cm,l,t,n):qo(l,t,n))){if(r||!function(){var r=t.line+n;return!(r<e.first||r>=e.first+e.size)&&(t=new me(r,t.ch,t.sticky),l=le(e,r))}())return!1;t=Yo(i,e.cm,l,t.line,n)}else t=o;return!0}if("char"==r)s();else if("column"==r)s(!0);else if("word"==r||"group"==r)for(var u=null,c="group"==r,f=e.cm&&e.cm.getHelper(t,"wordChars"),d=!0;!(n<0)||s(!d);d=!1){var h=l.text.charAt(t.ch)||"\n",p=te(h,f)?"w":c&&"\n"==h?"n":!c||/\s/.test(h)?null:"p";if(!c||d||p||(p="s"),u&&u!=p){n<0&&(n=1,s(),t.sticky="after");break}if(p&&(u=p),n>0&&!s(!d))break}var m=eo(e,t,o,a,!0);return ve(o,m)&&(m.hitSide=!0),m}function Pa(e,t,n,r){var i,o,a=e.doc,l=t.left;if("page"==r){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(s-.5*er(e.display),3);i=(n>0?t.bottom:t.top)+n*u}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=Yn(e,l,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Fa=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new R,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Wa(e,t){var n=Nn(e,t.line);if(!n||n.hidden)return null;var r=le(e.doc,t.line),i=_n(n,r,t.line),o=Qe(r,e.doc.direction),a="left";o&&(a=Xe(o,t.ch)%2?"right":"left");var l=Pn(i.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function za(e,t){return t&&(e.bad=!0),e}function Ra(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return za(e.clipPos(me(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return Ha(o,t,n)}}function Ha(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!D(r,t))return za(me(fe(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?Y(e.rest):e.line;return za(me(fe(o),o.text.length),i)}var a=3==t.nodeType?t:null,l=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,n&&(n=a.nodeValue.length));l.parentNode!=r;)l=l.parentNode;var s=e.measure,u=s.maps;function c(t,n,r){for(var i=-1;i<(u?u.length:0);i++)for(var o=i<0?s.map:u[i],a=0;a<o.length;a+=3){var l=o[a+2];if(l==t||l==n){var c=fe(i<0?e.line:e.rest[i]),f=o[a]+r;return(r<0||l!=t)&&(f=o[a+(r?1:0)]),me(c,f)}}}var f=c(a,l,n);if(f)return za(f,i);for(var d=l.nextSibling,h=a?a.nodeValue.length-n:0;d;d=d.nextSibling){if(f=c(d,d.firstChild,0))return za(me(f.line,f.ch-h),i);h+=d.textContent.length}for(var p=l.previousSibling,m=n;p;p=p.previousSibling){if(f=c(p,p.firstChild,-1))return za(me(f.line,f.ch+m),i);m+=p.textContent.length}}Fa.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;function o(e){if(!it(r,e)){if(r.somethingSelected())Ma({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=Da(r);Ma({lineWise:!0,text:t.text}),"cut"==e.type&&r.operation(function(){r.setSelections(t.ranges,0,V),r.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var o=Ta.text.join("\n");if(e.clipboardData.setData("Text",o),e.clipboardData.getData("Text")==o)return void e.preventDefault()}var a=Ia(),l=a.firstChild;r.display.lineSpace.insertBefore(a,r.display.lineSpace.firstChild),l.value=Ta.text.join("\n");var s=document.activeElement;P(l),setTimeout(function(){r.display.lineSpace.removeChild(a),s.focus(),s==i&&n.showPrimarySelection()},50)}}Aa(i,r.options.spellcheck),et(i,"paste",function(e){it(r,e)||Oa(e,r)||l<=11&&setTimeout(qr(r,function(){return t.updateFromDOM()}),20)}),et(i,"compositionstart",function(e){t.composing={data:e.data,done:!1}}),et(i,"compositionupdate",function(e){t.composing||(t.composing={data:e.data,done:!1})}),et(i,"compositionend",function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),et(i,"touchstart",function(){return n.forceCompositionEnd()}),et(i,"input",function(){t.composing||t.readFromDOMSoon()}),et(i,"copy",o),et(i,"cut",o)},Fa.prototype.prepareSelection=function(){var e=ur(this.cm,!1);return e.focus=this.cm.state.focused,e},Fa.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Fa.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Fa.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),o=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var a=Ra(t,e.anchorNode,e.anchorOffset),l=Ra(t,e.focusNode,e.focusOffset);if(!a||a.bad||!l||l.bad||0!=ge(xe(a,l),i)||0!=ge(be(a,l),o)){var s=t.display.view,u=i.line>=t.display.viewFrom&&Wa(t,i)||{node:s[0].measure.map[2],offset:0},c=o.line<t.display.viewTo&&Wa(t,o);if(!c){var f=s[s.length-1].measure,d=f.maps?f.maps[f.maps.length-1]:f.map;c={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(u&&c){var h,p=e.rangeCount&&e.getRangeAt(0);try{h=L(u.node,u.offset,c.offset,c.node)}catch(e){}h&&(!n&&t.state.focused?(e.collapse(u.node,u.offset),h.collapsed||(e.removeAllRanges(),e.addRange(h))):(e.removeAllRanges(),e.addRange(h)),p&&null==e.anchorNode?e.addRange(p):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Fa.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Fa.prototype.showMultipleSelections=function(e){_(this.cm.display.cursorDiv,e.cursors),_(this.cm.display.selectionDiv,e.selection)},Fa.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Fa.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return D(this.div,t)},Fa.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Fa.prototype.blur=function(){this.div.blur()},Fa.prototype.getField=function(){return this.div},Fa.prototype.supportsTouch=function(){return!0},Fa.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Kr(this.cm,function(){return e.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))})},Fa.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Fa.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(g&&c&&this.cm.options.gutters.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=Ra(t,e.anchorNode,e.anchorOffset),r=Ra(t,e.focusNode,e.focusOffset);n&&r&&Kr(t,function(){qi(t.doc,xi(n,r),V),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},Fa.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,r=this.cm,i=r.display,o=r.doc.sel.primary(),a=o.from(),l=o.to();if(0==a.ch&&a.line>r.firstLine()&&(a=me(a.line-1,le(r.doc,a.line-1).length)),l.ch==le(r.doc,l.line).text.length&&l.line<r.lastLine()&&(l=me(l.line+1,0)),a.line<i.viewFrom||l.line>i.viewTo-1)return!1;a.line==i.viewFrom||0==(e=lr(r,a.line))?(t=fe(i.view[0].line),n=i.view[0].node):(t=fe(i.view[e].line),n=i.view[e-1].node.nextSibling);var s,u,c=lr(r,l.line);if(c==i.view.length-1?(s=i.viewTo-1,u=i.lineDiv.lastChild):(s=fe(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!n)return!1;for(var f=r.doc.splitLines(function(e,t,n,r,i){var o="",a=!1,l=e.doc.lineSeparator(),s=!1;function u(){a&&(o+=l,s&&(o+=l),a=s=!1)}function c(e){e&&(u(),o+=e)}function f(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void c(n);var o,d=t.getAttribute("cm-marker");if(d){var h=e.findMarks(me(r,0),me(i+1,0),function(e){return function(t){return t.id==e}}(+d));return void(h.length&&(o=h[0].find(0))&&c(se(e.doc,o.from,o.to).join(l)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;p&&u();for(var m=0;m<t.childNodes.length;m++)f(t.childNodes[m]);/^(pre|p)$/i.test(t.nodeName)&&(s=!0),p&&(a=!0)}else 3==t.nodeType&&c(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;f(t),t!=n;)t=t.nextSibling,s=!1;return o}(r,n,u,t,s)),d=se(r.doc,me(t,0),me(s,le(r.doc,s).text.length));f.length>1&&d.length>1;)if(Y(f)==Y(d))f.pop(),d.pop(),s--;else{if(f[0]!=d[0])break;f.shift(),d.shift(),t++}for(var h=0,p=0,m=f[0],g=d[0],v=Math.min(m.length,g.length);h<v&&m.charCodeAt(h)==g.charCodeAt(h);)++h;for(var y=Y(f),b=Y(d),x=Math.min(y.length-(1==f.length?h:0),b.length-(1==d.length?h:0));p<x&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==f.length&&1==d.length&&t==a.line)for(;h&&h>a.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)h--,p++;f[f.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),f[0]=f[0].slice(h).replace(/\u200b+$/,"");var w=me(t,h),C=me(s,d.length?Y(d).length-p:0);return f.length>1||f[0]||ge(w,C)?(uo(r.doc,f,w,C,"+input"),!0):void 0},Fa.prototype.ensurePolled=function(){this.forceCompositionEnd()},Fa.prototype.reset=function(){this.forceCompositionEnd()},Fa.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Fa.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()},80))},Fa.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Kr(this.cm,function(){return Zr(e.cm)})},Fa.prototype.setUneditable=function(e){e.contentEditable="false"},Fa.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||qr(this.cm,_a)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Fa.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Fa.prototype.onContextMenu=function(){},Fa.prototype.resetPosition=function(){},Fa.prototype.needsContentAttribute=!0;var Ba=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new R,this.hasSelection=!1,this.composing=null};Ba.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!it(r,e)){if(r.somethingSelected())Ma({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Da(r);Ma({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,V):(n.prevInput="",i.value=t.text.join("\n"),P(i))}"cut"==e.type&&(r.state.cutIncoming=!0)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(i.style.width="0px"),et(i,"input",function(){a&&l>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),et(i,"paste",function(e){it(r,e)||Oa(e,r)||(r.state.pasteIncoming=!0,n.fastPoll())}),et(i,"cut",o),et(i,"copy",o),et(e.scroller,"paste",function(t){wn(e,t)||it(r,t)||(r.state.pasteIncoming=!0,n.focus())}),et(e.lineSpace,"selectstart",function(t){wn(e,t)||st(t)}),et(i,"compositionstart",function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}}),et(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Ba.prototype.createField=function(e){this.wrapper=Ia(),this.textarea=this.wrapper.firstChild},Ba.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=ur(e);if(e.options.moveInputWithCursor){var i=Gn(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},Ba.prototype.showSelection=function(e){var t=this.cm.display;_(t.cursorDiv,e.cursors),_(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ba.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&P(this.textarea),a&&l>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&l>=9&&(this.hasSelection=null))}},Ba.prototype.getField=function(){return this.textarea},Ba.prototype.supportsTouch=function(){return!1},Ba.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||A()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ba.prototype.blur=function(){this.textarea.blur()},Ba.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ba.prototype.receivedFocus=function(){this.slowPoll()},Ba.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ba.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))})},Ba.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||xt(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(a&&l>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var s=0,u=Math.min(r.length,i.length);s<u&&r.charCodeAt(s)==i.charCodeAt(s);)++s;return Kr(t,function(){_a(t,i.slice(s),r.length-s,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ba.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ba.prototype.onKeyPress=function(){a&&l>=9&&(this.hasSelection=null),this.fastPoll()},Ba.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea,o=ar(n,e),u=r.scroller.scrollTop;if(o&&!f){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&qr(n,qi)(n.doc,xi(o),V);var c=i.style.cssText,d=t.wrapper.style.cssText;t.wrapper.style.cssText="position: absolute";var h,p=t.wrapper.getBoundingClientRect();if(i.style.cssText="position: absolute; width: 30px; height: 30px;\n      top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n      z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",s&&(h=window.scrollY),r.input.focus(),s&&window.scrollTo(null,h),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=!0,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&l>=9&&g(),S){ft(e);var m=function(){nt(window,"mouseup",m),setTimeout(v,20)};et(window,"mouseup",m)}else setTimeout(v,50)}function g(){if(null!=i.selectionStart){var e=n.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending=!1,t.wrapper.style.cssText=d,i.style.cssText=c,a&&l<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=u),null!=i.selectionStart){(!a||a&&l<9)&&g();var e=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?qr(n,no)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},Ba.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},Ba.prototype.setUneditable=function(){},Ba.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=va&&i(e,t,n)}:i)}e.defineOption=n,e.Init=va,n("value","",function(e,t){return e.setValue(t)},!0),n("mode",null,function(e,t){e.doc.modeOption=t,Li(e)},!0),n("indentUnit",2,Li,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(e){Ti(e),Rn(e),Zr(e)},!0),n("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(me(r,o))}r++});for(var i=n.length-1;i>=0;i--)uo(e.doc,t,n[i],me(n[i].line,n[i].ch+t.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=va&&e.refresh()}),n("specialCharPlaceholder",Zt,function(e){return e.refresh()},!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",function(e){ga(e),xa(e)},!0),n("keyMap","default",function(e,t,n){var r=$o(t),i=n!=va&&$o(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ca,!0),n("gutters",[],function(e){fi(e.options),xa(e)},!0),n("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?rr(e.display)+"px":"0",e.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(e){return Pr(e)},!0),n("scrollbarStyle","native",function(e){zr(e),Pr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),n("lineNumbers",!1,function(e){fi(e.options),xa(e)},!0),n("firstLineNumber",1,xa,!0),n("lineNumberFormatter",function(e){return e},xa,!0),n("showCursorWhenSelecting",!1,sr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(e,t){"nocursor"==t&&(vr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),n("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),n("dragDrop",!0,wa),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,sr,!0),n("singleCursorHeightPerLine",!0,sr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Ti,!0),n("addModeClass",!1,Ti,!0),n("pollInterval",100),n("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),n("historyEventDelay",1250),n("viewportMargin",10,function(e){return e.refresh()},!0),n("maxHighlightLength",1e4,Ti,!0),n("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),n("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),n("autofocus",null),n("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0),n("phrases",null)}(Sa),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&qr(this,t[e])(this,n,i),rt(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"]($o(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:Yr(function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");!function(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},function(e){return e.priority}),this.state.modeGen++,Zr(this)}),removeOverlay:Yr(function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void Zr(this)}}),indentLine:Yr(function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),he(this.doc,e)&&La(this,e,t,n)}),indentSelection:Yr(function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(La(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Lr(this));else{var o=i.from(),a=i.to(),l=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var s=l;s<n;++s)La(this,s,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[r].from().ch>0&&$i(this.doc,r,new yi(o,u[r].to()),V)}}}),getTokenAt:function(e,t){return Ut(this,e,t)},getLineTokens:function(e,t){return Ut(this,me(e),t,!0)},getTokenTypeAt:function(e){e=Ce(this.doc,e);var t,n=Ft(this,le(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){t=n[2*a+2];break}r=a+1}}var l=t?t.indexOf("overlay "):-1;return l<0?t:0==l?null:t.slice(0,l-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var i=n[t],o=this.getModeAt(e);if("string"==typeof o[t])i[o[t]]&&r.push(i[o[t]]);else if(o[t])for(var a=0;a<o[t].length;a++){var l=i[o[t][a]];l&&r.push(l)}else o.helperType&&i[o.helperType]?r.push(i[o.helperType]):i[o.name]&&r.push(i[o.name]);for(var s=0;s<i._global.length;s++){var u=i._global[s];u.pred(o,this)&&-1==H(r,u.val)&&r.push(u.val)}return r},getStateAfter:function(e,t){var n=this.doc;return Wt(this,(e=we(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return Gn(this,null==e?n.head:"object"==typeof e?Ce(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return $n(this,Ce(this.doc,e),t||"page")},coordsChar:function(e,t){return Yn(this,(e=jn(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=jn(this,{top:e,left:0},t||"page").top,de(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),r=le(this.doc,e)}else r=e;return Vn(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-Ge(r):0)},defaultTextHeight:function(){return er(this.display)},defaultCharWidth:function(){return tr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display,a=(e=Gn(this,Ce(this.doc,e))).bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var s=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>u&&(l=u-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),n&&function(e,t){var n=Sr(e,t);null!=n.scrollTop&&Or(e,n.scrollTop),null!=n.scrollLeft&&Dr(e,n.scrollLeft)}(this,{left:l,top:a,right:l+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:Yr(oa),triggerOnKeyPress:Yr(la),triggerOnKeyUp:aa,triggerOnMouseDown:Yr(fa),execCommand:function(e){if(Xo.hasOwnProperty(e))return Xo[e].call(null,this)},triggerElectric:Yr(function(e){Na(this,e)}),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=Ce(this.doc,e),a=0;a<t&&!(o=Ea(this.doc,o,i,n,r)).hitSide;++a);return o},moveH:Yr(function(e,t){var n=this;this.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?Ea(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()},$)}),deleteH:Yr(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Go(this,function(n){var i=Ea(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(e,t,n,r){var i=1,o=r;t<0&&(i=-1,t=-t);for(var a=Ce(this.doc,e),l=0;l<t;++l){var s=Gn(this,a,"div");if(null==o?o=s.left:s.left=o,(a=Pa(this,s,i,n)).hitSide)break}return a},moveV:Yr(function(e,t){var n=this,r=this.doc,i=[],o=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy(function(a){if(o)return e<0?a.from():a.to();var l=Gn(n,a.head,"div");null!=a.goalColumn&&(l.left=a.goalColumn),i.push(l.left);var s=Pa(n,l,e,t);return"page"==t&&a==r.sel.primary()&&kr(n,$n(n,s,"div").top-l.top),s},$),i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]}),findWordAt:function(e){var t=le(this.doc,e.line).text,n=e.ch,r=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&r!=t.length||!n?++r:--n;for(var o=t.charAt(n),a=te(o,i)?function(e){return te(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!te(e)};n>0&&a(t.charAt(n-1));)--n;for(;r<t.length&&a(t.charAt(r));)++r}return new yi(me(e.line,n),me(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?I(this.display.cursorDiv,"CodeMirror-overwrite"):T(this.display.cursorDiv,"CodeMirror-overwrite"),rt(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==A()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Yr(function(e,t){Tr(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Ln(this)-this.display.barHeight,width:e.scrollWidth-Ln(this)-this.display.barWidth,clientHeight:Mn(this),clientWidth:Tn(this)}},scrollIntoView:Yr(function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:me(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?function(e,t){Mr(e),e.curOp.scrollToPos=t}(this,e):_r(this,e.from,e.to,e.margin)}),setSize:Yr(function(e,t){var n=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&zn(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Qr(n,i,"widget");break}++i}),this.curOp.forceUpdate=!0,rt(this,"refresh",this)}),operation:function(e){return Kr(this,e)},startOperation:function(){return Hr(this)},endOperation:function(){return Br(this)},refresh:Yr(function(){var e=this.display.cachedTextHeight;Zr(this),this.curOp.forceUpdate=!0,Rn(this),Tr(this,this.doc.scrollLeft,this.doc.scrollTop),si(this),(null==e||Math.abs(e-er(this.display))>.5)&&or(this),rt(this,"refresh",this)}),swapDoc:Yr(function(e){var t=this.doc;return t.cm=null,Ni(this,e),Rn(this),this.display.input.reset(),Tr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,ln(this,"swapDoc",this,t),t}),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},lt(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}(Sa);var Ua="iter insert remove copy getEditor constructor".split(" ");for(var Va in To.prototype)To.prototype.hasOwnProperty(Va)&&H(Ua,Va)<0&&(Sa.prototype[Va]=function(e){return function(){return e.apply(this.doc,arguments)}}(To.prototype[Va]));return lt(To),Sa.inputStyles={textarea:Ba,contenteditable:Fa},Sa.defineMode=function(e){Sa.defaults.mode||"null"==e||(Sa.defaults.mode=e),function(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),St[e]=t}.apply(this,arguments)},Sa.defineMIME=function(e,t){kt[e]=t},Sa.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Sa.defineMIME("text/plain","null"),Sa.defineExtension=function(e,t){Sa.prototype[e]=t},Sa.defineDocExtension=function(e,t){To.prototype[e]=t},Sa.fromTextArea=function(e,t){if((t=t?W(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=A();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=l.getValue()}var i;if(e.form&&(et(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(t){t.save=r,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,r(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(nt(e.form,"submit",r),"function"==typeof e.form.submit&&(e.form.submit=i))}},e.style.display="none";var l=Sa(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return l},function(e){e.off=nt,e.on=et,e.wheelEventPixels=mi,e.Doc=To,e.splitLines=bt,e.countColumn=z,e.findColumn=G,e.isWordChar=ee,e.Pass=U,e.signal=rt,e.Line=$t,e.changeEnd=wi,e.scrollbarModel=Wr,e.Pos=me,e.cmpPos=ge,e.modes=St,e.mimeModes=kt,e.resolveMode=Lt,e.getMode=Tt,e.modeExtensions=Mt,e.extendMode=_t,e.copyState=Ot,e.startState=Dt,e.innerMode=Nt,e.commands=Xo,e.keyMap=zo,e.keyName=jo,e.isModifierKey=Uo,e.lookupKey=Bo,e.normalizeKeyMap=Ho,e.StringStream=At,e.SharedTextMarker=Co,e.TextMarker=xo,e.LineWidget=vo,e.e_preventDefault=st,e.e_stopPropagation=ut,e.e_stop=ft,e.addClass=I,e.contains=D,e.rmClass=T,e.keyNames=Eo}(Sa),Sa.version="5.42.0",Sa})},BwfY:function(e,t,n){n("fWfb"),n("M6a0"),n("OYls"),n("QWe/"),e.exports=n("FeBl").Symbol},KVNC:function(e,t){},Kh4W:function(e,t,n){t.f=n("dSzd")},Kk9m:function(e,t,n){!function(e){e(n("8U58"),n("THjC"))}(function(e){"use strict";e.defineOption("foldGutter",!1,function(t,n,r){r&&r!=e.Init&&(t.clearGutter(t.state.foldGutter.options.gutter),t.state.foldGutter=null,t.off("gutterClick",a),t.off("change",l),t.off("viewportChange",s),t.off("fold",u),t.off("unfold",u),t.off("swapDoc",l)),n&&(t.state.foldGutter=new function(e){this.options=e,this.from=this.to=0}(function(e){!0===e&&(e={});null==e.gutter&&(e.gutter="CodeMirror-foldgutter");null==e.indicatorOpen&&(e.indicatorOpen="CodeMirror-foldgutter-open");null==e.indicatorFolded&&(e.indicatorFolded="CodeMirror-foldgutter-folded");return e}(n)),o(t),t.on("gutterClick",a),t.on("change",l),t.on("viewportChange",s),t.on("fold",u),t.on("unfold",u),t.on("swapDoc",l))});var t=e.Pos;function n(e,n){for(var r=e.findMarks(t(n,0),t(n+1,0)),i=0;i<r.length;++i)if(r[i].__isFold&&r[i].find().from.line==n)return r[i]}function r(e){if("string"==typeof e){var t=document.createElement("div");return t.className=e+" CodeMirror-guttermarker-subtle",t}return e.cloneNode(!0)}function i(e,i,o){var a=e.state.foldGutter.options,l=i,s=e.foldOption(a,"minFoldSize"),u=e.foldOption(a,"rangeFinder");e.eachLine(i,o,function(i){var o=null;if(n(e,l))o=r(a.indicatorFolded);else{var c=t(l,0),f=u&&u(e,c);f&&f.to.line-f.from.line>=s&&(o=r(a.indicatorOpen))}e.setGutterMarker(i,a.gutter,o),++l})}function o(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation(function(){i(e,t.from,t.to)}),n.from=t.from,n.to=t.to)}function a(e,r,i){var o=e.state.foldGutter;if(o){var a=o.options;if(i==a.gutter){var l=n(e,r);l?l.clear():e.foldCode(t(r,0),a.rangeFinder)}}}function l(e){var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){o(e)},n.foldOnChangeTimeSpan||600)}}function s(e){var t=e.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){var n=e.getViewport();t.from==t.to||n.from-t.to>20||t.from-n.to>20?o(e):e.operation(function(){n.from<t.from&&(i(e,n.from,t.from),t.from=n.from),n.to>t.to&&(i(e,t.to,n.to),t.to=n.to)})},n.updateViewportTimeSpan||400)}}function u(e,t){var n=e.state.foldGutter;if(n){var r=t.line;r>=n.from&&r<n.to&&i(e,r,r+1)}}})},LKZe:function(e,t,n){var r=n("NpIQ"),i=n("X8DO"),o=n("TcQ7"),a=n("MmMw"),l=n("D2L2"),s=n("SfB7"),u=Object.getOwnPropertyDescriptor;t.f=n("+E39")?u:function(e,t){if(e=o(e),t=a(t,!0),s)try{return u(e,t)}catch(e){}if(l(e,t))return i(!r.f.call(e,t),e[t])}},Lgoy:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("pFYg"),i=n.n(r),o=n("8U58");n("4/hK");var a={props:{value:{type:String,default:""},options:{type:Object,default:function(){return{mode:"text/javascript",lineNumbers:!0,lineWrapping:!0}}}},data:function(){return{skipNextChangeEvent:!1}},ready:function(){var e=this;this.editor=o.fromTextArea(this.$el.querySelector("textarea"),this.options),this.editor.setValue(this.value),this.editor.on("change",function(t){e.skipNextChangeEvent?e.skipNextChangeEvent=!1:(e.value=t.getValue(),e.$emit&&e.$emit("change",t.getValue()))})},mounted:function(){var e=this;this.editor=o.fromTextArea(this.$el.querySelector("textarea"),this.options),this.editor.setValue(this.value),this.editor.on("change",function(t){e.skipNextChangeEvent?e.skipNextChangeEvent=!1:e.$emit&&(e.$emit("change",t.getValue()),e.$emit("input",t.getValue()))})},watch:{value:function(e,t){if(e!==this.editor.getValue()){this.skipNextChangeEvent=!0;var n=this.editor.getScrollInfo();this.editor.setValue(e),this.editor.scrollTo(n.left,n.top)}},options:function(e,t){if("object"===(void 0===e?"undefined":i()(e)))for(var n in e)e.hasOwnProperty(n)&&this.editor.setOption(n,e[n])}},beforeDestroy:function(){this.editor&&this.editor.toTextArea()}},l={render:function(){this.$createElement;this._self._c;return this._m(0)},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"vue-codemirror-wrap"},[t("textarea")])}]};var s=n("VU/8")(a,l,!1,function(e){n("jzqz")},null,null);t.default=s.exports},MPgS:function(e,t){},OYls:function(e,t,n){n("crlp")("asyncIterator")},"QWe/":function(e,t,n){n("crlp")("observable")},Rrel:function(e,t,n){var r=n("TcQ7"),i=n("n0T6").f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==o.call(e)?function(e){try{return i(e)}catch(e){return a.slice()}}(e):i(r(e))}},THjC:function(e,t,n){!function(e){e(n("8U58"))}(function(e){"use strict";function t(t,n,i,o){if(i&&i.call){var a=i;i=null}else a=r(t,i,"rangeFinder");"number"==typeof n&&(n=e.Pos(n,0));var l=r(t,i,"minFoldSize");function s(e){var r=a(t,n);if(!r||r.to.line-r.from.line<l)return null;for(var i=t.findMarksAt(r.from),s=0;s<i.length;++s)if(i[s].__isFold&&"fold"!==o){if(!e)return null;r.cleared=!0,i[s].clear()}return r}var u=s(!0);if(r(t,i,"scanUp"))for(;!u&&n.line>t.firstLine();)n=e.Pos(n.line-1,0),u=s(!1);if(u&&!u.cleared&&"unfold"!==o){var c=function(e,t){var n=r(e,t,"widget");if("string"==typeof n){var i=document.createTextNode(n);(n=document.createElement("span")).appendChild(i),n.className="CodeMirror-foldmarker"}else n&&(n=n.cloneNode(!0));return n}(t,i);e.on(c,"mousedown",function(t){f.clear(),e.e_preventDefault(t)});var f=t.markText(u.from,u.to,{replacedWith:c,clearOnEnter:r(t,i,"clearOnEnter"),__isFold:!0});f.on("clear",function(n,r){e.signal(t,"unfold",t,n,r)}),e.signal(t,"fold",t,u.from,u.to)}}e.newFoldFunction=function(e,n){return function(r,i){t(r,i,{rangeFinder:e,widget:n})}},e.defineExtension("foldCode",function(e,n,r){t(this,e,n,r)}),e.defineExtension("isFolded",function(e){for(var t=this.findMarksAt(e),n=0;n<t.length;++n)if(t[n].__isFold)return!0}),e.commands.toggleFold=function(e){e.foldCode(e.getCursor())},e.commands.fold=function(e){e.foldCode(e.getCursor(),null,"fold")},e.commands.unfold=function(e){e.foldCode(e.getCursor(),null,"unfold")},e.commands.foldAll=function(t){t.operation(function(){for(var n=t.firstLine(),r=t.lastLine();n<=r;n++)t.foldCode(e.Pos(n,0),null,"fold")})},e.commands.unfoldAll=function(t){t.operation(function(){for(var n=t.firstLine(),r=t.lastLine();n<=r;n++)t.foldCode(e.Pos(n,0),null,"unfold")})},e.registerHelper("fold","combine",function(){var e=Array.prototype.slice.call(arguments,0);return function(t,n){for(var r=0;r<e.length;++r){var i=e[r](t,n);if(i)return i}}}),e.registerHelper("fold","auto",function(e,t){for(var n=e.getHelpers(t,"fold"),r=0;r<n.length;r++){var i=n[r](e,t);if(i)return i}});var n={rangeFinder:e.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};function r(e,t,r){if(t&&void 0!==t[r])return t[r];var i=e.options.foldOptions;return i&&void 0!==i[r]?i[r]:n[r]}e.defineOption("foldOptions",null),e.defineExtension("foldOption",function(e,t){return r(this,e,t)})})},U3HU:function(e,t,n){!function(e){e(n("8U58"))}(function(e){"use strict";function t(t,n){var r=t.getLine(n),i=r.search(/\S/);return-1==i||/\bcomment\b/.test(t.getTokenTypeAt(e.Pos(n,i+1)))?-1:e.countColumn(r,null,t.getOption("tabSize"))}e.registerHelper("fold","indent",function(n,r){var i=t(n,r.line);if(!(i<0)){for(var o=null,a=r.line+1,l=n.lastLine();a<=l;++a){var s=t(n,a);if(-1==s);else{if(!(s>i))break;o=a}}return o?{from:e.Pos(r.line,n.getLine(r.line).length),to:e.Pos(o,n.getLine(o).length)}:void 0}})})},UM8r:function(e,t){},WQH6:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("fZjL"),i=n.n(r),o=n("mvHQ"),a=n.n(o),l=n("Dd8w"),s=n.n(l),u=n("NYxO"),c=n("IcnI"),f=n("oAV5"),d=n("gZhU"),h=(n("UM8r"),n("Xdwu"),n("epNC"),n("6S2o"),n("tWbI"),n("aGTD"),n("Yokd"),n("Kk9m"),n("fo6W"),n("U3HU"),{name:"CodeMirror",components:{codemirror:d.codemirror},props:{value:{type:String,default:""},languages:{type:Array,default:function(){return["C","C++","Java","Python2"]}},language:{type:String,default:"C++"},theme:{type:String,default:"solarized"}},data:function(){return{options:{tabSize:4,mode:"text/x-csrc",theme:"solarized",lineNumbers:!0,line:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],styleSelectedText:!0,lineWrapping:!0,highlightSelectionMatches:{showToken:/\w/,annotateScrollbar:!0}},mode:{"C++":"text/x-csrc"},themes:[{label:"Monokai",value:"monokai"},{label:"Solarized Light",value:"solarized"},{label:"Material",value:"material"}]}},mounted:function(){var e=this;f.a.getLanguages().then(function(t){var n={};t.forEach(function(e){n[e.name]=e.content_type}),e.mode=n,e.editor.setOption("mode",e.mode[e.language])}),this.editor.focus()},methods:{onEditorCodeChange:function(e){this.$emit("update:value",e)},onLangChange:function(e){this.editor.setOption("mode",this.mode[e]),this.$emit("changeLang",e)},onThemeChange:function(e){this.editor.setOption("theme",e),this.$emit("changeTheme",e)},onResetClick:function(){this.$emit("resetCode")},onUploadFile:function(){document.getElementById("file-uploader").click()},onUploadFileDone:function(){var e=document.getElementById("file-uploader").files[0],t=new window.FileReader,n=this;t.onload=function(e){var t=e.target.result;n.editor.setValue(t),document.getElementById("file-uploader").value=""},t.readAsText(e,"UTF-8")}},computed:{editor:function(){return this.$refs.myEditor.editor}},watch:{theme:function(e,t){this.editor.setOption("theme",e)}}}),p={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{margin:"0px 0px 15px 0px"}},[n("Row",{staticClass:"header",attrs:{type:"flex",justify:"space-between"}},[n("Col",{attrs:{span:12}},[n("div",[n("span",[e._v("Language:")]),e._v(" "),n("Select",{staticClass:"adjust",attrs:{value:e.language},on:{"on-change":e.onLangChange}},e._l(e.languages,function(t){return n("Option",{key:t,attrs:{value:t}},[e._v(e._s(t)+"\n        ")])})),e._v(" "),n("Tooltip",{staticStyle:{"margin-left":"10px"},attrs:{content:"Reset to default code definition",placement:"top"}},[n("Button",{attrs:{icon:"refresh"},on:{click:e.onResetClick}})],1),e._v(" "),n("Tooltip",{staticStyle:{"margin-left":"10px"},attrs:{content:"Upload file",placement:"top"}},[n("Button",{attrs:{icon:"upload"},on:{click:e.onUploadFile}})],1),e._v(" "),n("input",{staticStyle:{display:"none"},attrs:{type:"file",id:"file-uploader"},on:{change:e.onUploadFileDone}})],1)]),e._v(" "),n("Col",{attrs:{span:12}},[n("div",{staticClass:"fl-right"},[n("span",[e._v("Theme:")]),e._v(" "),n("Select",{staticClass:"adjust",attrs:{value:e.theme},on:{"on-change":e.onThemeChange}},e._l(e.themes,function(t){return n("Option",{key:t.label,attrs:{value:t.value}},[e._v(e._s(t.label)+"\n        ")])}))],1)])],1),e._v(" "),n("codemirror",{ref:"myEditor",attrs:{value:e.value,options:e.options},on:{change:e.onEditorCodeChange}})],1)},staticRenderFns:[]};var m=n("VU/8")(h,p,!1,function(e){n("KVNC"),n("aFmK")},"data-v-3114994e",null).exports,g=n("VKKs"),v=n("y2MC"),y=n("FN8c"),b=n("8Q2T"),x={AC:{color:"#19be6b"},WA:{color:"#ed3f14"},TLE:{color:"#ff9300"},MLE:{color:"#f7de00"},RE:{color:"#ff6104"},CE:{color:"#80848f"},PAC:{color:"#2d8cf0"}};function w(e){return x[e.name].color}var C={legend:{left:"center",top:"10",orient:"horizontal",data:["AC","WA"]},series:[{name:"Summary",type:"pie",radius:"80%",center:["50%","55%"],itemStyle:{normal:{color:w}},data:[{value:0,name:"WA"},{value:0,name:"AC"}],label:{normal:{position:"inner",show:!0,formatter:"{b}: {c}\n {d}%",textStyle:{fontWeight:"bold"}}}}]},S={legend:{left:"center",top:"10",orient:"horizontal",itemGap:20,data:["AC","RE","WA","TLE","PAC","MLE"]},series:[{name:"Detail",type:"pie",radius:["45%","70%"],center:["50%","55%"],itemStyle:{normal:{color:w}},data:[{value:0,name:"RE"},{value:0,name:"WA"},{value:0,name:"TLE"},{value:0,name:"AC"},{value:0,name:"MLE"},{value:0,name:"PAC"}],label:{normal:{formatter:"{b}: {c}\n {d}%"}},labelLine:{normal:{}}},{name:"Summary",type:"pie",radius:"30%",center:["50%","55%"],itemStyle:{normal:{color:w}},data:[{value:"0",name:"WA"},{value:0,name:"AC",selected:!0}],label:{normal:{position:"inner",formatter:"{b}: {c}\n {d}%"}}}]},k=["-1","-2","0","1","2","3","4","8"],L={name:"Problem",components:{CodeMirror:m},mixins:[v.a],data:function(){return{statusVisible:!1,captchaRequired:!1,graphVisible:!1,submissionExists:!1,captchaCode:"",captchaSrc:"",contestID:"",problemID:"",submitting:!1,code:"",language:"C++",theme:"solarized",submissionId:"",submitted:!1,result:{result:9},problem:{title:"",description:"",hint:"",my_status:"",template:{},languages:[],created_by:{username:""},tags:[],io_mode:{io_mode:"Standard IO"}},pie:C,largePie:S,largePieInitOpts:{width:"500",height:"480"}}},beforeRouteEnter:function(e,t,n){var r=g.a.get(Object(y.j)(e.params.problemID,e.params.contestID));r?n(function(e){e.language=r.language,e.code=r.code,e.theme=r.theme}):n()},mounted:function(){this.$store.commit(c.b.CHANGE_CONTEST_ITEM_VISIBLE,{menu:!1}),this.init()},methods:s()({},Object(u.mapActions)(["changeDomTitle"]),{init:function(){var e=this;this.$Loading.start(),this.contestID=this.$route.params.contestID,this.problemID=this.$route.params.problemID;var t="problem-details"===this.$route.name?"getProblem":"getContestProblem";b.a[t](this.problemID,this.contestID).then(function(t){e.$Loading.finish();var n=t.data.data;if(e.changeDomTitle({title:n.title}),b.a.submissionExists(n.id).then(function(t){e.submissionExists=t.data.data}),n.languages=n.languages.sort(),e.problem=n,e.changePie(n),""===e.code){e.language=e.problem.languages[0];var r=e.problem.template;r&&r[e.language]&&(e.code=r[e.language])}},function(){e.$Loading.error()})},changePie:function(e){for(var t in e.statistic_info)-1===k.indexOf(t)&&delete e.statistic_info[t];var n=e.accepted_number,r=[{name:"WA",value:e.submission_number-n},{name:"AC",value:n}];this.pie.series[0].data=r;var o=JSON.parse(a()(r));o[1].selected=!0,this.largePie.series[1].data=o;var l=i()(e.statistic_info).map(function(e){return y.e[e].short});0===l.length&&l.push("AC","WA"),this.largePie.legend.data=l;var s=e.statistic_info[0];delete e.statistic_info[0];var u=[];i()(e.statistic_info).forEach(function(t){u.push({name:y.e[t].short,value:e.statistic_info[t]})}),u.push({name:"AC",value:s}),this.largePie.series[0].data=u},handleRoute:function(e){this.$router.push(e)},onChangeLang:function(e){this.problem.template[e]&&""===this.code.trim()&&(this.code=this.problem.template[e]),this.language=e},onChangeTheme:function(e){this.theme=e},onResetToTemplate:function(){var e=this;this.$Modal.confirm({content:"Are you sure you want to reset your code?",onOk:function(){var t=e.problem.template;t&&t[e.language]&&(e.code=t[e.language])}})},checkSubmissionStatus:function(){var e=this;this.refreshStatus&&clearTimeout(this.refreshStatus);this.refreshStatus=setTimeout(function t(){var n=e.submissionId;b.a.getSubmission(n).then(function(n){e.result=n.data.data,0!==i()(n.data.data.statistic_info).length?(e.submitting=!1,e.submitted=!1,clearTimeout(e.refreshStatus),e.init()):e.refreshStatus=setTimeout(t,2e3)},function(t){e.submitting=!1,clearTimeout(e.refreshStatus)})},2e3)},submitCode:function(){var e=this;if(""!==this.code.trim()){this.submissionId="",this.result={result:9},this.submitting=!0;var t={problem_id:this.problem.id,language:this.language,code:this.code,contest_id:this.contestID};this.captchaRequired&&(t.captcha=this.captchaCode);var n=function(t,n){e.statusVisible=!0,b.a.submitCode(t).then(function(t){e.submissionId=t.data.data&&t.data.data.submission_id,e.submitting=!1,e.submissionExists=!0,n?(e.submitted=!0,e.checkSubmissionStatus()):e.$Modal.success({title:"Success",content:"Submit code successfully"})},function(t){e.getCaptchaSrc(),t.data.data.startsWith("Captcha is required")&&(e.captchaRequired=!0),e.submitting=!1,e.statusVisible=!1})};"OI"!==this.contestRuleType||this.OIContestRealTimePermission?n(t,!0):this.submissionExists?this.$Modal.confirm({title:"",content:"<h3>You have submission in this problem, sure to cover it?<h3>",onOk:function(){setTimeout(function(){n(t,!1)},1e3)},onCancel:function(){e.submitting=!1}}):n(t,!1)}else this.$error("Code can not be empty")},onCopy:function(e){this.$success("Code copied")},onCopyError:function(e){this.$error("Failed to copy code")}}),computed:s()({},Object(u.mapGetters)(["problemSubmitDisabled","contestRuleType","OIContestRealTimePermission","contestStatus"]),{contest:function(){return this.$store.state.contest.contest},contestEnded:function(){return this.contestStatus===y.a.ENDED},submissionStatus:function(){return{text:y.e[this.result.result].name,color:y.e[this.result.result].color}},submissionRoute:function(){return this.contestID?{name:"contest-submission-list",query:{problemID:this.problemID}}:{name:"submission-list",query:{problemID:this.problemID}}}}),beforeRouteLeave:function(e,t,n){clearInterval(this.refreshStatus),this.$store.commit(c.b.CHANGE_CONTEST_ITEM_VISIBLE,{menu:!0}),g.a.set(Object(y.j)(this.problem._id,t.params.contestID),{code:this.code,language:this.language,theme:this.theme}),n()},watch:{$route:function(){this.init()}}},T={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex-container"},[n("div",{attrs:{id:"problem-main"}},[n("Panel",{attrs:{padding:40,shadow:""}},[n("div",{attrs:{slot:"title"},slot:"title"},[e._v(e._s(e.problem.title))]),e._v(" "),n("div",{directives:[{name:"katex",rawName:"v-katex"}],staticClass:"markdown-body",attrs:{id:"problem-content"}},[n("p",{staticClass:"title"},[e._v(e._s(e.$t("m.Description")))]),e._v(" "),n("p",{staticClass:"content",domProps:{innerHTML:e._s(e.problem.description)}}),e._v(" "),n("p",{staticClass:"title"},[e._v(e._s(e.$t("m.Input"))+" "),"File IO"==e.problem.io_mode.io_mode?n("span",[e._v("("+e._s(e.$t("m.FromFile"))+": "+e._s(e.problem.io_mode.input)+")")]):e._e()]),e._v(" "),n("p",{staticClass:"content",domProps:{innerHTML:e._s(e.problem.input_description)}}),e._v(" "),n("p",{staticClass:"title"},[e._v(e._s(e.$t("m.Output"))+" "),"File IO"==e.problem.io_mode.io_mode?n("span",[e._v("("+e._s(e.$t("m.ToFile"))+": "+e._s(e.problem.io_mode.output)+")")]):e._e()]),e._v(" "),n("p",{staticClass:"content",domProps:{innerHTML:e._s(e.problem.output_description)}}),e._v(" "),e._l(e.problem.samples,function(t,r){return n("div",{key:r},[n("div",{staticClass:"flex-container sample"},[n("div",{staticClass:"sample-input"},[n("p",{staticClass:"title"},[e._v(e._s(e.$t("m.Sample_Input"))+" "+e._s(r+1)+"\n                "),n("a",{directives:[{name:"clipboard",rawName:"v-clipboard:copy",value:t.input,expression:"sample.input",arg:"copy"},{name:"clipboard",rawName:"v-clipboard:success",value:e.onCopy,expression:"onCopy",arg:"success"},{name:"clipboard",rawName:"v-clipboard:error",value:e.onCopyError,expression:"onCopyError",arg:"error"}],staticClass:"copy"},[n("Icon",{attrs:{type:"clipboard"}})],1)]),e._v(" "),n("pre",[e._v(e._s(t.input))])]),e._v(" "),n("div",{staticClass:"sample-output"},[n("p",{staticClass:"title"},[e._v(e._s(e.$t("m.Sample_Output"))+" "+e._s(r+1))]),e._v(" "),n("pre",[e._v(e._s(t.output))])])])])}),e._v(" "),e.problem.hint?n("div",[n("p",{staticClass:"title"},[e._v(e._s(e.$t("m.Hint")))]),e._v(" "),n("Card",{attrs:{"dis-hover":""}},[n("div",{staticClass:"content",domProps:{innerHTML:e._s(e.problem.hint)}})])],1):e._e(),e._v(" "),e.problem.source?n("div",[n("p",{staticClass:"title"},[e._v(e._s(e.$t("m.Source")))]),e._v(" "),n("p",{staticClass:"content"},[e._v(e._s(e.problem.source))])]):e._e()],2)]),e._v(" "),n("Card",{attrs:{padding:20,id:"submit-code","dis-hover":""}},[n("CodeMirror",{attrs:{value:e.code,languages:e.problem.languages,language:e.language,theme:e.theme},on:{"update:value":function(t){e.code=t},resetCode:e.onResetToTemplate,changeTheme:e.onChangeTheme,changeLang:e.onChangeLang}}),e._v(" "),n("Row",{attrs:{type:"flex",justify:"space-between"}},[n("Col",{attrs:{span:10}},[e.statusVisible?n("div",{staticClass:"status"},[!this.contestID||this.contestID&&e.OIContestRealTimePermission?[n("span",[e._v(e._s(e.$t("m.Status")))]),e._v(" "),n("Tag",{attrs:{type:"dot",color:e.submissionStatus.color},nativeOn:{click:function(t){e.handleRoute("/status/"+e.submissionId)}}},[e._v("\n                "+e._s(e.submissionStatus.text)+"\n              ")])]:this.contestID&&!e.OIContestRealTimePermission?[n("Alert",{attrs:{type:"success","show-icon":""}},[e._v("提交成功")])]:e._e()],2):0===e.problem.my_status?n("div",[n("Alert",{attrs:{type:"success","show-icon":""}},[e._v("你已经解决了这道题")])],1):this.contestID&&!e.OIContestRealTimePermission&&e.submissionExists?n("div",[n("Alert",{attrs:{type:"success","show-icon":""}},[e._v("你已提交过了")])],1):e._e(),e._v(" "),e.contestEnded?n("div",[n("Alert",{attrs:{type:"warning","show-icon":""}},[e._v("比赛已经结束")])],1):e._e()]),e._v(" "),n("Col",{attrs:{span:12}},[e.captchaRequired?[n("div",{staticClass:"captcha-container"},[e.captchaRequired?n("Tooltip",{attrs:{content:"Click to refresh",placement:"top"}},[n("img",{attrs:{src:e.captchaSrc},on:{click:e.getCaptchaSrc}})]):e._e(),e._v(" "),n("Input",{staticClass:"captcha-code",model:{value:e.captchaCode,callback:function(t){e.captchaCode=t},expression:"captchaCode"}})],1)]:e._e(),e._v(" "),n("Button",{staticClass:"fl-right",attrs:{type:"warning",icon:"edit",loading:e.submitting,disabled:e.problemSubmitDisabled||e.submitted},on:{click:e.submitCode}},[e.submitting?n("span",[e._v("提交中")]):n("span",[e._v("提交")])])],2)],1)],1)],1),e._v(" "),n("div",{attrs:{id:"right-column"}},[n("VerticalMenu",{on:{"on-click":e.handleRoute}},[this.contestID?[n("VerticalMenu-item",{attrs:{route:{name:"contest-problem-list",params:{contestID:e.contestID}}}},[n("Icon",{attrs:{type:"ios-photos"}}),e._v("\n          题目\n        ")],1),e._v(" "),n("VerticalMenu-item",{attrs:{route:{name:"contest-announcement-list",params:{contestID:e.contestID}}}},[n("Icon",{attrs:{type:"chatbubble-working"}}),e._v("\n          公告\n        ")],1)]:e._e(),e._v(" "),!this.contestID||e.OIContestRealTimePermission?n("VerticalMenu-item",{attrs:{route:e.submissionRoute}},[n("Icon",{attrs:{type:"navicon-round"}}),e._v("\n        提交信息\n      ")],1):e._e(),e._v(" "),this.contestID?[!this.contestID||e.OIContestRealTimePermission?n("VerticalMenu-item",{attrs:{route:{name:"contest-rank",params:{contestID:e.contestID}}}},[n("Icon",{attrs:{type:"stats-bars"}}),e._v("\n          Rank排名\n        ")],1):e._e(),e._v(" "),n("VerticalMenu-item",{attrs:{route:{name:"contest-details",params:{contestID:e.contestID}}}},[n("Icon",{attrs:{type:"home"}}),e._v("\n          查看比赛\n        ")],1)]:e._e()],2),e._v(" "),n("Card",{attrs:{id:"info"}},[n("div",{staticClass:"header",attrs:{slot:"title"},slot:"title"},[n("Icon",{attrs:{type:"information-circled"}}),e._v(" "),n("span",{staticClass:"card-title"},[e._v(e._s(e.$t("m.Information")))])],1),e._v(" "),n("ul",[n("li",[n("p",[e._v("ID")]),e._v(" "),n("p",[e._v(e._s(e.problem._id))])]),e._v(" "),n("li",[n("p",[e._v(e._s(e.$t("m.Time_Limit")))]),e._v(" "),n("p",[e._v(e._s(e.problem.time_limit)+"MS")])]),e._v(" "),n("li",[n("p",[e._v(e._s(e.$t("m.Memory_Limit")))]),e._v(" "),n("p",[e._v(e._s(e.problem.memory_limit)+"MB")])]),e._v(" "),n("li"),n("li",[n("p",[e._v(e._s(e.$t("m.IOMode")))]),e._v(" "),n("p",[e._v(e._s(e.problem.io_mode.io_mode))])]),e._v(" "),n("li",[n("p",[e._v(e._s(e.$t("m.Created")))]),e._v(" "),n("p",[e._v(e._s(e.problem.created_by.username))])]),e._v(" "),e.problem.difficulty?n("li",[n("p",[e._v(e._s(e.$t("m.Level")))]),e._v(" "),n("p",[e._v(e._s(e.problem.difficulty))])]):e._e(),e._v(" "),e.problem.total_score?n("li",[n("p",[e._v(e._s(e.$t("m.Score")))]),e._v(" "),n("p",[e._v(e._s(e.problem.total_score))])]):e._e(),e._v(" "),n("li",[n("p",[e._v(e._s(e.$t("m.Tags")))]),e._v(" "),n("p",[n("Poptip",{attrs:{trigger:"hover",placement:"left-end"}},[n("a",[e._v("显示")]),e._v(" "),n("div",{attrs:{slot:"content"},slot:"content"},e._l(e.problem.tags,function(t){return n("Tag",{key:t},[e._v(e._s(t))])}))])],1)])])]),e._v(" "),!this.contestID||e.OIContestRealTimePermission?n("Card",{attrs:{id:"pieChart",padding:0}},[n("div",{attrs:{slot:"title"},slot:"title"},[n("Icon",{attrs:{type:"ios-analytics"}}),e._v(" "),n("span",{staticClass:"card-title"},[e._v("统计")]),e._v(" "),n("Button",{attrs:{type:"ghost",size:"small",id:"detail"},on:{click:function(t){e.graphVisible=!e.graphVisible}}},[e._v("Details")])],1),e._v(" "),n("div",{staticClass:"echarts"},[n("ECharts",{attrs:{options:e.pie}})],1)]):e._e()],1),e._v(" "),n("Modal",{model:{value:e.graphVisible,callback:function(t){e.graphVisible=t},expression:"graphVisible"}},[n("div",{attrs:{id:"pieChart-detail"}},[n("ECharts",{attrs:{options:e.largePie,initOptions:e.largePieInitOpts}})],1),e._v(" "),n("div",{attrs:{slot:"footer"},slot:"footer"},[n("Button",{attrs:{type:"ghost"},on:{click:function(t){e.graphVisible=!1}}},[e._v("关闭")])],1)])],1)},staticRenderFns:[]};var M=n("VU/8")(L,T,!1,function(e){n("MPgS")},"data-v-3837628f",null);t.default=M.exports},Xc4G:function(e,t,n){var r=n("lktj"),i=n("1kS7"),o=n("NpIQ");e.exports=function(e){var t=r(e),n=i.f;if(n)for(var a,l=n(e),s=o.f,u=0;l.length>u;)s.call(e,a=l[u++])&&t.push(a);return t}},Xdwu:function(e,t){},Yokd:function(e,t){},Zzip:function(e,t,n){e.exports={default:n("/n6Q"),__esModule:!0}},aFmK:function(e,t){},aGTD:function(e,t,n){!function(e){e(n("8U58"))}(function(e){"use strict";var t="CodeMirror-activeline",n="CodeMirror-activeline-background",r="CodeMirror-activeline-gutter";function i(e){for(var i=0;i<e.state.activeLines.length;i++)e.removeLineClass(e.state.activeLines[i],"wrap",t),e.removeLineClass(e.state.activeLines[i],"background",n),e.removeLineClass(e.state.activeLines[i],"gutter",r)}function o(e,o){for(var a=[],l=0;l<o.length;l++){var s=o[l],u=e.getOption("styleActiveLine");if("object"==typeof u&&u.nonEmpty?s.anchor.line==s.head.line:s.empty()){var c=e.getLineHandleVisualStart(s.head.line);a[a.length-1]!=c&&a.push(c)}}(function(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0})(e.state.activeLines,a)||e.operation(function(){i(e);for(var o=0;o<a.length;o++)e.addLineClass(a[o],"wrap",t),e.addLineClass(a[o],"background",n),e.addLineClass(a[o],"gutter",r);e.state.activeLines=a})}function a(e,t){o(e,t.ranges)}e.defineOption("styleActiveLine",!1,function(t,n,r){var l=r!=e.Init&&r;n!=l&&(l&&(t.off("beforeSelectionChange",a),i(t),delete t.state.activeLines),n&&(t.state.activeLines=[],o(t,t.listSelections()),t.on("beforeSelectionChange",a)))})})},crlp:function(e,t,n){var r=n("7KvD"),i=n("FeBl"),o=n("O4g8"),a=n("Kh4W"),l=n("evD5").f;e.exports=function(e){var t=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||l(t,e,{value:a.f(e)})}},epNC:function(e,t){},fWfb:function(e,t,n){"use strict";var r=n("7KvD"),i=n("D2L2"),o=n("+E39"),a=n("kM2E"),l=n("880/"),s=n("06OY").KEY,u=n("S82l"),c=n("e8AB"),f=n("e6n0"),d=n("3Eo+"),h=n("dSzd"),p=n("Kh4W"),m=n("crlp"),g=n("Xc4G"),v=n("7UMu"),y=n("77Pl"),b=n("EqjI"),x=n("TcQ7"),w=n("MmMw"),C=n("X8DO"),S=n("Yobk"),k=n("Rrel"),L=n("LKZe"),T=n("evD5"),M=n("lktj"),_=L.f,O=T.f,N=k.f,D=r.Symbol,A=r.JSON,I=A&&A.stringify,E=h("_hidden"),P=h("toPrimitive"),F={}.propertyIsEnumerable,W=c("symbol-registry"),z=c("symbols"),R=c("op-symbols"),H=Object.prototype,B="function"==typeof D,U=r.QObject,V=!U||!U.prototype||!U.prototype.findChild,j=o&&u(function(){return 7!=S(O({},"a",{get:function(){return O(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=_(H,t);r&&delete H[t],O(e,t,n),r&&e!==H&&O(H,t,r)}:O,$=function(e){var t=z[e]=S(D.prototype);return t._k=e,t},G=B&&"symbol"==typeof D.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof D},K=function(e,t,n){return e===H&&K(R,t,n),y(e),t=w(t,!0),y(n),i(z,t)?(n.enumerable?(i(e,E)&&e[E][t]&&(e[E][t]=!1),n=S(n,{enumerable:C(0,!1)})):(i(e,E)||O(e,E,C(1,{})),e[E][t]=!0),j(e,t,n)):O(e,t,n)},q=function(e,t){y(e);for(var n,r=g(t=x(t)),i=0,o=r.length;o>i;)K(e,n=r[i++],t[n]);return e},Y=function(e){var t=F.call(this,e=w(e,!0));return!(this===H&&i(z,e)&&!i(R,e))&&(!(t||!i(this,e)||!i(z,e)||i(this,E)&&this[E][e])||t)},X=function(e,t){if(e=x(e),t=w(t,!0),e!==H||!i(z,t)||i(R,t)){var n=_(e,t);return!n||!i(z,t)||i(e,E)&&e[E][t]||(n.enumerable=!0),n}},Z=function(e){for(var t,n=N(x(e)),r=[],o=0;n.length>o;)i(z,t=n[o++])||t==E||t==s||r.push(t);return r},Q=function(e){for(var t,n=e===H,r=N(n?R:x(e)),o=[],a=0;r.length>a;)!i(z,t=r[a++])||n&&!i(H,t)||o.push(z[t]);return o};B||(l((D=function(){if(this instanceof D)throw TypeError("Symbol is not a constructor!");var e=d(arguments.length>0?arguments[0]:void 0),t=function(n){this===H&&t.call(R,n),i(this,E)&&i(this[E],e)&&(this[E][e]=!1),j(this,e,C(1,n))};return o&&V&&j(H,e,{configurable:!0,set:t}),$(e)}).prototype,"toString",function(){return this._k}),L.f=X,T.f=K,n("n0T6").f=k.f=Z,n("NpIQ").f=Y,n("1kS7").f=Q,o&&!n("O4g8")&&l(H,"propertyIsEnumerable",Y,!0),p.f=function(e){return $(h(e))}),a(a.G+a.W+a.F*!B,{Symbol:D});for(var J="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;J.length>ee;)h(J[ee++]);for(var te=M(h.store),ne=0;te.length>ne;)m(te[ne++]);a(a.S+a.F*!B,"Symbol",{for:function(e){return i(W,e+="")?W[e]:W[e]=D(e)},keyFor:function(e){if(!G(e))throw TypeError(e+" is not a symbol!");for(var t in W)if(W[t]===e)return t},useSetter:function(){V=!0},useSimple:function(){V=!1}}),a(a.S+a.F*!B,"Object",{create:function(e,t){return void 0===t?S(e):q(S(e),t)},defineProperty:K,defineProperties:q,getOwnPropertyDescriptor:X,getOwnPropertyNames:Z,getOwnPropertySymbols:Q}),A&&a(a.S+a.F*(!B||u(function(){var e=D();return"[null]"!=I([e])||"{}"!=I({a:e})||"{}"!=I(Object(e))})),"JSON",{stringify:function(e){for(var t,n,r=[e],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=t=r[1],(b(t)||void 0!==e)&&!G(e))return v(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!G(t))return t}),r[1]=t,I.apply(A,r)}}),D.prototype[P]||n("hJx8")(D.prototype,P,D.prototype.valueOf),f(D,"Symbol"),f(Math,"Math",!0),f(r.JSON,"JSON",!0)},fo6W:function(e,t,n){!function(e){e(n("8U58"))}(function(e){"use strict";e.registerHelper("fold","brace",function(t,n){var r,i=n.line,o=t.getLine(i);function a(a){for(var l=n.ch,s=0;;){var u=l<=0?-1:o.lastIndexOf(a,l-1);if(-1!=u){if(1==s&&u<n.ch)break;if(r=t.getTokenTypeAt(e.Pos(i,u+1)),!/^(comment|string)/.test(r))return u+1;l=u-1}else{if(1==s)break;s=1,l=o.length}}}var l="{",s="}",u=a("{");if(null==u&&(l="[",s="]",u=a("[")),null!=u){var c,f,d=1,h=t.lastLine();e:for(var p=i;p<=h;++p)for(var m=t.getLine(p),g=p==i?u:0;;){var v=m.indexOf(l,g),y=m.indexOf(s,g);if(v<0&&(v=m.length),y<0&&(y=m.length),(g=Math.min(v,y))==m.length)break;if(t.getTokenTypeAt(e.Pos(p,g+1))==r)if(g==v)++d;else if(!--d){c=p,f=g;break e}++g}if(null!=c&&i!=c)return{from:e.Pos(i,u),to:e.Pos(c,f)}}}),e.registerHelper("fold","import",function(t,n){function r(n){if(n<t.firstLine()||n>t.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));if(/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"keyword"!=r.type||"import"!=r.string)return null;for(var i=n,o=Math.min(t.lastLine(),n+10);i<=o;++i){var a=t.getLine(i).indexOf(";");if(-1!=a)return{startCh:r.end,end:e.Pos(i,a)}}}var i,o=n.line,a=r(o);if(!a||r(o-1)||(i=r(o-2))&&i.end.line==o-1)return null;for(var l=a.end;;){var s=r(l.line+1);if(null==s)break;l=s.end}return{from:t.clipPos(e.Pos(o,a.startCh+1)),to:l}}),e.registerHelper("fold","include",function(t,n){function r(n){if(n<t.firstLine()||n>t.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));return/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"meta"==r.type&&"#include"==r.string.slice(0,8)?r.start+8:void 0}var i=n.line,o=r(i);if(null==o||null!=r(i-1))return null;for(var a=i;;){if(null==r(a+1))break;++a}return{from:e.Pos(i,o+1),to:t.clipPos(e.Pos(a))}})})},gZhU:function(e,t,n){var r=n("8U58"),i=n("Lgoy");i=i.default||i,e.exports={CodeMirror:r,codemirror:i,install:function(e){e.component("codemirror",i)}}},jzqz:function(e,t){},n0T6:function(e,t,n){var r=n("Ibhu"),i=n("xnc9").concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},pFYg:function(e,t,n){"use strict";t.__esModule=!0;var r=a(n("Zzip")),i=a(n("5QVw")),o="function"==typeof i.default&&"symbol"==typeof r.default?function(e){return typeof e}:function(e){return e&&"function"==typeof i.default&&e.constructor===i.default&&e!==i.default.prototype?"symbol":typeof e};function a(e){return e&&e.__esModule?e:{default:e}}t.default="function"==typeof i.default&&"symbol"===o(r.default)?function(e){return void 0===e?"undefined":o(e)}:function(e){return e&&"function"==typeof i.default&&e.constructor===i.default&&e!==i.default.prototype?"symbol":void 0===e?"undefined":o(e)}},tWbI:function(e,t,n){!function(e){e(n("8U58"))}(function(e){"use strict";function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}var n=t(["and","or","not","is"]),r=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in"],i=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"];function o(e){return e.scopes[e.scopes.length-1]}e.registerHelper("hintWords","python",r.concat(i)),e.defineMode("python",function(a,l){for(var s="error",u=l.delimiters||l.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,c=[l.singleOperators,l.doubleOperators,l.doubleDelimiters,l.tripleDelimiters,l.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@])/],f=0;f<c.length;f++)c[f]||c.splice(f--,1);var d=l.hangingIndent||a.indentUnit,h=r,p=i;void 0!=l.extra_keywords&&(h=h.concat(l.extra_keywords)),void 0!=l.extra_builtins&&(p=p.concat(l.extra_builtins));var m=!(l.version&&Number(l.version)<3);if(m){var g=l.identifiers||/^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;h=h.concat(["nonlocal","False","True","None","async","await"]),p=p.concat(["ascii","bytes","exec","print"]);var v=new RegExp("^(([rbuf]|(br)|(fr))?('{3}|\"{3}|['\"]))","i")}else{g=l.identifiers||/^[_A-Za-z][_A-Za-z0-9]*/;h=h.concat(["exec","print"]),p=p.concat(["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"]);v=new RegExp("^(([rubf]|(ur)|(br))?('{3}|\"{3}|['\"]))","i")}var y=t(h),b=t(p);function x(e,t){var n=e.sol()&&"\\"!=t.lastToken;if(n&&(t.indent=e.indentation()),n&&"py"==o(t).type){var r=o(t).offset;if(e.eatSpace()){var i=e.indentation();return i>r?C(t):i<r&&S(e,t)&&"#"!=e.peek()&&(t.errorToken=!0),null}var a=w(e,t);return r>0&&S(e,t)&&(a+=" "+s),a}return w(e,t)}function w(e,t){if(e.eatSpace())return null;if(e.match(/^#.*/))return"comment";if(e.match(/^[0-9\.]/,!1)){var r=!1;if(e.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(r=!0),e.match(/^[\d_]+\.\d*/)&&(r=!0),e.match(/^\.\d+/)&&(r=!0),r)return e.eat(/J/i),"number";var i=!1;if(e.match(/^0x[0-9a-f_]+/i)&&(i=!0),e.match(/^0b[01_]+/i)&&(i=!0),e.match(/^0o[0-7_]+/i)&&(i=!0),e.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(e.eat(/J/i),i=!0),e.match(/^0(?![\dx])/i)&&(i=!0),i)return e.eat(/L/i),"number"}if(e.match(v))return-1!==e.current().toLowerCase().indexOf("f")?(t.tokenize=function(e,t){for(;"rubf".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=1==e.length,r="string";function i(t,n){return t.match(e)?(n.tokenize=o,r):t.match("{")?"punctuation":t.match("}")?(n.tokenize=o,"punctuation"):w(t,n)}function o(o,a){for(;!o.eol();)if(o.eatWhile(/[^'"\{\}\\]/),o.eat("\\")){if(o.next(),n&&o.eol())return r}else{if(o.match(e))return a.tokenize=t,r;if(o.match("{{"))return r;if(o.match("{",!1))return a.tokenize=i,o.current()?r:(o.next(),"punctuation");if(o.match("}}"))return r;if(o.match("}"))return s;o.eat(/['"]/)}if(n){if(l.singleLineStringErrors)return s;a.tokenize=t}return r}return o.isString=!0,o}(e.current(),t.tokenize),t.tokenize(e,t)):(t.tokenize=function(e,t){for(;"rubf".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=1==e.length,r="string";function i(i,o){for(;!i.eol();)if(i.eatWhile(/[^'"\\]/),i.eat("\\")){if(i.next(),n&&i.eol())return r}else{if(i.match(e))return o.tokenize=t,r;i.eat(/['"]/)}if(n){if(l.singleLineStringErrors)return s;o.tokenize=t}return r}return i.isString=!0,i}(e.current(),t.tokenize),t.tokenize(e,t));for(var o=0;o<c.length;o++)if(e.match(c[o]))return"operator";return e.match(u)?"punctuation":"."==t.lastToken&&e.match(g)?"property":e.match(y)||e.match(n)?"keyword":e.match(b)?"builtin":e.match(/^(self|cls)\b/)?"variable-2":e.match(g)?"def"==t.lastToken||"class"==t.lastToken?"def":"variable":(e.next(),s)}function C(e){for(;"py"!=o(e).type;)e.scopes.pop();e.scopes.push({offset:o(e).offset+a.indentUnit,type:"py",align:null})}function S(e,t){for(var n=e.indentation();t.scopes.length>1&&o(t).offset>n;){if("py"!=o(t).type)return!0;t.scopes.pop()}return o(t).offset!=n}function k(e,t){e.sol()&&(t.beginningOfLine=!0);var n=t.tokenize(e,t),r=e.current();if(t.beginningOfLine&&"@"==r)return e.match(g,!1)?"meta":m?"operator":s;if(/\S/.test(r)&&(t.beginningOfLine=!1),"variable"!=n&&"builtin"!=n||"meta"!=t.lastToken||(n="meta"),"pass"!=r&&"return"!=r||(t.dedent+=1),"lambda"==r&&(t.lambda=!0),":"!=r||t.lambda||"py"!=o(t).type||C(t),1==r.length&&!/string|comment/.test(n)){var i="[({".indexOf(r);if(-1!=i&&function(e,t,n){var r=e.match(/^([\s\[\{\(]|#.*)*$/,!1)?null:e.column()+1;t.scopes.push({offset:t.indent+d,type:n,align:r})}(e,t,"])}".slice(i,i+1)),-1!=(i="])}".indexOf(r))){if(o(t).type!=r)return s;t.indent=t.scopes.pop().offset-d}}return t.dedent>0&&e.eol()&&"py"==o(t).type&&(t.scopes.length>1&&t.scopes.pop(),t.dedent-=1),n}return{startState:function(e){return{tokenize:x,scopes:[{offset:e||0,type:"py",align:null}],indent:e||0,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=t.errorToken;n&&(t.errorToken=!1);var r=k(e,t);return r&&"comment"!=r&&(t.lastToken="keyword"==r||"punctuation"==r?e.current():r),"punctuation"==r&&(r=null),e.eol()&&t.lambda&&(t.lambda=!1),n?r+" "+s:r},indent:function(t,n){if(t.tokenize!=x)return t.tokenize.isString?e.Pass:0;var r=o(t),i=r.type==n.charAt(0);return null!=r.align?r.align-(i?1:0):r.offset-(i?d:0)},electricInput:/^\s*[\}\]\)]$/,closeBrackets:{triples:"'\""},lineComment:"#",fold:"indent"}}),e.defineMIME("text/x-python","python");e.defineMIME("text/x-cython",{name:"python",extra_keywords:function(e){return e.split(" ")}("by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE")})})}});