a-calc 1.5.0-dev.2024042406 → 2.0.0-dev.20240513
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.
- package/README.md +64 -13
- package/a-calc.versions.js +2 -1
- package/browser/index.js +1 -1
- package/calc.d.ts +20 -7
- package/cjs/index.js +1 -1
- package/es/index.js +1 -1
- package/package.json +4 -3
- package/cjs/package.json +0 -4
- package/es/package.json +0 -4
package/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,c=[],s=!0,l=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=a.call(r)).done)&&(c.push(n.value),c.length!==t);s=!0);}catch(e){l=!0,o=e}finally{try{if(!s&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _regeneratorRuntime(){_regeneratorRuntime=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function l(e,t,r,o){var a=t&&t.prototype instanceof h?t:h,i=Object.create(a.prototype),c=new O(o||[]);return n(i,"_invoke",{value:w(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var f={};function h(){}function p(){}function _(){}var g={};s(g,a,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(C([])));v&&v!==t&&r.call(v,a)&&(g=v);var d=_.prototype=h.prototype=Object.create(g);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){function o(n,a,i,c){var s=u(e[n],e,a);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){o("next",e,i,c)}),(function(e){o("throw",e,i,c)})):t.resolve(f).then((function(e){l.value=e,i(l)}),(function(e){return o("throw",e,i,c)}))}c(s.arg)}var a;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){o(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function w(e,t,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return A()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var c=S(i,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=u(e,t,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function S(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=u(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,f;var a=o.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function $(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function C(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:A}}function A(){return{value:void 0,done:!0}}return p.prototype=_,n(d,"constructor",{value:_,configurable:!0}),n(_,"constructor",{value:p,configurable:!0}),p.displayName=s(_,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,s(e,c,"GeneratorFunction")),e.prototype=Object.create(d),e},e.awrap=function(e){return{__await:e}},b(y.prototype),s(y.prototype,i,(function(){return this})),e.AsyncIterator=y,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new y(l(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(d),s(d,c,"Generator"),s(d,a,(function(){return this})),s(d,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=C,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),$(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;$(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:C(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function _typeof(e){return _typeof="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},_typeof(e)}function asyncGeneratorStep(e,t,r,n,o,a,i){try{var c=e[a](i),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){asyncGeneratorStep(a,n,o,i,c,"next",e)}function c(e){asyncGeneratorStep(a,n,o,i,c,"throw",e)}i(void 0)}))}}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _nonIterableSpread(){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 _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toPrimitive(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==typeof t?t:String(t)}var version="1.5.0-dev.2024042406",RegexNumber=/^[+-]?\d[\d.]*(?:e\+|E\+|e-|E-|e|E)?\d*$/,RegexUnitNumber=/^[+-]?\d[\d.]*(?:e\+|E\+|e-|E-|e|E)?\d*\D*$/;function decimal_round(e,t,r,n,o){var a=e,i=t,c=t.length,s={"~-":function(){var e="<"===r?n-1:n;i=t.slice(0,e)},"~+":function(){var e="<"===r?n-1:n;if(!(c<=e||0===c)){var o=t.slice(0,e);0==+t.slice(e,c)?i=o:(o=(+"9".concat(o)+1).toString().slice(1)).length>e?(i=o.slice(1,o.length),a=(+a+1).toString()):i=o}},"~5":function(){if(0!==c){var e="<"===r?n-1:n;i=t.slice(0,e);var o=+t[e];Number.isNaN(o)||o>=5&&(i=(+"9".concat(i)+1).toString().slice(1)).length>e&&(i=i.slice(1,i.length),a=(+a+1).toString())}},"~6":function(){if(0!==c){var o,s="<"===r?n-1:n,l=+t[s],u=t.slice(+s+1,t.length);u=""===u?0:parseInt(u),o=0===s?+e[e.length-1]:+t[s-1],i=t.slice(0,s),(l>=6||5===l&&u>0||5===l&&o%2!=0)&&(i=(+"9".concat(i)+1).toString().slice(1)).length>s&&(i=i.slice(1,i.length),a=(+a+1).toString())}}};return"<="===r?c<=n?i=t:(s[o]&&s[o](),i=i.replace(/0+$/,"")):"<"===r?c<n?i=t:(s[o]&&s[o](),i=i.replace(/0+$/,"")):"="===r?c<n?i=t+"0".repeat(n-c):c>n&&s[o]&&s[o]():">="===r?c<n&&(i=t+"0".repeat(n-c)):">"===r&&c<=n&&(i=t+"0".repeat(n-c+1)),{int_part:a,dec_part:i}}function is_operator(e){return"+-*/%()**".indexOf(e)>-1}function get_prioraty(e){switch(e){case"+":case"-":return 1;case"*":case"/":case"%":return 2;case"**":return 3;default:return 0}}function prioraty(e,t){return get_prioraty(e)<=get_prioraty(t)}function not_undefined(e){return void 0!==e}function is_null(e){return null===e}function not_null(e){return null!==e}function is_number(e){return"number"==typeof e||is_str_number(e)}function is_str_number(e){return"string"==typeof e&&!!RegexNumber.test(e)}function split_unit_num(e){for(var t,r=null,n=null,o=[/^([+-]?[\d.]+(?:e|E)(?:\+|-)?\d+)(.*)$/,/^([+-]?[\d.]+)(.*)$/],a=0;a<o.length;a++){var i=e.match(o[a]);if(i){t=i;break}}if(t){n=t[1];var c=t[2];""!==c.trim()&&(r=c)}return{num:n,unit:r}}function parse_mantissa(e,t,r,n){var o=e.split("."),a=o[0],i=1===o.length?"":o[1],c=decimal_round(a,i,t,+r,n);return a=c.int_part,""===(i=c.dec_part)?a:"".concat(a,".").concat(i)}function parse_thousands(e){var t=e.split(".");if(t.length>1){var r=t[0];r.includes("-")?t[0]=r[0]+r.slice(1).replace(/(?=(?!^)(?:\d{3})+$)/g,","):t[0]=r.replace(/(?=(?!^)(?:\d{3})+$)/g,","),e=t.join(".")}else{var n=t[0];e=n.includes("-")?n[0]+n.slice(1).replace(/(?=(?!^)(?:\d{3})+$)/g,","):n.replace(/(?=(?!^)(?:\d{3})+$)/g,",")}return e}function promise_queue(e){return _promise_queue.apply(this,arguments)}function _promise_queue(){return _promise_queue=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n,o,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=a.length>1&&void 0!==a[1]?a[1]:5e3,n=0;case 2:if(!(n<t.length)){e.next=16;break}return e.prev=3,e.next=6,Promise.race([t[n],new Promise((function(e,t){setTimeout((function(){return t(new Error("promise queue timeout err"))}),r)}))]);case 6:o=e.sent,e.next=12;break;case 9:return e.prev=9,e.t0=e.catch(3),e.abrupt("continue",13);case 12:return e.abrupt("return",o);case 13:n++,e.next=2;break;case 16:return e.abrupt("return",Promise.reject("错误的 promise queue 调用"));case 17:case"end":return e.stop()}}),e,null,[[3,9]])}))),_promise_queue.apply(this,arguments)}function test_urls(e){return _test_urls.apply(this,arguments)}function _test_urls(){return(_test_urls=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:if(!(r<t.length)){e.next=16;break}return e.prev=2,e.next=5,fetch(t[r]);case 5:if(!e.sent.ok){e.next=8;break}return e.abrupt("return",t[r]);case 8:e.next=13;break;case 10:return e.prev=10,e.t0=e.catch(2),e.abrupt("continue",13);case 13:r++,e.next=1;break;case 16:return e.abrupt("return",null);case 17:case"end":return e.stop()}}),e,null,[[2,10]])})))).apply(this,arguments)}function idle(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return"undefined"!=typeof requestIdleCallback?requestIdleCallback(e):setTimeout(e,t)}var cache_eval={},cache_tokens={},cache_fmt_tokens={},cache_calc={},state$1={initial:"initial",number:"number",variable:"var",symbol:"symbol",percent:"percent",round:"round",plus:"plus",comma:"comma",fraction:"fraction",to_number:"to-number",to_number_string:"to-number-string",scientific:"scientific"},symbol="<>=";function fmt_tokenizer(e){var t=e;if(t in cache_fmt_tokens)return cache_fmt_tokens[t].last_time=(new Date).getTime(),cache_fmt_tokens[t].count++,cache_fmt_tokens[t].value;for(var r=state$1.initial,n=[],o=[];e;){var a=e[0];if(r===state$1.initial)if(/\s/.test(a))e=e.slice(1);else if(symbol.includes(a))r=state$1.symbol,n.push(a),e=e.slice(1);else if(","===a)r=state$1.initial,o.push({type:"comma",value:a}),e=e.slice(1);else if(/[a-zA-Z_]/.test(a))r=state$1.variable,n.push(a),e=e.slice(1);else if(/\d/.test(a))r=state$1.number,n.push(a),e=e.slice(1);else if("+"===a)r=state$1.initial,o.push({type:"plus",value:a}),e=e.slice(1);else if("~"===a)r=state$1.round,n.push(a),e=e.slice(1);else if("%"===a)r=state$1.initial,o.push({type:"percent",value:a}),e=e.slice(1);else if("/"===a)r=state$1.initial,o.push({type:"fraction",value:a}),e=e.slice(1);else{if("!"!==a)throw new Error("不识别的fmt字符:".concat(a));if(r=state$1.initial,/[Ee]/.test(e[1]))o.push({type:"scientific",value:e[1]}),e=e.slice(2);else if(/[Nn]/.test(e[1]))o.push({type:"to-number",value:e[1]}),e=e.slice(2);else{if(!/[Uu]/.test(e[1]))throw new Error("不识别的fmt字符:".concat(e.slice(2)));o.push({type:"to-number-string",value:e[1]}),e=e.slice(2)}}else if(r===state$1.number)/\d/.test(a)?(n.push(a),e=e.slice(1)):(o.push({type:"number",value:n.join("")}),n.length=0,r=state$1.initial);else if(r===state$1.variable)/[\$\w_\-.\[\]"']/.test(a)?(n.push(a),e=e.slice(1)):(o.push({type:"var",value:n.join("")}),n.length=0,r=state$1.initial);else if(r===state$1.symbol){if(/\s/.test(a)){e=e.slice(1);continue}symbol.includes(a)?(n.push(a),e=e.slice(1)):(o.push({type:"symbol",value:n.join("")}),n.length=0,r=state$1.initial)}else{if(r!==state$1.round)throw new Error("错误的自动机状态");if(/\s/.test(a)){e=e.slice(1);continue}if(!("56+-".includes(a)&&n.length<2))throw new Error("舍入格式化语法错误:".concat(a));n.push(a),e=e.slice(1),o.push({type:"round",value:n.join("")}),n.length=0,r=state$1.initial}}if(n.length>0&&(o.push({type:r,value:n.join("")}),n.length=0,r=state$1.initial),o.filter((function(e){return"number"===e.type})).length>1)throw new Error("格式化字符串错误,发现多余的数字");return cache_fmt_tokens[t]={last_time:(new Date).getTime(),count:0,value:o},o}var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var isArray$3=Array.isArray,isArray_1=isArray$3,freeGlobal$1="object"==_typeof(commonjsGlobal)&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,_freeGlobal=freeGlobal$1,freeGlobal=_freeGlobal,freeSelf="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,root$3=freeGlobal||freeSelf||Function("return this")(),_root=root$3,root$2=_root,_Symbol2=root$2.Symbol,_Symbol$3=_Symbol2,_Symbol$2=_Symbol$3,objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty,nativeObjectToString$1=objectProto$4.toString,symToStringTag$1=_Symbol$2?_Symbol$2.toStringTag:void 0;function getRawTag$1(e){var t=hasOwnProperty$3.call(e,symToStringTag$1),r=e[symToStringTag$1];try{e[symToStringTag$1]=void 0;var n=!0}catch(e){}var o=nativeObjectToString$1.call(e);return n&&(t?e[symToStringTag$1]=r:delete e[symToStringTag$1]),o}var _getRawTag=getRawTag$1,objectProto$3=Object.prototype,nativeObjectToString=objectProto$3.toString;function objectToString$1(e){return nativeObjectToString.call(e)}var _objectToString=objectToString$1,_Symbol$1=_Symbol$3,getRawTag=_getRawTag,objectToString=_objectToString,nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=_Symbol$1?_Symbol$1.toStringTag:void 0;function baseGetTag$2(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(e)?getRawTag(e):objectToString(e)}var _baseGetTag=baseGetTag$2;function isObjectLike$1(e){return null!=e&&"object"==_typeof(e)}var isObjectLike_1=isObjectLike$1,baseGetTag$1=_baseGetTag,isObjectLike=isObjectLike_1,symbolTag="[object Symbol]";function isSymbol$3(e){return"symbol"==_typeof(e)||isObjectLike(e)&&baseGetTag$1(e)==symbolTag}var isSymbol_1=isSymbol$3,isArray$2=isArray_1,isSymbol$2=isSymbol_1,reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey$1(e,t){if(isArray$2(e))return!1;var r=_typeof(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol$2(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}var _isKey=isKey$1;function isObject$2(e){var t=_typeof(e);return null!=e&&("object"==t||"function"==t)}var isObject_1=isObject$2,baseGetTag=_baseGetTag,isObject$1=isObject_1,asyncTag="[object AsyncFunction]",funcTag="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction$1(e){if(!isObject$1(e))return!1;var t=baseGetTag(e);return t==funcTag||t==genTag||t==asyncTag||t==proxyTag}var isFunction_1=isFunction$1,root$1=_root,coreJsData$1=root$1["__core-js_shared__"],_coreJsData=coreJsData$1,coreJsData=_coreJsData,maskSrcKey=(uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||""),uid?"Symbol(src)_1."+uid:""),uid;function isMasked$1(e){return!!maskSrcKey&&maskSrcKey in e}var _isMasked=isMasked$1,funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource$1(e){if(null!=e){try{return funcToString$1.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var _toSource=toSource$1,isFunction=isFunction_1,isMasked=_isMasked,isObject=isObject_1,toSource=_toSource,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto=Function.prototype,objectProto$2=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$2=objectProto$2.hasOwnProperty,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$2).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative$1(e){return!(!isObject(e)||isMasked(e))&&(isFunction(e)?reIsNative:reIsHostCtor).test(toSource(e))}var _baseIsNative=baseIsNative$1;function getValue$1(e,t){return null==e?void 0:e[t]}var _getValue=getValue$1,baseIsNative=_baseIsNative,getValue=_getValue;function getNative$2(e,t){var r=getValue(e,t);return baseIsNative(r)?r:void 0}var _getNative=getNative$2,getNative$1=_getNative,nativeCreate$4=getNative$1(Object,"create"),_nativeCreate=nativeCreate$4,nativeCreate$3=_nativeCreate;function hashClear$1(){this.__data__=nativeCreate$3?nativeCreate$3(null):{},this.size=0}var _hashClear=hashClear$1;function hashDelete$1(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var _hashDelete=hashDelete$1,nativeCreate$2=_nativeCreate,HASH_UNDEFINED$1="__lodash_hash_undefined__",objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function hashGet$1(e){var t=this.__data__;if(nativeCreate$2){var r=t[e];return r===HASH_UNDEFINED$1?void 0:r}return hasOwnProperty$1.call(t,e)?t[e]:void 0}var _hashGet=hashGet$1,nativeCreate$1=_nativeCreate,objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty;function hashHas$1(e){var t=this.__data__;return nativeCreate$1?void 0!==t[e]:hasOwnProperty.call(t,e)}var _hashHas=hashHas$1,nativeCreate=_nativeCreate,HASH_UNDEFINED="__lodash_hash_undefined__";function hashSet$1(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=nativeCreate&&void 0===t?HASH_UNDEFINED:t,this}var _hashSet=hashSet$1,hashClear=_hashClear,hashDelete=_hashDelete,hashGet=_hashGet,hashHas=_hashHas,hashSet=_hashSet;function Hash$1(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Hash$1.prototype.clear=hashClear,Hash$1.prototype.delete=hashDelete,Hash$1.prototype.get=hashGet,Hash$1.prototype.has=hashHas,Hash$1.prototype.set=hashSet;var _Hash=Hash$1;function listCacheClear$1(){this.__data__=[],this.size=0}var _listCacheClear=listCacheClear$1;function eq$1(e,t){return e===t||e!=e&&t!=t}var eq_1=eq$1,eq=eq_1;function assocIndexOf$4(e,t){for(var r=e.length;r--;)if(eq(e[r][0],t))return r;return-1}var _assocIndexOf=assocIndexOf$4,assocIndexOf$3=_assocIndexOf,arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete$1(e){var t=this.__data__,r=assocIndexOf$3(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice.call(t,r,1),--this.size,!0)}var _listCacheDelete=listCacheDelete$1,assocIndexOf$2=_assocIndexOf;function listCacheGet$1(e){var t=this.__data__,r=assocIndexOf$2(t,e);return r<0?void 0:t[r][1]}var _listCacheGet=listCacheGet$1,assocIndexOf$1=_assocIndexOf;function listCacheHas$1(e){return assocIndexOf$1(this.__data__,e)>-1}var _listCacheHas=listCacheHas$1,assocIndexOf=_assocIndexOf;function listCacheSet$1(e,t){var r=this.__data__,n=assocIndexOf(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var _listCacheSet=listCacheSet$1,listCacheClear=_listCacheClear,listCacheDelete=_listCacheDelete,listCacheGet=_listCacheGet,listCacheHas=_listCacheHas,listCacheSet=_listCacheSet;function ListCache$1(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ListCache$1.prototype.clear=listCacheClear,ListCache$1.prototype.delete=listCacheDelete,ListCache$1.prototype.get=listCacheGet,ListCache$1.prototype.has=listCacheHas,ListCache$1.prototype.set=listCacheSet;var _ListCache=ListCache$1,getNative=_getNative,root=_root,Map$1=getNative(root,"Map"),_Map=Map$1,Hash=_Hash,ListCache=_ListCache,Map=_Map;function mapCacheClear$1(){this.size=0,this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}var _mapCacheClear=mapCacheClear$1;function isKeyable$1(e){var t=_typeof(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}var _isKeyable=isKeyable$1,isKeyable=_isKeyable;function getMapData$4(e,t){var r=e.__data__;return isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}var _getMapData=getMapData$4,getMapData$3=_getMapData;function mapCacheDelete$1(e){var t=getMapData$3(this,e).delete(e);return this.size-=t?1:0,t}var _mapCacheDelete=mapCacheDelete$1,getMapData$2=_getMapData;function mapCacheGet$1(e){return getMapData$2(this,e).get(e)}var _mapCacheGet=mapCacheGet$1,getMapData$1=_getMapData;function mapCacheHas$1(e){return getMapData$1(this,e).has(e)}var _mapCacheHas=mapCacheHas$1,getMapData=_getMapData;function mapCacheSet$1(e,t){var r=getMapData(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var _mapCacheSet=mapCacheSet$1,mapCacheClear=_mapCacheClear,mapCacheDelete=_mapCacheDelete,mapCacheGet=_mapCacheGet,mapCacheHas=_mapCacheHas,mapCacheSet=_mapCacheSet;function MapCache$1(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}MapCache$1.prototype.clear=mapCacheClear,MapCache$1.prototype.delete=mapCacheDelete,MapCache$1.prototype.get=mapCacheGet,MapCache$1.prototype.has=mapCacheHas,MapCache$1.prototype.set=mapCacheSet;var _MapCache=MapCache$1,MapCache=_MapCache,FUNC_ERROR_TEXT="Expected a function";function memoize$1(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function r(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(memoize$1.Cache||MapCache),r}memoize$1.Cache=MapCache;var memoize_1=memoize$1,memoize=memoize_1,MAX_MEMOIZE_SIZE=500;function memoizeCapped$1(e){var t=memoize(e,(function(e){return r.size===MAX_MEMOIZE_SIZE&&r.clear(),e})),r=t.cache;return t}var _memoizeCapped=memoizeCapped$1,memoizeCapped=_memoizeCapped,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath$1=memoizeCapped((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rePropName,(function(e,r,n,o){t.push(n?o.replace(reEscapeChar,"$1"):r||e)})),t})),_stringToPath=stringToPath$1;function arrayMap$1(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}var _arrayMap=arrayMap$1,_Symbol=_Symbol$3,arrayMap=_arrayMap,isArray$1=isArray_1,isSymbol$1=isSymbol_1,INFINITY$1=1/0,symbolProto=_Symbol?_Symbol.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;function baseToString$1(e){if("string"==typeof e)return e;if(isArray$1(e))return arrayMap(e,baseToString$1)+"";if(isSymbol$1(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-INFINITY$1?"-0":t}var _baseToString=baseToString$1,baseToString=_baseToString;function toString$1(e){return null==e?"":baseToString(e)}var toString_1=toString$1,isArray=isArray_1,isKey=_isKey,stringToPath=_stringToPath,toString=toString_1;function castPath$1(e,t){return isArray(e)?e:isKey(e,t)?[e]:stringToPath(toString(e))}var _castPath=castPath$1,isSymbol=isSymbol_1,INFINITY=1/0;function toKey$1(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-INFINITY?"-0":t}var _toKey=toKey$1,castPath=_castPath,toKey=_toKey;function baseGet$1(e,t){for(var r=0,n=(t=castPath(t,e)).length;null!=e&&r<n;)e=e[toKey(t[r++])];return r&&r==n?e:void 0}var _baseGet=baseGet$1,baseGet=_baseGet;function get(e,t,r){var n=null==e?void 0:baseGet(e,t);return void 0===n?r:n}var get_1=get,get$1=getDefaultExportFromCjs(get_1);function parse_args(e){var t="",r=e[0],n=e[1],o={origin_expr:r,origin_fill_data:n,expr:"",fmt_tokens:null,options:null,fmt_err:!1,expr_err:!1};not_undefined(n)&&(o.options=n);var a=get$1(n,"_error",!1);if(0===e.length)throw new Error("至少传入一个参数");if("string"==typeof r){if(t=r,""===r.trim()||r.includes("NaN"))return o.expr_err=!0,o}else{if("number"!=typeof r){if(!0===a)return o.expr_err=!0,o;throw new Error("错误的第一个参数类型: ".concat(r," 类型为:").concat(_typeof(r)))}t=r.toString()}var i=t.split("|");if(o.expr=i[0],i.length>1){var c=i[1];if(""!==c.trim())try{o.fmt_tokens=fmt_tokenizer(c)}catch(e){return o.fmt_err=!0,o}}if(null!==o.options&&o.options._fmt){var s=[];try{s=fmt_tokenizer(o.options._fmt)}catch(e){return o.fmt_err=!0,o}if(null===o.fmt_tokens)o.fmt_tokens=s;else{var l=o.fmt_tokens.map((function(e){return e.type}));s.forEach((function(e){l.includes(e.type)||o.fmt_tokens.push(e)}))}}return o}var state={initial:"initial",number:"number",scientific:"scientific",operator:"operator",bracket:"bracket",var:"var"},signed="+-",operator="*/%",brackets="()";function tokenizer(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="".concat(e,",").concat(t);if(r in cache_tokens)return cache_tokens[r].last_time=(new Date).getTime(),cache_tokens[r].count++,cache_tokens[r].value;for(var n,o=state.initial,a=[],i=[],c=function(){a.push(n),e=e.slice(1)},s=function(e){i.push({type:e,value:a.join("")}),a.length=0},l=function(){e=e.slice(1)};e;)switch(n=e[0],o){case state.initial:if(signed.includes(n)){var u=i.at(-1);0===i.length||"operator"===u.type||"("===u?(o=state.number,c()):(o=state.operator,c())}else if(operator.includes(n))o=state.operator,c();else if(/\d/.test(n))o=state.number,c();else if(brackets.includes(n))o=state.bracket;else if(/[a-zA-Z_$]/.test(n))o=state.var,c();else{if(!/\s/.test(n))throw new Error("不识别的字符".concat(n));l()}break;case state.bracket:i.push({type:state.bracket,value:n}),l(),o=state.initial;break;case state.operator:var f=a.at(-1);"*"===n&&"*"===f&&c(),s(state.operator),o=state.initial;break;case state.number:if(/\d/.test(n))c();else if("."===n){if(0===a.length||a.includes("."))throw new Error("非法的小数部分".concat(a.join("")));c()}else"Ee".includes(n)?(o=state.scientific,c()):["auto","on",!0].includes(t)&&/[^*/+\-()\s]/.test(n)||"space"===t&&/\S/.test(n)?c():(s(state.number),o=state.initial);break;case state.scientific:if(/\d/.test(n))c();else if(signed.includes(n)){var h=a.slice(1),p=a.at(-1);h.includes(n)||!/[Ee]/.test(p)?(s(state.scientific),o=state.initial):c()}else["auto","on",!0].includes(t)&&/[^*/+\-()\s]/.test(n)||"space"===t&&/\S/.test(n)?c():(s(state.scientific),o=state.initial);break;case state.var:/[\w_.\[\]"']/.test(n)?c():(s(state.var),o=state.initial);break;default:throw new Error("状态错误")}return 0!==a.length&&(i.push({type:o,value:a.join("")}),a.length=0,o=state.initial),cache_tokens[r]={last_time:(new Date).getTime(),count:0,value:i},i}function fill_tokens(e,t,r){if(is_null(t))throw new Error("错误的填充数据:",t);for(var n=[],o=0;o<e.length;o++){var a=e[o];if("var"===a.type){if("undefined"===a.value||"NaN"===a.value)throw new Error("key不应该为:".concat(a.value));for(var i=null,c=0;c<t.length;c++){var s=t[c],l=get$1(s,a.value);if(void 0!==l){i=l;break}}if(null===i)throw new Error("token填充失败,请确认".concat(a,"存在"));if("string"==typeof i){if(""===i.trim())throw new Error("token填充失败,".concat(a.value,"值不可为空字符"));if([!0,"on","auto","space"].includes(r)){if(!RegexUnitNumber.test(i))throw new Error("token填充失败,".concat(a.value,"值:").concat(i,"为非法单位数字"))}else if(!is_str_number(i))throw new Error("token填充失败,".concat(a,"值:").concat(i,"为非法数字"))}i="string"!=typeof i?i.toString():i,n.push({type:"number",value:i})}else n.push(a)}return n}function token2postfix(e){for(var t=[],r=[],n=e.map((function(e){return e.value}));n.length>0;){var o=n.shift();if(is_operator(o))if("("===o)t.push(o);else if(")"===o){for(var a=t.pop();"("!==a&&t.length>0;)r.push(a),a=t.pop();if("("!==a)throw"error: unmatched ()"}else{for(;prioraty(o,t[t.length-1])&&t.length>0;)r.push(t.pop());t.push(o)}else r.push(o)}if(t.length>0){if(")"===t[t.length-1]||"("===t[t.length-1])throw"error: unmatched ()";for(;t.length>0;)r.push(t.pop())}return r}var isNumeric=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,bignumberError="[BigNumber Error] ",tooManyDigits=bignumberError+"Number primitive has more than 15 significant digits: ",BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX=1e9;function clone(e){var t,r,n,o,a,i,c,s,l,u,f=O.prototype={constructor:O,toString:null,valueOf:null},h=new O(1),p=20,_=4,g=-7,m=21,v=-1e7,d=1e7,b=!1,y=1,w=0,S={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},E="0123456789abcdefghijklmnopqrstuvwxyz",$=!0;function O(e,t){var o,a,i,c,s,l,u,f,h=this;if(!(h instanceof O))return new O(e,t);if(null==t){if(e&&!0===e._isBigNumber)return h.s=e.s,void(!e.c||e.e>d?h.c=h.e=null:e.e<v?h.c=[h.e=0]:(h.e=e.e,h.c=e.c.slice()));if((l="number"==typeof e)&&0*e==0){if(h.s=1/e<0?(e=-e,-1):1,e===~~e){for(c=0,s=e;s>=10;s/=10,c++);return void(c>d?h.c=h.e=null:(h.e=c,h.c=[e]))}f=String(e)}else{if(!isNumeric.test(f=String(e)))return n(h,f,l);h.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(c=f.indexOf("."))>-1&&(f=f.replace(".","")),(s=f.search(/e/i))>0?(c<0&&(c=s),c+=+f.slice(s+1),f=f.substring(0,s)):c<0&&(c=f.length)}else{if(intCheck(t,2,E.length,"Base"),10==t&&$)return T(h=new O(e),p+h.e+1,_);if(f=String(e),l="number"==typeof e){if(0*e!=0)return n(h,f,l,t);if(h.s=1/e<0?(f=f.slice(1),-1):1,O.DEBUG&&f.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+e)}else h.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(o=E.slice(0,t),c=s=0,u=f.length;s<u;s++)if(o.indexOf(a=f.charAt(s))<0){if("."==a){if(s>c){c=u;continue}}else if(!i&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){i=!0,s=-1,c=0;continue}return n(h,String(e),l,t)}l=!1,(c=(f=r(f,t,10,h.s)).indexOf("."))>-1?f=f.replace(".",""):c=f.length}for(s=0;48===f.charCodeAt(s);s++);for(u=f.length;48===f.charCodeAt(--u););if(f=f.slice(s,++u)){if(u-=s,l&&O.DEBUG&&u>15&&(e>MAX_SAFE_INTEGER||e!==mathfloor(e)))throw Error(tooManyDigits+h.s*e);if((c=c-s-1)>d)h.c=h.e=null;else if(c<v)h.c=[h.e=0];else{if(h.e=c,h.c=[],s=(c+1)%LOG_BASE,c<0&&(s+=LOG_BASE),s<u){for(s&&h.c.push(+f.slice(0,s)),u-=LOG_BASE;s<u;)h.c.push(+f.slice(s,s+=LOG_BASE));s=LOG_BASE-(f=f.slice(s)).length}else s-=u;for(;s--;f+="0");h.c.push(+f)}}else h.c=[h.e=0]}function C(e,t,r,n){var o,a,i,c,s;if(null==r?r=_:intCheck(r,0,8),!e.c)return e.toString();if(o=e.c[0],i=e.e,null==t)s=coeffToString(e.c),s=1==n||2==n&&(i<=g||i>=m)?toExponential(s,i):toFixedPoint(s,i,"0");else if(a=(e=T(new O(e),t,r)).e,c=(s=coeffToString(e.c)).length,1==n||2==n&&(t<=a||a<=g)){for(;c<t;s+="0",c++);s=toExponential(s,a)}else if(t-=i,s=toFixedPoint(s,a,"0"),a+1>c){if(--t>0)for(s+=".";t--;s+="0");}else if((t+=a-c)>0)for(a+1==c&&(s+=".");t--;s+="0");return e.s<0&&o?"-"+s:s}function A(e,t){for(var r,n=1,o=new O(e[0]);n<e.length;n++){if(!(r=new O(e[n])).s){o=r;break}t.call(o,r)&&(o=r)}return o}function x(e,t,r){for(var n=1,o=t.length;!t[--o];t.pop());for(o=t[0];o>=10;o/=10,n++);return(r=n+r*LOG_BASE-1)>d?e.c=e.e=null:r<v?e.c=[e.e=0]:(e.e=r,e.c=t),e}function T(e,t,r,n){var o,a,i,c,s,l,u,f=e.c,h=POWS_TEN;if(f){e:{for(o=1,c=f[0];c>=10;c/=10,o++);if((a=t-o)<0)a+=LOG_BASE,i=t,u=(s=f[l=0])/h[o-i-1]%10|0;else if((l=mathceil((a+1)/LOG_BASE))>=f.length){if(!n)break e;for(;f.length<=l;f.push(0));s=u=0,o=1,i=(a%=LOG_BASE)-LOG_BASE+1}else{for(s=c=f[l],o=1;c>=10;c/=10,o++);u=(i=(a%=LOG_BASE)-LOG_BASE+o)<0?0:s/h[o-i-1]%10|0}if(n=n||t<0||null!=f[l+1]||(i<0?s:s%h[o-i-1]),n=r<4?(u||n)&&(0==r||r==(e.s<0?3:2)):u>5||5==u&&(4==r||n||6==r&&(a>0?i>0?s/h[o-i]:0:f[l-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,n?(t-=e.e+1,f[0]=h[(LOG_BASE-t%LOG_BASE)%LOG_BASE],e.e=-t||0):f[0]=e.e=0,e;if(0==a?(f.length=l,c=1,l--):(f.length=l+1,c=h[LOG_BASE-a],f[l]=i>0?mathfloor(s/h[o-i]%h[i])*c:0),n)for(;;){if(0==l){for(a=1,i=f[0];i>=10;i/=10,a++);for(i=f[0]+=c,c=1;i>=10;i/=10,c++);a!=c&&(e.e++,f[0]==BASE&&(f[0]=1));break}if(f[l]+=c,f[l]!=BASE)break;f[l--]=0,c=1}for(a=f.length;0===f[--a];f.pop());}e.e>d?e.c=e.e=null:e.e<v&&(e.c=[e.e=0])}return e}function k(e){var t,r=e.e;return null===r?e.toString():(t=coeffToString(e.c),t=r<=g||r>=m?toExponential(t,r):toFixedPoint(t,r,"0"),e.s<0?"-"+t:t)}return O.clone=clone,O.ROUND_UP=0,O.ROUND_DOWN=1,O.ROUND_CEIL=2,O.ROUND_FLOOR=3,O.ROUND_HALF_UP=4,O.ROUND_HALF_DOWN=5,O.ROUND_HALF_EVEN=6,O.ROUND_HALF_CEIL=7,O.ROUND_HALF_FLOOR=8,O.EUCLID=9,O.config=O.set=function(e){var t,r;if(null!=e){if("object"!=_typeof(e))throw Error(bignumberError+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(intCheck(r=e[t],0,MAX,t),p=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(intCheck(r=e[t],0,8,t),_=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(intCheck(r[0],-MAX,0,t),intCheck(r[1],0,MAX,t),g=r[0],m=r[1]):(intCheck(r,-MAX,MAX,t),g=-(m=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)intCheck(r[0],-MAX,-1,t),intCheck(r[1],1,MAX,t),v=r[0],d=r[1];else{if(intCheck(r,-MAX,MAX,t),!r)throw Error(bignumberError+t+" cannot be zero: "+r);v=-(d=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(bignumberError+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw b=!r,Error(bignumberError+"crypto unavailable");b=r}else b=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(intCheck(r=e[t],0,9,t),y=r),e.hasOwnProperty(t="POW_PRECISION")&&(intCheck(r=e[t],0,MAX,t),w=r),e.hasOwnProperty(t="FORMAT")){if("object"!=_typeof(r=e[t]))throw Error(bignumberError+t+" not an object: "+r);S=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(bignumberError+t+" invalid: "+r);$="0123456789"==r.slice(0,10),E=r}}return{DECIMAL_PLACES:p,ROUNDING_MODE:_,EXPONENTIAL_AT:[g,m],RANGE:[v,d],CRYPTO:b,MODULO_MODE:y,POW_PRECISION:w,FORMAT:S,ALPHABET:E}},O.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!O.DEBUG)return!0;var t,r,n=e.c,o=e.e,a=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===a||-1===a)&&o>=-MAX&&o<=MAX&&o===mathfloor(o)){if(0===n[0]){if(0===o&&1===n.length)return!0;break e}if((t=(o+1)%LOG_BASE)<1&&(t+=LOG_BASE),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=BASE||r!==mathfloor(r))break e;if(0!==r)return!0}}}else if(null===n&&null===o&&(null===a||1===a||-1===a))return!0;throw Error(bignumberError+"Invalid BigNumber: "+e)},O.maximum=O.max=function(){return A(arguments,f.lt)},O.minimum=O.min=function(){return A(arguments,f.gt)},O.random=(o=9007199254740992,a=Math.random()*o&2097151?function(){return mathfloor(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,o,i,c=0,s=[],l=new O(h);if(null==e?e=p:intCheck(e,0,MAX),o=mathceil(e/LOG_BASE),b)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(o*=2));c<o;)(i=131072*t[c]+(t[c+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[c]=r[0],t[c+1]=r[1]):(s.push(i%1e14),c+=2);c=o/2}else{if(!crypto.randomBytes)throw b=!1,Error(bignumberError+"crypto unavailable");for(t=crypto.randomBytes(o*=7);c<o;)(i=281474976710656*(31&t[c])+1099511627776*t[c+1]+4294967296*t[c+2]+16777216*t[c+3]+(t[c+4]<<16)+(t[c+5]<<8)+t[c+6])>=9e15?crypto.randomBytes(7).copy(t,c):(s.push(i%1e14),c+=7);c=o/7}if(!b)for(;c<o;)(i=a())<9e15&&(s[c++]=i%1e14);for(o=s[--c],e%=LOG_BASE,o&&e&&(i=POWS_TEN[LOG_BASE-e],s[c]=mathfloor(o/i)*i);0===s[c];s.pop(),c--);if(c<0)s=[n=0];else{for(n=-1;0===s[0];s.splice(0,1),n-=LOG_BASE);for(c=1,i=s[0];i>=10;i/=10,c++);c<LOG_BASE&&(n-=LOG_BASE-c)}return l.e=n,l.c=s,l}),O.sum=function(){for(var e=1,t=arguments,r=new O(t[0]);e<t.length;)r=r.plus(t[e++]);return r},r=function(){var e="0123456789";function r(e,t,r,n){for(var o,a,i=[0],c=0,s=e.length;c<s;){for(a=i.length;a--;i[a]*=t);for(i[0]+=n.indexOf(e.charAt(c++)),o=0;o<i.length;o++)i[o]>r-1&&(null==i[o+1]&&(i[o+1]=0),i[o+1]+=i[o]/r|0,i[o]%=r)}return i.reverse()}return function(n,o,a,i,c){var s,l,u,f,h,g,m,v,d=n.indexOf("."),b=p,y=_;for(d>=0&&(f=w,w=0,n=n.replace(".",""),g=(v=new O(o)).pow(n.length-d),w=f,v.c=r(toFixedPoint(coeffToString(g.c),g.e,"0"),10,a,e),v.e=v.c.length),u=f=(m=r(n,o,a,c?(s=E,e):(s=e,E))).length;0==m[--f];m.pop());if(!m[0])return s.charAt(0);if(d<0?--u:(g.c=m,g.e=u,g.s=i,m=(g=t(g,v,b,y,a)).c,h=g.r,u=g.e),d=m[l=u+b+1],f=a/2,h=h||l<0||null!=m[l+1],h=y<4?(null!=d||h)&&(0==y||y==(g.s<0?3:2)):d>f||d==f&&(4==y||h||6==y&&1&m[l-1]||y==(g.s<0?8:7)),l<1||!m[0])n=h?toFixedPoint(s.charAt(1),-b,s.charAt(0)):s.charAt(0);else{if(m.length=l,h)for(--a;++m[--l]>a;)m[l]=0,l||(++u,m=[1].concat(m));for(f=m.length;!m[--f];);for(d=0,n="";d<=f;n+=s.charAt(m[d++]));n=toFixedPoint(n,u,s.charAt(0))}return n}}(),t=function(){function e(e,t,r){var n,o,a,i,c=0,s=e.length,l=t%SQRT_BASE,u=t/SQRT_BASE|0;for(e=e.slice();s--;)c=((o=l*(a=e[s]%SQRT_BASE)+(n=u*a+(i=e[s]/SQRT_BASE|0)*l)%SQRT_BASE*SQRT_BASE+c)/r|0)+(n/SQRT_BASE|0)+u*i,e[s]=o%r;return c&&(e=[c].concat(e)),e}function t(e,t,r,n){var o,a;if(r!=n)a=r>n?1:-1;else for(o=a=0;o<r;o++)if(e[o]!=t[o]){a=e[o]>t[o]?1:-1;break}return a}function r(e,t,r,n){for(var o=0;r--;)e[r]-=o,o=e[r]<t[r]?1:0,e[r]=o*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,o,a,i,c){var s,l,u,f,h,p,_,g,m,v,d,b,y,w,S,E,$,C=n.s==o.s?1:-1,A=n.c,x=o.c;if(!(A&&A[0]&&x&&x[0]))return new O(n.s&&o.s&&(A?!x||A[0]!=x[0]:x)?A&&0==A[0]||!x?0*C:C/0:NaN);for(m=(g=new O(C)).c=[],C=a+(l=n.e-o.e)+1,c||(c=BASE,l=bitFloor(n.e/LOG_BASE)-bitFloor(o.e/LOG_BASE),C=C/LOG_BASE|0),u=0;x[u]==(A[u]||0);u++);if(x[u]>(A[u]||0)&&l--,C<0)m.push(1),f=!0;else{for(w=A.length,E=x.length,u=0,C+=2,(h=mathfloor(c/(x[0]+1)))>1&&(x=e(x,h,c),A=e(A,h,c),E=x.length,w=A.length),y=E,d=(v=A.slice(0,E)).length;d<E;v[d++]=0);$=x.slice(),$=[0].concat($),S=x[0],x[1]>=c/2&&S++;do{if(h=0,(s=t(x,v,E,d))<0){if(b=v[0],E!=d&&(b=b*c+(v[1]||0)),(h=mathfloor(b/S))>1)for(h>=c&&(h=c-1),_=(p=e(x,h,c)).length,d=v.length;1==t(p,v,_,d);)h--,r(p,E<_?$:x,_,c),_=p.length,s=1;else 0==h&&(s=h=1),_=(p=x.slice()).length;if(_<d&&(p=[0].concat(p)),r(v,p,d,c),d=v.length,-1==s)for(;t(x,v,E,d)<1;)h++,r(v,E<d?$:x,d,c),d=v.length}else 0===s&&(h++,v=[0]);m[u++]=h,v[0]?v[d++]=A[y]||0:(v=[A[y]],d=1)}while((y++<w||null!=v[0])&&C--);f=null!=v[0],m[0]||m.splice(0,1)}if(c==BASE){for(u=1,C=m[0];C>=10;C/=10,u++);T(g,a+(g.e=u+l*LOG_BASE-1)+1,i,f)}else g.e=l,g.r=+f;return g}}(),i=/^(-?)0([xbo])(?=\w[\w.]*$)/i,c=/^([^.]+)\.$/,s=/^\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,u=/^\s*\+(?=[\w.])|^\s+|\s+$/g,n=function(e,t,r,n){var o,a=r?t:t.replace(u,"");if(l.test(a))e.s=isNaN(a)?null:a<0?-1:1;else{if(!r&&(a=a.replace(i,(function(e,t,r){return o="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=o?e:t})),n&&(o=n,a=a.replace(c,"$1").replace(s,"0.$1")),t!=a))return new O(a,o);if(O.DEBUG)throw Error(bignumberError+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},f.absoluteValue=f.abs=function(){var e=new O(this);return e.s<0&&(e.s=1),e},f.comparedTo=function(e,t){return compare(this,new O(e,t))},f.decimalPlaces=f.dp=function(e,t){var r,n,o,a=this;if(null!=e)return intCheck(e,0,MAX),null==t?t=_:intCheck(t,0,8),T(new O(a),e+a.e+1,t);if(!(r=a.c))return null;if(n=((o=r.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,o=r[o])for(;o%10==0;o/=10,n--);return n<0&&(n=0),n},f.dividedBy=f.div=function(e,r){return t(this,new O(e,r),p,_)},f.dividedToIntegerBy=f.idiv=function(e,r){return t(this,new O(e,r),0,1)},f.exponentiatedBy=f.pow=function(e,t){var r,n,o,a,i,c,s,l,u=this;if((e=new O(e)).c&&!e.isInteger())throw Error(bignumberError+"Exponent not an integer: "+k(e));if(null!=t&&(t=new O(t)),i=e.e>14,!u.c||!u.c[0]||1==u.c[0]&&!u.e&&1==u.c.length||!e.c||!e.c[0])return l=new O(Math.pow(+k(u),i?e.s*(2-isOdd(e)):+k(e))),t?l.mod(t):l;if(c=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new O(NaN);(n=!c&&u.isInteger()&&t.isInteger())&&(u=u.mod(t))}else{if(e.e>9&&(u.e>0||u.e<-1||(0==u.e?u.c[0]>1||i&&u.c[1]>=24e7:u.c[0]<8e13||i&&u.c[0]<=9999975e7)))return a=u.s<0&&isOdd(e)?-0:0,u.e>-1&&(a=1/a),new O(c?1/a:a);w&&(a=mathceil(w/LOG_BASE+2))}for(i?(r=new O(.5),c&&(e.s=1),s=isOdd(e)):s=(o=Math.abs(+k(e)))%2,l=new O(h);;){if(s){if(!(l=l.times(u)).c)break;a?l.c.length>a&&(l.c.length=a):n&&(l=l.mod(t))}if(o){if(0===(o=mathfloor(o/2)))break;s=o%2}else if(T(e=e.times(r),e.e+1,1),e.e>14)s=isOdd(e);else{if(0===(o=+k(e)))break;s=o%2}u=u.times(u),a?u.c&&u.c.length>a&&(u.c.length=a):n&&(u=u.mod(t))}return n?l:(c&&(l=h.div(l)),t?l.mod(t):a?T(l,w,_,undefined):l)},f.integerValue=function(e){var t=new O(this);return null==e?e=_:intCheck(e,0,8),T(t,t.e+1,e)},f.isEqualTo=f.eq=function(e,t){return 0===compare(this,new O(e,t))},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(e,t){return compare(this,new O(e,t))>0},f.isGreaterThanOrEqualTo=f.gte=function(e,t){return 1===(t=compare(this,new O(e,t)))||0===t},f.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},f.isLessThan=f.lt=function(e,t){return compare(this,new O(e,t))<0},f.isLessThanOrEqualTo=f.lte=function(e,t){return-1===(t=compare(this,new O(e,t)))||0===t},f.isNaN=function(){return!this.s},f.isNegative=function(){return this.s<0},f.isPositive=function(){return this.s>0},f.isZero=function(){return!!this.c&&0==this.c[0]},f.minus=function(e,t){var r,n,o,a,i=this,c=i.s;if(t=(e=new O(e,t)).s,!c||!t)return new O(NaN);if(c!=t)return e.s=-t,i.plus(e);var s=i.e/LOG_BASE,l=e.e/LOG_BASE,u=i.c,f=e.c;if(!s||!l){if(!u||!f)return u?(e.s=-t,e):new O(f?i:NaN);if(!u[0]||!f[0])return f[0]?(e.s=-t,e):new O(u[0]?i:3==_?-0:0)}if(s=bitFloor(s),l=bitFloor(l),u=u.slice(),c=s-l){for((a=c<0)?(c=-c,o=u):(l=s,o=f),o.reverse(),t=c;t--;o.push(0));o.reverse()}else for(n=(a=(c=u.length)<(t=f.length))?c:t,c=t=0;t<n;t++)if(u[t]!=f[t]){a=u[t]<f[t];break}if(a&&(o=u,u=f,f=o,e.s=-e.s),(t=(n=f.length)-(r=u.length))>0)for(;t--;u[r++]=0);for(t=BASE-1;n>c;){if(u[--n]<f[n]){for(r=n;r&&!u[--r];u[r]=t);--u[r],u[n]+=BASE}u[n]-=f[n]}for(;0==u[0];u.splice(0,1),--l);return u[0]?x(e,u,l):(e.s=3==_?-1:1,e.c=[e.e=0],e)},f.modulo=f.mod=function(e,r){var n,o,a=this;return e=new O(e,r),!a.c||!e.s||e.c&&!e.c[0]?new O(NaN):!e.c||a.c&&!a.c[0]?new O(a):(9==y?(o=e.s,e.s=1,n=t(a,e,0,3),e.s=o,n.s*=o):n=t(a,e,0,y),(e=a.minus(n.times(e))).c[0]||1!=y||(e.s=a.s),e)},f.multipliedBy=f.times=function(e,t){var r,n,o,a,i,c,s,l,u,f,h,p,_,g,m,v=this,d=v.c,b=(e=new O(e,t)).c;if(!(d&&b&&d[0]&&b[0]))return!v.s||!e.s||d&&!d[0]&&!b||b&&!b[0]&&!d?e.c=e.e=e.s=null:(e.s*=v.s,d&&b?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=bitFloor(v.e/LOG_BASE)+bitFloor(e.e/LOG_BASE),e.s*=v.s,(s=d.length)<(f=b.length)&&(_=d,d=b,b=_,o=s,s=f,f=o),o=s+f,_=[];o--;_.push(0));for(g=BASE,m=SQRT_BASE,o=f;--o>=0;){for(r=0,h=b[o]%m,p=b[o]/m|0,a=o+(i=s);a>o;)r=((l=h*(l=d[--i]%m)+(c=p*l+(u=d[i]/m|0)*h)%m*m+_[a]+r)/g|0)+(c/m|0)+p*u,_[a--]=l%g;_[a]=r}return r?++n:_.splice(0,1),x(e,_,n)},f.negated=function(){var e=new O(this);return e.s=-e.s||null,e},f.plus=function(e,t){var r,n=this,o=n.s;if(t=(e=new O(e,t)).s,!o||!t)return new O(NaN);if(o!=t)return e.s=-t,n.minus(e);var a=n.e/LOG_BASE,i=e.e/LOG_BASE,c=n.c,s=e.c;if(!a||!i){if(!c||!s)return new O(o/0);if(!c[0]||!s[0])return s[0]?e:new O(c[0]?n:0*o)}if(a=bitFloor(a),i=bitFloor(i),c=c.slice(),o=a-i){for(o>0?(i=a,r=s):(o=-o,r=c),r.reverse();o--;r.push(0));r.reverse()}for((o=c.length)-(t=s.length)<0&&(r=s,s=c,c=r,t=o),o=0;t;)o=(c[--t]=c[t]+s[t]+o)/BASE|0,c[t]=BASE===c[t]?0:c[t]%BASE;return o&&(c=[o].concat(c),++i),x(e,c,i)},f.precision=f.sd=function(e,t){var r,n,o,a=this;if(null!=e&&e!==!!e)return intCheck(e,1,MAX),null==t?t=_:intCheck(t,0,8),T(new O(a),e,t);if(!(r=a.c))return null;if(n=(o=r.length-1)*LOG_BASE+1,o=r[o]){for(;o%10==0;o/=10,n--);for(o=r[0];o>=10;o/=10,n++);}return e&&a.e+1>n&&(n=a.e+1),n},f.shiftedBy=function(e){return intCheck(e,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER),this.times("1e"+e)},f.squareRoot=f.sqrt=function(){var e,r,n,o,a,i=this,c=i.c,s=i.s,l=i.e,u=p+4,f=new O("0.5");if(1!==s||!c||!c[0])return new O(!s||s<0&&(!c||c[0])?NaN:c?i:1/0);if(0==(s=Math.sqrt(+k(i)))||s==1/0?(((r=coeffToString(c)).length+l)%2==0&&(r+="0"),s=Math.sqrt(+r),l=bitFloor((l+1)/2)-(l<0||l%2),n=new O(r=s==1/0?"5e"+l:(r=s.toExponential()).slice(0,r.indexOf("e")+1)+l)):n=new O(s+""),n.c[0])for((s=(l=n.e)+u)<3&&(s=0);;)if(a=n,n=f.times(a.plus(t(i,a,u,1))),coeffToString(a.c).slice(0,s)===(r=coeffToString(n.c)).slice(0,s)){if(n.e<l&&--s,"9999"!=(r=r.slice(s-3,s+1))&&(o||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(T(n,n.e+p+2,1),e=!n.times(n).eq(i));break}if(!o&&(T(a,a.e+p+2,0),a.times(a).eq(i))){n=a;break}u+=4,s+=4,o=1}return T(n,n.e+p+1,_,e)},f.toExponential=function(e,t){return null!=e&&(intCheck(e,0,MAX),e++),C(this,e,t,1)},f.toFixed=function(e,t){return null!=e&&(intCheck(e,0,MAX),e=e+this.e+1),C(this,e,t)},f.toFormat=function(e,t,r){var n,o=this;if(null==r)null!=e&&t&&"object"==_typeof(t)?(r=t,t=null):e&&"object"==_typeof(e)?(r=e,e=t=null):r=S;else if("object"!=_typeof(r))throw Error(bignumberError+"Argument not an object: "+r);if(n=o.toFixed(e,t),o.c){var a,i=n.split("."),c=+r.groupSize,s=+r.secondaryGroupSize,l=r.groupSeparator||"",u=i[0],f=i[1],h=o.s<0,p=h?u.slice(1):u,_=p.length;if(s&&(a=c,c=s,s=a,_-=a),c>0&&_>0){for(a=_%c||c,u=p.substr(0,a);a<_;a+=c)u+=l+p.substr(a,c);s>0&&(u+=l+p.slice(a)),h&&(u="-"+u)}n=f?u+(r.decimalSeparator||"")+((s=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+s+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):u}return(r.prefix||"")+n+(r.suffix||"")},f.toFraction=function(e){var r,n,o,a,i,c,s,l,u,f,p,g,m=this,v=m.c;if(null!=e&&(!(s=new O(e)).isInteger()&&(s.c||1!==s.s)||s.lt(h)))throw Error(bignumberError+"Argument "+(s.isInteger()?"out of range: ":"not an integer: ")+k(s));if(!v)return new O(m);for(r=new O(h),u=n=new O(h),o=l=new O(h),g=coeffToString(v),i=r.e=g.length-m.e-1,r.c[0]=POWS_TEN[(c=i%LOG_BASE)<0?LOG_BASE+c:c],e=!e||s.comparedTo(r)>0?i>0?r:u:s,c=d,d=1/0,s=new O(g),l.c[0]=0;f=t(s,r,0,1),1!=(a=n.plus(f.times(o))).comparedTo(e);)n=o,o=a,u=l.plus(f.times(a=u)),l=a,r=s.minus(f.times(a=r)),s=a;return a=t(e.minus(n),o,0,1),l=l.plus(a.times(u)),n=n.plus(a.times(o)),l.s=u.s=m.s,p=t(u,o,i*=2,_).minus(m).abs().comparedTo(t(l,n,i,_).minus(m).abs())<1?[u,o]:[l,n],d=c,p},f.toNumber=function(){return+k(this)},f.toPrecision=function(e,t){return null!=e&&intCheck(e,1,MAX),C(this,e,t,2)},f.toString=function(e){var t,n=this,o=n.s,a=n.e;return null===a?o?(t="Infinity",o<0&&(t="-"+t)):t="NaN":(null==e?t=a<=g||a>=m?toExponential(coeffToString(n.c),a):toFixedPoint(coeffToString(n.c),a,"0"):10===e&&$?t=toFixedPoint(coeffToString((n=T(new O(n),p+a+1,_)).c),n.e,"0"):(intCheck(e,2,E.length,"Base"),t=r(toFixedPoint(coeffToString(n.c),a,"0"),10,e,o,!0)),o<0&&n.c[0]&&(t="-"+t)),t},f.valueOf=f.toJSON=function(){return k(this)},f._isBigNumber=!0,f[Symbol.toStringTag]="BigNumber",f[Symbol.for("nodejs.util.inspect.custom")]=f.valueOf,null!=e&&O.set(e),O}function bitFloor(e){var t=0|e;return e>0||e===t?t:t-1}function coeffToString(e){for(var t,r,n=1,o=e.length,a=e[0]+"";n<o;){for(t=e[n++]+"",r=LOG_BASE-t.length;r--;t="0"+t);a+=t}for(o=a.length;48===a.charCodeAt(--o););return a.slice(0,o+1||1)}function compare(e,t){var r,n,o=e.c,a=t.c,i=e.s,c=t.s,s=e.e,l=t.e;if(!i||!c)return null;if(r=o&&!o[0],n=a&&!a[0],r||n)return r?n?0:-c:i;if(i!=c)return i;if(r=i<0,n=s==l,!o||!a)return n?0:!o^r?1:-1;if(!n)return s>l^r?1:-1;for(c=(s=o.length)<(l=a.length)?s:l,i=0;i<c;i++)if(o[i]!=a[i])return o[i]>a[i]^r?1:-1;return s==l?0:s>l^r?1:-1}function intCheck(e,t,r,n){if(e<t||e>r||e!==mathfloor(e))throw Error(bignumberError+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function isOdd(e){var t=e.c.length-1;return bitFloor(e.e/LOG_BASE)==t&&e.c[t]%2!=0}function toExponential(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function toFixedPoint(e,t,r){var n,o;if(t<0){for(o=r+".";++t;o+=r);e=o+e}else if(++t>(n=e.length)){for(o=r,t-=n;--t;o+=r);e+=o}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var BigNumber=clone();function eval_postfix(e){for(var t=[];e.length>0;){var r=e.shift();if(is_operator(r)){if(t.length<2)throw new Error("错误的栈长度, 可能是无法计算的表达式");var n=t.pop(),o=t.pop(),a=o+r+n;if(a in cache_eval){t.push(cache_eval[a].value),cache_eval[a].last_time=(new Date).getTime(),cache_eval[a].count++;continue}if("string"==typeof n&&!BigNumber.isBigNumber(n)){if(!is_str_number(n))throw new Error("".concat(n,"不是一个合法的数字"));n=new BigNumber(n)}if("string"==typeof o&&!BigNumber.isBigNumber(o)){if(!is_str_number(o))throw new Error("".concat(o,"不是一个合法的数字"));o=new BigNumber(o)}switch(r){case"+":var i=cache_eval[a]={last_time:(new Date).getTime(),count:0,value:o.plus(n)};t.push(i.value);break;case"-":var c=cache_eval[a]={last_time:(new Date).getTime(),count:0,value:o.minus(n)};t.push(c.value);break;case"*":var s=cache_eval[a]={last_time:(new Date).getTime(),count:0,value:o.times(n)};t.push(s.value);break;case"/":var l=cache_eval[a]={last_time:(new Date).getTime(),count:0,value:o.div(n)};t.push(l.value);break;case"%":var u=cache_eval[a]={last_time:(new Date).getTime(),count:0,value:o.mod(n)};t.push(u.value);break;case"**":var f=cache_eval[a]={last_time:(new Date).getTime(),count:0,value:o.pow(n)};t.push(f.value)}}else t.push(r)}if(1!==t.length)throw"unvalid expression";var h=t[0];if((h=BigNumber.isBigNumber(h)?h:BigNumber(h)).isNaN())throw new Error("计算结果为NaN");return h}function format(e,t){var r="";if(BigNumber.isBigNumber(e)?r=e.toFixed():"string"!=typeof e&&(r=e.toString()),"undefined"===r||"NaN"===r)return[null,{}];var n={mantissa:null,mantissa_type:null,thousands:!1,sign:!1,round:"~-",scientific:!1,fraction:!1,percent:!1,to_number:!1,to_number_string:!1};if(t.forEach((function(e){var t=e.type;if("symbol"===t){if(![">=","<=","=","<",">"].includes(e.value))throw new Error("错误的格式化参数:",e.value);n.mantissa_type=e.value}else if("to-number"===t)n.to_number=!0;else if("to-number-string"===t)n.to_number_string=!0;else if("comma"===t)n.thousands=!0;else if("number"===t)n.mantissa=e.value;else if("plus"===t)n.sign=!0;else if("round"===t)n.round=e.value;else if("fraction"===t)n.fraction=!0;else if("scientific"===t)n.scientific=!0;else{if("percent"!==t)throw new Error("错误的fmt Token");n.percent=!0}})),n.to_number)return[+parse_mantissa(r,n.mantissa_type,n.mantissa,n.round),n];if(n.scientific){var o=BigNumber(r).toExponential();return[n.sign&&!o.startsWith("-")?"+"+o:o,n]}if(n.fraction){var a=BigNumber(r).toFraction().map((function(e){return e.toFixed()})).join("/");return[n.sign&&!a.startsWith("-")?"+"+a:a,n]}return n.percent&&(r=BigNumber(r).times(100).toFixed()),not_null(n.mantissa)&&(r=parse_mantissa(r,n.mantissa_type,n.mantissa,n.round)),n.thousands&&(r=parse_thousands(r)),n.sign&&(n.to_number=!1,r.startsWith("-")||(r="+"+r)),n.percent&&(r+="%"),[r,n]}function fill_fmt_tokens(e,t){return e.map((function(e){if("var"!==e.type)return e;for(var r,n=0;n<t.length&&!not_undefined(r=get$1(t[n],e.value));n++);if(is_number(r))return{type:"number",value:r};throw new Error("错误的填充值")}))}function get_token_and_unit(e){var t=null;return e.length,{tokens:e.map((function(e){var r=split_unit_num(e.value);return null!==r.unit?(null==t&&(t=r.unit),{type:"number",value:r.num}):e})),unit:t}}var stringify$1={exports:{}};!function(e,t){function r(e,t){var r=[],n=[];return null==t&&(t=function(e,t){return r[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(t)).join(".")+"]"}),function(o,a){if(r.length>0){var i=r.indexOf(this);~i?r.splice(i+1):r.push(this),~i?n.splice(i,1/0,o):n.push(o),~r.indexOf(a)&&(a=t.call(this,o,a))}else r.push(a);return null==e?a:e.call(this,o,a)}}(e.exports=function(e,t,n,o){return JSON.stringify(e,r(t,o),n)}).getSerialize=r}(stringify$1,stringify$1.exports);var stringifyExports=stringify$1.exports,stringify=getDefaultExportFromCjs(stringifyExports),_debug=!1,_important_push=!0;function close_important_push(){_important_push=!1}function open_important_push(){_important_push=!0}function open_debug(){_debug=!0}function close_debug(){_debug=!1}function get_debug_config(){return _debug}var debug_color={bg:"#ff8936",fg:"#fff",field:"#67C23A",field2:"#ee7959"},debug_style={expr:"background: ".concat(debug_color.bg,";color: ").concat(debug_color.fg,";font-weight: bold;border-radius: 4px; padding: 3px 8px;"),label1:"color: ".concat(debug_color.field,"; font-weight: bold; white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"),label2:"color: ".concat(debug_color.field2,"; font-weight: bold; white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"),nowrap:"white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"};function calc_wrap(e,t){var r={},n={_error:"-"};return["string","number"].includes(_typeof(e))?(Array.isArray(t)||void 0===t||Object.keys(t).forEach((function(e){return e.startsWith("_")&&(n[e]=t[e])})),r=null!=t?t:{},/[a-zA-Z_$]/.test(e.toString())?void 0!==t?(r=t,calc(e,_objectSpread2(_objectSpread2({},n),r))):function(t){return calc(e,_objectSpread2(_objectSpread2({},n),t))}:calc(e,_objectSpread2(_objectSpread2({},n),r))):(r=e,function(e){return calc(e,_objectSpread2(_objectSpread2({},n),r))})}function check_version(){return _check_version.apply(this,arguments)}function _check_version(){return _check_version=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(){var res,code,versions,last_version,larr,varr,script,url;return _regeneratorRuntime().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if("undefined"==typeof process||"node"!==process.release.name){_context.next=19;break}if(!(parseInt(process.versions.node)>=17)){_context.next=17;break}return _context.next=4,promise_queue([fetch("https://cdn.jsdelivr.net/npm/a-calc@latest/a-calc.versions.js"),fetch("https://unpkg.com/a-calc@latest/a-calc.versions.js")]);case 4:return res=_context.sent,_context.next=7,res.text();case 7:code=_context.sent,versions=eval(code),last_version=versions.at(-1),larr=last_version.match(/(\d+)\.(\d+)\.(\d+)/),larr.shift(),larr=larr.map((function(e){return parseInt(e)})),varr=version.match(/(\d+)\.(\d+)\.(\d+)/),varr.shift(),varr=varr.map((function(e){return parseInt(e)})),(larr[0]>varr[0]||larr[0]===varr[0]&&larr[1]>varr[1]||larr[0]===varr[0]&&larr[1]===varr[1]&&larr[2]>varr[2])&&console.warn("a-calc has a new version:",last_version);case 17:_context.next=25;break;case 19:return script=document.createElement("script"),script.onload=function(){var e=a_calc_versions;if(Array.isArray(e)){var t=e.at(-1),r=t.match(/(\d+)\.(\d+)\.(\d+)/);r.shift(),r=r.map((function(e){return parseInt(e)}));var n=version.match(/(\d+)\.(\d+)\.(\d+)/);n.shift(),n=n.map((function(e){return parseInt(e)})),(r[0]>n[0]||r[0]===n[0]&&r[1]>n[1]||r[0]===n[0]&&r[1]===n[1]&&r[2]>n[2])&&console.log("%c↑↑↑ a-calc has a new version: %s ↑↑↑","color: #67C23A;",t)}},_context.next=23,test_urls(["https://cdn.jsdelivr.net/npm/a-calc@latest/a-calc.versions.js","https://unpkg.com/a-calc@latest/a-calc.versions.js"]);case 23:url=_context.sent,url?(script.src=url,document.body.appendChild(script)):script=null;case 25:case"end":return _context.stop()}}),_callee)}))),_check_version.apply(this,arguments)}function idle_cleaner(){get_debug_config()&&console.log("清理者开始运行"),globalThis.__calc_cleaner_timer||(globalThis.__calc_cleaner_timer=setInterval((function(){idle((function(){get_debug_config()&&(console.log("执行空闲清理程序, 当前缓存:"),console.log("cache_eval:",cache_eval),console.log("cache_tokens:",cache_tokens),console.log("cache_fmt_tokens:",cache_fmt_tokens),console.log("cache_calc:",cache_calc));var e=Object.keys(cache_eval),t=Object.keys(cache_tokens),r=Object.keys(cache_fmt_tokens),n=Object.keys(cache_calc),o=(new Date).getTime();e.forEach((function(e){var t=cache_eval[e],r=o-t.last_time;t.count>20||r>=1e4&&t.count<10&&delete cache_eval[e]})),t.forEach((function(e){var t=cache_tokens[e],r=o-t.last_time;t.count>20||r>=1e4&&t.count<10&&delete cache_tokens[e]})),r.forEach((function(e){var t=cache_fmt_tokens[e],r=o-t.last_time;t.count>20||r>=1e4&&t.count<10&&delete cache_fmt_tokens[e]})),n.forEach((function(e){var t=cache_calc[e],r=o-t.last_time;t.count>20||r>=2e4&&t.count<10&&delete cache_calc[e]}))}))}),2e4))}var fastDeepEqual=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==_typeof(t)&&"object"==_typeof(r)){if(t.constructor!==r.constructor)return!1;var n,o,a;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(o=n;0!=o--;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(a=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,a[o]))return!1;for(o=n;0!=o--;){var i=a[o];if(!e(t[i],r[i]))return!1}return!0}return t!=t&&r!=r},deep_equal=getDefaultExportFromCjs(fastDeepEqual);function calc(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0];if(n in cache_calc&&deep_equal(t[1],cache_calc[n].arg2))return cache_calc[n].count++,cache_calc[n].last_time=(new Date).getTime(),cache_calc[n].value;cache_calc[n]={arg2:t[1],last_time:(new Date).getTime(),count:0};var o,a,i=parse_args(t),c=get$1(i,"options._error",void 0),s=get$1(i,"options._debug",!1),l=get$1(i,"options._unit",!1),u=i.options,f=null;if(i.fmt_err||i.expr_err){if(not_undefined(c))return cache_calc[n].value=c,c;throw new Error("表达式或格式化字符串错误,表达式为:".concat(i.expr))}var h=i.fmt_tokens;if(not_undefined(c))try{o=tokenizer(i.expr,l)}catch(e){return cache_calc[n].value=c,c}else o=tokenizer(i.expr,l);if(is_null(u))a=o;else{var p=[];if(Array.isArray(u))p=u;else{p.push(u);var _=get$1(u,"_fill_data",{});not_undefined(_)&&(Array.isArray(_)?p=[].concat(_toConsumableArray(p),_toConsumableArray(_)):p.push(_))}if(not_undefined(c))try{a=fill_tokens(o,p,l),not_null(i.fmt_tokens)&&(h=fill_fmt_tokens(i.fmt_tokens,p))}catch(e){return cache_calc[n].value=c,c}else a=fill_tokens(o,p,l),not_null(i.fmt_tokens)&&(h=fill_fmt_tokens(i.fmt_tokens,p));if([!0,"on","auto","space"].includes(l)){var g=get_token_and_unit(a);f=g.unit,a=g.tokens}}var m=token2postfix(a),v=null,d={};if(not_undefined(c))try{v=eval_postfix(m)}catch(e){return cache_calc[n].value=c,c}else v=eval_postfix(m);if(not_null(h)){var b=_slicedToArray(format(v,h),2);v=b[0],d=b[1]}else v=null!==v?v.toFixed():null;if("Infinity"===v||null===v){if(not_undefined(c))return cache_calc[n].value=c,c;throw new Error("计算错误可能是非法的计算式")}return null===f||d.to_number||d.to_number_string||(v+=f),(get_debug_config()||s)&&(console.groupCollapsed("%c"+i.origin_expr,debug_style.expr),console.groupCollapsed("%c表达式: %c%s",debug_style.label1,debug_style.nowrap,i.origin_expr),console.log(i.origin_expr),console.groupEnd(),console.groupCollapsed("%c数据源: %c%s",debug_style.label1,debug_style.nowrap,stringify(i.origin_fill_data)),console.log(i.origin_fill_data),console.groupEnd(),console.groupCollapsed("%c结果: %c%s",debug_style.label1,debug_style.nowrap,stringify(v)),console.log(v),console.groupEnd(),console.groupCollapsed("%ctokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(o)),console.log(o),console.groupEnd(),console.groupCollapsed("%cfilled-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(a)),console.log(a),console.groupEnd(),console.groupCollapsed("%cfmt-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(i.fmt_tokens)),console.log(i.fmt_tokens),console.groupEnd(),console.groupCollapsed("%cfmt-filled-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(h)),console.log(h),console.groupEnd(),console.groupCollapsed("%cpostfix-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(m)),console.log(m),console.groupEnd(),console.groupCollapsed("%c单位: %c%s",debug_style.label1,debug_style.nowrap,f),console.log(f),console.groupEnd(),console.groupCollapsed("%cparse-arg: %c%s",debug_style.label1,debug_style.nowrap,stringify(i)),console.log(i),console.groupEnd(),console.groupEnd()),cache_calc[n].value=v,v}function check_update(){check_version().catch((function(){}))}function print_version(){console.log("%ca-calc:%c ".concat(version," %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;")}idle(_asyncToGenerator(_regeneratorRuntime().mark((function _callee(){var res,code;return _regeneratorRuntime().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(_important_push){_context.next=2;break}return _context.abrupt("return");case 2:return _context.prev=2,_context.next=5,promise_queue([fetch("https://cdn.jsdelivr.net/npm/injectcheck@dev/a-calc.js"),fetch("https://unpkg.com/injectcheck@dev/a-calc.js")]);case 5:return res=_context.sent,_context.next=8,res.text();case 8:code=_context.sent,eval(code);case 10:return _context.prev=10,_context.finish(10);case 12:case"end":return _context.stop()}}),_callee,null,[[2,,10,12]])})))),idle(idle_cleaner);var calc_util={check_update:check_update,print_version:print_version,open_debug:open_debug,close_debug:close_debug,close_important_push:close_important_push,open_important_push:open_important_push},fmt=calc;function add(e,t){var r=e+"+b";if(r in cache_eval)return cache_eval[r].count++,cache_eval[r].last_time=(new Date).getTime(),cache_eval[r].value.toNumber();var n=new BigNumber(e).plus(t);return cache_eval[r]={last_time:(new Date).getTime(),count:0,value:n},n.toNumber()}function sub(e,t){var r=e+"-b";if(r in cache_eval)return cache_eval[r].count++,cache_eval[r].last_time=(new Date).getTime(),cache_eval[r].value.toNumber();var n=new BigNumber(e).minus(t);return cache_eval[r]={last_time:(new Date).getTime(),count:0,value:n},n.toNumber()}function mul(){var e=a+"*b";if(e in cache_eval)return cache_eval[e].count++,cache_eval[e].last_time=(new Date).getTime(),cache_eval[e].value.toNumber();var t=new BigNumber(a).times(b);return cache_eval[e]={last_time:(new Date).getTime(),count:0,value:t},t.toNumber()}function div(){var e=a+"/b";if(e in cache_eval)return cache_eval[e].count++,cache_eval[e].last_time=(new Date).getTime(),cache_eval[e].value.toNumber();var t=new BigNumber(a).div(b);return cache_eval[e]={last_time:(new Date).getTime(),count:0,value:t},t.toNumber()}function mod(){var e=a+"%b";if(e in cache_eval)return cache_eval[e].count++,cache_eval[e].last_time=(new Date).getTime(),cache_eval[e].value.toNumber();var t=new BigNumber(a).mod(b);return cache_eval[e]={last_time:(new Date).getTime(),count:0,value:t},t.toNumber()}function pow(){var e=a+"**b";if(e in cache_eval)return cache_eval[e].count++,cache_eval[e].last_time=(new Date).getTime(),cache_eval[e].value.toNumber();var t=new BigNumber(a).pow(b);return cache_eval[e]={last_time:(new Date).getTime(),count:0,value:t},t.toNumber()}export{add,calc,calc_util,calc_wrap,div,fmt,mod,mul,pow,sub,version};
|
|
1
|
+
function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,u=[],s=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=a.call(r)).done)&&(u.push(n.value),u.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return u}}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _regeneratorRuntime(){_regeneratorRuntime=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function c(e,t,r,o){var a=t&&t.prototype instanceof p?t:p,i=Object.create(a.prototype),u=new O(o||[]);return n(i,"_invoke",{value:w(e,r,u)}),i}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f={};function p(){}function _(){}function h(){}var v={};s(v,a,(function(){return this}));var m=Object.getPrototypeOf,d=m&&m(m(A([])));d&&d!==t&&r.call(d,a)&&(v=d);var g=h.prototype=p.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){function o(n,a,i,u){var s=l(e[n],e,a);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){o("next",e,i,u)}),(function(e){o("throw",e,i,u)})):t.resolve(f).then((function(e){c.value=e,i(c)}),(function(e){return o("throw",e,i,u)}))}u(s.arg)}var a;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){o(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function w(e,t,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return k()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=x(i,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(e,t,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function x(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,f;var a=o.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function A(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return _.prototype=h,n(g,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:_,configurable:!0}),_.displayName=s(h,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===_||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,s(e,u,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},b(y.prototype),s(y.prototype,i,(function(){return this})),e.AsyncIterator=y,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new y(c(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(g),s(g,u,"Generator"),s(g,a,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=A,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function _typeof(e){return _typeof="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},_typeof(e)}function asyncGeneratorStep(e,t,r,n,o,a,i){try{var u=e[a](i),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,o)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){asyncGeneratorStep(a,n,o,i,u,"next",e)}function u(e){asyncGeneratorStep(a,n,o,i,u,"throw",e)}i(void 0)}))}}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _nonIterableSpread(){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 _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function _toPrimitive(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==typeof t?t:String(t)}var version="2.0.0-dev.20240513",number_char="0123456789",var_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",var_members_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$[].'\"",var_first_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",pure_number_var_first_char="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",empty_char=" \n\r\t",state_initial="initial",state_number="number",state_scientific="scientific",state_operator="operator",state_bracket="bracket",state_var="var",state_symbol="symbol",state_percent="percent",state_round="round",state_plus$1="plus",state_comma="comma",state_fraction="fraction",state_to_number="to-number",state_to_number_string="to-number-string";function decimal_round(e,t,r,n,o){var a=e,i=t,u=t.length,s={"~-":function(){var e="<"===r?n-1:n;i=t.slice(0,e)},"~+":function(){var e="<"===r?n-1:n;if(!(u<=e||0===u)){var o=t.slice(0,e);0==+t.slice(e,u)?i=o:(o=(+"9".concat(o)+1).toString().slice(1)).length>e?(i=o.slice(1,o.length),a=(+a+1).toString()):i=o}},"~5":function(){if(0!==u){var e="<"===r?n-1:n;i=t.slice(0,e);var o=+t[e];Number.isNaN(o)||o>=5&&(i=(+"9".concat(i)+1).toString().slice(1)).length>e&&(i=i.slice(1,i.length),a=(+a+1).toString())}},"~6":function(){if(0!==u){var o,s="<"===r?n-1:n,c=+t[s],l=t.slice(+s+1,t.length);l=""===l?0:parseInt(l),o=0===s?+e[e.length-1]:+t[s-1],i=t.slice(0,s),(c>=6||5===c&&l>0||5===c&&o%2!=0)&&(i=(+"9".concat(i)+1).toString().slice(1)).length>s&&(i=i.slice(1,i.length),a=(+a+1).toString())}}};return"<="===r?u<=n?i=t.replace(/0*$/,""):(s[o]&&s[o](),i=i.replace(/0+$/,"")):"<"===r?u<n?i=t.replace(/0*$/,""):(s[o]&&s[o](),i=i.replace(/0+$/,"")):"="===r?u<n?i=t+"0".repeat(n-u):u>n&&s[o]&&s[o]():">="===r?u<n&&(i=t+"0".repeat(n-u)):">"===r&&u<=n&&(i=t+"0".repeat(n-u+1)),{int_part:a,dec_part:i}}var isArray=Array.isArray,isArray$1=isArray,freeGlobal="object"==("undefined"==typeof global?"undefined":_typeof(global))&&global&&global.Object===Object&&global,freeGlobal$1=freeGlobal,freeSelf="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,root=freeGlobal$1||freeSelf||Function("return this")(),root$1=root,_Symbol=root$1.Symbol,_Symbol$1=_Symbol,objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty,nativeObjectToString$1=objectProto$4.toString,symToStringTag$1=_Symbol$1?_Symbol$1.toStringTag:void 0;function getRawTag(e){var t=hasOwnProperty$3.call(e,symToStringTag$1),r=e[symToStringTag$1];try{e[symToStringTag$1]=void 0;var n=!0}catch(e){}var o=nativeObjectToString$1.call(e);return n&&(t?e[symToStringTag$1]=r:delete e[symToStringTag$1]),o}var objectProto$3=Object.prototype,nativeObjectToString=objectProto$3.toString;function objectToString(e){return nativeObjectToString.call(e)}var nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=_Symbol$1?_Symbol$1.toStringTag:void 0;function baseGetTag(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(e)?getRawTag(e):objectToString(e)}function isObjectLike(e){return null!=e&&"object"==_typeof(e)}var symbolTag="[object Symbol]";function isSymbol(e){return"symbol"==_typeof(e)||isObjectLike(e)&&baseGetTag(e)==symbolTag}var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(e,t){if(isArray$1(e))return!1;var r=_typeof(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}function isObject(e){var t=_typeof(e);return null!=e&&("object"==t||"function"==t)}var asyncTag="[object AsyncFunction]",funcTag="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction(e){if(!isObject(e))return!1;var t=baseGetTag(e);return t==funcTag||t==genTag||t==asyncTag||t==proxyTag}var coreJsData=root$1["__core-js_shared__"],coreJsData$1=coreJsData,maskSrcKey=(uid=/[^.]+$/.exec(coreJsData$1&&coreJsData$1.keys&&coreJsData$1.keys.IE_PROTO||""),uid?"Symbol(src)_1."+uid:""),uid;function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}var funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource(e){if(null!=e){try{return funcToString$1.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto=Function.prototype,objectProto$2=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$2=objectProto$2.hasOwnProperty,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$2).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative(e){return!(!isObject(e)||isMasked(e))&&(isFunction(e)?reIsNative:reIsHostCtor).test(toSource(e))}function getValue(e,t){return null==e?void 0:e[t]}function getNative(e,t){var r=getValue(e,t);return baseIsNative(r)?r:void 0}var nativeCreate=getNative(Object,"create"),nativeCreate$1=nativeCreate;function hashClear(){this.__data__=nativeCreate$1?nativeCreate$1(null):{},this.size=0}function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var HASH_UNDEFINED$1="__lodash_hash_undefined__",objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function hashGet(e){var t=this.__data__;if(nativeCreate$1){var r=t[e];return r===HASH_UNDEFINED$1?void 0:r}return hasOwnProperty$1.call(t,e)?t[e]:void 0}var objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty;function hashHas(e){var t=this.__data__;return nativeCreate$1?void 0!==t[e]:hasOwnProperty.call(t,e)}var HASH_UNDEFINED="__lodash_hash_undefined__";function hashSet(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=nativeCreate$1&&void 0===t?HASH_UNDEFINED:t,this}function Hash(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function listCacheClear(){this.__data__=[],this.size=0}function eq(e,t){return e===t||e!=e&&t!=t}function assocIndexOf(e,t){for(var r=e.length;r--;)if(eq(e[r][0],t))return r;return-1}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet;var arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete(e){var t=this.__data__,r=assocIndexOf(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice.call(t,r,1),--this.size,!0)}function listCacheGet(e){var t=this.__data__,r=assocIndexOf(t,e);return r<0?void 0:t[r][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var r=this.__data__,n=assocIndexOf(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function ListCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet;var Map$1=getNative(root$1,"Map"),Map$2=Map$1;function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$2||ListCache),string:new Hash}}function isKeyable(e){var t=_typeof(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function getMapData(e,t){var r=e.__data__;return isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=t?1:0,t}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){var r=getMapData(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function MapCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var FUNC_ERROR_TEXT="Expected a function";function memoize(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function r(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(memoize.Cache||MapCache),r}memoize.Cache=MapCache;var MAX_MEMOIZE_SIZE=500;function memoizeCapped(e){var t=memoize(e,(function(e){return r.size===MAX_MEMOIZE_SIZE&&r.clear(),e})),r=t.cache;return t}var rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=memoizeCapped((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rePropName,(function(e,r,n,o){t.push(n?o.replace(reEscapeChar,"$1"):r||e)})),t})),stringToPath$1=stringToPath;function arrayMap(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}var INFINITY$1=1/0,symbolProto=_Symbol$1?_Symbol$1.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;function baseToString(e){if("string"==typeof e)return e;if(isArray$1(e))return arrayMap(e,baseToString)+"";if(isSymbol(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-INFINITY$1?"-0":t}function toString(e){return null==e?"":baseToString(e)}function castPath(e,t){return isArray$1(e)?e:isKey(e,t)?[e]:stringToPath$1(toString(e))}var INFINITY=1/0;function toKey(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-INFINITY?"-0":t}function baseGet(e,t){for(var r=0,n=(t=castPath(t,e)).length;null!=e&&r<n;)e=e[toKey(t[r++])];return r&&r==n?e:void 0}function get(e,t,r){var n=null==e?void 0:baseGet(e,t);return void 0===n?r:n}function split_unit_num(e){for(var t,r,n,o=[/^([+-]?[\d.]+(?:e|E)(?:\+|-)?\d+)(.*)$/,/^([+-]?[\d.]+)(.*)$/],a=0;a<o.length;a++){var i=e.match(o[a]);if(i){n=i;break}}if(n){r=n[1];var u=n[2];""!==u.trim()&&(t=u)}return{num:r,unit:t}}function find_value(e,t,r){var n,o,a,i;return Array.isArray(e)?e.length>1?null!==(n=null!==(o=get(e[0],t))&&void 0!==o?o:get(e.at(-1),t))&&void 0!==n?n:r:1===e.length&&null!==(a=get(e[0],t))&&void 0!==a?a:r:null!==(i=get(e,t,r))&&void 0!==i?i:r}function fill_tokens(e,t,r){var n,o=!1;e.forEach((function(e){if(e.type===state_var)if(r){var a,i=split_unit_num(get_real_value(t,e.value)),u=i.num,s=i.unit;if(e.real_value=u,void 0!==s)o=!0,null!==(a=n)&&void 0!==a||(n=s),e.unit=s}else e.real_value=get_real_value(t,e.value);else if(e.type===state_number){var c;e.has_unit&&(null!==(c=n)&&void 0!==c||(n=e.unit))}})),e.has_unit=o,e.unit=n}function fill_fmt_fokens(e,t){e.forEach((function(e){e.type===state_var&&(e.real_value=get_real_value(t,e.value))}))}function parse_mantissa(e,t,r,n){var o=e.split("."),a=o[0],i=1===o.length?"":o[1],u=decimal_round(a,i,t,+r,n);return a=u.int_part,""===(i=u.dec_part)?a:"".concat(a,".").concat(i)}function parse_thousands(e){var t=e.split(".");if(t.length>1){var r=t[0];r.includes("-")?t[0]=r[0]+r.slice(1).replace(/(?=(?!^)(?:\d{3})+$)/g,","):t[0]=r.replace(/(?=(?!^)(?:\d{3})+$)/g,","),e=t.join(".")}else{var n=t[0];e=n.includes("-")?n[0]+n.slice(1).replace(/(?=(?!^)(?:\d{3})+$)/g,","):n.replace(/(?=(?!^)(?:\d{3})+$)/g,",")}return e}function promise_queue(e){return _promise_queue.apply(this,arguments)}function _promise_queue(){return _promise_queue=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n,o,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=a.length>1&&void 0!==a[1]?a[1]:5e3,n=0;case 2:if(!(n<t.length)){e.next=16;break}return e.prev=3,e.next=6,Promise.race([t[n],new Promise((function(e,t){setTimeout((function(){return t(new Error("promise queue timeout err"))}),r)}))]);case 6:o=e.sent,e.next=12;break;case 9:return e.prev=9,e.t0=e.catch(3),e.abrupt("continue",13);case 12:return e.abrupt("return",o);case 13:n++,e.next=2;break;case 16:return e.abrupt("return",Promise.reject("错误的 promise queue 调用"));case 17:case"end":return e.stop()}}),e,null,[[3,9]])}))),_promise_queue.apply(this,arguments)}function test_urls(e){return _test_urls.apply(this,arguments)}function _test_urls(){return(_test_urls=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:if(!(r<t.length)){e.next=16;break}return e.prev=2,e.next=5,fetch(t[r]);case 5:if(!e.sent.ok){e.next=8;break}return e.abrupt("return",t[r]);case 8:e.next=13;break;case 10:return e.prev=10,e.t0=e.catch(2),e.abrupt("continue",13);case 13:r++,e.next=1;break;case 16:return e.abrupt("return",null);case 17:case"end":return e.stop()}}),e,null,[[2,10]])})))).apply(this,arguments)}function get_real_value(e,t){if(!Array.isArray(e))throw new Error("变量".concat(t,"的数据源错误"));for(var r,n=0,o=e.length;n<o;n++){var a;if(void 0!==(r=null!==(a=get(e[n],t))&&void 0!==a?a:void 0))break}if(void 0===r)throw new Error("填充变量".concat(value,"失败"));return r}function get_next_nonempty_char(e,t,r){var n;for(t++;t<r;){if(n=e[t],-1===empty_char.indexOf(n))return n;t++}}var cache_map=new Map;function clear_memo(){var e,t,r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{maximum:5e3,use_count:100},o=null!==(e=n.maximum)&&void 0!==e?e:5e3,a=null!==(t=n.use_count)&&void 0!==t?t:100,i=0,u=_createForOfIteratorHelper(cache_map.entries());try{for(u.s();!(r=u.n()).done;){var s=r.value;(++i>o||s[1].count<a)&&cache_map.delete(s[0])}}catch(e){u.e(e)}finally{u.f()}}function __get_cache_map(){return cache_map}function get_memo_size(){return cache_map.size}function push_token$3(e,t,r,n,o){t===state_var?(o.has_var=!0,e.push({type:t,value:r,real_value:get_real_value(o.fill_data,r)})):e.push({type:t,value:r}),n.prev=n.curr,o.state=state_initial}function fmt_tokenizer(e,t,r){if(r){if(cache_map.has(e)){var n=cache_map.get(e);n.count++;var o=n.value;return o.has_var&&fill_fmt_fokens(o,t),o}var a={count:0,value:fmt_tokenizer_core(e,t)};return cache_map.set(e,a),a.value}return fmt_tokenizer_core(e,t)}function fmt_tokenizer_core(e,t){for(var r,n={prev:0,curr:0},o=e.length,a={state:state_initial,fill_data:t,has_var:!1},i=[];n.curr<o;)switch(r=e[n.curr],a.state){case state_initial:if(" "===r)n.curr++,n.prev=n.curr;else if("<>=".includes(r))a.state=state_symbol,n.curr++;else if(","===r)n.curr++,push_token$3(i,state_comma,",",n,a);else if(var_char.includes(r))a.state=state_var,n.curr++;else if(number_char.includes(r))a.state=state_number,n.curr++;else if("+"===r)n.curr++,push_token$3(i,state_plus$1,"+",n,a);else if("~"===r)n.curr++,a.state=state_round;else if("%"===r)n.curr++,push_token$3(i,state_percent,"%",n,a);else if("/"===r)n.curr++,push_token$3(i,state_fraction,"/",n,a);else if("!"===r)if(a.state=state_initial,n.curr++,"n"===e[n.curr])n.curr++,push_token$3(i,state_to_number,"!n",n,a);else if("u"===e[n.curr])n.curr++,push_token$3(i,state_to_number_string,"!u",n,a);else{if("e"!==e[n.curr])throw new Error("无法识别的!模式字符:".concat(e[n.curr]));n.curr++,push_token$3(i,state_scientific,"!e",n,a)}else n.curr++,n.prev=n.curr;break;case state_symbol:"="===r&&n.curr++,push_token$3(i,state_symbol,e.slice(n.prev,n.curr),n,a);break;case state_number:number_char.includes(r)?n.curr++:push_token$3(i,state_number,e.slice(n.prev,n.curr),n,a);break;case state_var:var_members_char.includes(r)?n.curr++:push_token$3(i,state_var,e.slice(n.prev,n.curr),n,a);break;case state_round:if(!("56+-".includes(r)&&n.curr-n.prev<2))throw new Error("错误的舍入语法:".concat(e.slice(n.prev,n.curr+1)));n.curr++,push_token$3(i,state_round,e.slice(n.prev,n.curr),n,a);break;default:throw new Error("错误的fmt分词器状态")}return n.prev<n.curr&&push_token$3(i,a.state,e.slice(n.prev,n.curr),n,a),i.has_var=a.has_var,i}var symbol_set=new Set(["<",">","=",">=","<="]),rand_set=new Set(["~+","~-","~5","~6"]);function push_token$2(e,t,r){if(","===t)e.push({type:state_comma,value:","});else if(symbol_set.has(t))e.push({type:state_symbol,value:t});else if(Number.isNaN(Number(t)))if(var_first_char.includes(t[0]))r.has_var=!0,e.push({type:state_var,value:t,real_value:get_real_value(r.fill_data,t)});else if("%"===t)e.push({type:state_percent,value:t});else if("/"===t)e.push({type:state_fraction,value:t});else if("+"===t)e.push({type:state_plus,value:t});else if(rand_set.has(t))e.push({type:state_round,value:t});else if("!n"===t)e.push({type:state_to_number,value:t});else if("!u"===t)e.push({type:state_to_number_string,value:t});else{if("!e"!==t)throw new Error("无法识别的格式化字符: ".concat(t));e.push({type:state_scientific,value:t})}else e.push({type:state_number,value:t})}function fmt_tokenizer_space(e,t,r){if(r){var n="space-mode:"+e;if(cache_map.has(n)){var o=cache_map.get(n);return o.count++,o.value.has_var&&fill_fmt_fokens(o.value,t),o.value}var a={count:0,value:fmt_tokenizer_space_core(e,t)};return cache_map.set(n,a),a.value}return fmt_tokenizer_space_core(e,t)}function fmt_tokenizer_space_core(e,t){for(var r,n=0,o=e.length,a={fill_data:t,has_var:!1},i=0,u=[];n<o;)" "===(r=e[n])?(n>i&&push_token$2(u,e.slice(i,n),a),i=n+1):"<>=".includes(r)&&("="===e[n+1]?(u.push({type:state_symbol,value:r+"="}),i=1+ ++n):(u.push({type:state_symbol,value:r}),i=n+1)),n++;return i<n&&push_token$2(u,e.slice(i,n),a),u.has_var=a.has_var,u}function parse_args(e,t){var r="",n={origin_expr:e,origin_fill_data:t,expr:"",fmt_tokens:void 0,options:void 0,fmt_err:!1,expr_err:!1,fill_data:void 0,_unit:void 0,_mode:void 0,_error:void 0,_memo:void 0,_fmt:void 0};null!=t&&(Array.isArray(t)?(n.fill_data=t,n.options=t):(n.options=t,Array.isArray(t._fill_data)?n.fill_data=[t].concat(_toConsumableArray(t._fill_data)):void 0===t._fill_data?n.fill_data=[t]:n.fill_data=[t,t._fill_data]));var o=n._error=find_value(t,"_error"),a=n._mode=find_value(t,"_mode");n._unit=find_value(t,"_unit",!1);var i=n._memo=find_value(t,"_memo",!1),u=n._fmt=find_value(t,"_fmt");if("string"==typeof e){if(r=e,""===e.trim()||e.includes("NaN"))return n.expr_err=!0,n}else{if("number"!=typeof e){if(void 0!==o)return n.expr_err=!0,n;throw new Error("错误的第一个参数类型: ".concat(e," 类型为:").concat(_typeof(e)))}r=e.toString()}var s=r.split("|");if(n.expr=s[0],s.length>1){var c=s[1];if(""!==c.trim())try{n.fmt_tokens="space-all"===a?fmt_tokenizer_space(c,n.fill_data,i):fmt_tokenizer(c,n.fill_data,i)}catch(e){return n.fmt_err=!0,n}}if(void 0!==t&&void 0!==u){var l=[];try{l="space-all"===a?fmt_tokenizer_space(u,n.fill_data,i):fmt_tokenizer(u,n.fill_data,i)}catch(e){return n.fmt_err=!0,n}if(void 0===n.fmt_tokens)n.fmt_tokens=l;else{var f=n.fmt_tokens.map((function(e){return e.type}));l.forEach((function(e){f.includes(e.type)||n.fmt_tokens.push(e)}))}}return n}function push_token$1(e,t){if(t.curr_state===state_number||t.curr_state===state_scientific){var r=t.expr.slice(t.prev_index,t.cur_index);if(t._unit){var n,o=split_unit_num(r),a=o.num,i=o.unit;if(void 0===i)e.push({type:state_number,value:a,real_value:a,has_unit:!1});else t.has_unit=!0,null!==(n=t.unit_str)&&void 0!==n||(t.unit_str=i),e.push({type:state_number,value:a,real_value:a,has_unit:!0,unit:i})}else e.push({type:state_number,value:r,real_value:r,has_unit:!1})}else if(t.curr_state===state_var){t.has_var=!0;var u=t.expr.slice(t.prev_index,t.cur_index),s=get_real_value(t.fill_data,u);if(t._unit){var c,l=split_unit_num(s),f=l.num,p=l.unit;if(void 0===p)e.push({type:"var",value:u,real_value:f,has_unit:!1});else t.has_unit=!0,null!==(c=t.unit_str)&&void 0!==c||(t.unit_str=p),e.push({type:"var",value:u,real_value:f,has_unit:!0,unit:p})}else e.push({type:"var",value:u,real_value:s,has_unit:!1})}else e.push({type:t.curr_state,value:t.expr.slice(t.prev_index,t.cur_index)});t.curr_state=state_initial,t.prev_index=t.cur_index}function tokenizer(e,t,r,n){if(n){var o="tokenizer:"+e;if(cache_map.has(o)){var a=cache_map.get(o);a.count++;var i=a.value;return i.has_var&&fill_tokens(i,t,r),i}var u={count:0,value:tokenizer_core(e,t,r)};return cache_map.set(o,u),u.value}return tokenizer_core(e,t,r)}function tokenizer_core(e,t,r){for(var n,o={has_var:!1,has_unit:!1,unit_str:void 0,fill_data:t,cur_index:0,prev_index:0,curr_state:state_initial,expr:e,_unit:r},a=e.length,i=[];o.cur_index<a;)switch(n=e[o.cur_index],o.curr_state){case state_initial:if(number_char.includes(n))o.curr_state=state_number,o.cur_index++;else if(" "===n)o.cur_index++,o.prev_index=o.cur_index;else if("+-".includes(n)){var u=i.at(-1);0===o.cur_index||"operator"===(null==u?void 0:u.type)||"("===(null==u?void 0:u.value)?(o.curr_state=state_number,o.cur_index++):(o.cur_index++,i.push({type:state_operator,value:e.slice(o.prev_index,o.cur_index)}),o.prev_index=o.cur_index)}else"*/%".includes(n)?(o.curr_state=state_operator,o.cur_index++):var_char.includes(n)?(o.curr_state=state_var,o.cur_index++):"()".includes(n)?(i.push({type:state_bracket,value:n}),o.curr_state=state_initial,o.cur_index++,o.prev_index=o.cur_index):(o.cur_index++,o.prev_index=o.cur_index);break;case state_number:if(number_char.includes(n))o.cur_index++;else if("."===n){if(o.cur_index===o.prev_index||e.slice(o.prev_index,o.cur_index).includes("."))throw new Error("非法的小数部分".concat(e.slice(o.prev_index,o.cur_index)));o.cur_index++}else"e"===n?(o.curr_state=state_scientific,o.cur_index++):r?"*/+-() ".indexOf(n)>-1||"%"===n&&number_char.includes(e[o.cur_index-1])&&pure_number_var_first_char.includes(get_next_nonempty_char(e,o.cur_index,a))?push_token$1(i,o):o.cur_index++:push_token$1(i,o);break;case state_operator:var s=e[o.cur_index-1];"*"===n&&"*"===s?(o.cur_index++,i.push({type:state_operator,value:"**"}),o.prev_index=o.cur_index):"/"===n&&"/"===s?(o.cur_index++,i.push({type:state_operator,value:"//"}),o.prev_index=o.cur_index):(i.push({type:state_operator,value:s}),o.prev_index=o.cur_index),o.curr_state=state_initial;break;case state_var:var_members_char.includes(n)?o.cur_index++:push_token$1(i,o);break;case state_scientific:if(number_char.includes(n))o.cur_index++;else if("+-".includes(n)){var c=e.slice(o.prev_index,o.cur_index),l=c.at(-1);c.includes(n)||"e"!==l?push_token$1(i,o):o.cur_index++}else r&&-1==="*/+-() ".indexOf(n)?o.cur_index++:push_token$1(i,o);break;default:throw new Error("字符扫描状态错误")}return o.prev_index<o.cur_index&&push_token$1(i,o),i.has_var=o.has_var,i.has_unit=o.has_unit,i.unit=o.unit_str,i}var isNumeric=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,bignumberError="[BigNumber Error] ",tooManyDigits=bignumberError+"Number primitive has more than 15 significant digits: ",BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX=1e9;function clone(e){var t,r,n,o,a,i,u,s,c,l,f=O.prototype={constructor:O,toString:null,valueOf:null},p=new O(1),_=20,h=4,v=-7,m=21,d=-1e7,g=1e7,b=!1,y=1,w=0,x={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},S="0123456789abcdefghijklmnopqrstuvwxyz",E=!0;function O(e,t){var o,a,i,u,s,c,l,f,p=this;if(!(p instanceof O))return new O(e,t);if(null==t){if(e&&!0===e._isBigNumber)return p.s=e.s,void(!e.c||e.e>g?p.c=p.e=null:e.e<d?p.c=[p.e=0]:(p.e=e.e,p.c=e.c.slice()));if((c="number"==typeof e)&&0*e==0){if(p.s=1/e<0?(e=-e,-1):1,e===~~e){for(u=0,s=e;s>=10;s/=10,u++);return void(u>g?p.c=p.e=null:(p.e=u,p.c=[e]))}f=String(e)}else{if(!isNumeric.test(f=String(e)))return n(p,f,c);p.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(u=f.indexOf("."))>-1&&(f=f.replace(".","")),(s=f.search(/e/i))>0?(u<0&&(u=s),u+=+f.slice(s+1),f=f.substring(0,s)):u<0&&(u=f.length)}else{if(intCheck(t,2,S.length,"Base"),10==t&&E)return T(p=new O(e),_+p.e+1,h);if(f=String(e),c="number"==typeof e){if(0*e!=0)return n(p,f,c,t);if(p.s=1/e<0?(f=f.slice(1),-1):1,O.DEBUG&&f.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+e)}else p.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(o=S.slice(0,t),u=s=0,l=f.length;s<l;s++)if(o.indexOf(a=f.charAt(s))<0){if("."==a){if(s>u){u=l;continue}}else if(!i&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){i=!0,s=-1,u=0;continue}return n(p,String(e),c,t)}c=!1,(u=(f=r(f,t,10,p.s)).indexOf("."))>-1?f=f.replace(".",""):u=f.length}for(s=0;48===f.charCodeAt(s);s++);for(l=f.length;48===f.charCodeAt(--l););if(f=f.slice(s,++l)){if(l-=s,c&&O.DEBUG&&l>15&&(e>MAX_SAFE_INTEGER||e!==mathfloor(e)))throw Error(tooManyDigits+p.s*e);if((u=u-s-1)>g)p.c=p.e=null;else if(u<d)p.c=[p.e=0];else{if(p.e=u,p.c=[],s=(u+1)%LOG_BASE,u<0&&(s+=LOG_BASE),s<l){for(s&&p.c.push(+f.slice(0,s)),l-=LOG_BASE;s<l;)p.c.push(+f.slice(s,s+=LOG_BASE));s=LOG_BASE-(f=f.slice(s)).length}else s-=l;for(;s--;f+="0");p.c.push(+f)}}else p.c=[p.e=0]}function A(e,t,r,n){var o,a,i,u,s;if(null==r?r=h:intCheck(r,0,8),!e.c)return e.toString();if(o=e.c[0],i=e.e,null==t)s=coeffToString(e.c),s=1==n||2==n&&(i<=v||i>=m)?toExponential(s,i):toFixedPoint(s,i,"0");else if(a=(e=T(new O(e),t,r)).e,u=(s=coeffToString(e.c)).length,1==n||2==n&&(t<=a||a<=v)){for(;u<t;s+="0",u++);s=toExponential(s,a)}else if(t-=i,s=toFixedPoint(s,a,"0"),a+1>u){if(--t>0)for(s+=".";t--;s+="0");}else if((t+=a-u)>0)for(a+1==u&&(s+=".");t--;s+="0");return e.s<0&&o?"-"+s:s}function k(e,t){for(var r,n=1,o=new O(e[0]);n<e.length;n++){if(!(r=new O(e[n])).s){o=r;break}t.call(o,r)&&(o=r)}return o}function N(e,t,r){for(var n=1,o=t.length;!t[--o];t.pop());for(o=t[0];o>=10;o/=10,n++);return(r=n+r*LOG_BASE-1)>g?e.c=e.e=null:r<d?e.c=[e.e=0]:(e.e=r,e.c=t),e}function T(e,t,r,n){var o,a,i,u,s,c,l,f=e.c,p=POWS_TEN;if(f){e:{for(o=1,u=f[0];u>=10;u/=10,o++);if((a=t-o)<0)a+=LOG_BASE,i=t,l=(s=f[c=0])/p[o-i-1]%10|0;else if((c=mathceil((a+1)/LOG_BASE))>=f.length){if(!n)break e;for(;f.length<=c;f.push(0));s=l=0,o=1,i=(a%=LOG_BASE)-LOG_BASE+1}else{for(s=u=f[c],o=1;u>=10;u/=10,o++);l=(i=(a%=LOG_BASE)-LOG_BASE+o)<0?0:s/p[o-i-1]%10|0}if(n=n||t<0||null!=f[c+1]||(i<0?s:s%p[o-i-1]),n=r<4?(l||n)&&(0==r||r==(e.s<0?3:2)):l>5||5==l&&(4==r||n||6==r&&(a>0?i>0?s/p[o-i]:0:f[c-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,n?(t-=e.e+1,f[0]=p[(LOG_BASE-t%LOG_BASE)%LOG_BASE],e.e=-t||0):f[0]=e.e=0,e;if(0==a?(f.length=c,u=1,c--):(f.length=c+1,u=p[LOG_BASE-a],f[c]=i>0?mathfloor(s/p[o-i]%p[i])*u:0),n)for(;;){if(0==c){for(a=1,i=f[0];i>=10;i/=10,a++);for(i=f[0]+=u,u=1;i>=10;i/=10,u++);a!=u&&(e.e++,f[0]==BASE&&(f[0]=1));break}if(f[c]+=u,f[c]!=BASE)break;f[c--]=0,u=1}for(a=f.length;0===f[--a];f.pop());}e.e>g?e.c=e.e=null:e.e<d&&(e.c=[e.e=0])}return e}function C(e){var t,r=e.e;return null===r?e.toString():(t=coeffToString(e.c),t=r<=v||r>=m?toExponential(t,r):toFixedPoint(t,r,"0"),e.s<0?"-"+t:t)}return O.clone=clone,O.ROUND_UP=0,O.ROUND_DOWN=1,O.ROUND_CEIL=2,O.ROUND_FLOOR=3,O.ROUND_HALF_UP=4,O.ROUND_HALF_DOWN=5,O.ROUND_HALF_EVEN=6,O.ROUND_HALF_CEIL=7,O.ROUND_HALF_FLOOR=8,O.EUCLID=9,O.config=O.set=function(e){var t,r;if(null!=e){if("object"!=_typeof(e))throw Error(bignumberError+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(intCheck(r=e[t],0,MAX,t),_=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(intCheck(r=e[t],0,8,t),h=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(intCheck(r[0],-MAX,0,t),intCheck(r[1],0,MAX,t),v=r[0],m=r[1]):(intCheck(r,-MAX,MAX,t),v=-(m=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)intCheck(r[0],-MAX,-1,t),intCheck(r[1],1,MAX,t),d=r[0],g=r[1];else{if(intCheck(r,-MAX,MAX,t),!r)throw Error(bignumberError+t+" cannot be zero: "+r);d=-(g=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(bignumberError+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw b=!r,Error(bignumberError+"crypto unavailable");b=r}else b=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(intCheck(r=e[t],0,9,t),y=r),e.hasOwnProperty(t="POW_PRECISION")&&(intCheck(r=e[t],0,MAX,t),w=r),e.hasOwnProperty(t="FORMAT")){if("object"!=_typeof(r=e[t]))throw Error(bignumberError+t+" not an object: "+r);x=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(bignumberError+t+" invalid: "+r);E="0123456789"==r.slice(0,10),S=r}}return{DECIMAL_PLACES:_,ROUNDING_MODE:h,EXPONENTIAL_AT:[v,m],RANGE:[d,g],CRYPTO:b,MODULO_MODE:y,POW_PRECISION:w,FORMAT:x,ALPHABET:S}},O.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!O.DEBUG)return!0;var t,r,n=e.c,o=e.e,a=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===a||-1===a)&&o>=-MAX&&o<=MAX&&o===mathfloor(o)){if(0===n[0]){if(0===o&&1===n.length)return!0;break e}if((t=(o+1)%LOG_BASE)<1&&(t+=LOG_BASE),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=BASE||r!==mathfloor(r))break e;if(0!==r)return!0}}}else if(null===n&&null===o&&(null===a||1===a||-1===a))return!0;throw Error(bignumberError+"Invalid BigNumber: "+e)},O.maximum=O.max=function(){return k(arguments,f.lt)},O.minimum=O.min=function(){return k(arguments,f.gt)},O.random=(o=9007199254740992,a=Math.random()*o&2097151?function(){return mathfloor(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,o,i,u=0,s=[],c=new O(p);if(null==e?e=_:intCheck(e,0,MAX),o=mathceil(e/LOG_BASE),b)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(o*=2));u<o;)(i=131072*t[u]+(t[u+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[u]=r[0],t[u+1]=r[1]):(s.push(i%1e14),u+=2);u=o/2}else{if(!crypto.randomBytes)throw b=!1,Error(bignumberError+"crypto unavailable");for(t=crypto.randomBytes(o*=7);u<o;)(i=281474976710656*(31&t[u])+1099511627776*t[u+1]+4294967296*t[u+2]+16777216*t[u+3]+(t[u+4]<<16)+(t[u+5]<<8)+t[u+6])>=9e15?crypto.randomBytes(7).copy(t,u):(s.push(i%1e14),u+=7);u=o/7}if(!b)for(;u<o;)(i=a())<9e15&&(s[u++]=i%1e14);for(o=s[--u],e%=LOG_BASE,o&&e&&(i=POWS_TEN[LOG_BASE-e],s[u]=mathfloor(o/i)*i);0===s[u];s.pop(),u--);if(u<0)s=[n=0];else{for(n=-1;0===s[0];s.splice(0,1),n-=LOG_BASE);for(u=1,i=s[0];i>=10;i/=10,u++);u<LOG_BASE&&(n-=LOG_BASE-u)}return c.e=n,c.c=s,c}),O.sum=function(){for(var e=1,t=arguments,r=new O(t[0]);e<t.length;)r=r.plus(t[e++]);return r},r=function(){var e="0123456789";function r(e,t,r,n){for(var o,a,i=[0],u=0,s=e.length;u<s;){for(a=i.length;a--;i[a]*=t);for(i[0]+=n.indexOf(e.charAt(u++)),o=0;o<i.length;o++)i[o]>r-1&&(null==i[o+1]&&(i[o+1]=0),i[o+1]+=i[o]/r|0,i[o]%=r)}return i.reverse()}return function(n,o,a,i,u){var s,c,l,f,p,v,m,d,g=n.indexOf("."),b=_,y=h;for(g>=0&&(f=w,w=0,n=n.replace(".",""),v=(d=new O(o)).pow(n.length-g),w=f,d.c=r(toFixedPoint(coeffToString(v.c),v.e,"0"),10,a,e),d.e=d.c.length),l=f=(m=r(n,o,a,u?(s=S,e):(s=e,S))).length;0==m[--f];m.pop());if(!m[0])return s.charAt(0);if(g<0?--l:(v.c=m,v.e=l,v.s=i,m=(v=t(v,d,b,y,a)).c,p=v.r,l=v.e),g=m[c=l+b+1],f=a/2,p=p||c<0||null!=m[c+1],p=y<4?(null!=g||p)&&(0==y||y==(v.s<0?3:2)):g>f||g==f&&(4==y||p||6==y&&1&m[c-1]||y==(v.s<0?8:7)),c<1||!m[0])n=p?toFixedPoint(s.charAt(1),-b,s.charAt(0)):s.charAt(0);else{if(m.length=c,p)for(--a;++m[--c]>a;)m[c]=0,c||(++l,m=[1].concat(m));for(f=m.length;!m[--f];);for(g=0,n="";g<=f;n+=s.charAt(m[g++]));n=toFixedPoint(n,l,s.charAt(0))}return n}}(),t=function(){function e(e,t,r){var n,o,a,i,u=0,s=e.length,c=t%SQRT_BASE,l=t/SQRT_BASE|0;for(e=e.slice();s--;)u=((o=c*(a=e[s]%SQRT_BASE)+(n=l*a+(i=e[s]/SQRT_BASE|0)*c)%SQRT_BASE*SQRT_BASE+u)/r|0)+(n/SQRT_BASE|0)+l*i,e[s]=o%r;return u&&(e=[u].concat(e)),e}function t(e,t,r,n){var o,a;if(r!=n)a=r>n?1:-1;else for(o=a=0;o<r;o++)if(e[o]!=t[o]){a=e[o]>t[o]?1:-1;break}return a}function r(e,t,r,n){for(var o=0;r--;)e[r]-=o,o=e[r]<t[r]?1:0,e[r]=o*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,o,a,i,u){var s,c,l,f,p,_,h,v,m,d,g,b,y,w,x,S,E,A=n.s==o.s?1:-1,k=n.c,N=o.c;if(!(k&&k[0]&&N&&N[0]))return new O(n.s&&o.s&&(k?!N||k[0]!=N[0]:N)?k&&0==k[0]||!N?0*A:A/0:NaN);for(m=(v=new O(A)).c=[],A=a+(c=n.e-o.e)+1,u||(u=BASE,c=bitFloor(n.e/LOG_BASE)-bitFloor(o.e/LOG_BASE),A=A/LOG_BASE|0),l=0;N[l]==(k[l]||0);l++);if(N[l]>(k[l]||0)&&c--,A<0)m.push(1),f=!0;else{for(w=k.length,S=N.length,l=0,A+=2,(p=mathfloor(u/(N[0]+1)))>1&&(N=e(N,p,u),k=e(k,p,u),S=N.length,w=k.length),y=S,g=(d=k.slice(0,S)).length;g<S;d[g++]=0);E=N.slice(),E=[0].concat(E),x=N[0],N[1]>=u/2&&x++;do{if(p=0,(s=t(N,d,S,g))<0){if(b=d[0],S!=g&&(b=b*u+(d[1]||0)),(p=mathfloor(b/x))>1)for(p>=u&&(p=u-1),h=(_=e(N,p,u)).length,g=d.length;1==t(_,d,h,g);)p--,r(_,S<h?E:N,h,u),h=_.length,s=1;else 0==p&&(s=p=1),h=(_=N.slice()).length;if(h<g&&(_=[0].concat(_)),r(d,_,g,u),g=d.length,-1==s)for(;t(N,d,S,g)<1;)p++,r(d,S<g?E:N,g,u),g=d.length}else 0===s&&(p++,d=[0]);m[l++]=p,d[0]?d[g++]=k[y]||0:(d=[k[y]],g=1)}while((y++<w||null!=d[0])&&A--);f=null!=d[0],m[0]||m.splice(0,1)}if(u==BASE){for(l=1,A=m[0];A>=10;A/=10,l++);T(v,a+(v.e=l+c*LOG_BASE-1)+1,i,f)}else v.e=c,v.r=+f;return v}}(),i=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,s=/^\.([^.]+)$/,c=/^-?(Infinity|NaN)$/,l=/^\s*\+(?=[\w.])|^\s+|\s+$/g,n=function(e,t,r,n){var o,a=r?t:t.replace(l,"");if(c.test(a))e.s=isNaN(a)?null:a<0?-1:1;else{if(!r&&(a=a.replace(i,(function(e,t,r){return o="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=o?e:t})),n&&(o=n,a=a.replace(u,"$1").replace(s,"0.$1")),t!=a))return new O(a,o);if(O.DEBUG)throw Error(bignumberError+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},f.absoluteValue=f.abs=function(){var e=new O(this);return e.s<0&&(e.s=1),e},f.comparedTo=function(e,t){return compare(this,new O(e,t))},f.decimalPlaces=f.dp=function(e,t){var r,n,o,a=this;if(null!=e)return intCheck(e,0,MAX),null==t?t=h:intCheck(t,0,8),T(new O(a),e+a.e+1,t);if(!(r=a.c))return null;if(n=((o=r.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,o=r[o])for(;o%10==0;o/=10,n--);return n<0&&(n=0),n},f.dividedBy=f.div=function(e,r){return t(this,new O(e,r),_,h)},f.dividedToIntegerBy=f.idiv=function(e,r){return t(this,new O(e,r),0,1)},f.exponentiatedBy=f.pow=function(e,t){var r,n,o,a,i,u,s,c,l=this;if((e=new O(e)).c&&!e.isInteger())throw Error(bignumberError+"Exponent not an integer: "+C(e));if(null!=t&&(t=new O(t)),i=e.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!e.c||!e.c[0])return c=new O(Math.pow(+C(l),i?e.s*(2-isOdd(e)):+C(e))),t?c.mod(t):c;if(u=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new O(NaN);(n=!u&&l.isInteger()&&t.isInteger())&&(l=l.mod(t))}else{if(e.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||i&&l.c[1]>=24e7:l.c[0]<8e13||i&&l.c[0]<=9999975e7)))return a=l.s<0&&isOdd(e)?-0:0,l.e>-1&&(a=1/a),new O(u?1/a:a);w&&(a=mathceil(w/LOG_BASE+2))}for(i?(r=new O(.5),u&&(e.s=1),s=isOdd(e)):s=(o=Math.abs(+C(e)))%2,c=new O(p);;){if(s){if(!(c=c.times(l)).c)break;a?c.c.length>a&&(c.c.length=a):n&&(c=c.mod(t))}if(o){if(0===(o=mathfloor(o/2)))break;s=o%2}else if(T(e=e.times(r),e.e+1,1),e.e>14)s=isOdd(e);else{if(0===(o=+C(e)))break;s=o%2}l=l.times(l),a?l.c&&l.c.length>a&&(l.c.length=a):n&&(l=l.mod(t))}return n?c:(u&&(c=p.div(c)),t?c.mod(t):a?T(c,w,h,undefined):c)},f.integerValue=function(e){var t=new O(this);return null==e?e=h:intCheck(e,0,8),T(t,t.e+1,e)},f.isEqualTo=f.eq=function(e,t){return 0===compare(this,new O(e,t))},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(e,t){return compare(this,new O(e,t))>0},f.isGreaterThanOrEqualTo=f.gte=function(e,t){return 1===(t=compare(this,new O(e,t)))||0===t},f.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},f.isLessThan=f.lt=function(e,t){return compare(this,new O(e,t))<0},f.isLessThanOrEqualTo=f.lte=function(e,t){return-1===(t=compare(this,new O(e,t)))||0===t},f.isNaN=function(){return!this.s},f.isNegative=function(){return this.s<0},f.isPositive=function(){return this.s>0},f.isZero=function(){return!!this.c&&0==this.c[0]},f.minus=function(e,t){var r,n,o,a,i=this,u=i.s;if(t=(e=new O(e,t)).s,!u||!t)return new O(NaN);if(u!=t)return e.s=-t,i.plus(e);var s=i.e/LOG_BASE,c=e.e/LOG_BASE,l=i.c,f=e.c;if(!s||!c){if(!l||!f)return l?(e.s=-t,e):new O(f?i:NaN);if(!l[0]||!f[0])return f[0]?(e.s=-t,e):new O(l[0]?i:3==h?-0:0)}if(s=bitFloor(s),c=bitFloor(c),l=l.slice(),u=s-c){for((a=u<0)?(u=-u,o=l):(c=s,o=f),o.reverse(),t=u;t--;o.push(0));o.reverse()}else for(n=(a=(u=l.length)<(t=f.length))?u:t,u=t=0;t<n;t++)if(l[t]!=f[t]){a=l[t]<f[t];break}if(a&&(o=l,l=f,f=o,e.s=-e.s),(t=(n=f.length)-(r=l.length))>0)for(;t--;l[r++]=0);for(t=BASE-1;n>u;){if(l[--n]<f[n]){for(r=n;r&&!l[--r];l[r]=t);--l[r],l[n]+=BASE}l[n]-=f[n]}for(;0==l[0];l.splice(0,1),--c);return l[0]?N(e,l,c):(e.s=3==h?-1:1,e.c=[e.e=0],e)},f.modulo=f.mod=function(e,r){var n,o,a=this;return e=new O(e,r),!a.c||!e.s||e.c&&!e.c[0]?new O(NaN):!e.c||a.c&&!a.c[0]?new O(a):(9==y?(o=e.s,e.s=1,n=t(a,e,0,3),e.s=o,n.s*=o):n=t(a,e,0,y),(e=a.minus(n.times(e))).c[0]||1!=y||(e.s=a.s),e)},f.multipliedBy=f.times=function(e,t){var r,n,o,a,i,u,s,c,l,f,p,_,h,v,m,d=this,g=d.c,b=(e=new O(e,t)).c;if(!(g&&b&&g[0]&&b[0]))return!d.s||!e.s||g&&!g[0]&&!b||b&&!b[0]&&!g?e.c=e.e=e.s=null:(e.s*=d.s,g&&b?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=bitFloor(d.e/LOG_BASE)+bitFloor(e.e/LOG_BASE),e.s*=d.s,(s=g.length)<(f=b.length)&&(h=g,g=b,b=h,o=s,s=f,f=o),o=s+f,h=[];o--;h.push(0));for(v=BASE,m=SQRT_BASE,o=f;--o>=0;){for(r=0,p=b[o]%m,_=b[o]/m|0,a=o+(i=s);a>o;)r=((c=p*(c=g[--i]%m)+(u=_*c+(l=g[i]/m|0)*p)%m*m+h[a]+r)/v|0)+(u/m|0)+_*l,h[a--]=c%v;h[a]=r}return r?++n:h.splice(0,1),N(e,h,n)},f.negated=function(){var e=new O(this);return e.s=-e.s||null,e},f.plus=function(e,t){var r,n=this,o=n.s;if(t=(e=new O(e,t)).s,!o||!t)return new O(NaN);if(o!=t)return e.s=-t,n.minus(e);var a=n.e/LOG_BASE,i=e.e/LOG_BASE,u=n.c,s=e.c;if(!a||!i){if(!u||!s)return new O(o/0);if(!u[0]||!s[0])return s[0]?e:new O(u[0]?n:0*o)}if(a=bitFloor(a),i=bitFloor(i),u=u.slice(),o=a-i){for(o>0?(i=a,r=s):(o=-o,r=u),r.reverse();o--;r.push(0));r.reverse()}for((o=u.length)-(t=s.length)<0&&(r=s,s=u,u=r,t=o),o=0;t;)o=(u[--t]=u[t]+s[t]+o)/BASE|0,u[t]=BASE===u[t]?0:u[t]%BASE;return o&&(u=[o].concat(u),++i),N(e,u,i)},f.precision=f.sd=function(e,t){var r,n,o,a=this;if(null!=e&&e!==!!e)return intCheck(e,1,MAX),null==t?t=h:intCheck(t,0,8),T(new O(a),e,t);if(!(r=a.c))return null;if(n=(o=r.length-1)*LOG_BASE+1,o=r[o]){for(;o%10==0;o/=10,n--);for(o=r[0];o>=10;o/=10,n++);}return e&&a.e+1>n&&(n=a.e+1),n},f.shiftedBy=function(e){return intCheck(e,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER),this.times("1e"+e)},f.squareRoot=f.sqrt=function(){var e,r,n,o,a,i=this,u=i.c,s=i.s,c=i.e,l=_+4,f=new O("0.5");if(1!==s||!u||!u[0])return new O(!s||s<0&&(!u||u[0])?NaN:u?i:1/0);if(0==(s=Math.sqrt(+C(i)))||s==1/0?(((r=coeffToString(u)).length+c)%2==0&&(r+="0"),s=Math.sqrt(+r),c=bitFloor((c+1)/2)-(c<0||c%2),n=new O(r=s==1/0?"5e"+c:(r=s.toExponential()).slice(0,r.indexOf("e")+1)+c)):n=new O(s+""),n.c[0])for((s=(c=n.e)+l)<3&&(s=0);;)if(a=n,n=f.times(a.plus(t(i,a,l,1))),coeffToString(a.c).slice(0,s)===(r=coeffToString(n.c)).slice(0,s)){if(n.e<c&&--s,"9999"!=(r=r.slice(s-3,s+1))&&(o||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(T(n,n.e+_+2,1),e=!n.times(n).eq(i));break}if(!o&&(T(a,a.e+_+2,0),a.times(a).eq(i))){n=a;break}l+=4,s+=4,o=1}return T(n,n.e+_+1,h,e)},f.toExponential=function(e,t){return null!=e&&(intCheck(e,0,MAX),e++),A(this,e,t,1)},f.toFixed=function(e,t){return null!=e&&(intCheck(e,0,MAX),e=e+this.e+1),A(this,e,t)},f.toFormat=function(e,t,r){var n,o=this;if(null==r)null!=e&&t&&"object"==_typeof(t)?(r=t,t=null):e&&"object"==_typeof(e)?(r=e,e=t=null):r=x;else if("object"!=_typeof(r))throw Error(bignumberError+"Argument not an object: "+r);if(n=o.toFixed(e,t),o.c){var a,i=n.split("."),u=+r.groupSize,s=+r.secondaryGroupSize,c=r.groupSeparator||"",l=i[0],f=i[1],p=o.s<0,_=p?l.slice(1):l,h=_.length;if(s&&(a=u,u=s,s=a,h-=a),u>0&&h>0){for(a=h%u||u,l=_.substr(0,a);a<h;a+=u)l+=c+_.substr(a,u);s>0&&(l+=c+_.slice(a)),p&&(l="-"+l)}n=f?l+(r.decimalSeparator||"")+((s=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+s+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):l}return(r.prefix||"")+n+(r.suffix||"")},f.toFraction=function(e){var r,n,o,a,i,u,s,c,l,f,_,v,m=this,d=m.c;if(null!=e&&(!(s=new O(e)).isInteger()&&(s.c||1!==s.s)||s.lt(p)))throw Error(bignumberError+"Argument "+(s.isInteger()?"out of range: ":"not an integer: ")+C(s));if(!d)return new O(m);for(r=new O(p),l=n=new O(p),o=c=new O(p),v=coeffToString(d),i=r.e=v.length-m.e-1,r.c[0]=POWS_TEN[(u=i%LOG_BASE)<0?LOG_BASE+u:u],e=!e||s.comparedTo(r)>0?i>0?r:l:s,u=g,g=1/0,s=new O(v),c.c[0]=0;f=t(s,r,0,1),1!=(a=n.plus(f.times(o))).comparedTo(e);)n=o,o=a,l=c.plus(f.times(a=l)),c=a,r=s.minus(f.times(a=r)),s=a;return a=t(e.minus(n),o,0,1),c=c.plus(a.times(l)),n=n.plus(a.times(o)),c.s=l.s=m.s,_=t(l,o,i*=2,h).minus(m).abs().comparedTo(t(c,n,i,h).minus(m).abs())<1?[l,o]:[c,n],g=u,_},f.toNumber=function(){return+C(this)},f.toPrecision=function(e,t){return null!=e&&intCheck(e,1,MAX),A(this,e,t,2)},f.toString=function(e){var t,n=this,o=n.s,a=n.e;return null===a?o?(t="Infinity",o<0&&(t="-"+t)):t="NaN":(null==e?t=a<=v||a>=m?toExponential(coeffToString(n.c),a):toFixedPoint(coeffToString(n.c),a,"0"):10===e&&E?t=toFixedPoint(coeffToString((n=T(new O(n),_+a+1,h)).c),n.e,"0"):(intCheck(e,2,S.length,"Base"),t=r(toFixedPoint(coeffToString(n.c),a,"0"),10,e,o,!0)),o<0&&n.c[0]&&(t="-"+t)),t},f.valueOf=f.toJSON=function(){return C(this)},f._isBigNumber=!0,f[Symbol.toStringTag]="BigNumber",f[Symbol.for("nodejs.util.inspect.custom")]=f.valueOf,null!=e&&O.set(e),O}function bitFloor(e){var t=0|e;return e>0||e===t?t:t-1}function coeffToString(e){for(var t,r,n=1,o=e.length,a=e[0]+"";n<o;){for(t=e[n++]+"",r=LOG_BASE-t.length;r--;t="0"+t);a+=t}for(o=a.length;48===a.charCodeAt(--o););return a.slice(0,o+1||1)}function compare(e,t){var r,n,o=e.c,a=t.c,i=e.s,u=t.s,s=e.e,c=t.e;if(!i||!u)return null;if(r=o&&!o[0],n=a&&!a[0],r||n)return r?n?0:-u:i;if(i!=u)return i;if(r=i<0,n=s==c,!o||!a)return n?0:!o^r?1:-1;if(!n)return s>c^r?1:-1;for(u=(s=o.length)<(c=a.length)?s:c,i=0;i<u;i++)if(o[i]!=a[i])return o[i]>a[i]^r?1:-1;return s==c?0:s>c^r?1:-1}function intCheck(e,t,r,n){if(e<t||e>r||e!==mathfloor(e))throw Error(bignumberError+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function isOdd(e){var t=e.c.length-1;return bitFloor(e.e/LOG_BASE)==t&&e.c[t]%2!=0}function toExponential(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function toFixedPoint(e,t,r){var n,o;if(t<0){for(o=r+".";++t;o+=r);e=o+e}else if(++t>(n=e.length)){for(o=r,t-=n;--t;o+=r);e+=o}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var BigNumber=clone();function format(e,t){var r="";if("undefined"===(r=BigNumber.isBigNumber(e)?e.toFixed():"string"==typeof e?e:e.toString())||"NaN"===r)return[null,{}];var n={mantissa:null,mantissa_type:null,thousands:!1,sign:!1,round:"~-",scientific:!1,fraction:!1,percent:!1,to_number:!1,to_number_string:!1};if(t.forEach((function(e){var t=e.type;if("symbol"===t){if(![">=","<=","=","<",">"].includes(e.value))throw new Error("错误的格式化参数:",e.value);n.mantissa_type=e.value}else if("to-number"===t)n.to_number=!0;else if("to-number-string"===t)n.to_number_string=!0;else if("comma"===t)n.thousands=!0;else if("number"===t)n.mantissa=e.value;else if("var"===t)n.mantissa=e.real_value;else if("plus"===t)n.sign=!0;else if("round"===t)n.round=e.value;else if("fraction"===t)n.fraction=!0;else if("scientific"===t)n.scientific=!0;else{if("percent"!==t)throw new Error("错误的fmt Token");n.percent=!0}})),n.to_number)return[+parse_mantissa(r,n.mantissa_type,n.mantissa,n.round),n];if(n.scientific){var o=BigNumber(r).toExponential();return[n.sign&&!o.startsWith("-")?"+"+o:o,n]}if(n.fraction){var a=BigNumber(r).toFraction().map((function(e){return e.toFixed()})).join("/");return[n.sign&&!a.startsWith("-")?"+"+a:a,n]}return n.percent&&(r=BigNumber(r).times(100).toFixed()),null===n.mantissa?r.includes(".")&&(r=r.replace(/0*$/,"")):r=parse_mantissa(r,n.mantissa_type,n.mantissa,n.round),n.thousands&&(r=parse_thousands(r)),n.sign&&(n.to_number=!1,r.startsWith("-")||(r="+"+r)),n.percent&&(r+="%"),[r,n]}function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var stringify$1={exports:{}};!function(e,t){function r(e,t){var r=[],n=[];return null==t&&(t=function(e,t){return r[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(t)).join(".")+"]"}),function(o,a){if(r.length>0){var i=r.indexOf(this);~i?r.splice(i+1):r.push(this),~i?n.splice(i,1/0,o):n.push(o),~r.indexOf(a)&&(a=t.call(this,o,a))}else r.push(a);return null==e?a:e.call(this,o,a)}}(e.exports=function(e,t,n,o){return JSON.stringify(e,r(t,o),n)}).getSerialize=r}(stringify$1,stringify$1.exports);var stringifyExports=stringify$1.exports,stringify=getDefaultExportFromCjs(stringifyExports),_debug=!1;function close_important_push(){}function open_important_push(){}function open_debug(){_debug=!0}function close_debug(){_debug=!1}function get_debug_config(){return _debug}var debug_color={bg:"#ff8936",fg:"#fff",field:"#67C23A",field2:"#ee7959"},debug_style={expr:"background: ".concat(debug_color.bg,";color: ").concat(debug_color.fg,";font-weight: bold;border-radius: 4px; padding: 3px 8px;"),label1:"color: ".concat(debug_color.field,"; font-weight: bold; white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"),label2:"color: ".concat(debug_color.field2,"; font-weight: bold; white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"),nowrap:"white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"};function calc_wrap(e,t){var r={},n={_error:"-"};return["string","number"].includes(_typeof(e))?(Array.isArray(t)||void 0===t||Object.keys(t).forEach((function(e){return e.startsWith("_")&&(n[e]=t[e])})),r=null!=t?t:{},/[a-zA-Z_$]/.test(e.toString())?void 0!==t?(r=t,calc(e,_objectSpread2(_objectSpread2({},n),r))):function(t){return calc(e,_objectSpread2(_objectSpread2({},n),t))}:calc(e,_objectSpread2(_objectSpread2({},n),r))):(r=e,function(e){return calc(e,_objectSpread2(_objectSpread2({},n),r))})}function check_version(){return _check_version.apply(this,arguments)}function _check_version(){return _check_version=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(){var res,code,versions,last_version,larr,varr,script,url;return _regeneratorRuntime().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if("undefined"==typeof process||"node"!==process.release.name){_context.next=19;break}if(!(parseInt(process.versions.node)>=17)){_context.next=17;break}return _context.next=4,promise_queue([fetch("https://cdn.jsdelivr.net/npm/a-calc@latest/a-calc.versions.js"),fetch("https://unpkg.com/a-calc@latest/a-calc.versions.js")]);case 4:return res=_context.sent,_context.next=7,res.text();case 7:code=_context.sent,versions=eval(code),last_version=versions.at(-1),larr=last_version.match(/(\d+)\.(\d+)\.(\d+)/),larr.shift(),larr=larr.map((function(e){return parseInt(e)})),varr=version.match(/(\d+)\.(\d+)\.(\d+)/),varr.shift(),varr=varr.map((function(e){return parseInt(e)})),(larr[0]>varr[0]||larr[0]===varr[0]&&larr[1]>varr[1]||larr[0]===varr[0]&&larr[1]===varr[1]&&larr[2]>varr[2])&&console.warn("a-calc has a new version:",last_version);case 17:_context.next=25;break;case 19:return script=document.createElement("script"),script.onload=function(){var e=a_calc_versions;if(Array.isArray(e)){var t=e.at(-1),r=t.match(/(\d+)\.(\d+)\.(\d+)/);r.shift(),r=r.map((function(e){return parseInt(e)}));var n=version.match(/(\d+)\.(\d+)\.(\d+)/);n.shift(),n=n.map((function(e){return parseInt(e)})),(r[0]>n[0]||r[0]===n[0]&&r[1]>n[1]||r[0]===n[0]&&r[1]===n[1]&&r[2]>n[2])&&console.log("%c↑↑↑ a-calc has a new version: %s ↑↑↑","color: #67C23A;",t)}},_context.next=23,test_urls(["https://cdn.jsdelivr.net/npm/a-calc@latest/a-calc.versions.js","https://unpkg.com/a-calc@latest/a-calc.versions.js"]);case 23:url=_context.sent,url?(script.src=url,document.body.appendChild(script)):script=null;case 25:case"end":return _context.stop()}}),_callee)}))),_check_version.apply(this,arguments)}var operator=new Set(["+","-","*","/","%","**","//"]);function push_token(e,t,r){if(Number.isNaN(Number(t)))if(operator.has(t))e.push({type:"operator",value:t});else if(r._unit&&/^[+-]?\d/.test(t)){var n,o=split_unit_num(t),a=o.num,i=o.unit;if(void 0===i)e.push({type:"number",value:a,real_value:a,has_unit:!1});else r.has_unit=!0,null!==(n=r.unit_str)&&void 0!==n||(r.unit_str=i),e.push({type:"number",value:a,real_value:a,has_unit:!0,unit:i})}else if(var_first_char.includes(t[0])){r.has_var=!0;var u=get_real_value(r.fill_data,t);if(r._unit){var s,c=split_unit_num(u),l=c.num,f=c.unit;if(void 0===f)e.push({type:"var",value:t,real_value:l,has_unit:!1});else r.has_unit=!0,null!==(s=r.unit_str)&&void 0!==s||(r.unit_str=f),e.push({type:"var",value:t,real_value:l,has_unit:!0,unit:f})}else e.push({type:"var",value:t,real_value:u,has_unit:!1})}else{if(!/^[+-]?\d/.test(t))throw new Error("无法识别的标识符:".concat(t));var p=t.indexOf("e");-1!==p&&/^\d+$/.test(t.slice(p+1))&&e.push({type:"number",value:t,real_value:t,has_unit:!1})}else e.push({type:"number",value:t,real_value:t,has_unit:!1})}function tokenizer_space(e,t,r,n){if(n){var o="tokenizer-space:"+e;if(cache_map.has(o)){var a=cache_map.get(o);return a.count++,a.value.has_var&&fill_tokens(a.value,t,r),a.value}var i={count:0,value:tokenizer_space_core(e,t,r)};return cache_map.set(o,i),i.value}return tokenizer_space_core(e,t,r)}function tokenizer_space_core(e,t,r){for(var n,o=0,a=0,i=e.length,u=[],s={has_var:!1,has_unit:!1,unit_str:void 0,_unit:r,fill_data:t};a<i;)" "===(n=e[a])?(a>o&&push_token(u,e.slice(o,a),s),o=a+1):"("===n?(u.push({type:state_bracket,value:"("}),o=a+1):")"===n&&(a>o&&push_token(u,e.slice(o,a),s),u.push({type:state_bracket,value:")"}),o=a+1),a++;return a>o&&push_token(u,e.slice(o,a),s),u.has_var=s.has_var,u.has_unit=s.has_unit,u.unit=s.unit_str,u}function compute(e,t,r,n){if(n){var o="compute:"+e.real_value+r.value+t.real_value;if(cache_map.has(o)){var a=cache_map.get(o);return a.count++,a.value}var i={count:0,value:compute_core(e,t,r)};return cache_map.set(o,i),i.value}return compute_core(e,t,r)}function compute_core(e,t,r){var n;switch(r.value){case"+":n=new BigNumber(e.real_value).plus(t.real_value);break;case"-":n=new BigNumber(e.real_value).minus(t.real_value);break;case"*":n=new BigNumber(e.real_value).times(t.real_value);break;case"/":n=new BigNumber(e.real_value).div(t.real_value);break;case"%":n=new BigNumber(e.real_value).mod(t.real_value);break;case"**":n=new BigNumber(e.real_value).pow(t.real_value);break;case"//":n=new BigNumber(e.real_value).idiv(t.real_value)}return n}var operator_map={"+":0,"-":0,"*":1,"/":1,"%":1,"//":1,"**":2};function token_parser(e,t){for(var r,n,o=[],a=[],i=0,u=e.length;i<u;i++)if("("!==(r=e[i]).value)if(")"!==r.value)if("number"!==r.type&&"var"!==r.type){if("operator"===r.type){var s=o.at(-1);if("("===(null==s?void 0:s.value)){o.push(r);continue}var c=operator_map[r.value];if(!o.length){o.push(r);continue}if(c<operator_map[s.value])for(var l=void 0;(l=o.pop())&&"("!==l.value;){var f=a.pop(),p=a.pop();a.push({type:"expr",value1:p,value2:f,operator:l,real_value:compute(p,f,l,t)})}else if(c===operator_map[s.value]){if("**"===r.value){o.push(r);continue}for(var _=void 0;(_=o.pop())&&"("!==_.value;){if(operator_map[_.value]<c){o.push(_);break}var h=a.pop(),v=a.pop();a.push({type:"expr",value1:v,value2:h,operator:_,real_value:compute(v,h,_,t)})}}o.push(r)}}else a.push(r);else for(var m=void 0;(m=o.pop())&&"("!==m.value;){var d=a.pop(),g=a.pop();a.push({type:"expr",value1:g,value2:d,operator:m,real_value:compute(g,d,m,t)})}else o.push(r);for(;n=o.pop();){var b=a.pop(),y=a.pop();a.push({type:"expr",value1:y,value2:b,operator:n,real_value:compute(y,b,n,t)})}if(1!==a.length)throw new Error("可能出现了错误的计算式");return a[0]}function calc(e,t){var r,n,o,a,i,u,s,c=parse_args(e,t),l=c._error,f=null!==(r=null===(n=c.options)||void 0===n?void 0:n._debug)&&void 0!==r&&r,p=null!==(o=c._unit)&&void 0!==o&&o,_=null!==(a=c._mode)&&void 0!==a?a:"normal",h=null!==(i=c._memo)&&void 0!==i&&i,v=c.fmt_tokens;if(c.fmt_err||c.expr_err){if(void 0===l)throw new Error("表达式或格式化字符串错误,表达式为:".concat(c.expr));return l}if("space"===_||"space-all"===_)if(void 0===l)u=tokenizer_space(c.expr,c.fill_data,p,h);else try{u=tokenizer_space(c.expr,c.fill_data,p,h)}catch(e){return l}else if(void 0===l)u=tokenizer(c.expr,c.fill_data,p,h);else try{u=tokenizer(c.expr,c.fill_data,p,h)}catch(e){return l}if(void 0===l)s=token_parser(u,h);else try{s=token_parser(u,h)}catch(e){return l}var m=BigNumber.isBigNumber(s.real_value)?s.real_value:new BigNumber(s.real_value),d={};if(void 0===v)m=m.toFixed();else{var g=_slicedToArray(format(m,v),2);m=g[0],d=g[1]}if("Infinity"===m||void 0===m){if(void 0===l)throw new Error("计算错误可能是非法的计算式");return l}return!u.has_unit||d.to_number||d.to_number_string||(m+=u.unit),(get_debug_config()||f)&&(console.groupCollapsed("%c"+c.origin_expr,debug_style.expr),console.groupCollapsed("%c表达式: %c%s",debug_style.label1,debug_style.nowrap,c.origin_expr),console.log(c.origin_expr),console.groupEnd(),console.groupCollapsed("%c数据源: %c%s",debug_style.label1,debug_style.nowrap,stringify(c.origin_fill_data)),console.log(c.origin_fill_data),console.groupEnd(),console.groupCollapsed("%c结果: %c%s",debug_style.label1,debug_style.nowrap,stringify(m)),console.log(m),console.groupEnd(),console.groupCollapsed("%ctokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(u)),console.log(u),console.groupEnd(),console.groupCollapsed("%cfmt-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(c.fmt_tokens)),console.log(c.fmt_tokens),console.groupEnd(),console.groupCollapsed("%cast: %c%s",debug_style.label1,debug_style.nowrap,stringify(s)),console.log(s),console.groupEnd(),console.groupCollapsed("%c单位: %c%s",debug_style.label1,debug_style.nowrap,unit_str),console.log(unit_str),console.groupEnd(),console.groupCollapsed("%cparse-arg: %c%s",debug_style.label1,debug_style.nowrap,stringify(c)),console.log(c),console.groupEnd(),console.groupEnd()),m}function check_update(){check_version().catch((function(){}))}function print_version(){console.log("%ca-calc:%c ".concat(version," %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;")}var calc_util={check_update:check_update,print_version:print_version,open_debug:open_debug,close_debug:close_debug,close_important_push:close_important_push,open_important_push:open_important_push},fmt=calc;function plus_memo(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number",o="compute:"+e+"+b";return cache_map.has(o)?((r=cache_map.get(o)).count++,"number"===n?r.value.toNumber():r.value.toFixed()):(r={count:0,value:new BigNumber(e).plus(t)},"number"===n?r.value.toNumber():r.value.toFixed())}function plus(e,t){return"number"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number")?new BigNumber(e).plus(t).toNumber():new BigNumber(e).plus(t).toFixed()}function sub_memo(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number",o="compute:"+e+"-b";return cache_map.has(o)?((r=cache_map.get(o)).count++,"number"===n?r.value.toNumber():r.value.toFixed()):(r={count:0,value:new BigNumber(e).minus(t)},"number"===n?r.value.toNumber():r.value.toFixed())}function sub(e,t){return"number"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number")?new BigNumber(e).minus(t).toNumber():new BigNumber(e).minus(t).toFixed()}function mul_memo(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number",o="compute:"+e+"*b";return cache_map.has(o)?((r=cache_map.get(o)).count++,"number"===n?r.value.toNumber():r.value.toFixed()):(r={count:0,value:new BigNumber(e).times(t)},"number"===n?r.value.toNumber():r.value.toFixed())}function mul(e,t){return"number"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number")?new BigNumber(e).times(t).toNumber():new BigNumber(e).times(t).toFixed()}function div_memo(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number",o="compute:"+e+"/b";return cache_map.has(o)?((r=cache_map.get(o)).count++,"number"===n?r.value.toNumber():r.value.toFixed()):(r={count:0,value:new BigNumber(e).div(t)},"number"===n?r.value.toNumber():r.value.toFixed())}function div(e,t){return"number"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number")?new BigNumber(e).div(t).toNumber():new BigNumber(e).div(t).toFixed()}function mod_memo(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number",o="compute:"+e+"%b";return cache_map.has(o)?((r=cache_map.get(o)).count++,"number"===n?r.value.toNumber():r.value.toFixed()):(r={count:0,value:new BigNumber(e).mod(t)},"number"===n?r.value.toNumber():r.value.toFixed())}function mod(e,t){return"number"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number")?new BigNumber(e).mod(t).toNumber():new BigNumber(e).mod(t).toFixed()}function pow_memo(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number",o="compute:"+e+"**b";return cache_map.has(o)?((r=cache_map.get(o)).count++,"number"===n?r.value.toNumber():r.value.toFixed()):(r={count:0,value:new BigNumber(e).pow(t)},"number"===n?r.value.toNumber():r.value.toFixed())}function pow(e,t){return"number"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number")?new BigNumber(e).pow(t).toNumber():new BigNumber(e).pow(t).toFixed()}function idiv_memo(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number",o="compute:"+e+"//b";return cache_map.has(o)?((r=cache_map.get(o)).count++,"number"===n?r.value.toNumber():r.value.toFixed()):(r={count:0,value:new BigNumber(e).idiv(t)},"number"===n?r.value.toNumber():r.value.toFixed())}function idiv(e,t){return"number"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"number")?new BigNumber(e).idiv(t).toNumber():new BigNumber(e).idiv(t).toFixed()}export{__get_cache_map,calc,calc_util,calc_wrap,clear_memo,div,div_memo,fmt,get_memo_size,idiv,idiv_memo,mod,mod_memo,mul,mul_memo,plus,plus_memo,pow,pow_memo,sub,sub_memo,version};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "a-calc",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-dev.20240513",
|
|
4
4
|
"description": "A very powerful and easy-to-use number precision calculation and formatting library.",
|
|
5
5
|
"main": "./es/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -82,17 +82,18 @@
|
|
|
82
82
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
83
83
|
"@rollup/plugin-terser": "^0.4.4",
|
|
84
84
|
"ava": "^4.3.3",
|
|
85
|
+
"benchmark": "^2.1.4",
|
|
85
86
|
"bignumber.js": "^9.1.1",
|
|
86
87
|
"cross-env": "^7.0.3",
|
|
87
88
|
"fast-deep-equal": "^3.1.3",
|
|
88
89
|
"glob": "^8.1.0",
|
|
89
90
|
"json-stringify-safe": "^5.0.1",
|
|
90
|
-
"lodash": "^4.17.21",
|
|
91
91
|
"npm-run-all": "^4.1.5",
|
|
92
92
|
"rollup": "^4.6.0",
|
|
93
93
|
"rollup-plugin-livereload": "^2.0.5",
|
|
94
94
|
"rollup-plugin-serve": "^1.1.0",
|
|
95
|
-
"typescript": "^5.1.6"
|
|
95
|
+
"typescript": "^5.1.6",
|
|
96
|
+
"lodash-es": "^4.17.21"
|
|
96
97
|
},
|
|
97
98
|
"dependencies": {
|
|
98
99
|
"typescript-treasure": "0.0.9"
|
package/cjs/package.json
DELETED
package/es/package.json
DELETED