@bpmn-io/form-js-playground 1.24.1 → 1.25.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.
@@ -75,13 +75,13 @@
75
75
  i = [],
76
76
  r = [],
77
77
  o = m$2({}, u);
78
- o.__v = u.__v + 1, l$2.vnode && l$2.vnode(o), q$3(n.__P, o, u, n.__n, n.__P.namespaceURI, 32 & u.__u ? [t] : null, i, null == t ? $$2(u) : t, !!(32 & u.__u), r), o.__v = u.__v, o.__.__k[o.__i] = o, D$3(i, o, r), u.__e = u.__ = null, o.__e != t && P$4(o);
78
+ o.__v = u.__v + 1, l$2.vnode && l$2.vnode(o), q$3(n.__P, o, u, n.__n, n.__P.namespaceURI, 32 & u.__u ? [t] : null, i, null == t ? $$2(u) : t, !!(32 & u.__u), r), o.__v = u.__v, o.__.__k[o.__i] = o, D$3(i, o, r), u.__e = u.__ = null, o.__e != t && P$3(o);
79
79
  }
80
80
  }
81
- function P$4(n) {
81
+ function P$3(n) {
82
82
  if (null != (n = n.__) && null != n.__c) return n.__e = n.__c.base = null, n.__k.some(function (l) {
83
83
  if (null != l && null != l.__e) return n.__e = n.__c.base = l.__e;
84
- }), P$4(n);
84
+ }), P$3(n);
85
85
  }
86
86
  function A$3(n) {
87
87
  (!n.__d && (n.__d = true) && i$2.push(n) && !H$2.__r++ || r$1 != l$2.debounceRendering) && ((r$1 = l$2.debounceRendering) || o$1)(H$2);
@@ -1901,10 +1901,10 @@
1901
1901
  };
1902
1902
 
1903
1903
  /*
1904
- * big.js v7.0.1
1904
+ * big.js v5.2.2
1905
1905
  * A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic.
1906
- * Copyright (c) 2025 Michael Mclaughlin
1907
- * https://github.com/MikeMcl/big.js/LICENCE.md
1906
+ * Copyright (c) 2018 Michael Mclaughlin <M8ch88l@gmail.com>
1907
+ * https://github.com/MikeMcl/big.js/LICENCE
1908
1908
  */
1909
1909
 
1910
1910
  /************************************** EDITABLE DEFAULTS *****************************************/
@@ -1915,7 +1915,7 @@
1915
1915
  * The maximum number of decimal places (DP) of the results of operations involving division:
1916
1916
  * div and sqrt, and pow with negative exponents.
1917
1917
  */
1918
- var DP$1 = 20,
1918
+ var DP = 20,
1919
1919
  // 0 to MAX_DP
1920
1920
 
1921
1921
  /*
@@ -1926,15 +1926,15 @@
1926
1926
  * 2 To nearest neighbour. If equidistant, to even. (ROUND_HALF_EVEN)
1927
1927
  * 3 Away from zero. (ROUND_UP)
1928
1928
  */
1929
- RM$1 = 1,
1929
+ RM = 1,
1930
1930
  // 0, 1, 2 or 3
1931
1931
 
1932
1932
  // The maximum value of DP and Big.DP.
1933
- MAX_DP$1 = 1E6,
1933
+ MAX_DP = 1E6,
1934
1934
  // 0 to 1000000
1935
1935
 
1936
1936
  // The maximum magnitude of the exponent argument to the pow method.
1937
- MAX_POWER$1 = 1E6,
1937
+ MAX_POWER = 1E6,
1938
1938
  // 1 to 1000000
1939
1939
 
1940
1940
  /*
@@ -1942,42 +1942,36 @@
1942
1942
  * (JavaScript numbers: -7)
1943
1943
  * -1000000 is the minimum recommended exponent value of a Big.
1944
1944
  */
1945
- NE$1 = -7,
1945
+ NE = -7,
1946
1946
  // 0 to -1000000
1947
1947
 
1948
1948
  /*
1949
1949
  * The positive exponent (PE) at and above which toString returns exponential notation.
1950
1950
  * (JavaScript numbers: 21)
1951
- * 1000000 is the maximum recommended exponent value of a Big, but this limit is not enforced.
1951
+ * 1000000 is the maximum recommended exponent value of a Big.
1952
+ * (This limit is not enforced or checked.)
1952
1953
  */
1953
- PE$1 = 21,
1954
+ PE = 21,
1954
1955
  // 0 to 1000000
1955
1956
 
1956
- /*
1957
- * When true, an error will be thrown if a primitive number is passed to the Big constructor,
1958
- * or if valueOf is called, or if toNumber is called on a Big which cannot be converted to a
1959
- * primitive number without a loss of precision.
1960
- */
1961
- STRICT$1 = false,
1962
- // true or false
1963
-
1964
1957
  /**************************************************************************************************/
1965
1958
 
1966
1959
  // Error messages.
1967
- NAME$1 = '[big.js] ',
1968
- INVALID$4 = NAME$1 + 'Invalid ',
1969
- INVALID_DP$1 = INVALID$4 + 'decimal places',
1970
- INVALID_RM$1 = INVALID$4 + 'rounding mode',
1971
- DIV_BY_ZERO$1 = NAME$1 + 'Division by zero',
1960
+ NAME = '[big.js] ',
1961
+ INVALID$3 = NAME + 'Invalid ',
1962
+ INVALID_DP = INVALID$3 + 'decimal places',
1963
+ INVALID_RM = INVALID$3 + 'rounding mode',
1964
+ DIV_BY_ZERO = NAME + 'Division by zero',
1972
1965
  // The shared prototype object.
1973
- P$3 = {},
1974
- UNDEFINED$1 = void 0,
1975
- NUMERIC$1 = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
1966
+ P$2 = {},
1967
+ UNDEFINED = void 0,
1968
+ NUMERIC = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
1976
1969
 
1977
1970
  /*
1978
1971
  * Create and return a Big constructor.
1972
+ *
1979
1973
  */
1980
- function _Big_$1() {
1974
+ function _Big_() {
1981
1975
  /*
1982
1976
  * The Big constructor and exported function.
1983
1977
  * Create and return a new instance of a Big number object.
@@ -1988,9 +1982,7 @@
1988
1982
  var x = this;
1989
1983
 
1990
1984
  // Enable constructor usage without new.
1991
- if (!(x instanceof Big)) {
1992
- return n === UNDEFINED$1 && arguments.length === 0 ? _Big_$1() : new Big(n);
1993
- }
1985
+ if (!(x instanceof Big)) return n === UNDEFINED ? _Big_() : new Big(n);
1994
1986
 
1995
1987
  // Duplicate.
1996
1988
  if (n instanceof Big) {
@@ -1998,31 +1990,21 @@
1998
1990
  x.e = n.e;
1999
1991
  x.c = n.c.slice();
2000
1992
  } else {
2001
- if (typeof n !== 'string') {
2002
- if (Big.strict === true && typeof n !== 'bigint') {
2003
- throw TypeError(INVALID$4 + 'value');
2004
- }
2005
-
2006
- // Minus zero?
2007
- n = n === 0 && 1 / n < 0 ? '-0' : String(n);
2008
- }
2009
- parse$2(x, n);
1993
+ parse$1(x, n);
2010
1994
  }
2011
1995
 
2012
- // Retain a reference to this Big constructor.
2013
- // Shadow Big.prototype.constructor which points to Object.
1996
+ /*
1997
+ * Retain a reference to this Big constructor, and shadow Big.prototype.constructor which
1998
+ * points to Object.
1999
+ */
2014
2000
  x.constructor = Big;
2015
2001
  }
2016
- Big.prototype = P$3;
2017
- Big.DP = DP$1;
2018
- Big.RM = RM$1;
2019
- Big.NE = NE$1;
2020
- Big.PE = PE$1;
2021
- Big.strict = STRICT$1;
2022
- Big.roundDown = 0;
2023
- Big.roundHalfUp = 1;
2024
- Big.roundHalfEven = 2;
2025
- Big.roundUp = 3;
2002
+ Big.prototype = P$2;
2003
+ Big.DP = DP;
2004
+ Big.RM = RM;
2005
+ Big.NE = NE;
2006
+ Big.PE = PE;
2007
+ Big.version = '5.2.2';
2026
2008
  return Big;
2027
2009
  }
2028
2010
 
@@ -2032,11 +2014,11 @@
2032
2014
  * x {Big} A Big number instance.
2033
2015
  * n {number|string} A numeric value.
2034
2016
  */
2035
- function parse$2(x, n) {
2017
+ function parse$1(x, n) {
2036
2018
  var e, i, nl;
2037
- if (!NUMERIC$1.test(n)) {
2038
- throw Error(INVALID$4 + 'number');
2039
- }
2019
+
2020
+ // Minus zero?
2021
+ if (n === 0 && 1 / n < 0) n = '-0';else if (!NUMERIC.test(n += '')) throw Error(INVALID$3 + 'number');
2040
2022
 
2041
2023
  // Determine sign.
2042
2024
  x.s = n.charAt(0) == '-' ? (n = n.slice(1), -1) : 1;
@@ -2074,52 +2056,60 @@
2074
2056
  }
2075
2057
 
2076
2058
  /*
2077
- * Round Big x to a maximum of sd significant digits using rounding mode rm.
2059
+ * Round Big x to a maximum of dp decimal places using rounding mode rm.
2060
+ * Called by stringify, P.div, P.round and P.sqrt.
2078
2061
  *
2079
2062
  * x {Big} The Big to round.
2080
- * sd {number} Significant digits: integer, 0 to MAX_DP inclusive.
2081
- * rm {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
2063
+ * dp {number} Integer, 0 to MAX_DP inclusive.
2064
+ * rm {number} 0, 1, 2 or 3 (DOWN, HALF_UP, HALF_EVEN, UP)
2082
2065
  * [more] {boolean} Whether the result of division was truncated.
2083
2066
  */
2084
- function round$1(x, sd, rm, more) {
2085
- var xc = x.c;
2086
- if (rm === UNDEFINED$1) rm = x.constructor.RM;
2087
- if (rm !== 0 && rm !== 1 && rm !== 2 && rm !== 3) {
2088
- throw Error(INVALID_RM$1);
2089
- }
2090
- if (sd < 1) {
2091
- more = rm === 3 && (more || !!xc[0]) || sd === 0 && (rm === 1 && xc[0] >= 5 || rm === 2 && (xc[0] > 5 || xc[0] === 5 && (more || xc[1] !== UNDEFINED$1)));
2092
- xc.length = 1;
2093
- if (more) {
2094
- // 1, 0.1, 0.01, 0.001, 0.0001 etc.
2095
- x.e = x.e - sd + 1;
2096
- xc[0] = 1;
2067
+ function round(x, dp, rm, more) {
2068
+ var xc = x.c,
2069
+ i = x.e + dp + 1;
2070
+ if (i < xc.length) {
2071
+ if (rm === 1) {
2072
+ // xc[i] is the digit after the digit that may be rounded up.
2073
+ more = xc[i] >= 5;
2074
+ } else if (rm === 2) {
2075
+ more = xc[i] > 5 || xc[i] == 5 && (more || i < 0 || xc[i + 1] !== UNDEFINED || xc[i - 1] & 1);
2076
+ } else if (rm === 3) {
2077
+ more = more || !!xc[0];
2097
2078
  } else {
2098
- // Zero.
2099
- xc[0] = x.e = 0;
2100
- }
2101
- } else if (sd < xc.length) {
2102
- // xc[sd] is the digit after the digit that may be rounded up.
2103
- more = rm === 1 && xc[sd] >= 5 || rm === 2 && (xc[sd] > 5 || xc[sd] === 5 && (more || xc[sd + 1] !== UNDEFINED$1 || xc[sd - 1] & 1)) || rm === 3 && (more || !!xc[0]);
2104
-
2105
- // Remove any digits after the required precision.
2106
- xc.length = sd;
2107
-
2108
- // Round up?
2109
- if (more) {
2110
- // Rounding up may mean the previous digit has to be rounded up.
2111
- for (; ++xc[--sd] > 9;) {
2112
- xc[sd] = 0;
2113
- if (sd === 0) {
2114
- ++x.e;
2115
- xc.unshift(1);
2116
- break;
2079
+ more = false;
2080
+ if (rm !== 0) throw Error(INVALID_RM);
2081
+ }
2082
+ if (i < 1) {
2083
+ xc.length = 1;
2084
+ if (more) {
2085
+ // 1, 0.1, 0.01, 0.001, 0.0001 etc.
2086
+ x.e = -dp;
2087
+ xc[0] = 1;
2088
+ } else {
2089
+ // Zero.
2090
+ xc[0] = x.e = 0;
2091
+ }
2092
+ } else {
2093
+ // Remove any digits after the required decimal places.
2094
+ xc.length = i--;
2095
+
2096
+ // Round up?
2097
+ if (more) {
2098
+ // Rounding up may mean the previous digit has to be rounded up.
2099
+ for (; ++xc[i] > 9;) {
2100
+ xc[i] = 0;
2101
+ if (!i--) {
2102
+ ++x.e;
2103
+ xc.unshift(1);
2104
+ }
2117
2105
  }
2118
2106
  }
2119
- }
2120
2107
 
2121
- // Remove trailing zeros.
2122
- for (sd = xc.length; !xc[--sd];) xc.pop();
2108
+ // Remove trailing zeros.
2109
+ for (i = xc.length; !xc[--i];) xc.pop();
2110
+ }
2111
+ } else if (rm < 0 || rm > 3 || rm !== ~~rm) {
2112
+ throw Error(INVALID_RM);
2123
2113
  }
2124
2114
  return x;
2125
2115
  }
@@ -2127,14 +2117,45 @@
2127
2117
  /*
2128
2118
  * Return a string representing the value of Big x in normal or exponential notation.
2129
2119
  * Handles P.toExponential, P.toFixed, P.toJSON, P.toPrecision, P.toString and P.valueOf.
2130
- */
2131
- function stringify$1(x, doExponential, isNonzero) {
2132
- var e = x.e,
2133
- s = x.c.join(''),
2134
- n = s.length;
2120
+ *
2121
+ * x {Big}
2122
+ * id? {number} Caller id.
2123
+ * 1 toExponential
2124
+ * 2 toFixed
2125
+ * 3 toPrecision
2126
+ * 4 valueOf
2127
+ * n? {number|undefined} Caller's argument.
2128
+ * k? {number|undefined}
2129
+ */
2130
+ function stringify(x, id, n, k) {
2131
+ var e,
2132
+ s,
2133
+ Big = x.constructor,
2134
+ z = !x.c[0];
2135
+ if (n !== UNDEFINED) {
2136
+ if (n !== ~~n || n < (id == 3) || n > MAX_DP) {
2137
+ throw Error(id == 3 ? INVALID$3 + 'precision' : INVALID_DP);
2138
+ }
2139
+ x = new Big(x);
2140
+
2141
+ // The index of the digit that may be rounded up.
2142
+ n = k - x.e;
2143
+
2144
+ // Round?
2145
+ if (x.c.length > ++k) round(x, n, Big.RM);
2146
+
2147
+ // toFixed: recalculate k as x.e may have changed if value rounded up.
2148
+ if (id == 2) k = x.e + n + 1;
2149
+
2150
+ // Append zeros?
2151
+ for (; x.c.length < k;) x.c.push(0);
2152
+ }
2153
+ e = x.e;
2154
+ s = x.c.join('');
2155
+ n = s.length;
2135
2156
 
2136
2157
  // Exponential notation?
2137
- if (doExponential) {
2158
+ if (id != 2 && (id == 1 || id == 3 && k <= e || e <= Big.NE || e >= Big.PE)) {
2138
2159
  s = s.charAt(0) + (n > 1 ? '.' + s.slice(1) : '') + (e < 0 ? 'e' : 'e+') + e;
2139
2160
 
2140
2161
  // Normal notation.
@@ -2142,15 +2163,11 @@
2142
2163
  for (; ++e;) s = '0' + s;
2143
2164
  s = '0.' + s;
2144
2165
  } else if (e > 0) {
2145
- if (++e > n) {
2146
- for (e -= n; e--;) s += '0';
2147
- } else if (e < n) {
2148
- s = s.slice(0, e) + '.' + s.slice(e);
2149
- }
2166
+ if (++e > n) for (e -= n; e--;) s += '0';else if (e < n) s = s.slice(0, e) + '.' + s.slice(e);
2150
2167
  } else if (n > 1) {
2151
2168
  s = s.charAt(0) + '.' + s.slice(1);
2152
2169
  }
2153
- return x.s < 0 && isNonzero ? '-' + s : s;
2170
+ return x.s < 0 && (!z || id == 4) ? '-' + s : s;
2154
2171
  }
2155
2172
 
2156
2173
  // Prototype/instance methods
@@ -2158,7 +2175,7 @@
2158
2175
  /*
2159
2176
  * Return a new Big whose value is the absolute value of this Big.
2160
2177
  */
2161
- P$3.abs = function () {
2178
+ P$2.abs = function () {
2162
2179
  var x = new this.constructor(this);
2163
2180
  x.s = 1;
2164
2181
  return x;
@@ -2168,8 +2185,8 @@
2168
2185
  * Return 1 if the value of this Big is greater than the value of Big y,
2169
2186
  * -1 if the value of this Big is less than the value of Big y, or
2170
2187
  * 0 if they have the same value.
2171
- */
2172
- P$3.cmp = function (y) {
2188
+ */
2189
+ P$2.cmp = function (y) {
2173
2190
  var isneg,
2174
2191
  x = this,
2175
2192
  xc = x.c,
@@ -2203,7 +2220,7 @@
2203
2220
  * Return a new Big whose value is the value of this Big divided by the value of Big y, rounded,
2204
2221
  * if necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.
2205
2222
  */
2206
- P$3.div = function (y) {
2223
+ P$2.div = function (y) {
2207
2224
  var x = this,
2208
2225
  Big = x.constructor,
2209
2226
  a = x.c,
@@ -2212,21 +2229,13 @@
2212
2229
  // divisor
2213
2230
  k = x.s == y.s ? 1 : -1,
2214
2231
  dp = Big.DP;
2215
- if (dp !== ~~dp || dp < 0 || dp > MAX_DP$1) {
2216
- throw Error(INVALID_DP$1);
2217
- }
2232
+ if (dp !== ~~dp || dp < 0 || dp > MAX_DP) throw Error(INVALID_DP);
2218
2233
 
2219
2234
  // Divisor is zero?
2220
- if (!b[0]) {
2221
- throw Error(DIV_BY_ZERO$1);
2222
- }
2235
+ if (!b[0]) throw Error(DIV_BY_ZERO);
2223
2236
 
2224
2237
  // Dividend is 0? Return +-0.
2225
- if (!a[0]) {
2226
- y.s = k;
2227
- y.c = [y.e = 0];
2228
- return y;
2229
- }
2238
+ if (!a[0]) return new Big(k * 0);
2230
2239
  var bl,
2231
2240
  bt,
2232
2241
  n,
@@ -2242,10 +2251,10 @@
2242
2251
  // quotient
2243
2252
  qc = q.c = [],
2244
2253
  qi = 0,
2245
- p = dp + (q.e = x.e - y.e) + 1; // precision of the result
2254
+ d = dp + (q.e = x.e - y.e) + 1; // number of digits of the result
2246
2255
 
2247
2256
  q.s = k;
2248
- k = p < 0 ? 0 : p;
2257
+ k = d < 0 ? 0 : d;
2249
2258
 
2250
2259
  // Create version of divisor with leading zero.
2251
2260
  bz.unshift(0);
@@ -2291,33 +2300,32 @@
2291
2300
 
2292
2301
  // Update the remainder.
2293
2302
  if (r[0] && cmp) r[rl] = a[ai] || 0;else r = [a[ai]];
2294
- } while ((ai++ < al || r[0] !== UNDEFINED$1) && k--);
2303
+ } while ((ai++ < al || r[0] !== UNDEFINED) && k--);
2295
2304
 
2296
2305
  // Leading zero? Do not remove if result is simply zero (qi == 1).
2297
2306
  if (!qc[0] && qi != 1) {
2298
2307
  // There can't be more than one zero.
2299
2308
  qc.shift();
2300
2309
  q.e--;
2301
- p--;
2302
2310
  }
2303
2311
 
2304
2312
  // Round?
2305
- if (qi > p) round$1(q, p, Big.RM, r[0] !== UNDEFINED$1);
2313
+ if (qi > d) round(q, dp, Big.RM, r[0] !== UNDEFINED);
2306
2314
  return q;
2307
2315
  };
2308
2316
 
2309
2317
  /*
2310
2318
  * Return true if the value of this Big is equal to the value of Big y, otherwise return false.
2311
2319
  */
2312
- P$3.eq = function (y) {
2313
- return this.cmp(y) === 0;
2320
+ P$2.eq = function (y) {
2321
+ return !this.cmp(y);
2314
2322
  };
2315
2323
 
2316
2324
  /*
2317
2325
  * Return true if the value of this Big is greater than the value of Big y, otherwise return
2318
2326
  * false.
2319
2327
  */
2320
- P$3.gt = function (y) {
2328
+ P$2.gt = function (y) {
2321
2329
  return this.cmp(y) > 0;
2322
2330
  };
2323
2331
 
@@ -2325,14 +2333,14 @@
2325
2333
  * Return true if the value of this Big is greater than or equal to the value of Big y, otherwise
2326
2334
  * return false.
2327
2335
  */
2328
- P$3.gte = function (y) {
2336
+ P$2.gte = function (y) {
2329
2337
  return this.cmp(y) > -1;
2330
2338
  };
2331
2339
 
2332
2340
  /*
2333
2341
  * Return true if the value of this Big is less than the value of Big y, otherwise return false.
2334
2342
  */
2335
- P$3.lt = function (y) {
2343
+ P$2.lt = function (y) {
2336
2344
  return this.cmp(y) < 0;
2337
2345
  };
2338
2346
 
@@ -2340,14 +2348,14 @@
2340
2348
  * Return true if the value of this Big is less than or equal to the value of Big y, otherwise
2341
2349
  * return false.
2342
2350
  */
2343
- P$3.lte = function (y) {
2351
+ P$2.lte = function (y) {
2344
2352
  return this.cmp(y) < 1;
2345
2353
  };
2346
2354
 
2347
2355
  /*
2348
2356
  * Return a new Big whose value is the value of this Big minus the value of Big y.
2349
2357
  */
2350
- P$3.minus = P$3.sub = function (y) {
2358
+ P$2.minus = P$2.sub = function (y) {
2351
2359
  var i,
2352
2360
  j,
2353
2361
  t,
@@ -2369,14 +2377,8 @@
2369
2377
 
2370
2378
  // Either zero?
2371
2379
  if (!xc[0] || !yc[0]) {
2372
- if (yc[0]) {
2373
- y.s = -b;
2374
- } else if (xc[0]) {
2375
- y = new Big(x);
2376
- } else {
2377
- y.s = 1;
2378
- }
2379
- return y;
2380
+ // y is non-zero? x is non-zero? Or both are zero.
2381
+ return yc[0] ? (y.s = -b, y) : new Big(xc[0] ? x : 0);
2380
2382
  }
2381
2383
 
2382
2384
  // Determine which is the bigger number. Prepend zeros to equalise exponents.
@@ -2449,15 +2451,13 @@
2449
2451
  /*
2450
2452
  * Return a new Big whose value is the value of this Big modulo the value of Big y.
2451
2453
  */
2452
- P$3.mod = function (y) {
2454
+ P$2.mod = function (y) {
2453
2455
  var ygtx,
2454
2456
  x = this,
2455
2457
  Big = x.constructor,
2456
2458
  a = x.s,
2457
2459
  b = (y = new Big(y)).s;
2458
- if (!y.c[0]) {
2459
- throw Error(DIV_BY_ZERO$1);
2460
- }
2460
+ if (!y.c[0]) throw Error(DIV_BY_ZERO);
2461
2461
  x.s = y.s = 1;
2462
2462
  ygtx = y.cmp(x) == 1;
2463
2463
  x.s = a;
@@ -2472,29 +2472,19 @@
2472
2472
  return this.minus(x.times(y));
2473
2473
  };
2474
2474
 
2475
- /*
2476
- * Return a new Big whose value is the value of this Big negated.
2477
- */
2478
- P$3.neg = function () {
2479
- var x = new this.constructor(this);
2480
- x.s = -x.s;
2481
- return x;
2482
- };
2483
-
2484
2475
  /*
2485
2476
  * Return a new Big whose value is the value of this Big plus the value of Big y.
2486
2477
  */
2487
- P$3.plus = P$3.add = function (y) {
2488
- var e,
2489
- k,
2490
- t,
2478
+ P$2.plus = P$2.add = function (y) {
2479
+ var t,
2491
2480
  x = this,
2492
- Big = x.constructor;
2493
- y = new Big(y);
2481
+ Big = x.constructor,
2482
+ a = x.s,
2483
+ b = (y = new Big(y)).s;
2494
2484
 
2495
2485
  // Signs differ?
2496
- if (x.s != y.s) {
2497
- y.s = -y.s;
2486
+ if (a != b) {
2487
+ y.s = -b;
2498
2488
  return x.minus(y);
2499
2489
  }
2500
2490
  var xe = x.e,
@@ -2502,31 +2492,22 @@
2502
2492
  ye = y.e,
2503
2493
  yc = y.c;
2504
2494
 
2505
- // Either zero?
2506
- if (!xc[0] || !yc[0]) {
2507
- if (!yc[0]) {
2508
- if (xc[0]) {
2509
- y = new Big(x);
2510
- } else {
2511
- y.s = x.s;
2512
- }
2513
- }
2514
- return y;
2515
- }
2495
+ // Either zero? y is non-zero? x is non-zero? Or both are zero.
2496
+ if (!xc[0] || !yc[0]) return yc[0] ? y : new Big(xc[0] ? x : a * 0);
2516
2497
  xc = xc.slice();
2517
2498
 
2518
2499
  // Prepend zeros to equalise exponents.
2519
2500
  // Note: reverse faster than unshifts.
2520
- if (e = xe - ye) {
2521
- if (e > 0) {
2501
+ if (a = xe - ye) {
2502
+ if (a > 0) {
2522
2503
  ye = xe;
2523
2504
  t = yc;
2524
2505
  } else {
2525
- e = -e;
2506
+ a = -a;
2526
2507
  t = xc;
2527
2508
  }
2528
2509
  t.reverse();
2529
- for (; e--;) t.push(0);
2510
+ for (; a--;) t.push(0);
2530
2511
  t.reverse();
2531
2512
  }
2532
2513
 
@@ -2536,20 +2517,20 @@
2536
2517
  yc = xc;
2537
2518
  xc = t;
2538
2519
  }
2539
- e = yc.length;
2520
+ a = yc.length;
2540
2521
 
2541
2522
  // Only start adding at yc.length - 1 as the further digits of xc can be left as they are.
2542
- for (k = 0; e; xc[e] %= 10) k = (xc[--e] = xc[e] + yc[e] + k) / 10 | 0;
2523
+ for (b = 0; a; xc[a] %= 10) b = (xc[--a] = xc[a] + yc[a] + b) / 10 | 0;
2543
2524
 
2544
2525
  // No need to check for zero, as +x + +y != 0 && -x + -y != 0
2545
2526
 
2546
- if (k) {
2547
- xc.unshift(k);
2527
+ if (b) {
2528
+ xc.unshift(b);
2548
2529
  ++ye;
2549
2530
  }
2550
2531
 
2551
2532
  // Remove trailing zeros.
2552
- for (e = xc.length; xc[--e] === 0;) xc.pop();
2533
+ for (a = xc.length; xc[--a] === 0;) xc.pop();
2553
2534
  y.c = xc;
2554
2535
  y.e = ye;
2555
2536
  return y;
@@ -2562,14 +2543,12 @@
2562
2543
  *
2563
2544
  * n {number} Integer, -MAX_POWER to MAX_POWER inclusive.
2564
2545
  */
2565
- P$3.pow = function (n) {
2546
+ P$2.pow = function (n) {
2566
2547
  var x = this,
2567
- one = new x.constructor('1'),
2548
+ one = new x.constructor(1),
2568
2549
  y = one,
2569
2550
  isneg = n < 0;
2570
- if (n !== ~~n || n < -MAX_POWER$1 || n > MAX_POWER$1) {
2571
- throw Error(INVALID$4 + 'exponent');
2572
- }
2551
+ if (n !== ~~n || n < -MAX_POWER || n > MAX_POWER) throw Error(INVALID$3 + 'exponent');
2573
2552
  if (isneg) n = -n;
2574
2553
  for (;;) {
2575
2554
  if (n & 1) y = y.times(x);
@@ -2581,40 +2560,26 @@
2581
2560
  };
2582
2561
 
2583
2562
  /*
2584
- * Return a new Big whose value is the value of this Big rounded to a maximum precision of sd
2585
- * significant digits using rounding mode rm, or Big.RM if rm is not specified.
2586
- *
2587
- * sd {number} Significant digits: integer, 1 to MAX_DP inclusive.
2588
- * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
2589
- */
2590
- P$3.prec = function (sd, rm) {
2591
- if (sd !== ~~sd || sd < 1 || sd > MAX_DP$1) {
2592
- throw Error(INVALID$4 + 'precision');
2593
- }
2594
- return round$1(new this.constructor(this), sd, rm);
2595
- };
2596
-
2597
- /*
2598
- * Return a new Big whose value is the value of this Big rounded to a maximum of dp decimal places
2599
- * using rounding mode rm, or Big.RM if rm is not specified.
2600
- * If dp is negative, round to an integer which is a multiple of 10**-dp.
2563
+ * Return a new Big whose value is the value of this Big rounded using rounding mode rm
2564
+ * to a maximum of dp decimal places, or, if dp is negative, to an integer which is a
2565
+ * multiple of 10**-dp.
2601
2566
  * If dp is not specified, round to 0 decimal places.
2567
+ * If rm is not specified, use Big.RM.
2602
2568
  *
2603
2569
  * dp? {number} Integer, -MAX_DP to MAX_DP inclusive.
2604
- * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
2570
+ * rm? 0, 1, 2 or 3 (ROUND_DOWN, ROUND_HALF_UP, ROUND_HALF_EVEN, ROUND_UP)
2605
2571
  */
2606
- P$3.round = function (dp, rm) {
2607
- if (dp === UNDEFINED$1) dp = 0;else if (dp !== ~~dp || dp < -MAX_DP$1 || dp > MAX_DP$1) {
2608
- throw Error(INVALID_DP$1);
2609
- }
2610
- return round$1(new this.constructor(this), dp + this.e + 1, rm);
2572
+ P$2.round = function (dp, rm) {
2573
+ var Big = this.constructor;
2574
+ if (dp === UNDEFINED) dp = 0;else if (dp !== ~~dp || dp < -MAX_DP || dp > MAX_DP) throw Error(INVALID_DP);
2575
+ return round(new Big(this), dp, rm === UNDEFINED ? Big.RM : rm);
2611
2576
  };
2612
2577
 
2613
2578
  /*
2614
2579
  * Return a new Big whose value is the square root of the value of this Big, rounded, if
2615
2580
  * necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.
2616
2581
  */
2617
- P$3.sqrt = function () {
2582
+ P$2.sqrt = function () {
2618
2583
  var r,
2619
2584
  c,
2620
2585
  t,
@@ -2622,18 +2587,16 @@
2622
2587
  Big = x.constructor,
2623
2588
  s = x.s,
2624
2589
  e = x.e,
2625
- half = new Big('0.5');
2590
+ half = new Big(0.5);
2626
2591
 
2627
2592
  // Zero?
2628
2593
  if (!x.c[0]) return new Big(x);
2629
2594
 
2630
2595
  // Negative?
2631
- if (s < 0) {
2632
- throw Error(NAME$1 + 'No square root');
2633
- }
2596
+ if (s < 0) throw Error(NAME + 'No square root');
2634
2597
 
2635
2598
  // Estimate.
2636
- s = Math.sqrt(+stringify$1(x, true, true));
2599
+ s = Math.sqrt(x + '');
2637
2600
 
2638
2601
  // Math.sqrt underflow/overflow?
2639
2602
  // Re-estimate: pass x coefficient to Math.sqrt as integer, then adjust the result exponent.
@@ -2642,9 +2605,9 @@
2642
2605
  if (!(c.length + e & 1)) c += '0';
2643
2606
  s = Math.sqrt(c);
2644
2607
  e = ((e + 1) / 2 | 0) - (e < 0 || e & 1);
2645
- r = new Big((s == 1 / 0 ? '5e' : (s = s.toExponential()).slice(0, s.indexOf('e') + 1)) + e);
2608
+ r = new Big((s == 1 / 0 ? '1e' : (s = s.toExponential()).slice(0, s.indexOf('e') + 1)) + e);
2646
2609
  } else {
2647
- r = new Big(s + '');
2610
+ r = new Big(s);
2648
2611
  }
2649
2612
  e = r.e + (Big.DP += 4);
2650
2613
 
@@ -2653,13 +2616,13 @@
2653
2616
  t = r;
2654
2617
  r = half.times(t.plus(x.div(t)));
2655
2618
  } while (t.c.slice(0, e).join('') !== r.c.slice(0, e).join(''));
2656
- return round$1(r, (Big.DP -= 4) + r.e + 1, Big.RM);
2619
+ return round(r, Big.DP -= 4, Big.RM);
2657
2620
  };
2658
2621
 
2659
2622
  /*
2660
2623
  * Return a new Big whose value is the value of this Big times the value of Big y.
2661
2624
  */
2662
- P$3.times = P$3.mul = function (y) {
2625
+ P$2.times = P$2.mul = function (y) {
2663
2626
  var c,
2664
2627
  x = this,
2665
2628
  Big = x.constructor,
@@ -2674,10 +2637,7 @@
2674
2637
  y.s = x.s == y.s ? 1 : -1;
2675
2638
 
2676
2639
  // Return signed 0 if either 0.
2677
- if (!xc[0] || !yc[0]) {
2678
- y.c = [y.e = 0];
2679
- return y;
2680
- }
2640
+ if (!xc[0] || !yc[0]) return new Big(y.s * 0);
2681
2641
 
2682
2642
  // Initialise exponent of result as x.e + y.e.
2683
2643
  y.e = i + j;
@@ -2710,7 +2670,7 @@
2710
2670
  // carry
2711
2671
  b = b / 10 | 0;
2712
2672
  }
2713
- c[j] = b;
2673
+ c[j] = (c[j] + b) % 10;
2714
2674
  }
2715
2675
 
2716
2676
  // Increment result exponent if there is a final carry, otherwise remove leading zero.
@@ -2723,48 +2683,37 @@
2723
2683
  };
2724
2684
 
2725
2685
  /*
2726
- * Return a string representing the value of this Big in exponential notation rounded to dp fixed
2727
- * decimal places using rounding mode rm, or Big.RM if rm is not specified.
2686
+ * Return a string representing the value of this Big in exponential notation to dp fixed decimal
2687
+ * places and rounded using Big.RM.
2728
2688
  *
2729
- * dp? {number} Decimal places: integer, 0 to MAX_DP inclusive.
2730
- * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
2689
+ * dp? {number} Integer, 0 to MAX_DP inclusive.
2731
2690
  */
2732
- P$3.toExponential = function (dp, rm) {
2733
- var x = this,
2734
- n = x.c[0];
2735
- if (dp !== UNDEFINED$1) {
2736
- if (dp !== ~~dp || dp < 0 || dp > MAX_DP$1) {
2737
- throw Error(INVALID_DP$1);
2738
- }
2739
- x = round$1(new x.constructor(x), ++dp, rm);
2740
- for (; x.c.length < dp;) x.c.push(0);
2741
- }
2742
- return stringify$1(x, true, !!n);
2691
+ P$2.toExponential = function (dp) {
2692
+ return stringify(this, 1, dp, dp);
2743
2693
  };
2744
2694
 
2745
2695
  /*
2746
- * Return a string representing the value of this Big in normal notation rounded to dp fixed
2747
- * decimal places using rounding mode rm, or Big.RM if rm is not specified.
2696
+ * Return a string representing the value of this Big in normal notation to dp fixed decimal
2697
+ * places and rounded using Big.RM.
2748
2698
  *
2749
- * dp? {number} Decimal places: integer, 0 to MAX_DP inclusive.
2750
- * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
2699
+ * dp? {number} Integer, 0 to MAX_DP inclusive.
2751
2700
  *
2752
2701
  * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.
2753
2702
  * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.
2754
2703
  */
2755
- P$3.toFixed = function (dp, rm) {
2756
- var x = this,
2757
- n = x.c[0];
2758
- if (dp !== UNDEFINED$1) {
2759
- if (dp !== ~~dp || dp < 0 || dp > MAX_DP$1) {
2760
- throw Error(INVALID_DP$1);
2761
- }
2762
- x = round$1(new x.constructor(x), dp + x.e + 1, rm);
2704
+ P$2.toFixed = function (dp) {
2705
+ return stringify(this, 2, dp, this.e + dp);
2706
+ };
2763
2707
 
2764
- // x.e may have changed if the value is rounded up.
2765
- for (dp = dp + x.e + 1; x.c.length < dp;) x.c.push(0);
2766
- }
2767
- return stringify$1(x, false, !!n);
2708
+ /*
2709
+ * Return a string representing the value of this Big rounded to sd significant digits using
2710
+ * Big.RM. Use exponential notation if sd is less than the number of digits necessary to represent
2711
+ * the integer part of the value in normal notation.
2712
+ *
2713
+ * sd {number} Integer, 1 to MAX_DP inclusive.
2714
+ */
2715
+ P$2.toPrecision = function (sd) {
2716
+ return stringify(this, 3, sd, sd - 1);
2768
2717
  };
2769
2718
 
2770
2719
  /*
@@ -2773,47 +2722,8 @@
2773
2722
  * Big.PE, or a negative exponent equal to or less than Big.NE.
2774
2723
  * Omit the sign for negative zero.
2775
2724
  */
2776
- P$3.toJSON = P$3.toString = function () {
2777
- var x = this,
2778
- Big = x.constructor;
2779
- return stringify$1(x, x.e <= Big.NE || x.e >= Big.PE, !!x.c[0]);
2780
- };
2781
- if (typeof Symbol !== "undefined") {
2782
- P$3[Symbol.for('nodejs.util.inspect.custom')] = P$3.toJSON;
2783
- }
2784
-
2785
- /*
2786
- * Return the value of this Big as a primitive number.
2787
- */
2788
- P$3.toNumber = function () {
2789
- var n = +stringify$1(this, true, true);
2790
- if (this.constructor.strict === true && !this.eq(n.toString())) {
2791
- throw Error(NAME$1 + 'Imprecise conversion');
2792
- }
2793
- return n;
2794
- };
2795
-
2796
- /*
2797
- * Return a string representing the value of this Big rounded to sd significant digits using
2798
- * rounding mode rm, or Big.RM if rm is not specified.
2799
- * Use exponential notation if sd is less than the number of digits necessary to represent
2800
- * the integer part of the value in normal notation.
2801
- *
2802
- * sd {number} Significant digits: integer, 1 to MAX_DP inclusive.
2803
- * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
2804
- */
2805
- P$3.toPrecision = function (sd, rm) {
2806
- var x = this,
2807
- Big = x.constructor,
2808
- n = x.c[0];
2809
- if (sd !== UNDEFINED$1) {
2810
- if (sd !== ~~sd || sd < 1 || sd > MAX_DP$1) {
2811
- throw Error(INVALID$4 + 'precision');
2812
- }
2813
- x = round$1(new Big(x), sd, rm);
2814
- for (; x.c.length < sd;) x.c.push(0);
2815
- }
2816
- return stringify$1(x, sd <= x.e || x.e <= Big.NE || x.e >= Big.PE, !!n);
2725
+ P$2.toString = function () {
2726
+ return stringify(this);
2817
2727
  };
2818
2728
 
2819
2729
  /*
@@ -2822,18 +2732,13 @@
2822
2732
  * Big.PE, or a negative exponent equal to or less than Big.NE.
2823
2733
  * Include the sign for negative zero.
2824
2734
  */
2825
- P$3.valueOf = function () {
2826
- var x = this,
2827
- Big = x.constructor;
2828
- if (Big.strict === true) {
2829
- throw Error(NAME$1 + 'valueOf disallowed');
2830
- }
2831
- return stringify$1(x, x.e <= Big.NE || x.e >= Big.PE, true);
2735
+ P$2.valueOf = P$2.toJSON = function () {
2736
+ return stringify(this, 4);
2832
2737
  };
2833
2738
 
2834
2739
  // Export
2835
2740
 
2836
- var Big$1 = _Big_$1();
2741
+ var Big = _Big_();
2837
2742
 
2838
2743
  var f = 0;
2839
2744
  function u(e, t, n, o, i, u) {
@@ -8503,7 +8408,7 @@
8503
8408
  }, zone || mergedZone, next];
8504
8409
  }, [{}, null, 1]).slice(0, 2);
8505
8410
  }
8506
- function parse$1(s, ...patterns) {
8411
+ function parse(s, ...patterns) {
8507
8412
  if (s == null) {
8508
8413
  return [null, null];
8509
8414
  }
@@ -8674,26 +8579,26 @@
8674
8579
  */
8675
8580
 
8676
8581
  function parseISODate(s) {
8677
- return parse$1(s, [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset], [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime], [isoTimeCombinedRegex, extractISOTimeAndOffset]);
8582
+ return parse(s, [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset], [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime], [isoTimeCombinedRegex, extractISOTimeAndOffset]);
8678
8583
  }
8679
8584
  function parseRFC2822Date(s) {
8680
- return parse$1(preprocessRFC2822(s), [rfc2822, extractRFC2822]);
8585
+ return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]);
8681
8586
  }
8682
8587
  function parseHTTPDate(s) {
8683
- return parse$1(s, [rfc1123, extractRFC1123Or850], [rfc850, extractRFC1123Or850], [ascii, extractASCII]);
8588
+ return parse(s, [rfc1123, extractRFC1123Or850], [rfc850, extractRFC1123Or850], [ascii, extractASCII]);
8684
8589
  }
8685
8590
  function parseISODuration(s) {
8686
- return parse$1(s, [isoDuration, extractISODuration]);
8591
+ return parse(s, [isoDuration, extractISODuration]);
8687
8592
  }
8688
8593
  const extractISOTimeOnly = combineExtractors(extractISOTime);
8689
8594
  function parseISOTimeOnly(s) {
8690
- return parse$1(s, [isoTimeOnly, extractISOTimeOnly]);
8595
+ return parse(s, [isoTimeOnly, extractISOTimeOnly]);
8691
8596
  }
8692
8597
  const sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);
8693
8598
  const sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);
8694
8599
  const extractISOTimeOffsetAndIANAZone = combineExtractors(extractISOTime, extractISOOffset, extractIANAZone);
8695
8600
  function parseSQL(s) {
8696
- return parse$1(s, [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]);
8601
+ return parse(s, [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]);
8697
8602
  }
8698
8603
  const INVALID$2 = "Invalid Duration";
8699
8604
 
@@ -11093,7 +10998,7 @@
11093
10998
  const resolvedOpts = df.resolvedOptions();
11094
10999
  return parts.map(p => tokenForPart(p, formatOpts, resolvedOpts));
11095
11000
  }
11096
- const INVALID$3 = "Invalid DateTime";
11001
+ const INVALID = "Invalid DateTime";
11097
11002
  const MAX_DATE = 8.64e15;
11098
11003
  function unsupportedZone(zone) {
11099
11004
  return new Invalid("unsupported zone", `the zone "${zone.name}" is not supported`);
@@ -12805,7 +12710,7 @@
12805
12710
  * @return {string}
12806
12711
  */
12807
12712
  toFormat(fmt, opts = {}) {
12808
- return this.isValid ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt) : INVALID$3;
12713
+ return this.isValid ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt) : INVALID;
12809
12714
  }
12810
12715
 
12811
12716
  /**
@@ -12828,7 +12733,7 @@
12828
12733
  * @return {string}
12829
12734
  */
12830
12735
  toLocaleString(formatOpts = DATE_SHORT, opts = {}) {
12831
- return this.isValid ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this) : INVALID$3;
12736
+ return this.isValid ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this) : INVALID;
12832
12737
  }
12833
12738
 
12834
12739
  /**
@@ -13036,7 +12941,7 @@
13036
12941
  * @return {string}
13037
12942
  */
13038
12943
  toString() {
13039
- return this.isValid ? this.toISO() : INVALID$3;
12944
+ return this.isValid ? this.toISO() : INVALID;
13040
12945
  }
13041
12946
 
13042
12947
  /**
@@ -15764,7 +15669,7 @@
15764
15669
  return W$1(n, t, e);
15765
15670
  }), n.__c && n.__c.__P === t && (n.__e && e.appendChild(n.__e), n.__c.__e = true, n.__c.__P = e)), n;
15766
15671
  }
15767
- function P$2() {
15672
+ function P$1() {
15768
15673
  this.__u = 0, this.o = null, this.__b = null;
15769
15674
  }
15770
15675
  function j$1(n) {
@@ -15777,7 +15682,7 @@
15777
15682
  l$2.unmount = function (n) {
15778
15683
  var t = n.__c;
15779
15684
  t && (t.__z = true), t && t.__R && t.__R(), t && 32 & n.__u && (n.type = null), U$1 && U$1(n);
15780
- }, (P$2.prototype = new C$2()).__c = function (n, t) {
15685
+ }, (P$1.prototype = new C$2()).__c = function (n, t) {
15781
15686
  var e = t.__c,
15782
15687
  r = this;
15783
15688
  null == r.o && (r.o = []), r.o.push(e);
@@ -15804,9 +15709,9 @@
15804
15709
  r.__u++ || 32 & t.__u || r.setState({
15805
15710
  __a: r.__b = r.__v.__k[0]
15806
15711
  }), n.then(i, i);
15807
- }, P$2.prototype.componentWillUnmount = function () {
15712
+ }, P$1.prototype.componentWillUnmount = function () {
15808
15713
  this.o = [];
15809
- }, P$2.prototype.render = function (n, e) {
15714
+ }, P$1.prototype.render = function (n, e) {
15810
15715
  if (this.__b) {
15811
15716
  if (this.__v.__k) {
15812
15717
  var r = document.createElement("div"),
@@ -28835,7 +28740,7 @@ ${e}</tr>
28835
28740
  return n;
28836
28741
  }
28837
28742
  };
28838
- var P$1 = class P {
28743
+ var P = class {
28839
28744
  options;
28840
28745
  block;
28841
28746
  constructor(e) {
@@ -28872,7 +28777,7 @@ ${e}</tr>
28872
28777
  TextRenderer = L$1;
28873
28778
  Lexer = x;
28874
28779
  Tokenizer = w;
28875
- Hooks = P$1;
28780
+ Hooks = P;
28876
28781
  constructor(...e) {
28877
28782
  this.use(...e);
28878
28783
  }
@@ -28958,15 +28863,15 @@ ${e}</tr>
28958
28863
  s.tokenizer = r;
28959
28864
  }
28960
28865
  if (n.hooks) {
28961
- let r = this.defaults.hooks || new P$1();
28866
+ let r = this.defaults.hooks || new P();
28962
28867
  for (let i in n.hooks) {
28963
28868
  if (!(i in r)) throw new Error(`hook '${i}' does not exist`);
28964
28869
  if (["options", "block"].includes(i)) continue;
28965
28870
  let o = i,
28966
28871
  u = n.hooks[o],
28967
28872
  a = r[o];
28968
- P$1.passThroughHooks.has(i) ? r[o] = c => {
28969
- if (this.defaults.async && P$1.passThroughHooksRespectAsync.has(i)) return (async () => {
28873
+ P.passThroughHooks.has(i) ? r[o] = c => {
28874
+ if (this.defaults.async && P.passThroughHooksRespectAsync.has(i)) return (async () => {
28970
28875
  let k = await u.call(r, c);
28971
28876
  return a.call(r, k);
28972
28877
  })();
@@ -29076,7 +28981,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
29076
28981
  g.Lexer = x;
29077
28982
  g.lexer = x.lex;
29078
28983
  g.Tokenizer = w;
29079
- g.Hooks = P$1;
28984
+ g.Hooks = P;
29080
28985
  g.parse = g;
29081
28986
  g.options;
29082
28987
  g.setOptions;
@@ -33048,7 +32953,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33048
32953
  })));
33049
32954
  };
33050
32955
  function countDecimals$1(number) {
33051
- const num = Big$1(number);
32956
+ const num = Big(number);
33052
32957
  if (num.toString() === num.toFixed(0)) return 0;
33053
32958
  return num.toFixed().split('.')[1].length || 0;
33054
32959
  }
@@ -33167,15 +33072,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33167
33072
 
33168
33073
  // caches the value an increment/decrement operation will be based on
33169
33074
  const incrementAmount = T$3(() => {
33170
- if (incrementValue) return Big$1(incrementValue);
33171
- if (decimalDigits) return Big$1(`1e-${decimalDigits}`);
33172
- return Big$1('1');
33075
+ if (incrementValue) return Big(incrementValue);
33076
+ if (decimalDigits) return Big(`1e-${decimalDigits}`);
33077
+ return Big('1');
33173
33078
  }, [decimalDigits, incrementValue]);
33174
33079
  const increment = () => {
33175
33080
  if (readonly) {
33176
33081
  return;
33177
33082
  }
33178
- const base = isValidNumber$1(cachedValue) ? Big$1(cachedValue) : Big$1(0);
33083
+ const base = isValidNumber$1(cachedValue) ? Big(cachedValue) : Big(0);
33179
33084
  const stepFlooredValue = base.minus(base.mod(incrementAmount));
33180
33085
 
33181
33086
  // note: toFixed() behaves differently in big.js
@@ -33185,7 +33090,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33185
33090
  if (readonly) {
33186
33091
  return;
33187
33092
  }
33188
- const base = isValidNumber$1(cachedValue) ? Big$1(cachedValue) : Big$1(0);
33093
+ const base = isValidNumber$1(cachedValue) ? Big(cachedValue) : Big(0);
33189
33094
  const offset = base.mod(incrementAmount);
33190
33095
  if (offset.cmp(0) === 0) {
33191
33096
  // if we're already on a valid step, decrement
@@ -37807,8 +37712,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
37807
37712
  errors.push('Value is expected to ' + (decimalDigits === 0 ? 'be an integer' : `have at most ${decimalDigits} decimal digit${decimalDigits > 1 ? 's' : ''}`) + '.');
37808
37713
  }
37809
37714
  if (increment) {
37810
- const bigValue = Big$1(value);
37811
- const bigIncrement = Big$1(increment);
37715
+ const bigValue = Big(value);
37716
+ const bigIncrement = Big(increment);
37812
37717
  const offset = bigValue.mod(bigIncrement);
37813
37718
  if (offset.cmp(0) !== 0) {
37814
37719
  const previousValue = bigValue.minus(offset);
@@ -37834,7 +37739,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
37834
37739
  }
37835
37740
  if ('min' in validation && (value || value === 0)) {
37836
37741
  try {
37837
- if (Big$1(value).lt(Big$1(validation.min))) {
37742
+ if (Big(value).lt(Big(validation.min))) {
37838
37743
  errors.push(`Field must have minimum value of ${validation.min}.`);
37839
37744
  }
37840
37745
  } catch {
@@ -37843,7 +37748,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
37843
37748
  }
37844
37749
  if ('max' in validation && (value || value === 0)) {
37845
37750
  try {
37846
- if (Big$1(value).gt(Big$1(validation.max))) {
37751
+ if (Big(value).gt(Big(validation.max))) {
37847
37752
  errors.push(`Field must have maximum value of ${validation.max}.`);
37848
37753
  }
37849
37754
  } catch {
@@ -71747,941 +71652,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
71747
71652
  return trap;
71748
71653
  };
71749
71654
 
71750
- /*
71751
- * big.js v7.0.1
71752
- * A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic.
71753
- * Copyright (c) 2025 Michael Mclaughlin
71754
- * https://github.com/MikeMcl/big.js/LICENCE.md
71755
- */
71756
-
71757
- /************************************** EDITABLE DEFAULTS *****************************************/
71758
-
71759
- // The default values below must be integers within the stated ranges.
71760
-
71761
- /*
71762
- * The maximum number of decimal places (DP) of the results of operations involving division:
71763
- * div and sqrt, and pow with negative exponents.
71764
- */
71765
- var DP = 20,
71766
- // 0 to MAX_DP
71767
-
71768
- /*
71769
- * The rounding mode (RM) used when rounding to the above decimal places.
71770
- *
71771
- * 0 Towards zero (i.e. truncate, no rounding). (ROUND_DOWN)
71772
- * 1 To nearest neighbour. If equidistant, round up. (ROUND_HALF_UP)
71773
- * 2 To nearest neighbour. If equidistant, to even. (ROUND_HALF_EVEN)
71774
- * 3 Away from zero. (ROUND_UP)
71775
- */
71776
- RM = 1,
71777
- // 0, 1, 2 or 3
71778
-
71779
- // The maximum value of DP and Big.DP.
71780
- MAX_DP = 1E6,
71781
- // 0 to 1000000
71782
-
71783
- // The maximum magnitude of the exponent argument to the pow method.
71784
- MAX_POWER = 1E6,
71785
- // 1 to 1000000
71786
-
71787
- /*
71788
- * The negative exponent (NE) at and beneath which toString returns exponential notation.
71789
- * (JavaScript numbers: -7)
71790
- * -1000000 is the minimum recommended exponent value of a Big.
71791
- */
71792
- NE = -7,
71793
- // 0 to -1000000
71794
-
71795
- /*
71796
- * The positive exponent (PE) at and above which toString returns exponential notation.
71797
- * (JavaScript numbers: 21)
71798
- * 1000000 is the maximum recommended exponent value of a Big, but this limit is not enforced.
71799
- */
71800
- PE = 21,
71801
- // 0 to 1000000
71802
-
71803
- /*
71804
- * When true, an error will be thrown if a primitive number is passed to the Big constructor,
71805
- * or if valueOf is called, or if toNumber is called on a Big which cannot be converted to a
71806
- * primitive number without a loss of precision.
71807
- */
71808
- STRICT = false,
71809
- // true or false
71810
-
71811
- /**************************************************************************************************/
71812
-
71813
- // Error messages.
71814
- NAME = '[big.js] ',
71815
- INVALID = NAME + 'Invalid ',
71816
- INVALID_DP = INVALID + 'decimal places',
71817
- INVALID_RM = INVALID + 'rounding mode',
71818
- DIV_BY_ZERO = NAME + 'Division by zero',
71819
- // The shared prototype object.
71820
- P = {},
71821
- UNDEFINED = void 0,
71822
- NUMERIC = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
71823
-
71824
- /*
71825
- * Create and return a Big constructor.
71826
- */
71827
- function _Big_() {
71828
- /*
71829
- * The Big constructor and exported function.
71830
- * Create and return a new instance of a Big number object.
71831
- *
71832
- * n {number|string|Big} A numeric value.
71833
- */
71834
- function Big(n) {
71835
- var x = this;
71836
-
71837
- // Enable constructor usage without new.
71838
- if (!(x instanceof Big)) {
71839
- return n === UNDEFINED && arguments.length === 0 ? _Big_() : new Big(n);
71840
- }
71841
-
71842
- // Duplicate.
71843
- if (n instanceof Big) {
71844
- x.s = n.s;
71845
- x.e = n.e;
71846
- x.c = n.c.slice();
71847
- } else {
71848
- if (typeof n !== 'string') {
71849
- if (Big.strict === true && typeof n !== 'bigint') {
71850
- throw TypeError(INVALID + 'value');
71851
- }
71852
-
71853
- // Minus zero?
71854
- n = n === 0 && 1 / n < 0 ? '-0' : String(n);
71855
- }
71856
- parse(x, n);
71857
- }
71858
-
71859
- // Retain a reference to this Big constructor.
71860
- // Shadow Big.prototype.constructor which points to Object.
71861
- x.constructor = Big;
71862
- }
71863
- Big.prototype = P;
71864
- Big.DP = DP;
71865
- Big.RM = RM;
71866
- Big.NE = NE;
71867
- Big.PE = PE;
71868
- Big.strict = STRICT;
71869
- Big.roundDown = 0;
71870
- Big.roundHalfUp = 1;
71871
- Big.roundHalfEven = 2;
71872
- Big.roundUp = 3;
71873
- return Big;
71874
- }
71875
-
71876
- /*
71877
- * Parse the number or string value passed to a Big constructor.
71878
- *
71879
- * x {Big} A Big number instance.
71880
- * n {number|string} A numeric value.
71881
- */
71882
- function parse(x, n) {
71883
- var e, i, nl;
71884
- if (!NUMERIC.test(n)) {
71885
- throw Error(INVALID + 'number');
71886
- }
71887
-
71888
- // Determine sign.
71889
- x.s = n.charAt(0) == '-' ? (n = n.slice(1), -1) : 1;
71890
-
71891
- // Decimal point?
71892
- if ((e = n.indexOf('.')) > -1) n = n.replace('.', '');
71893
-
71894
- // Exponential form?
71895
- if ((i = n.search(/e/i)) > 0) {
71896
- // Determine exponent.
71897
- if (e < 0) e = i;
71898
- e += +n.slice(i + 1);
71899
- n = n.substring(0, i);
71900
- } else if (e < 0) {
71901
- // Integer.
71902
- e = n.length;
71903
- }
71904
- nl = n.length;
71905
-
71906
- // Determine leading zeros.
71907
- for (i = 0; i < nl && n.charAt(i) == '0';) ++i;
71908
- if (i == nl) {
71909
- // Zero.
71910
- x.c = [x.e = 0];
71911
- } else {
71912
- // Determine trailing zeros.
71913
- for (; nl > 0 && n.charAt(--nl) == '0';);
71914
- x.e = e - i - 1;
71915
- x.c = [];
71916
-
71917
- // Convert string to array of digits without leading/trailing zeros.
71918
- for (e = 0; i <= nl;) x.c[e++] = +n.charAt(i++);
71919
- }
71920
- return x;
71921
- }
71922
-
71923
- /*
71924
- * Round Big x to a maximum of sd significant digits using rounding mode rm.
71925
- *
71926
- * x {Big} The Big to round.
71927
- * sd {number} Significant digits: integer, 0 to MAX_DP inclusive.
71928
- * rm {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
71929
- * [more] {boolean} Whether the result of division was truncated.
71930
- */
71931
- function round(x, sd, rm, more) {
71932
- var xc = x.c;
71933
- if (rm === UNDEFINED) rm = x.constructor.RM;
71934
- if (rm !== 0 && rm !== 1 && rm !== 2 && rm !== 3) {
71935
- throw Error(INVALID_RM);
71936
- }
71937
- if (sd < 1) {
71938
- more = rm === 3 && (more || !!xc[0]) || sd === 0 && (rm === 1 && xc[0] >= 5 || rm === 2 && (xc[0] > 5 || xc[0] === 5 && (more || xc[1] !== UNDEFINED)));
71939
- xc.length = 1;
71940
- if (more) {
71941
- // 1, 0.1, 0.01, 0.001, 0.0001 etc.
71942
- x.e = x.e - sd + 1;
71943
- xc[0] = 1;
71944
- } else {
71945
- // Zero.
71946
- xc[0] = x.e = 0;
71947
- }
71948
- } else if (sd < xc.length) {
71949
- // xc[sd] is the digit after the digit that may be rounded up.
71950
- more = rm === 1 && xc[sd] >= 5 || rm === 2 && (xc[sd] > 5 || xc[sd] === 5 && (more || xc[sd + 1] !== UNDEFINED || xc[sd - 1] & 1)) || rm === 3 && (more || !!xc[0]);
71951
-
71952
- // Remove any digits after the required precision.
71953
- xc.length = sd;
71954
-
71955
- // Round up?
71956
- if (more) {
71957
- // Rounding up may mean the previous digit has to be rounded up.
71958
- for (; ++xc[--sd] > 9;) {
71959
- xc[sd] = 0;
71960
- if (sd === 0) {
71961
- ++x.e;
71962
- xc.unshift(1);
71963
- break;
71964
- }
71965
- }
71966
- }
71967
-
71968
- // Remove trailing zeros.
71969
- for (sd = xc.length; !xc[--sd];) xc.pop();
71970
- }
71971
- return x;
71972
- }
71973
-
71974
- /*
71975
- * Return a string representing the value of Big x in normal or exponential notation.
71976
- * Handles P.toExponential, P.toFixed, P.toJSON, P.toPrecision, P.toString and P.valueOf.
71977
- */
71978
- function stringify(x, doExponential, isNonzero) {
71979
- var e = x.e,
71980
- s = x.c.join(''),
71981
- n = s.length;
71982
-
71983
- // Exponential notation?
71984
- if (doExponential) {
71985
- s = s.charAt(0) + (n > 1 ? '.' + s.slice(1) : '') + (e < 0 ? 'e' : 'e+') + e;
71986
-
71987
- // Normal notation.
71988
- } else if (e < 0) {
71989
- for (; ++e;) s = '0' + s;
71990
- s = '0.' + s;
71991
- } else if (e > 0) {
71992
- if (++e > n) {
71993
- for (e -= n; e--;) s += '0';
71994
- } else if (e < n) {
71995
- s = s.slice(0, e) + '.' + s.slice(e);
71996
- }
71997
- } else if (n > 1) {
71998
- s = s.charAt(0) + '.' + s.slice(1);
71999
- }
72000
- return x.s < 0 && isNonzero ? '-' + s : s;
72001
- }
72002
-
72003
- // Prototype/instance methods
72004
-
72005
- /*
72006
- * Return a new Big whose value is the absolute value of this Big.
72007
- */
72008
- P.abs = function () {
72009
- var x = new this.constructor(this);
72010
- x.s = 1;
72011
- return x;
72012
- };
72013
-
72014
- /*
72015
- * Return 1 if the value of this Big is greater than the value of Big y,
72016
- * -1 if the value of this Big is less than the value of Big y, or
72017
- * 0 if they have the same value.
72018
- */
72019
- P.cmp = function (y) {
72020
- var isneg,
72021
- x = this,
72022
- xc = x.c,
72023
- yc = (y = new x.constructor(y)).c,
72024
- i = x.s,
72025
- j = y.s,
72026
- k = x.e,
72027
- l = y.e;
72028
-
72029
- // Either zero?
72030
- if (!xc[0] || !yc[0]) return !xc[0] ? !yc[0] ? 0 : -j : i;
72031
-
72032
- // Signs differ?
72033
- if (i != j) return i;
72034
- isneg = i < 0;
72035
-
72036
- // Compare exponents.
72037
- if (k != l) return k > l ^ isneg ? 1 : -1;
72038
- j = (k = xc.length) < (l = yc.length) ? k : l;
72039
-
72040
- // Compare digit by digit.
72041
- for (i = -1; ++i < j;) {
72042
- if (xc[i] != yc[i]) return xc[i] > yc[i] ^ isneg ? 1 : -1;
72043
- }
72044
-
72045
- // Compare lengths.
72046
- return k == l ? 0 : k > l ^ isneg ? 1 : -1;
72047
- };
72048
-
72049
- /*
72050
- * Return a new Big whose value is the value of this Big divided by the value of Big y, rounded,
72051
- * if necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.
72052
- */
72053
- P.div = function (y) {
72054
- var x = this,
72055
- Big = x.constructor,
72056
- a = x.c,
72057
- // dividend
72058
- b = (y = new Big(y)).c,
72059
- // divisor
72060
- k = x.s == y.s ? 1 : -1,
72061
- dp = Big.DP;
72062
- if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {
72063
- throw Error(INVALID_DP);
72064
- }
72065
-
72066
- // Divisor is zero?
72067
- if (!b[0]) {
72068
- throw Error(DIV_BY_ZERO);
72069
- }
72070
-
72071
- // Dividend is 0? Return +-0.
72072
- if (!a[0]) {
72073
- y.s = k;
72074
- y.c = [y.e = 0];
72075
- return y;
72076
- }
72077
- var bl,
72078
- bt,
72079
- n,
72080
- cmp,
72081
- ri,
72082
- bz = b.slice(),
72083
- ai = bl = b.length,
72084
- al = a.length,
72085
- r = a.slice(0, bl),
72086
- // remainder
72087
- rl = r.length,
72088
- q = y,
72089
- // quotient
72090
- qc = q.c = [],
72091
- qi = 0,
72092
- p = dp + (q.e = x.e - y.e) + 1; // precision of the result
72093
-
72094
- q.s = k;
72095
- k = p < 0 ? 0 : p;
72096
-
72097
- // Create version of divisor with leading zero.
72098
- bz.unshift(0);
72099
-
72100
- // Add zeros to make remainder as long as divisor.
72101
- for (; rl++ < bl;) r.push(0);
72102
- do {
72103
- // n is how many times the divisor goes into current remainder.
72104
- for (n = 0; n < 10; n++) {
72105
- // Compare divisor and remainder.
72106
- if (bl != (rl = r.length)) {
72107
- cmp = bl > rl ? 1 : -1;
72108
- } else {
72109
- for (ri = -1, cmp = 0; ++ri < bl;) {
72110
- if (b[ri] != r[ri]) {
72111
- cmp = b[ri] > r[ri] ? 1 : -1;
72112
- break;
72113
- }
72114
- }
72115
- }
72116
-
72117
- // If divisor < remainder, subtract divisor from remainder.
72118
- if (cmp < 0) {
72119
- // Remainder can't be more than 1 digit longer than divisor.
72120
- // Equalise lengths using divisor with extra leading zero?
72121
- for (bt = rl == bl ? b : bz; rl;) {
72122
- if (r[--rl] < bt[rl]) {
72123
- ri = rl;
72124
- for (; ri && !r[--ri];) r[ri] = 9;
72125
- --r[ri];
72126
- r[rl] += 10;
72127
- }
72128
- r[rl] -= bt[rl];
72129
- }
72130
- for (; !r[0];) r.shift();
72131
- } else {
72132
- break;
72133
- }
72134
- }
72135
-
72136
- // Add the digit n to the result array.
72137
- qc[qi++] = cmp ? n : ++n;
72138
-
72139
- // Update the remainder.
72140
- if (r[0] && cmp) r[rl] = a[ai] || 0;else r = [a[ai]];
72141
- } while ((ai++ < al || r[0] !== UNDEFINED) && k--);
72142
-
72143
- // Leading zero? Do not remove if result is simply zero (qi == 1).
72144
- if (!qc[0] && qi != 1) {
72145
- // There can't be more than one zero.
72146
- qc.shift();
72147
- q.e--;
72148
- p--;
72149
- }
72150
-
72151
- // Round?
72152
- if (qi > p) round(q, p, Big.RM, r[0] !== UNDEFINED);
72153
- return q;
72154
- };
72155
-
72156
- /*
72157
- * Return true if the value of this Big is equal to the value of Big y, otherwise return false.
72158
- */
72159
- P.eq = function (y) {
72160
- return this.cmp(y) === 0;
72161
- };
72162
-
72163
- /*
72164
- * Return true if the value of this Big is greater than the value of Big y, otherwise return
72165
- * false.
72166
- */
72167
- P.gt = function (y) {
72168
- return this.cmp(y) > 0;
72169
- };
72170
-
72171
- /*
72172
- * Return true if the value of this Big is greater than or equal to the value of Big y, otherwise
72173
- * return false.
72174
- */
72175
- P.gte = function (y) {
72176
- return this.cmp(y) > -1;
72177
- };
72178
-
72179
- /*
72180
- * Return true if the value of this Big is less than the value of Big y, otherwise return false.
72181
- */
72182
- P.lt = function (y) {
72183
- return this.cmp(y) < 0;
72184
- };
72185
-
72186
- /*
72187
- * Return true if the value of this Big is less than or equal to the value of Big y, otherwise
72188
- * return false.
72189
- */
72190
- P.lte = function (y) {
72191
- return this.cmp(y) < 1;
72192
- };
72193
-
72194
- /*
72195
- * Return a new Big whose value is the value of this Big minus the value of Big y.
72196
- */
72197
- P.minus = P.sub = function (y) {
72198
- var i,
72199
- j,
72200
- t,
72201
- xlty,
72202
- x = this,
72203
- Big = x.constructor,
72204
- a = x.s,
72205
- b = (y = new Big(y)).s;
72206
-
72207
- // Signs differ?
72208
- if (a != b) {
72209
- y.s = -b;
72210
- return x.plus(y);
72211
- }
72212
- var xc = x.c.slice(),
72213
- xe = x.e,
72214
- yc = y.c,
72215
- ye = y.e;
72216
-
72217
- // Either zero?
72218
- if (!xc[0] || !yc[0]) {
72219
- if (yc[0]) {
72220
- y.s = -b;
72221
- } else if (xc[0]) {
72222
- y = new Big(x);
72223
- } else {
72224
- y.s = 1;
72225
- }
72226
- return y;
72227
- }
72228
-
72229
- // Determine which is the bigger number. Prepend zeros to equalise exponents.
72230
- if (a = xe - ye) {
72231
- if (xlty = a < 0) {
72232
- a = -a;
72233
- t = xc;
72234
- } else {
72235
- ye = xe;
72236
- t = yc;
72237
- }
72238
- t.reverse();
72239
- for (b = a; b--;) t.push(0);
72240
- t.reverse();
72241
- } else {
72242
- // Exponents equal. Check digit by digit.
72243
- j = ((xlty = xc.length < yc.length) ? xc : yc).length;
72244
- for (a = b = 0; b < j; b++) {
72245
- if (xc[b] != yc[b]) {
72246
- xlty = xc[b] < yc[b];
72247
- break;
72248
- }
72249
- }
72250
- }
72251
-
72252
- // x < y? Point xc to the array of the bigger number.
72253
- if (xlty) {
72254
- t = xc;
72255
- xc = yc;
72256
- yc = t;
72257
- y.s = -y.s;
72258
- }
72259
-
72260
- /*
72261
- * Append zeros to xc if shorter. No need to add zeros to yc if shorter as subtraction only
72262
- * needs to start at yc.length.
72263
- */
72264
- if ((b = (j = yc.length) - (i = xc.length)) > 0) for (; b--;) xc[i++] = 0;
72265
-
72266
- // Subtract yc from xc.
72267
- for (b = i; j > a;) {
72268
- if (xc[--j] < yc[j]) {
72269
- for (i = j; i && !xc[--i];) xc[i] = 9;
72270
- --xc[i];
72271
- xc[j] += 10;
72272
- }
72273
- xc[j] -= yc[j];
72274
- }
72275
-
72276
- // Remove trailing zeros.
72277
- for (; xc[--b] === 0;) xc.pop();
72278
-
72279
- // Remove leading zeros and adjust exponent accordingly.
72280
- for (; xc[0] === 0;) {
72281
- xc.shift();
72282
- --ye;
72283
- }
72284
- if (!xc[0]) {
72285
- // n - n = +0
72286
- y.s = 1;
72287
-
72288
- // Result must be zero.
72289
- xc = [ye = 0];
72290
- }
72291
- y.c = xc;
72292
- y.e = ye;
72293
- return y;
72294
- };
72295
-
72296
- /*
72297
- * Return a new Big whose value is the value of this Big modulo the value of Big y.
72298
- */
72299
- P.mod = function (y) {
72300
- var ygtx,
72301
- x = this,
72302
- Big = x.constructor,
72303
- a = x.s,
72304
- b = (y = new Big(y)).s;
72305
- if (!y.c[0]) {
72306
- throw Error(DIV_BY_ZERO);
72307
- }
72308
- x.s = y.s = 1;
72309
- ygtx = y.cmp(x) == 1;
72310
- x.s = a;
72311
- y.s = b;
72312
- if (ygtx) return new Big(x);
72313
- a = Big.DP;
72314
- b = Big.RM;
72315
- Big.DP = Big.RM = 0;
72316
- x = x.div(y);
72317
- Big.DP = a;
72318
- Big.RM = b;
72319
- return this.minus(x.times(y));
72320
- };
72321
-
72322
- /*
72323
- * Return a new Big whose value is the value of this Big negated.
72324
- */
72325
- P.neg = function () {
72326
- var x = new this.constructor(this);
72327
- x.s = -x.s;
72328
- return x;
72329
- };
72330
-
72331
- /*
72332
- * Return a new Big whose value is the value of this Big plus the value of Big y.
72333
- */
72334
- P.plus = P.add = function (y) {
72335
- var e,
72336
- k,
72337
- t,
72338
- x = this,
72339
- Big = x.constructor;
72340
- y = new Big(y);
72341
-
72342
- // Signs differ?
72343
- if (x.s != y.s) {
72344
- y.s = -y.s;
72345
- return x.minus(y);
72346
- }
72347
- var xe = x.e,
72348
- xc = x.c,
72349
- ye = y.e,
72350
- yc = y.c;
72351
-
72352
- // Either zero?
72353
- if (!xc[0] || !yc[0]) {
72354
- if (!yc[0]) {
72355
- if (xc[0]) {
72356
- y = new Big(x);
72357
- } else {
72358
- y.s = x.s;
72359
- }
72360
- }
72361
- return y;
72362
- }
72363
- xc = xc.slice();
72364
-
72365
- // Prepend zeros to equalise exponents.
72366
- // Note: reverse faster than unshifts.
72367
- if (e = xe - ye) {
72368
- if (e > 0) {
72369
- ye = xe;
72370
- t = yc;
72371
- } else {
72372
- e = -e;
72373
- t = xc;
72374
- }
72375
- t.reverse();
72376
- for (; e--;) t.push(0);
72377
- t.reverse();
72378
- }
72379
-
72380
- // Point xc to the longer array.
72381
- if (xc.length - yc.length < 0) {
72382
- t = yc;
72383
- yc = xc;
72384
- xc = t;
72385
- }
72386
- e = yc.length;
72387
-
72388
- // Only start adding at yc.length - 1 as the further digits of xc can be left as they are.
72389
- for (k = 0; e; xc[e] %= 10) k = (xc[--e] = xc[e] + yc[e] + k) / 10 | 0;
72390
-
72391
- // No need to check for zero, as +x + +y != 0 && -x + -y != 0
72392
-
72393
- if (k) {
72394
- xc.unshift(k);
72395
- ++ye;
72396
- }
72397
-
72398
- // Remove trailing zeros.
72399
- for (e = xc.length; xc[--e] === 0;) xc.pop();
72400
- y.c = xc;
72401
- y.e = ye;
72402
- return y;
72403
- };
72404
-
72405
- /*
72406
- * Return a Big whose value is the value of this Big raised to the power n.
72407
- * If n is negative, round to a maximum of Big.DP decimal places using rounding
72408
- * mode Big.RM.
72409
- *
72410
- * n {number} Integer, -MAX_POWER to MAX_POWER inclusive.
72411
- */
72412
- P.pow = function (n) {
72413
- var x = this,
72414
- one = new x.constructor('1'),
72415
- y = one,
72416
- isneg = n < 0;
72417
- if (n !== ~~n || n < -MAX_POWER || n > MAX_POWER) {
72418
- throw Error(INVALID + 'exponent');
72419
- }
72420
- if (isneg) n = -n;
72421
- for (;;) {
72422
- if (n & 1) y = y.times(x);
72423
- n >>= 1;
72424
- if (!n) break;
72425
- x = x.times(x);
72426
- }
72427
- return isneg ? one.div(y) : y;
72428
- };
72429
-
72430
- /*
72431
- * Return a new Big whose value is the value of this Big rounded to a maximum precision of sd
72432
- * significant digits using rounding mode rm, or Big.RM if rm is not specified.
72433
- *
72434
- * sd {number} Significant digits: integer, 1 to MAX_DP inclusive.
72435
- * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
72436
- */
72437
- P.prec = function (sd, rm) {
72438
- if (sd !== ~~sd || sd < 1 || sd > MAX_DP) {
72439
- throw Error(INVALID + 'precision');
72440
- }
72441
- return round(new this.constructor(this), sd, rm);
72442
- };
72443
-
72444
- /*
72445
- * Return a new Big whose value is the value of this Big rounded to a maximum of dp decimal places
72446
- * using rounding mode rm, or Big.RM if rm is not specified.
72447
- * If dp is negative, round to an integer which is a multiple of 10**-dp.
72448
- * If dp is not specified, round to 0 decimal places.
72449
- *
72450
- * dp? {number} Integer, -MAX_DP to MAX_DP inclusive.
72451
- * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
72452
- */
72453
- P.round = function (dp, rm) {
72454
- if (dp === UNDEFINED) dp = 0;else if (dp !== ~~dp || dp < -MAX_DP || dp > MAX_DP) {
72455
- throw Error(INVALID_DP);
72456
- }
72457
- return round(new this.constructor(this), dp + this.e + 1, rm);
72458
- };
72459
-
72460
- /*
72461
- * Return a new Big whose value is the square root of the value of this Big, rounded, if
72462
- * necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.
72463
- */
72464
- P.sqrt = function () {
72465
- var r,
72466
- c,
72467
- t,
72468
- x = this,
72469
- Big = x.constructor,
72470
- s = x.s,
72471
- e = x.e,
72472
- half = new Big('0.5');
72473
-
72474
- // Zero?
72475
- if (!x.c[0]) return new Big(x);
72476
-
72477
- // Negative?
72478
- if (s < 0) {
72479
- throw Error(NAME + 'No square root');
72480
- }
72481
-
72482
- // Estimate.
72483
- s = Math.sqrt(+stringify(x, true, true));
72484
-
72485
- // Math.sqrt underflow/overflow?
72486
- // Re-estimate: pass x coefficient to Math.sqrt as integer, then adjust the result exponent.
72487
- if (s === 0 || s === 1 / 0) {
72488
- c = x.c.join('');
72489
- if (!(c.length + e & 1)) c += '0';
72490
- s = Math.sqrt(c);
72491
- e = ((e + 1) / 2 | 0) - (e < 0 || e & 1);
72492
- r = new Big((s == 1 / 0 ? '5e' : (s = s.toExponential()).slice(0, s.indexOf('e') + 1)) + e);
72493
- } else {
72494
- r = new Big(s + '');
72495
- }
72496
- e = r.e + (Big.DP += 4);
72497
-
72498
- // Newton-Raphson iteration.
72499
- do {
72500
- t = r;
72501
- r = half.times(t.plus(x.div(t)));
72502
- } while (t.c.slice(0, e).join('') !== r.c.slice(0, e).join(''));
72503
- return round(r, (Big.DP -= 4) + r.e + 1, Big.RM);
72504
- };
72505
-
72506
- /*
72507
- * Return a new Big whose value is the value of this Big times the value of Big y.
72508
- */
72509
- P.times = P.mul = function (y) {
72510
- var c,
72511
- x = this,
72512
- Big = x.constructor,
72513
- xc = x.c,
72514
- yc = (y = new Big(y)).c,
72515
- a = xc.length,
72516
- b = yc.length,
72517
- i = x.e,
72518
- j = y.e;
72519
-
72520
- // Determine sign of result.
72521
- y.s = x.s == y.s ? 1 : -1;
72522
-
72523
- // Return signed 0 if either 0.
72524
- if (!xc[0] || !yc[0]) {
72525
- y.c = [y.e = 0];
72526
- return y;
72527
- }
72528
-
72529
- // Initialise exponent of result as x.e + y.e.
72530
- y.e = i + j;
72531
-
72532
- // If array xc has fewer digits than yc, swap xc and yc, and lengths.
72533
- if (a < b) {
72534
- c = xc;
72535
- xc = yc;
72536
- yc = c;
72537
- j = a;
72538
- a = b;
72539
- b = j;
72540
- }
72541
-
72542
- // Initialise coefficient array of result with zeros.
72543
- for (c = new Array(j = a + b); j--;) c[j] = 0;
72544
-
72545
- // Multiply.
72546
-
72547
- // i is initially xc.length.
72548
- for (i = b; i--;) {
72549
- b = 0;
72550
-
72551
- // a is yc.length.
72552
- for (j = a + i; j > i;) {
72553
- // Current sum of products at this digit position, plus carry.
72554
- b = c[j] + yc[i] * xc[j - i - 1] + b;
72555
- c[j--] = b % 10;
72556
-
72557
- // carry
72558
- b = b / 10 | 0;
72559
- }
72560
- c[j] = b;
72561
- }
72562
-
72563
- // Increment result exponent if there is a final carry, otherwise remove leading zero.
72564
- if (b) ++y.e;else c.shift();
72565
-
72566
- // Remove trailing zeros.
72567
- for (i = c.length; !c[--i];) c.pop();
72568
- y.c = c;
72569
- return y;
72570
- };
72571
-
72572
- /*
72573
- * Return a string representing the value of this Big in exponential notation rounded to dp fixed
72574
- * decimal places using rounding mode rm, or Big.RM if rm is not specified.
72575
- *
72576
- * dp? {number} Decimal places: integer, 0 to MAX_DP inclusive.
72577
- * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
72578
- */
72579
- P.toExponential = function (dp, rm) {
72580
- var x = this,
72581
- n = x.c[0];
72582
- if (dp !== UNDEFINED) {
72583
- if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {
72584
- throw Error(INVALID_DP);
72585
- }
72586
- x = round(new x.constructor(x), ++dp, rm);
72587
- for (; x.c.length < dp;) x.c.push(0);
72588
- }
72589
- return stringify(x, true, !!n);
72590
- };
72591
-
72592
- /*
72593
- * Return a string representing the value of this Big in normal notation rounded to dp fixed
72594
- * decimal places using rounding mode rm, or Big.RM if rm is not specified.
72595
- *
72596
- * dp? {number} Decimal places: integer, 0 to MAX_DP inclusive.
72597
- * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
72598
- *
72599
- * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.
72600
- * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.
72601
- */
72602
- P.toFixed = function (dp, rm) {
72603
- var x = this,
72604
- n = x.c[0];
72605
- if (dp !== UNDEFINED) {
72606
- if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {
72607
- throw Error(INVALID_DP);
72608
- }
72609
- x = round(new x.constructor(x), dp + x.e + 1, rm);
72610
-
72611
- // x.e may have changed if the value is rounded up.
72612
- for (dp = dp + x.e + 1; x.c.length < dp;) x.c.push(0);
72613
- }
72614
- return stringify(x, false, !!n);
72615
- };
72616
-
72617
- /*
72618
- * Return a string representing the value of this Big.
72619
- * Return exponential notation if this Big has a positive exponent equal to or greater than
72620
- * Big.PE, or a negative exponent equal to or less than Big.NE.
72621
- * Omit the sign for negative zero.
72622
- */
72623
- P.toJSON = P.toString = function () {
72624
- var x = this,
72625
- Big = x.constructor;
72626
- return stringify(x, x.e <= Big.NE || x.e >= Big.PE, !!x.c[0]);
72627
- };
72628
- if (typeof Symbol !== "undefined") {
72629
- P[Symbol.for('nodejs.util.inspect.custom')] = P.toJSON;
72630
- }
72631
-
72632
- /*
72633
- * Return the value of this Big as a primitive number.
72634
- */
72635
- P.toNumber = function () {
72636
- var n = +stringify(this, true, true);
72637
- if (this.constructor.strict === true && !this.eq(n.toString())) {
72638
- throw Error(NAME + 'Imprecise conversion');
72639
- }
72640
- return n;
72641
- };
72642
-
72643
- /*
72644
- * Return a string representing the value of this Big rounded to sd significant digits using
72645
- * rounding mode rm, or Big.RM if rm is not specified.
72646
- * Use exponential notation if sd is less than the number of digits necessary to represent
72647
- * the integer part of the value in normal notation.
72648
- *
72649
- * sd {number} Significant digits: integer, 1 to MAX_DP inclusive.
72650
- * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
72651
- */
72652
- P.toPrecision = function (sd, rm) {
72653
- var x = this,
72654
- Big = x.constructor,
72655
- n = x.c[0];
72656
- if (sd !== UNDEFINED) {
72657
- if (sd !== ~~sd || sd < 1 || sd > MAX_DP) {
72658
- throw Error(INVALID + 'precision');
72659
- }
72660
- x = round(new Big(x), sd, rm);
72661
- for (; x.c.length < sd;) x.c.push(0);
72662
- }
72663
- return stringify(x, sd <= x.e || x.e <= Big.NE || x.e >= Big.PE, !!n);
72664
- };
72665
-
72666
- /*
72667
- * Return a string representing the value of this Big.
72668
- * Return exponential notation if this Big has a positive exponent equal to or greater than
72669
- * Big.PE, or a negative exponent equal to or less than Big.NE.
72670
- * Include the sign for negative zero.
72671
- */
72672
- P.valueOf = function () {
72673
- var x = this,
72674
- Big = x.constructor;
72675
- if (Big.strict === true) {
72676
- throw Error(NAME + 'valueOf disallowed');
72677
- }
72678
- return stringify(x, x.e <= Big.NE || x.e >= Big.PE, true);
72679
- };
72680
-
72681
- // Export
72682
-
72683
- var Big = _Big_();
72684
-
72685
71655
  var FN_REF = '__fn';
72686
71656
  var DEFAULT_PRIORITY$4 = 1000;
72687
71657
  var slice = Array.prototype.slice;