define("mixins/token_iterator",["require","exports","module"],function(a,n,l){var g=a("ace/token_iterator").TokenIterator,k=a("ace/range").Range;(function(){function a(b,a){return 1===b.length&&("{"===b||"("===b||"["===b||!!a&&"<"===b)}function f(b,a){return 1===b.length&&("}"===b||")"===b||"]"===b||!!a&&">"===b)}function e(b,a,d,e,c){for(var m=1,q,p=b.clone();q=d.call(p);)if(q=a(q),q===c){if(m--,0===m)return b.moveToTokenIterator(p),!0}else q===e&&m++;return!1}var b={"(":")","{":"}","[":"]","<":">",
")":"(","}":"{","]":"[",">":"<"};this.moveToPreviousToken=function(){var b=this.$rowTokens,a=this.$tokenIndex-1;if(0<=a)return this.$tokenIndex--,b[a];a=this.$session;var d=this.$row;if(0>d)return null;for(;;){d--;if(0>d)return null;if((b=a.getTokens(d))&&b.length)return this.$row=d,this.$tokenIndex=b.length-1,this.$rowTokens=b,b[b.length-1]}};this.moveToNextToken=function(){var b=this.$rowTokens,a=this.$tokenIndex+1;if(a<b.length)return this.$tokenIndex++,b[a];a=this.$session;var d=a.getLength(),
e=this.$row;if(e>=d)return null;for(;;){e++;if(e>=d)return null;if((b=a.getTokens(e))&&b.length)return this.$row=e,this.$tokenIndex=0,this.$rowTokens=b,b[0]}};this.moveToNextSignificantToken=function(){if(!this.moveToNextToken())return!1;for(var b=this.getCurrentToken();/^\s+$/.test(b.value)||/\bcomment\b/.test(b.type);){if(!this.moveToNextToken())return!1;b=this.getCurrentToken()}return!0};this.moveToPreviousSignificantToken=function(){if(!this.moveToPreviousToken())return!1;for(var b=this.getCurrentToken();/^\s+$/.test(b.value)||
/\bcomment\b/.test(b.type);){if(!this.moveToPreviousToken())return!1;b=this.getCurrentToken()}return!0};this.moveToStartOfRow=function(){this.$tokenIndex=0;return this.getCurrentToken()};this.moveToEndOfRow=function(){this.$tokenIndex=this.$rowTokens.length-1;return this.getCurrentToken()};this.moveToStartOfNextRowWithTokens=function(){for(var b=this.$row,a=this.$session,d=a.getLength();;){b++;if(b>=d)return null;var e=a.getTokens(b);if(e&&e.length)return this.$row=b,this.$tokenIndex=0,this.$rowTokens=
e,this.getCurrentToken()}};var c,d=0,u=0;this.tokenizeUpToRow=function(b){var a=this.$session.bgTokenizer;d=Math.min(d,a.currentLine);u=Math.max(u,b);for(var e=a.currentLine;e<=b;e++)a.$tokenizeRow(e);clearTimeout(c);c=setTimeout(function(){a.fireUpdateEvent(d,u);d=u;u=0},700)};this.moveToPosition=function(b,a){this.tokenizeUpToRow(b.row);var d=this.$session.getTokenAt(b.row,b.column);d&&a&&d.column<b.column&&(d=this.$session.getTokenAt(b.row,b.column+1));if(null==d){if(a)return this.$row=b.row,this.$rowTokens=
this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1,this.moveToNextToken();this.$row=b.row+1;this.$tokenIndex=0;this.$rowTokens=this.$session.getTokens(this.$row);return this.moveToPreviousToken()}this.$row=b.row;this.$rowTokens=this.$session.getTokens(this.$row);this.$tokenIndex=d.index;return this.getCurrentToken()};this.clone=function(){var b=new g(this.$session,0,0);b.moveToTokenIterator(this);return b};this.moveToTokenIterator=function(b){for(var a in b)b.hasOwnProperty(a)&&
(this[a]=b[a])};this.peekFwd=function(b){for(var a=this.clone(),d=null,e=0;e<b;e++)d=a.moveToNextToken();return d};this.peekBwd=function(b){for(var a=this.clone(),d=null,e=0;e<b;e++)d=a.moveToPreviousToken();return d};this.getCurrentToken=function(){var b=this.$rowTokens[this.$tokenIndex];b&&(b.row=this.$row);return b};this.getCurrentTokenValue=function(){return this.getCurrentToken().value};this.getCurrentTokenPosition=function(){return{row:this.getCurrentTokenRow(),column:this.getCurrentTokenColumn()}};
this.getCurrentTokenRange=function(){var b=this.getCurrentTokenPosition(),a={row:b.row,column:b.column+this.getCurrentToken().value.length};return k.fromPoints(b,a)};this.fwdToMatchingToken=function(){var d=this.getCurrentToken();return a(d.value,!0)?e(this,function(b){return b.value},this.moveToNextToken,d.value,b[d.value]):"support.function.codebegin"===d.type?e(this,function(b){return b.type},this.moveToNextToken,"support.function.codebegin","support.function.codeend"):!1};this.bwdToMatchingToken=
function(){var a=this.getCurrentToken();return f(a.value,!0)?e(this,function(b){return b.value},this.moveToPreviousToken,a.value,b[a.value]):"support.function.codeend"===a.type?e(this,function(b){return b.type},this.moveToPreviousToken,"support.function.codeend","support.function.codebegin"):!1};this.findTokenValueBwd=function(b,a){a=!!a;do if(!(a&&this.bwdToMatchingToken()||this.getCurrentToken().value!==b))return!0;while(this.moveToPreviousToken());return!1};this.findTokenValueFwd=function(b,a){a=
!!a;do if(!(a&&this.fwdToMatchingToken()||this.getCurrentToken().value!==b))return!0;while(this.moveToNextToken());return!1};this.findTokenTypeBwd=function(b,a){a=!!a;do if(!(a&&this.bwdToMatchingToken()||this.getCurrentToken().type!==b))return!0;while(this.moveToPreviousToken());return!1};this.findTokenTypeFwd=function(b,a){a=!!a;do if(!(a&&this.fwdToMatchingToken()||this.getCurrentToken().type!==b))return!0;while(this.moveToNextToken());return!1}}).call(g.prototype)});define("ace/token_tooltip",["require","exports","module"],function(a,n,l){function g(a){a.tokenTooltip||(f.call(this,a.container),a.tokenTooltip=this,this.editor=a,this.update=this.update.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.onMouseOut=this.onMouseOut.bind(this),k.addListener(a.renderer.scroller,"mousemove",this.onMouseMove),k.addListener(a.renderer.content,"mouseout",this.onMouseOut))}a("ace/lib/dom");l=a("ace/lib/oop");var k=a("ace/lib/event"),h=a("ace/range").Range,f=a("ace/tooltip").Tooltip;
l.inherits(g,f);(function(){this.token={};this.range=new h;this.update=function(){this.$timer=null;var a=this.editor.renderer;1E3<this.lastT-(a.timeStamp||0)&&(a.rect=null,a.timeStamp=this.lastT,this.maxHeight=window.innerHeight,this.maxWidth=window.innerWidth);var b=a.rect||(a.rect=a.scroller.getBoundingClientRect()),c=this.editor.session;a=c.screenToDocumentPosition(Math.floor((this.y+a.scrollTop-b.top)/a.lineHeight),Math.round((this.x+a.scrollLeft-b.left-a.$padding)/a.characterWidth));(b=c.getTokenAt(a.row,
a.column))||c.getLine(a.row)||(b={type:"",value:"",state:c.bgTokenizer.getState(0)});if(b){var d=b.type;b.state&&(d+="|"+b.state);b.merge&&(d+="\n  merge");b.stateTransitions&&(d+="\n  "+b.stateTransitions.join("\n  "));this.tokenText!=d&&(this.setText(d),this.width=this.getWidth(),this.height=this.getHeight(),this.tokenText=d);this.show(null,this.x,this.y);this.token=b;c.removeMarker(this.marker);this.range=new h(a.row,b.start,a.row,b.start+b.value.length);this.marker=c.addMarker(this.range,"ace_bracket",
"text")}else c.removeMarker(this.marker),this.hide()};this.onMouseMove=function(a){this.x=a.clientX;this.y=a.clientY;this.isOpen&&(this.lastT=a.timeStamp,this.setPosition(this.x,this.y));this.$timer||(this.$timer=setTimeout(this.update,100))};this.onMouseOut=function(a){a&&a.currentTarget.contains(a.relatedTarget)||(this.hide(),this.editor.session.removeMarker(this.marker),this.$timer=clearTimeout(this.$timer))};this.setPosition=function(a,b){a+10+this.width>this.maxWidth&&(a=window.innerWidth-this.width-
10);if(b>.75*window.innerHeight||b+20+this.height>this.maxHeight)b=b-this.height-30;f.prototype.setPosition.call(this,a+10,b+20)};this.destroy=function(){this.onMouseOut();k.removeListener(this.editor.renderer.scroller,"mousemove",this.onMouseMove);k.removeListener(this.editor.renderer.content,"mouseout",this.onMouseOut);delete this.editor.tokenTooltip}}).call(g.prototype);n.TokenTooltip=g});define("mode/auto_brace_insert",["require","exports","module"],function(a,n,l){var g=a("ace/range").Range,k=a("ace/mode/text").Mode;(function(){this.$complements={"(":")","[":"]",'"':'"',"{":"}"};this.$reOpen=/^[(["{]$/;this.$reClose=/^[)\]"}]$/;this.$reStop=/^[;,\s)\]}]$/;this.wrapInsert=function(a,f,e,b){if(!this.insertMatching)return f.call(a,e,b);var c=a.selection.getCursor();if(c=a.selection.isEmpty()&&e.row==c.row&&e.column==c.column){var d=g.fromPoints(e,{row:e.row,column:e.column+1}),h=a.doc.getTextRange(d);
if(this.$reClose.test(h)&&h==b){a.selection.moveCursorTo(d.end.row,d.end.column,!1);return}}d=null;c&&(d=this.$moveLeft(a.doc,e),d=a.doc.getTextRange(g.fromPoints(d,e)));f=f.call(a,e,b);c&&this.$reOpen.test(b)?(e=g.fromPoints(f,{row:f.row,column:f.column+1}),e=a.doc.getTextRange(e),(this.$reStop.test(e)||0==e.length)&&this.allowAutoInsert(a,f,this.$complements[b])&&(a.doc.insert(f,this.$complements[b]),a.selection.moveCursorTo(f.row,f.column,!1))):c&&"\n"===b&&(b=this.$moveRight(a.doc,f),b=a.doc.getTextRange(g.fromPoints(f,
b)),c=d,b=(d=a.getTokenAt(e.row,e.column-1))&&"function"===d.value?!1:"{"===c&&"}"===b||"("===c&&")"===b||"["===c&&"]"===b,b&&(e=this.getIndentForOpenBrace?this.getIndentForOpenBrace(this.$moveLeft(a.doc,e)):this.$getIndent(a.doc.getLine(f.row-1)),a.doc.insert(f,"\n"+e),a.selection.moveCursorTo(f.row,f.column,!1)));return f};this.allowAutoInsert=function(a,f,e){return!0};this.smartAllowAutoInsert=function(a,f,e){return"'"!==e&&'"'!==e&&"`"!==e?!0:"`"===e?(f=a.doc.getTextRange({start:{row:f.row,column:0},
end:f}),f=f.replace(/\\./g,""),0!=f.match(/`/g).length%2):0==f.column?!0:(a=this.codeModel.getTokenForPos(f,!1,!0))&&"string"===a.type&&a.column===f.column-1};this.wrapRemove=function(a,f,e){var b=a.selection.getCursor(),c=a.session.getDocument();if(!this.insertMatching||"left"!=e||!a.selection.isEmpty()||a.$readOnly||0==b.column||c.getLine(b.row).length<=b.column)return f.call(a,e);var d=g.fromPoints(this.$moveLeft(c,b),b);b=g.fromPoints(b,this.$moveRight(c,b));d=c.getTextRange(d);c=this.$reOpen.test(d)&&
this.$complements[d]==c.getTextRange(b);f.call(a,e);c&&f.call(a,"right")};this.$moveLeft=function(a,f){if(0==f.row&&0==f.column)return f;var e=f.row,b=f.column;b?b--:(e--,b=a.getLine(e).length);return{row:e,column:b}};this.$moveRight=function(a,f){var e=f.row,b=f.column;a.getLine(e).length!=b?b++:(e++,b=0);return e>=a.getLength()?f:{row:e,column:b}}}).call(k.prototype);n.setInsertMatching=function(a){k.prototype.insertMatching=a}});define("mode/c_cpp",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("ace/tokenizer").Tokenizer,h=a("ace/range").Range;a("mode/r_highlight_rules");var f=a("mode/c_cpp_highlight_rules").c_cppHighlightRules,e=a("mode/c_cpp_matching_brace_outdent").CppMatchingBraceOutdent,b=a("mode/behaviour/cstyle").CStyleBehaviour,c=null;window.NodeWebkit||(c=a("mode/c_cpp_fold_mode").FoldMode);var d=a("mode/r_code_model").RCodeModel,u=a("mode/r_matching_brace_outdent").RMatchingBraceOutdent,
q=a("mode/cpp_code_model").CppCodeModel;a("mode/token_cursor");var p=a("mode/utils");a=function(a,p){this.$session=p;this.$doc=p.getDocument();this.$tokenizer=new k((new f).getRules());this.r_codeModel=new d(p,this.$tokenizer,/^r-/,/^\s*\/\*{3,}\s*([Rr])\s*$/,/^\s*\*+\//);this.$r_outdent=new u(this.r_codeModel);this.codeModel=new q(p,this.$tokenizer);this.$behaviour=new b(this.codeModel);this.$cpp_outdent=new e(this.codeModel);window.NodeWebkit||(this.foldingRules=new c);this.$tokens=this.codeModel.$tokens;
this.getLineSansComments=this.codeModel.getLineSansComments};l.inherits(a,g);(function(){this.wrapInsert=function(a,b,d,e){return this.cursorInRLanguageMode()?g.prototype.wrapInsert(a,b,d,e):b.call(a,d,e)};this.wrapRemove=function(a,b,d){return this.cursorInRLanguageMode()?g.prototype.wrapRemove(a,b,d):b.call(a,d)};this.insertChunkInfo={value:"/*** R\n\n*/\n",position:{row:1,column:0},content_position:{row:1,column:0}};this.toggleCommentLines=function(a,b,d,e){var c=!0;a=/^(\s*)\/\//;for(var m=d;m<=
e;m++)if(!a.test(b.getLine(m))){c=!1;break}if(c)for(c=new h(0,0,0,0),m=d;m<=e;m++)d=b.getLine(m).match(a),c.start.row=m,c.end.row=m,c.end.column=d[0].length,b.replace(c,d[1]);else b.indentRows(d,e,"//")};this.getLanguageMode=function(a){return p.getPrimaryState(this.$session,a.row).match(/^r-/)?"R":"C_CPP"};this.cursorInRLanguageMode=function(){return"R"===this.getLanguageMode(this.$session.getSelection().getCursor())};this.inRLanguageMode=function(a){if(!a)return null;"object"===typeof a&&a.hasOwnProperty("length")&&
0<a.length&&(a=a[0]);return a.match(/^r-/)};this.getNextLineIndent=function(a,b,d,e,c){a=p.primaryState(a);return this.inRLanguageMode(a)?this.r_codeModel.getNextLineIndent(a,b,d,e):this.codeModel.getNextLineIndent(a,b,d,e,c)};this.checkOutdent=function(a,b,d){return this.inRLanguageMode(a)?this.$r_outdent.checkOutdent(a,b,d):this.$cpp_outdent.checkOutdent(a,b,d)};this.autoOutdent=function(a,b,d){return this.inRLanguageMode(a)?this.$r_outdent.autoOutdent(a,b,d,this.r_codeModel):this.$cpp_outdent.autoOutdent(a,
b,d)};this.$transformAction=this.transformAction;this.transformAction=function(a,b,d,e,c){a=p.primaryState(a);if(!this.inRLanguageMode(a))return this.$transformAction(a,b,d,e,c)};this.$id="mode/c_cpp"}).call(a.prototype);n.Mode=a});define("mode/c_cpp_fold_mode",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("ace/range").Range;a=a("ace/mode/folding/fold_mode").FoldMode;n=n.FoldMode=function(){};l.inherits(n,a);(function(){function a(a,e,d,f){a=a.doc.$lines;for(var b=e+f,c=a[b],m=0<f?"*/":"/*",h;null!=c;){var u=c.indexOf(m);if(-1!==u){h=0<f?new g(e,d,b,u):new g(b,c.length,e,d);break}b+=f;c=a[b]}return h}function h(a,e,d,f,q){for(var b=e+q,c=a.doc.$lines;0<=b&&b<a.getLength();){for(var h=a.getTokens(b),
u=c[b],k=0;k<h.length;k++)if(h[k].type===f)return 0<q?new g(e,d,b,0):new g(b,u.length,e,d);b+=q}}var f=/(\{|\[)[^\}\]]*$/,e=/^[^\[\{]*(\}|\])/;this.getFoldWidget=function(a,c,d){c="markbeginend"===c?"end":"";d=a.getLine(d);if(f.test(d))return"start";if(e.test(d))return c;a=d.indexOf("/*");d=d.indexOf("*/");return-1!==a&&(-1===d||a>d)?"start":-1!==d&&(-1===a||d<a)?c:""};this.getFoldWidgetRange=function(b,c,d){var g=b.getLine(d),q;if(q=g.match(f))return this.openingBracketBlock(b,q[1],d,q.index);if(q=
"markbeginend"===c&&g.match(e))return this.closingBracketBlock(b,q[1],d,q.index+q[0].length);c=b.getTokens(d);for(q=0;q<c.length;q++){var p=c[q];if("support.function.codebegin"===p.type)return h(b,d,g.length,"support.function.codeend",1);if("support.function.codeend"===p.type)return h(b,d,0,"support.function.codebegin",-1)}c=g.indexOf("/*");if(-1!==c)return a(b,d,g.length,1);c=g.indexOf("*/");if(-1!==c)return a(b,d,c,-1)}}).call(n.prototype)});define("mode/c_cpp_highlight_rules",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("ace/lib/lang"),k=a("mode/doc_comment_highlight_rules").DocCommentHighlightRules,h=a("ace/mode/text_highlight_rules").TextHighlightRules,f=a("mode/tex_highlight_rules").TexHighlightRules,e=a("mode/r_highlight_rules").RHighlightRules,b=a("mode/rainbow_paren_highlight_rules").RainbowParenHighlightRules;a=function(){function a(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}
var d=g.arrayToMap("alignas alignof and and_eq asm auto bitand bitor bool break case catch char char16_t char32_t class compl const constexpr const_cast continue decltype default delete do double dynamic_cast else enum explicit export extern false float for friend goto if inline int in long mutable namespace new noexcept not not_eq nullptr or or_eq private protected public register reinterpret_cast return short signed sizeof sizeof... static static_assert static_cast struct switch template this thread_local throw true try typedef typeid typeof typename union unsigned using virtual void volatile wchar_t while xor xor_eq".split(" ")),
h=g.arrayToMap(["NULL"]),q="new delete >>= <<= ->* ... << >> && || == != <= >= :: *= += -= /= ++ -- &= ^= %= -> .* ! $ & | + - * / ^ ~ = %".split(" "),p=q.map(function(b){return a(b)}).join("|");q=["->*"].concat(q).concat("< > , () [] ->".split(" ")).map(function(b){return a(b)});q=["new\\s*\\[\\]","delete\\s*\\[\\]"].concat(q);q="operator\\s*(?:"+q.join("|")+")|operator\\s+[\\w_]+(?:&&|&|\\*)?";this.$rules={start:[{token:"comment.doc.tag",regex:"\\/\\/\\s*\\[\\[.*\\]\\].*$"},{token:"comment.doc.tag",
regex:"^\\s*\\[\\[(.*)\\]\\]"},{token:"comment",regex:"\\/\\/'",next:"rdoc-start"},{token:"comment",regex:"\\/\\/.*$"},k.getStartRule("doc-start"),{token:"comment",merge:!0,regex:"\\/\\*",next:"comment"},{token:"string",regex:'(?:R|L|u8|u|U)?["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",merge:!0,regex:'(?:R|L|u8|u|U)?["].*\\\\$',next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",merge:!0,regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",
regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"0[bB][01']+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(?:(?:[fF])|(?:(?:[uU]?(?:(?:l?l?)|(?:L?L?))?)|(?:(?:(?:l?l?)|(?:L?L?))[uU]?))|(?:_\\w+))?\\b"},{token:"keyword.preproc",regex:"#\\s*include\\b",next:"include"},{token:"keyword.preproc",regex:"(?:"+"include pragma line define defined undef ifdef ifndef if else elif endif warning error".split(" ").map(function(a){return"#\\s*"+a+"\\b"}).join("|")+
")"},{token:"variable.language",regex:"\\b__\\S+__\\b"},{token:"keyword",regex:q},{token:function(a){return"this"==a?"variable.language":d.hasOwnProperty(a)?"keyword":h.hasOwnProperty(a)?"constant.language":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",merge:!1,regex:p},{token:"keyword.punctuation.operator",merge:!1,regex:"\\?|\\:|\\,|\\;|\\.|\\\\"},b.getParenRule(),{token:"paren.keyword.operator",merge:!1,regex:"[<>]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",
regex:".*?\\*\\/",next:"start"},{token:"comment",merge:!0,regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",merge:!0,regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",merge:!0,regex:".+"}],include:[{token:"string",regex:/<.+>/,next:"start"},{token:"string",regex:/".+"/,next:"start"}]};p=(new f("comment")).getRules();for(q=0;q<p.start.length;q++)p.start[q].token+=".virtual-comment";this.addRules(p,
"rdoc-");this.$rules["rdoc-start"].unshift({token:"text",regex:"^",next:"start"});this.$rules["rdoc-start"].unshift({token:"keyword",regex:"@(?!@)[^ ]*"});this.$rules["rdoc-start"].unshift({token:"comment",regex:"@@"});this.$rules["rdoc-start"].push({token:"comment",regex:"[^%\\\\[({\\])}]+"});this.embedRules(k,"doc-",[k.getEndRule("start")]);this.$rules.start.unshift({token:"support.function.codebegin",regex:"^\\s*\\/\\*{3,}\\s*[Rr]\\s*$",next:"r-start"});p=(new e).getRules();this.addRules(p,"r-");
this.$rules["r-start"].unshift({token:"support.function.codeend",regex:"\\*\\/",next:"start"})};l.inherits(a,h);n.c_cppHighlightRules=a});define("mode/c_cpp_matching_brace_outdent",["require","exports","module"],function(a,n,l){var g=a("ace/range").Range,k=a("mode/token_cursor").CppTokenCursor;l=function(a){this.codeModel=a};var h=a("mode/utils"),f=!0,e=!0,b=!0,c=!0,d=!0,u=!0,q=!0,p=!0,m=!0,t=!0,B=!0,v=!0;(function(){this.setIndent=function(a,b,d,e,c){a=a.getDocument();e="string"===typeof e?e:"";var m=a.$lines[d];d=this.$getIndent(a.$lines[b]);m=this.$getIndent(m);("function"!==typeof c||c(d,m))&&a.replace(new g(b,0,b,d.length),m+e)};
this.checkOutdent=function(a,b,d){return h.endsWith(a,"start")&&(":"===d||/^\s*[#\{\}>\]\)<.:]/.test(d)||"="===d)||h.endsWith(a,"comment")&&"/"==d?!0:!1};this.escapeRegExp=function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")};this.alignStartToken=function(a,b,d,e,c){return null===c||null===e?!1:(new RegExp("^\\s*"+this.escapeRegExp(a))).test(e)&&(a=c.indexOf(a),0<=a)?(b=b.getDocument(),e=this.$getIndent(e),a=Array(a+1).join(" "),b.replace(new g(d,0,d,e.length),a),!0):!1};this.alignEquals=
function(a,b,d,e){if(null===e||null===d)return!1;var c=d.indexOf("=");if(c!==d.lastIndexOf("="))return!1;var m=e.indexOf("=");if(-1!==c&&-1!==m&&/,\s*$/.test(e)){a=a.getDocument();d=this.$getIndent(d);if(d.length>=m)return!1;c=m-c;if(0>=c)return!1;c=Array(d.length+c+1).join(" ");a.replace(new g(b,0,b,d.length),c);return!0}return!1};this.autoOutdent=function(a,p,w){a=p.doc;var r=a.getLine(w),D=null;0<w&&(D=a.getLine(w-1));if(!t||!this.alignStartToken("<<",p,w,r,D))if(!m||!this.alignStartToken(">>",
p,w,r,D))if(!q||!this.alignStartToken(".",p,w,r,D)){if(f&&/^\s*:/.test(a.getLine(w))&&!/^\s*::/.test(a.getLine(w))&&this.codeModel.$tokenUtils.$tokenizeUpToRow(w)){var n=new k(this.codeModel.$tokens,w,0),l=-1,y=n.cloneCursor();if(")"===y.peekBwd().currentValue()||"keyword"===y.peekBwd().currentType()){do{n=y.currentType();var J=y.currentValue();if("identifier"===n||";"===J){l=y.$row;break}"keyword"!==n&&y.bwdToMatchingToken()}while(y.moveToPreviousToken())}else n.moveToPreviousToken(),n.bwdOverClassySpecifiers()&&
(l=n.$row);0<=l&&this.setIndent(p,w,l,p.getTabString(),function(a,b){return a===b})}if(u&&/^\s*>/.test(r)&&!/^\s*>>/.test(r)&&(l=this.codeModel.getRowForMatchingEOLArrows(p,a,w),0<=l)){this.setIndent(p,w,l);return}if(c&&/^\s*\}/.test(r)&&(l=p.findMatchingBracket({row:w,column:r.indexOf("}")+1}),null!==l)){if(/^\s*\{/.test(a.$lines[l.row])){this.setIndent(p,w,l.row);return}l=this.codeModel.getRowForOpenBraceIndent(p,l.row);if(0<=l){this.setIndent(p,w,l);return}}if(e&&/^\s*\)/.exec(r)&&(l=p.findMatchingBracket({row:w,
column:r.indexOf(")")+1}))){this.setIndent(p,w,l.row);return}if(d&&/^\s*\]/.exec(r)&&(l=p.findMatchingBracket({row:w,column:r.indexOf("]")+1}))){this.setIndent(p,w,l.row);return}if(B&&/^\s*public\s*:\s*$|^\s*private\s*:\s*$|^\s*protected\s*:\s*$/.test(r)&&(y=p.$findOpeningBracket("}",{row:w,column:r.length},h.getTokenTypeRegex("paren")))){l=this.codeModel.getRowForOpenBraceIndent(p,y.row);0<=l?this.setIndent(p,w,l):this.setIndent(p,w,y.row);return}if(v&&(/^\s*case.+:/.test(r)||/^\s*default\s*:/.test(r))&&
(y=p.$findOpeningBracket("}",{row:w,column:/(\S)/.exec(r).index+1},h.getTokenTypeRegex("paren")))){l=this.codeModel.getRowForOpenBraceIndent(p,y.row);0<=l?this.setIndent(p,w,l):this.setIndent(p,w,y.row);return}if(b&&/^\s*\{/.test(r)&&!/;\s*$/.test(D)){if(this.codeModel.$tokenUtils.$tokenizeUpToRow(w)&&(n=new k(this.codeModel.$tokens),n.$row=w,n.$offset=0,n.moveToPreviousToken()&&"="===n.currentValue()))return;D=this.codeModel.getRowForOpenBraceIndent(p,w);if(0<=D){this.setIndent(p,w,D);return}}/^\s*#/.test(r)&&
(p=this.$getIndent(r),a.replace(new g(w,0,w,p.length),""))}};this.$getIndent=function(a){return(a=a.match(/^(\s+)/))?a[1]:""}}).call(l.prototype);n.CppMatchingBraceOutdent=l;n.getOutdentColon=function(){return f};n.setOutdentColon=function(a){f=a};n.getOutdentRightParen=function(){return e};n.setOutdentRightParen=function(a){e=a};n.getOutdentLeftBrace=function(){return b};n.setOutdentLeftBrace=function(a){b=a};n.getOutdentRightBrace=function(){return c};n.setOutdentRightBrace=function(a){c=a};n.getOutdentRightBracket=
function(){return d};n.setOutdentRightBracket=function(a){d=a};n.getOutdentRightArrow=function(){return u};n.setOutdentRightArrow=function(a){u=a};n.getAlignDots=function(){return q};n.setAlignDots=function(a){q=a};n.getAlignEquals=function(){return p};n.setAlignEquals=function(a){p=a};n.getAlignStreamIn=function(){return m};n.setAlignStreamIn=function(a){m=a};n.getAlignStreamOut=function(){return t};n.setAlignStreamOut=function(a){t=a};n.getAlignClassAccessModifiers=function(){return B};n.setAlignClassAccessModifiers=
function(a){B=a};n.getAlignCase=function(){return v};n.setAlignCase=function(a){v=a}});define("mode/behaviour/cstyle",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("ace/mode/behaviour").Behaviour;a("mode/cpp_code_model");a("mode/token_cursor");a("ace/mode/text");var k=a("mode/utils"),h=!0;a=function(a){var e=a.$complements,b=function(a,b,c,p){var d=e[a];if(b==a)return b=c.getSelectionRange(),p=p.doc.getTextRange(b),""!==p?{text:a+p+d,selection:!1}:{text:a+d,selection:[1,1]};if(b==d&&(a=c.getCursorPosition(),p.doc.getLine(a.row)[a.column]==d&&(">"===d||null!==
p.findMatchingBracket({row:a.row,column:a.column+1}))))return{text:"",selection:[1,1]}},c=function(a,b,c){var d=e[a],m=c.doc.getTextRange(b);if(!b.isMultiLine()&&m==a&&c.doc.getLine(b.start.row).substring(b.start.column+1,b.start.column+2)==d)return b.end.column++,b};this.add("R","insertion",function(a,b,e,c,m){if("R"===m||"r"===m)if(a=e.getCursorPosition(),c=(new String(c.doc.getLine(a.row))).match(/^(\s*)\/\*{3,}\s*/))return{text:"R\n"+c[1]+"\n"+c[1]+"*/",selection:[1,c[1].length,1,c[1].length]}});
this.add("newline","insertion",function(b,e,c,p,m){if("\n"===m){var d=c.getCursorPosition();m=d.row;var f=d.column;e=p.getTabString();var h=p.doc.$lines;c=h[m];if(!this.codeModel.inMacro(h,m-1)){var q=/^(\s*\/\/'\s*)/.exec(c);if(q&&f>=q[1].length)return{text:"\n"+q[1]};if(/^\s*[/][*]+\s*$/.test(c)&&!/^\s*[*]/.test(h[m+1]||""))return p=this.$getIndent(c),e=p+" * ",{text:"\n"+e+"\n"+p+" */",selection:[1,e.length,1,e.length]};if(k.endsWith(b,"comment")||k.endsWith(b,"doc-start")){d&&d.row==m&&(c=c.substring(0,
d.column));if(b=/^(\s*)(\/\*)/.exec(c))return{text:"\n"+b[1]+" * "};if(b=/^(\s*\*+\s*)/.exec(c))return{text:"\n"+b[1],selection:[1,b[1].length,1,b[1].length]}}for(b=f-1;/\s/.test(c[b]);)--b;b=c[b];f=c[f];if(q=c.match(/\s*namespace\s*\w*\s*{/))return p=this.$getIndent(c),{text:"\n"+p,selection:[1,p.length,1,p.length]};if("("==b&&")"==f||"["==b&&"]"==f)return c=this.$getIndent(c),p=c+e,{text:"\n"+p+"\n"+c,selection:[1,p.length,1,p.length]};if("{"==b&&"}"==f){if(/^\s*{/.test(c))return c=this.$getIndent(c),
p=c+p.getTabString(),{text:"\n"+p+"\n"+c,selection:[1,p.length,1,p.length]};m=a.getRowForOpenBraceIndent(p,m);if(null!==m&&0<=m)return c=this.$getIndent(p.getDocument().getLine(m)),p=c+p.getTabString(),{text:"\n"+p+"\n"+c,selection:[1,p.length,1,p.length]};c=this.$getIndent(c);p=c+e;return{text:"\n"+p+"\n"+c,selection:[1,p.length,1,p.length]}}}}});this.add("braces","insertion",function(a,e,c,f,m){if(this.insertMatching){if("{"==m&&(a=c.getSelectionRange(),""===f.doc.getTextRange(a))){a=this.codeModel.getTokenCursor();
if(!a.moveToPosition(c.getCursorPosition()))return b("{",m,c,f);do if(!a.bwdToMatchingArrow()){e=a.currentValue();if(!e||!e.length)break;if("namespace"===e)return{text:"{",selection:[1,1]};if("class"===e||"struct"===e||"="===e)return{text:"{};",selection:[1,1]};if(h&&"do"===e)return{text:"{} while ();",selection:[1,1]};if(";"===e||"["===e||"]"===e||"("===e||")"===e||"{"===e||"}"===e||"if"===e||"else"===e||"#"===e[0])return{text:"{}",selection:[1,1]}}while(a.moveToPreviousToken())}return b("{",m,c,
f)}});this.add("braces","deletion",function(a,b,e,c,m){if(this.insertMatching&&(a=c.doc.getTextRange(m),!m.isMultiLine()&&"{"==a)){a=c.doc.getLine(m.start.row);if(/^\s*do\s*\{\} while \(\);\s*$/.test(a))return m.end.column=a.length,m;c=a.substring(m.end.column,m.end.column+1);a=a.substring(m.end.column+1,m.end.column+2);if("}"==c)return m.end.column++,";"==a&&m.end.column++,m}});this.add("parens","insertion",function(a,e,c,f,m){if(this.insertMatching)return b("(",m,c,f)});this.add("parens","deletion",
function(a,b,e,f,m){if(this.insertMatching)return c("(",m,f)});this.add("brackets","insertion",function(a,e,c,f,m){if(this.insertMatching)return b("[",m,c,f)});this.add("brackets","deletion",function(a,b,e,f,m){if(this.insertMatching)return c("[",m,f)});this.add("arrows","insertion",function(a,e,c,f,m){if(this.insertMatching&&(a=f.getLine(c.getCursorPosition().row),/^\s*#\s*include/.test(a)))return b("<",m,c,f)});this.add("arrows","deletion",function(a,b,e,f,m){if(this.insertMatching)return c("<",
m,f)});this.add("string_dquotes","insertion",function(a,b,e,c,m){if(this.insertMatching&&('"'==m||"'"==m)){a=e.getSelectionRange();b=c.doc.getTextRange(a);if(""!==b)return{text:m+b+m,selection:!1};e=e.getCursorPosition();b=c.doc.getLine(e.row);if("\\"==b.substring(e.column-1,e.column))return null;c=c.getTokens(a.start.row);for(var d=0,f,h=-1,p=0;p<c.length;p++){f=c[p];"string"==f.type?h=-1:0>h&&(h=f.value.indexOf(m));if(f.value.length+d>a.start.column)break;d+=c[p].value.length}if(!f||0>h&&"comment"!==
f.type&&("string"!==f.type||a.start.column!==f.value.length+d-1&&f.value.lastIndexOf(m)===f.value.length-1))return{text:m+m,selection:[1,1]};if(f&&"string"===f.type&&b.substring(e.column,e.column+1)==m)return{text:"",selection:[1,1]}}});this.add("string_dquotes","deletion",function(a,b,e,c,f){if(this.insertMatching&&(a=c.doc.getTextRange(f),!f.isMultiLine()&&('"'==a||"'"==a)&&(c=c.doc.getLine(f.start.row).substring(f.start.column+1,f.start.column+2),'"'===c||"'"===c)))return f.end.column++,f});this.add("punctuation.operator",
"insertion",function(a,b,e,c,f){if(this.insertMatching&&";"===f&&(a=e.selection.getCursor(),";"==c.getLine(a.row)[a.column]))return{text:"",selection:[1,1]}});this.add("macro","insertion",function(a,b,e,c,f){b=e.getPrintMarginColumn();b=Math.min(62,b);var d=c.getDocument().$lines,m=e.getCursorPosition(),h=m.row,g=d[h];e=g.substring(0,m.column);if(/^\s*#\s*define[^\\]*$/.test(g)&&"\\"==f)return a=b-e.length+1,0<=a?{text:Array(a+1).join(" ")+"\\\n"+this.$getIndent(g)+c.getTabString(),selection:!1}:
{text:"\\\n"+c.getTabString(),selection:!1};if(/^\s*#\s*define/.test(g)||this.codeModel.inMacro(d,h-1)){if("\\"==f&&/^\s*$/.test(g.substring(e.length,g.length)))return a=b-e.length+1,0<=a?{text:Array(a+1).join(" ")+"\\",selection:!1}:{text:"\\",selection:!1};if("\n"==f){if(/^\s*$/.test(g)||/^\s*#\s*define/.test(g)&&!/\\\s*$/.test(g))return{text:"\n",selection:!1};if(/\\\s*$/.test(g)&&!/\\\s*$/.test(e))return{text:"",selection:[1,m.column,1,m.column]};c=c.getMode().getNextLineIndent(a,g+"\\",c.getTabString(),
h,!1);a=b-e.length+1;f=/\\\s*$/.test(e)?"":"\\";return 0<=a?{text:Array(a+1).join(" ")+f+"\n"+c,selection:!1}:{text:f+"\n"+c,selection:!1}}}})};l.inherits(a,g);n.CStyleBehaviour=a;n.setFillinDoWhile=function(a){h=a};n.getFillinDoWhile=function(){return h}});define("mode/cpp_code_model",["require","exports","module"],function(a,n,l){a("ace/lib/oop");var g=a("ace/range").Range,k=a("mode/token_utils").TokenUtils;a("ace/token_iterator");var h=a("mode/token_cursor").CppTokenCursor,f=a("mode/cpp_scope_tree").CppScopeNode,e=a("mode/cpp_scope_tree").CppScopeManager,b=a("mode/r_code_model").getVerticallyAlignFunctionArgs,c=a("mode/utils");a=function(a,b,c,h,m){this.$session=a;this.$doc=a.getDocument();this.$tokenizer=b;this.$tokens=Array(this.$doc.getLength());
this.$statePattern=c;this.$codeBeginPattern=h;this.$codeEndPattern=m;this.$tokenUtils=new k(this.$doc,this.$tokenizer,this.$tokens,this.$statePattern,this.$codeBeginPattern);this.$scopes=new e(f);var d=!0,g=function(a,b){d?d=!1:(this.$doc.off("change",p),this.$session.off("changeMode",g))}.bind(this),p=function(a){this.$onDocChange(a)}.bind(this);this.$session.on("changeMode",g);this.$doc.on("change",p)};(function(){var a=c.contains;this.getTokenCursor=function(){return new h(this.$tokens,0,0,this)};
this.$tokenizeUpToRow=function(a){this.$tokenUtils.$tokenizeUpToRow(a)};var e=function(b,e){for(;;){var c=b.currentValue(),d=e.$doc.getLine(b.$row);if(a(["{","}",";"],c))break;if(":"===c&&(c=b.peekBwd().currentValue(),a(["public","private","protected"],c)))break;if(/^\s*#/.test(d))break;if(!b.moveToPreviousToken())break}},f="if else for do while struct class try catch switch".split(" "),p=function(a){a=a.trim();return a=a.replace(/[\n\s]+/g," ")},m=function(a,b){var e=p(a),c=b;"undefined"===typeof c&&
(c=80);e.length>c&&(e=e.substring(0,c)+"...");return e};this.$complements={"<":">",">":"<","{":"}","}":"{","[":"]","]":"[","(":")",")":"(","'":"'",'"':'"'};this.alignContinuationSlashes=function(a,b){"undefined"===typeof b&&(b={start:0,end:a.getLength()});var e=a.$lines;if(!(e instanceof Array))return!1;for(var c=b.start;c<b.end;c++)if(l.test(e[c])){var d=c;for(c+=1;l.test(e[c])&&c<=b.end;)c++;for(var f=c,m=e.slice(d,f).map(function(a){return a.lastIndexOf("\\")}),h=Math.max.apply(null,m),x=0;x<f-
d;x++){var g={row:d+x,column:m[x]},p=Array(h-m[x]+1).join(" ");a.insert(g,p)}}return!0};this.allIndicesOf=function(a,b){for(var e=[],c=0;c<a.length;c++)a[c]==b&&e.push(c);return e};this.getRowForMatchingEOLArrows=function(a,b,e){a=0;for(var c,d=1;100>d;d++){c=this.getLineSansComments(b,e-d);if(/;\s*$/.test(c))break;if(/<\s*$/.test(c)&&!/<<\s*$/.test(c)){if(0===a)return e-d;a--}else/^\s*>/.test(c)&&!/^\s*>>/.test(c)&&a++}return-1};var k=/^\s*#\s*define/,l=/\\\s*$/,v=/^\s*[+\-/&^%$!<>.?|=~]|^\s*\*[^/]|^\s*\/[^\*]/,
n=/[+\-*&^%$!<>.?|=~]\s*$|\*[^/]\s*$|\/[^\*]\s*$/,C=function(a){return v.test(a)||n.test(a)};this.inMacro=function(a,b){var e=a[b];return 0>b?!1:l.test(e)?k.test(e)?!0:this.inMacro(a,b-1):!1};this.$buildScopeTreeUpToRow=function(a){a=Math.min(a+30,this.$doc.getLength()-1);this.$tokenUtils.$tokenizeUpToRow(a);var b=this.getTokenCursor();if(b.seekToNearestToken(this.$scopes.parsePos,a)){do{this.$scopes.parsePos=b.currentPosition();this.$scopes.parsePos.column+=b.currentValue().length;var c=b.currentToken().type;
if(/\bsectionhead\b/.test(c)){if(c=/^\/\/'?[-=#\s]*(.*?)\s*[-=#]+\s*$/.exec(b.currentValue()))c=""+c[1],0==c.length&&(c="(Untitled)"),50<c.length&&(c=c.substring(0,50)+"..."),this.$scopes.onSectionStart(c,b.currentPosition())}else if(/\bcodebegin\b/.test(c)){c=b.currentPosition();var d={row:c.row+1,column:0};this.$scopes.getTopLevelScopeCount();this.$scopes.onChunkStart("(R Code Chunk)","(R Code Chunk)",c,d)}else if(/\bcodeend\b/.test(c)){for(c=b.currentPosition();this.$scopes.onScopeEnd(c););c.column+=
b.currentValue().length;this.$scopes.onChunkEnd(c)}else if("{"===b.currentValue())if(c=b.cloneCursor(),d=c.currentPosition(),c.isFirstSignificantTokenOnLine()&&(d.column=0),"namespace"===c.peekBwd(2).currentValue())c.moveToPreviousToken(),d=c.currentValue(),this.$scopes.onNamespaceScopeStart("namespace "+d,c.currentPosition(),b.currentPosition(),d);else if("namespace"===c.peekBwd().currentValue())this.$scopes.onNamespaceScopeStart("anonymous namespace",d,b.currentPosition(),"<anonymous>");else if("class"===
c.peekBwd(2).currentValue()||"struct"===c.peekBwd(2).currentValue()||c.bwdOverClassInheritance()){c.moveToPreviousToken();var f=c.cloneCursor();e(f,this);f=f.peekFwd().currentPosition();d=this.$session.getTextRange(new g(f.row,f.column,d.row,d.column));d=p(d);this.$scopes.onClassScopeStart(d,c.currentPosition(),b.currentPosition(),d)}else if(c.bwdOverConstNoexceptDecltype()&&c.bwdOverInitializationList()&&c.moveBackwardOverMatchingParens()||c.moveBackwardOverMatchingParens())if("identifier"===c.peekBwd().currentType()||
"]"===c.peekBwd().currentValue()||/^operator/.test(c.peekBwd().currentValue()))if("]"===c.peekBwd().currentValue())c=c.currentPosition(),c=this.$session.getTextRange(new g(c.row,c.column,d.row,d.column-1)),c=p("lambda "+c),this.$scopes.onLambdaScopeStart(c,d,b.currentPosition());else{if(c.moveToPreviousToken()){var h="";d=c.currentValue();f="";var q=this.$scopes.getActiveScopes(c.currentPosition());null!=q&&(q=q[q.length-1],q.isClass()&&q.label==="class "+d?"~"===c.peekBwd().currentValue()&&(d="~"+
d):(h=c.cloneCursor(),e(h,this),h.moveToNextToken(),h=h.currentPosition(),q=c.currentPosition(),h=this.$session.getTextRange(new g(h.row,h.column,q.row,q.column))));var k=c.peekFwd();q=k.currentPosition();k.fwdToMatchingToken()&&("const"===k.peekFwd().currentValue()&&k.moveToNextToken(),"noexcept"===k.peekFwd().currentValue()&&k.moveToNextToken(),"noexcept"===k.currentValue()&&"("===k.peekFwd().currentValue()&&(k.moveToNextToken(),k.fwdToMatchingToken()),(k=k.peekFwd().currentPosition())&&(f=this.$session.getTextRange(new g(q.row,
q.column,k.row,k.column))));h=0<h.length?m(d.trim()+f.trim()+": "+h.trim()):m(d.trim()+f.trim());this.$scopes.onFunctionScopeStart(h,c.currentPosition(),b.currentPosition(),d.trim(),f.split(","))}}else this.$scopes.onScopeStart(d);else this.$scopes.onScopeStart(d);else"}"===b.currentValue()&&(c=b.currentPosition(),b.isLastSignificantTokenOnLine()?c.column=this.$doc.getLine(c.row).length+1:c.column++,this.$scopes.onScopeEnd(c))}while(b.moveToNextToken(a))}};this.getCurrentScope=function(a,b){b||(b=
function(a){return!0});if(!a)return"";this.$buildScopeTreeUpToRow(a.row);var c=this.$scopes.getActiveScopes(a);if(c)for(var e=c.length-1;0<=e;e--)if(b(c[e]))return c[e];return null};this.getScopeTree=function(){this.$buildScopeTreeUpToRow(this.$doc.getLength()-1);return this.$scopes.getScopeList()};this.getRowForOpenBraceIndent=function(b,c,e){if(1>=b.getDocument().$lines.length)return-1;if(this.$tokenUtils.$tokenizeUpToRow(c))try{for(var d=Array(this.$tokens.length),m=0;m<this.$tokens.length;m++)if(null!=
this.$tokens[m]&&0<this.$tokens[m].length){var h=this.$tokens[m];"\\"===h[h.length-1].value&&(d[m]=this.$tokens[m].splice(h.length-1,1)[0])}var g=this.getTokenCursor();if(e){var p=b.getSelection().getCursor();if(!g.moveToPosition(p))return 0}else for(g.$row=c,m=g.$tokens[c].length-1,m=g.$tokens[c].length-1;0<=m&&(g.$offset=m,"{"!==g.currentValue());m--);if("{"===g.peekBwd().currentValue()||";"===g.currentValue())return-1;g.bwdOverInitializationList();g.bwdOverClassInheritance();if("{"===g.currentValue()&&
!g.moveToPreviousToken()||"{"===g.currentValue())return-1;for(;"keyword"===g.currentType();){var x=g.currentValue();if(a(f,x)||0===g.$row&&0===g.$offset)return g.$row;if(!g.moveToPreviousToken())return-1}if(":"===g.currentValue()){var q=g.peekBwd().currentValue();if(a(["public","private","protected"],q))return g.moveToNextToken(),g.$row}if(":"===g.currentValue())for(;g.moveToPreviousToken();){if(g.bwdToMatchingToken())if("keyword"===g.peekBwd().currentType())continue;else break;if("identifier"===
g.currentType())break}if(")"===g.currentValue()&&!g.bwdToMatchingToken()||"("===g.currentValue()&&!g.moveToPreviousToken())return-1;"="===g.currentValue()&&g.moveToPreviousToken();return g.$row}finally{for(m=0;m<d.length;m++)"undefined"!==typeof d[m]&&this.$tokens[m].push(d[m])}return-1};this.getLineSansComments=function(a,b,c){if(0>b)return"";a=a.getLine(b);var e=/(?!\\)"/g,d=a,f;for(b=[];f=e.exec(d);)b.push(f.index);if(0<b.length&&0===b.length%2)for(e=0;e<b.length/2;e+=2)d=b[e+1],a=a.substring(0,
b[e]+1)+a.substring(d,a.length);b=a.indexOf("//");-1!=b&&(a=a.substring(0,b));l.test(a)&&(a=a.substring(0,a.lastIndexOf("\\")));c&&(a=a.replace(/\bconst\b/,"").replace(/\bnoexcept\b/,""));return a};this.findStartOfCommentBlock=function(a,b,c){for(var e=0,d=/^\s*\/+\*/;0<=b&&e<c;){if(d.test(a[b]))return b;--b;++e}return-1};this.getNextLineIndent=function(e,d,f,m,g){var h=b(),p=this.$session,q=p.getTabSize(),x=p.getDocument();"number"!==typeof m&&(m=p.getSelection().getCursor().row-1);if(-1===m)return d=
x.getLine(0),0<d.length?this.$getIndent(d):"";if(0===d.length||/^\s*#/.test(d))return this.getNextLineIndent(c.getPrimaryState(p,m-1),x.getLine(m-1),f,m-1,g);var z=this.$getIndent(d),v=this.$getUnindent(d,q),t=x.$lines;if(c.endsWith(e,"comment")||c.endsWith(e,"doc-start")){n&&n.row==m&&(d=d.substring(0,n.column));if(/^\s*$/.test(d))return this.$getIndent(t[m]);n=this.findStartOfCommentBlock(t,m,200);if(null!==n)return this.$getIndent(t[n])+" "}if(c.endsWith(e,"start")){if(k.test(d))return/\\\s*$/.test(d)?
z+f:z;if(/^\s*#\s*\S/.test(d))return z;if(this.inMacro(t,m-1)&&!l.test(d))return v;d=this.getLineSansComments(x,m);var n=p.getSelection().getCursor();n&&n.row==m&&!g&&(d=d.substring(0,n.column));e=this.getLineSansComments(x,m-1);if("string"!==typeof d)return"";if(0===d.length||/^\s*$/.test(d))return this.$getIndent(t[m]);if(/\*\/\s*$/.test(d)&&(v=this.findStartOfCommentBlock(t,m,200),0<=v))return this.$getIndent(t[v]);if(/^\s*<</.test(d)){for(d=m-1;/^\s*<</.test(t[d]);)d--;return this.$getIndent(t[d])}if(/^\s*\./.test(d)){for(d=
m-1;/^\s*\./.test(t[d]);)d--;return this.$getIndent(t[d])}if(/\bnamespace\b.*\{\s*$/.test(d)||/\bswitch\b.*\{\s*$/.test(d))return z;if(d.match(/\(\s*$/))return-1!==d.indexOf("=")||/^\s*(return\s+)?[a-zA-Z0-9_.->:]+\(\s*$/.test(d)?z+f:z+f+f;if(/^\s*(class|struct)\s*[\w]+\s*$/.test(d)||/^\s*(class|struct).*\{\s*$/.test(d)||/^\s*(class|struct)\s+.+:\s*$/.test(d))return z+f;if((v=d.match(/(^\s*(?:class|struct)\s+.*\w[^:]):[^:]\s*.+/))&&!/,\s*/.test(d)||(v=d.match(/^(\s*(class|struct).*:\s*).*,\s*$/))||
(v=d.match(/^(\s*:\s*)(\w+).*,\s*$/))||(v=d.match(/^(\s*)[:,]\s*[\w\s]*$/)))return h?Array(v[1].length+1).join(" "):z+f;if(/<\s*$/.test(d))return z+f;if(/^\s*".*"\s*$/.test(d)||/^\s*template\s*<.*>\s*$/.test(d)&&d.split(">").length==d.split("<").length)return z;if(/([\[\{\(<]).+,\s*$/.exec(d)){var u=["(","{","[","<"];for(v=0;v<u.length;v++){var w=u[v],B=this.$complements[w];w=this.allIndicesOf(d,w);if(w.length&&(B=this.allIndicesOf(d,B),B=w.length-B.length-1,!(0>B)))return t=w[B],h?(d=d.substr(t+
1).match(/([^\s])/),Array(t+d.index+2).join(" ")):z+f}}for(v=m-1;0<=v&&/^\s*$|^\s*#/.test(e);)e=this.getLineSansComments(x,v),v--;if(/^\s*__attribute__\(\(.*\)\)\s*$/.test(d)||/^\s*[\w\s]+\s*$/.test(d)&&!/(class|struct|for|while|do|if|else|try)/.test(d)||C(d)&&C(e))return this.$getIndent(d);if(this.$tokenUtils.$tokenizeUpToRow(m+2)){u=Array(this.$tokens.length);try{for(v=0;v<this.$tokens.length;v++)if(null!=this.$tokens[v]&&0<this.$tokens[v].length){var y=this.$tokens[v];"\\"===y[y.length-1].value&&
(u[v]=this.$tokens[v].splice(y.length-1,1)[0])}var r=this.getTokenCursor();g?(r.$row=m,r.$offset=this.$tokens[m].length-1):r.moveToPosition(n);for(;0>r.$offset&&0<r.$row;)r.$row--,r.$offset=r.$tokens[r.$row].length-1;for(;0<r.$row&&/^\s*#/.test(x.getLine(r.$row));)r.$row--,r.$offset=r.$tokens[r.$row].length-1;g="";var D=r.cloneCursor(),L=D.currentValue(),H=D.currentType();if("keyword"===H||a(["{",")",">",":"],L))g=f;for(;";"===r.currentValue()&&r.moveToPreviousToken(););var F=r.cloneCursor();if(h&&
r.isLastSignificantTokenOnLine()&&("keyword.operator"===r.currentType()||"punctuation.operator"===r.currentType())){var R=r.cloneCursor();R.$offset=0;if("keyword"===R.currentType()){var O=d.split("(").length-d.split(")").length;if(0<O){var N=d.match(/.*?\(\s*(\S)/);if(N)return Array(N[0].length).join(" ")}}}if(","===r.currentValue()){if(h){var G=r.peekBwd();if("]"===G.currentValue()&&G.bwdToMatchingToken())return Array(G.currentPosition().column+1).join(" ");O=d.split("(").length-d.split(")").length;
if(0<O&&(N=d.match(/.*?\(\s*(\S)/)))return Array(N[0].length).join(" ")}if(/[,(]\s*$/.test(d)&&/[,(]\s*$/.test(e))return this.$getIndent(d);var E=r.cloneCursor();return E.findOpeningBracket("{",!1)&&E.bwdOverClassySpecifiers()&&"enum"===E.currentValue()?this.$getIndent(t[E.$row])+f:-1!==d.indexOf("=")?this.$getIndent(d)+f:this.$getIndent(d)}if("keyword.operator"===H&&":"!==L)return this.$getIndent(t[m])+f;for(;;){if("undefined"===typeof r.currentValue())return"undefined"!==typeof F.currentValue()?
this.$getIndent(t[F.$row])+g:g;F=r.cloneCursor();if(";"===r.currentValue()&&r.moveToNextToken()){for(m=r.$row;null!=t[m]&&/^\s*#/.test(t[m]);)++m;return this.$getIndent(t[m])+g}if(a(["for","while","do","try"],r.currentValue())&&";"!==L)return this.$getIndent(t[r.$row])+g;G=r.peekBwd();if(":"===r.currentValue()){if(a(["public","private","protected"],G.currentValue()))return this.$getIndent(t[G.$row])+f;var S=t[r.$row];if(/^\s*case/.test(S))return this.$getIndent(S)+f;if(")"===G.currentValue()&&(E=
G.cloneCursor(),E.bwdToMatchingToken())){var T=E.peekBwd(1),U=E.peekBwd(2);if(null!==T&&"identifier"===T.currentType()&&null!==U&&!/\boperator\b/.test(U.currentType()))return this.$getIndent(t[E.peekBwd().$row])+g}}if("]"===r.currentValue()&&"("===r.peekFwd().currentValue()&&(E=r.cloneCursor(),E.bwdToMatchingToken()))return this.$getIndent(t[E.$row])+g;if("("===r.currentValue()&&"for"===G.currentValue()&&";"===L)return r.peekFwd().cloneCursor(),h?Array(r.peekFwd().currentPosition().column+1).join(" "):
this.$getIndent(t[r.peekFwd().$row])+f;if(h&&"("===r.currentValue()&&!r.isLastSignificantTokenOnLine())return r.moveToNextToken(),Array(r.currentPosition().column+1+q).join(" ");if("if"===r.currentValue()||"else"===r.currentValue()||"template"===r.currentValue()&&"<"===r.peekFwd().currentValue())return this.$getIndent(t[r.$row])+g;if("{"===r.currentValue()){var A=this.getRowForOpenBraceIndent(p,r.$row);return 0<=A?(d=this.getLineSansComments(x,A),z=this.$getIndent(d),/\bnamespace\b/.test(d)?z:z+f):
this.$getIndent(t[r.$row])+f}if(0===r.$row&&0===r.$offset)return this.$getIndent(t[0])+g;if(">"===r.currentValue()&&(E=r.cloneCursor(),E.bwdToMatchingArrow()&&"template"===E.peekBwd().currentValue()))return">"===L&&(g=""),this.$getIndent(t[E.$row])+g;r.bwdToMatchingToken();if(!r.moveToPreviousToken())break;for(;0<r.$row&&/^\s*#/.test(t[r.$row]);)r.$row--,r.$offset=this.$tokens[r.$row].length-1}}finally{for(v=0;v<u.length;v++)"undefined"!==typeof u[v]&&this.$tokens[v].push(u[v])}}}return z};this.$onDocChange=
function(a){"insert"===a.action?this.$tokenUtils.$insertNewRows(a.start.row,a.end.row-a.start.row):this.$tokenUtils.$removeRows(a.start.row,a.end.row-a.start.row);this.$tokenUtils.$invalidateRow(a.start.row);this.$scopes.invalidateFrom(a.start)};this.$getIndent=function(a){return(a=/^([ \t]*)/.exec(a))?a[1]:""};this.$padIndent=function(a,b,c){b=Array(b+1).join(" ");b=a.replace("\t",b);return b>=c?a:a+Array(c-b+1).join(" ")};this.$getUnindent=function(a,b){var c=this.$getIndent(a);if(null===c||0===
c.length)return"";var d=c.indexOf("\t");if(-1!=d)return c.substring(0,d)+c.substring(d+1,c.length);for(var e=d=0;e<b&&e<c.length;e++)" "===c[e]&&d++;return c.substring(d,c.length)}}).call(a.prototype);n.CppCodeModel=a});define("mode/cpp_scope_tree",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("mode/r_scope_tree");a=g.ScopeManager;var k=g.ScopeNode,h=function(a,e,b,c,d,g){this.label=a;this.start=e;this.preamble=b||e;this.end=null;this.scopeType=c;this.scopeCategory=d;this.attributes=g||{};this.parentScope=null;this.$children=[]};l.mixin(h.prototype,k.prototype);h.CATEGORY_CLASS=1;h.CATEGORY_NAMESPACE=2;h.CATEGORY_FUNCTION=3;h.CATEGORY_LAMBDA=4;h.CATEGORY_ANON=5;(function(){this.isClass=
function(){return this.scopeType==k.TYPE_BRACE&&this.scopeCategory==h.CATEGORY_CLASS};this.isNamespace=function(){return this.scopeType==k.TYPE_BRACE&&this.scopeCategory==h.CATEGORY_NAMESPACE};this.isFunction=function(){return this.scopeType==k.TYPE_BRACE&&this.scopeCategory==h.CATEGORY_FUNCTION};this.isLambda=function(){return this.scopeType==k.TYPE_BRACE&&this.scopeCategory==h.CATEGORY_LAMBDA}}).call(h.prototype);g=function(a){this.$ScopeNodeFactory=a;this.parsePos={row:0,column:0};this.$root=new a("(Top Level)",
this.parsePos,null,k.TYPE_ROOT)};l.mixin(g.prototype,a.prototype);(function(){this.onClassScopeStart=function(a,e,b,c){a=new this.$ScopeNodeFactory(a,b,e,k.TYPE_BRACE,h.CATEGORY_CLASS,{name:c});this.$root.addNode(a);this.printScopeTree()};this.onNamespaceScopeStart=function(a,e,b,c){a=new this.$ScopeNodeFactory(a,b,e,k.TYPE_BRACE,h.CATEGORY_NAMESPACE,{name:c});this.$root.addNode(a);this.printScopeTree()};this.onFunctionScopeStart=function(a,e,b,c,d){a=new this.$ScopeNodeFactory(a,b,e,k.TYPE_BRACE,
h.CATEGORY_FUNCTION,{name:c,args:d});this.$root.addNode(a);this.printScopeTree()};this.onLambdaScopeStart=function(a,e,b,c){a=new this.$ScopeNodeFactory(a,b,e,k.TYPE_BRACE,h.CATEGORY_LAMBDA,{args:c});this.$root.addNode(a);this.printScopeTree()};this.onScopeStart=function(a){this.$root.addNode(new this.$ScopeNodeFactory(null,a,null,k.TYPE_BRACE));this.printScopeTree()};this.onScopeEnd=function(a){a=this.$root.closeScope(a,k.TYPE_BRACE);this.printScopeTree();return a}}).call(g.prototype);n.CppScopeManager=
g;n.CppScopeNode=h});define("mode/dcf",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("ace/tokenizer").Tokenizer,h=a("mode/dcf_highlight_rules").DcfHighlightRules;a=function(){this.$tokenizer=new k((new h).getRules())};l.inherits(a,g);(function(){this.getNextLineIndent=function(a,e,b){return this.$getIndent(e)}}).call(a.prototype);n.Mode=a});define("mode/dcf_highlight_rules",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(){this.$rules={start:[{token:["keyword","text"],regex:"^([^:]+)(:)"},{token:"text",regex:".+"}]}};l.inherits(g,a);n.DcfHighlightRules=g});define("mode/doc_comment_highlight_rules",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"[@\\\\][\\w\\d_]+"},{token:"comment.doc",merge:!0,regex:"\\s+"},{token:"comment.doc",merge:!0,regex:"TODO"},{token:"comment.doc",merge:!0,regex:"[^@\\\\\\*]+"},{token:"comment.doc",merge:!0,regex:"."}]}};l.inherits(g,a);g.getStartRule=function(a){return{token:"comment.doc",
merge:!0,regex:"\\/\\*[\\*\\!]",next:a}};g.getEndRule=function(a){return{token:"comment.doc",merge:!0,regex:"\\*\\/",next:a}};n.DocCommentHighlightRules=g});define("util/expand_selection",["require","exports","module"],function(a,n,l){n=a("ace/editor").Editor;var g=a("ace/range").Range;a("ace/keyboard/vim");var k=a("ace/token_iterator").TokenIterator,h=a("mode/utils");(function(){function a(a,b){for(var c=a.session.getTokens(b),d=0;d<c.length;d++){var e=c[d];if(!/^\s*$/.test(e.value))return/\bcomment\b/.test(e.type)}return!1}function e(a,b){var c=a.start.row<b.start.row||a.start.row===b.start.row&&a.start.column<b.start.column,d=a.start.row===b.start.row&&
a.start.column===b.start.column,e=a.end.row>b.end.row||a.end.row===b.end.row&&a.end.column>b.end.column,m=a.end.row===b.end.row&&a.end.column===b.end.column;return c?e||m:e?c||d:!1}function b(a,b){for(var c=a.getCurrentToken(),d=a.getCurrentTokenRow();a.moveToPreviousSignificantToken();){var e=a.getCurrentToken();if(d!==a.getCurrentTokenRow()&&0!==e.type.indexOf("keyword.operator")){if(!a.moveToNextSignificantToken())return!1;break}if(l.test(c.value)&&(l.test(e.value)||h.isOpeningBracket(e.value)||
h.contains(b,e.value))){if(!a.moveToNextSignificantToken())return!1;break}a.bwdToMatchingToken();c=a.getCurrentToken();d=a.getCurrentTokenRow()}return!0}function c(a,b,c){p.push({name:a,immediate:b,execute:c})}var d=this,l=/['"\w.]/,q=!1;this.$onClearSelectionHistory=function(){return d.$clearSelectionHistory()};this.$clearSelectionHistory=function(){this.$selectionRangeHistory=null;this.off("change",this.$clearSelectionHistory)};this.$acceptSelection=function(a,b,c){null==this.$selectionRangeHistory&&
(this.$selectionRangeHistory=[]);a.setSelectionRange(b);a.getRange().isEqual(c)||this.$selectionRangeHistory.push(c);this.isRowFullyVisible(b.start.row)&&this.isRowFullyVisible(b.end.row)||this.centerSelection(a);return b};var p=[];c("string",!0,function(a,b,c,d){return(a=b.getTokenAt(d.start.row,d.start.column+1))&&/\bstring\b/.test(a.type)?new g(d.start.row,a.column+1,d.start.row,a.column+a.value.length-1):null});c("token",!0,function(a,b,c,d){return(a=b.getTokenAt(d.start.row,d.start.column+1))&&
/[\d\w]/.test(a.value)?new g(d.start.row,a.column,d.start.row,a.column+a.value.length):null});c("comment",!0,function(b,c,d,e){c=e.start.row;e=e.end.row;for(d=c;d<=e;d++)if(!a(b,d))return null;for(;a(b,c);)c--;for(;a(b,e);)e++;b=b.getSession().getLine(e-1).length;return new g(c+1,0,e-1,b)});c("includeBoundaries",!0,function(a,b,c,d){a=new k(b);c=a.moveToPosition(d.start);0===d.start.column&&(c=a.moveToPreviousToken());b=new k(b);d=b.moveToPosition(d.end,!0);if(c&&d){var e="support.function.codebegin"===
c.type&&"support.function.codeend"===d.type;e||(e=h.isOpeningBracket(c.value)&&h.getComplement(c.value)===d.value);if(e)return a=a.getCurrentTokenPosition(),c=b.getCurrentTokenPosition(),c.column+=d.value.length,g.fromPoints(a,c)}return null});c("matching",!1,function(a,b,c,d){a=new k(b);d=a.moveToPosition(d.start);if(null==d)return null;do{if(null==d)break;if(!a.bwdToMatchingToken()&&(h.isOpeningBracket(d.value)||"support.function.codebegin"===d.type)){c=a.getCurrentTokenPosition();"support.function.codebegin"===
d.type?(c.row++,c.column=0):c.column+=d.value.length;var e=a.clone();if(e.fwdToMatchingToken())return a=e.getCurrentTokenPosition(),"support.function.codebegin"===d.type&&(a.row--,a.column=b.getLine(a.row).length),g.fromPoints(c,a)}}while(d=a.stepBackward());return null});c("statement",!1,function(a,c,d,e){a=new k(c);if(!a.moveToPosition(e.start,!0))return null;c=new k(c);if(!(d=!c.moveToPosition(e.end)||!b(a,[";",",","=","<-","<<-"]))){a:{d=[";",","];for(var f=c.getCurrentToken(),m=c.getCurrentTokenRow();c.moveToNextSignificantToken();){var p=
c.getCurrentToken();if(m!==c.getCurrentTokenRow()&&0!==f.type.indexOf("keyword.operator")){if(!c.moveToPreviousSignificantToken()){d=!1;break a}break}if(l.test(f.value)||h.isClosingBracket(f.value))if(l.test(p.value)||h.isClosingBracket(p.value)||h.contains(d,p.value)){if(!c.moveToPreviousSignificantToken()){d=!1;break a}break}c.fwdToMatchingToken();f=c.getCurrentToken();m=c.getCurrentTokenRow()}d=!0}d=!d}if(d)return null;d=a.getCurrentTokenPosition();f=c.getCurrentTokenPosition();if(d.row===e.start.row&&
d.column===e.start.column&&f.row===e.end.row&&f.column<=e.end.column&&!b(a,[";",","]))return null;e=a.getCurrentTokenPosition();a=c.getCurrentTokenPosition();a.column+=c.getCurrentTokenValue().length;return g.fromPoints(e,a)});c("scope",!1,function(a,b,c,d){c=b.getMode();if(null==c.codeModel||null==c.codeModel.getCurrentScope)return null;a=[];for(d=c.codeModel.getCurrentScope(d.start);null!=d;){c=d.preamble;var e=d.end;if(null==e&&d.parentScope)for(var f=d.parentScope.$children,h=f.length-2;0<=h;h--)if(f[h].equals(d)){e=
f[h+1].preamble;break}null==e&&(e={row:b.getLength(),column:0});a.push(g.fromPoints(c,e));d=d.parentScope}return 0===a.length?null:a});c("everything",!1,function(a,b,c,d){a=b.getLength();if(0===a)return new g(0,0,0,0);b=b.getLine(a-1);return new g(0,0,a-1,b.length)});this.$expandSelection=function(){q||(d.on("change",d.$onClearSelectionHistory),q=!0);for(var a=this.getSession(),b=this.getSelection(),c=b.getRange(),f=[],g=0;g<p.length;g++){var k=p[g],l=k.execute(this,a,b,c);h.isArray(l)||(l=[l]);for(var n=
0;n<l.length;n++){var u=l[n];if(u&&k.immediate&&e(u,c))return this.$acceptSelection(b,u,c);u&&e(u,c)&&f.push({name:k.name,range:u})}}f.sort(function(a,b){a=a.range;b=b.range;var c=a.end.row-a.start.row,d=b.end.row-b.start.row;return c!==d?c>d:a.end.column-a.start.column>b.end.column-b.start.column});return this.$acceptSelection(b,f[0].range,c)};this.$shrinkSelection=function(){var a=this.$selectionRangeHistory;if(a&&a.length)return a=a.pop(),this.getSelection().setSelectionRange(a),this.isRowFullyVisible(a.start.row)&&
this.isRowFullyVisible(a.end.row)||this.centerSelection(this.getSelection()),a;q&&(d.off("change",d.$onClearSelectionHistory),q=!1);return this.getSelectionRange()}}).call(n.prototype)});define("mode/markdown",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("ace/mode/javascript").Mode,h=a("ace/mode/xml").Mode,f=a("ace/mode/html").Mode,e=a("mode/markdown_highlight_rules").MarkdownHighlightRules,b=a("mode/markdown_folding").FoldMode;a=function(){this.HighlightRules=e;this.createModeDelegates({"js-":k,"xml-":h,"html-":f});this.foldingRules=new b};l.inherits(a,g);(function(){this.type="text";this.blockComment={start:"\x3c!--",end:"--\x3e"};
this.getNextLineIndent=function(a,b,e){return this.$getIndent(b)};this.$id="mode/markdown"}).call(a.prototype);n.Mode=a});define("mode/markdown_folding",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("ace/mode/folding/fold_mode").FoldMode,k=a("ace/range").Range;n=n.FoldMode=function(){};var h=a("mode/utils");l.inherits(n,g);(function(){this.foldingStartMarker=/^(?:[=-]+\s*$|#{1,6} |`{3})/;this.getFoldWidget=function(a,e,b){e="markbeginend"===e?"end":"";var c=a.getLine(b);return this.foldingStartMarker.test(c)?"`"==c[0]?"start"===h.getPrimaryState(a,b)?e:"start":"":""};this.getFoldWidgetRange=
function(a,e,b){function c(b){return(l=a.getTokens(b)[0])&&0===l.type.lastIndexOf(n,0)}function d(){var a=l.value[0];return"="==a?6:"-"==a?5:7-l.value.search(/[^#]/)}var f=a.getLine(b);e=f.length;var g=a.getLength(),p=b,m=b;if(f.match(this.foldingStartMarker)){if("`"==f[0]){if("start"!==h.getPrimaryState(a,b)){for(;++b<g&&!(f=a.getLine(b),"`"==f[0]&"```"==f.substring(0,3)););return new k(p,e,b,0)}for(;0<b--&&!(f=a.getLine(b),"`"==f[0]&"```"==f.substring(0,3)););return new k(b,f.length,p,0)}var l,
n="markup.heading";if(c(b)){for(m=d();++b<g&&!(c(b)&&d()>=m););m=b-(l&&-1!=["=","-"].indexOf(l.value[0])?2:1);if(m>p)for(;m>p&&/^\s*$/.test(a.getLine(m));)m--;if(m>p)return b=a.getLine(m).length,new k(p,e,m,b)}}}}).call(n.prototype)});define("mode/markdown_highlight_rules",["require","exports","module"],function(a,n,l){function g(a,b){return{token:"support.function",regex:"^\\s*```(?:\\{"+a+"[^\\}]*\\}|"+a+")\\s*$",push:b+"start"}}l=a("ace/lib/oop");var k=a("ace/lib/lang"),h=a("ace/mode/text_highlight_rules").TextHighlightRules,f=a("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules,e=a("ace/mode/xml_highlight_rules").XmlHighlightRules,b=a("ace/mode/html_highlight_rules").HtmlHighlightRules,c=a("ace/mode/css_highlight_rules").CssHighlightRules,
d=a("ace/mode/scss_highlight_rules").ScssHighlightRules,u=a("ace/mode/sass_highlight_rules").SassHighlightRules,q=a("ace/mode/less_highlight_rules").LessHighlightRules,p=a("ace/mode/perl_highlight_rules").PerlHighlightRules,m=a("mode/python_highlight_rules").PythonHighlightRules,t=a("ace/mode/ruby_highlight_rules").RubyHighlightRules,B=a("ace/mode/scala_highlight_rules").ScalaHighlightRules,v=a("mode/sh_highlight_rules").ShHighlightRules;a("mode/stan_highlight_rules");var y=a("mode/sql_highlight_rules").SqlHighlightRules,
C=a("mode/mermaid_highlight_rules").MermaidHighlightRules,w=a("ace/mode/dot_highlight_rules").DotHighlightRules,r=function(a){return"(?:[^"+k.escapeRegExp(a)+"\\\\]|\\\\.)*"},D=!0,H=7;n.setRainbowFencedDivs=function(a){D=a};n.getRainbowFencedDivs=function(){return D};n.setNumFencedDivsColors=function(a){H=a};a=function(){var a=k.arrayToMap("title author date rtl depends autosize width height transition transition-speed font-family css class navigation incremental left right id audio video type at help-doc help-topic source console console-input execute pause".split(" ")),
h={token:["text","constant.numeric.text","constant.numeric.text","constant.numeric.text"],regex:"(^|\\s+)(_{2,3})(?![\\s_])(.*?)(?=_)(\\2)\\b"},l={token:["text","constant.language.boolean.text"],regex:"(^|\\s+)(_(?=[^\\s_]).*?_)\\b"},n={token:["constant.numeric.text","constant.numeric.text","constant.numeric.text"],regex:"([*]{2,3})(?![\\s*])(.*?)(?=[*])(\\1)"},x={token:["constant.language.boolean.text"],regex:"([*](?=[^\\s*]).*?[*])"},z={token:"text",regex:"\\^\\["+r("]")+"\\]"},I={token:"text constant text url string text".split(" "),
regex:'^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:["][^"]+["])?(\\s*))$'},K={token:["text","keyword","text","constant","text"],regex:"(\\s*\\[)("+r("]")+")(\\]\\[)("+r("]")+")(\\])"},P={token:"text keyword text markup.href string text paren.keyword.operator nospell paren.keyword.operator".split(" "),regex:"(\\s*\\[)("+r("]")+')(\\]\\()((?:[^\\)\\s\\\\]|\\\\.|\\s(?=[^"]))*)(\\s*"'+r('"')+'"\\s*)?(\\))(?:(\\s*{)((?:[^\\}]+))(\\s*}))?'},Q={token:["text","keyword","text"],regex:"(<)((?:https?|ftp|dict):[^'\">\\s]+|(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+)(>)"};
this.$rules={basic:[{token:"constant.language.escape",regex:/\\[\\`*_{}[\]()#+\-.!]/},{token:"text",regex:/[?]`/},{token:"support.function.inline_r_chunk",regex:"`r (?:.*?[^`])`"},{token:["support.function","support.function","support.function"],regex:"(`+)(.*?[^`])(\\1)"},z,I,K,P,Q,n,h,x,l],start:[{token:"empty_line",regex:"^\\s*$",next:"allowBlock"},{token:"text",regex:/[?]`/},{token:"support.function.inline_r_chunk",regex:"`r (?:.*?[^`])`"},{token:["support.function","support.function","support.function"],
regex:"(`+)([^\\r]*?[^`])(\\1)"},{token:"markup.heading.1",regex:"^\\={3,}\\s*$",next:"fieldblock"},{token:"markup.heading.1",regex:"^={3,}(?=\\s*$)"},{token:"markup.heading.2",regex:"^\\-{3,}(?=\\s*$)"},{token:"fenced_open",regex:"^[:]{3,}\\s*.*$",onMatch:function(a,b,c){if(!D)return"keyword.operator";c=c||[];c[0]=b;c[16]=c[16]||0;c[17]=c[17]||[];if(/^[:]{3,}\s*$/.test(a))return b=c[17].pop()||0,"fenced_div_"+b;b=c[16];c[17].push(b);c[16]=(b+1)%H;c=/^([:]{3,})(.*)$/;return[{type:"fenced_div_"+b,
value:a.replace(c,"$1")},{type:"fenced_div_text_"+b,value:a.replace(c,"$2")}]},next:"start"},{token:function(a){return"markup.heading."+a.length},regex:/^#{1,6}(?=\s*[^ #]|\s+#.)/,next:"header"},g("(?:javascript|js)","jscode-"),g("xml","xmlcode-"),g("html","htmlcode-"),g("css","csscode-"),g("scss","scsscode-"),g("sass","sasscode-"),g("less","lesscode-"),g("mermaid","mermaidcode-"),g("dot","dotcode-"),g("perl","perlcode-"),g("python","pythoncode-"),g("ruby","rubycode-"),g("scala","scalacode-"),g("sh",
"shcode-"),g("bash","bashcode-"),g("stan","stancode-"),g("sql","sqlcode-"),g("d3","jscode-"),{token:"support.function",regex:"^\\s*```\\s*\\S*(?:{.*?\\})?\\s*$",next:"githubblock"},{token:"string.blockquote",regex:"^\\s*>\\s*(?=[-])"},{token:"string.blockquote",regex:"^\\s*>\\s*",next:"blockquote"},z,I,K,{token:"constant.hr",regex:"^\\s*[*](?:\\s*[*]){2,}\\s*$",next:"allowBlock"},{token:"constant.hr",regex:"^\\s*[-](?:\\s*[-]){2,}\\s*$",next:"allowBlock"},{token:"constant.hr",regex:"^\\s*[_](?:\\s*[_]){2,}\\s*$",
next:"allowBlock"},{token:"latex.markup.list.string.begin",regex:"\\\\\\[",next:"mathjaxnativedisplay"},{token:"latex.markup.list.string.begin",regex:"\\\\\\(",next:"mathjaxnativeinline"},{token:"text",regex:"\\\\\\$"},{token:"latex.markup.list.string.begin",regex:"\\${2}",next:"mathjaxdisplay"},{token:["latex.markup.list.string.begin","latex.support.function","latex.markup.list.string.end"],regex:"(\\$)((?:(?:\\\\.)|(?:[^\\$\\\\]))*?)(\\$)"},{token:["text","keyword","text"],regex:"(<)((?:https?|ftp|dict):[^'\">\\s]+|(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+)(>)"},
{token:"keyword",regex:"\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])"},{token:"paren.keyword.operator",regex:"[{}]"},{token:"markup.list",regex:"-?\\@[\\w\\d-]+"},{token:"text",regex:"[^\\*_%$`\\[#<>{}\\\\@\\s!]+"},{token:"text",regex:"\\\\"},{token:"text",regex:"^\\s*(?:[*+-]|\\d+\\.)\\s+",next:"listblock"},n,h,x,l,{token:"comment",regex:"<\\!--",next:"html-comment"},{include:"basic"}],"html-comment":[{token:"comment",regex:"--\x3e",next:"start"},{defaultToken:"comment.text"}],allowBlock:[{token:"support.function",
regex:"^ {4}.+",next:"allowBlock"},{token:"empty_line",regex:"^\\s*$",next:"allowBlock"},{token:"empty",regex:"",next:"start"}],header:[{regex:"$",next:"start"},{include:"basic"},{defaultToken:"heading"}],listblock:[{token:"empty_line",regex:"^\\s*$",next:"start"},{token:"text",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock"},{token:["latex.markup.list.string.begin","latex.support.function","latex.markup.list.string.end"],regex:"(\\$)((?:(?:\\\\.)|(?:[^\\$\\\\]))*?)(\\$)"},{include:"basic",
noEscape:!0},{token:"support.function",regex:"^\\s*```\\s*[a-zA-Z]*(?:{.*?\\})?\\s*$",next:"githubblock"},{defaultToken:"text"}],blockquote:[{token:"empty_line",regex:"^\\s*$",next:"start"},{token:"constant.language.escape",regex:/\\[\\`*_{}[\]()#+\-.!]/},{token:"text",regex:/[?]`/},{token:"support.function.inline_r_chunk",regex:"`r (?:.*?[^`])`"},{token:["support.function","support.function","support.function"],regex:"(`+)(.*?[^`])(\\1)"},z,I,K,P,Q,n,h,x,l,{defaultToken:"string.blockquote"}],githubblock:[{token:"support.function",
regex:"^\\s*```",next:"start"},{token:"support.function",regex:".+"}],fieldblock:[{token:function(b){b=b.slice(0,-1);return a[b]?"comment.doc.tag":"text"},regex:"^[\\w-]+\\:",next:"fieldblockvalue"},{token:"text",regex:"(?=.+)",next:"start"}],fieldblockvalue:[{token:"text",regex:"$",next:"fieldblock"},{token:"text",regex:"[^{}]+"}],mathjaxdisplay:[{token:"latex.markup.list.string.end",regex:"\\${2}",next:"start"},{token:"latex.support.function",regex:"[^\\$]+"}],mathjaxnativedisplay:[{token:"latex.markup.list.string.end",
regex:"\\\\\\]",next:"start"},{token:"latex.support.function",regex:"[\\s\\S]+?"}],mathjaxnativeinline:[{token:"latex.markup.list.string.end",regex:"\\\\\\)",next:"start"},{token:"latex.support.function",regex:"[\\s\\S]+?"}]};this.embedRules(f,"jscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(b,"htmlcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(c,"csscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(d,
"scsscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(u,"sasscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(q,"lesscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(e,"xmlcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(p,"perlcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(m,"pythoncode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);
this.embedRules(t,"rubycode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(C,"mermaidcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(w,"dotcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(B,"scalacode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(v,"shcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(v,"bashcode-",[{token:"support.function",regex:"^\\s*```",
next:"pop"}]);this.embedRules(y,"sqlcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(f,"jscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.normalizeRules()};l.inherits(a,h);n.MarkdownHighlightRules=a});define("mode/mermaid",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("ace/tokenizer").Tokenizer,h=a("mode/mermaid_highlight_rules").MermaidHighlightRules;a=function(){this.$highlightRules=new h;this.$tokenizer=new k(this.$highlightRules.getRules())};l.inherits(a,g);(function(){this.getNextLineIndent=function(a,e,b){return this.$getIndent(e)}}).call(a.prototype);n.Mode=a});define("mode/mermaid_highlight_rules",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(){this.createKeywordMapper({keyword:"sequenceDiagram|participant|graph|subgraph|loop|alt|is|opt|else|end|style|linkStyle|classDef|class"},"identifier",!1);this.$rules={start:[{token:"comment",regex:"%%.*$"},{token:"keyword",merge:!1,regex:"^\\s*graph\\s+(?:TB|BT|RL|LR|TD)\\s*$"},{token:"keyword",merge:!1,regex:"^\\s*(?:sequenceDiagram|participant|subgraph|loop|alt(?:\\s+is)?|opt|else(?:\\s+is)?|end|style|linkStyle|classDef|class)"},
{token:"keyword.operator",merge:!1,regex:">|\\->|\\-\\->|\\-\\-\\-|\\-\\-|\\-\\.\\->|\\-\\.|\\.\\->|==>|==|\\->>|\\-\\->>|\\-x|\\-\\-x"},{token:"paren.keyword.operator",merge:!1,regex:"[[({\\|]"},{token:"paren.keyword.operator",merge:!1,regex:"[\\])}]"},{token:"markup.list",merge:!1,regex:"Note\\s+(?:left|right)\\s+of"},{token:"markup.list",merge:!1,regex:"<br/>"},{token:"text",regex:"\\s+",merge:!0}]}};l.inherits(g,a);n.MermaidHighlightRules=g});define("mode/python",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("mode/python_highlight_rules").PythonHighlightRules,h=a("ace/mode/folding/pythonic").FoldMode,f=a("ace/range").Range;a=function(){this.HighlightRules=k;this.foldingRules=new h("\\:")};l.inherits(a,g);(function(){this.lineCommentStart="#";this.getLanguageMode=function(a){return"Python"};this.getNextLineIndent=function(a,b,c,d){a=this.$getIndent(b);if(/^\s*[#]/.test(b))return a;/[{([:]\s*(?:$|[#])/.test(b)&&
(a+=c);/^\s*(?:break|continue|pass|raise|return)\b/.test(b)&&(a=a.substring(0,a.length-c.length));return a};this.$performOutdent=function(a,b,c){var d=a.doc.$lines[c];c=this.$getIndent(a.doc.$lines[b]);d=this.$getIndent(d);d.length<c.length&&(b=new f(b,0,b,c.length),a.replace(b,d));return!0};this.$autoOutdentElse=function(a,b,c){a=b.doc.$lines[c].substring(0,b.selection.cursor.column);if(!/^\s*(?:else|elif)(?:\s|[:])/.test(a))return!1;for(a=c-1;0<=a;a--)if(/^\s*(?:if|elif|for|try)(?:\s|[:])/.test(b.doc.$lines[a]))return this.$performOutdent(b,
c,a)};this.$autoOutdentExceptFinally=function(a,b,c){a=b.doc.$lines[c].substring(0,b.selection.cursor.column);if(!/^\s*(?:except|finally)(?:\s|[:])/.test(a))return!1;for(a=c-1;0<=a;a--)if(/^\s*(?:try)(?:\s|[:])/.test(b.doc.$lines[a]))return this.$performOutdent(b,c,a)};this.checkOutdent=function(a,b,c){this.$lastInput=c;return":"===c||" "===c};this.$canAutoOutdent=function(a,b,c){a=b.selection.cursor;return 0===a.column?!1:":"===this.$lastInput?!0:" "===this.$lastInput?(b=b.getTokenAt(a.row,a.column-
1)||{},/\bkeyword\b/.test(b.type)):!1};this.autoOutdent=function(a,b,c){this.$canAutoOutdent(a,b,c)&&(this.$autoOutdentElse(a,b,c)||this.$autoOutdentExceptFinally(a,b,c))};this.transformAction=function(a,b,c,d,f){return!1};this.$id="mode/python"}).call(a.prototype);n.Mode=a});define("mode/python_highlight_rules",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("ace/mode/text_highlight_rules").TextHighlightRules,k=a("mode/rainbow_paren_highlight_rules").RainbowParenHighlightRules;a=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"#\\s*[|].*$",next:"start"},{token:"comment",regex:"#.*$"},{token:"constant.language",regex:"@[a-zA-Z_][a-zA-Z0-9._]*\\b"},{token:"string",regex:'(?:b|B|br|Br|bR|BR|rb|rB|Rb|RB|r|u|R|U|f|F|fr|Fr|fR|FR|rf|rF|Rf|RF)?"{3}',
next:"qqstring3"},{token:"string",regex:'(?:b|B|br|Br|bR|BR|rb|rB|Rb|RB|r|u|R|U|f|F|fr|Fr|fR|FR|rf|rF|Rf|RF)?"(?=.)',next:"qqstring"},{token:"string",regex:"(?:b|B|br|Br|bR|BR|rb|rB|Rb|RB|r|u|R|U|f|F|fr|Fr|fR|FR|rf|rF|Rf|RF)?'{3}",next:"qstring3"},{token:"string",regex:"(?:b|B|br|Br|bR|BR|rb|rB|Rb|RB|r|u|R|U|f|F|fr|Fr|fR|FR|rf|rF|Rf|RF)?'(?=.)",next:"qstring"},{token:"constant.numeric",regex:"(?:(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+))(?:[eE][+-]?\\d+))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))|\\d+)[jJ]\\b"},
{token:"constant.numeric",regex:"(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+))(?:[eE][+-]?\\d+))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))"},{token:"constant.numeric",regex:"(?:(?:(?:[1-9]\\d*)|(?:0))|(?:0[oO]?[0-7]+)|(?:0[xX][\\dA-Fa-f]+)|(?:0[bB][01]+))[lL]\\b"},{token:"constant.numeric",regex:"(?:(?:(?:[1-9]\\d*)|(?:0))|(?:0[oO]?[0-7]+)|(?:0[xX][\\dA-Fa-f]+)|(?:0[bB][01]+))\\b"},{token:this.createKeywordMapper({"invalid.deprecated":"debugger","support.function":"abs|all|any|ascii|basestring|bin|bool|breakpoint|bytearray|bytes|callable|chr|classmethod|cmp|compile|complex|delattr|dict|dir|divmod|eumerate|eval|execfile|exec|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|print|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip|__import__",
"constant.language":"NotImplemented|Ellipsis|__debug__",keyword:"False|None|True|and|as|assert|async|await|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|raise|return|try|while|with|yield"},"identifier"),regex:"[a-zA-Z_][a-zA-Z0-9_]*\\b"},{token:"keyword.operator",regex:"//=|\\*\\*=|>>=|<<=|//|\\*\\*|==|!=|>=|<=|:=|>>|<<|\\+=|-=|\\*=|/=|&=|%=|\\|=|\\^=|\\+|-|\\*|/|%|>|<|\\^|~|\\||&|=|:|\\.|;|,",merge:!1},k.getParenRule(),{token:"text",
regex:"\\s+"}],qqstring3:[{token:"constant.language.escape",regex:"\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})"},{token:"string",regex:'"{3}',next:"start"},{defaultToken:"string"}],qstring3:[{token:"constant.language.escape",regex:"\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})"},{token:"string",regex:"'{3}",next:"start"},{defaultToken:"string"}],qqstring:[{token:"constant.language.escape",regex:"\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})"},
{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:"\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})"},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"start"},{defaultToken:"string"}]}};l.inherits(a,g);n.PythonHighlightRules=a});define("mode/r",["require","exports","module"],function(a,n,l){a("ace/editor");a("ace/edit_session");a("ace/range");l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("ace/tokenizer").Tokenizer,h=a("ace/mode/text_highlight_rules").TextHighlightRules,f=a("mode/r_highlight_rules").RHighlightRules,e=a("mode/r_code_model").RCodeModel,b=a("mode/r_matching_brace_outdent").RMatchingBraceOutdent;a("mode/auto_brace_insert");var c=a("ace/unicode");a=function(a,c){this.$tokenizer=a?new k((new h).getRules()):
new k((new f).getRules());this.foldingRules=this.codeModel=new e(c,this.$tokenizer);this.$outdent=new b(this.codeModel)};l.inherits(a,g);(function(){this.getLanguageMode=function(a){return"R"};this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(a,b,c)};this.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(a,b,c)};this.tokenRe=new RegExp("^["+c.wordChars+"._]+","g");this.nonTokenRe=new RegExp("^(?:[^"+c.wordChars+"._]|\\s)+","g");this.$complements={"(":")","[":"]",'"':'"',
"'":"'","{":"}","`":"`"};this.$reOpen=/^[{(\["'`]$/;this.$reClose=/^[})\]"'`]$/;this.getNextLineIndent=function(a,b,c,e){return this.codeModel.getNextLineIndent(a,b,c,e)};this.allowAutoInsert=this.smartAllowAutoInsert;this.getIndentForOpenBrace=function(a){return this.codeModel.getIndentForOpenBrace(a)};this.$getIndent=function(a){return(a=a.match(/^(\s+)/))?a[1]:""};this.$id="mode/r"}).call(a.prototype);n.Mode=a});define("mode/r_code_model",["require","exports","module"],function(a,n,l){function g(a,b){for(var c=0;c<b.length;c++)if(a===b[c])return!0;return!1}function k(a){return"if"===a||"for"===a||"while"===a||"repeat"===a||"function"===a}var h=a("ace/range").Range,f=a("ace/token_iterator").TokenIterator,e=a("mode/token_cursor").RTokenCursor,b=a("mode/utils"),c=!1,d=a("mode/r_scope_tree").ScopeManager,u=a("mode/r_scope_tree").ScopeNode;a=function(a,b,c,e,f){this.$session=a;this.$doc=a.getDocument();this.$tokenizer=
b;this.$tokens=Array(this.$doc.getLength());this.$endStates=Array(this.$doc.getLength());this.$statePattern=c;this.$codeBeginPattern=e;this.$codeEndPattern=f;this.$scopes=new d(u);var g=!0,h=function(a,b){g?g=!1:(this.$doc.off("change",m),this.$session.off("changeMode",h))}.bind(this),m=function(a){this.$onDocChange(a)}.bind(this);this.$session.on("changeMode",h);this.$doc.on("change",m)};(function(){function a(a){return"keyword"==a.type&&("function"==a.value||"\\"==a.value)}function d(a){return/\boperator\b/.test(a.type)&&
/^(=|<-|<<-)$/.test(a.value)}function m(a){return/\bidentifier\b/.test(a.type)}function l(b){var c=b.cloneCursor();if("{"!==c.currentValue()||!c.moveBackwardOverMatchingParens()||!c.moveToPreviousToken()||!a(c.currentToken()))return!1;b.$row=c.$row;b.$offset=c.$offset;return!0}function n(a){a=a.cloneCursor();if(!("{"===a.currentValue()&&a.moveToPreviousToken()&&","!=!a.currentToken().value&&a.moveToPreviousToken()&&"string"!=!a.currentToken().type&&a.moveToPreviousToken()&&"("!=!a.currentToken().value&&
a.moveToPreviousToken()))return!1;a=a.currentToken();return m(a)&&"test_that"==a.value}function u(a){for(;a.findOpeningBracket("(")&&a.moveToPreviousToken();)if(g(a.currentValue(),["if","for","while"]))return!0;return!1}function y(b){var c=b.cloneCursor();if(!(a(c.currentToken())&&c.moveToPreviousToken()&&d(c.currentToken())&&c.moveToPreviousToken()))return!1;b.$row=c.$row;b.$offset=c.$offset;return!0}function C(a){return/\binfix\b/.test(a.type)||"|>"===a.value}function w(b){if(a(b.currentToken())&&
!b.moveToNextToken()||"("===b.currentValue()&&!b.moveToNextToken()||")"===b.currentValue())return[];var c=[];for(m(b.currentToken())&&c.push(b.currentValue());b.moveToNextToken();)if(!b.fwdToMatchingToken()){if(")"===b.currentValue())break;if(","===b.currentValue()){for(;","===b.currentValue()&&b.moveToNextToken(););m(b.currentToken())&&c.push(b.currentValue())}}return c}function r(a){for(var c=0,d=Math.min(a.getLength(),100),e="Title";c++<d;){var f=a.getLine(c);if(/^\s*[-]{3}\s*$/.test(f))break;
f=/^\s*title:\s+(.*?)\s*$/.exec(f);if(null!==f){e=f[1];break}}return b.stripEnclosingQuotes(e.trim())}function D(a){return"keyword.operator"===a||"keyword.operator.infix"===a}var H=b.contains;this.getTokenCursor=function(){return new e(this.$tokens,0,0,this)};this.$complements={"(":")",")":"(","[":"]","]":"[","{":"}","}":"{"};var F=function(a){a=a.trim();return a=a.replace(/[\n\s]+/g," ")};this.getFunctionsInScope=function(a){this.$buildScopeTreeUpToRow(a.row);return this.$scopes.getFunctionsInScope(a)};
this.getAllFunctionScopes=function(a){"undefined"===typeof a&&(a=this.$doc.getLength());this.$buildScopeTreeUpToRow(a);return this.$scopes.getAllFunctionScopes()};this.getDplyrJoinContextFromInfixChain=function(a){var b=a.cloneCursor();a="";b.hasType("identifier")&&(a=b.currentValue());var c="left";"="===b.currentValue()&&(c="right");if(b.hasType("identifier")){if(!b.moveToPreviousToken())return null;"="===b.currentValue()&&(c="right")}if(!b.findOpeningBracket("(",!0)||!b.moveToPreviousToken())return null;
for(;b.findOpeningBracket("(",!0)&&b.moveToPreviousToken();)if(/_join$/.test(b.currentValue())){var d=b.currentValue();if(!b.moveToNextToken())break;if(!b.moveToNextToken())break;var e=b.currentValue();if(!1===this.moveToDataObjectFromInfixChain(b))break;b=b.currentValue();return{token:a,leftData:b,rightData:e,verb:d,cursorPos:c}}return null};this.getDataFromInfixChain=function(a){var b=this.moveToDataObjectFromInfixChain(a),c=[],d=[],e="",f=!1;!1!==b&&(b.excludeArgsFromObject&&(f=b.excludeArgsFromObject),
c=a.cloneCursor(),c.findStartOfEvaluationContext(),e=this.$doc.getTextRange(new h(c.currentPosition().row,c.currentPosition().column,a.currentPosition().row,a.currentPosition().column+a.currentValue().length)),c=b.additionalArgs,d=b.excludeArgs,1==b.cancel&&(f=!0,c=[],d=[]));return{name:e,additionalArgs:c,excludeArgs:d,excludeArgsFromObject:f}};var M="mutate summarise summarize rename transmute select rename_vars inner_join left_join right_join semi_join anti_join outer_join full_join".split(" "),
J=function(a,b,c,d){if(!a.moveToNextToken()||"("!==a.currentValue()||!a.moveToNextToken()||")"===a.currentValue())return!1;a.hasType("identifier")&&b.additionalArgs.push(a.currentValue());if("rename"===d){if(!a.moveToNextToken())return!1;if("="===a.currentValue()){if(!a.moveToNextToken())return!1;b.excludeArgs.push(a.currentValue())}}"select"===d&&(b.excludeArgsFromObject=!0);do{if(")"===a.currentValue())break;if(a.$row>c.$row||a.$row===c.$row&&a.$offset>=c.$offset)break;if(a.fwdToMatchingToken()){if(!a.moveToNextToken())break}else if(","===
a.currentValue()){if(!a.moveToNextToken())return!1;a.hasType("identifier")&&b.additionalArgs.push(a.currentValue());if(!a.moveToNextToken())return!1;if("="===a.currentValue()&&g(d,["rename","rename_vars"])){if(!a.moveToNextToken())return!1;a.hasType("identifier")&&b.excludeArgs.push(a.currentValue())}}}while(a.moveToNextToken());return!0};this.moveToDataObjectFromInfixChain=function(a){var b=a.cloneCursor(),c;a:{for(c=b.cloneCursor();c.findOpeningBracket("(",!1)&&c.moveToPreviousToken()&&c.moveToPreviousToken();){if("::"===
c.currentValue()||":::"===c.currentValue()){if(!c.moveToPreviousToken())break;if(!m(c.currentToken())||!c.moveToPreviousToken())break}if(C(c.currentToken())){b.$row=c.$row;b.$offset=c.$offset;c=!0;break a}}c=!1}if(!c)return!1;for(c={additionalArgs:[],excludeArgs:[],cancel:!1};;){if(0===b.$row&&0===b.$offset)return a.$row=0,a.$offset=0,c;b.moveBackwardOverMatchingParens();if(!b.moveToPreviousToken())return!1;var d=b.currentValue();"pull"===d&&(c.cancel=!0);H(M,d)&&J(b.cloneCursor(),c,a,d);if(!b.moveToPreviousToken())return 0===
b.$row&&0===b.$offset?(a.$row=0,a.$offset=0,c):!1;if("::"===b.currentValue()||":::"===b.currentValue())if(!b.moveToPreviousToken()||!b.moveToPreviousToken())return!1;if(!C(b.currentToken()))break}if(!b.moveToNextToken())return!1;a.$row=b.$row;a.$offset=b.$offset;return c};var V=function(a){var b=a.cloneCursor();if(!b.findOpeningBracket(["(","["],!0)||!b.moveToPreviousToken())return!1;a.$row=b.$row;a.$offset=b.$offset;return!0};this.getVariablesInScope=function(b){var c=this.getTokenCursor();if(!c.moveToPosition(b))return[];
for(;V(c);){if(a(c.currentToken()))b=y(c);else{b=c;var e=b.cloneCursor();m(e.currentToken())&&e.moveToPreviousToken()&&d(e.currentToken())&&e.moveToPreviousToken()?(b.$row=e.$row,b.$offset=e.$offset,b=!0):b=!1}b&&c.findStartOfEvaluationContext()}b={};do if(!c.bwdToMatchingToken()){e=b;var f=c.cloneCursor();if("for"===f.currentValue()&&f.moveToNextToken()&&"("===f.currentValue()&&f.moveToNextToken()){var g=f.currentValue();f.moveToNextToken()&&"in"===f.currentValue()&&(e[g]="variable")}d(c.currentToken())&&
(e="variable",f=c.cloneCursor(),f.moveToNextToken()&&"function"===f.currentValue()&&(e="function"),f=c.cloneCursor(),f.moveToPreviousToken()&&m(f.currentToken())&&(f=f.currentValue(),b[f]=e))}while(c.moveToPreviousToken());c=[];for(var h in b)c.push({token:h,type:b[h]});c.sort();return c};this.$buildScopeTreeUpToRow=function(a){function c(a,c,d){if("undefined"===typeof a)return"";if(c=a.exec(c))if(a=c[1],a=a.split(","),0<a.length){c=a[0];if(!/=/.test(c)&&(c=c.replace(/(^\s+)|(\s+$)/g,""),c.length))return c;
for(var e=0;e<a.length;e++)if(c=/^\s*label\s*=\s*(.*)$/.exec(a[e]))return b.stripEnclosingQuotes(c[1].trim())}d=d.clone();for(a=d.moveToNextToken();null!=a&&a.type.startsWith("comment");){a=a.value;c=/^#\|\s*label\s*:\s*(.*)$/;if(c.test(a))return a.replace(c,"$1");a=d.moveToNextToken()}return null}var d=this.$session.getMode().$id;a=Math.min(a+30,this.$doc.getLength()-1);var e=this.$scopes.parsePos.row;if(e>=a)return e;e=new f(this.$session);e.tokenizeUpToRow(a);this.$tokenizeUpToRow(a);var g=this.$scopes.parsePos.row;
e.moveToPosition({row:g,column:this.$scopes.parsePos.column},!0);var m=e.getCurrentToken();if(null==m)return g;var p=m.value,k=m.type,q=e.getCurrentTokenPosition();g=this.$scopes.getChunkCount();do{if(e.$row>a)break;p=m.value;k=m.type;q=e.getCurrentTokenPosition();m=b.getPrimaryState(this.$session,q.row);if("rdoc-start"===m)e.moveToEndOfRow();else{var u=!0;this.$codeBeginPattern&&(u=/^r-/.test(m));if(b.startsWith(k,"markup.heading")){k="";u={row:q.row,column:0};var x={row:q.row+1,column:0};m=0;if(/^\s*#+\s*$/.test(p))m=
p.split("#").length-1,p=this.$session.getLine(q.row),k=p.replace(/^\s*[#]+\s*/,"");else if(/^[-=]{3,}\s*$/.test(p)&&(m="="===p[0]?1:2,k=this.$session.getLine(q.row-1).trim(),u.row--,0===k.length))continue;0===k.length&&(k="(Untitled)");k=k.replace(/{.*}\s*$/,"");this.$scopes.onMarkdownHead(k,u,x,m,!0)}else if(u&&/\bsectionhead\b/.test(k)){k="(Untitled)";if(m=/[^#=-\s]/.exec(p))k=p.substr(m.index),k=k.replace(/\s*[#=-]+\s*$/,"");p=/^\s*([#]+)\s*[^#]/.exec(p);if(null!=p)if(m=p[1].length,6<m)this.$scopes.onSectionStart(k,
q);else u={row:q.row,column:0},x={row:q.row,column:Infinity},this.$scopes.onMarkdownHead(k,u,x,m,!1);else this.$scopes.onSectionStart(k,q)}else if(u||"mode/sweave"!==d||"keyword"!==k||0!==q.column||0!==p.indexOf("\\")||"\\chapter"!==p&&"\\section"!==p&&"\\subsection"!==p&&"\\subsubsection"!==p)if(/\bcodebegin\b/.test(k)&&"---"===p)p=r(this.$session),this.$scopes.onSectionStart(p,q,{isYaml:!0});else if(/\bcodeend\b/.test(k)&&"---"===p)q.column=Infinity,this.$scopes.onSectionEnd(q);else if("mode/rmarkdown"===
d&&/\bcodebegin\b/.test(k)&&0===p.trim().indexOf("/***"))this.$scopes.onSectionStart("(R Code Chunk)",q);else if("mode/rmarkdown"===d&&/\bcodeend\b/.test(k)&&0===p.trim().indexOf("*/"))this.$scopes.onSectionEnd(q);else/\bcodebegin\b/.test(k)?(g++,k={row:q.row+1,column:0},u=g,m=c(this.$codeBeginPattern,p,e),u="Chunk "+u,m&&"YAML Header"!==p&&(u+=": "+m),this.$scopes.onChunkStart(m,u,q,k)):/\bcodeend\b/.test(k)?(q.column+=p.length,this.$scopes.onChunkEnd(q)):u&&"{"===p?(p=this.getTokenCursor(),p.moveToPosition(q,
!0),k=p.cloneCursor(),l(k)?(m=k.cloneCursor(),m.moveToNextToken(),q=null,y(k)&&(u=k.cloneCursor(),x=k.cloneCursor(),x.findStartOfEvaluationContext()&&(q=x.currentPosition(),x=u.currentPosition(),q.row!==x.row?(q.row=x.row,q.column=0,k.$row=q.row,k.$offset=0):k.moveToPosition(q,!0),q=this.$doc.getTextRange(new h(q.row,q.column,x.row,x.column+u.currentValue().length)))),u=k.currentPosition(),k.isFirstSignificantTokenOnLine()&&(u.column=0),k=w(m),m="("+k.join(", ")+")",m=null==q?F("<function>"+m):F(q+
m),this.$scopes.onFunctionScopeStart(m,u,p.currentPosition(),q,k)):n(k)?(k=k.cloneCursor(),k.moveToPreviousToken(),k.moveToPreviousToken(),q=k.currentToken().value,k=k.cloneCursor(),k.moveToPreviousToken(),k.moveToPreviousToken(),this.$scopes.onTestScopeStart(q,k.currentPosition(),p.currentPosition())):(u=p.currentPosition(),p.isFirstSignificantTokenOnLine()&&(u.column=0),this.$scopes.onScopeStart(u))):u&&"}"===p&&(q.column+=1,this.$scopes.onScopeEnd(q));else m=1,"\\chapter"===p?m=2:"\\section"===
p?m=3:"\\subsection"===p?m=4:"\\subsubsection"===p&&(m=5),p=this.$doc.getLine(q.row),p=/{([^}]*)}/.exec(p),k="",null!=p&&(k=p[1]),u={row:q.row,column:0},x={row:q.row,column:Infinity},this.$scopes.onMarkdownHead(k,u,x,m,!0)}}while(m=e.moveToNextToken());a=Math.max(a,e.$row);this.$scopes.parsePos={row:a,column:-1};return a};this.$getFoldToken=function(a,b,c){this.$tokenizeUpToRow(c);if(this.$statePattern&&!this.$statePattern.test(this.$endStates[c]))return"";a=this.$tokens[c];for(c=0;c<a.length;c++)if(/\bsectionhead\b/.test(a[c].type))return a[c];
var d=0,e=null,f=null;for(c=0;c<a.length;c++){var g=a[c];if(/\bparen\b/.test(g.type))switch(g.value){case "{":d++;1==d&&(e=g);break;case "}":d--,0==d&&(e=null),0>d&&(f=g,d=0)}}return e?e:"markbeginend"==b&&f?f:1<=a.length&&(/\bcodebegin\b/.test(a[0].type)||/\bcodeend\b/.test(a[0].type))?a[0]:null};this.getFoldWidget=function(a,b,c){a=this.$getFoldToken(a,b,c);return null==a?"":"{"==a.value?"start":"}"==a.value?"end":/\bcodebegin\b/.test(a.type)?"start":/\bcodeend\b/.test(a.type)?"end":/\bsectionhead\b/.test(a.type)?
"start":""};this.getFoldWidgetRange=function(a,c,d){var e=this.$getFoldToken(a,c,d);if(e){c={row:d,column:e.column+1};if("{"==e.value)return(a=a.$findClosingBracket(e.value,c,b.getTokenTypeRegex("paren")))?h.fromPoints(c,a):void 0;if("}"==e.value)return(a=a.$findOpeningBracket(e.value,c,b.getTokenTypeRegex("paren")))?h.fromPoints({row:a.row,column:a.column+1},{row:c.row,column:c.column-1}):void 0;if(/\bcodebegin\b/.test(e.type)){c=new f(a,d,0);for(var g;g=c.stepForward();)if(/\bcode(begin|end)\b/.test(g.type))return g=
/\bcodebegin\b/.test(g.type),c=c.getCurrentTokenRow(),a=g?{row:c-1,column:a.getLine(c-1).length}:{row:c,column:a.getLine(c).length},h.fromPoints({row:d,column:e.column+e.value.length},a)}else if(/\bcodeend\b/.test(e.type))for(c=new f(a,d,0);e=c.stepBackward();){if(/\bcodebegin\b/.test(e.type))return c=c.getCurrentTokenRow(),h.fromPoints({row:c,column:a.getLine(c).length},{row:d,column:a.getLine(d).length})}else if(/\bsectionhead\b/.test(e.type)){e=a.getLine(d);if(/^\s*[#=-]+\s*$/.test(e))e=e.length;
else{e=/[#=-]+\s*$/.exec(e);if(!e)return;e=e.index}c.column=e;d=new f(a,d+1);for(d.$tokenIndex=-1;(token=d.stepForward())&&"}"!==token.value&&!/\bsectionhead\b/.test(token.type)&&!/\bcode(?:begin|end)/.test(token.type);)"{"===token.value&&d.fwdToMatchingToken();d=d.getCurrentTokenRow();token&&d--;a={row:d,column:a.getLine(d).length};return h.fromPoints(c,a)}}};this.getCurrentScope=function(a,b){b||(b=function(a){return!0});if(!a)return"";this.$buildScopeTreeUpToRow(a.row);var c=this.$scopes.getActiveScopes(a);
if(c)for(var d=c.length-1;0<=d;d--)if(b(c[d]))return c[d];return null};this.getScopeTree=function(){this.$buildScopeTreeUpToRow(this.$doc.getLength()-1);return this.$scopes.getScopeList()};this.findFunctionDefinitionFromUsage=function(a,b){this.$buildScopeTreeUpToRow(this.$doc.getLength()-1);return this.$scopes.findFunctionDefinitionFromUsage(a,b)};this.getIndentForOpenBrace=function(a){if(this.$tokenizeUpToRow(a.row)){var b=this.getTokenCursor();if(b.seekToNearestToken(a,a.row)&&"{"==b.currentValue()&&
b.moveBackwardOverMatchingParens())return this.$getIndent(this.$getLine(b.currentPosition().row))}return this.$getIndent(this.$getLine(a.row))};this.getIndentForRow=function(a){return this.getNextLineIndent("start",this.$getLine(a),this.$session.getTabString(),a)};this.getNextLineIndent=function(a,e,f,h){if(b.endsWith(a,"qstring"))return this.$getIndent(e);"number"!==typeof h&&(h=this.$session.getSelection().getCursor().row-1);var m=this.$session.getTabSize();a=Array(m+1).join(" ");this.$lineOverrides=
null;this.$doc.getLine(h)!==e&&(this.$lineOverrides={},this.$lineOverrides[h]=e,this.$invalidateRow(h));try{var p=0>h?"":this.$getIndent(this.$getLine(h));if(!this.$tokenizeUpToRow(h))return p;var q={row:h,column:this.$getLine(h).length},l=this.$findPreviousSignificantToken(q,h-10);e=this.$session.getLine(h);if(/\bfunction\s*\(\s*$/.test(e))return this.$getIndent(h)+f+f;p="";var n=!1;if(l&&D(l.token.type))p=f,n=!0;else if(l&&/\bparen\b/.test(l.token.type)&&/\)$/.test(l.token.value)){var v=this.$walkParensBalanced(l.row,
l.row-10,null,function(a,b,c){return 0===a.length});if(null!=v){var r=this.$findPreviousSignificantToken(v,0);if(r&&"keyword"===r.token.type&&/^(if|while|for|function)$/.test(r.token.value))return this.$getIndent(this.$getLine(r.row))+f}}else if(l&&"keyword"===l.token.type&&("repeat"===l.token.value||"else"===l.token.value))return this.$getIndent(this.$getLine(l.row))+f;var t=this.getTokenCursor();if(!t.moveToPosition(q))return"";do{var w=t.currentType();if("support.function.codebegin"===w||"support.function.codeend"===
w)return this.$getIndent(this.$doc.getLine(t.$row))+p;var x=t.currentValue();if(t.isAtStartOfNewExpression(!1)){if("{"===x||"["===x||"("===x)p+=f;return this.$getIndent(this.$doc.getLine(t.$row))+p}if("("===x&&t.isAtStartOfNewExpression(!0))return this.$getIndent(this.$doc.getLine(t.$row))+f;if(!t.bwdToMatchingToken()){if("{"===x)break;if(H(["[","("],x)){var y=t.currentPosition();q=null;c&&(q=this.$findNextSignificantToken({row:y.row,column:y.column+1},h));if(q){e=this.$getLine(q.row);var B=e.replace(/[^\s].*$/,
""),z=q.column-B.length,C=Math.floor(z/m);y=z-m*C;z="";for(e=0;e<C;e++)z+=f;for(f=0;f<y;f++)z+=" ";f=B+z;var I=f.replace("\t",a).length;for(e=q.row+1;e<=h;e++)if(/[^\s]/.test(this.$getLine(e))){var K=this.$endStates[e-1];if("qstring"!==K&&"qqstring"!==K){var F=this.$getLine(e).replace(/[^\s].*$/,"");var M=F.replace("\t",a).length;M<I&&(f=F,I=M)}}return u(t)?f:f+p}return this.getIndentForOpenBrace(y)+f+p}}}while(t.moveToPreviousToken());if(!t.moveToPosition(q))return"";do if(!t.bwdToMatchingToken()){if("{"===
t.currentValue())return this.getIndentForOpenBrace(t.currentPosition())+f+p;if(d(t.currentToken())){for(;d(t.currentToken())&&t.moveToPreviousToken()&&t.findStartOfEvaluationContext();){var A=t.cloneCursor();if(A.moveToPreviousToken()){if("else"===A.currentValue()||"repeat"===A.currentValue())return this.$getIndent(this.$doc.getLine(A.$row))+p+p;if(")"===A.currentValue()&&A.bwdToMatchingToken()&&A.moveToPreviousToken()&&k(A.currentValue())){e=this.$doc.getLine(A.$row);if(!n)for(;A.moveToPreviousToken()&&
")"===A.currentValue()&&A.bwdToMatchingToken()&&A.moveToPreviousToken()&&k(A.currentValue());)e=this.$doc.getLine(A.$row);return this.$getIndent(e)+p+p}}d(t.peekBwd().currentToken())&&t.moveToPreviousToken()}return this.$getIndent(this.$getLine(t.$row))+p}}while(t.moveToPreviousToken());if(n){I=0;t=this.getTokenCursor();t.moveToPosition(q);t.moveToPreviousToken();do{if(g(t.currentValue(),["if","else"])){p+=f;break}if(t.hasType("constant","identifier")){if(!t.moveToPreviousToken())break;if(g(t.currentValue(),
["if","else"])){p+=f;break}if(")"===t.currentValue()){if(!t.bwdToMatchingToken())break;if(!t.moveToPreviousToken())break;if(g(t.currentValue(),["if","else"])){p+=f;break}}if(!t.hasType("operator"))break}else if(!t.findStartOfEvaluationContext())break}while(t.moveToPreviousToken()&&20>I++)}var J=this.$findNextSignificantToken({row:0,column:0},h);return J?this.$getIndent(this.$getLine(J.row))+p:""+p}finally{this.$lineOverrides&&(this.$lineOverrides=null,this.$invalidateRow(h))}};this.getBraceIndent=
function(a){var b=this.getTokenCursor(),c={row:a,column:this.$getLine(a).length};if(!b.moveToPosition(c))return"";if(")"===b.currentValue()){if(b.bwdToMatchingToken()&&b.moveToPreviousToken()&&(c=b.currentValue(),g(c,["if","while","for","function"])))return this.$getIndent(this.$getLine(b.$row))}else if(g(b.currentValue(),["else","repeat"]))return this.$getIndent(this.$getLine(b.$row));return this.getIndentForRow(a)};this.getTokenForPos=function(a,b,c){this.$tokenizeUpToRow(a.row);if(this.$tokens.length<=
a.row)return null;for(var d=this.$tokens[a.row],e=0;e<d.length;e++){var f=d[e];if(b&&a.column==f.column)return f;if(a.column<=f.column)break;if(c&&a.column==f.column+f.value.length||a.column<f.column+f.value.length)return f}return null};this.$tokenizeUpToRow=function(a){a=Math.min(a,this.$endStates.length-1);for(var b=0,c=!0;b<=a;b++)if(!c||!this.$endStates[b]){c=!1;var d=0===b?"start":this.$endStates[b-1],e=this.$getLine(b);e=this.$tokenizer.getLineTokens(e,d,b);!this.$statePattern||this.$statePattern.test(e.state)||
this.$statePattern.test(d)?this.$tokens[b]=this.$filterWhitespaceAndComments(e.tokens):this.$tokens[b]=[];e.state===this.$endStates[b]?c=!0:this.$endStates[b]=e.state}c||b<this.$tokens.length&&this.$invalidateRow(b);return!0};this.$onDocChange=function(a){"insert"===a.action?this.$insertNewRows(a.start.row,a.end.row-a.start.row):this.$removeRows(a.start.row,a.end.row-a.start.row);this.$invalidateRow(a.start.row);this.$scopes.invalidateFrom(a.start)};this.$invalidateRow=function(a){this.$tokens[a]=
null;this.$endStates[a]=null};this.$insertNewRows=function(a,b){for(var c=[a,0],d=0;d<b;d++)c.push(null);this.$tokens.splice.apply(this.$tokens,c);this.$endStates.splice.apply(this.$endStates,c)};this.$removeRows=function(a,b){this.$tokens.splice(a,b);this.$endStates.splice(a,b)};this.$getIndent=function(a){return(a=/^([ \t]*)/.exec(a))?a[1]:""};this.$getLine=function(a){return this.$lineOverrides&&"undefined"!=typeof this.$lineOverrides[a]?this.$lineOverrides[a]:this.$doc.getLine(a)};this.$walkParens=
function(a,b,c){var d=/\bparen\b/;return a<b?function(){for(;a<=b;a++)for(var e=this.$tokens[a],f=0;f<e.length;f++)if(d.test(e[f].type)&&!c(e[f].value,{row:a,column:e[f].column}))return!1;return!0}.call(this):function(){a=Math.max(0,a);for(b=Math.max(0,b);a>=b;a--)for(var e=this.$tokens[a],f=e.length-1;0<=f;f--)if(d.test(e[f].type)&&!c(e[f].value,{row:a,column:e[f].column}))return!1;return!0}.call(this)};this.$walkParensBalanced=function(a,b,c,d){var e=[],f=null,g=this;this.$walkParens(a,b,function(a,
b){if(c&&c(e,a,b))return f=b,!1;if(/[\[({]/.test(a))if(e[e.length-1]===g.$complements[a])e.pop();else return!0;else e.push(a);return d&&d(e,a,b)?(f=b,!1):!0});return f};this.$findNextSignificantToken=function(a,b){if(0==this.$tokens.length)return null;b=Math.min(b,this.$tokens.length-1);for(var c=a.row,d=a.column;c<=b;c++){for(var e=this.$tokens[c],f=0;f<e.length;f++)if(e[f].column+e[f].value.length>d)return{token:e[f],row:c,column:Math.max(e[f].column,d),offset:f};d=0}return null};this.findNextSignificantToken=
function(a){return this.$findNextSignificantToken(a,this.$tokens.length-1)};this.$findPreviousSignificantToken=function(a,b){if(0===this.$tokens.length)return null;b=Math.max(0,b);for(var c=Math.min(a.row,this.$tokens.length-1);c>=b;c--){var d=this.$tokens[c];if(0!==d.length){if(c!=a.row)return{row:c,column:d[d.length-1].column,token:d[d.length-1],offset:d.length-1};for(var e=d.length-1;0<=e;e--)if(d[e].column<a.column)return{row:c,column:d[e].column,token:d[e],offset:e}}}};this.$filterWhitespaceAndComments=
function(a){a=a.filter(function(a){a=/\bcode(?:begin|end)\b/.test(a.type)?!1:/\bsectionhead\b/.test(a.type)?!1:/^\s*$/.test(a.value)||a.type.match(/\b(?:ace_virtual-)?comment\b/);return!a});for(var b=a.length-1;0<=b;b--)if(1<a[b].value.length&&/\bparen\b/.test(a[b].type)){var c=a[b];a.splice(b,1);for(var d=c.value.length-1;0<=d;d--){var e={type:c.type,value:c.value.charAt(d),column:c.column+d};a.splice(b,0,e)}}return a}}).call(a.prototype);n.RCodeModel=a;n.setVerticallyAlignFunctionArgs=function(a){c=
a};n.getVerticallyAlignFunctionArgs=function(){return c}});var $jscomp$templatelit$0=["(?:\\|_|[p{L}p{Nl}.][p{L}p{Nl}p{Mn}p{Mc}p{Nd}p{Pc}.]*)"];$jscomp$templatelit$0.raw=["(?:\\\\|_|[\\p{L}\\p{Nl}.][\\p{L}\\p{Nl}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}.]*)"];var $colorFunctionCalls=!1;
define("mode/r_highlight_rules",["require","exports","module"],function(a,n,l){function g(a){for(var b=Array(a.length),c=0;c<a.length;c++)b[c]={include:a[c]};return b}l=a("ace/lib/oop");var k=a("ace/lib/lang"),h=a("ace/mode/text_highlight_rules").TextHighlightRules,f=a("mode/rainbow_paren_highlight_rules").RainbowParenHighlightRules,e=a("mode/utils"),b=function(){this.$rules={start:[{token:"comment",regex:"@@",merge:!1},{token:"keyword",regex:"\\\\[a-zA-Z0-9]+",merge:!1},{token:["keyword","comment"],
regex:"(@(?:export|field|inheritParams|name|param|rdname|slot|template|useDynLib))(\\s+)(?=[a-zA-Z0-9._-])",merge:!1,next:"rdoc-highlight"},{token:"keyword",regex:"@(?!@)[^ ]*",merge:!1},{token:["paren.keyword.operator","comment"],regex:"(\\[)(=)",merge:!1,next:"markdown-link"},{token:"paren.keyword.operator",regex:"\\[",merge:!1,next:"markdown-link"},{token:["support.function","support.function","support.function"],regex:"(`+)(.*?[^`])(\\1)",merge:!1},{token:["comment","constant.language.boolean"],
regex:"(\\s+|^)(__.+?__)\\b",merge:!1},{token:["comment","constant.language.boolean"],regex:"(\\s+|^)(_(?=[^_])(?:(?:\\\\.)|(?:[^_\\\\]))*?_)\\b",merge:!1},{token:["constant.numeric"],regex:"([*][*].+?[*][*])",merge:!1},{token:["constant.numeric"],regex:"([*](?=[^*])(?:(?:\\\\.)|(?:[^*\\\\]))*?[*])",merge:!1},{token:"paren.keyword.operator",regex:"(?:[[({]|[\\])}])",merge:!1},{defaultToken:"comment"}],highlight:[{token:"identifier.support.function",regex:"[^ ,]+"},{token:"comment",regex:","},{token:"comment",
regex:"\\s*",next:"start"}],"markdown-link":[{token:"paren.keyword.operator",regex:"\\]",next:"start"},{token:["identifier.support.class","comment"],regex:"([a-zA-Z0-9_.]+)(:{1,3})"},{token:"support.function",regex:"`.*?`"},{token:"support.function",regex:"[^{}()[\\]]+"},{token:"paren.keyword.operator",regex:"(?:[[({]|[\\])}])"},{defaultToken:"comment"}]};this.normalizeRules()};l.inherits(b,h);var c=function(a,b,c){return[{type:"string",value:a},{type:"string.color",value:b,bg:c},{type:"string",value:a}]};
a=function(){var a=k.arrayToMap("\\ function if else in break next repeat for while".split(" ")),h=k.arrayToMap("return switch try tryCatch stop warning require library attach detach source setMethod setGeneric setGroupGeneric setClass setRefClass R6Class UseMethod NextMethod".split(" ")),q=k.arrayToMap("NULL NA TRUE FALSE T F Inf NaN NA_integer_ NA_real_ NA_character_ NA_complex_".split(" ")),p=new Map([["white","ffffff"],["aliceblue","f0f8ff"],["antiquewhite","faebd7"],["antiquewhite1","ffefdb"],
["antiquewhite2","eedfcc"],["antiquewhite3","cdc0b0"],["antiquewhite4","8b8378"],["aquamarine","7fffd4"],["aquamarine1","7fffd4"],["aquamarine2","76eec6"],["aquamarine3","66cdaa"],["aquamarine4","458b74"],["azure","f0ffff"],["azure1","f0ffff"],["azure2","e0eeee"],["azure3","c1cdcd"],["azure4","838b8b"],["beige","f5f5dc"],["bisque","ffe4c4"],["bisque1","ffe4c4"],["bisque2","eed5b7"],["bisque3","cdb79e"],["bisque4","8b7d6b"],["black","000000"],["blanchedalmond","ffebcd"],["blue","0000ff"],["blue1",
"0000ff"],["blue2","0000ee"],["blue3","0000cd"],["blue4","00008b"],["blueviolet","8a2be2"],["brown","a52a2a"],["brown1","ff4040"],["brown2","ee3b3b"],["brown3","cd3333"],["brown4","8b2323"],["burlywood","deb887"],["burlywood1","ffd39b"],["burlywood2","eec591"],["burlywood3","cdaa7d"],["burlywood4","8b7355"],["cadetblue","5f9ea0"],["cadetblue1","98f5ff"],["cadetblue2","8ee5ee"],["cadetblue3","7ac5cd"],["cadetblue4","53868b"],["chartreuse","7fff00"],["chartreuse1","7fff00"],["chartreuse2","76ee00"],
["chartreuse3","66cd00"],["chartreuse4","458b00"],["chocolate","d2691e"],["chocolate1","ff7f24"],["chocolate2","ee7621"],["chocolate3","cd661d"],["chocolate4","8b4513"],["coral","ff7f50"],["coral1","ff7256"],["coral2","ee6a50"],["coral3","cd5b45"],["coral4","8b3e2f"],["cornflowerblue","6495ed"],["cornsilk","fff8dc"],["cornsilk1","fff8dc"],["cornsilk2","eee8cd"],["cornsilk3","cdc8b1"],["cornsilk4","8b8878"],["cyan","00ffff"],["cyan1","00ffff"],["cyan2","00eeee"],["cyan3","00cdcd"],["cyan4","008b8b"],
["darkblue","00008b"],["darkcyan","008b8b"],["darkgoldenrod","b8860b"],["darkgoldenrod1","ffb90f"],["darkgoldenrod2","eead0e"],["darkgoldenrod3","cd950c"],["darkgoldenrod4","8b6508"],["darkgray","a9a9a9"],["darkgreen","006400"],["darkgrey","a9a9a9"],["darkkhaki","bdb76b"],["darkmagenta","8b008b"],["darkolivegreen","556b2f"],["darkolivegreen1","caff70"],["darkolivegreen2","bcee68"],["darkolivegreen3","a2cd5a"],["darkolivegreen4","6e8b3d"],["darkorange","ff8c00"],["darkorange1","ff7f00"],["darkorange2",
"ee7600"],["darkorange3","cd6600"],["darkorange4","8b4500"],["darkorchid","9932cc"],["darkorchid1","bf3eff"],["darkorchid2","b23aee"],["darkorchid3","9a32cd"],["darkorchid4","68228b"],["darkred","8b0000"],["darksalmon","e9967a"],["darkseagreen","8fbc8f"],["darkseagreen1","c1ffc1"],["darkseagreen2","b4eeb4"],["darkseagreen3","9bcd9b"],["darkseagreen4","698b69"],["darkslateblue","483d8b"],["darkslategray","2f4f4f"],["darkslategray1","97ffff"],["darkslategray2","8deeee"],["darkslategray3","79cdcd"],
["darkslategray4","528b8b"],["darkslategrey","2f4f4f"],["darkturquoise","00ced1"],["darkviolet","9400d3"],["deeppink","ff1493"],["deeppink1","ff1493"],["deeppink2","ee1289"],["deeppink3","cd1076"],["deeppink4","8b0a50"],["deepskyblue","00bfff"],["deepskyblue1","00bfff"],["deepskyblue2","00b2ee"],["deepskyblue3","009acd"],["deepskyblue4","00688b"],["dimgray","696969"],["dimgrey","696969"],["dodgerblue","1e90ff"],["dodgerblue1","1e90ff"],["dodgerblue2","1c86ee"],["dodgerblue3","1874cd"],["dodgerblue4",
"104e8b"],["firebrick","b22222"],["firebrick1","ff3030"],["firebrick2","ee2c2c"],["firebrick3","cd2626"],["firebrick4","8b1a1a"],["floralwhite","fffaf0"],["forestgreen","228b22"],["gainsboro","dcdcdc"],["ghostwhite","f8f8ff"],["gold","ffd700"],["gold1","ffd700"],["gold2","eec900"],["gold3","cdad00"],["gold4","8b7500"],["goldenrod","daa520"],["goldenrod1","ffc125"],["goldenrod2","eeb422"],["goldenrod3","cd9b1d"],["goldenrod4","8b6914"],["gray","bebebe"],["gray0","000000"],["gray1","030303"],["gray2",
"050505"],["gray3","080808"],["gray4","0a0a0a"],["gray5","0d0d0d"],["gray6","0f0f0f"],["gray7","121212"],["gray8","141414"],["gray9","171717"],["gray10","1a1a1a"],["gray11","1c1c1c"],["gray12","1f1f1f"],["gray13","212121"],["gray14","242424"],["gray15","262626"],["gray16","292929"],["gray17","2b2b2b"],["gray18","2e2e2e"],["gray19","303030"],["gray20","333333"],["gray21","363636"],["gray22","383838"],["gray23","3b3b3b"],["gray24","3d3d3d"],["gray25","404040"],["gray26","424242"],["gray27","454545"],
["gray28","474747"],["gray29","4a4a4a"],["gray30","4d4d4d"],["gray31","4f4f4f"],["gray32","525252"],["gray33","545454"],["gray34","575757"],["gray35","595959"],["gray36","5c5c5c"],["gray37","5e5e5e"],["gray38","616161"],["gray39","636363"],["gray40","666666"],["gray41","696969"],["gray42","6b6b6b"],["gray43","6e6e6e"],["gray44","707070"],["gray45","737373"],["gray46","757575"],["gray47","787878"],["gray48","7a7a7a"],["gray49","7d7d7d"],["gray50","7f7f7f"],["gray51","828282"],["gray52","858585"],["gray53",
"878787"],["gray54","8a8a8a"],["gray55","8c8c8c"],["gray56","8f8f8f"],["gray57","919191"],["gray58","949494"],["gray59","969696"],["gray60","999999"],["gray61","9c9c9c"],["gray62","9e9e9e"],["gray63","a1a1a1"],["gray64","a3a3a3"],["gray65","a6a6a6"],["gray66","a8a8a8"],["gray67","ababab"],["gray68","adadad"],["gray69","b0b0b0"],["gray70","b3b3b3"],["gray71","b5b5b5"],["gray72","b8b8b8"],["gray73","bababa"],["gray74","bdbdbd"],["gray75","bfbfbf"],["gray76","c2c2c2"],["gray77","c4c4c4"],["gray78","c7c7c7"],
["gray79","c9c9c9"],["gray80","cccccc"],["gray81","cfcfcf"],["gray82","d1d1d1"],["gray83","d4d4d4"],["gray84","d6d6d6"],["gray85","d9d9d9"],["gray86","dbdbdb"],["gray87","dedede"],["gray88","e0e0e0"],["gray89","e3e3e3"],["gray90","e5e5e5"],["gray91","e8e8e8"],["gray92","ebebeb"],["gray93","ededed"],["gray94","f0f0f0"],["gray95","f2f2f2"],["gray96","f5f5f5"],["gray97","f7f7f7"],["gray98","fafafa"],["gray99","fcfcfc"],["gray100","ffffff"],["green","00ff00"],["green1","00ff00"],["green2","00ee00"],["green3",
"00cd00"],["green4","008b00"],["greenyellow","adff2f"],["grey","bebebe"],["grey0","000000"],["grey1","030303"],["grey2","050505"],["grey3","080808"],["grey4","0a0a0a"],["grey5","0d0d0d"],["grey6","0f0f0f"],["grey7","121212"],["grey8","141414"],["grey9","171717"],["grey10","1a1a1a"],["grey11","1c1c1c"],["grey12","1f1f1f"],["grey13","212121"],["grey14","242424"],["grey15","262626"],["grey16","292929"],["grey17","2b2b2b"],["grey18","2e2e2e"],["grey19","303030"],["grey20","333333"],["grey21","363636"],
["grey22","383838"],["grey23","3b3b3b"],["grey24","3d3d3d"],["grey25","404040"],["grey26","424242"],["grey27","454545"],["grey28","474747"],["grey29","4a4a4a"],["grey30","4d4d4d"],["grey31","4f4f4f"],["grey32","525252"],["grey33","545454"],["grey34","575757"],["grey35","595959"],["grey36","5c5c5c"],["grey37","5e5e5e"],["grey38","616161"],["grey39","636363"],["grey40","666666"],["grey41","696969"],["grey42","6b6b6b"],["grey43","6e6e6e"],["grey44","707070"],["grey45","737373"],["grey46","757575"],["grey47",
"787878"],["grey48","7a7a7a"],["grey49","7d7d7d"],["grey50","7f7f7f"],["grey51","828282"],["grey52","858585"],["grey53","878787"],["grey54","8a8a8a"],["grey55","8c8c8c"],["grey56","8f8f8f"],["grey57","919191"],["grey58","949494"],["grey59","969696"],["grey60","999999"],["grey61","9c9c9c"],["grey62","9e9e9e"],["grey63","a1a1a1"],["grey64","a3a3a3"],["grey65","a6a6a6"],["grey66","a8a8a8"],["grey67","ababab"],["grey68","adadad"],["grey69","b0b0b0"],["grey70","b3b3b3"],["grey71","b5b5b5"],["grey72","b8b8b8"],
["grey73","bababa"],["grey74","bdbdbd"],["grey75","bfbfbf"],["grey76","c2c2c2"],["grey77","c4c4c4"],["grey78","c7c7c7"],["grey79","c9c9c9"],["grey80","cccccc"],["grey81","cfcfcf"],["grey82","d1d1d1"],["grey83","d4d4d4"],["grey84","d6d6d6"],["grey85","d9d9d9"],["grey86","dbdbdb"],["grey87","dedede"],["grey88","e0e0e0"],["grey89","e3e3e3"],["grey90","e5e5e5"],["grey91","e8e8e8"],["grey92","ebebeb"],["grey93","ededed"],["grey94","f0f0f0"],["grey95","f2f2f2"],["grey96","f5f5f5"],["grey97","f7f7f7"],["grey98",
"fafafa"],["grey99","fcfcfc"],["grey100","ffffff"],["honeydew","f0fff0"],["honeydew1","f0fff0"],["honeydew2","e0eee0"],["honeydew3","c1cdc1"],["honeydew4","838b83"],["hotpink","ff69b4"],["hotpink1","ff6eb4"],["hotpink2","ee6aa7"],["hotpink3","cd6090"],["hotpink4","8b3a62"],["indianred","cd5c5c"],["indianred1","ff6a6a"],["indianred2","ee6363"],["indianred3","cd5555"],["indianred4","8b3a3a"],["ivory","fffff0"],["ivory1","fffff0"],["ivory2","eeeee0"],["ivory3","cdcdc1"],["ivory4","8b8b83"],["khaki",
"f0e68c"],["khaki1","fff68f"],["khaki2","eee685"],["khaki3","cdc673"],["khaki4","8b864e"],["lavender","e6e6fa"],["lavenderblush","fff0f5"],["lavenderblush1","fff0f5"],["lavenderblush2","eee0e5"],["lavenderblush3","cdc1c5"],["lavenderblush4","8b8386"],["lawngreen","7cfc00"],["lemonchiffon","fffacd"],["lemonchiffon1","fffacd"],["lemonchiffon2","eee9bf"],["lemonchiffon3","cdc9a5"],["lemonchiffon4","8b8970"],["lightblue","add8e6"],["lightblue1","bfefff"],["lightblue2","b2dfee"],["lightblue3","9ac0cd"],
["lightblue4","68838b"],["lightcoral","f08080"],["lightcyan","e0ffff"],["lightcyan1","e0ffff"],["lightcyan2","d1eeee"],["lightcyan3","b4cdcd"],["lightcyan4","7a8b8b"],["lightgoldenrod","eedd82"],["lightgoldenrod1","ffec8b"],["lightgoldenrod2","eedc82"],["lightgoldenrod3","cdbe70"],["lightgoldenrod4","8b814c"],["lightgoldenrodyellow","fafad2"],["lightgray","d3d3d3"],["lightgreen","90ee90"],["lightgrey","d3d3d3"],["lightpink","ffb6c1"],["lightpink1","ffaeb9"],["lightpink2","eea2ad"],["lightpink3","cd8c95"],
["lightpink4","8b5f65"],["lightsalmon","ffa07a"],["lightsalmon1","ffa07a"],["lightsalmon2","ee9572"],["lightsalmon3","cd8162"],["lightsalmon4","8b5742"],["lightseagreen","20b2aa"],["lightskyblue","87cefa"],["lightskyblue1","b0e2ff"],["lightskyblue2","a4d3ee"],["lightskyblue3","8db6cd"],["lightskyblue4","607b8b"],["lightslateblue","8470ff"],["lightslategray","778899"],["lightslategrey","778899"],["lightsteelblue","b0c4de"],["lightsteelblue1","cae1ff"],["lightsteelblue2","bcd2ee"],["lightsteelblue3",
"a2b5cd"],["lightsteelblue4","6e7b8b"],["lightyellow","ffffe0"],["lightyellow1","ffffe0"],["lightyellow2","eeeed1"],["lightyellow3","cdcdb4"],["lightyellow4","8b8b7a"],["limegreen","32cd32"],["linen","faf0e6"],["magenta","ff00ff"],["magenta1","ff00ff"],["magenta2","ee00ee"],["magenta3","cd00cd"],["magenta4","8b008b"],["maroon","b03060"],["maroon1","ff34b3"],["maroon2","ee30a7"],["maroon3","cd2990"],["maroon4","8b1c62"],["mediumaquamarine","66cdaa"],["mediumblue","0000cd"],["mediumorchid","ba55d3"],
["mediumorchid1","e066ff"],["mediumorchid2","d15fee"],["mediumorchid3","b452cd"],["mediumorchid4","7a378b"],["mediumpurple","9370db"],["mediumpurple1","ab82ff"],["mediumpurple2","9f79ee"],["mediumpurple3","8968cd"],["mediumpurple4","5d478b"],["mediumseagreen","3cb371"],["mediumslateblue","7b68ee"],["mediumspringgreen","00fa9a"],["mediumturquoise","48d1cc"],["mediumvioletred","c71585"],["midnightblue","191970"],["mintcream","f5fffa"],["mistyrose","ffe4e1"],["mistyrose1","ffe4e1"],["mistyrose2","eed5d2"],
["mistyrose3","cdb7b5"],["mistyrose4","8b7d7b"],["moccasin","ffe4b5"],["navajowhite","ffdead"],["navajowhite1","ffdead"],["navajowhite2","eecfa1"],["navajowhite3","cdb38b"],["navajowhite4","8b795e"],["navy","000080"],["navyblue","000080"],["oldlace","fdf5e6"],["olivedrab","6b8e23"],["olivedrab1","c0ff3e"],["olivedrab2","b3ee3a"],["olivedrab3","9acd32"],["olivedrab4","698b22"],["orange","ffa500"],["orange1","ffa500"],["orange2","ee9a00"],["orange3","cd8500"],["orange4","8b5a00"],["orangered","ff4500"],
["orangered1","ff4500"],["orangered2","ee4000"],["orangered3","cd3700"],["orangered4","8b2500"],["orchid","da70d6"],["orchid1","ff83fa"],["orchid2","ee7ae9"],["orchid3","cd69c9"],["orchid4","8b4789"],["palegoldenrod","eee8aa"],["palegreen","98fb98"],["palegreen1","9aff9a"],["palegreen2","90ee90"],["palegreen3","7ccd7c"],["palegreen4","548b54"],["paleturquoise","afeeee"],["paleturquoise1","bbffff"],["paleturquoise2","aeeeee"],["paleturquoise3","96cdcd"],["paleturquoise4","668b8b"],["palevioletred",
"db7093"],["palevioletred1","ff82ab"],["palevioletred2","ee799f"],["palevioletred3","cd6889"],["palevioletred4","8b475d"],["papayawhip","ffefd5"],["peachpuff","ffdab9"],["peachpuff1","ffdab9"],["peachpuff2","eecbad"],["peachpuff3","cdaf95"],["peachpuff4","8b7765"],["peru","cd853f"],["pink","ffc0cb"],["pink1","ffb5c5"],["pink2","eea9b8"],["pink3","cd919e"],["pink4","8b636c"],["plum","dda0dd"],["plum1","ffbbff"],["plum2","eeaeee"],["plum3","cd96cd"],["plum4","8b668b"],["powderblue","b0e0e6"],["purple",
"a020f0"],["purple1","9b30ff"],["purple2","912cee"],["purple3","7d26cd"],["purple4","551a8b"],["red","ff0000"],["red1","ff0000"],["red2","ee0000"],["red3","cd0000"],["red4","8b0000"],["rosybrown","bc8f8f"],["rosybrown1","ffc1c1"],["rosybrown2","eeb4b4"],["rosybrown3","cd9b9b"],["rosybrown4","8b6969"],["royalblue","4169e1"],["royalblue1","4876ff"],["royalblue2","436eee"],["royalblue3","3a5fcd"],["royalblue4","27408b"],["saddlebrown","8b4513"],["salmon","fa8072"],["salmon1","ff8c69"],["salmon2","ee8262"],
["salmon3","cd7054"],["salmon4","8b4c39"],["sandybrown","f4a460"],["seagreen","2e8b57"],["seagreen1","54ff9f"],["seagreen2","4eee94"],["seagreen3","43cd80"],["seagreen4","2e8b57"],["seashell","fff5ee"],["seashell1","fff5ee"],["seashell2","eee5de"],["seashell3","cdc5bf"],["seashell4","8b8682"],["sienna","a0522d"],["sienna1","ff8247"],["sienna2","ee7942"],["sienna3","cd6839"],["sienna4","8b4726"],["skyblue","87ceeb"],["skyblue1","87ceff"],["skyblue2","7ec0ee"],["skyblue3","6ca6cd"],["skyblue4","4a708b"],
["slateblue","6a5acd"],["slateblue1","836fff"],["slateblue2","7a67ee"],["slateblue3","6959cd"],["slateblue4","473c8b"],["slategray","708090"],["slategray1","c6e2ff"],["slategray2","b9d3ee"],["slategray3","9fb6cd"],["slategray4","6c7b8b"],["slategrey","708090"],["snow","fffafa"],["snow1","fffafa"],["snow2","eee9e9"],["snow3","cdc9c9"],["snow4","8b8989"],["springgreen","00ff7f"],["springgreen1","00ff7f"],["springgreen2","00ee76"],["springgreen3","00cd66"],["springgreen4","008b45"],["steelblue","4682b4"],
["steelblue1","63b8ff"],["steelblue2","5cacee"],["steelblue3","4f94cd"],["steelblue4","36648b"],["tan","d2b48c"],["tan1","ffa54f"],["tan2","ee9a49"],["tan3","cd853f"],["tan4","8b5a2b"],["thistle","d8bfd8"],["thistle1","ffe1ff"],["thistle2","eed2ee"],["thistle3","cdb5cd"],["thistle4","8b7b8b"],["tomato","ff6347"],["tomato1","ff6347"],["tomato2","ee5c42"],["tomato3","cd4f39"],["tomato4","8b3626"],["turquoise","40e0d0"],["turquoise1","00f5ff"],["turquoise2","00e5ee"],["turquoise3","00c5cd"],["turquoise4",
"00868b"],["violet","ee82ee"],["violetred","d02090"],["violetred1","ff3e96"],["violetred2","ee3a8c"],["violetred3","cd3278"],["violetred4","8b2252"],["wheat","f5deb3"],["wheat1","ffe7ba"],["wheat2","eed8ae"],["wheat3","cdba96"],["wheat4","8b7e66"],["whitesmoke","f5f5f5"],["yellow","ffff00"],["yellow1","ffff00"],["yellow2","eeee00"],["yellow3","cdcd00"],["yellow4","8b8b00"],["yellowgreen","9acd32"]]),m=String.raw($jscomp$templatelit$0),l={"{":"}","[":"]","(":")"},n={"#comment":[{token:"comment.sectionhead",
regex:"#+(?!').*(?:----|====|####)\\s*$",next:"start"},{token:"comment.doc.tag",regex:"#\\s*[|].*$",next:"start"},{token:["comment","comment.keyword.operator"],regex:"(#+['*]\\s*)(TODO|FIXME)\\b",next:"rdoc-start"},{token:"comment",regex:"#+['*]",next:"rdoc-start"},{token:["comment","comment.keyword.operator","comment"],regex:"(#+\\s*)(TODO|FIXME)\\b(.*)$",next:"start"},{token:"comment",regex:"#.*$",next:"start"}],"#string":[{token:"string",regex:"[rR]['\"][-]*[[({]",next:"rawstring",onMatch:function(a,
b,c,d){c=c||[];c[0]=b;c[1]=this.next;c[2]=l[a[a.length-1]]+a.substring(2,a.length-1)+a[1];return this.token}},{token:"string",regex:"([\"'])(#[0-9a-fA-F]{6})([0-9a-fA-F]{2})?(\\1)",next:"start",onMatch:function(a,b,d,e){b=a.substring(0,1);a=a.substring(1,a.length-1);return c(b,a,a)}},{token:"string",regex:"([\"'])(#[0-9a-fA-F]{3})(\\1)",next:"start",onMatch:function(a,b,d,e){b=a.substring(0,1);a=a.substring(1,a.length-1);return c(b,a,a)}},{token:"string",regex:"([\"'])([a-z]+[0-9]*)(\\1)",next:"start",
onMatch:function(a,b,d,e){b=a.substring(0,1);a=a.substring(1,a.length-1);d=p.get(a);return void 0===d?this.token:c(b,a,"#"+d)}},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]',next:"start"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",next:"start"},{token:"string",merge:!0,regex:'["]',next:"qqstring"},{token:"string",merge:!0,regex:"[']",next:"qstring"}],"#number":[{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+[Li]?",merge:!1,next:"start"},{token:"constant.numeric",regex:"(?:(?:\\d+(?:\\.\\d*)?)|(?:\\.\\d+))(?:[eE][+-]?\\d*)?[iL]?",
merge:!1,next:"start"}],"#quoted-identifier":[{token:"identifier",regex:"[`](?:(?:\\\\.)|(?:[^`\\\\]))*?[`]",merge:!1,next:"start"}]};n["#keyword-or-identifier"]=[{token:function(b){return q.hasOwnProperty(b)?"constant.language":a.hasOwnProperty(b)?"keyword":b.match(/^\.\.\d+$/)?"variable.language":"identifier"},regex:m,unicode:!0,merge:!1,next:"start"}];n["#package-access"]=[{token:function(a){return $colorFunctionCalls?"identifier.support.class":"identifier"},regex:m+"(?=\\s*::)",unicode:!0,merge:!1,
next:"start"}];n["#function-call"]=[{token:function(a){return $colorFunctionCalls?"identifier.support.function":"identifier"},regex:m+"(?=\\s*\\()",unicode:!0,merge:!1,next:"start"}];n["#function-call-or-keyword"]=[{token:function(b){return h.hasOwnProperty(b)||a.hasOwnProperty(b)?"keyword":$colorFunctionCalls?"identifier.support.function":"identifier"},regex:m+"(?=\\s*\\()",unicode:!0,merge:!1,next:"start"}];n["#operator"]=[{token:"keyword.operator",regex:"\\$|@",merge:!1,next:"afterDollar"},{token:"keyword.operator",
regex:":::|::|:=|\\|>|=>|%%|>=|<=|==|!=|<<-|->>|->|<-|\\|\\||&&|=|\\+|-|\\*\\*?|/|\\^|>|<|!|&|\\||~|\\$|:|@|\\?",merge:!1,next:"start"},{token:"keyword.operator.infix",regex:"%.*?%",merge:!1,next:"start"},f.getParenRule(),{token:function(a){return $colorFunctionCalls?"punctuation.keyword.operator":"punctuation"},regex:"[;]",merge:!1,next:"start"},{token:function(a){return $colorFunctionCalls?"punctuation.keyword.operator":"punctuation"},regex:"[,]",merge:!1,next:"start"}];n["#knitr-embed"]=[{token:"constant.language",
regex:"^[<][<][^>]+[>][>]$",merge:!1}];n["#text"]=[{token:"text",regex:"\\s+"}];n.start=g("#comment #string #number #package-access #quoted-identifier #function-call-or-keyword #keyword-or-identifier #knitr-embed #operator #text".split(" "));n.afterDollar=g("#comment #string #number #quoted-identifier #function-call #keyword-or-identifier #operator #text".split(" "));n.rawstring=[{token:"string",regex:"[\\]})][-]*['\"]",onMatch:function(a,b,c,d){this.next=a===c[2]?c[0]:c[1];return this.token}},{defaultToken:"string"}];
n.qqstring=[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+",merge:!0}];n.qstring=[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+",merge:!0}];this.$rules=n;m=(new b).getRules();for(var v in m){n=m[v];for(var y=0;y<n.length;y++)if(e.isArray(n[y].token))for(var C=0;C<n[y].token.length;C++)n[y].token[C]+=".virtual-comment";else n[y].token+=".virtual-comment"}this.embedRules(m,"rdoc-",[{token:"text",regex:"^",
next:"start"}]);this.normalizeRules()};l.inherits(a,h);n.RHighlightRules=a;n.setHighlightRFunctionCalls=function(a){$colorFunctionCalls=a}});define("mode/r_matching_brace_outdent",["require","exports","module"],function(a,n,l){var g=a("ace/range").Range;a=function(a){this.codeModel=a};(function(){this.checkOutdent=function(a,g,f){return/^\s+$/.test(g)&&/^\s*[\{\}\)\]]/.test(f)||/^\s*}\s*$/.test(g)&&"\n"==f||/}\s*$/.test(g)&&/\n/.test(f)?!0:!1};this.autoOutdent=function(a,h,f){if(0!==f){a=h.getLine(f);var e=a.match(/^(\s*[\}\)\]])/);if(e){e=e[1].length;var b=h.findMatchingBracket({row:f,column:e});if(!b||b.row==f)return 0;b=this.codeModel.getIndentForOpenBrace(b);
h.replace(new g(f,0,f,e-1),b)}if(e=a.match(/^(\s*\{)/))e=e[1].length,b=this.codeModel.getBraceIndent(f-1),h.replace(new g(f,0,f,e-1),b)}}}).call(a.prototype);n.RMatchingBraceOutdent=a});define("mode/r_scope_tree",["require","exports","module"],function(a,n,l){function g(a,f){return a.row!=f.row?a.row-f.row:a.column-f.column}var k=function(a,f,e,b,c){this.label=a;if((this.start=f)&&e&&(e.row>f.row||e.row===f.row&&e.column>f.column))throw Error("Malformed preamble: should lie before start position");this.preamble=e||f;this.end=null;this.scopeType=b;this.parentScope=null;this.attributes=c||{};this.$children=[]};k.TYPE_ROOT=1;k.TYPE_BRACE=2;k.TYPE_CHUNK=3;k.TYPE_SECTION=4;(function(){this.isRoot=
function(){return this.scopeType==k.TYPE_ROOT};this.isBrace=function(){return this.scopeType==k.TYPE_BRACE};this.isChunk=function(){return this.scopeType==k.TYPE_CHUNK};this.isSection=function(){return this.scopeType==k.TYPE_SECTION};this.isFunction=function(){return this.isBrace()&&!!this.attributes.args};this.isTest=function(){return this.isBrace()&&"test"===this.attributes.type};this.equals=function(a){return this.scopeType!==a.scopeType||this.start.row!==a.start.row||this.start.column!==a.start.column?
!1:!0};this.addNode=function(a){a.end&&window.alert("[ASSERTION FAILED] New node is already closed");0!=a.$children.length&&window.alert("[ASSERTION FAILED] New node already had children");if(!this.equals(a)){this.end=null;var f=this.$binarySearch(a.preamble);0<=f?this.$children[f].addNode(a):(f=-(f+1),f<this.$children.length&&(a.$children=this.$children.splice(f,this.$children.length-f)),a.parentScope=this,this.$children.push(a))}};this.closeScope=function(a,f){if(0==this.$children.length)return null;
var e=this.$children[this.$children.length-1];if(e.end)return null;var b=e.closeScope(a,f);return b?b:f==e.scopeType?(e.end=a,e.$forceDescendantsClosed(a),e):null};this.$forceDescendantsClosed=function(a){if(0!=this.$children.length){var f=this.$children[this.$children.length-1];f.end||(f.$forceDescendantsClosed(a),f.end=a)}};this.findNode=function(a){var f=this.$binarySearch(a);return 0<=f&&(a=this.$children[f].findNode(a))?(this.label&&a.unshift(this),a):this.label?[this]:null};this.$getFunctionStack=
function(a){var f=this.$binarySearch(a);a=0<=f?this.$children[f].$getFunctionStack(a):[];this.isFunction()&&a.push(this);return a};this.findFunctionDefinitionFromUsage=function(a,f){for(var e=this.$getFunctionStack(a),b=0;b<e.length;b++)for(var c=e[b],d=0;d<c.$children.length;d++)if(c.$children[d].label==f)return c.$children[d];return null};this.getFunctionsInScope=function(a){a=this.$getFunctionStack(a);for(var f=[],e=0;e<a.length;e++)f.push({name:a[e].attributes.name,args:a[e].attributes.args.slice()});
return f};this.invalidateFrom=function(a){var f=this.$binarySearch(a);0<=f?0>=g(a,this.$children[f].start)?a=this.$children[f].preamble:(a=this.$children[f].invalidateFrom(a),f++):f=-(f+1);f<this.$children.length&&this.$children.splice(f,this.$children.length-f);this.end=null;return a};this.$binarySearch=function(a,f,e){"undefined"===typeof f&&(f=0);"undefined"===typeof e&&(e=this.$children.length);if(f===e)return-(f+1);var b=Math.floor((f+e)/2),c=this.$children[b].comparePosition(a);return 0===c?
b:0>c?this.$binarySearch(a,f,b):this.$binarySearch(a,b+1,e)};this.comparePosition=function(a){return 0>g(a,this.preamble)?-1:null!=this.end&&0<=g(a,this.end)?1:0};this.printDebug=function(a){"undefined"===typeof a&&(a="");for(var f=0;f<this.$children.length;f++)this.$children[f].printDebug(a+"    ")}}).call(k.prototype);a=function(a){this.$ScopeNodeFactory=a||k;this.parsePos={row:0,column:0};this.$root=new this.$ScopeNodeFactory("(Top Level)",this.parsePos,null,k.TYPE_ROOT)};(function(){function a(e){count=
e.isChunk()?1:0;e=e.$children||[];for(var b=0;b<e.length;b++)count+=a(e[b]);return count}this.getParsePosition=function(){return this.parsePos};this.setParsePosition=function(a){this.parsePos=a};this.onSectionStart=function(a,b,c){"undefined"==typeof c&&(c={});var d=this.getActiveScopes(b);if(1<d.length){d=d[d.length-2].$children;for(var e=d.length-1;0<=e;e--)if(d[e].isSection()){this.$root.closeScope(b,k.TYPE_SECTION);break}}a=new this.$ScopeNodeFactory(a,b,b,k.TYPE_SECTION,c);this.$root.addNode(a)};
this.onSectionEnd=function(a){this.$root.closeScope(a,k.TYPE_SECTION)};this.closeMarkdownHeaderScopes=function(a,b,c){for(var d=a.$children,e=d.length-1;0<=e;e--){var f=d[e];if(f.isFunction()||f.isChunk())return;if(f.isSection()&&f.attributes.depth>=c)return this.$root.closeScope(b,k.TYPE_SECTION),f.attributes.depth===c||a.isRoot()||null==a?void 0:this.closeMarkdownHeaderScopes(a.parentScope,b,c)}a.isRoot()||null==a||this.closeMarkdownHeaderScopes(a.parentScope,b,c)};this.onMarkdownHead=function(a,
b,c,d,f){var e=this.getActiveScopes(b);1<e.length&&this.closeMarkdownHeaderScopes(e[e.length-2],b,d);this.$root.addNode(new this.$ScopeNodeFactory(a,c,b,k.TYPE_SECTION,{depth:d,isMarkdown:f}))};this.onChunkStart=function(a,b,c,d){this.$root.closeScope(c,k.TYPE_CHUNK);b=new this.$ScopeNodeFactory(b,d,c,k.TYPE_CHUNK);b.chunkLabel=a;this.$root.addNode(b);this.printScopeTree()};this.onChunkEnd=function(a){a=this.$root.closeScope(a,k.TYPE_CHUNK);this.printScopeTree();return a};this.onFunctionScopeStart=
function(a,b,c,d,f){this.$root.addNode(new this.$ScopeNodeFactory(a,c,b,k.TYPE_BRACE,{name:d,args:f,type:"function"}));this.printScopeTree()};this.onTestScopeStart=function(a,b,c){var d="test_that("+a+")";a=a.replace(/^['"](.*)['"]/,"$1");this.$root.addNode(new this.$ScopeNodeFactory(d,c,b,k.TYPE_BRACE,{name:a,type:"test"}));this.printScopeTree()};this.onNamedScopeStart=function(a,b){this.$root.addNode(new this.$ScopeNodeFactory(a,b,null,k.TYPE_BRACE))};this.onScopeStart=function(a){this.$root.addNode(new this.$ScopeNodeFactory(null,
a,null,k.TYPE_BRACE));this.printScopeTree()};this.onScopeEnd=function(a){a=this.$root.closeScope(a,k.TYPE_BRACE);this.printScopeTree();return a};this.getActiveScopes=function(a){return this.$root.findNode(a)};this.getScopeList=function(){return this.$root.$children};this.findFunctionDefinitionFromUsage=function(a,b){return this.$root.findFunctionDefinitionFromUsage(a,b)};this.getFunctionsInScope=function(a,b){return this.$root.getFunctionsInScope(a,b)};this.invalidateFrom=function(a){a={row:Math.max(0,
a.row-1),column:0};0<g(this.parsePos,a)&&(this.parsePos=this.$root.invalidateFrom(a));this.printScopeTree()};this.getChunkCount=function(e){return a(this.$root)};this.getTopLevelScopeCount=function(){return this.$root.$children.length};this.printScopeTree=function(){};this.getAllFunctionScopes=function(){var a=[];f(this.$root,a);return a};var f=function(a,b){a.isFunction()&&b.push(a);for(var c=a.$children,d=0;d<c.length;d++)f(c[d],b)}}).call(a.prototype);n.ScopeManager=a;n.ScopeNode=k});var $rainbowParentheses=!1,$numParenColors=7;
define("mode/rainbow_paren_highlight_rules",["require","exports","module"],function(a,n,l){a=function(){};n.RainbowParenHighlightRules=a;n.setRainbowParentheses=function(a){$rainbowParentheses=a};n.getRainbowParentheses=function(){return $rainbowParentheses};n.setNumParenColors=function(a){$numParenColors=a};a.getParenRule=function(){return{token:"paren.keyword.operator.nomatch",regex:"[[({})\\]]",merge:!1,onMatch:function(a,k,h){if(!$rainbowParentheses)return this.token="paren.keyword.operator.nomatch";
h=h||[];h[0]=k;h[15]=h[15]||0;switch(a){case "[":case "{":case "(":this.token="paren.paren_color_"+h[15]%$numParenColors;h[15]+=1;break;case "]":case "}":case ")":h[15]=Math.max(0,h[15]-1),this.token="paren.paren_color_"+h[15]%$numParenColors}return this.token},next:"start"}}});define("mode/rdoc",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("ace/tokenizer").Tokenizer,h=a("ace/mode/text_highlight_rules").TextHighlightRules,f=a("mode/rdoc_highlight_rules").RDocHighlightRules,e=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent;a=function(a){a?(this.$highlightRules=new h,this.$tokenizer=new k((new h).getRules())):(this.$highlightRules=new f,this.$tokenizer=new k((new f).getRules()));this.$outdent=new e};l.inherits(a,
g);(function(){this.getNextLineIndent=function(a,c,d){return this.$getIndent(c)}}).call(a.prototype);n.Mode=a});define("mode/rdoc_highlight_rules",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");a("ace/lib/lang");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(){var a="\\"+"name|alias|method|S3method|S4method|item|code|preformatted|kbd|pkg|var|env|option|command|author|email|url|source|cite|acronym|href|code|preformatted|link|eqn|deqn|keyword|usage|examples|dontrun|dontshow|figure|if|ifelse|Sexpr|RdOpts|inputencoding|usepackage".replace(/\|/g,"|\\");this.createKeywordMapper({keyword:a},
"identifer");this.$rules={start:[{token:"comment",regex:"%.*$"},{token:"text",regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:name|alias|method|S3method|S4method|item|code|preformatted|kbd|pkg|var|env|option|command|author|email|url|source|cite|acronym|href|code|preformatted|link|eqn|deqn|keyword|usage|examples|dontrun|dontshow|figure|if|ifelse|Sexpr|RdOpts|inputencoding|usepackage)\\b",next:"nospell"},{token:"keyword",regex:"\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])"},{token:"paren.keyword.operator",
regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],nospell:[{token:"comment",regex:"%.*$",next:"start"},{token:"nospell.text",regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:name|alias|method|S3method|S4method|item|code|preformatted|kbd|pkg|var|env|option|command|author|email|url|source|cite|acronym|href|code|preformatted|link|eqn|deqn|keyword|usage|examples|dontrun|dontshow|figure|if|ifelse|Sexpr|RdOpts|inputencoding|usepackage)\\b"},{token:"keyword",
regex:"\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])",next:"start"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])]"},{token:"paren.keyword.operator",regex:"}",next:"start"},{token:"nospell.text",regex:"\\s+"},{token:"nospell.text",regex:"\\w+"}]}};l.inherits(g,a);n.RDocHighlightRules=g});define("mode/rhtml",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("ace/mode/html").Mode,k=a("ace/tokenizer").Tokenizer,h=a("mode/rhtml_highlight_rules").RHtmlHighlightRules,f=a("mode/r_code_model").RCodeModel,e=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,b=a("mode/r_matching_brace_outdent").RMatchingBraceOutdent,c=a("mode/utils");a=function(a,c){this.$session=c;this.$tokenizer=new k((new h).getRules());this.codeModel=new f(c,this.$tokenizer,/^r-/,/^\x3c!--\s*begin.rcode\s*(.*)/,
/^\s*end.rcode\s*--\x3e/);this.$outdent=new e;this.$r_outdent=new b(this.codeModel);this.foldingRules=this.codeModel};l.inherits(a,g);(function(){this.insertChunkInfo={value:"\x3c!--begin.rcode\n\nend.rcode--\x3e\n",position:{row:0,column:15},content_position:{row:1,column:0}};this.checkOutdent=function(a,b,e){return"r"===c.activeMode(a,"html")?this.$r_outdent.checkOutdent(a,b,e):this.$outdent.checkOutdent(b,e)};this.autoOutdent=function(a,b,e){return"r"===c.activeMode(a,"html")?this.$r_outdent.autoOutdent(a,
b,e):this.$outdent.autoOutdent(b,e)};this.getLanguageMode=function(a){return c.getPrimaryState(this.$session,a.row).match(/^r-/)?"R":"HTML"};this.$getNextLineIndent=this.getNextLineIndent;this.getNextLineIndent=function(a,b,e,f){return"r"===c.activeMode(a,"html")?this.codeModel.getNextLineIndent(a,b,e,f):this.$getNextLineIndent(a,b,e)};this.$id="mode/rhtml"}).call(a.prototype);n.Mode=a});define("mode/rhtml_highlight_rules",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("mode/r_highlight_rules").RHighlightRules,k=a("ace/mode/html_highlight_rules").HtmlHighlightRules;a=a("ace/mode/text_highlight_rules").TextHighlightRules;var h=function(){this.$rules=(new k).getRules();this.$rules.start.unshift({token:"support.function.codebegin",regex:"^\x3c!--\\s*begin.rcode\\s*(?:.*)",next:"r-start"});var a=(new g).getRules();this.addRules(a,"r-");this.$rules["r-start"].unshift({token:"support.function.codeend",
regex:"^\\s*end.rcode\\s*--\x3e",next:"start"})};l.inherits(h,a);n.RHtmlHighlightRules=h});define("mode/rmarkdown",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("mode/markdown").Mode,k=a("ace/tokenizer").Tokenizer,h=a("mode/rmarkdown_highlight_rules").RMarkdownHighlightRules,f=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,e=a("mode/r_matching_brace_outdent").RMatchingBraceOutdent,b=a("mode/c_cpp_matching_brace_outdent").CppMatchingBraceOutdent,c=a("mode/r_code_model").RCodeModel,d=a("mode/cpp_code_model").CppCodeModel,u=a("mode/python").Mode,q=a("rstudio/folding/rmarkdown").FoldMode,
p=a("ace/mode/folding/cstyle").FoldMode;a("mode/auto_brace_insert");var m=a("mode/utils"),t=a("ace/unicode");a=function(a,g){var l=this;this.$session=g;this.$tokenizer=new k((new h).getRules());this.$outdent=new f;this.codeModel=new c(g,this.$tokenizer,/^r-/,new RegExp(h.prototype.$reChunkStartString),new RegExp(h.prototype.$reChunkEndString));this.$r_outdent=new e(this.codeModel);this.cpp_codeModel=new d(g,this.$tokenizer,/^r-cpp-/,new RegExp(h.prototype.$reCppChunkStartString),new RegExp(h.prototype.$reChunkEndString));
this.$cpp_outdent=new b(this.cpp_codeModel);this.$python=new u;var n=new q,t=new p;this.$tokenizer.getLineTokens=function(a,b,c){0===c&&(b="firstLine");return k.prototype.getLineTokens.call(this,a,b,c)};this.foldingRules={getFoldWidget:function(a,b,c){var d=l.getLanguageMode({row:c,column:0}),e=a.getLine(c);return"Markdown"===d||m.startsWith(e,"```")||0===c?n.getFoldWidget(a,b,c):"C_CPP"===d?t.getFoldWidget(a,b,c):l.codeModel.getFoldWidget(a,b,c)},getFoldWidgetRange:function(a,b,c){var d=l.getLanguageMode({row:c,
column:0}),e=a.getLine(c);return"Markdown"===d||m.startsWith(e,"```")||0===c?n.getFoldWidgetRange(a,b,c):"C_CPP"===d?t.getFoldWidgetRange(a,b,c):l.codeModel.getFoldWidgetRange(a,b,c)}}};l.inherits(a,g);(function(){function a(a){return m.activeMode(a,"markdown")}this.insertChunkInfo={value:"```{r}\n\n```\n",position:{row:0,column:5},content_position:{row:1,column:0}};this.getLanguageMode=function(b){b=m.getPrimaryState(this.$session,b.row);b=a(b);return"r"===b?"R":"r-cpp"===b?"C_CPP":"yaml"===b?"YAML":
"python"===b?"Python":"sql"==b?"SQL":"stan"===b?"Stan":"Markdown"};this.$getNextLineIndent=this.getNextLineIndent;this.getNextLineIndent=function(b,c,d,e,f){var g=a(b);return"r"===g?this.codeModel.getNextLineIndent(b,c,d,e):"r-cpp"===g?this.cpp_codeModel.getNextLineIndent(b,c,d,e,f):"yaml"===g?this.$getIndent(this.$session.getLine(e+1)):"python"===g?this.$python.getNextLineIndent(b,c,d,e):this.$getNextLineIndent(b,c,d)};this.checkOutdent=function(b,c,d){var e=a(b);return"r"===e?this.$r_outdent.checkOutdent(b,
c,d):"r-cpp"===e?this.$cpp_outdent.checkOutdent(b,c,d):"yaml"===e?!1:this.$outdent.checkOutdent(c,d)};this.autoOutdent=function(b,c,d){var e=a(b);if("r"===e)return this.$r_outdent.autoOutdent(b,c,d);if("r-cpp"===e)return this.$cpp_outdent.autoOutdent(b,c,d);if("yaml"!==e)return"python"===e?this.$python.autoOutdent(b,c,d):this.$outdent.autoOutdent(c,d)};this.getIndentForOpenBrace=function(b){var c=m.getPrimaryState(this.$session,b.row);if("r"===a(c))return this.codeModel.getIndentForOpenBrace(b);b=
this.$session.getLine(b.row1);return this.$getIndent(b)};this.transformAction=function(b,c,d,e,f){var g=a(b);return"markdown"===g?this.transformActionMarkdown(b,c,d,e,f):"r-cpp"===g?this.transformActionCpp(b,c,d,e,f):"yaml"===g?this.transformActionYaml(b,c,d,e,f):"python"===g?this.$python.transformAction(b,c,d,e,f):!1};this.transformActionMarkdown=function(a,b,c,d,e){if("insertion"===b)if("r"===e){if(a=c.getCursorPosition(),b=d.getLine(a.row),d=d.getTokenAt(a.row,a.column-1),null!==d&&-1===d.type.indexOf("support.function")&&
"`"===b[a.column-1])return{text:"r`",selection:[0,a.column+1,0,a.column+1]}}else if("`"===e&&(a=c.getCursorPosition(),b=d.getLine(a.row),d=d.getTokenAt(a.row,a.column+1),null!==d&&-1!==d.type.indexOf("support.function")&&"`"===b[a.column]))return{text:"",selection:[0,a.column+1,0,a.column+1]}};this.transformActionCpp=function(a,b,c,d,e){if("insertion"===b)if("\n"===e){if(a=c.getSelectionRange().start,(d=/^((\s*\/\/+')\s*)/.exec(d.doc.getLine(a.row)))&&c.getSelectionRange().start.column>=d[2].length)return{text:"\n"+
d[1]}}else if("R"===e&&(a=c.getSelectionRange().start,(d=/^(\s*\/\*{3,}\s*)/.exec(d.doc.getLine(a.row)))&&c.getSelectionRange().start.column>=d[1].length))return{text:"R\n\n*/\n",selection:[1,0,1,0]};return!1};this.transformActionYaml=function(a,b,c,d,e){return"insertion"===b&&"\n"===e?(a=c.getCursorPosition().row,a=d.getLine(a),d=this.$getIndent(a),/[:({[]$/.test(a)?(a=this.$session.getTabString(),{text:"\n"+d+a}):{text:"\n"+d}):!1};this.tokenRe=new RegExp("^["+t.wordChars+"._]+","g");this.nonTokenRe=
new RegExp("^(?:[^"+t.wordChars+"._]|\\s)+","g");this.allowAutoInsert=this.smartAllowAutoInsert;this.$id="mode/rmarkdown"}).call(a.prototype);n.Mode=a});define("rstudio/folding/rmarkdown",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("ace/mode/folding/fold_mode").FoldMode,k=a("ace/range").Range;n=n.FoldMode=function(){};var h=a("mode/utils");l.inherits(n,g);(function(){this.getFoldWidget=function(a,b,c){b="markbeginend"===b?"end":"";var d=a.getLine(c),e=a.getState(c);a=0<c?a.getState(c-1):"start";if(h.startsWith(d,"===")||h.startsWith(d,"---")||h.startsWith(d,"..."))return h.startsWith(a,"yaml")?b:"start";if("start"===
e&&h.startsWith(d,"#"))return"start";a=d.trim();return h.startsWith(a,"```")?"start"===e?b:"start":""};var a=function(a,b,c,d,f){b=0===c?1:"start"===b?-1:1;var e={row:c,column:0};1===b&&(e.column=a.getLine(c).length);c+=b;for(var g=0<b?a.getLength():0;c!==g;){var m=a.getLine(c).trim();if(h.startsWith(m,d))break;if(f&&h.startsWith(m,f))break;c+=b}d={row:c,column:0};-1===b&&(d.column=a.getLine(c).length);return 1===b?k.fromPoints(e,d):k.fromPoints(d,e)};this.$getFoldWidgetRange=function(e,b,c){var d=
e.getState(c);b=e.getLine(c);var f=b.trim();if(h.startsWith(b,"```"))return a(e,d,c,"```");var g=0<c?e.getState(c-1):"start";f=0===c&&"---"===f;g=h.startsWith(g,"yaml");if(f||g)return a(e,d,c,"---",f?"...":void 0);if("="===b[0])g=1;else if("-"===b[0])g=2;else{g=/^(#+)(?:.*)$/.exec(b);if(!g)return;g=g[1].length}if(null!==g){a:{f=e.getLength();for(var p=c+1;p<f;p++)if(e.getState(p)===d){var m=e.getLine(p);if(1===g&&/^[=]{3,}\s*/.test(m)){d=p-2;break a}if(2===g&&/^[-]{3,}\s*/.test(m)){d=p-2;break a}if((m=
/^(#+)(?:.*)$/.exec(m))&&m[1].length<=g){d=p-1;break a}}d=f}return new k(c,b.length,d,e.getLine(d).length)}};this.getFoldWidgetRange=function(a,b,c){a=this.$getFoldWidgetRange(a,b,c);if(null!=a&&a.start.row!==a.end.row)return a}}).call(n.prototype)});define("mode/rmarkdown_highlight_rules",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("mode/r_highlight_rules").RHighlightRules,k=a("mode/c_cpp_highlight_rules").c_cppHighlightRules,h=a("ace/mode/perl_highlight_rules").PerlHighlightRules,f=a("mode/python_highlight_rules").PythonHighlightRules,e=a("ace/mode/ruby_highlight_rules").RubyHighlightRules,b=a("mode/markdown_highlight_rules").MarkdownHighlightRules,c=a("ace/mode/text_highlight_rules").TextHighlightRules,d=a("mode/yaml_highlight_rules").YamlHighlightRules,
u=a("mode/sh_highlight_rules").ShHighlightRules,q=a("mode/stan_highlight_rules").StanHighlightRules,p=a("mode/sql_highlight_rules").SqlHighlightRules,m=a("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules,t=a("ace/mode/css_highlight_rules").CssHighlightRules,B=a("ace/mode/scss_highlight_rules").ScssHighlightRules,v=a("ace/mode/sass_highlight_rules").SassHighlightRules,y=a("ace/mode/less_highlight_rules").LessHighlightRules;c=a("ace/mode/text_highlight_rules").TextHighlightRules;var C=
a("mode/mermaid_highlight_rules").MermaidHighlightRules,w=a("ace/mode/dot_highlight_rules").DotHighlightRules,r=a("mode/utils");a=function(){this.$rules=(new b).getRules();this.$rules.firstLine=this.$rules.allowBlock.slice();r.embedRules(this,g,"r",this.$reChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);r.embedRules(this,k,"r-cpp",this.$reCppChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);r.embedRules(this,h,"perl",this.$rePerlChunkStartString,
this.$reChunkEndString,["start","listblock","allowBlock"]);r.embedRules(this,f,"python",this.$rePythonChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);r.embedRules(this,e,"ruby",this.$reRubyChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);r.embedRules(this,b,"markdown",this.$reMarkdownChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);r.embedRules(this,u,"sh",this.$reShChunkStartString,this.$reChunkEndString,["start","listblock",
"allowBlock"]);r.embedRules(this,q,"stan",this.$reStanChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);r.embedRules(this,p,"sql",this.$reSqlChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);r.embedRules(this,C,"mermaid",this.$reMermaidChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);r.embedRules(this,w,"dot",this.$reDotChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);r.embedRules(this,m,"js",
this.$reJavaScriptChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);r.embedRules(this,t,"css",this.$reCssChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);r.embedRules(this,B,"scss",this.$reScssChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);r.embedRules(this,v,"sass",this.$reSassChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);r.embedRules(this,y,"less",this.$reLessChunkStartString,this.$reChunkEndString,
["start","listblock","allowBlock"]);r.embedRules(this,c,"text",this.$reTextChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);r.embedRules(this,d,"yaml","^\\s*---\\s*$","^\\s*(?:---|\\.\\.\\.)\\s*$",["firstLine"]);this.$rules["yaml-start"].unshift({token:["string"],regex:/((?:January|February|March|April|May|June|July|August|September|October|November|December)\s+\d+(?:st|nd|rd|s|n|r)?(?:\s*(?:,)?(?:\s*\d+)?)?)/});this.$rules["yaml-start"].push({defaultToken:"text.nospell"});
this.normalizeRules()};l.inherits(a,c);(function(){function a(a){return"^(?:[ ]{4})?`{3,}\\s*\\{[Rr]\\b(?:.*)engine\\s*\\=\\s*['\"]"+a+"['\"](?:.*)\\}\\s*$|^(?:[ ]{4})?`{3,}\\s*\\{"+a+"\\b(?:.*)\\}\\s*$"}this.$reChunkStartString="^(?:[ ]{4})?`{3,}\\s*\\{\\w+\\b(.*)\\}\\s*$";this.$reChunkEndString="^(?:[ ]{4})?`{3,}\\s*$";this.$reCppChunkStartString=a("(?:[rR][cC]pp|[cC](?:pp)?)\\d*");this.$reMarkdownChunkStartString=a("block");this.$rePerlChunkStartString=a("perl");this.$rePythonChunkStartString=
a("python");this.$reMermaidChunkStartString=a("mermaid");this.$reDotChunkStartString=a("dot");this.$reRubyChunkStartString=a("ruby");this.$reShChunkStartString=a("(?:bash|sh)");this.$reStanChunkStartString=a("stan");this.$reSqlChunkStartString=a("sql");this.$reJavaScriptChunkStartString=a("(?:d3|js|ojs|observable)");this.$reCssChunkStartString=a("css");this.$reScssChunkStartString=a("scss");this.$reSassChunkStartString=a("sass");this.$reLessChunkStartString=a("less");this.$reTextChunkStartString=
a("(?:asis|text)")}).call(a.prototype);n.RMarkdownHighlightRules=a});define("mode/sh",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("mode/sh_highlight_rules").ShHighlightRules,h=a("ace/range").Range,f=a("ace/mode/folding/cstyle").FoldMode,e=a("ace/mode/behaviour/cstyle").CstyleBehaviour;a=function(){this.HighlightRules=k;this.foldingRules=new f;this.$behaviour=new e};l.inherits(a,g);(function(){this.lineCommentStart="#";this.getNextLineIndent=function(a,b,e){var c=this.$getIndent(b),d=this.getTokenizer().getLineTokens(b,
a).tokens;if(d.length&&"comment"==d[d.length-1].type)return c;"start"==a&&b.match(/^.*[\{\(\[:]\s*$/)&&(c+=e);return c};var a={pass:1,"return":1,raise:1,"break":1,"continue":1};this.checkOutdent=function(b,d,e){if("\r\n"!==e&&"\r"!==e&&"\n"!==e)return!1;b=this.getTokenizer().getLineTokens(d.trim(),b).tokens;if(!b)return!1;do d=b.pop();while(d&&("comment"==d.type||"text"==d.type&&d.value.match(/^\s+$/)));return d?"keyword"==d.type&&a[d.value]:!1};this.autoOutdent=function(a,b,e){e+=1;a=this.$getIndent(b.getLine(e));
var c=b.getTabString();a.slice(-c.length)==c&&b.remove(new h(e,a.length-c.length,e,a.length))};this.$id="mode/sh"}).call(a.prototype);n.Mode=a});define("mode/sh_highlight_rules",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=n.reservedKeywords="!|{|}|case|do|done|elif|else|esac|fi|for|if|in|then|until|while|&|;|export|local|read|typeset|unset|elif|select|set|function|declare|readonly",k=n.languageConstructs="[|]|alias|bg|bind|break|builtin|cd|command|compgen|complete|continue|dirs|disown|echo|enable|eval|exec|exit|fc|fg|getopts|hash|help|history|jobs|kill|let|logout|popd|printf|pushd|pwd|return|set|shift|shopt|source|suspend|test|times|trap|type|ulimit|umask|unalias|wait",
h=function(){this.$rules={start:[{token:"constant",regex:/\\./},{token:["text","comment"],regex:/(^|\s)(#.*)$/},{token:"string.start",regex:'"',push:[{token:"constant.language.escape",regex:/\\(?:[$`"\\]|$)/},{include:"variables"},{token:"keyword.operator",regex:/`/},{token:"string.end",regex:'"',next:"pop"},{defaultToken:"string"}]},{token:"string",regex:"\\$'",push:[{token:"constant.language.escape",regex:/\\(?:[abeEfnrtv\\'"]|x[a-fA-F\d]{1,2}|u[a-fA-F\d]{4}([a-fA-F\d]{4})?|c.|\d{1,3})/},{token:"string",
regex:"'",next:"pop"},{defaultToken:"string"}]},{regex:"<<<",token:"keyword.operator"},{stateName:"heredoc",regex:"(<<-?)(\\s*)(['\"`]?)([\\w\\-]+)(['\"`]?)",onMatch:function(a,e,b){var c=e.substring(0,e.length-5);c="-"===a[2]?c+"indentedHeredoc":c+"heredoc";a=a.split(this.splitRegex);b.push(c,a[4],e);return[{type:"constant",value:a[1]},{type:"text",value:a[2]},{type:"string",value:a[3]},{type:"support.class",value:a[4]},{type:"string",value:a[5]}]},rules:{heredoc:[{onMatch:function(a,e,b){if(a===
b[1])return this.next=b[2],b.splice(-3),"support.class";this.next="";return"string"},regex:".*$"}],indentedHeredoc:[{token:"string",regex:"^\t+"},{onMatch:function(a,e,b){if(a===b[1])return this.next=b[2],b.splice(-3),"support.class";this.next="";return"string"},regex:".*$"}]}},{regex:"$",token:"empty",next:function(a,e){return/heredoc$/i.test(e[0])?e[0]:a}},{token:["keyword","text","text","text","variable"],regex:/(declare|local|readonly)(\s+)(?:(-[fixar]+)(\s+))?([a-zA-Z_][a-zA-Z0-9_]*\b)/},{token:"variable.language",
regex:"(?:\\$(?:SHLVL|\\$|\\!|\\?))"},{token:"variable",regex:"(?:[a-zA-Z_][a-zA-Z0-9_]*(?==))"},{include:"variables"},{token:"support.function",regex:"(?:[a-zA-Z_][a-zA-Z0-9_]*\\s*\\(\\))"},{token:"support.function",regex:"(?:&(?:\\d+))"},{token:"string",start:"'",end:"'"},{token:"constant.numeric",regex:"(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+)))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))"},{token:"constant.numeric",regex:"(?:(?:[1-9]\\d*)|(?:0))\\b"},{token:this.createKeywordMapper({keyword:g,
"support.function.builtin":k,"invalid.deprecated":"debugger"},"identifier"),regex:"[a-zA-Z_][a-zA-Z0-9_]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!=|[%&|`]"},{token:"punctuation.operator",regex:";"},{token:"paren.lparen",regex:"[\\[\\(\\{]"},{token:"paren.rparen",regex:"[\\]]"},{token:"paren.rparen",regex:"[\\)\\}]",next:function(a,e){if(2>e.length)return a;e.shift();return e.shift()}}],variables:[{token:"variable",regex:/(\$)(\w+)/},{token:["variable","paren.lparen"],
regex:/(\$)(\()/,push:"start"},{token:["variable","paren.lparen","keyword.operator","variable","keyword.operator"],regex:/(\$)(\{)([#!]?)(\w+|[*@#?\-$!0_])(:[?+\-=]?|##?|%%?|,,?\/|\^\^?)?/,push:"start"},{token:"variable",regex:/\$[*@#?\-$!0_]/},{token:["variable","paren.lparen"],regex:/(\$)(\{)/,push:"start"}]};this.normalizeRules()};l.inherits(h,a);n.ShHighlightRules=h});define("mode/sql",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("mode/sql_highlight_rules").SqlHighlightRules;a("ace/range");a=function(){this.HighlightRules=k};l.inherits(a,g);a.prototype.lineCommentStart="--";a.prototype.$id="mode/sql";n.Mode=a});define("mode/sql_highlight_rules",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");a("ace/lib/lang");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(){this.$rules={start:[{token:"comment",regex:"--.*$"},{token:"comment",start:"/\\*",end:"\\*/"},{token:"comment",regex:"^#.*$"},{token:"comment.doc.tag",regex:"\\?[a-zA-Z_][a-zA-Z0-9_$]*"},{token:"paren.keyword.operator",merge:!1,regex:"[[({]",next:"start"},{token:"paren.keyword.operator",merge:!1,regex:"[\\])}]",
next:"start"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:this.createKeywordMapper({"support.function":"avg|count|first|last|max|min|sum|ucase|lcase|mid|len|round|rank|now|format|coalesce|ifnull|isnull|nvl",keyword:"select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|when|else|end|type|left|right|join|on|outer|desc|asc|union|create|table|primary|key|if|foreign|not|references|default|null|inner|cross|natural|database|drop|grant|into|values|between|like|in|alter|index|view|exists|full|distinct|top|truncate|all",
"constant.language":"true|false","storage.type":"int|numeric|decimal|date|varchar|char|bigint|float|double|bit|binary|text|set|timestamp|money|real|number|integer"},"identifier",!0),regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=|\\."},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]};this.normalizeRules()};l.inherits(g,a);n.SqlHighlightRules=g});define("mode/stan",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("ace/tokenizer").Tokenizer,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,f=a("mode/stan_highlight_rules").StanHighlightRules,e=a("ace/mode/folding/cstyle").FoldMode;a=function(){this.$highlightRules=new f;this.$tokenizer=new k(this.$highlightRules.getRules());this.$outdent=new h;this.foldingRules=new e};l.inherits(a,g);(function(){this.lineCommentStart=["//","#"];this.blockComment=
{start:"/*",end:"*/"};this.toggleCommentLines=function(a,c,d,e){var b=!0;a=/^(\s*)\/\//;for(var f=d;f<=e;f++)if(!a.test(c.getLine(f))){b=!1;break}if(b)for(b=new Range(0,0,0,0),f=d;f<=e;f++)d=c.getLine(f).match(a),b.start.row=f,b.end.row=f,b.end.column=d[0].length,c.replace(b,d[1]);else c.indentRows(d,e,"//")};this.getLanguageMode=function(a){return"Stan"};this.getNextLineIndent=function(a,c,d){var b=this.$getIndent(c),e=this.getTokenizer().getLineTokens(c,a).tokens;if(e.length&&"comment"==e[e.length-
1].type)return b;"start"==a&&c.match(/^.*(?:[\{\(\[])\s*$/)&&(b+=d);return b};this.checkOutdent=function(a,c,d){return this.$outdent.checkOutdent(c,d)};this.autoOutdent=function(a,c,d){this.$outdent.autoOutdent(c,d)};this.$id="mode/stan"}).call(a.prototype);n.Mode=a});define("mode/stan_highlight_rules",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");a("ace/lib/lang");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(){this.$rules={start:[{token:"comment.line.number-sign",regex:"\\/\\/.*$"},{token:"comment.line.double-dash",regex:"#.*$"},{token:"comment.block",regex:"\\/\\*",merge:!0,next:"comment"},{token:"keyword.other.block",regex:"\\b(functions|data|transformed\\s+data|parameters|transformed\\s+parameters|model|generated\\s+quantities)\\b"},
{token:"string.quoted.double",regex:'["][ a-zA-Z0-9~@#$%^&*_\'`\\-+={}[\\]()<>|/!?.,;:]*["]'},{token:"constant.numeric",regex:"(?:(?:\\d+(?:\\.\\d*)?)|(?:\\.\\d+))(?:[eE][+\\-]?\\d*)?\\b"},{token:"keyword.operator",regex:"\\bT(?=\\s*\\[)"},{token:["keyword.other","text","punctuation"],regex:"(lower|upper)(\\s*)(=)"},{token:["keyword.other","text","keyword.operator"],regex:"(target)(\\s*)(\\+=)"},{token:"keyword.control",regex:"\\b(for|in|while|if|then|else|return)\\b"},{token:"keyword.other",regex:"\\b(print|reject)\\b"},
{token:"storage.type",regex:"\\b(int|real|vector|simplex|unit_vector|ordered|positive_ordered|row_vector|matrix|cholesky_factor_cov|cholesky_factor_corr|corr_matrix|cov_matrix|void)\\b"},{token:"invalid.deprecated",regex:"\\b(bernoulli_ccdf_log|bernoulli_cdf_log|bernoulli_log|bernoulli_logit_log|beta_binomial_ccdf_log|beta_binomial_cdf_log|beta_binomial_log|beta_ccdf_log|beta_cdf_log|beta_log|binomial_ccdf_log|binomial_cdf_log|binomial_coefficient_log|binomial_log|binomial_logit_log|categorical_log|categorical_logit_log|cauchy_ccdf_log|cauchy_cdf_log|cauchy_log|chi_square_ccdf_log|chi_square_cdf_log|chi_square_log|dirichlet_log|double_exponential_ccdf_log|double_exponential_cdf_log|double_exponential_log|exp_mod_normal_ccdf_log|exp_mod_normal_cdf_log|exp_mod_normal_log|exponential_ccdf_log|exponential_cdf_log|exponential_log|frechet_ccdf_log|frechet_cdf_log|frechet_log|gamma_ccdf_log|gamma_cdf_log|gamma_log|gaussian_dlm_obs_log|get_lp|gumbel_ccdf_log|gumbel_cdf_log|gumbel_log|hypergeometric_log|increment_log_prob|integrate_ode|inv_chi_square_ccdf_log|inv_chi_square_cdf_log|inv_chi_square_log|inv_gamma_ccdf_log|inv_gamma_cdf_log|inv_gamma_log|inv_wishart_log|lkj_corr_cholesky_log|lkj_corr_log|logistic_ccdf_log|logistic_cdf_log|logistic_log|lognormal_ccdf_log|lognormal_cdf_log|lognormal_log|multi_gp_cholesky_log|multi_gp_log|multi_normal_cholesky_log|multi_normal_log|multi_normal_prec_log|multi_student_t_log|multinomial_log|multiply_log|neg_binomial_2_ccdf_log|neg_binomial_2_cdf_log|neg_binomial_2_log|neg_binomial_2_log_log|neg_binomial_ccdf_log|neg_binomial_cdf_log|neg_binomial_log|normal_ccdf_log|normal_cdf_log|normal_log|ordered_logistic_log|pareto_ccdf_log|pareto_cdf_log|pareto_log|pareto_type_2_ccdf_log|pareto_type_2_cdf_log|pareto_type_2_log|poisson_ccdf_log|poisson_cdf_log|poisson_log|poisson_log_log|rayleigh_ccdf_log|rayleigh_cdf_log|rayleigh_log|scaled_inv_chi_square_ccdf_log|scaled_inv_chi_square_cdf_log|scaled_inv_chi_square_log|skew_normal_ccdf_log|skew_normal_cdf_log|skew_normal_log|student_t_ccdf_log|student_t_cdf_log|student_t_log|uniform_ccdf_log|uniform_cdf_log|uniform_log|von_mises_log|weibull_ccdf_log|weibull_cdf_log|weibull_log|wiener_log|wishart_log)\\b"},
{token:["keyword.operator.sampling","text","support.function"],regex:"(~)(\\s*)(bernoulli|bernoulli_logit|beta|beta_binomial|binomial|binomial_logit|categorical|categorical_logit|cauchy|chi_square|dirichlet|double_exponential|exp_mod_normal|exponential|frechet|gamma|gaussian_dlm_obs|gumbel|hypergeometric|inv_chi_square|inv_gamma|inv_wishart|lkj_corr|lkj_corr_cholesky|logistic|lognormal|multi_gp|multi_gp_cholesky|multi_normal|multi_normal_cholesky|multi_normal_prec|multi_student_t|multinomial|neg_binomial|neg_binomial_2|neg_binomial_2_log|normal|ordered_logistic|pareto|pareto_type_2|poisson|poisson_log|rayleigh|scaled_inv_chi_square|skew_normal|student_t|uniform|von_mises|weibull|wiener|wishart)\\b"},
{token:"support.function",regex:"\\b(Phi|Phi_approx|abs|acos|acosh|append_col|append_row|asin|asinh|atan|atan2|atanh|bernoulli_cdf|bernoulli_lccdf|bernoulli_lcdf|bernoulli_logit_lpmf|bernoulli_lpmf|bernoulli_rng|bessel_first_kind|bessel_second_kind|beta_binomial_cdf|beta_binomial_lccdf|beta_binomial_lcdf|beta_binomial_lpmf|beta_binomial_rng|beta_cdf|beta_lccdf|beta_lcdf|beta_lpdf|beta_rng|binary_log_loss|binomial_cdf|binomial_lccdf|binomial_lcdf|binomial_logit_lpmf|binomial_lpmf|binomial_rng|block|categorical_logit_lpmf|categorical_lpmf|categorical_rng|cauchy_cdf|cauchy_lccdf|cauchy_lcdf|cauchy_lpdf|cauchy_rng|cbrt|ceil|chi_square_cdf|chi_square_lccdf|chi_square_lcdf|chi_square_lpdf|chi_square_rng|cholesky_decompose|col|cols|columns_dot_product|columns_dot_self|cos|cosh|cov_exp_quad|crossprod|csr_extract_u|csr_extract_v|csr_extract_w|csr_matrix_times_vector|csr_to_dense_matrix|cumulative_sum|determinant|diag_matrix|diag_post_multiply|diag_pre_multiply|diagonal|digamma|dims|dirichlet_lpdf|dirichlet_rng|distance|dot_product|dot_self|double_exponential_cdf|double_exponential_lccdf|double_exponential_lcdf|double_exponential_lpdf|double_exponential_rng|e|eigenvalues_sym|eigenvectors_sym|erf|erfc|exp|exp2|exp_mod_normal_cdf|exp_mod_normal_lccdf|exp_mod_normal_lcdf|exp_mod_normal_lpdf|exp_mod_normal_rng|expm1|exponential_cdf|exponential_lccdf|exponential_lcdf|exponential_lpdf|exponential_rng|fabs|falling_factorial|fdim|floor|fma|fmax|fmin|fmod|frechet_cdf|frechet_lccdf|frechet_lcdf|frechet_lpdf|frechet_rng|gamma_cdf|gamma_lccdf|gamma_lcdf|gamma_lpdf|gamma_p|gamma_q|gamma_rng|gaussian_dlm_obs_lpdf|gumbel_cdf|gumbel_lccdf|gumbel_lcdf|gumbel_lpdf|gumbel_rng|head|hypergeometric_lpmf|hypergeometric_rng|hypot|inc_beta|int_step|integrate_ode_bdf|integrate_ode_rk45|inv|inv_chi_square_cdf|inv_chi_square_lccdf|inv_chi_square_lcdf|inv_chi_square_lpdf|inv_chi_square_rng|inv_cloglog|inv_gamma_cdf|inv_gamma_lccdf|inv_gamma_lcdf|inv_gamma_lpdf|inv_gamma_rng|inv_logit|inv_phi|inv_sqrt|inv_square|inv_wishart_lpdf|inv_wishart_rng|inverse|inverse_spd|is_inf|is_nan|lbeta|lchoose|lgamma|lkj_corr_cholesky_lpdf|lkj_corr_cholesky_rng|lkj_corr_lpdf|lkj_corr_rng|lmgamma|lmultiply|log|log10|log1m|log1m_exp|log1m_inv_logit|log1p|log1p_exp|log2|log_determinant|log_diff_exp|log_falling_factorial|log_inv_logit|log_mix|log_rising_factorial|log_softmax|log_sum_exp|logistic_cdf|logistic_lccdf|logistic_lcdf|logistic_lpdf|logistic_rng|logit|lognormal_cdf|lognormal_lccdf|lognormal_lcdf|lognormal_lpdf|lognormal_rng|machine_precision|max|mdivide_left_spd|mdivide_left_tri_low|mdivide_right_spd|mdivide_right_tri_low|mean|min|modified_bessel_first_kind|modified_bessel_second_kind|multi_gp_cholesky_lpdf|multi_gp_lpdf|multi_normal_cholesky_lpdf|multi_normal_cholesky_rng|multi_normal_lpdf|multi_normal_prec_lpdf|multi_normal_rng|multi_student_t_lpdf|multi_student_t_rng|multinomial_lpmf|multinomial_rng|multiply_lower_tri_self_transpose|neg_binomial_2_cdf|neg_binomial_2_lccdf|neg_binomial_2_lcdf|neg_binomial_2_log_lpmf|neg_binomial_2_log_rng|neg_binomial_2_lpmf|neg_binomial_2_rng|neg_binomial_cdf|neg_binomial_lccdf|neg_binomial_lcdf|neg_binomial_lpmf|neg_binomial_rng|negative_infinity|normal_cdf|normal_lccdf|normal_lcdf|normal_lpdf|normal_rng|not_a_number|num_elements|ordered_logistic_lpmf|ordered_logistic_rng|owens_t|pareto_cdf|pareto_lccdf|pareto_lcdf|pareto_lpdf|pareto_rng|pareto_type_2_cdf|pareto_type_2_lccdf|pareto_type_2_lcdf|pareto_type_2_lpdf|pareto_type_2_rng|pi|poisson_cdf|poisson_lccdf|poisson_lcdf|poisson_log_lpmf|poisson_log_rng|poisson_lpmf|poisson_rng|positive_infinity|pow|prod|qr_Q|qr_R|quad_form|quad_form_diag|quad_form_sym|rank|rayleigh_cdf|rayleigh_lccdf|rayleigh_lcdf|rayleigh_lpdf|rayleigh_rng|rep_array|rep_matrix|rep_row_vector|rep_vector|rising_factorial|round|row|rows|rows_dot_product|rows_dot_self|scaled_inv_chi_square_cdf|scaled_inv_chi_square_lccdf|scaled_inv_chi_square_lcdf|scaled_inv_chi_square_lpdf|scaled_inv_chi_square_rng|sd|segment|sin|singular_values|sinh|size|skew_normal_cdf|skew_normal_lccdf|skew_normal_lcdf|skew_normal_lpdf|skew_normal_rng|softmax|sort_asc|sort_desc|sort_indices_asc|sort_indices_desc|sqrt|sqrt2|square|squared_distance|step|student_t_cdf|student_t_lccdf|student_t_lcdf|student_t_lpdf|student_t_rng|sub_col|sub_row|sum|tail|tan|tanh|target|tcrossprod|tgamma|to_array_1d|to_array_2d|to_matrix|to_row_vector|to_vector|trace|trace_gen_quad_form|trace_quad_form|trigamma|trunc|uniform_cdf|uniform_lccdf|uniform_lcdf|uniform_lpdf|uniform_rng|variance|von_mises_lpdf|von_mises_rng|weibull_cdf|weibull_lccdf|weibull_lcdf|weibull_lpdf|weibull_rng|wiener_lpdf|wishart_lpdf|wishart_rng)\\b"},
{token:"invalid.illegal",regex:"\\b(STAN_MAJOR|STAN_MATH_MAJOR|STAN_MATH_MINOR|STAN_MATH_PATCH|STAN_MINOR|STAN_PATCH|alignas|alignof|and|and_eq|asm|auto|bitand|bitor|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|const_cast|constexpr|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|false|float|for|friend|fvar|goto|if|in|inline|int|long|lp__|mutable|namespace|new|noexcept|not|not_eq|nullptr|operator|or|or_eq|private|protected|public|register|reinterpret_cast|repeat|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|then|this|thread_local|throw|true|try|typedef|typeid|typename|union|unsigned|until|using|var|virtual|void|volatile|wchar_t|while|xor|xor_eq)\\b"},
{token:"invalid.illegal",regex:"[a-zA-Z][a-zA-Z0-9_]*(?!__)\\b__\\b"},{token:"invalid.illegal",regex:"\\b(?:_|[_0-9][A-Za-z0-9_]+|[A-Za-z][A-Za-z0-9_]*__)\\b"},{token:"function",regex:"[a-zA-Z][a-zA-Z0-9_]*(?!__)\\b(?=\\s*\\()"},{token:"identifier",regex:"[a-zA-Z][a-zA-Z0-9_]*(?!__)\\b"},{token:"invalid.deprecated",regex:"<-"},{token:"keyword.operator",regex:"~|[|]{2}|&&|==?|!=|<=?|>=?|\\+|-|\\.?\\*|\\.?/|\\\\|\\^|!|'|%|\\?|:"},{token:"punctuation.operator",regex:",|;|[|]"},{token:"paren.lparen.keyword.operator",
regex:"[\\[\\(\\{]"},{token:"paren.rparen.keyword.operator",regex:"[\\]\\)\\}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",merge:!0,regex:".+"}]}};l.inherits(g,a);n.StanHighlightRules=g});define("mode/sweave",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("ace/tokenizer").Tokenizer,h=a("ace/mode/text_highlight_rules").TextHighlightRules,f=a("mode/sweave_highlight_rules").SweaveHighlightRules,e=a("mode/r_code_model").RCodeModel,b=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,c=a("mode/r_matching_brace_outdent").RMatchingBraceOutdent,d=a("ace/unicode"),u=a("mode/utils");a("mode/auto_brace_insert");a=function(a,d){this.$tokenizer=
a?new k((new h).getRules()):new k((new f).getRules());this.$session=d;this.$outdent=new b;this.codeModel=new e(d,this.$tokenizer,/^r-/,/<<(.*?)>>/,/^\s*@\s*$/);this.$r_outdent=new c(this.codeModel);this.foldingRules=this.codeModel};l.inherits(a,g);(function(){this.tokenRe=new RegExp("^["+d.wordChars+"._]+","g");this.nonTokenRe=new RegExp("^(?:[^"+d.wordChars+"._]|\\s)+","g");this.$complements={"(":")","[":"]",'"':'"',"'":"'","{":"}"};this.$reOpen=/^[(["'{]$/;this.$reClose=/^[)\]"'}]$/;this.insertChunkInfo=
{value:"<<>>=\n\n@\n",position:{row:0,column:2},content_position:{row:1,column:0}};this.getLanguageMode=function(a){return u.getPrimaryState(this.$session,a.row).match(/^r-/)?"R":"TeX"};this.$getNextLineIndent=this.getNextLineIndent;this.getNextLineIndent=function(a,b,c,d){return"r"===u.activeMode(a,"tex")?this.codeModel.getNextLineIndent(a,b,c,d):this.$getNextLineIndent(a,b,c)};this.checkOutdent=function(a,b,c){return"r"===u.activeMode(a,"tex")?this.$r_outdent.checkOutdent(a,b,c):this.$outdent.checkOutdent(b,
c)};this.autoOutdent=function(a,b,c){return"r"===u.activeMode(a,"tex")?this.$r_outdent.autoOutdent(a,b,c):this.$outdent.autoOutdent(b,c)};this.allowAutoInsert=this.smartAllowAutoInsert;this.$id="mode/sweave"}).call(a.prototype);n.Mode=a});define("mode/sweave_highlight_rules",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("mode/tex_highlight_rules").TexHighlightRules,k=a("mode/r_highlight_rules").RHighlightRules;a=a("ace/mode/text_highlight_rules").TextHighlightRules;var h=function(){this.$rules=(new g).getRules();this.$rules.start.unshift({token:"comment.codebegin",regex:"^\\s*<<.*>>=.*$",next:"r-start"});this.$rules.start.unshift({token:"comment",regex:"^\\s*@(?:\\s.*)?$"});this.$rules.start.unshift({regex:"(\\\\Sexpr)([{])",
next:"r-start",onMatch:function(a,b,c,d){c.length=2;c[0]=b;c[1]=1;return[{type:"keyword",value:"\\Sexpr"},{type:"paren.keyword.operator",value:"{"}]}});var a=(new k).getRules();this.addRules(a,"r-");this.$rules["r-start"].unshift({token:"paren.keyword.operator",regex:"[{]",merge:!1,onMatch:function(a,b,c,d){c.length&&(c[1]+=1);return this.token}});this.$rules["r-start"].unshift({token:"paren.keyword.operator",regex:"[}]",merge:!1,onMatch:function(a,b,c,d){this.next="r-start";c.length&&(--c[1],0==
c[1]&&(this.next=c[0],c.splice(0)));return this.token}});this.$rules["r-start"].unshift({token:"comment.codeend",regex:"^\\s*@(?:\\s.*)?$",next:"start"});this.$rules["r-start"].unshift({token:"comment.codebegin",regex:"^<<.*>>=.*$",next:"r-start"})};l.inherits(h,a);n.SweaveHighlightRules=h});define("mode/tex",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("ace/tokenizer").Tokenizer,h=a("ace/mode/text_highlight_rules").TextHighlightRules,f=a("mode/tex_highlight_rules").TexHighlightRules,e=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent;a=function(a){this.$tokenizer=a?new k((new h).getRules()):new k((new f).getRules());this.$outdent=new e};l.inherits(a,g);(function(){this.getNextLineIndent=function(a,c,d){return this.$getIndent(c)};
this.allowAutoInsert=function(){return!1}}).call(a.prototype);n.Mode=a});define("mode/tex_highlight_rules",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");a("ace/lib/lang");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(a){a||(a="text");this.$rules={start:[{token:"comment",regex:"%.*$"},{token:a,regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b",
next:"nospell"},{token:"keyword",regex:"\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:a,regex:"\\s+"}],nospell:[{token:"comment",regex:"%.*$",next:"start"},{token:"nospell."+a,regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b"},
{token:"keyword",regex:"\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])",next:"start"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])]"},{token:"paren.keyword.operator",regex:"}",next:"start"},{token:"nospell."+a,regex:"\\s+"},{token:"nospell."+a,regex:"\\w+"}]}};l.inherits(g,a);n.TexHighlightRules=g});define("mode/token_cursor",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("mode/utils"),k=g.getTokenTypeRegex("paren"),h=function(a,c,d){this.$tokens=a;this.$row=c||0;this.$offset=d||0};(function(){this.cloneCursor=function(){return new h(this.$tokens,this.$row,this.$offset)};var a=g.isArray,c=g.contains,d={"(":")","{":"}","<":">","[":"]",")":"(","}":"{",">":"<","]":"["},e=["(","[","{"],f=[")","]","}"];this.moveToStartOfRow=function(a){this.$row=a;this.$offset=0};this.moveToEndOfRow=
function(a){this.$row=a;this.$offset=(a=this.$tokens[a])&&a.length?a.length-1:0};this.moveToPreviousToken=function(){if(0>=this.$row&&0>=this.$offset)return this.$offset=this.$row=0,!1;if(0<this.$offset)return this.$offset--,!0;for(var a=this.$row-1,b=0;0<=a;){var c=this.$tokens[a];if(c&&0!==c.length){b=c.length;break}a--}if(0>a)return!1;this.$row=a;this.$offset=b-1;return!0};this.moveToNextToken=function(a){"undefined"===typeof a&&(a=(this.$tokens||[]).length);if(this.$row>a)return!1;null==this.$tokens[this.$row]&&
this.$codeModel&&this.$codeModel.$tokenizeUpToRow&&this.$codeModel.$tokenizeUpToRow.call(this.$codeModel,a);var b=this.$tokens[this.$row];if(b&&this.$offset<b.length-1)return this.$offset++,!0;for(var c=this.$row+1;c<=a&&(!(b=this.$tokens[c])||0===b.length);)c++;if(c>a)return!1;this.$row=c;this.$offset=0;return!0};this.peekBwd=function(a){"undefined"===typeof a&&(a=1);for(var b=this.cloneCursor(),c=0;c<a;c++)if(!b.moveToPreviousToken())return b.$invalidate();return b};this.peekFwd=function(a){"undefined"===
typeof a&&(a=1);for(var b=this.cloneCursor(),c=0;c<a;c++)if(!b.moveToNextToken())return b.$invalidate();return b};this.$invalidate=function(){this.$column=this.$row=0;this.$tokens=[];return this};this.seekToNearestToken=function(a,b){if(a.row>b)return!1;this.$row=a.row;var c=this.$tokens[this.$row]||[];for(this.$offset=0;this.$offset<c.length;this.$offset++)if(c[this.$offset].column>=a.column)return!0;return a.row<b?this.moveToNextToken(b):!1};this.bwdToNearestToken=function(a){this.$row=a.row;this.$offset=
a.column;for(var b=this.$tokens[this.$row]||[];0<=this.$offset;this.$offset--){var c=b[this.$offset];if("undefined"!==typeof c&&c.column<=a.column)return!0}return this.moveToPreviousToken()};this.bwdToMatchingToken=function(){var a=this.currentValue();if(!c(f,a))return!1;for(var b=d[a],e=0;this.moveToPreviousToken();){var g=this.currentValue();if(g===b){if(0===e)return!0;e--}else g===a&&e++}return!1};this.fwdToMatchingToken=function(){var a=this.currentValue();if(!c(e,a))return!1;for(var b=d[a],f=
0;this.moveToNextToken();){var g=this.currentValue();if(g===b){if(0===f)return!0;f--}else g===a&&f++}return!1};this.equals=function(a){return this.$row===a.$row&&this.$offset===a.$offset};this.moveBackwardOverMatchingParens=function(){if(!this.moveToPreviousToken())return!1;if(")"!==this.currentValue())return this.moveToNextToken(),!1;for(var a=!1,b=0;this.moveToPreviousToken();){var c=this.currentValue();if("("===c){if(0===b){a=!0;break}b--}else")"===c&&b++}return a};this.findToken=function(a,b){do{var c=
this.currentToken();if(c&&a(c))return c}while(this.moveToNextToken(b));return null};this.findTokenBwd=function(a,b){do{var c=this.currentToken();if(c&&a(c))return c}while(this.moveToPreviousToken(b));return null};this.currentToken=function(){var a=this.$tokens[this.$row];if(null==a)return{};a=a[this.$offset];return null==a?{}:a};this.currentValue=function(){return this.currentToken().value};this.currentType=function(){return this.currentToken().type};this.hasType=function(){var a=this.currentType();
if(null==a)return!1;for(var b=0;b<arguments.length;b++){var c=arguments[b];if(a===c||-1!==a.indexOf(c+".")||-1!==a.indexOf("."+c))return!0}return!1};this.currentPosition=function(){var a=this.currentToken();return null==a?null:{row:this.$row,column:a.column}};this.isFirstSignificantTokenOnLine=function(){return 0===this.$offset};this.isLastSignificantTokenOnLine=function(){return this.$offset==(this.$tokens[this.$row]||[]).length-1};this.bwdUntil=function(a){for(;!a(this);)this.moveToPreviousToken()};
this.bwdWhile=function(a){for(;a(this);)this.moveToPreviousToken()};this.moveToPosition=function(a,b){var c=a.row,d=a.column,e=this.$tokens[c];null==e&&this.$codeModel&&this.$codeModel.$tokenizeUpToRow&&(this.$codeModel.$tokenizeUpToRow.call(this.$codeModel,c),e=this.$tokens[c]);if(e&&0<e.length&&e[0].column<=d){for(var f=0;f<e.length&&!(e[f].column>=d);f++);this.$row=c;this.$offset=f===e.length?f-1:b&&e[f].column===d?f:f-1;return!0}d=this.cloneCursor();d.$row=c;d.$offset=0;return d.moveToPreviousToken()?
(this.$row=d.$row,this.$offset=d.$offset,!0):!1};this.findOpeningBracket=function(b,c){a(b)||(b=[b]);var d=this.cloneCursor();do if(!d.bwdToMatchingToken()){var e=d.currentValue();if(c&&"{"===e)break;for(var f=0;f<b.length;f++)if(e===b[f])return this.$row=d.$row,this.$offset=d.$offset,!0}while(d.moveToPreviousToken());return!1};this.findOpeningBracketCountCommas=function(b,c){a(b)||(b=[b]);var d=this.cloneCursor(),e=0;do if(!d.bwdToMatchingToken()){var f=d.currentValue();","===f&&(e+=1);if(c&&"{"===
f)break;for(var g=0;g<b.length;g++)if(f===b[g])return this.$row=d.$row,this.$offset=d.$offset,e}while(d.moveToPreviousToken());return-1}}).call(h.prototype);var f=function(a,c,d,e){this.$tokens=a;this.$row=c||0;this.$offset=d||0;this.$codeModel=e};l.mixin(f.prototype,h.prototype);(function(){this.cloneCursor=function(){return new f(this.$tokens,this.$row,this.$offset,this.$codeModel)};var a=g.contains;this.bwdOverConstNoexceptDecltype=function(){var a=this.cloneCursor();if("{"!==a.currentValue()||
!a.moveToPreviousToken())return!1;var b=a.cloneCursor();")"===b.currentValue()&&b.bwdToMatchingToken()&&b.moveToPreviousToken()&&"decltype"===b.currentValue()&&b.moveToPreviousToken()&&(a.$row=b.$row,a.$offset=b.$offset);b=a.cloneCursor();")"===b.currentValue()&&b.bwdToMatchingToken()&&b.moveToPreviousToken()&&"noexcept"===b.currentValue()&&(a.$row=b.$row,a.$offset=b.$offset);if("noexcept"===a.currentValue()&&!a.moveToPreviousToken()||"const"===a.currentValue()&&!a.moveToPreviousToken()||")"===a.currentValue()&&
!a.moveToNextToken())return!1;this.$row=a.$row;this.$offset=a.$offset;return!0};this.bwdToMatchingArrow=function(){if(">"!==this.currentValue())return!1;for(var a=0,b=this.cloneCursor();b.moveToPreviousToken();)if("<"===b.currentValue()){if(0===a)return this.$row=b.$row,this.$offset=b.$offset,!0;a--}else">"===b.currentValue()&&a++;return!1};this.bwdOverClassySpecifiers=function(){var a=this.currentValue();":"!==a&&","!==a&&"{"!==a||this.moveToPreviousToken();do{this.bwdToMatchingArrow()&&this.moveToPreviousToken();
a=this.currentType();var b=this.currentValue();if("keyword"!==a&&"::"!==b&&"identifier"!==a&&"constant"!==a)break;if("class"===b||"struct"===b||"enum"===b||":"===b||","===b)return!0}while(this.moveToPreviousToken());return!1};this.bwdOverClassInheritance=function(){var a=this.cloneCursor();return c(a,this)};var c=function(a,b){a.bwdOverClassySpecifiers();var d=a.currentValue();return","===d?c(a,b):":"===d?(b.$row=a.$row,b.$offset=a.$offset,!0):!1};this.bwdOverInitializationList=function(){var a=this.cloneCursor();
return this.doBwdOverInitializationList(a,this)};this.doBwdOverInitializationList=function(b,c){b.moveBackwardOverMatchingParens();if(!b.moveBackwardOverMatchingParens()&&!b.moveToPreviousToken())return!1;for(;"keyword"===b.currentType();)if(!b.moveToPreviousToken())return!1;if(b.moveToPreviousToken()){var d=b.currentValue();if(","===d)return this.doBwdOverInitializationList(b,c);if(":"===d&&(d=b.peekBwd().currentValue(),!a(["public","private","protected"],d)))return c.$row=b.$row,c.$offset=b.$offset,
!0}return!1}}).call(f.prototype);var e=function(a,c,d,e){this.$tokens=a;this.$row=c||0;this.$offset=d||0;this.$codeModel=e};l.mixin(e.prototype,h.prototype);(function(){function a(a){return 0===a.indexOf("'")?a.lastIndexOf("'")===a.length-1:0===a.indexOf('"')?a.lastIndexOf('"')===a.length-1:!1}function c(a){return"("===a||"["===a||"{"===a}function d(a){return")"===a||"]"===a||"}"===a}this.cloneCursor=function(){return new e(this.$tokens,this.$row,this.$offset,this.$codeModel)};var f=g.contains;this.isValidAsIdentifier=
function(){var a=this.currentType();return this.hasType("identifier","constant")||"symbol"===a||"keyword"===a||"string"===a};this.isExtractionOperator=function(){var a=this.currentValue();return"$"===a||"@"===a||"::"===a||":::"===a};this.findStartOfEvaluationContext=function(){var a=this.cloneCursor();do if(!a.bwdToMatchingToken()){if(a.isValidAsIdentifier()){if(!a.moveToPreviousToken())break;if(a.isExtractionOperator())continue;if(!a.moveToNextToken())return!1;break}return!1}while(a.moveToPreviousToken());
this.$row=a.$row;this.$offset=a.$offset;return!0};this.isLookingAtBinaryOp=function(){var a=this.currentType();return"keyword.operator"===a||"keyword.operator.infix"===a};this.moveToStartOfCurrentStatement=function(){for(var a=this.cloneCursor();a.isLookingAtBinaryOp();)if(!a.moveToPreviousToken())return!1;do if(!a.bwdToMatchingToken()){if(a.isValidAsIdentifier()){if(!a.moveToPreviousToken())break;if(a.isLookingAtBinaryOp()){for(;a.isLookingAtBinaryOp();)if(!a.moveToPreviousToken())return!1;if(!a.moveToNextToken())return!1;
continue}if(!a.moveToNextToken())return!1;break}return!1}while(a.moveToPreviousToken());this.$row=a.$row;this.$offset=a.$offset;return!0};this.moveToEndOfCurrentStatement=function(){for(var a=this.cloneCursor();a.isLookingAtBinaryOp();)if(!a.moveToNextToken())return!1;do if(!a.fwdToMatchingToken()){if(a.isValidAsIdentifier()){if(!a.moveToNextToken())break;if(a.isLookingAtBinaryOp()){for(;a.isLookingAtBinaryOp();)if(!a.moveToNextToken())return!1;if(!a.moveToPreviousToken())return!1;continue}if(!a.moveToPreviousToken())return!1;
break}return!1}while(a.moveToNextToken());this.$row=a.$row;this.$offset=a.$offset;return!0};this.isSingleLineString=function(){return a(this.currentValue())};this.isLeftBracket=function(){return c(this.currentValue())};this.isRightBracket=function(){return d(this.currentValue())};this.isValidForEndOfStatement=function(){var b=this.currentType(),c=this.currentValue();return-1!==b.search(k)?d(c):a(c)||this.hasType("identifier","constant","variable")};this.isValidForStartOfStatement=function(){var b=
this.currentType();this.currentValue();if(-1!==b.search(k))return c(this.currentValue());b=this.currentValue();return a(b)||this.hasType("identifier","constant","variable")};this.isConditionalControlFlowKeyword=function(){var a=this.currentValue();return f(["if","for","while","function"],a)};this.isControlFlowKeyword=function(){var a=this.currentValue();return f("if for while else function repeat break next".split(" "),a)};this.isAtStartOfNewExpression=function(a){var b=this.cloneCursor();return b.moveToPreviousToken()?
this.isValidForStartOfStatement()&&b.isValidForEndOfStatement()&&this.$row>b.$row?b.isControlFlowKeyword()||")"===b.currentValue()&&b.bwdToMatchingToken()&&b.moveToPreviousToken()&&b.isConditionalControlFlowKeyword()?!1:!0:!1:a}}).call(e.prototype);n.TokenCursor=h;n.CppTokenCursor=f;n.RTokenCursor=e});define("mode/token_utils",["require","exports","module"],function(a,n,l){a=function(a,k,h,f,e,b){this.$doc=a;this.$tokenizer=k;this.$tokens=h;this.$endStates=Array(a.getLength());this.$statePattern=f;this.$codeBeginPattern=e;this.$codeEndPattern=b};(function(){this.getTokenForPos=function(a,k,h){this.$tokenizeUpToRow(a.row);if(this.$tokens.length<=a.row)return null;for(var f=this.$tokens[a.row],e=0;e<f.length;e++){var b=f[e];if(k&&a.column==b.column)return b;if(a.column<=b.column)break;if(h&&a.column==
b.column+b.value.length||a.column<b.column+b.value.length)return b}return null};this.$tokenizeUpToRow=function(a){a=Math.min(a,this.$doc.getLength()-1);for(var g=0,h=!0;g<=a;g++)if(!h||!this.$endStates[g]){h=!1;var f=0===g?"start":this.$endStates[g-1],e=this.$doc.getLine(g);e=this.$tokenizer.getLineTokens(e,f,g);!this.$statePattern||this.$statePattern.test(e.state)||this.$statePattern.test(f)?this.$tokens[g]=this.$filterWhitespaceAndComments(e.tokens):this.$tokens[g]=[];e.state===this.$endStates[g]?
h=!0:this.$endStates[g]=e.state}h||g<this.$tokens.length&&this.$invalidateRow(g);return!0};this.$filterWhitespaceAndComments=function(a){a=a.filter(function(a){a=/\bcode(?:begin|end)\b/.test(a.type)?!1:/\bsectionhead\b/.test(a.type)?!1:/^\s*$/.test(a.value)||a.type.match(/\b(?:ace_virtual-)?comment\b/);return!a});for(var g=a.length-1;0<=g;g--)if(1<a[g].value.length&&/\bparen\b/.test(a[g].type)){var h=a[g];a.splice(g,1);for(var f=h.value.length-1;0<=f;f--){var e={type:h.type,value:h.value.charAt(f),
column:h.column+f};a.splice(g,0,e)}}return a};this.$invalidateRow=function(a){this.$tokens[a]=null;this.$endStates[a]=null};this.$insertNewRows=function(a,k){for(var g=[a,0],f=0;f<k;f++)g.push(null);this.$tokens.splice.apply(this.$tokens,g);this.$endStates.splice.apply(this.$endStates,g)};this.$removeRows=function(a,k){this.$tokens.splice(a,k);this.$endStates.splice(a,k)};this.$walkParens=function(a,k,h){var f=/\bparen\b/;return a<k?function(){for(;a<=k;a++)for(var e=this.$tokens[a],b=0;b<e.length;b++)if(f.test(e[b].type)&&
!h(e[b].value,{row:a,column:e[b].column}))return!1;return!0}.call(this):function(){a=Math.max(0,a);for(k=Math.max(0,k);a>=k;a--)for(var e=this.$tokens[a],b=e.length-1;0<=b;b--)if(f.test(e[b].type)&&!h(e[b].value,{row:a,column:e[b].column}))return!1;return!0}.call(this)};this.$walkParensBalanced=function(a,k,h,f,e){var b=[],c=null;this.$walkParens(a,k,function(a,g){if(h&&h(b,a,g))return c=g,!1;if(/[\[({]/.test(a))if(b[b.length-1]===e[a])b.pop();else return!0;else b.push(a);return f&&f(b,a,g)?(c=g,
!1):!0});return c};this.$findNextSignificantToken=function(a,k){if(0==this.$tokens.length)return null;k=Math.min(k,this.$tokens.length-1);for(var g=a.row,f=a.column;g<=k;g++){for(var e=this.$tokens[g],b=0;b<e.length;b++)if(e[b].column+e[b].value.length>f)return{token:e[b],row:g,column:Math.max(e[b].column,f),offset:b};f=0}return null};this.findNextSignificantToken=function(a){return this.$findNextSignificantToken(a,this.$tokens.length-1)};this.$findPreviousSignificantToken=function(a,k){if(0==this.$tokens.length)return null;
k=Math.max(0,k);for(var g=Math.min(a.row,this.$tokens.length-1);g>=k;g--){var f=this.$tokens[g];if(0!=f.length){if(g!=a.row)return{row:g,column:f[f.length-1].column,token:f[f.length-1],offset:f.length-1};for(var e=f.length-1;0<=e;e--)if(f[e].column<a.column)return{row:g,column:f[e].column,token:f[e],offset:e}}}return null}}).call(a.prototype);n.TokenUtils=a});define("mode/utils",["require","exports","module"],function(a,n,l){a("ace/range");var g=a("ace/token_iterator").TokenIterator,k=a("ace/unicode");(function(){var a=this,f=new RegExp("^["+k.wordChars+"._]+","");this.construct=function(a,c){function b(){return a.apply(this,c)}b.prototype=a.prototype;return new b};this.contains=function(a,c){for(var b=0;b<a.length;b++)if(a[b]===c)return!0;return!1};this.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)};this.asArray=function(b){return a.isArray(b)?
b:[b]};this.getPrimaryState=function(b,c){return a.primaryState(b.getState(c))};this.primaryState=function(b){if(a.isArray(b))for(var c=0;c<b.length;c++){var d=b[c];if("#tmp"!==d)return d||"start"}return b||"start"};this.activeMode=function(b,c){var d=a.primaryState(b),e=d.lastIndexOf("-");return-1===e?c:d.substring(0,e).toLowerCase()};this.endsWith=function(a,c){return-1!==a.indexOf(c,a.length-c.length)};this.escapeRegExp=function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")};
this.embedRules=function(b,c,d,e,f,g,m){"undefined"===typeof g&&(g=["start"]);"undefined"===typeof m&&(m="start");g=a.asArray(g);m=b.$rules;for(var k=function(a,b,c,d){c.splice(0);return this.token},h=0;h<g.length;h++)m[g[h]].unshift({token:"support.function.codebegin",regex:e,onMatch:k,next:d+"-start"});b.embedRules(c,d+"-",[{token:"support.function.codeend",regex:f,onMatch:k,next:"start"}])};this.isSingleLineString=function(a){if(2>a.length)return!1;var b=a[0];return"'"!==b&&'"'!==b||a[a.length-
1]!==b||"\\"===a[a.length-2]&&"\\"!==a[a.length-3]?!1:!0};this.createTokenIterator=function(a){var b=a.getSelectionRange().start;a=a.getSession();return new g(a,b.row,b.column)};this.isWordCharacter=function(a){return f.test(a)};var e={"'":"'",'"':'"',"`":"`","{":"}","(":")","[":"]","<":">","}":"{",")":"(","]":"[",">":"<"};this.isBracket=function(a,c){return!c||"<"!==a&&">"!==a?"{"===a||"}"===a||"("===a||")"===a||"["===a||"]"===a:!0};this.isOpeningBracket=function(a,c){return"{"===a||"("===a||"["===
a||!!c&&"<"===a};this.isClosingBracket=function(a,c){return"}"===a||")"===a||"]"===a||!!c&&">"===a};this.getComplement=function(a,c){"undefined"===typeof c&&(c=e);var b=c[a];return"undefined"===typeof b?a:b};this.stripEnclosingQuotes=function(a){var b=a.length;if(2>b)return a;var d=a[0];return"'"!==d&&'"'!==d&&"`"!==d||a[b-1]!==d?a:a.substr(1,b-2)};this.startsWith=function(a,c){if("string"!==typeof a||"string"!==typeof c||a.length<c.length)return!1;for(var b=0;b<c.length;b++)if(a[b]!==c[b])return!1;
return!0};this.getTokenTypeRegex=function(a){return new RegExp("(?:^|[.])"+a+"(?:$|[.])","")}}).call(n)});define("mode/xml",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("ace/tokenizer").Tokenizer,h=a("mode/xml_highlight_rules").XmlHighlightRules,f=a("mode/xml_behavior").XmlBehaviour,e=a("mode/xml_fold_mode").FoldMode;a=function(){this.$tokenizer=new k((new h).getRules());this.$behaviour=new f;this.foldingRules=new e};l.inherits(a,g);(function(){this.getNextLineIndent=function(a,c,e){return this.$getIndent(c)}}).call(a.prototype);n.Mode=a});define("mode/xml_behavior",["require","exports","module"],function(a,n,l){function g(a,b){var c=!0,e=a.type.split(".");b.split(".").forEach(function(a){if(-1==e.indexOf(a))return c=!1});return c}l=a("ace/lib/oop");var k=a("ace/mode/behaviour").Behaviour,h=a("ace/mode/behaviour/cstyle").CstyleBehaviour,f=a("ace/token_iterator").TokenIterator;a=function(){this.inherit(h,["string_dquotes"]);this.add("autoclosing","insertion",function(a,b,c,d,h){if(">"==h){a=c.getCursorPosition();c=new f(d,a.row,a.column);
d=c.getCurrentToken();b=!1;if(d&&(g(d,"meta.tag")||g(d,"text")&&d.value.match("/")))b=!0;else{do d=c.stepBackward();while(d&&(g(d,"string")||g(d,"keyword.operator")||g(d,"entity.attribute-name")||g(d,"text")))}if(d&&g(d,"meta.tag-name")&&!c.stepBackward().value.match("/"))return c=d.value,b&&(c=c.substring(0,a.column-d.start)),{text:"></"+c+">",selection:[1,1]}}});this.add("autoindent","insertion",function(a,b,c,d,f){if("\n"==f&&(b=c.getCursorPosition(),"</"==d.doc.getLine(b.row).substring(b.column,
b.column+2)))return a=this.$getIndent(d.doc.getLine(b.row))+d.getTabString(),d=this.$getIndent(d.doc.getLine(b.row)),{text:"\n"+a+"\n"+d,selection:[1,a.length,1,a.length]}})};l.inherits(a,k);n.XmlBehaviour=a});define("mode/xml_fold_mode",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("ace/lib/lang"),k=a("ace/range").Range,h=a("ace/mode/folding/fold_mode").FoldMode,f=a("ace/token_iterator").TokenIterator;a=n.FoldMode=function(a){h.call(this);this.voidElements=a||{}};l.inherits(a,h);(function(){this.getFoldWidget=function(a,b,c){a=this._getFirstTagInLine(a,c);return a.closing?"markbeginend"==b?"end":"":!a.tagName||this.voidElements[a.tagName.toLowerCase()]||a.selfClosing||-1!==
a.value.indexOf("/"+a.tagName)?"":"start"};this._getFirstTagInLine=function(a,b){for(var c=a.getTokens(b),d="",e=0;e<c.length;e++){var f=c[e];d=0===f.type.indexOf("meta.tag")?d+f.value:d+g.stringRepeat(" ",f.value.length)}return this._parseTag(d)};this.tagRe=/^(\s*)(<?(\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/;this._parseTag=function(a){var b=this.tagRe.exec(a),c=this.tagRe.lastIndex||0;this.tagRe.lastIndex=0;return{value:a,match:b?b[2]:"",closing:b?!!b[3]:!1,selfClosing:b?!!b[5]||"/>"==b[2]:!1,tagName:b?
b[4]:"",column:b[1]?c+b[1].length:c}};this._readTagForward=function(a){var b=a.getCurrentToken();if(!b)return null;var c="",d;do if(0===b.type.indexOf("meta.tag")&&(d||(d={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()}),c+=b.value,-1!==c.indexOf(">")))return c=this._parseTag(c),c.start=d,c.end={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()+b.value.length},a.stepForward(),c;while(b=a.stepForward());return null};this._readTagBackward=function(a){var b=a.getCurrentToken();
if(!b)return null;var c="",d;do if(0===b.type.indexOf("meta.tag")&&(d||(d={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()+b.value.length}),c=b.value+c,-1!==c.indexOf("<")))return b=this._parseTag(c),b.end=d,b.start={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()},a.stepBackward(),b;while(b=a.stepBackward());return null};this._pop=function(a,b){for(;a.length;){var c=a[a.length-1];if(b&&c.tagName!=b.tagName)if(this.voidElements[b.tagName])break;else if(this.voidElements[c.tagName])a.pop();
else return null;else return a.pop()}};this.getFoldWidgetRange=function(a,b,c){var d=this._getFirstTagInLine(a,c);if(!d.match)return null;b=[];if(d.closing||d.selfClosing)for(a=new f(a,c,d.column+d.match.length),d={row:c,column:d.column};c=this._readTagBackward(a);){if(c.selfClosing)if(b.length)continue;else return c.start.column+=c.tagName.length+2,c.end.column-=2,k.fromPoints(c.start,c.end);if(c.closing)b.push(c);else if(this._pop(b,c),0==b.length)return c.start.column+=c.tagName.length+2,k.fromPoints(c.start,
d)}else for(a=new f(a,c,d.column),d={row:c,column:d.column+d.tagName.length+2};c=this._readTagForward(a);){if(c.selfClosing)if(b.length)continue;else return c.start.column+=c.tagName.length+2,c.end.column-=2,k.fromPoints(c.start,c.end);if(c.closing){if(this._pop(b,c),0==b.length)return k.fromPoints(d,c.start)}else b.push(c)}}}).call(a.prototype)});define("mode/xml_highlight_rules",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("mode/xml_util");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var k=function(){this.$rules={start:[{token:"text",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:"xml_pe",regex:"<\\?.*?\\?>"},{token:"comment",merge:!0,regex:"<\\!--",next:"comment"},{token:"xml_pe",regex:"<\\!.*?>"},{token:"meta.tag",regex:"<\\/?",next:"tag"},{token:"text",regex:"\\s+"},{token:"constant.character.entity",
regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"},{token:"text",regex:"[^<]+"}],cdata:[{token:"text",regex:"\\]\\]>",next:"start"},{token:"text",regex:"\\s+"},{token:"text",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment",regex:".*?--\x3e",next:"start"},{token:"comment",merge:!0,regex:".+"}]};g.tag(this.$rules,"tag","start")};l.inherits(k,a);n.XmlHighlightRules=k});define("mode/xml_util",["require","exports","module"],function(a,n,l){function g(a,g){return[{token:"string",merge:!0,regex:".*?"+a,next:g},{token:"string",merge:!0,regex:".+"}]}n.tag=function(a,h,f,e){a[h]=[{token:"text",regex:"\\s+"},{token:function(a){return e&&e[a]?"meta.tag.tag-name."+e[a]:"meta.tag.tag-name"},merge:!0,regex:"[-_a-zA-Z0-9:]+",next:h+"_embed_attribute_list"},{token:"empty",regex:"",next:h+"_embed_attribute_list"}];a[h+"_qstring"]=g("'",h+"_embed_attribute_list");a[h+"_qqstring"]=
g('"',h+"_embed_attribute_list");a[h+"_embed_attribute_list"]=[{token:"meta.tag",merge:!0,regex:"/?>",next:f},{token:"keyword.operator",regex:"="},{token:"entity.other.attribute-name",regex:"[-_a-zA-Z0-9:]+"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"text",regex:"\\s+"}].concat([{token:"string",regex:'".*?"'},{token:"string",merge:!0,regex:'["].*',next:h+"_qqstring"},{token:"string",regex:"'.*?'"},{token:"string",merge:!0,regex:"['].*",next:h+"_qstring"}])}});define("mode/yaml",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");var g=a("ace/mode/text").Mode,k=a("mode/yaml_highlight_rules").YamlHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,f=a("ace/mode/folding/coffee").FoldMode;a=function(){this.HighlightRules=k;this.$outdent=new h;this.foldingRules=new f;this.$behaviour=this.$defaultBehaviour};l.inherits(a,g);(function(){this.lineCommentStart="#";this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b);
"start"==a&&b.match(/^.*[\{\(\[]\s*$/)&&(d+=c);return d};this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)};this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)};this.$id="mode/yaml"}).call(a.prototype);n.Mode=a});define("mode/yaml_highlight_rules",["require","exports","module"],function(a,n,l){l=a("ace/lib/oop");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(){this.$rules={start:[{token:["whitespace","comment"],regex:"(^|\\s+)(#.*)$"},{token:"list.markup",regex:/^(?:-{3}|\.{3})\s*(?=#|$)/},{token:"list.markup",regex:/^\s*[\-?](?:$|\s)/},{token:"constant",regex:"!![\\w//]+"},{token:"constant.language",regex:"[&\\*][a-zA-Z0-9-_]+"},{token:["meta.tag","keyword","meta.tag","keyword"],regex:/^(\s*[\w\-].*?)(:{2,3})(\s*[\w\-].*?)(:(?:\s+|$))/},
{token:["meta.tag","keyword"],regex:/^(\s*[\w\-].*?)(:(?:\s+|$))/},{token:["meta.tag","keyword"],regex:/([\w\-]+?)(\s*:(?:\s+|$))/},{token:"keyword.operator",regex:"<<\\w*:\\w*"},{token:"keyword.operator",regex:"-\\s*(?=[{])"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:/[|>][-+\d\s]*$/,onMatch:function(a,g,f,e){a=/^\s*/.exec(e)[0];f=f||[];f[0]=g;f[1]=a.length;return this.token},next:"mlString"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"constant.numeric",
regex:/(\b|[+\-\.])[\d_]+(?:(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)/},{token:"constant.numeric",regex:/[+\-]?\.inf\b|NaN\b|0x[\dA-Fa-f_]+|0b[10_]+/},{token:"constant.language.boolean",regex:"\\b(?:true|false|TRUE|FALSE|True|False|yes|no)\\b"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"}],mlString:[{token:"indent",regex:/^\s*$/},{token:"indent",regex:/^\s*/,onMatch:function(a,g,f){this.next=f[1]>=a.length?f[0]:g;return this.token},next:"mlString"},{token:"string",regex:".+"}]};
this.normalizeRules()};l.inherits(g,a);n.YamlHighlightRules=g});define("theme/default",["require","exports","module"],function(a,n,l){a("ace/lib/dom");n.cssClass="ace-rs"});if(!String.prototype.trimRight){var trimEndRegexp=/\s\s*$/;String.prototype.trimRight=function(){return String(this).replace(trimEndRegexp,"")}}
define("rstudio/loader",["require","exports","module"],function(a,n,l){var g=a("ace/edit_session").EditSession,k=a("ace/editor").Editor;a("ace/lib/event_emitter");a("util/expand_selection");var h=a("ace/range").Range,f=a("ace/virtual_renderer").VirtualRenderer,e=a("ace/mode/text").Mode,b=a("ace/undomanager").UndoManager,c=a("mode/utils");a("ace/lib/event");l=a("ace/lib/oop");a("mixins/token_iterator");var d=function(a,b){k.call(this,a,b);this.setBehavioursEnabled(!0)};l.inherits(d,k);(function(){this.$highlightBrackets=
function(){this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null);this.session.selection.isEmpty()&&k.prototype.$highlightBrackets.call(this)};this.insert=function(a,b){if(!this.session.selection.isEmpty()){var d=[];"quotes"===this.$surroundSelection?d=["'",'"',"`"]:"quotes_and_brackets"===this.$surroundSelection&&(d="'\"`({[".split(""));if("quotes_and_brackets"===this.$surroundSelection){var e=this.session.$mode;if(/\/markdown$/.test(e.$id))d.push("*",
"_");else{var f=this.getCursorPosition();e.getLanguageMode&&"Markdown"===e.getLanguageMode(f)&&d.push("*","_")}}if(c.contains(d,a))return d=c.getComplement(a),this.session.replace(this.session.selection.getRange(),a+this.session.getTextRange()+d)}return k.prototype.insert.call(this,a,b)};this.remove=function(a){return this.session.getMode().wrapRemove?this.session.getMode().wrapRemove(this,k.prototype.remove,a):k.prototype.remove.call(this,a)};this.undo=function(){k.prototype.undo.call(this);this._dispatchEvent("undo")};
this.redo=function(){k.prototype.redo.call(this);this._dispatchEvent("redo")};this.onPaste=function(a,b){k.prototype.onPaste.call(this,a.replace(/\r\n|\n\r|\r/g,"\n"),b)}}).call(d.prototype);var u=function(a,b){g.call(this,a,b)};l.inherits(u,g);(function(){this.insert=function(a,b){return this.getMode().wrapInsert?this.getMode().wrapInsert(this,g.prototype.insert,a,b):g.prototype.insert.call(this,a,b)};this.reindent=function(a){var b=this.getMode();if(b.getNextLineIndent){var d=a.start.row;a=a.end.row;
0===d&&(this.applyIndent(0,""),d++);for(var e=d;e<=a;e++){var f=c.getPrimaryState(this,e-1);if(!c.endsWith(f,"qstring")&&"rawstring"!==f){var g=b.getNextLineIndent(f,this.getLine(e-1),this.getTabString(),e-1,!0);this.applyIndent(e,g);b.autoOutdent(f,this,e)}}b=b.codeModel;"undefined"!==typeof b&&(b=b.alignContinuationSlashes,"undefined"!==typeof b&&b(this.getDocument(),{start:d,end:a}))}};this.applyIndent=function(a,b){var c=this.getLine(a).match(/^\s*/g)[0].length;this.replace(new h(a,0,a,c),b)};
this.setDisableOverwrite=function(a){a?(this.setOverwrite(!1),this.setOverwrite=function(){},this.getOverwrite=function(){return!1}):(this.setOverwrite=g.prototype.setOverwrite,this.getOverwrite=g.prototype.getOverwrite)}}).call(u.prototype);var q=function(){b.call(this)};l.inherits(q,b);(function(){this.peek=function(){return this.$undoStack.length?this.$undoStack[this.$undoStack.length-1]:null}}).call(q.prototype);var p=function(a,b){f.call(this,a,b)};l.inherits(p,f);(function(){this.setTheme=function(a){a&&
f.prototype.setTheme.call(this,a)}}).call(p.prototype);n.RStudioEditor=d;n.loadEditor=function(b){function c(a){f.editor.commands.removeCommand(a)}var f={};b.env=f;b=new p(b,"");var g=new u("");b=new d(b,g);f.editor=b;g=b.getSession();g.setMode(new e);g.setUndoManager(new q);b=a("ace/config");b.set("basePath","ace");b.set("workerPath","js/workers");b.setDefaultValue("session","useWorker",!1);c("findnext");c("findprevious");c("find");c("replace");c("togglecomment");c("gotoline");c("foldall");c("unfoldall");
return f.editor}});define("rstudio/snippets",["require","exports","module"],function(a,n,l){n.toSnippetText=function(a){for(var g=a.length,h="",f=0;f<g;f++){var e=a[f];h+="snippet "+e.name+"\n\t"+e.content.replace(/\n/g,"\n\t")+"\n\n"}return h};n.normalizeSnippets=function(a){for(var g=a.length,h=0;h<g;h++){var f=a[h];null==f.tabTrigger&&(f.tabTrigger=f.name);f.content=f.content.replace("\n    ","\n\t")}}});define("rstudio/snippets/c_cpp",["require","exports","module"],function(a,n,l){l=a("rstudio/snippets");a=a("ace/snippets").snippetManager;var g=[{name:"once",content:"#ifndef ${1:`HeaderGuardFileName`}\n#define ${1:`HeaderGuardFileName`}\n\n${0}\n\n#endif /* ${1:`HeaderGuardFileName`} */"},{name:"ans",content:"namespace {\n${0}\n} // anonymous namespace"},{name:"ns",content:"namespace ${1:ns} {\n${0}\n} // namespace ${1:ns}"},{name:"cls",content:"class ${1:ClassName} {\npublic:\n    ${2}\nprivate:\n    ${3}\n};"},
{name:"str",content:"struct ${1} {\n    ${0}\n};"},{name:"ept",content:"// [[Rcpp::export]]\n"}];l.normalizeSnippets(g);n.snippetText=l.toSnippetText(g);a.register(g,"c_cpp")});define("rstudio/snippets/markdown",["require","exports","module"],function(a,n,l){l=a("rstudio/snippets");a=a("ace/snippets").snippetManager;var g=[{name:"[",content:"[${1:label}](${2:location})"},{name:"![",content:"![${1:label}](${2:location})"},{name:"r",content:"```{r ${1:label}, ${2:options}}\n${0}\n```"},{name:"rcpp",content:"```{r, engine='Rcpp'}\n#include <Rcpp.h>\nusing namespace Rcpp;\n\n${0}\n\n```"}];l.normalizeSnippets(g);n.snippetText=l.toSnippetText(g);a.register(g,"markdown")});define("rstudio/snippets/r",["require","exports","module"],function(a,n,l){l=a("rstudio/snippets");a=a("ace/snippets").snippetManager;var g=[{name:"lib",content:"library(${1:package})"},{name:"req",content:"require(${1:package})"},{name:"src",content:'source("${1:file.R}")'},{name:"ret",content:"return(${1:code})"},{name:"mat",content:"matrix(${1:data}, nrow = ${2:rows}, ncol = ${3:cols})"},{name:"sg",content:'setGeneric("${1:generic}", function(${2:x, ...}) {\n    standardGeneric("${1:generic}")\n})'},
{name:"sm",content:'setMethod("${1:generic}", ${2:class}, function(${2:x, ...}) {\n    ${0}\n})'},{name:"sc",content:'setClass("${1:Class}", slots = c(${2:name = "type"}))'},{name:"if",content:"if (${1:condition}) {\n    ${0}\n}"},{name:"el",content:"else {\n    ${0}\n}"},{name:"ei",content:"else if (${1:condition}) {\n    ${0}\n}"},{name:"fun",content:"${1:name} <- function(${2:variables}) {\n    ${0}\n}"},{name:"for",content:"for (${1:variable} in ${2:vector}) {\n    ${0}\n}"},{name:"while",content:"while (${1:condition}) {\n    ${0}\n}"},
{name:"switch",content:"switch (${1:object},\n    ${2:case} = ${3:action}\n)"},{name:"apply",content:"apply(${1:array}, ${2:margin}, ${3:...})"},{name:"lapply",content:"lapply(${1:list}, ${2:function})"},{name:"sapply",content:"sapply(${1:list}, ${2:function})"},{name:"mapply",content:"mapply(${1:function}, ${2:...})"},{name:"tapply",content:"tapply(${1:vector}, ${2:index}, ${3:function})"},{name:"vapply",content:"vapply(${1:list}, ${2:function}, FUN.VALUE = ${3:type}, ${4:...})"},{name:"rapply",
content:"rapply(${1:list}, ${2:function})"},{name:"ts",content:'`r paste("#", date(), "------------------------------\\n")`'},{name:"shinyapp",content:"library(shiny)\n\nui <- fluidPage(\n  ${0}\n)\n\nserver <- function(input, output, session) {\n  \n}\n\nshinyApp(ui, server)"},{name:"shinymod",content:"${1:name}UI <- function(id) {\n  ns <- NS(id)\n  tagList(\n    ${0}\n  )\n}\n\n${1:name}Server <- function(id) {\n  moduleServer(\n    id,\n    function(input, output, session) {\n      \n    }\n  )\n}"}];
l.normalizeSnippets(g);n.snippetText=l.toSnippetText(g);a.register(g,"r")});define("rstudio/snippets/stan",["require","exports","module"],function(a,n,l){l=a("rstudio/snippets");a=a("ace/snippets").snippetManager;var g=[{name:"for",content:"for (${1:var} in ${2:start}:${3:end}) {\n  ${0}\n}"},{name:"if",content:"if (${1:condition}) {\n  ${0}\n}"},{name:"el",content:"else (${1:condition}) {\n  ${0}\n}"},{name:"ei",content:"else if (${1:condition}) {\n  ${0}\n}"},{name:"<l",content:"<lower = ${1:expression}>${0}"},{name:"<u",content:"<upper = ${1:expression}>${0}"},{name:"<lu",
content:"<lower = ${1:expression}, upper = ${2:expression}>${0}"},{name:"while",content:"while (${1:condition}) {\n  ${0}\n}"},{name:"gen",content:"generated quantities {\n  ${0}\n}"},{name:"mdl",content:"model {\n  ${0}\n}"},{name:"par",content:"parameters {\n  ${0}\n}"},{name:"tpar",content:"transformed parameters {\n  ${0}\n}"},{name:"data",content:"data {\n  ${0}\n}"},{name:"tdata",content:"transformed data {\n  ${0}\n}"},{name:"ode",content:"integrate_ode(${1:function}, ${2:y0}, ${3:t0}, ${4:t}, ${5:theta}, ${6:x_r}, ${7:x_i});"},
{name:"funs",content:"functions {\n  ${0}\n}"},{name:"fun",content:"${1:return} ${2:name} (${3:args}) {\n  ${0}\n}"}];l.normalizeSnippets(g);n.snippetText=l.toSnippetText(g);a.register(g,"stan")});define("rstudio/snippets/yaml",["require","exports","module"],function(a,n,l){l=a("rstudio/snippets");a=a("ace/snippets").snippetManager;var g=[{name:"key",content:"${1:key}: ${2:value}"},{name:"list",content:"${1:key}:\n  - ${2:value1}\n  - ${3:value2}"}];l.normalizeSnippets(g);n.snippetText=l.toSnippetText(g);a.register(g,"yaml")});