diff --git a/dist/sval.es6.js b/dist/sval.es6.js index 0e1feb4..9857f61 100644 --- a/dist/sval.es6.js +++ b/dist/sval.es6.js @@ -464,7 +464,7 @@ const IMPORT = createSymbol('import'); const EXPORTS = createSymbol('exports'); - var version = "0.5.9"; + var version = "0.6.0"; class Var { constructor(kind, value) { @@ -1205,7 +1205,13 @@ } function* SpreadElement$1(node, scope, options = {}) { const result = yield* evaluate$1(node.argument, scope); - return options.spreadProps ? result : [...result]; + if (options.spreadProps) { + return result; + } + if (typeof Symbol === 'function' && typeof result[Symbol.iterator] !== 'function') { + throw new TypeError('Spread syntax requires ...iterable[Symbol.iterator] to be a function'); + } + return [...result]; } function* ChainExpression$1(node, scope) { return yield* evaluate$1(node.expression, scope); @@ -2629,7 +2635,13 @@ } function SpreadElement(node, scope, options = {}) { const result = evaluate(node.argument, scope); - return options.spreadProps ? result : [...result]; + if (options.spreadProps) { + return result; + } + if (typeof Symbol === 'function' && typeof result[Symbol.iterator] !== 'function') { + throw new TypeError('Spread syntax requires ...iterable[Symbol.iterator] to be a function'); + } + return [...result]; } function ChainExpression(node, scope) { return evaluate(node.expression, scope); diff --git a/dist/sval.js b/dist/sval.js index 12338ab..f0cc2cd 100644 --- a/dist/sval.js +++ b/dist/sval.js @@ -542,7 +542,7 @@ var IMPORT = createSymbol('import'); var EXPORTS = createSymbol('exports'); - var version = "0.5.9"; + var version = "0.6.0"; var Var = (function () { function Var(kind, value) { @@ -1557,7 +1557,13 @@ case 0: return [5, __values(evaluate$1(node.argument, scope))]; case 1: result = _a.sent(); - return [2, options.spreadProps ? result : __spread(result)]; + if (options.spreadProps) { + return [2, result]; + } + if (typeof Symbol === 'function' && typeof result[Symbol.iterator] !== 'function') { + throw new TypeError('Spread syntax requires ...iterable[Symbol.iterator] to be a function'); + } + return [2, __spread(result)]; } }); } @@ -3527,7 +3533,13 @@ function SpreadElement(node, scope, options) { if (options === void 0) { options = {}; } var result = evaluate(node.argument, scope); - return options.spreadProps ? result : __spread(result); + if (options.spreadProps) { + return result; + } + if (typeof Symbol === 'function' && typeof result[Symbol.iterator] !== 'function') { + throw new TypeError('Spread syntax requires ...iterable[Symbol.iterator] to be a function'); + } + return __spread(result); } function ChainExpression(node, scope) { return evaluate(node.expression, scope); diff --git a/dist/sval.min.js b/dist/sval.min.js index 5ffc685..143ba5f 100644 --- a/dist/sval.min.js +++ b/dist/sval.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Sval=t()}(this,function(){"use strict";var R=Object.freeze({__proto__:null,get ExpressionStatement(){return jt},get BlockStatement(){return Ut},get EmptyStatement(){return qt},get DebuggerStatement(){return Wt},get ReturnStatement(){return Gt},get BreakStatement(){return Ht},get ContinueStatement(){return zt},get LabeledStatement(){return Kt},get WithStatement(){return Qt},get IfStatement(){return Xt},get SwitchStatement(){return Yt},get SwitchCase(){return Zt},get ThrowStatement(){return Jt},get TryStatement(){return $t},get CatchClause(){return er},get WhileStatement(){return tr},get DoWhileStatement(){return rr},get ForStatement(){return ir},get ForInStatement(){return nr},get ForOfStatement(){return sr}}),O=Object.freeze({__proto__:null,get FunctionDeclaration(){return ar},get VariableDeclaration(){return or},get VariableDeclarator(){return cr},get ClassDeclaration(){return hr},get ClassBody(){return lr},get MethodDefinition(){return ur},get PropertyDefinition(){return pr},get StaticBlock(){return dr},get ImportDeclaration(){return fr},get ExportDefaultDeclaration(){return mr},get ExportNamedDeclaration(){return yr},get ExportAllDeclaration(){return gr}}),M=Object.freeze({__proto__:null,get ExpressionStatement(){return Br},get BlockStatement(){return Dr},get EmptyStatement(){return Rr},get DebuggerStatement(){return Or},get ReturnStatement(){return Mr},get BreakStatement(){return Fr},get ContinueStatement(){return jr},get LabeledStatement(){return Ur},get WithStatement(){return qr},get IfStatement(){return Wr},get SwitchStatement(){return Gr},get SwitchCase(){return Hr},get ThrowStatement(){return zr},get TryStatement(){return Kr},get CatchClause(){return Qr},get WhileStatement(){return Xr},get DoWhileStatement(){return Yr},get ForStatement(){return Zr},get ForInStatement(){return Jr},get ForOfStatement(){return $r}}),F=Object.freeze({__proto__:null,get FunctionDeclaration(){return ei},get VariableDeclaration(){return ti},get VariableDeclarator(){return ri},get ClassDeclaration(){return ii},get ClassBody(){return ni},get MethodDefinition(){return si},get PropertyDefinition(){return ai},get StaticBlock(){return oi},get ImportDeclaration(){return ci},get ExportDefaultDeclaration(){return hi},get ExportNamedDeclaration(){return li},get ExportAllDeclaration(){return ui}});function y(i,n){var s,a,o,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(s)throw new TypeError("Generator is already executing.");for(;c;)try{if(s=1,a&&(o=2&t[0]?a.return:t[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,t[1])).done)return o;switch(a=0,(t=o?[2&t[0],o.value]:t)[0]){case 0:case 1:o=t;break;case 4:return c.label++,{value:t[1],done:!1};case 5:c.label++,a=t[1],t=[0];continue;case 7:t=c.ops.pop(),c.trys.pop();continue;default:if(!(o=0<(o=c.trys).length&&o[o.length-1])&&(6===t[0]||2===t[0])){c=0;continue}if(3===t[0]&&(!o||t[1]>o[0]&&t[1]=e.length?void 0:e)&&e[r++],done:!e}}}}function j(){for(var e=[],t=0;t",t),template:new r("template"),invalidTemplate:new r("invalidTemplate"),ellipsis:new r("...",t),backQuote:new r("`",e),dollarBraceL:new r("${",{beforeExpr:!0,startsExpr:!0}),eq:new r("=",{beforeExpr:!0,isAssign:!0}),assign:new r("_=",{beforeExpr:!0,isAssign:!0}),incDec:new r("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new r("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:n("||",1),logicalAND:n("&&",2),bitwiseOR:n("|",3),bitwiseXOR:n("^",4),bitwiseAND:n("&",5),equality:n("==/!=/===/!==",6),relational:n("/<=/>=",7),bitShift:n("<>/>>>",8),plusMin:new r("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:n("%",10),star:n("*",10),slash:n("/",10),starstar:new r("**",{beforeExpr:!0}),coalesce:n("??",1),_break:s("break"),_case:s("case",t),_catch:s("catch"),_continue:s("continue"),_debugger:s("debugger"),_default:s("default",t),_do:s("do",{isLoop:!0,beforeExpr:!0}),_else:s("else",t),_finally:s("finally"),_for:s("for",{isLoop:!0}),_function:s("function",e),_if:s("if"),_return:s("return",t),_switch:s("switch"),_throw:s("throw",t),_try:s("try"),_var:s("var"),_const:s("const"),_while:s("while",{isLoop:!0}),_with:s("with"),_new:s("new",{beforeExpr:!0,startsExpr:!0}),_this:s("this",e),_super:s("super",e),_class:s("class",e),_extends:s("extends",t),_export:s("export"),_import:s("import",e),_null:s("null",e),_true:s("true",e),_false:s("false",e),_in:s("in",{beforeExpr:!0,binop:7}),_instanceof:s("instanceof",{beforeExpr:!0,binop:7}),_typeof:s("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:s("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:s("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},o=/\r\n?|\n|\u2028|\u2029/,t=new RegExp(o.source,"g");function me(e){return 10===e||13===e||8232===e||8233===e}function ye(e,t,r){void 0===r&&(r=e.length);for(var i=t;i>10),56320+(1023&e)))}function _e(e,t){this.line=e,this.column=t}function Ee(e,t,r){this.start=t,this.end=r,null!==e.sourceFile&&(this.source=e.sourceFile)}var Ce=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/;function Ie(e,t){for(var r=1,i=0;;){var n=ye(e,i,t);if(n<0)return new _e(r,t-i);++r,i=n}}var Ae={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!(_e.prototype.offset=function(e){return new _e(this.line,this.column+e)}),allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},Pe=!1;function Le(e){var t,r,a,o,i={};for(t in Ae)i[t]=(e&&xe(e,t)?e:Ae)[t];return"latest"===i.ecmaVersion?i.ecmaVersion=1e8:null==i.ecmaVersion?(!Pe&&"object"==typeof console&&console.warn&&(Pe=!0,console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")),i.ecmaVersion=11):2015<=i.ecmaVersion&&(i.ecmaVersion-=2009),null==i.allowReserved&&(i.allowReserved=i.ecmaVersion<5),e&&null!=e.allowHashBang||(i.allowHashBang=14<=i.ecmaVersion),we(i.onToken)&&(r=i.onToken,i.onToken=function(e){return r.push(e)}),we(i.onComment)&&(i.onComment=(o=(a=i).onComment,function(e,t,r,i,n,s){e={type:e?"Block":"Line",value:t,start:r,end:i};a.locations&&(e.loc=new Ee(this,n,s)),a.ranges&&(e.range=[r,i]),o.push(e)})),i}function Te(e,t){return 2|(e?4:0)|(t?8:0)}function l(e,t,r){this.options=e=Le(e),this.sourceFile=e.sourceFile,this.keywords=Se(ce[6<=e.ecmaVersion?6:"module"===e.sourceType?"5module":5]);var i="",i=(!0!==e.allowReserved&&(i=oe[6<=e.ecmaVersion?6:5===e.ecmaVersion?5:3],"module"===e.sourceType)&&(i+=" await"),this.reservedWords=Se(i),(i?i+" ":"")+oe.strict);this.reservedWordsStrict=Se(i),this.reservedWordsStrictBind=Se(i+" "+oe.strictBind),this.input=String(t),this.containsEsc=!1,r?(this.pos=r,this.lineStart=this.input.lastIndexOf("\n",r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(o).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=v.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null,this.privateNameStack=[]}function Ve(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}var e={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}},e=(l.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},e.inFunction.get=function(){return 0<(2&this.currentVarScope().flags)},e.inGenerator.get=function(){return 0<(8&this.currentVarScope().flags)&&!this.currentVarScope().inClassFieldInit},e.inAsync.get=function(){return 0<(4&this.currentVarScope().flags)&&!this.currentVarScope().inClassFieldInit},e.canAwait.get=function(){for(var e=this.scopeStack.length-1;0<=e;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||256&t.flags)return!1;if(2&t.flags)return 0<(4&t.flags)}return this.inModule&&13<=this.options.ecmaVersion||this.options.allowAwaitOutsideFunction},e.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,e=e.inClassFieldInit;return 0<(64&t)||e||this.options.allowSuperOutsideMethod},e.allowDirectSuper.get=function(){return 0<(128&this.currentThisScope().flags)},e.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},e.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,e=e.inClassFieldInit;return 0<(258&t)||e},e.inClassStaticBlock.get=function(){return 0<(256&this.currentVarScope().flags)},l.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var r=this,i=0;i=,?^&]/.test(i)||"!"===i&&"="===this.input.charAt(r+1));e+=n[0].length,c.lastIndex=e,e+=c.exec(this.input)[0].length,";"===this.input[e]&&e++}},e.eat=function(e){return this.type===e&&(this.next(),!0)},e.isContextual=function(e){return this.type===v.name&&this.value===e&&!this.containsEsc},e.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},e.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},e.canInsertSemicolon=function(){return this.type===v.eof||this.type===v.braceR||o.test(this.input.slice(this.lastTokEnd,this.start))},e.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},e.semicolon=function(){this.eat(v.semi)||this.insertSemicolon()||this.unexpected()},e.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},e.expect=function(e){this.eat(e)||this.unexpected()},e.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")},e.checkPatternErrors=function(e,t){e&&(-1e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,r=e.backReferenceNames;te.maxBackReference&&(e.maxBackReference=r),!0;if(r<=e.numCapturingParens)return!0;e.pos=t}return!1},e.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},e.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},e.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},e.regexp_eatZero=function(e){return 48===e.current()&&!nt(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},e.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},e.regexp_eatControlLetter=function(e){var t=e.current();return!!rt(t)&&(e.lastIntValue=t%32,e.advance(),!0)},e.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){var r=e.pos,t=(t=void 0===t?!1:t)||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(t&&55296<=i&&i<=56319){var n=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(56320<=s&&s<=57343)return e.lastIntValue=1024*(i-55296)+(s-56320)+65536,!0}e.pos=n,e.lastIntValue=i}return!0}if(t&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&0<=(s=e.lastIntValue)&&s<=1114111)return!0;t&&e.raise("Invalid unicode escape"),e.pos=r}return!1},e.regexp_eatIdentityEscape=function(e){var t;return e.switchU?!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0):!(99===(t=e.current())||e.switchN&&107===t||(e.lastIntValue=t,e.advance(),0))},e.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(49<=t&&t<=57){for(;e.lastIntValue=10*e.lastIntValue+(t-48),e.advance(),48<=(t=e.current())&&t<=57;);return!0}return!1};function it(e){return rt(e)||95===e}function nt(e){return 48<=e&&e<=57}function st(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function at(e){return 65<=e&&e<=70?e-65+10:97<=e&&e<=102?e-97+10:e-48}function ot(e){return 48<=e&&e<=55}e.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(100===(i=t)||68===i||115===i||83===i||119===i||87===i)return e.lastIntValue=-1,e.advance(),1;var r,i=!1;if(e.switchU&&9<=this.options.ecmaVersion&&((i=80===t)||112===t)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return i&&2===r&&e.raise("Invalid property name"),r;e.raise("Invalid property name")}return 0},e.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var r,i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e))return r=e.lastStringValue,this.regexp_validateUnicodePropertyNameAndValue(e,i,r),1}return e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)?(i=e.lastStringValue,this.regexp_validateUnicodePropertyNameOrValue(e,i)):0},e.regexp_validateUnicodePropertyNameAndValue=function(e,t,r){xe(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(r)||e.raise("Invalid property value")},e.regexp_validateUnicodePropertyNameOrValue=function(e,t){return e.unicodeProperties.binary.test(t)?1:e.switchV&&e.unicodeProperties.binaryOfStrings.test(t)?2:void e.raise("Invalid property name")},e.regexp_eatUnicodePropertyName=function(e){var t;for(e.lastStringValue="";it(t=e.current());)e.lastStringValue+=h(t),e.advance();return""!==e.lastStringValue},e.regexp_eatUnicodePropertyValue=function(e){var t,r;for(e.lastStringValue="";it(r=t=e.current())||nt(r);)e.lastStringValue+=h(t),e.advance();return""!==e.lastStringValue},e.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},e.regexp_eatCharacterClass=function(e){var t,r;return!!e.eat(91)&&(t=e.eat(94),r=this.regexp_classContents(e),e.eat(93)||e.raise("Unterminated character class"),t&&2===r&&e.raise("Negated character class may contain strings"),!0)},e.regexp_classContents=function(e){if(93!==e.current()){if(e.switchV)return this.regexp_classSetExpression(e);this.regexp_nonEmptyClassRanges(e)}return 1},e.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t,r=e.lastIntValue;e.eat(45)&&this.regexp_eatClassAtom(e)&&(t=e.lastIntValue,!e.switchU||-1!==r&&-1!==t||e.raise("Invalid character class"),-1!==r)&&-1!==t&&t=this.input.length?this.finishToken(v.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},b.readToken=function(e){return a(e,6<=this.options.ecmaVersion)||92===e?this.readWord():this.getTokenFromCode(e)},b.fullCharCodeAtPos=function(){var e,t=this.input.charCodeAt(this.pos);return t<=55295||56320<=t||(e=this.input.charCodeAt(this.pos+1))<=56319||57344<=e?t:(t<<10)+e-56613888},b.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,r=this.input.indexOf("*/",this.pos+=2);if(-1===r&&this.raise(this.pos-2,"Unterminated comment"),this.pos=r+2,this.options.locations)for(var i,n=t;-1<(i=ye(this.input,n,this.pos));)++this.curLine,n=this.lineStart=i;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,r),t,this.pos,e,this.curPosition())},b.skipLineComment=function(e){for(var t=this.pos,r=this.options.onComment&&this.curPosition(),i=this.input.charCodeAt(this.pos+=e);this.pos=this.input.length&&this.raise(r,"Unterminated regular expression");var i=this.input.charAt(this.pos);if(o.test(i)&&this.raise(r,"Unterminated regular expression"),e)e=!1;else{if("["===i)t=!0;else if("]"===i&&t)t=!1;else if("/"===i&&!t)break;e="\\"===i}++this.pos}var n=this.input.slice(r,this.pos),s=(++this.pos,this.pos),a=this.readWord1(),s=(this.containsEsc&&this.unexpected(s),this.regexpState||(this.regexpState=new w(this))),s=(s.reset(r,n,a),this.validateRegExpFlags(s),this.validateRegExpPattern(s),null);try{s=new RegExp(n,a)}catch(e){}return this.finishToken(v.regexp,{pattern:n,flags:a,value:s})},b.readInt=function(e,t,r){for(var i=12<=this.options.ecmaVersion&&void 0===t,n=r&&48===this.input.charCodeAt(this.pos),r=this.pos,s=0,a=0,o=0,c=null==t?1/0:t;o=this.input.length&&this.raise(this.start,"Unterminated string constant");var i=this.input.charCodeAt(this.pos);if(i===e)break;92===i?(t=(t+=this.input.slice(r,this.pos))+this.readEscapedChar(!1),r=this.pos):8232===i||8233===i?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(me(i)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(r,this.pos++),this.finishToken(v.string,t)};var lt={};b.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==lt)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},b.invalidStringToken=function(e,t){if(this.inTemplateElement&&9<=this.options.ecmaVersion)throw lt;this.raise(e,t)},b.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var r=this.input.charCodeAt(this.pos);if(96===r||36===r&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==v.template&&this.type!==v.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(v.template,e)):36===r?(this.pos+=2,this.finishToken(v.dollarBraceL)):(++this.pos,this.finishToken(v.backQuote));if(92===r)e=(e+=this.input.slice(t,this.pos))+this.readEscapedChar(!0),t=this.pos;else if(me(r)){switch(e+=this.input.slice(t,this.pos),++this.pos,r){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(r)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},b.readInvalidTemplateToken=function(){for(;this.pos":return[2,n=":return[2,n<=i];case"<<":return[2,i<>":return[2,i>>n];case">>>":return[2,i>>>n];case"+":return[2,i+n];case"-":return[2,i-n];case"*":return[2,i*n];case"**":return[2,Math.pow(i,n)];case"/":return[2,i/n];case"%":return[2,i%n];case"|":return[2,i|n];case"^":return[2,i^n];case"&":return[2,i&n];case"in":return[2,i in n];case"instanceof":return[2,i instanceof n];default:throw new SyntaxError("Unexpected token "+t.operator)}}})},AssignmentExpression:function(t,r){var i,n,s,a,o;return y(this,function(e){switch(e.label){case 0:return"Identifier"!==(i=t.left).type?[3,2]:[5,g(_t(i,r,{getVar:!0,throwErr:!1}))];case 1:return(n=e.sent())||(s=r.global().find("window").get(),n=new xt(s,i.name)),[3,7];case 2:return"MemberExpression"!==i.type?[3,4]:[5,g(At(i,r,{getVar:!0}))];case 3:return n=e.sent(),[3,7];case 4:return[5,g(L(t.right,r))];case 5:return s=e.sent(),[5,g(B(i,r,{feed:s}))];case 6:return[2,e.sent()];case 7:return[5,g(L(t.right,r))];case 8:switch(a=e.sent(),t.operator){case"=":return n.set(a),[2,n.get()];case"+=":return n.set(n.get()+a),[2,n.get()];case"-=":return n.set(n.get()-a),[2,n.get()];case"*=":return n.set(n.get()*a),[2,n.get()];case"/=":return n.set(n.get()/a),[2,n.get()];case"%=":return n.set(n.get()%a),[2,n.get()];case"**=":return n.set(Math.pow(n.get(),a)),[2,n.get()];case"<<=":return n.set(n.get()<>=":return n.set(n.get()>>a),[2,n.get()];case">>>=":return n.set(n.get()>>>a),[2,n.get()];case"|=":return n.set(n.get()|a),[2,n.get()];case"^=":return n.set(n.get()^a),[2,n.get()];case"&=":return n.set(n.get()&a),[2,n.get()];case"??=":return n.set(null!=(o=n.get())?o:a),[2,n.get()];case"&&=":return n.set(n.get()&&a),[2,n.get()];case"||=":return n.set(n.get()||a),[2,n.get()];default:throw new SyntaxError("Unexpected token "+t.operator)}}})},LogicalExpression:function(t,r){var i,n,s,a;return y(this,function(e){switch(e.label){case 0:switch(t.operator){case"||":return[3,1];case"&&":return[3,5];case"??":return[3,9]}return[3,14];case 1:return[5,g(L(t.left,r))];case 2:return(i=e.sent())?[3,4]:[5,g(L(t.right,r))];case 3:i=e.sent(),e.label=4;case 4:return[2,i];case 5:return[5,g(L(t.left,r))];case 6:return(n=e.sent())?[5,g(L(t.right,r))]:[3,8];case 7:n=e.sent(),e.label=8;case 8:return[2,n];case 9:return[5,g(L(t.left,r))];case 10:return null==(a=e.sent())?[3,11]:(s=a,[3,13]);case 11:return[5,g(L(t.right,r))];case 12:s=e.sent(),e.label=13;case 13:return[2,s];case 14:throw new SyntaxError("Unexpected token "+t.operator)}})},MemberExpression:At,ConditionalExpression:function(t,r){var i;return y(this,function(e){switch(e.label){case 0:return[5,g(L(t.test,r))];case 1:return e.sent()?[5,g(L(t.consequent,r))]:[3,3];case 2:return i=e.sent(),[3,5];case 3:return[5,g(L(t.alternate,r))];case 4:i=e.sent(),e.label=5;case 5:return[2,i]}})},CallExpression:function(t,r){var i,n,s,a,o,c,h,l,u,p,d,f,m;return y(this,function(e){switch(e.label){case 0:return"MemberExpression"!==t.callee.type?[3,5]:[5,g(At(t.callee,r,{getObj:!0}))];case 1:return(i=e.sent(),t.callee.optional&&null==i)?[2,void 0]:(n=void 0,s=!1,t.callee.computed?[5,g(L(t.callee.property,r))]:[3,3]);case 2:return n=e.sent(),[3,4];case 3:"PrivateIdentifier"===t.callee.property.type?(n=t.callee.property.name,s=!0):n=t.callee.property.name,e.label=4;case 4:if(m=i,s&&(m=m[E]),a="Super"===t.callee.object.type?(a=r.find("this").get(),m[n].bind(a)):m[n],t.optional&&null==a)return[2,void 0];if("function"!=typeof a)throw new TypeError(n+" is not a function");if(a[mt])throw new TypeError("Class constructor "+n+" cannot be invoked without 'new'");return[3,7];case 5:return i=r.find("this").get(),[5,g(L(t.callee,r))];case 6:if(a=e.sent(),t.optional&&null==a)return[2,void 0];if("function"!=typeof a||"Super"!==t.callee.type&&a[mt]){if("Identifier"===t.callee.type)o=t.callee.name;else try{o=JSON.stringify(a)}catch(e){o=""+a}throw"function"!=typeof a?new TypeError(o+" is not a function"):new TypeError("Class constructor "+o+" cannot be invoked without 'new'")}e.label=7;case 7:c=[],h=0,e.label=8;case 8:return h=t.length?void 0:t)&&t[i++],done:!t}}}),h=void 0,ut.RES=c.next(),[4,ut]):[3,8];case 2:h=e.sent(),e.label=3;case 3:return h.done?[3,7]:[5,g(gi(n,s,{value:h.value}))];case 4:if((p=e.sent())===_)return p.LABEL===a.label?[3,7]:[2,p];if(p===S)return p.LABEL===a.label?[3,5]:[2,p];if(p===k)return[2,p];e.label=5;case 5:return ut.RES=c.next(),[4,ut];case 6:return h=e.sent(),[3,3];case 7:return[3,15];case 8:e.trys.push([8,13,14,15]),l=g(o),u=l.next(),e.label=9;case 9:return u.done?[3,12]:(d=u.value,[5,g(gi(n,s,{value:d}))]);case 10:if((p=e.sent())===_)return p.LABEL===a.label?[3,12]:[2,p];if(p===S)return p.LABEL===a.label?[3,11]:[2,p];if(p===k)return[2,p];e.label=11;case 11:return u=l.next(),[3,9];case 12:return[3,15];case 13:return d=e.sent(),f={error:d},[3,15];case 14:try{u&&!u.done&&(m=l.return)&&m.call(l)}finally{if(f)throw f.error}return[7];case 15:return[2]}var t,r,i})}function ar(t,r){return y(this,function(e){return r.func(t.id.name,D(t,r)),[2]})}function or(t,r,i){var n;return void 0===i&&(i={}),y(this,function(e){switch(e.label){case 0:n=0,e.label=1;case 1:return n":return i=":return i<=r;case"<<":return r<>":return r>>i;case">>>":return r>>>i;case"+":return r+i;case"-":return r-i;case"*":return r*i;case"**":return Math.pow(r,i);case"/":return r/i;case"%":return r%i;case"|":return r|i;case"^":return r^i;case"&":return r&i;case"in":return r in i;case"instanceof":return r instanceof i;default:throw new SyntaxError("Unexpected token "+e.operator)}},AssignmentExpression:function(e,t){var r,i,n,s=e.left;if("Identifier"===s.type)(n=vr(s,t,{getVar:!0,throwErr:!1}))||(i=t.global().find("window").get(),n=new xt(i,s.name));else{if("MemberExpression"!==s.type)return V(s,t,{feed:T(e.right,t)});n=kr(s,t,{getVar:!0})}var a=T(e.right,t);switch(e.operator){case"=":return n.set(a),n.get();case"+=":return n.set(n.get()+a),n.get();case"-=":return n.set(n.get()-a),n.get();case"*=":return n.set(n.get()*a),n.get();case"/=":return n.set(n.get()/a),n.get();case"%=":return n.set(n.get()%a),n.get();case"**=":return n.set(Math.pow(n.get(),a)),n.get();case"<<=":return n.set(n.get()<>=":return n.set(n.get()>>a),n.get();case">>>=":return n.set(n.get()>>>a),n.get();case"|=":return n.set(n.get()|a),n.get();case"^=":return n.set(n.get()^a),n.get();case"&=":return n.set(n.get()&a),n.get();case"??=":return n.set(null!=(r=n.get())?r:a),n.get();case"&&=":return n.set(n.get()&&a),n.get();case"||=":return n.set(n.get()||a),n.get();default:throw new SyntaxError("Unexpected token "+e.operator)}},LogicalExpression:function(e,t){var r;switch(e.operator){case"||":return T(e.left,t)||T(e.right,t);case"&&":return T(e.left,t)&&T(e.right,t);case"??":return null!=(r=T(e.left,t))?r:T(e.right,t);default:throw new SyntaxError("Unexpected token "+e.operator)}},MemberExpression:kr,ConditionalExpression:function(e,t){return T(e.test,t)?T(e.consequent,t):T(e.alternate,t)},CallExpression:function(e,t){var r,i;if("MemberExpression"===e.callee.type){if(r=kr(e.callee,t,{getObj:!0}),e.callee.optional&&null==r)return;var n=void 0,s=!1,a=(e.callee.computed?n=T(e.callee.property,t):"PrivateIdentifier"===e.callee.property.type?(n=e.callee.property.name,s=!0):n=e.callee.property.name,r);if(s&&(a=a[E]),s="Super"===e.callee.object.type?(s=t.find("this").get(),a[n].bind(s)):a[n],e.optional&&null==s)return;if("function"!=typeof s)throw new TypeError(n+" is not a function");if(s[mt])throw new TypeError("Class constructor "+n+" cannot be invoked without 'new'")}else{if(r=t.find("this").get(),s=T(e.callee,t),e.optional&&null==s)return;if("function"!=typeof s||"Super"!==e.callee.type&&s[mt]){if("Identifier"===e.callee.type)i=e.callee.name;else try{i=JSON.stringify(s)}catch(e){i=""+s}throw"function"!=typeof s?new TypeError(i+" is not a function"):new TypeError("Class constructor "+i+" cannot be invoked without 'new'")}}for(var o=[],c=0;co[0]&&t[1]=e.length?void 0:e)&&e[r++],done:!e}}}}function j(){for(var e=[],t=0;t",t),template:new r("template"),invalidTemplate:new r("invalidTemplate"),ellipsis:new r("...",t),backQuote:new r("`",e),dollarBraceL:new r("${",{beforeExpr:!0,startsExpr:!0}),eq:new r("=",{beforeExpr:!0,isAssign:!0}),assign:new r("_=",{beforeExpr:!0,isAssign:!0}),incDec:new r("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new r("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:n("||",1),logicalAND:n("&&",2),bitwiseOR:n("|",3),bitwiseXOR:n("^",4),bitwiseAND:n("&",5),equality:n("==/!=/===/!==",6),relational:n("/<=/>=",7),bitShift:n("<>/>>>",8),plusMin:new r("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:n("%",10),star:n("*",10),slash:n("/",10),starstar:new r("**",{beforeExpr:!0}),coalesce:n("??",1),_break:s("break"),_case:s("case",t),_catch:s("catch"),_continue:s("continue"),_debugger:s("debugger"),_default:s("default",t),_do:s("do",{isLoop:!0,beforeExpr:!0}),_else:s("else",t),_finally:s("finally"),_for:s("for",{isLoop:!0}),_function:s("function",e),_if:s("if"),_return:s("return",t),_switch:s("switch"),_throw:s("throw",t),_try:s("try"),_var:s("var"),_const:s("const"),_while:s("while",{isLoop:!0}),_with:s("with"),_new:s("new",{beforeExpr:!0,startsExpr:!0}),_this:s("this",e),_super:s("super",e),_class:s("class",e),_extends:s("extends",t),_export:s("export"),_import:s("import",e),_null:s("null",e),_true:s("true",e),_false:s("false",e),_in:s("in",{beforeExpr:!0,binop:7}),_instanceof:s("instanceof",{beforeExpr:!0,binop:7}),_typeof:s("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:s("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:s("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},o=/\r\n?|\n|\u2028|\u2029/,t=new RegExp(o.source,"g");function me(e){return 10===e||13===e||8232===e||8233===e}function ye(e,t,r){void 0===r&&(r=e.length);for(var i=t;i>10),56320+(1023&e)))}function _e(e,t){this.line=e,this.column=t}function Ee(e,t,r){this.start=t,this.end=r,null!==e.sourceFile&&(this.source=e.sourceFile)}var Ce=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/;function Ie(e,t){for(var r=1,i=0;;){var n=ye(e,i,t);if(n<0)return new _e(r,t-i);++r,i=n}}var Ae={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!(_e.prototype.offset=function(e){return new _e(this.line,this.column+e)}),allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},Pe=!1;function Le(e){var t,r,a,o,i={};for(t in Ae)i[t]=(e&&xe(e,t)?e:Ae)[t];return"latest"===i.ecmaVersion?i.ecmaVersion=1e8:null==i.ecmaVersion?(!Pe&&"object"==typeof console&&console.warn&&(Pe=!0,console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")),i.ecmaVersion=11):2015<=i.ecmaVersion&&(i.ecmaVersion-=2009),null==i.allowReserved&&(i.allowReserved=i.ecmaVersion<5),e&&null!=e.allowHashBang||(i.allowHashBang=14<=i.ecmaVersion),we(i.onToken)&&(r=i.onToken,i.onToken=function(e){return r.push(e)}),we(i.onComment)&&(i.onComment=(o=(a=i).onComment,function(e,t,r,i,n,s){e={type:e?"Block":"Line",value:t,start:r,end:i};a.locations&&(e.loc=new Ee(this,n,s)),a.ranges&&(e.range=[r,i]),o.push(e)})),i}function Te(e,t){return 2|(e?4:0)|(t?8:0)}function l(e,t,r){this.options=e=Le(e),this.sourceFile=e.sourceFile,this.keywords=ke(ce[6<=e.ecmaVersion?6:"module"===e.sourceType?"5module":5]);var i="",i=(!0!==e.allowReserved&&(i=oe[6<=e.ecmaVersion?6:5===e.ecmaVersion?5:3],"module"===e.sourceType)&&(i+=" await"),this.reservedWords=ke(i),(i?i+" ":"")+oe.strict);this.reservedWordsStrict=ke(i),this.reservedWordsStrictBind=ke(i+" "+oe.strictBind),this.input=String(t),this.containsEsc=!1,r?(this.pos=r,this.lineStart=this.input.lastIndexOf("\n",r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(o).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=v.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null,this.privateNameStack=[]}function Ve(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}var e={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}},e=(l.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},e.inFunction.get=function(){return 0<(2&this.currentVarScope().flags)},e.inGenerator.get=function(){return 0<(8&this.currentVarScope().flags)&&!this.currentVarScope().inClassFieldInit},e.inAsync.get=function(){return 0<(4&this.currentVarScope().flags)&&!this.currentVarScope().inClassFieldInit},e.canAwait.get=function(){for(var e=this.scopeStack.length-1;0<=e;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||256&t.flags)return!1;if(2&t.flags)return 0<(4&t.flags)}return this.inModule&&13<=this.options.ecmaVersion||this.options.allowAwaitOutsideFunction},e.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,e=e.inClassFieldInit;return 0<(64&t)||e||this.options.allowSuperOutsideMethod},e.allowDirectSuper.get=function(){return 0<(128&this.currentThisScope().flags)},e.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},e.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,e=e.inClassFieldInit;return 0<(258&t)||e},e.inClassStaticBlock.get=function(){return 0<(256&this.currentVarScope().flags)},l.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var r=this,i=0;i=,?^&]/.test(i)||"!"===i&&"="===this.input.charAt(r+1));e+=n[0].length,c.lastIndex=e,e+=c.exec(this.input)[0].length,";"===this.input[e]&&e++}},e.eat=function(e){return this.type===e&&(this.next(),!0)},e.isContextual=function(e){return this.type===v.name&&this.value===e&&!this.containsEsc},e.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},e.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},e.canInsertSemicolon=function(){return this.type===v.eof||this.type===v.braceR||o.test(this.input.slice(this.lastTokEnd,this.start))},e.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},e.semicolon=function(){this.eat(v.semi)||this.insertSemicolon()||this.unexpected()},e.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},e.expect=function(e){this.eat(e)||this.unexpected()},e.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")},e.checkPatternErrors=function(e,t){e&&(-1e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,r=e.backReferenceNames;te.maxBackReference&&(e.maxBackReference=r),!0;if(r<=e.numCapturingParens)return!0;e.pos=t}return!1},e.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},e.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},e.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},e.regexp_eatZero=function(e){return 48===e.current()&&!nt(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},e.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},e.regexp_eatControlLetter=function(e){var t=e.current();return!!rt(t)&&(e.lastIntValue=t%32,e.advance(),!0)},e.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){var r=e.pos,t=(t=void 0===t?!1:t)||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(t&&55296<=i&&i<=56319){var n=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(56320<=s&&s<=57343)return e.lastIntValue=1024*(i-55296)+(s-56320)+65536,!0}e.pos=n,e.lastIntValue=i}return!0}if(t&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&0<=(s=e.lastIntValue)&&s<=1114111)return!0;t&&e.raise("Invalid unicode escape"),e.pos=r}return!1},e.regexp_eatIdentityEscape=function(e){var t;return e.switchU?!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0):!(99===(t=e.current())||e.switchN&&107===t||(e.lastIntValue=t,e.advance(),0))},e.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(49<=t&&t<=57){for(;e.lastIntValue=10*e.lastIntValue+(t-48),e.advance(),48<=(t=e.current())&&t<=57;);return!0}return!1};function it(e){return rt(e)||95===e}function nt(e){return 48<=e&&e<=57}function st(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function at(e){return 65<=e&&e<=70?e-65+10:97<=e&&e<=102?e-97+10:e-48}function ot(e){return 48<=e&&e<=55}e.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(100===(i=t)||68===i||115===i||83===i||119===i||87===i)return e.lastIntValue=-1,e.advance(),1;var r,i=!1;if(e.switchU&&9<=this.options.ecmaVersion&&((i=80===t)||112===t)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return i&&2===r&&e.raise("Invalid property name"),r;e.raise("Invalid property name")}return 0},e.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var r,i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e))return r=e.lastStringValue,this.regexp_validateUnicodePropertyNameAndValue(e,i,r),1}return e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)?(i=e.lastStringValue,this.regexp_validateUnicodePropertyNameOrValue(e,i)):0},e.regexp_validateUnicodePropertyNameAndValue=function(e,t,r){xe(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(r)||e.raise("Invalid property value")},e.regexp_validateUnicodePropertyNameOrValue=function(e,t){return e.unicodeProperties.binary.test(t)?1:e.switchV&&e.unicodeProperties.binaryOfStrings.test(t)?2:void e.raise("Invalid property name")},e.regexp_eatUnicodePropertyName=function(e){var t;for(e.lastStringValue="";it(t=e.current());)e.lastStringValue+=h(t),e.advance();return""!==e.lastStringValue},e.regexp_eatUnicodePropertyValue=function(e){var t,r;for(e.lastStringValue="";it(r=t=e.current())||nt(r);)e.lastStringValue+=h(t),e.advance();return""!==e.lastStringValue},e.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},e.regexp_eatCharacterClass=function(e){var t,r;return!!e.eat(91)&&(t=e.eat(94),r=this.regexp_classContents(e),e.eat(93)||e.raise("Unterminated character class"),t&&2===r&&e.raise("Negated character class may contain strings"),!0)},e.regexp_classContents=function(e){if(93!==e.current()){if(e.switchV)return this.regexp_classSetExpression(e);this.regexp_nonEmptyClassRanges(e)}return 1},e.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t,r=e.lastIntValue;e.eat(45)&&this.regexp_eatClassAtom(e)&&(t=e.lastIntValue,!e.switchU||-1!==r&&-1!==t||e.raise("Invalid character class"),-1!==r)&&-1!==t&&t=this.input.length?this.finishToken(v.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},b.readToken=function(e){return a(e,6<=this.options.ecmaVersion)||92===e?this.readWord():this.getTokenFromCode(e)},b.fullCharCodeAtPos=function(){var e,t=this.input.charCodeAt(this.pos);return t<=55295||56320<=t||(e=this.input.charCodeAt(this.pos+1))<=56319||57344<=e?t:(t<<10)+e-56613888},b.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,r=this.input.indexOf("*/",this.pos+=2);if(-1===r&&this.raise(this.pos-2,"Unterminated comment"),this.pos=r+2,this.options.locations)for(var i,n=t;-1<(i=ye(this.input,n,this.pos));)++this.curLine,n=this.lineStart=i;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,r),t,this.pos,e,this.curPosition())},b.skipLineComment=function(e){for(var t=this.pos,r=this.options.onComment&&this.curPosition(),i=this.input.charCodeAt(this.pos+=e);this.pos=this.input.length&&this.raise(r,"Unterminated regular expression");var i=this.input.charAt(this.pos);if(o.test(i)&&this.raise(r,"Unterminated regular expression"),e)e=!1;else{if("["===i)t=!0;else if("]"===i&&t)t=!1;else if("/"===i&&!t)break;e="\\"===i}++this.pos}var n=this.input.slice(r,this.pos),s=(++this.pos,this.pos),a=this.readWord1(),s=(this.containsEsc&&this.unexpected(s),this.regexpState||(this.regexpState=new w(this))),s=(s.reset(r,n,a),this.validateRegExpFlags(s),this.validateRegExpPattern(s),null);try{s=new RegExp(n,a)}catch(e){}return this.finishToken(v.regexp,{pattern:n,flags:a,value:s})},b.readInt=function(e,t,r){for(var i=12<=this.options.ecmaVersion&&void 0===t,n=r&&48===this.input.charCodeAt(this.pos),r=this.pos,s=0,a=0,o=0,c=null==t?1/0:t;o=this.input.length&&this.raise(this.start,"Unterminated string constant");var i=this.input.charCodeAt(this.pos);if(i===e)break;92===i?(t=(t+=this.input.slice(r,this.pos))+this.readEscapedChar(!1),r=this.pos):8232===i||8233===i?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(me(i)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(r,this.pos++),this.finishToken(v.string,t)};var lt={};b.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==lt)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},b.invalidStringToken=function(e,t){if(this.inTemplateElement&&9<=this.options.ecmaVersion)throw lt;this.raise(e,t)},b.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var r=this.input.charCodeAt(this.pos);if(96===r||36===r&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==v.template&&this.type!==v.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(v.template,e)):36===r?(this.pos+=2,this.finishToken(v.dollarBraceL)):(++this.pos,this.finishToken(v.backQuote));if(92===r)e=(e+=this.input.slice(t,this.pos))+this.readEscapedChar(!0),t=this.pos;else if(me(r)){switch(e+=this.input.slice(t,this.pos),++this.pos,r){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(r)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},b.readInvalidTemplateToken=function(){for(;this.pos":return[2,n=":return[2,n<=i];case"<<":return[2,i<>":return[2,i>>n];case">>>":return[2,i>>>n];case"+":return[2,i+n];case"-":return[2,i-n];case"*":return[2,i*n];case"**":return[2,Math.pow(i,n)];case"/":return[2,i/n];case"%":return[2,i%n];case"|":return[2,i|n];case"^":return[2,i^n];case"&":return[2,i&n];case"in":return[2,i in n];case"instanceof":return[2,i instanceof n];default:throw new SyntaxError("Unexpected token "+t.operator)}}})},AssignmentExpression:function(t,r){var i,n,s,a,o;return y(this,function(e){switch(e.label){case 0:return"Identifier"!==(i=t.left).type?[3,2]:[5,g(_t(i,r,{getVar:!0,throwErr:!1}))];case 1:return(n=e.sent())||(s=r.global().find("window").get(),n=new xt(s,i.name)),[3,7];case 2:return"MemberExpression"!==i.type?[3,4]:[5,g(At(i,r,{getVar:!0}))];case 3:return n=e.sent(),[3,7];case 4:return[5,g(L(t.right,r))];case 5:return s=e.sent(),[5,g(B(i,r,{feed:s}))];case 6:return[2,e.sent()];case 7:return[5,g(L(t.right,r))];case 8:switch(a=e.sent(),t.operator){case"=":return n.set(a),[2,n.get()];case"+=":return n.set(n.get()+a),[2,n.get()];case"-=":return n.set(n.get()-a),[2,n.get()];case"*=":return n.set(n.get()*a),[2,n.get()];case"/=":return n.set(n.get()/a),[2,n.get()];case"%=":return n.set(n.get()%a),[2,n.get()];case"**=":return n.set(Math.pow(n.get(),a)),[2,n.get()];case"<<=":return n.set(n.get()<>=":return n.set(n.get()>>a),[2,n.get()];case">>>=":return n.set(n.get()>>>a),[2,n.get()];case"|=":return n.set(n.get()|a),[2,n.get()];case"^=":return n.set(n.get()^a),[2,n.get()];case"&=":return n.set(n.get()&a),[2,n.get()];case"??=":return n.set(null!=(o=n.get())?o:a),[2,n.get()];case"&&=":return n.set(n.get()&&a),[2,n.get()];case"||=":return n.set(n.get()||a),[2,n.get()];default:throw new SyntaxError("Unexpected token "+t.operator)}}})},LogicalExpression:function(t,r){var i,n,s,a;return y(this,function(e){switch(e.label){case 0:switch(t.operator){case"||":return[3,1];case"&&":return[3,5];case"??":return[3,9]}return[3,14];case 1:return[5,g(L(t.left,r))];case 2:return(i=e.sent())?[3,4]:[5,g(L(t.right,r))];case 3:i=e.sent(),e.label=4;case 4:return[2,i];case 5:return[5,g(L(t.left,r))];case 6:return(n=e.sent())?[5,g(L(t.right,r))]:[3,8];case 7:n=e.sent(),e.label=8;case 8:return[2,n];case 9:return[5,g(L(t.left,r))];case 10:return null==(a=e.sent())?[3,11]:(s=a,[3,13]);case 11:return[5,g(L(t.right,r))];case 12:s=e.sent(),e.label=13;case 13:return[2,s];case 14:throw new SyntaxError("Unexpected token "+t.operator)}})},MemberExpression:At,ConditionalExpression:function(t,r){var i;return y(this,function(e){switch(e.label){case 0:return[5,g(L(t.test,r))];case 1:return e.sent()?[5,g(L(t.consequent,r))]:[3,3];case 2:return i=e.sent(),[3,5];case 3:return[5,g(L(t.alternate,r))];case 4:i=e.sent(),e.label=5;case 5:return[2,i]}})},CallExpression:function(t,r){var i,n,s,a,o,c,h,l,u,p,d,f,m;return y(this,function(e){switch(e.label){case 0:return"MemberExpression"!==t.callee.type?[3,5]:[5,g(At(t.callee,r,{getObj:!0}))];case 1:return(i=e.sent(),t.callee.optional&&null==i)?[2,void 0]:(n=void 0,s=!1,t.callee.computed?[5,g(L(t.callee.property,r))]:[3,3]);case 2:return n=e.sent(),[3,4];case 3:"PrivateIdentifier"===t.callee.property.type?(n=t.callee.property.name,s=!0):n=t.callee.property.name,e.label=4;case 4:if(m=i,s&&(m=m[E]),a="Super"===t.callee.object.type?(a=r.find("this").get(),m[n].bind(a)):m[n],t.optional&&null==a)return[2,void 0];if("function"!=typeof a)throw new TypeError(n+" is not a function");if(a[mt])throw new TypeError("Class constructor "+n+" cannot be invoked without 'new'");return[3,7];case 5:return i=r.find("this").get(),[5,g(L(t.callee,r))];case 6:if(a=e.sent(),t.optional&&null==a)return[2,void 0];if("function"!=typeof a||"Super"!==t.callee.type&&a[mt]){if("Identifier"===t.callee.type)o=t.callee.name;else try{o=JSON.stringify(a)}catch(e){o=""+a}throw"function"!=typeof a?new TypeError(o+" is not a function"):new TypeError("Class constructor "+o+" cannot be invoked without 'new'")}e.label=7;case 7:c=[],h=0,e.label=8;case 8:return h=t.length?void 0:t)&&t[i++],done:!t}}}),h=void 0,ut.RES=c.next(),[4,ut]):[3,8];case 2:h=e.sent(),e.label=3;case 3:return h.done?[3,7]:[5,g(gi(n,s,{value:h.value}))];case 4:if((p=e.sent())===_)return p.LABEL===a.label?[3,7]:[2,p];if(p===k)return p.LABEL===a.label?[3,5]:[2,p];if(p===S)return[2,p];e.label=5;case 5:return ut.RES=c.next(),[4,ut];case 6:return h=e.sent(),[3,3];case 7:return[3,15];case 8:e.trys.push([8,13,14,15]),l=g(o),u=l.next(),e.label=9;case 9:return u.done?[3,12]:(d=u.value,[5,g(gi(n,s,{value:d}))]);case 10:if((p=e.sent())===_)return p.LABEL===a.label?[3,12]:[2,p];if(p===k)return p.LABEL===a.label?[3,11]:[2,p];if(p===S)return[2,p];e.label=11;case 11:return u=l.next(),[3,9];case 12:return[3,15];case 13:return d=e.sent(),f={error:d},[3,15];case 14:try{u&&!u.done&&(m=l.return)&&m.call(l)}finally{if(f)throw f.error}return[7];case 15:return[2]}var t,r,i})}function ar(t,r){return y(this,function(e){return r.func(t.id.name,D(t,r)),[2]})}function or(t,r,i){var n;return void 0===i&&(i={}),y(this,function(e){switch(e.label){case 0:n=0,e.label=1;case 1:return n":return i=":return i<=r;case"<<":return r<>":return r>>i;case">>>":return r>>>i;case"+":return r+i;case"-":return r-i;case"*":return r*i;case"**":return Math.pow(r,i);case"/":return r/i;case"%":return r%i;case"|":return r|i;case"^":return r^i;case"&":return r&i;case"in":return r in i;case"instanceof":return r instanceof i;default:throw new SyntaxError("Unexpected token "+e.operator)}},AssignmentExpression:function(e,t){var r,i,n,s=e.left;if("Identifier"===s.type)(n=vr(s,t,{getVar:!0,throwErr:!1}))||(i=t.global().find("window").get(),n=new xt(i,s.name));else{if("MemberExpression"!==s.type)return V(s,t,{feed:T(e.right,t)});n=Sr(s,t,{getVar:!0})}var a=T(e.right,t);switch(e.operator){case"=":return n.set(a),n.get();case"+=":return n.set(n.get()+a),n.get();case"-=":return n.set(n.get()-a),n.get();case"*=":return n.set(n.get()*a),n.get();case"/=":return n.set(n.get()/a),n.get();case"%=":return n.set(n.get()%a),n.get();case"**=":return n.set(Math.pow(n.get(),a)),n.get();case"<<=":return n.set(n.get()<>=":return n.set(n.get()>>a),n.get();case">>>=":return n.set(n.get()>>>a),n.get();case"|=":return n.set(n.get()|a),n.get();case"^=":return n.set(n.get()^a),n.get();case"&=":return n.set(n.get()&a),n.get();case"??=":return n.set(null!=(r=n.get())?r:a),n.get();case"&&=":return n.set(n.get()&&a),n.get();case"||=":return n.set(n.get()||a),n.get();default:throw new SyntaxError("Unexpected token "+e.operator)}},LogicalExpression:function(e,t){var r;switch(e.operator){case"||":return T(e.left,t)||T(e.right,t);case"&&":return T(e.left,t)&&T(e.right,t);case"??":return null!=(r=T(e.left,t))?r:T(e.right,t);default:throw new SyntaxError("Unexpected token "+e.operator)}},MemberExpression:Sr,ConditionalExpression:function(e,t){return T(e.test,t)?T(e.consequent,t):T(e.alternate,t)},CallExpression:function(e,t){var r,i;if("MemberExpression"===e.callee.type){if(r=Sr(e.callee,t,{getObj:!0}),e.callee.optional&&null==r)return;var n=void 0,s=!1,a=(e.callee.computed?n=T(e.callee.property,t):"PrivateIdentifier"===e.callee.property.type?(n=e.callee.property.name,s=!0):n=e.callee.property.name,r);if(s&&(a=a[E]),s="Super"===e.callee.object.type?(s=t.find("this").get(),a[n].bind(s)):a[n],e.optional&&null==s)return;if("function"!=typeof s)throw new TypeError(n+" is not a function");if(s[mt])throw new TypeError("Class constructor "+n+" cannot be invoked without 'new'")}else{if(r=t.find("this").get(),s=T(e.callee,t),e.optional&&null==s)return;if("function"!=typeof s||"Super"!==e.callee.type&&s[mt]){if("Identifier"===e.callee.type)i=e.callee.name;else try{i=JSON.stringify(s)}catch(e){i=""+s}throw"function"!=typeof s?new TypeError(i+" is not a function"):new TypeError("Class constructor "+i+" cannot be invoked without 'new'")}}for(var o=[],c=0;c