UNPKG

cdap-avsc

Version:

This project is a clone of mtth/avsc repo with modifications required by CDAP

1 lines 196 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.cdapavsc=e():t.cdapavsc=e()}(window,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=24)}([function(t,e,r){"use strict";(function(t){var n=r(25),i=r(26),o=r(16);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,r);if("number"!=typeof t)return h(this,t,e,r);if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}function h(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=l(t,e),t}(t,e,r,n):"string"==typeof e?function(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(e,r),i=(t=a(t,n)).write(e,r);return i!==n&&(t=t.slice(0,i)),t}(t,e,r):function(t,e){if(u.isBuffer(e)){var r=0|p(e.length);return 0===(t=a(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?a(t,0):l(t,e);if("Buffer"===e.type&&o(e.data))return l(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function c(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,e){if(c(e),t=a(t,e<0?0:0|p(e)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function l(t,e){var r=e.length<0?0:0|p(e.length);t=a(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function p(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function d(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return D(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return j(t).length;default:if(n)return D(t).length;e=(""+e).toLowerCase(),n=!0}}function _(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:g(t,e,r,n,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):g(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(t,e,r,n,i){var o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a/=s=2,u/=2,r/=2}function h(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var c=-1;for(o=r;o<a;o++)if(h(t,o)===h(e,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*s}else-1!==c&&(o-=o-c),c=-1}else for(a<r+u&&(r=a-u),o=r;0<=o;o--){for(var f=!0,l=0;l<u;l++)if(h(t,o+l)!==h(e,l)){f=!1;break}if(f)return o}return-1}function v(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?i<(n=Number(n))&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");o/2<n&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[r+s]=a}return s}function m(t,e,r,n){return F(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function w(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function b(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,a,u,h=t[i],c=null,f=239<h?4:223<h?3:191<h?2:1;if(i+f<=r)switch(f){case 1:h<128&&(c=h);break;case 2:128==(192&(o=t[i+1]))&&127<(u=(31&h)<<6|63&o)&&(c=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&2047<(u=(15&h)<<12|(63&o)<<6|63&s)&&(u<55296||57343<u)&&(c=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&65535<(u=(15&h)<<18|(63&o)<<12|(63&s)<<6|63&a)&&u<1114112&&(c=u)}null===c?(c=65533,f=1):65535<c&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=f}return function(t){var e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=k));return r}(n)}e.Buffer=u,e.SlowBuffer=function(t){return+t!=t&&(t=0),u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.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}}(),e.kMaxLength=s(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,r){return h(null,t,e,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,r){return n=null,o=e,s=r,c(i=t),i<=0?a(n,i):void 0!==o?"string"==typeof s?a(n,i).fill(o,s):a(n,i).fill(o):a(n,i);var n,i,o,s},u.allocUnsafe=function(t){return f(null,t)},u.allocUnsafeSlow=function(t){return f(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},u.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}},u.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var r;if(void 0===e)for(r=e=0;r<t.length;++r)e+=t[r].length;var n=u.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var s=t[r];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},u.byteLength=d,u.prototype._isBuffer=!0,u.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 e=0;e<t;e+=2)_(this,e,e+1);return this},u.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 e=0;e<t;e+=4)_(this,e,e+3),_(this,e+1,e+2);return this},u.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 e=0;e<t;e+=8)_(this,e,e+7),_(this,e+1,e+6),_(this,e+2,e+5),_(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?b(this,0,t):function(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,r);case"utf8":case"utf-8":return b(this,e,r);case"ascii":return E(this,e,r);case"latin1":case"binary":return x(this,e,r);case"base64":return w(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return 0<this.length&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,r,n,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(i<=n&&r<=e)return 0;if(i<=n)return-1;if(r<=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),h=this.slice(n,i),c=t.slice(e,r),f=0;f<a;++f)if(h[f]!==c[f]){o=h[f],s=c[f];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||i<r)&&(r=i),0<t.length&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o,s,a,u,h,c,f=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return h=e,c=r,F(D(t,this.length-h),this,h,c);case"ascii":return m(this,t,e,r);case"latin1":case"binary":return m(this,t,e,r);case"base64":return this,a=e,u=r,F(j(t),this,a,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o=e,s=r,F(function(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=(r=t.charCodeAt(s))>>8,i=r%256,o.push(i),o.push(n);return o}(t,this.length-o),this,o,s);default:if(f)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),f=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function E(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function x(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function T(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||n<r)&&(r=n);for(var i="",o=e;o<r;++o)i+=M(t[o]);return i}function S(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function A(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(r<t+e)throw new RangeError("Trying to access beyond buffer length")}function R(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(i<e||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function L(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function O(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function B(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(t,e,r,n,o){return o||B(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function I(t,e,r,n,o){return o||B(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):n<t&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):n<e&&(e=n),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=u.prototype;else{var i=e-t;r=new u(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},u.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||A(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},u.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||A(t,e,this.length);for(var n=this[t+--e],i=1;0<e&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUInt8=function(t,e){return e||A(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||A(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||A(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||A(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||A(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||A(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return(i*=128)<=n&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||A(t,e,this.length);for(var n=e,i=1,o=this[t+--n];0<n&&(i*=256);)o+=this[t+--n]*i;return(i*=128)<=o&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||A(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||A(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||A(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||A(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||A(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||A(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||A(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||A(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||A(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||R(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||R(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;0<=--i&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):L(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):L(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):O(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):O(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);R(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);R(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;0<=--o&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):L(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):L(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):O(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):O(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return I(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return I(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),0<n&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,o=n-r;if(this===t&&r<e&&e<n)for(i=o-1;0<=i;--i)t[i+e]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var s=u.isBuffer(t)?t:D(new u(t,n).toString()),a=s.length;for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};var z=/[^+\/0-9A-Za-z-_]/g;function M(t){return t<16?"0"+t.toString(16):t.toString(16)}function D(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if(55295<(r=t.charCodeAt(s))&&r<57344){if(!i){if(56319<r){-1<(e-=3)&&o.push(239,191,189);continue}if(s+1===n){-1<(e-=3)&&o.push(239,191,189);continue}i=r;continue}if(r<56320){-1<(e-=3)&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&-1<(e-=3)&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function j(t){return n.toByteArray(function(t){var e;if((t=(e=t,e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")).replace(z,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(9))},function(t,e){var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var u,h=[],c=!1,f=-1;function l(){c&&u&&(c=!1,u.length?h=u.concat(h):f=-1,h.length&&p())}function p(){if(!c){var t=a(l);c=!0;for(var e=h.length;e;){for(u=h,h=[];++f<e;)u&&u[f].run();f=-1,e=h.length}u=null,c=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function _(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];h.push(new d(t,e)),1!==h.length||c||a(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=_,i.addListener=_,i.once=_,i.off=_,i.removeListener=_,i.removeAllListeners=_,i.emit=_,i.prependListener=_,i.prependOnceListener=_,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,r){"use strict";(function(e){var n=r(28);function i(t){var e=Math.pow(2,31),r=Math.floor(t||Math.random()*(e-1));this._max=e,this._nextInt=function(){return r=(1103515245*r+12345)%e}}function o(){this._index=0,this._items=[]}function s(t,e){if(this.buf=t,this.pos=0|e,this.pos<0)throw new Error("negative offset")}function a(t,e){for(;e--;)t[e]=~t[e]}i.prototype.nextBoolean=function(){return!!(this._nextInt()%2)},i.prototype.nextInt=function(t,e){return void 0===e&&(e=t,t=0),e=void 0===e?this._max:e,t+Math.floor(this.nextFloat()*(e-t))},i.prototype.nextFloat=function(t,e){return void 0===e&&(e=t,t=0),t+((e=void 0===e?1:e)-t)*this._nextInt()/this._max},i.prototype.nextString=function(t,e){t|=0;var r="";-1<(e=e||"aA").indexOf("a")&&(r+="abcdefghijklmnopqrstuvwxyz"),-1<e.indexOf("A")&&(r+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),-1<e.indexOf("#")&&(r+="0123456789"),-1<e.indexOf("!")&&(r+="~`!@#$%^&*()_+-={}[]:\";'<>?,./|\\");for(var n=[],i=0;i<t;i++)n.push(this.choice(r));return n.join("")},i.prototype.nextBuffer=function(t){var r,n=[];for(r=0;r<t;r++)n.push(this.nextInt(256));return new e(n)},i.prototype.choice=function(t){var e=t.length;if(!e)throw new Error("choosing from empty array");return t[this.nextInt(e)]},o.prototype.push=function(t){var e,r=this._items,n=0|r.length;for(r.push(t);0<n&&r[n].index<r[e=n-1>>1].index;)t=r[n],r[n]=r[e],r[e]=t,n=e},o.prototype.pop=function(){var t=this._items,e=t.length-1|0,r=t[0];if(!r||r.index>this._index)return null;if(this._index++,!e)return t.pop(),r;t[0]=t.pop();for(var n,i,o,s,a,u,h,c=e>>1,f=0;f<c&&(s=t[f],i=f+1<<1,u=t[n=1+(f<<1)],o=!(h=t[i])||u.index<=h.index?(a=u,n):(a=h,i),!(a.index>=s.index));)t[o]=s,t[f]=a,f=o;return r},s.prototype.isValid=function(){return this.pos<=this.buf.length},s.prototype.readBoolean=function(){return!!this.buf[this.pos++]},s.prototype.skipBoolean=function(){this.pos++},s.prototype.writeBoolean=function(t){this.buf[this.pos++]=!!t},s.prototype.readInt=s.prototype.readLong=function(){for(var t,e,r,n,i=0,o=0,s=this.buf;e=128&(t=s[this.pos++]),i|=(127&t)<<o,o+=7,e&&o<28;);if(e){for(r=i,n=268435456;r+=(127&(t=s[this.pos++]))*n,n*=128,128&t;);return(r%2?-(r+1):r)/2}return i>>1^-(1&i)},s.prototype.skipInt=s.prototype.skipLong=function(){for(var t=this.buf;128&t[this.pos++];);},s.prototype.writeInt=s.prototype.writeLong=function(t){var e,r,n=this.buf;if(-1073741824<=t&&t<1073741824)for(r=0<=t?t<<1:~t<<1|1;n[this.pos]=127&r,(r>>=7)&&(n[this.pos++]|=128););else for(e=0<=t?2*t:2*-t-1;n[this.pos]=127&e,1<=(e/=128)&&(n[this.pos++]|=128););this.pos++},s.prototype.readFloat=function(){var t=this.buf,e=this.pos;if(this.pos+=4,!(this.pos>t.length))return this.buf.readFloatLE(e)},s.prototype.skipFloat=function(){this.pos+=4},s.prototype.writeFloat=function(t){var e=this.buf,r=this.pos;if(this.pos+=4,!(this.pos>e.length))return this.buf.writeFloatLE(t,r)},s.prototype.readDouble=function(){var t=this.buf,e=this.pos;if(this.pos+=8,!(this.pos>t.length))return this.buf.readDoubleLE(e)},s.prototype.skipDouble=function(){this.pos+=8},s.prototype.writeDouble=function(t){var e=this.buf,r=this.pos;if(this.pos+=8,!(this.pos>e.length))return this.buf.writeDoubleLE(t,r)},s.prototype.readFixed=function(t){var r=this.pos;if(this.pos+=t,!(this.pos>this.buf.length)){var n=new e(t);return this.buf.copy(n,0,r,r+t),n}},s.prototype.skipFixed=function(t){this.pos+=t},s.prototype.writeFixed=function(t,e){e=e||t.length;var r=this.pos;this.pos+=e,this.pos>this.buf.length||t.copy(this.buf,r,0,e)},s.prototype.readBytes=function(){return this.readFixed(this.readLong())},s.prototype.skipBytes=function(){var t=this.readLong();this.pos+=t},s.prototype.writeBytes=function(t){var e=t.length;this.writeLong(e),this.writeFixed(t,e)},s.prototype.readString=function(){var t=this.readLong(),e=this.pos,r=this.buf;if(this.pos+=t,!(this.pos>r.length))return this.buf.utf8Slice(e,e+t)},s.prototype.skipString=function(){var t=this.readLong();this.pos+=t},s.prototype.writeString=function(t){var r=e.byteLength(t);this.writeLong(r);var n=this.pos;this.pos+=r,this.pos>this.buf.length||this.buf.utf8Write(t,n,r)},s.prototype.writeBinary=function(t,e){var r=this.pos;this.pos+=e,this.pos>this.buf.length||(this.buf.latin1Write?this.buf.latin1Write(t,r,e):this.buf.binaryWrite(t,r,e))},s.prototype.matchBoolean=function(t){return this.buf[this.pos++]-t.buf[t.pos++]},s.prototype.matchInt=s.prototype.matchLong=function(t){var e=this.readLong(),r=t.readLong();return e===r?0:e<r?-1:1},s.prototype.matchFloat=function(t){var e=this.readFloat(),r=t.readFloat();return e===r?0:e<r?-1:1},s.prototype.matchDouble=function(t){var e=this.readDouble(),r=t.readDouble();return e===r?0:e<r?-1:1},s.prototype.matchFixed=function(t,e){return this.readFixed(e).compare(t.readFixed(e))},s.prototype.matchBytes=s.prototype.matchString=function(t){var e=this.readLong(),r=this.pos;this.pos+=e;var n=t.readLong(),i=t.pos;t.pos+=n;var o=this.buf.slice(r,this.pos),s=t.buf.slice(i,t.pos);return o.compare(s)},s.prototype.unpackLongBytes=function(){var t,r,n=new e(8),i=0,o=0,s=6,u=this.buf;for(r=1&(t=u[this.pos++]),n.fill(0),i|=(127&t)>>1;128&t;)i|=(127&(t=u[this.pos++]))<<s,8<=(s+=7)&&(s-=8,n[o++]=i,i>>=8);return n[o]=i,r&&a(n,8),n},s.prototype.packLongBytes=function(t){var e,r=(128&t[7])>>7,n=this.buf,i=1,o=0,s=3;e=r?(a(t,8),1):0;for(var u=[t.readUIntLE(0,3),t.readUIntLE(3,3),t.readUIntLE(6,2)];s&&!u[--s];);for(;o<s;)for(e|=u[o++]<<i,i+=24;7<i;)n[this.pos++]=127&e|128,e>>=7,i-=7;for(e|=u[s]<<i;n[this.pos]=127&e,(e>>=7)&&(n[this.pos++]|=128););this.pos++,r&&a(t,8)},t.exports={abstractFunction:function(){throw new Error("abstract")},capitalize:function(t){return t.charAt(0).toUpperCase()+t.slice(1)},getHash:function(t,e){e=e||"md5";var r=n.createHash(e);return r.end(t),r.read()},compare:function(t,e){return t===e?0:t<e?-1:1},getOption:function(t,e,r){var n=t[e];return void 0===n?r:n},jsonEnd:function(t,e){e|=0;var r=t.charAt(e++);if(/[\d-]/.test(r)){for(;/[eE\d.+-]/.test(t.charAt(e));)e++;return e}if(/true|null/.test(t.slice(e-1,e+3)))return e+3;if(/false/.test(t.slice(e-1,e+4)))return e+4;var n=0,i=!1;do{switch(r){case"{":case"[":i||n++;break;case"}":case"]":if(!i&&!--n)return e;break;case'"':if(i=!i,!n&&!i)return e;break;case"\\":e++}}while(r=t.charAt(e++));return-1},toMap:function(t,e){var r,n,i={};for(r=0;r<t.length;r++)i[e(n=t[r])]=n;return i},singleIndexOf:function(t,e){var r,n,i=-1;if(!t)return-1;for(r=0,n=t.length;r<n;r++)if(t[r]===e){if(0<=i)return-2;i=r}return i},hasDuplicates:function(t,e){var r,n,i,o={};for(r=0,n=t.length;r<n;r++){if(i=t[r],e&&(i=e(i)),o[i])return!0;o[i]=!0}return!1},Lcg:i,OrderedQueue:o,Tap:s}}).call(this,r(0).Buffer)},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e,r){"use strict";var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=f;var i=r(13),o=r(8);o.inherits=r(3);var s=r(17),a=r(14);o.inherits(f,s);for(var u=n(a.prototype),h=0;h<u.length;h++){var c=u[h];f.prototype[c]||(f.prototype[c]=a.prototype[c])}function f(t){if(!(this instanceof f))return new f(t);s.call(this,t),a.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",l)}function l(){this.allowHalfOpen||this._writableState.ended||i(p,this)}function p(t){t.end()}},function(t,e,r){(function(t,n){var i=/%[sdj%]/g;e.format=function(t){if(!g(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(a(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,o=n.length,s=String(t).replace(i,function(t){if("%%"===t)return"%";if(o<=r)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),u=n[r];r<o;u=n[++r])_(u)||!w(u)?s+=" "+u:s+=" "+a(u);return s},e.deprecate=function(r,i){if(v(t.process))return function(){return e.deprecate(r,i).apply(this,arguments)};if(!0===n.noDeprecation)return r;var o=!1;return function(){if(!o){if(n.throwDeprecation)throw new Error(i);n.traceDeprecation?console.trace(i):console.error(i),o=!0}return r.apply(this,arguments)}};var o,s={};function a(t,r){var n={seen:[],stylize:h};return 3<=arguments.length&&(n.depth=arguments[2]),4<=arguments.length&&(n.colors=arguments[3]),d(r)?n.showHidden=r:r&&e._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),c(n,t,n.depth)}function u(t,e){var r=a.styles[e];return r?"["+a.colors[r][0]+"m"+t+"["+a.colors[r][1]+"m":t}function h(t,e){return t}function c(t,r,n){if(t.customInspect&&r&&E(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return g(i)||(i=c(t,i,n)),i}var o=function(t,e){if(v(e))return t.stylize("undefined","undefined");if(g(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return y(e)?t.stylize(""+e,"number"):d(e)?t.stylize(""+e,"boolean"):_(e)?t.stylize("null","null"):void 0}(t,r);if(o)return o;var s,a=Object.keys(r),u=(s={},a.forEach(function(t,e){s[t]=!0}),s);if(t.showHidden&&(a=Object.getOwnPropertyNames(r)),k(r)&&(0<=a.indexOf("message")||0<=a.indexOf("description")))return f(r);if(0===a.length){if(E(r)){var h=r.name?": "+r.name:"";return t.stylize("[Function"+h+"]","special")}if(m(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(b(r))return t.stylize(Date.prototype.toString.call(r),"date");if(k(r))return f(r)}var w,x="",T=!1,S=["{","}"];return p(r)&&(T=!0,S=["[","]"]),E(r)&&(x=" [Function"+(r.name?": "+r.name:"")+"]"),m(r)&&(x=" "+RegExp.prototype.toString.call(r)),b(r)&&(x=" "+Date.prototype.toUTCString.call(r)),k(r)&&(x=" "+f(r)),0!==a.length||T&&0!=r.length?n<0?m(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),w=T?function(t,e,r,n,i){for(var o=[],s=0,a=e.length;s<a;++s)A(e,String(s))?o.push(l(t,e,r,n,String(s),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(l(t,e,r,n,i,!0))}),o}(t,r,n,u,a):a.map(function(e){return l(t,r,n,u,e,T)}),t.seen.pop(),function(t,e,r){return 60<t.reduce(function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(w,x,S)):S[0]+x+S[1]}function f(t){return"["+Error.prototype.toString.call(t)+"]"}function l(t,e,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),A(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(u.value)<0?-1<(a=_(r)?c(t,u.value,null):c(t,u.value,r-1)).indexOf("\n")&&(a=o?a.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+a.split("\n").map(function(t){return" "+t}).join("\n")):a=t.stylize("[Circular]","special")),v(s)){if(o&&i.match(/^\d+$/))return a;s=(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),t.stylize(s,"string"))}return s+": "+a}function p(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function _(t){return null===t}function y(t){return"number"==typeof t}function g(t){return"string"==typeof t}function v(t){return void 0===t}function m(t){return w(t)&&"[object RegExp]"===x(t)}function w(t){return"object"==typeof t&&null!==t}function b(t){return w(t)&&"[object Date]"===x(t)}function k(t){return w(t)&&("[object Error]"===x(t)||t instanceof Error)}function E(t){return"function"==typeof t}function x(t){return Object.prototype.toString.call(t)}function T(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(v(o)&&(o=n.env.NODE_DEBUG||""),t=t.toUpperCase(),!s[t])if(new RegExp("\\b"+t+"\\b","i").test(o)){var r=n.pid;s[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else s[t]=function(){};return s[t]},(e.inspect=a).colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=p,e.isBoolean=d,e.isNull=_,e.isNullOrUndefined=function(t){return null==t},e.isNumber=y,e.isString=g,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=v,e.isRegExp=m,e.isObject=w,e.isDate=b,e.isError=k,e.isFunction=E,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(29);var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){var t,r;console.log("%s - %s",(r=[T((t=new Date).getHours()),T(t.getMinutes()),T(t.getSeconds())].join(":"),[t.getDate(),S[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=r(3),e._extend=function(t,e){if(!e||!w(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this,r(9),r(1))},function(t,e,r){t.exports=i;var n=r(7).EventEmitter;function i(){n.call(this)}r(3)(i,n),i.Readable=r(30),i.Writable=r(33),i.Duplex=r(34),i.Transform=r(20),i.PassThrough=r(35),(i.Stream=i).prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",u));var s=!1;function a(){s||(s=!0,t.end())}function u(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function h(t){if(c(),0===n.listenerCount(this,"error"))throw t}function c(){r.removeListener("data",i),t.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",u),r.removeListener("error",h),t.removeListener("error",h),r.removeListener("end",c),r.removeListener("close",c),t.removeListener("close",c)}return r.on("error",h),t.on("error",h),r.on("end",c),r.on("close",c),t.on("close",c),t.emit("pipe",r),t}},function(t,e){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(t){return"function"==typeof t}function i(t){return"object"==typeof t&&null!==t}function o(t){return void 0===t}((t.exports=r).EventEmitter=r).prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},r.prototype.emit=function(t){var e,r,s,a,u,h;if(this._events||(this._events={}),"error"===t&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var c=new Error('Uncaught, unspecified "error" event. ('+e+")");throw c.context=e,c}if(o(r=this._events[t]))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),r.apply(this,a)}else if(i(r))for(a=Array.prototype.slice.call(arguments,1),s=(h=r.slice()).length,u=0;u<s;u++)h[u].apply(this,a);return!0},r.prototype.on=r.prototype.addListener=function(t,e){var s;if(!n(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,n(e.listener)?e.listener:e),this._events[t]?i(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,i(this._events[t])&&!this._events[t].warned&&(s=o(this._maxListeners)?r.defaultMaxListeners:this._maxListeners)&&0<s&&this._events[t].length>s&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.once=function(t,e){if(!n(e))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(t,i),r||(r=!0,e.apply(this,arguments))}return i.listener=e,this.on(t,i),this},r.prototype.removeListener=function(t,e){var r,o,s,a;if(!n(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(s=(r=this._events[t]).length,o=-1,r===e||n(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(i(r)){for(a=s;0<a--;)if(r[a]===e||r[a].listener&&r[a].listener===e){o=a;break}if(o<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(o,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n(r=this._events[t]))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){return this._events&&this._events[t]?n(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(n(e))return 1;if(e)return e.length}return 0},r.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,r){(function(t){function r(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===r(t)},e.isBoolean=function(t){return"boolean"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"==typeof t},e.isString=function(t){return"string"==typeof t},e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===r(t)},e.isObject=function(t){return"object"==typeof t&&null!==t},e.isDate=function(t){return"[object Date]"===r(t)},e.isError=function(t){return"[object Error]"===r(t)||t instanceof Error},e.isFunction=function(t){return"function"==typeof t},e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=t.isBuffer}).call(this,r(0).Buffer)},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";(function(e){function n(t,e,r){return(n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&function(t,e){(Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}(i,r.prototype),i}).apply(null,arguments)}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var s=r(2),a=r(0),u=r(5),h=s.Tap,c=u.format,f={array:z,boolean:b,bytes:A,double:T,enum:B,error:M,fixed:N,float:x,int:k,long:E,map:I,null:w,record:M,string:S},l=/^[A-Za-z_][A-Za-z0-9_-]*$/,p=new s.Lcg,d=new h(new a.SlowBuffer(1024)),_=null,y=!1;function g(t,e){if(null===t)throw new Error('invalid type: null (did you mean "null"?)');if(v.isType(t))return t;var r;if((e=e||{}).registry=e.registry||{},e.typeHook&&(r=e.typeHook(t,e))){if(!v.isType(r))throw new Error(c("invalid typehook return value: %j",r));return r}if("string"==typeof t){if(t=Z(t,e.namespace),r=e.registry[t])return r;if(q(t))return e.registry[t]=g({type:t},e);throw new Error(c("undefined type name: %s",t))}if(t.logicalType&&e.logicalTypes&&!_){var n=e.logicalTypes[t.logicalType];if(n){var i=e.namespace,o={};Object.keys(e.registry).forEach(function(t){o[t]=e.registry[t]});try{return new n(t,e)}catch(r){if(e.assertLogicalTypes)throw r;_=null,e.namespace=i,e.registry=o}}}return r=Array.isArray(t)?new(e.wrapUnions?O:L)(t,e):function(r){var n=f[r];if(void 0===n)throw new Error(c("unknown type: %j",r));return new n(t,e)}(t.type)}function v(t,e){var r=_||this;if(_=null,this._hs=void 0,this._name=void 0,this._aliases=void 0,t){var n=t.name,i=void 0===t.namespace?e&&e.namespace:t.namespace;if(void 0!==n){if(q(n=Z(n,i)))throw new Error(c("cannot rename primitive type: %j",n));var o=e&&e.registry;if(o){if(void 0!==o[n])throw new Error(c("duplicate type name: %s",n));o[n]=r}}else if(e&&e.noAnonymousTypes)throw new Error(c("missing name property in schema: %j",t));this._name=n,this._aliases=t.aliases?t.aliases.map(function(t){return Z(t,i)}):[]}}function m(){v.call(this)}function w(){m.call(this)}function b(){m.call(this)}function k(){m.call(this)}function E(){m.call(this)}function x(){m.call(this)}function T(){m.call(this)}function S(){m.call(this)}function A(){m.call(this)}function R(t,e){if(v.call(this),!Array.isArray(t))throw new Error(c("non-array union schema: %j",t));if(!t.length)throw new Error("empty union");this._types=t.map(function(t){return g(t,e)}),this._branchIndices={},this._types.forEach(function(t,e){if(v.isType(t,"union"))throw new Error("unions cannot be directly nested");var r=t.getName(!0);if(void 0!==this._branchIndices[r])throw new Error(c("duplicate union branch name: %j",r));this._branchIndices[r]=e},this)}function L(t,e){R.call(this,t,e),this._logicalBranches=null,this._bucketIndices={},this._types.forEach(function(t,e){if(v.isType(t,"logical"))this._logicalBranches||(this._logicalBranches=[]),this._logicalBranches.push({index:e,type:t});else{var r=$(t);if(void 0!==this._bucketIndices[r])throw new Error(c("ambiguous unwrapped union: %j",this));this._bucketIndices[r]=e}},this)}function O(t,e){R.call(this,t,e),this._constructors=this._types.map(function(t){var e=t.getName(!0);if("null"===e)return null;var r,n=(r=e,function(t){this["".concat(r)]=t});return n.getBranchType=function(){return t},n})}function B(t,e){if(v.call(this,t,e),!Array.isArray(t.symbols)||!t.symbols.length)throw new Error(c("invalid enum symbols: %j",t.symbols));this._symbols=t.symbols,this._indices={},this._symbols.forEach(function(t,e){if(!K(t))throw new Error(c("invalid %s symbol: %j",this,t));if(void 0!==this._indices[t])throw new Error(c("duplicate %s symbol: %j",this,t));this._indices[t]=e},this)}function N(t,e){if(v.call(this,t,e),t.size!==(0|t.size)||t.size<1)throw new Error(c("invalid %s fixed size",this.getName(!0)));this._size=0|t.size}function I(t,e){if(v.call(this),!t.values)throw new Error(c("missing map values: %j",t));this._values=g(t.values,e);var r=t.keys;r||(r="string"),this._keys=g(r,e)}function z(t,e){if(v.call(this),!t.items)throw new Error(c("missing array items: %j",t));this._items=g(t.items,e)}function M(t,e){var r=(e=e||{}).namespace;if(void 0!==t.namespace)e.namespace=t.namespace;else if(t.name){var n=/^(.*)\.[^.]+$/.exec(t.name);n&&(e.namespace=n[1])}if(v.call(this,t,e),!Array.isArray(t.fields))throw new Error(c("non-array record fields: %j",t.fields));if(s.hasDuplicates(t.fields,function(t){return t.name}))throw new Error(c("duplicate field name: %j",t.fields));this._fieldsMap={},this._fields=t.fields.map(function(t){var r=new F(t,e);return this._fieldsMap[r.getName()]=r},this),this._isError="error"===t.type,this._constructor=this._createConstructor(),this._read=this._createReader(),this._skip=this._createSkipper(),this._write=this._createWriter(),this._check=this._createChecker(),e.namespace=r}function D(t,e){this._logicalTypeName=t.logicalType,v.call(this),(_=this)._underlyingType=g(t,e)}function j(t){E.call(this),this._noUnpack=!!t}function F(t,e){var r=t.name;if("string"!=typeof r||!K(r))throw new Error(c("invalid field name: %s",r));this._name=r,this._type=g(t.type,e),this._aliases=t.aliases||[],this._order=function(t){switch(t){case"ascending":return 1;case"descending":return-1;case"ignore":return 0;default:throw new Error(c("invalid order: %j",t))}}(void 0===t.order?"ascending":t.order);var n=t.default;if(void 0!==n){var i=this._type,o=i._copy(n,{coerce:2,wrap:2});q(i.getTypeName())&&"bytes"!==i.getTypeName()?this.getDefault=function(){return o}:this.getDefault=function(){return i._copy(o)}}}function P(t){this._readerType=t,this._items=null,this._read=null,this._size=0,this._symbols=null,this._values=null}function U(t,e,r,n){if(r){if(r._readerType!==t)throw new Error("invalid resolver");return r._read(e,n)}return t._read(e)}function C(t){var e=t.split(".");return e[e.length-1]}function Z(t,e){~t.indexOf(".")?t=t.replace(/^\./,""):e&&(t=e+"."+t),t.split(".").forEach(function(e){if(!K(e))throw new Error(c("invalid name: %j",t))});var r=C(t);return q(r)?r:t}function H(t){var e=[];t._name&&e.push(t._name);var r,n,i=t._aliases;for(r=0,n=i.length;r<n;r++)e.push(i[r]);return e}function q(t){var e=f[t];return e&&e.prototype instanceof m}function W(t){if("error"===t)t="record";else{var e=/^([^:]+):(.*)$/.exec(t);e&&(t="union"===e[1]?e[2]+"Union":e[1])}return s.capitalize(t)+"Type"}function V(t){var e=t.readLong();return e<0&&(e=-e,t.skipLong()),e}function Y(t,e){y=e&&e.exportAttrs;var r,n=e&&e.noDeref;return r={},JSON.stringify(t,function(t,e){if(e){if("object"==o(e)&&e.hasOwnProperty("default")&&!e.hasOwnProperty("logicalType"))return y?{name:e.name,type:e.type,default:e.default,order:"ascending"!==e.order?e.order:void 0,aliases:e.aliases.length?e.aliases:void 0}:{name:e.name,type:e.type};if(e.aliases){var i=e.name;if(i){if(n||r[i])return i;r[i]=!0}y&&e.aliases.length||(e.aliases=void 0)}}return e})}function J(t){return-9007199254740990<=t&&t<=9007199254740990}function G(t){return t&&"Buffer"===t.type&&Array.isArray(t.data)}function K(t){return l.test(t)}function X(t,e){throw new Error(c("invalid %s: %j",e,t))}function $(t){var e=t.getTypeName();switch(e){case"double":case"float":case"int":case"long":return"number";case"bytes":case"fixed":return"buffer";case"enum":return"string";case"map":case"error":case"record":return"object";default:return e}}function Q(t){if(null===t)return"null";var r=o(t);if("object"===r){if(Array.isArray(t))return"array";if(e.isBuffer(t))return"buffer"}return r}v.isType=function(){var t=arguments.length;if(!t)return!1;var e=arguments[0];if(!e||"function"!=typeof e._update||"function"!=typeof e.getTypeName)return!1;if(1===t)return!0;var r,n=e.getTypeName();for(r=1;r<t;r++)if(0===n.indexOf(arguments[r]))return!0;return!1},v.__reset=function(t){d.buf=new a.SlowBuffer(t)},v.prototype.createResolver=function(t,e){if(!v.isType(t))throw new Error(c("not a type: %j",t));if(!v.isType(this,"logical")&&v.isType(t,"logical"))return this.createResolver(t._un