a-calc 2.0.0-dev.20240522 → 2.1.0
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 +13 -41
- package/a-calc.versions.js +2 -1
- package/browser/index.js +1 -1
- package/calc.d.ts +0 -12
- package/cjs/index.js +1 -1
- package/es/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# a-calc
|
|
2
2
|
[](https://www.npmjs.com/package/a-calc) [](https://github.com/Autumn-one/a-calc-old) [](https://github.com/Autumn-one/a-calc-old) [](https://github.com/Autumn-one/a-calc-old) [](https://www.npmjs.com/package/a-calc)
|
|
3
3
|
|
|
4
|
-
**Black people should go back to Africa!**
|
|
5
|
-
|
|
6
4
|
## Features and Advantages
|
|
7
5
|
|
|
8
6
|
**:baby_chick:Easy** Push the coding experience to the extreme, the minimalist API is easy to remember.
|
|
@@ -276,60 +274,33 @@ calc(`${a} + ${b}`) // This way of writing is not recommended.
|
|
|
276
274
|
calc("a + b", {a,b}) // Recommended writing, because it is clearer.
|
|
277
275
|
```
|
|
278
276
|
|
|
279
|
-
##
|
|
280
|
-
|
|
281
|
-
This section will teach you how to squeeze every last bit of performance out of a-calc. a-calc 2.x is several times faster than 1.x at its peak performance.
|
|
282
|
-
|
|
283
|
-
### Enable calculation caching.
|
|
284
|
-
|
|
285
|
-
The `calc`, `fmt`, and `calc_wrap` methods all have corresponding caching methods. The method names are simply the original names followed by `_memo`. The usage is the same as the non-cached versions, but with the added built-in caching functionality.
|
|
286
|
-
|
|
287
|
-
```typescript
|
|
288
|
-
import { calc_memo, fmt_memo, calc_wrap_memo } from "a-calc"
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
These caching methods are not suitable for computing completely random expressions, but even for completely random expressions, there is a way to transform them into versions that can take advantage of caching. The prerequisite is that the formulas between different expressions can be reused. Here is an example:
|
|
277
|
+
## space and space-all modes
|
|
292
278
|
|
|
293
|
-
|
|
294
|
-
// The following calculation formula cannot be reused and is not suitable for cached computation.
|
|
295
|
-
calc(`${Math.Random()} + ${Math.Random()}`)
|
|
296
|
-
calc(`${Math.Random()} + ${Math.Random()}`)
|
|
297
|
-
// The following calculation formula is suitable for using cached computation.
|
|
298
|
-
calc_memo("a + b", {a: Math.Random(), b: Math.Random()})
|
|
299
|
-
calc_memo("a + b", {a: Math.Random(), b: Math.Random()})
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
It can be seen that once we extract a formula like `a + b` from the calculation above, it can be reused. However, please note that `a + b` and `c + d` are considered different formulas!
|
|
303
|
-
|
|
304
|
-
In conclusion, effectively utilizing caching in calculations can significantly improve performance. This is one of the most impactful techniques for enhancing performance among all performance improvement strategies.
|
|
305
|
-
|
|
306
|
-
### The space and space-all modes
|
|
307
|
-
|
|
308
|
-
Both the space and space-all modes can improve a certain level of performance, but these two modes have higher requirements for code writing. The space mode requires strict insertion of spaces between each unit in the calculation part, while the space-all not only requires spaces to be strictly inserted in the calculation part, but also requires spaces to be inserted in the fmt formatting part.
|
|
279
|
+
The two modes of space and space-ALL put forward higher requirements for code writing. space mode requires strict insertion of Spaces between each unit of the calculation part. Space-all not only requires strict insertion of Spaces in the calculation part but also requires insertion of Spaces in the fmt formatting part. Almost the most important effect of this feature is disambiguation, and the second is that it can improve performance slightly.
|
|
309
280
|
|
|
310
281
|
```typescript
|
|
311
|
-
calc("1+1", {_mode: "space"}) // This
|
|
312
|
-
calc("1 + 1", {_mode: "space"}) // This is
|
|
313
|
-
calc("1 + (2 * 3)", {_mode: "space"}) // This
|
|
282
|
+
calc("1+1", {_mode: "space"}) // This formulation cannot be calculated because of the lack of Spaces
|
|
283
|
+
calc("1 + 1", {_mode: "space"}) // This is written correctly
|
|
284
|
+
calc("1 + (2 * 3)", {_mode: "space"}) // This is also correct, because of the special treatment of parentheses, which can be next to internal numbers or variable names or separated by Spaces
|
|
314
285
|
|
|
315
|
-
calc("1 + ( 2 * 3 ) | =2 ,", {_mode: "space-all"}) //
|
|
286
|
+
calc("1 + ( 2 * 3 ) | =2 ,", {_mode: "space-all"}) // space is also required between =2 and, after using the space-all mode, there must be at least one space between each formatting unit, and the space can be more than less.
|
|
316
287
|
```
|
|
317
288
|
|
|
318
|
-
|
|
289
|
+
## Original method
|
|
319
290
|
|
|
320
|
-
You can also use
|
|
291
|
+
You can also use plus sub mul div and other methods to calculate, although the main problem that a-calc solves is that such methods are not intuitive to write the problem, but if you only have two operands and do not need any formatting then using these methods can bring some performance improvement
|
|
321
292
|
|
|
322
293
|
```typescript
|
|
323
|
-
import {plus, sub, mul, div, mod, pow, idiv
|
|
324
|
-
// All of the above methods will have a memo version, which will not be elaborated on.
|
|
294
|
+
import {plus, sub, mul, div, mod, pow, idiv} from "a-calc"
|
|
325
295
|
plus(1, 1) // 2
|
|
326
296
|
plus(1, 1, "string") // "2"
|
|
327
297
|
```
|
|
328
298
|
|
|
329
|
-
## 版本变更
|
|
330
|
-
|
|
331
299
|
## Version changes
|
|
332
300
|
|
|
301
|
+
* 2.1.0
|
|
302
|
+
|
|
303
|
+
- Destructive changes: All memo methods have been removed because the memo method brings more code. However, after multi-scenario testing, it can only bring significant performance improvement in specific scenarios. In some business scenarios, it hardly brings performance improvement because the parser performance is high enough. The running time of cache logic often cancels out the parsing time saved, so the overall benefit is too low.
|
|
333
304
|
* 2.0.0
|
|
334
305
|
|
|
335
306
|
- Destructive change: The \_unit parameter now only supports boolean type, the previous space value has been moved to the \_mode parameter.
|
|
@@ -340,6 +311,7 @@ plus(1, 1, "string") // "2"
|
|
|
340
311
|
- Now it is also possible to configure when the second parameter is an array.
|
|
341
312
|
- Exposed primitive methods such as plus, subtract, multiply, divide, modulo, power, integer division and their corresponding memo versions.
|
|
342
313
|
- Added support for the `//` floor division operator.
|
|
314
|
+
- `**` to right-bound to be consistent with the native JS language rules
|
|
343
315
|
* 1.3.9 Solved the problem of failed rounding due to the part of the injection variable in formatting being 0 (Problem reporter: MangMax)
|
|
344
316
|
* 1.3.8 Solved the packaging failure problem caused by the upgrade of vite5.x (Problem reporter: 武建鹏)
|
|
345
317
|
* 1.3.6
|
package/a-calc.versions.js
CHANGED
|
@@ -40,7 +40,8 @@ try{
|
|
|
40
40
|
'1.5.0-dev.2024042402', '1.5.0-dev.2024042404', '1.5.0-dev.2024042405',
|
|
41
41
|
'1.5.0-dev.2024042406', '2.0.0-dev.20240511', '2.0.0-dev.20240513',
|
|
42
42
|
'2.0.0-dev.20240514', '2.0.0-dev.20240517', '2.0.0-dev.20240520',
|
|
43
|
-
'2.0.0-dev.
|
|
43
|
+
'2.0.0-dev.20240522', '2.0.0-dev.2024052101', '2.0.0-dev.2024052102',
|
|
44
|
+
'2.0.0', '2.1.0'
|
|
44
45
|
]; a_calc_versions;
|
|
45
46
|
}
|
|
46
47
|
finally
|
package/browser/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var a_calc=function(exports){"use strict";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=[],c=!0,s=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)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 c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function s(e,t,r,o){var a=t&&t.prototype instanceof p?t:p,i=Object.create(a.prototype),u=new A(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=s;var f={};function p(){}function _(){}function h(){}var m={};c(m,a,(function(){return this}));var v=Object.getPrototypeOf,d=v&&v(v(O([])));d&&d!==t&&r.call(d,a)&&(m=d);var b=h.prototype=p.prototype=Object.create(m);function g(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){function o(n,a,i,u){var c=l(e[n],e,a);if("throw"!==c.type){var s=c.arg,f=s.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){s.value=e,i(s)}),(function(e){return o("throw",e,i,u)}))}u(c.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 c=l(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.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 A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function O(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(b,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:_,configurable:!0}),_.displayName=c(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,c(e,u,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},g(y.prototype),c(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(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},g(b),c(b,u,"Generator"),c(b,a,(function(){return this})),c(b,"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=O,A.prototype={constructor:A,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"),c=r.call(a,"finallyLoc");if(u&&c){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(!c)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:O(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),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).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.20240522";function decimal_round(e,t,r,n,o){var a=e,i=t,u=t.length,c={"~-":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,c="<"===r?n-1:n,s=+t[c],l=t.slice(+c+1,t.length);l=""===l?0:parseInt(l),o=0===c?+e[e.length-1]:+t[c-1],i=t.slice(0,c),(s>=6||5===s&&l>0||5===s&&o%2!=0)&&(i=(+"9".concat(i)+1).toString().slice(1)).length>c&&(i=i.slice(1,i.length),a=(+a+1).toString())}}};return"<="===r?u<=n?i=t.replace(/0*$/,""):(c[o]&&c[o](),i=i.replace(/0+$/,"")):"<"===r?u<n?i=t.replace(/0*$/,""):(c[o]&&c[o](),i=i.replace(/0+$/,"")):"="===r?u<n?i=t+"0".repeat(n-u):u>n&&c[o]&&c[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 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",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,c=i.unit;if(e.real_value=u,void 0!==c)o=!0,null!==(a=n)&&void 0!==a||(n=c),e.unit=c}else e.real_value=get_real_value(t,e.value);else if(e.type===state_number){var s;if(e.has_unit)o=!0,null!==(s=n)&&void 0!==s||(n=e.unit)}})),e.has_unit=o,e.unit=n}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 integer_thousands(e){for(var t=e.length,r="";t>0;)r=e.substring(t-3,t)+(""!==r?",":"")+r,t-=3;return r}function parse_thousands(e){var t=e.split("."),r=t[0];return"-"===r[0]?t[0]="-"+integer_thousands(r.slice(1)):t[0]=integer_thousands(r),t.join(".")}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++}}function parse_args(e,t,r,n){var o="",a={origin_expr:e,origin_fill_data:t,expr:"",fmt_tokens:void 0,options:void 0,fill_data:void 0,_unit:void 0,_mode:void 0,_fmt:void 0};null!=t&&(a.options=t,Array.isArray(t)?a.fill_data=t:Array.isArray(t._fill_data)?a.fill_data=[t].concat(_toConsumableArray(t._fill_data)):void 0===t._fill_data?a.fill_data=[t]:a.fill_data=[t,t._fill_data]);var i=a._mode=find_value(t,"_mode");a._unit=find_value(t,"_unit",!1);var u=a._fmt=find_value(t,"_fmt");if("string"==typeof e){if(o=e,""===e.trim()||e.includes("NaN"))throw new Error("非法的表达式:".concat(e))}else{if("number"!=typeof e)throw new Error("错误的第一个参数类型: ".concat(e," 类型为:").concat(_typeof(e)));o=e.toString()}var c=o.split("|");if(a.expr=c[0],c.length>1){var s=c[1];""!==s.trim()&&(a.fmt_tokens="space-all"===i?n(s,a.fill_data):r(s,a.fill_data))}if(void 0!==t&&void 0!==u){var l=[];if(l="space-all"===i?n(u,a.fill_data):r(u,a.fill_data),void 0===a.fmt_tokens)a.fmt_tokens=l;else{var f=a.fmt_tokens.map((function(e){return e.type}));l.forEach((function(e){f.includes(e.type)||a.fmt_tokens.push(e)}))}}return a}function push_token$3(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),c=get_real_value(t.fill_data,u);if(t._unit){var s,l=split_unit_num(c),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!==(s=t.unit_str)&&void 0!==s||(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:c,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){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$3(i,o):o.cur_index++:push_token$3(i,o);break;case state_operator:var c=e[o.cur_index-1];"*"===n&&"*"===c?(o.cur_index++,i.push({type:state_operator,value:"**"}),o.prev_index=o.cur_index):"/"===n&&"/"===c?(o.cur_index++,i.push({type:state_operator,value:"//"}),o.prev_index=o.cur_index):(i.push({type:state_operator,value:c}),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$3(i,o);break;case state_scientific:if(number_char.includes(n))o.cur_index++;else if("+-".includes(n)){var s=o.prev_index;"+-".includes(e[s])&&(s+=1);var l=e.slice(s,o.cur_index),f=l.at(-1);l.includes(n)||"e"!==f?push_token$3(i,o):o.cur_index++}else r&&-1==="*/+-() ".indexOf(n)?o.cur_index++:push_token$3(i,o);break;default:throw new Error("字符扫描状态错误")}return o.prev_index<o.cur_index&&push_token$3(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,c,s,l,f=A.prototype={constructor:A,toString:null,valueOf:null},p=new A(1),_=20,h=4,m=-7,v=21,d=-1e7,b=1e7,g=!1,y=1,w=0,x={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},S="0123456789abcdefghijklmnopqrstuvwxyz",E=!0;function A(e,t){var o,a,i,u,c,s,l,f,p=this;if(!(p instanceof A))return new A(e,t);if(null==t){if(e&&!0===e._isBigNumber)return p.s=e.s,void(!e.c||e.e>b?p.c=p.e=null:e.e<d?p.c=[p.e=0]:(p.e=e.e,p.c=e.c.slice()));if((s="number"==typeof e)&&0*e==0){if(p.s=1/e<0?(e=-e,-1):1,e===~~e){for(u=0,c=e;c>=10;c/=10,u++);return void(u>b?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,s);p.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(u=f.indexOf("."))>-1&&(f=f.replace(".","")),(c=f.search(/e/i))>0?(u<0&&(u=c),u+=+f.slice(c+1),f=f.substring(0,c)):u<0&&(u=f.length)}else{if(intCheck(t,2,S.length,"Base"),10==t&&E)return T(p=new A(e),_+p.e+1,h);if(f=String(e),s="number"==typeof e){if(0*e!=0)return n(p,f,s,t);if(p.s=1/e<0?(f=f.slice(1),-1):1,A.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=c=0,l=f.length;c<l;c++)if(o.indexOf(a=f.charAt(c))<0){if("."==a){if(c>u){u=l;continue}}else if(!i&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){i=!0,c=-1,u=0;continue}return n(p,String(e),s,t)}s=!1,(u=(f=r(f,t,10,p.s)).indexOf("."))>-1?f=f.replace(".",""):u=f.length}for(c=0;48===f.charCodeAt(c);c++);for(l=f.length;48===f.charCodeAt(--l););if(f=f.slice(c,++l)){if(l-=c,s&&A.DEBUG&&l>15&&(e>MAX_SAFE_INTEGER||e!==mathfloor(e)))throw Error(tooManyDigits+p.s*e);if((u=u-c-1)>b)p.c=p.e=null;else if(u<d)p.c=[p.e=0];else{if(p.e=u,p.c=[],c=(u+1)%LOG_BASE,u<0&&(c+=LOG_BASE),c<l){for(c&&p.c.push(+f.slice(0,c)),l-=LOG_BASE;c<l;)p.c.push(+f.slice(c,c+=LOG_BASE));c=LOG_BASE-(f=f.slice(c)).length}else c-=l;for(;c--;f+="0");p.c.push(+f)}}else p.c=[p.e=0]}function O(e,t,r,n){var o,a,i,u,c;if(null==r?r=h:intCheck(r,0,8),!e.c)return e.toString();if(o=e.c[0],i=e.e,null==t)c=coeffToString(e.c),c=1==n||2==n&&(i<=m||i>=v)?toExponential(c,i):toFixedPoint(c,i,"0");else if(a=(e=T(new A(e),t,r)).e,u=(c=coeffToString(e.c)).length,1==n||2==n&&(t<=a||a<=m)){for(;u<t;c+="0",u++);c=toExponential(c,a)}else if(t-=i,c=toFixedPoint(c,a,"0"),a+1>u){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=a-u)>0)for(a+1==u&&(c+=".");t--;c+="0");return e.s<0&&o?"-"+c:c}function k(e,t){for(var r,n=1,o=new A(e[0]);n<e.length;n++){if(!(r=new A(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)>b?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,c,s,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=(c=f[s=0])/p[o-i-1]%10|0;else if((s=mathceil((a+1)/LOG_BASE))>=f.length){if(!n)break e;for(;f.length<=s;f.push(0));c=l=0,o=1,i=(a%=LOG_BASE)-LOG_BASE+1}else{for(c=u=f[s],o=1;u>=10;u/=10,o++);l=(i=(a%=LOG_BASE)-LOG_BASE+o)<0?0:c/p[o-i-1]%10|0}if(n=n||t<0||null!=f[s+1]||(i<0?c:c%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?c/p[o-i]:0:f[s-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=s,u=1,s--):(f.length=s+1,u=p[LOG_BASE-a],f[s]=i>0?mathfloor(c/p[o-i]%p[i])*u:0),n)for(;;){if(0==s){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[s]+=u,f[s]!=BASE)break;f[s--]=0,u=1}for(a=f.length;0===f[--a];f.pop());}e.e>b?e.c=e.e=null:e.e<d&&(e.c=[e.e=0])}return e}function B(e){var t,r=e.e;return null===r?e.toString():(t=coeffToString(e.c),t=r<=m||r>=v?toExponential(t,r):toFixedPoint(t,r,"0"),e.s<0?"-"+t:t)}return A.clone=clone,A.ROUND_UP=0,A.ROUND_DOWN=1,A.ROUND_CEIL=2,A.ROUND_FLOOR=3,A.ROUND_HALF_UP=4,A.ROUND_HALF_DOWN=5,A.ROUND_HALF_EVEN=6,A.ROUND_HALF_CEIL=7,A.ROUND_HALF_FLOOR=8,A.EUCLID=9,A.config=A.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),m=r[0],v=r[1]):(intCheck(r,-MAX,MAX,t),m=-(v=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],b=r[1];else{if(intCheck(r,-MAX,MAX,t),!r)throw Error(bignumberError+t+" cannot be zero: "+r);d=-(b=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 g=!r,Error(bignumberError+"crypto unavailable");g=r}else g=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:[m,v],RANGE:[d,b],CRYPTO:g,MODULO_MODE:y,POW_PRECISION:w,FORMAT:x,ALPHABET:S}},A.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!A.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)},A.maximum=A.max=function(){return k(arguments,f.lt)},A.minimum=A.min=function(){return k(arguments,f.gt)},A.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,c=[],s=new A(p);if(null==e?e=_:intCheck(e,0,MAX),o=mathceil(e/LOG_BASE),g)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]):(c.push(i%1e14),u+=2);u=o/2}else{if(!crypto.randomBytes)throw g=!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):(c.push(i%1e14),u+=7);u=o/7}if(!g)for(;u<o;)(i=a())<9e15&&(c[u++]=i%1e14);for(o=c[--u],e%=LOG_BASE,o&&e&&(i=POWS_TEN[LOG_BASE-e],c[u]=mathfloor(o/i)*i);0===c[u];c.pop(),u--);if(u<0)c=[n=0];else{for(n=-1;0===c[0];c.splice(0,1),n-=LOG_BASE);for(u=1,i=c[0];i>=10;i/=10,u++);u<LOG_BASE&&(n-=LOG_BASE-u)}return s.e=n,s.c=c,s}),A.sum=function(){for(var e=1,t=arguments,r=new A(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,c=e.length;u<c;){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 c,s,l,f,p,m,v,d,b=n.indexOf("."),g=_,y=h;for(b>=0&&(f=w,w=0,n=n.replace(".",""),m=(d=new A(o)).pow(n.length-b),w=f,d.c=r(toFixedPoint(coeffToString(m.c),m.e,"0"),10,a,e),d.e=d.c.length),l=f=(v=r(n,o,a,u?(c=S,e):(c=e,S))).length;0==v[--f];v.pop());if(!v[0])return c.charAt(0);if(b<0?--l:(m.c=v,m.e=l,m.s=i,v=(m=t(m,d,g,y,a)).c,p=m.r,l=m.e),b=v[s=l+g+1],f=a/2,p=p||s<0||null!=v[s+1],p=y<4?(null!=b||p)&&(0==y||y==(m.s<0?3:2)):b>f||b==f&&(4==y||p||6==y&&1&v[s-1]||y==(m.s<0?8:7)),s<1||!v[0])n=p?toFixedPoint(c.charAt(1),-g,c.charAt(0)):c.charAt(0);else{if(v.length=s,p)for(--a;++v[--s]>a;)v[s]=0,s||(++l,v=[1].concat(v));for(f=v.length;!v[--f];);for(b=0,n="";b<=f;n+=c.charAt(v[b++]));n=toFixedPoint(n,l,c.charAt(0))}return n}}(),t=function(){function e(e,t,r){var n,o,a,i,u=0,c=e.length,s=t%SQRT_BASE,l=t/SQRT_BASE|0;for(e=e.slice();c--;)u=((o=s*(a=e[c]%SQRT_BASE)+(n=l*a+(i=e[c]/SQRT_BASE|0)*s)%SQRT_BASE*SQRT_BASE+u)/r|0)+(n/SQRT_BASE|0)+l*i,e[c]=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 c,s,l,f,p,_,h,m,v,d,b,g,y,w,x,S,E,O=n.s==o.s?1:-1,k=n.c,N=o.c;if(!(k&&k[0]&&N&&N[0]))return new A(n.s&&o.s&&(k?!N||k[0]!=N[0]:N)?k&&0==k[0]||!N?0*O:O/0:NaN);for(v=(m=new A(O)).c=[],O=a+(s=n.e-o.e)+1,u||(u=BASE,s=bitFloor(n.e/LOG_BASE)-bitFloor(o.e/LOG_BASE),O=O/LOG_BASE|0),l=0;N[l]==(k[l]||0);l++);if(N[l]>(k[l]||0)&&s--,O<0)v.push(1),f=!0;else{for(w=k.length,S=N.length,l=0,O+=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,b=(d=k.slice(0,S)).length;b<S;d[b++]=0);E=N.slice(),E=[0].concat(E),x=N[0],N[1]>=u/2&&x++;do{if(p=0,(c=t(N,d,S,b))<0){if(g=d[0],S!=b&&(g=g*u+(d[1]||0)),(p=mathfloor(g/x))>1)for(p>=u&&(p=u-1),h=(_=e(N,p,u)).length,b=d.length;1==t(_,d,h,b);)p--,r(_,S<h?E:N,h,u),h=_.length,c=1;else 0==p&&(c=p=1),h=(_=N.slice()).length;if(h<b&&(_=[0].concat(_)),r(d,_,b,u),b=d.length,-1==c)for(;t(N,d,S,b)<1;)p++,r(d,S<b?E:N,b,u),b=d.length}else 0===c&&(p++,d=[0]);v[l++]=p,d[0]?d[b++]=k[y]||0:(d=[k[y]],b=1)}while((y++<w||null!=d[0])&&O--);f=null!=d[0],v[0]||v.splice(0,1)}if(u==BASE){for(l=1,O=v[0];O>=10;O/=10,l++);T(m,a+(m.e=l+s*LOG_BASE-1)+1,i,f)}else m.e=s,m.r=+f;return m}}(),i=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,c=/^\.([^.]+)$/,s=/^-?(Infinity|NaN)$/,l=/^\s*\+(?=[\w.])|^\s+|\s+$/g,n=function(e,t,r,n){var o,a=r?t:t.replace(l,"");if(s.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(c,"0.$1")),t!=a))return new A(a,o);if(A.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 A(this);return e.s<0&&(e.s=1),e},f.comparedTo=function(e,t){return compare(this,new A(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 A(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 A(e,r),_,h)},f.dividedToIntegerBy=f.idiv=function(e,r){return t(this,new A(e,r),0,1)},f.exponentiatedBy=f.pow=function(e,t){var r,n,o,a,i,u,c,s,l=this;if((e=new A(e)).c&&!e.isInteger())throw Error(bignumberError+"Exponent not an integer: "+B(e));if(null!=t&&(t=new A(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 s=new A(Math.pow(+B(l),i?e.s*(2-isOdd(e)):+B(e))),t?s.mod(t):s;if(u=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new A(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 A(u?1/a:a);w&&(a=mathceil(w/LOG_BASE+2))}for(i?(r=new A(.5),u&&(e.s=1),c=isOdd(e)):c=(o=Math.abs(+B(e)))%2,s=new A(p);;){if(c){if(!(s=s.times(l)).c)break;a?s.c.length>a&&(s.c.length=a):n&&(s=s.mod(t))}if(o){if(0===(o=mathfloor(o/2)))break;c=o%2}else if(T(e=e.times(r),e.e+1,1),e.e>14)c=isOdd(e);else{if(0===(o=+B(e)))break;c=o%2}l=l.times(l),a?l.c&&l.c.length>a&&(l.c.length=a):n&&(l=l.mod(t))}return n?s:(u&&(s=p.div(s)),t?s.mod(t):a?T(s,w,h,undefined):s)},f.integerValue=function(e){var t=new A(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 A(e,t))},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(e,t){return compare(this,new A(e,t))>0},f.isGreaterThanOrEqualTo=f.gte=function(e,t){return 1===(t=compare(this,new A(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 A(e,t))<0},f.isLessThanOrEqualTo=f.lte=function(e,t){return-1===(t=compare(this,new A(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 A(e,t)).s,!u||!t)return new A(NaN);if(u!=t)return e.s=-t,i.plus(e);var c=i.e/LOG_BASE,s=e.e/LOG_BASE,l=i.c,f=e.c;if(!c||!s){if(!l||!f)return l?(e.s=-t,e):new A(f?i:NaN);if(!l[0]||!f[0])return f[0]?(e.s=-t,e):new A(l[0]?i:3==h?-0:0)}if(c=bitFloor(c),s=bitFloor(s),l=l.slice(),u=c-s){for((a=u<0)?(u=-u,o=l):(s=c,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),--s);return l[0]?N(e,l,s):(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 A(e,r),!a.c||!e.s||e.c&&!e.c[0]?new A(NaN):!e.c||a.c&&!a.c[0]?new A(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,c,s,l,f,p,_,h,m,v,d=this,b=d.c,g=(e=new A(e,t)).c;if(!(b&&g&&b[0]&&g[0]))return!d.s||!e.s||b&&!b[0]&&!g||g&&!g[0]&&!b?e.c=e.e=e.s=null:(e.s*=d.s,b&&g?(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,(c=b.length)<(f=g.length)&&(h=b,b=g,g=h,o=c,c=f,f=o),o=c+f,h=[];o--;h.push(0));for(m=BASE,v=SQRT_BASE,o=f;--o>=0;){for(r=0,p=g[o]%v,_=g[o]/v|0,a=o+(i=c);a>o;)r=((s=p*(s=b[--i]%v)+(u=_*s+(l=b[i]/v|0)*p)%v*v+h[a]+r)/m|0)+(u/v|0)+_*l,h[a--]=s%m;h[a]=r}return r?++n:h.splice(0,1),N(e,h,n)},f.negated=function(){var e=new A(this);return e.s=-e.s||null,e},f.plus=function(e,t){var r,n=this,o=n.s;if(t=(e=new A(e,t)).s,!o||!t)return new A(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,c=e.c;if(!a||!i){if(!u||!c)return new A(o/0);if(!u[0]||!c[0])return c[0]?e:new A(u[0]?n:0*o)}if(a=bitFloor(a),i=bitFloor(i),u=u.slice(),o=a-i){for(o>0?(i=a,r=c):(o=-o,r=u),r.reverse();o--;r.push(0));r.reverse()}for((o=u.length)-(t=c.length)<0&&(r=c,c=u,u=r,t=o),o=0;t;)o=(u[--t]=u[t]+c[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 A(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,c=i.s,s=i.e,l=_+4,f=new A("0.5");if(1!==c||!u||!u[0])return new A(!c||c<0&&(!u||u[0])?NaN:u?i:1/0);if(0==(c=Math.sqrt(+B(i)))||c==1/0?(((r=coeffToString(u)).length+s)%2==0&&(r+="0"),c=Math.sqrt(+r),s=bitFloor((s+1)/2)-(s<0||s%2),n=new A(r=c==1/0?"5e"+s:(r=c.toExponential()).slice(0,r.indexOf("e")+1)+s)):n=new A(c+""),n.c[0])for((c=(s=n.e)+l)<3&&(c=0);;)if(a=n,n=f.times(a.plus(t(i,a,l,1))),coeffToString(a.c).slice(0,c)===(r=coeffToString(n.c)).slice(0,c)){if(n.e<s&&--c,"9999"!=(r=r.slice(c-3,c+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,c+=4,o=1}return T(n,n.e+_+1,h,e)},f.toExponential=function(e,t){return null!=e&&(intCheck(e,0,MAX),e++),O(this,e,t,1)},f.toFixed=function(e,t){return null!=e&&(intCheck(e,0,MAX),e=e+this.e+1),O(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,c=+r.secondaryGroupSize,s=r.groupSeparator||"",l=i[0],f=i[1],p=o.s<0,_=p?l.slice(1):l,h=_.length;if(c&&(a=u,u=c,c=a,h-=a),u>0&&h>0){for(a=h%u||u,l=_.substr(0,a);a<h;a+=u)l+=s+_.substr(a,u);c>0&&(l+=s+_.slice(a)),p&&(l="-"+l)}n=f?l+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):l}return(r.prefix||"")+n+(r.suffix||"")},f.toFraction=function(e){var r,n,o,a,i,u,c,s,l,f,_,m,v=this,d=v.c;if(null!=e&&(!(c=new A(e)).isInteger()&&(c.c||1!==c.s)||c.lt(p)))throw Error(bignumberError+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+B(c));if(!d)return new A(v);for(r=new A(p),l=n=new A(p),o=s=new A(p),m=coeffToString(d),i=r.e=m.length-v.e-1,r.c[0]=POWS_TEN[(u=i%LOG_BASE)<0?LOG_BASE+u:u],e=!e||c.comparedTo(r)>0?i>0?r:l:c,u=b,b=1/0,c=new A(m),s.c[0]=0;f=t(c,r,0,1),1!=(a=n.plus(f.times(o))).comparedTo(e);)n=o,o=a,l=s.plus(f.times(a=l)),s=a,r=c.minus(f.times(a=r)),c=a;return a=t(e.minus(n),o,0,1),s=s.plus(a.times(l)),n=n.plus(a.times(o)),s.s=l.s=v.s,_=t(l,o,i*=2,h).minus(v).abs().comparedTo(t(s,n,i,h).minus(v).abs())<1?[l,o]:[s,n],b=u,_},f.toNumber=function(){return+B(this)},f.toPrecision=function(e,t){return null!=e&&intCheck(e,1,MAX),O(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<=m||a>=v?toExponential(coeffToString(n.c),a):toFixedPoint(coeffToString(n.c),a,"0"):10===e&&E?t=toFixedPoint(coeffToString((n=T(new A(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 B(this)},f._isBigNumber=!0,f[Symbol.toStringTag]="BigNumber",f[Symbol.for("nodejs.util.inspect.custom")]=f.valueOf,null!=e&&A.set(e),A}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,c=e.e,s=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=c==s,!o||!a)return n?0:!o^r?1:-1;if(!n)return c>s^r?1:-1;for(u=(c=o.length)<(s=a.length)?c:s,i=0;i<u;i++)if(o[i]!=a[i])return o[i]>a[i]^r?1:-1;return c==s?0:c>s^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 close_important_push(){}function open_important_push(){}function open_debug(){}function close_debug(){}function calc_wrap(e,t){var r={_error:"-"};return["string","number"].includes(_typeof(e))?void 0===t?/[a-zA-Z$_]/.test(e.toString())?function(t){return Array.isArray(t)?t.unshift(r):t=_objectSpread2(_objectSpread2({},r),t),calc(e,t)}:calc(e):(Array.isArray(t)?t.unshift(r):t=_objectSpread2(_objectSpread2({},r),t),calc(e,t)):(Array.isArray(e)?e.unshift(r):e=_objectSpread2(_objectSpread2({},r),e),function(t){return calc(t,e)})}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$2(e,t,r){if(Number.isNaN(Number(t)))if("-"===t||"+"===t)0===e.length||"operator"===e.at(-1).type||"("===e.at(-1).value?e.push({type:"number",value:t,real_value:t,has_unit:!1}):e.push({type:"operator",value:t});else 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 c,s=split_unit_num(u),l=s.num,f=s.unit;if(void 0===f)e.push({type:"var",value:t,real_value:l,has_unit:!1});else r.has_unit=!0,null!==(c=r.unit_str)&&void 0!==c||(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){for(var n,o=0,a=0,i=e.length,u=[],c={has_var:!1,has_unit:!1,unit_str:void 0,_unit:r,fill_data:t};a<i;)" "===(n=e[a])?(a>o&&push_token$2(u,e.slice(o,a),c),o=a+1):"("===n?(u.push({type:state_bracket,value:"("}),o=a+1):")"===n&&(a>o&&push_token$2(u,e.slice(o,a),c),u.push({type:state_bracket,value:")"}),o=a+1),a++;return a>o&&push_token$2(u,e.slice(o,a),c),u.has_var=c.has_var,u.has_unit=c.has_unit,u.unit=c.unit_str,u}var cache_map=new Map,clear_ing=!1;function clear_cache(){var e,t,r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{maximum:2e3,use_count:100},o=null!==(e=n.maximum)&&void 0!==e?e:2e3,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 c=r.value;(++i>o||c[1].count<a)&&cache_map.delete(c[0])}}catch(e){u.e(e)}finally{u.f()}clear_ing=!1}function get_cache_data(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"value",n=cache_map.get(e);if(void 0===n){var o={count:0,value:t()};return cache_map.set(e,o),"value"===r?o.value:o}return n.count++,"value"===r?n.value:n}function __get_cache_map(){return cache_map}function check_cache(){!clear_ing&&cache_map.size>5e3&&(clear_ing=!0,Promise.resolve().then((function(){return clear_cache})))}var operator_map={"+":0,"-":0,"*":1,"/":1,"%":1,"//":1,"**":2};function eval_tokens(e,t){if(1===e.length){var r=e[0];if("number"===r.type||"var"===r.type)return r.real_value;throw new Error("错误的表达式:".concat(r.value))}for(var n,o,a=[],i=[],u=0,c=e.length;u<c;u++)if("number"!==(n=e[u]).type&&"var"!==n.type)if("operator"!==n.type)if("("!==n.value){if(")"===n.value)for(var s=void 0;s=a.pop();){if("("===s){var l=i.at(-2);if("-"===l){var f=i.pop();i.pop(),i.push(BigNumber.isBigNumber(f)?f.negated():new BigNumber(f).negated())}else if("+"===l){var p=i.pop();i.pop(),i.push(p)}break}var _=i.pop(),h=i.pop();i.push(t(h,_,s))}}else a.push("(");else{var m=a.at(-1);if("("===m){a.push(n.value);continue}var v=operator_map[n.value];if(!a.length){a.push(n.value);continue}if(v<operator_map[m])for(var d=void 0;d=a.pop();){if("("===d){a.push("(");break}var b=i.pop(),g=i.pop();i.push(t(g,b,d))}else if(v===operator_map[m]){if("**"===n.value){a.push(n.value);continue}for(var y=void 0;y=a.pop();){if("("===y){a.push("(");break}if(operator_map[y]<v){a.push(y);break}var w=i.pop(),x=i.pop();i.push(t(x,w,y))}}a.push(n.value)}else i.push(n.real_value);for(;o=a.pop();){var S=i.pop(),E=i.pop();i.push(t(E,S,o))}if(1!==i.length)throw new Error("可能出现了错误的计算式");return e.has_var||(e.calc_result=i[0]),i[0]}function compute(e,t,r){if(void 0===e||void 0===t)throw new Error("无效的操作数对:v1:".concat(e,", v2:").concat(t));var n;switch(r){case"+":n=new BigNumber(e).plus(t);break;case"-":n=new BigNumber(e).minus(t);break;case"*":n=new BigNumber(e).times(t);break;case"/":n=new BigNumber(e).div(t);break;case"%":n=new BigNumber(e).mod(t);break;case"**":n=new BigNumber(e).pow(t);break;case"//":n=new BigNumber(e).idiv(t)}return n}function compute_memo(e,t,r){return get_cache_data("compute:".concat(e).concat(r).concat(t),(function(){return compute(e,t,r)}))}function push_token$1(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){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$1(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$1(i,state_plus$1,"+",n,a);else if("~"===r)n.curr++,a.state=state_round;else if("%"===r)n.curr++,push_token$1(i,state_percent,"%",n,a);else if("/"===r)n.curr++,push_token$1(i,state_fraction,"/",n,a);else if("!"===r)if(a.state=state_initial,n.curr++,"n"===e[n.curr])n.curr++,push_token$1(i,state_to_number,"!n",n,a);else if("u"===e[n.curr])n.curr++,push_token$1(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$1(i,state_scientific,"!e",n,a)}else n.curr++,n.prev=n.curr;break;case state_symbol:"="===r&&n.curr++,push_token$1(i,state_symbol,e.slice(n.prev,n.curr),n,a);break;case state_number:number_char.includes(r)?n.curr++:push_token$1(i,state_number,e.slice(n.prev,n.curr),n,a);break;case state_var:var_members_char.includes(r)?n.curr++:push_token$1(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$1(i,state_round,e.slice(n.prev,n.curr),n,a);break;default:throw new Error("错误的fmt分词器状态")}return n.prev<n.curr&&push_token$1(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(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){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(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(u,e.slice(i,n),a),u.has_var=a.has_var,u}function fmt_tokenizer_memo(e,t){return get_cache_data("fmt-tokens:".concat(e),(function(){return fmt_tokenizer(e,t)}))}function fmt_tokenizer_space_memo(e,t){return get_cache_data("fmt-tokens-space:".concat(e),(function(){return fmt_tokenizer_space(e,t)}))}function calc_memo(e,t){var r,n,o=find_value(t,"_error"),a={};try{var i,u,c;if(null==t)return get_cache_data("calc:".concat(e),(function(){return calc(e,t)}));var s=parse_args(e,t,fmt_tokenizer_memo,fmt_tokenizer_space_memo),l=null!==(i=s._unit)&&void 0!==i&&i,f=null!==(u=s._mode)&&void 0!==u?u:"normal",p=s.fmt_tokens,_="space"===f||"space-all"===f?get_cache_data("tokens-space:".concat(s.expr,":").concat(l),(function(){return tokenizer_space(s.expr,s.fill_data,l)}),"item"):get_cache_data("tokens:".concat(s.expr,":").concat(l),(function(){return tokenizer(s.expr,s.fill_data,l)}),"item");(n=_.value).has_var&&_.count>0&&fill_tokens(n,s.fill_data,l);var h=null!==(c=n.calc_result)&&void 0!==c?c:eval_tokens(n,compute_memo);if(r=BigNumber.isBigNumber(h)?h:new BigNumber(h),void 0===p)r=r.toFixed();else{var m=_slicedToArray(format(r,p),2);r=m[0],a=m[1]}if("Infinity"===r||void 0===r)throw new Error("计算错误可能是非法的计算式")}catch(e){if(void 0===o)throw e;return o}return!n.has_unit||a.to_number||a.to_number_string||(r+=n.unit),check_cache(),r}var fmt_memo=calc_memo;function calc_wrap_memo(e,t){var r={_error:"-"};return["string","number"].includes(_typeof(e))?void 0===t?/[a-zA-Z$_]/.test(e.toString())?function(t){return Array.isArray(t)?t.unshift(r):t=_objectSpread2(_objectSpread2({},r),t),calc_memo(e,t)}:calc_memo(e):(Array.isArray(t)?t.unshift(r):t=_objectSpread2(_objectSpread2({},r),t),calc_memo(e,t)):(Array.isArray(e)?e.unshift(r):e=_objectSpread2(_objectSpread2({},r),e),function(t){return calc_memo(t,e)})}function calc(e,t){var r,n,o=find_value(t,"_error"),a={};try{var i,u,c=parse_args(e,t,fmt_tokenizer,fmt_tokenizer_space),s=null!==(i=c._unit)&&void 0!==i&&i,l=null!==(u=c._mode)&&void 0!==u?u:"normal",f=c.fmt_tokens,p=eval_tokens(n="space"===l||"space-all"===l?tokenizer_space(c.expr,c.fill_data,s):tokenizer(c.expr,c.fill_data,s),compute);if(r=BigNumber.isBigNumber(p)?p:new BigNumber(p),void 0===f)r=r.toFixed();else{var _=_slicedToArray(format(r,f),2);r=_[0],a=_[1]}if("Infinity"===r||void 0===r)throw new Error("计算错误可能是非法的计算式")}catch(e){if(void 0===o)throw e;return o}return!n.has_unit||a.to_number||a.to_number_string||(r+=n.unit),r}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)},check_cache(),"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)},check_cache(),"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)},check_cache(),"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)},check_cache(),"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)},check_cache(),"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)},check_cache(),"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)},check_cache(),"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()}return exports.__get_cache_map=__get_cache_map,exports.calc=calc,exports.calc_memo=calc_memo,exports.calc_util=calc_util,exports.calc_wrap=calc_wrap,exports.calc_wrap_memo=calc_wrap_memo,exports.div=div,exports.div_memo=div_memo,exports.fmt=fmt,exports.fmt_memo=fmt_memo,exports.idiv=idiv,exports.idiv_memo=idiv_memo,exports.mod=mod,exports.mod_memo=mod_memo,exports.mul=mul,exports.mul_memo=mul_memo,exports.parse_thousands=parse_thousands,exports.plus=plus,exports.plus_memo=plus_memo,exports.pow=pow,exports.pow_memo=pow_memo,exports.sub=sub,exports.sub_memo=sub_memo,exports.version=version,exports}({});
|
|
1
|
+
var a_calc=function(exports){"use strict";function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,u=[],s=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}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},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.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,i){var o=t&&t.prototype instanceof p?t:p,a=Object.create(o.prototype),u=new A(i||[]);return n(a,"_invoke",{value:w(e,r,u)}),a}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 h(){}function _(){}var v={};s(v,o,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(O([])));m&&m!==t&&r.call(m,o)&&(v=m);var g=_.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 i(n,o,a,u){var s=l(e[n],e,o);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){i("next",e,a,u)}),(function(e){i("throw",e,a,u)})):t.resolve(f).then((function(e){c.value=e,a(c)}),(function(e){return i("throw",e,a,u)}))}u(s.arg)}var o;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return o=o?o.then(n,n):n()}})}function w(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return N()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var u=S(a,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 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 i=l(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,f;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function x(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 A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function O(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=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 i.next=i}}return{next:N}}function N(){return{value:void 0,done:!0}}return h.prototype=_,n(g,"constructor",{value:_,configurable:!0}),n(_,"constructor",{value:h,configurable:!0}),h.displayName=s(_,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,s(e,u,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},b(y.prototype),s(y.prototype,a,(function(){return this})),e.AsyncIterator=y,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new y(c(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(g),s(g,u,"Generator"),s(g,o,(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=O,A.prototype={constructor:A,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 a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),s=r.call(o,"finallyLoc");if(u&&s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},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 i=n.arg;E(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(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,i,o,a){try{var u=e[o](a),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,i)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){asyncGeneratorStep(o,n,i,a,u,"next",e)}function u(e){asyncGeneratorStep(o,n,i,a,u,"throw",e)}a(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="2.1.0";function decimal_round(e,t,r,n,i){var o=e,a=t,u=t.length,s={"~-":function(){var e="<"===r?n-1:n;a=t.slice(0,e)},"~+":function(){var e="<"===r?n-1:n;if(!(u<=e||0===u)){var i=t.slice(0,e);0==+t.slice(e,u)?a=i:(i=(+"9".concat(i)+1).toString().slice(1)).length>e?(a=i.slice(1,i.length),o=(+o+1).toString()):a=i}},"~5":function(){if(0!==u){var e="<"===r?n-1:n;a=t.slice(0,e);var i=+t[e];Number.isNaN(i)||i>=5&&(a=(+"9".concat(a)+1).toString().slice(1)).length>e&&(a=a.slice(1,a.length),o=(+o+1).toString())}},"~6":function(){if(0!==u){var i,s="<"===r?n-1:n,c=+t[s],l=t.slice(+s+1,t.length);l=""===l?0:parseInt(l),i=0===s?+e[e.length-1]:+t[s-1],a=t.slice(0,s),(c>=6||5===c&&l>0||5===c&&i%2!=0)&&(a=(+"9".concat(a)+1).toString().slice(1)).length>s&&(a=a.slice(1,a.length),o=(+o+1).toString())}}};return"<="===r?u<=n?a=t.replace(/0*$/,""):(s[i]&&s[i](),a=a.replace(/0+$/,"")):"<"===r?u<n?a=t.replace(/0*$/,""):(s[i]&&s[i](),a=a.replace(/0+$/,"")):"="===r?u<n?a=t+"0".repeat(n-u):u>n&&s[i]&&s[i]():">="===r?u<n&&(a=t+"0".repeat(n-u)):">"===r&&u<=n&&(a=t+"0".repeat(n-u+1)),{int_part:o,dec_part:a}}var 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",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 i=nativeObjectToString$1.call(e);return n&&(t?e[symToStringTag$1]=r:delete e[symToStringTag$1]),i}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=getNative(root$1,"Map"),Map$1=Map;function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$1||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,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};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,i){t.push(n?i.replace(reEscapeChar,"$1"):r||e)})),t})),stringToPath$1=stringToPath;function arrayMap(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}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,i=[/^([+-]?[\d.]+(?:e|E)(?:\+|-)?\d+)(.*)$/,/^([+-]?[\d.]+)(.*)$/],o=0;o<i.length;o++){var a=e.match(i[o]);if(a){n=a;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,i,o,a;return Array.isArray(e)?e.length>1?null!==(n=null!==(i=get(e[0],t))&&void 0!==i?i:get(e.at(-1),t))&&void 0!==n?n:r:1===e.length&&null!==(o=get(e[0],t))&&void 0!==o?o:r:null!==(a=get(e,t,r))&&void 0!==a?a:r}function parse_mantissa(e,t,r,n){var i=e.split("."),o=i[0],a=1===i.length?"":i[1],u=decimal_round(o,a,t,+r,n);return o=u.int_part,""===(a=u.dec_part)?o:"".concat(o,".").concat(a)}function integer_thousands(e){for(var t=e.length,r="";t>0;)r=e.substring(t-3,t)+(""!==r?",":"")+r,t-=3;return r}function parse_thousands(e){var t=e.split("."),r=t[0];return"-"===r[0]?t[0]="-"+integer_thousands(r.slice(1)):t[0]=integer_thousands(r),t.join(".")}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,i,o=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=o.length>1&&void 0!==o[1]?o[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:i=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",i);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,i=e.length;n<i;n++){var o;if(void 0!==(r=null!==(o=get(e[n],t))&&void 0!==o?o: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++}}function parse_args(e,t){var r="",n={origin_expr:e,origin_fill_data:t,expr:"",fmt_expr:"",options:void 0,fill_data:void 0,_unit:void 0,_mode:void 0,_fmt:void 0};if(null!=t&&(n.options=t,Array.isArray(t)?n.fill_data=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]),n._mode=find_value(t,"_mode"),n._unit=find_value(t,"_unit",!1),n._fmt=find_value(t,"_fmt"),"string"==typeof e){if(r=e,""===e.trim()||e.includes("NaN"))throw new Error("非法的表达式:".concat(e))}else{if("number"!=typeof e)throw new Error("错误的第一个参数类型: ".concat(e," 类型为:").concat(_typeof(e)));r=e.toString()}var i=r.split("|");return n.expr=i[0],i.length>1&&(n.fmt_expr=i[1].trim()),n}function push_token$3(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,i=split_unit_num(r),o=i.num,a=i.unit;if(void 0===a)e.push({type:state_number,value:o,real_value:o,has_unit:!1});else t.has_unit=!0,null!==(n=t.unit_str)&&void 0!==n||(t.unit_str=a),e.push({type:state_number,value:o,real_value:o,has_unit:!0,unit:a})}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){for(var n,i={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},o=e.length,a=[];i.cur_index<o;)switch(n=e[i.cur_index],i.curr_state){case state_initial:if(number_char.includes(n))i.curr_state=state_number,i.cur_index++;else if(" "===n)i.cur_index++,i.prev_index=i.cur_index;else if("+-".includes(n)){var u=a.at(-1);0===i.cur_index||"operator"===(null==u?void 0:u.type)||"("===(null==u?void 0:u.value)?(i.curr_state=state_number,i.cur_index++):(i.cur_index++,a.push({type:state_operator,value:e.slice(i.prev_index,i.cur_index)}),i.prev_index=i.cur_index)}else"*/%".includes(n)?(i.curr_state=state_operator,i.cur_index++):var_char.includes(n)?(i.curr_state=state_var,i.cur_index++):"()".includes(n)?(a.push({type:state_bracket,value:n}),i.curr_state=state_initial,i.cur_index++,i.prev_index=i.cur_index):(i.cur_index++,i.prev_index=i.cur_index);break;case state_number:if(number_char.includes(n))i.cur_index++;else if("."===n){if(i.cur_index===i.prev_index||e.slice(i.prev_index,i.cur_index).includes("."))throw new Error("非法的小数部分".concat(e.slice(i.prev_index,i.cur_index)));i.cur_index++}else"e"===n?(i.curr_state=state_scientific,i.cur_index++):r?"*/+-() ".indexOf(n)>-1||"%"===n&&number_char.includes(e[i.cur_index-1])&&pure_number_var_first_char.includes(get_next_nonempty_char(e,i.cur_index,o))?push_token$3(a,i):i.cur_index++:push_token$3(a,i);break;case state_operator:var s=e[i.cur_index-1];"*"===n&&"*"===s?(i.cur_index++,a.push({type:state_operator,value:"**"}),i.prev_index=i.cur_index):"/"===n&&"/"===s?(i.cur_index++,a.push({type:state_operator,value:"//"}),i.prev_index=i.cur_index):(a.push({type:state_operator,value:s}),i.prev_index=i.cur_index),i.curr_state=state_initial;break;case state_var:var_members_char.includes(n)?i.cur_index++:push_token$3(a,i);break;case state_scientific:if(number_char.includes(n))i.cur_index++;else if("+-".includes(n)){var c=i.prev_index;"+-".includes(e[c])&&(c+=1);var l=e.slice(c,i.cur_index),f=l.at(-1);l.includes(n)||"e"!==f?push_token$3(a,i):i.cur_index++}else r&&-1==="*/+-() ".indexOf(n)?i.cur_index++:push_token$3(a,i);break;default:throw new Error("字符扫描状态错误")}return i.prev_index<i.cur_index&&push_token$3(a,i),a.has_var=i.has_var,a.has_unit=i.has_unit,a.unit=i.unit_str,a}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,i,o,a,u,s,c,l,f=A.prototype={constructor:A,toString:null,valueOf:null},p=new A(1),h=20,_=4,v=-7,d=21,m=-1e7,g=1e7,b=!1,y=1,w=0,S={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},x="0123456789abcdefghijklmnopqrstuvwxyz",E=!0;function A(e,t){var i,o,a,u,s,c,l,f,p=this;if(!(p instanceof A))return new A(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<m?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,x.length,"Base"),10==t&&E)return T(p=new A(e),h+p.e+1,_);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,A.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(i=x.slice(0,t),u=s=0,l=f.length;s<l;s++)if(i.indexOf(o=f.charAt(s))<0){if("."==o){if(s>u){u=l;continue}}else if(!a&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){a=!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&&A.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<m)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 O(e,t,r,n){var i,o,a,u,s;if(null==r?r=_:intCheck(r,0,8),!e.c)return e.toString();if(i=e.c[0],a=e.e,null==t)s=coeffToString(e.c),s=1==n||2==n&&(a<=v||a>=d)?toExponential(s,a):toFixedPoint(s,a,"0");else if(o=(e=T(new A(e),t,r)).e,u=(s=coeffToString(e.c)).length,1==n||2==n&&(t<=o||o<=v)){for(;u<t;s+="0",u++);s=toExponential(s,o)}else if(t-=a,s=toFixedPoint(s,o,"0"),o+1>u){if(--t>0)for(s+=".";t--;s+="0");}else if((t+=o-u)>0)for(o+1==u&&(s+=".");t--;s+="0");return e.s<0&&i?"-"+s:s}function N(e,t){for(var r,n=1,i=new A(e[0]);n<e.length;n++){if(!(r=new A(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function k(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*LOG_BASE-1)>g?e.c=e.e=null:r<m?e.c=[e.e=0]:(e.e=r,e.c=t),e}function T(e,t,r,n){var i,o,a,u,s,c,l,f=e.c,p=POWS_TEN;if(f){e:{for(i=1,u=f[0];u>=10;u/=10,i++);if((o=t-i)<0)o+=LOG_BASE,a=t,l=(s=f[c=0])/p[i-a-1]%10|0;else if((c=mathceil((o+1)/LOG_BASE))>=f.length){if(!n)break e;for(;f.length<=c;f.push(0));s=l=0,i=1,a=(o%=LOG_BASE)-LOG_BASE+1}else{for(s=u=f[c],i=1;u>=10;u/=10,i++);l=(a=(o%=LOG_BASE)-LOG_BASE+i)<0?0:s/p[i-a-1]%10|0}if(n=n||t<0||null!=f[c+1]||(a<0?s:s%p[i-a-1]),n=r<4?(l||n)&&(0==r||r==(e.s<0?3:2)):l>5||5==l&&(4==r||n||6==r&&(o>0?a>0?s/p[i-a]: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==o?(f.length=c,u=1,c--):(f.length=c+1,u=p[LOG_BASE-o],f[c]=a>0?mathfloor(s/p[i-a]%p[a])*u:0),n)for(;;){if(0==c){for(o=1,a=f[0];a>=10;a/=10,o++);for(a=f[0]+=u,u=1;a>=10;a/=10,u++);o!=u&&(e.e++,f[0]==BASE&&(f[0]=1));break}if(f[c]+=u,f[c]!=BASE)break;f[c--]=0,u=1}for(o=f.length;0===f[--o];f.pop());}e.e>g?e.c=e.e=null:e.e<m&&(e.c=[e.e=0])}return e}function B(e){var t,r=e.e;return null===r?e.toString():(t=coeffToString(e.c),t=r<=v||r>=d?toExponential(t,r):toFixedPoint(t,r,"0"),e.s<0?"-"+t:t)}return A.clone=clone,A.ROUND_UP=0,A.ROUND_DOWN=1,A.ROUND_CEIL=2,A.ROUND_FLOOR=3,A.ROUND_HALF_UP=4,A.ROUND_HALF_DOWN=5,A.ROUND_HALF_EVEN=6,A.ROUND_HALF_CEIL=7,A.ROUND_HALF_FLOOR=8,A.EUCLID=9,A.config=A.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),h=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),v=r[0],d=r[1]):(intCheck(r,-MAX,MAX,t),v=-(d=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),m=r[0],g=r[1];else{if(intCheck(r,-MAX,MAX,t),!r)throw Error(bignumberError+t+" cannot be zero: "+r);m=-(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);S=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),x=r}}return{DECIMAL_PLACES:h,ROUNDING_MODE:_,EXPONENTIAL_AT:[v,d],RANGE:[m,g],CRYPTO:b,MODULO_MODE:y,POW_PRECISION:w,FORMAT:S,ALPHABET:x}},A.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!A.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-MAX&&i<=MAX&&i===mathfloor(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+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===i&&(null===o||1===o||-1===o))return!0;throw Error(bignumberError+"Invalid BigNumber: "+e)},A.maximum=A.max=function(){return N(arguments,f.lt)},A.minimum=A.min=function(){return N(arguments,f.gt)},A.random=(i=9007199254740992,o=Math.random()*i&2097151?function(){return mathfloor(Math.random()*i)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,a,u=0,s=[],c=new A(p);if(null==e?e=h:intCheck(e,0,MAX),i=mathceil(e/LOG_BASE),b)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));u<i;)(a=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(a%1e14),u+=2);u=i/2}else{if(!crypto.randomBytes)throw b=!1,Error(bignumberError+"crypto unavailable");for(t=crypto.randomBytes(i*=7);u<i;)(a=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(a%1e14),u+=7);u=i/7}if(!b)for(;u<i;)(a=o())<9e15&&(s[u++]=a%1e14);for(i=s[--u],e%=LOG_BASE,i&&e&&(a=POWS_TEN[LOG_BASE-e],s[u]=mathfloor(i/a)*a);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,a=s[0];a>=10;a/=10,u++);u<LOG_BASE&&(n-=LOG_BASE-u)}return c.e=n,c.c=s,c}),A.sum=function(){for(var e=1,t=arguments,r=new A(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 i,o,a=[0],u=0,s=e.length;u<s;){for(o=a.length;o--;a[o]*=t);for(a[0]+=n.indexOf(e.charAt(u++)),i=0;i<a.length;i++)a[i]>r-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}return function(n,i,o,a,u){var s,c,l,f,p,v,d,m,g=n.indexOf("."),b=h,y=_;for(g>=0&&(f=w,w=0,n=n.replace(".",""),v=(m=new A(i)).pow(n.length-g),w=f,m.c=r(toFixedPoint(coeffToString(v.c),v.e,"0"),10,o,e),m.e=m.c.length),l=f=(d=r(n,i,o,u?(s=x,e):(s=e,x))).length;0==d[--f];d.pop());if(!d[0])return s.charAt(0);if(g<0?--l:(v.c=d,v.e=l,v.s=a,d=(v=t(v,m,b,y,o)).c,p=v.r,l=v.e),g=d[c=l+b+1],f=o/2,p=p||c<0||null!=d[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&d[c-1]||y==(v.s<0?8:7)),c<1||!d[0])n=p?toFixedPoint(s.charAt(1),-b,s.charAt(0)):s.charAt(0);else{if(d.length=c,p)for(--o;++d[--c]>o;)d[c]=0,c||(++l,d=[1].concat(d));for(f=d.length;!d[--f];);for(g=0,n="";g<=f;n+=s.charAt(d[g++]));n=toFixedPoint(n,l,s.charAt(0))}return n}}(),t=function(){function e(e,t,r){var n,i,o,a,u=0,s=e.length,c=t%SQRT_BASE,l=t/SQRT_BASE|0;for(e=e.slice();s--;)u=((i=c*(o=e[s]%SQRT_BASE)+(n=l*o+(a=e[s]/SQRT_BASE|0)*c)%SQRT_BASE*SQRT_BASE+u)/r|0)+(n/SQRT_BASE|0)+l*a,e[s]=i%r;return u&&(e=[u].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,o,a,u){var s,c,l,f,p,h,_,v,d,m,g,b,y,w,S,x,E,O=n.s==i.s?1:-1,N=n.c,k=i.c;if(!(N&&N[0]&&k&&k[0]))return new A(n.s&&i.s&&(N?!k||N[0]!=k[0]:k)?N&&0==N[0]||!k?0*O:O/0:NaN);for(d=(v=new A(O)).c=[],O=o+(c=n.e-i.e)+1,u||(u=BASE,c=bitFloor(n.e/LOG_BASE)-bitFloor(i.e/LOG_BASE),O=O/LOG_BASE|0),l=0;k[l]==(N[l]||0);l++);if(k[l]>(N[l]||0)&&c--,O<0)d.push(1),f=!0;else{for(w=N.length,x=k.length,l=0,O+=2,(p=mathfloor(u/(k[0]+1)))>1&&(k=e(k,p,u),N=e(N,p,u),x=k.length,w=N.length),y=x,g=(m=N.slice(0,x)).length;g<x;m[g++]=0);E=k.slice(),E=[0].concat(E),S=k[0],k[1]>=u/2&&S++;do{if(p=0,(s=t(k,m,x,g))<0){if(b=m[0],x!=g&&(b=b*u+(m[1]||0)),(p=mathfloor(b/S))>1)for(p>=u&&(p=u-1),_=(h=e(k,p,u)).length,g=m.length;1==t(h,m,_,g);)p--,r(h,x<_?E:k,_,u),_=h.length,s=1;else 0==p&&(s=p=1),_=(h=k.slice()).length;if(_<g&&(h=[0].concat(h)),r(m,h,g,u),g=m.length,-1==s)for(;t(k,m,x,g)<1;)p++,r(m,x<g?E:k,g,u),g=m.length}else 0===s&&(p++,m=[0]);d[l++]=p,m[0]?m[g++]=N[y]||0:(m=[N[y]],g=1)}while((y++<w||null!=m[0])&&O--);f=null!=m[0],d[0]||d.splice(0,1)}if(u==BASE){for(l=1,O=d[0];O>=10;O/=10,l++);T(v,o+(v.e=l+c*LOG_BASE-1)+1,a,f)}else v.e=c,v.r=+f;return v}}(),a=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,s=/^\.([^.]+)$/,c=/^-?(Infinity|NaN)$/,l=/^\s*\+(?=[\w.])|^\s+|\s+$/g,n=function(e,t,r,n){var i,o=r?t:t.replace(l,"");if(c.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(a,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(u,"$1").replace(s,"0.$1")),t!=o))return new A(o,i);if(A.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 A(this);return e.s<0&&(e.s=1),e},f.comparedTo=function(e,t){return compare(this,new A(e,t))},f.decimalPlaces=f.dp=function(e,t){var r,n,i,o=this;if(null!=e)return intCheck(e,0,MAX),null==t?t=_:intCheck(t,0,8),T(new A(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},f.dividedBy=f.div=function(e,r){return t(this,new A(e,r),h,_)},f.dividedToIntegerBy=f.idiv=function(e,r){return t(this,new A(e,r),0,1)},f.exponentiatedBy=f.pow=function(e,t){var r,n,i,o,a,u,s,c,l=this;if((e=new A(e)).c&&!e.isInteger())throw Error(bignumberError+"Exponent not an integer: "+B(e));if(null!=t&&(t=new A(t)),a=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 A(Math.pow(+B(l),a?e.s*(2-isOdd(e)):+B(e))),t?c.mod(t):c;if(u=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new A(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||a&&l.c[1]>=24e7:l.c[0]<8e13||a&&l.c[0]<=9999975e7)))return o=l.s<0&&isOdd(e)?-0:0,l.e>-1&&(o=1/o),new A(u?1/o:o);w&&(o=mathceil(w/LOG_BASE+2))}for(a?(r=new A(.5),u&&(e.s=1),s=isOdd(e)):s=(i=Math.abs(+B(e)))%2,c=new A(p);;){if(s){if(!(c=c.times(l)).c)break;o?c.c.length>o&&(c.c.length=o):n&&(c=c.mod(t))}if(i){if(0===(i=mathfloor(i/2)))break;s=i%2}else if(T(e=e.times(r),e.e+1,1),e.e>14)s=isOdd(e);else{if(0===(i=+B(e)))break;s=i%2}l=l.times(l),o?l.c&&l.c.length>o&&(l.c.length=o):n&&(l=l.mod(t))}return n?c:(u&&(c=p.div(c)),t?c.mod(t):o?T(c,w,_,undefined):c)},f.integerValue=function(e){var t=new A(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 A(e,t))},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(e,t){return compare(this,new A(e,t))>0},f.isGreaterThanOrEqualTo=f.gte=function(e,t){return 1===(t=compare(this,new A(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 A(e,t))<0},f.isLessThanOrEqualTo=f.lte=function(e,t){return-1===(t=compare(this,new A(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,i,o,a=this,u=a.s;if(t=(e=new A(e,t)).s,!u||!t)return new A(NaN);if(u!=t)return e.s=-t,a.plus(e);var s=a.e/LOG_BASE,c=e.e/LOG_BASE,l=a.c,f=e.c;if(!s||!c){if(!l||!f)return l?(e.s=-t,e):new A(f?a:NaN);if(!l[0]||!f[0])return f[0]?(e.s=-t,e):new A(l[0]?a:3==_?-0:0)}if(s=bitFloor(s),c=bitFloor(c),l=l.slice(),u=s-c){for((o=u<0)?(u=-u,i=l):(c=s,i=f),i.reverse(),t=u;t--;i.push(0));i.reverse()}else for(n=(o=(u=l.length)<(t=f.length))?u:t,u=t=0;t<n;t++)if(l[t]!=f[t]){o=l[t]<f[t];break}if(o&&(i=l,l=f,f=i,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]?k(e,l,c):(e.s=3==_?-1:1,e.c=[e.e=0],e)},f.modulo=f.mod=function(e,r){var n,i,o=this;return e=new A(e,r),!o.c||!e.s||e.c&&!e.c[0]?new A(NaN):!e.c||o.c&&!o.c[0]?new A(o):(9==y?(i=e.s,e.s=1,n=t(o,e,0,3),e.s=i,n.s*=i):n=t(o,e,0,y),(e=o.minus(n.times(e))).c[0]||1!=y||(e.s=o.s),e)},f.multipliedBy=f.times=function(e,t){var r,n,i,o,a,u,s,c,l,f,p,h,_,v,d,m=this,g=m.c,b=(e=new A(e,t)).c;if(!(g&&b&&g[0]&&b[0]))return!m.s||!e.s||g&&!g[0]&&!b||b&&!b[0]&&!g?e.c=e.e=e.s=null:(e.s*=m.s,g&&b?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=bitFloor(m.e/LOG_BASE)+bitFloor(e.e/LOG_BASE),e.s*=m.s,(s=g.length)<(f=b.length)&&(_=g,g=b,b=_,i=s,s=f,f=i),i=s+f,_=[];i--;_.push(0));for(v=BASE,d=SQRT_BASE,i=f;--i>=0;){for(r=0,p=b[i]%d,h=b[i]/d|0,o=i+(a=s);o>i;)r=((c=p*(c=g[--a]%d)+(u=h*c+(l=g[a]/d|0)*p)%d*d+_[o]+r)/v|0)+(u/d|0)+h*l,_[o--]=c%v;_[o]=r}return r?++n:_.splice(0,1),k(e,_,n)},f.negated=function(){var e=new A(this);return e.s=-e.s||null,e},f.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new A(e,t)).s,!i||!t)return new A(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/LOG_BASE,a=e.e/LOG_BASE,u=n.c,s=e.c;if(!o||!a){if(!u||!s)return new A(i/0);if(!u[0]||!s[0])return s[0]?e:new A(u[0]?n:0*i)}if(o=bitFloor(o),a=bitFloor(a),u=u.slice(),i=o-a){for(i>0?(a=o,r=s):(i=-i,r=u),r.reverse();i--;r.push(0));r.reverse()}for((i=u.length)-(t=s.length)<0&&(r=s,s=u,u=r,t=i),i=0;t;)i=(u[--t]=u[t]+s[t]+i)/BASE|0,u[t]=BASE===u[t]?0:u[t]%BASE;return i&&(u=[i].concat(u),++a),k(e,u,a)},f.precision=f.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return intCheck(e,1,MAX),null==t?t=_:intCheck(t,0,8),T(new A(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*LOG_BASE+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.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,i,o,a=this,u=a.c,s=a.s,c=a.e,l=h+4,f=new A("0.5");if(1!==s||!u||!u[0])return new A(!s||s<0&&(!u||u[0])?NaN:u?a:1/0);if(0==(s=Math.sqrt(+B(a)))||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 A(r=s==1/0?"5e"+c:(r=s.toExponential()).slice(0,r.indexOf("e")+1)+c)):n=new A(s+""),n.c[0])for((s=(c=n.e)+l)<3&&(s=0);;)if(o=n,n=f.times(o.plus(t(a,o,l,1))),coeffToString(o.c).slice(0,s)===(r=coeffToString(n.c)).slice(0,s)){if(n.e<c&&--s,"9999"!=(r=r.slice(s-3,s+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(T(n,n.e+h+2,1),e=!n.times(n).eq(a));break}if(!i&&(T(o,o.e+h+2,0),o.times(o).eq(a))){n=o;break}l+=4,s+=4,i=1}return T(n,n.e+h+1,_,e)},f.toExponential=function(e,t){return null!=e&&(intCheck(e,0,MAX),e++),O(this,e,t,1)},f.toFixed=function(e,t){return null!=e&&(intCheck(e,0,MAX),e=e+this.e+1),O(this,e,t)},f.toFormat=function(e,t,r){var n,i=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=i.toFixed(e,t),i.c){var o,a=n.split("."),u=+r.groupSize,s=+r.secondaryGroupSize,c=r.groupSeparator||"",l=a[0],f=a[1],p=i.s<0,h=p?l.slice(1):l,_=h.length;if(s&&(o=u,u=s,s=o,_-=o),u>0&&_>0){for(o=_%u||u,l=h.substr(0,o);o<_;o+=u)l+=c+h.substr(o,u);s>0&&(l+=c+h.slice(o)),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,i,o,a,u,s,c,l,f,h,v,d=this,m=d.c;if(null!=e&&(!(s=new A(e)).isInteger()&&(s.c||1!==s.s)||s.lt(p)))throw Error(bignumberError+"Argument "+(s.isInteger()?"out of range: ":"not an integer: ")+B(s));if(!m)return new A(d);for(r=new A(p),l=n=new A(p),i=c=new A(p),v=coeffToString(m),a=r.e=v.length-d.e-1,r.c[0]=POWS_TEN[(u=a%LOG_BASE)<0?LOG_BASE+u:u],e=!e||s.comparedTo(r)>0?a>0?r:l:s,u=g,g=1/0,s=new A(v),c.c[0]=0;f=t(s,r,0,1),1!=(o=n.plus(f.times(i))).comparedTo(e);)n=i,i=o,l=c.plus(f.times(o=l)),c=o,r=s.minus(f.times(o=r)),s=o;return o=t(e.minus(n),i,0,1),c=c.plus(o.times(l)),n=n.plus(o.times(i)),c.s=l.s=d.s,h=t(l,i,a*=2,_).minus(d).abs().comparedTo(t(c,n,a,_).minus(d).abs())<1?[l,i]:[c,n],g=u,h},f.toNumber=function(){return+B(this)},f.toPrecision=function(e,t){return null!=e&&intCheck(e,1,MAX),O(this,e,t,2)},f.toString=function(e){var t,n=this,i=n.s,o=n.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=v||o>=d?toExponential(coeffToString(n.c),o):toFixedPoint(coeffToString(n.c),o,"0"):10===e&&E?t=toFixedPoint(coeffToString((n=T(new A(n),h+o+1,_)).c),n.e,"0"):(intCheck(e,2,x.length,"Base"),t=r(toFixedPoint(coeffToString(n.c),o,"0"),10,e,i,!0)),i<0&&n.c[0]&&(t="-"+t)),t},f.valueOf=f.toJSON=function(){return B(this)},f._isBigNumber=!0,f[Symbol.toStringTag]="BigNumber",f[Symbol.for("nodejs.util.inspect.custom")]=f.valueOf,null!=e&&A.set(e),A}function bitFloor(e){var t=0|e;return e>0||e===t?t:t-1}function coeffToString(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=LOG_BASE-t.length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function compare(e,t){var r,n,i=e.c,o=t.c,a=e.s,u=t.s,s=e.e,c=t.e;if(!a||!u)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-u:a;if(a!=u)return a;if(r=a<0,n=s==c,!i||!o)return n?0:!i^r?1:-1;if(!n)return s>c^r?1:-1;for(u=(s=i.length)<(c=o.length)?s:c,a=0;a<u;a++)if(i[a]!=o[a])return i[a]>o[a]^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,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}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 i=BigNumber(r).toExponential();return[n.sign&&!i.startsWith("-")?"+"+i:i,n]}if(n.fraction){var o=BigNumber(r).toFraction().map((function(e){return e.toFixed()})).join("/");return[n.sign&&!o.startsWith("-")?"+"+o:o,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 close_important_push(){}function open_important_push(){}function open_debug(){}function close_debug(){}function calc_wrap(e,t){var r={_error:"-"};return["string","number"].includes(_typeof(e))?void 0===t?/[a-zA-Z$_]/.test(e.toString())?function(t){return Array.isArray(t)?t.unshift(r):t=_objectSpread2(_objectSpread2({},r),t),calc(e,t)}:calc(e):(Array.isArray(t)?t.unshift(r):t=_objectSpread2(_objectSpread2({},r),t),calc(e,t)):(Array.isArray(e)?e.unshift(r):e=_objectSpread2(_objectSpread2({},r),e),function(t){return calc(t,e)})}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$2(e,t,r){if(Number.isNaN(Number(t)))if("-"===t||"+"===t)0===e.length||"operator"===e.at(-1).type||"("===e.at(-1).value?e.push({type:"number",value:t,real_value:t,has_unit:!1}):e.push({type:"operator",value:t});else if(operator.has(t))e.push({type:"operator",value:t});else if(r._unit&&/^[+-]?\d/.test(t)){var n,i=split_unit_num(t),o=i.num,a=i.unit;if(void 0===a)e.push({type:"number",value:o,real_value:o,has_unit:!1});else r.has_unit=!0,null!==(n=r.unit_str)&&void 0!==n||(r.unit_str=a),e.push({type:"number",value:o,real_value:o,has_unit:!0,unit:a})}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){for(var n,i=0,o=0,a=e.length,u=[],s={has_var:!1,has_unit:!1,unit_str:void 0,_unit:r,fill_data:t};o<a;)" "===(n=e[o])?(o>i&&push_token$2(u,e.slice(i,o),s),i=o+1):"("===n?(u.push({type:state_bracket,value:"("}),i=o+1):")"===n&&(o>i&&push_token$2(u,e.slice(i,o),s),u.push({type:state_bracket,value:")"}),i=o+1),o++;return o>i&&push_token$2(u,e.slice(i,o),s),u.has_var=s.has_var,u.has_unit=s.has_unit,u.unit=s.unit_str,u}function compute(e,t,r){if(void 0===e||void 0===t)throw new Error("无效的操作数对:v1:".concat(e,", v2:").concat(t));var n;switch(r){case"+":n=new BigNumber(e).plus(t);break;case"-":n=new BigNumber(e).minus(t);break;case"*":n=new BigNumber(e).times(t);break;case"/":n=new BigNumber(e).div(t);break;case"%":n=new BigNumber(e).mod(t);break;case"**":n=new BigNumber(e).pow(t);break;case"//":n=new BigNumber(e).idiv(t)}return n}var operator_map={"+":0,"-":0,"*":1,"/":1,"%":1,"//":1,"**":2};function eval_tokens(e){if(1===e.length){var t=e[0];if("number"===t.type||"var"===t.type)return t.real_value;throw new Error("错误的表达式:".concat(t.value))}for(var r,n,i=[],o=[],a=0,u=e.length;a<u;a++)if("number"!==(r=e[a]).type&&"var"!==r.type)if("operator"!==r.type)if("("!==r.value){if(")"===r.value)for(var s=void 0;s=i.pop();){if("("===s){var c=o.at(-2);if("-"===c){var l=o.pop();o.pop(),o.push(BigNumber.isBigNumber(l)?l.negated():new BigNumber(l).negated())}else if("+"===c){var f=o.pop();o.pop(),o.push(f)}break}var p=o.pop(),h=o.pop();o.push(compute(h,p,s))}}else i.push("(");else{var _=i.at(-1);if("("===_){i.push(r.value);continue}var v=operator_map[r.value];if(!i.length){i.push(r.value);continue}if(v<operator_map[_])for(var d=void 0;d=i.pop();){if("("===d){i.push("(");break}var m=o.pop(),g=o.pop();o.push(compute(g,m,d))}else if(v===operator_map[_]){if("**"===r.value){i.push(r.value);continue}for(var b=void 0;b=i.pop();){if("("===b){i.push("(");break}if(operator_map[b]<v){i.push(b);break}var y=o.pop(),w=o.pop();o.push(compute(w,y,b))}}i.push(r.value)}else o.push(r.real_value);for(;n=i.pop();){var S=o.pop(),x=o.pop();o.push(compute(x,S,n))}if(1!==o.length)throw new Error("可能出现了错误的计算式");return e.has_var||(e.calc_result=o[0]),o[0]}function push_token$1(e,t,r,n,i){t===state_var?(i.has_var=!0,e.push({type:t,value:r,real_value:get_real_value(i.fill_data,r)})):e.push({type:t,value:r}),n.prev=n.curr,i.state=state_initial}function fmt_tokenizer(e,t){for(var r,n={prev:0,curr:0},i=e.length,o={state:state_initial,fill_data:t,has_var:!1},a=[];n.curr<i;)switch(r=e[n.curr],o.state){case state_initial:if(" "===r)n.curr++,n.prev=n.curr;else if("<>=".includes(r))o.state=state_symbol,n.curr++;else if(","===r)n.curr++,push_token$1(a,state_comma,",",n,o);else if(var_char.includes(r))o.state=state_var,n.curr++;else if(number_char.includes(r))o.state=state_number,n.curr++;else if("+"===r)n.curr++,push_token$1(a,state_plus$1,"+",n,o);else if("~"===r)n.curr++,o.state=state_round;else if("%"===r)n.curr++,push_token$1(a,state_percent,"%",n,o);else if("/"===r)n.curr++,push_token$1(a,state_fraction,"/",n,o);else if("!"===r)if(o.state=state_initial,n.curr++,"n"===e[n.curr])n.curr++,push_token$1(a,state_to_number,"!n",n,o);else if("u"===e[n.curr])n.curr++,push_token$1(a,state_to_number_string,"!u",n,o);else{if("e"!==e[n.curr])throw new Error("无法识别的!模式字符:".concat(e[n.curr]));n.curr++,push_token$1(a,state_scientific,"!e",n,o)}else n.curr++,n.prev=n.curr;break;case state_symbol:"="===r&&n.curr++,push_token$1(a,state_symbol,e.slice(n.prev,n.curr),n,o);break;case state_number:number_char.includes(r)?n.curr++:push_token$1(a,state_number,e.slice(n.prev,n.curr),n,o);break;case state_var:var_members_char.includes(r)?n.curr++:push_token$1(a,state_var,e.slice(n.prev,n.curr),n,o);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$1(a,state_round,e.slice(n.prev,n.curr),n,o);break;default:throw new Error("错误的fmt分词器状态")}return n.prev<n.curr&&push_token$1(a,o.state,e.slice(n.prev,n.curr),n,o),a.has_var=o.has_var,a}var symbol_set=new Set(["<",">","=",">=","<="]),rand_set=new Set(["~+","~-","~5","~6"]);function push_token(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){for(var r,n=0,i=e.length,o={fill_data:t,has_var:!1},a=0,u=[];n<i;)" "===(r=e[n])?(n>a&&push_token(u,e.slice(a,n),o),a=n+1):"<>=".includes(r)&&("="===e[n+1]?(u.push({type:state_symbol,value:r+"="}),a=1+ ++n):(u.push({type:state_symbol,value:r}),a=n+1)),n++;return a<n&&push_token(u,e.slice(a,n),o),u.has_var=o.has_var,u}function calc(e,t){var r=find_value(t,"_error");try{var n,i,o,a,u,s,c,l=parse_args(e,t),f=null!==(n=l._unit)&&void 0!==n&&n,p=null!==(i=l._mode)&&void 0!==i?i:"normal",h="space"===p||"space-all"===p?tokenizer_space(l.expr,l.fill_data,f):tokenizer(l.expr,l.fill_data,f),_=eval_tokens(h),v=BigNumber.isBigNumber(_)?_:new BigNumber(_);if("space-all"===p?(s=""===l.fmt_expr||void 0===l.fmt_expr?void 0:fmt_tokenizer_space(l.fmt_expr,l.fill_data),c=""===l._fmt||void 0===l._fmt?void 0:fmt_tokenizer_space(l._fmt,l.fill_data)):(s=""===l.fmt_expr||void 0===l.fmt_expr?void 0:fmt_tokenizer(l.fmt_expr,l.fill_data),c=""===l._fmt||void 0===l._fmt?void 0:fmt_tokenizer(l._fmt,l.fill_data)),void 0===s?void 0!==c&&(s=c):void 0!==c&&(s=[].concat(_toConsumableArray(c),_toConsumableArray(s))),void 0===s)v=v.toFixed();else{var d=_slicedToArray(format(v,s),2);v=d[0],u=d[1]}if("Infinity"===v||void 0===v)throw new Error("计算错误可能是非法的计算式");return!h.has_unit||null!==(o=u)&&void 0!==o&&o.to_number||null!==(a=u)&&void 0!==a&&a.to_number_string||(v+=h.unit),v}catch(e){if(void 0===r)throw e;return r}}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(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(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(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(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(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(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(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()}return exports.calc=calc,exports.calc_util=calc_util,exports.calc_wrap=calc_wrap,exports.div=div,exports.fmt=fmt,exports.idiv=idiv,exports.mod=mod,exports.mul=mul,exports.parse_thousands=parse_thousands,exports.plus=plus,exports.pow=pow,exports.sub=sub,exports.version=version,exports}({});
|
package/calc.d.ts
CHANGED
|
@@ -74,7 +74,6 @@ type CalcConfig<Fmt extends string, Err> =
|
|
|
74
74
|
_unit: boolean,
|
|
75
75
|
_fmt: Fmt,
|
|
76
76
|
_mode: "space" | "space-all" | "normal", // space 只会影响表达式部分 space_all 也会影响 fmt 部分
|
|
77
|
-
_memo: boolean,
|
|
78
77
|
[Prop: string]: any;
|
|
79
78
|
}>;
|
|
80
79
|
|
|
@@ -106,10 +105,7 @@ declare const calc_util: {
|
|
|
106
105
|
|
|
107
106
|
export declare const calc: Calc;
|
|
108
107
|
export declare const fmt: Calc;
|
|
109
|
-
export declare const calc_memo: Calc;
|
|
110
|
-
export declare const fmt_memo: Calc;
|
|
111
108
|
export declare const calc_wrap: CalcWrap;
|
|
112
|
-
export declare const calc_wrap_memo: CalcWrap;
|
|
113
109
|
declare const version: string;
|
|
114
110
|
|
|
115
111
|
export declare const parse_thousands: (str: string) => string;
|
|
@@ -120,11 +116,3 @@ export declare const mul: <const T extends "number" | "string" = "number">(a: nu
|
|
|
120
116
|
export declare const div: <const T extends "number" | "string" = "number">(a: number|string, b: number|string, type: T) => T extends "number" ? number : string;
|
|
121
117
|
export declare const pow: <const T extends "number" | "string" = "number">(a: number|string, b: number|string, type: T) => T extends "number" ? number : string;
|
|
122
118
|
export declare const mod: <const T extends "number" | "string" = "number">(a: number|string, b: number|string, type: T) => T extends "number" ? number : string;
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
export declare const plus_memo: <const T extends "number" | "string" = "number">(a: number|string, b: number|string, type: T) => T extends "number" ? number : string;
|
|
126
|
-
export declare const sub_memo: <const T extends "number" | "string" = "number">(a: number|string, b: number|string, type: T) => T extends "number" ? number : string;
|
|
127
|
-
export declare const mul_memo: <const T extends "number" | "string" = "number">(a: number|string, b: number|string, type: T) => T extends "number" ? number : string;
|
|
128
|
-
export declare const div_memo: <const T extends "number" | "string" = "number">(a: number|string, b: number|string, type: T) => T extends "number" ? number : string;
|
|
129
|
-
export declare const pow_memo: <const T extends "number" | "string" = "number">(a: number|string, b: number|string, type: T) => T extends "number" ? number : string;
|
|
130
|
-
export declare const mod_memo: <const T extends "number" | "string" = "number">(a: number|string, b: number|string, type: T) => T extends "number" ? number : string;
|
package/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";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=[],c=!0,s=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)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 c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function s(e,t,r,o){var a=t&&t.prototype instanceof p?t:p,i=Object.create(a.prototype),u=new A(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=s;var f={};function p(){}function _(){}function h(){}var m={};c(m,a,(function(){return this}));var v=Object.getPrototypeOf,d=v&&v(v(O([])));d&&d!==t&&r.call(d,a)&&(m=d);var b=h.prototype=p.prototype=Object.create(m);function g(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){function o(n,a,i,u){var c=l(e[n],e,a);if("throw"!==c.type){var s=c.arg,f=s.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){s.value=e,i(s)}),(function(e){return o("throw",e,i,u)}))}u(c.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 c=l(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.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 A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function O(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(b,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:_,configurable:!0}),_.displayName=c(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,c(e,u,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},g(y.prototype),c(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(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},g(b),c(b,u,"Generator"),c(b,a,(function(){return this})),c(b,"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=O,A.prototype={constructor:A,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"),c=r.call(a,"finallyLoc");if(u&&c){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(!c)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:O(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),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).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.20240522";function decimal_round(e,t,r,n,o){var a=e,i=t,u=t.length,c={"~-":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,c="<"===r?n-1:n,s=+t[c],l=t.slice(+c+1,t.length);l=""===l?0:parseInt(l),o=0===c?+e[e.length-1]:+t[c-1],i=t.slice(0,c),(s>=6||5===s&&l>0||5===s&&o%2!=0)&&(i=(+"9".concat(i)+1).toString().slice(1)).length>c&&(i=i.slice(1,i.length),a=(+a+1).toString())}}};return"<="===r?u<=n?i=t.replace(/0*$/,""):(c[o]&&c[o](),i=i.replace(/0+$/,"")):"<"===r?u<n?i=t.replace(/0*$/,""):(c[o]&&c[o](),i=i.replace(/0+$/,"")):"="===r?u<n?i=t+"0".repeat(n-u):u>n&&c[o]&&c[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 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",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,c=i.unit;if(e.real_value=u,void 0!==c)o=!0,null!==(a=n)&&void 0!==a||(n=c),e.unit=c}else e.real_value=get_real_value(t,e.value);else if(e.type===state_number){var s;if(e.has_unit)o=!0,null!==(s=n)&&void 0!==s||(n=e.unit)}})),e.has_unit=o,e.unit=n}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 integer_thousands(e){for(var t=e.length,r="";t>0;)r=e.substring(t-3,t)+(""!==r?",":"")+r,t-=3;return r}function parse_thousands(e){var t=e.split("."),r=t[0];return"-"===r[0]?t[0]="-"+integer_thousands(r.slice(1)):t[0]=integer_thousands(r),t.join(".")}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++}}function parse_args(e,t,r,n){var o="",a={origin_expr:e,origin_fill_data:t,expr:"",fmt_tokens:void 0,options:void 0,fill_data:void 0,_unit:void 0,_mode:void 0,_fmt:void 0};null!=t&&(a.options=t,Array.isArray(t)?a.fill_data=t:Array.isArray(t._fill_data)?a.fill_data=[t].concat(_toConsumableArray(t._fill_data)):void 0===t._fill_data?a.fill_data=[t]:a.fill_data=[t,t._fill_data]);var i=a._mode=find_value(t,"_mode");a._unit=find_value(t,"_unit",!1);var u=a._fmt=find_value(t,"_fmt");if("string"==typeof e){if(o=e,""===e.trim()||e.includes("NaN"))throw new Error("非法的表达式:".concat(e))}else{if("number"!=typeof e)throw new Error("错误的第一个参数类型: ".concat(e," 类型为:").concat(_typeof(e)));o=e.toString()}var c=o.split("|");if(a.expr=c[0],c.length>1){var s=c[1];""!==s.trim()&&(a.fmt_tokens="space-all"===i?n(s,a.fill_data):r(s,a.fill_data))}if(void 0!==t&&void 0!==u){var l=[];if(l="space-all"===i?n(u,a.fill_data):r(u,a.fill_data),void 0===a.fmt_tokens)a.fmt_tokens=l;else{var f=a.fmt_tokens.map((function(e){return e.type}));l.forEach((function(e){f.includes(e.type)||a.fmt_tokens.push(e)}))}}return a}function push_token$3(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),c=get_real_value(t.fill_data,u);if(t._unit){var s,l=split_unit_num(c),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!==(s=t.unit_str)&&void 0!==s||(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:c,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){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$3(i,o):o.cur_index++:push_token$3(i,o);break;case state_operator:var c=e[o.cur_index-1];"*"===n&&"*"===c?(o.cur_index++,i.push({type:state_operator,value:"**"}),o.prev_index=o.cur_index):"/"===n&&"/"===c?(o.cur_index++,i.push({type:state_operator,value:"//"}),o.prev_index=o.cur_index):(i.push({type:state_operator,value:c}),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$3(i,o);break;case state_scientific:if(number_char.includes(n))o.cur_index++;else if("+-".includes(n)){var s=o.prev_index;"+-".includes(e[s])&&(s+=1);var l=e.slice(s,o.cur_index),f=l.at(-1);l.includes(n)||"e"!==f?push_token$3(i,o):o.cur_index++}else r&&-1==="*/+-() ".indexOf(n)?o.cur_index++:push_token$3(i,o);break;default:throw new Error("字符扫描状态错误")}return o.prev_index<o.cur_index&&push_token$3(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,c,s,l,f=A.prototype={constructor:A,toString:null,valueOf:null},p=new A(1),_=20,h=4,m=-7,v=21,d=-1e7,b=1e7,g=!1,y=1,w=0,x={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},S="0123456789abcdefghijklmnopqrstuvwxyz",E=!0;function A(e,t){var o,a,i,u,c,s,l,f,p=this;if(!(p instanceof A))return new A(e,t);if(null==t){if(e&&!0===e._isBigNumber)return p.s=e.s,void(!e.c||e.e>b?p.c=p.e=null:e.e<d?p.c=[p.e=0]:(p.e=e.e,p.c=e.c.slice()));if((s="number"==typeof e)&&0*e==0){if(p.s=1/e<0?(e=-e,-1):1,e===~~e){for(u=0,c=e;c>=10;c/=10,u++);return void(u>b?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,s);p.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(u=f.indexOf("."))>-1&&(f=f.replace(".","")),(c=f.search(/e/i))>0?(u<0&&(u=c),u+=+f.slice(c+1),f=f.substring(0,c)):u<0&&(u=f.length)}else{if(intCheck(t,2,S.length,"Base"),10==t&&E)return T(p=new A(e),_+p.e+1,h);if(f=String(e),s="number"==typeof e){if(0*e!=0)return n(p,f,s,t);if(p.s=1/e<0?(f=f.slice(1),-1):1,A.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=c=0,l=f.length;c<l;c++)if(o.indexOf(a=f.charAt(c))<0){if("."==a){if(c>u){u=l;continue}}else if(!i&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){i=!0,c=-1,u=0;continue}return n(p,String(e),s,t)}s=!1,(u=(f=r(f,t,10,p.s)).indexOf("."))>-1?f=f.replace(".",""):u=f.length}for(c=0;48===f.charCodeAt(c);c++);for(l=f.length;48===f.charCodeAt(--l););if(f=f.slice(c,++l)){if(l-=c,s&&A.DEBUG&&l>15&&(e>MAX_SAFE_INTEGER||e!==mathfloor(e)))throw Error(tooManyDigits+p.s*e);if((u=u-c-1)>b)p.c=p.e=null;else if(u<d)p.c=[p.e=0];else{if(p.e=u,p.c=[],c=(u+1)%LOG_BASE,u<0&&(c+=LOG_BASE),c<l){for(c&&p.c.push(+f.slice(0,c)),l-=LOG_BASE;c<l;)p.c.push(+f.slice(c,c+=LOG_BASE));c=LOG_BASE-(f=f.slice(c)).length}else c-=l;for(;c--;f+="0");p.c.push(+f)}}else p.c=[p.e=0]}function O(e,t,r,n){var o,a,i,u,c;if(null==r?r=h:intCheck(r,0,8),!e.c)return e.toString();if(o=e.c[0],i=e.e,null==t)c=coeffToString(e.c),c=1==n||2==n&&(i<=m||i>=v)?toExponential(c,i):toFixedPoint(c,i,"0");else if(a=(e=T(new A(e),t,r)).e,u=(c=coeffToString(e.c)).length,1==n||2==n&&(t<=a||a<=m)){for(;u<t;c+="0",u++);c=toExponential(c,a)}else if(t-=i,c=toFixedPoint(c,a,"0"),a+1>u){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=a-u)>0)for(a+1==u&&(c+=".");t--;c+="0");return e.s<0&&o?"-"+c:c}function k(e,t){for(var r,n=1,o=new A(e[0]);n<e.length;n++){if(!(r=new A(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)>b?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,c,s,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=(c=f[s=0])/p[o-i-1]%10|0;else if((s=mathceil((a+1)/LOG_BASE))>=f.length){if(!n)break e;for(;f.length<=s;f.push(0));c=l=0,o=1,i=(a%=LOG_BASE)-LOG_BASE+1}else{for(c=u=f[s],o=1;u>=10;u/=10,o++);l=(i=(a%=LOG_BASE)-LOG_BASE+o)<0?0:c/p[o-i-1]%10|0}if(n=n||t<0||null!=f[s+1]||(i<0?c:c%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?c/p[o-i]:0:f[s-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=s,u=1,s--):(f.length=s+1,u=p[LOG_BASE-a],f[s]=i>0?mathfloor(c/p[o-i]%p[i])*u:0),n)for(;;){if(0==s){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[s]+=u,f[s]!=BASE)break;f[s--]=0,u=1}for(a=f.length;0===f[--a];f.pop());}e.e>b?e.c=e.e=null:e.e<d&&(e.c=[e.e=0])}return e}function B(e){var t,r=e.e;return null===r?e.toString():(t=coeffToString(e.c),t=r<=m||r>=v?toExponential(t,r):toFixedPoint(t,r,"0"),e.s<0?"-"+t:t)}return A.clone=clone,A.ROUND_UP=0,A.ROUND_DOWN=1,A.ROUND_CEIL=2,A.ROUND_FLOOR=3,A.ROUND_HALF_UP=4,A.ROUND_HALF_DOWN=5,A.ROUND_HALF_EVEN=6,A.ROUND_HALF_CEIL=7,A.ROUND_HALF_FLOOR=8,A.EUCLID=9,A.config=A.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),m=r[0],v=r[1]):(intCheck(r,-MAX,MAX,t),m=-(v=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],b=r[1];else{if(intCheck(r,-MAX,MAX,t),!r)throw Error(bignumberError+t+" cannot be zero: "+r);d=-(b=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 g=!r,Error(bignumberError+"crypto unavailable");g=r}else g=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:[m,v],RANGE:[d,b],CRYPTO:g,MODULO_MODE:y,POW_PRECISION:w,FORMAT:x,ALPHABET:S}},A.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!A.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)},A.maximum=A.max=function(){return k(arguments,f.lt)},A.minimum=A.min=function(){return k(arguments,f.gt)},A.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,c=[],s=new A(p);if(null==e?e=_:intCheck(e,0,MAX),o=mathceil(e/LOG_BASE),g)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]):(c.push(i%1e14),u+=2);u=o/2}else{if(!crypto.randomBytes)throw g=!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):(c.push(i%1e14),u+=7);u=o/7}if(!g)for(;u<o;)(i=a())<9e15&&(c[u++]=i%1e14);for(o=c[--u],e%=LOG_BASE,o&&e&&(i=POWS_TEN[LOG_BASE-e],c[u]=mathfloor(o/i)*i);0===c[u];c.pop(),u--);if(u<0)c=[n=0];else{for(n=-1;0===c[0];c.splice(0,1),n-=LOG_BASE);for(u=1,i=c[0];i>=10;i/=10,u++);u<LOG_BASE&&(n-=LOG_BASE-u)}return s.e=n,s.c=c,s}),A.sum=function(){for(var e=1,t=arguments,r=new A(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,c=e.length;u<c;){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 c,s,l,f,p,m,v,d,b=n.indexOf("."),g=_,y=h;for(b>=0&&(f=w,w=0,n=n.replace(".",""),m=(d=new A(o)).pow(n.length-b),w=f,d.c=r(toFixedPoint(coeffToString(m.c),m.e,"0"),10,a,e),d.e=d.c.length),l=f=(v=r(n,o,a,u?(c=S,e):(c=e,S))).length;0==v[--f];v.pop());if(!v[0])return c.charAt(0);if(b<0?--l:(m.c=v,m.e=l,m.s=i,v=(m=t(m,d,g,y,a)).c,p=m.r,l=m.e),b=v[s=l+g+1],f=a/2,p=p||s<0||null!=v[s+1],p=y<4?(null!=b||p)&&(0==y||y==(m.s<0?3:2)):b>f||b==f&&(4==y||p||6==y&&1&v[s-1]||y==(m.s<0?8:7)),s<1||!v[0])n=p?toFixedPoint(c.charAt(1),-g,c.charAt(0)):c.charAt(0);else{if(v.length=s,p)for(--a;++v[--s]>a;)v[s]=0,s||(++l,v=[1].concat(v));for(f=v.length;!v[--f];);for(b=0,n="";b<=f;n+=c.charAt(v[b++]));n=toFixedPoint(n,l,c.charAt(0))}return n}}(),t=function(){function e(e,t,r){var n,o,a,i,u=0,c=e.length,s=t%SQRT_BASE,l=t/SQRT_BASE|0;for(e=e.slice();c--;)u=((o=s*(a=e[c]%SQRT_BASE)+(n=l*a+(i=e[c]/SQRT_BASE|0)*s)%SQRT_BASE*SQRT_BASE+u)/r|0)+(n/SQRT_BASE|0)+l*i,e[c]=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 c,s,l,f,p,_,h,m,v,d,b,g,y,w,x,S,E,O=n.s==o.s?1:-1,k=n.c,N=o.c;if(!(k&&k[0]&&N&&N[0]))return new A(n.s&&o.s&&(k?!N||k[0]!=N[0]:N)?k&&0==k[0]||!N?0*O:O/0:NaN);for(v=(m=new A(O)).c=[],O=a+(s=n.e-o.e)+1,u||(u=BASE,s=bitFloor(n.e/LOG_BASE)-bitFloor(o.e/LOG_BASE),O=O/LOG_BASE|0),l=0;N[l]==(k[l]||0);l++);if(N[l]>(k[l]||0)&&s--,O<0)v.push(1),f=!0;else{for(w=k.length,S=N.length,l=0,O+=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,b=(d=k.slice(0,S)).length;b<S;d[b++]=0);E=N.slice(),E=[0].concat(E),x=N[0],N[1]>=u/2&&x++;do{if(p=0,(c=t(N,d,S,b))<0){if(g=d[0],S!=b&&(g=g*u+(d[1]||0)),(p=mathfloor(g/x))>1)for(p>=u&&(p=u-1),h=(_=e(N,p,u)).length,b=d.length;1==t(_,d,h,b);)p--,r(_,S<h?E:N,h,u),h=_.length,c=1;else 0==p&&(c=p=1),h=(_=N.slice()).length;if(h<b&&(_=[0].concat(_)),r(d,_,b,u),b=d.length,-1==c)for(;t(N,d,S,b)<1;)p++,r(d,S<b?E:N,b,u),b=d.length}else 0===c&&(p++,d=[0]);v[l++]=p,d[0]?d[b++]=k[y]||0:(d=[k[y]],b=1)}while((y++<w||null!=d[0])&&O--);f=null!=d[0],v[0]||v.splice(0,1)}if(u==BASE){for(l=1,O=v[0];O>=10;O/=10,l++);T(m,a+(m.e=l+s*LOG_BASE-1)+1,i,f)}else m.e=s,m.r=+f;return m}}(),i=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,c=/^\.([^.]+)$/,s=/^-?(Infinity|NaN)$/,l=/^\s*\+(?=[\w.])|^\s+|\s+$/g,n=function(e,t,r,n){var o,a=r?t:t.replace(l,"");if(s.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(c,"0.$1")),t!=a))return new A(a,o);if(A.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 A(this);return e.s<0&&(e.s=1),e},f.comparedTo=function(e,t){return compare(this,new A(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 A(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 A(e,r),_,h)},f.dividedToIntegerBy=f.idiv=function(e,r){return t(this,new A(e,r),0,1)},f.exponentiatedBy=f.pow=function(e,t){var r,n,o,a,i,u,c,s,l=this;if((e=new A(e)).c&&!e.isInteger())throw Error(bignumberError+"Exponent not an integer: "+B(e));if(null!=t&&(t=new A(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 s=new A(Math.pow(+B(l),i?e.s*(2-isOdd(e)):+B(e))),t?s.mod(t):s;if(u=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new A(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 A(u?1/a:a);w&&(a=mathceil(w/LOG_BASE+2))}for(i?(r=new A(.5),u&&(e.s=1),c=isOdd(e)):c=(o=Math.abs(+B(e)))%2,s=new A(p);;){if(c){if(!(s=s.times(l)).c)break;a?s.c.length>a&&(s.c.length=a):n&&(s=s.mod(t))}if(o){if(0===(o=mathfloor(o/2)))break;c=o%2}else if(T(e=e.times(r),e.e+1,1),e.e>14)c=isOdd(e);else{if(0===(o=+B(e)))break;c=o%2}l=l.times(l),a?l.c&&l.c.length>a&&(l.c.length=a):n&&(l=l.mod(t))}return n?s:(u&&(s=p.div(s)),t?s.mod(t):a?T(s,w,h,undefined):s)},f.integerValue=function(e){var t=new A(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 A(e,t))},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(e,t){return compare(this,new A(e,t))>0},f.isGreaterThanOrEqualTo=f.gte=function(e,t){return 1===(t=compare(this,new A(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 A(e,t))<0},f.isLessThanOrEqualTo=f.lte=function(e,t){return-1===(t=compare(this,new A(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 A(e,t)).s,!u||!t)return new A(NaN);if(u!=t)return e.s=-t,i.plus(e);var c=i.e/LOG_BASE,s=e.e/LOG_BASE,l=i.c,f=e.c;if(!c||!s){if(!l||!f)return l?(e.s=-t,e):new A(f?i:NaN);if(!l[0]||!f[0])return f[0]?(e.s=-t,e):new A(l[0]?i:3==h?-0:0)}if(c=bitFloor(c),s=bitFloor(s),l=l.slice(),u=c-s){for((a=u<0)?(u=-u,o=l):(s=c,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),--s);return l[0]?N(e,l,s):(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 A(e,r),!a.c||!e.s||e.c&&!e.c[0]?new A(NaN):!e.c||a.c&&!a.c[0]?new A(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,c,s,l,f,p,_,h,m,v,d=this,b=d.c,g=(e=new A(e,t)).c;if(!(b&&g&&b[0]&&g[0]))return!d.s||!e.s||b&&!b[0]&&!g||g&&!g[0]&&!b?e.c=e.e=e.s=null:(e.s*=d.s,b&&g?(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,(c=b.length)<(f=g.length)&&(h=b,b=g,g=h,o=c,c=f,f=o),o=c+f,h=[];o--;h.push(0));for(m=BASE,v=SQRT_BASE,o=f;--o>=0;){for(r=0,p=g[o]%v,_=g[o]/v|0,a=o+(i=c);a>o;)r=((s=p*(s=b[--i]%v)+(u=_*s+(l=b[i]/v|0)*p)%v*v+h[a]+r)/m|0)+(u/v|0)+_*l,h[a--]=s%m;h[a]=r}return r?++n:h.splice(0,1),N(e,h,n)},f.negated=function(){var e=new A(this);return e.s=-e.s||null,e},f.plus=function(e,t){var r,n=this,o=n.s;if(t=(e=new A(e,t)).s,!o||!t)return new A(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,c=e.c;if(!a||!i){if(!u||!c)return new A(o/0);if(!u[0]||!c[0])return c[0]?e:new A(u[0]?n:0*o)}if(a=bitFloor(a),i=bitFloor(i),u=u.slice(),o=a-i){for(o>0?(i=a,r=c):(o=-o,r=u),r.reverse();o--;r.push(0));r.reverse()}for((o=u.length)-(t=c.length)<0&&(r=c,c=u,u=r,t=o),o=0;t;)o=(u[--t]=u[t]+c[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 A(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,c=i.s,s=i.e,l=_+4,f=new A("0.5");if(1!==c||!u||!u[0])return new A(!c||c<0&&(!u||u[0])?NaN:u?i:1/0);if(0==(c=Math.sqrt(+B(i)))||c==1/0?(((r=coeffToString(u)).length+s)%2==0&&(r+="0"),c=Math.sqrt(+r),s=bitFloor((s+1)/2)-(s<0||s%2),n=new A(r=c==1/0?"5e"+s:(r=c.toExponential()).slice(0,r.indexOf("e")+1)+s)):n=new A(c+""),n.c[0])for((c=(s=n.e)+l)<3&&(c=0);;)if(a=n,n=f.times(a.plus(t(i,a,l,1))),coeffToString(a.c).slice(0,c)===(r=coeffToString(n.c)).slice(0,c)){if(n.e<s&&--c,"9999"!=(r=r.slice(c-3,c+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,c+=4,o=1}return T(n,n.e+_+1,h,e)},f.toExponential=function(e,t){return null!=e&&(intCheck(e,0,MAX),e++),O(this,e,t,1)},f.toFixed=function(e,t){return null!=e&&(intCheck(e,0,MAX),e=e+this.e+1),O(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,c=+r.secondaryGroupSize,s=r.groupSeparator||"",l=i[0],f=i[1],p=o.s<0,_=p?l.slice(1):l,h=_.length;if(c&&(a=u,u=c,c=a,h-=a),u>0&&h>0){for(a=h%u||u,l=_.substr(0,a);a<h;a+=u)l+=s+_.substr(a,u);c>0&&(l+=s+_.slice(a)),p&&(l="-"+l)}n=f?l+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):l}return(r.prefix||"")+n+(r.suffix||"")},f.toFraction=function(e){var r,n,o,a,i,u,c,s,l,f,_,m,v=this,d=v.c;if(null!=e&&(!(c=new A(e)).isInteger()&&(c.c||1!==c.s)||c.lt(p)))throw Error(bignumberError+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+B(c));if(!d)return new A(v);for(r=new A(p),l=n=new A(p),o=s=new A(p),m=coeffToString(d),i=r.e=m.length-v.e-1,r.c[0]=POWS_TEN[(u=i%LOG_BASE)<0?LOG_BASE+u:u],e=!e||c.comparedTo(r)>0?i>0?r:l:c,u=b,b=1/0,c=new A(m),s.c[0]=0;f=t(c,r,0,1),1!=(a=n.plus(f.times(o))).comparedTo(e);)n=o,o=a,l=s.plus(f.times(a=l)),s=a,r=c.minus(f.times(a=r)),c=a;return a=t(e.minus(n),o,0,1),s=s.plus(a.times(l)),n=n.plus(a.times(o)),s.s=l.s=v.s,_=t(l,o,i*=2,h).minus(v).abs().comparedTo(t(s,n,i,h).minus(v).abs())<1?[l,o]:[s,n],b=u,_},f.toNumber=function(){return+B(this)},f.toPrecision=function(e,t){return null!=e&&intCheck(e,1,MAX),O(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<=m||a>=v?toExponential(coeffToString(n.c),a):toFixedPoint(coeffToString(n.c),a,"0"):10===e&&E?t=toFixedPoint(coeffToString((n=T(new A(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 B(this)},f._isBigNumber=!0,f[Symbol.toStringTag]="BigNumber",f[Symbol.for("nodejs.util.inspect.custom")]=f.valueOf,null!=e&&A.set(e),A}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,c=e.e,s=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=c==s,!o||!a)return n?0:!o^r?1:-1;if(!n)return c>s^r?1:-1;for(u=(c=o.length)<(s=a.length)?c:s,i=0;i<u;i++)if(o[i]!=a[i])return o[i]>a[i]^r?1:-1;return c==s?0:c>s^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 close_important_push(){}function open_important_push(){}function open_debug(){}function close_debug(){}function calc_wrap(e,t){var r={_error:"-"};return["string","number"].includes(_typeof(e))?void 0===t?/[a-zA-Z$_]/.test(e.toString())?function(t){return Array.isArray(t)?t.unshift(r):t=_objectSpread2(_objectSpread2({},r),t),calc(e,t)}:calc(e):(Array.isArray(t)?t.unshift(r):t=_objectSpread2(_objectSpread2({},r),t),calc(e,t)):(Array.isArray(e)?e.unshift(r):e=_objectSpread2(_objectSpread2({},r),e),function(t){return calc(t,e)})}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$2(e,t,r){if(Number.isNaN(Number(t)))if("-"===t||"+"===t)0===e.length||"operator"===e.at(-1).type||"("===e.at(-1).value?e.push({type:"number",value:t,real_value:t,has_unit:!1}):e.push({type:"operator",value:t});else 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 c,s=split_unit_num(u),l=s.num,f=s.unit;if(void 0===f)e.push({type:"var",value:t,real_value:l,has_unit:!1});else r.has_unit=!0,null!==(c=r.unit_str)&&void 0!==c||(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){for(var n,o=0,a=0,i=e.length,u=[],c={has_var:!1,has_unit:!1,unit_str:void 0,_unit:r,fill_data:t};a<i;)" "===(n=e[a])?(a>o&&push_token$2(u,e.slice(o,a),c),o=a+1):"("===n?(u.push({type:state_bracket,value:"("}),o=a+1):")"===n&&(a>o&&push_token$2(u,e.slice(o,a),c),u.push({type:state_bracket,value:")"}),o=a+1),a++;return a>o&&push_token$2(u,e.slice(o,a),c),u.has_var=c.has_var,u.has_unit=c.has_unit,u.unit=c.unit_str,u}var cache_map=new Map,clear_ing=!1;function clear_cache(){var e,t,r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{maximum:2e3,use_count:100},o=null!==(e=n.maximum)&&void 0!==e?e:2e3,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 c=r.value;(++i>o||c[1].count<a)&&cache_map.delete(c[0])}}catch(e){u.e(e)}finally{u.f()}clear_ing=!1}function get_cache_data(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"value",n=cache_map.get(e);if(void 0===n){var o={count:0,value:t()};return cache_map.set(e,o),"value"===r?o.value:o}return n.count++,"value"===r?n.value:n}function __get_cache_map(){return cache_map}function check_cache(){!clear_ing&&cache_map.size>5e3&&(clear_ing=!0,Promise.resolve().then((function(){return clear_cache})))}var operator_map={"+":0,"-":0,"*":1,"/":1,"%":1,"//":1,"**":2};function eval_tokens(e,t){if(1===e.length){var r=e[0];if("number"===r.type||"var"===r.type)return r.real_value;throw new Error("错误的表达式:".concat(r.value))}for(var n,o,a=[],i=[],u=0,c=e.length;u<c;u++)if("number"!==(n=e[u]).type&&"var"!==n.type)if("operator"!==n.type)if("("!==n.value){if(")"===n.value)for(var s=void 0;s=a.pop();){if("("===s){var l=i.at(-2);if("-"===l){var f=i.pop();i.pop(),i.push(BigNumber.isBigNumber(f)?f.negated():new BigNumber(f).negated())}else if("+"===l){var p=i.pop();i.pop(),i.push(p)}break}var _=i.pop(),h=i.pop();i.push(t(h,_,s))}}else a.push("(");else{var m=a.at(-1);if("("===m){a.push(n.value);continue}var v=operator_map[n.value];if(!a.length){a.push(n.value);continue}if(v<operator_map[m])for(var d=void 0;d=a.pop();){if("("===d){a.push("(");break}var b=i.pop(),g=i.pop();i.push(t(g,b,d))}else if(v===operator_map[m]){if("**"===n.value){a.push(n.value);continue}for(var y=void 0;y=a.pop();){if("("===y){a.push("(");break}if(operator_map[y]<v){a.push(y);break}var w=i.pop(),x=i.pop();i.push(t(x,w,y))}}a.push(n.value)}else i.push(n.real_value);for(;o=a.pop();){var S=i.pop(),E=i.pop();i.push(t(E,S,o))}if(1!==i.length)throw new Error("可能出现了错误的计算式");return e.has_var||(e.calc_result=i[0]),i[0]}function compute(e,t,r){if(void 0===e||void 0===t)throw new Error("无效的操作数对:v1:".concat(e,", v2:").concat(t));var n;switch(r){case"+":n=new BigNumber(e).plus(t);break;case"-":n=new BigNumber(e).minus(t);break;case"*":n=new BigNumber(e).times(t);break;case"/":n=new BigNumber(e).div(t);break;case"%":n=new BigNumber(e).mod(t);break;case"**":n=new BigNumber(e).pow(t);break;case"//":n=new BigNumber(e).idiv(t)}return n}function compute_memo(e,t,r){return get_cache_data("compute:".concat(e).concat(r).concat(t),(function(){return compute(e,t,r)}))}function push_token$1(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){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$1(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$1(i,state_plus$1,"+",n,a);else if("~"===r)n.curr++,a.state=state_round;else if("%"===r)n.curr++,push_token$1(i,state_percent,"%",n,a);else if("/"===r)n.curr++,push_token$1(i,state_fraction,"/",n,a);else if("!"===r)if(a.state=state_initial,n.curr++,"n"===e[n.curr])n.curr++,push_token$1(i,state_to_number,"!n",n,a);else if("u"===e[n.curr])n.curr++,push_token$1(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$1(i,state_scientific,"!e",n,a)}else n.curr++,n.prev=n.curr;break;case state_symbol:"="===r&&n.curr++,push_token$1(i,state_symbol,e.slice(n.prev,n.curr),n,a);break;case state_number:number_char.includes(r)?n.curr++:push_token$1(i,state_number,e.slice(n.prev,n.curr),n,a);break;case state_var:var_members_char.includes(r)?n.curr++:push_token$1(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$1(i,state_round,e.slice(n.prev,n.curr),n,a);break;default:throw new Error("错误的fmt分词器状态")}return n.prev<n.curr&&push_token$1(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(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){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(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(u,e.slice(i,n),a),u.has_var=a.has_var,u}function fmt_tokenizer_memo(e,t){return get_cache_data("fmt-tokens:".concat(e),(function(){return fmt_tokenizer(e,t)}))}function fmt_tokenizer_space_memo(e,t){return get_cache_data("fmt-tokens-space:".concat(e),(function(){return fmt_tokenizer_space(e,t)}))}function calc_memo(e,t){var r,n,o=find_value(t,"_error"),a={};try{var i,u,c;if(null==t)return get_cache_data("calc:".concat(e),(function(){return calc(e,t)}));var s=parse_args(e,t,fmt_tokenizer_memo,fmt_tokenizer_space_memo),l=null!==(i=s._unit)&&void 0!==i&&i,f=null!==(u=s._mode)&&void 0!==u?u:"normal",p=s.fmt_tokens,_="space"===f||"space-all"===f?get_cache_data("tokens-space:".concat(s.expr,":").concat(l),(function(){return tokenizer_space(s.expr,s.fill_data,l)}),"item"):get_cache_data("tokens:".concat(s.expr,":").concat(l),(function(){return tokenizer(s.expr,s.fill_data,l)}),"item");(n=_.value).has_var&&_.count>0&&fill_tokens(n,s.fill_data,l);var h=null!==(c=n.calc_result)&&void 0!==c?c:eval_tokens(n,compute_memo);if(r=BigNumber.isBigNumber(h)?h:new BigNumber(h),void 0===p)r=r.toFixed();else{var m=_slicedToArray(format(r,p),2);r=m[0],a=m[1]}if("Infinity"===r||void 0===r)throw new Error("计算错误可能是非法的计算式")}catch(e){if(void 0===o)throw e;return o}return!n.has_unit||a.to_number||a.to_number_string||(r+=n.unit),check_cache(),r}var fmt_memo=calc_memo;function calc_wrap_memo(e,t){var r={_error:"-"};return["string","number"].includes(_typeof(e))?void 0===t?/[a-zA-Z$_]/.test(e.toString())?function(t){return Array.isArray(t)?t.unshift(r):t=_objectSpread2(_objectSpread2({},r),t),calc_memo(e,t)}:calc_memo(e):(Array.isArray(t)?t.unshift(r):t=_objectSpread2(_objectSpread2({},r),t),calc_memo(e,t)):(Array.isArray(e)?e.unshift(r):e=_objectSpread2(_objectSpread2({},r),e),function(t){return calc_memo(t,e)})}function calc(e,t){var r,n,o=find_value(t,"_error"),a={};try{var i,u,c=parse_args(e,t,fmt_tokenizer,fmt_tokenizer_space),s=null!==(i=c._unit)&&void 0!==i&&i,l=null!==(u=c._mode)&&void 0!==u?u:"normal",f=c.fmt_tokens,p=eval_tokens(n="space"===l||"space-all"===l?tokenizer_space(c.expr,c.fill_data,s):tokenizer(c.expr,c.fill_data,s),compute);if(r=BigNumber.isBigNumber(p)?p:new BigNumber(p),void 0===f)r=r.toFixed();else{var _=_slicedToArray(format(r,f),2);r=_[0],a=_[1]}if("Infinity"===r||void 0===r)throw new Error("计算错误可能是非法的计算式")}catch(e){if(void 0===o)throw e;return o}return!n.has_unit||a.to_number||a.to_number_string||(r+=n.unit),r}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)},check_cache(),"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)},check_cache(),"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)},check_cache(),"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)},check_cache(),"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)},check_cache(),"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)},check_cache(),"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)},check_cache(),"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()}exports.__get_cache_map=__get_cache_map,exports.calc=calc,exports.calc_memo=calc_memo,exports.calc_util=calc_util,exports.calc_wrap=calc_wrap,exports.calc_wrap_memo=calc_wrap_memo,exports.div=div,exports.div_memo=div_memo,exports.fmt=fmt,exports.fmt_memo=fmt_memo,exports.idiv=idiv,exports.idiv_memo=idiv_memo,exports.mod=mod,exports.mod_memo=mod_memo,exports.mul=mul,exports.mul_memo=mul_memo,exports.parse_thousands=parse_thousands,exports.plus=plus,exports.plus_memo=plus_memo,exports.pow=pow,exports.pow_memo=pow_memo,exports.sub=sub,exports.sub_memo=sub_memo,exports.version=version;
|
|
1
|
+
"use strict";function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,u=[],s=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}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},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.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,i){var o=t&&t.prototype instanceof p?t:p,a=Object.create(o.prototype),u=new A(i||[]);return n(a,"_invoke",{value:w(e,r,u)}),a}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 h(){}function _(){}var v={};s(v,o,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(O([])));m&&m!==t&&r.call(m,o)&&(v=m);var g=_.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 i(n,o,a,u){var s=l(e[n],e,o);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){i("next",e,a,u)}),(function(e){i("throw",e,a,u)})):t.resolve(f).then((function(e){c.value=e,a(c)}),(function(e){return i("throw",e,a,u)}))}u(s.arg)}var o;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return o=o?o.then(n,n):n()}})}function w(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return N()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var u=S(a,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 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 i=l(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,f;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function x(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 A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function O(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=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 i.next=i}}return{next:N}}function N(){return{value:void 0,done:!0}}return h.prototype=_,n(g,"constructor",{value:_,configurable:!0}),n(_,"constructor",{value:h,configurable:!0}),h.displayName=s(_,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,s(e,u,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},b(y.prototype),s(y.prototype,a,(function(){return this})),e.AsyncIterator=y,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new y(c(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(g),s(g,u,"Generator"),s(g,o,(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=O,A.prototype={constructor:A,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 a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),s=r.call(o,"finallyLoc");if(u&&s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},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 i=n.arg;E(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(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,i,o,a){try{var u=e[o](a),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,i)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){asyncGeneratorStep(o,n,i,a,u,"next",e)}function u(e){asyncGeneratorStep(o,n,i,a,u,"throw",e)}a(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="2.1.0";function decimal_round(e,t,r,n,i){var o=e,a=t,u=t.length,s={"~-":function(){var e="<"===r?n-1:n;a=t.slice(0,e)},"~+":function(){var e="<"===r?n-1:n;if(!(u<=e||0===u)){var i=t.slice(0,e);0==+t.slice(e,u)?a=i:(i=(+"9".concat(i)+1).toString().slice(1)).length>e?(a=i.slice(1,i.length),o=(+o+1).toString()):a=i}},"~5":function(){if(0!==u){var e="<"===r?n-1:n;a=t.slice(0,e);var i=+t[e];Number.isNaN(i)||i>=5&&(a=(+"9".concat(a)+1).toString().slice(1)).length>e&&(a=a.slice(1,a.length),o=(+o+1).toString())}},"~6":function(){if(0!==u){var i,s="<"===r?n-1:n,c=+t[s],l=t.slice(+s+1,t.length);l=""===l?0:parseInt(l),i=0===s?+e[e.length-1]:+t[s-1],a=t.slice(0,s),(c>=6||5===c&&l>0||5===c&&i%2!=0)&&(a=(+"9".concat(a)+1).toString().slice(1)).length>s&&(a=a.slice(1,a.length),o=(+o+1).toString())}}};return"<="===r?u<=n?a=t.replace(/0*$/,""):(s[i]&&s[i](),a=a.replace(/0+$/,"")):"<"===r?u<n?a=t.replace(/0*$/,""):(s[i]&&s[i](),a=a.replace(/0+$/,"")):"="===r?u<n?a=t+"0".repeat(n-u):u>n&&s[i]&&s[i]():">="===r?u<n&&(a=t+"0".repeat(n-u)):">"===r&&u<=n&&(a=t+"0".repeat(n-u+1)),{int_part:o,dec_part:a}}var 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",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 i=nativeObjectToString$1.call(e);return n&&(t?e[symToStringTag$1]=r:delete e[symToStringTag$1]),i}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=getNative(root$1,"Map"),Map$1=Map;function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$1||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,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};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,i){t.push(n?i.replace(reEscapeChar,"$1"):r||e)})),t})),stringToPath$1=stringToPath;function arrayMap(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}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,i=[/^([+-]?[\d.]+(?:e|E)(?:\+|-)?\d+)(.*)$/,/^([+-]?[\d.]+)(.*)$/],o=0;o<i.length;o++){var a=e.match(i[o]);if(a){n=a;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,i,o,a;return Array.isArray(e)?e.length>1?null!==(n=null!==(i=get(e[0],t))&&void 0!==i?i:get(e.at(-1),t))&&void 0!==n?n:r:1===e.length&&null!==(o=get(e[0],t))&&void 0!==o?o:r:null!==(a=get(e,t,r))&&void 0!==a?a:r}function parse_mantissa(e,t,r,n){var i=e.split("."),o=i[0],a=1===i.length?"":i[1],u=decimal_round(o,a,t,+r,n);return o=u.int_part,""===(a=u.dec_part)?o:"".concat(o,".").concat(a)}function integer_thousands(e){for(var t=e.length,r="";t>0;)r=e.substring(t-3,t)+(""!==r?",":"")+r,t-=3;return r}function parse_thousands(e){var t=e.split("."),r=t[0];return"-"===r[0]?t[0]="-"+integer_thousands(r.slice(1)):t[0]=integer_thousands(r),t.join(".")}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,i,o=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=o.length>1&&void 0!==o[1]?o[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:i=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",i);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,i=e.length;n<i;n++){var o;if(void 0!==(r=null!==(o=get(e[n],t))&&void 0!==o?o: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++}}function parse_args(e,t){var r="",n={origin_expr:e,origin_fill_data:t,expr:"",fmt_expr:"",options:void 0,fill_data:void 0,_unit:void 0,_mode:void 0,_fmt:void 0};if(null!=t&&(n.options=t,Array.isArray(t)?n.fill_data=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]),n._mode=find_value(t,"_mode"),n._unit=find_value(t,"_unit",!1),n._fmt=find_value(t,"_fmt"),"string"==typeof e){if(r=e,""===e.trim()||e.includes("NaN"))throw new Error("非法的表达式:".concat(e))}else{if("number"!=typeof e)throw new Error("错误的第一个参数类型: ".concat(e," 类型为:").concat(_typeof(e)));r=e.toString()}var i=r.split("|");return n.expr=i[0],i.length>1&&(n.fmt_expr=i[1].trim()),n}function push_token$3(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,i=split_unit_num(r),o=i.num,a=i.unit;if(void 0===a)e.push({type:state_number,value:o,real_value:o,has_unit:!1});else t.has_unit=!0,null!==(n=t.unit_str)&&void 0!==n||(t.unit_str=a),e.push({type:state_number,value:o,real_value:o,has_unit:!0,unit:a})}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){for(var n,i={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},o=e.length,a=[];i.cur_index<o;)switch(n=e[i.cur_index],i.curr_state){case state_initial:if(number_char.includes(n))i.curr_state=state_number,i.cur_index++;else if(" "===n)i.cur_index++,i.prev_index=i.cur_index;else if("+-".includes(n)){var u=a.at(-1);0===i.cur_index||"operator"===(null==u?void 0:u.type)||"("===(null==u?void 0:u.value)?(i.curr_state=state_number,i.cur_index++):(i.cur_index++,a.push({type:state_operator,value:e.slice(i.prev_index,i.cur_index)}),i.prev_index=i.cur_index)}else"*/%".includes(n)?(i.curr_state=state_operator,i.cur_index++):var_char.includes(n)?(i.curr_state=state_var,i.cur_index++):"()".includes(n)?(a.push({type:state_bracket,value:n}),i.curr_state=state_initial,i.cur_index++,i.prev_index=i.cur_index):(i.cur_index++,i.prev_index=i.cur_index);break;case state_number:if(number_char.includes(n))i.cur_index++;else if("."===n){if(i.cur_index===i.prev_index||e.slice(i.prev_index,i.cur_index).includes("."))throw new Error("非法的小数部分".concat(e.slice(i.prev_index,i.cur_index)));i.cur_index++}else"e"===n?(i.curr_state=state_scientific,i.cur_index++):r?"*/+-() ".indexOf(n)>-1||"%"===n&&number_char.includes(e[i.cur_index-1])&&pure_number_var_first_char.includes(get_next_nonempty_char(e,i.cur_index,o))?push_token$3(a,i):i.cur_index++:push_token$3(a,i);break;case state_operator:var s=e[i.cur_index-1];"*"===n&&"*"===s?(i.cur_index++,a.push({type:state_operator,value:"**"}),i.prev_index=i.cur_index):"/"===n&&"/"===s?(i.cur_index++,a.push({type:state_operator,value:"//"}),i.prev_index=i.cur_index):(a.push({type:state_operator,value:s}),i.prev_index=i.cur_index),i.curr_state=state_initial;break;case state_var:var_members_char.includes(n)?i.cur_index++:push_token$3(a,i);break;case state_scientific:if(number_char.includes(n))i.cur_index++;else if("+-".includes(n)){var c=i.prev_index;"+-".includes(e[c])&&(c+=1);var l=e.slice(c,i.cur_index),f=l.at(-1);l.includes(n)||"e"!==f?push_token$3(a,i):i.cur_index++}else r&&-1==="*/+-() ".indexOf(n)?i.cur_index++:push_token$3(a,i);break;default:throw new Error("字符扫描状态错误")}return i.prev_index<i.cur_index&&push_token$3(a,i),a.has_var=i.has_var,a.has_unit=i.has_unit,a.unit=i.unit_str,a}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,i,o,a,u,s,c,l,f=A.prototype={constructor:A,toString:null,valueOf:null},p=new A(1),h=20,_=4,v=-7,d=21,m=-1e7,g=1e7,b=!1,y=1,w=0,S={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},x="0123456789abcdefghijklmnopqrstuvwxyz",E=!0;function A(e,t){var i,o,a,u,s,c,l,f,p=this;if(!(p instanceof A))return new A(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<m?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,x.length,"Base"),10==t&&E)return T(p=new A(e),h+p.e+1,_);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,A.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(i=x.slice(0,t),u=s=0,l=f.length;s<l;s++)if(i.indexOf(o=f.charAt(s))<0){if("."==o){if(s>u){u=l;continue}}else if(!a&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){a=!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&&A.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<m)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 O(e,t,r,n){var i,o,a,u,s;if(null==r?r=_:intCheck(r,0,8),!e.c)return e.toString();if(i=e.c[0],a=e.e,null==t)s=coeffToString(e.c),s=1==n||2==n&&(a<=v||a>=d)?toExponential(s,a):toFixedPoint(s,a,"0");else if(o=(e=T(new A(e),t,r)).e,u=(s=coeffToString(e.c)).length,1==n||2==n&&(t<=o||o<=v)){for(;u<t;s+="0",u++);s=toExponential(s,o)}else if(t-=a,s=toFixedPoint(s,o,"0"),o+1>u){if(--t>0)for(s+=".";t--;s+="0");}else if((t+=o-u)>0)for(o+1==u&&(s+=".");t--;s+="0");return e.s<0&&i?"-"+s:s}function N(e,t){for(var r,n=1,i=new A(e[0]);n<e.length;n++){if(!(r=new A(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function k(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*LOG_BASE-1)>g?e.c=e.e=null:r<m?e.c=[e.e=0]:(e.e=r,e.c=t),e}function T(e,t,r,n){var i,o,a,u,s,c,l,f=e.c,p=POWS_TEN;if(f){e:{for(i=1,u=f[0];u>=10;u/=10,i++);if((o=t-i)<0)o+=LOG_BASE,a=t,l=(s=f[c=0])/p[i-a-1]%10|0;else if((c=mathceil((o+1)/LOG_BASE))>=f.length){if(!n)break e;for(;f.length<=c;f.push(0));s=l=0,i=1,a=(o%=LOG_BASE)-LOG_BASE+1}else{for(s=u=f[c],i=1;u>=10;u/=10,i++);l=(a=(o%=LOG_BASE)-LOG_BASE+i)<0?0:s/p[i-a-1]%10|0}if(n=n||t<0||null!=f[c+1]||(a<0?s:s%p[i-a-1]),n=r<4?(l||n)&&(0==r||r==(e.s<0?3:2)):l>5||5==l&&(4==r||n||6==r&&(o>0?a>0?s/p[i-a]: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==o?(f.length=c,u=1,c--):(f.length=c+1,u=p[LOG_BASE-o],f[c]=a>0?mathfloor(s/p[i-a]%p[a])*u:0),n)for(;;){if(0==c){for(o=1,a=f[0];a>=10;a/=10,o++);for(a=f[0]+=u,u=1;a>=10;a/=10,u++);o!=u&&(e.e++,f[0]==BASE&&(f[0]=1));break}if(f[c]+=u,f[c]!=BASE)break;f[c--]=0,u=1}for(o=f.length;0===f[--o];f.pop());}e.e>g?e.c=e.e=null:e.e<m&&(e.c=[e.e=0])}return e}function B(e){var t,r=e.e;return null===r?e.toString():(t=coeffToString(e.c),t=r<=v||r>=d?toExponential(t,r):toFixedPoint(t,r,"0"),e.s<0?"-"+t:t)}return A.clone=clone,A.ROUND_UP=0,A.ROUND_DOWN=1,A.ROUND_CEIL=2,A.ROUND_FLOOR=3,A.ROUND_HALF_UP=4,A.ROUND_HALF_DOWN=5,A.ROUND_HALF_EVEN=6,A.ROUND_HALF_CEIL=7,A.ROUND_HALF_FLOOR=8,A.EUCLID=9,A.config=A.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),h=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),v=r[0],d=r[1]):(intCheck(r,-MAX,MAX,t),v=-(d=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),m=r[0],g=r[1];else{if(intCheck(r,-MAX,MAX,t),!r)throw Error(bignumberError+t+" cannot be zero: "+r);m=-(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);S=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),x=r}}return{DECIMAL_PLACES:h,ROUNDING_MODE:_,EXPONENTIAL_AT:[v,d],RANGE:[m,g],CRYPTO:b,MODULO_MODE:y,POW_PRECISION:w,FORMAT:S,ALPHABET:x}},A.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!A.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-MAX&&i<=MAX&&i===mathfloor(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+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===i&&(null===o||1===o||-1===o))return!0;throw Error(bignumberError+"Invalid BigNumber: "+e)},A.maximum=A.max=function(){return N(arguments,f.lt)},A.minimum=A.min=function(){return N(arguments,f.gt)},A.random=(i=9007199254740992,o=Math.random()*i&2097151?function(){return mathfloor(Math.random()*i)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,a,u=0,s=[],c=new A(p);if(null==e?e=h:intCheck(e,0,MAX),i=mathceil(e/LOG_BASE),b)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));u<i;)(a=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(a%1e14),u+=2);u=i/2}else{if(!crypto.randomBytes)throw b=!1,Error(bignumberError+"crypto unavailable");for(t=crypto.randomBytes(i*=7);u<i;)(a=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(a%1e14),u+=7);u=i/7}if(!b)for(;u<i;)(a=o())<9e15&&(s[u++]=a%1e14);for(i=s[--u],e%=LOG_BASE,i&&e&&(a=POWS_TEN[LOG_BASE-e],s[u]=mathfloor(i/a)*a);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,a=s[0];a>=10;a/=10,u++);u<LOG_BASE&&(n-=LOG_BASE-u)}return c.e=n,c.c=s,c}),A.sum=function(){for(var e=1,t=arguments,r=new A(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 i,o,a=[0],u=0,s=e.length;u<s;){for(o=a.length;o--;a[o]*=t);for(a[0]+=n.indexOf(e.charAt(u++)),i=0;i<a.length;i++)a[i]>r-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}return function(n,i,o,a,u){var s,c,l,f,p,v,d,m,g=n.indexOf("."),b=h,y=_;for(g>=0&&(f=w,w=0,n=n.replace(".",""),v=(m=new A(i)).pow(n.length-g),w=f,m.c=r(toFixedPoint(coeffToString(v.c),v.e,"0"),10,o,e),m.e=m.c.length),l=f=(d=r(n,i,o,u?(s=x,e):(s=e,x))).length;0==d[--f];d.pop());if(!d[0])return s.charAt(0);if(g<0?--l:(v.c=d,v.e=l,v.s=a,d=(v=t(v,m,b,y,o)).c,p=v.r,l=v.e),g=d[c=l+b+1],f=o/2,p=p||c<0||null!=d[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&d[c-1]||y==(v.s<0?8:7)),c<1||!d[0])n=p?toFixedPoint(s.charAt(1),-b,s.charAt(0)):s.charAt(0);else{if(d.length=c,p)for(--o;++d[--c]>o;)d[c]=0,c||(++l,d=[1].concat(d));for(f=d.length;!d[--f];);for(g=0,n="";g<=f;n+=s.charAt(d[g++]));n=toFixedPoint(n,l,s.charAt(0))}return n}}(),t=function(){function e(e,t,r){var n,i,o,a,u=0,s=e.length,c=t%SQRT_BASE,l=t/SQRT_BASE|0;for(e=e.slice();s--;)u=((i=c*(o=e[s]%SQRT_BASE)+(n=l*o+(a=e[s]/SQRT_BASE|0)*c)%SQRT_BASE*SQRT_BASE+u)/r|0)+(n/SQRT_BASE|0)+l*a,e[s]=i%r;return u&&(e=[u].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,o,a,u){var s,c,l,f,p,h,_,v,d,m,g,b,y,w,S,x,E,O=n.s==i.s?1:-1,N=n.c,k=i.c;if(!(N&&N[0]&&k&&k[0]))return new A(n.s&&i.s&&(N?!k||N[0]!=k[0]:k)?N&&0==N[0]||!k?0*O:O/0:NaN);for(d=(v=new A(O)).c=[],O=o+(c=n.e-i.e)+1,u||(u=BASE,c=bitFloor(n.e/LOG_BASE)-bitFloor(i.e/LOG_BASE),O=O/LOG_BASE|0),l=0;k[l]==(N[l]||0);l++);if(k[l]>(N[l]||0)&&c--,O<0)d.push(1),f=!0;else{for(w=N.length,x=k.length,l=0,O+=2,(p=mathfloor(u/(k[0]+1)))>1&&(k=e(k,p,u),N=e(N,p,u),x=k.length,w=N.length),y=x,g=(m=N.slice(0,x)).length;g<x;m[g++]=0);E=k.slice(),E=[0].concat(E),S=k[0],k[1]>=u/2&&S++;do{if(p=0,(s=t(k,m,x,g))<0){if(b=m[0],x!=g&&(b=b*u+(m[1]||0)),(p=mathfloor(b/S))>1)for(p>=u&&(p=u-1),_=(h=e(k,p,u)).length,g=m.length;1==t(h,m,_,g);)p--,r(h,x<_?E:k,_,u),_=h.length,s=1;else 0==p&&(s=p=1),_=(h=k.slice()).length;if(_<g&&(h=[0].concat(h)),r(m,h,g,u),g=m.length,-1==s)for(;t(k,m,x,g)<1;)p++,r(m,x<g?E:k,g,u),g=m.length}else 0===s&&(p++,m=[0]);d[l++]=p,m[0]?m[g++]=N[y]||0:(m=[N[y]],g=1)}while((y++<w||null!=m[0])&&O--);f=null!=m[0],d[0]||d.splice(0,1)}if(u==BASE){for(l=1,O=d[0];O>=10;O/=10,l++);T(v,o+(v.e=l+c*LOG_BASE-1)+1,a,f)}else v.e=c,v.r=+f;return v}}(),a=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,s=/^\.([^.]+)$/,c=/^-?(Infinity|NaN)$/,l=/^\s*\+(?=[\w.])|^\s+|\s+$/g,n=function(e,t,r,n){var i,o=r?t:t.replace(l,"");if(c.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(a,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(u,"$1").replace(s,"0.$1")),t!=o))return new A(o,i);if(A.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 A(this);return e.s<0&&(e.s=1),e},f.comparedTo=function(e,t){return compare(this,new A(e,t))},f.decimalPlaces=f.dp=function(e,t){var r,n,i,o=this;if(null!=e)return intCheck(e,0,MAX),null==t?t=_:intCheck(t,0,8),T(new A(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},f.dividedBy=f.div=function(e,r){return t(this,new A(e,r),h,_)},f.dividedToIntegerBy=f.idiv=function(e,r){return t(this,new A(e,r),0,1)},f.exponentiatedBy=f.pow=function(e,t){var r,n,i,o,a,u,s,c,l=this;if((e=new A(e)).c&&!e.isInteger())throw Error(bignumberError+"Exponent not an integer: "+B(e));if(null!=t&&(t=new A(t)),a=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 A(Math.pow(+B(l),a?e.s*(2-isOdd(e)):+B(e))),t?c.mod(t):c;if(u=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new A(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||a&&l.c[1]>=24e7:l.c[0]<8e13||a&&l.c[0]<=9999975e7)))return o=l.s<0&&isOdd(e)?-0:0,l.e>-1&&(o=1/o),new A(u?1/o:o);w&&(o=mathceil(w/LOG_BASE+2))}for(a?(r=new A(.5),u&&(e.s=1),s=isOdd(e)):s=(i=Math.abs(+B(e)))%2,c=new A(p);;){if(s){if(!(c=c.times(l)).c)break;o?c.c.length>o&&(c.c.length=o):n&&(c=c.mod(t))}if(i){if(0===(i=mathfloor(i/2)))break;s=i%2}else if(T(e=e.times(r),e.e+1,1),e.e>14)s=isOdd(e);else{if(0===(i=+B(e)))break;s=i%2}l=l.times(l),o?l.c&&l.c.length>o&&(l.c.length=o):n&&(l=l.mod(t))}return n?c:(u&&(c=p.div(c)),t?c.mod(t):o?T(c,w,_,undefined):c)},f.integerValue=function(e){var t=new A(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 A(e,t))},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(e,t){return compare(this,new A(e,t))>0},f.isGreaterThanOrEqualTo=f.gte=function(e,t){return 1===(t=compare(this,new A(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 A(e,t))<0},f.isLessThanOrEqualTo=f.lte=function(e,t){return-1===(t=compare(this,new A(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,i,o,a=this,u=a.s;if(t=(e=new A(e,t)).s,!u||!t)return new A(NaN);if(u!=t)return e.s=-t,a.plus(e);var s=a.e/LOG_BASE,c=e.e/LOG_BASE,l=a.c,f=e.c;if(!s||!c){if(!l||!f)return l?(e.s=-t,e):new A(f?a:NaN);if(!l[0]||!f[0])return f[0]?(e.s=-t,e):new A(l[0]?a:3==_?-0:0)}if(s=bitFloor(s),c=bitFloor(c),l=l.slice(),u=s-c){for((o=u<0)?(u=-u,i=l):(c=s,i=f),i.reverse(),t=u;t--;i.push(0));i.reverse()}else for(n=(o=(u=l.length)<(t=f.length))?u:t,u=t=0;t<n;t++)if(l[t]!=f[t]){o=l[t]<f[t];break}if(o&&(i=l,l=f,f=i,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]?k(e,l,c):(e.s=3==_?-1:1,e.c=[e.e=0],e)},f.modulo=f.mod=function(e,r){var n,i,o=this;return e=new A(e,r),!o.c||!e.s||e.c&&!e.c[0]?new A(NaN):!e.c||o.c&&!o.c[0]?new A(o):(9==y?(i=e.s,e.s=1,n=t(o,e,0,3),e.s=i,n.s*=i):n=t(o,e,0,y),(e=o.minus(n.times(e))).c[0]||1!=y||(e.s=o.s),e)},f.multipliedBy=f.times=function(e,t){var r,n,i,o,a,u,s,c,l,f,p,h,_,v,d,m=this,g=m.c,b=(e=new A(e,t)).c;if(!(g&&b&&g[0]&&b[0]))return!m.s||!e.s||g&&!g[0]&&!b||b&&!b[0]&&!g?e.c=e.e=e.s=null:(e.s*=m.s,g&&b?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=bitFloor(m.e/LOG_BASE)+bitFloor(e.e/LOG_BASE),e.s*=m.s,(s=g.length)<(f=b.length)&&(_=g,g=b,b=_,i=s,s=f,f=i),i=s+f,_=[];i--;_.push(0));for(v=BASE,d=SQRT_BASE,i=f;--i>=0;){for(r=0,p=b[i]%d,h=b[i]/d|0,o=i+(a=s);o>i;)r=((c=p*(c=g[--a]%d)+(u=h*c+(l=g[a]/d|0)*p)%d*d+_[o]+r)/v|0)+(u/d|0)+h*l,_[o--]=c%v;_[o]=r}return r?++n:_.splice(0,1),k(e,_,n)},f.negated=function(){var e=new A(this);return e.s=-e.s||null,e},f.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new A(e,t)).s,!i||!t)return new A(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/LOG_BASE,a=e.e/LOG_BASE,u=n.c,s=e.c;if(!o||!a){if(!u||!s)return new A(i/0);if(!u[0]||!s[0])return s[0]?e:new A(u[0]?n:0*i)}if(o=bitFloor(o),a=bitFloor(a),u=u.slice(),i=o-a){for(i>0?(a=o,r=s):(i=-i,r=u),r.reverse();i--;r.push(0));r.reverse()}for((i=u.length)-(t=s.length)<0&&(r=s,s=u,u=r,t=i),i=0;t;)i=(u[--t]=u[t]+s[t]+i)/BASE|0,u[t]=BASE===u[t]?0:u[t]%BASE;return i&&(u=[i].concat(u),++a),k(e,u,a)},f.precision=f.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return intCheck(e,1,MAX),null==t?t=_:intCheck(t,0,8),T(new A(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*LOG_BASE+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.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,i,o,a=this,u=a.c,s=a.s,c=a.e,l=h+4,f=new A("0.5");if(1!==s||!u||!u[0])return new A(!s||s<0&&(!u||u[0])?NaN:u?a:1/0);if(0==(s=Math.sqrt(+B(a)))||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 A(r=s==1/0?"5e"+c:(r=s.toExponential()).slice(0,r.indexOf("e")+1)+c)):n=new A(s+""),n.c[0])for((s=(c=n.e)+l)<3&&(s=0);;)if(o=n,n=f.times(o.plus(t(a,o,l,1))),coeffToString(o.c).slice(0,s)===(r=coeffToString(n.c)).slice(0,s)){if(n.e<c&&--s,"9999"!=(r=r.slice(s-3,s+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(T(n,n.e+h+2,1),e=!n.times(n).eq(a));break}if(!i&&(T(o,o.e+h+2,0),o.times(o).eq(a))){n=o;break}l+=4,s+=4,i=1}return T(n,n.e+h+1,_,e)},f.toExponential=function(e,t){return null!=e&&(intCheck(e,0,MAX),e++),O(this,e,t,1)},f.toFixed=function(e,t){return null!=e&&(intCheck(e,0,MAX),e=e+this.e+1),O(this,e,t)},f.toFormat=function(e,t,r){var n,i=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=i.toFixed(e,t),i.c){var o,a=n.split("."),u=+r.groupSize,s=+r.secondaryGroupSize,c=r.groupSeparator||"",l=a[0],f=a[1],p=i.s<0,h=p?l.slice(1):l,_=h.length;if(s&&(o=u,u=s,s=o,_-=o),u>0&&_>0){for(o=_%u||u,l=h.substr(0,o);o<_;o+=u)l+=c+h.substr(o,u);s>0&&(l+=c+h.slice(o)),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,i,o,a,u,s,c,l,f,h,v,d=this,m=d.c;if(null!=e&&(!(s=new A(e)).isInteger()&&(s.c||1!==s.s)||s.lt(p)))throw Error(bignumberError+"Argument "+(s.isInteger()?"out of range: ":"not an integer: ")+B(s));if(!m)return new A(d);for(r=new A(p),l=n=new A(p),i=c=new A(p),v=coeffToString(m),a=r.e=v.length-d.e-1,r.c[0]=POWS_TEN[(u=a%LOG_BASE)<0?LOG_BASE+u:u],e=!e||s.comparedTo(r)>0?a>0?r:l:s,u=g,g=1/0,s=new A(v),c.c[0]=0;f=t(s,r,0,1),1!=(o=n.plus(f.times(i))).comparedTo(e);)n=i,i=o,l=c.plus(f.times(o=l)),c=o,r=s.minus(f.times(o=r)),s=o;return o=t(e.minus(n),i,0,1),c=c.plus(o.times(l)),n=n.plus(o.times(i)),c.s=l.s=d.s,h=t(l,i,a*=2,_).minus(d).abs().comparedTo(t(c,n,a,_).minus(d).abs())<1?[l,i]:[c,n],g=u,h},f.toNumber=function(){return+B(this)},f.toPrecision=function(e,t){return null!=e&&intCheck(e,1,MAX),O(this,e,t,2)},f.toString=function(e){var t,n=this,i=n.s,o=n.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=v||o>=d?toExponential(coeffToString(n.c),o):toFixedPoint(coeffToString(n.c),o,"0"):10===e&&E?t=toFixedPoint(coeffToString((n=T(new A(n),h+o+1,_)).c),n.e,"0"):(intCheck(e,2,x.length,"Base"),t=r(toFixedPoint(coeffToString(n.c),o,"0"),10,e,i,!0)),i<0&&n.c[0]&&(t="-"+t)),t},f.valueOf=f.toJSON=function(){return B(this)},f._isBigNumber=!0,f[Symbol.toStringTag]="BigNumber",f[Symbol.for("nodejs.util.inspect.custom")]=f.valueOf,null!=e&&A.set(e),A}function bitFloor(e){var t=0|e;return e>0||e===t?t:t-1}function coeffToString(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=LOG_BASE-t.length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function compare(e,t){var r,n,i=e.c,o=t.c,a=e.s,u=t.s,s=e.e,c=t.e;if(!a||!u)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-u:a;if(a!=u)return a;if(r=a<0,n=s==c,!i||!o)return n?0:!i^r?1:-1;if(!n)return s>c^r?1:-1;for(u=(s=i.length)<(c=o.length)?s:c,a=0;a<u;a++)if(i[a]!=o[a])return i[a]>o[a]^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,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}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 i=BigNumber(r).toExponential();return[n.sign&&!i.startsWith("-")?"+"+i:i,n]}if(n.fraction){var o=BigNumber(r).toFraction().map((function(e){return e.toFixed()})).join("/");return[n.sign&&!o.startsWith("-")?"+"+o:o,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 close_important_push(){}function open_important_push(){}function open_debug(){}function close_debug(){}function calc_wrap(e,t){var r={_error:"-"};return["string","number"].includes(_typeof(e))?void 0===t?/[a-zA-Z$_]/.test(e.toString())?function(t){return Array.isArray(t)?t.unshift(r):t=_objectSpread2(_objectSpread2({},r),t),calc(e,t)}:calc(e):(Array.isArray(t)?t.unshift(r):t=_objectSpread2(_objectSpread2({},r),t),calc(e,t)):(Array.isArray(e)?e.unshift(r):e=_objectSpread2(_objectSpread2({},r),e),function(t){return calc(t,e)})}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$2(e,t,r){if(Number.isNaN(Number(t)))if("-"===t||"+"===t)0===e.length||"operator"===e.at(-1).type||"("===e.at(-1).value?e.push({type:"number",value:t,real_value:t,has_unit:!1}):e.push({type:"operator",value:t});else if(operator.has(t))e.push({type:"operator",value:t});else if(r._unit&&/^[+-]?\d/.test(t)){var n,i=split_unit_num(t),o=i.num,a=i.unit;if(void 0===a)e.push({type:"number",value:o,real_value:o,has_unit:!1});else r.has_unit=!0,null!==(n=r.unit_str)&&void 0!==n||(r.unit_str=a),e.push({type:"number",value:o,real_value:o,has_unit:!0,unit:a})}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){for(var n,i=0,o=0,a=e.length,u=[],s={has_var:!1,has_unit:!1,unit_str:void 0,_unit:r,fill_data:t};o<a;)" "===(n=e[o])?(o>i&&push_token$2(u,e.slice(i,o),s),i=o+1):"("===n?(u.push({type:state_bracket,value:"("}),i=o+1):")"===n&&(o>i&&push_token$2(u,e.slice(i,o),s),u.push({type:state_bracket,value:")"}),i=o+1),o++;return o>i&&push_token$2(u,e.slice(i,o),s),u.has_var=s.has_var,u.has_unit=s.has_unit,u.unit=s.unit_str,u}function compute(e,t,r){if(void 0===e||void 0===t)throw new Error("无效的操作数对:v1:".concat(e,", v2:").concat(t));var n;switch(r){case"+":n=new BigNumber(e).plus(t);break;case"-":n=new BigNumber(e).minus(t);break;case"*":n=new BigNumber(e).times(t);break;case"/":n=new BigNumber(e).div(t);break;case"%":n=new BigNumber(e).mod(t);break;case"**":n=new BigNumber(e).pow(t);break;case"//":n=new BigNumber(e).idiv(t)}return n}var operator_map={"+":0,"-":0,"*":1,"/":1,"%":1,"//":1,"**":2};function eval_tokens(e){if(1===e.length){var t=e[0];if("number"===t.type||"var"===t.type)return t.real_value;throw new Error("错误的表达式:".concat(t.value))}for(var r,n,i=[],o=[],a=0,u=e.length;a<u;a++)if("number"!==(r=e[a]).type&&"var"!==r.type)if("operator"!==r.type)if("("!==r.value){if(")"===r.value)for(var s=void 0;s=i.pop();){if("("===s){var c=o.at(-2);if("-"===c){var l=o.pop();o.pop(),o.push(BigNumber.isBigNumber(l)?l.negated():new BigNumber(l).negated())}else if("+"===c){var f=o.pop();o.pop(),o.push(f)}break}var p=o.pop(),h=o.pop();o.push(compute(h,p,s))}}else i.push("(");else{var _=i.at(-1);if("("===_){i.push(r.value);continue}var v=operator_map[r.value];if(!i.length){i.push(r.value);continue}if(v<operator_map[_])for(var d=void 0;d=i.pop();){if("("===d){i.push("(");break}var m=o.pop(),g=o.pop();o.push(compute(g,m,d))}else if(v===operator_map[_]){if("**"===r.value){i.push(r.value);continue}for(var b=void 0;b=i.pop();){if("("===b){i.push("(");break}if(operator_map[b]<v){i.push(b);break}var y=o.pop(),w=o.pop();o.push(compute(w,y,b))}}i.push(r.value)}else o.push(r.real_value);for(;n=i.pop();){var S=o.pop(),x=o.pop();o.push(compute(x,S,n))}if(1!==o.length)throw new Error("可能出现了错误的计算式");return e.has_var||(e.calc_result=o[0]),o[0]}function push_token$1(e,t,r,n,i){t===state_var?(i.has_var=!0,e.push({type:t,value:r,real_value:get_real_value(i.fill_data,r)})):e.push({type:t,value:r}),n.prev=n.curr,i.state=state_initial}function fmt_tokenizer(e,t){for(var r,n={prev:0,curr:0},i=e.length,o={state:state_initial,fill_data:t,has_var:!1},a=[];n.curr<i;)switch(r=e[n.curr],o.state){case state_initial:if(" "===r)n.curr++,n.prev=n.curr;else if("<>=".includes(r))o.state=state_symbol,n.curr++;else if(","===r)n.curr++,push_token$1(a,state_comma,",",n,o);else if(var_char.includes(r))o.state=state_var,n.curr++;else if(number_char.includes(r))o.state=state_number,n.curr++;else if("+"===r)n.curr++,push_token$1(a,state_plus$1,"+",n,o);else if("~"===r)n.curr++,o.state=state_round;else if("%"===r)n.curr++,push_token$1(a,state_percent,"%",n,o);else if("/"===r)n.curr++,push_token$1(a,state_fraction,"/",n,o);else if("!"===r)if(o.state=state_initial,n.curr++,"n"===e[n.curr])n.curr++,push_token$1(a,state_to_number,"!n",n,o);else if("u"===e[n.curr])n.curr++,push_token$1(a,state_to_number_string,"!u",n,o);else{if("e"!==e[n.curr])throw new Error("无法识别的!模式字符:".concat(e[n.curr]));n.curr++,push_token$1(a,state_scientific,"!e",n,o)}else n.curr++,n.prev=n.curr;break;case state_symbol:"="===r&&n.curr++,push_token$1(a,state_symbol,e.slice(n.prev,n.curr),n,o);break;case state_number:number_char.includes(r)?n.curr++:push_token$1(a,state_number,e.slice(n.prev,n.curr),n,o);break;case state_var:var_members_char.includes(r)?n.curr++:push_token$1(a,state_var,e.slice(n.prev,n.curr),n,o);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$1(a,state_round,e.slice(n.prev,n.curr),n,o);break;default:throw new Error("错误的fmt分词器状态")}return n.prev<n.curr&&push_token$1(a,o.state,e.slice(n.prev,n.curr),n,o),a.has_var=o.has_var,a}var symbol_set=new Set(["<",">","=",">=","<="]),rand_set=new Set(["~+","~-","~5","~6"]);function push_token(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){for(var r,n=0,i=e.length,o={fill_data:t,has_var:!1},a=0,u=[];n<i;)" "===(r=e[n])?(n>a&&push_token(u,e.slice(a,n),o),a=n+1):"<>=".includes(r)&&("="===e[n+1]?(u.push({type:state_symbol,value:r+"="}),a=1+ ++n):(u.push({type:state_symbol,value:r}),a=n+1)),n++;return a<n&&push_token(u,e.slice(a,n),o),u.has_var=o.has_var,u}function calc(e,t){var r=find_value(t,"_error");try{var n,i,o,a,u,s,c,l=parse_args(e,t),f=null!==(n=l._unit)&&void 0!==n&&n,p=null!==(i=l._mode)&&void 0!==i?i:"normal",h="space"===p||"space-all"===p?tokenizer_space(l.expr,l.fill_data,f):tokenizer(l.expr,l.fill_data,f),_=eval_tokens(h),v=BigNumber.isBigNumber(_)?_:new BigNumber(_);if("space-all"===p?(s=""===l.fmt_expr||void 0===l.fmt_expr?void 0:fmt_tokenizer_space(l.fmt_expr,l.fill_data),c=""===l._fmt||void 0===l._fmt?void 0:fmt_tokenizer_space(l._fmt,l.fill_data)):(s=""===l.fmt_expr||void 0===l.fmt_expr?void 0:fmt_tokenizer(l.fmt_expr,l.fill_data),c=""===l._fmt||void 0===l._fmt?void 0:fmt_tokenizer(l._fmt,l.fill_data)),void 0===s?void 0!==c&&(s=c):void 0!==c&&(s=[].concat(_toConsumableArray(c),_toConsumableArray(s))),void 0===s)v=v.toFixed();else{var d=_slicedToArray(format(v,s),2);v=d[0],u=d[1]}if("Infinity"===v||void 0===v)throw new Error("计算错误可能是非法的计算式");return!h.has_unit||null!==(o=u)&&void 0!==o&&o.to_number||null!==(a=u)&&void 0!==a&&a.to_number_string||(v+=h.unit),v}catch(e){if(void 0===r)throw e;return r}}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(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(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(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(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(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(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(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()}exports.calc=calc,exports.calc_util=calc_util,exports.calc_wrap=calc_wrap,exports.div=div,exports.fmt=fmt,exports.idiv=idiv,exports.mod=mod,exports.mul=mul,exports.parse_thousands=parse_thousands,exports.plus=plus,exports.pow=pow,exports.sub=sub,exports.version=version;
|
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,a,i,o,u=[],c=!0,s=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(e){s=!0,a=e}finally{try{if(!c&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(s)throw a}}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},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",o=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var i=t&&t.prototype instanceof p?t:p,o=Object.create(i.prototype),u=new A(a||[]);return n(o,"_invoke",{value:w(e,r,u)}),o}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var f={};function p(){}function _(){}function h(){}var v={};c(v,i,(function(){return this}));var m=Object.getPrototypeOf,d=m&&m(m(O([])));d&&d!==t&&r.call(d,i)&&(v=d);var b=h.prototype=p.prototype=Object.create(v);function g(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){function a(n,i,o,u){var c=l(e[n],e,i);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){a("next",e,o,u)}),(function(e){a("throw",e,o,u)})):t.resolve(f).then((function(e){s.value=e,o(s)}),(function(e){return a("throw",e,o,u)}))}u(c.arg)}var i;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){a(e,r,t,n)}))}return i=i?i.then(n,n):n()}})}function w(e,t,r){var n="suspendedStart";return function(a,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw i;return k()}for(r.method=a,r.arg=i;;){var o=r.delegate;if(o){var u=S(o,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 c=l(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.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 a=l(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,f;var i=a.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function x(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 A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function O(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=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 a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return _.prototype=h,n(b,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:_,configurable:!0}),_.displayName=c(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,c(e,u,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},g(y.prototype),c(y.prototype,o,(function(){return this})),e.AsyncIterator=y,e.async=function(t,r,n,a,i){void 0===i&&(i=Promise);var o=new y(s(t,r,n,a),i);return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},g(b),c(b,u,"Generator"),c(b,i,(function(){return this})),c(b,"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=O,A.prototype={constructor:A,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 o.type="throw",o.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(o)},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 a=n.arg;E(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(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,a,i,o){try{var u=e[i](o),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,a)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){asyncGeneratorStep(i,n,a,o,u,"next",e)}function u(e){asyncGeneratorStep(i,n,a,o,u,"throw",e)}o(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,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}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 i,o=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){u=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw i}}}}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.20240522";function decimal_round(e,t,r,n,a){var i=e,o=t,u=t.length,c={"~-":function(){var e="<"===r?n-1:n;o=t.slice(0,e)},"~+":function(){var e="<"===r?n-1:n;if(!(u<=e||0===u)){var a=t.slice(0,e);0==+t.slice(e,u)?o=a:(a=(+"9".concat(a)+1).toString().slice(1)).length>e?(o=a.slice(1,a.length),i=(+i+1).toString()):o=a}},"~5":function(){if(0!==u){var e="<"===r?n-1:n;o=t.slice(0,e);var a=+t[e];Number.isNaN(a)||a>=5&&(o=(+"9".concat(o)+1).toString().slice(1)).length>e&&(o=o.slice(1,o.length),i=(+i+1).toString())}},"~6":function(){if(0!==u){var a,c="<"===r?n-1:n,s=+t[c],l=t.slice(+c+1,t.length);l=""===l?0:parseInt(l),a=0===c?+e[e.length-1]:+t[c-1],o=t.slice(0,c),(s>=6||5===s&&l>0||5===s&&a%2!=0)&&(o=(+"9".concat(o)+1).toString().slice(1)).length>c&&(o=o.slice(1,o.length),i=(+i+1).toString())}}};return"<="===r?u<=n?o=t.replace(/0*$/,""):(c[a]&&c[a](),o=o.replace(/0+$/,"")):"<"===r?u<n?o=t.replace(/0*$/,""):(c[a]&&c[a](),o=o.replace(/0+$/,"")):"="===r?u<n?o=t+"0".repeat(n-u):u>n&&c[a]&&c[a]():">="===r?u<n&&(o=t+"0".repeat(n-u)):">"===r&&u<=n&&(o=t+"0".repeat(n-u+1)),{int_part:i,dec_part:o}}var 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",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 a=nativeObjectToString$1.call(e);return n&&(t?e[symToStringTag$1]=r:delete e[symToStringTag$1]),a}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,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=e.apply(this,n);return r.cache=i.set(a,o)||i,o};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,a){t.push(n?a.replace(reEscapeChar,"$1"):r||e)})),t})),stringToPath$1=stringToPath;function arrayMap(e,t){for(var r=-1,n=null==e?0:e.length,a=Array(n);++r<n;)a[r]=t(e[r],r,e);return a}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,a=[/^([+-]?[\d.]+(?:e|E)(?:\+|-)?\d+)(.*)$/,/^([+-]?[\d.]+)(.*)$/],i=0;i<a.length;i++){var o=e.match(a[i]);if(o){n=o;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,a,i,o;return Array.isArray(e)?e.length>1?null!==(n=null!==(a=get(e[0],t))&&void 0!==a?a:get(e.at(-1),t))&&void 0!==n?n:r:1===e.length&&null!==(i=get(e[0],t))&&void 0!==i?i:r:null!==(o=get(e,t,r))&&void 0!==o?o:r}function fill_tokens(e,t,r){var n,a=!1;e.forEach((function(e){if(e.type===state_var)if(r){var i,o=split_unit_num(get_real_value(t,e.value)),u=o.num,c=o.unit;if(e.real_value=u,void 0!==c)a=!0,null!==(i=n)&&void 0!==i||(n=c),e.unit=c}else e.real_value=get_real_value(t,e.value);else if(e.type===state_number){var s;if(e.has_unit)a=!0,null!==(s=n)&&void 0!==s||(n=e.unit)}})),e.has_unit=a,e.unit=n}function parse_mantissa(e,t,r,n){var a=e.split("."),i=a[0],o=1===a.length?"":a[1],u=decimal_round(i,o,t,+r,n);return i=u.int_part,""===(o=u.dec_part)?i:"".concat(i,".").concat(o)}function integer_thousands(e){for(var t=e.length,r="";t>0;)r=e.substring(t-3,t)+(""!==r?",":"")+r,t-=3;return r}function parse_thousands(e){var t=e.split("."),r=t[0];return"-"===r[0]?t[0]="-"+integer_thousands(r.slice(1)):t[0]=integer_thousands(r),t.join(".")}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,a,i=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=i.length>1&&void 0!==i[1]?i[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:a=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",a);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,a=e.length;n<a;n++){var i;if(void 0!==(r=null!==(i=get(e[n],t))&&void 0!==i?i: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++}}function parse_args(e,t,r,n){var a="",i={origin_expr:e,origin_fill_data:t,expr:"",fmt_tokens:void 0,options:void 0,fill_data:void 0,_unit:void 0,_mode:void 0,_fmt:void 0};null!=t&&(i.options=t,Array.isArray(t)?i.fill_data=t:Array.isArray(t._fill_data)?i.fill_data=[t].concat(_toConsumableArray(t._fill_data)):void 0===t._fill_data?i.fill_data=[t]:i.fill_data=[t,t._fill_data]);var o=i._mode=find_value(t,"_mode");i._unit=find_value(t,"_unit",!1);var u=i._fmt=find_value(t,"_fmt");if("string"==typeof e){if(a=e,""===e.trim()||e.includes("NaN"))throw new Error("非法的表达式:".concat(e))}else{if("number"!=typeof e)throw new Error("错误的第一个参数类型: ".concat(e," 类型为:").concat(_typeof(e)));a=e.toString()}var c=a.split("|");if(i.expr=c[0],c.length>1){var s=c[1];""!==s.trim()&&(i.fmt_tokens="space-all"===o?n(s,i.fill_data):r(s,i.fill_data))}if(void 0!==t&&void 0!==u){var l=[];if(l="space-all"===o?n(u,i.fill_data):r(u,i.fill_data),void 0===i.fmt_tokens)i.fmt_tokens=l;else{var f=i.fmt_tokens.map((function(e){return e.type}));l.forEach((function(e){f.includes(e.type)||i.fmt_tokens.push(e)}))}}return i}function push_token$3(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,a=split_unit_num(r),i=a.num,o=a.unit;if(void 0===o)e.push({type:state_number,value:i,real_value:i,has_unit:!1});else t.has_unit=!0,null!==(n=t.unit_str)&&void 0!==n||(t.unit_str=o),e.push({type:state_number,value:i,real_value:i,has_unit:!0,unit:o})}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),c=get_real_value(t.fill_data,u);if(t._unit){var s,l=split_unit_num(c),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!==(s=t.unit_str)&&void 0!==s||(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:c,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){for(var n,a={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},i=e.length,o=[];a.cur_index<i;)switch(n=e[a.cur_index],a.curr_state){case state_initial:if(number_char.includes(n))a.curr_state=state_number,a.cur_index++;else if(" "===n)a.cur_index++,a.prev_index=a.cur_index;else if("+-".includes(n)){var u=o.at(-1);0===a.cur_index||"operator"===(null==u?void 0:u.type)||"("===(null==u?void 0:u.value)?(a.curr_state=state_number,a.cur_index++):(a.cur_index++,o.push({type:state_operator,value:e.slice(a.prev_index,a.cur_index)}),a.prev_index=a.cur_index)}else"*/%".includes(n)?(a.curr_state=state_operator,a.cur_index++):var_char.includes(n)?(a.curr_state=state_var,a.cur_index++):"()".includes(n)?(o.push({type:state_bracket,value:n}),a.curr_state=state_initial,a.cur_index++,a.prev_index=a.cur_index):(a.cur_index++,a.prev_index=a.cur_index);break;case state_number:if(number_char.includes(n))a.cur_index++;else if("."===n){if(a.cur_index===a.prev_index||e.slice(a.prev_index,a.cur_index).includes("."))throw new Error("非法的小数部分".concat(e.slice(a.prev_index,a.cur_index)));a.cur_index++}else"e"===n?(a.curr_state=state_scientific,a.cur_index++):r?"*/+-() ".indexOf(n)>-1||"%"===n&&number_char.includes(e[a.cur_index-1])&&pure_number_var_first_char.includes(get_next_nonempty_char(e,a.cur_index,i))?push_token$3(o,a):a.cur_index++:push_token$3(o,a);break;case state_operator:var c=e[a.cur_index-1];"*"===n&&"*"===c?(a.cur_index++,o.push({type:state_operator,value:"**"}),a.prev_index=a.cur_index):"/"===n&&"/"===c?(a.cur_index++,o.push({type:state_operator,value:"//"}),a.prev_index=a.cur_index):(o.push({type:state_operator,value:c}),a.prev_index=a.cur_index),a.curr_state=state_initial;break;case state_var:var_members_char.includes(n)?a.cur_index++:push_token$3(o,a);break;case state_scientific:if(number_char.includes(n))a.cur_index++;else if("+-".includes(n)){var s=a.prev_index;"+-".includes(e[s])&&(s+=1);var l=e.slice(s,a.cur_index),f=l.at(-1);l.includes(n)||"e"!==f?push_token$3(o,a):a.cur_index++}else r&&-1==="*/+-() ".indexOf(n)?a.cur_index++:push_token$3(o,a);break;default:throw new Error("字符扫描状态错误")}return a.prev_index<a.cur_index&&push_token$3(o,a),o.has_var=a.has_var,o.has_unit=a.has_unit,o.unit=a.unit_str,o}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,a,i,o,u,c,s,l,f=A.prototype={constructor:A,toString:null,valueOf:null},p=new A(1),_=20,h=4,v=-7,m=21,d=-1e7,b=1e7,g=!1,y=1,w=0,S={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},x="0123456789abcdefghijklmnopqrstuvwxyz",E=!0;function A(e,t){var a,i,o,u,c,s,l,f,p=this;if(!(p instanceof A))return new A(e,t);if(null==t){if(e&&!0===e._isBigNumber)return p.s=e.s,void(!e.c||e.e>b?p.c=p.e=null:e.e<d?p.c=[p.e=0]:(p.e=e.e,p.c=e.c.slice()));if((s="number"==typeof e)&&0*e==0){if(p.s=1/e<0?(e=-e,-1):1,e===~~e){for(u=0,c=e;c>=10;c/=10,u++);return void(u>b?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,s);p.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(u=f.indexOf("."))>-1&&(f=f.replace(".","")),(c=f.search(/e/i))>0?(u<0&&(u=c),u+=+f.slice(c+1),f=f.substring(0,c)):u<0&&(u=f.length)}else{if(intCheck(t,2,x.length,"Base"),10==t&&E)return T(p=new A(e),_+p.e+1,h);if(f=String(e),s="number"==typeof e){if(0*e!=0)return n(p,f,s,t);if(p.s=1/e<0?(f=f.slice(1),-1):1,A.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(a=x.slice(0,t),u=c=0,l=f.length;c<l;c++)if(a.indexOf(i=f.charAt(c))<0){if("."==i){if(c>u){u=l;continue}}else if(!o&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){o=!0,c=-1,u=0;continue}return n(p,String(e),s,t)}s=!1,(u=(f=r(f,t,10,p.s)).indexOf("."))>-1?f=f.replace(".",""):u=f.length}for(c=0;48===f.charCodeAt(c);c++);for(l=f.length;48===f.charCodeAt(--l););if(f=f.slice(c,++l)){if(l-=c,s&&A.DEBUG&&l>15&&(e>MAX_SAFE_INTEGER||e!==mathfloor(e)))throw Error(tooManyDigits+p.s*e);if((u=u-c-1)>b)p.c=p.e=null;else if(u<d)p.c=[p.e=0];else{if(p.e=u,p.c=[],c=(u+1)%LOG_BASE,u<0&&(c+=LOG_BASE),c<l){for(c&&p.c.push(+f.slice(0,c)),l-=LOG_BASE;c<l;)p.c.push(+f.slice(c,c+=LOG_BASE));c=LOG_BASE-(f=f.slice(c)).length}else c-=l;for(;c--;f+="0");p.c.push(+f)}}else p.c=[p.e=0]}function O(e,t,r,n){var a,i,o,u,c;if(null==r?r=h:intCheck(r,0,8),!e.c)return e.toString();if(a=e.c[0],o=e.e,null==t)c=coeffToString(e.c),c=1==n||2==n&&(o<=v||o>=m)?toExponential(c,o):toFixedPoint(c,o,"0");else if(i=(e=T(new A(e),t,r)).e,u=(c=coeffToString(e.c)).length,1==n||2==n&&(t<=i||i<=v)){for(;u<t;c+="0",u++);c=toExponential(c,i)}else if(t-=o,c=toFixedPoint(c,i,"0"),i+1>u){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=i-u)>0)for(i+1==u&&(c+=".");t--;c+="0");return e.s<0&&a?"-"+c:c}function k(e,t){for(var r,n=1,a=new A(e[0]);n<e.length;n++){if(!(r=new A(e[n])).s){a=r;break}t.call(a,r)&&(a=r)}return a}function N(e,t,r){for(var n=1,a=t.length;!t[--a];t.pop());for(a=t[0];a>=10;a/=10,n++);return(r=n+r*LOG_BASE-1)>b?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 a,i,o,u,c,s,l,f=e.c,p=POWS_TEN;if(f){e:{for(a=1,u=f[0];u>=10;u/=10,a++);if((i=t-a)<0)i+=LOG_BASE,o=t,l=(c=f[s=0])/p[a-o-1]%10|0;else if((s=mathceil((i+1)/LOG_BASE))>=f.length){if(!n)break e;for(;f.length<=s;f.push(0));c=l=0,a=1,o=(i%=LOG_BASE)-LOG_BASE+1}else{for(c=u=f[s],a=1;u>=10;u/=10,a++);l=(o=(i%=LOG_BASE)-LOG_BASE+a)<0?0:c/p[a-o-1]%10|0}if(n=n||t<0||null!=f[s+1]||(o<0?c:c%p[a-o-1]),n=r<4?(l||n)&&(0==r||r==(e.s<0?3:2)):l>5||5==l&&(4==r||n||6==r&&(i>0?o>0?c/p[a-o]:0:f[s-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==i?(f.length=s,u=1,s--):(f.length=s+1,u=p[LOG_BASE-i],f[s]=o>0?mathfloor(c/p[a-o]%p[o])*u:0),n)for(;;){if(0==s){for(i=1,o=f[0];o>=10;o/=10,i++);for(o=f[0]+=u,u=1;o>=10;o/=10,u++);i!=u&&(e.e++,f[0]==BASE&&(f[0]=1));break}if(f[s]+=u,f[s]!=BASE)break;f[s--]=0,u=1}for(i=f.length;0===f[--i];f.pop());}e.e>b?e.c=e.e=null:e.e<d&&(e.c=[e.e=0])}return e}function B(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 A.clone=clone,A.ROUND_UP=0,A.ROUND_DOWN=1,A.ROUND_CEIL=2,A.ROUND_FLOOR=3,A.ROUND_HALF_UP=4,A.ROUND_HALF_DOWN=5,A.ROUND_HALF_EVEN=6,A.ROUND_HALF_CEIL=7,A.ROUND_HALF_FLOOR=8,A.EUCLID=9,A.config=A.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],b=r[1];else{if(intCheck(r,-MAX,MAX,t),!r)throw Error(bignumberError+t+" cannot be zero: "+r);d=-(b=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 g=!r,Error(bignumberError+"crypto unavailable");g=r}else g=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);E="0123456789"==r.slice(0,10),x=r}}return{DECIMAL_PLACES:_,ROUNDING_MODE:h,EXPONENTIAL_AT:[v,m],RANGE:[d,b],CRYPTO:g,MODULO_MODE:y,POW_PRECISION:w,FORMAT:S,ALPHABET:x}},A.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!A.DEBUG)return!0;var t,r,n=e.c,a=e.e,i=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===i||-1===i)&&a>=-MAX&&a<=MAX&&a===mathfloor(a)){if(0===n[0]){if(0===a&&1===n.length)return!0;break e}if((t=(a+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===a&&(null===i||1===i||-1===i))return!0;throw Error(bignumberError+"Invalid BigNumber: "+e)},A.maximum=A.max=function(){return k(arguments,f.lt)},A.minimum=A.min=function(){return k(arguments,f.gt)},A.random=(a=9007199254740992,i=Math.random()*a&2097151?function(){return mathfloor(Math.random()*a)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,a,o,u=0,c=[],s=new A(p);if(null==e?e=_:intCheck(e,0,MAX),a=mathceil(e/LOG_BASE),g)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(a*=2));u<a;)(o=131072*t[u]+(t[u+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[u]=r[0],t[u+1]=r[1]):(c.push(o%1e14),u+=2);u=a/2}else{if(!crypto.randomBytes)throw g=!1,Error(bignumberError+"crypto unavailable");for(t=crypto.randomBytes(a*=7);u<a;)(o=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):(c.push(o%1e14),u+=7);u=a/7}if(!g)for(;u<a;)(o=i())<9e15&&(c[u++]=o%1e14);for(a=c[--u],e%=LOG_BASE,a&&e&&(o=POWS_TEN[LOG_BASE-e],c[u]=mathfloor(a/o)*o);0===c[u];c.pop(),u--);if(u<0)c=[n=0];else{for(n=-1;0===c[0];c.splice(0,1),n-=LOG_BASE);for(u=1,o=c[0];o>=10;o/=10,u++);u<LOG_BASE&&(n-=LOG_BASE-u)}return s.e=n,s.c=c,s}),A.sum=function(){for(var e=1,t=arguments,r=new A(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 a,i,o=[0],u=0,c=e.length;u<c;){for(i=o.length;i--;o[i]*=t);for(o[0]+=n.indexOf(e.charAt(u++)),a=0;a<o.length;a++)o[a]>r-1&&(null==o[a+1]&&(o[a+1]=0),o[a+1]+=o[a]/r|0,o[a]%=r)}return o.reverse()}return function(n,a,i,o,u){var c,s,l,f,p,v,m,d,b=n.indexOf("."),g=_,y=h;for(b>=0&&(f=w,w=0,n=n.replace(".",""),v=(d=new A(a)).pow(n.length-b),w=f,d.c=r(toFixedPoint(coeffToString(v.c),v.e,"0"),10,i,e),d.e=d.c.length),l=f=(m=r(n,a,i,u?(c=x,e):(c=e,x))).length;0==m[--f];m.pop());if(!m[0])return c.charAt(0);if(b<0?--l:(v.c=m,v.e=l,v.s=o,m=(v=t(v,d,g,y,i)).c,p=v.r,l=v.e),b=m[s=l+g+1],f=i/2,p=p||s<0||null!=m[s+1],p=y<4?(null!=b||p)&&(0==y||y==(v.s<0?3:2)):b>f||b==f&&(4==y||p||6==y&&1&m[s-1]||y==(v.s<0?8:7)),s<1||!m[0])n=p?toFixedPoint(c.charAt(1),-g,c.charAt(0)):c.charAt(0);else{if(m.length=s,p)for(--i;++m[--s]>i;)m[s]=0,s||(++l,m=[1].concat(m));for(f=m.length;!m[--f];);for(b=0,n="";b<=f;n+=c.charAt(m[b++]));n=toFixedPoint(n,l,c.charAt(0))}return n}}(),t=function(){function e(e,t,r){var n,a,i,o,u=0,c=e.length,s=t%SQRT_BASE,l=t/SQRT_BASE|0;for(e=e.slice();c--;)u=((a=s*(i=e[c]%SQRT_BASE)+(n=l*i+(o=e[c]/SQRT_BASE|0)*s)%SQRT_BASE*SQRT_BASE+u)/r|0)+(n/SQRT_BASE|0)+l*o,e[c]=a%r;return u&&(e=[u].concat(e)),e}function t(e,t,r,n){var a,i;if(r!=n)i=r>n?1:-1;else for(a=i=0;a<r;a++)if(e[a]!=t[a]){i=e[a]>t[a]?1:-1;break}return i}function r(e,t,r,n){for(var a=0;r--;)e[r]-=a,a=e[r]<t[r]?1:0,e[r]=a*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,a,i,o,u){var c,s,l,f,p,_,h,v,m,d,b,g,y,w,S,x,E,O=n.s==a.s?1:-1,k=n.c,N=a.c;if(!(k&&k[0]&&N&&N[0]))return new A(n.s&&a.s&&(k?!N||k[0]!=N[0]:N)?k&&0==k[0]||!N?0*O:O/0:NaN);for(m=(v=new A(O)).c=[],O=i+(s=n.e-a.e)+1,u||(u=BASE,s=bitFloor(n.e/LOG_BASE)-bitFloor(a.e/LOG_BASE),O=O/LOG_BASE|0),l=0;N[l]==(k[l]||0);l++);if(N[l]>(k[l]||0)&&s--,O<0)m.push(1),f=!0;else{for(w=k.length,x=N.length,l=0,O+=2,(p=mathfloor(u/(N[0]+1)))>1&&(N=e(N,p,u),k=e(k,p,u),x=N.length,w=k.length),y=x,b=(d=k.slice(0,x)).length;b<x;d[b++]=0);E=N.slice(),E=[0].concat(E),S=N[0],N[1]>=u/2&&S++;do{if(p=0,(c=t(N,d,x,b))<0){if(g=d[0],x!=b&&(g=g*u+(d[1]||0)),(p=mathfloor(g/S))>1)for(p>=u&&(p=u-1),h=(_=e(N,p,u)).length,b=d.length;1==t(_,d,h,b);)p--,r(_,x<h?E:N,h,u),h=_.length,c=1;else 0==p&&(c=p=1),h=(_=N.slice()).length;if(h<b&&(_=[0].concat(_)),r(d,_,b,u),b=d.length,-1==c)for(;t(N,d,x,b)<1;)p++,r(d,x<b?E:N,b,u),b=d.length}else 0===c&&(p++,d=[0]);m[l++]=p,d[0]?d[b++]=k[y]||0:(d=[k[y]],b=1)}while((y++<w||null!=d[0])&&O--);f=null!=d[0],m[0]||m.splice(0,1)}if(u==BASE){for(l=1,O=m[0];O>=10;O/=10,l++);T(v,i+(v.e=l+s*LOG_BASE-1)+1,o,f)}else v.e=s,v.r=+f;return v}}(),o=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,c=/^\.([^.]+)$/,s=/^-?(Infinity|NaN)$/,l=/^\s*\+(?=[\w.])|^\s+|\s+$/g,n=function(e,t,r,n){var a,i=r?t:t.replace(l,"");if(s.test(i))e.s=isNaN(i)?null:i<0?-1:1;else{if(!r&&(i=i.replace(o,(function(e,t,r){return a="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=a?e:t})),n&&(a=n,i=i.replace(u,"$1").replace(c,"0.$1")),t!=i))return new A(i,a);if(A.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 A(this);return e.s<0&&(e.s=1),e},f.comparedTo=function(e,t){return compare(this,new A(e,t))},f.decimalPlaces=f.dp=function(e,t){var r,n,a,i=this;if(null!=e)return intCheck(e,0,MAX),null==t?t=h:intCheck(t,0,8),T(new A(i),e+i.e+1,t);if(!(r=i.c))return null;if(n=((a=r.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,a=r[a])for(;a%10==0;a/=10,n--);return n<0&&(n=0),n},f.dividedBy=f.div=function(e,r){return t(this,new A(e,r),_,h)},f.dividedToIntegerBy=f.idiv=function(e,r){return t(this,new A(e,r),0,1)},f.exponentiatedBy=f.pow=function(e,t){var r,n,a,i,o,u,c,s,l=this;if((e=new A(e)).c&&!e.isInteger())throw Error(bignumberError+"Exponent not an integer: "+B(e));if(null!=t&&(t=new A(t)),o=e.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!e.c||!e.c[0])return s=new A(Math.pow(+B(l),o?e.s*(2-isOdd(e)):+B(e))),t?s.mod(t):s;if(u=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new A(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||o&&l.c[1]>=24e7:l.c[0]<8e13||o&&l.c[0]<=9999975e7)))return i=l.s<0&&isOdd(e)?-0:0,l.e>-1&&(i=1/i),new A(u?1/i:i);w&&(i=mathceil(w/LOG_BASE+2))}for(o?(r=new A(.5),u&&(e.s=1),c=isOdd(e)):c=(a=Math.abs(+B(e)))%2,s=new A(p);;){if(c){if(!(s=s.times(l)).c)break;i?s.c.length>i&&(s.c.length=i):n&&(s=s.mod(t))}if(a){if(0===(a=mathfloor(a/2)))break;c=a%2}else if(T(e=e.times(r),e.e+1,1),e.e>14)c=isOdd(e);else{if(0===(a=+B(e)))break;c=a%2}l=l.times(l),i?l.c&&l.c.length>i&&(l.c.length=i):n&&(l=l.mod(t))}return n?s:(u&&(s=p.div(s)),t?s.mod(t):i?T(s,w,h,undefined):s)},f.integerValue=function(e){var t=new A(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 A(e,t))},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(e,t){return compare(this,new A(e,t))>0},f.isGreaterThanOrEqualTo=f.gte=function(e,t){return 1===(t=compare(this,new A(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 A(e,t))<0},f.isLessThanOrEqualTo=f.lte=function(e,t){return-1===(t=compare(this,new A(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,a,i,o=this,u=o.s;if(t=(e=new A(e,t)).s,!u||!t)return new A(NaN);if(u!=t)return e.s=-t,o.plus(e);var c=o.e/LOG_BASE,s=e.e/LOG_BASE,l=o.c,f=e.c;if(!c||!s){if(!l||!f)return l?(e.s=-t,e):new A(f?o:NaN);if(!l[0]||!f[0])return f[0]?(e.s=-t,e):new A(l[0]?o:3==h?-0:0)}if(c=bitFloor(c),s=bitFloor(s),l=l.slice(),u=c-s){for((i=u<0)?(u=-u,a=l):(s=c,a=f),a.reverse(),t=u;t--;a.push(0));a.reverse()}else for(n=(i=(u=l.length)<(t=f.length))?u:t,u=t=0;t<n;t++)if(l[t]!=f[t]){i=l[t]<f[t];break}if(i&&(a=l,l=f,f=a,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),--s);return l[0]?N(e,l,s):(e.s=3==h?-1:1,e.c=[e.e=0],e)},f.modulo=f.mod=function(e,r){var n,a,i=this;return e=new A(e,r),!i.c||!e.s||e.c&&!e.c[0]?new A(NaN):!e.c||i.c&&!i.c[0]?new A(i):(9==y?(a=e.s,e.s=1,n=t(i,e,0,3),e.s=a,n.s*=a):n=t(i,e,0,y),(e=i.minus(n.times(e))).c[0]||1!=y||(e.s=i.s),e)},f.multipliedBy=f.times=function(e,t){var r,n,a,i,o,u,c,s,l,f,p,_,h,v,m,d=this,b=d.c,g=(e=new A(e,t)).c;if(!(b&&g&&b[0]&&g[0]))return!d.s||!e.s||b&&!b[0]&&!g||g&&!g[0]&&!b?e.c=e.e=e.s=null:(e.s*=d.s,b&&g?(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,(c=b.length)<(f=g.length)&&(h=b,b=g,g=h,a=c,c=f,f=a),a=c+f,h=[];a--;h.push(0));for(v=BASE,m=SQRT_BASE,a=f;--a>=0;){for(r=0,p=g[a]%m,_=g[a]/m|0,i=a+(o=c);i>a;)r=((s=p*(s=b[--o]%m)+(u=_*s+(l=b[o]/m|0)*p)%m*m+h[i]+r)/v|0)+(u/m|0)+_*l,h[i--]=s%v;h[i]=r}return r?++n:h.splice(0,1),N(e,h,n)},f.negated=function(){var e=new A(this);return e.s=-e.s||null,e},f.plus=function(e,t){var r,n=this,a=n.s;if(t=(e=new A(e,t)).s,!a||!t)return new A(NaN);if(a!=t)return e.s=-t,n.minus(e);var i=n.e/LOG_BASE,o=e.e/LOG_BASE,u=n.c,c=e.c;if(!i||!o){if(!u||!c)return new A(a/0);if(!u[0]||!c[0])return c[0]?e:new A(u[0]?n:0*a)}if(i=bitFloor(i),o=bitFloor(o),u=u.slice(),a=i-o){for(a>0?(o=i,r=c):(a=-a,r=u),r.reverse();a--;r.push(0));r.reverse()}for((a=u.length)-(t=c.length)<0&&(r=c,c=u,u=r,t=a),a=0;t;)a=(u[--t]=u[t]+c[t]+a)/BASE|0,u[t]=BASE===u[t]?0:u[t]%BASE;return a&&(u=[a].concat(u),++o),N(e,u,o)},f.precision=f.sd=function(e,t){var r,n,a,i=this;if(null!=e&&e!==!!e)return intCheck(e,1,MAX),null==t?t=h:intCheck(t,0,8),T(new A(i),e,t);if(!(r=i.c))return null;if(n=(a=r.length-1)*LOG_BASE+1,a=r[a]){for(;a%10==0;a/=10,n--);for(a=r[0];a>=10;a/=10,n++);}return e&&i.e+1>n&&(n=i.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,a,i,o=this,u=o.c,c=o.s,s=o.e,l=_+4,f=new A("0.5");if(1!==c||!u||!u[0])return new A(!c||c<0&&(!u||u[0])?NaN:u?o:1/0);if(0==(c=Math.sqrt(+B(o)))||c==1/0?(((r=coeffToString(u)).length+s)%2==0&&(r+="0"),c=Math.sqrt(+r),s=bitFloor((s+1)/2)-(s<0||s%2),n=new A(r=c==1/0?"5e"+s:(r=c.toExponential()).slice(0,r.indexOf("e")+1)+s)):n=new A(c+""),n.c[0])for((c=(s=n.e)+l)<3&&(c=0);;)if(i=n,n=f.times(i.plus(t(o,i,l,1))),coeffToString(i.c).slice(0,c)===(r=coeffToString(n.c)).slice(0,c)){if(n.e<s&&--c,"9999"!=(r=r.slice(c-3,c+1))&&(a||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(T(n,n.e+_+2,1),e=!n.times(n).eq(o));break}if(!a&&(T(i,i.e+_+2,0),i.times(i).eq(o))){n=i;break}l+=4,c+=4,a=1}return T(n,n.e+_+1,h,e)},f.toExponential=function(e,t){return null!=e&&(intCheck(e,0,MAX),e++),O(this,e,t,1)},f.toFixed=function(e,t){return null!=e&&(intCheck(e,0,MAX),e=e+this.e+1),O(this,e,t)},f.toFormat=function(e,t,r){var n,a=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=a.toFixed(e,t),a.c){var i,o=n.split("."),u=+r.groupSize,c=+r.secondaryGroupSize,s=r.groupSeparator||"",l=o[0],f=o[1],p=a.s<0,_=p?l.slice(1):l,h=_.length;if(c&&(i=u,u=c,c=i,h-=i),u>0&&h>0){for(i=h%u||u,l=_.substr(0,i);i<h;i+=u)l+=s+_.substr(i,u);c>0&&(l+=s+_.slice(i)),p&&(l="-"+l)}n=f?l+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):l}return(r.prefix||"")+n+(r.suffix||"")},f.toFraction=function(e){var r,n,a,i,o,u,c,s,l,f,_,v,m=this,d=m.c;if(null!=e&&(!(c=new A(e)).isInteger()&&(c.c||1!==c.s)||c.lt(p)))throw Error(bignumberError+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+B(c));if(!d)return new A(m);for(r=new A(p),l=n=new A(p),a=s=new A(p),v=coeffToString(d),o=r.e=v.length-m.e-1,r.c[0]=POWS_TEN[(u=o%LOG_BASE)<0?LOG_BASE+u:u],e=!e||c.comparedTo(r)>0?o>0?r:l:c,u=b,b=1/0,c=new A(v),s.c[0]=0;f=t(c,r,0,1),1!=(i=n.plus(f.times(a))).comparedTo(e);)n=a,a=i,l=s.plus(f.times(i=l)),s=i,r=c.minus(f.times(i=r)),c=i;return i=t(e.minus(n),a,0,1),s=s.plus(i.times(l)),n=n.plus(i.times(a)),s.s=l.s=m.s,_=t(l,a,o*=2,h).minus(m).abs().comparedTo(t(s,n,o,h).minus(m).abs())<1?[l,a]:[s,n],b=u,_},f.toNumber=function(){return+B(this)},f.toPrecision=function(e,t){return null!=e&&intCheck(e,1,MAX),O(this,e,t,2)},f.toString=function(e){var t,n=this,a=n.s,i=n.e;return null===i?a?(t="Infinity",a<0&&(t="-"+t)):t="NaN":(null==e?t=i<=v||i>=m?toExponential(coeffToString(n.c),i):toFixedPoint(coeffToString(n.c),i,"0"):10===e&&E?t=toFixedPoint(coeffToString((n=T(new A(n),_+i+1,h)).c),n.e,"0"):(intCheck(e,2,x.length,"Base"),t=r(toFixedPoint(coeffToString(n.c),i,"0"),10,e,a,!0)),a<0&&n.c[0]&&(t="-"+t)),t},f.valueOf=f.toJSON=function(){return B(this)},f._isBigNumber=!0,f[Symbol.toStringTag]="BigNumber",f[Symbol.for("nodejs.util.inspect.custom")]=f.valueOf,null!=e&&A.set(e),A}function bitFloor(e){var t=0|e;return e>0||e===t?t:t-1}function coeffToString(e){for(var t,r,n=1,a=e.length,i=e[0]+"";n<a;){for(t=e[n++]+"",r=LOG_BASE-t.length;r--;t="0"+t);i+=t}for(a=i.length;48===i.charCodeAt(--a););return i.slice(0,a+1||1)}function compare(e,t){var r,n,a=e.c,i=t.c,o=e.s,u=t.s,c=e.e,s=t.e;if(!o||!u)return null;if(r=a&&!a[0],n=i&&!i[0],r||n)return r?n?0:-u:o;if(o!=u)return o;if(r=o<0,n=c==s,!a||!i)return n?0:!a^r?1:-1;if(!n)return c>s^r?1:-1;for(u=(c=a.length)<(s=i.length)?c:s,o=0;o<u;o++)if(a[o]!=i[o])return a[o]>i[o]^r?1:-1;return c==s?0:c>s^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,a;if(t<0){for(a=r+".";++t;a+=r);e=a+e}else if(++t>(n=e.length)){for(a=r,t-=n;--t;a+=r);e+=a}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 a=BigNumber(r).toExponential();return[n.sign&&!a.startsWith("-")?"+"+a:a,n]}if(n.fraction){var i=BigNumber(r).toFraction().map((function(e){return e.toFixed()})).join("/");return[n.sign&&!i.startsWith("-")?"+"+i:i,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 close_important_push(){}function open_important_push(){}function open_debug(){}function close_debug(){}function calc_wrap(e,t){var r={_error:"-"};return["string","number"].includes(_typeof(e))?void 0===t?/[a-zA-Z$_]/.test(e.toString())?function(t){return Array.isArray(t)?t.unshift(r):t=_objectSpread2(_objectSpread2({},r),t),calc(e,t)}:calc(e):(Array.isArray(t)?t.unshift(r):t=_objectSpread2(_objectSpread2({},r),t),calc(e,t)):(Array.isArray(e)?e.unshift(r):e=_objectSpread2(_objectSpread2({},r),e),function(t){return calc(t,e)})}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$2(e,t,r){if(Number.isNaN(Number(t)))if("-"===t||"+"===t)0===e.length||"operator"===e.at(-1).type||"("===e.at(-1).value?e.push({type:"number",value:t,real_value:t,has_unit:!1}):e.push({type:"operator",value:t});else if(operator.has(t))e.push({type:"operator",value:t});else if(r._unit&&/^[+-]?\d/.test(t)){var n,a=split_unit_num(t),i=a.num,o=a.unit;if(void 0===o)e.push({type:"number",value:i,real_value:i,has_unit:!1});else r.has_unit=!0,null!==(n=r.unit_str)&&void 0!==n||(r.unit_str=o),e.push({type:"number",value:i,real_value:i,has_unit:!0,unit:o})}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 c,s=split_unit_num(u),l=s.num,f=s.unit;if(void 0===f)e.push({type:"var",value:t,real_value:l,has_unit:!1});else r.has_unit=!0,null!==(c=r.unit_str)&&void 0!==c||(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){for(var n,a=0,i=0,o=e.length,u=[],c={has_var:!1,has_unit:!1,unit_str:void 0,_unit:r,fill_data:t};i<o;)" "===(n=e[i])?(i>a&&push_token$2(u,e.slice(a,i),c),a=i+1):"("===n?(u.push({type:state_bracket,value:"("}),a=i+1):")"===n&&(i>a&&push_token$2(u,e.slice(a,i),c),u.push({type:state_bracket,value:")"}),a=i+1),i++;return i>a&&push_token$2(u,e.slice(a,i),c),u.has_var=c.has_var,u.has_unit=c.has_unit,u.unit=c.unit_str,u}var cache_map=new Map,clear_ing=!1;function clear_cache(){var e,t,r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{maximum:2e3,use_count:100},a=null!==(e=n.maximum)&&void 0!==e?e:2e3,i=null!==(t=n.use_count)&&void 0!==t?t:100,o=0,u=_createForOfIteratorHelper(cache_map.entries());try{for(u.s();!(r=u.n()).done;){var c=r.value;(++o>a||c[1].count<i)&&cache_map.delete(c[0])}}catch(e){u.e(e)}finally{u.f()}clear_ing=!1}function get_cache_data(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"value",n=cache_map.get(e);if(void 0===n){var a={count:0,value:t()};return cache_map.set(e,a),"value"===r?a.value:a}return n.count++,"value"===r?n.value:n}function __get_cache_map(){return cache_map}function check_cache(){!clear_ing&&cache_map.size>5e3&&(clear_ing=!0,Promise.resolve().then((function(){return clear_cache})))}var operator_map={"+":0,"-":0,"*":1,"/":1,"%":1,"//":1,"**":2};function eval_tokens(e,t){if(1===e.length){var r=e[0];if("number"===r.type||"var"===r.type)return r.real_value;throw new Error("错误的表达式:".concat(r.value))}for(var n,a,i=[],o=[],u=0,c=e.length;u<c;u++)if("number"!==(n=e[u]).type&&"var"!==n.type)if("operator"!==n.type)if("("!==n.value){if(")"===n.value)for(var s=void 0;s=i.pop();){if("("===s){var l=o.at(-2);if("-"===l){var f=o.pop();o.pop(),o.push(BigNumber.isBigNumber(f)?f.negated():new BigNumber(f).negated())}else if("+"===l){var p=o.pop();o.pop(),o.push(p)}break}var _=o.pop(),h=o.pop();o.push(t(h,_,s))}}else i.push("(");else{var v=i.at(-1);if("("===v){i.push(n.value);continue}var m=operator_map[n.value];if(!i.length){i.push(n.value);continue}if(m<operator_map[v])for(var d=void 0;d=i.pop();){if("("===d){i.push("(");break}var b=o.pop(),g=o.pop();o.push(t(g,b,d))}else if(m===operator_map[v]){if("**"===n.value){i.push(n.value);continue}for(var y=void 0;y=i.pop();){if("("===y){i.push("(");break}if(operator_map[y]<m){i.push(y);break}var w=o.pop(),S=o.pop();o.push(t(S,w,y))}}i.push(n.value)}else o.push(n.real_value);for(;a=i.pop();){var x=o.pop(),E=o.pop();o.push(t(E,x,a))}if(1!==o.length)throw new Error("可能出现了错误的计算式");return e.has_var||(e.calc_result=o[0]),o[0]}function compute(e,t,r){if(void 0===e||void 0===t)throw new Error("无效的操作数对:v1:".concat(e,", v2:").concat(t));var n;switch(r){case"+":n=new BigNumber(e).plus(t);break;case"-":n=new BigNumber(e).minus(t);break;case"*":n=new BigNumber(e).times(t);break;case"/":n=new BigNumber(e).div(t);break;case"%":n=new BigNumber(e).mod(t);break;case"**":n=new BigNumber(e).pow(t);break;case"//":n=new BigNumber(e).idiv(t)}return n}function compute_memo(e,t,r){return get_cache_data("compute:".concat(e).concat(r).concat(t),(function(){return compute(e,t,r)}))}function push_token$1(e,t,r,n,a){t===state_var?(a.has_var=!0,e.push({type:t,value:r,real_value:get_real_value(a.fill_data,r)})):e.push({type:t,value:r}),n.prev=n.curr,a.state=state_initial}function fmt_tokenizer(e,t){for(var r,n={prev:0,curr:0},a=e.length,i={state:state_initial,fill_data:t,has_var:!1},o=[];n.curr<a;)switch(r=e[n.curr],i.state){case state_initial:if(" "===r)n.curr++,n.prev=n.curr;else if("<>=".includes(r))i.state=state_symbol,n.curr++;else if(","===r)n.curr++,push_token$1(o,state_comma,",",n,i);else if(var_char.includes(r))i.state=state_var,n.curr++;else if(number_char.includes(r))i.state=state_number,n.curr++;else if("+"===r)n.curr++,push_token$1(o,state_plus$1,"+",n,i);else if("~"===r)n.curr++,i.state=state_round;else if("%"===r)n.curr++,push_token$1(o,state_percent,"%",n,i);else if("/"===r)n.curr++,push_token$1(o,state_fraction,"/",n,i);else if("!"===r)if(i.state=state_initial,n.curr++,"n"===e[n.curr])n.curr++,push_token$1(o,state_to_number,"!n",n,i);else if("u"===e[n.curr])n.curr++,push_token$1(o,state_to_number_string,"!u",n,i);else{if("e"!==e[n.curr])throw new Error("无法识别的!模式字符:".concat(e[n.curr]));n.curr++,push_token$1(o,state_scientific,"!e",n,i)}else n.curr++,n.prev=n.curr;break;case state_symbol:"="===r&&n.curr++,push_token$1(o,state_symbol,e.slice(n.prev,n.curr),n,i);break;case state_number:number_char.includes(r)?n.curr++:push_token$1(o,state_number,e.slice(n.prev,n.curr),n,i);break;case state_var:var_members_char.includes(r)?n.curr++:push_token$1(o,state_var,e.slice(n.prev,n.curr),n,i);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$1(o,state_round,e.slice(n.prev,n.curr),n,i);break;default:throw new Error("错误的fmt分词器状态")}return n.prev<n.curr&&push_token$1(o,i.state,e.slice(n.prev,n.curr),n,i),o.has_var=i.has_var,o}var symbol_set=new Set(["<",">","=",">=","<="]),rand_set=new Set(["~+","~-","~5","~6"]);function push_token(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){for(var r,n=0,a=e.length,i={fill_data:t,has_var:!1},o=0,u=[];n<a;)" "===(r=e[n])?(n>o&&push_token(u,e.slice(o,n),i),o=n+1):"<>=".includes(r)&&("="===e[n+1]?(u.push({type:state_symbol,value:r+"="}),o=1+ ++n):(u.push({type:state_symbol,value:r}),o=n+1)),n++;return o<n&&push_token(u,e.slice(o,n),i),u.has_var=i.has_var,u}function fmt_tokenizer_memo(e,t){return get_cache_data("fmt-tokens:".concat(e),(function(){return fmt_tokenizer(e,t)}))}function fmt_tokenizer_space_memo(e,t){return get_cache_data("fmt-tokens-space:".concat(e),(function(){return fmt_tokenizer_space(e,t)}))}function calc_memo(e,t){var r,n,a=find_value(t,"_error"),i={};try{var o,u,c;if(null==t)return get_cache_data("calc:".concat(e),(function(){return calc(e,t)}));var s=parse_args(e,t,fmt_tokenizer_memo,fmt_tokenizer_space_memo),l=null!==(o=s._unit)&&void 0!==o&&o,f=null!==(u=s._mode)&&void 0!==u?u:"normal",p=s.fmt_tokens,_="space"===f||"space-all"===f?get_cache_data("tokens-space:".concat(s.expr,":").concat(l),(function(){return tokenizer_space(s.expr,s.fill_data,l)}),"item"):get_cache_data("tokens:".concat(s.expr,":").concat(l),(function(){return tokenizer(s.expr,s.fill_data,l)}),"item");(n=_.value).has_var&&_.count>0&&fill_tokens(n,s.fill_data,l);var h=null!==(c=n.calc_result)&&void 0!==c?c:eval_tokens(n,compute_memo);if(r=BigNumber.isBigNumber(h)?h:new BigNumber(h),void 0===p)r=r.toFixed();else{var v=_slicedToArray(format(r,p),2);r=v[0],i=v[1]}if("Infinity"===r||void 0===r)throw new Error("计算错误可能是非法的计算式")}catch(e){if(void 0===a)throw e;return a}return!n.has_unit||i.to_number||i.to_number_string||(r+=n.unit),check_cache(),r}var fmt_memo=calc_memo;function calc_wrap_memo(e,t){var r={_error:"-"};return["string","number"].includes(_typeof(e))?void 0===t?/[a-zA-Z$_]/.test(e.toString())?function(t){return Array.isArray(t)?t.unshift(r):t=_objectSpread2(_objectSpread2({},r),t),calc_memo(e,t)}:calc_memo(e):(Array.isArray(t)?t.unshift(r):t=_objectSpread2(_objectSpread2({},r),t),calc_memo(e,t)):(Array.isArray(e)?e.unshift(r):e=_objectSpread2(_objectSpread2({},r),e),function(t){return calc_memo(t,e)})}function calc(e,t){var r,n,a=find_value(t,"_error"),i={};try{var o,u,c=parse_args(e,t,fmt_tokenizer,fmt_tokenizer_space),s=null!==(o=c._unit)&&void 0!==o&&o,l=null!==(u=c._mode)&&void 0!==u?u:"normal",f=c.fmt_tokens,p=eval_tokens(n="space"===l||"space-all"===l?tokenizer_space(c.expr,c.fill_data,s):tokenizer(c.expr,c.fill_data,s),compute);if(r=BigNumber.isBigNumber(p)?p:new BigNumber(p),void 0===f)r=r.toFixed();else{var _=_slicedToArray(format(r,f),2);r=_[0],i=_[1]}if("Infinity"===r||void 0===r)throw new Error("计算错误可能是非法的计算式")}catch(e){if(void 0===a)throw e;return a}return!n.has_unit||i.to_number||i.to_number_string||(r+=n.unit),r}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",a="compute:"+e+"+b";return cache_map.has(a)?((r=cache_map.get(a)).count++,"number"===n?r.value.toNumber():r.value.toFixed()):(r={count:0,value:new BigNumber(e).plus(t)},check_cache(),"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",a="compute:"+e+"-b";return cache_map.has(a)?((r=cache_map.get(a)).count++,"number"===n?r.value.toNumber():r.value.toFixed()):(r={count:0,value:new BigNumber(e).minus(t)},check_cache(),"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",a="compute:"+e+"*b";return cache_map.has(a)?((r=cache_map.get(a)).count++,"number"===n?r.value.toNumber():r.value.toFixed()):(r={count:0,value:new BigNumber(e).times(t)},check_cache(),"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",a="compute:"+e+"/b";return cache_map.has(a)?((r=cache_map.get(a)).count++,"number"===n?r.value.toNumber():r.value.toFixed()):(r={count:0,value:new BigNumber(e).div(t)},check_cache(),"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",a="compute:"+e+"%b";return cache_map.has(a)?((r=cache_map.get(a)).count++,"number"===n?r.value.toNumber():r.value.toFixed()):(r={count:0,value:new BigNumber(e).mod(t)},check_cache(),"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",a="compute:"+e+"**b";return cache_map.has(a)?((r=cache_map.get(a)).count++,"number"===n?r.value.toNumber():r.value.toFixed()):(r={count:0,value:new BigNumber(e).pow(t)},check_cache(),"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",a="compute:"+e+"//b";return cache_map.has(a)?((r=cache_map.get(a)).count++,"number"===n?r.value.toNumber():r.value.toFixed()):(r={count:0,value:new BigNumber(e).idiv(t)},check_cache(),"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_memo,calc_util,calc_wrap,calc_wrap_memo,div,div_memo,fmt,fmt_memo,idiv,idiv_memo,mod,mod_memo,mul,mul_memo,parse_thousands,plus,plus_memo,pow,pow_memo,sub,sub_memo,version};
|
|
1
|
+
function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,u=[],s=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}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},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.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,i){var o=t&&t.prototype instanceof p?t:p,a=Object.create(o.prototype),u=new A(i||[]);return n(a,"_invoke",{value:w(e,r,u)}),a}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 h(){}function _(){}var v={};s(v,o,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(O([])));m&&m!==t&&r.call(m,o)&&(v=m);var g=_.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 i(n,o,a,u){var s=l(e[n],e,o);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){i("next",e,a,u)}),(function(e){i("throw",e,a,u)})):t.resolve(f).then((function(e){c.value=e,a(c)}),(function(e){return i("throw",e,a,u)}))}u(s.arg)}var o;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return o=o?o.then(n,n):n()}})}function w(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return N()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var u=S(a,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 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 i=l(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,f;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(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 x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function O(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=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 i.next=i}}return{next:N}}function N(){return{value:void 0,done:!0}}return h.prototype=_,n(g,"constructor",{value:_,configurable:!0}),n(_,"constructor",{value:h,configurable:!0}),h.displayName=s(_,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,s(e,u,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},b(y.prototype),s(y.prototype,a,(function(){return this})),e.AsyncIterator=y,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new y(c(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(g),s(g,u,"Generator"),s(g,o,(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=O,A.prototype={constructor:A,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(x),!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 a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),s=r.call(o,"finallyLoc");if(u&&s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},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),x(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 i=n.arg;x(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(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,i,o,a){try{var u=e[o](a),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,i)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){asyncGeneratorStep(o,n,i,a,u,"next",e)}function u(e){asyncGeneratorStep(o,n,i,a,u,"throw",e)}a(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="2.1.0";function decimal_round(e,t,r,n,i){var o=e,a=t,u=t.length,s={"~-":function(){var e="<"===r?n-1:n;a=t.slice(0,e)},"~+":function(){var e="<"===r?n-1:n;if(!(u<=e||0===u)){var i=t.slice(0,e);0==+t.slice(e,u)?a=i:(i=(+"9".concat(i)+1).toString().slice(1)).length>e?(a=i.slice(1,i.length),o=(+o+1).toString()):a=i}},"~5":function(){if(0!==u){var e="<"===r?n-1:n;a=t.slice(0,e);var i=+t[e];Number.isNaN(i)||i>=5&&(a=(+"9".concat(a)+1).toString().slice(1)).length>e&&(a=a.slice(1,a.length),o=(+o+1).toString())}},"~6":function(){if(0!==u){var i,s="<"===r?n-1:n,c=+t[s],l=t.slice(+s+1,t.length);l=""===l?0:parseInt(l),i=0===s?+e[e.length-1]:+t[s-1],a=t.slice(0,s),(c>=6||5===c&&l>0||5===c&&i%2!=0)&&(a=(+"9".concat(a)+1).toString().slice(1)).length>s&&(a=a.slice(1,a.length),o=(+o+1).toString())}}};return"<="===r?u<=n?a=t.replace(/0*$/,""):(s[i]&&s[i](),a=a.replace(/0+$/,"")):"<"===r?u<n?a=t.replace(/0*$/,""):(s[i]&&s[i](),a=a.replace(/0+$/,"")):"="===r?u<n?a=t+"0".repeat(n-u):u>n&&s[i]&&s[i]():">="===r?u<n&&(a=t+"0".repeat(n-u)):">"===r&&u<=n&&(a=t+"0".repeat(n-u+1)),{int_part:o,dec_part:a}}var 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",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 i=nativeObjectToString$1.call(e);return n&&(t?e[symToStringTag$1]=r:delete e[symToStringTag$1]),i}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=getNative(root$1,"Map"),Map$1=Map;function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$1||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,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};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,i){t.push(n?i.replace(reEscapeChar,"$1"):r||e)})),t})),stringToPath$1=stringToPath;function arrayMap(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}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,i=[/^([+-]?[\d.]+(?:e|E)(?:\+|-)?\d+)(.*)$/,/^([+-]?[\d.]+)(.*)$/],o=0;o<i.length;o++){var a=e.match(i[o]);if(a){n=a;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,i,o,a;return Array.isArray(e)?e.length>1?null!==(n=null!==(i=get(e[0],t))&&void 0!==i?i:get(e.at(-1),t))&&void 0!==n?n:r:1===e.length&&null!==(o=get(e[0],t))&&void 0!==o?o:r:null!==(a=get(e,t,r))&&void 0!==a?a:r}function parse_mantissa(e,t,r,n){var i=e.split("."),o=i[0],a=1===i.length?"":i[1],u=decimal_round(o,a,t,+r,n);return o=u.int_part,""===(a=u.dec_part)?o:"".concat(o,".").concat(a)}function integer_thousands(e){for(var t=e.length,r="";t>0;)r=e.substring(t-3,t)+(""!==r?",":"")+r,t-=3;return r}function parse_thousands(e){var t=e.split("."),r=t[0];return"-"===r[0]?t[0]="-"+integer_thousands(r.slice(1)):t[0]=integer_thousands(r),t.join(".")}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,i,o=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=o.length>1&&void 0!==o[1]?o[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:i=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",i);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,i=e.length;n<i;n++){var o;if(void 0!==(r=null!==(o=get(e[n],t))&&void 0!==o?o: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++}}function parse_args(e,t){var r="",n={origin_expr:e,origin_fill_data:t,expr:"",fmt_expr:"",options:void 0,fill_data:void 0,_unit:void 0,_mode:void 0,_fmt:void 0};if(null!=t&&(n.options=t,Array.isArray(t)?n.fill_data=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]),n._mode=find_value(t,"_mode"),n._unit=find_value(t,"_unit",!1),n._fmt=find_value(t,"_fmt"),"string"==typeof e){if(r=e,""===e.trim()||e.includes("NaN"))throw new Error("非法的表达式:".concat(e))}else{if("number"!=typeof e)throw new Error("错误的第一个参数类型: ".concat(e," 类型为:").concat(_typeof(e)));r=e.toString()}var i=r.split("|");return n.expr=i[0],i.length>1&&(n.fmt_expr=i[1].trim()),n}function push_token$3(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,i=split_unit_num(r),o=i.num,a=i.unit;if(void 0===a)e.push({type:state_number,value:o,real_value:o,has_unit:!1});else t.has_unit=!0,null!==(n=t.unit_str)&&void 0!==n||(t.unit_str=a),e.push({type:state_number,value:o,real_value:o,has_unit:!0,unit:a})}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){for(var n,i={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},o=e.length,a=[];i.cur_index<o;)switch(n=e[i.cur_index],i.curr_state){case state_initial:if(number_char.includes(n))i.curr_state=state_number,i.cur_index++;else if(" "===n)i.cur_index++,i.prev_index=i.cur_index;else if("+-".includes(n)){var u=a.at(-1);0===i.cur_index||"operator"===(null==u?void 0:u.type)||"("===(null==u?void 0:u.value)?(i.curr_state=state_number,i.cur_index++):(i.cur_index++,a.push({type:state_operator,value:e.slice(i.prev_index,i.cur_index)}),i.prev_index=i.cur_index)}else"*/%".includes(n)?(i.curr_state=state_operator,i.cur_index++):var_char.includes(n)?(i.curr_state=state_var,i.cur_index++):"()".includes(n)?(a.push({type:state_bracket,value:n}),i.curr_state=state_initial,i.cur_index++,i.prev_index=i.cur_index):(i.cur_index++,i.prev_index=i.cur_index);break;case state_number:if(number_char.includes(n))i.cur_index++;else if("."===n){if(i.cur_index===i.prev_index||e.slice(i.prev_index,i.cur_index).includes("."))throw new Error("非法的小数部分".concat(e.slice(i.prev_index,i.cur_index)));i.cur_index++}else"e"===n?(i.curr_state=state_scientific,i.cur_index++):r?"*/+-() ".indexOf(n)>-1||"%"===n&&number_char.includes(e[i.cur_index-1])&&pure_number_var_first_char.includes(get_next_nonempty_char(e,i.cur_index,o))?push_token$3(a,i):i.cur_index++:push_token$3(a,i);break;case state_operator:var s=e[i.cur_index-1];"*"===n&&"*"===s?(i.cur_index++,a.push({type:state_operator,value:"**"}),i.prev_index=i.cur_index):"/"===n&&"/"===s?(i.cur_index++,a.push({type:state_operator,value:"//"}),i.prev_index=i.cur_index):(a.push({type:state_operator,value:s}),i.prev_index=i.cur_index),i.curr_state=state_initial;break;case state_var:var_members_char.includes(n)?i.cur_index++:push_token$3(a,i);break;case state_scientific:if(number_char.includes(n))i.cur_index++;else if("+-".includes(n)){var c=i.prev_index;"+-".includes(e[c])&&(c+=1);var l=e.slice(c,i.cur_index),f=l.at(-1);l.includes(n)||"e"!==f?push_token$3(a,i):i.cur_index++}else r&&-1==="*/+-() ".indexOf(n)?i.cur_index++:push_token$3(a,i);break;default:throw new Error("字符扫描状态错误")}return i.prev_index<i.cur_index&&push_token$3(a,i),a.has_var=i.has_var,a.has_unit=i.has_unit,a.unit=i.unit_str,a}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,i,o,a,u,s,c,l,f=A.prototype={constructor:A,toString:null,valueOf:null},p=new A(1),h=20,_=4,v=-7,d=21,m=-1e7,g=1e7,b=!1,y=1,w=0,S={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},E="0123456789abcdefghijklmnopqrstuvwxyz",x=!0;function A(e,t){var i,o,a,u,s,c,l,f,p=this;if(!(p instanceof A))return new A(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<m?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,E.length,"Base"),10==t&&x)return T(p=new A(e),h+p.e+1,_);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,A.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(i=E.slice(0,t),u=s=0,l=f.length;s<l;s++)if(i.indexOf(o=f.charAt(s))<0){if("."==o){if(s>u){u=l;continue}}else if(!a&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){a=!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&&A.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<m)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 O(e,t,r,n){var i,o,a,u,s;if(null==r?r=_:intCheck(r,0,8),!e.c)return e.toString();if(i=e.c[0],a=e.e,null==t)s=coeffToString(e.c),s=1==n||2==n&&(a<=v||a>=d)?toExponential(s,a):toFixedPoint(s,a,"0");else if(o=(e=T(new A(e),t,r)).e,u=(s=coeffToString(e.c)).length,1==n||2==n&&(t<=o||o<=v)){for(;u<t;s+="0",u++);s=toExponential(s,o)}else if(t-=a,s=toFixedPoint(s,o,"0"),o+1>u){if(--t>0)for(s+=".";t--;s+="0");}else if((t+=o-u)>0)for(o+1==u&&(s+=".");t--;s+="0");return e.s<0&&i?"-"+s:s}function N(e,t){for(var r,n=1,i=new A(e[0]);n<e.length;n++){if(!(r=new A(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function k(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*LOG_BASE-1)>g?e.c=e.e=null:r<m?e.c=[e.e=0]:(e.e=r,e.c=t),e}function T(e,t,r,n){var i,o,a,u,s,c,l,f=e.c,p=POWS_TEN;if(f){e:{for(i=1,u=f[0];u>=10;u/=10,i++);if((o=t-i)<0)o+=LOG_BASE,a=t,l=(s=f[c=0])/p[i-a-1]%10|0;else if((c=mathceil((o+1)/LOG_BASE))>=f.length){if(!n)break e;for(;f.length<=c;f.push(0));s=l=0,i=1,a=(o%=LOG_BASE)-LOG_BASE+1}else{for(s=u=f[c],i=1;u>=10;u/=10,i++);l=(a=(o%=LOG_BASE)-LOG_BASE+i)<0?0:s/p[i-a-1]%10|0}if(n=n||t<0||null!=f[c+1]||(a<0?s:s%p[i-a-1]),n=r<4?(l||n)&&(0==r||r==(e.s<0?3:2)):l>5||5==l&&(4==r||n||6==r&&(o>0?a>0?s/p[i-a]: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==o?(f.length=c,u=1,c--):(f.length=c+1,u=p[LOG_BASE-o],f[c]=a>0?mathfloor(s/p[i-a]%p[a])*u:0),n)for(;;){if(0==c){for(o=1,a=f[0];a>=10;a/=10,o++);for(a=f[0]+=u,u=1;a>=10;a/=10,u++);o!=u&&(e.e++,f[0]==BASE&&(f[0]=1));break}if(f[c]+=u,f[c]!=BASE)break;f[c--]=0,u=1}for(o=f.length;0===f[--o];f.pop());}e.e>g?e.c=e.e=null:e.e<m&&(e.c=[e.e=0])}return e}function B(e){var t,r=e.e;return null===r?e.toString():(t=coeffToString(e.c),t=r<=v||r>=d?toExponential(t,r):toFixedPoint(t,r,"0"),e.s<0?"-"+t:t)}return A.clone=clone,A.ROUND_UP=0,A.ROUND_DOWN=1,A.ROUND_CEIL=2,A.ROUND_FLOOR=3,A.ROUND_HALF_UP=4,A.ROUND_HALF_DOWN=5,A.ROUND_HALF_EVEN=6,A.ROUND_HALF_CEIL=7,A.ROUND_HALF_FLOOR=8,A.EUCLID=9,A.config=A.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),h=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),v=r[0],d=r[1]):(intCheck(r,-MAX,MAX,t),v=-(d=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),m=r[0],g=r[1];else{if(intCheck(r,-MAX,MAX,t),!r)throw Error(bignumberError+t+" cannot be zero: "+r);m=-(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);S=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(bignumberError+t+" invalid: "+r);x="0123456789"==r.slice(0,10),E=r}}return{DECIMAL_PLACES:h,ROUNDING_MODE:_,EXPONENTIAL_AT:[v,d],RANGE:[m,g],CRYPTO:b,MODULO_MODE:y,POW_PRECISION:w,FORMAT:S,ALPHABET:E}},A.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!A.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-MAX&&i<=MAX&&i===mathfloor(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+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===i&&(null===o||1===o||-1===o))return!0;throw Error(bignumberError+"Invalid BigNumber: "+e)},A.maximum=A.max=function(){return N(arguments,f.lt)},A.minimum=A.min=function(){return N(arguments,f.gt)},A.random=(i=9007199254740992,o=Math.random()*i&2097151?function(){return mathfloor(Math.random()*i)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,a,u=0,s=[],c=new A(p);if(null==e?e=h:intCheck(e,0,MAX),i=mathceil(e/LOG_BASE),b)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));u<i;)(a=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(a%1e14),u+=2);u=i/2}else{if(!crypto.randomBytes)throw b=!1,Error(bignumberError+"crypto unavailable");for(t=crypto.randomBytes(i*=7);u<i;)(a=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(a%1e14),u+=7);u=i/7}if(!b)for(;u<i;)(a=o())<9e15&&(s[u++]=a%1e14);for(i=s[--u],e%=LOG_BASE,i&&e&&(a=POWS_TEN[LOG_BASE-e],s[u]=mathfloor(i/a)*a);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,a=s[0];a>=10;a/=10,u++);u<LOG_BASE&&(n-=LOG_BASE-u)}return c.e=n,c.c=s,c}),A.sum=function(){for(var e=1,t=arguments,r=new A(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 i,o,a=[0],u=0,s=e.length;u<s;){for(o=a.length;o--;a[o]*=t);for(a[0]+=n.indexOf(e.charAt(u++)),i=0;i<a.length;i++)a[i]>r-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}return function(n,i,o,a,u){var s,c,l,f,p,v,d,m,g=n.indexOf("."),b=h,y=_;for(g>=0&&(f=w,w=0,n=n.replace(".",""),v=(m=new A(i)).pow(n.length-g),w=f,m.c=r(toFixedPoint(coeffToString(v.c),v.e,"0"),10,o,e),m.e=m.c.length),l=f=(d=r(n,i,o,u?(s=E,e):(s=e,E))).length;0==d[--f];d.pop());if(!d[0])return s.charAt(0);if(g<0?--l:(v.c=d,v.e=l,v.s=a,d=(v=t(v,m,b,y,o)).c,p=v.r,l=v.e),g=d[c=l+b+1],f=o/2,p=p||c<0||null!=d[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&d[c-1]||y==(v.s<0?8:7)),c<1||!d[0])n=p?toFixedPoint(s.charAt(1),-b,s.charAt(0)):s.charAt(0);else{if(d.length=c,p)for(--o;++d[--c]>o;)d[c]=0,c||(++l,d=[1].concat(d));for(f=d.length;!d[--f];);for(g=0,n="";g<=f;n+=s.charAt(d[g++]));n=toFixedPoint(n,l,s.charAt(0))}return n}}(),t=function(){function e(e,t,r){var n,i,o,a,u=0,s=e.length,c=t%SQRT_BASE,l=t/SQRT_BASE|0;for(e=e.slice();s--;)u=((i=c*(o=e[s]%SQRT_BASE)+(n=l*o+(a=e[s]/SQRT_BASE|0)*c)%SQRT_BASE*SQRT_BASE+u)/r|0)+(n/SQRT_BASE|0)+l*a,e[s]=i%r;return u&&(e=[u].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,o,a,u){var s,c,l,f,p,h,_,v,d,m,g,b,y,w,S,E,x,O=n.s==i.s?1:-1,N=n.c,k=i.c;if(!(N&&N[0]&&k&&k[0]))return new A(n.s&&i.s&&(N?!k||N[0]!=k[0]:k)?N&&0==N[0]||!k?0*O:O/0:NaN);for(d=(v=new A(O)).c=[],O=o+(c=n.e-i.e)+1,u||(u=BASE,c=bitFloor(n.e/LOG_BASE)-bitFloor(i.e/LOG_BASE),O=O/LOG_BASE|0),l=0;k[l]==(N[l]||0);l++);if(k[l]>(N[l]||0)&&c--,O<0)d.push(1),f=!0;else{for(w=N.length,E=k.length,l=0,O+=2,(p=mathfloor(u/(k[0]+1)))>1&&(k=e(k,p,u),N=e(N,p,u),E=k.length,w=N.length),y=E,g=(m=N.slice(0,E)).length;g<E;m[g++]=0);x=k.slice(),x=[0].concat(x),S=k[0],k[1]>=u/2&&S++;do{if(p=0,(s=t(k,m,E,g))<0){if(b=m[0],E!=g&&(b=b*u+(m[1]||0)),(p=mathfloor(b/S))>1)for(p>=u&&(p=u-1),_=(h=e(k,p,u)).length,g=m.length;1==t(h,m,_,g);)p--,r(h,E<_?x:k,_,u),_=h.length,s=1;else 0==p&&(s=p=1),_=(h=k.slice()).length;if(_<g&&(h=[0].concat(h)),r(m,h,g,u),g=m.length,-1==s)for(;t(k,m,E,g)<1;)p++,r(m,E<g?x:k,g,u),g=m.length}else 0===s&&(p++,m=[0]);d[l++]=p,m[0]?m[g++]=N[y]||0:(m=[N[y]],g=1)}while((y++<w||null!=m[0])&&O--);f=null!=m[0],d[0]||d.splice(0,1)}if(u==BASE){for(l=1,O=d[0];O>=10;O/=10,l++);T(v,o+(v.e=l+c*LOG_BASE-1)+1,a,f)}else v.e=c,v.r=+f;return v}}(),a=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,s=/^\.([^.]+)$/,c=/^-?(Infinity|NaN)$/,l=/^\s*\+(?=[\w.])|^\s+|\s+$/g,n=function(e,t,r,n){var i,o=r?t:t.replace(l,"");if(c.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(a,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(u,"$1").replace(s,"0.$1")),t!=o))return new A(o,i);if(A.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 A(this);return e.s<0&&(e.s=1),e},f.comparedTo=function(e,t){return compare(this,new A(e,t))},f.decimalPlaces=f.dp=function(e,t){var r,n,i,o=this;if(null!=e)return intCheck(e,0,MAX),null==t?t=_:intCheck(t,0,8),T(new A(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},f.dividedBy=f.div=function(e,r){return t(this,new A(e,r),h,_)},f.dividedToIntegerBy=f.idiv=function(e,r){return t(this,new A(e,r),0,1)},f.exponentiatedBy=f.pow=function(e,t){var r,n,i,o,a,u,s,c,l=this;if((e=new A(e)).c&&!e.isInteger())throw Error(bignumberError+"Exponent not an integer: "+B(e));if(null!=t&&(t=new A(t)),a=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 A(Math.pow(+B(l),a?e.s*(2-isOdd(e)):+B(e))),t?c.mod(t):c;if(u=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new A(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||a&&l.c[1]>=24e7:l.c[0]<8e13||a&&l.c[0]<=9999975e7)))return o=l.s<0&&isOdd(e)?-0:0,l.e>-1&&(o=1/o),new A(u?1/o:o);w&&(o=mathceil(w/LOG_BASE+2))}for(a?(r=new A(.5),u&&(e.s=1),s=isOdd(e)):s=(i=Math.abs(+B(e)))%2,c=new A(p);;){if(s){if(!(c=c.times(l)).c)break;o?c.c.length>o&&(c.c.length=o):n&&(c=c.mod(t))}if(i){if(0===(i=mathfloor(i/2)))break;s=i%2}else if(T(e=e.times(r),e.e+1,1),e.e>14)s=isOdd(e);else{if(0===(i=+B(e)))break;s=i%2}l=l.times(l),o?l.c&&l.c.length>o&&(l.c.length=o):n&&(l=l.mod(t))}return n?c:(u&&(c=p.div(c)),t?c.mod(t):o?T(c,w,_,undefined):c)},f.integerValue=function(e){var t=new A(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 A(e,t))},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(e,t){return compare(this,new A(e,t))>0},f.isGreaterThanOrEqualTo=f.gte=function(e,t){return 1===(t=compare(this,new A(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 A(e,t))<0},f.isLessThanOrEqualTo=f.lte=function(e,t){return-1===(t=compare(this,new A(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,i,o,a=this,u=a.s;if(t=(e=new A(e,t)).s,!u||!t)return new A(NaN);if(u!=t)return e.s=-t,a.plus(e);var s=a.e/LOG_BASE,c=e.e/LOG_BASE,l=a.c,f=e.c;if(!s||!c){if(!l||!f)return l?(e.s=-t,e):new A(f?a:NaN);if(!l[0]||!f[0])return f[0]?(e.s=-t,e):new A(l[0]?a:3==_?-0:0)}if(s=bitFloor(s),c=bitFloor(c),l=l.slice(),u=s-c){for((o=u<0)?(u=-u,i=l):(c=s,i=f),i.reverse(),t=u;t--;i.push(0));i.reverse()}else for(n=(o=(u=l.length)<(t=f.length))?u:t,u=t=0;t<n;t++)if(l[t]!=f[t]){o=l[t]<f[t];break}if(o&&(i=l,l=f,f=i,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]?k(e,l,c):(e.s=3==_?-1:1,e.c=[e.e=0],e)},f.modulo=f.mod=function(e,r){var n,i,o=this;return e=new A(e,r),!o.c||!e.s||e.c&&!e.c[0]?new A(NaN):!e.c||o.c&&!o.c[0]?new A(o):(9==y?(i=e.s,e.s=1,n=t(o,e,0,3),e.s=i,n.s*=i):n=t(o,e,0,y),(e=o.minus(n.times(e))).c[0]||1!=y||(e.s=o.s),e)},f.multipliedBy=f.times=function(e,t){var r,n,i,o,a,u,s,c,l,f,p,h,_,v,d,m=this,g=m.c,b=(e=new A(e,t)).c;if(!(g&&b&&g[0]&&b[0]))return!m.s||!e.s||g&&!g[0]&&!b||b&&!b[0]&&!g?e.c=e.e=e.s=null:(e.s*=m.s,g&&b?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=bitFloor(m.e/LOG_BASE)+bitFloor(e.e/LOG_BASE),e.s*=m.s,(s=g.length)<(f=b.length)&&(_=g,g=b,b=_,i=s,s=f,f=i),i=s+f,_=[];i--;_.push(0));for(v=BASE,d=SQRT_BASE,i=f;--i>=0;){for(r=0,p=b[i]%d,h=b[i]/d|0,o=i+(a=s);o>i;)r=((c=p*(c=g[--a]%d)+(u=h*c+(l=g[a]/d|0)*p)%d*d+_[o]+r)/v|0)+(u/d|0)+h*l,_[o--]=c%v;_[o]=r}return r?++n:_.splice(0,1),k(e,_,n)},f.negated=function(){var e=new A(this);return e.s=-e.s||null,e},f.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new A(e,t)).s,!i||!t)return new A(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/LOG_BASE,a=e.e/LOG_BASE,u=n.c,s=e.c;if(!o||!a){if(!u||!s)return new A(i/0);if(!u[0]||!s[0])return s[0]?e:new A(u[0]?n:0*i)}if(o=bitFloor(o),a=bitFloor(a),u=u.slice(),i=o-a){for(i>0?(a=o,r=s):(i=-i,r=u),r.reverse();i--;r.push(0));r.reverse()}for((i=u.length)-(t=s.length)<0&&(r=s,s=u,u=r,t=i),i=0;t;)i=(u[--t]=u[t]+s[t]+i)/BASE|0,u[t]=BASE===u[t]?0:u[t]%BASE;return i&&(u=[i].concat(u),++a),k(e,u,a)},f.precision=f.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return intCheck(e,1,MAX),null==t?t=_:intCheck(t,0,8),T(new A(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*LOG_BASE+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.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,i,o,a=this,u=a.c,s=a.s,c=a.e,l=h+4,f=new A("0.5");if(1!==s||!u||!u[0])return new A(!s||s<0&&(!u||u[0])?NaN:u?a:1/0);if(0==(s=Math.sqrt(+B(a)))||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 A(r=s==1/0?"5e"+c:(r=s.toExponential()).slice(0,r.indexOf("e")+1)+c)):n=new A(s+""),n.c[0])for((s=(c=n.e)+l)<3&&(s=0);;)if(o=n,n=f.times(o.plus(t(a,o,l,1))),coeffToString(o.c).slice(0,s)===(r=coeffToString(n.c)).slice(0,s)){if(n.e<c&&--s,"9999"!=(r=r.slice(s-3,s+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(T(n,n.e+h+2,1),e=!n.times(n).eq(a));break}if(!i&&(T(o,o.e+h+2,0),o.times(o).eq(a))){n=o;break}l+=4,s+=4,i=1}return T(n,n.e+h+1,_,e)},f.toExponential=function(e,t){return null!=e&&(intCheck(e,0,MAX),e++),O(this,e,t,1)},f.toFixed=function(e,t){return null!=e&&(intCheck(e,0,MAX),e=e+this.e+1),O(this,e,t)},f.toFormat=function(e,t,r){var n,i=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=i.toFixed(e,t),i.c){var o,a=n.split("."),u=+r.groupSize,s=+r.secondaryGroupSize,c=r.groupSeparator||"",l=a[0],f=a[1],p=i.s<0,h=p?l.slice(1):l,_=h.length;if(s&&(o=u,u=s,s=o,_-=o),u>0&&_>0){for(o=_%u||u,l=h.substr(0,o);o<_;o+=u)l+=c+h.substr(o,u);s>0&&(l+=c+h.slice(o)),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,i,o,a,u,s,c,l,f,h,v,d=this,m=d.c;if(null!=e&&(!(s=new A(e)).isInteger()&&(s.c||1!==s.s)||s.lt(p)))throw Error(bignumberError+"Argument "+(s.isInteger()?"out of range: ":"not an integer: ")+B(s));if(!m)return new A(d);for(r=new A(p),l=n=new A(p),i=c=new A(p),v=coeffToString(m),a=r.e=v.length-d.e-1,r.c[0]=POWS_TEN[(u=a%LOG_BASE)<0?LOG_BASE+u:u],e=!e||s.comparedTo(r)>0?a>0?r:l:s,u=g,g=1/0,s=new A(v),c.c[0]=0;f=t(s,r,0,1),1!=(o=n.plus(f.times(i))).comparedTo(e);)n=i,i=o,l=c.plus(f.times(o=l)),c=o,r=s.minus(f.times(o=r)),s=o;return o=t(e.minus(n),i,0,1),c=c.plus(o.times(l)),n=n.plus(o.times(i)),c.s=l.s=d.s,h=t(l,i,a*=2,_).minus(d).abs().comparedTo(t(c,n,a,_).minus(d).abs())<1?[l,i]:[c,n],g=u,h},f.toNumber=function(){return+B(this)},f.toPrecision=function(e,t){return null!=e&&intCheck(e,1,MAX),O(this,e,t,2)},f.toString=function(e){var t,n=this,i=n.s,o=n.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=v||o>=d?toExponential(coeffToString(n.c),o):toFixedPoint(coeffToString(n.c),o,"0"):10===e&&x?t=toFixedPoint(coeffToString((n=T(new A(n),h+o+1,_)).c),n.e,"0"):(intCheck(e,2,E.length,"Base"),t=r(toFixedPoint(coeffToString(n.c),o,"0"),10,e,i,!0)),i<0&&n.c[0]&&(t="-"+t)),t},f.valueOf=f.toJSON=function(){return B(this)},f._isBigNumber=!0,f[Symbol.toStringTag]="BigNumber",f[Symbol.for("nodejs.util.inspect.custom")]=f.valueOf,null!=e&&A.set(e),A}function bitFloor(e){var t=0|e;return e>0||e===t?t:t-1}function coeffToString(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=LOG_BASE-t.length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function compare(e,t){var r,n,i=e.c,o=t.c,a=e.s,u=t.s,s=e.e,c=t.e;if(!a||!u)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-u:a;if(a!=u)return a;if(r=a<0,n=s==c,!i||!o)return n?0:!i^r?1:-1;if(!n)return s>c^r?1:-1;for(u=(s=i.length)<(c=o.length)?s:c,a=0;a<u;a++)if(i[a]!=o[a])return i[a]>o[a]^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,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}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 i=BigNumber(r).toExponential();return[n.sign&&!i.startsWith("-")?"+"+i:i,n]}if(n.fraction){var o=BigNumber(r).toFraction().map((function(e){return e.toFixed()})).join("/");return[n.sign&&!o.startsWith("-")?"+"+o:o,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 close_important_push(){}function open_important_push(){}function open_debug(){}function close_debug(){}function calc_wrap(e,t){var r={_error:"-"};return["string","number"].includes(_typeof(e))?void 0===t?/[a-zA-Z$_]/.test(e.toString())?function(t){return Array.isArray(t)?t.unshift(r):t=_objectSpread2(_objectSpread2({},r),t),calc(e,t)}:calc(e):(Array.isArray(t)?t.unshift(r):t=_objectSpread2(_objectSpread2({},r),t),calc(e,t)):(Array.isArray(e)?e.unshift(r):e=_objectSpread2(_objectSpread2({},r),e),function(t){return calc(t,e)})}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$2(e,t,r){if(Number.isNaN(Number(t)))if("-"===t||"+"===t)0===e.length||"operator"===e.at(-1).type||"("===e.at(-1).value?e.push({type:"number",value:t,real_value:t,has_unit:!1}):e.push({type:"operator",value:t});else if(operator.has(t))e.push({type:"operator",value:t});else if(r._unit&&/^[+-]?\d/.test(t)){var n,i=split_unit_num(t),o=i.num,a=i.unit;if(void 0===a)e.push({type:"number",value:o,real_value:o,has_unit:!1});else r.has_unit=!0,null!==(n=r.unit_str)&&void 0!==n||(r.unit_str=a),e.push({type:"number",value:o,real_value:o,has_unit:!0,unit:a})}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){for(var n,i=0,o=0,a=e.length,u=[],s={has_var:!1,has_unit:!1,unit_str:void 0,_unit:r,fill_data:t};o<a;)" "===(n=e[o])?(o>i&&push_token$2(u,e.slice(i,o),s),i=o+1):"("===n?(u.push({type:state_bracket,value:"("}),i=o+1):")"===n&&(o>i&&push_token$2(u,e.slice(i,o),s),u.push({type:state_bracket,value:")"}),i=o+1),o++;return o>i&&push_token$2(u,e.slice(i,o),s),u.has_var=s.has_var,u.has_unit=s.has_unit,u.unit=s.unit_str,u}function compute(e,t,r){if(void 0===e||void 0===t)throw new Error("无效的操作数对:v1:".concat(e,", v2:").concat(t));var n;switch(r){case"+":n=new BigNumber(e).plus(t);break;case"-":n=new BigNumber(e).minus(t);break;case"*":n=new BigNumber(e).times(t);break;case"/":n=new BigNumber(e).div(t);break;case"%":n=new BigNumber(e).mod(t);break;case"**":n=new BigNumber(e).pow(t);break;case"//":n=new BigNumber(e).idiv(t)}return n}var operator_map={"+":0,"-":0,"*":1,"/":1,"%":1,"//":1,"**":2};function eval_tokens(e){if(1===e.length){var t=e[0];if("number"===t.type||"var"===t.type)return t.real_value;throw new Error("错误的表达式:".concat(t.value))}for(var r,n,i=[],o=[],a=0,u=e.length;a<u;a++)if("number"!==(r=e[a]).type&&"var"!==r.type)if("operator"!==r.type)if("("!==r.value){if(")"===r.value)for(var s=void 0;s=i.pop();){if("("===s){var c=o.at(-2);if("-"===c){var l=o.pop();o.pop(),o.push(BigNumber.isBigNumber(l)?l.negated():new BigNumber(l).negated())}else if("+"===c){var f=o.pop();o.pop(),o.push(f)}break}var p=o.pop(),h=o.pop();o.push(compute(h,p,s))}}else i.push("(");else{var _=i.at(-1);if("("===_){i.push(r.value);continue}var v=operator_map[r.value];if(!i.length){i.push(r.value);continue}if(v<operator_map[_])for(var d=void 0;d=i.pop();){if("("===d){i.push("(");break}var m=o.pop(),g=o.pop();o.push(compute(g,m,d))}else if(v===operator_map[_]){if("**"===r.value){i.push(r.value);continue}for(var b=void 0;b=i.pop();){if("("===b){i.push("(");break}if(operator_map[b]<v){i.push(b);break}var y=o.pop(),w=o.pop();o.push(compute(w,y,b))}}i.push(r.value)}else o.push(r.real_value);for(;n=i.pop();){var S=o.pop(),E=o.pop();o.push(compute(E,S,n))}if(1!==o.length)throw new Error("可能出现了错误的计算式");return e.has_var||(e.calc_result=o[0]),o[0]}function push_token$1(e,t,r,n,i){t===state_var?(i.has_var=!0,e.push({type:t,value:r,real_value:get_real_value(i.fill_data,r)})):e.push({type:t,value:r}),n.prev=n.curr,i.state=state_initial}function fmt_tokenizer(e,t){for(var r,n={prev:0,curr:0},i=e.length,o={state:state_initial,fill_data:t,has_var:!1},a=[];n.curr<i;)switch(r=e[n.curr],o.state){case state_initial:if(" "===r)n.curr++,n.prev=n.curr;else if("<>=".includes(r))o.state=state_symbol,n.curr++;else if(","===r)n.curr++,push_token$1(a,state_comma,",",n,o);else if(var_char.includes(r))o.state=state_var,n.curr++;else if(number_char.includes(r))o.state=state_number,n.curr++;else if("+"===r)n.curr++,push_token$1(a,state_plus$1,"+",n,o);else if("~"===r)n.curr++,o.state=state_round;else if("%"===r)n.curr++,push_token$1(a,state_percent,"%",n,o);else if("/"===r)n.curr++,push_token$1(a,state_fraction,"/",n,o);else if("!"===r)if(o.state=state_initial,n.curr++,"n"===e[n.curr])n.curr++,push_token$1(a,state_to_number,"!n",n,o);else if("u"===e[n.curr])n.curr++,push_token$1(a,state_to_number_string,"!u",n,o);else{if("e"!==e[n.curr])throw new Error("无法识别的!模式字符:".concat(e[n.curr]));n.curr++,push_token$1(a,state_scientific,"!e",n,o)}else n.curr++,n.prev=n.curr;break;case state_symbol:"="===r&&n.curr++,push_token$1(a,state_symbol,e.slice(n.prev,n.curr),n,o);break;case state_number:number_char.includes(r)?n.curr++:push_token$1(a,state_number,e.slice(n.prev,n.curr),n,o);break;case state_var:var_members_char.includes(r)?n.curr++:push_token$1(a,state_var,e.slice(n.prev,n.curr),n,o);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$1(a,state_round,e.slice(n.prev,n.curr),n,o);break;default:throw new Error("错误的fmt分词器状态")}return n.prev<n.curr&&push_token$1(a,o.state,e.slice(n.prev,n.curr),n,o),a.has_var=o.has_var,a}var symbol_set=new Set(["<",">","=",">=","<="]),rand_set=new Set(["~+","~-","~5","~6"]);function push_token(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){for(var r,n=0,i=e.length,o={fill_data:t,has_var:!1},a=0,u=[];n<i;)" "===(r=e[n])?(n>a&&push_token(u,e.slice(a,n),o),a=n+1):"<>=".includes(r)&&("="===e[n+1]?(u.push({type:state_symbol,value:r+"="}),a=1+ ++n):(u.push({type:state_symbol,value:r}),a=n+1)),n++;return a<n&&push_token(u,e.slice(a,n),o),u.has_var=o.has_var,u}function calc(e,t){var r=find_value(t,"_error");try{var n,i,o,a,u,s,c,l=parse_args(e,t),f=null!==(n=l._unit)&&void 0!==n&&n,p=null!==(i=l._mode)&&void 0!==i?i:"normal",h="space"===p||"space-all"===p?tokenizer_space(l.expr,l.fill_data,f):tokenizer(l.expr,l.fill_data,f),_=eval_tokens(h),v=BigNumber.isBigNumber(_)?_:new BigNumber(_);if("space-all"===p?(s=""===l.fmt_expr||void 0===l.fmt_expr?void 0:fmt_tokenizer_space(l.fmt_expr,l.fill_data),c=""===l._fmt||void 0===l._fmt?void 0:fmt_tokenizer_space(l._fmt,l.fill_data)):(s=""===l.fmt_expr||void 0===l.fmt_expr?void 0:fmt_tokenizer(l.fmt_expr,l.fill_data),c=""===l._fmt||void 0===l._fmt?void 0:fmt_tokenizer(l._fmt,l.fill_data)),void 0===s?void 0!==c&&(s=c):void 0!==c&&(s=[].concat(_toConsumableArray(c),_toConsumableArray(s))),void 0===s)v=v.toFixed();else{var d=_slicedToArray(format(v,s),2);v=d[0],u=d[1]}if("Infinity"===v||void 0===v)throw new Error("计算错误可能是非法的计算式");return!h.has_unit||null!==(o=u)&&void 0!==o&&o.to_number||null!==(a=u)&&void 0!==a&&a.to_number_string||(v+=h.unit),v}catch(e){if(void 0===r)throw e;return r}}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(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(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(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(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(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(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(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{calc,calc_util,calc_wrap,div,fmt,idiv,mod,mul,parse_thousands,plus,pow,sub,version};
|