diff --git a/ui/StatusQ/src/StatusQ/Core/Utils/big.min.mjs b/ui/StatusQ/src/StatusQ/Core/Utils/big.min.mjs new file mode 100644 index 0000000000..6f099b628e --- /dev/null +++ b/ui/StatusQ/src/StatusQ/Core/Utils/big.min.mjs @@ -0,0 +1,7 @@ +/* + * big.js v6.2.1 (minified) + * A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic. + * Copyright (c) 2022 Michael Mclaughlin + * https://github.com/MikeMcl/big.js/blob/8f44eb57da97709a56024c6bd97a17804a1be91a/LICENCE.md + */ +var DP=20,RM=1,MAX_DP=1e6,MAX_POWER=1e6,NE=-7,PE=21,STRICT=!1,NAME="[big.js] ",INVALID=NAME+"Invalid ",INVALID_DP=INVALID+"decimal places",INVALID_RM=INVALID+"rounding mode",DIV_BY_ZERO=NAME+"Division by zero",P={},UNDEFINED=void 0,NUMERIC=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function _Big_(){function r(t){var e=this;if(!(e instanceof r))return t===UNDEFINED?_Big_():new r(t);if(t instanceof r)e.s=t.s,e.e=t.e,e.c=t.c.slice();else{if("string"!=typeof t){if(!0===r.strict&&"bigint"!=typeof t)throw TypeError(INVALID+"value");t=0===t&&1/t<0?"-0":String(t)}parse(e,t)}e.constructor=r}return r.prototype=P,r.DP=DP,r.RM=RM,r.NE=NE,r.PE=PE,r.strict=STRICT,r.roundDown=0,r.roundHalfUp=1,r.roundHalfEven=2,r.roundUp=3,r}function parse(r,t){var e,n,i;if(!NUMERIC.test(t))throw Error(INVALID+"number");for(r.s="-"==t.charAt(0)?(t=t.slice(1),-1):1,(e=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(e<0&&(e=n),e+=+t.slice(n+1),t=t.substring(0,n)):e<0&&(e=t.length),i=t.length,n=0;n0&&"0"==t.charAt(--i););for(r.e=e-n-1,r.c=[],e=0;n<=i;)r.c[e++]=+t.charAt(n++)}return r}function round(r,t,e,n){var i=r.c;if(e===UNDEFINED&&(e=r.constructor.RM),0!==e&&1!==e&&2!==e&&3!==e)throw Error(INVALID_RM);if(t<1)n=3===e&&(n||!!i[0])||0===t&&(1===e&&i[0]>=5||2===e&&(i[0]>5||5===i[0]&&(n||i[1]!==UNDEFINED))),i.length=1,n?(r.e=r.e-t+1,i[0]=1):i[0]=r.e=0;else if(t=5||2===e&&(i[t]>5||5===i[t]&&(n||i[t+1]!==UNDEFINED||1&i[t-1]))||3===e&&(n||!!i[0]),i.length=t,n)for(;++i[--t]>9;)if(i[t]=0,0===t){++r.e,i.unshift(1);break}for(t=i.length;!i[--t];)i.pop()}return r}function stringify(r,t,e){var n=r.e,i=r.c.join(""),o=i.length;if(t)i=i.charAt(0)+(o>1?"."+i.slice(1):"")+(n<0?"e":"e+")+n;else if(n<0){for(;++n;)i="0"+i;i="0."+i}else if(n>0)if(++n>o)for(n-=o;n--;)i+="0";else n1&&(i=i.charAt(0)+"."+i.slice(1));return r.s<0&&e?"-"+i:i}P.abs=function(){var r=new this.constructor(this);return r.s=1,r},P.cmp=function(r){var t,e=this,n=e.c,i=(r=new e.constructor(r)).c,o=e.s,s=r.s,c=e.e,f=r.e;if(!n[0]||!i[0])return n[0]?o:i[0]?-s:0;if(o!=s)return o;if(t=o<0,c!=f)return c>f^t?1:-1;for(s=(c=n.length)<(f=i.length)?c:f,o=-1;++oi[o]^t?1:-1;return c==f?0:c>f^t?1:-1},P.div=function(r){var t=this,e=t.constructor,n=t.c,i=(r=new e(r)).c,o=t.s==r.s?1:-1,s=e.DP;if(s!==~~s||s<0||s>MAX_DP)throw Error(INVALID_DP);if(!i[0])throw Error(DIV_BY_ZERO);if(!n[0])return r.s=o,r.c=[r.e=0],r;var c,f,u,h,l,E=i.slice(),D=c=i.length,P=n.length,a=n.slice(0,c),N=a.length,g=r,I=g.c=[],p=0,w=s+(g.e=t.e-r.e)+1;for(g.s=o,o=w<0?0:w,E.unshift(0);N++N?1:-1;else for(l=-1,h=0;++la[l]?1:-1;break}if(!(h<0))break;for(f=N==c?i:E;N;){if(a[--N]w&&round(g,w,e.RM,a[0]!==UNDEFINED),g},P.eq=function(r){return 0===this.cmp(r)},P.gt=function(r){return this.cmp(r)>0},P.gte=function(r){return this.cmp(r)>-1},P.lt=function(r){return this.cmp(r)<0},P.lte=function(r){return this.cmp(r)<1},P.minus=P.sub=function(r){var t,e,n,i,o=this,s=o.constructor,c=o.s,f=(r=new s(r)).s;if(c!=f)return r.s=-f,o.plus(r);var u=o.c.slice(),h=o.e,l=r.c,E=r.e;if(!u[0]||!l[0])return l[0]?r.s=-f:u[0]?r=new s(o):r.s=1,r;if(c=h-E){for((i=c<0)?(c=-c,n=u):(E=h,n=l),n.reverse(),f=c;f--;)n.push(0);n.reverse()}else for(e=((i=u.length0)for(;f--;)u[t++]=0;for(f=t;e>c;){if(u[--e]0?(f=s,n=u):(t=-t,n=c),n.reverse();t--;)n.push(0);n.reverse()}for(c.length-u.length<0&&(n=u,u=c,c=n),t=u.length,e=0;t;c[t]%=10)e=(c[--t]=c[t]+u[t]+e)/10|0;for(e&&(c.unshift(e),++f),t=c.length;0===c[--t];)c.pop();return r.c=c,r.e=f,r},P.pow=function(r){var t=this,e=new t.constructor("1"),n=e,i=r<0;if(r!==~~r||r<-MAX_POWER||r>MAX_POWER)throw Error(INVALID+"exponent");for(i&&(r=-r);1&r&&(n=n.times(t)),r>>=1;)t=t.times(t);return i?e.div(n):n},P.prec=function(r,t){if(r!==~~r||r<1||r>MAX_DP)throw Error(INVALID+"precision");return round(new this.constructor(this),r,t)},P.round=function(r,t){if(r===UNDEFINED)r=0;else if(r!==~~r||r<-MAX_DP||r>MAX_DP)throw Error(INVALID_DP);return round(new this.constructor(this),r+this.e+1,t)},P.sqrt=function(){var r,t,e,n=this,i=n.constructor,o=n.s,s=n.e,c=new i("0.5");if(!n.c[0])return new i(n);if(o<0)throw Error(NAME+"No square root");0===(o=Math.sqrt(n+""))||o===1/0?((t=n.c.join("")).length+s&1||(t+="0"),s=((s+1)/2|0)-(s<0||1&s),r=new i(((o=Math.sqrt(t))==1/0?"5e":(o=o.toExponential()).slice(0,o.indexOf("e")+1))+s)):r=new i(o+""),s=r.e+(i.DP+=4);do{e=r,r=c.times(e.plus(n.div(e)))}while(e.c.slice(0,s).join("")!==r.c.slice(0,s).join(""));return round(r,(i.DP-=4)+r.e+1,i.RM)},P.times=P.mul=function(r){var t,e=this,n=e.constructor,i=e.c,o=(r=new n(r)).c,s=i.length,c=o.length,f=e.e,u=r.e;if(r.s=e.s==r.s?1:-1,!i[0]||!o[0])return r.c=[r.e=0],r;for(r.e=f+u,sf;)c=t[u]+o[f]*i[u-f-1]+c,t[u--]=c%10,c=c/10|0;t[u]=c}for(c?++r.e:t.shift(),f=t.length;!t[--f];)t.pop();return r.c=t,r},P.toExponential=function(r,t){var e=this,n=e.c[0];if(r!==UNDEFINED){if(r!==~~r||r<0||r>MAX_DP)throw Error(INVALID_DP);for(e=round(new e.constructor(e),++r,t);e.c.lengthMAX_DP)throw Error(INVALID_DP);for(r=r+(e=round(new e.constructor(e),r+e.e+1,t)).e+1;e.c.length=t.PE,!!r.c[0])},P.toNumber=function(){var r=Number(stringify(this,!0,!0));if(!0===this.constructor.strict&&!this.eq(r.toString()))throw Error(NAME+"Imprecise conversion");return r},P.toPrecision=function(r,t){var e=this,n=e.constructor,i=e.c[0];if(r!==UNDEFINED){if(r!==~~r||r<1||r>MAX_DP)throw Error(INVALID+"precision");for(e=round(new n(e),r,t);e.c.length=n.PE,!!i)},P.valueOf=function(){var r=this,t=r.constructor;if(!0===t.strict)throw Error(NAME+"valueOf disallowed");return stringify(r,r.e<=t.NE||r.e>=t.PE,!0)};export var Big=_Big_();;export default Big;