Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

a-calc

Package Overview
Dependencies
Maintainers
1
Versions
161
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

a-calc - npm Package Compare versions

Comparing version 1.2.19 to 1.2.20

2

browser/index.js

@@ -1,1 +0,1 @@

var a_calc=function(e){"use strict";function _(r,e){var t,n=Object.keys(r);return Object.getOwnPropertySymbols&&(t=Object.getOwnPropertySymbols(r),e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),n.push.apply(n,t)),n}function o(n){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?_(Object(i),!0).forEach(function(e){var r,t;r=n,t=i[e=e],e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):_(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}function R(e){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function O(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,r){if(e){if("string"==typeof e)return n(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(t="Object"===t&&e.constructor?e.constructor.name:t)||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?n(e,r):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var N="1.2.19",S=/^[+-]?\d[\d.]*(?:e\+|E\+|e-|E-|e|E)?\d*$/,A=/^[+-]?\d[\d.]*(?:e\+|E\+|e-|E-|e|E)?\d*\D*$/;function x(e){return-1<"+-*/%()**".indexOf(e)}function k(e){switch(e){case"+":case"-":return 1;case"*":case"/":case"%":return 2;case"**":return 3;default:return 0}}function h(e){return void 0!==e}function j(e){return null===e}function P(e){return null!==e}function u(e){return"string"==typeof e&&!!S.test(e)}var l={initial:"initial",number:"number",variable:"var",symbol:"symbol",percent:"percent",round:"round",plus:"plus",comma:"comma",fraction:"fraction",to_number:"to-number",scientific:"scientific"},C="<>=";function $(e){for(var r=l.initial,t=[],n=[];e;){var i=e[0];if(r===l.initial)if(/\s/.test(i))e=e.slice(1);else if(C.includes(i))r=l.symbol,t.push(i),e=e.slice(1);else if(","===i)r=l.initial,n.push({type:"comma",value:i}),e=e.slice(1);else if(/[a-zA-Z_]/.test(i))r=l.variable,t.push(i),e=e.slice(1);else if(/\d/.test(i))r=l.number,t.push(i),e=e.slice(1);else if("+"===i)r=l.initial,n.push({type:"plus",value:i}),e=e.slice(1);else if("~"===i)r=l.round,t.push(i),e=e.slice(1);else if("%"===i)r=l.initial,n.push({type:"percent",value:i}),e=e.slice(1);else if("/"===i)r=l.initial,n.push({type:"fraction",value:i}),e=e.slice(1);else{if("!"!==i)throw new Error("不识别的fmt字符:".concat(i));if(r=l.initial,/[Ee]/.test(e[1]))n.push({type:"scientific",value:e[1]}),e=e.slice(2);else{if(!/[Nn]/.test(e[1]))throw new Error("不识别的fmt字符:".concat(e.slice(2)));n.push({type:"to-number",value:e[1]}),e=e.slice(2)}}else if(r===l.number)/\d/.test(i)?(t.push(i),e=e.slice(1)):(n.push({type:"number",value:t.join("")}),t.length=0,r=l.initial);else if(r===l.variable)/[\$\w_\-.\[\]"']/.test(i)?(t.push(i),e=e.slice(1)):(n.push({type:"var",value:t.join("")}),t.length=0,r=l.initial);else if(r===l.symbol)/\s/.test(i)?e=e.slice(1):C.includes(i)?(t.push(i),e=e.slice(1)):(n.push({type:"symbol",value:t.join("")}),t.length=0,r=l.initial);else{if(r!==l.round)throw new Error("错误的自动机状态");if(/\s/.test(i))e=e.slice(1);else{if(!("56+-".includes(i)&&t.length<2))throw new Error("舍入格式化语法错误:".concat(i));t.push(i),e=e.slice(1),n.push({type:"round",value:t.join("")}),t.length=0,r=l.initial}}}if(0<t.length&&(n.push({type:r,value:t.join("")}),t.length=0,r=l.initial),1<n.filter(function(e){return"number"===e.type}).length)throw new Error("格式化字符串错误,发现多余的数字");return n}var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=Array.isArray,r="object"==R(r)&&r&&r.Object===Object&&r,i="object"==("undefined"==typeof self?"undefined":R(self))&&self&&self.Object===Object&&self,r=r||i||Function("return this")(),i=r.Symbol,s=Object.prototype,D=s.hasOwnProperty,T=s.toString,c=i?i.toStringTag:void 0;var B=Object.prototype.toString;var I=function(e){var r=D.call(e,c),t=e[c];try{var n=!(e[c]=void 0)}catch(e){}var i=T.call(e);return n&&(r?e[c]=t:delete e[c]),i},Y=function(e){return B.call(e)},K=i?i.toStringTag:void 0;function Q(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":(K&&K in Object(e)?I:Y)(e)}var ee=Q,re=function(e){return null!=e&&"object"==R(e)};function te(e){return"symbol"==R(e)||re(e)&&"[object Symbol]"==ee(e)}var ne=t,ie=te,oe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,le=/^\w*$/;function se(e,r){if(ne(e))return!1;var t=R(e);return!("number"!=t&&"symbol"!=t&&"boolean"!=t&&null!=e&&!ie(e))||(le.test(e)||!oe.test(e)||null!=r&&e in Object(r))}function ce(e){var r=R(e);return null!=e&&("object"==r||"function"==r)}var ue=Q,ae=ce;function fe(e){return!!ae(e)&&("[object Function]"==(e=ue(e))||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e)}var s=r["__core-js_shared__"],pe=(s=/[^.]+$/.exec(s&&s.keys&&s.keys.IE_PROTO||""))?"Symbol(src)_1."+s:"";var he=Function.prototype.toString;var ge=fe,de=function(e){return!!pe&&pe in e},ve=ce,we=function(e){if(null!=e){try{return he.call(e)}catch(e){}try{return e+""}catch(e){}}return""},ye=/^\[object .+?Constructor\]$/,s=Function.prototype,a=Object.prototype,s=s.toString,a=a.hasOwnProperty,be=RegExp("^"+s.call(a).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var me=function(e){return!(!ve(e)||de(e))&&(ge(e)?be:ye).test(we(e))},_e=function(e,r){return null==e?void 0:e[r]};function Ee(e,r){return e=_e(e,r),me(e)?e:void 0}var s=Ee(Object,"create"),Oe=s;var Ne=s,Se=Object.prototype.hasOwnProperty;var Ae=s,xe=Object.prototype.hasOwnProperty;var ke=s;function je(e){return e=this.has(e)&&delete this.__data__[e],this.size-=e?1:0,e}function Pe(e){var r,t=this.__data__;return Ne?"__lodash_hash_undefined__"===(r=t[e])?void 0:r:Se.call(t,e)?t[e]:void 0}function Ce(e){var r=this.__data__;return Ae?void 0!==r[e]:xe.call(r,e)}function $e(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=ke&&void 0===r?"__lodash_hash_undefined__":r,this}function f(e){var r=-1,t=null==e?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}f.prototype.clear=function(){this.__data__=Oe?Oe(null):{},this.size=0},f.prototype.delete=je,f.prototype.get=Pe,f.prototype.has=Ce,f.prototype.set=$e;a=f;var De=function(e,r){return e===r||e!=e&&r!=r};function p(e,r){for(var t=e.length;t--;)if(De(e[t][0],r))return t;return-1}var Te=p,Be=Array.prototype.splice;var Ie=p;var Re=p;var ze=p;function Ue(e){var r=this.__data__;return!((e=Te(r,e))<0)&&(e==r.length-1?r.pop():Be.call(r,e,1),--this.size,!0)}function Fe(e){var r=this.__data__;return(e=Ie(r,e))<0?void 0:r[e][1]}function Le(e){return-1<Re(this.__data__,e)}function Me(e,r){var t=this.__data__,n=ze(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}function g(e){var r=-1,t=null==e?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}g.prototype.clear=function(){this.__data__=[],this.size=0},g.prototype.delete=Ue,g.prototype.get=Fe,g.prototype.has=Le,g.prototype.set=Me;var s=g,r=Ee(r,"Map"),Ge=a,qe=s,Je=r;var We=function(e){var r=R(e);return"string"==r||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==e:null===e};function d(e,r){return e=e.__data__,We(r)?e["string"==typeof r?"string":"hash"]:e.map}var He=d;var Ve=d;var Ze=d;var Xe=d;function Ye(e){return e=He(this,e).delete(e),this.size-=e?1:0,e}function Ke(e){return Ve(this,e).get(e)}function Qe(e){return Ze(this,e).has(e)}function er(e,r){var t=Xe(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}function v(e){var r=-1,t=null==e?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}v.prototype.clear=function(){this.size=0,this.__data__={hash:new Ge,map:new(Je||qe),string:new Ge}},v.prototype.delete=Ye,v.prototype.get=Ke,v.prototype.has=Qe,v.prototype.set=er;var rr=v;function tr(n,i){if("function"!=typeof n||null!=i&&"function"!=typeof i)throw new TypeError("Expected a function");function o(){var e=arguments,r=i?i.apply(this,e):e[0],t=o.cache;return t.has(r)?t.get(r):(e=n.apply(this,e),o.cache=t.set(r,e)||t,e)}return o.cache=new(tr.Cache||rr),o}tr.Cache=rr;var nr=tr;var ir=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,or=/\\(\\)?/g,a=function(e){var r=(e=nr(e,function(e){return 500===r.size&&r.clear(),e})).cache;return e}(function(e){var i=[];return 46===e.charCodeAt(0)&&i.push(""),e.replace(ir,function(e,r,t,n){i.push(t?n.replace(or,"$1"):r||e)}),i});var lr=function(e,r){for(var t=-1,n=null==e?0:e.length,i=Array(n);++t<n;)i[t]=r(e[t],t,e);return i},sr=t,cr=te,s=i?i.prototype:void 0,ur=s?s.toString:void 0;var ar=function e(r){if("string"==typeof r)return r;if(sr(r))return lr(r,e)+"";if(cr(r))return ur?ur.call(r):"";var t=r+"";return"0"==t&&1/r==-1/0?"-0":t};var fr=t,pr=se,hr=a,gr=function(e){return null==e?"":ar(e)};var dr=te;var vr=function(e,r){return fr(e)?e:pr(e,r)?[e]:hr(gr(e))},wr=function(e){if("string"==typeof e||dr(e))return e;var r=e+"";return"0"==r&&1/e==-1/0?"-0":r};var yr=function(e,r){for(var t=0,n=(r=vr(r,e)).length;null!=e&&t<n;)e=e[wr(r[t++])];return t&&t==n?e:void 0};var w=function(e,r,t){return void 0===(e=null==e?void 0:yr(e,r))?t:e};var y={initial:"initial",number:"number",scientific:"scientific",operator:"operator",bracket:"bracket",var:"var"},br="+-",mr="*/%",_r="()";function Er(e,r){for(var t,n,i,o=1<arguments.length&&void 0!==r&&r,l=y.initial,s=[],c=[],u=function(){s.push(t),e=e.slice(1)},a=function(e){c.push({type:e,value:s.join("")}),s.length=0},f=function(){e=e.slice(1)};e;)switch(t=e[0],l){case y.initial:if(br.includes(t)){var p=c.at(-1),l=0===c.length||"operator"===p.type||"("===p?y.number:y.operator;u()}else if(mr.includes(t))l=y.operator,u();else if(/\d/.test(t))l=y.number,u();else if(_r.includes(t))l=y.bracket;else if(/[a-zA-Z_$]/.test(t))l=y.var,u();else{if(!/\s/.test(t))throw new Error("不识别的字符".concat(t));f()}break;case y.bracket:c.push({type:y.bracket,value:t}),f(),l=y.initial;break;case y.operator:p=s.at(-1);"*"===t&&"*"===p&&u(),a(y.operator),l=y.initial;break;case y.number:if(/\d/.test(t))u();else if("."===t){if(0===s.length||s.includes("."))throw new Error("非法的小数部分".concat(s.join("")));u()}else"Ee".includes(t)?(l=y.scientific,u()):["auto","on",!0].includes(o)&&/[^*/+\-()\s]/.test(t)||"space"===o&&/\S/.test(t)?u():(a(y.number),l=y.initial);break;case y.scientific:/\d/.test(t)?u():br.includes(t)?(n=s.slice(1),i=s.at(-1),n.includes(t)||!/[Ee]/.test(i)?(a(y.scientific),l=y.initial):u()):["auto","on",!0].includes(o)&&/[^*/+\-()\s]/.test(t)||"space"===o&&/\S/.test(t)?u():(a(y.scientific),l=y.initial);break;case y.var:/[\w_.\[\]"']/.test(t)?u():(a(y.var),l=y.initial);break;default:throw new Error("状态错误")}return 0!==s.length&&(c.push({type:l,value:s.join("")}),s.length=0,l=y.initial),c}function Or(e,r,t){if(j(r))throw new Error("错误的填充数据:",r);for(var n=[],i=0;i<e.length;i++){var o=e[i];if("var"!==o.type)n.push(o);else{if("undefined"===o.value||"NaN"===o.value)throw new Error("key不应该为:".concat(o.value));for(var l=null,s=0;s<r.length;s++){var c=r[s],c=w(c,o.value);if(void 0!==c){l=c;break}}if(null===l)throw new Error("token填充失败,请确认".concat(o,"存在"));if("string"==typeof l){if(""===l.trim())throw new Error("token填充失败,".concat(o.value,"值不可为空字符"));if([!0,"on","auto","space"].includes(t)){if(!A.test(l))throw new Error("token填充失败,".concat(o.value,"值:").concat(l,"为非法单位数字"))}else if(!u(l))throw new Error("token填充失败,".concat(o,"值:").concat(l,"为非法数字"))}l="string"!=typeof l?l.toString():l,n.push({type:"number",value:l})}}return n}function Nr(e){for(var r,t=[],n=[],i=e.map(function(e){return e.value});0<i.length;){var o=i.shift();if(x(o))if("("===o)t.push(o);else if(")"===o){for(var l=t.pop();"("!==l&&0<t.length;)n.push(l),l=t.pop();if("("!==l)throw"error: unmatched ()"}else{for(;r=t[t.length-1],k(o)<=k(r)&&0<t.length;)n.push(t.pop());t.push(o)}else n.push(o)}if(0<t.length){if(")"===t[t.length-1]||"("===t[t.length-1])throw"error: unmatched ()";for(;0<t.length;)n.push(t.pop())}return n}var Sr=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Ar=Math.ceil,z=Math.floor,U="[BigNumber Error] ",xr=U+"Number primitive has more than 15 significant digits: ",F=1e14,L=14,kr=9007199254740991,jr=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],M=1e7,G=1e9;function q(e){var r=0|e;return 0<e||e===r?r:r-1}function J(e){for(var r,t,n=1,i=e.length,o=e[0]+"";n<i;){for(r=e[n++]+"",t=L-r.length;t--;r="0"+r);o+=r}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function W(e,r){var t,n,i=e.c,o=r.c,l=e.s,s=r.s,e=e.e,r=r.e;if(!l||!s)return null;if(t=i&&!i[0],n=o&&!o[0],t||n)return t?n?0:-s:l;if(l!=s)return l;if(t=l<0,n=e==r,!i||!o)return n?0:!i^t?1:-1;if(!n)return r<e^t?1:-1;for(s=(e=i.length)<(r=o.length)?e:r,l=0;l<s;l++)if(i[l]!=o[l])return i[l]>o[l]^t?1:-1;return e==r?0:r<e^t?1:-1}function H(e,r,t,n){if(e<r||t<e||e!==z(e))throw Error(U+(n||"Argument")+("number"==typeof e?e<r||t<e?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function V(e){var r=e.c.length-1;return q(e.e/L)==r&&e.c[r]%2!=0}function Z(e,r){return(1<e.length?e.charAt(0)+"."+e.slice(1):e)+(r<0?"e":"e+")+r}function X(e,r,t){var n,i;if(r<0){for(i=t+".";++r;i+=t);e=i+e}else if(++r>(n=e.length)){for(i=t,r-=n;--r;i+=t);e+=i}else r<n&&(e=e.slice(0,r)+"."+e.slice(r));return e}var E=function I(e){var v,f,p,r,u,w,l,s,c,a,h,t=k.prototype={constructor:k,toString:null,valueOf:null},g=new k(1),y=20,b=4,d=-7,m=21,_=-1e7,E=1e7,O=!1,i=1,N=0,S={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},A="0123456789abcdefghijklmnopqrstuvwxyz",x=!0;function k(e,r){var t,n,i,o,l,s,c,u,a=this;if(!(a instanceof k))return new k(e,r);if(null==r){if(e&&!0===e._isBigNumber)return a.s=e.s,void(!e.c||e.e>E?a.c=a.e=null:e.e<_?a.c=[a.e=0]:(a.e=e.e,a.c=e.c.slice()));if((s="number"==typeof e)&&0*e==0){if(a.s=1/e<0?(e=-e,-1):1,e===~~e){for(o=0,l=e;10<=l;l/=10,o++);return void(E<o?a.c=a.e=null:(a.e=o,a.c=[e]))}u=String(e)}else{if(!Sr.test(u=String(e)))return p(a,u,s);a.s=45==u.charCodeAt(0)?(u=u.slice(1),-1):1}0<(l=(u=-1<(o=u.indexOf("."))?u.replace(".",""):u).search(/e/i))?(o<0&&(o=l),o+=+u.slice(l+1),u=u.substring(0,l)):o<0&&(o=u.length)}else{if(H(r,2,A.length,"Base"),10==r&&x)return T(a=new k(e),y+a.e+1,b);if(u=String(e),s="number"==typeof e){if(0*e!=0)return p(a,u,s,r);if(a.s=1/e<0?(u=u.slice(1),-1):1,k.DEBUG&&15<u.replace(/^0\.0*|\./,"").length)throw Error(xr+e)}else a.s=45===u.charCodeAt(0)?(u=u.slice(1),-1):1;for(t=A.slice(0,r),o=l=0,c=u.length;l<c;l++)if(t.indexOf(n=u.charAt(l))<0){if("."==n){if(o<l){o=c;continue}}else if(!i&&(u==u.toUpperCase()&&(u=u.toLowerCase())||u==u.toLowerCase()&&(u=u.toUpperCase()))){i=!0,l=-1,o=0;continue}return p(a,String(e),s,r)}s=!1,-1<(o=(u=f(u,r,10,a.s)).indexOf("."))?u=u.replace(".",""):o=u.length}for(l=0;48===u.charCodeAt(l);l++);for(c=u.length;48===u.charCodeAt(--c););if(u=u.slice(l,++c)){if(c-=l,s&&k.DEBUG&&15<c&&(kr<e||e!==z(e)))throw Error(xr+a.s*e);if((o=o-l-1)>E)a.c=a.e=null;else if(o<_)a.c=[a.e=0];else{if(a.e=o,a.c=[],l=(o+1)%L,o<0&&(l+=L),l<c){for(l&&a.c.push(+u.slice(0,l)),c-=L;l<c;)a.c.push(+u.slice(l,l+=L));l=L-(u=u.slice(l)).length}else l-=c;for(;l--;u+="0");a.c.push(+u)}}else a.c=[a.e=0]}function j(e,r,t,n){for(var i,o,l=[0],s=0,c=e.length;s<c;){for(o=l.length;o--;l[o]*=r);for(l[0]+=n.indexOf(e.charAt(s++)),i=0;i<l.length;i++)l[i]>t-1&&(null==l[i+1]&&(l[i+1]=0),l[i+1]+=l[i]/t|0,l[i]%=t)}return l.reverse()}function P(e,r,t){var n,i,o,l=0,s=e.length,c=r%M,u=r/M|0;for(e=e.slice();s--;)l=((i=c*(o=e[s]%M)+(n=u*o+(o=e[s]/M|0)*c)%M*M+l)/t|0)+(n/M|0)+u*o,e[s]=i%t;return e=l?[l].concat(e):e}function C(e,r,t,n){var i,o;if(t!=n)o=n<t?1:-1;else for(i=o=0;i<t;i++)if(e[i]!=r[i]){o=e[i]>r[i]?1:-1;break}return o}function $(e,r,t,n){for(var i=0;t--;)e[t]-=i,i=e[t]<r[t]?1:0,e[t]=i*n+e[t]-r[t];for(;!e[0]&&1<e.length;e.splice(0,1));}function n(e,r,t,n){var i,o,l,s;if(null==t?t=b:H(t,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,null==r)s=J(e.c),s=1==n||2==n&&(o<=d||m<=o)?Z(s,o):X(s,o,"0");else if(t=(e=T(new k(e),r,t)).e,l=(s=J(e.c)).length,1==n||2==n&&(r<=t||t<=d)){for(;l<r;s+="0",l++);s=Z(s,t)}else if(r-=o,s=X(s,t,"0"),l<t+1){if(0<--r)for(s+=".";r--;s+="0");}else if(0<(r+=t-l))for(t+1==l&&(s+=".");r--;s+="0");return e.s<0&&i?"-"+s:s}function o(e,r){for(var t,n=1,i=new k(e[0]);n<e.length;n++){if(!(t=new k(e[n])).s){i=t;break}r.call(i,t)&&(i=t)}return i}function D(e,r,t){for(var n=1,i=r.length;!r[--i];r.pop());for(i=r[0];10<=i;i/=10,n++);return(t=n+t*L-1)>E?e.c=e.e=null:t<_?e.c=[e.e=0]:(e.e=t,e.c=r),e}function T(e,r,t,n){var i,o,l,s,c,u,a,f=e.c,p=jr;if(f){e:{for(i=1,s=f[0];10<=s;s/=10,i++);if((o=r-i)<0)o+=L,l=r,a=(c=f[u=0])/p[i-l-1]%10|0;else if((u=Ar((o+1)/L))>=f.length){if(!n)break e;for(;f.length<=u;f.push(0));c=a=0,l=(o%=L)-L+(i=1)}else{for(c=s=f[u],i=1;10<=s;s/=10,i++);a=(l=(o%=L)-L+i)<0?0:c/p[i-l-1]%10|0}if(n=n||r<0||null!=f[u+1]||(l<0?c:c%p[i-l-1]),n=t<4?(a||n)&&(0==t||t==(e.s<0?3:2)):5<a||5==a&&(4==t||n||6==t&&(0<o?0<l?c/p[i-l]:0:f[u-1])%10&1||t==(e.s<0?8:7)),r<1||!f[0])return f.length=0,n?(r-=e.e+1,f[0]=p[(L-r%L)%L],e.e=-r||0):f[0]=e.e=0,e;if(0==o?(f.length=u,s=1,u--):(f.length=u+1,s=p[L-o],f[u]=0<l?z(c/p[i-l]%p[l])*s:0),n)for(;;){if(0==u){for(o=1,l=f[0];10<=l;l/=10,o++);for(l=f[0]+=s,s=1;10<=l;l/=10,s++);o!=s&&(e.e++,f[0]==F&&(f[0]=1));break}if(f[u]+=s,f[u]!=F)break;f[u--]=0,s=1}for(o=f.length;0===f[--o];f.pop());}e.e>E?e.c=e.e=null:e.e<_&&(e.c=[e.e=0])}return e}function B(e){var r,t=e.e;return null===t?e.toString():(r=J(e.c),r=t<=d||m<=t?Z(r,t):X(r,t,"0"),e.s<0?"-"+r:r)}return k.clone=I,k.ROUND_UP=0,k.ROUND_DOWN=1,k.ROUND_CEIL=2,k.ROUND_FLOOR=3,k.ROUND_HALF_UP=4,k.ROUND_HALF_DOWN=5,k.ROUND_HALF_EVEN=6,k.ROUND_HALF_CEIL=7,k.ROUND_HALF_FLOOR=8,k.EUCLID=9,k.config=k.set=function(e){var r,t;if(null!=e){if("object"!=R(e))throw Error(U+"Object expected: "+e);if(e.hasOwnProperty(r="DECIMAL_PLACES")&&(H(t=e[r],0,G,r),y=t),e.hasOwnProperty(r="ROUNDING_MODE")&&(H(t=e[r],0,8,r),b=t),e.hasOwnProperty(r="EXPONENTIAL_AT")&&((t=e[r])&&t.pop?(H(t[0],-G,0,r),H(t[1],0,G,r),d=t[0],m=t[1]):(H(t,-G,G,r),d=-(m=t<0?-t:t))),e.hasOwnProperty(r="RANGE"))if((t=e[r])&&t.pop)H(t[0],-G,-1,r),H(t[1],1,G,r),_=t[0],E=t[1];else{if(H(t,-G,G,r),!t)throw Error(U+r+" cannot be zero: "+t);_=-(E=t<0?-t:t)}if(e.hasOwnProperty(r="CRYPTO")){if((t=e[r])!==!!t)throw Error(U+r+" not true or false: "+t);if(t){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw O=!t,Error(U+"crypto unavailable");O=t}else O=t}if(e.hasOwnProperty(r="MODULO_MODE")&&(H(t=e[r],0,9,r),i=t),e.hasOwnProperty(r="POW_PRECISION")&&(H(t=e[r],0,G,r),N=t),e.hasOwnProperty(r="FORMAT")){if("object"!=R(t=e[r]))throw Error(U+r+" not an object: "+t);S=t}if(e.hasOwnProperty(r="ALPHABET")){if("string"!=typeof(t=e[r])||/^.?$|[+\-.\s]|(.).*\1/.test(t))throw Error(U+r+" invalid: "+t);x="0123456789"==t.slice(0,10),A=t}}return{DECIMAL_PLACES:y,ROUNDING_MODE:b,EXPONENTIAL_AT:[d,m],RANGE:[_,E],CRYPTO:O,MODULO_MODE:i,POW_PRECISION:N,FORMAT:S,ALPHABET:A}},k.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!k.DEBUG)return!0;var r,t,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&-G<=i&&i<=G&&i===z(i))if(0===n[0]){if(0===i&&1===n.length)return!0}else if((r=(i+1)%L)<1&&(r+=L),String(n[0]).length==r){for(r=0;r<n.length;r++)if((t=n[r])<0||F<=t||t!==z(t))break e;if(0!==t)return!0}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(U+"Invalid BigNumber: "+e)},k.maximum=k.max=function(){return o(arguments,t.lt)},k.minimum=k.min=function(){return o(arguments,t.gt)},k.random=(r=9007199254740992,u=Math.random()*r&2097151?function(){return z(Math.random()*r)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var r,t,n,i,o,l=0,s=[],c=new k(g);if(null==e?e=y:H(e,0,G),i=Ar(e/L),O)if(crypto.getRandomValues){for(r=crypto.getRandomValues(new Uint32Array(i*=2));l<i;)9e15<=(o=131072*r[l]+(r[l+1]>>>11))?(t=crypto.getRandomValues(new Uint32Array(2)),r[l]=t[0],r[l+1]=t[1]):(s.push(o%1e14),l+=2);l=i/2}else{if(!crypto.randomBytes)throw O=!1,Error(U+"crypto unavailable");for(r=crypto.randomBytes(i*=7);l<i;)9e15<=(o=281474976710656*(31&r[l])+1099511627776*r[l+1]+4294967296*r[l+2]+16777216*r[l+3]+(r[l+4]<<16)+(r[l+5]<<8)+r[l+6])?crypto.randomBytes(7).copy(r,l):(s.push(o%1e14),l+=7);l=i/7}if(!O)for(;l<i;)(o=u())<9e15&&(s[l++]=o%1e14);for(i=s[--l],e%=L,i&&e&&(s[l]=z(i/(o=jr[L-e]))*o);0===s[l];s.pop(),l--);if(l<0)s=[n=0];else{for(n=-1;0===s[0];s.splice(0,1),n-=L);for(l=1,o=s[0];10<=o;o/=10,l++);l<L&&(n-=L-l)}return c.e=n,c.c=s,c}),k.sum=function(){for(var e=1,r=arguments,t=new k(r[0]);e<r.length;)t=t.plus(r[e++]);return t},w="0123456789",f=function(e,r,t,n,i){var o,l,s,c,u,a,f,p,h=e.indexOf("."),g=y,d=b;for(0<=h&&(c=N,N=0,e=e.replace(".",""),a=(p=new k(r)).pow(e.length-h),N=c,p.c=j(X(J(a.c),a.e,"0"),10,t,w),p.e=p.c.length),s=c=(f=j(e,r,t,i?(o=A,w):(o=w,A))).length;0==f[--c];f.pop());if(!f[0])return o.charAt(0);if(h<0?--s:(a.c=f,a.e=s,a.s=n,f=(a=v(a,p,g,d,t)).c,u=a.r,s=a.e),h=f[l=s+g+1],c=t/2,u=u||l<0||null!=f[l+1],u=d<4?(null!=h||u)&&(0==d||d==(a.s<0?3:2)):c<h||h==c&&(4==d||u||6==d&&1&f[l-1]||d==(a.s<0?8:7)),l<1||!f[0])e=u?X(o.charAt(1),-g,o.charAt(0)):o.charAt(0);else{if(f.length=l,u)for(--t;++f[--l]>t;)f[l]=0,l||(++s,f=[1].concat(f));for(c=f.length;!f[--c];);for(h=0,e="";h<=c;e+=o.charAt(f[h++]));e=X(e,s,o.charAt(0))}return e},v=function(e,r,t,n,i){var o,l,s,c,u,a,f,p,h,g,d,v,w,y,b,m,_,E=e.s==r.s?1:-1,O=e.c,N=r.c;if(!(O&&O[0]&&N&&N[0]))return new k(e.s&&r.s&&(O?!N||O[0]!=N[0]:N)?O&&0==O[0]||!N?0*E:E/0:NaN);for(h=(p=new k(E)).c=[],E=t+(l=e.e-r.e)+1,i||(i=F,l=q(e.e/L)-q(r.e/L),E=E/L|0),s=0;N[s]==(O[s]||0);s++);if(N[s]>(O[s]||0)&&l--,E<0)h.push(1),c=!0;else{for(y=O.length,m=N.length,E+=2,1<(u=z(i/(N[s=0]+1)))&&(N=P(N,u,i),O=P(O,u,i),m=N.length,y=O.length),w=m,d=(g=O.slice(0,m)).length;d<m;g[d++]=0);_=N.slice(),_=[0].concat(_),b=N[0],N[1]>=i/2&&b++;do{if(u=0,(o=C(N,g,m,d))<0){if(v=g[0],m!=d&&(v=v*i+(g[1]||0)),1<(u=z(v/b)))for(f=(a=P(N,u=i<=u?i-1:u,i)).length,d=g.length;1==C(a,g,f,d);)u--,$(a,m<f?_:N,f,i),f=a.length,o=1;else 0==u&&(o=u=1),f=(a=N.slice()).length;if($(g,a=f<d?[0].concat(a):a,d,i),d=g.length,-1==o)for(;C(N,g,m,d)<1;)u++,$(g,m<d?_:N,d,i),d=g.length}else 0===o&&(u++,g=[0])}while(h[s++]=u,g[0]?g[d++]=O[w]||0:(g=[O[w]],d=1),(w++<y||null!=g[0])&&E--);c=null!=g[0],h[0]||h.splice(0,1)}if(i==F){for(s=1,E=h[0];10<=E;E/=10,s++);T(p,t+(p.e=s+l*L-1)+1,n,c)}else p.e=l,p.r=+c;return p},l=/^(-?)0([xbo])(?=\w[\w.]*$)/i,s=/^([^.]+)\.$/,c=/^\.([^.]+)$/,a=/^-?(Infinity|NaN)$/,h=/^\s*\+(?=[\w.])|^\s+|\s+$/g,p=function(e,r,t,n){var i,o=t?r:r.replace(h,"");if(a.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!t&&(o=o.replace(l,function(e,r,t){return i="x"==(t=t.toLowerCase())?16:"b"==t?2:8,n&&n!=i?e:r}),n&&(i=n,o=o.replace(s,"$1").replace(c,"0.$1")),r!=o))return new k(o,i);if(k.DEBUG)throw Error(U+"Not a"+(n?" base "+n:"")+" number: "+r);e.s=null}e.c=e.e=null},t.absoluteValue=t.abs=function(){var e=new k(this);return e.s<0&&(e.s=1),e},t.comparedTo=function(e,r){return W(this,new k(e,r))},t.decimalPlaces=t.dp=function(e,r){var t,n;if(null!=e)return H(e,0,G),null==r?r=b:H(r,0,8),T(new k(this),e+this.e+1,r);if(!(e=this.c))return null;if(t=((n=e.length-1)-q(this.e/L))*L,n=e[n])for(;n%10==0;n/=10,t--);return t=t<0?0:t},t.dividedBy=t.div=function(e,r){return v(this,new k(e,r),y,b)},t.dividedToIntegerBy=t.idiv=function(e,r){return v(this,new k(e,r),0,1)},t.exponentiatedBy=t.pow=function(e,r){var t,n,i,o,l,s,c,u,a=this;if((e=new k(e)).c&&!e.isInteger())throw Error(U+"Exponent not an integer: "+B(e));if(null!=r&&(r=new k(r)),l=14<e.e,!a.c||!a.c[0]||1==a.c[0]&&!a.e&&1==a.c.length||!e.c||!e.c[0])return u=new k(Math.pow(+B(a),l?2-V(e):+B(e))),r?u.mod(r):u;if(s=e.s<0,r){if(r.c?!r.c[0]:!r.s)return new k(NaN);(n=!s&&a.isInteger()&&r.isInteger())&&(a=a.mod(r))}else{if(9<e.e&&(0<a.e||a.e<-1||(0==a.e?1<a.c[0]||l&&24e7<=a.c[1]:a.c[0]<8e13||l&&a.c[0]<=9999975e7)))return o=a.s<0&&V(e)?-0:0,-1<a.e&&(o=1/o),new k(s?1/o:o);N&&(o=Ar(N/L+2))}for(c=l?(t=new k(.5),s&&(e.s=1),V(e)):(i=Math.abs(+B(e)))%2,u=new k(g);;){if(c){if(!(u=u.times(a)).c)break;o?u.c.length>o&&(u.c.length=o):n&&(u=u.mod(r))}if(i){if(0===(i=z(i/2)))break;c=i%2}else if(T(e=e.times(t),e.e+1,1),14<e.e)c=V(e);else{if(0==(i=+B(e)))break;c=i%2}a=a.times(a),o?a.c&&a.c.length>o&&(a.c.length=o):n&&(a=a.mod(r))}return n?u:(s&&(u=g.div(u)),r?u.mod(r):o?T(u,N,b,void 0):u)},t.integerValue=function(e){var r=new k(this);return null==e?e=b:H(e,0,8),T(r,r.e+1,e)},t.isEqualTo=t.eq=function(e,r){return 0===W(this,new k(e,r))},t.isFinite=function(){return!!this.c},t.isGreaterThan=t.gt=function(e,r){return 0<W(this,new k(e,r))},t.isGreaterThanOrEqualTo=t.gte=function(e,r){return 1===(r=W(this,new k(e,r)))||0===r},t.isInteger=function(){return!!this.c&&q(this.e/L)>this.c.length-2},t.isLessThan=t.lt=function(e,r){return W(this,new k(e,r))<0},t.isLessThanOrEqualTo=t.lte=function(e,r){return-1===(r=W(this,new k(e,r)))||0===r},t.isNaN=function(){return!this.s},t.isNegative=function(){return this.s<0},t.isPositive=function(){return 0<this.s},t.isZero=function(){return!!this.c&&0==this.c[0]},t.minus=function(e,r){var t,n,i,o,l=this,s=l.s;if(r=(e=new k(e,r)).s,!s||!r)return new k(NaN);if(s!=r)return e.s=-r,l.plus(e);var c=l.e/L,u=e.e/L,a=l.c,f=e.c;if(!c||!u){if(!a||!f)return a?(e.s=-r,e):new k(f?l:NaN);if(!a[0]||!f[0])return f[0]?(e.s=-r,e):new k(a[0]?l:3==b?-0:0)}if(c=q(c),u=q(u),a=a.slice(),s=c-u){for((i=(o=s<0)?(s=-s,a):(u=c,f)).reverse(),r=s;r--;i.push(0));i.reverse()}else for(n=(o=(s=a.length)<(r=f.length))?s:r,s=r=0;r<n;r++)if(a[r]!=f[r]){o=a[r]<f[r];break}if(o&&(i=a,a=f,f=i,e.s=-e.s),0<(r=(n=f.length)-(t=a.length)))for(;r--;a[t++]=0);for(r=F-1;s<n;){if(a[--n]<f[n]){for(t=n;t&&!a[--t];a[t]=r);--a[t],a[n]+=F}a[n]-=f[n]}for(;0==a[0];a.splice(0,1),--u);return a[0]?D(e,a,u):(e.s=3==b?-1:1,e.c=[e.e=0],e)},t.modulo=t.mod=function(e,r){var t,n=this;return e=new k(e,r),!n.c||!e.s||e.c&&!e.c[0]?new k(NaN):!e.c||n.c&&!n.c[0]?new k(n):(9==i?(r=e.s,e.s=1,t=v(n,e,0,3),e.s=r,t.s*=r):t=v(n,e,0,i),(e=n.minus(t.times(e))).c[0]||1!=i||(e.s=n.s),e)},t.multipliedBy=t.times=function(e,r){var t,n,i,o,l,s,c,u,a,f,p,h=this,g=h.c,d=(e=new k(e,r)).c;if(!(g&&d&&g[0]&&d[0]))return!h.s||!e.s||g&&!g[0]&&!d||d&&!d[0]&&!g?e.c=e.e=e.s=null:(e.s*=h.s,g&&d?(e.c=[0],e.e=0):e.c=e.e=null),e;for(r=q(h.e/L)+q(e.e/L),e.s*=h.s,(s=g.length)<(h=d.length)&&(p=g,g=d,d=p,n=s,s=h,h=n),n=s+h,p=[];n--;p.push(0));for(n=h;0<=--n;){for(a=d[n]%1e7,f=d[n]/1e7|(t=0),i=n+(o=s);n<i;)t=((c=a*(c=g[--o]%1e7)+(l=f*c+(u=g[o]/1e7|0)*a)%1e7*1e7+p[i]+t)/1e14|0)+(l/1e7|0)+f*u,p[i--]=c%1e14;p[i]=t}return t?++r:p.splice(0,1),D(e,p,r)},t.negated=function(){var e=new k(this);return e.s=-e.s||null,e},t.plus=function(e,r){var t,n=this,i=n.s;if(r=(e=new k(e,r)).s,!i||!r)return new k(NaN);if(i!=r)return e.s=-r,n.minus(e);var o=n.e/L,l=e.e/L,s=n.c,c=e.c;if(!o||!l){if(!s||!c)return new k(i/0);if(!s[0]||!c[0])return c[0]?e:new k(s[0]?n:0*i)}if(o=q(o),l=q(l),s=s.slice(),i=o-l){for((t=0<i?(l=o,c):(i=-i,s)).reverse();i--;t.push(0));t.reverse()}for((i=s.length)-(r=c.length)<0&&(t=c,c=s,s=t,r=i),i=0;r;)i=(s[--r]=s[r]+c[r]+i)/F|0,s[r]=F===s[r]?0:s[r]%F;return i&&(s=[i].concat(s),++l),D(e,s,l)},t.precision=t.sd=function(e,r){var t,n;if(null!=e&&e!==!!e)return H(e,1,G),null==r?r=b:H(r,0,8),T(new k(this),e,r);if(!(r=this.c))return null;if(t=(n=r.length-1)*L+1,n=r[n]){for(;n%10==0;n/=10,t--);for(n=r[0];10<=n;n/=10,t++);}return t=e&&this.e+1>t?this.e+1:t},t.shiftedBy=function(e){return H(e,-kr,kr),this.times("1e"+e)},t.squareRoot=t.sqrt=function(){var e,r,t,n,i,o=this,l=o.c,s=o.s,c=o.e,u=y+4,a=new k("0.5");if(1!==s||!l||!l[0])return new k(!s||s<0&&(!l||l[0])?NaN:l?o:1/0);if((t=0==(s=Math.sqrt(+B(o)))||s==1/0?(((r=J(l)).length+c)%2==0&&(r+="0"),s=Math.sqrt(+r),c=q((c+1)/2)-(c<0||c%2),new k(r=s==1/0?"5e"+c:(r=s.toExponential()).slice(0,r.indexOf("e")+1)+c)):new k(s+"")).c[0])for((s=(c=t.e)+u)<3&&(s=0);;)if(i=t,t=a.times(i.plus(v(o,i,u,1))),J(i.c).slice(0,s)===(r=J(t.c)).slice(0,s)){if(t.e<c&&--s,"9999"!=(r=r.slice(s-3,s+1))&&(n||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(T(t,t.e+y+2,1),e=!t.times(t).eq(o));break}if(!n&&(T(i,i.e+y+2,0),i.times(i).eq(o))){t=i;break}u+=4,s+=4,n=1}return T(t,t.e+y+1,b,e)},t.toExponential=function(e,r){return null!=e&&(H(e,0,G),e++),n(this,e,r,1)},t.toFixed=function(e,r){return null!=e&&(H(e,0,G),e=e+this.e+1),n(this,e,r)},t.toFormat=function(e,r,t){if(null==t)null!=e&&r&&"object"==R(r)?(t=r,r=null):e&&"object"==R(e)?(t=e,e=r=null):t=S;else if("object"!=R(t))throw Error(U+"Argument not an object: "+t);if(e=this.toFixed(e,r),this.c){var n,r=e.split("."),i=+t.groupSize,o=+t.secondaryGroupSize,l=t.groupSeparator||"",s=r[0],r=r[1],c=this.s<0,u=c?s.slice(1):s,a=u.length;if(o&&(n=i,i=o,a-=o=n),0<i&&0<a){for(s=u.substr(0,n=a%i||i);n<a;n+=i)s+=l+u.substr(n,i);0<o&&(s+=l+u.slice(n)),c&&(s="-"+s)}e=r?s+(t.decimalSeparator||"")+((o=+t.fractionGroupSize)?r.replace(new RegExp("\\d{"+o+"}\\B","g"),"$&"+(t.fractionGroupSeparator||"")):r):s}return(t.prefix||"")+e+(t.suffix||"")},t.toFraction=function(e){var r,t,n,i,o,l,s,c,u,a,f=this,p=f.c;if(null!=e&&(!(s=new k(e)).isInteger()&&(s.c||1!==s.s)||s.lt(g)))throw Error(U+"Argument "+(s.isInteger()?"out of range: ":"not an integer: ")+B(s));if(!p)return new k(f);for(r=new k(g),u=t=new k(g),n=c=new k(g),p=J(p),o=r.e=p.length-f.e-1,r.c[0]=jr[(l=o%L)<0?L+l:l],e=!e||0<s.comparedTo(r)?0<o?r:u:s,l=E,E=1/0,s=new k(p),c.c[0]=0;a=v(s,r,0,1),1!=(i=t.plus(a.times(n))).comparedTo(e);)t=n,n=i,u=c.plus(a.times(i=u)),c=i,r=s.minus(a.times(i=r)),s=i;return i=v(e.minus(t),n,0,1),c=c.plus(i.times(u)),t=t.plus(i.times(n)),c.s=u.s=f.s,p=v(u,n,o*=2,b).minus(f).abs().comparedTo(v(c,t,o,b).minus(f).abs())<1?[u,n]:[c,t],E=l,p},t.toNumber=function(){return+B(this)},t.toPrecision=function(e,r){return null!=e&&H(e,1,G),n(this,e,r,2)},t.toString=function(e){var r,t=this,n=t.s,i=t.e;return null===i?n?(r="Infinity",n<0&&(r="-"+r)):r="NaN":(r=null==e?i<=d||m<=i?Z(J(t.c),i):X(J(t.c),i,"0"):10===e&&x?X(J((t=T(new k(t),y+i+1,b)).c),t.e,"0"):(H(e,2,A.length,"Base"),f(X(J(t.c),i,"0"),10,e,n,!0)),n<0&&t.c[0]&&(r="-"+r)),r},t.valueOf=t.toJSON=function(){return B(this)},t._isBigNumber=!0,t[Symbol.toStringTag]="BigNumber",t[Symbol.for("nodejs.util.inspect.custom")]=t.valueOf,null!=e&&k.set(e),k}();function Pr(e){for(var r=[];0<e.length;){var t=e.shift();if(x(t)){if(r.length<2)throw new Error("错误的栈长度, 可能是无法计算的表达式");var n=r.pop(),i=r.pop();if("string"==typeof n&&!E.isBigNumber(n)){if(!u(n))throw new Error("".concat(n,"不是一个合法的数字"));n=new E(n)}if("string"==typeof i&&!E.isBigNumber(i)){if(!u(i))throw new Error("".concat(i,"不是一个合法的数字"));i=new E(i)}switch(t){case"+":r.push(i.plus(n));break;case"-":r.push(i.minus(n));break;case"*":r.push(i.times(n));break;case"/":r.push(i.div(n));break;case"%":r.push(i.mod(n));break;case"**":r.push(i.pow(n))}}else r.push(t)}if(1!==r.length)throw"unvalid expression";var o=r[0];if((o=E.isBigNumber(o)?o:E(o)).isNaN())throw new Error("计算结果为NaN");return o}function Cr(e,r,t){var n="";if(E.isBigNumber(e)?n=e.toFixed():"string"!=typeof e&&(n=e.toString()),"undefined"===n||"NaN"===n)return null;var i,o,l,s,c,u,a,f,p,h=null,g=null,d=!1,v=!1,w="~-",y=!1,b=!1,m=!1,_=!1;return r.forEach(function(e){var r=e.type;if("symbol"===r){if(![">=","<=","=","<",">"].includes(e.value))throw new Error("错误的格式化参数:",e.value);g=e.value}else if("to-number"===r)_=!0;else if("comma"===r)d=!0;else if("number"===r)h=e.value;else if("plus"===r)v=!0;else if("round"===r)w=e.value;else if("fraction"===r)b=!0;else if("scientific"===r)y=!0;else{if("percent"!==r)throw new Error("错误的fmt Token");m=!0}}),y?(e=E(n).toExponential(),v&&!e.startsWith("-")?"+"+e:e):b?(r=E(n).toFraction().map(function(e){return e.toFixed()}).join("/"),v&&!r.startsWith("-")?"+"+r:r):(m&&(n=E(n).times(100).toFixed()),h&&(e=n.split("."),r=e[0],e=1===e.length?"":e[1],l=g,s=+h,f=w,c=i=r,a=(u=o=e).length,p={"~-":function(){u=o.slice(0,"<"===l?s-1:s)},"~+":function(){var e,r="<"===l?s-1:s;a<=r||0===a||(e=o.slice(0,r),0!=+o.slice(r,a)&&(e=(+e+1).toString()).length>r?(u=e.slice(1,e.length),c=(+c+1).toString()):u=e)},"~5":function(){var e,r;0!==a&&(u=o.slice(0,e="<"===l?s-1:s),r=+o[e],Number.isNaN(r)||5<=r&&(u=(+u+1).toString()).length>e&&(u=u.slice(1,u.length),c=(+c+1).toString()))},"~6":function(){var e,r,t,n;0!==a&&(r=+o[e="<"===l?s-1:s],t=""===(t=o.slice(+e+1,o.length))?0:parseInt(t),n=0===e?+i[i.length-1]:+o[e-1],u=o.slice(0,e),(6<=r||5==r&&0<t||5==r&&n%2!=0)&&(u=(+u+1).toString()).length>e&&(u=u.slice(1,u.length),c=(+c+1).toString()))}},"<="===l?u=a<=s?o:(p[f]&&p[f](),u.replace(/0+$/,"")):"<"===l?u=a<s?o:(p[f]&&p[f](),u.replace(/0+$/,"")):"="===l?a<s?u=o+"0".repeat(s-a):s<a&&p[f]&&p[f]():">="===l?a<s&&(u=o+"0".repeat(s-a)):">"===l&&a<=s&&(u=o+"0".repeat(s-a+1)),r=(p={int_part:c,dec_part:u}).int_part,n=""===(e=p.dec_part)?r:"".concat(r,".").concat(e)),d&&(_=!1,n=1<(f=n.split(".")).length?((p=f[0]).includes("-")?f[0]=p[0]+p.slice(1).replace(/(?=(?!^)(?:\d{3})+$)/g,","):f[0]=p.replace(/(?=(?!^)(?:\d{3})+$)/g,","),f.join(".")):(r=f[0]).includes("-")?r[0]+r.slice(1).replace(/(?=(?!^)(?:\d{3})+$)/g,","):r.replace(/(?=(?!^)(?:\d{3})+$)/g,",")),v&&(_=!1,n.startsWith("-")||(n="+"+n)),m&&(_=!1,n+="%"),_&&!t?+n:n)}function $r(e,i){return e.map(function(e){if("var"!==e.type)return e;for(var r,t,n=0;n<i.length&&!h(r=w(i[n],e.value));n++);if("number"==typeof(t=r)||u(t))return{type:"number",value:r};throw new Error("错误的填充值")})}function Dr(e){var t=null;return e.length,{tokens:e.map(function(e){var r=function(e){for(var r,t,n=null,i=null,o=[/^([+-]?[\d.]+(?:e|E)(?:\+|-)?\d+)(.*)$/,/^([+-]?[\d.]+)(.*)$/],l=0;l<o.length;l++){var s=e.match(o[l]);if(s){r=s;break}}return r&&(i=r[1],""!==(t=r[2]).trim()&&(n=t)),{num:i,unit:n}}(e.value);return null!==r.unit?(null==t&&(t=r.unit),{type:"number",value:r.num}):e}),unit:t}}var Tr=!1;var r="#ff8936",i="#fff",s="#67C23A",t="#ee7959",b={expr:"background: ".concat(r,";color: ").concat(i,";font-weight: bold;border-radius: 4px; padding: 3px 8px;"),label1:"color: ".concat(s,"; font-weight: bold; white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"),label2:"color: ".concat(t,"; font-weight: bold; white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"),nowrap:"white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"};function m(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];var n,i=function(e){var r="",t=e[0],n=e[1],i={origin_expr:t,origin_fill_data:n,expr:"",fmt_tokens:null,options:null,fmt_err:!1,expr_err:!1},n=(h(n)&&(i.options=n),w(n,"_error",!1));if(0===e.length)throw new Error("至少传入一个参数");if("string"==typeof t){if(""===(r=t).trim()||t.includes("NaN"))return i.expr_err=!0,i}else{if("number"!=typeof t){if(!0===n)return i.expr_err=!0,i;throw new Error("错误的第一个参数类型: ".concat(t," 类型为:").concat(R(t)))}r=t.toString()}if(e=r.split("|"),i.expr=e[0],1<e.length){n=e[1];if(""!==n.trim())try{i.fmt_tokens=$(n)}catch(e){return i.fmt_err=!0,i}}if(null!==i.options&&i.options._fmt){var o,t=[];try{t=$(i.options._fmt)}catch(e){return i.fmt_err=!0,i}null===i.fmt_tokens?i.fmt_tokens=t:(o=i.fmt_tokens.map(function(e){return e.type}),t.forEach(function(e){o.includes(e.type)||i.fmt_tokens.push(e)}))}return i}(r),o=w(i,"options._error",void 0),l=w(i,"options._debug",!1),s=w(i,"options._unit",!1),c=i.options,u=null;if(i.fmt_err||i.expr_err){if(h(o))return o;throw new Error("表达式或格式化字符串错误,表达式为:".concat(i.expr))}var a=i.fmt_tokens;if(h(o))try{n=Er(i.expr,s)}catch(e){return o}else n=Er(i.expr,s);if(j(c))f=n;else{var f,p=[];if(Array.isArray(c)?p=c:(p.push(c),h(c=w(c,"_fill_data",{}))&&(Array.isArray(c)?p=[].concat(O(p),O(c)):p.push(c))),h(o))try{f=Or(n,p,s),P(i.fmt_tokens)&&(a=$r(i.fmt_tokens,p))}catch(e){return o}else f=Or(n,p,s),P(i.fmt_tokens)&&(a=$r(i.fmt_tokens,p));[!0,"on","auto","space"].includes(s)&&(u=(c=Dr(f)).unit,f=c.tokens)}p=Nr(f),c=null;if(h(o))try{c=Pr(p)}catch(e){return o}else c=Pr(p);if("Infinity"!==(c=P(a)?Cr(c,a,s):null!==c?c.toFixed():null)&&null!==c)return null!==u&&(c+=u),(Tr||l)&&(console.groupCollapsed("%c"+i.origin_expr,b.expr),console.groupCollapsed("%c表达式: %c%s",b.label1,b.nowrap,i.origin_expr),console.log(i.origin_expr),console.groupEnd(),console.groupCollapsed("%c数据源: %c%s",b.label1,b.nowrap,JSON.stringify(i.origin_fill_data)),console.log(i.origin_fill_data),console.groupEnd(),console.groupCollapsed("%c结果: %c%s",b.label1,b.nowrap,JSON.stringify(c)),console.log(c),console.groupEnd(),console.groupCollapsed("%ctokens: %c%s",b.label1,b.nowrap,JSON.stringify(n)),console.log(n),console.groupEnd(),console.groupCollapsed("%cfilled-tokens: %c%s",b.label1,b.nowrap,JSON.stringify(f)),console.log(f),console.groupEnd(),console.groupCollapsed("%cfmt-tokens: %c%s",b.label1,b.nowrap,JSON.stringify(i.fmt_tokens)),console.log(i.fmt_tokens),console.groupEnd(),console.groupCollapsed("%cfmt-filled-tokens: %c%s",b.label1,b.nowrap,JSON.stringify(a)),console.log(a),console.groupEnd(),console.groupCollapsed("%cpostfix-tokens: %c%s",b.label1,b.nowrap,JSON.stringify(p)),console.log(p),console.groupEnd(),console.groupCollapsed("%c单位: %c%s",b.label1,b.nowrap,u),console.log(u),console.groupEnd(),console.groupCollapsed("%cparse-arg: %c%s",b.label1,b.nowrap,JSON.stringify(i)),console.log(i),console.groupEnd(),console.groupEnd()),c;if(h(o))return o;throw new Error("计算错误可能是非法的计算式")}console.log("%ca-calc:%c ".concat(N," %c=> %curl:%c https://www.npmjs.com/package/a-calc"),"color: #fff;background: #67C23A;padding: 2px 5px;border-radius:4px;font-size: 14px;","color: #67C23A;font-size:14px;","color: #67C23A;font-size:14px;","background: #67C23A;font-size:14px; padding: 2px 5px; border-radius: 4px; color: #fff;","font-size:14px;");a=m;return e.calc=m,e.calc_wrap=function(r,t){var n={},i={_error:"-"};return["string","number"].includes(R(r))?(Array.isArray(t)||void 0===t||Object.keys(t).forEach(function(e){return e.startsWith("_")&&(i[e]=t[e])}),n=null!=t?t:{},/[a-zA-Z_$]/.test(r.toString())?void 0!==t?(n=t,m(r,o(o({},i),n))):function(e){return m(r,o(o({},i),{},{data:e}))}:m(r,o(o({},i),n))):(n=r,function(e){return m(e,o(o({},i),n))})},e.close_debug=function(){Tr=!1},e.fmt=a,e.open_debug=function(){Tr=!0},e.version=N,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
var a_calc=function(e){"use strict";function _(r,e){var t,n=Object.keys(r);return Object.getOwnPropertySymbols&&(t=Object.getOwnPropertySymbols(r),e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),n.push.apply(n,t)),n}function o(n){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?_(Object(i),!0).forEach(function(e){var r,t;r=n,t=i[e=e],e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):_(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}function R(e){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function O(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,r){if(e){if("string"==typeof e)return n(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(t="Object"===t&&e.constructor?e.constructor.name:t)||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?n(e,r):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var N="1.2.20",S=/^[+-]?\d[\d.]*(?:e\+|E\+|e-|E-|e|E)?\d*$/,A=/^[+-]?\d[\d.]*(?:e\+|E\+|e-|E-|e|E)?\d*\D*$/;function x(e){return-1<"+-*/%()**".indexOf(e)}function k(e){switch(e){case"+":case"-":return 1;case"*":case"/":case"%":return 2;case"**":return 3;default:return 0}}function h(e){return void 0!==e}function j(e){return null===e}function P(e){return null!==e}function u(e){return"string"==typeof e&&!!S.test(e)}var l={initial:"initial",number:"number",variable:"var",symbol:"symbol",percent:"percent",round:"round",plus:"plus",comma:"comma",fraction:"fraction",to_number:"to-number",scientific:"scientific"},C="<>=";function $(e){for(var r=l.initial,t=[],n=[];e;){var i=e[0];if(r===l.initial)if(/\s/.test(i))e=e.slice(1);else if(C.includes(i))r=l.symbol,t.push(i),e=e.slice(1);else if(","===i)r=l.initial,n.push({type:"comma",value:i}),e=e.slice(1);else if(/[a-zA-Z_]/.test(i))r=l.variable,t.push(i),e=e.slice(1);else if(/\d/.test(i))r=l.number,t.push(i),e=e.slice(1);else if("+"===i)r=l.initial,n.push({type:"plus",value:i}),e=e.slice(1);else if("~"===i)r=l.round,t.push(i),e=e.slice(1);else if("%"===i)r=l.initial,n.push({type:"percent",value:i}),e=e.slice(1);else if("/"===i)r=l.initial,n.push({type:"fraction",value:i}),e=e.slice(1);else{if("!"!==i)throw new Error("不识别的fmt字符:".concat(i));if(r=l.initial,/[Ee]/.test(e[1]))n.push({type:"scientific",value:e[1]}),e=e.slice(2);else{if(!/[Nn]/.test(e[1]))throw new Error("不识别的fmt字符:".concat(e.slice(2)));n.push({type:"to-number",value:e[1]}),e=e.slice(2)}}else if(r===l.number)/\d/.test(i)?(t.push(i),e=e.slice(1)):(n.push({type:"number",value:t.join("")}),t.length=0,r=l.initial);else if(r===l.variable)/[\$\w_\-.\[\]"']/.test(i)?(t.push(i),e=e.slice(1)):(n.push({type:"var",value:t.join("")}),t.length=0,r=l.initial);else if(r===l.symbol)/\s/.test(i)?e=e.slice(1):C.includes(i)?(t.push(i),e=e.slice(1)):(n.push({type:"symbol",value:t.join("")}),t.length=0,r=l.initial);else{if(r!==l.round)throw new Error("错误的自动机状态");if(/\s/.test(i))e=e.slice(1);else{if(!("56+-".includes(i)&&t.length<2))throw new Error("舍入格式化语法错误:".concat(i));t.push(i),e=e.slice(1),n.push({type:"round",value:t.join("")}),t.length=0,r=l.initial}}}if(0<t.length&&(n.push({type:r,value:t.join("")}),t.length=0,r=l.initial),1<n.filter(function(e){return"number"===e.type}).length)throw new Error("格式化字符串错误,发现多余的数字");return n}var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=Array.isArray,r="object"==R(r)&&r&&r.Object===Object&&r,i="object"==("undefined"==typeof self?"undefined":R(self))&&self&&self.Object===Object&&self,r=r||i||Function("return this")(),i=r.Symbol,s=Object.prototype,D=s.hasOwnProperty,T=s.toString,c=i?i.toStringTag:void 0;var B=Object.prototype.toString;var I=function(e){var r=D.call(e,c),t=e[c];try{var n=!(e[c]=void 0)}catch(e){}var i=T.call(e);return n&&(r?e[c]=t:delete e[c]),i},Y=function(e){return B.call(e)},K=i?i.toStringTag:void 0;function Q(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":(K&&K in Object(e)?I:Y)(e)}var ee=Q,re=function(e){return null!=e&&"object"==R(e)};function te(e){return"symbol"==R(e)||re(e)&&"[object Symbol]"==ee(e)}var ne=t,ie=te,oe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,le=/^\w*$/;function se(e,r){if(ne(e))return!1;var t=R(e);return!("number"!=t&&"symbol"!=t&&"boolean"!=t&&null!=e&&!ie(e))||(le.test(e)||!oe.test(e)||null!=r&&e in Object(r))}function ce(e){var r=R(e);return null!=e&&("object"==r||"function"==r)}var ue=Q,ae=ce;function fe(e){return!!ae(e)&&("[object Function]"==(e=ue(e))||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e)}var s=r["__core-js_shared__"],pe=(s=/[^.]+$/.exec(s&&s.keys&&s.keys.IE_PROTO||""))?"Symbol(src)_1."+s:"";var he=Function.prototype.toString;var ge=fe,de=function(e){return!!pe&&pe in e},ve=ce,we=function(e){if(null!=e){try{return he.call(e)}catch(e){}try{return e+""}catch(e){}}return""},ye=/^\[object .+?Constructor\]$/,s=Function.prototype,a=Object.prototype,s=s.toString,a=a.hasOwnProperty,be=RegExp("^"+s.call(a).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var me=function(e){return!(!ve(e)||de(e))&&(ge(e)?be:ye).test(we(e))},_e=function(e,r){return null==e?void 0:e[r]};function Ee(e,r){return e=_e(e,r),me(e)?e:void 0}var s=Ee(Object,"create"),Oe=s;var Ne=s,Se=Object.prototype.hasOwnProperty;var Ae=s,xe=Object.prototype.hasOwnProperty;var ke=s;function je(e){return e=this.has(e)&&delete this.__data__[e],this.size-=e?1:0,e}function Pe(e){var r,t=this.__data__;return Ne?"__lodash_hash_undefined__"===(r=t[e])?void 0:r:Se.call(t,e)?t[e]:void 0}function Ce(e){var r=this.__data__;return Ae?void 0!==r[e]:xe.call(r,e)}function $e(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=ke&&void 0===r?"__lodash_hash_undefined__":r,this}function f(e){var r=-1,t=null==e?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}f.prototype.clear=function(){this.__data__=Oe?Oe(null):{},this.size=0},f.prototype.delete=je,f.prototype.get=Pe,f.prototype.has=Ce,f.prototype.set=$e;a=f;var De=function(e,r){return e===r||e!=e&&r!=r};function p(e,r){for(var t=e.length;t--;)if(De(e[t][0],r))return t;return-1}var Te=p,Be=Array.prototype.splice;var Ie=p;var Re=p;var ze=p;function Ue(e){var r=this.__data__;return!((e=Te(r,e))<0)&&(e==r.length-1?r.pop():Be.call(r,e,1),--this.size,!0)}function Fe(e){var r=this.__data__;return(e=Ie(r,e))<0?void 0:r[e][1]}function Le(e){return-1<Re(this.__data__,e)}function Me(e,r){var t=this.__data__,n=ze(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}function g(e){var r=-1,t=null==e?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}g.prototype.clear=function(){this.__data__=[],this.size=0},g.prototype.delete=Ue,g.prototype.get=Fe,g.prototype.has=Le,g.prototype.set=Me;var s=g,r=Ee(r,"Map"),Ge=a,qe=s,Je=r;var We=function(e){var r=R(e);return"string"==r||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==e:null===e};function d(e,r){return e=e.__data__,We(r)?e["string"==typeof r?"string":"hash"]:e.map}var He=d;var Ve=d;var Ze=d;var Xe=d;function Ye(e){return e=He(this,e).delete(e),this.size-=e?1:0,e}function Ke(e){return Ve(this,e).get(e)}function Qe(e){return Ze(this,e).has(e)}function er(e,r){var t=Xe(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}function v(e){var r=-1,t=null==e?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}v.prototype.clear=function(){this.size=0,this.__data__={hash:new Ge,map:new(Je||qe),string:new Ge}},v.prototype.delete=Ye,v.prototype.get=Ke,v.prototype.has=Qe,v.prototype.set=er;var rr=v;function tr(n,i){if("function"!=typeof n||null!=i&&"function"!=typeof i)throw new TypeError("Expected a function");function o(){var e=arguments,r=i?i.apply(this,e):e[0],t=o.cache;return t.has(r)?t.get(r):(e=n.apply(this,e),o.cache=t.set(r,e)||t,e)}return o.cache=new(tr.Cache||rr),o}tr.Cache=rr;var nr=tr;var ir=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,or=/\\(\\)?/g,a=function(e){var r=(e=nr(e,function(e){return 500===r.size&&r.clear(),e})).cache;return e}(function(e){var i=[];return 46===e.charCodeAt(0)&&i.push(""),e.replace(ir,function(e,r,t,n){i.push(t?n.replace(or,"$1"):r||e)}),i});var lr=function(e,r){for(var t=-1,n=null==e?0:e.length,i=Array(n);++t<n;)i[t]=r(e[t],t,e);return i},sr=t,cr=te,s=i?i.prototype:void 0,ur=s?s.toString:void 0;var ar=function e(r){if("string"==typeof r)return r;if(sr(r))return lr(r,e)+"";if(cr(r))return ur?ur.call(r):"";var t=r+"";return"0"==t&&1/r==-1/0?"-0":t};var fr=t,pr=se,hr=a,gr=function(e){return null==e?"":ar(e)};var dr=te;var vr=function(e,r){return fr(e)?e:pr(e,r)?[e]:hr(gr(e))},wr=function(e){if("string"==typeof e||dr(e))return e;var r=e+"";return"0"==r&&1/e==-1/0?"-0":r};var yr=function(e,r){for(var t=0,n=(r=vr(r,e)).length;null!=e&&t<n;)e=e[wr(r[t++])];return t&&t==n?e:void 0};var w=function(e,r,t){return void 0===(e=null==e?void 0:yr(e,r))?t:e};var y={initial:"initial",number:"number",scientific:"scientific",operator:"operator",bracket:"bracket",var:"var"},br="+-",mr="*/%",_r="()";function Er(e,r){for(var t,n,i,o=1<arguments.length&&void 0!==r&&r,l=y.initial,s=[],c=[],u=function(){s.push(t),e=e.slice(1)},a=function(e){c.push({type:e,value:s.join("")}),s.length=0},f=function(){e=e.slice(1)};e;)switch(t=e[0],l){case y.initial:if(br.includes(t)){var p=c.at(-1),l=0===c.length||"operator"===p.type||"("===p?y.number:y.operator;u()}else if(mr.includes(t))l=y.operator,u();else if(/\d/.test(t))l=y.number,u();else if(_r.includes(t))l=y.bracket;else if(/[a-zA-Z_$]/.test(t))l=y.var,u();else{if(!/\s/.test(t))throw new Error("不识别的字符".concat(t));f()}break;case y.bracket:c.push({type:y.bracket,value:t}),f(),l=y.initial;break;case y.operator:p=s.at(-1);"*"===t&&"*"===p&&u(),a(y.operator),l=y.initial;break;case y.number:if(/\d/.test(t))u();else if("."===t){if(0===s.length||s.includes("."))throw new Error("非法的小数部分".concat(s.join("")));u()}else"Ee".includes(t)?(l=y.scientific,u()):["auto","on",!0].includes(o)&&/[^*/+\-()\s]/.test(t)||"space"===o&&/\S/.test(t)?u():(a(y.number),l=y.initial);break;case y.scientific:/\d/.test(t)?u():br.includes(t)?(n=s.slice(1),i=s.at(-1),n.includes(t)||!/[Ee]/.test(i)?(a(y.scientific),l=y.initial):u()):["auto","on",!0].includes(o)&&/[^*/+\-()\s]/.test(t)||"space"===o&&/\S/.test(t)?u():(a(y.scientific),l=y.initial);break;case y.var:/[\w_.\[\]"']/.test(t)?u():(a(y.var),l=y.initial);break;default:throw new Error("状态错误")}return 0!==s.length&&(c.push({type:l,value:s.join("")}),s.length=0,l=y.initial),c}function Or(e,r,t){if(j(r))throw new Error("错误的填充数据:",r);for(var n=[],i=0;i<e.length;i++){var o=e[i];if("var"!==o.type)n.push(o);else{if("undefined"===o.value||"NaN"===o.value)throw new Error("key不应该为:".concat(o.value));for(var l=null,s=0;s<r.length;s++){var c=r[s],c=w(c,o.value);if(void 0!==c){l=c;break}}if(null===l)throw new Error("token填充失败,请确认".concat(o,"存在"));if("string"==typeof l){if(""===l.trim())throw new Error("token填充失败,".concat(o.value,"值不可为空字符"));if([!0,"on","auto","space"].includes(t)){if(!A.test(l))throw new Error("token填充失败,".concat(o.value,"值:").concat(l,"为非法单位数字"))}else if(!u(l))throw new Error("token填充失败,".concat(o,"值:").concat(l,"为非法数字"))}l="string"!=typeof l?l.toString():l,n.push({type:"number",value:l})}}return n}function Nr(e){for(var r,t=[],n=[],i=e.map(function(e){return e.value});0<i.length;){var o=i.shift();if(x(o))if("("===o)t.push(o);else if(")"===o){for(var l=t.pop();"("!==l&&0<t.length;)n.push(l),l=t.pop();if("("!==l)throw"error: unmatched ()"}else{for(;r=t[t.length-1],k(o)<=k(r)&&0<t.length;)n.push(t.pop());t.push(o)}else n.push(o)}if(0<t.length){if(")"===t[t.length-1]||"("===t[t.length-1])throw"error: unmatched ()";for(;0<t.length;)n.push(t.pop())}return n}var Sr=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Ar=Math.ceil,z=Math.floor,U="[BigNumber Error] ",xr=U+"Number primitive has more than 15 significant digits: ",F=1e14,L=14,kr=9007199254740991,jr=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],M=1e7,G=1e9;function q(e){var r=0|e;return 0<e||e===r?r:r-1}function J(e){for(var r,t,n=1,i=e.length,o=e[0]+"";n<i;){for(r=e[n++]+"",t=L-r.length;t--;r="0"+r);o+=r}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function W(e,r){var t,n,i=e.c,o=r.c,l=e.s,s=r.s,e=e.e,r=r.e;if(!l||!s)return null;if(t=i&&!i[0],n=o&&!o[0],t||n)return t?n?0:-s:l;if(l!=s)return l;if(t=l<0,n=e==r,!i||!o)return n?0:!i^t?1:-1;if(!n)return r<e^t?1:-1;for(s=(e=i.length)<(r=o.length)?e:r,l=0;l<s;l++)if(i[l]!=o[l])return i[l]>o[l]^t?1:-1;return e==r?0:r<e^t?1:-1}function H(e,r,t,n){if(e<r||t<e||e!==z(e))throw Error(U+(n||"Argument")+("number"==typeof e?e<r||t<e?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function V(e){var r=e.c.length-1;return q(e.e/L)==r&&e.c[r]%2!=0}function Z(e,r){return(1<e.length?e.charAt(0)+"."+e.slice(1):e)+(r<0?"e":"e+")+r}function X(e,r,t){var n,i;if(r<0){for(i=t+".";++r;i+=t);e=i+e}else if(++r>(n=e.length)){for(i=t,r-=n;--r;i+=t);e+=i}else r<n&&(e=e.slice(0,r)+"."+e.slice(r));return e}var E=function I(e){var v,f,p,r,u,w,l,s,c,a,h,t=k.prototype={constructor:k,toString:null,valueOf:null},g=new k(1),y=20,b=4,d=-7,m=21,_=-1e7,E=1e7,O=!1,i=1,N=0,S={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},A="0123456789abcdefghijklmnopqrstuvwxyz",x=!0;function k(e,r){var t,n,i,o,l,s,c,u,a=this;if(!(a instanceof k))return new k(e,r);if(null==r){if(e&&!0===e._isBigNumber)return a.s=e.s,void(!e.c||e.e>E?a.c=a.e=null:e.e<_?a.c=[a.e=0]:(a.e=e.e,a.c=e.c.slice()));if((s="number"==typeof e)&&0*e==0){if(a.s=1/e<0?(e=-e,-1):1,e===~~e){for(o=0,l=e;10<=l;l/=10,o++);return void(E<o?a.c=a.e=null:(a.e=o,a.c=[e]))}u=String(e)}else{if(!Sr.test(u=String(e)))return p(a,u,s);a.s=45==u.charCodeAt(0)?(u=u.slice(1),-1):1}0<(l=(u=-1<(o=u.indexOf("."))?u.replace(".",""):u).search(/e/i))?(o<0&&(o=l),o+=+u.slice(l+1),u=u.substring(0,l)):o<0&&(o=u.length)}else{if(H(r,2,A.length,"Base"),10==r&&x)return T(a=new k(e),y+a.e+1,b);if(u=String(e),s="number"==typeof e){if(0*e!=0)return p(a,u,s,r);if(a.s=1/e<0?(u=u.slice(1),-1):1,k.DEBUG&&15<u.replace(/^0\.0*|\./,"").length)throw Error(xr+e)}else a.s=45===u.charCodeAt(0)?(u=u.slice(1),-1):1;for(t=A.slice(0,r),o=l=0,c=u.length;l<c;l++)if(t.indexOf(n=u.charAt(l))<0){if("."==n){if(o<l){o=c;continue}}else if(!i&&(u==u.toUpperCase()&&(u=u.toLowerCase())||u==u.toLowerCase()&&(u=u.toUpperCase()))){i=!0,l=-1,o=0;continue}return p(a,String(e),s,r)}s=!1,-1<(o=(u=f(u,r,10,a.s)).indexOf("."))?u=u.replace(".",""):o=u.length}for(l=0;48===u.charCodeAt(l);l++);for(c=u.length;48===u.charCodeAt(--c););if(u=u.slice(l,++c)){if(c-=l,s&&k.DEBUG&&15<c&&(kr<e||e!==z(e)))throw Error(xr+a.s*e);if((o=o-l-1)>E)a.c=a.e=null;else if(o<_)a.c=[a.e=0];else{if(a.e=o,a.c=[],l=(o+1)%L,o<0&&(l+=L),l<c){for(l&&a.c.push(+u.slice(0,l)),c-=L;l<c;)a.c.push(+u.slice(l,l+=L));l=L-(u=u.slice(l)).length}else l-=c;for(;l--;u+="0");a.c.push(+u)}}else a.c=[a.e=0]}function j(e,r,t,n){for(var i,o,l=[0],s=0,c=e.length;s<c;){for(o=l.length;o--;l[o]*=r);for(l[0]+=n.indexOf(e.charAt(s++)),i=0;i<l.length;i++)l[i]>t-1&&(null==l[i+1]&&(l[i+1]=0),l[i+1]+=l[i]/t|0,l[i]%=t)}return l.reverse()}function P(e,r,t){var n,i,o,l=0,s=e.length,c=r%M,u=r/M|0;for(e=e.slice();s--;)l=((i=c*(o=e[s]%M)+(n=u*o+(o=e[s]/M|0)*c)%M*M+l)/t|0)+(n/M|0)+u*o,e[s]=i%t;return e=l?[l].concat(e):e}function C(e,r,t,n){var i,o;if(t!=n)o=n<t?1:-1;else for(i=o=0;i<t;i++)if(e[i]!=r[i]){o=e[i]>r[i]?1:-1;break}return o}function $(e,r,t,n){for(var i=0;t--;)e[t]-=i,i=e[t]<r[t]?1:0,e[t]=i*n+e[t]-r[t];for(;!e[0]&&1<e.length;e.splice(0,1));}function n(e,r,t,n){var i,o,l,s;if(null==t?t=b:H(t,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,null==r)s=J(e.c),s=1==n||2==n&&(o<=d||m<=o)?Z(s,o):X(s,o,"0");else if(t=(e=T(new k(e),r,t)).e,l=(s=J(e.c)).length,1==n||2==n&&(r<=t||t<=d)){for(;l<r;s+="0",l++);s=Z(s,t)}else if(r-=o,s=X(s,t,"0"),l<t+1){if(0<--r)for(s+=".";r--;s+="0");}else if(0<(r+=t-l))for(t+1==l&&(s+=".");r--;s+="0");return e.s<0&&i?"-"+s:s}function o(e,r){for(var t,n=1,i=new k(e[0]);n<e.length;n++){if(!(t=new k(e[n])).s){i=t;break}r.call(i,t)&&(i=t)}return i}function D(e,r,t){for(var n=1,i=r.length;!r[--i];r.pop());for(i=r[0];10<=i;i/=10,n++);return(t=n+t*L-1)>E?e.c=e.e=null:t<_?e.c=[e.e=0]:(e.e=t,e.c=r),e}function T(e,r,t,n){var i,o,l,s,c,u,a,f=e.c,p=jr;if(f){e:{for(i=1,s=f[0];10<=s;s/=10,i++);if((o=r-i)<0)o+=L,l=r,a=(c=f[u=0])/p[i-l-1]%10|0;else if((u=Ar((o+1)/L))>=f.length){if(!n)break e;for(;f.length<=u;f.push(0));c=a=0,l=(o%=L)-L+(i=1)}else{for(c=s=f[u],i=1;10<=s;s/=10,i++);a=(l=(o%=L)-L+i)<0?0:c/p[i-l-1]%10|0}if(n=n||r<0||null!=f[u+1]||(l<0?c:c%p[i-l-1]),n=t<4?(a||n)&&(0==t||t==(e.s<0?3:2)):5<a||5==a&&(4==t||n||6==t&&(0<o?0<l?c/p[i-l]:0:f[u-1])%10&1||t==(e.s<0?8:7)),r<1||!f[0])return f.length=0,n?(r-=e.e+1,f[0]=p[(L-r%L)%L],e.e=-r||0):f[0]=e.e=0,e;if(0==o?(f.length=u,s=1,u--):(f.length=u+1,s=p[L-o],f[u]=0<l?z(c/p[i-l]%p[l])*s:0),n)for(;;){if(0==u){for(o=1,l=f[0];10<=l;l/=10,o++);for(l=f[0]+=s,s=1;10<=l;l/=10,s++);o!=s&&(e.e++,f[0]==F&&(f[0]=1));break}if(f[u]+=s,f[u]!=F)break;f[u--]=0,s=1}for(o=f.length;0===f[--o];f.pop());}e.e>E?e.c=e.e=null:e.e<_&&(e.c=[e.e=0])}return e}function B(e){var r,t=e.e;return null===t?e.toString():(r=J(e.c),r=t<=d||m<=t?Z(r,t):X(r,t,"0"),e.s<0?"-"+r:r)}return k.clone=I,k.ROUND_UP=0,k.ROUND_DOWN=1,k.ROUND_CEIL=2,k.ROUND_FLOOR=3,k.ROUND_HALF_UP=4,k.ROUND_HALF_DOWN=5,k.ROUND_HALF_EVEN=6,k.ROUND_HALF_CEIL=7,k.ROUND_HALF_FLOOR=8,k.EUCLID=9,k.config=k.set=function(e){var r,t;if(null!=e){if("object"!=R(e))throw Error(U+"Object expected: "+e);if(e.hasOwnProperty(r="DECIMAL_PLACES")&&(H(t=e[r],0,G,r),y=t),e.hasOwnProperty(r="ROUNDING_MODE")&&(H(t=e[r],0,8,r),b=t),e.hasOwnProperty(r="EXPONENTIAL_AT")&&((t=e[r])&&t.pop?(H(t[0],-G,0,r),H(t[1],0,G,r),d=t[0],m=t[1]):(H(t,-G,G,r),d=-(m=t<0?-t:t))),e.hasOwnProperty(r="RANGE"))if((t=e[r])&&t.pop)H(t[0],-G,-1,r),H(t[1],1,G,r),_=t[0],E=t[1];else{if(H(t,-G,G,r),!t)throw Error(U+r+" cannot be zero: "+t);_=-(E=t<0?-t:t)}if(e.hasOwnProperty(r="CRYPTO")){if((t=e[r])!==!!t)throw Error(U+r+" not true or false: "+t);if(t){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw O=!t,Error(U+"crypto unavailable");O=t}else O=t}if(e.hasOwnProperty(r="MODULO_MODE")&&(H(t=e[r],0,9,r),i=t),e.hasOwnProperty(r="POW_PRECISION")&&(H(t=e[r],0,G,r),N=t),e.hasOwnProperty(r="FORMAT")){if("object"!=R(t=e[r]))throw Error(U+r+" not an object: "+t);S=t}if(e.hasOwnProperty(r="ALPHABET")){if("string"!=typeof(t=e[r])||/^.?$|[+\-.\s]|(.).*\1/.test(t))throw Error(U+r+" invalid: "+t);x="0123456789"==t.slice(0,10),A=t}}return{DECIMAL_PLACES:y,ROUNDING_MODE:b,EXPONENTIAL_AT:[d,m],RANGE:[_,E],CRYPTO:O,MODULO_MODE:i,POW_PRECISION:N,FORMAT:S,ALPHABET:A}},k.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!k.DEBUG)return!0;var r,t,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&-G<=i&&i<=G&&i===z(i))if(0===n[0]){if(0===i&&1===n.length)return!0}else if((r=(i+1)%L)<1&&(r+=L),String(n[0]).length==r){for(r=0;r<n.length;r++)if((t=n[r])<0||F<=t||t!==z(t))break e;if(0!==t)return!0}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(U+"Invalid BigNumber: "+e)},k.maximum=k.max=function(){return o(arguments,t.lt)},k.minimum=k.min=function(){return o(arguments,t.gt)},k.random=(r=9007199254740992,u=Math.random()*r&2097151?function(){return z(Math.random()*r)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var r,t,n,i,o,l=0,s=[],c=new k(g);if(null==e?e=y:H(e,0,G),i=Ar(e/L),O)if(crypto.getRandomValues){for(r=crypto.getRandomValues(new Uint32Array(i*=2));l<i;)9e15<=(o=131072*r[l]+(r[l+1]>>>11))?(t=crypto.getRandomValues(new Uint32Array(2)),r[l]=t[0],r[l+1]=t[1]):(s.push(o%1e14),l+=2);l=i/2}else{if(!crypto.randomBytes)throw O=!1,Error(U+"crypto unavailable");for(r=crypto.randomBytes(i*=7);l<i;)9e15<=(o=281474976710656*(31&r[l])+1099511627776*r[l+1]+4294967296*r[l+2]+16777216*r[l+3]+(r[l+4]<<16)+(r[l+5]<<8)+r[l+6])?crypto.randomBytes(7).copy(r,l):(s.push(o%1e14),l+=7);l=i/7}if(!O)for(;l<i;)(o=u())<9e15&&(s[l++]=o%1e14);for(i=s[--l],e%=L,i&&e&&(s[l]=z(i/(o=jr[L-e]))*o);0===s[l];s.pop(),l--);if(l<0)s=[n=0];else{for(n=-1;0===s[0];s.splice(0,1),n-=L);for(l=1,o=s[0];10<=o;o/=10,l++);l<L&&(n-=L-l)}return c.e=n,c.c=s,c}),k.sum=function(){for(var e=1,r=arguments,t=new k(r[0]);e<r.length;)t=t.plus(r[e++]);return t},w="0123456789",f=function(e,r,t,n,i){var o,l,s,c,u,a,f,p,h=e.indexOf("."),g=y,d=b;for(0<=h&&(c=N,N=0,e=e.replace(".",""),a=(p=new k(r)).pow(e.length-h),N=c,p.c=j(X(J(a.c),a.e,"0"),10,t,w),p.e=p.c.length),s=c=(f=j(e,r,t,i?(o=A,w):(o=w,A))).length;0==f[--c];f.pop());if(!f[0])return o.charAt(0);if(h<0?--s:(a.c=f,a.e=s,a.s=n,f=(a=v(a,p,g,d,t)).c,u=a.r,s=a.e),h=f[l=s+g+1],c=t/2,u=u||l<0||null!=f[l+1],u=d<4?(null!=h||u)&&(0==d||d==(a.s<0?3:2)):c<h||h==c&&(4==d||u||6==d&&1&f[l-1]||d==(a.s<0?8:7)),l<1||!f[0])e=u?X(o.charAt(1),-g,o.charAt(0)):o.charAt(0);else{if(f.length=l,u)for(--t;++f[--l]>t;)f[l]=0,l||(++s,f=[1].concat(f));for(c=f.length;!f[--c];);for(h=0,e="";h<=c;e+=o.charAt(f[h++]));e=X(e,s,o.charAt(0))}return e},v=function(e,r,t,n,i){var o,l,s,c,u,a,f,p,h,g,d,v,w,y,b,m,_,E=e.s==r.s?1:-1,O=e.c,N=r.c;if(!(O&&O[0]&&N&&N[0]))return new k(e.s&&r.s&&(O?!N||O[0]!=N[0]:N)?O&&0==O[0]||!N?0*E:E/0:NaN);for(h=(p=new k(E)).c=[],E=t+(l=e.e-r.e)+1,i||(i=F,l=q(e.e/L)-q(r.e/L),E=E/L|0),s=0;N[s]==(O[s]||0);s++);if(N[s]>(O[s]||0)&&l--,E<0)h.push(1),c=!0;else{for(y=O.length,m=N.length,E+=2,1<(u=z(i/(N[s=0]+1)))&&(N=P(N,u,i),O=P(O,u,i),m=N.length,y=O.length),w=m,d=(g=O.slice(0,m)).length;d<m;g[d++]=0);_=N.slice(),_=[0].concat(_),b=N[0],N[1]>=i/2&&b++;do{if(u=0,(o=C(N,g,m,d))<0){if(v=g[0],m!=d&&(v=v*i+(g[1]||0)),1<(u=z(v/b)))for(f=(a=P(N,u=i<=u?i-1:u,i)).length,d=g.length;1==C(a,g,f,d);)u--,$(a,m<f?_:N,f,i),f=a.length,o=1;else 0==u&&(o=u=1),f=(a=N.slice()).length;if($(g,a=f<d?[0].concat(a):a,d,i),d=g.length,-1==o)for(;C(N,g,m,d)<1;)u++,$(g,m<d?_:N,d,i),d=g.length}else 0===o&&(u++,g=[0])}while(h[s++]=u,g[0]?g[d++]=O[w]||0:(g=[O[w]],d=1),(w++<y||null!=g[0])&&E--);c=null!=g[0],h[0]||h.splice(0,1)}if(i==F){for(s=1,E=h[0];10<=E;E/=10,s++);T(p,t+(p.e=s+l*L-1)+1,n,c)}else p.e=l,p.r=+c;return p},l=/^(-?)0([xbo])(?=\w[\w.]*$)/i,s=/^([^.]+)\.$/,c=/^\.([^.]+)$/,a=/^-?(Infinity|NaN)$/,h=/^\s*\+(?=[\w.])|^\s+|\s+$/g,p=function(e,r,t,n){var i,o=t?r:r.replace(h,"");if(a.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!t&&(o=o.replace(l,function(e,r,t){return i="x"==(t=t.toLowerCase())?16:"b"==t?2:8,n&&n!=i?e:r}),n&&(i=n,o=o.replace(s,"$1").replace(c,"0.$1")),r!=o))return new k(o,i);if(k.DEBUG)throw Error(U+"Not a"+(n?" base "+n:"")+" number: "+r);e.s=null}e.c=e.e=null},t.absoluteValue=t.abs=function(){var e=new k(this);return e.s<0&&(e.s=1),e},t.comparedTo=function(e,r){return W(this,new k(e,r))},t.decimalPlaces=t.dp=function(e,r){var t,n;if(null!=e)return H(e,0,G),null==r?r=b:H(r,0,8),T(new k(this),e+this.e+1,r);if(!(e=this.c))return null;if(t=((n=e.length-1)-q(this.e/L))*L,n=e[n])for(;n%10==0;n/=10,t--);return t=t<0?0:t},t.dividedBy=t.div=function(e,r){return v(this,new k(e,r),y,b)},t.dividedToIntegerBy=t.idiv=function(e,r){return v(this,new k(e,r),0,1)},t.exponentiatedBy=t.pow=function(e,r){var t,n,i,o,l,s,c,u,a=this;if((e=new k(e)).c&&!e.isInteger())throw Error(U+"Exponent not an integer: "+B(e));if(null!=r&&(r=new k(r)),l=14<e.e,!a.c||!a.c[0]||1==a.c[0]&&!a.e&&1==a.c.length||!e.c||!e.c[0])return u=new k(Math.pow(+B(a),l?2-V(e):+B(e))),r?u.mod(r):u;if(s=e.s<0,r){if(r.c?!r.c[0]:!r.s)return new k(NaN);(n=!s&&a.isInteger()&&r.isInteger())&&(a=a.mod(r))}else{if(9<e.e&&(0<a.e||a.e<-1||(0==a.e?1<a.c[0]||l&&24e7<=a.c[1]:a.c[0]<8e13||l&&a.c[0]<=9999975e7)))return o=a.s<0&&V(e)?-0:0,-1<a.e&&(o=1/o),new k(s?1/o:o);N&&(o=Ar(N/L+2))}for(c=l?(t=new k(.5),s&&(e.s=1),V(e)):(i=Math.abs(+B(e)))%2,u=new k(g);;){if(c){if(!(u=u.times(a)).c)break;o?u.c.length>o&&(u.c.length=o):n&&(u=u.mod(r))}if(i){if(0===(i=z(i/2)))break;c=i%2}else if(T(e=e.times(t),e.e+1,1),14<e.e)c=V(e);else{if(0==(i=+B(e)))break;c=i%2}a=a.times(a),o?a.c&&a.c.length>o&&(a.c.length=o):n&&(a=a.mod(r))}return n?u:(s&&(u=g.div(u)),r?u.mod(r):o?T(u,N,b,void 0):u)},t.integerValue=function(e){var r=new k(this);return null==e?e=b:H(e,0,8),T(r,r.e+1,e)},t.isEqualTo=t.eq=function(e,r){return 0===W(this,new k(e,r))},t.isFinite=function(){return!!this.c},t.isGreaterThan=t.gt=function(e,r){return 0<W(this,new k(e,r))},t.isGreaterThanOrEqualTo=t.gte=function(e,r){return 1===(r=W(this,new k(e,r)))||0===r},t.isInteger=function(){return!!this.c&&q(this.e/L)>this.c.length-2},t.isLessThan=t.lt=function(e,r){return W(this,new k(e,r))<0},t.isLessThanOrEqualTo=t.lte=function(e,r){return-1===(r=W(this,new k(e,r)))||0===r},t.isNaN=function(){return!this.s},t.isNegative=function(){return this.s<0},t.isPositive=function(){return 0<this.s},t.isZero=function(){return!!this.c&&0==this.c[0]},t.minus=function(e,r){var t,n,i,o,l=this,s=l.s;if(r=(e=new k(e,r)).s,!s||!r)return new k(NaN);if(s!=r)return e.s=-r,l.plus(e);var c=l.e/L,u=e.e/L,a=l.c,f=e.c;if(!c||!u){if(!a||!f)return a?(e.s=-r,e):new k(f?l:NaN);if(!a[0]||!f[0])return f[0]?(e.s=-r,e):new k(a[0]?l:3==b?-0:0)}if(c=q(c),u=q(u),a=a.slice(),s=c-u){for((i=(o=s<0)?(s=-s,a):(u=c,f)).reverse(),r=s;r--;i.push(0));i.reverse()}else for(n=(o=(s=a.length)<(r=f.length))?s:r,s=r=0;r<n;r++)if(a[r]!=f[r]){o=a[r]<f[r];break}if(o&&(i=a,a=f,f=i,e.s=-e.s),0<(r=(n=f.length)-(t=a.length)))for(;r--;a[t++]=0);for(r=F-1;s<n;){if(a[--n]<f[n]){for(t=n;t&&!a[--t];a[t]=r);--a[t],a[n]+=F}a[n]-=f[n]}for(;0==a[0];a.splice(0,1),--u);return a[0]?D(e,a,u):(e.s=3==b?-1:1,e.c=[e.e=0],e)},t.modulo=t.mod=function(e,r){var t,n=this;return e=new k(e,r),!n.c||!e.s||e.c&&!e.c[0]?new k(NaN):!e.c||n.c&&!n.c[0]?new k(n):(9==i?(r=e.s,e.s=1,t=v(n,e,0,3),e.s=r,t.s*=r):t=v(n,e,0,i),(e=n.minus(t.times(e))).c[0]||1!=i||(e.s=n.s),e)},t.multipliedBy=t.times=function(e,r){var t,n,i,o,l,s,c,u,a,f,p,h=this,g=h.c,d=(e=new k(e,r)).c;if(!(g&&d&&g[0]&&d[0]))return!h.s||!e.s||g&&!g[0]&&!d||d&&!d[0]&&!g?e.c=e.e=e.s=null:(e.s*=h.s,g&&d?(e.c=[0],e.e=0):e.c=e.e=null),e;for(r=q(h.e/L)+q(e.e/L),e.s*=h.s,(s=g.length)<(h=d.length)&&(p=g,g=d,d=p,n=s,s=h,h=n),n=s+h,p=[];n--;p.push(0));for(n=h;0<=--n;){for(a=d[n]%1e7,f=d[n]/1e7|(t=0),i=n+(o=s);n<i;)t=((c=a*(c=g[--o]%1e7)+(l=f*c+(u=g[o]/1e7|0)*a)%1e7*1e7+p[i]+t)/1e14|0)+(l/1e7|0)+f*u,p[i--]=c%1e14;p[i]=t}return t?++r:p.splice(0,1),D(e,p,r)},t.negated=function(){var e=new k(this);return e.s=-e.s||null,e},t.plus=function(e,r){var t,n=this,i=n.s;if(r=(e=new k(e,r)).s,!i||!r)return new k(NaN);if(i!=r)return e.s=-r,n.minus(e);var o=n.e/L,l=e.e/L,s=n.c,c=e.c;if(!o||!l){if(!s||!c)return new k(i/0);if(!s[0]||!c[0])return c[0]?e:new k(s[0]?n:0*i)}if(o=q(o),l=q(l),s=s.slice(),i=o-l){for((t=0<i?(l=o,c):(i=-i,s)).reverse();i--;t.push(0));t.reverse()}for((i=s.length)-(r=c.length)<0&&(t=c,c=s,s=t,r=i),i=0;r;)i=(s[--r]=s[r]+c[r]+i)/F|0,s[r]=F===s[r]?0:s[r]%F;return i&&(s=[i].concat(s),++l),D(e,s,l)},t.precision=t.sd=function(e,r){var t,n;if(null!=e&&e!==!!e)return H(e,1,G),null==r?r=b:H(r,0,8),T(new k(this),e,r);if(!(r=this.c))return null;if(t=(n=r.length-1)*L+1,n=r[n]){for(;n%10==0;n/=10,t--);for(n=r[0];10<=n;n/=10,t++);}return t=e&&this.e+1>t?this.e+1:t},t.shiftedBy=function(e){return H(e,-kr,kr),this.times("1e"+e)},t.squareRoot=t.sqrt=function(){var e,r,t,n,i,o=this,l=o.c,s=o.s,c=o.e,u=y+4,a=new k("0.5");if(1!==s||!l||!l[0])return new k(!s||s<0&&(!l||l[0])?NaN:l?o:1/0);if((t=0==(s=Math.sqrt(+B(o)))||s==1/0?(((r=J(l)).length+c)%2==0&&(r+="0"),s=Math.sqrt(+r),c=q((c+1)/2)-(c<0||c%2),new k(r=s==1/0?"5e"+c:(r=s.toExponential()).slice(0,r.indexOf("e")+1)+c)):new k(s+"")).c[0])for((s=(c=t.e)+u)<3&&(s=0);;)if(i=t,t=a.times(i.plus(v(o,i,u,1))),J(i.c).slice(0,s)===(r=J(t.c)).slice(0,s)){if(t.e<c&&--s,"9999"!=(r=r.slice(s-3,s+1))&&(n||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(T(t,t.e+y+2,1),e=!t.times(t).eq(o));break}if(!n&&(T(i,i.e+y+2,0),i.times(i).eq(o))){t=i;break}u+=4,s+=4,n=1}return T(t,t.e+y+1,b,e)},t.toExponential=function(e,r){return null!=e&&(H(e,0,G),e++),n(this,e,r,1)},t.toFixed=function(e,r){return null!=e&&(H(e,0,G),e=e+this.e+1),n(this,e,r)},t.toFormat=function(e,r,t){if(null==t)null!=e&&r&&"object"==R(r)?(t=r,r=null):e&&"object"==R(e)?(t=e,e=r=null):t=S;else if("object"!=R(t))throw Error(U+"Argument not an object: "+t);if(e=this.toFixed(e,r),this.c){var n,r=e.split("."),i=+t.groupSize,o=+t.secondaryGroupSize,l=t.groupSeparator||"",s=r[0],r=r[1],c=this.s<0,u=c?s.slice(1):s,a=u.length;if(o&&(n=i,i=o,a-=o=n),0<i&&0<a){for(s=u.substr(0,n=a%i||i);n<a;n+=i)s+=l+u.substr(n,i);0<o&&(s+=l+u.slice(n)),c&&(s="-"+s)}e=r?s+(t.decimalSeparator||"")+((o=+t.fractionGroupSize)?r.replace(new RegExp("\\d{"+o+"}\\B","g"),"$&"+(t.fractionGroupSeparator||"")):r):s}return(t.prefix||"")+e+(t.suffix||"")},t.toFraction=function(e){var r,t,n,i,o,l,s,c,u,a,f=this,p=f.c;if(null!=e&&(!(s=new k(e)).isInteger()&&(s.c||1!==s.s)||s.lt(g)))throw Error(U+"Argument "+(s.isInteger()?"out of range: ":"not an integer: ")+B(s));if(!p)return new k(f);for(r=new k(g),u=t=new k(g),n=c=new k(g),p=J(p),o=r.e=p.length-f.e-1,r.c[0]=jr[(l=o%L)<0?L+l:l],e=!e||0<s.comparedTo(r)?0<o?r:u:s,l=E,E=1/0,s=new k(p),c.c[0]=0;a=v(s,r,0,1),1!=(i=t.plus(a.times(n))).comparedTo(e);)t=n,n=i,u=c.plus(a.times(i=u)),c=i,r=s.minus(a.times(i=r)),s=i;return i=v(e.minus(t),n,0,1),c=c.plus(i.times(u)),t=t.plus(i.times(n)),c.s=u.s=f.s,p=v(u,n,o*=2,b).minus(f).abs().comparedTo(v(c,t,o,b).minus(f).abs())<1?[u,n]:[c,t],E=l,p},t.toNumber=function(){return+B(this)},t.toPrecision=function(e,r){return null!=e&&H(e,1,G),n(this,e,r,2)},t.toString=function(e){var r,t=this,n=t.s,i=t.e;return null===i?n?(r="Infinity",n<0&&(r="-"+r)):r="NaN":(r=null==e?i<=d||m<=i?Z(J(t.c),i):X(J(t.c),i,"0"):10===e&&x?X(J((t=T(new k(t),y+i+1,b)).c),t.e,"0"):(H(e,2,A.length,"Base"),f(X(J(t.c),i,"0"),10,e,n,!0)),n<0&&t.c[0]&&(r="-"+r)),r},t.valueOf=t.toJSON=function(){return B(this)},t._isBigNumber=!0,t[Symbol.toStringTag]="BigNumber",t[Symbol.for("nodejs.util.inspect.custom")]=t.valueOf,null!=e&&k.set(e),k}();function Pr(e){for(var r=[];0<e.length;){var t=e.shift();if(x(t)){if(r.length<2)throw new Error("错误的栈长度, 可能是无法计算的表达式");var n=r.pop(),i=r.pop();if("string"==typeof n&&!E.isBigNumber(n)){if(!u(n))throw new Error("".concat(n,"不是一个合法的数字"));n=new E(n)}if("string"==typeof i&&!E.isBigNumber(i)){if(!u(i))throw new Error("".concat(i,"不是一个合法的数字"));i=new E(i)}switch(t){case"+":r.push(i.plus(n));break;case"-":r.push(i.minus(n));break;case"*":r.push(i.times(n));break;case"/":r.push(i.div(n));break;case"%":r.push(i.mod(n));break;case"**":r.push(i.pow(n))}}else r.push(t)}if(1!==r.length)throw"unvalid expression";var o=r[0];if((o=E.isBigNumber(o)?o:E(o)).isNaN())throw new Error("计算结果为NaN");return o}function Cr(e,r,t){var n="";if(E.isBigNumber(e)?n=e.toFixed():"string"!=typeof e&&(n=e.toString()),"undefined"===n||"NaN"===n)return null;var i,o,l,s,c,u,a,f,p,h=null,g=null,d=!1,v=!1,w="~-",y=!1,b=!1,m=!1,_=!1;return r.forEach(function(e){var r=e.type;if("symbol"===r){if(![">=","<=","=","<",">"].includes(e.value))throw new Error("错误的格式化参数:",e.value);g=e.value}else if("to-number"===r)_=!0;else if("comma"===r)d=!0;else if("number"===r)h=e.value;else if("plus"===r)v=!0;else if("round"===r)w=e.value;else if("fraction"===r)b=!0;else if("scientific"===r)y=!0;else{if("percent"!==r)throw new Error("错误的fmt Token");m=!0}}),y?(e=E(n).toExponential(),v&&!e.startsWith("-")?"+"+e:e):b?(r=E(n).toFraction().map(function(e){return e.toFixed()}).join("/"),v&&!r.startsWith("-")?"+"+r:r):(m&&(n=E(n).times(100).toFixed()),h&&(e=n.split("."),r=e[0],e=1===e.length?"":e[1],l=g,s=+h,f=w,c=i=r,a=(u=o=e).length,p={"~-":function(){u=o.slice(0,"<"===l?s-1:s)},"~+":function(){var e,r="<"===l?s-1:s;a<=r||0===a||(e=o.slice(0,r),0!=+o.slice(r,a)&&(e=(+e+1).toString()).length>r?(u=e.slice(1,e.length),c=(+c+1).toString()):u=e)},"~5":function(){var e,r;0!==a&&(u=o.slice(0,e="<"===l?s-1:s),r=+o[e],Number.isNaN(r)||5<=r&&(u=(+u+1).toString()).length>e&&(u=u.slice(1,u.length),c=(+c+1).toString()))},"~6":function(){var e,r,t,n;0!==a&&(r=+o[e="<"===l?s-1:s],t=""===(t=o.slice(+e+1,o.length))?0:parseInt(t),n=0===e?+i[i.length-1]:+o[e-1],u=o.slice(0,e),(6<=r||5==r&&0<t||5==r&&n%2!=0)&&(u=(+u+1).toString()).length>e&&(u=u.slice(1,u.length),c=(+c+1).toString()))}},"<="===l?u=a<=s?o:(p[f]&&p[f](),u.replace(/0+$/,"")):"<"===l?u=a<s?o:(p[f]&&p[f](),u.replace(/0+$/,"")):"="===l?a<s?u=o+"0".repeat(s-a):s<a&&p[f]&&p[f]():">="===l?a<s&&(u=o+"0".repeat(s-a)):">"===l&&a<=s&&(u=o+"0".repeat(s-a+1)),r=(p={int_part:c,dec_part:u}).int_part,n=""===(e=p.dec_part)?r:"".concat(r,".").concat(e)),d&&(_=!1,n=1<(f=n.split(".")).length?((p=f[0]).includes("-")?f[0]=p[0]+p.slice(1).replace(/(?=(?!^)(?:\d{3})+$)/g,","):f[0]=p.replace(/(?=(?!^)(?:\d{3})+$)/g,","),f.join(".")):(r=f[0]).includes("-")?r[0]+r.slice(1).replace(/(?=(?!^)(?:\d{3})+$)/g,","):r.replace(/(?=(?!^)(?:\d{3})+$)/g,",")),v&&(_=!1,n.startsWith("-")||(n="+"+n)),m&&(_=!1,n+="%"),_&&!t?+n:n)}function $r(e,i){return e.map(function(e){if("var"!==e.type)return e;for(var r,t,n=0;n<i.length&&!h(r=w(i[n],e.value));n++);if("number"==typeof(t=r)||u(t))return{type:"number",value:r};throw new Error("错误的填充值")})}function Dr(e){var t=null;return e.length,{tokens:e.map(function(e){var r=function(e){for(var r,t,n=null,i=null,o=[/^([+-]?[\d.]+(?:e|E)(?:\+|-)?\d+)(.*)$/,/^([+-]?[\d.]+)(.*)$/],l=0;l<o.length;l++){var s=e.match(o[l]);if(s){r=s;break}}return r&&(i=r[1],""!==(t=r[2]).trim()&&(n=t)),{num:i,unit:n}}(e.value);return null!==r.unit?(null==t&&(t=r.unit),{type:"number",value:r.num}):e}),unit:t}}var Tr=!1;var r="#ff8936",i="#fff",s="#67C23A",t="#ee7959",b={expr:"background: ".concat(r,";color: ").concat(i,";font-weight: bold;border-radius: 4px; padding: 3px 8px;"),label1:"color: ".concat(s,"; font-weight: bold; white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"),label2:"color: ".concat(t,"; font-weight: bold; white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"),nowrap:"white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"};function m(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];var n,i=function(e){var r="",t=e[0],n=e[1],i={origin_expr:t,origin_fill_data:n,expr:"",fmt_tokens:null,options:null,fmt_err:!1,expr_err:!1},n=(h(n)&&(i.options=n),w(n,"_error",!1));if(0===e.length)throw new Error("至少传入一个参数");if("string"==typeof t){if(""===(r=t).trim()||t.includes("NaN"))return i.expr_err=!0,i}else{if("number"!=typeof t){if(!0===n)return i.expr_err=!0,i;throw new Error("错误的第一个参数类型: ".concat(t," 类型为:").concat(R(t)))}r=t.toString()}if(e=r.split("|"),i.expr=e[0],1<e.length){n=e[1];if(""!==n.trim())try{i.fmt_tokens=$(n)}catch(e){return i.fmt_err=!0,i}}if(null!==i.options&&i.options._fmt){var o,t=[];try{t=$(i.options._fmt)}catch(e){return i.fmt_err=!0,i}null===i.fmt_tokens?i.fmt_tokens=t:(o=i.fmt_tokens.map(function(e){return e.type}),t.forEach(function(e){o.includes(e.type)||i.fmt_tokens.push(e)}))}return i}(r),o=w(i,"options._error",void 0),l=w(i,"options._debug",!1),s=w(i,"options._unit",!1),c=i.options,u=null;if(i.fmt_err||i.expr_err){if(h(o))return o;throw new Error("表达式或格式化字符串错误,表达式为:".concat(i.expr))}var a=i.fmt_tokens;if(h(o))try{n=Er(i.expr,s)}catch(e){return o}else n=Er(i.expr,s);if(j(c))f=n;else{var f,p=[];if(Array.isArray(c)?p=c:(p.push(c),h(c=w(c,"_fill_data",{}))&&(Array.isArray(c)?p=[].concat(O(p),O(c)):p.push(c))),h(o))try{f=Or(n,p,s),P(i.fmt_tokens)&&(a=$r(i.fmt_tokens,p))}catch(e){return o}else f=Or(n,p,s),P(i.fmt_tokens)&&(a=$r(i.fmt_tokens,p));[!0,"on","auto","space"].includes(s)&&(u=(c=Dr(f)).unit,f=c.tokens)}p=Nr(f),c=null;if(h(o))try{c=Pr(p)}catch(e){return o}else c=Pr(p);if("Infinity"!==(c=P(a)?Cr(c,a,s):null!==c?c.toFixed():null)&&null!==c)return null!==u&&(c+=u),(Tr||l)&&(console.groupCollapsed("%c"+i.origin_expr,b.expr),console.groupCollapsed("%c表达式: %c%s",b.label1,b.nowrap,i.origin_expr),console.log(i.origin_expr),console.groupEnd(),console.groupCollapsed("%c数据源: %c%s",b.label1,b.nowrap,JSON.stringify(i.origin_fill_data)),console.log(i.origin_fill_data),console.groupEnd(),console.groupCollapsed("%c结果: %c%s",b.label1,b.nowrap,JSON.stringify(c)),console.log(c),console.groupEnd(),console.groupCollapsed("%ctokens: %c%s",b.label1,b.nowrap,JSON.stringify(n)),console.log(n),console.groupEnd(),console.groupCollapsed("%cfilled-tokens: %c%s",b.label1,b.nowrap,JSON.stringify(f)),console.log(f),console.groupEnd(),console.groupCollapsed("%cfmt-tokens: %c%s",b.label1,b.nowrap,JSON.stringify(i.fmt_tokens)),console.log(i.fmt_tokens),console.groupEnd(),console.groupCollapsed("%cfmt-filled-tokens: %c%s",b.label1,b.nowrap,JSON.stringify(a)),console.log(a),console.groupEnd(),console.groupCollapsed("%cpostfix-tokens: %c%s",b.label1,b.nowrap,JSON.stringify(p)),console.log(p),console.groupEnd(),console.groupCollapsed("%c单位: %c%s",b.label1,b.nowrap,u),console.log(u),console.groupEnd(),console.groupCollapsed("%cparse-arg: %c%s",b.label1,b.nowrap,JSON.stringify(i)),console.log(i),console.groupEnd(),console.groupEnd()),c;if(h(o))return o;throw new Error("计算错误可能是非法的计算式")}console.log("%ca-calc:%c ".concat(N," %c=> %curl:%c https://www.npmjs.com/package/a-calc"),"color: #fff;background: #67C23A;padding: 2px 5px;border-radius:4px;font-size: 14px;","color: #67C23A;font-size:14px;","color: #67C23A;font-size:14px;","background: #67C23A;font-size:14px; padding: 2px 5px; border-radius: 4px; color: #fff;","font-size:14px;");a=m;return e.calc=m,e.calc_wrap=function(r,t){var n={},i={_error:"-"};return["string","number"].includes(R(r))?(Array.isArray(t)||void 0===t||Object.keys(t).forEach(function(e){return e.startsWith("_")&&(i[e]=t[e])}),n=null!=t?t:{},/[a-zA-Z_$]/.test(r.toString())?void 0!==t?(n=t,m(r,o(o({},i),n))):function(e){return m(r,o(o({},i),n))}:m(r,o(o({},i),n))):(n=r,function(e){return m(e,o(o({},i),n))})},e.close_debug=function(){Tr=!1},e.fmt=a,e.open_debug=function(){Tr=!0},e.version=N,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
{
"name": "a-calc",
"version": "1.2.19",
"version": "1.2.20",
"description": "Very powerful arbitrary precision calculation library and number formatting library",

@@ -5,0 +5,0 @@ "main": "./cjs/index.cjs",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc