import{c as Et}from"./index-15e3682d.js";function At(h,y){for(var I=0;Id[s]})}}}return Object.freeze(Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}))}var Be={};(function(h){if(typeof h.window<"u"&&h.document||h.require&&h.define)return;h.console||(h.console=function(){var s=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:s})},h.console.error=h.console.warn=h.console.log=h.console.trace=h.console),h.window=h,h.ace=h,h.onerror=function(s,n,r,i,c){postMessage({type:"error",data:{message:s,data:c&&c.data,file:n,line:r,col:i,stack:c&&c.stack}})},h.normalizeModule=function(s,n){if(n.indexOf("!")!==-1){var r=n.split("!");return h.normalizeModule(s,r[0])+"!"+h.normalizeModule(s,r[1])}if(n.charAt(0)=="."){var i=s.split("/").slice(0,-1).join("/");for(n=(i?i+"/":"")+n;n.indexOf(".")!==-1&&c!=n;){var c=n;n=n.replace(/^\.\//,"").replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return n},h.require=function(n,r){if(r||(r=n,n=null),!r.charAt)throw new Error("worker.js require() accepts only (parentId, id) as arguments");r=h.normalizeModule(n,r);var i=h.require.modules[r];if(i)return i.initialized||(i.initialized=!0,i.exports=i.factory().exports),i.exports;if(!h.require.tlns)return console.log("unable to load "+r);var c=y(r,h.require.tlns);return c.slice(-3)!=".js"&&(c+=".js"),h.require.id=r,h.require.modules[r]={},importScripts(c),h.require(n,r)};function y(s,n){for(var r=s,i="";r;){var c=n[r];if(typeof c=="string")return c+i;if(c)return c.location.replace(/\/*$/,"/")+(i||c.main||c.name);if(c===!1)return"";var l=r.lastIndexOf("/");if(l===-1)break;i=r.substr(l)+i,r=r.slice(0,l)}return s}h.require.modules={},h.require.tlns={},h.define=function(s,n,r){if(arguments.length==2?(r=n,typeof s!="string"&&(n=s,s=h.require.id)):arguments.length==1&&(r=s,n=[],s=h.require.id),typeof r!="function"){h.require.modules[s]={exports:r,initialized:!0};return}n.length||(n=["require","exports","module"]);var i=function(c){return h.require(s,c)};h.require.modules[s]={exports:{},factory:function(){var c=this,l=r.apply(this,n.slice(0,r.length).map(function(a){switch(a){case"require":return i;case"exports":return c.exports;case"module":return c;default:return i(a)}}));return l&&(c.exports=l),c}}},h.define.amd={},h.require.tlns={},h.initBaseUrls=function(n){for(var r in n)this.require.tlns[r]=n[r]},h.initSender=function(){var n=h.require("ace/lib/event_emitter").EventEmitter,r=h.require("ace/lib/oop"),i=function(){};return function(){r.implement(this,n),this.callback=function(c,l){postMessage({type:"call",id:l,data:c})},this.emit=function(c,l){postMessage({type:"event",name:c,data:l})}}.call(i.prototype),new i};var I=h.main=null,d=h.sender=null;h.onmessage=function(s){var n=s.data;if(n.event&&d)d._signal(n.event,n.data);else if(n.command)if(I[n.command])I[n.command].apply(I,n.args);else if(h[n.command])h[n.command].apply(h,n.args);else throw new Error("Unknown command:"+n.command);else if(n.init){h.initBaseUrls(n.tlns),d=h.sender=h.initSender();var r=this.require(n.module)[n.classname];I=h.main=new r(d)}}})(Et);ace.define("ace/lib/oop",[],function(h,y,I){y.inherits=function(d,s){d.super_=s,d.prototype=Object.create(s.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}})},y.mixin=function(d,s){for(var n in s)d[n]=s[n];return d},y.implement=function(d,s){y.mixin(d,s)}});ace.define("ace/apply_delta",[],function(h,y,I){y.applyDelta=function(d,s,n){var r=s.start.row,i=s.start.column,c=d[r]||"";switch(s.action){case"insert":var l=s.lines;if(l.length===1)d[r]=c.substring(0,i)+s.lines[0]+c.substring(i);else{var a=[r,1].concat(s.lines);d.splice.apply(d,a),d[r]=c.substring(0,i)+d[r],d[r+s.lines.length-1]+=c.substring(i)}break;case"remove":var f=s.end.column,v=s.end.row;r===v?d[r]=c.substring(0,i)+c.substring(f):d.splice(r,v-r+1,c.substring(0,i)+d[v].substring(f));break}}});ace.define("ace/lib/event_emitter",[],function(h,y,I){var d={},s=function(){this.propagationStopped=!0},n=function(){this.defaultPrevented=!0};d._emit=d._dispatchEvent=function(r,i){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var c=this._eventRegistry[r]||[],l=this._defaultHandlers[r];if(!(!c.length&&!l)){(typeof i!="object"||!i)&&(i={}),i.type||(i.type=r),i.stopPropagation||(i.stopPropagation=s),i.preventDefault||(i.preventDefault=n),c=c.slice();for(var a=0;a ["+this.end.row+"/"+this.end.column+"]"},n.prototype.contains=function(r,i){return this.compare(r,i)==0},n.prototype.compareRange=function(r){var i,c=r.end,l=r.start;return i=this.compare(c.row,c.column),i==1?(i=this.compare(l.row,l.column),i==1?2:i==0?1:0):i==-1?-2:(i=this.compare(l.row,l.column),i==-1?-1:i==1?42:0)},n.prototype.comparePoint=function(r){return this.compare(r.row,r.column)},n.prototype.containsRange=function(r){return this.comparePoint(r.start)==0&&this.comparePoint(r.end)==0},n.prototype.intersects=function(r){var i=this.compareRange(r);return i==-1||i==0||i==1},n.prototype.isEnd=function(r,i){return this.end.row==r&&this.end.column==i},n.prototype.isStart=function(r,i){return this.start.row==r&&this.start.column==i},n.prototype.setStart=function(r,i){typeof r=="object"?(this.start.column=r.column,this.start.row=r.row):(this.start.row=r,this.start.column=i)},n.prototype.setEnd=function(r,i){typeof r=="object"?(this.end.column=r.column,this.end.row=r.row):(this.end.row=r,this.end.column=i)},n.prototype.inside=function(r,i){return this.compare(r,i)==0?!(this.isEnd(r,i)||this.isStart(r,i)):!1},n.prototype.insideStart=function(r,i){return this.compare(r,i)==0?!this.isEnd(r,i):!1},n.prototype.insideEnd=function(r,i){return this.compare(r,i)==0?!this.isStart(r,i):!1},n.prototype.compare=function(r,i){return!this.isMultiLine()&&r===this.start.row?ithis.end.column?1:0:rthis.end.row?1:this.start.row===r?i>=this.start.column?0:-1:this.end.row===r?i<=this.end.column?0:1:0},n.prototype.compareStart=function(r,i){return this.start.row==r&&this.start.column==i?-1:this.compare(r,i)},n.prototype.compareEnd=function(r,i){return this.end.row==r&&this.end.column==i?1:this.compare(r,i)},n.prototype.compareInside=function(r,i){return this.end.row==r&&this.end.column==i?1:this.start.row==r&&this.start.column==i?-1:this.compare(r,i)},n.prototype.clipRows=function(r,i){if(this.end.row>i)var c={row:i+1,column:0};else if(this.end.rowi)var l={row:i+1,column:0};else if(this.start.row"u"?this.setPosition(a.row,a.column):this.setPosition(a,f)}return c.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},c.prototype.getDocument=function(){return this.document},c.prototype.onChange=function(l){if(!(l.start.row==l.end.row&&l.start.row!=this.row)&&!(l.start.row>this.row)){var a=i(l,{row:this.row,column:this.column},this.$insertRight);this.setPosition(a.row,a.column,!0)}},c.prototype.setPosition=function(l,a,f){var v;if(f?v={row:l,column:a}:v=this.$clipPositionToDocument(l,a),!(this.row==v.row&&this.column==v.column)){var b={row:this.row,column:this.column};this.row=v.row,this.column=v.column,this._signal("change",{old:b,value:v})}},c.prototype.detach=function(){this.document.off("change",this.$onChange)},c.prototype.attach=function(l){this.document=l||this.document,this.document.on("change",this.$onChange)},c.prototype.$clipPositionToDocument=function(l,a){var f={};return l>=this.document.getLength()?(f.row=Math.max(0,this.document.getLength()-1),f.column=this.document.getLine(f.row).length):l<0?(f.row=0,f.column=0):(f.row=l,f.column=Math.min(this.document.getLine(f.row).length,Math.max(0,a))),a<0&&(f.column=0),f},c}();n.prototype.$insertRight=!1,d.implement(n.prototype,s);function r(c,l,a){var f=a?c.column<=l.column:c.column=v&&(a=v-1,f=void 0);var b=this.getLine(a);return f==null&&(f=b.length),f=Math.min(Math.max(f,0),b.length),{row:a,column:f}},l.prototype.clonePos=function(a){return{row:a.row,column:a.column}},l.prototype.pos=function(a,f){return{row:a,column:f}},l.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},l.prototype.insertFullLines=function(a,f){a=Math.min(Math.max(a,0),this.getLength());var v=0;a0,b=f=0&&this.applyDelta({start:this.pos(a,this.getLine(a).length),end:this.pos(a+1,0),action:"remove",lines:["",""]})},l.prototype.replace=function(a,f){if(a instanceof r||(a=r.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 v;return f?v=this.insert(a.start,f):v=a.start,v},l.prototype.applyDeltas=function(a){for(var f=0;f=0;f--)this.revertDelta(a[f])},l.prototype.applyDelta=function(a,f){var v=a.action=="insert";(v?a.lines.length<=1&&!a.lines[0]:!r.comparePoints(a.start,a.end))||(v&&a.lines.length>2e4?this.$splitAndapplyLargeDelta(a,2e4):(s(this.$lines,a,f),this._signal("change",a)))},l.prototype.$safeApplyDelta=function(a){var f=this.$lines.length;(a.action=="remove"&&a.start.row0;)r&1&&(i+=n),(r>>=1)&&(n+=n);return i};var d=/^\s\s*/,s=/\s\s*$/;y.stringTrimLeft=function(n){return n.replace(d,"")},y.stringTrimRight=function(n){return n.replace(s,"")},y.copyObject=function(n){var r={};for(var i in n)r[i]=n[i];return r},y.copyArray=function(n){for(var r=[],i=0,c=n.length;i=i.$lines.length)throw E=new Error("Invalid delta"),E.data={path:l.$path,linesLength:i.$lines.length,start:b.start,end:b.end},E;i.applyDelta(b,!0)}if(l.$timeout)return c.schedule(l.$timeout);l.onUpdate()})};(function(){this.$timeout=500,this.setTimeout=function(r){this.$timeout=r},this.setValue=function(r){this.doc.setValue(r),this.deferredUpdate.schedule(this.$timeout)},this.getValue=function(r){this.sender.callback(this.doc.getValue(),r)},this.onUpdate=function(){},this.isPending=function(){return this.deferredUpdate.isPending()}}).call(n.prototype)});ace.define("ace/mode/lua/luaparse",[],function(h,y,I){(function(d,s,n){n(y)})(this,"luaparse",function(d){d.version="0.3.1";var s,n,r,i,c,l=d.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 o=e.toString(16);o.length=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""}}},E=1,k=2,$=4,F=8,H=16,K=32,se=64,oe=128,ue=256;d.tokenTypes={EOF:E,StringLiteral:k,Keyword:$,Identifier:F,NumericLiteral:H,Punctuator:K,BooleanLiteral:se,NilLiteral:oe,VarargLiteral:ue};var A=d.errors={unexpected:"unexpected %1 '%2' near '%3'",unexpectedEOF:"unexpected symbol near ''",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 ",gotoJumpInLocalScope:" 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"},S=d.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,o,p){return{type:"FunctionDeclaration",identifier:e,isLocal:o,parameters:t,body:p}},forNumericStatement:function(e,t,o,p,m){return{type:"ForNumericStatement",variable:e,start:t,end:o,step:p,body:m}},forGenericStatement:function(e,t,o){return{type:"ForGenericStatement",variables:e,iterators:t,body:o}},chunk:function(e){return{type:"Chunk",body:e}},identifier:function(e){return{type:"Identifier",name:e}},literal:function(e,t,o){return e=e===k?"StringLiteral":e===H?"NumericLiteral":e===se?"BooleanLiteral":e===oe?"NilLiteral":"VarargLiteral",{type:e,value:t,raw:o}},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,o){var p=e==="and"||e==="or"?"LogicalExpression":"BinaryExpression";return{type:p,operator:e,left:t,right:o}},unaryExpression:function(e,t){return{type:"UnaryExpression",operator:e,argument:t}},memberExpression:function(e,t,o){return{type:"MemberExpression",indexer:t,identifier:o,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 L(e){if(N){var t=B.pop();t.complete(),t.bless(e)}return n.onCreateNode&&n.onCreateNode(e),e}var Se=Array.prototype.slice,Le=function(e,t){for(var o=0,p=e.length;o"u"?(p=u-V+1,o=Te(new SyntaxError(ce("[%1:%2] %3",R,p,t))),o.index=u,o.line=R,o.column=p):(p=e.range[0]-e.lineStart,o=Te(new SyntaxError(ce("[%1:%2] %3",e.line,p,t))),o.line=e.line,o.index=e.range[0],o.column=p),o}function le(e){var t=s.slice(e.range[0],e.range[1]);return t||e.value}function ee(e,t){w(t,A.expectedToken,e,le(t))}function fe(e){var t=le(te);if(typeof e.type<"u"){var o;switch(e.type){case k:o="string";break;case $:o="keyword";break;case F:o="identifier";break;case H:o="number";break;case K:o="symbol";break;case se:o="boolean";break;case oe:return w(e,A.unexpected,"symbol","nil",t);case E:return w(e,A.unexpectedEOF)}return w(e,A.unexpected,o,le(e),t)}return w(e,A.unexpected,"symbol",e,t)}var u,g,G,te,Ee,T,R,V;d.lex=Ae;function Ae(){for(we();s.charCodeAt(u)===45&&s.charCodeAt(u+1)===45;)tt(),we();if(u>=r)return{type:E,value:"",line:R,lineStart:V,range:[u,u]};var e=s.charCodeAt(u),t=s.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 _e();case 46:return Y(t)?_e():t===46?s.charCodeAt(u+2)===46?Ke():U(".."):U(".");case 61:return U(t===61?"==":"=");case 62:return i.bitwiseOperators&&t===62?U(">>"):U(t===61?">=":">");case 60:return i.bitwiseOperators&&t===60?U("<<"):U(t===61?"<=":"<");case 126:if(t===61)return U("~=");if(!i.bitwiseOperators)break;return U("~");case 58:return i.labels&&t===58?U("::"):U(":");case 91:return t===91||t===61?ze():U("[");case 47:return i.integerDivision&&t===47?U("//"):U("/");case 38:case 124:if(!i.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 U(s.charAt(u))}return fe(s.charAt(u))}function de(){var e=s.charCodeAt(u),t=s.charCodeAt(u+1);return pe(e)?(e===10&&t===13&&++u,e===13&&t===10&&++u,++R,V=++u,!0):!1}function we(){for(;ur||pe(x))&&(m+=s.slice(p,u-1),w(null,A.unfinishedString,s.slice(T,u-1))),x===92){if(!c.discardStrings){var P=s.slice(p,u-1);m+=c.fixup(P)}var C=et();c.discardStrings||(m+=C),p=u}return c.discardStrings||(m+=c.encodeByte(null),m+=c.fixup(s.slice(p,u-1))),{type:k,value:m,line:t,lineStart:o,lastLine:R,lastLineStart:V,range:[T,u]}}function ze(){var e=R,t=V,o=Ce(!1);return o===!1&&w(g,A.expected,"[",le(g)),{type:k,value:c.discardStrings?null:c.fixup(o),line:e,lineStart:t,lastLine:R,lastLineStart:V,range:[T,u]}}function _e(){var e=s.charAt(u),t=s.charAt(u+1),o=e==="0"&&"xX".indexOf(t||null)>=0?Xe():Ye(),p=Je(),m=Qe();return m&&(p||o.hasFractionPart)&&w(null,A.malformedNumber,s.slice(T,u)),{type:H,value:o.value,line:R,lineStart:V,range:[T,u]}}function Je(){if(i.imaginaryNumbers)return"iI".indexOf(s.charAt(u)||null)>=0?(++u,!0):!1}function Qe(){if(i.integerSuffixes){if("uU".indexOf(s.charAt(u)||null)>=0)if(++u,"lL".indexOf(s.charAt(u)||null)>=0){if(++u,"lL".indexOf(s.charAt(u)||null)>=0)return++u,"ULL";w(null,A.malformedNumber,s.slice(T,u))}else w(null,A.malformedNumber,s.slice(T,u));else if("lL".indexOf(s.charAt(u)||null)>=0){if(++u,"lL".indexOf(s.charAt(u)||null)>=0)return++u,"LL";w(null,A.malformedNumber,s.slice(T,u))}}}function Xe(){var e=0,t=1,o=1,p,m,x,P;for(P=u+=2,re(s.charCodeAt(u))||w(null,A.malformedNumber,s.slice(T,u));re(s.charCodeAt(u));)++u;p=parseInt(s.slice(P,u),16);var C=!1;if(s.charAt(u)==="."){for(C=!0,m=++u;re(s.charCodeAt(u));)++u;e=s.slice(m,u),e=m===u?0:parseInt(e,16)/Math.pow(16,u-m)}var be=!1;if("pP".indexOf(s.charAt(u)||null)>=0){for(be=!0,++u,"+-".indexOf(s.charAt(u)||null)>=0&&(o=s.charAt(u++)==="+"?1:-1),x=u,Y(s.charCodeAt(u))||w(null,A.malformedNumber,s.slice(T,u));Y(s.charCodeAt(u));)++u;t=s.slice(x,u),t=Math.pow(2,t*o)}return{value:(p+e)*t,hasFractionPart:C||be}}function Ye(){for(;Y(s.charCodeAt(u));)++u;var e=!1;if(s.charAt(u)===".")for(e=!0,++u;Y(s.charCodeAt(u));)++u;var t=!1;if("eE".indexOf(s.charAt(u)||null)>=0)for(t=!0,++u,"+-".indexOf(s.charAt(u)||null)>=0&&++u,Y(s.charCodeAt(u))||w(null,A.malformedNumber,s.slice(T,u));Y(s.charCodeAt(u));)++u;return{value:parseFloat(s.slice(T,u)),hasFractionPart:e||t}}function Ze(){var e=u++;for(s.charAt(u++)!=="{"&&w(null,A.braceExpected,"{","\\"+s.slice(e,u)),re(s.charCodeAt(u))||w(null,A.hexadecimalDigitExpected,"\\"+s.slice(e,u));s.charCodeAt(u)===48;)++u;for(var t=u;re(s.charCodeAt(u));)++u,u-t>6&&w(null,A.tooLargeCodepoint,"\\"+s.slice(e,u));var o=s.charAt(u++);o!=="}"&&(o==='"'||o==="'"?w(null,A.braceExpected,"}","\\"+s.slice(e,u--)):w(null,A.hexadecimalDigitExpected,"\\"+s.slice(e,u)));var p=parseInt(s.slice(t,u-1)||"0",16),m="\\"+s.slice(e,u);return p>1114111&&w(null,A.tooLargeCodepoint,m),c.encodeUTF8(p,m)}function et(){var e=u;switch(s.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 de(),` `;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;Y(s.charCodeAt(u))&&u-e<3;)++u;var t=s.slice(e,u),o=parseInt(t,10);return o>255&&w(null,A.decimalEscapeTooLarge,"\\"+o),c.encodeByte(o,"\\"+t);case"z":if(i.skipWhitespaceEscape)return++u,we(),"";break;case"x":if(i.hexEscapes){if(re(s.charCodeAt(u+1))&&re(s.charCodeAt(u+2)))return u+=3,c.encodeByte(parseInt(s.slice(e+1,u),16),"\\"+s.slice(e,u));w(null,A.hexadecimalDigitExpected,"\\"+s.slice(e,u+2))}break;case"u":if(i.unicodeEscapes)return Ze();break;case"\\":case'"':case"'":return s.charAt(u++)}return i.strictEscapes&&w(null,A.invalidEscape,"\\"+s.slice(e,u+1)),s.charAt(u++)}function tt(){T=u,u+=2;var e=s.charAt(u),t="",o=!1,p=u,m=V,x=R;if(e==="["&&(t=Ce(!0),t===!1?t=e:o=!0),!o){for(;u")}function D(){G=g,g=te,te=Ae()}function M(e){return e===g.value?(D(),!0):!1}function O(e){e===g.value?D():w(g,A.expected,e,le(g))}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||i.extendedIdentifiers&&e>=128)}function it(e){return!!(e>=65&&e<=90||e>=97&&e<=122||e===95||e>=48&&e<=57||i.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:i.labels&&!i.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(E===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,ge;function W(){var e=ne[ie++].slice();ne.push(e),n.onCreateScope&&n.onCreateScope()}function z(){ne.pop(),--ie,n.onDestroyScope&&n.onDestroyScope()}function Pe(e){n.onLocalDeclaration&&n.onLocalDeclaration(e),Le(ne[ie],e)===-1&&ne[ie].push(e)}function he(e){Pe(e.name),me(e,!0)}function me(e,t){!t&&He(ge,"name",e.name)===-1&&ge.push(e),e.isLocal=t}function De(e){return Le(ne[ie],e)!==-1}var B=[],N;function Q(){return new ve(g)}function ve(e){n.locations&&(this.loc={start:{line:e.line,column:e.range[0]-e.lineStart},end:{line:0,column:0}}),n.ranges&&(this.range=[e.range[0],0])}ve.prototype.complete=function(){n.locations&&(this.loc.end.line=G.lastLine||G.line,this.loc.end.column=G.range[1]-(G.lastLineStart||G.lineStart)),n.ranges&&(this.range[1]=G.range[1])},ve.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(){N&&B.push(Q())}function j(e){N&&B.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.scopes.length&&--t.maxDepth<=0&&w(t.token,A.labelNotVisible,t.target)}this.scopes.pop()},X.prototype.addGoto=function(e,t){for(var o=[],p=0;p=this.scopes.length&&x.target===e){x.localCounts[this.scopes.length-1]",g)}function yt(e){var t,o,p,m,x,P=[];N&&(o=Q());do{if(N&&(t=Q()),F===g.type)x=g.value,m=q(),n.scope&&me(m,De(x)),p=!0;else if(g.value==="(")D(),m=_(e),O(")"),p=!1;else return fe(g);e:for(;;){switch(k===g.type?'"':g.value){case".":case"[":p=!0;break;case":":case"(":case"{":case'"':p=null;break;default:break e}m=Re(m,t,e)}if(P.push(m),g.value!==",")break;if(!p)return fe(g);D()}while(!0);if(P.length===1&&p===null)return j(t),L(S.callStatement(P[0]));if(!p)return fe(g);O("=");var C=[];do C.push(_(e));while(M(","));return j(o),L(S.assignmentStatement(P,C))}function q(){ae();var e=g.value;return F!==g.type&&ee("",g),D(),L(S.identifier(e))}function Oe(e,t){var o=Ie();o.pushScope();var p=[];if(O("("),!M(")"))for(;;){if(F===g.type){var m=q();if(n.scope&&he(m),p.push(m),M(","))continue}else ue===g.type?(o.allowVararg=!0,p.push($e(o))):ee(" or '...'",g);O(")");break}var x=J(o);return o.popScope(),O("end"),n.scope&&z(),t=t||!1,L(S.functionStatement(e,p,t,x))}function bt(){var e,t,o;for(N&&(o=Q()),e=q(),n.scope&&(me(e,De(e.name)),W());M(".");)j(o),t=q(),e=L(S.memberExpression(e,".",t));return M(":")&&(j(o),t=q(),e=L(S.memberExpression(e,":",t)),n.scope&&Pe("self")),e}function Ne(e){for(var t=[],o,p;;){if(ae(),K===g.type&&M("["))o=_(e),O("]"),O("="),p=_(e),t.push(L(S.tableKey(o,p)));else if(F===g.type)te.value==="="?(o=q(),D(),p=_(e),t.push(L(S.tableKeyString(o,p)))):(p=_(e),t.push(L(S.tableValue(p))));else{if((p=ye(e))==null){B.pop();break}t.push(L(S.tableValue(p)))}if(",;".indexOf(g.value)>=0){D();continue}break}return O("}"),L(S.tableConstructorExpression(t))}function ye(e){var t=ke(0,e);return t}function _(e){var t=ye(e);if(t==null)ee("",g);else return t}function St(e){var t=e.charCodeAt(0),o=e.length;if(o===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(o===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 ke(e,t){var o=g.value,p,m;if(N&&(m=Q()),st(g)){ae(),D();var x=ke(10,t);x==null&&ee("",g),p=L(S.unaryExpression(o,x))}if(p==null&&(p=$e(t),p==null&&(p=Lt(t))),p==null)return null;for(var P;o=g.value,P=K===g.type||$===g.type?St(o):0,!(P===0||P<=e);){(o==="^"||o==="..")&&--P,D();var C=ke(P,t);C==null&&ee("",g),N&&B.push(m),p=L(S.binaryExpression(o,p,C))}return p}function Re(e,t,o){var p,m;if(K===g.type)switch(g.value){case"[":return j(t),D(),p=_(o),O("]"),L(S.indexExpression(e,p));case".":return j(t),D(),m=q(),L(S.memberExpression(e,".",m));case":":return j(t),D(),m=q(),e=L(S.memberExpression(e,":",m)),j(t),Me(e,o);case"(":case"{":return j(t),Me(e,o)}else if(k===g.type)return j(t),Me(e,o);return null}function Lt(e){var t,o,p;if(N&&(p=Q()),F===g.type)o=g.value,t=q(),n.scope&&me(t,De(o));else if(M("("))t=_(e),O(")");else return null;for(;;){var m=Re(t,p,e);if(m===null)break;t=m}return t}function Me(e,t){if(K===g.type)switch(g.value){case"(":i.emptyStatement||g.line!==G.line&&w(null,A.ambiguousSyntax,g.value),D();var o=[],p=ye(t);for(p!=null&&o.push(p);M(",");)p=_(t),o.push(p);return O(")"),L(S.callExpression(e,o));case"{":ae(),D();var m=Ne(t);return L(S.tableCallExpression(e,m))}else if(k===g.type)return L(S.stringCallExpression(e,$e(t)));ee("function arguments",g)}function $e(e){var t=k|H|se|oe|ue,o=g.value,p=g.type,m;if(N&&(m=Q()),p===ue&&!e.allowVararg&&w(g,A.cannotUseVararg,g.value),p&t){j(m);var x=s.slice(g.range[0],g.range[1]);return D(),L(S.literal(p,o,x))}else{if($===p&&o==="function")return j(m),D(),n.scope&&W(),Oe(null);if(M("{"))return j(m),Ne(e)}}d.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>"u"&&typeof e=="object"&&(t=e,e=void 0),t||(t={}),s=e||"",n=xe({},l,t),u=0,R=1,V=0,r=s.length,ne=[[]],ie=0,ge=[],B=[],!Object.prototype.hasOwnProperty.call(qe,n.luaVersion))throw new Error(ce("Lua version '%1' not supported",n.luaVersion));if(i=xe({},qe[n.luaVersion]),n.extendedIdentifiers!==void 0&&(i.extendedIdentifiers=!!n.extendedIdentifiers),!Object.prototype.hasOwnProperty.call(b,n.encodingMode))throw new Error(ce("Encoding mode '%1' not supported",n.encodingMode));return c=b[n.encodingMode],n.comments&&(Ee=[]),n.wait?d:je()}d.write=Ve;function Ve(e){return s+=String(e),r=s.length,d}d.end=je;function je(e){typeof e<"u"&&Ve(e),s&&s.substr(0,2)==="#!"&&(s=s.replace(/^.*/,function(o){return o.replace(/./g," ")})),r=s.length,N=n.locations||n.ranges,te=Ae();var t=ut();if(n.comments&&(t.comments=Ee),n.scope&&(t.globals=ge),B.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(h,y,I){var d=h("../lib/oop"),s=h("../worker/mirror").Mirror,n=h("../mode/lua/luaparse"),r=y.Worker=function(i){s.call(this,i),this.setTimeout(500)};d.inherits(r,s),function(){this.onUpdate=function(){var i=this.doc.getValue(),c=[];try{n.parse(i)}catch(l){l instanceof n.SyntaxError&&c.push({row:l.line-1,column:l.column,text:l.message,type:"error"})}this.sender.emit("annotate",c)}}.call(r.prototype)});const Pt=At({__proto__:null,default:Be},[Be]);export{Pt as w};