'use strict';(function(q){"object"==typeof exports&&"object"==typeof module?q(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],q):q(CodeMirror)})(function(q){q.defineMode("javascript",function(oa,r){function p(a,c,f){C=a;J=f;return c}function x(a,c){var f=a.next();if('"'==f||"'"==f)return c.tokenize=pa(f),c.tokenize(a,c);if("."==f&&a.match(/^\d+(?:[eE][+\-]?\d+)?/))return p("number","number");if("."==f&&a.match(".."))return p("spread","meta");
if(/[\[\]{}\(\),;\:\.]/.test(f))return p(f);if("="==f&&a.eat(">"))return p("=>","operator");if("0"==f&&a.eat(/x/i))return a.eatWhile(/[\da-f]/i),p("number","number");if("0"==f&&a.eat(/o/i))return a.eatWhile(/[0-7]/i),p("number","number");if("0"==f&&a.eat(/b/i))return a.eatWhile(/[01]/i),p("number","number");if(/\d/.test(f))return a.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),p("number","number");if("/"==f){if(a.eat("*"))return c.tokenize=K,K(a,c);if(a.eat("/"))return a.skipToEnd(),p("comment","comment");
if(/^(?:operator|sof|keyword c|case|new|[\[{}\(,;:])$/.test(c.lastType)){a:for(var f=!1,d,b=!1;null!=(d=a.next());){if(!f){if("/"==d&&!b)break a;"["==d?b=!0:b&&"]"==d&&(b=!1)}f=!f&&"\\"==d}a.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/);return p("regexp","string-2")}a.eatWhile(L);return p("operator","operator",a.current())}if("`"==f)return c.tokenize=R,R(a,c);if("#"==f)return a.skipToEnd(),p("error","error");if(L.test(f))return a.eatWhile(L),p("operator","operator",a.current());if(S.test(f))return a.eatWhile(S),
f=a.current(),(d=aa.propertyIsEnumerable(f)&&aa[f])&&"."!=c.lastType?p(d.type,d.style,f):p("variable","variable",f)}function pa(a){return function(c,b){var d=!1,e;if(M&&"@"==c.peek()&&c.match(qa))return b.tokenize=x,p("jsonld-keyword","meta");for(;null!=(e=c.next())&&(e!=a||d);)d=!d&&"\\"==e;d||(b.tokenize=x);return p("string","string")}}function K(a,c){for(var b=!1,d;d=a.next();){if("/"==d&&b){c.tokenize=x;break}b="*"==d}return p("comment","comment")}function R(a,c){for(var b=!1,d;null!=(d=a.next());){if(!b&&
("`"==d||"$"==d&&a.eat("{"))){c.tokenize=x;break}b=!b&&"\\"==d}return p("quasi","string-2",a.current())}function T(a,c){c.fatArrowAt&&(c.fatArrowAt=null);var b=a.string.indexOf("=>",a.start);if(!(0>b)){for(var d=0,e=!1,b=b-1;0<=b;--b){var h=a.string.charAt(b),g="([{}])".indexOf(h);if(0<=g&&3>g){if(!d){++b;break}if(0==--d)break}else if(3<=g&&6>g)++d;else if(S.test(h))e=!0;else{if(/["'\/]/.test(h))return;if(e&&!d){++b;break}}}e&&!d&&(c.fatArrowAt=b)}}function ba(a,c,b,d,e,h){this.indented=a;this.column=
c;this.type=b;this.prev=e;this.info=h;null!=d&&(this.align=d)}function g(){for(var a=arguments.length-1;0<=a;a--)e.cc.push(arguments[a])}function b(){g.apply(null,arguments);return!0}function y(a,c){function b(c){for(;c;c=c.next)if(c.name==a)return!0;return!1}var d=e.state;e.marked="function"==c?"deffunc":"argument"==c?"defarg":"def";d.context?b(d.localVars)||(d.localVars={name:a,next:d.localVars}):!b(d.globalVars)&&r.globalVars&&(d.globalVars={name:a,next:d.globalVars})}function D(){e.state.context=
{prev:e.state.context,vars:e.state.localVars};e.state.localVars=ra}function E(){e.state.localVars=e.state.context.vars;e.state.context=e.state.context.prev}function m(a,c){var b=function(){var b=e.state,f=b.indented;if("stat"==b.lexical.type)f=b.lexical.indented;else for(var h=b.lexical;h&&")"==h.type&&h.align;h=h.prev)f=h.indented;b.lexical=new ba(f,e.stream.column(),a,null,b.lexical,c)};b.lex=!0;return b}function k(){var a=e.state;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=a.lexical.indented),
a.lexical=a.lexical.prev)}function n(a){function c(f){return f==a?b():";"==a?g():b(c)}return c}function t(a,c){return"var"==a?b(m("vardef",c.length),U,n(";"),k):"keyword a"==a?b(m("form"),l,t,k):"keyword b"==a?b(m("form"),t,k):"{"==a?b(m("}"),V,k):";"==a?b():"if"==a?("else"==e.state.lexical.info&&e.state.cc[e.state.cc.length-1]==k&&e.state.cc.pop()(),b(m("form"),l,t,k,ca)):"function"==a?b(v):"for"==a?b(m("form"),da,t,k):"variable"==a?b(m("stat"),sa):"switch"==a?b(m("form"),l,m("}","switch"),n("{"),
V,k,k):"case"==a?b(l,n(":")):"default"==a?b(n(":")):"catch"==a?b(m("form"),D,n("("),W,n(")"),t,k,E):"class"==a?b(m("form"),ta,k):"export"==a?b(m("stat"),ua,k):"import"==a?b(m("stat"),va,k):g(m("stat"),l,n(";"),k)}function l(a){return ea(a,!1)}function u(a){return ea(a,!0)}function ea(a,c){if(e.state.fatArrowAt==e.stream.start){var f=c?fa:ga;if("("==a)return b(D,m(")"),F(w,")"),k,n("=>"),f,E);if("variable"==a)return g(D,w,n("=>"),f,E)}f=c?N:G;return wa.hasOwnProperty(a)?b(f):"function"==a?b(v,f):"keyword c"==
a?b(c?ha:X):"("==a?b(m(")"),X,O,n(")"),k,f):"operator"==a||"spread"==a?b(c?u:l):"["==a?b(m("]"),xa,k,f):"{"==a?H(ya,"}",null,f):"quasi"==a?g(P,f):"new"==a?b(za(c)):b()}function X(a){return a.match(/[;\}\)\],]/)?g():g(l)}function ha(a){return a.match(/[;\}\)\],]/)?g():g(u)}function G(a,c){return","==a?b(l):N(a,c,!1)}function N(a,c,f){var d=0==f?G:N,e=0==f?l:u;if("=>"==a)return b(D,f?fa:ga,E);if("operator"==a)return/\+\+|--/.test(c)?b(d):"?"==c?b(l,n(":"),e):b(e);if("quasi"==a)return g(P,d);if(";"!=
a){if("("==a)return H(u,")","call",d);if("."==a)return b(Aa,d);if("["==a)return b(m("]"),X,n("]"),k,d)}}function P(a,c){return"quasi"!=a?g():"${"!=c.slice(c.length-2)?b(P):b(l,Ba)}function Ba(a){if("}"==a)return e.marked="string-2",e.state.tokenize=R,b(P)}function ga(a){T(e.stream,e.state);return g("{"==a?t:l)}function fa(a){T(e.stream,e.state);return g("{"==a?t:u)}function za(a){return function(c){return"."==c?b(a?Ca:Da):g(a?u:l)}}function Da(a,c){if("target"==c)return e.marked="keyword",b(G)}function Ca(a,
c){if("target"==c)return e.marked="keyword",b(N)}function sa(a){return":"==a?b(k,t):g(G,n(";"),k)}function Aa(a){if("variable"==a)return e.marked="property",b()}function ya(a,c){if("variable"==a||"keyword"==e.style)return e.marked="objprop","get"==c||"set"==c?b(Ea):b(I);if("number"==a||"string"==a)return e.marked=M?"property":e.style+" property",b(I);if("jsonld-keyword"==a)return b(I);if("["==a)return b(l,n("]"),I);if("spread"==a)return b(l)}function Ea(a){if("variable"!=a)return g(I);e.marked="property";
return b(v)}function I(a){if(":"==a)return b(u);if("("==a)return g(v)}function F(a,c){function f(d){return","==d?(d=e.state.lexical,"call"==d.info&&(d.pos=(d.pos||0)+1),b(a,f)):d==c?b():b(n(c))}return function(d){return d==c?b():g(a,f)}}function H(a,c,f){for(var d=3;d<arguments.length;d++)e.cc.push(arguments[d]);return b(m(c,f),F(a,c),k)}function V(a){return"}"==a?b():g(t,V)}function ia(a){if(ja&&":"==a)return b(Fa)}function Ga(a,c){if("="==c)return b(u)}function Fa(a){if("variable"==a)return e.marked=
"variable-3",b()}function U(){return g(w,ia,Y,Ha)}function w(a,c){if("function"==a)return y(c),b();if("variable"==a)return y(c,")"!=e.state.lexical.type||e.state.lexical.prev&&"form"==e.state.lexical.prev.type?null:"argument"),b();if("spread"==a)return b(w);if("["==a)return H(w,"]");if("{"==a)return H(Ia,"}")}function Ia(a,c){if("variable"==a&&!e.stream.match(/^\s*:/,!1))return y(c),b(Y);"variable"==a&&(e.marked="property");return"spread"==a?b(w):b(n(":"),w,Y)}function Y(a,c){if("="==c)return b(u)}
function Ha(a){if(","==a)return b(U)}function ca(a,c){if("keyword b"==a&&"else"==c)return b(m("form","else"),t,k)}function da(a){if("("==a)return b(m(")"),Ja,n(")"),k)}function Ja(a){return"var"==a?b(U,n(";"),Q):";"==a?b(Q):"variable"==a?b(Ka):g(l,n(";"),Q)}function Ka(a,c){return"in"==c||"of"==c?(e.marked="keyword",b(l)):b(G,Q)}function Q(a,c){return";"==a?b(ka):"in"==c||"of"==c?(e.marked="keyword",b(l)):g(l,n(";"),ka)}function ka(a){")"!=a&&b(l)}function v(a,c){if("*"==c)return e.marked="keyword",
b(v);if("variable"==a)return y(c,"function"),b(v);if("("==a)return b(D,m(")"),F(W,")"),k,t,E)}function W(a){return"spread"==a?b(W):g(w,ia,Ga)}function ta(a,c){if("variable"==a)return y(c),b(la)}function la(a,c){if("extends"==c)return b(l,la);if("{"==a)return b(m("}"),z,k)}function z(a,c){if("variable"==a||"keyword"==e.style){if("static"==c)return e.marked="keyword",b(z);e.marked="property";return"get"==c||"set"==c?b(La,v,z):b(v,z)}if("*"==c)return e.marked="keyword",b(z);if(";"==a)return b(z);if("}"==
a)return b()}function La(a){if("variable"!=a)return g();e.marked="property";return b()}function ua(a,c){return"*"==c?(e.marked="keyword",b(ma,n(";"))):"default"==c?(e.marked="keyword",b(l,n(";"))):g(t)}function va(a){return"string"==a?b():g(Z,ma)}function Z(a,c){if("{"==a)return H(Z,"}");"variable"==a&&y(c);"*"==c&&(e.marked="keyword");return b(Ma)}function Ma(a,c){if("as"==c)return e.marked="keyword",b(Z)}function ma(a,c){if("from"==c)return e.marked="keyword",b(l)}function xa(a){return"]"==a?b():
g(u,Na)}function Na(a){return"for"==a?g(O,n("]")):","==a?b(F(ha,"]")):g(F(u,"]"))}function O(a){if("for"==a)return b(da,O);if("if"==a)return b(l,O)}var A=oa.indentUnit,na=r.statementIndent,M=r.jsonld,B=r.json||M,ja=r.typescript,S=r.wordCharacters||/[\w$\xa1-\uffff]/,aa=function(){function a(a){return{type:a,style:"keyword"}}var b=a("keyword a"),f=a("keyword b"),d=a("keyword c"),e=a("operator"),h={type:"atom",style:"atom"},b={"if":a("if"),"while":b,"with":b,"else":f,"do":f,"try":f,"finally":f,"return":d,
"break":d,"continue":d,"new":a("new"),"delete":d,"throw":d,"debugger":d,"var":a("var"),"const":a("var"),let:a("var"),"function":a("function"),"catch":a("catch"),"for":a("for"),"switch":a("switch"),"case":a("case"),"default":a("default"),"in":e,"typeof":e,"instanceof":e,"true":h,"false":h,"null":h,undefined:h,NaN:h,Infinity:h,"this":a("this"),"class":a("class"),"super":a("atom"),yield:d,"export":a("export"),"import":a("import"),"extends":d};if(ja){var f={type:"variable",style:"variable-3"},f={"interface":a("interface"),
"extends":a("extends"),constructor:a("constructor"),"public":a("public"),"private":a("private"),"protected":a("protected"),"static":a("static"),string:f,number:f,"boolean":f,any:f},g;for(g in f)b[g]=f[g]}return b}(),L=/[+\-*&%=<>!?|~^]/,qa=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,C,J,wa={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},e={state:null,column:null,marked:null,cc:null},ra={name:"this",next:{name:"arguments"}};
k.lex=!0;return{startState:function(a){a={tokenize:x,lastType:"sof",cc:[],lexical:new ba((a||0)-A,0,"block",!1),localVars:r.localVars,context:r.localVars&&{vars:r.localVars},indented:0};r.globalVars&&"object"==typeof r.globalVars&&(a.globalVars=r.globalVars);return a},token:function(a,b){a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation(),T(a,b));if(b.tokenize!=K&&a.eatSpace())return null;var f=b.tokenize(a,b);if("comment"==C)return f;b.lastType="operator"!=
C||"++"!=J&&"--"!=J?C:"incdec";a:{var d=C,g=J,h=b.cc;e.state=b;e.stream=a;e.marked=null;e.cc=h;e.style=f;b.lexical.hasOwnProperty("align")||(b.lexical.align=!0);for(;;)if((h.length?h.pop():B?l:t)(d,g)){for(;h.length&&h[h.length-1].lex;)h.pop()();if(e.marked){f=e.marked;break a}if(d="variable"==d)b:{for(d=b.localVars;d;d=d.next)if(d.name==g){d=!0;break b}for(h=b.context;h;h=h.prev)for(d=h.vars;d;d=d.next)if(d.name==g){d=!0;break b}d=void 0}if(d){f="variable-2";break a}break a}}return f},indent:function(a,
b){if(a.tokenize==K)return q.Pass;if(a.tokenize!=x)return 0;var e=b&&b.charAt(0),d=a.lexical;if(!/^\s*else\b/.test(b))for(var g=a.cc.length-1;0<=g;--g){var h=a.cc[g];if(h==k)d=d.prev;else if(h!=ca)break}"stat"==d.type&&"}"==e&&(d=d.prev);na&&")"==d.type&&"stat"==d.prev.type&&(d=d.prev);g=d.type;h=e==g;return"vardef"==g?d.indented+("operator"==a.lastType||","==a.lastType?d.info+1:0):"form"==g&&"{"==e?d.indented:"form"==g?d.indented+A:"stat"==g?(e=d.indented,d="operator"==a.lastType||","==a.lastType||
L.test(b.charAt(0))||/[,.]/.test(b.charAt(0)),e+(d?na||A:0)):"switch"!=d.info||h||0==r.doubleIndentSwitch?d.align?d.column+(h?0:1):d.indented+(h?0:A):d.indented+(/^(?:case|default)\b/.test(b)?A:2*A)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:B?null:"/*",blockCommentEnd:B?null:"*/",lineComment:B?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:B?"json":"javascript",jsonldMode:M,jsonMode:B}});q.registerHelper("wordChars","javascript",/[\w$]/);q.defineMIME("text/javascript",
"javascript");q.defineMIME("text/ecmascript","javascript");q.defineMIME("application/javascript","javascript");q.defineMIME("application/x-javascript","javascript");q.defineMIME("application/ecmascript","javascript");q.defineMIME("application/json",{name:"javascript",json:!0});q.defineMIME("application/x-json",{name:"javascript",json:!0});q.defineMIME("application/ld+json",{name:"javascript",jsonld:!0});q.defineMIME("text/typescript",{name:"javascript",typescript:!0});q.defineMIME("application/typescript",
{name:"javascript",typescript:!0})});
