UNPKG

bleakjsfirst

Version:

password check library-js

10 lines 183 kB
(function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?this:self:global:window,t.bleak=e()}})(function(){var e=Math.sqrt,t=Math.exp,o=Math.expm1,r=Math.ceil,n=Math.max,s=Math.min,a=String.fromCharCode,l=Math.floor,f=Math.LN2,_=Math.log,g=Math.abs,u=Math.pow,p;return function(){function s(l,e,r){function t(d,n){if(!e[d]){if(!l[d]){var i="function"==typeof require&&require;if(!n&&i)return i(d,!0);if(o)return o(d,!0);var f=new Error("Cannot find module '"+d+"'");throw f.code="MODULE_NOT_FOUND",f}var a=e[d]={exports:{}};l[d][0].call(a.exports,function(e){var o=l[d][1][e];return t(o||e)},a,a.exports,s,l,e,r)}return e[d].exports}for(var o="function"==typeof require&&require,n=0;n<r.length;n++)t(r[n]);return t}return s}()({1:[function(e){(function(t){"use strict";e("core-js/es6"),e("core-js/fn/array/includes"),e("core-js/fn/string/pad-start"),e("core-js/fn/string/pad-end"),e("core-js/fn/symbol/async-iterator"),e("core-js/fn/object/get-own-property-descriptors"),e("core-js/fn/object/values"),e("core-js/fn/object/entries"),e("core-js/fn/promise/finally"),e("core-js/web"),e("regenerator-runtime/runtime"),t._babelPolyfill&&"undefined"!=typeof console&&console.warn&&console.warn("@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended and may have consequences if different versions of the polyfills are applied sequentially. If you do need to load the polyfill more than once, use @babel/polyfill/noConflict instead to bypass the warning."),t._babelPolyfill=!0}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{"core-js/es6":4,"core-js/fn/array/includes":5,"core-js/fn/object/entries":6,"core-js/fn/object/get-own-property-descriptors":7,"core-js/fn/object/values":8,"core-js/fn/promise/finally":9,"core-js/fn/string/pad-end":10,"core-js/fn/string/pad-start":11,"core-js/fn/symbol/async-iterator":12,"core-js/web":277,"regenerator-runtime/runtime":279}],2:[function(e,t){/** * @license bytebuffer.js (c) 2015 Daniel Wirtz <dcode@dcode.io> * Backing buffer: ArrayBuffer, Accessor: Uint8Array * Released under the Apache License, Version 2.0 * see: https://github.com/dcodeIO/bytebuffer.js for details */(function(o,r){"function"==typeof p&&p.amd?p(["long"],r):"function"==typeof e&&"object"==typeof t&&t&&t.exports?t.exports=function(){var t;try{t=e("long")}catch(t){}return r(t)}():(o.dcodeIO=o.dcodeIO||{}).ByteBuffer=r(o.dcodeIO.Long)})(this,function(e){"use strict";function t(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function o(){var e=[],t=[];return function(){return 0===arguments.length?t.join("")+p.apply(String,e):void(1024<e.length+arguments.length&&(t.push(p.apply(String,e)),e.length=0),Array.prototype.push.apply(e,arguments))}}function r(t,o,r,n,a){var l=8*a-n-1,f=(1<<l)-1,_=f>>1,g=-7,c=r?a-1:0,p=r?-1:1,d=t[o+c],b,h;for(c+=p,b=d&(1<<-g)-1,d>>=-g,g+=l;0<g;b=256*b+t[o+c],c+=p,g-=8);for(h=b&(1<<-g)-1,b>>=-g,g+=n;0<g;h=256*h+t[o+c],c+=p,g-=8);if(0===b)b=1-_;else{if(b===f)return h?NaN:(d?-1:1)*(1/0);h+=u(2,n),b-=_}return(d?-1:1)*h*u(2,b-n)}function n(t,o,r,n,a,p){var b=8*p-a-1,h=(1<<b)-1,y=h>>1,x=23===a?u(2,-24)-u(2,-77):0,w=n?0:p-1,v=n?1:-1,d=0>o||0===o&&0>1/o?1:0,s,j,I;for(o=g(o),isNaN(o)||o===1/0?(j=isNaN(o)?1:0,s=h):(s=l(_(o)/f),1>o*(I=u(2,-s))&&(s--,I*=2),o+=1<=s+y?x/I:x*u(2,1-y),2<=o*I&&(s++,I/=2),s+y>=h?(j=0,s=h):1<=s+y?(j=(o*I-1)*u(2,a),s+=y):(j=o*u(2,y-1)*u(2,a),s=0));8<=a;t[r+w]=255&j,w+=v,j/=256,a-=8);for(s=s<<a|j,b+=a;0<b;t[r+w]=255&s,w+=v,s/=256,b-=8);t[r+w-v]|=128*d}var s=function(e,t,o){if("undefined"==typeof e&&(e=s.DEFAULT_CAPACITY),"undefined"==typeof t&&(t=s.DEFAULT_ENDIAN),"undefined"==typeof o&&(o=s.DEFAULT_NOASSERT),!o){if(e|=0,0>e)throw RangeError("Illegal capacity");t=!!t,o=!!o}this.buffer=0===e?c:new ArrayBuffer(e),this.view=0===e?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=e,this.littleEndian=t,this.noAssert=o};s.VERSION="5.0.1",s.LITTLE_ENDIAN=!0,s.BIG_ENDIAN=!1,s.DEFAULT_CAPACITY=16,s.DEFAULT_ENDIAN=s.BIG_ENDIAN,s.DEFAULT_NOASSERT=!1,s.Long=e||null;var d=s.prototype;d.__isByteBuffer__,Object.defineProperty(d,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var c=new ArrayBuffer(0),p=a;s.accessor=function(){return Uint8Array},s.allocate=function(e,t,o){return new s(e,t,o)},s.concat=function(e,t,o,r){("boolean"==typeof t||"string"!=typeof t)&&(r=o,o=t,t=void 0);for(var n=0,a=0,l=e.length,d;a<l;++a)s.isByteBuffer(e[a])||(e[a]=s.wrap(e[a],t)),d=e[a].limit-e[a].offset,0<d&&(n+=d);if(0===n)return new s(0,o,r);var f=new s(n,o,r),_;for(a=0;a<l;)_=e[a++],d=_.limit-_.offset,0>=d||(f.view.set(_.view.subarray(_.offset,_.limit),f.offset),f.offset+=d);return f.limit=f.offset,f.offset=0,f},s.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},s.type=function(){return ArrayBuffer},s.wrap=function(e,t,o,r){if("string"!=typeof t&&(r=o,o=t,t=void 0),"string"==typeof e)switch("undefined"==typeof t&&(t="utf8"),t){case"base64":return s.fromBase64(e,o);case"hex":return s.fromHex(e,o);case"binary":return s.fromBinary(e,o);case"utf8":return s.fromUTF8(e,o);case"debug":return s.fromDebug(e,o);default:throw Error("Unsupported encoding: "+t);}if(null===e||"object"!=typeof e)throw TypeError("Illegal buffer");var n;if(s.isByteBuffer(e))return n=d.clone.call(e),n.markedOffset=-1,n;if(e instanceof Uint8Array)n=new s(0,o,r),0<e.length&&(n.buffer=e.buffer,n.offset=e.byteOffset,n.limit=e.byteOffset+e.byteLength,n.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)n=new s(0,o,r),0<e.byteLength&&(n.buffer=e,n.offset=0,n.limit=e.byteLength,n.view=0<e.byteLength?new Uint8Array(e):null);else if("[object Array]"===Object.prototype.toString.call(e)){n=new s(e.length,o,r),n.limit=e.length;for(var a=0;a<e.length;++a)n.view[a]=e[a]}else throw TypeError("Illegal buffer");return n},d.writeBitSet=function(e,t){var o="undefined"==typeof t;if(o&&(t=this.offset),!this.noAssert){if(!(e instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+0+") <= "+this.buffer.byteLength)}var r=t,n=e.length,s=n>>3,i=0,a;for(t+=this.writeVarint32(n,t);s--;)a=1&!!e[i++]|(1&!!e[i++])<<1|(1&!!e[i++])<<2|(1&!!e[i++])<<3|(1&!!e[i++])<<4|(1&!!e[i++])<<5|(1&!!e[i++])<<6|(1&!!e[i++])<<7,this.writeByte(a,t++);if(i<n){var l=0;for(a=0;i<n;)a|=(1&!!e[i++])<<l++;this.writeByte(a,t++)}return o?(this.offset=t,this):t-r},d.readBitSet=function(e){var t="undefined"==typeof e;t&&(e=this.offset);var o=this.readVarint32(e),r=o.value,n=r>>3,s=0,i=[],a;for(e+=o.length;n--;)a=this.readByte(e++),i[s++]=!!(1&a),i[s++]=!!(2&a),i[s++]=!!(4&a),i[s++]=!!(8&a),i[s++]=!!(16&a),i[s++]=!!(32&a),i[s++]=!!(64&a),i[s++]=!!(128&a);if(s<r){var l=0;for(a=this.readByte(e++);s<r;)i[s++]=!!(1&a>>l++)}return t&&(this.offset=e),i},d.readBytes=function(e,t){var o="undefined"==typeof t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+e+") <= "+this.buffer.byteLength)}var r=this.slice(t,t+e);return o&&(this.offset+=e),r},d.writeBytes=d.append,d.writeInt8=function(e,t){var o="undefined"==typeof t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+0+") <= "+this.buffer.byteLength)}t+=1;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=1,this.view[t]=e,o&&(this.offset+=1),this},d.writeByte=d.writeInt8,d.readInt8=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+1+") <= "+this.buffer.byteLength)}var o=this.view[e];return 128==(128&o)&&(o=-(255-o+1)),t&&(this.offset+=1),o},d.readByte=d.readInt8,d.writeUint8=function(e,t){var o="undefined"==typeof t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+0+") <= "+this.buffer.byteLength)}t+=1;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=1,this.view[t]=e,o&&(this.offset+=1),this},d.writeUInt8=d.writeUint8,d.readUint8=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+1+") <= "+this.buffer.byteLength)}var o=this.view[e];return t&&(this.offset+=1),o},d.readUInt8=d.readUint8,d.writeInt16=function(e,t){var o="undefined"==typeof t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+0+") <= "+this.buffer.byteLength)}t+=2;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),o&&(this.offset+=2),this},d.writeShort=d.writeInt16,d.readInt16=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+2+") <= "+this.buffer.byteLength)}var o=0;return this.littleEndian?(o=this.view[e],o|=this.view[e+1]<<8):(o=this.view[e]<<8,o|=this.view[e+1]),32768==(32768&o)&&(o=-(65535-o+1)),t&&(this.offset+=2),o},d.readShort=d.readInt16,d.writeUint16=function(e,t){var o="undefined"==typeof t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+0+") <= "+this.buffer.byteLength)}t+=2;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),o&&(this.offset+=2),this},d.writeUInt16=d.writeUint16,d.readUint16=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+2+") <= "+this.buffer.byteLength)}var o=0;return this.littleEndian?(o=this.view[e],o|=this.view[e+1]<<8):(o=this.view[e]<<8,o|=this.view[e+1]),t&&(this.offset+=2),o},d.readUInt16=d.readUint16,d.writeInt32=function(e,t){var o="undefined"==typeof t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+0+") <= "+this.buffer.byteLength)}t+=4;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=4,this.littleEndian?(this.view[t+3]=255&e>>>24,this.view[t+2]=255&e>>>16,this.view[t+1]=255&e>>>8,this.view[t]=255&e):(this.view[t]=255&e>>>24,this.view[t+1]=255&e>>>16,this.view[t+2]=255&e>>>8,this.view[t+3]=255&e),o&&(this.offset+=4),this},d.writeInt=d.writeInt32,d.readInt32=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+4+") <= "+this.buffer.byteLength)}var o=0;return this.littleEndian?(o=this.view[e+2]<<16,o|=this.view[e+1]<<8,o|=this.view[e],o+=this.view[e+3]<<24>>>0):(o=this.view[e+1]<<16,o|=this.view[e+2]<<8,o|=this.view[e+3],o+=this.view[e]<<24>>>0),o|=0,t&&(this.offset+=4),o},d.readInt=d.readInt32,d.writeUint32=function(e,t){var o="undefined"==typeof t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+0+") <= "+this.buffer.byteLength)}t+=4;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=4,this.littleEndian?(this.view[t+3]=255&e>>>24,this.view[t+2]=255&e>>>16,this.view[t+1]=255&e>>>8,this.view[t]=255&e):(this.view[t]=255&e>>>24,this.view[t+1]=255&e>>>16,this.view[t+2]=255&e>>>8,this.view[t+3]=255&e),o&&(this.offset+=4),this},d.writeUInt32=d.writeUint32,d.readUint32=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+4+") <= "+this.buffer.byteLength)}var o=0;return this.littleEndian?(o=this.view[e+2]<<16,o|=this.view[e+1]<<8,o|=this.view[e],o+=this.view[e+3]<<24>>>0):(o=this.view[e+1]<<16,o|=this.view[e+2]<<8,o|=this.view[e+3],o+=this.view[e]<<24>>>0),t&&(this.offset+=4),o},d.readUInt32=d.readUint32,e&&(d.writeInt64=function(t,o){var r="undefined"==typeof o;if(r&&(o=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof o||0!=o%1)throw TypeError("Illegal offset: "+o+" (not an integer)");if(o>>>=0,0>o||o+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+o+" (+"+0+") <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),o+=8;var n=this.buffer.byteLength;o>n&&this.resize((n*=2)>o?n:o),o-=8;var s=t.low,i=t.high;return this.littleEndian?(this.view[o+3]=255&s>>>24,this.view[o+2]=255&s>>>16,this.view[o+1]=255&s>>>8,this.view[o]=255&s,o+=4,this.view[o+3]=255&i>>>24,this.view[o+2]=255&i>>>16,this.view[o+1]=255&i>>>8,this.view[o]=255&i):(this.view[o]=255&i>>>24,this.view[o+1]=255&i>>>16,this.view[o+2]=255&i>>>8,this.view[o+3]=255&i,o+=4,this.view[o]=255&s>>>24,this.view[o+1]=255&s>>>16,this.view[o+2]=255&s>>>8,this.view[o+3]=255&s),r&&(this.offset+=8),this},d.writeLong=d.writeInt64,d.readInt64=function(t){var o="undefined"==typeof t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+8+") <= "+this.buffer.byteLength)}var r=0,n=0;this.littleEndian?(r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0,t+=4,n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0):(n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0,t+=4,r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0);var s=new e(r,n,!1);return o&&(this.offset+=8),s},d.readLong=d.readInt64,d.writeUint64=function(t,o){var r="undefined"==typeof o;if(r&&(o=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof o||0!=o%1)throw TypeError("Illegal offset: "+o+" (not an integer)");if(o>>>=0,0>o||o+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+o+" (+"+0+") <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),o+=8;var n=this.buffer.byteLength;o>n&&this.resize((n*=2)>o?n:o),o-=8;var s=t.low,i=t.high;return this.littleEndian?(this.view[o+3]=255&s>>>24,this.view[o+2]=255&s>>>16,this.view[o+1]=255&s>>>8,this.view[o]=255&s,o+=4,this.view[o+3]=255&i>>>24,this.view[o+2]=255&i>>>16,this.view[o+1]=255&i>>>8,this.view[o]=255&i):(this.view[o]=255&i>>>24,this.view[o+1]=255&i>>>16,this.view[o+2]=255&i>>>8,this.view[o+3]=255&i,o+=4,this.view[o]=255&s>>>24,this.view[o+1]=255&s>>>16,this.view[o+2]=255&s>>>8,this.view[o+3]=255&s),r&&(this.offset+=8),this},d.writeUInt64=d.writeUint64,d.readUint64=function(t){var o="undefined"==typeof t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+8+") <= "+this.buffer.byteLength)}var r=0,n=0;this.littleEndian?(r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0,t+=4,n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0):(n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0,t+=4,r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0);var s=new e(r,n,!0);return o&&(this.offset+=8),s},d.readUInt64=d.readUint64),d.writeFloat32=function(e,t){var o="undefined"==typeof t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+0+") <= "+this.buffer.byteLength)}t+=4;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=4,n(this.view,e,t,this.littleEndian,23,4),o&&(this.offset+=4),this},d.writeFloat=d.writeFloat32,d.readFloat32=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+4+") <= "+this.buffer.byteLength)}var o=r(this.view,e,this.littleEndian,23,4);return t&&(this.offset+=4),o},d.readFloat=d.readFloat32,d.writeFloat64=function(e,t){var o="undefined"==typeof t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+0+") <= "+this.buffer.byteLength)}t+=8;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=8,n(this.view,e,t,this.littleEndian,52,8),o&&(this.offset+=8),this},d.writeDouble=d.writeFloat64,d.readFloat64=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+8+") <= "+this.buffer.byteLength)}var o=r(this.view,e,this.littleEndian,52,8);return t&&(this.offset+=8),o},d.readDouble=d.readFloat64,s.MAX_VARINT32_BYTES=5,s.calculateVarint32=function(e){return e>>>=0,128>e?1:16384>e?2:2097152>e?3:268435456>e?4:5},s.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},s.zigZagDecode32=function(e){return 0|e>>>1^-(1&e)},d.writeVarint32=function(e,t){var o="undefined"==typeof t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+0+") <= "+this.buffer.byteLength)}var r=s.calculateVarint32(e),n;t+=r;var i=this.buffer.byteLength;for(t>i&&this.resize((i*=2)>t?i:t),t-=r,e>>>=0;128<=e;)n=128|127&e,this.view[t++]=n,e>>>=7;return this.view[t++]=e,o?(this.offset=t,this):r},d.writeVarint32ZigZag=function(e,t){return this.writeVarint32(s.zigZagEncode32(e),t)},d.readVarint32=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+1+") <= "+this.buffer.byteLength)}var o=0,r=0,n;do{if(!this.noAssert&&e>this.limit){var s=Error("Truncated");throw s.truncated=!0,s}n=this.view[e++],5>o&&(r|=(127&n)<<7*o),++o}while(0!=(128&n));return r|=0,t?(this.offset=e,r):{value:r,length:o}},d.readVarint32ZigZag=function(e){var t=this.readVarint32(e);return"object"==typeof t?t.value=s.zigZagDecode32(t.value):t=s.zigZagDecode32(t),t},e&&(s.MAX_VARINT64_BYTES=10,s.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var o=t.toInt()>>>0,r=t.shiftRightUnsigned(28).toInt()>>>0,n=t.shiftRightUnsigned(56).toInt()>>>0;return 0==n?0==r?16384>o?128>o?1:2:2097152>o?3:4:16384>r?128>r?5:6:2097152>r?7:8:128>n?9:10},s.zigZagEncode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()},s.zigZagDecode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()},d.writeVarint64=function(t,o){var r="undefined"==typeof o;if(r&&(o=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof o||0!=o%1)throw TypeError("Illegal offset: "+o+" (not an integer)");if(o>>>=0,0>o||o+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+o+" (+"+0+") <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned());var n=s.calculateVarint64(t),i=t.toInt()>>>0,a=t.shiftRightUnsigned(28).toInt()>>>0,l=t.shiftRightUnsigned(56).toInt()>>>0;o+=n;var d=this.buffer.byteLength;switch(o>d&&this.resize((d*=2)>o?d:o),o-=n,n){case 10:this.view[o+9]=1&l>>>7;case 9:this.view[o+8]=9===n?127&l:128|l;case 8:this.view[o+7]=8===n?127&a>>>21:128|a>>>21;case 7:this.view[o+6]=7===n?127&a>>>14:128|a>>>14;case 6:this.view[o+5]=6===n?127&a>>>7:128|a>>>7;case 5:this.view[o+4]=5===n?127&a:128|a;case 4:this.view[o+3]=4===n?127&i>>>21:128|i>>>21;case 3:this.view[o+2]=3===n?127&i>>>14:128|i>>>14;case 2:this.view[o+1]=2===n?127&i>>>7:128|i>>>7;case 1:this.view[o]=1===n?127&i:128|i;}return r?(this.offset+=n,this):n},d.writeVarint64ZigZag=function(e,t){return this.writeVarint64(s.zigZagEncode64(e),t)},d.readVarint64=function(t){var o="undefined"==typeof t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+1+") <= "+this.buffer.byteLength)}var r=t,n=0,s=0,i=0,a=0;if(a=this.view[t++],n=127&a,128&a&&(a=this.view[t++],n|=(127&a)<<7,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],n|=(127&a)<<14,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],n|=(127&a)<<21,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],s=127&a,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],s|=(127&a)<<7,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],s|=(127&a)<<14,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],s|=(127&a)<<21,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],i=127&a,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],i|=(127&a)<<7,128&a||this.noAssert&&"undefined"==typeof a))))))))))throw Error("Buffer overrun");var l=e.fromBits(n|s<<28,s>>>4|i<<24,!1);return o?(this.offset=t,l):{value:l,length:t-r}},d.readVarint64ZigZag=function(t){var o=this.readVarint64(t);return o&&o.value instanceof e?o.value=s.zigZagDecode64(o.value):o=s.zigZagDecode64(o),o}),d.writeCString=function(e,o){var r="undefined"==typeof o;r&&(o=this.offset);var n=e.length,s;if(!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(s=0;s<n;++s)if(0===e.charCodeAt(s))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof o||0!=o%1)throw TypeError("Illegal offset: "+o+" (not an integer)");if(o>>>=0,0>o||o+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+o+" (+"+0+") <= "+this.buffer.byteLength)}n=m.calculateUTF16asUTF8(t(e))[1],o+=n+1;var a=this.buffer.byteLength;return o>a&&this.resize((a*=2)>o?a:o),o-=n+1,m.encodeUTF16toUTF8(t(e),function(e){this.view[o++]=e}.bind(this)),this.view[o++]=0,r?(this.offset=o,this):n},d.readCString=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+1+") <= "+this.buffer.byteLength)}var r=e,n=-1,s;return m.decodeUTF8toUTF16(function(){if(0===n)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return n=this.view[e++],0===n?null:n}.bind(this),s=o(),!0),t?(this.offset=e,s()):{string:s(),length:e-r}},d.writeIString=function(e,o){var r="undefined"==typeof o;if(r&&(o=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof o||0!=o%1)throw TypeError("Illegal offset: "+o+" (not an integer)");if(o>>>=0,0>o||o+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+o+" (+"+0+") <= "+this.buffer.byteLength)}var n=o,s;s=m.calculateUTF16asUTF8(t(e),this.noAssert)[1],o+=4+s;var i=this.buffer.byteLength;if(o>i&&this.resize((i*=2)>o?i:o),o-=4+s,this.littleEndian?(this.view[o+3]=255&s>>>24,this.view[o+2]=255&s>>>16,this.view[o+1]=255&s>>>8,this.view[o]=255&s):(this.view[o]=255&s>>>24,this.view[o+1]=255&s>>>16,this.view[o+2]=255&s>>>8,this.view[o+3]=255&s),o+=4,m.encodeUTF16toUTF8(t(e),function(e){this.view[o++]=e}.bind(this)),o!==n+4+s)throw RangeError("Illegal range: Truncated data, "+o+" == "+(o+4+s));return r?(this.offset=o,this):o-n},d.readIString=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+4+") <= "+this.buffer.byteLength)}var o=e,r=this.readUint32(e),n=this.readUTF8String(r,s.METRICS_BYTES,e+=4);return e+=n.length,t?(this.offset=e,n.string):{string:n.string,length:e-o}},s.METRICS_CHARS="c",s.METRICS_BYTES="b",d.writeUTF8String=function(e,o){var r="undefined"==typeof o;if(r&&(o=this.offset),!this.noAssert){if("number"!=typeof o||0!=o%1)throw TypeError("Illegal offset: "+o+" (not an integer)");if(o>>>=0,0>o||o+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+o+" (+"+0+") <= "+this.buffer.byteLength)}var n=o,s;s=m.calculateUTF16asUTF8(t(e))[1],o+=s;var i=this.buffer.byteLength;return o>i&&this.resize((i*=2)>o?i:o),o-=s,m.encodeUTF16toUTF8(t(e),function(e){this.view[o++]=e}.bind(this)),r?(this.offset=o,this):o-n},d.writeString=d.writeUTF8String,s.calculateUTF8Chars=function(e){return m.calculateUTF16asUTF8(t(e))[0]},s.calculateUTF8Bytes=function(e){return m.calculateUTF16asUTF8(t(e))[1]},s.calculateString=s.calculateUTF8Bytes,d.readUTF8String=function(e,t,r){"number"==typeof t&&(r=t,t=void 0);var n="undefined"==typeof r;if(n&&(r=this.offset),"undefined"==typeof t&&(t=s.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof r||0!=r%1)throw TypeError("Illegal offset: "+r+" (not an integer)");if(r>>>=0,0>r||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+0+") <= "+this.buffer.byteLength)}var a=0,l=r,d;if(t===s.METRICS_CHARS){if(d=o(),m.decodeUTF8(function(){return a<e&&r<this.limit?this.view[r++]:null}.bind(this),function(e){++a,m.UTF8toUTF16(e,d)}),a!==e)throw RangeError("Illegal range: Truncated data, "+a+" == "+e);return n?(this.offset=r,d()):{string:d(),length:r-l}}if(t===s.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof r||0!=r%1)throw TypeError("Illegal offset: "+r+" (not an integer)");if(r>>>=0,0>r||r+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+e+") <= "+this.buffer.byteLength)}var f=r+e;if(m.decodeUTF8toUTF16(function(){return r<f?this.view[r++]:null}.bind(this),d=o(),this.noAssert),r!==f)throw RangeError("Illegal range: Truncated data, "+r+" == "+f);return n?(this.offset=r,d()):{string:d(),length:r-l}}throw TypeError("Unsupported metrics: "+t)},d.readString=d.readUTF8String,d.writeVString=function(e,o){var r="undefined"==typeof o;if(r&&(o=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof o||0!=o%1)throw TypeError("Illegal offset: "+o+" (not an integer)");if(o>>>=0,0>o||o+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+o+" (+"+0+") <= "+this.buffer.byteLength)}var n=o,i,a;i=m.calculateUTF16asUTF8(t(e),this.noAssert)[1],a=s.calculateVarint32(i),o+=a+i;var d=this.buffer.byteLength;if(o>d&&this.resize((d*=2)>o?d:o),o-=a+i,o+=this.writeVarint32(i,o),m.encodeUTF16toUTF8(t(e),function(e){this.view[o++]=e}.bind(this)),o!==n+i+a)throw RangeError("Illegal range: Truncated data, "+o+" == "+(o+i+a));return r?(this.offset=o,this):o-n},d.readVString=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+1+") <= "+this.buffer.byteLength)}var o=e,r=this.readVarint32(e),n=this.readUTF8String(r.value,s.METRICS_BYTES,e+=r.length);return e+=n.length,t?(this.offset=e,n.string):{string:n.string,length:e-o}},d.append=function(e,t,o){("number"==typeof t||"string"!=typeof t)&&(o=t,t=void 0);var r="undefined"==typeof o;if(r&&(o=this.offset),!this.noAssert){if("number"!=typeof o||0!=o%1)throw TypeError("Illegal offset: "+o+" (not an integer)");if(o>>>=0,0>o||o+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+o+" (+"+0+") <= "+this.buffer.byteLength)}e instanceof s||(e=s.wrap(e,t));var n=e.limit-e.offset;if(0>=n)return this;o+=n;var i=this.buffer.byteLength;return o>i&&this.resize((i*=2)>o?i:o),o-=n,this.view.set(e.view.subarray(e.offset,e.limit),o),e.offset+=n,r&&(this.offset+=n),this},d.appendTo=function(e,t){return e.append(this,t),this},d.assert=function(e){return this.noAssert=!e,this},d.capacity=function(){return this.buffer.byteLength},d.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},d.clone=function(e){var t=new s(0,this.littleEndian,this.noAssert);return e?(t.buffer=new ArrayBuffer(this.buffer.byteLength),t.view=new Uint8Array(t.buffer)):(t.buffer=this.buffer,t.view=this.view),t.offset=this.offset,t.markedOffset=this.markedOffset,t.limit=this.limit,t},d.compact=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||0!=t%1)throw TypeError("Illegal end: Not an integer");if(t>>>=0,0>e||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(0===e&&t===this.buffer.byteLength)return this;var o=t-e;if(0==o)return this.buffer=c,this.view=null,0<=this.markedOffset&&(this.markedOffset-=e),this.offset=0,this.limit=0,this;var r=new ArrayBuffer(o),n=new Uint8Array(r);return n.set(this.view.subarray(e,t)),this.buffer=r,this.view=n,0<=this.markedOffset&&(this.markedOffset-=e),this.offset=0,this.limit=o,this},d.copy=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||0!=t%1)throw TypeError("Illegal end: Not an integer");if(t>>>=0,0>e||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(e===t)return new s(0,this.littleEndian,this.noAssert);var o=t-e,r=new s(o,this.littleEndian,this.noAssert);return r.offset=0,r.limit=o,0<=r.markedOffset&&(r.markedOffset-=e),this.copyTo(r,0,e,t),r},d.copyTo=function(e,t,o,r){var n,i;if(!this.noAssert&&!s.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(t=(i="undefined"==typeof t)?e.offset:0|t,o=(n="undefined"==typeof o)?this.offset:0|o,r="undefined"==typeof r?this.limit:0|r,0>t||t>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+t+" <= "+e.buffer.byteLength);if(0>o||r>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+o+" <= "+this.buffer.byteLength);var a=r-o;return 0==a?e:(e.ensureCapacity(t+a),e.view.set(this.view.subarray(o,r),t),n&&(this.offset+=a),i&&(e.offset+=a),this)},d.ensureCapacity=function(e){var t=this.buffer.byteLength;return t<e?this.resize((t*=2)>e?t:e):this},d.fill=function(e,t,o){var r="undefined"==typeof t;if(r&&(t=this.offset),"string"==typeof e&&0<e.length&&(e=e.charCodeAt(0)),"undefined"==typeof t&&(t=this.offset),"undefined"==typeof o&&(o=this.limit),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||0!=t%1)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof o||0!=o%1)throw TypeError("Illegal end: Not an integer");if(o>>>=0,0>t||t>o||o>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+o+" <= "+this.buffer.byteLength)}if(t>=o)return this;for(;t<o;)this.view[t++]=e;return r&&(this.offset=t),this},d.flip=function(){return this.limit=this.offset,this.offset=0,this},d.mark=function(e){if(e="undefined"==typeof e?this.offset:e,!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+0+") <= "+this.buffer.byteLength)}return this.markedOffset=e,this},d.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},d.LE=function(e){return this.littleEndian="undefined"==typeof e||!!e,this},d.BE=function(e){return this.littleEndian="undefined"!=typeof e&&!e,this},d.prepend=function(e,t,o){("number"==typeof t||"string"!=typeof t)&&(o=t,t=void 0);var r="undefined"==typeof o;if(r&&(o=this.offset),!this.noAssert){if("number"!=typeof o||0!=o%1)throw TypeError("Illegal offset: "+o+" (not an integer)");if(o>>>=0,0>o||o+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+o+" (+"+0+") <= "+this.buffer.byteLength)}e instanceof s||(e=s.wrap(e,t));var n=e.limit-e.offset;if(0>=n)return this;var i=n-o;if(0<i){var a=new ArrayBuffer(this.buffer.byteLength+i),l=new Uint8Array(a);l.set(this.view.subarray(o,this.buffer.byteLength),n),this.buffer=a,this.view=l,this.offset+=i,0<=this.markedOffset&&(this.markedOffset+=i),this.limit+=i,o+=i}else new Uint8Array(this.buffer);return this.view.set(e.view.subarray(e.offset,e.limit),o-n),e.offset=e.limit,r&&(this.offset-=n),this},d.prependTo=function(e,t){return e.prepend(this,t),this},d.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},d.remaining=function(){return this.limit-this.offset},d.reset=function(){return 0<=this.markedOffset?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},d.resize=function(e){if(!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal capacity: "+e+" (not an integer)");if(e|=0,0>e)throw RangeError("Illegal capacity: 0 <= "+e)}if(this.buffer.byteLength<e){var t=new ArrayBuffer(e),o=new Uint8Array(t);o.set(this.view),this.buffer=t,this.view=o}return this},d.reverse=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||0!=t%1)throw TypeError("Illegal end: Not an integer");if(t>>>=0,0>e||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return e===t?this:(Array.prototype.reverse.call(this.view.subarray(e,t)),this)},d.skip=function(e){if(!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal length: "+e+" (not an integer)");e|=0}var t=this.offset+e;if(!this.noAssert&&(0>t||t>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+e+" <= "+this.buffer.byteLength);return this.offset=t,this},d.slice=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||0!=t%1)throw TypeError("Illegal end: Not an integer");if(t>>>=0,0>e||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var o=this.clone();return o.offset=e,o.limit=t,o},d.toBuffer=function(e){var t=this.offset,o=this.limit;if(!this.noAssert){if("number"!=typeof t||0!=t%1)throw TypeError("Illegal offset: Not an integer");if(t>>>=0,"number"!=typeof o||0!=o%1)throw TypeError("Illegal limit: Not an integer");if(o>>>=0,0>t||t>o||o>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+o+" <= "+this.buffer.byteLength)}if(!e&&0===t&&o===this.buffer.byteLength)return this.buffer;if(t===o)return c;var r=new ArrayBuffer(o-t);return new Uint8Array(r).set(new Uint8Array(this.buffer).subarray(t,o),0),r},d.toArrayBuffer=d.toBuffer,d.toString=function(e,t,o){if("undefined"==typeof e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(e="utf8",t=e,o=t),e){case"utf8":return this.toUTF8(t,o);case"base64":return this.toBase64(t,o);case"hex":return this.toHex(t,o);case"binary":return this.toBinary(t,o);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e);}};var b=function(){for(var e={},o=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],r=[],n=0,t=o.length;n<t;++n)r[o[n]]=n;return e.encode=function(e,r){for(var n,s;null!==(n=e());)r(o[63&n>>2]),s=(3&n)<<4,null===(n=e())?(r(o[63&s]),r(61),r(61)):(s|=15&n>>4,r(o[63&(s|15&n>>4)]),s=(15&n)<<2,null===(n=e())?(r(o[63&s]),r(61)):(r(o[63&(s|3&n>>6)]),r(o[63&n])))},e.decode=function(e,t){function o(e){throw Error("Illegal character code: "+e)}for(var n,s,i;null!==(n=e());)if(s=r[n],"undefined"==typeof s&&o(n),null!==(n=e())&&(i=r[n],"undefined"==typeof i&&o(n),t(s<<2>>>0|(48&i)>>4),null!==(n=e()))){if(s=r[n],"undefined"==typeof s)if(61===n)break;else o(n);if(t((15&i)<<4>>>0|(60&s)>>2),null!==(n=e())){if(i=r[n],"undefined"==typeof i)if(61===n)break;else o(n);t((3&s)<<6>>>0|i)}}},e.test=function(e){return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)},e}();d.toBase64=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),e|=0,t|=0,0>e||t>this.capacity||e>t)throw RangeError("begin, end");var r;return b.encode(function(){return e<t?this.view[e++]:null}.bind(this),r=o()),r()},s.fromBase64=function(e,o){if("string"!=typeof e)throw TypeError("str");var r=new s(3*(e.length/4),o),n=0;return b.decode(t(e),function(e){r.view[n++]=e}),r.limit=n,r},s.btoa=function(e){return s.fromBinary(e).toBase64()},s.atob=function(e){return s.fromBase64(e).toBinary()},d.toBinary=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),e|=0,t|=0,0>e||t>this.capacity()||e>t)throw RangeError("begin, end");if(e===t)return"";for(var o=[],r=[];e<t;)o.push(this.view[e++]),1024<=o.length&&(r.push(a.apply(String,o)),o=[]);return r.join("")+a.apply(String,o)},s.fromBinary=function(e,t){if("string"!=typeof e)throw TypeError("str");for(var o=0,r=e.length,n=new s(r,t),a;o<r;){if(a=e.charCodeAt(o),255<a)throw RangeError("illegal char code: "+a);n.view[o++]=a}return n.limit=r,n},d.toDebug=function(e){for(var t=-1,o=this.buffer.byteLength,r="",n="",s="",l;t<o;){if(-1!==t&&(l=this.view[t],r+=16>l?"0"+l.toString(16).toUpperCase():l.toString(16).toUpperCase(),e&&(n+=32<l&&127>l?a(l):".")),++t,e&&0<t&&0==t%16&&t!==o){for(;51>r.length;)r+=" ";s+=r+n+"\n",r=n=""}r+=t===this.offset&&t===this.limit?t===this.markedOffset?"!":"|":t===this.offset?t===this.markedOffset?"[":"<":t===this.limit?t===this.markedOffset?"]":">":t===this.markedOffset?"'":e||0!==t&&t!==o?" ":""}if(e&&" "!==r){for(;51>r.length;)r+=" ";s+=r+n+"\n"}return e?s:r},s.fromDebug=function(e,t,o){for(var r=e.length,n=new s(0|(r+1)/3,t,o),a=0,l=0,d=!1,f=!1,_=!1,g=!1,c=!1,u,p;a<r;){switch(u=e.charAt(a++)){case"!":if(!o){if(f||_||g){c=!0;break}f=_=g=!0}n.offset=n.markedOffset=n.limit=l,d=!1;break;case"|":if(!o){if(f||g){c=!0;break}f=g=!0}n.offset=n.limit=l,d=!1;break;case"[":if(!o){if(f||_){c=!0;break}f=_=!0}n.offset=n.markedOffset=l,d=!1;break;case"<":if(!o){if(f){c=!0;break}f=!0}n.offset=l,d=!1;break;case"]":if(!o){if(g||_){c=!0;break}g=_=!0}n.limit=n.markedOffset=l,d=!1;break;case">":if(!o){if(g){c=!0;break}g=!0}n.limit=l,d=!1;break;case"'":if(!o){if(_){c=!0;break}_=!0}n.markedOffset=l,d=!1;break;case" ":d=!1;break;default:if(!o&&d){c=!0;break}if(p=parseInt(u+e.charAt(a++),16),!o&&(isNaN(p)||0>p||255<p))throw TypeError("Illegal str: Not a debug encoded string");n.view[l++]=p,d=!0;}if(c)throw TypeError("Illegal str: Invalid symbol at "+a)}if(!o){if(!f||!g)throw TypeError("Illegal str: Missing offset or limit");if(l<n.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+l+" < "+r)}return n},d.toHex=function(e,t){if(e="undefined"==typeof e?this.offset:e,t="undefined"==typeof t?this.limit:t,!this.noAssert){if("number"!=typeof e||0!=e%1)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||0!=t%1)throw TypeError("Illegal end: Not an integer");if(t>>>=0,0>e||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var o=Array(t-e),r;e<t;)r=this.view[e++],16>r?o.push("0",r.toString(16)):o.push(r.toString(16));return o.join("")},s.fromHex=function(e,t,o){if(!o){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if(0!=e.length%2)throw TypeError("Illegal str: Length not a multiple of 2")}for(var r=e.length,n=new s(0|r/2,t),a=0,l=0,d;a<r;a+=2){if(d=parseInt(e.substring(a,a+2),16),!o&&(!isFinite(d)||0>d||255<d))throw TypeError("Illegal str: Contains non-hex characters");n.view[l++]=d}return n.limit=l,n};var m=function(){var e={};return e.MAX_CODEPOINT=1114111,e.encodeUTF8=function(e,t){var o=null;for("number"==typeof e&&(o=e,e=function(){return null});null!==o||null!==(o=e());)128>o?t(127&o):2048>o?(t(192|31&o>>6),t(128|63&o)):65536>o?(t(224|15&o>>12),t(128|63&o>>6),t(128|63&o)):(t(240|7&o>>18),t(128|63&o>>12),t(128|63&o>>6),t(128|63&o)),o=null},e.decodeUTF8=function(e,t){for(var o=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t},r,n,s,i;null!==(r=e());)if(0==(128&r))t(r);else if(192==(224&r))null===(n=e())&&o([r,n]),t((31&r)<<6|63&n);else if(224==(240&r))(null===(n=e())||null===(s=e()))&&o([r,n,s]),t((15&r)<<12|(63&n)<<6|63&s);else if(240==(248&r))(null===(n=e())||null===(s=e())||null===(i=e()))&&o([r,n,s,i]),t((7&r)<<18|(63&n)<<12|(63&s)<<6|63&i);else throw RangeError("Illegal starting byte: "+r)},e.UTF16toUTF8=function(e,t){for(var o=null,r;null!==(r=null===o?e():o);){if(55296<=r&&57343>=r&&null!==(o=e())&&56320<=o&&57343>=o){t(1024*(r-55296)+o-56320+65536),o=null;continue}t(r)}null!==o&&t(o)},e.UTF8toUTF16=function(e,t){var o=null;for("number"==typeof e&&(o=e,e=function(){return null});null!==o||null!==(o=e());)65535>=o?t(o):(o-=65536,t((o>>10)+55296),t(o%1024+56320)),o=null},e.encodeUTF16toUTF8=function(t,o){e.UTF16toUTF8(t,function(t){e.encodeUTF8(t,o)})},e.decodeUTF8toUTF16=function(t,o){e.decodeUTF8(t,function(t){e.UTF8toUTF16(t,o)})},e.calculateCodePoint=function(e){return 128>e?1:2048>e?2:65536>e?3:4},e.calculateUTF8=function(e){for(var t=0,o;null!==(o=e());)t+=128>o?1:2048>o?2:65536>o?3:4;return t},e.calculateUTF16asUTF8=function(t){var o=0,r=0;return e.UTF16toUTF8(t,function(e){++o,r+=128>e?1:2048>e?2:65536>e?3:4}),[o,r]},e}();return d.toUTF8=function(t,r){if("undefined"==typeof t&&(t=this.offset),"undefined"==typeof r&&(r=this.limit),!this.noAssert){if("number"!=typeof t||0!=t%1)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof r||0!=r%1)throw TypeError("Illegal end: Not an integer");if(r>>>=0,0>t||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}var n;try{m.decodeUTF8toUTF16(function(){return t<r?this.view[t++]:null}.bind(this),n=o())}catch(o){if(t!==r)throw RangeError("Illegal range: Truncated data, "+t+" != "+r)}return n()},s.fromUTF8=function(e,o,r){if(!r&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var n=new s(m.calculateUTF16asUTF8(t(e),!0)[1],o,r),a=0;return m.encodeUTF16toUTF8(t(e),function(e){n.view[a++]=e}),n.limit=a,n},s})},{long:3}],3:[function(e,t){/** * @license long.js (c) 2013 Daniel Wirtz <dcode@dcode.io> * Released under the Apache License, Version 2.0 * see: https://github.com/dcodeIO/long.js for details */(function(o,r){"function"==typeof p&&p.amd?p([],r):"function"==typeof e&&"object"==typeof t&&t&&t.exports?t.exports=r():(o.dcodeIO=o.dcodeIO||{}).Long=r()})(this,function(){"use strict";function e(e,t,o){this.low=0|e,this.high=0|t,this.unsigned=!!o}function t(e){return!0===(e&&e.__isLong__)}function o(e,t){var o,r,n;return t?(e>>>=0,(n=0<=e&&256>e)&&(r=b[e],r))?r:(o=d(e,0>(0|e)?-1:0,!0),n&&(b[e]=o),o):(e|=0,(n=-128<=e&&128>e)&&(r=p[e],r))?r:(o=d(e,0>e?-1:0,!1),n&&(p[e]=o),o)}function a(e,t){if(isNaN(e)||!isFinite(e))return t?j:v;if(t){if(0>e)return j;if(e>=y)return L}else{if(e<=-x)return A;if(e+1>=x)return T}return 0>e?a(-e,t).neg():d(0|e%h,0|e/h,t)}function d(t,o,r){return new e(t,o,r)}function g(e,t,o){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return v;if("number"==typeof t?(o=t,t=!1):t=!!t,o=o||10,2>o||36<o)throw RangeError("radix");var r;if(0<(r=e.indexOf("-")))throw Error("interior hyphen");else if(0===r)return g(e.substring(1),t,o).neg();for(var n=a(m(o,8)),l=v,d=0;d<e.length;d+=8){var f=s(8,e.length-d),_=parseInt(e.substring(d,d+f),o);if(8>f){var c=a(m(o,f));l=l.mul(c).add(a(_))}else l=l.mul(n),l=l.add(a(_))}return l.unsigned=t,l}function c(t){return t instanceof e?t:"number"==typeof t?a(t):"string"==typeof t?g(t):d(t.low,t.high,t.unsigned)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var p={},b={};e.fromInt=o,e.fromNumber=a,e.fromBits=d;var m=u;e.fromString=g,e.fromValue=c;var h=4294967296,y=h*h,x=y/2,w=o(16777216),v=o(0);e.ZERO=v;var j=o(0,!0);e.UZERO=j;var I=o(1);e.ONE=I;var E=o(1,!0);e.UONE=E;var S=o(-1);e.NEG_ONE=S;var T=d(-1,2147483647,!1);e.MAX_VALUE=T;var L=d(-1,-1,!0);e.MAX_UNSIGNED_VALUE=L;var A=d(0,-2147483648,!1);e.MIN_VALUE=A;var k=e.prototype;return k.toInt=function(){return this.unsigned?this.low>>>0:this.low},k.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},k.toString=function(e){if(e=e||10,2>e||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(A)){var t=a(e),o=this.div(t),r=o.mul(t).sub(this);return o.toString(e)+r.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var n=a(m(e,6),this.unsigned),s=this,i="";;){var l=s.div(n),d=s.sub(l.mul(n)).toInt()>>>0,f=d.toString(e);if(s=l,s.isZero())return f+i;for(;6>f.length;)f="0"+f;i=""+f+i}},k.getHighBits=function(){return this.high},k.getHighBitsUnsigned=function(){return this.high>>>0},k.getLowBits=function(){return this.low},k.getLowBitsUnsigned=function(){return this.low>>>0},k.getNumBitsAbs=function(){if(this.isNegative())return this.eq(A)?64:this.neg().getNumBitsAbs();for(var e=0==this.high?this.low:this.high,t=31;0<t&&0==(e&1<<t);t--);return 0==this.high?t+1:t+33},k.isZero=function(){return 0===this.high&&0===this.low},k.isNegative=function(){return!this.unsigned&&0>this.high},k.isPositive=function(){return this.unsigned||0<=this.high},k.isOdd=function(){return 1==(1&this.low)},k.isEven=function(){return 0==(1&this.low)},k.equals=function(e){ret