16 lines
463 KiB
JavaScript
16 lines
463 KiB
JavaScript
|
(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.uniter=e()}})(function(){var e,t,r;return function e(t,r,n){function i(a,o){if(!r[a]){if(!t[a]){var u=typeof require=="function"&&require;if(!o&&u)return u(a,!0);if(s)return s(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[a]={exports:{}};t[a][0].call(l.exports,function(e){var r=t[a][1][e];return i(r?r:e)},l,l.exports,e,t,r,n)}return r[a].exports}var s=typeof require=="function"&&require;for(var a=0;a<n.length;a++)i(n[a]);return i}({1:[function(e,t,r){(function(r){"use strict";var n=e("phpruntime"),i=e("phptoast"),s=e("phptojs"),a=e("./js/ScriptLoader"),o=e("./js/Uniter"),u,c;c=new o(i,s,n);u=new a(r,'script[type="text/x-uniter-php"]',c);u.loadScripts();t.exports=c}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./js/ScriptLoader":4,"./js/Uniter":6,phpruntime:219,phptoast:238,phptojs:243}],2:[function(e,t,r){"use strict";var n=e("microdash"),i={}.hasOwnProperty,s=e("phpcommon"),a="include",o=s.PHPError,u=e("./Promise");function c(e,t,r,n,i){this.environment=n;this.options=i||{};this.phpParser=e;this.phpRuntime=r;this.phpToJS=t}n.extend(c.prototype,{configure:function(e){n.extend(this.options,e)},execute:function(e,t){var r=this,s,c,l=new u,f,p;function h(e,t){r.phpParser.getState().setPath(t||null);e="return "+r.phpToJS.transpile(r.phpParser.parse(e),{bare:true})+";";p=new Function(e)();return r.phpRuntime.compile(p)}t=t||null;c=n.extend({},r.options,{path:t});if(i.call(c,a)){c[a]=function(e){return function(t,r,i,s){var a={reject:r.reject,resolve:function(e){if(n.isString(e)){r.resolve(h(e,t));return}r.resolve(e)}};e(t,a,i,s)}}(c[a])}try{s=h(e,t)}catch(e){if(t===null&&e instanceof o){r.getStderr().write(e.message)}return l.reject(e)}f=s(c,r.environment);f.execute().then(function(e){l.resolve(e.getNative(),e.getType(),e)},function(e){l.reject(e)});return l},expose:function(e,t){this.environment.expose(e,t)},getStderr:function(){return this.environment.getStderr()},getStdin:function(){return this.environment.getStdin()},getStdout:function(){return this.environment.getStdout()}});t.exports=c},{"./Promise":3,microdash:79,phpcommon:146}],3:[function(e,t,r){"use strict";var n=e("microdash"),i=[].slice,s=e("util"),a=e("./SimplePromise"),o=a.prototype;function u(){a.call(this)}s.inherits(u,a);n.extend(u.prototype,{always:function(e){return this.then(e,e)},done:function(e){return this.then(e)},fail:function(e){return this.then(null,e)},resolve:function(){return o.resolve.call(this,i.call(arguments))},then:function(e,t){return o.then.call(this,e?function(t){e.apply(null,t)}:null,t)}});t.exports=u},{"./SimplePromise":5,microdash:79,util:265}],4:[function(e,t,r){"use strict";var n=e("microdash");function i(e,t,r){this.global=e;this.scriptSelector=t;this.uniter=r}n.extend(i.prototype,{loadScripts:function(){var e=this,t,r;if(!e.global.document){return}r=this.global.document.querySelectorAll(this.scriptSelector);if(r.length===0){return}t=e.uniter.createEngine("PHP");t.expose(e.global.document,"document");t.expose(e.global,"window");t.getStdout().on("data",function(t){if(e.global.console){e.global.console.log(t)}});t.getStderr().on("data",function(t){if(e.global.console){e.global.console.error(t)}});[].forEach.call(r,function(r){var n=r.textContent;t.execute("<?php "+n).fail(function(t){if(e.global.console){e.global.console.error(t.toString());throw t}})})}});t.exports=i},{microdash:79}],5:[function(e,t,r){"use strict";var n=e("microdash"),i=0,s=1,a=2;function o(){this.mode=i;this.thens=[];this.valueArgs=null}n.extend(o.prototype,{reject:function(){var e=[].slice.call(arguments),t=this;if(t.mode===i){t.mode=s;t.valueArgs=e;n.each(t.thens,function(t){if(t.onReject){t.onReject.apply(null,e)}})}return t},resolve:functio
|
||
|
;if(n.isArray(t.onToken)){(function(){var e=t.onToken;t.onToken=function(t){return e.push(t)}})()}if(n.isArray(t.onComment))t.onComment=o(t,t.onComment);return t}function o(e,t){return function(r,n,s,a,o,u){var c={type:r?"Block":"Line",value:n,start:s,end:a};if(e.locations)c.loc=new i.SourceLocation(this,o,u);if(e.ranges)c.range=[s,a];t.push(c)}}},{"./locutil":5,"./util":15}],9:[function(e,t,r){"use strict";var n=e("./tokentype");var i=e("./state");var s=e("./whitespace");var a=i.Parser.prototype;a.isUseStrict=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&e.expression.raw.slice(1,-1)==="use strict"};a.eat=function(e){if(this.type===e){this.next();return true}else{return false}};a.isContextual=function(e){return this.type===n.types.name&&this.value===e};a.eatContextual=function(e){return this.value===e&&this.eat(n.types.name)};a.expectContextual=function(e){if(!this.eatContextual(e))this.unexpected()};a.canInsertSemicolon=function(){return this.type===n.types.eof||this.type===n.types.braceR||s.lineBreak.test(this.input.slice(this.lastTokEnd,this.start))};a.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon)this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc);return true}};a.semicolon=function(){if(!this.eat(n.types.semi)&&!this.insertSemicolon())this.unexpected()};a.afterTrailingComma=function(e){if(this.type==e){if(this.options.onTrailingComma)this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc);this.next();return true}};a.expect=function(e){this.eat(e)||this.unexpected()};a.unexpected=function(e){this.raise(e!=null?e:this.start,"Unexpected token")};a.checkPatternErrors=function(e,t){var r=e&&e.trailingComma;if(!t)return!!r;if(r)this.raise(r,"Trailing comma is not permitted in destructuring patterns")};a.checkExpressionErrors=function(e,t){var r=e&&e.shorthandAssign;if(!t)return!!r;if(r)this.raise(r,"Shorthand property assignments are valid only in destructuring patterns")}},{"./state":10,"./tokentype":14,"./whitespace":16}],10:[function(e,t,r){"use strict";r.__esModule=true;function n(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var i=e("./identifier");var s=e("./tokentype");var a=e("./whitespace");var o=e("./options");var u={};r.plugins=u;function c(e){return new RegExp("^("+e.replace(/ /g,"|")+")$")}var l=function(){function e(t,r,u){n(this,e);this.options=t=o.getOptions(t);this.sourceFile=t.sourceFile;this.keywords=c(i.keywords[t.ecmaVersion>=6?6:5]);var l=t.allowReserved?"":i.reservedWords[t.ecmaVersion]+(t.sourceType=="module"?" await":"");this.reservedWords=c(l);var f=(l?l+" ":"")+i.reservedWords.strict;this.reservedWordsStrict=c(f);this.reservedWordsStrictBind=c(f+" "+i.reservedWords.strictBind);this.input=String(r);this.containsEsc=false;this.loadPlugins(t.plugins);if(u){this.pos=u;this.lineStart=Math.max(0,this.input.lastIndexOf("\n",u));this.curLine=this.input.slice(0,this.lineStart).split(a.lineBreak).length}else{this.pos=this.lineStart=0;this.curLine=1}this.type=s.types.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=true;this.strict=this.inModule=t.sourceType==="module";this.potentialArrowAt=-1;this.inFunction=this.inGenerator=false;this.labels=[];if(this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!")this.skipLineComment(2)}e.prototype.isKeyword=function e(t){return this.keywords.test(t)};e.prototype.isReservedWord=function e(t){return this.reservedWords.test(t)};e.prototype.extend=function e(t,r){this[t]=r(this[t])};e.prototype.loadPlugins=function e(t){for(var r in t){var n=u[r];if(!n)throw new Error("Plugin '"+r+"' not found");n(this,t[r])}};e.prototype.parse=function e(){var t=this.options.program||this.startNode();this.nextToken();return this.parseTopLevel(t)};return e}();r.Parser=l},{"./identifier":2,"./options":8,"./tokentype":14,".
|
||
|
if(this.pos===this.start&&this.type===s.types.template){if(r===36){this.pos+=2;return this.finishToken(s.types.dollarBraceL)}else{++this.pos;return this.finishToken(s.types.backQuote)}}e+=this.input.slice(t,this.pos);return this.finishToken(s.types.template,e)}if(r===92){e+=this.input.slice(t,this.pos);e+=this.readEscapedChar(true);t=this.pos}else if(u.isNewLine(r)){e+=this.input.slice(t,this.pos);++this.pos;switch(r){case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(r);break}if(this.options.locations){++this.curLine;this.lineStart=this.pos}t=this.pos}else{++this.pos}}};l.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);++this.pos;switch(t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return m(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:if(this.options.locations){this.lineStart=this.pos;++this.curLine}return"";default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0];var n=parseInt(r,8);if(n>255){r=r.slice(0,-1);n=parseInt(r,8)}if(r!=="0"&&(this.strict||e)){this.raise(this.pos-2,"Octal literal in strict mode")}this.pos+=r.length-1;return String.fromCharCode(n)}return String.fromCharCode(t)}};l.readHexChar=function(e){var t=this.pos;var r=this.readInt(16,e);if(r===null)this.raise(t,"Bad character escape sequence");return r};l.readWord1=function(){this.containsEsc=false;var e="",t=true,r=this.pos;var n=this.options.ecmaVersion>=6;while(this.pos<this.input.length){var s=this.fullCharCodeAtPos();if(i.isIdentifierChar(s,n)){this.pos+=s<=65535?1:2}else if(s===92){this.containsEsc=true;e+=this.input.slice(r,this.pos);var a=this.pos;if(this.input.charCodeAt(++this.pos)!=117)this.raise(this.pos,"Expecting Unicode escape sequence \\uXXXX");++this.pos;var o=this.readCodePoint();if(!(t?i.isIdentifierStart:i.isIdentifierChar)(o,n))this.raise(a,"Invalid Unicode escape");e+=m(o);r=this.pos}else{break}t=false}return e+this.input.slice(r,this.pos)};l.readWord=function(){var e=this.readWord1();var t=s.types.name;if((this.options.ecmaVersion>=6||!this.containsEsc)&&this.keywords.test(e))t=s.keywords[e];return this.finishToken(t,e)}},{"./identifier":2,"./locutil":5,"./state":10,"./tokentype":14,"./whitespace":16}],14:[function(e,t,r){"use strict";r.__esModule=true;function n(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var i=function e(t){var r=arguments.length<=1||arguments[1]===undefined?{}:arguments[1];n(this,e);this.label=t;this.keyword=r.keyword;this.beforeExpr=!!r.beforeExpr;this.startsExpr=!!r.startsExpr;this.isLoop=!!r.isLoop;this.isAssign=!!r.isAssign;this.prefix=!!r.prefix;this.postfix=!!r.postfix;this.binop=r.binop||null;this.updateContext=null};r.TokenType=i;function s(e,t){return new i(e,{beforeExpr:true,binop:t})}var a={beforeExpr:true},o={startsExpr:true};var u={num:new i("num",o),regexp:new i("regexp",o),string:new i("string",o),name:new i("name",o),eof:new i("eof"),bracketL:new i("[",{beforeExpr:true,startsExpr:true}),bracketR:new i("]"),braceL:new i("{",{beforeExpr:true,startsExpr:true}),braceR:new i("}"),parenL:new i("(",{beforeExpr:true,startsExpr:true}),parenR:new i(")"),comma:new i(",",a),semi:new i(";",a),colon:new i(":",a),dot:new i("."),question:new i("?",a),arrow:new i("=>",a),template:new i("template"),ellipsis:new i("...",a),backQuote:new i("`",o),dollarBraceL:new i("${",{beforeExpr:true,startsExpr:true}),eq:new i("=",{beforeExpr:true,isAssign:true}),assign:new i("_=",{beforeExpr:true,isAssign:true}),incDec:new i("++/--",{prefix:true,postfix:true,startsExpr:true}),prefix:new i("prefix",{beforeExpr:true,prefix:true,startsExpr:true}),logicalOR:s("||",1),logicalAND:s("&&",2),bitwiseOR:s("|",3),bitwiseXOR:s("^",4),bitwiseAND:s("&",5),equality:s("==/!=",6),relational:s("</>",7),bitShift:s("<</>>",8),plusMin:new i("+/-",{beforeExpr:true,binop:9,prefix:true,startsExpr:true}),modulo:s("%",10),st
|
||
|
;var n=e("./valid-callable"),i=e("./valid-value"),s=Function.prototype.bind,a=Function.prototype.call,o=Object.keys,u=Object.prototype.propertyIsEnumerable;t.exports=function(e,t){return function(r,c){var l,f=arguments[2],p=arguments[3];r=Object(i(r));n(c);l=o(r);if(p){l.sort(typeof p==="function"?s.call(p,r):undefined)}if(typeof e!=="function")e=l[e];return a.call(e,l,function(e,n){if(!u.call(r,e))return t;return a.call(c,f,r[e],e,r,n)})}}},{"./valid-callable":42,"./valid-value":44}],25:[function(e,t,r){"use strict";t.exports=e("./is-implemented")()?Object.assign:e("./shim")},{"./is-implemented":26,"./shim":27}],26:[function(e,t,r){"use strict";t.exports=function(){var e=Object.assign,t;if(typeof e!=="function")return false;t={foo:"raz"};e(t,{bar:"dwa"},{trzy:"trzy"});return t.foo+t.bar+t.trzy==="razdwatrzy"}},{}],27:[function(e,t,r){"use strict";var n=e("../keys"),i=e("../valid-value"),s=Math.max;t.exports=function(e,t){var r,a,o=s(arguments.length,2),u;e=Object(i(e));u=function(n){try{e[n]=t[n]}catch(e){if(!r)r=e}};for(a=1;a<o;++a){t=arguments[a];n(t).forEach(u)}if(r!==undefined)throw r;return e}},{"../keys":34,"../valid-value":44}],28:[function(e,t,r){"use strict";var n=e("../array/from"),i=e("./assign"),s=e("./valid-value");t.exports=function(e){var t=Object(s(e)),r=arguments[1],a=Object(arguments[2]);if(t!==e&&!r)return t;var o={};if(r){n(r,function(t){if(a.ensure||t in e)o[t]=e[t]})}else{i(o,e)}return o}},{"../array/from":13,"./assign":25,"./valid-value":44}],29:[function(e,t,r){"use strict";var n=Object.create,i;if(!e("./set-prototype-of/is-implemented")()){i=e("./set-prototype-of/shim")}t.exports=function(){var e,t,r;if(!i)return n;if(i.level!==1)return n;e={};t={};r={configurable:false,enumerable:false,writable:true,value:undefined};Object.getOwnPropertyNames(Object.prototype).forEach(function(e){if(e==="__proto__"){t[e]={configurable:true,enumerable:false,writable:true,value:undefined};return}t[e]=r});Object.defineProperties(e,t);Object.defineProperty(i,"nullPolyfill",{configurable:false,enumerable:false,writable:false,value:e});return function(t,r){return n(t===null?e:t,r)}}()},{"./set-prototype-of/is-implemented":40,"./set-prototype-of/shim":41}],30:[function(e,t,r){"use strict";t.exports=e("./_iterate")("forEach")},{"./_iterate":24}],31:[function(e,t,r){"use strict";t.exports=function(e){return typeof e==="function"}},{}],32:[function(e,t,r){"use strict";var n=e("./is-value");var i={function:true,object:true};t.exports=function(e){return n(e)&&i[typeof e]||false}},{"./is-value":33}],33:[function(e,t,r){"use strict";var n=e("../function/noop")();t.exports=function(e){return e!==n&&e!==null}},{"../function/noop":18}],34:[function(e,t,r){"use strict";t.exports=e("./is-implemented")()?Object.keys:e("./shim")},{"./is-implemented":35,"./shim":36}],35:[function(e,t,r){"use strict";t.exports=function(){try{Object.keys("primitive");return true}catch(e){return false}}},{}],36:[function(e,t,r){"use strict";var n=e("../is-value");var i=Object.keys;t.exports=function(e){return i(n(e)?Object(e):e)}},{"../is-value":33}],37:[function(e,t,r){"use strict";var n=e("./valid-callable"),i=e("./for-each"),s=Function.prototype.call;t.exports=function(e,t){var r={},a=arguments[2];n(t);i(e,function(e,n,i,o){r[n]=s.call(t,a,e,n,i,o)});return r}},{"./for-each":30,"./valid-callable":42}],38:[function(e,t,r){"use strict";var n=e("./is-value");var i=Array.prototype.forEach,s=Object.create;var a=function(e,t){var r;for(r in e)t[r]=e[r]};t.exports=function(e){var t=s(null);i.call(arguments,function(e){if(!n(e))return;a(Object(e),t)});return t}},{"./is-value":33}],39:[function(e,t,r){"use strict";t.exports=e("./is-implemented")()?Object.setPrototypeOf:e("./shim")},{"./is-implemented":40,"./shim":41}],40:[function(e,t,r){"use strict";var n=Object.create,i=Object.getPrototypeOf,s={};t.exports=function(){var e=Object.setPrototypeOf,t=arguments[0]||n;if(typeof e!=="function")return false;return i(e(t(null),s))===s}},{}],41:[function(e,t,r){"use strict";var n=e("../is-object"),i=e("../valid-value"),s=Object.prototype.isPrototypeOf,a=Object.defi
|
||
|
if(e.slice(r,r+8)!=="function"){return false}t=e.charCodeAt(r+8);return t===40||u.code.isWhiteSpace(t)||t===42||u.code.isLineTerminator(t)}r=[this.generateExpression(e.expression,i.Sequence,j)];s=ce(r).toString();if(s.charCodeAt(0)===123||a(s)||o(s)||c(s)||A&&t&L&&e.expression.type===n.Literal&&typeof e.expression.value==="string"){r=["(",r,")"+this.semicolon(t)]}else{r.push(this.semicolon(t))}return r},ImportDeclaration:function(e,t){var r,s,a=this;if(e.specifiers.length===0){return["import",y,this.generateExpression(e.source,i.Sequence,j),this.semicolon(t)]}r=["import"];s=0;if(e.specifiers[s].type===n.ImportDefaultSpecifier){r=fe(r,[this.generateExpression(e.specifiers[s],i.Sequence,j)]);++s}if(e.specifiers[s]){if(s!==0){r.push(",")}if(e.specifiers[s].type===n.ImportNamespaceSpecifier){r=fe(r,[y,this.generateExpression(e.specifiers[s],i.Sequence,j)])}else{r.push(y+"{");if(e.specifiers.length-s===1){r.push(y);r.push(this.generateExpression(e.specifiers[s],i.Sequence,j));r.push(y+"}"+y)}else{he(function(t){var n,o;r.push(g);for(n=s,o=e.specifiers.length;n<o;++n){r.push(t);r.push(a.generateExpression(e.specifiers[n],i.Sequence,j));if(n+1<o){r.push(","+g)}}});if(!Q(ce(r).toString())){r.push(g)}r.push(l+"}"+y)}}}r=fe(r,["from"+y,this.generateExpression(e.source,i.Sequence,j),this.semicolon(t)]);return r},VariableDeclarator:function(e,t){var r=t&w?j:k;if(e.init){return[this.generateExpression(e.id,i.Assignment,r),y,"=",y,this.generateExpression(e.init,i.Assignment,r)]}return this.generatePattern(e.id,i.Assignment,r)},VariableDeclaration:function(e,t){var r,n,i,s,a,o=this;r=[e.kind];a=t&w?q:Y;function u(){s=e.declarations[0];if(S.comment&&s.leadingComments){r.push("\n");r.push(pe(o.generateStatement(s,a)))}else{r.push(le());r.push(o.generateStatement(s,a))}for(n=1,i=e.declarations.length;n<i;++n){s=e.declarations[n];if(S.comment&&s.leadingComments){r.push(","+g);r.push(pe(o.generateStatement(s,a)))}else{r.push(","+y);r.push(o.generateStatement(s,a))}}}if(e.declarations.length>1){he(u)}else{u()}r.push(this.semicolon(t));return r},ThrowStatement:function(e,t){return[fe("throw",this.generateExpression(e.argument,i.Sequence,j)),this.semicolon(t)]},TryStatement:function(e,t){var r,n,i,s;r=["try",this.maybeBlock(e.block,q)];r=this.maybeBlockSuffix(e.block,r);if(e.handlers){for(n=0,i=e.handlers.length;n<i;++n){r=fe(r,this.generateStatement(e.handlers[n],q));if(e.finalizer||n+1!==i){r=this.maybeBlockSuffix(e.handlers[n].body,r)}}}else{s=e.guardedHandlers||[];for(n=0,i=s.length;n<i;++n){r=fe(r,this.generateStatement(s[n],q));if(e.finalizer||n+1!==i){r=this.maybeBlockSuffix(s[n].body,r)}}if(e.handler){if(c(e.handler)){for(n=0,i=e.handler.length;n<i;++n){r=fe(r,this.generateStatement(e.handler[n],q));if(e.finalizer||n+1!==i){r=this.maybeBlockSuffix(e.handler[n].body,r)}}}else{r=fe(r,this.generateStatement(e.handler,q));if(e.finalizer){r=this.maybeBlockSuffix(e.handler.body,r)}}}}if(e.finalizer){r=fe(r,["finally",this.maybeBlock(e.finalizer,q)])}return r},SwitchStatement:function(e,t){var r,n,s,a,o,u=this;he(function(){r=["switch"+y+"(",u.generateExpression(e.discriminant,i.Sequence,j),")"+y+"{"+g]});if(e.cases){o=q;for(s=0,a=e.cases.length;s<a;++s){if(s===a-1){o|=M}n=pe(this.generateStatement(e.cases[s],o));r.push(n);if(!Q(ce(n).toString())){r.push(g)}}}r.push(pe("}"));return r},SwitchCase:function(e,t){var r,s,a,o,u,c=this;he(function(){if(e.test){r=[fe("case",c.generateExpression(e.test,i.Sequence,j)),":"]}else{r=["default:"]}a=0;o=e.consequent.length;if(o&&e.consequent[0].type===n.BlockStatement){s=c.maybeBlock(e.consequent[0],q);r.push(s);a=1}if(a!==o&&!Q(ce(r).toString())){r.push(g)}u=q;for(;a<o;++a){if(a===o-1&&t&M){u|=M}s=pe(c.generateStatement(e.consequent[a],u));r.push(s);if(a+1!==o&&!Q(ce(s).toString())){r.push(g)}}});return r},IfStatement:function(e,t){var r,s,a,o=this;he(function(){r=["if"+y+"(",o.generateExpression(e.test,i.Sequence,j),")"]});a=t&M;s=q;if(a){s|=M}if(e.alternate){r.push(this.maybeBlock(e.consequent,q));r=this.maybeBlockSuffix(e.consequent,r);if(e.alternate.type===n.IfStatement){r=fe(r,["else ",this.generate
|
||
|
"unit-test":"mocha --compilers js:babel-register"},version:"4.2.0"}},{}],70:[function(e,t,r){(function(){"use strict";function e(e){if(e==null){return false}switch(e.type){case"ArrayExpression":case"AssignmentExpression":case"BinaryExpression":case"CallExpression":case"ConditionalExpression":case"FunctionExpression":case"Identifier":case"Literal":case"LogicalExpression":case"MemberExpression":case"NewExpression":case"ObjectExpression":case"SequenceExpression":case"ThisExpression":case"UnaryExpression":case"UpdateExpression":return true}return false}function r(e){if(e==null){return false}switch(e.type){case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"WhileStatement":return true}return false}function n(e){if(e==null){return false}switch(e.type){case"BlockStatement":case"BreakStatement":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExpressionStatement":case"ForInStatement":case"ForStatement":case"IfStatement":case"LabeledStatement":case"ReturnStatement":case"SwitchStatement":case"ThrowStatement":case"TryStatement":case"VariableDeclaration":case"WhileStatement":case"WithStatement":return true}return false}function i(e){return n(e)||e!=null&&e.type==="FunctionDeclaration"}function s(e){switch(e.type){case"IfStatement":if(e.alternate!=null){return e.alternate}return e.consequent;case"LabeledStatement":case"ForStatement":case"ForInStatement":case"WhileStatement":case"WithStatement":return e.body}return null}function a(e){var t;if(e.type!=="IfStatement"){return false}if(e.alternate==null){return false}t=e.consequent;do{if(t.type==="IfStatement"){if(t.alternate==null){return true}}t=s(t)}while(t);return false}t.exports={isExpression:e,isStatement:n,isIterationStatement:r,isSourceElement:i,isProblematicIfStatement:a,trailingStatement:s}})()},{}],71:[function(e,t,r){(function(){"use strict";var e,r,n,i,s,a;r={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B
|
||
|
;if(!this._events||!this._events[e])t=[];else if(i(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};n.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(i(e._events[t]))r=1;else r=e._events[t].length;return r};function i(e){return typeof e==="function"}function s(e){return typeof e==="number"}function a(e){return typeof e==="object"&&e!==null}function o(e){return e===void 0}},{}],75:[function(e,t,r){r.read=function(e,t,r,n,i){var s,a;var o=i*8-n-1;var u=(1<<o)-1;var c=u>>1;var l=-7;var f=r?i-1:0;var p=r?-1:1;var h=e[t+f];f+=p;s=h&(1<<-l)-1;h>>=-l;l+=o;for(;l>0;s=s*256+e[t+f],f+=p,l-=8){}a=s&(1<<-l)-1;s>>=-l;l+=n;for(;l>0;a=a*256+e[t+f],f+=p,l-=8){}if(s===0){s=1-c}else if(s===u){return a?NaN:(h?-1:1)*Infinity}else{a=a+Math.pow(2,n);s=s-c}return(h?-1:1)*a*Math.pow(2,s-n)};r.write=function(e,t,r,n,i,s){var a,o,u;var c=s*8-i-1;var l=(1<<c)-1;var f=l>>1;var p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0;var h=n?0:s-1;var m=n?1:-1;var d=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;a=l}else{a=Math.floor(Math.log(t)/Math.LN2);if(t*(u=Math.pow(2,-a))<1){a--;u*=2}if(a+f>=1){t+=p/u}else{t+=p*Math.pow(2,1-f)}if(t*u>=2){a++;u/=2}if(a+f>=l){o=0;a=l}else if(a+f>=1){o=(t*u-1)*Math.pow(2,i);a=a+f}else{o=t*Math.pow(2,f-1)*Math.pow(2,i);a=0}}for(;i>=8;e[r+h]=o&255,h+=m,o/=256,i-=8){}a=a<<i|o;c+=i;for(;c>0;e[r+h]=a&255,h+=m,a/=256,c-=8){}e[r+h-m]|=d*128}},{}],76:[function(e,t,r){(function(e){"use strict";var r=e.MutationObserver||e.WebKitMutationObserver;var n;{if(r){var i=0;var s=new r(l);var a=e.document.createTextNode("");s.observe(a,{characterData:true});n=function(){a.data=i=++i%2}}else if(!e.setImmediate&&typeof e.MessageChannel!=="undefined"){var o=new e.MessageChannel;o.port1.onmessage=l;n=function(){o.port2.postMessage(0)}}else if("document"in e&&"onreadystatechange"in e.document.createElement("script")){n=function(){var t=e.document.createElement("script");t.onreadystatechange=function(){l();t.onreadystatechange=null;t.parentNode.removeChild(t);t=null};e.document.documentElement.appendChild(t)}}else{n=function(){setTimeout(l,0)}}}var u;var c=[];function l(){u=true;var e,t;var r=c.length;while(r){t=c;c=[];e=-1;while(++e<r){t[e]()}r=c.length}u=false}t.exports=f;function f(e){if(c.push(e)===1&&!u){n()}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],77:[function(e,t,r){var n={}.toString;t.exports=Array.isArray||function(e){return n.call(e)=="[object Array]"}},{}],78:[function(e,t,r){"use strict";var n=e("immediate");function i(){}var s={};var a=["REJECTED"];var o=["FULFILLED"];var u=["PENDING"];t.exports=c;function c(e){if(typeof e!=="function"){throw new TypeError("resolver must be a function")}this.state=u;this.queue=[];this.outcome=void 0;if(e!==i){h(this,e)}}c.prototype["catch"]=function(e){return this.then(null,e)};c.prototype.then=function(e,t){if(typeof e!=="function"&&this.state===o||typeof t!=="function"&&this.state===a){return this}var r=new this.constructor(i);if(this.state!==u){var n=this.state===o?e:t;f(r,n,this.outcome)}else{this.queue.push(new l(r,e,t))}return r};function l(e,t,r){this.promise=e;if(typeof t==="function"){this.onFulfilled=t;this.callFulfilled=this.otherCallFulfilled}if(typeof r==="function"){this.onRejected=r;this.callRejected=this.otherCallRejected}}l.prototype.callFulfilled=function(e){s.resolve(this.promise,e)};l.prototype.otherCallFulfilled=function(e){f(this.promise,this.onFulfilled,e)};l.prototype.callRejected=function(e){s.reject(this.promise,e)};l.prototype.otherCallRejected=function(e){f(this.promise,this.onRejected,e)};function f(e,t,r){n(function(){var n;try{n=t(r)}catch(t){return s.reject(e,t)}if(n===e){s.reject(e,new TypeError("Cannot resolve promise with itself"))}else{s.resolve(e,n)}})}s.resolve=function(e,t){var r=m(p,t);if(r.status==="error"){return s.reject(e,r.value)}var n=r.value;if(n){h(e,n)}else{e.state=o;e.outcome=t;var i=-1;var a=e.queue.length;while(++i<a){e.queue[i].callFulfilled(t)}}return e};s.reject=function(e,t){e.stat
|
||
|
var t=[],r,s=i.parse("var statementIndex = 0;").body[0],a=this,u=[],c,l=[],p=[],h=i.parse("if (Resumable._resumeState_) { statementIndex = Resumable._resumeState_.statementIndex; }").body[0];n.each(a.variables,function(e){s[o].push({type:f.VariableDeclarator,id:{type:f.Identifier,name:e},init:null})});if(a.catches.length>0){r=[];n.each(a.catches,function(e){r.push({type:f.Property,kind:"init",key:{type:f.Identifier,name:e.catchStatementIndex},value:{type:f.ObjectExpression,properties:[{type:f.Property,kind:"init",key:{type:f.Identifier,name:"from"},value:{type:f.Literal,value:e.tryStartIndex}},{type:f.Property,kind:"init",key:{type:f.Identifier,name:"to"},value:{type:f.Literal,value:e.tryEndIndex}},{type:f.Property,kind:"init",key:{type:f.Identifier,name:"param"},value:{type:f.Literal,value:e.catchParameter}}]}})});p.push({type:f.Property,kind:"init",key:{type:f.Identifier,name:"catches"},value:{type:f.ObjectExpression,properties:r}})}if(a.hasFinally){u.push({type:f.VariableDeclaration,declarations:[{type:f.VariableDeclarator,id:{type:f.Identifier,name:"resumablePause"},init:{type:f.Literal,value:null}}],kind:"var"})}for(c=0;c<a.nextTempIndex;c++){p.push({type:f.Property,kind:"init",key:{type:f.Identifier,name:"temp"+c},value:{type:f.Identifier,name:"temp"+c}});s.declarations.push({type:f.VariableDeclarator,id:{type:f.Identifier,name:"temp"+c},init:null});h.consequent.body.push({type:f.ExpressionStatement,expression:{type:f.AssignmentExpression,operator:"=",left:{type:f.Identifier,name:"temp"+c},right:i.parse("Resumable._resumeState_.temp"+c).body[0].expression}})}h.consequent.body.push(i.parse("Resumable._resumeState_ = null;").body[0]);n.forOwn(a.assignmentVariables,function(e,r){t.push({type:f.Property,kind:"init",key:{type:f.Literal,value:r},value:{type:f.Literal,value:e}})});l.push(s);[].push.apply(l,a.functionDeclarations);l.push({type:f.ReturnStatement,argument:{type:f.CallExpression,arguments:[{type:f.ThisExpression},{type:f.Identifier,name:"arguments"}],callee:{type:f.MemberExpression,object:{type:f.FunctionExpression,id:{type:f.Identifier,name:"resumableScope"},params:[],body:{type:f.BlockStatement,body:u.concat([h,{type:f.TryStatement,block:{type:f.BlockStatement,body:[e]},handler:{type:f.CatchClause,param:{type:f.Identifier,name:"e"},body:{type:f.BlockStatement,body:[{type:f.IfStatement,test:i.parse("e instanceof Resumable.PauseException").body[0].expression,consequent:{type:f.BlockStatement,body:[{type:f.ExpressionStatement,expression:{type:f.CallExpression,callee:{type:f.MemberExpression,object:{type:f.Identifier,name:"e"},property:{type:f.Identifier,name:"add"},computed:false},arguments:[{type:f.ObjectExpression,properties:[{type:f.Property,kind:"init",key:{type:f.Identifier,name:"func"},value:{type:f.Identifier,name:"resumableScope"}},{type:f.Property,kind:"init",key:{type:f.Identifier,name:"statementIndex"},value:{type:f.BinaryExpression,operator:"+",left:{type:f.Identifier,name:"statementIndex"},right:{type:f.Literal,value:1}}},{type:f.Property,kind:"init",key:{type:f.Identifier,name:"assignments"},value:{type:f.ObjectExpression,properties:t}}].concat(p)}]}}]}},{type:f.ThrowStatement,argument:{type:f.Identifier,name:"e"}}]}}}])}},property:{type:f.Identifier,name:"apply"}}}});return l},getTempName:function(){return"temp"+this.nextTempIndex++},getTempNameForVariable:function(e,t){var r=this,n;n=r.getTempName();r.lastTempNames[e]=n;t.addAssignment(n).assign({type:f.Identifier,name:e});return n},getLastTempName:function(){return"temp"+(this.nextTempIndex-1)},getLastTempNameForVariable:function(e){var t=this;if(!a.call(t.lastTempNames,e)){return e}return t.lastTempNames[e]},hasVariableDefined:function(e){var t=false;n.each(this.functionDeclarations,function(r){if(r[u]&&r[u][c]===e){t=true;return false}});n.each(this.variables,function(r){if(r===e){t=true}});return t},popLabelableContext:function(){var e=this;e.labelableContext=e.labelableContextStack.pop()},pushLabelableContext:function(e){var t=this,r=t.labelableContextStack.length,n=new l(e,r);t.labelableContextStack.push(t.labelableContext);t.labelableCo
|
||
|
INSTANCEOF_EXPECTS_OBJECT:20,CANNOT_USE_WRONG_TYPE_AS:21,USED_THIS_OUTSIDE_OBJECT_CONTEXT:22,OPERATOR_REQUIRES_POSITIVE_NUMBER:23,CANNOT_BREAK_OR_CONTINUE:24,ONLY_VARIABLES_BY_REFERENCE:25,CANNOT_UNSET_STATIC_PROPERTY:26,NO_PARENT_CLASS:27});t.exports=u},{"./PHPError":148,microdash:79,"template-string":259,util:265}],150:[function(e,t,r){"use strict";var n=e("microdash"),i=e("template-string"),s=e("util"),a=e("./PHPError"),o={1:"syntax error, unexpected ${what} in ${file} on line ${line}"};function u(e,t){a.call(this,a.E_PARSE,i(o[e],t))}s.inherits(u,a);n.extend(u,{SYNTAX_UNEXPECTED:1});t.exports=u},{"./PHPError":148,microdash:79,"template-string":259,util:265}],151:[function(e,t,r){(function(r){"use strict";var n=e("pausable"),i=e("phpcommon"),s=e("./src/Debug/DebugFactory"),a=e("./src/Debug/DebugFormatter"),o=e("./src/Debug/DebugFormatterInstaller"),u=e("./src/Debug/DebugValue"),c=e("./src/Engine"),l=e("./src/Environment"),f=e("./src/OptionSet"),p=e("./src/PHPState").async(n),h=e("./src/Runtime").async(n),m=e("./src/Debug/ValueFormatter"),d=new h(l,c,f,p,i,n),E=new s(a,u,m);new o(r,E).install();t.exports=d}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./src/Debug/DebugFactory":159,"./src/Debug/DebugFormatter":160,"./src/Debug/DebugFormatterInstaller":161,"./src/Debug/DebugValue":162,"./src/Debug/ValueFormatter":164,"./src/Engine":165,"./src/Environment":166,"./src/OptionSet":178,"./src/PHPState":180,"./src/Runtime":191,pausable:103,phpcommon:146}],152:[function(e,t,r){"use strict";var n=e("microdash");function i(e,t,r,n){this.args=r;this.finder=null;this.namespaceScope=t;this.newStaticClass=n;this.scope=e}n.extend(i.prototype,{getFilePath:function(){return this.namespaceScope.getFilePath()},getFunctionArgs:function(){return this.args},getFunctionName:function(){return this.scope.getFunctionName().getNative()},getLastLine:function(){var e=this;if(!e.finder){return null}return e.finder()},getScope:function(){return this.scope},getStaticClass:function(){var e=this,t=e.scope.getThisObject();if(t&&t.getType()!=="null"){return t.getClass()}return e.newStaticClass},instrument:function(e){this.finder=e}});t.exports=i},{microdash:79}],153:[function(e,t,r){"use strict";var n=e("microdash");function i(e){this.Call=e}n.extend(i.prototype,{create:function(e,t,r,n){var i=this;return new i.Call(e,t,r||[],n||null)}});t.exports=i},{microdash:79}],154:[function(e,t,r){"use strict";var n=e("microdash"),i=e("phpcommon"),s=i.PHPError;function a(e){this.calls=[];this.stderr=e}n.extend(a.prototype,{getCallerScope:function(){var e=this,t=e.calls[e.calls.length-2]||null;return t?t.getScope():null},getCurrent:function(){var e=this;return e.calls[e.calls.length-1]||null},getLastFilePath:function(){return this.getCurrent().getFilePath()},getLastLine:function(){return this.getCurrent().getLastLine()},getStaticClass:function(){var e,t=this,r,n,i=null;for(r=t.calls.length-1;r>=0;r--){e=t.calls[r];n=e.getStaticClass();if(n){i=n;break}}return i},getThisObject:function(){var e=this.getCurrent();if(!e){return null}return e.getScope().getThisObject()},getTrace:function(){var e=this,t=[],r=e.calls.length-1;n.each(e.calls,function(n,i){t.unshift({index:r--,file:n.getFilePath(),line:i>0?e.calls[i-1].getLastLine():null,func:n.getFunctionName(),args:n.getFunctionArgs()})});return t},instrumentCurrent:function(e){this.getCurrent().instrument(e)},pop:function(){this.calls.pop()},push:function(e){this.calls.push(e)},raiseError:function(e,t){var r,n=this,i=n.calls,a,o;if(n.getCurrent().getScope().suppressesOwnErrors()){return}for(o=i.length-1;o>=0;--o){r=i[o];if(r.getScope().suppressesErrors()){return}}a=new s(e,t);n.stderr.write(a.message+"\n")}});t.exports=a},{microdash:79,phpcommon:146}],155:[function(e,t,r){"use strict";t.exports=e("pauser")([e("microdash"),e("phpcommon"),e("./Reference/StaticProperty"),e("./Reference/UndeclaredStaticProperty")],function(e,t,r,n){var i="isStatic",s="__call",a="__callStatic",o="value",u="visibility",c={}.hasOwnProperty,l=t.PHPError,f=t.PHPFatalError,p=f
|
||
|
;t.exports=e("pauser")([e("microdash"),e("./builtin/builtins"),e("util"),e("./Reference/AccessorReference"),e("./Call"),e("./CallFactory"),e("./CallStack"),e("./ClassAutoloader"),e("./Closure"),e("./ClosureFactory"),e("./FunctionFactory"),e("./INIState"),e("./MethodSpec"),e("./Module"),e("./ModuleFactory"),e("./Namespace"),e("./NamespaceFactory"),e("./NamespaceScope"),e("./Reference/Null"),e("./ReferenceFactory"),e("./Scope"),e("./ScopeFactory"),e("./SuperGlobalScope"),e("./Value"),e("./ValueFactory"),e("./Variable"),e("./VariableFactory"),e("./Reference/Variable")],function(e,t,r,n,i,s,a,o,u,c,l,f,p,h,m,d,E,g,y,_,v,N,A,S,T,C,b,D){var x="Exception",F=function(r,n){var i=r.globalNamespace;function s(t){var n=t(r.internals);e.each(n,function(e,t){i.defineFunction(t,e)})}function a(e,t){r.defineClass(t,e)}function o(t){var n=t(r.internals);e.each(n,function(e,t){i.defineConstant(t,r.valueFactory.coerce(e))})}e.each(t.functionGroups,s);e.forOwn(t.classes,a);e.each(t.constantGroups,o);e.each(n.functionGroups,s);e.forOwn(n.classes,a);e.each(n.constantGroups,o)};function I(e,t,r,S,x,I){var O=new a(S),w=new s(i),B=new m(h),R=new T(x,O),P=new _(n,y,D,R),L=new o(R),M=new A(O,R),k=new b(C,O,R),V=new N(v,O,M,R,k,P),j=new l(p,V,w,R,O),U=new c(j,R,O,u),G=new E(d,O,j,R,L),X=G.create(),q=B.create(null),H=new g(X,R,q,X),Y,W=M.defineVariable("GLOBALS");V.setClosureFactory(U);Y=V.create(H);V.setGlobalScope(Y);L.setGlobalNamespace(X);R.setGlobalNamespace(X);W.setReference(P.createAccessor(function(){var e=Y.exportVariables(),t=R.coerce(e);t.getElementByKey(R.createString("GLOBALS")).setValue(t);return t},function(e){W.unset();W.setValue(R.coerce(e))}));this.callFactory=w;this.callStack=O;this.globalNamespace=X;this.globalNamespaceScope=H;this.globalScope=Y;this.iniState=new f;this.internals={callStack:O,classAutoloader:L,globalNamespace:X,iniState:this.iniState,optionSet:I,pausable:x,stdout:r,valueFactory:R};this.moduleFactory=B;this.optionSet=I;this.referenceFactory=P;this.callStack=O;this.classAutoloader=L;this.pausable=x;this.stderr=S;this.stdin=t;this.stdout=r;this.superGlobalScope=M;this.valueFactory=R;this.PHPException=null;F(this,e)}e.extend(I.prototype,{defineClass:function(t,r){var n=this,i=null,s=true,a=r(e.extend({},n.internals,{defineUnwrapper:function(e){i=e},disableAutoCoercion:function(){s=false}})),o,u=n.globalNamespace,c=n.globalNamespace.parseClassName(t);if(t===x){if(n.PHPException){throw new Error("PHPState.defineClass(...) :: Exception class is already defined")}n.PHPException=a}if(c){u=c.namespace;t=c.name}o=u.defineClass(t,a,n.globalNamespaceScope);if(i){o.defineUnwrapper(i)}if(s){o.enableAutoCoercion()}return o},defineSuperGlobal:function(e,t){this.superGlobalScope.defineVariable(e).setValue(t)},defineSuperGlobalAccessor:function(e,t,r){var i=this,s=new n(i.valueFactory,t,r);i.superGlobalScope.defineVariable(e).setReference(s)},getCallFactory:function(){return this.callFactory},getCallStack:function(){return this.callStack},getConstant:function(e){var t;try{t=this.globalNamespace.getConstant(e,true)}catch(e){return null}return t.getNative()},getGlobalNamespace:function(){return this.globalNamespace},getGlobalScope:function(){return this.globalScope},getModuleFactory:function(){return this.moduleFactory},getOptions:function(){return this.optionSet.getOptions()},getPHPExceptionClass:function(){return this.PHPException},getReferenceFactory:function(){return this.referenceFactory},getStderr:function(){return this.stderr},getStdin:function(){return this.stdin},getStdout:function(){return this.stdout},getSuperGlobalScope:function(){return this.superGlobalScope},getValueFactory:function(){return this.valueFactory}});return I},{strict:true})},{"./Call":152,"./CallFactory":153,"./CallStack":154,"./ClassAutoloader":156,"./Closure":157,"./ClosureFactory":158,"./FunctionFactory":167,"./INIState":168,"./MethodSpec":172,"./Module":173,"./ModuleFactory":174,"./Namespace":175,"./NamespaceFactory":176,"./NamespaceScope":177,"./Reference/AccessorReference":181,"./Reference/Null":183,"./Reference/Variable":189,"./ReferenceFactory":190
|
||
|
reset:function(){var e=this;e.pointer=0;return e},setPointer:function(e){this.pointer=e},shift:function(){var t=this,r=t.value,i=[],s={},a=0;if(r.length===0){return t.factory.createNull()}e.each(r.slice(1),function(e){var r=e.getKey(),o=r.getNative();if(isFinite(o)){o=a++;r=t.factory.createInteger(o)}e=new n(t.factory,t.callStack,t,r,e.getValue());s[o]=e;i.push(e)});t.pointer=0;t.keysToElements=s;t.value=i;return r[0].getValue()},shiftLeftBy:function(e){return this.coerceToInteger().shiftLeftBy(e)},shiftRightBy:function(e){return this.coerceToInteger().shiftRightBy(e)},sort:function(e){this.value.sort(e)}});return h},{strict:true})},{"../KeyReferencePair":169,"../KeyValuePair":170,"../Reference/Element":182,"../Reference/Null":183,"../Reference/Reference":186,"../Value":196,"../Variable":207,microdash:79,pauser:144,phpcommon:146,util:265}],198:[function(e,t,r){"use strict";t.exports=e("pauser")([e("microdash"),e("util"),e("./String")],function(e,t,r){function n(e,t,n){r.call(this,e,t,n)}t.inherits(n,r);e.extend(n.prototype,{call:function(e,t){return t.getFunction(this.value).apply(null,e)},callStaticMethod:function(e,t,r,n){var i=this,s=r.getClass(i.value);return s.callMethod(e.getNative(),t,null,null,null,n)},getCallableName:function(e){var t=this,r=e.resolveClass(t.value);return r.namespace.getPrefix()+r.name},getConstantByName:function(e,t){var r=this,n=t.getClass(r.value);return n.getConstantByName(e)},getStaticPropertyByName:function(e,t){var r=this,n=t.getClass(r.value);return n.getStaticPropertyByName(e.getNative())},instantiate:function(e,t){var r=this,n=t.getClass(r.value);return n.instantiate(e)},isTheClassOfObject:function(e,t){var r=this,n=r.getCallableName(t);return r.factory.createBoolean(e.classIs(n))}});return n},{strict:true})},{"./String":205,microdash:79,pauser:144,util:265}],199:[function(e,t,r){"use strict";t.exports=e("pauser")([e("microdash"),e("phpcommon"),e("util"),e("../Value")],function(e,t,r,n){var i=t.PHPError,s=t.PHPFatalError;function a(e,t,r){n.call(this,e,t,"boolean",!!r)}r.inherits(a,n);e.extend(a.prototype,{add:function(e){return e.addToBoolean(this)},addToBoolean:function(e){var t=this;return t.factory.createInteger(t.value+e.value)},addToInteger:function(e){return e.addToBoolean(this)},addToNull:function(){return this.coerceToInteger()},addToObject:function(e){return e.addToBoolean(this)},coerceToBoolean:function(){return this},coerceToInteger:function(){var e=this;return e.factory.createInteger(e.value?1:0)},coerceToKey:function(){return this.coerceToInteger()},coerceToNumber:function(){return this.coerceToInteger()},coerceToString:function(){var e=this;return e.factory.createString(e.value?"1":"")},divide:function(e){return e.divideByBoolean(this)},divideByNonArray:function(e){var t,r=this,n=r.getNative(),s;if(n===false){r.callStack.raiseError(i.E_WARNING,"Division by zero");return r.factory.createBoolean(false)}t=e.coerceToNumber();s=t.getNative()/n;return t.getType()==="float"?r.factory.createFloat(s):r.factory.createInteger(s)},formatAsString:function(){return this.value?"true":"false"},getElement:function(){return this.factory.createNull()},isAnInstanceOf:function(e){return e.isTheClassOfBoolean(this)},isEmpty:function(){return this.value===false},isEqualTo:function(e){var t=this,r=t.factory;return r.createBoolean(e.coerceToBoolean().value===t.value)},isEqualToObject:function(){return this},isEqualToString:function(e){var t=this;return e.factory.createBoolean(e.coerceToBoolean().getNative()===t.getNative())},isNumeric:function(){return false},multiply:function(e){return e.multiplyByBoolean(this)},multiplyByNonArray:function(e){var t=e.coerceToNumber(),r=this,n=r.getNative(),i=t.getNative()*n;return t.getType()==="float"?r.factory.createFloat(i):r.factory.createInteger(i)},onesComplement:function(){throw new s(s.UNSUPPORTED_OPERAND_TYPES)},shiftLeftBy:function(e){return this.coerceToInteger().shiftLeftBy(e)},shiftRightBy:function(e){return this.coerceToInteger().shiftRightBy(e)}});return a},{strict:true})},{"../Value":196,microdash:79,pauser:144,phpcommon:146,util:265}],200:[fun
|
||
|
}else{f=u.coerceToString().getNative()}}else{f=null}if(f&&f!=="static"){l=a.getClass(f)}else if(c.getType()!=="null"){l=c.getClass()}else{l=null}return o.createObject(s.bindClosure(c,l),a.getClass("Closure"))}),bindTo:function(e,r){var n=this,s,u,c,l;if(!e){t.raiseError(i.E_WARNING,"Closure::bindTo() expects at least 1 parameter, 0 given");return o.createNull()}u=e.getValue();if(u.getType()!=="object"&&u.getType()!=="null"){t.raiseError(i.E_WARNING,"Closure::bindTo() expects parameter 1 to be object, "+u.getType()+" given");return o.createNull()}s=r?r.getValue():null;if(s){if(s.getType()==="object"){l=s.getClassName()}else{l=s.coerceToString().getNative()}}else{l=null}if(l&&l!=="static"){c=a.getClass(l)}else if(u.getType()!=="null"){c=u.getClass()}else{c=null}return o.createObject(n.bindClosure(u,c),a.getClass("Closure"))},__invoke:function(){return this.invokeClosure([].slice.call(arguments))}});e.disableAutoCoercion();e.defineUnwrapper(function(){var t=this;return function(){var r=o.coerceObject(this),i=[];n.each(arguments,function(e){i.push(o.coerce(e))});if(e.pausable){return new s(function(n,s){e.pausable.call(t.getObject().invoke,[i,r],t.getObject()).then(function(e){n(e.getNative())},function(e){if(o.isValue(e)&&e.getType()==="object"){s(e.coerceToNativeError());return}s(e)})})}try{return t.getObject().invoke(i,r).getNative()}catch(e){if(o.isValue(e)&&e.getType()==="object"){throw e.coerceToNativeError()}throw e}}});return u}},{lie:78,microdash:79,phpcommon:146}],211:[function(e,t,r){"use strict";var n=e("microdash"),i=e("phpcommon"),s=e("util"),a=i.PHPError;t.exports=function(e){var t=e.callStack,r=e.valueFactory;function i(e){this.setInternalProperty("messageValue",e||r.createString(""))}i.shadowConstructor=function(){this.setInternalProperty("file",t.getLastFilePath());this.setInternalProperty("line",t.getLastLine());this.setInternalProperty("messageValue",r.createString(""));this.setInternalProperty("trace",t.getTrace())};s.inherits(i,a);n.extend(i.prototype,{getFile:function(){return r.createString(this.getInternalProperty("file"))},getLine:function(){return r.createInteger(this.getInternalProperty("line"))},getMessage:function(){return this.getInternalProperty("messageValue")},getTraceAsString:function(){var e=this.getInternalProperty("trace"),t=[];e.pop();n.each(e,function(e){var r=n.map(e.args,function(e){return e.formatAsString()});t.push("#"+e.index+" "+e.file+"("+e.line+"): "+e.func+"("+r.join(", ")+")")});t.push("#"+e.length+" {main}");return r.createString(t.join("\n"))}});e.disableAutoCoercion();return i}},{microdash:79,phpcommon:146,util:265}],212:[function(e,t,r){"use strict";var n=e("microdash"),i=e("phpcommon").PHPFatalError,s=e("lie");t.exports=function(e){var t=e.pausable,r=function(e){var r;if(!(e instanceof s)){return}if(!t){throw new Error("Cannot wait for promise returned from JS-land to resolve - async mode is not available")}r=t.createPause();e.then(function(e){r.resume(e)},function(e){r.throw(e)});r.now()};function a(){}n.extend(a.prototype,{__call:function(e,t){var s=this,a;if(!n.isFunction(s[e])){throw new i(i.UNDEFINED_METHOD,{className:"JSObject",methodName:e})}a=s[e].apply(s,t);r(a);return a},__invoke:function(){var e=this,t;if(!n.isFunction(e)){throw new Error("Attempted to invoke a non-function JS object")}t=e.apply(null,arguments);r(t);return t}});return a}},{lie:78,microdash:79,phpcommon:146}],213:[function(e,t,r){"use strict";t.exports=function(e){function t(){}e.disableAutoCoercion();return t}},{}],214:[function(e,t,r){"use strict";t.exports=function(){return{PHP_EOL:"\n"}}},{}],215:[function(e,t,r){"use strict";t.exports=e("pauser")([e("../../Variable")],function(e){return function(t){var r=t.classAutoloader,n=t.valueFactory;return{spl_autoload_register:function(t){var n=t instanceof e,i=n?t.getValue():t;r.appendAutoloadCallable(i)},spl_autoload_unregister:function(t){var i=t instanceof e,s=i?t.getValue():t;return n.createBoolean(r.removeAutoloadCallable(s))}}}},{strict:true})},{"../../Variable":207,pauser:144}],216:[function(e,t,r){"use strict";t.exports=function(){function
|
||
|
component:"constant",capture:"next"}},N_CLASS_CONSTANT:"N_EXPRESSION_LEVEL_2_A",N_EMPTY_ARRAY_INDEX:{captureAs:"N_ARRAY_INDEX",components:{name:"indices",what:[/\[/,/\]/]},options:{indices:true}},N_EXPRESSION_LEVEL_2_B:{components:[{name:"expression",oneOf:["N_EXPRESSION_LEVEL_2_A","N_NAMESPACED_REFERENCE"]},{name:"member",zeroOrMoreOf:{oneOf:[{name:"array_index",oneOf:["N_EMPTY_ARRAY_INDEX",{name:"indices",oneOrMoreOf:[/\[/,{name:"index",what:"N_EXPRESSION"},/\]/]}]},{name:"method_call",what:{name:"calls",oneOrMoreOf:["T_OBJECT_OPERATOR",{name:"func",what:"N_INSTANCE_MEMBER"},/\(/,{name:"args",zeroOrMoreOf:["N_EXPRESSION",{what:/(,|(?=\)))()/,captureIndex:2}]},/\)/]}},{name:"object_property",what:{name:"properties",oneOrMoreOf:["T_OBJECT_OPERATOR",{name:"property",what:"N_INSTANCE_MEMBER"},/(?!\()/]}},{name:"static_method_call",what:["T_DOUBLE_COLON",{name:"method",oneOf:["N_STRING","N_VARIABLE","N_VARIABLE_EXPRESSION"]},/\(/,{name:"args",zeroOrMoreOf:["N_EXPRESSION",{what:/(,|(?=\)))()/,captureIndex:2}]},/\)/]},{name:"static_property",what:["T_DOUBLE_COLON",{name:"property",what:"N_STATIC_MEMBER"}]},{name:"callable",what:[/\(/,{name:"args",zeroOrMoreOf:["N_EXPRESSION",{what:/(,|(?=\)))()/,captureIndex:2}]},/\)/]}]}}],processor:function(e){var t;if(!e||!e.expression){return e}t=e.expression;n.each(e.member,function(e){if(e.array_index){t={name:"N_ARRAY_INDEX",array:t,indices:e.array_index.indices}}else if(e.method_call){t={name:"N_METHOD_CALL",object:t,calls:e.method_call.calls}}else if(e.object_property){t={name:"N_OBJECT_PROPERTY",object:t,properties:e.object_property.properties}}else if(e.static_method_call){t={name:"N_STATIC_METHOD_CALL",className:t,method:e.static_method_call.method,args:e.static_method_call.args}}else if(e.static_property){t={name:"N_STATIC_PROPERTY",className:t,property:e.static_property.property}}else if(e.callable){t={name:"N_FUNCTION_CALL",func:t,args:e.callable.args}}if(e.offset){t.offset=e.offset}});return t}},N_EXPRESSION_LEVEL_2_C:{components:{oneOf:["N_REFERENCE","N_EXPRESSION_LEVEL_2_B"]}},N_REFERENCE:{components:[/&/,{name:"operand",what:"N_EXPRESSION_LEVEL_2_B"}]},N_EXPRESSION_LEVEL_3_A:{oneOf:["N_UNARY_PREFIX_EXPRESSION","N_UNARY_SUFFIX_EXPRESSION","N_EXPRESSION_LEVEL_2_C"]},N_EXPRESSION_LEVEL_3_B:{oneOf:["N_ARRAY_CAST","N_BINARY_CAST","N_BOOLEAN_CAST","N_DOUBLE_CAST","N_INTEGER_CAST","N_OBJECT_CAST","N_STRING_CAST","N_UNSET_CAST","N_SUPPRESSED_EXPRESSION","N_EXPRESSION_LEVEL_3_A"]},N_ARRAY_CAST:{components:["T_ARRAY_CAST",{name:"value",rule:"N_EXPRESSION_LEVEL_3_B"}]},N_BINARY_CAST:{components:["T_BINARY_CAST",{name:"value",rule:"N_EXPRESSION_LEVEL_3_B"}]},N_BOOLEAN_CAST:{components:["T_BOOL_CAST",{name:"value",rule:"N_EXPRESSION_LEVEL_3_B"}]},N_DOUBLE_CAST:{components:["T_DOUBLE_CAST",{name:"value",rule:"N_EXPRESSION_LEVEL_3_B"}]},N_INTEGER_CAST:{components:["T_INT_CAST",{name:"value",rule:"N_EXPRESSION_LEVEL_3_B"}]},N_OBJECT_CAST:{components:["T_OBJECT_CAST",{name:"value",rule:"N_EXPRESSION_LEVEL_3_B"}]},N_STRING_CAST:{components:["T_STRING_CAST",{name:"value",rule:"N_EXPRESSION_LEVEL_3_B"}]},N_UNSET_CAST:{components:["T_UNSET_CAST",{name:"value",rule:"N_EXPRESSION_LEVEL_3_B"}]},N_SUPPRESSED_EXPRESSION:{components:[/@/,{name:"expression",oneOf:["N_ASSIGNMENT_EXPRESSION","N_EXPRESSION_LEVEL_3_B"]}]},N_UNARY_PREFIX_EXPRESSION:{captureAs:"N_UNARY_EXPRESSION",components:[{name:"operator",oneOf:["T_INC","T_DEC",/~/]},{name:"operand",what:"N_EXPRESSION_LEVEL_2_C"}],ifNoMatch:{component:"operator",capture:"operand"},options:{prefix:true}},N_UNARY_SUFFIX_EXPRESSION:{captureAs:"N_UNARY_EXPRESSION",components:[{name:"operand",what:"N_EXPRESSION_LEVEL_2_C"},{name:"operator",oneOf:["T_INC","T_DEC"]}],ifNoMatch:{component:"operator",capture:"operand"},options:{prefix:false}},N_EMPTY:{components:["T_EMPTY",/\(/,{name:"variable",rule:"N_EXPRESSION"},/\)/]},N_EXPRESSION_LEVEL_4:{captureAs:"N_EXPRESSION",components:[{name:"left",what:"N_EXPRESSION_LEVEL_3_B"},{name:"right",zeroOrMoreOf:[{name:"operator",what:"T_INSTANCEOF"},{name:"operand",what:"N_EXPRESSION_LEVEL_3_B"}]}],processor:function(e){if
|
||
|
i.push("stdout.write(",t(e),".coerceToString().getNative());")});return r.createStatementSourceNode(i,e)},N_EMPTY:function(e,t,r){return r.createExpressionSourceNode(["(function (scope) {scope.suppressOwnErrors();"+"var result = tools.valueFactory.createBoolean("].concat(t(e.variable,{getValue:false}),".isEmpty());"+"scope.unsuppressOwnErrors(); return result;}(scope))"),e)},N_EXIT:function(e,t,r){if(h.call(e,"status")){return r.createExpressionSourceNode(["tools.exit("].concat(t(e.status),")"),e)}if(h.call(e,"message")){return r.createExpressionSourceNode(["(stdout.write("].concat(t(e.message),".getNative()), tools.exit())"),e)}return r.createStatementSourceNode(["tools.exit()"],e)},N_EXPRESSION:function(e,t,r){var i=/^(?:[-+*\/.%&|^]|<<|>>)?=$/.test(e.right[0].operator),s=[],a=t(e.left,{assignment:i,getValue:!i});n.each(e.right,function(o,u){var c,l=o.operand.name==="N_REFERENCE",f,h=l?o.operand.operand:o.operand,m,d=l?".getReference()":"";c=(!i||u===e.right.length-1)&&!l;m=t(h,{getValue:c});if(o.operator==="&&"||o.operator==="and"){a=["tools.valueFactory.createBoolean("].concat(a,".coerceToBoolean().getNative() && (",m,d+".coerceToBoolean().getNative()");s.push("))")}else if(o.operator==="||"||o.operator==="or"){a=["tools.valueFactory.createBoolean("].concat(a,".coerceToBoolean().getNative() || (",m,d+".coerceToBoolean().getNative()");s.push("))")}else if(o.operator==="xor"){a=["tools.valueFactory.createBoolean("].concat(a,".coerceToBoolean().getNative() !== (",m,d+".coerceToBoolean().getNative()");s.push("))")}else{f=p[o.operator];if(!f){throw new Error('Unsupported binary operator "'+o.operator+'"')}if(n.isPlainObject(f)){f=f[l]}a.push("."+f+"(",m,d);s.push(")")}if(l&&r.getValue){s.push(".getValue()")}});return r.createExpressionSourceNode(a.concat(s),e)},N_EXPRESSION_STATEMENT:function(e,t,r){return r.createStatementSourceNode(t(e.expression).concat(";"),e)},N_FLOAT:function(e,t,r){return r.createExpressionSourceNode(["tools.valueFactory.createFloat("+e.number+")"],e)},N_FOR_STATEMENT:function(e,t,r){var n=r.blockContexts.concat(["for"]),i={blockContexts:n},s=t(e.body,i),a=t(e.condition,i),o=t(e.initializer,i),u=t(e.update,i);if(a.length>0){a.push(".coerceToBoolean().getNative()")}return r.createStatementSourceNode(["block_"+n.length+": for ("].concat(o,";",a||[],";",u,") {",s,"}"),e)},N_FOREACH_STATEMENT:function(e,t,r){var n=t(e.array),i,s=[],a=e.key?t(e.key,{getValue:false}):null,o,u,c=r.blockContexts.concat(["foreach"]),l={blockContexts:c},f=e.value.name==="N_REFERENCE",p=f?e.value.operand:e.value,h=t(p,{getValue:false});i="array_"+c.length;s.push("var "+i+" = ",n,".reset();");o="length_"+c.length;s.push("var "+o+" = "+i+".getLength();");u="pointer_"+c.length;s.push("var "+u+" = 0;");s.push("block_"+c.length+": ");s.push("while ("+u+" < "+o+") {");if(a){s.push(a,".setValue("+i+".getKeyByIndex("+u+"));")}s.push(h,".set"+(f?"Reference":"Value")+"("+i+".getElementByIndex("+u+")"+(f?".getReference()":".getValue()")+");");s.push(u+"++;");s=s.concat(t(e.body,l));s.push("}");return r.createStatementSourceNode(s,e)},N_FUNCTION_STATEMENT:function(e,t,r){var n;n=N(e.func,e.args,null,e.body,t,r);return r.createStatementSourceNode(["namespace.defineFunction("+JSON.stringify(e.func.string)+", "].concat(n,", namespaceScope);"),e)},N_FUNCTION_CALL:function(e,t,r){var i=[];n.each(e.args,function(e,r){if(r>0){i.push(", ")}i.push(t(e,{getValue:false}))});return r.createExpressionSourceNode(["("].concat(t(e.func,{getValue:true,allowBareword:true}),".call([",i,"], namespaceScope) || tools.valueFactory.createNull())"),e)},N_GLOBAL_STATEMENT:function(e,t,r){var i="";n.each(e.variables,function(e){i+="scope.importGlobal("+JSON.stringify(e.variable)+");"});return r.createStatementSourceNode([i],e)},N_GOTO_STATEMENT:function(e,t,r){var n="",i=e.label;r.labelRepository.addPending(i);n+="goingToLabel_"+i+" = true;";if(r.labelRepository.hasBeenFound(i)){n+=" continue continue_"+i+";"}else{n+=" break "+i+";"}return r.createStatementSourceNode([n],e)},N_HEREDOC:function(e,t,r){var i=[];n.each(e.parts,function(e,r){if(r>0){i.push(" + ")}i.p
|
||
|
throw new Error('"'+t+'" is not in the SourceMap.')}};c.prototype.generatedPositionFor=function e(t){var r=n.getArg(t,"source");if(this.sourceRoot!=null){r=n.relative(this.sourceRoot,r)}if(!this._sources.has(r)){return{line:null,column:null,lastColumn:null}}r=this._sources.indexOf(r);var i={source:r,originalLine:n.getArg(t,"line"),originalColumn:n.getArg(t,"column")};var s=this._findMapping(i,this._originalMappings,"originalLine","originalColumn",n.compareByOriginalPositions,n.getArg(t,"bias",u.GREATEST_LOWER_BOUND));if(s>=0){var a=this._originalMappings[s];if(a.source===i.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}};r.BasicSourceMapConsumer=c;function f(e){var t=e;if(typeof e==="string"){t=JSON.parse(e.replace(/^\)\]\}'/,""))}var r=n.getArg(t,"version");var i=n.getArg(t,"sections");if(r!=this._version){throw new Error("Unsupported version: "+r)}this._sources=new s;this._names=new s;var a={line:-1,column:0};this._sections=i.map(function(e){if(e.url){throw new Error("Support for url field in sections not implemented.")}var t=n.getArg(e,"offset");var r=n.getArg(t,"line");var i=n.getArg(t,"column");if(r<a.line||r===a.line&&i<a.column){throw new Error("Section offsets must be ordered and non-overlapping.")}a=t;return{generatedOffset:{generatedLine:r+1,generatedColumn:i+1},consumer:new u(n.getArg(e,"map"))}})}f.prototype=Object.create(u.prototype);f.prototype.constructor=u;f.prototype._version=3;Object.defineProperty(f.prototype,"sources",{get:function(){var e=[];for(var t=0;t<this._sections.length;t++){for(var r=0;r<this._sections[t].consumer.sources.length;r++){e.push(this._sections[t].consumer.sources[r])}}return e}});f.prototype.originalPositionFor=function e(t){var r={generatedLine:n.getArg(t,"line"),generatedColumn:n.getArg(t,"column")};var s=i.search(r,this._sections,function(e,t){var r=e.generatedLine-t.generatedOffset.generatedLine;if(r){return r}return e.generatedColumn-t.generatedOffset.generatedColumn});var a=this._sections[s];if(!a){return{source:null,line:null,column:null,name:null}}return a.consumer.originalPositionFor({line:r.generatedLine-(a.generatedOffset.generatedLine-1),column:r.generatedColumn-(a.generatedOffset.generatedLine===r.generatedLine?a.generatedOffset.generatedColumn-1:0),bias:t.bias})};f.prototype.hasContentsOfAllSources=function e(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};f.prototype.sourceContentFor=function e(t,r){for(var n=0;n<this._sections.length;n++){var i=this._sections[n];var s=i.consumer.sourceContentFor(t,true);if(s){return s}}if(r){return null}else{throw new Error('"'+t+'" is not in the SourceMap.')}};f.prototype.generatedPositionFor=function e(t){for(var r=0;r<this._sections.length;r++){var i=this._sections[r];if(i.consumer.sources.indexOf(n.getArg(t,"source"))===-1){continue}var s=i.consumer.generatedPositionFor(t);if(s){var a={line:s.line+(i.generatedOffset.generatedLine-1),column:s.column+(i.generatedOffset.generatedLine===s.line?i.generatedOffset.generatedColumn-1:0)};return a}}return{line:null,column:null}};f.prototype._parseMappings=function e(t,r){this.__generatedMappings=[];this.__originalMappings=[];for(var i=0;i<this._sections.length;i++){var s=this._sections[i];var a=s.consumer._generatedMappings;for(var u=0;u<a.length;u++){var c=a[u];var l=s.consumer._sources.at(c.source);if(s.consumer.sourceRoot!==null){l=n.join(s.consumer.sourceRoot,l)}this._sources.add(l);l=this._sources.indexOf(l);var f=s.consumer._names.at(c.name);this._names.add(f);f=this._names.indexOf(f);var p={source:l,generatedLine:c.generatedLine+(s.generatedOffset.generatedLine-1),generatedColumn:c.generatedColumn+(s.generatedOffset.generatedLine===c.generatedLine?s.generatedOffset.generatedColumn-1:0),originalLine:c.originalLine,originalColumn:c.originalColumn,name:f};this.__generatedMappings.push(p);if(typeof p.originalLine==="number"){this.__originalMappings.push(p)}}}o(this.__generatedMappings,n.compareByGener
|