var mod$$inline_58=function(a){function b(a){n=a||{};for(var b in Ua)Object.prototype.hasOwnProperty.call(n,b)||(n[b]=Ua[b]);wa=n.sourceFile||null}function c(a,b){var c=Ab(k,a);b+=" ("+c.line+":"+c.column+")";var f=new SyntaxError(b);f.pos=a;f.loc=c;f.raisedAt=g;throw f;}function d(a){function b(a){if(1==a.length)return c+="return str === "+JSON.stringify(a[0])+";";c+="switch(str){";for(var va=0;vaa)++g;else if(47===a)if(a=k.charCodeAt(g+1),42===a){var a=n.onComment&&n.locations&&new f,b=g,e=k.indexOf("*/",g+=2);-1===e&&c(g-2,"Unterminated comment"); g=e+2;if(n.locations){Y.lastIndex=b;for(var d=void 0;(d=Y.exec(k))&&d.index=a?a=P(!0):(++g,a=e(xa)),a;case 40:return++g,e(J);case 41:return++g,e(F);case 59:return++g,e(K);case 44:return++g,e(L);case 91:return++g,e(ja); case 93:return++g,e(ka);case 123:return++g,e(Z);case 125:return++g,e(T);case 58:return++g,e(aa);case 63:return++g,e(ya);case 48:if(a=k.charCodeAt(g+1),120===a||88===a)return g+=2,a=x(16),null==a&&c(y+2,"Expected hexadecimal number"),la(k.charCodeAt(g))&&c(g,"Identifier directly after number"),a=e(ba,a);case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return P(!1);case 34:case 39:a:{g++;for(var b="";;){g>=S&&c(y,"Unterminated string constant");var f=k.charCodeAt(g);if(f===a){++g; a=e(da,b);break a}if(92===f){var f=k.charCodeAt(++g),d=/^[0-7]+/.exec(k.slice(g,g+3));for(d&&(d=d[0]);d&&255=S)return e(pa);var b=k.charCodeAt(g);if(la(b)||92===b)return Ya();a=m(b);if(!1===a){b=String.fromCharCode(b);if("\\"===b||Za.test(b))return Ya();c(g,"Unexpected character '"+b+"'")}return a}function t(a,b){var c=k.slice(g,g+b);g+=b;e(a,c)}function D(){for(var a="",b,f,d=g;;){g>= S&&c(d,"Unterminated regular expression");a=k.charAt(g);na.test(a)&&c(d,"Unterminated regular expression");if(b)b=!1;else{if("["===a)f=!0;else if("]"===a&&f)f=!1;else if("/"===a&&!f)break;b="\\"===a}++g}a=k.slice(d,g);++g;(b=$a())&&!/^[gmsiy]*$/.test(b)&&c(d,"Invalid regexp flag");return e(Ba,new RegExp(a,b))}function x(a,b){for(var c=g,f=0,e=0,d=null==b?Infinity:b;e=h?h-48:Infinity;if(h>=a)break;++g;f=f*a+h}return g===c||null!= b&&g-c!==b?null:f}function P(a){var b=g,f=!1,d=48===k.charCodeAt(g);a||null!==x(10)||c(b,"Invalid number");46===k.charCodeAt(g)&&(++g,x(10),f=!0);a=k.charCodeAt(g);if(69===a||101===a)a=k.charCodeAt(++g),43!==a&&45!==a||++g,null===x(10)&&c(b,"Invalid number"),f=!0;la(k.charCodeAt(g))&&c(g,"Identifier directly after number");a=k.slice(b,g);var h;f?h=parseFloat(a):d&&1!==a.length?/[89]/.test(a)||C?c(b,"Invalid number"):h=parseInt(a,8):h=parseInt(a,10);return e(ba,h)}function ma(a){a=x(16,a);null===a&& c(y,"Bad character escape sequence");return a}function $a(){ca=!1;for(var a,b=!0,f=g;;){var e=k.charCodeAt(g);if(ab(e))ca&&(a+=k.charAt(g)),++g;else if(92===e){ca||(a=k.slice(f,g));ca=!0;117!=k.charCodeAt(++g)&&c(g,"Expecting Unicode escape sequence \\uXXXX");++g;var e=ma(4),d=String.fromCharCode(e);d||c(g-1,"Invalid Unicode escape");(b?la(e):ab(e))||c(g-4,"Invalid Unicode escape");a+=d}else break;b=!1}return ca?a:k.slice(f,g)}function Ya(){var a=$a(),b=V;ca||(Lb(a)?b=Ca[a]:(n.forbidReserved&&(3=== n.ecmaVersion?Mb:Nb)(a)||C&&bb(a))&&c(y,"The keyword '"+a+"' is reserved"));return e(b,a)}function r(){Da=y;M=X;Ea=ia;A()}function Fa(a){C=a;g=M;if(n.locations)for(;gb){var e=Q(a);e.left=a;e.operator=I;a=p;r();e.right=Ra(Sa(),f,c);f=q(e,a===Va||a===Wa?"LogicalExpression":"BinaryExpression");return Ra(f,b,c)}return a}function Sa(){if(p.prefix){var a=z(),b=p.isUpdate;a.operator=I;R=a.prefix=!0;r();a.argument= Sa();b?ra(a.argument):C&&"delete"===a.operator&&"Identifier"===a.argument.type&&c(a.start,"Deleting local variable in strict mode");return q(a,b?"UpdateExpression":"UnaryExpression")}for(b=ha(ua());p.postfix&&!qa();)a=Q(b),a.operator=I,a.prefix=!1,a.argument=b,ra(b),r(),b=q(a,"UpdateExpression");return b}function ha(a,b){if(u(xa)){var c=Q(a);c.object=a;c.property=O(!0);c.computed=!1;return ha(q(c,"MemberExpression"),b)}return u(ja)?(c=Q(a),c.object=a,c.property=B(),c.computed=!0,v(ka),ha(q(c,"MemberExpression"), b)):!b&&u(J)?(c=Q(a),c.callee=a,c.arguments=Ta(F,!1),ha(q(c,"CallExpression"),b)):a}function ua(){switch(p){case ub:var a=z();r();return q(a,"ThisExpression");case V:return O();case ba:case da:case Ba:return a=z(),a.value=I,a.raw=k.slice(y,X),r(),q(a,"Literal");case vb:case wb:case xb:return a=z(),a.value=p.atomValue,a.raw=p.keyword,r(),q(a,"Literal");case J:var a=oa,b=y;r();var f=B();f.start=b;f.end=X;n.locations&&(f.loc.start=a,f.loc.end=ia);n.ranges&&(f.range=[b,X]);v(F);return f;case ja:return a= z(),r(),a.elements=Ta(ka,!0,!0),q(a,"ArrayExpression");case Z:a=z();b=!0;f=!1;a.properties=[];for(r();!u(T);){if(b)b=!1;else if(v(L),n.allowTrailingCommas&&u(T))break;var e={key:p===ba||p===da?ua():O(!0)},d=!1,h;u(aa)?(e.value=B(!0),h=e.kind="init"):5<=n.ecmaVersion&&"Identifier"===e.key.type&&("get"===e.key.name||"set"===e.key.name)?(d=f=!0,h=e.kind=e.key.name,e.key=p===ba||p===da?ua():O(!0),p!==J&&N(),e.value=Na(z(),!1)):N();if("Identifier"===e.key.type&&(C||f))for(var g=0;gf?a.id:a.params[f],(bb(e.name)||sa(e.name))&&c(e.start,"Defining '"+e.name+"' in strict mode"),0<=f)for(var d=0;da?36===a:91>a?!0:97>a?95===a:123>a?!0:170<=a&&Za.test(String.fromCharCode(a))},ab=a.isIdentifierChar=function(a){return 48>a?36===a:58>a?!0:65>a?!1:91>a?!0:97>a?95===a:123>a?!0:170<=a&&Pb.test(String.fromCharCode(a))},ca,Ia={kind:"loop"},Ob={kind:"switch"}}; "object"==typeof exports&&"object"==typeof module?mod$$inline_58(exports):"function"==typeof define&&define.amd?define(["exports"],mod$$inline_58):mod$$inline_58(this.acorn||(this.acorn={}));/* JavaScript Interpreter Copyright 2013 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ var Interpreter=function(a,b){this.ast=acorn.parse(a);this.initFunc_=b;this.paused_=!1;this.UNDEFINED=new Interpreter.Primitive(void 0,this);this.NULL=new Interpreter.Primitive(null,this);this.TRUE=new Interpreter.Primitive(!0,this);this.FALSE=new Interpreter.Primitive(!1,this);this.NUMBER_ZERO=new Interpreter.Primitive(0,this);this.NUMBER_ONE=new Interpreter.Primitive(1,this);this.STRING_EMPTY=new Interpreter.Primitive("",this);var c=this.createScope(this.ast,null);this.TRUE.parent=this.BOOLEAN; this.FALSE.parent=this.BOOLEAN;this.NUMBER_ZERO.parent=this.NUMBER;this.NUMBER_ONE.parent=this.NUMBER;this.STRING_EMPTY.parent=this.STRING;this.stateStack=[{node:this.ast,scope:c,thisExpression:c,done:!1}]}; Interpreter.prototype.appendCode=function(a){var b=this.stateStack[this.stateStack.length-1];if(!b||"Program"!=b.node.type)throw"Expecting original AST to start with a Program node.";a=acorn.parse(a);if(!a||"Program"!=a.type)throw"Expecting new AST to start with a Program node.";for(var c=0,d;d=a.body[c];c++)b.node.body.push(d);b.done=!1}; Interpreter.prototype.step=function(){var a=this.stateStack[0];if(!a||"Program"==a.node.type&&a.done)return!1;if(this.paused_)return!0;this["step"+a.node.type]();return!0};Interpreter.prototype.run=function(){for(;!this.paused_&&this.step(););return this.paused_}; Interpreter.prototype.initGlobalScope=function(a){this.setProperty(a,"Infinity",this.createPrimitive(Infinity),!0);this.setProperty(a,"NaN",this.createPrimitive(NaN),!0);this.setProperty(a,"undefined",this.UNDEFINED,!0);this.setProperty(a,"window",a,!0);this.setProperty(a,"self",a,!1);this.initFunction(a);this.initObject(a);a.parent=this.OBJECT;this.initArray(a);this.initNumber(a);this.initString(a);this.initBoolean(a);this.initDate(a);this.initMath(a);this.initRegExp(a);this.initJSON(a);var b=this, c;c=function(a){a=a||b.UNDEFINED;return b.createPrimitive(isNaN(a.toNumber()))};this.setProperty(a,"isNaN",this.createNativeFunction(c));c=function(a){a=a||b.UNDEFINED;return b.createPrimitive(isFinite(a.toNumber()))};this.setProperty(a,"isFinite",this.createNativeFunction(c));c=function(a){a=a||b.UNDEFINED;return b.createPrimitive(parseFloat(a.toNumber()))};this.setProperty(a,"parseFloat",this.createNativeFunction(c));c=function(a,c){a=a||b.UNDEFINED;c=c||b.UNDEFINED;return b.createPrimitive(parseInt(a.toString(), c.toNumber()))};this.setProperty(a,"parseInt",this.createNativeFunction(c));c=this.createObject(this.FUNCTION);c.eval=!0;this.setProperty(c,"length",this.NUMBER_ONE,!0);this.setProperty(a,"eval",c);for(var d="escape unescape decodeURI decodeURIComponent encodeURI encodeURIComponent".split(" "),f=0;fa?Math.max(this.length+a,0):Math.min(a,this.length);e=c(e,Infinity);e=Math.min(e,this.length-a);for(var l=b.createObject(b.ARRAY),m=a;m=a;m--)this.properties[m+arguments.length-2]=this.properties[m];this.length+=arguments.length-2;for(m=2;ml&&(l=this.length+l);var l=Math.max(0,Math.min(l,this.length)),m=c(e,this.length);0>m&&(m=this.length+m);for(var m=Math.max(0,Math.min(m,this.length)),A=0;lh&&(h=this.length+h);for(h=Math.max(0,Math.min(h,this.length));hh&&(h=this.length+h);for(h=Math.max(0,Math.min(h,this.length));0<=h;h--){var l=b.getProperty(this,h);if(0==b.comp(l,a))return b.createPrimitive(h)}return b.createPrimitive(-1)}; this.setProperty(this.ARRAY.properties.prototype,"lastIndexOf",this.createNativeFunction(d),!1,!0);d=function(){for(var a=[],c=0;cb?1:0};Interpreter.prototype.arrayIndex=function(a){a=Number(a);return!isFinite(a)||a!=Math.floor(a)||0>a?NaN:a}; Interpreter.Primitive=function(a,b){var c=typeof a;this.data=a;this.type=c;"number"==c?this.parent=b.NUMBER:"string"==c?this.parent=b.STRING:"boolean"==c&&(this.parent=b.BOOLEAN)};Interpreter.Primitive.prototype.data=void 0;Interpreter.Primitive.prototype.type=void 0;Interpreter.Primitive.prototype.parent=null;Interpreter.Primitive.prototype.isPrimitive=!0;Interpreter.Primitive.prototype.toBoolean=function(){return Boolean(this.data)};Interpreter.Primitive.prototype.toNumber=function(){return Number(this.data)}; Interpreter.Primitive.prototype.toString=function(){return String(this.data)};Interpreter.Primitive.prototype.valueOf=function(){return this.data};Interpreter.prototype.createPrimitive=function(a){return void 0===a?this.UNDEFINED:null===a?this.NULL:!0===a?this.TRUE:!1===a?this.FALSE:0===a?this.NUMBER_ZERO:1===a?this.NUMBER_ONE:""===a?this.STRING_EMPTY:a instanceof RegExp?this.createRegExp(this.createObject(this.REGEXP),a):new Interpreter.Primitive(a,this)}; Interpreter.prototype.createObject=function(a){a={isPrimitive:!1,type:"object",parent:a,fixed:Object.create(null),nonenumerable:Object.create(null),properties:Object.create(null),toBoolean:function(){return!0},toNumber:function(){return NaN},toString:function(){return"["+this.type+"]"},valueOf:function(){return this}};this.isa(a,this.FUNCTION)&&(a.type="function",this.setProperty(a,"prototype",this.createObject(this.OBJECT||null)));this.isa(a,this.ARRAY)&&(a.length=0,a.toNumber=function(){return 0}, a.toString=function(){for(var a=[],c=0;c>="==b.operator)b=f>>e;else if(">>>="==b.operator)b=f>>>e;else if("&="==b.operator)b=f&e;else if("^="==b.operator)b=f^e;else if("|="==b.operator)b=f|e;else throw"Unknown assignment expression: "+b.operator;b=this.createPrimitive(b)}this.setValue(c,b);this.stateStack[0].value=b}else a.doneRight=!0,a.leftSide=a.value,this.stateStack.unshift({node:b.right});else a.doneLeft=!0,this.stateStack.unshift({node:b.left,components:!0})}; Interpreter.prototype.stepBinaryExpression=function(){var a=this.stateStack[0],b=a.node;if(a.doneLeft)if(a.doneRight){this.stateStack.shift();var c=a.leftValue,a=a.value,d=this.comp(c,a);if("=="==b.operator||"!="==b.operator)c=c.isPrimitive&&a.isPrimitive?c.data==a.data:0===d,"!="==b.operator&&(c=!c);else if("==="==b.operator||"!=="==b.operator)c=c.isPrimitive&&a.isPrimitive?c.data===a.data:c===a,"!=="==b.operator&&(c=!c);else if(">"==b.operator)c=1==d;else if(">="==b.operator)c=1==d||0===d;else if("<"== b.operator)c=-1==d;else if("<="==b.operator)c=-1==d||0===d;else if("+"==b.operator)"string"==c.type||"string"==a.type?(c=c.toString(),a=a.toString()):(c=c.toNumber(),a=a.toNumber()),c+=a;else if("in"==b.operator)c=this.hasProperty(a,c);else if(c=c.toNumber(),a=a.toNumber(),"-"==b.operator)c-=a;else if("*"==b.operator)c*=a;else if("/"==b.operator)c/=a;else if("%"==b.operator)c%=a;else if("&"==b.operator)c&=a;else if("|"==b.operator)c|=a;else if("^"==b.operator)c^=a;else if("<<"==b.operator)c<<=a;else if(">>"== b.operator)c>>=a;else if(">>>"==b.operator)c>>>=a;else throw"Unknown binary operator: "+b.operator;this.stateStack[0].value=this.createPrimitive(c)}else a.doneRight=!0,a.leftValue=a.value,this.stateStack.unshift({node:b.right});else a.doneLeft=!0,this.stateStack.unshift({node:b.left})};Interpreter.prototype.stepBlockStatement=function(){var a=this.stateStack[0],b=a.node,c=a.n_||0;b.body[c]?(a.done=!1,a.n_=c+1,this.stateStack.unshift({node:b.body[c]})):(a.done=!0,"Program"!=a.node.type&&this.stateStack.shift())}; Interpreter.prototype.stepBreakStatement=function(){var a=this.stateStack.shift(),a=a.node,b=null;a.label&&(b=a.label.name);for(a=this.stateStack.shift();a&&"CallExpression"!=a.node.type&&"NewExpression"!=a.node.type;){if(b?b==a.label:a.isLoop||a.isSwitch)return;a=this.stateStack.shift()}throw new SyntaxError("Illegal break statement");}; Interpreter.prototype.stepCallExpression=function(){var a=this.stateStack[0],b=a.node;if(a.doneCallee_){if(a.func_)c=a.n_,a.arguments.length!=b.arguments.length&&(a.arguments[c-1]=a.value);else{if("function"==a.value.type)a.func_=a.value;else if(a.member_=a.value[0],a.func_=this.getValue(a.value),!a.func_||"function"!=a.func_.type){this.throwException((a.func_&&a.func_.type)+" is not a function");return}"NewExpression"==a.node.type?(a.funcThis_=this.createObject(a.func_),a.isConstructor_=!0):a.funcThis_= a.value.length?a.value[0]:this.stateStack[this.stateStack.length-1].thisExpression;a.arguments=[];var c=0}if(b.arguments[c])a.n_=c+1,this.stateStack.unshift({node:b.arguments[c]});else if(a.doneExec)this.stateStack.shift(),this.stateStack[0].value=a.isConstructor_&&"object"!==a.value.type?a.funcThis_:a.value;else{a.doneExec=!0;if(a.func_.node&&("FunctionApply_"==a.func_.node.type||"FunctionCall_"==a.func_.node.type)){a.funcThis_=a.arguments.shift();if("FunctionApply_"==a.func_.node.type){var d=a.arguments.shift(); if(d&&this.isa(d,this.ARRAY))for(a.arguments=[],b=0;bb?a.arguments[b]:this.UNDEFINED;this.setProperty(c,d,f)}d=this.createObject(this.ARRAY);for(b=0;b