msgpack-lite 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/msgpack.min.js +1 -1
- package/lib/read-format.js +10 -0
- package/package.json +3 -2
package/dist/msgpack.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).msgpack=t()}(function(){return function n(i,o,f){function u(r,t){if(!o[r]){if(!i[r]){var e="function"==typeof require&&require;if(!t&&e)return e(r,!0);if(a)return a(r,!0);throw(t=new Error("Cannot find module '"+r+"'")).code="MODULE_NOT_FOUND",t}e=o[r]={exports:{}},i[r][0].call(e.exports,function(t){return u(i[r][1][t]||t)},e,e.exports,n,i,o,f)}return o[r].exports}for(var a="function"==typeof require&&require,t=0;t<f.length;t++)u(f[t]);return u}({1:[function(t,r,e){e.encode=t("./encode").encode,e.decode=t("./decode").decode,e.Encoder=t("./encoder").Encoder,e.Decoder=t("./decoder").Decoder,e.createCodec=t("./ext").createCodec,e.codec=t("./codec").codec},{"./codec":10,"./decode":12,"./decoder":13,"./encode":15,"./encoder":16,"./ext":20}],2:[function(t,r,e){!function(Buffer){!function(){function t(t){return t&&t.isBuffer&&t}r.exports=t(void 0!==Buffer&&Buffer)||t(this.Buffer)||t("undefined"!=typeof window&&window.Buffer)||this.Buffer}.call(this)}.call(this,t("buffer").Buffer)},{buffer:30}],3:[function(t,r,e){e.copy=function(t,r,e,n){var i;e=e||0;n||0===n||(n=this.length);r=r||0;var o=n-e;if(t===this&&e<r&&r<n)for(i=o-1;0<=i;i--)t[i+r]=this[i+e];else for(i=0;i<o;i++)t[i+r]=this[i+e];return o},e.toString=function(t,r,e){var n=this,i=0|r;e=e||n.length;var o="",f=0;for(;i<e;)!((f=n[i++])<128)&&(192==(224&f)?f=(31&f)<<6|63&n[i++]:224==(240&f)?f=(15&f)<<12|(63&n[i++])<<6|63&n[i++]:240==(248&f)&&(f=(7&f)<<18|(63&n[i++])<<12|(63&n[i++])<<6|63&n[i++]),65536<=f)?(f-=65536,o+=String.fromCharCode(55296+(f>>>10),56320+(1023&f))):o+=String.fromCharCode(f);return o},e.write=function(t,r){var e=this,n=r||(r|=0),i=t.length,o=0,f=0;for(;f<i;)(o=t.charCodeAt(f++))<128?e[n++]=o:(o<2048?e[n++]=192|o>>>6:(o<55296||57343<o?e[n++]=224|o>>>12:(o=65536+(o-55296<<10|t.charCodeAt(f++)-56320),e[n++]=240|o>>>18,e[n++]=128|o>>>12&63),e[n++]=128|o>>>6&63),e[n++]=128|63&o);return n-r}},{}],4:[function(t,r,e){var n=t("./bufferish");function i(t){return new Array(t)}(e=r.exports=i(0)).alloc=i,e.concat=n.concat,e.from=function(t){if(!n.isBuffer(t)&&n.isView(t))t=n.Uint8Array.from(t);else if(n.isArrayBuffer(t))t=new Uint8Array(t);else{if("string"==typeof t)return n.from.call(e,t);if("number"==typeof t)throw new TypeError('"value" argument must not be a number')}return Array.prototype.slice.call(t)}},{"./bufferish":8}],5:[function(t,r,e){var n=t("./bufferish"),Buffer=n.global;function i(t){return new Buffer(t)}(e=r.exports=n.hasBuffer?Buffer.alloc?Buffer.alloc(0):i(0):[]).alloc=n.hasBuffer&&Buffer.alloc||i,e.concat=n.concat,e.from=function(t){if(!n.isBuffer(t)&&n.isView(t))t=n.Uint8Array.from(t);else if(n.isArrayBuffer(t))t=new Uint8Array(t);else{if("string"==typeof t)return n.from.call(e,t);if("number"==typeof t)throw new TypeError('"value" argument must not be a number')}return Buffer.from&&1!==Buffer.from.length?Buffer.from(t):new Buffer(t)}},{"./bufferish":8}],6:[function(t,r,e){var n,f=t("./buffer-lite"),u=(e.copy=o,e.slice=s,e.toString=function(t,r,e){return(!i&&u.isBuffer(this)?this:f).toString.apply(this,arguments)},e.write=(n="write",function(){return(this[n]||f[n]).apply(this,arguments)}),t("./bufferish")),e=u.global,i=u.hasBuffer&&"TYPED_ARRAY_SUPPORT"in e,a=i&&!e.TYPED_ARRAY_SUPPORT;function o(t,r,e,n){var i=u.isBuffer(this),o=u.isBuffer(t);return i&&o?this.copy(t,r,e,n):a||i||o||!u.isView(this)||!u.isView(t)?f.copy.call(this,t,r,e,n):(i=e||null!=n?s.call(this,e,n):this,t.set(i,r),i.length)}function s(t,r){var e=this.slice||!a&&this.subarray;return e?e.call(this,t,r):(e=u.alloc.call(this,r-t),o.call(this,e,0,t,r),e)}},{"./buffer-lite":3,"./bufferish":8}],7:[function(t,r,n){var i=t("./bufferish");function e(t){return new Uint8Array(t)}(n=r.exports=i.hasArrayBuffer?e(0):[]).alloc=e,n.concat=i.concat,n.from=function(t){if(i.isView(t)){var r=t.byteOffset,e=t.byteLength;(t=t.buffer).byteLength!==e&&(t.slice?t=t.slice(r,r+e):(t=new Uint8Array(t)).byteLength!==e&&(t=Array.prototype.slice.call(t,r,r+e)))}else{if("string"==typeof t)return i.from.call(n,t);if("number"==typeof t)throw new TypeError('"value" argument must not be a number')}return new Uint8Array(t)}},{"./bufferish":8}],8:[function(t,r,o){var Buffer=o.global=t("./buffer-global"),e=o.hasBuffer=Buffer&&!!Buffer.isBuffer,n=o.hasArrayBuffer="undefined"!=typeof ArrayBuffer,i=o.isArray=t("isarray"),f=(o.isArrayBuffer=n?function(t){return t instanceof ArrayBuffer||p(t)}:y,o.isBuffer=e?Buffer.isBuffer:y),u=o.isView=n?ArrayBuffer.isView||g("ArrayBuffer","buffer"):y,a=(o.alloc=l,o.concat=function(t,r){r||(r=0,Array.prototype.forEach.call(t,function(t){r+=t.length}));var e=this!==o&&this||t[0],n=l.call(e,r),i=0;return Array.prototype.forEach.call(t,function(t){i+=h.copy.call(t,n,i)}),n},o.from=function(t){return"string"==typeof t?function(t){var r=3*t.length,e=l.call(this,r),t=h.write.call(e,t);r!==t&&(e=h.slice.call(e,0,t));return e}.call(this,t):d(this).from(t)},o.Array=t("./bufferish-array")),s=o.Buffer=t("./bufferish-buffer"),c=o.Uint8Array=t("./bufferish-uint8array"),h=o.prototype=t("./bufferish-proto");function l(t){return d(this).alloc(t)}var p=g("ArrayBuffer");function d(t){return f(t)?s:u(t)?c:i(t)?a:e?s:n?c:a}function y(){return!1}function g(r,e){return r="[object "+r+"]",function(t){return null!=t&&{}.toString.call(e?t[e]:t)===r}}},{"./buffer-global":2,"./bufferish-array":4,"./bufferish-buffer":5,"./bufferish-proto":6,"./bufferish-uint8array":7,isarray:35}],9:[function(t,r,e){var n=t("isarray"),i=(e.createCodec=f,e.install=function(t){for(var r in t)o.prototype[r]=function(t,r){return t&&r?function(){return t.apply(this,arguments),r.apply(this,arguments)}:t||r}(o.prototype[r],t[r])},e.filter=function(t){return n(t)?function(r){return r=r.slice(),function(t){return r.reduce(e,t)};function e(t,r){return r(t)}}(t):t},t("./bufferish"));function o(t){if(!(this instanceof o))return new o(t);this.options=t,this.init()}function f(t){return new o(t)}o.prototype.init=function(){var t=this.options;return t&&t.uint8array&&(this.bufferish=i.Uint8Array),this},e.preset=f({preset:!0})},{"./bufferish":8,isarray:35}],10:[function(t,r,e){t("./read-core"),t("./write-core"),e.codec={preset:t("./codec-base").preset}},{"./codec-base":9,"./read-core":22,"./write-core":25}],11:[function(t,r,e){e.DecodeBuffer=n;e=t("./read-core").preset;function n(t){if(!(this instanceof n))return new n(t);t&&(this.options=t).codec&&(t=this.codec=t.codec).bufferish&&(this.bufferish=t.bufferish)}t("./flex-buffer").FlexDecoder.mixin(n.prototype),n.prototype.codec=e,n.prototype.fetch=function(){return this.codec.decode(this)}},{"./flex-buffer":21,"./read-core":22}],12:[function(t,r,e){e.decode=function(t,r){r=new n(r);return r.write(t),r.read()};var n=t("./decode-buffer").DecodeBuffer},{"./decode-buffer":11}],13:[function(t,r,e){e.Decoder=i;var e=t("event-lite"),n=t("./decode-buffer").DecodeBuffer;function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}i.prototype=new n,e.mixin(i.prototype),i.prototype.decode=function(t){arguments.length&&this.write(t),this.flush()},i.prototype.push=function(t){this.emit("data",t)},i.prototype.end=function(t){this.decode(t),this.emit("end")}},{"./decode-buffer":11,"event-lite":32}],14:[function(t,r,e){e.EncodeBuffer=n;e=t("./write-core").preset;function n(t){if(!(this instanceof n))return new n(t);t&&(this.options=t).codec&&(t=this.codec=t.codec).bufferish&&(this.bufferish=t.bufferish)}t("./flex-buffer").FlexEncoder.mixin(n.prototype),n.prototype.codec=e,n.prototype.write=function(t){this.codec.encode(this,t)}},{"./flex-buffer":21,"./write-core":25}],15:[function(t,r,e){e.encode=function(t,r){r=new n(r);return r.write(t),r.read()};var n=t("./encode-buffer").EncodeBuffer},{"./encode-buffer":14}],16:[function(t,r,e){e.Encoder=i;var e=t("event-lite"),n=t("./encode-buffer").EncodeBuffer;function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}i.prototype=new n,e.mixin(i.prototype),i.prototype.encode=function(t){this.write(t),this.emit("data",this.read())},i.prototype.end=function(t){arguments.length&&this.encode(t),this.flush(),this.emit("end")}},{"./encode-buffer":14,"event-lite":32}],17:[function(t,r,e){e.ExtBuffer=function t(r,e){if(!(this instanceof t))return new t(r,e);this.buffer=n.from(r);this.type=e};var n=t("./bufferish")},{"./bufferish":8}],18:[function(r,t,e){e.setExtPackers=function(t){t.addExtPacker(14,Error,[c,u]),t.addExtPacker(1,EvalError,[c,u]),t.addExtPacker(2,RangeError,[c,u]),t.addExtPacker(3,ReferenceError,[c,u]),t.addExtPacker(4,SyntaxError,[c,u]),t.addExtPacker(5,TypeError,[c,u]),t.addExtPacker(6,URIError,[c,u]),t.addExtPacker(10,RegExp,[s,u]),t.addExtPacker(11,Boolean,[a,u]),t.addExtPacker(12,String,[a,u]),t.addExtPacker(13,Date,[Number,u]),t.addExtPacker(15,Number,[a,u]),"undefined"!=typeof Uint8Array&&(t.addExtPacker(17,Int8Array,o),t.addExtPacker(18,Uint8Array,o),t.addExtPacker(19,Int16Array,o),t.addExtPacker(20,Uint16Array,o),t.addExtPacker(21,Int32Array,o),t.addExtPacker(22,Uint32Array,o),t.addExtPacker(23,Float32Array,o),"undefined"!=typeof Float64Array&&t.addExtPacker(24,Float64Array,o),"undefined"!=typeof Uint8ClampedArray&&t.addExtPacker(25,Uint8ClampedArray,o),t.addExtPacker(26,ArrayBuffer,o),t.addExtPacker(29,DataView,o));i.hasBuffer&&t.addExtPacker(27,Buffer,i.from)};var n,i=r("./bufferish"),Buffer=i.global,o=i.Uint8Array.from,f={name:1,message:1,stack:1,columnNumber:1,fileName:1,lineNumber:1};function u(t){return(n=n||r("./encode").encode)(t)}function a(t){return t.valueOf()}function s(t){(t=RegExp.prototype.toString.call(t).split("/")).shift();var r=[t.pop()];return r.unshift(t.join("/")),r}function c(t){var r,e={};for(r in f)e[r]=t[r];return e}},{"./bufferish":8,"./encode":15}],19:[function(r,t,e){e.setExtUnpackers=function(t){t.addExtUnpacker(14,[f,a(Error)]),t.addExtUnpacker(1,[f,a(EvalError)]),t.addExtUnpacker(2,[f,a(RangeError)]),t.addExtUnpacker(3,[f,a(ReferenceError)]),t.addExtUnpacker(4,[f,a(SyntaxError)]),t.addExtUnpacker(5,[f,a(TypeError)]),t.addExtUnpacker(6,[f,a(URIError)]),t.addExtUnpacker(10,[f,u]),t.addExtUnpacker(11,[f,s(Boolean)]),t.addExtUnpacker(12,[f,s(String)]),t.addExtUnpacker(13,[f,s(Date)]),t.addExtUnpacker(15,[f,s(Number)]),"undefined"!=typeof Uint8Array&&(t.addExtUnpacker(17,s(Int8Array)),t.addExtUnpacker(18,s(Uint8Array)),t.addExtUnpacker(19,[c,s(Int16Array)]),t.addExtUnpacker(20,[c,s(Uint16Array)]),t.addExtUnpacker(21,[c,s(Int32Array)]),t.addExtUnpacker(22,[c,s(Uint32Array)]),t.addExtUnpacker(23,[c,s(Float32Array)]),"undefined"!=typeof Float64Array&&t.addExtUnpacker(24,[c,s(Float64Array)]),"undefined"!=typeof Uint8ClampedArray&&t.addExtUnpacker(25,s(Uint8ClampedArray)),t.addExtUnpacker(26,c),t.addExtUnpacker(29,[c,s(DataView)]));i.hasBuffer&&t.addExtUnpacker(27,i.from)};var n,i=r("./bufferish"),o=(i.global,{name:1,message:1,stack:1,columnNumber:1,fileName:1,lineNumber:1});function f(t){return(n=n||r("./decode").decode)(t)}function u(t){return RegExp.apply(null,t)}function a(n){return function(t){var r,e=new n;for(r in o)e[r]=t[r];return e}}function s(r){return function(t){return new r(t)}}function c(t){return new Uint8Array(t).buffer}},{"./bufferish":8,"./decode":12}],20:[function(t,r,e){t("./read-core"),t("./write-core"),e.createCodec=t("./codec-base").createCodec},{"./codec-base":9,"./read-core":22,"./write-core":25}],21:[function(t,r,e){e.FlexDecoder=o,e.FlexEncoder=f;var n=t("./bufferish"),i="BUFFER_SHORTAGE";function o(){if(!(this instanceof o))return new o}function f(){if(!(this instanceof f))return new f}function u(){throw new Error("method not implemented: write()")}function a(){throw new Error("method not implemented: fetch()")}function s(){return this.buffers&&this.buffers.length?(this.flush(),this.pull()):this.fetch()}function c(t){(this.buffers||(this.buffers=[])).push(t)}function h(){return(this.buffers||(this.buffers=[])).shift()}function l(e){return function(t){for(var r in e)t[r]=e[r];return t}}o.mixin=l({bufferish:n,write:function(t){var r=this.offset?n.prototype.slice.call(this.buffer,this.offset):this.buffer;this.buffer=r?t?this.bufferish.concat([r,t]):r:t,this.offset=0},fetch:a,flush:function(){for(;this.offset<this.buffer.length;){var t,r=this.offset;try{t=this.fetch()}catch(t){if(t&&t.message!=i)throw t;this.offset=r;break}this.push(t)}},push:c,pull:h,read:s,reserve:function(t){var r=this.offset,t=r+t;if(t>this.buffer.length)throw new Error(i);return this.offset=t,r},offset:0}),o.mixin(o.prototype),f.mixin=l({bufferish:n,write:u,fetch:function(){var t=this.start;{var r;if(t<this.offset)return r=this.start=this.offset,n.prototype.slice.call(this.buffer,t,r)}},flush:function(){for(;this.start<this.offset;){var t=this.fetch();t&&this.push(t)}},push:c,pull:function(){var t=this.buffers||(this.buffers=[]),r=1<t.length?this.bufferish.concat(t):t[0];return t.length=0,r},read:s,reserve:function(t){var r=0|t;if(this.buffer){var e=this.buffer.length,n=0|this.offset,i=n+r;if(i<e)return this.offset=i,n;this.flush(),t=Math.max(t,Math.min(2*e,this.maxBufferSize))}return t=Math.max(t,this.minBufferSize),this.buffer=this.bufferish.alloc(t),this.start=0,this.offset=r,0},send:function(t){var r=t.length;r>this.minBufferSize?(this.flush(),this.push(t)):(r=this.reserve(r),n.prototype.copy.call(t,this.buffer,r))},maxBufferSize:65536,minBufferSize:2048,offset:0,start:0}),f.mixin(f.prototype)},{"./bufferish":8}],22:[function(t,r,e){var n=t("./ext-buffer").ExtBuffer,i=t("./ext-unpacker"),o=t("./read-format").readUint8,f=t("./read-token"),u=t("./codec-base");function a(t){var n=f.getReadToken(t);return function(t){var r=o(t),e=n[r];if(e)return e(t);throw new Error("Invalid type: "+(r&&"0x"+r.toString(16)))}}function s(){var t=this.options;return this.decode=a(t),t&&t.preset&&i.setExtUnpackers(this),this}u.install({addExtUnpacker:function(t,r){(this.extUnpackers||(this.extUnpackers=[]))[t]=u.filter(r)},getExtUnpacker:function(r){return(this.extUnpackers||(this.extUnpackers=[]))[r]||function(t){return new n(t,r)}},init:s}),e.preset=s.call(u.preset)},{"./codec-base":9,"./ext-buffer":17,"./ext-unpacker":19,"./read-format":23,"./read-token":24}],23:[function(t,r,e){var n=t("ieee754"),i=t("int64-buffer"),o=i.Uint64BE,f=i.Int64BE,u=(e.getReadFormat=function(t){var r=u.hasArrayBuffer&&t&&t.binarraybuffer,e=t&&t.int64;return{map:s&&t&&t.usemap?l:h,array:p,str:d,bin:r?g:y,ext:b,uint8:w,uint16:E,uint32:m,uint64:B(8,e?R:U),int8:v,int16:A,int32:x,int64:B(8,e?k:P),float32:B(4,_),float64:B(8,T)}},e.readUint8=w,t("./bufferish")),a=t("./bufferish-proto"),s="undefined"!=typeof Map,c=!0;function h(t,r){for(var e={},n=new Array(r),i=new Array(r),o=t.codec.decode,f=0;f<r;f++)n[f]=o(t),i[f]=o(t);for(f=0;f<r;f++)e[n[f]]=i[f];return e}function l(t,r){for(var e=new Map,n=new Array(r),i=new Array(r),o=t.codec.decode,f=0;f<r;f++)n[f]=o(t),i[f]=o(t);for(f=0;f<r;f++)e.set(n[f],i[f]);return e}function p(t,r){for(var e=new Array(r),n=t.codec.decode,i=0;i<r;i++)e[i]=n(t);return e}function d(t,r){var e=t.reserve(r);return a.toString.call(t.buffer,"utf-8",e,e+r)}function y(t,r){var e=t.reserve(r),t=a.slice.call(t.buffer,e,e+r);return u.from(t)}function g(t,r){var e=t.reserve(r),t=a.slice.call(t.buffer,e,e+r);return u.Uint8Array.from(t).buffer}function b(t,r){var e=t.reserve(r+1),n=t.buffer[e++],r=e+r,i=t.codec.getExtUnpacker(n);if(i)return i(a.slice.call(t.buffer,e,r));throw new Error("Invalid ext type: "+(n&&"0x"+n.toString(16)))}function w(t){var r=t.reserve(1);return t.buffer[r]}function v(t){var r=t.reserve(1),t=t.buffer[r];return 128&t?t-256:t}function E(t){var r=t.reserve(2),t=t.buffer;return t[r++]<<8|t[r]}function A(t){var r=t.reserve(2),t=t.buffer,t=t[r++]<<8|t[r];return 32768&t?t-65536:t}function m(t){var r=t.reserve(4),t=t.buffer;return 16777216*t[r++]+(t[r++]<<16)+(t[r++]<<8)+t[r]}function x(t){var r=t.reserve(4),t=t.buffer;return t[r++]<<24|t[r++]<<16|t[r++]<<8|t[r]}function B(e,n){return function(t){var r=t.reserve(e);return n.call(t.buffer,r,c)}}function U(t){return new o(this,t).toNumber()}function P(t){return new f(this,t).toNumber()}function R(t){return new o(this,t)}function k(t){return new f(this,t)}function _(t){return n.read(this,t,!1,23,4)}function T(t){return n.read(this,t,!1,52,8)}},{"./bufferish":8,"./bufferish-proto":6,ieee754:33,"int64-buffer":34}],24:[function(t,r,e){var n=t("./read-format");function i(t){for(var r=new Array(256),e=0;e<=127;e++)r[e]=o(e);for(e=128;e<=143;e++)r[e]=u(e-128,t.map);for(e=144;e<=159;e++)r[e]=u(e-144,t.array);for(e=160;e<=191;e++)r[e]=u(e-160,t.str);for(r[192]=o(null),r[193]=null,r[194]=o(!1),r[195]=o(!0),r[196]=f(t.uint8,t.bin),r[197]=f(t.uint16,t.bin),r[198]=f(t.uint32,t.bin),r[199]=f(t.uint8,t.ext),r[200]=f(t.uint16,t.ext),r[201]=f(t.uint32,t.ext),r[202]=t.float32,r[203]=t.float64,r[204]=t.uint8,r[205]=t.uint16,r[206]=t.uint32,r[207]=t.uint64,r[208]=t.int8,r[209]=t.int16,r[210]=t.int32,r[211]=t.int64,r[212]=u(1,t.ext),r[213]=u(2,t.ext),r[214]=u(4,t.ext),r[215]=u(8,t.ext),r[216]=u(16,t.ext),r[217]=f(t.uint8,t.str),r[218]=f(t.uint16,t.str),r[219]=f(t.uint32,t.str),r[220]=f(t.uint16,t.array),r[221]=f(t.uint32,t.array),r[222]=f(t.uint16,t.map),r[223]=f(t.uint32,t.map),e=224;e<=255;e++)r[e]=o(e-256);return r}function o(t){return function(){return t}}function f(e,n){return function(t){var r=e(t);return n(t,r)}}function u(r,e){return function(t){return e(t,r)}}e.getReadToken=function(t){var r=n.getReadFormat(t);return(t&&t.useraw?function(t){var r,e=i(t).slice();for(e[217]=e[196],e[218]=e[197],e[219]=e[198],r=160;r<=191;r++)e[r]=u(r-160,t.bin);return e}:i)(r)}},{"./read-format":23}],25:[function(t,r,e){var o=t("./ext-buffer").ExtBuffer,n=t("./ext-packer"),i=t("./write-type"),f=t("./codec-base");function u(t){var n=i.getWriteType(t);return function(t,r){var e=n[typeof r];if(!e)throw new Error('Unsupported type "'+typeof r+'": '+r);e(t,r)}}function a(){var t=this.options;return this.encode=u(t),t&&t.preset&&n.setExtPackers(this),this}f.install({addExtPacker:function(r,t,e){e=f.filter(e);var n=t.name;n&&"Object"!==n?(this.extPackers||(this.extPackers={}))[n]=i:(this.extEncoderList||(this.extEncoderList=[])).unshift([t,i]);function i(t){return e&&(t=e(t)),new o(t,r)}},getExtPacker:function(t){var r=this.extPackers||(this.extPackers={}),e=t.constructor,t=e&&e.name&&r[e.name];if(t)return t;for(var n=this.extEncoderList||(this.extEncoderList=[]),i=n.length,o=0;o<i;o++){var f=n[o];if(e===f[0])return f[1]}},init:a}),e.preset=a.call(f.preset)},{"./codec-base":9,"./ext-buffer":17,"./ext-packer":18,"./write-type":27}],26:[function(t,r,e){var n=t("ieee754"),i=t("int64-buffer"),o=i.Uint64BE,f=i.Int64BE,u=t("./write-uint8").uint8,a=t("./bufferish"),Buffer=a.global,s=a.hasBuffer&&"TYPED_ARRAY_SUPPORT"in Buffer&&!Buffer.TYPED_ARRAY_SUPPORT,c=a.hasBuffer&&Buffer.prototype||{};function h(){var t=u.slice();return t[196]=l(196),t[197]=p(197),t[198]=d(198),t[199]=l(199),t[200]=p(200),t[201]=d(201),t[202]=y(202,4,c.writeFloatBE||w,!0),t[203]=y(203,8,c.writeDoubleBE||v,!0),t[204]=l(204),t[205]=p(205),t[206]=d(206),t[207]=y(207,8,g),t[208]=l(208),t[209]=p(209),t[210]=d(210),t[211]=y(211,8,b),t[217]=l(217),t[218]=p(218),t[219]=d(219),t[220]=p(220),t[221]=d(221),t[222]=p(222),t[223]=d(223),t}function l(n){return function(t,r){var e=t.reserve(2),t=t.buffer;t[e++]=n,t[e]=r}}function p(n){return function(t,r){var e=t.reserve(3),t=t.buffer;t[e++]=n,t[e++]=r>>>8,t[e]=r}}function d(n){return function(t,r){var e=t.reserve(5),t=t.buffer;t[e++]=n,t[e++]=r>>>24,t[e++]=r>>>16,t[e++]=r>>>8,t[e]=r}}function y(n,i,o,f){return function(t,r){var e=t.reserve(i+1);t.buffer[e++]=n,o.call(t.buffer,r,e,f)}}function g(t,r){new o(this,r,t)}function b(t,r){new f(this,r,t)}function w(t,r){n.write(this,t,r,!1,23,4)}function v(t,r){n.write(this,t,r,!1,52,8)}e.getWriteToken=function(t){return(t&&t.uint8array?function(){var t=h();return t[202]=y(202,4,w),t[203]=y(203,8,v),t}:s||a.hasBuffer&&t&&t.safe?function(){var t=u.slice();return t[196]=y(196,1,Buffer.prototype.writeUInt8),t[197]=y(197,2,Buffer.prototype.writeUInt16BE),t[198]=y(198,4,Buffer.prototype.writeUInt32BE),t[199]=y(199,1,Buffer.prototype.writeUInt8),t[200]=y(200,2,Buffer.prototype.writeUInt16BE),t[201]=y(201,4,Buffer.prototype.writeUInt32BE),t[202]=y(202,4,Buffer.prototype.writeFloatBE),t[203]=y(203,8,Buffer.prototype.writeDoubleBE),t[204]=y(204,1,Buffer.prototype.writeUInt8),t[205]=y(205,2,Buffer.prototype.writeUInt16BE),t[206]=y(206,4,Buffer.prototype.writeUInt32BE),t[207]=y(207,8,g),t[208]=y(208,1,Buffer.prototype.writeInt8),t[209]=y(209,2,Buffer.prototype.writeInt16BE),t[210]=y(210,4,Buffer.prototype.writeInt32BE),t[211]=y(211,8,b),t[217]=y(217,1,Buffer.prototype.writeUInt8),t[218]=y(218,2,Buffer.prototype.writeUInt16BE),t[219]=y(219,4,Buffer.prototype.writeUInt32BE),t[220]=y(220,2,Buffer.prototype.writeUInt16BE),t[221]=y(221,4,Buffer.prototype.writeUInt32BE),t[222]=y(222,2,Buffer.prototype.writeUInt16BE),t[223]=y(223,4,Buffer.prototype.writeUInt32BE),t}:h)()}},{"./bufferish":8,"./write-uint8":28,ieee754:33,"int64-buffer":34}],27:[function(t,r,e){var b=t("isarray"),n=t("int64-buffer"),w=n.Uint64BE,v=n.Int64BE,f=t("./bufferish"),a=t("./bufferish-proto"),u=t("./write-token"),E=t("./write-uint8").uint8,A=t("./ext-buffer").ExtBuffer,s="undefined"!=typeof Uint8Array,c="undefined"!=typeof Map,m=[];m[1]=212,m[2]=213,m[4]=214,m[8]=215,m[16]=216,e.getWriteType=function(t){var l=u.getWriteToken(t),r=t&&t.useraw,e=s&&t&&t.binarraybuffer,p=e?f.isArrayBuffer:f.isBuffer,d=e?function(t,r){i(t,new Uint8Array(r))}:i,y=c&&t&&t.usemap?function(n,t){if(!(t instanceof Map))return o(n,t);var r=t.size,i=(l[r<16?128+r:r<=65535?222:223](n,r),n.codec.encode);t.forEach(function(t,r,e){i(n,r),i(n,t)})}:o;return{boolean:function(t,r){l[r?195:194](t,r)},function:g,number:function(t,r){var e=0|r;r!==e?0<=r&&r<=4294967295&&Math.floor(r)===r?l[206](t,r):l[203](t,r):l[-32<=e&&e<=127?255&e:0<=e?e<=255?204:e<=65535?205:206:-128<=e?208:-32768<=e?209:210](t,e)},object:r?function(t,r){if(p(r))return function(t,r){var e=r.length;l[e<32?160+e:e<=65535?218:219](t,e),t.send(r)}(t,r);n(t,r)}:n,string:function(u){return function(t,r){var e=r.length,n=5+3*e,n=(t.offset=t.reserve(n),t.buffer),i=u(e),o=t.offset+i,r=(e=a.write.call(n,r,o),u(e));{var f;i!==r&&(i=o+r-i,f=o+e,a.copy.call(n,n,i,o,f))}l[1===r?160+e:r<=3?215+r:219](t,e),t.offset+=e}}(r?function(t){return t<32?1:t<=65535?3:5}:function(t){return t<32?1:t<=255?2:t<=65535?3:5}),symbol:g,undefined:g};function n(t,r){if(null===r)return g(t,r);if(p(r))return d(t,r);if(b(r))for(var e=t,n=r,i=n.length,o=(l[i<16?144+i:i<=65535?220:221](e,i),e.codec.encode),f=0;f<i;f++)o(e,n[f]);else if(w.isUint64BE(r))u=r,l[207](t,u.toArray());else if(v.isInt64BE(r))u=r,l[211](t,u.toArray());else{var u,a,s,c,h=t.codec.getExtPacker(r);if((r=h?h(r):r)instanceof A)return h=t,s=(a=r).buffer,c=s.length,l[m[c]||(c<255?199:c<=65535?200:201)](h,c),E[a.type](h),void h.send(s);y(t,r)}}function g(t,r){l[192](t,r)}function i(t,r){var e=r.length;l[e<255?196:e<=65535?197:198](t,e),t.send(r)}function o(r,e){var t=Object.keys(e),n=t.length,i=(l[n<16?128+n:n<=65535?222:223](r,n),r.codec.encode);t.forEach(function(t){i(r,t),i(r,e[t])})}}},{"./bufferish":8,"./bufferish-proto":6,"./ext-buffer":17,"./write-token":26,"./write-uint8":28,"int64-buffer":34,isarray:35}],28:[function(t,r,e){for(var n=e.uint8=new Array(256),i=0;i<=255;i++)n[i]=function(e){return function(t){var r=t.reserve(1);t.buffer[r]=e}}(i)},{}],29:[function(t,r,e){e.byteLength=function(t){var t=c(t),r=t[0],t=t[1];return 3*(r+t)/4-t},e.toByteArray=function(t){var r,e,n=c(t),i=n[0],n=n[1],o=new s(function(t,r){return 3*(t+r)/4-r}(i,n)),f=0,u=0<n?i-4:i;for(e=0;e<u;e+=4)r=a[t.charCodeAt(e)]<<18|a[t.charCodeAt(e+1)]<<12|a[t.charCodeAt(e+2)]<<6|a[t.charCodeAt(e+3)],o[f++]=r>>16&255,o[f++]=r>>8&255,o[f++]=255&r;2===n&&(r=a[t.charCodeAt(e)]<<2|a[t.charCodeAt(e+1)]>>4,o[f++]=255&r);1===n&&(r=a[t.charCodeAt(e)]<<10|a[t.charCodeAt(e+1)]<<4|a[t.charCodeAt(e+2)]>>2,o[f++]=r>>8&255,o[f++]=255&r);return o},e.fromByteArray=function(t){for(var r,e=t.length,n=e%3,i=[],o=0,f=e-n;o<f;o+=16383)i.push(function(t,r,e){for(var n,i=[],o=r;o<e;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),i.push(function(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}(n));return i.join("")}(t,o,f<o+16383?f:o+16383));1==n?(r=t[e-1],i.push(u[r>>2]+u[r<<4&63]+"==")):2==n&&(r=(t[e-2]<<8)+t[e-1],i.push(u[r>>10]+u[r>>4&63]+u[r<<2&63]+"="));return i.join("")};for(var u=[],a=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=n.length;i<o;++i)u[i]=n[i],a[n.charCodeAt(i)]=i;function c(t){var r=t.length;if(0<r%4)throw new Error("Invalid string. Length must be a multiple of 4");t=t.indexOf("="),r=(t=-1===t?r:t)===r?0:4-t%4;return[t,r]}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},{}],30:[function(S,t,I){!function(t,Buffer){!function(){var B=S("base64-js"),o=S("ieee754"),u=S("isarray");function e(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,r){if(e()<r)throw new RangeError("Invalid typed array length");return Buffer.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=Buffer.prototype:(t=null===t?new Buffer(r):t).length=r,t}function Buffer(t,r,e){if(!(Buffer.TYPED_ARRAY_SUPPORT||this instanceof Buffer))return new Buffer(t,r,e);if("number"!=typeof t)return n(this,t,r,e);if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}function n(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');if("undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer){var i=t,o=r,f=e;if(o.byteLength,f<0||o.byteLength<f)throw new RangeError("'offset' is out of bounds");if(o.byteLength<f+(n||0))throw new RangeError("'length' is out of bounds");return o=void 0===f&&void 0===n?new Uint8Array(o):void 0===n?new Uint8Array(o,f):new Uint8Array(o,f,n),Buffer.TYPED_ARRAY_SUPPORT?(i=o).__proto__=Buffer.prototype:i=s(i,o),i}if("string"!=typeof r){f=t,n=r;if(Buffer.isBuffer(n))return o=0|c(n.length),0!==(f=a(f,o)).length&&n.copy(f,0,0,o),f;if(n){if("undefined"!=typeof ArrayBuffer&&n.buffer instanceof ArrayBuffer||"length"in n)return"number"!=typeof n.length||function(t){return t!=t}(n.length)?a(f,0):s(f,n);if("Buffer"===n.type&&u(n.data))return s(f,n.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}i=t,n=r,t=e;if(Buffer.isEncoding(t="string"==typeof t&&""!==t?t:"utf8"))return r=0|h(n,t),i=(n=(i=a(i,r)).write(n,t))!==r?i.slice(0,n):i;throw new TypeError('"encoding" must be a valid string encoding')}function i(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,r){if(i(r),t=a(t,r<0?0:0|c(r)),!Buffer.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function s(t,r){var e=r.length<0?0:0|c(r.length);t=a(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function c(t){if(e()<=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+e().toString(16)+" bytes");return 0|t}function h(t,r){if(Buffer.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;var e=(t="string"!=typeof t?""+t:t).length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return k(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return _(t).length;default:if(n)return k(t).length;r=(""+r).toLowerCase(),n=!0}}function r(t,r,e){var n,i=!1;if((r=void 0===r||r<0?0:r)>this.length)return"";if((e=void 0===e||e>this.length?this.length:e)<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t=t||"utf8";;)switch(t){case"hex":var o=this,f=r,u=e,a=o.length;(!u||u<0||a<u)&&(u=a);for(var s="",c=f=!f||f<0?0:f;c<u;++c)s+=function(t){return t<16?"0"+t.toString(16):t.toString(16)}(o[c]);return s;case"utf8":case"utf-8":return U(this,r,e);case"ascii":var h=this,a=r,l=e,p="";l=Math.min(h.length,l);for(var d=a;d<l;++d)p+=String.fromCharCode(127&h[d]);return p;case"latin1":case"binary":var y=this,f=r,g=e,b="";g=Math.min(y.length,g);for(var w=f;w<g;++w)b+=String.fromCharCode(y[w]);return b;case"base64":return v=this,n=e,0===(E=r)&&n===v.length?B.fromByteArray(v):B.fromByteArray(v.slice(E,n));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":for(var v=r,E=e,A=this.slice(v,E),m="",x=0;x<A.length;x+=2)m+=String.fromCharCode(A[x]+256*A[x+1]);return m;default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function l(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function p(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):2147483647<e?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,(e=(e=isNaN(e)?i?0:t.length-1:e)<0?t.length+e:e)>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=Buffer.from(r,n)),Buffer.isBuffer(r))return 0===r.length?-1:d(t,r,e,n,i);if("number"==typeof r)return r&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(i?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(t,r,e):d(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function d(t,r,e,n,i){var o=1,f=t.length,u=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;f/=o=2,u/=2,e/=2}function a(t,r){return 1===o?t[r]:t.readUInt16BE(r*o)}if(i)for(var s=-1,c=e;c<f;c++)if(a(t,c)===a(r,-1===s?0:c-s)){if(c-(s=-1===s?c:s)+1===u)return s*o}else-1!==s&&(c-=c-s),s=-1;else for(c=e=f<e+u?f-u:e;0<=c;c--){for(var h=!0,l=0;l<u;l++)if(a(t,c+l)!==a(r,l)){h=!1;break}if(h)return c}return-1}function g(t,r,e,n){return T(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,n)}function b(t,r,e,n){return T(function(t,r){for(var e,n,i=[],o=0;o<t.length&&!((r-=2)<0);++o)e=t.charCodeAt(o),n=e>>8,i.push(e%256),i.push(n);return i}(r,t.length-e),t,e,n)}function U(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,f,u,a,s=t[i],c=null,h=239<s?4:223<s?3:191<s?2:1;if(i+h<=e)switch(h){case 1:s<128&&(c=s);break;case 2:128==(192&(o=t[i+1]))&&127<(a=(31&s)<<6|63&o)&&(c=a);break;case 3:o=t[i+1],f=t[i+2],128==(192&o)&&128==(192&f)&&2047<(a=(15&s)<<12|(63&o)<<6|63&f)&&(a<55296||57343<a)&&(c=a);break;case 4:o=t[i+1],f=t[i+2],u=t[i+3],128==(192&o)&&128==(192&f)&&128==(192&u)&&65535<(a=(15&s)<<18|(63&o)<<12|(63&f)<<6|63&u)&&a<1114112&&(c=a)}null===c?(c=65533,h=1):65535<c&&(n.push((c-=65536)>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}var l=n,p=l.length;if(p<=w)return String.fromCharCode.apply(String,l);for(var d="",y=0;y<p;)d+=String.fromCharCode.apply(String,l.slice(y,y+=w));return d}I.Buffer=Buffer,I.SlowBuffer=function(t){+t!=t&&(t=0);return Buffer.alloc(+t)},I.INSPECT_MAX_BYTES=50,Buffer.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){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}}(),I.kMaxLength=e(),Buffer.poolSize=8192,Buffer._augment=function(t){return t.__proto__=Buffer.prototype,t},Buffer.from=function(t,r,e){return n(null,t,r,e)},Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,"undefined"!=typeof Symbol)&&Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0}),Buffer.alloc=function(t,r,e){return n=null,r=r,e=e,i(t=t),!(t<=0)&&void 0!==r?"string"==typeof e?a(n,t).fill(r,e):a(n,t).fill(r):a(n,t);var n},Buffer.allocUnsafe=function(t){return f(null,t)},Buffer.allocUnsafeSlow=function(t){return f(null,t)},Buffer.isBuffer=function(t){return!(null==t||!t._isBuffer)},Buffer.compare=function(t,r){if(!Buffer.isBuffer(t)||!Buffer.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?1:0},Buffer.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.concat=function(t,r){if(!u(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return Buffer.alloc(0);if(void 0===r)for(i=r=0;i<t.length;++i)r+=t[i].length;for(var e=Buffer.allocUnsafe(r),n=0,i=0;i<t.length;++i){var o=t[i];if(!Buffer.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(e,n),n+=o.length}return e},Buffer.byteLength=h,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)l(this,r,r+1);return this},Buffer.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)l(this,r,r+3),l(this,r+1,r+2);return this},Buffer.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)l(this,r,r+7),l(this,r+1,r+6),l(this,r+2,r+5),l(this,r+3,r+4);return this},Buffer.prototype.toString=function(){var t=0|this.length;return 0==t?"":0===arguments.length?U(this,0,t):r.apply(this,arguments)},Buffer.prototype.equals=function(t){if(Buffer.isBuffer(t))return this===t||0===Buffer.compare(this,t);throw new TypeError("Argument must be a Buffer")},Buffer.prototype.inspect=function(){var t="",r=I.INSPECT_MAX_BYTES;return 0<this.length&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r)&&(t+=" ... "),"<Buffer "+t+">"},Buffer.prototype.compare=function(t,r,e,n,i){if(!Buffer.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),(r=void 0===r?0:r)<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(i<=n&&e<=r)return 0;if(i<=n)return-1;if(e<=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),f=(e>>>=0)-(r>>>=0),u=Math.min(o,f),a=this.slice(n,i),s=t.slice(r,e),c=0;c<u;++c)if(a[c]!==s[c]){o=a[c],f=s[c];break}return o<f?-1:f<o?1:0},Buffer.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},Buffer.prototype.indexOf=function(t,r,e){return p(this,t,r,e,!0)},Buffer.prototype.lastIndexOf=function(t,r,e){return p(this,t,r,e,!1)},Buffer.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||i<e)&&(e=i),0<t.length&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var o,f,u,a=!1;;)switch(n){case"hex":var s=this,c=t,h=r,l=e,p=(h=Number(h)||0,s.length-h);if((!l||p<(l=Number(l)))&&(l=p),(p=c.length)%2!=0)throw new TypeError("Invalid hex string");p/2<l&&(l=p/2);for(var d=0;d<l;++d){var y=parseInt(c.substr(2*d,2),16);if(isNaN(y))return d;s[h+d]=y}return d;case"utf8":case"utf-8":return p=r,u=e,T(k(t,(f=this).length-p),f,p,u);case"ascii":return g(this,t,r,e);case"latin1":case"binary":return g(this,t,r,e);case"base64":return f=this,u=r,o=e,T(_(t),f,u,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,t,r,e);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function y(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(e<t+r)throw new RangeError("Trying to access beyond buffer length")}function v(t,r,e,n,i,o){if(!Buffer.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(i<r||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function E(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function A(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>8*(n?i:3-i)&255}function m(t,r,e,n){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function x(t,r,e,n,i){return i||m(t,0,e,4),o.write(t,r,e,n,23,4),e+4}function P(t,r,e,n,i){return i||m(t,0,e,8),o.write(t,r,e,n,52,8),e+8}Buffer.prototype.slice=function(t,r){var e=this.length;if((t=~~t)<0?(t+=e)<0&&(t=0):e<t&&(t=e),(r=void 0===r?e:~~r)<0?(r+=e)<0&&(r=0):e<r&&(r=e),r<t&&(r=t),Buffer.TYPED_ARRAY_SUPPORT)(i=this.subarray(t,r)).__proto__=Buffer.prototype;else for(var n=r-t,i=new Buffer(n,void 0),o=0;o<n;++o)i[o]=this[o+t];return i},Buffer.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||y(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},Buffer.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||y(t,r,this.length);for(var n=this[t+--r],i=1;0<r&&(i*=256);)n+=this[t+--r]*i;return n},Buffer.prototype.readUInt8=function(t,r){return r||y(t,1,this.length),this[t]},Buffer.prototype.readUInt16LE=function(t,r){return r||y(t,2,this.length),this[t]|this[t+1]<<8},Buffer.prototype.readUInt16BE=function(t,r){return r||y(t,2,this.length),this[t]<<8|this[t+1]},Buffer.prototype.readUInt32LE=function(t,r){return r||y(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},Buffer.prototype.readUInt32BE=function(t,r){return r||y(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Buffer.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||y(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return(i*=128)<=n&&(n-=Math.pow(2,8*r)),n},Buffer.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||y(t,r,this.length);for(var n=r,i=1,o=this[t+--n];0<n&&(i*=256);)o+=this[t+--n]*i;return(i*=128)<=o&&(o-=Math.pow(2,8*r)),o},Buffer.prototype.readInt8=function(t,r){return r||y(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},Buffer.prototype.readInt16LE=function(t,r){r||y(t,2,this.length);r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function(t,r){r||y(t,2,this.length);r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function(t,r){return r||y(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Buffer.prototype.readInt32BE=function(t,r){return r||y(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Buffer.prototype.readFloatLE=function(t,r){return r||y(t,4,this.length),o.read(this,t,!0,23,4)},Buffer.prototype.readFloatBE=function(t,r){return r||y(t,4,this.length),o.read(this,t,!1,23,4)},Buffer.prototype.readDoubleLE=function(t,r){return r||y(t,8,this.length),o.read(this,t,!0,52,8)},Buffer.prototype.readDoubleBE=function(t,r){return r||y(t,8,this.length),o.read(this,t,!1,52,8)},Buffer.prototype.writeUIntLE=function(t,r,e,n){t=+t,r|=0,e|=0,n||v(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},Buffer.prototype.writeUIntBE=function(t,r,e,n){t=+t,r|=0,e|=0,n||v(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;0<=--i&&(o*=256);)this[r+i]=t/o&255;return r+e},Buffer.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||v(this,t,r,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},Buffer.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||v(this,t,r,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):E(this,t,r,!0),r+2},Buffer.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||v(this,t,r,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):E(this,t,r,!1),r+2},Buffer.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||v(this,t,r,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):A(this,t,r,!0),r+4},Buffer.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||v(this,t,r,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):A(this,t,r,!1),r+4},Buffer.prototype.writeIntLE=function(t,r,e,n){t=+t,r|=0,n||v(this,t,r,e,(n=Math.pow(2,8*e-1))-1,-n);var i=0,o=1,f=0;for(this[r]=255&t;++i<e&&(o*=256);)t<0&&0===f&&0!==this[r+i-1]&&(f=1),this[r+i]=(t/o>>0)-f&255;return r+e},Buffer.prototype.writeIntBE=function(t,r,e,n){t=+t,r|=0,n||v(this,t,r,e,(n=Math.pow(2,8*e-1))-1,-n);var i=e-1,o=1,f=0;for(this[r+i]=255&t;0<=--i&&(o*=256);)t<0&&0===f&&0!==this[r+i+1]&&(f=1),this[r+i]=(t/o>>0)-f&255;return r+e},Buffer.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||v(this,t,r,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&(t=t<0?255+t+1:t),r+1},Buffer.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||v(this,t,r,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):E(this,t,r,!0),r+2},Buffer.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||v(this,t,r,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):E(this,t,r,!1),r+2},Buffer.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||v(this,t,r,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):A(this,t,r,!0),r+4},Buffer.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||v(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),Buffer.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):A(this,t,r,!1),r+4},Buffer.prototype.writeFloatLE=function(t,r,e){return x(this,t,r,!0,e)},Buffer.prototype.writeFloatBE=function(t,r,e){return x(this,t,r,!1,e)},Buffer.prototype.writeDoubleLE=function(t,r,e){return P(this,t,r,!0,e)},Buffer.prototype.writeDoubleBE=function(t,r,e){return P(this,t,r,!1,e)},Buffer.prototype.copy=function(t,r,e,n){if(e=e||0,n||0===n||(n=this.length),r>=t.length&&(r=t.length),(n=0<n&&n<e?e:n)===e)return 0;if(0===t.length||0===this.length)return 0;if((r=r||0)<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=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);var i,o=(n=t.length-r<n-e?t.length-r+e:n)-e;if(this===t&&e<r&&r<n)for(i=o-1;0<=i;--i)t[i+r]=this[i+e];else if(o<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+o),r);return o},Buffer.prototype.fill=function(t,r,e,n){if("string"==typeof t){var i;if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length&&(i=t.charCodeAt(0))<256&&(t=i),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Buffer.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(!(e<=r))if(r>>>=0,e=void 0===e?this.length:e>>>0,"number"==typeof(t=t||0))for(u=r;u<e;++u)this[u]=t;else for(var o=Buffer.isBuffer(t)?t:k(new Buffer(t,n).toString()),f=o.length,u=0;u<e-r;++u)this[u+r]=o[u%f];return this};var R=/[^+\/0-9A-Za-z-_]/g;function k(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],f=0;f<n;++f){if(55295<(e=t.charCodeAt(f))&&e<57344){if(!i){if(56319<e){-1<(r-=3)&&o.push(239,191,189);continue}if(f+1===n){-1<(r-=3)&&o.push(239,191,189);continue}i=e;continue}if(e<56320){-1<(r-=3)&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&-1<(r-=3)&&o.push(239,191,189);if(i=null,e<128){if(--r<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function _(t){return B.toByteArray(function(t){var r;if((t=((r=t).trim?r.trim():r.replace(/^\s+|\s+$/g,"")).replace(R,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function T(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},S("buffer").Buffer)},{"base64-js":29,buffer:30,ieee754:33,isarray:31}],31:[function(t,r,e){var n={}.toString;r.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},{}],32:[function(t,r,e){function n(t){for(var r in a)t[r]=a[r];return t}function i(t,r){var e,n=this;if(arguments.length){if(r){if(e=o(n,t,!0)){if(!(e=e.filter(function(t){return t!==r&&t.originalListener!==r})).length)return i.call(n,t);n[u][t]=e}}else if((e=n[u])&&(delete e[t],!Object.keys(e).length))return i.call(n)}else delete n[u];return n}function o(t,r,e){if(!e||t[u])return(e=t[u]||(t[u]={}))[r]||(e[r]=[])}var f,u,a;f=function t(){if(!(this instanceof t))return new t},void 0!==r&&(r.exports=f),u="listeners",a={on:function(t,r){return o(this,t).push(r),this},once:function(t,r){var e=this;return n.originalListener=r,o(e,t).push(n),e;function n(){i.call(e,t,n),r.apply(this,arguments)}},off:i,emit:function(t,r){var e=this,t=o(e,t,!0);if(!t)return!1;var n=arguments.length;{var i;1===n?t.forEach(function(t){t.call(e)}):2===n?t.forEach(function(t){t.call(e,r)}):(i=Array.prototype.slice.call(arguments,1),t.forEach(function(t){t.apply(e,i)}))}return!!t.length}},n(f.prototype),f.mixin=n},{}],33:[function(t,r,e){e.read=function(t,r,e,n,i){var o,f,u=8*i-n-1,a=(1<<u)-1,s=a>>1,c=-7,h=e?i-1:0,l=e?-1:1,i=t[r+h];for(h+=l,o=i&(1<<-c)-1,i>>=-c,c+=u;0<c;o=256*o+t[r+h],h+=l,c-=8);for(f=o&(1<<-c)-1,o>>=-c,c+=n;0<c;f=256*f+t[r+h],h+=l,c-=8);if(0===o)o=1-s;else{if(o===a)return f?NaN:1/0*(i?-1:1);f+=Math.pow(2,n),o-=s}return(i?-1:1)*f*Math.pow(2,o-n)},e.write=function(t,r,e,n,i,o){var f,u,a=8*o-i-1,s=(1<<a)-1,c=s>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:o-1,p=n?1:-1,o=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(u=isNaN(r)?1:0,f=s):(f=Math.floor(Math.log(r)/Math.LN2),r*(n=Math.pow(2,-f))<1&&(f--,n*=2),2<=(r+=1<=f+c?h/n:h*Math.pow(2,1-c))*n&&(f++,n/=2),s<=f+c?(u=0,f=s):1<=f+c?(u=(r*n-1)*Math.pow(2,i),f+=c):(u=r*Math.pow(2,c-1)*Math.pow(2,i),f=0));8<=i;t[e+l]=255&u,l+=p,u/=256,i-=8);for(f=f<<i|u,a+=i;0<a;t[e+l]=255&f,l+=p,f/=256,a-=8);t[e+l-p]|=128*o}},{}],34:[function(t,r,e){!function(Buffer){!function(){var h,v,E,A,m,x,B,n,U;function t(t,r,u){var p=r?0:4,d=r?4:0,n=r?0:3,i=r?1:2,o=r?2:1,f=r?3:0,y=r?S:Y,g=r?I:C,r=b.prototype,e="is"+t,a="_"+e;return r.buffer=void 0,r.offset=0,r[a]=!0,r.toNumber=s,r.toString=function(t){var r=this.buffer,e=this.offset,n=c(r,e+p),i=c(r,e+d),o="",r=!u&&2147483648&n;r&&(n=~n,i=U-i);t=t||10;for(;;){var f=n%t*U+i;if(n=Math.floor(n/t),i=Math.floor(f/t),o=(f%t).toString(t)+o,!n&&!i)break}r&&(o="-"+o);return o},r.toJSON=s,r.toArray=l,A&&(r.toBuffer=P),m&&(r.toArrayBuffer=R),b[e]=function(t){return!(!t||!t[a])},h[t]=b;function b(t,r,e,n){if(!(this instanceof b))return new b(t,r,e,n);var i=this;if(m&&x&&(t instanceof x&&(t=new m(t)),e instanceof x)&&(e=new m(e)),t||r||e||v){if(k(t,r)||(o=v||Array,n=r,e=t,r=0,t=v===A?A.alloc(8):new o(8)),i.buffer=t,i.offset=r|=0,E!=typeof e)if("string"!=typeof e)k(e,n)?_(t,r,e,n):"number"==typeof n?(w(t,r+p,e),w(t,r+d,n)):0<e?y(t,r,e):e<0?g(t,r,e):_(t,r,B,0);else{for(var o=t,t=r,f=e,u=n||10,a=0,s=f.length,c=0,h=0,r=("-"===f[0]&&a++,a);a<s;){var l=parseInt(f[a++],u);if(!(0<=l))break;h=h*u+l,c=c*u+Math.floor(h/U),h%=U}r&&(c=~c,h?h=U-h:c++),w(o,t+p,c),w(o,t+d,h)}}else i.buffer=T(B,0)}function s(){var t=this.buffer,r=this.offset,e=c(t,r+p),t=c(t,r+d);return u||(e|=0),e?e*U+t:t}function w(t,r,e){t[r+f]=255&e,t[r+o]=255&(e>>=8),t[r+i]=255&(e>>=8),t[r+n]=255&(e>>=8)}function c(t,r){return 16777216*t[r+n]+(t[r+i]<<16)+(t[r+o]<<8)+t[r+f]}}function l(t){var r=this.buffer,e=this.offset;return v=null,!1!==t&&n(r)?8===r.length?r:r.slice(e,e+8):T(r,e)}function P(t){var r=this.buffer,e=this.offset;return v=A,!1!==t&&A.isBuffer(r)?8===r.length?r:r.slice(e,e+8):A.from(R.call(this,t))}function R(t){var r=this.buffer,e=this.offset,n=r.buffer;return v=m,!1!==t&&!r.offset&&n instanceof x?8===n.byteLength?n:n.slice(e,e+8):(_(t=new m(8),0,r,e),t.buffer)}function k(t,r){var e=t&&t.length;return r|=0,e&&r+8<=e&&"string"!=typeof t[r]}function _(t,r,e,n){r|=0,n|=0;for(var i=0;i<8;i++)t[r++]=255&e[n++]}function T(t,r){return Array.prototype.slice.call(t,r,r+8)}function S(t,r,e){for(var n=r+8;r<n;)t[--n]=255&e,e/=256}function I(t,r,e){var n=r+8;for(e++;r<n;)t[--n]=255&-e^255,e/=256}function Y(t,r,e){for(var n=r+8;r<n;)t[r++]=255&e,e/=256}function C(t,r,e){var n=r+8;for(e++;r<n;)t[r++]=255&-e^255,e/=256}h="object"==typeof e&&"string"!=typeof e.nodeName?e:this||{},A=(E="undefined")!=typeof Buffer&&Buffer,m=E!=typeof Uint8Array&&Uint8Array,x=E!=typeof ArrayBuffer&&ArrayBuffer,B=[0,0,0,0,0,0,0,0],n=Array.isArray||function(t){return!!t&&"[object Array]"==Object.prototype.toString.call(t)},U=4294967296,t("Uint64BE",!0,!0),t("Int64BE",!0,!1),t("Uint64LE",!1,!0),t("Int64LE",!1,!1)}.call(this)}.call(this,t("buffer").Buffer)},{buffer:30}],35:[function(t,r,e){arguments[4][31][0].apply(e,arguments)},{dup:31}]},{},[1])(1)});
|
|
1
|
+
!function(t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).msgpack=t()}(function(){return function n(i,o,f){function u(r,t){if(!o[r]){if(!i[r]){var e="function"==typeof require&&require;if(!t&&e)return e(r,!0);if(a)return a(r,!0);throw(t=new Error("Cannot find module '"+r+"'")).code="MODULE_NOT_FOUND",t}e=o[r]={exports:{}},i[r][0].call(e.exports,function(t){return u(i[r][1][t]||t)},e,e.exports,n,i,o,f)}return o[r].exports}for(var a="function"==typeof require&&require,t=0;t<f.length;t++)u(f[t]);return u}({1:[function(t,r,e){e.encode=t("./encode").encode,e.decode=t("./decode").decode,e.Encoder=t("./encoder").Encoder,e.Decoder=t("./decoder").Decoder,e.createCodec=t("./ext").createCodec,e.codec=t("./codec").codec},{"./codec":10,"./decode":12,"./decoder":13,"./encode":15,"./encoder":16,"./ext":20}],2:[function(t,r,e){!function(Buffer){!function(){function t(t){return t&&t.isBuffer&&t}r.exports=t(void 0!==Buffer&&Buffer)||t(this.Buffer)||t("undefined"!=typeof window&&window.Buffer)||this.Buffer}.call(this)}.call(this,t("buffer").Buffer)},{buffer:30}],3:[function(t,r,e){e.copy=function(t,r,e,n){var i;e=e||0;n||0===n||(n=this.length);r=r||0;var o=n-e;if(t===this&&e<r&&r<n)for(i=o-1;0<=i;i--)t[i+r]=this[i+e];else for(i=0;i<o;i++)t[i+r]=this[i+e];return o},e.toString=function(t,r,e){var n=this,i=0|r;e=e||n.length;var o="",f=0;for(;i<e;)!((f=n[i++])<128)&&(192==(224&f)?f=(31&f)<<6|63&n[i++]:224==(240&f)?f=(15&f)<<12|(63&n[i++])<<6|63&n[i++]:240==(248&f)&&(f=(7&f)<<18|(63&n[i++])<<12|(63&n[i++])<<6|63&n[i++]),65536<=f)?(f-=65536,o+=String.fromCharCode(55296+(f>>>10),56320+(1023&f))):o+=String.fromCharCode(f);return o},e.write=function(t,r){var e=this,n=r||(r|=0),i=t.length,o=0,f=0;for(;f<i;)(o=t.charCodeAt(f++))<128?e[n++]=o:(o<2048?e[n++]=192|o>>>6:(o<55296||57343<o?e[n++]=224|o>>>12:(o=65536+(o-55296<<10|t.charCodeAt(f++)-56320),e[n++]=240|o>>>18,e[n++]=128|o>>>12&63),e[n++]=128|o>>>6&63),e[n++]=128|63&o);return n-r}},{}],4:[function(t,r,e){var n=t("./bufferish");function i(t){return new Array(t)}(e=r.exports=i(0)).alloc=i,e.concat=n.concat,e.from=function(t){if(!n.isBuffer(t)&&n.isView(t))t=n.Uint8Array.from(t);else if(n.isArrayBuffer(t))t=new Uint8Array(t);else{if("string"==typeof t)return n.from.call(e,t);if("number"==typeof t)throw new TypeError('"value" argument must not be a number')}return Array.prototype.slice.call(t)}},{"./bufferish":8}],5:[function(t,r,e){var n=t("./bufferish"),Buffer=n.global;function i(t){return new Buffer(t)}(e=r.exports=n.hasBuffer?Buffer.alloc?Buffer.alloc(0):i(0):[]).alloc=n.hasBuffer&&Buffer.alloc||i,e.concat=n.concat,e.from=function(t){if(!n.isBuffer(t)&&n.isView(t))t=n.Uint8Array.from(t);else if(n.isArrayBuffer(t))t=new Uint8Array(t);else{if("string"==typeof t)return n.from.call(e,t);if("number"==typeof t)throw new TypeError('"value" argument must not be a number')}return Buffer.from&&1!==Buffer.from.length?Buffer.from(t):new Buffer(t)}},{"./bufferish":8}],6:[function(t,r,e){var n,f=t("./buffer-lite"),u=(e.copy=o,e.slice=s,e.toString=function(t,r,e){return(!i&&u.isBuffer(this)?this:f).toString.apply(this,arguments)},e.write=(n="write",function(){return(this[n]||f[n]).apply(this,arguments)}),t("./bufferish")),e=u.global,i=u.hasBuffer&&"TYPED_ARRAY_SUPPORT"in e,a=i&&!e.TYPED_ARRAY_SUPPORT;function o(t,r,e,n){var i=u.isBuffer(this),o=u.isBuffer(t);return i&&o?this.copy(t,r,e,n):a||i||o||!u.isView(this)||!u.isView(t)?f.copy.call(this,t,r,e,n):(i=e||null!=n?s.call(this,e,n):this,t.set(i,r),i.length)}function s(t,r){var e=this.slice||!a&&this.subarray;return e?e.call(this,t,r):(e=u.alloc.call(this,r-t),o.call(this,e,0,t,r),e)}},{"./buffer-lite":3,"./bufferish":8}],7:[function(t,r,n){var i=t("./bufferish");function e(t){return new Uint8Array(t)}(n=r.exports=i.hasArrayBuffer?e(0):[]).alloc=e,n.concat=i.concat,n.from=function(t){if(i.isView(t)){var r=t.byteOffset,e=t.byteLength;(t=t.buffer).byteLength!==e&&(t.slice?t=t.slice(r,r+e):(t=new Uint8Array(t)).byteLength!==e&&(t=Array.prototype.slice.call(t,r,r+e)))}else{if("string"==typeof t)return i.from.call(n,t);if("number"==typeof t)throw new TypeError('"value" argument must not be a number')}return new Uint8Array(t)}},{"./bufferish":8}],8:[function(t,r,o){var Buffer=o.global=t("./buffer-global"),e=o.hasBuffer=Buffer&&!!Buffer.isBuffer,n=o.hasArrayBuffer="undefined"!=typeof ArrayBuffer,i=o.isArray=t("isarray"),f=(o.isArrayBuffer=n?function(t){return t instanceof ArrayBuffer||p(t)}:y,o.isBuffer=e?Buffer.isBuffer:y),u=o.isView=n?ArrayBuffer.isView||g("ArrayBuffer","buffer"):y,a=(o.alloc=l,o.concat=function(t,r){r||(r=0,Array.prototype.forEach.call(t,function(t){r+=t.length}));var e=this!==o&&this||t[0],n=l.call(e,r),i=0;return Array.prototype.forEach.call(t,function(t){i+=h.copy.call(t,n,i)}),n},o.from=function(t){return"string"==typeof t?function(t){var r=3*t.length,e=l.call(this,r),t=h.write.call(e,t);r!==t&&(e=h.slice.call(e,0,t));return e}.call(this,t):d(this).from(t)},o.Array=t("./bufferish-array")),s=o.Buffer=t("./bufferish-buffer"),c=o.Uint8Array=t("./bufferish-uint8array"),h=o.prototype=t("./bufferish-proto");function l(t){return d(this).alloc(t)}var p=g("ArrayBuffer");function d(t){return f(t)?s:u(t)?c:i(t)?a:e?s:n?c:a}function y(){return!1}function g(r,e){return r="[object "+r+"]",function(t){return null!=t&&{}.toString.call(e?t[e]:t)===r}}},{"./buffer-global":2,"./bufferish-array":4,"./bufferish-buffer":5,"./bufferish-proto":6,"./bufferish-uint8array":7,isarray:35}],9:[function(t,r,e){var n=t("isarray"),i=(e.createCodec=f,e.install=function(t){for(var r in t)o.prototype[r]=function(t,r){return t&&r?function(){return t.apply(this,arguments),r.apply(this,arguments)}:t||r}(o.prototype[r],t[r])},e.filter=function(t){return n(t)?function(r){return r=r.slice(),function(t){return r.reduce(e,t)};function e(t,r){return r(t)}}(t):t},t("./bufferish"));function o(t){if(!(this instanceof o))return new o(t);this.options=t,this.init()}function f(t){return new o(t)}o.prototype.init=function(){var t=this.options;return t&&t.uint8array&&(this.bufferish=i.Uint8Array),this},e.preset=f({preset:!0})},{"./bufferish":8,isarray:35}],10:[function(t,r,e){t("./read-core"),t("./write-core"),e.codec={preset:t("./codec-base").preset}},{"./codec-base":9,"./read-core":22,"./write-core":25}],11:[function(t,r,e){e.DecodeBuffer=n;e=t("./read-core").preset;function n(t){if(!(this instanceof n))return new n(t);t&&(this.options=t).codec&&(t=this.codec=t.codec).bufferish&&(this.bufferish=t.bufferish)}t("./flex-buffer").FlexDecoder.mixin(n.prototype),n.prototype.codec=e,n.prototype.fetch=function(){return this.codec.decode(this)}},{"./flex-buffer":21,"./read-core":22}],12:[function(t,r,e){e.decode=function(t,r){r=new n(r);return r.write(t),r.read()};var n=t("./decode-buffer").DecodeBuffer},{"./decode-buffer":11}],13:[function(t,r,e){e.Decoder=i;var e=t("event-lite"),n=t("./decode-buffer").DecodeBuffer;function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}i.prototype=new n,e.mixin(i.prototype),i.prototype.decode=function(t){arguments.length&&this.write(t),this.flush()},i.prototype.push=function(t){this.emit("data",t)},i.prototype.end=function(t){this.decode(t),this.emit("end")}},{"./decode-buffer":11,"event-lite":32}],14:[function(t,r,e){e.EncodeBuffer=n;e=t("./write-core").preset;function n(t){if(!(this instanceof n))return new n(t);t&&(this.options=t).codec&&(t=this.codec=t.codec).bufferish&&(this.bufferish=t.bufferish)}t("./flex-buffer").FlexEncoder.mixin(n.prototype),n.prototype.codec=e,n.prototype.write=function(t){this.codec.encode(this,t)}},{"./flex-buffer":21,"./write-core":25}],15:[function(t,r,e){e.encode=function(t,r){r=new n(r);return r.write(t),r.read()};var n=t("./encode-buffer").EncodeBuffer},{"./encode-buffer":14}],16:[function(t,r,e){e.Encoder=i;var e=t("event-lite"),n=t("./encode-buffer").EncodeBuffer;function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}i.prototype=new n,e.mixin(i.prototype),i.prototype.encode=function(t){this.write(t),this.emit("data",this.read())},i.prototype.end=function(t){arguments.length&&this.encode(t),this.flush(),this.emit("end")}},{"./encode-buffer":14,"event-lite":32}],17:[function(t,r,e){e.ExtBuffer=function t(r,e){if(!(this instanceof t))return new t(r,e);this.buffer=n.from(r);this.type=e};var n=t("./bufferish")},{"./bufferish":8}],18:[function(r,t,e){e.setExtPackers=function(t){t.addExtPacker(14,Error,[c,u]),t.addExtPacker(1,EvalError,[c,u]),t.addExtPacker(2,RangeError,[c,u]),t.addExtPacker(3,ReferenceError,[c,u]),t.addExtPacker(4,SyntaxError,[c,u]),t.addExtPacker(5,TypeError,[c,u]),t.addExtPacker(6,URIError,[c,u]),t.addExtPacker(10,RegExp,[s,u]),t.addExtPacker(11,Boolean,[a,u]),t.addExtPacker(12,String,[a,u]),t.addExtPacker(13,Date,[Number,u]),t.addExtPacker(15,Number,[a,u]),"undefined"!=typeof Uint8Array&&(t.addExtPacker(17,Int8Array,o),t.addExtPacker(18,Uint8Array,o),t.addExtPacker(19,Int16Array,o),t.addExtPacker(20,Uint16Array,o),t.addExtPacker(21,Int32Array,o),t.addExtPacker(22,Uint32Array,o),t.addExtPacker(23,Float32Array,o),"undefined"!=typeof Float64Array&&t.addExtPacker(24,Float64Array,o),"undefined"!=typeof Uint8ClampedArray&&t.addExtPacker(25,Uint8ClampedArray,o),t.addExtPacker(26,ArrayBuffer,o),t.addExtPacker(29,DataView,o));i.hasBuffer&&t.addExtPacker(27,Buffer,i.from)};var n,i=r("./bufferish"),Buffer=i.global,o=i.Uint8Array.from,f={name:1,message:1,stack:1,columnNumber:1,fileName:1,lineNumber:1};function u(t){return(n=n||r("./encode").encode)(t)}function a(t){return t.valueOf()}function s(t){(t=RegExp.prototype.toString.call(t).split("/")).shift();var r=[t.pop()];return r.unshift(t.join("/")),r}function c(t){var r,e={};for(r in f)e[r]=t[r];return e}},{"./bufferish":8,"./encode":15}],19:[function(r,t,e){e.setExtUnpackers=function(t){t.addExtUnpacker(14,[f,a(Error)]),t.addExtUnpacker(1,[f,a(EvalError)]),t.addExtUnpacker(2,[f,a(RangeError)]),t.addExtUnpacker(3,[f,a(ReferenceError)]),t.addExtUnpacker(4,[f,a(SyntaxError)]),t.addExtUnpacker(5,[f,a(TypeError)]),t.addExtUnpacker(6,[f,a(URIError)]),t.addExtUnpacker(10,[f,u]),t.addExtUnpacker(11,[f,s(Boolean)]),t.addExtUnpacker(12,[f,s(String)]),t.addExtUnpacker(13,[f,s(Date)]),t.addExtUnpacker(15,[f,s(Number)]),"undefined"!=typeof Uint8Array&&(t.addExtUnpacker(17,s(Int8Array)),t.addExtUnpacker(18,s(Uint8Array)),t.addExtUnpacker(19,[c,s(Int16Array)]),t.addExtUnpacker(20,[c,s(Uint16Array)]),t.addExtUnpacker(21,[c,s(Int32Array)]),t.addExtUnpacker(22,[c,s(Uint32Array)]),t.addExtUnpacker(23,[c,s(Float32Array)]),"undefined"!=typeof Float64Array&&t.addExtUnpacker(24,[c,s(Float64Array)]),"undefined"!=typeof Uint8ClampedArray&&t.addExtUnpacker(25,s(Uint8ClampedArray)),t.addExtUnpacker(26,c),t.addExtUnpacker(29,[c,s(DataView)]));i.hasBuffer&&t.addExtUnpacker(27,i.from)};var n,i=r("./bufferish"),o=(i.global,{name:1,message:1,stack:1,columnNumber:1,fileName:1,lineNumber:1});function f(t){return(n=n||r("./decode").decode)(t)}function u(t){return RegExp.apply(null,t)}function a(n){return function(t){var r,e=new n;for(r in o)e[r]=t[r];return e}}function s(r){return function(t){return new r(t)}}function c(t){return new Uint8Array(t).buffer}},{"./bufferish":8,"./decode":12}],20:[function(t,r,e){t("./read-core"),t("./write-core"),e.createCodec=t("./codec-base").createCodec},{"./codec-base":9,"./read-core":22,"./write-core":25}],21:[function(t,r,e){e.FlexDecoder=o,e.FlexEncoder=f;var n=t("./bufferish"),i="BUFFER_SHORTAGE";function o(){if(!(this instanceof o))return new o}function f(){if(!(this instanceof f))return new f}function u(){throw new Error("method not implemented: write()")}function a(){throw new Error("method not implemented: fetch()")}function s(){return this.buffers&&this.buffers.length?(this.flush(),this.pull()):this.fetch()}function c(t){(this.buffers||(this.buffers=[])).push(t)}function h(){return(this.buffers||(this.buffers=[])).shift()}function l(e){return function(t){for(var r in e)t[r]=e[r];return t}}o.mixin=l({bufferish:n,write:function(t){var r=this.offset?n.prototype.slice.call(this.buffer,this.offset):this.buffer;this.buffer=r?t?this.bufferish.concat([r,t]):r:t,this.offset=0},fetch:a,flush:function(){for(;this.offset<this.buffer.length;){var t,r=this.offset;try{t=this.fetch()}catch(t){if(t&&t.message!=i)throw t;this.offset=r;break}this.push(t)}},push:c,pull:h,read:s,reserve:function(t){var r=this.offset,t=r+t;if(t>this.buffer.length)throw new Error(i);return this.offset=t,r},offset:0}),o.mixin(o.prototype),f.mixin=l({bufferish:n,write:u,fetch:function(){var t=this.start;{var r;if(t<this.offset)return r=this.start=this.offset,n.prototype.slice.call(this.buffer,t,r)}},flush:function(){for(;this.start<this.offset;){var t=this.fetch();t&&this.push(t)}},push:c,pull:function(){var t=this.buffers||(this.buffers=[]),r=1<t.length?this.bufferish.concat(t):t[0];return t.length=0,r},read:s,reserve:function(t){var r=0|t;if(this.buffer){var e=this.buffer.length,n=0|this.offset,i=n+r;if(i<e)return this.offset=i,n;this.flush(),t=Math.max(t,Math.min(2*e,this.maxBufferSize))}return t=Math.max(t,this.minBufferSize),this.buffer=this.bufferish.alloc(t),this.start=0,this.offset=r,0},send:function(t){var r=t.length;r>this.minBufferSize?(this.flush(),this.push(t)):(r=this.reserve(r),n.prototype.copy.call(t,this.buffer,r))},maxBufferSize:65536,minBufferSize:2048,offset:0,start:0}),f.mixin(f.prototype)},{"./bufferish":8}],22:[function(t,r,e){var n=t("./ext-buffer").ExtBuffer,i=t("./ext-unpacker"),o=t("./read-format").readUint8,f=t("./read-token"),u=t("./codec-base");function a(t){var n=f.getReadToken(t);return function(t){var r=o(t),e=n[r];if(e)return e(t);throw new Error("Invalid type: "+(r&&"0x"+r.toString(16)))}}function s(){var t=this.options;return this.decode=a(t),t&&t.preset&&i.setExtUnpackers(this),this}u.install({addExtUnpacker:function(t,r){(this.extUnpackers||(this.extUnpackers=[]))[t]=u.filter(r)},getExtUnpacker:function(r){return(this.extUnpackers||(this.extUnpackers=[]))[r]||function(t){return new n(t,r)}},init:s}),e.preset=s.call(u.preset)},{"./codec-base":9,"./ext-buffer":17,"./ext-unpacker":19,"./read-format":23,"./read-token":24}],23:[function(t,r,e){var n=t("ieee754"),i=t("int64-buffer"),o=i.Uint64BE,f=i.Int64BE,u=(e.getReadFormat=function(t){var r=u.hasArrayBuffer&&t&&t.binarraybuffer,e=t&&t.int64;return{map:s&&t&&t.usemap?d:p,array:y,str:g,bin:r?w:b,ext:v,uint8:E,uint16:m,uint32:B,uint64:R(8,e?_:P),int8:A,int16:x,int32:U,int64:R(8,e?T:k),float32:R(4,S),float64:R(8,I)}},e.readUint8=E,t("./bufferish")),a=t("./bufferish-proto"),s="undefined"!=typeof Map,c=!0,h="BUFFER_SHORTAGE";function l(t,r){if(r>t.buffer.length-t.offset)throw new Error(h)}function p(t,r){l(t,2*r);for(var e={},n=new Array(r),i=new Array(r),o=t.codec.decode,f=0;f<r;f++)n[f]=o(t),i[f]=o(t);for(f=0;f<r;f++)e[n[f]]=i[f];return e}function d(t,r){l(t,2*r);for(var e=new Map,n=new Array(r),i=new Array(r),o=t.codec.decode,f=0;f<r;f++)n[f]=o(t),i[f]=o(t);for(f=0;f<r;f++)e.set(n[f],i[f]);return e}function y(t,r){l(t,r);for(var e=new Array(r),n=t.codec.decode,i=0;i<r;i++)e[i]=n(t);return e}function g(t,r){var e=t.reserve(r);return a.toString.call(t.buffer,"utf-8",e,e+r)}function b(t,r){var e=t.reserve(r),t=a.slice.call(t.buffer,e,e+r);return u.from(t)}function w(t,r){var e=t.reserve(r),t=a.slice.call(t.buffer,e,e+r);return u.Uint8Array.from(t).buffer}function v(t,r){var e=t.reserve(r+1),n=t.buffer[e++],r=e+r,i=t.codec.getExtUnpacker(n);if(i)return i(a.slice.call(t.buffer,e,r));throw new Error("Invalid ext type: "+(n&&"0x"+n.toString(16)))}function E(t){var r=t.reserve(1);return t.buffer[r]}function A(t){var r=t.reserve(1),t=t.buffer[r];return 128&t?t-256:t}function m(t){var r=t.reserve(2),t=t.buffer;return t[r++]<<8|t[r]}function x(t){var r=t.reserve(2),t=t.buffer,t=t[r++]<<8|t[r];return 32768&t?t-65536:t}function B(t){var r=t.reserve(4),t=t.buffer;return 16777216*t[r++]+(t[r++]<<16)+(t[r++]<<8)+t[r]}function U(t){var r=t.reserve(4),t=t.buffer;return t[r++]<<24|t[r++]<<16|t[r++]<<8|t[r]}function R(e,n){return function(t){var r=t.reserve(e);return n.call(t.buffer,r,c)}}function P(t){return new o(this,t).toNumber()}function k(t){return new f(this,t).toNumber()}function _(t){return new o(this,t)}function T(t){return new f(this,t)}function S(t){return n.read(this,t,!1,23,4)}function I(t){return n.read(this,t,!1,52,8)}},{"./bufferish":8,"./bufferish-proto":6,ieee754:33,"int64-buffer":34}],24:[function(t,r,e){var n=t("./read-format");function i(t){for(var r=new Array(256),e=0;e<=127;e++)r[e]=o(e);for(e=128;e<=143;e++)r[e]=u(e-128,t.map);for(e=144;e<=159;e++)r[e]=u(e-144,t.array);for(e=160;e<=191;e++)r[e]=u(e-160,t.str);for(r[192]=o(null),r[193]=null,r[194]=o(!1),r[195]=o(!0),r[196]=f(t.uint8,t.bin),r[197]=f(t.uint16,t.bin),r[198]=f(t.uint32,t.bin),r[199]=f(t.uint8,t.ext),r[200]=f(t.uint16,t.ext),r[201]=f(t.uint32,t.ext),r[202]=t.float32,r[203]=t.float64,r[204]=t.uint8,r[205]=t.uint16,r[206]=t.uint32,r[207]=t.uint64,r[208]=t.int8,r[209]=t.int16,r[210]=t.int32,r[211]=t.int64,r[212]=u(1,t.ext),r[213]=u(2,t.ext),r[214]=u(4,t.ext),r[215]=u(8,t.ext),r[216]=u(16,t.ext),r[217]=f(t.uint8,t.str),r[218]=f(t.uint16,t.str),r[219]=f(t.uint32,t.str),r[220]=f(t.uint16,t.array),r[221]=f(t.uint32,t.array),r[222]=f(t.uint16,t.map),r[223]=f(t.uint32,t.map),e=224;e<=255;e++)r[e]=o(e-256);return r}function o(t){return function(){return t}}function f(e,n){return function(t){var r=e(t);return n(t,r)}}function u(r,e){return function(t){return e(t,r)}}e.getReadToken=function(t){var r=n.getReadFormat(t);return(t&&t.useraw?function(t){var r,e=i(t).slice();for(e[217]=e[196],e[218]=e[197],e[219]=e[198],r=160;r<=191;r++)e[r]=u(r-160,t.bin);return e}:i)(r)}},{"./read-format":23}],25:[function(t,r,e){var o=t("./ext-buffer").ExtBuffer,n=t("./ext-packer"),i=t("./write-type"),f=t("./codec-base");function u(t){var n=i.getWriteType(t);return function(t,r){var e=n[typeof r];if(!e)throw new Error('Unsupported type "'+typeof r+'": '+r);e(t,r)}}function a(){var t=this.options;return this.encode=u(t),t&&t.preset&&n.setExtPackers(this),this}f.install({addExtPacker:function(r,t,e){e=f.filter(e);var n=t.name;n&&"Object"!==n?(this.extPackers||(this.extPackers={}))[n]=i:(this.extEncoderList||(this.extEncoderList=[])).unshift([t,i]);function i(t){return e&&(t=e(t)),new o(t,r)}},getExtPacker:function(t){var r=this.extPackers||(this.extPackers={}),e=t.constructor,t=e&&e.name&&r[e.name];if(t)return t;for(var n=this.extEncoderList||(this.extEncoderList=[]),i=n.length,o=0;o<i;o++){var f=n[o];if(e===f[0])return f[1]}},init:a}),e.preset=a.call(f.preset)},{"./codec-base":9,"./ext-buffer":17,"./ext-packer":18,"./write-type":27}],26:[function(t,r,e){var n=t("ieee754"),i=t("int64-buffer"),o=i.Uint64BE,f=i.Int64BE,u=t("./write-uint8").uint8,a=t("./bufferish"),Buffer=a.global,s=a.hasBuffer&&"TYPED_ARRAY_SUPPORT"in Buffer&&!Buffer.TYPED_ARRAY_SUPPORT,c=a.hasBuffer&&Buffer.prototype||{};function h(){var t=u.slice();return t[196]=l(196),t[197]=p(197),t[198]=d(198),t[199]=l(199),t[200]=p(200),t[201]=d(201),t[202]=y(202,4,c.writeFloatBE||w,!0),t[203]=y(203,8,c.writeDoubleBE||v,!0),t[204]=l(204),t[205]=p(205),t[206]=d(206),t[207]=y(207,8,g),t[208]=l(208),t[209]=p(209),t[210]=d(210),t[211]=y(211,8,b),t[217]=l(217),t[218]=p(218),t[219]=d(219),t[220]=p(220),t[221]=d(221),t[222]=p(222),t[223]=d(223),t}function l(n){return function(t,r){var e=t.reserve(2),t=t.buffer;t[e++]=n,t[e]=r}}function p(n){return function(t,r){var e=t.reserve(3),t=t.buffer;t[e++]=n,t[e++]=r>>>8,t[e]=r}}function d(n){return function(t,r){var e=t.reserve(5),t=t.buffer;t[e++]=n,t[e++]=r>>>24,t[e++]=r>>>16,t[e++]=r>>>8,t[e]=r}}function y(n,i,o,f){return function(t,r){var e=t.reserve(i+1);t.buffer[e++]=n,o.call(t.buffer,r,e,f)}}function g(t,r){new o(this,r,t)}function b(t,r){new f(this,r,t)}function w(t,r){n.write(this,t,r,!1,23,4)}function v(t,r){n.write(this,t,r,!1,52,8)}e.getWriteToken=function(t){return(t&&t.uint8array?function(){var t=h();return t[202]=y(202,4,w),t[203]=y(203,8,v),t}:s||a.hasBuffer&&t&&t.safe?function(){var t=u.slice();return t[196]=y(196,1,Buffer.prototype.writeUInt8),t[197]=y(197,2,Buffer.prototype.writeUInt16BE),t[198]=y(198,4,Buffer.prototype.writeUInt32BE),t[199]=y(199,1,Buffer.prototype.writeUInt8),t[200]=y(200,2,Buffer.prototype.writeUInt16BE),t[201]=y(201,4,Buffer.prototype.writeUInt32BE),t[202]=y(202,4,Buffer.prototype.writeFloatBE),t[203]=y(203,8,Buffer.prototype.writeDoubleBE),t[204]=y(204,1,Buffer.prototype.writeUInt8),t[205]=y(205,2,Buffer.prototype.writeUInt16BE),t[206]=y(206,4,Buffer.prototype.writeUInt32BE),t[207]=y(207,8,g),t[208]=y(208,1,Buffer.prototype.writeInt8),t[209]=y(209,2,Buffer.prototype.writeInt16BE),t[210]=y(210,4,Buffer.prototype.writeInt32BE),t[211]=y(211,8,b),t[217]=y(217,1,Buffer.prototype.writeUInt8),t[218]=y(218,2,Buffer.prototype.writeUInt16BE),t[219]=y(219,4,Buffer.prototype.writeUInt32BE),t[220]=y(220,2,Buffer.prototype.writeUInt16BE),t[221]=y(221,4,Buffer.prototype.writeUInt32BE),t[222]=y(222,2,Buffer.prototype.writeUInt16BE),t[223]=y(223,4,Buffer.prototype.writeUInt32BE),t}:h)()}},{"./bufferish":8,"./write-uint8":28,ieee754:33,"int64-buffer":34}],27:[function(t,r,e){var b=t("isarray"),n=t("int64-buffer"),w=n.Uint64BE,v=n.Int64BE,f=t("./bufferish"),a=t("./bufferish-proto"),u=t("./write-token"),E=t("./write-uint8").uint8,A=t("./ext-buffer").ExtBuffer,s="undefined"!=typeof Uint8Array,c="undefined"!=typeof Map,m=[];m[1]=212,m[2]=213,m[4]=214,m[8]=215,m[16]=216,e.getWriteType=function(t){var l=u.getWriteToken(t),r=t&&t.useraw,e=s&&t&&t.binarraybuffer,p=e?f.isArrayBuffer:f.isBuffer,d=e?function(t,r){i(t,new Uint8Array(r))}:i,y=c&&t&&t.usemap?function(n,t){if(!(t instanceof Map))return o(n,t);var r=t.size,i=(l[r<16?128+r:r<=65535?222:223](n,r),n.codec.encode);t.forEach(function(t,r,e){i(n,r),i(n,t)})}:o;return{boolean:function(t,r){l[r?195:194](t,r)},function:g,number:function(t,r){var e=0|r;r!==e?0<=r&&r<=4294967295&&Math.floor(r)===r?l[206](t,r):l[203](t,r):l[-32<=e&&e<=127?255&e:0<=e?e<=255?204:e<=65535?205:206:-128<=e?208:-32768<=e?209:210](t,e)},object:r?function(t,r){if(p(r))return function(t,r){var e=r.length;l[e<32?160+e:e<=65535?218:219](t,e),t.send(r)}(t,r);n(t,r)}:n,string:function(u){return function(t,r){var e=r.length,n=5+3*e,n=(t.offset=t.reserve(n),t.buffer),i=u(e),o=t.offset+i,r=(e=a.write.call(n,r,o),u(e));{var f;i!==r&&(i=o+r-i,f=o+e,a.copy.call(n,n,i,o,f))}l[1===r?160+e:r<=3?215+r:219](t,e),t.offset+=e}}(r?function(t){return t<32?1:t<=65535?3:5}:function(t){return t<32?1:t<=255?2:t<=65535?3:5}),symbol:g,undefined:g};function n(t,r){if(null===r)return g(t,r);if(p(r))return d(t,r);if(b(r))for(var e=t,n=r,i=n.length,o=(l[i<16?144+i:i<=65535?220:221](e,i),e.codec.encode),f=0;f<i;f++)o(e,n[f]);else if(w.isUint64BE(r))u=r,l[207](t,u.toArray());else if(v.isInt64BE(r))u=r,l[211](t,u.toArray());else{var u,a,s,c,h=t.codec.getExtPacker(r);if((r=h?h(r):r)instanceof A)return h=t,s=(a=r).buffer,c=s.length,l[m[c]||(c<255?199:c<=65535?200:201)](h,c),E[a.type](h),void h.send(s);y(t,r)}}function g(t,r){l[192](t,r)}function i(t,r){var e=r.length;l[e<255?196:e<=65535?197:198](t,e),t.send(r)}function o(r,e){var t=Object.keys(e),n=t.length,i=(l[n<16?128+n:n<=65535?222:223](r,n),r.codec.encode);t.forEach(function(t){i(r,t),i(r,e[t])})}}},{"./bufferish":8,"./bufferish-proto":6,"./ext-buffer":17,"./write-token":26,"./write-uint8":28,"int64-buffer":34,isarray:35}],28:[function(t,r,e){for(var n=e.uint8=new Array(256),i=0;i<=255;i++)n[i]=function(e){return function(t){var r=t.reserve(1);t.buffer[r]=e}}(i)},{}],29:[function(t,r,e){e.byteLength=function(t){var t=c(t),r=t[0],t=t[1];return 3*(r+t)/4-t},e.toByteArray=function(t){var r,e,n=c(t),i=n[0],n=n[1],o=new s(function(t,r){return 3*(t+r)/4-r}(i,n)),f=0,u=0<n?i-4:i;for(e=0;e<u;e+=4)r=a[t.charCodeAt(e)]<<18|a[t.charCodeAt(e+1)]<<12|a[t.charCodeAt(e+2)]<<6|a[t.charCodeAt(e+3)],o[f++]=r>>16&255,o[f++]=r>>8&255,o[f++]=255&r;2===n&&(r=a[t.charCodeAt(e)]<<2|a[t.charCodeAt(e+1)]>>4,o[f++]=255&r);1===n&&(r=a[t.charCodeAt(e)]<<10|a[t.charCodeAt(e+1)]<<4|a[t.charCodeAt(e+2)]>>2,o[f++]=r>>8&255,o[f++]=255&r);return o},e.fromByteArray=function(t){for(var r,e=t.length,n=e%3,i=[],o=0,f=e-n;o<f;o+=16383)i.push(function(t,r,e){for(var n,i=[],o=r;o<e;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),i.push(function(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}(n));return i.join("")}(t,o,f<o+16383?f:o+16383));1==n?(r=t[e-1],i.push(u[r>>2]+u[r<<4&63]+"==")):2==n&&(r=(t[e-2]<<8)+t[e-1],i.push(u[r>>10]+u[r>>4&63]+u[r<<2&63]+"="));return i.join("")};for(var u=[],a=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=n.length;i<o;++i)u[i]=n[i],a[n.charCodeAt(i)]=i;function c(t){var r=t.length;if(0<r%4)throw new Error("Invalid string. Length must be a multiple of 4");t=t.indexOf("="),r=(t=-1===t?r:t)===r?0:4-t%4;return[t,r]}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},{}],30:[function(S,t,I){!function(t,Buffer){!function(){var B=S("base64-js"),o=S("ieee754"),u=S("isarray");function e(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,r){if(e()<r)throw new RangeError("Invalid typed array length");return Buffer.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=Buffer.prototype:(t=null===t?new Buffer(r):t).length=r,t}function Buffer(t,r,e){if(!(Buffer.TYPED_ARRAY_SUPPORT||this instanceof Buffer))return new Buffer(t,r,e);if("number"!=typeof t)return n(this,t,r,e);if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}function n(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');if("undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer){var i=t,o=r,f=e;if(o.byteLength,f<0||o.byteLength<f)throw new RangeError("'offset' is out of bounds");if(o.byteLength<f+(n||0))throw new RangeError("'length' is out of bounds");return o=void 0===f&&void 0===n?new Uint8Array(o):void 0===n?new Uint8Array(o,f):new Uint8Array(o,f,n),Buffer.TYPED_ARRAY_SUPPORT?(i=o).__proto__=Buffer.prototype:i=s(i,o),i}if("string"!=typeof r){f=t,n=r;if(Buffer.isBuffer(n))return o=0|c(n.length),0!==(f=a(f,o)).length&&n.copy(f,0,0,o),f;if(n){if("undefined"!=typeof ArrayBuffer&&n.buffer instanceof ArrayBuffer||"length"in n)return"number"!=typeof n.length||function(t){return t!=t}(n.length)?a(f,0):s(f,n);if("Buffer"===n.type&&u(n.data))return s(f,n.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}i=t,n=r,t=e;if(Buffer.isEncoding(t="string"==typeof t&&""!==t?t:"utf8"))return r=0|h(n,t),i=(n=(i=a(i,r)).write(n,t))!==r?i.slice(0,n):i;throw new TypeError('"encoding" must be a valid string encoding')}function i(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,r){if(i(r),t=a(t,r<0?0:0|c(r)),!Buffer.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function s(t,r){var e=r.length<0?0:0|c(r.length);t=a(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function c(t){if(e()<=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+e().toString(16)+" bytes");return 0|t}function h(t,r){if(Buffer.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;var e=(t="string"!=typeof t?""+t:t).length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return k(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return _(t).length;default:if(n)return k(t).length;r=(""+r).toLowerCase(),n=!0}}function r(t,r,e){var n,i=!1;if((r=void 0===r||r<0?0:r)>this.length)return"";if((e=void 0===e||e>this.length?this.length:e)<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t=t||"utf8";;)switch(t){case"hex":var o=this,f=r,u=e,a=o.length;(!u||u<0||a<u)&&(u=a);for(var s="",c=f=!f||f<0?0:f;c<u;++c)s+=function(t){return t<16?"0"+t.toString(16):t.toString(16)}(o[c]);return s;case"utf8":case"utf-8":return U(this,r,e);case"ascii":var h=this,a=r,l=e,p="";l=Math.min(h.length,l);for(var d=a;d<l;++d)p+=String.fromCharCode(127&h[d]);return p;case"latin1":case"binary":var y=this,f=r,g=e,b="";g=Math.min(y.length,g);for(var w=f;w<g;++w)b+=String.fromCharCode(y[w]);return b;case"base64":return v=this,n=e,0===(E=r)&&n===v.length?B.fromByteArray(v):B.fromByteArray(v.slice(E,n));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":for(var v=r,E=e,A=this.slice(v,E),m="",x=0;x<A.length;x+=2)m+=String.fromCharCode(A[x]+256*A[x+1]);return m;default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function l(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function p(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):2147483647<e?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,(e=(e=isNaN(e)?i?0:t.length-1:e)<0?t.length+e:e)>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=Buffer.from(r,n)),Buffer.isBuffer(r))return 0===r.length?-1:d(t,r,e,n,i);if("number"==typeof r)return r&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(i?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(t,r,e):d(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function d(t,r,e,n,i){var o=1,f=t.length,u=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;f/=o=2,u/=2,e/=2}function a(t,r){return 1===o?t[r]:t.readUInt16BE(r*o)}if(i)for(var s=-1,c=e;c<f;c++)if(a(t,c)===a(r,-1===s?0:c-s)){if(c-(s=-1===s?c:s)+1===u)return s*o}else-1!==s&&(c-=c-s),s=-1;else for(c=e=f<e+u?f-u:e;0<=c;c--){for(var h=!0,l=0;l<u;l++)if(a(t,c+l)!==a(r,l)){h=!1;break}if(h)return c}return-1}function g(t,r,e,n){return T(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,n)}function b(t,r,e,n){return T(function(t,r){for(var e,n,i=[],o=0;o<t.length&&!((r-=2)<0);++o)e=t.charCodeAt(o),n=e>>8,i.push(e%256),i.push(n);return i}(r,t.length-e),t,e,n)}function U(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,f,u,a,s=t[i],c=null,h=239<s?4:223<s?3:191<s?2:1;if(i+h<=e)switch(h){case 1:s<128&&(c=s);break;case 2:128==(192&(o=t[i+1]))&&127<(a=(31&s)<<6|63&o)&&(c=a);break;case 3:o=t[i+1],f=t[i+2],128==(192&o)&&128==(192&f)&&2047<(a=(15&s)<<12|(63&o)<<6|63&f)&&(a<55296||57343<a)&&(c=a);break;case 4:o=t[i+1],f=t[i+2],u=t[i+3],128==(192&o)&&128==(192&f)&&128==(192&u)&&65535<(a=(15&s)<<18|(63&o)<<12|(63&f)<<6|63&u)&&a<1114112&&(c=a)}null===c?(c=65533,h=1):65535<c&&(n.push((c-=65536)>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}var l=n,p=l.length;if(p<=w)return String.fromCharCode.apply(String,l);for(var d="",y=0;y<p;)d+=String.fromCharCode.apply(String,l.slice(y,y+=w));return d}I.Buffer=Buffer,I.SlowBuffer=function(t){+t!=t&&(t=0);return Buffer.alloc(+t)},I.INSPECT_MAX_BYTES=50,Buffer.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){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}}(),I.kMaxLength=e(),Buffer.poolSize=8192,Buffer._augment=function(t){return t.__proto__=Buffer.prototype,t},Buffer.from=function(t,r,e){return n(null,t,r,e)},Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,"undefined"!=typeof Symbol)&&Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0}),Buffer.alloc=function(t,r,e){return n=null,r=r,e=e,i(t=t),!(t<=0)&&void 0!==r?"string"==typeof e?a(n,t).fill(r,e):a(n,t).fill(r):a(n,t);var n},Buffer.allocUnsafe=function(t){return f(null,t)},Buffer.allocUnsafeSlow=function(t){return f(null,t)},Buffer.isBuffer=function(t){return!(null==t||!t._isBuffer)},Buffer.compare=function(t,r){if(!Buffer.isBuffer(t)||!Buffer.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?1:0},Buffer.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.concat=function(t,r){if(!u(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return Buffer.alloc(0);if(void 0===r)for(i=r=0;i<t.length;++i)r+=t[i].length;for(var e=Buffer.allocUnsafe(r),n=0,i=0;i<t.length;++i){var o=t[i];if(!Buffer.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(e,n),n+=o.length}return e},Buffer.byteLength=h,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)l(this,r,r+1);return this},Buffer.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)l(this,r,r+3),l(this,r+1,r+2);return this},Buffer.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)l(this,r,r+7),l(this,r+1,r+6),l(this,r+2,r+5),l(this,r+3,r+4);return this},Buffer.prototype.toString=function(){var t=0|this.length;return 0==t?"":0===arguments.length?U(this,0,t):r.apply(this,arguments)},Buffer.prototype.equals=function(t){if(Buffer.isBuffer(t))return this===t||0===Buffer.compare(this,t);throw new TypeError("Argument must be a Buffer")},Buffer.prototype.inspect=function(){var t="",r=I.INSPECT_MAX_BYTES;return 0<this.length&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r)&&(t+=" ... "),"<Buffer "+t+">"},Buffer.prototype.compare=function(t,r,e,n,i){if(!Buffer.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),(r=void 0===r?0:r)<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(i<=n&&e<=r)return 0;if(i<=n)return-1;if(e<=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),f=(e>>>=0)-(r>>>=0),u=Math.min(o,f),a=this.slice(n,i),s=t.slice(r,e),c=0;c<u;++c)if(a[c]!==s[c]){o=a[c],f=s[c];break}return o<f?-1:f<o?1:0},Buffer.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},Buffer.prototype.indexOf=function(t,r,e){return p(this,t,r,e,!0)},Buffer.prototype.lastIndexOf=function(t,r,e){return p(this,t,r,e,!1)},Buffer.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||i<e)&&(e=i),0<t.length&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var o,f,u,a=!1;;)switch(n){case"hex":var s=this,c=t,h=r,l=e,p=(h=Number(h)||0,s.length-h);if((!l||p<(l=Number(l)))&&(l=p),(p=c.length)%2!=0)throw new TypeError("Invalid hex string");p/2<l&&(l=p/2);for(var d=0;d<l;++d){var y=parseInt(c.substr(2*d,2),16);if(isNaN(y))return d;s[h+d]=y}return d;case"utf8":case"utf-8":return p=r,u=e,T(k(t,(f=this).length-p),f,p,u);case"ascii":return g(this,t,r,e);case"latin1":case"binary":return g(this,t,r,e);case"base64":return f=this,u=r,o=e,T(_(t),f,u,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,t,r,e);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function y(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(e<t+r)throw new RangeError("Trying to access beyond buffer length")}function v(t,r,e,n,i,o){if(!Buffer.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(i<r||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function E(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function A(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>8*(n?i:3-i)&255}function m(t,r,e,n){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function x(t,r,e,n,i){return i||m(t,0,e,4),o.write(t,r,e,n,23,4),e+4}function R(t,r,e,n,i){return i||m(t,0,e,8),o.write(t,r,e,n,52,8),e+8}Buffer.prototype.slice=function(t,r){var e=this.length;if((t=~~t)<0?(t+=e)<0&&(t=0):e<t&&(t=e),(r=void 0===r?e:~~r)<0?(r+=e)<0&&(r=0):e<r&&(r=e),r<t&&(r=t),Buffer.TYPED_ARRAY_SUPPORT)(i=this.subarray(t,r)).__proto__=Buffer.prototype;else for(var n=r-t,i=new Buffer(n,void 0),o=0;o<n;++o)i[o]=this[o+t];return i},Buffer.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||y(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},Buffer.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||y(t,r,this.length);for(var n=this[t+--r],i=1;0<r&&(i*=256);)n+=this[t+--r]*i;return n},Buffer.prototype.readUInt8=function(t,r){return r||y(t,1,this.length),this[t]},Buffer.prototype.readUInt16LE=function(t,r){return r||y(t,2,this.length),this[t]|this[t+1]<<8},Buffer.prototype.readUInt16BE=function(t,r){return r||y(t,2,this.length),this[t]<<8|this[t+1]},Buffer.prototype.readUInt32LE=function(t,r){return r||y(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},Buffer.prototype.readUInt32BE=function(t,r){return r||y(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Buffer.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||y(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return(i*=128)<=n&&(n-=Math.pow(2,8*r)),n},Buffer.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||y(t,r,this.length);for(var n=r,i=1,o=this[t+--n];0<n&&(i*=256);)o+=this[t+--n]*i;return(i*=128)<=o&&(o-=Math.pow(2,8*r)),o},Buffer.prototype.readInt8=function(t,r){return r||y(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},Buffer.prototype.readInt16LE=function(t,r){r||y(t,2,this.length);r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function(t,r){r||y(t,2,this.length);r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function(t,r){return r||y(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Buffer.prototype.readInt32BE=function(t,r){return r||y(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Buffer.prototype.readFloatLE=function(t,r){return r||y(t,4,this.length),o.read(this,t,!0,23,4)},Buffer.prototype.readFloatBE=function(t,r){return r||y(t,4,this.length),o.read(this,t,!1,23,4)},Buffer.prototype.readDoubleLE=function(t,r){return r||y(t,8,this.length),o.read(this,t,!0,52,8)},Buffer.prototype.readDoubleBE=function(t,r){return r||y(t,8,this.length),o.read(this,t,!1,52,8)},Buffer.prototype.writeUIntLE=function(t,r,e,n){t=+t,r|=0,e|=0,n||v(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},Buffer.prototype.writeUIntBE=function(t,r,e,n){t=+t,r|=0,e|=0,n||v(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;0<=--i&&(o*=256);)this[r+i]=t/o&255;return r+e},Buffer.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||v(this,t,r,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},Buffer.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||v(this,t,r,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):E(this,t,r,!0),r+2},Buffer.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||v(this,t,r,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):E(this,t,r,!1),r+2},Buffer.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||v(this,t,r,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):A(this,t,r,!0),r+4},Buffer.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||v(this,t,r,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):A(this,t,r,!1),r+4},Buffer.prototype.writeIntLE=function(t,r,e,n){t=+t,r|=0,n||v(this,t,r,e,(n=Math.pow(2,8*e-1))-1,-n);var i=0,o=1,f=0;for(this[r]=255&t;++i<e&&(o*=256);)t<0&&0===f&&0!==this[r+i-1]&&(f=1),this[r+i]=(t/o>>0)-f&255;return r+e},Buffer.prototype.writeIntBE=function(t,r,e,n){t=+t,r|=0,n||v(this,t,r,e,(n=Math.pow(2,8*e-1))-1,-n);var i=e-1,o=1,f=0;for(this[r+i]=255&t;0<=--i&&(o*=256);)t<0&&0===f&&0!==this[r+i+1]&&(f=1),this[r+i]=(t/o>>0)-f&255;return r+e},Buffer.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||v(this,t,r,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&(t=t<0?255+t+1:t),r+1},Buffer.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||v(this,t,r,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):E(this,t,r,!0),r+2},Buffer.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||v(this,t,r,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):E(this,t,r,!1),r+2},Buffer.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||v(this,t,r,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):A(this,t,r,!0),r+4},Buffer.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||v(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),Buffer.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):A(this,t,r,!1),r+4},Buffer.prototype.writeFloatLE=function(t,r,e){return x(this,t,r,!0,e)},Buffer.prototype.writeFloatBE=function(t,r,e){return x(this,t,r,!1,e)},Buffer.prototype.writeDoubleLE=function(t,r,e){return R(this,t,r,!0,e)},Buffer.prototype.writeDoubleBE=function(t,r,e){return R(this,t,r,!1,e)},Buffer.prototype.copy=function(t,r,e,n){if(e=e||0,n||0===n||(n=this.length),r>=t.length&&(r=t.length),(n=0<n&&n<e?e:n)===e)return 0;if(0===t.length||0===this.length)return 0;if((r=r||0)<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=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);var i,o=(n=t.length-r<n-e?t.length-r+e:n)-e;if(this===t&&e<r&&r<n)for(i=o-1;0<=i;--i)t[i+r]=this[i+e];else if(o<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+o),r);return o},Buffer.prototype.fill=function(t,r,e,n){if("string"==typeof t){var i;if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length&&(i=t.charCodeAt(0))<256&&(t=i),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Buffer.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(!(e<=r))if(r>>>=0,e=void 0===e?this.length:e>>>0,"number"==typeof(t=t||0))for(u=r;u<e;++u)this[u]=t;else for(var o=Buffer.isBuffer(t)?t:k(new Buffer(t,n).toString()),f=o.length,u=0;u<e-r;++u)this[u+r]=o[u%f];return this};var P=/[^+\/0-9A-Za-z-_]/g;function k(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],f=0;f<n;++f){if(55295<(e=t.charCodeAt(f))&&e<57344){if(!i){if(56319<e){-1<(r-=3)&&o.push(239,191,189);continue}if(f+1===n){-1<(r-=3)&&o.push(239,191,189);continue}i=e;continue}if(e<56320){-1<(r-=3)&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&-1<(r-=3)&&o.push(239,191,189);if(i=null,e<128){if(--r<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function _(t){return B.toByteArray(function(t){var r;if((t=((r=t).trim?r.trim():r.replace(/^\s+|\s+$/g,"")).replace(P,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function T(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},S("buffer").Buffer)},{"base64-js":29,buffer:30,ieee754:33,isarray:31}],31:[function(t,r,e){var n={}.toString;r.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},{}],32:[function(t,r,e){function n(t){for(var r in a)t[r]=a[r];return t}function i(t,r){var e,n=this;if(arguments.length){if(r){if(e=o(n,t,!0)){if(!(e=e.filter(function(t){return t!==r&&t.originalListener!==r})).length)return i.call(n,t);n[u][t]=e}}else if((e=n[u])&&(delete e[t],!Object.keys(e).length))return i.call(n)}else delete n[u];return n}function o(t,r,e){if(!e||t[u])return(e=t[u]||(t[u]={}))[r]||(e[r]=[])}var f,u,a;f=function t(){if(!(this instanceof t))return new t},void 0!==r&&(r.exports=f),u="listeners",a={on:function(t,r){return o(this,t).push(r),this},once:function(t,r){var e=this;return n.originalListener=r,o(e,t).push(n),e;function n(){i.call(e,t,n),r.apply(this,arguments)}},off:i,emit:function(t,r){var e=this,t=o(e,t,!0);if(!t)return!1;var n=arguments.length;{var i;1===n?t.forEach(function(t){t.call(e)}):2===n?t.forEach(function(t){t.call(e,r)}):(i=Array.prototype.slice.call(arguments,1),t.forEach(function(t){t.apply(e,i)}))}return!!t.length}},n(f.prototype),f.mixin=n},{}],33:[function(t,r,e){e.read=function(t,r,e,n,i){var o,f,u=8*i-n-1,a=(1<<u)-1,s=a>>1,c=-7,h=e?i-1:0,l=e?-1:1,i=t[r+h];for(h+=l,o=i&(1<<-c)-1,i>>=-c,c+=u;0<c;o=256*o+t[r+h],h+=l,c-=8);for(f=o&(1<<-c)-1,o>>=-c,c+=n;0<c;f=256*f+t[r+h],h+=l,c-=8);if(0===o)o=1-s;else{if(o===a)return f?NaN:1/0*(i?-1:1);f+=Math.pow(2,n),o-=s}return(i?-1:1)*f*Math.pow(2,o-n)},e.write=function(t,r,e,n,i,o){var f,u,a=8*o-i-1,s=(1<<a)-1,c=s>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:o-1,p=n?1:-1,o=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(u=isNaN(r)?1:0,f=s):(f=Math.floor(Math.log(r)/Math.LN2),r*(n=Math.pow(2,-f))<1&&(f--,n*=2),2<=(r+=1<=f+c?h/n:h*Math.pow(2,1-c))*n&&(f++,n/=2),s<=f+c?(u=0,f=s):1<=f+c?(u=(r*n-1)*Math.pow(2,i),f+=c):(u=r*Math.pow(2,c-1)*Math.pow(2,i),f=0));8<=i;t[e+l]=255&u,l+=p,u/=256,i-=8);for(f=f<<i|u,a+=i;0<a;t[e+l]=255&f,l+=p,f/=256,a-=8);t[e+l-p]|=128*o}},{}],34:[function(t,r,e){!function(Buffer){!function(){var h,v,E,A,m,x,B,n,U;function t(t,r,u){var p=r?0:4,d=r?4:0,n=r?0:3,i=r?1:2,o=r?2:1,f=r?3:0,y=r?S:Y,g=r?I:C,r=b.prototype,e="is"+t,a="_"+e;return r.buffer=void 0,r.offset=0,r[a]=!0,r.toNumber=s,r.toString=function(t){var r=this.buffer,e=this.offset,n=c(r,e+p),i=c(r,e+d),o="",r=!u&&2147483648&n;r&&(n=~n,i=U-i);t=t||10;for(;;){var f=n%t*U+i;if(n=Math.floor(n/t),i=Math.floor(f/t),o=(f%t).toString(t)+o,!n&&!i)break}r&&(o="-"+o);return o},r.toJSON=s,r.toArray=l,A&&(r.toBuffer=R),m&&(r.toArrayBuffer=P),b[e]=function(t){return!(!t||!t[a])},h[t]=b;function b(t,r,e,n){if(!(this instanceof b))return new b(t,r,e,n);var i=this;if(m&&x&&(t instanceof x&&(t=new m(t)),e instanceof x)&&(e=new m(e)),t||r||e||v){if(k(t,r)||(o=v||Array,n=r,e=t,r=0,t=v===A?A.alloc(8):new o(8)),i.buffer=t,i.offset=r|=0,E!=typeof e)if("string"!=typeof e)k(e,n)?_(t,r,e,n):"number"==typeof n?(w(t,r+p,e),w(t,r+d,n)):0<e?y(t,r,e):e<0?g(t,r,e):_(t,r,B,0);else{for(var o=t,t=r,f=e,u=n||10,a=0,s=f.length,c=0,h=0,r=("-"===f[0]&&a++,a);a<s;){var l=parseInt(f[a++],u);if(!(0<=l))break;h=h*u+l,c=c*u+Math.floor(h/U),h%=U}r&&(c=~c,h?h=U-h:c++),w(o,t+p,c),w(o,t+d,h)}}else i.buffer=T(B,0)}function s(){var t=this.buffer,r=this.offset,e=c(t,r+p),t=c(t,r+d);return u||(e|=0),e?e*U+t:t}function w(t,r,e){t[r+f]=255&e,t[r+o]=255&(e>>=8),t[r+i]=255&(e>>=8),t[r+n]=255&(e>>=8)}function c(t,r){return 16777216*t[r+n]+(t[r+i]<<16)+(t[r+o]<<8)+t[r+f]}}function l(t){var r=this.buffer,e=this.offset;return v=null,!1!==t&&n(r)?8===r.length?r:r.slice(e,e+8):T(r,e)}function R(t){var r=this.buffer,e=this.offset;return v=A,!1!==t&&A.isBuffer(r)?8===r.length?r:r.slice(e,e+8):A.from(P.call(this,t))}function P(t){var r=this.buffer,e=this.offset,n=r.buffer;return v=m,!1!==t&&!r.offset&&n instanceof x?8===n.byteLength?n:n.slice(e,e+8):(_(t=new m(8),0,r,e),t.buffer)}function k(t,r){var e=t&&t.length;return r|=0,e&&r+8<=e&&"string"!=typeof t[r]}function _(t,r,e,n){r|=0,n|=0;for(var i=0;i<8;i++)t[r++]=255&e[n++]}function T(t,r){return Array.prototype.slice.call(t,r,r+8)}function S(t,r,e){for(var n=r+8;r<n;)t[--n]=255&e,e/=256}function I(t,r,e){var n=r+8;for(e++;r<n;)t[--n]=255&-e^255,e/=256}function Y(t,r,e){for(var n=r+8;r<n;)t[r++]=255&e,e/=256}function C(t,r,e){var n=r+8;for(e++;r<n;)t[r++]=255&-e^255,e/=256}h="object"==typeof e&&"string"!=typeof e.nodeName?e:this||{},A=(E="undefined")!=typeof Buffer&&Buffer,m=E!=typeof Uint8Array&&Uint8Array,x=E!=typeof ArrayBuffer&&ArrayBuffer,B=[0,0,0,0,0,0,0,0],n=Array.isArray||function(t){return!!t&&"[object Array]"==Object.prototype.toString.call(t)},U=4294967296,t("Uint64BE",!0,!0),t("Int64BE",!0,!1),t("Uint64LE",!1,!0),t("Int64LE",!1,!1)}.call(this)}.call(this,t("buffer").Buffer)},{buffer:30}],35:[function(t,r,e){arguments[4][31][0].apply(e,arguments)},{dup:31}]},{},[1])(1)});
|
package/lib/read-format.js
CHANGED
|
@@ -13,6 +13,7 @@ var BufferProto = require("./bufferish-proto");
|
|
|
13
13
|
|
|
14
14
|
var HAS_MAP = ("undefined" !== typeof Map);
|
|
15
15
|
var NO_ASSERT = true;
|
|
16
|
+
var BUFFER_SHORTAGE = "BUFFER_SHORTAGE";
|
|
16
17
|
|
|
17
18
|
function getReadFormat(options) {
|
|
18
19
|
var binarraybuffer = Bufferish.hasArrayBuffer && options && options.binarraybuffer;
|
|
@@ -40,7 +41,14 @@ function getReadFormat(options) {
|
|
|
40
41
|
return readFormat;
|
|
41
42
|
}
|
|
42
43
|
|
|
44
|
+
// every element takes at least one byte, so a count beyond the remaining buffer
|
|
45
|
+
// can never be satisfied -- bail before pre-allocating an attacker-sized array
|
|
46
|
+
function checkLength(decoder, len) {
|
|
47
|
+
if (len > decoder.buffer.length - decoder.offset) throw new Error(BUFFER_SHORTAGE);
|
|
48
|
+
}
|
|
49
|
+
|
|
43
50
|
function map_to_obj(decoder, len) {
|
|
51
|
+
checkLength(decoder, 2 * len);
|
|
44
52
|
var value = {};
|
|
45
53
|
var i;
|
|
46
54
|
var k = new Array(len);
|
|
@@ -58,6 +66,7 @@ function map_to_obj(decoder, len) {
|
|
|
58
66
|
}
|
|
59
67
|
|
|
60
68
|
function map_to_map(decoder, len) {
|
|
69
|
+
checkLength(decoder, 2 * len);
|
|
61
70
|
var value = new Map();
|
|
62
71
|
var i;
|
|
63
72
|
var k = new Array(len);
|
|
@@ -75,6 +84,7 @@ function map_to_map(decoder, len) {
|
|
|
75
84
|
}
|
|
76
85
|
|
|
77
86
|
function array(decoder, len) {
|
|
87
|
+
checkLength(decoder, len);
|
|
78
88
|
var value = new Array(len);
|
|
79
89
|
var decode = decoder.codec.decode;
|
|
80
90
|
for (var i = 0; i < len; i++) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "msgpack-lite",
|
|
3
3
|
"description": "Fast Pure JavaScript MessagePack Encoder and Decoder",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.1",
|
|
5
5
|
"author": "@kawanet",
|
|
6
6
|
"bin": {
|
|
7
7
|
"msgpack": "./bin/msgpack"
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"Joshua Mouch <josh@mouch.name>",
|
|
19
19
|
"Joshua Wise <josh@joshuawise.ninja>",
|
|
20
20
|
"Maciej Hirsz <maciej.hirsz@gmail.com>",
|
|
21
|
-
"Rafał Michalski <royaltm75@gmail.com>"
|
|
21
|
+
"Rafał Michalski <royaltm75@gmail.com>",
|
|
22
|
+
"Yarchik <spoko.dev@gmail.com>"
|
|
22
23
|
],
|
|
23
24
|
"dependencies": {
|
|
24
25
|
"event-lite": "^1.0.0",
|