filesbox/web/dist/55259.be73e456.async.js
2024-07-26 14:10:54 +08:00

13 lines
47 KiB
JavaScript

(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[55259],{55259:function(){(function(m){if(typeof m.window!="undefined"&&m.document||m.require&&m.define)return;m.console||(m.console=function(){var c=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:c})},m.console.error=m.console.warn=m.console.log=m.console.trace=m.console),m.window=m,m.ace=m,m.onerror=function(c,i,n,r,l){postMessage({type:"error",data:{message:c,data:l&&l.data,file:i,line:n,col:r,stack:l&&l.stack}})},m.normalizeModule=function(c,i){if(i.indexOf("!")!==-1){var n=i.split("!");return m.normalizeModule(c,n[0])+"!"+m.normalizeModule(c,n[1])}if(i.charAt(0)=="."){var r=c.split("/").slice(0,-1).join("/");for(i=(r?r+"/":"")+i;i.indexOf(".")!==-1&&l!=i;){var l=i;i=i.replace(/^\.\//,"").replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return i},m.require=function(i,n){if(n||(n=i,i=null),!n.charAt)throw new Error("worker.js require() accepts only (parentId, id) as arguments");n=m.normalizeModule(i,n);var r=m.require.modules[n];if(r)return r.initialized||(r.initialized=!0,r.exports=r.factory().exports),r.exports;if(!m.require.tlns)return console.log("unable to load "+n);var l=b(n,m.require.tlns);return l.slice(-3)!=".js"&&(l+=".js"),m.require.id=n,m.require.modules[n]={},importScripts(l),m.require(i,n)};function b(c,i){for(var n=c,r="";n;){var l=i[n];if(typeof l=="string")return l+r;if(l)return l.location.replace(/\/*$/,"/")+(r||l.main||l.name);if(l===!1)return"";var o=n.lastIndexOf("/");if(o===-1)break;r=n.substr(o)+r,n=n.slice(0,o)}return c}m.require.modules={},m.require.tlns={},m.define=function(c,i,n){if(arguments.length==2?(n=i,typeof c!="string"&&(i=c,c=m.require.id)):arguments.length==1&&(n=c,i=[],c=m.require.id),typeof n!="function"){m.require.modules[c]={exports:n,initialized:!0};return}i.length||(i=["require","exports","module"]);var r=function(l){return m.require(c,l)};m.require.modules[c]={exports:{},factory:function(){var l=this,o=n.apply(this,i.slice(0,n.length).map(function(a){switch(a){case"require":return r;case"exports":return l.exports;case"module":return l;default:return r(a)}}));return o&&(l.exports=o),l}}},m.define.amd={},m.require.tlns={},m.initBaseUrls=function(i){for(var n in i)this.require.tlns[n]=i[n]},m.initSender=function(){var i=m.require("ace/lib/event_emitter").EventEmitter,n=m.require("ace/lib/oop"),r=function(){};return function(){n.implement(this,i),this.callback=function(l,o){postMessage({type:"call",id:o,data:l})},this.emit=function(l,o){postMessage({type:"event",name:l,data:o})}}.call(r.prototype),new r};var q=m.main=null,v=m.sender=null;m.onmessage=function(c){var i=c.data;if(i.event&&v)v._signal(i.event,i.data);else if(i.command)if(q[i.command])q[i.command].apply(q,i.args);else if(m[i.command])m[i.command].apply(m,i.args);else throw new Error("Unknown command:"+i.command);else if(i.init){m.initBaseUrls(i.tlns),v=m.sender=m.initSender();var n=this.require(i.module)[i.classname];q=m.main=new n(v)}}})(this),ace.define("ace/lib/oop",[],function(m,b,q){"use strict";b.inherits=function(v,c){v.super_=c,v.prototype=Object.create(c.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}})},b.mixin=function(v,c){for(var i in c)v[i]=c[i];return v},b.implement=function(v,c){b.mixin(v,c)}}),ace.define("ace/apply_delta",[],function(m,b,q){"use strict";function v(n,r){throw console.log("Invalid Delta:",n),"Invalid Delta: "+r}function c(n,r){return r.row>=0&&r.row<n.length&&r.column>=0&&r.column<=n[r.row].length}function i(n,r){r.action!="insert"&&r.action!="remove"&&v(r,"delta.action must be 'insert' or 'remove'"),r.lines instanceof Array||v(r,"delta.lines must be an Array"),(!r.start||!r.end)&&v(r,"delta.start/end must be an present");var l=r.start;c(n,r.start)||v(r,"delta.start must be contained in document");var o=r.end;r.action=="remove"&&!c(n,o)&&v(r,"delta.end must contained in document for 'remove' actions");var a=o.row-l.row,f=o.column-(a==0?l.column:0);(a!=r.lines.length-1||r.lines[a].length!=f)&&v(r,"delta.range must match delta lines")}b.applyDelta=function(n,r,l){var o=r.start.row,a=r.start.column,f=n[o]||"";switch(r.action){case"insert":var g=r.lines;if(g.length===1)n[o]=f.substring(0,a)+r.lines[0]+f.substring(a);else{var y=[o,1].concat(r.lines);n.splice.apply(n,y),n[o]=f.substring(0,a)+n[o],n[o+r.lines.length-1]+=f.substring(a)}break;case"remove":var L=r.end.column,D=r.end.row;o===D?n[o]=f.substring(0,a)+f.substring(L):n.splice(o,D-o+1,f.substring(0,a)+n[D].substring(L));break}}}),ace.define("ace/lib/event_emitter",[],function(m,b,q){"use strict";var v={},c=function(){this.propagationStopped=!0},i=function(){this.defaultPrevented=!0};v._emit=v._dispatchEvent=function(n,r){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var l=this._eventRegistry[n]||[],o=this._defaultHandlers[n];if(!(!l.length&&!o)){(typeof r!="object"||!r)&&(r={}),r.type||(r.type=n),r.stopPropagation||(r.stopPropagation=c),r.preventDefault||(r.preventDefault=i),l=l.slice();for(var a=0;a<l.length&&(l[a](r,this),!r.propagationStopped);a++);if(o&&!r.defaultPrevented)return o(r,this)}},v._signal=function(n,r){var l=(this._eventRegistry||{})[n];if(!!l){l=l.slice();for(var o=0;o<l.length;o++)l[o](r,this)}},v.once=function(n,r){var l=this;if(this.on(n,function o(){l.off(n,o),r.apply(null,arguments)}),!r)return new Promise(function(o){r=o})},v.setDefaultHandler=function(n,r){var l=this._defaultHandlers;if(l||(l=this._defaultHandlers={_disabled_:{}}),l[n]){var o=l[n],a=l._disabled_[n];a||(l._disabled_[n]=a=[]),a.push(o);var f=a.indexOf(r);f!=-1&&a.splice(f,1)}l[n]=r},v.removeDefaultHandler=function(n,r){var l=this._defaultHandlers;if(!!l){var o=l._disabled_[n];if(l[n]==r)o&&this.setDefaultHandler(n,o.pop());else if(o){var a=o.indexOf(r);a!=-1&&o.splice(a,1)}}},v.on=v.addEventListener=function(n,r,l){this._eventRegistry=this._eventRegistry||{};var o=this._eventRegistry[n];return o||(o=this._eventRegistry[n]=[]),o.indexOf(r)==-1&&o[l?"unshift":"push"](r),r},v.off=v.removeListener=v.removeEventListener=function(n,r){this._eventRegistry=this._eventRegistry||{};var l=this._eventRegistry[n];if(!!l){var o=l.indexOf(r);o!==-1&&l.splice(o,1)}},v.removeAllListeners=function(n){n||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[n]=void 0),this._defaultHandlers&&(this._defaultHandlers[n]=void 0)},b.EventEmitter=v}),ace.define("ace/range",[],function(m,b,q){"use strict";var v=function(i,n){return i.row-n.row||i.column-n.column},c=function(){function i(n,r,l,o){this.start={row:n,column:r},this.end={row:l,column:o}}return i.prototype.isEqual=function(n){return this.start.row===n.start.row&&this.end.row===n.end.row&&this.start.column===n.start.column&&this.end.column===n.end.column},i.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},i.prototype.contains=function(n,r){return this.compare(n,r)==0},i.prototype.compareRange=function(n){var r,l=n.end,o=n.start;return r=this.compare(l.row,l.column),r==1?(r=this.compare(o.row,o.column),r==1?2:r==0?1:0):r==-1?-2:(r=this.compare(o.row,o.column),r==-1?-1:r==1?42:0)},i.prototype.comparePoint=function(n){return this.compare(n.row,n.column)},i.prototype.containsRange=function(n){return this.comparePoint(n.start)==0&&this.comparePoint(n.end)==0},i.prototype.intersects=function(n){var r=this.compareRange(n);return r==-1||r==0||r==1},i.prototype.isEnd=function(n,r){return this.end.row==n&&this.end.column==r},i.prototype.isStart=function(n,r){return this.start.row==n&&this.start.column==r},i.prototype.setStart=function(n,r){typeof n=="object"?(this.start.column=n.column,this.start.row=n.row):(this.start.row=n,this.start.column=r)},i.prototype.setEnd=function(n,r){typeof n=="object"?(this.end.column=n.column,this.end.row=n.row):(this.end.row=n,this.end.column=r)},i.prototype.inside=function(n,r){return this.compare(n,r)==0?!(this.isEnd(n,r)||this.isStart(n,r)):!1},i.prototype.insideStart=function(n,r){return this.compare(n,r)==0?!this.isEnd(n,r):!1},i.prototype.insideEnd=function(n,r){return this.compare(n,r)==0?!this.isStart(n,r):!1},i.prototype.compare=function(n,r){return!this.isMultiLine()&&n===this.start.row?r<this.start.column?-1:r>this.end.column?1:0:n<this.start.row?-1:n>this.end.row?1:this.start.row===n?r>=this.start.column?0:-1:this.end.row===n?r<=this.end.column?0:1:0},i.prototype.compareStart=function(n,r){return this.start.row==n&&this.start.column==r?-1:this.compare(n,r)},i.prototype.compareEnd=function(n,r){return this.end.row==n&&this.end.column==r?1:this.compare(n,r)},i.prototype.compareInside=function(n,r){return this.end.row==n&&this.end.column==r?1:this.start.row==n&&this.start.column==r?-1:this.compare(n,r)},i.prototype.clipRows=function(n,r){if(this.end.row>r)var l={row:r+1,column:0};else if(this.end.row<n)var l={row:n,column:0};if(this.start.row>r)var o={row:r+1,column:0};else if(this.start.row<n)var o={row:n,column:0};return i.fromPoints(o||this.start,l||this.end)},i.prototype.extend=function(n,r){var l=this.compare(n,r);if(l==0)return this;if(l==-1)var o={row:n,column:r};else var a={row:n,column:r};return i.fromPoints(o||this.start,a||this.end)},i.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},i.prototype.isMultiLine=function(){return this.start.row!==this.end.row},i.prototype.clone=function(){return i.fromPoints(this.start,this.end)},i.prototype.collapseRows=function(){return this.end.column==0?new i(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new i(this.start.row,0,this.end.row,0)},i.prototype.toScreenRange=function(n){var r=n.documentToScreenPosition(this.start),l=n.documentToScreenPosition(this.end);return new i(r.row,r.column,l.row,l.column)},i.prototype.moveBy=function(n,r){this.start.row+=n,this.start.column+=r,this.end.row+=n,this.end.column+=r},i}();c.fromPoints=function(i,n){return new c(i.row,i.column,n.row,n.column)},c.comparePoints=v,c.comparePoints=function(i,n){return i.row-n.row||i.column-n.column},b.Range=c}),ace.define("ace/anchor",[],function(m,b,q){"use strict";var v=m("./lib/oop"),c=m("./lib/event_emitter").EventEmitter,i=function(){function l(o,a,f){this.$onChange=this.onChange.bind(this),this.attach(o),typeof f=="undefined"?this.setPosition(a.row,a.column):this.setPosition(a,f)}return l.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},l.prototype.getDocument=function(){return this.document},l.prototype.onChange=function(o){if(!(o.start.row==o.end.row&&o.start.row!=this.row)&&!(o.start.row>this.row)){var a=r(o,{row:this.row,column:this.column},this.$insertRight);this.setPosition(a.row,a.column,!0)}},l.prototype.setPosition=function(o,a,f){var g;if(f?g={row:o,column:a}:g=this.$clipPositionToDocument(o,a),!(this.row==g.row&&this.column==g.column)){var y={row:this.row,column:this.column};this.row=g.row,this.column=g.column,this._signal("change",{old:y,value:g})}},l.prototype.detach=function(){this.document.off("change",this.$onChange)},l.prototype.attach=function(o){this.document=o||this.document,this.document.on("change",this.$onChange)},l.prototype.$clipPositionToDocument=function(o,a){var f={};return o>=this.document.getLength()?(f.row=Math.max(0,this.document.getLength()-1),f.column=this.document.getLine(f.row).length):o<0?(f.row=0,f.column=0):(f.row=o,f.column=Math.min(this.document.getLine(f.row).length,Math.max(0,a))),a<0&&(f.column=0),f},l}();i.prototype.$insertRight=!1,v.implement(i.prototype,c);function n(l,o,a){var f=a?l.column<=o.column:l.column<o.column;return l.row<o.row||l.row==o.row&&f}function r(l,o,a){var f=l.action=="insert",g=(f?1:-1)*(l.end.row-l.start.row),y=(f?1:-1)*(l.end.column-l.start.column),L=l.start,D=f?L:l.end;return n(o,L,a)?{row:o.row,column:o.column}:n(D,o,!a)?{row:o.row+g,column:o.column+(o.row==D.row?y:0)}:{row:L.row,column:L.column}}b.Anchor=i}),ace.define("ace/document",[],function(m,b,q){"use strict";var v=m("./lib/oop"),c=m("./apply_delta").applyDelta,i=m("./lib/event_emitter").EventEmitter,n=m("./range").Range,r=m("./anchor").Anchor,l=function(){function o(a){this.$lines=[""],a.length===0?this.$lines=[""]:Array.isArray(a)?this.insertMergedLines({row:0,column:0},a):this.insert({row:0,column:0},a)}return o.prototype.setValue=function(a){var f=this.getLength()-1;this.remove(new n(0,0,f,this.getLine(f).length)),this.insert({row:0,column:0},a||"")},o.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},o.prototype.createAnchor=function(a,f){return new r(this,a,f)},o.prototype.$detectNewLine=function(a){var f=a.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=f?f[1]:`
`,this._signal("changeNewLineMode")},o.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return`\r
`;case"unix":return`
`;default:return this.$autoNewLine||`
`}},o.prototype.setNewLineMode=function(a){this.$newLineMode!==a&&(this.$newLineMode=a,this._signal("changeNewLineMode"))},o.prototype.getNewLineMode=function(){return this.$newLineMode},o.prototype.isNewLine=function(a){return a==`\r
`||a=="\r"||a==`
`},o.prototype.getLine=function(a){return this.$lines[a]||""},o.prototype.getLines=function(a,f){return this.$lines.slice(a,f+1)},o.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},o.prototype.getLength=function(){return this.$lines.length},o.prototype.getTextRange=function(a){return this.getLinesForRange(a).join(this.getNewLineCharacter())},o.prototype.getLinesForRange=function(a){var f;if(a.start.row===a.end.row)f=[this.getLine(a.start.row).substring(a.start.column,a.end.column)];else{f=this.getLines(a.start.row,a.end.row),f[0]=(f[0]||"").substring(a.start.column);var g=f.length-1;a.end.row-a.start.row==g&&(f[g]=f[g].substring(0,a.end.column))}return f},o.prototype.insertLines=function(a,f){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(a,f)},o.prototype.removeLines=function(a,f){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(a,f)},o.prototype.insertNewLine=function(a){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(a,["",""])},o.prototype.insert=function(a,f){return this.getLength()<=1&&this.$detectNewLine(f),this.insertMergedLines(a,this.$split(f))},o.prototype.insertInLine=function(a,f){var g=this.clippedPos(a.row,a.column),y=this.pos(a.row,a.column+f.length);return this.applyDelta({start:g,end:y,action:"insert",lines:[f]},!0),this.clonePos(y)},o.prototype.clippedPos=function(a,f){var g=this.getLength();a===void 0?a=g:a<0?a=0:a>=g&&(a=g-1,f=void 0);var y=this.getLine(a);return f==null&&(f=y.length),f=Math.min(Math.max(f,0),y.length),{row:a,column:f}},o.prototype.clonePos=function(a){return{row:a.row,column:a.column}},o.prototype.pos=function(a,f){return{row:a,column:f}},o.prototype.$clipPosition=function(a){var f=this.getLength();return a.row>=f?(a.row=Math.max(0,f-1),a.column=this.getLine(f-1).length):(a.row=Math.max(0,a.row),a.column=Math.min(Math.max(a.column,0),this.getLine(a.row).length)),a},o.prototype.insertFullLines=function(a,f){a=Math.min(Math.max(a,0),this.getLength());var g=0;a<this.getLength()?(f=f.concat([""]),g=0):(f=[""].concat(f),a--,g=this.$lines[a].length),this.insertMergedLines({row:a,column:g},f)},o.prototype.insertMergedLines=function(a,f){var g=this.clippedPos(a.row,a.column),y={row:g.row+f.length-1,column:(f.length==1?g.column:0)+f[f.length-1].length};return this.applyDelta({start:g,end:y,action:"insert",lines:f}),this.clonePos(y)},o.prototype.remove=function(a){var f=this.clippedPos(a.start.row,a.start.column),g=this.clippedPos(a.end.row,a.end.column);return this.applyDelta({start:f,end:g,action:"remove",lines:this.getLinesForRange({start:f,end:g})}),this.clonePos(f)},o.prototype.removeInLine=function(a,f,g){var y=this.clippedPos(a,f),L=this.clippedPos(a,g);return this.applyDelta({start:y,end:L,action:"remove",lines:this.getLinesForRange({start:y,end:L})},!0),this.clonePos(y)},o.prototype.removeFullLines=function(a,f){a=Math.min(Math.max(0,a),this.getLength()-1),f=Math.min(Math.max(0,f),this.getLength()-1);var g=f==this.getLength()-1&&a>0,y=f<this.getLength()-1,L=g?a-1:a,D=g?this.getLine(L).length:0,$=y?f+1:f,I=y?0:this.getLine($).length,H=new n(L,D,$,I),K=this.$lines.slice(a,f+1);return this.applyDelta({start:H.start,end:H.end,action:"remove",lines:this.getLinesForRange(H)}),K},o.prototype.removeNewLine=function(a){a<this.getLength()-1&&a>=0&&this.applyDelta({start:this.pos(a,this.getLine(a).length),end:this.pos(a+1,0),action:"remove",lines:["",""]})},o.prototype.replace=function(a,f){if(a instanceof n||(a=n.fromPoints(a.start,a.end)),f.length===0&&a.isEmpty())return a.start;if(f==this.getTextRange(a))return a.end;this.remove(a);var g;return f?g=this.insert(a.start,f):g=a.start,g},o.prototype.applyDeltas=function(a){for(var f=0;f<a.length;f++)this.applyDelta(a[f])},o.prototype.revertDeltas=function(a){for(var f=a.length-1;f>=0;f--)this.revertDelta(a[f])},o.prototype.applyDelta=function(a,f){var g=a.action=="insert";(g?a.lines.length<=1&&!a.lines[0]:!n.comparePoints(a.start,a.end))||(g&&a.lines.length>2e4?this.$splitAndapplyLargeDelta(a,2e4):(c(this.$lines,a,f),this._signal("change",a)))},o.prototype.$safeApplyDelta=function(a){var f=this.$lines.length;(a.action=="remove"&&a.start.row<f&&a.end.row<f||a.action=="insert"&&a.start.row<=f)&&this.applyDelta(a)},o.prototype.$splitAndapplyLargeDelta=function(a,f){for(var g=a.lines,y=g.length-f+1,L=a.start.row,D=a.start.column,$=0,I=0;$<y;$=I){I+=f-1;var H=g.slice($,I);H.push(""),this.applyDelta({start:this.pos(L+$,D),end:this.pos(L+I,D=0),action:a.action,lines:H},!0)}a.lines=g.slice($),a.start.row=L+$,a.start.column=D,this.applyDelta(a,!0)},o.prototype.revertDelta=function(a){this.$safeApplyDelta({start:this.clonePos(a.start),end:this.clonePos(a.end),action:a.action=="insert"?"remove":"insert",lines:a.lines.slice()})},o.prototype.indexToPosition=function(a,f){for(var g=this.$lines||this.getAllLines(),y=this.getNewLineCharacter().length,L=f||0,D=g.length;L<D;L++)if(a-=g[L].length+y,a<0)return{row:L,column:a+g[L].length+y};return{row:D-1,column:a+g[D-1].length+y}},o.prototype.positionToIndex=function(a,f){for(var g=this.$lines||this.getAllLines(),y=this.getNewLineCharacter().length,L=0,D=Math.min(a.row,g.length),$=f||0;$<D;++$)L+=g[$].length+y;return L+a.column},o}();l.prototype.$split="aaa".split(/a/).length===0?function(o){return o.replace(/\r\n|\r/g,`
`).split(`
`)}:function(o){return o.split(/\r\n|\r|\n/)},l.prototype.$autoNewLine="",l.prototype.$newLineMode="auto",v.implement(l.prototype,i),b.Document=l}),ace.define("ace/lib/lang",[],function(m,b,q){"use strict";b.last=function(i){return i[i.length-1]},b.stringReverse=function(i){return i.split("").reverse().join("")},b.stringRepeat=function(i,n){for(var r="";n>0;)n&1&&(r+=i),(n>>=1)&&(i+=i);return r};var v=/^\s\s*/,c=/\s\s*$/;b.stringTrimLeft=function(i){return i.replace(v,"")},b.stringTrimRight=function(i){return i.replace(c,"")},b.copyObject=function(i){var n={};for(var r in i)n[r]=i[r];return n},b.copyArray=function(i){for(var n=[],r=0,l=i.length;r<l;r++)i[r]&&typeof i[r]=="object"?n[r]=this.copyObject(i[r]):n[r]=i[r];return n},b.deepCopy=function i(n){if(typeof n!="object"||!n)return n;var r;if(Array.isArray(n)){r=[];for(var l=0;l<n.length;l++)r[l]=i(n[l]);return r}if(Object.prototype.toString.call(n)!=="[object Object]")return n;r={};for(var l in n)r[l]=i(n[l]);return r},b.arrayToMap=function(i){for(var n={},r=0;r<i.length;r++)n[i[r]]=1;return n},b.createMap=function(i){var n=Object.create(null);for(var r in i)n[r]=i[r];return n},b.arrayRemove=function(i,n){for(var r=0;r<=i.length;r++)n===i[r]&&i.splice(r,1)},b.escapeRegExp=function(i){return i.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},b.escapeHTML=function(i){return(""+i).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},b.getMatchOffsets=function(i,n){var r=[];return i.replace(n,function(l){r.push({offset:arguments[arguments.length-2],length:l.length})}),r},b.deferredCall=function(i){var n=null,r=function(){n=null,i()},l=function(o){return l.cancel(),n=setTimeout(r,o||0),l};return l.schedule=l,l.call=function(){return this.cancel(),i(),l},l.cancel=function(){return clearTimeout(n),n=null,l},l.isPending=function(){return n},l},b.delayedCall=function(i,n){var r=null,l=function(){r=null,i()},o=function(a){r==null&&(r=setTimeout(l,a||n))};return o.delay=function(a){r&&clearTimeout(r),r=setTimeout(l,a||n)},o.schedule=o,o.call=function(){this.cancel(),i()},o.cancel=function(){r&&clearTimeout(r),r=null},o.isPending=function(){return r},o}}),ace.define("ace/worker/mirror",[],function(m,b,q){"use strict";var v=m("../document").Document,c=m("../lib/lang"),i=b.Mirror=function(n){this.sender=n;var r=this.doc=new v(""),l=this.deferredUpdate=c.delayedCall(this.onUpdate.bind(this)),o=this;n.on("change",function(a){var f=a.data;if(f[0].start)r.applyDeltas(f);else for(var g=0;g<f.length;g+=2){var y,L;if(Array.isArray(f[g+1])?y={action:"insert",start:f[g],lines:f[g+1]}:y={action:"remove",start:f[g],end:f[g+1]},(y.action=="insert"?y.start:y.end).row>=r.$lines.length)throw L=new Error("Invalid delta"),L.data={path:o.$path,linesLength:r.$lines.length,start:y.start,end:y.end},L;r.applyDelta(y,!0)}if(o.$timeout)return l.schedule(o.$timeout);o.onUpdate()})};(function(){this.$timeout=500,this.setTimeout=function(n){this.$timeout=n},this.setValue=function(n){this.doc.setValue(n),this.deferredUpdate.schedule(this.$timeout)},this.getValue=function(n){this.sender.callback(this.doc.getValue(),n)},this.onUpdate=function(){},this.isPending=function(){return this.deferredUpdate.isPending()}}).call(i.prototype)}),ace.define("ace/mode/lua/luaparse",[],function(m,b,q){(function(v,c,i){i(b)})(this,"luaparse",function(v){"use strict";v.version="0.3.1";var c,i,n,r,l,o=v.defaultOptions={wait:!1,comments:!0,scope:!1,locations:!1,ranges:!1,onCreateNode:null,onCreateScope:null,onDestroyScope:null,onLocalDeclaration:null,luaVersion:"5.3",encodingMode:"none"};function a(e,t){return t=t||0,e<128?String.fromCharCode(e):e<2048?String.fromCharCode(t|192|e>>6,t|128|e&63):e<65536?String.fromCharCode(t|224|e>>12,t|128|e>>6&63,t|128|e&63):e<1114112?String.fromCharCode(t|240|e>>18,t|128|e>>12&63,t|128|e>>6&63,t|128|e&63):null}function f(e,t){for(var s=e.toString(16);s.length<t;)s="0"+s;return s}function g(e){return function(t){var s=e.exec(t);if(!s)return t;A(null,w.invalidCodeUnit,f(s[0].charCodeAt(0),4).toUpperCase())}}var y={"pseudo-latin1":{fixup:g(/[^\x00-\xff]/),encodeByte:function(e){return e===null?"":String.fromCharCode(e)},encodeUTF8:function(e){return a(e)}},"x-user-defined":{fixup:g(/[^\x00-\x7f\uf780-\uf7ff]/),encodeByte:function(e){return e===null?"":e>=128?String.fromCharCode(e|63232):String.fromCharCode(e)},encodeUTF8:function(e){return a(e,63232)}},none:{discardStrings:!0,fixup:function(e){return e},encodeByte:function(e){return""},encodeUTF8:function(e){return""}}},L=1,D=2,$=4,I=8,H=16,K=32,se=64,oe=128,ue=256;v.tokenTypes={EOF:L,StringLiteral:D,Keyword:$,Identifier:I,NumericLiteral:H,Punctuator:K,BooleanLiteral:se,NilLiteral:oe,VarargLiteral:ue};var w=v.errors={unexpected:"unexpected %1 '%2' near '%3'",unexpectedEOF:"unexpected symbol near '<eof>'",expected:"'%1' expected near '%2'",expectedToken:"%1 expected near '%2'",unfinishedString:"unfinished string near '%1'",malformedNumber:"malformed number near '%1'",decimalEscapeTooLarge:"decimal escape too large near '%1'",invalidEscape:"invalid escape sequence near '%1'",hexadecimalDigitExpected:"hexadecimal digit expected near '%1'",braceExpected:"missing '%1' near '%2'",tooLargeCodepoint:"UTF-8 value too large near '%1'",unfinishedLongString:"unfinished long string (starting at line %1) near '%2'",unfinishedLongComment:"unfinished long comment (starting at line %1) near '%2'",ambiguousSyntax:"ambiguous syntax (function call x new statement) near '%1'",noLoopToBreak:"no loop to break near '%1'",labelAlreadyDefined:"label '%1' already defined on line %2",labelNotVisible:"no visible label '%1' for <goto>",gotoJumpInLocalScope:"<goto %1> jumps into the scope of local '%2'",cannotUseVararg:"cannot use '...' outside a vararg function near '%1'",invalidCodeUnit:"code unit U+%1 is not allowed in the current encoding mode"},x=v.ast={labelStatement:function(e){return{type:"LabelStatement",label:e}},breakStatement:function(){return{type:"BreakStatement"}},gotoStatement:function(e){return{type:"GotoStatement",label:e}},returnStatement:function(e){return{type:"ReturnStatement",arguments:e}},ifStatement:function(e){return{type:"IfStatement",clauses:e}},ifClause:function(e,t){return{type:"IfClause",condition:e,body:t}},elseifClause:function(e,t){return{type:"ElseifClause",condition:e,body:t}},elseClause:function(e){return{type:"ElseClause",body:e}},whileStatement:function(e,t){return{type:"WhileStatement",condition:e,body:t}},doStatement:function(e){return{type:"DoStatement",body:e}},repeatStatement:function(e,t){return{type:"RepeatStatement",condition:e,body:t}},localStatement:function(e,t){return{type:"LocalStatement",variables:e,init:t}},assignmentStatement:function(e,t){return{type:"AssignmentStatement",variables:e,init:t}},callStatement:function(e){return{type:"CallStatement",expression:e}},functionStatement:function(e,t,s,p){return{type:"FunctionDeclaration",identifier:e,isLocal:s,parameters:t,body:p}},forNumericStatement:function(e,t,s,p,h){return{type:"ForNumericStatement",variable:e,start:t,end:s,step:p,body:h}},forGenericStatement:function(e,t,s){return{type:"ForGenericStatement",variables:e,iterators:t,body:s}},chunk:function(e){return{type:"Chunk",body:e}},identifier:function(e){return{type:"Identifier",name:e}},literal:function(e,t,s){return e=e===D?"StringLiteral":e===H?"NumericLiteral":e===se?"BooleanLiteral":e===oe?"NilLiteral":"VarargLiteral",{type:e,value:t,raw:s}},tableKey:function(e,t){return{type:"TableKey",key:e,value:t}},tableKeyString:function(e,t){return{type:"TableKeyString",key:e,value:t}},tableValue:function(e){return{type:"TableValue",value:e}},tableConstructorExpression:function(e){return{type:"TableConstructorExpression",fields:e}},binaryExpression:function(e,t,s){var p=e==="and"||e==="or"?"LogicalExpression":"BinaryExpression";return{type:p,operator:e,left:t,right:s}},unaryExpression:function(e,t){return{type:"UnaryExpression",operator:e,argument:t}},memberExpression:function(e,t,s){return{type:"MemberExpression",indexer:t,identifier:s,base:e}},indexExpression:function(e,t){return{type:"IndexExpression",base:e,index:t}},callExpression:function(e,t){return{type:"CallExpression",base:e,arguments:t}},tableCallExpression:function(e,t){return{type:"TableCallExpression",base:e,arguments:t}},stringCallExpression:function(e,t){return{type:"StringCallExpression",base:e,argument:t}},comment:function(e,t){return{type:"Comment",value:e,raw:t}}};function E(e){if(U){var t=j.pop();t.complete(),t.bless(e)}return i.onCreateNode&&i.onCreateNode(e),e}var Se=Array.prototype.slice,Et=Object.prototype.toString,Le=function(e,t){for(var s=0,p=e.length;s<p;++s)if(e[s]===t)return s;return-1};Array.prototype.indexOf&&(Le=function(e,t){return e.indexOf(t)});function He(e,t,s){for(var p=0,h=e.length;p<h;++p)if(e[p][t]===s)return p;return-1}function ce(e){var t=Se.call(arguments,1);return e=e.replace(/%(\d)/g,function(s,p){return""+t[p-1]||""}),e}var xe=function(e){for(var t=Se.call(arguments,1),s,p,h=0,S=t.length;h<S;++h){s=t[h];for(p in s)Object.prototype.hasOwnProperty.call(s,p)&&(e[p]=s[p])}return e};Object.assign&&(xe=Object.assign),v.SyntaxError=SyntaxError;function Te(e){return Object.create?Object.create(e,{line:{writable:!0,value:e.line},index:{writable:!0,value:e.index},column:{writable:!0,value:e.column}}):e}function A(e){var t=ce.apply(null,Se.call(arguments,1)),s,p;throw e===null||typeof e.line=="undefined"?(p=u-V+1,s=Te(new SyntaxError(ce("[%1:%2] %3",R,p,t))),s.index=u,s.line=R,s.column=p):(p=e.range[0]-e.lineStart,s=Te(new SyntaxError(ce("[%1:%2] %3",e.line,p,t))),s.line=e.line,s.index=e.range[0],s.column=p),s}function le(e){var t=c.slice(e.range[0],e.range[1]);return t||e.value}function ee(e,t){A(t,w.expectedToken,e,le(t))}function fe(e){var t=le(te);if(typeof e.type!="undefined"){var s;switch(e.type){case D:s="string";break;case $:s="keyword";break;case I:s="identifier";break;case H:s="number";break;case K:s="symbol";break;case se:s="boolean";break;case oe:return A(e,w.unexpected,"symbol","nil",t);case L:return A(e,w.unexpectedEOF)}return A(e,w.unexpected,s,le(e),t)}return A(e,w.unexpected,"symbol",e,t)}var u,d,G,te,Ee,T,R,V;v.lex=we;function we(){for(Ae();c.charCodeAt(u)===45&&c.charCodeAt(u+1)===45;)tt(),Ae();if(u>=n)return{type:L,value:"<eof>",line:R,lineStart:V,range:[u,u]};var e=c.charCodeAt(u),t=c.charCodeAt(u+1);if(T=u,nt(e))return Ge();switch(e){case 39:case 34:return We();case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return Ce();case 46:return Y(t)?Ce():t===46?c.charCodeAt(u+2)===46?Ke():F(".."):F(".");case 61:return F(t===61?"==":"=");case 62:return r.bitwiseOperators&&t===62?F(">>"):F(t===61?">=":">");case 60:return r.bitwiseOperators&&t===60?F("<<"):F(t===61?"<=":"<");case 126:if(t===61)return F("~=");if(!r.bitwiseOperators)break;return F("~");case 58:return r.labels&&t===58?F("::"):F(":");case 91:return t===91||t===61?ze():F("[");case 47:return r.integerDivision&&t===47?F("//"):F("/");case 38:case 124:if(!r.bitwiseOperators)break;case 42:case 94:case 37:case 44:case 123:case 125:case 93:case 40:case 41:case 59:case 35:case 45:case 43:return F(c.charAt(u))}return fe(c.charAt(u))}function ge(){var e=c.charCodeAt(u),t=c.charCodeAt(u+1);return pe(e)?(e===10&&t===13&&++u,e===13&&t===10&&++u,++R,V=++u,!0):!1}function Ae(){for(;u<n;){var e=c.charCodeAt(u);if(rt(e))++u;else if(!ge())break}}function Ge(){for(var e,t;it(c.charCodeAt(++u)););return e=l.fixup(c.slice(T,u)),at(e)?t=$:e==="true"||e==="false"?(t=se,e=e==="true"):e==="nil"?(t=oe,e=null):t=I,{type:t,value:e,line:R,lineStart:V,range:[T,u]}}function F(e){return u+=e.length,{type:K,value:e,line:R,lineStart:V,range:[T,u]}}function Ke(){return u+=3,{type:ue,value:"...",line:R,lineStart:V,range:[T,u]}}function We(){for(var e=c.charCodeAt(u++),t=R,s=V,p=u,h=l.discardStrings?null:"",S;S=c.charCodeAt(u++),e!==S;)if((u>n||pe(S))&&(h+=c.slice(p,u-1),A(null,w.unfinishedString,c.slice(T,u-1))),S===92){if(!l.discardStrings){var k=c.slice(p,u-1);h+=l.fixup(k)}var C=et();l.discardStrings||(h+=C),p=u}return l.discardStrings||(h+=l.encodeByte(null),h+=l.fixup(c.slice(p,u-1))),{type:D,value:h,line:t,lineStart:s,lastLine:R,lastLineStart:V,range:[T,u]}}function ze(){var e=R,t=V,s=_e(!1);return s===!1&&A(d,w.expected,"[",le(d)),{type:D,value:l.discardStrings?null:l.fixup(s),line:e,lineStart:t,lastLine:R,lastLineStart:V,range:[T,u]}}function Ce(){var e=c.charAt(u),t=c.charAt(u+1),s=e==="0"&&"xX".indexOf(t||null)>=0?Xe():Ye(),p=Je(),h=Qe();return h&&(p||s.hasFractionPart)&&A(null,w.malformedNumber,c.slice(T,u)),{type:H,value:s.value,line:R,lineStart:V,range:[T,u]}}function Je(){if(!!r.imaginaryNumbers)return"iI".indexOf(c.charAt(u)||null)>=0?(++u,!0):!1}function Qe(){if(!!r.integerSuffixes){if("uU".indexOf(c.charAt(u)||null)>=0)if(++u,"lL".indexOf(c.charAt(u)||null)>=0){if(++u,"lL".indexOf(c.charAt(u)||null)>=0)return++u,"ULL";A(null,w.malformedNumber,c.slice(T,u))}else A(null,w.malformedNumber,c.slice(T,u));else if("lL".indexOf(c.charAt(u)||null)>=0){if(++u,"lL".indexOf(c.charAt(u)||null)>=0)return++u,"LL";A(null,w.malformedNumber,c.slice(T,u))}}}function Xe(){var e=0,t=1,s=1,p,h,S,k;for(k=u+=2,re(c.charCodeAt(u))||A(null,w.malformedNumber,c.slice(T,u));re(c.charCodeAt(u));)++u;p=parseInt(c.slice(k,u),16);var C=!1;if(c.charAt(u)==="."){for(C=!0,h=++u;re(c.charCodeAt(u));)++u;e=c.slice(h,u),e=h===u?0:parseInt(e,16)/Math.pow(16,u-h)}var de=!1;if("pP".indexOf(c.charAt(u)||null)>=0){for(de=!0,++u,"+-".indexOf(c.charAt(u)||null)>=0&&(s=c.charAt(u++)==="+"?1:-1),S=u,Y(c.charCodeAt(u))||A(null,w.malformedNumber,c.slice(T,u));Y(c.charCodeAt(u));)++u;t=c.slice(S,u),t=Math.pow(2,t*s)}return{value:(p+e)*t,hasFractionPart:C||de}}function Ye(){for(;Y(c.charCodeAt(u));)++u;var e=!1;if(c.charAt(u)===".")for(e=!0,++u;Y(c.charCodeAt(u));)++u;var t=!1;if("eE".indexOf(c.charAt(u)||null)>=0)for(t=!0,++u,"+-".indexOf(c.charAt(u)||null)>=0&&++u,Y(c.charCodeAt(u))||A(null,w.malformedNumber,c.slice(T,u));Y(c.charCodeAt(u));)++u;return{value:parseFloat(c.slice(T,u)),hasFractionPart:e||t}}function Ze(){var e=u++;for(c.charAt(u++)!=="{"&&A(null,w.braceExpected,"{","\\"+c.slice(e,u)),re(c.charCodeAt(u))||A(null,w.hexadecimalDigitExpected,"\\"+c.slice(e,u));c.charCodeAt(u)===48;)++u;for(var t=u;re(c.charCodeAt(u));)++u,u-t>6&&A(null,w.tooLargeCodepoint,"\\"+c.slice(e,u));var s=c.charAt(u++);s!=="}"&&(s==='"'||s==="'"?A(null,w.braceExpected,"}","\\"+c.slice(e,u--)):A(null,w.hexadecimalDigitExpected,"\\"+c.slice(e,u)));var p=parseInt(c.slice(t,u-1)||"0",16),h="\\"+c.slice(e,u);return p>1114111&&A(null,w.tooLargeCodepoint,h),l.encodeUTF8(p,h)}function et(){var e=u;switch(c.charAt(u)){case"a":return++u,"\x07";case"n":return++u,`
`;case"r":return++u,"\r";case"t":return++u," ";case"v":return++u,"\v";case"b":return++u,"\b";case"f":return++u,"\f";case"\r":case`
`:return ge(),`
`;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;Y(c.charCodeAt(u))&&u-e<3;)++u;var t=c.slice(e,u),s=parseInt(t,10);return s>255&&A(null,w.decimalEscapeTooLarge,"\\"+s),l.encodeByte(s,"\\"+t);case"z":if(r.skipWhitespaceEscape)return++u,Ae(),"";break;case"x":if(r.hexEscapes){if(re(c.charCodeAt(u+1))&&re(c.charCodeAt(u+2)))return u+=3,l.encodeByte(parseInt(c.slice(e+1,u),16),"\\"+c.slice(e,u));A(null,w.hexadecimalDigitExpected,"\\"+c.slice(e,u+2))}break;case"u":if(r.unicodeEscapes)return Ze();break;case"\\":case'"':case"'":return c.charAt(u++)}return r.strictEscapes&&A(null,w.invalidEscape,"\\"+c.slice(e,u+1)),c.charAt(u++)}function tt(){T=u,u+=2;var e=c.charAt(u),t="",s=!1,p=u,h=V,S=R;if(e==="["&&(t=_e(!0),t===!1?t=e:s=!0),!s){for(;u<n&&!pe(c.charCodeAt(u));)++u;i.comments&&(t=c.slice(p,u))}if(i.comments){var k=x.comment(t,c.slice(T,u));i.locations&&(k.loc={start:{line:S,column:T-h},end:{line:R,column:u-V}}),i.ranges&&(k.range=[T,u]),i.onCreateNode&&i.onCreateNode(k),Ee.push(k)}}function _e(e){var t=0,s="",p=!1,h,S,k=R;for(++u;c.charAt(u+t)==="=";)++t;if(c.charAt(u+t)!=="[")return!1;for(u+=t+1,pe(c.charCodeAt(u))&&ge(),S=u;u<n;){for(;pe(c.charCodeAt(u));)ge();if(h=c.charAt(u++),h==="]"){p=!0;for(var C=0;C<t;++C)c.charAt(u+C)!=="="&&(p=!1);c.charAt(u+t)!=="]"&&(p=!1)}if(p)return s+=c.slice(S,u-1),u+=t+1,s}A(null,e?w.unfinishedLongComment:w.unfinishedLongString,k,"<eof>")}function P(){G=d,d=te,te=we()}function M(e){return e===d.value?(P(),!0):!1}function O(e){e===d.value?P():A(d,w.expected,e,le(d))}function rt(e){return e===9||e===32||e===11||e===12}function pe(e){return e===10||e===13}function Y(e){return e>=48&&e<=57}function re(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function nt(e){return!!(e>=65&&e<=90||e>=97&&e<=122||e===95||r.extendedIdentifiers&&e>=128)}function it(e){return!!(e>=65&&e<=90||e>=97&&e<=122||e===95||e>=48&&e<=57||r.extendedIdentifiers&&e>=128)}function at(e){switch(e.length){case 2:return e==="do"||e==="if"||e==="in"||e==="or";case 3:return e==="and"||e==="end"||e==="for"||e==="not";case 4:return e==="else"||e==="then"?!0:r.labels&&!r.contextualGoto?e==="goto":!1;case 5:return e==="break"||e==="local"||e==="until"||e==="while";case 6:return e==="elseif"||e==="repeat"||e==="return";case 8:return e==="function"}return!1}function st(e){return K===e.type?"#-~".indexOf(e.value)>=0:$===e.type?e.value==="not":!1}function ot(e){if(L===e.type)return!0;if($!==e.type)return!1;switch(e.value){case"else":case"elseif":case"end":case"until":return!0;default:return!1}}var ne,ie,ve;function W(){var e=ne[ie++].slice();ne.push(e),i.onCreateScope&&i.onCreateScope()}function z(){var e=ne.pop();--ie,i.onDestroyScope&&i.onDestroyScope()}function De(e){i.onLocalDeclaration&&i.onLocalDeclaration(e),Le(ne[ie],e)===-1&&ne[ie].push(e)}function he(e){De(e.name),me(e,!0)}function me(e,t){!t&&He(ve,"name",e.name)===-1&&ve.push(e),e.isLocal=t}function Pe(e){return Le(ne[ie],e)!==-1}var j=[],U;function Q(){return new ye(d)}function ye(e){i.locations&&(this.loc={start:{line:e.line,column:e.range[0]-e.lineStart},end:{line:0,column:0}}),i.ranges&&(this.range=[e.range[0],0])}ye.prototype.complete=function(){i.locations&&(this.loc.end.line=G.lastLine||G.line,this.loc.end.column=G.range[1]-(G.lastLineStart||G.lineStart)),i.ranges&&(this.range[1]=G.range[1])},ye.prototype.bless=function(e){if(this.loc){var t=this.loc;e.loc={start:{line:t.start.line,column:t.start.column},end:{line:t.end.line,column:t.end.column}}}this.range&&(e.range=[this.range[0],this.range[1]])};function ae(){U&&j.push(Q())}function B(e){U&&j.push(e)}function X(){this.scopes=[],this.pendingGotos=[]}X.prototype.isInLoop=function(){for(var e=this.scopes.length;e-- >0;)if(this.scopes[e].isLoop)return!0;return!1},X.prototype.pushScope=function(e){var t={labels:{},locals:[],deferredGotos:[],isLoop:!!e};this.scopes.push(t)},X.prototype.popScope=function(){for(var e=0;e<this.pendingGotos.length;++e){var t=this.pendingGotos[e];t.maxDepth>=this.scopes.length&&--t.maxDepth<=0&&A(t.token,w.labelNotVisible,t.target)}this.scopes.pop()},X.prototype.addGoto=function(e,t){for(var s=[],p=0;p<this.scopes.length;++p){var h=this.scopes[p];if(s.push(h.locals.length),Object.prototype.hasOwnProperty.call(h.labels,e))return}this.pendingGotos.push({maxDepth:this.scopes.length,target:e,token:t,localCounts:s})},X.prototype.addLabel=function(e,t){var s=this.currentScope();if(Object.prototype.hasOwnProperty.call(s.labels,e))A(t,w.labelAlreadyDefined,e,s.labels[e].line);else{for(var p=[],h=0;h<this.pendingGotos.length;++h){var S=this.pendingGotos[h];if(S.maxDepth>=this.scopes.length&&S.target===e){S.localCounts[this.scopes.length-1]<s.locals.length&&s.deferredGotos.push(S);continue}p.push(S)}this.pendingGotos=p}s.labels[e]={localCount:s.locals.length,line:t.line}},X.prototype.addLocal=function(e,t){this.currentScope().locals.push({name:e,token:t})},X.prototype.currentScope=function(){return this.scopes[this.scopes.length-1]},X.prototype.raiseDeferredErrors=function(){for(var e=this.currentScope(),t=e.deferredGotos,s=0;s<t.length;++s){var p=t[s];A(p.token,w.gotoJumpInLocalScope,p.target,e.locals[p.localCounts[this.scopes.length-1]].name)}};function Z(){this.level=0,this.loopLevels=[]}Z.prototype.isInLoop=function(){return!!this.loopLevels.length},Z.prototype.pushScope=function(e){++this.level,e&&this.loopLevels.push(this.level)},Z.prototype.popScope=function(){var e=this.loopLevels,t=e.length;t&&e[t-1]===this.level&&e.pop(),--this.level},Z.prototype.addGoto=Z.prototype.addLabel=function(){throw new Error("This should never happen")},Z.prototype.addLocal=Z.prototype.raiseDeferredErrors=function(){};function Ie(){return r.labels?new X:new Z}function ut(){P(),ae(),i.scope&&W();var e=Ie();e.allowVararg=!0,e.pushScope();var t=J(e);return e.popScope(),i.scope&&z(),L!==d.type&&fe(d),U&&!t.length&&(G=d),E(x.chunk(t))}function J(e){for(var t=[],s;!ot(d);){if(d.value==="return"||!r.relaxedBreak&&d.value==="break"){t.push(Fe(e));break}s=Fe(e),M(";"),s&&t.push(s)}return t}function Fe(e){if(ae(),K===d.type&&M("::"))return ct(e);if(r.emptyStatement&&M(";")){U&&j.pop();return}if(e.raiseDeferredErrors(),$===d.type)switch(d.value){case"local":return P(),vt(e);case"if":return P(),dt(e);case"return":return P(),mt(e);case"function":P();var t=bt();return ke(t);case"while":return P(),pt(e);case"for":return P(),gt(e);case"repeat":return P(),ht(e);case"break":return P(),e.isInLoop()||A(d,w.noLoopToBreak,d.value),lt();case"do":return P(),ft(e);case"goto":return P(),Ue(e)}return r.contextualGoto&&d.type===I&&d.value==="goto"&&te.type===I&&te.value!=="goto"?(P(),Ue(e)):(U&&j.pop(),yt(e))}function ct(e){var t=d,s=N();return i.scope&&(De("::"+t.value+"::"),me(s,!0)),O("::"),e.addLabel(t.value,t),E(x.labelStatement(s))}function lt(){return E(x.breakStatement())}function Ue(e){var t=d.value,s=G,p=N();return e.addGoto(t,s),E(x.gotoStatement(p))}function ft(e){i.scope&&W(),e.pushScope();var t=J(e);return e.popScope(),i.scope&&z(),O("end"),E(x.doStatement(t))}function pt(e){var t=_(e);O("do"),i.scope&&W(),e.pushScope(!0);var s=J(e);return e.popScope(),i.scope&&z(),O("end"),E(x.whileStatement(t,s))}function ht(e){i.scope&&W(),e.pushScope(!0);var t=J(e);O("until"),e.raiseDeferredErrors();var s=_(e);return e.popScope(),i.scope&&z(),E(x.repeatStatement(s,t))}function mt(e){var t=[];if(d.value!=="end"){var s=be(e);for(s!=null&&t.push(s);M(",");)s=_(e),t.push(s);M(";")}return E(x.returnStatement(t))}function dt(e){var t=[],s,p,h;for(U&&(h=j[j.length-1],j.push(h)),s=_(e),O("then"),i.scope&&W(),e.pushScope(),p=J(e),e.popScope(),i.scope&&z(),t.push(E(x.ifClause(s,p))),U&&(h=Q());M("elseif");)B(h),s=_(e),O("then"),i.scope&&W(),e.pushScope(),p=J(e),e.popScope(),i.scope&&z(),t.push(E(x.elseifClause(s,p))),U&&(h=Q());return M("else")&&(U&&(h=new ye(G),j.push(h)),i.scope&&W(),e.pushScope(),p=J(e),e.popScope(),i.scope&&z(),t.push(E(x.elseClause(p)))),O("end"),E(x.ifStatement(t))}function gt(e){var t=N(),s;if(i.scope&&(W(),he(t)),M("=")){var p=_(e);O(",");var h=_(e),S=M(",")?_(e):null;return O("do"),e.pushScope(!0),s=J(e),e.popScope(),O("end"),i.scope&&z(),E(x.forNumericStatement(t,p,h,S,s))}else{for(var k=[t];M(",");)t=N(),i.scope&&he(t),k.push(t);O("in");var C=[];do{var de=_(e);C.push(de)}while(M(","));return O("do"),e.pushScope(!0),s=J(e),e.popScope(),O("end"),i.scope&&z(),E(x.forGenericStatement(k,C,s))}}function vt(e){var t,s=G;if(I===d.type){var p=[],h=[];do t=N(),p.push(t),e.addLocal(t.name,s);while(M(","));if(M("="))do{var S=_(e);h.push(S)}while(M(","));if(i.scope)for(var k=0,C=p.length;k<C;++k)he(p[k]);return E(x.localStatement(p,h))}if(M("function"))return t=N(),e.addLocal(t.name,s),i.scope&&(he(t),W()),ke(t,!0);ee("<name>",d)}function yt(e){var t=d,s,p,h,S,k,C=[];U&&(p=Q());do{if(U&&(s=Q()),I===d.type)k=d.value,S=N(),i.scope&&me(S,Pe(k)),h=!0;else if(d.value==="(")P(),S=_(e),O(")"),h=!1;else return fe(d);e:for(;;){var de;switch(D===d.type?'"':d.value){case".":case"[":h=!0;break;case":":case"(":case"{":case'"':h=null;break;default:break e}S=Ne(S,s,e)}if(C.push(S),d.value!==",")break;if(!h)return fe(d);P()}while(!0);if(C.length===1&&h===null)return B(s),E(x.callStatement(C[0]));if(!h)return fe(d);O("=");var je=[];do je.push(_(e));while(M(","));return B(p),E(x.assignmentStatement(C,je))}function N(){ae();var e=d.value;return I!==d.type&&ee("<name>",d),P(),E(x.identifier(e))}function ke(e,t){var s=Ie();s.pushScope();var p=[];if(O("("),!M(")"))for(;;){if(I===d.type){var h=N();if(i.scope&&he(h),p.push(h),M(","))continue}else ue===d.type?(s.allowVararg=!0,p.push($e(s))):ee("<name> or '...'",d);O(")");break}var S=J(s);return s.popScope(),O("end"),i.scope&&z(),t=t||!1,E(x.functionStatement(e,p,t,S))}function bt(){var e,t,s;for(U&&(s=Q()),e=N(),i.scope&&(me(e,Pe(e.name)),W());M(".");)B(s),t=N(),e=E(x.memberExpression(e,".",t));return M(":")&&(B(s),t=N(),e=E(x.memberExpression(e,":",t)),i.scope&&De("self")),e}function Re(e){for(var t=[],s,p;;){if(ae(),K===d.type&&M("["))s=_(e),O("]"),O("="),p=_(e),t.push(E(x.tableKey(s,p)));else if(I===d.type)te.value==="="?(s=N(),P(),p=_(e),t.push(E(x.tableKeyString(s,p)))):(p=_(e),t.push(E(x.tableValue(p))));else{if((p=be(e))==null){j.pop();break}t.push(E(x.tableValue(p)))}if(",;".indexOf(d.value)>=0){P();continue}break}return O("}"),E(x.tableConstructorExpression(t))}function be(e){var t=Oe(0,e);return t}function _(e){var t=be(e);if(t==null)ee("<expression>",d);else return t}function St(e){var t=e.charCodeAt(0),s=e.length;if(s===1)switch(t){case 94:return 12;case 42:case 47:case 37:return 10;case 43:case 45:return 9;case 38:return 6;case 126:return 5;case 124:return 4;case 60:case 62:return 3}else if(s===2)switch(t){case 47:return 10;case 46:return 8;case 60:case 62:return e==="<<"||e===">>"?7:3;case 61:case 126:return 3;case 111:return 1}else if(t===97&&e==="and")return 2;return 0}function Oe(e,t){var s=d.value,p,h;if(U&&(h=Q()),st(d)){ae(),P();var S=Oe(10,t);S==null&&ee("<expression>",d),p=E(x.unaryExpression(s,S))}if(p==null&&(p=$e(t),p==null&&(p=Lt(t))),p==null)return null;for(var k;s=d.value,k=K===d.type||$===d.type?St(s):0,!(k===0||k<=e);){(s==="^"||s==="..")&&--k,P();var C=Oe(k,t);C==null&&ee("<expression>",d),U&&j.push(h),p=E(x.binaryExpression(s,p,C))}return p}function Ne(e,t,s){var p,h;if(K===d.type)switch(d.value){case"[":return B(t),P(),p=_(s),O("]"),E(x.indexExpression(e,p));case".":return B(t),P(),h=N(),E(x.memberExpression(e,".",h));case":":return B(t),P(),h=N(),e=E(x.memberExpression(e,":",h)),B(t),Me(e,s);case"(":case"{":return B(t),Me(e,s)}else if(D===d.type)return B(t),Me(e,s);return null}function Lt(e){var t,s,p;if(U&&(p=Q()),I===d.type)s=d.value,t=N(),i.scope&&me(t,Pe(s));else if(M("("))t=_(e),O(")");else return null;for(;;){var h=Ne(t,p,e);if(h===null)break;t=h}return t}function Me(e,t){if(K===d.type)switch(d.value){case"(":r.emptyStatement||d.line!==G.line&&A(null,w.ambiguousSyntax,d.value),P();var s=[],p=be(t);for(p!=null&&s.push(p);M(",");)p=_(t),s.push(p);return O(")"),E(x.callExpression(e,s));case"{":ae(),P();var h=Re(t);return E(x.tableCallExpression(e,h))}else if(D===d.type)return E(x.stringCallExpression(e,$e(t)));ee("function arguments",d)}function $e(e){var t=D|H|se|oe|ue,s=d.value,p=d.type,h;if(U&&(h=Q()),p===ue&&!e.allowVararg&&A(d,w.cannotUseVararg,d.value),p&t){B(h);var S=c.slice(d.range[0],d.range[1]);return P(),E(x.literal(p,s,S))}else{if($===p&&s==="function")return B(h),P(),i.scope&&W(),ke(null);if(M("{"))return B(h),Re(e)}}v.parse=xt;var qe={"5.1":{},"5.2":{labels:!0,emptyStatement:!0,hexEscapes:!0,skipWhitespaceEscape:!0,strictEscapes:!0,relaxedBreak:!0},"5.3":{labels:!0,emptyStatement:!0,hexEscapes:!0,skipWhitespaceEscape:!0,strictEscapes:!0,unicodeEscapes:!0,bitwiseOperators:!0,integerDivision:!0,relaxedBreak:!0},LuaJIT:{labels:!0,contextualGoto:!0,hexEscapes:!0,skipWhitespaceEscape:!0,strictEscapes:!0,unicodeEscapes:!0,imaginaryNumbers:!0,integerSuffixes:!0}};function xt(e,t){if(typeof t=="undefined"&&typeof e=="object"&&(t=e,e=void 0),t||(t={}),c=e||"",i=xe({},o,t),u=0,R=1,V=0,n=c.length,ne=[[]],ie=0,ve=[],j=[],!Object.prototype.hasOwnProperty.call(qe,i.luaVersion))throw new Error(ce("Lua version '%1' not supported",i.luaVersion));if(r=xe({},qe[i.luaVersion]),i.extendedIdentifiers!==void 0&&(r.extendedIdentifiers=!!i.extendedIdentifiers),!Object.prototype.hasOwnProperty.call(y,i.encodingMode))throw new Error(ce("Encoding mode '%1' not supported",i.encodingMode));return l=y[i.encodingMode],i.comments&&(Ee=[]),i.wait?v:Be()}v.write=Ve;function Ve(e){return c+=String(e),n=c.length,v}v.end=Be;function Be(e){typeof e!="undefined"&&Ve(e),c&&c.substr(0,2)==="#!"&&(c=c.replace(/^.*/,function(s){return s.replace(/./g," ")})),n=c.length,U=i.locations||i.ranges,te=we();var t=ut();if(i.comments&&(t.comments=Ee),i.scope&&(t.globals=ve),j.length>0)throw new Error("Location tracking failed. This is most likely a bug in luaparse");return t}})}),ace.define("ace/mode/lua_worker",[],function(m,b,q){"use strict";var v=m("../lib/oop"),c=m("../worker/mirror").Mirror,i=m("../mode/lua/luaparse"),n=b.Worker=function(r){c.call(this,r),this.setTimeout(500)};v.inherits(n,c),function(){this.onUpdate=function(){var r=this.doc.getValue(),l=[];try{i.parse(r)}catch(o){o instanceof i.SyntaxError&&l.push({row:o.line-1,column:o.column,text:o.message,type:"error"})}this.sender.emit("annotate",l)}}.call(n.prototype)})}}]);