UNPKG

gorillascript

Version:

GorillaScript is a compile-to-JavaScript language designed to empower the user while attempting to prevent some common errors.

2 lines 711 kB
!function(a){"use strict";var b=function(a){function b(c){var d=Object.prototype.hasOwnProperty;if(d.call(b._cache,c))return b._cache[c];if(d.call(b,c)){var e=b[c];return delete b[c],b._cache[c]=e.call({})}return a?a(c):void 0}return b._cache={},b["./utils"]=function(){var a={exports:this},c=this;return function(a){function d(a,b){return 1>b?"":1===b?a:1&b?""+a+d(a,b-1):d(""+a+a,b/2)}function e(a,b,c){return""+d(c,b-a.length)+a}function f(a,b,c){return""+a+d(c,b-a.length)}function g(a){return B?B(a):-1===a.indexOf("'")?"'"+JSON.stringify(a).slice(1,-1)+"'":JSON.stringify(a)}function h(a){var b,c,d,e,f;for(f=[],b=v(a),c=0,d=b.length;d>c;++c)e=b[c],q(e,f)||f.push(e);return f}function i(a){var b,c;return b=E.join(a,"package.json"),A.existsSync(b)?b:(c=E.normalize(E.join(a,"..")),c!==a?i(c):void 0)}function j(a){var b,c;if("string"!=typeof a||!A||!E)return"";try{b=i(E.dirname(a))}catch(d){}if(!b)return"";try{c=JSON.parse(A.readFileSync(b)).version}catch(d){}return"string"==typeof c?c:""}function k(a){var b;return b=o(),A.exists(a,b.fulfill),b.promise}function l(a,b){return D.sync(a,b,!0)}function m(a,b,c){return H.sync(a,b,c,!0)}var n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H;n="function"==typeof Object.create?Object.create:function(a){function b(){}return b.prototype=a,new b},o=function(){function a(){function b(a,b){var f;c&&(f=c,c=null,d=a,e=b,f.length&&F(function(){var a,b;for(b=0,a=f.length;a>b;++b)f[b]()}))}var c,d,e;return d=!1,e=null,c=[],{promise:{then:function(b,f,g){function h(){var a,c;try{a=d?f:b,"function"==typeof a?(c=a(e),c&&"function"==typeof c.then?c.then(j,l,g):j(c)):(d?l:j)(e)}catch(h){l(h)}}var i,j,k,l;return g!==!0&&(g=void 0),i=a(),k=i.promise,j=i.fulfill,l=i.reject,i=null,c?c.push(h):g?h():F(h),k},sync:function(){var a,b;switch(b=0,a=0,this.then(function(c){b=1,a=c},function(c){b=2,a=c},!0),b){case 0:throw new Error("Promise did not execute synchronously");case 1:return a;case 2:throw a;default:throw new Error("Unknown state")}}},fulfill:function(a){b(!1,a)},reject:function(a){b(!0,a)}}}return a.fulfilled=function(b){var c;return c=a(),c.fulfill(b),c.promise},a.rejected=function(b){var c;return c=a(),c.reject(b),c.promise},a}(),p=function(a,b){function c(c,f){var g;try{g=a[c](f)}catch(h){return o.rejected(h)}return g.done?o.fulfilled(g.value):g.value.then(d,e,b)}function d(a){return c("send",a)}function e(a){return c("throw",a)}if("object"!=typeof a||null===a)throw new TypeError("Expected generator to be an Object, got "+x(a));if("function"!=typeof a.send)throw new TypeError("Expected generator.send to be a Function, got "+x(a.send));if("function"!=typeof a["throw"])throw new TypeError("Expected generator.throw to be a Function, got "+x(a["throw"]));if(null==b)b=!1;else if("boolean"!=typeof b)throw new TypeError("Expected allowSync to be a Boolean, got "+x(b));return d(void 0)},q="function"==typeof Array.prototype.indexOf?function(a){return function(b,c){return-1!==a.call(c,b)}}(Array.prototype.indexOf):function(a,b){var c,d;for(d=+b.length,c=-1;++c<d;)if(a===b[c]&&c in b)return!0;return!1},r="function"==typeof Array.isArray?Array.isArray:function(a){return function(b){return"[object Array]"===a.call(b)}}(Object.prototype.toString),s=Object.prototype.hasOwnProperty,t=function(a,b){var c;if(null==b)b=!1;else if("boolean"!=typeof b)throw new TypeError("Expected allowSync to be a Boolean, got "+x(b));return"function"==typeof a?(c=function(){return p(a.apply(this,arguments))},c.sync=function(){return p(a.apply(this,arguments),!0).sync()},c.maybeSync=function(){return p(a.apply(this,arguments),!0)},c):p(a,b)},u=Array.prototype.slice,v=function(a){if(null==a)throw new TypeError("Expected an object, got "+x(a));if(r(a))return a;if("string"==typeof a)return a.split("");if("number"==typeof a.length)return u.call(a);throw new TypeError("Expected an object with a length property, got "+x(a))},w=function(a,b,c){var d,e,f,g;if("function"!=typeof a)throw new TypeError("Expected func to be a Function, got "+x(a));return d=o(),f=d.promise,g=d.reject,e=d.fulfill,d=null,a.apply(b,v(c).concat([function(a,b){null!=a?g(a):e(b)}])),f},x=function(){var a;return a=Object.prototype.toString,function(b){return void 0===b?"Undefined":null===b?"Null":b.constructor&&b.constructor.name||a.call(b).slice(8,-1)}}(),F="function"==typeof a.setImmediate?a.setImmediate:"undefined"!=typeof process&&"function"==typeof process.nextTick?function(a){return function(b){var c;if("function"!=typeof b)throw new TypeError("Expected func to be a Function, got "+x(b));return c=u.call(arguments,1),c.length?a(function(){b.apply(void 0,v(c))}):a(b)}}(process.nextTick):function(a){var b;if("function"!=typeof a)throw new TypeError("Expected func to be a Function, got "+x(a));return b=u.call(arguments,1),b.length?setTimeout(function(){a.apply(void 0,b)},0):setTimeout(a,0)},G="function"==typeof a.WeakMap?a.WeakMap:G=function(){function a(){var b;return b=this instanceof a?this:n(e),b._keys=[],b._values=[],b._chilly=[],b._uid=c(),b}function b(){return Math.random().toString(36).slice(2)}function c(){return b()+"-"+(new Date).getTime()+"-"+b()+"-"+b()}function d(a){var b,c;c=this._uid,s.call(a,c)&&(b=this._chilly,-1===b.indexOf(a)&&(b.push(a),this._keys.push(a),this._values.push(a[c])))}var e,f,g;return e=a.prototype,a.displayName="WeakMap",g=Object.isExtensible||function(){return!0},e.get=function(a){var b,c;if(Object(a)!==a)throw new TypeError("Invalid value used as weak map key");if(g(a)){if(s.call(a,b=this._uid))return a[b]}else if(d.call(this,a),c=this._keys.indexOf(a),-1!==c)return this._values[c]},e.has=function(a){if(Object(a)!==a)throw new TypeError("Invalid value used as weak map key");return g(a)?s.call(a,this._uid):(d.call(this,a),-1!==this._keys.indexOf(a))},f="function"==typeof Object.defineProperty?Object.defineProperty:function(a,b,c){a[b]=c.value},e.set=function(a,b){var c,e;if(Object(a)!==a)throw new TypeError("Invalid value used as weak map key");g(a)?f(a,this._uid,{configurable:!0,writable:!0,enumerable:!1,value:b}):(d.call(this,a),e=this._keys,c=e.indexOf(a),-1===c&&(c=e.length,e[c]=a),this._values[c]=b)},e["delete"]=function(a){var b,c;if(Object(a)!==a)throw new TypeError("Invalid value used as weak map key");g(a)?delete a[this._uid]:(d.call(this,a),c=this._keys,b=c.indexOf(a),-1!==b&&(c.splice(b,1),this._values.splice(b,1)))},a}(),null!=(y=b("util"))&&(B=y.inspect),E=b("path"),A=b("fs"),z=function(){function a(){var c;return c=this instanceof a?this:n(b),c.weakmap=G(),c}var b;return b=a.prototype,a.displayName="Cache",b.get=function(a){return this.weakmap.get(a)},b.set=function(a,b){this.weakmap.set(a,b)},b.getOrAdd=function(a,b){var c,d;return d=this.weakmap,c=d.get(a),void 0===c&&(c=b(a),d.set(a,c)),c},a}(),C=function(){var a;return a={Object:!0,String:!0,Number:!0,Boolean:!0,Function:!0,Array:!0,Math:!0,JSON:!0,Date:!0,RegExp:!0,Error:!0,RangeError:!0,ReferenceError:!0,SyntaxError:!0,TypeError:!0,URIError:!0,escape:!0,unescape:!0,parseInt:!0,parseFloat:!0,isNaN:!0,isFinite:!0,decodeURI:!0,decodeURIComponent:!0,encodeURI:!0,encodeURIComponent:!0},function(b){return s.call(a,b)}}(),D=t(function(a,b,c){function d(){l=14}function e(d){for(;;)switch(l){case 0:null==b&&(b=511&~+process.umask()),m="/"===a.charAt(0)?"/":"",h=v(a.split(/[\/\\]/g)),i=0,j=h.length,++l;case 1:l=j>i?2:13;break;case 2:q=h[i],n=E.resolve(E.join(m,q)),l=c?3:4;break;case 3:p=A.existsSync(n),l=6;break;case 4:return++l,{done:!1,value:k(n)};case 5:p=d,++l;case 6:l=p?11:7;break;case 7:l=c?8:9;break;case 8:A.mkdirSync(n,b),l=11;break;case 9:return l=11,{done:!1,value:w(A.mkdir,A,[n,b])};case 10:throw new Error("Unable to create directory '"+n+"' (Error code: "+o.code+")");case 11:m=n,++l;case 12:++i,l=1;break;case 13:++l;case 14:return{done:!0,value:void 0};default:throw new Error("Unknown state: "+l)}}function f(a){if(!(l>=7&&9>=l))throw d(),a;o=a,l=10}function g(a){for(;;)try{return e(a)}catch(b){f(b)}}var h,i,j,g,l,e,f,m,n,o,p,q;return l=0,{close:d,iterator:function(){return this},next:function(){return g(void 0)},send:g,"throw":function(a){return f(a),g(void 0)}}}),H=t(function(a,b,c,d){function e(){i=4}function f(){for(;;)switch(i){case 0:i=d?1:2;break;case 1:l(E.dirname(a)),A.writeFileSync(a,b,c),i=4;break;case 2:return++i,{done:!1,value:D(E.dirname(a))};case 3:return++i,{done:!1,value:w(A.writeFile,A,[a,b,c])};case 4:return{done:!0,value:void 0};default:throw new Error("Unknown state: "+i)}}function g(a){throw e(),a}function h(a){try{return f(a)}catch(b){g(b)}}var h,i,f,g;return i=0,{close:e,iterator:function(){return this},next:function(){return h(void 0)},send:h,"throw":function(a){return g(a),h(void 0)}}}),c.stringRepeat=d,c.padLeft=e,c.padRight=f,c.Cache=z,c.quote=g,c.unique=h,c.getPackageVersion=j,c.isPrimordial=C,c.mkdirp=D,c.mkdirpSync=l,c.writeFileWithMkdirp=H,c.writeFileWithMkdirpSync=m}.call(this,"undefined"!=typeof window?window:"undefined"!=typeof global?global:this),a.exports},b["./jsutils"]=function(){var a={exports:this},c=this;return function(){var a,d,e,f,g,h,i,j,k,l,m;a=function(a,b){var c;if(null==a)throw new TypeError("Expected parent to be an object, got "+j(a));if(c=a[b],"function"!=typeof c)throw new Error("Trying to bind child '"+String(b)+"' which is not a function");return function(){return c.apply(a,arguments)}},d="function"==typeof Object.create?Object.create:function(a){function b(){}return b.prototype=a,new b},e="function"==typeof Array.prototype.indexOf?function(a){return function(b,c){return-1!==a.call(c,b)}}(Array.prototype.indexOf):function(a,b){var c,d;for(d=+b.length,c=-1;++c<d;)if(a===b[c]&&c in b)return!0;return!1},f="function"==typeof Array.isArray?Array.isArray:function(a){return function(b){return"[object Array]"===a.call(b)}}(Object.prototype.toString),g=Object.prototype.hasOwnProperty,h=Array.prototype.slice,i=function(a){if(null==a)throw new TypeError("Expected an object, got "+j(a));if(f(a))return a;if("string"==typeof a)return a.split("");if("number"==typeof a.length)return h.call(a);throw new TypeError("Expected an object with a length property, got "+j(a))},j=function(){var a;return a=Object.prototype.toString,function(b){return void 0===b?"Undefined":null===b?"Null":b.constructor&&b.constructor.name||a.call(b).slice(8,-1)}}(),l=b("./utils").padLeft,k=function(){var a,b,c;return a=/^[a-zA-Z_\$][a-zA-Z_\$0-9]*$/,b=/^[a-zA-Z_\$\u00a0-\uffff][a-zA-Z_\$0-9\u00a0-\uffff]*$/,c=["arguments","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","eval","false","finally","for","function","if","implements","import","in","Infinity","instanceof","interface","let","NaN","new","null","package","private","protected","public","return","static","super","switch","this","throw","true","try","typeof","undefined","var","void","while","with","yield"],function(d,f){var g;return null==f&&(f=!1),g=f?b:a,g.test(d)&&!e(d,c)}}(),m=function(){function b(a,b,c){var d;for(null==c&&(c=" "),d=0;b>d;++d)a(c)}function c(a){var b;return b=d(a),b.indent=+a.indent+1,b}function e(a){var b,c,d;if(null==a)return!1;if(a instanceof RegExp)return e(a.source);if(a instanceof Date)return!1;if(f(a))switch(a.length){case 0:return!1;case 1:return e(a[0]);default:return!0}else switch(typeof a){case"string":return a.length>=h;case"number":case"boolean":return!1;case"object":b=-1;for(c in a)if(g.call(a,c)&&(++b,d=a[c],b>=1||e(c)||e(d)))return!0;return!1;default:return!0}}var h,n,o;return h=50,n=7,o={"null":function(a,b){b("null")},undefined:function(a,b){b("void 0")},number:function(a,b){b(0===a?0>1/a?"-0":"0":isFinite(a)?String(a):a!==a?"0/0":a>0?"1/0":"-1/0")},regexp:function(a,b){b("/"),b(a.source.replace(/(\\\\)*\\?\//g,"$1\\/")||"(?:)"),b("/"),a.global&&b("g"),a.ignoreCase&&b("i"),a.multiline&&b("m")},string:function(){function a(a){switch(a){case"\b":return"\\b";case" ":return"\\t";case"\n":return"\\n";case"\f":return"\\f";case"\r":return"\\r";case"\n":return"\\n";case'"':return'\\"';case"'":return"\\'";case"\\":return"\\\\";default:return"\\u"+l(a.charCodeAt(0).toString(16),4,"0")}}function b(b){return'"'+b.replace(e,a)+'"'}function c(b){return"'"+b.replace(f,a)+"'"}function d(a,b){return a.length<=b.length?a:b}var e,f;return e=/[\u0000-\u001f"\\\u0080-\uffff]/g,f=/[\u0000-\u001f'\\\u0080-\uffff]/g,function(a,e){return e(-1===a.indexOf('"')?b(a):-1===a.indexOf("'")?c(a):d(b(a),c(a)))}}(),"boolean":function(a,b){return b(a?"true":"false")},date:function(a,b){return b("new Date("),b(String(a.getTime())),b(")")},array:function(a,d,f){var g,h,j,k,l,o,p;if(k="indent"in f,0===a.length)return d("[]");if(k&&a.length>1&&(a.length>=n||function(){var b,c,d,f,g;for(f=!1,b=i(a),c=0,d=b.length;d>c;++c)if(g=b[c],e(g)){f=!0;break}return f}())){for(d("[\n"),j=c(f),g=i(a),l=0,p=g.length;p>l;++l)o=g[l],b(d,j.indent),m(o,d,j),p-1>l&&d(","),d("\n");return b(d,f.indent),d("]")}for(d("["),g=i(a),l=0,h=g.length;h>l;++l)o=g[l],l>0&&(d(","),k&&d(" ")),m(o,d,f);return d("]")},object:function(){function a(a,b,c){var d;k(a)?b(a):(d=Number(a),d===d&&String(d)===a?b(a):m(a,b,c))}return function(d,f,h){var i,j,k,l,o,p,q,r,s,t;i=[];for(q in d)g.call(d,q)&&(t=d[q],i.push({key:q,value:t}));if(s=i,o="indent"in h,0===s.length)return f("{}");if(o&&s.length>1&&(s.length>=n||function(){var a,b,c,d,f,g;for(d=!1,a=0,b=s.length;b>a;++a)if(c=s[a],f=c.key,g=c.value,c=null,e(f)||e(g)){d=!0;break}return d}())){for(f("{\n"),l=c(h),p=0,r=s.length;r>p;++p)k=s[p],q=k.key,t=k.value,k=null,b(f,l.indent),a(q,f,l),f(": "),m(t,f,l),r-1>p&&f(","),f("\n");return b(f,h.indent),f("}")}for(f("{"),p=0,j=s.length;j>p;++p)k=s[p],q=k.key,t=k.value,k=null,p>0&&(f(","),o&&f(" ")),a(q,f,h),f(":"),o&&f(" "),m(t,f,h);return f("}")}}()},function(b,c,d){var e,h,i;if(null==c&&(c=null),null==d&&(d={}),null==c)return h=[],m(b,a(h,"push"),d),h.join("");if(null===b)o["null"](b,c,d);else if(f(b))o.array(b,c,d);else if(b instanceof RegExp)o.regexp(b,c,d);else if(b instanceof Date)o.date(b,c,d);else{if(g.call(o,e=typeof b)&&(i=o[e]),"function"!=typeof i)throw new Error("Cannot convert "+j(b)+" to JS source");i(b,c,d)}}}(),c.toJSSource=m,c.isAcceptableIdent=k}.call(this),a.exports},b["./types"]=function(){var a={exports:this};return function(){var c,d,e,f,g,h,i,j,k,l,m,n;c=function(a,b){var c;if(a===b)return 0;if(c=typeof a,"number"!==c&&"string"!==c)throw new TypeError("Cannot compare a non-number/string: "+c);if(c!==typeof b)throw new TypeError("Cannot compare elements of different types: "+c+" vs "+typeof b);return b>a?-1:1},d="function"==typeof Object.create?Object.create:function(a){function b(){}return b.prototype=a,new b},e="function"==typeof Array.isArray?Array.isArray:function(a){return function(b){return"[object Array]"===a.call(b)}}(Object.prototype.toString),f=function(a){if("function"!=typeof a)throw new TypeError("Expected func to be a Function, got "+k(a));return a.displayName||a.name||""},g=Object.prototype.hasOwnProperty,h=Array.prototype.slice,i=function(a){throw a},j=function(a){if(null==a)throw new TypeError("Expected an object, got "+k(a));if(e(a))return a;if("string"==typeof a)return a.split("");if("number"==typeof a.length)return h.call(a);throw new TypeError("Expected an object with a length property, got "+k(a))},k=function(){var a;return a=Object.prototype.toString,function(b){return void 0===b?"Undefined":null===b?"Null":b.constructor&&b.constructor.name||a.call(b).slice(8,-1)}}(),n=b("util"),null!=n&&(l=n.inspect),a.exports=m=function(){function a(){var b;throw b=this instanceof a?this:d(v),new TypeError("Type should not be instantiated")}function b(a,b){var c,d,e;for(c=j(a),d=c.length;d--;)if(e=c[d],e.equals(b))return!0;return!1}function e(a,b){var c,d,e,f,g,h,i,j;if(a===b)return a;for(j=[],d=a.length,f=b.length,h=0,i=0;d>h&&f>i;)c=a[h],e=b[i],g=c.compare(e),0===g?(j.push(c),++h,++i):0>g?(j.push(c),++h):(j.push(e),++i);for(;d>h;++h)j.push(a[h]);for(;f>i;++i)j.push(b[i]);switch(j.length){case d:return a;case f:return b;default:return j}}function m(a,b){var c,d,e,f,g,h,i,j;if(a===b)return a;for(d=a.length,f=b.length,j=[],h=0,i=0;d>h&&f>i;)c=a[h],e=b[i],g=c.compare(e),0===g?(j.push(c),++h,++i):0>g?++h:++i;switch(j.length){case d:return a;case f:return b;default:return j}}function n(a,b){var c,d,e,f,g,h,i;if(a===b)return[];if(i=[],d=a.length,0===d)return i;if(e=b.length,0===e)return a;for(g=0,h=0;d>g&&e>h;)c=a[g],f=c.compare(b[h]),0===f?(++g,++h):0>f?(i.push(c),++g):++h;for(;d>g;++g)i.push(a[g]);return i.length===d?a:i}function o(a,b){var c,d,e,f;if(a===b)return!0;if(c=a.length,0===c)return!0;if(d=b.length,c>d)return!1;for(e=0,f=0;d>f;)if(a[e].equals(b[f])){if(++e,e>=c)return!0;++f}else++f;return!1}function p(a,b){var c,d,e,f,g;if(c=a.length,a===b&&c>0)return!0;for(d=b.length,f=0,g=0;c>f&&d>g;){if(e=a[f].compare(b[g]),0===e)return!0;0>e?++f:++g}return!1}function q(a,b){var d,e,f;if(a!==b){if(f=a.length,d=c(f,b.length))return d;for(e=0;f>e;++e)if(d=a[e].compare(b[e]))return d}return 0}function r(a,b){var c,d;if(a!==b){if(d=a.length,d!==b.length)return!1;for(c=0;d>c;++c)if(!a[c].equals(b[c]))return!1}return!0}function s(a,b){return a.compare(b)}function t(a,b){switch(a.length){case 0:return E;case 1:return a[0];default:return b&&a.sort(s),I(a)}}function u(a){var b;if("string"==typeof a)return u({type:"simple",name:a});if(b=a.type,"string"!=typeof b)throw new TypeError("Unspecified type");if(g.call(A,b))return A[b](a);throw new TypeError("Unknown serialization type: "+b)}var v,w,x,y,z,A,B,C,D,E,F,G,H,I;return v=a.prototype,a.displayName="Type",v.isSubsetOf=function(){throw new Error("Not implemented: "+f(this.constructor)+".isSubsetOf()")},v.isSupersetOf=function(a){return a.isSubsetOf(this)},v.overlaps=function(){throw new Error("Not implemented: "+f(this.constructor)+".overlaps()")},v.compare=function(){throw new Error("Not implemented: "+f(this.constructor)+".compare()")},v.equals=function(){throw new Error("Not implemented: "+f(this.constructor)+".equals()")},v.union=function(){throw new Error("Not implemented: "+f(this.constructor)+".union()")},v.intersect=function(){throw new Error("Not implemented: "+f(this.constructor)+".intersect()")},v.complement=function(){var a;return null==(a=this._complement)?this._complement=z(this):a},v.array=function(){var b;return null==(b=this._array)?this._array=a.generic(y,this):b},v["function"]=function(){var b,c;return c=h.call(arguments),null==(b=this._function)?this._function=a.generic.apply(a,[B,this].concat(c)):b},v.returnType=function(){return E},A={},a.fromJSON=u,D=function(){var a;return a=-1,function(){return++a,a}}(),H=function(a){function b(a){var c;return c=this instanceof b?this:d(e),c.name=a,c.id=D(),c}var e,f;return f=a.prototype,e=b.prototype=d(f),e.constructor=b,b.displayName="SimpleType","function"==typeof a.extended&&a.extended(b),e.toString=function(){return this.name},e.equals=function(a){return this===a},e.returnType=function(){return this===B?w:E},e.compare=function(a){return this===a?0:a instanceof b?c(this.name,a.name)||c(this.id,a.id):c("SimpleType",a.constructor.displayName)},e.union=function(a){return a instanceof b?this===a?this:t([this,a],!0):a.union(this)},e.intersect=function(a){return a instanceof b?this===a?this:E:a.intersect(this)},e.isSubsetOf=function(a){var c,d,e,f;if(a instanceof b)return this===a;if(a instanceof I){for(e=!1,c=j(a.types),d=c.length;d--;)if(f=c[d],this===f){e=!0;break}return e}return a instanceof z?!this.isSubsetOf(a.untype):a===w},e.overlaps=function(a){return a instanceof b?this===a:a.overlaps(this)},e.inspect=function(){var b;return b=this,function(){var c,d,e;c=!0;for(d in a)if(g.call(a,d)&&(c=!1,e=a[d],e===b))return"Type."+d;return"Type.make("+l(b.name)+")"}()},e.toAst=function(b,c,d){var e;return e=this,function(){var f,h,i;f=!0;for(h in a)if(g.call(a,h)&&(f=!1,i=a[h],i===e))return b.Access(c,d,b.Const(c,h));throw new Error("Cannot serialize custom type: "+String(e))}()},e.toJSON=function(){var b;return b=this,function(){var c,d,e;c=!0;for(d in a)if(g.call(a,d)&&(c=!1,e=a[d],e===b))return d;throw new Error("Cannot serialize custom type: "+String(b))}()},A.simple=function(b){var c;return c=b.name,g.call(a,c)&&a[c]||i(new Error("Unknown type: "+String(c)))},b}(a),a.make=function(a){return H(a)},C=function(a){function b(a,c){var e,g;if(g=this instanceof b?this:d(f),g.base=a,0===c.length)throw new Error("Must provide at least one generic type argument");if(g.id=D(),g.args=c.slice(),g.base===y&&1===c.length){if(null!=(e=c[0]._array))return e;c[0]._array=g}else if(g.base===B&&1===c.length){if(null!=(e=c[0]._function))return e;c[0]._function=g}return g}function e(a,b){return a.id>b.id?e(b,a):(b.base=a.base,b.args=a.args,b.id=a.id,void 0)}var f,h;return h=a.prototype,f=b.prototype=d(h),f.constructor=b,b.displayName="GenericType","function"==typeof a.extended&&a.extended(b),f.toString=function(){var a,b,c,d,e,f;if(null==(c=this._name)){if(this.base===y&&1===this.args.length)return this._name=this.args[0]===w?"[]":"["+String(this.args[0])+"]";if(this.base===B&&1===this.args.length)return this._name=this.args[0]===w?"->":"-> "+String(this.args[0]);for(f=[],f.push(String(this.base)),f.push("<"),a=j(this.args),e=0,b=a.length;b>e;++e)d=a[e],e>0&&(f.push(","),d!==w&&this.args[e-1]!==w&&f.push(" ")),d!==w&&f.push(String(d));return f.push(">"),this._name=f.join("")}return c},f.returnType=function(){return this.base===B?this.args[0]:E},f.equals=function(a){return a===this?!0:a instanceof b?this.id===a.id?!0:this.base===a.base&&r(this.args,a.args)?(e(this,a),!0):!1:!1},f.compare=function(a){var d,f;return a===this?0:a instanceof b?this.id===a.id?0:(d=this.base.compare(a.base))?d:(f=q(this.args,a.args),f||e(this,a),f):c("GenericType",a.constructor.displayName)},f.union=function(a){return a instanceof b?this.equals(a)?this:this.isSubsetOf(a)?a:a.isSubsetOf(this)?this:t([this,a],!0):a instanceof H?t([this,a],!0):a.union(this)},f.intersect=function(a){var c,d,e,f,g,h,i,j,k,l;if(a instanceof b){if(this.base!==a.base)return E;if(this.equals(a))return this;if(d=this.args,l=a.args,h=d.length,h!==l.length)return E;for(g=!0,f=!0,j=[],e=0;h>e;++e)c=d[e],k=l[e],i=d[e].intersect(l[e]),g&&c!==i&&(g=!1),f&&k!==i&&(f=!1),j.push(i);return g?this:f?a:b(this.base,j)}return a instanceof H?E:a.intersect(this)},f.isSubsetOf=function(a){var c,d,e,f,g,h,i,k;if(a instanceof b){if(this.base!==a.base)return!1;if(this.equals(a))return!0;if(f=this.args,i=a.args,h=f.length,h!==i.length)return!1;for(g=0;h>g;++g)if(!f[g].isSubsetOf(i[g]))return!1;return!0}if(a instanceof I){for(e=!1,c=j(a.types),d=c.length;d--;)if(k=c[d],this.isSubsetOf(k)){e=!0;break}return e}return a instanceof z?!this.isSubsetOf(a.untype):a===w},f.overlaps=function(a){return a instanceof b?this.base!==a.base?!1:this.args.length===a.args.length:a instanceof H?!1:a.overlaps(this)},f.inspect=function(a){var b,c,d,e,f;for(null!=a&&--a,f=["Type.generic("],f.push(l(this.base,null,a)),b=j(this.args),c=0,d=b.length;d>c;++c)e=b[c],f.push(", "),f.push(l(e,null,a));return f.push(")"),f.join("")},f.toAst=function(b,c,d){var e;return e=this,function(){var f,h,i;f=!0;for(h in a)if(g.call(a,h)&&(f=!1,i=a[h],i===e))return b.Access(c,d,b.Const(c,h));return b.Call(c,b.Access(c,d,b.Const(c,"generic")),[e.base.toAst(b,c,d)].concat(function(){var a,f,g,h,i;for(a=[],f=j(e.args),g=0,h=f.length;h>g;++g)i=f[g],a.push(i.toAst(b,c,d));return a}()))}()},f.toJSON=function(){var b;return b=this,function(){var c,d,e;c=!0;for(d in a)if(g.call(a,d)&&(c=!1,e=a[d],e===b))return d;return{type:"generic",base:b.base,args:b.args}}()},A.generic=function(c){var d,e,f;return e=c.base,d=c.args,f=a.fromJSON(e),f===y&&1===d.length?a.fromJSON(d[0]).array():f===B&&1===d.length?a.fromJSON(d[0])["function"]():b(f,function(){var b,c,e,f,g;for(b=[],c=j(d),e=0,f=c.length;f>e;++e)g=c[e],b.push(a.fromJSON(g));return b}())},b}(a),a.generic=function(b){var c;return c=h.call(arguments,1),C("string"==typeof b?a.make(b):b,c)},G=function(a){function b(e){var h,i,j,l;h=this instanceof b?this:d(f),j=[];for(i in e)if(g.call(e,i)){if(l=e[i],!(l instanceof a))throw new TypeError("Expected data["+JSON.stringify(i)+"] to be a Type, got "+k(l));l!==w&&j.push([i,l])}return j.sort(function(a,b){return c(a[0],b[0])}),0===j.length&&null!=a.object?a.object:(h.pairs=j,h.id=D(),h)}function e(a,b){return a.id>b.id?e(b,a):(b.pairs=a.pairs,b.id=a.id,void 0)}var f,h;return h=a.prototype,f=b.prototype=d(h),f.constructor=b,b.displayName="ObjectType","function"==typeof a.extended&&a.extended(b),f.toString=function(){var a,b;return b=this,null==(a=this._name)?this._name="{"+function(){var a,c,d,e,f,g,h;for(a=[],c=j(b.pairs),d=0,e=c.length;e>d;++d)f=c[d],g=f[0],h=f[1],f=null,a.push(g+": "+String(h));return a}().join(", ")+"}":a},f.equals=function(a){var c,d,f,g,h,i,k;if(a===this)return!0;if(a instanceof b){if(k=this.pairs,h=a.pairs,k===h)return!0;if(k.length!==h.length)return!1;for(c=j(k),f=0,d=c.length;d>f;++f)if(i=c[f],g=h[f],i[0]!==g[0]||!i[1].equals(g[1]))return!1;return e(this,a),!0}return!1},f.compare=function(a){var d,f,g,h,i,k,l,m;if(this===a)return 0;if(a instanceof b){if(m=this.pairs,k=a.pairs,m===k)return 0;if(g=c(m.length,k.length))return g;for(d=j(m),h=0,f=d.length;f>h;++h)if(l=d[h],i=k[h],g=c(l[0],i[0])||l[1].compare(i[1]))return g;return e(this,a),0}return c("ObjectType",a.constructor.displayName)},f.union=function(a){return a instanceof b?this.equals(a)?this:this.isSubsetOf(a)?a:a.isSubsetOf(this)?this:t([this,a],!0):a instanceof H||a instanceof C?t([this,a],!0):a.union(this)},f.intersect=function(a){var c,d,e,f,h,i,k;if(a instanceof b){if(this.equals(a))return this;if(this.isSubsetOf(a))return this;if(a.isSubsetOf(this))return a;for(i={},c=j(this.pairs),d=0,e=c.length;e>d;++d)f=c[d],h=f[0],k=f[1],f=null,i[h]=k;for(c=j(a.pairs),d=0,e=c.length;e>d;++d)f=c[d],h=f[0],k=f[1],f=null,i[h]=g.call(i,h)?i[h].intersect(k):k;return b(i)}return a instanceof H||a instanceof C?E:a.intersect(this)},f.isSubsetOf=function(c){var d,f,g,h,i,k,l,m,n,o,p,q,r;if(c instanceof b){if(this===c||c===a.object)return!0;if(this===a.object)return!1;if(q=this.pairs,n=c.pairs,q===c.pairs)return!0;for(k=0,l=q.length,d=j(n),f=0,g=d.length;g>f;++f)for(h=d[f],m=h[0],o=h[1],h=null;l>=k;++k){if(k===l)return!1;if(p=q[k],p[0]===m){if(p[1].isSubsetOf(o)){++k;break}return!1}if(p[0]>m)return!1}return k===l&&e(this,c),!0}if(c instanceof I){for(i=!1,d=j(c.types),f=d.length;f--;)if(r=d[f],this.isSubsetOf(r)){i=!0;break}return i}return c instanceof z?!this.isSubsetOf(c.untype):c===w},f.overlaps=function(a){return a instanceof b?!0:a instanceof H||a instanceof C?!1:a.overlaps(this)},f.value=function(b){var c,d,e,f;for(c=j(this.pairs),d=c.length;d--;){if(e=c[d],f=e[0],f===b)return e[1];if(b>f)return a.any}return a.any},f.inspect=function(b){var c,d,e,f,g,h,i;if(this===a.object)return"Type.object";for(h={},c=j(this.pairs),d=0,e=c.length;e>d;++d)f=c[d],g=f[0],i=f[1],f=null,h[g]=i;return"Type.makeObject("+l(h,null,null!=b?b-1:null)+")"},f.toAst=function(a,b,c){var d;return d=this,0===this.pairs.length?a.Access(b,c,a.Const(b,"object")):a.Call(b,a.Access(b,c,a.Const(b,"makeObject")),[a.Obj(b,function(){var e,f,g,h,i,k,l;for(e=[],f=j(d.pairs),g=0,h=f.length;h>g;++g)i=f[g],k=i[0],l=i[1],i=null,e.push(a.Obj.Pair(b,k,l.toAst(a,b,c)));return e}())])},f.toJSON=function(){var a,b,c,d,e,f,g;if(0===this.pairs.length)return"object";for(f={},a=j(this.pairs),b=0,c=a.length;c>b;++b)d=a[b],e=d[0],g=d[1],d=null,f[e]=g;return{type:"object",pairs:f}},A.object=function(c){var d,e,f,h;f=c.pairs,d={};for(e in f)g.call(f,e)&&(h=f[e],d[e]=a.fromJSON(h));return b(d)},b}(a),a.makeObject=function(a){return G(a)},I=function(a){function f(a){var b;if(b=this instanceof f?this:d(k),b.types=a,a.length<=1)throw new Error("Must provide at least 2 types to UnionType");return b.id=D(),b}function h(a,b){return a.id>b.id?h(b,a):(b.types=a.types,b.id=a.id)}var i,k;return i=a.prototype,k=f.prototype=d(i),k.constructor=f,f.displayName="UnionType","function"==typeof a.extended&&a.extended(f),k.toString=function(){var a;return null==(a=this._name)?this._name="("+this.types.join("|")+")":a},k.returnType=function(){var a,b,c,d,e;for(d=E,a=j(this.types),b=0,c=a.length;c>b;++b)e=a[b],d=d.union(e.returnType());return d},k.equals=function(a){return a===this?!0:a instanceof f?this.id===a.id?!0:this.types===a.types||r(this.types,a.types)?(h(this,a),!0):!1:!1},k.compare=function(a){var b;return a===this?0:a instanceof f?this.id===a.id?0:this.types===a.types?(h(this,a),0):(b=q(this.types,a.types),0===b&&h(this,a),b):c("UnionType",a.constructor.displayName)},k.union=function(b){var c,d,g,h,i,k;if(b instanceof H||b instanceof C)return k=e(this.types,[b]),k===this.types?this:t(k);if(b instanceof G){if(b===a.object){for(h=[b],c=j(this.types),d=0,g=c.length;g>d;++d)if(i=c[d],i instanceof G){if(i===a.object)return this}else h.push(i);return t(h)}for(h=[b],c=j(this.types),d=0,g=c.length;g>d;++d)if(i=c[d],i instanceof G){if(b.isSubsetOf(i))return this;i.isSubsetOf(b)||h.push(i)}else h.push(i);return t(h)}return b instanceof f?(k=e(this.types,b.types),k===this.types?this:k===b.types?b:t(k)):b.union(this)},k.intersect=function(a){var b;return a instanceof H||a instanceof C||a instanceof G?t(m(this.types,[a])):a instanceof f?(b=m(this.types,a.types),b===this.types?this:b===a.types?a:t(b)):a.intersect(this)},k.isSubsetOf=function(a){return a instanceof f?o(this.types,a.types):a instanceof z?!this.overlaps(a.untype):a===w},k.overlaps=function(a){var c,d,e,g;if(a instanceof H)return b(this.types,a);if(a instanceof C||a instanceof G){for(e=!1,c=j(this.types),d=c.length;d--;)if(g=c[d],g.overlaps(a)){e=!0;break}return e}return a instanceof f?p(this.types,a.types):a.overlaps(this)},k.inspect=function(a){var b;return b=this,"("+function(){var c,d,e,f,g;for(c=[],d=j(b.types),e=0,f=d.length;f>e;++e)g=d[e],c.push(l(g,null,null!=a?a-1:null));return c}().join(").union(")+")"},k.toAst=function(b,c,d){var e;return e=this,function(){var f,h,i,k,l,m,n,o;h=!0;for(m in a)if(g.call(a,m)&&(h=!1,o=a[m],o===e))return b.Access(c,d,b.Const(c,m));for(l=e.types[0].toAst(b,c,d),f=j(e.types),i=1,k=f.length;k>i;++i)n=f[i],l=b.Call(c,b.Access(c,l,b.Const(c,"union")),[n.toAst(b,c,d)]);return l}()},k.toJSON=function(){var b;return b=this,function(){var c,d,e;c=!0;for(d in a)if(g.call(a,d)&&(c=!1,e=a[d],e===b))return d;return{type:"union",types:b.types}}()},A.union=function(b){var c,d,e,f,g;for(g=b.types,e=a.none,c=j(g),d=c.length;d--;)f=c[d],e=e.union(a.fromJSON(f));return e},f}(a),z=function(a){function e(a){var b;return b=this instanceof e?this:d(i),b.untype=a,b.id=D(),b}function f(a,b){return a.id>b.id?f(b,a):(b.id=a.id,b.untype=a.untype)}function h(a){return a instanceof I?a.types:[a]}var i,j;return j=a.prototype,i=e.prototype=d(j),i.constructor=e,e.displayName="ComplementType","function"==typeof a.extended&&a.extended(e),i.toString=function(){var a;return null==(a=this._name)?this._name="any \\ "+String(this.untype):a},i.returnType=function(){return w},i.equals=function(a){return this===a?!0:a instanceof e?this.id===a.id?!0:this.untype.equals(a.untype)?(f(this,a),!0):!1:!1},i.compare=function(a){var b;return this===a?0:a instanceof e?this.id===a.id?0:(b=this.untype.compare(a.untype),0===b&&f(this,a),b):c("ComplementType",a.constructor.displayName)},i.union=function(a){var b,c;return a instanceof H||a instanceof C||a instanceof G?(b=h(this.untype),c=n(b,[a]),c===b?this:t(c).complement()):a instanceof I?(b=h(this.untype),c=n(b,a.types),c===b?this:t(c).complement()):a instanceof e?this.untype.intersect(a.untype).complement():a.union(this)},i.intersect=function(a){var c;return a instanceof H||a instanceof C||a instanceof G?b(h(this.untype),a)?E:a:a instanceof I?(c=n(a.types,h(this.untype)),c===a.types?a:t(c)):a instanceof e?this.untype.union(a.untype).complement():a.intersect(this)},i.isSubsetOf=function(a){return a instanceof e?a.untype.isSubsetOf(this.untype):a===w},i.overlaps=function(a){var b,c,d,f;if(a instanceof H||a instanceof C)return!this.untype.overlaps(a);if(a instanceof G){for(c=!0,b=h(this.untype),d=b.length;d--;)if(f=b[d],f instanceof G&&a.isSubsetOf(f)){c=!1;break}return c}return a instanceof I?n(a.types,h(this.untype)).length>0:a instanceof e?!0:a.overlaps(this) },i.complement=function(){return this.untype},i.inspect=function(a){return this.untype.inspect(a)+".complement()"},i.toAst=function(b,c,d){var e;return e=this,function(){var f,h,i;f=!0;for(h in a)if(g.call(a,h)&&(f=!1,i=a[h],i===e))return b.Access(c,d,b.Const(c,h));return b.Call(c,b.Access(c,e.complement().toAst(b,c,d),b.Const(c,"complement")),[])}()},i.toJSON=function(){var b;return b=this,function(){var c,d,e;c=!0;for(d in a)if(g.call(a,d)&&(c=!1,e=a[d],e===b))return d;return{type:"complement",untype:b.complement()}}()},A.complement=function(b){var c;return c=b.untype,a.fromJSON(c).complement()},e}(a),w=a.any=new(x=function(a){function b(){var a;if(a=this instanceof b?this:d(e),w)throw new Error("Cannot instantiate more than once");return a}var e,f;return f=a.prototype,e=b.prototype=d(f),e.constructor=b,b.displayName="AnyType","function"==typeof a.extended&&a.extended(b),e.toString=function(){return"any"},e.returnType=function(){return w},e.equals=function(a){return this===a},e.compare=function(a){return this===a?0:c("AnyType",a.constructor.displayName)},e.union=function(){return this},e.intersect=function(a){return a},e.isSubsetOf=function(a){return this===a},e.overlaps=function(){return!0},e.complement=function(){return E},e.inspect=function(){return"Type.any"},e.toAst=function(a,b,c){return a.Access(b,c,a.Const(b,"any"))},e.toJSON=function(){return"any"},A.any=function(){return w},b}(a)),E=a.none=new(F=function(a){function b(){var a;if(a=this instanceof b?this:d(e),E)throw new Error("Cannot instantiate more than once");return a}var e,f;return f=a.prototype,e=b.prototype=d(f),e.constructor=b,b.displayName="NoneType","function"==typeof a.extended&&a.extended(b),e.toString=function(){return"none"},e.equals=function(a){return this===a},e.compare=function(a){return this===a?0:c("NoneType",a.constructor.displayName)},e.union=function(a){return a},e.intersect=function(){return this},e.isSubsetOf=function(){return!0},e.overlaps=function(){return!1},e.complement=function(){return w},e.inspect=function(){return"Type.none"},e.toAst=function(a,b,c){return a.Access(b,c,a.Const(b,"none"))},e.toJSON=function(){return"none"},A.none=function(){return E},b}(a)),y=a.arrayBase=a.make("Array"),B=a.functionBase=a.make("Function"),a.undefined=a.make("undefined"),a["null"]=a.make("null"),a.boolean=a.make("Boolean"),a.string=a.make("String"),a.stringArray=a.string.array(),a.number=a.make("Number"),a.numberArray=a.number.array(),a.array=w.array(),a.args=a.make("Arguments"),a.object=a.makeObject({}),a["function"]=w["function"](),a.regexp=a.make("RegExp"),a.date=a.make("Date"),a.error=a.make("Error"),a.promise=a.makeObject({then:a.any["function"](a["function"],a["function"])}),a.generatorResult=a.makeObject({done:a.boolean,value:w}),a.generator=a.generatorResult["function"](),a.numeric=a.number.union(a.undefined).union(a["null"]).union(a.boolean),a.stringOrNumber=a.string.union(a.number),a.arrayLike=a.array.union(a.args),a.undefinedOrNull=a.undefined.union(a["null"]),a.notUndefinedOrNull=a.undefinedOrNull.complement(),a.primitive=a.undefinedOrNull.union(a.boolean).union(a.string).union(a.number),a.nonPrimitive=a.primitive.complement(),a.alwaysFalsy=a.undefinedOrNull,a.potentiallyTruthy=a.alwaysFalsy.complement(),a.potentiallyFalsy=a.alwaysFalsy.union(a.number).union(a.string).union(a.boolean),a.alwaysTruthy=a.potentiallyFalsy.complement(),a}()}.call(this),a.exports},b["./jsast"]=function(){var a={exports:this},c=this;return function(){function a(a){var b;return b=t(a),++b.indent,b}function d(a){function b(c){var d,e,f;switch(f=String(c),e=f.split(cb),e.length){case 0:break;case 1:b.column-=-e[0].length;break;default:d=e.length,b.line-=-d+1,b.column=+e[d-1].length+1}a(f)}return b.line=1,b.column=1,b.indent=function(a){this(X(a))},b}function e(a){return d(a)}function f(){var a,b;return a=[],b=d(function(b){a.push(b)}),b.toString=function(){return"string"==typeof a?a:a=a.join("")},b}function g(a,b,c){var d;if(null==c&&(c=void 0),d={line:a,column:b},c){if("string"!=typeof c)throw new TypeError("Must provide a valid string for file");d.file=c}return d}function h(a){return null!=a?a-1:null}function i(a,b,c,d){var e,f,g,h,i,j,k,l;for(i=!1,e=[],f=0,g=a.length;g>f;++f)j=a[f],k=null!=(h=d(j,b,c))?h:j.walk(d),j!==k&&(i=!0),e.push(k);return l=e,i?l:a}function j(a,b,c){var d,e,f,g,h;if(null==c&&(c=!1),0===a.length)return a;for(h=[],g=-1,e=0,d=a.length;d>e;++e)f=a[e],g=f instanceof eb?e:-1,h.push(k(f,b));return c||-1===g||h.splice(g,1/0),h}function k(a,b){return w(a)?j(a):a instanceof eb?b:a}function l(a,b){if(b instanceof db)throw new Error("Cannot convert "+B(b)+" to a Const");return b instanceof RegExp?hb(a,b.source,b.flags):N(a,b)}function m(a){return 0>a||0===a&&0>1/a}function n(a,b){var c,d,e,f,g;for(e=[],c=A(a),d=c.length;d--;){if(f=c[d],v(f.name,e))throw new Error("Duplicate parameter: "+f.name);e.push(f.name)}for(c=A(b),d=c.length;d--;){if(g=c[d],v(g,e))throw new Error("Duplicate variable: "+g);e.push(g)}}function o(a,b,c,d,e,f){var g,h,i,j,k,l,m,n,o;for(m=a.minify,g=A(c),h=0,i=g.length;i>h;++h)k=g[h],m||b.indent(a.indent),b(pb(k)),b(";"),f=!1,m||(b(a.linefeed||"\n"),f=!0);if(d.length>0){for(j=0,m||(b.indent(a.indent),j=4+2*a.indent),b("var "),g=A(d.sort(function(a,b){return s(a.toLowerCase(),b.toLowerCase())||s(a,b)})),l=0,i=g.length;i>l;++l)o=g[l],n=ob(d[l]),l>0&&(m?b(","):j+2+n.length<80?(b(", "),j+=2):(b(","),b(a.linefeed||"\n"),b.indent(a.indent),b(" "),j=4+2*a.indent)),b(n),j+=n.length;b(";"),f=!1,m||(b(a.linefeed||"\n"),f=!0)}e.isNoop()||(m||b.indent(a.indent),e.compileAsStatement(a,f,b),m||b(a.linefeed||"\n"))}function p(b,c,d,e,f,g,h){var i,j,k,l,m;for(c("function"),l=b.minify,l&&null==d||c(" "),null!=d&&d.compile(b,2,!1,c),c("("),i=A(e),k=0,j=i.length;j>k;++k)m=i[k],k>0&&(c(","),l||c(" ")),m.compile(b,2,!1,c);return c(")"),l||c(" "),c("{"),(g.length||f.length||!h.isNoop())&&(l||c(b.linefeed||"\n"),o(a(b),c,f,g,h,!l),l||c.indent(b.indent)),c("}")}function q(a){var b,c,d,e,f;if(null==a)return[];if(w(a)){for(b=[],c=A(a),d=0,e=c.length;e>d;++d)f=c[d],b.push(V(f));return b}throw new Error("Expected an array, got "+B(a))}function r(a,b){var c;if(null===b||"undefined"==(c=typeof b)||"boolean"===c||"number"===c||"string"===c)return N(a,b);if(w(b))return E(a,function(){var c,d,e,f,g;for(c=[],d=A(b),e=0,f=d.length;f>e;++e)g=d[e],c.push(r(a,g));return c}());if(b.constructor===Object)return fb(a,function(){var c,d,e;c=[];for(d in b)y.call(b,d)&&(e=b[d],c.push(fb.Pair(a,d,r(a,e))));return c}());throw new TypeError("Cannot convert "+B(b)+" to an ast literal")}var s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,ab,bb,cb,db,eb,fb,gb,hb,ib,jb,kb,lb,mb,nb,ob,pb,qb,rb,sb,tb,ub;s=function(a,b){var c;if(a===b)return 0;if(c=typeof a,"number"!==c&&"string"!==c)throw new TypeError("Cannot compare a non-number/string: "+c);if(c!==typeof b)throw new TypeError("Cannot compare elements of different types: "+c+" vs "+typeof b);return b>a?-1:1},t="function"==typeof Object.create?Object.create:function(a){function b(){}return b.prototype=a,new b},u=function(a,b){var c;for(c in b)y.call(b,c)&&(a[c]=b[c]);return a},v="function"==typeof Array.prototype.indexOf?function(a){return function(b,c){return-1!==a.call(c,b)}}(Array.prototype.indexOf):function(a,b){var c,d;for(d=+b.length,c=-1;++c<d;)if(a===b[c]&&c in b)return!0;return!1},w="function"==typeof Array.isArray?Array.isArray:function(a){return function(b){return"[object Array]"===a.call(b)}}(Object.prototype.toString),x=function(a){if("function"!=typeof a)throw new TypeError("Expected func to be a Function, got "+B(a));return a.displayName||a.name||""},y=Object.prototype.hasOwnProperty,z=Array.prototype.slice,A=function(a){if(null==a)throw new TypeError("Expected an object, got "+B(a));if(w(a))return a;if("string"==typeof a)return a.split("");if("number"==typeof a.length)return z.call(a);throw new TypeError("Expected an object with a length property, got "+B(a))},B=function(){var a;return a=Object.prototype.toString,function(b){return void 0===b?"Undefined":null===b?"Null":b.constructor&&b.constructor.name||a.call(b).slice(8,-1)}}(),tb=b("util"),null!=tb&&(ab=tb.inspect),gb=b("./utils").padLeft,C=b("./jsutils"),bb=C.isAcceptableIdent,pb=C.toJSSource,C=null,X=function(){var a;return a=[""],function(b){var c,d;if(b>=a.length)for(d=a[a.length-1],c=a.length;b>=c;++c)d+=" ",a.push(d);return a[b]}}(),cb=/(?:\r\n?|[\n\u2028\u2029])/g,c.Node=db=function(){function a(){var b;throw b=this instanceof a?this:t(c),new Error("Node cannot be instantiated directly")}function b(a,b){var c,d,e,f,g;if(0===b.length)return"[]";for(g="",g+="[",c=A(b),d=0,e=c.length;e>d;++d)f=c[d],g+="\n ",g+=ab(f,null,h(a)).split("\n").join("\n ");return g+="\n]"}var c;return c=a.prototype,a.displayName="Node",c.toString=function(a){var b;return null==a&&(a={}),b=f(),this.compile(u({indent:0,bare:!0},a),2,!1,b),b.toString()},c.compile=function(){throw new Error("Not implemented: "+x(this.constructor)+".compile()")},c.maybeToStatement=function(){return"function"==typeof this.toStatement?this.toStatement():this},c.isConst=function(){return!1},c.isNoop=function(){return!1},c.constValue=function(){throw new Error(this.constructor.name+" has no const value")},c.isLarge=function(){return!0},c.isSmall=function(){return!this.isLarge()},c.mutateLast=function(){return this},c.exitType=function(){return null},c.last=function(){return this},c.removeTrailingReturnVoids=function(){return this},c.walkWithThis=function(a){var b;return null!=(b=a(this))?b:this.walk(a)},c.inspect=function(a,c){var d,e,f;e=this.constructor.displayName,e+=' "',this.pos.file&&(e+=this.pos.file,e+=":"),e+=this.pos.line,e+=":",e+=this.pos.column,e+='"';for(d in this)y.call(this,d)&&(f=this[d],"pos"===d||!c&&(!f||w(f)&&0===f.length||f instanceof eb)||(e+="\n ",e+=d,e+=": ",e+=w(f)?b(a,f).split("\n").join("\n "):ab(f,null,h(a)).split("\n").join("\n ")));return e},c.toAst=function(a,b){return L(a,b,[N(a,this.typeId),N(a,this.pos.line),N(a,this.pos.column),N(a,this.pos.file||0)].concat(A(this._toAst(a,b))))},c._toAst=function(){return[]},c.toJSON=function(){return[this.typeId,this.pos.line,this.pos.column,this.pos.file||0].concat(A(this._toJSON()))},c._toJSON=function(){return[]},a}(),c.Expression=S=function(a){function b(){var a;throw a=this instanceof b?this:t(c),new Error("Expression cannot be instantiated directly")}var c,d;return d=a.prototype,c=b.prototype=t(d),c.constructor=b,b.displayName="Expression","function"==typeof a.extended&&a.extended(b),c.compileAsBlock=function(a,b,c,d){this.compile(a,b,c,d)},c.compileAsStatement=function(a,b,c){"function"==typeof this.toStatement?this.toStatement().compileAsStatement(a,b,c):(this.compile(a,1,b,c),c(";"))},c.isLarge=function(){return!1},c.invert=function(){return sb(this.pos,"!",this)},c.mutateLast=function(a){return a(this)},c.withLabel=function(a){return null==a&&(a=null),a?J(this.pos,[this],a):this},b}(db),c.Statement=kb=function(a){function b(){var a;throw a=this instanceof b?this:t(d),new Error("Expression cannot be instantiated directly")}var c,d;return c=a.prototype,d=b.prototype=t(c),d.constructor=b,b.displayName="Statement","function"==typeof a.extended&&a.extended(b),d.compileAsStatement=function(a,b,c){return this.compile(a,1,b,c)},b}(db),c.Access=function(a,b){var c,d,e,f,g;for(f=z.call(arguments,2),g=b,c=0,d=f.length;d>c;++c)e=f[c],g=G(a,g,".",e);return g},c.Arguments=D=function(a){function b(a){var d;return d=this instanceof b?this:t(c),d.pos=a,d}var c,d;return d=a.prototype,c=b.prototype=t(d),c.constructor=b,b.displayName="Arguments","function"==typeof a.extended&&a.extended(b),c.compile=function(a,b,c,d){var e;null!=(e=a.sourceMap)&&e.add(d.line,d.column,this.pos.line,this.pos.column,this.pos.file),d("arguments")},c.compileAsBlock=function(a,b,c,d){eb(this.pos).compileAsBlock(a,b,c,d)},c.walk=function(){return this},c.isNoop=function(){return!0},c.typeId=1,b._fromAst=function(a){return b(a)},b.fromJSON=function(a,c,d){return b(g(a,c,d))},b}(S),c.Arr=E=function(b){function c(a,b){var d;return d=this instanceof c?this:t(f),d.pos=a,null==b&&(b=[]),d.elements=b,d}function d(b,c,d,e,f){var g,h,i,j,k;for(h=a(c),g=A(b),i=0,k=g.length;k>i;++i)j=g[i],f(c.linefeed||"\n"),f.indent(h.indent),j.compile(h,3,!1,f),k-1>i&&f(",");f(c.linefeed||"\n"),f.indent(c.indent)}function e(a,b,c,d,e){var f,g,h,i;for(f=A(a),h=0,g=f.length;g>h;++h)i=f[h],h>0&&(e(","),b.minify||e(" ")),i.compile(b,3,!1,e)}var f,h;return h=b.prototype,f=c.prototype=t(h),f.constructor=c,c.displayName="Arr","function"==typeof b.extended&&b.extended(c),f.compile=function(a,b,c,f){var g,h;null!=a.sourceMap&&this.pos.file&&a.sourceMap.pushFile(this.pos.file),null!=(g=a.sourceMap)&&g.add(f.line,f.column,this.pos.line,this.pos.column),f("["),h=!a.minify&&this.shouldCompileLarge()?d:e,h(this.elements,a,b,c,f),f("]"),null!=a.sourceMap&&this.pos.file&&a.sourceMap.popFile()},f.compileAsBlock=function(a,b,c,d){return I(this.pos,this.elements).compileAsBlock(a,b,c,d)},f.compileAsStatement=function(a,b,c){J(this.pos,this.elements).compile(a,1,b,c)},f.shouldCompileLarge=function(){switch(this.elements.length){case 0:return!1;case 1:return this.elements[0].isLarge();default:return this.isLarge()}},f.isSmall=function(){switch(this.elements.length){case 0:return!0;case 1:return this.elements[0].isSmall();default:return!1}},f.isLarge=function(){var a,b;return b=this,null==(a=this._isLarge)?this._isLarge=this.elements.length>4||function(){var a,c,d,e;for(d=!1,a=A(b.elements),c=a.length;c--;)if(e=a[c],!e.isSmall()){d=!0;break}return d}():a},f.isNoop=function(){var a,b,c,d,e;if(null==(d=this._isNoop)){for(b=!0,a=A(this.elements),c=a.length;c--;)if(e=a[c],!e.isNoop()){b=!1;break}return this._isNoop=b}return d},f.walk=function(a){var b;return b=i(this.elements,this,"element",a),this.elements!==b?c(this.pos,b):this},f.typeId=2,f._toAst=function(a,b){var c,d,e,f,g;for(c=[],d=A(this.elements),e=0,f=d.length;f>e;++e)g=d[e],c.push(g.toAst(a,b));return c},c._fromAst=function(a){var b;return b=z.call(arguments,1),c(a,b)},f._toJSON=function(){return j(this.elements,0)},c.fromJSON=function(a,b,d){var e;return e=z.call(arguments,3),c(g(a,b,d),q(e))},c}(S),c.Assign=function(a){var b,c,d,e,f,g;for(b=arguments.length-1,b>1?g=z.call(arguments,1,b):(b=1,g=[]),d=arguments[b],f=d,c=g.length;c--;)e=g[c],f=G(a,e,"=",f);return f},c.BinaryChain=function(a,b){var c,d,e,f,g,h,i,j;if(f=z.call(arguments,2),"+"===b)for(h=f.length-2;h>=0;--h)i=f[h],j=f[h+1],("string"==typeof i||i instanceof N&&"string"==typeof i.value)&&("string"==typeof j||j instanceof N&&"string"==typeof j.value)&&f.splice(h,2,""+("string"==typeof i?i:i.value)+("string"==typeof j?j:j.value));for(g=f[0],c=1,d=f.length;d>c;++c)e=f[c],g=G(a,g,b,e);return g},c.And=function(a){var b,c,d,e;if(c=z.call(arguments,1),0===c.length)return N(a,!0);for(d=c[0],e=1,b=c.length;b>e;++e)d=G(a,d,"&&",c[e]);return d},c.Or=function(a){var b,c,d,e;if(c=z.call(arguments,1),0===c.length)return N(a,!1);for(d=c[0],e=1,b=c.length;b>e;++e)d=G(a,d,"||",c[e]);return d},c.Binary=G=function(a){function b(c,d,f,g){var i,j;if(j=this instanceof b?this:t(e),j.pos=c,null==d&&(d=eb(c)),j.left=d,j.op=f,null==g&&(g=eb(c)),j.right=g,!y.call(n,f))throw new Error("Unknown binary operator: "+pb(f));if(d instanceof a||(d=l(c,d)),g instanceof a||(g=l(c,g)),y.call(h,f)){if(!(d instanceof Y||d instanceof b&&"."===d.op))throw new Error("Cannot assign with "+f+" to non-Ident or Access: "+B(d));if(d instanceof b&&d.left instanceof I)return I(c,A(z.call(d.left.body,0,-1)).concat([b.call(j,c,b(d.pos,(i=d.left.body)[i.length-1],".",d.right),f,g)]));if(g instanceof I&&(d instanceof Y||d.left.isNoop()&&d.right.isNoop()))return I(c,A(z.call(g.body,0,-1)).concat([b.call(j,c,d,f,(i=g.body)[i.length-1])]))}else if(d instanceof I&&"."!==f)return I(c,A(z.call(d.body,0,-1)).concat([b.call(j,c,(i=d.body)[i.length-1],f,g)]));return j.left=d,j.right=g,j}function c(a,b,c,d,e,f,g){var h,i,j;h=c instanceof N&&"string"==typeof c.value&&bb(c.value),j=e>18,j&&g("("),b instanceof N&&"number"==typeof b.value?(i=pb(b.value),m(b.value)||!isFinite(b.value)?(g("("),g(i),g(")")):(g(i),h&&-1===i.indexOf("e")&&-1===i.indexOf(".")&&g("."))):b.isConst()&&void 0===b.constValue()?(g("("),(b instanceof N?b:N(b.pos,void 0)).compile(d,2,!1,g),g(")")):b.compile(d,18,f,g),h?(g("."),g(c.value)):(g("["),c.compile(d,2,!1,g),g("]")),j&&g(")")}function d(a,c,d,e,f,g,h){var i,k,l,m;k=n[a],i=j[k],m="paren"===i?f>=k:f>k,m&&h("("),c.compile(e,"right"===i&&c instanceof b&&n[c.op]===k?+k+1:k,g&&!m,h),l=!e.minify||/^\w/.test(a),l&&h(" "),h(a),l&&h(" "),d.compile(e,"left"===i&&d instanceof b&&n[d.op]===k?+k+1:k,!1,h),m&&h(")")}var e,f,h,i,j,n;return f=a.prototype,e=b.prototype=t(f),e.constructor=b,b.displayName="Binary","function"==typeof a.extended&&a.extended(b),e.compile=function(a,b,e,f){var g,h;null!=a.sourceMap&&this.pos.file&&a.sourceMap.pushFile(this.pos.file),null!=(g=a.sourceMap)&&g.add(f.line,f.column,this.pos.line,this.pos.column),h="."===this.op?c:d,h(this.op,this.left,this.right,a,b,e,f),null!=a.sourceMap&&this.pos.file&&a.sourceMap.popFile()},e.compileAsBlock=function(a,b,c,d){var e;y.call(h,this.op)||"."===(e=this.op)||"&&"===e||"||"===e?f.compileAsBlock.call(this,a,b,c,d):I(this.pos,[this.left,this.right]).compileAsBlock(a,b,c,d)},e.compileAsStatement=function(a,b,c){var d,e,g;d=this,e=this.left,g=this.op,y.call(h,g)?f.compileAsStatement.call(this,a,b,c):"&&"===this.op?_(this.pos,this.left,this.right).compileAsStatement(a,b,c):"||"===this.op?_(this.pos,this.left.invert(),this.right).compileAsStatement(a,b,c):"."===g?f.compileAsStatement.call(this,a,b,c):J(this.pos,[this.left,this.right]).compileAsStatement(a,b,c)},h={"=":!0,"+=":!0,"-=":!0,"*=":!0,"/=":!0,"%=":!0,"<<=":!0,">>=":!0,">>>=":!0,"&=":!0,"^=":!0,"|=":!0},e.isAssign=function(){return y.call(h,this.op)},n={".":18,"*":15,"/":15,"%":15,"+":14,"-":14,"<<":13,">>":13,">>>":13,"<":12,"<=":12,">":12,">=":12,"in":12,"instanceo