ace.define("ace/mode/bibtex_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(r,h,m){"use strict";var u=r("../lib/oop"),d=r("./text_highlight_rules").TextHighlightRules,c=function(){this.$rules={start:[{token:"comment",regex:/@Comment\{/,stateName:"bibtexComment",push:[{token:"comment",regex:/}/,next:"pop"},{token:"comment",regex:/\{/,push:"bibtexComment"},{defaultToken:"comment"}]},{token:["keyword","text","paren.lparen","text","variable","text","keyword.operator"],regex:/(@String)(\s*)(\{)(\s*)([a-zA-Z]*)(\s*)(=)/,push:[{token:"paren.rparen",regex:/\}/,next:"pop"},{include:"#misc"},{defaultToken:"text"}]},{token:["keyword","text","paren.lparen","text","variable","text","keyword.operator"],regex:/(@String)(\s*)(\()(\s*)([a-zA-Z]*)(\s*)(=)/,push:[{token:"paren.rparen",regex:/\)/,next:"pop"},{include:"#misc"},{defaultToken:"text"}]},{token:["keyword","text","paren.lparen"],regex:/(@preamble)(\s*)(\()/,push:[{token:"paren.rparen",regex:/\)/,next:"pop"},{include:"#misc"},{defaultToken:"text"}]},{token:["keyword","text","paren.lparen"],regex:/(@preamble)(\s*)(\{)/,push:[{token:"paren.rparen",regex:/\}/,next:"pop"},{include:"#misc"},{defaultToken:"text"}]},{token:["keyword","text","paren.lparen","text","support.class"],regex:/(@[a-zA-Z]+)(\s*)(\{)(\s*)([\w-]+)/,push:[{token:"paren.rparen",regex:/\}/,next:"pop"},{token:["variable","text","keyword.operator"],regex:/([a-zA-Z0-9\!\$\&\*\+\-\.\/\:\;\<\>\?\[\]\^\_\`\|]+)(\s*)(=)/,push:[{token:"text",regex:/(?=[,}])/,next:"pop"},{include:"#misc"},{include:"#integer"},{defaultToken:"text"}]},{token:"punctuation",regex:/,/},{defaultToken:"text"}]},{defaultToken:"comment"}],"#integer":[{token:"constant.numeric.bibtex",regex:/\d+/}],"#misc":[{token:"string",regex:/"/,push:"#string_quotes"},{token:"paren.lparen",regex:/\{/,push:"#string_braces"},{token:"keyword.operator",regex:/#/}],"#string_braces":[{token:"paren.rparen",regex:/\}/,next:"pop"},{token:"invalid.illegal",regex:/@/},{include:"#misc"},{defaultToken:"string"}],"#string_quotes":[{token:"string",regex:/"/,next:"pop"},{include:"#misc"},{defaultToken:"string"}]},this.normalizeRules()};u.inherits(c,d),h.BibTeXHighlightRules=c}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(r,h,m){"use strict";var u=r("../../lib/oop"),d=r("../../range").Range,c=r("./fold_mode").FoldMode,x=h.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};u.inherits(x,c),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var a=e.getLine(n);if(this.singleLineBlockCommentRe.test(a)&&!this.startRegionRe.test(a)&&!this.tripleStarBlockCommentRe.test(a))return"";var o=this._getFoldWidgetBase(e,t,n);return!o&&this.startRegionRe.test(a)?"start":o},this.getFoldWidgetRange=function(e,t,n,a){var i,o=e.getLine(n);if(this.startRegionRe.test(o))return this.getCommentRegionBlock(e,o,n);if(i=o.match(this.foldingStartMarker)){var g=i.index;if(i[1])return this.openingBracketBlock(e,i[1],n,g);var l=e.getCommentFoldRange(n,g+i[0].length,1);return l&&!l.isMultiLine()&&(a?l=this.getSectionRange(e,n):"all"!=t&&(l=null)),l}return"markbegin"!==t&&(i=o.match(this.foldingStopMarker))?(g=i.index+i[0].length,i[1]?this.closingBracketBlock(e,i[1],n,g):e.getCommentFoldRange(n,g,-1)):void 0},this.getSectionRange=function(e,t){for(var n=e.getLine(t),a=n.search(/\S/),o=t,g=n.length,l=t+=1,i=e.getLength();++t<i;){var p=(n=e.getLine(t)).search(/\S/);if(-1!==p){if(a>p)break;var s=this.getFoldWidgetRange(e,"all",t);if(s){if(s.start.row<=o)break;if(s.isMultiLine())t=s.end.row;else if(a==p)break}l=t}}return new d(o,g,l,e.getLine(l).length)},this.getCommentRegionBlock=function(e,t,n){for(var a=t.search(/\s*$/),o=e.getLength(),g=n,l=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,i=1;++n<o;){t=e.getLine(n);var p=l.exec(t);if(p&&(p[1]?i--:i++,!i))break}if(n>g)return new d(g,a,n,t.length)}}.call(x.prototype)}),ace.define("ace/mode/bibtex",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/bibtex_highlight_rules","ace/mode/folding/cstyle"],function(r,h,m){"use strict";var u=r("../lib/oop"),d=r("./text").Mode,c=r("./bibtex_highlight_rules").BibTeXHighlightRules,x=r("./folding/cstyle").FoldMode,e=function(){this.HighlightRules=c,this.foldingRules=new x};u.inherits(e,d),function(){this.$id="ace/mode/bibtex"}.call(e.prototype),h.Mode=e}),ace.require(["ace/mode/bibtex"],function(r){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=r)});