UNPKG

solutaut

Version:

Multicoin address validator for Bitcoin and other Altcoins.

1 lines 178 kB
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).WAValidator=t()}}(function(){return function(){return function t(e,r,n){function i(s,a){if(!r[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var h=r[s]={exports:{}};e[s][0].call(h.exports,function(t){return i(e[s][1][t]||t)},h,h.exports,t,e,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s<n.length;s++)i(n[s]);return i}}()({1:[function(t,e,r){"use strict";e.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var n=0;n<t.length;n++){var i=t.charAt(n),o=i.charCodeAt(0);if(255!==e[o])throw new TypeError(i+" is ambiguous");e[o]=n}var s=t.length,a=t.charAt(0),u=Math.log(s)/Math.log(256),c=Math.log(256)/Math.log(s);function h(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return new Uint8Array;for(var r=0,n=0,i=0;t[r]===a;)n++,r++;for(var o=(t.length-r)*u+1>>>0,c=new Uint8Array(o);t[r];){var h=e[t.charCodeAt(r)];if(255===h)return;for(var f=0,l=o-1;(0!==h||f<i)&&-1!==l;l--,f++)h+=s*c[l]>>>0,c[l]=h%256>>>0,h=h/256>>>0;if(0!==h)throw new Error("Non-zero carry");i=f,r++}for(var d=o-i;d!==o&&0===c[d];)d++;for(var p=new Uint8Array(n+(o-d)),y=n;d!==o;)p[y++]=c[d++];return p}return{encode:function(e){if(e instanceof Uint8Array||(ArrayBuffer.isView(e)?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Array.isArray(e)&&(e=Uint8Array.from(e))),!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===e.length)return"";for(var r=0,n=0,i=0,o=e.length;i!==o&&0===e[i];)i++,r++;for(var u=(o-i)*c+1>>>0,h=new Uint8Array(u);i!==o;){for(var f=e[i],l=0,d=u-1;(0!==f||l<n)&&-1!==d;d--,l++)f+=256*h[d]>>>0,h[d]=f%s>>>0,f=f/s>>>0;if(0!==f)throw new Error("Non-zero carry");n=l,i++}for(var p=u-n;p!==u&&0===h[p];)p++;for(var y=a.repeat(r);p<u;++p)y+=t.charAt(h[p]);return y},decodeUnsafe:h,decode:function(t){var e=h(t);if(e)return e;throw new Error("Non-base"+s+" character")}}}},{}],2:[function(t,e,r){"use strict";r.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},r.toByteArray=function(t){for(var e,r=c(t),n=r[0],s=r[1],a=new o(function(t,e,r){return 3*(e+r)/4-r}(0,n,s)),u=0,h=s>0?n-4:n,f=0;f<h;f+=4)e=i[t.charCodeAt(f)]<<18|i[t.charCodeAt(f+1)]<<12|i[t.charCodeAt(f+2)]<<6|i[t.charCodeAt(f+3)],a[u++]=e>>16&255,a[u++]=e>>8&255,a[u++]=255&e;2===s&&(e=i[t.charCodeAt(f)]<<2|i[t.charCodeAt(f+1)]>>4,a[u++]=255&e);1===s&&(e=i[t.charCodeAt(f)]<<10|i[t.charCodeAt(f+1)]<<4|i[t.charCodeAt(f+2)]>>2,a[u++]=e>>8&255,a[u++]=255&e);return a},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],s=0,a=r-i;s<a;s+=16383)o.push(h(t,s,s+16383>a?a:s+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)n[a]=s[a],i[s.charCodeAt(a)]=a;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function h(t,e,r){for(var i,o,s=[],a=e;a<r;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],3:[function(t,e,r){(function(t){(function(){var r,n=20,i=4,o=-7,s=21,a=-1e9,u=1e9,c=!0,h=parseInt,f=g.prototype,l="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",d=0,p=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,y=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},v=g(1);function g(t,e){var o,s,h,f,v,w,_=this;if(!(_ instanceof g))return new g(t,e);if(t instanceof g){if(d=0,e===o)return _.s=t.s,_.e=t.e,void(_.c=(t=t.c)?t.slice():t);t+=""}if("string"!=typeof t&&(t=(h="number"==typeof t||"[object Number]"==Object.prototype.toString.call(t))&&0===t&&1/t<0?"-0":t+""),w=t,e===o&&p.test(t))_.s="-"==t.charAt(0)?(t=t.slice(1),-1):1;else{if(10==e)return x(t,n,i);if(t=y.call(t).replace(/^\+(?!-)/,""),_.s="-"==t.charAt(0)?(t=t.replace(/^-(?!-)/,""),-1):1,null!=e?e!=(0|e)&&c||(r=!(e>=2&&e<65))?(m(e,2),v=p.test(t)):(f="["+l.slice(0,e|=0)+"]+",t=t.replace(/\.$/,"").replace(/^\./,"0."),(v=new RegExp("^"+f+"(?:\\."+f+")?$",e<37?"i":"").test(t))?(h&&(t.replace(/^0\.0*|\./,"").length>15&&m(w,0),h=!h),t=b(t,10,e,_.s)):"Infinity"!=t&&"NaN"!=t&&(m(w,1,e),t="NaN")):v=p.test(t),!v)return _.c=_.e=null,"Infinity"!=t&&("NaN"!=t&&m(w,3),_.s=null),void(d=0)}for((o=t.indexOf("."))>-1&&(t=t.replace(".","")),(s=t.search(/e/i))>0?(o<0&&(o=s),o+=+t.slice(s+1),t=t.substring(0,s)):o<0&&(o=t.length),s=0;"0"==t.charAt(s);s++);if(e=t.length,h&&e>15&&t.slice(s).length>15&&m(w,0),d=0,(o-=s+1)>u)_.c=_.e=null;else if(s==e||o<a)_.c=[_.e=0];else{for(;"0"==t.charAt(--e););for(_.e=o,_.c=[],o=0;s<=e;_.c[o++]=+t.charAt(s++));}}function m(t,e,n,i,o,s){if(c){var a,u=["new BigNumber","cmp","div","eq","gt","gte","lt","lte","minus","mod","plus","times","toFr"][d?d<0?-d:d:1/d<0?1:0]+"()",h=r?" out of range":" not a"+(o?" non-zero":"n")+" integer";throw h=([u+" number type has more than 15 significant digits",u+" not a base "+n+" number",u+" base"+h,u+" not a number"][e]||n+"() "+e+(s?" not a boolean or binary digit":h+(i?" or not ["+(r?" negative, positive":" integer, integer")+" ]":"")))+": "+t,r=d=0,(a=new Error(h)).name="BigNumber Error",a}}function b(t,e,r,n){var i,o,s,a,u,c;function h(t,n){var i,o,s=0,a=t.length,u=[0];for(n=n||r;s<a;s++){for(o=u.length,i=0;i<o;u[i]*=n,i++);for(u[0]+=l.indexOf(t.charAt(s)),i=0;i<u.length;i++)u[i]>e-1&&(null==u[i+1]&&(u[i+1]=0),u[i+1]+=u[i]/e^0,u[i]%=e)}return u.reverse()}function f(t){for(var e=0,r=t.length,n="";e<r;n+=l.charAt(t[e++]));return n}if(r<37&&(t=t.toLowerCase()),(i=t.indexOf("."))>-1)if(i=t.length-i-1,o=h(new g(r).pow(i).toF(),10),s=h((a=t.split("."))[1]),a=h(a[0]),u=(c=w(s,o,s.length-o.length,n,e,1&a[a.length-1])).c,i=c.e){for(;++i;u.unshift(0));t=f(a)+"."+f(u)}else u[0]?a[i=a.length-1]<e-1?(++a[i],t=f(a)):t=new g(f(a),e).plus(v).toS(e):t=f(a);else t=f(h(t));return t}function w(t,e,r,i,o,s){var c,h,f,l,d,p=e.slice(),y=c=e.length,m=t.length,b=t.slice(0,c),w=b.length,_=new g(v),x=_.c=[],E=0,k=n+(_.e=r)+1;for(_.s=i,i=k<0?0:k;w++<c;b.push(0));p.unshift(0);do{for(f=0;f<o;f++){if(c!=(w=b.length))l=c>w?1:-1;else for(d=-1,l=0;++d<c;)if(e[d]!=b[d]){l=e[d]>b[d]?1:-1;break}if(!(l<0))break;for(h=w==c?e:p;w;){if(b[--w]<h[w]){for(d=w;d&&!b[--d];b[d]=o-1);--b[d],b[w]+=o}b[w]-=h[w]}for(;!b[0];b.shift());}x[E++]=l?f:++f,b[0]&&l?b[w]=t[y]||0:b=[t[y]]}while((y++<m||null!=b[0])&&i--);return x[0]||1==E||(--_.e,x.shift()),E>k&&A(_,n,o,s,null!=b[0]),_.e>u?_.c=_.e=null:_.e<a&&(_.c=[_.e=0]),_}function _(t,e,r){var n=e-(t=new g(t)).e,i=t.c;if(!i)return t.toS();for(i.length>++e&&A(t,n,10),n=0==i[0]?n+1:r?e:t.e+n+1;i.length<n;i.push(0));return n=t.e,1==r||2==r&&(--e<n||n<=o)?(t.s<0&&i[0]?"-":"")+(i.length>1?(i.splice(1,0,"."),i.join("")):i[0])+(n<0?"e":"e+")+n:t.toS()}function A(t,e,r,n,o){var s=t.c,a=t.s<0,u=r/2,c=t.e+e+1,h=s[c],f=o||c<0||null!=s[c+1];if(o=i<4?(null!=h||f)&&(0==i||2==i&&!a||3==i&&a):h>u||h==u&&(4==i||f||6==i&&(1&s[c-1]||!e&&n)||7==i&&!a||8==i&&a),c<1||!s[0])return s.length=0,s.push(0),o?(s[0]=1,t.e=-e):t.e=0,t;if(s.length=c--,o)for(--r;++s[c]>r;)s[c]=0,c--||(++t.e,s.unshift(1));for(c=s.length;!s[--c];s.pop());return t}function x(t,e,r){var n=i;return i=r,(t=new g(t)).c&&A(t,e,10),i=n,t}g.ROUND_UP=0,g.ROUND_DOWN=1,g.ROUND_CEIL=2,g.ROUND_FLOOR=3,g.ROUND_HALF_UP=4,g.ROUND_HALF_DOWN=5,g.ROUND_HALF_EVEN=6,g.ROUND_HALF_CEIL=7,g.ROUND_HALF_FLOOR=8,g.fromBuffer=function(t,e){e||(e={});var r={1:"big","-1":"little"}[e.endian]||e.endian||"big",n="auto"===e.size?Math.ceil(t.length):e.size||1;if(t.length%n!=0)throw new RangeError("Buffer length ("+t.length+") must be a multiple of size ("+n+")");for(var i=[],o=0;o<t.length;o+=n){for(var s=[],a=0;a<n;a++)s.push(t[o+("big"===r?a:n-a-1)]);i.push(s.map(function(t){return(t<16?"0":"")+t.toString(16)}).join(""))}return g(i.join(""),16)},g.config=function(){var t,e,f=0,l={},p=arguments,y=p[0],v="config",g=function(t,e,n){return!((r=t<e||t>n)||h(t)!=t&&0!==t)},b=y&&"object"==typeof y?function(){if(y.hasOwnProperty(e))return null!=(t=y[e])}:function(){if(p.length>f)return null!=(t=p[f++])};return b(e="DECIMAL_PLACES")&&(g(t,0,1e9)?n=0|t:m(t,e,v)),l[e]=n,b(e="ROUNDING_MODE")&&(g(t,0,8)?i=0|t:m(t,e,v)),l[e]=i,b(e="EXPONENTIAL_AT")&&(g(t,-1e9,1e9)?o=-(s=~~(t<0?-t:+t)):!r&&t&&g(t[0],-1e9,0)&&g(t[1],0,1e9)?(o=~~t[0],s=~~t[1]):m(t,e,v,1)),l[e]=[o,s],b(e="RANGE")&&(g(t,-1e9,1e9)&&~~t?a=-(u=~~(t<0?-t:+t)):!r&&t&&g(t[0],-1e9,-1)&&g(t[1],1,1e9)?(a=~~t[0],u=~~t[1]):m(t,e,v,1,1)),l[e]=[a,u],b(e="ERRORS")&&(t===!!t||1===t||0===t?(r=d=0,h=(c=!!t)?parseInt:parseFloat):m(t,e,v,0,0,1)),l[e]=c,l},f.abs=f.absoluteValue=function(){var t=new g(this);return t.s<0&&(t.s=1),t},f.bitLength=function(){return this.toString(2).length},f.ceil=function(){return x(this,0,2)},f.comparedTo=f.cmp=function(t,e){var r,n=this,i=n.c,o=(d=-d,t=new g(t,e)).c,s=n.s,a=t.s,u=n.e,c=t.e;if(!s||!a)return null;if(r=i&&!i[0],e=o&&!o[0],r||e)return r?e?0:-a:s;if(s!=a)return s;if(r=s<0,e=u==c,!i||!o)return e?0:!i^r?1:-1;if(!e)return u>c^r?1:-1;for(s=-1,a=(u=i.length)<(c=o.length)?u:c;++s<a;)if(i[s]!=o[s])return i[s]>o[s]^r?1:-1;return u==c?0:u>c^r?1:-1},f.dividedBy=f.div=function(t,e){var r=this.c,n=this.e,i=this.s,o=(d=2,t=new g(t,e)).c,s=t.e,a=t.s,u=i==a?1:-1;return(n||r&&r[0])&&(s||o&&o[0])?w(r,o,n-s,u,10):new g(i&&a&&(r?!o||r[0]!=o[0]:o)?r&&0==r[0]||!o?0*u:u/0:NaN)},f.equals=f.eq=function(t,e){return d=3,0===this.cmp(t,e)},f.floor=function(){return x(this,0,3)},f.greaterThan=f.gt=function(t,e){return d=4,this.cmp(t,e)>0},f.greaterThanOrEqualTo=f.gte=f.gt=function(t,e){return d=5,1==(e=this.cmp(t,e))||0===e},f.isFinite=f.isF=function(){return!!this.c},f.isNaN=function(){return!this.s},f.isNegative=f.isNeg=function(){return this.s<0},f.isZero=f.isZ=function(){return!!this.c&&0==this.c[0]},f.lessThan=f.lt=function(t,e){return d=6,this.cmp(t,e)<0},f.lessThanOrEqualTo=f.lte=f.le=function(t,e){return d=7,-1==(e=this.cmp(t,e))||0===e},f.minus=f.sub=function(t,e){var r,n,o,s,u=this,c=u.s;if(e=(d=8,t=new g(t,e)).s,!c||!e)return new g(NaN);if(c!=e)return t.s=-e,u.plus(t);var h=u.c,f=u.e,l=t.c,p=t.e;if(!f||!p){if(!h||!l)return h?(t.s=-e,t):new g(l?u:NaN);if(!h[0]||!l[0])return l[0]?(t.s=-e,t):new g(h[0]?u:3==i?-0:0)}if(h=h.slice(),c=f-p){for((r=(s=c<0)?(c=-c,h):(p=f,l)).reverse(),e=c;e--;r.push(0));r.reverse()}else for(o=((s=h.length<l.length)?h:l).length,c=e=0;e<o;e++)if(h[e]!=l[e]){s=h[e]<l[e];break}if(s&&(r=h,h=l,l=r,t.s=-t.s),(e=-((o=h.length)-l.length))>0)for(;e--;h[o++]=0);for(e=l.length;e>c;){if(h[--e]<l[e]){for(n=e;n&&!h[--n];h[n]=9);--h[n],h[e]+=10}h[e]-=l[e]}for(;0==h[--o];h.pop());for(;0==h[0];h.shift(),--p);return(p<a||!h[0])&&(h[0]||(t.s=3==i?-1:1),h=[p=0]),t.c=h,t.e=p,t},f.modulo=f.mod=function(t,e){var r=this,o=r.c,s=(d=9,t=new g(t,e)).c,a=r.s,u=t.s;return(e=!a||!u||s&&!s[0])||o&&!o[0]?new g(e?NaN:r):(r.s=t.s=1,e=1==t.cmp(r),r.s=a,t.s=u,e?new g(r):(a=n,u=i,n=0,i=1,r=r.div(t),n=a,i=u,this.minus(r.times(t))))},f.negated=f.neg=function(){var t=new g(this);return t.s=-t.s||null,t},f.plus=f.add=function(t,e){var r,n=this,i=n.s;if(e=(d=10,t=new g(t,e)).s,!i||!e)return new g(NaN);if(i!=e)return t.s=-e,n.minus(t);var o=n.e,s=n.c,a=t.e,c=t.c;if(!o||!a){if(!s||!c)return new g(i/0);if(!s[0]||!c[0])return c[0]?t:new g(s[0]?n:0*i)}if(s=s.slice(),i=o-a){for((r=i>0?(a=o,c):(i=-i,s)).reverse();i--;r.push(0));r.reverse()}for(s.length-c.length<0&&(r=c,c=s,s=r),i=c.length,e=0;i;e=(s[--i]=s[i]+c[i]+e)/10^0,s[i]%=10);for(e&&(s.unshift(e),++a>u&&(s=a=null)),i=s.length;0==s[--i];s.pop());return t.c=s,t.e=a,t},f.toPower=f.pow=function(t){var e=0*t==0?0|t:t,n=new g(this),i=new g(v);if(((r=t<-1e6||t>1e6)&&(e=1*t/0)||h(t)!=t&&0!==t&&!(e=NaN))&&!m(t,"exponent","pow")||!e)return new g(Math.pow(n.toS(),e));for(e=e<0?-e:e;1&e&&(i=i.times(n)),e>>=1;)n=n.times(n);return t<0?v.div(i):i},f.powm=function(t,e){return this.pow(t).mod(e)},f.round=function(t,e){return x(this,t=null==t||((r=t<0||t>1e9)||h(t)!=t)&&!m(t,"decimal places","round")?0:0|t,e=null==e||((r=e<0||e>8)||h(e)!=e&&0!==e)&&!m(e,"mode","round")?i:0|e)},f.squareRoot=f.sqrt=function(){var t,e,r,o,s=this,a=s.c,u=s.s,c=s.e,h=n,f=i,l=new g("0.5");if(1!==u||!a||!a[0])return new g(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(u=Math.sqrt(s.toS()),i=1,0==u||u==1/0?((t=a.join("")).length+c&1||(t+="0"),(e=new g(Math.sqrt(t)+"")).c||(e.c=[1]),e.e=((c+1)/2|0)-(c<0||1&c)):e=new g(t=u.toString()),(u=(r=e.e)+(n+=4))<3&&(u=0),c=u;;)if(o=e,e=l.times(o.plus(s.div(o))),o.c.slice(0,u).join("")===e.c.slice(0,u).join("")){if(9!=(a=e.c)[u-=t&&e.e<r]||9!=a[u-1]||9!=a[u-2]||!(9==a[u-3]||t&&4==a[u-3])){if(!(a[c]||a[c-1]||a[c-2]||a[c-3]&&5!=a[c-3]||(a.length>c-2&&(a.length=c-2),e.times(e).eq(s)))){for(;a.length<c-3;)a.push(0);a[c-3]++}return i=f,A(e,n=h,10),e}if(t&&9==a[u-3]&&(o=e.round(h,0)).times(o).eq(s))return i=f,n=h,o;n+=4,u+=4,t=""}},f.times=f.mul=function(t,e){var r,n=this,i=n.c,o=(d=11,t=new g(t,e)).c,s=n.e,c=t.e,h=n.s;if(t.s=h==(e=t.s)?1:-1,!((s||i&&i[0])&&(c||o&&o[0])))return new g(!h||!e||i&&!i[0]&&!o||o&&!o[0]&&!i?NaN:i&&o?0*t.s:t.s/0);for(t.e=s+c,(h=i.length)<(e=o.length)&&(r=i,i=o,o=r,c=h,h=e,e=c),c=h+e,r=[];c--;r.push(0));for(s=e-1;s>-1;s--){for(e=0,c=h+s;c>s;e=r[c]+o[s]*i[c-s-1]+e,r[c--]=e%10|0,e=e/10|0);e&&(r[c]=(r[c]+e)%10)}for(e&&++t.e,!r[0]&&r.shift(),c=r.length;!r[--c];r.pop());return t.c=t.e>u?t.e=null:t.e<a?[t.e=0]:r,t},f.toBuffer=function(e){if("string"==typeof e){if("mpint"!==e)return"Unsupported Buffer representation";var r=this.abs(),n=1===(h=r.toBuffer({size:1,endian:"big"})).length&&0===h[0]?0:h.length;128&h[0]&&n++;var i=new t(4+n);n>0&&h.copy(i,4+(128&h[0]?1:0)),128&h[0]&&(i[4]=0),i[0]=n&255<<24,i[1]=n&255<<16,i[2]=65280&n,i[3]=255&n;var o=this.lt(0);if(o)for(var s=4;s<i.length;s++)i[s]=255-i[s];return i[4]=127&i[4]|(o?128:0),o&&i[i.length-1]++,i}e||(e={});var a={1:"big","-1":"little"}[e.endian]||e.endian||"big",u=this.toString(16);if("-"===u.charAt(0))throw new Error("converting negative numbers to Buffers not supported yet");for(var c="auto"===e.size?Math.ceil(u.length/2):e.size||1,h=(n=Math.ceil(u.length/(2*c))*c,new t(n));u.length<2*n;)u="0"+u;return u.split(new RegExp("(.{"+2*c+"})")).filter(function(t){return t.length>0}).forEach(function(t,e){for(var r=0;r<c;r++){h[e*c+("big"===a?r:c-r-1)]=parseInt(t.slice(2*r,2*r+2),16)}}),h},f.toExponential=f.toE=function(t){return _(this,(null==t||((r=t<0||t>1e9)||h(t)!=t&&0!==t)&&!m(t,"decimal places","toE"))&&this.c?this.c.length-1:0|t,1)},f.toFixed=f.toF=function(t){var e,n,i,a=this;return null==t||((r=t<0||t>1e9)||h(t)!=t&&0!==t)&&!m(t,"decimal places","toF")||(i=a.e+(0|t)),e=o,t=s,o=-(s=1/0),i==n?n=a.toS():(n=_(a,i),a.s<0&&a.c&&(a.c[0]?n.indexOf("-")<0&&(n="-"+n):n=n.replace(/^-/,""))),o=e,s=t,n},f.toFraction=f.toFr=function(t){var e,o,s,a,h,f,l,p=a=new g(v),y=s=new g("0"),b=this,w=b.c,_=u,A=n,x=i,E=new g(v);if(!w)return b.toS();for(l=E.e=w.length-b.e-1,(null==t||(!(d=12,f=new g(t)).s||(r=f.cmp(p)<0||!f.c)||c&&f.e<f.c.length-1)&&!m(t,"max denominator","toFr")||(t=f).cmp(E)>0)&&(t=l>0?E:p),u=1/0,f=new g(w.join("")),n=0,i=1;e=f.div(E),1!=(h=a.plus(e.times(y))).cmp(t);)a=y,y=h,p=s.plus(e.times(h=p)),s=h,E=f.minus(e.times(h=E)),f=h;return h=t.minus(a).div(y),s=s.plus(h.times(p)),a=a.plus(h.times(y)),s.s=p.s=b.s,n=2*l,i=x,o=p.div(y).minus(b).abs().cmp(s.div(a).minus(b).abs())<1?[p.toS(),y.toS()]:[s.toS(),a.toS()],u=_,n=A,o},f.toPrecision=f.toP=function(t){return null==t||((r=t<1||t>1e9)||h(t)!=t)&&!m(t,"precision","toP")?this.toS():_(this,0|--t,2)},f.toString=f.toS=function(t){var e,n,i,a=this,u=a.e;if(null===u)n=a.s?"Infinity":"NaN";else{if(t===e&&(u<=o||u>=s))return _(a,a.c.length-1,1);if(n=a.c.join(""),u<0){for(;++u;n="0"+n);n="0."+n}else if(i=n.length,u>0)if(++u>i)for(u-=i;u--;n+="0");else u<i&&(n=n.slice(0,u)+"."+n.slice(u));else if(e=n.charAt(0),i>1)n=e+"."+n.slice(1);else if("0"==e)return e;if(null!=t)if((r=!(t>=2&&t<65))||t!=(0|t)&&c)m(t,"base","toS");else if("0"==(n=b(n,0|t,10,a.s)))return n}return a.s<0?"-"+n:n},f.valueOf=function(){return this.toS()},e.exports=g}).call(this)}).call(this,t("buffer").Buffer)},{buffer:4}],4:[function(t,e,r){"use strict";var n=t("base64-js"),i=t("ieee754");r.Buffer=a,r.SlowBuffer=function(t){+t!=t&&(t=0);return a.alloc(+t)},r.INSPECT_MAX_BYTES=50;var o=2147483647;function s(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=a.prototype,e}function a(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|d(t,e),n=s(r),i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e);if(ArrayBuffer.isView(t))return f(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(z(t,ArrayBuffer)||t&&z(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r);return n.__proto__=a.prototype,n}(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return a.from(n,e,r);var i=function(t){if(a.isBuffer(t)){var e=0|l(t.length),r=s(e);return 0===r.length?r:(t.copy(r,0,0,e),r)}if(void 0!==t.length)return"number"!=typeof t.length||F(t.length)?s(0):f(t);if("Buffer"===t.type&&Array.isArray(t.data))return f(t.data)}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return a.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return c(t),s(t<0?0:0|l(t))}function f(t){for(var e=t.length<0?0:0|l(t.length),r=s(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function l(t){if(t>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function d(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||z(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(t).length;default:if(i)return n?-1:N(t).length;e=(""+e).toLowerCase(),i=!0}}function p(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):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),F(r=+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=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(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;s=2,a/=2,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var h=-1;for(o=r;o<a;o++)if(c(t,o)===c(e,-1===h?0:o-h)){if(-1===h&&(h=o),o-h+1===u)return h*s}else-1!==h&&(o-=o-h),h=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var f=!0,l=0;l<u;l++)if(c(t,o+l)!==c(e,l)){f=!1;break}if(f)return o}return-1}function g(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(F(a))return s;t[r+s]=a}return s}function m(t,e,r,n){return P(N(e,t.length-r),t,r,n)}function b(t,e,r,n){return P(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,n){return b(t,e,r,n)}function _(t,e,r,n){return P(H(e),t,r,n)}function A(t,e,r,n){return P(function(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function x(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function E(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,a,u,c=t[i],h=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(h=c);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(h=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(h=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)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(h=u)}null===h?(h=65533,f=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=f}return function(t){var e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=k));return r}(n)}r.kMaxLength=o,a.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),a.poolSize=8192,a.from=function(t,e,r){return u(t,e,r)},a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,a.alloc=function(t,e,r){return function(t,e,r){return c(t),t<=0?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)}(t,e,r)},a.allocUnsafe=function(t){return h(t)},a.allocUnsafeSlow=function(t){return h(t)},a.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==a.prototype},a.compare=function(t,e){if(z(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),z(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');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},a.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}},a.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=a.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(z(o,Uint8Array)&&(o=a.from(o)),!a.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},a.byteLength=d,a.prototype._isBuffer=!0,a.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)p(this,e,e+1);return this},a.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)p(this,e,e+3),p(this,e+1,e+2);return this},a.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)p(this,e,e+7),p(this,e+1,e+6),p(this,e+2,e+5),p(this,e+3,e+4);return this},a.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?E(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 I(this,e,r);case"utf8":case"utf-8":return E(this,e,r);case"ascii":return S(this,e,r);case"latin1":case"binary":return C(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},a.prototype.compare=function(t,e,r,n,i){if(z(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,s=r-e,u=Math.min(o,s),c=this.slice(n,i),h=t.slice(e,r),f=0;f<u;++f)if(c[f]!==h[f]){o=c[f],s=h[f];break}return o<s?-1:s<o?1:0},a.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},a.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)},a.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||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return g(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return b(this,t,e,r);case"latin1":case"binary":return w(this,t,e,r);case"base64":return _(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function S(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 C(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 I(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=R(t[o]);return i}function j(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 M(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function B(t,e,r,n,i,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function U(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 T(t,e,r,n,o){return e=+e,r>>>=0,o||U(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function L(t,e,r,n,o){return e=+e,r>>>=0,o||U(t,0,r,8),i.write(t,e,r,n,52,8),r+8}a.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return n.__proto__=a.prototype,n},a.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||M(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},a.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||M(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},a.prototype.readUInt8=function(t,e){return t>>>=0,e||M(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||M(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||M(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||M(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||M(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},a.prototype.readInt8=function(t,e){return t>>>=0,e||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||M(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){t>>>=0,e||M(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return t>>>=0,e||M(t,4,this.length),i.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||M(t,4,this.length),i.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||M(t,8,this.length),i.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||M(t,8,this.length),i.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||B(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},a.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||B(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);B(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},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);B(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeFloatLE=function(t,e,r){return T(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return T(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return L(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return L(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(!a.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&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("Index out of range");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=n-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(var o=i-1;o>=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},a.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),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}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=a.isBuffer(t)?t:a.from(t,n),u=s.length;if(0===u)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=s[o%u]}return this};var O=/[^+/0-9A-Za-z-_]/g;function R(t){return t<16?"0"+t.toString(16):t.toString(16)}function N(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function H(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function P(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}function z(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function F(t){return t!=t}},{"base64-js":2,ieee754:45}],5:[function(t,e,r){!function(t,r){"use strict";var n=Math.pow(2,-24),i=Math.pow(2,32),o=Math.pow(2,53);var s={encode:function(t){var e,n=new ArrayBuffer(256),s=new DataView(n),a=0;function u(t){for(var r=n.byteLength,i=a+t;r<i;)r*=2;if(r!==n.byteLength){var o=s;n=new ArrayBuffer(r),s=new DataView(n);for(var u=a+3>>2,c=0;c<u;++c)s.setUint32(4*c,o.getUint32(4*c))}return e=t,s}function c(){a+=e}function h(t){c(u(1).setUint8(a,t))}function f(t){for(var e=u(t.length),r=0;r<t.length;++r)e.setUint8(a+r,t[r]);c()}function l(t,e){var r;e<24?h(t<<5|e):e<256?(h(t<<5|24),h(e)):e<65536?(h(t<<5|25),r=e,c(u(2).setUint16(a,r))):e<4294967296?(h(t<<5|26),function(t){c(u(4).setUint32(a,t))}(e)):(h(t<<5|27),function(t){var e=t%i,r=(t-e)/i,n=u(8);n.setUint32(a,r),n.setUint32(a+4,e),c()}(e))}if(function t(e){var n;if(!1===e)return h(244);if(!0===e)return h(245);if(null===e)return h(246);if(e===r)return h(247);switch(typeof e){case"number":if(Math.floor(e)===e){if(0<=e&&e<=o)return l(0,e);if(-o<=e&&e<0)return l(1,-(e+1))}return h(251),function(t){c(u(8).setFloat64(a,t))}(e);case"string":var i=[];for(n=0;n<e.length;++n){var s=e.charCodeAt(n);s<128?i.push(s):s<2048?(i.push(192|s>>6),i.push(128|63&s)):s<55296?(i.push(224|s>>12),i.push(128|s>>6&63),i.push(128|63&s)):(s=(1023&s)<<10,s|=1023&e.charCodeAt(++n),s+=65536,i.push(240|s>>18),i.push(128|s>>12&63),i.push(128|s>>6&63),i.push(128|63&s))}return l(3,i.length),f(i);default:var d;if(Array.isArray(e))for(l(4,d=e.length),n=0;n<d;++n)t(e[n]);else if(e instanceof Uint8Array)l(2,e.length),f(e);else{var p=Object.keys(e);for(l(5,d=p.length),n=0;n<d;++n){var y=p[n];t(y),t(e[y])}}}}(t),"slice"in n)return n.slice(0,a);for(var d=new ArrayBuffer(a),p=new DataView(d),y=0;y<a;++y)p.setUint8(y,s.getUint8(y));return d},decode:function(t,e,o){var s=new DataView(t),a=0;function u(t,e){return a+=e,t}function c(e){return u(new Uint8Array(t,a,e),e)}function h(){return u(s.getUint8(a),1)}function f(){return u(s.getUint16(a),2)}function l(){return u(s.getUint32(a),4)}function d(){return 255===s.getUint8(a)&&(a+=1,!0)}function p(t){if(t<24)return t;if(24===t)return h();if(25===t)return f();if(26===t)return l();if(27===t)return l()*i+l();if(31===t)return-1;throw"Invalid length encoding"}function y(t){var e=h();if(255===e)return-1;var r=p(31&e);if(r<0||e>>5!==t)throw"Invalid indefinite length element";return r}function v(t,e){for(var r=0;r<e;++r){var n=h();128&n&&(n<224?(n=(31&n)<<6|63&h(),e-=1):n<240?(n=(15&n)<<12|(63&h())<<6|63&h(),e-=2):(n=(15&n)<<18|(63&h())<<12|(63&h())<<6|63&h(),e-=3)),n<65536?t.push(n):(n-=65536,t.push(55296|n>>10),t.push(56320|1023&n))}}"function"!=typeof e&&(e=function(t){return t}),"function"!=typeof o&&(o=function(){return r});var g=function t(){var i,l,g=h(),m=g>>5,b=31&g;if(7===m)switch(b){case 25:return function(){var t=new ArrayBuffer(4),e=new DataView(t),r=f(),i=32768&r,o=31744&r,s=1023&r;if(31744===o)o=261120;else if(0!==o)o+=114688;else if(0!==s)return s*n;return e.setUint32(0,i<<16|o<<13|s<<13),e.getFloat32(0)}();case 26:return u(s.getFloat32(a),4);case 27:return u(s.getFloat64(a),8)}if((l=p(b))<0&&(m<2||6<m))throw"Invalid length";switch(m){case 0:return l;case 1:return-1-l;case 2:if(l<0){for(var w=[],_=0;(l=y(m))>=0;)_+=l,w.push(c(l));var A=new Uint8Array(_),x=0;for(i=0;i<w.length;++i)A.set(w[i],x),x+=w[i].length;return A}return c(l);case 3:var E=[];if(l<0)for(;(l=y(m))>=0;)v(E,l);else v(E,l);return String.fromCharCode.apply(null,E);case 4:var k;if(l<0)for(k=[];!d();)k.push(t());else for(k=new Array(l),i=0;i<l;++i)k[i]=t();return k;case 5:var S={};for(i=0;i<l||l<0&&!d();++i)S[t()]=t();return S;case 6:return e(t(),l);case 7:switch(l){case 20:return!1;case 21:return!0;case 22:return null;case 23:return r;default:return o(l)}}}();if(a!==t.byteLength)throw"Remaining bytes";return g}};void 0!==e&&e.exports?e.exports=s:t.CBOR||(t.CBOR=s)}(this)},{}],6:[function(t,e,r){const n=t("../cjs/crc1").default;e.exports=n,e.exports.default=n},{"../cjs/crc1":31}],7:[function(t,e,r){const n=t("../cjs/crc16").default;e.exports=n,e.exports.default=n},{"../cjs/crc16":32}],8:[function(t,e,r){const n=t("../cjs/crc16ccitt").default;e.exports=n,e.exports.default=n},{"../cjs/crc16ccitt":33}],9:[function(t,e,r){const n=t("../cjs/crc16kermit").default;e.exports=n,e.exports.default=n},{"../cjs/crc16kermit":34}],10:[function(t,e,r){const n=t("../cjs/crc16modbus").default;e.exports=n,e.exports.default=n},{"../cjs/crc16modbus":35}],11:[function(t,e,r){const n=t("../cjs/crc16xmodem").default;e.exports=n,e.exports.default=n},{"../cjs/crc16xmodem":36}],12:[function(t,e,r){const n=t("../cjs/crc24").default;e.exports=n,e.exports.default=n},{"../cjs/crc24":37}],13:[function(t,e,r){const n=t("../cjs/crc32").default;e.exports=n,e.exports.default=n},{"../cjs/crc32":38}],14:[function(t,e,r){const n=t("../cjs/crc32mpeg2").default;e.exports=n,e.exports.default=n},{"../cjs/crc32mpeg2":39}],15:[function(t,e,r){const n=t("../cjs/crc8").default;e.exports=n,e.exports.default=n},{"../cjs/crc8":40}],16:[function(t,e,r){const n=t("../cjs/crc81wire").default;e.exports=n,e.exports.default=n},{"../cjs/crc81wire":41}],17:[function(t,e,r){const n=t("../cjs/crcjam").default;e.exports=n,e.exports.default=n},{"../cjs/crcjam":42}],18:[function(t,e,r){e.exports={crc1:t("./crc1"),crc8:t("./crc8"),crc81wire:t("./crc81wire"),crc16:t("./crc16"),crc16ccitt:t("./crc16ccitt"),crc16modbus:t("./crc16modbus"),crc16xmodem:t("./crc16xmodem"),crc16kermit:t("./crc16kermit"),crc24:t("./crc24"),crc32:t("./crc32"),crc32mpeg:t("./crc32mpeg2"),crcjam:t("./crcjam")},e.exports.default=e.exports},{"./crc1":6,"./crc16":7,"./crc16ccitt":8,"./crc16kermit":9,"./crc16modbus":10,"./crc16xmodem":11,"./crc24":12,"./crc32":13,"./crc32mpeg2":14,"./crc8":15,"./crc81wire":16,"./crcjam":17}],19:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.default=((t,e=0)=>{let r=~~e,n=0;for(let e=0;e<t.length;e++)n+=t[e];return(r+=n%256)%256})},{}],20:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];"undefined"!=typeof Int32Array&&(n=new Int32Array(n));r.default=((t,e=0)=>{let r=~~e;for(let e=0;e<t.length;e++)r=65535&(n[255&(r^t[e])]^r>>8);return r})},{}],21:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920];"undefined"!=typeof Int32Array&&(n=new Int32Array(n));r.default=((t,e)=>{let r=void 0!==e?~~e:65535;for(let e=0;e<t.length;e++)r=65535&(n[255&(r>>8^t[e])]^r<<8);return r})},{}],22:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=[0,4489,8978,12955,17956,22445,25910,29887,35912,40385,44890,48851,51820,56293,59774,63735,4225,264,13203,8730,22181,18220,30135,25662,40137,36160,49115,44626,56045,52068,63999,59510,8450,12427,528,5017,26406,30383,17460,21949,44362,48323,36440,40913,60270,64231,51324,55797,12675,8202,4753,792,30631,26158,21685,17724,48587,44098,40665,36688,64495,60006,55549,51572,16900,21389,24854,28831,1056,5545,10034,14011,52812,57285,60766,64727,34920,39393,43898,47859,21125,17164,29079,24606,5281,1320,14259,9786,57037,53060,64991,60502,39145,35168,48123,43634,25350,29327,16404,20893,9506,13483,1584,6073,61262,65223,52316,56789,43370,47331,35448,39921,29575,25102,20629,16668,13731,9258,5809,1848,65487,60998,56541,52564,47595,43106,39673,35696,33800,38273,42778,46739,49708,54181,57662,61623,2112,6601,11090,15067,20068,24557,28022,31999,38025,34048,47003,42514,53933,49956,61887,57398,6337,2376,15315,10842,24293,20332,32247,27774,42250,46211,34328,38801,58158,62119,49212,53685,10562,14539,2640,7129,28518,32495,19572,24061,46475,41986,38553,34576,62383,57894,53437,49460,14787,10314,6865,2904,32743,28270,23797,19836,50700,55173,58654,62615,32808,37281,41786,45747,19012,23501,26966,30943,3168,7657,12146,16123,54925,50948,62879,58390,37033,33056,46011,41522,23237,19276,31191,26718,7393,3432,16371,11898,59150,63111,50204,54677,41258,45219,33336,37809,27462,31439,18516,23005,11618,15595,3696,8185,63375,58886,54429,50452,45483,40994,37561,33584,31687,27214,22741,18780,15843,11370,7921,3960];"undefined"!=typeof Int32Array&&(n=new Int32Array(n));r.default=((t,e)=>{let r=void 0!==e?~~e:0;for(let e=0;e<t.length;e++)r=65535&(n[255&(r^t[e])]^r>>8);return r})},{}],23:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];"undefined"!=typeof Int32Array&&(n=new Int32Array(n));r.default=((t,e)=>{let r=void 0!==e?~~e:65535;for(let e=0;e<t.length;e++)r=65535&(n[255&(r^t[e])]^r>>8);return r})},{}],24:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.default=((t,e)=>{let r=void 0!==e?~~e:0;for(let e=0;e<t.length;e++){let n=r>>>8&255;n^=255&t[e],r=r<<8&65535,r^=n^=n>>>4,r^=n=n<<5&65535,r^=n=n<<7&65535}return r})},{}],25:[func