diff --git a/README.md b/README.md index 99b8614..2bcb3f7 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ const sb = require('structure-bytes'); //Buffer obtained somehow let tribeBuffer = Buffer.from([0x51, 0x03, 0x06, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x51, 0x03, 0x03, 0x64, 0x6f, 0x62, 0x15, 0x02, 0x69, 0x64, 0x12, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x41, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x53, 0xff, 0x00, 0x1b, 0x05, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x54, 0xff, 0x00, 0x25, 0x20]); -let type = sb.type(tribeBuffer); +let type = sb.r.type(tribeBuffer); console.log(type); /* StructType { @@ -122,7 +122,7 @@ StructType { //Buffer obtained somehow let buffer = Buffer.from([0x00, 0x00, 0x01, 0x4e, 0xb7, 0x2d, 0x6c, 0x20, 0x00, 0x0a, 0x4a, 0x6f, 0x65, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x4e, 0xb7, 0x2d, 0x6c, 0x21, 0x00, 0x09, 0x4c, 0x6f, 0x75, 0x69, 0x73, 0x00, 0x00, 0x00, 0x01, 0x4e, 0xb7, 0x2d, 0x6c, 0x22, 0x00, 0x11, 0x47, 0x61, 0x72, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x4e, 0xb7, 0x2d, 0x6c, 0x21, 0x00, 0x09, 0x4c, 0x6f, 0x75, 0x69, 0x73, 0x00, 0x41, 0xb8, 0x66, 0x66, 0x00, 0x00, 0x01, 0x4e, 0xb7, 0x2d, 0x6c, 0x22, 0x00, 0x11, 0x47, 0x61, 0x72, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x00, 0xc1, 0x21, 0x1e, 0xb8]); -console.log(sb.value({type, buffer})); +console.log(sb.r.value({type, buffer})); /* { leader: { dob: 2015-07-22T19:11:24.192Z, id: 10, name: 'Joe' }, members: diff --git a/compiled/download.js b/compiled/download.js index c64e86e..cab07a9 100644 --- a/compiled/download.js +++ b/compiled/download.js @@ -1,4 +1,4 @@ -require=function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var f=new Error("Cannot find module '"+a+"'");throw f.code="MODULE_NOT_FOUND",f}var h=r[a]={exports:{}};t[a][0].call(h.exports,function(e){var r=t[a][1][e];return i(r?r:e)},h,h.exports,e,t,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a=200&&t.status<300||304===t.status;r?e[a]=t.response:e.text=t.statusText,n(t.status,t.statusText,e,t.getAllResponseHeaders())}),t.open(o,i,u),t.responseType=a;for(var f in r)r.hasOwnProperty(f)&&t.setRequestHeader(f,r[f]);t.send(s)},abort:function(){t&&t.abort()}}}})}(jQuery)},{}],"/config.js":[function(e,t,r){(function(r,n){"use strict";"/"===n&&(n="");var i=e(n+"/lib/assert.js"),o=7;i.between(0,o,65536);var a=2,s=r.allocUnsafe(a);s.writeUInt16BE(o,0);var u=s.toString("base64");t.exports={VERSION_STRING:u}}).call(this,e("buffer").Buffer,"/")},{buffer:5}],"/io.js":[function(e,t,r){(function(r,n){"use strict";function i(){this.end()}"/"===n&&(n="");var o=e(n+"/lib/assert.js"),a=e(n+"/lib/buffer-stream.js"),s=e(n+"/lib/growable-buffer.js"),u=e(n+"/read.js"),f=e("stream"),h=e(n+"/structure-types.js"),l=t.exports={writeType:function(e,t){var r=e.type,n=e.outStream;return o.instanceOf(r,h.Type),o.instanceOf(n,[f.Writable,f.Duplex]),void 0===t&&(t=function(){}),o.instanceOf(t,Function),new a(r.toBuffer()).pipe(n).on("error",function(e){this.end(),t(e)}).on("finish",function(){return t(null)})},writeValue:function(e,t){var r=e.type,n=e.value,i=e.outStream;o.instanceOf(r,h.Type),o.instanceOf(i,[f.Writable,f.Duplex]),void 0===t&&(t=function(){}),o.instanceOf(t,Function);var u=new s;return r.writeValue(u,n),new a(u).pipe(i).on("error",function(e){this.end(),t(e)}).on("finish",function(){return t(null)})},writeTypeAndValue:function(e,t){var r=e.type,n=e.value,s=e.outStream;o.instanceOf(r,h.Type),o.instanceOf(s,[f.Writable,f.Duplex]),void 0===t&&(t=function(){}),o.instanceOf(t,Function);var u=new a(r.toBuffer());return u.pipe(s,{end:!1}).on("error",i),u.on("bs-written",function(){l.writeValue({type:r,value:n,outStream:s},t)}),s},readType:function(e,t){o.instanceOf(e,f.Readable),o.instanceOf(t,Function);var n=[];e.on("data",function(e){return n.push(e)}),e.on("error",i).on("error",function(e){return t(e,null)}),e.on("end",function(){var e=r.concat(n),i=void 0;try{i=u.type(e,!1)}catch(e){t(e,null)}i&&t(null,i)})},readValue:function(e,t){var n=e.inStream,a=e.type;o.instanceOf(n,f.Readable),o.instanceOf(t,Function);var s=[];n.on("data",function(e){return s.push(e)}),n.on("error",i).on("error",function(e){return t(e,null)}),n.on("end",function(){var e=r.concat(s),n=void 0;try{n=u.value({buffer:e,type:a})}catch(e){t(e,null)}n&&t(null,n)})},readTypeAndValue:function(e,t){o.instanceOf(e,f.Readable),o.instanceOf(t,Function);var n=[];e.on("data",function(e){return n.push(e)}),e.on("error",i).on("error",function(e){return t(e,null,null)}),e.on("end",function(){var e=r.concat(n),i=void 0;try{i=u._consumeType(e,0)}catch(e){t(e,null,null)}if(i){var o=void 0;try{o=u.value({buffer:e,offset:i.length,type:i.value})}catch(e){t(e,null,null)}o&&t(null,i.value,o)}})},httpRespond:function(e,t){var r=this,n=e.req,i=e.res,a=e.type,s=e.value;o.instanceOf(a,h.Type),void 0===t&&(t=function(){}),o.instanceOf(t,Function),i.setHeader("Content-Type","application/octet-stream"),i.setHeader("Content-Encoding","gzip"),i.setHeader("sig",a.getSignature());var u=zlib.createGzip();n.headers.sig&&n.headers.sig===a.getSignature()?l.writeValue({type:a,value:s,outStream:u},function(e){e&&t(e)}):l.writeTypeAndValue({type:a,value:s,outStream:u},function(e){e&&t(e)}),u.pipe(i).on("error",function(e){r.close(),t(e)}).on("finish",function(){return t(null)})}}}).call(this,e("buffer").Buffer,"/")},{buffer:5,stream:32}],"/lib/assert.js":[function(e,t,r){"use strict";var n=e("/lib/util-inspect.js"),i={instanceOf:function(e,t){t instanceof Array||(t=[t]);var r=!1,i=!0,o=!1,a=void 0;try{for(var s,u=t[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var f=s.value;if(e instanceof f||void 0!==e&&null!==e&&e.constructor===f){r=!0;break}}}catch(e){o=!0,a=e}finally{try{!i&&u.return&&u.return()}finally{if(o)throw a}}if(!r)throw new TypeError(n.inspect(e)+" is not an instance of "+t.map(function(e){return e.name}).join(" or "))},integer:function(e){if(i.instanceOf(e,Number),!Number.isSafeInteger(e))throw new RangeError(n.inspect(e)+" is not an integer")},between:function(e,t,r){var i=arguments.length<=3||void 0===arguments[3]?"":arguments[3];if(t=r)throw new RangeError(i+n.inspect(t)+" is not in ["+n.inspect(e)+","+n.inspect(r)+")")},byteUnsignedInteger:function(e){i.integer(e),i.between(0,e,256)},fourByteUnsignedInteger:function(e){i.integer(e),i.between(0,e,4294967296)},fail:function(e){throw new Error(e)},assert:function(e,t){e||i.fail(t)},throws:function(e){var t=!0;try{e(),t=!1}catch(e){}i.assert(t,"Should throw an error")},equal:function(e,t){var r=new RangeError("Expected "+n.inspect(t)+" but got "+n.inspect(e));if(t&&t.constructor===Object){for(var o in t)if(t.hasOwnProperty(o))try{i.equal(e[o],t[o])}catch(e){throw r}}else if(t&&t.constructor===Array){if(!e||e.constructor!==Array)throw r;try{i.equal(e.length,t.length)}catch(e){throw r}for(var a=0;a>>3},modEight:function(e){return 7&e}}},{}],"/lib/buffer-stream.js":[function(e,t,r){(function(r,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=function(){function e(e,t){for(var r=0;rthis.buffer.length){var t=r.allocUnsafe(e<<1);this.buffer.copy(t,0,0,this.size),this.buffer=t}return this}},{key:"set",value:function(e,t){return a.integer(e),a.integer(t),a.between(0,e,this.size,"Index out of bounds: "),a.between(0,t,256,"Not a byte: "),this.buffer.writeUInt8(t,e),this}},{key:"setAll",value:function(e,t){a.instanceOf(t,r),a.integer(e),a.between(0,e,this.size-t.length+1,"Index out of bounds: "),t.copy(this.buffer,e)}},{key:"get",value:function(e){return a.integer(e),a.between(0,e,this.size,"Index out of bounds: "),this.buffer.readUInt8(e)}},{key:"add",value:function(e){var t=this.size,r=t+1;return this.grow(r),this.size=r,this.set(t,e),this}},{key:"addAll",value:function(e){a.instanceOf(e,r);var t=this.size,n=this.size+e.length;return this.grow(n),this.size=n,e.copy(this.buffer,t),this}},{key:"toBuffer",value:function(){return this.buffer.slice(0,this.size)}},{key:"length",get:function(){return this.size}},{key:"rawBuffer",get:function(){return this.buffer}}]),e}()}).call(this,e("buffer").Buffer,"/lib")},{buffer:5}],"/lib/strint.js":[function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},i={};!function(){function e(e,t){return O(e)===O(t)}function t(e,t){for(;t>0;)e+="0",t--;return e}function r(e){f(e,"string")}function o(e){r(e),u(e,O,"isPositive")}function a(e){f(e,"number")}function s(e){if(f(e,"number"),e<0)throw new Error("Expected a positive number: "+e)}function u(e,t,r){if(!t.call(null,e))throw new Error("Condition "+r+" failed for value "+e)}function f(e,t){if(("undefined"==typeof e?"undefined":n(e))!==t)throw new Error("Not a "+t+": "+e)}var h=i.subPositive=function(e,t){if(o(e),o(t),!m(e,t))throw new Error("x must be greater or equal to y");for(var r=Math.max(e.length,t.length),n="",i=0,a=0,s=0;s=10;)h-=10,i++;0===h?a++:(n=String(h)+x(n,a),a=0)}return i>0&&(n=String(i)+x(n,a)),n},c=i.add=function(e,t){if(r(e),r(t),O(e)&&O(t))return l(e,t);if(T(e)&&T(t))return S(l(B(e),B(t)));if(_(B(e),B(t))){var n=e;e=t,t=n}var i=h(B(e),B(t));return O(e)?i:S(i)},p=i.sub=function(e,t){return r(e),r(t),c(e,S(t))},d=i.timesDigit=function(e,t){o(e),a(t);for(var r="",n=P(e),i=0,s=0,u=0;u=10;)f-=10,i++;0===f?s++:(r=String(f)+x(r,s),s=0)}return i>0&&(r=String(i)+x(r,s)),0===r.length?"0":r},y=i.mulPositive=function(e,r){o(e),o(r);for(var n="0",i=P(r),a=0;a=P(e)?"0":e.charAt(e.length-t-1)},P=function(e){return T(e)?e.length-1:e.length}}(),i.LONG_UPPER_SHIFT="4294967296",t.exports=i},{}],"/lib/util-inspect.js":[function(e,t,r){"use strict";r.inspect=function(e){if(void 0===e)return"undefined";if(null===e||e.constructor===Object||e.constructor===Array||e.constructor===String||e.constructor===Number||e.constructor===Boolean||e.constructor===Date)return JSON.stringify(e);if(e.constructor===Set){for(var t="Set {",n=e.values(),i=n.next();!i.done;)t+=r.inspect(i.value),i=n.next(),i.done||(t+=", ");return t+"}"}if(e.constructor===Map){for(var o="Map {",a=e.entries(),s=a.next();!s.done;)o+=r.inspect(s.value[0]),o+=" => ",o+=r.inspect(s.value[1]),s=a.next(),s.done||(o+=", ");return o+"}"}return e.constructor.name?e.constructor.name+" "+JSON.stringify(e):JSON.stringify(e)}},{}],"/read.js":[function(e,t,r){(function(r,n){"use strict";function i(e,t){try{return{value:e.readUInt32BE(t),length:4}}catch(e){throw new Error(y)}}function o(e,t){h.assert(t>=0,"Offset is negative: "+String(t)),h.assert(e.length>t,y);var r=void 0,n=1;switch(e.readUInt8(t)){case p.ByteType._value:r=new p.ByteType;break;case p.ShortType._value:r=new p.ShortType;break;case p.IntType._value:r=new p.IntType;break;case p.LongType._value:r=new p.LongType;break;case p.UnsignedByteType._value:r=new p.UnsignedByteType;break;case p.UnsignedShortType._value:r=new p.UnsignedShortType;break;case p.UnsignedIntType._value:r=new p.UnsignedIntType;break;case p.UnsignedLongType._value:r=new p.UnsignedLongType;break;case p.DateType._value:r=new p.DateType;break;case p.FloatType._value:r=new p.FloatType;break;case p.DoubleType._value:r=new p.DoubleType;break;case p.BooleanType._value:r=new p.BooleanType;break;case p.BooleanTupleType._value:var a=i(e,t+n);r=new p.BooleanTupleType(a.value),n+=a.length;break;case p.BooleanArrayType._value:r=new p.BooleanArrayType;break;case p.CharType._value:r=new p.CharType;break;case p.StringType._value:r=new p.StringType;break;case p.OctetsType._value:r=new p.OctetsType;break;case p.TupleType._value:var s=o(e,t+n);n+=s.length;var f=i(e,t+n);n+=f.length,r=new p.TupleType({type:s.value,length:f.value});break;case p.StructType._value:h.assert(e.length>t+n,y);var l=e.readUInt8(t+n);n++;for(var c={},d=0;dt+n,y);var v=e.readUInt8(t+n);n++,h.assert(e.length>=t+n+v);var g=e.toString("utf8",t+n,t+n+v);n+=v;var b=o(e,t+n);c[g]=b.value,n+=b.length}r=new p.StructType(c);break;case p.ArrayType._value:var w=o(e,t+n);n+=w.length,r=new p.ArrayType(w.value);break;case p.SetType._value:var _=o(e,t+n);n+=_.length,r=new p.SetType(_.value);break;case p.MapType._value:var m=o(e,t+n);n+=m.length;var E=o(e,t+n);n+=E.length,r=new p.MapType(m.value,E.value);break;case p.EnumType._value:var T=o(e,t+n);n+=T.length,h.assert(e.length>t+n,y);var O=e.readUInt8(t+n);n++;for(var B=[],S=0;St+n,y);var A=e.readUInt8(t+n);n++;for(var j=new Array(A),R=0;R=t+U,y);var L=o(e,t+n-e.readUInt16BE(t+n));r=L.value,n=U;break;default:h.fail("No such type: 0x"+e[t].toString(16))}return{value:r,length:n}}function a(e){var t=arguments.length<=1||void 0===arguments[1]||arguments[1];h.instanceOf(e,r);var n=o(e,0),i=n.value,a=n.length;return t&&h.assert(a===e.length,"Did not consume all of the buffer"),i}function s(e){var t=e.buffer,r=e.offset,n=e.count,i=new Array(n),o=l.modEight(i.length),a=l.dividedByEight(i.length),s=void 0;s=o?a+1:a,h.assert(t.length>=r+s,y);for(var u=0;u=n+f,y),a=t.readInt8(n);break;case p.ShortType:f=2,h.assert(t.length>=n+f,y),a=t.readInt16BE(n);break;case p.IntType:f=4,a=t.readInt32BE(n);break;case p.LongType:f=8,h.assert(t.length>=n+f,y);var l=t.readInt32BE(n),v=t.readUInt32BE(n+4);a=c.add(c.mul(String(l),c.LONG_UPPER_SHIFT),String(v));break;case p.UnsignedByteType:f=1,h.assert(t.length>=n+f,y),a=t.readUInt8(n);break;case p.UnsignedShortType:f=2,h.assert(t.length>=n+f,y),a=t.readUInt16BE(n);break;case p.UnsignedIntType:f=4,h.assert(t.length>=n+f,y),a=t.readUInt32BE(n);break;case p.UnsignedLongType:case p.DateType:f=8,h.assert(t.length>=n+f,y);var g=t.readUInt32BE(n),b=t.readUInt32BE(n+4);a=c.add(c.mul(String(g),c.LONG_UPPER_SHIFT),String(b)),o.constructor===p.DateType&&(a=new Date(Number(a)));break;case p.FloatType:f=4,h.assert(t.length>=n+f,y),a=t.readFloatBE(n);break;case p.DoubleType:f=8,h.assert(t.length>=n+f,y),a=t.readDoubleBE(n);break;case p.BooleanType:f=1,h.assert(t.length>=n+f,y);var w=t.readUInt8(n);h.assert(0===w||255===w,"0x"+w.toString(16)+" is an invalid Boolean value"),a=!!w;break;case p.BooleanArrayType:var _=i(t,n);f=_.length;var m=s({buffer:t,offset:n+f,count:_.value});f+=m.length,a=m.value;break;case p.BooleanTupleType:var E=s({buffer:t,offset:n,count:o.length});a=E.value,f=E.length;break;case p.CharType:h.assert(t.length>n,y),a=t.slice(n,n+4).toString()[0],f=r.byteLength(a);break;case p.StringType:for(f=0;h.assert(t.length>n+f,y),t.readUInt8(n+f);)f++;a=t.slice(n,n+f).toString(),f++;break;case p.OctetsType:var T=i(t,n);f=T.length;var O=f+T.value;h.assert(t.length>=n+O,y),a=t.slice(n+f,n+O),f=O;break;case p.TupleType:f=0,a=new Array(o.length);for(var B=0;B=n+f,y);var H=t.readUInt8(n);a=o.values[H],void 0===a&&h.fail("Index "+String(H)+" is invalid");break;case p.ChoiceType:f=1,h.assert(t.length>=n+f,y);var G=t.readUInt8(n),J=u({buffer:t,offset:n+f,type:o.types[G]});f+=J.length,a=J.value;break;case p.OptionalType:f=1,h.assert(t.length>=n+f,y);var X=t.readUInt8(n);if(h.assert(0===X||255===X,"0x"+X.toString(16)+" is an invalid Optional byte"),X){var $=u({buffer:t,offset:n+f,type:o.type});f+=$.length,a=$.value}else a=null;break;case p.PointerType:var Q=i(t,n);f=Q.length,a=u({buffer:t,offset:Q.value,type:o.type}).value;break;default:h.fail("Not a structure type: "+d.inspect(o))}return{value:a,length:f}}function f(e){var t=e.buffer,n=e.type,i=e.offset;h.instanceOf(t,r),h.instanceOf(n,p.Type),void 0===i&&(i=0),h.instanceOf(i,Number);var o=u({buffer:t,offset:i,type:n}),a=o.value;return a}"/"===n&&(n="");var h=e(n+"/lib/assert.js"),l=e(n+"/lib/bit-math.js"),c=e(n+"/lib/strint.js"),p=e(n+"/structure-types.js"),d=e("/lib/util-inspect.js"),y="Buffer is not long enough";t.exports={_consumeType:o,type:a,value:f}}).call(this,e("buffer").Buffer,"/")},{"/lib/util-inspect.js":"/lib/util-inspect.js",buffer:5}],"/structure-types.js":[function(e,t,r){(function(r,n){"use strict";function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){var t=r.allocUnsafe(4);return t.writeUInt32BE(e,0),t}function u(e,t){if(t&&e.pointers){var n=!0,i=!1,o=void 0;try{for(var a,s=e.pointers[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=p(a.value,2),f=u[0],h=u[1],l=e.length;e.addAll(r.from(f,T));var c=r.allocUnsafe(4);c.writeUInt32BE(l);var d=!0,y=!1,v=void 0;try{for(var g,b=h[Symbol.iterator]();!(d=(g=b.next()).done);d=!0){var w=g.value;e.setAll(w,c)}}catch(e){y=!0,v=e}finally{try{!d&&b.return&&b.return()}finally{if(y)throw v}}}}catch(e){i=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}}}function f(e,t){if(d.instanceOf(e,g),d.instanceOf(t,String),b.gt(t,"18446744073709551615")||b.lt(t,"0"))throw new Error("Value out of range");var n=b.div(t,b.LONG_UPPER_SHIFT),i=b.sub(t,b.mul(n,b.LONG_UPPER_SHIFT)),o=r.allocUnsafe(8);o.writeUInt32BE(Number(n),0),o.writeUInt32BE(Number(i),4),e.addAll(o)}function h(e,t){d.instanceOf(t,Array);var n=E(t.length),i=m(t.length),o=void 0;o=n?i+1:i;var a=r.allocUnsafe(o);n&&(a[o-1]=0);for(var s=0;st[J])return 1;throw new Error("Should not have any duplicate fields")}),n}return o(t,e),c(t,null,[{key:"_value",get:function(){return 81}}]),c(t,[{key:"addToBuffer",value:function(e){if(l(Object.getPrototypeOf(t.prototype),"addToBuffer",this).call(this,e)){e.add(this.fields.length);var n=!0,i=!1,o=void 0;try{for(var a,s=this.fields[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value,f=r.from(u[J]);e.add(f.length),e.addAll(f),u[X].addToBuffer(e)}}catch(e){i=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}}}},{key:"writeValue",value:function(e,t){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];d.instanceOf(e,g),d.instanceOf(t,Object);var n=!0,i=!1,o=void 0;try{for(var a,s=this.fields[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var f=a.value;f[X].writeValue(e,t[f[J]],!1)}}catch(e){i=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}u(e,r)}}]),t}(S),Q=function(e){function t(e){a(this,t);var r=i(this,Object.getPrototypeOf(t).call(this));return d.instanceOf(e,B),r.type=e,r}return o(t,e),c(t,null,[{key:"_value",get:function(){return 82}}]),c(t,[{key:"addToBuffer",value:function(e){l(Object.getPrototypeOf(t.prototype),"addToBuffer",this).call(this,e)&&this.type.addToBuffer(e)}},{key:"_writeValue",value:function(e,t,r){d.instanceOf(e,g),d.fourByteUnsignedInteger(t.length),e.addAll(s(t.length));var n=!0,i=!1,o=void 0;try{for(var a,f=t[Symbol.iterator]();!(n=(a=f.next()).done);n=!0){var h=a.value;this.type.writeValue(e,h,!1)}}catch(e){i=!0,o=e}finally{try{!n&&f.return&&f.return()}finally{if(i)throw o}}u(e,r)}},{key:"writeValue",value:function(e,t){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];d.instanceOf(t,Array),this._writeValue(e,t,r)}}]),t}(S),Z=function(e){function t(e){return a(this,t),i(this,Object.getPrototypeOf(t).call(this,e))}return o(t,e),c(t,null,[{key:"_value",get:function(){return 83}}]),c(t,[{key:"writeValue",value:function(e,t){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];d.instanceOf(t,Set),t.length=t.size,this._writeValue(e,t,r)}}]),t}(Q),K=function(e){function t(e,r){a(this,t);var n=i(this,Object.getPrototypeOf(t).call(this));return d.instanceOf(e,B),d.instanceOf(r,B),n.keyType=e,n.valueType=r,n}return o(t,e),c(t,null,[{key:"_value",get:function(){return 84}}]),c(t,[{key:"addToBuffer",value:function(e){l(Object.getPrototypeOf(t.prototype),"addToBuffer",this).call(this,e)&&(this.keyType.addToBuffer(e),this.valueType.addToBuffer(e))}},{key:"writeValue",value:function(e,t){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];d.instanceOf(e,g),d.instanceOf(t,Map),d.fourByteUnsignedInteger(t.size),e.addAll(s(t.size));var n=!0,i=!1,o=void 0;try{for(var a,f=t[Symbol.iterator]();!(n=(a=f.next()).done);n=!0){var h=p(a.value,2),l=h[0],c=h[1];this.keyType.writeValue(e,l,!1),this.valueType.writeValue(e,c,!1)}}catch(e){i=!0,o=e}finally{try{!n&&f.return&&f.return()}finally{if(i)throw o}}u(e,r)}}]),t}(S),ee=function(e){function t(e){var r=e.type,n=e.values;a(this,t);var o=i(this,Object.getPrototypeOf(t).call(this));d.instanceOf(r,S),d.instanceOf(n,Array);try{d.byteUnsignedInteger(n.length)}catch(e){throw new Error(String(n.length)+" values is too many")}for(var s=new Map,u=0;u0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[s-2]?2:"="===e[s-1]?1:0,a=new h(3*s/4-o),n=o>0?s-4:s;var u=0;for(t=0,r=0;t>16&255,a[u++]=i>>8&255,a[u++]=255&i;return 2===o?(i=f[e.charCodeAt(t)]<<2|f[e.charCodeAt(t+1)]>>4,a[u++]=255&i):1===o&&(i=f[e.charCodeAt(t)]<<10|f[e.charCodeAt(t+1)]<<4|f[e.charCodeAt(t+2)]>>2,a[u++]=i>>8&255,a[u++]=255&i),a}function o(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}function a(e,t,r){for(var n,i=[],a=t;ah?h:f+s));return 1===n?(t=e[r-1],i+=u[t>>2],i+=u[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=u[t>>10],i+=u[t>>4&63],i+=u[t<<2&63],i+="="),o.push(i),o.join("")}r.toByteArray=i,r.fromByteArray=s;var u=[],f=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array;n()},{}],3:[function(e,t,r){},{}],4:[function(e,t,r){(function(t){"use strict";var n=e("buffer"),i=n.Buffer,o=n.SlowBuffer,a=n.kMaxLength||2147483647;r.alloc=function(e,t,r){if("function"==typeof i.alloc)return i.alloc(e,t,r);if("number"==typeof r)throw new TypeError("encoding must not be number");if("number"!=typeof e)throw new TypeError("size must be a number");if(e>a)throw new RangeError("size is too large");var n=r,o=t;void 0===o&&(n=void 0,o=0);var s=new i(e);if("string"==typeof o)for(var u=new i(o,n),f=u.length,h=-1;++ha)throw new RangeError("size is too large");return new i(e)},r.from=function(e,r,n){if("function"==typeof i.from&&(!t.Uint8Array||Uint8Array.from!==i.from))return i.from(e,r,n);if("number"==typeof e)throw new TypeError('"value" argument must not be a number');if("string"==typeof e)return new i(e,r);if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer){var o=r;if(1===arguments.length)return new i(e);"undefined"==typeof o&&(o=0);var a=n;if("undefined"==typeof a&&(a=e.byteLength-o),o>=e.byteLength)throw new RangeError("'offset' is out of bounds");if(a>e.byteLength-o)throw new RangeError("'length' is out of bounds");return new i(e.slice(o,o+a))}if(i.isBuffer(e)){var s=new i(e.length);return e.copy(s,0,0,e.length),s}if(e){if(Array.isArray(e)||"undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return new i(e);if("Buffer"===e.type&&Array.isArray(e.data))return new i(e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")},r.allocUnsafeSlow=function(e){if("function"==typeof i.allocUnsafeSlow)return i.allocUnsafeSlow(e);if("number"!=typeof e)throw new TypeError("size must be a number");if(e>=a)throw new RangeError("size is too large");return new o(e)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{buffer:5}],5:[function(e,t,r){(function(t){"use strict";function n(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}function i(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,t){if(i()=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function v(e){return+e!=e&&(e=0),a.alloc(+e)}function g(e,t){if(a.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"binary":case"raw":case"raws":return r;case"utf8":case"utf-8":case void 0:return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(n)return Y(e).length;t=(""+t).toLowerCase(),n=!0}}function b(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return A(this,t,r);case"ascii":return R(this,t,r);case"binary":return x(this,t,r);case"base64":return k(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function w(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function _(e,t,r,n){function i(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}var o=1,a=e.length,s=t.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,a/=2,s/=2,r/=2}for(var u=-1,f=r;fi&&(n=i)):n=i;var o=t.length;if(o%2!==0)throw new Error("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a239?4:o>223?3:o>191?2:1;if(i+s<=r){var u,f,h,l;switch(s){case 1:o<128&&(a=o);break;case 2:u=e[i+1],128===(192&u)&&(l=(31&o)<<6|63&u,l>127&&(a=l));break;case 3:u=e[i+1],f=e[i+2],128===(192&u)&&128===(192&f)&&(l=(15&o)<<12|(63&u)<<6|63&f,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:u=e[i+1],f=e[i+2],h=e[i+3],128===(192&u)&&128===(192&f)&&128===(192&h)&&(l=(15&o)<<18|(63&u)<<12|(63&f)<<6|63&h,l>65535&&l<1114112&&(a=l))}}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=s}return j(n)}function j(e){var t=e.length;if(t<=K)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,r,n,i,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function M(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function C(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function D(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(e,t,r,n,i){return i||D(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(e,t,r,n,23,4),r+4}function V(e,t,r,n,i){return i||D(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(e,t,r,n,52,8),r+8}function q(e){if(e=z(e).replace(ee,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function z(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function F(e){return e<16?"0"+e.toString(16):e.toString(16)}function Y(e,t){t=t||1/0;for(var r,n=e.length,i=null,o=[],a=0;a55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function W(e){for(var t=[],r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function G(e){return $.toByteArray(q(e))}function J(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function X(e){return e!==e}var $=e("base64-js"),Q=e("ieee754"),Z=e("isarray");r.Buffer=a,r.SlowBuffer=v,r.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:n(),r.kMaxLength=i(),a.poolSize=8192,a._augment=function(e){return e.__proto__=a.prototype,e},a.from=function(e,t,r){return s(null,e,t,r)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(e,t,r){return f(null,e,t,r)},a.allocUnsafe=function(e){return h(null,e)},a.allocUnsafeSlow=function(e){return h(null,e)},a.isBuffer=function(e){return!(null==e||!e._isBuffer)},a.compare=function(e,t){if(!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},a.prototype.compare=function(e,t,r,n,i){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var o=i-n,s=r-t,u=Math.min(o,s),f=this.slice(n,i),h=e.slice(t,r),l=0;l2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t>>=0,0===this.length)return-1;if(t>=this.length)return-1;if(t<0&&(t=Math.max(this.length+t,0)),"string"==typeof e&&(e=a.from(e,r)),a.isBuffer(e))return 0===e.length?-1:_(this,e,t,r);if("number"==typeof e)return a.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,e,t):_(this,[e],t,r);throw new TypeError("val must be string, number or Buffer")},a.prototype.includes=function(e,t,r){return this.indexOf(e,t,r)!==-1},a.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t=0|t,isFinite(r)?(r=0|r,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return m(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":return T(this,e,t,r);case"binary":return O(this,e,t,r);case"base64":return B(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var K=4096;a.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),t0&&(i*=256);)n+=this[e+--t]*i;return n},a.prototype.readUInt8=function(e,t){return t||U(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return t||U(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return t||U(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return t||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return t||U(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,r){e=0|e,t=0|t,r||U(e,t,this.length);for(var n=this[e],i=1,o=0;++o=i&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e=0|e,t=0|t,r||U(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},a.prototype.readInt8=function(e,t){return t||U(e,1,this.length),128&this[e]?(255-this[e]+1)*-1:this[e]},a.prototype.readInt16LE=function(e,t){t||U(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(e,t){t||U(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(e,t){return t||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return t||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return t||U(e,4,this.length),Q.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return t||U(e,4,this.length),Q.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return t||U(e,8,this.length),Q.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return t||U(e,8,this.length),Q.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t=0|t,r=0|r,!n){var i=Math.pow(2,8*r)-1;L(this,e,t,r,i,0)}var o=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+o]=e/a&255;return t+r},a.prototype.writeUInt8=function(e,t,r){return e=+e,t=0|t,r||L(this,e,t,1,255,0),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=0|t,r||L(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},a.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=0|t,r||L(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},a.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=0|t,r||L(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):C(this,e,t,!0),t+4},a.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=0|t,r||L(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},a.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t=0|t,!n){var i=Math.pow(2,8*r-1);L(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t=0|t,!n){var i=Math.pow(2,8*r-1);L(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t=0|t,r||L(this,e,t,1,127,-128),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e=+e,t=0|t,r||L(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},a.prototype.writeInt16BE=function(e,t,r){return e=+e,t=0|t,r||L(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},a.prototype.writeInt32LE=function(e,t,r){return e=+e,t=0|t,r||L(this,e,t,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):C(this,e,t,!0),t+4},a.prototype.writeInt32BE=function(e,t,r){return e=+e,t=0|t,r||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},a.prototype.writeFloatLE=function(e,t,r){return N(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return N(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return V(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return V(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds"); -if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var o;if("number"==typeof e)for(o=t;o0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}if(!i(t))throw TypeError("listener must be a function");var n=!1;return r.listener=t,this.on(e,r),this},n.prototype.removeListener=function(e,t){var r,n,o,s;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],o=r.length,n=-1,r===t||i(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(a(r)){for(s=o;s-- >0;)if(r[s]===t||r[s].listener&&r[s].listener===t){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],i(r))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?i(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(i(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},{}],8:[function(e,t,r){r.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,h=-7,l=r?i-1:0,c=r?-1:1,p=e[t+l];for(l+=c,o=p&(1<<-h)-1,p>>=-h,h+=s;h>0;o=256*o+e[t+l],l+=c,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=256*a+e[t+l],l+=c,h-=8);if(0===o)o=1-f;else{if(o===u)return a?NaN:(p?-1:1)*(1/0);a+=Math.pow(2,n),o-=f}return(p?-1:1)*a*Math.pow(2,o-n)},r.write=function(e,t,r,n,i,o){var a,s,u,f=8*o-i-1,h=(1<>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),t+=a+l>=1?c/u:c*Math.pow(2,1-l),t*u>=2&&(a++,u/=2),a+l>=h?(s=0,a=h):a+l>=1?(s=(t*u-1)*Math.pow(2,i),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;e[r+p]=255&s,p+=d,s/=256,i-=8);for(a=a<0;e[r+p]=255&a,p+=d,a/=256,f-=8);e[r+p-d]|=128*y}},{}],9:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],10:[function(e,t,r){t.exports=function(e){return!(null==e||!(e._isBuffer||e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)))}},{}],11:[function(e,t,r){var n={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},{}],12:[function(e,t,r){(function(e){"use strict";function r(t,r,n,i){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,r)});case 3:return e.nextTick(function(){t.call(null,r,n)});case 4:return e.nextTick(function(){t.call(null,r,n,i)});default:for(o=new Array(s-1),a=0;a1)for(var r=1;r0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var u=new Error("stream.unshift() after end event");e.emit("error",u)}else{var f;!t.decoder||i||n||(r=t.decoder.write(r),f=!t.objectMode&&0===r.length),i||(t.reading=!1),f||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&c(e))),d(e,t)}else i||(t.reading=!1);return s(t)}function s(e){return!e.ended&&(e.needReadable||e.length=N?e=N:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function f(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:null===e||isNaN(e)?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:e<=0?0:(e>t.highWaterMark&&(t.highWaterMark=u(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function h(e,t){var r=null;return x.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}function l(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,c(e)}}function c(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(L("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?S(p,e):p(e))}function p(e){L("emit readable"),e.emit("readable"),_(e)}function d(e,t){t.readingMore||(t.readingMore=!0,S(y,e,t))}function y(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=i)r=o?n.join(""):1===n.length?n[0]:x.concat(n,i),n.length=0;else if(e0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,S(T,t,e))}function T(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function O(e,t){for(var r=0,n=e.length;r0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return L("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?E(this):c(this),null;if(e=f(e,t),0===e&&t.ended)return 0===t.length&&E(this),null;var n=t.needReadable;L("need readable",n),(0===t.length||t.length-e0?m(e,t):null,null===i&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),r!==e&&t.ended&&0===t.length&&E(this),null!==i&&this.emit("data",i),i},o.prototype._read=function(e){this.emit("error",new Error("not implemented"))},o.prototype.pipe=function(e,t){function i(e){L("onunpipe"),e===c&&a()}function o(){L("onend"),e.end()}function a(){L("cleanup"),e.removeListener("close",f),e.removeListener("finish",h),e.removeListener("drain",g),e.removeListener("error",u),e.removeListener("unpipe",i),c.removeListener("end",o),c.removeListener("end",a),c.removeListener("data",s),b=!0,!p.awaitDrain||e._writableState&&!e._writableState.needDrain||g()}function s(t){L("ondata");var r=e.write(t);!1===r&&((1===p.pipesCount&&p.pipes===e||p.pipesCount>1&&B(p.pipes,e)!==-1)&&!b&&(L("false write response, pause",c._readableState.awaitDrain),c._readableState.awaitDrain++),c.pause())}function u(t){L("onerror",t),l(),e.removeListener("error",u),0===R(e,"error")&&e.emit("error",t)}function f(){e.removeListener("finish",h),l()}function h(){L("onfinish"),e.removeListener("close",f),l()}function l(){L("unpipe"),c.unpipe(e)}var c=this,p=this._readableState;switch(p.pipesCount){case 0:p.pipes=e;break;case 1:p.pipes=[p.pipes,e];break;default:p.pipes.push(e)}p.pipesCount+=1,L("pipe count=%d opts=%j",p.pipesCount,t);var d=(!t||t.end!==!1)&&e!==r.stdout&&e!==r.stderr,y=d?o:a;p.endEmitted?S(y):c.once("end",y),e.on("unpipe",i);var g=v(c);e.on("drain",g);var b=!1;return c.on("data",s),n(e,"error",u),e.once("close",f),e.once("finish",h),e.emit("pipe",c),p.flowing||(L("pipe resume"),c.resume()),e},o.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i-1?setImmediate:T;a.WritableState=o;var B=e("core-util-is");B.inherits=e("inherits");var S,k={deprecate:e("util-deprecate")};!function(){try{S=e("stream")}catch(e){}finally{S||(S=e("events").EventEmitter)}}();var A=e("buffer").Buffer,j=e("buffer-shims");B.inherits(a,S);var R;o.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(o.prototype,"buffer",{get:k.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(e){}}();var R;a.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},a.prototype.write=function(e,t,r){var i=this._writableState,o=!1;return"function"==typeof t&&(r=t,t=null),A.isBuffer(e)?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=n),i.ended?s(this,r):u(this,i,e,r)&&(i.pendingcb++,o=h(this,i,e,t,r)),o},a.prototype.cork=function(){var e=this._writableState;e.corked++},a.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||g(this,e))},a.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},a.prototype._write=function(e,t,r){r(new Error("not implemented"))},a.prototype._writev=null,a.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||m(this,n,r)}}).call(this,e("_process"))},{"./_stream_duplex":15,_process:13,buffer:5,"buffer-shims":4,"core-util-is":6,events:7,inherits:9,"process-nextick-args":12,"util-deprecate":34}],20:[function(e,t,r){t.exports=e("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":16}],21:[function(e,t,r){(function(n){var i=function(){try{return e("stream")}catch(e){}}();r=t.exports=e("./lib/_stream_readable.js"),r.Stream=i||r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"),!n.browser&&"disable"===n.env.READABLE_STREAM&&i&&(t.exports=i)}).call(this,e("_process"))},{"./lib/_stream_duplex.js":15,"./lib/_stream_passthrough.js":16,"./lib/_stream_readable.js":17,"./lib/_stream_transform.js":18,"./lib/_stream_writable.js":19,_process:13}],22:[function(e,t,r){t.exports=e("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":18}],23:[function(e,t,r){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":19}],24:[function(e,t,r){(function(e){function r(t,r){this._block=new e(t),this._finalSize=r,this._blockSize=t,this._len=0,this._s=0}r.prototype.update=function(t,r){"string"==typeof t&&(r=r||"utf8",t=new e(t,r));for(var n=this._len+=t.length,i=this._s||0,o=0,a=this._block;i=8*this._finalSize&&(this._update(this._block),this._block.fill(0)),this._block.writeInt32BE(t,this._blockSize-4);var r=this._update(this._block)||this._hash();return e?r.toString(e):r},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=r}).call(this,e("buffer").Buffer)},{buffer:5}],25:[function(e,t,r){var r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};r.sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":26,"./sha1":27,"./sha224":28,"./sha256":29,"./sha384":30,"./sha512":31}],26:[function(e,t,r){(function(r){function n(){this.init(),this._w=h,u.call(this,64,56)}function i(e){return e<<5|e>>>27}function o(e){return e<<30|e>>>2}function a(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}var s=e("inherits"),u=e("./hash"),f=[1518500249,1859775393,-1894007588,-899497514],h=new Array(80);s(n,u),n.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},n.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,s=0|this._c,u=0|this._d,h=0|this._e,l=0;l<16;++l)t[l]=e.readInt32BE(4*l);for(;l<80;++l)t[l]=t[l-3]^t[l-8]^t[l-14]^t[l-16];for(var c=0;c<80;++c){var p=~~(c/20),d=i(r)+a(p,n,s,u)+h+t[c]+f[p]|0;h=u,u=s,s=o(n),n=r,r=d}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=u+this._d|0,this._e=h+this._e|0},n.prototype._hash=function(){var e=new r(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=n}).call(this,e("buffer").Buffer)},{"./hash":24,buffer:5,inherits:9}],27:[function(e,t,r){(function(r){function n(){this.init(),this._w=l,f.call(this,64,56)}function i(e){return e<<1|e>>>31}function o(e){return e<<5|e>>>27}function a(e){return e<<30|e>>>2}function s(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}var u=e("inherits"),f=e("./hash"),h=[1518500249,1859775393,-1894007588,-899497514],l=new Array(80);u(n,f),n.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},n.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,u=0|this._c,f=0|this._d,l=0|this._e,c=0;c<16;++c)t[c]=e.readInt32BE(4*c);for(;c<80;++c)t[c]=i(t[c-3]^t[c-8]^t[c-14]^t[c-16]); -for(var p=0;p<80;++p){var d=~~(p/20),y=o(r)+s(d,n,u,f)+l+t[p]+h[d]|0;l=f,f=u,u=a(n),n=r,r=y}this._a=r+this._a|0,this._b=n+this._b|0,this._c=u+this._c|0,this._d=f+this._d|0,this._e=l+this._e|0},n.prototype._hash=function(){var e=new r(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=n}).call(this,e("buffer").Buffer)},{"./hash":24,buffer:5,inherits:9}],28:[function(e,t,r){(function(r){function n(){this.init(),this._w=s,a.call(this,64,56)}var i=e("inherits"),o=e("./sha256"),a=e("./hash"),s=new Array(64);i(n,o),n.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},n.prototype._hash=function(){var e=new r(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},t.exports=n}).call(this,e("buffer").Buffer)},{"./hash":24,"./sha256":29,buffer:5,inherits:9}],29:[function(e,t,r){(function(r){function n(){this.init(),this._w=p,l.call(this,64,56)}function i(e,t,r){return r^e&(t^r)}function o(e,t,r){return e&t|r&(e|t)}function a(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function s(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function u(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function f(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}var h=e("inherits"),l=e("./hash"),c=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],p=new Array(64);h(n,l),n.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},n.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,h=0|this._c,l=0|this._d,p=0|this._e,d=0|this._f,y=0|this._g,v=0|this._h,g=0;g<16;++g)t[g]=e.readInt32BE(4*g);for(;g<64;++g)t[g]=f(t[g-2])+t[g-7]+u(t[g-15])+t[g-16]|0;for(var b=0;b<64;++b){var w=v+s(p)+i(p,d,y)+c[b]+t[b]|0,_=a(r)+o(r,n,h)|0;v=y,y=d,d=p,p=l+w|0,l=h,h=n,n=r,r=w+_|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=h+this._c|0,this._d=l+this._d|0,this._e=p+this._e|0,this._f=d+this._f|0,this._g=y+this._g|0,this._h=v+this._h|0},n.prototype._hash=function(){var e=new r(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},t.exports=n}).call(this,e("buffer").Buffer)},{"./hash":24,buffer:5,inherits:9}],30:[function(e,t,r){(function(r){function n(){this.init(),this._w=s,a.call(this,128,112)}var i=e("inherits"),o=e("./sha512"),a=e("./hash"),s=new Array(160);i(n,o),n.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},n.prototype._hash=function(){function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}var t=new r(48);return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=n}).call(this,e("buffer").Buffer)},{"./hash":24,"./sha512":31,buffer:5,inherits:9}],31:[function(e,t,r){(function(r){function n(){this.init(),this._w=v,d.call(this,128,112)}function i(e,t,r){return r^e&(t^r)}function o(e,t,r){return e&t|r&(e|t)}function a(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function s(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function u(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function f(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function h(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function l(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function c(e,t){return e>>>0>>0?1:0}var p=e("inherits"),d=e("./hash"),y=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],v=new Array(160);p(n,d),n.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},n.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,p=0|this._ch,d=0|this._dh,v=0|this._eh,g=0|this._fh,b=0|this._gh,w=0|this._hh,_=0|this._al,m=0|this._bl,E=0|this._cl,T=0|this._dl,O=0|this._el,B=0|this._fl,S=0|this._gl,k=0|this._hl,A=0;A<32;A+=2)t[A]=e.readInt32BE(4*A),t[A+1]=e.readInt32BE(4*A+4);for(;A<160;A+=2){var j=t[A-30],R=t[A-30+1],x=u(j,R),I=f(R,j);j=t[A-4],R=t[A-4+1];var P=h(j,R),U=l(R,j),L=t[A-14],M=t[A-14+1],C=t[A-32],D=t[A-32+1],N=I+M|0,V=x+L+c(N,I)|0;N=N+U|0,V=V+P+c(N,U)|0,N=N+D|0,V=V+C+c(N,D)|0,t[A]=V,t[A+1]=N}for(var q=0;q<160;q+=2){V=t[q],N=t[q+1];var z=o(r,n,p),F=o(_,m,E),Y=a(r,_),W=a(_,r),H=s(v,O),G=s(O,v),J=y[q],X=y[q+1],$=i(v,g,b),Q=i(O,B,S),Z=k+G|0,K=w+H+c(Z,k)|0;Z=Z+Q|0,K=K+$+c(Z,Q)|0,Z=Z+X|0,K=K+J+c(Z,X)|0,Z=Z+N|0,K=K+V+c(Z,N)|0;var ee=W+F|0,te=Y+z+c(ee,W)|0;w=b,k=S,b=g,S=B,g=v,B=O,O=T+Z|0,v=d+K+c(O,T)|0,d=p,T=E,p=n,E=m,n=r,m=_,_=Z+ee|0,r=K+te+c(_,Z)|0}this._al=this._al+_|0,this._bl=this._bl+m|0,this._cl=this._cl+E|0,this._dl=this._dl+T|0,this._el=this._el+O|0,this._fl=this._fl+B|0,this._gl=this._gl+S|0,this._hl=this._hl+k|0,this._ah=this._ah+r+c(this._al,_)|0,this._bh=this._bh+n+c(this._bl,m)|0,this._ch=this._ch+p+c(this._cl,E)|0,this._dh=this._dh+d+c(this._dl,T)|0,this._eh=this._eh+v+c(this._el,O)|0,this._fh=this._fh+g+c(this._fl,B)|0,this._gh=this._gh+b+c(this._gl,S)|0,this._hh=this._hh+w+c(this._hl,k)|0},n.prototype._hash=function(){function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}var t=new r(64);return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=n}).call(this,e("buffer").Buffer)},{"./hash":24,buffer:5,inherits:9}],32:[function(e,t,r){function n(){i.call(this)}t.exports=n;var i=e("events").EventEmitter,o=e("inherits");o(n,i),n.Readable=e("readable-stream/readable.js"),n.Writable=e("readable-stream/writable.js"),n.Duplex=e("readable-stream/duplex.js"),n.Transform=e("readable-stream/transform.js"),n.PassThrough=e("readable-stream/passthrough.js"),n.Stream=n,n.prototype.pipe=function(e,t){function r(t){e.writable&&!1===e.write(t)&&f.pause&&f.pause()}function n(){f.readable&&f.resume&&f.resume()}function o(){h||(h=!0,e.end())}function a(){h||(h=!0,"function"==typeof e.destroy&&e.destroy())}function s(e){if(u(),0===i.listenerCount(this,"error"))throw e}function u(){f.removeListener("data",r),e.removeListener("drain",n),f.removeListener("end",o),f.removeListener("close",a),f.removeListener("error",s),e.removeListener("error",s),f.removeListener("end",u),f.removeListener("close",u),e.removeListener("close",u)}var f=this;f.on("data",r),e.on("drain",n),e._isStdio||t&&t.end===!1||(f.on("end",o),f.on("close",a));var h=!1;return f.on("error",s),e.on("error",s),f.on("end",u),f.on("close",u),e.on("close",u),e.emit("pipe",f),e}},{events:7,inherits:9,"readable-stream/duplex.js":14,"readable-stream/passthrough.js":20,"readable-stream/readable.js":21,"readable-stream/transform.js":22,"readable-stream/writable.js":23}],33:[function(e,t,r){function n(e){if(e&&!u(e))throw new Error("Unknown encoding: "+e)}function i(e){return e.toString(this.encoding)}function o(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function a(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}var s=e("buffer").Buffer,u=s.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},f=r.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),n(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=o;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=a;break;default:return void(this.write=i)}this.charBuffer=new s(6),this.charReceived=0,this.charLength=0};f.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&n<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var i=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,i),i-=this.charReceived),t+=e.toString(this.encoding,0,i);var i=t.length-1,n=t.charCodeAt(i);if(n>=55296&&n<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,i)}return t},f.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},f.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;t+=n.slice(0,r).toString(i)}return t}},{buffer:5}],34:[function(e,t,r){(function(e){function r(e,t){function r(){if(!i){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),i=!0}return e.apply(this,arguments)}if(n("noDeprecation"))return e;var i=!1;return r}function n(t){try{if(!e.localStorage)return!1}catch(e){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1]); \ No newline at end of file +require=function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var f=new Error("Cannot find module '"+a+"'");throw f.code="MODULE_NOT_FOUND",f}var h=r[a]={exports:{}};t[a][0].call(h.exports,function(e){var r=t[a][1][e];return i(r?r:e)},h,h.exports,e,t,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a=200&&t.status<300||304===t.status;r?e[a]=t.response:e.text=t.statusText,n(t.status,t.statusText,e,t.getAllResponseHeaders())}),t.open(o,i,u),t.responseType=a;for(var f in r)r.hasOwnProperty(f)&&t.setRequestHeader(f,r[f]);t.send(s)},abort:function(){t&&t.abort()}}}})}(jQuery)},{}],"/config.js":[function(e,t,r){(function(r,n){"use strict";"/"===n&&(n="");var i=e(n+"/lib/assert.js"),o=7;i.between(0,o,65536);var a=2,s=r.allocUnsafe(a);s.writeUInt16BE(o,0);var u=s.toString("base64");t.exports={VERSION_STRING:u}}).call(this,e("buffer").Buffer,"/")},{buffer:5}],"/io.js":[function(e,t,r){(function(r,n){"use strict";function i(){this.end()}"/"===n&&(n="");var o=e(n+"/lib/assert.js"),a=e(n+"/lib/buffer-stream.js"),s=e(n+"/lib/growable-buffer.js"),u=e(n+"/read.js"),f=e("stream"),h=e(n+"/structure-types.js"),l=t.exports={writeType:function(e,t){var r=e.type,n=e.outStream;return o.instanceOf(r,h.Type),o.instanceOf(n,[f.Writable,f.Duplex]),void 0===t&&(t=function(){}),o.instanceOf(t,Function),new a(r.toBuffer()).pipe(n).on("error",function(e){this.end(),t(e)}).on("finish",function(){return t(null)})},writeValue:function(e,t){var r=e.type,n=e.value,i=e.outStream;o.instanceOf(r,h.Type),o.instanceOf(i,[f.Writable,f.Duplex]),void 0===t&&(t=function(){}),o.instanceOf(t,Function);var u=new s;return r.writeValue(u,n),new a(u).pipe(i).on("error",function(e){this.end(),t(e)}).on("finish",function(){return t(null)})},writeTypeAndValue:function(e,t){var r=e.type,n=e.value,s=e.outStream;o.instanceOf(r,h.Type),o.instanceOf(s,[f.Writable,f.Duplex]),void 0===t&&(t=function(){}),o.instanceOf(t,Function);var u=new a(r.toBuffer());return u.pipe(s,{end:!1}).on("error",i),u.on("bs-written",function(){l.writeValue({type:r,value:n,outStream:s},t)}),s},readType:function(e,t){o.instanceOf(e,f.Readable),o.instanceOf(t,Function);var n=[];e.on("data",function(e){return n.push(e)}),e.on("error",i).on("error",function(e){return t(e,null)}),e.on("end",function(){var e=r.concat(n),i=void 0;try{i=u.type(e,!1)}catch(e){t(e,null)}i&&t(null,i)})},readValue:function(e,t){var n=e.type,a=e.inStream;o.instanceOf(a,f.Readable),o.instanceOf(t,Function);var s=[];a.on("data",function(e){return s.push(e)}),a.on("error",i).on("error",function(e){return t(e,null)}),a.on("end",function(){var e=r.concat(s),i=void 0;try{i=u.value({buffer:e,type:n})}catch(e){t(e,null)}i&&t(null,i)})},readTypeAndValue:function(e,t){o.instanceOf(e,f.Readable),o.instanceOf(t,Function);var n=[];e.on("data",function(e){return n.push(e)}),e.on("error",i).on("error",function(e){return t(e,null,null)}),e.on("end",function(){var e=r.concat(n),i=void 0;try{i=u._consumeType(e,0)}catch(e){t(e,null,null)}if(i){var o=void 0;try{o=u.value({buffer:e,offset:i.length,type:i.value})}catch(e){t(e,null,null)}o&&t(null,i.value,o)}})},httpRespond:function(e,t){var r=this,n=e.req,i=e.res,a=e.type,s=e.value;o.instanceOf(a,h.Type),void 0===t&&(t=function(){}),o.instanceOf(t,Function),i.setHeader("Content-Type","application/octet-stream"),i.setHeader("Content-Encoding","gzip"),i.setHeader("sig",a.getSignature());var u=zlib.createGzip();n.headers.sig&&n.headers.sig===a.getSignature()?l.writeValue({type:a,value:s,outStream:u},function(e){e&&t(e)}):l.writeTypeAndValue({type:a,value:s,outStream:u},function(e){e&&t(e)}),u.pipe(i).on("error",function(e){r.close(),t(e)}).on("finish",function(){return t(null)})}}}).call(this,e("buffer").Buffer,"/")},{buffer:5,stream:32}],"/lib/assert.js":[function(e,t,r){"use strict";var n=e("/lib/util-inspect.js"),i={instanceOf:function(e,t){t instanceof Array||(t=[t]);var r=!1,i=!0,o=!1,a=void 0;try{for(var s,u=t[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var f=s.value;if(e instanceof f||void 0!==e&&null!==e&&e.constructor===f){r=!0;break}}}catch(e){o=!0,a=e}finally{try{!i&&u.return&&u.return()}finally{if(o)throw a}}if(!r)throw new TypeError(n.inspect(e)+" is not an instance of "+t.map(function(e){return e.name}).join(" or "))},integer:function(e){if(i.instanceOf(e,Number),!Number.isSafeInteger(e))throw new RangeError(n.inspect(e)+" is not an integer")},between:function(e,t,r){var i=arguments.length<=3||void 0===arguments[3]?"":arguments[3];if(t=r)throw new RangeError(i+n.inspect(t)+" is not in ["+n.inspect(e)+","+n.inspect(r)+")")},byteUnsignedInteger:function(e){i.integer(e),i.between(0,e,256)},fourByteUnsignedInteger:function(e){i.integer(e),i.between(0,e,4294967296)},fail:function(e){throw new Error(e)},assert:function(e,t){e||i.fail(t)},throws:function(e){var t=!0;try{e(),t=!1}catch(e){}i.assert(t,"Should throw an error")},equal:function(e,t){var r=new RangeError("Expected "+n.inspect(t)+" but got "+n.inspect(e));if(t&&t.constructor===Object){for(var o in t)if(t.hasOwnProperty(o))try{i.equal(e[o],t[o])}catch(e){throw r}}else if(t&&t.constructor===Array){if(!e||e.constructor!==Array)throw r;try{i.equal(e.length,t.length)}catch(e){throw r}for(var a=0;a>>3},modEight:function(e){return 7&e}}},{}],"/lib/buffer-stream.js":[function(e,t,r){(function(r,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=function(){function e(e,t){for(var r=0;rthis.buffer.length){var t=r.allocUnsafe(e<<1);this.buffer.copy(t,0,0,this.size),this.buffer=t}return this}},{key:"set",value:function(e,t){return a.integer(e),a.integer(t),a.between(0,e,this.size,"Index out of bounds: "+String(e)),a.between(0,t,256,"Not a byte: "+String(t)),this.buffer.writeUInt8(t,e),this}},{key:"setAll",value:function(e,t){a.instanceOf(t,r),a.integer(e),a.between(0,e,this.size-t.length+1,"Index out of bounds: "+String(e)),t.copy(this.buffer,e)}},{key:"get",value:function(e){return a.integer(e),a.between(0,e,this.size,"Index out of bounds: "+String(e)),this.buffer.readUInt8(e)}},{key:"add",value:function(e){var t=this.size,r=t+1;return this.grow(r),this.size=r,this.set(t,e),this}},{key:"addAll",value:function(e){a.instanceOf(e,r);var t=this.size,n=this.size+e.length;return this.grow(n),this.size=n,e.copy(this.buffer,t),this}},{key:"toBuffer",value:function(){return this.buffer.slice(0,this.size)}},{key:"length",get:function(){return this.size}},{key:"rawBuffer",get:function(){return this.buffer}}]),e}();t.exports=u}).call(this,e("buffer").Buffer,"/lib")},{buffer:5}],"/lib/strint.js":[function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},i={};!function(){function e(e,t){return O(e)===O(t)}function t(e,t){for(;t>0;)e+="0",t--;return e}function r(e){f(e,"string")}function o(e){r(e),u(e,O,"isPositive")}function a(e){f(e,"number")}function s(e){if(f(e,"number"),e<0)throw new Error("Expected a positive number: "+e)}function u(e,t,r){if(!t.call(null,e))throw new Error("Condition "+r+" failed for value "+e)}function f(e,t){if(("undefined"==typeof e?"undefined":n(e))!==t)throw new Error("Not a "+t+": "+e)}var h=i.subPositive=function(e,t){if(o(e),o(t),!m(e,t))throw new Error("x must be greater or equal to y");for(var r=Math.max(e.length,t.length),n="",i=0,a=0,s=0;s=10;)h-=10,i++;0===h?a++:(n=String(h)+x(n,a),a=0)}return i>0&&(n=String(i)+x(n,a)),n},c=i.add=function(e,t){if(r(e),r(t),O(e)&&O(t))return l(e,t);if(T(e)&&T(t))return B(l(S(e),S(t)));if(_(S(e),S(t))){var n=e;e=t,t=n}var i=h(S(e),S(t));return O(e)?i:B(i)},p=i.sub=function(e,t){return r(e),r(t),c(e,B(t))},d=i.timesDigit=function(e,t){o(e),a(t);for(var r="",n=P(e),i=0,s=0,u=0;u=10;)f-=10,i++;0===f?s++:(r=String(f)+x(r,s),s=0)}return i>0&&(r=String(i)+x(r,s)),0===r.length?"0":r},y=i.mulPositive=function(e,r){o(e),o(r);for(var n="0",i=P(r),a=0;a=P(e)?"0":e.charAt(e.length-t-1)},P=function(e){return T(e)?e.length-1:e.length}}(),i.LONG_UPPER_SHIFT="4294967296",t.exports=i},{}],"/lib/util-inspect.js":[function(e,t,r){"use strict";r.inspect=function(e){if(void 0===e)return"undefined";if(null===e||e.constructor===Object||e.constructor===Array||e.constructor===String||e.constructor===Number||e.constructor===Boolean||e.constructor===Date)return JSON.stringify(e);if(e.constructor===Set){for(var t="Set {",n=e.values(),i=n.next();!i.done;)t+=r.inspect(i.value),i=n.next(),i.done||(t+=", ");return t+"}"}if(e.constructor===Map){for(var o="Map {",a=e.entries(),s=a.next();!s.done;)o+=r.inspect(s.value[0]),o+=" => ",o+=r.inspect(s.value[1]),s=a.next(),s.done||(o+=", ");return o+"}"}return e.constructor.name?e.constructor.name+" "+JSON.stringify(e):JSON.stringify(e)}},{}],"/read.js":[function(e,t,r){(function(r,n){"use strict";function i(e,t){try{return{value:e.readUInt32BE(t),length:4}}catch(e){throw new Error(y)}}function o(e,t){h.assert(t>=0,"Offset is negative: "+String(t)),h.assert(e.length>t,y);var r=void 0,n=1;switch(e.readUInt8(t)){case p.ByteType._value:r=new p.ByteType;break;case p.ShortType._value:r=new p.ShortType;break;case p.IntType._value:r=new p.IntType;break;case p.LongType._value:r=new p.LongType;break;case p.UnsignedByteType._value:r=new p.UnsignedByteType;break;case p.UnsignedShortType._value:r=new p.UnsignedShortType;break;case p.UnsignedIntType._value:r=new p.UnsignedIntType;break;case p.UnsignedLongType._value:r=new p.UnsignedLongType;break;case p.DateType._value:r=new p.DateType;break;case p.FloatType._value:r=new p.FloatType;break;case p.DoubleType._value:r=new p.DoubleType;break;case p.BooleanType._value:r=new p.BooleanType;break;case p.BooleanTupleType._value:var a=i(e,t+n);r=new p.BooleanTupleType(a.value),n+=a.length;break;case p.BooleanArrayType._value:r=new p.BooleanArrayType;break;case p.CharType._value:r=new p.CharType;break;case p.StringType._value:r=new p.StringType;break;case p.OctetsType._value:r=new p.OctetsType;break;case p.TupleType._value:var s=o(e,t+n);n+=s.length;var f=i(e,t+n);n+=f.length,r=new p.TupleType({type:s.value,length:f.value});break;case p.StructType._value:h.assert(e.length>t+n,y);var l=e.readUInt8(t+n);n++;for(var c={},d=0;dt+n,y);var v=e.readUInt8(t+n);n++,h.assert(e.length>=t+n+v);var g=e.toString("utf8",t+n,t+n+v);n+=v;var b=o(e,t+n);c[g]=b.value,n+=b.length}r=new p.StructType(c);break;case p.ArrayType._value:var w=o(e,t+n);n+=w.length,r=new p.ArrayType(w.value);break;case p.SetType._value:var _=o(e,t+n);n+=_.length,r=new p.SetType(_.value);break;case p.MapType._value:var m=o(e,t+n);n+=m.length;var E=o(e,t+n);n+=E.length,r=new p.MapType(m.value,E.value);break;case p.EnumType._value:var T=o(e,t+n);n+=T.length,h.assert(e.length>t+n,y);var O=e.readUInt8(t+n);n++;for(var S=[],B=0;Bt+n,y);var A=e.readUInt8(t+n);n++;for(var j=new Array(A),R=0;R=t+U,y);var L=o(e,t+n-e.readUInt16BE(t+n));r=L.value,n=U;break;default:h.fail("No such type: 0x"+e[t].toString(16))}return{value:r,length:n}}function a(e){var t=arguments.length<=1||void 0===arguments[1]||arguments[1];h.instanceOf(e,r);var n=o(e,0),i=n.value,a=n.length;return t&&h.assert(a===e.length,"Did not consume all of the buffer"),i}function s(e){var t=e.buffer,r=e.offset,n=e.count,i=new Array(n),o=l.modEight(i.length),a=l.dividedByEight(i.length),s=void 0;s=o?a+1:a,h.assert(t.length>=r+s,y);for(var u=0;u=n+f,y),a=t.readInt8(n);break;case p.ShortType:f=2,h.assert(t.length>=n+f,y),a=t.readInt16BE(n);break;case p.IntType:f=4,a=t.readInt32BE(n);break;case p.LongType:f=8,h.assert(t.length>=n+f,y);var l=t.readInt32BE(n),v=t.readUInt32BE(n+4);a=c.add(c.mul(String(l),c.LONG_UPPER_SHIFT),String(v));break;case p.UnsignedByteType:f=1,h.assert(t.length>=n+f,y),a=t.readUInt8(n);break;case p.UnsignedShortType:f=2,h.assert(t.length>=n+f,y),a=t.readUInt16BE(n);break;case p.UnsignedIntType:f=4,h.assert(t.length>=n+f,y),a=t.readUInt32BE(n);break;case p.UnsignedLongType:case p.DateType:f=8,h.assert(t.length>=n+f,y);var g=t.readUInt32BE(n),b=t.readUInt32BE(n+4);a=c.add(c.mul(String(g),c.LONG_UPPER_SHIFT),String(b)),o.constructor===p.DateType&&(a=new Date(Number(a)));break;case p.FloatType:f=4,h.assert(t.length>=n+f,y),a=t.readFloatBE(n);break;case p.DoubleType:f=8,h.assert(t.length>=n+f,y),a=t.readDoubleBE(n);break;case p.BooleanType:f=1,h.assert(t.length>=n+f,y);var w=t.readUInt8(n);h.assert(0===w||255===w,"0x"+w.toString(16)+" is an invalid Boolean value"),a=!!w;break;case p.BooleanArrayType:var _=i(t,n);f=_.length;var m=s({buffer:t,offset:n+f,count:_.value});f+=m.length,a=m.value;break;case p.BooleanTupleType:var E=s({buffer:t,offset:n,count:o.length});a=E.value,f=E.length;break;case p.CharType:h.assert(t.length>n,y),a=t.slice(n,n+4).toString()[0],f=r.byteLength(a);break;case p.StringType:for(f=0;h.assert(t.length>n+f,y),t.readUInt8(n+f);)f++;a=t.slice(n,n+f).toString(),f++;break;case p.OctetsType:var T=i(t,n);f=T.length;var O=f+T.value;h.assert(t.length>=n+O,y),a=t.slice(n+f,n+O),f=O;break;case p.TupleType:f=0,a=new Array(o.length);for(var S=0;S=n+f,y);var H=t.readUInt8(n);a=o.values[H],void 0===a&&h.fail("Index "+String(H)+" is invalid");break;case p.ChoiceType:f=1,h.assert(t.length>=n+f,y);var G=t.readUInt8(n),J=u({buffer:t,offset:n+f,type:o.types[G]});f+=J.length,a=J.value;break;case p.OptionalType:f=1,h.assert(t.length>=n+f,y);var X=t.readUInt8(n);if(h.assert(0===X||255===X,"0x"+X.toString(16)+" is an invalid Optional byte"),X){var $=u({buffer:t,offset:n+f,type:o.type});f+=$.length,a=$.value}else a=null;break;case p.PointerType:var Q=i(t,n);f=Q.length,a=u({buffer:t,offset:Q.value,type:o.type}).value;break;default:h.fail("Not a structure type: "+d.inspect(o))}return{value:a,length:f}}function f(e){var t=e.buffer,n=e.type,i=e.offset;h.instanceOf(t,r),h.instanceOf(n,p.Type),void 0===i&&(i=0),h.instanceOf(i,Number);var o=u({buffer:t,offset:i,type:n}),a=o.value;return a}"/"===n&&(n="");var h=e(n+"/lib/assert.js"),l=e(n+"/lib/bit-math.js"),c=e(n+"/lib/strint.js"),p=e(n+"/structure-types.js"),d=e("/lib/util-inspect.js"),y="Buffer is not long enough";t.exports={_consumeType:o,type:a,value:f}}).call(this,e("buffer").Buffer,"/")},{"/lib/util-inspect.js":"/lib/util-inspect.js",buffer:5}],"/structure-types.js":[function(e,t,r){(function(r,n){"use strict";function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){var t=r.allocUnsafe(4);return t.writeUInt32BE(e,0),t}function u(e,t){if(t&&e.pointers){var n=!0,i=!1,o=void 0;try{for(var a,s=e.pointers[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=p(a.value,2),f=u[0],h=u[1],l=e.length;e.addAll(r.from(f,T));var c=r.allocUnsafe(4);c.writeUInt32BE(l);var d=!0,y=!1,v=void 0;try{for(var g,b=h[Symbol.iterator]();!(d=(g=b.next()).done);d=!0){var w=g.value;e.setAll(w,c)}}catch(e){y=!0,v=e}finally{try{!d&&b.return&&b.return()}finally{if(y)throw v}}}}catch(e){i=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}}}function f(e,t){if(d.instanceOf(e,g),d.instanceOf(t,String),b.gt(t,"18446744073709551615")||b.lt(t,"0"))throw new Error("Value out of range");var n=b.div(t,b.LONG_UPPER_SHIFT),i=b.sub(t,b.mul(n,b.LONG_UPPER_SHIFT)),o=r.allocUnsafe(8);o.writeUInt32BE(Number(n),0),o.writeUInt32BE(Number(i),4),e.addAll(o)}function h(e,t){d.instanceOf(t,Array);var n=E(t.length),i=m(t.length),o=void 0;o=n?i+1:i;var a=r.allocUnsafe(o);n&&(a[o-1]=0);for(var s=0;st[J])return 1;throw new Error("Should not have any duplicate fields")}),n}return o(t,e),c(t,null,[{key:"_value",get:function(){return 81}}]),c(t,[{key:"addToBuffer",value:function(e){if(l(Object.getPrototypeOf(t.prototype),"addToBuffer",this).call(this,e)){e.add(this.fields.length);var n=!0,i=!1,o=void 0;try{for(var a,s=this.fields[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value,f=r.from(u[J]);e.add(f.length),e.addAll(f),u[X].addToBuffer(e)}}catch(e){i=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}}}},{key:"writeValue",value:function(e,t){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];d.instanceOf(e,g),d.instanceOf(t,Object);var n=!0,i=!1,o=void 0;try{for(var a,s=this.fields[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var f=a.value;f[X].writeValue(e,t[f[J]],!1)}}catch(e){i=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}u(e,r)}}]),t}(B),Q=function(e){function t(e){a(this,t);var r=i(this,Object.getPrototypeOf(t).call(this));return d.instanceOf(e,S),r.type=e,r}return o(t,e),c(t,null,[{key:"_value",get:function(){return 82}}]),c(t,[{key:"addToBuffer",value:function(e){l(Object.getPrototypeOf(t.prototype),"addToBuffer",this).call(this,e)&&this.type.addToBuffer(e)}},{key:"_writeValue",value:function(e,t,r){d.instanceOf(e,g),d.fourByteUnsignedInteger(t.length),e.addAll(s(t.length));var n=!0,i=!1,o=void 0;try{for(var a,f=t[Symbol.iterator]();!(n=(a=f.next()).done);n=!0){var h=a.value;this.type.writeValue(e,h,!1)}}catch(e){i=!0,o=e}finally{try{!n&&f.return&&f.return()}finally{if(i)throw o}}u(e,r)}},{key:"writeValue",value:function(e,t){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];d.instanceOf(t,Array),this._writeValue(e,t,r)}}]),t}(B),Z=function(e){function t(e){return a(this,t),i(this,Object.getPrototypeOf(t).call(this,e))}return o(t,e),c(t,null,[{key:"_value",get:function(){return 83}}]),c(t,[{key:"writeValue",value:function(e,t){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];d.instanceOf(t,Set),t.length=t.size,this._writeValue(e,t,r)}}]),t}(Q),K=function(e){function t(e,r){a(this,t);var n=i(this,Object.getPrototypeOf(t).call(this));return d.instanceOf(e,S),d.instanceOf(r,S),n.keyType=e,n.valueType=r,n}return o(t,e),c(t,null,[{key:"_value",get:function(){return 84}}]),c(t,[{key:"addToBuffer",value:function(e){l(Object.getPrototypeOf(t.prototype),"addToBuffer",this).call(this,e)&&(this.keyType.addToBuffer(e),this.valueType.addToBuffer(e))}},{key:"writeValue",value:function(e,t){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];d.instanceOf(e,g),d.instanceOf(t,Map),d.fourByteUnsignedInteger(t.size),e.addAll(s(t.size));var n=!0,i=!1,o=void 0;try{for(var a,f=t[Symbol.iterator]();!(n=(a=f.next()).done);n=!0){var h=p(a.value,2),l=h[0],c=h[1];this.keyType.writeValue(e,l,!1),this.valueType.writeValue(e,c,!1)}}catch(e){i=!0,o=e}finally{try{!n&&f.return&&f.return()}finally{if(i)throw o}}u(e,r)}}]),t}(B),ee=function(e){function t(e){var r=e.type,n=e.values;a(this,t);var o=i(this,Object.getPrototypeOf(t).call(this));d.instanceOf(r,B),d.instanceOf(n,Array);try{d.byteUnsignedInteger(n.length)}catch(e){throw new Error(String(n.length)+" values is too many")}for(var s=new Map,u=0;u0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[s-2]?2:"="===e[s-1]?1:0,a=new h(3*s/4-o),n=o>0?s-4:s;var u=0;for(t=0,r=0;t>16&255,a[u++]=i>>8&255,a[u++]=255&i;return 2===o?(i=f[e.charCodeAt(t)]<<2|f[e.charCodeAt(t+1)]>>4,a[u++]=255&i):1===o&&(i=f[e.charCodeAt(t)]<<10|f[e.charCodeAt(t+1)]<<4|f[e.charCodeAt(t+2)]>>2,a[u++]=i>>8&255,a[u++]=255&i),a}function o(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}function a(e,t,r){for(var n,i=[],a=t;ah?h:f+s));return 1===n?(t=e[r-1],i+=u[t>>2],i+=u[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=u[t>>10],i+=u[t>>4&63],i+=u[t<<2&63],i+="="),o.push(i),o.join("")}r.toByteArray=i,r.fromByteArray=s;var u=[],f=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array;n()},{}],3:[function(e,t,r){},{}],4:[function(e,t,r){(function(t){"use strict";var n=e("buffer"),i=n.Buffer,o=n.SlowBuffer,a=n.kMaxLength||2147483647;r.alloc=function(e,t,r){if("function"==typeof i.alloc)return i.alloc(e,t,r);if("number"==typeof r)throw new TypeError("encoding must not be number");if("number"!=typeof e)throw new TypeError("size must be a number");if(e>a)throw new RangeError("size is too large");var n=r,o=t;void 0===o&&(n=void 0,o=0);var s=new i(e);if("string"==typeof o)for(var u=new i(o,n),f=u.length,h=-1;++ha)throw new RangeError("size is too large");return new i(e)},r.from=function(e,r,n){if("function"==typeof i.from&&(!t.Uint8Array||Uint8Array.from!==i.from))return i.from(e,r,n);if("number"==typeof e)throw new TypeError('"value" argument must not be a number');if("string"==typeof e)return new i(e,r);if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer){var o=r;if(1===arguments.length)return new i(e);"undefined"==typeof o&&(o=0);var a=n;if("undefined"==typeof a&&(a=e.byteLength-o),o>=e.byteLength)throw new RangeError("'offset' is out of bounds");if(a>e.byteLength-o)throw new RangeError("'length' is out of bounds");return new i(e.slice(o,o+a))}if(i.isBuffer(e)){var s=new i(e.length);return e.copy(s,0,0,e.length),s}if(e){if(Array.isArray(e)||"undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return new i(e);if("Buffer"===e.type&&Array.isArray(e.data))return new i(e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")},r.allocUnsafeSlow=function(e){if("function"==typeof i.allocUnsafeSlow)return i.allocUnsafeSlow(e);if("number"!=typeof e)throw new TypeError("size must be a number");if(e>=a)throw new RangeError("size is too large");return new o(e)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{buffer:5}],5:[function(e,t,r){(function(t){"use strict";function n(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}function i(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,t){if(i()=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function v(e){return+e!=e&&(e=0),a.alloc(+e)}function g(e,t){if(a.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"binary":case"raw":case"raws":return r;case"utf8":case"utf-8":case void 0:return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(n)return Y(e).length;t=(""+t).toLowerCase(),n=!0}}function b(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return A(this,t,r);case"ascii":return R(this,t,r);case"binary":return x(this,t,r);case"base64":return k(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function w(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function _(e,t,r,n){function i(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}var o=1,a=e.length,s=t.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,a/=2,s/=2,r/=2}for(var u=-1,f=r;fi&&(n=i)):n=i;var o=t.length;if(o%2!==0)throw new Error("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a239?4:o>223?3:o>191?2:1;if(i+s<=r){var u,f,h,l;switch(s){case 1:o<128&&(a=o);break;case 2:u=e[i+1],128===(192&u)&&(l=(31&o)<<6|63&u,l>127&&(a=l));break;case 3:u=e[i+1],f=e[i+2],128===(192&u)&&128===(192&f)&&(l=(15&o)<<12|(63&u)<<6|63&f,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:u=e[i+1],f=e[i+2],h=e[i+3],128===(192&u)&&128===(192&f)&&128===(192&h)&&(l=(15&o)<<18|(63&u)<<12|(63&f)<<6|63&h,l>65535&&l<1114112&&(a=l))}}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=s}return j(n)}function j(e){var t=e.length;if(t<=K)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,r,n,i,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function M(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function C(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function D(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(e,t,r,n,i){return i||D(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(e,t,r,n,23,4),r+4}function V(e,t,r,n,i){return i||D(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(e,t,r,n,52,8),r+8}function q(e){if(e=z(e).replace(ee,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function z(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function F(e){return e<16?"0"+e.toString(16):e.toString(16)}function Y(e,t){t=t||1/0;for(var r,n=e.length,i=null,o=[],a=0;a55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function W(e){for(var t=[],r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function G(e){return $.toByteArray(q(e))}function J(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function X(e){return e!==e}var $=e("base64-js"),Q=e("ieee754"),Z=e("isarray");r.Buffer=a,r.SlowBuffer=v,r.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:n(),r.kMaxLength=i(),a.poolSize=8192,a._augment=function(e){return e.__proto__=a.prototype,e},a.from=function(e,t,r){return s(null,e,t,r)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(e,t,r){return f(null,e,t,r)},a.allocUnsafe=function(e){return h(null,e)},a.allocUnsafeSlow=function(e){return h(null,e)},a.isBuffer=function(e){return!(null==e||!e._isBuffer)},a.compare=function(e,t){if(!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},a.prototype.compare=function(e,t,r,n,i){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var o=i-n,s=r-t,u=Math.min(o,s),f=this.slice(n,i),h=e.slice(t,r),l=0;l2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t>>=0,0===this.length)return-1;if(t>=this.length)return-1;if(t<0&&(t=Math.max(this.length+t,0)),"string"==typeof e&&(e=a.from(e,r)),a.isBuffer(e))return 0===e.length?-1:_(this,e,t,r);if("number"==typeof e)return a.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,e,t):_(this,[e],t,r);throw new TypeError("val must be string, number or Buffer")},a.prototype.includes=function(e,t,r){return this.indexOf(e,t,r)!==-1},a.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t=0|t,isFinite(r)?(r=0|r,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return m(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":return T(this,e,t,r);case"binary":return O(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var K=4096;a.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),t0&&(i*=256);)n+=this[e+--t]*i;return n},a.prototype.readUInt8=function(e,t){return t||U(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return t||U(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return t||U(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return t||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return t||U(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,r){e=0|e,t=0|t,r||U(e,t,this.length);for(var n=this[e],i=1,o=0;++o=i&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e=0|e,t=0|t,r||U(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},a.prototype.readInt8=function(e,t){return t||U(e,1,this.length),128&this[e]?(255-this[e]+1)*-1:this[e]},a.prototype.readInt16LE=function(e,t){t||U(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(e,t){t||U(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(e,t){return t||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return t||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return t||U(e,4,this.length),Q.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return t||U(e,4,this.length),Q.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return t||U(e,8,this.length),Q.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return t||U(e,8,this.length),Q.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t=0|t,r=0|r,!n){var i=Math.pow(2,8*r)-1;L(this,e,t,r,i,0)}var o=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+o]=e/a&255;return t+r},a.prototype.writeUInt8=function(e,t,r){return e=+e,t=0|t,r||L(this,e,t,1,255,0),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=0|t,r||L(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},a.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=0|t,r||L(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},a.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=0|t,r||L(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):C(this,e,t,!0),t+4},a.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=0|t,r||L(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},a.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t=0|t,!n){var i=Math.pow(2,8*r-1);L(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t=0|t,!n){var i=Math.pow(2,8*r-1);L(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t=0|t,r||L(this,e,t,1,127,-128),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e=+e,t=0|t,r||L(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},a.prototype.writeInt16BE=function(e,t,r){return e=+e,t=0|t,r||L(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},a.prototype.writeInt32LE=function(e,t,r){return e=+e,t=0|t,r||L(this,e,t,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):C(this,e,t,!0),t+4},a.prototype.writeInt32BE=function(e,t,r){return e=+e,t=0|t,r||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},a.prototype.writeFloatLE=function(e,t,r){return N(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return N(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return V(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return V(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var o;if("number"==typeof e)for(o=t;o0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}if(!i(t))throw TypeError("listener must be a function");var n=!1;return r.listener=t,this.on(e,r),this},n.prototype.removeListener=function(e,t){var r,n,o,s;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],o=r.length,n=-1,r===t||i(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(a(r)){for(s=o;s-- >0;)if(r[s]===t||r[s].listener&&r[s].listener===t){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],i(r))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?i(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(i(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},{}],8:[function(e,t,r){r.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,h=-7,l=r?i-1:0,c=r?-1:1,p=e[t+l];for(l+=c,o=p&(1<<-h)-1,p>>=-h,h+=s;h>0;o=256*o+e[t+l],l+=c,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=256*a+e[t+l],l+=c,h-=8);if(0===o)o=1-f;else{if(o===u)return a?NaN:(p?-1:1)*(1/0);a+=Math.pow(2,n),o-=f}return(p?-1:1)*a*Math.pow(2,o-n)},r.write=function(e,t,r,n,i,o){var a,s,u,f=8*o-i-1,h=(1<>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),t+=a+l>=1?c/u:c*Math.pow(2,1-l),t*u>=2&&(a++,u/=2),a+l>=h?(s=0,a=h):a+l>=1?(s=(t*u-1)*Math.pow(2,i),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;e[r+p]=255&s,p+=d,s/=256,i-=8);for(a=a<0;e[r+p]=255&a,p+=d,a/=256,f-=8);e[r+p-d]|=128*y}},{}],9:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],10:[function(e,t,r){t.exports=function(e){return!(null==e||!(e._isBuffer||e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)))}},{}],11:[function(e,t,r){var n={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},{}],12:[function(e,t,r){(function(e){"use strict";function r(t,r,n,i){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,r)});case 3:return e.nextTick(function(){t.call(null,r,n)});case 4:return e.nextTick(function(){t.call(null,r,n,i)});default:for(o=new Array(s-1),a=0;a1)for(var r=1;r0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var u=new Error("stream.unshift() after end event");e.emit("error",u)}else{var f;!t.decoder||i||n||(r=t.decoder.write(r),f=!t.objectMode&&0===r.length),i||(t.reading=!1),f||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&c(e))),d(e,t)}else i||(t.reading=!1);return s(t)}function s(e){return!e.ended&&(e.needReadable||e.length=N?e=N:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function f(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:null===e||isNaN(e)?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:e<=0?0:(e>t.highWaterMark&&(t.highWaterMark=u(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function h(e,t){var r=null;return x.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}function l(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,c(e)}}function c(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(L("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?B(p,e):p(e))}function p(e){L("emit readable"),e.emit("readable"),_(e)}function d(e,t){t.readingMore||(t.readingMore=!0,B(y,e,t))}function y(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=i)r=o?n.join(""):1===n.length?n[0]:x.concat(n,i),n.length=0;else if(e0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,B(T,t,e))}function T(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function O(e,t){for(var r=0,n=e.length;r0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return L("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?E(this):c(this),null;if(e=f(e,t),0===e&&t.ended)return 0===t.length&&E(this),null;var n=t.needReadable;L("need readable",n),(0===t.length||t.length-e0?m(e,t):null,null===i&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),r!==e&&t.ended&&0===t.length&&E(this),null!==i&&this.emit("data",i),i},o.prototype._read=function(e){this.emit("error",new Error("not implemented"))},o.prototype.pipe=function(e,t){function i(e){L("onunpipe"),e===c&&a()}function o(){L("onend"),e.end()}function a(){L("cleanup"),e.removeListener("close",f),e.removeListener("finish",h),e.removeListener("drain",g),e.removeListener("error",u),e.removeListener("unpipe",i),c.removeListener("end",o),c.removeListener("end",a),c.removeListener("data",s),b=!0,!p.awaitDrain||e._writableState&&!e._writableState.needDrain||g()}function s(t){L("ondata");var r=e.write(t);!1===r&&((1===p.pipesCount&&p.pipes===e||p.pipesCount>1&&S(p.pipes,e)!==-1)&&!b&&(L("false write response, pause",c._readableState.awaitDrain),c._readableState.awaitDrain++),c.pause())}function u(t){L("onerror",t),l(),e.removeListener("error",u),0===R(e,"error")&&e.emit("error",t)}function f(){e.removeListener("finish",h),l()}function h(){L("onfinish"),e.removeListener("close",f),l()}function l(){L("unpipe"),c.unpipe(e)}var c=this,p=this._readableState;switch(p.pipesCount){case 0:p.pipes=e;break;case 1:p.pipes=[p.pipes,e];break;default:p.pipes.push(e)}p.pipesCount+=1,L("pipe count=%d opts=%j",p.pipesCount,t);var d=(!t||t.end!==!1)&&e!==r.stdout&&e!==r.stderr,y=d?o:a;p.endEmitted?B(y):c.once("end",y),e.on("unpipe",i);var g=v(c);e.on("drain",g);var b=!1;return c.on("data",s),n(e,"error",u),e.once("close",f),e.once("finish",h),e.emit("pipe",c),p.flowing||(L("pipe resume"),c.resume()),e},o.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i-1?setImmediate:T;a.WritableState=o;var S=e("core-util-is");S.inherits=e("inherits");var B,k={deprecate:e("util-deprecate")};!function(){try{B=e("stream")}catch(e){}finally{B||(B=e("events").EventEmitter)}}();var A=e("buffer").Buffer,j=e("buffer-shims");S.inherits(a,B);var R;o.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(o.prototype,"buffer",{get:k.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(e){}}();var R;a.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},a.prototype.write=function(e,t,r){var i=this._writableState,o=!1;return"function"==typeof t&&(r=t,t=null),A.isBuffer(e)?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=n),i.ended?s(this,r):u(this,i,e,r)&&(i.pendingcb++,o=h(this,i,e,t,r)),o},a.prototype.cork=function(){var e=this._writableState;e.corked++},a.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||g(this,e))},a.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},a.prototype._write=function(e,t,r){r(new Error("not implemented"))},a.prototype._writev=null,a.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||m(this,n,r)}}).call(this,e("_process"))},{"./_stream_duplex":15,_process:13,buffer:5,"buffer-shims":4,"core-util-is":6,events:7,inherits:9,"process-nextick-args":12,"util-deprecate":34}],20:[function(e,t,r){t.exports=e("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":16}],21:[function(e,t,r){(function(n){var i=function(){try{return e("stream")}catch(e){}}();r=t.exports=e("./lib/_stream_readable.js"),r.Stream=i||r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"),!n.browser&&"disable"===n.env.READABLE_STREAM&&i&&(t.exports=i)}).call(this,e("_process"))},{"./lib/_stream_duplex.js":15,"./lib/_stream_passthrough.js":16,"./lib/_stream_readable.js":17,"./lib/_stream_transform.js":18,"./lib/_stream_writable.js":19,_process:13}],22:[function(e,t,r){t.exports=e("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":18}],23:[function(e,t,r){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":19}],24:[function(e,t,r){(function(e){function r(t,r){this._block=new e(t),this._finalSize=r,this._blockSize=t,this._len=0,this._s=0}r.prototype.update=function(t,r){"string"==typeof t&&(r=r||"utf8",t=new e(t,r));for(var n=this._len+=t.length,i=this._s||0,o=0,a=this._block;i=8*this._finalSize&&(this._update(this._block),this._block.fill(0)),this._block.writeInt32BE(t,this._blockSize-4);var r=this._update(this._block)||this._hash();return e?r.toString(e):r},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=r}).call(this,e("buffer").Buffer)},{buffer:5}],25:[function(e,t,r){var r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};r.sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":26,"./sha1":27,"./sha224":28,"./sha256":29,"./sha384":30,"./sha512":31}],26:[function(e,t,r){(function(r){function n(){this.init(),this._w=h,u.call(this,64,56)}function i(e){return e<<5|e>>>27}function o(e){return e<<30|e>>>2}function a(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}var s=e("inherits"),u=e("./hash"),f=[1518500249,1859775393,-1894007588,-899497514],h=new Array(80);s(n,u),n.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},n.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,s=0|this._c,u=0|this._d,h=0|this._e,l=0;l<16;++l)t[l]=e.readInt32BE(4*l);for(;l<80;++l)t[l]=t[l-3]^t[l-8]^t[l-14]^t[l-16];for(var c=0;c<80;++c){var p=~~(c/20),d=i(r)+a(p,n,s,u)+h+t[c]+f[p]|0;h=u,u=s,s=o(n),n=r,r=d}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=u+this._d|0,this._e=h+this._e|0},n.prototype._hash=function(){var e=new r(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=n}).call(this,e("buffer").Buffer)},{"./hash":24,buffer:5,inherits:9}],27:[function(e,t,r){(function(r){function n(){this.init(),this._w=l,f.call(this,64,56)}function i(e){return e<<1|e>>>31}function o(e){return e<<5|e>>>27}function a(e){return e<<30|e>>>2}function s(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}var u=e("inherits"),f=e("./hash"),h=[1518500249,1859775393,-1894007588,-899497514],l=new Array(80);u(n,f),n.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},n.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,u=0|this._c,f=0|this._d,l=0|this._e,c=0;c<16;++c)t[c]=e.readInt32BE(4*c); +for(;c<80;++c)t[c]=i(t[c-3]^t[c-8]^t[c-14]^t[c-16]);for(var p=0;p<80;++p){var d=~~(p/20),y=o(r)+s(d,n,u,f)+l+t[p]+h[d]|0;l=f,f=u,u=a(n),n=r,r=y}this._a=r+this._a|0,this._b=n+this._b|0,this._c=u+this._c|0,this._d=f+this._d|0,this._e=l+this._e|0},n.prototype._hash=function(){var e=new r(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=n}).call(this,e("buffer").Buffer)},{"./hash":24,buffer:5,inherits:9}],28:[function(e,t,r){(function(r){function n(){this.init(),this._w=s,a.call(this,64,56)}var i=e("inherits"),o=e("./sha256"),a=e("./hash"),s=new Array(64);i(n,o),n.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},n.prototype._hash=function(){var e=new r(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},t.exports=n}).call(this,e("buffer").Buffer)},{"./hash":24,"./sha256":29,buffer:5,inherits:9}],29:[function(e,t,r){(function(r){function n(){this.init(),this._w=p,l.call(this,64,56)}function i(e,t,r){return r^e&(t^r)}function o(e,t,r){return e&t|r&(e|t)}function a(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function s(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function u(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function f(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}var h=e("inherits"),l=e("./hash"),c=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],p=new Array(64);h(n,l),n.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},n.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,h=0|this._c,l=0|this._d,p=0|this._e,d=0|this._f,y=0|this._g,v=0|this._h,g=0;g<16;++g)t[g]=e.readInt32BE(4*g);for(;g<64;++g)t[g]=f(t[g-2])+t[g-7]+u(t[g-15])+t[g-16]|0;for(var b=0;b<64;++b){var w=v+s(p)+i(p,d,y)+c[b]+t[b]|0,_=a(r)+o(r,n,h)|0;v=y,y=d,d=p,p=l+w|0,l=h,h=n,n=r,r=w+_|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=h+this._c|0,this._d=l+this._d|0,this._e=p+this._e|0,this._f=d+this._f|0,this._g=y+this._g|0,this._h=v+this._h|0},n.prototype._hash=function(){var e=new r(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},t.exports=n}).call(this,e("buffer").Buffer)},{"./hash":24,buffer:5,inherits:9}],30:[function(e,t,r){(function(r){function n(){this.init(),this._w=s,a.call(this,128,112)}var i=e("inherits"),o=e("./sha512"),a=e("./hash"),s=new Array(160);i(n,o),n.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},n.prototype._hash=function(){function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}var t=new r(48);return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=n}).call(this,e("buffer").Buffer)},{"./hash":24,"./sha512":31,buffer:5,inherits:9}],31:[function(e,t,r){(function(r){function n(){this.init(),this._w=v,d.call(this,128,112)}function i(e,t,r){return r^e&(t^r)}function o(e,t,r){return e&t|r&(e|t)}function a(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function s(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function u(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function f(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function h(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function l(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function c(e,t){return e>>>0>>0?1:0}var p=e("inherits"),d=e("./hash"),y=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],v=new Array(160);p(n,d),n.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},n.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,p=0|this._ch,d=0|this._dh,v=0|this._eh,g=0|this._fh,b=0|this._gh,w=0|this._hh,_=0|this._al,m=0|this._bl,E=0|this._cl,T=0|this._dl,O=0|this._el,S=0|this._fl,B=0|this._gl,k=0|this._hl,A=0;A<32;A+=2)t[A]=e.readInt32BE(4*A),t[A+1]=e.readInt32BE(4*A+4);for(;A<160;A+=2){var j=t[A-30],R=t[A-30+1],x=u(j,R),I=f(R,j);j=t[A-4],R=t[A-4+1];var P=h(j,R),U=l(R,j),L=t[A-14],M=t[A-14+1],C=t[A-32],D=t[A-32+1],N=I+M|0,V=x+L+c(N,I)|0;N=N+U|0,V=V+P+c(N,U)|0,N=N+D|0,V=V+C+c(N,D)|0,t[A]=V,t[A+1]=N}for(var q=0;q<160;q+=2){V=t[q],N=t[q+1];var z=o(r,n,p),F=o(_,m,E),Y=a(r,_),W=a(_,r),H=s(v,O),G=s(O,v),J=y[q],X=y[q+1],$=i(v,g,b),Q=i(O,S,B),Z=k+G|0,K=w+H+c(Z,k)|0;Z=Z+Q|0,K=K+$+c(Z,Q)|0,Z=Z+X|0,K=K+J+c(Z,X)|0,Z=Z+N|0,K=K+V+c(Z,N)|0;var ee=W+F|0,te=Y+z+c(ee,W)|0;w=b,k=B,b=g,B=S,g=v,S=O,O=T+Z|0,v=d+K+c(O,T)|0,d=p,T=E,p=n,E=m,n=r,m=_,_=Z+ee|0,r=K+te+c(_,Z)|0}this._al=this._al+_|0,this._bl=this._bl+m|0,this._cl=this._cl+E|0,this._dl=this._dl+T|0,this._el=this._el+O|0,this._fl=this._fl+S|0,this._gl=this._gl+B|0,this._hl=this._hl+k|0,this._ah=this._ah+r+c(this._al,_)|0,this._bh=this._bh+n+c(this._bl,m)|0,this._ch=this._ch+p+c(this._cl,E)|0,this._dh=this._dh+d+c(this._dl,T)|0,this._eh=this._eh+v+c(this._el,O)|0,this._fh=this._fh+g+c(this._fl,S)|0,this._gh=this._gh+b+c(this._gl,B)|0,this._hh=this._hh+w+c(this._hl,k)|0},n.prototype._hash=function(){function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}var t=new r(64);return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=n}).call(this,e("buffer").Buffer)},{"./hash":24,buffer:5,inherits:9}],32:[function(e,t,r){function n(){i.call(this)}t.exports=n;var i=e("events").EventEmitter,o=e("inherits");o(n,i),n.Readable=e("readable-stream/readable.js"),n.Writable=e("readable-stream/writable.js"),n.Duplex=e("readable-stream/duplex.js"),n.Transform=e("readable-stream/transform.js"),n.PassThrough=e("readable-stream/passthrough.js"),n.Stream=n,n.prototype.pipe=function(e,t){function r(t){e.writable&&!1===e.write(t)&&f.pause&&f.pause()}function n(){f.readable&&f.resume&&f.resume()}function o(){h||(h=!0,e.end())}function a(){h||(h=!0,"function"==typeof e.destroy&&e.destroy())}function s(e){if(u(),0===i.listenerCount(this,"error"))throw e}function u(){f.removeListener("data",r),e.removeListener("drain",n),f.removeListener("end",o),f.removeListener("close",a),f.removeListener("error",s),e.removeListener("error",s),f.removeListener("end",u),f.removeListener("close",u),e.removeListener("close",u)}var f=this;f.on("data",r),e.on("drain",n),e._isStdio||t&&t.end===!1||(f.on("end",o),f.on("close",a));var h=!1;return f.on("error",s),e.on("error",s),f.on("end",u),f.on("close",u),e.on("close",u),e.emit("pipe",f),e}},{events:7,inherits:9,"readable-stream/duplex.js":14,"readable-stream/passthrough.js":20,"readable-stream/readable.js":21,"readable-stream/transform.js":22,"readable-stream/writable.js":23}],33:[function(e,t,r){function n(e){if(e&&!u(e))throw new Error("Unknown encoding: "+e)}function i(e){return e.toString(this.encoding)}function o(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function a(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}var s=e("buffer").Buffer,u=s.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},f=r.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),n(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=o;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=a;break;default:return void(this.write=i)}this.charBuffer=new s(6),this.charReceived=0,this.charLength=0};f.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&n<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var i=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,i),i-=this.charReceived),t+=e.toString(this.encoding,0,i);var i=t.length-1,n=t.charCodeAt(i);if(n>=55296&&n<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,i)}return t},f.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},f.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;t+=n.slice(0,r).toString(i)}return t}},{buffer:5}],34:[function(e,t,r){(function(e){function r(e,t){function r(){if(!i){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),i=!0}return e.apply(this,arguments)}if(n("noDeprecation"))return e;var i=!1;return r}function n(t){try{if(!e.localStorage)return!1}catch(e){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1]); \ No newline at end of file diff --git a/compiled/upload.js b/compiled/upload.js index 82622c5..ef31655 100644 --- a/compiled/upload.js +++ b/compiled/upload.js @@ -1,4 +1,4 @@ -require=function t(e,r,n){function i(s,a){if(!r[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var f=new Error("Cannot find module '"+s+"'");throw f.code="MODULE_NOT_FOUND",f}var h=r[s]={exports:{}};e[s][0].call(h.exports,function(t){var r=e[s][1][t];return i(r?r:t)},h,h.exports,t,e,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s=200&&e.status<300||304===e.status;r?t[s]=e.response:t.text=e.statusText,n(e.status,e.statusText,t,e.getAllResponseHeaders())}),e.open(o,i,u),e.responseType=s;for(var f in r)r.hasOwnProperty(f)&&e.setRequestHeader(f,r[f]);e.send(a)},abort:function(){e&&e.abort()}}}})}(jQuery)},{}],"/config.js":[function(t,e,r){(function(r,n){"use strict";"/"===n&&(n="");var i=t(n+"/lib/assert.js"),o=7;i.between(0,o,65536);var s=2,a=r.allocUnsafe(s);a.writeUInt16BE(o,0);var u=a.toString("base64");e.exports={VERSION_STRING:u}}).call(this,t("buffer").Buffer,"/")},{buffer:5}],"/lib/assert.js":[function(t,e,r){"use strict";var n=t("/lib/util-inspect.js"),i={instanceOf:function(t,e){e instanceof Array||(e=[e]);var r=!1,i=!0,o=!1,s=void 0;try{for(var a,u=e[Symbol.iterator]();!(i=(a=u.next()).done);i=!0){var f=a.value;if(t instanceof f||void 0!==t&&null!==t&&t.constructor===f){r=!0;break}}}catch(t){o=!0,s=t}finally{try{!i&&u.return&&u.return()}finally{if(o)throw s}}if(!r)throw new TypeError(n.inspect(t)+" is not an instance of "+e.map(function(t){return t.name}).join(" or "))},integer:function(t){if(i.instanceOf(t,Number),!Number.isSafeInteger(t))throw new RangeError(n.inspect(t)+" is not an integer")},between:function(t,e,r){var i=arguments.length<=3||void 0===arguments[3]?"":arguments[3];if(e=r)throw new RangeError(i+n.inspect(e)+" is not in ["+n.inspect(t)+","+n.inspect(r)+")")},byteUnsignedInteger:function(t){i.integer(t),i.between(0,t,256)},fourByteUnsignedInteger:function(t){i.integer(t),i.between(0,t,4294967296)},fail:function(t){throw new Error(t)},assert:function(t,e){t||i.fail(e)},throws:function(t){var e=!0;try{t(),e=!1}catch(t){}i.assert(e,"Should throw an error")},equal:function(t,e){var r=new RangeError("Expected "+n.inspect(e)+" but got "+n.inspect(t));if(e&&e.constructor===Object){for(var o in e)if(e.hasOwnProperty(o))try{i.equal(t[o],e[o])}catch(t){throw r}}else if(e&&e.constructor===Array){if(!t||t.constructor!==Array)throw r;try{i.equal(t.length,e.length)}catch(t){throw r}for(var s=0;s>>3},modEight:function(t){return 7&t}}},{}],"/lib/buffer-stream.js":[function(t,e,r){(function(r,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=function(){function t(t,e){for(var r=0;rthis.buffer.length){var e=r.allocUnsafe(t<<1);this.buffer.copy(e,0,0,this.size),this.buffer=e}return this}},{key:"set",value:function(t,e){return s.integer(t),s.integer(e),s.between(0,t,this.size,"Index out of bounds: "),s.between(0,e,256,"Not a byte: "),this.buffer.writeUInt8(e,t),this}},{key:"setAll",value:function(t,e){s.instanceOf(e,r),s.integer(t),s.between(0,t,this.size-e.length+1,"Index out of bounds: "),e.copy(this.buffer,t)}},{key:"get",value:function(t){return s.integer(t),s.between(0,t,this.size,"Index out of bounds: "),this.buffer.readUInt8(t)}},{key:"add",value:function(t){var e=this.size,r=e+1;return this.grow(r),this.size=r,this.set(e,t),this}},{key:"addAll",value:function(t){s.instanceOf(t,r);var e=this.size,n=this.size+t.length;return this.grow(n),this.size=n,t.copy(this.buffer,e),this}},{key:"toBuffer",value:function(){return this.buffer.slice(0,this.size)}},{key:"length",get:function(){return this.size}},{key:"rawBuffer",get:function(){return this.buffer}}]),t}()}).call(this,t("buffer").Buffer,"/lib")},{buffer:5}],"/lib/strint.js":[function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},i={};!function(){function t(t,e){return B(t)===B(e)}function e(t,e){for(;e>0;)t+="0",e--;return t}function r(t){f(t,"string")}function o(t){r(t),u(t,B,"isPositive")}function s(t){f(t,"number")}function a(t){if(f(t,"number"),t<0)throw new Error("Expected a positive number: "+t)}function u(t,e,r){if(!e.call(null,t))throw new Error("Condition "+r+" failed for value "+t)}function f(t,e){if(("undefined"==typeof t?"undefined":n(t))!==e)throw new Error("Not a "+e+": "+t)}var h=i.subPositive=function(t,e){if(o(t),o(e),!m(t,e))throw new Error("x must be greater or equal to y");for(var r=Math.max(t.length,e.length),n="",i=0,s=0,a=0;a=10;)h-=10,i++;0===h?s++:(n=String(h)+x(n,s),s=0)}return i>0&&(n=String(i)+x(n,s)),n},l=i.add=function(t,e){if(r(t),r(e),B(t)&&B(e))return c(t,e);if(O(t)&&O(e))return k(c(S(t),S(e)));if(_(S(t),S(e))){var n=t;t=e,e=n}var i=h(S(t),S(e));return B(t)?i:k(i)},d=i.sub=function(t,e){return r(t),r(e),l(t,k(e))},p=i.timesDigit=function(t,e){o(t),s(e);for(var r="",n=I(t),i=0,a=0,u=0;u=10;)f-=10,i++;0===f?a++:(r=String(f)+x(r,a),a=0)}return i>0&&(r=String(i)+x(r,a)),0===r.length?"0":r},y=i.mulPositive=function(t,r){o(t),o(r);for(var n="0",i=I(r),s=0;s=I(t)?"0":t.charAt(t.length-e-1)},I=function(t){return O(t)?t.length-1:t.length}}(),i.LONG_UPPER_SHIFT="4294967296",e.exports=i},{}],"/lib/util-inspect.js":[function(t,e,r){"use strict";r.inspect=function(t){if(void 0===t)return"undefined";if(null===t||t.constructor===Object||t.constructor===Array||t.constructor===String||t.constructor===Number||t.constructor===Boolean||t.constructor===Date)return JSON.stringify(t);if(t.constructor===Set){for(var e="Set {",n=t.values(),i=n.next();!i.done;)e+=r.inspect(i.value),i=n.next(),i.done||(e+=", ");return e+"}"}if(t.constructor===Map){for(var o="Map {",s=t.entries(),a=s.next();!a.done;)o+=r.inspect(a.value[0]),o+=" => ",o+=r.inspect(a.value[1]),a=s.next(),a.done||(o+=", ");return o+"}"}return t.constructor.name?t.constructor.name+" "+JSON.stringify(t):JSON.stringify(t)}},{}],"/structure-types.js":[function(t,e,r){(function(r,n){"use strict";function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t){var e=r.allocUnsafe(4);return e.writeUInt32BE(t,0),e}function u(t,e){if(e&&t.pointers){var n=!0,i=!1,o=void 0;try{for(var s,a=t.pointers[Symbol.iterator]();!(n=(s=a.next()).done);n=!0){var u=d(s.value,2),f=u[0],h=u[1],c=t.length;t.addAll(r.from(f,O));var l=r.allocUnsafe(4);l.writeUInt32BE(c);var p=!0,y=!1,g=void 0;try{for(var v,b=h[Symbol.iterator]();!(p=(v=b.next()).done);p=!0){var w=v.value;t.setAll(w,l)}}catch(t){y=!0,g=t}finally{try{!p&&b.return&&b.return()}finally{if(y)throw g}}}}catch(t){i=!0,o=t}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}}}function f(t,e){if(p.instanceOf(t,v),p.instanceOf(e,String),b.gt(e,"18446744073709551615")||b.lt(e,"0"))throw new Error("Value out of range");var n=b.div(e,b.LONG_UPPER_SHIFT),i=b.sub(e,b.mul(n,b.LONG_UPPER_SHIFT)),o=r.allocUnsafe(8);o.writeUInt32BE(Number(n),0),o.writeUInt32BE(Number(i),4),t.addAll(o)}function h(t,e){p.instanceOf(e,Array);var n=E(e.length),i=m(e.length),o=void 0;o=n?i+1:i;var s=r.allocUnsafe(o);n&&(s[o-1]=0);for(var a=0;ae[J])return 1;throw new Error("Should not have any duplicate fields")}),n}return o(e,t),l(e,null,[{key:"_value",get:function(){return 81}}]),l(e,[{key:"addToBuffer",value:function(t){if(c(Object.getPrototypeOf(e.prototype),"addToBuffer",this).call(this,t)){t.add(this.fields.length);var n=!0,i=!1,o=void 0;try{for(var s,a=this.fields[Symbol.iterator]();!(n=(s=a.next()).done);n=!0){var u=s.value,f=r.from(u[J]);t.add(f.length),t.addAll(f),u[X].addToBuffer(t)}}catch(t){i=!0,o=t}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}}}},{key:"writeValue",value:function(t,e){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];p.instanceOf(t,v),p.instanceOf(e,Object);var n=!0,i=!1,o=void 0;try{for(var s,a=this.fields[Symbol.iterator]();!(n=(s=a.next()).done);n=!0){var f=s.value;f[X].writeValue(t,e[f[J]],!1)}}catch(t){i=!0,o=t}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}u(t,r)}}]),e}(k),Q=function(t){function e(t){s(this,e);var r=i(this,Object.getPrototypeOf(e).call(this));return p.instanceOf(t,S),r.type=t,r}return o(e,t),l(e,null,[{key:"_value",get:function(){return 82}}]),l(e,[{key:"addToBuffer",value:function(t){c(Object.getPrototypeOf(e.prototype),"addToBuffer",this).call(this,t)&&this.type.addToBuffer(t)}},{key:"_writeValue",value:function(t,e,r){p.instanceOf(t,v),p.fourByteUnsignedInteger(e.length),t.addAll(a(e.length));var n=!0,i=!1,o=void 0;try{for(var s,f=e[Symbol.iterator]();!(n=(s=f.next()).done);n=!0){var h=s.value;this.type.writeValue(t,h,!1)}}catch(t){i=!0,o=t}finally{try{!n&&f.return&&f.return()}finally{if(i)throw o}}u(t,r)}},{key:"writeValue",value:function(t,e){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];p.instanceOf(e,Array),this._writeValue(t,e,r)}}]),e}(k),Z=function(t){function e(t){return s(this,e),i(this,Object.getPrototypeOf(e).call(this,t))}return o(e,t),l(e,null,[{key:"_value",get:function(){return 83}}]),l(e,[{key:"writeValue",value:function(t,e){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];p.instanceOf(e,Set),e.length=e.size,this._writeValue(t,e,r)}}]),e}(Q),K=function(t){function e(t,r){s(this,e);var n=i(this,Object.getPrototypeOf(e).call(this));return p.instanceOf(t,S),p.instanceOf(r,S),n.keyType=t,n.valueType=r,n}return o(e,t),l(e,null,[{key:"_value",get:function(){return 84}}]),l(e,[{key:"addToBuffer",value:function(t){c(Object.getPrototypeOf(e.prototype),"addToBuffer",this).call(this,t)&&(this.keyType.addToBuffer(t),this.valueType.addToBuffer(t))}},{key:"writeValue",value:function(t,e){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];p.instanceOf(t,v),p.instanceOf(e,Map),p.fourByteUnsignedInteger(e.size),t.addAll(a(e.size));var n=!0,i=!1,o=void 0;try{for(var s,f=e[Symbol.iterator]();!(n=(s=f.next()).done);n=!0){var h=d(s.value,2),c=h[0],l=h[1];this.keyType.writeValue(t,c,!1),this.valueType.writeValue(t,l,!1)}}catch(t){i=!0,o=t}finally{try{!n&&f.return&&f.return()}finally{if(i)throw o}}u(t,r)}}]),e}(k),tt=function(t){function e(t){var r=t.type,n=t.values;s(this,e);var o=i(this,Object.getPrototypeOf(e).call(this));p.instanceOf(r,k),p.instanceOf(n,Array);try{p.byteUnsignedInteger(n.length)}catch(t){throw new Error(String(n.length)+" values is too many")}for(var a=new Map,u=0;u0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===t[a-2]?2:"="===t[a-1]?1:0,s=new h(3*a/4-o), -n=o>0?a-4:a;var u=0;for(e=0,r=0;e>16&255,s[u++]=i>>8&255,s[u++]=255&i;return 2===o?(i=f[t.charCodeAt(e)]<<2|f[t.charCodeAt(e+1)]>>4,s[u++]=255&i):1===o&&(i=f[t.charCodeAt(e)]<<10|f[t.charCodeAt(e+1)]<<4|f[t.charCodeAt(e+2)]>>2,s[u++]=i>>8&255,s[u++]=255&i),s}function o(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}function s(t,e,r){for(var n,i=[],s=e;sh?h:f+a));return 1===n?(e=t[r-1],i+=u[e>>2],i+=u[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=u[e>>10],i+=u[e>>4&63],i+=u[e<<2&63],i+="="),o.push(i),o.join("")}r.toByteArray=i,r.fromByteArray=a;var u=[],f=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array;n()},{}],3:[function(t,e,r){},{}],4:[function(t,e,r){(function(e){"use strict";var n=t("buffer"),i=n.Buffer,o=n.SlowBuffer,s=n.kMaxLength||2147483647;r.alloc=function(t,e,r){if("function"==typeof i.alloc)return i.alloc(t,e,r);if("number"==typeof r)throw new TypeError("encoding must not be number");if("number"!=typeof t)throw new TypeError("size must be a number");if(t>s)throw new RangeError("size is too large");var n=r,o=e;void 0===o&&(n=void 0,o=0);var a=new i(t);if("string"==typeof o)for(var u=new i(o,n),f=u.length,h=-1;++hs)throw new RangeError("size is too large");return new i(t)},r.from=function(t,r,n){if("function"==typeof i.from&&(!e.Uint8Array||Uint8Array.from!==i.from))return i.from(t,r,n);if("number"==typeof t)throw new TypeError('"value" argument must not be a number');if("string"==typeof t)return new i(t,r);if("undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer){var o=r;if(1===arguments.length)return new i(t);"undefined"==typeof o&&(o=0);var s=n;if("undefined"==typeof s&&(s=t.byteLength-o),o>=t.byteLength)throw new RangeError("'offset' is out of bounds");if(s>t.byteLength-o)throw new RangeError("'length' is out of bounds");return new i(t.slice(o,o+s))}if(i.isBuffer(t)){var a=new i(t.length);return t.copy(a,0,0,t.length),a}if(t){if(Array.isArray(t)||"undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return new i(t);if("Buffer"===t.type&&Array.isArray(t.data))return new i(t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")},r.allocUnsafeSlow=function(t){if("function"==typeof i.allocUnsafeSlow)return i.allocUnsafeSlow(t);if("number"!=typeof t)throw new TypeError("size must be a number");if(t>=s)throw new RangeError("size is too large");return new o(t)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{buffer:5}],5:[function(t,e,r){(function(e){"use strict";function n(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}function i(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t,e){if(i()=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function g(t){return+t!=t&&(t=0),s.alloc(+t)}function v(t,e){if(s.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"binary":case"raw":case"raws":return r;case"utf8":case"utf-8":case void 0:return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(t).length;default:if(n)return F(t).length;e=(""+e).toLowerCase(),n=!0}}function b(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return P(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return R(this,e,r);case"binary":return x(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function w(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function _(t,e,r,n){function i(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var o=1,s=t.length,a=e.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,a/=2,r/=2}for(var u=-1,f=r;fi&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new Error("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s239?4:o>223?3:o>191?2:1;if(i+a<=r){var u,f,h,c;switch(a){case 1:o<128&&(s=o);break;case 2:u=t[i+1],128===(192&u)&&(c=(31&o)<<6|63&u,c>127&&(s=c));break;case 3:u=t[i+1],f=t[i+2],128===(192&u)&&128===(192&f)&&(c=(15&o)<<12|(63&u)<<6|63&f,c>2047&&(c<55296||c>57343)&&(s=c));break;case 4:u=t[i+1],f=t[i+2],h=t[i+3],128===(192&u)&&128===(192&f)&&128===(192&h)&&(c=(15&o)<<18|(63&u)<<12|(63&f)<<6|63&h,c>65535&&c<1114112&&(s=c))}}null===s?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=a}return j(n)}function j(t){var e=t.length;if(e<=K)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function U(t,e,r,n,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function M(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function C(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function D(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(t,e,r,n,i){return i||D(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(t,e,r,n,23,4),r+4}function q(t,e,r,n,i){return i||D(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(t,e,r,n,52,8),r+8}function V(t){if(t=z(t).replace(tt,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function z(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Y(t){return t<16?"0"+t.toString(16):t.toString(16)}function F(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],s=0;s55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function W(t){for(var e=[],r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function G(t){return $.toByteArray(V(t))}function J(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function X(t){return t!==t}var $=t("base64-js"),Q=t("ieee754"),Z=t("isarray");r.Buffer=s,r.SlowBuffer=g,r.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:n(),r.kMaxLength=i(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,e,r){return a(null,t,e,r)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(t,e,r){return f(null,t,e,r)},s.allocUnsafe=function(t){return h(null,t)},s.allocUnsafeSlow=function(t){return h(null,t)},s.isBuffer=function(t){return!(null==t||!t._isBuffer)},s.compare=function(t,e){if(!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},s.prototype.compare=function(t,e,r,n,i){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,a=r-e,u=Math.min(o,a),f=this.slice(n,i),h=t.slice(e,r),c=0;c2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e>>=0,0===this.length)return-1;if(e>=this.length)return-1;if(e<0&&(e=Math.max(this.length+e,0)),"string"==typeof t&&(t=s.from(t,r)),s.isBuffer(t))return 0===t.length?-1:_(this,t,e,r);if("number"==typeof t)return s.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,t,e):_(this,[t],e,r);throw new TypeError("val must be string, number or Buffer")},s.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1},s.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e=0|e,isFinite(r)?(r=0|r,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return m(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":return O(this,t,e,r);case"binary":return B(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var K=4096;s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUInt8=function(t,e){return e||L(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return e||L(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return e||L(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t=0|t,e=0|e,r||L(t,e,this.length);for(var n=this[t],i=1,o=0;++o=i&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t=0|t,e=0|e,r||L(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return e||L(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},s.prototype.readInt16LE=function(t,e){e||L(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){e||L(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return e||L(t,4,this.length),Q.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return e||L(t,4,this.length),Q.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return e||L(t,8,this.length),Q.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return e||L(t,8,this.length),Q.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e=0|e,r=0|r,!n){var i=Math.pow(2,8*r)-1;U(this,t,e,r,i,0)}var o=1,s=0;for(this[e]=255&t;++s=0&&(s*=256);)this[e+o]=t/s&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):M(this,t,e,!0),e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):M(this,t,e,!1),e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):C(this,t,e,!0),e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);U(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);U(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):M(this,t,e,!0),e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):M(this,t,e,!1),e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):C(this,t,e,!0),e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},s.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return q(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return q(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,o,a;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],o=r.length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(s(r)){for(a=o;a-- >0;)if(r[a]===e||r[a].listener&&r[a].listener===e){n=a;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],i(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],8:[function(t,e,r){r.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,h=-7,c=r?i-1:0,l=r?-1:1,d=t[e+c];for(c+=l,o=d&(1<<-h)-1,d>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=l,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+c],c+=l,h-=8);if(0===o)o=1-f;else{if(o===u)return s?NaN:(d?-1:1)*(1/0);s+=Math.pow(2,n),o-=f}return(d?-1:1)*s*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var s,a,u,f=8*o-i-1,h=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),e+=s+c>=1?l/u:l*Math.pow(2,1-c),e*u>=2&&(s++,u/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*u-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<0;t[r+d]=255&s,d+=p,s/=256,f-=8);t[r+d-p]|=128*y}},{}],9:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],10:[function(t,e,r){e.exports=function(t){return!(null==t||!(t._isBuffer||t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)))}},{}],11:[function(t,e,r){var n={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},{}],12:[function(t,e,r){(function(t){"use strict";function r(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,r)});case 3:return t.nextTick(function(){e.call(null,r,n)});case 4:return t.nextTick(function(){e.call(null,r,n,i)});default:for(o=new Array(a-1),s=0;s1)for(var r=1;r0)if(e.ended&&!i){var s=new Error("stream.push() after EOF");t.emit("error",s)}else if(e.endEmitted&&i){var u=new Error("stream.unshift() after end event");t.emit("error",u)}else{var f;!e.decoder||i||n||(r=e.decoder.write(r),f=!e.objectMode&&0===r.length),i||(e.reading=!1),f||(e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&l(t))),p(t,e)}else i||(e.reading=!1);return a(e)}function a(t){return!t.ended&&(t.needReadable||t.length=N?t=N:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function f(t,e){return 0===e.length&&e.ended?0:e.objectMode?0===t?0:1:null===t||isNaN(t)?e.flowing&&e.buffer.length?e.buffer[0].length:e.length:t<=0?0:(t>e.highWaterMark&&(e.highWaterMark=u(t)),t>e.length?e.ended?e.length:(e.needReadable=!0,0):t)}function h(t,e){var r=null;return x.isBuffer(e)||"string"==typeof e||null===e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}function c(t,e){if(!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,l(t)}}function l(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(U("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?k(d,t):d(t))}function d(t){U("emit readable"),t.emit("readable"),_(t)}function p(t,e){e.readingMore||(e.readingMore=!0,k(y,t,e))}function y(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=i)r=o?n.join(""):1===n.length?n[0]:x.concat(n,i),n.length=0;else if(t0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,k(O,e,t))}function O(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function B(t,e){for(var r=0,n=t.length;r0)&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return U("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?E(this):l(this),null;if(t=f(t,e),0===t&&e.ended)return 0===e.length&&E(this),null;var n=e.needReadable;U("need readable",n),(0===e.length||e.length-t0?m(t,e):null,null===i&&(e.needReadable=!0,t=0),e.length-=t,0!==e.length||e.ended||(e.needReadable=!0),r!==t&&e.ended&&0===e.length&&E(this),null!==i&&this.emit("data",i),i},o.prototype._read=function(t){this.emit("error",new Error("not implemented"))},o.prototype.pipe=function(t,e){function i(t){U("onunpipe"),t===l&&s()}function o(){U("onend"),t.end()}function s(){U("cleanup"),t.removeListener("close",f),t.removeListener("finish",h),t.removeListener("drain",v),t.removeListener("error",u),t.removeListener("unpipe",i),l.removeListener("end",o),l.removeListener("end",s),l.removeListener("data",a),b=!0,!d.awaitDrain||t._writableState&&!t._writableState.needDrain||v()}function a(e){U("ondata");var r=t.write(e);!1===r&&((1===d.pipesCount&&d.pipes===t||d.pipesCount>1&&S(d.pipes,t)!==-1)&&!b&&(U("false write response, pause",l._readableState.awaitDrain),l._readableState.awaitDrain++),l.pause())}function u(e){U("onerror",e),c(),t.removeListener("error",u),0===R(t,"error")&&t.emit("error",e)}function f(){t.removeListener("finish",h),c()}function h(){U("onfinish"),t.removeListener("close",f),c()}function c(){U("unpipe"),l.unpipe(t)}var l=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=t;break;case 1:d.pipes=[d.pipes,t];break;default:d.pipes.push(t)}d.pipesCount+=1,U("pipe count=%d opts=%j",d.pipesCount,e);var p=(!e||e.end!==!1)&&t!==r.stdout&&t!==r.stderr,y=p?o:s;d.endEmitted?k(y):l.once("end",y),t.on("unpipe",i);var v=g(l);t.on("drain",v);var b=!1;return l.on("data",a),n(t,"error",u),t.once("close",f),t.once("finish",h),t.emit("pipe",l),d.flowing||(U("pipe resume"),l.resume()),t},o.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this),this);if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;i-1?setImmediate:O;s.WritableState=o;var S=t("core-util-is");S.inherits=t("inherits");var k,T={deprecate:t("util-deprecate")};!function(){try{k=t("stream")}catch(t){}finally{k||(k=t("events").EventEmitter)}}();var A=t("buffer").Buffer,j=t("buffer-shims");S.inherits(s,k);var R;o.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(o.prototype,"buffer",{get:T.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(t){}}();var R;s.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},s.prototype.write=function(t,e,r){var i=this._writableState,o=!1;return"function"==typeof e&&(r=e,e=null),A.isBuffer(t)?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=n),i.ended?a(this,r):u(this,i,t,r)&&(i.pendingcb++,o=h(this,i,t,e,r)),o},s.prototype.cork=function(){var t=this._writableState;t.corked++},s.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||v(this,t))},s.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},s.prototype._write=function(t,e,r){r(new Error("not implemented"))},s.prototype._writev=null,s.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||m(this,n,r)}}).call(this,t("_process"))},{"./_stream_duplex":15,_process:13,buffer:5,"buffer-shims":4,"core-util-is":6,events:7,inherits:9,"process-nextick-args":12,"util-deprecate":34}],20:[function(t,e,r){e.exports=t("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":16}],21:[function(t,e,r){(function(n){var i=function(){try{return t("stream")}catch(t){}}();r=e.exports=t("./lib/_stream_readable.js"),r.Stream=i||r,r.Readable=r,r.Writable=t("./lib/_stream_writable.js"),r.Duplex=t("./lib/_stream_duplex.js"),r.Transform=t("./lib/_stream_transform.js"),r.PassThrough=t("./lib/_stream_passthrough.js"),!n.browser&&"disable"===n.env.READABLE_STREAM&&i&&(e.exports=i)}).call(this,t("_process"))},{"./lib/_stream_duplex.js":15,"./lib/_stream_passthrough.js":16,"./lib/_stream_readable.js":17,"./lib/_stream_transform.js":18,"./lib/_stream_writable.js":19,_process:13}],22:[function(t,e,r){e.exports=t("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":18}],23:[function(t,e,r){e.exports=t("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":19}],24:[function(t,e,r){(function(t){function r(e,r){this._block=new t(e),this._finalSize=r,this._blockSize=e,this._len=0,this._s=0}r.prototype.update=function(e,r){"string"==typeof e&&(r=r||"utf8",e=new t(e,r));for(var n=this._len+=e.length,i=this._s||0,o=0,s=this._block;i=8*this._finalSize&&(this._update(this._block),this._block.fill(0)),this._block.writeInt32BE(e,this._blockSize-4);var r=this._update(this._block)||this._hash();return t?r.toString(t):r},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=r}).call(this,t("buffer").Buffer)},{buffer:5}],25:[function(t,e,r){var r=e.exports=function(t){t=t.toLowerCase();var e=r[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e};r.sha=t("./sha"),r.sha1=t("./sha1"),r.sha224=t("./sha224"),r.sha256=t("./sha256"),r.sha384=t("./sha384"),r.sha512=t("./sha512")},{"./sha":26,"./sha1":27,"./sha224":28,"./sha256":29,"./sha384":30,"./sha512":31}],26:[function(t,e,r){(function(r){function n(){this.init(),this._w=h,u.call(this,64,56)}function i(t){return t<<5|t>>>27}function o(t){return t<<30|t>>>2}function s(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}var a=t("inherits"),u=t("./hash"),f=[1518500249,1859775393,-1894007588,-899497514],h=new Array(80);a(n,u),n.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},n.prototype._update=function(t){for(var e=this._w,r=0|this._a,n=0|this._b,a=0|this._c,u=0|this._d,h=0|this._e,c=0;c<16;++c)e[c]=t.readInt32BE(4*c);for(;c<80;++c)e[c]=e[c-3]^e[c-8]^e[c-14]^e[c-16];for(var l=0;l<80;++l){var d=~~(l/20),p=i(r)+s(d,n,a,u)+h+e[l]+f[d]|0;h=u,u=a,a=o(n),n=r,r=p}this._a=r+this._a|0,this._b=n+this._b|0,this._c=a+this._c|0,this._d=u+this._d|0,this._e=h+this._e|0},n.prototype._hash=function(){var t=new r(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},e.exports=n}).call(this,t("buffer").Buffer)},{"./hash":24,buffer:5,inherits:9}],27:[function(t,e,r){(function(r){function n(){this.init(),this._w=c,f.call(this,64,56)}function i(t){return t<<1|t>>>31}function o(t){return t<<5|t>>>27}function s(t){return t<<30|t>>>2}function a(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}var u=t("inherits"),f=t("./hash"),h=[1518500249,1859775393,-1894007588,-899497514],c=new Array(80);u(n,f),n.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},n.prototype._update=function(t){for(var e=this._w,r=0|this._a,n=0|this._b,u=0|this._c,f=0|this._d,c=0|this._e,l=0;l<16;++l)e[l]=t.readInt32BE(4*l);for(;l<80;++l)e[l]=i(e[l-3]^e[l-8]^e[l-14]^e[l-16]);for(var d=0;d<80;++d){var p=~~(d/20),y=o(r)+a(p,n,u,f)+c+e[d]+h[p]|0;c=f,f=u,u=s(n),n=r,r=y}this._a=r+this._a|0,this._b=n+this._b|0,this._c=u+this._c|0,this._d=f+this._d|0,this._e=c+this._e|0},n.prototype._hash=function(){var t=new r(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},e.exports=n}).call(this,t("buffer").Buffer)},{"./hash":24,buffer:5,inherits:9}],28:[function(t,e,r){(function(r){function n(){this.init(),this._w=a,s.call(this,64,56)}var i=t("inherits"),o=t("./sha256"),s=t("./hash"),a=new Array(64);i(n,o),n.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},n.prototype._hash=function(){var t=new r(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},e.exports=n}).call(this,t("buffer").Buffer)},{"./hash":24,"./sha256":29,buffer:5,inherits:9}],29:[function(t,e,r){(function(r){function n(){this.init(),this._w=d,c.call(this,64,56)}function i(t,e,r){return r^t&(e^r)}function o(t,e,r){return t&e|r&(t|e)}function s(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function a(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function u(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function f(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}var h=t("inherits"),c=t("./hash"),l=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],d=new Array(64);h(n,c),n.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},n.prototype._update=function(t){for(var e=this._w,r=0|this._a,n=0|this._b,h=0|this._c,c=0|this._d,d=0|this._e,p=0|this._f,y=0|this._g,g=0|this._h,v=0;v<16;++v)e[v]=t.readInt32BE(4*v);for(;v<64;++v)e[v]=f(e[v-2])+e[v-7]+u(e[v-15])+e[v-16]|0;for(var b=0;b<64;++b){var w=g+a(d)+i(d,p,y)+l[b]+e[b]|0,_=s(r)+o(r,n,h)|0;g=y,y=p,p=d,d=c+w|0,c=h,h=n,n=r,r=w+_|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=h+this._c|0,this._d=c+this._d|0,this._e=d+this._e|0,this._f=p+this._f|0,this._g=y+this._g|0,this._h=g+this._h|0},n.prototype._hash=function(){var t=new r(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},e.exports=n}).call(this,t("buffer").Buffer)},{"./hash":24,buffer:5,inherits:9}],30:[function(t,e,r){(function(r){function n(){this.init(),this._w=a,s.call(this,128,112)}var i=t("inherits"),o=t("./sha512"),s=t("./hash"),a=new Array(160);i(n,o),n.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},n.prototype._hash=function(){function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}var e=new r(48);return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=n}).call(this,t("buffer").Buffer)},{"./hash":24,"./sha512":31,buffer:5,inherits:9}],31:[function(t,e,r){(function(r){function n(){this.init(),this._w=g,p.call(this,128,112)}function i(t,e,r){return r^t&(e^r)}function o(t,e,r){return t&e|r&(t|e)}function s(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function a(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function u(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function f(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function h(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function c(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function l(t,e){return t>>>0>>0?1:0}var d=t("inherits"),p=t("./hash"),y=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],g=new Array(160);d(n,p),n.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},n.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,d=0|this._ch,p=0|this._dh,g=0|this._eh,v=0|this._fh,b=0|this._gh,w=0|this._hh,_=0|this._al,m=0|this._bl,E=0|this._cl,O=0|this._dl,B=0|this._el,S=0|this._fl,k=0|this._gl,T=0|this._hl,A=0;A<32;A+=2)e[A]=t.readInt32BE(4*A),e[A+1]=t.readInt32BE(4*A+4);for(;A<160;A+=2){var j=e[A-30],R=e[A-30+1],x=u(j,R),P=f(R,j);j=e[A-4],R=e[A-4+1];var I=h(j,R),L=c(R,j),U=e[A-14],M=e[A-14+1],C=e[A-32],D=e[A-32+1],N=P+M|0,q=x+U+l(N,P)|0;N=N+L|0,q=q+I+l(N,L)|0,N=N+D|0,q=q+C+l(N,D)|0,e[A]=q,e[A+1]=N}for(var V=0;V<160;V+=2){q=e[V],N=e[V+1];var z=o(r,n,d),Y=o(_,m,E),F=s(r,_),W=s(_,r),H=a(g,B),G=a(B,g),J=y[V],X=y[V+1],$=i(g,v,b),Q=i(B,S,k),Z=T+G|0,K=w+H+l(Z,T)|0;Z=Z+Q|0,K=K+$+l(Z,Q)|0,Z=Z+X|0,K=K+J+l(Z,X)|0,Z=Z+N|0,K=K+q+l(Z,N)|0;var tt=W+Y|0,et=F+z+l(tt,W)|0;w=b,T=k,b=v,k=S,v=g,S=B,B=O+Z|0,g=p+K+l(B,O)|0,p=d,O=E,d=n,E=m,n=r,m=_,_=Z+tt|0,r=K+et+l(_,Z)|0}this._al=this._al+_|0,this._bl=this._bl+m|0,this._cl=this._cl+E|0,this._dl=this._dl+O|0,this._el=this._el+B|0,this._fl=this._fl+S|0,this._gl=this._gl+k|0,this._hl=this._hl+T|0,this._ah=this._ah+r+l(this._al,_)|0,this._bh=this._bh+n+l(this._bl,m)|0,this._ch=this._ch+d+l(this._cl,E)|0,this._dh=this._dh+p+l(this._dl,O)|0,this._eh=this._eh+g+l(this._el,B)|0,this._fh=this._fh+v+l(this._fl,S)|0,this._gh=this._gh+b+l(this._gl,k)|0,this._hh=this._hh+w+l(this._hl,T)|0},n.prototype._hash=function(){function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}var e=new r(64);return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=n}).call(this,t("buffer").Buffer)},{"./hash":24,buffer:5,inherits:9}],32:[function(t,e,r){function n(){i.call(this)}e.exports=n;var i=t("events").EventEmitter,o=t("inherits");o(n,i),n.Readable=t("readable-stream/readable.js"),n.Writable=t("readable-stream/writable.js"),n.Duplex=t("readable-stream/duplex.js"),n.Transform=t("readable-stream/transform.js"),n.PassThrough=t("readable-stream/passthrough.js"),n.Stream=n,n.prototype.pipe=function(t,e){function r(e){t.writable&&!1===t.write(e)&&f.pause&&f.pause()}function n(){f.readable&&f.resume&&f.resume()}function o(){h||(h=!0,t.end())}function s(){h||(h=!0,"function"==typeof t.destroy&&t.destroy())}function a(t){if(u(),0===i.listenerCount(this,"error"))throw t}function u(){f.removeListener("data",r),t.removeListener("drain",n),f.removeListener("end",o),f.removeListener("close",s),f.removeListener("error",a),t.removeListener("error",a),f.removeListener("end",u),f.removeListener("close",u),t.removeListener("close",u)}var f=this;f.on("data",r),t.on("drain",n),t._isStdio||e&&e.end===!1||(f.on("end",o),f.on("close",s));var h=!1;return f.on("error",a),t.on("error",a),f.on("end",u),f.on("close",u),t.on("close",u),t.emit("pipe",f),t}},{events:7,inherits:9,"readable-stream/duplex.js":14,"readable-stream/passthrough.js":20,"readable-stream/readable.js":21,"readable-stream/transform.js":22,"readable-stream/writable.js":23}],33:[function(t,e,r){function n(t){if(t&&!u(t))throw new Error("Unknown encoding: "+t)}function i(t){return t.toString(this.encoding)}function o(t){this.charReceived=t.length%2,this.charLength=this.charReceived?2:0}function s(t){this.charReceived=t.length%3,this.charLength=this.charReceived?3:0}var a=t("buffer").Buffer,u=a.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},f=r.StringDecoder=function(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),n(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=o;break;case"base64":this.surrogateSize=3, -this.detectIncompleteChar=s;break;default:return void(this.write=i)}this.charBuffer=new a(6),this.charReceived=0,this.charLength=0};f.prototype.write=function(t){for(var e="";this.charLength;){var r=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&n<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var i=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,i),i-=this.charReceived),e+=t.toString(this.encoding,0,i);var i=e.length-1,n=e.charCodeAt(i);if(n>=55296&&n<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),t.copy(this.charBuffer,0,0,o),e.substring(0,i)}return e},f.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var r=t[t.length-e];if(1==e&&r>>5==6){this.charLength=2;break}if(e<=2&&r>>4==14){this.charLength=3;break}if(e<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=e},f.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;e+=n.slice(0,r).toString(i)}return e}},{buffer:5}],34:[function(t,e,r){(function(t){function r(t,e){function r(){if(!i){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}if(n("noDeprecation"))return t;var i=!1;return r}function n(e){try{if(!t.localStorage)return!1}catch(t){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1]); \ No newline at end of file +require=function t(e,r,n){function i(s,a){if(!r[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var f=new Error("Cannot find module '"+s+"'");throw f.code="MODULE_NOT_FOUND",f}var h=r[s]={exports:{}};e[s][0].call(h.exports,function(t){var r=e[s][1][t];return i(r?r:t)},h,h.exports,t,e,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s=200&&e.status<300||304===e.status;r?t[s]=e.response:t.text=e.statusText,n(e.status,e.statusText,t,e.getAllResponseHeaders())}),e.open(o,i,u),e.responseType=s;for(var f in r)r.hasOwnProperty(f)&&e.setRequestHeader(f,r[f]);e.send(a)},abort:function(){e&&e.abort()}}}})}(jQuery)},{}],"/config.js":[function(t,e,r){(function(r,n){"use strict";"/"===n&&(n="");var i=t(n+"/lib/assert.js"),o=7;i.between(0,o,65536);var s=2,a=r.allocUnsafe(s);a.writeUInt16BE(o,0);var u=a.toString("base64");e.exports={VERSION_STRING:u}}).call(this,t("buffer").Buffer,"/")},{buffer:5}],"/lib/assert.js":[function(t,e,r){"use strict";var n=t("/lib/util-inspect.js"),i={instanceOf:function(t,e){e instanceof Array||(e=[e]);var r=!1,i=!0,o=!1,s=void 0;try{for(var a,u=e[Symbol.iterator]();!(i=(a=u.next()).done);i=!0){var f=a.value;if(t instanceof f||void 0!==t&&null!==t&&t.constructor===f){r=!0;break}}}catch(t){o=!0,s=t}finally{try{!i&&u.return&&u.return()}finally{if(o)throw s}}if(!r)throw new TypeError(n.inspect(t)+" is not an instance of "+e.map(function(t){return t.name}).join(" or "))},integer:function(t){if(i.instanceOf(t,Number),!Number.isSafeInteger(t))throw new RangeError(n.inspect(t)+" is not an integer")},between:function(t,e,r){var i=arguments.length<=3||void 0===arguments[3]?"":arguments[3];if(e=r)throw new RangeError(i+n.inspect(e)+" is not in ["+n.inspect(t)+","+n.inspect(r)+")")},byteUnsignedInteger:function(t){i.integer(t),i.between(0,t,256)},fourByteUnsignedInteger:function(t){i.integer(t),i.between(0,t,4294967296)},fail:function(t){throw new Error(t)},assert:function(t,e){t||i.fail(e)},throws:function(t){var e=!0;try{t(),e=!1}catch(t){}i.assert(e,"Should throw an error")},equal:function(t,e){var r=new RangeError("Expected "+n.inspect(e)+" but got "+n.inspect(t));if(e&&e.constructor===Object){for(var o in e)if(e.hasOwnProperty(o))try{i.equal(t[o],e[o])}catch(t){throw r}}else if(e&&e.constructor===Array){if(!t||t.constructor!==Array)throw r;try{i.equal(t.length,e.length)}catch(t){throw r}for(var s=0;s>>3},modEight:function(t){return 7&t}}},{}],"/lib/buffer-stream.js":[function(t,e,r){(function(r,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=function(){function t(t,e){for(var r=0;rthis.buffer.length){var e=r.allocUnsafe(t<<1);this.buffer.copy(e,0,0,this.size),this.buffer=e}return this}},{key:"set",value:function(t,e){return s.integer(t),s.integer(e),s.between(0,t,this.size,"Index out of bounds: "+String(t)),s.between(0,e,256,"Not a byte: "+String(e)),this.buffer.writeUInt8(e,t),this}},{key:"setAll",value:function(t,e){s.instanceOf(e,r),s.integer(t),s.between(0,t,this.size-e.length+1,"Index out of bounds: "+String(t)),e.copy(this.buffer,t)}},{key:"get",value:function(t){return s.integer(t),s.between(0,t,this.size,"Index out of bounds: "+String(t)),this.buffer.readUInt8(t)}},{key:"add",value:function(t){var e=this.size,r=e+1;return this.grow(r),this.size=r,this.set(e,t),this}},{key:"addAll",value:function(t){s.instanceOf(t,r);var e=this.size,n=this.size+t.length;return this.grow(n),this.size=n,t.copy(this.buffer,e),this}},{key:"toBuffer",value:function(){return this.buffer.slice(0,this.size)}},{key:"length",get:function(){return this.size}},{key:"rawBuffer",get:function(){return this.buffer}}]),t}();e.exports=u}).call(this,t("buffer").Buffer,"/lib")},{buffer:5}],"/lib/strint.js":[function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},i={};!function(){function t(t,e){return B(t)===B(e)}function e(t,e){for(;e>0;)t+="0",e--;return t}function r(t){f(t,"string")}function o(t){r(t),u(t,B,"isPositive")}function s(t){f(t,"number")}function a(t){if(f(t,"number"),t<0)throw new Error("Expected a positive number: "+t)}function u(t,e,r){if(!e.call(null,t))throw new Error("Condition "+r+" failed for value "+t)}function f(t,e){if(("undefined"==typeof t?"undefined":n(t))!==e)throw new Error("Not a "+e+": "+t)}var h=i.subPositive=function(t,e){if(o(t),o(e),!m(t,e))throw new Error("x must be greater or equal to y");for(var r=Math.max(t.length,e.length),n="",i=0,s=0,a=0;a=10;)h-=10,i++;0===h?s++:(n=String(h)+x(n,s),s=0)}return i>0&&(n=String(i)+x(n,s)),n},l=i.add=function(t,e){if(r(t),r(e),B(t)&&B(e))return c(t,e);if(O(t)&&O(e))return k(c(S(t),S(e)));if(_(S(t),S(e))){var n=t;t=e,e=n}var i=h(S(t),S(e));return B(t)?i:k(i)},d=i.sub=function(t,e){return r(t),r(e),l(t,k(e))},p=i.timesDigit=function(t,e){o(t),s(e);for(var r="",n=I(t),i=0,a=0,u=0;u=10;)f-=10,i++;0===f?a++:(r=String(f)+x(r,a),a=0)}return i>0&&(r=String(i)+x(r,a)),0===r.length?"0":r},y=i.mulPositive=function(t,r){o(t),o(r);for(var n="0",i=I(r),s=0;s=I(t)?"0":t.charAt(t.length-e-1)},I=function(t){return O(t)?t.length-1:t.length}}(),i.LONG_UPPER_SHIFT="4294967296",e.exports=i},{}],"/lib/util-inspect.js":[function(t,e,r){"use strict";r.inspect=function(t){if(void 0===t)return"undefined";if(null===t||t.constructor===Object||t.constructor===Array||t.constructor===String||t.constructor===Number||t.constructor===Boolean||t.constructor===Date)return JSON.stringify(t);if(t.constructor===Set){for(var e="Set {",n=t.values(),i=n.next();!i.done;)e+=r.inspect(i.value),i=n.next(),i.done||(e+=", ");return e+"}"}if(t.constructor===Map){for(var o="Map {",s=t.entries(),a=s.next();!a.done;)o+=r.inspect(a.value[0]),o+=" => ",o+=r.inspect(a.value[1]),a=s.next(),a.done||(o+=", ");return o+"}"}return t.constructor.name?t.constructor.name+" "+JSON.stringify(t):JSON.stringify(t)}},{}],"/structure-types.js":[function(t,e,r){(function(r,n){"use strict";function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t){var e=r.allocUnsafe(4);return e.writeUInt32BE(t,0),e}function u(t,e){if(e&&t.pointers){var n=!0,i=!1,o=void 0;try{for(var s,a=t.pointers[Symbol.iterator]();!(n=(s=a.next()).done);n=!0){var u=d(s.value,2),f=u[0],h=u[1],c=t.length;t.addAll(r.from(f,O));var l=r.allocUnsafe(4);l.writeUInt32BE(c);var p=!0,y=!1,g=void 0;try{for(var v,b=h[Symbol.iterator]();!(p=(v=b.next()).done);p=!0){var w=v.value;t.setAll(w,l)}}catch(t){y=!0,g=t}finally{try{!p&&b.return&&b.return()}finally{if(y)throw g}}}}catch(t){i=!0,o=t}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}}}function f(t,e){if(p.instanceOf(t,v),p.instanceOf(e,String),b.gt(e,"18446744073709551615")||b.lt(e,"0"))throw new Error("Value out of range");var n=b.div(e,b.LONG_UPPER_SHIFT),i=b.sub(e,b.mul(n,b.LONG_UPPER_SHIFT)),o=r.allocUnsafe(8);o.writeUInt32BE(Number(n),0),o.writeUInt32BE(Number(i),4),t.addAll(o)}function h(t,e){p.instanceOf(e,Array);var n=E(e.length),i=m(e.length),o=void 0;o=n?i+1:i;var s=r.allocUnsafe(o);n&&(s[o-1]=0);for(var a=0;ae[J])return 1;throw new Error("Should not have any duplicate fields")}),n}return o(e,t),l(e,null,[{key:"_value",get:function(){return 81}}]),l(e,[{key:"addToBuffer",value:function(t){if(c(Object.getPrototypeOf(e.prototype),"addToBuffer",this).call(this,t)){t.add(this.fields.length);var n=!0,i=!1,o=void 0;try{for(var s,a=this.fields[Symbol.iterator]();!(n=(s=a.next()).done);n=!0){var u=s.value,f=r.from(u[J]);t.add(f.length),t.addAll(f),u[X].addToBuffer(t)}}catch(t){i=!0,o=t}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}}}},{key:"writeValue",value:function(t,e){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];p.instanceOf(t,v),p.instanceOf(e,Object);var n=!0,i=!1,o=void 0;try{for(var s,a=this.fields[Symbol.iterator]();!(n=(s=a.next()).done);n=!0){var f=s.value;f[X].writeValue(t,e[f[J]],!1)}}catch(t){i=!0,o=t}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}u(t,r)}}]),e}(k),Q=function(t){function e(t){s(this,e);var r=i(this,Object.getPrototypeOf(e).call(this));return p.instanceOf(t,S),r.type=t,r}return o(e,t),l(e,null,[{key:"_value",get:function(){return 82}}]),l(e,[{key:"addToBuffer",value:function(t){c(Object.getPrototypeOf(e.prototype),"addToBuffer",this).call(this,t)&&this.type.addToBuffer(t)}},{key:"_writeValue",value:function(t,e,r){p.instanceOf(t,v),p.fourByteUnsignedInteger(e.length),t.addAll(a(e.length));var n=!0,i=!1,o=void 0;try{for(var s,f=e[Symbol.iterator]();!(n=(s=f.next()).done);n=!0){var h=s.value;this.type.writeValue(t,h,!1)}}catch(t){i=!0,o=t}finally{try{!n&&f.return&&f.return()}finally{if(i)throw o}}u(t,r)}},{key:"writeValue",value:function(t,e){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];p.instanceOf(e,Array),this._writeValue(t,e,r)}}]),e}(k),Z=function(t){function e(t){return s(this,e),i(this,Object.getPrototypeOf(e).call(this,t))}return o(e,t),l(e,null,[{key:"_value",get:function(){return 83}}]),l(e,[{key:"writeValue",value:function(t,e){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];p.instanceOf(e,Set),e.length=e.size,this._writeValue(t,e,r)}}]),e}(Q),K=function(t){function e(t,r){s(this,e);var n=i(this,Object.getPrototypeOf(e).call(this));return p.instanceOf(t,S),p.instanceOf(r,S),n.keyType=t,n.valueType=r,n}return o(e,t),l(e,null,[{key:"_value",get:function(){return 84}}]),l(e,[{key:"addToBuffer",value:function(t){c(Object.getPrototypeOf(e.prototype),"addToBuffer",this).call(this,t)&&(this.keyType.addToBuffer(t),this.valueType.addToBuffer(t))}},{key:"writeValue",value:function(t,e){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];p.instanceOf(t,v),p.instanceOf(e,Map),p.fourByteUnsignedInteger(e.size),t.addAll(a(e.size));var n=!0,i=!1,o=void 0;try{for(var s,f=e[Symbol.iterator]();!(n=(s=f.next()).done);n=!0){var h=d(s.value,2),c=h[0],l=h[1];this.keyType.writeValue(t,c,!1),this.valueType.writeValue(t,l,!1)}}catch(t){i=!0,o=t}finally{try{!n&&f.return&&f.return()}finally{if(i)throw o}}u(t,r)}}]),e}(k),tt=function(t){function e(t){var r=t.type,n=t.values;s(this,e);var o=i(this,Object.getPrototypeOf(e).call(this));p.instanceOf(r,k),p.instanceOf(n,Array);try{p.byteUnsignedInteger(n.length)}catch(t){throw new Error(String(n.length)+" values is too many")}for(var a=new Map,u=0;u0)throw new Error("Invalid string. Length must be a multiple of 4"); +o="="===t[a-2]?2:"="===t[a-1]?1:0,s=new h(3*a/4-o),n=o>0?a-4:a;var u=0;for(e=0,r=0;e>16&255,s[u++]=i>>8&255,s[u++]=255&i;return 2===o?(i=f[t.charCodeAt(e)]<<2|f[t.charCodeAt(e+1)]>>4,s[u++]=255&i):1===o&&(i=f[t.charCodeAt(e)]<<10|f[t.charCodeAt(e+1)]<<4|f[t.charCodeAt(e+2)]>>2,s[u++]=i>>8&255,s[u++]=255&i),s}function o(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}function s(t,e,r){for(var n,i=[],s=e;sh?h:f+a));return 1===n?(e=t[r-1],i+=u[e>>2],i+=u[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=u[e>>10],i+=u[e>>4&63],i+=u[e<<2&63],i+="="),o.push(i),o.join("")}r.toByteArray=i,r.fromByteArray=a;var u=[],f=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array;n()},{}],3:[function(t,e,r){},{}],4:[function(t,e,r){(function(e){"use strict";var n=t("buffer"),i=n.Buffer,o=n.SlowBuffer,s=n.kMaxLength||2147483647;r.alloc=function(t,e,r){if("function"==typeof i.alloc)return i.alloc(t,e,r);if("number"==typeof r)throw new TypeError("encoding must not be number");if("number"!=typeof t)throw new TypeError("size must be a number");if(t>s)throw new RangeError("size is too large");var n=r,o=e;void 0===o&&(n=void 0,o=0);var a=new i(t);if("string"==typeof o)for(var u=new i(o,n),f=u.length,h=-1;++hs)throw new RangeError("size is too large");return new i(t)},r.from=function(t,r,n){if("function"==typeof i.from&&(!e.Uint8Array||Uint8Array.from!==i.from))return i.from(t,r,n);if("number"==typeof t)throw new TypeError('"value" argument must not be a number');if("string"==typeof t)return new i(t,r);if("undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer){var o=r;if(1===arguments.length)return new i(t);"undefined"==typeof o&&(o=0);var s=n;if("undefined"==typeof s&&(s=t.byteLength-o),o>=t.byteLength)throw new RangeError("'offset' is out of bounds");if(s>t.byteLength-o)throw new RangeError("'length' is out of bounds");return new i(t.slice(o,o+s))}if(i.isBuffer(t)){var a=new i(t.length);return t.copy(a,0,0,t.length),a}if(t){if(Array.isArray(t)||"undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return new i(t);if("Buffer"===t.type&&Array.isArray(t.data))return new i(t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")},r.allocUnsafeSlow=function(t){if("function"==typeof i.allocUnsafeSlow)return i.allocUnsafeSlow(t);if("number"!=typeof t)throw new TypeError("size must be a number");if(t>=s)throw new RangeError("size is too large");return new o(t)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{buffer:5}],5:[function(t,e,r){(function(e){"use strict";function n(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}function i(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t,e){if(i()=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function g(t){return+t!=t&&(t=0),s.alloc(+t)}function v(t,e){if(s.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"binary":case"raw":case"raws":return r;case"utf8":case"utf-8":case void 0:return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(t).length;default:if(n)return F(t).length;e=(""+e).toLowerCase(),n=!0}}function b(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return P(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return R(this,e,r);case"binary":return x(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function w(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function _(t,e,r,n){function i(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var o=1,s=t.length,a=e.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,a/=2,r/=2}for(var u=-1,f=r;fi&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new Error("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s239?4:o>223?3:o>191?2:1;if(i+a<=r){var u,f,h,c;switch(a){case 1:o<128&&(s=o);break;case 2:u=t[i+1],128===(192&u)&&(c=(31&o)<<6|63&u,c>127&&(s=c));break;case 3:u=t[i+1],f=t[i+2],128===(192&u)&&128===(192&f)&&(c=(15&o)<<12|(63&u)<<6|63&f,c>2047&&(c<55296||c>57343)&&(s=c));break;case 4:u=t[i+1],f=t[i+2],h=t[i+3],128===(192&u)&&128===(192&f)&&128===(192&h)&&(c=(15&o)<<18|(63&u)<<12|(63&f)<<6|63&h,c>65535&&c<1114112&&(s=c))}}null===s?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=a}return j(n)}function j(t){var e=t.length;if(e<=K)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function U(t,e,r,n,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function M(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function C(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function D(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(t,e,r,n,i){return i||D(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(t,e,r,n,23,4),r+4}function q(t,e,r,n,i){return i||D(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(t,e,r,n,52,8),r+8}function V(t){if(t=z(t).replace(tt,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function z(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Y(t){return t<16?"0"+t.toString(16):t.toString(16)}function F(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],s=0;s55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function W(t){for(var e=[],r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function G(t){return $.toByteArray(V(t))}function J(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function X(t){return t!==t}var $=t("base64-js"),Q=t("ieee754"),Z=t("isarray");r.Buffer=s,r.SlowBuffer=g,r.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:n(),r.kMaxLength=i(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,e,r){return a(null,t,e,r)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(t,e,r){return f(null,t,e,r)},s.allocUnsafe=function(t){return h(null,t)},s.allocUnsafeSlow=function(t){return h(null,t)},s.isBuffer=function(t){return!(null==t||!t._isBuffer)},s.compare=function(t,e){if(!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},s.prototype.compare=function(t,e,r,n,i){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,a=r-e,u=Math.min(o,a),f=this.slice(n,i),h=t.slice(e,r),c=0;c2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e>>=0,0===this.length)return-1;if(e>=this.length)return-1;if(e<0&&(e=Math.max(this.length+e,0)),"string"==typeof t&&(t=s.from(t,r)),s.isBuffer(t))return 0===t.length?-1:_(this,t,e,r);if("number"==typeof t)return s.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,t,e):_(this,[t],e,r);throw new TypeError("val must be string, number or Buffer")},s.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1},s.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e=0|e,isFinite(r)?(r=0|r,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return m(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":return O(this,t,e,r);case"binary":return B(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var K=4096;s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUInt8=function(t,e){return e||L(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return e||L(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return e||L(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t=0|t,e=0|e,r||L(t,e,this.length);for(var n=this[t],i=1,o=0;++o=i&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t=0|t,e=0|e,r||L(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return e||L(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},s.prototype.readInt16LE=function(t,e){e||L(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){e||L(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return e||L(t,4,this.length),Q.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return e||L(t,4,this.length),Q.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return e||L(t,8,this.length),Q.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return e||L(t,8,this.length),Q.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e=0|e,r=0|r,!n){var i=Math.pow(2,8*r)-1;U(this,t,e,r,i,0)}var o=1,s=0;for(this[e]=255&t;++s=0&&(s*=256);)this[e+o]=t/s&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):M(this,t,e,!0),e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):M(this,t,e,!1),e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):C(this,t,e,!0),e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);U(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);U(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):M(this,t,e,!0),e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):M(this,t,e,!1),e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):C(this,t,e,!0),e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},s.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return q(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return q(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,o,a;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],o=r.length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(s(r)){for(a=o;a-- >0;)if(r[a]===e||r[a].listener&&r[a].listener===e){n=a;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],i(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],8:[function(t,e,r){r.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,h=-7,c=r?i-1:0,l=r?-1:1,d=t[e+c];for(c+=l,o=d&(1<<-h)-1,d>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=l,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+c],c+=l,h-=8);if(0===o)o=1-f;else{if(o===u)return s?NaN:(d?-1:1)*(1/0);s+=Math.pow(2,n),o-=f}return(d?-1:1)*s*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var s,a,u,f=8*o-i-1,h=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),e+=s+c>=1?l/u:l*Math.pow(2,1-c),e*u>=2&&(s++,u/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*u-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<0;t[r+d]=255&s,d+=p,s/=256,f-=8);t[r+d-p]|=128*y}},{}],9:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],10:[function(t,e,r){e.exports=function(t){return!(null==t||!(t._isBuffer||t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)))}},{}],11:[function(t,e,r){var n={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},{}],12:[function(t,e,r){(function(t){"use strict";function r(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,r)});case 3:return t.nextTick(function(){e.call(null,r,n)});case 4:return t.nextTick(function(){e.call(null,r,n,i)});default:for(o=new Array(a-1),s=0;s1)for(var r=1;r0)if(e.ended&&!i){var s=new Error("stream.push() after EOF");t.emit("error",s)}else if(e.endEmitted&&i){var u=new Error("stream.unshift() after end event");t.emit("error",u)}else{var f;!e.decoder||i||n||(r=e.decoder.write(r),f=!e.objectMode&&0===r.length),i||(e.reading=!1),f||(e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&l(t))),p(t,e)}else i||(e.reading=!1);return a(e)}function a(t){return!t.ended&&(t.needReadable||t.length=N?t=N:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function f(t,e){return 0===e.length&&e.ended?0:e.objectMode?0===t?0:1:null===t||isNaN(t)?e.flowing&&e.buffer.length?e.buffer[0].length:e.length:t<=0?0:(t>e.highWaterMark&&(e.highWaterMark=u(t)),t>e.length?e.ended?e.length:(e.needReadable=!0,0):t)}function h(t,e){var r=null;return x.isBuffer(e)||"string"==typeof e||null===e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}function c(t,e){if(!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,l(t)}}function l(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(U("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?k(d,t):d(t))}function d(t){U("emit readable"),t.emit("readable"),_(t)}function p(t,e){e.readingMore||(e.readingMore=!0,k(y,t,e))}function y(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=i)r=o?n.join(""):1===n.length?n[0]:x.concat(n,i),n.length=0;else if(t0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,k(O,e,t))}function O(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function B(t,e){for(var r=0,n=t.length;r0)&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return U("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?E(this):l(this),null;if(t=f(t,e),0===t&&e.ended)return 0===e.length&&E(this),null;var n=e.needReadable;U("need readable",n),(0===e.length||e.length-t0?m(t,e):null,null===i&&(e.needReadable=!0,t=0),e.length-=t,0!==e.length||e.ended||(e.needReadable=!0),r!==t&&e.ended&&0===e.length&&E(this),null!==i&&this.emit("data",i),i},o.prototype._read=function(t){this.emit("error",new Error("not implemented"))},o.prototype.pipe=function(t,e){function i(t){U("onunpipe"),t===l&&s()}function o(){U("onend"),t.end()}function s(){U("cleanup"),t.removeListener("close",f),t.removeListener("finish",h),t.removeListener("drain",v),t.removeListener("error",u),t.removeListener("unpipe",i),l.removeListener("end",o),l.removeListener("end",s),l.removeListener("data",a),b=!0,!d.awaitDrain||t._writableState&&!t._writableState.needDrain||v()}function a(e){U("ondata");var r=t.write(e);!1===r&&((1===d.pipesCount&&d.pipes===t||d.pipesCount>1&&S(d.pipes,t)!==-1)&&!b&&(U("false write response, pause",l._readableState.awaitDrain),l._readableState.awaitDrain++),l.pause())}function u(e){U("onerror",e),c(),t.removeListener("error",u),0===R(t,"error")&&t.emit("error",e)}function f(){t.removeListener("finish",h),c()}function h(){U("onfinish"),t.removeListener("close",f),c()}function c(){U("unpipe"),l.unpipe(t)}var l=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=t;break;case 1:d.pipes=[d.pipes,t];break;default:d.pipes.push(t)}d.pipesCount+=1,U("pipe count=%d opts=%j",d.pipesCount,e);var p=(!e||e.end!==!1)&&t!==r.stdout&&t!==r.stderr,y=p?o:s;d.endEmitted?k(y):l.once("end",y),t.on("unpipe",i);var v=g(l);t.on("drain",v);var b=!1;return l.on("data",a),n(t,"error",u),t.once("close",f),t.once("finish",h),t.emit("pipe",l),d.flowing||(U("pipe resume"),l.resume()),t},o.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this),this);if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;i-1?setImmediate:O;s.WritableState=o;var S=t("core-util-is");S.inherits=t("inherits");var k,T={deprecate:t("util-deprecate")};!function(){try{k=t("stream")}catch(t){}finally{k||(k=t("events").EventEmitter)}}();var A=t("buffer").Buffer,j=t("buffer-shims");S.inherits(s,k);var R;o.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(o.prototype,"buffer",{get:T.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(t){}}();var R;s.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},s.prototype.write=function(t,e,r){var i=this._writableState,o=!1;return"function"==typeof e&&(r=e,e=null),A.isBuffer(t)?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=n),i.ended?a(this,r):u(this,i,t,r)&&(i.pendingcb++,o=h(this,i,t,e,r)),o},s.prototype.cork=function(){var t=this._writableState;t.corked++},s.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||v(this,t))},s.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},s.prototype._write=function(t,e,r){r(new Error("not implemented"))},s.prototype._writev=null,s.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||m(this,n,r)}}).call(this,t("_process"))},{"./_stream_duplex":15,_process:13,buffer:5,"buffer-shims":4,"core-util-is":6,events:7,inherits:9,"process-nextick-args":12,"util-deprecate":34}],20:[function(t,e,r){e.exports=t("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":16}],21:[function(t,e,r){(function(n){var i=function(){try{return t("stream")}catch(t){}}();r=e.exports=t("./lib/_stream_readable.js"),r.Stream=i||r,r.Readable=r,r.Writable=t("./lib/_stream_writable.js"),r.Duplex=t("./lib/_stream_duplex.js"),r.Transform=t("./lib/_stream_transform.js"),r.PassThrough=t("./lib/_stream_passthrough.js"),!n.browser&&"disable"===n.env.READABLE_STREAM&&i&&(e.exports=i)}).call(this,t("_process"))},{"./lib/_stream_duplex.js":15,"./lib/_stream_passthrough.js":16,"./lib/_stream_readable.js":17,"./lib/_stream_transform.js":18,"./lib/_stream_writable.js":19,_process:13}],22:[function(t,e,r){e.exports=t("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":18}],23:[function(t,e,r){e.exports=t("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":19}],24:[function(t,e,r){(function(t){function r(e,r){this._block=new t(e),this._finalSize=r,this._blockSize=e,this._len=0,this._s=0}r.prototype.update=function(e,r){"string"==typeof e&&(r=r||"utf8",e=new t(e,r));for(var n=this._len+=e.length,i=this._s||0,o=0,s=this._block;i=8*this._finalSize&&(this._update(this._block),this._block.fill(0)),this._block.writeInt32BE(e,this._blockSize-4);var r=this._update(this._block)||this._hash();return t?r.toString(t):r},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=r}).call(this,t("buffer").Buffer)},{buffer:5}],25:[function(t,e,r){var r=e.exports=function(t){t=t.toLowerCase();var e=r[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e};r.sha=t("./sha"),r.sha1=t("./sha1"),r.sha224=t("./sha224"),r.sha256=t("./sha256"),r.sha384=t("./sha384"),r.sha512=t("./sha512")},{"./sha":26,"./sha1":27,"./sha224":28,"./sha256":29,"./sha384":30,"./sha512":31}],26:[function(t,e,r){(function(r){function n(){this.init(),this._w=h,u.call(this,64,56)}function i(t){return t<<5|t>>>27}function o(t){return t<<30|t>>>2}function s(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}var a=t("inherits"),u=t("./hash"),f=[1518500249,1859775393,-1894007588,-899497514],h=new Array(80);a(n,u),n.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},n.prototype._update=function(t){for(var e=this._w,r=0|this._a,n=0|this._b,a=0|this._c,u=0|this._d,h=0|this._e,c=0;c<16;++c)e[c]=t.readInt32BE(4*c);for(;c<80;++c)e[c]=e[c-3]^e[c-8]^e[c-14]^e[c-16];for(var l=0;l<80;++l){var d=~~(l/20),p=i(r)+s(d,n,a,u)+h+e[l]+f[d]|0;h=u,u=a,a=o(n),n=r,r=p}this._a=r+this._a|0,this._b=n+this._b|0,this._c=a+this._c|0,this._d=u+this._d|0,this._e=h+this._e|0},n.prototype._hash=function(){var t=new r(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},e.exports=n}).call(this,t("buffer").Buffer)},{"./hash":24,buffer:5,inherits:9}],27:[function(t,e,r){(function(r){function n(){this.init(),this._w=c,f.call(this,64,56)}function i(t){return t<<1|t>>>31}function o(t){return t<<5|t>>>27}function s(t){return t<<30|t>>>2}function a(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}var u=t("inherits"),f=t("./hash"),h=[1518500249,1859775393,-1894007588,-899497514],c=new Array(80);u(n,f),n.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},n.prototype._update=function(t){for(var e=this._w,r=0|this._a,n=0|this._b,u=0|this._c,f=0|this._d,c=0|this._e,l=0;l<16;++l)e[l]=t.readInt32BE(4*l);for(;l<80;++l)e[l]=i(e[l-3]^e[l-8]^e[l-14]^e[l-16]);for(var d=0;d<80;++d){var p=~~(d/20),y=o(r)+a(p,n,u,f)+c+e[d]+h[p]|0;c=f,f=u,u=s(n),n=r,r=y}this._a=r+this._a|0,this._b=n+this._b|0,this._c=u+this._c|0,this._d=f+this._d|0,this._e=c+this._e|0},n.prototype._hash=function(){var t=new r(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},e.exports=n}).call(this,t("buffer").Buffer)},{"./hash":24,buffer:5,inherits:9}],28:[function(t,e,r){(function(r){function n(){this.init(),this._w=a,s.call(this,64,56)}var i=t("inherits"),o=t("./sha256"),s=t("./hash"),a=new Array(64);i(n,o),n.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},n.prototype._hash=function(){var t=new r(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},e.exports=n}).call(this,t("buffer").Buffer)},{"./hash":24,"./sha256":29,buffer:5,inherits:9}],29:[function(t,e,r){(function(r){function n(){this.init(),this._w=d,c.call(this,64,56)}function i(t,e,r){return r^t&(e^r)}function o(t,e,r){return t&e|r&(t|e)}function s(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function a(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function u(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function f(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}var h=t("inherits"),c=t("./hash"),l=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],d=new Array(64);h(n,c),n.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},n.prototype._update=function(t){for(var e=this._w,r=0|this._a,n=0|this._b,h=0|this._c,c=0|this._d,d=0|this._e,p=0|this._f,y=0|this._g,g=0|this._h,v=0;v<16;++v)e[v]=t.readInt32BE(4*v);for(;v<64;++v)e[v]=f(e[v-2])+e[v-7]+u(e[v-15])+e[v-16]|0;for(var b=0;b<64;++b){var w=g+a(d)+i(d,p,y)+l[b]+e[b]|0,_=s(r)+o(r,n,h)|0;g=y,y=p,p=d,d=c+w|0,c=h,h=n,n=r,r=w+_|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=h+this._c|0,this._d=c+this._d|0,this._e=d+this._e|0,this._f=p+this._f|0,this._g=y+this._g|0,this._h=g+this._h|0},n.prototype._hash=function(){var t=new r(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},e.exports=n}).call(this,t("buffer").Buffer)},{"./hash":24,buffer:5,inherits:9}],30:[function(t,e,r){(function(r){function n(){this.init(),this._w=a,s.call(this,128,112)}var i=t("inherits"),o=t("./sha512"),s=t("./hash"),a=new Array(160);i(n,o),n.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},n.prototype._hash=function(){function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}var e=new r(48);return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=n}).call(this,t("buffer").Buffer)},{"./hash":24,"./sha512":31,buffer:5,inherits:9}],31:[function(t,e,r){(function(r){function n(){this.init(),this._w=g,p.call(this,128,112)}function i(t,e,r){return r^t&(e^r)}function o(t,e,r){return t&e|r&(t|e)}function s(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function a(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function u(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function f(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function h(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function c(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function l(t,e){return t>>>0>>0?1:0}var d=t("inherits"),p=t("./hash"),y=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],g=new Array(160);d(n,p),n.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},n.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,d=0|this._ch,p=0|this._dh,g=0|this._eh,v=0|this._fh,b=0|this._gh,w=0|this._hh,_=0|this._al,m=0|this._bl,E=0|this._cl,O=0|this._dl,B=0|this._el,S=0|this._fl,k=0|this._gl,T=0|this._hl,A=0;A<32;A+=2)e[A]=t.readInt32BE(4*A),e[A+1]=t.readInt32BE(4*A+4);for(;A<160;A+=2){var j=e[A-30],R=e[A-30+1],x=u(j,R),P=f(R,j);j=e[A-4],R=e[A-4+1];var I=h(j,R),L=c(R,j),U=e[A-14],M=e[A-14+1],C=e[A-32],D=e[A-32+1],N=P+M|0,q=x+U+l(N,P)|0;N=N+L|0,q=q+I+l(N,L)|0,N=N+D|0,q=q+C+l(N,D)|0,e[A]=q,e[A+1]=N}for(var V=0;V<160;V+=2){q=e[V],N=e[V+1];var z=o(r,n,d),Y=o(_,m,E),F=s(r,_),W=s(_,r),H=a(g,B),G=a(B,g),J=y[V],X=y[V+1],$=i(g,v,b),Q=i(B,S,k),Z=T+G|0,K=w+H+l(Z,T)|0;Z=Z+Q|0,K=K+$+l(Z,Q)|0,Z=Z+X|0,K=K+J+l(Z,X)|0,Z=Z+N|0,K=K+q+l(Z,N)|0;var tt=W+Y|0,et=F+z+l(tt,W)|0;w=b,T=k,b=v,k=S,v=g,S=B,B=O+Z|0,g=p+K+l(B,O)|0,p=d,O=E,d=n,E=m,n=r,m=_,_=Z+tt|0,r=K+et+l(_,Z)|0}this._al=this._al+_|0,this._bl=this._bl+m|0,this._cl=this._cl+E|0,this._dl=this._dl+O|0,this._el=this._el+B|0,this._fl=this._fl+S|0,this._gl=this._gl+k|0,this._hl=this._hl+T|0,this._ah=this._ah+r+l(this._al,_)|0,this._bh=this._bh+n+l(this._bl,m)|0,this._ch=this._ch+d+l(this._cl,E)|0,this._dh=this._dh+p+l(this._dl,O)|0,this._eh=this._eh+g+l(this._el,B)|0,this._fh=this._fh+v+l(this._fl,S)|0,this._gh=this._gh+b+l(this._gl,k)|0,this._hh=this._hh+w+l(this._hl,T)|0},n.prototype._hash=function(){function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}var e=new r(64);return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=n}).call(this,t("buffer").Buffer)},{"./hash":24,buffer:5,inherits:9}],32:[function(t,e,r){function n(){i.call(this)}e.exports=n;var i=t("events").EventEmitter,o=t("inherits");o(n,i),n.Readable=t("readable-stream/readable.js"),n.Writable=t("readable-stream/writable.js"),n.Duplex=t("readable-stream/duplex.js"),n.Transform=t("readable-stream/transform.js"),n.PassThrough=t("readable-stream/passthrough.js"),n.Stream=n,n.prototype.pipe=function(t,e){function r(e){t.writable&&!1===t.write(e)&&f.pause&&f.pause()}function n(){f.readable&&f.resume&&f.resume()}function o(){h||(h=!0,t.end())}function s(){h||(h=!0,"function"==typeof t.destroy&&t.destroy())}function a(t){if(u(),0===i.listenerCount(this,"error"))throw t}function u(){f.removeListener("data",r),t.removeListener("drain",n),f.removeListener("end",o),f.removeListener("close",s),f.removeListener("error",a),t.removeListener("error",a),f.removeListener("end",u),f.removeListener("close",u),t.removeListener("close",u)}var f=this;f.on("data",r),t.on("drain",n),t._isStdio||e&&e.end===!1||(f.on("end",o),f.on("close",s));var h=!1;return f.on("error",a),t.on("error",a),f.on("end",u),f.on("close",u),t.on("close",u),t.emit("pipe",f),t}},{events:7,inherits:9,"readable-stream/duplex.js":14,"readable-stream/passthrough.js":20,"readable-stream/readable.js":21,"readable-stream/transform.js":22,"readable-stream/writable.js":23}],33:[function(t,e,r){function n(t){if(t&&!u(t))throw new Error("Unknown encoding: "+t)}function i(t){return t.toString(this.encoding)}function o(t){this.charReceived=t.length%2,this.charLength=this.charReceived?2:0}function s(t){this.charReceived=t.length%3,this.charLength=this.charReceived?3:0}var a=t("buffer").Buffer,u=a.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},f=r.StringDecoder=function(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),n(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=o; +break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=s;break;default:return void(this.write=i)}this.charBuffer=new a(6),this.charReceived=0,this.charLength=0};f.prototype.write=function(t){for(var e="";this.charLength;){var r=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&n<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var i=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,i),i-=this.charReceived),e+=t.toString(this.encoding,0,i);var i=e.length-1,n=e.charCodeAt(i);if(n>=55296&&n<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),t.copy(this.charBuffer,0,0,o),e.substring(0,i)}return e},f.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var r=t[t.length-e];if(1==e&&r>>5==6){this.charLength=2;break}if(e<=2&&r>>4==14){this.charLength=3;break}if(e<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=e},f.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;e+=n.slice(0,r).toString(i)}return e}},{buffer:5}],34:[function(t,e,r){(function(t){function r(t,e){function r(){if(!i){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}if(n("noDeprecation"))return t;var i=!1;return r}function n(e){try{if(!t.localStorage)return!1}catch(t){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1]); \ No newline at end of file diff --git a/doc/ArrayType.html b/doc/ArrayType.html index 784309d..2127ee6 100644 --- a/doc/ArrayType.html +++ b/doc/ArrayType.html @@ -747,7 +747,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -842,7 +842,7 @@
Returns:
-Buffer +external:Buffer
@@ -857,7 +857,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -1004,7 +1004,7 @@
Returns:
-Buffer +external:Buffer
@@ -1223,7 +1223,7 @@
Example

diff --git a/doc/BooleanArrayType.html b/doc/BooleanArrayType.html index 45ab389..b7ed3c5 100644 --- a/doc/BooleanArrayType.html +++ b/doc/BooleanArrayType.html @@ -697,7 +697,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -792,7 +792,7 @@
Returns:
-Buffer +external:Buffer
@@ -807,7 +807,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -954,7 +954,7 @@
Returns:
-Buffer +external:Buffer
@@ -1168,7 +1168,7 @@
Throws:

diff --git a/doc/BooleanTupleType.html b/doc/BooleanTupleType.html index 6ad1b3b..ae8ee6d 100644 --- a/doc/BooleanTupleType.html +++ b/doc/BooleanTupleType.html @@ -748,7 +748,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -843,7 +843,7 @@
Returns:
-Buffer +external:Buffer
@@ -858,7 +858,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -1005,7 +1005,7 @@
Returns:
-Buffer +external:Buffer
@@ -1219,7 +1219,7 @@
Throws:

diff --git a/doc/BooleanType.html b/doc/BooleanType.html index 9a55311..bbf9236 100644 --- a/doc/BooleanType.html +++ b/doc/BooleanType.html @@ -690,7 +690,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -785,7 +785,7 @@
Returns:
-Buffer +external:Buffer
@@ -800,7 +800,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -947,7 +947,7 @@
Returns:
-Buffer +external:Buffer
@@ -1161,7 +1161,7 @@
Throws:

diff --git a/doc/ByteType.html b/doc/ByteType.html index 3864683..19f096c 100644 --- a/doc/ByteType.html +++ b/doc/ByteType.html @@ -690,7 +690,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -785,7 +785,7 @@
Returns:
-Buffer +external:Buffer
@@ -800,7 +800,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -947,7 +947,7 @@
Returns:
-Buffer +external:Buffer
@@ -1161,7 +1161,7 @@
Throws:

diff --git a/doc/CharType.html b/doc/CharType.html index d77ae90..8d9c698 100644 --- a/doc/CharType.html +++ b/doc/CharType.html @@ -690,7 +690,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -785,7 +785,7 @@
Returns:
-Buffer +external:Buffer
@@ -800,7 +800,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -947,7 +947,7 @@
Returns:
-Buffer +external:Buffer
@@ -1161,7 +1161,7 @@
Throws:

diff --git a/doc/ChoiceType.html b/doc/ChoiceType.html index a80efdc..c3c82d8 100644 --- a/doc/ChoiceType.html +++ b/doc/ChoiceType.html @@ -754,7 +754,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -849,7 +849,7 @@
Returns:
-Buffer +external:Buffer
@@ -864,7 +864,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -1011,7 +1011,7 @@
Returns:
-Buffer +external:Buffer
@@ -1226,7 +1226,7 @@
Example

diff --git a/doc/DateType.html b/doc/DateType.html index adf8388..968514e 100644 --- a/doc/DateType.html +++ b/doc/DateType.html @@ -691,7 +691,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -786,7 +786,7 @@
Returns:
-Buffer +external:Buffer
@@ -801,7 +801,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -948,7 +948,7 @@
Returns:
-Buffer +external:Buffer
@@ -1162,7 +1162,7 @@
Throws:

diff --git a/doc/DoubleType.html b/doc/DoubleType.html index 4a8affa..7267c5b 100644 --- a/doc/DoubleType.html +++ b/doc/DoubleType.html @@ -690,7 +690,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -785,7 +785,7 @@
Returns:
-Buffer +external:Buffer
@@ -800,7 +800,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -947,7 +947,7 @@
Returns:
-Buffer +external:Buffer
@@ -1161,7 +1161,7 @@
Throws:

diff --git a/doc/EnumType.html b/doc/EnumType.html index 92cac1c..3272f97 100644 --- a/doc/EnumType.html +++ b/doc/EnumType.html @@ -827,7 +827,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -922,7 +922,7 @@
Returns:
-Buffer +external:Buffer
@@ -937,7 +937,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -1084,7 +1084,7 @@
Returns:
-Buffer +external:Buffer
@@ -1303,7 +1303,7 @@
Example

diff --git a/doc/FloatType.html b/doc/FloatType.html index fc7b6b8..227963a 100644 --- a/doc/FloatType.html +++ b/doc/FloatType.html @@ -690,7 +690,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -785,7 +785,7 @@
Returns:
-Buffer +external:Buffer
@@ -800,7 +800,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -947,7 +947,7 @@
Returns:
-Buffer +external:Buffer
@@ -1161,7 +1161,7 @@
Throws:

diff --git a/doc/GrowableBuffer.html b/doc/GrowableBuffer.html index 44e8803..0c8ef00 100644 --- a/doc/GrowableBuffer.html +++ b/doc/GrowableBuffer.html @@ -503,7 +503,7 @@
Parameters:
-Buffer +external:Buffer @@ -1178,7 +1178,7 @@
Parameters:
-Buffer +external:Buffer @@ -1284,7 +1284,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -1374,7 +1374,7 @@
Returns:
-Buffer +external:Buffer
@@ -1400,7 +1400,7 @@
Returns:

diff --git a/doc/IntType.html b/doc/IntType.html index fc3c1f4..c1a5d1d 100644 --- a/doc/IntType.html +++ b/doc/IntType.html @@ -690,7 +690,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -785,7 +785,7 @@
Returns:
-Buffer +external:Buffer
@@ -800,7 +800,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -947,7 +947,7 @@
Returns:
-Buffer +external:Buffer
@@ -1161,7 +1161,7 @@
Throws:

diff --git a/doc/LongType.html b/doc/LongType.html index 43b2486..5d48bc0 100644 --- a/doc/LongType.html +++ b/doc/LongType.html @@ -690,7 +690,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -785,7 +785,7 @@
Returns:
-Buffer +external:Buffer
@@ -800,7 +800,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -947,7 +947,7 @@
Returns:
-Buffer +external:Buffer
@@ -1161,7 +1161,7 @@
Throws:

diff --git a/doc/MapType.html b/doc/MapType.html index 51f701c..0e7d791 100644 --- a/doc/MapType.html +++ b/doc/MapType.html @@ -773,7 +773,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -868,7 +868,7 @@
Returns:
-Buffer +external:Buffer
@@ -883,7 +883,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -1030,7 +1030,7 @@
Returns:
-Buffer +external:Buffer
@@ -1253,7 +1253,7 @@
Example

diff --git a/doc/OctetsType.html b/doc/OctetsType.html index b064d6b..57c3af8 100644 --- a/doc/OctetsType.html +++ b/doc/OctetsType.html @@ -692,7 +692,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -787,7 +787,7 @@
Returns:
-Buffer +external:Buffer
@@ -802,7 +802,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -949,7 +949,7 @@
Returns:
-Buffer +external:Buffer
@@ -1036,7 +1036,7 @@
Parameters:
-Buffer +external:Buffer @@ -1163,7 +1163,7 @@
Throws:

diff --git a/doc/OptionalType.html b/doc/OptionalType.html index f91cfa0..bb17794 100644 --- a/doc/OptionalType.html +++ b/doc/OptionalType.html @@ -749,7 +749,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -844,7 +844,7 @@
Returns:
-Buffer +external:Buffer
@@ -859,7 +859,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -1006,7 +1006,7 @@
Returns:
-Buffer +external:Buffer
@@ -1235,7 +1235,7 @@
Example

diff --git a/doc/PointerType.html b/doc/PointerType.html index cb3f4d4..4468bb8 100644 --- a/doc/PointerType.html +++ b/doc/PointerType.html @@ -758,7 +758,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -853,7 +853,7 @@
Returns:
-Buffer +external:Buffer
@@ -868,7 +868,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -1015,7 +1015,7 @@
Returns:
-Buffer +external:Buffer
@@ -1253,7 +1253,7 @@
Example

diff --git a/doc/SetType.html b/doc/SetType.html index ab1417a..8f75fb0 100644 --- a/doc/SetType.html +++ b/doc/SetType.html @@ -748,7 +748,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -843,7 +843,7 @@
Returns:
-Buffer +external:Buffer
@@ -858,7 +858,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -1005,7 +1005,7 @@
Returns:
-Buffer +external:Buffer
@@ -1224,7 +1224,7 @@
Example

diff --git a/doc/ShortType.html b/doc/ShortType.html index e51eed4..8f052e9 100644 --- a/doc/ShortType.html +++ b/doc/ShortType.html @@ -690,7 +690,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -785,7 +785,7 @@
Returns:
-Buffer +external:Buffer
@@ -800,7 +800,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -947,7 +947,7 @@
Returns:
-Buffer +external:Buffer
@@ -1161,7 +1161,7 @@
Throws:

diff --git a/doc/StringType.html b/doc/StringType.html index b474f8b..15f53c1 100644 --- a/doc/StringType.html +++ b/doc/StringType.html @@ -690,7 +690,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -785,7 +785,7 @@
Returns:
-Buffer +external:Buffer
@@ -800,7 +800,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -947,7 +947,7 @@
Returns:
-Buffer +external:Buffer
@@ -1161,7 +1161,7 @@
Throws:

diff --git a/doc/StructType.html b/doc/StructType.html index 239ccd0..2a2fb09 100644 --- a/doc/StructType.html +++ b/doc/StructType.html @@ -751,7 +751,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -846,7 +846,7 @@
Returns:
-Buffer +external:Buffer
@@ -861,7 +861,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -1008,7 +1008,7 @@
Returns:
-Buffer +external:Buffer
@@ -1231,7 +1231,7 @@
Example

diff --git a/doc/TupleType.html b/doc/TupleType.html index 9a0eb7e..a3ac426 100644 --- a/doc/TupleType.html +++ b/doc/TupleType.html @@ -819,7 +819,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -914,7 +914,7 @@
Returns:
-Buffer +external:Buffer
@@ -929,7 +929,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -1076,7 +1076,7 @@
Returns:
-Buffer +external:Buffer
@@ -1295,7 +1295,7 @@
Example

diff --git a/doc/Type.html b/doc/Type.html index d91ed0c..a0709bc 100644 --- a/doc/Type.html +++ b/doc/Type.html @@ -737,7 +737,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -827,7 +827,7 @@
Returns:
-Buffer +external:Buffer
@@ -842,7 +842,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -984,7 +984,7 @@
Returns:
-Buffer +external:Buffer
@@ -1215,7 +1215,7 @@
Throws:

diff --git a/doc/UnsignedByteType.html b/doc/UnsignedByteType.html index 91bd73a..f4a4056 100644 --- a/doc/UnsignedByteType.html +++ b/doc/UnsignedByteType.html @@ -690,7 +690,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -785,7 +785,7 @@
Returns:
-Buffer +external:Buffer
@@ -800,7 +800,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -947,7 +947,7 @@
Returns:
-Buffer +external:Buffer
@@ -1161,7 +1161,7 @@
Throws:

diff --git a/doc/UnsignedIntType.html b/doc/UnsignedIntType.html index f889bb2..5dca187 100644 --- a/doc/UnsignedIntType.html +++ b/doc/UnsignedIntType.html @@ -690,7 +690,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -785,7 +785,7 @@
Returns:
-Buffer +external:Buffer
@@ -800,7 +800,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -947,7 +947,7 @@
Returns:
-Buffer +external:Buffer
@@ -1161,7 +1161,7 @@
Throws:

diff --git a/doc/UnsignedLongType.html b/doc/UnsignedLongType.html index c255bab..8e6e87a 100644 --- a/doc/UnsignedLongType.html +++ b/doc/UnsignedLongType.html @@ -690,7 +690,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -785,7 +785,7 @@
Returns:
-Buffer +external:Buffer
@@ -800,7 +800,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -947,7 +947,7 @@
Returns:
-Buffer +external:Buffer
@@ -1161,7 +1161,7 @@
Throws:

diff --git a/doc/UnsignedShortType.html b/doc/UnsignedShortType.html index 0d3fc2b..6f0a664 100644 --- a/doc/UnsignedShortType.html +++ b/doc/UnsignedShortType.html @@ -690,7 +690,7 @@
Returns:
-

toBuffer() → {Buffer}

+

toBuffer() → {external:Buffer}

@@ -785,7 +785,7 @@
Returns:
-Buffer +external:Buffer
@@ -800,7 +800,7 @@
Returns:
-

valueBuffer(value) → {Buffer}

+

valueBuffer(value) → {external:Buffer}

@@ -947,7 +947,7 @@
Returns:
-Buffer +external:Buffer
@@ -1161,7 +1161,7 @@
Throws:

diff --git a/doc/external-Buffer.html b/doc/external-Buffer.html new file mode 100644 index 0000000..a677d56 --- /dev/null +++ b/doc/external-Buffer.html @@ -0,0 +1,137 @@ + + + + + JSDoc: External: Buffer + + + + + + + + + + +
+ +

External: Buffer

+ + + + + + +
+ +
+ +

Buffer

+ + +
+ +
+
+ + +
The NodeJS Buffer object
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/doc/external-http.IncomingMessage.html b/doc/external-http.IncomingMessage.html new file mode 100644 index 0000000..6fb23cd --- /dev/null +++ b/doc/external-http.IncomingMessage.html @@ -0,0 +1,166 @@ + + + + + JSDoc: Class: IncomingMessage + + + + + + + + + + +
+ +

Class: IncomingMessage

+ + + + + + +
+ +
+ +

+ http.IncomingMessage

+ + +
+ + + +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/doc/external-http.ServerResponse.html b/doc/external-http.ServerResponse.html new file mode 100644 index 0000000..e6001a4 --- /dev/null +++ b/doc/external-http.ServerResponse.html @@ -0,0 +1,166 @@ + + + + + JSDoc: Class: ServerResponse + + + + + + + + + + +
+ +

Class: ServerResponse

+ + + + + + +
+ +
+ +

+ http.ServerResponse

+ + +
+ + + +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/doc/external-http.html b/doc/external-http.html new file mode 100644 index 0000000..dff1c0d --- /dev/null +++ b/doc/external-http.html @@ -0,0 +1,147 @@ + + + + + JSDoc: External: http + + + + + + + + + + +
+ +

External: http

+ + + + + + +
+ +
+ +

http

+ + +
+ + + +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/doc/global.html b/doc/global.html new file mode 100644 index 0000000..035fd3c --- /dev/null +++ b/doc/global.html @@ -0,0 +1,2390 @@ + + + + + JSDoc: Global + + + + + + + + + + +
+ +

Global

+ + + + + + +
+ +
+ +

+ + +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + +

Methods

+ + + + + + +

httpRespond(param, callback)

+ + + + + +
+ Responds to an HTTP(S) request for a value. +Will send both type and value if the sig header +doesn't match the type's signature. +Will only send the value if the signatures match. +Response is gzipped to decrease size. +Calls callback when done. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
param + + +Object + + + + +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
req + + +external:http.IncomingMessage + + + + The client request
res + + +external:http.ServerResponse + + + + The server response
type + + +Type + + + + The type of the message
value + + +type + + + + The value to send
+ +
callback + + +errCallback + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

readType(inStream, callback)

+ + + + + +
+ Reads a type from a readable stream. +This should be used when reading from sources +written to by writeType. +Calls callback with the type when done. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
inStream + + +stream.Readable + + + + The stream to read from
callback + + +typeCallback + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

readTypeAndValue(inStream, callback)

+ + + + + +
+ Reads a type and a value from a readable stream. +This should be used when reading from sources +written to by writeTypeAndValue. +Calls callback with the type and value when done. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
inStream + + +stream.Readable + + + + The stream to read from
callback + + +typeAndValueCallback + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

readValue(param, callback)

+ + + + + +
+ Reads a value from a readable stream. +The Type used to write the value bytes must be known. +This should be used when reading from sources +written to by writeValue. +Calls callback with the value when done. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
param + + +Object + + + + +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +Type + + + + The type that wrote the value bytes
inStream + + +stream.Readable + + + + The stream to read from
+ +
callback + + +valueCallback + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

writeType(param, callbackopt)

+ + + + + +
+ Writes type bytes to a writable stream. +Writes the contents of type.toBuffer() +followed by a null byte. +Calls callback when done. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
param + + +Object + + + + + + + + + + +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +Type + + + + The type to write
outStream + + +stream.Writable + + + + The stream to write to
+ +
callback + + +errCallback + + + + + + <optional>
+ + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

writeTypeAndValue(param, callbackopt)

+ + + + + +
+ Writes both type and value bytes to a writable stream. +Writes the contents of type.toBuffer(), +followed by the contents of type.valueBuffer(value), +and then a null byte. +Calls callback when done. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
param + + +Object + + + + + + + + + + +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +Type + + + + The type to write +and to use to write the value
value + + +type + + + + The value to write
outStream + + +stream.Writable + + + + The stream to write to
+ +
callback + + +errCallback + + + + + + <optional>
+ + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

writeValue(param, callbackopt)

+ + + + + +
+ Writes value bytes to a writable stream. +Writes the contents of type.valueBuffer(value) +followed by a null byte. +Calls callback when done. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
param + + +Object + + + + + + + + + + +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +Type + + + + The type to use to write the value
value + + +type + + + + The value to write
outStream + + +stream.Writable + + + + The stream to write to
+ +
callback + + +errCallback + + + + + + <optional>
+ + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +

Type Definitions

+ + + + + + +

errCallback(err)

+ + + + + +
+ A callback that receives an error object, if any was thrown. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
err + + +null +| + +Error + + + + The error (if any) that occurred
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

typeAndValueCallback(err, type, value)

+ + + + + +
+ A callback that receives an error object, if any was thrown, +and a type and value, if no error was thrown. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
err + + +null +| + +Error + + + + The error (if any) that occurred
type + + +null +| + +Type + + + + The type that was read
value + + +null +| + +type + + + + The value that was read
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

typeCallback(err, type)

+ + + + + +
+ A callback that receives an error object, if any was thrown, +and a type, if no error was thrown. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
err + + +null +| + +Error + + + + The error (if any) that occurred
type + + +null +| + +Type + + + + The type that was read
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

valueCallback(err, value)

+ + + + + +
+ A callback that receives an error object, if any was thrown, +and a value, if no error was thrown. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
err + + +null +| + +Error + + + + The error (if any) that occurred
value + + +null +| + +type + + + + The value that was read
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/doc/index.html b/doc/index.html index 093f5fc..415f394 100644 --- a/doc/index.html +++ b/doc/index.html @@ -145,7 +145,7 @@

Examples

Type creation

Examples

Type creation

Home

Classes

+

Home

Externals

Classes

Global


diff --git a/doc/index.js.html b/doc/index.js.html new file mode 100644 index 0000000..d1ba688 --- /dev/null +++ b/doc/index.js.html @@ -0,0 +1,77 @@ + + + + + JSDoc: Source: index.js + + + + + + + + + + +
+ +

Source: index.js

+ + + + + + +
+
+
/**
+ * The NodeJS Buffer object
+ * @external Buffer
+ * @see {@link https://nodejs.org/api/buffer.html}
+ */
+/**
+ * The NodeJS HTTP library
+ * @external http
+ * @see {@link https://nodejs.org/api/http.html}
+ */
+/**
+ * @class IncomingMessage
+ * @memberof external:http
+ * @see {@link https://nodejs.org/api/http.html#http_class_http_incomingmessage}
+ */
+/**
+ * @class ServerResponse
+ * @memberof external:http
+ * @see {@link https://nodejs.org/api/http.html#http_class_http_serverresponse}
+ */
+
+module.exports = {};
+for (let sbModule of ['config', 'io', 'structure-types']) {
+	sbModule = require(__dirname + '/' + sbModule + '.js');
+	for (let attribute in sbModule) module.exports[attribute] = sbModule[attribute];
+}
+module.exports.r = require(__dirname + '/read.js');
+
+
+ + + + +
+ + + +
+ + + + + + + diff --git a/doc/io.js.html b/doc/io.js.html new file mode 100644 index 0000000..5672130 --- /dev/null +++ b/doc/io.js.html @@ -0,0 +1,276 @@ + + + + + JSDoc: Source: io.js + + + + + + + + + + +
+ +

Source: io.js

+ + + + + + +
+
+
//For use with browserify
+if (__dirname === '/') __dirname = '';
+
+const assert = require(__dirname + '/lib/assert.js');
+const BufferStream = require(__dirname + '/lib/buffer-stream.js');
+const GrowableBuffer = require(__dirname + '/lib/growable-buffer.js');
+const r = require(__dirname + '/read.js');
+const stream = require('stream');
+const t = require(__dirname + '/structure-types.js');
+const zlib = require('zlib');
+
+function close() {
+	this.end();
+}
+
+const io = module.exports = {
+	/**
+	 * A callback that receives an error object, if any was thrown.
+	 * @callback errCallback
+	 * @param {null|Error} err The error (if any) that occurred
+	 */
+	/** @function
+	 * @name writeType
+	 * @desc Writes type bytes to a writable stream.
+	 * Writes the contents of [type.toBuffer()]{@link Type#toBuffer}
+	 * followed by a null byte.
+	 * Calls {@link callback} when done.
+	 * @param {{type, outStream}} param
+	 * @param {Type} param.type The type to write
+	 * @param {stream.Writable} param.outStream The stream to write to
+	 * @param {errCallback=} callback
+	 */
+	writeType({type, outStream}, callback) {
+		assert.instanceOf(type, t.Type);
+		assert.instanceOf(outStream, [stream.Writable, stream.Duplex]);
+		if (callback === undefined) callback = () => {};
+		assert.instanceOf(callback, Function);
+		return new BufferStream(type.toBuffer()).pipe(outStream).on('error', function(err) {
+			this.end();
+			callback(err);
+		}).on('finish', () => callback(null));
+	},
+	/** @function
+	 * @name writeValue
+	 * @desc Writes value bytes to a writable stream.
+	 * Writes the contents of [type.valueBuffer(value)]{@link Type#valueBuffer}
+	 * followed by a null byte.
+	 * Calls {@link callback} when done.
+	 * @param {{type, value, outStream}} param
+	 * @param {Type} param.type The type to use to write the value
+	 * @param {type} param.value The value to write
+	 * @param {stream.Writable} param.outStream The stream to write to
+	 * @param {errCallback=} callback
+	 */
+	writeValue({type, value, outStream}, callback) {
+		assert.instanceOf(type, t.Type);
+		assert.instanceOf(outStream, [stream.Writable, stream.Duplex]);
+		if (callback === undefined) callback = () => {};
+		assert.instanceOf(callback, Function);
+		const valueBuffer = new GrowableBuffer;
+		type.writeValue(valueBuffer, value);
+		return new BufferStream(valueBuffer).pipe(outStream).on('error', function(err) {
+			this.end();
+			callback(err);
+		}).on('finish', () => callback(null));
+	},
+	/** @function
+	 * @name writeTypeAndValue
+	 * @desc Writes both type and value bytes to a writable stream.
+	 * Writes the contents of [type.toBuffer()]{@link Type#toBuffer},
+	 * followed by the contents of [type.valueBuffer(value)]{@link Type#valueBuffer},
+	 * and then a null byte.
+	 * Calls {@link callback} when done.
+	 * @param {{type, value, outStream}} param
+	 * @param {Type} param.type The type to write
+	 * and to use to write the value
+	 * @param {type} param.value The value to write
+	 * @param {stream.Writable} param.outStream The stream to write to
+	 * @param {errCallback=} callback
+	 */
+	writeTypeAndValue({type, value, outStream}, callback) {
+		assert.instanceOf(type, t.Type);
+		assert.instanceOf(outStream, [stream.Writable, stream.Duplex]);
+		if (callback === undefined) callback = () => {};
+		assert.instanceOf(callback, Function);
+		const typeStream = new BufferStream(type.toBuffer());
+		typeStream.pipe(outStream, {end: false}).on('error', close);
+		typeStream.on('bs-written', () => { //can't listen for finish because it isn't called on a pipe without an end
+			io.writeValue({type, value, outStream}, callback);
+		});
+		return outStream;
+	},
+	/**
+	 * A callback that receives an error object, if any was thrown,
+	 * and a type, if no error was thrown.
+	 * @callback typeCallback
+	 * @param {null|Error} err The error (if any) that occurred
+	 * @param {null|Type} type The type that was read
+	 */
+	/** @function
+	 * @name readType
+	 * @desc Reads a type from a readable stream.
+	 * This should be used when reading from sources
+	 * written to by {@link writeType}.
+	 * Calls {@link callback} with the type when done.
+	 * @param {stream.Readable} inStream The stream to read from
+	 * @param {typeCallback} callback
+	 */
+	readType(inStream, callback) {
+		assert.instanceOf(inStream, stream.Readable);
+		assert.instanceOf(callback, Function);
+		const segments = [];
+		inStream.on('data', (chunk) => segments.push(chunk));
+		inStream.on('error', close).on('error', (err) => callback(err, null));
+		inStream.on('end', () => {
+			const buffer = Buffer.concat(segments);
+			let type;
+			try { type = r.type(buffer, false) } //eslint-disable-line semi
+			catch (e) { callback(e, null) } //eslint-disable-line semi
+			if (type) callback(null, type);
+		});
+	},
+	/**
+	 * A callback that receives an error object, if any was thrown,
+	 * and a value, if no error was thrown.
+	 * @callback valueCallback
+	 * @param {null|Error} err The error (if any) that occurred
+	 * @param {null|type} value The value that was read
+	 */
+	/** @function
+	 * @name readValue
+	 * @desc Reads a value from a readable stream.
+	 * The {@link Type} used to write the value bytes must be known.
+	 * This should be used when reading from sources
+	 * written to by {@link writeValue}.
+	 * Calls {@link callback} with the value when done.
+	 * @param {{type, inStream}} param
+	 * @param {Type} param.type The type that wrote the value bytes
+	 * @param {stream.Readable} param.inStream The stream to read from
+	 * @param {valueCallback} callback
+	 */
+	readValue({type, inStream}, callback) {
+		assert.instanceOf(inStream, stream.Readable);
+		assert.instanceOf(callback, Function);
+		const segments = [];
+		inStream.on('data', (chunk) => segments.push(chunk));
+		inStream.on('error', close).on('error', (err) => callback(err, null));
+		inStream.on('end', () => {
+			const buffer = Buffer.concat(segments);
+			let value;
+			try { value = r.value({buffer, type}) } //eslint-disable-line semi
+			catch (e) { callback(e, null) } //eslint-disable-line semi
+			if (value) callback(null, value);
+		});
+	},
+	/**
+	 * A callback that receives an error object, if any was thrown,
+	 * and a type and value, if no error was thrown.
+	 * @callback typeAndValueCallback
+	 * @param {null|Error} err The error (if any) that occurred
+	 * @param {null|Type} type The type that was read
+	 * @param {null|type} value The value that was read
+	 */
+	/** @function
+	 * @name readTypeAndValue
+	 * @desc Reads a type and a value from a readable stream.
+	 * This should be used when reading from sources
+	 * written to by {@link writeTypeAndValue}.
+	 * Calls {@link callback} with the type and value when done.
+	 * @param {stream.Readable} inStream The stream to read from
+	 * @param {typeAndValueCallback} callback
+	 */
+	readTypeAndValue(inStream, callback) {
+		assert.instanceOf(inStream, stream.Readable);
+		assert.instanceOf(callback, Function);
+		const segments = [];
+		inStream.on('data', (chunk) => segments.push(chunk));
+		inStream.on('error', close).on('error', (err) => callback(err, null, null));
+		inStream.on('end', () => {
+			const buffer = Buffer.concat(segments);
+			let type;
+			try { type = r._consumeType(buffer, 0) } //eslint-disable-line semi
+			catch (e) { callback(e, null, null) } //eslint-disable-line semi
+			if (type) {
+				let value;
+				try { value = r.value({buffer, offset: type.length, type: type.value}) } //eslint-disable-line semi
+				catch (e) { callback(e, null, null) } //eslint-disable-line semi
+				if (value) callback(null, type.value, value);
+			}
+		});
+	},
+	/** @function
+	 * @name httpRespond
+	 * @desc Responds to an HTTP(S) request for a value.
+	 * Will send both type and value if the {@link sig} header
+	 * doesn't match the type's signature.
+	 * Will only send the value if the signatures match.
+	 * Response is gzipped to decrease size.
+	 * Calls {@link callback} when done.
+	 * @param {{req, res, type, value}} param
+	 * @param {external:http.IncomingMessage} param.req The client request
+	 * @param {external:http.ServerResponse} param.res The server response
+	 * @param {Type} param.type The type of the message
+	 * @param {type} param.value The value to send
+	 * @param {errCallback} callback
+	 */
+	httpRespond({req, res, type, value}, callback) {
+		assert.instanceOf(type, t.Type);
+		if (callback === undefined) callback = () => {};
+		assert.instanceOf(callback, Function);
+		res.setHeader('Content-Type', 'application/octet-stream');
+		res.setHeader('Content-Encoding', 'gzip');
+		res.setHeader('sig', type.getSignature());
+		const outStream = zlib.createGzip(); //eslint-disable-line no-undef
+		if (req.headers.sig && req.headers.sig === type.getSignature()) io.writeValue({type, value, outStream}, (err) => {
+			if (err) callback(err);
+		});
+		else io.writeTypeAndValue({type, value, outStream}, (err) => {
+			if (err) callback(err);
+		});
+		outStream.pipe(res).on('error', (err) => {
+			this.close();
+			callback(err);
+		}).on('finish', () => callback(null));
+	}
+};
+
+
+ + + + +
+ + + +
+ + + + + + + diff --git a/doc/lib_growable-buffer.js.html b/doc/lib_growable-buffer.js.html index 6f71add..791a38b 100644 --- a/doc/lib_growable-buffer.js.html +++ b/doc/lib_growable-buffer.js.html @@ -103,7 +103,7 @@

Source: lib/growable-buffer.js

* Each byte must lie in the occupied portion * of the internal buffer. * @param {number} index The position of the first byte (0-indexed) - * @param {Buffer} buffer The values to write, starting at {@link index} + * @param {external:Buffer} buffer The values to write, starting at {@link index} * (the byte at position {@link i} in {@link buffer} will be written to * position {@link index+i} of the {@link GrowableBuffer}) * @return {GrowableBuffer} {@link this} @@ -145,7 +145,7 @@

Source: lib/growable-buffer.js

* Adds a contiguous set of bytes after * the end of the occupied portion * of the internal buffer - * @param {Buffer} buffer The bytes to add + * @param {external:Buffer} buffer The bytes to add * the byte at position {@link i} in {@link buffer} will be written to * position {@link this.length+i} of the {@link GrowableBuffer}) * @return {GrowableBuffer} {@link this} @@ -163,14 +163,14 @@

Source: lib/growable-buffer.js

* Gets the internal buffer to avoid calling {@link Buffer#slice} * @private * @readonly - * @type {Buffer} + * @type {external:Buffer} */ get rawBuffer() { return this.buffer; } /** * Gets the occupied portion in {@link Buffer} form. - * @return {Buffer} The internal buffer trimmed to + * @return {external:Buffer} The internal buffer trimmed to * [this.length]{@link GrowableBuffer#length} */ toBuffer() { @@ -187,7 +187,7 @@

Source: lib/growable-buffer.js


diff --git a/doc/structure-types.js.html b/doc/structure-types.js.html index f32bfde..84869ff 100644 --- a/doc/structure-types.js.html +++ b/doc/structure-types.js.html @@ -108,7 +108,7 @@

Source: structure-types.js

/** * Gets the type in buffer form, using a cached value if present. * Since types are immutable, the result should never change from the cached value. - * @return {Buffer} A Buffer containing the type bytes + * @return {external:Buffer} A Buffer containing the type bytes */ toBuffer() { if (!this.cachedBuffer) this.cachedBuffer = this._toBuffer(); @@ -118,7 +118,7 @@

Source: structure-types.js

* Generates the type buffer, recomputed each time * @private * @see Type#toBuffer - * @return {Buffer} A Buffer containing the type bytes + * @return {external:Buffer} A Buffer containing the type bytes */ _toBuffer() { const buffer = new GrowableBuffer; @@ -178,7 +178,7 @@

Source: structure-types.js

* See this type's {@link writeValue()} documentation * for acceptable values. * @param value The value to write - * @return {Buffer} a {@link Buffer} storing the value (assuming the type is known) + * @return {external:Buffer} a {@link Buffer} storing the value (assuming the type is known) * @see Type#writeValue */ valueBuffer(value) { @@ -654,7 +654,7 @@

Source: structure-types.js

/** * Appends value bytes to a {@link GrowableBuffer} according to the type * @param {GrowableBuffer} buffer The buffer to which to append - * @param {Buffer} value The value to write + * @param {external:Buffer} value The value to write * @throws {Error} If the value doesn't match the type, e.g. {@link new sb.StringType().writeValue(buffer, 23)} */ writeValue(buffer, value) { @@ -1243,7 +1243,7 @@

Source: structure-types.js


diff --git a/index.js b/index.js index 65165a3..46c389f 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,27 @@ -let combined = {}; -for (let module of ['config', 'io', 'read', 'structure-types']) { - module = require(__dirname + '/' + module + '.js'); - for (let attribute in module) combined[attribute] = module[attribute]; +/** + * The NodeJS Buffer object + * @external Buffer + * @see {@link https://nodejs.org/api/buffer.html} + */ +/** + * The NodeJS HTTP library + * @external http + * @see {@link https://nodejs.org/api/http.html} + */ +/** + * @class IncomingMessage + * @memberof external:http + * @see {@link https://nodejs.org/api/http.html#http_class_http_incomingmessage} + */ +/** + * @class ServerResponse + * @memberof external:http + * @see {@link https://nodejs.org/api/http.html#http_class_http_serverresponse} + */ + +module.exports = {}; +for (let sbModule of ['config', 'io', 'structure-types']) { + sbModule = require(__dirname + '/' + sbModule + '.js'); + for (let attribute in sbModule) module.exports[attribute] = sbModule[attribute]; } -module.exports = combined; \ No newline at end of file +module.exports.r = require(__dirname + '/read.js'); \ No newline at end of file diff --git a/io.js b/io.js index dea8c3f..394186b 100644 --- a/io.js +++ b/io.js @@ -14,6 +14,22 @@ function close() { } const io = module.exports = { + /** + * A callback that receives an error object, if any was thrown. + * @callback errCallback + * @param {null|Error} err The error (if any) that occurred + */ + /** @function + * @name writeType + * @desc Writes type bytes to a writable stream. + * Writes the contents of [type.toBuffer()]{@link Type#toBuffer} + * followed by a null byte. + * Calls {@link callback} when done. + * @param {{type, outStream}} param + * @param {Type} param.type The type to write + * @param {stream.Writable} param.outStream The stream to write to + * @param {errCallback=} callback + */ writeType({type, outStream}, callback) { assert.instanceOf(type, t.Type); assert.instanceOf(outStream, [stream.Writable, stream.Duplex]); @@ -24,6 +40,18 @@ const io = module.exports = { callback(err); }).on('finish', () => callback(null)); }, + /** @function + * @name writeValue + * @desc Writes value bytes to a writable stream. + * Writes the contents of [type.valueBuffer(value)]{@link Type#valueBuffer} + * followed by a null byte. + * Calls {@link callback} when done. + * @param {{type, value, outStream}} param + * @param {Type} param.type The type to use to write the value + * @param {type} param.value The value to write + * @param {stream.Writable} param.outStream The stream to write to + * @param {errCallback=} callback + */ writeValue({type, value, outStream}, callback) { assert.instanceOf(type, t.Type); assert.instanceOf(outStream, [stream.Writable, stream.Duplex]); @@ -36,6 +64,20 @@ const io = module.exports = { callback(err); }).on('finish', () => callback(null)); }, + /** @function + * @name writeTypeAndValue + * @desc Writes both type and value bytes to a writable stream. + * Writes the contents of [type.toBuffer()]{@link Type#toBuffer}, + * followed by the contents of [type.valueBuffer(value)]{@link Type#valueBuffer}, + * and then a null byte. + * Calls {@link callback} when done. + * @param {{type, value, outStream}} param + * @param {Type} param.type The type to write + * and to use to write the value + * @param {type} param.value The value to write + * @param {stream.Writable} param.outStream The stream to write to + * @param {errCallback=} callback + */ writeTypeAndValue({type, value, outStream}, callback) { assert.instanceOf(type, t.Type); assert.instanceOf(outStream, [stream.Writable, stream.Duplex]); @@ -48,6 +90,22 @@ const io = module.exports = { }); return outStream; }, + /** + * A callback that receives an error object, if any was thrown, + * and a type, if no error was thrown. + * @callback typeCallback + * @param {null|Error} err The error (if any) that occurred + * @param {null|Type} type The type that was read + */ + /** @function + * @name readType + * @desc Reads a type from a readable stream. + * This should be used when reading from sources + * written to by {@link writeType}. + * Calls {@link callback} with the type when done. + * @param {stream.Readable} inStream The stream to read from + * @param {typeCallback} callback + */ readType(inStream, callback) { assert.instanceOf(inStream, stream.Readable); assert.instanceOf(callback, Function); @@ -62,7 +120,26 @@ const io = module.exports = { if (type) callback(null, type); }); }, - readValue({inStream, type}, callback) { + /** + * A callback that receives an error object, if any was thrown, + * and a value, if no error was thrown. + * @callback valueCallback + * @param {null|Error} err The error (if any) that occurred + * @param {null|type} value The value that was read + */ + /** @function + * @name readValue + * @desc Reads a value from a readable stream. + * The {@link Type} used to write the value bytes must be known. + * This should be used when reading from sources + * written to by {@link writeValue}. + * Calls {@link callback} with the value when done. + * @param {{type, inStream}} param + * @param {Type} param.type The type that wrote the value bytes + * @param {stream.Readable} param.inStream The stream to read from + * @param {valueCallback} callback + */ + readValue({type, inStream}, callback) { assert.instanceOf(inStream, stream.Readable); assert.instanceOf(callback, Function); const segments = []; @@ -76,6 +153,23 @@ const io = module.exports = { if (value) callback(null, value); }); }, + /** + * A callback that receives an error object, if any was thrown, + * and a type and value, if no error was thrown. + * @callback typeAndValueCallback + * @param {null|Error} err The error (if any) that occurred + * @param {null|Type} type The type that was read + * @param {null|type} value The value that was read + */ + /** @function + * @name readTypeAndValue + * @desc Reads a type and a value from a readable stream. + * This should be used when reading from sources + * written to by {@link writeTypeAndValue}. + * Calls {@link callback} with the type and value when done. + * @param {stream.Readable} inStream The stream to read from + * @param {typeAndValueCallback} callback + */ readTypeAndValue(inStream, callback) { assert.instanceOf(inStream, stream.Readable); assert.instanceOf(callback, Function); @@ -95,6 +189,21 @@ const io = module.exports = { } }); }, + /** @function + * @name httpRespond + * @desc Responds to an HTTP(S) request for a value. + * Will send both type and value if the {@link sig} header + * doesn't match the type's signature. + * Will only send the value if the signatures match. + * Response is gzipped to decrease size. + * Calls {@link callback} when done. + * @param {{req, res, type, value}} param + * @param {external:http.IncomingMessage} param.req The client request + * @param {external:http.ServerResponse} param.res The server response + * @param {Type} param.type The type of the message + * @param {type} param.value The value to send + * @param {errCallback} callback + */ httpRespond({req, res, type, value}, callback) { assert.instanceOf(type, t.Type); if (callback === undefined) callback = () => {}; diff --git a/jsdoc.sh b/jsdoc.sh index 87972e5..4f78830 100644 --- a/jsdoc.sh +++ b/jsdoc.sh @@ -4,6 +4,8 @@ which jsdoc > /dev/null jsdoc --verbose -c js-conf.json \ README.md \ structure-types.js \ -lib/growable-buffer.js +io.js \ +lib/growable-buffer.js \ +index.js rm -r doc mv out doc \ No newline at end of file diff --git a/lib/growable-buffer.js b/lib/growable-buffer.js index 875b016..9594ae2 100644 --- a/lib/growable-buffer.js +++ b/lib/growable-buffer.js @@ -75,7 +75,7 @@ class GrowableBuffer { * Each byte must lie in the occupied portion * of the internal buffer. * @param {number} index The position of the first byte (0-indexed) - * @param {Buffer} buffer The values to write, starting at {@link index} + * @param {external:Buffer} buffer The values to write, starting at {@link index} * (the byte at position {@link i} in {@link buffer} will be written to * position {@link index+i} of the {@link GrowableBuffer}) * @return {GrowableBuffer} {@link this} @@ -117,7 +117,7 @@ class GrowableBuffer { * Adds a contiguous set of bytes after * the end of the occupied portion * of the internal buffer - * @param {Buffer} buffer The bytes to add + * @param {external:Buffer} buffer The bytes to add * the byte at position {@link i} in {@link buffer} will be written to * position {@link this.length+i} of the {@link GrowableBuffer}) * @return {GrowableBuffer} {@link this} @@ -135,14 +135,14 @@ class GrowableBuffer { * Gets the internal buffer to avoid calling {@link Buffer#slice} * @private * @readonly - * @type {Buffer} + * @type {external:Buffer} */ get rawBuffer() { return this.buffer; } /** * Gets the occupied portion in {@link Buffer} form. - * @return {Buffer} The internal buffer trimmed to + * @return {external:Buffer} The internal buffer trimmed to * [this.length]{@link GrowableBuffer#length} */ toBuffer() { diff --git a/package.json b/package.json index f1f7708..fabbb59 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "structure-bytes", - "version": "1.0.7", + "version": "2.0.7", "description": "Efficiently stores data of any shape by separating it into structure and value", "main": "index.js", "devDependencies": { diff --git a/structure-types.js b/structure-types.js index 28f0ba7..d16d1d7 100644 --- a/structure-types.js +++ b/structure-types.js @@ -80,7 +80,7 @@ class Type { /** * Gets the type in buffer form, using a cached value if present. * Since types are immutable, the result should never change from the cached value. - * @return {Buffer} A Buffer containing the type bytes + * @return {external:Buffer} A Buffer containing the type bytes */ toBuffer() { if (!this.cachedBuffer) this.cachedBuffer = this._toBuffer(); @@ -90,7 +90,7 @@ class Type { * Generates the type buffer, recomputed each time * @private * @see Type#toBuffer - * @return {Buffer} A Buffer containing the type bytes + * @return {external:Buffer} A Buffer containing the type bytes */ _toBuffer() { const buffer = new GrowableBuffer; @@ -150,7 +150,7 @@ class Type { * See this type's {@link writeValue()} documentation * for acceptable values. * @param value The value to write - * @return {Buffer} a {@link Buffer} storing the value (assuming the type is known) + * @return {external:Buffer} a {@link Buffer} storing the value (assuming the type is known) * @see Type#writeValue */ valueBuffer(value) { @@ -626,7 +626,7 @@ class OctetsType extends AbsoluteType { /** * Appends value bytes to a {@link GrowableBuffer} according to the type * @param {GrowableBuffer} buffer The buffer to which to append - * @param {Buffer} value The value to write + * @param {external:Buffer} value The value to write * @throws {Error} If the value doesn't match the type, e.g. {@link new sb.StringType().writeValue(buffer, 23)} */ writeValue(buffer, value) { diff --git a/test/main.js b/test/main.js index d680d35..a45fdbc 100644 --- a/test/main.js +++ b/test/main.js @@ -6,7 +6,7 @@ const assert = require(__dirname + '/../lib/assert.js'); const BufferStream = require(__dirname + '/../lib/buffer-stream.js'); const GrowableBuffer = require(__dirname + '/../lib/growable-buffer.js'); const io = index; -const r = index; +const r = index.r; const ReplaceStream = require(__dirname + '/../lib/replace-stream.js'); const Simultaneity = require(__dirname + '/../lib/simultaneity.js'); const t = index;