text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[33],{"8EBN":function(e,t,n){(function(e){e(n("VrN/"))})((function(e){"use strict";e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy","cbl"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded JavaScript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"],alias:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var t=0;t<e.modeInfo.length;t++){var n=e.modeInfo[t];n.mimes&&(n.mime=n.mimes[0])}e.findModeByMIME=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.mime==t)return r;if(r.mimes)for(var i=0;i<r.mimes.length;i++)if(r.mimes[i]==t)return r}return/\+xml$/.test(t)?e.findModeByMIME("application/xml"):/\+json$/.test(t)?e.findModeByMIME("application/json"):void 0},e.findModeByExtension=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.ext)for(var i=0;i<r.ext.length;i++)if(r.ext[i]==t)return r}},e.findModeByFileName=function(t){for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.file&&r.file.test(t))return r}var i=t.lastIndexOf("."),o=i>-1&&t.substring(i+1,t.length);if(o)return e.findModeByExtension(o)},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.name.toLowerCase()==t)return r;if(r.alias)for(var i=0;i<r.alias.length;i++)if(r.alias[i].toLowerCase()==t)return r}}}))},"9Low":function(e,t,n){(function(e){e(n("VrN/"))})((function(e){"use strict";function t(t,r){function i(){t.display.wrapper.offsetHeight?(n(t,r),t.display.lastWrapHeight!=t.display.wrapper.clientHeight&&t.refresh()):r.timeout=setTimeout(i,r.delay)}r.timeout=setTimeout(i,r.delay),r.hurry=function(){clearTimeout(r.timeout),r.timeout=setTimeout(i,50)},e.on(window,"mouseup",r.hurry),e.on(window,"keyup",r.hurry)}function n(t,n){clearTimeout(n.timeout),e.off(window,"mouseup",n.hurry),e.off(window,"keyup",n.hurry)}e.defineOption("autoRefresh",!1,(function(e,r){e.state.autoRefresh&&(n(e,e.state.autoRefresh),e.state.autoRefresh=null),r&&0==e.display.wrapper.offsetHeight&&t(e,e.state.autoRefresh={delay:r.delay||250})}))}))},"9W6w":function(e,t,n){},ELLl:function(e,t,n){(function(e){e(n("VrN/"))})((function(e){var t={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},n=e.Pos;function r(e,n){return"pairs"==n&&"string"==typeof e?e:"object"==typeof e&&null!=e[n]?e[n]:t[n]}e.defineOption("autoCloseBrackets",!1,(function(t,n,l){l&&l!=e.Init&&(t.removeKeyMap(i),t.state.closeBrackets=null),n&&(o(r(n,"pairs")),t.state.closeBrackets=n,t.addKeyMap(i))}));var i={Backspace:s,Enter:c};function o(e){for(var t=0;t<e.length;t++){var n=e.charAt(t),r="'"+n+"'";i[r]||(i[r]=l(n))}}function l(e){return function(t){return h(t,e)}}function a(e){var t=e.state.closeBrackets;if(!t||t.override)return t;var n=e.getModeAt(e.getCursor());return n.closeBrackets||t}function s(t){var i=a(t);if(!i||t.getOption("disableInput"))return e.Pass;for(var o=r(i,"pairs"),l=t.listSelections(),s=0;s<l.length;s++){if(!l[s].empty())return e.Pass;var c=d(t,l[s].head);if(!c||o.indexOf(c)%2!=0)return e.Pass}for(s=l.length-1;s>=0;s--){var u=l[s].head;t.replaceRange("",n(u.line,u.ch-1),n(u.line,u.ch+1),"+delete")}}function c(t){var n=a(t),i=n&&r(n,"explode");if(!i||t.getOption("disableInput"))return e.Pass;for(var o=t.listSelections(),l=0;l<o.length;l++){if(!o[l].empty())return e.Pass;var s=d(t,o[l].head);if(!s||i.indexOf(s)%2!=0)return e.Pass}t.operation((function(){var e=t.lineSeparator()||"\n";t.replaceSelection(e+e,null),u(t,-1),o=t.listSelections();for(var n=0;n<o.length;n++){var r=o[n].head.line;t.indentLine(r,null,!0),t.indentLine(r+1,null,!0)}}))}function u(e,t){for(var n=[],r=e.listSelections(),i=0,o=0;o<r.length;o++){var l=r[o];l.head==e.getCursor()&&(i=o);var a=l.head.ch||t>0?{line:l.head.line,ch:l.head.ch+t}:{line:l.head.line-1};n.push({anchor:a,head:a})}e.setSelections(n,i)}function f(t){var r=e.cmpPos(t.anchor,t.head)>0;return{anchor:new n(t.anchor.line,t.anchor.ch+(r?-1:1)),head:new n(t.head.line,t.head.ch+(r?1:-1))}}function h(t,i){var o=a(t);if(!o||t.getOption("disableInput"))return e.Pass;var l=r(o,"pairs"),s=l.indexOf(i);if(-1==s)return e.Pass;for(var c,h=r(o,"closeBefore"),d=r(o,"triples"),m=l.charAt(s+1)==i,g=t.listSelections(),v=s%2==0,y=0;y<g.length;y++){var x,b=g[y],w=b.head,C=t.getRange(w,n(w.line,w.ch+1));if(v&&!b.empty())x="surround";else if(!m&&v||C!=i)if(m&&w.ch>1&&d.indexOf(i)>=0&&t.getRange(n(w.line,w.ch-2),w)==i+i){if(w.ch>2&&/\bstring/.test(t.getTokenTypeAt(n(w.line,w.ch-2))))return e.Pass;x="addFour"}else if(m){var S=0==w.ch?" ":t.getRange(n(w.line,w.ch-1),w);if(e.isWordChar(C)||S==i||e.isWordChar(S))return e.Pass;x="both"}else{if(!v||!(0===C.length||/\s/.test(C)||h.indexOf(C)>-1))return e.Pass;x="both"}else x=m&&p(t,w)?"both":d.indexOf(i)>=0&&t.getRange(w,n(w.line,w.ch+3))==i+i+i?"skipThree":"skip";if(c){if(c!=x)return e.Pass}else c=x}var k=s%2?l.charAt(s-1):i,L=s%2?i:l.charAt(s+1);t.operation((function(){if("skip"==c)u(t,1);else if("skipThree"==c)u(t,3);else if("surround"==c){for(var e=t.getSelections(),n=0;n<e.length;n++)e[n]=k+e[n]+L;t.replaceSelections(e,"around"),e=t.listSelections().slice();for(n=0;n<e.length;n++)e[n]=f(e[n]);t.setSelections(e)}else"both"==c?(t.replaceSelection(k+L,null),t.triggerElectric(k+L),u(t,-1)):"addFour"==c&&(t.replaceSelection(k+k+k+k,"before"),u(t,1))}))}function d(e,t){var r=e.getRange(n(t.line,t.ch-1),n(t.line,t.ch+1));return 2==r.length?r:null}function p(e,t){var r=e.getTokenAt(n(t.line,t.ch+1));return/\bstring/.test(r.type)&&r.start==t.ch&&(0==t.ch||!/\bstring/.test(e.getTokenTypeAt(t)))}o(t.pairs+"`")}))},FhfK:function(e,t,n){e.exports=n("VWci")},FkuW:function(e,t,n){(function(e){e(n("VrN/"))})((function(e){"use strict";e.registerGlobalHelper("fold","comment",(function(e){return e.blockCommentStart&&e.blockCommentEnd}),(function(t,n){var r=t.getModeAt(n),i=r.blockCommentStart,o=r.blockCommentEnd;if(i&&o){for(var l,a=n.line,s=t.getLine(a),c=n.ch,u=0;;){var f=c<=0?-1:s.lastIndexOf(i,c-1);if(-1!=f){if(1==u&&f<n.ch)return;if(/comment/.test(t.getTokenTypeAt(e.Pos(a,f+1)))&&(0==f||s.slice(f-o.length,f)==o||!/comment/.test(t.getTokenTypeAt(e.Pos(a,f))))){l=f+i.length;break}c=f-1}else{if(1==u)return;u=1,c=s.length}}var h,d,p=1,m=t.lastLine();e:for(var g=a;g<=m;++g)for(var v=t.getLine(g),y=g==a?l:0;;){var x=v.indexOf(i,y),b=v.indexOf(o,y);if(x<0&&(x=v.length),b<0&&(b=v.length),y=Math.min(x,b),y==v.length)break;if(y==x)++p;else if(!--p){h=g,d=y;break e}++y}if(null!=h&&(a!=h||d!=l))return{from:e.Pos(a,l),to:e.Pos(h,d)}}}))}))},SJVZ:function(e,t,n){(function(e){e(n("VrN/"))})((function(e){"use strict";function t(t,r,o,l){if(o&&o.call){var a=o;o=null}else a=i(t,o,"rangeFinder");"number"==typeof r&&(r=e.Pos(r,0));var s=i(t,o,"minFoldSize");function c(e){var n=a(t,r);if(!n||n.to.line-n.from.line<s)return null;if("fold"===l)return n;for(var i=t.findMarksAt(n.from),o=0;o<i.length;++o)if(i[o].__isFold){if(!e)return null;n.cleared=!0,i[o].clear()}return n}var u=c(!0);if(i(t,o,"scanUp"))while(!u&&r.line>t.firstLine())r=e.Pos(r.line-1,0),u=c(!1);if(u&&!u.cleared&&"unfold"!==l){var f=n(t,o,u);e.on(f,"mousedown",(function(t){h.clear(),e.e_preventDefault(t)}));var h=t.markText(u.from,u.to,{replacedWith:f,clearOnEnter:i(t,o,"clearOnEnter"),__isFold:!0});h.on("clear",(function(n,r){e.signal(t,"unfold",t,n,r)})),e.signal(t,"fold",t,u.from,u.to)}}function n(e,t,n){var r=i(e,t,"widget");if("function"==typeof r&&(r=r(n.from,n.to)),"string"==typeof r){var o=document.createTextNode(r);r=document.createElement("span"),r.appendChild(o),r.className="CodeMirror-foldmarker"}else r&&(r=r.cloneNode(!0));return r}e.newFoldFunction=function(e,n){return function(r,i){t(r,i,{rangeFinder:e,widget:n})}},e.defineExtension("foldCode",(function(e,n,r){t(this,e,n,r)})),e.defineExtension("isFolded",(function(e){for(var t=this.findMarksAt(e),n=0;n<t.length;++n)if(t[n].__isFold)return!0})),e.commands.toggleFold=function(e){e.foldCode(e.getCursor())},e.commands.fold=function(e){e.foldCode(e.getCursor(),null,"fold")},e.commands.unfold=function(e){e.foldCode(e.getCursor(),{scanUp:!1},"unfold")},e.commands.foldAll=function(t){t.operation((function(){for(var n=t.firstLine(),r=t.lastLine();n<=r;n++)t.foldCode(e.Pos(n,0),{scanUp:!1},"fold")}))},e.commands.unfoldAll=function(t){t.operation((function(){for(var n=t.firstLine(),r=t.lastLine();n<=r;n++)t.foldCode(e.Pos(n,0),{scanUp:!1},"unfold")}))},e.registerHelper("fold","combine",(function(){var e=Array.prototype.slice.call(arguments,0);return function(t,n){for(var r=0;r<e.length;++r){var i=e[r](t,n);if(i)return i}}})),e.registerHelper("fold","auto",(function(e,t){for(var n=e.getHelpers(t,"fold"),r=0;r<n.length;r++){var i=n[r](e,t);if(i)return i}}));var r={rangeFinder:e.fold.auto,widget:"\u2194",minFoldSize:0,scanUp:!1,clearOnEnter:!0};function i(e,t,n){if(t&&void 0!==t[n])return t[n];var i=e.options.foldOptions;return i&&void 0!==i[n]?i[n]:r[n]}e.defineOption("foldOptions",null),e.defineExtension("foldOption",(function(e,t){return i(this,e,t)}))}))},"VrN/":function(e,t,n){(function(t,n){e.exports=n()})(0,(function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),l=r||i||o,a=l&&(r?document.documentMode||6:+(o||i)[1]),s=!o&&/WebKit\//.test(e),c=s&&/Qt\/\d+\.\d+/.test(e),u=!o&&/Chrome\//.test(e),f=/Opera\//.test(e),h=/Apple Computer/.test(navigator.vendor),d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),m=h&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),g=/Android/.test(e),v=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=m||/Mac/.test(t),x=/\bCrOS\b/.test(e),b=/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&&(c||f&&(null==w||w<12.11)),S=n||l&&a>=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 O(e,t){return M(e).appendChild(t)}function A(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function N(e,t,n,r){var i=A(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 P(){var e;try{e=document.activeElement}catch(t){e=document.body||null}while(e&&e.shadowRoot&&e.shadowRoot.activeElement)e=e.shadowRoot.activeElement;return e}function W(e,t){var n=e.className;k(t).test(n)||(e.className+=(n?" ":"")+t)}function F(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(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var E=function(e){e.select()};function H(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function B(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 R(e,t,n,r,i){null==t&&(t=e.search(/[^\s\u00a0]/),-1==t&&(t=e.length));for(var o=r||0,l=i||0;;){var a=e.indexOf("\t",o);if(a<0||a>=t)return l+(t-o);l+=a-o,l+=n-l%n,o=a+1}}m?E=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:l&&(E=function(e){try{e.select()}catch(t){}});var I=function(){this.id=null,this.f=null,this.time=0,this.handler=H(this.onTimeout,this)};function z(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}I.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},I.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};var j=50,U={toString:function(){return"CodeMirror.Pass"}},K={scroll:!1},G={origin:"*mouse"},V={origin:"+move"};function q(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);-1==o&&(o=e.length);var l=o-r;if(o==e.length||i+l>=t)return r+Math.min(l,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var X=[""];function Y(e){while(X.length<=e)X.push($(X)+" ");return X[e]}function $(e){return e[e.length-1]}function _(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function J(e,t,n){var r=0,i=n(t);while(r<e.length&&n(e[r])<=i)r++;e.splice(r,0,t)}function Q(){}function Z(e,t){var n;return Object.create?n=Object.create(e):(Q.prototype=e,n=new Q),t&&B(t,n),n}var ee=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function te(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ee.test(e))}function ne(e,t){return t?!!(t.source.indexOf("\\w")>-1&&te(e))||t.test(e):te(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ie=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function oe(e){return e.charCodeAt(0)>=768&&ie.test(e)}function le(e,t,n){while((n<0?t>0:t<e.length)&&oe(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 se(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<n&&l.to>t||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),1==l.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var ce=null;function ue(e,t,n){var r;ce=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:ce=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:ce=i)}return null!=r?r:ce}var fe=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?t.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,l=/[Lb1n]/,a=/[1n]/;function s(e,t,n){this.level=e,this.from=t,this.to=n}return function(e,t){var c="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!r.test(e))return!1;for(var u=e.length,f=[],h=0;h<u;++h)f.push(n(e.charCodeAt(h)));for(var d=0,p=c;d<u;++d){var m=f[d];"m"==m?f[d]=p:p=m}for(var g=0,v=c;g<u;++g){var y=f[g];"1"==y&&"r"==v?f[g]="n":o.test(y)&&(v=y,"r"==y&&(f[g]="R"))}for(var x=1,b=f[0];x<u-1;++x){var w=f[x];"+"==w&&"1"==b&&"1"==f[x+1]?f[x]="1":","!=w||b!=f[x+1]||"1"!=b&&"n"!=b||(f[x]=b),b=w}for(var C=0;C<u;++C){var S=f[C];if(","==S)f[C]="N";else if("%"==S){var k=void 0;for(k=C+1;k<u&&"%"==f[k];++k);for(var L=C&&"!"==f[C-1]||k<u&&"1"==f[k]?"1":"N",T=C;T<k;++T)f[T]=L;C=k-1}}for(var M=0,O=c;M<u;++M){var A=f[M];"L"==O&&"1"==A?f[M]="L":o.test(A)&&(O=A)}for(var N=0;N<u;++N)if(i.test(f[N])){var D=void 0;for(D=N+1;D<u&&i.test(f[D]);++D);for(var P="L"==(N?f[N-1]:c),W="L"==(D<u?f[D]:c),F=P==W?P?"L":"R":c,E=N;E<D;++E)f[E]=F;N=D-1}for(var H,B=[],R=0;R<u;)if(l.test(f[R])){var I=R;for(++R;R<u&&l.test(f[R]);++R);B.push(new s(0,I,R))}else{var z=R,j=B.length,U="rtl"==t?1:0;for(++R;R<u&&"L"!=f[R];++R);for(var K=z;K<R;)if(a.test(f[K])){z<K&&(B.splice(j,0,new s(1,z,K)),j+=U);var G=K;for(++K;K<R&&a.test(f[K]);++K);B.splice(j,0,new s(2,G,K)),j+=U,z=K}else++K;z<R&&B.splice(j,0,new s(1,z,R))}return"ltr"==t&&(1==B[0].level&&(H=e.match(/^\s+/))&&(B[0].from=H[0].length,B.unshift(new s(0,0,H[0].length))),1==$(B).level&&(H=e.match(/\s+$/))&&($(B).to-=H[0].length,B.push(new s(0,u-H[0].length,u)))),"rtl"==t?B.reverse():B}}();function he(e,t){var n=e.order;return null==n&&(n=e.order=fe(e.text,t)),n}var de=[],pe=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]||de).concat(n)}};function me(e,t){return e._handlers&&e._handlers[t]||de}function ge(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=z(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function ve(e,t){var n=me(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 ye(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ve(e,n||t.type,e,t),ke(t)||t.codemirrorIgnore}function xe(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==z(n,t[r])&&n.push(t[r])}function be(e,t){return me(e,t).length>0}function we(e){e.prototype.on=function(e,t){pe(this,e,t)},e.prototype.off=function(e,t){ge(this,e,t)}}function Ce(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Se(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ke(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Le(e){Ce(e),Se(e)}function Te(e){return e.target||e.srcElement}function Me(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var Oe,Ae,Ne=function(){if(l&&a<9)return!1;var e=A("div");return"draggable"in e||"dragDrop"in e}();function De(e){if(null==Oe){var t=A("span","\u200b");O(e,A("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Oe=t.offsetWidth<=1&&t.offsetHeight>2&&!(l&&a<8))}var n=Oe?A("span","\u200b"):A("span","\xa0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Pe(e){if(null!=Ae)return Ae;var t=O(e,document.createTextNode("A\u062eA")),n=L(t,0,1).getBoundingClientRect(),r=L(t,1,2).getBoundingClientRect();return M(e),!(!n||n.left==n.right)&&(Ae=r.right-n.right<3)}var We=3!="\n\nb".split(/\n/).length?function(e){var t=0,n=[],r=e.length;while(t<=r){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(n.push(o.slice(0,l)),t+=l+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Fe=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Ee=function(){var e=A("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),He=null;function Be(e){if(null!=He)return He;var t=O(e,A("span","x")),n=t.getBoundingClientRect(),r=L(t,0,1).getBoundingClientRect();return He=Math.abs(n.left-r.left)>1}var Re={},Ie={};function ze(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Re[e]=t}function je(e,t){Ie[e]=t}function Ue(e){if("string"==typeof e&&Ie.hasOwnProperty(e))e=Ie[e];else if(e&&"string"==typeof e.name&&Ie.hasOwnProperty(e.name)){var t=Ie[e.name];"string"==typeof t&&(t={name:t}),e=Z(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ue("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ue("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ke(e,t){t=Ue(t);var n=Re[t.name];if(!n)return Ke(e,"text/plain");var r=n(e,t);if(Ge.hasOwnProperty(t.name)){var i=Ge[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}var Ge={};function Ve(e,t){var n=Ge.hasOwnProperty(e)?Ge[e]:Ge[e]={};B(t,n)}function qe(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 Xe(e,t){var n;while(e.innerMode){if(n=e.innerMode(t),!n||n.mode==e)break;t=n.state,e=n.mode}return n||{mode:e,state:t}}function Ye(e,t,n){return!e.startState||e.startState(t,n)}var $e=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function _e(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");var n=e;while(!n.lines)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function Je(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 Qe(e,t,n){var r=[];return e.iter(t,n,(function(e){r.push(e.text)})),r}function Ze(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function et(e){if(null==e.parent)return null;for(var t=e.parent,n=z(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;;++i){if(r.children[i]==t)break;n+=r.children[i].chunkSize()}return n+t.first}function tt(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var l=0;l<e.lines.length;++l){var a=e.lines[l],s=a.height;if(t<s)break;t-=s}return n+l}function nt(e,t){return t>=e.first&&t<e.first+e.size}function rt(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function it(e,t,n){if(void 0===n&&(n=null),!(this instanceof it))return new it(e,t,n);this.line=e,this.ch=t,this.sticky=n}function ot(e,t){return e.line-t.line||e.ch-t.ch}function lt(e,t){return e.sticky==t.sticky&&0==ot(e,t)}function at(e){return it(e.line,e.ch)}function st(e,t){return ot(e,t)<0?t:e}function ct(e,t){return ot(e,t)<0?e:t}function ut(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ft(e,t){if(t.line<e.first)return it(e.first,0);var n=e.first+e.size-1;return t.line>n?it(n,_e(e,n).text.length):ht(t,_e(e,t.line).text.length)}function ht(e,t){var n=e.ch;return null==n||n>t?it(e.line,t):n<0?it(e.line,0):e}function dt(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=ft(e,t[r]);return n}$e.prototype.eol=function(){return this.pos>=this.string.length},$e.prototype.sol=function(){return this.pos==this.lineStart},$e.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},$e.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},$e.prototype.eat=function(e){var t,n=this.string.charAt(this.pos);if(t="string"==typeof e?n==e:n&&(e.test?e.test(n):e(n)),t)return++this.pos,n},$e.prototype.eatWhile=function(e){var t=this.pos;while(this.eat(e));return this.pos>t},$e.prototype.eatSpace=function(){var e=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>e},$e.prototype.skipToEnd=function(){this.pos=this.string.length},$e.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},$e.prototype.backUp=function(e){this.pos-=e},$e.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=R(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?R(this.string,this.lineStart,this.tabSize):0)},$e.prototype.indentation=function(){return R(this.string,null,this.tabSize)-(this.lineStart?R(this.string,this.lineStart,this.tabSize):0)},$e.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(i(o)==i(e))return!1!==t&&(this.pos+=e.length),!0},$e.prototype.current=function(){return this.string.slice(this.start,this.pos)},$e.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},$e.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},$e.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var pt=function(e,t){this.state=e,this.lookAhead=t},mt=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 gt(e,t,n,r){var i=[e.state.modeGen],o={};Lt(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var l=n.state,a=function(r){n.baseTokens=i;var a=e.state.overlays[r],s=1,c=0;n.state=!0,Lt(e,t.text,a.mode,n,(function(e,t){var n=s;while(c<e){var r=i[s];r>e&&i.splice(s,1,e,i[s+1],r),s+=2,c=Math.min(e,r)}if(t)if(a.opaque)i.splice(n,s-n,e,"overlay "+t),s=n+2;else for(;n<s;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+t}}),o),n.state=l,n.baseTokens=null,n.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)a(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function vt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=yt(e,et(t)),i=t.text.length>e.options.maxHighlightLength&&qe(e.doc.mode,r.state),o=gt(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 yt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new mt(r,!0,t);var o=Tt(e,t,n),l=o>r.first&&_e(r,o-1).stateAfter,a=l?mt.fromSaved(r,l,o):new mt(r,Ye(r.mode),o);return r.iter(o,t,(function(n){xt(e,n.text,a);var r=a.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?a.save():null,a.nextLine()})),n&&(r.modeFrontier=a.line),a}function xt(e,t,n,r){var i=e.doc.mode,o=new $e(t,e.options.tabSize,n);o.start=o.pos=r||0,""==t&&bt(i,n.state);while(!o.eol())wt(i,o,n.state),o.start=o.pos}function bt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Xe(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function wt(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=Xe(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.")}mt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},mt.prototype.baseToken=function(e){if(!this.baseTokens)return null;while(this.baseTokens[this.baseTokenPos]<=e)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},mt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},mt.fromSaved=function(e,t,n){return t instanceof pt?new mt(e,qe(e.mode,t.state),n,t.lookAhead):new mt(e,qe(e.mode,t),n)},mt.prototype.save=function(e){var t=!1!==e?qe(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new pt(t,this.maxLookAhead):t};var Ct=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function St(e,t,n,r){var i,o=e.doc,l=o.mode;t=ft(o,t);var a,s=_e(o,t.line),c=yt(e,t.line,n),u=new $e(s.text,e.options.tabSize,c);r&&(a=[]);while((r||u.pos<t.ch)&&!u.eol())u.start=u.pos,i=wt(l,u,c.state),r&&a.push(new Ct(u,i,qe(o.mode,c.state)));return r?a:new Ct(u,i,c.state)}function kt(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 Lt(e,t,n,r,i,o,l){var a=n.flattenSpans;null==a&&(a=e.options.flattenSpans);var s,c=0,u=null,f=new $e(t,e.options.tabSize,r),h=e.options.addModeClass&&[null];""==t&&kt(bt(n,r.state),o);while(!f.eol()){if(f.pos>e.options.maxHighlightLength?(a=!1,l&&xt(e,t,r,f.pos),f.pos=t.length,s=null):s=kt(wt(n,f,r.state,h),o),h){var d=h[0].name;d&&(s="m-"+(s?d+" "+s:d))}if(!a||u!=s){while(c<f.start)c=Math.min(f.start,c+5e3),i(c,u);u=s}f.start=f.pos}while(c<f.pos){var p=Math.min(f.pos,c+5e3);i(p,u),c=p}}function Tt(e,t,n){for(var r,i,o=e.doc,l=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>l;--a){if(a<=o.first)return o.first;var s=_e(o,a-1),c=s.stateAfter;if(c&&(!n||a+(c instanceof pt?c.lookAhead:0)<=o.modeFrontier))return a;var u=R(s.text,null,e.options.tabSize);(null==i||r>u)&&(i=a-1,r=u)}return i}function Mt(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=_e(e,r).stateAfter;if(i&&(!(i instanceof pt)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var Ot=!1,At=!1;function Nt(){Ot=!0}function Dt(){At=!0}function Pt(e,t,n){this.marker=e,this.from=t,this.to=n}function Wt(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Ft(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Et(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}function Ht(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker,a=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);if(a||o.from==t&&"bookmark"==l.type&&(!n||!o.marker.insertLeft)){var s=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Pt(l,o.from,s?null:o.to))}}return r}function Bt(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker,a=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);if(a||o.from==t&&"bookmark"==l.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Pt(l,s?null:o.from-t,null==o.to?null:o.to-t))}}return r}function Rt(e,t){if(t.full)return null;var n=nt(e,t.from.line)&&_e(e,t.from.line).markedSpans,r=nt(e,t.to.line)&&_e(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,l=0==ot(t.from,t.to),a=Ht(n,i,l),s=Bt(r,o,l),c=1==t.text.length,u=$(t.text).length+(c?i:0);if(a)for(var f=0;f<a.length;++f){var h=a[f];if(null==h.to){var d=Wt(s,h.marker);d?c&&(h.to=null==d.to?null:d.to+u):h.to=i}}if(s)for(var p=0;p<s.length;++p){var m=s[p];if(null!=m.to&&(m.to+=u),null==m.from){var g=Wt(a,m.marker);g||(m.from=u,c&&(a||(a=[])).push(m))}else m.from+=u,c&&(a||(a=[])).push(m)}a&&(a=It(a)),s&&s!=a&&(s=It(s));var v=[a];if(!c){var y,x=t.text.length-2;if(x>0&&a)for(var b=0;b<a.length;++b)null==a[b].to&&(y||(y=[])).push(new Pt(a[b].marker,null,null));for(var w=0;w<x;++w)v.push(y);v.push(s)}return v}function It(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 zt(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!=z(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var l=r[o],a=l.find(0),s=0;s<i.length;++s){var c=i[s];if(!(ot(c.to,a.from)<0||ot(c.from,a.to)>0)){var u=[s,1],f=ot(c.from,a.from),h=ot(c.to,a.to);(f<0||!l.inclusiveLeft&&!f)&&u.push({from:c.from,to:a.from}),(h>0||!l.inclusiveRight&&!h)&&u.push({from:a.to,to:c.to}),i.splice.apply(i,u),s+=u.length-3}}return i}function jt(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Ut(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Kt(e){return e.inclusiveLeft?-1:0}function Gt(e){return e.inclusiveRight?1:0}function Vt(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=ot(r.from,i.from)||Kt(e)-Kt(t);if(o)return-o;var l=ot(r.to,i.to)||Gt(e)-Gt(t);return l||t.id-e.id}function qt(e,t){var n,r=At&&e.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)i=r[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!n||Vt(n,i.marker)<0)&&(n=i.marker);return n}function Xt(e){return qt(e,!0)}function Yt(e){return qt(e,!1)}function $t(e,t){var n,r=At&&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||Vt(n,o.marker)<0)&&(n=o.marker)}return n}function _t(e,t,n,r,i){var o=_e(e,t),l=At&&o.markedSpans;if(l)for(var a=0;a<l.length;++a){var s=l[a];if(s.marker.collapsed){var c=s.marker.find(0),u=ot(c.from,n)||Kt(s.marker)-Kt(i),f=ot(c.to,r)||Gt(s.marker)-Gt(i);if(!(u>=0&&f<=0||u<=0&&f>=0)&&(u<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?ot(c.to,n)>=0:ot(c.to,n)>0)||u>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?ot(c.from,r)<=0:ot(c.from,r)<0)))return!0}}}function Jt(e){var t;while(t=Xt(e))e=t.find(-1,!0).line;return e}function Qt(e){var t;while(t=Yt(e))e=t.find(1,!0).line;return e}function Zt(e){var t,n;while(t=Yt(e))e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function en(e,t){var n=_e(e,t),r=Jt(n);return n==r?t:et(r)}function tn(e,t){if(t>e.lastLine())return t;var n,r=_e(e,t);if(!nn(e,r))return t;while(n=Yt(r))r=n.find(1,!0).line;return et(r)+1}function nn(e,t){var n=At&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],r.marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&rn(e,t,r))return!0}}function rn(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return rn(e,r.line,Wt(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&rn(e,t,i))return!0}function on(e){e=Jt(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var l=0;l<o.children.length;++l){var a=o.children[l];if(a==n)break;t+=a.height}return t}function ln(e){if(0==e.height)return 0;var t,n=e.text.length,r=e;while(t=Xt(r)){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}r=e;while(t=Yt(r)){var o=t.find(0,!0);n-=r.text.length-o.from.ch,r=o.to.line,n+=r.text.length-o.to.ch}return n}function an(e){var t=e.display,n=e.doc;t.maxLine=_e(n,n.first),t.maxLineLength=ln(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=ln(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var sn=function(e,t,n){this.text=e,Ut(this,t),this.height=n?n(this):1};function cn(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),jt(e),Ut(e,n);var i=r?r(e):1;i!=e.height&&Ze(e,i)}function un(e){e.parent=null,jt(e)}sn.prototype.lineNo=function(){return et(this)},we(sn);var fn={},hn={};function dn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?hn:fn;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function pn(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,l=void 0;r.pos=0,r.addToken=gn,Pe(e.display.measure)&&(l=he(o,e.doc.direction))&&(r.addToken=yn(r.addToken,l)),r.map=[];var a=t!=e.display.externalMeasured&&et(o);bn(o,r,vt(e,o,a)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=F(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=F(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(De(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 c=r.content.lastChild;(/\bcm-tab\b/.test(c.className)||c.querySelector&&c.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return ve(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=F(r.pre.className,r.textClass||"")),r}function mn(e){var t=A("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function gn(e,t,n,r,i,o,s){if(t){var c,u=e.splitSpaces?vn(t,e.trailingSpace):t,f=e.cm.state.specialChars,h=!1;if(f.test(t)){c=document.createDocumentFragment();var d=0;while(1){f.lastIndex=d;var p=f.exec(t),m=p?p.index-d:t.length-d;if(m){var g=document.createTextNode(u.slice(d,d+m));l&&a<9?c.appendChild(A("span",[g])):c.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!p)break;d+=m+1;var v=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,x=y-e.col%y;v=c.appendChild(A("span",Y(x),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=x}else"\r"==p[0]||"\n"==p[0]?(v=c.appendChild(A("span","\r"==p[0]?"\u240d":"\u2424","cm-invalidchar")),v.setAttribute("cm-text",p[0]),e.col+=1):(v=e.cm.options.specialCharPlaceholder(p[0]),v.setAttribute("cm-text",p[0]),l&&a<9?c.appendChild(A("span",[v])):c.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),l&&a<9&&(h=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),n||r||i||h||o||s){var b=n||"";r&&(b+=r),i&&(b+=i);var w=A("span",[c],b,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(c)}}function vn(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="\xa0"),r+=o,n=" "==o}return r}function yn(e,t){return function(n,r,i,o,l,a,s){i=i?i+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var f=void 0,h=0;h<t.length;h++)if(f=t[h],f.to>c&&f.from<=c)break;if(f.to>=u)return e(n,r,i,o,l,a,s);e(n,r.slice(0,f.to-c),i,o,null,a,s),o=null,r=r.slice(f.to-c),c=f.to}}}function xn(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 bn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var l,a,s,c,u,f,h,d=i.length,p=0,m=1,g="",v=0;;){if(v==p){s=c=u=a="",h=null,f=null,v=1/0;for(var y=[],x=void 0,b=0;b<r.length;++b){var w=r[b],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,c=""),C.className&&(s+=" "+C.className),C.css&&(a=(a?a+";":"")+C.css),C.startStyle&&w.from==p&&(u+=" "+C.startStyle),C.endStyle&&w.to==v&&(x||(x=[])).push(C.endStyle,w.to),C.title&&((h||(h={})).title=C.title),C.attributes)for(var S in C.attributes)(h||(h={}))[S]=C.attributes[S];C.collapsed&&(!f||Vt(f.marker,C)<0)&&(f=w)}else w.from>p&&v>w.from&&(v=w.from)}if(x)for(var k=0;k<x.length;k+=2)x[k+1]==v&&(c+=" "+x[k]);if(!f||f.from==p)for(var L=0;L<y.length;++L)xn(t,0,y[L]);if(f&&(f.from||0)==p){if(xn(t,(null==f.to?d+1:f.to)-p,f.marker,null==f.from),null==f.to)return;f.to==p&&(f=!1)}}if(p>=d)break;var T=Math.min(d,v);while(1){if(g){var M=p+g.length;if(!f){var O=M>T?g.slice(0,T-p):g;t.addToken(t,O,l?l+s:s,u,p+O.length==v?c:"",a,h)}if(M>=T){g=g.slice(T-p),p=T;break}p=M,u=""}g=i.slice(o,o=n[m++]),l=dn(n[m++],t.cm.options)}}else for(var A=1;A<n.length;A+=2)t.addToken(t,i.slice(o,o=n[A]),dn(n[A+1],t.cm.options))}function wn(e,t,n){this.line=t,this.rest=Zt(t),this.size=this.rest?et($(this.rest))-n+1:1,this.node=this.text=null,this.hidden=nn(e,t)}function Cn(e,t,n){for(var r,i=[],o=t;o<n;o=r){var l=new wn(e.doc,_e(e.doc,o),o);r=o+l.size,i.push(l)}return i}var Sn=null;function kn(e){Sn?Sn.ops.push(e):e.ownsGroup=Sn={ops:[e],delayedCallbacks:[]}}function Ln(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)while(i.cursorActivityCalled<i.cursorActivityHandlers.length)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function Tn(e,t){var n=e.ownsGroup;if(n)try{Ln(n)}finally{Sn=null,t(n)}}var Mn=null;function On(e,t){var n=me(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);Sn?r=Sn.delayedCallbacks:Mn?r=Mn:(r=Mn=[],setTimeout(An,0));for(var o=function(e){r.push((function(){return n[e].apply(null,i)}))},l=0;l<n.length;++l)o(l)}}function An(){var e=Mn;Mn=null;for(var t=0;t<e.length;++t)e[t]()}function Nn(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?Fn(e,t):"gutter"==o?Hn(e,t,n,r):"class"==o?En(e,t):"widget"==o&&Bn(e,t,r)}t.changes=null}function Dn(e){return e.node==e.text&&(e.node=A("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),l&&a<8&&(e.node.style.zIndex=2)),e.node}function Pn(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=Dn(t);t.background=r.insertBefore(A("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Wn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):pn(e,t)}function Fn(e,t){var n=t.text.className,r=Wn(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,En(e,t)):n&&(t.text.className=n)}function En(e,t){Pn(e,t),t.line.wrapClass?Dn(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 Hn(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=Dn(t);t.gutterBackground=A("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var l=Dn(t),a=t.gutter=A("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(a.setAttribute("aria-hidden","true"),e.display.input.setUneditable(a),l.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(A("div",rt(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.display.gutterSpecs.length;++s){var c=e.display.gutterSpecs[s].className,u=o.hasOwnProperty(c)&&o[c];u&&a.appendChild(A("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function Bn(e,t,n){t.alignable&&(t.alignable=null);for(var r=k("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);In(e,t,n)}function Rn(e,t,n,r){var i=Wn(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),En(e,t),Hn(e,t,n,r),In(e,t,r),t.node}function In(e,t,n){if(zn(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)zn(e,t.rest[r],t,n,!1)}function zn(e,t,n,r,i){if(t.widgets)for(var o=Dn(n),l=0,a=t.widgets;l<a.length;++l){var s=a[l],c=A("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),jn(s,c,n,r),e.display.input.setUneditable(c),i&&s.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),On(s,"redraw")}}function jn(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 Un(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;"),O(t.display.measure,A("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Kn(e,t){for(var n=Te(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 Gn(e){return e.lineSpace.offsetTop}function Vn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function qn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=O(e.measure,A("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Xn(e){return j-e.display.nativeBarWidth}function Yn(e){return e.display.scroller.clientWidth-Xn(e)-e.display.barWidth}function $n(e){return e.display.scroller.clientHeight-Xn(e)-e.display.barHeight}function _n(e,t,n){var r=e.options.lineWrapping,i=r&&Yn(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var l=t.text.firstChild.getClientRects(),a=0;a<l.length-1;a++){var s=l[a],c=l[a+1];Math.abs(s.bottom-c.bottom)>2&&o.push((s.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Jn(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(et(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Qn(e,t){t=Jt(t);var n=et(t),r=e.display.externalMeasured=new wn(e.doc,t,n);r.lineN=n;var i=r.built=pn(e,r);return r.text=i.pre,O(e.display.lineMeasure,i.pre),r}function Zn(e,t,n,r){return nr(e,tr(e,t),n,r)}function er(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Er(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function tr(e,t){var n=et(t),r=er(e,n);r&&!r.text?r=null:r&&r.changes&&(Nn(e,r,n,Nr(e)),e.curOp.forceUpdate=!0),r||(r=Qn(e,t));var i=Jn(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function nr(e,t,n,r,i){t.before&&(n=-1);var o,l=n+(r||"");return t.cache.hasOwnProperty(l)?o=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(_n(e,t.view,t.rect),t.hasHeights=!0),o=ar(e,t,n,r),o.bogus||(t.cache[l]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var rr,ir={left:0,right:0,top:0,bottom:0};function or(e,t,n){for(var r,i,o,l,a,s,c=0;c<e.length;c+=3)if(a=e[c],s=e[c+1],t<a?(i=0,o=1,l="left"):t<s?(i=t-a,o=i+1):(c==e.length-3||t==s&&e[c+3]>t)&&(o=s-a,i=o-1,t>=s&&(l="right")),null!=i){if(r=e[c+2],a==s&&n==(r.insertLeft?"left":"right")&&(l=n),"left"==n&&0==i)while(c&&e[c-2]==e[c-3]&&e[c-1].insertLeft)r=e[2+(c-=3)],l="left";if("right"==n&&i==s-a)while(c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft)r=e[(c+=3)+2],l="right";break}return{node:r,start:i,end:o,collapse:l,coverStart:a,coverEnd:s}}function lr(e,t){var n=ir;if("left"==t){for(var r=0;r<e.length;r++)if((n=e[r]).left!=n.right)break}else for(var i=e.length-1;i>=0;i--)if((n=e[i]).left!=n.right)break;return n}function ar(e,t,n,r){var i,o=or(t.map,n,r),s=o.node,c=o.start,u=o.end,f=o.collapse;if(3==s.nodeType){for(var h=0;h<4;h++){while(c&&oe(t.line.text.charAt(o.coverStart+c)))--c;while(o.coverStart+u<o.coverEnd&&oe(t.line.text.charAt(o.coverStart+u)))++u;if(i=l&&a<9&&0==c&&u==o.coverEnd-o.coverStart?s.parentNode.getBoundingClientRect():lr(L(s,c,u).getClientRects(),r),i.left||i.right||0==c)break;u=c,c-=1,f="right"}l&&a<11&&(i=sr(e.display.measure,i))}else{var d;c>0&&(f=r="right"),i=e.options.lineWrapping&&(d=s.getClientRects()).length>1?d["right"==r?d.length-1:0]:s.getBoundingClientRect()}if(l&&a<9&&!c&&(!i||!i.left&&!i.right)){var p=s.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+Ar(e.display),top:p.top,bottom:p.bottom}:ir}for(var m=i.top-t.rect.top,g=i.bottom-t.rect.top,v=(m+g)/2,y=t.view.measure.heights,x=0;x<y.length-1;x++)if(v<y[x])break;var b=x?y[x-1]:0,w=y[x],C={left:("right"==f?i.right:i.left)-t.rect.left,right:("left"==f?i.left:i.right)-t.rect.left,top:b,bottom:w};return i.left||i.right||(C.bogus=!0),e.options.singleCursorHeightPerLine||(C.rtop=m,C.rbottom=g),C}function sr(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Be(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function cr(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 ur(e){e.display.externalMeasure=null,M(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)cr(e.display.view[t])}function fr(e){ur(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function hr(){return u&&g?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function dr(){return u&&g?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function pr(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=Un(e.widgets[n]));return t}function mr(e,t,n,r,i){if(!i){var o=pr(t);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var l=on(t);if("local"==r?l+=Gn(e.display):l-=e.display.viewOffset,"page"==r||"window"==r){var a=e.display.lineSpace.getBoundingClientRect();l+=a.top+("window"==r?0:dr());var s=a.left+("window"==r?0:hr());n.left+=s,n.right+=s}return n.top+=l,n.bottom+=l,n}function gr(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=hr(),i-=dr();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:r-l.left,top:i-l.top}}function vr(e,t,n,r,i){return r||(r=_e(e.doc,t.line)),mr(e,r,Zn(e,r,t.ch,i),n)}function yr(e,t,n,r,i,o){function l(t,l){var a=nr(e,i,t,l?"right":"left",o);return l?a.left=a.right:a.right=a.left,mr(e,r,a,n)}r=r||_e(e.doc,t.line),i||(i=tr(e,r));var a=he(r,e.doc.direction),s=t.ch,c=t.sticky;if(s>=r.text.length?(s=r.text.length,c="before"):s<=0&&(s=0,c="after"),!a)return l("before"==c?s-1:s,"before"==c);function u(e,t,n){var r=a[t],i=1==r.level;return l(n?e-1:e,i!=n)}var f=ue(a,s,c),h=ce,d=u(s,f,"before"==c);return null!=h&&(d.other=u(s,h,"before"!=c)),d}function xr(e,t){var n=0;t=ft(e.doc,t),e.options.lineWrapping||(n=Ar(e.display)*t.ch);var r=_e(e.doc,t.line),i=on(r)+Gn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function br(e,t,n,r,i){var o=it(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function wr(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return br(r.first,0,null,-1,-1);var i=tt(r,n),o=r.first+r.size-1;if(i>o)return br(r.first+r.size-1,_e(r,o).text.length,null,1,1);t<0&&(t=0);for(var l=_e(r,i);;){var a=Lr(e,l,i,t,n),s=$t(l,a.ch+(a.xRel>0||a.outside>0?1:0));if(!s)return a;var c=s.find(1);if(c.line==i)return c;l=_e(r,i=c.line)}}function Cr(e,t,n,r){r-=pr(t);var i=t.text.length,o=ae((function(t){return nr(e,n,t-1).bottom<=r}),i,0);return i=ae((function(t){return nr(e,n,t).top>r}),o,i),{begin:o,end:i}}function Sr(e,t,n,r){n||(n=tr(e,t));var i=mr(e,t,nr(e,n,r),"line").top;return Cr(e,t,n,i)}function kr(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function Lr(e,t,n,r,i){i-=on(t);var o=tr(e,t),l=pr(t),a=0,s=t.text.length,c=!0,u=he(t,e.doc.direction);if(u){var f=(e.options.lineWrapping?Mr:Tr)(e,t,n,o,u,r,i);c=1!=f.level,a=c?f.from:f.to-1,s=c?f.to:f.from-1}var h,d,p=null,m=null,g=ae((function(t){var n=nr(e,o,t);return n.top+=l,n.bottom+=l,!!kr(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=t,m=n),!0)}),a,s),v=!1;if(m){var y=r-m.left<m.right-r,x=y==c;g=p+(x?0:1),d=x?"after":"before",h=y?m.left:m.right}else{c||g!=s&&g!=a||g++,d=0==g?"after":g==t.text.length?"before":nr(e,o,g-(c?1:0)).bottom+l<=i==c?"after":"before";var b=yr(e,it(n,g,d),"line",t,o);h=b.left,v=i<b.top?-1:i>=b.bottom?1:0}return g=le(t.text,g,1),br(n,g,d,v,r-h)}function Tr(e,t,n,r,i,o,l){var a=ae((function(a){var s=i[a],c=1!=s.level;return kr(yr(e,it(n,c?s.to:s.from,c?"before":"after"),"line",t,r),o,l,!0)}),0,i.length-1),s=i[a];if(a>0){var c=1!=s.level,u=yr(e,it(n,c?s.from:s.to,c?"after":"before"),"line",t,r);kr(u,o,l,!0)&&u.top>l&&(s=i[a-1])}return s}function Mr(e,t,n,r,i,o,l){var a=Cr(e,t,r,l),s=a.begin,c=a.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,f=null,h=0;h<i.length;h++){var d=i[h];if(!(d.from>=c||d.to<=s)){var p=1!=d.level,m=nr(e,r,p?Math.min(c,d.to)-1:Math.max(s,d.from)).right,g=m<o?o-m+1e9:m-o;(!u||f>g)&&(u=d,f=g)}}return u||(u=i[i.length-1]),u.from<s&&(u={from:s,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function Or(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==rr){rr=A("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)rr.appendChild(document.createTextNode("x")),rr.appendChild(A("br"));rr.appendChild(document.createTextNode("x"))}O(e.measure,rr);var n=rr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),M(e.measure),n||1}function Ar(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=A("span","xxxxxxxxxx"),n=A("pre",[t],"CodeMirror-line-like");O(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,l=0;o;o=o.nextSibling,++l){var a=e.display.gutterSpecs[l].className;n[a]=o.offsetLeft+o.clientLeft+i,r[a]=o.clientWidth}return{fixedPos:Dr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Dr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Pr(e){var t=Or(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Ar(e.display)-3);return function(i){if(nn(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l<i.widgets.length;l++)i.widgets[l].height&&(o+=i.widgets[l].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function Wr(e){var t=e.doc,n=Pr(e);t.iter((function(e){var t=n(e);t!=e.height&&Ze(e,t)}))}function Fr(e,t,n,r){var i=e.display;if(!n&&"true"==Te(t).getAttribute("cm-not-content"))return null;var o,l,a=i.lineSpace.getBoundingClientRect();try{o=t.clientX-a.left,l=t.clientY-a.top}catch(f){return null}var s,c=wr(e,o,l);if(r&&c.xRel>0&&(s=_e(e.doc,c.line).text).length==c.ch){var u=R(s,s.length,e.options.tabSize)-s.length;c=it(c.line,Math.max(0,Math.round((o-qn(e.display).left)/Ar(e.display))-u))}return c}function Er(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function Hr(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)At&&en(e.doc,t)<i.viewTo&&Rr(e);else if(n<=i.viewFrom)At&&tn(e.doc,n+r)>i.viewFrom?Rr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Rr(e);else if(t<=i.viewFrom){var o=Ir(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Rr(e)}else if(n>=i.viewTo){var l=Ir(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):Rr(e)}else{var a=Ir(e,t,t,-1),s=Ir(e,n,n+r,1);a&&s?(i.view=i.view.slice(0,a.index).concat(Cn(e,a.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):Rr(e)}var c=i.externalMeasured;c&&(n<c.lineN?c.lineN+=r:t<c.lineN+c.size&&(i.externalMeasured=null))}function Br(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[Er(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==z(l,n)&&l.push(n)}}}function Rr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ir(e,t,n,r){var i,o=Er(e,t),l=e.display.view;if(!At||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var a=e.display.viewFrom,s=0;s<o;s++)a+=l[s].size;if(a!=t){if(r>0){if(o==l.length-1)return null;i=a+l[o].size-t,o++}else i=a-t;t+=i,n+=i}while(en(e.doc,n)!=n){if(o==(r<0?0:l.length-1))return null;n+=r*l[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function zr(e,t,n){var r=e.display,i=r.view;0==i.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Cn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Cn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Er(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(Cn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Er(e,n)))),r.viewTo=n}function jr(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 Ur(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Kr(e,t){void 0===t&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),l=0;l<n.sel.ranges.length;l++)if(t||l!=n.sel.primIndex){var a=n.sel.ranges[l];if(!(a.from().line>=e.display.viewTo||a.to().line<e.display.viewFrom)){var s=a.empty();(s||e.options.showCursorWhenSelecting)&&Gr(e,a.head,i),s||qr(e,a,o)}}return r}function Gr(e,t,n){var r=yr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(A("div","\xa0","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var o=vr(e,t,"div",null,null);i.style.width=Math.max(0,o.right-o.left)+"px"}if(r.other){var l=n.appendChild(A("div","\xa0","CodeMirror-cursor CodeMirror-secondarycursor"));l.style.display="",l.style.left=r.other.left+"px",l.style.top=r.other.top+"px",l.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function Vr(e,t){return e.top-t.top||e.left-t.left}function qr(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),l=qn(e.display),a=l.left,s=Math.max(r.sizerWidth,Yn(e)-r.sizer.offsetLeft)-l.right,c="ltr"==i.direction;function u(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),o.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n                             top: "+t+"px; width: "+(null==n?s-e:n)+"px;\n                             height: "+(r-t)+"px"))}function f(t,n,r){var o,l,f=_e(i,t),h=f.text.length;function d(n,r){return vr(e,it(t,n),"div",f,r)}function p(t,n,r){var i=Sr(e,f,null,t),o="ltr"==n==("after"==r)?"left":"right",l="after"==r?i.begin:i.end-(/\s/.test(f.text.charAt(i.end-1))?2:1);return d(l,o)[o]}var m=he(f,i.direction);return se(m,n||0,null==r?h:r,(function(e,t,i,f){var g="ltr"==i,v=d(e,g?"left":"right"),y=d(t-1,g?"right":"left"),x=null==n&&0==e,b=null==r&&t==h,w=0==f,C=!m||f==m.length-1;if(y.top-v.top<=3){var S=(c?x:b)&&w,k=(c?b:x)&&C,L=S?a:(g?v:y).left,T=k?s:(g?y:v).right;u(L,v.top,T-L,v.bottom)}else{var M,O,A,N;g?(M=c&&x&&w?a:v.left,O=c?s:p(e,i,"before"),A=c?a:p(t,i,"after"),N=c&&b&&C?s:y.right):(M=c?p(e,i,"before"):a,O=!c&&x&&w?s:v.right,A=!c&&b&&C?a:y.left,N=c?p(t,i,"after"):s),u(M,v.top,O-M,v.bottom),v.bottom<y.top&&u(a,v.bottom,null,y.top),u(A,y.top,N-A,y.bottom)}(!o||Vr(v,o)<0)&&(o=v),Vr(y,o)<0&&(o=y),(!l||Vr(v,l)<0)&&(l=v),Vr(y,l)<0&&(l=y)})),{start:o,end:l}}var h=t.from(),d=t.to();if(h.line==d.line)f(h.line,h.ch,d.ch);else{var p=_e(i,h.line),m=_e(i,d.line),g=Jt(p)==Jt(m),v=f(h.line,h.ch,g?p.text.length+1:null).end,y=f(d.line,g?0:null,d.ch).start;g&&(v.top<y.top-2?(u(v.right,v.top,null,v.bottom),u(a,y.top,y.left,y.bottom)):u(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&u(a,v.bottom,null,y.top)}n.appendChild(o)}function Xr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){e.hasFocus()||Jr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Yr(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||_r(e))}function $r(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Jr(e))}),100)}function _r(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ve(e,"focus",e,t),e.state.focused=!0,W(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()),Xr(e))}function Jr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ve(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 Qr(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,c=0;if(!i.hidden){if(l&&a<8){var u=i.node.offsetTop+i.node.offsetHeight;s=u-n,n=u}else{var f=i.node.getBoundingClientRect();s=f.bottom-f.top,!o&&i.text.firstChild&&(c=i.text.firstChild.getBoundingClientRect().right-f.left-1)}var h=i.line.height-s;if((h>.005||h<-.005)&&(Ze(i.line,s),Zr(i.line),i.rest))for(var d=0;d<i.rest.length;d++)Zr(i.rest[d]);if(c>e.display.sizerWidth){var p=Math.ceil(c/Ar(e.display));p>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function Zr(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 ei(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Gn(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=tt(t,r),l=tt(t,i);if(n&&n.ensure){var a=n.ensure.from.line,s=n.ensure.to.line;a<o?(o=a,l=tt(t,on(_e(t,a))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=l&&(o=tt(t,on(_e(t,s))-e.wrapper.clientHeight),l=s)}return{from:o,to:Math.max(l,o+1)}}function ti(e,t){if(!ye(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=A("div","\u200b",null,"position: absolute;\n                         top: "+(t.top-n.viewOffset-Gn(e.display))+"px;\n                         height: "+(t.bottom-t.top+Xn(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)}}}function ni(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==t.sticky?it(t.line,t.ch+1,"before"):t,t=t.ch?it(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var l=!1,a=yr(e,t),s=n&&n!=t?yr(e,n):a;i={left:Math.min(a.left,s.left),top:Math.min(a.top,s.top)-r,right:Math.max(a.left,s.left),bottom:Math.max(a.bottom,s.bottom)+r};var c=ii(e,i),u=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=c.scrollTop&&(fi(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(l=!0)),null!=c.scrollLeft&&(di(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(l=!0)),!l)break}return i}function ri(e,t){var n=ii(e,t);null!=n.scrollTop&&fi(e,n.scrollTop),null!=n.scrollLeft&&di(e,n.scrollLeft)}function ii(e,t){var n=e.display,r=Or(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=$n(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var a=e.doc.height+Vn(n),s=t.top<r,c=t.bottom>a-r;if(t.top<i)l.scrollTop=s?0:t.top;else if(t.bottom>i+o){var u=Math.min(t.top,(c?a:t.bottom)-o);u!=i&&(l.scrollTop=u)}var f=e.options.fixedGutter?0:n.gutters.offsetWidth,h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-f,d=Yn(e)-n.gutters.offsetWidth,p=t.right-t.left>d;return p&&(t.right=t.left+d),t.left<10?l.scrollLeft=0:t.left<h?l.scrollLeft=Math.max(0,t.left+f-(p?0:10)):t.right>d+h-3&&(l.scrollLeft=t.right+(p?0:10)-d),l}function oi(e,t){null!=t&&(ci(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function li(e){ci(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ai(e,t,n){null==t&&null==n||ci(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function si(e,t){ci(e),e.curOp.scrollToPos=t}function ci(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=xr(e,t.from),r=xr(e,t.to);ui(e,n,r,t.margin)}}function ui(e,t,n,r){var i=ii(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});ai(e,i.scrollLeft,i.scrollTop)}function fi(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||Ui(e,{top:t}),hi(e,t,!0),n&&Ui(e),Fi(e,100))}function hi(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function di(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,qi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function pi(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Vn(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+Xn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var mi=function(e,t,n){this.cm=n;var r=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),pe(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),pe(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,l&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};mi.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}},mi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},mi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},mi.prototype.zeroWidthHack=function(){var e=y&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new I,this.disableVert=new I},mi.prototype.enableZeroWidthBar=function(e,t,n){function r(){var i=e.getBoundingClientRect(),o="vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",t.set(1e3,r)},mi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var gi=function(){};function vi(e,t){t||(t=pi(e));var n=e.display.barWidth,r=e.display.barHeight;yi(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Qr(e),yi(e,pi(e)),n=e.display.barWidth,r=e.display.barHeight}function yi(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=""}gi.prototype.update=function(){return{bottom:0,right:0}},gi.prototype.setScrollLeft=function(){},gi.prototype.setScrollTop=function(){},gi.prototype.clear=function(){};var xi={native:mi,null:gi};function bi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&T(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new xi[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),pe(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?di(e,t):fi(e,t)}),e),e.display.scrollbars.addClass&&W(e.display.wrapper,e.display.scrollbars.addClass)}var wi=0;function Ci(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++wi,markArrays:null},kn(e.curOp)}function Si(e){var t=e.curOp;t&&Tn(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;ki(e)}))}function ki(e){for(var t=e.ops,n=0;n<t.length;n++)Li(t[n]);for(var r=0;r<t.length;r++)Ti(t[r]);for(var i=0;i<t.length;i++)Mi(t[i]);for(var o=0;o<t.length;o++)Oi(t[o]);for(var l=0;l<t.length;l++)Ai(t[l])}function Li(e){var t=e.cm,n=t.display;Bi(t),e.updateMaxLine&&an(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 Hi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Ti(e){e.updatedDisplay=e.mustUpdate&&zi(e.cm,e.update)}function Mi(e){var t=e.cm,n=t.display;e.updatedDisplay&&Qr(t),e.barMeasure=pi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Zn(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+Xn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Yn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Oi(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&di(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==P();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&vi(t,e.barMeasure),e.updatedDisplay&&Vi(t,e.barMeasure),e.selectionChanged&&Xr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Yr(e.cm)}function Ai(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&ji(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&hi(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&di(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=ni(t,ft(r,e.scrollToPos.from),ft(r,e.scrollToPos.to),e.scrollToPos.margin);ti(t,i)}var o=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(o)for(var a=0;a<o.length;++a)o[a].lines.length||ve(o[a],"hide");if(l)for(var s=0;s<l.length;++s)l[s].lines.length&&ve(l[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ve(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Ni(e,t){if(e.curOp)return t();Ci(e);try{return t()}finally{Si(e)}}function Di(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Ci(e);try{return t.apply(e,arguments)}finally{Si(e)}}}function Pi(e){return function(){if(this.curOp)return e.apply(this,arguments);Ci(this);try{return e.apply(this,arguments)}finally{Si(this)}}}function Wi(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Ci(t);try{return e.apply(this,arguments)}finally{Si(t)}}}function Fi(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,H(Ei,e))}function Ei(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=yt(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var l=o.styles,a=o.text.length>e.options.maxHighlightLength?qe(t.mode,r.state):null,s=gt(e,o,r,!0);a&&(r.state=a),o.styles=s.styles;var c=o.styleClasses,u=s.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var f=!l||l.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),h=0;!f&&h<l.length;++h)f=l[h]!=o.styles[h];f&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&xt(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return Fi(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Ni(e,(function(){for(var t=0;t<i.length;t++)Br(e,i[t],"text")}))}}var Hi=function(e,t,n){var r=e.display;this.viewport=t,this.visible=ei(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Yn(e),this.force=n,this.dims=Nr(e),this.events=[]};function Bi(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Xn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Xn(e)+"px",t.scrollbarsClipped=!0)}function Ri(e){if(e.hasFocus())return null;var t=P();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}function Ii(e){if(e&&e.activeElt&&e.activeElt!=P()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&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)}}function zi(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return Rr(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==jr(e))return!1;Xi(e)&&(Rr(e),t.dims=Nr(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>l&&n.viewTo-l<20&&(l=Math.min(i,n.viewTo)),At&&(o=en(e.doc,o),l=tn(e.doc,l));var a=o!=n.viewFrom||l!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;zr(e,o,l),n.viewOffset=on(_e(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=jr(e);if(!a&&0==s&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Ri(e);return s>4&&(n.lineDiv.style.display="none"),Ki(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Ii(c),M(n.cursorDiv),M(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Fi(e,400)),n.updateLineNumbers=null,!0}function ji(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Yn(e))r&&(t.visible=ei(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Vn(e.display)-$n(e),n.top)}),t.visible=ei(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!zi(e,t))break;Qr(e);var i=pi(e);Ur(e),vi(e,i),Vi(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 Ui(e,t){var n=new Hi(e,t);if(zi(e,n)){Qr(e),ji(e,n);var r=pi(e);Ur(e),vi(e,r),Vi(e,r),n.finish()}}function Ki(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,l=o.firstChild;function a(t){var n=t.nextSibling;return s&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var c=r.view,u=r.viewFrom,f=0;f<c.length;f++){var h=c[f];if(h.hidden);else if(h.node&&h.node.parentNode==o){while(l!=h.node)l=a(l);var d=i&&null!=t&&t<=u&&h.lineNumber;h.changes&&(z(h.changes,"gutter")>-1&&(d=!1),Nn(e,h,u,n)),d&&(M(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(rt(e.options,u)))),l=h.node.nextSibling}else{var p=Rn(e,h,u,n);o.insertBefore(p,l)}u+=h.size}while(l)l=a(l)}function Gi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",On(e,"gutterChanged",e)}function Vi(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+Xn(e)+"px"}function qi(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=Dr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",l=0;l<n.length;l++)if(!n[l].hidden){e.options.fixedGutter&&(n[l].gutter&&(n[l].gutter.style.left=o),n[l].gutterBackground&&(n[l].gutterBackground.style.left=o));var a=n[l].alignable;if(a)for(var s=0;s<a.length;s++)a[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function Xi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=rt(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(A("div",[A("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,l=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-l)+1,r.lineNumWidth=r.lineNumInnerWidth+l,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Gi(e.display),!0}return!1}function Yi(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var o=e[i],l=null;if("string"!=typeof o&&(l=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;r=!0}n.push({className:o,style:l})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function $i(e){var t=e.gutters,n=e.gutterSpecs;M(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,l=i.style,a=t.appendChild(A("div",null,"CodeMirror-gutter "+o));l&&(a.style.cssText=l),"CodeMirror-linenumbers"==o&&(e.lineGutter=a,a.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Gi(e)}function _i(e){$i(e.display),Hr(e),qi(e)}function Ji(e,t,r,i){var o=this;this.input=r,o.scrollbarFiller=A("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=A("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=N("div",null,"CodeMirror-code"),o.selectionDiv=A("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=A("div",null,"CodeMirror-cursors"),o.measure=A("div",null,"CodeMirror-measure"),o.lineMeasure=A("div",null,"CodeMirror-measure"),o.lineSpace=N("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var c=N("div",[o.lineSpace],"CodeMirror-lines");o.mover=A("div",[c],null,"position: relative"),o.sizer=A("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=A("div",null,null,"position: absolute; height: "+j+"px; width: 1px;"),o.gutters=A("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=A("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=A("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),o.wrapper.setAttribute("translate","no"),l&&a<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),s||n&&v||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=Yi(i.gutters,i.lineNumbers),$i(o),r.init(o)}Hi.prototype.signal=function(e,t){be(e,t)&&this.events.push(arguments)},Hi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ve.apply(null,this.events[e])};var Qi=0,Zi=null;function eo(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 to(e){var t=eo(e);return t.x*=Zi,t.y*=Zi,t}function no(e,t){var r=eo(t),i=r.x,o=r.y,l=e.display,a=l.scroller,c=a.scrollWidth>a.clientWidth,u=a.scrollHeight>a.clientHeight;if(i&&c||o&&u){if(o&&y&&s)e:for(var h=t.target,d=l.view;h!=a;h=h.parentNode)for(var p=0;p<d.length;p++)if(d[p].node==h){e.display.currentWheelTarget=h;break e}if(i&&!n&&!f&&null!=Zi)return o&&u&&fi(e,Math.max(0,a.scrollTop+o*Zi)),di(e,Math.max(0,a.scrollLeft+i*Zi)),(!o||o&&u)&&Ce(t),void(l.wheelStartX=null);if(o&&null!=Zi){var m=o*Zi,g=e.doc.scrollTop,v=g+l.wrapper.clientHeight;m<0?g=Math.max(0,g+m-50):v=Math.min(e.doc.height,v+m+50),Ui(e,{top:g,bottom:v})}Qi<20&&(null==l.wheelStartX?(l.wheelStartX=a.scrollLeft,l.wheelStartY=a.scrollTop,l.wheelDX=i,l.wheelDY=o,setTimeout((function(){if(null!=l.wheelStartX){var e=a.scrollLeft-l.wheelStartX,t=a.scrollTop-l.wheelStartY,n=t&&l.wheelDY&&t/l.wheelDY||e&&l.wheelDX&&e/l.wheelDX;l.wheelStartX=l.wheelStartY=null,n&&(Zi=(Zi*Qi+n)/(Qi+1),++Qi)}}),200)):(l.wheelDX+=i,l.wheelDY+=o))}}l?Zi=-.53:n?Zi=15:u?Zi=-.7:h&&(Zi=-1/3);var ro=function(e,t){this.ranges=e,this.primIndex=t};ro.prototype.primary=function(){return this.ranges[this.primIndex]},ro.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(!lt(n.anchor,r.anchor)||!lt(n.head,r.head))return!1}return!0},ro.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new io(at(this.ranges[t].anchor),at(this.ranges[t].head));return new ro(e,this.primIndex)},ro.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},ro.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(ot(t,r.from())>=0&&ot(e,r.to())<=0)return n}return-1};var io=function(e,t){this.anchor=e,this.head=t};function oo(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return ot(e.from(),t.from())})),n=z(t,i);for(var o=1;o<t.length;o++){var l=t[o],a=t[o-1],s=ot(a.to(),l.from());if(r&&!l.empty()?s>0:s>=0){var c=ct(a.from(),l.from()),u=st(a.to(),l.to()),f=a.empty()?l.from()==l.head:a.from()==a.head;o<=n&&--n,t.splice(--o,2,new io(f?u:c,f?c:u))}}return new ro(t,n)}function lo(e,t){return new ro([new io(e,t||e)],0)}function ao(e){return e.text?it(e.from.line+e.text.length-1,$(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function so(e,t){if(ot(e,t.from)<0)return e;if(ot(e,t.to)<=0)return ao(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+=ao(t).ch-t.to.ch),it(n,r)}function co(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new io(so(i.anchor,t),so(i.head,t)))}return oo(e.cm,n,e.sel.primIndex)}function uo(e,t,n){return e.line==t.line?it(n.line,e.ch-t.ch+n.ch):it(n.line+(e.line-t.line),e.ch)}function fo(e,t,n){for(var r=[],i=it(e.first,0),o=i,l=0;l<t.length;l++){var a=t[l],s=uo(a.from,i,o),c=uo(ao(a),i,o);if(i=a.to,o=c,"around"==n){var u=e.sel.ranges[l],f=ot(u.head,u.anchor)<0;r[l]=new io(f?c:s,f?s:c)}else r[l]=new io(s,s)}return new ro(r,e.sel.primIndex)}function ho(e){e.doc.mode=Ke(e.options,e.doc.modeOption),po(e)}function po(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,Fi(e,100),e.state.modeGen++,e.curOp&&Hr(e)}function mo(e,t){return 0==t.from.ch&&0==t.to.ch&&""==$(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function go(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){cn(e,n,i,r),On(e,"change",e,t)}function l(e,t){for(var n=[],o=e;o<t;++o)n.push(new sn(c[o],i(o),r));return n}var a=t.from,s=t.to,c=t.text,u=_e(e,a.line),f=_e(e,s.line),h=$(c),d=i(c.length-1),p=s.line-a.line;if(t.full)e.insert(0,l(0,c.length)),e.remove(c.length,e.size-c.length);else if(mo(e,t)){var m=l(0,c.length-1);o(f,f.text,d),p&&e.remove(a.line,p),m.length&&e.insert(a.line,m)}else if(u==f)if(1==c.length)o(u,u.text.slice(0,a.ch)+h+u.text.slice(s.ch),d);else{var g=l(1,c.length-1);g.push(new sn(h+u.text.slice(s.ch),d,r)),o(u,u.text.slice(0,a.ch)+c[0],i(0)),e.insert(a.line+1,g)}else if(1==c.length)o(u,u.text.slice(0,a.ch)+c[0]+f.text.slice(s.ch),i(0)),e.remove(a.line+1,p);else{o(u,u.text.slice(0,a.ch)+c[0],i(0)),o(f,h+f.text.slice(s.ch),d);var v=l(1,c.length-1);p>1&&e.remove(a.line+1,p-1),e.insert(a.line+1,v)}On(e,"change",e,t)}function vo(e,t,n){function r(e,i,o){if(e.linked)for(var l=0;l<e.linked.length;++l){var a=e.linked[l];if(a.doc!=i){var s=o&&a.sharedHist;n&&!s||(t(a.doc,s),r(a.doc,e,s))}}}r(e,null,!0)}function yo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Wr(e),ho(e),xo(e),e.options.direction=t.direction,e.options.lineWrapping||an(e),e.options.mode=t.modeOption,Hr(e)}function xo(e){("rtl"==e.doc.direction?W:T)(e.display.lineDiv,"CodeMirror-rtl")}function bo(e){Ni(e,(function(){xo(e),Hr(e)}))}function wo(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function Co(e,t){var n={from:at(t.from),to:ao(t),text:Je(e,t.from,t.to)};return Ao(e,n,t.from.line,t.to.line+1),vo(e,(function(e){return Ao(e,n,t.from.line,t.to.line+1)}),!0),n}function So(e){while(e.length){var t=$(e);if(!t.ranges)break;e.pop()}}function ko(e,t){return t?(So(e.done),$(e.done)):e.done.length&&!$(e.done).ranges?$(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),$(e.done)):void 0}function Lo(e,t,n,r){var i=e.history;i.undone.length=0;var o,l,a=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=ko(i,i.lastOp==r)))l=$(o.changes),0==ot(t.from,t.to)&&0==ot(t.from,l.to)?l.to=ao(t):o.changes.push(Co(e,t));else{var s=$(i.done);s&&s.ranges||Oo(e.sel,i.done),o={changes:[Co(e,t)],generation:i.generation},i.done.push(o);while(i.done.length>i.undoDepth)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||ve(e,"historyAdded")}function To(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Mo(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||To(e,o,$(i.done),t))?i.done[i.done.length-1]=t:Oo(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&So(i.undone)}function Oo(e,t){var n=$(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Ao(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 No(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 Do(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(No(n[i]));return r}function Po(e,t){var n=Do(e,t),r=Rt(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],l=r[i];if(o&&l)e:for(var a=0;a<l.length;++a){for(var s=l[a],c=0;c<o.length;++c)if(o[c].marker==s.marker)continue e;o.push(s)}else l&&(n[i]=l)}return n}function Wo(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)r.push(n?ro.prototype.deepCopy.call(o):o);else{var l=o.changes,a=[];r.push({changes:a});for(var s=0;s<l.length;++s){var c=l[s],u=void 0;if(a.push({from:c.from,to:c.to,text:c.text}),t)for(var f in c)(u=f.match(/^spans_(\d+)$/))&&z(t,Number(u[1]))>-1&&($(a)[f]=c[f],delete c[f])}}}return r}function Fo(e,t,n,r){if(r){var i=e.anchor;if(n){var o=ot(t,i)<0;o!=ot(n,i)<0?(i=t,t=n):o!=ot(t,n)<0&&(t=n)}return new io(i,t)}return new io(n||t,t)}function Eo(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),jo(e,new ro([Fo(e.sel.primary(),t,n,i)],0),r)}function Ho(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]=Fo(e.sel.ranges[o],t[o],null,i);var l=oo(e.cm,r,e.sel.primIndex);jo(e,l,n)}function Bo(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,jo(e,oo(e.cm,i,e.sel.primIndex),r)}function Ro(e,t,n,r){jo(e,lo(t,n),r)}function Io(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 io(ft(e,t[n].anchor),ft(e,t[n].head))},origin:n&&n.origin};return ve(e,"beforeSelectionChange",e,r),e.cm&&ve(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?oo(e.cm,r.ranges,r.ranges.length-1):t}function zo(e,t,n){var r=e.history.done,i=$(r);i&&i.ranges?(r[r.length-1]=t,Uo(e,t,n)):jo(e,t,n)}function jo(e,t,n){Uo(e,t,n),Mo(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Uo(e,t,n){(be(e,"beforeSelectionChange")||e.cm&&be(e.cm,"beforeSelectionChange"))&&(t=Io(e,t,n));var r=n&&n.bias||(ot(t.primary().head,e.sel.primary().head)<0?-1:1);Ko(e,Vo(e,t,r,!0)),n&&!1===n.scroll||!e.cm||"nocursor"==e.cm.getOption("readOnly")||li(e.cm)}function Ko(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,xe(e.cm)),On(e,"cursorActivity",e))}function Go(e){Ko(e,Vo(e,e.sel,null,!1))}function Vo(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var l=t.ranges[o],a=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=Xo(e,l.anchor,a&&a.anchor,n,r),c=Xo(e,l.head,a&&a.head,n,r);(i||s!=l.anchor||c!=l.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new io(s,c))}return i?oo(e.cm,i,t.primIndex):t}function qo(e,t,n,r,i){var o=_e(e,t.line);if(o.markedSpans)for(var l=0;l<o.markedSpans.length;++l){var a=o.markedSpans[l],s=a.marker,c="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,u="selectRight"in s?!s.selectRight:s.inclusiveRight;if((null==a.from||(c?a.from<=t.ch:a.from<t.ch))&&(null==a.to||(u?a.to>=t.ch:a.to>t.ch))){if(i&&(ve(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(!s.atomic)continue;if(n){var f=s.find(r<0?1:-1),h=void 0;if((r<0?u:c)&&(f=Yo(e,f,-r,f&&f.line==t.line?o:null)),f&&f.line==t.line&&(h=ot(f,n))&&(r<0?h<0:h>0))return qo(e,f,t,r,i)}var d=s.find(r<0?-1:1);return(r<0?c:u)&&(d=Yo(e,d,r,d.line==t.line?o:null)),d?qo(e,d,t,r,i):null}}return t}function Xo(e,t,n,r,i){var o=r||1,l=qo(e,t,n,o,i)||!i&&qo(e,t,n,o,!0)||qo(e,t,n,-o,i)||!i&&qo(e,t,n,-o,!0);return l||(e.cantEdit=!0,it(e.first,0))}function Yo(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?ft(e,it(t.line-1)):null:n>0&&t.ch==(r||_e(e,t.line)).text.length?t.line<e.first+e.size-1?it(t.line+1,0):null:new it(t.line,t.ch+n)}function $o(e){e.setSelection(it(e.firstLine(),0),it(e.lastLine()),K)}function _o(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=ft(e,t)),n&&(r.to=ft(e,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),ve(e,"beforeChange",e,r),e.cm&&ve(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Jo(e,t,n){if(e.cm){if(!e.cm.curOp)return Di(e.cm,Jo)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(be(e,"beforeChange")||e.cm&&be(e.cm,"beforeChange"))||(t=_o(e,t,!0),t)){var r=Ot&&!n&&zt(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Qo(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Qo(e,t)}}function Qo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=ot(t.from,t.to)){var n=co(e,t);Lo(e,t,n,e.cm?e.cm.curOp.id:NaN),tl(e,t,n,Rt(e,t));var r=[];vo(e,(function(e,n){n||-1!=z(r,e.history)||(ll(e.history,t),r.push(e.history)),tl(e,t,null,Rt(e,t))}))}}function Zo(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,l=e.sel,a="undo"==t?o.done:o.undone,s="undo"==t?o.undone:o.done,c=0;c<a.length;c++)if(i=a[c],n?i.ranges&&!i.equals(e.sel):!i.ranges)break;if(c!=a.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(i=a.pop(),!i.ranges){if(r)return void a.push(i);break}if(Oo(i,s),n&&!i.equals(e.sel))return void jo(e,i,{clearRedo:!1});l=i}var u=[];Oo(l,s),s.push({changes:u,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var f=be(e,"beforeChange")||e.cm&&be(e.cm,"beforeChange"),h=function(n){var r=i.changes[n];if(r.origin=t,f&&!_o(e,r,!1))return a.length=0,{};u.push(Co(e,r));var o=n?co(e,r):$(a);tl(e,r,o,Po(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:ao(r)});var l=[];vo(e,(function(e,t){t||-1!=z(l,e.history)||(ll(e.history,r),l.push(e.history)),tl(e,r,null,Po(e,r))}))},d=i.changes.length-1;d>=0;--d){var p=h(d);if(p)return p.v}}}}function el(e,t){if(0!=t&&(e.first+=t,e.sel=new ro(_(e.sel.ranges,(function(e){return new io(it(e.anchor.line+t,e.anchor.ch),it(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){Hr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Br(e.cm,r,"gutter")}}function tl(e,t,n,r){if(e.cm&&!e.cm.curOp)return Di(e.cm,tl)(e,t,n,r);if(t.to.line<e.first)el(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);el(e,i),t={from:it(e.first,0),to:it(t.to.line+i,t.to.ch),text:[$(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:it(o,_e(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Je(e,t.from,t.to),n||(n=co(e,t)),e.cm?nl(e.cm,t,r):go(e,t,r),Uo(e,n,K),e.cantEdit&&Xo(e,it(e.firstLine(),0))&&(e.cantEdit=!1)}}function nl(e,t,n){var r=e.doc,i=e.display,o=t.from,l=t.to,a=!1,s=o.line;e.options.lineWrapping||(s=et(Jt(_e(r,o.line))),r.iter(s,l.line+1,(function(e){if(e==i.maxLine)return a=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&xe(e),go(r,t,n,Pr(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,(function(e){var t=ln(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,a=!1)})),a&&(e.curOp.updateMaxLine=!0)),Mt(r,o.line),Fi(e,400);var c=t.text.length-(l.line-o.line)-1;t.full?Hr(e):o.line!=l.line||1!=t.text.length||mo(e.doc,t)?Hr(e,o.line,l.line+1,c):Br(e,o.line,"text");var u=be(e,"changes"),f=be(e,"change");if(f||u){var h={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};f&&On(e,"change",e,h),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function rl(e,t,n,r,i){var o;r||(r=n),ot(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),Jo(e,{from:n,to:r,text:t,origin:i})}function il(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function ol(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],l=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var a=0;a<o.ranges.length;a++)il(o.ranges[a].anchor,t,n,r),il(o.ranges[a].head,t,n,r)}else{for(var s=0;s<o.changes.length;++s){var c=o.changes[s];if(n<c.from.line)c.from=it(c.from.line+r,c.from.ch),c.to=it(c.to.line+r,c.to.ch);else if(t<=c.to.line){l=!1;break}}l||(e.splice(0,i+1),i=0)}}}function ll(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;ol(e.done,n,r,i),ol(e.undone,n,r,i)}function al(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=_e(e,ut(e,t)):i=et(t),null==i?null:(r(o,i)&&e.cm&&Br(e.cm,i,n),o)}function sl(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 cl(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}io.prototype.from=function(){return ct(this.anchor,this.head)},io.prototype.to=function(){return st(this.anchor,this.head)},io.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},sl.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,un(i),On(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}},cl.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),l=r.height;if(r.removeInner(e,o),this.height-=l-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof sl))){var a=[];this.collapse(a),this.children=[new sl(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var l=i.lines.length%25+25,a=l;a<i.lines.length;){var s=new sl(i.lines.slice(a,a+=25));i.height-=s.height,this.children.splice(++r,0,s),s.parent=this}i.lines=i.lines.slice(0,l),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new cl(t);if(e.parent){e.size-=n.size,e.height-=n.height;var r=z(e.parent.children,e);e.parent.children.splice(r+1,0,n)}else{var i=new cl(e.children);i.parent=e,e.children=[i,n],e=i}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var l=Math.min(t,o-e);if(i.iterN(e,l,n))return!0;if(0==(t-=l))break;e=0}else e-=o}}};var ul=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 fl(e,t,n){on(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&oi(e,n)}function hl(e,t,n,r){var i=new ul(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),al(e,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!nn(e,t)){var r=on(t)<e.scrollTop;Ze(t,t.height+Un(i)),r&&oi(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&On(o,"lineWidgetAdded",o,i,"number"==typeof t?t:et(t)),i}ul.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=et(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=Un(this);Ze(n,Math.max(0,n.height-o)),e&&(Ni(e,(function(){fl(e,n,-o),Br(e,r,"widget")})),On(e,"lineWidgetCleared",e,this,r))}},ul.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Un(this)-t;i&&(nn(this.doc,r)||Ze(r,r.height+i),n&&Ni(n,(function(){n.curOp.forceUpdate=!0,fl(n,r,i),On(n,"lineWidgetChanged",n,e,et(r))})))},we(ul);var dl=0,pl=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++dl};function ml(e,t,n,r,i){if(r&&r.shared)return vl(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Di(e.cm,ml)(e,t,n,r,i);var o=new pl(e,i),l=ot(t,n);if(r&&B(r,o,!1),l>0||0==l&&!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(_t(e,t.line,t,n,o)||t.line!=n.line&&_t(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Dt()}o.addToHistory&&Lo(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a,s=t.line,c=e.cm;if(e.iter(s,n.line+1,(function(r){c&&o.collapsed&&!c.options.lineWrapping&&Jt(r)==c.display.maxLine&&(a=!0),o.collapsed&&s!=t.line&&Ze(r,0),Et(r,new Pt(o,s==t.line?t.ch:null,s==n.line?n.ch:null),e.cm&&e.cm.curOp),++s})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){nn(e,t)&&Ze(t,0)})),o.clearOnEnter&&pe(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Nt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++dl,o.atomic=!0),c){if(a&&(c.curOp.updateMaxLine=!0),o.collapsed)Hr(c,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=t.line;u<=n.line;u++)Br(c,u,"text");o.atomic&&Go(c.doc),On(c,"markerAdded",c,o)}return o}pl.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ci(e),be(this,"clear")){var n=this.find();n&&On(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var l=this.lines[o],a=Wt(l.markedSpans,this);e&&!this.collapsed?Br(e,et(l),"text"):e&&(null!=a.to&&(i=et(l)),null!=a.from&&(r=et(l))),l.markedSpans=Ft(l.markedSpans,a),null==a.from&&this.collapsed&&!nn(this.doc,l)&&e&&Ze(l,Or(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var c=Jt(this.lines[s]),u=ln(c);u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Hr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Go(e.doc)),e&&On(e,"markerCleared",e,this,r,i),t&&Si(e),this.parent&&this.parent.clear()}},pl.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],l=Wt(o.markedSpans,this);if(null!=l.from&&(n=it(t?o:et(o),l.from),-1==e))return n;if(null!=l.to&&(r=it(t?o:et(o),l.to),1==e))return r}return n&&{from:n,to:r}},pl.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&Ni(r,(function(){var i=t.line,o=et(t.line),l=er(r,o);if(l&&(cr(l),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!nn(n.doc,i)&&null!=n.height){var a=n.height;n.height=null;var s=Un(n)-a;s&&Ze(i,i.height+s)}On(r,"markerChanged",r,e)}))},pl.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=z(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},pl.prototype.detachLine=function(e){if(this.lines.splice(z(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},we(pl);var gl=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function vl(e,t,n,r,i){r=B(r),r.shared=!1;var o=[ml(e,t,n,r,i)],l=o[0],a=r.widgetNode;return vo(e,(function(e){a&&(r.widgetNode=a.cloneNode(!0)),o.push(ml(e,ft(e,t),ft(e,n),r,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;l=$(o)})),new gl(o,l)}function yl(e){return e.findMarks(it(e.first,0),e.clipPos(it(e.lastLine())),(function(e){return e.parent}))}function xl(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),l=e.clipPos(i.to);if(ot(o,l)){var a=ml(e,o,l,r.primary,r.primary.type);r.markers.push(a),a.parent=r}}}function bl(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];vo(n.primary.doc,(function(e){return r.push(e)}));for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==z(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}},n=0;n<e.length;n++)t(n)}gl.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();On(this,"clear")}},gl.prototype.find=function(e,t){return this.primary.find(e,t)},we(gl);var wl=0,Cl=function e(t,n,r,i,o){if(!(this instanceof e))return new e(t,n,r,i,o);null==r&&(r=0),cl.call(this,[new sl([new sn("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var l=it(r,0);this.sel=lo(l),this.history=new wo(null),this.id=++wl,this.modeOption=n,this.lineSep=i,this.direction="rtl"==o?"rtl":"ltr",this.extend=!1,"string"==typeof t&&(t=this.splitLines(t)),go(this,{from:l,to:l,text:t}),jo(this,lo(l),K)};Cl.prototype=Z(cl.prototype,{constructor:Cl,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=Qe(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:Wi((function(e){var t=it(this.first,0),n=this.first+this.size-1;Jo(this,{from:t,to:it(n,_e(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ai(this.cm,0,0),jo(this,lo(t),K)})),replaceRange:function(e,t,n,r){t=ft(this,t),n=n?ft(this,n):t,rl(this,e,t,n,r)},getRange:function(e,t,n){var r=Je(this,ft(this,e),ft(this,t));return!1===n?r:""===n?r.join(""):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(nt(this,e))return _e(this,e)},getLineNumber:function(e){return et(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=_e(this,e)),Jt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ft(this,e)},getCursor:function(e){var t,n=this.sel.primary();return t=null==e||"head"==e?n.head:"anchor"==e?n.anchor:"end"==e||"to"==e||!1===e?n.to():n.from(),t},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Wi((function(e,t,n){Ro(this,ft(this,"number"==typeof e?it(e,t||0):e),null,n)})),setSelection:Wi((function(e,t,n){Ro(this,ft(this,e),ft(this,t||e),n)})),extendSelection:Wi((function(e,t,n){Eo(this,ft(this,e),t&&ft(this,t),n)})),extendSelections:Wi((function(e,t){Ho(this,dt(this,e),t)})),extendSelectionsBy:Wi((function(e,t){var n=_(this.sel.ranges,e);Ho(this,dt(this,n),t)})),setSelections:Wi((function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new io(ft(this,e[i].anchor),ft(this,e[i].head||e[i].anchor));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),jo(this,oo(this.cm,r,t),n)}})),addSelection:Wi((function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new io(ft(this,e),ft(this,t||e))),jo(this,oo(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=Je(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=Je(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:Wi((function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var l=i.ranges[o];r[o]={from:l.from(),to:l.to(),text:this.splitLines(e[o]),origin:n}}for(var a=t&&"end"!=t&&fo(this,r,t),s=r.length-1;s>=0;s--)Jo(this,r[s]);a?zo(this,a):this.cm&&li(this.cm)})),undo:Wi((function(){Zo(this,"undo")})),redo:Wi((function(){Zo(this,"redo")})),undoSelection:Wi((function(){Zo(this,"undo",!0)})),redoSelection:Wi((function(){Zo(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new wo(this.history),vo(this,(function(t){return t.history=e.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Wo(this.history.done),undone:Wo(this.history.undone)}},setHistory:function(e){var t=this.history=new wo(this.history);t.done=Wo(e.done.slice(0),null,!0),t.undone=Wo(e.undone.slice(0),null,!0)},setGutterMarker:Wi((function(e,t,n){return al(this,e,"gutter",(function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&re(r)&&(e.gutterMarkers=null),!0}))})),clearGutter:Wi((function(e){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&al(t,n,"gutter",(function(){return n.gutterMarkers[e]=null,re(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!nt(this,e))return null;if(t=e,e=_e(this,e),!e)return null}else if(t=et(e),null==t)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Wi((function(e,t,n){return al(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:Wi((function(e,t,n){return al(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 l=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&l!=i.length?" ":"")+i.slice(l)||null}return!0}))})),addLineWidget:Wi((function(e,t,n){return hl(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return ml(this,ft(this,e),ft(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=ft(this,e),ml(this,e,e,n,"bookmark")},findMarksAt:function(e){e=ft(this,e);var t=[],n=_e(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=ft(this,e),t=ft(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var l=o.markedSpans;if(l)for(var a=0;a<l.length;a++){var s=l[a];null!=s.to&&i==e.line&&e.ch>=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||n&&!n(s.marker)||r.push(s.marker.parent||s.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)})),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n})),ft(this,it(n,t))},indexFromPos:function(e){e=ft(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+n})),t},copy:function(e){var t=new Cl(Qe(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 Cl(Qe(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}],xl(r,yl(this)),r},unlinkDoc:function(e){if(e instanceof Ha&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),bl(yl(this));break}}if(e.history==this.history){var r=[e.id];vo(e,(function(e){return r.push(e.id)}),!0),e.history=new wo(null),e.history.done=Wo(this.history.done,r),e.history.undone=Wo(this.history.undone,r)}},iterLinkedDocs:function(e){vo(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):We(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Wi((function(e){"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&bo(this.cm))}))}),Cl.prototype.eachLine=Cl.prototype.iter;var Sl=0;function kl(e){var t=this;if(Ml(t),!ye(t,e)&&!Kn(t.display,e)){Ce(e),l&&(Sl=+new Date);var n=Fr(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,s=function(){++a==i&&Di(t,(function(){n=ft(t.doc,n);var e={from:n,to:n,text:t.doc.splitLines(o.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};Jo(t.doc,e),zo(t.doc,lo(ft(t.doc,n),ft(t.doc,ao(e))))}))()},c=function(e,n){if(t.options.allowDropFileTypes&&-1==z(t.options.allowDropFileTypes,e.type))s();else{var r=new FileReader;r.onerror=function(){return s()},r.onload=function(){var e=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(o[n]=e),s()},r.readAsText(e)}},u=0;u<r.length;u++)c(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 f=e.dataTransfer.getData("Text");if(f){var h;if(t.state.draggingText&&!t.state.draggingText.copy&&(h=t.listSelections()),Uo(t.doc,lo(n,n)),h)for(var d=0;d<h.length;++d)rl(t.doc,"",h[d].anchor,h[d].head,"drag");t.replaceSelection(f,"around","paste"),t.display.input.focus()}}catch(p){}}}}function Ll(e,t){if(l&&(!e.state.draggingText||+new Date-Sl<100))Le(t);else if(!ye(e,t)&&!Kn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!h)){var n=A("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)}}function Tl(e,t){var n=Fr(e,t);if(n){var r=document.createDocumentFragment();Gr(e,n,r),e.display.dragCursor||(e.display.dragCursor=A("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),O(e.display.dragCursor,r)}}function Ml(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ol(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 Al=!1;function Nl(){Al||(Dl(),Al=!0)}function Dl(){var e;pe(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Ol(Pl)}),100))})),pe(window,"blur",(function(){return Ol(Jr)}))}function Pl(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Wl={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Fl=0;Fl<10;Fl++)Wl[Fl+48]=Wl[Fl+96]=String(Fl);for(var El=65;El<=90;El++)Wl[El]=String.fromCharCode(El);for(var Hl=1;Hl<=12;Hl++)Wl[Hl+111]=Wl[Hl+63235]="F"+Hl;var Bl={};function Rl(e){var t,n,r,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var l=0;l<o.length-1;l++){var a=o[l];if(/^(cmd|meta|m)$/i.test(a))i=!0;else if(/^a(lt)?$/i.test(a))t=!0;else if(/^(c|ctrl|control)$/i.test(a))n=!0;else{if(!/^s(hift)?$/i.test(a))throw new Error("Unrecognized modifier name: "+a);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Il(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=_(n.split(" "),Rl),o=0;o<i.length;o++){var l=void 0,a=void 0;o==i.length-1?(a=i.join(" "),l=r):(a=i.slice(0,o+1).join(" "),l="...");var s=t[a];if(s){if(s!=l)throw new Error("Inconsistent bindings for "+a)}else t[a]=l}delete e[n]}for(var c in t)e[c]=t[c];return e}function zl(e,t,n,r){t=Gl(t);var i=t.call?t.call(e,r):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return zl(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var l=zl(e,t.fallthrough[o],n,r);if(l)return l}}}function jl(e){var t="string"==typeof e?e:Wl[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Ul(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)&&"Mod"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function Kl(e,t){if(f&&34==e.keyCode&&e["char"])return!1;var n=Wl[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),Ul(n,e,t))}function Gl(e){return"string"==typeof e?Bl[e]:e}function Vl(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){var o=t(n[i]);while(r.length&&ot(o.from,$(r).to)<=0){var l=r.pop();if(ot(l.from,o.from)<0){o.from=l.from;break}}r.push(o)}Ni(e,(function(){for(var t=r.length-1;t>=0;t--)rl(e.doc,"",r[t].from,r[t].to,"+delete");li(e)}))}function ql(e,t,n){var r=le(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Xl(e,t,n){var r=ql(e,t.ch,n);return null==r?null:new it(t.line,r,n<0?"after":"before")}function Yl(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=he(n,t.doc.direction);if(o){var l,a=i<0?$(o):o[0],s=i<0==(1==a.level),c=s?"after":"before";if(a.level>0||"rtl"==t.doc.direction){var u=tr(t,n);l=i<0?n.text.length-1:0;var f=nr(t,u,l).top;l=ae((function(e){return nr(t,u,e).top==f}),i<0==(1==a.level)?a.from:a.to-1,l),"before"==c&&(l=ql(n,l,1))}else l=i<0?a.to:a.from;return new it(r,l,c)}}return new it(r,i<0?n.text.length:0,i<0?"before":"after")}function $l(e,t,n,r){var i=he(t,e.doc.direction);if(!i)return Xl(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=ue(i,n.ch,n.sticky),l=i[o];if("ltr"==e.doc.direction&&l.level%2==0&&(r>0?l.to>n.ch:l.from<n.ch))return Xl(t,n,r);var a,s=function(e,n){return ql(t,e instanceof it?e.ch:e,n)},c=function(n){return e.options.lineWrapping?(a=a||tr(e,t),Sr(e,t,a,n)):{begin:0,end:t.text.length}},u=c("before"==n.sticky?s(n,-1):n.ch);if("rtl"==e.doc.direction||1==l.level){var f=1==l.level==r<0,h=s(n,f?1:-1);if(null!=h&&(f?h<=l.to&&h<=u.end:h>=l.from&&h>=u.begin)){var d=f?"before":"after";return new it(n.line,h,d)}}var p=function(e,t,r){for(var o=function(e,t){return t?new it(n.line,s(e,1),"before"):new it(n.line,e,"after")};e>=0&&e<i.length;e+=t){var l=i[e],a=t>0==(1!=l.level),c=a?r.begin:s(r.end,-1);if(l.from<=c&&c<l.to)return o(c,a);if(c=a?l.from:s(l.to,-1),r.begin<=c&&c<r.end)return o(c,a)}},m=p(o+r,r,u);if(m)return m;var g=r>0?u.end:s(u.begin,-1);return null==g||r>0&&g==t.text.length||(m=p(r>0?0:i.length-1,r,c(g)),!m)?null:m}Bl.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"},Bl.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"},Bl.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Bl.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"]},Bl["default"]=y?Bl.macDefault:Bl.pcDefault;var _l={selectAll:$o,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),K)},killLine:function(e){return Vl(e,(function(t){if(t.empty()){var n=_e(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:it(t.head.line+1,0)}:{from:t.head,to:it(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Vl(e,(function(t){return{from:it(t.from().line,0),to:ft(e.doc,it(t.to().line+1,0))}}))},delLineLeft:function(e){return Vl(e,(function(e){return{from:it(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Vl(e,(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}}))},delWrappedLineRight:function(e){return Vl(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(it(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(it(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return Jl(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return Zl(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return Ql(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")}),V)},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")}),V)},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/)?Zl(e,t.head):r}),V)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),l=R(e.getLine(o.line),o.ch,r);t.push(Y(r-l%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Ni(e,(function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=_e(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new it(i.line,i.ch-1)),i.ch>0)i=new it(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),it(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=_e(e.doc,i.line-1).text;l&&(i=new it(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),it(i.line-1,l.length-1),i,"+transpose"))}n.push(new io(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return Ni(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);li(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Jl(e,t){var n=_e(e.doc,t),r=Jt(n);return r!=n&&(t=et(r)),Yl(!0,e,r,t,1)}function Ql(e,t){var n=_e(e.doc,t),r=Qt(n);return r!=n&&(t=et(r)),Yl(!0,e,n,t,-1)}function Zl(e,t){var n=Jl(e,t.line),r=_e(e.doc,n.line),i=he(r,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(n.ch,r.text.search(/\S/)),l=t.line==n.line&&t.ch<=o&&t.ch;return it(n.line,l?0:o,n.sticky)}return n}function ea(e,t,n){if("string"==typeof t&&(t=_l[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=U}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function ta(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=zl(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&zl(t,e.options.extraKeys,n,e)||zl(t,e.options.keyMap,n,e)}var na=new I;function ra(e,t,n,r){var i=e.state.keySeq;if(i){if(jl(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:na.set(50,(function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())})),ia(e,i+" "+t,n,r))return!0}return ia(e,t,n,r)}function ia(e,t,n,r){var i=ta(e,t,r);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&On(e,"keyHandled",e,t,n),"handled"!=i&&"multi"!=i||(Ce(n),Xr(e)),!!i}function oa(e,t){var n=Kl(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?ra(e,"Shift-"+n,t,(function(t){return ea(e,t,!0)}))||ra(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return ea(e,t)})):ra(e,n,t,(function(t){return ea(e,t)})))}function la(e,t,n){return ra(e,"'"+n+"'",t,(function(t){return ea(e,t,!0)}))}var aa=null;function sa(e){var t=this;if((!e.target||e.target==t.display.input.getField())&&(t.curOp.focus=P(),!ye(t,e))){l&&a<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var i=oa(t,e);f&&(aa=i?r:null,i||88!=r||Ee||!(y?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),n&&!y&&!i&&46==r&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||ca(t)}}function ca(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(T(t,"CodeMirror-crosshair"),ge(document,"keyup",n),ge(document,"mouseover",n))}W(t,"CodeMirror-crosshair"),pe(document,"keyup",n),pe(document,"mouseover",n)}function ua(e){16==e.keyCode&&(this.doc.sel.shift=!1),ye(this,e)}function fa(e){var t=this;if((!e.target||e.target==t.display.input.getField())&&!(Kn(t.display,e)||ye(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(f&&n==aa)return aa=null,void Ce(e);if(!f||e.which&&!(e.which<10)||!oa(t,e)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(la(t,e,i)||t.display.input.onKeyPress(e))}}}var ha,da,pa=400,ma=function(e,t,n){this.time=e,this.pos=t,this.button=n};function ga(e,t){var n=+new Date;return da&&da.compare(n,e,t)?(ha=da=null,"triple"):ha&&ha.compare(n,e,t)?(da=new ma(n,e,t),ha=null,"double"):(ha=new ma(n,e,t),da=null,"single")}function va(e){var t=this,n=t.display;if(!(ye(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,Kn(n,e))s||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!Ta(t,e)){var r=Fr(t,e),i=Me(e),o=r?ga(r,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),r&&ya(t,i,r,o,e)||(1==i?r?ba(t,r,o,e):Te(e)==n.scroller&&Ce(e):2==i?(r&&Eo(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(S?t.display.input.onContextMenu(e):$r(t)))}}function ya(e,t,n,r,i){var o="Click";return"double"==r?o="Double"+o:"triple"==r&&(o="Triple"+o),o=(1==t?"Left":2==t?"Middle":"Right")+o,ra(e,Ul(o,i),i,(function(t){if("string"==typeof t&&(t=_l[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}))}function xa(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(null==i.unit){var o=x?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),null==i.addNew&&(i.addNew=y?n.metaKey:n.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(y?n.altKey:n.ctrlKey)),i}function ba(e,t,n,r){l?setTimeout(H(Yr,e),0):e.curOp.focus=P();var i,o=xa(e,n,r),a=e.doc.sel;e.options.dragDrop&&Ne&&!e.isReadOnly()&&"single"==n&&(i=a.contains(t))>-1&&(ot((i=a.ranges[i]).from(),t)<0||t.xRel>0)&&(ot(i.to(),t)>0||t.xRel<0)?wa(e,r,t,o):Sa(e,r,t,o)}function wa(e,t,n,r){var i=e.display,o=!1,c=Di(e,(function(t){s&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:$r(e)),ge(i.wrapper.ownerDocument,"mouseup",c),ge(i.wrapper.ownerDocument,"mousemove",u),ge(i.scroller,"dragstart",f),ge(i.scroller,"drop",c),o||(Ce(t),r.addNew||Eo(e.doc,n,null,null,r.extend),s&&!h||l&&9==a?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),u=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=c,c.copy=!r.moveOnDrag,pe(i.wrapper.ownerDocument,"mouseup",c),pe(i.wrapper.ownerDocument,"mousemove",u),pe(i.scroller,"dragstart",f),pe(i.scroller,"drop",c),e.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}function Ca(e,t,n){if("char"==n)return new io(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new io(it(t.line,0),ft(e.doc,it(t.line+1,0)));var r=n(e,t);return new io(r.from,r.to)}function Sa(e,t,n,r){l&&$r(e);var i=e.display,o=e.doc;Ce(t);var a,s,c=o.sel,u=c.ranges;if(r.addNew&&!r.extend?(s=o.sel.contains(n),a=s>-1?u[s]:new io(n,n)):(a=o.sel.primary(),s=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(a=new io(n,n)),n=Fr(e,t,!0,!0),s=-1;else{var f=Ca(e,n,r.unit);a=r.extend?Fo(a,f.anchor,f.head,r.extend):f}r.addNew?-1==s?(s=u.length,jo(o,oo(e,u.concat([a]),s),{scroll:!1,origin:"*mouse"})):u.length>1&&u[s].empty()&&"char"==r.unit&&!r.extend?(jo(o,oo(e,u.slice(0,s).concat(u.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),c=o.sel):Bo(o,s,a,G):(s=0,jo(o,new ro([a],0),G),c=o.sel);var h=n;function d(t){if(0!=ot(h,t))if(h=t,"rectangle"==r.unit){for(var i=[],l=e.options.tabSize,u=R(_e(o,n.line).text,n.ch,l),f=R(_e(o,t.line).text,t.ch,l),d=Math.min(u,f),p=Math.max(u,f),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var v=_e(o,m).text,y=q(v,d,l);d==p?i.push(new io(it(m,y),it(m,y))):v.length>y&&i.push(new io(it(m,y),it(m,q(v,p,l))))}i.length||i.push(new io(n,n)),jo(o,oo(e,c.ranges.slice(0,s).concat(i),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x,b=a,w=Ca(e,t,r.unit),C=b.anchor;ot(w.anchor,C)>0?(x=w.head,C=ct(b.from(),w.anchor)):(x=w.anchor,C=st(b.to(),w.head));var S=c.ranges.slice(0);S[s]=ka(e,new io(ft(o,C),x)),jo(o,oo(e,S,s),G)}}var p=i.wrapper.getBoundingClientRect(),m=0;function g(t){var n=++m,l=Fr(e,t,!0,"rectangle"==r.unit);if(l)if(0!=ot(l,h)){e.curOp.focus=P(),d(l);var a=ei(i,o);(l.line>=a.to||l.line<a.from)&&setTimeout(Di(e,(function(){m==n&&g(t)})),150)}else{var s=t.clientY<p.top?-20:t.clientY>p.bottom?20:0;s&&setTimeout(Di(e,(function(){m==n&&(i.scroller.scrollTop+=s,g(t))})),50)}}function v(t){e.state.selectingText=!1,m=1/0,t&&(Ce(t),i.input.focus()),ge(i.wrapper.ownerDocument,"mousemove",y),ge(i.wrapper.ownerDocument,"mouseup",x),o.history.lastSelOrigin=null}var y=Di(e,(function(e){0!==e.buttons&&Me(e)?g(e):v(e)})),x=Di(e,v);e.state.selectingText=x,pe(i.wrapper.ownerDocument,"mousemove",y),pe(i.wrapper.ownerDocument,"mouseup",x)}function ka(e,t){var n=t.anchor,r=t.head,i=_e(e.doc,n.line);if(0==ot(n,r)&&n.sticky==r.sticky)return t;var o=he(i);if(!o)return t;var l=ue(o,n.ch,n.sticky),a=o[l];if(a.from!=n.ch&&a.to!=n.ch)return t;var s,c=l+(a.from==n.ch==(1!=a.level)?0:1);if(0==c||c==o.length)return t;if(r.line!=n.line)s=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=ue(o,r.ch,r.sticky),f=u-l||(r.ch-n.ch)*(1==a.level?-1:1);s=u==c-1||u==c?f<0:f>0}var h=o[c+(s?-1:0)],d=s==(1==h.level),p=d?h.from:h.to,m=d?"after":"before";return n.ch==p&&n.sticky==m?t:new io(new it(n.line,p,m),r)}function La(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(h){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Ce(t);var l=e.display,a=l.lineDiv.getBoundingClientRect();if(o>a.bottom||!be(e,n))return ke(t);o-=a.top-l.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var c=l.gutters.childNodes[s];if(c&&c.getBoundingClientRect().right>=i){var u=tt(e.doc,o),f=e.display.gutterSpecs[s];return ve(e,n,e,u,f.className,t),ke(t)}}}function Ta(e,t){return La(e,t,"gutterClick",!0)}function Ma(e,t){Kn(e.display,t)||Oa(e,t)||ye(e,t,"contextmenu")||S||e.display.input.onContextMenu(t)}function Oa(e,t){return!!be(e,"gutterContextMenu")&&La(e,t,"gutterContextMenu",!1)}function Aa(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),fr(e)}ma.prototype.compare=function(e,t,n){return this.time+pa>e&&0==ot(t,this.pos)&&n==this.button};var Na={toString:function(){return"CodeMirror.Init"}},Da={},Pa={};function Wa(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=Na&&i(e,t,n)}:i)}e.defineOption=n,e.Init=Na,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,ho(e)}),!0),n("indentUnit",2,ho,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){po(e),fr(e),Hr(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(it(r,o))}r++}));for(var i=n.length-1;i>=0;i--)rl(e.doc,t,n[i],it(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Na&&e.refresh()})),n("specialCharPlaceholder",mn,(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("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!b),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Aa(e),_i(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Gl(t),i=n!=Na&&Gl(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ea,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=Yi(t,e.options.lineNumbers),_i(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?Dr(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return vi(e)}),!0),n("scrollbarStyle","native",(function(e){bi(e),vi(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=Yi(e.options.gutters,t),_i(e)}),!0),n("firstLineNumber",1,_i,!0),n("lineNumberFormatter",(function(e){return e}),_i,!0),n("showCursorWhenSelecting",!1,Ur,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Jr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Fa),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Ur,!0),n("singleCursorHeightPerLine",!0,Ur,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,po,!0),n("addModeClass",!1,po,!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,po,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}function Fa(e,t,n){var r=n&&n!=Na;if(!t!=!r){var i=e.display.dragFunctions,o=t?pe:ge;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function Ea(e){e.options.lineWrapping?(W(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(T(e.display.wrapper,"CodeMirror-wrap"),an(e)),Wr(e),Hr(e),fr(e),setTimeout((function(){return vi(e)}),100)}function Ha(e,t){var n=this;if(!(this instanceof Ha))return new Ha(e,t);this.options=t=t?B(t):{},B(Da,t,!1);var r=t.value;"string"==typeof r?r=new Cl(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Ha.inputStyles[t.inputStyle](this),o=this.display=new Ji(e,r,i,t);for(var c in o.wrapper.CodeMirror=this,Aa(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),bi(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 I,keySeq:null,specialChars:null},t.autofocus&&!v&&o.input.focus(),l&&a<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Ba(this),Nl(),Ci(this),this.curOp.forceUpdate=!0,yo(this,r),t.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&_r(n)}),20):Jr(this),Pa)Pa.hasOwnProperty(c)&&Pa[c](this,t[c],Na);Xi(this),t.finishInit&&t.finishInit(this);for(var u=0;u<Ra.length;++u)Ra[u](this);Si(this),s&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function Ba(e){var t=e.display;pe(t.scroller,"mousedown",Di(e,va)),pe(t.scroller,"dblclick",l&&a<11?Di(e,(function(t){if(!ye(e,t)){var n=Fr(e,t);if(n&&!Ta(e,t)&&!Kn(e.display,t)){Ce(t);var r=e.findWordAt(n);Eo(e.doc,r.anchor,r.head)}}})):function(t){return ye(e,t)||Ce(t)}),pe(t.scroller,"contextmenu",(function(t){return Ma(e,t)})),pe(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||Ma(e,n)}));var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),r=t.activeTouch,r.end=+new Date)}function o(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function s(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}pe(t.scroller,"touchstart",(function(i){if(!ye(e,i)&&!o(i)&&!Ta(e,i)){t.input.ensurePolled(),clearTimeout(n);var l=+new Date;t.activeTouch={start:l,moved:!1,prev:l-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),pe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),pe(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!Kn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,l=e.coordsChar(t.activeTouch,"page");o=!r.prev||s(r,r.prev)?new io(l,l):!r.prev.prev||s(r,r.prev.prev)?e.findWordAt(l):new io(it(l.line,0),ft(e.doc,it(l.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),Ce(n)}i()})),pe(t.scroller,"touchcancel",i),pe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(fi(e,t.scroller.scrollTop),di(e,t.scroller.scrollLeft,!0),ve(e,"scroll",e))})),pe(t.scroller,"mousewheel",(function(t){return no(e,t)})),pe(t.scroller,"DOMMouseScroll",(function(t){return no(e,t)})),pe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ye(e,t)||Le(t)},over:function(t){ye(e,t)||(Tl(e,t),Le(t))},start:function(t){return Ll(e,t)},drop:Di(e,kl),leave:function(t){ye(e,t)||Ml(e)}};var c=t.input.getField();pe(c,"keyup",(function(t){return ua.call(e,t)})),pe(c,"keydown",Di(e,sa)),pe(c,"keypress",Di(e,fa)),pe(c,"focus",(function(t){return _r(e,t)})),pe(c,"blur",(function(t){return Jr(e,t)}))}Ha.defaults=Da,Ha.optionHandlers=Pa;var Ra=[];function Ia(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=yt(e,t).state:n="prev");var l=e.options.tabSize,a=_e(o,t),s=R(a.text,null,l);a.stateAfter&&(a.stateAfter=null);var c,u=a.text.match(/^\s*/)[0];if(r||/\S/.test(a.text)){if("smart"==n&&(c=o.mode.indent(i,a.text.slice(u.length),a.text),c==U||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?R(_e(o,t-1).text,null,l):0:"add"==n?c=s+e.options.indentUnit:"subtract"==n?c=s-e.options.indentUnit:"number"==typeof n&&(c=s+n),c=Math.max(0,c);var f="",h=0;if(e.options.indentWithTabs)for(var d=Math.floor(c/l);d;--d)h+=l,f+="\t";if(h<c&&(f+=Y(c-h)),f!=u)return rl(o,f,it(t,0),it(t,u.length),"+input"),a.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<u.length){var g=it(t,u.length);Bo(o,p,new io(g,g));break}}}Ha.defineInitHook=function(e){return Ra.push(e)};var za=null;function ja(e){za=e}function Ua(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var l=+new Date-200,a="paste"==i||e.state.pasteIncoming>l,s=We(t),c=null;if(a&&r.ranges.length>1)if(za&&za.text.join("\n")==t){if(r.ranges.length%za.text.length==0){c=[];for(var u=0;u<za.text.length;u++)c.push(o.splitLines(za.text[u]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(c=_(s,(function(e){return[e]})));for(var f=e.curOp.updateInput,h=r.ranges.length-1;h>=0;h--){var d=r.ranges[h],p=d.from(),m=d.to();d.empty()&&(n&&n>0?p=it(p.line,p.ch-n):e.state.overwrite&&!a?m=it(m.line,Math.min(_e(o,m.line).text.length,m.ch+$(s).length)):a&&za&&za.lineWise&&za.text.join("\n")==s.join("\n")&&(p=m=it(p.line,0)));var g={from:p,to:m,text:c?c[h%c.length]:s,origin:i||(a?"paste":e.state.cutIncoming>l?"cut":"+input")};Jo(e.doc,g),On(e,"inputRead",e,g)}t&&!a&&Ga(e,t),li(e),e.curOp.updateInput<2&&(e.curOp.updateInput=f),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ka(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Ni(t,(function(){return Ua(t,n,0,null,"paste")})),!0}function Ga(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var a=0;a<o.electricChars.length;a++)if(t.indexOf(o.electricChars.charAt(a))>-1){l=Ia(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(_e(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Ia(e,i.head.line,"smart"));l&&On(e,"electricInput",e,i.head.line)}}}function Va(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:it(i,0),head:it(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function qa(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Xa(){var e=A("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=A("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return s?e.style.width="1000px":e.setAttribute("wrap","off"),m&&(e.style.border="1px solid black"),qa(e),t}function Ya(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)&&Di(this,t[e])(this,n,i),ve(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"](Gl(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:Pi((function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");J(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(e){return e.priority})),this.state.modeGen++,Hr(this)})),removeOverlay:Pi((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 Hr(this)}})),indentLine:Pi((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),nt(this.doc,e)&&Ia(this,e,t,n)})),indentSelection:Pi((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&&(Ia(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&li(this));else{var o=i.from(),l=i.to(),a=Math.max(n,o.line);n=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1;for(var s=a;s<n;++s)Ia(this,s,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&c[r].from().ch>0&&Bo(this.doc,r,new io(o,c[r].to()),K)}}})),getTokenAt:function(e,t){return St(this,e,t)},getLineTokens:function(e,t){return St(this,it(e),t,!0)},getTokenTypeAt:function(e){e=ft(this.doc,e);var t,n=vt(this,_e(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var l=r+i>>1;if((l?n[2*l-1]:0)>=o)i=l;else{if(!(n[2*l+1]<o)){t=n[2*l+2];break}r=l+1}}var a=t?t.indexOf("overlay "):-1;return a<0?t:0==a?null:t.slice(0,a-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var i=n[t],o=this.getModeAt(e);if("string"==typeof o[t])i[o[t]]&&r.push(i[o[t]]);else if(o[t])for(var l=0;l<o[t].length;l++){var a=i[o[t][l]];a&&r.push(a)}else o.helperType&&i[o.helperType]?r.push(i[o.helperType]):i[o.name]&&r.push(i[o.name]);for(var s=0;s<i._global.length;s++){var c=i._global[s];c.pred(o,this)&&-1==z(r,c.val)&&r.push(c.val)}return r},getStateAfter:function(e,t){var n=this.doc;return e=ut(n,null==e?n.first+n.size-1:e),yt(this,e+1,t).state},cursorCoords:function(e,t){var n,r=this.doc.sel.primary();return n=null==e?r.head:"object"==typeof e?ft(this.doc,e):e?r.from():r.to(),yr(this,n,t||"page")},charCoords:function(e,t){return vr(this,ft(this.doc,e),t||"page")},coordsChar:function(e,t){return e=gr(this,e,t||"page"),wr(this,e.left,e.top)},lineAtHeight:function(e,t){return e=gr(this,{top:e,left:0},t||"page").top,tt(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=_e(this.doc,e)}else r=e;return mr(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-on(r):0)},defaultTextHeight:function(){return Or(this.display)},defaultCharWidth:function(){return Ar(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display;e=yr(this,ft(this.doc,e));var l=e.bottom,a=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)l=e.top;else if("above"==r||"near"==r){var s=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(l=e.bottom),a+t.offsetWidth>c&&(a=c-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(a=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?a=0:"middle"==i&&(a=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=a+"px"),n&&ri(this,{left:a,top:l,right:a+t.offsetWidth,bottom:l+t.offsetHeight})},triggerOnKeyDown:Pi(sa),triggerOnKeyPress:Pi(fa),triggerOnKeyUp:ua,triggerOnMouseDown:Pi(va),execCommand:function(e){if(_l.hasOwnProperty(e))return _l[e].call(null,this)},triggerElectric:Pi((function(e){Ga(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=ft(this.doc,e),l=0;l<t;++l)if(o=$a(this.doc,o,i,n,r),o.hitSide)break;return o},moveH:Pi((function(e,t){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?$a(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()}),V)})),deleteH:Pi((function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Vl(this,(function(n){var i=$a(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}}))})),findPosV:function(e,t,n,r){var i=1,o=r;t<0&&(i=-1,t=-t);for(var l=ft(this.doc,e),a=0;a<t;++a){var s=yr(this,l,"div");if(null==o?o=s.left:s.left=o,l=_a(this,s,i,n),l.hitSide)break}return l},moveV:Pi((function(e,t){var n=this,r=this.doc,i=[],o=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(l){if(o)return e<0?l.from():l.to();var a=yr(n,l.head,"div");null!=l.goalColumn&&(a.left=l.goalColumn),i.push(a.left);var s=_a(n,a,e,t);return"page"==t&&l==r.sel.primary()&&oi(n,vr(n,s,"div").top-a.top),s}),V),i.length)for(var l=0;l<r.sel.ranges.length;l++)r.sel.ranges[l].goalColumn=i[l]})),findWordAt:function(e){var t=this.doc,n=_e(t,e.line).text,r=e.ch,i=e.ch;if(n){var o=this.getHelper(e,"wordChars");"before"!=e.sticky&&i!=n.length||!r?++i:--r;var l=n.charAt(r),a=ne(l,o)?function(e){return ne(e,o)}:/\s/.test(l)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ne(e)};while(r>0&&a(n.charAt(r-1)))--r;while(i<n.length&&a(n.charAt(i)))++i}return new io(it(e.line,r),it(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?W(this.display.cursorDiv,"CodeMirror-overwrite"):T(this.display.cursorDiv,"CodeMirror-overwrite"),ve(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==P()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Pi((function(e,t){ai(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Xn(this)-this.display.barHeight,width:e.scrollWidth-Xn(this)-this.display.barWidth,clientHeight:$n(this),clientWidth:Yn(this)}},scrollIntoView:Pi((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:it(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?si(this,e):ui(this,e.from,e.to,e.margin)})),setSize:Pi((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&&ur(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){Br(n,i,"widget");break}++i})),this.curOp.forceUpdate=!0,ve(this,"refresh",this)})),operation:function(e){return Ni(this,e)},startOperation:function(){return Ci(this)},endOperation:function(){return Si(this)},refresh:Pi((function(){var e=this.display.cachedTextHeight;Hr(this),this.curOp.forceUpdate=!0,fr(this),ai(this,this.doc.scrollLeft,this.doc.scrollTop),Gi(this.display),(null==e||Math.abs(e-Or(this.display))>.5||this.options.lineWrapping)&&Wr(this),ve(this,"refresh",this)})),swapDoc:Pi((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),yo(this,e),fr(this),this.display.input.reset(),ai(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,On(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}},we(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}function $a(e,t,n,r,i){var o=t,l=n,a=_e(e,t.line),s=i&&"rtl"==e.direction?-n:n;function c(){var n=t.line+s;return!(n<e.first||n>=e.first+e.size)&&(t=new it(n,t.ch,t.sticky),a=_e(e,n))}function u(o){var l;if("codepoint"==r){var u=a.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(u))l=null;else{var f=n>0?u>=55296&&u<56320:u>=56320&&u<57343;l=new it(t.line,Math.max(0,Math.min(a.text.length,t.ch+n*(f?2:1))),-n)}}else l=i?$l(e.cm,a,t,n):Xl(a,t,n);if(null==l){if(o||!c())return!1;t=Yl(i,e.cm,a,t.line,s)}else t=l;return!0}if("char"==r||"codepoint"==r)u();else if("column"==r)u(!0);else if("word"==r||"group"==r)for(var f=null,h="group"==r,d=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;;p=!1){if(n<0&&!u(!p))break;var m=a.text.charAt(t.ch)||"\n",g=ne(m,d)?"w":h&&"\n"==m?"n":!h||/\s/.test(m)?null:"p";if(!h||p||g||(g="s"),f&&f!=g){n<0&&(n=1,u(),t.sticky="after");break}if(g&&(f=g),n>0&&!u(!p))break}var v=Xo(e,t,o,l,!0);return lt(o,v)&&(v.hitSide=!0),v}function _a(e,t,n,r){var i,o,l=e.doc,a=t.left;if("page"==r){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(s-.5*Or(e.display),3);i=(n>0?t.bottom:t.top)+n*c}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;;){if(o=wr(e,a,i),!o.outside)break;if(n<0?i<=0:i>=l.height){o.hitSide=!0;break}i+=5*n}return o}var Ja=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new I,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Qa(e,t){var n=er(e,t.line);if(!n||n.hidden)return null;var r=_e(e.doc,t.line),i=Jn(n,r,t.line),o=he(r,e.doc.direction),l="left";if(o){var a=ue(o,t.ch);l=a%2?"right":"left"}var s=or(i.map,t.ch,l);return s.offset="right"==s.collapse?s.end:s.start,s}function Za(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function es(e,t){return t&&(e.bad=!0),e}function ts(e,t,n,r,i){var o="",l=!1,a=e.doc.lineSeparator(),s=!1;function c(e){return function(t){return t.id==e}}function u(){l&&(o+=a,s&&(o+=a),l=s=!1)}function f(e){e&&(u(),o+=e)}function h(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void f(n);var o,d=t.getAttribute("cm-marker");if(d){var p=e.findMarks(it(r,0),it(i+1,0),c(+d));return void(p.length&&(o=p[0].find(0))&&f(Je(e.doc,o.from,o.to).join(a)))}if("false"==t.getAttribute("contenteditable"))return;var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;m&&u();for(var g=0;g<t.childNodes.length;g++)h(t.childNodes[g]);/^(pre|p)$/i.test(t.nodeName)&&(s=!0),m&&(l=!0)}else 3==t.nodeType&&f(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;;){if(h(t),t==n)break;t=t.nextSibling,s=!1}return o}function ns(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return es(e.clipPos(it(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 rs(o,t,n)}}function rs(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!D(r,t))return es(it(et(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?$(e.rest):e.line;return es(it(et(o),o.text.length),i)}var l=3==t.nodeType?t:null,a=t;l||1!=t.childNodes.length||3!=t.firstChild.nodeType||(l=t.firstChild,n&&(n=l.nodeValue.length));while(a.parentNode!=r)a=a.parentNode;var s=e.measure,c=s.maps;function u(t,n,r){for(var i=-1;i<(c?c.length:0);i++)for(var o=i<0?s.map:c[i],l=0;l<o.length;l+=3){var a=o[l+2];if(a==t||a==n){var u=et(i<0?e.line:e.rest[i]),f=o[l]+r;return(r<0||a!=t)&&(f=o[l+(r?1:0)]),it(u,f)}}}var f=u(l,a,n);if(f)return es(f,i);for(var h=a.nextSibling,d=l?l.nodeValue.length-n:0;h;h=h.nextSibling){if(f=u(h,h.firstChild,0),f)return es(it(f.line,f.ch-d),i);d+=h.textContent.length}for(var p=a.previousSibling,m=n;p;p=p.previousSibling){if(f=u(p,p.firstChild,-1),f)return es(it(f.line,f.ch+m),i);m+=p.textContent.length}}Ja.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;function o(e){for(var t=e.target;t;t=t.parentNode){if(t==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function l(e){if(o(e)&&!ye(r,e)){if(r.somethingSelected())ja({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=Va(r);ja({lineWise:!0,text:t.text}),"cut"==e.type&&r.operation((function(){r.setSelections(t.ranges,0,K),r.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var l=za.text.join("\n");if(e.clipboardData.setData("Text",l),e.clipboardData.getData("Text")==l)return void e.preventDefault()}var a=Xa(),s=a.firstChild;r.display.lineSpace.insertBefore(a,r.display.lineSpace.firstChild),s.value=za.text.join("\n");var c=P();E(s),setTimeout((function(){r.display.lineSpace.removeChild(a),c.focus(),c==i&&n.showPrimarySelection()}),50)}}i.contentEditable=!0,qa(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),pe(i,"paste",(function(e){!o(e)||ye(r,e)||Ka(e,r)||a<=11&&setTimeout(Di(r,(function(){return t.updateFromDOM()})),20)})),pe(i,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),pe(i,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),pe(i,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),pe(i,"touchstart",(function(){return n.forceCompositionEnd()})),pe(i,"input",(function(){t.composing||t.readFromDOMSoon()})),pe(i,"copy",l),pe(i,"cut",l)},Ja.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ja.prototype.prepareSelection=function(){var e=Kr(this.cm,!1);return e.focus=P()==this.div,e},Ja.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ja.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ja.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),o=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var l=ns(t,e.anchorNode,e.anchorOffset),a=ns(t,e.focusNode,e.focusOffset);if(!l||l.bad||!a||a.bad||0!=ot(ct(l,a),i)||0!=ot(st(l,a),o)){var s=t.display.view,c=i.line>=t.display.viewFrom&&Qa(t,i)||{node:s[0].measure.map[2],offset:0},u=o.line<t.display.viewTo&&Qa(t,o);if(!u){var f=s[s.length-1].measure,h=f.maps?f.maps[f.maps.length-1]:f.map;u={node:h[h.length-1],offset:h[h.length-2]-h[h.length-3]}}if(c&&u){var d,p=e.rangeCount&&e.getRangeAt(0);try{d=L(c.node,c.offset,u.offset,u.node)}catch(m){}d&&(!n&&t.state.focused?(e.collapse(c.node,c.offset),d.collapsed||(e.removeAllRanges(),e.addRange(d))):(e.removeAllRanges(),e.addRange(d)),p&&null==e.anchorNode?e.addRange(p):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Ja.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)},Ja.prototype.showMultipleSelections=function(e){O(this.cm.display.cursorDiv,e.cursors),O(this.cm.display.selectionDiv,e.selection)},Ja.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ja.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return D(this.div,t)},Ja.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&P()==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ja.prototype.blur=function(){this.div.blur()},Ja.prototype.getField=function(){return this.div},Ja.prototype.supportsTouch=function(){return!0},Ja.prototype.receivedFocus=function(){var e=this;function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.selectionInEditor()?this.pollSelection():Ni(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,t)},Ja.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ja.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(g&&u&&this.cm.display.gutterSpecs.length&&Za(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=ns(t,e.anchorNode,e.anchorOffset),r=ns(t,e.focusNode,e.focusOffset);n&&r&&Ni(t,(function(){jo(t.doc,lo(n,r),K),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)}))}}},Ja.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,r=this.cm,i=r.display,o=r.doc.sel.primary(),l=o.from(),a=o.to();if(0==l.ch&&l.line>r.firstLine()&&(l=it(l.line-1,_e(r.doc,l.line-1).length)),a.ch==_e(r.doc,a.line).text.length&&a.line<r.lastLine()&&(a=it(a.line+1,0)),l.line<i.viewFrom||a.line>i.viewTo-1)return!1;l.line==i.viewFrom||0==(e=Er(r,l.line))?(t=et(i.view[0].line),n=i.view[0].node):(t=et(i.view[e].line),n=i.view[e-1].node.nextSibling);var s,c,u=Er(r,a.line);if(u==i.view.length-1?(s=i.viewTo-1,c=i.lineDiv.lastChild):(s=et(i.view[u+1].line)-1,c=i.view[u+1].node.previousSibling),!n)return!1;var f=r.doc.splitLines(ts(r,n,c,t,s)),h=Je(r.doc,it(t,0),it(s,_e(r.doc,s).text.length));while(f.length>1&&h.length>1)if($(f)==$(h))f.pop(),h.pop(),s--;else{if(f[0]!=h[0])break;f.shift(),h.shift(),t++}var d=0,p=0,m=f[0],g=h[0],v=Math.min(m.length,g.length);while(d<v&&m.charCodeAt(d)==g.charCodeAt(d))++d;var y=$(f),x=$(h),b=Math.min(y.length-(1==f.length?d:0),x.length-(1==h.length?d:0));while(p<b&&y.charCodeAt(y.length-p-1)==x.charCodeAt(x.length-p-1))++p;if(1==f.length&&1==h.length&&t==l.line)while(d&&d>l.ch&&y.charCodeAt(y.length-p-1)==x.charCodeAt(x.length-p-1))d--,p++;f[f.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),f[0]=f[0].slice(d).replace(/\u200b+$/,"");var w=it(t,d),C=it(s,h.length?$(h).length-p:0);return f.length>1||f[0]||ot(w,C)?(rl(r.doc,f,w,C,"+input"),!0):void 0},Ja.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ja.prototype.reset=function(){this.forceCompositionEnd()},Ja.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ja.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))},Ja.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Ni(this.cm,(function(){return Hr(e.cm)}))},Ja.prototype.setUneditable=function(e){e.contentEditable="false"},Ja.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Di(this.cm,Ua)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ja.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ja.prototype.onContextMenu=function(){},Ja.prototype.resetPosition=function(){},Ja.prototype.needsContentAttribute=!0;var is=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new I,this.hasSelection=!1,this.composing=null};function os(e,t){if(t=t?B(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=P();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=a.getValue()}var i;if(e.form&&(pe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=l}}catch(s){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(ge(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var a=Ha((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return a}function ls(e){e.off=ge,e.on=pe,e.wheelEventPixels=to,e.Doc=Cl,e.splitLines=We,e.countColumn=R,e.findColumn=q,e.isWordChar=te,e.Pass=U,e.signal=ve,e.Line=sn,e.changeEnd=ao,e.scrollbarModel=xi,e.Pos=it,e.cmpPos=ot,e.modes=Re,e.mimeModes=Ie,e.resolveMode=Ue,e.getMode=Ke,e.modeExtensions=Ge,e.extendMode=Ve,e.copyState=qe,e.startState=Ye,e.innerMode=Xe,e.commands=_l,e.keyMap=Bl,e.keyName=Kl,e.isModifierKey=jl,e.lookupKey=zl,e.normalizeKeyMap=Il,e.StringStream=$e,e.SharedTextMarker=gl,e.TextMarker=pl,e.LineWidget=ul,e.e_preventDefault=Ce,e.e_stopPropagation=Se,e.e_stop=Le,e.addClass=W,e.contains=D,e.rmClass=T,e.keyNames=Wl}is.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!ye(r,e)){if(r.somethingSelected())ja({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Va(r);ja({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,K):(n.prevInput="",i.value=t.text.join("\n"),E(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(i.style.width="0px"),pe(i,"input",(function(){l&&a>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),pe(i,"paste",(function(e){ye(r,e)||Ka(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),pe(i,"cut",o),pe(i,"copy",o),pe(e.scroller,"paste",(function(t){if(!Kn(e,t)&&!ye(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),pe(e.lineSpace,"selectstart",(function(t){Kn(e,t)||Ce(t)})),pe(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"})}})),pe(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},is.prototype.createField=function(e){this.wrapper=Xa(),this.textarea=this.wrapper.firstChild},is.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},is.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Kr(e);if(e.options.moveInputWithCursor){var i=yr(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return r},is.prototype.showSelection=function(e){var t=this.cm,n=t.display;O(n.cursorDiv,e.cursors),O(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},is.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&&E(this.textarea),l&&a>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",l&&a>=9&&(this.hasSelection=null))}},is.prototype.getField=function(){return this.textarea},is.prototype.supportsTouch=function(){return!1},is.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||P()!=this.textarea))try{this.textarea.focus()}catch(e){}},is.prototype.blur=function(){this.textarea.blur()},is.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},is.prototype.receivedFocus=function(){this.slowPoll()},is.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},is.prototype.fastPoll=function(){var e=!1,t=this;function n(){var r=t.poll();r||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}t.pollingFast=!0,t.polling.set(20,n)},is.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Fe(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(l&&a>=9&&this.hasSelection===i||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="\u200b"),8666==o)return this.reset(),this.cm.execCommand("undo")}var s=0,c=Math.min(r.length,i.length);while(s<c&&r.charCodeAt(s)==i.charCodeAt(s))++s;return Ni(t,(function(){Ua(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},is.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},is.prototype.onKeyPress=function(){l&&a>=9&&(this.hasSelection=null),this.fastPoll()},is.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Fr(n,e),c=r.scroller.scrollTop;if(o&&!f){var u=n.options.resetSelectionOnContextMenu;u&&-1==n.doc.sel.contains(o)&&Di(n,jo)(n.doc,lo(o),K);var h,d=i.style.cssText,p=t.wrapper.style.cssText,m=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n      top: "+(e.clientY-m.top-5)+"px; left: "+(e.clientX-m.left-5)+"px;\n      z-index: 1000; background: "+(l?"rgba(255, 255, 255, .05)":"transparent")+";\n      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",s&&(h=window.scrollY),r.input.focus(),s&&window.scrollTo(null,h),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=y,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),l&&a>=9&&v(),S){Le(e);var g=function e(){ge(window,"mouseup",e),setTimeout(y,20)};pe(window,"mouseup",g)}else setTimeout(y,50)}function v(){if(null!=i.selectionStart){var e=n.somethingSelected(),o="\u200b"+(e?i.value:"");i.value="\u21da",i.value=o,t.prevInput=e?"":"\u200b",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function y(){if(t.contextMenuPending==y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=p,i.style.cssText=d,l&&a<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=i.selectionStart)){(!l||l&&a<9)&&v();var e=0,o=function o(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"\u200b"==t.prevInput?Di(n,$o)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},is.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},is.prototype.setUneditable=function(){},is.prototype.needsContentAttribute=!1,Wa(Ha),Ya(Ha);var as="iter insert remove copy getEditor constructor".split(" ");for(var ss in Cl.prototype)Cl.prototype.hasOwnProperty(ss)&&z(as,ss)<0&&(Ha.prototype[ss]=function(e){return function(){return e.apply(this.doc,arguments)}}(Cl.prototype[ss]));return we(Cl),Ha.inputStyles={textarea:is,contenteditable:Ja},Ha.defineMode=function(e){Ha.defaults.mode||"null"==e||(Ha.defaults.mode=e),ze.apply(this,arguments)},Ha.defineMIME=je,Ha.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Ha.defineMIME("text/plain","null"),Ha.defineExtension=function(e,t){Ha.prototype[e]=t},Ha.defineDocExtension=function(e,t){Cl.prototype[e]=t},Ha.fromTextArea=os,ls(Ha),Ha.version="5.62.3",Ha}))},aX69:function(e,t,n){},"anB+":function(e,t,n){},bXjK:function(e,t,n){(function(e){e(n("VrN/"))})((function(e){"use strict";function t(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",e.refresh()}function n(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var n=e.state.fullScreenRestore;t.style.width=n.width,t.style.height=n.height,window.scrollTo(n.scrollLeft,n.scrollTop),e.refresh()}e.defineOption("fullScreen",!1,(function(r,i,o){o==e.Init&&(o=!1),!o!=!i&&(i?t(r):n(r))}))}))},cokd:function(e,t,n){(function(e){e(n("VrN/"))})((function(e){"use strict";var t={},n=/[^\s\u00a0]/,r=e.Pos,i=e.cmpPos;function o(e){var t=e.search(n);return-1==t?0:t}function l(e,t,n){return/\bstring\b/.test(e.getTokenTypeAt(r(t.line,0)))&&!/^[\'\"\`]/.test(n)}function a(e,t){var n=e.getMode();return!1!==n.useInnerComments&&n.innerMode?e.getModeAt(t):n}e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",(function(e){e||(e=t);for(var n=this,i=1/0,o=this.listSelections(),l=null,a=o.length-1;a>=0;a--){var s=o[a].from(),c=o[a].to();s.line>=i||(c.line>=i&&(c=r(i,0)),i=s.line,null==l?n.uncomment(s,c,e)?l="un":(n.lineComment(s,c,e),l="line"):"un"==l?n.uncomment(s,c,e):n.lineComment(s,c,e))}})),e.defineExtension("lineComment",(function(e,i,s){s||(s=t);var c=this,u=a(c,e),f=c.getLine(e.line);if(null!=f&&!l(c,e,f)){var h=s.lineComment||u.lineComment;if(h){var d=Math.min(0!=i.ch||i.line==e.line?i.line+1:i.line,c.lastLine()+1),p=null==s.padding?" ":s.padding,m=s.commentBlankLines||e.line==i.line;c.operation((function(){if(s.indent){for(var t=null,i=e.line;i<d;++i){var l=c.getLine(i),a=l.slice(0,o(l));(null==t||t.length>a.length)&&(t=a)}for(i=e.line;i<d;++i){l=c.getLine(i);var u=t.length;(m||n.test(l))&&(l.slice(0,u)!=t&&(u=o(l)),c.replaceRange(t+h+p,r(i,0),r(i,u)))}}else for(i=e.line;i<d;++i)(m||n.test(c.getLine(i)))&&c.replaceRange(h+p,r(i,0))}))}else(s.blockCommentStart||u.blockCommentStart)&&(s.fullLines=!0,c.blockComment(e,i,s))}})),e.defineExtension("blockComment",(function(e,o,l){l||(l=t);var s=this,c=a(s,e),u=l.blockCommentStart||c.blockCommentStart,f=l.blockCommentEnd||c.blockCommentEnd;if(u&&f){if(!/\bcomment\b/.test(s.getTokenTypeAt(r(e.line,0)))){var h=Math.min(o.line,s.lastLine());h!=e.line&&0==o.ch&&n.test(s.getLine(h))&&--h;var d=null==l.padding?" ":l.padding;e.line>h||s.operation((function(){if(0!=l.fullLines){var t=n.test(s.getLine(h));s.replaceRange(d+f,r(h)),s.replaceRange(u+d,r(e.line,0));var a=l.blockCommentLead||c.blockCommentLead;if(null!=a)for(var p=e.line+1;p<=h;++p)(p!=h||t)&&s.replaceRange(a+d,r(p,0))}else{var m=0==i(s.getCursor("to"),o),g=!s.somethingSelected();s.replaceRange(f,o),m&&s.setSelection(g?o:s.getCursor("from"),o),s.replaceRange(u,e)}}))}}else(l.lineComment||c.lineComment)&&0!=l.fullLines&&s.lineComment(e,o,l)})),e.defineExtension("uncomment",(function(e,i,o){o||(o=t);var l,s=this,c=a(s,e),u=Math.min(0!=i.ch||i.line==e.line?i.line:i.line-1,s.lastLine()),f=Math.min(e.line,u),h=o.lineComment||c.lineComment,d=[],p=null==o.padding?" ":o.padding;e:if(h){for(var m=f;m<=u;++m){var g=s.getLine(m),v=g.indexOf(h);if(v>-1&&!/comment/.test(s.getTokenTypeAt(r(m,v+1)))&&(v=-1),-1==v&&n.test(g))break e;if(v>-1&&n.test(g.slice(0,v)))break e;d.push(g)}if(s.operation((function(){for(var e=f;e<=u;++e){var t=d[e-f],n=t.indexOf(h),i=n+h.length;n<0||(t.slice(i,i+p.length)==p&&(i+=p.length),l=!0,s.replaceRange("",r(e,n),r(e,i)))}})),l)return!0}var y=o.blockCommentStart||c.blockCommentStart,x=o.blockCommentEnd||c.blockCommentEnd;if(!y||!x)return!1;var b=o.blockCommentLead||c.blockCommentLead,w=s.getLine(f),C=w.indexOf(y);if(-1==C)return!1;var S=u==f?w:s.getLine(u),k=S.indexOf(x,u==f?C+y.length:0),L=r(f,C+1),T=r(u,k+1);if(-1==k||!/comment/.test(s.getTokenTypeAt(L))||!/comment/.test(s.getTokenTypeAt(T))||s.getRange(L,T,"\n").indexOf(x)>-1)return!1;var M=w.lastIndexOf(y,e.ch),O=-1==M?-1:w.slice(0,e.ch).indexOf(x,M+y.length);if(-1!=M&&-1!=O&&O+x.length!=e.ch)return!1;O=S.indexOf(x,i.ch);var A=S.slice(i.ch).lastIndexOf(y,O-i.ch);return M=-1==O||-1==A?-1:i.ch+A,(-1==O||-1==M||M==i.ch)&&(s.operation((function(){s.replaceRange("",r(u,k-(p&&S.slice(k-p.length,k)==p?p.length:0)),r(u,k+x.length));var e=C+y.length;if(p&&w.slice(e,e+p.length)==p&&(e+=p.length),s.replaceRange("",r(f,C),r(f,e)),b)for(var t=f+1;t<=u;++t){var i=s.getLine(t),o=i.indexOf(b);if(-1!=o&&!n.test(i.slice(0,o))){var l=o+b.length;p&&i.slice(l,l+p.length)==p&&(l+=p.length),s.replaceRange("",r(t,o),r(t,l))}}})),!0)}))}))},enqM:function(e,t,n){},jDMi:function(e,t,n){(function(e){e(n("VrN/"))})((function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=e.Pos,r={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function i(e){return e&&e.bracketRegex||/[(){}[\]]/}function o(e,t,o){var a=e.getLineHandle(t.line),s=t.ch-1,c=o&&o.afterCursor;null==c&&(c=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var u=i(o),f=!c&&s>=0&&u.test(a.text.charAt(s))&&r[a.text.charAt(s)]||u.test(a.text.charAt(s+1))&&r[a.text.charAt(++s)];if(!f)return null;var h=">"==f.charAt(1)?1:-1;if(o&&o.strict&&h>0!=(s==t.ch))return null;var d=e.getTokenTypeAt(n(t.line,s+1)),p=l(e,n(t.line,s+(h>0?1:0)),h,d,o);return null==p?null:{from:n(t.line,s),to:p&&p.pos,match:p&&p.ch==f.charAt(0),forward:h>0}}function l(e,t,o,l,a){for(var s=a&&a.maxScanLineLength||1e4,c=a&&a.maxScanLines||1e3,u=[],f=i(a),h=o>0?Math.min(t.line+c,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-c),d=t.line;d!=h;d+=o){var p=e.getLine(d);if(p){var m=o>0?0:p.length-1,g=o>0?p.length:-1;if(!(p.length>s))for(d==t.line&&(m=t.ch-(o<0?1:0));m!=g;m+=o){var v=p.charAt(m);if(f.test(v)&&(void 0===l||(e.getTokenTypeAt(n(d,m+1))||"")==(l||""))){var y=r[v];if(y&&">"==y.charAt(1)==o>0)u.push(v);else{if(!u.length)return{pos:n(d,m),ch:v};u.pop()}}}}}return d-o!=(o>0?e.lastLine():e.firstLine())&&null}function a(e,r,i){for(var l=e.state.matchBrackets.maxHighlightLineLength||1e3,a=i&&i.highlightNonMatching,s=[],c=e.listSelections(),u=0;u<c.length;u++){var f=c[u].empty()&&o(e,c[u].head,i);if(f&&(f.match||!1!==a)&&e.getLine(f.from.line).length<=l){var h=f.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";s.push(e.markText(f.from,n(f.from.line,f.from.ch+1),{className:h})),f.to&&e.getLine(f.to.line).length<=l&&s.push(e.markText(f.to,n(f.to.line,f.to.ch+1),{className:h}))}}if(s.length){t&&e.state.focused&&e.focus();var d=function(){e.operation((function(){for(var e=0;e<s.length;e++)s[e].clear()}))};if(!r)return d;setTimeout(d,800)}}function s(e){e.operation((function(){e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null),e.state.matchBrackets.currentlyHighlighted=a(e,!1,e.state.matchBrackets)}))}function c(e){e.state.matchBrackets&&e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null)}e.defineOption("matchBrackets",!1,(function(t,n,r){r&&r!=e.Init&&(t.off("cursorActivity",s),t.off("focus",s),t.off("blur",c),c(t)),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",s),t.on("focus",s),t.on("blur",c))})),e.defineExtension("matchBrackets",(function(){a(this,!0)})),e.defineExtension("findMatchingBracket",(function(e,t,n){return(n||"boolean"==typeof t)&&(n?(n.strict=t,t=n):t=t?{strict:!0}:null),o(this,e,t)})),e.defineExtension("scanForBracket",(function(e,t,n,r){return l(this,e,t,n,r)}))}))},jXCp:function(e,t,n){(function(e){e(n("VrN/"))})((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,l=r.line+1,a=n.lastLine();l<=a;++l){var s=t(n,l);if(-1==s);else{if(!(s>i))break;o=l}}return o?{from:e.Pos(r.line,n.getLine(r.line).length),to:e.Pos(o,n.getLine(o).length)}:void 0}}))}))},mki7:function(e,t,n){(function(e){e(n("VrN/"),n("uTOq"),n("jDMi"))})((function(e){"use strict";var t=e.commands,n=e.Pos;function r(t,r,i){if(i<0&&0==r.ch)return t.clipPos(n(r.line-1));var o=t.getLine(r.line);if(i>0&&r.ch>=o.length)return t.clipPos(n(r.line+1,0));for(var l,a="start",s=r.ch,c=s,u=i<0?0:o.length,f=0;c!=u;c+=i,f++){var h=o.charAt(i<0?c-1:c),d="_"!=h&&e.isWordChar(h)?"w":"o";if("w"==d&&h.toUpperCase()==h&&(d="W"),"start"==a)"o"!=d?(a="in",l=d):s=c+i;else if("in"==a&&l!=d){if("w"==l&&"W"==d&&i<0&&c--,"W"==l&&"w"==d&&i>0){if(c==s+1){l="w";continue}c--}break}}return n(r.line,c)}function i(e,t){e.extendSelectionsBy((function(n){return e.display.shift||e.doc.extend||n.empty()?r(e.doc,n.head,t):t<0?n.from():n.to()}))}function o(t,r){if(t.isReadOnly())return e.Pass;t.operation((function(){for(var e=t.listSelections().length,i=[],o=-1,l=0;l<e;l++){var a=t.listSelections()[l].head;if(!(a.line<=o)){var s=n(a.line+(r?0:1),0);t.replaceRange("\n",s,null,"+insertLine"),t.indentLine(s.line,null,!0),i.push({head:s,anchor:s}),o=a.line+1}}t.setSelections(i)})),t.execCommand("indentAuto")}function l(t,r){var i=r.ch,o=i,l=t.getLine(r.line);while(i&&e.isWordChar(l.charAt(i-1)))--i;while(o<l.length&&e.isWordChar(l.charAt(o)))++o;return{from:n(r.line,i),to:n(r.line,o),word:l.slice(i,o)}}function a(e,t){for(var n=e.listSelections(),r=[],i=0;i<n.length;i++){var o=n[i],l=e.findPosV(o.anchor,t,"line",o.anchor.goalColumn),a=e.findPosV(o.head,t,"line",o.head.goalColumn);l.goalColumn=null!=o.anchor.goalColumn?o.anchor.goalColumn:e.cursorCoords(o.anchor,"div").left,a.goalColumn=null!=o.head.goalColumn?o.head.goalColumn:e.cursorCoords(o.head,"div").left;var s={anchor:l,head:a};r.push(o),r.push(s)}e.setSelections(r)}function s(t,n,r){for(var i=0;i<t.length;i++)if(0==e.cmpPos(t[i].from(),n)&&0==e.cmpPos(t[i].to(),r))return!0;return!1}t.goSubwordLeft=function(e){i(e,-1)},t.goSubwordRight=function(e){i(e,1)},t.scrollLineUp=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top+t.clientHeight,"local");e.getCursor().line>=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},t.scrollLineDown=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},t.splitSelectionByLine=function(e){for(var t=e.listSelections(),r=[],i=0;i<t.length;i++)for(var o=t[i].from(),l=t[i].to(),a=o.line;a<=l.line;++a)l.line>o.line&&a==l.line&&0==l.ch||r.push({anchor:a==o.line?o:n(a,0),head:a==l.line?l:n(a)});e.setSelections(r,0)},t.singleSelectionTop=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},t.selectLine=function(e){for(var t=e.listSelections(),r=[],i=0;i<t.length;i++){var o=t[i];r.push({anchor:n(o.from().line,0),head:n(o.to().line+1,0)})}e.setSelections(r)},t.insertLineAfter=function(e){return o(e,!1)},t.insertLineBefore=function(e){return o(e,!0)},t.selectNextOccurrence=function(t){var r=t.getCursor("from"),i=t.getCursor("to"),o=t.state.sublimeFindFullWord==t.doc.sel;if(0==e.cmpPos(r,i)){var a=l(t,r);if(!a.word)return;t.setSelection(a.from,a.to),o=!0}else{var c=t.getRange(r,i),u=o?new RegExp("\\b"+c+"\\b"):c,f=t.getSearchCursor(u,i),h=f.findNext();if(h||(f=t.getSearchCursor(u,n(t.firstLine(),0)),h=f.findNext()),!h||s(t.listSelections(),f.from(),f.to()))return;t.addSelection(f.from(),f.to())}o&&(t.state.sublimeFindFullWord=t.doc.sel)},t.skipAndSelectNextOccurrence=function(n){var r=n.getCursor("anchor"),i=n.getCursor("head");t.selectNextOccurrence(n),0!=e.cmpPos(r,i)&&n.doc.setSelections(n.doc.listSelections().filter((function(e){return e.anchor!=r||e.head!=i})))},t.addCursorToPrevLine=function(e){a(e,-1)},t.addCursorToNextLine=function(e){a(e,1)};var c="(){}[]";function u(t){for(var r=t.listSelections(),i=[],o=0;o<r.length;o++){var l=r[o],a=l.head,s=t.scanForBracket(a,-1);if(!s)return!1;for(;;){var u=t.scanForBracket(a,1);if(!u)return!1;if(u.ch==c.charAt(c.indexOf(s.ch)+1)){var f=n(s.pos.line,s.pos.ch+1);if(0!=e.cmpPos(f,l.from())||0!=e.cmpPos(u.pos,l.to())){i.push({anchor:f,head:u.pos});break}if(s=t.scanForBracket(s.pos,-1),!s)return!1}a=n(u.pos.line,u.pos.ch+1)}}return t.setSelections(i),!0}function f(e){return e?/\bpunctuation\b/.test(e)?e:void 0:null}function h(t,r,i){if(t.isReadOnly())return e.Pass;for(var o,l=t.listSelections(),a=[],s=0;s<l.length;s++){var c=l[s];if(!c.empty()){var u=c.from().line,f=c.to().line;while(s<l.length-1&&l[s+1].from().line==f)f=l[++s].to().line;l[s].to().ch||f--,a.push(u,f)}}a.length?o=!0:a.push(t.firstLine(),t.lastLine()),t.operation((function(){for(var e=[],l=0;l<a.length;l+=2){var s=a[l],c=a[l+1],u=n(s,0),f=n(c),h=t.getRange(u,f,!1);r?h.sort((function(e,t){return e<t?-i:e==t?0:i})):h.sort((function(e,t){var n=e.toUpperCase(),r=t.toUpperCase();return n!=r&&(e=n,t=r),e<t?-i:e==t?0:i})),t.replaceRange(h,u,f),o&&e.push({anchor:u,head:n(c+1,0)})}o&&t.setSelections(e,0)}))}function d(t,n){t.operation((function(){for(var r=t.listSelections(),i=[],o=[],a=0;a<r.length;a++){var s=r[a];s.empty()?(i.push(a),o.push("")):o.push(n(t.getRange(s.from(),s.to())))}t.replaceSelections(o,"around","case");var c;for(a=i.length-1;a>=0;a--){s=r[i[a]];if(!(c&&e.cmpPos(s.head,c)>0)){var u=l(t,s.head);c=u.from,t.replaceRange(n(u.word),u.from,u.to)}}}))}function p(t){var n=t.getCursor("from"),r=t.getCursor("to");if(0==e.cmpPos(n,r)){var i=l(t,n);if(!i.word)return;n=i.from,r=i.to}return{from:n,to:r,query:t.getRange(n,r),word:i}}function m(e,t){var r=p(e);if(r){var i=r.query,o=e.getSearchCursor(i,t?r.to:r.from);(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):(o=e.getSearchCursor(i,t?n(e.firstLine(),0):e.clipPos(n(e.lastLine()))),(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):r.word&&e.setSelection(r.from,r.to))}}t.selectScope=function(e){u(e)||e.execCommand("selectAll")},t.selectBetweenBrackets=function(t){if(!u(t))return e.Pass},t.goToBracket=function(t){t.extendSelectionsBy((function(r){var i=t.scanForBracket(r.head,1,f(t.getTokenTypeAt(r.head)));if(i&&0!=e.cmpPos(i.pos,r.head))return i.pos;var o=t.scanForBracket(r.head,-1,f(t.getTokenTypeAt(n(r.head.line,r.head.ch+1))));return o&&n(o.pos.line,o.pos.ch+1)||r.head}))},t.swapLineUp=function(t){if(t.isReadOnly())return e.Pass;for(var r=t.listSelections(),i=[],o=t.firstLine()-1,l=[],a=0;a<r.length;a++){var s=r[a],c=s.from().line-1,u=s.to().line;l.push({anchor:n(s.anchor.line-1,s.anchor.ch),head:n(s.head.line-1,s.head.ch)}),0!=s.to().ch||s.empty()||--u,c>o?i.push(c,u):i.length&&(i[i.length-1]=u),o=u}t.operation((function(){for(var e=0;e<i.length;e+=2){var r=i[e],o=i[e+1],a=t.getLine(r);t.replaceRange("",n(r,0),n(r+1,0),"+swapLine"),o>t.lastLine()?t.replaceRange("\n"+a,n(t.lastLine()),null,"+swapLine"):t.replaceRange(a+"\n",n(o,0),null,"+swapLine")}t.setSelections(l),t.scrollIntoView()}))},t.swapLineDown=function(t){if(t.isReadOnly())return e.Pass;for(var r=t.listSelections(),i=[],o=t.lastLine()+1,l=r.length-1;l>=0;l--){var a=r[l],s=a.to().line+1,c=a.from().line;0!=a.to().ch||a.empty()||s--,s<o?i.push(s,c):i.length&&(i[i.length-1]=c),o=c}t.operation((function(){for(var e=i.length-2;e>=0;e-=2){var r=i[e],o=i[e+1],l=t.getLine(r);r==t.lastLine()?t.replaceRange("",n(r-1),n(r),"+swapLine"):t.replaceRange("",n(r,0),n(r+1,0),"+swapLine"),t.replaceRange(l+"\n",n(o,0),null,"+swapLine")}t.scrollIntoView()}))},t.toggleCommentIndented=function(e){e.toggleComment({indent:!0})},t.joinLines=function(e){for(var t=e.listSelections(),r=[],i=0;i<t.length;i++){var o=t[i],l=o.from(),a=l.line,s=o.to().line;while(i<t.length-1&&t[i+1].from().line==s)s=t[++i].to().line;r.push({start:a,end:s,anchor:!o.empty()&&l})}e.operation((function(){for(var t=0,i=[],o=0;o<r.length;o++){for(var l,a=r[o],s=a.anchor&&n(a.anchor.line-t,a.anchor.ch),c=a.start;c<=a.end;c++){var u=c-t;c==a.end&&(l=n(u,e.getLine(u).length+1)),u<e.lastLine()&&(e.replaceRange(" ",n(u),n(u+1,/^\s*/.exec(e.getLine(u+1))[0].length)),++t)}i.push({anchor:s||l,head:l})}e.setSelections(i,0)}))},t.duplicateLine=function(e){e.operation((function(){for(var t=e.listSelections().length,r=0;r<t;r++){var i=e.listSelections()[r];i.empty()?e.replaceRange(e.getLine(i.head.line)+"\n",n(i.head.line,0)):e.replaceRange(e.getRange(i.from(),i.to()),i.from())}e.scrollIntoView()}))},t.sortLines=function(e){h(e,!0,1)},t.reverseSortLines=function(e){h(e,!0,-1)},t.sortLinesInsensitive=function(e){h(e,!1,1)},t.reverseSortLinesInsensitive=function(e){h(e,!1,-1)},t.nextBookmark=function(e){var t=e.state.sublimeBookmarks;if(t)while(t.length){var n=t.shift(),r=n.find();if(r)return t.push(n),e.setSelection(r.from,r.to)}},t.prevBookmark=function(e){var t=e.state.sublimeBookmarks;if(t)while(t.length){t.unshift(t.pop());var n=t[t.length-1].find();if(n)return e.setSelection(n.from,n.to);t.pop()}},t.toggleBookmark=function(e){for(var t=e.listSelections(),n=e.state.sublimeBookmarks||(e.state.sublimeBookmarks=[]),r=0;r<t.length;r++){for(var i=t[r].from(),o=t[r].to(),l=t[r].empty()?e.findMarksAt(i):e.findMarks(i,o),a=0;a<l.length;a++)if(l[a].sublimeBookmark){l[a].clear();for(var s=0;s<n.length;s++)n[s]==l[a]&&n.splice(s--,1);break}a==l.length&&n.push(e.markText(i,o,{sublimeBookmark:!0,clearWhenEmpty:!1}))}},t.clearBookmarks=function(e){var t=e.state.sublimeBookmarks;if(t)for(var n=0;n<t.length;n++)t[n].clear();t.length=0},t.selectBookmarks=function(e){var t=e.state.sublimeBookmarks,n=[];if(t)for(var r=0;r<t.length;r++){var i=t[r].find();i?n.push({anchor:i.from,head:i.to}):t.splice(r--,0)}n.length&&e.setSelections(n,0)},t.smartBackspace=function(t){if(t.somethingSelected())return e.Pass;t.operation((function(){for(var r=t.listSelections(),i=t.getOption("indentUnit"),o=r.length-1;o>=0;o--){var l=r[o].head,a=t.getRange({line:l.line,ch:0},l),s=e.countColumn(a,null,t.getOption("tabSize")),c=t.findPosH(l,-1,"char",!1);if(a&&!/\S/.test(a)&&s%i==0){var u=new n(l.line,e.findColumn(a,s-i,i));u.ch!=l.ch&&(c=u)}t.replaceRange("",c,l,"+delete")}}))},t.delLineRight=function(e){e.operation((function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange("",t[r].anchor,n(t[r].to().line),"+delete");e.scrollIntoView()}))},t.upcaseAtCursor=function(e){d(e,(function(e){return e.toUpperCase()}))},t.downcaseAtCursor=function(e){d(e,(function(e){return e.toLowerCase()}))},t.setSublimeMark=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},t.selectToSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},t.deleteToSublimeMark=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var r=t.getCursor(),i=n;if(e.cmpPos(r,i)>0){var o=i;i=r,r=o}t.state.sublimeKilled=t.getRange(r,i),t.replaceRange("",r,i)}},t.swapWithSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},t.sublimeYank=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},t.showInCenter=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},t.findUnder=function(e){m(e,!0)},t.findUnderPrevious=function(e){m(e,!1)},t.findAllUnder=function(e){var t=p(e);if(t){var n=e.getSearchCursor(t.query),r=[],i=-1;while(n.findNext())r.push({anchor:n.from(),head:n.to()}),n.from().line<=t.from.line&&n.from().ch<=t.from.ch&&i++;e.setSelections(r,i)}};var g=e.keyMap;g.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F5:"sortLines","Shift-F5":"reverseSortLines","Cmd-F5":"sortLinesInsensitive","Shift-Cmd-F5":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-D":"skipAndSelectNextOccurrence","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-1":"foldAll","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},e.normalizeKeyMap(g.macSublime),g.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Shift-F9":"reverseSortLines","Ctrl-F9":"sortLinesInsensitive","Shift-Ctrl-F9":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-D":"skipAndSelectNextOccurrence","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-1":"foldAll","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine","Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},e.normalizeKeyMap(g.pcSublime);var v=g.default==g.macDefault;g.sublime=v?g.macSublime:g.pcSublime}))},rt3J:function(e,t,n){(function(e){e(n("VrN/"))})((function(e){"use strict";e.registerHelper("fold","brace",(function(t,n){var r,i=n.line,o=t.getLine(i);function l(l){for(var a=n.ch,s=0;;){var c=a<=0?-1:o.lastIndexOf(l,a-1);if(-1!=c){if(1==s&&c<n.ch)break;if(r=t.getTokenTypeAt(e.Pos(i,c+1)),!/^(comment|string)/.test(r))return c+1;a=c-1}else{if(1==s)break;s=1,a=o.length}}}var a,s,c,u=l("{"),f=l("[");if(null!=u&&(null==f||f>u))c=u,a="{",s="}";else{if(null==f)return;c=f,a="[",s="]"}var h,d,p=1,m=t.lastLine();e:for(var g=i;g<=m;++g)for(var v=t.getLine(g),y=g==i?c:0;;){var x=v.indexOf(a,y),b=v.indexOf(s,y);if(x<0&&(x=v.length),b<0&&(b=v.length),y=Math.min(x,b),y==v.length)break;if(t.getTokenTypeAt(e.Pos(g,y+1))==r)if(y==x)++p;else if(!--p){h=g,d=y;break e}++y}if(null!=h&&i!=h)return{from:e.Pos(i,c),to:e.Pos(h,d)}})),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 l=t.getLine(i),a=l.indexOf(";");if(-1!=a)return{startCh:r.end,end:e.Pos(i,a)}}}var i,o=n.line,l=r(o);if(!l||r(o-1)||(i=r(o-2))&&i.end.line==o-1)return null;for(var a=l.end;;){var s=r(a.line+1);if(null==s)break;a=s.end}return{from:t.clipPos(e.Pos(o,l.startCh+1)),to:a}})),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 l=i;;){var a=r(l+1);if(null==a)break;++l}return{from:e.Pos(i,o+1),to:t.clipPos(e.Pos(l))}}))}))},"tN+X":function(e,t,n){"use strict";function r(){return r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}function i(e,t,n,r,i,o,l){try{var a=e[o](l),s=a.value}catch(c){return void n(c)}a.done?t(s):Promise.resolve(s).then(r,i)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var l=e.apply(t,n);function a(e){i(l,r,o,a,s,"next",e)}function s(e){i(l,r,o,a,s,"throw",e)}a(void 0)}))}}var l=n("FhfK"),a=n.n(l),s=n("q1tI"),c=n.n(s),u=n("VrN/"),f=n.n(u),h=(n("8EBN"),n("9W6w"),{tabSize:2,autoCloseBrackets:!0,matchBrackets:!0,showCursorWhenSelecting:!0,lineNumbers:!0,fullScreen:!0});function d(e,t){void 0===e&&(e={});var i=e,l=i.options,u=void 0===l?{}:l,d=i.value,p=void 0===d?"":d,m=i.width,g=void 0===m?"100%":m,v=i.height,y=void 0===v?"100%":v,x=i.lazyLoadMode,b=void 0===x||x,w=Object(s["useState"])(),C=w[0],S=w[1],k=Object(s["useRef"])(),L=Object(s["useRef"])(e);function T(){var t=Object.keys(e),n=t.filter((function(e){return/^on+/.test(e)})),r={};return n.forEach((function(e){var t=e.slice(2);t&&t[0]&&(r[e]=t.replace(t[0],t[0].toLowerCase()))})),r}function M(e,t){return O.apply(this,arguments)}function O(){return O=o(a.a.mark((function e(t,r){var i;return a.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(void 0===r&&(r={}),"object"!==typeof r||!window){e.next=8;break}if(i=f.a.findModeByName(r.mode||""),!(b&&i&&i.mode)){e.next=6;break}return e.next=6,n("v4wS")("./"+i.mode+"/"+i.mode+".js");case 6:i&&(r.mode=i.mime),Object.keys(r).forEach((function(e){(r[e]||!1===r[e])&&JSON.stringify(r[e])&&t.setOption(e,r[e])}));case 8:case"end":return e.stop()}}),e)}))),O.apply(this,arguments)}return Object(s["useImperativeHandle"])(t,(function(){return{editor:C}}),[C]),L.current=e,Object(s["useEffect"])((function(){if(!C&&window){var e=f.a.fromTextArea(k.current,r({},h,u)),t=T();Object.keys(t).forEach((function(n){e.on(t[n],(function(){var e;return(e=L.current)[n].apply(e,arguments)}))})),e.setValue(p||""),(g||y)&&e.setSize(g,y),S(e),M(e,r({},h,u))}return function(){C&&window&&(C.toTextArea(),S(void 0))}}),[]),Object(s["useMemo"])((function(){if(C&&window){var e=C.getValue();void 0!==p&&p!==e&&C.setValue(p)}}),[p]),Object(s["useMemo"])((function(){C&&window&&C.setSize(g,y)}),[g,y]),Object(s["useMemo"])((function(){C&&window&&M(C,r({},h,u))}),[C,u]),c.a.createElement("textarea",{ref:k})}t["a"]=c.a.forwardRef(d)},uTOq:function(e,t,n){(function(e){e(n("VrN/"))})((function(e){"use strict";var t,n,r=e.Pos;function i(e){var t=e.flags;return null!=t?t:(e.ignoreCase?"i":"")+(e.global?"g":"")+(e.multiline?"m":"")}function o(e,t){for(var n=i(e),r=n,o=0;o<t.length;o++)-1==r.indexOf(t.charAt(o))&&(r+=t.charAt(o));return n==r?e:new RegExp(e.source,r)}function l(e){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(e.source)}function a(e,t,n){t=o(t,"g");for(var i=n.line,l=n.ch,a=e.lastLine();i<=a;i++,l=0){t.lastIndex=l;var s=e.getLine(i),c=t.exec(s);if(c)return{from:r(i,c.index),to:r(i,c.index+c[0].length),match:c}}}function s(e,t,n){if(!l(t))return a(e,t,n);t=o(t,"gm");for(var i,s=1,c=n.line,u=e.lastLine();c<=u;){for(var f=0;f<s;f++){if(c>u)break;var h=e.getLine(c++);i=null==i?h:i+"\n"+h}s*=2,t.lastIndex=n.ch;var d=t.exec(i);if(d){var p=i.slice(0,d.index).split("\n"),m=d[0].split("\n"),g=n.line+p.length-1,v=p[p.length-1].length;return{from:r(g,v),to:r(g+m.length-1,1==m.length?v+m[0].length:m[m.length-1].length),match:d}}}}function c(e,t,n){var r,i=0;while(i<=e.length){t.lastIndex=i;var o=t.exec(e);if(!o)break;var l=o.index+o[0].length;if(l>e.length-n)break;(!r||l>r.index+r[0].length)&&(r=o),i=o.index+1}return r}function u(e,t,n){t=o(t,"g");for(var i=n.line,l=n.ch,a=e.firstLine();i>=a;i--,l=-1){var s=e.getLine(i),u=c(s,t,l<0?0:s.length-l);if(u)return{from:r(i,u.index),to:r(i,u.index+u[0].length),match:u}}}function f(e,t,n){if(!l(t))return u(e,t,n);t=o(t,"gm");for(var i,a=1,s=e.getLine(n.line).length-n.ch,f=n.line,h=e.firstLine();f>=h;){for(var d=0;d<a&&f>=h;d++){var p=e.getLine(f--);i=null==i?p:p+"\n"+i}a*=2;var m=c(i,t,s);if(m){var g=i.slice(0,m.index).split("\n"),v=m[0].split("\n"),y=f+g.length,x=g[g.length-1].length;return{from:r(y,x),to:r(y+v.length-1,1==v.length?x+v[0].length:v[v.length-1].length),match:m}}}}function h(e,t,n,r){if(e.length==t.length)return n;for(var i=0,o=n+Math.max(0,e.length-t.length);;){if(i==o)return i;var l=i+o>>1,a=r(e.slice(0,l)).length;if(a==n)return l;a>n?o=l:i=l+1}}function d(e,i,o,l){if(!i.length)return null;var a=l?t:n,s=a(i).split(/\r|\n\r?/);e:for(var c=o.line,u=o.ch,f=e.lastLine()+1-s.length;c<=f;c++,u=0){var d=e.getLine(c).slice(u),p=a(d);if(1==s.length){var m=p.indexOf(s[0]);if(-1==m)continue e;o=h(d,p,m,a)+u;return{from:r(c,h(d,p,m,a)+u),to:r(c,h(d,p,m+s[0].length,a)+u)}}var g=p.length-s[0].length;if(p.slice(g)==s[0]){for(var v=1;v<s.length-1;v++)if(a(e.getLine(c+v))!=s[v])continue e;var y=e.getLine(c+s.length-1),x=a(y),b=s[s.length-1];if(x.slice(0,b.length)==b)return{from:r(c,h(d,p,g,a)+u),to:r(c+s.length-1,h(y,x,b.length,a))}}}}function p(e,i,o,l){if(!i.length)return null;var a=l?t:n,s=a(i).split(/\r|\n\r?/);e:for(var c=o.line,u=o.ch,f=e.firstLine()-1+s.length;c>=f;c--,u=-1){var d=e.getLine(c);u>-1&&(d=d.slice(0,u));var p=a(d);if(1==s.length){var m=p.lastIndexOf(s[0]);if(-1==m)continue e;return{from:r(c,h(d,p,m,a)),to:r(c,h(d,p,m+s[0].length,a))}}var g=s[s.length-1];if(p.slice(0,g.length)==g){var v=1;for(o=c-s.length+1;v<s.length-1;v++)if(a(e.getLine(o+v))!=s[v])continue e;var y=e.getLine(c+1-s.length),x=a(y);if(x.slice(x.length-s[0].length)==s[0])return{from:r(c+1-s.length,h(y,x,y.length-s[0].length,a)),to:r(c,h(d,p,g.length,a))}}}}function m(e,t,n,i){var l;this.atOccurrence=!1,this.doc=e,n=n?e.clipPos(n):r(0,0),this.pos={from:n,to:n},"object"==typeof i?l=i.caseFold:(l=i,i=null),"string"==typeof t?(null==l&&(l=!1),this.matches=function(n,r){return(n?p:d)(e,t,r,l)}):(t=o(t,"gm"),i&&!1===i.multiline?this.matches=function(n,r){return(n?u:a)(e,t,r)}:this.matches=function(n,r){return(n?f:s)(e,t,r)})}String.prototype.normalize?(t=function(e){return e.normalize("NFD").toLowerCase()},n=function(e){return e.normalize("NFD")}):(t=function(e){return e.toLowerCase()},n=function(e){return e}),m.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(t){var n=this.matches(t,this.doc.clipPos(t?this.pos.from:this.pos.to));while(n&&0==e.cmpPos(n.from,n.to))t?n.from.ch?n.from=r(n.from.line,n.from.ch-1):n=n.from.line==this.doc.firstLine()?null:this.matches(t,this.doc.clipPos(r(n.from.line-1))):n.to.ch<this.doc.getLine(n.to.line).length?n.to=r(n.to.line,n.to.ch+1):n=n.to.line==this.doc.lastLine()?null:this.matches(t,r(n.to.line+1,0));if(n)return this.pos=n,this.atOccurrence=!0,this.pos.match||!0;var i=r(t?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:i,to:i},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,n){if(this.atOccurrence){var i=e.splitLines(t);this.doc.replaceRange(i,this.pos.from,this.pos.to,n),this.pos.to=r(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",(function(e,t,n){return new m(this.doc,e,t,n)})),e.defineDocExtension("getSearchCursor",(function(e,t,n){return new m(this,e,t,n)})),e.defineExtension("selectMatches",(function(t,n){var r=[],i=this.getSearchCursor(t,this.getCursor("from"),n);while(i.findNext()){if(e.cmpPos(i.to(),this.getCursor("to"))>0)break;r.push({anchor:i.from(),head:i.to()})}r.length&&this.setSelections(r,0)}))}))},y8iW:function(e,t,n){(function(e){e(n("VrN/"),n("SJVZ"))})((function(e){"use strict";e.defineOption("foldGutter",!1,(function(t,i,o){o&&o!=e.Init&&(t.clearGutter(t.state.foldGutter.options.gutter),t.state.foldGutter=null,t.off("gutterClick",c),t.off("changes",u),t.off("viewportChange",f),t.off("fold",h),t.off("unfold",h),t.off("swapDoc",u)),i&&(t.state.foldGutter=new n(r(i)),s(t),t.on("gutterClick",c),t.on("changes",u),t.on("viewportChange",f),t.on("fold",h),t.on("unfold",h),t.on("swapDoc",u))}));var t=e.Pos;function n(e){this.options=e,this.from=this.to=0}function r(e){return!0===e&&(e={}),null==e.gutter&&(e.gutter="CodeMirror-foldgutter"),null==e.indicatorOpen&&(e.indicatorOpen="CodeMirror-foldgutter-open"),null==e.indicatorFolded&&(e.indicatorFolded="CodeMirror-foldgutter-folded"),e}function i(e,n){for(var r=e.findMarks(t(n,0),t(n+1,0)),i=0;i<r.length;++i)if(r[i].__isFold){var o=r[i].find(-1);if(o&&o.line===n)return r[i]}}function o(e){if("string"==typeof e){var t=document.createElement("div");return t.className=e+" CodeMirror-guttermarker-subtle",t}return e.cloneNode(!0)}function l(e,n,r){var l=e.state.foldGutter.options,s=n-1,c=e.foldOption(l,"minFoldSize"),u=e.foldOption(l,"rangeFinder"),f="string"==typeof l.indicatorFolded&&a(l.indicatorFolded),h="string"==typeof l.indicatorOpen&&a(l.indicatorOpen);e.eachLine(n,r,(function(n){++s;var r=null,a=n.gutterMarkers;if(a&&(a=a[l.gutter]),i(e,s)){if(f&&a&&f.test(a.className))return;r=o(l.indicatorFolded)}else{var d=t(s,0),p=u&&u(e,d);if(p&&p.to.line-p.from.line>=c){if(h&&a&&h.test(a.className))return;r=o(l.indicatorOpen)}}(r||a)&&e.setGutterMarker(n,l.gutter,r)}))}function a(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function s(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation((function(){l(e,t.from,t.to)})),n.from=t.from,n.to=t.to)}function c(e,n,r){var o=e.state.foldGutter;if(o){var l=o.options;if(r==l.gutter){var a=i(e,n);a?a.clear():e.foldCode(t(n,0),l)}}}function u(e){var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){s(e)}),n.foldOnChangeTimeSpan||600)}}function f(e){var t=e.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){var n=e.getViewport();t.from==t.to||n.from-t.to>20||t.from-n.to>20?s(e):e.operation((function(){n.from<t.from&&(l(e,n.from,t.from),t.from=n.from),n.to>t.to&&(l(e,t.to,n.to),t.to=n.to)}))}),n.updateViewportTimeSpan||400)}}function h(e,t){var n=e.state.foldGutter;if(n){var r=t.line;r>=n.from&&r<n.to&&l(e,r,r+1)}}}))}}]);