/*! For license information please see index.js.LICENSE.txt */ (()=>{var __webpack_modules__={"./node_modules/buffer-from/index.js":e=>{var t=Object.prototype.toString,r="undefined"!=typeof Buffer&&"function"==typeof Buffer.alloc&&"function"==typeof Buffer.allocUnsafe&&"function"==typeof Buffer.from;e.exports=function(e,n,i){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return a=e,"ArrayBuffer"===t.call(a).slice(8,-1)?function(e,t,n){t>>>=0;var i=e.byteLength-t;if(i<0)throw new RangeError("'offset' is out of bounds");if(void 0===n)n=i;else if((n>>>=0)>i)throw new RangeError("'length' is out of bounds");return r?Buffer.from(e.slice(t,t+n)):new Buffer(new Uint8Array(e.slice(t,t+n)))}(e,n,i):"string"==typeof e?function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!Buffer.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');return r?Buffer.from(e,t):new Buffer(e,t)}(e,n):r?Buffer.from(e):new Buffer(e);var a}},"./node_modules/source-map-support/node_modules/source-map/lib/array-set.js":(e,t,r)=>{var n=r("./node_modules/source-map-support/node_modules/source-map/lib/util.js"),i=Object.prototype.hasOwnProperty,a="undefined"!=typeof Map;function o(){this._array=[],this._set=a?new Map:Object.create(null)}o.fromArray=function(e,t){for(var r=new o,n=0,i=e.length;n=0)return t}else{var r=n.toSetString(e);if(i.call(this._set,r))return this._set[r]}throw new Error('"'+e+'" is not in the set.')},o.prototype.at=function(e){if(e>=0&&e{var n=r("./node_modules/source-map-support/node_modules/source-map/lib/base64.js");t.encode=function(e){var t,r="",i=function(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{t=31&i,(i>>>=5)>0&&(t|=32),r+=n.encode(t)}while(i>0);return r},t.decode=function(e,t,r){var i,a,o,s,c=e.length,l=0,u=0;do{if(t>=c)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(a=n.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));i=!!(32&a),l+=(a&=31)<>1,1==(1&o)?-s:s),r.rest=t}},"./node_modules/source-map-support/node_modules/source-map/lib/base64.js":(e,t)=>{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(e){if(0<=e&&e{function r(e,n,i,a,o,s){var c=Math.floor((n-e)/2)+e,l=o(i,a[c],!0);return 0===l?c:l>0?n-c>1?r(c,n,i,a,o,s):s==t.LEAST_UPPER_BOUND?n1?r(e,c,i,a,o,s):s==t.LEAST_UPPER_BOUND?c:e<0?-1:e}t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(e,n,i,a){if(0===n.length)return-1;var o=r(-1,n.length,e,n,i,a||t.GREATEST_LOWER_BOUND);if(o<0)return-1;for(;o-1>=0&&0===i(n[o],n[o-1],!0);)--o;return o}},"./node_modules/source-map-support/node_modules/source-map/lib/mapping-list.js":(e,t,r)=>{var n=r("./node_modules/source-map-support/node_modules/source-map/lib/util.js");function i(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}i.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},i.prototype.add=function(e){var t,r,i,a,o,s;r=e,i=(t=this._last).generatedLine,a=r.generatedLine,o=t.generatedColumn,s=r.generatedColumn,a>i||a==i&&s>=o||n.compareByGeneratedPositionsInflated(t,r)<=0?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},i.prototype.toArray=function(){return this._sorted||(this._array.sort(n.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.MappingList=i},"./node_modules/source-map-support/node_modules/source-map/lib/quick-sort.js":(e,t)=>{function r(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function n(e,t,i,a){if(i{var n=r("./node_modules/source-map-support/node_modules/source-map/lib/util.js"),i=r("./node_modules/source-map-support/node_modules/source-map/lib/binary-search.js"),a=r("./node_modules/source-map-support/node_modules/source-map/lib/array-set.js").ArraySet,o=r("./node_modules/source-map-support/node_modules/source-map/lib/base64-vlq.js"),s=r("./node_modules/source-map-support/node_modules/source-map/lib/quick-sort.js").quickSort;function c(e,t){var r=e;return"string"==typeof e&&(r=n.parseSourceMapInput(e)),null!=r.sections?new _(r,t):new l(r,t)}function l(e,t){var r=e;"string"==typeof e&&(r=n.parseSourceMapInput(e));var i=n.getArg(r,"version"),o=n.getArg(r,"sources"),s=n.getArg(r,"names",[]),c=n.getArg(r,"sourceRoot",null),l=n.getArg(r,"sourcesContent",null),u=n.getArg(r,"mappings"),_=n.getArg(r,"file",null);if(i!=this._version)throw new Error("Unsupported version: "+i);c&&(c=n.normalize(c)),o=o.map(String).map(n.normalize).map((function(e){return c&&n.isAbsolute(c)&&n.isAbsolute(e)?n.relative(c,e):e})),this._names=a.fromArray(s.map(String),!0),this._sources=a.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map((function(e){return n.computeSourceURL(c,e,t)})),this.sourceRoot=c,this.sourcesContent=l,this._mappings=u,this._sourceMapURL=t,this.file=_}function u(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function _(e,t){var r=e;"string"==typeof e&&(r=n.parseSourceMapInput(e));var i=n.getArg(r,"version"),o=n.getArg(r,"sections");if(i!=this._version)throw new Error("Unsupported version: "+i);this._sources=new a,this._names=new a;var s={line:-1,column:0};this._sections=o.map((function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var r=n.getArg(e,"offset"),i=n.getArg(r,"line"),a=n.getArg(r,"column");if(i=0){var s=this._originalMappings[o];if(void 0===e.column)for(var c=s.originalLine;s&&s.originalLine===c;)a.push({line:n.getArg(s,"generatedLine",null),column:n.getArg(s,"generatedColumn",null),lastColumn:n.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++o];else for(var l=s.originalColumn;s&&s.originalLine===t&&s.originalColumn==l;)a.push({line:n.getArg(s,"generatedLine",null),column:n.getArg(s,"generatedColumn",null),lastColumn:n.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++o]}return a},t.SourceMapConsumer=c,l.prototype=Object.create(c.prototype),l.prototype.consumer=c,l.prototype._findSourceIndex=function(e){var t,r=e;if(null!=this.sourceRoot&&(r=n.relative(this.sourceRoot,r)),this._sources.has(r))return this._sources.indexOf(r);for(t=0;t1&&(r.source=g+a[1],g+=a[1],r.originalLine=p+a[2],p=r.originalLine,r.originalLine+=1,r.originalColumn=f+a[3],f=r.originalColumn,a.length>4&&(r.name=m+a[4],m+=a[4])),D.push(r),"number"==typeof r.originalLine&&x.push(r)}s(D,n.compareByGeneratedPositionsDeflated),this.__generatedMappings=D,s(x,n.compareByOriginalPositions),this.__originalMappings=x},l.prototype._findMapping=function(e,t,r,n,a,o){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[n]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[n]);return i.search(e,t,a,o)},l.prototype.computeColumnSpans=function(){for(var e=0;e=0){var i=this._generatedMappings[r];if(i.generatedLine===t.generatedLine){var a=n.getArg(i,"source",null);null!==a&&(a=this._sources.at(a),a=n.computeSourceURL(this.sourceRoot,a,this._sourceMapURL));var o=n.getArg(i,"name",null);return null!==o&&(o=this._names.at(o)),{source:a,line:n.getArg(i,"originalLine",null),column:n.getArg(i,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}},l.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(e){return null==e}))},l.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(r>=0)return this.sourcesContent[r];var i,a=e;if(null!=this.sourceRoot&&(a=n.relative(this.sourceRoot,a)),null!=this.sourceRoot&&(i=n.urlParse(this.sourceRoot))){var o=a.replace(/^file:\/\//,"");if("file"==i.scheme&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!i.path||"/"==i.path)&&this._sources.has("/"+a))return this.sourcesContent[this._sources.indexOf("/"+a)]}if(t)return null;throw new Error('"'+a+'" is not in the SourceMap.')},l.prototype.generatedPositionFor=function(e){var t=n.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};var r={source:t,originalLine:n.getArg(e,"line"),originalColumn:n.getArg(e,"column")},i=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",n.compareByOriginalPositions,n.getArg(e,"bias",c.GREATEST_LOWER_BOUND));if(i>=0){var a=this._originalMappings[i];if(a.source===r.source)return{line:n.getArg(a,"generatedLine",null),column:n.getArg(a,"generatedColumn",null),lastColumn:n.getArg(a,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},t.BasicSourceMapConsumer=l,_.prototype=Object.create(c.prototype),_.prototype.constructor=c,_.prototype._version=3,Object.defineProperty(_.prototype,"sources",{get:function(){for(var e=[],t=0;t{var n=r("./node_modules/source-map-support/node_modules/source-map/lib/base64-vlq.js"),i=r("./node_modules/source-map-support/node_modules/source-map/lib/util.js"),a=r("./node_modules/source-map-support/node_modules/source-map/lib/array-set.js").ArraySet,o=r("./node_modules/source-map-support/node_modules/source-map/lib/mapping-list.js").MappingList;function s(e){e||(e={}),this._file=i.getArg(e,"file",null),this._sourceRoot=i.getArg(e,"sourceRoot",null),this._skipValidation=i.getArg(e,"skipValidation",!1),this._sources=new a,this._names=new a,this._mappings=new o,this._sourcesContents=null}s.prototype._version=3,s.fromSourceMap=function(e){var t=e.sourceRoot,r=new s({file:e.file,sourceRoot:t});return e.eachMapping((function(e){var n={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(n.source=e.source,null!=t&&(n.source=i.relative(t,n.source)),n.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(n.name=e.name)),r.addMapping(n)})),e.sources.forEach((function(n){var a=n;null!==t&&(a=i.relative(t,n)),r._sources.has(a)||r._sources.add(a);var o=e.sourceContentFor(n);null!=o&&r.setSourceContent(n,o)})),r},s.prototype.addMapping=function(e){var t=i.getArg(e,"generated"),r=i.getArg(e,"original",null),n=i.getArg(e,"source",null),a=i.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,r,n,a),null!=n&&(n=String(n),this._sources.has(n)||this._sources.add(n)),null!=a&&(a=String(a),this._names.has(a)||this._names.add(a)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=r&&r.line,originalColumn:null!=r&&r.column,source:n,name:a})},s.prototype.setSourceContent=function(e,t){var r=e;null!=this._sourceRoot&&(r=i.relative(this._sourceRoot,r)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[i.toSetString(r)]=t):this._sourcesContents&&(delete this._sourcesContents[i.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},s.prototype.applySourceMap=function(e,t,r){var n=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=e.file}var o=this._sourceRoot;null!=o&&(n=i.relative(o,n));var s=new a,c=new a;this._mappings.unsortedForEach((function(t){if(t.source===n&&null!=t.originalLine){var a=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=a.source&&(t.source=a.source,null!=r&&(t.source=i.join(r,t.source)),null!=o&&(t.source=i.relative(o,t.source)),t.originalLine=a.line,t.originalColumn=a.column,null!=a.name&&(t.name=a.name))}var l=t.source;null==l||s.has(l)||s.add(l);var u=t.name;null==u||c.has(u)||c.add(u)}),this),this._sources=s,this._names=c,e.sources.forEach((function(t){var n=e.sourceContentFor(t);null!=n&&(null!=r&&(t=i.join(r,t)),null!=o&&(t=i.relative(o,t)),this.setSourceContent(t,n))}),this)},s.prototype._validateMapping=function(e,t,r,n){if(t&&"number"!=typeof t.line&&"number"!=typeof t.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||r||n)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:t,name:n}))},s.prototype._serializeMappings=function(){for(var e,t,r,a,o=0,s=1,c=0,l=0,u=0,_=0,d="",p=this._mappings.toArray(),f=0,g=p.length;f0){if(!i.compareByGeneratedPositionsInflated(t,p[f-1]))continue;e+=","}e+=n.encode(t.generatedColumn-o),o=t.generatedColumn,null!=t.source&&(a=this._sources.indexOf(t.source),e+=n.encode(a-_),_=a,e+=n.encode(t.originalLine-1-l),l=t.originalLine-1,e+=n.encode(t.originalColumn-c),c=t.originalColumn,null!=t.name&&(r=this._names.indexOf(t.name),e+=n.encode(r-u),u=r)),d+=e}return d},s.prototype._generateSourcesContent=function(e,t){return e.map((function(e){if(!this._sourcesContents)return null;null!=t&&(e=i.relative(t,e));var r=i.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null}),this)},s.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},s.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=s},"./node_modules/source-map-support/node_modules/source-map/lib/source-node.js":(e,t,r)=>{var n=r("./node_modules/source-map-support/node_modules/source-map/lib/source-map-generator.js").SourceMapGenerator,i=r("./node_modules/source-map-support/node_modules/source-map/lib/util.js"),a=/(\r?\n)/,o="$$$isSourceNode$$$";function s(e,t,r,n,i){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==r?null:r,this.name=null==i?null:i,this[o]=!0,null!=n&&this.add(n)}s.fromStringWithSourceMap=function(e,t,r){var n=new s,o=e.split(a),c=0,l=function(){return e()+(e()||"");function e(){return c=0;t--)this.prepend(e[t]);else{if(!e[o]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},s.prototype.walk=function(e){for(var t,r=0,n=this.children.length;r0){for(t=[],r=0;r{t.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')};var r=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,n=/^data:.+\,.+$/;function i(e){var t=e.match(r);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function a(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function o(e){var r=e,n=i(e);if(n){if(!n.path)return e;r=n.path}for(var o,s=t.isAbsolute(r),c=r.split(/\/+/),l=0,u=c.length-1;u>=0;u--)"."===(o=c[u])?c.splice(u,1):".."===o?l++:l>0&&(""===o?(c.splice(u+1,l),l=0):(c.splice(u,2),l--));return""===(r=c.join("/"))&&(r=s?"/":"."),n?(n.path=r,a(n)):r}function s(e,t){""===e&&(e="."),""===t&&(t=".");var r=i(t),s=i(e);if(s&&(e=s.path||"/"),r&&!r.scheme)return s&&(r.scheme=s.scheme),a(r);if(r||t.match(n))return t;if(s&&!s.host&&!s.path)return s.host=t,a(s);var c="/"===t.charAt(0)?t:o(e.replace(/\/+$/,"")+"/"+t);return s?(s.path=c,a(s)):c}t.urlParse=i,t.urlGenerate=a,t.normalize=o,t.join=s,t.isAbsolute=function(e){return"/"===e.charAt(0)||r.test(e)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==t.indexOf(e+"/");){var n=e.lastIndexOf("/");if(n<0)return t;if((e=e.slice(0,n)).match(/^([^\/]+:\/)?\/*$/))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)};var c=!("__proto__"in Object.create(null));function l(e){return e}function u(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var r=t-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function _(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}t.toSetString=c?l:function(e){return u(e)?"$"+e:e},t.fromSetString=c?l:function(e){return u(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,r){var n=_(e.source,t.source);return 0!==n||0!=(n=e.originalLine-t.originalLine)||0!=(n=e.originalColumn-t.originalColumn)||r||0!=(n=e.generatedColumn-t.generatedColumn)||0!=(n=e.generatedLine-t.generatedLine)?n:_(e.name,t.name)},t.compareByGeneratedPositionsDeflated=function(e,t,r){var n=e.generatedLine-t.generatedLine;return 0!==n||0!=(n=e.generatedColumn-t.generatedColumn)||r||0!==(n=_(e.source,t.source))||0!=(n=e.originalLine-t.originalLine)||0!=(n=e.originalColumn-t.originalColumn)?n:_(e.name,t.name)},t.compareByGeneratedPositionsInflated=function(e,t){var r=e.generatedLine-t.generatedLine;return 0!==r||0!=(r=e.generatedColumn-t.generatedColumn)||0!==(r=_(e.source,t.source))||0!=(r=e.originalLine-t.originalLine)||0!=(r=e.originalColumn-t.originalColumn)?r:_(e.name,t.name)},t.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},t.computeSourceURL=function(e,t,r){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),r){var n=i(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var c=n.path.lastIndexOf("/");c>=0&&(n.path=n.path.substring(0,c+1))}t=s(a(n),t)}return o(t)}},"./node_modules/source-map-support/node_modules/source-map/source-map.js":(e,t,r)=>{t.SourceMapGenerator=r("./node_modules/source-map-support/node_modules/source-map/lib/source-map-generator.js").SourceMapGenerator,t.SourceMapConsumer=r("./node_modules/source-map-support/node_modules/source-map/lib/source-map-consumer.js").SourceMapConsumer,t.SourceNode=r("./node_modules/source-map-support/node_modules/source-map/lib/source-node.js").SourceNode},"./node_modules/source-map-support/source-map-support.js":(e,t,r)=>{e=r.nmd(e);var n,i=r("./node_modules/source-map-support/node_modules/source-map/source-map.js").SourceMapConsumer,a=r("path");try{(n=r("fs")).existsSync&&n.readFileSync||(n=null)}catch(e){}var o=r("./node_modules/buffer-from/index.js");function s(e,t){return e.require(t)}var c=!1,l=!1,u=!1,_="auto",d={},p={},f=/^data:application\/json[^,]+base64,/,g=[],m=[];function y(){return"browser"===_||"node"!==_&&"undefined"!=typeof window&&"function"==typeof XMLHttpRequest&&!(window.require&&window.module&&window.process&&"renderer"===window.process.type)}function h(e){return function(t){for(var r=0;r";var r=this.getLineNumber();if(null!=r){t+=":"+r;var n=this.getColumnNumber();n&&(t+=":"+n)}}var i="",a=this.getFunctionName(),o=!0,s=this.isConstructor();if(this.isToplevel()||s)s?i+="new "+(a||""):a?i+=a:(i+=t,o=!1);else{var c=this.getTypeName();"[object Object]"===c&&(c="null");var l=this.getMethodName();a?(c&&0!=a.indexOf(c)&&(i+=c+"."),i+=a,l&&a.indexOf("."+l)!=a.length-l.length-1&&(i+=" [as "+l+"]")):i+=c+"."+(l||"")}return o&&(i+=" ("+t+")"),i}function T(e){var t={};return Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(r){t[r]=/^(?:is|get)/.test(r)?function(){return e[r].call(e)}:e[r]})),t.toString=E,t}function C(e,t){if(void 0===t&&(t={nextPosition:null,curPosition:null}),e.isNative())return t.curPosition=null,e;var r=e.getFileName()||e.getScriptNameOrSourceURL();if(r){var n=e.getLineNumber(),i=e.getColumnNumber()-1,a=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/.test("object"==typeof process&&null!==process?process.version:"")?0:62;1===n&&i>a&&!y()&&!e.isEval()&&(i-=a);var o=D({source:r,line:n,column:i});t.curPosition=o;var s=(e=T(e)).getFunctionName;return e.getFunctionName=function(){return null==t.nextPosition?s():t.nextPosition.name||s()},e.getFileName=function(){return o.source},e.getLineNumber=function(){return o.line},e.getColumnNumber=function(){return o.column+1},e.getScriptNameOrSourceURL=function(){return o.source},e}var c=e.isEval()&&e.getEvalOrigin();return c?(c=S(c),(e=T(e)).getEvalOrigin=function(){return c},e):e}function k(e,t){u&&(d={},p={});for(var r=(e.name||"Error")+": "+(e.message||""),n={nextPosition:null,curPosition:null},i=[],a=t.length-1;a>=0;a--)i.push("\n at "+C(t[a],n)),n.nextPosition=n.curPosition;return n.curPosition=n.nextPosition=null,r+i.reverse().join("")}function A(e){var t=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(e.stack);if(t){var r=t[1],i=+t[2],a=+t[3],o=d[r];if(!o&&n&&n.existsSync(r))try{o=n.readFileSync(r,"utf8")}catch(e){o=""}if(o){var s=o.split(/(?:\r\n|\r|\n)/)[i-1];if(s)return r+":"+i+"\n"+s+"\n"+new Array(a).join(" ")+"^"}}return null}function N(e){var t=A(e),r=function(){if("object"==typeof process&&null!==process)return process.stderr}();r&&r._handle&&r._handle.setBlocking&&r._handle.setBlocking(!0),t&&(console.error(),console.error(t)),console.error(e.stack),"object"==typeof process&&null!==process&&"function"==typeof process.exit&&process.exit(1)}m.push((function(e){var t,r=function(e){var t;if(y())try{var r=new XMLHttpRequest;r.open("GET",e,!1),r.send(null),t=4===r.readyState?r.responseText:null;var n=r.getResponseHeader("SourceMap")||r.getResponseHeader("X-SourceMap");if(n)return n}catch(e){}t=v(e);for(var i,a,o=/(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/gm;a=o.exec(t);)i=a;return i?i[1]:null}(e);if(!r)return null;if(f.test(r)){var n=r.slice(r.indexOf(",")+1);t=o(n,"base64").toString(),r=e}else r=b(e,r),t=v(r);return t?{url:r,map:t}:null}));var F=g.slice(0),w=m.slice(0);t.wrapCallSite=C,t.getErrorSource=A,t.mapSourcePosition=D,t.retrieveSourceMap=x,t.install=function(t){if((t=t||{}).environment&&(_=t.environment,-1===["node","browser","auto"].indexOf(_)))throw new Error("environment "+_+" was unknown. Available options are {auto, browser, node}");if(t.retrieveFile&&(t.overrideRetrieveFile&&(g.length=0),g.unshift(t.retrieveFile)),t.retrieveSourceMap&&(t.overrideRetrieveSourceMap&&(m.length=0),m.unshift(t.retrieveSourceMap)),t.hookRequire&&!y()){var r=s(e,"module"),n=r.prototype._compile;n.__sourceMapSupport||(r.prototype._compile=function(e,t){return d[t]=e,p[t]=void 0,n.call(this,e,t)},r.prototype._compile.__sourceMapSupport=!0)}if(u||(u="emptyCacheBetweenOperations"in t&&t.emptyCacheBetweenOperations),c||(c=!0,Error.prepareStackTrace=k),!l){var i=!("handleUncaughtExceptions"in t)||t.handleUncaughtExceptions;try{!1===s(e,"worker_threads").isMainThread&&(i=!1)}catch(e){}i&&"object"==typeof process&&null!==process&&"function"==typeof process.on&&(l=!0,a=process.emit,process.emit=function(e){if("uncaughtException"===e){var t=arguments[1]&&arguments[1].stack,r=this.listeners(e).length>0;if(t&&!r)return N(arguments[1])}return a.apply(this,arguments)})}var a},t.resetRetrieveHandlers=function(){g.length=0,m.length=0,g=F.slice(0),m=w.slice(0),x=h(m),v=h(g)}},"./src/addVariable2Scope.ts":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.addVariableToScope=void 0;const o=a(r("./node_modules/typescript/lib/typescript.js")),s=r("./src/base/util.ts"),c=r("./src/cmdOptions.ts"),l=a(r("./src/jshelpers.js")),u=r("./src/scope.ts"),_=r("./src/syntaxCheckHelper.ts"),d=r("./src/typeRecorder.ts"),p=r("./src/variable.ts");function f(e,t,r){r?function(e,t){if(t){let r=d.TypeRecorder.getInstance().tryGetTypeIndex(o.getOriginalNode(e));t.setTypeIndex(r)}}(e,t):function(e,t){if(t){let r=d.TypeRecorder.getInstance().tryGetVariable2Type(o.getOriginalNode(e));t.setTypeIndex(r)}}(e,t)}function g(e,t){let r="";e.elements.forEach((e=>{o.isOmittedExpression(e)||(o.isIdentifier(e.name)?(r=l.getTextOfIdentifierOrLiteral(e.name),t.add(r,p.VarDeclarationKind.VAR)):(0,s.isBindingPattern)(e.name)&&g(e.name,t))}))}t.addVariableToScope=function(e,t){let r=e.getScopeMap(),n=e.getHoistMap();r.forEach(((r,i)=>{let a=[];r instanceof u.VariableScope&&(function(e,t,r){if(t.addParameter("4funcObj",p.VarDeclarationKind.CONST,-1),e.kind==o.SyntaxKind.ArrowFunction?(t.addParameter("0newTarget",p.VarDeclarationKind.CONST,-1),t.addParameter("0this",p.VarDeclarationKind.CONST,0)):(t.addParameter("4newTarget",p.VarDeclarationKind.CONST,-1),t.addParameter("this",p.VarDeclarationKind.CONST,0)),e.kind!=o.SyntaxKind.SourceFile&&function(e,t,r){let n=new Array;for(let i=0;i{let n;if(e instanceof u.VarDecl)n=r.add(e.name,p.VarDeclarationKind.VAR);else{if(!(e instanceof u.FuncDecl))throw new Error("Wrong type of declaration to be hoisted");n=r.add(e.name,p.VarDeclarationKind.FUNCTION)}t&&f(e.node,n,e instanceof u.FuncDecl)})));let d=r.getDecls(),m=r.getNearestVariableScope();a=n.get(m);for(let n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AssemblyDumper=t.IntrinsicInfo=void 0;const n=r("./src/irnodes.ts"),i=r("./src/statement/tryStatement.ts"),a=r("./src/base/util.ts");t.IntrinsicInfo=class{constructor(e,t,r){this.intrinsicName=e,this.argsNum=t,this.returnType=r}};class o{constructor(e){this.labelPrefix="LABEL_",this.pg=e,this.labels=new Map,this.labelId=0,this.output=""}static writeLanguageTag(e){e.str+=".language ECMAScript\n",e.str+="\n"}writeFunctionHeader(){let e=this.pg.getParametersCount();this.output+=".function any "+this.pg.internalName+"(";for(let t=0;t{let t=e.getCatchBeginLabel();e.getLabelPairs().forEach((e=>{this.output+=".catchall "+this.getLabelName(e.getBeginLabel())+", "+this.getLabelName(e.getEndLabel())+", "+this.getLabelName(t)+"\n"}))})))}getLabelName(e){let t;return this.labels.has(e.id)?t=this.labels.get(e.id):(t=this.labelPrefix+this.labelId++,this.labels.set(e.id,t)),t}writeLabel(e){let t=this.getLabelName(e);this.output+=t+":\n"}dump(){this.writeFunctionHeader(),this.writeFunctionBody(),this.writeFunctionCatchTable(),this.writeFunctionTail(),console.log(this.output)}static dumpHeader(){let e={str:""};o.writeLanguageTag(e),console.log(e.str)}}t.AssemblyDumper=o,o.intrinsicRec=new Map},"./src/astutils.ts":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.getVarDeclarationKind=void 0;const o=a(r("./node_modules/typescript/lib/typescript.js")),s=r("./src/variable.ts");t.getVarDeclarationKind=function(e){if(e.parent.kind==o.SyntaxKind.VariableDeclarationList){let t=e.parent;return 0!=(t.flags&o.NodeFlags.Let)?s.VarDeclarationKind.LET:0!=(t.flags&o.NodeFlags.Const)?s.VarDeclarationKind.CONST:s.VarDeclarationKind.VAR}if(e.parent.kind==o.SyntaxKind.CatchClause)return s.VarDeclarationKind.LET;throw new Error("VariableDeclaration inside "+o.SyntaxKind[e.parent]+" is not implemented")}},"./src/base/bcGenUtil.ts":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwObjectNonCoercible=t.createObjectWithExcludedKeys=t.defineClassWithBuffer=t.storeArraySpread=t.createArrayWithBuffer=t.createEmptyArray=t.defineGetterSetterByValue=t.copyDataProperties=t.setObjectWithProto=t.createObjectWithBuffer=t.createObjectHavingMethod=t.createEmptyObject=t.returnUndefined=t.getNextPropName=t.getPropIterator=t.newObject=t.call=t.throwIfSuperNotCorrectCall=t.storeOwnByValue=t.storeOwnByIndex=t.storeOwnByName=t.storeObjByValue=t.loadObjByValue=t.storeObjByIndex=t.loadObjByIndex=t.storeObjByName=t.loadObjByName=t.storeGlobalVar=t.loadGlobalVar=t.tryStoreGlobalByName=t.tryLoadGlobalByName=t.storeLexicalVar=t.loadLexicalVar=t.popLexicalEnv=t.loadLexicalEnv=t.newLexicalEnv=t.throwDeleteSuperProperty=t.throwThrowNotExists=t.throwUndefinedIfHole=t.throwConstAssignment=t.throwException=t.creatDebugger=t.jumpTarget=t.moveVreg=t.deleteObjProperty=t.storeAccumulator=t.loadAccumulator=t.loadAccumulatorString=t.loadAccumulatorFloat=t.loadAccumulatorInt=void 0,t.loadAccumulatorBigInt=t.stClassToGlobalRecord=t.stConstToGlobalRecord=t.stLetToGlobalRecord=t.createRegExpWithLiteral=t.isFalse=t.isTrue=t.defineMethod=t.defineNCFunc=t.defineGeneratorFunc=t.defineAsyncFunc=t.defineFunc=t.loadHomeObject=t.copyModuleIntoCurrentModule=t.storeModuleVariable=t.loadModuleVarByName=t.importModule=t.ldSuperByValue=t.stSuperByValue=t.stSuperByName=t.ldSuperByName=t.superCallSpread=t.superCall=t.closeIterator=t.getIteratorNext=t.getIterator=t.throwIfNotObject=void 0;const n=r("./src/irnodes.ts");t.loadAccumulatorInt=function(e){return new n.LdaiDyn(new n.Imm(e))},t.loadAccumulatorFloat=function(e){return new n.FldaiDyn(new n.Imm(e))},t.loadAccumulatorString=function(e){return new n.LdaStr(e)},t.loadAccumulator=function(e){return new n.LdaDyn(e)},t.storeAccumulator=function(e){return new n.StaDyn(e)},t.deleteObjProperty=function(e,t){return new n.EcmaDelobjprop(e,t)},t.moveVreg=function(e,t){return new n.MovDyn(e,t)},t.jumpTarget=function(e){return new n.Jmp(e)},t.creatDebugger=function(){return new n.EcmaDebugger},t.throwException=function(){return new n.EcmaThrowdyn},t.throwConstAssignment=function(e){return new n.EcmaThrowconstassignment(e)},t.throwUndefinedIfHole=function(e,t){return new n.EcmaThrowundefinedifhole(e,t)},t.throwThrowNotExists=function(){return new n.EcmaThrowthrownotexists},t.throwDeleteSuperProperty=function(){return new n.EcmaThrowdeletesuperproperty},t.newLexicalEnv=function(e,t){return null==t?new n.EcmaNewlexenvdyn(new n.Imm(e)):new n.EcmaNewlexenvwithnamedyn(new n.Imm(e),new n.Imm(t))},t.loadLexicalEnv=function(){return new n.EcmaLdlexenvdyn},t.popLexicalEnv=function(){return new n.EcmaPoplexenvdyn},t.loadLexicalVar=function(e,t){return new n.EcmaLdlexvardyn(new n.Imm(e),new n.Imm(t))},t.storeLexicalVar=function(e,t,r){return new n.EcmaStlexvardyn(new n.Imm(e),new n.Imm(t),r)},t.tryLoadGlobalByName=function(e){return new n.EcmaTryldglobalbyname(e)},t.tryStoreGlobalByName=function(e){return new n.EcmaTrystglobalbyname(e)},t.loadGlobalVar=function(e){return new n.EcmaLdglobalvar(e)},t.storeGlobalVar=function(e){return new n.EcmaStglobalvar(e)},t.loadObjByName=function(e,t){return new n.EcmaLdobjbyname(t,e)},t.storeObjByName=function(e,t){return new n.EcmaStobjbyname(t,e)},t.loadObjByIndex=function(e,t){return new n.EcmaLdobjbyindex(e,new n.Imm(t))},t.storeObjByIndex=function(e,t){return new n.EcmaStobjbyindex(e,new n.Imm(t))},t.loadObjByValue=function(e,t){return new n.EcmaLdobjbyvalue(e,t)},t.storeObjByValue=function(e,t){return new n.EcmaStobjbyvalue(e,t)},t.storeOwnByName=function(e,t,r){return r?new n.EcmaStownbynamewithnameset(t,e):new n.EcmaStownbyname(t,e)},t.storeOwnByIndex=function(e,t){return new n.EcmaStownbyindex(e,new n.Imm(t))},t.storeOwnByValue=function(e,t,r){return r?new n.EcmaStownbyvaluewithnameset(e,t):new n.EcmaStownbyvalue(e,t)},t.throwIfSuperNotCorrectCall=function(e){return new n.EcmaThrowifsupernotcorrectcall(new n.Imm(e))},t.call=function(e,t){let r,i=e.length;if(t)r=new n.EcmaCallithisrangedyn(new n.Imm(i-1),e);else switch(i){case 1:r=new n.EcmaCallarg0dyn(e[0]);break;case 2:r=new n.EcmaCallarg1dyn(e[0],e[1]);break;case 3:r=new n.EcmaCallargs2dyn(e[0],e[1],e[2]);break;case 4:r=new n.EcmaCallargs3dyn(e[0],e[1],e[2],e[3]);break;default:r=new n.EcmaCallirangedyn(new n.Imm(i-1),e)}return r},t.newObject=function(e){return new n.EcmaNewobjdynrange(new n.Imm(e.length),e)},t.getPropIterator=function(){return new n.EcmaGetpropiterator},t.getNextPropName=function(e){return new n.EcmaGetnextpropname(e)},t.returnUndefined=function(){return new n.EcmaReturnundefined},t.createEmptyObject=function(){return new n.EcmaCreateemptyobject},t.createObjectHavingMethod=function(e){return new n.EcmaCreateobjecthavingmethod(new n.Imm(e))},t.createObjectWithBuffer=function(e){return new n.EcmaCreateobjectwithbuffer(new n.Imm(e))},t.setObjectWithProto=function(e,t){return new n.EcmaSetobjectwithproto(e,t)},t.copyDataProperties=function(e,t){return new n.EcmaCopydataproperties(e,t)},t.defineGetterSetterByValue=function(e,t,r,i){return new n.EcmaDefinegettersetterbyvalue(e,t,r,i)},t.createEmptyArray=function(){return new n.EcmaCreateemptyarray},t.createArrayWithBuffer=function(e){return new n.EcmaCreatearraywithbuffer(new n.Imm(e))},t.storeArraySpread=function(e,t){return new n.EcmaStarrayspread(e,t)},t.defineClassWithBuffer=function(e,t,r,i,a){return new n.EcmaDefineclasswithbuffer(e,new n.Imm(t),new n.Imm(r),i,a)},t.createObjectWithExcludedKeys=function(e,t){return new n.EcmaCreateobjectwithexcludedkeys(new n.Imm(t.length-1),e,t)},t.throwObjectNonCoercible=function(){return new n.EcmaThrowpatternnoncoercible},t.throwIfNotObject=function(e){return new n.EcmaThrowifnotobject(e)},t.getIterator=function(){return new n.EcmaGetiterator},t.getIteratorNext=function(e,t){return new n.EcmaGetiteratornext(e,t)},t.closeIterator=function(e){return new n.EcmaCloseiterator(e)},t.superCall=function(e,t){return new n.EcmaSupercall(new n.Imm(e),t)},t.superCallSpread=function(e){return new n.EcmaSupercallspread(e)},t.ldSuperByName=function(e,t){return new n.EcmaLdsuperbyname(t,e)},t.stSuperByName=function(e,t){return new n.EcmaStsuperbyname(t,e)},t.stSuperByValue=function(e,t){return new n.EcmaStsuperbyvalue(e,t)},t.ldSuperByValue=function(e,t){return new n.EcmaLdsuperbyvalue(e,t)},t.importModule=function(e){return new n.EcmaImportmodule(e)},t.loadModuleVarByName=function(e,t){return new n.EcmaLdmodvarbyname(e,t)},t.storeModuleVariable=function(e){return new n.EcmaStmodulevar(e)},t.copyModuleIntoCurrentModule=function(e){return new n.EcmaCopymodule(e)},t.loadHomeObject=function(){return new n.EcmaLdhomeobject},t.defineFunc=function(e,t,r){return new n.EcmaDefinefuncdyn(e,new n.Imm(r),t)},t.defineAsyncFunc=function(e,t,r){return new n.EcmaDefineasyncfunc(e,new n.Imm(r),t)},t.defineGeneratorFunc=function(e,t,r){return new n.EcmaDefinegeneratorfunc(e,new n.Imm(r),t)},t.defineNCFunc=function(e,t,r){return new n.EcmaDefinencfuncdyn(e,new n.Imm(r),t)},t.defineMethod=function(e,t,r){return new n.EcmaDefinemethod(e,new n.Imm(r),t)},t.isTrue=function(){return new n.EcmaIstrue},t.isFalse=function(){return new n.EcmaIsfalse},t.createRegExpWithLiteral=function(e,t){return new n.EcmaCreateregexpwithliteral(e,new n.Imm(t))},t.stLetToGlobalRecord=function(e){return new n.EcmaStlettoglobalrecord(e)},t.stConstToGlobalRecord=function(e){return new n.EcmaStconsttoglobalrecord(e)},t.stClassToGlobalRecord=function(e){return new n.EcmaStclasstoglobalrecord(e)},t.loadAccumulatorBigInt=function(e){return new n.EcmaLdbigint(e)}},"./src/base/builtIn.ts":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expandFunc=t.expandFalse=t.expandTrue=t.expandNull=t.expandSymbol=t.expandUndefined=t.expandGlobal=t.expandInfinity=t.expandNaN=t.expandHole=void 0;const n=r("./src/irnodes.ts"),i=r("./src/base/vregisterCache.ts");t.expandHole=function(e){let t=(0,i.getVregisterCache)(e,i.CacheList.HOLE);return[new n.EcmaLdhole,new n.StaDyn(t)]},t.expandNaN=function(e){let t=(0,i.getVregisterCache)(e,i.CacheList.NaN);return[new n.EcmaLdnan,new n.StaDyn(t)]},t.expandInfinity=function(e){let t=(0,i.getVregisterCache)(e,i.CacheList.Infinity);return[new n.EcmaLdinfinity,new n.StaDyn(t)]},t.expandGlobal=function(e){let t=(0,i.getVregisterCache)(e,i.CacheList.Global);return[new n.EcmaLdglobal,new n.StaDyn(t)]},t.expandUndefined=function(e){let t=(0,i.getVregisterCache)(e,i.CacheList.undefined);return[new n.EcmaLdundefined,new n.StaDyn(t)]},t.expandSymbol=function(e){let t=(0,i.getVregisterCache)(e,i.CacheList.Symbol);return[new n.EcmaLdsymbol,new n.StaDyn(t)]},t.expandNull=function(e){let t=(0,i.getVregisterCache)(e,i.CacheList.Null);return[new n.EcmaLdnull,new n.StaDyn(t)]},t.expandTrue=function(e){let t=(0,i.getVregisterCache)(e,i.CacheList.True);return[new n.EcmaLdtrue,new n.StaDyn(t)]},t.expandFalse=function(e){let t=(0,i.getVregisterCache)(e,i.CacheList.False);return[new n.EcmaLdfalse,new n.StaDyn(t)]},t.expandFunc=function(e){let t=(0,i.getVregisterCache)(e,i.CacheList.FUNC);return[new n.EcmaLdfunction,new n.StaDyn(t)]}},"./src/base/iterator.ts":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Iterator=void 0,t.Iterator=class{constructor(e,t,r,n,i){this.iterRecord=e,this.iterDone=t,this.iterValue=r,this.pandaGen=n,this.node=i}getIterator(){let e=this.pandaGen,t=this.iterRecord.iterator;e.getIterator(this.node),e.storeAccumulator(this.node,t),e.loadObjProperty(this.node,t,"next"),e.storeAccumulator(this.node,this.iterRecord.nextMethod)}callNext(e){this.pandaGen.getIteratorNext(this.node,this.iterRecord.iterator,this.iterRecord.nextMethod),this.pandaGen.storeAccumulator(this.node,e)}iteratorComplete(e){this.pandaGen.loadObjProperty(this.node,e,"done"),this.pandaGen.storeAccumulator(this.node,this.iterDone)}iteratorValue(e){this.pandaGen.loadObjProperty(this.node,e,"value"),this.pandaGen.storeAccumulator(this.node,this.iterValue)}close(){this.pandaGen.closeIterator(this.node,this.iterRecord.iterator)}getCurrentValue(){return this.iterValue}getCurrrentDone(){return this.iterDone}}},"./src/base/lexEnv.ts":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expandLexEnv=void 0;const n=r("./src/cmdOptions.ts"),i=r("./src/base/bcGenUtil.ts"),a=r("./src/base/vregisterCache.ts");t.expandLexEnv=function(e){let t,r=e.getScope().getNearestVariableScope();if(!r)throw new Error("pandagen must have one variable scope");return t=r.need2CreateLexEnv()?function(e,t){let r,o=t.getNumLexEnv(),s=[],c=t.getLexVarInfo();return n.CmdOptions.isDebugMode()&&(r=e.appendScopeInfo(c)),s.push((0,i.newLexicalEnv)(o,r),(0,i.storeAccumulator)((0,a.getVregisterCache)(e,a.CacheList.LexEnv))),s}(e,r):function(e){let t=[];return t.push((0,i.loadLexicalEnv)(),(0,i.storeAccumulator)((0,a.getVregisterCache)(e,a.CacheList.LexEnv))),t}(e),t}},"./src/base/literal.ts":(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.LiteralBuffer=t.Literal=t.LiteralTag=void 0,(r=t.LiteralTag||(t.LiteralTag={}))[r.BOOLEAN=1]="BOOLEAN",r[r.INTEGER=2]="INTEGER",r[r.DOUBLE=4]="DOUBLE",r[r.STRING=5]="STRING",r[r.METHOD=6]="METHOD",r[r.GENERATOR=7]="GENERATOR",r[r.ACCESSOR=8]="ACCESSOR",r[r.METHODAFFILIATE=9]="METHODAFFILIATE",r[r.NULLVALUE=255]="NULLVALUE",t.Literal=class{constructor(e,t){this.t=e,this.v=t}getTag(){return this.t}getValue(){return this.v}},t.LiteralBuffer=class{constructor(){this.lb=[]}addLiterals(...e){this.lb.push(...e)}getLiterals(){return this.lb}isEmpty(){return 0==this.lb.length}getLiteral(e){if(!(e>=this.lb.length||this.lb.length<=0))return this.lb[e]}}},"./src/base/lreference.ts":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.LReference=void 0;const o=a(r("./node_modules/typescript/lib/typescript.js")),s=r("./src/compilerUtils.ts"),c=r("./src/diagnostic.ts"),l=r("./src/expression/memberAccessExpression.ts"),u=r("./src/expression/parenthesizedExpression.ts"),_=r("./src/irnodes.ts"),d=a(r("./src/jshelpers.js")),p=r("./src/variable.ts"),f=r("./src/base/util.ts");var g;!function(e){e[e.MemberAccess=0]="MemberAccess",e[e.LocalOrGlobal=1]="LocalOrGlobal",e[e.Destructuring=2]="Destructuring"}(g||(g={}));class m{constructor(e,t,r,n,i){this.obj=void 0,this.prop=void 0,this.propLiteral=void 0,this.node=e,this.compiler=t,this.isDeclaration=r,this.refKind=n,n==g.Destructuring?this.destructuringTarget=e:n==g.LocalOrGlobal?this.variable=i:n==g.MemberAccess&&(this.obj=t.getPandaGen().getTemp(),this.prop=t.getPandaGen().getTemp())}getValue(){let e=this.compiler.getPandaGen();switch(this.refKind){case g.MemberAccess:let t;return t=void 0===this.propLiteral?this.prop:this.propLiteral,void e.loadObjProperty(this.node,this.obj,t);case g.LocalOrGlobal:return void this.compiler.loadTarget(this.node,this.variable);case g.Destructuring:throw new Error("Destructuring target can't be loaded");default:throw new Error("Invalid LReference kind to GetValue")}}setValue(){let e=this.compiler.getPandaGen();switch(this.refKind){case g.MemberAccess:{let t;if(t=void 0===this.propLiteral?this.prop:this.propLiteral,d.isSuperProperty(this.node)){let r=e.getTemp();this.compiler.getThis(this.node,r),e.storeSuperProperty(this.node,r,t),e.freeTemps(r)}else e.storeObjProperty(this.node,this.obj,t);return void e.freeTemps(this.obj,this.prop)}case g.LocalOrGlobal:return void this.compiler.storeTarget(this.node,this.variable,this.isDeclaration);case g.Destructuring:return void(0,s.compileDestructuring)(this.destructuringTarget,e,this.compiler);default:throw new Error("Invalid LReference kind to SetValue")}}setObjectAndProperty(e,t,r){d.isSuperProperty(this.node)||e.moveVreg(this.node,this.obj,t),r instanceof _.VReg?e.moveVreg(this.node,this.prop,r):this.propLiteral=r}static generateLReference(e,t,r){let n=e.getPandaGen(),i=t;if(o.isParenthesizedExpression(t)&&(i=(0,u.findInnerExprOfParenthesis)(t)),o.isIdentifier(i)){let t=d.getTextOfIdentifierOrLiteral(i),n=e.getCurrentScope().find(t);return n.v||(n.v=e.getCurrentScope().add(t,p.VarDeclarationKind.NONE)),new m(i,e,r,g.LocalOrGlobal,n)}if(o.isPropertyAccessExpression(i)||o.isElementAccessExpression(i)){let t=new m(i,e,!1,g.MemberAccess,void 0),r=n.getTemp(),a=n.getTemp(),{obj:o,prop:s}=(0,l.getObjAndProp)(i,r,a,e);return t.setObjectAndProperty(n,o,s),n.freeTemps(r,a),t}if(o.isVariableDeclarationList(i)){let t=i.declarations;if(1!=t.length)throw new Error("Malformed variable declaration");return m.generateLReference(e,t[0].name,!0)}if((0,f.isBindingOrAssignmentPattern)(i))return new m(i,e,r,g.Destructuring,void 0);throw new c.DiagnosticError(t,c.DiagnosticCode.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access)}}t.LReference=m},"./src/base/properties.ts":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.getPropName=t.propertyKeyAsString=t.isConstantExpr=t.generatePropertyFromExpr=t.Property=t.PropertyKind=void 0;const o=a(r("./node_modules/typescript/lib/typescript.js")),s=r("./src/expression/memberAccessExpression.ts"),c=a(r("./src/jshelpers.js"));var l;!function(e){e[e.Variable=0]="Variable",e[e.Constant=1]="Constant",e[e.Computed=2]="Computed",e[e.Prototype=3]="Prototype",e[e.Accessor=4]="Accessor",e[e.Spread=5]="Spread"}(l=t.PropertyKind||(t.PropertyKind={}));class u{constructor(e,t){this.compiled=!1,this.redeclared=!1,this.propKind=e,void 0!==t&&(this.name=t)}setCompiled(){this.compiled=!0}setRedeclared(){this.redeclared=!0}isCompiled(){return this.compiled}isRedeclared(){return this.redeclared}getName(){if(void 0===this.name)throw new Error("this property doesn't have a name");return this.name}getKind(){return this.propKind}getValue(){if(this.propKind==l.Accessor)throw new Error("Accessor doesn't have valueNode");return this.valueNode}getGetter(){return this.getterNode}getSetter(){return this.setterNode}setValue(e){this.valueNode=e,this.getterNode=void 0,this.setterNode=void 0}setGetter(e){this.propKind!=l.Accessor&&(this.valueNode=void 0,this.setterNode=void 0,this.propKind=l.Accessor),this.getterNode=e}setSetter(e){this.propKind!=l.Accessor&&(this.valueNode=void 0,this.getterNode=void 0,this.propKind=l.Accessor),this.setterNode=e}setKind(e){this.propKind=e}}function _(e,t,r,n,i){if(r==l.Computed||r==l.Spread){let i=new u(r,e);i.setValue(t),n.push(i)}else{let a=new u(r,e),s=p(e);if(i.has(s)){let e=n[i.get(s)];if(!(e.getKind()!=l.Accessor&&e.getKind()!=l.Constant||r!=l.Accessor&&r!=l.Constant))return void(r==l.Accessor?o.isGetAccessorDeclaration(t)?e.setGetter(t):o.isSetAccessorDeclaration(t)&&e.setSetter(t):(e.setValue(t),e.setKind(l.Constant)));a.setRedeclared()}i.set(s,n.length),r==l.Accessor?o.isGetAccessorDeclaration(t)?a.setGetter(t):o.isSetAccessorDeclaration(t)&&a.setSetter(t):a.setValue(t),n.push(a)}}function d(e){switch(e.kind){case o.SyntaxKind.StringLiteral:case o.SyntaxKind.NumericLiteral:case o.SyntaxKind.NullKeyword:case o.SyntaxKind.TrueKeyword:case o.SyntaxKind.FalseKeyword:return!0;default:return!1}}function p(e){return"number"==typeof e?e.toString():e}function f(e){if(o.isComputedPropertyName(e))return e;let t=c.getTextOfIdentifierOrLiteral(e);if(e.kind==o.SyntaxKind.NumericLiteral)t=Number.parseFloat(t),(0,s.isValidIndex)(t)||(t=t.toString());else if(e.kind==o.SyntaxKind.StringLiteral){let e=Number(t);isNaN(Number.parseFloat(t))||isNaN(e)||!(0,s.isValidIndex)(e)||String(e)!=t||(t=e)}return t}t.Property=u,t.generatePropertyFromExpr=function(e){let t=!1,r=[],n=new Map;return e.properties.forEach((e=>{switch(e.kind){case o.SyntaxKind.PropertyAssignment:{if(e.name.kind==o.SyntaxKind.ComputedPropertyName){_(e.name,e,l.Computed,r,n);break}let i=f(e.name);if("__proto__"==i){if(t)throw new Error("__proto__ was set multiple times in the object definition.");_(i,e.initializer,l.Prototype,r,n),t=!0;break}d(e.initializer)?_(i,e.initializer,l.Constant,r,n):_(i,e.initializer,l.Variable,r,n);break}case o.SyntaxKind.ShorthandPropertyAssignment:_(c.getTextOfIdentifierOrLiteral(e.name),e.name,l.Variable,r,n);break;case o.SyntaxKind.SpreadAssignment:_(void 0,e.expression,l.Spread,r,n);break;case o.SyntaxKind.MethodDeclaration:{let t=f(e.name);_(t,e,"string"==typeof t||"number"==typeof t?l.Variable:l.Computed,r,n);break}case o.SyntaxKind.GetAccessor:case o.SyntaxKind.SetAccessor:{let t=f(e.name);_(t,e,"string"==typeof t||"number"==typeof t?l.Accessor:l.Computed,r,n);break}default:throw new Error("Unreachable Kind")}})),r},t.isConstantExpr=d,t.propertyKeyAsString=p,t.getPropName=f},"./src/base/typeSystem.ts":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.InterfaceType=t.ObjectType=t.ArrayType=t.UnionType=t.ExternalType=t.FunctionType=t.ClassInstType=t.ClassType=t.TypeSummary=t.PlaceHolderType=t.BaseType=t.AccessFlag=t.ModifierReadonly=t.ModifierStatic=t.ModifierAbstract=t.L2Type=t.PrimitiveType=void 0;const o=a(r("./node_modules/typescript/lib/typescript.js")),s=a(r("./src/jshelpers.js")),c=r("./src/pandagen.ts"),l=r("./src/typeChecker.ts"),u=r("./src/typeRecorder.ts"),_=r("./src/base/literal.ts");var d,p,f,g,m,y;!function(e){e[e.ANY=0]="ANY",e[e.NUMBER=1]="NUMBER",e[e.BOOLEAN=2]="BOOLEAN",e[e.VOID=3]="VOID",e[e.STRING=4]="STRING",e[e.SYMBOL=5]="SYMBOL",e[e.NULL=6]="NULL",e[e.UNDEFINED=7]="UNDEFINED",e[e.INT=8]="INT",e[e._LENGTH=50]="_LENGTH"}(d=t.PrimitiveType||(t.PrimitiveType={})),function(e){e[e._COUNTER=0]="_COUNTER",e[e.CLASS=1]="CLASS",e[e.CLASSINST=2]="CLASSINST",e[e.FUNCTION=3]="FUNCTION",e[e.UNION=4]="UNION",e[e.ARRAY=5]="ARRAY",e[e.OBJECT=6]="OBJECT",e[e.EXTERNAL=7]="EXTERNAL",e[e.INTERFACE=8]="INTERFACE"}(p=t.L2Type||(t.L2Type={})),function(e){e[e.NONABSTRACT=0]="NONABSTRACT",e[e.ABSTRACT=1]="ABSTRACT"}(f=t.ModifierAbstract||(t.ModifierAbstract={})),function(e){e[e.NONSTATIC=0]="NONSTATIC",e[e.STATIC=1]="STATIC"}(g=t.ModifierStatic||(t.ModifierStatic={})),function(e){e[e.NONREADONLY=0]="NONREADONLY",e[e.READONLY=1]="READONLY"}(m=t.ModifierReadonly||(t.ModifierReadonly={})),function(e){e[e.PUBLIC=0]="PUBLIC",e[e.PRIVATE=1]="PRIVATE",e[e.PROTECTED=2]="PROTECTED"}(y=t.AccessFlag||(t.AccessFlag={}));class h{constructor(){this.typeChecker=l.TypeChecker.getInstance(),this.typeRecorder=u.TypeRecorder.getInstance()}addCurrentType(e,t){this.typeRecorder.addType2Index(e,t)}setVariable2Type(e,t){this.typeRecorder.setVariable2Type(e,t)}tryGetTypeIndex(e){return this.typeRecorder.tryGetTypeIndex(e)}getOrCreateRecordForDeclNode(e,t){return this.typeChecker.getOrCreateRecordForDeclNode(e,t)}getOrCreateRecordForTypeNode(e,t){return this.typeChecker.getOrCreateRecordForTypeNode(e,t)}getIndexFromTypeArrayBuffer(e){return c.PandaGen.appendTypeArrayBuffer(e)}setTypeArrayBuffer(e,t){c.PandaGen.setTypeArrayBuffer(e,t)}}t.BaseType=h;class v extends h{transfer2LiteralBuffer(){return new _.LiteralBuffer}}t.PlaceHolderType=v,t.TypeSummary=class extends h{constructor(){super(),this.preservedIndex=0,this.userDefinedClassNum=0,this.anonymousRedirect=new Array,this.preservedIndex=this.getIndexFromTypeArrayBuffer(new v)}setInfo(e,t){this.userDefinedClassNum=e,this.anonymousRedirect=t,this.setTypeArrayBuffer(this,this.preservedIndex)}transfer2LiteralBuffer(){let e=new _.LiteralBuffer,t=new Array;t.push(new _.Literal(_.LiteralTag.INTEGER,p._COUNTER)),t.push(new _.Literal(_.LiteralTag.INTEGER,this.userDefinedClassNum)),t.push(new _.Literal(_.LiteralTag.INTEGER,this.anonymousRedirect.length));for(let e of this.anonymousRedirect)t.push(new _.Literal(_.LiteralTag.STRING,e));return e.addLiterals(...t),e}},t.ClassType=class extends h{constructor(e){super(),this.modifier=f.NONABSTRACT,this.extendsHeritage=d.ANY,this.implementsHeritages=new Array,this.staticFields=new Map,this.staticMethods=new Map,this.fields=new Map,this.methods=new Map,this.typeIndex=this.getIndexFromTypeArrayBuffer(new v),this.shiftedTypeIndex=this.typeIndex+d._LENGTH,this.addCurrentType(e,this.shiftedTypeIndex),this.fillInModifiers(e),this.fillInHeritages(e),this.fillInFieldsAndMethods(e),this.setTypeArrayBuffer(this,this.typeIndex)}fillInModifiers(e){if(e.modifiers)for(let t of e.modifiers)t.kind===o.SyntaxKind.AbstractKeyword&&(this.modifier=f.ABSTRACT)}fillInHeritages(e){if(e.heritageClauses)for(let t of e.heritageClauses){let e=t.getText();for(let r of t.types){let t=r.expression,n=this.getOrCreateRecordForDeclNode(t,t);e.startsWith("extends ")?this.extendsHeritage=n:e.startsWith("implements ")&&this.implementsHeritages.push(n)}}}fillInFields(e){let t=s.getTextOfIdentifierOrLiteral(e.name),r=Array(d.ANY,y.PUBLIC,m.NONREADONLY),n=!1;if(e.modifiers)for(let t of e.modifiers)switch(t.kind){case o.SyntaxKind.StaticKeyword:n=!0;break;case o.SyntaxKind.PrivateKeyword:r[1]=y.PRIVATE;break;case o.SyntaxKind.ProtectedKeyword:r[1]=y.PROTECTED;break;case o.SyntaxKind.ReadonlyKeyword:r[2]=m.READONLY}let i=e.type,a=e.name;r[0]=this.getOrCreateRecordForTypeNode(i,a),n?this.staticFields.set(t,r):this.fields.set(t,r)}fillInMethods(e){let t=e.name?e.name:void 0,r=new b(e);t&&this.setVariable2Type(t,r.shiftedTypeIndex);let n=this.tryGetTypeIndex(e);r.getModifier()?this.staticMethods.set(r.getFunctionName(),n):this.methods.set(r.getFunctionName(),n)}fillInFieldsAndMethods(e){if(e.members)for(let t of e.members)switch(t.kind){case o.SyntaxKind.MethodDeclaration:case o.SyntaxKind.Constructor:case o.SyntaxKind.GetAccessor:case o.SyntaxKind.SetAccessor:this.fillInMethods(t);break;case o.SyntaxKind.PropertyDeclaration:this.fillInFields(t)}}transfer2LiteralBuffer(){let e=new _.LiteralBuffer,t=new Array;return t.push(new _.Literal(_.LiteralTag.INTEGER,p.CLASS)),t.push(new _.Literal(_.LiteralTag.INTEGER,this.modifier)),t.push(new _.Literal(_.LiteralTag.INTEGER,this.extendsHeritage)),t.push(new _.Literal(_.LiteralTag.INTEGER,this.implementsHeritages.length)),this.implementsHeritages.forEach((e=>{t.push(new _.Literal(_.LiteralTag.INTEGER,e))})),this.transferFields2Literal(t,!1),this.transferMethods2Literal(t,!1),this.transferFields2Literal(t,!0),this.transferMethods2Literal(t,!0),e.addLiterals(...t),e}transferFields2Literal(e,t){let r=t?this.staticFields:this.fields;e.push(new _.Literal(_.LiteralTag.INTEGER,r.size)),r.forEach(((t,r)=>{e.push(new _.Literal(_.LiteralTag.STRING,r)),e.push(new _.Literal(_.LiteralTag.INTEGER,t[0])),e.push(new _.Literal(_.LiteralTag.INTEGER,t[1])),e.push(new _.Literal(_.LiteralTag.INTEGER,t[2]))}))}transferMethods2Literal(e,t){let r=t?this.staticMethods:this.methods;e.push(new _.Literal(_.LiteralTag.INTEGER,r.size)),r.forEach(((t,r)=>{e.push(new _.Literal(_.LiteralTag.STRING,r)),e.push(new _.Literal(_.LiteralTag.INTEGER,t))}))}},t.ClassInstType=class extends h{constructor(e){super(),this.shiftedReferredClassIndex=e,this.typeIndex=this.getIndexFromTypeArrayBuffer(this),this.shiftedTypeIndex=this.typeIndex+d._LENGTH,this.typeRecorder.setClass2InstanceMap(this.shiftedReferredClassIndex,this.shiftedTypeIndex)}transfer2LiteralBuffer(){let e=new _.LiteralBuffer,t=new Array;return t.push(new _.Literal(_.LiteralTag.INTEGER,p.CLASSINST)),t.push(new _.Literal(_.LiteralTag.INTEGER,this.shiftedReferredClassIndex)),e.addLiterals(...t),e}};class b extends h{constructor(e){super(),this.name="",this.accessFlag=y.PUBLIC,this.modifierStatic=g.NONSTATIC,this.parameters=new Array,this.returnType=d.ANY,this.typeIndex=this.getIndexFromTypeArrayBuffer(new v),this.shiftedTypeIndex=this.typeIndex+d._LENGTH,this.addCurrentType(e,this.shiftedTypeIndex),e.name?this.name=s.getTextOfIdentifierOrLiteral(e.name):this.name="constructor",this.fillInModifiers(e),this.fillInParameters(e),this.fillInReturn(e),this.setTypeArrayBuffer(this,this.typeIndex)}getFunctionName(){return this.name}fillInModifiers(e){if(e.modifiers)for(let t of e.modifiers)switch(t.kind){case o.SyntaxKind.PrivateKeyword:this.accessFlag=y.PRIVATE;break;case o.SyntaxKind.ProtectedKeyword:this.accessFlag=y.PROTECTED;break;case o.SyntaxKind.StaticKeyword:this.modifierStatic=g.STATIC}}fillInParameters(e){if(e.parameters)for(let t of e.parameters){let e=t.type,r=t.name,n=this.getOrCreateRecordForTypeNode(e,r);this.parameters.push(n)}}fillInReturn(e){let t=e.type,r=this.getOrCreateRecordForTypeNode(t,t);this.returnType=r}getModifier(){return this.modifierStatic}transfer2LiteralBuffer(){let e=new _.LiteralBuffer,t=new Array;return t.push(new _.Literal(_.LiteralTag.INTEGER,p.FUNCTION)),t.push(new _.Literal(_.LiteralTag.INTEGER,this.accessFlag)),t.push(new _.Literal(_.LiteralTag.INTEGER,this.modifierStatic)),t.push(new _.Literal(_.LiteralTag.STRING,this.name)),t.push(new _.Literal(_.LiteralTag.INTEGER,this.parameters.length)),this.parameters.forEach((e=>{t.push(new _.Literal(_.LiteralTag.INTEGER,e))})),t.push(new _.Literal(_.LiteralTag.INTEGER,this.returnType)),e.addLiterals(...t),e}}t.FunctionType=b,t.ExternalType=class extends h{constructor(e,t){super(),this.fullRedirectNath=`#${e}#${t}`,this.typeIndex=this.getIndexFromTypeArrayBuffer(this),this.shiftedTypeIndex=this.typeIndex+d._LENGTH}transfer2LiteralBuffer(){let e=new _.LiteralBuffer,t=new Array;return t.push(new _.Literal(_.LiteralTag.INTEGER,p.EXTERNAL)),t.push(new _.Literal(_.LiteralTag.STRING,this.fullRedirectNath)),e.addLiterals(...t),e}},t.UnionType=class extends h{constructor(e){super(),this.unionedTypeArray=[],this.typeIndex=d.ANY,this.shiftedTypeIndex=d.ANY,this.setOrReadFromArrayRecord(e)}setOrReadFromArrayRecord(e){let t=e.getText();this.hasUnionTypeMapping(t)?this.shiftedTypeIndex=this.getFromUnionTypeMap(t):(this.typeIndex=this.getIndexFromTypeArrayBuffer(new v),this.shiftedTypeIndex=this.typeIndex+d._LENGTH,this.fillInUnionArray(e,this.unionedTypeArray),this.setUnionTypeMap(t,this.shiftedTypeIndex),this.setTypeArrayBuffer(this,this.typeIndex))}hasUnionTypeMapping(e){return this.typeRecorder.hasUnionTypeMapping(e)}getFromUnionTypeMap(e){return this.typeRecorder.getFromUnionTypeMap(e)}setUnionTypeMap(e,t){return this.typeRecorder.setUnionTypeMap(e,t)}fillInUnionArray(e,t){for(let r of e.types){let e=r,n=this.getOrCreateRecordForTypeNode(e,e);t.push(n)}}transfer2LiteralBuffer(){let e=new _.LiteralBuffer,t=new Array;t.push(new _.Literal(_.LiteralTag.INTEGER,p.UNION)),t.push(new _.Literal(_.LiteralTag.INTEGER,this.unionedTypeArray.length));for(let e of this.unionedTypeArray)t.push(new _.Literal(_.LiteralTag.INTEGER,e));return e.addLiterals(...t),e}},t.ArrayType=class extends h{constructor(e){super(),this.referedTypeIndex=d.ANY,this.typeIndex=d.ANY,this.shiftedTypeIndex=d.ANY;let t=e.elementType;this.referedTypeIndex=this.getOrCreateRecordForTypeNode(t,t),this.setOrReadFromArrayRecord()}setOrReadFromArrayRecord(){this.hasArrayTypeMapping(this.referedTypeIndex)?this.shiftedTypeIndex=this.getFromArrayTypeMap(this.referedTypeIndex):(this.typeIndex=this.getIndexFromTypeArrayBuffer(this),this.shiftedTypeIndex=this.typeIndex+d._LENGTH,this.setTypeArrayBuffer(this,this.typeIndex),this.setArrayTypeMap(this.referedTypeIndex,this.shiftedTypeIndex))}hasArrayTypeMapping(e){return this.typeRecorder.hasArrayTypeMapping(e)}getFromArrayTypeMap(e){return this.typeRecorder.getFromArrayTypeMap(e)}setArrayTypeMap(e,t){return this.typeRecorder.setArrayTypeMap(e,t)}transfer2LiteralBuffer(){let e=new _.LiteralBuffer,t=new Array;return t.push(new _.Literal(_.LiteralTag.INTEGER,p.ARRAY)),t.push(new _.Literal(_.LiteralTag.INTEGER,this.referedTypeIndex)),e.addLiterals(...t),e}},t.ObjectType=class extends h{constructor(e){super(),this.properties=new Map,this.typeIndex=d.ANY,this.shiftedTypeIndex=d.ANY,this.typeIndex=this.getIndexFromTypeArrayBuffer(new v),this.shiftedTypeIndex=this.typeIndex+d._LENGTH,this.fillInMembers(e),this.setTypeArrayBuffer(this,this.typeIndex)}fillInMembers(e){for(let t of e.members){let e=t,r=t.name?t.name.getText():"#undefined",n=this.getOrCreateRecordForTypeNode(e.type,t.name);this.properties.set(r,n)}}transfer2LiteralBuffer(){let e=new _.LiteralBuffer,t=new Array;return t.push(new _.Literal(_.LiteralTag.INTEGER,p.OBJECT)),t.push(new _.Literal(_.LiteralTag.INTEGER,this.properties.size)),this.properties.forEach(((e,r)=>{t.push(new _.Literal(_.LiteralTag.STRING,r)),t.push(new _.Literal(_.LiteralTag.INTEGER,e))})),e.addLiterals(...t),e}},t.InterfaceType=class extends h{constructor(e){super(),this.heritages=new Array,this.fields=new Map,this.methods=new Array,this.typeIndex=this.getIndexFromTypeArrayBuffer(new v),this.shiftedTypeIndex=this.typeIndex+d._LENGTH,this.addCurrentType(e,this.shiftedTypeIndex),this.fillInHeritages(e),this.fillInFieldsAndMethods(e),this.setTypeArrayBuffer(this,this.typeIndex)}fillInHeritages(e){if(e.heritageClauses)for(let t of e.heritageClauses)for(let e of t.types){let t=e.expression,r=this.getOrCreateRecordForDeclNode(t,t);this.heritages.push(r)}}fillInFields(e){let t=s.getTextOfIdentifierOrLiteral(e.name),r=Array(d.ANY,y.PUBLIC,m.NONREADONLY);if(e.modifiers)for(let t of e.modifiers)switch(t.kind){case o.SyntaxKind.PrivateKeyword:r[1]=y.PRIVATE;break;case o.SyntaxKind.ProtectedKeyword:r[1]=y.PROTECTED;break;case o.SyntaxKind.ReadonlyKeyword:r[2]=m.READONLY}let n=e.type,i=e.name;r[0]=this.getOrCreateRecordForTypeNode(n,i),this.fields.set(t,r)}fillInMethods(e){let t=e.name?e.name:void 0,r=new b(e);t&&this.setVariable2Type(t,r.shiftedTypeIndex);let n=this.tryGetTypeIndex(e);this.methods.push(n)}fillInFieldsAndMethods(e){if(e.members)for(let t of e.members)switch(t.kind){case o.SyntaxKind.MethodSignature:this.fillInMethods(t);break;case o.SyntaxKind.PropertySignature:this.fillInFields(t)}}transfer2LiteralBuffer(){let e=new _.LiteralBuffer,t=new Array;return t.push(new _.Literal(_.LiteralTag.INTEGER,p.INTERFACE)),t.push(new _.Literal(_.LiteralTag.INTEGER,this.heritages.length)),this.heritages.forEach((e=>{t.push(new _.Literal(_.LiteralTag.INTEGER,e))})),this.transferFields2Literal(t),this.transferMethods2Literal(t),e.addLiterals(...t),e}transferFields2Literal(e){let t=this.fields;e.push(new _.Literal(_.LiteralTag.INTEGER,t.size)),t.forEach(((t,r)=>{e.push(new _.Literal(_.LiteralTag.STRING,r)),e.push(new _.Literal(_.LiteralTag.INTEGER,t[0])),e.push(new _.Literal(_.LiteralTag.INTEGER,t[1])),e.push(new _.Literal(_.LiteralTag.INTEGER,t[2]))}))}transferMethods2Literal(e){let t=this.methods;e.push(new _.Literal(_.LiteralTag.INTEGER,t.length)),t.forEach((t=>{e.push(new _.Literal(_.LiteralTag.INTEGER,t))}))}}},"./src/base/util.ts":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.getDtsFiles=t.isBase64Str=t.setPos=t.getRangeStartVregPos=t.getParameterLength4Ctor=t.getParamLengthOfFunc=t.isRestParameter=t.getRangeExplicitVregNums=t.isRangeInst=t.listenErrorEvent=t.listenChildExit=t.terminateWritePipe=t.initiateTs2abc=t.escapeUnicode=t.isAnonymousFunctionDefinition=t.isUndefinedIdentifier=t.isMemberExpression=t.isBindingOrAssignmentPattern=t.isArrayBindingOrAssignmentPattern=t.isObjectBindingOrAssignmentPattern=t.isBindingPattern=t.addUnicodeEscape=t.execute=t.setVariableExported=t.hasDefaultKeywordModifier=t.hasExportKeywordModifier=t.containSpreadElement=void 0;const o=a(r("fs")),s=a(r("path")),c=a(r("./node_modules/typescript/lib/typescript.js")),l=r("./src/statement/classStatement.ts"),u=r("./src/irnodes.ts"),_=a(r("./src/jshelpers.js")),d=r("./src/log.ts"),p=r("./src/scope.ts"),f=r("./src/syntaxCheckHelper.ts");function g(e){let t=0,r=0,n=e.length,i="";for(;r!=n;)"\\"==e[r]&&r+1!=n&&"u"==e[r+1]?(0!=r&&"\\"==e[r-1]?i+=e.substr(t,r-t)+"\\\\\\u":i+=e.substr(t,r-t)+"\\\\u",r+=2,t=r):r++;return r==n&&t!=r&&(i+=e.substr(t)),i}function m(e){return c.isObjectLiteralExpression(e)||c.isObjectBindingPattern(e)}function y(e){return c.isArrayLiteralExpression(e)||c.isArrayBindingPattern(e)}function h(e){return e instanceof u.EcmaCallithisrangedyn||e instanceof u.EcmaCallirangedyn||e instanceof u.EcmaNewobjdynrange||e instanceof u.EcmaCreateobjectwithexcludedkeys}function v(e){return!!e.dotDotDotToken}function b(e){let t=0,r=!0,n=e.parameters;return n&&n.forEach((e=>{(e.initializer||v(e))&&(r=!1),r&&t++})),t}t.containSpreadElement=function(e){if(!e)return!1;for(let t=0;t{e.kind==c.SyntaxKind.ExportKeyword&&(t=!0)})),t},t.hasDefaultKeywordModifier=function(e){let t=!1;return e.modifiers&&e.modifiers.forEach((e=>{e.kind==c.SyntaxKind.DefaultKeyword&&(t=!0)})),t},t.setVariableExported=function(e,t){if(!(t instanceof p.ModuleScope))throw new Error("variable can't be exported out of module scope");let r=t.find(e);r.v.setExport(),r.v.setExportedName(e)},t.execute=function(e,t){return(0,r("child_process").spawn)(e,[...t],{stdio:["pipe","inherit","inherit"]}).on("exit",(t=>1===t?((0,d.LOGD)("fail to execute cmd: ",e),0):((0,d.LOGD)("execute cmd successfully: ",e),1))),1},t.addUnicodeEscape=g,t.isBindingPattern=function(e){return c.isArrayBindingPattern(e)||c.isObjectBindingPattern(e)},t.isObjectBindingOrAssignmentPattern=m,t.isArrayBindingOrAssignmentPattern=y,t.isBindingOrAssignmentPattern=function(e){return y(e)||m(e)},t.isMemberExpression=function(e){return!(!c.isPropertyAccessExpression(e)&&!c.isElementAccessExpression(e))},t.isUndefinedIdentifier=function(e){return!!c.isIdentifier(e)&&"undefined"==_.getTextOfIdentifierOrLiteral(e)},t.isAnonymousFunctionDefinition=function(e){return!!(0,f.isFunctionLikeDeclaration)(e)&&!e.name},t.escapeUnicode=function(e){let t=0,r=0,n="";for(;-1!==(r=e.indexOf("\n",t));){let i=e.substring(t,r);-1!=i.indexOf("\\u")&&(i=g(i)),n=n.concat(i,"\n"),t=r+1}return n=n.concat("}\n"),n},t.initiateTs2abc=function(e){let t=s.join(s.resolve(__dirname,"../bin"),"js2abc");return e.unshift("--compile-by-pipe"),(0,r("child_process").spawn)(t,[...e],{stdio:["pipe","inherit","inherit","pipe"]})},t.terminateWritePipe=function(e){e||(0,d.LOGD)("ts2abc is not a valid object"),e.stdio[3].end()},t.listenChildExit=function(e){e||(0,d.LOGD)("child is not a valid object"),e.on("exit",(e=>{1===e&&(0,d.LOGD)("fail to generate panda binary file"),(0,d.LOGD)("success to generate panda binary file")}))},t.listenErrorEvent=function(e){e||(0,d.LOGD)("child is not a valid object"),e.on("error",(e=>{(0,d.LOGD)(e.toString())}))},t.isRangeInst=h,t.getRangeExplicitVregNums=function(e){return h(e)?e instanceof u.EcmaCreateobjectwithexcludedkeys?2:1:-1},t.isRestParameter=v,t.getParamLengthOfFunc=b,t.getParameterLength4Ctor=function(e){if(!(0,l.extractCtorOfClass)(e))return 0;let t,r=e.members;for(let e=0;e{e(t)})),t},t.isBase64Str=function(e){return""!=e&&""!=e.trim()&&Buffer.from(Buffer.from(e,"base64").toString()).toString("base64")==e},t.getDtsFiles=function(e){let t=[];return function e(r){o.readdirSync(r).forEach((function(n,i){let a=s.join(r,n),c=o.statSync(a);!0===c.isDirectory()&&e(a),!0===c.isFile()&&!0===n.endsWith(".d.ts")&&t.push(a)}))}(e),t}},"./src/base/vregisterCache.ts":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getVregisterCache=t.VregisterCache=t.CacheList=void 0;const n=r("./src/irnodes.ts"),i=r("./src/base/builtIn.ts"),a=r("./src/base/lexEnv.ts");var o;!function(e){e[e.MIN=0]="MIN",e[e.NaN=0]="NaN",e[e.HOLE=1]="HOLE",e[e.FUNC=2]="FUNC",e[e[1/0]=3]="Infinity",e[e[void 0]=4]="undefined",e[e.Symbol=5]="Symbol",e[e.Null=6]="Null",e[e.Global=7]="Global",e[e.LexEnv=8]="LexEnv",e[e.True=9]="True",e[e.False=10]="False",e[e.MAX=11]="MAX"}(o=t.CacheList||(t.CacheList={}));let s=new Map([[o.HOLE,i.expandHole],[o.NaN,i.expandNaN],[o.Infinity,i.expandInfinity],[o.undefined,i.expandUndefined],[o.Symbol,i.expandSymbol],[o.Null,i.expandNull],[o.Global,i.expandGlobal],[o.LexEnv,a.expandLexEnv],[o.True,i.expandTrue],[o.False,i.expandFalse],[o.FUNC,i.expandFunc]]);class c{constructor(e){this.flag=!1,this.vreg=void 0,this.expander=e}isNeeded(){return this.flag}getCache(){return this.flag&&this.vreg||(this.flag=!0,this.vreg=new n.VReg),this.vreg}getExpander(){return this.expander}}t.VregisterCache=class{constructor(){this.cache=[];for(let e=o.MIN;eo.MAX)throw new Error("invalid builtin index");return this.cache[e]}},t.getVregisterCache=function(e,t){return e.getVregisterCache().getCache(t).getCache()}},"./src/cmdOptions.ts":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.CmdOptions=void 0;const o=r("./node_modules/commander/index.js"),s=a(r("path")),c=a(r("./node_modules/typescript/lib/typescript.js")),l=r("./src/log.ts"),u=r("./src/base/util.ts");class _{static initOptions(){this.cmd.option("-m, --modules","compile as module.",!1).option("-l, --debug-log","show info debug log and generate the json file.",!1).option("-a, --dump-assembly","dump assembly to file.",!1).option("-d, --debug","compile with debug info.",!1).option("-w, --debug-add-watch ","watch expression and abc file path in debug mode.",[]).option("-k, --keep-persistent-watch ","keep persistent watch on js file with watched expression.",[]).option("-s, --show-statistics ","show compile statistics(ast, histogram, hoisting, all).",[""]).option("-o, --output ","set output file.","").option("-t, --timeout