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5BlH,KAAKC,YACN,EAEAD,KAAKiH,KAAKlH,OAEX,CACA,EA/hBA","sources":["webpack://gravitywp-advanced-number-field/./node_modules/decimal.js-light/decimal.js","webpack://gravitywp-advanced-number-field/webpack/bootstrap","webpack://gravitywp-advanced-number-field/webpack/runtime/compat get default export","webpack://gravitywp-advanced-number-field/webpack/runtime/define property getters","webpack://gravitywp-advanced-number-field/webpack/runtime/hasOwnProperty shorthand","webpack://gravitywp-advanced-number-field/./src/js/scripts.js"],"sourcesContent":["/*! decimal.js-light v2.5.1 https://github.com/MikeMcl/decimal.js-light/LICENCE */\r\n;(function (globalScope) {\r\n 'use strict';\r\n\r\n\r\n /*\r\n * decimal.js-light v2.5.1\r\n * An arbitrary-precision Decimal type for JavaScript.\r\n * https://github.com/MikeMcl/decimal.js-light\r\n * Copyright (c) 2020 Michael Mclaughlin \r\n * MIT Expat Licence\r\n */\r\n\r\n\r\n // ----------------------------------- EDITABLE DEFAULTS ------------------------------------ //\r\n\r\n\r\n // The limit on the value of `precision`, and on the value of the first argument to\r\n // `toDecimalPlaces`, `toExponential`, `toFixed`, `toPrecision` and `toSignificantDigits`.\r\n var MAX_DIGITS = 1e9, // 0 to 1e9\r\n\r\n\r\n // The initial configuration properties of the Decimal constructor.\r\n Decimal = {\r\n\r\n // These values must be integers within the stated ranges (inclusive).\r\n // Most of these values can be changed during run-time using `Decimal.config`.\r\n\r\n // The maximum number of significant digits of the result of a calculation or base conversion.\r\n // E.g. `Decimal.config({ precision: 20 });`\r\n precision: 20, // 1 to MAX_DIGITS\r\n\r\n // The rounding mode used by default by `toInteger`, `toDecimalPlaces`, `toExponential`,\r\n // `toFixed`, `toPrecision` and `toSignificantDigits`.\r\n //\r\n // ROUND_UP 0 Away from zero.\r\n // ROUND_DOWN 1 Towards zero.\r\n // ROUND_CEIL 2 Towards +Infinity.\r\n // ROUND_FLOOR 3 Towards -Infinity.\r\n // ROUND_HALF_UP 4 Towards nearest neighbour. If equidistant, up.\r\n // ROUND_HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.\r\n // ROUND_HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.\r\n // ROUND_HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.\r\n // ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.\r\n //\r\n // E.g.\r\n // `Decimal.rounding = 4;`\r\n // `Decimal.rounding = Decimal.ROUND_HALF_UP;`\r\n rounding: 4, // 0 to 8\r\n\r\n // The exponent value at and beneath which `toString` returns exponential notation.\r\n // JavaScript numbers: -7\r\n toExpNeg: -7, // 0 to -MAX_E\r\n\r\n // The exponent value at and above which `toString` returns exponential notation.\r\n // JavaScript numbers: 21\r\n toExpPos: 21, // 0 to MAX_E\r\n\r\n // The natural logarithm of 10.\r\n // 115 digits\r\n LN10: '2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286'\r\n },\r\n\r\n\r\n // ----------------------------------- END OF EDITABLE DEFAULTS ------------------------------- //\r\n\r\n\r\n external = true,\r\n\r\n decimalError = '[DecimalError] ',\r\n invalidArgument = decimalError + 'Invalid argument: ',\r\n exponentOutOfRange = decimalError + 'Exponent out of range: ',\r\n\r\n mathfloor = Math.floor,\r\n mathpow = Math.pow,\r\n\r\n isDecimal = /^(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,\r\n\r\n ONE,\r\n BASE = 1e7,\r\n LOG_BASE = 7,\r\n MAX_SAFE_INTEGER = 9007199254740991,\r\n MAX_E = mathfloor(MAX_SAFE_INTEGER / LOG_BASE), // 1286742750677284\r\n\r\n // Decimal.prototype object\r\n P = {};\r\n\r\n\r\n // Decimal prototype methods\r\n\r\n\r\n /*\r\n * absoluteValue abs\r\n * comparedTo cmp\r\n * decimalPlaces dp\r\n * dividedBy div\r\n * dividedToIntegerBy idiv\r\n * equals eq\r\n * exponent\r\n * greaterThan gt\r\n * greaterThanOrEqualTo gte\r\n * isInteger isint\r\n * isNegative isneg\r\n * isPositive ispos\r\n * isZero\r\n * lessThan lt\r\n * lessThanOrEqualTo lte\r\n * logarithm log\r\n * minus sub\r\n * modulo mod\r\n * naturalExponential exp\r\n * naturalLogarithm ln\r\n * negated neg\r\n * plus add\r\n * precision sd\r\n * squareRoot sqrt\r\n * times mul\r\n * toDecimalPlaces todp\r\n * toExponential\r\n * toFixed\r\n * toInteger toint\r\n * toNumber\r\n * toPower pow\r\n * toPrecision\r\n * toSignificantDigits tosd\r\n * toString\r\n * valueOf val\r\n */\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the absolute value of this Decimal.\r\n *\r\n */\r\n P.absoluteValue = P.abs = function () {\r\n var x = new this.constructor(this);\r\n if (x.s) x.s = 1;\r\n return x;\r\n };\r\n\r\n\r\n /*\r\n * Return\r\n * 1 if the value of this Decimal is greater than the value of `y`,\r\n * -1 if the value of this Decimal is less than the value of `y`,\r\n * 0 if they have the same value\r\n *\r\n */\r\n P.comparedTo = P.cmp = function (y) {\r\n var i, j, xdL, ydL,\r\n x = this;\r\n\r\n y = new x.constructor(y);\r\n\r\n // Signs differ?\r\n if (x.s !== y.s) return x.s || -y.s;\r\n\r\n // Compare exponents.\r\n if (x.e !== y.e) return x.e > y.e ^ x.s < 0 ? 1 : -1;\r\n\r\n xdL = x.d.length;\r\n ydL = y.d.length;\r\n\r\n // Compare digit by digit.\r\n for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) {\r\n if (x.d[i] !== y.d[i]) return x.d[i] > y.d[i] ^ x.s < 0 ? 1 : -1;\r\n }\r\n\r\n // Compare lengths.\r\n return xdL === ydL ? 0 : xdL > ydL ^ x.s < 0 ? 1 : -1;\r\n };\r\n\r\n\r\n /*\r\n * Return the number of decimal places of the value of this Decimal.\r\n *\r\n */\r\n P.decimalPlaces = P.dp = function () {\r\n var x = this,\r\n w = x.d.length - 1,\r\n dp = (w - x.e) * LOG_BASE;\r\n\r\n // Subtract the number of trailing zeros of the last word.\r\n w = x.d[w];\r\n if (w) for (; w % 10 == 0; w /= 10) dp--;\r\n\r\n return dp < 0 ? 0 : dp;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal divided by `y`, truncated to\r\n * `precision` significant digits.\r\n *\r\n */\r\n P.dividedBy = P.div = function (y) {\r\n return divide(this, new this.constructor(y));\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the integer part of dividing the value of this Decimal\r\n * by the value of `y`, truncated to `precision` significant digits.\r\n *\r\n */\r\n P.dividedToIntegerBy = P.idiv = function (y) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n return round(divide(x, new Ctor(y), 0, 1), Ctor.precision);\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is equal to the value of `y`, otherwise return false.\r\n *\r\n */\r\n P.equals = P.eq = function (y) {\r\n return !this.cmp(y);\r\n };\r\n\r\n\r\n /*\r\n * Return the (base 10) exponent value of this Decimal (this.e is the base 10000000 exponent).\r\n *\r\n */\r\n P.exponent = function () {\r\n return getBase10Exponent(this);\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is greater than the value of `y`, otherwise return\r\n * false.\r\n *\r\n */\r\n P.greaterThan = P.gt = function (y) {\r\n return this.cmp(y) > 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is greater than or equal to the value of `y`,\r\n * otherwise return false.\r\n *\r\n */\r\n P.greaterThanOrEqualTo = P.gte = function (y) {\r\n return this.cmp(y) >= 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is an integer, otherwise return false.\r\n *\r\n */\r\n P.isInteger = P.isint = function () {\r\n return this.e > this.d.length - 2;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is negative, otherwise return false.\r\n *\r\n */\r\n P.isNegative = P.isneg = function () {\r\n return this.s < 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is positive, otherwise return false.\r\n *\r\n */\r\n P.isPositive = P.ispos = function () {\r\n return this.s > 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is 0, otherwise return false.\r\n *\r\n */\r\n P.isZero = function () {\r\n return this.s === 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is less than `y`, otherwise return false.\r\n *\r\n */\r\n P.lessThan = P.lt = function (y) {\r\n return this.cmp(y) < 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this Decimal is less than or equal to `y`, otherwise return false.\r\n *\r\n */\r\n P.lessThanOrEqualTo = P.lte = function (y) {\r\n return this.cmp(y) < 1;\r\n };\r\n\r\n\r\n /*\r\n * Return the logarithm of the value of this Decimal to the specified base, truncated to\r\n * `precision` significant digits.\r\n *\r\n * If no base is specified, return log[10](x).\r\n *\r\n * log[base](x) = ln(x) / ln(base)\r\n *\r\n * The maximum error of the result is 1 ulp (unit in the last place).\r\n *\r\n * [base] {number|string|Decimal} The base of the logarithm.\r\n *\r\n */\r\n P.logarithm = P.log = function (base) {\r\n var r,\r\n x = this,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision,\r\n wpr = pr + 5;\r\n\r\n // Default base is 10.\r\n if (base === void 0) {\r\n base = new Ctor(10);\r\n } else {\r\n base = new Ctor(base);\r\n\r\n // log[-b](x) = NaN\r\n // log[0](x) = NaN\r\n // log[1](x) = NaN\r\n if (base.s < 1 || base.eq(ONE)) throw Error(decimalError + 'NaN');\r\n }\r\n\r\n // log[b](-x) = NaN\r\n // log[b](0) = -Infinity\r\n if (x.s < 1) throw Error(decimalError + (x.s ? 'NaN' : '-Infinity'));\r\n\r\n // log[b](1) = 0\r\n if (x.eq(ONE)) return new Ctor(0);\r\n\r\n external = false;\r\n r = divide(ln(x, wpr), ln(base, wpr), wpr);\r\n external = true;\r\n\r\n return round(r, pr);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal minus `y`, truncated to\r\n * `precision` significant digits.\r\n *\r\n */\r\n P.minus = P.sub = function (y) {\r\n var x = this;\r\n y = new x.constructor(y);\r\n return x.s == y.s ? subtract(x, y) : add(x, (y.s = -y.s, y));\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal modulo `y`, truncated to\r\n * `precision` significant digits.\r\n *\r\n */\r\n P.modulo = P.mod = function (y) {\r\n var q,\r\n x = this,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision;\r\n\r\n y = new Ctor(y);\r\n\r\n // x % 0 = NaN\r\n if (!y.s) throw Error(decimalError + 'NaN');\r\n\r\n // Return x if x is 0.\r\n if (!x.s) return round(new Ctor(x), pr);\r\n\r\n // Prevent rounding of intermediate calculations.\r\n external = false;\r\n q = divide(x, y, 0, 1).times(y);\r\n external = true;\r\n\r\n return x.minus(q);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the natural exponential of the value of this Decimal,\r\n * i.e. the base e raised to the power the value of this Decimal, truncated to `precision`\r\n * significant digits.\r\n *\r\n */\r\n P.naturalExponential = P.exp = function () {\r\n return exp(this);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the natural logarithm of the value of this Decimal,\r\n * truncated to `precision` significant digits.\r\n *\r\n */\r\n P.naturalLogarithm = P.ln = function () {\r\n return ln(this);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal negated, i.e. as if multiplied by\r\n * -1.\r\n *\r\n */\r\n P.negated = P.neg = function () {\r\n var x = new this.constructor(this);\r\n x.s = -x.s || 0;\r\n return x;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal plus `y`, truncated to\r\n * `precision` significant digits.\r\n *\r\n */\r\n P.plus = P.add = function (y) {\r\n var x = this;\r\n y = new x.constructor(y);\r\n return x.s == y.s ? add(x, y) : subtract(x, (y.s = -y.s, y));\r\n };\r\n\r\n\r\n /*\r\n * Return the number of significant digits of the value of this Decimal.\r\n *\r\n * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0.\r\n *\r\n */\r\n P.precision = P.sd = function (z) {\r\n var e, sd, w,\r\n x = this;\r\n\r\n if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) throw Error(invalidArgument + z);\r\n\r\n e = getBase10Exponent(x) + 1;\r\n w = x.d.length - 1;\r\n sd = w * LOG_BASE + 1;\r\n w = x.d[w];\r\n\r\n // If non-zero...\r\n if (w) {\r\n\r\n // Subtract the number of trailing zeros of the last word.\r\n for (; w % 10 == 0; w /= 10) sd--;\r\n\r\n // Add the number of digits of the first word.\r\n for (w = x.d[0]; w >= 10; w /= 10) sd++;\r\n }\r\n\r\n return z && e > sd ? e : sd;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the square root of this Decimal, truncated to `precision`\r\n * significant digits.\r\n *\r\n */\r\n P.squareRoot = P.sqrt = function () {\r\n var e, n, pr, r, s, t, wpr,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n // Negative or zero?\r\n if (x.s < 1) {\r\n if (!x.s) return new Ctor(0);\r\n\r\n // sqrt(-x) = NaN\r\n throw Error(decimalError + 'NaN');\r\n }\r\n\r\n e = getBase10Exponent(x);\r\n external = false;\r\n\r\n // Initial estimate.\r\n s = Math.sqrt(+x);\r\n\r\n // Math.sqrt underflow/overflow?\r\n // Pass x to Math.sqrt as integer, then adjust the exponent of the result.\r\n if (s == 0 || s == 1 / 0) {\r\n n = digitsToString(x.d);\r\n if ((n.length + e) % 2 == 0) n += '0';\r\n s = Math.sqrt(n);\r\n e = mathfloor((e + 1) / 2) - (e < 0 || e % 2);\r\n\r\n if (s == 1 / 0) {\r\n n = '5e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new Ctor(n);\r\n } else {\r\n r = new Ctor(s.toString());\r\n }\r\n\r\n pr = Ctor.precision;\r\n s = wpr = pr + 3;\r\n\r\n // Newton-Raphson iteration.\r\n for (;;) {\r\n t = r;\r\n r = t.plus(divide(x, t, wpr + 2)).times(0.5);\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === (n = digitsToString(r.d)).slice(0, wpr)) {\r\n n = n.slice(wpr - 3, wpr + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or\r\n // 4999, i.e. approaching a rounding boundary, continue the iteration.\r\n if (s == wpr && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the exact result as the\r\n // nines may infinitely repeat.\r\n round(t, pr + 1, 0);\r\n\r\n if (t.times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n } else if (n != '9999') {\r\n break;\r\n }\r\n\r\n wpr += 4;\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return round(r, pr);\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal times `y`, truncated to\r\n * `precision` significant digits.\r\n *\r\n */\r\n P.times = P.mul = function (y) {\r\n var carry, e, i, k, r, rL, t, xdL, ydL,\r\n x = this,\r\n Ctor = x.constructor,\r\n xd = x.d,\r\n yd = (y = new Ctor(y)).d;\r\n\r\n // Return 0 if either is 0.\r\n if (!x.s || !y.s) return new Ctor(0);\r\n\r\n y.s *= x.s;\r\n e = x.e + y.e;\r\n xdL = xd.length;\r\n ydL = yd.length;\r\n\r\n // Ensure xd points to the longer array.\r\n if (xdL < ydL) {\r\n r = xd;\r\n xd = yd;\r\n yd = r;\r\n rL = xdL;\r\n xdL = ydL;\r\n ydL = rL;\r\n }\r\n\r\n // Initialise the result array with zeros.\r\n r = [];\r\n rL = xdL + ydL;\r\n for (i = rL; i--;) r.push(0);\r\n\r\n // Multiply!\r\n for (i = ydL; --i >= 0;) {\r\n carry = 0;\r\n for (k = xdL + i; k > i;) {\r\n t = r[k] + yd[i] * xd[k - i - 1] + carry;\r\n r[k--] = t % BASE | 0;\r\n carry = t / BASE | 0;\r\n }\r\n\r\n r[k] = (r[k] + carry) % BASE | 0;\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; !r[--rL];) r.pop();\r\n\r\n if (carry) ++e;\r\n else r.shift();\r\n\r\n y.d = r;\r\n y.e = e;\r\n\r\n return external ? round(y, Ctor.precision) : y;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `dp`\r\n * decimal places using rounding mode `rm` or `rounding` if `rm` is omitted.\r\n *\r\n * If `dp` is omitted, return a new Decimal whose value is the value of this Decimal.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\n P.toDecimalPlaces = P.todp = function (dp, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n x = new Ctor(x);\r\n if (dp === void 0) return x;\r\n\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n return round(x, dp + getBase10Exponent(x) + 1, rm);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Decimal in exponential notation rounded to\r\n * `dp` fixed decimal places using rounding mode `rounding`.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\n P.toExponential = function (dp, rm) {\r\n var str,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (dp === void 0) {\r\n str = toString(x, true);\r\n } else {\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n x = round(new Ctor(x), dp + 1, rm);\r\n str = toString(x, true, dp + 1);\r\n }\r\n\r\n return str;\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Decimal in normal (fixed-point) notation to\r\n * `dp` fixed decimal places and rounded using rounding mode `rm` or `rounding` if `rm` is\r\n * omitted.\r\n *\r\n * As with JavaScript numbers, (-0).toFixed(0) is '0', but e.g. (-0.00001).toFixed(0) is '-0'.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.\r\n * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.\r\n * (-0).toFixed(3) is '0.000'.\r\n * (-0.5).toFixed(0) is '-0'.\r\n *\r\n */\r\n P.toFixed = function (dp, rm) {\r\n var str, y,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (dp === void 0) return toString(x);\r\n\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n y = round(new Ctor(x), dp + getBase10Exponent(x) + 1, rm);\r\n str = toString(y.abs(), false, dp + getBase10Exponent(y) + 1);\r\n\r\n // To determine whether to add the minus sign look at the value before it was rounded,\r\n // i.e. look at `x` rather than `y`.\r\n return x.isneg() && !x.isZero() ? '-' + str : str;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number using\r\n * rounding mode `rounding`.\r\n *\r\n */\r\n P.toInteger = P.toint = function () {\r\n var x = this,\r\n Ctor = x.constructor;\r\n return round(new Ctor(x), getBase10Exponent(x) + 1, Ctor.rounding);\r\n };\r\n\r\n\r\n /*\r\n * Return the value of this Decimal converted to a number primitive.\r\n *\r\n */\r\n P.toNumber = function () {\r\n return +this;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal raised to the power `y`,\r\n * truncated to `precision` significant digits.\r\n *\r\n * For non-integer or very large exponents pow(x, y) is calculated using\r\n *\r\n * x^y = exp(y*ln(x))\r\n *\r\n * The maximum error is 1 ulp (unit in last place).\r\n *\r\n * y {number|string|Decimal} The power to which to raise this Decimal.\r\n *\r\n */\r\n P.toPower = P.pow = function (y) {\r\n var e, k, pr, r, sign, yIsInt,\r\n x = this,\r\n Ctor = x.constructor,\r\n guard = 12,\r\n yn = +(y = new Ctor(y));\r\n\r\n // pow(x, 0) = 1\r\n if (!y.s) return new Ctor(ONE);\r\n\r\n x = new Ctor(x);\r\n\r\n // pow(0, y > 0) = 0\r\n // pow(0, y < 0) = Infinity\r\n if (!x.s) {\r\n if (y.s < 1) throw Error(decimalError + 'Infinity');\r\n return x;\r\n }\r\n\r\n // pow(1, y) = 1\r\n if (x.eq(ONE)) return x;\r\n\r\n pr = Ctor.precision;\r\n\r\n // pow(x, 1) = x\r\n if (y.eq(ONE)) return round(x, pr);\r\n\r\n e = y.e;\r\n k = y.d.length - 1;\r\n yIsInt = e >= k;\r\n sign = x.s;\r\n\r\n if (!yIsInt) {\r\n\r\n // pow(x < 0, y non-integer) = NaN\r\n if (sign < 0) throw Error(decimalError + 'NaN');\r\n\r\n // If y is a small integer use the 'exponentiation by squaring' algorithm.\r\n } else if ((k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) {\r\n r = new Ctor(ONE);\r\n\r\n // Max k of 9007199254740991 takes 53 loop iterations.\r\n // Maximum digits array length; leaves [28, 34] guard digits.\r\n e = Math.ceil(pr / LOG_BASE + 4);\r\n\r\n external = false;\r\n\r\n for (;;) {\r\n if (k % 2) {\r\n r = r.times(x);\r\n truncate(r.d, e);\r\n }\r\n\r\n k = mathfloor(k / 2);\r\n if (k === 0) break;\r\n\r\n x = x.times(x);\r\n truncate(x.d, e);\r\n }\r\n\r\n external = true;\r\n\r\n return y.s < 0 ? new Ctor(ONE).div(r) : round(r, pr);\r\n }\r\n\r\n // Result is negative if x is negative and the last digit of integer y is odd.\r\n sign = sign < 0 && y.d[Math.max(e, k)] & 1 ? -1 : 1;\r\n\r\n x.s = 1;\r\n external = false;\r\n r = y.times(ln(x, pr + guard));\r\n external = true;\r\n r = exp(r);\r\n r.s = sign;\r\n\r\n return r;\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Decimal rounded to `sd` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * Return exponential notation if `sd` is less than the number of digits necessary to represent\r\n * the integer part of the value in normal notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\n P.toPrecision = function (sd, rm) {\r\n var e, str,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (sd === void 0) {\r\n e = getBase10Exponent(x);\r\n str = toString(x, e <= Ctor.toExpNeg || e >= Ctor.toExpPos);\r\n } else {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n x = round(new Ctor(x), sd, rm);\r\n e = getBase10Exponent(x);\r\n str = toString(x, sd <= e || e <= Ctor.toExpNeg, sd);\r\n }\r\n\r\n return str;\r\n };\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `sd`\r\n * significant digits using rounding mode `rm`, or to `precision` and `rounding` respectively if\r\n * omitted.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\n P.toSignificantDigits = P.tosd = function (sd, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n if (sd === void 0) {\r\n sd = Ctor.precision;\r\n rm = Ctor.rounding;\r\n } else {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n }\r\n\r\n return round(new Ctor(x), sd, rm);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this Decimal.\r\n *\r\n * Return exponential notation if this Decimal has a positive exponent equal to or greater than\r\n * `toExpPos`, or a negative exponent equal to or less than `toExpNeg`.\r\n *\r\n */\r\n P.toString = P.valueOf = P.val = P.toJSON = function () {\r\n var x = this,\r\n e = getBase10Exponent(x),\r\n Ctor = x.constructor;\r\n\r\n return toString(x, e <= Ctor.toExpNeg || e >= Ctor.toExpPos);\r\n };\r\n\r\n\r\n // Helper functions for Decimal.prototype (P) and/or Decimal methods, and their callers.\r\n\r\n\r\n /*\r\n * add P.minus, P.plus\r\n * checkInt32 P.todp, P.toExponential, P.toFixed, P.toPrecision, P.tosd\r\n * digitsToString P.log, P.sqrt, P.pow, toString, exp, ln\r\n * divide P.div, P.idiv, P.log, P.mod, P.sqrt, exp, ln\r\n * exp P.exp, P.pow\r\n * getBase10Exponent P.exponent, P.sd, P.toint, P.sqrt, P.todp, P.toFixed, P.toPrecision,\r\n * P.toString, divide, round, toString, exp, ln\r\n * getLn10 P.log, ln\r\n * getZeroString digitsToString, toString\r\n * ln P.log, P.ln, P.pow, exp\r\n * parseDecimal Decimal\r\n * round P.abs, P.idiv, P.log, P.minus, P.mod, P.neg, P.plus, P.toint, P.sqrt,\r\n * P.times, P.todp, P.toExponential, P.toFixed, P.pow, P.toPrecision, P.tosd,\r\n * divide, getLn10, exp, ln\r\n * subtract P.minus, P.plus\r\n * toString P.toExponential, P.toFixed, P.toPrecision, P.toString, P.valueOf\r\n * truncate P.pow\r\n *\r\n * Throws: P.log, P.mod, P.sd, P.sqrt, P.pow, checkInt32, divide, round,\r\n * getLn10, exp, ln, parseDecimal, Decimal, config\r\n */\r\n\r\n\r\n function add(x, y) {\r\n var carry, d, e, i, k, len, xd, yd,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision;\r\n\r\n // If either is zero...\r\n if (!x.s || !y.s) {\r\n\r\n // Return x if y is zero.\r\n // Return y if y is non-zero.\r\n if (!y.s) y = new Ctor(x);\r\n return external ? round(y, pr) : y;\r\n }\r\n\r\n xd = x.d;\r\n yd = y.d;\r\n\r\n // x and y are finite, non-zero numbers with the same sign.\r\n\r\n k = x.e;\r\n e = y.e;\r\n xd = xd.slice();\r\n i = k - e;\r\n\r\n // If base 1e7 exponents differ...\r\n if (i) {\r\n if (i < 0) {\r\n d = xd;\r\n i = -i;\r\n len = yd.length;\r\n } else {\r\n d = yd;\r\n e = k;\r\n len = xd.length;\r\n }\r\n\r\n // Limit number of zeros prepended to max(ceil(pr / LOG_BASE), len) + 1.\r\n k = Math.ceil(pr / LOG_BASE);\r\n len = k > len ? k + 1 : len + 1;\r\n\r\n if (i > len) {\r\n i = len;\r\n d.length = 1;\r\n }\r\n\r\n // Prepend zeros to equalise exponents. Note: Faster to use reverse then do unshifts.\r\n d.reverse();\r\n for (; i--;) d.push(0);\r\n d.reverse();\r\n }\r\n\r\n len = xd.length;\r\n i = yd.length;\r\n\r\n // If yd is longer than xd, swap xd and yd so xd points to the longer array.\r\n if (len - i < 0) {\r\n i = len;\r\n d = yd;\r\n yd = xd;\r\n xd = d;\r\n }\r\n\r\n // Only start adding at yd.length - 1 as the further digits of xd can be left as they are.\r\n for (carry = 0; i;) {\r\n carry = (xd[--i] = xd[i] + yd[i] + carry) / BASE | 0;\r\n xd[i] %= BASE;\r\n }\r\n\r\n if (carry) {\r\n xd.unshift(carry);\r\n ++e;\r\n }\r\n\r\n // Remove trailing zeros.\r\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\r\n for (len = xd.length; xd[--len] == 0;) xd.pop();\r\n\r\n y.d = xd;\r\n y.e = e;\r\n\r\n return external ? round(y, pr) : y;\r\n }\r\n\r\n\r\n function checkInt32(i, min, max) {\r\n if (i !== ~~i || i < min || i > max) {\r\n throw Error(invalidArgument + i);\r\n }\r\n }\r\n\r\n\r\n function digitsToString(d) {\r\n var i, k, ws,\r\n indexOfLastWord = d.length - 1,\r\n str = '',\r\n w = d[0];\r\n\r\n if (indexOfLastWord > 0) {\r\n str += w;\r\n for (i = 1; i < indexOfLastWord; i++) {\r\n ws = d[i] + '';\r\n k = LOG_BASE - ws.length;\r\n if (k) str += getZeroString(k);\r\n str += ws;\r\n }\r\n\r\n w = d[i];\r\n ws = w + '';\r\n k = LOG_BASE - ws.length;\r\n if (k) str += getZeroString(k);\r\n } else if (w === 0) {\r\n return '0';\r\n }\r\n\r\n // Remove trailing zeros of last w.\r\n for (; w % 10 === 0;) w /= 10;\r\n\r\n return str + w;\r\n }\r\n\r\n\r\n var divide = (function () {\r\n\r\n // Assumes non-zero x and k, and hence non-zero result.\r\n function multiplyInteger(x, k) {\r\n var temp,\r\n carry = 0,\r\n i = x.length;\r\n\r\n for (x = x.slice(); i--;) {\r\n temp = x[i] * k + carry;\r\n x[i] = temp % BASE | 0;\r\n carry = temp / BASE | 0;\r\n }\r\n\r\n if (carry) x.unshift(carry);\r\n\r\n return x;\r\n }\r\n\r\n function compare(a, b, aL, bL) {\r\n var i, r;\r\n\r\n if (aL != bL) {\r\n r = aL > bL ? 1 : -1;\r\n } else {\r\n for (i = r = 0; i < aL; i++) {\r\n if (a[i] != b[i]) {\r\n r = a[i] > b[i] ? 1 : -1;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return r;\r\n }\r\n\r\n function subtract(a, b, aL) {\r\n var i = 0;\r\n\r\n // Subtract b from a.\r\n for (; aL--;) {\r\n a[aL] -= i;\r\n i = a[aL] < b[aL] ? 1 : 0;\r\n a[aL] = i * BASE + a[aL] - b[aL];\r\n }\r\n\r\n // Remove leading zeros.\r\n for (; !a[0] && a.length > 1;) a.shift();\r\n }\r\n\r\n return function (x, y, pr, dp) {\r\n var cmp, e, i, k, prod, prodL, q, qd, rem, remL, rem0, sd, t, xi, xL, yd0, yL, yz,\r\n Ctor = x.constructor,\r\n sign = x.s == y.s ? 1 : -1,\r\n xd = x.d,\r\n yd = y.d;\r\n\r\n // Either 0?\r\n if (!x.s) return new Ctor(x);\r\n if (!y.s) throw Error(decimalError + 'Division by zero');\r\n\r\n e = x.e - y.e;\r\n yL = yd.length;\r\n xL = xd.length;\r\n q = new Ctor(sign);\r\n qd = q.d = [];\r\n\r\n // Result exponent may be one less than e.\r\n for (i = 0; yd[i] == (xd[i] || 0); ) ++i;\r\n if (yd[i] > (xd[i] || 0)) --e;\r\n\r\n if (pr == null) {\r\n sd = pr = Ctor.precision;\r\n } else if (dp) {\r\n sd = pr + (getBase10Exponent(x) - getBase10Exponent(y)) + 1;\r\n } else {\r\n sd = pr;\r\n }\r\n\r\n if (sd < 0) return new Ctor(0);\r\n\r\n // Convert precision in number of base 10 digits to base 1e7 digits.\r\n sd = sd / LOG_BASE + 2 | 0;\r\n i = 0;\r\n\r\n // divisor < 1e7\r\n if (yL == 1) {\r\n k = 0;\r\n yd = yd[0];\r\n sd++;\r\n\r\n // k is the carry.\r\n for (; (i < xL || k) && sd--; i++) {\r\n t = k * BASE + (xd[i] || 0);\r\n qd[i] = t / yd | 0;\r\n k = t % yd | 0;\r\n }\r\n\r\n // divisor >= 1e7\r\n } else {\r\n\r\n // Normalise xd and yd so highest order digit of yd is >= BASE/2\r\n k = BASE / (yd[0] + 1) | 0;\r\n\r\n if (k > 1) {\r\n yd = multiplyInteger(yd, k);\r\n xd = multiplyInteger(xd, k);\r\n yL = yd.length;\r\n xL = xd.length;\r\n }\r\n\r\n xi = yL;\r\n rem = xd.slice(0, yL);\r\n remL = rem.length;\r\n\r\n // Add zeros to make remainder as long as divisor.\r\n for (; remL < yL;) rem[remL++] = 0;\r\n\r\n yz = yd.slice();\r\n yz.unshift(0);\r\n yd0 = yd[0];\r\n\r\n if (yd[1] >= BASE / 2) ++yd0;\r\n\r\n do {\r\n k = 0;\r\n\r\n // Compare divisor and remainder.\r\n cmp = compare(yd, rem, yL, remL);\r\n\r\n // If divisor < remainder.\r\n if (cmp < 0) {\r\n\r\n // Calculate trial digit, k.\r\n rem0 = rem[0];\r\n if (yL != remL) rem0 = rem0 * BASE + (rem[1] || 0);\r\n\r\n // k will be how many times the divisor goes into the current remainder.\r\n k = rem0 / yd0 | 0;\r\n\r\n // Algorithm:\r\n // 1. product = divisor * trial digit (k)\r\n // 2. if product > remainder: product -= divisor, k--\r\n // 3. remainder -= product\r\n // 4. if product was < remainder at 2:\r\n // 5. compare new remainder and divisor\r\n // 6. If remainder > divisor: remainder -= divisor, k++\r\n\r\n if (k > 1) {\r\n if (k >= BASE) k = BASE - 1;\r\n\r\n // product = divisor * trial digit.\r\n prod = multiplyInteger(yd, k);\r\n prodL = prod.length;\r\n remL = rem.length;\r\n\r\n // Compare product and remainder.\r\n cmp = compare(prod, rem, prodL, remL);\r\n\r\n // product > remainder.\r\n if (cmp == 1) {\r\n k--;\r\n\r\n // Subtract divisor from product.\r\n subtract(prod, yL < prodL ? yz : yd, prodL);\r\n }\r\n } else {\r\n\r\n // cmp is -1.\r\n // If k is 0, there is no need to compare yd and rem again below, so change cmp to 1\r\n // to avoid it. If k is 1 there is a need to compare yd and rem again below.\r\n if (k == 0) cmp = k = 1;\r\n prod = yd.slice();\r\n }\r\n\r\n prodL = prod.length;\r\n if (prodL < remL) prod.unshift(0);\r\n\r\n // Subtract product from remainder.\r\n subtract(rem, prod, remL);\r\n\r\n // If product was < previous remainder.\r\n if (cmp == -1) {\r\n remL = rem.length;\r\n\r\n // Compare divisor and new remainder.\r\n cmp = compare(yd, rem, yL, remL);\r\n\r\n // If divisor < new remainder, subtract divisor from remainder.\r\n if (cmp < 1) {\r\n k++;\r\n\r\n // Subtract divisor from remainder.\r\n subtract(rem, yL < remL ? yz : yd, remL);\r\n }\r\n }\r\n\r\n remL = rem.length;\r\n } else if (cmp === 0) {\r\n k++;\r\n rem = [0];\r\n } // if cmp === 1, k will be 0\r\n\r\n // Add the next digit, k, to the result array.\r\n qd[i++] = k;\r\n\r\n // Update the remainder.\r\n if (cmp && rem[0]) {\r\n rem[remL++] = xd[xi] || 0;\r\n } else {\r\n rem = [xd[xi]];\r\n remL = 1;\r\n }\r\n\r\n } while ((xi++ < xL || rem[0] !== void 0) && sd--);\r\n }\r\n\r\n // Leading zero?\r\n if (!qd[0]) qd.shift();\r\n\r\n q.e = e;\r\n\r\n return round(q, dp ? pr + getBase10Exponent(q) + 1 : pr);\r\n };\r\n })();\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the natural exponential of `x` truncated to `sd`\r\n * significant digits.\r\n *\r\n * Taylor/Maclaurin series.\r\n *\r\n * exp(x) = x^0/0! + x^1/1! + x^2/2! + x^3/3! + ...\r\n *\r\n * Argument reduction:\r\n * Repeat x = x / 32, k += 5, until |x| < 0.1\r\n * exp(x) = exp(x / 2^k)^(2^k)\r\n *\r\n * Previously, the argument was initially reduced by\r\n * exp(x) = exp(r) * 10^k where r = x - k * ln10, k = floor(x / ln10)\r\n * to first put r in the range [0, ln10], before dividing by 32 until |x| < 0.1, but this was\r\n * found to be slower than just dividing repeatedly by 32 as above.\r\n *\r\n * (Math object integer min/max: Math.exp(709) = 8.2e+307, Math.exp(-745) = 5e-324)\r\n *\r\n * exp(x) is non-terminating for any finite, non-zero x.\r\n *\r\n */\r\n function exp(x, sd) {\r\n var denominator, guard, pow, sum, t, wpr,\r\n i = 0,\r\n k = 0,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision;\r\n\r\n if (getBase10Exponent(x) > 16) throw Error(exponentOutOfRange + getBase10Exponent(x));\r\n\r\n // exp(0) = 1\r\n if (!x.s) return new Ctor(ONE);\r\n\r\n if (sd == null) {\r\n external = false;\r\n wpr = pr;\r\n } else {\r\n wpr = sd;\r\n }\r\n\r\n t = new Ctor(0.03125);\r\n\r\n while (x.abs().gte(0.1)) {\r\n x = x.times(t); // x = x / 2^5\r\n k += 5;\r\n }\r\n\r\n // Estimate the precision increase necessary to ensure the first 4 rounding digits are correct.\r\n guard = Math.log(mathpow(2, k)) / Math.LN10 * 2 + 5 | 0;\r\n wpr += guard;\r\n denominator = pow = sum = new Ctor(ONE);\r\n Ctor.precision = wpr;\r\n\r\n for (;;) {\r\n pow = round(pow.times(x), wpr);\r\n denominator = denominator.times(++i);\r\n t = sum.plus(divide(pow, denominator, wpr));\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n while (k--) sum = round(sum.times(sum), wpr);\r\n Ctor.precision = pr;\r\n return sd == null ? (external = true, round(sum, pr)) : sum;\r\n }\r\n\r\n sum = t;\r\n }\r\n }\r\n\r\n\r\n // Calculate the base 10 exponent from the base 1e7 exponent.\r\n function getBase10Exponent(x) {\r\n var e = x.e * LOG_BASE,\r\n w = x.d[0];\r\n\r\n // Add the number of digits of the first word of the digits array.\r\n for (; w >= 10; w /= 10) e++;\r\n return e;\r\n }\r\n\r\n\r\n function getLn10(Ctor, sd, pr) {\r\n\r\n if (sd > Ctor.LN10.sd()) {\r\n\r\n\r\n // Reset global state in case the exception is caught.\r\n external = true;\r\n if (pr) Ctor.precision = pr;\r\n throw Error(decimalError + 'LN10 precision limit exceeded');\r\n }\r\n\r\n return round(new Ctor(Ctor.LN10), sd);\r\n }\r\n\r\n\r\n function getZeroString(k) {\r\n var zs = '';\r\n for (; k--;) zs += '0';\r\n return zs;\r\n }\r\n\r\n\r\n /*\r\n * Return a new Decimal whose value is the natural logarithm of `x` truncated to `sd` significant\r\n * digits.\r\n *\r\n * ln(n) is non-terminating (n != 1)\r\n *\r\n */\r\n function ln(y, sd) {\r\n var c, c0, denominator, e, numerator, sum, t, wpr, x2,\r\n n = 1,\r\n guard = 10,\r\n x = y,\r\n xd = x.d,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision;\r\n\r\n // ln(-x) = NaN\r\n // ln(0) = -Infinity\r\n if (x.s < 1) throw Error(decimalError + (x.s ? 'NaN' : '-Infinity'));\r\n\r\n // ln(1) = 0\r\n if (x.eq(ONE)) return new Ctor(0);\r\n\r\n if (sd == null) {\r\n external = false;\r\n wpr = pr;\r\n } else {\r\n wpr = sd;\r\n }\r\n\r\n if (x.eq(10)) {\r\n if (sd == null) external = true;\r\n return getLn10(Ctor, wpr);\r\n }\r\n\r\n wpr += guard;\r\n Ctor.precision = wpr;\r\n c = digitsToString(xd);\r\n c0 = c.charAt(0);\r\n e = getBase10Exponent(x);\r\n\r\n if (Math.abs(e) < 1.5e15) {\r\n\r\n // Argument reduction.\r\n // The series converges faster the closer the argument is to 1, so using\r\n // ln(a^b) = b * ln(a), ln(a) = ln(a^b) / b\r\n // multiply the argument by itself until the leading digits of the significand are 7, 8, 9,\r\n // 10, 11, 12 or 13, recording the number of multiplications so the sum of the series can\r\n // later be divided by this number, then separate out the power of 10 using\r\n // ln(a*10^b) = ln(a) + b*ln(10).\r\n\r\n // max n is 21 (gives 0.9, 1.0 or 1.1) (9e15 / 21 = 4.2e14).\r\n //while (c0 < 9 && c0 != 1 || c0 == 1 && c.charAt(1) > 1) {\r\n // max n is 6 (gives 0.7 - 1.3)\r\n while (c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3) {\r\n x = x.times(y);\r\n c = digitsToString(x.d);\r\n c0 = c.charAt(0);\r\n n++;\r\n }\r\n\r\n e = getBase10Exponent(x);\r\n\r\n if (c0 > 1) {\r\n x = new Ctor('0.' + c);\r\n e++;\r\n } else {\r\n x = new Ctor(c0 + '.' + c.slice(1));\r\n }\r\n } else {\r\n\r\n // The argument reduction method above may result in overflow if the argument y is a massive\r\n // number with exponent >= 1500000000000000 (9e15 / 6 = 1.5e15), so instead recall this\r\n // function using ln(x*10^e) = ln(x) + e*ln(10).\r\n t = getLn10(Ctor, wpr + 2, pr).times(e + '');\r\n x = ln(new Ctor(c0 + '.' + c.slice(1)), wpr - guard).plus(t);\r\n\r\n Ctor.precision = pr;\r\n return sd == null ? (external = true, round(x, pr)) : x;\r\n }\r\n\r\n // x is reduced to a value near 1.\r\n\r\n // Taylor series.\r\n // ln(y) = ln((1 + x)/(1 - x)) = 2(x + x^3/3 + x^5/5 + x^7/7 + ...)\r\n // where x = (y - 1)/(y + 1) (|x| < 1)\r\n sum = numerator = x = divide(x.minus(ONE), x.plus(ONE), wpr);\r\n x2 = round(x.times(x), wpr);\r\n denominator = 3;\r\n\r\n for (;;) {\r\n numerator = round(numerator.times(x2), wpr);\r\n t = sum.plus(divide(numerator, new Ctor(denominator), wpr));\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n sum = sum.times(2);\r\n\r\n // Reverse the argument reduction.\r\n if (e !== 0) sum = sum.plus(getLn10(Ctor, wpr + 2, pr).times(e + ''));\r\n sum = divide(sum, new Ctor(n), wpr);\r\n\r\n Ctor.precision = pr;\r\n return sd == null ? (external = true, round(sum, pr)) : sum;\r\n }\r\n\r\n sum = t;\r\n denominator += 2;\r\n }\r\n }\r\n\r\n\r\n /*\r\n * Parse the value of a new Decimal `x` from string `str`.\r\n */\r\n function parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48;) ++i;\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48;) --len;\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n e = e - i - 1;\r\n x.e = mathfloor(e / LOG_BASE);\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external && (x.e > MAX_E || x.e < -MAX_E)) throw Error(exponentOutOfRange + e);\r\n } else {\r\n\r\n // Zero.\r\n x.s = 0;\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n }\r\n\r\n\r\n /*\r\n * Round `x` to `sd` significant digits, using rounding mode `rm` if present (truncate otherwise).\r\n */\r\n function round(x, sd, rm) {\r\n var i, j, k, n, rd, doRound, w, xdi,\r\n xd = x.d;\r\n\r\n // rd: the rounding digit, i.e. the digit after the digit that may be rounded up.\r\n // w: the word of xd which contains the rounding digit, a base 1e7 number.\r\n // xdi: the index of w within xd.\r\n // n: the number of digits of w.\r\n // i: what would be the index of rd within w if all the numbers were 7 digits long (i.e. if\r\n // they had leading zeros)\r\n // j: if > 0, the actual index of rd within w (if < 0, rd is a leading zero).\r\n\r\n // Get the length of the first word of the digits array xd.\r\n for (n = 1, k = xd[0]; k >= 10; k /= 10) n++;\r\n i = sd - n;\r\n\r\n // Is the rounding digit in the first word of xd?\r\n if (i < 0) {\r\n i += LOG_BASE;\r\n j = sd;\r\n w = xd[xdi = 0];\r\n } else {\r\n xdi = Math.ceil((i + 1) / LOG_BASE);\r\n k = xd.length;\r\n if (xdi >= k) return x;\r\n w = k = xd[xdi];\r\n\r\n // Get the number of digits of w.\r\n for (n = 1; k >= 10; k /= 10) n++;\r\n\r\n // Get the index of rd within w.\r\n i %= LOG_BASE;\r\n\r\n // Get the index of rd within w, adjusted for leading zeros.\r\n // The number of leading zeros of w is given by LOG_BASE - n.\r\n j = i - LOG_BASE + n;\r\n }\r\n\r\n if (rm !== void 0) {\r\n k = mathpow(10, n - j - 1);\r\n\r\n // Get the rounding digit at index j of w.\r\n rd = w / k % 10 | 0;\r\n\r\n // Are there any non-zero digits after the rounding digit?\r\n doRound = sd < 0 || xd[xdi + 1] !== void 0 || w % k;\r\n\r\n // The expression `w % mathpow(10, n - j - 1)` returns all the digits of w to the right of the\r\n // digit at (left-to-right) index j, e.g. if w is 908714 and j is 2, the expression will give\r\n // 714.\r\n\r\n doRound = rm < 4\r\n ? (rd || doRound) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r\n : rd > 5 || rd == 5 && (rm == 4 || doRound || rm == 6 &&\r\n\r\n // Check whether the digit to the left of the rounding digit is odd.\r\n ((i > 0 ? j > 0 ? w / mathpow(10, n - j) : 0 : xd[xdi - 1]) % 10) & 1 ||\r\n rm == (x.s < 0 ? 8 : 7));\r\n }\r\n\r\n if (sd < 1 || !xd[0]) {\r\n if (doRound) {\r\n k = getBase10Exponent(x);\r\n xd.length = 1;\r\n\r\n // Convert sd to decimal places.\r\n sd = sd - k - 1;\r\n\r\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\r\n xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE);\r\n x.e = mathfloor(-sd / LOG_BASE) || 0;\r\n } else {\r\n xd.length = 1;\r\n\r\n // Zero.\r\n xd[0] = x.e = x.s = 0;\r\n }\r\n\r\n return x;\r\n }\r\n\r\n // Remove excess digits.\r\n if (i == 0) {\r\n xd.length = xdi;\r\n k = 1;\r\n xdi--;\r\n } else {\r\n xd.length = xdi + 1;\r\n k = mathpow(10, LOG_BASE - i);\r\n\r\n // E.g. 56700 becomes 56000 if 7 is the rounding digit.\r\n // j > 0 means i > number of leading zeros of w.\r\n xd[xdi] = j > 0 ? (w / mathpow(10, n - j) % mathpow(10, j) | 0) * k : 0;\r\n }\r\n\r\n if (doRound) {\r\n for (;;) {\r\n\r\n // Is the digit to be rounded up in the first word of xd?\r\n if (xdi == 0) {\r\n if ((xd[0] += k) == BASE) {\r\n xd[0] = 1;\r\n ++x.e;\r\n }\r\n\r\n break;\r\n } else {\r\n xd[xdi] += k;\r\n if (xd[xdi] != BASE) break;\r\n xd[xdi--] = 0;\r\n k = 1;\r\n }\r\n }\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (i = xd.length; xd[--i] === 0;) xd.pop();\r\n\r\n if (external && (x.e > MAX_E || x.e < -MAX_E)) {\r\n throw Error(exponentOutOfRange + getBase10Exponent(x));\r\n }\r\n\r\n return x;\r\n }\r\n\r\n\r\n function subtract(x, y) {\r\n var d, e, i, j, k, len, xd, xe, xLTy, yd,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision;\r\n\r\n // Return y negated if x is zero.\r\n // Return x if y is zero and x is non-zero.\r\n if (!x.s || !y.s) {\r\n if (y.s) y.s = -y.s;\r\n else y = new Ctor(x);\r\n return external ? round(y, pr) : y;\r\n }\r\n\r\n xd = x.d;\r\n yd = y.d;\r\n\r\n // x and y are non-zero numbers with the same sign.\r\n\r\n e = y.e;\r\n xe = x.e;\r\n xd = xd.slice();\r\n k = xe - e;\r\n\r\n // If exponents differ...\r\n if (k) {\r\n xLTy = k < 0;\r\n\r\n if (xLTy) {\r\n d = xd;\r\n k = -k;\r\n len = yd.length;\r\n } else {\r\n d = yd;\r\n e = xe;\r\n len = xd.length;\r\n }\r\n\r\n // Numbers with massively different exponents would result in a very high number of zeros\r\n // needing to be prepended, but this can be avoided while still ensuring correct rounding by\r\n // limiting the number of zeros to `Math.ceil(pr / LOG_BASE) + 2`.\r\n i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2;\r\n\r\n if (k > i) {\r\n k = i;\r\n d.length = 1;\r\n }\r\n\r\n // Prepend zeros to equalise exponents.\r\n d.reverse();\r\n for (i = k; i--;) d.push(0);\r\n d.reverse();\r\n\r\n // Base 1e7 exponents equal.\r\n } else {\r\n\r\n // Check digits to determine which is the bigger number.\r\n\r\n i = xd.length;\r\n len = yd.length;\r\n xLTy = i < len;\r\n if (xLTy) len = i;\r\n\r\n for (i = 0; i < len; i++) {\r\n if (xd[i] != yd[i]) {\r\n xLTy = xd[i] < yd[i];\r\n break;\r\n }\r\n }\r\n\r\n k = 0;\r\n }\r\n\r\n if (xLTy) {\r\n d = xd;\r\n xd = yd;\r\n yd = d;\r\n y.s = -y.s;\r\n }\r\n\r\n len = xd.length;\r\n\r\n // Append zeros to xd if shorter.\r\n // Don't add zeros to yd if shorter as subtraction only needs to start at yd length.\r\n for (i = yd.length - len; i > 0; --i) xd[len++] = 0;\r\n\r\n // Subtract yd from xd.\r\n for (i = yd.length; i > k;) {\r\n if (xd[--i] < yd[i]) {\r\n for (j = i; j && xd[--j] === 0;) xd[j] = BASE - 1;\r\n --xd[j];\r\n xd[i] += BASE;\r\n }\r\n\r\n xd[i] -= yd[i];\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; xd[--len] === 0;) xd.pop();\r\n\r\n // Remove leading zeros and adjust exponent accordingly.\r\n for (; xd[0] === 0; xd.shift()) --e;\r\n\r\n // Zero?\r\n if (!xd[0]) return new Ctor(0);\r\n\r\n y.d = xd;\r\n y.e = e;\r\n\r\n //return external && xd.length >= pr / LOG_BASE ? round(y, pr) : y;\r\n return external ? round(y, pr) : y;\r\n }\r\n\r\n\r\n function toString(x, isExp, sd) {\r\n var k,\r\n e = getBase10Exponent(x),\r\n str = digitsToString(x.d),\r\n len = str.length;\r\n\r\n if (isExp) {\r\n if (sd && (k = sd - len) > 0) {\r\n str = str.charAt(0) + '.' + str.slice(1) + getZeroString(k);\r\n } else if (len > 1) {\r\n str = str.charAt(0) + '.' + str.slice(1);\r\n }\r\n\r\n str = str + (e < 0 ? 'e' : 'e+') + e;\r\n } else if (e < 0) {\r\n str = '0.' + getZeroString(-e - 1) + str;\r\n if (sd && (k = sd - len) > 0) str += getZeroString(k);\r\n } else if (e >= len) {\r\n str += getZeroString(e + 1 - len);\r\n if (sd && (k = sd - e - 1) > 0) str = str + '.' + getZeroString(k);\r\n } else {\r\n if ((k = e + 1) < len) str = str.slice(0, k) + '.' + str.slice(k);\r\n if (sd && (k = sd - len) > 0) {\r\n if (e + 1 === len) str += '.';\r\n str += getZeroString(k);\r\n }\r\n }\r\n\r\n return x.s < 0 ? '-' + str : str;\r\n }\r\n\r\n\r\n // Does not strip trailing zeros.\r\n function truncate(arr, len) {\r\n if (arr.length > len) {\r\n arr.length = len;\r\n return true;\r\n }\r\n }\r\n\r\n\r\n // Decimal methods\r\n\r\n\r\n /*\r\n * clone\r\n * config/set\r\n */\r\n\r\n\r\n /*\r\n * Create and return a Decimal constructor with the same configuration properties as this Decimal\r\n * constructor.\r\n *\r\n */\r\n function clone(obj) {\r\n var i, p, ps;\r\n\r\n /*\r\n * The Decimal constructor and exported function.\r\n * Return a new Decimal instance.\r\n *\r\n * value {number|string|Decimal} A numeric value.\r\n *\r\n */\r\n function Decimal(value) {\r\n var x = this;\r\n\r\n // Decimal called without new.\r\n if (!(x instanceof Decimal)) return new Decimal(value);\r\n\r\n // Retain a reference to this Decimal constructor, and shadow Decimal.prototype.constructor\r\n // which points to Object.\r\n x.constructor = Decimal;\r\n\r\n // Duplicate.\r\n if (value instanceof Decimal) {\r\n x.s = value.s;\r\n x.e = value.e;\r\n x.d = (value = value.d) ? value.slice() : value;\r\n return;\r\n }\r\n\r\n if (typeof value === 'number') {\r\n\r\n // Reject Infinity/NaN.\r\n if (value * 0 !== 0) {\r\n throw Error(invalidArgument + value);\r\n }\r\n\r\n if (value > 0) {\r\n x.s = 1;\r\n } else if (value < 0) {\r\n value = -value;\r\n x.s = -1;\r\n } else {\r\n x.s = 0;\r\n x.e = 0;\r\n x.d = [0];\r\n return;\r\n }\r\n\r\n // Fast path for small integers.\r\n if (value === ~~value && value < 1e7) {\r\n x.e = 0;\r\n x.d = [value];\r\n return;\r\n }\r\n\r\n return parseDecimal(x, value.toString());\r\n } else if (typeof value !== 'string') {\r\n throw Error(invalidArgument + value);\r\n }\r\n\r\n // Minus sign?\r\n if (value.charCodeAt(0) === 45) {\r\n value = value.slice(1);\r\n x.s = -1;\r\n } else {\r\n x.s = 1;\r\n }\r\n\r\n if (isDecimal.test(value)) parseDecimal(x, value);\r\n else throw Error(invalidArgument + value);\r\n }\r\n\r\n Decimal.prototype = P;\r\n\r\n Decimal.ROUND_UP = 0;\r\n Decimal.ROUND_DOWN = 1;\r\n Decimal.ROUND_CEIL = 2;\r\n Decimal.ROUND_FLOOR = 3;\r\n Decimal.ROUND_HALF_UP = 4;\r\n Decimal.ROUND_HALF_DOWN = 5;\r\n Decimal.ROUND_HALF_EVEN = 6;\r\n Decimal.ROUND_HALF_CEIL = 7;\r\n Decimal.ROUND_HALF_FLOOR = 8;\r\n\r\n Decimal.clone = clone;\r\n Decimal.config = Decimal.set = config;\r\n\r\n if (obj === void 0) obj = {};\r\n if (obj) {\r\n ps = ['precision', 'rounding', 'toExpNeg', 'toExpPos', 'LN10'];\r\n for (i = 0; i < ps.length;) if (!obj.hasOwnProperty(p = ps[i++])) obj[p] = this[p];\r\n }\r\n\r\n Decimal.config(obj);\r\n\r\n return Decimal;\r\n }\r\n\r\n\r\n /*\r\n * Configure global settings for a Decimal constructor.\r\n *\r\n * `obj` is an object with one or more of the following properties,\r\n *\r\n * precision {number}\r\n * rounding {number}\r\n * toExpNeg {number}\r\n * toExpPos {number}\r\n *\r\n * E.g. Decimal.config({ precision: 20, rounding: 4 })\r\n *\r\n */\r\n function config(obj) {\r\n if (!obj || typeof obj !== 'object') {\r\n throw Error(decimalError + 'Object expected');\r\n }\r\n var i, p, v,\r\n ps = [\r\n 'precision', 1, MAX_DIGITS,\r\n 'rounding', 0, 8,\r\n 'toExpNeg', -1 / 0, 0,\r\n 'toExpPos', 0, 1 / 0\r\n ];\r\n\r\n for (i = 0; i < ps.length; i += 3) {\r\n if ((v = obj[p = ps[i]]) !== void 0) {\r\n if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v;\r\n else throw Error(invalidArgument + p + ': ' + v);\r\n }\r\n }\r\n\r\n if ((v = obj[p = 'LN10']) !== void 0) {\r\n if (v == Math.LN10) this[p] = new this(v);\r\n else throw Error(invalidArgument + p + ': ' + v);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n\r\n // Create and configure initial Decimal constructor.\r\n Decimal = clone(Decimal);\r\n\r\n Decimal['default'] = Decimal.Decimal = Decimal;\r\n\r\n // Internal constant.\r\n ONE = new Decimal(1);\r\n\r\n\r\n // Export.\r\n\r\n\r\n // AMD.\r\n if (typeof define == 'function' && define.amd) {\r\n define(function () {\r\n return Decimal;\r\n });\r\n\r\n // Node and other environments that support module.exports.\r\n } else if (typeof module != 'undefined' && module.exports) {\r\n module.exports = Decimal;\r\n\r\n // Browser.\r\n } else {\r\n if (!globalScope) {\r\n globalScope = typeof self != 'undefined' && self && self.self == self\r\n ? self : Function('return this')();\r\n }\r\n\r\n globalScope.Decimal = Decimal;\r\n }\r\n})(this);\r\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","/* eslint-disable linebreak-style */\n/* eslint-disable camelcase */\n/* eslint-disable linebreak-style */\n/* global gformFormatMoney,Currency,GFCalc,rgars,gform,gformGetDecimalSeparator,gformCleanNumber,gformIsNumber,GFMergeTag,GWPAdvancedNumberField */\nimport '../css/style.scss';\n\nimport Decimal from 'decimal.js-light';\n\nwindow.GWPAdvancedNumberField = null;\n\nconst GWPAdvancedNumberFields = [];\n\n(function () {\n\twindow.GWPAdvancedNumberField = function (fields) {\n\t\tconst self = GWPAdvancedNumberField;\n\n\t\tself.bindEvents = function () {\n\t\t\tgform.addFilter('gform_calculation_result', function (result, formulaField, formId) {\n\t\t\t\treturn self.filterCalculationValue(result, formId + '_' + formulaField.field_id);\n\t\t\t});\n\n\t\t\tgform.addFilter('gform_calculation_format_result', function (formattedResult, result, formulaField, formId) {\n\t\t\t\treturn self.filterFormatValue(formattedResult, result, formId + '_' + formulaField.field_id, false);\n\t\t\t});\n\n\t\t\tgform.addFilter('gform_calculation_formula', function (formula, formulaField, formId, calcObj) {\n\t\t\t\treturn self.replaceMathFunctions(formula, formulaField, formId, calcObj);\n\t\t\t}, 16 ); // We use prio 16 to prevent conflicts for users that are using GP Advanced Calculations. Which has a more advanced implementation of min/max/pow functions and uses priority 15.\n\n\t\t\tgform.addFilter('gform_merge_tag_value_pre_calculation', function (value, mergeTagArr, isVisible, formulaField, formId) {\n\t\t\t\treturn self.getCalculationValue(value, mergeTagArr, isVisible, formulaField, formId);\n\t\t\t});\n\t\t};\n\n\t\t/**\n\t\t * Prepare the value for use in calculations.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t * @param {string} value\n\t\t * @param {Array} mergeTagArr\n\t\t * @param {boolean} isVisible\n\t\t * @param {Object} formulaField\n\t\t * @param {int} formId\n\t\t * @return\n\t\t */\n\t\tself.getCalculationValue = function (value, mergeTagArr, isVisible, formulaField, formId) {\n\t\t\tconst formFieldId = formId + '_' + mergeTagArr[1];\n\n\t\t\tif (formFieldId in GWPAdvancedNumberFields) {\n\t\t\t\t// Custom Unit enabled.\n\t\t\t\tif (GWPAdvancedNumberFields[formFieldId].hasOwnProperty('customUnit') && GWPAdvancedNumberFields[formFieldId].customUnit.enabled) {\n\t\t\t\t\t// Remove custom unit string.\n\t\t\t\t\tvalue = value.toString().replace(GWPAdvancedNumberFields[formFieldId].customUnit.unitValue, '');\n\t\t\t\t}\n\n\t\t\t\t// Slider enabled.\n\t\t\t\tif (GWPAdvancedNumberFields[formFieldId].hasOwnProperty('showAsSlider') && GWPAdvancedNumberFields[formFieldId].showAsSlider.enabled) {\n\t\t\t\t\t// Rounding + fixedNotation enabled.\n\t\t\t\t\tif (GWPAdvancedNumberFields[formFieldId].hasOwnProperty('roundValue') && GWPAdvancedNumberFields[formFieldId].roundValue.enabled && GWPAdvancedNumberFields[formFieldId].roundValue.fixedNotation) {\n\t\t\t\t\t\t// Slider input.val() returns decimal point notation (in FF), but keeps fixed decimals. Here we parse 2.00 to 2.\n\t\t\t\t\t\tvalue = parseFloat(value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn value;\n\t\t};\n\n\t\t/**\n\t\t * Replace min / max before calculations.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t * @param {string} formula The formule.\n\t\t * @param {Object} formulaField The field with formula.\n\t\t * @param {int} formId The form id.\n\t\t * @param {Object} calcObj The calc Object.\n\t\t *\n\t\t * @return {number|string}\n\t\t */\n\t\tself.replaceMathFunctions = function (formula, formulaField, formId, calcObj) {\n\t\t\tconst regEx = /(min|max|pow)\\(([^\\(]+?)[?^\\)]/gi;\n\t\t\tconst matches = formula.matchAll(regEx);\n\t\t\tlet parsed = '';\n\t\t\tlet result = 0;\n\t\t\tfor (const match of matches) {\n\t\t\t\tparsed = calcObj.replaceFieldTags(formId, match[2], formulaField).replace(/ /g, '').split(',');\n\t\t\t\tswitch (match[1].toLowerCase()) {\n\t\t\t\t\tcase 'max':\n\t\t\t\t\t\tresult = Math.max(...parsed);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'min':\n\t\t\t\t\t\tresult = Math.min(...parsed);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'pow':\n\t\t\t\t\t\t// convert to fixed to avoid scientific notation, which is not accepted by GFCalc.\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresult = new Decimal(Math.pow(parsed[0], parsed[1])).toFixed(21);\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\tresult = Math.pow(parsed[0], parsed[1]);\n\t\t\t\t\t\t\tconsole.log(result + 'not a valid calculation value.');\n\t\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tformula = formula.replace(match[0], result);\n\t\t\t}\n\t\t\treturn formula;\n\t\t};\n\n\t\t/**\n\t\t * Round the value.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t * @param {number} value The value.\n\t\t * @param {int} decimalPlaces The decimal places.\n\t\t * @param {string} roundingMethod The rounding method.\n\t\t * @param {boolean} fixedNotation If fixed notation set.\n\t\t *\n\t\t * @return {number|string}\n\t\t */\n\t\tself.roundValue = function (value, decimalPlaces, roundingMethod, fixedNotation) {\n\t\t\t/**\n\t\t\t * Ceil or Floor can give unexpected results because in JS 0.1 + 0.2 = 0.30000000000000004. Therefore we convert the value to string by using toFixed(7) before applying the rounding settings. Which is 1 more than the supported 6 decimals.\n\t\t\t * When changing this take gravityforms.js Currency.numberFormat() limitations into account which we use for formatting of the calculated numbers, because 0.0000000001 is being added to the number when rounded (in GF2.6).\n\t\t\t *\n\t\t\t * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed#description\n\t\t\t * @see https://en.wikipedia.org/wiki/Floating-point_arithmetic#Accuracy_problems\n\t\t\t */\n\t\t\tif ( ! isFinite(value) || ! isFinite(value.toFixed(7))) {\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\tconst v = new Decimal(value.toFixed(7));\n\t\t\tlet rm; // rounding method.\n\t\t\tswitch (roundingMethod) {\n\t\t\t\tcase 'round':\n\t\t\t\t\trm = Decimal.ROUND_HALF_UP;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ceil':\n\t\t\t\t\trm = Decimal.ROUND_UP;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'floor':\n\t\t\t\t\trm = Decimal.ROUND_DOWN;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (fixedNotation) {\n\t\t\t\treturn v.toFixed(decimalPlaces, rm).toString();\n\t\t\t}\n\n\t\t\treturn parseFloat(v.toDecimalPlaces(decimalPlaces, rm).toString());\n\t\t};\n\n\t\t/**\n\t\t * Apply the custom unit.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t * @param {string|number} value The value.\n\t\t * @param {string} unit The custom unit.\n\t\t * @param {string} placement The unit placement.\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tself.applyCustomUnit = function (value, unit, placement) {\n\t\t\tif (placement === 'after') {\n\t\t\t\treturn value + unit;\n\t\t\t}\n\n\t\t\treturn unit + value;\n\t\t};\n\n\t\t/**\n\t\t * Display the slider value.\n\t\t *\n\t\t * @since 1.0\n\t\t * @param {Event|string} e The event or field ID.\n\t\t * @param {string} formattedNumber\n\t\t *\n\t\t */\n\t\tself.displaySliderValue = function (e, formattedNumber) {\n\t\t\tlet element, fieldId;\n\n\t\t\tif (e.target) {\n\t\t\t\tfieldId = e.target.id.replace('input_', '');\n\t\t\t\telement = e.target;\n\t\t\t} else {\n\t\t\t\tfieldId = e;\n\t\t\t\telement = document.getElementById('input_' + fieldId);\n\t\t\t}\n\n\t\t\tconst props = GWPAdvancedNumberFields[fieldId];\n\n\t\t\tif (props.hasOwnProperty('showAsSlider') && props.showAsSlider.enabled) {\n\t\t\t\tconst rawValue = element.value;\n\n\t\t\t\tlet min = element.getAttribute(\"min\");\n\t\t\t\tlet max = element.getAttribute(\"max\");\n\t\t\t\t \n\t\t\t\t// element.nextElementSibling.value = gform.applyFilters('gravityWP.advancedNumberField.sliderOutput', formattedNumber, rawValue, fieldId, GWPAdvancedNumberFields[fieldId]);\n\t\t\t\telement.parentElement.parentElement.querySelector('output').value = gform.applyFilters('gravityWP.advancedNumberField.sliderOutput', formattedNumber, rawValue, fieldId, GWPAdvancedNumberFields[fieldId]);\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * Filter the field value based on the advanced number settings for calculations results.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t * @param {number} value The value.\n\t\t * @param {string} fieldId The field Id in the format of \"21_2\" (formId_fieldId).'\n\t\t *\n\t\t * @return {number}\n\t\t */\n\t\tself.filterCalculationValue = function (value, fieldId) {\n\t\t\tif (!GWPAdvancedNumberFields.hasOwnProperty(fieldId)) {\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\tconst props = GWPAdvancedNumberFields[fieldId];\n\t\t\tlet decimalPlaces = -1;\n\n\t\t\t// Get absolute value if set.\n\t\t\tif (props.hasOwnProperty('absoluteValue') && props.absoluteValue.enabled) {\n\t\t\t\tvalue = Math.abs(parseFloat(value));\n\t\t\t}\n\n\t\t\t// Rounding values if set.\n\t\t\tif (props.hasOwnProperty('roundValue') && props.roundValue.enabled) {\n\t\t\t\tdecimalPlaces = parseInt(props.roundValue.decimalPlaces);\n\t\t\t\tvalue = self.roundValue(parseFloat(value), decimalPlaces, props.roundValue.roundingMethod, props.roundValue.fixedNotation);\n\t\t\t}\n\n\t\t\treturn value;\n\t\t};\n\n\t\t/**\n\t\t * Filter the field value based on the advanced number settings. Filters input change events, initilization values (formatted values) and calculation results (raw value).\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t * @param {string|boolean} formattedResult Has a formatted result or false.\n\t\t * @param {number} value Raw number to be formatted.\n\t\t * @param {string} fieldId The field Id in the format of \"21_2\" (formId_fieldId).'\n\t\t * @param {boolean} isDOMValue DOM value or raw value.\n\t\t *\n\t\t * @return {string} The formatted value.\n\t\t */\n\t\tself.filterFormatValue = function (formattedResult, value, fieldId, isDOMValue) {\n\t\t\tif (!GWPAdvancedNumberFields.hasOwnProperty(fieldId)) {\n\t\t\t\treturn formattedResult;\n\t\t\t}\n\t\t\tconst props = GWPAdvancedNumberFields[fieldId];\n\t\t\tconst decimalSeparator = gformGetDecimalSeparator(props.numberFormat);\n\t\t\tlet thousandSeparator = decimalSeparator === '.' ? ',' : '.';\n\t\t\tthousandSeparator = props.showThousandsSeparator ? thousandSeparator : '';\n\t\t\tlet decimalPlaces = -1;\n\n\t\t\t// Remove the custom unit from the value.\n\t\t\tconst customUnitEnabled = props.hasOwnProperty('customUnit') && props.customUnit.enabled;\n\t\t\tif (customUnitEnabled) {\n\t\t\t\tvalue = value.toString().replace(props.customUnit.unitValue, '');\n\t\t\t}\n\n\t\t\tconst originalValue = value;\n\t\t\tif (isDOMValue) {\n\t\t\t\t// transform to a decimal dot number.\n\t\t\t\t// gformGetDecimalSeparator(value)\n\t\t\t\tif (props.hasOwnProperty('showAsSlider') && props.showAsSlider.enabled) {\n\t\t\t\t\tvalue = gformCleanNumber(value, '', '', '.' );\n\t\t\t\t} else {\n\t\t\t\t\tvalue = gformCleanNumber(value, '', '', gformGetDecimalSeparator(props.numberFormat) );\n\t\t\t\t}\t\t\t\t\n\n\t\t\t\t// If the converted value is not a number, return early.\n\t\t\t\tif (!gformIsNumber(value)) {\n\t\t\t\t\treturn originalValue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Get absolute value if set.\n\t\t\tif (props.hasOwnProperty('absoluteValue') && props.absoluteValue.enabled) {\n\t\t\t\tvalue = Math.abs(value);\n\t\t\t}\n\n\t\t\t// Rounding values if set.\n\t\t\tif (props.hasOwnProperty('roundValue') && props.roundValue.enabled) {\n\t\t\t\tdecimalPlaces = parseInt(props.roundValue.decimalPlaces);\n\t\t\t\tvalue = self.roundValue(parseFloat(value), decimalPlaces, props.roundValue.roundingMethod, props.roundValue.fixedNotation);\n\t\t\t}\n\n\t\t\t// Format the number.\n\t\t\tconst currency = new Currency();\n\t\t\tconst formattedNumber = props.numberFormat === 'currency' ? gformFormatMoney(value, true) : currency.numberFormat(value, decimalPlaces, decimalSeparator, thousandSeparator, props.roundValue.fixedNotation);\n\t\t\tif (!props.hasOwnProperty('showAsSlider') || !props.showAsSlider.enabled) {\n\t\t\t\tvalue = formattedNumber;\n\t\t\t} else {\n\t\t\t\tdocument.getElementById('input_' + fieldId).setAttribute('data-slidervalue', formattedNumber);\n\t\t\t\tself.displaySliderValue(fieldId, formattedNumber);\n\t\t\t}\n\n\t\t\t// Apply custom unit if set.\n\t\t\tif (customUnitEnabled) {\n\t\t\t\tconst customUnitValue = self.applyCustomUnit(formattedNumber, props.customUnit.unitValue, props.customUnit.unitPlacement);\n\t\t\t\tif (!props.hasOwnProperty('showAsSlider') || !props.showAsSlider.enabled) {\n\t\t\t\t\tvalue = customUnitValue;\n\t\t\t\t} else {\n\t\t\t\t\tdocument.getElementById('input_' + fieldId).setAttribute('data-slidervalue', customUnitValue);\n\t\t\t\t\tself.displaySliderValue(fieldId, customUnitValue);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (props.hasOwnProperty('showAsSlider') && props.showAsSlider.enabled) {\n\t\t\t\treturn originalValue;\n\t\t\t}\n\n\t\t\treturn value;\n\t\t};\n\n\t\t/**\n\t\t * Update the field value based on the advanced number settings.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t * @param {Event} e The Event object.\n\t\t */\n\t\tself.updateValue = function (e) {\n\t\t\te.target.value = self.filterFormatValue(false, e.target.value, e.target.id.replace('input_', ''), true);\n\t\t};\n\n\t\t/**\n\t\t * Trigger the change event for a Slider input.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t * @param {Event} e The Event object.\n\t\t */\n\t\tself.triggerSliderChange = function (e) {\n\t\t\tconst event = new Event('change');\n\t\t\te.target.dispatchEvent(event);\n\t\t};\n\n\t\t/**\n\t\t * Remove custom unit from the input value.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t * @param {string} customUnit The custom unit string.\n\t\t * @param {Event} e The Event object.\n\t\t */\n\t\tself.removeCustomUnit = function (customUnit, e) {\n\t\t\te.target.value = e.target.value.replace(customUnit, '');\n\t\t};\n\n\t\t/**\n\t\t * Returns the ANF field settings so the settings are accessible for frontend user scripts.\n\t\t *\n\t\t * @since 1.0\n\t\t */\n\t\tself.getGWPAdvancedNumberFieldsSettings = function () {\n\t\t\treturn GWPAdvancedNumberFields;\n\t\t};\n\n\t\t/**\n\t\t * Init the min/max range calculation.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t * @param {string} fieldId The range input ID.\n\t\t * @param {string} type min or max.\n\t\t */\n\t\tself.initRangeCalculation = function (fieldId, type) {\n\t\t\tif (type !== 'min' && type !== 'max') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst props = GWPAdvancedNumberFields[fieldId];\n\n\t\t\tif (rgars(props, type + 'ValueCalculation/enabled', false) === true) {\n\t\t\t\tlet formula = rgars(props, type + 'ValueCalculation/formula', '');\n\t\t\t\tconst formFieldId = fieldId.split('_');\n\t\t\t\tif (formula.length > 0) {\n\t\t\t\t\tconst matches = GFMergeTag.parseMergeTags(formula);\n\t\t\t\t\tif (matches.length > 0) {\n\t\t\t\t\t\tfor (const i in matches) {\n\t\t\t\t\t\t\tif (!matches.hasOwnProperty(i)) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst inputIdToBind = formFieldId[0] + '_' + matches[i][1];\n\t\t\t\t\t\t\t//const input = document.getElementById('input_' + inputIdToBind);\n\t\t\t\t\t\t\t//input.addEventListener('change', (e) => self.applyRangeCalculation(formFieldId[0], formFieldId[1], formula, type, e)); -> this doesn't catch some changes made by GP ADvanced Calculations\n\t\t\t\t\t\t\tjQuery('#input_' + inputIdToBind).change(function(){self.applyRangeCalculation(formFieldId[0], formFieldId[1], formula, type);});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// No formula, initialize range on 0.\n\t\t\t\t\tformula = '0';\n\t\t\t\t}\n\n\t\t\t\tself.applyRangeCalculation(formFieldId[0], formFieldId[1], formula, type);\n\t\t\t}\n\t\t};\n\t\t\n\t\t/**\n\t\t * Function to generate ruler marks dynamically based on input range values\n\t\t * @param {string} formId - ID of the form containing the input element\n\t\t * @param {string} fieldId - ID of the input field\n\t\t * @param {string} type - Type of ruler (not used in this function)\n\t\t * @param {string} result - Result of the ruler generation (not used in this function)\n\t\t */\n\t\tself.generateRulerMarks = function (formId,fieldId,type,result) {\t\n\t\t\tlet input = document.getElementById('input_' +formId + '_' + fieldId); \n\t\t\tlet max = parseInt(input.max);\n\t\t\tlet min = parseInt(input.min);\n\t\t\tlet rulerDev = document.getElementById(\"gwp_slider_ruler_\"+formId+\"_\"+fieldId);\n\t\t\tlet step_rulers = false;\n\t\t\tif ( rulerDev !== null && typeof rulerDev.dataset !== 'undefined' && typeof rulerDev.dataset.step !== 'undefined' ) {\n\t\t\t\tstep_rulers = parseInt( rulerDev.dataset.step );\n\t\t\t}\n\t\t\tif (rulerDev && step_rulers) {\n\t\t\t\tif (input) {\n\t\t\t\t\t//let marksCount = (max - min) / step_rulers;\n\t\t\t\t\tlet rulerHtml = '';\n\t\t\t\t\tlet range_width = max - min;\n\t\t\t\t\tif ( ( max - min ) / step_rulers < 150 ) { // do not allow more than 150 ruler elements to prevent DOM overload.\n\t\t\t\t\t\tfor ( i = min; i <= max; i += step_rulers ) {\n\t\t\t\t\t\t\tlet normalized_value = i - min;\n\t\t\t\t\t\t\tlet percentage_position = ( normalized_value / range_width ) * 100;\n\t\t\t\t\t\t\trulerHtml += `
  • `;\n\t\t\t\t\t\t\trulerHtml += '' + i.toString() + '';\n\t\t\t\t\t\t\trulerHtml += '
  • ';\n\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\trulerDev.innerHTML = rulerHtml;\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\n\t\t/**\n\t\t * Applies calculated min/max range to slider input.\n\t\t *\n\t\t * @param {string} formId Form id (numeric string).\n\t\t * @param {string} fieldId Field id (numeric string).\n\t\t * @param {string} formula The formula containing merge tags.\n\t\t * @param {string} type Type of range boundary: min or max.\n\t\t */\n\t\tself.applyRangeCalculation = function (formId, fieldId, formula, type) {\n\t\t\tconst formulaField = new Object;\n\t\t\tformulaField.field_id = fieldId;\n\t\t\tformulaField.formula = formula;\n\t\t\tconst result = self.parseEvaluateFormula(formulaField, formId);\n\t\t\tconst range = document.getElementById('input_' + formId + '_' + fieldId);\n\t\t\tconst previousVal = range.value;\n\t\t\trange.setAttribute(type, result);\n\t\t\tconst props = GWPAdvancedNumberFields[formId + '_' + fieldId];\n\n\t\t\tif ((type === 'min' && previousVal < result) || (type === 'max' && previousVal > result)) {\n\t\t\t\t\n\t\t\t\trange.dispatchEvent(new Event('input'));\n\t\t\t\t\n\t\t\t\tif (rgars(props, 'showAsSlider/enabled', false) === true && rgars(props, 'showAsSlider/continuousUpdate', false) === false) {\n\t\t\t\t\trange.dispatchEvent(new Event('change'));\t\t\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\n\t\t\tif ( rgars(props, 'showAsSlider/displayRuler', true ) ) {\n\t\t\t\tif ((type === 'min' && previousVal !== result) || (type === 'max' && previousVal !== result)) {\n\t\t\t\t\tif (fieldId != '' && formId != '') {\n\t\t\t\t\t\tself.generateRulerMarks(formId,fieldId,type,result);\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * Parse and evaluate the formula.\n\t\t *\n\t\t * @param {Object} formulaField formula Field.\n\t\t * @param {string} formId Form id (numeric string).\n\t\t * @return\n\t\t */\n\t\tself.parseEvaluateFormula = function (formulaField, formId) {\n\t\t\t// Retrieve or create the GFCalc object.\n\t\t\tlet calcObj = rgars(window, 'gf_global/gfcalc/' + formId, null);\n\t\t\tif (typeof (calcObj) !== GFCalc) {\n\t\t\t\tcalcObj = new GFCalc(formId, {});\n\t\t\t}\n\n\t\t\t// Initialize other\n\t\t\tconst formula = gform.applyFilters('gform_calculation_formula', formulaField.formula, formulaField, formId, calcObj),\n\t\t\t\texpr = calcObj.replaceFieldTags(formId, formula, formulaField).replace(/(\\r\\n|\\n|\\r)/gm, '');\n\t\t\tlet result = '';\n\n\t\t\tif (calcObj.exprPatt.test(expr)) {\n\t\t\t\ttry {\n\t\t\t\t\t// Run sanitized calculation.\n\t\t\t\t\tresult = eval(expr);\n\t\t\t\t\treturn result;\n\t\t\t\t} catch (e) { }\n\t\t\t} else {\n\n\t\t\t}\n\t\t};\n\n\t\tself.init = function () {\n\t\t\t// Copy all ANF field settings into a global variable to support multiple forms.\n\t\t\tfor (const prop in fields) {\n\t\t\t\tif (fields.hasOwnProperty(prop)) {\n\t\t\t\t\t// Push each value from `obj` into `extended`\n\t\t\t\t\tGWPAdvancedNumberFields[prop] = fields[prop];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add event listeners.\n\t\t\tfor (const fieldId in fields) {\n\t\t\t\tconst input = document.getElementById('input_' + fieldId);\n\t\t\t\tconst props = GWPAdvancedNumberFields[fieldId];\n\n\t\t\t\tif (input.type === 'range' && input.defaultValue !== '') {\n\t\t\t\t\t// GF seems to assume decimal point notation for default field values, so we filter it as if it is a raw value.\n\t\t\t\t\tinput.value = self.filterFormatValue(false, input.defaultValue, fieldId, false);\n\t\t\t\t} else if (input.value !== '') {\n\t\t\t\t\t// input.value is a value from the DOM, which should be formatted.\n\t\t\t\t\tinput.value = self.filterFormatValue(false, input.value, fieldId, true);\n\t\t\t\t}\n\n\t\t\t\tif (input.type === 'range') {\n\t\t\t\t\t// Format the textual output for the slider.\n\t\t\t\t\tinput.addEventListener('input', self.updateValue);\n\t\t\t\t\tself.initRangeCalculation(fieldId, 'min');\n\t\t\t\t\tself.initRangeCalculation(fieldId, 'max');\n\n\t\t\t\t\tif (rgars(props, 'showAsSlider/enabled', false) === true && rgars(props, 'showAsSlider/continuousUpdate', false) === true) {\n\t\t\t\t\t\t// Trigger a change event continuously when the slider slides.\n\t\t\t\t\t\tinput.addEventListener('input', self.triggerSliderChange);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tinput.addEventListener('change', self.updateValue);\n\t\t\t\t}\n\n\t\t\t\t// Add listeners for removing custom unit when field has focus.\n\t\t\t\tif (props.hasOwnProperty('customUnit') && props.customUnit.enabled && input.type !== 'range' && !input.readOnly) {\n\t\t\t\t\tinput.addEventListener('focus', (e) => self.removeCustomUnit(props.customUnit.unitValue, e));\n\t\t\t\t\tinput.addEventListener('focusout', self.updateValue);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Bind Events.\n\t\t\tself.bindEvents();\n\t\t};\n\n\t\tself.init(fields);\n\n\t};\n}());\n"],"names":["globalScope","ONE","MAX_DIGITS","Decimal","precision","rounding","toExpNeg","toExpPos","LN10","external","decimalError","invalidArgument","exponentOutOfRange","mathfloor","Math","floor","mathpow","pow","isDecimal","BASE","LOG_BASE","MAX_SAFE_INTEGER","MAX_E","P","add","x","y","carry","d","e","i","k","len","xd","yd","Ctor","constructor","pr","s","round","slice","length","ceil","reverse","push","unshift","pop","checkInt32","min","max","Error","digitsToString","ws","indexOfLastWord","str","w","getZeroString","absoluteValue","abs","this","comparedTo","cmp","j","xdL","ydL","decimalPlaces","dp","dividedBy","div","divide","dividedToIntegerBy","idiv","equals","eq","exponent","getBase10Exponent","greaterThan","gt","greaterThanOrEqualTo","gte","isInteger","isint","isNegative","isneg","isPositive","ispos","isZero","lessThan","lt","lessThanOrEqualTo","lte","logarithm","log","base","r","wpr","ln","minus","sub","subtract","modulo","mod","q","times","naturalExponential","exp","naturalLogarithm","negated","neg","plus","sd","z","squareRoot","sqrt","n","t","toExponential","indexOf","toString","mul","rL","shift","toDecimalPlaces","todp","rm","toFixed","toInteger","toint","toNumber","toPower","sign","yIsInt","yn","truncate","toPrecision","toSignificantDigits","tosd","valueOf","val","toJSON","multiplyInteger","temp","compare","a","b","aL","bL","prod","prodL","qd","rem","remL","rem0","xi","xL","yd0","yL","yz","denominator","sum","getLn10","zs","c","c0","numerator","x2","charAt","parseDecimal","replace","search","substring","charCodeAt","rd","doRound","xdi","xe","xLTy","isExp","arr","config","obj","p","v","ps","clone","value","test","prototype","ROUND_UP","ROUND_DOWN","ROUND_CEIL","ROUND_FLOOR","ROUND_HALF_UP","ROUND_HALF_DOWN","ROUND_HALF_EVEN","ROUND_HALF_CEIL","ROUND_HALF_FLOOR","set","hasOwnProperty","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","call","getter","__esModule","definition","key","o","Object","defineProperty","enumerable","get","prop","window","GWPAdvancedNumberField","GWPAdvancedNumberFields","fields","self","bindEvents","gform","addFilter","result","formulaField","formId","filterCalculationValue","field_id","formattedResult","filterFormatValue","formula","calcObj","replaceMathFunctions","mergeTagArr","isVisible","getCalculationValue","formFieldId","customUnit","enabled","unitValue","showAsSlider","roundValue","fixedNotation","parseFloat","_step","parsed","_iterator","_createForOfIteratorHelper","matchAll","done","match","replaceFieldTags","split","toLowerCase","apply","_toConsumableArray","error","console","err","f","roundingMethod","isFinite","applyCustomUnit","unit","placement","displaySliderValue","formattedNumber","element","fieldId","target","id","document","getElementById","props","rawValue","getAttribute","parentElement","querySelector","applyFilters","parseInt","isDOMValue","decimalSeparator","gformGetDecimalSeparator","numberFormat","thousandSeparator","showThousandsSeparator","customUnitEnabled","originalValue","gformCleanNumber","gformIsNumber","currency","Currency","gformFormatMoney","setAttribute","customUnitValue","unitPlacement","updateValue","triggerSliderChange","event","Event","dispatchEvent","removeCustomUnit","getGWPAdvancedNumberFieldsSettings","initRangeCalculation","type","rgars","matches","GFMergeTag","parseMergeTags","inputIdToBind","jQuery","change","applyRangeCalculation","generateRulerMarks","input","rulerDev","step_rulers","dataset","step","rulerHtml","range_width","percentage_position","concat","innerHTML","parseEvaluateFormula","range","previousVal","_typeof","GFCalc","expr","exprPatt","eval","init","_loop","defaultValue","addEventListener","readOnly"],"sourceRoot":""}