| 1 ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/li
b/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("..
/lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$r
ules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:
)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[
xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?
:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)
\\b"},{token:"invalid.illegal",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{toke
n:"invalid.illegal",regex:"\\/\\/.*$"},{token:"paren.lparen",regex:"[[({]"},{tok
en:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],string:[{token:"
constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnr
t])/},{token:"string",regex:'[^"\\\\]+'},{token:"string",regex:'"',next:"start"}
,{token:"string",regex:"",next:"start"}]}};r.inherits(s,i),t.JsonHighlightRules=
s}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","
ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){
};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.tes
t(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/)
;if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!
o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0
,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prot
otype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/behaviour/cstyle",["requi
re","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","
ace/lib/lang"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../beh
aviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang
"),u=["text","paren.rparen","punctuation.operator"],a=["text","paren.rparen","pu
nctuation.operator","comment"],f,l={},c=function(e){var t=-1;e.multiSelect&&(t=e
.selection.index,l.rangeCount!=e.multiSelect.rangeCount&&(l={rangeCount:e.multiS
elect.rangeCount}));if(l[t])return f=l[t];f=l[t]={autoInsertedBrackets:0,autoIns
ertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,m
aybeInsertedLineStart:"",maybeInsertedLineEnd:""}},h=function(e,t,n,r){var i=e.e
nd.row-e.start.row;return{text:n+t+r,selection:[0,e.start.column+1,i,e.end.colum
n+(i?0:1)]}},p=function(){this.add("braces","insertion",function(e,t,n,r,i){var
s=n.getCursorPosition(),u=r.doc.getLine(s.row);if(i=="{"){c(n);var a=n.getSelect
ionRange(),l=r.doc.getTextRange(a);if(l!==""&&l!=="{"&&n.getWrapBehavioursEnable
d())return h(a,l,"{","}");if(p.isSaneInsertion(n,r))return/[\]\}\)]/.test(u[s.co
lumn])||n.inMultiSelectMode?(p.recordAutoInsert(n,r,"}"),{text:"{}",selection:[1
,1]}):(p.recordMaybeInsert(n,r,"{"),{text:"{",selection:[1,1]})}else if(i=="}"){
c(n);var d=u.substring(s.column,s.column+1);if(d=="}"){var v=r.$findOpeningBrack
et("}",{column:s.column+1,row:s.row});if(v!==null&&p.isAutoInsertedClosing(s,u,i
))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if(i=="\n"||
i=="\r\n"){c(n);var m="";p.isMaybeInsertedClosing(s,u)&&(m=o.stringRepeat("}",f.
maybeInsertedBrackets),p.clearMaybeInsertedClosing());var d=u.substring(s.column
,s.column+1);if(d==="}"){var g=r.findMatchingBracket({row:s.row,column:s.column+
1},"}");if(!g)return null;var y=this.$getIndent(r.getLine(g.row))}else{if(!m){p.
clearMaybeInsertedClosing();return}var y=this.$getIndent(u)}var b=y+r.getTabStri
ng();return{text:"\n"+b+"\n"+y+m,selection:[1,b.length,1,b.length]}}p.clearMaybe
InsertedClosing()}}),this.add("braces","deletion",function(e,t,n,r,i){var s=r.do
c.getTextRange(i);if(!i.isMultiLine()&&s=="{"){c(n);var o=r.doc.getLine(i.start.
row),u=o.substring(i.end.column,i.end.column+1);if(u=="}")return i.end.column++,
i;f.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i)
{if(i=="("){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&
n.getWrapBehavioursEnabled())return h(s,o,"(",")");if(p.isSaneInsertion(n,r))ret
urn p.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(i==")"){c(n)
;var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.col
umn+1);if(f==")"){var l=r.$findOpeningBracket(")",{column:u.column+1,row:u.row})
;if(l!==null&&p.isAutoInsertedClosing(u,a,i))return p.popAutoInsertedClosing(),{
text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,n,r,i){va
r s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="("){c(n);var o=r.doc.getLine(
i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==")")return i
.end.column++,i}}),this.add("brackets","insertion",function(e,t,n,r,i){if(i=="["
){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapB
ehavioursEnabled())return h(s,o,"[","]");if(p.isSaneInsertion(n,r))return p.reco
rdAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if(i=="]"){c(n);var u=n.g
etCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(
f=="]"){var l=r.$findOpeningBracket("]",{column:u.column+1,row:u.row});if(l!==nu
ll&&p.isAutoInsertedClosing(u,a,i))return p.popAutoInsertedClosing(),{text:"",se
lection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.do
c.getTextRange(i);if(!i.isMultiLine()&&s=="["){c(n);var o=r.doc.getLine(i.start.
row),u=o.substring(i.start.column+1,i.start.column+2);if(u=="]")return i.end.col
umn++,i}}),this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||
i=="'"){c(n);var s=i,o=n.getSelectionRange(),u=r.doc.getTextRange(o);if(u!==""&&
u!=="'"&&u!='"'&&n.getWrapBehavioursEnabled())return h(o,u,s,s);if(!u){var a=n.g
etCursorPosition(),f=r.doc.getLine(a.row),l=f.substring(a.column-1,a.column),p=f
.substring(a.column,a.column+1),d=r.getTokenAt(a.row,a.column),v=r.getTokenAt(a.
row,a.column+1);if(l=="\\"&&d&&/escape/.test(d.type))return null;var m=d&&/strin
g|escape/.test(d.type),g=!v||/string|escape/.test(v.type),y;if(p==s)y=m!==g;else
{if(m&&!g)return null;if(m&&g)return null;var b=r.$mode.tokenRe;b.lastIndex=0;va
r w=b.test(l);b.lastIndex=0;var E=b.test(l);if(w||E)return null;if(p&&!/[\s;,.})
\]\\]/.test(p))return null;y=!0}return{text:y?s+s:"",selection:[1,1]}}}}),this.a
dd("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);i
f(!i.isMultiLine()&&(s=='"'||s=="'")){c(n);var o=r.doc.getLine(i.start.row),u=o.
substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}})}
;p.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new s(t,n.row,n.c
olumn);if(!this.$matchTokenType(r.getCurrentToken()||"text",u)){var i=new s(t,n.
row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",u))return!1
}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.g
etCurrentToken()||"text",a)},p.$matchTokenType=function(e,t){return t.indexOf(e.
type||e)>-1},p.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.
doc.getLine(r.row);this.isAutoInsertedClosing(r,i,f.autoInsertedLineEnd[0])||(f.
autoInsertedBrackets=0),f.autoInsertedRow=r.row,f.autoInsertedLineEnd=n+i.substr
(r.column),f.autoInsertedBrackets++},p.recordMaybeInsert=function(e,t,n){var r=e
.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(f
.maybeInsertedBrackets=0),f.maybeInsertedRow=r.row,f.maybeInsertedLineStart=i.su
bstr(0,r.column)+n,f.maybeInsertedLineEnd=i.substr(r.column),f.maybeInsertedBrac
kets++},p.isAutoInsertedClosing=function(e,t,n){return f.autoInsertedBrackets>0&
&e.row===f.autoInsertedRow&&n===f.autoInsertedLineEnd[0]&&t.substr(e.column)===f
.autoInsertedLineEnd},p.isMaybeInsertedClosing=function(e,t){return f.maybeInser
tedBrackets>0&&e.row===f.maybeInsertedRow&&t.substr(e.column)===f.maybeInsertedL
ineEnd&&t.substr(0,e.column)==f.maybeInsertedLineStart},p.popAutoInsertedClosing
=function(){f.autoInsertedLineEnd=f.autoInsertedLineEnd.substr(1),f.autoInserted
Brackets--},p.clearMaybeInsertedClosing=function(){f&&(f.maybeInsertedBrackets=0
,f.maybeInsertedRow=-1)},r.inherits(p,i),t.CstyleBehaviour=p}),ace.define("ace/m
ode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace
/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),
i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&
&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[
^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.s
ource.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingS
tartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\]
)|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.trip
leStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/
\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=fun
ction(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.
startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=thi
s._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this
.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.t
est(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartM
arker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);v
ar u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=t
his.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i
.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.
closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionR
ange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u
=t,a=e.getLength();while(++t<a){n=e.getLine(t);var f=n.search(/\S/);if(f===-1)co
ntinue;if(r>f)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.ro
w<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,
o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.sea
rch(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;whi
le(++n<s){t=e.getLine(n);var f=u.exec(t);if(!f)continue;f[1]?a--:a++;if(!a)break
}var l=n;if(l>o)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("a
ce/mode/json",["require","exports","module","ace/lib/oop","ace/mode/text","ace/m
ode/json_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/
cstyle","ace/mode/folding/cstyle","ace/worker/worker_client"],function(e,t,n){"u
se strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./json_highlight_rules"
).JsonHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e(".
/behaviour/cstyle").CstyleBehaviour,a=e("./folding/cstyle").FoldMode,f=e("../wor
ker/worker_client").WorkerClient,l=function(){this.HighlightRules=s,this.$outden
t=new o,this.$behaviour=new u,this.foldingRules=new a};r.inherits(l,i),function(
){this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t);if(e=="start")
{var i=t.match(/^.*[\{\(\[]\s*$/);i&&(r+=n)}return r},this.checkOutdent=function
(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n)
{this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new f(["ace
"],"ace/mode/json_worker","JsonWorker");return t.attachToDocument(e.getDocument(
)),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",funct
ion(){e.clearAnnotations()}),t},this.$id="ace/mode/json"}.call(l.prototype),t.Mo
de=l}) |