Socket
Socket
Sign inDemoInstall

msgpack-lite

Package Overview
Dependencies
35
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.13 to 0.1.14

buffer/v0.12-buffer.js

4

dist/msgpack.min.js

@@ -1,2 +0,2 @@

!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r;r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,r.msgpack=t()}}(function(){return function t(r,e,n){function o(f,a){if(!e[f]){if(!r[f]){var u="function"==typeof require&&require;if(!a&&u)return u(f,!0);if(i)return i(f,!0);var s=new Error("Cannot find module '"+f+"'");throw s.code="MODULE_NOT_FOUND",s}var c=e[f]={exports:{}};r[f][0].call(c.exports,function(t){var e=r[f][1][t];return o(e?e:t)},c,c.exports,t,r,e,n)}return e[f].exports}for(var i="function"==typeof require&&require,f=0;f<n.length;f++)o(n[f]);return o}({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},{"./decode":5,"./decoder":6,"./encode":8,"./encoder":9}],2:[function(t,r,e){function n(t,r){for(var e=this,n=r||0,o=t.length,i=0;o>i;i++){var f=t.charCodeAt(i);128>f?e[n++]=f:2048>f?(e[n++]=192|f>>6,e[n++]=128|63&f):(e[n++]=224|f>>12,e[n++]=128|f>>6&63,e[n++]=128|63&f)}return n-r}function o(t,r){var e=this,n=t-0||0;r||(r=e.length);var o=r-t;o>s&&(o=s);for(var i=[];r>n;){for(var f=new Array(o),a=0;o>a&&r>n;){var u=e[n++];u=128>u?u:224>u?(63&u)<<6|63&e[n++]:(63&u)<<12|(63&e[n++])<<6|63&e[n++],f[a++]=u}o>a&&(f=f.slice(0,a)),i.push(String.fromCharCode.apply("",f))}return i.length>1?i.join(""):i.length?i.shift():""}function i(t){var r=0;return Array.prototype.forEach.call(t,function(t){var e=t.charCodeAt(0);r+=128>e?1:2048>e?2:3}),r}function f(t,r,e,n){var o;e||(e=0),n||0===n||(n=this.length),r||(r=0);var i=n-e;if(t===this&&r>e&&n>r)for(o=i-1;o>=0;o--)t[o+r]=this[o+e];else for(o=0;i>o;o++)t[o+r]=this[o+e];return i}function a(t,r){for(var e=7;e>=0;e--)this[r+e]=255&t,t/=256}function u(t,r){if(t>0)return a.call(this,t,r);t++;for(var e=7;e>=0;e--)this[r+e]=255&-t^255,t/=256}var s=8192;e.writeString=n,e.readString=o,e.byteLength=i,e.copy=f,e.writeUint64BE=a,e.writeInt64BE=u},{}],3:[function(t,r,e){e.BUFFER_SHORTAGE=new Error("BUFFER_SHORTAGE")},{}],4:[function(t,r,e){(function(t){function r(t){return this instanceof r?void(this.options=t||n):new r(t)}e.DecodeBuffer=r;var n={};r.prototype.push=Array.prototype.push,r.prototype.read=Array.prototype.shift,r.prototype.append=function(r){var e=this.offset?this.buffer.slice(this.offset):this.buffer;this.buffer=e?t.concat([e,r]):r,this.offset=0}}).call(this,t("buffer").Buffer)},{buffer:20}],5:[function(t,r,e){function n(t,r){var e=new o(r);return e.append(t),n(e)}e.decode=n;var o=t("./decode-buffer").DecodeBuffer,n=t("./read-core").decode},{"./decode-buffer":4,"./read-core":13}],6:[function(t,r,e){function n(t){return this instanceof n?void i.call(this,t):new n(t)}e.Decoder=n;var o=t("event-lite"),i=t("./decode-buffer").DecodeBuffer,f=t("./read-core").decodeAsync;n.prototype=new i,o.mixin(n.prototype),n.prototype.decode=function(t){t&&this.append(t),f(this)},n.prototype.push=function(t){this.emit("data",t)},n.prototype.end=function(t){this.decode(t),this.emit("end")}},{"./decode-buffer":4,"./read-core":13,"event-lite":24}],7:[function(t,r,e){(function(t){function r(t){return this instanceof r?void(this.options=t||i):new r(t)}e.EncodeBuffer=r;var n=2048,o=65536,i={};r.prototype.push=function(t){var r=this.buffers||(this.buffers=[]);r.push(t)},r.prototype.read=function(){this.flush();var r=this.buffers;if(r){var e=r.length>1?t.concat(r):r[0];return r.length=0,e}},r.prototype.flush=function(){this.start<this.offset&&(this.push(this.buffer.slice(this.start,this.offset)),this.start=this.offset)},r.prototype.reserve=function(t){if(!this.buffer)return this.alloc(t);var r=this.buffer.length;this.offset+t<r||(this.offset&&this.flush(),this.alloc(Math.max(t,Math.min(2*r,o))))},r.prototype.alloc=function(r){this.buffer=new t(r>n?r:n),this.start=0,this.offset=0},r.prototype.send=function(t){var r=this.offset+t.length;this.buffer&&r<this.buffer.length?(t.copy(this.buffer,this.offset),this.offset=r):(this.flush(),this.push(t))}}).call(this,t("buffer").Buffer)},{buffer:20}],8:[function(t,r,e){function n(t,r){var e=new o(r);return n(e,t),e.read()}e.encode=n;var n=t("./write-core").encode,o=t("./encode-buffer").EncodeBuffer},{"./encode-buffer":7,"./write-core":16}],9:[function(t,r,e){function n(t){return this instanceof n?void f.call(this,t):new n(t)}e.Encoder=n;var o=t("event-lite"),i=t("./write-core").encode,f=t("./encode-buffer").EncodeBuffer;n.prototype=new f,o.mixin(n.prototype),n.prototype.encode=function(t){i(this,t),this.emit("data",this.read())},n.prototype.end=function(t){arguments.length&&this.encode(t),this.flush(),this.emit("end")}},{"./encode-buffer":7,"./write-core":16,"event-lite":24}],10:[function(t,r,e){function n(t,r){return this instanceof n?(this.buffer=t,void(this.type=r)):new n(t,r)}e.ExtBuffer=n},{}],11:[function(t,r,e){(function(r){function n(){y.addExtPacker(14,Error,o(s,w)),y.addExtPacker(1,EvalError,o(s,w)),y.addExtPacker(2,RangeError,o(s,w)),y.addExtPacker(3,ReferenceError,o(s,w)),y.addExtPacker(4,SyntaxError,o(s,w)),y.addExtPacker(5,TypeError,o(s,w)),y.addExtPacker(6,URIError,o(s,w)),y.addExtUnpacker(14,o(g,c(Error))),y.addExtUnpacker(1,o(g,c(EvalError))),y.addExtUnpacker(2,o(g,c(RangeError))),y.addExtUnpacker(3,o(g,c(ReferenceError))),y.addExtUnpacker(4,o(g,c(SyntaxError))),y.addExtUnpacker(5,o(g,c(TypeError))),y.addExtUnpacker(6,o(g,c(URIError))),y.addExtPacker(10,RegExp,o(a,w)),y.addExtPacker(11,Boolean,o(f,w)),y.addExtPacker(12,String,o(f,w)),y.addExtPacker(13,Date,o(Number,w)),y.addExtPacker(15,Number,o(f,w)),y.addExtUnpacker(10,o(g,u)),y.addExtUnpacker(11,o(g,h(Boolean))),y.addExtUnpacker(12,o(g,h(String))),y.addExtUnpacker(13,o(g,h(Date))),y.addExtUnpacker(15,o(g,h(Number))),"undefined"!=typeof Uint8Array&&(y.addExtPacker(17,Int8Array,i),y.addExtPacker(18,Uint8Array,i),y.addExtPacker(19,Int16Array,p),y.addExtPacker(20,Uint16Array,p),y.addExtPacker(21,Int32Array,p),y.addExtPacker(22,Uint32Array,p),y.addExtPacker(23,Float32Array,p),y.addExtUnpacker(17,h(Int8Array)),y.addExtUnpacker(18,h(Uint8Array)),y.addExtUnpacker(19,o(l,h(Int16Array))),y.addExtUnpacker(20,o(l,h(Uint16Array))),y.addExtUnpacker(21,o(l,h(Int32Array))),y.addExtUnpacker(22,o(l,h(Uint32Array))),y.addExtUnpacker(23,o(l,h(Float32Array))),"undefined"!=typeof Float64Array&&(y.addExtPacker(24,Float64Array,p),y.addExtUnpacker(24,o(l,h(Float64Array)))),"undefined"!=typeof Uint8ClampedArray&&(y.addExtPacker(25,Uint8ClampedArray,i),y.addExtUnpacker(25,h(Uint8ClampedArray))),y.addExtPacker(26,ArrayBuffer,d),y.addExtPacker(29,DataView,p),y.addExtUnpacker(26,l),y.addExtUnpacker(29,o(l,h(DataView))))}function o(t){function r(t,r){return r(t)}return t=Array.prototype.slice.call(arguments),function(e){return t.reduce(r,e)}}function i(t){return new r(t)}function f(t){return t.valueOf()}function a(t){t=RegExp.prototype.toString.call(t).split("/"),t.shift();var r=[t.pop()];return r.unshift(t.join("/")),r}function u(t){return RegExp.apply(null,t)}function s(t){var r={};for(var e in v)r[e]=t[e];return r}function c(t){return function(r){var e=new t;for(var n in v)e[n]=r[n];return e}}function h(t){return function(r){return new t(r)}}function p(t){return new r(new Uint8Array(t.buffer))}function d(t){return new r(new Uint8Array(t))}function l(t){return new Uint8Array(t).buffer}var E=t("./ext").Ext,y=e.preset=new E,w=t("./encode").encode,g=t("./decode").decode,v={name:1,message:1,stack:1,columnNumber:1,fileName:1,lineNumber:1};n()}).call(this,t("buffer").Buffer)},{"./decode":5,"./encode":8,"./ext":12,buffer:20}],12:[function(t,r,e){function n(){return this instanceof n?(this.extPackers={},void(this.extUnpackers=[])):new n}e.Ext=n;var o=t("./ext-buffer").ExtBuffer;n.prototype.addExtPacker=function(t,r,e){function n(r){var n=e(r);return new o(n,t)}var i=r.name;if(i&&"Object"!==i)this.extPackers[i]=n;else{var f=this.extEncoderList||(this.extEncoderList=[]);f.unshift([r,n])}},n.prototype.addExtUnpacker=function(t,r){this.extUnpackers[t]=r},n.prototype.getExtPacker=function(t){var r=t.constructor,e=r&&r.name&&this.extPackers[r.name];if(e)return e;var n=this.extEncoderList;if(n)for(var o=n.length,i=0;o>i;i++){var f=n[i];if(r===f[0])return f[1]}},n.prototype.getExtUnpacker=function(t){function r(r){return new o(r,t)}return this.extUnpackers[t]||r}},{"./ext-buffer":10}],13:[function(t,r,e){function n(t){var r=i(t),e=f[r];if(!e)throw new Error("Invalid type: "+(r?"0x"+r.toString(16):r));return e(t)}function o(t){for(;t.offset<t.buffer.length;){var r,e=t.offset;try{r=n(t)}catch(o){if(o!==a)throw o;t.offset=e;break}t.push(r)}}e.decode=n,e.decodeAsync=o;var i=t("./read-format").format.uint8,f=t("./read-token").token,a=t("./common").BUFFER_SHORTAGE},{"./common":3,"./read-format":14,"./read-token":15}],14:[function(t,r,e){(function(r){function n(t,r){var e,n={},o=new Array(r),i=new Array(r);for(e=0;r>e;e++)o[e]=l(t),i[e]=l(t);for(e=0;r>e;e++)n[o[e]]=i[e];return n}function o(t,r){for(var e=new Array(r),n=0;r>n;n++)e[n]=l(t);return e}function i(t,r){var e=t.offset,n=t.offset=e+r;if(n>t.buffer.length)throw y;return w?d.readString.call(t.buffer,e,n):t.buffer.toString("utf-8",e,n)}function f(t,r){var e=t.offset,n=t.offset=e+r;if(n>t.buffer.length)throw y;return t.buffer.slice(e,n)}function a(t,r){var e=t.offset,n=t.offset=e+r+1;if(n>t.buffer.length)throw y;var o=t.buffer[e],i=E.getExtUnpacker(o);if(!i)throw new Error("Invalid ext type: "+(o?"0x"+o.toString(16):o));var f=t.buffer.slice(e+1,n);return i(f)}function u(t){var r=t.buffer;if(t.offset>=r.length)throw y;return r[t.offset++]}function s(t){var r=t.buffer;if(t.offset+2>r.length)throw y;return r[t.offset++]<<8|r[t.offset++]}function c(t,r){return function(e){var n=e.offset,o=e.offset=n+t;if(o>e.buffer.length)throw y;return r.call(e.buffer,n,g)}}function h(t,r){var e=this.readUInt32BE(t,r),n=this.readUInt32BE(t+4,r);return e?4294967296*e+n:n}function p(t,r){var e=this.readInt32BE(t,r),n=this.readUInt32BE(t+4,r);return e?4294967296*e+n:n}e.format={map:n,array:o,str:i,bin:f,ext:a,uint8:u,uint16:s,uint32:c(4,r.prototype.readUInt32BE),uint64:c(8,h),int8:c(1,r.prototype.readInt8),int16:c(2,r.prototype.readInt16BE),int32:c(4,r.prototype.readInt32BE),int64:c(8,p),float32:c(4,r.prototype.readFloatBE),float64:c(8,r.prototype.readDoubleBE)};var d=t("./buffer-lite"),l=t("./read-core").decode,E=t("./ext-preset").preset,y=t("./common").BUFFER_SHORTAGE,w="TYPED_ARRAY_SUPPORT"in r,g=!0}).call(this,t("buffer").Buffer)},{"./buffer-lite":2,"./common":3,"./ext-preset":11,"./read-core":13,buffer:20}],15:[function(t,r,e){function n(){var t;for(t=0;127>=t;t++)a[t]=o(t);for(t=128;143>=t;t++)a[t]=f(t-128,u.map);for(t=144;159>=t;t++)a[t]=f(t-144,u.array);for(t=160;191>=t;t++)a[t]=f(t-160,u.str);for(a[192]=o(null),a[193]=null,a[194]=o(!1),a[195]=o(!0),a[196]=i(u.uint8,u.bin),a[197]=i(u.uint16,u.bin),a[198]=i(u.uint32,u.bin),a[199]=i(u.uint8,u.ext),a[200]=i(u.uint16,u.ext),a[201]=i(u.uint32,u.ext),a[202]=u.float32,a[203]=u.float64,a[204]=u.uint8,a[205]=u.uint16,a[206]=u.uint32,a[207]=u.uint64,a[208]=u.int8,a[209]=u.int16,a[210]=u.int32,a[211]=u.int64,a[212]=f(1,u.ext),a[213]=f(2,u.ext),a[214]=f(4,u.ext),a[215]=f(8,u.ext),a[216]=f(16,u.ext),a[217]=i(u.uint8,u.str),a[218]=i(u.uint16,u.str),a[219]=i(u.uint32,u.str),a[220]=i(u.uint16,u.array),a[221]=i(u.uint32,u.array),a[222]=i(u.uint16,u.map),a[223]=i(u.uint32,u.map),t=224;255>=t;t++)a[t]=o(t-256)}function o(t){return function(){return t}}function i(t,r){return function(e){var n=t(e);return r(e,n)}}function f(t,r){return function(e){return r(e,t)}}var a=e.token=new Array(256),u=t("./read-format").format;n()},{"./read-format":14}],16:[function(t,r,e){function n(t,r){var e=o[typeof r];if(!e)throw new Error('Unsupported type "'+typeof r+'": '+r);e(t,r)}e.encode=n;var o=t("./write-type").type},{"./write-type":18}],17:[function(t,r,e){(function(r){function n(){for(var t=0;255>=t;t++)c[t]=p[t];E?i():o()}function o(){c[196]=f(196),c[197]=a(197),c[198]=u(198),c[199]=f(199),c[200]=a(200),c[201]=u(201),c[202]=s(202,4,r.prototype.writeFloatBE),c[203]=s(203,8,r.prototype.writeDoubleBE),c[204]=f(204),c[205]=a(205),c[206]=u(206),c[207]=s(207,8,h.writeUint64BE),c[208]=f(208),c[209]=a(209),c[210]=u(210),c[211]=s(211,8,h.writeUint64BE),c[217]=f(217),c[218]=a(218),c[219]=u(219),c[220]=a(220),c[221]=u(221),c[222]=a(222),c[223]=u(223)}function i(){c[196]=s(196,1,r.prototype.writeUInt8),c[197]=s(197,2,r.prototype.writeUInt16BE),c[198]=s(198,4,r.prototype.writeUInt32BE),c[199]=s(199,1,r.prototype.writeUInt8),c[200]=s(200,2,r.prototype.writeUInt16BE),c[201]=s(201,4,r.prototype.writeUInt32BE),c[202]=s(202,4,r.prototype.writeFloatBE),c[203]=s(203,8,r.prototype.writeDoubleBE),c[204]=s(204,1,r.prototype.writeUInt8),c[205]=s(205,2,r.prototype.writeUInt16BE),c[206]=s(206,4,r.prototype.writeUInt32BE),c[207]=s(207,8,h.writeUint64BE),c[208]=s(208,1,r.prototype.writeInt8),c[209]=s(209,2,r.prototype.writeInt16BE),c[210]=s(210,4,r.prototype.writeInt32BE),c[211]=s(211,8,h.writeUint64BE),c[217]=s(217,1,r.prototype.writeUInt8),c[218]=s(218,2,r.prototype.writeUInt16BE),c[219]=s(219,4,r.prototype.writeUInt32BE),c[220]=s(220,2,r.prototype.writeUInt16BE),c[221]=s(221,4,r.prototype.writeUInt32BE),c[222]=s(222,2,r.prototype.writeUInt16BE),c[223]=s(223,4,r.prototype.writeUInt32BE)}function f(t){return function(r,e){r.reserve(2);var n=r.buffer,o=r.offset;n[o++]=t,n[o++]=e,r.offset=o}}function a(t){return function(r,e){r.reserve(3);var n=r.buffer,o=r.offset;n[o++]=t,n[o++]=e>>>8,n[o++]=e,r.offset=o}}function u(t){return function(r,e){r.reserve(5);var n=r.buffer,o=r.offset;n[o++]=t,n[o++]=e>>>24,n[o++]=e>>>16,n[o++]=e>>>8,n[o++]=e,r.offset=o}}function s(t,r,e){return function(n,o){n.reserve(r+1),n.buffer[n.offset++]=t,e.call(n.buffer,o,n.offset,d),n.offset+=r}}var c=e.token=new Array(256),h=t("./buffer-lite"),p=t("./write-uint8").uint8,d=!0,l="TYPED_ARRAY_SUPPORT"in r,E=l&&!r.TYPED_ARRAY_SUPPORT;n()}).call(this,t("buffer").Buffer)},{"./buffer-lite":2,"./write-uint8":19,buffer:20}],18:[function(t,r,e){(function(r){function n(t,r){var e=r?195:194;l[e](t,r)}function o(t,r){var e,n=0|r;return r!==n?(e=203,void l[e](t,r)):(e=n>=-32&&127>=n?255&n:n>=0?255>=n?204:65535>=n?205:206:n>=-128?208:n>=-32768?209:210,void l[e](t,n))}function i(t,r){var e=r.length,n=5+3*e;t.reserve(n);var o=32>e?1:255>=e?2:65535>=e?3:5,i=t.offset+o;e=d.writeString.call(t.buffer,r,i);var f=32>e?1:255>=e?2:65535>=e?3:5;if(o!==f){var a=t.offset+f,u=i+e;v?d.copy.call(t.buffer,t.buffer,a,i,u):t.buffer.copy(t.buffer,a,i,u)}var s=1===f?160+e:3>=f?215+f:219;l[s](t,e),t.offset+=e}function f(t,e){if(b(e))return u(t,e);if(null===e)return a(t,e);var n=w.getExtPacker(e);return n&&(e=n(e)),e instanceof g?c(t,e):r.isBuffer(e)?s(t,e):void h(t,e)}function a(t,r){var e=192;l[e](t,r)}function u(t,r){var e=r.length,n=16>e?144+e:65535>=e?220:221;l[n](t,e);for(var o=0;e>o;o++)E(t,r[o])}function s(t,r){var e=r.length,n=255>e?196:65535>=e?197:198;l[n](t,e),t.send(r)}function c(t,r){var e=r.buffer,n=e.length,o=A[n]||(255>n?199:65535>=n?200:201);l[o](t,n),y[r.type](t),t.send(e)}function h(t,r){var e=Object.keys(r),n=e.length,o=16>n?128+n:65535>=n?222:223;l[o](t,n),e.forEach(function(e){E(t,e),E(t,r[e])})}function p(t){return"[object Array]"===Object.prototype.toString.call(t)}e.type={"boolean":n,"function":a,number:o,object:f,string:i,symbol:a,undefined:a};var d=t("./buffer-lite"),l=t("./write-token").token,E=t("./write-core").encode,y=t("./write-uint8").uint8,w=t("./ext-preset").preset,g=t("./ext-buffer").ExtBuffer,v="TYPED_ARRAY_SUPPORT"in r,b=Array.isArray||p,A=[];A[1]=212,A[2]=213,A[4]=214,A[8]=215,A[16]=216}).call(this,t("buffer").Buffer)},{"./buffer-lite":2,"./ext-buffer":10,"./ext-preset":11,"./write-core":16,"./write-token":17,"./write-uint8":19,buffer:20}],19:[function(t,r,e){function n(t){return function(r){r.reserve(1),r.buffer[r.offset++]=t}}for(var o=e.uint8=new Array(256),i=0;255>=i;i++)o[i]=n(i)},{}],20:[function(t,r,e){function n(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t){return this instanceof o?(this.length=0,this.parent=void 0,"number"==typeof t?i(this,t):"string"==typeof t?f(this,t,arguments.length>1?arguments[1]:"utf8"):a(this,t)):arguments.length>1?new o(t,arguments[1]):new o(t)}function i(t,r){if(t=l(t,0>r?0:0|E(r)),!o.TYPED_ARRAY_SUPPORT)for(var e=0;r>e;e++)t[e]=0;return t}function f(t,r,e){("string"!=typeof e||""===e)&&(e="utf8");var n=0|w(r,e);return t=l(t,n),t.write(r,e),t}function a(t,r){if(o.isBuffer(r))return u(t,r);if(Z(r))return s(t,r);if(null==r)throw new TypeError("must start with number, buffer, array or string");if("undefined"!=typeof ArrayBuffer){if(r.buffer instanceof ArrayBuffer)return c(t,r);if(r instanceof ArrayBuffer)return h(t,r)}return r.length?p(t,r):d(t,r)}function u(t,r){var e=0|E(r.length);return t=l(t,e),r.copy(t,0,0,e),t}function s(t,r){var e=0|E(r.length);t=l(t,e);for(var n=0;e>n;n+=1)t[n]=255&r[n];return t}function c(t,r){var e=0|E(r.length);t=l(t,e);for(var n=0;e>n;n+=1)t[n]=255&r[n];return t}function h(t,r){return o.TYPED_ARRAY_SUPPORT?(r.byteLength,t=o._augment(new Uint8Array(r))):t=c(t,new Uint8Array(r)),t}function p(t,r){var e=0|E(r.length);t=l(t,e);for(var n=0;e>n;n+=1)t[n]=255&r[n];return t}function d(t,r){var e,n=0;"Buffer"===r.type&&Z(r.data)&&(e=r.data,n=0|E(e.length)),t=l(t,n);for(var o=0;n>o;o+=1)t[o]=255&e[o];return t}function l(t,r){o.TYPED_ARRAY_SUPPORT?t=o._augment(new Uint8Array(r)):(t.length=r,t._isBuffer=!0);var e=0!==r&&r<=o.poolSize>>>1;return e&&(t.parent=K),t}function E(t){if(t>=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|t}function y(t,r){if(!(this instanceof y))return new y(t,r);var e=new o(t,r);return delete e.parent,e}function w(t,r){"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"binary":case"raw":case"raws":return e;case"utf8":case"utf-8":return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return H(t).length;default:if(n)return q(t).length;r=(""+r).toLowerCase(),n=!0}}function g(t,r,e){var n=!1;if(r=0|r,e=void 0===e||e===1/0?this.length:0|e,t||(t="utf8"),0>r&&(r=0),e>this.length&&(e=this.length),r>=e)return"";for(;;)switch(t){case"hex":return S(this,r,e);case"utf8":case"utf-8":return m(this,r,e);case"ascii":return P(this,r,e);case"binary":return k(this,r,e);case"base64":return x(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var i=r.length;if(i%2!==0)throw new Error("Invalid hex string");n>i/2&&(n=i/2);for(var f=0;n>f;f++){var a=parseInt(r.substr(2*f,2),16);if(isNaN(a))throw new Error("Invalid hex string");t[e+f]=a}return f}function b(t,r,e,n){return J(q(r,t.length-e),t,e,n)}function A(t,r,e,n){return J(z(r),t,e,n)}function U(t,r,e,n){return A(t,r,e,n)}function B(t,r,e,n){return J(H(r),t,e,n)}function I(t,r,e,n){return J(G(r,t.length-e),t,e,n)}function x(t,r,e){return 0===r&&e===t.length?V.fromByteArray(t):V.fromByteArray(t.slice(r,e))}function m(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;e>o;){var i=t[o],f=null,a=i>239?4:i>223?3:i>191?2:1;if(e>=o+a){var u,s,c,h;switch(a){case 1:128>i&&(f=i);break;case 2:u=t[o+1],128===(192&u)&&(h=(31&i)<<6|63&u,h>127&&(f=h));break;case 3:u=t[o+1],s=t[o+2],128===(192&u)&&128===(192&s)&&(h=(15&i)<<12|(63&u)<<6|63&s,h>2047&&(55296>h||h>57343)&&(f=h));break;case 4:u=t[o+1],s=t[o+2],c=t[o+3],128===(192&u)&&128===(192&s)&&128===(192&c)&&(h=(15&i)<<18|(63&u)<<12|(63&s)<<6|63&c,h>65535&&1114112>h&&(f=h))}}null===f?(f=65533,a=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),o+=a}return R(n)}function R(t){var r=t.length;if(Q>=r)return String.fromCharCode.apply(String,t);for(var e="",n=0;r>n;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Q));return e}function P(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;e>o;o++)n+=String.fromCharCode(127&t[o]);return n}function k(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;e>o;o++)n+=String.fromCharCode(t[o]);return n}function S(t,r,e){var n=t.length;(!r||0>r)&&(r=0),(!e||0>e||e>n)&&(e=n);for(var o="",i=r;e>i;i++)o+=j(t[i]);return o}function T(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function _(t,r,e){if(t%1!==0||0>t)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function L(t,r,e,n,i,f){if(!o.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");if(r>i||f>r)throw new RangeError("value is out of bounds");if(e+n>t.length)throw new RangeError("index out of range")}function D(t,r,e,n){0>r&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);i>o;o++)t[e+o]=(r&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function Y(t,r,e,n){0>r&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);i>o;o++)t[e+o]=r>>>8*(n?o:3-o)&255}function O(t,r,e,n,o,i){if(r>o||i>r)throw new RangeError("value is out of bounds");if(e+n>t.length)throw new RangeError("index out of range");if(0>e)throw new RangeError("index out of range")}function C(t,r,e,n,o){return o||O(t,r,e,4,3.4028234663852886e38,-3.4028234663852886e38),X.write(t,r,e,n,23,4),e+4}function M(t,r,e,n,o){return o||O(t,r,e,8,1.7976931348623157e308,-1.7976931348623157e308),X.write(t,r,e,n,52,8),e+8}function F(t){if(t=N(t).replace($,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function N(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function j(t){return 16>t?"0"+t.toString(16):t.toString(16)}function q(t,r){r=r||1/0;for(var e,n=t.length,o=null,i=[],f=0;n>f;f++){if(e=t.charCodeAt(f),e>55295&&57344>e){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}if(f+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(56320>e){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=o-55296<<10|e-56320|65536}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,128>e){if((r-=1)<0)break;i.push(e)}else if(2048>e){if((r-=2)<0)break;i.push(e>>6|192,63&e|128)}else if(65536>e){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(1114112>e))throw new Error("Invalid code point");if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return i}function z(t){for(var r=[],e=0;e<t.length;e++)r.push(255&t.charCodeAt(e));return r}function G(t,r){for(var e,n,o,i=[],f=0;f<t.length&&!((r-=2)<0);f++)e=t.charCodeAt(f),n=e>>8,o=e%256,i.push(o),i.push(n);return i}function H(t){return V.toByteArray(F(t))}function J(t,r,e,n){for(var o=0;n>o&&!(o+e>=r.length||o>=t.length);o++)r[o+e]=t[o];return o}var V=t("base64-js"),X=t("ieee754"),Z=t("is-array");e.Buffer=o,e.SlowBuffer=y,e.INSPECT_MAX_BYTES=50,o.poolSize=8192;var K={};o.TYPED_ARRAY_SUPPORT=function(){function t(){}try{var r=new Uint8Array(1);return r.foo=function(){return 42},r.constructor=t,42===r.foo()&&r.constructor===t&&"function"==typeof r.subarray&&0===r.subarray(1,1).byteLength}catch(e){return!1}}(),o.isBuffer=function(t){return!(null==t||!t._isBuffer)},o.compare=function(t,r){if(!o.isBuffer(t)||!o.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,f=Math.min(e,n);f>i&&t[i]===r[i];)++i;return i!==f&&(e=t[i],n=r[i]),n>e?-1:e>n?1:0},o.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(t,r){if(!Z(t))throw new TypeError("list argument must be an Array of Buffers.");if(0===t.length)return new o(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;e++)r+=t[e].length;var n=new o(r),i=0;for(e=0;e<t.length;e++){var f=t[e];f.copy(n,i),i+=f.length}return n},o.byteLength=w,o.prototype.length=void 0,o.prototype.parent=void 0,o.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?m(this,0,t):g.apply(this,arguments)},o.prototype.equals=function(t){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:0===o.compare(this,t)},o.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},o.prototype.compare=function(t){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?0:o.compare(this,t)},o.prototype.indexOf=function(t,r){function e(t,r,e){for(var n=-1,o=0;e+o<t.length;o++)if(t[e+o]===r[-1===n?0:o-n]){if(-1===n&&(n=o),o-n+1===r.length)return e+n}else n=-1;return-1}if(r>2147483647?r=2147483647:-2147483648>r&&(r=-2147483648),r>>=0,0===this.length)return-1;if(r>=this.length)return-1;if(0>r&&(r=Math.max(this.length+r,0)),"string"==typeof t)return 0===t.length?-1:String.prototype.indexOf.call(this,t,r);if(o.isBuffer(t))return e(this,t,r);if("number"==typeof t)return o.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,t,r):e(this,[t],r);throw new TypeError("val must be string, number or Buffer")},o.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},o.prototype.set=function(t,r){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,r)},o.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))r=0|r,isFinite(e)?(e=0|e,void 0===n&&(n="utf8")):(n=e,e=void 0);else{var o=n;n=r,r=0|e,e=o}var i=this.length-r;if((void 0===e||e>i)&&(e=i),t.length>0&&(0>e||0>r)||r>this.length)throw new RangeError("attempt to write outside buffer bounds");n||(n="utf8");for(var f=!1;;)switch(n){case"hex":return v(this,t,r,e);case"utf8":case"utf-8":return b(this,t,r,e);case"ascii":return A(this,t,r,e);case"binary":return U(this,t,r,e);case"base64":return B(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r,e);default:if(f)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),f=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;o.prototype.slice=function(t,r){var e=this.length;t=~~t,r=void 0===r?e:~~r,0>t?(t+=e,0>t&&(t=0)):t>e&&(t=e),0>r?(r+=e,0>r&&(r=0)):r>e&&(r=e),t>r&&(r=t);var n;if(o.TYPED_ARRAY_SUPPORT)n=o._augment(this.subarray(t,r));else{var i=r-t;n=new o(i,void 0);for(var f=0;i>f;f++)n[f]=this[f+t]}return n.length&&(n.parent=this.parent||this),n},o.prototype.readUIntLE=function(t,r,e){t=0|t,r=0|r,e||_(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return n},o.prototype.readUIntBE=function(t,r,e){t=0|t,r=0|r,e||_(t,r,this.length);for(var n=this[t+--r],o=1;r>0&&(o*=256);)n+=this[t+--r]*o;return n},o.prototype.readUInt8=function(t,r){return r||_(t,1,this.length),this[t]},o.prototype.readUInt16LE=function(t,r){return r||_(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUInt16BE=function(t,r){return r||_(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUInt32LE=function(t,r){return r||_(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUInt32BE=function(t,r){return r||_(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readIntLE=function(t,r,e){t=0|t,r=0|r,e||_(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*r)),n},o.prototype.readIntBE=function(t,r,e){t=0|t,r=0|r,e||_(t,r,this.length);for(var n=r,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i},o.prototype.readInt8=function(t,r){return r||_(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,r){r||_(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},o.prototype.readInt16BE=function(t,r){r||_(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},o.prototype.readInt32LE=function(t,r){return r||_(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,r){return r||_(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,r){return r||_(t,4,this.length),X.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,r){return r||_(t,4,this.length),X.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,r){return r||_(t,8,this.length),X.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,r){return r||_(t,8,this.length),X.read(this,t,!1,52,8)},o.prototype.writeUIntLE=function(t,r,e,n){t=+t,r=0|r,e=0|e,n||L(this,t,r,e,Math.pow(2,8*e),0);var o=1,i=0;for(this[r]=255&t;++i<e&&(o*=256);)this[r+i]=t/o&255;return r+e},o.prototype.writeUIntBE=function(t,r,e,n){t=+t,r=0|r,e=0|e,n||L(this,t,r,e,Math.pow(2,8*e),0);var o=e-1,i=1;for(this[r+o]=255&t;--o>=0&&(i*=256);)this[r+o]=t/i&255;return r+e},o.prototype.writeUInt8=function(t,r,e){return t=+t,r=0|r,e||L(this,t,r,1,255,0),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=t,r+1},o.prototype.writeUInt16LE=function(t,r,e){return t=+t,r=0|r,e||L(this,t,r,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[r]=t,this[r+1]=t>>>8):D(this,t,r,!0),r+2},o.prototype.writeUInt16BE=function(t,r,e){return t=+t,r=0|r,e||L(this,t,r,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=t):D(this,t,r,!1),r+2},o.prototype.writeUInt32LE=function(t,r,e){return t=+t,r=0|r,e||L(this,t,r,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t):Y(this,t,r,!0),r+4},o.prototype.writeUInt32BE=function(t,r,e){return t=+t,r=0|r,e||L(this,t,r,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t):Y(this,t,r,!1),r+4},o.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r=0|r,!n){var o=Math.pow(2,8*e-1);L(this,t,r,e,o-1,-o)}var i=0,f=1,a=0>t?1:0;for(this[r]=255&t;++i<e&&(f*=256);)this[r+i]=(t/f>>0)-a&255;return r+e},o.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r=0|r,!n){var o=Math.pow(2,8*e-1);L(this,t,r,e,o-1,-o)}var i=e-1,f=1,a=0>t?1:0;for(this[r+i]=255&t;--i>=0&&(f*=256);)this[r+i]=(t/f>>0)-a&255;return r+e},o.prototype.writeInt8=function(t,r,e){return t=+t,r=0|r,e||L(this,t,r,1,127,-128),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[r]=t,r+1},o.prototype.writeInt16LE=function(t,r,e){return t=+t,r=0|r,e||L(this,t,r,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[r]=t,this[r+1]=t>>>8):D(this,t,r,!0),r+2},o.prototype.writeInt16BE=function(t,r,e){return t=+t,r=0|r,e||L(this,t,r,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=t):D(this,t,r,!1),r+2},o.prototype.writeInt32LE=function(t,r,e){return t=+t,r=0|r,e||L(this,t,r,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[r]=t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):Y(this,t,r,!0),r+4},o.prototype.writeInt32BE=function(t,r,e){return t=+t,r=0|r,e||L(this,t,r,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),o.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t):Y(this,t,r,!1),r+4},o.prototype.writeFloatLE=function(t,r,e){return C(this,t,r,!0,e)},o.prototype.writeFloatBE=function(t,r,e){return C(this,t,r,!1,e)},o.prototype.writeDoubleLE=function(t,r,e){return M(this,t,r,!0,e)},o.prototype.writeDoubleBE=function(t,r,e){return M(this,t,r,!1,e)},o.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&e>n&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(0>r)throw new RangeError("targetStart out of bounds");if(0>e||e>=this.length)throw new RangeError("sourceStart out of bounds");if(0>n)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var i,f=n-e;if(this===t&&r>e&&n>r)for(i=f-1;i>=0;i--)t[i+r]=this[i+e];else if(1e3>f||!o.TYPED_ARRAY_SUPPORT)for(i=0;f>i;i++)t[i+r]=this[i+e];else t._set(this.subarray(e,e+f),r);
return f},o.prototype.fill=function(t,r,e){if(t||(t=0),r||(r=0),e||(e=this.length),r>e)throw new RangeError("end < start");if(e!==r&&0!==this.length){if(0>r||r>=this.length)throw new RangeError("start out of bounds");if(0>e||e>this.length)throw new RangeError("end out of bounds");var n;if("number"==typeof t)for(n=r;e>n;n++)this[n]=t;else{var o=q(t.toString()),i=o.length;for(n=r;e>n;n++)this[n]=o[n%i]}return this}},o.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(o.TYPED_ARRAY_SUPPORT)return new o(this).buffer;for(var t=new Uint8Array(this.length),r=0,e=t.length;e>r;r+=1)t[r]=this[r];return t.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var W=o.prototype;o._augment=function(t){return t.constructor=o,t._isBuffer=!0,t._set=t.set,t.get=W.get,t.set=W.set,t.write=W.write,t.toString=W.toString,t.toLocaleString=W.toString,t.toJSON=W.toJSON,t.equals=W.equals,t.compare=W.compare,t.indexOf=W.indexOf,t.copy=W.copy,t.slice=W.slice,t.readUIntLE=W.readUIntLE,t.readUIntBE=W.readUIntBE,t.readUInt8=W.readUInt8,t.readUInt16LE=W.readUInt16LE,t.readUInt16BE=W.readUInt16BE,t.readUInt32LE=W.readUInt32LE,t.readUInt32BE=W.readUInt32BE,t.readIntLE=W.readIntLE,t.readIntBE=W.readIntBE,t.readInt8=W.readInt8,t.readInt16LE=W.readInt16LE,t.readInt16BE=W.readInt16BE,t.readInt32LE=W.readInt32LE,t.readInt32BE=W.readInt32BE,t.readFloatLE=W.readFloatLE,t.readFloatBE=W.readFloatBE,t.readDoubleLE=W.readDoubleLE,t.readDoubleBE=W.readDoubleBE,t.writeUInt8=W.writeUInt8,t.writeUIntLE=W.writeUIntLE,t.writeUIntBE=W.writeUIntBE,t.writeUInt16LE=W.writeUInt16LE,t.writeUInt16BE=W.writeUInt16BE,t.writeUInt32LE=W.writeUInt32LE,t.writeUInt32BE=W.writeUInt32BE,t.writeIntLE=W.writeIntLE,t.writeIntBE=W.writeIntBE,t.writeInt8=W.writeInt8,t.writeInt16LE=W.writeInt16LE,t.writeInt16BE=W.writeInt16BE,t.writeInt32LE=W.writeInt32LE,t.writeInt32BE=W.writeInt32BE,t.writeFloatLE=W.writeFloatLE,t.writeFloatBE=W.writeFloatBE,t.writeDoubleLE=W.writeDoubleLE,t.writeDoubleBE=W.writeDoubleBE,t.fill=W.fill,t.inspect=W.inspect,t.toArrayBuffer=W.toArrayBuffer,t};var $=/[^+\/0-9A-Za-z-_]/g},{"base64-js":21,ieee754:22,"is-array":23}],21:[function(t,r,e){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(t){"use strict";function r(t){var r=t.charCodeAt(0);return r===f||r===h?62:r===a||r===p?63:u>r?-1:u+10>r?r-u+26+26:c+26>r?r-c:s+26>r?r-s+26:void 0}function e(t){function e(t){s[h++]=t}var n,o,f,a,u,s;if(t.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var c=t.length;u="="===t.charAt(c-2)?2:"="===t.charAt(c-1)?1:0,s=new i(3*t.length/4-u),f=u>0?t.length-4:t.length;var h=0;for(n=0,o=0;f>n;n+=4,o+=3)a=r(t.charAt(n))<<18|r(t.charAt(n+1))<<12|r(t.charAt(n+2))<<6|r(t.charAt(n+3)),e((16711680&a)>>16),e((65280&a)>>8),e(255&a);return 2===u?(a=r(t.charAt(n))<<2|r(t.charAt(n+1))>>4,e(255&a)):1===u&&(a=r(t.charAt(n))<<10|r(t.charAt(n+1))<<4|r(t.charAt(n+2))>>2,e(a>>8&255),e(255&a)),s}function o(t){function r(t){return n.charAt(t)}function e(t){return r(t>>18&63)+r(t>>12&63)+r(t>>6&63)+r(63&t)}var o,i,f,a=t.length%3,u="";for(o=0,f=t.length-a;f>o;o+=3)i=(t[o]<<16)+(t[o+1]<<8)+t[o+2],u+=e(i);switch(a){case 1:i=t[t.length-1],u+=r(i>>2),u+=r(i<<4&63),u+="==";break;case 2:i=(t[t.length-2]<<8)+t[t.length-1],u+=r(i>>10),u+=r(i>>4&63),u+=r(i<<2&63),u+="="}return u}var i="undefined"!=typeof Uint8Array?Uint8Array:Array,f="+".charCodeAt(0),a="/".charCodeAt(0),u="0".charCodeAt(0),s="a".charCodeAt(0),c="A".charCodeAt(0),h="-".charCodeAt(0),p="_".charCodeAt(0);t.toByteArray=e,t.fromByteArray=o}("undefined"==typeof e?this.base64js={}:e)},{}],22:[function(t,r,e){e.read=function(t,r,e,n,o){var i,f,a=8*o-n-1,u=(1<<a)-1,s=u>>1,c=-7,h=e?o-1:0,p=e?-1:1,d=t[r+h];for(h+=p,i=d&(1<<-c)-1,d>>=-c,c+=a;c>0;i=256*i+t[r+h],h+=p,c-=8);for(f=i&(1<<-c)-1,i>>=-c,c+=n;c>0;f=256*f+t[r+h],h+=p,c-=8);if(0===i)i=1-s;else{if(i===u)return f?NaN:(d?-1:1)*(1/0);f+=Math.pow(2,n),i-=s}return(d?-1:1)*f*Math.pow(2,i-n)},e.write=function(t,r,e,n,o,i){var f,a,u,s=8*i-o-1,c=(1<<s)-1,h=c>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,l=n?1:-1,E=0>r||0===r&&0>1/r?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,f=c):(f=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-f))<1&&(f--,u*=2),r+=f+h>=1?p/u:p*Math.pow(2,1-h),r*u>=2&&(f++,u/=2),f+h>=c?(a=0,f=c):f+h>=1?(a=(r*u-1)*Math.pow(2,o),f+=h):(a=r*Math.pow(2,h-1)*Math.pow(2,o),f=0));o>=8;t[e+d]=255&a,d+=l,a/=256,o-=8);for(f=f<<o|a,s+=o;s>0;t[e+d]=255&f,d+=l,f/=256,s-=8);t[e+d-l]|=128*E}},{}],23:[function(t,r,e){var n=Array.isArray,o=Object.prototype.toString;r.exports=n||function(t){return!!t&&"[object Array]"==o.call(t)}},{}],24:[function(t,r,e){function n(){return this instanceof n?void 0:new n}!function(t){function e(t){for(var r in s)t[r]=s[r];return t}function n(t,r){return a(this,t).push(r),this}function o(t,r){function e(){i.call(n,t,e),r.apply(this,arguments)}var n=this;return a(n,t).push(e),n}function i(t,r){function e(t){return t!==r}var n,o=this;if(t){if(r){if(n=a(o,t,!0)){if(n=n.filter(e),!n.length)return i.call(o,t);o[u][t]=n}}else if(n=o[u],n&&(delete n[t],!Object.keys(n).length))return i.call(o)}else delete o[u];return o}function f(t,r){function e(t){t.call(i)}function n(t){t.call(i,r)}function o(t){t.apply(i,s)}var i=this,f=a(i,t,!0);if(!f)return!1;var u=arguments.length;if(1===u)f.forEach(e);else if(2===u)f.forEach(n);else{var s=Array.prototype.slice.call(arguments,1);f.forEach(o)}return!!f.length}function a(t,r,e){if(!e||t[u]){var n=t[u]||(t[u]={});return n[r]||(n[r]=[])}}"undefined"!=typeof r&&(r.exports=t);var u="listeners",s={on:n,once:o,off:i,emit:f};e(t.prototype),t.mixin=e}(n)},{}]},{},[1])(1)});
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r;r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,r.msgpack=t()}}(function(){return function t(r,e,n){function o(f,a){if(!e[f]){if(!r[f]){var u="function"==typeof require&&require;if(!a&&u)return u(f,!0);if(i)return i(f,!0);var s=new Error("Cannot find module '"+f+"'");throw s.code="MODULE_NOT_FOUND",s}var c=e[f]={exports:{}};r[f][0].call(c.exports,function(t){var e=r[f][1][t];return o(e?e:t)},c,c.exports,t,r,e,n)}return e[f].exports}for(var i="function"==typeof require&&require,f=0;f<n.length;f++)o(n[f]);return o}({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},{"./decode":5,"./decoder":6,"./encode":8,"./encoder":9}],2:[function(t,r,e){function n(t,r){for(var e=this,n=r||0,o=t.length,i=0;o>i;i++){var f=t.charCodeAt(i);128>f?e[n++]=f:2048>f?(e[n++]=192|f>>6,e[n++]=128|63&f):(e[n++]=224|f>>12,e[n++]=128|f>>6&63,e[n++]=128|63&f)}return n-r}function o(t,r){var e=this,n=t-0||0;r||(r=e.length);var o=r-t;o>s&&(o=s);for(var i=[];r>n;){for(var f=new Array(o),a=0;o>a&&r>n;){var u=e[n++];u=128>u?u:224>u?(63&u)<<6|63&e[n++]:(63&u)<<12|(63&e[n++])<<6|63&e[n++],f[a++]=u}o>a&&(f=f.slice(0,a)),i.push(String.fromCharCode.apply("",f))}return i.length>1?i.join(""):i.length?i.shift():""}function i(t){var r=0;return Array.prototype.forEach.call(t,function(t){var e=t.charCodeAt(0);r+=128>e?1:2048>e?2:3}),r}function f(t,r,e,n){var o;e||(e=0),n||0===n||(n=this.length),r||(r=0);var i=n-e;if(t===this&&r>e&&n>r)for(o=i-1;o>=0;o--)t[o+r]=this[o+e];else for(o=0;i>o;o++)t[o+r]=this[o+e];return i}function a(t,r){for(var e=7;e>=0;e--)this[r+e]=255&t,t/=256}function u(t,r){if(t>0)return a.call(this,t,r);t++;for(var e=7;e>=0;e--)this[r+e]=255&-t^255,t/=256}var s=8192;e.writeString=n,e.readString=o,e.byteLength=i,e.copy=f,e.writeUint64BE=a,e.writeInt64BE=u},{}],3:[function(t,r,e){e.BUFFER_SHORTAGE=new Error("BUFFER_SHORTAGE")},{}],4:[function(t,r,e){(function(t){function r(t){return this instanceof r?void(this.options=t||n):new r(t)}e.DecodeBuffer=r;var n={};r.prototype.push=Array.prototype.push,r.prototype.read=Array.prototype.shift,r.prototype.append=function(r){var e=this.offset?this.buffer.slice(this.offset):this.buffer;this.buffer=e?t.concat([e,r]):r,this.offset=0}}).call(this,t("buffer").Buffer)},{buffer:20}],5:[function(t,r,e){function n(t,r){var e=new o(r);return e.append(t),n(e)}e.decode=n;var o=t("./decode-buffer").DecodeBuffer,n=t("./read-core").decode},{"./decode-buffer":4,"./read-core":13}],6:[function(t,r,e){function n(t){return this instanceof n?void i.call(this,t):new n(t)}e.Decoder=n;var o=t("event-lite"),i=t("./decode-buffer").DecodeBuffer,f=t("./read-core").decodeAsync;n.prototype=new i,o.mixin(n.prototype),n.prototype.decode=function(t){t&&this.append(t),f(this)},n.prototype.push=function(t){this.emit("data",t)},n.prototype.end=function(t){this.decode(t),this.emit("end")}},{"./decode-buffer":4,"./read-core":13,"event-lite":24}],7:[function(t,r,e){(function(t){function r(t){return this instanceof r?void(this.options=t||i):new r(t)}e.EncodeBuffer=r;var n=2048,o=65536,i={};r.prototype.push=function(t){var r=this.buffers||(this.buffers=[]);r.push(t)},r.prototype.read=function(){this.flush();var r=this.buffers;if(r){var e=r.length>1?t.concat(r):r[0];return r.length=0,e}},r.prototype.flush=function(){this.start<this.offset&&(this.push(this.buffer.slice(this.start,this.offset)),this.start=this.offset)},r.prototype.reserve=function(t){if(!this.buffer)return this.alloc(t);var r=this.buffer.length;this.offset+t<r||(this.offset&&this.flush(),this.alloc(Math.max(t,Math.min(2*r,o))))},r.prototype.alloc=function(r){this.buffer=new t(r>n?r:n),this.start=0,this.offset=0},r.prototype.send=function(t){var r=this.offset+t.length;this.buffer&&r<this.buffer.length?(t.copy(this.buffer,this.offset),this.offset=r):(this.flush(),this.push(t))}}).call(this,t("buffer").Buffer)},{buffer:20}],8:[function(t,r,e){function n(t,r){var e=new o(r);return n(e,t),e.read()}e.encode=n;var n=t("./write-core").encode,o=t("./encode-buffer").EncodeBuffer},{"./encode-buffer":7,"./write-core":16}],9:[function(t,r,e){function n(t){return this instanceof n?void f.call(this,t):new n(t)}e.Encoder=n;var o=t("event-lite"),i=t("./write-core").encode,f=t("./encode-buffer").EncodeBuffer;n.prototype=new f,o.mixin(n.prototype),n.prototype.encode=function(t){i(this,t),this.emit("data",this.read())},n.prototype.end=function(t){arguments.length&&this.encode(t),this.flush(),this.emit("end")}},{"./encode-buffer":7,"./write-core":16,"event-lite":24}],10:[function(t,r,e){function n(t,r){return this instanceof n?(this.buffer=t,void(this.type=r)):new n(t,r)}e.ExtBuffer=n},{}],11:[function(t,r,e){(function(r){function n(){E.addExtPacker(14,Error,o(s,w)),E.addExtPacker(1,EvalError,o(s,w)),E.addExtPacker(2,RangeError,o(s,w)),E.addExtPacker(3,ReferenceError,o(s,w)),E.addExtPacker(4,SyntaxError,o(s,w)),E.addExtPacker(5,TypeError,o(s,w)),E.addExtPacker(6,URIError,o(s,w)),E.addExtUnpacker(14,o(g,c(Error))),E.addExtUnpacker(1,o(g,c(EvalError))),E.addExtUnpacker(2,o(g,c(RangeError))),E.addExtUnpacker(3,o(g,c(ReferenceError))),E.addExtUnpacker(4,o(g,c(SyntaxError))),E.addExtUnpacker(5,o(g,c(TypeError))),E.addExtUnpacker(6,o(g,c(URIError))),E.addExtPacker(10,RegExp,o(a,w)),E.addExtPacker(11,Boolean,o(f,w)),E.addExtPacker(12,String,o(f,w)),E.addExtPacker(13,Date,o(Number,w)),E.addExtPacker(15,Number,o(f,w)),E.addExtUnpacker(10,o(g,u)),E.addExtUnpacker(11,o(g,h(Boolean))),E.addExtUnpacker(12,o(g,h(String))),E.addExtUnpacker(13,o(g,h(Date))),E.addExtUnpacker(15,o(g,h(Number))),"undefined"!=typeof Uint8Array&&(E.addExtPacker(17,Int8Array,i),E.addExtPacker(18,Uint8Array,i),E.addExtPacker(19,Int16Array,p),E.addExtPacker(20,Uint16Array,p),E.addExtPacker(21,Int32Array,p),E.addExtPacker(22,Uint32Array,p),E.addExtPacker(23,Float32Array,p),E.addExtUnpacker(17,h(Int8Array)),E.addExtUnpacker(18,h(Uint8Array)),E.addExtUnpacker(19,o(l,h(Int16Array))),E.addExtUnpacker(20,o(l,h(Uint16Array))),E.addExtUnpacker(21,o(l,h(Int32Array))),E.addExtUnpacker(22,o(l,h(Uint32Array))),E.addExtUnpacker(23,o(l,h(Float32Array))),"undefined"!=typeof Float64Array&&(E.addExtPacker(24,Float64Array,p),E.addExtUnpacker(24,o(l,h(Float64Array)))),"undefined"!=typeof Uint8ClampedArray&&(E.addExtPacker(25,Uint8ClampedArray,i),E.addExtUnpacker(25,h(Uint8ClampedArray))),E.addExtPacker(26,ArrayBuffer,d),E.addExtPacker(29,DataView,p),E.addExtUnpacker(26,l),E.addExtUnpacker(29,o(l,h(DataView))))}function o(t){function r(t,r){return r(t)}return t=Array.prototype.slice.call(arguments),function(e){return t.reduce(r,e)}}function i(t){return new r(t)}function f(t){return t.valueOf()}function a(t){t=RegExp.prototype.toString.call(t).split("/"),t.shift();var r=[t.pop()];return r.unshift(t.join("/")),r}function u(t){return RegExp.apply(null,t)}function s(t){var r={};for(var e in v)r[e]=t[e];return r}function c(t){return function(r){var e=new t;for(var n in v)e[n]=r[n];return e}}function h(t){return function(r){return new t(r)}}function p(t){return new r(new Uint8Array(t.buffer))}function d(t){return new r(new Uint8Array(t))}function l(t){return new Uint8Array(t).buffer}var y=t("./ext").Ext,E=e.preset=new y,w=t("./encode").encode,g=t("./decode").decode,v={name:1,message:1,stack:1,columnNumber:1,fileName:1,lineNumber:1};n()}).call(this,t("buffer").Buffer)},{"./decode":5,"./encode":8,"./ext":12,buffer:20}],12:[function(t,r,e){function n(){return this instanceof n?(this.extPackers={},void(this.extUnpackers=[])):new n}e.Ext=n;var o=t("./ext-buffer").ExtBuffer;n.prototype.addExtPacker=function(t,r,e){function n(r){var n=e(r);return new o(n,t)}var i=r.name;if(i&&"Object"!==i)this.extPackers[i]=n;else{var f=this.extEncoderList||(this.extEncoderList=[]);f.unshift([r,n])}},n.prototype.addExtUnpacker=function(t,r){this.extUnpackers[t]=r},n.prototype.getExtPacker=function(t){var r=t.constructor,e=r&&r.name&&this.extPackers[r.name];if(e)return e;var n=this.extEncoderList;if(n)for(var o=n.length,i=0;o>i;i++){var f=n[i];if(r===f[0])return f[1]}},n.prototype.getExtUnpacker=function(t){function r(r){return new o(r,t)}return this.extUnpackers[t]||r}},{"./ext-buffer":10}],13:[function(t,r,e){function n(t){var r=i(t),e=f[r];if(!e)throw new Error("Invalid type: "+(r?"0x"+r.toString(16):r));return e(t)}function o(t){for(;t.offset<t.buffer.length;){var r,e=t.offset;try{r=n(t)}catch(o){if(o!==a)throw o;t.offset=e;break}t.push(r)}}e.decode=n,e.decodeAsync=o;var i=t("./read-format").format.uint8,f=t("./read-token").token,a=t("./common").BUFFER_SHORTAGE},{"./common":3,"./read-format":14,"./read-token":15}],14:[function(t,r,e){(function(r){function n(t,r){var e,n={},o=new Array(r),i=new Array(r);for(e=0;r>e;e++)o[e]=l(t),i[e]=l(t);for(e=0;r>e;e++)n[o[e]]=i[e];return n}function o(t,r){for(var e=new Array(r),n=0;r>n;n++)e[n]=l(t);return e}function i(t,r){var e=t.offset,n=t.offset=e+r;if(n>t.buffer.length)throw E;return w?d.readString.call(t.buffer,e,n):t.buffer.toString("utf-8",e,n)}function f(t,r){var e=t.offset,n=t.offset=e+r;if(n>t.buffer.length)throw E;return t.buffer.slice(e,n)}function a(t,r){var e=t.offset,n=t.offset=e+r+1;if(n>t.buffer.length)throw E;var o=t.buffer[e],i=y.getExtUnpacker(o);if(!i)throw new Error("Invalid ext type: "+(o?"0x"+o.toString(16):o));var f=t.buffer.slice(e+1,n);return i(f)}function u(t){var r=t.buffer;if(t.offset>=r.length)throw E;return r[t.offset++]}function s(t){var r=t.buffer;if(t.offset+2>r.length)throw E;return r[t.offset++]<<8|r[t.offset++]}function c(t,r){return function(e){var n=e.offset,o=e.offset=n+t;if(o>e.buffer.length)throw E;return r.call(e.buffer,n,g)}}function h(t,r){var e=this.readUInt32BE(t,r),n=this.readUInt32BE(t+4,r);return e?4294967296*e+n:n}function p(t,r){var e=this.readInt32BE(t,r),n=this.readUInt32BE(t+4,r);return e?4294967296*e+n:n}e.format={map:n,array:o,str:i,bin:f,ext:a,uint8:u,uint16:s,uint32:c(4,r.prototype.readUInt32BE),uint64:c(8,h),int8:c(1,r.prototype.readInt8),int16:c(2,r.prototype.readInt16BE),int32:c(4,r.prototype.readInt32BE),int64:c(8,p),float32:c(4,r.prototype.readFloatBE),float64:c(8,r.prototype.readDoubleBE)};var d=t("./buffer-lite"),l=t("./read-core").decode,y=t("./ext-preset").preset,E=t("./common").BUFFER_SHORTAGE,w="TYPED_ARRAY_SUPPORT"in r,g=!0}).call(this,t("buffer").Buffer)},{"./buffer-lite":2,"./common":3,"./ext-preset":11,"./read-core":13,buffer:20}],15:[function(t,r,e){function n(){var t;for(t=0;127>=t;t++)a[t]=o(t);for(t=128;143>=t;t++)a[t]=f(t-128,u.map);for(t=144;159>=t;t++)a[t]=f(t-144,u.array);for(t=160;191>=t;t++)a[t]=f(t-160,u.str);for(a[192]=o(null),a[193]=null,a[194]=o(!1),a[195]=o(!0),a[196]=i(u.uint8,u.bin),a[197]=i(u.uint16,u.bin),a[198]=i(u.uint32,u.bin),a[199]=i(u.uint8,u.ext),a[200]=i(u.uint16,u.ext),a[201]=i(u.uint32,u.ext),a[202]=u.float32,a[203]=u.float64,a[204]=u.uint8,a[205]=u.uint16,a[206]=u.uint32,a[207]=u.uint64,a[208]=u.int8,a[209]=u.int16,a[210]=u.int32,a[211]=u.int64,a[212]=f(1,u.ext),a[213]=f(2,u.ext),a[214]=f(4,u.ext),a[215]=f(8,u.ext),a[216]=f(16,u.ext),a[217]=i(u.uint8,u.str),a[218]=i(u.uint16,u.str),a[219]=i(u.uint32,u.str),a[220]=i(u.uint16,u.array),a[221]=i(u.uint32,u.array),a[222]=i(u.uint16,u.map),a[223]=i(u.uint32,u.map),t=224;255>=t;t++)a[t]=o(t-256)}function o(t){return function(){return t}}function i(t,r){return function(e){var n=t(e);return r(e,n)}}function f(t,r){return function(e){return r(e,t)}}var a=e.token=new Array(256),u=t("./read-format").format;n()},{"./read-format":14}],16:[function(t,r,e){function n(t,r){var e=o[typeof r];if(!e)throw new Error('Unsupported type "'+typeof r+'": '+r);e(t,r)}e.encode=n;var o=t("./write-type").type},{"./write-type":18}],17:[function(t,r,e){(function(r){function n(){for(var t=0;255>=t;t++)c[t]=p[t];y?i():o()}function o(){c[196]=f(196),c[197]=a(197),c[198]=u(198),c[199]=f(199),c[200]=a(200),c[201]=u(201),c[202]=s(202,4,r.prototype.writeFloatBE),c[203]=s(203,8,r.prototype.writeDoubleBE),c[204]=f(204),c[205]=a(205),c[206]=u(206),c[207]=s(207,8,h.writeUint64BE),c[208]=f(208),c[209]=a(209),c[210]=u(210),c[211]=s(211,8,h.writeUint64BE),c[217]=f(217),c[218]=a(218),c[219]=u(219),c[220]=a(220),c[221]=u(221),c[222]=a(222),c[223]=u(223)}function i(){c[196]=s(196,1,r.prototype.writeUInt8),c[197]=s(197,2,r.prototype.writeUInt16BE),c[198]=s(198,4,r.prototype.writeUInt32BE),c[199]=s(199,1,r.prototype.writeUInt8),c[200]=s(200,2,r.prototype.writeUInt16BE),c[201]=s(201,4,r.prototype.writeUInt32BE),c[202]=s(202,4,r.prototype.writeFloatBE),c[203]=s(203,8,r.prototype.writeDoubleBE),c[204]=s(204,1,r.prototype.writeUInt8),c[205]=s(205,2,r.prototype.writeUInt16BE),c[206]=s(206,4,r.prototype.writeUInt32BE),c[207]=s(207,8,h.writeUint64BE),c[208]=s(208,1,r.prototype.writeInt8),c[209]=s(209,2,r.prototype.writeInt16BE),c[210]=s(210,4,r.prototype.writeInt32BE),c[211]=s(211,8,h.writeUint64BE),c[217]=s(217,1,r.prototype.writeUInt8),c[218]=s(218,2,r.prototype.writeUInt16BE),c[219]=s(219,4,r.prototype.writeUInt32BE),c[220]=s(220,2,r.prototype.writeUInt16BE),c[221]=s(221,4,r.prototype.writeUInt32BE),c[222]=s(222,2,r.prototype.writeUInt16BE),c[223]=s(223,4,r.prototype.writeUInt32BE)}function f(t){return function(r,e){r.reserve(2);var n=r.buffer,o=r.offset;n[o++]=t,n[o++]=e,r.offset=o}}function a(t){return function(r,e){r.reserve(3);var n=r.buffer,o=r.offset;n[o++]=t,n[o++]=e>>>8,n[o++]=e,r.offset=o}}function u(t){return function(r,e){r.reserve(5);var n=r.buffer,o=r.offset;n[o++]=t,n[o++]=e>>>24,n[o++]=e>>>16,n[o++]=e>>>8,n[o++]=e,r.offset=o}}function s(t,r,e){return function(n,o){n.reserve(r+1),n.buffer[n.offset++]=t,e.call(n.buffer,o,n.offset,d),n.offset+=r}}var c=e.token=new Array(256),h=t("./buffer-lite"),p=t("./write-uint8").uint8,d=!0,l="TYPED_ARRAY_SUPPORT"in r,y=l&&!r.TYPED_ARRAY_SUPPORT;n()}).call(this,t("buffer").Buffer)},{"./buffer-lite":2,"./write-uint8":19,buffer:20}],18:[function(t,r,e){(function(r){function n(t,r){var e=r?195:194;l[e](t,r)}function o(t,r){var e,n=0|r;return r!==n?(e=203,void l[e](t,r)):(e=n>=-32&&127>=n?255&n:n>=0?255>=n?204:65535>=n?205:206:n>=-128?208:n>=-32768?209:210,void l[e](t,n))}function i(t,r){var e=r.length,n=5+3*e;t.reserve(n);var o=32>e?1:255>=e?2:65535>=e?3:5,i=t.offset+o;e=d.writeString.call(t.buffer,r,i);var f=32>e?1:255>=e?2:65535>=e?3:5;if(o!==f){var a=t.offset+f,u=i+e;v?d.copy.call(t.buffer,t.buffer,a,i,u):t.buffer.copy(t.buffer,a,i,u)}var s=1===f?160+e:3>=f?215+f:219;l[s](t,e),t.offset+=e}function f(t,e){if(b(e))return u(t,e);if(null===e)return a(t,e);var n=w.getExtPacker(e);return n&&(e=n(e)),e instanceof g?c(t,e):r.isBuffer(e)?s(t,e):void h(t,e)}function a(t,r){var e=192;l[e](t,r)}function u(t,r){var e=r.length,n=16>e?144+e:65535>=e?220:221;l[n](t,e);for(var o=0;e>o;o++)y(t,r[o])}function s(t,r){var e=r.length,n=255>e?196:65535>=e?197:198;l[n](t,e),t.send(r)}function c(t,r){var e=r.buffer,n=e.length,o=A[n]||(255>n?199:65535>=n?200:201);l[o](t,n),E[r.type](t),t.send(e)}function h(t,r){var e=Object.keys(r),n=e.length,o=16>n?128+n:65535>=n?222:223;l[o](t,n),e.forEach(function(e){y(t,e),y(t,r[e])})}function p(t){return"[object Array]"===Object.prototype.toString.call(t)}e.type={"boolean":n,"function":a,number:o,object:f,string:i,symbol:a,undefined:a};var d=t("./buffer-lite"),l=t("./write-token").token,y=t("./write-core").encode,E=t("./write-uint8").uint8,w=t("./ext-preset").preset,g=t("./ext-buffer").ExtBuffer,v="TYPED_ARRAY_SUPPORT"in r,b=Array.isArray||p,A=[];A[1]=212,A[2]=213,A[4]=214,A[8]=215,A[16]=216}).call(this,t("buffer").Buffer)},{"./buffer-lite":2,"./ext-buffer":10,"./ext-preset":11,"./write-core":16,"./write-token":17,"./write-uint8":19,buffer:20}],19:[function(t,r,e){function n(t){return function(r){r.reserve(1),r.buffer[r.offset++]=t}}for(var o=e.uint8=new Array(256),i=0;255>=i;i++)o[i]=n(i)},{}],20:[function(t,r,e){(function(r){function n(){function t(){}try{var r=new Uint8Array(1);return r.foo=function(){return 42},r.constructor=t,42===r.foo()&&r.constructor===t&&"function"==typeof r.subarray&&0===r.subarray(1,1).byteLength}catch(e){return!1}}function o(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(t){return this instanceof i?(this.length=0,this.parent=void 0,"number"==typeof t?f(this,t):"string"==typeof t?a(this,t,arguments.length>1?arguments[1]:"utf8"):u(this,t)):arguments.length>1?new i(t,arguments[1]):new i(t)}function f(t,r){if(t=y(t,0>r?0:0|E(r)),!i.TYPED_ARRAY_SUPPORT)for(var e=0;r>e;e++)t[e]=0;return t}function a(t,r,e){("string"!=typeof e||""===e)&&(e="utf8");var n=0|g(r,e);return t=y(t,n),t.write(r,e),t}function u(t,r){if(i.isBuffer(r))return s(t,r);if(K(r))return c(t,r);if(null==r)throw new TypeError("must start with number, buffer, array or string");if("undefined"!=typeof ArrayBuffer){if(r.buffer instanceof ArrayBuffer)return h(t,r);if(r instanceof ArrayBuffer)return p(t,r)}return r.length?d(t,r):l(t,r)}function s(t,r){var e=0|E(r.length);return t=y(t,e),r.copy(t,0,0,e),t}function c(t,r){var e=0|E(r.length);t=y(t,e);for(var n=0;e>n;n+=1)t[n]=255&r[n];return t}function h(t,r){var e=0|E(r.length);t=y(t,e);for(var n=0;e>n;n+=1)t[n]=255&r[n];return t}function p(t,r){return i.TYPED_ARRAY_SUPPORT?(r.byteLength,t=i._augment(new Uint8Array(r))):t=h(t,new Uint8Array(r)),t}function d(t,r){var e=0|E(r.length);t=y(t,e);for(var n=0;e>n;n+=1)t[n]=255&r[n];return t}function l(t,r){var e,n=0;"Buffer"===r.type&&K(r.data)&&(e=r.data,n=0|E(e.length)),t=y(t,n);for(var o=0;n>o;o+=1)t[o]=255&e[o];return t}function y(t,r){i.TYPED_ARRAY_SUPPORT?(t=i._augment(new Uint8Array(r)),t.__proto__=i.prototype):(t.length=r,t._isBuffer=!0);var e=0!==r&&r<=i.poolSize>>>1;return e&&(t.parent=Q),t}function E(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function w(t,r){if(!(this instanceof w))return new w(t,r);var e=new i(t,r);return delete e.parent,e}function g(t,r){"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"binary":case"raw":case"raws":return e;case"utf8":case"utf-8":return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return J(t).length;default:if(n)return z(t).length;r=(""+r).toLowerCase(),n=!0}}function v(t,r,e){var n=!1;if(r=0|r,e=void 0===e||e===1/0?this.length:0|e,t||(t="utf8"),0>r&&(r=0),e>this.length&&(e=this.length),r>=e)return"";for(;;)switch(t){case"hex":return S(this,r,e);case"utf8":case"utf-8":return R(this,r,e);case"ascii":return _(this,r,e);case"binary":return k(this,r,e);case"base64":return m(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var i=r.length;if(i%2!==0)throw new Error("Invalid hex string");n>i/2&&(n=i/2);for(var f=0;n>f;f++){var a=parseInt(r.substr(2*f,2),16);if(isNaN(a))throw new Error("Invalid hex string");t[e+f]=a}return f}function A(t,r,e,n){return V(z(r,t.length-e),t,e,n)}function U(t,r,e,n){return V(G(r),t,e,n)}function B(t,r,e,n){return U(t,r,e,n)}function I(t,r,e,n){return V(J(r),t,e,n)}function x(t,r,e,n){return V(H(r,t.length-e),t,e,n)}function m(t,r,e){return 0===r&&e===t.length?X.fromByteArray(t):X.fromByteArray(t.slice(r,e))}function R(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;e>o;){var i=t[o],f=null,a=i>239?4:i>223?3:i>191?2:1;if(e>=o+a){var u,s,c,h;switch(a){case 1:128>i&&(f=i);break;case 2:u=t[o+1],128===(192&u)&&(h=(31&i)<<6|63&u,h>127&&(f=h));break;case 3:u=t[o+1],s=t[o+2],128===(192&u)&&128===(192&s)&&(h=(15&i)<<12|(63&u)<<6|63&s,h>2047&&(55296>h||h>57343)&&(f=h));break;case 4:u=t[o+1],s=t[o+2],c=t[o+3],128===(192&u)&&128===(192&s)&&128===(192&c)&&(h=(15&i)<<18|(63&u)<<12|(63&s)<<6|63&c,h>65535&&1114112>h&&(f=h))}}null===f?(f=65533,a=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),o+=a}return P(n)}function P(t){var r=t.length;if(W>=r)return String.fromCharCode.apply(String,t);for(var e="",n=0;r>n;)e+=String.fromCharCode.apply(String,t.slice(n,n+=W));return e}function _(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;e>o;o++)n+=String.fromCharCode(127&t[o]);return n}function k(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;e>o;o++)n+=String.fromCharCode(t[o]);return n}function S(t,r,e){var n=t.length;(!r||0>r)&&(r=0),(!e||0>e||e>n)&&(e=n);for(var o="",i=r;e>i;i++)o+=q(t[i]);return o}function T(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function L(t,r,e){if(t%1!==0||0>t)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function Y(t,r,e,n,o,f){if(!i.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");if(r>o||f>r)throw new RangeError("value is out of bounds");if(e+n>t.length)throw new RangeError("index out of range")}function D(t,r,e,n){0>r&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);i>o;o++)t[e+o]=(r&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function O(t,r,e,n){0>r&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);i>o;o++)t[e+o]=r>>>8*(n?o:3-o)&255}function C(t,r,e,n,o,i){if(r>o||i>r)throw new RangeError("value is out of bounds");if(e+n>t.length)throw new RangeError("index out of range");if(0>e)throw new RangeError("index out of range")}function M(t,r,e,n,o){return o||C(t,r,e,4,3.4028234663852886e38,-3.4028234663852886e38),Z.write(t,r,e,n,23,4),e+4}function F(t,r,e,n,o){return o||C(t,r,e,8,1.7976931348623157e308,-1.7976931348623157e308),Z.write(t,r,e,n,52,8),e+8}function N(t){if(t=j(t).replace(tt,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function j(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function q(t){return 16>t?"0"+t.toString(16):t.toString(16)}function z(t,r){r=r||1/0;for(var e,n=t.length,o=null,i=[],f=0;n>f;f++){if(e=t.charCodeAt(f),e>55295&&57344>e){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}if(f+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(56320>e){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,128>e){if((r-=1)<0)break;i.push(e)}else if(2048>e){if((r-=2)<0)break;i.push(e>>6|192,63&e|128)}else if(65536>e){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(1114112>e))throw new Error("Invalid code point");if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return i}function G(t){for(var r=[],e=0;e<t.length;e++)r.push(255&t.charCodeAt(e));return r}function H(t,r){for(var e,n,o,i=[],f=0;f<t.length&&!((r-=2)<0);f++)e=t.charCodeAt(f),n=e>>8,o=e%256,i.push(o),i.push(n);return i}function J(t){return X.toByteArray(N(t))}function V(t,r,e,n){for(var o=0;n>o&&!(o+e>=r.length||o>=t.length);o++)r[o+e]=t[o];return o}var X=t("base64-js"),Z=t("ieee754"),K=t("isarray");e.Buffer=i,e.SlowBuffer=w,e.INSPECT_MAX_BYTES=50,i.poolSize=8192;var Q={};i.TYPED_ARRAY_SUPPORT=void 0!==r.TYPED_ARRAY_SUPPORT?r.TYPED_ARRAY_SUPPORT:n(),i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array),i.isBuffer=function(t){return!(null==t||!t._isBuffer)},i.compare=function(t,r){if(!i.isBuffer(t)||!i.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,o=0,f=Math.min(e,n);f>o&&t[o]===r[o];)++o;return o!==f&&(e=t[o],n=r[o]),n>e?-1:e>n?1:0},i.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(t,r){if(!K(t))throw new TypeError("list argument must be an Array of Buffers.");if(0===t.length)return new i(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;e++)r+=t[e].length;var n=new i(r),o=0;for(e=0;e<t.length;e++){var f=t[e];f.copy(n,o),o+=f.length}return n},i.byteLength=g,i.prototype.length=void 0,i.prototype.parent=void 0,i.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?R(this,0,t):v.apply(this,arguments)},i.prototype.equals=function(t){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:0===i.compare(this,t)},i.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},i.prototype.compare=function(t){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?0:i.compare(this,t)},i.prototype.indexOf=function(t,r){function e(t,r,e){for(var n=-1,o=0;e+o<t.length;o++)if(t[e+o]===r[-1===n?0:o-n]){if(-1===n&&(n=o),o-n+1===r.length)return e+n}else n=-1;return-1}if(r>2147483647?r=2147483647:-2147483648>r&&(r=-2147483648),r>>=0,0===this.length)return-1;if(r>=this.length)return-1;if(0>r&&(r=Math.max(this.length+r,0)),"string"==typeof t)return 0===t.length?-1:String.prototype.indexOf.call(this,t,r);if(i.isBuffer(t))return e(this,t,r);if("number"==typeof t)return i.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,t,r):e(this,[t],r);throw new TypeError("val must be string, number or Buffer")},i.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},i.prototype.set=function(t,r){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,r)},i.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))r=0|r,isFinite(e)?(e=0|e,void 0===n&&(n="utf8")):(n=e,e=void 0);else{var o=n;n=r,r=0|e,e=o}var i=this.length-r;if((void 0===e||e>i)&&(e=i),t.length>0&&(0>e||0>r)||r>this.length)throw new RangeError("attempt to write outside buffer bounds");n||(n="utf8");for(var f=!1;;)switch(n){case"hex":return b(this,t,r,e);case"utf8":case"utf-8":return A(this,t,r,e);case"ascii":return U(this,t,r,e);case"binary":return B(this,t,r,e);case"base64":return I(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,r,e);default:if(f)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),f=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var W=4096;i.prototype.slice=function(t,r){var e=this.length;t=~~t,r=void 0===r?e:~~r,0>t?(t+=e,0>t&&(t=0)):t>e&&(t=e),0>r?(r+=e,0>r&&(r=0)):r>e&&(r=e),t>r&&(r=t);var n;if(i.TYPED_ARRAY_SUPPORT)n=i._augment(this.subarray(t,r));else{var o=r-t;n=new i(o,void 0);for(var f=0;o>f;f++)n[f]=this[f+t]}return n.length&&(n.parent=this.parent||this),n},i.prototype.readUIntLE=function(t,r,e){t=0|t,r=0|r,e||L(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return n},i.prototype.readUIntBE=function(t,r,e){t=0|t,r=0|r,e||L(t,r,this.length);for(var n=this[t+--r],o=1;r>0&&(o*=256);)n+=this[t+--r]*o;return n},i.prototype.readUInt8=function(t,r){return r||L(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,r){return r||L(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,r){return r||L(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,r){return r||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,r){return r||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,r,e){t=0|t,r=0|r,e||L(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*r)),n},i.prototype.readIntBE=function(t,r,e){t=0|t,r=0|r,e||L(t,r,this.length);for(var n=r,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i},i.prototype.readInt8=function(t,r){return r||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,r){r||L(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},i.prototype.readInt16BE=function(t,r){r||L(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},i.prototype.readInt32LE=function(t,r){return r||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,r){return r||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,r){return r||L(t,4,this.length),Z.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,r){return r||L(t,4,this.length),Z.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,r){return r||L(t,8,this.length),Z.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,r){return r||L(t,8,this.length),Z.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,r,e,n){t=+t,r=0|r,e=0|e,n||Y(this,t,r,e,Math.pow(2,8*e),0);var o=1,i=0;for(this[r]=255&t;++i<e&&(o*=256);)this[r+i]=t/o&255;return r+e},i.prototype.writeUIntBE=function(t,r,e,n){t=+t,r=0|r,e=0|e,n||Y(this,t,r,e,Math.pow(2,8*e),0);var o=e-1,i=1;for(this[r+o]=255&t;--o>=0&&(i*=256);)this[r+o]=t/i&255;return r+e},i.prototype.writeUInt8=function(t,r,e){return t=+t,r=0|r,e||Y(this,t,r,1,255,0),i.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},i.prototype.writeUInt16LE=function(t,r,e){return t=+t,r=0|r,e||Y(this,t,r,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):D(this,t,r,!0),r+2},i.prototype.writeUInt16BE=function(t,r,e){return t=+t,r=0|r,e||Y(this,t,r,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):D(this,t,r,!1),r+2},i.prototype.writeUInt32LE=function(t,r,e){return t=+t,r=0|r,e||Y(this,t,r,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):O(this,t,r,!0),r+4},i.prototype.writeUInt32BE=function(t,r,e){return t=+t,r=0|r,e||Y(this,t,r,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):O(this,t,r,!1),r+4},i.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r=0|r,!n){var o=Math.pow(2,8*e-1);Y(this,t,r,e,o-1,-o)}var i=0,f=1,a=0>t?1:0;for(this[r]=255&t;++i<e&&(f*=256);)this[r+i]=(t/f>>0)-a&255;return r+e},i.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r=0|r,!n){var o=Math.pow(2,8*e-1);Y(this,t,r,e,o-1,-o)}var i=e-1,f=1,a=0>t?1:0;for(this[r+i]=255&t;--i>=0&&(f*=256);)this[r+i]=(t/f>>0)-a&255;return r+e},i.prototype.writeInt8=function(t,r,e){return t=+t,r=0|r,e||Y(this,t,r,1,127,-128),i.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[r]=255&t,r+1},i.prototype.writeInt16LE=function(t,r,e){return t=+t,r=0|r,e||Y(this,t,r,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):D(this,t,r,!0),r+2},i.prototype.writeInt16BE=function(t,r,e){return t=+t,r=0|r,e||Y(this,t,r,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):D(this,t,r,!1),r+2},i.prototype.writeInt32LE=function(t,r,e){return t=+t,r=0|r,e||Y(this,t,r,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):O(this,t,r,!0),r+4},i.prototype.writeInt32BE=function(t,r,e){return t=+t,r=0|r,e||Y(this,t,r,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),i.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):O(this,t,r,!1),r+4},i.prototype.writeFloatLE=function(t,r,e){return M(this,t,r,!0,e)},i.prototype.writeFloatBE=function(t,r,e){return M(this,t,r,!1,e)},i.prototype.writeDoubleLE=function(t,r,e){return F(this,t,r,!0,e)},i.prototype.writeDoubleBE=function(t,r,e){return F(this,t,r,!1,e)},i.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&e>n&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(0>r)throw new RangeError("targetStart out of bounds");if(0>e||e>=this.length)throw new RangeError("sourceStart out of bounds");
if(0>n)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var o,f=n-e;if(this===t&&r>e&&n>r)for(o=f-1;o>=0;o--)t[o+r]=this[o+e];else if(1e3>f||!i.TYPED_ARRAY_SUPPORT)for(o=0;f>o;o++)t[o+r]=this[o+e];else t._set(this.subarray(e,e+f),r);return f},i.prototype.fill=function(t,r,e){if(t||(t=0),r||(r=0),e||(e=this.length),r>e)throw new RangeError("end < start");if(e!==r&&0!==this.length){if(0>r||r>=this.length)throw new RangeError("start out of bounds");if(0>e||e>this.length)throw new RangeError("end out of bounds");var n;if("number"==typeof t)for(n=r;e>n;n++)this[n]=t;else{var o=z(t.toString()),i=o.length;for(n=r;e>n;n++)this[n]=o[n%i]}return this}},i.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(i.TYPED_ARRAY_SUPPORT)return new i(this).buffer;for(var t=new Uint8Array(this.length),r=0,e=t.length;e>r;r+=1)t[r]=this[r];return t.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var $=i.prototype;i._augment=function(t){return t.constructor=i,t._isBuffer=!0,t._set=t.set,t.get=$.get,t.set=$.set,t.write=$.write,t.toString=$.toString,t.toLocaleString=$.toString,t.toJSON=$.toJSON,t.equals=$.equals,t.compare=$.compare,t.indexOf=$.indexOf,t.copy=$.copy,t.slice=$.slice,t.readUIntLE=$.readUIntLE,t.readUIntBE=$.readUIntBE,t.readUInt8=$.readUInt8,t.readUInt16LE=$.readUInt16LE,t.readUInt16BE=$.readUInt16BE,t.readUInt32LE=$.readUInt32LE,t.readUInt32BE=$.readUInt32BE,t.readIntLE=$.readIntLE,t.readIntBE=$.readIntBE,t.readInt8=$.readInt8,t.readInt16LE=$.readInt16LE,t.readInt16BE=$.readInt16BE,t.readInt32LE=$.readInt32LE,t.readInt32BE=$.readInt32BE,t.readFloatLE=$.readFloatLE,t.readFloatBE=$.readFloatBE,t.readDoubleLE=$.readDoubleLE,t.readDoubleBE=$.readDoubleBE,t.writeUInt8=$.writeUInt8,t.writeUIntLE=$.writeUIntLE,t.writeUIntBE=$.writeUIntBE,t.writeUInt16LE=$.writeUInt16LE,t.writeUInt16BE=$.writeUInt16BE,t.writeUInt32LE=$.writeUInt32LE,t.writeUInt32BE=$.writeUInt32BE,t.writeIntLE=$.writeIntLE,t.writeIntBE=$.writeIntBE,t.writeInt8=$.writeInt8,t.writeInt16LE=$.writeInt16LE,t.writeInt16BE=$.writeInt16BE,t.writeInt32LE=$.writeInt32LE,t.writeInt32BE=$.writeInt32BE,t.writeFloatLE=$.writeFloatLE,t.writeFloatBE=$.writeFloatBE,t.writeDoubleLE=$.writeDoubleLE,t.writeDoubleBE=$.writeDoubleBE,t.fill=$.fill,t.inspect=$.inspect,t.toArrayBuffer=$.toArrayBuffer,t};var tt=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":21,ieee754:22,isarray:23}],21:[function(t,r,e){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(t){"use strict";function r(t){var r=t.charCodeAt(0);return r===f||r===h?62:r===a||r===p?63:u>r?-1:u+10>r?r-u+26+26:c+26>r?r-c:s+26>r?r-s+26:void 0}function e(t){function e(t){s[h++]=t}var n,o,f,a,u,s;if(t.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var c=t.length;u="="===t.charAt(c-2)?2:"="===t.charAt(c-1)?1:0,s=new i(3*t.length/4-u),f=u>0?t.length-4:t.length;var h=0;for(n=0,o=0;f>n;n+=4,o+=3)a=r(t.charAt(n))<<18|r(t.charAt(n+1))<<12|r(t.charAt(n+2))<<6|r(t.charAt(n+3)),e((16711680&a)>>16),e((65280&a)>>8),e(255&a);return 2===u?(a=r(t.charAt(n))<<2|r(t.charAt(n+1))>>4,e(255&a)):1===u&&(a=r(t.charAt(n))<<10|r(t.charAt(n+1))<<4|r(t.charAt(n+2))>>2,e(a>>8&255),e(255&a)),s}function o(t){function r(t){return n.charAt(t)}function e(t){return r(t>>18&63)+r(t>>12&63)+r(t>>6&63)+r(63&t)}var o,i,f,a=t.length%3,u="";for(o=0,f=t.length-a;f>o;o+=3)i=(t[o]<<16)+(t[o+1]<<8)+t[o+2],u+=e(i);switch(a){case 1:i=t[t.length-1],u+=r(i>>2),u+=r(i<<4&63),u+="==";break;case 2:i=(t[t.length-2]<<8)+t[t.length-1],u+=r(i>>10),u+=r(i>>4&63),u+=r(i<<2&63),u+="="}return u}var i="undefined"!=typeof Uint8Array?Uint8Array:Array,f="+".charCodeAt(0),a="/".charCodeAt(0),u="0".charCodeAt(0),s="a".charCodeAt(0),c="A".charCodeAt(0),h="-".charCodeAt(0),p="_".charCodeAt(0);t.toByteArray=e,t.fromByteArray=o}("undefined"==typeof e?this.base64js={}:e)},{}],22:[function(t,r,e){e.read=function(t,r,e,n,o){var i,f,a=8*o-n-1,u=(1<<a)-1,s=u>>1,c=-7,h=e?o-1:0,p=e?-1:1,d=t[r+h];for(h+=p,i=d&(1<<-c)-1,d>>=-c,c+=a;c>0;i=256*i+t[r+h],h+=p,c-=8);for(f=i&(1<<-c)-1,i>>=-c,c+=n;c>0;f=256*f+t[r+h],h+=p,c-=8);if(0===i)i=1-s;else{if(i===u)return f?NaN:(d?-1:1)*(1/0);f+=Math.pow(2,n),i-=s}return(d?-1:1)*f*Math.pow(2,i-n)},e.write=function(t,r,e,n,o,i){var f,a,u,s=8*i-o-1,c=(1<<s)-1,h=c>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,l=n?1:-1,y=0>r||0===r&&0>1/r?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,f=c):(f=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-f))<1&&(f--,u*=2),r+=f+h>=1?p/u:p*Math.pow(2,1-h),r*u>=2&&(f++,u/=2),f+h>=c?(a=0,f=c):f+h>=1?(a=(r*u-1)*Math.pow(2,o),f+=h):(a=r*Math.pow(2,h-1)*Math.pow(2,o),f=0));o>=8;t[e+d]=255&a,d+=l,a/=256,o-=8);for(f=f<<o|a,s+=o;s>0;t[e+d]=255&f,d+=l,f/=256,s-=8);t[e+d-l]|=128*y}},{}],23:[function(t,r,e){var n={}.toString;r.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},{}],24:[function(t,r,e){function n(){return this instanceof n?void 0:new n}!function(t){function e(t){for(var r in s)t[r]=s[r];return t}function n(t,r){return a(this,t).push(r),this}function o(t,r){function e(){i.call(n,t,e),r.apply(this,arguments)}var n=this;return a(n,t).push(e),n}function i(t,r){function e(t){return t!==r}var n,o=this;if(t){if(r){if(n=a(o,t,!0)){if(n=n.filter(e),!n.length)return i.call(o,t);o[u][t]=n}}else if(n=o[u],n&&(delete n[t],!Object.keys(n).length))return i.call(o)}else delete o[u];return o}function f(t,r){function e(t){t.call(i)}function n(t){t.call(i,r)}function o(t){t.apply(i,s)}var i=this,f=a(i,t,!0);if(!f)return!1;var u=arguments.length;if(1===u)f.forEach(e);else if(2===u)f.forEach(n);else{var s=Array.prototype.slice.call(arguments,1);f.forEach(o)}return!!f.length}function a(t,r,e){if(!e||t[u]){var n=t[u]||(t[u]={});return n[r]||(n[r]=[])}}"undefined"!=typeof r&&(r.exports=t);var u="listeners",s={on:n,once:o,off:i,emit:f};e(t.prototype),t.mixin=e}(n)},{}]},{},[1])(1)});

@@ -9,2 +9,3 @@ #!/usr/bin/env node

var Decoder = require("./decoder").Decoder;
var notepack = require("notepack");

@@ -33,5 +34,7 @@ var pkg = require("../package.json");

['stream.write(msgpack.encode(obj));', encode1],
['stream.write(notepack.encode(obj));', encode4],
['msgpack.Encoder().on("data",ondata).encode(obj);', encode2],
['msgpack.createEncodeStream().write(obj);', encode3],
['stream.write(msgpack.decode(buf));', decode1],
['stream.write(notepack.decode(buf));', decode4],
['msgpack.Decoder().on("data",ondata).decode(buf);', decode2],

@@ -81,2 +84,13 @@ ['msgpack.createDecodeStream().write(buf);', decode3]

function encode4(callback) {
var stream = new PassThrough();
var cnt = counter(callback);
stream.on("data", cnt.buf);
stream.on("end", cnt.end);
for (var j = 0; j < opcount; j++) {
stream.write(notepack.encode(data));
}
stream.end();
}
function decode1(callback) {

@@ -122,2 +136,13 @@ var stream = new PassThrough({objectMode: true});

function decode4(callback) {
var stream = new PassThrough({objectMode: true});
var cnt = counter(callback);
stream.on("data", cnt.inc);
stream.on("end", cnt.end);
for (var j = 0; j < opcount; j++) {
stream.write(notepack.decode(packed));
}
stream.end();
}
function rpad(str, len, chr) {

@@ -124,0 +149,0 @@ if (!chr) chr = " ";

@@ -10,2 +10,3 @@ #!/usr/bin/env node

var msgpack_codec = try_require("msgpack.codec");
var notepack = try_require("notepack");

@@ -83,2 +84,8 @@ msgpack5 = msgpack5 && msgpack5();

if (notepack) {
buf = bench('buf = require("notepack").encode(obj);', notepack.encode, data);
obj = bench('obj = require("notepack").decode(buf);', notepack.decode, buf);
test(obj);
}
if (msgpack_unpack) {

@@ -85,0 +92,0 @@ obj = bench('obj = require("msgpack-unpack").decode(buf);', msgpack_unpack, packed);

@@ -13,9 +13,12 @@ // cli.js

"J": "input JSON",
"S": "input JSON(s) '\\n' separated stream",
"m": "output MessagePack (default)",
"j": "output JSON",
"j": "output JSON(s)",
"h": "show help message",
"1": "add spacer for JSON"
"1": "add a spacer for JSON output"
};
process.stderr.write("Usage: msgpack-lite -[flags] [infile] [outfile]\n");
Object.keys(cfgmap).forEach(function(key) {
var keys = Object.keys(cfgmap);
var flags = keys.join("");
process.stderr.write("Usage: msgpack-lite [-" + flags + "] [infile] [outfile]\n");
keys.forEach(function(key) {
process.stderr.write(" -" + key + " " + cfgmap[key] + "\n");

@@ -53,9 +56,15 @@ });

if (args.j) {
encodeJSON(pass, output);
var spacer = args[2] ? " " : args[1] ? " " : null;
pass.on("data", function(data) {
output.write(JSON.stringify(data, null, spacer) + "\n");
});
} else {
pass.pipe(msgpack.createEncodeStream()).pipe(output);
// pass.pipe(msgpack.createEncodeStream()).pipe(output);
pass.on("data", function(data) {
output.write(msgpack.encode(data));
});
}
if (args.J) {
decodeJSON(input, pass);
if (args.J || args.S) {
decodeJSON(input, pass, args);
} else {

@@ -66,22 +75,22 @@ input.pipe(msgpack.createDecodeStream()).pipe(pass);

function encodeJSON(input, output) {
input.on("data", function(data) {
output.write(JSON.stringify(data) + "\n");
});
}
function decodeJSON(input, output) {
function decodeJSON(input, output, args) {
var buf = "";
input.on("data", function(chunk) {
buf += chunk;
check(true);
if (args.S) sendStreaming();
});
input.on("end", function() {
check();
sendAll();
});
function check(leave) {
function sendAll() {
if (!buf.length) return;
output.write(JSON.parse(buf));
}
function sendStreaming(leave) {
var list = buf.split("\n");
if (list.length < 2) return;
if (leave) buf = list.pop();
buf = list.pop();
list.forEach(function(str) {
str = str.replace(/,\s*$/, "");
if (!str.length) return;

@@ -88,0 +97,0 @@ output.write(JSON.parse(str));

{
"name": "msgpack-lite",
"description": "Fast Pure JavaScript MessagePack Encoder and Decoder",
"version": "0.1.13",
"version": "0.1.14",
"author": "@kawanet",

@@ -17,14 +17,9 @@ "bin": {

"devDependencies": {
"async": "^1.4.2",
"browserify": "^11.0.1",
"concat-stream": "^1.5.0",
"async": "^1.5.0",
"browserify": "^12.0.1",
"concat-stream": "^1.5.1",
"jshint": "^2.8.0",
"mocha": "^2.3.0",
"msgpack-js": "^0.3.0",
"msgpack-js-v5": "^0.3.0-v5",
"msgpack-unpack": "^2.1.1",
"msgpack.codec": "git+https://github.com/kawanet/msgpack-javascript.git#msgpack.codec",
"msgpack5": "^3.0.0",
"uglify-js": "^2.4.24",
"zuul": "^3.3.0"
"mocha": "^2.3.4",
"uglify-js": "^2.6.1",
"zuul": "^3.8.0"
},

@@ -54,2 +49,11 @@ "homepage": "https://github.com/kawanet/msgpack-lite",

"main": "index.js",
"optionalDependencies": {
"msgpack": "^1.0.2",
"msgpack-js": "^0.3.0",
"msgpack-js-v5": "^0.3.0-v5",
"msgpack-unpack": "^2.1.1",
"msgpack.codec": "git+https://github.com/kawanet/msgpack-javascript.git#msgpack.codec",
"msgpack5": "^3.3.0",
"notepack": "0.0.2"
},
"repository": {

@@ -56,0 +60,0 @@ "type": "git",

@@ -12,7 +12,7 @@ # msgpack-lite [![npm version](https://badge.fury.io/js/msgpack-lite.svg)](http://badge.fury.io/js/msgpack-lite) [![Build Status](https://travis-ci.org/kawanet/msgpack-lite.svg?branch=master)](https://travis-ci.org/kawanet/msgpack-lite)

- Pure JavaScript only (No node-gyp nor gcc required)
- Faster than any other pure JavaScript libraries: **5x faster** encoding and **50% faster** decoding
- Even faster than C++ based [msgpack](https://www.npmjs.com/package/msgpack) library: **50% faster** encoding and **10% faster** decoding
- Faster than any other pure JavaScript libraries on node.js v4
- Even faster than C++ based [msgpack](https://www.npmjs.com/package/msgpack) library (**90% faster** on encoding)
- Streaming encoding and decoding interface is also available. It's more faster.
- [Browsers](https://saucelabs.com/u/msgpack-lite) ready (Chrome, Firefox, Safari and even works on IE8)
- [Tested](https://travis-ci.org/kawanet/msgpack-lite) on Node.js-v0.12, v0.10 and io.js-v3.3 and browsers
- [Tested](https://travis-ci.org/kawanet/msgpack-lite) on Node.js v0.10, v0.12 and v4.2 as well as browsers

@@ -29,2 +29,4 @@ ### Encoding and Decoding MessagePack

var data = msgpack.decode(buffer); // => {"foo": "bar"}
// if encode/decode receives an invalid argument an error is thrown
```

@@ -118,10 +120,11 @@

- [https://www.npmjs.com/package/msgpack](https://www.npmjs.com/package/msgpack) (0.2.6)
- [https://www.npmjs.com/package/msgpack](https://www.npmjs.com/package/msgpack) (1.0.2)
- [https://www.npmjs.com/package/msgpack-js](https://www.npmjs.com/package/msgpack-js) (0.3.0)
- [https://www.npmjs.com/package/msgpack-js-v5](https://www.npmjs.com/package/msgpack-js-v5) (0.3.0-v5)
- [https://www.npmjs.com/package/msgpack5](https://www.npmjs.com/package/msgpack5) (3.1.0)
- [https://www.npmjs.com/package/msgpack-unpack](https://www.npmjs.com/package/msgpack-unpack) (2.1.1)
- [https://github.com/msgpack/msgpack-javascript](https://github.com/msgpack/msgpack-javascript) (msgpack.codec)
- [https://www.npmjs.com/package/msgpack5](https://www.npmjs.com/package/msgpack5) (3.3.0)
- [https://www.npmjs.com/package/notepack](https://www.npmjs.com/package/notepack) (0.0.2)
### Benchmark
### Benchmarks

@@ -134,17 +137,19 @@ A benchmark tool `lib/benchmark.js` is available to compare encoding/decoding speed

--------------------------------------------------------- | -----: | ----: | -----:
buf = Buffer(JSON.stringify(obj)); | 261300 | 10002 | 26124
obj = JSON.parse(buf); | 259200 | 10013 | 25886
buf = require("msgpack-lite").encode(obj); | 242800 | 10001 | 24277
obj = require("msgpack-lite").decode(buf); | 212000 | 10002 | 21195
buf = require("msgpack").pack(obj); | 162800 | 10009 | 16265
obj = require("msgpack").unpack(buf); | 189800 | 10012 | 18957
buf = Buffer(require("msgpack.codec").msgpack.pack(obj)); | 46900 | 10006 | 4687
obj = require("msgpack.codec").msgpack.unpack(buf); | 155900 | 10000 | 15590
buf = require("msgpack-js-v5").encode(obj); | 45200 | 10017 | 4512
obj = require("msgpack-js-v5").decode(buf); | 146700 | 10015 | 14648
buf = require("msgpack-js").encode(obj); | 43000 | 10009 | 4296
obj = require("msgpack-js").decode(buf); | 146400 | 10011 | 14623
buf = require("msgpack5")().encode(obj); | 4500 | 10040 | 448
obj = require("msgpack5")().decode(buf); | 18900 | 10025 | 1885
obj = require("msgpack-unpack").decode(buf); | 1000 | 10343 | 96
buf = Buffer(JSON.stringify(obj)); | 1055200 | 10000 | 105520
obj = JSON.parse(buf); | 863800 | 10000 | 86380
buf = require("msgpack-lite").encode(obj); | 969100 | 10000 | 96910
obj = require("msgpack-lite").decode(buf); | 600300 | 10000 | 60030
buf = require("msgpack").pack(obj); | 503500 | 10001 | 50344
obj = require("msgpack").unpack(buf); | 560200 | 10001 | 56014
buf = Buffer(require("msgpack.codec").msgpack.pack(obj)); | 653500 | 10000 | 65349
obj = require("msgpack.codec").msgpack.unpack(buf); | 367500 | 10001 | 36746
buf = require("msgpack-js-v5").encode(obj); | 189500 | 10002 | 18946
obj = require("msgpack-js-v5").decode(buf); | 408900 | 10000 | 40890
buf = require("msgpack-js").encode(obj); | 189200 | 10000 | 18920
obj = require("msgpack-js").decode(buf); | 375600 | 10002 | 37552
buf = require("msgpack5")().encode(obj); | 110500 | 10009 | 11040
obj = require("msgpack5")().decode(buf); | 165500 | 10000 | 16550
buf = require("notepack")().encode(obj); | 847800 | 10000 | 84780
obj = require("notepack")().decode(buf); | 599800 | 10000 | 59980
obj = require("msgpack-unpack").decode(buf); | 48100 | 10002 | 4809

@@ -155,10 +160,14 @@ Streaming benchmark tool `lib/benchmark-stream.js` is also available.

operation (1000000 x 3) | op | ms | op/s
operation (1000000 x 2) | op | ms | op/s
------------------------------------------------ | ------: | ----: | -----:
stream.write(msgpack.encode(obj)); | 1000000 | 36072 | 27722
msgpack.createEncodeStream().write(obj); | 1000000 | 6080 | 164473
stream.write(msgpack.decode(buf)); | 1000000 | 9568 | 104515
msgpack.createDecodeStream().write(buf); | 1000000 | 5681 | 176025
stream.write(msgpack.encode(obj)); | 1000000 | 3027 | 330360
stream.write(notepack.encode(obj)); | 1000000 | 2012 | 497017
msgpack.Encoder().on("data",ondata).encode(obj); | 1000000 | 2956 | 338294
msgpack.createEncodeStream().write(obj); | 1000000 | 1888 | 529661
stream.write(msgpack.decode(buf)); | 1000000 | 2020 | 495049
stream.write(notepack.decode(buf)); | 1000000 | 1794 | 557413
msgpack.Decoder().on("data",ondata).decode(buf); | 1000000 | 2744 | 364431
msgpack.createDecodeStream().write(buf); | 1000000 | 1341 | 745712
Test environment: msgpack-lite 0.1.13 on Node v0.12.7
Test environment: msgpack-lite 0.1.14, Node v4.2.3, Intel(R) Xeon(R) CPU E5-2666 v3 @ 2.90GHz

@@ -165,0 +174,0 @@ ### MessagePack Mapping Table

@@ -32,2 +32,7 @@ #!/usr/bin/env mocha -R spec

test("notepack", function(they) {
assert.deepEqual(they.decode(msgpack.encode(data)), data);
assert.deepEqual(msgpack.decode(Buffer(they.encode(data))), data);
});
test("msgpack-unpack", function(they) {

@@ -34,0 +39,0 @@ assert.deepEqual(they(msgpack.encode(data)), data);

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc