oakscriptjs 0.10.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/box/index.d.ts.map +1 -1
- package/dist/cjs/box/index.js +7 -1
- package/dist/cjs/box/index.js.map +2 -2
- package/dist/cjs/callsite/index.d.ts +73 -32
- package/dist/cjs/callsite/index.d.ts.map +1 -1
- package/dist/cjs/callsite/index.js +69 -65
- package/dist/cjs/callsite/index.js.map +2 -2
- package/dist/cjs/drawing/registry.d.ts +75 -0
- package/dist/cjs/drawing/registry.d.ts.map +1 -1
- package/dist/cjs/drawing/registry.js +139 -6
- package/dist/cjs/drawing/registry.js.map +2 -2
- package/dist/cjs/index.d.ts +6 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +28 -1
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/label/index.d.ts.map +1 -1
- package/dist/cjs/label/index.js +3 -0
- package/dist/cjs/label/index.js.map +2 -2
- package/dist/cjs/line/index.d.ts.map +1 -1
- package/dist/cjs/line/index.js +7 -1
- package/dist/cjs/line/index.js.map +2 -2
- package/dist/cjs/math/index.d.ts.map +1 -1
- package/dist/cjs/math/index.js +2 -0
- package/dist/cjs/math/index.js.map +2 -2
- package/dist/cjs/polyline/index.d.ts.map +1 -1
- package/dist/cjs/polyline/index.js +3 -0
- package/dist/cjs/polyline/index.js.map +2 -2
- package/dist/cjs/script/index.d.ts +30 -13
- package/dist/cjs/script/index.d.ts.map +1 -1
- package/dist/cjs/script/index.js +48 -9
- package/dist/cjs/script/index.js.map +3 -3
- package/dist/cjs/session/bars.d.ts +15 -1
- package/dist/cjs/session/bars.d.ts.map +1 -1
- package/dist/cjs/session/bars.js +41 -6
- package/dist/cjs/session/bars.js.map +3 -3
- package/dist/cjs/session/calendar.d.ts +9 -1
- package/dist/cjs/session/calendar.d.ts.map +1 -1
- package/dist/cjs/session/calendar.js +28 -2
- package/dist/cjs/session/calendar.js.map +2 -2
- package/dist/cjs/session/context.d.ts +75 -0
- package/dist/cjs/session/context.d.ts.map +1 -0
- package/dist/cjs/session/context.js +113 -0
- package/dist/cjs/session/context.js.map +7 -0
- package/dist/cjs/str/index.d.ts +3 -1
- package/dist/cjs/str/index.d.ts.map +1 -1
- package/dist/cjs/str/index.js +2 -1
- package/dist/cjs/str/index.js.map +2 -2
- package/dist/cjs/str/numberformat.d.ts +4 -2
- package/dist/cjs/str/numberformat.d.ts.map +1 -1
- package/dist/cjs/str/numberformat.js +1 -1
- package/dist/cjs/str/numberformat.js.map +2 -2
- package/dist/cjs/ta/index.d.ts +33 -17
- package/dist/cjs/ta/index.d.ts.map +1 -1
- package/dist/cjs/ta/index.js +70 -29
- package/dist/cjs/ta/index.js.map +2 -2
- package/dist/cjs/ta/limits.d.ts +24 -0
- package/dist/cjs/ta/limits.d.ts.map +1 -0
- package/dist/cjs/ta/limits.js +50 -0
- package/dist/cjs/ta/limits.js.map +7 -0
- package/dist/cjs/ta/running-sum.d.ts +0 -16
- package/dist/cjs/ta/running-sum.d.ts.map +1 -1
- package/dist/cjs/ta/running-sum.js +2 -0
- package/dist/cjs/ta/running-sum.js.map +2 -2
- package/dist/cjs/ta-series.d.ts +7 -7
- package/dist/cjs/ta-series.d.ts.map +1 -1
- package/dist/cjs/ta-series.js +9 -7
- package/dist/cjs/ta-series.js.map +2 -2
- package/dist/cjs/time/index.d.ts +5 -2
- package/dist/cjs/time/index.d.ts.map +1 -1
- package/dist/cjs/time/index.js +2 -2
- package/dist/cjs/time/index.js.map +2 -2
- package/dist/cjs/time/session.d.ts +17 -1
- package/dist/cjs/time/session.d.ts.map +1 -1
- package/dist/cjs/time/session.js +61 -7
- package/dist/cjs/time/session.js.map +2 -2
- package/dist/cjs/types/metadata.d.ts +27 -3
- package/dist/cjs/types/metadata.d.ts.map +1 -1
- package/dist/cjs/types/metadata.js.map +1 -1
- package/dist/esm/box/index.d.ts.map +1 -1
- package/dist/esm/box/index.js +8 -2
- package/dist/esm/box/index.js.map +1 -1
- package/dist/esm/callsite/index.d.ts +73 -32
- package/dist/esm/callsite/index.d.ts.map +1 -1
- package/dist/esm/callsite/index.js +143 -106
- package/dist/esm/callsite/index.js.map +1 -1
- package/dist/esm/drawing/registry.d.ts +75 -0
- package/dist/esm/drawing/registry.d.ts.map +1 -1
- package/dist/esm/drawing/registry.js +237 -6
- package/dist/esm/drawing/registry.js.map +1 -1
- package/dist/esm/index.d.ts +6 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +10 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/label/index.d.ts.map +1 -1
- package/dist/esm/label/index.js +4 -1
- package/dist/esm/label/index.js.map +1 -1
- package/dist/esm/line/index.d.ts.map +1 -1
- package/dist/esm/line/index.js +8 -2
- package/dist/esm/line/index.js.map +1 -1
- package/dist/esm/math/index.d.ts.map +1 -1
- package/dist/esm/math/index.js +3 -0
- package/dist/esm/math/index.js.map +1 -1
- package/dist/esm/polyline/index.d.ts.map +1 -1
- package/dist/esm/polyline/index.js +5 -1
- package/dist/esm/polyline/index.js.map +1 -1
- package/dist/esm/script/index.d.ts +30 -13
- package/dist/esm/script/index.d.ts.map +1 -1
- package/dist/esm/script/index.js +54 -11
- package/dist/esm/script/index.js.map +1 -1
- package/dist/esm/session/bars.d.ts +15 -1
- package/dist/esm/session/bars.d.ts.map +1 -1
- package/dist/esm/session/bars.js +50 -6
- package/dist/esm/session/bars.js.map +1 -1
- package/dist/esm/session/calendar.d.ts +9 -1
- package/dist/esm/session/calendar.d.ts.map +1 -1
- package/dist/esm/session/calendar.js +35 -3
- package/dist/esm/session/calendar.js.map +1 -1
- package/dist/esm/session/context.d.ts +75 -0
- package/dist/esm/session/context.d.ts.map +1 -0
- package/dist/esm/session/context.js +122 -0
- package/dist/esm/session/context.js.map +1 -0
- package/dist/esm/str/index.d.ts +3 -1
- package/dist/esm/str/index.d.ts.map +1 -1
- package/dist/esm/str/index.js +8 -2
- package/dist/esm/str/index.js.map +1 -1
- package/dist/esm/str/numberformat.d.ts +4 -2
- package/dist/esm/str/numberformat.d.ts.map +1 -1
- package/dist/esm/str/numberformat.js +4 -2
- package/dist/esm/str/numberformat.js.map +1 -1
- package/dist/esm/ta/index.d.ts +33 -17
- package/dist/esm/ta/index.d.ts.map +1 -1
- package/dist/esm/ta/index.js +130 -56
- package/dist/esm/ta/index.js.map +1 -1
- package/dist/esm/ta/limits.d.ts +24 -0
- package/dist/esm/ta/limits.d.ts.map +1 -0
- package/dist/esm/ta/limits.js +42 -0
- package/dist/esm/ta/limits.js.map +1 -0
- package/dist/esm/ta/running-sum.d.ts +0 -16
- package/dist/esm/ta/running-sum.d.ts.map +1 -1
- package/dist/esm/ta/running-sum.js +2 -0
- package/dist/esm/ta/running-sum.js.map +1 -1
- package/dist/esm/ta-series.d.ts +7 -7
- package/dist/esm/ta-series.d.ts.map +1 -1
- package/dist/esm/ta-series.js +9 -7
- package/dist/esm/ta-series.js.map +1 -1
- package/dist/esm/time/index.d.ts +5 -2
- package/dist/esm/time/index.d.ts.map +1 -1
- package/dist/esm/time/index.js +6 -3
- package/dist/esm/time/index.js.map +1 -1
- package/dist/esm/time/session.d.ts +17 -1
- package/dist/esm/time/session.d.ts.map +1 -1
- package/dist/esm/time/session.js +97 -10
- package/dist/esm/time/session.js.map +1 -1
- package/dist/esm/types/metadata.d.ts +27 -3
- package/dist/esm/types/metadata.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/box/index.ts +8 -2
- package/src/callsite/index.ts +150 -100
- package/src/drawing/registry.ts +255 -5
- package/src/index.ts +34 -1
- package/src/label/index.ts +4 -1
- package/src/line/index.ts +8 -2
- package/src/math/index.ts +2 -0
- package/src/polyline/index.ts +3 -1
- package/src/script/index.ts +77 -18
- package/src/session/bars.ts +47 -6
- package/src/session/calendar.ts +37 -3
- package/src/session/context.ts +160 -0
- package/src/str/index.ts +7 -2
- package/src/str/numberformat.ts +5 -3
- package/src/ta/index.ts +148 -66
- package/src/ta/limits.ts +47 -0
- package/src/ta/running-sum.ts +2 -0
- package/src/ta-series.ts +16 -14
- package/src/time/index.ts +6 -3
- package/src/time/session.ts +89 -9
- package/src/types/metadata.ts +27 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/math/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Math namespace\n * Mirrors PineScript's math.* functions for mathematical operations and calculations.\n *\n * @remarks\n * All math functions in this namespace follow PineScript v6 API specifications.\n * Functions include basic arithmetic, algebraic operations, trigonometry, and combinatorics.\n *\n * Known difference: `log10`, `exp`, `log`, `pow`, `sin`, `cos`, `tan` use JavaScript's `Math`. PineScript uses\n * other algorithms, whose results differ by 1 or 2 units in the last place on part of the inputs (`log10` about 4 %,\n * `exp` about 9 %, `sin` / `cos` / `tan` about 3 %, `log` 0.4 %, `pow` 0.05 % of random inputs). This is visible\n * only when a script amplifies these tiny differences (e.g. `ma > ma[1]` on values of 1e195); `sqrt`, `atan`,\n * `asin`, `acos` are equal. A constant argument (`math.log10(2)`) is computed before the script runs, with other\n * rules: see `constant`.\n *\n * @version 6\n */\n\nimport type { float, int, simple_int, series_float } from '../types/index.js';\nimport { Series } from '../runtime/series.js';\nimport { runningSum, runningSumSeries } from '../ta/running-sum.js';\n\n/**\n * Returns the absolute value of a number.\n *\n * @param value - The number or Series\n * @returns The absolute value (always non-negative)\n *\n * @remarks\n * - Returns the distance from zero on the number line\n * - |x| = x if x \u2265 0, -x if x < 0\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.abs(5) // Returns: 5\n * math.abs(-5) // Returns: 5\n * math.abs(0) // Returns: 0\n * ```\n */\nexport function abs(value: Series): Series;\nexport function abs(value: float): float;\nexport function abs(value: float | Series): float | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(Math.abs(v));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return Math.abs(value);\n}\n\n/**\n * Returns the smallest integer greater than or equal to a given number (rounds up).\n *\n * @param value - The number to round up or Series\n * @returns The ceiling value (smallest integer \u2265 value)\n *\n * @remarks\n * - Always rounds towards positive infinity\n * - For positive numbers, rounds away from zero\n * - For negative numbers, rounds towards zero\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.ceil(4.2) // Returns: 5\n * math.ceil(4.8) // Returns: 5\n * math.ceil(-4.2) // Returns: -4\n * math.ceil(5) // Returns: 5\n * ```\n */\nexport function ceil(value: Series): Series;\nexport function ceil(value: float): int;\nexport function ceil(value: float | Series): int | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(Math.ceil(v));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return Math.ceil(value);\n}\n\n/**\n * Returns the largest integer less than or equal to a given number (rounds down).\n *\n * @param value - The number to round down or Series\n * @returns The floor value (largest integer \u2264 value)\n *\n * @remarks\n * - Always rounds towards negative infinity\n * - For positive numbers, rounds towards zero\n * - For negative numbers, rounds away from zero\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.floor(4.2) // Returns: 4\n * math.floor(4.8) // Returns: 4\n * math.floor(-4.2) // Returns: -5\n * math.floor(5) // Returns: 5\n * ```\n */\nexport function floor(value: Series): Series;\nexport function floor(value: float): int;\nexport function floor(value: float | Series): int | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(Math.floor(v));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return Math.floor(value);\n}\n\n/**\n * Returns the value rounded to the nearest integer or to a specified precision.\n *\n * @param value - The number to round or Series\n * @param precision - Optional number of decimal places (default: 0)\n * @returns The rounded value\n *\n * @remarks\n * - Rounds to nearest integer by default\n * - With precision, rounds to that many decimal places\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * PineScript rules:\n * - ties go away from zero (2.5 -> 3, -2.5 -> -3, -0.5 -> -1)\n * - without a precision, or with a precision <= 0, the result is the integer rounding (1234.5678 @ -2 -> 1235)\n * - a positive precision rounds only the fraction: `int + round(frac * scale) / scale` with\n * `scale = 1 / 10^-precision` (precision above 16 acts as 16); the tie is decided on the exact value of\n * `frac * scale` with a 1e-10 tolerance (1.005 @ 2 -> 1.01, 0.285 @ 2 -> 0.29, -1.45 @ 1 -> -1.5)\n * - an infinite value gives na\n *\n * @example\n * ```typescript\n * math.round(4.2) // Returns: 4\n * math.round(4.5) // Returns: 5\n * math.round(-2.5) // Returns: -3\n * math.round(4.567, 2) // Returns: 4.57\n * math.round(1.005, 2) // Returns: 1.01\n * ```\n */\nexport function round(value: Series, precision?: int): Series;\nexport function round(value: float, precision?: int): float;\nexport function round(value: float | Series, precision?: int): float | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const result: number[] = [];\n for (let i = 0; i < bars.length; i++) {\n result.push(roundValue(valueArray[i] ?? NaN, precision));\n }\n return Series.fromArray(bars, result);\n }\n return roundValue(value, precision);\n}\n\n/** `0.5 - 1e-10` as the exact fraction TIE_HALF / TIE_SCALE: the tie threshold of round / round_to_mintick. */\nconst TIE_SCALE = 10n ** 10n;\nconst TIE_HALF = 5n * 10n ** 9n - 1n;\n/** From 2^52 up every double is an integer. */\nconst INT_LIMIT = 2 ** 52;\n\n/** Exact value of a finite double >= 0 as `[numerator, denominator]`. */\nfunction exactRatio(x: number): [bigint, bigint] {\n const view = new DataView(new ArrayBuffer(8));\n view.setFloat64(0, x);\n const hi = view.getUint32(0);\n const lo = view.getUint32(4);\n const expField = (hi >>> 20) & 0x7ff;\n let mantissa = (BigInt(hi & 0xfffff) << 32n) | BigInt(lo);\n let exp = -1074;\n if (expField !== 0) {\n mantissa |= 1n << 52n;\n exp = expField - 1075;\n }\n return exp >= 0 ? [mantissa << BigInt(exp), 1n] : [mantissa, 1n << BigInt(-exp)];\n}\n\n/** True when `num / den - units` (exact) is >= 0.5 - 1e-10. */\nfunction reachesTie(num: bigint, den: bigint, units: bigint): boolean {\n return (num - units * den) * TIE_SCALE >= TIE_HALF * den;\n}\n\n/** `10^-p`: the exact literal for an integer p (correctly rounded), Math.pow otherwise. */\nfunction tenToMinus(p: number): number {\n return Number.isInteger(p) ? Number(`1e-${p}`) : Math.pow(10, -p);\n}\n\n/** PineScript math.round of one value (see `round`). */\nfunction roundValue(value: number, precision?: number): number {\n if (!Number.isFinite(value)) return NaN;\n const negative = value < 0;\n const magnitude = negative ? -value : value;\n if (precision === undefined || Number.isNaN(precision) || precision <= 0) {\n if (magnitude >= INT_LIMIT) return value;\n let units = Math.floor(magnitude);\n if (magnitude - units >= 0.5) units++;\n return negative ? 0 - units : units;\n }\n const scale = 1 / tenToMinus(Math.min(precision, 16));\n const fraction = magnitude % 1;\n const scaled = fraction * scale;\n let units = Math.floor(scaled);\n const offset = scaled - units - 0.5;\n // Only a near-tie needs the exact product; the window covers the double's own error.\n const slack = 1e-9 + scaled * 1.8e-15;\n if (-slack < offset && offset < slack) {\n const [fn, fd] = exactRatio(fraction);\n const [sn, sd] = exactRatio(scale);\n if (reachesTie(fn * sn, fd * sd, BigInt(units))) units++;\n } else if (offset > 0) {\n units++;\n }\n const result = magnitude - fraction + units / scale;\n return negative ? 0 - result : result;\n}\n\n/** 10^16: a constant keeps 16 decimals. */\nconst CONSTANT_SCALE = 10n ** 16n;\n\n/**\n * Returns the value PineScript gives to a constant float expression (not a PineScript function).\n *\n * @param value - The result of the constant expression, computed in JavaScript (e.g. `1 / 255`)\n * @returns The value of the same expression in a PineScript script\n *\n * @remarks\n * PineScript computes a constant expression (only literals and constants: `1 / 255`, `0.1 * 3`,\n * `math.sqrt(0.1)`) before the script runs, and the value is then rounded. JavaScript cannot tell a constant from a\n * series value, so wrap the constant expressions of a script with this function.\n * - |value| >= 0.001: the exact value of the double is rounded to 16 decimals, ties to even\n * (`1 / 255` -> 0.003921568627451, `1 / 7` -> 0.1428571428571428)\n * - |value| < 0.001, na and infinities: unchanged\n * - the whole expression is computed first, then rounded once (`(1 / 7) * 7` is 1)\n * - math functions of constants use JavaScript's `Math` there: `math.constant(math.sqrt(0.1))` is the PineScript\n * value; `math.log10` of a constant is `math.log(x) / math.log(10)` there:\n * `math.constant(math.log(2) / math.log(10))` -> 0.3010299956639811\n * - the same expression with a series operand (`close / 255`) is not rounded: do not wrap it\n *\n * @example\n * ```typescript\n * // Pine: var const float i_255 = 1 / 255\n * const i_255 = math.constant(1 / 255) // 0.003921568627451 (JavaScript: 0.00392156862745098)\n * math.constant(1 / 7) // 0.1428571428571428 (JavaScript: 0.14285714285714285)\n * math.constant(1 / 3) // 0.3333333333333333 (unchanged)\n * ```\n */\nexport function constant(value: float): float {\n const magnitude = Math.abs(value);\n // from 0.5 up, 16 decimals move a double by less than half its spacing: it stays the same\n if (!(magnitude >= 1e-3 && magnitude < 0.5)) return value;\n const [num, den] = exactRatio(magnitude);\n const scaled = num * CONSTANT_SCALE;\n let units = scaled / den;\n const twiceRest = (scaled - units * den) * 2n;\n if (twiceRest > den || (twiceRest === den && (units & 1n) === 1n)) units++;\n const digits = units.toString().padStart(17, '0');\n const result = Number(`${digits.slice(0, -16)}.${digits.slice(-16)}`);\n return value < 0 ? -result : result;\n}\n\n/**\n * Returns the maximum value from the arguments.\n *\n * @param values - Variable number of values to compare (numbers or Series)\n * @returns The largest value\n *\n * @remarks\n * - Accepts any number of arguments\n * - Returns -Infinity if no arguments provided\n * - Returns NaN if any argument is NaN\n * - If any argument is a Series, returns a Series; otherwise returns a number\n *\n * @example\n * ```typescript\n * math.max(1, 2, 3) // Returns: 3\n * math.max(-1, -5, -2) // Returns: -1\n * math.max(10) // Returns: 10\n * math.max(5, 10, 3, 8) // Returns: 10\n * ```\n */\nexport function max(...values: (float | Series)[]): float | Series {\n // Check if any value is a Series\n const hasSeries = values.some(v => v instanceof Series);\n \n if (!hasSeries) {\n // All scalars - use native Math.max\n return Math.max(...(values as number[]));\n }\n \n // At least one Series - return a Series\n const firstSeries = values.find(v => v instanceof Series) as Series;\n const bars = firstSeries.bars;\n const length = bars.length;\n \n // Convert all values to arrays (scalars become constant arrays)\n const valueArrays = values.map(v => \n v instanceof Series ? v.toArray() : null\n );\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const nums = values.map((v, idx) => \n valueArrays[idx] ? valueArrays[idx]![i] ?? NaN : (v as number)\n );\n result.push(Math.max(...nums));\n }\n \n return Series.fromArray(bars, result);\n}\n\n/**\n * Returns the minimum value from the arguments.\n *\n * @param values - Variable number of values to compare (numbers or Series)\n * @returns The smallest value\n *\n * @remarks\n * - Accepts any number of arguments\n * - Returns Infinity if no arguments provided\n * - Returns NaN if any argument is NaN\n * - If any argument is a Series, returns a Series; otherwise returns a number\n *\n * @example\n * ```typescript\n * math.min(1, 2, 3) // Returns: 1\n * math.min(-1, -5, -2) // Returns: -5\n * math.min(10) // Returns: 10\n * math.min(5, 10, 3, 8) // Returns: 3\n * ```\n */\nexport function min(...values: (float | Series)[]): float | Series {\n // Check if any value is a Series\n const hasSeries = values.some(v => v instanceof Series);\n \n if (!hasSeries) {\n // All scalars - use native Math.min\n return Math.min(...(values as number[]));\n }\n \n // At least one Series - return a Series\n const firstSeries = values.find(v => v instanceof Series) as Series;\n const bars = firstSeries.bars;\n const length = bars.length;\n \n // Convert all values to arrays (scalars become constant arrays)\n const valueArrays = values.map(v => \n v instanceof Series ? v.toArray() : null\n );\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const nums = values.map((v, idx) => \n valueArrays[idx] ? valueArrays[idx]![i] ?? NaN : (v as number)\n );\n result.push(Math.min(...nums));\n }\n \n return Series.fromArray(bars, result);\n}\n\n/**\n * Returns the average (arithmetic mean) of the arguments.\n *\n * @param values - Variable number of values (numbers or Series)\n * @returns The arithmetic mean\n *\n * @remarks\n * - Calculates sum of all values divided by count\n * - Returns NaN if no arguments provided (division by zero)\n * - If any argument is a Series, returns a Series; otherwise returns a number\n * - PineScript rule: with 1 or 2 values the sum is plain; with 3 values or more it is a Kahan compensated sum whose\n * pending correction is subtracted before the division (math.avg(0.1, 0.2, 0.3) = 0.19999999999999998)\n *\n * @example\n * ```typescript\n * math.avg(1, 2, 3) // Returns: 2\n * math.avg(10, 20) // Returns: 15\n * math.avg(5) // Returns: 5\n * math.avg(1, 2, 3, 4, 5) // Returns: 3\n * ```\n */\nexport function avg(...values: (float | Series)[]): float | Series {\n // Check if any value is a Series\n const hasSeries = values.some(v => v instanceof Series);\n\n if (!hasSeries) {\n return avgOf(values as number[]);\n }\n \n // At least one Series - return a Series\n const firstSeries = values.find(v => v instanceof Series) as Series;\n const bars = firstSeries.bars;\n const length = bars.length;\n \n // Convert all values to arrays (scalars become constant arrays)\n const valueArrays = values.map(v => \n v instanceof Series ? v.toArray() : null\n );\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const nums = values.map((v, idx) => \n valueArrays[idx] ? valueArrays[idx]![i] ?? NaN : (v as number)\n );\n result.push(avgOf(nums));\n }\n\n return Series.fromArray(bars, result);\n}\n\n/** PineScript math.avg of numbers: plain sum up to 2 values, Kahan sum with the correction flushed from 3. */\nfunction avgOf(nums: number[]): number {\n if (nums.length <= 2) {\n let sum = 0;\n for (const n of nums) sum = sum + n;\n return sum / nums.length;\n }\n let sum = 0;\n let c = 0;\n for (const n of nums) {\n const y = n - c;\n const t = sum + y;\n c = t - sum - y;\n sum = t;\n }\n return (sum - c) / nums.length;\n}\n\n/**\n * Returns the sum of values over a sliding window.\n *\n * @param source - Series of values or array\n * @param length - Window length for summation, or one length per bar (a series length: array or Series)\n * @returns Series or array with rolling sum values\n *\n * @remarks\n * - Calculates the sum of the last `length` non-`na` values at each point; an `na` value (also +/-Infinity) is\n * skipped and the bar keeps the previous result (as in PineScript)\n * - Returns NaN until `length` non-`na` values are available\n * - A compensated running sum, as in PineScript, so the result can differ from the exact window sum in the last\n * bits (bit for bit with PineScript)\n * - When passed a Series, returns a Series; when passed an array, returns an array\n * - With a series length, PineScript moves the running sum to the new length when the length changes, with Kahan\n * steps of the raw values: a smaller length removes the values that leave the window (oldest first); a larger\n * length adds back the values from the one before the old window down to the one `length` values back (newest\n * first), then the usual step removes the stored value of the one `length` values back. A bar with an `na` value\n * gives the sum of the last `length` earlier values\n *\n * @example\n * ```typescript\n * math.sum([1, 2, 3, 4, 5], 3) // Returns: [NaN, NaN, 6, 9, 12]\n * // Explanation: [NaN, NaN, 1+2+3, 2+3+4, 3+4+5]\n * ```\n */\nexport function sum(source: Series, length: simple_int | ArrayLike<number> | Series): Series;\nexport function sum(source: series_float, length: simple_int | ArrayLike<number> | Series): series_float;\nexport function sum(\n source: series_float | Series,\n length: simple_int | ArrayLike<number> | Series\n): series_float | Series {\n // Handle Series objects - extract to array first\n const sourceArray = source instanceof Series ? source.toArray() : source;\n // PineScript: the sum of the last `length` non-na values (also +/-Infinity skipped); an na bar keeps the previous\n // result. A compensated running sum, bit for bit as PineScript.\n const result: series_float =\n typeof length === 'number'\n ? runningSum(sourceArray, length)\n : runningSumSeries(sourceArray, length instanceof Series ? length.toArray() : length, 'math.sum');\n\n // If input was a Series, return a Series\n if (source instanceof Series) {\n return Series.fromArray(source.bars, result);\n }\n\n return result;\n}\n\n/**\n * Returns the square root of a number.\n *\n * @param value - The number (must be non-negative) or Series\n * @returns The square root (\u221Avalue)\n *\n * @remarks\n * - Returns NaN for negative numbers\n * - \u221Ax \u00D7 \u221Ax = x (for non-negative x)\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.sqrt(9) // Returns: 3\n * math.sqrt(16) // Returns: 4\n * math.sqrt(2) // Returns: 1.414...\n * math.sqrt(0) // Returns: 0\n * ```\n */\nexport function sqrt(value: Series): Series;\nexport function sqrt(value: float): float;\nexport function sqrt(value: float | Series): float | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(Math.sqrt(v));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return Math.sqrt(value);\n}\n\n/**\n * Returns base raised to the power of exponent.\n *\n * @param base - The base number or Series\n * @param exponent - The exponent (power) or Series\n * @returns base^exponent\n *\n * @remarks\n * - 0^0 returns 1\n * - Negative base with fractional exponent returns NaN\n * - Any number to the power of 0 equals 1\n * - If any argument is a Series, returns a Series; if all are numbers, returns a number\n *\n * @example\n * ```typescript\n * math.pow(2, 3) // Returns: 8 (2\u00B3)\n * math.pow(10, 2) // Returns: 100\n * math.pow(5, 0) // Returns: 1\n * math.pow(2, -1) // Returns: 0.5\n * ```\n */\nexport function pow(base: Series, exponent: float): Series;\nexport function pow(base: float, exponent: Series): Series;\nexport function pow(base: Series, exponent: Series): Series;\nexport function pow(base: float, exponent: float): float;\nexport function pow(base: float | Series, exponent: float | Series): float | Series {\n const baseIsSeries = base instanceof Series;\n const expIsSeries = exponent instanceof Series;\n \n // Pure scalar case\n if (!baseIsSeries && !expIsSeries) {\n return Math.pow(base as number, exponent as number);\n }\n \n // At least one is a Series - return a Series\n const bars = baseIsSeries ? (base as Series).bars : (exponent as Series).bars;\n const baseArray = baseIsSeries ? (base as Series).toArray() : null;\n const expArray = expIsSeries ? (exponent as Series).toArray() : null;\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const b = baseArray ? baseArray[i] ?? NaN : (base as number);\n const e = expArray ? expArray[i] ?? NaN : (exponent as number);\n result.push(Math.pow(b, e));\n }\n \n return Series.fromArray(bars, result);\n}\n\n/**\n * Returns e (Euler's number) raised to the power of value.\n *\n * @param value - The exponent or Series\n * @returns e^value (where e \u2248 2.71828)\n *\n * @remarks\n * - e^0 = 1\n * - e^1 = e \u2248 2.71828\n * - Inverse of ln(x)\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.exp(0) // Returns: 1\n * math.exp(1) // Returns: 2.71828... (e)\n * math.exp(2) // Returns: 7.389...\n * math.exp(-1) // Returns: 0.3678...\n * ```\n */\nexport function exp(value: Series): Series;\nexport function exp(value: float): float;\nexport function exp(value: float | Series): float | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(Math.exp(v));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return Math.exp(value);\n}\n\n/**\n * Returns the natural logarithm (base e) of a number.\n *\n * @param value - The number (must be positive) or Series\n * @returns ln(value)\n *\n * @remarks\n * - Returns NaN for negative numbers\n * - Returns -Infinity for 0\n * - ln(e) = 1\n * - ln(1) = 0\n * - Inverse of exp(x)\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.log(1) // Returns: 0\n * math.log(Math.E) // Returns: 1\n * math.log(10) // Returns: 2.302...\n * math.log(100) // Returns: 4.605...\n * ```\n */\nexport function log(value: Series): Series;\nexport function log(value: float): float;\nexport function log(value: float | Series): float | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(Math.log(v));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return Math.log(value);\n}\n\n/**\n * Returns the base-10 logarithm of a number.\n *\n * @param value - The number (must be positive) or Series\n * @returns log\u2081\u2080(value)\n *\n * @remarks\n * - Returns NaN for negative numbers\n * - Returns -Infinity for 0\n * - log\u2081\u2080(10) = 1\n * - log\u2081\u2080(100) = 2\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.log10(10) // Returns: 1\n * math.log10(100) // Returns: 2\n * math.log10(1000) // Returns: 3\n * math.log10(1) // Returns: 0\n * ```\n */\nexport function log10(value: Series): Series;\nexport function log10(value: float): float;\nexport function log10(value: float | Series): float | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(Math.log10(v));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return Math.log10(value);\n}\n\n/**\n * Returns the sine of an angle in radians.\n *\n * @param value - The angle in radians or Series\n * @returns The sine value (range: [-1, 1])\n *\n * @remarks\n * - Input is in radians, not degrees\n * - sin(0) = 0\n * - sin(\u03C0/2) = 1\n * - Periodic with period 2\u03C0\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.sin(0) // Returns: 0\n * math.sin(Math.PI / 2) // Returns: 1\n * math.sin(Math.PI) // Returns: 0 (approximately)\n * math.sin(Math.PI / 6) // Returns: 0.5\n * ```\n */\nexport function sin(value: Series): Series;\nexport function sin(value: float): float;\nexport function sin(value: float | Series): float | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(Math.sin(v));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return Math.sin(value);\n}\n\n/**\n * Returns the cosine of an angle in radians.\n *\n * @param value - The angle in radians or Series\n * @returns The cosine value (range: [-1, 1])\n *\n * @remarks\n * - Input is in radians, not degrees\n * - cos(0) = 1\n * - cos(\u03C0/2) = 0\n * - Periodic with period 2\u03C0\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.cos(0) // Returns: 1\n * math.cos(Math.PI / 2) // Returns: 0 (approximately)\n * math.cos(Math.PI) // Returns: -1\n * math.cos(Math.PI / 3) // Returns: 0.5\n * ```\n */\nexport function cos(value: Series): Series;\nexport function cos(value: float): float;\nexport function cos(value: float | Series): float | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(Math.cos(v));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return Math.cos(value);\n}\n\n/**\n * Returns the tangent of an angle in radians.\n *\n * @param value - The angle in radians or Series\n * @returns The tangent value\n *\n * @remarks\n * - Input is in radians, not degrees\n * - tan(x) = sin(x) / cos(x)\n * - Undefined at \u03C0/2, 3\u03C0/2, etc. (returns very large numbers)\n * - Periodic with period \u03C0\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.tan(0) // Returns: 0\n * math.tan(Math.PI / 4) // Returns: 1\n * math.tan(Math.PI / 6) // Returns: 0.577... (1/\u221A3)\n * ```\n */\nexport function tan(value: Series): Series;\nexport function tan(value: float): float;\nexport function tan(value: float | Series): float | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(Math.tan(v));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return Math.tan(value);\n}\n\n/**\n * Returns the arcsine (inverse sine) of a number.\n *\n * @param value - The value (must be in range [-1, 1]) or Series\n * @returns The angle in radians (range: [-\u03C0/2, \u03C0/2])\n *\n * @remarks\n * - Returns NaN for values outside [-1, 1]\n * - asin(sin(x)) = x for x in [-\u03C0/2, \u03C0/2]\n * - asin(0) = 0\n * - asin(1) = \u03C0/2\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.asin(0) // Returns: 0\n * math.asin(1) // Returns: 1.5707... (\u03C0/2)\n * math.asin(0.5) // Returns: 0.5235... (\u03C0/6)\n * math.asin(-1) // Returns: -1.5707... (-\u03C0/2)\n * ```\n */\nexport function asin(value: Series): Series;\nexport function asin(value: float): float;\nexport function asin(value: float | Series): float | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(Math.asin(v));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return Math.asin(value);\n}\n\n/**\n * Returns the arccosine (inverse cosine) of a number.\n *\n * @param value - The value (must be in range [-1, 1]) or Series\n * @returns The angle in radians (range: [0, \u03C0])\n *\n * @remarks\n * - Returns NaN for values outside [-1, 1]\n * - acos(cos(x)) = x for x in [0, \u03C0]\n * - acos(1) = 0\n * - acos(0) = \u03C0/2\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.acos(1) // Returns: 0\n * math.acos(0) // Returns: 1.5707... (\u03C0/2)\n * math.acos(0.5) // Returns: 1.0471... (\u03C0/3)\n * math.acos(-1) // Returns: 3.1415... (\u03C0)\n * ```\n */\nexport function acos(value: Series): Series;\nexport function acos(value: float): float;\nexport function acos(value: float | Series): float | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(Math.acos(v));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return Math.acos(value);\n}\n\n/**\n * Returns the arctangent (inverse tangent) of a number.\n *\n * @param value - The value or Series\n * @returns The angle in radians (range: [-\u03C0/2, \u03C0/2])\n *\n * @remarks\n * - Accepts any number as input\n * - atan(tan(x)) = x for x in [-\u03C0/2, \u03C0/2]\n * - atan(0) = 0\n * - atan(1) = \u03C0/4\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.atan(0) // Returns: 0\n * math.atan(1) // Returns: 0.7853... (\u03C0/4)\n * math.atan(-1) // Returns: -0.7853... (-\u03C0/4)\n * math.atan(Infinity) // Returns: 1.5707... (\u03C0/2)\n * ```\n */\nexport function atan(value: Series): Series;\nexport function atan(value: float): float;\nexport function atan(value: float | Series): float | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(Math.atan(v));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return Math.atan(value);\n}\n\n/**\n * Converts an angle from degrees to radians.\n *\n * @param degrees - The angle in degrees or Series\n * @returns The angle in radians\n *\n * @remarks\n * - Radians = Degrees \u00D7 (\u03C0 / 180)\n * - One full rotation: 360\u00B0 = 2\u03C0 radians\n * - Common conversions: 90\u00B0 = \u03C0/2, 180\u00B0 = \u03C0, 270\u00B0 = 3\u03C0/2\n * - If degrees is a Series, returns a Series; if degrees is a number, returns a number\n *\n * @example\n * ```typescript\n * math.toradians(0) // Returns: 0\n * math.toradians(90) // Returns: 1.5707... (\u03C0/2)\n * math.toradians(180) // Returns: 3.1415... (\u03C0)\n * math.toradians(360) // Returns: 6.2831... (2\u03C0)\n * ```\n */\nexport function toradians(degrees: Series): Series;\nexport function toradians(degrees: float): float;\nexport function toradians(degrees: float | Series): float | Series {\n if (degrees instanceof Series) {\n const bars = degrees.bars;\n const valueArray = degrees.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(v * (Math.PI / 180));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return degrees * (Math.PI / 180);\n}\n\n/**\n * Converts an angle from radians to degrees.\n *\n * @param radians - The angle in radians or Series\n * @returns The angle in degrees\n *\n * @remarks\n * - Degrees = Radians \u00D7 (180 / \u03C0)\n * - One full rotation: 2\u03C0 radians = 360\u00B0\n * - Common conversions: \u03C0/2 = 90\u00B0, \u03C0 = 180\u00B0, 3\u03C0/2 = 270\u00B0\n * - If radians is a Series, returns a Series; if radians is a number, returns a number\n *\n * @example\n * ```typescript\n * math.todegrees(0) // Returns: 0\n * math.todegrees(Math.PI / 2) // Returns: 90\n * math.todegrees(Math.PI) // Returns: 180\n * math.todegrees(2 * Math.PI) // Returns: 360\n * ```\n */\nexport function todegrees(radians: Series): Series;\nexport function todegrees(radians: float): float;\nexport function todegrees(radians: float | Series): float | Series {\n if (radians instanceof Series) {\n const bars = radians.bars;\n const valueArray = radians.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(v * (180 / Math.PI));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return radians * (180 / Math.PI);\n}\n\n/**\n * PineScript's seeded generator: Java's linear congruential generator (`java.util.Random`), `nextDouble()`.\n * Each generator draws one number per call.\n */\nexport function seededRandom(seed: int): (min?: float, max?: float) => float {\n const mask = (1n << 48n) - 1n;\n let state = (BigInt(Math.trunc(seed)) ^ 0x5deece66dn) & mask;\n const next = (bits: bigint): bigint => {\n state = (0x5deece66dn * state + 11n) & mask;\n return state >> (48n - bits);\n };\n return (min = 0, max = 1) => {\n const hi = next(26n);\n const lo = next(27n);\n const unit = Number((hi << 27n) + lo) / 2 ** 53;\n return min + unit * (max - min);\n };\n}\n\nconst seeded = new Map<number, (min?: float, max?: float) => float>();\n\n/** Starts every seeded sequence of `math.random` again (called at the start of a script run). */\nexport function resetRandom(): void {\n seeded.clear();\n}\n\n/**\n * Returns a pseudo-random number.\n *\n * @param min - Optional minimum value (inclusive), default 0\n * @param max - Optional maximum value (exclusive), default 1\n * @param seed - Optional seed: a repeatable sequence, as PineScript (Java's `java.util.Random`)\n * @returns A random number in the specified range, or [0, 1) if no range specified\n *\n * @remarks\n * - Without a seed: `Math.random()`\n * - With a seed: PineScript's sequence, one number per call (measured: the call on each bar draws the next number\n * of `new java.util.Random(seed).nextDouble()` from the first bar of the history). PineScript keeps one generator\n * per call site; here there is one generator per seed value (started again by `executeScript`): for two call sites\n * with the same seed use `callsite.random(seed)`\n *\n * @example\n * ```typescript\n * math.random() // Returns: value between 0 and 1 (e.g., 0.234...)\n * math.random(0, 10) // Returns: value between 0 and 10 (e.g., 7.45...)\n * math.random(0, 1, 42) // Returns: 0.7275636800328681 on the first call, as PineScript\n * ```\n */\nexport function random(min?: float, max?: float, seed?: int): float {\n if (seed !== undefined && seed !== null && !Number.isNaN(seed)) {\n let gen = seeded.get(seed);\n if (!gen) {\n gen = seededRandom(seed);\n seeded.set(seed, gen);\n }\n return gen(min ?? 0, max ?? 1);\n }\n const rand = Math.random();\n if (min !== undefined && max !== undefined) {\n return min + rand * (max - min);\n }\n return rand;\n}\n\n/**\n * Returns the sign of a number.\n *\n * @param value - The number to check or Series\n * @returns 1 for positive, -1 for negative, 0 for zero, na for na\n *\n * @remarks\n * - Returns 1 if value > 0\n * - Returns -1 if value < 0\n * - Returns 0 if value = 0\n * - Returns na if value is na (as PineScript)\n * - Useful for determining direction or polarity\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.sign(5) // Returns: 1\n * math.sign(-3) // Returns: -1\n * math.sign(0) // Returns: 0\n * math.sign(0.001) // Returns: 1\n * math.sign(NaN) // Returns: NaN\n * ```\n */\nexport function sign(value: Series): Series;\nexport function sign(value: float): int;\nexport function sign(value: float | Series): int | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(v > 0 ? 1 : v < 0 ? -1 : v === 0 ? 0 : NaN);\n }\n \n return Series.fromArray(bars, result);\n }\n \n return value > 0 ? 1 : value < 0 ? -1 : value === 0 ? 0 : NaN;\n}\n\n/**\n * Rounds a value to the nearest mintick.\n *\n * @param number - The number to round or Series\n * @param mintick - Optional mintick value (defaults to requiring syminfo context)\n * @returns The number rounded to tick precision\n *\n * @remarks\n * - **PineScript v6 signature**: `math.round_to_mintick(number)` - uses implicit syminfo.mintick\n * - **JavaScript signature**: Requires explicit `mintick` OR use `createContext()` with syminfo\n * - Rounds to the nearest value divisible by mintick\n * - Returns NaN for NaN input\n * - If number is a Series, returns a Series; if number is a float, returns a float\n *\n * PineScript rules:\n * - mintick is `minmove / pricescale` (here rebuilt from `mintick`: the smallest power of 10 that makes it an\n * integer); the position on the tick grid is `|number| * pricescale / minmove`\n * - ties go away from zero, decided on the exact value of that product with a 1e-10 tolerance\n * (-1.075 -> -1.08, 1.005 -> 1.01, 2.675 -> 2.68 at mintick 0.01)\n *\n * @example\n * ```typescript\n * // Direct call with explicit mintick\n * const rounded = math.round_to_mintick(1.2345, 0.01); // Returns: 1.23\n * const rounded2 = math.round_to_mintick(1.2367, 0.01); // Returns: 1.24\n *\n * // Or use context API for cleaner syntax\n * const { math } = createContext({ syminfo: { mintick: 0.01 } });\n * const rounded = math.round_to_mintick(1.2345); // Returns: 1.23\n * ```\n */\nexport function round_to_mintick(number: Series, mintick?: float): Series;\nexport function round_to_mintick(number: float, mintick?: float): float;\nexport function round_to_mintick(number: float | Series, mintick?: float): float | Series {\n if (number instanceof Series) {\n const bars = number.bars;\n const valueArray = number.toArray();\n if (mintick === undefined) {\n throw new Error(\n 'math.round_to_mintick() requires mintick value. ' +\n 'Either pass it explicitly or use createContext({ syminfo: { mintick } }) for implicit data.'\n );\n }\n const result: number[] = [];\n for (let i = 0; i < bars.length; i++) {\n result.push(roundToTick(valueArray[i] ?? NaN, mintick));\n }\n return Series.fromArray(bars, result);\n }\n\n // Scalar case\n if (isNaN(number)) {\n return NaN;\n }\n\n if (mintick === undefined) {\n throw new Error(\n 'math.round_to_mintick() requires mintick value. ' +\n 'Either pass it explicitly or use createContext({ syminfo: { mintick } }) for implicit data.'\n );\n }\n return roundToTick(number, mintick);\n}\n\n/** `[minmove, pricescale]` of a mintick: pricescale is the smallest power of 10 (up to 1e15) giving an integer. */\nfunction tickPair(mintick: number): [number, number] | null {\n for (let k = 0; k <= 15; k++) {\n const pricescale = Number(`1e${k}`);\n const scaled = mintick * pricescale;\n const minmove = Math.round(scaled);\n if (minmove >= 1 && Math.abs(scaled - minmove) <= 1e-9 * minmove) return [minmove, pricescale];\n }\n return null;\n}\n\n/** PineScript math.round_to_mintick of one value (see `round_to_mintick`). */\nfunction roundToTick(number: number, mintick: number): number {\n if (!Number.isFinite(number)) return NaN;\n if (mintick === 0) return number;\n const pair = tickPair(mintick);\n const negative = number < 0;\n const magnitude = negative ? -number : number;\n if (pair === null) {\n // A tick that is no decimal fraction: the grid of the double mintick, ties away from zero.\n const scaled = magnitude / mintick;\n let units = Math.trunc(scaled);\n if (scaled - units >= 0.5) units++;\n return (negative ? 0 - units : units) * mintick;\n }\n const [minmove, pricescale] = pair;\n const scaled = (magnitude * pricescale) / minmove;\n let units = Math.trunc(scaled);\n const offset = scaled - units - 0.5;\n const slack = 1e-6 + scaled * 1.8e-15;\n if (-slack < offset && offset < slack) {\n const [n, d] = exactRatio(magnitude);\n const num = n * BigInt(pricescale);\n const den = d * BigInt(minmove);\n const whole = num / den;\n units = Number(whole) + (reachesTie(num, den, whole) ? 1 : 0);\n } else if (offset > 0) {\n units++;\n }\n return ((negative ? 0 - units : units) * minmove) / pricescale;\n}\n\n// Constants\nexport const pi = Math.PI;\nexport const e = Math.E;\nexport const phi = 1.618033988749895; // Golden ratio\nexport const rphi = 0.6180339887498948; // Reciprocal of golden ratio: 1 / phi\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBA,oBAAuB;AACvB,yBAA6C;AAsBtC,SAAS,IAAI,OAAuC;AACz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Script's math.* functions for mathematical operations and calculations.\n *\n * @remarks\n * All math functions in this namespace follow PineScript v6 API specifications.\n * Functions include basic arithmetic, algebraic operations, trigonometry, and combinatorics.\n *\n * Known difference: `log10`, `exp`, `log`, `pow`, `sin`, `cos`, `tan` use JavaScript's `Math`. PineScript uses\n * other algorithms, whose results differ by 1 or 2 units in the last place on part of the inputs (`log10` about 4 %,\n * `exp` about 9 %, `sin` / `cos` / `tan` about 3 %, `log` 0.4 %, `pow` 0.05 % of random inputs). This is visible\n * only when a script amplifies these tiny differences (e.g. `ma > ma[1]` on values of 1e195); `sqrt`, `atan`,\n * `asin`, `acos` are equal. A constant argument (`math.log10(2)`) is computed before the script runs, with other\n * rules: see `constant`.\n *\n * @version 6\n */\n\nimport type { float, int, simple_int, series_float } from '../types/index.js';\nimport { Series } from '../runtime/series.js';\nimport { runningSum, runningSumSeries } from '../ta/running-sum.js';\nimport { checkSumLength } from '../ta/limits.js';\n\n/**\n * Returns the absolute value of a number.\n *\n * @param value - The number or Series\n * @returns The absolute value (always non-negative)\n *\n * @remarks\n * - Returns the distance from zero on the number line\n * - |x| = x if x \u2265 0, -x if x < 0\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.abs(5) // Returns: 5\n * math.abs(-5) // Returns: 5\n * math.abs(0) // Returns: 0\n * ```\n */\nexport function abs(value: Series): Series;\nexport function abs(value: float): float;\nexport function abs(value: float | Series): float | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(Math.abs(v));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return Math.abs(value);\n}\n\n/**\n * Returns the smallest integer greater than or equal to a given number (rounds up).\n *\n * @param value - The number to round up or Series\n * @returns The ceiling value (smallest integer \u2265 value)\n *\n * @remarks\n * - Always rounds towards positive infinity\n * - For positive numbers, rounds away from zero\n * - For negative numbers, rounds towards zero\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.ceil(4.2) // Returns: 5\n * math.ceil(4.8) // Returns: 5\n * math.ceil(-4.2) // Returns: -4\n * math.ceil(5) // Returns: 5\n * ```\n */\nexport function ceil(value: Series): Series;\nexport function ceil(value: float): int;\nexport function ceil(value: float | Series): int | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(Math.ceil(v));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return Math.ceil(value);\n}\n\n/**\n * Returns the largest integer less than or equal to a given number (rounds down).\n *\n * @param value - The number to round down or Series\n * @returns The floor value (largest integer \u2264 value)\n *\n * @remarks\n * - Always rounds towards negative infinity\n * - For positive numbers, rounds towards zero\n * - For negative numbers, rounds away from zero\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.floor(4.2) // Returns: 4\n * math.floor(4.8) // Returns: 4\n * math.floor(-4.2) // Returns: -5\n * math.floor(5) // Returns: 5\n * ```\n */\nexport function floor(value: Series): Series;\nexport function floor(value: float): int;\nexport function floor(value: float | Series): int | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(Math.floor(v));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return Math.floor(value);\n}\n\n/**\n * Returns the value rounded to the nearest integer or to a specified precision.\n *\n * @param value - The number to round or Series\n * @param precision - Optional number of decimal places (default: 0)\n * @returns The rounded value\n *\n * @remarks\n * - Rounds to nearest integer by default\n * - With precision, rounds to that many decimal places\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * PineScript rules:\n * - ties go away from zero (2.5 -> 3, -2.5 -> -3, -0.5 -> -1)\n * - without a precision, or with a precision <= 0, the result is the integer rounding (1234.5678 @ -2 -> 1235)\n * - a positive precision rounds only the fraction: `int + round(frac * scale) / scale` with\n * `scale = 1 / 10^-precision` (precision above 16 acts as 16); the tie is decided on the exact value of\n * `frac * scale` with a 1e-10 tolerance (1.005 @ 2 -> 1.01, 0.285 @ 2 -> 0.29, -1.45 @ 1 -> -1.5)\n * - an infinite value gives na\n *\n * @example\n * ```typescript\n * math.round(4.2) // Returns: 4\n * math.round(4.5) // Returns: 5\n * math.round(-2.5) // Returns: -3\n * math.round(4.567, 2) // Returns: 4.57\n * math.round(1.005, 2) // Returns: 1.01\n * ```\n */\nexport function round(value: Series, precision?: int): Series;\nexport function round(value: float, precision?: int): float;\nexport function round(value: float | Series, precision?: int): float | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const result: number[] = [];\n for (let i = 0; i < bars.length; i++) {\n result.push(roundValue(valueArray[i] ?? NaN, precision));\n }\n return Series.fromArray(bars, result);\n }\n return roundValue(value, precision);\n}\n\n/** `0.5 - 1e-10` as the exact fraction TIE_HALF / TIE_SCALE: the tie threshold of round / round_to_mintick. */\nconst TIE_SCALE = 10n ** 10n;\nconst TIE_HALF = 5n * 10n ** 9n - 1n;\n/** From 2^52 up every double is an integer. */\nconst INT_LIMIT = 2 ** 52;\n\n/** Exact value of a finite double >= 0 as `[numerator, denominator]`. */\nfunction exactRatio(x: number): [bigint, bigint] {\n const view = new DataView(new ArrayBuffer(8));\n view.setFloat64(0, x);\n const hi = view.getUint32(0);\n const lo = view.getUint32(4);\n const expField = (hi >>> 20) & 0x7ff;\n let mantissa = (BigInt(hi & 0xfffff) << 32n) | BigInt(lo);\n let exp = -1074;\n if (expField !== 0) {\n mantissa |= 1n << 52n;\n exp = expField - 1075;\n }\n return exp >= 0 ? [mantissa << BigInt(exp), 1n] : [mantissa, 1n << BigInt(-exp)];\n}\n\n/** True when `num / den - units` (exact) is >= 0.5 - 1e-10. */\nfunction reachesTie(num: bigint, den: bigint, units: bigint): boolean {\n return (num - units * den) * TIE_SCALE >= TIE_HALF * den;\n}\n\n/** `10^-p`: the exact literal for an integer p (correctly rounded), Math.pow otherwise. */\nfunction tenToMinus(p: number): number {\n return Number.isInteger(p) ? Number(`1e-${p}`) : Math.pow(10, -p);\n}\n\n/** PineScript math.round of one value (see `round`). */\nfunction roundValue(value: number, precision?: number): number {\n if (!Number.isFinite(value)) return NaN;\n const negative = value < 0;\n const magnitude = negative ? -value : value;\n if (precision === undefined || Number.isNaN(precision) || precision <= 0) {\n if (magnitude >= INT_LIMIT) return value;\n let units = Math.floor(magnitude);\n if (magnitude - units >= 0.5) units++;\n return negative ? 0 - units : units;\n }\n const scale = 1 / tenToMinus(Math.min(precision, 16));\n const fraction = magnitude % 1;\n const scaled = fraction * scale;\n let units = Math.floor(scaled);\n const offset = scaled - units - 0.5;\n // Only a near-tie needs the exact product; the window covers the double's own error.\n const slack = 1e-9 + scaled * 1.8e-15;\n if (-slack < offset && offset < slack) {\n const [fn, fd] = exactRatio(fraction);\n const [sn, sd] = exactRatio(scale);\n if (reachesTie(fn * sn, fd * sd, BigInt(units))) units++;\n } else if (offset > 0) {\n units++;\n }\n const result = magnitude - fraction + units / scale;\n return negative ? 0 - result : result;\n}\n\n/** 10^16: a constant keeps 16 decimals. */\nconst CONSTANT_SCALE = 10n ** 16n;\n\n/**\n * Returns the value PineScript gives to a constant float expression (not a PineScript function).\n *\n * @param value - The result of the constant expression, computed in JavaScript (e.g. `1 / 255`)\n * @returns The value of the same expression in a PineScript script\n *\n * @remarks\n * PineScript computes a constant expression (only literals and constants: `1 / 255`, `0.1 * 3`,\n * `math.sqrt(0.1)`) before the script runs, and the value is then rounded. JavaScript cannot tell a constant from a\n * series value, so wrap the constant expressions of a script with this function.\n * - |value| >= 0.001: the exact value of the double is rounded to 16 decimals, ties to even\n * (`1 / 255` -> 0.003921568627451, `1 / 7` -> 0.1428571428571428)\n * - |value| < 0.001, na and infinities: unchanged\n * - the whole expression is computed first, then rounded once (`(1 / 7) * 7` is 1)\n * - math functions of constants use JavaScript's `Math` there: `math.constant(math.sqrt(0.1))` is the PineScript\n * value; `math.log10` of a constant is `math.log(x) / math.log(10)` there:\n * `math.constant(math.log(2) / math.log(10))` -> 0.3010299956639811\n * - the same expression with a series operand (`close / 255`) is not rounded: do not wrap it\n *\n * @example\n * ```typescript\n * // Pine: var const float i_255 = 1 / 255\n * const i_255 = math.constant(1 / 255) // 0.003921568627451 (JavaScript: 0.00392156862745098)\n * math.constant(1 / 7) // 0.1428571428571428 (JavaScript: 0.14285714285714285)\n * math.constant(1 / 3) // 0.3333333333333333 (unchanged)\n * ```\n */\nexport function constant(value: float): float {\n const magnitude = Math.abs(value);\n // from 0.5 up, 16 decimals move a double by less than half its spacing: it stays the same\n if (!(magnitude >= 1e-3 && magnitude < 0.5)) return value;\n const [num, den] = exactRatio(magnitude);\n const scaled = num * CONSTANT_SCALE;\n let units = scaled / den;\n const twiceRest = (scaled - units * den) * 2n;\n if (twiceRest > den || (twiceRest === den && (units & 1n) === 1n)) units++;\n const digits = units.toString().padStart(17, '0');\n const result = Number(`${digits.slice(0, -16)}.${digits.slice(-16)}`);\n return value < 0 ? -result : result;\n}\n\n/**\n * Returns the maximum value from the arguments.\n *\n * @param values - Variable number of values to compare (numbers or Series)\n * @returns The largest value\n *\n * @remarks\n * - Accepts any number of arguments\n * - Returns -Infinity if no arguments provided\n * - Returns NaN if any argument is NaN\n * - If any argument is a Series, returns a Series; otherwise returns a number\n *\n * @example\n * ```typescript\n * math.max(1, 2, 3) // Returns: 3\n * math.max(-1, -5, -2) // Returns: -1\n * math.max(10) // Returns: 10\n * math.max(5, 10, 3, 8) // Returns: 10\n * ```\n */\nexport function max(...values: (float | Series)[]): float | Series {\n // Check if any value is a Series\n const hasSeries = values.some(v => v instanceof Series);\n \n if (!hasSeries) {\n // All scalars - use native Math.max\n return Math.max(...(values as number[]));\n }\n \n // At least one Series - return a Series\n const firstSeries = values.find(v => v instanceof Series) as Series;\n const bars = firstSeries.bars;\n const length = bars.length;\n \n // Convert all values to arrays (scalars become constant arrays)\n const valueArrays = values.map(v => \n v instanceof Series ? v.toArray() : null\n );\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const nums = values.map((v, idx) => \n valueArrays[idx] ? valueArrays[idx]![i] ?? NaN : (v as number)\n );\n result.push(Math.max(...nums));\n }\n \n return Series.fromArray(bars, result);\n}\n\n/**\n * Returns the minimum value from the arguments.\n *\n * @param values - Variable number of values to compare (numbers or Series)\n * @returns The smallest value\n *\n * @remarks\n * - Accepts any number of arguments\n * - Returns Infinity if no arguments provided\n * - Returns NaN if any argument is NaN\n * - If any argument is a Series, returns a Series; otherwise returns a number\n *\n * @example\n * ```typescript\n * math.min(1, 2, 3) // Returns: 1\n * math.min(-1, -5, -2) // Returns: -5\n * math.min(10) // Returns: 10\n * math.min(5, 10, 3, 8) // Returns: 3\n * ```\n */\nexport function min(...values: (float | Series)[]): float | Series {\n // Check if any value is a Series\n const hasSeries = values.some(v => v instanceof Series);\n \n if (!hasSeries) {\n // All scalars - use native Math.min\n return Math.min(...(values as number[]));\n }\n \n // At least one Series - return a Series\n const firstSeries = values.find(v => v instanceof Series) as Series;\n const bars = firstSeries.bars;\n const length = bars.length;\n \n // Convert all values to arrays (scalars become constant arrays)\n const valueArrays = values.map(v => \n v instanceof Series ? v.toArray() : null\n );\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const nums = values.map((v, idx) => \n valueArrays[idx] ? valueArrays[idx]![i] ?? NaN : (v as number)\n );\n result.push(Math.min(...nums));\n }\n \n return Series.fromArray(bars, result);\n}\n\n/**\n * Returns the average (arithmetic mean) of the arguments.\n *\n * @param values - Variable number of values (numbers or Series)\n * @returns The arithmetic mean\n *\n * @remarks\n * - Calculates sum of all values divided by count\n * - Returns NaN if no arguments provided (division by zero)\n * - If any argument is a Series, returns a Series; otherwise returns a number\n * - PineScript rule: with 1 or 2 values the sum is plain; with 3 values or more it is a Kahan compensated sum whose\n * pending correction is subtracted before the division (math.avg(0.1, 0.2, 0.3) = 0.19999999999999998)\n *\n * @example\n * ```typescript\n * math.avg(1, 2, 3) // Returns: 2\n * math.avg(10, 20) // Returns: 15\n * math.avg(5) // Returns: 5\n * math.avg(1, 2, 3, 4, 5) // Returns: 3\n * ```\n */\nexport function avg(...values: (float | Series)[]): float | Series {\n // Check if any value is a Series\n const hasSeries = values.some(v => v instanceof Series);\n\n if (!hasSeries) {\n return avgOf(values as number[]);\n }\n \n // At least one Series - return a Series\n const firstSeries = values.find(v => v instanceof Series) as Series;\n const bars = firstSeries.bars;\n const length = bars.length;\n \n // Convert all values to arrays (scalars become constant arrays)\n const valueArrays = values.map(v => \n v instanceof Series ? v.toArray() : null\n );\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const nums = values.map((v, idx) => \n valueArrays[idx] ? valueArrays[idx]![i] ?? NaN : (v as number)\n );\n result.push(avgOf(nums));\n }\n\n return Series.fromArray(bars, result);\n}\n\n/** PineScript math.avg of numbers: plain sum up to 2 values, Kahan sum with the correction flushed from 3. */\nfunction avgOf(nums: number[]): number {\n if (nums.length <= 2) {\n let sum = 0;\n for (const n of nums) sum = sum + n;\n return sum / nums.length;\n }\n let sum = 0;\n let c = 0;\n for (const n of nums) {\n const y = n - c;\n const t = sum + y;\n c = t - sum - y;\n sum = t;\n }\n return (sum - c) / nums.length;\n}\n\n/**\n * Returns the sum of values over a sliding window.\n *\n * @param source - Series of values or array\n * @param length - Window length for summation, or one length per bar (a series length: array or Series)\n * @returns Series or array with rolling sum values\n *\n * @remarks\n * - Calculates the sum of the last `length` non-`na` values at each point; an `na` value (also +/-Infinity) is\n * skipped and the bar keeps the previous result (as in PineScript)\n * - Returns NaN until `length` non-`na` values are available\n * - A compensated running sum, as in PineScript, so the result can differ from the exact window sum in the last\n * bits (bit for bit with PineScript)\n * - When passed a Series, returns a Series; when passed an array, returns an array\n * - With a series length, PineScript moves the running sum to the new length when the length changes, with Kahan\n * steps of the raw values: a smaller length removes the values that leave the window (oldest first); a larger\n * length adds back the values from the one before the old window down to the one `length` values back (newest\n * first), then the usual step removes the stored value of the one `length` values back. A bar with an `na` value\n * gives the sum of the last `length` earlier values\n *\n * @example\n * ```typescript\n * math.sum([1, 2, 3, 4, 5], 3) // Returns: [NaN, NaN, 6, 9, 12]\n * // Explanation: [NaN, NaN, 1+2+3, 2+3+4, 3+4+5]\n * ```\n */\nexport function sum(source: Series, length: simple_int | ArrayLike<number> | Series): Series;\nexport function sum(source: series_float, length: simple_int | ArrayLike<number> | Series): series_float;\nexport function sum(\n source: series_float | Series,\n length: simple_int | ArrayLike<number> | Series\n): series_float | Series {\n // Handle Series objects - extract to array first\n const sourceArray = source instanceof Series ? source.toArray() : source;\n if (typeof length === 'number') checkSumLength('math.sum', length, 0);\n // PineScript: the sum of the last `length` non-na values (also +/-Infinity skipped); an na bar keeps the previous\n // result. A compensated running sum, bit for bit as PineScript.\n const result: series_float =\n typeof length === 'number'\n ? runningSum(sourceArray, length)\n : runningSumSeries(sourceArray, length instanceof Series ? length.toArray() : length, 'math.sum');\n\n // If input was a Series, return a Series\n if (source instanceof Series) {\n return Series.fromArray(source.bars, result);\n }\n\n return result;\n}\n\n/**\n * Returns the square root of a number.\n *\n * @param value - The number (must be non-negative) or Series\n * @returns The square root (\u221Avalue)\n *\n * @remarks\n * - Returns NaN for negative numbers\n * - \u221Ax \u00D7 \u221Ax = x (for non-negative x)\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.sqrt(9) // Returns: 3\n * math.sqrt(16) // Returns: 4\n * math.sqrt(2) // Returns: 1.414...\n * math.sqrt(0) // Returns: 0\n * ```\n */\nexport function sqrt(value: Series): Series;\nexport function sqrt(value: float): float;\nexport function sqrt(value: float | Series): float | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(Math.sqrt(v));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return Math.sqrt(value);\n}\n\n/**\n * Returns base raised to the power of exponent.\n *\n * @param base - The base number or Series\n * @param exponent - The exponent (power) or Series\n * @returns base^exponent\n *\n * @remarks\n * - 0^0 returns 1\n * - Negative base with fractional exponent returns NaN\n * - Any number to the power of 0 equals 1\n * - If any argument is a Series, returns a Series; if all are numbers, returns a number\n *\n * @example\n * ```typescript\n * math.pow(2, 3) // Returns: 8 (2\u00B3)\n * math.pow(10, 2) // Returns: 100\n * math.pow(5, 0) // Returns: 1\n * math.pow(2, -1) // Returns: 0.5\n * ```\n */\nexport function pow(base: Series, exponent: float): Series;\nexport function pow(base: float, exponent: Series): Series;\nexport function pow(base: Series, exponent: Series): Series;\nexport function pow(base: float, exponent: float): float;\nexport function pow(base: float | Series, exponent: float | Series): float | Series {\n const baseIsSeries = base instanceof Series;\n const expIsSeries = exponent instanceof Series;\n \n // Pure scalar case\n if (!baseIsSeries && !expIsSeries) {\n return Math.pow(base as number, exponent as number);\n }\n \n // At least one is a Series - return a Series\n const bars = baseIsSeries ? (base as Series).bars : (exponent as Series).bars;\n const baseArray = baseIsSeries ? (base as Series).toArray() : null;\n const expArray = expIsSeries ? (exponent as Series).toArray() : null;\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const b = baseArray ? baseArray[i] ?? NaN : (base as number);\n const e = expArray ? expArray[i] ?? NaN : (exponent as number);\n result.push(Math.pow(b, e));\n }\n \n return Series.fromArray(bars, result);\n}\n\n/**\n * Returns e (Euler's number) raised to the power of value.\n *\n * @param value - The exponent or Series\n * @returns e^value (where e \u2248 2.71828)\n *\n * @remarks\n * - e^0 = 1\n * - e^1 = e \u2248 2.71828\n * - Inverse of ln(x)\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.exp(0) // Returns: 1\n * math.exp(1) // Returns: 2.71828... (e)\n * math.exp(2) // Returns: 7.389...\n * math.exp(-1) // Returns: 0.3678...\n * ```\n */\nexport function exp(value: Series): Series;\nexport function exp(value: float): float;\nexport function exp(value: float | Series): float | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(Math.exp(v));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return Math.exp(value);\n}\n\n/**\n * Returns the natural logarithm (base e) of a number.\n *\n * @param value - The number (must be positive) or Series\n * @returns ln(value)\n *\n * @remarks\n * - Returns NaN for negative numbers\n * - Returns -Infinity for 0\n * - ln(e) = 1\n * - ln(1) = 0\n * - Inverse of exp(x)\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.log(1) // Returns: 0\n * math.log(Math.E) // Returns: 1\n * math.log(10) // Returns: 2.302...\n * math.log(100) // Returns: 4.605...\n * ```\n */\nexport function log(value: Series): Series;\nexport function log(value: float): float;\nexport function log(value: float | Series): float | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(Math.log(v));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return Math.log(value);\n}\n\n/**\n * Returns the base-10 logarithm of a number.\n *\n * @param value - The number (must be positive) or Series\n * @returns log\u2081\u2080(value)\n *\n * @remarks\n * - Returns NaN for negative numbers\n * - Returns -Infinity for 0\n * - log\u2081\u2080(10) = 1\n * - log\u2081\u2080(100) = 2\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.log10(10) // Returns: 1\n * math.log10(100) // Returns: 2\n * math.log10(1000) // Returns: 3\n * math.log10(1) // Returns: 0\n * ```\n */\nexport function log10(value: Series): Series;\nexport function log10(value: float): float;\nexport function log10(value: float | Series): float | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(Math.log10(v));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return Math.log10(value);\n}\n\n/**\n * Returns the sine of an angle in radians.\n *\n * @param value - The angle in radians or Series\n * @returns The sine value (range: [-1, 1])\n *\n * @remarks\n * - Input is in radians, not degrees\n * - sin(0) = 0\n * - sin(\u03C0/2) = 1\n * - Periodic with period 2\u03C0\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.sin(0) // Returns: 0\n * math.sin(Math.PI / 2) // Returns: 1\n * math.sin(Math.PI) // Returns: 0 (approximately)\n * math.sin(Math.PI / 6) // Returns: 0.5\n * ```\n */\nexport function sin(value: Series): Series;\nexport function sin(value: float): float;\nexport function sin(value: float | Series): float | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(Math.sin(v));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return Math.sin(value);\n}\n\n/**\n * Returns the cosine of an angle in radians.\n *\n * @param value - The angle in radians or Series\n * @returns The cosine value (range: [-1, 1])\n *\n * @remarks\n * - Input is in radians, not degrees\n * - cos(0) = 1\n * - cos(\u03C0/2) = 0\n * - Periodic with period 2\u03C0\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.cos(0) // Returns: 1\n * math.cos(Math.PI / 2) // Returns: 0 (approximately)\n * math.cos(Math.PI) // Returns: -1\n * math.cos(Math.PI / 3) // Returns: 0.5\n * ```\n */\nexport function cos(value: Series): Series;\nexport function cos(value: float): float;\nexport function cos(value: float | Series): float | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(Math.cos(v));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return Math.cos(value);\n}\n\n/**\n * Returns the tangent of an angle in radians.\n *\n * @param value - The angle in radians or Series\n * @returns The tangent value\n *\n * @remarks\n * - Input is in radians, not degrees\n * - tan(x) = sin(x) / cos(x)\n * - Undefined at \u03C0/2, 3\u03C0/2, etc. (returns very large numbers)\n * - Periodic with period \u03C0\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.tan(0) // Returns: 0\n * math.tan(Math.PI / 4) // Returns: 1\n * math.tan(Math.PI / 6) // Returns: 0.577... (1/\u221A3)\n * ```\n */\nexport function tan(value: Series): Series;\nexport function tan(value: float): float;\nexport function tan(value: float | Series): float | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(Math.tan(v));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return Math.tan(value);\n}\n\n/**\n * Returns the arcsine (inverse sine) of a number.\n *\n * @param value - The value (must be in range [-1, 1]) or Series\n * @returns The angle in radians (range: [-\u03C0/2, \u03C0/2])\n *\n * @remarks\n * - Returns NaN for values outside [-1, 1]\n * - asin(sin(x)) = x for x in [-\u03C0/2, \u03C0/2]\n * - asin(0) = 0\n * - asin(1) = \u03C0/2\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.asin(0) // Returns: 0\n * math.asin(1) // Returns: 1.5707... (\u03C0/2)\n * math.asin(0.5) // Returns: 0.5235... (\u03C0/6)\n * math.asin(-1) // Returns: -1.5707... (-\u03C0/2)\n * ```\n */\nexport function asin(value: Series): Series;\nexport function asin(value: float): float;\nexport function asin(value: float | Series): float | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(Math.asin(v));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return Math.asin(value);\n}\n\n/**\n * Returns the arccosine (inverse cosine) of a number.\n *\n * @param value - The value (must be in range [-1, 1]) or Series\n * @returns The angle in radians (range: [0, \u03C0])\n *\n * @remarks\n * - Returns NaN for values outside [-1, 1]\n * - acos(cos(x)) = x for x in [0, \u03C0]\n * - acos(1) = 0\n * - acos(0) = \u03C0/2\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.acos(1) // Returns: 0\n * math.acos(0) // Returns: 1.5707... (\u03C0/2)\n * math.acos(0.5) // Returns: 1.0471... (\u03C0/3)\n * math.acos(-1) // Returns: 3.1415... (\u03C0)\n * ```\n */\nexport function acos(value: Series): Series;\nexport function acos(value: float): float;\nexport function acos(value: float | Series): float | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(Math.acos(v));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return Math.acos(value);\n}\n\n/**\n * Returns the arctangent (inverse tangent) of a number.\n *\n * @param value - The value or Series\n * @returns The angle in radians (range: [-\u03C0/2, \u03C0/2])\n *\n * @remarks\n * - Accepts any number as input\n * - atan(tan(x)) = x for x in [-\u03C0/2, \u03C0/2]\n * - atan(0) = 0\n * - atan(1) = \u03C0/4\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.atan(0) // Returns: 0\n * math.atan(1) // Returns: 0.7853... (\u03C0/4)\n * math.atan(-1) // Returns: -0.7853... (-\u03C0/4)\n * math.atan(Infinity) // Returns: 1.5707... (\u03C0/2)\n * ```\n */\nexport function atan(value: Series): Series;\nexport function atan(value: float): float;\nexport function atan(value: float | Series): float | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(Math.atan(v));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return Math.atan(value);\n}\n\n/**\n * Converts an angle from degrees to radians.\n *\n * @param degrees - The angle in degrees or Series\n * @returns The angle in radians\n *\n * @remarks\n * - Radians = Degrees \u00D7 (\u03C0 / 180)\n * - One full rotation: 360\u00B0 = 2\u03C0 radians\n * - Common conversions: 90\u00B0 = \u03C0/2, 180\u00B0 = \u03C0, 270\u00B0 = 3\u03C0/2\n * - If degrees is a Series, returns a Series; if degrees is a number, returns a number\n *\n * @example\n * ```typescript\n * math.toradians(0) // Returns: 0\n * math.toradians(90) // Returns: 1.5707... (\u03C0/2)\n * math.toradians(180) // Returns: 3.1415... (\u03C0)\n * math.toradians(360) // Returns: 6.2831... (2\u03C0)\n * ```\n */\nexport function toradians(degrees: Series): Series;\nexport function toradians(degrees: float): float;\nexport function toradians(degrees: float | Series): float | Series {\n if (degrees instanceof Series) {\n const bars = degrees.bars;\n const valueArray = degrees.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(v * (Math.PI / 180));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return degrees * (Math.PI / 180);\n}\n\n/**\n * Converts an angle from radians to degrees.\n *\n * @param radians - The angle in radians or Series\n * @returns The angle in degrees\n *\n * @remarks\n * - Degrees = Radians \u00D7 (180 / \u03C0)\n * - One full rotation: 2\u03C0 radians = 360\u00B0\n * - Common conversions: \u03C0/2 = 90\u00B0, \u03C0 = 180\u00B0, 3\u03C0/2 = 270\u00B0\n * - If radians is a Series, returns a Series; if radians is a number, returns a number\n *\n * @example\n * ```typescript\n * math.todegrees(0) // Returns: 0\n * math.todegrees(Math.PI / 2) // Returns: 90\n * math.todegrees(Math.PI) // Returns: 180\n * math.todegrees(2 * Math.PI) // Returns: 360\n * ```\n */\nexport function todegrees(radians: Series): Series;\nexport function todegrees(radians: float): float;\nexport function todegrees(radians: float | Series): float | Series {\n if (radians instanceof Series) {\n const bars = radians.bars;\n const valueArray = radians.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(v * (180 / Math.PI));\n }\n \n return Series.fromArray(bars, result);\n }\n \n return radians * (180 / Math.PI);\n}\n\n/**\n * PineScript's seeded generator: Java's linear congruential generator (`java.util.Random`), `nextDouble()`.\n * Each generator draws one number per call.\n */\nexport function seededRandom(seed: int): (min?: float, max?: float) => float {\n const mask = (1n << 48n) - 1n;\n let state = (BigInt(Math.trunc(seed)) ^ 0x5deece66dn) & mask;\n const next = (bits: bigint): bigint => {\n state = (0x5deece66dn * state + 11n) & mask;\n return state >> (48n - bits);\n };\n return (min = 0, max = 1) => {\n const hi = next(26n);\n const lo = next(27n);\n const unit = Number((hi << 27n) + lo) / 2 ** 53;\n return min + unit * (max - min);\n };\n}\n\nconst seeded = new Map<number, (min?: float, max?: float) => float>();\n\n/** Starts every seeded sequence of `math.random` again (called at the start of a script run). */\nexport function resetRandom(): void {\n seeded.clear();\n}\n\n/**\n * Returns a pseudo-random number.\n *\n * @param min - Optional minimum value (inclusive), default 0\n * @param max - Optional maximum value (exclusive), default 1\n * @param seed - Optional seed: a repeatable sequence, as PineScript (Java's `java.util.Random`)\n * @returns A random number in the specified range, or [0, 1) if no range specified\n *\n * @remarks\n * - Without a seed: `Math.random()`\n * - With a seed: PineScript's sequence, one number per call (measured: the call on each bar draws the next number\n * of `new java.util.Random(seed).nextDouble()` from the first bar of the history). PineScript keeps one generator\n * per call site; here there is one generator per seed value (started again by `executeScript`): for two call sites\n * with the same seed use `callsite.random(seed)`\n *\n * @example\n * ```typescript\n * math.random() // Returns: value between 0 and 1 (e.g., 0.234...)\n * math.random(0, 10) // Returns: value between 0 and 10 (e.g., 7.45...)\n * math.random(0, 1, 42) // Returns: 0.7275636800328681 on the first call, as PineScript\n * ```\n */\nexport function random(min?: float, max?: float, seed?: int): float {\n if (seed !== undefined && seed !== null && !Number.isNaN(seed)) {\n let gen = seeded.get(seed);\n if (!gen) {\n gen = seededRandom(seed);\n seeded.set(seed, gen);\n }\n return gen(min ?? 0, max ?? 1);\n }\n const rand = Math.random();\n if (min !== undefined && max !== undefined) {\n return min + rand * (max - min);\n }\n return rand;\n}\n\n/**\n * Returns the sign of a number.\n *\n * @param value - The number to check or Series\n * @returns 1 for positive, -1 for negative, 0 for zero, na for na\n *\n * @remarks\n * - Returns 1 if value > 0\n * - Returns -1 if value < 0\n * - Returns 0 if value = 0\n * - Returns na if value is na (as PineScript)\n * - Useful for determining direction or polarity\n * - If value is a Series, returns a Series; if value is a number, returns a number\n *\n * @example\n * ```typescript\n * math.sign(5) // Returns: 1\n * math.sign(-3) // Returns: -1\n * math.sign(0) // Returns: 0\n * math.sign(0.001) // Returns: 1\n * math.sign(NaN) // Returns: NaN\n * ```\n */\nexport function sign(value: Series): Series;\nexport function sign(value: float): int;\nexport function sign(value: float | Series): int | Series {\n if (value instanceof Series) {\n const bars = value.bars;\n const valueArray = value.toArray();\n const length = bars.length;\n \n const result: number[] = [];\n for (let i = 0; i < length; i++) {\n const v = valueArray[i] ?? NaN;\n result.push(v > 0 ? 1 : v < 0 ? -1 : v === 0 ? 0 : NaN);\n }\n \n return Series.fromArray(bars, result);\n }\n \n return value > 0 ? 1 : value < 0 ? -1 : value === 0 ? 0 : NaN;\n}\n\n/**\n * Rounds a value to the nearest mintick.\n *\n * @param number - The number to round or Series\n * @param mintick - Optional mintick value (defaults to requiring syminfo context)\n * @returns The number rounded to tick precision\n *\n * @remarks\n * - **PineScript v6 signature**: `math.round_to_mintick(number)` - uses implicit syminfo.mintick\n * - **JavaScript signature**: Requires explicit `mintick` OR use `createContext()` with syminfo\n * - Rounds to the nearest value divisible by mintick\n * - Returns NaN for NaN input\n * - If number is a Series, returns a Series; if number is a float, returns a float\n *\n * PineScript rules:\n * - mintick is `minmove / pricescale` (here rebuilt from `mintick`: the smallest power of 10 that makes it an\n * integer); the position on the tick grid is `|number| * pricescale / minmove`\n * - ties go away from zero, decided on the exact value of that product with a 1e-10 tolerance\n * (-1.075 -> -1.08, 1.005 -> 1.01, 2.675 -> 2.68 at mintick 0.01)\n *\n * @example\n * ```typescript\n * // Direct call with explicit mintick\n * const rounded = math.round_to_mintick(1.2345, 0.01); // Returns: 1.23\n * const rounded2 = math.round_to_mintick(1.2367, 0.01); // Returns: 1.24\n *\n * // Or use context API for cleaner syntax\n * const { math } = createContext({ syminfo: { mintick: 0.01 } });\n * const rounded = math.round_to_mintick(1.2345); // Returns: 1.23\n * ```\n */\nexport function round_to_mintick(number: Series, mintick?: float): Series;\nexport function round_to_mintick(number: float, mintick?: float): float;\nexport function round_to_mintick(number: float | Series, mintick?: float): float | Series {\n if (number instanceof Series) {\n const bars = number.bars;\n const valueArray = number.toArray();\n if (mintick === undefined) {\n throw new Error(\n 'math.round_to_mintick() requires mintick value. ' +\n 'Either pass it explicitly or use createContext({ syminfo: { mintick } }) for implicit data.'\n );\n }\n const result: number[] = [];\n for (let i = 0; i < bars.length; i++) {\n result.push(roundToTick(valueArray[i] ?? NaN, mintick));\n }\n return Series.fromArray(bars, result);\n }\n\n // Scalar case\n if (isNaN(number)) {\n return NaN;\n }\n\n if (mintick === undefined) {\n throw new Error(\n 'math.round_to_mintick() requires mintick value. ' +\n 'Either pass it explicitly or use createContext({ syminfo: { mintick } }) for implicit data.'\n );\n }\n return roundToTick(number, mintick);\n}\n\n/** `[minmove, pricescale]` of a mintick: pricescale is the smallest power of 10 (up to 1e15) giving an integer. */\nfunction tickPair(mintick: number): [number, number] | null {\n for (let k = 0; k <= 15; k++) {\n const pricescale = Number(`1e${k}`);\n const scaled = mintick * pricescale;\n const minmove = Math.round(scaled);\n if (minmove >= 1 && Math.abs(scaled - minmove) <= 1e-9 * minmove) return [minmove, pricescale];\n }\n return null;\n}\n\n/** PineScript math.round_to_mintick of one value (see `round_to_mintick`). */\nfunction roundToTick(number: number, mintick: number): number {\n if (!Number.isFinite(number)) return NaN;\n if (mintick === 0) return number;\n const pair = tickPair(mintick);\n const negative = number < 0;\n const magnitude = negative ? -number : number;\n if (pair === null) {\n // A tick that is no decimal fraction: the grid of the double mintick, ties away from zero.\n const scaled = magnitude / mintick;\n let units = Math.trunc(scaled);\n if (scaled - units >= 0.5) units++;\n return (negative ? 0 - units : units) * mintick;\n }\n const [minmove, pricescale] = pair;\n const scaled = (magnitude * pricescale) / minmove;\n let units = Math.trunc(scaled);\n const offset = scaled - units - 0.5;\n const slack = 1e-6 + scaled * 1.8e-15;\n if (-slack < offset && offset < slack) {\n const [n, d] = exactRatio(magnitude);\n const num = n * BigInt(pricescale);\n const den = d * BigInt(minmove);\n const whole = num / den;\n units = Number(whole) + (reachesTie(num, den, whole) ? 1 : 0);\n } else if (offset > 0) {\n units++;\n }\n return ((negative ? 0 - units : units) * minmove) / pricescale;\n}\n\n// Constants\nexport const pi = Math.PI;\nexport const e = Math.E;\nexport const phi = 1.618033988749895; // Golden ratio\nexport const rphi = 0.6180339887498948; // Reciprocal of golden ratio: 1 / phi\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBA,oBAAuB;AACvB,yBAA6C;AAC7C,oBAA+B;AAsBxB,SAAS,IAAI,OAAuC;AACzD,MAAI,iBAAiB,sBAAQ;AAC3B,UAAM,OAAO,MAAM;AACnB,UAAM,aAAa,MAAM,QAAQ;AACjC,UAAM,SAAS,KAAK;AAEpB,UAAM,SAAmB,CAAC;AAC1B,aAAS,IAAI,GAAG,IAAI,QAAQ,KAAK;AAC/B,YAAM,IAAI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BAAgB,OAAO,IAAI,SAAS,QAAQ,EAAE,CAE7C;AAED;;GAEG;AACH,wBAAgB,GAAG,IAAI,QAAQ,EAAE,CAEhC;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAEhC;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC;AAGD,OAAO,EAAE,YAAY,IAAI,GAAG,EAAE,CAAC;AAC/B,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,CAAC"}
|
|
@@ -38,6 +38,9 @@ function new_polyline(points, curved = false, closed = false, xloc = "bar_index"
|
|
|
38
38
|
console.warn("polyline.new(): line_width must be at least 1. Using 1.");
|
|
39
39
|
line_width = 1;
|
|
40
40
|
}
|
|
41
|
+
if (xloc === "bar_index") {
|
|
42
|
+
for (const point of points) if (point.index !== null) (0, import_registry.checkBarIndex)("polyline.new", "points", point.index, xloc);
|
|
43
|
+
}
|
|
41
44
|
const polyline = {
|
|
42
45
|
id: generateId(),
|
|
43
46
|
points: [...points],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/polyline/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Polyline namespace\n * Functions for creating and manipulating polyline drawing objects.\n *\n * @remarks\n * Polylines allow connecting multiple points with line segments, enabling complex chart drawings\n * like trend channels, patterns, and custom shapes. The `curved` flag goes to the renderer\n * (`result.polylines` of the script API), which draws the curve.\n *\n * @version 6\n */\n\nimport type { ChartPoint, Polyline, color } from '../types/index.js';\nimport { all as allDrawings, register, remove } from '../drawing/registry.js';\n\n// Re-export the Polyline type for convenience\nexport type { Polyline };\n\n// Internal counter for generating unique IDs\nlet polylineIdCounter = 0;\n\n/**\n * Generates a unique ID for a polyline\n */\nfunction generateId(): string {\n return `polyline_${++polylineIdCounter}`;\n}\n\n/**\n * Creates a new polyline connecting all points.\n *\n * @param points - Array of chart.point objects to connect\n * @param curved - If true, use curved line segments (default: false)\n * @param closed - If true, connect first point to last point (default: false)\n * @param xloc - X-coordinate mode: 'bar_index' or 'bar_time' (default: 'bar_index')\n * @param line_color - Color of line segments (default: '#2196F3' - blue)\n * @param fill_color - Fill color for closed polylines (default: null)\n * @param line_style - Line style (default: 'solid')\n * @param line_width - Line width in pixels (default: 1)\n * @param force_overlay - Force display on main pane (default: false)\n * @returns New Polyline object\n *\n * @remarks\n * - For meaningful polylines, provide at least 2 points.\n * - Closed polylines can be filled with a color by setting fill_color.\n *\n * @example\n * ```typescript\n * import { chartPoint, polyline } from 'oakscriptjs';\n *\n * // Create points\n * const points = [\n * chartPoint.from_index(0, 100),\n * chartPoint.from_index(10, 120),\n * chartPoint.from_index(20, 110)\n * ];\n *\n * // Create a basic polyline\n * const myPolyline = polyline.new(points);\n *\n * // Create a closed polygon with fill\n * const polygon = polyline.new(\n * points,\n * false, // curved\n * true, // closed\n * 'bar_index', // xloc\n * '#FF5722', // line_color\n * 'rgba(255, 87, 34, 0.3)' // fill_color\n * );\n * ```\n */\nexport function new_polyline(\n points: ChartPoint[],\n curved: boolean = false,\n closed: boolean = false,\n xloc: 'bar_index' | 'bar_time' = 'bar_index',\n line_color: color = '#2196F3',\n fill_color: color | null = null,\n line_style: 'solid' | 'dotted' | 'dashed' = 'solid',\n line_width: number = 1,\n force_overlay: boolean = false\n): Polyline {\n // Validate line_width is positive\n if (line_width < 1) {\n console.warn('polyline.new(): line_width must be at least 1. Using 1.');\n line_width = 1;\n }\n\n const polyline: Polyline = {\n id: generateId(),\n points: [...points], // Create a copy of the points array\n curved,\n closed,\n xloc,\n line_color,\n fill_color,\n line_style,\n line_width,\n force_overlay,\n };\n\n return register('polyline', polyline);\n}\n\n/**\n * Deletes a polyline.\n *\n * @param id - Polyline object to delete\n *\n * @remarks\n * Removes the polyline from `polyline.all()` (the drawing registry, see drawing/registry).\n *\n * @example\n * ```typescript\n * const myPolyline = polyline.new(points);\n * polyline.delete(myPolyline);\n * ```\n */\nexport function delete_polyline(id: Polyline): void {\n remove('polyline', id);\n}\n\n/**\n * Gets all active polylines.\n *\n * @returns Array of all active polylines\n *\n * @remarks\n * Returns a copy of the internal polylines array to prevent external modification.\n *\n * @example\n * ```typescript\n * console.log('Total polylines:', polyline.all.length);\n *\n * for (const p of polyline.all) {\n * console.log('Polyline ID:', p.id, 'Points:', p.points.length);\n * }\n * ```\n */\nexport function get_all(): readonly Polyline[] {\n return allDrawings('polyline');\n}\n\n/**\n * All live polylines, in creation order (PineScript `polyline.all`). A new array.\n */\nexport function all(): Polyline[] {\n return allDrawings('polyline');\n}\n\n/**\n * Deletes all polylines.\n *\n * @remarks\n * This is useful for resetting state, especially in tests.\n * Not part of the PineScript API.\n */\nexport function clear_all(): void {\n for (const p of allDrawings('polyline')) remove('polyline', p);\n}\n\n/**\n * Resets the polyline ID counter.\n *\n * @remarks\n * This is useful for resetting state, especially in tests.\n * Not part of the PineScript API.\n */\nexport function reset_id_counter(): void {\n polylineIdCounter = 0;\n}\n\n// Aliases to match PineScript API\nexport { new_polyline as new };\nexport { delete_polyline as delete };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA,
|
|
4
|
+
"sourcesContent": ["/**\n * Polyline namespace\n * Functions for creating and manipulating polyline drawing objects.\n *\n * @remarks\n * Polylines allow connecting multiple points with line segments, enabling complex chart drawings\n * like trend channels, patterns, and custom shapes. The `curved` flag goes to the renderer\n * (`result.polylines` of the script API), which draws the curve.\n *\n * @version 6\n */\n\nimport type { ChartPoint, Polyline, color } from '../types/index.js';\nimport { all as allDrawings, checkBarIndex, register, remove } from '../drawing/registry.js';\n\n// Re-export the Polyline type for convenience\nexport type { Polyline };\n\n// Internal counter for generating unique IDs\nlet polylineIdCounter = 0;\n\n/**\n * Generates a unique ID for a polyline\n */\nfunction generateId(): string {\n return `polyline_${++polylineIdCounter}`;\n}\n\n/**\n * Creates a new polyline connecting all points.\n *\n * @param points - Array of chart.point objects to connect\n * @param curved - If true, use curved line segments (default: false)\n * @param closed - If true, connect first point to last point (default: false)\n * @param xloc - X-coordinate mode: 'bar_index' or 'bar_time' (default: 'bar_index')\n * @param line_color - Color of line segments (default: '#2196F3' - blue)\n * @param fill_color - Fill color for closed polylines (default: null)\n * @param line_style - Line style (default: 'solid')\n * @param line_width - Line width in pixels (default: 1)\n * @param force_overlay - Force display on main pane (default: false)\n * @returns New Polyline object\n *\n * @remarks\n * - For meaningful polylines, provide at least 2 points.\n * - Closed polylines can be filled with a color by setting fill_color.\n *\n * @example\n * ```typescript\n * import { chartPoint, polyline } from 'oakscriptjs';\n *\n * // Create points\n * const points = [\n * chartPoint.from_index(0, 100),\n * chartPoint.from_index(10, 120),\n * chartPoint.from_index(20, 110)\n * ];\n *\n * // Create a basic polyline\n * const myPolyline = polyline.new(points);\n *\n * // Create a closed polygon with fill\n * const polygon = polyline.new(\n * points,\n * false, // curved\n * true, // closed\n * 'bar_index', // xloc\n * '#FF5722', // line_color\n * 'rgba(255, 87, 34, 0.3)' // fill_color\n * );\n * ```\n */\nexport function new_polyline(\n points: ChartPoint[],\n curved: boolean = false,\n closed: boolean = false,\n xloc: 'bar_index' | 'bar_time' = 'bar_index',\n line_color: color = '#2196F3',\n fill_color: color | null = null,\n line_style: 'solid' | 'dotted' | 'dashed' = 'solid',\n line_width: number = 1,\n force_overlay: boolean = false\n): Polyline {\n // Validate line_width is positive\n if (line_width < 1) {\n console.warn('polyline.new(): line_width must be at least 1. Using 1.');\n line_width = 1;\n }\n\n if (xloc === 'bar_index') for (const point of points) if (point.index !== null) checkBarIndex('polyline.new', 'points', point.index, xloc);\n\n const polyline: Polyline = {\n id: generateId(),\n points: [...points], // Create a copy of the points array\n curved,\n closed,\n xloc,\n line_color,\n fill_color,\n line_style,\n line_width,\n force_overlay,\n };\n\n return register('polyline', polyline);\n}\n\n/**\n * Deletes a polyline.\n *\n * @param id - Polyline object to delete\n *\n * @remarks\n * Removes the polyline from `polyline.all()` (the drawing registry, see drawing/registry).\n *\n * @example\n * ```typescript\n * const myPolyline = polyline.new(points);\n * polyline.delete(myPolyline);\n * ```\n */\nexport function delete_polyline(id: Polyline): void {\n remove('polyline', id);\n}\n\n/**\n * Gets all active polylines.\n *\n * @returns Array of all active polylines\n *\n * @remarks\n * Returns a copy of the internal polylines array to prevent external modification.\n *\n * @example\n * ```typescript\n * console.log('Total polylines:', polyline.all.length);\n *\n * for (const p of polyline.all) {\n * console.log('Polyline ID:', p.id, 'Points:', p.points.length);\n * }\n * ```\n */\nexport function get_all(): readonly Polyline[] {\n return allDrawings('polyline');\n}\n\n/**\n * All live polylines, in creation order (PineScript `polyline.all`). A new array.\n */\nexport function all(): Polyline[] {\n return allDrawings('polyline');\n}\n\n/**\n * Deletes all polylines.\n *\n * @remarks\n * This is useful for resetting state, especially in tests.\n * Not part of the PineScript API.\n */\nexport function clear_all(): void {\n for (const p of allDrawings('polyline')) remove('polyline', p);\n}\n\n/**\n * Resets the polyline ID counter.\n *\n * @remarks\n * This is useful for resetting state, especially in tests.\n * Not part of the PineScript API.\n */\nexport function reset_id_counter(): void {\n polylineIdCounter = 0;\n}\n\n// Aliases to match PineScript API\nexport { new_polyline as new };\nexport { delete_polyline as delete };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA,sBAAoE;AAMpE,IAAI,oBAAoB;AAKxB,SAAS,aAAqB;AAC5B,SAAO,YAAY,EAAE,iBAAiB;AACxC;AA6CO,SAAS,aACd,QACA,SAAkB,OAClB,SAAkB,OAClB,OAAiC,aACjC,aAAoB,WACpB,aAA2B,MAC3B,aAA4C,SAC5C,aAAqB,GACrB,gBAAyB,OACf;AAEV,MAAI,aAAa,GAAG;AAClB,YAAQ,KAAK,yDAAyD;AACtE,iBAAa;AAAA,EACf;AAEA,MAAI,SAAS;AAAa,eAAW,SAAS,OAAQ,KAAI,MAAM,UAAU,KAAM,oCAAc,gBAAgB,UAAU,MAAM,OAAO,IAAI;AAAA;AAEzI,QAAM,WAAqB;AAAA,IACzB,IAAI,WAAW;AAAA,IACf,QAAQ,CAAC,GAAG,MAAM;AAAA;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,aAAO,0BAAS,YAAY,QAAQ;AACtC;AAgBO,SAAS,gBAAgB,IAAoB;AAClD,8BAAO,YAAY,EAAE;AACvB;AAmBO,SAAS,UAA+B;AAC7C,aAAO,gBAAAA,KAAY,UAAU;AAC/B;AAKO,SAAS,MAAkB;AAChC,aAAO,gBAAAA,KAAY,UAAU;AAC/B;AASO,SAAS,YAAkB;AAChC,aAAW,SAAK,gBAAAA,KAAY,UAAU,EAAG,6BAAO,YAAY,CAAC;AAC/D;AASO,SAAS,mBAAyB;AACvC,sBAAoB;AACtB;",
|
|
6
6
|
"names": ["allDrawings"]
|
|
7
7
|
}
|
|
@@ -47,6 +47,7 @@ import * as polylineCore from '../polyline/index.js';
|
|
|
47
47
|
import * as tableCore from '../table/index.js';
|
|
48
48
|
import * as chartPointCore from '../chartpoint/index.js';
|
|
49
49
|
import * as mathCore from '../math/index.js';
|
|
50
|
+
export { holdDrawing, releaseDrawing, varDrawing, type DrawingVariable } from '../drawing/registry.js';
|
|
50
51
|
import * as timeframeCore from '../timeframe/index.js';
|
|
51
52
|
import * as strCore from '../str/index.js';
|
|
52
53
|
import { type SessionSpec } from '../session/calendar.js';
|
|
@@ -199,15 +200,16 @@ export declare const ta: {
|
|
|
199
200
|
kcw: (source: Series, length?: number, mult?: number, useTrueRange?: boolean) => Series;
|
|
200
201
|
ichimoku: (conversionPeriods: number, basePeriods: number, laggingSpan2Periods: number, displacement: number) => [Series, Series, Series, Series, Series];
|
|
201
202
|
/** `ta.highest(source, length)` or `ta.highest(length)` (source = high). */
|
|
202
|
-
highest: (sourceOrLength: Series | number, length?: number) => Series;
|
|
203
|
+
highest: (sourceOrLength: Series | number, length?: number | Series) => Series;
|
|
203
204
|
/** `ta.lowest(source, length)` or `ta.lowest(length)` (source = low). */
|
|
204
|
-
lowest: (sourceOrLength: Series | number, length?: number) => Series;
|
|
205
|
+
lowest: (sourceOrLength: Series | number, length?: number | Series) => Series;
|
|
205
206
|
/** `ta.highestbars(source, length)` or `ta.highestbars(length)` (source = high); offsets are 0 or negative. */
|
|
206
|
-
highestbars: (sourceOrLength: Series | number, length?: number) => Series;
|
|
207
|
+
highestbars: (sourceOrLength: Series | number, length?: number | Series) => Series;
|
|
207
208
|
/** `ta.lowestbars(source, length)` or `ta.lowestbars(length)` (source = low); offsets are 0 or negative. */
|
|
208
|
-
lowestbars: (sourceOrLength: Series | number, length?: number) => Series;
|
|
209
|
+
lowestbars: (sourceOrLength: Series | number, length?: number | Series) => Series;
|
|
209
210
|
/** `ta.vwap(source, anchor?, stdev_mult?)` with the chart volume; the default anchor is a new trading
|
|
210
|
-
* day (`timeframe.change("1D")`), which needs the chart context (timeframe, time zone, session)
|
|
211
|
+
* day (`timeframe.change("1D")`), which needs the chart context (timeframe, time zone, session), and the
|
|
212
|
+
* first bar: as in PineScript, the first loaded bars (a day in progress) have a value. */
|
|
211
213
|
vwap: {
|
|
212
214
|
(source: Series, anchor?: Series): Series;
|
|
213
215
|
(source: Series, anchor: Series | undefined, stdev_mult: number): [Series, Series, Series];
|
|
@@ -216,9 +218,9 @@ export declare const ta: {
|
|
|
216
218
|
mfi: (source: Series, length: number) => Series;
|
|
217
219
|
/** `ta.pivothigh(source, leftbars, rightbars)` or `ta.pivothigh(leftbars, rightbars)` (source = high).
|
|
218
220
|
* The value appears `rightbars` bars after the pivot bar, as in PineScript. */
|
|
219
|
-
pivothigh: (sourceOrLeft: Series | number, leftOrRight: number, rightbars?: number) => Series;
|
|
221
|
+
pivothigh: (sourceOrLeft: Series | number, leftOrRight: number | Series, rightbars?: number | Series) => Series;
|
|
220
222
|
/** `ta.pivotlow(source, leftbars, rightbars)` or `ta.pivotlow(leftbars, rightbars)` (source = low). */
|
|
221
|
-
pivotlow: (sourceOrLeft: Series | number, leftOrRight: number, rightbars?: number) => Series;
|
|
223
|
+
pivotlow: (sourceOrLeft: Series | number, leftOrRight: number | Series, rightbars?: number | Series) => Series;
|
|
222
224
|
obv: Series;
|
|
223
225
|
pvt: Series;
|
|
224
226
|
accdist: Series;
|
|
@@ -229,7 +231,7 @@ export declare const ta: {
|
|
|
229
231
|
wvad: Series;
|
|
230
232
|
sma(source: Series, length: number | Series): Series;
|
|
231
233
|
ema(source: Series, length: number): Series;
|
|
232
|
-
wma(source: Series, length: number): Series;
|
|
234
|
+
wma(source: Series, length: number | Series): Series;
|
|
233
235
|
rma(source: Series, length: number): Series;
|
|
234
236
|
rsi(source: Series, length: number): Series;
|
|
235
237
|
macd(source: Series, fastLength: number, slowLength: number, signalLength: number): [Series, Series, Series];
|
|
@@ -653,6 +655,16 @@ export interface ChartContext {
|
|
|
653
655
|
pointvalue?: number;
|
|
654
656
|
/** Smallest tradable quantity (PineScript `syminfo.mincontract`); 1 for whole shares */
|
|
655
657
|
mincontract?: number;
|
|
658
|
+
/** Symbol type (PineScript `syminfo.type`): "stock", "crypto", "forex", "futures", "index", "fund"... */
|
|
659
|
+
symbolType?: string;
|
|
660
|
+
/** Currency of the symbol (PineScript `syminfo.currency`), e.g. "USD" */
|
|
661
|
+
currency?: string;
|
|
662
|
+
/** Chart foreground colour (PineScript `chart.fg_color`), e.g. "#DBDBDB" on a dark chart */
|
|
663
|
+
foregroundColor?: string;
|
|
664
|
+
/** Chart background colour (PineScript `chart.bg_color`), e.g. "#0F0F0F" on a dark chart */
|
|
665
|
+
backgroundColor?: string;
|
|
666
|
+
/** Current time in ms (PineScript `timenow`); default: the clock of the computer at the start of the run */
|
|
667
|
+
now?: number;
|
|
656
668
|
/**
|
|
657
669
|
* The last bar is closed (`barstate.isconfirmed` on the last bar). Default false: PineScript treats the last bar
|
|
658
670
|
* of the data as not confirmed until the data feed closes it.
|
|
@@ -688,7 +700,8 @@ export declare const timeframe: {
|
|
|
688
700
|
};
|
|
689
701
|
/**
|
|
690
702
|
* PineScript `syminfo.timezone`, `syminfo.tickerid`, `syminfo.session` (session type), `syminfo.mintick`,
|
|
691
|
-
* `syminfo.minmove`, `syminfo.pricescale`, `syminfo.pointvalue
|
|
703
|
+
* `syminfo.minmove`, `syminfo.pricescale`, `syminfo.pointvalue`, `syminfo.mincontract`, `syminfo.type` and
|
|
704
|
+
* `syminfo.currency`, from the chart context.
|
|
692
705
|
*/
|
|
693
706
|
export declare const syminfo: {
|
|
694
707
|
readonly mintick: number;
|
|
@@ -699,6 +712,8 @@ export declare const syminfo: {
|
|
|
699
712
|
readonly timezone: string;
|
|
700
713
|
readonly tickerid: string;
|
|
701
714
|
readonly session: string;
|
|
715
|
+
readonly type: string;
|
|
716
|
+
readonly currency: string;
|
|
702
717
|
};
|
|
703
718
|
/** A calendar function: `(time, timezone?)` on a UNIX time or on a Series of times. */
|
|
704
719
|
interface CalendarFunction {
|
|
@@ -757,10 +772,8 @@ export declare const str: {
|
|
|
757
772
|
};
|
|
758
773
|
declare function timeFunction(tf?: string, session?: string, timezone?: string): Series;
|
|
759
774
|
declare function timeCloseFunction(tf?: string, session?: string, timezone?: string): Series;
|
|
760
|
-
/**
|
|
761
|
-
|
|
762
|
-
* the open time of the `timeframe` period that contains the bar, `na` outside `session`.
|
|
763
|
-
*/
|
|
775
|
+
/** PineScript `timenow`: the current time in ms, the same on every bar of a run (`ChartContext.now`). */
|
|
776
|
+
export declare const timenow: Series;
|
|
764
777
|
export declare const time: Series & typeof timeFunction;
|
|
765
778
|
/**
|
|
766
779
|
* PineScript `time_close`: the bar close time in ms (a Series), and `time_close(timeframe?, session?, timezone?)`.
|
|
@@ -993,6 +1006,10 @@ export declare const text: {
|
|
|
993
1006
|
* (index, time, and `price`, default the close), so it runs inside eachBar().
|
|
994
1007
|
*/
|
|
995
1008
|
export declare const chart: {
|
|
1009
|
+
/** Chart foreground colour (PineScript `chart.fg_color`), from the chart context. */
|
|
1010
|
+
readonly fg_color: string;
|
|
1011
|
+
/** Chart background colour (PineScript `chart.bg_color`), from the chart context. */
|
|
1012
|
+
readonly bg_color: string;
|
|
996
1013
|
point: {
|
|
997
1014
|
now(price?: number): ChartPoint;
|
|
998
1015
|
new_point(time: number | null, index: number | null, price: number): ChartPoint;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/script/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,EACV,SAAS,EACT,YAAY,EACZ,WAAW,EACX,OAAO,EAGP,eAAe,EACf,SAAS,EACT,UAAU,EACV,eAAe,EACf,YAAY,EACZ,UAAU,EACV,cAAc,EACd,cAAc,EACd,WAAW,EACX,UAAU,EACV,QAAQ,EACR,WAAW,EACX,cAAc,EACd,YAAY,EACZ,UAAU,EACV,aAAa,EACb,SAAS,EACT,cAAc,EACd,aAAa,EACb,SAAS,EACV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,YAAY,EACZ,UAAU,EACV,WAAW,EACX,WAAW,EACX,cAAc,EACd,UAAU,EACV,WAAW,EACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,EAA+B,MAAM,sBAAsB,CAAC;AACpF,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAA0B,IAAI,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAC7C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e,EACf,SAAS,EACT,WAAW,EACX,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,WAAW,EACX,cAAc,EACd,YAAY,EACZ,UAAU,EACV,cAAc,EACd,WAAW,EACX,SAAS,EACT,YAAY,EACZ,WAAW,EACX,cAAc,EACd,WAAW,EACX,SAAS,EACT,UAAU,EACV,eAAe,EACf,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,aAAa,EACb,cAAc,EACd,aAAa,EACb,cAAc,EACd,UAAU,EACV,QAAQ,EACR,UAAU,GACX,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/script/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,EACV,SAAS,EACT,YAAY,EACZ,WAAW,EACX,OAAO,EAGP,eAAe,EACf,SAAS,EACT,UAAU,EACV,eAAe,EACf,YAAY,EACZ,UAAU,EACV,cAAc,EACd,cAAc,EACd,WAAW,EACX,UAAU,EACV,QAAQ,EACR,WAAW,EACX,cAAc,EACd,YAAY,EACZ,UAAU,EACV,aAAa,EACb,SAAS,EACT,cAAc,EACd,aAAa,EACb,SAAS,EACV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,YAAY,EACZ,UAAU,EACV,WAAW,EACX,WAAW,EACX,cAAc,EACd,UAAU,EACV,WAAW,EACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,EAA+B,MAAM,sBAAsB,CAAC;AACpF,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAA0B,IAAI,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAC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