@argent/x-shared 1.79.2 → 1.79.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- var e=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,t=Math.ceil,n=Math.floor,r=`[BigNumber Error] `,i=r+`Number primitive has more than 15 significant digits: `,a=0x5af3107a4000,o=14,s=9007199254740991,c=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,0xe8d4a51000,0x9184e72a000],l=1e7,u=1e9;function d(y){var b,x,S,C=L.prototype={constructor:L,toString:null,valueOf:null},w=new L(1),T=20,E=4,D=-7,O=21,k=-1e7,A=1e7,j=!1,M=1,N=0,P={prefix:``,groupSize:3,secondaryGroupSize:0,groupSeparator:`,`,decimalSeparator:`.`,fractionGroupSize:0,fractionGroupSeparator:`\xA0`,suffix:``},F=`0123456789abcdefghijklmnopqrstuvwxyz`,I=!0;function L(t,r){var a,c,l,u,d,f,p,m,g=this;if(!(g instanceof L))return new L(t,r);if(r==null){if(t&&t._isBigNumber===!0){g.s=t.s,!t.c||t.e>A?g.c=g.e=null:t.e<k?g.c=[g.e=0]:(g.e=t.e,g.c=t.c.slice());return}if((f=typeof t==`number`)&&t*0==0){if(g.s=1/t<0?(t=-t,-1):1,t===~~t){for(u=0,d=t;d>=10;d/=10,u++);u>A?g.c=g.e=null:(g.e=u,g.c=[t]);return}m=String(t)}else{if(!e.test(m=String(t)))return S(g,m,f);g.s=m.charCodeAt(0)==45?(m=m.slice(1),-1):1}(u=m.indexOf(`.`))>-1&&(m=m.replace(`.`,``)),(d=m.search(/e/i))>0?(u<0&&(u=d),u+=+m.slice(d+1),m=m.substring(0,d)):u<0&&(u=m.length)}else{if(h(r,2,F.length,`Base`),r==10&&I)return g=new L(t),V(g,T+g.e+1,E);if(m=String(t),f=typeof t==`number`){if(t*0!=0)return S(g,m,f,r);if(g.s=1/t<0?(m=m.slice(1),-1):1,L.DEBUG&&m.replace(/^0\.0*|\./,``).length>15)throw Error(i+t)}else g.s=m.charCodeAt(0)===45?(m=m.slice(1),-1):1;for(a=F.slice(0,r),u=d=0,p=m.length;d<p;d++)if(a.indexOf(c=m.charAt(d))<0){if(c==`.`){if(d>u){u=p;continue}}else if(!l&&(m==m.toUpperCase()&&(m=m.toLowerCase())||m==m.toLowerCase()&&(m=m.toUpperCase()))){l=!0,d=-1,u=0;continue}return S(g,String(t),f,r)}f=!1,m=x(m,r,10,g.s),(u=m.indexOf(`.`))>-1?m=m.replace(`.`,``):u=m.length}for(d=0;m.charCodeAt(d)===48;d++);for(p=m.length;m.charCodeAt(--p)===48;);if(m=m.slice(d,++p)){if(p-=d,f&&L.DEBUG&&p>15&&(t>s||t!==n(t)))throw Error(i+g.s*t);if((u=u-d-1)>A)g.c=g.e=null;else if(u<k)g.c=[g.e=0];else{if(g.e=u,g.c=[],d=(u+1)%o,u<0&&(d+=o),d<p){for(d&&g.c.push(+m.slice(0,d)),p-=o;d<p;)g.c.push(+m.slice(d,d+=o));d=o-(m=m.slice(d)).length}else d-=p;for(;d--;m+=`0`);g.c.push(+m)}}else g.c=[g.e=0]}L.clone=d,L.ROUND_UP=0,L.ROUND_DOWN=1,L.ROUND_CEIL=2,L.ROUND_FLOOR=3,L.ROUND_HALF_UP=4,L.ROUND_HALF_DOWN=5,L.ROUND_HALF_EVEN=6,L.ROUND_HALF_CEIL=7,L.ROUND_HALF_FLOOR=8,L.EUCLID=9,L.config=L.set=function(e){var t,n;if(e!=null)if(typeof e==`object`){if(e.hasOwnProperty(t=`DECIMAL_PLACES`)&&(n=e[t],h(n,0,u,t),T=n),e.hasOwnProperty(t=`ROUNDING_MODE`)&&(n=e[t],h(n,0,8,t),E=n),e.hasOwnProperty(t=`EXPONENTIAL_AT`)&&(n=e[t],n&&n.pop?(h(n[0],-u,0,t),h(n[1],0,u,t),D=n[0],O=n[1]):(h(n,-u,u,t),D=-(O=n<0?-n:n))),e.hasOwnProperty(t=`RANGE`))if(n=e[t],n&&n.pop)h(n[0],-u,-1,t),h(n[1],1,u,t),k=n[0],A=n[1];else if(h(n,-u,u,t),n)k=-(A=n<0?-n:n);else throw Error(r+t+` cannot be zero: `+n);if(e.hasOwnProperty(t=`CRYPTO`))if(n=e[t],n===!!n)if(n)if(typeof crypto<`u`&&crypto&&(crypto.getRandomValues||crypto.randomBytes))j=n;else throw j=!n,Error(r+`crypto unavailable`);else j=n;else throw Error(r+t+` not true or false: `+n);if(e.hasOwnProperty(t=`MODULO_MODE`)&&(n=e[t],h(n,0,9,t),M=n),e.hasOwnProperty(t=`POW_PRECISION`)&&(n=e[t],h(n,0,u,t),N=n),e.hasOwnProperty(t=`FORMAT`))if(n=e[t],typeof n==`object`)P=n;else throw Error(r+t+` not an object: `+n);if(e.hasOwnProperty(t=`ALPHABET`))if(n=e[t],typeof n==`string`&&!/^.?$|[+\-.\s]|(.).*\1/.test(n))I=n.slice(0,10)==`0123456789`,F=n;else throw Error(r+t+` invalid: `+n)}else throw Error(r+`Object expected: `+e);return{DECIMAL_PLACES:T,ROUNDING_MODE:E,EXPONENTIAL_AT:[D,O],RANGE:[k,A],CRYPTO:j,MODULO_MODE:M,POW_PRECISION:N,FORMAT:P,ALPHABET:F}},L.isBigNumber=function(e){if(!e||e._isBigNumber!==!0)return!1;if(!L.DEBUG)return!0;var t,i,s=e.c,c=e.e,l=e.s;out:if({}.toString.call(s)==`[object Array]`){if((l===1||l===-1)&&c>=-u&&c<=u&&c===n(c)){if(s[0]===0){if(c===0&&s.length===1)return!0;break out}if(t=(c+1)%o,t<1&&(t+=o),String(s[0]).length==t){for(t=0;t<s.length;t++)if(i=s[t],i<0||i>=a||i!==n(i))break out;if(i!==0)return!0}}}else if(s===null&&c===null&&(l===null||l===1||l===-1))return!0;throw Error(r+`Invalid BigNumber: `+e)},L.maximum=L.max=function(){return z(arguments,-1)},L.minimum=L.min=function(){return z(arguments,1)},L.random=(function(){var e=9007199254740992,i=Math.random()*e&2097151?function(){return n(Math.random()*e)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(e){var a,s,l,d,f,p=0,m=[],g=new L(w);if(e==null?e=T:h(e,0,u),d=t(e/o),j)if(crypto.getRandomValues){for(a=crypto.getRandomValues(new Uint32Array(d*=2));p<d;)f=a[p]*131072+(a[p+1]>>>11),f>=9e15?(s=crypto.getRandomValues(new Uint32Array(2)),a[p]=s[0],a[p+1]=s[1]):(m.push(f%0x5af3107a4000),p+=2);p=d/2}else if(crypto.randomBytes){for(a=crypto.randomBytes(d*=7);p<d;)f=(a[p]&31)*281474976710656+a[p+1]*1099511627776+a[p+2]*4294967296+a[p+3]*16777216+(a[p+4]<<16)+(a[p+5]<<8)+a[p+6],f>=9e15?crypto.randomBytes(7).copy(a,p):(m.push(f%0x5af3107a4000),p+=7);p=d/7}else throw j=!1,Error(r+`crypto unavailable`);if(!j)for(;p<d;)f=i(),f<9e15&&(m[p++]=f%0x5af3107a4000);for(d=m[--p],e%=o,d&&e&&(f=c[o-e],m[p]=n(d/f)*f);m[p]===0;m.pop(),p--);if(p<0)m=[l=0];else{for(l=-1;m[0]===0;m.splice(0,1),l-=o);for(p=1,f=m[0];f>=10;f/=10,p++);p<o&&(l-=o-p)}return g.e=l,g.c=m,g}})(),L.sum=function(){for(var e=1,t=arguments,n=new L(t[0]);e<t.length;)n=n.plus(t[e++]);return n},x=(function(){var e=`0123456789`;function t(e,t,n,r){for(var i,a=[0],o,s=0,c=e.length;s<c;){for(o=a.length;o--;a[o]*=t);for(a[0]+=r.indexOf(e.charAt(s++)),i=0;i<a.length;i++)a[i]>n-1&&(a[i+1]??(a[i+1]=0),a[i+1]+=a[i]/n|0,a[i]%=n)}return a.reverse()}return function(n,r,i,a,o){var s,c,l,u,d,f,m,h,g=n.indexOf(`.`),_=T,y=E;for(g>=0&&(u=N,N=0,n=n.replace(`.`,``),h=new L(r),f=h.pow(n.length-g),N=u,h.c=t(v(p(f.c),f.e,`0`),10,i,e),h.e=h.c.length),m=t(n,r,i,o?(s=F,e):(s=e,F)),l=u=m.length;m[--u]==0;m.pop());if(!m[0])return s.charAt(0);if(g<0?--l:(f.c=m,f.e=l,f.s=a,f=b(f,h,_,y,i),m=f.c,d=f.r,l=f.e),c=l+_+1,g=m[c],u=i/2,d=d||c<0||m[c+1]!=null,d=y<4?(g!=null||d)&&(y==0||y==(f.s<0?3:2)):g>u||g==u&&(y==4||d||y==6&&m[c-1]&1||y==(f.s<0?8:7)),c<1||!m[0])n=d?v(s.charAt(1),-_,s.charAt(0)):s.charAt(0);else{if(m.length=c,d)for(--i;++m[--c]>i;)m[c]=0,c||(++l,m=[1].concat(m));for(u=m.length;!m[--u];);for(g=0,n=``;g<=u;n+=s.charAt(m[g++]));n=v(n,l,s.charAt(0))}return n}})(),b=(function(){function e(e,t,n){var r,i,a,o,s=0,c=e.length,u=t%l,d=t/l|0;for(e=e.slice();c--;)a=e[c]%l,o=e[c]/l|0,r=d*a+o*u,i=u*a+r%l*l+s,s=(i/n|0)+(r/l|0)+d*o,e[c]=i%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function r(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(i,s,c,l,u){var d,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k=i.s==s.s?1:-1,A=i.c,j=s.c;if(!A||!A[0]||!j||!j[0])return new L(!i.s||!s.s||(A?j&&A[0]==j[0]:!j)?NaN:A&&A[0]==0||!j?k*0:k/0);for(y=new L(k),b=y.c=[],p=i.e-s.e,k=c+p+1,u||(u=a,p=f(i.e/o)-f(s.e/o),k=k/o|0),m=0;j[m]==(A[m]||0);m++);if(j[m]>(A[m]||0)&&p--,k<0)b.push(1),h=!0;else{for(T=A.length,D=j.length,m=0,k+=2,g=n(u/(j[0]+1)),g>1&&(j=e(j,g,u),A=e(A,g,u),D=j.length,T=A.length),w=D,x=A.slice(0,D),S=x.length;S<D;x[S++]=0);O=j.slice(),O=[0].concat(O),E=j[0],j[1]>=u/2&&E++;do{if(g=0,d=t(j,x,D,S),d<0){if(C=x[0],D!=S&&(C=C*u+(x[1]||0)),g=n(C/E),g>1)for(g>=u&&(g=u-1),_=e(j,g,u),v=_.length,S=x.length;t(_,x,v,S)==1;)g--,r(_,D<v?O:j,v,u),v=_.length,d=1;else g==0&&(d=g=1),_=j.slice(),v=_.length;if(v<S&&(_=[0].concat(_)),r(x,_,S,u),S=x.length,d==-1)for(;t(j,x,D,S)<1;)g++,r(x,D<S?O:j,S,u),S=x.length}else d===0&&(g++,x=[0]);b[m++]=g,x[0]?x[S++]=A[w]||0:(x=[A[w]],S=1)}while((w++<T||x[0]!=null)&&k--);h=x[0]!=null,b[0]||b.splice(0,1)}if(u==a){for(m=1,k=b[0];k>=10;k/=10,m++);V(y,c+(y.e=m+p*o-1)+1,l,h)}else y.e=p,y.r=+h;return y}})();function R(e,t,n,r){var i,a,o,s,c;if(n==null?n=E:h(n,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,t==null)c=p(e.c),c=r==1||r==2&&(o<=D||o>=O)?_(c,o):v(c,o,`0`);else if(e=V(new L(e),t,n),a=e.e,c=p(e.c),s=c.length,r==1||r==2&&(t<=a||a<=D)){for(;s<t;c+=`0`,s++);c=_(c,a)}else if(t-=o,c=v(c,a,`0`),a+1>s){if(--t>0)for(c+=`.`;t--;c+=`0`);}else if(t+=a-s,t>0)for(a+1==s&&(c+=`.`);t--;c+=`0`);return e.s<0&&i?`-`+c:c}function z(e,t){for(var n,r,i=1,a=new L(e[0]);i<e.length;i++)r=new L(e[i]),(!r.s||(n=m(a,r))===t||n===0&&a.s===t)&&(a=r);return a}function B(e,t,n){for(var r=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,r++);return(n=r+n*o-1)>A?e.c=e.e=null:n<k?e.c=[e.e=0]:(e.e=n,e.c=t),e}S=(function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,t=/^([^.]+)\.$/,n=/^\.([^.]+)$/,i=/^-?(Infinity|NaN)$/,a=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(o,s,c,l){var u,d=c?s:s.replace(a,``);if(i.test(d))o.s=isNaN(d)?null:d<0?-1:1;else{if(!c&&(d=d.replace(e,function(e,t,n){return u=(n=n.toLowerCase())==`x`?16:n==`b`?2:8,!l||l==u?t:e}),l&&(u=l,d=d.replace(t,`$1`).replace(n,`0.$1`)),s!=d))return new L(d,u);if(L.DEBUG)throw Error(r+`Not a`+(l?` base `+l:``)+` number: `+s);o.s=null}o.c=o.e=null}})();function V(e,r,i,s){var l,u,d,f,p,m,h,g=e.c,_=c;if(g){out:{for(l=1,f=g[0];f>=10;f/=10,l++);if(u=r-l,u<0)u+=o,d=r,p=g[m=0],h=n(p/_[l-d-1]%10);else if(m=t((u+1)/o),m>=g.length)if(s){for(;g.length<=m;g.push(0));p=h=0,l=1,u%=o,d=u-o+1}else break out;else{for(p=f=g[m],l=1;f>=10;f/=10,l++);u%=o,d=u-o+l,h=d<0?0:n(p/_[l-d-1]%10)}if(s=s||r<0||g[m+1]!=null||(d<0?p:p%_[l-d-1]),s=i<4?(h||s)&&(i==0||i==(e.s<0?3:2)):h>5||h==5&&(i==4||s||i==6&&(u>0?d>0?p/_[l-d]:0:g[m-1])%10&1||i==(e.s<0?8:7)),r<1||!g[0])return g.length=0,s?(r-=e.e+1,g[0]=_[(o-r%o)%o],e.e=-r||0):g[0]=e.e=0,e;if(u==0?(g.length=m,f=1,m--):(g.length=m+1,f=_[o-u],g[m]=d>0?n(p/_[l-d]%_[d])*f:0),s)for(;;)if(m==0){for(u=1,d=g[0];d>=10;d/=10,u++);for(d=g[0]+=f,f=1;d>=10;d/=10,f++);u!=f&&(e.e++,g[0]==a&&(g[0]=1));break}else{if(g[m]+=f,g[m]!=a)break;g[m--]=0,f=1}for(u=g.length;g[--u]===0;g.pop());}e.e>A?e.c=e.e=null:e.e<k&&(e.c=[e.e=0])}return e}function H(e){var t,n=e.e;return n===null?e.toString():(t=p(e.c),t=n<=D||n>=O?_(t,n):v(t,n,`0`),e.s<0?`-`+t:t)}return C.absoluteValue=C.abs=function(){var e=new L(this);return e.s<0&&(e.s=1),e},C.comparedTo=function(e,t){return m(this,new L(e,t))},C.decimalPlaces=C.dp=function(e,t){var n,r,i,a=this;if(e!=null)return h(e,0,u),t==null?t=E:h(t,0,8),V(new L(a),e+a.e+1,t);if(!(n=a.c))return null;if(r=((i=n.length-1)-f(this.e/o))*o,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},C.dividedBy=C.div=function(e,t){return b(this,new L(e,t),T,E)},C.dividedToIntegerBy=C.idiv=function(e,t){return b(this,new L(e,t),0,1)},C.exponentiatedBy=C.pow=function(e,i){var a,s,c,l,u,d,f,p,m,h=this;if(e=new L(e),e.c&&!e.isInteger())throw Error(r+`Exponent not an integer: `+H(e));if(i!=null&&(i=new L(i)),d=e.e>14,!h.c||!h.c[0]||h.c[0]==1&&!h.e&&h.c.length==1||!e.c||!e.c[0])return m=new L(H(h)**(d?e.s*(2-g(e)):+H(e))),i?m.mod(i):m;if(f=e.s<0,i){if(i.c?!i.c[0]:!i.s)return new L(NaN);s=!f&&h.isInteger()&&i.isInteger(),s&&(h=h.mod(i))}else if(e.e>9&&(h.e>0||h.e<-1||(h.e==0?h.c[0]>1||d&&h.c[1]>=24e7:h.c[0]<8e13||d&&h.c[0]<=9999975e7)))return l=h.s<0&&g(e)?-0:0,h.e>-1&&(l=1/l),new L(f?1/l:l);else N&&(l=t(N/o+2));for(d?(a=new L(.5),f&&(e.s=1),p=g(e)):(c=Math.abs(+H(e)),p=c%2),m=new L(w);;){if(p){if(m=m.times(h),!m.c)break;l?m.c.length>l&&(m.c.length=l):s&&(m=m.mod(i))}if(c){if(c=n(c/2),c===0)break;p=c%2}else if(e=e.times(a),V(e,e.e+1,1),e.e>14)p=g(e);else{if(c=+H(e),c===0)break;p=c%2}h=h.times(h),l?h.c&&h.c.length>l&&(h.c.length=l):s&&(h=h.mod(i))}return s?m:(f&&(m=w.div(m)),i?m.mod(i):l?V(m,N,E,u):m)},C.integerValue=function(e){var t=new L(this);return e==null?e=E:h(e,0,8),V(t,t.e+1,e)},C.isEqualTo=C.eq=function(e,t){return m(this,new L(e,t))===0},C.isFinite=function(){return!!this.c},C.isGreaterThan=C.gt=function(e,t){return m(this,new L(e,t))>0},C.isGreaterThanOrEqualTo=C.gte=function(e,t){return(t=m(this,new L(e,t)))===1||t===0},C.isInteger=function(){return!!this.c&&f(this.e/o)>this.c.length-2},C.isLessThan=C.lt=function(e,t){return m(this,new L(e,t))<0},C.isLessThanOrEqualTo=C.lte=function(e,t){return(t=m(this,new L(e,t)))===-1||t===0},C.isNaN=function(){return!this.s},C.isNegative=function(){return this.s<0},C.isPositive=function(){return this.s>0},C.isZero=function(){return!!this.c&&this.c[0]==0},C.minus=function(e,t){var n,r,i,s,c=this,l=c.s;if(e=new L(e,t),t=e.s,!l||!t)return new L(NaN);if(l!=t)return e.s=-t,c.plus(e);var u=c.e/o,d=e.e/o,p=c.c,m=e.c;if(!u||!d){if(!p||!m)return p?(e.s=-t,e):new L(m?c:NaN);if(!p[0]||!m[0])return m[0]?(e.s=-t,e):new L(p[0]?c:E==3?-0:0)}if(u=f(u),d=f(d),p=p.slice(),l=u-d){for((s=l<0)?(l=-l,i=p):(d=u,i=m),i.reverse(),t=l;t--;i.push(0));i.reverse()}else for(r=(s=(l=p.length)<(t=m.length))?l:t,l=t=0;t<r;t++)if(p[t]!=m[t]){s=p[t]<m[t];break}if(s&&(i=p,p=m,m=i,e.s=-e.s),t=(r=m.length)-(n=p.length),t>0)for(;t--;p[n++]=0);for(t=a-1;r>l;){if(p[--r]<m[r]){for(n=r;n&&!p[--n];p[n]=t);--p[n],p[r]+=a}p[r]-=m[r]}for(;p[0]==0;p.splice(0,1),--d);return p[0]?B(e,p,d):(e.s=E==3?-1:1,e.c=[e.e=0],e)},C.modulo=C.mod=function(e,t){var n,r,i=this;return e=new L(e,t),!i.c||!e.s||e.c&&!e.c[0]?new L(NaN):!e.c||i.c&&!i.c[0]?new L(i):(M==9?(r=e.s,e.s=1,n=b(i,e,0,3),e.s=r,n.s*=r):n=b(i,e,0,M),e=i.minus(n.times(e)),!e.c[0]&&M==1&&(e.s=i.s),e)},C.multipliedBy=C.times=function(e,t){var n,r,i,s,c,u,d,p,m,h,g,_,v,y,b,x=this,S=x.c,C=(e=new L(e,t)).c;if(!S||!C||!S[0]||!C[0])return!x.s||!e.s||S&&!S[0]&&!C||C&&!C[0]&&!S?e.c=e.e=e.s=null:(e.s*=x.s,!S||!C?e.c=e.e=null:(e.c=[0],e.e=0)),e;for(r=f(x.e/o)+f(e.e/o),e.s*=x.s,d=S.length,h=C.length,d<h&&(v=S,S=C,C=v,i=d,d=h,h=i),i=d+h,v=[];i--;v.push(0));for(y=a,b=l,i=h;--i>=0;){for(n=0,g=C[i]%b,_=C[i]/b|0,c=d,s=i+c;s>i;)p=S[--c]%b,m=S[c]/b|0,u=_*p+m*g,p=g*p+u%b*b+v[s]+n,n=(p/y|0)+(u/b|0)+_*m,v[s--]=p%y;v[s]=n}return n?++r:v.splice(0,1),B(e,v,r)},C.negated=function(){var e=new L(this);return e.s=-e.s||null,e},C.plus=function(e,t){var n,r=this,i=r.s;if(e=new L(e,t),t=e.s,!i||!t)return new L(NaN);if(i!=t)return e.s=-t,r.minus(e);var s=r.e/o,c=e.e/o,l=r.c,u=e.c;if(!s||!c){if(!l||!u)return new L(i/0);if(!l[0]||!u[0])return u[0]?e:new L(l[0]?r:i*0)}if(s=f(s),c=f(c),l=l.slice(),i=s-c){for(i>0?(c=s,n=u):(i=-i,n=l),n.reverse();i--;n.push(0));n.reverse()}for(i=l.length,t=u.length,i-t<0&&(n=u,u=l,l=n,t=i),i=0;t;)i=(l[--t]=l[t]+u[t]+i)/a|0,l[t]=a===l[t]?0:l[t]%a;return i&&(l=[i].concat(l),++c),B(e,l,c)},C.precision=C.sd=function(e,t){var n,r,i,a=this;if(e!=null&&e!==!!e)return h(e,1,u),t==null?t=E:h(t,0,8),V(new L(a),e,t);if(!(n=a.c))return null;if(i=n.length-1,r=i*o+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return e&&a.e+1>r&&(r=a.e+1),r},C.shiftedBy=function(e){return h(e,-s,s),this.times(`1e`+e)},C.squareRoot=C.sqrt=function(){var e,t,n,r,i,a=this,o=a.c,s=a.s,c=a.e,l=T+4,u=new L(`0.5`);if(s!==1||!o||!o[0])return new L(!s||s<0&&(!o||o[0])?NaN:o?a:1/0);if(s=Math.sqrt(+H(a)),s==0||s==1/0?(t=p(o),(t.length+c)%2==0&&(t+=`0`),s=Math.sqrt(+t),c=f((c+1)/2)-(c<0||c%2),s==1/0?t=`5e`+c:(t=s.toExponential(),t=t.slice(0,t.indexOf(`e`)+1)+c),n=new L(t)):n=new L(s+``),n.c[0]){for(c=n.e,s=c+l,s<3&&(s=0);;)if(i=n,n=u.times(i.plus(b(a,i,l,1))),p(i.c).slice(0,s)===(t=p(n.c)).slice(0,s))if(n.e<c&&--s,t=t.slice(s-3,s+1),t==`9999`||!r&&t==`4999`){if(!r&&(V(i,i.e+T+2,0),i.times(i).eq(a))){n=i;break}l+=4,s+=4,r=1}else{(!+t||!+t.slice(1)&&t.charAt(0)==`5`)&&(V(n,n.e+T+2,1),e=!n.times(n).eq(a));break}}return V(n,n.e+T+1,E,e)},C.toExponential=function(e,t){return e!=null&&(h(e,0,u),e++),R(this,e,t,1)},C.toFixed=function(e,t){return e!=null&&(h(e,0,u),e=e+this.e+1),R(this,e,t)},C.toFormat=function(e,t,n){var i,a=this;if(n==null)e!=null&&t&&typeof t==`object`?(n=t,t=null):e&&typeof e==`object`?(n=e,e=t=null):n=P;else if(typeof n!=`object`)throw Error(r+`Argument not an object: `+n);if(i=a.toFixed(e,t),a.c){var o,s=i.split(`.`),c=+n.groupSize,l=+n.secondaryGroupSize,u=n.groupSeparator||``,d=s[0],f=s[1],p=a.s<0,m=p?d.slice(1):d,h=m.length;if(l&&(o=c,c=l,l=o,h-=o),c>0&&h>0){for(o=h%c||c,d=m.substr(0,o);o<h;o+=c)d+=u+m.substr(o,c);l>0&&(d+=u+m.slice(o)),p&&(d=`-`+d)}i=f?d+(n.decimalSeparator||``)+((l=+n.fractionGroupSize)?f.replace(RegExp(`\\d{`+l+`}\\B`,`g`),`$&`+(n.fractionGroupSeparator||``)):f):d}return(n.prefix||``)+i+(n.suffix||``)},C.toFraction=function(e){var t,n,i,a,s,l,u,d,f,m,h,g,_=this,v=_.c;if(e!=null&&(u=new L(e),!u.isInteger()&&(u.c||u.s!==1)||u.lt(w)))throw Error(r+`Argument `+(u.isInteger()?`out of range: `:`not an integer: `)+H(u));if(!v)return new L(_);for(t=new L(w),f=n=new L(w),i=d=new L(w),g=p(v),s=t.e=g.length-_.e-1,t.c[0]=c[(l=s%o)<0?o+l:l],e=!e||u.comparedTo(t)>0?s>0?t:f:u,l=A,A=1/0,u=new L(g),d.c[0]=0;m=b(u,t,0,1),a=n.plus(m.times(i)),a.comparedTo(e)!=1;)n=i,i=a,f=d.plus(m.times(a=f)),d=a,t=u.minus(m.times(a=t)),u=a;return a=b(e.minus(n),i,0,1),d=d.plus(a.times(f)),n=n.plus(a.times(i)),d.s=f.s=_.s,s*=2,h=b(f,i,s,E).minus(_).abs().comparedTo(b(d,n,s,E).minus(_).abs())<1?[f,i]:[d,n],A=l,h},C.toNumber=function(){return+H(this)},C.toPrecision=function(e,t){return e!=null&&h(e,1,u),R(this,e,t,2)},C.toString=function(e){var t,n=this,r=n.s,i=n.e;return i===null?r?(t=`Infinity`,r<0&&(t=`-`+t)):t=`NaN`:(e==null?t=i<=D||i>=O?_(p(n.c),i):v(p(n.c),i,`0`):e===10&&I?(n=V(new L(n),T+i+1,E),t=v(p(n.c),n.e,`0`)):(h(e,2,F.length,`Base`),t=x(v(p(n.c),i,`0`),10,e,r,!0)),r<0&&n.c[0]&&(t=`-`+t)),t},C.valueOf=C.toJSON=function(){return H(this)},C._isBigNumber=!0,C[Symbol.toStringTag]=`BigNumber`,C[Symbol.for(`nodejs.util.inspect.custom`)]=C.valueOf,y!=null&&L.set(y),L}function f(e){var t=e|0;return e>0||e===t?t:t-1}function p(e){for(var t,n,r=1,i=e.length,a=e[0]+``;r<i;){for(t=e[r++]+``,n=o-t.length;n--;t=`0`+t);a+=t}for(i=a.length;a.charCodeAt(--i)===48;);return a.slice(0,i+1||1)}function m(e,t){var n,r,i=e.c,a=t.c,o=e.s,s=t.s,c=e.e,l=t.e;if(!o||!s)return null;if(n=i&&!i[0],r=a&&!a[0],n||r)return n?r?0:-s:o;if(o!=s)return o;if(n=o<0,r=c==l,!i||!a)return r?0:!i^n?1:-1;if(!r)return c>l^n?1:-1;for(s=(c=i.length)<(l=a.length)?c:l,o=0;o<s;o++)if(i[o]!=a[o])return i[o]>a[o]^n?1:-1;return c==l?0:c>l^n?1:-1}function h(e,t,i,a){if(e<t||e>i||e!==n(e))throw Error(r+(a||`Argument`)+(typeof e==`number`?e<t||e>i?` out of range: `:` not an integer: `:` not a primitive number: `)+String(e))}function g(e){var t=e.c.length-1;return f(e.e/o)==t&&e.c[t]%2!=0}function _(e,t){return(e.length>1?e.charAt(0)+`.`+e.slice(1):e)+(t<0?`e`:`e+`)+t}function v(e,t,n){var r,i;if(t<0){for(i=n+`.`;++t;i+=n);e=i+e}else if(r=e.length,++t>r){for(i=n,t-=r;--t;i+=n);e+=i}else t<r&&(e=e.slice(0,t)+`.`+e.slice(t));return e}var y=d();exports.default=y;
@@ -1,527 +0,0 @@
1
- //#region node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.mjs
2
- var e = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, t = Math.ceil, n = Math.floor, r = "[BigNumber Error] ", i = r + "Number primitive has more than 15 significant digits: ", a = 0x5af3107a4000, o = 14, s = 9007199254740991, c = [
3
- 1,
4
- 10,
5
- 100,
6
- 1e3,
7
- 1e4,
8
- 1e5,
9
- 1e6,
10
- 1e7,
11
- 1e8,
12
- 1e9,
13
- 1e10,
14
- 1e11,
15
- 0xe8d4a51000,
16
- 0x9184e72a000
17
- ], l = 1e7, u = 1e9;
18
- function d(y) {
19
- var b, x, S, C = L.prototype = {
20
- constructor: L,
21
- toString: null,
22
- valueOf: null
23
- }, w = new L(1), T = 20, E = 4, D = -7, O = 21, k = -1e7, A = 1e7, j = !1, M = 1, N = 0, P = {
24
- prefix: "",
25
- groupSize: 3,
26
- secondaryGroupSize: 0,
27
- groupSeparator: ",",
28
- decimalSeparator: ".",
29
- fractionGroupSize: 0,
30
- fractionGroupSeparator: "\xA0",
31
- suffix: ""
32
- }, F = "0123456789abcdefghijklmnopqrstuvwxyz", I = !0;
33
- function L(t, r) {
34
- var a, c, l, u, d, f, p, m, g = this;
35
- if (!(g instanceof L)) return new L(t, r);
36
- if (r == null) {
37
- if (t && t._isBigNumber === !0) {
38
- g.s = t.s, !t.c || t.e > A ? g.c = g.e = null : t.e < k ? g.c = [g.e = 0] : (g.e = t.e, g.c = t.c.slice());
39
- return;
40
- }
41
- if ((f = typeof t == "number") && t * 0 == 0) {
42
- if (g.s = 1 / t < 0 ? (t = -t, -1) : 1, t === ~~t) {
43
- for (u = 0, d = t; d >= 10; d /= 10, u++);
44
- u > A ? g.c = g.e = null : (g.e = u, g.c = [t]);
45
- return;
46
- }
47
- m = String(t);
48
- } else {
49
- if (!e.test(m = String(t))) return S(g, m, f);
50
- g.s = m.charCodeAt(0) == 45 ? (m = m.slice(1), -1) : 1;
51
- }
52
- (u = m.indexOf(".")) > -1 && (m = m.replace(".", "")), (d = m.search(/e/i)) > 0 ? (u < 0 && (u = d), u += +m.slice(d + 1), m = m.substring(0, d)) : u < 0 && (u = m.length);
53
- } else {
54
- if (h(r, 2, F.length, "Base"), r == 10 && I) return g = new L(t), V(g, T + g.e + 1, E);
55
- if (m = String(t), f = typeof t == "number") {
56
- if (t * 0 != 0) return S(g, m, f, r);
57
- if (g.s = 1 / t < 0 ? (m = m.slice(1), -1) : 1, L.DEBUG && m.replace(/^0\.0*|\./, "").length > 15) throw Error(i + t);
58
- } else g.s = m.charCodeAt(0) === 45 ? (m = m.slice(1), -1) : 1;
59
- for (a = F.slice(0, r), u = d = 0, p = m.length; d < p; d++) if (a.indexOf(c = m.charAt(d)) < 0) {
60
- if (c == ".") {
61
- if (d > u) {
62
- u = p;
63
- continue;
64
- }
65
- } else if (!l && (m == m.toUpperCase() && (m = m.toLowerCase()) || m == m.toLowerCase() && (m = m.toUpperCase()))) {
66
- l = !0, d = -1, u = 0;
67
- continue;
68
- }
69
- return S(g, String(t), f, r);
70
- }
71
- f = !1, m = x(m, r, 10, g.s), (u = m.indexOf(".")) > -1 ? m = m.replace(".", "") : u = m.length;
72
- }
73
- for (d = 0; m.charCodeAt(d) === 48; d++);
74
- for (p = m.length; m.charCodeAt(--p) === 48;);
75
- if (m = m.slice(d, ++p)) {
76
- if (p -= d, f && L.DEBUG && p > 15 && (t > s || t !== n(t))) throw Error(i + g.s * t);
77
- if ((u = u - d - 1) > A) g.c = g.e = null;
78
- else if (u < k) g.c = [g.e = 0];
79
- else {
80
- if (g.e = u, g.c = [], d = (u + 1) % o, u < 0 && (d += o), d < p) {
81
- for (d && g.c.push(+m.slice(0, d)), p -= o; d < p;) g.c.push(+m.slice(d, d += o));
82
- d = o - (m = m.slice(d)).length;
83
- } else d -= p;
84
- for (; d--; m += "0");
85
- g.c.push(+m);
86
- }
87
- } else g.c = [g.e = 0];
88
- }
89
- L.clone = d, L.ROUND_UP = 0, L.ROUND_DOWN = 1, L.ROUND_CEIL = 2, L.ROUND_FLOOR = 3, L.ROUND_HALF_UP = 4, L.ROUND_HALF_DOWN = 5, L.ROUND_HALF_EVEN = 6, L.ROUND_HALF_CEIL = 7, L.ROUND_HALF_FLOOR = 8, L.EUCLID = 9, L.config = L.set = function(e) {
90
- var t, n;
91
- if (e != null) if (typeof e == "object") {
92
- if (e.hasOwnProperty(t = "DECIMAL_PLACES") && (n = e[t], h(n, 0, u, t), T = n), e.hasOwnProperty(t = "ROUNDING_MODE") && (n = e[t], h(n, 0, 8, t), E = n), e.hasOwnProperty(t = "EXPONENTIAL_AT") && (n = e[t], n && n.pop ? (h(n[0], -u, 0, t), h(n[1], 0, u, t), D = n[0], O = n[1]) : (h(n, -u, u, t), D = -(O = n < 0 ? -n : n))), e.hasOwnProperty(t = "RANGE")) if (n = e[t], n && n.pop) h(n[0], -u, -1, t), h(n[1], 1, u, t), k = n[0], A = n[1];
93
- else if (h(n, -u, u, t), n) k = -(A = n < 0 ? -n : n);
94
- else throw Error(r + t + " cannot be zero: " + n);
95
- if (e.hasOwnProperty(t = "CRYPTO")) if (n = e[t], n === !!n) if (n) if (typeof crypto < "u" && crypto && (crypto.getRandomValues || crypto.randomBytes)) j = n;
96
- else throw j = !n, Error(r + "crypto unavailable");
97
- else j = n;
98
- else throw Error(r + t + " not true or false: " + n);
99
- if (e.hasOwnProperty(t = "MODULO_MODE") && (n = e[t], h(n, 0, 9, t), M = n), e.hasOwnProperty(t = "POW_PRECISION") && (n = e[t], h(n, 0, u, t), N = n), e.hasOwnProperty(t = "FORMAT")) if (n = e[t], typeof n == "object") P = n;
100
- else throw Error(r + t + " not an object: " + n);
101
- if (e.hasOwnProperty(t = "ALPHABET")) if (n = e[t], typeof n == "string" && !/^.?$|[+\-.\s]|(.).*\1/.test(n)) I = n.slice(0, 10) == "0123456789", F = n;
102
- else throw Error(r + t + " invalid: " + n);
103
- } else throw Error(r + "Object expected: " + e);
104
- return {
105
- DECIMAL_PLACES: T,
106
- ROUNDING_MODE: E,
107
- EXPONENTIAL_AT: [D, O],
108
- RANGE: [k, A],
109
- CRYPTO: j,
110
- MODULO_MODE: M,
111
- POW_PRECISION: N,
112
- FORMAT: P,
113
- ALPHABET: F
114
- };
115
- }, L.isBigNumber = function(e) {
116
- if (!e || e._isBigNumber !== !0) return !1;
117
- if (!L.DEBUG) return !0;
118
- var t, i, s = e.c, c = e.e, l = e.s;
119
- out: if ({}.toString.call(s) == "[object Array]") {
120
- if ((l === 1 || l === -1) && c >= -u && c <= u && c === n(c)) {
121
- if (s[0] === 0) {
122
- if (c === 0 && s.length === 1) return !0;
123
- break out;
124
- }
125
- if (t = (c + 1) % o, t < 1 && (t += o), String(s[0]).length == t) {
126
- for (t = 0; t < s.length; t++) if (i = s[t], i < 0 || i >= a || i !== n(i)) break out;
127
- if (i !== 0) return !0;
128
- }
129
- }
130
- } else if (s === null && c === null && (l === null || l === 1 || l === -1)) return !0;
131
- throw Error(r + "Invalid BigNumber: " + e);
132
- }, L.maximum = L.max = function() {
133
- return z(arguments, -1);
134
- }, L.minimum = L.min = function() {
135
- return z(arguments, 1);
136
- }, L.random = (function() {
137
- var e = 9007199254740992, i = Math.random() * e & 2097151 ? function() {
138
- return n(Math.random() * e);
139
- } : function() {
140
- return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
141
- };
142
- return function(e) {
143
- var a, s, l, d, f, p = 0, m = [], g = new L(w);
144
- if (e == null ? e = T : h(e, 0, u), d = t(e / o), j) if (crypto.getRandomValues) {
145
- for (a = crypto.getRandomValues(new Uint32Array(d *= 2)); p < d;) f = a[p] * 131072 + (a[p + 1] >>> 11), f >= 9e15 ? (s = crypto.getRandomValues(new Uint32Array(2)), a[p] = s[0], a[p + 1] = s[1]) : (m.push(f % 0x5af3107a4000), p += 2);
146
- p = d / 2;
147
- } else if (crypto.randomBytes) {
148
- for (a = crypto.randomBytes(d *= 7); p < d;) f = (a[p] & 31) * 281474976710656 + a[p + 1] * 1099511627776 + a[p + 2] * 4294967296 + a[p + 3] * 16777216 + (a[p + 4] << 16) + (a[p + 5] << 8) + a[p + 6], f >= 9e15 ? crypto.randomBytes(7).copy(a, p) : (m.push(f % 0x5af3107a4000), p += 7);
149
- p = d / 7;
150
- } else throw j = !1, Error(r + "crypto unavailable");
151
- if (!j) for (; p < d;) f = i(), f < 9e15 && (m[p++] = f % 0x5af3107a4000);
152
- for (d = m[--p], e %= o, d && e && (f = c[o - e], m[p] = n(d / f) * f); m[p] === 0; m.pop(), p--);
153
- if (p < 0) m = [l = 0];
154
- else {
155
- for (l = -1; m[0] === 0; m.splice(0, 1), l -= o);
156
- for (p = 1, f = m[0]; f >= 10; f /= 10, p++);
157
- p < o && (l -= o - p);
158
- }
159
- return g.e = l, g.c = m, g;
160
- };
161
- })(), L.sum = function() {
162
- for (var e = 1, t = arguments, n = new L(t[0]); e < t.length;) n = n.plus(t[e++]);
163
- return n;
164
- }, x = (function() {
165
- var e = "0123456789";
166
- function t(e, t, n, r) {
167
- for (var i, a = [0], o, s = 0, c = e.length; s < c;) {
168
- for (o = a.length; o--; a[o] *= t);
169
- for (a[0] += r.indexOf(e.charAt(s++)), i = 0; i < a.length; i++) a[i] > n - 1 && (a[i + 1] ?? (a[i + 1] = 0), a[i + 1] += a[i] / n | 0, a[i] %= n);
170
- }
171
- return a.reverse();
172
- }
173
- return function(n, r, i, a, o) {
174
- var s, c, l, u, d, f, m, h, g = n.indexOf("."), _ = T, y = E;
175
- for (g >= 0 && (u = N, N = 0, n = n.replace(".", ""), h = new L(r), f = h.pow(n.length - g), N = u, h.c = t(v(p(f.c), f.e, "0"), 10, i, e), h.e = h.c.length), m = t(n, r, i, o ? (s = F, e) : (s = e, F)), l = u = m.length; m[--u] == 0; m.pop());
176
- if (!m[0]) return s.charAt(0);
177
- if (g < 0 ? --l : (f.c = m, f.e = l, f.s = a, f = b(f, h, _, y, i), m = f.c, d = f.r, l = f.e), c = l + _ + 1, g = m[c], u = i / 2, d = d || c < 0 || m[c + 1] != null, d = y < 4 ? (g != null || d) && (y == 0 || y == (f.s < 0 ? 3 : 2)) : g > u || g == u && (y == 4 || d || y == 6 && m[c - 1] & 1 || y == (f.s < 0 ? 8 : 7)), c < 1 || !m[0]) n = d ? v(s.charAt(1), -_, s.charAt(0)) : s.charAt(0);
178
- else {
179
- if (m.length = c, d) for (--i; ++m[--c] > i;) m[c] = 0, c || (++l, m = [1].concat(m));
180
- for (u = m.length; !m[--u];);
181
- for (g = 0, n = ""; g <= u; n += s.charAt(m[g++]));
182
- n = v(n, l, s.charAt(0));
183
- }
184
- return n;
185
- };
186
- })(), b = (function() {
187
- function e(e, t, n) {
188
- var r, i, a, o, s = 0, c = e.length, u = t % l, d = t / l | 0;
189
- for (e = e.slice(); c--;) a = e[c] % l, o = e[c] / l | 0, r = d * a + o * u, i = u * a + r % l * l + s, s = (i / n | 0) + (r / l | 0) + d * o, e[c] = i % n;
190
- return s && (e = [s].concat(e)), e;
191
- }
192
- function t(e, t, n, r) {
193
- var i, a;
194
- if (n != r) a = n > r ? 1 : -1;
195
- else for (i = a = 0; i < n; i++) if (e[i] != t[i]) {
196
- a = e[i] > t[i] ? 1 : -1;
197
- break;
198
- }
199
- return a;
200
- }
201
- function r(e, t, n, r) {
202
- for (var i = 0; n--;) e[n] -= i, i = e[n] < t[n] ? 1 : 0, e[n] = i * r + e[n] - t[n];
203
- for (; !e[0] && e.length > 1; e.splice(0, 1));
204
- }
205
- return function(i, s, c, l, u) {
206
- var d, p, m, h, g, _, v, y, b, x, S, C, w, T, E, D, O, k = i.s == s.s ? 1 : -1, A = i.c, j = s.c;
207
- if (!A || !A[0] || !j || !j[0]) return new L(!i.s || !s.s || (A ? j && A[0] == j[0] : !j) ? NaN : A && A[0] == 0 || !j ? k * 0 : k / 0);
208
- for (y = new L(k), b = y.c = [], p = i.e - s.e, k = c + p + 1, u || (u = a, p = f(i.e / o) - f(s.e / o), k = k / o | 0), m = 0; j[m] == (A[m] || 0); m++);
209
- if (j[m] > (A[m] || 0) && p--, k < 0) b.push(1), h = !0;
210
- else {
211
- for (T = A.length, D = j.length, m = 0, k += 2, g = n(u / (j[0] + 1)), g > 1 && (j = e(j, g, u), A = e(A, g, u), D = j.length, T = A.length), w = D, x = A.slice(0, D), S = x.length; S < D; x[S++] = 0);
212
- O = j.slice(), O = [0].concat(O), E = j[0], j[1] >= u / 2 && E++;
213
- do {
214
- if (g = 0, d = t(j, x, D, S), d < 0) {
215
- if (C = x[0], D != S && (C = C * u + (x[1] || 0)), g = n(C / E), g > 1) for (g >= u && (g = u - 1), _ = e(j, g, u), v = _.length, S = x.length; t(_, x, v, S) == 1;) g--, r(_, D < v ? O : j, v, u), v = _.length, d = 1;
216
- else g == 0 && (d = g = 1), _ = j.slice(), v = _.length;
217
- if (v < S && (_ = [0].concat(_)), r(x, _, S, u), S = x.length, d == -1) for (; t(j, x, D, S) < 1;) g++, r(x, D < S ? O : j, S, u), S = x.length;
218
- } else d === 0 && (g++, x = [0]);
219
- b[m++] = g, x[0] ? x[S++] = A[w] || 0 : (x = [A[w]], S = 1);
220
- } while ((w++ < T || x[0] != null) && k--);
221
- h = x[0] != null, b[0] || b.splice(0, 1);
222
- }
223
- if (u == a) {
224
- for (m = 1, k = b[0]; k >= 10; k /= 10, m++);
225
- V(y, c + (y.e = m + p * o - 1) + 1, l, h);
226
- } else y.e = p, y.r = +h;
227
- return y;
228
- };
229
- })();
230
- function R(e, t, n, r) {
231
- var i, a, o, s, c;
232
- if (n == null ? n = E : h(n, 0, 8), !e.c) return e.toString();
233
- if (i = e.c[0], o = e.e, t == null) c = p(e.c), c = r == 1 || r == 2 && (o <= D || o >= O) ? _(c, o) : v(c, o, "0");
234
- else if (e = V(new L(e), t, n), a = e.e, c = p(e.c), s = c.length, r == 1 || r == 2 && (t <= a || a <= D)) {
235
- for (; s < t; c += "0", s++);
236
- c = _(c, a);
237
- } else if (t -= o, c = v(c, a, "0"), a + 1 > s) {
238
- if (--t > 0) for (c += "."; t--; c += "0");
239
- } else if (t += a - s, t > 0) for (a + 1 == s && (c += "."); t--; c += "0");
240
- return e.s < 0 && i ? "-" + c : c;
241
- }
242
- function z(e, t) {
243
- for (var n, r, i = 1, a = new L(e[0]); i < e.length; i++) r = new L(e[i]), (!r.s || (n = m(a, r)) === t || n === 0 && a.s === t) && (a = r);
244
- return a;
245
- }
246
- function B(e, t, n) {
247
- for (var r = 1, i = t.length; !t[--i]; t.pop());
248
- for (i = t[0]; i >= 10; i /= 10, r++);
249
- return (n = r + n * o - 1) > A ? e.c = e.e = null : n < k ? e.c = [e.e = 0] : (e.e = n, e.c = t), e;
250
- }
251
- S = (function() {
252
- var e = /^(-?)0([xbo])(?=\w[\w.]*$)/i, t = /^([^.]+)\.$/, n = /^\.([^.]+)$/, i = /^-?(Infinity|NaN)$/, a = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
253
- return function(o, s, c, l) {
254
- var u, d = c ? s : s.replace(a, "");
255
- if (i.test(d)) o.s = isNaN(d) ? null : d < 0 ? -1 : 1;
256
- else {
257
- if (!c && (d = d.replace(e, function(e, t, n) {
258
- return u = (n = n.toLowerCase()) == "x" ? 16 : n == "b" ? 2 : 8, !l || l == u ? t : e;
259
- }), l && (u = l, d = d.replace(t, "$1").replace(n, "0.$1")), s != d)) return new L(d, u);
260
- if (L.DEBUG) throw Error(r + "Not a" + (l ? " base " + l : "") + " number: " + s);
261
- o.s = null;
262
- }
263
- o.c = o.e = null;
264
- };
265
- })();
266
- function V(e, r, i, s) {
267
- var l, u, d, f, p, m, h, g = e.c, _ = c;
268
- if (g) {
269
- out: {
270
- for (l = 1, f = g[0]; f >= 10; f /= 10, l++);
271
- if (u = r - l, u < 0) u += o, d = r, p = g[m = 0], h = n(p / _[l - d - 1] % 10);
272
- else if (m = t((u + 1) / o), m >= g.length) if (s) {
273
- for (; g.length <= m; g.push(0));
274
- p = h = 0, l = 1, u %= o, d = u - o + 1;
275
- } else break out;
276
- else {
277
- for (p = f = g[m], l = 1; f >= 10; f /= 10, l++);
278
- u %= o, d = u - o + l, h = d < 0 ? 0 : n(p / _[l - d - 1] % 10);
279
- }
280
- if (s = s || r < 0 || g[m + 1] != null || (d < 0 ? p : p % _[l - d - 1]), s = i < 4 ? (h || s) && (i == 0 || i == (e.s < 0 ? 3 : 2)) : h > 5 || h == 5 && (i == 4 || s || i == 6 && (u > 0 ? d > 0 ? p / _[l - d] : 0 : g[m - 1]) % 10 & 1 || i == (e.s < 0 ? 8 : 7)), r < 1 || !g[0]) return g.length = 0, s ? (r -= e.e + 1, g[0] = _[(o - r % o) % o], e.e = -r || 0) : g[0] = e.e = 0, e;
281
- if (u == 0 ? (g.length = m, f = 1, m--) : (g.length = m + 1, f = _[o - u], g[m] = d > 0 ? n(p / _[l - d] % _[d]) * f : 0), s) for (;;) if (m == 0) {
282
- for (u = 1, d = g[0]; d >= 10; d /= 10, u++);
283
- for (d = g[0] += f, f = 1; d >= 10; d /= 10, f++);
284
- u != f && (e.e++, g[0] == a && (g[0] = 1));
285
- break;
286
- } else {
287
- if (g[m] += f, g[m] != a) break;
288
- g[m--] = 0, f = 1;
289
- }
290
- for (u = g.length; g[--u] === 0; g.pop());
291
- }
292
- e.e > A ? e.c = e.e = null : e.e < k && (e.c = [e.e = 0]);
293
- }
294
- return e;
295
- }
296
- function H(e) {
297
- var t, n = e.e;
298
- return n === null ? e.toString() : (t = p(e.c), t = n <= D || n >= O ? _(t, n) : v(t, n, "0"), e.s < 0 ? "-" + t : t);
299
- }
300
- return C.absoluteValue = C.abs = function() {
301
- var e = new L(this);
302
- return e.s < 0 && (e.s = 1), e;
303
- }, C.comparedTo = function(e, t) {
304
- return m(this, new L(e, t));
305
- }, C.decimalPlaces = C.dp = function(e, t) {
306
- var n, r, i, a = this;
307
- if (e != null) return h(e, 0, u), t == null ? t = E : h(t, 0, 8), V(new L(a), e + a.e + 1, t);
308
- if (!(n = a.c)) return null;
309
- if (r = ((i = n.length - 1) - f(this.e / o)) * o, i = n[i]) for (; i % 10 == 0; i /= 10, r--);
310
- return r < 0 && (r = 0), r;
311
- }, C.dividedBy = C.div = function(e, t) {
312
- return b(this, new L(e, t), T, E);
313
- }, C.dividedToIntegerBy = C.idiv = function(e, t) {
314
- return b(this, new L(e, t), 0, 1);
315
- }, C.exponentiatedBy = C.pow = function(e, i) {
316
- var a, s, c, l, u, d, f, p, m, h = this;
317
- if (e = new L(e), e.c && !e.isInteger()) throw Error(r + "Exponent not an integer: " + H(e));
318
- if (i != null && (i = new L(i)), d = e.e > 14, !h.c || !h.c[0] || h.c[0] == 1 && !h.e && h.c.length == 1 || !e.c || !e.c[0]) return m = new L(H(h) ** (d ? e.s * (2 - g(e)) : +H(e))), i ? m.mod(i) : m;
319
- if (f = e.s < 0, i) {
320
- if (i.c ? !i.c[0] : !i.s) return new L(NaN);
321
- s = !f && h.isInteger() && i.isInteger(), s && (h = h.mod(i));
322
- } else if (e.e > 9 && (h.e > 0 || h.e < -1 || (h.e == 0 ? h.c[0] > 1 || d && h.c[1] >= 24e7 : h.c[0] < 8e13 || d && h.c[0] <= 9999975e7))) return l = h.s < 0 && g(e) ? -0 : 0, h.e > -1 && (l = 1 / l), new L(f ? 1 / l : l);
323
- else N && (l = t(N / o + 2));
324
- for (d ? (a = new L(.5), f && (e.s = 1), p = g(e)) : (c = Math.abs(+H(e)), p = c % 2), m = new L(w);;) {
325
- if (p) {
326
- if (m = m.times(h), !m.c) break;
327
- l ? m.c.length > l && (m.c.length = l) : s && (m = m.mod(i));
328
- }
329
- if (c) {
330
- if (c = n(c / 2), c === 0) break;
331
- p = c % 2;
332
- } else if (e = e.times(a), V(e, e.e + 1, 1), e.e > 14) p = g(e);
333
- else {
334
- if (c = +H(e), c === 0) break;
335
- p = c % 2;
336
- }
337
- h = h.times(h), l ? h.c && h.c.length > l && (h.c.length = l) : s && (h = h.mod(i));
338
- }
339
- return s ? m : (f && (m = w.div(m)), i ? m.mod(i) : l ? V(m, N, E, u) : m);
340
- }, C.integerValue = function(e) {
341
- var t = new L(this);
342
- return e == null ? e = E : h(e, 0, 8), V(t, t.e + 1, e);
343
- }, C.isEqualTo = C.eq = function(e, t) {
344
- return m(this, new L(e, t)) === 0;
345
- }, C.isFinite = function() {
346
- return !!this.c;
347
- }, C.isGreaterThan = C.gt = function(e, t) {
348
- return m(this, new L(e, t)) > 0;
349
- }, C.isGreaterThanOrEqualTo = C.gte = function(e, t) {
350
- return (t = m(this, new L(e, t))) === 1 || t === 0;
351
- }, C.isInteger = function() {
352
- return !!this.c && f(this.e / o) > this.c.length - 2;
353
- }, C.isLessThan = C.lt = function(e, t) {
354
- return m(this, new L(e, t)) < 0;
355
- }, C.isLessThanOrEqualTo = C.lte = function(e, t) {
356
- return (t = m(this, new L(e, t))) === -1 || t === 0;
357
- }, C.isNaN = function() {
358
- return !this.s;
359
- }, C.isNegative = function() {
360
- return this.s < 0;
361
- }, C.isPositive = function() {
362
- return this.s > 0;
363
- }, C.isZero = function() {
364
- return !!this.c && this.c[0] == 0;
365
- }, C.minus = function(e, t) {
366
- var n, r, i, s, c = this, l = c.s;
367
- if (e = new L(e, t), t = e.s, !l || !t) return new L(NaN);
368
- if (l != t) return e.s = -t, c.plus(e);
369
- var u = c.e / o, d = e.e / o, p = c.c, m = e.c;
370
- if (!u || !d) {
371
- if (!p || !m) return p ? (e.s = -t, e) : new L(m ? c : NaN);
372
- if (!p[0] || !m[0]) return m[0] ? (e.s = -t, e) : new L(p[0] ? c : E == 3 ? -0 : 0);
373
- }
374
- if (u = f(u), d = f(d), p = p.slice(), l = u - d) {
375
- for ((s = l < 0) ? (l = -l, i = p) : (d = u, i = m), i.reverse(), t = l; t--; i.push(0));
376
- i.reverse();
377
- } else for (r = (s = (l = p.length) < (t = m.length)) ? l : t, l = t = 0; t < r; t++) if (p[t] != m[t]) {
378
- s = p[t] < m[t];
379
- break;
380
- }
381
- if (s && (i = p, p = m, m = i, e.s = -e.s), t = (r = m.length) - (n = p.length), t > 0) for (; t--; p[n++] = 0);
382
- for (t = a - 1; r > l;) {
383
- if (p[--r] < m[r]) {
384
- for (n = r; n && !p[--n]; p[n] = t);
385
- --p[n], p[r] += a;
386
- }
387
- p[r] -= m[r];
388
- }
389
- for (; p[0] == 0; p.splice(0, 1), --d);
390
- return p[0] ? B(e, p, d) : (e.s = E == 3 ? -1 : 1, e.c = [e.e = 0], e);
391
- }, C.modulo = C.mod = function(e, t) {
392
- var n, r, i = this;
393
- return e = new L(e, t), !i.c || !e.s || e.c && !e.c[0] ? new L(NaN) : !e.c || i.c && !i.c[0] ? new L(i) : (M == 9 ? (r = e.s, e.s = 1, n = b(i, e, 0, 3), e.s = r, n.s *= r) : n = b(i, e, 0, M), e = i.minus(n.times(e)), !e.c[0] && M == 1 && (e.s = i.s), e);
394
- }, C.multipliedBy = C.times = function(e, t) {
395
- var n, r, i, s, c, u, d, p, m, h, g, _, v, y, b, x = this, S = x.c, C = (e = new L(e, t)).c;
396
- if (!S || !C || !S[0] || !C[0]) return !x.s || !e.s || S && !S[0] && !C || C && !C[0] && !S ? e.c = e.e = e.s = null : (e.s *= x.s, !S || !C ? e.c = e.e = null : (e.c = [0], e.e = 0)), e;
397
- for (r = f(x.e / o) + f(e.e / o), e.s *= x.s, d = S.length, h = C.length, d < h && (v = S, S = C, C = v, i = d, d = h, h = i), i = d + h, v = []; i--; v.push(0));
398
- for (y = a, b = l, i = h; --i >= 0;) {
399
- for (n = 0, g = C[i] % b, _ = C[i] / b | 0, c = d, s = i + c; s > i;) p = S[--c] % b, m = S[c] / b | 0, u = _ * p + m * g, p = g * p + u % b * b + v[s] + n, n = (p / y | 0) + (u / b | 0) + _ * m, v[s--] = p % y;
400
- v[s] = n;
401
- }
402
- return n ? ++r : v.splice(0, 1), B(e, v, r);
403
- }, C.negated = function() {
404
- var e = new L(this);
405
- return e.s = -e.s || null, e;
406
- }, C.plus = function(e, t) {
407
- var n, r = this, i = r.s;
408
- if (e = new L(e, t), t = e.s, !i || !t) return new L(NaN);
409
- if (i != t) return e.s = -t, r.minus(e);
410
- var s = r.e / o, c = e.e / o, l = r.c, u = e.c;
411
- if (!s || !c) {
412
- if (!l || !u) return new L(i / 0);
413
- if (!l[0] || !u[0]) return u[0] ? e : new L(l[0] ? r : i * 0);
414
- }
415
- if (s = f(s), c = f(c), l = l.slice(), i = s - c) {
416
- for (i > 0 ? (c = s, n = u) : (i = -i, n = l), n.reverse(); i--; n.push(0));
417
- n.reverse();
418
- }
419
- for (i = l.length, t = u.length, i - t < 0 && (n = u, u = l, l = n, t = i), i = 0; t;) i = (l[--t] = l[t] + u[t] + i) / a | 0, l[t] = a === l[t] ? 0 : l[t] % a;
420
- return i && (l = [i].concat(l), ++c), B(e, l, c);
421
- }, C.precision = C.sd = function(e, t) {
422
- var n, r, i, a = this;
423
- if (e != null && e !== !!e) return h(e, 1, u), t == null ? t = E : h(t, 0, 8), V(new L(a), e, t);
424
- if (!(n = a.c)) return null;
425
- if (i = n.length - 1, r = i * o + 1, i = n[i]) {
426
- for (; i % 10 == 0; i /= 10, r--);
427
- for (i = n[0]; i >= 10; i /= 10, r++);
428
- }
429
- return e && a.e + 1 > r && (r = a.e + 1), r;
430
- }, C.shiftedBy = function(e) {
431
- return h(e, -s, s), this.times("1e" + e);
432
- }, C.squareRoot = C.sqrt = function() {
433
- var e, t, n, r, i, a = this, o = a.c, s = a.s, c = a.e, l = T + 4, u = new L("0.5");
434
- if (s !== 1 || !o || !o[0]) return new L(!s || s < 0 && (!o || o[0]) ? NaN : o ? a : Infinity);
435
- if (s = Math.sqrt(+H(a)), s == 0 || s == Infinity ? (t = p(o), (t.length + c) % 2 == 0 && (t += "0"), s = Math.sqrt(+t), c = f((c + 1) / 2) - (c < 0 || c % 2), s == Infinity ? t = "5e" + c : (t = s.toExponential(), t = t.slice(0, t.indexOf("e") + 1) + c), n = new L(t)) : n = new L(s + ""), n.c[0]) {
436
- for (c = n.e, s = c + l, s < 3 && (s = 0);;) if (i = n, n = u.times(i.plus(b(a, i, l, 1))), p(i.c).slice(0, s) === (t = p(n.c)).slice(0, s)) if (n.e < c && --s, t = t.slice(s - 3, s + 1), t == "9999" || !r && t == "4999") {
437
- if (!r && (V(i, i.e + T + 2, 0), i.times(i).eq(a))) {
438
- n = i;
439
- break;
440
- }
441
- l += 4, s += 4, r = 1;
442
- } else {
443
- (!+t || !+t.slice(1) && t.charAt(0) == "5") && (V(n, n.e + T + 2, 1), e = !n.times(n).eq(a));
444
- break;
445
- }
446
- }
447
- return V(n, n.e + T + 1, E, e);
448
- }, C.toExponential = function(e, t) {
449
- return e != null && (h(e, 0, u), e++), R(this, e, t, 1);
450
- }, C.toFixed = function(e, t) {
451
- return e != null && (h(e, 0, u), e = e + this.e + 1), R(this, e, t);
452
- }, C.toFormat = function(e, t, n) {
453
- var i, a = this;
454
- if (n == null) e != null && t && typeof t == "object" ? (n = t, t = null) : e && typeof e == "object" ? (n = e, e = t = null) : n = P;
455
- else if (typeof n != "object") throw Error(r + "Argument not an object: " + n);
456
- if (i = a.toFixed(e, t), a.c) {
457
- var o, s = i.split("."), c = +n.groupSize, l = +n.secondaryGroupSize, u = n.groupSeparator || "", d = s[0], f = s[1], p = a.s < 0, m = p ? d.slice(1) : d, h = m.length;
458
- if (l && (o = c, c = l, l = o, h -= o), c > 0 && h > 0) {
459
- for (o = h % c || c, d = m.substr(0, o); o < h; o += c) d += u + m.substr(o, c);
460
- l > 0 && (d += u + m.slice(o)), p && (d = "-" + d);
461
- }
462
- i = f ? d + (n.decimalSeparator || "") + ((l = +n.fractionGroupSize) ? f.replace(RegExp("\\d{" + l + "}\\B", "g"), "$&" + (n.fractionGroupSeparator || "")) : f) : d;
463
- }
464
- return (n.prefix || "") + i + (n.suffix || "");
465
- }, C.toFraction = function(e) {
466
- var t, n, i, a, s, l, u, d, f, m, h, g, _ = this, v = _.c;
467
- if (e != null && (u = new L(e), !u.isInteger() && (u.c || u.s !== 1) || u.lt(w))) throw Error(r + "Argument " + (u.isInteger() ? "out of range: " : "not an integer: ") + H(u));
468
- if (!v) return new L(_);
469
- for (t = new L(w), f = n = new L(w), i = d = new L(w), g = p(v), s = t.e = g.length - _.e - 1, t.c[0] = c[(l = s % o) < 0 ? o + l : l], e = !e || u.comparedTo(t) > 0 ? s > 0 ? t : f : u, l = A, A = Infinity, u = new L(g), d.c[0] = 0; m = b(u, t, 0, 1), a = n.plus(m.times(i)), a.comparedTo(e) != 1;) n = i, i = a, f = d.plus(m.times(a = f)), d = a, t = u.minus(m.times(a = t)), u = a;
470
- return a = b(e.minus(n), i, 0, 1), d = d.plus(a.times(f)), n = n.plus(a.times(i)), d.s = f.s = _.s, s *= 2, h = b(f, i, s, E).minus(_).abs().comparedTo(b(d, n, s, E).minus(_).abs()) < 1 ? [f, i] : [d, n], A = l, h;
471
- }, C.toNumber = function() {
472
- return +H(this);
473
- }, C.toPrecision = function(e, t) {
474
- return e != null && h(e, 1, u), R(this, e, t, 2);
475
- }, C.toString = function(e) {
476
- var t, n = this, r = n.s, i = n.e;
477
- return i === null ? r ? (t = "Infinity", r < 0 && (t = "-" + t)) : t = "NaN" : (e == null ? t = i <= D || i >= O ? _(p(n.c), i) : v(p(n.c), i, "0") : e === 10 && I ? (n = V(new L(n), T + i + 1, E), t = v(p(n.c), n.e, "0")) : (h(e, 2, F.length, "Base"), t = x(v(p(n.c), i, "0"), 10, e, r, !0)), r < 0 && n.c[0] && (t = "-" + t)), t;
478
- }, C.valueOf = C.toJSON = function() {
479
- return H(this);
480
- }, C._isBigNumber = !0, C[Symbol.toStringTag] = "BigNumber", C[Symbol.for("nodejs.util.inspect.custom")] = C.valueOf, y != null && L.set(y), L;
481
- }
482
- function f(e) {
483
- var t = e | 0;
484
- return e > 0 || e === t ? t : t - 1;
485
- }
486
- function p(e) {
487
- for (var t, n, r = 1, i = e.length, a = e[0] + ""; r < i;) {
488
- for (t = e[r++] + "", n = o - t.length; n--; t = "0" + t);
489
- a += t;
490
- }
491
- for (i = a.length; a.charCodeAt(--i) === 48;);
492
- return a.slice(0, i + 1 || 1);
493
- }
494
- function m(e, t) {
495
- var n, r, i = e.c, a = t.c, o = e.s, s = t.s, c = e.e, l = t.e;
496
- if (!o || !s) return null;
497
- if (n = i && !i[0], r = a && !a[0], n || r) return n ? r ? 0 : -s : o;
498
- if (o != s) return o;
499
- if (n = o < 0, r = c == l, !i || !a) return r ? 0 : !i ^ n ? 1 : -1;
500
- if (!r) return c > l ^ n ? 1 : -1;
501
- for (s = (c = i.length) < (l = a.length) ? c : l, o = 0; o < s; o++) if (i[o] != a[o]) return i[o] > a[o] ^ n ? 1 : -1;
502
- return c == l ? 0 : c > l ^ n ? 1 : -1;
503
- }
504
- function h(e, t, i, a) {
505
- if (e < t || e > i || e !== n(e)) throw Error(r + (a || "Argument") + (typeof e == "number" ? e < t || e > i ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(e));
506
- }
507
- function g(e) {
508
- var t = e.c.length - 1;
509
- return f(e.e / o) == t && e.c[t] % 2 != 0;
510
- }
511
- function _(e, t) {
512
- return (e.length > 1 ? e.charAt(0) + "." + e.slice(1) : e) + (t < 0 ? "e" : "e+") + t;
513
- }
514
- function v(e, t, n) {
515
- var r, i;
516
- if (t < 0) {
517
- for (i = n + "."; ++t; i += n);
518
- e = i + e;
519
- } else if (r = e.length, ++t > r) {
520
- for (i = n, t -= r; --t; i += n);
521
- e += i;
522
- } else t < r && (e = e.slice(0, t) + "." + e.slice(t));
523
- return e;
524
- }
525
- var y = d();
526
- //#endregion
527
- export { y as default };