pinets 0.6.1 → 0.7.1

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.
Files changed (35) hide show
  1. package/README.md +146 -75
  2. package/dist/pinets.min.browser.es.js +117 -0
  3. package/dist/pinets.min.browser.es.js.map +1 -0
  4. package/dist/pinets.min.browser.js +96 -16
  5. package/dist/pinets.min.browser.js.map +1 -0
  6. package/dist/pinets.min.cjs +96 -15
  7. package/dist/pinets.min.cjs.map +1 -0
  8. package/dist/pinets.min.es.js +99 -5
  9. package/dist/pinets.min.es.js.map +1 -0
  10. package/dist/types/Context.class.d.ts +3 -25
  11. package/dist/types/namespaces/Core.d.ts +8 -3
  12. package/dist/types/namespaces/Plot.helper.d.ts +16 -0
  13. package/dist/types/namespaces/Plots.d.ts +16 -0
  14. package/dist/types/namespaces/Types.d.ts +1 -1
  15. package/dist/types/namespaces/input/utils.d.ts +2 -14
  16. package/dist/types/namespaces/ta/methods/pivothigh.d.ts +1 -1
  17. package/dist/types/namespaces/ta/methods/pivotlow.d.ts +1 -1
  18. package/dist/types/namespaces/utils.d.ts +12 -0
  19. package/dist/types/transpiler/index.d.ts +1 -1
  20. package/dist/types/transpiler/pineToJS/ast.d.ts +167 -0
  21. package/dist/types/transpiler/pineToJS/codegen.d.ts +53 -0
  22. package/dist/types/transpiler/pineToJS/lexer.d.ts +31 -0
  23. package/dist/types/transpiler/pineToJS/parser.d.ts +45 -0
  24. package/dist/types/transpiler/pineToJS/pineToJS.index.d.ts +32 -0
  25. package/dist/types/transpiler/pineToJS/tokens.d.ts +34 -0
  26. package/dist/types/transpiler/settings.d.ts +2 -0
  27. package/dist/types/transpiler/transformers/WrapperTransformer.d.ts +5 -3
  28. package/dist/types/transpiler/utils/ASTFactory.d.ts +1 -0
  29. package/dist/types/types/PineTypes.d.ts +19 -15
  30. package/package.json +24 -5
  31. package/dist/pinets.dev.browser.js +0 -16515
  32. package/dist/pinets.dev.cjs +0 -16765
  33. package/dist/pinets.dev.cjs.map +0 -1
  34. package/dist/pinets.dev.es.js +0 -9125
  35. package/dist/pinets.dev.es.js.map +0 -1
@@ -15,23 +15,103 @@
15
15
  * You should have received a copy of the GNU Affero General Public License
16
16
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
17
  */
18
- (function(ve,Be){typeof exports=="object"&&typeof module<"u"?Be(exports):typeof define=="function"&&define.amd?define(["exports"],Be):(ve=typeof globalThis<"u"?globalThis:ve||self,Be(ve.PineTSLib={}))})(this,function(ve){"use strict";var Be=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],Mt=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],Ui="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",Lt="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",at={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},ot="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",zi={5:ot,"5module":ot+" export import",6:ot+" const class extends export import super"},Gi=/^in(stanceof)?$/,Hi=new RegExp("["+Lt+"]"),Ki=new RegExp("["+Lt+Ui+"]");function ut(e,t){for(var i=65536,r=0;r<t.length;r+=2){if(i+=t[r],i>e)return!1;if(i+=t[r+1],i>=e)return!0}return!1}function de(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Hi.test(String.fromCharCode(e)):t===!1?!1:ut(e,Mt)}function ke(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Ki.test(String.fromCharCode(e)):t===!1?!1:ut(e,Mt)||ut(e,Be)}var L=function(t,i){i===void 0&&(i={}),this.label=t,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null};function te(e,t){return new L(e,{beforeExpr:!0,binop:t})}var ie={beforeExpr:!0},Z={startsExpr:!0},ct={};function M(e,t){return t===void 0&&(t={}),t.keyword=e,ct[e]=new L(e,t)}var l={num:new L("num",Z),regexp:new L("regexp",Z),string:new L("string",Z),name:new L("name",Z),privateId:new L("privateId",Z),eof:new L("eof"),bracketL:new L("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new L("]"),braceL:new L("{",{beforeExpr:!0,startsExpr:!0}),braceR:new L("}"),parenL:new L("(",{beforeExpr:!0,startsExpr:!0}),parenR:new L(")"),comma:new L(",",ie),semi:new L(";",ie),colon:new L(":",ie),dot:new L("."),question:new L("?",ie),questionDot:new L("?."),arrow:new L("=>",ie),template:new L("template"),invalidTemplate:new L("invalidTemplate"),ellipsis:new L("...",ie),backQuote:new L("`",Z),dollarBraceL:new L("${",{beforeExpr:!0,startsExpr:!0}),eq:new L("=",{beforeExpr:!0,isAssign:!0}),assign:new L("_=",{beforeExpr:!0,isAssign:!0}),incDec:new L("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new L("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:te("||",1),logicalAND:te("&&",2),bitwiseOR:te("|",3),bitwiseXOR:te("^",4),bitwiseAND:te("&",5),equality:te("==/!=/===/!==",6),relational:te("</>/<=/>=",7),bitShift:te("<</>>/>>>",8),plusMin:new L("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:te("%",10),star:te("*",10),slash:te("/",10),starstar:new L("**",{beforeExpr:!0}),coalesce:te("??",1),_break:M("break"),_case:M("case",ie),_catch:M("catch"),_continue:M("continue"),_debugger:M("debugger"),_default:M("default",ie),_do:M("do",{isLoop:!0,beforeExpr:!0}),_else:M("else",ie),_finally:M("finally"),_for:M("for",{isLoop:!0}),_function:M("function",Z),_if:M("if"),_return:M("return",ie),_switch:M("switch"),_throw:M("throw",ie),_try:M("try"),_var:M("var"),_const:M("const"),_while:M("while",{isLoop:!0}),_with:M("with"),_new:M("new",{beforeExpr:!0,startsExpr:!0}),_this:M("this",Z),_super:M("super",Z),_class:M("class",Z),_extends:M("extends",ie),_export:M("export"),_import:M("import",Z),_null:M("null",Z),_true:M("true",Z),_false:M("false",Z),_in:M("in",{beforeExpr:!0,binop:7}),_instanceof:M("instanceof",{beforeExpr:!0,binop:7}),_typeof:M("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:M("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:M("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},re=/\r\n?|\n|\u2028|\u2029/,Qi=new RegExp(re.source,"g");function Ie(e){return e===10||e===13||e===8232||e===8233}function Bt(e,t,i){i===void 0&&(i=e.length);for(var r=t;r<i;r++){var n=e.charCodeAt(r);if(Ie(n))return r<i-1&&n===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var Rt=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,ne=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Dt=Object.prototype,Xi=Dt.hasOwnProperty,Yi=Dt.toString,Ae=Object.hasOwn||function(e,t){return Xi.call(e,t)},jt=Array.isArray||function(e){return Yi.call(e)==="[object Array]"},Ot=Object.create(null);function we(e){return Ot[e]||(Ot[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function ge(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var Zi=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Re=function(t,i){this.line=t,this.column=i};Re.prototype.offset=function(t){return new Re(this.line,this.column+t)};var ze=function(t,i,r){this.start=i,this.end=r,t.sourceFile!==null&&(this.source=t.sourceFile)};function Ft(e,t){for(var i=1,r=0;;){var n=Bt(e,r,t);if(n<0)return new Re(i,t-r);++i,r=n}}var lt={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},$t=!1;function Ji(e){var t={};for(var i in lt)t[i]=e&&Ae(e,i)?e[i]:lt[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!$t&&typeof console=="object"&&console.warn&&($t=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
19
- Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),jt(t.onToken)){var r=t.onToken;t.onToken=function(n){return r.push(n)}}return jt(t.onComment)&&(t.onComment=er(t,t.onComment)),t}function er(e,t){return function(i,r,n,s,a,o){var u={type:i?"Block":"Line",value:r,start:n,end:s};e.locations&&(u.loc=new ze(this,a,o)),e.ranges&&(u.range=[n,s]),t.push(u)}}var De=1,Pe=2,ht=4,Wt=8,qt=16,Ut=32,pt=64,zt=128,je=256,ft=De|Pe|je;function mt(e,t){return Pe|(e?ht:0)|(t?Wt:0)}var Ge=0,dt=1,xe=2,Gt=3,Ht=4,Kt=5,$=function(t,i,r){this.options=t=Ji(t),this.sourceFile=t.sourceFile,this.keywords=we(zi[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var n="";t.allowReserved!==!0&&(n=at[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(n+=" await")),this.reservedWords=we(n);var s=(n?n+" ":"")+at.strict;this.reservedWordsStrict=we(s),this.reservedWordsStrictBind=we(s+" "+at.strictBind),this.input=String(i),this.containsEsc=!1,r?(this.pos=r,this.lineStart=this.input.lastIndexOf(`
20
- `,r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(re).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=l.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=t.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(De),this.regexpState=null,this.privateNameStack=[]},fe={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};$.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)},fe.inFunction.get=function(){return(this.currentVarScope().flags&Pe)>0},fe.inGenerator.get=function(){return(this.currentVarScope().flags&Wt)>0&&!this.currentVarScope().inClassFieldInit},fe.inAsync.get=function(){return(this.currentVarScope().flags&ht)>0&&!this.currentVarScope().inClassFieldInit},fe.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&je)return!1;if(t.flags&Pe)return(t.flags&ht)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},fe.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&pt)>0||i||this.options.allowSuperOutsideMethod},fe.allowDirectSuper.get=function(){return(this.currentThisScope().flags&zt)>0},fe.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},fe.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&(Pe|je))>0||i},fe.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&je)>0},$.extend=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];for(var r=this,n=0;n<t.length;n++)r=t[n](r);return r},$.parse=function(t,i){return new this(i,t).parse()},$.parseExpressionAt=function(t,i,r){var n=new this(r,t,i);return n.nextToken(),n.parseExpression()},$.tokenizer=function(t,i){return new this(i,t)},Object.defineProperties($.prototype,fe);var K=$.prototype,tr=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;K.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){ne.lastIndex=e,e+=ne.exec(this.input)[0].length;var t=tr.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){ne.lastIndex=e+t[0].length;var i=ne.exec(this.input),r=i.index+i[0].length,n=this.input.charAt(r);return n===";"||n==="}"||re.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(n)||n==="!"&&this.input.charAt(r+1)==="=")}e+=t[0].length,ne.lastIndex=e,e+=ne.exec(this.input)[0].length,this.input[e]===";"&&e++}},K.eat=function(e){return this.type===e?(this.next(),!0):!1},K.isContextual=function(e){return this.type===l.name&&this.value===e&&!this.containsEsc},K.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},K.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},K.canInsertSemicolon=function(){return this.type===l.eof||this.type===l.braceR||re.test(this.input.slice(this.lastTokEnd,this.start))},K.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},K.semicolon=function(){!this.eat(l.semi)&&!this.insertSemicolon()&&this.unexpected()},K.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},K.expect=function(e){this.eat(e)||this.unexpected()},K.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var He=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};K.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern")}},K.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,r=e.doubleProto;if(!t)return i>=0||r>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property")},K.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},K.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var N=$.prototype;N.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==l.eof;){var i=this.parseStatement(null,!0,t);e.body.push(i)}if(this.inModule)for(var r=0,n=Object.keys(this.undefinedExports);r<n.length;r+=1){var s=n[r];this.raiseRecoverable(this.undefinedExports[s].start,"Export '"+s+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var gt={kind:"loop"},ir={kind:"switch"};N.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;ne.lastIndex=this.pos;var t=ne.exec(this.input),i=this.pos+t[0].length,r=this.input.charCodeAt(i);if(r===91||r===92)return!0;if(e)return!1;if(r===123||r>55295&&r<56320)return!0;if(de(r,!0)){for(var n=i+1;ke(r=this.input.charCodeAt(n),!0);)++n;if(r===92||r>55295&&r<56320)return!0;var s=this.input.slice(i,n);if(!Gi.test(s))return!0}return!1},N.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;ne.lastIndex=this.pos;var e=ne.exec(this.input),t=this.pos+e[0].length,i;return!re.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(ke(i=this.input.charCodeAt(t+8))||i>55295&&i<56320))},N.parseStatement=function(e,t,i){var r=this.type,n=this.startNode(),s;switch(this.isLet(e)&&(r=l._var,s="let"),r){case l._break:case l._continue:return this.parseBreakContinueStatement(n,r.keyword);case l._debugger:return this.parseDebuggerStatement(n);case l._do:return this.parseDoStatement(n);case l._for:return this.parseForStatement(n);case l._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(n,!1,!e);case l._class:return e&&this.unexpected(),this.parseClass(n,!0);case l._if:return this.parseIfStatement(n);case l._return:return this.parseReturnStatement(n);case l._switch:return this.parseSwitchStatement(n);case l._throw:return this.parseThrowStatement(n);case l._try:return this.parseTryStatement(n);case l._const:case l._var:return s=s||this.value,e&&s!=="var"&&this.unexpected(),this.parseVarStatement(n,s);case l._while:return this.parseWhileStatement(n);case l._with:return this.parseWithStatement(n);case l.braceL:return this.parseBlock(!0,n);case l.semi:return this.parseEmptyStatement(n);case l._export:case l._import:if(this.options.ecmaVersion>10&&r===l._import){ne.lastIndex=this.pos;var a=ne.exec(this.input),o=this.pos+a[0].length,u=this.input.charCodeAt(o);if(u===40||u===46)return this.parseExpressionStatement(n,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===l._import?this.parseImport(n):this.parseExport(n,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(n,!0,!e);var c=this.value,h=this.parseExpression();return r===l.name&&h.type==="Identifier"&&this.eat(l.colon)?this.parseLabeledStatement(n,c,h,e):this.parseExpressionStatement(n,h)}},N.parseBreakContinueStatement=function(e,t){var i=t==="break";this.next(),this.eat(l.semi)||this.insertSemicolon()?e.label=null:this.type!==l.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var r=0;r<this.labels.length;++r){var n=this.labels[r];if((e.label==null||n.name===e.label.name)&&(n.kind!=null&&(i||n.kind==="loop")||e.label&&i))break}return r===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")},N.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},N.parseDoStatement=function(e){return this.next(),this.labels.push(gt),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(l._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(l.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},N.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(gt),this.enterScope(0),this.expect(l.parenL),this.type===l.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===l._var||this.type===l._const||i){var r=this.startNode(),n=i?"let":this.value;return this.next(),this.parseVar(r,!0,n),this.finishNode(r,"VariableDeclaration"),(this.type===l._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&r.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===l._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,r)):(t>-1&&this.unexpected(t),this.parseFor(e,r))}var s=this.isContextual("let"),a=!1,o=this.containsEsc,u=new He,c=this.start,h=t>-1?this.parseExprSubscripts(u,"await"):this.parseExpression(!0,u);return this.type===l._in||(a=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===l._in&&this.unexpected(t),e.await=!0):a&&this.options.ecmaVersion>=8&&(h.start===c&&!o&&h.type==="Identifier"&&h.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),s&&a&&this.raise(h.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(h,!1,u),this.checkLValPattern(h),this.parseForIn(e,h)):(this.checkExpressionErrors(u,!0),t>-1&&this.unexpected(t),this.parseFor(e,h))},N.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,Oe|(i?0:xt),!1,t)},N.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(l._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},N.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(l.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},N.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(l.braceL),this.labels.push(ir),this.enterScope(0);for(var t,i=!1;this.type!==l.braceR;)if(this.type===l._case||this.type===l._default){var r=this.type===l._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,t.test=null),this.expect(l.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},N.parseThrowStatement=function(e){return this.next(),re.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var rr=[];N.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?Ut:0),this.checkLValPattern(e,t?Ht:xe),this.expect(l.parenR),e},N.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===l._catch){var t=this.startNode();this.next(),this.eat(l.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(l._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},N.parseVarStatement=function(e,t,i){return this.next(),this.parseVar(e,!1,t,i),this.semicolon(),this.finishNode(e,"VariableDeclaration")},N.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(gt),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},N.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},N.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},N.parseLabeledStatement=function(e,t,i,r){for(var n=0,s=this.labels;n<s.length;n+=1){var a=s[n];a.name===t&&this.raise(i.start,"Label '"+t+"' is already declared")}for(var o=this.type.isLoop?"loop":this.type===l._switch?"switch":null,u=this.labels.length-1;u>=0;u--){var c=this.labels[u];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf("label")===-1?r+"label":r:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")},N.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},N.parseBlock=function(e,t,i){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(l.braceL),e&&this.enterScope(0);this.type!==l.braceR;){var r=this.parseStatement(null);t.body.push(r)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},N.parseFor=function(e,t){return e.init=t,this.expect(l.semi),e.test=this.type===l.semi?null:this.parseExpression(),this.expect(l.semi),e.update=this.type===l.parenR?null:this.parseExpression(),this.expect(l.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},N.parseForIn=function(e,t){var i=this.type===l._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(l.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")},N.parseVar=function(e,t,i,r){for(e.declarations=[],e.kind=i;;){var n=this.startNode();if(this.parseVarId(n,i),this.eat(l.eq)?n.init=this.parseMaybeAssign(t):!r&&i==="const"&&!(this.type===l._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!r&&n.id.type!=="Identifier"&&!(t&&(this.type===l._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):n.init=null,e.declarations.push(this.finishNode(n,"VariableDeclarator")),!this.eat(l.comma))break}return e},N.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?dt:xe,!1)};var Oe=1,xt=2,Qt=4;N.parseFunction=function(e,t,i,r,n){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===l.star&&t&xt&&this.unexpected(),e.generator=this.eat(l.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&Oe&&(e.id=t&Qt&&this.type!==l.name?null:this.parseIdent(),e.id&&!(t&xt)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?dt:xe:Gt));var s=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(mt(e.async,e.generator)),t&Oe||(e.id=this.type===l.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,n),this.yieldPos=s,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,t&Oe?"FunctionDeclaration":"FunctionExpression")},N.parseFunctionParams=function(e){this.expect(l.parenL),e.params=this.parseBindingList(l.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},N.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),n=this.startNode(),s=!1;for(n.body=[],this.expect(l.braceL);this.type!==l.braceR;){var a=this.parseClassElement(e.superClass!==null);a&&(n.body.push(a),a.type==="MethodDefinition"&&a.kind==="constructor"?(s&&this.raiseRecoverable(a.start,"Duplicate constructor in the same class"),s=!0):a.key&&a.key.type==="PrivateIdentifier"&&nr(r,a)&&this.raiseRecoverable(a.key.start,"Identifier '#"+a.key.name+"' has already been declared"))}return this.strict=i,this.next(),e.body=this.finishNode(n,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},N.parseClassElement=function(e){if(this.eat(l.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),r="",n=!1,s=!1,a="method",o=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(l.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===l.star?o=!0:r="static"}if(i.static=o,!r&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===l.star)&&!this.canInsertSemicolon()?s=!0:r="async"),!r&&(t>=9||!s)&&this.eat(l.star)&&(n=!0),!r&&!s&&!n){var u=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?a=u:r=u)}if(r?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=r,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===l.parenL||a!=="method"||n||s){var c=!i.static&&Ke(i,"constructor"),h=c&&e;c&&a!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=c?"constructor":a,this.parseClassMethod(i,n,s,h)}else this.parseClassField(i);return i},N.isClassElementNameStart=function(){return this.type===l.name||this.type===l.privateId||this.type===l.num||this.type===l.string||this.type===l.bracketL||this.type.keyword},N.parseClassElementName=function(e){this.type===l.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},N.parseClassMethod=function(e,t,i,r){var n=e.key;e.kind==="constructor"?(t&&this.raise(n.start,"Constructor can't be a generator"),i&&this.raise(n.start,"Constructor can't be an async method")):e.static&&Ke(e,"prototype")&&this.raise(n.start,"Classes may not have a static property named prototype");var s=e.value=this.parseMethod(t,i,r);return e.kind==="get"&&s.params.length!==0&&this.raiseRecoverable(s.start,"getter should have no params"),e.kind==="set"&&s.params.length!==1&&this.raiseRecoverable(s.start,"setter should have exactly one param"),e.kind==="set"&&s.params[0].type==="RestElement"&&this.raiseRecoverable(s.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")},N.parseClassField=function(e){if(Ke(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&Ke(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(l.eq)){var t=this.currentThisScope(),i=t.inClassFieldInit;t.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),t.inClassFieldInit=i}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")},N.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(je|pt);this.type!==l.braceR;){var i=this.parseStatement(null);e.body.push(i)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")},N.parseClassId=function(e,t){this.type===l.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,xe,!1)):(t===!0&&this.unexpected(),e.id=null)},N.parseClassSuper=function(e){e.superClass=this.eat(l._extends)?this.parseExprSubscripts(null,!1):null},N.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},N.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,i=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,n=r===0?null:this.privateNameStack[r-1],s=0;s<i.length;++s){var a=i[s];Ae(t,a.name)||(n?n.used.push(a):this.raiseRecoverable(a.start,"Private field '#"+a.name+"' must be declared in an enclosing class"))}};function nr(e,t){var i=t.key.name,r=e[i],n="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(n=(t.static?"s":"i")+t.kind),r==="iget"&&n==="iset"||r==="iset"&&n==="iget"||r==="sget"&&n==="sset"||r==="sset"&&n==="sget"?(e[i]="true",!1):r?!0:(e[i]=n,!1)}function Ke(e,t){var i=e.computed,r=e.key;return!i&&(r.type==="Identifier"&&r.name===t||r.type==="Literal"&&r.value===t)}N.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==l.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")},N.parseExport=function(e,t){if(this.next(),this.eat(l.star))return this.parseExportAllDeclaration(e,t);if(this.eat(l._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==l.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var i=0,r=e.specifiers;i<r.length;i+=1){var n=r[i];this.checkUnreserved(n.local),this.checkLocalExport(n.local),n.local.type==="Literal"&&this.raise(n.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},N.parseExportDeclaration=function(e){return this.parseStatement(null)},N.parseExportDefaultDeclaration=function(){var e;if(this.type===l._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,Oe|Qt,!1,e)}else if(this.type===l._class){var i=this.startNode();return this.parseClass(i,"nullableID")}else{var r=this.parseMaybeAssign();return this.semicolon(),r}},N.checkExport=function(e,t,i){e&&(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),Ae(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=!0)},N.checkPatternExport=function(e,t){var i=t.type;if(i==="Identifier")this.checkExport(e,t,t.start);else if(i==="ObjectPattern")for(var r=0,n=t.properties;r<n.length;r+=1){var s=n[r];this.checkPatternExport(e,s)}else if(i==="ArrayPattern")for(var a=0,o=t.elements;a<o.length;a+=1){var u=o[a];u&&this.checkPatternExport(e,u)}else i==="Property"?this.checkPatternExport(e,t.value):i==="AssignmentPattern"?this.checkPatternExport(e,t.left):i==="RestElement"&&this.checkPatternExport(e,t.argument)},N.checkVariableExport=function(e,t){if(e)for(var i=0,r=t;i<r.length;i+=1){var n=r[i];this.checkPatternExport(e,n.id)}},N.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()},N.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")},N.parseExportSpecifiers=function(e){var t=[],i=!0;for(this.expect(l.braceL);!this.eat(l.braceR);){if(i)i=!1;else if(this.expect(l.comma),this.afterTrailingComma(l.braceR))break;t.push(this.parseExportSpecifier(e))}return t},N.parseImport=function(e){return this.next(),this.type===l.string?(e.specifiers=rr,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===l.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},N.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,xe),this.finishNode(e,"ImportSpecifier")},N.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,xe),this.finishNode(e,"ImportDefaultSpecifier")},N.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,xe),this.finishNode(e,"ImportNamespaceSpecifier")},N.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===l.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(l.comma)))return e;if(this.type===l.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(l.braceL);!this.eat(l.braceR);){if(t)t=!1;else if(this.expect(l.comma),this.afterTrailingComma(l.braceR))break;e.push(this.parseImportSpecifier())}return e},N.parseWithClause=function(){var e=[];if(!this.eat(l._with))return e;this.expect(l.braceL);for(var t={},i=!0;!this.eat(l.braceR);){if(i)i=!1;else if(this.expect(l.comma),this.afterTrailingComma(l.braceR))break;var r=this.parseImportAttribute(),n=r.key.type==="Identifier"?r.key.name:r.key.value;Ae(t,n)&&this.raiseRecoverable(r.key.start,"Duplicate attribute key '"+n+"'"),t[n]=!0,e.push(r)}return e},N.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===l.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(l.colon),this.type!==l.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")},N.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===l.string){var e=this.parseLiteral(this.value);return Zi.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)},N.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},N.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var se=$.prototype;se.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var r=0,n=e.properties;r<n.length;r+=1){var s=n[r];this.toAssignable(s,t),s.type==="RestElement"&&(s.argument.type==="ArrayPattern"||s.argument.type==="ObjectPattern")&&this.raise(s.argument.start,"Unexpected token")}break;case"Property":e.kind!=="init"&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern"&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":e.operator!=="="&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return e},se.toAssignableList=function(e,t){for(var i=e.length,r=0;r<i;r++){var n=e[r];n&&this.toAssignable(n,t)}if(i){var s=e[i-1];this.options.ecmaVersion===6&&t&&s&&s.type==="RestElement"&&s.argument.type!=="Identifier"&&this.unexpected(s.argument.start)}return e},se.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},se.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==l.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")},se.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case l.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(l.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case l.braceL:return this.parseObj(!0)}return this.parseIdent()},se.parseBindingList=function(e,t,i,r){for(var n=[],s=!0;!this.eat(e);)if(s?s=!1:this.expect(l.comma),t&&this.type===l.comma)n.push(null);else{if(i&&this.afterTrailingComma(e))break;if(this.type===l.ellipsis){var a=this.parseRestBinding();this.parseBindingListItem(a),n.push(a),this.type===l.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else n.push(this.parseAssignableListItem(r))}return n},se.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},se.parseBindingListItem=function(e){return e},se.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(l.eq))return i;var r=this.startNodeAt(e,t);return r.left=i,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")},se.checkLValSimple=function(e,t,i){t===void 0&&(t=Ge);var r=t!==Ge;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?"Binding ":"Assigning to ")+e.name+" in strict mode"),r&&(t===xe&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(Ae(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=!0),t!==Kt&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":r&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return r&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(r?"Binding":"Assigning to")+" rvalue")}},se.checkLValPattern=function(e,t,i){switch(t===void 0&&(t=Ge),e.type){case"ObjectPattern":for(var r=0,n=e.properties;r<n.length;r+=1){var s=n[r];this.checkLValInnerPattern(s,t,i)}break;case"ArrayPattern":for(var a=0,o=e.elements;a<o.length;a+=1){var u=o[a];u&&this.checkLValInnerPattern(u,t,i)}break;default:this.checkLValSimple(e,t,i)}},se.checkLValInnerPattern=function(e,t,i){switch(t===void 0&&(t=Ge),e.type){case"Property":this.checkLValInnerPattern(e.value,t,i);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case"RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i)}};var oe=function(t,i,r,n,s){this.token=t,this.isExpr=!!i,this.preserveSpace=!!r,this.override=n,this.generator=!!s},j={b_stat:new oe("{",!1),b_expr:new oe("{",!0),b_tmpl:new oe("${",!1),p_stat:new oe("(",!1),p_expr:new oe("(",!0),q_tmpl:new oe("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new oe("function",!1),f_expr:new oe("function",!0),f_expr_gen:new oe("function",!0,!1,null,!0),f_gen:new oe("function",!1,!1,null,!0)},Ve=$.prototype;Ve.initialContext=function(){return[j.b_stat]},Ve.curContext=function(){return this.context[this.context.length-1]},Ve.braceIsBlock=function(e){var t=this.curContext();return t===j.f_expr||t===j.f_stat?!0:e===l.colon&&(t===j.b_stat||t===j.b_expr)?!t.isExpr:e===l._return||e===l.name&&this.exprAllowed?re.test(this.input.slice(this.lastTokEnd,this.start)):e===l._else||e===l.semi||e===l.eof||e===l.parenR||e===l.arrow?!0:e===l.braceL?t===j.b_stat:e===l._var||e===l._const||e===l.name?!1:!this.exprAllowed},Ve.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function")return t.generator}return!1},Ve.updateContext=function(e){var t,i=this.type;i.keyword&&e===l.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr},Ve.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},l.parenR.updateContext=l.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===j.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr},l.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?j.b_stat:j.b_expr),this.exprAllowed=!0},l.dollarBraceL.updateContext=function(){this.context.push(j.b_tmpl),this.exprAllowed=!0},l.parenL.updateContext=function(e){var t=e===l._if||e===l._for||e===l._with||e===l._while;this.context.push(t?j.p_stat:j.p_expr),this.exprAllowed=!0},l.incDec.updateContext=function(){},l._function.updateContext=l._class.updateContext=function(e){e.beforeExpr&&e!==l._else&&!(e===l.semi&&this.curContext()!==j.p_stat)&&!(e===l._return&&re.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===l.colon||e===l.braceL)&&this.curContext()===j.b_stat)?this.context.push(j.f_expr):this.context.push(j.f_stat),this.exprAllowed=!1},l.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0},l.backQuote.updateContext=function(){this.curContext()===j.q_tmpl?this.context.pop():this.context.push(j.q_tmpl),this.exprAllowed=!1},l.star.updateContext=function(e){if(e===l._function){var t=this.context.length-1;this.context[t]===j.f_expr?this.context[t]=j.f_expr_gen:this.context[t]=j.f_gen}this.exprAllowed=!0},l.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==l.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var A=$.prototype;A.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&e.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,n;switch(r.type){case"Identifier":n=r.name;break;case"Literal":n=String(r.value);break;default:return}var s=e.kind;if(this.options.ecmaVersion>=6){n==="__proto__"&&s==="init"&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=r.start):this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),t.proto=!0);return}n="$"+n;var a=t[n];if(a){var o;s==="init"?o=this.strict&&a.init||a.get||a.set:o=a.init||a[s],o&&this.raiseRecoverable(r.start,"Redefinition of property")}else a=t[n]={init:!1,get:!1,set:!1};a[s]=!0}},A.parseExpression=function(e,t){var i=this.start,r=this.startLoc,n=this.parseMaybeAssign(e,t);if(this.type===l.comma){var s=this.startNodeAt(i,r);for(s.expressions=[n];this.eat(l.comma);)s.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(s,"SequenceExpression")}return n},A.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,n=-1,s=-1,a=-1;t?(n=t.parenthesizedAssign,s=t.trailingComma,a=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new He,r=!0);var o=this.start,u=this.startLoc;(this.type===l.parenL||this.type===l.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var c=this.parseMaybeConditional(e,t);if(i&&(c=i.call(this,c,o,u)),this.type.isAssign){var h=this.startNodeAt(o,u);return h.operator=this.value,this.type===l.eq&&(c=this.toAssignable(c,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=c.start&&(t.shorthandAssign=-1),this.type===l.eq?this.checkLValPattern(c):this.checkLValSimple(c),h.left=c,this.next(),h.right=this.parseMaybeAssign(e),a>-1&&(t.doubleProto=a),this.finishNode(h,"AssignmentExpression")}else r&&this.checkExpressionErrors(t,!0);return n>-1&&(t.parenthesizedAssign=n),s>-1&&(t.trailingComma=s),c},A.parseMaybeConditional=function(e,t){var i=this.start,r=this.startLoc,n=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return n;if(this.eat(l.question)){var s=this.startNodeAt(i,r);return s.test=n,s.consequent=this.parseMaybeAssign(),this.expect(l.colon),s.alternate=this.parseMaybeAssign(e),this.finishNode(s,"ConditionalExpression")}return n},A.parseExprOps=function(e,t){var i=this.start,r=this.startLoc,n=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||n.start===i&&n.type==="ArrowFunctionExpression"?n:this.parseExprOp(n,i,r,-1,e)},A.parseExprOp=function(e,t,i,r,n){var s=this.type.binop;if(s!=null&&(!n||this.type!==l._in)&&s>r){var a=this.type===l.logicalOR||this.type===l.logicalAND,o=this.type===l.coalesce;o&&(s=l.logicalAND.binop);var u=this.value;this.next();var c=this.start,h=this.startLoc,f=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,n),c,h,s,n),d=this.buildBinary(t,i,e,f,u,a||o);return(a&&this.type===l.coalesce||o&&(this.type===l.logicalOR||this.type===l.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(d,t,i,r,n)}return e},A.buildBinary=function(e,t,i,r,n,s){r.type==="PrivateIdentifier"&&this.raise(r.start,"Private identifier can only be left side of binary expression");var a=this.startNodeAt(e,t);return a.left=i,a.operator=n,a.right=r,this.finishNode(a,s?"LogicalExpression":"BinaryExpression")},A.parseMaybeUnary=function(e,t,i,r){var n=this.start,s=this.startLoc,a;if(this.isContextual("await")&&this.canAwait)a=this.parseAwait(r),t=!0;else if(this.type.prefix){var o=this.startNode(),u=this.type===l.incDec;o.operator=this.value,o.prefix=!0,this.next(),o.argument=this.parseMaybeUnary(null,!0,u,r),this.checkExpressionErrors(e,!0),u?this.checkLValSimple(o.argument):this.strict&&o.operator==="delete"&&Xt(o.argument)?this.raiseRecoverable(o.start,"Deleting local variable in strict mode"):o.operator==="delete"&&yt(o.argument)?this.raiseRecoverable(o.start,"Private fields can not be deleted"):t=!0,a=this.finishNode(o,u?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===l.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),a=this.parsePrivateIdent(),this.type!==l._in&&this.unexpected();else{if(a=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return a;for(;this.type.postfix&&!this.canInsertSemicolon();){var c=this.startNodeAt(n,s);c.operator=this.value,c.prefix=!1,c.argument=a,this.checkLValSimple(a),this.next(),a=this.finishNode(c,"UpdateExpression")}}if(!i&&this.eat(l.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(n,s,a,this.parseMaybeUnary(null,!1,!1,r),"**",!1);else return a};function Xt(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&Xt(e.expression)}function yt(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&yt(e.expression)||e.type==="ParenthesizedExpression"&&yt(e.expression)}A.parseExprSubscripts=function(e,t){var i=this.start,r=this.startLoc,n=this.parseExprAtom(e,t);if(n.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return n;var s=this.parseSubscripts(n,i,r,!1,t);return e&&s.type==="MemberExpression"&&(e.parenthesizedAssign>=s.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=s.start&&(e.parenthesizedBind=-1),e.trailingComma>=s.start&&(e.trailingComma=-1)),s},A.parseSubscripts=function(e,t,i,r,n){for(var s=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,a=!1;;){var o=this.parseSubscript(e,t,i,r,s,a,n);if(o.optional&&(a=!0),o===e||o.type==="ArrowFunctionExpression"){if(a){var u=this.startNodeAt(t,i);u.expression=o,o=this.finishNode(u,"ChainExpression")}return o}e=o}},A.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(l.arrow)},A.parseSubscriptAsyncArrow=function(e,t,i,r){return this.parseArrowExpression(this.startNodeAt(e,t),i,!0,r)},A.parseSubscript=function(e,t,i,r,n,s,a){var o=this.options.ecmaVersion>=11,u=o&&this.eat(l.questionDot);r&&u&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var c=this.eat(l.bracketL);if(c||u&&this.type!==l.parenL&&this.type!==l.backQuote||this.eat(l.dot)){var h=this.startNodeAt(t,i);h.object=e,c?(h.property=this.parseExpression(),this.expect(l.bracketR)):this.type===l.privateId&&e.type!=="Super"?h.property=this.parsePrivateIdent():h.property=this.parseIdent(this.options.allowReserved!=="never"),h.computed=!!c,o&&(h.optional=u),e=this.finishNode(h,"MemberExpression")}else if(!r&&this.eat(l.parenL)){var f=new He,d=this.yieldPos,p=this.awaitPos,g=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var x=this.parseExprList(l.parenR,this.options.ecmaVersion>=8,!1,f);if(n&&!u&&this.shouldParseAsyncArrow())return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=d,this.awaitPos=p,this.awaitIdentPos=g,this.parseSubscriptAsyncArrow(t,i,x,a);this.checkExpressionErrors(f,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=g||this.awaitIdentPos;var y=this.startNodeAt(t,i);y.callee=e,y.arguments=x,o&&(y.optional=u),e=this.finishNode(y,"CallExpression")}else if(this.type===l.backQuote){(u||s)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var S=this.startNodeAt(t,i);S.tag=e,S.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(S,"TaggedTemplateExpression")}return e},A.parseExprAtom=function(e,t,i){this.type===l.slash&&this.readRegexp();var r,n=this.potentialArrowAt===this.start;switch(this.type){case l._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),r=this.startNode(),this.next(),this.type===l.parenL&&!this.allowDirectSuper&&this.raise(r.start,"super() call outside constructor of a subclass"),this.type!==l.dot&&this.type!==l.bracketL&&this.type!==l.parenL&&this.unexpected(),this.finishNode(r,"Super");case l._this:return r=this.startNode(),this.next(),this.finishNode(r,"ThisExpression");case l.name:var s=this.start,a=this.startLoc,o=this.containsEsc,u=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&u.name==="async"&&!this.canInsertSemicolon()&&this.eat(l._function))return this.overrideContext(j.f_expr),this.parseFunction(this.startNodeAt(s,a),0,!1,!0,t);if(n&&!this.canInsertSemicolon()){if(this.eat(l.arrow))return this.parseArrowExpression(this.startNodeAt(s,a),[u],!1,t);if(this.options.ecmaVersion>=8&&u.name==="async"&&this.type===l.name&&!o&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return u=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(l.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(s,a),[u],!0,t)}return u;case l.regexp:var c=this.value;return r=this.parseLiteral(c.value),r.regex={pattern:c.pattern,flags:c.flags},r;case l.num:case l.string:return this.parseLiteral(this.value);case l._null:case l._true:case l._false:return r=this.startNode(),r.value=this.type===l._null?null:this.type===l._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,"Literal");case l.parenL:var h=this.start,f=this.parseParenAndDistinguishExpression(n,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(f)&&(e.parenthesizedAssign=h),e.parenthesizedBind<0&&(e.parenthesizedBind=h)),f;case l.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(l.bracketR,!0,!0,e),this.finishNode(r,"ArrayExpression");case l.braceL:return this.overrideContext(j.b_expr),this.parseObj(!1,e);case l._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case l._class:return this.parseClass(this.startNode(),!1);case l._new:return this.parseNew();case l.backQuote:return this.parseTemplate();case l._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}},A.parseExprAtomDefault=function(){this.unexpected()},A.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===l.parenL&&!e)return this.parseDynamicImport(t);if(this.type===l.dot){var i=this.startNodeAt(t.start,t.loc&&t.loc.start);return i.name="import",t.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(t)}else this.unexpected()},A.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(l.parenR)?e.options=null:(this.expect(l.comma),this.afterTrailingComma(l.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(l.parenR)||(this.expect(l.comma),this.afterTrailingComma(l.parenR)||this.unexpected())));else if(!this.eat(l.parenR)){var t=this.start;this.eat(l.comma)&&this.eat(l.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},A.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},A.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},A.parseParenExpression=function(){this.expect(l.parenL);var e=this.parseExpression();return this.expect(l.parenR),e},A.shouldParseArrow=function(e){return!this.canInsertSemicolon()},A.parseParenAndDistinguishExpression=function(e,t){var i=this.start,r=this.startLoc,n,s=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var a=this.start,o=this.startLoc,u=[],c=!0,h=!1,f=new He,d=this.yieldPos,p=this.awaitPos,g;for(this.yieldPos=0,this.awaitPos=0;this.type!==l.parenR;)if(c?c=!1:this.expect(l.comma),s&&this.afterTrailingComma(l.parenR,!0)){h=!0;break}else if(this.type===l.ellipsis){g=this.start,u.push(this.parseParenItem(this.parseRestBinding())),this.type===l.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else u.push(this.parseMaybeAssign(!1,f,this.parseParenItem));var x=this.lastTokEnd,y=this.lastTokEndLoc;if(this.expect(l.parenR),e&&this.shouldParseArrow(u)&&this.eat(l.arrow))return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=d,this.awaitPos=p,this.parseParenArrowList(i,r,u,t);(!u.length||h)&&this.unexpected(this.lastTokStart),g&&this.unexpected(g),this.checkExpressionErrors(f,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=p||this.awaitPos,u.length>1?(n=this.startNodeAt(a,o),n.expressions=u,this.finishNodeAt(n,"SequenceExpression",x,y)):n=u[0]}else n=this.parseParenExpression();if(this.options.preserveParens){var S=this.startNodeAt(i,r);return S.expression=n,this.finishNode(S,"ParenthesizedExpression")}else return n},A.parseParenItem=function(e){return e},A.parseParenArrowList=function(e,t,i,r){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,r)};var sr=[];A.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===l.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var i=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var r=this.start,n=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,n,!0,!1),this.eat(l.parenL)?e.arguments=this.parseExprList(l.parenR,this.options.ecmaVersion>=8,!1):e.arguments=sr,this.finishNode(e,"NewExpression")},A.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===l.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,`
18
+ (function(Ce,Ge){typeof exports=="object"&&typeof module<"u"?Ge(exports):typeof define=="function"&&define.amd?define(["exports"],Ge):(Ce=typeof globalThis<"u"?globalThis:Ce||self,Ge(Ce.PineTSLib={}))})(this,function(Ce){"use strict";var Ge=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],Zt=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],wr="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",Jt="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",bt={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},vt="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",br={5:vt,"5module":vt+" export import",6:vt+" const class extends export import super"},vr=/^in(stanceof)?$/,_r=new RegExp("["+Jt+"]"),Sr=new RegExp("["+Jt+wr+"]");function _t(e,t){for(var i=65536,r=0;r<t.length;r+=2){if(i+=t[r],i>e)return!1;if(i+=t[r+1],i>=e)return!0}return!1}function ve(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&_r.test(String.fromCharCode(e)):t===!1?!1:_t(e,Zt)}function Fe(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Sr.test(String.fromCharCode(e)):t===!1?!1:_t(e,Zt)||_t(e,Ge)}var O=function(t,i){i===void 0&&(i={}),this.label=t,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null};function ne(e,t){return new O(e,{beforeExpr:!0,binop:t})}var ae={beforeExpr:!0},ee={startsExpr:!0},St={};function V(e,t){return t===void 0&&(t={}),t.keyword=e,St[e]=new O(e,t)}var c={num:new O("num",ee),regexp:new O("regexp",ee),string:new O("string",ee),name:new O("name",ee),privateId:new O("privateId",ee),eof:new O("eof"),bracketL:new O("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new O("]"),braceL:new O("{",{beforeExpr:!0,startsExpr:!0}),braceR:new O("}"),parenL:new O("(",{beforeExpr:!0,startsExpr:!0}),parenR:new O(")"),comma:new O(",",ae),semi:new O(";",ae),colon:new O(":",ae),dot:new O("."),question:new O("?",ae),questionDot:new O("?."),arrow:new O("=>",ae),template:new O("template"),invalidTemplate:new O("invalidTemplate"),ellipsis:new O("...",ae),backQuote:new O("`",ee),dollarBraceL:new O("${",{beforeExpr:!0,startsExpr:!0}),eq:new O("=",{beforeExpr:!0,isAssign:!0}),assign:new O("_=",{beforeExpr:!0,isAssign:!0}),incDec:new O("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new O("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:ne("||",1),logicalAND:ne("&&",2),bitwiseOR:ne("|",3),bitwiseXOR:ne("^",4),bitwiseAND:ne("&",5),equality:ne("==/!=/===/!==",6),relational:ne("</>/<=/>=",7),bitShift:ne("<</>>/>>>",8),plusMin:new O("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:ne("%",10),star:ne("*",10),slash:ne("/",10),starstar:new O("**",{beforeExpr:!0}),coalesce:ne("??",1),_break:V("break"),_case:V("case",ae),_catch:V("catch"),_continue:V("continue"),_debugger:V("debugger"),_default:V("default",ae),_do:V("do",{isLoop:!0,beforeExpr:!0}),_else:V("else",ae),_finally:V("finally"),_for:V("for",{isLoop:!0}),_function:V("function",ee),_if:V("if"),_return:V("return",ae),_switch:V("switch"),_throw:V("throw",ae),_try:V("try"),_var:V("var"),_const:V("const"),_while:V("while",{isLoop:!0}),_with:V("with"),_new:V("new",{beforeExpr:!0,startsExpr:!0}),_this:V("this",ee),_super:V("super",ee),_class:V("class",ee),_extends:V("extends",ae),_export:V("export"),_import:V("import",ee),_null:V("null",ee),_true:V("true",ee),_false:V("false",ee),_in:V("in",{beforeExpr:!0,binop:7}),_instanceof:V("instanceof",{beforeExpr:!0,binop:7}),_typeof:V("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:V("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:V("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},oe=/\r\n?|\n|\u2028|\u2029/,Er=new RegExp(oe.source,"g");function je(e){return e===10||e===13||e===8232||e===8233}function ei(e,t,i){i===void 0&&(i=e.length);for(var r=t;r<i;r++){var s=e.charCodeAt(r);if(je(s))return r<i-1&&s===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var ti=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,he=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ii=Object.prototype,Nr=ii.hasOwnProperty,Cr=ii.toString,$e=Object.hasOwn||function(e,t){return Nr.call(e,t)},ri=Array.isArray||function(e){return Cr.call(e)==="[object Array]"},si=Object.create(null);function ke(e){return si[e]||(si[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function _e(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var kr=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Ye=function(t,i){this.line=t,this.column=i};Ye.prototype.offset=function(t){return new Ye(this.line,this.column+t)};var at=function(t,i,r){this.start=i,this.end=r,t.sourceFile!==null&&(this.source=t.sourceFile)};function ni(e,t){for(var i=1,r=0;;){var s=ei(e,r,t);if(s<0)return new Ye(i,t-r);++i,r=s}}var Et={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},ai=!1;function Ir(e){var t={};for(var i in Et)t[i]=e&&$e(e,i)?e[i]:Et[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!ai&&typeof console=="object"&&console.warn&&(ai=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
19
+ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),ri(t.onToken)){var r=t.onToken;t.onToken=function(s){return r.push(s)}}return ri(t.onComment)&&(t.onComment=Ar(t,t.onComment)),t}function Ar(e,t){return function(i,r,s,n,a,o){var h={type:i?"Block":"Line",value:r,start:s,end:n};e.locations&&(h.loc=new at(this,a,o)),e.ranges&&(h.range=[s,n]),t.push(h)}}var Qe=1,We=2,Nt=4,oi=8,hi=16,ui=32,Ct=64,ci=128,Xe=256,kt=Qe|We|Xe;function It(e,t){return We|(e?Nt:0)|(t?oi:0)}var ot=0,At=1,Se=2,li=3,pi=4,fi=5,q=function(t,i,r){this.options=t=Ir(t),this.sourceFile=t.sourceFile,this.keywords=ke(br[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var s="";t.allowReserved!==!0&&(s=bt[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(s+=" await")),this.reservedWords=ke(s);var n=(s?s+" ":"")+bt.strict;this.reservedWordsStrict=ke(n),this.reservedWordsStrictBind=ke(n+" "+bt.strictBind),this.input=String(i),this.containsEsc=!1,r?(this.pos=r,this.lineStart=this.input.lastIndexOf(`
20
+ `,r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(oe).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=c.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=t.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Qe),this.regexpState=null,this.privateNameStack=[]},ye={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};q.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)},ye.inFunction.get=function(){return(this.currentVarScope().flags&We)>0},ye.inGenerator.get=function(){return(this.currentVarScope().flags&oi)>0&&!this.currentVarScope().inClassFieldInit},ye.inAsync.get=function(){return(this.currentVarScope().flags&Nt)>0&&!this.currentVarScope().inClassFieldInit},ye.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&Xe)return!1;if(t.flags&We)return(t.flags&Nt)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},ye.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&Ct)>0||i||this.options.allowSuperOutsideMethod},ye.allowDirectSuper.get=function(){return(this.currentThisScope().flags&ci)>0},ye.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},ye.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&(We|Xe))>0||i},ye.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Xe)>0},q.extend=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];for(var r=this,s=0;s<t.length;s++)r=t[s](r);return r},q.parse=function(t,i){return new this(i,t).parse()},q.parseExpressionAt=function(t,i,r){var s=new this(r,t,i);return s.nextToken(),s.parseExpression()},q.tokenizer=function(t,i){return new this(i,t)},Object.defineProperties(q.prototype,ye);var Q=q.prototype,Pr=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;Q.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){he.lastIndex=e,e+=he.exec(this.input)[0].length;var t=Pr.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){he.lastIndex=e+t[0].length;var i=he.exec(this.input),r=i.index+i[0].length,s=this.input.charAt(r);return s===";"||s==="}"||oe.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(s)||s==="!"&&this.input.charAt(r+1)==="=")}e+=t[0].length,he.lastIndex=e,e+=he.exec(this.input)[0].length,this.input[e]===";"&&e++}},Q.eat=function(e){return this.type===e?(this.next(),!0):!1},Q.isContextual=function(e){return this.type===c.name&&this.value===e&&!this.containsEsc},Q.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},Q.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},Q.canInsertSemicolon=function(){return this.type===c.eof||this.type===c.braceR||oe.test(this.input.slice(this.lastTokEnd,this.start))},Q.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},Q.semicolon=function(){!this.eat(c.semi)&&!this.insertSemicolon()&&this.unexpected()},Q.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},Q.expect=function(e){this.eat(e)||this.unexpected()},Q.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var ht=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Q.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern")}},Q.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,r=e.doubleProto;if(!t)return i>=0||r>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property")},Q.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},Q.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var N=q.prototype;N.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==c.eof;){var i=this.parseStatement(null,!0,t);e.body.push(i)}if(this.inModule)for(var r=0,s=Object.keys(this.undefinedExports);r<s.length;r+=1){var n=s[r];this.raiseRecoverable(this.undefinedExports[n].start,"Export '"+n+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var Pt={kind:"loop"},Tr={kind:"switch"};N.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;he.lastIndex=this.pos;var t=he.exec(this.input),i=this.pos+t[0].length,r=this.input.charCodeAt(i);if(r===91||r===92)return!0;if(e)return!1;if(r===123||r>55295&&r<56320)return!0;if(ve(r,!0)){for(var s=i+1;Fe(r=this.input.charCodeAt(s),!0);)++s;if(r===92||r>55295&&r<56320)return!0;var n=this.input.slice(i,s);if(!vr.test(n))return!0}return!1},N.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;he.lastIndex=this.pos;var e=he.exec(this.input),t=this.pos+e[0].length,i;return!oe.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(Fe(i=this.input.charCodeAt(t+8))||i>55295&&i<56320))},N.parseStatement=function(e,t,i){var r=this.type,s=this.startNode(),n;switch(this.isLet(e)&&(r=c._var,n="let"),r){case c._break:case c._continue:return this.parseBreakContinueStatement(s,r.keyword);case c._debugger:return this.parseDebuggerStatement(s);case c._do:return this.parseDoStatement(s);case c._for:return this.parseForStatement(s);case c._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case c._class:return e&&this.unexpected(),this.parseClass(s,!0);case c._if:return this.parseIfStatement(s);case c._return:return this.parseReturnStatement(s);case c._switch:return this.parseSwitchStatement(s);case c._throw:return this.parseThrowStatement(s);case c._try:return this.parseTryStatement(s);case c._const:case c._var:return n=n||this.value,e&&n!=="var"&&this.unexpected(),this.parseVarStatement(s,n);case c._while:return this.parseWhileStatement(s);case c._with:return this.parseWithStatement(s);case c.braceL:return this.parseBlock(!0,s);case c.semi:return this.parseEmptyStatement(s);case c._export:case c._import:if(this.options.ecmaVersion>10&&r===c._import){he.lastIndex=this.pos;var a=he.exec(this.input),o=this.pos+a[0].length,h=this.input.charCodeAt(o);if(h===40||h===46)return this.parseExpressionStatement(s,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===c._import?this.parseImport(s):this.parseExport(s,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,!0,!e);var u=this.value,l=this.parseExpression();return r===c.name&&l.type==="Identifier"&&this.eat(c.colon)?this.parseLabeledStatement(s,u,l,e):this.parseExpressionStatement(s,l)}},N.parseBreakContinueStatement=function(e,t){var i=t==="break";this.next(),this.eat(c.semi)||this.insertSemicolon()?e.label=null:this.type!==c.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var r=0;r<this.labels.length;++r){var s=this.labels[r];if((e.label==null||s.name===e.label.name)&&(s.kind!=null&&(i||s.kind==="loop")||e.label&&i))break}return r===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")},N.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},N.parseDoStatement=function(e){return this.next(),this.labels.push(Pt),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(c._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(c.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},N.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Pt),this.enterScope(0),this.expect(c.parenL),this.type===c.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===c._var||this.type===c._const||i){var r=this.startNode(),s=i?"let":this.value;return this.next(),this.parseVar(r,!0,s),this.finishNode(r,"VariableDeclaration"),(this.type===c._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&r.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===c._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,r)):(t>-1&&this.unexpected(t),this.parseFor(e,r))}var n=this.isContextual("let"),a=!1,o=this.containsEsc,h=new ht,u=this.start,l=t>-1?this.parseExprSubscripts(h,"await"):this.parseExpression(!0,h);return this.type===c._in||(a=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===c._in&&this.unexpected(t),e.await=!0):a&&this.options.ecmaVersion>=8&&(l.start===u&&!o&&l.type==="Identifier"&&l.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),n&&a&&this.raise(l.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(l,!1,h),this.checkLValPattern(l),this.parseForIn(e,l)):(this.checkExpressionErrors(h,!0),t>-1&&this.unexpected(t),this.parseFor(e,l))},N.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,Ze|(i?0:Tt),!1,t)},N.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(c._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},N.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(c.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},N.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(c.braceL),this.labels.push(Tr),this.enterScope(0);for(var t,i=!1;this.type!==c.braceR;)if(this.type===c._case||this.type===c._default){var r=this.type===c._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,t.test=null),this.expect(c.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},N.parseThrowStatement=function(e){return this.next(),oe.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Rr=[];N.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?ui:0),this.checkLValPattern(e,t?pi:Se),this.expect(c.parenR),e},N.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===c._catch){var t=this.startNode();this.next(),this.eat(c.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(c._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},N.parseVarStatement=function(e,t,i){return this.next(),this.parseVar(e,!1,t,i),this.semicolon(),this.finishNode(e,"VariableDeclaration")},N.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Pt),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},N.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},N.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},N.parseLabeledStatement=function(e,t,i,r){for(var s=0,n=this.labels;s<n.length;s+=1){var a=n[s];a.name===t&&this.raise(i.start,"Label '"+t+"' is already declared")}for(var o=this.type.isLoop?"loop":this.type===c._switch?"switch":null,h=this.labels.length-1;h>=0;h--){var u=this.labels[h];if(u.statementStart===e.start)u.statementStart=this.start,u.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf("label")===-1?r+"label":r:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")},N.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},N.parseBlock=function(e,t,i){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(c.braceL),e&&this.enterScope(0);this.type!==c.braceR;){var r=this.parseStatement(null);t.body.push(r)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},N.parseFor=function(e,t){return e.init=t,this.expect(c.semi),e.test=this.type===c.semi?null:this.parseExpression(),this.expect(c.semi),e.update=this.type===c.parenR?null:this.parseExpression(),this.expect(c.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},N.parseForIn=function(e,t){var i=this.type===c._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(c.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")},N.parseVar=function(e,t,i,r){for(e.declarations=[],e.kind=i;;){var s=this.startNode();if(this.parseVarId(s,i),this.eat(c.eq)?s.init=this.parseMaybeAssign(t):!r&&i==="const"&&!(this.type===c._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!r&&s.id.type!=="Identifier"&&!(t&&(this.type===c._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):s.init=null,e.declarations.push(this.finishNode(s,"VariableDeclarator")),!this.eat(c.comma))break}return e},N.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?At:Se,!1)};var Ze=1,Tt=2,mi=4;N.parseFunction=function(e,t,i,r,s){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===c.star&&t&Tt&&this.unexpected(),e.generator=this.eat(c.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&Ze&&(e.id=t&mi&&this.type!==c.name?null:this.parseIdent(),e.id&&!(t&Tt)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?At:Se:li));var n=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(It(e.async,e.generator)),t&Ze||(e.id=this.type===c.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,s),this.yieldPos=n,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,t&Ze?"FunctionDeclaration":"FunctionExpression")},N.parseFunctionParams=function(e){this.expect(c.parenL),e.params=this.parseBindingList(c.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},N.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),s=this.startNode(),n=!1;for(s.body=[],this.expect(c.braceL);this.type!==c.braceR;){var a=this.parseClassElement(e.superClass!==null);a&&(s.body.push(a),a.type==="MethodDefinition"&&a.kind==="constructor"?(n&&this.raiseRecoverable(a.start,"Duplicate constructor in the same class"),n=!0):a.key&&a.key.type==="PrivateIdentifier"&&Dr(r,a)&&this.raiseRecoverable(a.key.start,"Identifier '#"+a.key.name+"' has already been declared"))}return this.strict=i,this.next(),e.body=this.finishNode(s,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},N.parseClassElement=function(e){if(this.eat(c.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),r="",s=!1,n=!1,a="method",o=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(c.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===c.star?o=!0:r="static"}if(i.static=o,!r&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===c.star)&&!this.canInsertSemicolon()?n=!0:r="async"),!r&&(t>=9||!n)&&this.eat(c.star)&&(s=!0),!r&&!n&&!s){var h=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?a=h:r=h)}if(r?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=r,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===c.parenL||a!=="method"||s||n){var u=!i.static&&ut(i,"constructor"),l=u&&e;u&&a!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=u?"constructor":a,this.parseClassMethod(i,s,n,l)}else this.parseClassField(i);return i},N.isClassElementNameStart=function(){return this.type===c.name||this.type===c.privateId||this.type===c.num||this.type===c.string||this.type===c.bracketL||this.type.keyword},N.parseClassElementName=function(e){this.type===c.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},N.parseClassMethod=function(e,t,i,r){var s=e.key;e.kind==="constructor"?(t&&this.raise(s.start,"Constructor can't be a generator"),i&&this.raise(s.start,"Constructor can't be an async method")):e.static&&ut(e,"prototype")&&this.raise(s.start,"Classes may not have a static property named prototype");var n=e.value=this.parseMethod(t,i,r);return e.kind==="get"&&n.params.length!==0&&this.raiseRecoverable(n.start,"getter should have no params"),e.kind==="set"&&n.params.length!==1&&this.raiseRecoverable(n.start,"setter should have exactly one param"),e.kind==="set"&&n.params[0].type==="RestElement"&&this.raiseRecoverable(n.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")},N.parseClassField=function(e){if(ut(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&ut(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(c.eq)){var t=this.currentThisScope(),i=t.inClassFieldInit;t.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),t.inClassFieldInit=i}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")},N.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(Xe|Ct);this.type!==c.braceR;){var i=this.parseStatement(null);e.body.push(i)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")},N.parseClassId=function(e,t){this.type===c.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,Se,!1)):(t===!0&&this.unexpected(),e.id=null)},N.parseClassSuper=function(e){e.superClass=this.eat(c._extends)?this.parseExprSubscripts(null,!1):null},N.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},N.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,i=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,s=r===0?null:this.privateNameStack[r-1],n=0;n<i.length;++n){var a=i[n];$e(t,a.name)||(s?s.used.push(a):this.raiseRecoverable(a.start,"Private field '#"+a.name+"' must be declared in an enclosing class"))}};function Dr(e,t){var i=t.key.name,r=e[i],s="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(s=(t.static?"s":"i")+t.kind),r==="iget"&&s==="iset"||r==="iset"&&s==="iget"||r==="sget"&&s==="sset"||r==="sset"&&s==="sget"?(e[i]="true",!1):r?!0:(e[i]=s,!1)}function ut(e,t){var i=e.computed,r=e.key;return!i&&(r.type==="Identifier"&&r.name===t||r.type==="Literal"&&r.value===t)}N.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==c.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")},N.parseExport=function(e,t){if(this.next(),this.eat(c.star))return this.parseExportAllDeclaration(e,t);if(this.eat(c._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==c.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var i=0,r=e.specifiers;i<r.length;i+=1){var s=r[i];this.checkUnreserved(s.local),this.checkLocalExport(s.local),s.local.type==="Literal"&&this.raise(s.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},N.parseExportDeclaration=function(e){return this.parseStatement(null)},N.parseExportDefaultDeclaration=function(){var e;if(this.type===c._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,Ze|mi,!1,e)}else if(this.type===c._class){var i=this.startNode();return this.parseClass(i,"nullableID")}else{var r=this.parseMaybeAssign();return this.semicolon(),r}},N.checkExport=function(e,t,i){e&&(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),$e(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=!0)},N.checkPatternExport=function(e,t){var i=t.type;if(i==="Identifier")this.checkExport(e,t,t.start);else if(i==="ObjectPattern")for(var r=0,s=t.properties;r<s.length;r+=1){var n=s[r];this.checkPatternExport(e,n)}else if(i==="ArrayPattern")for(var a=0,o=t.elements;a<o.length;a+=1){var h=o[a];h&&this.checkPatternExport(e,h)}else i==="Property"?this.checkPatternExport(e,t.value):i==="AssignmentPattern"?this.checkPatternExport(e,t.left):i==="RestElement"&&this.checkPatternExport(e,t.argument)},N.checkVariableExport=function(e,t){if(e)for(var i=0,r=t;i<r.length;i+=1){var s=r[i];this.checkPatternExport(e,s.id)}},N.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()},N.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")},N.parseExportSpecifiers=function(e){var t=[],i=!0;for(this.expect(c.braceL);!this.eat(c.braceR);){if(i)i=!1;else if(this.expect(c.comma),this.afterTrailingComma(c.braceR))break;t.push(this.parseExportSpecifier(e))}return t},N.parseImport=function(e){return this.next(),this.type===c.string?(e.specifiers=Rr,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===c.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},N.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,Se),this.finishNode(e,"ImportSpecifier")},N.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,Se),this.finishNode(e,"ImportDefaultSpecifier")},N.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,Se),this.finishNode(e,"ImportNamespaceSpecifier")},N.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===c.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(c.comma)))return e;if(this.type===c.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(c.braceL);!this.eat(c.braceR);){if(t)t=!1;else if(this.expect(c.comma),this.afterTrailingComma(c.braceR))break;e.push(this.parseImportSpecifier())}return e},N.parseWithClause=function(){var e=[];if(!this.eat(c._with))return e;this.expect(c.braceL);for(var t={},i=!0;!this.eat(c.braceR);){if(i)i=!1;else if(this.expect(c.comma),this.afterTrailingComma(c.braceR))break;var r=this.parseImportAttribute(),s=r.key.type==="Identifier"?r.key.name:r.key.value;$e(t,s)&&this.raiseRecoverable(r.key.start,"Duplicate attribute key '"+s+"'"),t[s]=!0,e.push(r)}return e},N.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===c.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(c.colon),this.type!==c.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")},N.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===c.string){var e=this.parseLiteral(this.value);return kr.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)},N.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},N.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var ue=q.prototype;ue.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var r=0,s=e.properties;r<s.length;r+=1){var n=s[r];this.toAssignable(n,t),n.type==="RestElement"&&(n.argument.type==="ArrayPattern"||n.argument.type==="ObjectPattern")&&this.raise(n.argument.start,"Unexpected token")}break;case"Property":e.kind!=="init"&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern"&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":e.operator!=="="&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return e},ue.toAssignableList=function(e,t){for(var i=e.length,r=0;r<i;r++){var s=e[r];s&&this.toAssignable(s,t)}if(i){var n=e[i-1];this.options.ecmaVersion===6&&t&&n&&n.type==="RestElement"&&n.argument.type!=="Identifier"&&this.unexpected(n.argument.start)}return e},ue.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},ue.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==c.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")},ue.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case c.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(c.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case c.braceL:return this.parseObj(!0)}return this.parseIdent()},ue.parseBindingList=function(e,t,i,r){for(var s=[],n=!0;!this.eat(e);)if(n?n=!1:this.expect(c.comma),t&&this.type===c.comma)s.push(null);else{if(i&&this.afterTrailingComma(e))break;if(this.type===c.ellipsis){var a=this.parseRestBinding();this.parseBindingListItem(a),s.push(a),this.type===c.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else s.push(this.parseAssignableListItem(r))}return s},ue.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},ue.parseBindingListItem=function(e){return e},ue.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(c.eq))return i;var r=this.startNodeAt(e,t);return r.left=i,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")},ue.checkLValSimple=function(e,t,i){t===void 0&&(t=ot);var r=t!==ot;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?"Binding ":"Assigning to ")+e.name+" in strict mode"),r&&(t===Se&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&($e(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=!0),t!==fi&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":r&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return r&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(r?"Binding":"Assigning to")+" rvalue")}},ue.checkLValPattern=function(e,t,i){switch(t===void 0&&(t=ot),e.type){case"ObjectPattern":for(var r=0,s=e.properties;r<s.length;r+=1){var n=s[r];this.checkLValInnerPattern(n,t,i)}break;case"ArrayPattern":for(var a=0,o=e.elements;a<o.length;a+=1){var h=o[a];h&&this.checkLValInnerPattern(h,t,i)}break;default:this.checkLValSimple(e,t,i)}},ue.checkLValInnerPattern=function(e,t,i){switch(t===void 0&&(t=ot),e.type){case"Property":this.checkLValInnerPattern(e.value,t,i);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case"RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i)}};var me=function(t,i,r,s,n){this.token=t,this.isExpr=!!i,this.preserveSpace=!!r,this.override=s,this.generator=!!n},$={b_stat:new me("{",!1),b_expr:new me("{",!0),b_tmpl:new me("${",!1),p_stat:new me("(",!1),p_expr:new me("(",!0),q_tmpl:new me("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new me("function",!1),f_expr:new me("function",!0),f_expr_gen:new me("function",!0,!1,null,!0),f_gen:new me("function",!1,!1,null,!0)},qe=q.prototype;qe.initialContext=function(){return[$.b_stat]},qe.curContext=function(){return this.context[this.context.length-1]},qe.braceIsBlock=function(e){var t=this.curContext();return t===$.f_expr||t===$.f_stat?!0:e===c.colon&&(t===$.b_stat||t===$.b_expr)?!t.isExpr:e===c._return||e===c.name&&this.exprAllowed?oe.test(this.input.slice(this.lastTokEnd,this.start)):e===c._else||e===c.semi||e===c.eof||e===c.parenR||e===c.arrow?!0:e===c.braceL?t===$.b_stat:e===c._var||e===c._const||e===c.name?!1:!this.exprAllowed},qe.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function")return t.generator}return!1},qe.updateContext=function(e){var t,i=this.type;i.keyword&&e===c.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr},qe.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},c.parenR.updateContext=c.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===$.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr},c.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?$.b_stat:$.b_expr),this.exprAllowed=!0},c.dollarBraceL.updateContext=function(){this.context.push($.b_tmpl),this.exprAllowed=!0},c.parenL.updateContext=function(e){var t=e===c._if||e===c._for||e===c._with||e===c._while;this.context.push(t?$.p_stat:$.p_expr),this.exprAllowed=!0},c.incDec.updateContext=function(){},c._function.updateContext=c._class.updateContext=function(e){e.beforeExpr&&e!==c._else&&!(e===c.semi&&this.curContext()!==$.p_stat)&&!(e===c._return&&oe.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===c.colon||e===c.braceL)&&this.curContext()===$.b_stat)?this.context.push($.f_expr):this.context.push($.f_stat),this.exprAllowed=!1},c.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0},c.backQuote.updateContext=function(){this.curContext()===$.q_tmpl?this.context.pop():this.context.push($.q_tmpl),this.exprAllowed=!1},c.star.updateContext=function(e){if(e===c._function){var t=this.context.length-1;this.context[t]===$.f_expr?this.context[t]=$.f_expr_gen:this.context[t]=$.f_gen}this.exprAllowed=!0},c.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==c.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var P=q.prototype;P.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&e.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,s;switch(r.type){case"Identifier":s=r.name;break;case"Literal":s=String(r.value);break;default:return}var n=e.kind;if(this.options.ecmaVersion>=6){s==="__proto__"&&n==="init"&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=r.start):this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),t.proto=!0);return}s="$"+s;var a=t[s];if(a){var o;n==="init"?o=this.strict&&a.init||a.get||a.set:o=a.init||a[n],o&&this.raiseRecoverable(r.start,"Redefinition of property")}else a=t[s]={init:!1,get:!1,set:!1};a[n]=!0}},P.parseExpression=function(e,t){var i=this.start,r=this.startLoc,s=this.parseMaybeAssign(e,t);if(this.type===c.comma){var n=this.startNodeAt(i,r);for(n.expressions=[s];this.eat(c.comma);)n.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(n,"SequenceExpression")}return s},P.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,s=-1,n=-1,a=-1;t?(s=t.parenthesizedAssign,n=t.trailingComma,a=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new ht,r=!0);var o=this.start,h=this.startLoc;(this.type===c.parenL||this.type===c.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var u=this.parseMaybeConditional(e,t);if(i&&(u=i.call(this,u,o,h)),this.type.isAssign){var l=this.startNodeAt(o,h);return l.operator=this.value,this.type===c.eq&&(u=this.toAssignable(u,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=u.start&&(t.shorthandAssign=-1),this.type===c.eq?this.checkLValPattern(u):this.checkLValSimple(u),l.left=u,this.next(),l.right=this.parseMaybeAssign(e),a>-1&&(t.doubleProto=a),this.finishNode(l,"AssignmentExpression")}else r&&this.checkExpressionErrors(t,!0);return s>-1&&(t.parenthesizedAssign=s),n>-1&&(t.trailingComma=n),u},P.parseMaybeConditional=function(e,t){var i=this.start,r=this.startLoc,s=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return s;if(this.eat(c.question)){var n=this.startNodeAt(i,r);return n.test=s,n.consequent=this.parseMaybeAssign(),this.expect(c.colon),n.alternate=this.parseMaybeAssign(e),this.finishNode(n,"ConditionalExpression")}return s},P.parseExprOps=function(e,t){var i=this.start,r=this.startLoc,s=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||s.start===i&&s.type==="ArrowFunctionExpression"?s:this.parseExprOp(s,i,r,-1,e)},P.parseExprOp=function(e,t,i,r,s){var n=this.type.binop;if(n!=null&&(!s||this.type!==c._in)&&n>r){var a=this.type===c.logicalOR||this.type===c.logicalAND,o=this.type===c.coalesce;o&&(n=c.logicalAND.binop);var h=this.value;this.next();var u=this.start,l=this.startLoc,f=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,s),u,l,n,s),g=this.buildBinary(t,i,e,f,h,a||o);return(a&&this.type===c.coalesce||o&&(this.type===c.logicalOR||this.type===c.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(g,t,i,r,s)}return e},P.buildBinary=function(e,t,i,r,s,n){r.type==="PrivateIdentifier"&&this.raise(r.start,"Private identifier can only be left side of binary expression");var a=this.startNodeAt(e,t);return a.left=i,a.operator=s,a.right=r,this.finishNode(a,n?"LogicalExpression":"BinaryExpression")},P.parseMaybeUnary=function(e,t,i,r){var s=this.start,n=this.startLoc,a;if(this.isContextual("await")&&this.canAwait)a=this.parseAwait(r),t=!0;else if(this.type.prefix){var o=this.startNode(),h=this.type===c.incDec;o.operator=this.value,o.prefix=!0,this.next(),o.argument=this.parseMaybeUnary(null,!0,h,r),this.checkExpressionErrors(e,!0),h?this.checkLValSimple(o.argument):this.strict&&o.operator==="delete"&&di(o.argument)?this.raiseRecoverable(o.start,"Deleting local variable in strict mode"):o.operator==="delete"&&Rt(o.argument)?this.raiseRecoverable(o.start,"Private fields can not be deleted"):t=!0,a=this.finishNode(o,h?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===c.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),a=this.parsePrivateIdent(),this.type!==c._in&&this.unexpected();else{if(a=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return a;for(;this.type.postfix&&!this.canInsertSemicolon();){var u=this.startNodeAt(s,n);u.operator=this.value,u.prefix=!1,u.argument=a,this.checkLValSimple(a),this.next(),a=this.finishNode(u,"UpdateExpression")}}if(!i&&this.eat(c.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(s,n,a,this.parseMaybeUnary(null,!1,!1,r),"**",!1);else return a};function di(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&di(e.expression)}function Rt(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&Rt(e.expression)||e.type==="ParenthesizedExpression"&&Rt(e.expression)}P.parseExprSubscripts=function(e,t){var i=this.start,r=this.startLoc,s=this.parseExprAtom(e,t);if(s.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return s;var n=this.parseSubscripts(s,i,r,!1,t);return e&&n.type==="MemberExpression"&&(e.parenthesizedAssign>=n.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=n.start&&(e.parenthesizedBind=-1),e.trailingComma>=n.start&&(e.trailingComma=-1)),n},P.parseSubscripts=function(e,t,i,r,s){for(var n=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,a=!1;;){var o=this.parseSubscript(e,t,i,r,n,a,s);if(o.optional&&(a=!0),o===e||o.type==="ArrowFunctionExpression"){if(a){var h=this.startNodeAt(t,i);h.expression=o,o=this.finishNode(h,"ChainExpression")}return o}e=o}},P.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(c.arrow)},P.parseSubscriptAsyncArrow=function(e,t,i,r){return this.parseArrowExpression(this.startNodeAt(e,t),i,!0,r)},P.parseSubscript=function(e,t,i,r,s,n,a){var o=this.options.ecmaVersion>=11,h=o&&this.eat(c.questionDot);r&&h&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var u=this.eat(c.bracketL);if(u||h&&this.type!==c.parenL&&this.type!==c.backQuote||this.eat(c.dot)){var l=this.startNodeAt(t,i);l.object=e,u?(l.property=this.parseExpression(),this.expect(c.bracketR)):this.type===c.privateId&&e.type!=="Super"?l.property=this.parsePrivateIdent():l.property=this.parseIdent(this.options.allowReserved!=="never"),l.computed=!!u,o&&(l.optional=h),e=this.finishNode(l,"MemberExpression")}else if(!r&&this.eat(c.parenL)){var f=new ht,g=this.yieldPos,p=this.awaitPos,x=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var y=this.parseExprList(c.parenR,this.options.ecmaVersion>=8,!1,f);if(s&&!h&&this.shouldParseAsyncArrow())return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=g,this.awaitPos=p,this.awaitIdentPos=x,this.parseSubscriptAsyncArrow(t,i,y,a);this.checkExpressionErrors(f,!0),this.yieldPos=g||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=x||this.awaitIdentPos;var w=this.startNodeAt(t,i);w.callee=e,w.arguments=y,o&&(w.optional=h),e=this.finishNode(w,"CallExpression")}else if(this.type===c.backQuote){(h||n)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var E=this.startNodeAt(t,i);E.tag=e,E.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(E,"TaggedTemplateExpression")}return e},P.parseExprAtom=function(e,t,i){this.type===c.slash&&this.readRegexp();var r,s=this.potentialArrowAt===this.start;switch(this.type){case c._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),r=this.startNode(),this.next(),this.type===c.parenL&&!this.allowDirectSuper&&this.raise(r.start,"super() call outside constructor of a subclass"),this.type!==c.dot&&this.type!==c.bracketL&&this.type!==c.parenL&&this.unexpected(),this.finishNode(r,"Super");case c._this:return r=this.startNode(),this.next(),this.finishNode(r,"ThisExpression");case c.name:var n=this.start,a=this.startLoc,o=this.containsEsc,h=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&h.name==="async"&&!this.canInsertSemicolon()&&this.eat(c._function))return this.overrideContext($.f_expr),this.parseFunction(this.startNodeAt(n,a),0,!1,!0,t);if(s&&!this.canInsertSemicolon()){if(this.eat(c.arrow))return this.parseArrowExpression(this.startNodeAt(n,a),[h],!1,t);if(this.options.ecmaVersion>=8&&h.name==="async"&&this.type===c.name&&!o&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return h=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(c.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,a),[h],!0,t)}return h;case c.regexp:var u=this.value;return r=this.parseLiteral(u.value),r.regex={pattern:u.pattern,flags:u.flags},r;case c.num:case c.string:return this.parseLiteral(this.value);case c._null:case c._true:case c._false:return r=this.startNode(),r.value=this.type===c._null?null:this.type===c._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,"Literal");case c.parenL:var l=this.start,f=this.parseParenAndDistinguishExpression(s,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(f)&&(e.parenthesizedAssign=l),e.parenthesizedBind<0&&(e.parenthesizedBind=l)),f;case c.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(c.bracketR,!0,!0,e),this.finishNode(r,"ArrayExpression");case c.braceL:return this.overrideContext($.b_expr),this.parseObj(!1,e);case c._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case c._class:return this.parseClass(this.startNode(),!1);case c._new:return this.parseNew();case c.backQuote:return this.parseTemplate();case c._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}},P.parseExprAtomDefault=function(){this.unexpected()},P.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===c.parenL&&!e)return this.parseDynamicImport(t);if(this.type===c.dot){var i=this.startNodeAt(t.start,t.loc&&t.loc.start);return i.name="import",t.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(t)}else this.unexpected()},P.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(c.parenR)?e.options=null:(this.expect(c.comma),this.afterTrailingComma(c.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(c.parenR)||(this.expect(c.comma),this.afterTrailingComma(c.parenR)||this.unexpected())));else if(!this.eat(c.parenR)){var t=this.start;this.eat(c.comma)&&this.eat(c.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},P.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},P.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},P.parseParenExpression=function(){this.expect(c.parenL);var e=this.parseExpression();return this.expect(c.parenR),e},P.shouldParseArrow=function(e){return!this.canInsertSemicolon()},P.parseParenAndDistinguishExpression=function(e,t){var i=this.start,r=this.startLoc,s,n=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var a=this.start,o=this.startLoc,h=[],u=!0,l=!1,f=new ht,g=this.yieldPos,p=this.awaitPos,x;for(this.yieldPos=0,this.awaitPos=0;this.type!==c.parenR;)if(u?u=!1:this.expect(c.comma),n&&this.afterTrailingComma(c.parenR,!0)){l=!0;break}else if(this.type===c.ellipsis){x=this.start,h.push(this.parseParenItem(this.parseRestBinding())),this.type===c.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else h.push(this.parseMaybeAssign(!1,f,this.parseParenItem));var y=this.lastTokEnd,w=this.lastTokEndLoc;if(this.expect(c.parenR),e&&this.shouldParseArrow(h)&&this.eat(c.arrow))return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=g,this.awaitPos=p,this.parseParenArrowList(i,r,h,t);(!h.length||l)&&this.unexpected(this.lastTokStart),x&&this.unexpected(x),this.checkExpressionErrors(f,!0),this.yieldPos=g||this.yieldPos,this.awaitPos=p||this.awaitPos,h.length>1?(s=this.startNodeAt(a,o),s.expressions=h,this.finishNodeAt(s,"SequenceExpression",y,w)):s=h[0]}else s=this.parseParenExpression();if(this.options.preserveParens){var E=this.startNodeAt(i,r);return E.expression=s,this.finishNode(E,"ParenthesizedExpression")}else return s},P.parseParenItem=function(e){return e},P.parseParenArrowList=function(e,t,i,r){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,r)};var Vr=[];P.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===c.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var i=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var r=this.start,s=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,s,!0,!1),this.eat(c.parenL)?e.arguments=this.parseExprList(c.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Vr,this.finishNode(e,"NewExpression")},P.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===c.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,`
21
21
  `),cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
22
- `),cooked:this.value},this.next(),i.tail=this.type===l.backQuote,this.finishNode(i,"TemplateElement")},A.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var i=this.startNode();this.next(),i.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(i.quasis=[r];!r.tail;)this.type===l.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(l.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(l.braceR),i.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")},A.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===l.name||this.type===l.num||this.type===l.string||this.type===l.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===l.star)&&!re.test(this.input.slice(this.lastTokEnd,this.start))},A.parseObj=function(e,t){var i=this.startNode(),r=!0,n={};for(i.properties=[],this.next();!this.eat(l.braceR);){if(r)r=!1;else if(this.expect(l.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(l.braceR))break;var s=this.parseProperty(e,t);e||this.checkPropClash(s,n,t),i.properties.push(s)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")},A.parseProperty=function(e,t){var i=this.startNode(),r,n,s,a;if(this.options.ecmaVersion>=9&&this.eat(l.ellipsis))return e?(i.argument=this.parseIdent(!1),this.type===l.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,t),this.type===l.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(e||t)&&(s=this.start,a=this.startLoc),e||(r=this.eat(l.star)));var o=this.containsEsc;return this.parsePropertyName(i),!e&&!o&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(i)?(n=!0,r=this.options.ecmaVersion>=9&&this.eat(l.star),this.parsePropertyName(i)):n=!1,this.parsePropertyValue(i,e,r,n,s,a,t,o),this.finishNode(i,"Property")},A.parseGetterSetter=function(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var t=e.kind==="get"?0:1;if(e.value.params.length!==t){var i=e.value.start;e.kind==="get"?this.raiseRecoverable(i,"getter should have no params"):this.raiseRecoverable(i,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")},A.parsePropertyValue=function(e,t,i,r,n,s,a,o){(i||r)&&this.type===l.colon&&this.unexpected(),this.eat(l.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),e.kind="init"):this.options.ecmaVersion>=6&&this.type===l.parenL?(t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(i,r)):!t&&!o&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==l.comma&&this.type!==l.braceR&&this.type!==l.eq?((i||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((i||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=n),e.kind="init",t?e.value=this.parseMaybeDefault(n,s,this.copyNode(e.key)):this.type===l.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),e.value=this.parseMaybeDefault(n,s,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()},A.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(l.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(l.bracketR),e.key;e.computed=!1}return e.key=this.type===l.num||this.type===l.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")},A.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},A.parseMethod=function(e,t,i){var r=this.startNode(),n=this.yieldPos,s=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(mt(t,r.generator)|pt|(i?zt:0)),this.expect(l.parenL),r.params=this.parseBindingList(l.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=n,this.awaitPos=s,this.awaitIdentPos=a,this.finishNode(r,"FunctionExpression")},A.parseArrowExpression=function(e,t,i,r){var n=this.yieldPos,s=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(mt(i,!1)|qt),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=n,this.awaitPos=s,this.awaitIdentPos=a,this.finishNode(e,"ArrowFunctionExpression")},A.parseFunctionBody=function(e,t,i,r){var n=t&&this.type!==l.braceL,s=this.strict,a=!1;if(n)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!s||o)&&(a=this.strictDirective(this.end),a&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var u=this.labels;this.labels=[],a&&(this.strict=!0),this.checkParams(e,!s&&!a&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,Kt),e.body=this.parseBlock(!1,void 0,a&&!s),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=u}this.exitScope()},A.isSimpleParamList=function(e){for(var t=0,i=e;t<i.length;t+=1){var r=i[t];if(r.type!=="Identifier")return!1}return!0},A.checkParams=function(e,t){for(var i=Object.create(null),r=0,n=e.params;r<n.length;r+=1){var s=n[r];this.checkLValInnerPattern(s,dt,t?null:i)}},A.parseExprList=function(e,t,i,r){for(var n=[],s=!0;!this.eat(e);){if(s)s=!1;else if(this.expect(l.comma),t&&this.afterTrailingComma(e))break;var a=void 0;i&&this.type===l.comma?a=null:this.type===l.ellipsis?(a=this.parseSpread(r),r&&this.type===l.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):a=this.parseMaybeAssign(!1,r),n.push(a)}return n},A.checkUnreserved=function(e){var t=e.start,i=e.end,r=e.name;if(this.inGenerator&&r==="yield"&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().inClassFieldInit&&r==="arguments"&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(r==="arguments"||r==="await")&&this.raise(t,"Cannot use "+r+" in class static initialization block"),this.keywords.test(r)&&this.raise(t,"Unexpected keyword '"+r+"'"),!(this.options.ecmaVersion<6&&this.input.slice(t,i).indexOf("\\")!==-1)){var n=this.strict?this.reservedWordsStrict:this.reservedWords;n.test(r)&&(!this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+r+"' is reserved"))}},A.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),t.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t},A.parseIdentNode=function(){var e=this.startNode();return this.type===l.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,(e.name==="class"||e.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=l.name):this.unexpected(),e},A.parsePrivateIdent=function(){var e=this.startNode();return this.type===l.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},A.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===l.semi||this.canInsertSemicolon()||this.type!==l.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(l.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")},A.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var Qe=$.prototype;Qe.raise=function(e,t){var i=Ft(this.input,e);t+=" ("+i.line+":"+i.column+")";var r=new SyntaxError(t);throw r.pos=e,r.loc=i,r.raisedAt=this.pos,r},Qe.raiseRecoverable=Qe.raise,Qe.curPosition=function(){if(this.options.locations)return new Re(this.curLine,this.pos-this.lineStart)};var _e=$.prototype,ar=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[],this.inClassFieldInit=!1};_e.enterScope=function(e){this.scopeStack.push(new ar(e))},_e.exitScope=function(){this.scopeStack.pop()},_e.treatFunctionsAsVarInScope=function(e){return e.flags&Pe||!this.inModule&&e.flags&De},_e.declareName=function(e,t,i){var r=!1;if(t===xe){var n=this.currentScope();r=n.lexical.indexOf(e)>-1||n.functions.indexOf(e)>-1||n.var.indexOf(e)>-1,n.lexical.push(e),this.inModule&&n.flags&De&&delete this.undefinedExports[e]}else if(t===Ht){var s=this.currentScope();s.lexical.push(e)}else if(t===Gt){var a=this.currentScope();this.treatFunctionsAsVar?r=a.lexical.indexOf(e)>-1:r=a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var u=this.scopeStack[o];if(u.lexical.indexOf(e)>-1&&!(u.flags&Ut&&u.lexical[0]===e)||!this.treatFunctionsAsVarInScope(u)&&u.functions.indexOf(e)>-1){r=!0;break}if(u.var.push(e),this.inModule&&u.flags&De&&delete this.undefinedExports[e],u.flags&ft)break}r&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")},_e.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},_e.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},_e.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&ft)return t}},_e.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&ft&&!(t.flags&qt))return t}};var Xe=function(t,i,r){this.type="",this.start=i,this.end=0,t.options.locations&&(this.loc=new ze(t,r)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[i,0])},Fe=$.prototype;Fe.startNode=function(){return new Xe(this,this.start,this.startLoc)},Fe.startNodeAt=function(e,t){return new Xe(this,e,t)};function Yt(e,t,i,r){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=i),e}Fe.finishNode=function(e,t){return Yt.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},Fe.finishNodeAt=function(e,t,i,r){return Yt.call(this,e,t,i,r)},Fe.copyNode=function(e){var t=new Xe(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var or="Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz",Zt="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Jt=Zt+" Extended_Pictographic",ei=Jt,ti=ei+" EBase EComp EMod EPres ExtPict",ii=ti,ur=ii,cr={9:Zt,10:Jt,11:ei,12:ti,13:ii,14:ur},lr="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",hr={9:"",10:"",11:"",12:"",13:"",14:lr},ri="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",ni="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",si=ni+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",ai=si+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",oi=ai+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",ui=oi+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",pr=ui+" "+or,fr={9:ni,10:si,11:ai,12:oi,13:ui,14:pr},ci={};function mr(e){var t=ci[e]={binary:we(cr[e]+" "+ri),binaryOfStrings:we(hr[e]),nonBinary:{General_Category:we(ri),Script:we(fr[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var bt=0,li=[9,10,11,12,13,14];bt<li.length;bt+=1){var dr=li[bt];mr(dr)}var w=$.prototype,Ye=function(t,i){this.parent=t,this.base=i||this};Ye.prototype.separatedFrom=function(t){for(var i=this;i;i=i.parent)for(var r=t;r;r=r.parent)if(i.base===r.base&&i!==r)return!0;return!1},Ye.prototype.sibling=function(){return new Ye(this.parent,this.base)};var me=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":"")+(t.options.ecmaVersion>=15?"v":""),this.unicodeProperties=ci[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};me.prototype.reset=function(t,i,r){var n=r.indexOf("v")!==-1,s=r.indexOf("u")!==-1;this.start=t|0,this.source=i+"",this.flags=r,n&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=s&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=s&&this.parser.options.ecmaVersion>=9)},me.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)},me.prototype.at=function(t,i){i===void 0&&(i=!1);var r=this.source,n=r.length;if(t>=n)return-1;var s=r.charCodeAt(t);if(!(i||this.switchU)||s<=55295||s>=57344||t+1>=n)return s;var a=r.charCodeAt(t+1);return a>=56320&&a<=57343?(s<<10)+a-56613888:s},me.prototype.nextIndex=function(t,i){i===void 0&&(i=!1);var r=this.source,n=r.length;if(t>=n)return n;var s=r.charCodeAt(t),a;return!(i||this.switchU)||s<=55295||s>=57344||t+1>=n||(a=r.charCodeAt(t+1))<56320||a>57343?t+1:t+2},me.prototype.current=function(t){return t===void 0&&(t=!1),this.at(this.pos,t)},me.prototype.lookahead=function(t){return t===void 0&&(t=!1),this.at(this.nextIndex(this.pos,t),t)},me.prototype.advance=function(t){t===void 0&&(t=!1),this.pos=this.nextIndex(this.pos,t)},me.prototype.eat=function(t,i){return i===void 0&&(i=!1),this.current(i)===t?(this.advance(i),!0):!1},me.prototype.eatChars=function(t,i){i===void 0&&(i=!1);for(var r=this.pos,n=0,s=t;n<s.length;n+=1){var a=s[n],o=this.at(r,i);if(o===-1||o!==a)return!1;r=this.nextIndex(r,i)}return this.pos=r,!0},w.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,r=!1,n=!1,s=0;s<i.length;s++){var a=i.charAt(s);t.indexOf(a)===-1&&this.raise(e.start,"Invalid regular expression flag"),i.indexOf(a,s+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),a==="u"&&(r=!0),a==="v"&&(n=!0)}this.options.ecmaVersion>=15&&r&&n&&this.raise(e.start,"Invalid regular expression flag")};function gr(e){for(var t in e)return!0;return!1}w.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&gr(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},w.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,i=e.backReferenceNames;t<i.length;t+=1){var r=i[t];e.groupNames[r]||e.raise("Invalid named capture referenced")}},w.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new Ye(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")},w.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},w.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1},w.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var i=!1;if(this.options.ecmaVersion>=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,!0}return e.pos=t,!1},w.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1},w.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},w.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var r=0,n=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue),e.eat(125)))return n!==-1&&n<r&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=i}return!1},w.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},w.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},w.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var i=this.regexp_eatModifiers(e),r=e.eat(45);if(i||r){for(var n=0;n<i.length;n++){var s=i.charAt(n);i.indexOf(s,n+1)>-1&&e.raise("Duplicate regular expression modifiers")}if(r){var a=this.regexp_eatModifiers(e);!i&&!a&&e.current()===58&&e.raise("Invalid regular expression modifiers");for(var o=0;o<a.length;o++){var u=a.charAt(o);(a.indexOf(u,o+1)>-1||i.indexOf(u)>-1)&&e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1},w.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},w.regexp_eatModifiers=function(e){for(var t="",i=0;(i=e.current())!==-1&&xr(i);)t+=ge(i),e.advance();return t};function xr(e){return e===105||e===109||e===115}w.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},w.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},w.regexp_eatSyntaxCharacter=function(e){var t=e.current();return hi(t)?(e.lastIntValue=t,e.advance(),!0):!1};function hi(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}w.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;(i=e.current())!==-1&&!hi(i);)e.advance();return e.pos!==t},w.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1},w.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,i=e.groupNames[e.lastStringValue];if(i)if(t)for(var r=0,n=i;r<n.length;r+=1){var s=n[r];s.separatedFrom(e.branchID)||e.raise("Duplicate capture group name")}else e.raise("Duplicate capture group name");t?(i||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},w.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},w.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=ge(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=ge(e.lastIntValue);return!0}return!1},w.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),yr(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function yr(e){return de(e,!0)||e===36||e===95}w.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),br(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function br(e){return ke(e,!0)||e===36||e===95||e===8204||e===8205}w.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},w.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),!0;if(i<=e.numCapturingParens)return!0;e.pos=t}return!1},w.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},w.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},w.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},w.regexp_eatZero=function(e){return e.current()===48&&!Ze(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1},w.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1},w.regexp_eatControlLetter=function(e){var t=e.current();return pi(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function pi(e){return e>=65&&e<=90||e>=97&&e<=122}w.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var i=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var n=e.lastIntValue;if(r&&n>=55296&&n<=56319){var s=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(a>=56320&&a<=57343)return e.lastIntValue=(n-55296)*1024+(a-56320)+65536,!0}e.pos=s,e.lastIntValue=n}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&vr(e.lastIntValue))return!0;r&&e.raise("Invalid unicode escape"),e.pos=i}return!1};function vr(e){return e>=0&&e<=1114111}w.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1},w.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var fi=0,ye=1,ae=2;w.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(wr(t))return e.lastIntValue=-1,e.advance(),ye;var i=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((i=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return i&&r===ae&&e.raise("Invalid property name"),r;e.raise("Invalid property name")}return fi};function wr(e){return e===100||e===68||e===115||e===83||e===119||e===87}w.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,r),ye}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,n)}return fi},w.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){Ae(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")},w.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return ye;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return ae;e.raise("Invalid property name")},w.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";mi(t=e.current());)e.lastStringValue+=ge(t),e.advance();return e.lastStringValue!==""};function mi(e){return pi(e)||e===95}w.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";_r(t=e.current());)e.lastStringValue+=ge(t),e.advance();return e.lastStringValue!==""};function _r(e){return mi(e)||Ze(e)}w.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},w.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),i=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&i===ae&&e.raise("Negated character class may contain strings"),!0}return!1},w.regexp_classContents=function(e){return e.current()===93?ye:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),ye)},w.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;e.switchU&&(t===-1||i===-1)&&e.raise("Invalid character class"),t!==-1&&i!==-1&&t>i&&e.raise("Range out of order in character class")}}},w.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var i=e.current();(i===99||xi(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var r=e.current();return r!==93?(e.lastIntValue=r,e.advance(),!0):!1},w.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},w.regexp_classSetExpression=function(e){var t=ye,i;if(!this.regexp_eatClassSetRange(e))if(i=this.regexp_eatClassSetOperand(e)){i===ae&&(t=ae);for(var r=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(i=this.regexp_eatClassSetOperand(e))){i!==ae&&(t=ye);continue}e.raise("Invalid character in character class")}if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(r!==e.pos)return t}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(i=this.regexp_eatClassSetOperand(e),!i)return t;i===ae&&(t=ae)}},w.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var i=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return i!==-1&&r!==-1&&i>r&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1},w.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?ye:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},w.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var i=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return i&&r===ae&&e.raise("Negated character class may contain strings"),r;e.pos=t}if(e.eat(92)){var n=this.regexp_eatCharacterClassEscape(e);if(n)return n;e.pos=t}return null},w.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var i=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return i}else e.raise("Invalid escape");e.pos=t}return null},w.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===ae&&(t=ae);return t},w.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?ye:ae},w.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var i=e.current();return i<0||i===e.lookahead()&&Sr(i)||Nr(i)?!1:(e.advance(),e.lastIntValue=i,!0)};function Sr(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function Nr(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}w.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return Cr(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Cr(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}w.regexp_eatClassControlLetter=function(e){var t=e.current();return Ze(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1},w.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},w.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Ze(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t};function Ze(e){return e>=48&&e<=57}w.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;di(i=e.current());)e.lastIntValue=16*e.lastIntValue+gi(i),e.advance();return e.pos!==t};function di(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function gi(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}w.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+i*8+e.lastIntValue:e.lastIntValue=t*8+i}else e.lastIntValue=t;return!0}return!1},w.regexp_eatOctalDigit=function(e){var t=e.current();return xi(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function xi(e){return e>=48&&e<=55}w.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var n=e.current();if(!di(n))return e.pos=i,!1;e.lastIntValue=16*e.lastIntValue+gi(n),e.advance()}return!0};var vt=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new ze(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])},T=$.prototype;T.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new vt(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},T.getToken=function(){return this.next(),new vt(this)},typeof Symbol<"u"&&(T[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===l.eof,value:t}}}}),T.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(l.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())},T.readToken=function(e){return de(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},T.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888},T.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var r=void 0,n=t;(r=Bt(this.input,n,this.pos))>-1;)++this.curLine,n=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,i),t,this.pos,e,this.curPosition())},T.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!Ie(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition())},T.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(e>8&&e<14||e>=5760&&Rt.test(String.fromCharCode(e)))++this.pos;else break e}}},T.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i)},T.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(l.ellipsis)):(++this.pos,this.finishToken(l.dot))},T.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(l.assign,2):this.finishOp(l.slash,1)},T.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,r=e===42?l.star:l.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++i,r=l.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(l.assign,i+1):this.finishOp(r,i)},T.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(l.assign,3)}return this.finishOp(e===124?l.logicalOR:l.logicalAND,2)}return t===61?this.finishOp(l.assign,2):this.finishOp(e===124?l.bitwiseOR:l.bitwiseAND,1)},T.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(l.assign,2):this.finishOp(l.bitwiseXOR,1)},T.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||re.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(l.incDec,2):t===61?this.finishOp(l.assign,2):this.finishOp(l.plusMin,1)},T.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(l.assign,i+1):this.finishOp(l.bitShift,i)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(i=2),this.finishOp(l.relational,i))},T.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(l.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(l.arrow)):this.finishOp(e===61?l.eq:l.prefix,1)},T.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(l.questionDot,2)}if(t===63){if(e>=12){var r=this.input.charCodeAt(this.pos+2);if(r===61)return this.finishOp(l.assign,3)}return this.finishOp(l.coalesce,2)}}return this.finishOp(l.question,1)},T.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),de(t,!0)||t===92))return this.finishToken(l.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+ge(t)+"'")},T.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(l.parenL);case 41:return++this.pos,this.finishToken(l.parenR);case 59:return++this.pos,this.finishToken(l.semi);case 44:return++this.pos,this.finishToken(l.comma);case 91:return++this.pos,this.finishToken(l.bracketL);case 93:return++this.pos,this.finishToken(l.bracketR);case 123:return++this.pos,this.finishToken(l.braceL);case 125:return++this.pos,this.finishToken(l.braceR);case 58:return++this.pos,this.finishToken(l.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(l.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(l.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+ge(e)+"'")},T.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)},T.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(re.test(r)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if(r==="[")t=!0;else if(r==="]"&&t)t=!1;else if(r==="/"&&!t)break;e=r==="\\"}++this.pos}var n=this.input.slice(i,this.pos);++this.pos;var s=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(s);var o=this.regexpState||(this.regexpState=new me(this));o.reset(i,n,a),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var u=null;try{u=new RegExp(n,a)}catch{}return this.finishToken(l.regexp,{pattern:n,flags:a,value:u})},T.readInt=function(e,t,i){for(var r=this.options.ecmaVersion>=12&&t===void 0,n=i&&this.input.charCodeAt(this.pos)===48,s=this.pos,a=0,o=0,u=0,c=t??1/0;u<c;++u,++this.pos){var h=this.input.charCodeAt(this.pos),f=void 0;if(r&&h===95){n&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),o===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),u===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=h;continue}if(h>=97?f=h-97+10:h>=65?f=h-65+10:h>=48&&h<=57?f=h-48:f=1/0,f>=e)break;o=h,a=a*e+f}return r&&o===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===s||t!=null&&this.pos-s!==t?null:a};function Er(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function yi(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}T.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return i==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=yi(this.input.slice(t,this.pos)),++this.pos):de(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(l.num,i)},T.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,"Invalid number");var i=this.pos-t>=2&&this.input.charCodeAt(t)===48;i&&this.strict&&this.raise(t,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&r===110){var n=yi(this.input.slice(t,this.pos));return++this.pos,de(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(l.num,n)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1),r===46&&!i&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!i&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),de(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var s=Er(this.input.slice(t,this.pos),i);return this.finishToken(l.num,s)},T.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var i=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(i,"Code point out of bounds")}else t=this.readHexChar(4);return t},T.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Ie(r)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(l.string,t)};var bi={};T.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===bi)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1},T.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw bi;this.raise(e,t)},T.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===l.template||this.type===l.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(l.dollarBraceL)):(++this.pos,this.finishToken(l.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(l.template,e));if(i===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Ie(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
23
- `;break;default:e+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},T.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(l.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":this.input[this.pos+1]===`
22
+ `),cooked:this.value},this.next(),i.tail=this.type===c.backQuote,this.finishNode(i,"TemplateElement")},P.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var i=this.startNode();this.next(),i.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(i.quasis=[r];!r.tail;)this.type===c.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(c.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(c.braceR),i.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")},P.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===c.name||this.type===c.num||this.type===c.string||this.type===c.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===c.star)&&!oe.test(this.input.slice(this.lastTokEnd,this.start))},P.parseObj=function(e,t){var i=this.startNode(),r=!0,s={};for(i.properties=[],this.next();!this.eat(c.braceR);){if(r)r=!1;else if(this.expect(c.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(c.braceR))break;var n=this.parseProperty(e,t);e||this.checkPropClash(n,s,t),i.properties.push(n)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")},P.parseProperty=function(e,t){var i=this.startNode(),r,s,n,a;if(this.options.ecmaVersion>=9&&this.eat(c.ellipsis))return e?(i.argument=this.parseIdent(!1),this.type===c.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,t),this.type===c.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(e||t)&&(n=this.start,a=this.startLoc),e||(r=this.eat(c.star)));var o=this.containsEsc;return this.parsePropertyName(i),!e&&!o&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(i)?(s=!0,r=this.options.ecmaVersion>=9&&this.eat(c.star),this.parsePropertyName(i)):s=!1,this.parsePropertyValue(i,e,r,s,n,a,t,o),this.finishNode(i,"Property")},P.parseGetterSetter=function(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var t=e.kind==="get"?0:1;if(e.value.params.length!==t){var i=e.value.start;e.kind==="get"?this.raiseRecoverable(i,"getter should have no params"):this.raiseRecoverable(i,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")},P.parsePropertyValue=function(e,t,i,r,s,n,a,o){(i||r)&&this.type===c.colon&&this.unexpected(),this.eat(c.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),e.kind="init"):this.options.ecmaVersion>=6&&this.type===c.parenL?(t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(i,r)):!t&&!o&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==c.comma&&this.type!==c.braceR&&this.type!==c.eq?((i||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((i||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=s),e.kind="init",t?e.value=this.parseMaybeDefault(s,n,this.copyNode(e.key)):this.type===c.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),e.value=this.parseMaybeDefault(s,n,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()},P.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(c.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(c.bracketR),e.key;e.computed=!1}return e.key=this.type===c.num||this.type===c.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")},P.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},P.parseMethod=function(e,t,i){var r=this.startNode(),s=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(It(t,r.generator)|Ct|(i?ci:0)),this.expect(c.parenL),r.params=this.parseBindingList(c.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=s,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(r,"FunctionExpression")},P.parseArrowExpression=function(e,t,i,r){var s=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(It(i,!1)|hi),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=s,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(e,"ArrowFunctionExpression")},P.parseFunctionBody=function(e,t,i,r){var s=t&&this.type!==c.braceL,n=this.strict,a=!1;if(s)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!n||o)&&(a=this.strictDirective(this.end),a&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var h=this.labels;this.labels=[],a&&(this.strict=!0),this.checkParams(e,!n&&!a&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,fi),e.body=this.parseBlock(!1,void 0,a&&!n),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=h}this.exitScope()},P.isSimpleParamList=function(e){for(var t=0,i=e;t<i.length;t+=1){var r=i[t];if(r.type!=="Identifier")return!1}return!0},P.checkParams=function(e,t){for(var i=Object.create(null),r=0,s=e.params;r<s.length;r+=1){var n=s[r];this.checkLValInnerPattern(n,At,t?null:i)}},P.parseExprList=function(e,t,i,r){for(var s=[],n=!0;!this.eat(e);){if(n)n=!1;else if(this.expect(c.comma),t&&this.afterTrailingComma(e))break;var a=void 0;i&&this.type===c.comma?a=null:this.type===c.ellipsis?(a=this.parseSpread(r),r&&this.type===c.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):a=this.parseMaybeAssign(!1,r),s.push(a)}return s},P.checkUnreserved=function(e){var t=e.start,i=e.end,r=e.name;if(this.inGenerator&&r==="yield"&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().inClassFieldInit&&r==="arguments"&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(r==="arguments"||r==="await")&&this.raise(t,"Cannot use "+r+" in class static initialization block"),this.keywords.test(r)&&this.raise(t,"Unexpected keyword '"+r+"'"),!(this.options.ecmaVersion<6&&this.input.slice(t,i).indexOf("\\")!==-1)){var s=this.strict?this.reservedWordsStrict:this.reservedWords;s.test(r)&&(!this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+r+"' is reserved"))}},P.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),t.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t},P.parseIdentNode=function(){var e=this.startNode();return this.type===c.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,(e.name==="class"||e.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=c.name):this.unexpected(),e},P.parsePrivateIdent=function(){var e=this.startNode();return this.type===c.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},P.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===c.semi||this.canInsertSemicolon()||this.type!==c.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(c.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")},P.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var ct=q.prototype;ct.raise=function(e,t){var i=ni(this.input,e);t+=" ("+i.line+":"+i.column+")";var r=new SyntaxError(t);throw r.pos=e,r.loc=i,r.raisedAt=this.pos,r},ct.raiseRecoverable=ct.raise,ct.curPosition=function(){if(this.options.locations)return new Ye(this.curLine,this.pos-this.lineStart)};var Ie=q.prototype,Or=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[],this.inClassFieldInit=!1};Ie.enterScope=function(e){this.scopeStack.push(new Or(e))},Ie.exitScope=function(){this.scopeStack.pop()},Ie.treatFunctionsAsVarInScope=function(e){return e.flags&We||!this.inModule&&e.flags&Qe},Ie.declareName=function(e,t,i){var r=!1;if(t===Se){var s=this.currentScope();r=s.lexical.indexOf(e)>-1||s.functions.indexOf(e)>-1||s.var.indexOf(e)>-1,s.lexical.push(e),this.inModule&&s.flags&Qe&&delete this.undefinedExports[e]}else if(t===pi){var n=this.currentScope();n.lexical.push(e)}else if(t===li){var a=this.currentScope();this.treatFunctionsAsVar?r=a.lexical.indexOf(e)>-1:r=a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var h=this.scopeStack[o];if(h.lexical.indexOf(e)>-1&&!(h.flags&ui&&h.lexical[0]===e)||!this.treatFunctionsAsVarInScope(h)&&h.functions.indexOf(e)>-1){r=!0;break}if(h.var.push(e),this.inModule&&h.flags&Qe&&delete this.undefinedExports[e],h.flags&kt)break}r&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")},Ie.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},Ie.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},Ie.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&kt)return t}},Ie.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&kt&&!(t.flags&hi))return t}};var lt=function(t,i,r){this.type="",this.start=i,this.end=0,t.options.locations&&(this.loc=new at(t,r)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[i,0])},Je=q.prototype;Je.startNode=function(){return new lt(this,this.start,this.startLoc)},Je.startNodeAt=function(e,t){return new lt(this,e,t)};function gi(e,t,i,r){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=i),e}Je.finishNode=function(e,t){return gi.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},Je.finishNodeAt=function(e,t,i,r){return gi.call(this,e,t,i,r)},Je.copyNode=function(e){var t=new lt(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var Mr="Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz",xi="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",yi=xi+" Extended_Pictographic",wi=yi,bi=wi+" EBase EComp EMod EPres ExtPict",vi=bi,Lr=vi,Br={9:xi,10:yi,11:wi,12:bi,13:vi,14:Lr},Fr="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",jr={9:"",10:"",11:"",12:"",13:"",14:Fr},_i="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Si="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Ei=Si+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Ni=Ei+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Ci=Ni+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",ki=Ci+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",$r=ki+" "+Mr,Wr={9:Si,10:Ei,11:Ni,12:Ci,13:ki,14:$r},Ii={};function qr(e){var t=Ii[e]={binary:ke(Br[e]+" "+_i),binaryOfStrings:ke(jr[e]),nonBinary:{General_Category:ke(_i),Script:ke(Wr[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var Dt=0,Ai=[9,10,11,12,13,14];Dt<Ai.length;Dt+=1){var Ur=Ai[Dt];qr(Ur)}var _=q.prototype,pt=function(t,i){this.parent=t,this.base=i||this};pt.prototype.separatedFrom=function(t){for(var i=this;i;i=i.parent)for(var r=t;r;r=r.parent)if(i.base===r.base&&i!==r)return!0;return!1},pt.prototype.sibling=function(){return new pt(this.parent,this.base)};var we=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":"")+(t.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Ii[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};we.prototype.reset=function(t,i,r){var s=r.indexOf("v")!==-1,n=r.indexOf("u")!==-1;this.start=t|0,this.source=i+"",this.flags=r,s&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=n&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=n&&this.parser.options.ecmaVersion>=9)},we.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)},we.prototype.at=function(t,i){i===void 0&&(i=!1);var r=this.source,s=r.length;if(t>=s)return-1;var n=r.charCodeAt(t);if(!(i||this.switchU)||n<=55295||n>=57344||t+1>=s)return n;var a=r.charCodeAt(t+1);return a>=56320&&a<=57343?(n<<10)+a-56613888:n},we.prototype.nextIndex=function(t,i){i===void 0&&(i=!1);var r=this.source,s=r.length;if(t>=s)return s;var n=r.charCodeAt(t),a;return!(i||this.switchU)||n<=55295||n>=57344||t+1>=s||(a=r.charCodeAt(t+1))<56320||a>57343?t+1:t+2},we.prototype.current=function(t){return t===void 0&&(t=!1),this.at(this.pos,t)},we.prototype.lookahead=function(t){return t===void 0&&(t=!1),this.at(this.nextIndex(this.pos,t),t)},we.prototype.advance=function(t){t===void 0&&(t=!1),this.pos=this.nextIndex(this.pos,t)},we.prototype.eat=function(t,i){return i===void 0&&(i=!1),this.current(i)===t?(this.advance(i),!0):!1},we.prototype.eatChars=function(t,i){i===void 0&&(i=!1);for(var r=this.pos,s=0,n=t;s<n.length;s+=1){var a=n[s],o=this.at(r,i);if(o===-1||o!==a)return!1;r=this.nextIndex(r,i)}return this.pos=r,!0},_.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,r=!1,s=!1,n=0;n<i.length;n++){var a=i.charAt(n);t.indexOf(a)===-1&&this.raise(e.start,"Invalid regular expression flag"),i.indexOf(a,n+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),a==="u"&&(r=!0),a==="v"&&(s=!0)}this.options.ecmaVersion>=15&&r&&s&&this.raise(e.start,"Invalid regular expression flag")};function Kr(e){for(var t in e)return!0;return!1}_.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&Kr(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},_.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,i=e.backReferenceNames;t<i.length;t+=1){var r=i[t];e.groupNames[r]||e.raise("Invalid named capture referenced")}},_.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new pt(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")},_.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},_.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1},_.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var i=!1;if(this.options.ecmaVersion>=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,!0}return e.pos=t,!1},_.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1},_.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},_.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var r=0,s=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(s=e.lastIntValue),e.eat(125)))return s!==-1&&s<r&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=i}return!1},_.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},_.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},_.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var i=this.regexp_eatModifiers(e),r=e.eat(45);if(i||r){for(var s=0;s<i.length;s++){var n=i.charAt(s);i.indexOf(n,s+1)>-1&&e.raise("Duplicate regular expression modifiers")}if(r){var a=this.regexp_eatModifiers(e);!i&&!a&&e.current()===58&&e.raise("Invalid regular expression modifiers");for(var o=0;o<a.length;o++){var h=a.charAt(o);(a.indexOf(h,o+1)>-1||i.indexOf(h)>-1)&&e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1},_.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},_.regexp_eatModifiers=function(e){for(var t="",i=0;(i=e.current())!==-1&&zr(i);)t+=_e(i),e.advance();return t};function zr(e){return e===105||e===109||e===115}_.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},_.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},_.regexp_eatSyntaxCharacter=function(e){var t=e.current();return Pi(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Pi(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}_.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;(i=e.current())!==-1&&!Pi(i);)e.advance();return e.pos!==t},_.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1},_.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,i=e.groupNames[e.lastStringValue];if(i)if(t)for(var r=0,s=i;r<s.length;r+=1){var n=s[r];n.separatedFrom(e.branchID)||e.raise("Duplicate capture group name")}else e.raise("Duplicate capture group name");t?(i||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},_.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},_.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=_e(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=_e(e.lastIntValue);return!0}return!1},_.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),Hr(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function Hr(e){return ve(e,!0)||e===36||e===95}_.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),Gr(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function Gr(e){return Fe(e,!0)||e===36||e===95||e===8204||e===8205}_.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},_.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),!0;if(i<=e.numCapturingParens)return!0;e.pos=t}return!1},_.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},_.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},_.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},_.regexp_eatZero=function(e){return e.current()===48&&!ft(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1},_.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1},_.regexp_eatControlLetter=function(e){var t=e.current();return Ti(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function Ti(e){return e>=65&&e<=90||e>=97&&e<=122}_.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var i=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(r&&s>=55296&&s<=56319){var n=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(a>=56320&&a<=57343)return e.lastIntValue=(s-55296)*1024+(a-56320)+65536,!0}e.pos=n,e.lastIntValue=s}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Yr(e.lastIntValue))return!0;r&&e.raise("Invalid unicode escape"),e.pos=i}return!1};function Yr(e){return e>=0&&e<=1114111}_.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1},_.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var Ri=0,Ee=1,ce=2;_.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(Qr(t))return e.lastIntValue=-1,e.advance(),Ee;var i=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((i=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return i&&r===ce&&e.raise("Invalid property name"),r;e.raise("Invalid property name")}return Ri};function Qr(e){return e===100||e===68||e===115||e===83||e===119||e===87}_.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,r),Ee}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var s=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,s)}return Ri},_.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){$e(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")},_.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return Ee;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return ce;e.raise("Invalid property name")},_.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Di(t=e.current());)e.lastStringValue+=_e(t),e.advance();return e.lastStringValue!==""};function Di(e){return Ti(e)||e===95}_.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Xr(t=e.current());)e.lastStringValue+=_e(t),e.advance();return e.lastStringValue!==""};function Xr(e){return Di(e)||ft(e)}_.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},_.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),i=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&i===ce&&e.raise("Negated character class may contain strings"),!0}return!1},_.regexp_classContents=function(e){return e.current()===93?Ee:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),Ee)},_.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;e.switchU&&(t===-1||i===-1)&&e.raise("Invalid character class"),t!==-1&&i!==-1&&t>i&&e.raise("Range out of order in character class")}}},_.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var i=e.current();(i===99||Mi(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var r=e.current();return r!==93?(e.lastIntValue=r,e.advance(),!0):!1},_.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},_.regexp_classSetExpression=function(e){var t=Ee,i;if(!this.regexp_eatClassSetRange(e))if(i=this.regexp_eatClassSetOperand(e)){i===ce&&(t=ce);for(var r=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(i=this.regexp_eatClassSetOperand(e))){i!==ce&&(t=Ee);continue}e.raise("Invalid character in character class")}if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(r!==e.pos)return t}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(i=this.regexp_eatClassSetOperand(e),!i)return t;i===ce&&(t=ce)}},_.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var i=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return i!==-1&&r!==-1&&i>r&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1},_.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?Ee:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},_.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var i=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return i&&r===ce&&e.raise("Negated character class may contain strings"),r;e.pos=t}if(e.eat(92)){var s=this.regexp_eatCharacterClassEscape(e);if(s)return s;e.pos=t}return null},_.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var i=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return i}else e.raise("Invalid escape");e.pos=t}return null},_.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===ce&&(t=ce);return t},_.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?Ee:ce},_.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var i=e.current();return i<0||i===e.lookahead()&&Zr(i)||Jr(i)?!1:(e.advance(),e.lastIntValue=i,!0)};function Zr(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function Jr(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}_.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return es(t)?(e.lastIntValue=t,e.advance(),!0):!1};function es(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}_.regexp_eatClassControlLetter=function(e){var t=e.current();return ft(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1},_.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},_.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;ft(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t};function ft(e){return e>=48&&e<=57}_.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Vi(i=e.current());)e.lastIntValue=16*e.lastIntValue+Oi(i),e.advance();return e.pos!==t};function Vi(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Oi(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}_.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+i*8+e.lastIntValue:e.lastIntValue=t*8+i}else e.lastIntValue=t;return!0}return!1},_.regexp_eatOctalDigit=function(e){var t=e.current();return Mi(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Mi(e){return e>=48&&e<=55}_.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var s=e.current();if(!Vi(s))return e.pos=i,!1;e.lastIntValue=16*e.lastIntValue+Oi(s),e.advance()}return!0};var Vt=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new at(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])},D=q.prototype;D.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Vt(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},D.getToken=function(){return this.next(),new Vt(this)},typeof Symbol<"u"&&(D[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===c.eof,value:t}}}}),D.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(c.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())},D.readToken=function(e){return ve(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},D.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888},D.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var r=void 0,s=t;(r=ei(this.input,s,this.pos))>-1;)++this.curLine,s=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,i),t,this.pos,e,this.curPosition())},D.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!je(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition())},D.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(e>8&&e<14||e>=5760&&ti.test(String.fromCharCode(e)))++this.pos;else break e}}},D.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i)},D.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(c.ellipsis)):(++this.pos,this.finishToken(c.dot))},D.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(c.assign,2):this.finishOp(c.slash,1)},D.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,r=e===42?c.star:c.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++i,r=c.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(c.assign,i+1):this.finishOp(r,i)},D.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(c.assign,3)}return this.finishOp(e===124?c.logicalOR:c.logicalAND,2)}return t===61?this.finishOp(c.assign,2):this.finishOp(e===124?c.bitwiseOR:c.bitwiseAND,1)},D.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(c.assign,2):this.finishOp(c.bitwiseXOR,1)},D.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||oe.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(c.incDec,2):t===61?this.finishOp(c.assign,2):this.finishOp(c.plusMin,1)},D.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(c.assign,i+1):this.finishOp(c.bitShift,i)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(i=2),this.finishOp(c.relational,i))},D.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(c.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(c.arrow)):this.finishOp(e===61?c.eq:c.prefix,1)},D.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(c.questionDot,2)}if(t===63){if(e>=12){var r=this.input.charCodeAt(this.pos+2);if(r===61)return this.finishOp(c.assign,3)}return this.finishOp(c.coalesce,2)}}return this.finishOp(c.question,1)},D.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),ve(t,!0)||t===92))return this.finishToken(c.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+_e(t)+"'")},D.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(c.parenL);case 41:return++this.pos,this.finishToken(c.parenR);case 59:return++this.pos,this.finishToken(c.semi);case 44:return++this.pos,this.finishToken(c.comma);case 91:return++this.pos,this.finishToken(c.bracketL);case 93:return++this.pos,this.finishToken(c.bracketR);case 123:return++this.pos,this.finishToken(c.braceL);case 125:return++this.pos,this.finishToken(c.braceR);case 58:return++this.pos,this.finishToken(c.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(c.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(c.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+_e(e)+"'")},D.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)},D.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(oe.test(r)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if(r==="[")t=!0;else if(r==="]"&&t)t=!1;else if(r==="/"&&!t)break;e=r==="\\"}++this.pos}var s=this.input.slice(i,this.pos);++this.pos;var n=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(n);var o=this.regexpState||(this.regexpState=new we(this));o.reset(i,s,a),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var h=null;try{h=new RegExp(s,a)}catch{}return this.finishToken(c.regexp,{pattern:s,flags:a,value:h})},D.readInt=function(e,t,i){for(var r=this.options.ecmaVersion>=12&&t===void 0,s=i&&this.input.charCodeAt(this.pos)===48,n=this.pos,a=0,o=0,h=0,u=t??1/0;h<u;++h,++this.pos){var l=this.input.charCodeAt(this.pos),f=void 0;if(r&&l===95){s&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),o===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),h===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=l;continue}if(l>=97?f=l-97+10:l>=65?f=l-65+10:l>=48&&l<=57?f=l-48:f=1/0,f>=e)break;o=l,a=a*e+f}return r&&o===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===n||t!=null&&this.pos-n!==t?null:a};function ts(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function Li(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}D.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return i==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=Li(this.input.slice(t,this.pos)),++this.pos):ve(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(c.num,i)},D.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,"Invalid number");var i=this.pos-t>=2&&this.input.charCodeAt(t)===48;i&&this.strict&&this.raise(t,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&r===110){var s=Li(this.input.slice(t,this.pos));return++this.pos,ve(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(c.num,s)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1),r===46&&!i&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!i&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),ve(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var n=ts(this.input.slice(t,this.pos),i);return this.finishToken(c.num,n)},D.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var i=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(i,"Code point out of bounds")}else t=this.readHexChar(4);return t},D.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(je(r)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(c.string,t)};var Bi={};D.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Bi)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1},D.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Bi;this.raise(e,t)},D.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===c.template||this.type===c.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(c.dollarBraceL)):(++this.pos,this.finishToken(c.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(c.template,e));if(i===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(je(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
23
+ `;break;default:e+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},D.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(c.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":this.input[this.pos+1]===`
24
24
  `&&++this.pos;case`
25
- `:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")},T.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
26
- `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return ge(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],n=parseInt(r,8);return n>255&&(r=r.slice(0,-1),n=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(n)}return Ie(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}},T.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return i===null&&this.invalidStringToken(t,"Bad character escape sequence"),i},T.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var n=this.fullCharCodeAtPos();if(ke(n,r))this.pos+=n<=65535?1:2;else if(n===92){this.containsEsc=!0,e+=this.input.slice(i,this.pos);var s=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var a=this.readCodePoint();(t?de:ke)(a,r)||this.invalidStringToken(s,"Invalid Unicode escape"),e+=ge(a),i=this.pos}else break;t=!1}return e+this.input.slice(i,this.pos)},T.readWord=function(){var e=this.readWord1(),t=l.name;return this.keywords.test(e)&&(t=ct[e]),this.finishToken(t,e)};var kr="8.14.0";$.acorn={Parser:$,version:kr,defaultOptions:lt,Position:Re,SourceLocation:ze,getLineInfo:Ft,Node:Xe,TokenType:L,tokTypes:l,keywordTypes:ct,TokContext:oe,tokContexts:j,isIdentifierChar:ke,isIdentifierStart:de,Token:vt,isNewLine:Ie,lineBreak:re,lineBreakG:Qi,nonASCIIwhitespace:Rt};function vi(e,t){return $.parse(e,t)}const{stringify:Ir}=JSON;if(!String.prototype.repeat)throw new Error("String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation");if(!String.prototype.endsWith)throw new Error("String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation");const Je={"||":2,"??":3,"&&":4,"|":5,"^":6,"&":7,"==":8,"!=":8,"===":8,"!==":8,"<":9,">":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},ue=17,Ar={ArrayExpression:20,TaggedTemplateExpression:20,ThisExpression:20,Identifier:20,PrivateIdentifier:20,Literal:18,TemplateLiteral:20,Super:20,SequenceExpression:20,MemberExpression:19,ChainExpression:19,CallExpression:19,NewExpression:19,ArrowFunctionExpression:ue,ClassExpression:ue,FunctionExpression:ue,ObjectExpression:ue,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};function Te(e,t){const{generator:i}=e;if(e.write("("),t!=null&&t.length>0){i[t[0].type](t[0],e);const{length:r}=t;for(let n=1;n<r;n++){const s=t[n];e.write(", "),i[s.type](s,e)}}e.write(")")}function wi(e,t,i,r){const n=e.expressionsPrecedence[t.type];if(n===ue)return!0;const s=e.expressionsPrecedence[i.type];return n!==s?!r&&n===15&&s===14&&i.operator==="**"||n<s:n!==13&&n!==14?!1:t.operator==="**"&&i.operator==="**"?!r:n===13&&s===13&&(t.operator==="??"||i.operator==="??")?!0:r?Je[t.operator]<=Je[i.operator]:Je[t.operator]<Je[i.operator]}function et(e,t,i,r){const{generator:n}=e;wi(e,t,i,r)?(e.write("("),n[t.type](t,e),e.write(")")):n[t.type](t,e)}function Pr(e,t,i,r){const n=t.split(`
27
- `),s=n.length-1;if(e.write(n[0].trim()),s>0){e.write(r);for(let a=1;a<s;a++)e.write(i+n[a].trim()+r);e.write(i+n[s].trim())}}function Q(e,t,i,r){const{length:n}=t;for(let s=0;s<n;s++){const a=t[s];e.write(i),a.type[0]==="L"?e.write("// "+a.value.trim()+`
28
- `,a):(e.write("/*"),Pr(e,a.value,i,r),e.write("*/"+r))}}function Vr(e){let t=e;for(;t!=null;){const{type:i}=t;if(i[0]==="C"&&i[1]==="a")return!0;if(i[0]==="M"&&i[1]==="e"&&i[2]==="m")t=t.object;else return!1}}function wt(e,t){const{generator:i}=e,{declarations:r}=t;e.write(t.kind+" ");const{length:n}=r;if(n>0){i.VariableDeclarator(r[0],e);for(let s=1;s<n;s++)e.write(", "),i.VariableDeclarator(r[s],e)}}let _i,Si,Ni,Ci,Ei,ki;const _t={Program(e,t){const i=t.indent.repeat(t.indentLevel),{lineEnd:r,writeComments:n}=t;n&&e.comments!=null&&Q(t,e.comments,i,r);const s=e.body,{length:a}=s;for(let o=0;o<a;o++){const u=s[o];n&&u.comments!=null&&Q(t,u.comments,i,r),t.write(i),this[u.type](u,t),t.write(r)}n&&e.trailingComments!=null&&Q(t,e.trailingComments,i,r)},BlockStatement:ki=function(e,t){const i=t.indent.repeat(t.indentLevel++),{lineEnd:r,writeComments:n}=t,s=i+t.indent;t.write("{");const a=e.body;if(a!=null&&a.length>0){t.write(r),n&&e.comments!=null&&Q(t,e.comments,s,r);const{length:o}=a;for(let u=0;u<o;u++){const c=a[u];n&&c.comments!=null&&Q(t,c.comments,s,r),t.write(s),this[c.type](c,t),t.write(r)}t.write(i)}else n&&e.comments!=null&&(t.write(r),Q(t,e.comments,s,r),t.write(i));n&&e.trailingComments!=null&&Q(t,e.trailingComments,s,r),t.write("}"),t.indentLevel--},ClassBody:ki,StaticBlock(e,t){t.write("static "),this.BlockStatement(e,t)},EmptyStatement(e,t){t.write(";")},ExpressionStatement(e,t){const i=t.expressionsPrecedence[e.expression.type];i===ue||i===3&&e.expression.left.type[0]==="O"?(t.write("("),this[e.expression.type](e.expression,t),t.write(")")):this[e.expression.type](e.expression,t),t.write(";")},IfStatement(e,t){t.write("if ("),this[e.test.type](e.test,t),t.write(") "),this[e.consequent.type](e.consequent,t),e.alternate!=null&&(t.write(" else "),this[e.alternate.type](e.alternate,t))},LabeledStatement(e,t){this[e.label.type](e.label,t),t.write(": "),this[e.body.type](e.body,t)},BreakStatement(e,t){t.write("break"),e.label!=null&&(t.write(" "),this[e.label.type](e.label,t)),t.write(";")},ContinueStatement(e,t){t.write("continue"),e.label!=null&&(t.write(" "),this[e.label.type](e.label,t)),t.write(";")},WithStatement(e,t){t.write("with ("),this[e.object.type](e.object,t),t.write(") "),this[e.body.type](e.body,t)},SwitchStatement(e,t){const i=t.indent.repeat(t.indentLevel++),{lineEnd:r,writeComments:n}=t;t.indentLevel++;const s=i+t.indent,a=s+t.indent;t.write("switch ("),this[e.discriminant.type](e.discriminant,t),t.write(") {"+r);const{cases:o}=e,{length:u}=o;for(let c=0;c<u;c++){const h=o[c];n&&h.comments!=null&&Q(t,h.comments,s,r),h.test?(t.write(s+"case "),this[h.test.type](h.test,t),t.write(":"+r)):t.write(s+"default:"+r);const{consequent:f}=h,{length:d}=f;for(let p=0;p<d;p++){const g=f[p];n&&g.comments!=null&&Q(t,g.comments,a,r),t.write(a),this[g.type](g,t),t.write(r)}}t.indentLevel-=2,t.write(i+"}")},ReturnStatement(e,t){t.write("return"),e.argument&&(t.write(" "),this[e.argument.type](e.argument,t)),t.write(";")},ThrowStatement(e,t){t.write("throw "),this[e.argument.type](e.argument,t),t.write(";")},TryStatement(e,t){if(t.write("try "),this[e.block.type](e.block,t),e.handler){const{handler:i}=e;i.param==null?t.write(" catch "):(t.write(" catch ("),this[i.param.type](i.param,t),t.write(") ")),this[i.body.type](i.body,t)}e.finalizer&&(t.write(" finally "),this[e.finalizer.type](e.finalizer,t))},WhileStatement(e,t){t.write("while ("),this[e.test.type](e.test,t),t.write(") "),this[e.body.type](e.body,t)},DoWhileStatement(e,t){t.write("do "),this[e.body.type](e.body,t),t.write(" while ("),this[e.test.type](e.test,t),t.write(");")},ForStatement(e,t){if(t.write("for ("),e.init!=null){const{init:i}=e;i.type[0]==="V"?wt(t,i):this[i.type](i,t)}t.write("; "),e.test&&this[e.test.type](e.test,t),t.write("; "),e.update&&this[e.update.type](e.update,t),t.write(") "),this[e.body.type](e.body,t)},ForInStatement:_i=function(e,t){t.write(`for ${e.await?"await ":""}(`);const{left:i}=e;i.type[0]==="V"?wt(t,i):this[i.type](i,t),t.write(e.type[3]==="I"?" in ":" of "),this[e.right.type](e.right,t),t.write(") "),this[e.body.type](e.body,t)},ForOfStatement:_i,DebuggerStatement(e,t){t.write("debugger;",e)},FunctionDeclaration:Si=function(e,t){t.write((e.async?"async ":"")+(e.generator?"function* ":"function ")+(e.id?e.id.name:""),e),Te(t,e.params),t.write(" "),this[e.body.type](e.body,t)},FunctionExpression:Si,VariableDeclaration(e,t){wt(t,e),t.write(";")},VariableDeclarator(e,t){this[e.id.type](e.id,t),e.init!=null&&(t.write(" = "),this[e.init.type](e.init,t))},ClassDeclaration(e,t){if(t.write("class "+(e.id?`${e.id.name} `:""),e),e.superClass){t.write("extends ");const{superClass:i}=e,{type:r}=i,n=t.expressionsPrecedence[r];(r[0]!=="C"||r[1]!=="l"||r[5]!=="E")&&(n===ue||n<t.expressionsPrecedence.ClassExpression)?(t.write("("),this[e.superClass.type](i,t),t.write(")")):this[i.type](i,t),t.write(" ")}this.ClassBody(e.body,t)},ImportDeclaration(e,t){t.write("import ");const{specifiers:i,attributes:r}=e,{length:n}=i;let s=0;if(n>0){for(;s<n;){s>0&&t.write(", ");const a=i[s],o=a.type[6];if(o==="D")t.write(a.local.name,a),s++;else if(o==="N")t.write("* as "+a.local.name,a),s++;else break}if(s<n){for(t.write("{");;){const a=i[s],{name:o}=a.imported;if(t.write(o,a),o!==a.local.name&&t.write(" as "+a.local.name),++s<n)t.write(", ");else break}t.write("}")}t.write(" from ")}if(this.Literal(e.source,t),r&&r.length>0){t.write(" with { ");for(let a=0;a<r.length;a++)this.ImportAttribute(r[a],t),a<r.length-1&&t.write(", ");t.write(" }")}t.write(";")},ImportAttribute(e,t){this.Identifier(e.key,t),t.write(": "),this.Literal(e.value,t)},ImportExpression(e,t){t.write("import("),this[e.source.type](e.source,t),t.write(")")},ExportDefaultDeclaration(e,t){t.write("export default "),this[e.declaration.type](e.declaration,t),t.expressionsPrecedence[e.declaration.type]!=null&&e.declaration.type[0]!=="F"&&t.write(";")},ExportNamedDeclaration(e,t){if(t.write("export "),e.declaration)this[e.declaration.type](e.declaration,t);else{t.write("{");const{specifiers:i}=e,{length:r}=i;if(r>0)for(let n=0;;){const s=i[n],{name:a}=s.local;if(t.write(a,s),a!==s.exported.name&&t.write(" as "+s.exported.name),++n<r)t.write(", ");else break}if(t.write("}"),e.source&&(t.write(" from "),this.Literal(e.source,t)),e.attributes&&e.attributes.length>0){t.write(" with { ");for(let n=0;n<e.attributes.length;n++)this.ImportAttribute(e.attributes[n],t),n<e.attributes.length-1&&t.write(", ");t.write(" }")}t.write(";")}},ExportAllDeclaration(e,t){if(e.exported!=null?t.write("export * as "+e.exported.name+" from "):t.write("export * from "),this.Literal(e.source,t),e.attributes&&e.attributes.length>0){t.write(" with { ");for(let i=0;i<e.attributes.length;i++)this.ImportAttribute(e.attributes[i],t),i<e.attributes.length-1&&t.write(", ");t.write(" }")}t.write(";")},MethodDefinition(e,t){e.static&&t.write("static ");const i=e.kind[0];(i==="g"||i==="s")&&t.write(e.kind+" "),e.value.async&&t.write("async "),e.value.generator&&t.write("*"),e.computed?(t.write("["),this[e.key.type](e.key,t),t.write("]")):this[e.key.type](e.key,t),Te(t,e.value.params),t.write(" "),this[e.value.body.type](e.value.body,t)},ClassExpression(e,t){this.ClassDeclaration(e,t)},ArrowFunctionExpression(e,t){t.write(e.async?"async ":"",e);const{params:i}=e;i!=null&&(i.length===1&&i[0].type[0]==="I"?t.write(i[0].name,i[0]):Te(t,e.params)),t.write(" => "),e.body.type[0]==="O"?(t.write("("),this.ObjectExpression(e.body,t),t.write(")")):this[e.body.type](e.body,t)},ThisExpression(e,t){t.write("this",e)},Super(e,t){t.write("super",e)},RestElement:Ni=function(e,t){t.write("..."),this[e.argument.type](e.argument,t)},SpreadElement:Ni,YieldExpression(e,t){t.write(e.delegate?"yield*":"yield"),e.argument&&(t.write(" "),this[e.argument.type](e.argument,t))},AwaitExpression(e,t){t.write("await ",e),et(t,e.argument,e)},TemplateLiteral(e,t){const{quasis:i,expressions:r}=e;t.write("`");const{length:n}=r;for(let a=0;a<n;a++){const o=r[a],u=i[a];t.write(u.value.raw,u),t.write("${"),this[o.type](o,t),t.write("}")}const s=i[i.length-1];t.write(s.value.raw,s),t.write("`")},TemplateElement(e,t){t.write(e.value.raw,e)},TaggedTemplateExpression(e,t){et(t,e.tag,e),this[e.quasi.type](e.quasi,t)},ArrayExpression:Ei=function(e,t){if(t.write("["),e.elements.length>0){const{elements:i}=e,{length:r}=i;for(let n=0;;){const s=i[n];if(s!=null&&this[s.type](s,t),++n<r)t.write(", ");else{s==null&&t.write(", ");break}}}t.write("]")},ArrayPattern:Ei,ObjectExpression(e,t){const i=t.indent.repeat(t.indentLevel++),{lineEnd:r,writeComments:n}=t,s=i+t.indent;if(t.write("{"),e.properties.length>0){t.write(r),n&&e.comments!=null&&Q(t,e.comments,s,r);const a=","+r,{properties:o}=e,{length:u}=o;for(let c=0;;){const h=o[c];if(n&&h.comments!=null&&Q(t,h.comments,s,r),t.write(s),this[h.type](h,t),++c<u)t.write(a);else break}t.write(r),n&&e.trailingComments!=null&&Q(t,e.trailingComments,s,r),t.write(i+"}")}else n?e.comments!=null?(t.write(r),Q(t,e.comments,s,r),e.trailingComments!=null&&Q(t,e.trailingComments,s,r),t.write(i+"}")):e.trailingComments!=null?(t.write(r),Q(t,e.trailingComments,s,r),t.write(i+"}")):t.write("}"):t.write("}");t.indentLevel--},Property(e,t){e.method||e.kind[0]!=="i"?this.MethodDefinition(e,t):(e.shorthand||(e.computed?(t.write("["),this[e.key.type](e.key,t),t.write("]")):this[e.key.type](e.key,t),t.write(": ")),this[e.value.type](e.value,t))},PropertyDefinition(e,t){if(e.static&&t.write("static "),e.computed&&t.write("["),this[e.key.type](e.key,t),e.computed&&t.write("]"),e.value==null){e.key.type[0]!=="F"&&t.write(";");return}t.write(" = "),this[e.value.type](e.value,t),t.write(";")},ObjectPattern(e,t){if(t.write("{"),e.properties.length>0){const{properties:i}=e,{length:r}=i;for(let n=0;this[i[n].type](i[n],t),++n<r;)t.write(", ")}t.write("}")},SequenceExpression(e,t){Te(t,e.expressions)},UnaryExpression(e,t){if(e.prefix){const{operator:i,argument:r,argument:{type:n}}=e;t.write(i);const s=wi(t,r,e);!s&&(i.length>1||n[0]==="U"&&(n[1]==="n"||n[1]==="p")&&r.prefix&&r.operator[0]===i&&(i==="+"||i==="-"))&&t.write(" "),s?(t.write(i.length>1?" (":"("),this[n](r,t),t.write(")")):this[n](r,t)}else this[e.argument.type](e.argument,t),t.write(e.operator)},UpdateExpression(e,t){e.prefix?(t.write(e.operator),this[e.argument.type](e.argument,t)):(this[e.argument.type](e.argument,t),t.write(e.operator))},AssignmentExpression(e,t){this[e.left.type](e.left,t),t.write(" "+e.operator+" "),this[e.right.type](e.right,t)},AssignmentPattern(e,t){this[e.left.type](e.left,t),t.write(" = "),this[e.right.type](e.right,t)},BinaryExpression:Ci=function(e,t){const i=e.operator==="in";i&&t.write("("),et(t,e.left,e,!1),t.write(" "+e.operator+" "),et(t,e.right,e,!0),i&&t.write(")")},LogicalExpression:Ci,ConditionalExpression(e,t){const{test:i}=e,r=t.expressionsPrecedence[i.type];r===ue||r<=t.expressionsPrecedence.ConditionalExpression?(t.write("("),this[i.type](i,t),t.write(")")):this[i.type](i,t),t.write(" ? "),this[e.consequent.type](e.consequent,t),t.write(" : "),this[e.alternate.type](e.alternate,t)},NewExpression(e,t){t.write("new ");const i=t.expressionsPrecedence[e.callee.type];i===ue||i<t.expressionsPrecedence.CallExpression||Vr(e.callee)?(t.write("("),this[e.callee.type](e.callee,t),t.write(")")):this[e.callee.type](e.callee,t),Te(t,e.arguments)},CallExpression(e,t){const i=t.expressionsPrecedence[e.callee.type];i===ue||i<t.expressionsPrecedence.CallExpression?(t.write("("),this[e.callee.type](e.callee,t),t.write(")")):this[e.callee.type](e.callee,t),e.optional&&t.write("?."),Te(t,e.arguments)},ChainExpression(e,t){this[e.expression.type](e.expression,t)},MemberExpression(e,t){const i=t.expressionsPrecedence[e.object.type];i===ue||i<t.expressionsPrecedence.MemberExpression?(t.write("("),this[e.object.type](e.object,t),t.write(")")):this[e.object.type](e.object,t),e.computed?(e.optional&&t.write("?."),t.write("["),this[e.property.type](e.property,t),t.write("]")):(e.optional?t.write("?."):t.write("."),this[e.property.type](e.property,t))},MetaProperty(e,t){t.write(e.meta.name+"."+e.property.name,e)},Identifier(e,t){t.write(e.name,e)},PrivateIdentifier(e,t){t.write(`#${e.name}`,e)},Literal(e,t){e.raw!=null?t.write(e.raw,e):e.regex!=null?this.RegExpLiteral(e,t):e.bigint!=null?t.write(e.bigint+"n",e):t.write(Ir(e.value),e)},RegExpLiteral(e,t){const{regex:i}=e;t.write(`/${i.pattern}/${i.flags}`,e)}},Tr={},Mr=_t;class Lr{constructor(t){const i=t??Tr;this.output="",i.output!=null?(this.output=i.output,this.write=this.writeToStream):this.output="",this.generator=i.generator!=null?i.generator:_t,this.expressionsPrecedence=i.expressionsPrecedence!=null?i.expressionsPrecedence:Ar,this.indent=i.indent!=null?i.indent:" ",this.lineEnd=i.lineEnd!=null?i.lineEnd:`
25
+ `:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")},D.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
26
+ `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return _e(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],s=parseInt(r,8);return s>255&&(r=r.slice(0,-1),s=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(s)}return je(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}},D.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return i===null&&this.invalidStringToken(t,"Bad character escape sequence"),i},D.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var s=this.fullCharCodeAtPos();if(Fe(s,r))this.pos+=s<=65535?1:2;else if(s===92){this.containsEsc=!0,e+=this.input.slice(i,this.pos);var n=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var a=this.readCodePoint();(t?ve:Fe)(a,r)||this.invalidStringToken(n,"Invalid Unicode escape"),e+=_e(a),i=this.pos}else break;t=!1}return e+this.input.slice(i,this.pos)},D.readWord=function(){var e=this.readWord1(),t=c.name;return this.keywords.test(e)&&(t=St[e]),this.finishToken(t,e)};var is="8.14.0";q.acorn={Parser:q,version:is,defaultOptions:Et,Position:Ye,SourceLocation:at,getLineInfo:ni,Node:lt,TokenType:O,tokTypes:c,keywordTypes:St,TokContext:me,tokContexts:$,isIdentifierChar:Fe,isIdentifierStart:ve,Token:Vt,isNewLine:je,lineBreak:oe,lineBreakG:Er,nonASCIIwhitespace:ti};function Fi(e,t){return q.parse(e,t)}const{stringify:rs}=JSON;if(!String.prototype.repeat)throw new Error("String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation");if(!String.prototype.endsWith)throw new Error("String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation");const mt={"||":2,"??":3,"&&":4,"|":5,"^":6,"&":7,"==":8,"!=":8,"===":8,"!==":8,"<":9,">":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},de=17,ss={ArrayExpression:20,TaggedTemplateExpression:20,ThisExpression:20,Identifier:20,PrivateIdentifier:20,Literal:18,TemplateLiteral:20,Super:20,SequenceExpression:20,MemberExpression:19,ChainExpression:19,CallExpression:19,NewExpression:19,ArrowFunctionExpression:de,ClassExpression:de,FunctionExpression:de,ObjectExpression:de,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};function Ue(e,t){const{generator:i}=e;if(e.write("("),t!=null&&t.length>0){i[t[0].type](t[0],e);const{length:r}=t;for(let s=1;s<r;s++){const n=t[s];e.write(", "),i[n.type](n,e)}}e.write(")")}function ji(e,t,i,r){const s=e.expressionsPrecedence[t.type];if(s===de)return!0;const n=e.expressionsPrecedence[i.type];return s!==n?!r&&s===15&&n===14&&i.operator==="**"||s<n:s!==13&&s!==14?!1:t.operator==="**"&&i.operator==="**"?!r:s===13&&n===13&&(t.operator==="??"||i.operator==="??")?!0:r?mt[t.operator]<=mt[i.operator]:mt[t.operator]<mt[i.operator]}function dt(e,t,i,r){const{generator:s}=e;ji(e,t,i,r)?(e.write("("),s[t.type](t,e),e.write(")")):s[t.type](t,e)}function ns(e,t,i,r){const s=t.split(`
27
+ `),n=s.length-1;if(e.write(s[0].trim()),n>0){e.write(r);for(let a=1;a<n;a++)e.write(i+s[a].trim()+r);e.write(i+s[n].trim())}}function X(e,t,i,r){const{length:s}=t;for(let n=0;n<s;n++){const a=t[n];e.write(i),a.type[0]==="L"?e.write("// "+a.value.trim()+`
28
+ `,a):(e.write("/*"),ns(e,a.value,i,r),e.write("*/"+r))}}function as(e){let t=e;for(;t!=null;){const{type:i}=t;if(i[0]==="C"&&i[1]==="a")return!0;if(i[0]==="M"&&i[1]==="e"&&i[2]==="m")t=t.object;else return!1}}function Ot(e,t){const{generator:i}=e,{declarations:r}=t;e.write(t.kind+" ");const{length:s}=r;if(s>0){i.VariableDeclarator(r[0],e);for(let n=1;n<s;n++)e.write(", "),i.VariableDeclarator(r[n],e)}}let $i,Wi,qi,Ui,Ki,zi;const Mt={Program(e,t){const i=t.indent.repeat(t.indentLevel),{lineEnd:r,writeComments:s}=t;s&&e.comments!=null&&X(t,e.comments,i,r);const n=e.body,{length:a}=n;for(let o=0;o<a;o++){const h=n[o];s&&h.comments!=null&&X(t,h.comments,i,r),t.write(i),this[h.type](h,t),t.write(r)}s&&e.trailingComments!=null&&X(t,e.trailingComments,i,r)},BlockStatement:zi=function(e,t){const i=t.indent.repeat(t.indentLevel++),{lineEnd:r,writeComments:s}=t,n=i+t.indent;t.write("{");const a=e.body;if(a!=null&&a.length>0){t.write(r),s&&e.comments!=null&&X(t,e.comments,n,r);const{length:o}=a;for(let h=0;h<o;h++){const u=a[h];s&&u.comments!=null&&X(t,u.comments,n,r),t.write(n),this[u.type](u,t),t.write(r)}t.write(i)}else s&&e.comments!=null&&(t.write(r),X(t,e.comments,n,r),t.write(i));s&&e.trailingComments!=null&&X(t,e.trailingComments,n,r),t.write("}"),t.indentLevel--},ClassBody:zi,StaticBlock(e,t){t.write("static "),this.BlockStatement(e,t)},EmptyStatement(e,t){t.write(";")},ExpressionStatement(e,t){const i=t.expressionsPrecedence[e.expression.type];i===de||i===3&&e.expression.left.type[0]==="O"?(t.write("("),this[e.expression.type](e.expression,t),t.write(")")):this[e.expression.type](e.expression,t),t.write(";")},IfStatement(e,t){t.write("if ("),this[e.test.type](e.test,t),t.write(") "),this[e.consequent.type](e.consequent,t),e.alternate!=null&&(t.write(" else "),this[e.alternate.type](e.alternate,t))},LabeledStatement(e,t){this[e.label.type](e.label,t),t.write(": "),this[e.body.type](e.body,t)},BreakStatement(e,t){t.write("break"),e.label!=null&&(t.write(" "),this[e.label.type](e.label,t)),t.write(";")},ContinueStatement(e,t){t.write("continue"),e.label!=null&&(t.write(" "),this[e.label.type](e.label,t)),t.write(";")},WithStatement(e,t){t.write("with ("),this[e.object.type](e.object,t),t.write(") "),this[e.body.type](e.body,t)},SwitchStatement(e,t){const i=t.indent.repeat(t.indentLevel++),{lineEnd:r,writeComments:s}=t;t.indentLevel++;const n=i+t.indent,a=n+t.indent;t.write("switch ("),this[e.discriminant.type](e.discriminant,t),t.write(") {"+r);const{cases:o}=e,{length:h}=o;for(let u=0;u<h;u++){const l=o[u];s&&l.comments!=null&&X(t,l.comments,n,r),l.test?(t.write(n+"case "),this[l.test.type](l.test,t),t.write(":"+r)):t.write(n+"default:"+r);const{consequent:f}=l,{length:g}=f;for(let p=0;p<g;p++){const x=f[p];s&&x.comments!=null&&X(t,x.comments,a,r),t.write(a),this[x.type](x,t),t.write(r)}}t.indentLevel-=2,t.write(i+"}")},ReturnStatement(e,t){t.write("return"),e.argument&&(t.write(" "),this[e.argument.type](e.argument,t)),t.write(";")},ThrowStatement(e,t){t.write("throw "),this[e.argument.type](e.argument,t),t.write(";")},TryStatement(e,t){if(t.write("try "),this[e.block.type](e.block,t),e.handler){const{handler:i}=e;i.param==null?t.write(" catch "):(t.write(" catch ("),this[i.param.type](i.param,t),t.write(") ")),this[i.body.type](i.body,t)}e.finalizer&&(t.write(" finally "),this[e.finalizer.type](e.finalizer,t))},WhileStatement(e,t){t.write("while ("),this[e.test.type](e.test,t),t.write(") "),this[e.body.type](e.body,t)},DoWhileStatement(e,t){t.write("do "),this[e.body.type](e.body,t),t.write(" while ("),this[e.test.type](e.test,t),t.write(");")},ForStatement(e,t){if(t.write("for ("),e.init!=null){const{init:i}=e;i.type[0]==="V"?Ot(t,i):this[i.type](i,t)}t.write("; "),e.test&&this[e.test.type](e.test,t),t.write("; "),e.update&&this[e.update.type](e.update,t),t.write(") "),this[e.body.type](e.body,t)},ForInStatement:$i=function(e,t){t.write(`for ${e.await?"await ":""}(`);const{left:i}=e;i.type[0]==="V"?Ot(t,i):this[i.type](i,t),t.write(e.type[3]==="I"?" in ":" of "),this[e.right.type](e.right,t),t.write(") "),this[e.body.type](e.body,t)},ForOfStatement:$i,DebuggerStatement(e,t){t.write("debugger;",e)},FunctionDeclaration:Wi=function(e,t){t.write((e.async?"async ":"")+(e.generator?"function* ":"function ")+(e.id?e.id.name:""),e),Ue(t,e.params),t.write(" "),this[e.body.type](e.body,t)},FunctionExpression:Wi,VariableDeclaration(e,t){Ot(t,e),t.write(";")},VariableDeclarator(e,t){this[e.id.type](e.id,t),e.init!=null&&(t.write(" = "),this[e.init.type](e.init,t))},ClassDeclaration(e,t){if(t.write("class "+(e.id?`${e.id.name} `:""),e),e.superClass){t.write("extends ");const{superClass:i}=e,{type:r}=i,s=t.expressionsPrecedence[r];(r[0]!=="C"||r[1]!=="l"||r[5]!=="E")&&(s===de||s<t.expressionsPrecedence.ClassExpression)?(t.write("("),this[e.superClass.type](i,t),t.write(")")):this[i.type](i,t),t.write(" ")}this.ClassBody(e.body,t)},ImportDeclaration(e,t){t.write("import ");const{specifiers:i,attributes:r}=e,{length:s}=i;let n=0;if(s>0){for(;n<s;){n>0&&t.write(", ");const a=i[n],o=a.type[6];if(o==="D")t.write(a.local.name,a),n++;else if(o==="N")t.write("* as "+a.local.name,a),n++;else break}if(n<s){for(t.write("{");;){const a=i[n],{name:o}=a.imported;if(t.write(o,a),o!==a.local.name&&t.write(" as "+a.local.name),++n<s)t.write(", ");else break}t.write("}")}t.write(" from ")}if(this.Literal(e.source,t),r&&r.length>0){t.write(" with { ");for(let a=0;a<r.length;a++)this.ImportAttribute(r[a],t),a<r.length-1&&t.write(", ");t.write(" }")}t.write(";")},ImportAttribute(e,t){this.Identifier(e.key,t),t.write(": "),this.Literal(e.value,t)},ImportExpression(e,t){t.write("import("),this[e.source.type](e.source,t),t.write(")")},ExportDefaultDeclaration(e,t){t.write("export default "),this[e.declaration.type](e.declaration,t),t.expressionsPrecedence[e.declaration.type]!=null&&e.declaration.type[0]!=="F"&&t.write(";")},ExportNamedDeclaration(e,t){if(t.write("export "),e.declaration)this[e.declaration.type](e.declaration,t);else{t.write("{");const{specifiers:i}=e,{length:r}=i;if(r>0)for(let s=0;;){const n=i[s],{name:a}=n.local;if(t.write(a,n),a!==n.exported.name&&t.write(" as "+n.exported.name),++s<r)t.write(", ");else break}if(t.write("}"),e.source&&(t.write(" from "),this.Literal(e.source,t)),e.attributes&&e.attributes.length>0){t.write(" with { ");for(let s=0;s<e.attributes.length;s++)this.ImportAttribute(e.attributes[s],t),s<e.attributes.length-1&&t.write(", ");t.write(" }")}t.write(";")}},ExportAllDeclaration(e,t){if(e.exported!=null?t.write("export * as "+e.exported.name+" from "):t.write("export * from "),this.Literal(e.source,t),e.attributes&&e.attributes.length>0){t.write(" with { ");for(let i=0;i<e.attributes.length;i++)this.ImportAttribute(e.attributes[i],t),i<e.attributes.length-1&&t.write(", ");t.write(" }")}t.write(";")},MethodDefinition(e,t){e.static&&t.write("static ");const i=e.kind[0];(i==="g"||i==="s")&&t.write(e.kind+" "),e.value.async&&t.write("async "),e.value.generator&&t.write("*"),e.computed?(t.write("["),this[e.key.type](e.key,t),t.write("]")):this[e.key.type](e.key,t),Ue(t,e.value.params),t.write(" "),this[e.value.body.type](e.value.body,t)},ClassExpression(e,t){this.ClassDeclaration(e,t)},ArrowFunctionExpression(e,t){t.write(e.async?"async ":"",e);const{params:i}=e;i!=null&&(i.length===1&&i[0].type[0]==="I"?t.write(i[0].name,i[0]):Ue(t,e.params)),t.write(" => "),e.body.type[0]==="O"?(t.write("("),this.ObjectExpression(e.body,t),t.write(")")):this[e.body.type](e.body,t)},ThisExpression(e,t){t.write("this",e)},Super(e,t){t.write("super",e)},RestElement:qi=function(e,t){t.write("..."),this[e.argument.type](e.argument,t)},SpreadElement:qi,YieldExpression(e,t){t.write(e.delegate?"yield*":"yield"),e.argument&&(t.write(" "),this[e.argument.type](e.argument,t))},AwaitExpression(e,t){t.write("await ",e),dt(t,e.argument,e)},TemplateLiteral(e,t){const{quasis:i,expressions:r}=e;t.write("`");const{length:s}=r;for(let a=0;a<s;a++){const o=r[a],h=i[a];t.write(h.value.raw,h),t.write("${"),this[o.type](o,t),t.write("}")}const n=i[i.length-1];t.write(n.value.raw,n),t.write("`")},TemplateElement(e,t){t.write(e.value.raw,e)},TaggedTemplateExpression(e,t){dt(t,e.tag,e),this[e.quasi.type](e.quasi,t)},ArrayExpression:Ki=function(e,t){if(t.write("["),e.elements.length>0){const{elements:i}=e,{length:r}=i;for(let s=0;;){const n=i[s];if(n!=null&&this[n.type](n,t),++s<r)t.write(", ");else{n==null&&t.write(", ");break}}}t.write("]")},ArrayPattern:Ki,ObjectExpression(e,t){const i=t.indent.repeat(t.indentLevel++),{lineEnd:r,writeComments:s}=t,n=i+t.indent;if(t.write("{"),e.properties.length>0){t.write(r),s&&e.comments!=null&&X(t,e.comments,n,r);const a=","+r,{properties:o}=e,{length:h}=o;for(let u=0;;){const l=o[u];if(s&&l.comments!=null&&X(t,l.comments,n,r),t.write(n),this[l.type](l,t),++u<h)t.write(a);else break}t.write(r),s&&e.trailingComments!=null&&X(t,e.trailingComments,n,r),t.write(i+"}")}else s?e.comments!=null?(t.write(r),X(t,e.comments,n,r),e.trailingComments!=null&&X(t,e.trailingComments,n,r),t.write(i+"}")):e.trailingComments!=null?(t.write(r),X(t,e.trailingComments,n,r),t.write(i+"}")):t.write("}"):t.write("}");t.indentLevel--},Property(e,t){e.method||e.kind[0]!=="i"?this.MethodDefinition(e,t):(e.shorthand||(e.computed?(t.write("["),this[e.key.type](e.key,t),t.write("]")):this[e.key.type](e.key,t),t.write(": ")),this[e.value.type](e.value,t))},PropertyDefinition(e,t){if(e.static&&t.write("static "),e.computed&&t.write("["),this[e.key.type](e.key,t),e.computed&&t.write("]"),e.value==null){e.key.type[0]!=="F"&&t.write(";");return}t.write(" = "),this[e.value.type](e.value,t),t.write(";")},ObjectPattern(e,t){if(t.write("{"),e.properties.length>0){const{properties:i}=e,{length:r}=i;for(let s=0;this[i[s].type](i[s],t),++s<r;)t.write(", ")}t.write("}")},SequenceExpression(e,t){Ue(t,e.expressions)},UnaryExpression(e,t){if(e.prefix){const{operator:i,argument:r,argument:{type:s}}=e;t.write(i);const n=ji(t,r,e);!n&&(i.length>1||s[0]==="U"&&(s[1]==="n"||s[1]==="p")&&r.prefix&&r.operator[0]===i&&(i==="+"||i==="-"))&&t.write(" "),n?(t.write(i.length>1?" (":"("),this[s](r,t),t.write(")")):this[s](r,t)}else this[e.argument.type](e.argument,t),t.write(e.operator)},UpdateExpression(e,t){e.prefix?(t.write(e.operator),this[e.argument.type](e.argument,t)):(this[e.argument.type](e.argument,t),t.write(e.operator))},AssignmentExpression(e,t){this[e.left.type](e.left,t),t.write(" "+e.operator+" "),this[e.right.type](e.right,t)},AssignmentPattern(e,t){this[e.left.type](e.left,t),t.write(" = "),this[e.right.type](e.right,t)},BinaryExpression:Ui=function(e,t){const i=e.operator==="in";i&&t.write("("),dt(t,e.left,e,!1),t.write(" "+e.operator+" "),dt(t,e.right,e,!0),i&&t.write(")")},LogicalExpression:Ui,ConditionalExpression(e,t){const{test:i}=e,r=t.expressionsPrecedence[i.type];r===de||r<=t.expressionsPrecedence.ConditionalExpression?(t.write("("),this[i.type](i,t),t.write(")")):this[i.type](i,t),t.write(" ? "),this[e.consequent.type](e.consequent,t),t.write(" : "),this[e.alternate.type](e.alternate,t)},NewExpression(e,t){t.write("new ");const i=t.expressionsPrecedence[e.callee.type];i===de||i<t.expressionsPrecedence.CallExpression||as(e.callee)?(t.write("("),this[e.callee.type](e.callee,t),t.write(")")):this[e.callee.type](e.callee,t),Ue(t,e.arguments)},CallExpression(e,t){const i=t.expressionsPrecedence[e.callee.type];i===de||i<t.expressionsPrecedence.CallExpression?(t.write("("),this[e.callee.type](e.callee,t),t.write(")")):this[e.callee.type](e.callee,t),e.optional&&t.write("?."),Ue(t,e.arguments)},ChainExpression(e,t){this[e.expression.type](e.expression,t)},MemberExpression(e,t){const i=t.expressionsPrecedence[e.object.type];i===de||i<t.expressionsPrecedence.MemberExpression?(t.write("("),this[e.object.type](e.object,t),t.write(")")):this[e.object.type](e.object,t),e.computed?(e.optional&&t.write("?."),t.write("["),this[e.property.type](e.property,t),t.write("]")):(e.optional?t.write("?."):t.write("."),this[e.property.type](e.property,t))},MetaProperty(e,t){t.write(e.meta.name+"."+e.property.name,e)},Identifier(e,t){t.write(e.name,e)},PrivateIdentifier(e,t){t.write(`#${e.name}`,e)},Literal(e,t){e.raw!=null?t.write(e.raw,e):e.regex!=null?this.RegExpLiteral(e,t):e.bigint!=null?t.write(e.bigint+"n",e):t.write(rs(e.value),e)},RegExpLiteral(e,t){const{regex:i}=e;t.write(`/${i.pattern}/${i.flags}`,e)}},os={},hs=Mt;class us{constructor(t){const i=t??os;this.output="",i.output!=null?(this.output=i.output,this.write=this.writeToStream):this.output="",this.generator=i.generator!=null?i.generator:Mt,this.expressionsPrecedence=i.expressionsPrecedence!=null?i.expressionsPrecedence:ss,this.indent=i.indent!=null?i.indent:" ",this.lineEnd=i.lineEnd!=null?i.lineEnd:`
29
29
  `,this.indentLevel=i.startingIndentLevel!=null?i.startingIndentLevel:0,this.writeComments=i.comments?i.comments:!1,i.sourceMap!=null&&(this.write=i.output==null?this.writeAndMap:this.writeToStreamAndMap,this.sourceMap=i.sourceMap,this.line=1,this.column=0,this.lineEndSize=this.lineEnd.split(`
30
- `).length-1,this.mapping={original:null,generated:this,name:void 0,source:i.sourceMap.file||i.sourceMap._file})}write(t){this.output+=t}writeToStream(t){this.output.write(t)}writeAndMap(t,i){this.output+=t,this.map(t,i)}writeToStreamAndMap(t,i){this.output.write(t),this.map(t,i)}map(t,i){if(i!=null){const{type:s}=i;if(s[0]==="L"&&s[2]==="n"){this.column=0,this.line++;return}if(i.loc!=null){const{mapping:a}=this;a.original=i.loc.start,a.name=i.name,this.sourceMap.addMapping(a)}if(s[0]==="T"&&s[8]==="E"||s[0]==="L"&&s[1]==="i"&&typeof i.value=="string"){const{length:a}=t;let{column:o,line:u}=this;for(let c=0;c<a;c++)t[c]===`
31
- `?(o=0,u++):o++;this.column=o,this.line=u;return}}const{length:r}=t,{lineEnd:n}=this;r>0&&(this.lineEndSize>0&&(n.length===1?t[r-1]===n:t.endsWith(n))?(this.line+=this.lineEndSize,this.column=0):this.column+=r)}toString(){return this.output}}function Br(e,t){const i=new Lr(t);return i.generator[e.type](e,i),i.output}var Rr=Object.defineProperty,Dr=(e,t,i)=>t in e?Rr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,G=(e,t,i)=>Dr(e,typeof t!="symbol"?t+"":t,i);const jr=new Set(["Infinity","NaN","undefined","null","true","false"]),Or=new Set(["Math","Array","Object","String","Number","Boolean","Date","RegExp","Error","JSON","Promise","Set","Map","WeakSet","WeakMap","Symbol","BigInt","Proxy","Reflect","console","isNaN","isFinite","parseInt","parseFloat","encodeURI","decodeURI","encodeURIComponent","decodeURIComponent"]);class Fr{constructor(){G(this,"scopes",[]),G(this,"scopeTypes",[]),G(this,"scopeCounts",new Map),G(this,"contextBoundVars",new Set),G(this,"arrayPatternElements",new Set),G(this,"rootParams",new Set),G(this,"localSeriesVars",new Set),G(this,"varKinds",new Map),G(this,"loopVars",new Set),G(this,"loopVarNames",new Map),G(this,"paramIdCounter",0),G(this,"cacheIdCounter",0),G(this,"tempVarCounter",0),G(this,"taCallIdCounter",0),G(this,"hoistingStack",[]),G(this,"suppressHoisting",!1),this.pushScope("glb")}get nextParamIdArg(){return{type:"Identifier",name:`'p${this.paramIdCounter++}'`}}get nextCacheIdArg(){return{type:"Identifier",name:`'cache_${this.cacheIdCounter++}'`}}getNextTACallId(){return{type:"Literal",value:`_ta${this.taCallIdCounter++}`}}pushScope(t){this.scopes.push(new Map),this.scopeTypes.push(t),this.scopeCounts.set(t,(this.scopeCounts.get(t)||0)+1)}popScope(){this.scopes.pop(),this.scopeTypes.pop()}getCurrentScopeType(){return this.scopeTypes[this.scopeTypes.length-1]}getCurrentScopeCount(){return this.scopeCounts.get(this.getCurrentScopeType())||1}addLocalSeriesVar(t){this.localSeriesVars.add(t)}isLocalSeriesVar(t){return this.localSeriesVars.has(t)}addContextBoundVar(t,i=!1){this.contextBoundVars.add(t),i&&this.rootParams.add(t)}removeContextBoundVar(t){this.contextBoundVars.has(t)&&(this.contextBoundVars.delete(t),this.rootParams.has(t)&&this.rootParams.delete(t))}addArrayPatternElement(t){this.arrayPatternElements.add(t)}isContextBound(t){return jr.has(t)||Or.has(t)?!1:this.contextBoundVars.has(t)}isArrayPatternElement(t){return this.arrayPatternElements.has(t)}isRootParam(t){return this.rootParams.has(t)}addLoopVariable(t,i){this.loopVars.add(t),this.loopVarNames.set(t,i)}getLoopVariableName(t){return this.loopVarNames.get(t)}isLoopVariable(t){return this.loopVars.has(t)}addVariable(t,i){if(this.isContextBound(t))return t;const r=this.scopes[this.scopes.length-1],n=this.scopeTypes[this.scopeTypes.length-1],s=this.scopeCounts.get(n)||1,a=`${n}${s}_${t}`;return r.set(t,a),this.varKinds.set(a,i),a}getVariable(t){if(this.loopVars.has(t)){const i=this.loopVarNames.get(t);if(i)return[i,"let"]}if(this.isContextBound(t))return[t,"let"];for(let i=this.scopes.length-1;i>=0;i--){const r=this.scopes[i];if(r.has(t)){const n=r.get(t),s=this.varKinds.get(n)||"let";return[n,s]}}return[t,"let"]}generateTempVar(){return`temp_${++this.tempVarCounter}`}enterHoistingScope(){this.hoistingStack.push([])}exitHoistingScope(){return this.hoistingStack.pop()||[]}addHoistedStatement(t){this.hoistingStack.length>0&&!this.suppressHoisting&&this.hoistingStack[this.hoistingStack.length-1].push(t)}setSuppressHoisting(t){this.suppressHoisting=t}shouldSuppressHoisting(){return this.suppressHoisting}generateParamId(){return`p${this.paramIdCounter++}`}}function St(e,t,i,r,n){i||(i=b),function s(a,o,u){var c=u||a.type;i[c](a,o,s),t[c]&&t[c](a,o)}(e,r,n)}function U(e,t,i,r,n){var s=i?$r(i,r||void 0):r;(function a(o,u,c){s[c||o.type](o,u,a)})(e,t,n)}function $r(e,t){var i=Object.create(t||b);for(var r in e)i[r]=e[r];return i}function Nt(e,t,i){i(e,t)}function Ee(e,t,i){}var b={};b.Program=b.BlockStatement=b.StaticBlock=function(e,t,i){for(var r=0,n=e.body;r<n.length;r+=1){var s=n[r];i(s,t,"Statement")}},b.Statement=Nt,b.EmptyStatement=Ee,b.ExpressionStatement=b.ParenthesizedExpression=b.ChainExpression=function(e,t,i){return i(e.expression,t,"Expression")},b.IfStatement=function(e,t,i){i(e.test,t,"Expression"),i(e.consequent,t,"Statement"),e.alternate&&i(e.alternate,t,"Statement")},b.LabeledStatement=function(e,t,i){return i(e.body,t,"Statement")},b.BreakStatement=b.ContinueStatement=Ee,b.WithStatement=function(e,t,i){i(e.object,t,"Expression"),i(e.body,t,"Statement")},b.SwitchStatement=function(e,t,i){i(e.discriminant,t,"Expression");for(var r=0,n=e.cases;r<n.length;r+=1){var s=n[r];i(s,t)}},b.SwitchCase=function(e,t,i){e.test&&i(e.test,t,"Expression");for(var r=0,n=e.consequent;r<n.length;r+=1){var s=n[r];i(s,t,"Statement")}},b.ReturnStatement=b.YieldExpression=b.AwaitExpression=function(e,t,i){e.argument&&i(e.argument,t,"Expression")},b.ThrowStatement=b.SpreadElement=function(e,t,i){return i(e.argument,t,"Expression")},b.TryStatement=function(e,t,i){i(e.block,t,"Statement"),e.handler&&i(e.handler,t),e.finalizer&&i(e.finalizer,t,"Statement")},b.CatchClause=function(e,t,i){e.param&&i(e.param,t,"Pattern"),i(e.body,t,"Statement")},b.WhileStatement=b.DoWhileStatement=function(e,t,i){i(e.test,t,"Expression"),i(e.body,t,"Statement")},b.ForStatement=function(e,t,i){e.init&&i(e.init,t,"ForInit"),e.test&&i(e.test,t,"Expression"),e.update&&i(e.update,t,"Expression"),i(e.body,t,"Statement")},b.ForInStatement=b.ForOfStatement=function(e,t,i){i(e.left,t,"ForInit"),i(e.right,t,"Expression"),i(e.body,t,"Statement")},b.ForInit=function(e,t,i){e.type==="VariableDeclaration"?i(e,t):i(e,t,"Expression")},b.DebuggerStatement=Ee,b.FunctionDeclaration=function(e,t,i){return i(e,t,"Function")},b.VariableDeclaration=function(e,t,i){for(var r=0,n=e.declarations;r<n.length;r+=1){var s=n[r];i(s,t)}},b.VariableDeclarator=function(e,t,i){i(e.id,t,"Pattern"),e.init&&i(e.init,t,"Expression")},b.Function=function(e,t,i){e.id&&i(e.id,t,"Pattern");for(var r=0,n=e.params;r<n.length;r+=1){var s=n[r];i(s,t,"Pattern")}i(e.body,t,e.expression?"Expression":"Statement")},b.Pattern=function(e,t,i){e.type==="Identifier"?i(e,t,"VariablePattern"):e.type==="MemberExpression"?i(e,t,"MemberPattern"):i(e,t)},b.VariablePattern=Ee,b.MemberPattern=Nt,b.RestElement=function(e,t,i){return i(e.argument,t,"Pattern")},b.ArrayPattern=function(e,t,i){for(var r=0,n=e.elements;r<n.length;r+=1){var s=n[r];s&&i(s,t,"Pattern")}},b.ObjectPattern=function(e,t,i){for(var r=0,n=e.properties;r<n.length;r+=1){var s=n[r];s.type==="Property"?(s.computed&&i(s.key,t,"Expression"),i(s.value,t,"Pattern")):s.type==="RestElement"&&i(s.argument,t,"Pattern")}},b.Expression=Nt,b.ThisExpression=b.Super=b.MetaProperty=Ee,b.ArrayExpression=function(e,t,i){for(var r=0,n=e.elements;r<n.length;r+=1){var s=n[r];s&&i(s,t,"Expression")}},b.ObjectExpression=function(e,t,i){for(var r=0,n=e.properties;r<n.length;r+=1){var s=n[r];i(s,t)}},b.FunctionExpression=b.ArrowFunctionExpression=b.FunctionDeclaration,b.SequenceExpression=function(e,t,i){for(var r=0,n=e.expressions;r<n.length;r+=1){var s=n[r];i(s,t,"Expression")}},b.TemplateLiteral=function(e,t,i){for(var r=0,n=e.quasis;r<n.length;r+=1){var s=n[r];i(s,t)}for(var a=0,o=e.expressions;a<o.length;a+=1){var u=o[a];i(u,t,"Expression")}},b.TemplateElement=Ee,b.UnaryExpression=b.UpdateExpression=function(e,t,i){i(e.argument,t,"Expression")},b.BinaryExpression=b.LogicalExpression=function(e,t,i){i(e.left,t,"Expression"),i(e.right,t,"Expression")},b.AssignmentExpression=b.AssignmentPattern=function(e,t,i){i(e.left,t,"Pattern"),i(e.right,t,"Expression")},b.ConditionalExpression=function(e,t,i){i(e.test,t,"Expression"),i(e.consequent,t,"Expression"),i(e.alternate,t,"Expression")},b.NewExpression=b.CallExpression=function(e,t,i){if(i(e.callee,t,"Expression"),e.arguments)for(var r=0,n=e.arguments;r<n.length;r+=1){var s=n[r];i(s,t,"Expression")}},b.MemberExpression=function(e,t,i){i(e.object,t,"Expression"),e.computed&&i(e.property,t,"Expression")},b.ExportNamedDeclaration=b.ExportDefaultDeclaration=function(e,t,i){e.declaration&&i(e.declaration,t,e.type==="ExportNamedDeclaration"||e.declaration.id?"Statement":"Expression"),e.source&&i(e.source,t,"Expression")},b.ExportAllDeclaration=function(e,t,i){e.exported&&i(e.exported,t),i(e.source,t,"Expression")},b.ImportDeclaration=function(e,t,i){for(var r=0,n=e.specifiers;r<n.length;r+=1){var s=n[r];i(s,t)}i(e.source,t,"Expression")},b.ImportExpression=function(e,t,i){i(e.source,t,"Expression")},b.ImportSpecifier=b.ImportDefaultSpecifier=b.ImportNamespaceSpecifier=b.Identifier=b.PrivateIdentifier=b.Literal=Ee,b.TaggedTemplateExpression=function(e,t,i){i(e.tag,t,"Expression"),i(e.quasi,t,"Expression")},b.ClassDeclaration=b.ClassExpression=function(e,t,i){return i(e,t,"Class")},b.Class=function(e,t,i){e.id&&i(e.id,t,"Pattern"),e.superClass&&i(e.superClass,t,"Expression"),i(e.body,t)},b.ClassBody=function(e,t,i){for(var r=0,n=e.body;r<n.length;r+=1){var s=n[r];i(s,t)}},b.MethodDefinition=b.PropertyDefinition=b.Property=function(e,t,i){e.computed&&i(e.key,t,"Expression"),e.value&&i(e.value,t,"Expression")};const W="$",v={createIdentifier(e){return{type:"Identifier",name:e}},createLiteral(e){return{type:"Literal",value:e}},createMemberExpression(e,t,i=!1){return{type:"MemberExpression",object:e,property:t,computed:i}},createContextIdentifier(){return this.createIdentifier(W)},createContextVariableReference(e,t){const i=this.createContextIdentifier(),r=this.createIdentifier(e),n=this.createIdentifier(t);return this.createMemberExpression(this.createMemberExpression(i,r,!1),n,!1)},createContextVariableAccess0(e,t){const i=this.createContextVariableReference(e,t);return this.createGetCall(i,0)},createArrayAccess(e,t){const i=typeof t=="number"?this.createLiteral(t):t;return this.createMemberExpression(e,i,!0)},createCallExpression(e,t){return{type:"CallExpression",callee:e,arguments:t}},createAssignmentExpression(e,t,i="="){return{type:"AssignmentExpression",operator:i,left:e,right:t}},createExpressionStatement(e){return{type:"ExpressionStatement",expression:e}},createInitCall(e,t,i){const r=this.createMemberExpression(this.createContextIdentifier(),this.createIdentifier("init"),!1),n=[e,t];return i&&n.push(i),this.createCallExpression(r,n)},createInitVarCall(e,t){const i=this.createMemberExpression(this.createContextIdentifier(),this.createIdentifier("initVar"),!1),r=[e,t];return this.createCallExpression(i,r)},createGetCall(e,t){const i=this.createMemberExpression(this.createContextIdentifier(),this.createIdentifier("get"),!1),r=typeof t=="number"?this.createLiteral(t):t;return this.createCallExpression(i,[e,r])},createSetCall(e,t){const i=this.createMemberExpression(this.createContextIdentifier(),this.createIdentifier("set"),!1);return this.createCallExpression(i,[e,t])},createMathEqCall(e,t){const i=this.createMemberExpression(this.createContextIdentifier(),this.createIdentifier("math"),!1),r=this.createMemberExpression(i,this.createIdentifier("__eq"),!1);return this.createCallExpression(r,[e,t])},createWrapperFunction(e){return{type:"FunctionDeclaration",id:null,params:[this.createIdentifier("context")],body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:e}]}}},createVariableDeclaration(e,t){return{type:"VariableDeclaration",kind:"const",declarations:[{type:"VariableDeclarator",id:this.createIdentifier(e),init:t}]}}},tt=["ta","math","request","array","input"],Ii=["open","high","low","close","volume","hl2","hlc3","ohlc4","openTime","closeTime"],Ai=["input","ta","math","request","array","na","plotchar","color","plot","nz","strategy","library","str","box","line","label","table","map","matrix","log","map","timeframe","syminfo","barstate","bar_index","last_bar_index","last_bar_time","order","currency","display","dayofweek"],Wr=["na","nz","plot","plotchar","color"];function qr(e){let t=null,i=W;if(e.type==="Program"&&e.body.length>0){const p=e.body[0];if(p.type==="ExpressionStatement"&&(p.expression.type==="ArrowFunctionExpression"||p.expression.type==="FunctionExpression")){const g=p.expression;g.body.type==="BlockStatement"&&(t=g.body.body,g.params.length>0&&g.params[0].type==="Identifier"&&(i=g.params[0].name))}}if(!t)return;const r=new Set,n=new Set,s=p=>{p.type==="Identifier"?r.add(p.name):p.type==="ObjectPattern"?p.properties.forEach(g=>s(g.value)):p.type==="ArrayPattern"&&p.elements.forEach(g=>{g&&s(g)})};U(e,{},{VariableDeclarator(p,g,x){s(p.id),p.init&&x(p.init,g)},FunctionDeclaration(p,g,x){s(p.id),x(p.body,g)},Identifier(p,g,x){n.add(p.name)},MemberExpression(p,g,x){x(p.object,g),p.computed&&x(p.property,g)},Property(p,g,x){p.computed&&x(p.key,g),x(p.value,g)}}),t.forEach(p=>{p.type==="VariableDeclaration"?p.declarations.forEach(g=>s(g.id)):p.type==="FunctionDeclaration"&&s(p.id)});const a=Ii,o=Ai,u=a.filter(p=>!r.has(p)),c=o.filter(p=>!r.has(p)),h=u.filter(p=>n.has(p)),f=c.filter(p=>n.has(p)),d=[];h.length>0&&d.push({type:"VariableDeclaration",kind:"const",declarations:[{type:"VariableDeclarator",id:{type:"ObjectPattern",properties:h.map(p=>({type:"Property",key:{type:"Identifier",name:p},value:{type:"Identifier",name:p},kind:"init",shorthand:!0}))},init:{type:"MemberExpression",object:{type:"Identifier",name:i},property:{type:"Identifier",name:"data"},computed:!1}}]}),f.length>0&&d.push({type:"VariableDeclaration",kind:"const",declarations:[{type:"VariableDeclarator",id:{type:"ObjectPattern",properties:f.map(p=>({type:"Property",key:{type:"Identifier",name:p},value:{type:"Identifier",name:p},kind:"init",shorthand:!0}))},init:{type:"MemberExpression",object:{type:"Identifier",name:i},property:{type:"Identifier",name:"pine"},computed:!1}}]}),d.length>0&&t.unshift(...d)}function Ur(e){let t=null,i=W;if(e.type==="Program"&&e.body.length>0){const o=e.body[0];if(o.type==="ExpressionStatement"&&(o.expression.type==="ArrowFunctionExpression"||o.expression.type==="FunctionExpression")){const u=o.expression;u.body.type==="BlockStatement"&&(t=u.body.body,u.params.length>0&&u.params[0].type==="Identifier"&&(i=u.params[0].name))}}if(!t)return;const r=new Set(Ii),n=new Set(Ai),s=new Set(Wr),a=new Map;t.forEach(o=>{o.type==="VariableDeclaration"&&o.declarations.forEach(u=>{if(u.init&&u.init.type==="MemberExpression"&&u.init.object.type==="Identifier"&&u.init.object.name===i&&u.init.property.type==="Identifier"){const c=u.init.property.name;let h=null;if(c==="data"?h=r:c==="pine"?h=n:c==="core"&&(h=s),h&&u.id.type==="ObjectPattern")u.id.properties.forEach(f=>{if(f.type==="Property"&&f.key.type==="Identifier"&&f.value.type==="Identifier"){const d=f.key.name,p=f.value.name;h.has(d)&&d!==p&&(a.set(p,d),f.value.name=d,f.shorthand=!0)}});else if(u.id.type==="Identifier"&&tt.includes(c)){const f=c,d=u.id.name;f!==d&&(a.set(d,f),u.id.name=f)}}})}),a.size>0&&U(e,{},{Identifier(o){a.has(o.name)&&(o.name=a.get(o.name))},MemberExpression(o,u,c){c(o.object,u),o.computed&&c(o.property,u)},Property(o,u,c){o.computed&&c(o.key,u),c(o.value,u)}})}function zr(e){try{const t=vi(e,{ecmaVersion:"latest",sourceType:"module"});if(t.type==="Program"&&t.body.length===1){const i=t.body[0];if(i.type==="ExpressionStatement"){const r=i.expression;if(r.type==="ArrowFunctionExpression"||r.type==="FunctionExpression")return!0}if(i.type==="FunctionDeclaration")return!0}return!1}catch{return!1}}function Gr(e){return e=e.trim(),zr(e)?e:`(context) => {
30
+ `).length-1,this.mapping={original:null,generated:this,name:void 0,source:i.sourceMap.file||i.sourceMap._file})}write(t){this.output+=t}writeToStream(t){this.output.write(t)}writeAndMap(t,i){this.output+=t,this.map(t,i)}writeToStreamAndMap(t,i){this.output.write(t),this.map(t,i)}map(t,i){if(i!=null){const{type:n}=i;if(n[0]==="L"&&n[2]==="n"){this.column=0,this.line++;return}if(i.loc!=null){const{mapping:a}=this;a.original=i.loc.start,a.name=i.name,this.sourceMap.addMapping(a)}if(n[0]==="T"&&n[8]==="E"||n[0]==="L"&&n[1]==="i"&&typeof i.value=="string"){const{length:a}=t;let{column:o,line:h}=this;for(let u=0;u<a;u++)t[u]===`
31
+ `?(o=0,h++):o++;this.column=o,this.line=h;return}}const{length:r}=t,{lineEnd:s}=this;r>0&&(this.lineEndSize>0&&(s.length===1?t[r-1]===s:t.endsWith(s))?(this.line+=this.lineEndSize,this.column=0):this.column+=r)}toString(){return this.output}}function Hi(e,t){const i=new us(t);return i.generator[e.type](e,i),i.output}var cs=Object.defineProperty,ls=(e,t,i)=>t in e?cs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,G=(e,t,i)=>ls(e,typeof t!="symbol"?t+"":t,i);const ps=new Set(["Infinity","NaN","undefined","null","true","false"]),fs=new Set(["Math","Array","Object","String","Number","Boolean","Date","RegExp","Error","JSON","Promise","Set","Map","WeakSet","WeakMap","Symbol","BigInt","Proxy","Reflect","console","isNaN","isFinite","parseInt","parseFloat","encodeURI","decodeURI","encodeURIComponent","decodeURIComponent"]);class ms{constructor(){G(this,"scopes",[]),G(this,"scopeTypes",[]),G(this,"scopeCounts",new Map),G(this,"contextBoundVars",new Set),G(this,"arrayPatternElements",new Set),G(this,"rootParams",new Set),G(this,"localSeriesVars",new Set),G(this,"varKinds",new Map),G(this,"loopVars",new Set),G(this,"loopVarNames",new Map),G(this,"paramIdCounter",0),G(this,"cacheIdCounter",0),G(this,"tempVarCounter",0),G(this,"taCallIdCounter",0),G(this,"hoistingStack",[]),G(this,"suppressHoisting",!1),this.pushScope("glb")}get nextParamIdArg(){return{type:"Identifier",name:`'p${this.paramIdCounter++}'`}}get nextCacheIdArg(){return{type:"Identifier",name:`'cache_${this.cacheIdCounter++}'`}}getNextTACallId(){return{type:"Literal",value:`_ta${this.taCallIdCounter++}`}}pushScope(t){this.scopes.push(new Map),this.scopeTypes.push(t),this.scopeCounts.set(t,(this.scopeCounts.get(t)||0)+1)}popScope(){this.scopes.pop(),this.scopeTypes.pop()}getCurrentScopeType(){return this.scopeTypes[this.scopeTypes.length-1]}getCurrentScopeCount(){return this.scopeCounts.get(this.getCurrentScopeType())||1}addLocalSeriesVar(t){this.localSeriesVars.add(t)}isLocalSeriesVar(t){return this.localSeriesVars.has(t)}addContextBoundVar(t,i=!1){this.contextBoundVars.add(t),i&&this.rootParams.add(t)}removeContextBoundVar(t){this.contextBoundVars.has(t)&&(this.contextBoundVars.delete(t),this.rootParams.has(t)&&this.rootParams.delete(t))}addArrayPatternElement(t){this.arrayPatternElements.add(t)}isContextBound(t){return ps.has(t)||fs.has(t)?!1:this.contextBoundVars.has(t)}isArrayPatternElement(t){return this.arrayPatternElements.has(t)}isRootParam(t){return this.rootParams.has(t)}addLoopVariable(t,i){this.loopVars.add(t),this.loopVarNames.set(t,i)}getLoopVariableName(t){return this.loopVarNames.get(t)}isLoopVariable(t){return this.loopVars.has(t)}addVariable(t,i){if(this.isContextBound(t))return t;const r=this.scopes[this.scopes.length-1],s=this.scopeTypes[this.scopeTypes.length-1],n=this.scopeCounts.get(s)||1,a=`${s}${n}_${t}`;return r.set(t,a),this.varKinds.set(a,i),a}getVariable(t){if(this.loopVars.has(t)){const i=this.loopVarNames.get(t);if(i)return[i,"let"]}if(this.isContextBound(t))return[t,"let"];for(let i=this.scopes.length-1;i>=0;i--){const r=this.scopes[i];if(r.has(t)){const s=r.get(t),n=this.varKinds.get(s)||"let";return[s,n]}}return[t,"let"]}generateTempVar(){return`temp_${++this.tempVarCounter}`}enterHoistingScope(){this.hoistingStack.push([])}exitHoistingScope(){return this.hoistingStack.pop()||[]}addHoistedStatement(t){this.hoistingStack.length>0&&!this.suppressHoisting&&this.hoistingStack[this.hoistingStack.length-1].push(t)}setSuppressHoisting(t){this.suppressHoisting=t}shouldSuppressHoisting(){return this.suppressHoisting}generateParamId(){return`p${this.paramIdCounter++}`}}function Lt(e,t,i,r,s){i||(i=b),function n(a,o,h){var u=h||a.type;i[u](a,o,n),t[u]&&t[u](a,o)}(e,r,s)}function z(e,t,i,r,s){var n=i?ds(i,r||void 0):r;(function a(o,h,u){n[u||o.type](o,h,a)})(e,t,s)}function ds(e,t){var i=Object.create(t||b);for(var r in e)i[r]=e[r];return i}function Bt(e,t,i){i(e,t)}function Re(e,t,i){}var b={};b.Program=b.BlockStatement=b.StaticBlock=function(e,t,i){for(var r=0,s=e.body;r<s.length;r+=1){var n=s[r];i(n,t,"Statement")}},b.Statement=Bt,b.EmptyStatement=Re,b.ExpressionStatement=b.ParenthesizedExpression=b.ChainExpression=function(e,t,i){return i(e.expression,t,"Expression")},b.IfStatement=function(e,t,i){i(e.test,t,"Expression"),i(e.consequent,t,"Statement"),e.alternate&&i(e.alternate,t,"Statement")},b.LabeledStatement=function(e,t,i){return i(e.body,t,"Statement")},b.BreakStatement=b.ContinueStatement=Re,b.WithStatement=function(e,t,i){i(e.object,t,"Expression"),i(e.body,t,"Statement")},b.SwitchStatement=function(e,t,i){i(e.discriminant,t,"Expression");for(var r=0,s=e.cases;r<s.length;r+=1){var n=s[r];i(n,t)}},b.SwitchCase=function(e,t,i){e.test&&i(e.test,t,"Expression");for(var r=0,s=e.consequent;r<s.length;r+=1){var n=s[r];i(n,t,"Statement")}},b.ReturnStatement=b.YieldExpression=b.AwaitExpression=function(e,t,i){e.argument&&i(e.argument,t,"Expression")},b.ThrowStatement=b.SpreadElement=function(e,t,i){return i(e.argument,t,"Expression")},b.TryStatement=function(e,t,i){i(e.block,t,"Statement"),e.handler&&i(e.handler,t),e.finalizer&&i(e.finalizer,t,"Statement")},b.CatchClause=function(e,t,i){e.param&&i(e.param,t,"Pattern"),i(e.body,t,"Statement")},b.WhileStatement=b.DoWhileStatement=function(e,t,i){i(e.test,t,"Expression"),i(e.body,t,"Statement")},b.ForStatement=function(e,t,i){e.init&&i(e.init,t,"ForInit"),e.test&&i(e.test,t,"Expression"),e.update&&i(e.update,t,"Expression"),i(e.body,t,"Statement")},b.ForInStatement=b.ForOfStatement=function(e,t,i){i(e.left,t,"ForInit"),i(e.right,t,"Expression"),i(e.body,t,"Statement")},b.ForInit=function(e,t,i){e.type==="VariableDeclaration"?i(e,t):i(e,t,"Expression")},b.DebuggerStatement=Re,b.FunctionDeclaration=function(e,t,i){return i(e,t,"Function")},b.VariableDeclaration=function(e,t,i){for(var r=0,s=e.declarations;r<s.length;r+=1){var n=s[r];i(n,t)}},b.VariableDeclarator=function(e,t,i){i(e.id,t,"Pattern"),e.init&&i(e.init,t,"Expression")},b.Function=function(e,t,i){e.id&&i(e.id,t,"Pattern");for(var r=0,s=e.params;r<s.length;r+=1){var n=s[r];i(n,t,"Pattern")}i(e.body,t,e.expression?"Expression":"Statement")},b.Pattern=function(e,t,i){e.type==="Identifier"?i(e,t,"VariablePattern"):e.type==="MemberExpression"?i(e,t,"MemberPattern"):i(e,t)},b.VariablePattern=Re,b.MemberPattern=Bt,b.RestElement=function(e,t,i){return i(e.argument,t,"Pattern")},b.ArrayPattern=function(e,t,i){for(var r=0,s=e.elements;r<s.length;r+=1){var n=s[r];n&&i(n,t,"Pattern")}},b.ObjectPattern=function(e,t,i){for(var r=0,s=e.properties;r<s.length;r+=1){var n=s[r];n.type==="Property"?(n.computed&&i(n.key,t,"Expression"),i(n.value,t,"Pattern")):n.type==="RestElement"&&i(n.argument,t,"Pattern")}},b.Expression=Bt,b.ThisExpression=b.Super=b.MetaProperty=Re,b.ArrayExpression=function(e,t,i){for(var r=0,s=e.elements;r<s.length;r+=1){var n=s[r];n&&i(n,t,"Expression")}},b.ObjectExpression=function(e,t,i){for(var r=0,s=e.properties;r<s.length;r+=1){var n=s[r];i(n,t)}},b.FunctionExpression=b.ArrowFunctionExpression=b.FunctionDeclaration,b.SequenceExpression=function(e,t,i){for(var r=0,s=e.expressions;r<s.length;r+=1){var n=s[r];i(n,t,"Expression")}},b.TemplateLiteral=function(e,t,i){for(var r=0,s=e.quasis;r<s.length;r+=1){var n=s[r];i(n,t)}for(var a=0,o=e.expressions;a<o.length;a+=1){var h=o[a];i(h,t,"Expression")}},b.TemplateElement=Re,b.UnaryExpression=b.UpdateExpression=function(e,t,i){i(e.argument,t,"Expression")},b.BinaryExpression=b.LogicalExpression=function(e,t,i){i(e.left,t,"Expression"),i(e.right,t,"Expression")},b.AssignmentExpression=b.AssignmentPattern=function(e,t,i){i(e.left,t,"Pattern"),i(e.right,t,"Expression")},b.ConditionalExpression=function(e,t,i){i(e.test,t,"Expression"),i(e.consequent,t,"Expression"),i(e.alternate,t,"Expression")},b.NewExpression=b.CallExpression=function(e,t,i){if(i(e.callee,t,"Expression"),e.arguments)for(var r=0,s=e.arguments;r<s.length;r+=1){var n=s[r];i(n,t,"Expression")}},b.MemberExpression=function(e,t,i){i(e.object,t,"Expression"),e.computed&&i(e.property,t,"Expression")},b.ExportNamedDeclaration=b.ExportDefaultDeclaration=function(e,t,i){e.declaration&&i(e.declaration,t,e.type==="ExportNamedDeclaration"||e.declaration.id?"Statement":"Expression"),e.source&&i(e.source,t,"Expression")},b.ExportAllDeclaration=function(e,t,i){e.exported&&i(e.exported,t),i(e.source,t,"Expression")},b.ImportDeclaration=function(e,t,i){for(var r=0,s=e.specifiers;r<s.length;r+=1){var n=s[r];i(n,t)}i(e.source,t,"Expression")},b.ImportExpression=function(e,t,i){i(e.source,t,"Expression")},b.ImportSpecifier=b.ImportDefaultSpecifier=b.ImportNamespaceSpecifier=b.Identifier=b.PrivateIdentifier=b.Literal=Re,b.TaggedTemplateExpression=function(e,t,i){i(e.tag,t,"Expression"),i(e.quasi,t,"Expression")},b.ClassDeclaration=b.ClassExpression=function(e,t,i){return i(e,t,"Class")},b.Class=function(e,t,i){e.id&&i(e.id,t,"Pattern"),e.superClass&&i(e.superClass,t,"Expression"),i(e.body,t)},b.ClassBody=function(e,t,i){for(var r=0,s=e.body;r<s.length;r+=1){var n=s[r];i(n,t)}},b.MethodDefinition=b.PropertyDefinition=b.Property=function(e,t,i){e.computed&&i(e.key,t,"Expression"),e.value&&i(e.value,t,"Expression")};const U="$",v={createIdentifier(e){return{type:"Identifier",name:e}},createLiteral(e){return{type:"Literal",value:e}},createMemberExpression(e,t,i=!1){return{type:"MemberExpression",object:e,property:t,computed:i}},createContextIdentifier(){return this.createIdentifier(U)},createContextVariableReference(e,t){const i=this.createContextIdentifier(),r=this.createIdentifier(e),s=this.createIdentifier(t);return this.createMemberExpression(this.createMemberExpression(i,r,!1),s,!1)},createContextVariableAccess0(e,t){const i=this.createContextVariableReference(e,t);return this.createGetCall(i,0)},createArrayAccess(e,t){const i=typeof t=="number"?this.createLiteral(t):t;return this.createMemberExpression(e,i,!0)},createCallExpression(e,t){return{type:"CallExpression",callee:e,arguments:t}},createAssignmentExpression(e,t,i="="){return{type:"AssignmentExpression",operator:i,left:e,right:t}},createExpressionStatement(e){return{type:"ExpressionStatement",expression:e}},createInitCall(e,t,i){const r=this.createMemberExpression(this.createContextIdentifier(),this.createIdentifier("init"),!1),s=[e,t];return i&&s.push(i),this.createCallExpression(r,s)},createInitVarCall(e,t){const i=this.createMemberExpression(this.createContextIdentifier(),this.createIdentifier("initVar"),!1),r=[e,t];return this.createCallExpression(i,r)},createGetCall(e,t){const i=this.createMemberExpression(this.createContextIdentifier(),this.createIdentifier("get"),!1),r=typeof t=="number"?this.createLiteral(t):t;return this.createCallExpression(i,[e,r])},createSetCall(e,t){const i=this.createMemberExpression(this.createContextIdentifier(),this.createIdentifier("set"),!1);return this.createCallExpression(i,[e,t])},createMathEqCall(e,t){const i=this.createMemberExpression(this.createContextIdentifier(),this.createIdentifier("math"),!1),r=this.createMemberExpression(i,this.createIdentifier("__eq"),!1);return this.createCallExpression(r,[e,t])},createWrapperFunction(e){return{type:"FunctionDeclaration",id:null,params:[this.createIdentifier("context")],body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:e}]}}},createVariableDeclaration(e,t){return{type:"VariableDeclaration",kind:"const",declarations:[{type:"VariableDeclarator",id:this.createIdentifier(e),init:t}]}},createAwaitExpression(e){return{type:"AwaitExpression",argument:e}}},et=["ta","math","request","array","input"],gs=["hline"],xs=["request.security","request.security_lower_tf"],Gi=["open","high","low","close","volume","hl2","hlc3","ohlc4","openTime","closeTime"],Yi=[...et,"plotchar","plot","hline","indicator","strategy","library","alertcondition","fixnan","na","color","nz","str","box","line","label","table","map","matrix","log","map","bool","timeframe","syminfo","barstate","bar_index","last_bar_index","last_bar_time","order","currency","display","dayofweek"],ys=["na","nz","plot","plotchar","color","hline"];function ws(e){let t=null,i=U;if(e.type==="Program"&&e.body.length>0){const p=e.body[0];if(p.type==="ExpressionStatement"&&(p.expression.type==="ArrowFunctionExpression"||p.expression.type==="FunctionExpression")){const x=p.expression;x.body.type==="BlockStatement"&&(t=x.body.body,x.params.length>0&&x.params[0].type==="Identifier"&&(i=x.params[0].name))}}if(!t)return;const r=new Set,s=new Set,n=p=>{p.type==="Identifier"?r.add(p.name):p.type==="ObjectPattern"?p.properties.forEach(x=>n(x.value)):p.type==="ArrayPattern"&&p.elements.forEach(x=>{x&&n(x)})};z(e,{},{VariableDeclarator(p,x,y){n(p.id),p.init&&y(p.init,x)},FunctionDeclaration(p,x,y){n(p.id),y(p.body,x)},Identifier(p,x,y){s.add(p.name)},MemberExpression(p,x,y){y(p.object,x),p.computed&&y(p.property,x)},Property(p,x,y){p.computed&&y(p.key,x),y(p.value,x)}}),t.forEach(p=>{p.type==="VariableDeclaration"?p.declarations.forEach(x=>n(x.id)):p.type==="FunctionDeclaration"&&n(p.id)});const a=Gi,o=Yi,h=a.filter(p=>!r.has(p)),u=o.filter(p=>!r.has(p)),l=h.filter(p=>s.has(p)),f=u.filter(p=>s.has(p)),g=[];l.length>0&&g.push({type:"VariableDeclaration",kind:"const",declarations:[{type:"VariableDeclarator",id:{type:"ObjectPattern",properties:l.map(p=>({type:"Property",key:{type:"Identifier",name:p},value:{type:"Identifier",name:p},kind:"init",shorthand:!0}))},init:{type:"MemberExpression",object:{type:"Identifier",name:i},property:{type:"Identifier",name:"data"},computed:!1}}]}),f.length>0&&g.push({type:"VariableDeclaration",kind:"const",declarations:[{type:"VariableDeclarator",id:{type:"ObjectPattern",properties:f.map(p=>({type:"Property",key:{type:"Identifier",name:p},value:{type:"Identifier",name:p},kind:"init",shorthand:!0}))},init:{type:"MemberExpression",object:{type:"Identifier",name:i},property:{type:"Identifier",name:"pine"},computed:!1}}]}),g.length>0&&t.unshift(...g)}function bs(e){let t=null,i=U;if(e.type==="Program"&&e.body.length>0){const o=e.body[0];if(o.type==="ExpressionStatement"&&(o.expression.type==="ArrowFunctionExpression"||o.expression.type==="FunctionExpression")){const h=o.expression;h.body.type==="BlockStatement"&&(t=h.body.body,h.params.length>0&&h.params[0].type==="Identifier"&&(i=h.params[0].name))}}if(!t)return;const r=new Set(Gi),s=new Set(Yi),n=new Set(ys),a=new Map;t.forEach(o=>{o.type==="VariableDeclaration"&&o.declarations.forEach(h=>{if(h.init&&h.init.type==="MemberExpression"&&h.init.object.type==="Identifier"&&h.init.object.name===i&&h.init.property.type==="Identifier"){const u=h.init.property.name;let l=null;if(u==="data"?l=r:u==="pine"?l=s:u==="core"&&(l=n),l&&h.id.type==="ObjectPattern")h.id.properties.forEach(f=>{if(f.type==="Property"&&f.key.type==="Identifier"&&f.value.type==="Identifier"){const g=f.key.name,p=f.value.name;l.has(g)&&g!==p&&(a.set(p,g),f.value.name=g,f.shorthand=!0)}});else if(h.id.type==="Identifier"&&et.includes(u)){const f=u,g=h.id.name;f!==g&&(a.set(g,f),h.id.name=f)}}})}),a.size>0&&z(e,{},{Identifier(o){a.has(o.name)&&(o.name=a.get(o.name))},MemberExpression(o,h,u){u(o.object,h),o.computed&&u(o.property,h)},Property(o,h,u){o.computed&&u(o.key,h),u(o.value,h)}})}function vs(e){try{const t=Fi(e,{ecmaVersion:"latest",sourceType:"module"});if(t.type==="Program"&&t.body.length===1){const i=t.body[0];if(i.type==="ExpressionStatement"){const r=i.expression;if(r.type==="ArrowFunctionExpression"||r.type==="FunctionExpression")return{isWrapped:!0,isAsync:r.async||!1,functionNode:r}}if(i.type==="FunctionDeclaration")return{isWrapped:!0,isAsync:i.async||!1,functionNode:i}}return{isWrapped:!1,isAsync:!1}}catch{return{isWrapped:!1,isAsync:!1}}}function _s(e){return e.async=!0,Hi(e)}function Ss(e){e=e.trim();const{isWrapped:t,isAsync:i,functionNode:r}=vs(e);return t&&r?i?e:_s(r):`async (context) => {
32
32
  ${e}
33
- }`}function Hr(e){U(e,null,{VariableDeclaration(t,i,r){t.declarations&&t.declarations.length>0&&t.declarations.forEach(n=>{if(n.init&&n.init.type==="ArrowFunctionExpression"&&n.init.start!==0){const s={type:"FunctionDeclaration",id:n.id,params:n.init.params,body:n.init.body.type==="BlockStatement"?n.init.body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:n.init.body}]},async:n.init.async,generator:!1};Object.assign(t,s)}}),t.body&&t.body.body&&t.body.body.forEach(n=>r(n,i))}})}function Kr(e,t){St(e,{VariableDeclaration(i){i.declarations.forEach(r=>{const n=r.init&&r.init.type==="MemberExpression"&&r.init.object&&(r.init.object.name==="context"||r.init.object.name===W||r.init.object.name==="context2"),s=r.init&&r.init.type==="MemberExpression"&&r.init.object?.object&&(r.init.object.object.name==="context"||r.init.object.object.name===W||r.init.object.object.name==="context2");(n||s)&&(r.id.name&&t.addContextBoundVar(r.id.name),r.id.properties&&r.id.properties.forEach(a=>{a.key.name&&t.addContextBoundVar(a.key.name)}))})}})}function Qr(e,t,i=!1){e.params.forEach(r=>{r.type==="Identifier"&&t.addContextBoundVar(r.name,i)})}function Xr(e,t){e.params.forEach(i=>{i.type==="Identifier"&&t.addContextBoundVar(i.name,!1)})}function Yr(e,t){let i;return St(e,{FunctionDeclaration(r){Xr(r,t)},ArrowFunctionExpression(r){const n=r.start===0;n&&r.params&&r.params.length>0&&(i=r.params[0].name,r.params[0].name=W),Qr(r,t,n)},VariableDeclaration(r){r.declarations.forEach(n=>{if(n.id.type==="ArrayPattern"){const s=t.generateTempVar(),a={type:"VariableDeclaration",kind:r.kind,declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:s},init:n.init}]};n.id.elements?.forEach(u=>{u.type==="Identifier"&&t.addArrayPatternElement(u.name)});const o=n.id.elements.map((u,c)=>({type:"VariableDeclaration",kind:r.kind,declarations:[{type:"VariableDeclarator",id:u,init:{type:"MemberExpression",object:{type:"Identifier",name:s},property:{type:"Literal",value:c},computed:!0}}]}));Object.assign(r,{type:"BlockStatement",body:[a,...o]})}})},ForStatement(r){}}),i}const Ct={type:"Identifier",name:"undefined"};function Se(e,t){if(e.computed&&e.property.type==="Identifier"){if(t.isLoopVariable(e.property.name)){if(e.object.type==="Identifier"&&!t.isLoopVariable(e.object.name)&&!t.isContextBound(e.object.name)){const[i,r]=t.getVariable(e.object.name),n=v.createContextVariableReference(r,i),s=v.createGetCall(n,e.property);Object.assign(e,s),e._indexTransformed=!0}return}if(!t.isContextBound(e.property.name)){const[i,r]=t.getVariable(e.property.name);e.property=v.createContextVariableReference(r,i),e.property=v.createGetCall(e.property,0)}}if(e.computed&&e.object.type==="Identifier"){if(t.isLoopVariable(e.object.name))return;if(!t.isContextBound(e.object.name)){const[i,r]=t.getVariable(e.object.name);e.object=v.createContextVariableReference(r,i)}if(e.property.type==="MemberExpression"){const i=e.property;i._indexTransformed||(Se(i,t),i._indexTransformed=!0)}}}function be(e,t){const i=v.createGetCall(v.createIdentifier(e.name),0);e.start!==void 0&&(i.start=e.start),e.end!==void 0&&(i.end=e.end),i._indexTransformed=!0,Object.assign(e,i)}function J(e,t){if(e.name!==W){if(e.name==="na"&&!(e.parent&&e.parent.type==="CallExpression"&&e.parent.callee===e)){e.name="NaN";return}if(e.name==="Math"||e.name==="NaN"||e.name==="undefined"||e.name==="Infinity"||e.name==="null"||e.name.startsWith("'")&&e.name.endsWith("'")||e.name.startsWith('"')&&e.name.endsWith('"')||e.name.startsWith("`")&&e.name.endsWith("`")||t.isLoopVariable(e.name))return;let i=!1;if(e.parent&&e.parent.type==="CallExpression"&&e.parent.arguments.includes(e)){const d=e.parent.callee;if(d.type==="MemberExpression"&&d.object&&d.object.name===W&&["get","set","init","param"].includes(d.property.name))e.parent.arguments.indexOf(e)===0&&(i=!0);else{const p=d.type==="MemberExpression"&&d.object&&d.object.type==="Identifier"&&tt.includes(d.object.name);d.type==="MemberExpression"&&!p?i=!1:i=!0}}const r=e.parent&&e.parent.type==="MemberExpression"&&e.parent.object===e&&t.isContextBound(e.name),n=e.parent&&e.parent.type==="CallExpression"&&e.parent.callee&&e.parent.callee.type==="MemberExpression"&&e.parent.callee.property.name==="param";e.parent&&e.parent.type==="AssignmentExpression"&&e.parent.left;const s=e.parent&&e.parent.type==="CallExpression"&&e.parent.callee===e,a=e.parent&&e.parent.type==="MemberExpression"&&e.parent.computed&&e.parent.object===e,o=e.parent&&e.parent.type==="MemberExpression"&&e.parent.computed&&e.parent.property===e&&e.parent.parent&&e.parent.parent.type==="CallExpression"&&e.parent.parent.callee&&e.parent.parent.callee.type==="MemberExpression"&&t.isContextBound(e.parent.parent.callee.object.name);if(r||n||i||o||s){if(s||t.isLocalSeriesVar(e.name)||t.isContextBound(e.name)&&!t.isRootParam(e.name))return;const[d,p]=t.getVariable(e.name),g=v.createContextVariableReference(p,d);Object.assign(e,g);return}const u=t.isContextBound(e.name)&&!t.isRootParam(e.name);if(u&&!(e.parent&&e.parent.type==="CallExpression"&&e.parent.arguments.includes(e)))return;if(t.isLocalSeriesVar(e.name)){if(!a){const d=v.createIdentifier(e.name),p=v.createGetCall(d,0);Object.assign(e,p)}return}const[c,h]=t.getVariable(e.name);let f;if(u)f=v.createIdentifier(e.name);else{if(c===e.name&&!t.isContextBound(e.name))return;f=v.createContextVariableReference(h,c)}if(a)Object.assign(e,f);else{const d=v.createGetCall(f,0);Object.assign(e,d)}}}function ce(e,t,i){if(e.object&&e.object.type==="Identifier"&&e.object.name==="Math")return;if(e.object&&e.object.type==="Identifier"&&tt.includes(e.object.name)&&i.isContextBound(e.object.name)&&!e.computed){const u=e.parent&&e.parent.type==="CallExpression"&&e.parent.callee===e,c=e.parent&&(e.parent.type==="VariableDeclarator"||e.parent.type==="Property"||e.parent.type==="AssignmentExpression");if(!u&&!c){const h={type:"CallExpression",callee:{type:"MemberExpression",object:e.object,property:e.property,computed:!1},arguments:[],_transformed:!1};e.start!==void 0&&(h.start=e.start),e.end!==void 0&&(h.end=e.end),Object.assign(e,h);return}}const r=i.getCurrentScopeType()=="if",n=i.getCurrentScopeType()=="els",s=i.getCurrentScopeType()=="for";if(!r&&!n&&!s&&e.object&&e.object.type==="Identifier"&&i.isContextBound(e.object.name)&&!i.isRootParam(e.object.name)&&!e.computed)return;e._indexTransformed||(Se(e,i),e._indexTransformed=!0);const a=e.object&&e.object.type==="MemberExpression"&&e.object.object&&e.object.object.type==="MemberExpression"&&e.object.object.object&&e.object.object.object.name===W,o=e.object&&e.object.type==="Identifier"&&i.isContextBound(e.object.name);if(e.computed&&(a||o)){if(e.parent&&e.parent.type==="AssignmentExpression"&&e.parent.left===e)return;const u=v.createGetCall(e.object,e.property);e.start&&(u.start=e.start),e.end&&(u.end=e.end),Object.assign(e,u),delete e.object,delete e.property,delete e.computed}}function $e(e,t){if(e.type==="Identifier"){if(e.name==="na")return e.name="NaN",e;if(t.isLoopVariable(e.name))return e;if(t.isRootParam(e.name)){const[n,s]=t.getVariable(e.name);return v.createContextVariableReference(s,n)}if(t.isContextBound(e.name)||t.isLocalSeriesVar(e.name))return e;const[i,r]=t.getVariable(e.name);return i===e.name&&!t.isContextBound(e.name)?e:v.createContextVariableReference(r,i)}return e}function Ne(e,t,i=""){switch(e.type){case"BinaryExpression":return Pi(e,t,i);case"MemberExpression":return{type:"MemberExpression",object:e.object.type==="Identifier"?$e(e.object,t):e.object,property:e.property,computed:e.computed};case"Identifier":{if(t.isLoopVariable(e.name)||e.parent&&e.parent.type==="MemberExpression"&&e.parent.property===e)return e;const r=$e(e,t);return r.type==="Identifier"&&(r.name==="NaN"||r.name==="undefined"||r.name==="Infinity"||r.name==="null"||r.name==="Math")?r:v.createGetCall(r,0)}case"UnaryExpression":return Vi(e,t,i);case"ConditionalExpression":{const r=Ne(e.test,t,i),n=Ne(e.consequent,t,i),s=Ne(e.alternate,t,i);return{type:"ConditionalExpression",test:r,consequent:n,alternate:s,start:e.start,end:e.end}}}return e}function Pi(e,t,i){const r=Ne(e.left,t,i),n=Ne(e.right,t,i),s={type:"BinaryExpression",operator:e.operator,left:r,right:n,start:e.start,end:e.end};return U(s,t,{CallExpression(a,o){a._transformed||le(a,o)},MemberExpression(a){ce(a,"",t)}}),s}function Zr(e,t,i){const r=Ne(e.left,t,i),n=Ne(e.right,t,i),s={type:"LogicalExpression",operator:e.operator,left:r,right:n,start:e.start,end:e.end};return U(s,t,{CallExpression(a,o){a._transformed||le(a,o)}}),s}function Jr(e,t,i){U(e,{parent:e,inNamespaceCall:!1},{Identifier(a,o,u){if(a.name=="NaN")return;if(a.name=="na"){a.name="NaN";return}a.parent=o.parent,J(a,t);const c=a.parent&&a.parent.type==="BinaryExpression";(a.parent&&a.parent.type==="ConditionalExpression"||c)&&(a.type==="MemberExpression"?Se(a,t):a.type==="Identifier"&&(a.parent&&a.parent.type==="CallExpression"&&a.parent.callee&&a.parent.callee.object&&a.parent.callee.object.name===W&&a.parent.callee.property.name==="get"||be(a)))},MemberExpression(a,o,u){Se(a,t),a.object&&u(a.object,{parent:a,inNamespaceCall:o.inNamespaceCall})},ConditionalExpression(a,o,u){const c={...o,parent:a};a.test&&u(a.test,c),a.consequent&&u(a.consequent,c),a.alternate&&u(a.alternate,c)},BinaryExpression(a,o,u){const c={...o,parent:a};u(a.left,c),u(a.right,c)},LogicalExpression(a,o,u){const c={...o,parent:a};u(a.left,c),u(a.right,c)},UnaryExpression(a,o,u){const c={...o,parent:a};u(a.argument,c)},CallExpression(a,o,u){const c=a.callee&&a.callee.type==="MemberExpression"&&a.callee.object&&a.callee.object.type==="Identifier"&&t.isContextBound(a.callee.object.name);le(a,t),a.arguments.forEach(h=>u(h,{parent:a,inNamespaceCall:c||o.inNamespaceCall}))}});const r=v.createMemberExpression(v.createIdentifier(i),v.createIdentifier("param")),n=t.generateParamId(),s={type:"CallExpression",callee:r,arguments:[e,Ct,{type:"Identifier",name:`'${n}'`}],_transformed:!0,_isParamCall:!0};if(!t.shouldSuppressHoisting()){const a=n;t.addLocalSeriesVar(a);const o=v.createVariableDeclaration(a,s);return t.addHoistedStatement(o),v.createIdentifier(a)}return s}function Vi(e,t,i){const r=Ne(e.argument,t,i);return{type:"UnaryExpression",operator:e.operator,prefix:e.prefix,argument:r,start:e.start,end:e.end}}function Ti(e,t,i){switch(e?.type){case"BinaryExpression":e=Pi(e,i,t);break;case"LogicalExpression":e=Zr(e,i,t);break;case"ConditionalExpression":return Jr(e,i,t);case"UnaryExpression":e=Vi(e,i,t);break;case"ArrayExpression":e.elements=e.elements.map(o=>{if(o.type==="Identifier"){if(i.isContextBound(o.name)&&!i.isRootParam(o.name))return o;const[u,c]=i.getVariable(o.name);return v.createContextVariableAccess0(c,u)}return o});break}if(e.type==="MemberExpression"&&e.computed&&e.property){const o=e.object.type==="Identifier"&&i.isContextBound(e.object.name)&&!i.isRootParam(e.object.name)?e.object:$e(e.object,i),u=e.property.type==="Identifier"&&!i.isContextBound(e.property.name)&&!i.isLoopVariable(e.property.name)?$e(e.property,i):e.property,c=v.createMemberExpression(v.createIdentifier(t),v.createIdentifier("param")),h=i.generateParamId(),f={type:"CallExpression",callee:c,arguments:[o,u,{type:"Identifier",name:`'${h}'`}],_transformed:!0,_isParamCall:!0};if(!i.shouldSuppressHoisting()){const d=h;i.addLocalSeriesVar(d);const p=v.createVariableDeclaration(d,f);return i.addHoistedStatement(p),v.createIdentifier(d)}return f}if(e.type==="ObjectExpression"&&(e.properties=e.properties.map(o=>{if(o.value.name){if(i.isContextBound(o.value.name)&&!i.isRootParam(o.value.name))return{type:"Property",key:{type:"Identifier",name:o.key.name},value:v.createIdentifier(o.value.name),kind:"init",method:!1,shorthand:!1,computed:!1};const[u,c]=i.getVariable(o.value.name);return{type:"Property",key:{type:"Identifier",name:o.key.name},value:v.createContextVariableReference(c,u),kind:"init",method:!1,shorthand:!1,computed:!1}}return o})),e.type==="Identifier"){if(e.name==="na")return e.name="NaN",e;if(i.isContextBound(e.name)&&!i.isRootParam(e.name)){const o=v.createMemberExpression(v.createIdentifier(t),v.createIdentifier("param")),u=i.generateParamId(),c={type:"CallExpression",callee:o,arguments:[e,Ct,{type:"Identifier",name:`'${u}'`}],_transformed:!0,_isParamCall:!0};if(!i.shouldSuppressHoisting()){const h=u;i.addLocalSeriesVar(h);const f=v.createVariableDeclaration(h,c);return i.addHoistedStatement(f),v.createIdentifier(h)}return c}}e?.type==="CallExpression"&&le(e,i);const r=v.createMemberExpression(v.createIdentifier(t),v.createIdentifier("param")),n=e.type==="Identifier"?$e(e,i):e,s=i.generateParamId(),a={type:"CallExpression",callee:r,arguments:[n,Ct,{type:"Identifier",name:`'${s}'`}],_transformed:!0,_isParamCall:!0};if(!i.shouldSuppressHoisting()){const o=s;i.addLocalSeriesVar(o);const u=v.createVariableDeclaration(o,a);return i.addHoistedStatement(u),v.createIdentifier(o)}return a}function le(e,t,i){if(e._transformed)return;e.callee&&e.callee.type==="Identifier"&&tt.includes(e.callee.name)&&t.isContextBound(e.callee.name)&&(e.callee=v.createMemberExpression(e.callee,v.createIdentifier("any")));const r=e.callee&&e.callee.type==="MemberExpression"&&e.callee.object&&e.callee.object.type==="Identifier"&&(t.isContextBound(e.callee.object.name)||e.callee.object.name==="math"||e.callee.object.name==="ta");if(r){if(e.callee.object.name===W&&["get","init","param"].includes(e.callee.property.name))return;const n=e.callee.object.name,s=[];if(e.arguments.forEach(a=>{if(a._isParamCall){s.push(a);return}s.push(Ti(a,n,t))}),e.arguments=s,n==="ta"&&e.arguments.push(t.getNextTACallId()),!t.shouldSuppressHoisting()){const a=t.generateTempVar();t.addLocalSeriesVar(a);const o=v.createVariableDeclaration(a,Object.assign({},e));t.addHoistedStatement(o),Object.assign(e,v.createIdentifier(a));return}e._transformed=!0}else e.callee&&e.callee.type==="Identifier"&&(e.arguments=e.arguments.map(n=>n._isParamCall?n:Ti(n,W,t)),e._transformed=!0);!r&&e.callee&&e.callee.type==="MemberExpression"&&e.callee.object.type==="Identifier"&&J(e.callee.object,t),e.arguments.forEach(n=>{U(n,{parent:e},{Identifier(s,a,o){s.parent=a.parent,J(s,t);const u=s.parent&&s.parent.type==="BinaryExpression";(s.parent&&s.parent.type==="ConditionalExpression"||u)&&(s.type==="MemberExpression"?Se(s,t):s.type==="Identifier"&&(s.parent&&s.parent.type==="CallExpression"&&s.parent.callee&&s.parent.callee.object&&s.parent.callee.object.name===W&&s.parent.callee.property.name==="get"||be(s)))},BinaryExpression(s,a,o){const u={...a,parent:s};o(s.left,u),o(s.right,u)},LogicalExpression(s,a,o){const u={...a,parent:s};o(s.left,u),o(s.right,u)},UnaryExpression(s,a,o){const u={...a,parent:s};o(s.argument,u)},CallExpression(s,a,o){s._transformed||le(s,t)},MemberExpression(s,a,o){ce(s,"",t),s.object&&o(s.object,{parent:s})}})})}function Mi(e,t){let i=null;if(e.left.type==="Identifier"){const[r,n]=t.getVariable(e.left.name);i=v.createContextVariableReference(n,r)}else if(e.left.type==="MemberExpression"&&e.left.computed&&e.left.object.type==="Identifier"){const r=e.left.object.name,[n,s]=t.getVariable(r),a=n!==r,o=t.isContextBound(r);(a||o)&&!t.isLoopVariable(r)&&e.left.property.type==="Literal"&&e.left.property.value===0&&(i=v.createContextVariableReference(s,n))}if(U(e.right,{parent:e.right,inNamespaceCall:!1},{Identifier(r,n,s){r.name=="na"&&(r.name="NaN"),r.parent=n.parent,J(r,t);const a=r.parent&&r.parent.type==="BinaryExpression",o=r.parent&&r.parent.type==="ConditionalExpression",u=t.isContextBound(r.name)&&!t.isRootParam(r.name),c=r.parent&&r.parent.type==="MemberExpression"&&r.parent.computed&&r.parent.object===r,h=r.parent&&r.parent._isParamCall,f=r.parent&&r.parent.type==="MemberExpression",d=r.name==="NaN",p=r.parent&&r.parent.type==="CallExpression"&&r.parent.callee&&r.parent.callee.object&&r.parent.callee.object.name===W&&r.parent.callee.property.name==="get";(u||o||a)&&(r.type==="MemberExpression"?Se(r,t):r.type==="Identifier"&&!f&&!c&&!h&&!d&&!p&&be(r))},MemberExpression(r,n,s){ce(r,"",t),r.type==="CallExpression"?r.arguments.forEach(a=>s(a,{parent:r,inNamespaceCall:n.inNamespaceCall})):r.object&&s(r.object,{parent:r,inNamespaceCall:n.inNamespaceCall})},CallExpression(r,n,s){const a=r.callee&&r.callee.type==="MemberExpression"&&r.callee.object&&r.callee.object.type==="Identifier"&&t.isContextBound(r.callee.object.name);le(r,t),r.type==="CallExpression"&&r.arguments.forEach(o=>s(o,{parent:r,inNamespaceCall:a||n.inNamespaceCall}))}}),i){let r=e.right;if(e.operator!=="="){const s=e.operator.replace("=",""),a=v.createGetCall(i,0);r={type:"BinaryExpression",operator:s,left:a,right:e.right,start:e.start,end:e.end}}const n=v.createSetCall(i,r);e.start&&(n.start=e.start),e.end&&(n.end=e.end),Object.assign(e,n)}}function Li(e,t){e.declarations.forEach(i=>{i.init.name=="na"&&(i.init.name="NaN");const r=i.init&&i.init.type==="MemberExpression"&&i.init.object&&(i.init.object.name==="context"||i.init.object.name===W||i.init.object.name==="context2"),n=i.init&&i.init.type==="MemberExpression"&&i.init.object?.object&&(i.init.object.object.name==="context"||i.init.object.object.name===W||i.init.object.object.name==="context2"),s=i.init&&i.init.type==="ArrowFunctionExpression";if(r){i.id.name&&t.addContextBoundVar(i.id.name),i.id.properties&&i.id.properties.forEach(p=>{p.key.name&&t.addContextBoundVar(p.key.name)}),i.init.object.name=W;return}if(n){i.id.name&&t.addContextBoundVar(i.id.name),i.id.properties&&i.id.properties.forEach(p=>{p.key.name&&t.addContextBoundVar(p.key.name)}),i.init.object.object.name=W;return}s&&i.init.params.forEach(p=>{p.type==="Identifier"&&t.addContextBoundVar(p.name)});const a=t.addVariable(i.id.name,e.kind),o=e.kind,u=t.isArrayPatternElement(i.id.name);i.init&&!s&&!u&&(i.init.type==="CallExpression"&&i.init.callee.type==="MemberExpression"&&i.init.callee.object&&i.init.callee.object.type==="Identifier"&&t.isContextBound(i.init.callee.object.name)?le(i.init,t):U(i.init,{parent:i.init},{Identifier(p,g){p.parent=g.parent,J(p,t);const x=p.parent&&p.parent.type==="BinaryExpression",y=p.parent&&p.parent.type==="UnaryExpression",S=p.parent&&p.parent.type==="ConditionalExpression",I=p.parent&&p.parent.type==="CallExpression"&&p.parent.callee&&p.parent.callee.object&&p.parent.callee.object.name===W&&p.parent.callee.property.name==="get";p.type==="Identifier"&&(x||y||S)&&!I&&be(p)},CallExpression(p,g,x){p.callee.type==="Identifier"&&(p.callee.parent=p),p.arguments.forEach(y=>{y.type==="Identifier"&&(y.parent=p)}),le(p,t),p.type==="CallExpression"&&p.arguments.forEach(y=>x(y,{parent:p}))},BinaryExpression(p,g,x){p.left.type==="Identifier"&&(p.left.parent=p),p.right.type==="Identifier"&&(p.right.parent=p),x(p.left,{parent:p}),x(p.right,{parent:p})},MemberExpression(p,g,x){p.object&&p.object.type==="Identifier"&&(p.object.parent=p),p.property&&p.property.type==="Identifier"&&(p.property.parent=p),ce(p,"",t),p.type==="CallExpression"?p.arguments.forEach(y=>x(y,{parent:p})):p.object&&x(p.object,{parent:p})}}));const c=v.createContextVariableReference(o,a),h=!u&&i.init&&i.init.type==="MemberExpression"&&i.init.computed&&i.init.property&&(i.init.property.type==="Literal"||i.init.property.type==="MemberExpression");i.init?.property?.type==="MemberExpression"&&(i.init.property._indexTransformed||(Se(i.init.property,t),i.init.property._indexTransformed=!0));let f;i.init?s||u?f=i.init:o==="var"?f=v.createInitVarCall(c,i.init):f=v.createInitCall(c,h?i.init.object:i.init,h?i.init.property:void 0):f=v.createIdentifier("undefined");const d=v.createExpressionStatement(v.createAssignmentExpression(c,f));if(u){const p=i.init.object.name,[g,x]=t.getVariable(p),y=v.createContextVariableReference(x,g),S=i.init.property.value,I={type:"MemberExpression",object:v.createGetCall(y,0),property:{type:"Literal",value:S},computed:!0};d.expression.right=v.createCallExpression(v.createMemberExpression(v.createContextIdentifier(),v.createIdentifier("init")),[c,I])}s&&(t.pushScope("fn"),U(i.init.body,t,{BlockStatement(p,g,x){p.body.forEach(y=>x(y,g))},IfStatement(p,g,x){g.pushScope("if"),x(p.consequent,g),p.alternate&&(g.pushScope("els"),x(p.alternate,g),g.popScope()),g.popScope()},VariableDeclaration(p,g){Li(p,g)},Identifier(p,g){J(p,g)},AssignmentExpression(p,g){Mi(p,g)}}),t.popScope()),Object.assign(e,d)})}function en(e,t,i){if(t.setSuppressHoisting(!0),e.init&&e.init.type==="VariableDeclaration"){const r=e.init.declarations[0],n=r.id.name;t.addLoopVariable(n,n),e.init={type:"VariableDeclaration",kind:e.init.kind,declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:n},init:r.init}]},r.init&&U(r.init,t,{Identifier(s,a){t.isLoopVariable(s.name)||(t.pushScope("for"),J(s,a),t.popScope())},MemberExpression(s){t.pushScope("for"),ce(s,"",t),t.popScope()}})}e.test&&U(e.test,t,{Identifier(r,n){!t.isLoopVariable(r.name)&&!r.computed&&(t.pushScope("for"),J(r,n),r.type==="Identifier"&&(r.computed=!0,be(r)),t.popScope())},MemberExpression(r){t.pushScope("for"),ce(r,"",t),t.popScope()}}),e.update&&U(e.update,t,{Identifier(r,n){t.isLoopVariable(r.name)||(t.pushScope("for"),J(r,n),t.popScope())}}),t.setSuppressHoisting(!1),t.pushScope("for"),i(e.body,t),t.popScope()}function tn(e,t){U(e,t,{MemberExpression(i){ce(i,"",t)},CallExpression(i,r){le(i,r)},Identifier(i,r){J(i,r);const n=t.getCurrentScopeType()==="if";t.isContextBound(i.name)&&!t.isRootParam(i.name)&&n&&be(i)}})}function rn(e,t,i){e.test&&(t.pushScope("if"),tn(e.test,t),t.popScope()),t.pushScope("if"),i(e.consequent,t),t.popScope(),e.alternate&&(t.pushScope("els"),i(e.alternate,t),t.popScope())}function nn(e,t){const i=t.getCurrentScopeType();if(e.argument&&(e.argument.type==="ArrayExpression"?(e.argument.elements=e.argument.elements.map(r=>{if(r.type==="Identifier"){if(t.isContextBound(r.name)&&!t.isRootParam(r.name))return v.createGetCall(r,0);const[n,s]=t.getVariable(r.name);return v.createContextVariableAccess0(s,n)}else if(r.type==="MemberExpression")return r.object&&r.object.type==="MemberExpression"&&r.object.object&&r.object.object.type==="Identifier"&&r.object.object.name==="$"&&r.object.property&&["const","let","var","params"].includes(r.object.property.name)?v.createGetCall(r,0):(r.computed&&r.object.type==="Identifier"&&t.isContextBound(r.object.name)&&!t.isRootParam(r.object.name)||ce(r,"",t),r);return r}),e.argument={type:"ArrayExpression",elements:[e.argument]}):e.argument.type==="BinaryExpression"?U(e.argument,t,{Identifier(r,n){J(r,n),r.type==="Identifier"&&be(r)},MemberExpression(r){ce(r,"",t)}}):e.argument.type==="ObjectExpression"?e.argument.properties=e.argument.properties.map(r=>{if(r.shorthand){if(t.isContextBound(r.value.name))return r;const[n,s]=t.getVariable(r.value.name);return{type:"Property",key:v.createIdentifier(r.key.name),value:v.createContextVariableReference(s,n),kind:"init",method:!1,shorthand:!1,computed:!1}}if(r.value&&r.value.type==="Identifier"&&!(t.isContextBound(r.value.name)&&!t.isRootParam(r.value.name))&&!t.isContextBound(r.value.name)){const[n,s]=t.getVariable(r.value.name);r.value=v.createContextVariableReference(s,n)}return r}):e.argument.type==="Identifier"&&(J(e.argument,t),e.argument.type==="Identifier"&&be(e.argument)),i==="fn")){e.argument.type==="Identifier"&&t.isContextBound(e.argument.name)&&!t.isRootParam(e.argument.name)?e.argument=v.createArrayAccess(e.argument,0):e.argument.type==="MemberExpression"?e.argument.object.type==="Identifier"&&t.isContextBound(e.argument.object.name)&&!t.isRootParam(e.argument.object.name)&&(e.argument._indexTransformed||(Se(e.argument,t),e.argument._indexTransformed=!0)):(e.argument.type==="BinaryExpression"||e.argument.type==="LogicalExpression"||e.argument.type==="ConditionalExpression"||e.argument.type==="CallExpression")&&U(e.argument,t,{Identifier(n,s){J(n,s),n.type==="Identifier"&&!n._arrayAccessed&&(be(n),n._arrayAccessed=!0)},MemberExpression(n){ce(n,"",t)},CallExpression(n,s){le(n,s)}});const r=v.createCallExpression(v.createMemberExpression(v.createContextIdentifier(),v.createIdentifier("precision")),[e.argument]);e.argument=r}}function sn(e,t,i){e.body&&e.body.type==="BlockStatement"&&(t.pushScope("fn"),i(e.body,t),t.popScope())}function an(e){const t={...b,LineComment:()=>{}};St(e,{BinaryExpression(i){if(i.operator==="=="||i.operator==="==="){const r=i.left,n=i.right,s=v.createMathEqCall(r,n);s._transformed=!0,Object.assign(i,s)}}},t)}function on(e,t,i,r={debug:!1,ln:!1},n=[]){const s=a=>{if(!r.debug||!a.loc||!n.length)return null;const o=a.loc.start.line-1;if(o>=0&&o<n.length){const u=n[o].trim();if(u)return{type:"LineComment",value:`${r.ln?` [Line ${a.loc.start.line}]`:""} ${u}`}}return null};U(e,t,{Program(a,o,u){const c=[];a.body.forEach(h=>{o.enterHoistingScope(),u(h,o);const f=o.exitHoistingScope(),d=s(h);d&&c.push(d),c.push(...f),c.push(h)}),a.body=c},BlockStatement(a,o,u){const c=[];a.body.forEach(h=>{o.enterHoistingScope(),u(h,o);const f=o.exitHoistingScope(),d=s(h);d&&c.push(d),c.push(...f),c.push(h)}),a.body=c},ReturnStatement(a,o){nn(a,o)},VariableDeclaration(a,o){Li(a,o)},Identifier(a,o){J(a,o)},CallExpression(a,o){le(a,o)},MemberExpression(a,o){ce(a,i,o)},AssignmentExpression(a,o){Mi(a,o)},FunctionDeclaration(a,o,u){sn(a,o,u)},ForStatement(a,o,u){en(a,o,u)},IfStatement(a,o,u){rn(a,o,u)}})}function un(e,t={debug:!1,ln:!1}){typeof t=="boolean"&&(t={debug:t,ln:!0});const{debug:i}=t;let r=typeof e=="function"?e.toString():e;r=r.trim(),r=Gr(r);const n=i?r.split(`
34
- `):[],s=vi(r,{ecmaVersion:"latest",sourceType:"module",locations:i});Hr(s),Ur(s),qr(s);const a=new Fr;Kr(s,a);const o=Yr(s,a)||"";on(s,a,o,t,n),an(s);const u=Mr||_t||void 0,c=Object.assign({},u,{LineComment(f,d){d.write("//"+f.value)}}),h=Br(s,{generator:c,comments:i});return new Function("",`var _r = ${h}
35
- ; return _r;`)(this)}function cn(e){return t=>new D(t.array.map(i=>Math.abs(i)),t.type,e)}function ln(e){return t=>{let i=0,r=0;for(const n of t.array){const s=Number(n);isNaN(s)||(r++,i+=(s-i)/r)}return r===0?NaN:e.precision(i)}}function hn(e){return(t,i)=>{const r=t.array;let n=0,s=r.length-1;for(;n<=s;){const a=Math.floor((n+s)/2),o=r[a];if(o===i)return a;o<i?n=a+1:s=a-1}return-1}}function pn(e){return(t,i)=>{const r=t.array;let n=0,s=r.length;for(;n<s;){const a=Math.floor((n+s)/2);r[a]<i?n=a+1:s=a}return n<r.length&&r[n]===i?n:n-1}}function fn(e){return(t,i)=>{const r=t.array;let n=0,s=r.length;for(;n<s;){const a=Math.floor((n+s)/2);r[a]<=i?n=a+1:s=a}return n>0&&r[n-1]===i?n-1:n}}function mn(e){return t=>{t.array.length=0}}function dn(e){return(t,i)=>(t.array.push(...i.array),t)}function gn(e){return t=>new D([...t.array],t.type,e)}function xn(e){return(t,i,r=!0)=>{const n=t.array,s=i.array;if(n.length!==s.length)return NaN;let a=0,o=0,u=0;const c=[];for(let g=0;g<n.length;g++){const x=Number(n[g]),y=Number(s[g]);!isNaN(x)&&x!==null&&x!==void 0&&!isNaN(y)&&y!==null&&y!==void 0&&(a+=x,o+=y,u++,c.push(g))}if(u===0)return NaN;const h=a/u,f=o/u;let d=0;for(const g of c){const x=Number(n[g]),y=Number(s[g]);d+=(x-h)*(y-f)}const p=r?u:u-1;return p<=0?NaN:e.precision(d/p)}}function yn(e){return t=>t.array.every(i=>!isNaN(i)&&i)}function bn(e){if(e.every(t=>typeof t=="number"))return e.every(t=>(t|0)===t)?F.int:F.float;if(e.every(t=>typeof t=="string"))return F.string;if(e.every(t=>typeof t=="boolean"))return F.bool;throw new Error("Cannot infer type from values")}function he(e){if(typeof e=="number")return(e|0)===e?F.int:F.float;if(typeof e=="string")return F.string;if(typeof e=="boolean")return F.bool;throw new Error("Cannot infer type from value")}function We(e,t){switch(t){case F.int:return typeof e=="number"&&(e|0)===e||isNaN(e);case F.float:return typeof e=="number"||isNaN(e);case F.string:return typeof e=="string";case F.bool:return typeof e=="boolean"}return!1}function vn(e){return(t,i,r=0,n)=>{const s=t.array.length,a=n!==void 0?Math.min(n,s):s;for(let o=r;o<a;o++){if(!We(i,t.type))throw new Error(`Cannot call 'array.fill' with argument 'value'='${i}'. An argument of 'literal ${typeof i}' type was used but a '${t.type}' is expected.`);t.array[o]=e.precision(i)}}}function wn(e){return t=>t.array.length>0?t.array[0]:e.NA}function _n(e){return(t,i)=>t.array[i]}function Sn(e){return(t,i)=>t.array.includes(i)}function Nn(e){return(t,i)=>t.array.indexOf(i)}function Cn(e){return(t,i,r)=>{if(!We(r,t.type))throw new Error(`Cannot call 'array.insert' with argument 'value'='${r}'. An argument of 'literal ${typeof r}' type was used but a '${t.type}' is expected.`);t.array.splice(i,0,r)}}function En(e){return(t,i=",")=>t.array.join(i)}function kn(e){return t=>t.array.length>0?t.array[t.array.length-1]:e.NA}function In(e){return(t,i)=>t.array.lastIndexOf(i)}function An(e){return(t,i=0)=>[...t.array].sort((r,n)=>n-r)[i]??e.NA}function Pn(e){return t=>{if(t.array.length===0)return NaN;const i=[...t.array].sort((n,s)=>typeof n=="number"&&typeof s=="number"?n-s:0),r=Math.floor(i.length/2);return i.length%2!==0?i[r]:(i[r-1]+i[r])/2}}function Vn(e){return(t,i=0)=>[...t.array].sort((r,n)=>r-n)[i]??e.NA}function Tn(e){return t=>{if(t.array.length===0)return NaN;const i=new Map;let r=0;for(const s of t.array){const a=(i.get(s)||0)+1;i.set(s,a),a>r&&(r=a)}const n=[];for(const[s,a]of i)a===r&&n.push(s);return n.sort((s,a)=>typeof s=="number"&&typeof a=="number"?s-a:typeof s=="string"&&typeof a=="string"?s<a?-1:s>a?1:0:0),n[0]}}function Mn(e){return(t,i)=>{const r=t.array;if(r.length===0)return NaN;const n=[];for(const u of r){const c=Number(u);if(isNaN(c)||c===null||c===void 0)return NaN;n.push(c)}n.sort((u,c)=>u-c),i<0&&(i=0),i>100&&(i=100);const s=i/100*n.length-.5;if(s<=0)return e.precision(n[0]);if(s>=n.length-1)return e.precision(n[n.length-1]);const a=Math.floor(s),o=s-a;return e.precision(n[a]*(1-o)+n[a+1]*o)}}function Ln(e){return(t,i)=>{const r=t.array;if(r.length===0)return NaN;const n=[];for(const o of r){const u=Number(o);!isNaN(u)&&u!==null&&u!==void 0&&n.push(u)}if(n.length===0)return NaN;n.sort((o,u)=>o-u),i<0&&(i=0),i>100&&(i=100);const s=r.length,a=Math.ceil(i/100*s);return a<=0?n[0]:a>n.length?NaN:n[a-1]}}function Bn(e){return(t,i)=>{if(t.array.length===0)return NaN;const r=Math.floor(i);if(r<0||r>=t.array.length)return NaN;const n=Number(t.array[r]);if(isNaN(n)||n===null||n===void 0)return NaN;let s=0;for(const o of t.array){const u=Number(o);!isNaN(u)&&u!==null&&u!==void 0&&u<n&&s++}const a=t.array.length-1;return a<=0?NaN:s/a*100}}function Rn(e){return t=>t.array.pop()}function Dn(e){return(t,i)=>{if(!We(i,t.type))throw new Error(`Cannot call 'array.push' with argument 'value'='${i}'. An argument of 'literal ${typeof i}' type was used but a '${t.type}' is expected.`);t.array.push(e.precision(i))}}function jn(e){return t=>e.precision(e.pine.array.max(t)-e.pine.array.min(t))}function On(e){return(t,i)=>i>=0&&i<t.array.length?t.array.splice(i,1)[0]:e.NA}function Fn(e){return t=>{t.array.reverse()}}function $n(e){return(t,i,r)=>{if(!We(r,t.type))throw new Error(`Cannot call 'array.set' with argument 'value'='${r}'. An argument of 'literal ${typeof r}' type was used but a '${t.type}' is expected.`);t.array[i]=e.precision(r)}}function Wn(e){return t=>t.array.shift()}function qn(e){return t=>t.array.length}function Un(e){return(t,i,r)=>{const n=r!==void 0?r:void 0;return new D(t.array.slice(i,n),t.type,e)}}function zn(e){return t=>t.array.some(i=>!isNaN(i)&&i)}var Me=(e=>(e[e.ascending=1]="ascending",e[e.descending=0]="descending",e))(Me||{}),Bi=(e=>(e.AED="AED",e.ARS="ARS",e.AUD="AUD",e.BDT="BDT",e.BHD="BHD",e.BRL="BRL",e.BTC="BTC",e.CAD="CAD",e.CHF="CHF",e.CLP="CLP",e.CNY="CNY",e.COP="COP",e.CZK="CZK",e.DKK="DKK",e.EGP="EGP",e.ETH="ETH",e.EUR="EUR",e.GBP="GBP",e.HKD="HKD",e.HUF="HUF",e.IDR="IDR",e.ILS="ILS",e.INR="INR",e.ISK="ISK",e.JPY="JPY",e.KES="KES",e.KRW="KRW",e.KWD="KWD",e.LKR="LKR",e.MAD="MAD",e.MXN="MXN",e.MYR="MYR",e.NGN="NGN",e.NOK="NOK",e.NONE="NONE",e.NZD="NZD",e.PEN="PEN",e.PHP="PHP",e.PKR="PKR",e.PLN="PLN",e.QAR="QAR",e.RON="RON",e.RSD="RSD",e.RUB="RUB",e.SAR="SAR",e.SEK="SEK",e.SGD="SGD",e.THB="THB",e.TND="TND",e.TRY="TRY",e.TWD="TWD",e.USD="USD",e.USDT="USDT",e.VES="VES",e.VND="VND",e.ZAR="ZAR",e))(Bi||{}),Ri=(e=>(e[e.sunday=1]="sunday",e[e.monday=2]="monday",e[e.tuesday=3]="tuesday",e[e.wednesday=4]="wednesday",e[e.thursday=5]="thursday",e[e.friday=6]="friday",e[e.saturday=7]="saturday",e))(Ri||{}),Gn=(e=>(e.all="all",e.data_window="data_window",e.none="none",e.pane="pane",e.pine_screener="pine_screener",e.price_scale="price_scale",e.status_line="status_line",e))(Gn||{});const Hn={order:Me,currency:Bi,dayofweek:Ri};function Kn(e){return(t,i=Me.ascending)=>{t.array.sort((r,n)=>{let s=isNaN(r)?1/0:r,a=isNaN(n)?1/0:n;return i===Me.ascending?s-a:a-s})}}function Qn(e){return(t,i=Me.ascending)=>{const r=t.array.map((n,s)=>s);return r.sort((n,s)=>{const a=isNaN(t.array[n])?1/0:t.array[n],o=isNaN(t.array[s])?1/0:t.array[s];return i===Me.ascending?a-o:o-a}),new D(r,F.int,e)}}function Xn(e){return t=>{const i=e.array.avg(t),r=e.array.stdev(t);return isNaN(r)?new D(t.array.map(()=>NaN),F.int,e):r===0?new D(t.array.map(()=>1),F.int,e):new D(t.array.map(n=>(n-i)/r),F.int,e)}}function Yn(e){return(t,i=!0)=>{const r=t.array,n=r.length;if(n===0)return NaN;let s=0,a=0,o=0;for(let h=0;h<n;h++){const f=Number(r[h]);!isNaN(f)&&f!==null&&f!==void 0&&(s+=f,a+=f*f,o++)}if(o===0)return NaN;const u=s/o;let c=a/o-u*u;return c<0?NaN:(!i&&o>1&&(c=c*o/(o-1)),!i&&o===1?0:e.precision(Math.sqrt(c)))}}function Zn(e){return t=>e.precision(t.array.reduce((i,r)=>{const n=Number(r);return isNaN(n)?i:i+n},0))}function Jn(e){return(t,i)=>{if(!We(i,t.type))throw new Error(`Cannot call 'array.unshift' with argument 'value'='${i}'. An argument of 'literal ${typeof i}' type was used but a '${t.type}' is expected.`);t.array.unshift(e.precision(i))}}function es(e){return(t,i=!0)=>{let r=0,n=0;for(const u of t.array){const c=Number(u);!isNaN(c)&&c!==null&&c!==void 0&&(r+=c,n++)}if(n===0)return NaN;const s=r/n;let a=0;for(const u of t.array){const c=Number(u);!isNaN(c)&&c!==null&&c!==void 0&&(a+=(c-s)*(c-s))}const o=i?n:n-1;return o<=0?NaN:e.precision(a/o)}}var ts=Object.defineProperty,is=(e,t,i)=>t in e?ts(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,V=(e,t,i)=>is(e,typeof t!="symbol"?t+"":t,i),F=(e=>(e.any="",e.box="box",e.bool="bool",e.color="color",e.float="float",e.int="int",e.label="label",e.line="line",e.linefill="linefill",e.string="string",e.table="table",e))(F||{});class D{constructor(t,i,r){this.array=t,this.type=i,this.context=r,V(this,"_abs"),V(this,"_avg"),V(this,"_binary_search"),V(this,"_binary_search_leftmost"),V(this,"_binary_search_rightmost"),V(this,"_clear"),V(this,"_concat"),V(this,"_copy"),V(this,"_covariance"),V(this,"_every"),V(this,"_fill"),V(this,"_first"),V(this,"_get"),V(this,"_includes"),V(this,"_indexof"),V(this,"_insert"),V(this,"_join"),V(this,"_last"),V(this,"_lastindexof"),V(this,"_max"),V(this,"_median"),V(this,"_min"),V(this,"_mode"),V(this,"_percentile_linear_interpolation"),V(this,"_percentile_nearest_rank"),V(this,"_percentrank"),V(this,"_pop"),V(this,"_push"),V(this,"_range"),V(this,"_remove"),V(this,"_reverse"),V(this,"_set"),V(this,"_shift"),V(this,"_size"),V(this,"_slice"),V(this,"_some"),V(this,"_sort"),V(this,"_sort_indices"),V(this,"_standardize"),V(this,"_stdev"),V(this,"_sum"),V(this,"_unshift"),V(this,"_variance"),this._abs=cn(this.context),this._avg=ln(this.context),this._binary_search=hn(this.context),this._binary_search_leftmost=pn(this.context),this._binary_search_rightmost=fn(this.context),this._clear=mn(this.context),this._concat=dn(this.context),this._copy=gn(this.context),this._covariance=xn(this.context),this._every=yn(this.context),this._fill=vn(this.context),this._first=wn(this.context),this._get=_n(this.context),this._includes=Sn(this.context),this._indexof=Nn(this.context),this._insert=Cn(this.context),this._join=En(this.context),this._last=kn(this.context),this._lastindexof=In(this.context),this._max=An(this.context),this._median=Pn(this.context),this._min=Vn(this.context),this._mode=Tn(this.context),this._percentile_linear_interpolation=Mn(this.context),this._percentile_nearest_rank=Ln(this.context),this._percentrank=Bn(this.context),this._pop=Rn(this.context),this._push=Dn(this.context),this._range=jn(this.context),this._remove=On(this.context),this._reverse=Fn(this.context),this._set=$n(this.context),this._shift=Wn(this.context),this._size=qn(this.context),this._slice=Un(this.context),this._some=zn(this.context),this._sort=Kn(this.context),this._sort_indices=Qn(this.context),this._standardize=Xn(this.context),this._stdev=Yn(this.context),this._sum=Zn(this.context),this._unshift=Jn(this.context),this._variance=es(this.context)}toString(){return"["+this.array.toString().replace(/,/g,", ")+"]"}abs(...t){return this._abs(this,...t)}avg(...t){return this._avg(this,...t)}binary_search(...t){return this._binary_search(this,...t)}binary_search_leftmost(...t){return this._binary_search_leftmost(this,...t)}binary_search_rightmost(...t){return this._binary_search_rightmost(this,...t)}clear(...t){return this._clear(this,...t)}concat(...t){return this._concat(this,...t)}copy(...t){return this._copy(this,...t)}covariance(...t){return this._covariance(this,...t)}every(...t){return this._every(this,...t)}fill(...t){return this._fill(this,...t)}first(...t){return this._first(this,...t)}get(...t){return this._get(this,...t)}includes(...t){return this._includes(this,...t)}indexof(...t){return this._indexof(this,...t)}insert(...t){return this._insert(this,...t)}join(...t){return this._join(this,...t)}last(...t){return this._last(this,...t)}lastindexof(...t){return this._lastindexof(this,...t)}max(...t){return this._max(this,...t)}median(...t){return this._median(this,...t)}min(...t){return this._min(this,...t)}mode(...t){return this._mode(this,...t)}percentile_linear_interpolation(...t){return this._percentile_linear_interpolation(this,...t)}percentile_nearest_rank(...t){return this._percentile_nearest_rank(this,...t)}percentrank(...t){return this._percentrank(this,...t)}pop(...t){return this._pop(this,...t)}push(...t){return this._push(this,...t)}range(...t){return this._range(this,...t)}remove(...t){return this._remove(this,...t)}reverse(...t){return this._reverse(this,...t)}set(...t){return this._set(this,...t)}shift(...t){return this._shift(this,...t)}size(...t){return this._size(this,...t)}slice(...t){return this._slice(this,...t)}some(...t){return this._some(this,...t)}sort(...t){return this._sort(this,...t)}sort_indices(...t){return this._sort_indices(this,...t)}standardize(...t){return this._standardize(this,...t)}stdev(...t){return this._stdev(this,...t)}sum(...t){return this._sum(this,...t)}unshift(...t){return this._unshift(this,...t)}variance(...t){return this._variance(this,...t)}}function rs(e){return(...t)=>new D([...t],bn(t),e)}function ns(e){return(t,i)=>new D(Array(t).fill(e.precision(i||0)),he(i||0),e)}function ss(e){return(t,i=!1)=>new D(Array(t).fill(i),F.bool,e)}function as(e){return(t,i=NaN)=>new D(Array(t).fill(e.precision(i)),F.float,e)}function os(e){return(t,i=0)=>new D(Array(t).fill(e.precision(i)),F.int,e)}function us(e){return(t,i="")=>new D(Array(t).fill(i),F.string,e)}class m{constructor(t,i=0){this.data=t,this.offset=i}get(t){const i=this.data.length-1-(this.offset+t);return i<0||i>=this.data.length?NaN:this.data[i]}set(t,i){const r=this.data.length-1-(this.offset+t);r>=0&&r<this.data.length&&(this.data[r]=i)}get length(){return this.data.length}toArray(){return this.data}static from(t){return t instanceof m?t:Array.isArray(t)?new m(t):new m([t])}}function cs(e){return(t,i=0)=>m.from(t).get(i)}class ls{constructor(t){this.context=t,this.abs=(i,...r)=>i.abs(...r),this.avg=(i,...r)=>i.avg(...r),this.binary_search=(i,...r)=>i.binary_search(...r),this.binary_search_leftmost=(i,...r)=>i.binary_search_leftmost(...r),this.binary_search_rightmost=(i,...r)=>i.binary_search_rightmost(...r),this.clear=(i,...r)=>i.clear(...r),this.concat=(i,...r)=>i.concat(...r),this.copy=(i,...r)=>i.copy(...r),this.covariance=(i,...r)=>i.covariance(...r),this.every=(i,...r)=>i.every(...r),this.fill=(i,...r)=>i.fill(...r),this.first=(i,...r)=>i.first(...r),this.from=rs(t),this.get=(i,...r)=>i.get(...r),this.includes=(i,...r)=>i.includes(...r),this.indexof=(i,...r)=>i.indexof(...r),this.insert=(i,...r)=>i.insert(...r),this.join=(i,...r)=>i.join(...r),this.last=(i,...r)=>i.last(...r),this.lastindexof=(i,...r)=>i.lastindexof(...r),this.max=(i,...r)=>i.max(...r),this.median=(i,...r)=>i.median(...r),this.min=(i,...r)=>i.min(...r),this.mode=(i,...r)=>i.mode(...r),this.new=ns(t),this.new_bool=ss(t),this.new_float=as(t),this.new_int=os(t),this.new_string=us(t),this.param=cs(),this.percentile_linear_interpolation=(i,...r)=>i.percentile_linear_interpolation(...r),this.percentile_nearest_rank=(i,...r)=>i.percentile_nearest_rank(...r),this.percentrank=(i,...r)=>i.percentrank(...r),this.pop=(i,...r)=>i.pop(...r),this.push=(i,...r)=>i.push(...r),this.range=(i,...r)=>i.range(...r),this.remove=(i,...r)=>i.remove(...r),this.reverse=(i,...r)=>i.reverse(...r),this.set=(i,...r)=>i.set(...r),this.shift=(i,...r)=>i.shift(...r),this.size=(i,...r)=>i.size(...r),this.slice=(i,...r)=>i.slice(...r),this.some=(i,...r)=>i.some(...r),this.sort=(i,...r)=>i.sort(...r),this.sort_indices=(i,...r)=>i.sort_indices(...r),this.standardize=(i,...r)=>i.standardize(...r),this.stdev=(i,...r)=>i.stdev(...r),this.sum=(i,...r)=>i.sum(...r),this.unshift=(i,...r)=>i.unshift(...r),this.variance=(i,...r)=>i.variance(...r)}}function hs(e){return t=>{t.map.clear()}}function ps(e){return(t,i)=>t.map.has(i)}function fs(e){return t=>{const i=new Di(e);return i.map=new Map(t.map),i}}function ms(e){return(t,i)=>{const r=t.map.get(i);return r===void 0?NaN:r}}function ds(e){return t=>{const i=Array.from(t.map.keys()),r=he(i[0]);return new D(i,r,e)}}function gs(e){return(t,i,r)=>{const n=t.map.get(i);return t.map.set(i,r),n===void 0?NaN:n}}function xs(e){return(t,i)=>{for(const[r,n]of i.map)t.map.set(r,n)}}function ys(e){return(t,i)=>{const r=t.map.get(i);return t.map.delete(i)?r:NaN}}function bs(e){return t=>t.map.size}function vs(e){return t=>{const i=Array.from(t.map.values()),r=he(i[0]);return new D(i,r,e)}}var ws=Object.defineProperty,_s=(e,t,i)=>t in e?ws(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,pe=(e,t,i)=>_s(e,typeof t!="symbol"?t+"":t,i);class Di{constructor(t){this.context=t,pe(this,"map"),pe(this,"_clear"),pe(this,"_contains"),pe(this,"_copy"),pe(this,"_get"),pe(this,"_keys"),pe(this,"_put"),pe(this,"_put_all"),pe(this,"_remove"),pe(this,"_size"),pe(this,"_values"),this.map=new Map,this._clear=hs(this.context),this._contains=ps(this.context),this._copy=fs(this.context),this._get=ms(this.context),this._keys=ds(this.context),this._put=gs(this.context),this._put_all=xs(this.context),this._remove=ys(this.context),this._size=bs(this.context),this._values=vs(this.context)}toString(){return`PineMapObject(${this.map.size})`}clear(...t){return this._clear(this,...t)}contains(...t){return this._contains(this,...t)}copy(...t){return this._copy(this,...t)}get(...t){return this._get(this,...t)}keys(...t){return this._keys(this,...t)}put(...t){return this._put(this,...t)}put_all(...t){return this._put_all(this,...t)}remove(...t){return this._remove(this,...t)}size(...t){return this._size(this,...t)}values(...t){return this._values(this,...t)}}function Ss(e){return()=>new Di(e)}function Ns(e){return(t,i=0)=>m.from(t).get(i)}class Cs{constructor(t){this.context=t,this.clear=(i,...r)=>i.clear(...r),this.contains=(i,...r)=>i.contains(...r),this.copy=(i,...r)=>i.copy(...r),this.get=(i,...r)=>i.get(...r),this.keys=(i,...r)=>i.keys(...r),this.new=Ss(t),this.param=Ns(),this.put=(i,...r)=>i.put(...r),this.put_all=(i,...r)=>i.put_all(...r),this.remove=(i,...r)=>i.remove(...r),this.size=(i,...r)=>i.size(...r),this.values=(i,...r)=>i.values(...r)}}function Es(e){return(t,i,r)=>{const n=t.matrix.length;let s=[];if(r&&(r instanceof D?s=r.array:Array.isArray(r)?s=r:s=[r]),n===0){for(let u=0;u<s.length;u++){let c=s[u];c instanceof m&&(c=c.get(0)),t.matrix.push([c])}return}const a=t.matrix[0].length,o=i!==void 0?i:a;for(let u=0;u<n;u++){let c=u<s.length?s[u]:NaN;c instanceof m&&(c=c.get(0)),t.matrix[u].splice(o,0,c)}}}function ks(e){return(t,i,r)=>{const n=t.matrix.length;let s=[];if(r)if(r instanceof D)s=r.array;else if(Array.isArray(r))s=r;else if(r instanceof m){const c=r.get(0);Array.isArray(c)?s=c:s=[c]}else s=[r];const a=n>0?t.matrix[0].length:s.length,o=i!==void 0?i:n,u=[];for(let c=0;c<a;c++)if(c<s.length){let h=s[c];h instanceof m&&(h=h.get(0)),u.push(h)}else u.push(NaN);t.matrix.splice(o,0,u)}}function Is(e){return t=>{const i=t.matrix.length;if(i===0)return NaN;const r=t.matrix[0].length;if(r===0)return NaN;let n=0,s=0;for(let a=0;a<i;a++)for(let o=0;o<r;o++){const u=t.matrix[a][o];isNaN(u)||(n+=u,s++)}return s===0?NaN:n/s}}function As(e){return(t,i)=>{const r=t.matrix.length,n=[];for(let a=0;a<r;a++)n.push(t.matrix[a][i]);const s=he(n[0]);return new D(n,s,e)}}function Ps(e){return t=>t.matrix.length===0?0:t.matrix[0].length}function Vs(e){return(t,i)=>{const r=t.matrix.length,n=i.matrix.length;if(r===0){for(let o=0;o<n;o++)t.matrix.push([...i.matrix[o]]);return}const s=t.matrix[0].length,a=n>0?i.matrix[0].length:0;if(s!==a&&n>0){console.error(`matrix.concat: Column count mismatch ${s} vs ${a}`);return}for(let o=0;o<n;o++)t.matrix.push([...i.matrix[o]])}}function Ts(e){return t=>{const i=t.matrix.length,r=i>0?t.matrix[0].length:0,n=new B(i,r,NaN,e);return n.matrix=t.matrix.map(s=>[...s]),n}}function Ms(e){const t=e.length;if(t===0)return 0;if(t===1)return e[0][0];if(t===2)return e[0][0]*e[1][1]-e[0][1]*e[1][0];const i=e.map(n=>[...n]);let r=1;for(let n=0;n<t;n++){let s=n;for(;s<t&&i[s][n]===0;)s++;if(s===t)return 0;s!==n&&([i[n],i[s]]=[i[s],i[n]],r*=-1),r*=i[n][n];for(let a=n+1;a<t;a++){const o=i[a][n]/i[n][n];for(let u=n;u<t;u++)i[a][u]-=o*i[n][u]}}return r}function Ls(e){return t=>{const i=t.matrix.length,r=i>0?t.matrix[0].length:0;return i!==r?NaN:Ms(t.matrix)}}function Bs(e){return(t,i)=>{const r=t.matrix.length;if(r===0)return new B(0,0,NaN,e);const n=t.matrix[0].length,s=new B(r,n,NaN,e);if(i instanceof B)for(let a=0;a<r;a++)for(let o=0;o<n;o++){const u=t.matrix[a][o],c=i.matrix[a]&&i.matrix[a][o]!==void 0?i.matrix[a][o]:NaN;s.matrix[a][o]=u-c}else{const a=i;for(let o=0;o<r;o++)for(let u=0;u<n;u++)s.matrix[o][u]=t.matrix[o][u]-a}return s}}function Rs(e){const t=e.length;if(t!==2)return Array(t).fill(NaN);const i=e[0][0],r=e[0][1],n=e[1][0],s=e[1][1],a=i+s,o=i*s-r*n,u=a*a-4*o;if(u<0)return[NaN,NaN];const c=(a+Math.sqrt(u))/2,h=(a-Math.sqrt(u))/2;return[c,h]}function Ds(e){return t=>{const i=t.matrix.length,r=i>0?t.matrix[0].length:0;if(i!==r){const a=he(t.matrix[0][0]);return new D([],a,e)}const n=Rs(t.matrix),s=he(n[0]);return new D(n,s,e)}}function js(e){return t=>{const i=t.matrix.length,r=i>0?t.matrix[0].length:0;if(i!==r)return new B(0,0,NaN,e);const n=new B(i,r,0,e);for(let s=0;s<i;s++)n.matrix[s][s]=1;return n}}function Os(e){return t=>{const i=t.matrix.length;return i===0?0:i*t.matrix[0].length}}function Fs(e){return(t,i,r,n,s,a)=>{const o=t.matrix.length;if(o===0)return;const u=t.matrix[0].length,c=r!==void 0?r:0,h=n!==void 0?n:o,f=s!==void 0?s:0,d=a!==void 0?a:u;for(let p=c;p<h&&!(p>=o);p++)for(let g=f;g<d&&!(g>=u);g++)t.matrix[p][g]=i}}function $s(e){return(t,i,r)=>{if(!t.matrix[i])return NaN;const n=t.matrix[i][r];return n===void 0?NaN:n}}function Ws(e){if(e.length!==2)return e.map(i=>i.map(()=>NaN));const t=e[0][0]*e[1][1]-e[0][1]*e[1][0];return t===0?[[NaN,NaN],[NaN,NaN]]:[[e[1][1]/t,-e[0][1]/t],[-e[1][0]/t,e[0][0]/t]]}function qs(e){return t=>{const i=t.matrix.length,r=i>0?t.matrix[0].length:0;if(i!==r)return new B(i,r,NaN,e);const n=Ws(t.matrix),s=new B(i,r,NaN,e);return s.matrix=n,s}}function Us(e){return t=>{const i=t.matrix.length;if(i===0)return!1;const r=t.matrix[0].length;if(i!==r)return!1;for(let n=0;n<i;n++)for(let s=0;s<r;s++)if(n+s!==i-1&&t.matrix[n][s]!==0)return!1;return!0}}function zs(e){return t=>{const i=t.matrix.length;if(i===0)return!1;const r=t.matrix[0].length;if(i!==r)return!1;for(let n=0;n<i;n++)for(let s=0;s<r;s++)if(t.matrix[s][n]!==-t.matrix[n][s])return!1;return!0}}function Gs(e){return t=>{const i=t.matrix.length;if(i===0)return!1;const r=t.matrix[0].length;for(let n=0;n<i;n++)for(let s=0;s<r;s++){const a=t.matrix[n][s];if(a!==0&&a!==1)return!1}return!0}}function Hs(e){return t=>{const i=t.matrix.length;if(i===0)return!1;const r=t.matrix[0].length;if(i!==r)return!1;for(let n=0;n<i;n++)for(let s=0;s<r;s++)if(n!==s&&t.matrix[n][s]!==0)return!1;return!0}}function Ks(e){return t=>{const i=t.matrix.length;if(i===0)return!1;const r=t.matrix[0].length;if(i!==r)return!1;for(let n=0;n<i;n++)for(let s=0;s<r;s++)if(n===s){if(t.matrix[n][s]!==1)return!1}else if(t.matrix[n][s]!==0)return!1;return!0}}function Qs(e){return t=>{const i=t.matrix.length;if(i===0)return!1;const r=t.matrix[0].length;return i===r}}function Xs(e){return t=>{const i=t.matrix.length;if(i===0)return!1;const r=t.matrix[0].length;for(let n=0;n<i;n++){let s=0;for(let a=0;a<r;a++){const o=t.matrix[n][a];if(o<0)return!1;s+=o}if(Math.abs(s-1)>1e-10)return!1}return!0}}function Ys(e){return t=>{const i=t.matrix.length;if(i===0)return!1;const r=t.matrix[0].length;if(i!==r)return!1;for(let n=0;n<i;n++)for(let s=0;s<n;s++)if(t.matrix[n][s]!==t.matrix[s][n])return!1;return!0}}function Zs(e){return t=>{const i=t.matrix.length;if(i===0)return!1;const r=t.matrix[0].length;if(i!==r)return!1;let n=!0,s=!0;for(let a=0;a<i;a++)for(let o=0;o<r;o++)a>o&&t.matrix[a][o]!==0&&(n=!1),a<o&&t.matrix[a][o]!==0&&(s=!1);return n||s}}function Js(e){return t=>{const i=t.matrix.length;if(i===0)return!0;const r=t.matrix[0].length;for(let n=0;n<i;n++)for(let s=0;s<r;s++)if(t.matrix[n][s]!==0)return!1;return!0}}function ea(e){return(t,i)=>{const r=t.matrix.length,n=r>0?t.matrix[0].length:0,s=i.matrix.length,a=s>0?i.matrix[0].length:0,o=r*s,u=n*a,c=new B(o,u,NaN,e);for(let h=0;h<r;h++)for(let f=0;f<n;f++){const d=t.matrix[h][f];for(let p=0;p<s;p++)for(let g=0;g<a;g++){const x=i.matrix[p][g];c.matrix[h*s+p][f*a+g]=d*x}}return c}}function ta(e){return t=>{const i=t.matrix.length;if(i===0)return NaN;const r=t.matrix[0].length;let n=-1/0,s=!1;for(let a=0;a<i;a++)for(let o=0;o<r;o++){const u=t.matrix[a][o];isNaN(u)||(u>n&&(n=u),s=!0)}return s?n:NaN}}function ia(e){return t=>{const i=t.matrix.length;if(i===0)return NaN;const r=t.matrix[0].length,n=[];for(let a=0;a<i;a++)for(let o=0;o<r;o++){const u=t.matrix[a][o];isNaN(u)||n.push(u)}if(n.length===0)return NaN;n.sort((a,o)=>a-o);const s=Math.floor(n.length/2);return n.length%2!==0?n[s]:(n[s-1]+n[s])/2}}function ra(e){return t=>{const i=t.matrix.length;if(i===0)return NaN;const r=t.matrix[0].length;let n=1/0,s=!1;for(let a=0;a<i;a++)for(let o=0;o<r;o++){const u=t.matrix[a][o];isNaN(u)||(u<n&&(n=u),s=!0)}return s?n:NaN}}function na(e){return t=>{const i=t.matrix.length;if(i===0)return NaN;const r=t.matrix[0].length,n=new Map;let s=0,a=NaN;for(let o=0;o<i;o++)for(let u=0;u<r;u++){const c=t.matrix[o][u];if(!isNaN(c)){const h=(n.get(c)||0)+1;n.set(c,h),h>s?(s=h,a=c):h===s&&c<a&&(a=c)}}return a}}function sa(e){return(t,i)=>{const r=t.matrix.length,n=r>0?t.matrix[0].length:0;if(i instanceof B){const s=i.matrix.length,a=s>0?i.matrix[0].length:0;if(n!==s)return new B(0,0,NaN,e);const o=new B(r,a,0,e);for(let u=0;u<r;u++)for(let c=0;c<a;c++){let h=0;for(let f=0;f<n;f++)h+=t.matrix[u][f]*i.matrix[f][c];o.matrix[u][c]=h}return o}else if(i instanceof D||Array.isArray(i.array||i)){const s=i.array||i;if(n!==s.length)return new B(0,0,NaN,e);const a=new B(r,1,0,e);for(let o=0;o<r;o++){let u=0;for(let c=0;c<n;c++)u+=t.matrix[o][c]*s[c];a.matrix[o][0]=u}return a}else{const s=i,a=new B(r,n,NaN,e);for(let o=0;o<r;o++)for(let u=0;u<n;u++)a.matrix[o][u]=t.matrix[o][u]*s;return a}}}function aa(e){return t=>{const i=t.matrix.length,r=i>0?t.matrix[0].length:0;return i===r?new B(i,r,NaN,e):new B(r,i,NaN,e)}}function oa(e){return(t,i)=>{const r=t.matrix.length,n=r>0?t.matrix[0].length:0;if(r!==n)return new B(0,0,NaN,e);let s=new B(r,n,0,e);for(let u=0;u<r;u++)s.matrix[u][u]=1;let a=new B(r,n,NaN,e);for(let u=0;u<r;u++)a.matrix[u]=[...t.matrix[u]];let o=Math.floor(i);if(o<0)return new B(r,n,NaN,e);for(;o>0;){if(o%2===1){const c=new B(r,n,0,e);for(let h=0;h<r;h++)for(let f=0;f<n;f++){let d=0;for(let p=0;p<r;p++)d+=s.matrix[h][p]*a.matrix[p][f];c.matrix[h][f]=d}s=c}const u=new B(r,n,0,e);for(let c=0;c<r;c++)for(let h=0;h<n;h++){let f=0;for(let d=0;d<r;d++)f+=a.matrix[c][d]*a.matrix[d][h];u.matrix[c][h]=f}a=u,o=Math.floor(o/2)}return s}}function ua(e){return t=>{const i=t.matrix.length;if(i===0)return 0;const r=t.matrix[0].length,n=t.matrix.map(a=>[...a]);let s=0;for(let a=0;a<r&&s<i;a++){let o=s;for(;o<i&&Math.abs(n[o][a])<1e-10;)o++;if(o<i){[n[s],n[o]]=[n[o],n[s]];const u=n[s][a];for(let c=a;c<r;c++)n[s][c]/=u;for(let c=0;c<i;c++)if(c!==s){const h=n[c][a];for(let f=a;f<r;f++)n[c][f]-=h*n[s][f]}s++}}return s}}function ca(e){return(t,i)=>{const r=t.matrix.length;if(r===0){const a=he(t.matrix[0][0]);return new D([],a,e)}const n=[];for(let a=0;a<r;a++){const o=t.matrix[a].splice(i,1);n.push(o[0])}const s=he(n[0]);return new D(n,s,e)}}function la(e){return(t,i)=>{const r=t.matrix.splice(i,1),n=he(r[0][0]);return new D(r[0]||[],n,e)}}function ha(e){return(t,i,r)=>{const n=t.matrix.length,s=n>0?t.matrix[0].length:0,a=i*r,o=[];for(let h=0;h<n;h++)for(let f=0;f<s;f++)o.push(t.matrix[h][f]);for(;o.length<a;)o.push(NaN);o.length>a&&(o.length=a);const u=[];let c=0;for(let h=0;h<i;h++){const f=[];for(let d=0;d<r;d++)f.push(o[c++]);u.push(f)}t.matrix=u}}function pa(e){return t=>{t.matrix.reverse();for(const i of t.matrix)i.reverse()}}function fa(e){return(t,i)=>{if(!t.matrix[i]){const n=he(t.matrix[0][0]);return new D([],n,e)}const r=he(t.matrix[i][0]);return new D([...t.matrix[i]],r,e)}}function ma(e){return t=>t.matrix.length}function da(e){return(t,i,r,n)=>{t.matrix[i]&&(t.matrix[i][r]=n)}}function ga(e){return(t,i=0,r="asc")=>{t.matrix.length!==0&&t.matrix.sort((n,s)=>{const a=n[i],o=s[i];return a<o?r==="asc"?-1:1:a>o?r==="asc"?1:-1:0})}}function xa(e){return(t,i,r,n,s)=>{const a=r-i,o=s-n,u=new B(a,o,NaN,e);for(let c=0;c<a;c++){const h=i+c;if(h>=t.matrix.length)break;for(let f=0;f<o;f++){const d=n+f;if(d>=t.matrix[h].length)break;u.matrix[c][f]=t.matrix[h][d]}}return u}}function ya(e){return(t,i)=>{const r=t.matrix.length;if(r===0)return new B(0,0,NaN,e);const n=t.matrix[0].length,s=new B(r,n,NaN,e);if(i instanceof B)for(let a=0;a<r;a++)for(let o=0;o<n;o++){const u=t.matrix[a][o],c=i.matrix[a]&&i.matrix[a][o]!==void 0?i.matrix[a][o]:NaN;s.matrix[a][o]=u+c}else{const a=i;for(let o=0;o<r;o++)for(let u=0;u<n;u++)s.matrix[o][u]=t.matrix[o][u]+a}return s}}function ba(e){return(t,i,r)=>{const n=t.matrix.length;for(let s=0;s<n;s++){const a=t.matrix[s][i];t.matrix[s][i]=t.matrix[s][r],t.matrix[s][r]=a}}}function va(e){return(t,i,r)=>{const n=t.matrix[i];t.matrix[i]=t.matrix[r],t.matrix[r]=n}}function wa(e){return t=>{const i=t.matrix.length;if(i===0)return 0;const r=t.matrix[0].length,n=Math.min(i,r);let s=0;for(let a=0;a<n;a++)s+=t.matrix[a][a];return s}}function _a(e){return t=>{const i=t.matrix.length;if(i===0)return new B(0,0,NaN,e);const r=t.matrix[0].length,n=new B(r,i,NaN,e);for(let s=0;s<i;s++)for(let a=0;a<r;a++)n.matrix[a][s]=t.matrix[s][a];return n}}var Sa=Object.defineProperty,Na=(e,t,i)=>t in e?Sa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,k=(e,t,i)=>Na(e,typeof t!="symbol"?t+"":t,i);class B{constructor(t=0,i=0,r=NaN,n){if(this.context=n,k(this,"matrix"),k(this,"_add_col"),k(this,"_add_row"),k(this,"_avg"),k(this,"_col"),k(this,"_columns"),k(this,"_concat"),k(this,"_copy"),k(this,"_det"),k(this,"_diff"),k(this,"_eigenvalues"),k(this,"_eigenvectors"),k(this,"_elements_count"),k(this,"_fill"),k(this,"_get"),k(this,"_inv"),k(this,"_is_antidiagonal"),k(this,"_is_antisymmetric"),k(this,"_is_binary"),k(this,"_is_diagonal"),k(this,"_is_identity"),k(this,"_is_square"),k(this,"_is_stochastic"),k(this,"_is_symmetric"),k(this,"_is_triangular"),k(this,"_is_zero"),k(this,"_kron"),k(this,"_max"),k(this,"_median"),k(this,"_min"),k(this,"_mode"),k(this,"_mult"),k(this,"_pinv"),k(this,"_pow"),k(this,"_rank"),k(this,"_remove_col"),k(this,"_remove_row"),k(this,"_reshape"),k(this,"_reverse"),k(this,"_row"),k(this,"_rows"),k(this,"_set"),k(this,"_sort"),k(this,"_submatrix"),k(this,"_sum"),k(this,"_swap_columns"),k(this,"_swap_rows"),k(this,"_trace"),k(this,"_transpose"),this.matrix=[],t>0&&i>0)for(let s=0;s<t;s++)this.matrix.push(Array(i).fill(r));this._add_col=Es(this.context),this._add_row=ks(this.context),this._avg=Is(this.context),this._col=As(this.context),this._columns=Ps(this.context),this._concat=Vs(this.context),this._copy=Ts(this.context),this._det=Ls(this.context),this._diff=Bs(this.context),this._eigenvalues=Ds(this.context),this._eigenvectors=js(this.context),this._elements_count=Os(this.context),this._fill=Fs(this.context),this._get=$s(this.context),this._inv=qs(this.context),this._is_antidiagonal=Us(this.context),this._is_antisymmetric=zs(this.context),this._is_binary=Gs(this.context),this._is_diagonal=Hs(this.context),this._is_identity=Ks(this.context),this._is_square=Qs(this.context),this._is_stochastic=Xs(this.context),this._is_symmetric=Ys(this.context),this._is_triangular=Zs(this.context),this._is_zero=Js(this.context),this._kron=ea(this.context),this._max=ta(this.context),this._median=ia(this.context),this._min=ra(this.context),this._mode=na(this.context),this._mult=sa(this.context),this._pinv=aa(this.context),this._pow=oa(this.context),this._rank=ua(this.context),this._remove_col=ca(this.context),this._remove_row=la(this.context),this._reshape=ha(this.context),this._reverse=pa(this.context),this._row=fa(this.context),this._rows=ma(this.context),this._set=da(this.context),this._sort=ga(this.context),this._submatrix=xa(this.context),this._sum=ya(this.context),this._swap_columns=ba(this.context),this._swap_rows=va(this.context),this._trace=wa(this.context),this._transpose=_a(this.context)}toString(){let t="";for(let i=0;i<this.matrix.length;i++)t+=t===""?"":`
36
- `,t+="["+this.matrix[i].join(", ")+"]";return t}add_col(...t){return this._add_col(this,...t)}add_row(...t){return this._add_row(this,...t)}avg(...t){return this._avg(this,...t)}col(...t){return this._col(this,...t)}columns(...t){return this._columns(this,...t)}concat(...t){return this._concat(this,...t)}copy(...t){return this._copy(this,...t)}det(...t){return this._det(this,...t)}diff(...t){return this._diff(this,...t)}eigenvalues(...t){return this._eigenvalues(this,...t)}eigenvectors(...t){return this._eigenvectors(this,...t)}elements_count(...t){return this._elements_count(this,...t)}fill(...t){return this._fill(this,...t)}get(...t){return this._get(this,...t)}inv(...t){return this._inv(this,...t)}is_antidiagonal(...t){return this._is_antidiagonal(this,...t)}is_antisymmetric(...t){return this._is_antisymmetric(this,...t)}is_binary(...t){return this._is_binary(this,...t)}is_diagonal(...t){return this._is_diagonal(this,...t)}is_identity(...t){return this._is_identity(this,...t)}is_square(...t){return this._is_square(this,...t)}is_stochastic(...t){return this._is_stochastic(this,...t)}is_symmetric(...t){return this._is_symmetric(this,...t)}is_triangular(...t){return this._is_triangular(this,...t)}is_zero(...t){return this._is_zero(this,...t)}kron(...t){return this._kron(this,...t)}max(...t){return this._max(this,...t)}median(...t){return this._median(this,...t)}min(...t){return this._min(this,...t)}mode(...t){return this._mode(this,...t)}mult(...t){return this._mult(this,...t)}pinv(...t){return this._pinv(this,...t)}pow(...t){return this._pow(this,...t)}rank(...t){return this._rank(this,...t)}remove_col(...t){return this._remove_col(this,...t)}remove_row(...t){return this._remove_row(this,...t)}reshape(...t){return this._reshape(this,...t)}reverse(...t){return this._reverse(this,...t)}row(...t){return this._row(this,...t)}rows(...t){return this._rows(this,...t)}set(...t){return this._set(this,...t)}sort(...t){return this._sort(this,...t)}submatrix(...t){return this._submatrix(this,...t)}sum(...t){return this._sum(this,...t)}swap_columns(...t){return this._swap_columns(this,...t)}swap_rows(...t){return this._swap_rows(this,...t)}trace(...t){return this._trace(this,...t)}transpose(...t){return this._transpose(this,...t)}}function Ca(e){return(t,i,r)=>new B(t,i,r,e)}function Ea(e){return(t,i=0)=>m.from(t).get(i)}class ka{constructor(t){this.context=t,this.add_col=(i,...r)=>i.add_col(...r),this.add_row=(i,...r)=>i.add_row(...r),this.avg=(i,...r)=>i.avg(...r),this.col=(i,...r)=>i.col(...r),this.columns=(i,...r)=>i.columns(...r),this.concat=(i,...r)=>i.concat(...r),this.copy=(i,...r)=>i.copy(...r),this.det=(i,...r)=>i.det(...r),this.diff=(i,...r)=>i.diff(...r),this.eigenvalues=(i,...r)=>i.eigenvalues(...r),this.eigenvectors=(i,...r)=>i.eigenvectors(...r),this.elements_count=(i,...r)=>i.elements_count(...r),this.fill=(i,...r)=>i.fill(...r),this.get=(i,...r)=>i.get(...r),this.inv=(i,...r)=>i.inv(...r),this.is_antidiagonal=(i,...r)=>i.is_antidiagonal(...r),this.is_antisymmetric=(i,...r)=>i.is_antisymmetric(...r),this.is_binary=(i,...r)=>i.is_binary(...r),this.is_diagonal=(i,...r)=>i.is_diagonal(...r),this.is_identity=(i,...r)=>i.is_identity(...r),this.is_square=(i,...r)=>i.is_square(...r),this.is_stochastic=(i,...r)=>i.is_stochastic(...r),this.is_symmetric=(i,...r)=>i.is_symmetric(...r),this.is_triangular=(i,...r)=>i.is_triangular(...r),this.is_zero=(i,...r)=>i.is_zero(...r),this.kron=(i,...r)=>i.kron(...r),this.max=(i,...r)=>i.max(...r),this.median=(i,...r)=>i.median(...r),this.min=(i,...r)=>i.min(...r),this.mode=(i,...r)=>i.mode(...r),this.mult=(i,...r)=>i.mult(...r),this.new=Ca(t),this.param=Ea(),this.pinv=(i,...r)=>i.pinv(...r),this.pow=(i,...r)=>i.pow(...r),this.rank=(i,...r)=>i.rank(...r),this.remove_col=(i,...r)=>i.remove_col(...r),this.remove_row=(i,...r)=>i.remove_row(...r),this.reshape=(i,...r)=>i.reshape(...r),this.reverse=(i,...r)=>i.reverse(...r),this.row=(i,...r)=>i.row(...r),this.rows=(i,...r)=>i.rows(...r),this.set=(i,...r)=>i.set(...r),this.sort=(i,...r)=>i.sort(...r),this.submatrix=(i,...r)=>i.submatrix(...r),this.sum=(i,...r)=>i.sum(...r),this.swap_columns=(i,...r)=>i.swap_columns(...r),this.swap_rows=(i,...r)=>i.swap_rows(...r),this.trace=(i,...r)=>i.trace(...r),this.transpose=(i,...r)=>i.transpose(...r)}}var Ia=Object.defineProperty,Aa=(e,t,i)=>t in e?Ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Pa=(e,t,i)=>Aa(e,typeof t!="symbol"?t+"":t,i);class Va{constructor(t){this.context=t,Pa(this,"_live",!1)}setLive(){this._live=!0}get isnew(){return!this._live}get islast(){return this.context.idx===this.context.data.close.data.length-1}get isfirst(){return this.context.idx===0}get ishistory(){return this.context.idx<this.context.data.close.data.length-1}get isrealtime(){return this.context.idx===this.context.data.close.data.length-1}get isconfirmed(){return this.context.data.closeTime[this.context.data.closeTime.length-1]<=new Date().getTime()}get islastconfirmedhistory(){return this.context.data.closeTime[this.context.data.closeTime.length-1]<=new Date().getTime()}}var Ta=Object.defineProperty,Ma=(e,t,i)=>t in e?Ta(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,La=(e,t,i)=>Ma(e,typeof t!="symbol"?t+"":t,i);class Ba{constructor(t){this.context=t,La(this,"color",{param:(i,r=0)=>m.from(i).get(r),rgb:(i,r,n,s)=>s?`rgba(${i}, ${r}, ${n}, ${s})`:`rgb(${i}, ${r}, ${n})`,new:(i,r)=>{if(i&&i.startsWith("#")){const n=i.slice(1),s=parseInt(n.slice(0,2),16),a=parseInt(n.slice(2,4),16),o=parseInt(n.slice(4,6),16);return r?`rgba(${s}, ${a}, ${o}, ${r})`:`rgb(${s}, ${a}, ${o})`}return r?`rgba(${i}, ${r})`:i},white:"white",lime:"lime",green:"green",red:"red",maroon:"maroon",black:"black",gray:"gray",blue:"blue",yellow:"yellow",orange:"orange",purple:"purple",pink:"pink",brown:"brown",teal:"teal",cyan:"cyan",navy:"navy",indigo:"indigo",violet:"violet",magenta:"magenta",rose:"rose",gold:"gold",silver:"silver",bronze:"bronze"})}extractPlotOptions(t){const i={};for(let r in t)i[r]=m.from(t[r]).get(0);return i}indicator(t,i,r){}plotchar(t,i,r){this.context.plots[i]||(this.context.plots[i]={data:[],options:this.extractPlotOptions(r),title:i});const n=m.from(t).get(0);this.context.plots[i].data.push({time:this.context.marketData[this.context.idx].openTime,value:n,options:{...this.extractPlotOptions(r),style:"char"}})}plot(t,i,r){this.context.plots[i]||(this.context.plots[i]={data:[],options:this.extractPlotOptions(r),title:i});const n=m.from(t).get(0);this.context.plots[i].data.push({time:this.context.marketData[this.context.idx].openTime,value:n,options:this.extractPlotOptions(r)})}get bar_index(){return this.context.idx}na(t){return isNaN(m.from(t).get(0))}nz(t,i=0){const r=m.from(t).get(0),n=m.from(i).get(0);return isNaN(r)?n:r}}const ji=[["defval","title","tooltip","inline","group","display"],["defval","title","tooltip","group","confirm","display"],["defval","title","tooltip","inline","group","confirm","display"],["defval","title","options","tooltip","inline","group","confirm","display"],["defval","title","minval","maxval","step","tooltip","inline","group","confirm","display"]],Ra={defval:e=>typeof e!="object",title:e=>typeof e=="string",tooltip:e=>typeof e=="string",inline:e=>typeof e=="string",group:e=>typeof e=="string",display:e=>typeof e=="string",confirm:e=>typeof e=="boolean",options:e=>Array.isArray(e),minval:e=>typeof e=="number",maxval:e=>typeof e=="number",step:e=>typeof e=="number"};function ee(e){const t={};let i={};const r=new Array(ji.length).fill(!0);for(let n=0;n<e.length;n++){const s=e[n];if(typeof s=="object"){i=s;break}const a=ji.map((o,u)=>r[u]?o[n]:void 0);for(let o=0;o<a.length;o++){const u=a[o];if(u===void 0){r[o]=!1;continue}Ra[u](s)?t[u]=s:r[o]=!1}}return{...i,...t}}function Da(e){return(...t)=>ee(t).defval}function ja(e){return(...t)=>ee(t).defval}function Oa(e){return(...t)=>ee(t).defval}function Fa(e){return(...t)=>ee(t).defval}function $a(e){return(...t)=>ee(t).defval}function Wa(e){return(...t)=>ee(t).defval}function qa(e){return(t,i=0)=>m.from(t).get(i)}function Ua(e){return(...t)=>ee(t).defval}function za(e){return(...t)=>ee(t).defval}function Ga(e){return(...t)=>ee(t).defval}function Ha(e){return(...t)=>ee(t).defval}function Ka(e){return(...t)=>ee(t).defval}function Qa(e){return(...t)=>ee(t).defval}function Xa(e){return(...t)=>ee(t).defval}function Ya(e){return(...t)=>ee(t).defval}var Za=Object.defineProperty,Ja=(e,t,i)=>t in e?Za(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,X=(e,t,i)=>Ja(e,typeof t!="symbol"?t+"":t,i);const eo={any:Da,bool:ja,color:Oa,enum:Fa,float:$a,int:Wa,param:qa,price:Ua,session:za,source:Ga,string:Ha,symbol:Ka,text_area:Qa,time:Xa,timeframe:Ya};class to{constructor(t){this.context=t,X(this,"any"),X(this,"bool"),X(this,"color"),X(this,"enum"),X(this,"float"),X(this,"int"),X(this,"param"),X(this,"price"),X(this,"session"),X(this,"source"),X(this,"string"),X(this,"symbol"),X(this,"text_area"),X(this,"time"),X(this,"timeframe"),Object.entries(eo).forEach(([i,r])=>{this[i]=r(t)})}}function io(e){return t=>Math.abs(m.from(t).get(0))}function ro(e){return t=>Math.acos(m.from(t).get(0))}function no(e){return t=>Math.asin(m.from(t).get(0))}function so(e){return t=>Math.atan(m.from(t).get(0))}function ao(e){return(...t)=>{const i=t.map(r=>m.from(r).get(0));return i.reduce((r,n)=>r+n,0)/i.length}}function oo(e){return t=>Math.ceil(m.from(t).get(0))}function uo(e){return t=>Math.cos(m.from(t).get(0))}function co(e){return()=>Math.E}function lo(e){return t=>Math.exp(m.from(t).get(0))}function ho(e){return t=>Math.floor(m.from(t).get(0))}function po(e){return t=>Math.log(m.from(t).get(0))}function fo(e){return t=>Math.log(m.from(t).get(0))}function mo(e){return t=>Math.log10(m.from(t).get(0))}function go(e){return(...t)=>{const i=t.map(r=>m.from(r).get(0));return Math.max(...i)}}function xo(e){return(...t)=>{const i=t.map(r=>m.from(r).get(0));return Math.min(...i)}}function yo(e){return(t,i,r)=>typeof t=="string"?t:t instanceof m?i?new m(t.data,t.offset+i):t:!Array.isArray(t)&&typeof t=="object"?t:(e.params[r]||(e.params[r]=[]),Array.isArray(t)?new m(t,i||0):(e.params[r].length===0?e.params[r].push(t):e.params[r][e.params[r].length-1]=t,new m(e.params[r],0)))}function bo(e){return()=>1.618033988749895}function vo(e){return()=>Math.PI}function wo(e){return(t,i)=>Math.pow(m.from(t).get(0),m.from(i).get(0))}function _o(e){return()=>Math.random()}function So(e){return t=>Math.round(m.from(t).get(0))}function No(e){return t=>e.precision(Math.round(m.from(t).get(0)/e.pine.syminfo.mintick)*e.pine.syminfo.mintick)}function Co(e){return()=>.6180339887498948}function Eo(e){return t=>Math.sign(m.from(t).get(0))}function ko(e){return t=>Math.sin(m.from(t).get(0))}function Io(e){return t=>Math.sqrt(m.from(t).get(0))}function Ao(e){return(t,i)=>{const r=m.from(i).get(0),n=m.from(t);let s=0;for(let a=0;a<r;a++){const o=n.get(a);s+=o}return s}}function Po(e){return t=>Math.tan(m.from(t).get(0))}function Vo(e){return(t,i)=>{const r=m.from(t).get(0),n=m.from(i).get(0);return isNaN(r)&&isNaN(n)?!0:isNaN(r)||isNaN(n)?!1:Math.abs(r-n)<1e-8}}var To=Object.defineProperty,Mo=(e,t,i)=>t in e?To(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,R=(e,t,i)=>Mo(e,typeof t!="symbol"?t+"":t,i);const Lo={abs:io,acos:ro,asin:no,atan:so,avg:ao,ceil:oo,cos:uo,e:co,exp:lo,floor:ho,ln:po,log:fo,log10:mo,max:go,min:xo,param:yo,phi:bo,pi:vo,pow:wo,random:_o,round:So,round_to_mintick:No,rphi:Co,sign:Eo,sin:ko,sqrt:Io,sum:Ao,tan:Po,__eq:Vo};class Bo{constructor(t){this.context=t,R(this,"_cache",{}),R(this,"abs"),R(this,"acos"),R(this,"asin"),R(this,"atan"),R(this,"avg"),R(this,"ceil"),R(this,"cos"),R(this,"e"),R(this,"exp"),R(this,"floor"),R(this,"ln"),R(this,"log"),R(this,"log10"),R(this,"max"),R(this,"min"),R(this,"param"),R(this,"phi"),R(this,"pi"),R(this,"pow"),R(this,"random"),R(this,"round"),R(this,"round_to_mintick"),R(this,"rphi"),R(this,"sign"),R(this,"sin"),R(this,"sqrt"),R(this,"sum"),R(this,"tan"),R(this,"__eq"),Object.entries(Lo).forEach(([i,r])=>{this[i]=r(t)})}}function Ro(e){return(t,i,r)=>{e.params[r]||(e.params[r]=[]);let n;if(t instanceof m)n=t.get(i||0);else if(Array.isArray(t)){const s=t.every(o=>o instanceof m),a=t.every(o=>!(o instanceof m)&&!Array.isArray(o));(s||a)&&t.length>=1?s?n=t.map(o=>o.get(0)):n=t:n=m.from(t).get(i||0)}else n=t;return e.params[r].length===0?e.params[r].push(n):e.params[r][e.params[r].length-1]=n,[n,r]}}const it=["1","3","5","15","30","45","60","120","180","240","D","W","M"];function Oi(e,t,i,r,n=!1){for(let s=0;s<i.length;s++)if(i[s]<=e&&t<=r[s])return n||t>=r[s]?s:s-1;return-1}function Fi(e,t,i,r,n=!1,s,a=!1){for(let o=i.length-1;o>=0;o--){if(r[o]<=t&&i[o]>=e){const u=s&&t>s;if(a&&n)for(let c=0;c<i.length;c++){if(i[c]>=e&&i[c]<t)return c;if(i[c]>=t)break}if(u&&n&&!a)for(let c=0;c<i.length;c++){if(i[c]>=e&&i[c]<t)return c;if(i[c]>=t)break}return o}if(r[o]<e)break}return-1}function Do(e){return async(t,i,r,n=!1,s=!1,a=!1,o=null,u=null)=>{const c=t[0],h=i[0],f=r[0],d=r[1],p=Array.isArray(n)?n[0]:n,g=Array.isArray(s)?s[0]:s;if(e.isSecondaryContext)return f;const x=it.indexOf(e.timeframe),y=it.indexOf(h);if(x==-1||y==-1)throw new Error("Invalid timeframe");if(x===y)return f;const S=x>y,I=m.from(e.data.openTime).get(0),E=m.from(e.data.closeTime).get(0),P=`${c}_${h}_${d}`,C=`${P}_prevIdx`;if(e.cache[P]){const Ue=e.cache[P],st=S?Fi(I,E,Ue.data.openTime.data,Ue.data.closeTime.data,g,e.eDate,p):Oi(I,E,Ue.data.openTime.data,Ue.data.closeTime.data,g);if(st==-1)return NaN;const Le=Ue.params[d][st];if(!S&&p){const qi=e.cache[C];return qi!==void 0&&qi===st?NaN:(e.cache[C]=st,Array.isArray(Le)?[Le]:Le)}return Array.isArray(Le)?[Le]:Le}const Y=1e3*60*60*24*30,H=e.sDate?e.sDate-Y:void 0,z=e.sDate&&e.eDate?void 0:e.limit||1e3,qe=new kt(e.source,c,h,z,H,void 0);qe.markAsSecondary();const Ce=await qe.run(e.pineTSCode);e.cache[P]=Ce;const Pt=S?Fi(I,E,Ce.data.openTime.data,Ce.data.closeTime.data,g,e.eDate,p):Oi(I,E,Ce.data.openTime.data,Ce.data.closeTime.data,g);if(Pt==-1)return NaN;const Vt=Ce.params[d][Pt];return!S&&p?(e.cache[C]=Pt,NaN):Array.isArray(Vt)?[Vt]:Vt}}function jo(e){return async(t,i,r,n=!1,s=null,a=!1,o=0)=>{const u=t[0],c=i[0],h=r[0],f=r[1];Array.isArray(n)&&n[0];const d=Array.isArray(a)?a[0]:a;if(e.isSecondaryContext)return Array.isArray(h)?[h]:h;const p=it.indexOf(e.timeframe),g=it.indexOf(c);if(p===-1||g===-1){if(d)return NaN;throw new Error("Invalid timeframe")}if(g>p){if(d)return NaN;throw new Error(`Timeframe ${c} is not lower than or equal to chart timeframe ${e.timeframe}`)}if(g===p)return[[h]];const x=`${u}_${c}_${f}_lower`;if(!e.cache[x]){const H=e.sDate?e.sDate-2592e6:void 0,z=e.sDate&&e.eDate?void 0:e.limit||1e3,qe=new kt(e.source,u,c,z,H,e.eDate);qe.markAsSecondary();const Ce=await qe.run(e.pineTSCode);e.cache[x]=Ce}const y=e.cache[x],S=m.from(e.data.openTime).get(0),I=m.from(e.data.closeTime).get(0),E=y.data.openTime.data,P=y.data.closeTime.data,C=y.params[f];if(!C)return[];const Y=[];for(let H=0;H<E.length;H++){const z=E[H];if(!(P[H]<=S)){if(z>=I)break;z>=S&&z<I&&Y.push(C[H])}}return[Y]}}var Oo=Object.defineProperty,Fo=(e,t,i)=>t in e?Oo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,rt=(e,t,i)=>Fo(e,typeof t!="symbol"?t+"":t,i);const $o={param:Ro,security:Do,security_lower_tf:jo};class Wo{constructor(t){this.context=t,rt(this,"_cache",{}),rt(this,"param"),rt(this,"security"),rt(this,"security_lower_tf"),Object.entries($o).forEach(([i,r])=>{this[i]=r(t)})}}function qo(e){return t=>{e.taState||(e.taState={});const i=t||"accdist";e.taState[i]||(e.taState[i]={cumulativeSum:0});const r=e.taState[i],n=e.get(e.data.close,0),s=e.get(e.data.high,0),a=e.get(e.data.low,0),o=e.get(e.data.volume,0);if(isNaN(n)||isNaN(s)||isNaN(a)||isNaN(o))return e.precision(r.cumulativeSum);const u=s-a;let c=0;return u!==0&&(c=(n-a-(s-n))/u*o),r.cumulativeSum+=c,e.precision(r.cumulativeSum)}}function Uo(e){return(t,i,r,n,s)=>{const a=m.from(i).get(0),o=m.from(r).get(0),u=m.from(n).get(0);e.taState||(e.taState={});const c=s||`alma_${a}_${o}_${u}`;if(!e.taState[c]){const p=o*(a-1),g=a/u,x=[];let y=0;for(let S=0;S<a;S++){const I=Math.exp(-Math.pow(S-p,2)/(2*g*g));x.push(I),y+=I}for(let S=0;S<x.length;S++)x[S]/=y;e.taState[c]={window:[],weights:x}}const h=e.taState[c],f=m.from(t).get(0);if(h.window.unshift(f),h.window.length<a)return NaN;h.window.length>a&&h.window.pop();let d=0;for(let p=0;p<a;p++)d+=h.weights[p]*h.window[a-1-p];return e.precision(d)}}function zo(e){return(t,i)=>{const r=m.from(t).get(0);e.taState||(e.taState={});const n=i||`atr_${r}`;e.taState[n]||(e.taState[n]={prevAtr:null,initSum:0,initCount:0,prevClose:null});const s=e.taState[n],a=e.get(e.data.high,0),o=e.get(e.data.low,0),u=e.get(e.data.close,0);let c;if(s.prevClose!==null){const f=a-o,d=Math.abs(a-s.prevClose),p=Math.abs(o-s.prevClose);c=Math.max(f,d,p)}else c=a-o;if(s.prevClose=u,s.initCount<r)return s.initSum+=c,s.initCount++,s.initCount===r?(s.prevAtr=s.initSum/r,e.precision(s.prevAtr)):NaN;const h=(s.prevAtr*(r-1)+c)/r;return s.prevAtr=h,e.precision(h)}}function Go(e){return(t,i)=>{e.taState||(e.taState={});const r=i||"barssince";e.taState[r]||(e.taState[r]={lastTrueIndex:null});const n=e.taState[r];return m.from(t).get(0)?(n.lastTrueIndex=e.idx,0):n.lastTrueIndex===null?NaN:e.idx-n.lastTrueIndex}}function Ho(e){return(t,i,r,n)=>{const s=m.from(i).get(0),a=m.from(r).get(0);e.taState||(e.taState={});const o=n||`bb_${s}_${a}`;e.taState[o]||(e.taState[o]={window:[],sum:0});const u=e.taState[o],c=m.from(t).get(0);if(isNaN(c))return[[NaN,NaN,NaN]];if(u.window.unshift(c),u.sum+=c,u.window.length<s)return[[NaN,NaN,NaN]];if(u.window.length>s){const x=u.window.pop();u.sum-=x}const h=u.sum/s;let f=0;for(let x=0;x<s;x++)f+=Math.pow(u.window[x]-h,2);const d=Math.sqrt(f/s),p=h+a*d,g=h-a*d;return[[e.precision(p),e.precision(h),e.precision(g)]]}}function Ko(e){return(t,i,r,n)=>{const s=m.from(i).get(0),a=m.from(r).get(0);e.taState||(e.taState={});const o=n||`bbw_${s}_${a}`;e.taState[o]||(e.taState[o]={window:[],sum:0});const u=e.taState[o],c=m.from(t).get(0);if(isNaN(c))return NaN;if(u.window.unshift(c),u.sum+=c,u.window.length<s)return NaN;if(u.window.length>s){const y=u.window.pop();u.sum-=y}const h=u.sum/s;let f=0;for(let y=0;y<s;y++){const S=u.window[y]-h;f+=S*S}const d=f/s,p=Math.sqrt(d),g=a*p;if(h===0)return e.precision(0);const x=2*g/h*100;return e.precision(x)}}function Qo(e){return(t,i,r)=>{const n=m.from(i).get(0);e.taState||(e.taState={});const s=r||`cci_${n}`;e.taState[s]||(e.taState[s]={window:[],sum:0});const a=e.taState[s],o=m.from(t).get(0);if(isNaN(o))return NaN;if(a.window.unshift(o),a.sum+=o,a.window.length<n)return NaN;if(a.window.length>n){const d=a.window.pop();a.sum-=d}const u=a.sum/n;let c=0;for(let d=0;d<n;d++)c+=Math.abs(a.window[d]-u);const h=c/n;if(h===0)return 0;const f=(o-u)/(.015*h);return e.precision(f)}}function Xo(e){return(t,i=1,r)=>{typeof i=="string"&&(r=i,i=1);const n=m.from(i).get(0);e.taState||(e.taState={});const s=r||`change_${n}`;e.taState[s]||(e.taState[s]={window:[]});const a=e.taState[s],o=m.from(t).get(0);if(a.window.unshift(o),a.window.length<=n)return NaN;a.window.length>n+1&&a.window.pop();const u=o-a.window[n];return e.precision(u)}}function Yo(e){return(t,i,r)=>{const n=m.from(i).get(0);e.taState||(e.taState={});const s=r||`cmo_${n}`;e.taState[s]||(e.taState[s]={gainsWindow:[],lossesWindow:[],gainsSum:0,lossesSum:0});const a=e.taState[s],o=m.from(t).get(0),u=m.from(t).get(1);if(isNaN(o)||isNaN(u))return NaN;const c=o-u,h=c>=0?c:0,f=c>=0?0:-c;if(a.gainsWindow.unshift(h),a.lossesWindow.unshift(f),a.gainsSum+=h,a.lossesSum+=f,a.gainsWindow.length<n)return NaN;if(a.gainsWindow.length>n){const g=a.gainsWindow.pop(),x=a.lossesWindow.pop();a.gainsSum-=g,a.lossesSum-=x}const d=a.gainsSum+a.lossesSum;if(d===0)return e.precision(0);const p=100*(a.gainsSum-a.lossesSum)/d;return e.precision(p)}}function Zo(e){return(t,i,r)=>{const n=m.from(i).get(0),s=m.from(t);let a=0,o=!1;for(let h=0;h<n;h++){const f=s.get(h);if(isNaN(f)){o=!0;break}a+=f}if(o)return NaN;let u=0;for(let h=0;h<n;h++){const f=s.get(h);u+=f*(h+1)}if(a===0)return NaN;const c=-u/a;return e.precision(c)}}function Jo(e){return(t,i,r,n)=>{const s=m.from(r).get(0),a=m.from(t),o=m.from(i);if(e.idx<s-1)return NaN;let u=0,c=0,h=0,f=0,d=0,p=0;for(let I=0;I<s;I++){const E=a.get(I),P=o.get(I);isNaN(E)||isNaN(P)||(u+=E,c+=P,h+=E*P,f+=E*E,d+=P*P,p++)}if(p<2)return NaN;const g=p*h-u*c,x=p*f-u*u,y=p*d-c*c;if(x<=0||y<=0)return e.precision(0);const S=g/Math.sqrt(x*y);return e.precision(S)}}function eu(e){return(t,i,r)=>{const n=m.from(t),s=m.from(i),a=n.get(0),o=s.get(0),u=n.get(1),c=s.get(1);if(isNaN(a)||isNaN(o)||isNaN(u)||isNaN(c))return!1;const h=a>o&&u<=c,f=a<o&&u>=c;return h||f}}function tu(e){return(t,i)=>{const r=m.from(t),n=m.from(i),s=r.get(0),a=n.get(0),o=r.get(1),u=n.get(1);return o<u&&s>a}}function iu(e){return(t,i)=>{const r=m.from(t),n=m.from(i),s=r.get(0),a=n.get(0),o=r.get(1),u=n.get(1);return o>u&&s<a}}function ru(e){return(t,i)=>{e.taState||(e.taState={});const r=i||"cum";e.taState[r]||(e.taState[r]={cumulativeSum:0});const n=e.taState[r],s=m.from(t).get(0);return isNaN(s)||(n.cumulativeSum+=s),e.precision(n.cumulativeSum)}}function nu(e){return(t,i,r)=>{const n=m.from(i).get(0);e.taState||(e.taState={});const s=r||`dev_${n}`;e.taState[s]||(e.taState[s]={window:[],sum:0});const a=e.taState[s],o=m.from(t).get(0)||0;if(a.window.unshift(o),a.sum+=o,a.window.length<n)return NaN;if(a.window.length>n){const f=a.window.pop();a.sum-=f}const u=a.sum/n;let c=0;for(let f=0;f<n;f++)c+=Math.abs(a.window[f]-u);const h=c/n;return e.precision(h)}}function su(e){return(t,i,r)=>{const n=m.from(t).get(0),s=m.from(i).get(0);e.taState||(e.taState={});const a=r||`dmi_${n}_${s}`;e.taState[a]||(e.taState[a]={prevHigh:NaN,prevLow:NaN,prevClose:NaN,trInitSum:0,plusInitSum:0,minusInitSum:0,initCount:0,prevSmoothedTR:NaN,prevSmoothedPlus:NaN,prevSmoothedMinus:NaN,dxInitSum:0,adxInitCount:0,prevADX:NaN});const o=e.taState[a],u=e.get(e.data.high,0),c=e.get(e.data.low,0),h=e.get(e.data.close,0);if(isNaN(u)||isNaN(c)||isNaN(h))return[[NaN,NaN,NaN]];if(isNaN(o.prevHigh))return o.prevHigh=u,o.prevLow=c,o.prevClose=h,[[NaN,NaN,NaN]];const f=Math.max(u-c,Math.abs(u-o.prevClose),Math.abs(c-o.prevClose)),d=u-o.prevHigh,p=o.prevLow-c,g=d>p&&d>0?d:0,x=p>d&&p>0?p:0;o.prevHigh=u,o.prevLow=c,o.prevClose=h;let y,S,I;if(o.initCount++,o.initCount<=n)o.trInitSum+=f,o.plusInitSum+=g,o.minusInitSum+=x,o.initCount===n&&(o.prevSmoothedTR=o.trInitSum/n,o.prevSmoothedPlus=o.plusInitSum/n,o.prevSmoothedMinus=o.minusInitSum/n);else{const z=1/n;o.prevSmoothedTR=z*f+(1-z)*o.prevSmoothedTR,o.prevSmoothedPlus=z*g+(1-z)*o.prevSmoothedPlus,o.prevSmoothedMinus=z*x+(1-z)*o.prevSmoothedMinus}if(y=o.prevSmoothedTR,S=o.prevSmoothedPlus,I=o.prevSmoothedMinus,o.initCount<n)return[[NaN,NaN,NaN]];const E=y===0?0:100*S/y,P=y===0?0:100*I/y,C=E+P,Y=C===0?0:100*Math.abs(E-P)/C;let H=NaN;if(o.adxInitCount++,o.adxInitCount<=s)o.dxInitSum+=Y,o.adxInitCount===s&&(o.prevADX=o.dxInitSum/s,H=o.prevADX);else{const z=1/s;o.prevADX=z*Y+(1-z)*o.prevADX,H=o.prevADX}return[[e.precision(E),e.precision(P),e.precision(H)]]}}function au(e){return(t,i,r)=>{const n=m.from(i).get(0);e.taState||(e.taState={});const s=r||`ema_${n}`;e.taState[s]||(e.taState[s]={prevEma:null,initSum:0,initCount:0});const a=e.taState[s],o=m.from(t).get(0);if(a.initCount<n)return a.initSum+=o,a.initCount++,a.initCount===n?(a.prevEma=a.initSum/n,e.precision(a.prevEma)):NaN;const u=2/(n+1),c=o*u+a.prevEma*(1-u);return a.prevEma=c,e.precision(c)}}function ou(e){return(t,i,r)=>{const n=m.from(i).get(0),s=m.from(t);for(let a=0;a<n;a++){const o=s.get(a),u=s.get(a+1);if(isNaN(o)||isNaN(u)||o>=u)return!1}return!0}}function uu(e){return(t,i,r)=>{const n=m.from(i).get(0);e.taState||(e.taState={});const s=r||`highest_${n}`;e.taState[s]||(e.taState[s]={window:[]});const a=e.taState[s],o=m.from(t).get(0);if(a.window.unshift(o),a.window.length<n)return NaN;a.window.length>n&&a.window.pop();const u=Math.max(...a.window.filter(c=>!isNaN(c)));return e.precision(u)}}function cu(e){return(t,i,r)=>{const n=m.from(i).get(0),s=m.from(t);if(e.idx<n-1)return NaN;let a=-1/0,o=NaN;for(let u=0;u<n;u++){const c=s.get(u);isNaN(c)||(isNaN(o)||c>a)&&(a=c,o=-u)}return o}}function lu(e){return(t,i,r)=>{const n=m.from(i).get(0),s=Math.floor(n/2),a=Math.floor(Math.sqrt(n)),o=e.ta.wma,u=o(t,s,r?`${r}_wma1`:void 0),c=o(t,n,r?`${r}_wma2`:void 0);if(isNaN(u)||isNaN(c))return NaN;e.taState||(e.taState={});const h=r||`hma_raw_${n}`;e.taState[h]||(e.taState[h]=[]);const f=2*u-c;e.taState[h].unshift(f);const d=r?`${r}_hma_final`:`hma_final_${n}`;e.taState[d]||(e.taState[d]={window:[]});const p=e.taState[d];if(p.window.unshift(f),p.window.length<a)return NaN;p.window.length>a&&p.window.pop();let g=0,x=0;for(let S=0;S<a;S++){const I=a-S;g+=p.window[S]*I,x+=I}const y=g/x;return e.precision(y)}}function hu(e){return t=>{const i=e.get(e.data.close,0),r=e.get(e.data.high,0),n=e.get(e.data.low,0),s=e.get(e.data.volume,0);if(isNaN(i)||isNaN(r)||isNaN(n)||isNaN(s))return NaN;const a=(r-n)*s;if(a===0)return e.precision(0);const o=(2*i-r-n)/a;return e.precision(o)}}function pu(e){return(t,i,r,n,s)=>{const a=m.from(i).get(0),o=m.from(r).get(0);let u=!0;typeof n=="string"?s=n:n!==void 0&&(u=m.from(n).get(0));let c;const h=e.get(e.data.high,0),f=e.get(e.data.low,0);if(u){const P=e.get(e.data.close,1);isNaN(P)?c=NaN:c=Math.max(h-f,Math.abs(h-P),Math.abs(f-P))}else c=h-f;const d=m.from(t).get(0);e.taState||(e.taState={});const p=s||`kc_${a}_${o}_${u}`;e.taState[p]||(e.taState[p]={basisState:{prevEma:null,initSum:0,initCount:0},rangeState:{prevEma:null,initSum:0,initCount:0}});const g=e.taState[p],x=(P,C,Y)=>{if(isNaN(C))return NaN;if(P.initCount<Y)return P.initSum+=C,P.initCount++,P.initCount===Y?(P.prevEma=P.initSum/Y,P.prevEma):NaN;const H=2/(Y+1);return P.prevEma=C*H+P.prevEma*(1-H),P.prevEma},y=x(g.basisState,d,a),S=x(g.rangeState,c,a);if(isNaN(y)||isNaN(S))return[[NaN,NaN,NaN]];const I=y+S*o,E=y-S*o;return[[e.precision(y),e.precision(I),e.precision(E)]]}}function fu(e){return(t,i,r,n,s)=>{const a=m.from(i).get(0),o=m.from(r).get(0);let u=!0;typeof n=="string"?s=n:n!==void 0&&(u=m.from(n).get(0)),e.taState||(e.taState={});const c=s||`kcw_${a}_${o}_${u}`;e.taState[c]||(e.taState[c]={basisState:{prevEma:null,initSum:0,initCount:0},rangeState:{prevEma:null,initSum:0,initCount:0}});const h=e.taState[c],f=(E,P,C)=>{if(isNaN(P))return NaN;if(E.initCount<C)return E.initSum+=P,E.initCount++,E.initCount===C?(E.prevEma=E.initSum/C,E.prevEma):NaN;const Y=2/(C+1);return E.prevEma=P*Y+E.prevEma*(1-Y),E.prevEma};let d;const p=e.get(e.data.high,0),g=e.get(e.data.low,0);if(u){const E=e.get(e.data.close,1);isNaN(E)?d=NaN:d=Math.max(p-g,Math.abs(p-E),Math.abs(g-E))}else d=p-g;const x=m.from(t).get(0),y=f(h.basisState,x,a),S=f(h.rangeState,d,a);if(isNaN(y)||isNaN(S))return NaN;if(y===0)return e.precision(0);const I=2*S*o/y;return e.precision(I)}}function mu(e){return(t,i,r,n)=>{const s=m.from(i).get(0),a=m.from(r).get(0);e.taState||(e.taState={});const o=n||`linreg_${s}_${a}`;e.taState[o]||(e.taState[o]={window:[]});const u=e.taState[o],c=m.from(t).get(0);if(u.window.unshift(c),u.window.length<s)return NaN;u.window.length>s&&u.window.pop();let h=0,f=0,d=0,p=0;const g=s;for(let I=0;I<s;I++){const E=s-1-I,P=u.window[I];h+=E,f+=P,d+=E*P,p+=E*E}const x=g*p-h*h;if(x===0)return NaN;const y=(g*d-h*f)/x,S=(f-y*h)/g+y*(s-1-a);return e.precision(S)}}function du(e){return(t,i,r)=>{const n=m.from(i).get(0);e.taState||(e.taState={});const s=r||`lowest_${n}`;e.taState[s]||(e.taState[s]={window:[]});const a=e.taState[s],o=m.from(t).get(0);if(a.window.unshift(o),a.window.length<n)return NaN;a.window.length>n&&a.window.pop();const u=a.window.filter(h=>!isNaN(h)&&h!==void 0),c=u.length>0?Math.min(...u):NaN;return e.precision(c)}}function gu(e){return(t,i,r)=>{const n=m.from(i).get(0),s=m.from(t);if(e.idx<n-1)return NaN;let a=1/0,o=NaN;for(let u=0;u<n;u++){const c=s.get(u);isNaN(c)||(isNaN(o)||c<a)&&(a=c,o=-u)}return o}}function xu(e){return(t,i,r,n,s)=>{const a=m.from(i).get(0),o=m.from(r).get(0),u=m.from(n).get(0),c=s||`macd_${a}_${o}_${u}`,h=`${c}_fast`,f=`${c}_slow`,d=`${c}_signal`,p=e.ta.ema(t,a,h),g=e.ta.ema(t,o,f);let x=NaN;!isNaN(p)&&!isNaN(g)&&(x=p-g);let y=NaN;isNaN(x)||(y=e.ta.ema(x,u,d));let S=NaN;return!isNaN(x)&&!isNaN(y)&&(S=x-y),[[e.precision(x),e.precision(y),e.precision(S)]]}}function yu(e){return(t,i,r)=>{const n=m.from(i).get(0);e.taState||(e.taState={});const s=r||`median_${n}`;e.taState[s]||(e.taState[s]={window:[]});const a=e.taState[s],o=m.from(t).get(0);if(a.window.unshift(o),a.window.length<n)return NaN;a.window.length>n&&a.window.pop();const u=a.window.slice().sort((f,d)=>f-d),c=Math.floor(n/2),h=n%2===0?(u[c-1]+u[c])/2:u[c];return e.precision(h)}}function bu(e){return(t,i,r)=>{const n=m.from(i).get(0);e.taState||(e.taState={});const s=r||`mfi_${n}`;e.taState[s]||(e.taState[s]={upperWindow:[],lowerWindow:[],upperSum:0,lowerSum:0});const a=e.taState[s],o=m.from(t).get(0),u=m.from(t).get(1),c=e.get(e.data.volume,0);if(isNaN(o)||isNaN(c))return NaN;const h=isNaN(u)?NaN:o-u;let f=0,d=0;if(f=c*(h<=0?0:o),d=c*(h>=0?0:o),a.upperWindow.unshift(f),a.lowerWindow.unshift(d),a.upperSum+=f,a.lowerSum+=d,a.upperWindow.length<n)return NaN;if(a.upperWindow.length>n){const g=a.upperWindow.pop(),x=a.lowerWindow.pop();a.upperSum-=g,a.lowerSum-=x}if(a.lowerSum===0)return a.upperSum,e.precision(100);if(a.upperSum===0)return e.precision(0);const p=100-100/(1+a.upperSum/a.lowerSum);return e.precision(p)}}function vu(e){return(t,i,r)=>{const n=m.from(i).get(0),s=m.from(t);if(e.idx<n-1)return NaN;const a=new Map;for(let c=0;c<n;c++){const h=s.get(c);isNaN(h)||a.set(h,(a.get(h)||0)+1)}if(a.size===0)return NaN;let o=NaN,u=-1;for(const[c,h]of a.entries())h>u?(u=h,o=c):h===u&&c<o&&(o=c);return o}}function wu(e){return(t,i,r)=>{const n=m.from(i).get(0);return e.ta.change(t,n)}}function _u(e){return t=>{e.taState||(e.taState={});const i=t||"nvi";e.taState[i]||(e.taState[i]={nvi:1});const r=e.taState[i],n=e.get(e.data.close,0),s=e.get(e.data.close,1),a=e.get(e.data.volume,0),o=e.get(e.data.volume,1),u=isNaN(n)?0:n,c=isNaN(s)?0:s,h=isNaN(a)?0:a,f=isNaN(o)?0:o;if(!(u===0||c===0)&&h<f){const d=(u-c)/c;r.nvi=r.nvi+d*r.nvi}return e.precision(r.nvi)}}function Su(e){return()=>{e.taState||(e.taState={});const t="obv";e.taState[t]||(e.taState[t]={prevOBV:0});const i=e.taState[t],r=e.get(e.data.close,0),n=e.get(e.data.volume,0),s=e.get(e.data.close,1);if(isNaN(s))return i.prevOBV=0,e.precision(0);let a;return r>s?a=i.prevOBV+n:r<s?a=i.prevOBV-n:a=i.prevOBV,i.prevOBV=a,e.precision(a)}}function Nu(e){return(t,i,r)=>t instanceof m?i?new m(t.data,t.offset+i):t:(e.params[r]||(e.params[r]=[]),Array.isArray(t)?new m(t,i||0):(e.params[r].length===0?e.params[r].push(t):e.params[r][e.params[r].length-1]=t,new m(e.params[r],0)))}function Cu(e){return(t,i,r,n)=>{const s=m.from(i).get(0),a=m.from(r).get(0),o=m.from(t);if(e.idx<s-1)return NaN;const u=[];for(let g=0;g<s;g++){const x=o.get(g);if(isNaN(x))return NaN;u.push(x)}u.sort((g,x)=>g-x);let c=a/100*s-.5;c<0&&(c=0),c>s-1&&(c=s-1);const h=Math.floor(c),f=Math.ceil(c);if(h===f)return e.precision(u[h]);const d=c-h,p=u[h]+d*(u[f]-u[h]);return e.precision(p)}}function Eu(e){return(t,i,r,n)=>{const s=m.from(i).get(0),a=m.from(r).get(0),o=m.from(t);if(e.idx<s-1)return NaN;const u=[];for(let h=0;h<s;h++){const f=o.get(h);isNaN(f)||u.push(f)}if(u.length===0)return NaN;u.sort((h,f)=>h-f);let c=Math.ceil(a/100*u.length)-1;return c<0&&(c=0),c>=u.length&&(c=u.length-1),e.precision(u[c])}}function ku(e){return(t,i,r)=>{const n=m.from(i).get(0),s=m.from(t);if(e.idx<n)return NaN;const a=s.get(0);if(isNaN(a))return NaN;let o=0,u=0;for(let c=1;c<=n;c++){const h=s.get(c);isNaN(h)||(u++,h<=a&&o++)}return u===0?NaN:e.precision(o/u*100)}}function Iu(e,t,i){const r=new Array(e.length).fill(NaN);for(let n=t+i;n<e.length;n++){const s=e[n-i];let a=!0;for(let o=1;o<=t;o++)if(e[n-i-o]>=s){a=!1;break}if(a){for(let o=1;o<=i;o++)if(e[n-i+o]>=s){a=!1;break}}a&&(r[n]=s)}return r}function Au(e){return(t,i,r)=>{r==null&&(r=i,i=t,t=e.data.high);const n=m.from(i).get(0),s=m.from(r).get(0),a=m.from(t).toArray(),o=Iu(a,n,s),u=e.idx;return e.precision(o[u])}}function Pu(e,t,i){const r=new Array(e.length).fill(NaN);for(let n=t+i;n<e.length;n++){const s=e[n-i];let a=!0;for(let o=1;o<=t;o++)if(e[n-i-o]<=s){a=!1;break}if(a){for(let o=1;o<=i;o++)if(e[n-i+o]<=s){a=!1;break}}a&&(r[n]=s)}return r}function Vu(e){return(t,i,r)=>{r==null&&(r=i,i=t,t=e.data.low);const n=m.from(i).get(0),s=m.from(r).get(0),a=m.from(t).toArray(),o=Pu(a,n,s),u=e.idx;return e.precision(o[u])}}function Tu(e){return t=>{e.taState||(e.taState={});const i=t||"pvi";e.taState[i]||(e.taState[i]={pvi:1});const r=e.taState[i],n=e.get(e.data.close,0),s=e.get(e.data.close,1),a=e.get(e.data.volume,0),o=e.get(e.data.volume,1),u=isNaN(n)?0:n,c=isNaN(s)?0:s,h=isNaN(a)?0:a,f=isNaN(o)?0:o;if(!(u===0||c===0)&&h>f){const d=(u-c)/c;r.pvi=r.pvi+d*r.pvi}return e.precision(r.pvi)}}function Mu(e){return t=>{e.taState||(e.taState={});const i=t||"pvt";e.taState[i]||(e.taState[i]={cumulativeSum:0});const r=e.taState[i],n=e.get(e.data.close,0),s=e.get(e.data.close,1),a=e.get(e.data.volume,0);if(!isNaN(n)&&!isNaN(s)&&!isNaN(a)&&s!==0){const o=(n-s)/s*a;r.cumulativeSum+=o}return e.precision(r.cumulativeSum)}}function Lu(e){return(t,i,r)=>{const n=e.pine.ta.highest(t,i,(r||"range")+"_h"),s=e.pine.ta.lowest(t,i,(r||"range")+"_l");return isNaN(n)||isNaN(s)?NaN:e.precision(n-s)}}function Bu(e){return(t,i,r)=>{const n=m.from(i).get(0),s=m.from(t);for(let a=0;a<n;a++){const o=s.get(a),u=s.get(a+1);if(isNaN(o)||isNaN(u)||o<=u)return!1}return!0}}function Ru(e){return(t,i,r)=>{const n=m.from(i).get(0);e.taState||(e.taState={});const s=r||`rma_${n}`;e.taState[s]||(e.taState[s]={prevRma:null,initSum:0,initCount:0});const a=e.taState[s],o=m.from(t).get(0)||0;if(a.initCount<n)return a.initSum+=o,a.initCount++,a.initCount===n?(a.prevRma=a.initSum/n,e.precision(a.prevRma)):NaN;const u=1/n,c=o*u+a.prevRma*(1-u);return a.prevRma=c,e.precision(c)}}function Du(e){return(t,i,r)=>{const n=m.from(i).get(0);e.taState||(e.taState={});const s=r||`roc_${n}`;e.taState[s]||(e.taState[s]={window:[]});const a=e.taState[s],o=m.from(t).get(0);if(a.window.unshift(o),a.window.length<=n)return NaN;a.window.length>n+1&&a.window.pop();const u=a.window[n],c=(o-u)/u*100;return e.precision(c)}}function ju(e){return(t,i,r)=>{const n=m.from(i).get(0);e.taState||(e.taState={});const s=r||`rsi_${n}`;e.taState[s]||(e.taState[s]={prevValue:null,avgGain:0,avgLoss:0,initGains:[],initLosses:[]});const a=e.taState[s],o=m.from(t).get(0);if(a.prevValue!==null){const u=o-a.prevValue,c=u>0?u:0,h=u<0?-u:0;if(a.initGains.length<n){if(a.initGains.push(c),a.initLosses.push(h),a.initGains.length===n){a.avgGain=a.initGains.reduce((p,g)=>p+g,0)/n,a.avgLoss=a.initLosses.reduce((p,g)=>p+g,0)/n,a.prevValue=o;const d=a.avgLoss===0?100:100-100/(1+a.avgGain/a.avgLoss);return e.precision(d)}return a.prevValue=o,NaN}a.avgGain=(a.avgGain*(n-1)+c)/n,a.avgLoss=(a.avgLoss*(n-1)+h)/n;const f=a.avgLoss===0?100:100-100/(1+a.avgGain/a.avgLoss);return a.prevValue=o,e.precision(f)}return a.prevValue=o,NaN}}function Ou(e){return(t,i,r,n)=>{const s=m.from(t).get(0),a=m.from(i).get(0),o=m.from(r).get(0);e.taState||(e.taState={});const u=n||`sar_${s}_${a}_${o}`;e.taState[u]||(e.taState[u]={result:NaN,maxMin:NaN,acceleration:NaN,isBelow:!1,barIndex:0});const c=e.taState[u],h=e.get(e.data.high,0),f=e.get(e.data.low,0),d=e.get(e.data.close,0),p=e.get(e.data.close,1),g=e.get(e.data.high,1),x=e.get(e.data.low,1),y=e.get(e.data.high,2),S=e.get(e.data.low,2);if(isNaN(h)||isNaN(f)||isNaN(d))return NaN;let I=!1;return c.barIndex===1&&(d>p?(c.isBelow=!0,c.maxMin=h,c.result=x):(c.isBelow=!1,c.maxMin=f,c.result=g),I=!0,c.acceleration=s),c.barIndex>=1&&(c.result=c.result+c.acceleration*(c.maxMin-c.result),c.isBelow?c.result>f&&(I=!0,c.isBelow=!1,c.result=Math.max(h,c.maxMin),c.maxMin=f,c.acceleration=s):c.result<h&&(I=!0,c.isBelow=!0,c.result=Math.min(f,c.maxMin),c.maxMin=h,c.acceleration=s),I||(c.isBelow?h>c.maxMin&&(c.maxMin=h,c.acceleration=Math.min(c.acceleration+a,o)):f<c.maxMin&&(c.maxMin=f,c.acceleration=Math.min(c.acceleration+a,o))),c.isBelow?(c.result=Math.min(c.result,x),c.barIndex>1&&(c.result=Math.min(c.result,S))):(c.result=Math.max(c.result,g),c.barIndex>1&&(c.result=Math.max(c.result,y)))),c.barIndex++,c.barIndex<=1?NaN:e.precision(c.result)}}function Fu(e){return(t,i,r)=>{const n=m.from(i).get(0);e.taState||(e.taState={});const s=r||`sma_${n}`;e.taState[s]||(e.taState[s]={window:[],sum:0});const a=e.taState[s],o=m.from(t).get(0)||0;if(a.window.unshift(o),a.sum+=o,a.window.length<n)return NaN;if(a.window.length>n){const c=a.window.pop();a.sum-=c}const u=a.sum/n;return e.precision(u)}}function $u(e){return(t,i,r=!0,n)=>{const s=m.from(i).get(0),a=m.from(r).get(0);e.taState||(e.taState={});const o=n||`stdev_${s}_${a}`;e.taState[o]||(e.taState[o]={window:[],sum:0});const u=e.taState[o],c=m.from(t).get(0);if(u.window.unshift(c),u.sum+=c,u.window.length<s)return NaN;if(u.window.length>s){const g=u.window.pop();u.sum-=g}const h=u.sum/s;let f=0;for(let g=0;g<s;g++)f+=Math.pow(u.window[g]-h,2);const d=a?s:s-1,p=Math.sqrt(f/d);return e.precision(p)}}function Wu(e){return(t,i,r,n,s)=>{const a=m.from(n).get(0);e.taState||(e.taState={});const o=s||`stoch_${a}`;e.taState[o]||(e.taState[o]={highWindow:[],lowWindow:[]});const u=e.taState[o],c=m.from(t).get(0),h=m.from(i).get(0),f=m.from(r).get(0);if(isNaN(c)||isNaN(h)||isNaN(f))return NaN;if(u.highWindow.unshift(h),u.lowWindow.unshift(f),u.highWindow.length<a)return NaN;u.highWindow.length>a&&(u.highWindow.pop(),u.lowWindow.pop());let d=u.highWindow[0],p=u.lowWindow[0];for(let y=1;y<a;y++)u.highWindow[y]>d&&(d=u.highWindow[y]),u.lowWindow[y]<p&&(p=u.lowWindow[y]);const g=d-p;if(g===0)return NaN;const x=100*(c-p)/g;return e.precision(x)}}function qu(e){return(t,i,r)=>{const n=m.from(t).get(0),s=m.from(i).get(0);e.taState||(e.taState={});const a=r||`supertrend_${n}_${s}`;e.taState[a]||(e.taState[a]={trWindow:[],trSum:0,atrValue:NaN,atrCount:0,prevLowerBand:NaN,prevUpperBand:NaN,prevSuperTrend:NaN,prevDirection:NaN,prevClose:NaN});const o=e.taState[a],u=e.get(e.data.high,0),c=e.get(e.data.low,0),h=e.get(e.data.close,0);if(isNaN(u)||isNaN(c)||isNaN(h))return[[NaN,NaN]];const f=(u+c)/2;let d;isNaN(o.prevClose)?d=u-c:d=Math.max(u-c,Math.abs(u-o.prevClose),Math.abs(c-o.prevClose)),o.atrCount++,o.atrCount<=s?(o.trWindow.push(d),o.trSum+=d,o.atrCount===s&&(o.atrValue=o.trSum/s)):o.atrValue=(o.atrValue*(s-1)+d)/s;const p=o.atrValue,g=o.prevClose;if(o.prevClose=h,isNaN(p))return[[NaN,NaN]];let x=f+n*p,y=f-n*p;const S=isNaN(o.prevLowerBand)?0:o.prevLowerBand,I=isNaN(o.prevUpperBand)?0:o.prevUpperBand;isNaN(o.prevLowerBand)||y>S||g<S||(y=S),isNaN(o.prevUpperBand)||x<I||g>I||(x=I);let E,P;const C=o.prevSuperTrend;return o.atrCount===s?E=1:C===o.prevUpperBand?E=h>x?-1:1:E=h<y?1:-1,P=E===-1?y:x,o.prevLowerBand=y,o.prevUpperBand=x,o.prevSuperTrend=P,o.prevDirection=E,[[e.precision(P),E]]}}function Uu(e){return(t,i)=>{const r=[1,2,2,1],n=6;e.taState||(e.taState={});const s=i||"swma";e.taState[s]||(e.taState[s]={window:[]});const a=e.taState[s],o=m.from(t).get(0);if(a.window.unshift(o),a.window.length<4)return NaN;a.window.length>4&&a.window.pop();let u=0;for(let c=0;c<4;c++)u+=r[c]*a.window[3-c];return u/=n,e.precision(u)}}function zu(e){return(t,i)=>{let r=!0;typeof t=="string"||t!==void 0&&(r=m.from(t).get(0));const n=e.get(e.data.high,0),s=e.get(e.data.low,0),a=e.get(e.data.close,1);if(isNaN(a))return r?e.precision(n-s):NaN;const o=Math.max(n-s,Math.abs(n-a),Math.abs(s-a));return e.precision(o)}}function Gu(e){return(t,i,r,n)=>{const s=m.from(i).get(0),a=m.from(r).get(0);e.taState||(e.taState={});const o=n||`tsi_${s}_${a}`;e.taState[o]||(e.taState[o]={prevSource:NaN,ema1_pc_multiplier:2/(a+1),ema1_pc_value:NaN,ema1_pc_count:0,ema1_pc_sum:0,ema2_pc_multiplier:2/(s+1),ema2_pc_value:NaN,ema2_pc_count:0,ema2_pc_sum:0,ema1_abs_multiplier:2/(a+1),ema1_abs_value:NaN,ema1_abs_count:0,ema1_abs_sum:0,ema2_abs_multiplier:2/(s+1),ema2_abs_value:NaN,ema2_abs_count:0,ema2_abs_sum:0});const u=e.taState[o],c=m.from(t).get(0);if(isNaN(c))return NaN;const h=isNaN(u.prevSource)?NaN:c-u.prevSource;if(u.prevSource=c,isNaN(h))return NaN;const f=Math.abs(h);if(u.ema1_pc_count++,u.ema1_pc_count<=a?(u.ema1_pc_sum+=h,u.ema1_pc_count===a&&(u.ema1_pc_value=u.ema1_pc_sum/a)):u.ema1_pc_value=h*u.ema1_pc_multiplier+u.ema1_pc_value*(1-u.ema1_pc_multiplier),u.ema1_abs_count++,u.ema1_abs_count<=a?(u.ema1_abs_sum+=f,u.ema1_abs_count===a&&(u.ema1_abs_value=u.ema1_abs_sum/a)):u.ema1_abs_value=f*u.ema1_abs_multiplier+u.ema1_abs_value*(1-u.ema1_abs_multiplier),isNaN(u.ema1_pc_value)||isNaN(u.ema1_abs_value))return NaN;if(u.ema2_pc_count++,u.ema2_pc_count<=s?(u.ema2_pc_sum+=u.ema1_pc_value,u.ema2_pc_count===s&&(u.ema2_pc_value=u.ema2_pc_sum/s)):u.ema2_pc_value=u.ema1_pc_value*u.ema2_pc_multiplier+u.ema2_pc_value*(1-u.ema2_pc_multiplier),u.ema2_abs_count++,u.ema2_abs_count<=s?(u.ema2_abs_sum+=u.ema1_abs_value,u.ema2_abs_count===s&&(u.ema2_abs_value=u.ema2_abs_sum/s)):u.ema2_abs_value=u.ema1_abs_value*u.ema2_abs_multiplier+u.ema2_abs_value*(1-u.ema2_abs_multiplier),isNaN(u.ema2_pc_value)||isNaN(u.ema2_abs_value))return NaN;if(u.ema2_abs_value===0)return e.precision(0);const d=u.ema2_pc_value/u.ema2_abs_value;return e.precision(d)}}function Hu(e){return(t,i,r,n)=>{e.taState||(e.taState={});const s=n||"valuewhen";e.taState[s]||(e.taState[s]={values:[]});const a=e.taState[s],o=m.from(t).get(0),u=m.from(i).get(0),c=m.from(r).get(0);if(o&&a.values.push(u),isNaN(c)||c<0)return NaN;const h=a.values.length-1-c;if(h<0)return NaN;const f=a.values[h];return typeof f=="number"?e.precision(f):f}}function Ku(e){return(t,i,r)=>{const n=m.from(i).get(0);e.taState||(e.taState={});const s=r||`variance_${n}`;e.taState[s]||(e.taState[s]={window:[]});const a=e.taState[s],o=m.from(t).get(0);if(a.window.unshift(o),a.window.length<n)return NaN;a.window.length>n&&a.window.pop();let u=0,c=0;for(let d=0;d<n;d++)u+=a.window[d],c+=a.window[d]*a.window[d];const h=u/n,f=c/n-h*h;return e.precision(f)}}function Qu(e){return(t,i)=>{e.taState||(e.taState={});const r=i||"vwap";e.taState[r]||(e.taState[r]={cumulativePV:0,cumulativeVolume:0,lastSessionDate:null});const n=e.taState[r],s=m.from(t).get(0),a=m.from(e.data.volume).get(0),o=m.from(e.data.openTime).get(0),u=new Date(o).toISOString().slice(0,10);if(n.lastSessionDate!==u&&(n.cumulativePV=0,n.cumulativeVolume=0,n.lastSessionDate=u),n.cumulativePV+=s*a,n.cumulativeVolume+=a,n.cumulativeVolume===0)return NaN;const c=n.cumulativePV/n.cumulativeVolume;return e.precision(c)}}function Xu(e){return(t,i,r)=>{const n=m.from(i).get(0);e.taState||(e.taState={});const s=r||`vwma_${n}`;e.taState[s]||(e.taState[s]={window:[],volumeWindow:[]});const a=e.taState[s],o=m.from(t).get(0),u=e.get(e.data.volume,0);if(a.window.unshift(o),a.volumeWindow.unshift(u),a.window.length<n)return NaN;a.window.length>n&&(a.window.pop(),a.volumeWindow.pop());let c=0,h=0;for(let d=0;d<n;d++)c+=a.window[d]*a.volumeWindow[d],h+=a.volumeWindow[d];const f=c/h;return e.precision(f)}}function Yu(e){return t=>{e.taState||(e.taState={});const i=t||"wad";e.taState[i]||(e.taState[i]={cumulativeSum:0});const r=e.taState[i],n=e.get(e.data.close,0),s=e.get(e.data.high,0),a=e.get(e.data.low,0),o=e.get(e.data.close,1);if(isNaN(n)||isNaN(s)||isNaN(a))return e.precision(r.cumulativeSum);let u=0;if(!isNaN(o)){const c=Math.max(s,o),h=Math.min(a,o),f=n-o;f>0?u=n-h:f<0&&(u=n-c)}return r.cumulativeSum+=u,e.precision(r.cumulativeSum)}}function Zu(e){return(t,i,r)=>{const n=m.from(i).get(0);e.taState||(e.taState={});const s=r||`wma_${n}`;e.taState[s]||(e.taState[s]={window:[]});const a=e.taState[s],o=m.from(t).get(0);if(a.window.unshift(o),a.window.length<n)return NaN;a.window.length>n&&a.window.pop();let u=0,c=0;for(let f=0;f<n;f++){const d=n-f;u+=a.window[f]*d,c+=d}const h=u/c;return e.precision(h)}}function Ju(e){return(t,i)=>{const r=m.from(t).get(0);e.taState||(e.taState={});const n=i||`wpr_${r}`;e.taState[n]||(e.taState[n]={highWindow:[],lowWindow:[]});const s=e.taState[n],a=e.get(e.data.high,0),o=e.get(e.data.low,0),u=e.get(e.data.close,0);if(isNaN(a)||isNaN(o)||isNaN(u))return NaN;if(s.highWindow.unshift(a),s.lowWindow.unshift(o),s.highWindow.length<r)return NaN;s.highWindow.length>r&&(s.highWindow.pop(),s.lowWindow.pop());let c=s.highWindow[0],h=s.lowWindow[0];for(let p=1;p<r;p++)s.highWindow[p]>c&&(c=s.highWindow[p]),s.lowWindow[p]<h&&(h=s.lowWindow[p]);const f=c-h;if(f===0)return e.precision(0);const d=(c-u)/f*-100;return e.precision(d)}}function ec(e){return t=>{const i=e.get(e.data.close,0),r=e.get(e.data.open,0),n=e.get(e.data.high,0),s=e.get(e.data.low,0),a=e.get(e.data.volume,0);if(isNaN(i)||isNaN(r)||isNaN(n)||isNaN(s)||isNaN(a))return NaN;const o=n-s;if(o===0)return e.precision(0);const u=(i-r)/o*a;return e.precision(u)}}var tc=Object.defineProperty,ic=(e,t,i)=>t in e?tc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,_=(e,t,i)=>ic(e,typeof t!="symbol"?t+"":t,i);const rc={accdist:qo,alma:Uo,atr:zo,barssince:Go,bb:Ho,bbw:Ko,cci:Qo,change:Xo,cmo:Yo,cog:Zo,correlation:Jo,cross:eu,crossover:tu,crossunder:iu,cum:ru,dev:nu,dmi:su,ema:au,falling:ou,highest:uu,highestbars:cu,hma:lu,iii:hu,kc:pu,kcw:fu,linreg:mu,lowest:du,lowestbars:gu,macd:xu,median:yu,mfi:bu,mode:vu,mom:wu,nvi:_u,obv:Su,param:Nu,percentile_linear_interpolation:Cu,percentile_nearest_rank:Eu,percentrank:ku,pivothigh:Au,pivotlow:Vu,pvi:Tu,pvt:Mu,range:Lu,rising:Bu,rma:Ru,roc:Du,rsi:ju,sar:Ou,sma:Fu,stdev:$u,stoch:Wu,supertrend:qu,swma:Uu,tr:zu,tsi:Gu,valuewhen:Hu,variance:Ku,vwap:Qu,vwma:Xu,wad:Yu,wma:Zu,wpr:Ju,wvad:ec};class nc{constructor(t){this.context=t,_(this,"accdist"),_(this,"alma"),_(this,"atr"),_(this,"barssince"),_(this,"bb"),_(this,"bbw"),_(this,"cci"),_(this,"change"),_(this,"cmo"),_(this,"cog"),_(this,"correlation"),_(this,"cross"),_(this,"crossover"),_(this,"crossunder"),_(this,"cum"),_(this,"dev"),_(this,"dmi"),_(this,"ema"),_(this,"falling"),_(this,"highest"),_(this,"highestbars"),_(this,"hma"),_(this,"iii"),_(this,"kc"),_(this,"kcw"),_(this,"linreg"),_(this,"lowest"),_(this,"lowestbars"),_(this,"macd"),_(this,"median"),_(this,"mfi"),_(this,"mode"),_(this,"mom"),_(this,"nvi"),_(this,"obv"),_(this,"param"),_(this,"percentile_linear_interpolation"),_(this,"percentile_nearest_rank"),_(this,"percentrank"),_(this,"pivothigh"),_(this,"pivotlow"),_(this,"pvi"),_(this,"pvt"),_(this,"range"),_(this,"rising"),_(this,"rma"),_(this,"roc"),_(this,"rsi"),_(this,"sar"),_(this,"sma"),_(this,"stdev"),_(this,"stoch"),_(this,"supertrend"),_(this,"swma"),_(this,"tr"),_(this,"tsi"),_(this,"valuewhen"),_(this,"variance"),_(this,"vwap"),_(this,"vwma"),_(this,"wad"),_(this,"wma"),_(this,"wpr"),_(this,"wvad"),Object.entries(rc).forEach(([i,r])=>{this[i]=r(t)})}}class sc{constructor(t){this.context=t}logFormat(t,...i){return t.replace(/{(\d+)}/g,(r,n)=>i[n])}param(t,i=0,r){return m.from(t).get(i)}warning(t,...i){console.warn(this.logFormat(t,...i))}error(t,...i){console.error(this.logFormat(t,...i))}info(t,...i){console.log(this.logFormat(t,...i))}}class ac{constructor(t){this.context=t}param(t,i=0,r){return m.from(t).get(i)}tostring(t){return String(t)}tonumber(t){return Number(t)}lower(t){return String(t).toLowerCase()}upper(t){return String(t).toUpperCase()}trim(t){return String(t).trim()}repeat(t,i,r=""){return Array(i).fill(t).join(r||"")}replace_all(t,i,r){return String(t).replaceAll(i,r)}replace(t,i,r,n=0){const s=String(t),a=String(i),o=String(r),u=Math.floor(Number(n))||0;if(a==="")return s;let c=0,h=0;for(;;){const f=s.indexOf(a,c);if(f===-1)return s;if(h===u)return s.substring(0,f)+o+s.substring(f+a.length);h++,c=f+a.length}}contains(t,i){return String(t).includes(i)}endswith(t,i){return String(t).endsWith(i)}startswith(t,i){return String(t).startsWith(i)}pos(t,i){const r=String(t).indexOf(i);return r===-1?NaN:r}length(t){return String(t).length}match(t,i){return String(t).match(new RegExp(i))}split(t,i){return[String(t).split(i)]}substring(t,i,r){return String(t).substring(i,r)}format(t,...i){return t.replace(/{(\d+)}/g,(r,n)=>i[n])}}class oc{constructor(t){this.context=t}param(t,i=0,r){return m.from(t).get(i)}get main_period(){return this.context.timeframe}get period(){return this.context.timeframe}get multiplier(){const t=parseInt(this.context.timeframe);return isNaN(t)?1:t}get isdwm(){return["D","W","M"].includes(this.context.timeframe.slice(-1))}get isdaily(){return this.context.timeframe.slice(-1)==="D"}get isweekly(){return this.context.timeframe.slice(-1)==="W"}get ismonthly(){return this.context.timeframe.slice(-1)==="M"}get isseconds(){return this.context.timeframe.slice(-1)==="S"}get isminutes(){return parseInt(this.context.timeframe).toString()==this.context.timeframe.trim()}get isintraday(){return!this.isdwm}from_seconds(t){return t<60?Math.ceil(t/5)*5+"S":t<60*60*24?Math.ceil(t/60):t<=60*60*24*7*52?t%(60*60*24*7)===0?Math.ceil(t/604800)+"W":Math.ceil(t/(60*60*24))+"D":"12M"}in_seconds(t){const i=parseInt(t),r=t.slice(-1);return r==="S"?i:r==="D"?i*60*60*24:r==="W"?i*60*60*24*7:r==="M"?i*60*60*24*30:isNaN(i)?0:i*60}}var uc=Object.defineProperty,cc=(e,t,i)=>t in e?uc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,O=(e,t,i)=>cc(e,typeof t!="symbol"?t+"":t,i);const $i=class Tt{constructor({marketData:t,source:i,tickerId:r,timeframe:n,limit:s,sDate:a,eDate:o,fullContext:u}){O(this,"data",{open:new m([]),high:new m([]),low:new m([]),close:new m([]),volume:new m([]),hl2:new m([]),hlc3:new m([]),ohlc4:new m([]),hlcc4:new m([])}),O(this,"cache",{}),O(this,"taState",{}),O(this,"isSecondaryContext",!1),O(this,"NA",NaN),O(this,"lang"),O(this,"pine"),O(this,"idx",0),O(this,"params",{}),O(this,"const",{}),O(this,"var",{}),O(this,"let",{}),O(this,"result"),O(this,"plots",{}),O(this,"marketData"),O(this,"source"),O(this,"tickerId"),O(this,"timeframe",""),O(this,"limit"),O(this,"sDate"),O(this,"eDate"),O(this,"fullContext"),O(this,"pineTSCode"),this.marketData=t,this.source=i,this.tickerId=r,this.timeframe=n,this.limit=s,this.sDate=a,this.eDate=o,this.fullContext=u||this;const c=new Ba(this),h={plotchar:c.plotchar.bind(c),na:c.na.bind(c),color:c.color,plot:c.plot.bind(c),nz:c.nz.bind(c)},f=this;this.pine={input:new to(this),ta:new nc(this),math:new Bo(this),request:new Wo(this),array:new ls(this),map:new Cs(this),matrix:new ka(this),na:h.na,plotchar:h.plotchar,color:h.color,plot:h.plot,nz:h.nz,syminfo:null,timeframe:new oc(this),barstate:new Va(this),get bar_index(){return f.idx},get last_bar_index(){return f.data.close.length-1},get last_bar_time(){return f.data.openTime.get(f.data.openTime.length-1)},get timenow(){return new Date().getTime()},log:new sc(this),str:new ac(this),...Hn}}init(t,i,r=0){let n;return i instanceof m?n=i.get(0):Array.isArray(i)?Array.isArray(i[0])?n=i[0]:n=i[i.length-1+r]:n=i,t?t instanceof m?(t.data[t.data.length-1]=n,t):Array.isArray(t)?(t[t.length-1]=n,new m(t)):new m([n]):new m([n])}initVar(t,i){if(t)return t;let r;return i instanceof m?r=i.get(0):Array.isArray(i)?Array.isArray(i[0])?r=i[0]:r=this.precision(i[i.length-1]):r=this.precision(i),new m([r])}precision(t,i=10){const r=10**i;return typeof t=="number"?Math.round(t*r)/r:t}param(t,i,r){return typeof t=="string"?t:t instanceof m?i?new m(t.data,t.offset+i):t:!Array.isArray(t)&&typeof t=="object"?t:(this.params[r]||(this.params[r]=[]),Array.isArray(t)?new m(t,i||0):(this.params[r].length===0?this.params[r].push(t):this.params[r][this.params[r].length-1]=t,new m(this.params[r],0)))}get(t,i){if(t instanceof m)return t.get(i);if(Array.isArray(t)){const r=t.length-1-i;return r<0||r>=t.length?NaN:t[r]}return t}set(t,i){if(t instanceof m){t.set(0,i);return}if(Array.isArray(t)){t.length>0?t[t.length-1]=i:t.push(i);return}}get math(){return this._showDeprecationWarning("const math = context.math","const { math, ta, input } = context.pine"),this.pine.math}get ta(){return this._showDeprecationWarning("const ta = context.ta","const { ta, math, input } = context.pine"),this.pine.ta}get input(){return this._showDeprecationWarning("const input = context.input","const { input, math, ta } = context.pine"),this.pine.input}get request(){return this._showDeprecationWarning("const request = context.request","const { request, math, ta } = context.pine"),this.pine.request}get array(){return this._showDeprecationWarning("const array = context.array","const { array, math, ta } = context.pine"),this.pine.array}get core(){return this._showDeprecationWarning("context.core.*","context.pine (e.g., const { na, plotchar, color, plot, nz } = context.pine)"),{na:this.pine.na,plotchar:this.pine.plotchar,color:this.pine.color,plot:this.pine.plot,nz:this.pine.nz}}_showDeprecationWarning(t,i){const r=`${t}->${i}`;Tt._deprecationWarningsShown.has(r)||(Tt._deprecationWarningsShown.add(r),typeof window<"u"?console.warn("%c[WARNING]%c %s syntax is deprecated. Use %s instead. This will be removed in a future version.","color: #FFA500; font-weight: bold;","color: #FFA500;",t,i):console.warn(`\x1B[33m[WARNING] ${t} syntax is deprecated. Use ${i} instead. This will be removed in a future version.\x1B[0m`))}};O($i,"_deprecationWarningsShown",new Set);let Et=$i;var lc=Object.defineProperty,hc=(e,t,i)=>t in e?lc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,q=(e,t,i)=>hc(e,typeof t!="symbol"?t+"":t,i);class kt{constructor(t,i,r,n,s,a){this.source=t,this.tickerId=i,this.timeframe=r,this.limit=n,this.sDate=s,this.eDate=a,q(this,"data",[]),q(this,"open",[]),q(this,"high",[]),q(this,"low",[]),q(this,"close",[]),q(this,"volume",[]),q(this,"hl2",[]),q(this,"hlc3",[]),q(this,"ohlc4",[]),q(this,"hlcc4",[]),q(this,"openTime",[]),q(this,"closeTime",[]),q(this,"_readyPromise",null),q(this,"_ready",!1),q(this,"_debugSettings",{ln:!1,debug:!1}),q(this,"_transpiledCode",null),q(this,"_isSecondaryContext",!1),q(this,"_syminfo"),this._readyPromise=new Promise(o=>{this.loadMarketData(t,i,r,n,s,a).then(u=>{const c=u;this.data=c;const h=c.map(C=>C.open),f=c.map(C=>C.close),d=c.map(C=>C.high),p=c.map(C=>C.low),g=c.map(C=>C.volume),x=c.map(C=>(C.high+C.low+C.close)/3),y=c.map(C=>(C.high+C.low)/2),S=c.map(C=>(C.high+C.low+C.open+C.close)/4),I=c.map(C=>(C.high+C.low+C.close+C.close)/4),E=c.map(C=>C.openTime),P=c.map(C=>C.closeTime);this.open=h,this.close=f,this.high=d,this.low=p,this.volume=g,this.hl2=y,this.hlc3=x,this.ohlc4=S,this.hlcc4=I,this.openTime=E,this.closeTime=P,t&&t.getSymbolInfo?t.getSymbolInfo(i).then(C=>{this._syminfo=C,this._ready=!0,o(!0)}).catch(C=>{console.warn("Failed to get symbol info, using default values:",C),this._ready=!0,o(!0)}):(this._ready=!0,o(!0))})})}get transpiledCode(){return this._transpiledCode}markAsSecondary(){this._isSecondaryContext=!0}setDebugSettings({ln:t,debug:i}){this._debugSettings.ln=t,this._debugSettings.debug=i}async loadMarketData(t,i,r,n,s,a){return Array.isArray(t)?t:t.getMarketData(i,r,n,s,a)}async ready(){if(this._ready)return!0;if(!this._readyPromise)throw new Error("PineTS is not ready");return this._readyPromise}run(t,i,r){if(r&&r>0){const n=typeof this.eDate>"u"&&!Array.isArray(this.source);return this._runPaginated(t,i,r,n)}else return this._runComplete(t,i)}async _runComplete(t,i){await this.ready(),i||(i=this.data.length);const r=this._initializeContext(t,this._isSecondaryContext);return this._transpiledCode=this._transpileCode(t),await this._executeIterations(r,this._transpiledCode,this.data.length-i,this.data.length),r}async*_runPaginated(t,i,r,n=!1){await this.ready(),i||(i=this.data.length);const s=this._initializeContext(t,this._isSecondaryContext);this._transpiledCode=this._transpileCode(t);let a=this.data.length-i;for(;;){const o=this.data.length-a;if(o>0){const h=Math.min(o,r),f=this._getResultLength(s.result);await this._executeIterations(s,this._transpiledCode,a,a+h),a+=h,yield this._createPageContext(s,f);continue}if(!n||Array.isArray(this.source))break;const{newCandles:u,updatedLastCandle:c}=await this._updateMarketData();if(u===0&&!c){yield null;continue}this._removeLastResult(s),a=this.data.length-(u+1),s.pine.barstate.setLive()}}_getResultLength(t){if(Array.isArray(t))return t.length;if(typeof t=="object"&&t!==null){const i=Object.keys(t);if(i.length>0&&Array.isArray(t[i[0]]))return t[i[0]].length}return 0}_createPageContext(t,i){const r=new Et({marketData:this.data,source:this.source,tickerId:this.tickerId,timeframe:this.timeframe,limit:this.limit,sDate:this.sDate,eDate:this.eDate,fullContext:t});if(r.pineTSCode=t.pineTSCode,r.idx=t.idx,Array.isArray(t.result))r.result=t.result.slice(i);else if(typeof t.result=="object"&&t.result!==null){r.result={};for(let n in t.result)Array.isArray(t.result[n])?r.result[n]=t.result[n].slice(i):r.result[n]=t.result[n]}else r.result=t.result;return r.plots={...t.plots},r}async _updateMarketData(t){if(Array.isArray(this.source))return{newCandles:0,updatedLastCandle:!1};const i=this.source,r=this.data.length-1,n=this.data[r].openTime;try{const s=await i.getMarketData(this.tickerId,this.timeframe,void 0,n,t);if(!s||s.length===0)return{newCandles:0,updatedLastCandle:!1};let a=!1,o=0;for(let u=0;u<s.length;u++){const c=s[u];c.openTime===n?(this._replaceCandle(r,c),a=!0):c.openTime>n&&(this._appendCandle(c),o++)}return{newCandles:o,updatedLastCandle:a}}catch(s){return console.error("Error updating market data:",s),{newCandles:0,updatedLastCandle:!1}}}_replaceCandle(t,i){this.data[t]=i,this.open[t]=i.open,this.close[t]=i.close,this.high[t]=i.high,this.low[t]=i.low,this.volume[t]=i.volume,this.hl2[t]=(i.high+i.low)/2,this.hlc3[t]=(i.high+i.low+i.close)/3,this.ohlc4[t]=(i.high+i.low+i.open+i.close)/4,this.hlcc4[t]=(i.high+i.low+i.close+i.close)/4,this.openTime[t]=i.openTime,this.closeTime[t]=i.closeTime}_appendCandle(t){this.data.push(t),this.open.push(t.open),this.close.push(t.close),this.high.push(t.high),this.low.push(t.low),this.volume.push(t.volume),this.hl2.push((t.high+t.low)/2),this.hlc3.push((t.high+t.low+t.close)/3),this.ohlc4.push((t.high+t.low+t.open+t.close)/4),this.hlcc4.push((t.high+t.low+t.close+t.close)/4),this.openTime.push(t.openTime),this.closeTime.push(t.closeTime)}_removeLastResult(t){if(Array.isArray(t.result))t.result.pop();else if(typeof t.result=="object"&&t.result!==null)for(let i in t.result)Array.isArray(t.result[i])&&t.result[i].pop();t.data.close.data.pop(),t.data.open.data.pop(),t.data.high.data.pop(),t.data.low.data.pop(),t.data.volume.data.pop(),t.data.hl2.data.pop(),t.data.hlc3.data.pop(),t.data.ohlc4.data.pop(),t.data.hlcc4.data.pop(),t.data.openTime.data.pop(),t.data.closeTime&&t.data.closeTime.data.pop()}_initializeContext(t,i=!1){const r=new Et({marketData:this.data,source:this.source,tickerId:this.tickerId,timeframe:this.timeframe,limit:this.limit,sDate:this.sDate,eDate:this.eDate});return r.pine.syminfo=this._syminfo,r.pineTSCode=t,r.isSecondaryContext=i,r.data.close=new m([]),r.data.open=new m([]),r.data.high=new m([]),r.data.low=new m([]),r.data.volume=new m([]),r.data.hl2=new m([]),r.data.hlc3=new m([]),r.data.ohlc4=new m([]),r.data.hlcc4=new m([]),r.data.openTime=new m([]),r.data.closeTime=new m([]),r}_transpileCode(t){return un.bind(this)(t,this._debugSettings)}async _executeIterations(t,i,r,n){const s=["const","var","let","params"];for(let a=r;a<n;a++){t.idx=a,t.data.close.data.push(this.close[a]),t.data.open.data.push(this.open[a]),t.data.high.data.push(this.high[a]),t.data.low.data.push(this.low[a]),t.data.volume.data.push(this.volume[a]),t.data.hl2.data.push(this.hl2[a]),t.data.hlc3.data.push(this.hlc3[a]),t.data.ohlc4.data.push(this.ohlc4[a]),t.data.hlcc4.data.push(this.hlcc4[a]),t.data.openTime.data.push(this.openTime[a]),t.data.closeTime.data.push(this.closeTime[a]);const o=await i(t);if(typeof o=="object"){typeof t.result!="object"&&(t.result={});for(let u in o){t.result[u]===void 0&&(t.result[u]=[]);let c;o[u]instanceof m?c=o[u].get(0):Array.isArray(o[u])?c=o[u][o[u].length-1]:c=o[u],t.result[u].push(c)}}else Array.isArray(t.result)||(t.result=[]),t.result.push(o);for(let u of s)for(let c in t[u]){const h=t[u][c];if(h instanceof m){const f=h.get(0);h.data.push(f)}else if(Array.isArray(h)){const f=h[h.length-1];h.push(f)}}}}}var pc=Object.defineProperty,fc=(e,t,i)=>t in e?pc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,It=(e,t,i)=>fc(e,typeof t!="symbol"?t+"":t,i);const Wi="https://api.binance.com/api/v3",At={1:"1m",3:"3m",5:"5m",15:"15m",30:"30m",45:null,60:"1h",120:"2h",180:null,240:"4h","4H":"4h","1D":"1d",D:"1d","1W":"1w",W:"1w","1M":"1M",M:"1M"};class mc{constructor(t=5*60*1e3){It(this,"cache"),It(this,"cacheDuration"),this.cache=new Map,this.cacheDuration=t}generateKey(t){return Object.entries(t).filter(([i,r])=>r!==void 0).map(([i,r])=>`${i}:${r}`).join("|")}get(t){const i=this.generateKey(t),r=this.cache.get(i);return r?Date.now()-r.timestamp>this.cacheDuration?(this.cache.delete(i),null):r.data:null}set(t,i){const r=this.generateKey(t);this.cache.set(r,{data:i,timestamp:Date.now()})}clear(){this.cache.clear()}cleanup(){const t=Date.now();for(const[i,r]of this.cache.entries())t-r.timestamp>this.cacheDuration&&this.cache.delete(i)}}class dc{constructor(){It(this,"cacheManager"),this.cacheManager=new mc(5*60*1e3)}async getMarketDataInterval(t,i,r,n){try{const s=At[i.toUpperCase()];if(!s)return console.error(`Unsupported timeframe: ${i}`),[];const a={"1m":60*1e3,"3m":3*60*1e3,"5m":5*60*1e3,"15m":15*60*1e3,"30m":30*60*1e3,"1h":60*60*1e3,"2h":2*60*60*1e3,"4h":4*60*60*1e3,"1d":24*60*60*1e3,"1w":7*24*60*60*1e3,"1M":30*24*60*60*1e3};let o=[],u=r;const c=n,h=a[s];if(!h)return console.error(`Duration not defined for interval: ${s}`),[];for(;u<c;){const f=Math.min(u+1e3*h,c),d=await this.getMarketData(t,i,1e3,u,f);if(d.length===0)break;o=o.concat(d),u=d[d.length-1].closeTime+1}return o}catch(s){return console.error("Error in getMarketDataInterval:",s),[]}}async getMarketData(t,i,r,n,s){try{const a=s!==void 0,o={tickerId:t,timeframe:i,limit:r,sDate:n,eDate:s};if(a){const d=this.cacheManager.get(o);if(d)return d}const u=At[i.toUpperCase()];if(!u)return console.error(`Unsupported timeframe: ${i}`),[];if(this.shouldPaginate(i,r,n,s)&&n&&s){const d=await this.getMarketDataInterval(t,i,n,s),p=r?d.slice(0,r):d;return this.cacheManager.set(o,p),p}let c=`${Wi}/klines?symbol=${t}&interval=${u}`;r&&(c+=`&limit=${Math.min(r,1e3)}`),n&&(c+=`&startTime=${n}`),s&&(c+=`&endTime=${s}`);const h=await fetch(c);if(!h.ok)throw new Error(`HTTP error! status: ${h.status}`);const f=(await h.json()).map(d=>({openTime:parseInt(d[0]),open:parseFloat(d[1]),high:parseFloat(d[2]),low:parseFloat(d[3]),close:parseFloat(d[4]),volume:parseFloat(d[5]),closeTime:parseInt(d[6]),quoteAssetVolume:parseFloat(d[7]),numberOfTrades:parseInt(d[8]),takerBuyBaseAssetVolume:parseFloat(d[9]),takerBuyQuoteAssetVolume:parseFloat(d[10]),ignore:d[11]}));return a&&this.cacheManager.set(o,f),f}catch(a){return console.error("Error in binance.klines:",a),[]}}shouldPaginate(t,i,r,n){if(i&&i>1e3)return!0;if(r&&n){const s=At[t.toUpperCase()],a={"1m":60*1e3,"3m":3*60*1e3,"5m":5*60*1e3,"15m":15*60*1e3,"30m":30*60*1e3,"1h":60*60*1e3,"2h":2*60*60*1e3,"4h":4*60*60*1e3,"1d":24*60*60*1e3,"1w":7*24*60*60*1e3,"1M":30*24*60*60*1e3}[s];if(a)return Math.ceil((n-r)/a)>1e3}return!1}async getSymbolInfo(t){try{let i="crypto",r=Wi,n=t,s="";t.endsWith(".P")?(i="futures",n=t.replace(".P",""),r="https://fapi.binance.com/fapi/v1",s="Perpetual"):t.includes("_")&&(i="futures",n=t,r="https://dapi.binance.com/dapi/v1",s="Delivery");const a=i==="crypto"?`${r}/exchangeInfo?symbol=${n}`:`${r}/exchangeInfo`,o=await fetch(a);if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);const u=(await o.json()).symbols;if(!u||u.length===0)return console.error(`Symbol ${t} not found`),null;const c=i==="futures"?u.find(E=>E.symbol===n):u[0];if(!c)return console.error(`Symbol ${n} not found in exchange info`),null;const h=c.filters?.find(E=>E.filterType==="PRICE_FILTER"),f=c.filters?.find(E=>E.filterType==="LOT_SIZE"),d=h?parseFloat(h.tickSize):.01,p=f?parseFloat(f.minQty):0,g=Math.round(1/d),x=c.baseAsset,y=c.quoteAsset,S=s?` ${s}`:"",I=`${x} / ${y}${S}`;return{ticker:t,tickerid:`BINANCE:${t}`,prefix:"BINANCE",root:x,description:I,type:i,main_tickerid:`BINANCE:${t}`,current_contract:s,isin:"",basecurrency:x,currency:y,timezone:"Etc/UTC",country:"",mintick:d,pricescale:g,minmove:1,pointvalue:c.contractSize||1,mincontract:p,session:"24x7",volumetype:"base",expiration_date:c.deliveryDate||0,employees:0,industry:"",sector:"",shareholders:0,shares_outstanding_float:0,shares_outstanding_total:0,recommendations_buy:0,recommendations_buy_strong:0,recommendations_date:0,recommendations_hold:0,recommendations_sell:0,recommendations_sell_strong:0,recommendations_total:0,target_price_average:0,target_price_date:0,target_price_estimates:0,target_price_high:0,target_price_low:0,target_price_median:0}}catch(i){return console.error("Error in binance.exchangeInfo:",i),null}}}class gc{async getMarketData(){return[]}}const xc=typeof process<"u"&&process.versions&&process.versions.node;let nt=null;if(xc)try{nt=new gc}catch{nt=null}const yc={Binance:new dc,...nt?{Mock:nt}:{}};ve.Context=Et,ve.PineTS=kt,ve.Provider=yc,Object.defineProperty(ve,"__esModule",{value:!0})});
37
- ;var PineTS = PineTSLib.PineTS;PineTS.Provider = PineTSLib.Provider;PineTS.Context = PineTSLib.Context;
33
+ }`}function Es(e){z(e,null,{VariableDeclaration(t,i,r){t.declarations&&t.declarations.length>0&&t.declarations.forEach(s=>{if(s.init&&s.init.type==="ArrowFunctionExpression"&&s.init.start!==0){const n={type:"FunctionDeclaration",id:s.id,params:s.init.params,body:s.init.body.type==="BlockStatement"?s.init.body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:s.init.body}]},async:s.init.async,generator:!1};Object.assign(t,n)}}),t.body&&t.body.body&&t.body.body.forEach(s=>r(s,i))}})}function Ns(e,t){Lt(e,{VariableDeclaration(i){i.declarations.forEach(r=>{const s=r.init&&r.init.type==="MemberExpression"&&r.init.object&&(r.init.object.name==="context"||r.init.object.name===U||r.init.object.name==="context2"),n=r.init&&r.init.type==="MemberExpression"&&r.init.object?.object&&(r.init.object.object.name==="context"||r.init.object.object.name===U||r.init.object.object.name==="context2");(s||n)&&(r.id.name&&t.addContextBoundVar(r.id.name),r.id.properties&&r.id.properties.forEach(a=>{a.key.name&&t.addContextBoundVar(a.key.name)}))})}})}function Cs(e,t,i=!1){e.params.forEach(r=>{r.type==="Identifier"&&t.addContextBoundVar(r.name,i)})}function ks(e,t){e.params.forEach(i=>{i.type==="Identifier"&&t.addContextBoundVar(i.name,!1)})}function Is(e,t){let i;return Lt(e,{FunctionDeclaration(r){ks(r,t)},ArrowFunctionExpression(r){const s=r.start===0;s&&r.params&&r.params.length>0&&(i=r.params[0].name,r.params[0].name=U),Cs(r,t,s)},VariableDeclaration(r){r.declarations.forEach(s=>{if(s.id.type==="ArrayPattern"){const n=t.generateTempVar(),a={type:"VariableDeclaration",kind:r.kind,declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:n},init:s.init}]};s.id.elements?.forEach(h=>{h.type==="Identifier"&&t.addArrayPatternElement(h.name)});const o=s.id.elements.map((h,u)=>({type:"VariableDeclaration",kind:r.kind,declarations:[{type:"VariableDeclarator",id:h,init:{type:"MemberExpression",object:{type:"Identifier",name:n},property:{type:"Literal",value:u},computed:!0}}]}));Object.assign(r,{type:"BlockStatement",body:[a,...o]})}})},ForStatement(r){}}),i}const Ft={type:"Identifier",name:"undefined"};function Ae(e,t){if(e.computed&&e.property.type==="Identifier"){if(t.isLoopVariable(e.property.name)){if(e.object.type==="Identifier"&&!t.isLoopVariable(e.object.name)&&!t.isContextBound(e.object.name)){const[i,r]=t.getVariable(e.object.name),s=v.createContextVariableReference(r,i),n=v.createGetCall(s,e.property);Object.assign(e,n),e._indexTransformed=!0}return}if(!t.isContextBound(e.property.name)){const[i,r]=t.getVariable(e.property.name);e.property=v.createContextVariableReference(r,i),e.property=v.createGetCall(e.property,0)}}if(e.computed&&e.object.type==="Identifier"){if(t.isLoopVariable(e.object.name))return;if(!t.isContextBound(e.object.name)){const[i,r]=t.getVariable(e.object.name);e.object=v.createContextVariableReference(r,i)}if(e.property.type==="MemberExpression"){const i=e.property;i._indexTransformed||(Ae(i,t),i._indexTransformed=!0)}}}function Ne(e,t){const i=v.createGetCall(v.createIdentifier(e.name),0);e.start!==void 0&&(i.start=e.start),e.end!==void 0&&(i.end=e.end),i._indexTransformed=!0,Object.assign(e,i)}function te(e,t){if(e.name!==U){if(e.name==="na"&&!(e.parent&&e.parent.type==="CallExpression"&&e.parent.callee===e)){e.name="NaN";return}if(e.name==="Math"||e.name==="NaN"||e.name==="undefined"||e.name==="Infinity"||e.name==="null"||e.name.startsWith("'")&&e.name.endsWith("'")||e.name.startsWith('"')&&e.name.endsWith('"')||e.name.startsWith("`")&&e.name.endsWith("`")||t.isLoopVariable(e.name))return;let i=!1;if(e.parent&&e.parent.type==="CallExpression"&&e.parent.arguments.includes(e)){const g=e.parent.callee;if(g.type==="MemberExpression"&&g.object&&g.object.name===U&&["get","set","init","param"].includes(g.property.name))e.parent.arguments.indexOf(e)===0&&(i=!0);else{const p=g.type==="MemberExpression"&&g.object&&g.object.type==="Identifier"&&et.includes(g.object.name);g.type==="MemberExpression"&&!p?i=!1:i=!0}}const r=e.parent&&e.parent.type==="MemberExpression"&&e.parent.object===e&&t.isContextBound(e.name),s=e.parent&&e.parent.type==="CallExpression"&&e.parent.callee&&e.parent.callee.type==="MemberExpression"&&e.parent.callee.property.name==="param";e.parent&&e.parent.type==="AssignmentExpression"&&e.parent.left;const n=e.parent&&e.parent.type==="CallExpression"&&e.parent.callee===e,a=e.parent&&e.parent.type==="MemberExpression"&&e.parent.computed&&e.parent.object===e,o=e.parent&&e.parent.type==="MemberExpression"&&e.parent.computed&&e.parent.property===e&&e.parent.parent&&e.parent.parent.type==="CallExpression"&&e.parent.parent.callee&&e.parent.parent.callee.type==="MemberExpression"&&t.isContextBound(e.parent.parent.callee.object.name);if(r||s||i||o||n){if(n||t.isLocalSeriesVar(e.name)||t.isContextBound(e.name)&&!t.isRootParam(e.name))return;const[g,p]=t.getVariable(e.name),x=v.createContextVariableReference(p,g);Object.assign(e,x);return}const h=t.isContextBound(e.name)&&!t.isRootParam(e.name);if(h&&!(e.parent&&e.parent.type==="CallExpression"&&e.parent.arguments.includes(e)))return;if(t.isLocalSeriesVar(e.name)){if(!a){const g=v.createIdentifier(e.name),p=v.createGetCall(g,0);Object.assign(e,p)}return}const[u,l]=t.getVariable(e.name);let f;if(h)f=v.createIdentifier(e.name);else{if(u===e.name&&!t.isContextBound(e.name))return;f=v.createContextVariableReference(l,u)}if(a)Object.assign(e,f);else{const g=v.createGetCall(f,0);Object.assign(e,g)}}}function le(e,t,i){if(e.object&&e.object.type==="Identifier"&&e.object.name==="Math")return;if(e.object&&e.object.type==="Identifier"&&et.includes(e.object.name)&&i.isContextBound(e.object.name)&&!e.computed){const h=e.parent&&e.parent.type==="CallExpression"&&e.parent.callee===e,u=e.parent&&(e.parent.type==="VariableDeclarator"||e.parent.type==="Property"||e.parent.type==="AssignmentExpression");if(!h&&!u){const l={type:"CallExpression",callee:{type:"MemberExpression",object:e.object,property:e.property,computed:!1},arguments:[],_transformed:!1};e.start!==void 0&&(l.start=e.start),e.end!==void 0&&(l.end=e.end),Object.assign(e,l);return}}const r=i.getCurrentScopeType()=="if",s=i.getCurrentScopeType()=="els",n=i.getCurrentScopeType()=="for";if(!r&&!s&&!n&&e.object&&e.object.type==="Identifier"&&i.isContextBound(e.object.name)&&!i.isRootParam(e.object.name)&&!e.computed)return;e._indexTransformed||(Ae(e,i),e._indexTransformed=!0);const a=e.object&&e.object.type==="MemberExpression"&&e.object.object&&e.object.object.type==="MemberExpression"&&e.object.object.object&&e.object.object.object.name===U,o=e.object&&e.object.type==="Identifier"&&i.isContextBound(e.object.name);if(e.computed&&(a||o)){if(e.parent&&e.parent.type==="AssignmentExpression"&&e.parent.left===e)return;const h=v.createGetCall(e.object,e.property);e.start&&(h.start=e.start),e.end&&(h.end=e.end),Object.assign(e,h),delete e.object,delete e.property,delete e.computed}}function tt(e,t){if(e.type==="Identifier"){if(e.name==="na")return e.name="NaN",e;if(t.isLoopVariable(e.name))return e;if(t.isRootParam(e.name)){const[s,n]=t.getVariable(e.name);return v.createContextVariableReference(n,s)}if(t.isContextBound(e.name)||t.isLocalSeriesVar(e.name))return e;const[i,r]=t.getVariable(e.name);return i===e.name&&!t.isContextBound(e.name)?e:v.createContextVariableReference(r,i)}return e}function Pe(e,t,i=""){switch(e.type){case"BinaryExpression":return jt(e,t,i);case"MemberExpression":return{type:"MemberExpression",object:e.object.type==="Identifier"?tt(e.object,t):e.object,property:e.property,computed:e.computed};case"Identifier":{if(t.isLoopVariable(e.name)||e.parent&&e.parent.type==="MemberExpression"&&e.parent.property===e)return e;const r=tt(e,t);return r.type==="Identifier"&&(r.name==="NaN"||r.name==="undefined"||r.name==="Infinity"||r.name==="null"||r.name==="Math")?r:v.createGetCall(r,0)}case"UnaryExpression":return $t(e,t,i);case"ConditionalExpression":{const r=Pe(e.test,t,i),s=Pe(e.consequent,t,i),n=Pe(e.alternate,t,i);return{type:"ConditionalExpression",test:r,consequent:s,alternate:n,start:e.start,end:e.end}}}return e}function jt(e,t,i){const r=Pe(e.left,t,i),s=Pe(e.right,t,i),n={type:"BinaryExpression",operator:e.operator,left:r,right:s,start:e.start,end:e.end};return z(n,t,{CallExpression(a,o){a._transformed||pe(a,o)},MemberExpression(a){le(a,"",t)}}),n}function Qi(e,t,i){const r=Pe(e.left,t,i),s=Pe(e.right,t,i),n={type:"LogicalExpression",operator:e.operator,left:r,right:s,start:e.start,end:e.end};return z(n,t,{CallExpression(a,o){a._transformed||pe(a,o)}}),n}function Xi(e,t,i){z(e,{parent:e,inNamespaceCall:!1},{Identifier(a,o,h){if(a.name=="NaN")return;if(a.name=="na"){a.name="NaN";return}a.parent=o.parent,te(a,t);const u=a.parent&&a.parent.type==="BinaryExpression";(a.parent&&a.parent.type==="ConditionalExpression"||u)&&(a.type==="MemberExpression"?Ae(a,t):a.type==="Identifier"&&(a.parent&&a.parent.type==="CallExpression"&&a.parent.callee&&a.parent.callee.object&&a.parent.callee.object.name===U&&a.parent.callee.property.name==="get"||Ne(a)))},MemberExpression(a,o,h){Ae(a,t),a.object&&h(a.object,{parent:a,inNamespaceCall:o.inNamespaceCall})},ConditionalExpression(a,o,h){const u={...o,parent:a};a.test&&h(a.test,u),a.consequent&&h(a.consequent,u),a.alternate&&h(a.alternate,u)},BinaryExpression(a,o,h){const u={...o,parent:a};h(a.left,u),h(a.right,u)},LogicalExpression(a,o,h){const u={...o,parent:a};h(a.left,u),h(a.right,u)},UnaryExpression(a,o,h){const u={...o,parent:a};h(a.argument,u)},CallExpression(a,o,h){const u=a.callee&&a.callee.type==="MemberExpression"&&a.callee.object&&a.callee.object.type==="Identifier"&&t.isContextBound(a.callee.object.name);pe(a,t),a.arguments.forEach(l=>h(l,{parent:a,inNamespaceCall:u||o.inNamespaceCall}))}});const r=v.createMemberExpression(v.createIdentifier(i),v.createIdentifier("param")),s=t.generateParamId(),n={type:"CallExpression",callee:r,arguments:[e,Ft,{type:"Identifier",name:`'${s}'`}],_transformed:!0,_isParamCall:!0};if(!t.shouldSuppressHoisting()){const a=s;t.addLocalSeriesVar(a);const o=v.createVariableDeclaration(a,n);return t.addHoistedStatement(o),v.createIdentifier(a)}return n}function $t(e,t,i){const r=Pe(e.argument,t,i);return{type:"UnaryExpression",operator:e.operator,prefix:e.prefix,argument:r,start:e.start,end:e.end}}function Wt(e,t,i){switch(e?.type){case"BinaryExpression":e=jt(e,i,t);break;case"LogicalExpression":e=Qi(e,i,t);break;case"ConditionalExpression":return Xi(e,i,t);case"UnaryExpression":e=$t(e,i,t);break;case"ArrayExpression":e.elements=e.elements.map(o=>{if(o.type==="Identifier"){if(i.isContextBound(o.name)&&!i.isRootParam(o.name))return o;const[h,u]=i.getVariable(o.name);return v.createContextVariableAccess0(u,h)}return o});break}if(e.type==="MemberExpression"&&e.computed&&e.property){e.object.type==="CallExpression"?pe(e.object,i):e.object.type==="MemberExpression"?le(e.object,"",i):e.object.type==="BinaryExpression"?e.object=jt(e.object,i,t):e.object.type==="LogicalExpression"?e.object=Qi(e.object,i,t):e.object.type==="ConditionalExpression"?e.object=Xi(e.object,i,t):e.object.type==="UnaryExpression"&&(e.object=$t(e.object,i,t));const o=e.object.type==="Identifier"&&i.isContextBound(e.object.name)&&!i.isRootParam(e.object.name)?e.object:tt(e.object,i),h=e.property.type==="Identifier"&&!i.isContextBound(e.property.name)&&!i.isLoopVariable(e.property.name)?tt(e.property,i):e.property,u=v.createMemberExpression(v.createIdentifier(t),v.createIdentifier("param")),l=i.generateParamId(),f={type:"CallExpression",callee:u,arguments:[o,h,{type:"Identifier",name:`'${l}'`}],_transformed:!0,_isParamCall:!0};if(!i.shouldSuppressHoisting()){const g=l;i.addLocalSeriesVar(g);const p=v.createVariableDeclaration(g,f);return i.addHoistedStatement(p),v.createIdentifier(g)}return f}if(e.type==="ObjectExpression"&&(e.properties=e.properties.map(o=>{if(o.value.name){if(i.isContextBound(o.value.name)&&!i.isRootParam(o.value.name))return{type:"Property",key:{type:"Identifier",name:o.key.name},value:v.createIdentifier(o.value.name),kind:"init",method:!1,shorthand:!1,computed:!1};const[h,u]=i.getVariable(o.value.name);return{type:"Property",key:{type:"Identifier",name:o.key.name},value:v.createContextVariableReference(u,h),kind:"init",method:!1,shorthand:!1,computed:!1}}else o.value.type!=="Literal"&&(o.value=Wt(o.value,t,i));return o})),e.type==="Identifier"){if(e.name==="na")return e.name="NaN",e;if(i.isContextBound(e.name)&&!i.isRootParam(e.name)){const o=v.createMemberExpression(v.createIdentifier(t),v.createIdentifier("param")),h=i.generateParamId(),u={type:"CallExpression",callee:o,arguments:[e,Ft,{type:"Identifier",name:`'${h}'`}],_transformed:!0,_isParamCall:!0};if(!i.shouldSuppressHoisting()){const l=h;i.addLocalSeriesVar(l);const f=v.createVariableDeclaration(l,u);return i.addHoistedStatement(f),v.createIdentifier(l)}return u}}e?.type==="CallExpression"&&pe(e,i);const r=v.createMemberExpression(v.createIdentifier(t),v.createIdentifier("param")),s=e.type==="Identifier"?tt(e,i):e,n=i.generateParamId(),a={type:"CallExpression",callee:r,arguments:[s,Ft,{type:"Identifier",name:`'${n}'`}],_transformed:!0,_isParamCall:!0};if(!i.shouldSuppressHoisting()){const o=n;i.addLocalSeriesVar(o);const h=v.createVariableDeclaration(o,a);return i.addHoistedStatement(h),v.createIdentifier(o)}return a}function pe(e,t,i){if(e._transformed)return;e.callee&&e.callee.type==="Identifier"&&(et.includes(e.callee.name)||gs.includes(e.callee.name))&&t.isContextBound(e.callee.name)&&(e.callee=v.createMemberExpression(e.callee,v.createIdentifier("any")));const r=e.callee&&e.callee.type==="MemberExpression"&&e.callee.object&&e.callee.object.type==="Identifier"&&(t.isContextBound(e.callee.object.name)||e.callee.object.name==="math"||e.callee.object.name==="ta");if(r){if(e.callee.object.name===U&&["get","init","param"].includes(e.callee.property.name))return;const s=e.callee.object.name,n=[];e.arguments.forEach(l=>{if(l._isParamCall){n.push(l);return}n.push(Wt(l,s,t))}),e.arguments=n,s==="ta"&&e.arguments.push(t.getNextTACallId());const a=e.callee.property.name,o=`${s}.${a}`,h=xs.includes(o),u=e._insideAwait===!0;if(h&&!u){const l=Object.assign({},e),f=v.createAwaitExpression(l);Object.assign(e,f)}if(!t.shouldSuppressHoisting()){const l=t.generateTempVar();t.addLocalSeriesVar(l);const f=e._insideAwait===!0;let g=Object.assign({},e);f&&(g=v.createAwaitExpression(g));const p=v.createVariableDeclaration(l,g);t.addHoistedStatement(p);const x=v.createIdentifier(l);Object.assign(e,x),e._wasHoisted=!0,e._wasInsideAwait=f;return}e._transformed=!0}else e.callee&&e.callee.type==="Identifier"&&(e.arguments=e.arguments.map(s=>s._isParamCall?s:Wt(s,U,t)),e._transformed=!0);!r&&e.callee&&e.callee.type==="MemberExpression"&&e.callee.object.type==="Identifier"&&te(e.callee.object,t),e.arguments.forEach(s=>{z(s,{parent:e},{Identifier(n,a,o){n.parent=a.parent,te(n,t);const h=n.parent&&n.parent.type==="BinaryExpression";(n.parent&&n.parent.type==="ConditionalExpression"||h)&&(n.type==="MemberExpression"?Ae(n,t):n.type==="Identifier"&&(n.parent&&n.parent.type==="CallExpression"&&n.parent.callee&&n.parent.callee.object&&n.parent.callee.object.name===U&&n.parent.callee.property.name==="get"||Ne(n)))},BinaryExpression(n,a,o){const h={...a,parent:n};o(n.left,h),o(n.right,h)},LogicalExpression(n,a,o){const h={...a,parent:n};o(n.left,h),o(n.right,h)},UnaryExpression(n,a,o){const h={...a,parent:n};o(n.argument,h)},CallExpression(n,a,o){n._transformed||pe(n,t)},MemberExpression(n,a,o){le(n,"",t),n.object&&o(n.object,{parent:n})}})})}function Zi(e,t){let i=null;if(e.left.type==="Identifier"){const[r,s]=t.getVariable(e.left.name);i=v.createContextVariableReference(s,r)}else if(e.left.type==="MemberExpression"&&e.left.computed&&e.left.object.type==="Identifier"){const r=e.left.object.name,[s,n]=t.getVariable(r),a=s!==r,o=t.isContextBound(r);(a||o)&&!t.isLoopVariable(r)&&e.left.property.type==="Literal"&&e.left.property.value===0&&(i=v.createContextVariableReference(n,s))}if(z(e.right,{parent:e.right,inNamespaceCall:!1},{Identifier(r,s,n){r.name=="na"&&(r.name="NaN"),r.parent=s.parent,te(r,t);const a=r.parent&&r.parent.type==="BinaryExpression",o=r.parent&&r.parent.type==="ConditionalExpression",h=t.isContextBound(r.name)&&!t.isRootParam(r.name),u=r.parent&&r.parent.type==="MemberExpression"&&r.parent.computed&&r.parent.object===r,l=r.parent&&r.parent._isParamCall,f=r.parent&&r.parent.type==="MemberExpression",g=r.name==="NaN",p=r.parent&&r.parent.type==="CallExpression"&&r.parent.callee&&r.parent.callee.object&&r.parent.callee.object.name===U&&r.parent.callee.property.name==="get";(h||o||a)&&(r.type==="MemberExpression"?Ae(r,t):r.type==="Identifier"&&!f&&!u&&!l&&!g&&!p&&Ne(r))},MemberExpression(r,s,n){le(r,"",t),r.type==="CallExpression"?r.arguments.forEach(a=>n(a,{parent:r,inNamespaceCall:s.inNamespaceCall})):r.object&&n(r.object,{parent:r,inNamespaceCall:s.inNamespaceCall})},CallExpression(r,s,n){const a=r.callee&&r.callee.type==="MemberExpression"&&r.callee.object&&r.callee.object.type==="Identifier"&&t.isContextBound(r.callee.object.name);pe(r,t),r.type==="CallExpression"&&r.arguments.forEach(o=>n(o,{parent:r,inNamespaceCall:a||s.inNamespaceCall}))}}),i){let r=e.right;if(e.operator!=="="){const n=e.operator.replace("=",""),a=v.createGetCall(i,0);r={type:"BinaryExpression",operator:n,left:a,right:e.right,start:e.start,end:e.end}}const s=v.createSetCall(i,r);e.start&&(s.start=e.start),e.end&&(s.end=e.end),Object.assign(e,s)}}function Ji(e,t){e.declarations.forEach(i=>{i.init.name=="na"&&(i.init.name="NaN");const r=i.init&&i.init.type==="MemberExpression"&&i.init.object&&(i.init.object.name==="context"||i.init.object.name===U||i.init.object.name==="context2"),s=i.init&&i.init.type==="MemberExpression"&&i.init.object?.object&&(i.init.object.object.name==="context"||i.init.object.object.name===U||i.init.object.object.name==="context2"),n=i.init&&i.init.type==="ArrowFunctionExpression";if(r){i.id.name&&t.addContextBoundVar(i.id.name),i.id.properties&&i.id.properties.forEach(p=>{p.key.name&&t.addContextBoundVar(p.key.name)}),i.init.object.name=U;return}if(s){i.id.name&&t.addContextBoundVar(i.id.name),i.id.properties&&i.id.properties.forEach(p=>{p.key.name&&t.addContextBoundVar(p.key.name)}),i.init.object.object.name=U;return}n&&i.init.params.forEach(p=>{p.type==="Identifier"&&t.addContextBoundVar(p.name)});const a=t.addVariable(i.id.name,e.kind),o=e.kind,h=t.isArrayPatternElement(i.id.name);i.init&&!n&&!h&&(i.init.type==="CallExpression"&&i.init.callee.type==="MemberExpression"&&i.init.callee.object&&i.init.callee.object.type==="Identifier"&&t.isContextBound(i.init.callee.object.name)?pe(i.init,t):z(i.init,{parent:i.init},{Identifier(p,x){p.parent=x.parent,te(p,t);const y=p.parent&&p.parent.type==="BinaryExpression",w=p.parent&&p.parent.type==="UnaryExpression",E=p.parent&&p.parent.type==="ConditionalExpression",A=p.parent&&p.parent.type==="CallExpression"&&p.parent.callee&&p.parent.callee.object&&p.parent.callee.object.name===U&&p.parent.callee.property.name==="get";p.type==="Identifier"&&(y||w||E)&&!A&&Ne(p)},CallExpression(p,x,y){p.callee.type==="Identifier"&&(p.callee.parent=p),p.arguments.forEach(w=>{w.type==="Identifier"&&(w.parent=p)}),pe(p,t),p.type==="CallExpression"&&p.arguments.forEach(w=>y(w,{parent:p}))},BinaryExpression(p,x,y){p.left.type==="Identifier"&&(p.left.parent=p),p.right.type==="Identifier"&&(p.right.parent=p),y(p.left,{parent:p}),y(p.right,{parent:p})},MemberExpression(p,x,y){p.object&&p.object.type==="Identifier"&&(p.object.parent=p),p.property&&p.property.type==="Identifier"&&(p.property.parent=p),le(p,"",t),p.type==="CallExpression"?p.arguments.forEach(w=>y(w,{parent:p})):p.object&&y(p.object,{parent:p})},AwaitExpression(p,x,y){p.argument&&(p.argument._insideAwait=!0,y(p.argument,{parent:p}),p.argument.type==="Identifier"&&p.argument._wasInsideAwait&&Object.assign(p,p.argument))}}));const u=v.createContextVariableReference(o,a),l=!h&&i.init&&i.init.type==="MemberExpression"&&i.init.computed&&i.init.property&&(i.init.property.type==="Literal"||i.init.property.type==="MemberExpression");i.init?.property?.type==="MemberExpression"&&(i.init.property._indexTransformed||(Ae(i.init.property,t),i.init.property._indexTransformed=!0));let f;i.init?n||h?f=i.init:o==="var"?f=v.createInitVarCall(u,i.init):f=v.createInitCall(u,l?i.init.object:i.init,l?i.init.property:void 0):f=v.createIdentifier("undefined");const g=v.createExpressionStatement(v.createAssignmentExpression(u,f));if(h){const p=i.init.object.name,[x,y]=t.getVariable(p),w=v.createContextVariableReference(y,x),E=i.init.property.value,A={type:"MemberExpression",object:v.createGetCall(w,0),property:{type:"Literal",value:E},computed:!0};g.expression.right=v.createCallExpression(v.createMemberExpression(v.createContextIdentifier(),v.createIdentifier("init")),[u,A])}n&&(t.pushScope("fn"),z(i.init.body,t,{BlockStatement(p,x,y){p.body.forEach(w=>y(w,x))},IfStatement(p,x,y){x.pushScope("if"),y(p.consequent,x),p.alternate&&(x.pushScope("els"),y(p.alternate,x),x.popScope()),x.popScope()},VariableDeclaration(p,x){Ji(p,x)},Identifier(p,x){te(p,x)},AssignmentExpression(p,x){Zi(p,x)}}),t.popScope()),Object.assign(e,g)})}function As(e,t,i){if(t.setSuppressHoisting(!0),e.init&&e.init.type==="VariableDeclaration"){const r=e.init.declarations[0],s=r.id.name;t.addLoopVariable(s,s),e.init={type:"VariableDeclaration",kind:e.init.kind,declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:s},init:r.init}]},r.init&&z(r.init,t,{Identifier(n,a){t.isLoopVariable(n.name)||(t.pushScope("for"),te(n,a),t.popScope())},MemberExpression(n){t.pushScope("for"),le(n,"",t),t.popScope()}})}e.test&&z(e.test,t,{Identifier(r,s){!t.isLoopVariable(r.name)&&!r.computed&&(t.pushScope("for"),te(r,s),r.type==="Identifier"&&(r.computed=!0,Ne(r)),t.popScope())},MemberExpression(r){t.pushScope("for"),le(r,"",t),t.popScope()}}),e.update&&z(e.update,t,{Identifier(r,s){t.isLoopVariable(r.name)||(t.pushScope("for"),te(r,s),t.popScope())}}),t.setSuppressHoisting(!1),t.pushScope("for"),i(e.body,t),t.popScope()}function Ps(e,t){z(e,t,{MemberExpression(i){le(i,"",t)},CallExpression(i,r){pe(i,r)},Identifier(i,r){te(i,r);const s=t.getCurrentScopeType()==="if";t.isContextBound(i.name)&&!t.isRootParam(i.name)&&s&&Ne(i)}})}function Ts(e,t,i){e.test&&(t.pushScope("if"),Ps(e.test,t),t.popScope()),t.pushScope("if"),i(e.consequent,t),t.popScope(),e.alternate&&(t.pushScope("els"),i(e.alternate,t),t.popScope())}function Rs(e,t){const i=t.getCurrentScopeType();if(e.argument&&(e.argument.type==="ArrayExpression"?(e.argument.elements=e.argument.elements.map(r=>{if(r.type==="Identifier"){if(t.isContextBound(r.name)&&!t.isRootParam(r.name))return v.createGetCall(r,0);const[s,n]=t.getVariable(r.name);return v.createContextVariableAccess0(n,s)}else if(r.type==="MemberExpression")return r.object&&r.object.type==="MemberExpression"&&r.object.object&&r.object.object.type==="Identifier"&&r.object.object.name==="$"&&r.object.property&&["const","let","var","params"].includes(r.object.property.name)?v.createGetCall(r,0):(r.computed&&r.object.type==="Identifier"&&t.isContextBound(r.object.name)&&!t.isRootParam(r.object.name)||le(r,"",t),r);return r}),e.argument={type:"ArrayExpression",elements:[e.argument]}):e.argument.type==="BinaryExpression"?z(e.argument,t,{Identifier(r,s){te(r,s),r.type==="Identifier"&&Ne(r)},MemberExpression(r){le(r,"",t)}}):e.argument.type==="ObjectExpression"?e.argument.properties=e.argument.properties.map(r=>{if(r.shorthand){if(t.isContextBound(r.value.name))return r;const[s,n]=t.getVariable(r.value.name);return{type:"Property",key:v.createIdentifier(r.key.name),value:v.createContextVariableReference(n,s),kind:"init",method:!1,shorthand:!1,computed:!1}}if(r.value&&r.value.type==="Identifier"&&!(t.isContextBound(r.value.name)&&!t.isRootParam(r.value.name))&&!t.isContextBound(r.value.name)){const[s,n]=t.getVariable(r.value.name);r.value=v.createContextVariableReference(n,s)}return r}):e.argument.type==="Identifier"&&(te(e.argument,t),e.argument.type==="Identifier"&&Ne(e.argument)),i==="fn")){e.argument.type==="Identifier"&&t.isContextBound(e.argument.name)&&!t.isRootParam(e.argument.name)?e.argument=v.createArrayAccess(e.argument,0):e.argument.type==="MemberExpression"?e.argument.object.type==="Identifier"&&t.isContextBound(e.argument.object.name)&&!t.isRootParam(e.argument.object.name)&&(e.argument._indexTransformed||(Ae(e.argument,t),e.argument._indexTransformed=!0)):(e.argument.type==="BinaryExpression"||e.argument.type==="LogicalExpression"||e.argument.type==="ConditionalExpression"||e.argument.type==="CallExpression")&&z(e.argument,t,{Identifier(s,n){te(s,n),s.type==="Identifier"&&!s._arrayAccessed&&(Ne(s),s._arrayAccessed=!0)},MemberExpression(s){le(s,"",t)},CallExpression(s,n){pe(s,n)}});const r=v.createCallExpression(v.createMemberExpression(v.createContextIdentifier(),v.createIdentifier("precision")),[e.argument]);e.argument=r}}function Ds(e,t,i){e.body&&e.body.type==="BlockStatement"&&(t.pushScope("fn"),i(e.body,t),t.popScope())}function Vs(e){const t={...b,LineComment:()=>{}};Lt(e,{BinaryExpression(i){if(i.operator==="=="||i.operator==="==="){const r=i.left,s=i.right,n=v.createMathEqCall(r,s);n._transformed=!0,Object.assign(i,n)}}},t)}function Os(e,t,i,r={debug:!1,ln:!1},s=[]){const n=a=>{if(!r.debug||!a.loc||!s.length)return null;const o=a.loc.start.line-1;if(o>=0&&o<s.length){const h=s[o].trim();if(h)return{type:"LineComment",value:`${r.ln?` [Line ${a.loc.start.line}]`:""} ${h}`}}return null};z(e,t,{Program(a,o,h){const u=[];a.body.forEach(l=>{o.enterHoistingScope(),h(l,o);const f=o.exitHoistingScope(),g=n(l);g&&u.push(g),u.push(...f),u.push(l)}),a.body=u},BlockStatement(a,o,h){const u=[];a.body.forEach(l=>{o.enterHoistingScope(),h(l,o);const f=o.exitHoistingScope(),g=n(l);g&&u.push(g),u.push(...f),u.push(l)}),a.body=u},ReturnStatement(a,o){Rs(a,o)},VariableDeclaration(a,o){Ji(a,o)},Identifier(a,o){te(a,o)},CallExpression(a,o){pe(a,o)},MemberExpression(a,o){le(a,i,o)},AssignmentExpression(a,o){Zi(a,o)},FunctionDeclaration(a,o,h){Ds(a,o,h)},ForStatement(a,o,h){As(a,o,h)},IfStatement(a,o,h){Ts(a,o,h)},AwaitExpression(a,o,h){a.argument&&(a.argument._insideAwait=!0,h(a.argument,o),a.argument.type==="Identifier"&&a.argument._wasInsideAwait===!0&&(a.type="Identifier",a.name=a.argument.name,a.argument._wasHoisted&&(a._wasHoisted=a.argument._wasHoisted),delete a.argument))}})}const m={NUMBER:"NUMBER",STRING:"STRING",BOOLEAN:"BOOLEAN",IDENTIFIER:"IDENTIFIER",KEYWORD:"KEYWORD",OPERATOR:"OPERATOR",LPAREN:"LPAREN",RPAREN:"RPAREN",LBRACKET:"LBRACKET",RBRACKET:"RBRACKET",LBRACE:"LBRACE",RBRACE:"RBRACE",COMMA:"COMMA",DOT:"DOT",COLON:"COLON",SEMICOLON:"SEMICOLON",INDENT:"INDENT",DEDENT:"DEDENT",NEWLINE:"NEWLINE",COMMENT:"COMMENT",EOF:"EOF"},Ms=new Set(["if","else","for","while","switch","break","continue","var","varip","type","and","or","not","to","by","in","import","export","method","extends"]),Ls=["==","!=","<=",">=",":=","+=","-=","*=","/=","%=","=>","//","and","or","not"];class Bs{constructor(t,i,r,s,n=0){this.type=t,this.value=i,this.line=r,this.column=s,this.indent=n}toString(){return`Token(${this.type}, ${JSON.stringify(this.value)}, ${this.line}:${this.column}, indent=${this.indent})`}}var Fs=Object.defineProperty,js=(e,t,i)=>t in e?Fs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,be=(e,t,i)=>js(e,typeof t!="symbol"?t+"":t,i);class $s{constructor(t){be(this,"source"),be(this,"pos"),be(this,"line"),be(this,"column"),be(this,"tokens"),be(this,"indentStack"),be(this,"atLineStart"),be(this,"parenDepth"),be(this,"bracketDepth"),be(this,"braceDepth"),this.source=t,this.pos=0,this.line=1,this.column=1,this.tokens=[],this.indentStack=[0],this.atLineStart=!0,this.parenDepth=0,this.bracketDepth=0,this.braceDepth=0}tokenize(){for(;this.pos<this.source.length;){const t=this.peek();if(t==="\r"){this.advance();continue}if(t===`
34
+ `){this.handleNewline();continue}if(this.atLineStart&&t!==`
35
+ `){this.handleIndentation(),this.atLineStart=!1;continue}if(t===" "||t===" "){this.advance();continue}if(this.pos>=this.source.length)break;if(t==="/"&&this.peek(1)==="/"){this.readComment();continue}if(t==='"'||t==="'"){this.readString();continue}if(t==="#"){this.readColorLiteral();continue}if(this.isDigit(t)){this.readNumber();continue}if(this.isIdentifierStart(t)){this.readIdentifier();continue}if(!this.readOperatorOrPunctuation())throw new Error(`Unexpected character '${t}' at ${this.line}:${this.column}`)}for(;this.indentStack.length>1;)this.indentStack.pop(),this.addToken(m.DEDENT,"",this.getCurrentIndent());return this.addToken(m.EOF,""),this.tokens}handleNewline(){this.parenDepth===0&&this.bracketDepth===0&&this.braceDepth===0&&(this.addToken(m.NEWLINE,`
36
+ `),this.atLineStart=!0),this.advance(),this.line++,this.column=1}handleIndentation(){let t=0,i=0;for(this.pos;this.pos<this.source.length;){const s=this.peek();if(s===" ")i++,this.advance();else if(s===" ")t++,this.advance();else break}if(this.peek()===`
37
+ `||this.peek()==="\0")return;t+=Math.floor(i/4);const r=this.indentStack[this.indentStack.length-1];if(t>r)this.indentStack.push(t),this.addToken(m.INDENT,"",t);else if(t<r){for(;this.indentStack.length>1&&this.indentStack[this.indentStack.length-1]>t;)this.indentStack.pop(),this.addToken(m.DEDENT,"",this.indentStack[this.indentStack.length-1]);if(this.indentStack[this.indentStack.length-1]!==t)throw new Error(`Indentation error at ${this.line}:${this.column} - misaligned dedent`)}}readComment(){this.column;let t="";for(this.advance(),this.advance();this.pos<this.source.length&&this.peek()!==`
38
+ `;)t+=this.advance();this.addToken(m.COMMENT,t.trim())}readString(){const t=this.advance(),i=this.column-1;let r="";for(;this.pos<this.source.length&&this.peek()!==t;)if(this.peek()==="\\"){this.advance();const s=this.advance();switch(s){case"n":r+=`
39
+ `;break;case"t":r+=" ";break;case"r":r+="\r";break;case"\\":r+="\\";break;case t:r+=t;break;default:r+=s}}else r+=this.advance();if(this.peek()!==t)throw new Error(`Unterminated string at ${this.line}:${i}`);this.advance(),this.addToken(m.STRING,r)}readColorLiteral(){const t=this.column;let i="#";for(this.advance();this.pos<this.source.length&&i.length<9;){const r=this.peek();if(r>="0"&&r<="9"||r>="A"&&r<="F"||r>="a"&&r<="f")i+=this.advance();else break}if(i.length!==7&&i.length!==9)throw new Error(`Invalid color literal '${i}' at ${this.line}:${t}`);this.addToken(m.STRING,i)}readNumber(){this.column;let t="",i=!1;for(;this.pos<this.source.length;){const r=this.peek();if(this.isDigit(r))t+=this.advance();else if(r==="."&&!i){const s=this.peek(1);if(this.isDigit(s)||!this.isIdentifierStart(s)){if(i=!0,t+=this.advance(),!this.isDigit(this.peek()))break}else break}else break}this.addToken(m.NUMBER,parseFloat(t))}readIdentifier(){this.column;let t="";for(;this.pos<this.source.length&&this.isIdentifierChar(this.peek());)t+=this.advance();Ms.has(t)?this.addToken(m.KEYWORD,t):t==="true"||t==="false"?this.addToken(m.BOOLEAN,t==="true"):this.addToken(m.IDENTIFIER,t)}readOperatorOrPunctuation(){const t=this.peek(),i=this.peek(1),r=t+i;if(Ls.includes(r))return this.advance(),this.advance(),this.addToken(m.OPERATOR,r),!0;if("+-*/%<>=!?".includes(t))return this.advance(),this.addToken(m.OPERATOR,t),!0;switch(t){case"(":return this.parenDepth++,this.advance(),this.addToken(m.LPAREN,t),!0;case")":return this.parenDepth--,this.advance(),this.addToken(m.RPAREN,t),!0;case"[":return this.bracketDepth++,this.advance(),this.addToken(m.LBRACKET,t),!0;case"]":return this.bracketDepth--,this.advance(),this.addToken(m.RBRACKET,t),!0;case"{":return this.braceDepth++,this.advance(),this.addToken(m.LBRACE,t),!0;case"}":return this.braceDepth--,this.advance(),this.addToken(m.RBRACE,t),!0;case",":return this.advance(),this.addToken(m.COMMA,t),!0;case".":return this.advance(),this.addToken(m.DOT,t),!0;case":":return this.advance(),this.addToken(m.COLON,t),!0;case";":return this.advance(),this.addToken(m.SEMICOLON,t),!0}return!1}peek(t=0){const i=this.pos+t;return i<this.source.length?this.source[i]:"\0"}advance(){const t=this.source[this.pos++];return this.column++,t}skipWhitespaceInline(){if(!this.atLineStart)for(;this.pos<this.source.length&&(this.peek()===" "||this.peek()===" ");)this.advance()}isDigit(t){return t>="0"&&t<="9"}isIdentifierStart(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"||t==="_"}isIdentifierChar(t){return this.isIdentifierStart(t)||this.isDigit(t)}getCurrentIndent(){return this.indentStack[this.indentStack.length-1]}addToken(t,i,r=null){const s=new Bs(t,i,this.line,this.column,r!==null?r:this.getCurrentIndent());this.tokens.push(s)}}var Ws=Object.defineProperty,qs=(e,t,i)=>t in e?Ws(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,se=(e,t,i)=>qs(e,typeof t!="symbol"?t+"":t,i);class B{constructor(t){this.type=t}}class Us extends B{constructor(t){super("Program"),this.body=t}}class fe extends B{constructor(t){super("ExpressionStatement"),this.expression=t}}var De=(e=>(e.VAR="var",e.LET="let",e.CONST="const",e))(De||{});class Ve extends B{constructor(t,i="let"){super("VariableDeclaration"),this.declarations=t,this.kind=i}}class Oe extends B{constructor(t,i,r=null){super("VariableDeclarator"),this.id=t,this.init=i,this.varType=r}}class er extends B{constructor(t,i,r,s=null){super("FunctionDeclaration"),this.id=t,this.params=i,this.body=r,this.returnType=s}}class Ks extends B{constructor(t,i){super("TypeDefinition"),this.name=t,this.fields=i}}class zs extends B{constructor(t,i,r=null){super("IfStatement"),this.test=t,this.consequent=i,this.alternate=r,se(this,"_line")}}class tr extends B{constructor(t,i,r,s){super("ForStatement"),this.init=t,this.test=i,this.update=r,this.body=s,se(this,"isForIn")}}class Hs extends B{constructor(t,i){super("WhileStatement"),this.test=t,this.body=i}}class Me extends B{constructor(t){super("BlockStatement"),this.body=t}}class ir extends B{constructor(t){super("ReturnStatement"),this.argument=t}}class ie extends B{constructor(t){super("Identifier"),this.name=t,se(this,"varType"),se(this,"returnType"),se(this,"isMethod")}}class Ke extends B{constructor(t,i=null){super("Literal"),this.value=t,this.raw=i}}class Le extends B{constructor(t,i,r){super("BinaryExpression"),this.operator=t,this.left=i,this.right=r}}class rr extends B{constructor(t,i,r=!0){super("UnaryExpression"),this.operator=t,this.argument=i,this.prefix=r}}class qt extends B{constructor(t,i,r){super("AssignmentExpression"),this.operator=t,this.left=i,this.right=r}}class Gs extends B{constructor(t,i,r=!1){super("UpdateExpression"),this.operator=t,this.argument=i,this.prefix=r}}class Ys extends B{constructor(t,i){super("CallExpression"),this.callee=t,this.args=i,se(this,"arguments"),this.callee=t,this.arguments=i}}class sr extends B{constructor(t,i,r=!1){super("MemberExpression"),this.object=t,this.property=i,this.computed=r}}class it extends B{constructor(t,i,r){super("ConditionalExpression"),this.test=t,this.consequent=i,this.alternate=r,se(this,"needsIIFE"),se(this,"consequentStmts"),se(this,"alternateStmts")}}class Qs extends B{constructor(t){super("ArrayExpression"),this.elements=t}}class Xs extends B{constructor(t){super("ObjectExpression"),this.properties=t}}class Zs extends B{constructor(t,i){super("Property"),this.key=t,this.value=i,se(this,"kind"),se(this,"method"),se(this,"shorthand"),se(this,"computed"),this.kind="init",this.method=!1,this.shorthand=!1,this.computed=!1}}class nr extends B{constructor(t){super("ArrayPattern"),this.elements=t}}class ar extends B{constructor(t,i){super("AssignmentPattern"),this.left=t,this.right=i}}class Js extends B{constructor(t,i){super("SwitchExpression"),this.discriminant=t,this.cases=i}}class en extends B{constructor(t,i){super("SwitchCase"),this.test=t,this.consequent=i}}var tn=Object.defineProperty,rn=(e,t,i)=>t in e?tn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,or=(e,t,i)=>rn(e,typeof t!="symbol"?t+"":t,i);class sn{constructor(t){or(this,"tokens"),or(this,"pos"),this.tokens=t,this.pos=0}peek(t=0){return this.tokens[this.pos+t]||this.tokens[this.tokens.length-1]}advance(){return this.tokens[this.pos++]}match(t,i=null){const r=this.peek();return!(r.type!==t||i!==null&&r.value!==i)}expect(t,i=null){const r=this.peek();if(r.type!==t)throw new Error(`Expected ${t} but got ${r.type} at ${r.line}:${r.column}`);if(i!==null&&r.value!==i)throw new Error(`Expected '${i}' but got '${r.value}' at ${r.line}:${r.column}`);return this.advance()}skipNewlines(){for(;this.match(m.NEWLINE);)this.advance()}parse(){const t=[];for(;!this.match(m.EOF)&&(this.skipNewlines(),!this.match(m.EOF));){const i=this.parseStatement();i&&t.push(i),this.skipNewlines()}return new Us(t)}parseStatement(){this.skipNewlines();const t=this.peek().line;if(this.match(m.COMMENT))return this.advance(),null;let i;if(this.match(m.KEYWORD,"type"))i=this.parseTypeDefinition();else if(this.match(m.KEYWORD,"var")||this.match(m.KEYWORD,"varip"))i=this.parseVarDeclaration();else if(this.match(m.KEYWORD,"method"))i=this.parseMethodDeclaration();else if(this.isFunctionDeclaration())i=this.parseFunctionDeclaration();else if(this.match(m.KEYWORD,"if"))i=this.parseIfStatement();else if(this.match(m.KEYWORD,"for"))i=this.parseForStatement();else if(this.match(m.KEYWORD,"while"))i=this.parseWhileStatement();else if(this.match(m.KEYWORD,"break")||this.match(m.KEYWORD,"continue")){const r=this.advance().value;i=new fe(new ie(r))}else if(this.isTupleDestructuring())i=this.parseTupleDestructuring();else if(this.peek().type===m.IDENTIFIER&&this.peek(1).type===m.IDENTIFIER){let r=2;for(;this.peek(r).type===m.IDENTIFIER;)r++;this.peek(r).type===m.OPERATOR&&this.peek(r).value==="="&&(i=this.parseTypedVarDeclaration())}if(!i){const r=this.parseExpression();if(this.match(m.OPERATOR)){const s=this.peek().value;if(["=",":=","+=","-=","*=","/=","%="].includes(s)){this.advance(),this.skipNewlines();const n=this.parseExpression();s==="="&&r.type==="Identifier"?i=new Ve([new Oe(r,n)],De.LET):i=new fe(new qt(s===":="?"=":s,r,n))}else i=new fe(r)}else i=new fe(r)}return i&&(i._line=t),i}isFunctionDeclaration(){const t=this.pos;try{let i=0;if(this.peek(i).type===m.IDENTIFIER&&this.peek(i+1).type===m.IDENTIFIER&&i++,this.peek(i).type!==m.IDENTIFIER||(i++,this.peek(i).type!==m.LPAREN))return!1;i++;let r=1;for(;r>0&&this.peek(i).type!==m.EOF;)this.peek(i).type===m.LPAREN&&r++,this.peek(i).type===m.RPAREN&&r--,i++;for(;this.peek(i).type===m.NEWLINE;)i++;return this.peek(i).type===m.OPERATOR&&this.peek(i).value==="=>"}finally{this.pos=t}}parseTypeDefinition(){this.expect(m.KEYWORD,"type");const t=this.expect(m.IDENTIFIER).value;this.match(m.OPERATOR,"=>")&&this.advance(),this.skipNewlines(),this.expect(m.INDENT);const i=[];for(;!this.match(m.DEDENT)&&!this.match(m.EOF)&&(this.skipNewlines(),!this.match(m.DEDENT));){const r=this.expect(m.IDENTIFIER).value,s=this.expect(m.IDENTIFIER).value;let n=null;this.match(m.OPERATOR,"=")&&(this.advance(),this.skipNewlines(),n=this.parseExpression()),i.push({type:r,name:s,defaultValue:n}),this.skipNewlines()}return this.match(m.DEDENT)&&this.advance(),new Ks(t,i)}parseVarDeclaration(){const t=this.advance().value;let i=null,r=null;if(this.peek().type===m.IDENTIFIER&&this.peek(1).type===m.LBRACKET&&this.peek(2).type===m.RBRACKET)i=this.advance().value,this.advance(),i+="[]",this.advance(),r=this.expect(m.IDENTIFIER).value;else if(this.peek().type===m.IDENTIFIER&&(this.peek(1).type===m.IDENTIFIER||this.peek(1).type===m.OPERATOR&&this.peek(1).value==="<")){if(i=this.advance().value,this.match(m.OPERATOR,"<")){for(this.advance(),i+="<";!this.match(m.OPERATOR,">");)if(this.match(m.IDENTIFIER))i+=this.advance().value;else if(this.match(m.COMMA))i+=this.advance().value,this.skipNewlines();else break;this.match(m.OPERATOR,">")&&(i+=">",this.advance())}r=this.expect(m.IDENTIFIER).value}else if(this.peek().type===m.IDENTIFIER)r=this.advance().value;else throw new Error(`Expected identifier after ${t} at ${this.peek().line}:${this.peek().column}`);this.expect(m.OPERATOR,"="),this.skipNewlines();const s=this.parseExpression(),n=new ie(r);return i&&(n.varType=i),new Ve([new Oe(n,s,i)],t)}parseTypedVarDeclaration(){let t=this.advance().value;for(;this.peek().type===m.IDENTIFIER&&this.peek(1).type===m.IDENTIFIER;)t+=" "+this.advance().value;const i=this.expect(m.IDENTIFIER).value;this.expect(m.OPERATOR,"="),this.skipNewlines();const r=this.parseExpression(),s=new ie(i);return s.varType=t,new Ve([new Oe(s,r,t)],De.LET)}parseFunctionDeclaration(){let t=null;this.peek().type===m.IDENTIFIER&&this.peek(1).type===m.IDENTIFIER&&(t=this.advance().value);const i=this.expect(m.IDENTIFIER).value;this.expect(m.LPAREN);const r=[];for(;!this.match(m.RPAREN)&&(this.skipNewlines(),!this.match(m.RPAREN));){let a=null;for(;this.peek().type===m.IDENTIFIER&&this.peek(1).type===m.IDENTIFIER&&this.peek(2).type!==m.LPAREN;)a&&(a+=" "),a=(a||"")+this.advance().value;const o=this.expect(m.IDENTIFIER).value,h=new ie(o);if(a&&(h.varType=a),this.match(m.OPERATOR,"=")){this.advance(),this.skipNewlines();const u=this.parseExpression();r.push(new ar(h,u))}else r.push(h);this.match(m.COMMA)&&this.advance()}this.expect(m.RPAREN),this.skipNewlines(),this.expect(m.OPERATOR,"=>"),this.skipNewlines();const s=this.parseFunctionBody(),n=new ie(i);return t&&(n.returnType=t),new er(n,r,s,t)}parseMethodDeclaration(){this.expect(m.KEYWORD,"method");let t=null;this.peek().type===m.IDENTIFIER&&this.peek(1).type===m.IDENTIFIER&&this.peek(2).type===m.LPAREN&&(t=this.advance().value);const i=this.expect(m.IDENTIFIER).value;this.expect(m.LPAREN);const r=[];for(;!this.match(m.RPAREN)&&(this.skipNewlines(),!this.match(m.RPAREN));){let a=null;for(;this.peek().type===m.IDENTIFIER&&this.peek(1).type===m.IDENTIFIER&&this.peek(2).type!==m.LPAREN;)a&&(a+=" "),a=(a||"")+this.advance().value;const o=this.expect(m.IDENTIFIER).value,h=new ie(o);if(a&&(h.varType=a),this.match(m.OPERATOR,"=")){this.advance(),this.skipNewlines();const u=this.parseExpression();r.push(new ar(h,u))}else r.push(h);this.match(m.COMMA)&&this.advance()}this.expect(m.RPAREN),this.skipNewlines(),this.expect(m.OPERATOR,"=>"),this.skipNewlines();const s=this.parseFunctionBody(),n=new ie(i);return t&&(n.returnType=t),n.isMethod=!0,new er(n,r,s,t)}parseFunctionBody(){const t=[];if(!this.match(m.INDENT)){const i=this.parseExpression();return new Me([new ir(i)])}for(this.advance();!this.match(m.DEDENT)&&!this.match(m.EOF)&&(this.skipNewlines(),!this.match(m.DEDENT));){const i=this.parseStatementOrSequence();Array.isArray(i)?t.push(...i):i&&t.push(i)}if(this.match(m.DEDENT)&&this.advance(),t.length>0){const i=t[t.length-1];i.type==="ExpressionStatement"&&(t[t.length-1]=new ir(i.expression))}return new Me(t)}parseStatementOrSequence(){this.pos;const t=this.peek().line;if(this.match(m.KEYWORD,"if")){const r=this.parseIfStatement();return r&&(r._line=t),r}if(this.match(m.KEYWORD,"for"))return this.parseForStatement();if(this.match(m.KEYWORD,"while"))return this.parseWhileStatement();if(this.match(m.KEYWORD,"break")||this.match(m.KEYWORD,"continue")){const r=this.advance().value;return new fe(new ie(r))}if(this.match(m.KEYWORD,"var")||this.match(m.KEYWORD,"varip"))return this.parseVarDeclaration();if(this.isTupleDestructuring())return this.parseTupleDestructuring();if(this.peek().type===m.IDENTIFIER&&this.peek(1).type===m.IDENTIFIER){let r=2;for(;this.peek(r).type===m.IDENTIFIER;)r++;if(this.peek(r).type===m.OPERATOR&&this.peek(r).value==="=")return this.parseTypedVarDeclaration()}const i=[];for(;;){const r=this.parseExpression();if(this.match(m.OPERATOR)){const s=this.peek().value;if(["=",":=","+=","-=","*=","/=","%="].includes(s)){this.advance(),this.skipNewlines();const n=this.parseExpression();if(s==="="&&r.type==="Identifier"?i.push(new Ve([new Oe(r,n)],De.LET)):i.push(new fe(new qt(s===":="?"=":s,r,n))),this.match(m.COMMA)){this.advance(),this.skipNewlines();continue}break}else{if(i.length>0)i.push(new fe(r));else return new fe(r);break}}else if(this.match(m.COMMA)){i.push(new fe(r)),this.advance(),this.skipNewlines();continue}else{if(i.length>0)i.push(new fe(r));else return new fe(r);break}}return i.length>1?i:i.length===1?i[0]:null}parseIfStatement(){this.expect(m.KEYWORD,"if");const t=this.parseExpression();this.skipNewlines();const i=this.parseBlock();let r=null;return this.match(m.KEYWORD,"else")&&(this.advance(),this.skipNewlines(),this.match(m.KEYWORD,"if")?r=this.parseIfStatement():r=this.parseBlock()),new zs(t,i,r)}parseForStatement(){this.expect(m.KEYWORD,"for");let t=null,i=!1;if(this.match(m.LBRACKET)){this.advance();const r=[];for(;!this.match(m.RBRACKET);)this.skipNewlines(),r.push(new ie(this.expect(m.IDENTIFIER).value)),this.match(m.COMMA)&&this.advance();this.expect(m.RBRACKET),t=new nr(r),i=!0}else{const r=this.expect(m.IDENTIFIER).value;t=new ie(r)}if(this.match(m.KEYWORD,"in")){this.advance();const r=this.parseExpression();this.skipNewlines();const s=this.parseBlock(),n=new Ve([new Oe(t,r)],De.CONST),a=new tr(n,null,null,s);return a.isForIn=!0,a}else{if(i)throw new Error(`Range-based for loops don't support destructuring at ${this.peek().line}:${this.peek().column}`);this.expect(m.OPERATOR,"=");const r=this.parseExpression();this.expect(m.KEYWORD,"to");const s=this.parseExpression();let n=null;this.match(m.KEYWORD,"by")&&(this.advance(),n=this.parseExpression()),this.skipNewlines();const a=this.parseBlock(),o=new Ve([new Oe(t,r)],De.LET),h=new Le("<=",t,s),u=n?new qt("+=",t,n):new Gs("++",t);return new tr(o,h,u,a)}}parseWhileStatement(){this.expect(m.KEYWORD,"while");const t=this.parseExpression();this.skipNewlines();const i=this.parseBlock();return new Hs(t,i)}parseBlock(){if(!this.match(m.INDENT)){const i=this.parseStatement();return new Me(i?[i]:[])}this.advance();const t=[];for(;!this.match(m.DEDENT)&&!this.match(m.EOF)&&(this.skipNewlines(),!this.match(m.DEDENT));){const i=this.parseStatement();i&&t.push(i)}return this.match(m.DEDENT)&&this.advance(),new Me(t)}isTupleDestructuring(){if(!this.match(m.LBRACKET))return!1;let t=1;for(;;){for(;this.peek(t).type===m.NEWLINE;)t++;if(this.peek(t).type!==m.IDENTIFIER)return!1;for(t++;this.peek(t).type===m.NEWLINE;)t++;if(this.peek(t).type===m.RBRACKET){t++;break}else if(this.peek(t).type===m.COMMA){t++;continue}else return!1}for(;this.peek(t).type===m.NEWLINE;)t++;return this.peek(t).type===m.OPERATOR&&this.peek(t).value==="="}parseTupleDestructuring(){this.expect(m.LBRACKET);const t=[];for(;!this.match(m.RBRACKET);)this.skipNewlines(),t.push(new ie(this.expect(m.IDENTIFIER).value)),this.match(m.COMMA)&&this.advance();this.expect(m.RBRACKET),this.skipNewlines(),this.expect(m.OPERATOR,"="),this.skipNewlines();const i=this.parseExpression();return new Ve([new Oe(new nr(t),i)],De.CONST)}parseExpression(){return this.parseTernary()}parseTernary(){let t=this.parseLogicalOr();if(this.match(m.OPERATOR,"?")){this.advance(),this.skipNewlines();const i=this.parseExpression();this.expect(m.COLON),this.skipNewlines();const r=this.parseExpression();return new it(t,i,r)}return t}parseLogicalOr(){let t=this.parseLogicalAnd();for(;this.match(m.KEYWORD,"or")||this.match(m.OPERATOR)&&this.peek().value==="||";){this.advance(),this.skipNewlines();const i=this.parseLogicalAnd();t=new Le("||",t,i)}return t}parseLogicalAnd(){let t=this.parseEquality();for(;this.match(m.KEYWORD,"and")||this.match(m.OPERATOR)&&this.peek().value==="&&";){this.advance(),this.skipNewlines();const i=this.parseEquality();t=new Le("&&",t,i)}return t}parseEquality(){let t=this.parseComparison();for(;this.match(m.OPERATOR);){const i=this.peek().value;if(!["==","!="].includes(i))break;this.advance(),this.skipNewlines();const r=this.parseComparison();t=new Le(i,t,r)}return t}parseComparison(){let t=this.parseAdditive();for(;this.match(m.OPERATOR);){const i=this.peek().value;if(!["<",">","<=",">="].includes(i))break;this.advance(),this.skipNewlines();const r=this.parseAdditive();t=new Le(i,t,r)}return t}parseAdditive(){let t=this.parseMultiplicative();for(;this.match(m.OPERATOR);){const i=this.peek().value;if(!["+","-"].includes(i))break;this.advance(),this.skipNewlines();const r=this.parseMultiplicative();t=new Le(i,t,r)}return t}parseMultiplicative(){let t=this.parseUnary();for(;this.match(m.OPERATOR);){const i=this.peek().value;if(!["*","/","%"].includes(i))break;this.advance(),this.skipNewlines();const r=this.parseUnary();t=new Le(i,t,r)}return t}parseUnary(){if(this.match(m.OPERATOR)){const t=this.peek().value;if(["+","-","!"].includes(t))return this.advance(),this.skipNewlines(),new rr(t,this.parseUnary())}return this.match(m.KEYWORD,"not")?(this.advance(),this.skipNewlines(),new rr("!",this.parseUnary())):this.parsePostfix()}parsePostfix(){let t=this.parsePrimary();for(;;)if(this.match(m.OPERATOR,"<")){const i=this.pos;this.advance();let r=1,s=!0;for(;r>0&&!this.match(m.EOF);)if(this.match(m.OPERATOR,"<"))r++,this.advance();else if(this.match(m.OPERATOR,">"))r--,this.advance();else if(this.match(m.IDENTIFIER)||this.match(m.COMMA))this.advance();else{s=!1,this.pos=i;break}if(s&&this.match(m.LPAREN)){t=this.parseCallExpression(t);continue}else{if(s)continue;break}}else if(this.match(m.LPAREN))t=this.parseCallExpression(t);else if(this.match(m.DOT)){this.advance(),this.skipNewlines();const i=this.expect(m.IDENTIFIER).value;t=new sr(t,new ie(i),!1)}else if(this.match(m.LBRACKET)){this.advance(),this.skipNewlines();const i=this.parseExpression();this.expect(m.RBRACKET),t=new sr(t,i,!0)}else break;return t}parseCallExpression(t){this.expect(m.LPAREN);const i=[],r=[];for(;!this.match(m.RPAREN)&&(this.skipNewlines(),!this.match(m.RPAREN));){if((this.peek().type===m.IDENTIFIER||this.peek().type===m.KEYWORD)&&this.peek(1).type===m.OPERATOR&&this.peek(1).value==="="){const s=this.advance().value;this.advance(),this.skipNewlines();const n=this.parseExpression();r.push(new Zs(new ie(s),n))}else i.push(this.parseExpression());this.match(m.COMMA)&&this.advance(),this.skipNewlines()}return this.expect(m.RPAREN),r.length>0&&i.push(new Xs(r)),new Ys(t,i)}parsePrimary(){const t=this.peek();if(this.match(m.NUMBER)){const i=this.advance();return new Ke(i.value)}if(this.match(m.STRING)){const i=this.advance();return new Ke(i.value)}if(this.match(m.BOOLEAN)){const i=this.advance();return new Ke(i.value)}if(this.match(m.IDENTIFIER)){const i=this.advance();return new ie(i.value)}if(this.match(m.LBRACKET))return this.parseArrayLiteral();if(this.match(m.LPAREN)){this.advance(),this.skipNewlines();const i=this.parseExpression();return this.skipNewlines(),this.expect(m.RPAREN),i}if(this.match(m.KEYWORD,"if"))return this.parseIfExpression();if(this.match(m.KEYWORD,"switch"))return this.parseSwitchExpression();throw new Error(`Unexpected token ${t.type} '${t.value}' at ${t.line}:${t.column}`)}parseArrayLiteral(){this.expect(m.LBRACKET);const t=[];for(;!this.match(m.RBRACKET)&&(this.skipNewlines(),!this.match(m.RBRACKET));)t.push(this.parseExpression()),this.match(m.COMMA)&&this.advance(),this.skipNewlines();return this.expect(m.RBRACKET),new Qs(t)}parseIfExpression(){this.expect(m.KEYWORD,"if");const t=this.parseExpression();this.skipNewlines(),this.expect(m.INDENT);const i=[];for(;!this.match(m.DEDENT)&&!this.match(m.EOF)&&(this.skipNewlines(),!this.match(m.DEDENT));){const a=this.parseStatement();a&&i.push(a)}this.advance();let r=[];if(this.match(m.KEYWORD,"else"))if(this.advance(),this.skipNewlines(),this.match(m.KEYWORD,"if")){const a=this.parseIfExpression();if(this.needsIIFE(i,r)){const o=new it(t,new Me(i),a);return o.needsIIFE=!0,o.consequentStmts=i,o.alternateExpr=a,o}else return new it(t,this.getBlockValue(i),a)}else{for(this.expect(m.INDENT);!this.match(m.DEDENT)&&!this.match(m.EOF)&&(this.skipNewlines(),!this.match(m.DEDENT));){const a=this.parseStatement();a&&r.push(a)}this.advance()}if(this.needsIIFE(i,r)){const a=new it(t,new Me(i),new Me(r));return a.needsIIFE=!0,a.consequentStmts=i,a.alternateStmts=r,a}const s=this.getBlockValue(i),n=r.length>0?this.getBlockValue(r):new Ke(null);return new it(t,s,n)}needsIIFE(t,i){if(t.length>1||i.length>1)return!0;const r=s=>s.some(n=>n.type==="IfStatement"||n.type==="ForStatement"||n.type==="WhileStatement"||n.type==="BlockStatement");return r(t)||r(i)}parseSwitchExpression(){this.expect(m.KEYWORD,"switch");const t=this.parseExpression();this.skipNewlines(),this.expect(m.INDENT);const i=[];for(;!this.match(m.DEDENT)&&!this.match(m.EOF)&&(this.skipNewlines(),!this.match(m.DEDENT));){let r=null;this.match(m.OPERATOR,"=>")||(r=this.parseExpression()),this.expect(m.OPERATOR,"=>"),this.skipNewlines();const s=[];if(this.match(m.INDENT)){for(this.advance();!this.match(m.DEDENT)&&!this.match(m.EOF)&&(this.skipNewlines(),!this.match(m.DEDENT));){const a=this.parseStatement();a&&s.push(a)}this.advance()}else s.push(new fe(this.parseExpression()));const n=this.getBlockValue(s);i.push(new en(r,n)),this.skipNewlines()}return this.advance(),new Js(t,i)}getBlockValue(t){if(t.length===0)return new Ke(null);const i=t[t.length-1];return i.type==="ExpressionStatement"?i.expression:i.type==="VariableDeclaration"&&i.declarations.length>0?i.declarations[0].id:new Ke(null)}}var nn=Object.defineProperty,an=(e,t,i)=>t in e?nn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Be=(e,t,i)=>an(e,typeof t!="symbol"?t+"":t,i);class on{constructor(t={}){Be(this,"indent"),Be(this,"indentStr"),Be(this,"output"),Be(this,"sourceCode"),Be(this,"sourceLines"),Be(this,"lastCommentedLine"),Be(this,"includeSourceComments"),this.indent=0,this.indentStr=t.indentStr||" ",this.output=[],this.sourceCode=t.sourceCode||null,this.sourceLines=this.sourceCode?this.sourceCode.split(`
40
+ `):[],this.lastCommentedLine=-1,this.includeSourceComments=t.includeSourceComments||!1}generate(t){if(this.output=[],this.indent=0,this.lastCommentedLine=-1,t.type==="Program")this.generateProgram(t);else throw new Error(`Expected Program node, got ${t.type}`);return this.output.join("")}writeSourceComment(t,i=null){if(!this.sourceLines.length)return;const r=i||t,s=[];for(let n=t-1;n<r&&n<this.sourceLines.length;n++)if(n>this.lastCommentedLine){const a=this.sourceLines[n].trim();a&&!a.startsWith("//@")&&!a.startsWith("//")&&s.push(this.sourceLines[n])}if(s.length>0){for(const n of s)this.write(this.indentStr.repeat(this.indent)),this.write("/// "),this.write(n.trimEnd()),this.write(`
41
+ `);this.lastCommentedLine=Math.max(this.lastCommentedLine,r-1)}}write(t){this.output.push(t)}writeLine(t=""){t?this.output.push(this.indentStr.repeat(this.indent)+t+`
42
+ `):this.output.push(`
43
+ `)}increaseIndent(){this.indent++}decreaseIndent(){this.indent--}generateProgram(t){for(let i=0;i<t.body.length;i++)if(this.generateStatement(t.body[i]),i<t.body.length-1){const r=t.body[i],s=t.body[i+1];(r.type==="FunctionDeclaration"||r.type==="TypeDefinition")&&(s.type==="FunctionDeclaration"||s.type==="TypeDefinition")&&this.writeLine()}}generateStatement(t){switch(this.includeSourceComments&&t._line&&this.sourceLines.length>0&&this.writeSourceComment(t._line),t.type){case"FunctionDeclaration":return this.generateFunctionDeclaration(t);case"VariableDeclaration":return this.generateVariableDeclaration(t);case"ExpressionStatement":return this.generateExpressionStatement(t);case"IfStatement":return this.generateIfStatement(t);case"ForStatement":return this.generateForStatement(t);case"WhileStatement":return this.generateWhileStatement(t);case"ReturnStatement":return this.generateReturnStatement(t);case"BlockStatement":return this.generateBlockStatement(t);case"TypeDefinition":return this.generateTypeDefinition(t);default:throw new Error(`Unknown statement type: ${t.type}`)}}generateTypeDefinition(t){this.write(this.indentStr.repeat(this.indent)),this.write(`class ${t.name} {
44
+ `),this.increaseIndent(),this.write(this.indentStr.repeat(this.indent)),this.write("constructor(");const i=t.fields.map(r=>r.name).join(", ");this.write(i),this.write(`) {
45
+ `),this.increaseIndent();for(const r of t.fields)this.write(this.indentStr.repeat(this.indent)),this.write(`this.${r.name} = ${r.name}`),r.defaultValue&&(this.write(" !== undefined ? "),this.write(r.name),this.write(" : "),this.generateExpression(r.defaultValue)),this.write(`;
46
+ `);this.decreaseIndent(),this.write(this.indentStr.repeat(this.indent)),this.write(`}
47
+ `),this.decreaseIndent(),this.write(this.indentStr.repeat(this.indent)),this.write(`}
48
+ `)}generateFunctionDeclaration(t){this.write(this.indentStr.repeat(this.indent));const i=t.id.isMethod;this.write("function "),this.write(t.id.name),this.write("(");const r=t.params,s=i&&r.length>0&&r[0].type==="Identifier"&&r[0].name==="this"?1:0;for(let n=s;n<r.length;n++){const a=r[n];if(a.type==="Identifier")this.write(a.name);else if(a.type==="AssignmentPattern"){const o=a.left.name==="this"&&i?"self":a.left.name;this.write(o),this.write(" = "),this.generateExpression(a.right)}n<r.length-1&&this.write(", ")}this.write(") "),this.generateBlockStatement(t.body,!1),this.write(`
49
+ `)}generateVariableDeclaration(t){const i=t.kind==="var"||t.kind==="varip"?"var":"let";for(let r=0;r<t.declarations.length;r++){const s=t.declarations[r];if(s.init&&s.init.type==="ConditionalExpression"&&s.init.needsIIFE){const n=s.id.type==="Identifier"?s.id.name:null;if(n){this.write(this.indentStr.repeat(this.indent)),this.write(i),this.write(" "),this.write(n),this.write(`;
50
+ `),this.generateIfStatementWithAssignment(s.init,n);continue}}if(this.write(this.indentStr.repeat(this.indent)),this.write(i),this.write(" "),s.id.type==="Identifier")this.write(s.id.name);else if(s.id.type==="ArrayPattern"){this.write("[");for(let n=0;n<s.id.elements.length;n++)this.write(s.id.elements[n].name),n<s.id.elements.length-1&&this.write(", ");this.write("]")}s.init&&(this.write(" = "),this.generateExpression(s.init)),this.write(`;
51
+ `)}}generateExpressionStatement(t){this.write(this.indentStr.repeat(this.indent)),this.generateExpression(t.expression),this.write(`;
52
+ `)}generateIfStatement(t){this.write(this.indentStr.repeat(this.indent)),this.write("if ("),this.generateExpression(t.test),this.write(") "),this.generateBlockStatement(t.consequent,!1),t.alternate?(this.write(" else "),t.alternate.type==="IfStatement"?this.generateIfStatement(t.alternate):this.generateBlockStatement(t.alternate,!1)):this.write(`
53
+ `)}generateIfStatementWithAssignment(t,i){if(this.write(this.indentStr.repeat(this.indent)),this.write("if ("),this.generateExpression(t.test),this.write(`) {
54
+ `),this.indent++,t.consequentStmts)for(let r=0;r<t.consequentStmts.length;r++){const s=t.consequentStmts[r];r===t.consequentStmts.length-1?s.type==="ExpressionStatement"?(this.write(this.indentStr.repeat(this.indent)),this.write(i),this.write(" = "),this.generateExpression(s.expression),this.write(`;
55
+ `)):s.type==="IfStatement"?this.generateNestedIfWithAssignments(s,i):this.generateStatement(s):this.generateStatement(s)}if(this.indent--,this.write(this.indentStr.repeat(this.indent)),this.write("}"),t.alternateExpr)this.write(` else {
56
+ `),this.indent++,this.write(this.indentStr.repeat(this.indent)),this.write(i),this.write(" = "),this.generateExpression(t.alternateExpr),this.write(`;
57
+ `),this.indent--,this.write(this.indentStr.repeat(this.indent)),this.write("}");else if(t.alternateStmts&&t.alternateStmts.length>0){this.write(` else {
58
+ `),this.indent++;for(let r=0;r<t.alternateStmts.length;r++){const s=t.alternateStmts[r];r===t.alternateStmts.length-1?s.type==="ExpressionStatement"?(this.write(this.indentStr.repeat(this.indent)),this.write(i),this.write(" = "),this.generateExpression(s.expression),this.write(`;
59
+ `)):s.type==="IfStatement"?this.generateNestedIfWithAssignments(s,i):this.generateStatement(s):this.generateStatement(s)}this.indent--,this.write(this.indentStr.repeat(this.indent)),this.write("}")}else this.write(` else {
60
+ `),this.indent++,this.write(this.indentStr.repeat(this.indent)),this.write(i),this.write(` = false;
61
+ `),this.indent--,this.write(this.indentStr.repeat(this.indent)),this.write("}");this.write(`
62
+ `)}generateNestedIfWithAssignments(t,i){if(this.write(this.indentStr.repeat(this.indent)),this.write("if ("),this.generateExpression(t.test),this.write(`) {
63
+ `),this.indent++,t.consequent.type==="BlockStatement"&&t.consequent.body.length>0)for(let r=0;r<t.consequent.body.length;r++){const s=t.consequent.body[r];r===t.consequent.body.length-1?s.type==="ExpressionStatement"?(this.write(this.indentStr.repeat(this.indent)),this.write(i),this.write(" = "),this.generateExpression(s.expression),this.write(`;
64
+ `)):s.type==="IfStatement"?this.generateNestedIfWithAssignments(s,i):this.generateStatement(s):this.generateStatement(s)}if(this.indent--,this.write(this.indentStr.repeat(this.indent)),this.write("}"),t.alternate)if(t.alternate.type==="IfStatement"){if(this.write(" else "),this.write("if ("),this.generateExpression(t.alternate.test),this.write(`) {
65
+ `),this.indent++,t.alternate.consequent.type==="BlockStatement"&&t.alternate.consequent.body.length>0)for(let r=0;r<t.alternate.consequent.body.length;r++){const s=t.alternate.consequent.body[r];r===t.alternate.consequent.body.length-1?s.type==="ExpressionStatement"?(this.write(this.indentStr.repeat(this.indent)),this.write(i),this.write(" = "),this.generateExpression(s.expression),this.write(`;
66
+ `)):s.type==="IfStatement"?this.generateNestedIfWithAssignments(s,i):this.generateStatement(s):this.generateStatement(s)}this.indent--,this.write(this.indentStr.repeat(this.indent)),this.write("}"),this.generateNestedIfAlternatesWithAssignments(t.alternate.alternate,i)}else if(t.alternate.type==="BlockStatement"&&t.alternate.body.length>0){this.write(` else {
67
+ `),this.indent++;for(let r=0;r<t.alternate.body.length;r++){const s=t.alternate.body[r];r===t.alternate.body.length-1?s.type==="ExpressionStatement"?(this.write(this.indentStr.repeat(this.indent)),this.write(i),this.write(" = "),this.generateExpression(s.expression),this.write(`;
68
+ `)):s.type==="IfStatement"?this.generateNestedIfWithAssignments(s,i):this.generateStatement(s):this.generateStatement(s)}this.indent--,this.write(this.indentStr.repeat(this.indent)),this.write(`}
69
+ `)}else this.write(` else {
70
+ `),this.indent++,this.write(this.indentStr.repeat(this.indent)),this.write(i),this.write(` = false;
71
+ `),this.indent--,this.write(this.indentStr.repeat(this.indent)),this.write(`}
72
+ `);else this.write(`
73
+ `)}generateNestedIfAlternatesWithAssignments(t,i){if(t)if(t.type==="IfStatement"){if(this.write(" else "),this.write("if ("),this.generateExpression(t.test),this.write(`) {
74
+ `),this.indent++,t.consequent.type==="BlockStatement"&&t.consequent.body.length>0)for(let r=0;r<t.consequent.body.length;r++){const s=t.consequent.body[r];r===t.consequent.body.length-1?s.type==="ExpressionStatement"?(this.write(this.indentStr.repeat(this.indent)),this.write(i),this.write(" = "),this.generateExpression(s.expression),this.write(`;
75
+ `)):s.type==="IfStatement"?this.generateNestedIfWithAssignments(s,i):this.generateStatement(s):this.generateStatement(s)}this.indent--,this.write(this.indentStr.repeat(this.indent)),this.write("}"),this.generateNestedIfAlternatesWithAssignments(t.alternate,i)}else if(t.type==="BlockStatement"&&t.body.length>0){this.write(` else {
76
+ `),this.indent++;for(let r=0;r<t.body.length;r++){const s=t.body[r];r===t.body.length-1?s.type==="ExpressionStatement"?(this.write(this.indentStr.repeat(this.indent)),this.write(i),this.write(" = "),this.generateExpression(s.expression),this.write(`;
77
+ `)):s.type==="IfStatement"?this.generateNestedIfWithAssignments(s,i):this.generateStatement(s):this.generateStatement(s)}this.indent--,this.write(this.indentStr.repeat(this.indent)),this.write(`}
78
+ `)}else this.write(` else {
79
+ `),this.indent++,this.write(this.indentStr.repeat(this.indent)),this.write(i),this.write(` = false;
80
+ `),this.indent--,this.write(this.indentStr.repeat(this.indent)),this.write(`}
81
+ `)}generateForStatement(t){if(this.write(this.indentStr.repeat(this.indent)),t.isForIn){if(this.write("for ("),t.init&&t.init.type==="VariableDeclaration"){const i=t.init.declarations[0];if(this.write(`${t.init.kind} `),i.id.type==="Identifier")this.write(i.id.name);else if(i.id.type==="ArrayPattern"){this.write("[");for(let r=0;r<i.id.elements.length;r++)this.write(i.id.elements[r].name),r<i.id.elements.length-1&&this.write(", ");this.write("]")}this.write(" of "),this.generateExpression(i.init)}this.write(") "),this.generateBlockStatement(t.body,!1);return}if(this.write("for ("),t.init)if(t.init.type==="VariableDeclaration"){const i=t.init.declarations[0];this.write(`${t.init.kind} ${i.id.name}`),i.init&&(this.write(" = "),this.generateExpression(i.init))}else this.generateExpression(t.init);this.write("; "),t.test&&this.generateExpression(t.test),this.write("; "),t.update&&(t.update.type==="AssignmentExpression"?(this.generateExpression(t.update.left),this.write(` ${t.update.operator} `),this.generateExpression(t.update.right)):this.generateExpression(t.update)),this.write(") "),this.generateBlockStatement(t.body,!1)}generateWhileStatement(t){this.write(this.indentStr.repeat(this.indent)),this.write("while ("),this.generateExpression(t.test),this.write(") "),this.generateBlockStatement(t.body,!1)}generateReturnStatement(t){this.write(this.indentStr.repeat(this.indent)),this.write("return"),t.argument&&(this.write(" "),this.generateExpression(t.argument)),this.write(`;
82
+ `)}generateBlockStatement(t,i=!0){this.write(`{
83
+ `),i?this.increaseIndent():this.indent++;for(const r of t.body)this.generateStatement(r);i?this.decreaseIndent():this.indent--,this.write(this.indentStr.repeat(this.indent)),this.write("}"),i&&this.write(`
84
+ `)}generateExpression(t){switch(t.type){case"Identifier":return this.write(t.name);case"Literal":return this.generateLiteral(t);case"BinaryExpression":case"LogicalExpression":return this.generateBinaryExpression(t);case"UnaryExpression":return this.generateUnaryExpression(t);case"AssignmentExpression":return this.generateAssignmentExpression(t);case"UpdateExpression":return this.generateUpdateExpression(t);case"CallExpression":return this.generateCallExpression(t);case"MemberExpression":return this.generateMemberExpression(t);case"ConditionalExpression":return this.generateConditionalExpression(t);case"ArrayExpression":return this.generateArrayExpression(t);case"ObjectExpression":return this.generateObjectExpression(t);case"SwitchExpression":return this.generateSwitchExpression(t);case"SequenceExpression":return this.generateSequenceExpression(t);default:throw new Error(`Unknown expression type: ${t.type}`)}}generateLiteral(t){if(typeof t.value=="string"){const i=t.value.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");this.write(`'${i}'`)}else t.value===null?this.write("null"):this.write(String(t.value))}generateBinaryExpression(t){const i=this.needsParentheses(t);i&&this.write("("),this.generateExpression(t.left),this.write(" ");let r=t.operator;r==="and"?r="&&":r==="or"&&(r="||"),this.write(r),this.write(" "),this.generateExpression(t.right),i&&this.write(")")}generateUnaryExpression(t){let i=t.operator;i==="not"&&(i="!"),this.write(i),this.generateExpression(t.argument)}generateAssignmentExpression(t){this.generateExpression(t.left),this.write(" ");let i=t.operator;i===":="&&(i="="),this.write(i),this.write(" "),this.generateExpression(t.right)}generateUpdateExpression(t){t.prefix?(this.write(t.operator),this.generateExpression(t.argument)):(this.generateExpression(t.argument),this.write(t.operator))}generateCallExpression(t){this.generateExpression(t.callee),this.write("(");for(let i=0;i<t.arguments.length;i++){const r=t.arguments[i];r.type==="AssignmentExpression"&&r.operator==="="?this.generateExpression(r.right):this.generateExpression(r),i<t.arguments.length-1&&this.write(", ")}this.write(")")}generateMemberExpression(t){this.generateExpression(t.object),t.computed?(this.write("["),this.generateExpression(t.property),this.write("]")):(this.write("."),this.generateExpression(t.property))}generateConditionalExpression(t){if(t.needsIIFE){this.generateIIFEConditional(t);return}this.write("("),this.generateExpression(t.test),this.write(" ? "),this.generateExpression(t.consequent),this.write(" : "),this.generateExpression(t.alternate),this.write(")")}generateIIFEConditional(t){this.write(`(() => {
85
+ `),this.indent++,this.generateIIFEIfBlock(t),this.indent--,this.write(this.indentStr.repeat(this.indent)),this.write("})()")}generateIIFEIfBlock(t){if(this.write(this.indentStr.repeat(this.indent)),this.write("if ("),this.generateExpression(t.test),this.write(`) {
86
+ `),this.indent++,t.consequentStmts)for(let i=0;i<t.consequentStmts.length;i++){const r=t.consequentStmts[i];i===t.consequentStmts.length-1?r.type==="ExpressionStatement"?(this.write(this.indentStr.repeat(this.indent)),this.write("return "),this.generateExpression(r.expression),this.write(`;
87
+ `)):r.type==="IfStatement"?this.generateNestedIfWithReturns(r):this.generateStatement(r):this.generateStatement(r)}if(this.indent--,this.write(this.indentStr.repeat(this.indent)),this.write("}"),t.alternateExpr)this.write(` else {
88
+ `),this.indent++,this.write(this.indentStr.repeat(this.indent)),this.write("return "),this.generateExpression(t.alternateExpr),this.write(`;
89
+ `),this.indent--,this.write(this.indentStr.repeat(this.indent)),this.write("}");else if(t.alternateStmts&&t.alternateStmts.length>0){this.write(` else {
90
+ `),this.indent++;for(let i=0;i<t.alternateStmts.length;i++){const r=t.alternateStmts[i];i===t.alternateStmts.length-1?r.type==="ExpressionStatement"?(this.write(this.indentStr.repeat(this.indent)),this.write("return "),this.generateExpression(r.expression),this.write(`;
91
+ `)):r.type==="IfStatement"?this.generateNestedIfWithReturns(r):this.generateStatement(r):this.generateStatement(r)}this.indent--,this.write(this.indentStr.repeat(this.indent)),this.write("}")}else this.write(` else {
92
+ `),this.indent++,this.write(this.indentStr.repeat(this.indent)),this.write(`return false;
93
+ `),this.indent--,this.write(this.indentStr.repeat(this.indent)),this.write("}");this.write(`
94
+ `)}generateNestedIfWithReturns(t){if(this.write(this.indentStr.repeat(this.indent)),this.write("if ("),this.generateExpression(t.test),this.write(`) {
95
+ `),this.indent++,t.consequent.type==="BlockStatement"&&t.consequent.body.length>0)for(let i=0;i<t.consequent.body.length;i++){const r=t.consequent.body[i];i===t.consequent.body.length-1?r.type==="ExpressionStatement"?(this.write(this.indentStr.repeat(this.indent)),this.write("return "),this.generateExpression(r.expression),this.write(`;
96
+ `)):r.type==="IfStatement"?this.generateNestedIfWithReturns(r):this.generateStatement(r):this.generateStatement(r)}if(this.indent--,this.write(this.indentStr.repeat(this.indent)),this.write("}"),t.alternate)if(t.alternate.type==="IfStatement"){if(this.write(" else "),this.write("if ("),this.generateExpression(t.alternate.test),this.write(`) {
97
+ `),this.indent++,t.alternate.consequent.type==="BlockStatement"&&t.alternate.consequent.body.length>0)for(let i=0;i<t.alternate.consequent.body.length;i++){const r=t.alternate.consequent.body[i];i===t.alternate.consequent.body.length-1?r.type==="ExpressionStatement"?(this.write(this.indentStr.repeat(this.indent)),this.write("return "),this.generateExpression(r.expression),this.write(`;
98
+ `)):r.type==="IfStatement"?this.generateNestedIfWithReturns(r):this.generateStatement(r):this.generateStatement(r)}this.indent--,this.write(this.indentStr.repeat(this.indent)),this.write("}"),this.generateNestedIfAlternates(t.alternate.alternate)}else if(t.alternate.type==="BlockStatement"&&t.alternate.body.length>0){this.write(` else {
99
+ `),this.indent++;for(let i=0;i<t.alternate.body.length;i++){const r=t.alternate.body[i];i===t.alternate.body.length-1?r.type==="ExpressionStatement"?(this.write(this.indentStr.repeat(this.indent)),this.write("return "),this.generateExpression(r.expression),this.write(`;
100
+ `)):r.type==="IfStatement"?this.generateNestedIfWithReturns(r):this.generateStatement(r):this.generateStatement(r)}this.indent--,this.write(this.indentStr.repeat(this.indent)),this.write(`}
101
+ `)}else this.write(` else {
102
+ `),this.indent++,this.write(this.indentStr.repeat(this.indent)),this.write(`return false;
103
+ `),this.indent--,this.write(this.indentStr.repeat(this.indent)),this.write(`}
104
+ `);else this.write(`
105
+ `)}generateNestedIfAlternates(t){if(t)if(t.type==="IfStatement"){if(this.write(" else "),this.write("if ("),this.generateExpression(t.test),this.write(`) {
106
+ `),this.indent++,t.consequent.type==="BlockStatement"&&t.consequent.body.length>0)for(let i=0;i<t.consequent.body.length;i++){const r=t.consequent.body[i];i===t.consequent.body.length-1?r.type==="ExpressionStatement"?(this.write(this.indentStr.repeat(this.indent)),this.write("return "),this.generateExpression(r.expression),this.write(`;
107
+ `)):r.type==="IfStatement"?this.generateNestedIfWithReturns(r):this.generateStatement(r):this.generateStatement(r)}this.indent--,this.write(this.indentStr.repeat(this.indent)),this.write("}"),this.generateNestedIfAlternates(t.alternate)}else if(t.type==="BlockStatement"&&t.body.length>0){this.write(` else {
108
+ `),this.indent++;for(let i=0;i<t.body.length;i++){const r=t.body[i];i===t.body.length-1?r.type==="ExpressionStatement"?(this.write(this.indentStr.repeat(this.indent)),this.write("return "),this.generateExpression(r.expression),this.write(`;
109
+ `)):r.type==="IfStatement"?this.generateNestedIfWithReturns(r):this.generateStatement(r):this.generateStatement(r)}this.indent--,this.write(this.indentStr.repeat(this.indent)),this.write(`}
110
+ `)}else this.write(` else {
111
+ `),this.indent++,this.write(this.indentStr.repeat(this.indent)),this.write(`return false;
112
+ `),this.indent--,this.write(this.indentStr.repeat(this.indent)),this.write(`}
113
+ `)}generateNestedIfAsExpression(t){if(t.type==="IfStatement"){if(this.write("("),this.generateExpression(t.test),this.write(" ? "),t.consequent.type==="BlockStatement"&&t.consequent.body.length>0){const i=t.consequent.body[t.consequent.body.length-1];i.type==="ExpressionStatement"?this.generateExpression(i.expression):i.type==="IfStatement"&&this.generateNestedIfAsExpression(i)}if(this.write(" : "),t.alternate)if(t.alternate.type==="IfStatement")this.generateNestedIfAsExpression(t.alternate);else if(t.alternate.type==="BlockStatement"&&t.alternate.body.length>0){const i=t.alternate.body[t.alternate.body.length-1];i.type==="ExpressionStatement"&&this.generateExpression(i.expression)}else this.write("false");else this.write("false");this.write(")")}}generateArrayExpression(t){this.write("[");for(let i=0;i<t.elements.length;i++)this.generateExpression(t.elements[i]),i<t.elements.length-1&&this.write(", ");this.write("]")}generateObjectExpression(t){this.write("{");for(let i=0;i<t.properties.length;i++){const r=t.properties[i];r.key.type==="Identifier"?this.write(r.key.name):this.generateExpression(r.key),this.write(": "),this.generateExpression(r.value),i<t.properties.length-1&&this.write(", ")}this.write("}")}generateSwitchExpression(t){this.write("(");for(let i=0;i<t.cases.length;i++){const r=t.cases[i];r.test?(this.generateExpression(t.discriminant),this.write(" == "),this.generateExpression(r.test),this.write(" ? "),this.generateExpression(r.consequent),this.write(" : ")):this.generateExpression(r.consequent)}t.cases.some(i=>!i.test)||this.write("undefined"),this.write(")")}generateSequenceExpression(t){this.write("(");for(let i=0;i<t.expressions.length;i++)this.generateExpression(t.expressions[i]),i<t.expressions.length-1&&this.write(", ");this.write(")")}needsParentheses(t){return!1}}function hr(e){const t=/^\s*\/\/\s*@version\s*=\s*(\d+)\s*$/im,i=e.match(t);return i&&i[1]?parseInt(i[1],10):null}function hn(e,t={}){const i=hr(e);if(i===null)return{success:!1,version:null,error:"Pine Script version not found. Please add //@version=X comment to your script."};if(i<5)return{success:!1,version:i,error:`Pine Script version ${i} is not supported. Only version 5 and above are supported.`};try{const r=new $s(e).tokenize(),s=new sn(r).parse(),n={...t,sourceCode:e},a=new on(n).generate(s);return{success:!0,version:i,code:a,ast:s,tokens:r}}catch(r){return{success:!1,version:i,error:r.message,stack:r.stack}}}function un(e){if(typeof e=="function")return e.toString();{const t=hr(e);if(t===null)return e;if(t>=5){const i=hn(e);if(i.success)return i.code;throw new Error(`Failed to transpile Pine Script version ${t}: ${i.error}`)}else throw new Error(`Unsupported Pine Script version ${t}. Only version 5 and above are supported.`)}}function cn(e,t={debug:!1,ln:!1}){typeof t=="boolean"&&(t={debug:t,ln:!0});const{debug:i}=t;let r=un(e);r=Ss(r);const s=i?r.split(`
114
+ `):[],n=Fi(r,{ecmaVersion:"latest",sourceType:"module",locations:i});Es(n),bs(n),ws(n);const a=new ms;Ns(n,a);const o=Is(n,a)||"";Os(n,a,o,t,s),Vs(n);const h=hs||Mt||void 0,u=Object.assign({},h,{LineComment(f,g){g.write("//"+f.value)}}),l=Hi(n,{generator:u,comments:i});return new Function("",`var _r = ${l}
115
+ ; return _r;`)(this)}function ln(e){return t=>new F(t.array.map(i=>Math.abs(i)),t.type,e)}function pn(e){return t=>{let i=0,r=0;for(const s of t.array){const n=Number(s);isNaN(n)||(r++,i+=(n-i)/r)}return r===0?NaN:e.precision(i)}}function fn(e){return(t,i)=>{const r=t.array;let s=0,n=r.length-1;for(;s<=n;){const a=Math.floor((s+n)/2),o=r[a];if(o===i)return a;o<i?s=a+1:n=a-1}return-1}}function mn(e){return(t,i)=>{const r=t.array;let s=0,n=r.length;for(;s<n;){const a=Math.floor((s+n)/2);r[a]<i?s=a+1:n=a}return s<r.length&&r[s]===i?s:s-1}}function dn(e){return(t,i)=>{const r=t.array;let s=0,n=r.length;for(;s<n;){const a=Math.floor((s+n)/2);r[a]<=i?s=a+1:n=a}return s>0&&r[s-1]===i?s-1:s}}function gn(e){return t=>{t.array.length=0}}function xn(e){return(t,i)=>(t.array.push(...i.array),t)}function yn(e){return t=>new F([...t.array],t.type,e)}function wn(e){return(t,i,r=!0)=>{const s=t.array,n=i.array;if(s.length!==n.length)return NaN;let a=0,o=0,h=0;const u=[];for(let x=0;x<s.length;x++){const y=Number(s[x]),w=Number(n[x]);!isNaN(y)&&y!==null&&y!==void 0&&!isNaN(w)&&w!==null&&w!==void 0&&(a+=y,o+=w,h++,u.push(x))}if(h===0)return NaN;const l=a/h,f=o/h;let g=0;for(const x of u){const y=Number(s[x]),w=Number(n[x]);g+=(y-l)*(w-f)}const p=r?h:h-1;return p<=0?NaN:e.precision(g/p)}}function bn(e){return t=>t.array.every(i=>!isNaN(i)&&i)}function vn(e){if(e.every(t=>typeof t=="number"))return e.every(t=>(t|0)===t)?W.int:W.float;if(e.every(t=>typeof t=="string"))return W.string;if(e.every(t=>typeof t=="boolean"))return W.bool;throw new Error("Cannot infer type from values")}function ge(e){if(typeof e=="number")return(e|0)===e?W.int:W.float;if(typeof e=="string")return W.string;if(typeof e=="boolean")return W.bool;throw new Error("Cannot infer type from value")}function rt(e,t){switch(t){case W.int:return typeof e=="number"&&(e|0)===e||isNaN(e);case W.float:return typeof e=="number"||isNaN(e);case W.string:return typeof e=="string";case W.bool:return typeof e=="boolean"}return!1}function _n(e){return(t,i,r=0,s)=>{const n=t.array.length,a=s!==void 0?Math.min(s,n):n;for(let o=r;o<a;o++){if(!rt(i,t.type))throw new Error(`Cannot call 'array.fill' with argument 'value'='${i}'. An argument of 'literal ${typeof i}' type was used but a '${t.type}' is expected.`);t.array[o]=e.precision(i)}}}function Sn(e){return t=>t.array.length>0?t.array[0]:e.NA}function En(e){return(t,i)=>t.array[i]}function Nn(e){return(t,i)=>t.array.includes(i)}function Cn(e){return(t,i)=>t.array.indexOf(i)}function kn(e){return(t,i,r)=>{if(!rt(r,t.type))throw new Error(`Cannot call 'array.insert' with argument 'value'='${r}'. An argument of 'literal ${typeof r}' type was used but a '${t.type}' is expected.`);t.array.splice(i,0,r)}}function In(e){return(t,i=",")=>t.array.join(i)}function An(e){return t=>t.array.length>0?t.array[t.array.length-1]:e.NA}function Pn(e){return(t,i)=>t.array.lastIndexOf(i)}function Tn(e){return(t,i=0)=>[...t.array].sort((r,s)=>s-r)[i]??e.NA}function Rn(e){return t=>{if(t.array.length===0)return NaN;const i=[...t.array].sort((s,n)=>typeof s=="number"&&typeof n=="number"?s-n:0),r=Math.floor(i.length/2);return i.length%2!==0?i[r]:(i[r-1]+i[r])/2}}function Dn(e){return(t,i=0)=>[...t.array].sort((r,s)=>r-s)[i]??e.NA}function Vn(e){return t=>{if(t.array.length===0)return NaN;const i=new Map;let r=0;for(const n of t.array){const a=(i.get(n)||0)+1;i.set(n,a),a>r&&(r=a)}const s=[];for(const[n,a]of i)a===r&&s.push(n);return s.sort((n,a)=>typeof n=="number"&&typeof a=="number"?n-a:typeof n=="string"&&typeof a=="string"?n<a?-1:n>a?1:0:0),s[0]}}function On(e){return(t,i)=>{const r=t.array;if(r.length===0)return NaN;const s=[];for(const h of r){const u=Number(h);if(isNaN(u)||u===null||u===void 0)return NaN;s.push(u)}s.sort((h,u)=>h-u),i<0&&(i=0),i>100&&(i=100);const n=i/100*s.length-.5;if(n<=0)return e.precision(s[0]);if(n>=s.length-1)return e.precision(s[s.length-1]);const a=Math.floor(n),o=n-a;return e.precision(s[a]*(1-o)+s[a+1]*o)}}function Mn(e){return(t,i)=>{const r=t.array;if(r.length===0)return NaN;const s=[];for(const o of r){const h=Number(o);!isNaN(h)&&h!==null&&h!==void 0&&s.push(h)}if(s.length===0)return NaN;s.sort((o,h)=>o-h),i<0&&(i=0),i>100&&(i=100);const n=r.length,a=Math.ceil(i/100*n);return a<=0?s[0]:a>s.length?NaN:s[a-1]}}function Ln(e){return(t,i)=>{if(t.array.length===0)return NaN;const r=Math.floor(i);if(r<0||r>=t.array.length)return NaN;const s=Number(t.array[r]);if(isNaN(s)||s===null||s===void 0)return NaN;let n=0;for(const o of t.array){const h=Number(o);!isNaN(h)&&h!==null&&h!==void 0&&h<s&&n++}const a=t.array.length-1;return a<=0?NaN:n/a*100}}function Bn(e){return t=>t.array.pop()}function Fn(e){return(t,i)=>{if(!rt(i,t.type))throw new Error(`Cannot call 'array.push' with argument 'value'='${i}'. An argument of 'literal ${typeof i}' type was used but a '${t.type}' is expected.`);t.array.push(e.precision(i))}}function jn(e){return t=>e.precision(e.pine.array.max(t)-e.pine.array.min(t))}function $n(e){return(t,i)=>i>=0&&i<t.array.length?t.array.splice(i,1)[0]:e.NA}function Wn(e){return t=>{t.array.reverse()}}function qn(e){return(t,i,r)=>{if(!rt(r,t.type))throw new Error(`Cannot call 'array.set' with argument 'value'='${r}'. An argument of 'literal ${typeof r}' type was used but a '${t.type}' is expected.`);t.array[i]=e.precision(r)}}function Un(e){return t=>t.array.shift()}function Kn(e){return t=>t.array.length}function zn(e){return(t,i,r)=>{const s=r!==void 0?r:void 0;return new F(t.array.slice(i,s),t.type,e)}}function Hn(e){return t=>t.array.some(i=>!isNaN(i)&&i)}var ze=(e=>(e[e.ascending=1]="ascending",e[e.descending=0]="descending",e))(ze||{}),ur=(e=>(e.AED="AED",e.ARS="ARS",e.AUD="AUD",e.BDT="BDT",e.BHD="BHD",e.BRL="BRL",e.BTC="BTC",e.CAD="CAD",e.CHF="CHF",e.CLP="CLP",e.CNY="CNY",e.COP="COP",e.CZK="CZK",e.DKK="DKK",e.EGP="EGP",e.ETH="ETH",e.EUR="EUR",e.GBP="GBP",e.HKD="HKD",e.HUF="HUF",e.IDR="IDR",e.ILS="ILS",e.INR="INR",e.ISK="ISK",e.JPY="JPY",e.KES="KES",e.KRW="KRW",e.KWD="KWD",e.LKR="LKR",e.MAD="MAD",e.MXN="MXN",e.MYR="MYR",e.NGN="NGN",e.NOK="NOK",e.NONE="NONE",e.NZD="NZD",e.PEN="PEN",e.PHP="PHP",e.PKR="PKR",e.PLN="PLN",e.QAR="QAR",e.RON="RON",e.RSD="RSD",e.RUB="RUB",e.SAR="SAR",e.SEK="SEK",e.SGD="SGD",e.THB="THB",e.TND="TND",e.TRY="TRY",e.TWD="TWD",e.USD="USD",e.USDT="USDT",e.VES="VES",e.VND="VND",e.ZAR="ZAR",e))(ur||{}),cr=(e=>(e[e.sunday=1]="sunday",e[e.monday=2]="monday",e[e.tuesday=3]="tuesday",e[e.wednesday=4]="wednesday",e[e.thursday=5]="thursday",e[e.friday=6]="friday",e[e.saturday=7]="saturday",e))(cr||{}),lr=(e=>(e.all="all",e.data_window="data_window",e.none="none",e.pane="pane",e.price_scale="price_scale",e.status_line="status_line",e))(lr||{});const Gn={order:ze,currency:ur,dayofweek:cr,display:lr};function Yn(e){return(t,i=ze.ascending)=>{t.array.sort((r,s)=>{let n=isNaN(r)?1/0:r,a=isNaN(s)?1/0:s;return i===ze.ascending?n-a:a-n})}}function Qn(e){return(t,i=ze.ascending)=>{const r=t.array.map((s,n)=>n);return r.sort((s,n)=>{const a=isNaN(t.array[s])?1/0:t.array[s],o=isNaN(t.array[n])?1/0:t.array[n];return i===ze.ascending?a-o:o-a}),new F(r,W.int,e)}}function Xn(e){return t=>{const i=e.array.avg(t),r=e.array.stdev(t);return isNaN(r)?new F(t.array.map(()=>NaN),W.int,e):r===0?new F(t.array.map(()=>1),W.int,e):new F(t.array.map(s=>(s-i)/r),W.int,e)}}function Zn(e){return(t,i=!0)=>{const r=t.array,s=r.length;if(s===0)return NaN;let n=0,a=0,o=0;for(let l=0;l<s;l++){const f=Number(r[l]);!isNaN(f)&&f!==null&&f!==void 0&&(n+=f,a+=f*f,o++)}if(o===0)return NaN;const h=n/o;let u=a/o-h*h;return u<0?NaN:(!i&&o>1&&(u=u*o/(o-1)),!i&&o===1?0:e.precision(Math.sqrt(u)))}}function Jn(e){return t=>e.precision(t.array.reduce((i,r)=>{const s=Number(r);return isNaN(s)?i:i+s},0))}function ea(e){return(t,i)=>{if(!rt(i,t.type))throw new Error(`Cannot call 'array.unshift' with argument 'value'='${i}'. An argument of 'literal ${typeof i}' type was used but a '${t.type}' is expected.`);t.array.unshift(e.precision(i))}}function ta(e){return(t,i=!0)=>{let r=0,s=0;for(const h of t.array){const u=Number(h);!isNaN(u)&&u!==null&&u!==void 0&&(r+=u,s++)}if(s===0)return NaN;const n=r/s;let a=0;for(const h of t.array){const u=Number(h);!isNaN(u)&&u!==null&&u!==void 0&&(a+=(u-n)*(u-n))}const o=i?s:s-1;return o<=0?NaN:e.precision(a/o)}}var ia=Object.defineProperty,ra=(e,t,i)=>t in e?ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,R=(e,t,i)=>ra(e,typeof t!="symbol"?t+"":t,i),W=(e=>(e.any="",e.box="box",e.bool="bool",e.color="color",e.float="float",e.int="int",e.label="label",e.line="line",e.linefill="linefill",e.string="string",e.table="table",e))(W||{});class F{constructor(t,i,r){this.array=t,this.type=i,this.context=r,R(this,"_abs"),R(this,"_avg"),R(this,"_binary_search"),R(this,"_binary_search_leftmost"),R(this,"_binary_search_rightmost"),R(this,"_clear"),R(this,"_concat"),R(this,"_copy"),R(this,"_covariance"),R(this,"_every"),R(this,"_fill"),R(this,"_first"),R(this,"_get"),R(this,"_includes"),R(this,"_indexof"),R(this,"_insert"),R(this,"_join"),R(this,"_last"),R(this,"_lastindexof"),R(this,"_max"),R(this,"_median"),R(this,"_min"),R(this,"_mode"),R(this,"_percentile_linear_interpolation"),R(this,"_percentile_nearest_rank"),R(this,"_percentrank"),R(this,"_pop"),R(this,"_push"),R(this,"_range"),R(this,"_remove"),R(this,"_reverse"),R(this,"_set"),R(this,"_shift"),R(this,"_size"),R(this,"_slice"),R(this,"_some"),R(this,"_sort"),R(this,"_sort_indices"),R(this,"_standardize"),R(this,"_stdev"),R(this,"_sum"),R(this,"_unshift"),R(this,"_variance"),this._abs=ln(this.context),this._avg=pn(this.context),this._binary_search=fn(this.context),this._binary_search_leftmost=mn(this.context),this._binary_search_rightmost=dn(this.context),this._clear=gn(this.context),this._concat=xn(this.context),this._copy=yn(this.context),this._covariance=wn(this.context),this._every=bn(this.context),this._fill=_n(this.context),this._first=Sn(this.context),this._get=En(this.context),this._includes=Nn(this.context),this._indexof=Cn(this.context),this._insert=kn(this.context),this._join=In(this.context),this._last=An(this.context),this._lastindexof=Pn(this.context),this._max=Tn(this.context),this._median=Rn(this.context),this._min=Dn(this.context),this._mode=Vn(this.context),this._percentile_linear_interpolation=On(this.context),this._percentile_nearest_rank=Mn(this.context),this._percentrank=Ln(this.context),this._pop=Bn(this.context),this._push=Fn(this.context),this._range=jn(this.context),this._remove=$n(this.context),this._reverse=Wn(this.context),this._set=qn(this.context),this._shift=Un(this.context),this._size=Kn(this.context),this._slice=zn(this.context),this._some=Hn(this.context),this._sort=Yn(this.context),this._sort_indices=Qn(this.context),this._standardize=Xn(this.context),this._stdev=Zn(this.context),this._sum=Jn(this.context),this._unshift=ea(this.context),this._variance=ta(this.context)}toString(){return"["+this.array.toString().replace(/,/g,", ")+"]"}abs(...t){return this._abs(this,...t)}avg(...t){return this._avg(this,...t)}binary_search(...t){return this._binary_search(this,...t)}binary_search_leftmost(...t){return this._binary_search_leftmost(this,...t)}binary_search_rightmost(...t){return this._binary_search_rightmost(this,...t)}clear(...t){return this._clear(this,...t)}concat(...t){return this._concat(this,...t)}copy(...t){return this._copy(this,...t)}covariance(...t){return this._covariance(this,...t)}every(...t){return this._every(this,...t)}fill(...t){return this._fill(this,...t)}first(...t){return this._first(this,...t)}get(...t){return this._get(this,...t)}includes(...t){return this._includes(this,...t)}indexof(...t){return this._indexof(this,...t)}insert(...t){return this._insert(this,...t)}join(...t){return this._join(this,...t)}last(...t){return this._last(this,...t)}lastindexof(...t){return this._lastindexof(this,...t)}max(...t){return this._max(this,...t)}median(...t){return this._median(this,...t)}min(...t){return this._min(this,...t)}mode(...t){return this._mode(this,...t)}percentile_linear_interpolation(...t){return this._percentile_linear_interpolation(this,...t)}percentile_nearest_rank(...t){return this._percentile_nearest_rank(this,...t)}percentrank(...t){return this._percentrank(this,...t)}pop(...t){return this._pop(this,...t)}push(...t){return this._push(this,...t)}range(...t){return this._range(this,...t)}remove(...t){return this._remove(this,...t)}reverse(...t){return this._reverse(this,...t)}set(...t){return this._set(this,...t)}shift(...t){return this._shift(this,...t)}size(...t){return this._size(this,...t)}slice(...t){return this._slice(this,...t)}some(...t){return this._some(this,...t)}sort(...t){return this._sort(this,...t)}sort_indices(...t){return this._sort_indices(this,...t)}standardize(...t){return this._standardize(this,...t)}stdev(...t){return this._stdev(this,...t)}sum(...t){return this._sum(this,...t)}unshift(...t){return this._unshift(this,...t)}variance(...t){return this._variance(this,...t)}}function sa(e){return(...t)=>new F([...t],vn(t),e)}function na(e){return(t,i)=>new F(Array(t).fill(e.precision(i||0)),ge(i||0),e)}function aa(e){return(t,i=!1)=>new F(Array(t).fill(i),W.bool,e)}function oa(e){return(t,i=NaN)=>new F(Array(t).fill(e.precision(i)),W.float,e)}function ha(e){return(t,i=0)=>new F(Array(t).fill(e.precision(i)),W.int,e)}function ua(e){return(t,i="")=>new F(Array(t).fill(i),W.string,e)}class d{constructor(t,i=0){this.data=t,this.offset=i}get(t){const i=this.data.length-1-(this.offset+t);return i<0||i>=this.data.length?NaN:this.data[i]}set(t,i){const r=this.data.length-1-(this.offset+t);r>=0&&r<this.data.length&&(this.data[r]=i)}get length(){return this.data.length}toArray(){return this.data}static from(t){return t instanceof d?t:Array.isArray(t)?new d(t):new d([t])}}function ca(e){return(t,i=0)=>d.from(t).get(i)}class la{constructor(t){this.context=t,this.abs=(i,...r)=>i.abs(...r),this.avg=(i,...r)=>i.avg(...r),this.binary_search=(i,...r)=>i.binary_search(...r),this.binary_search_leftmost=(i,...r)=>i.binary_search_leftmost(...r),this.binary_search_rightmost=(i,...r)=>i.binary_search_rightmost(...r),this.clear=(i,...r)=>i.clear(...r),this.concat=(i,...r)=>i.concat(...r),this.copy=(i,...r)=>i.copy(...r),this.covariance=(i,...r)=>i.covariance(...r),this.every=(i,...r)=>i.every(...r),this.fill=(i,...r)=>i.fill(...r),this.first=(i,...r)=>i.first(...r),this.from=sa(t),this.get=(i,...r)=>i.get(...r),this.includes=(i,...r)=>i.includes(...r),this.indexof=(i,...r)=>i.indexof(...r),this.insert=(i,...r)=>i.insert(...r),this.join=(i,...r)=>i.join(...r),this.last=(i,...r)=>i.last(...r),this.lastindexof=(i,...r)=>i.lastindexof(...r),this.max=(i,...r)=>i.max(...r),this.median=(i,...r)=>i.median(...r),this.min=(i,...r)=>i.min(...r),this.mode=(i,...r)=>i.mode(...r),this.new=na(t),this.new_bool=aa(t),this.new_float=oa(t),this.new_int=ha(t),this.new_string=ua(t),this.param=ca(),this.percentile_linear_interpolation=(i,...r)=>i.percentile_linear_interpolation(...r),this.percentile_nearest_rank=(i,...r)=>i.percentile_nearest_rank(...r),this.percentrank=(i,...r)=>i.percentrank(...r),this.pop=(i,...r)=>i.pop(...r),this.push=(i,...r)=>i.push(...r),this.range=(i,...r)=>i.range(...r),this.remove=(i,...r)=>i.remove(...r),this.reverse=(i,...r)=>i.reverse(...r),this.set=(i,...r)=>i.set(...r),this.shift=(i,...r)=>i.shift(...r),this.size=(i,...r)=>i.size(...r),this.slice=(i,...r)=>i.slice(...r),this.some=(i,...r)=>i.some(...r),this.sort=(i,...r)=>i.sort(...r),this.sort_indices=(i,...r)=>i.sort_indices(...r),this.standardize=(i,...r)=>i.standardize(...r),this.stdev=(i,...r)=>i.stdev(...r),this.sum=(i,...r)=>i.sum(...r),this.unshift=(i,...r)=>i.unshift(...r),this.variance=(i,...r)=>i.variance(...r)}}function pa(e){return t=>{t.map.clear()}}function fa(e){return(t,i)=>t.map.has(i)}function ma(e){return t=>{const i=new pr(e);return i.map=new Map(t.map),i}}function da(e){return(t,i)=>{const r=t.map.get(i);return r===void 0?NaN:r}}function ga(e){return t=>{const i=Array.from(t.map.keys()),r=ge(i[0]);return new F(i,r,e)}}function xa(e){return(t,i,r)=>{const s=t.map.get(i);return t.map.set(i,r),s===void 0?NaN:s}}function ya(e){return(t,i)=>{for(const[r,s]of i.map)t.map.set(r,s)}}function wa(e){return(t,i)=>{const r=t.map.get(i);return t.map.delete(i)?r:NaN}}function ba(e){return t=>t.map.size}function va(e){return t=>{const i=Array.from(t.map.values()),r=ge(i[0]);return new F(i,r,e)}}var _a=Object.defineProperty,Sa=(e,t,i)=>t in e?_a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,xe=(e,t,i)=>Sa(e,typeof t!="symbol"?t+"":t,i);class pr{constructor(t){this.context=t,xe(this,"map"),xe(this,"_clear"),xe(this,"_contains"),xe(this,"_copy"),xe(this,"_get"),xe(this,"_keys"),xe(this,"_put"),xe(this,"_put_all"),xe(this,"_remove"),xe(this,"_size"),xe(this,"_values"),this.map=new Map,this._clear=pa(this.context),this._contains=fa(this.context),this._copy=ma(this.context),this._get=da(this.context),this._keys=ga(this.context),this._put=xa(this.context),this._put_all=ya(this.context),this._remove=wa(this.context),this._size=ba(this.context),this._values=va(this.context)}toString(){return`PineMapObject(${this.map.size})`}clear(...t){return this._clear(this,...t)}contains(...t){return this._contains(this,...t)}copy(...t){return this._copy(this,...t)}get(...t){return this._get(this,...t)}keys(...t){return this._keys(this,...t)}put(...t){return this._put(this,...t)}put_all(...t){return this._put_all(this,...t)}remove(...t){return this._remove(this,...t)}size(...t){return this._size(this,...t)}values(...t){return this._values(this,...t)}}function Ea(e){return()=>new pr(e)}function Na(e){return(t,i=0)=>d.from(t).get(i)}class Ca{constructor(t){this.context=t,this.clear=(i,...r)=>i.clear(...r),this.contains=(i,...r)=>i.contains(...r),this.copy=(i,...r)=>i.copy(...r),this.get=(i,...r)=>i.get(...r),this.keys=(i,...r)=>i.keys(...r),this.new=Ea(t),this.param=Na(),this.put=(i,...r)=>i.put(...r),this.put_all=(i,...r)=>i.put_all(...r),this.remove=(i,...r)=>i.remove(...r),this.size=(i,...r)=>i.size(...r),this.values=(i,...r)=>i.values(...r)}}function ka(e){return(t,i,r)=>{const s=t.matrix.length;let n=[];if(r&&(r instanceof F?n=r.array:Array.isArray(r)?n=r:n=[r]),s===0){for(let h=0;h<n.length;h++){let u=n[h];u instanceof d&&(u=u.get(0)),t.matrix.push([u])}return}const a=t.matrix[0].length,o=i!==void 0?i:a;for(let h=0;h<s;h++){let u=h<n.length?n[h]:NaN;u instanceof d&&(u=u.get(0)),t.matrix[h].splice(o,0,u)}}}function Ia(e){return(t,i,r)=>{const s=t.matrix.length;let n=[];if(r)if(r instanceof F)n=r.array;else if(Array.isArray(r))n=r;else if(r instanceof d){const u=r.get(0);Array.isArray(u)?n=u:n=[u]}else n=[r];const a=s>0?t.matrix[0].length:n.length,o=i!==void 0?i:s,h=[];for(let u=0;u<a;u++)if(u<n.length){let l=n[u];l instanceof d&&(l=l.get(0)),h.push(l)}else h.push(NaN);t.matrix.splice(o,0,h)}}function Aa(e){return t=>{const i=t.matrix.length;if(i===0)return NaN;const r=t.matrix[0].length;if(r===0)return NaN;let s=0,n=0;for(let a=0;a<i;a++)for(let o=0;o<r;o++){const h=t.matrix[a][o];isNaN(h)||(s+=h,n++)}return n===0?NaN:s/n}}function Pa(e){return(t,i)=>{const r=t.matrix.length,s=[];for(let a=0;a<r;a++)s.push(t.matrix[a][i]);const n=ge(s[0]);return new F(s,n,e)}}function Ta(e){return t=>t.matrix.length===0?0:t.matrix[0].length}function Ra(e){return(t,i)=>{const r=t.matrix.length,s=i.matrix.length;if(r===0){for(let o=0;o<s;o++)t.matrix.push([...i.matrix[o]]);return}const n=t.matrix[0].length,a=s>0?i.matrix[0].length:0;if(n!==a&&s>0){console.error(`matrix.concat: Column count mismatch ${n} vs ${a}`);return}for(let o=0;o<s;o++)t.matrix.push([...i.matrix[o]])}}function Da(e){return t=>{const i=t.matrix.length,r=i>0?t.matrix[0].length:0,s=new M(i,r,NaN,e);return s.matrix=t.matrix.map(n=>[...n]),s}}function Va(e){const t=e.length;if(t===0)return 0;if(t===1)return e[0][0];if(t===2)return e[0][0]*e[1][1]-e[0][1]*e[1][0];const i=e.map(s=>[...s]);let r=1;for(let s=0;s<t;s++){let n=s;for(;n<t&&i[n][s]===0;)n++;if(n===t)return 0;n!==s&&([i[s],i[n]]=[i[n],i[s]],r*=-1),r*=i[s][s];for(let a=s+1;a<t;a++){const o=i[a][s]/i[s][s];for(let h=s;h<t;h++)i[a][h]-=o*i[s][h]}}return r}function Oa(e){return t=>{const i=t.matrix.length,r=i>0?t.matrix[0].length:0;return i!==r?NaN:Va(t.matrix)}}function Ma(e){return(t,i)=>{const r=t.matrix.length;if(r===0)return new M(0,0,NaN,e);const s=t.matrix[0].length,n=new M(r,s,NaN,e);if(i instanceof M)for(let a=0;a<r;a++)for(let o=0;o<s;o++){const h=t.matrix[a][o],u=i.matrix[a]&&i.matrix[a][o]!==void 0?i.matrix[a][o]:NaN;n.matrix[a][o]=h-u}else{const a=i;for(let o=0;o<r;o++)for(let h=0;h<s;h++)n.matrix[o][h]=t.matrix[o][h]-a}return n}}function La(e){const t=e.length;if(t!==2)return Array(t).fill(NaN);const i=e[0][0],r=e[0][1],s=e[1][0],n=e[1][1],a=i+n,o=i*n-r*s,h=a*a-4*o;if(h<0)return[NaN,NaN];const u=(a+Math.sqrt(h))/2,l=(a-Math.sqrt(h))/2;return[u,l]}function Ba(e){return t=>{const i=t.matrix.length,r=i>0?t.matrix[0].length:0;if(i!==r){const a=ge(t.matrix[0][0]);return new F([],a,e)}const s=La(t.matrix),n=ge(s[0]);return new F(s,n,e)}}function Fa(e){return t=>{const i=t.matrix.length,r=i>0?t.matrix[0].length:0;if(i!==r)return new M(0,0,NaN,e);const s=new M(i,r,0,e);for(let n=0;n<i;n++)s.matrix[n][n]=1;return s}}function ja(e){return t=>{const i=t.matrix.length;return i===0?0:i*t.matrix[0].length}}function $a(e){return(t,i,r,s,n,a)=>{const o=t.matrix.length;if(o===0)return;const h=t.matrix[0].length,u=r!==void 0?r:0,l=s!==void 0?s:o,f=n!==void 0?n:0,g=a!==void 0?a:h;for(let p=u;p<l&&!(p>=o);p++)for(let x=f;x<g&&!(x>=h);x++)t.matrix[p][x]=i}}function Wa(e){return(t,i,r)=>{if(!t.matrix[i])return NaN;const s=t.matrix[i][r];return s===void 0?NaN:s}}function qa(e){if(e.length!==2)return e.map(i=>i.map(()=>NaN));const t=e[0][0]*e[1][1]-e[0][1]*e[1][0];return t===0?[[NaN,NaN],[NaN,NaN]]:[[e[1][1]/t,-e[0][1]/t],[-e[1][0]/t,e[0][0]/t]]}function Ua(e){return t=>{const i=t.matrix.length,r=i>0?t.matrix[0].length:0;if(i!==r)return new M(i,r,NaN,e);const s=qa(t.matrix),n=new M(i,r,NaN,e);return n.matrix=s,n}}function Ka(e){return t=>{const i=t.matrix.length;if(i===0)return!1;const r=t.matrix[0].length;if(i!==r)return!1;for(let s=0;s<i;s++)for(let n=0;n<r;n++)if(s+n!==i-1&&t.matrix[s][n]!==0)return!1;return!0}}function za(e){return t=>{const i=t.matrix.length;if(i===0)return!1;const r=t.matrix[0].length;if(i!==r)return!1;for(let s=0;s<i;s++)for(let n=0;n<r;n++)if(t.matrix[n][s]!==-t.matrix[s][n])return!1;return!0}}function Ha(e){return t=>{const i=t.matrix.length;if(i===0)return!1;const r=t.matrix[0].length;for(let s=0;s<i;s++)for(let n=0;n<r;n++){const a=t.matrix[s][n];if(a!==0&&a!==1)return!1}return!0}}function Ga(e){return t=>{const i=t.matrix.length;if(i===0)return!1;const r=t.matrix[0].length;if(i!==r)return!1;for(let s=0;s<i;s++)for(let n=0;n<r;n++)if(s!==n&&t.matrix[s][n]!==0)return!1;return!0}}function Ya(e){return t=>{const i=t.matrix.length;if(i===0)return!1;const r=t.matrix[0].length;if(i!==r)return!1;for(let s=0;s<i;s++)for(let n=0;n<r;n++)if(s===n){if(t.matrix[s][n]!==1)return!1}else if(t.matrix[s][n]!==0)return!1;return!0}}function Qa(e){return t=>{const i=t.matrix.length;if(i===0)return!1;const r=t.matrix[0].length;return i===r}}function Xa(e){return t=>{const i=t.matrix.length;if(i===0)return!1;const r=t.matrix[0].length;for(let s=0;s<i;s++){let n=0;for(let a=0;a<r;a++){const o=t.matrix[s][a];if(o<0)return!1;n+=o}if(Math.abs(n-1)>1e-10)return!1}return!0}}function Za(e){return t=>{const i=t.matrix.length;if(i===0)return!1;const r=t.matrix[0].length;if(i!==r)return!1;for(let s=0;s<i;s++)for(let n=0;n<s;n++)if(t.matrix[s][n]!==t.matrix[n][s])return!1;return!0}}function Ja(e){return t=>{const i=t.matrix.length;if(i===0)return!1;const r=t.matrix[0].length;if(i!==r)return!1;let s=!0,n=!0;for(let a=0;a<i;a++)for(let o=0;o<r;o++)a>o&&t.matrix[a][o]!==0&&(s=!1),a<o&&t.matrix[a][o]!==0&&(n=!1);return s||n}}function eo(e){return t=>{const i=t.matrix.length;if(i===0)return!0;const r=t.matrix[0].length;for(let s=0;s<i;s++)for(let n=0;n<r;n++)if(t.matrix[s][n]!==0)return!1;return!0}}function to(e){return(t,i)=>{const r=t.matrix.length,s=r>0?t.matrix[0].length:0,n=i.matrix.length,a=n>0?i.matrix[0].length:0,o=r*n,h=s*a,u=new M(o,h,NaN,e);for(let l=0;l<r;l++)for(let f=0;f<s;f++){const g=t.matrix[l][f];for(let p=0;p<n;p++)for(let x=0;x<a;x++){const y=i.matrix[p][x];u.matrix[l*n+p][f*a+x]=g*y}}return u}}function io(e){return t=>{const i=t.matrix.length;if(i===0)return NaN;const r=t.matrix[0].length;let s=-1/0,n=!1;for(let a=0;a<i;a++)for(let o=0;o<r;o++){const h=t.matrix[a][o];isNaN(h)||(h>s&&(s=h),n=!0)}return n?s:NaN}}function ro(e){return t=>{const i=t.matrix.length;if(i===0)return NaN;const r=t.matrix[0].length,s=[];for(let a=0;a<i;a++)for(let o=0;o<r;o++){const h=t.matrix[a][o];isNaN(h)||s.push(h)}if(s.length===0)return NaN;s.sort((a,o)=>a-o);const n=Math.floor(s.length/2);return s.length%2!==0?s[n]:(s[n-1]+s[n])/2}}function so(e){return t=>{const i=t.matrix.length;if(i===0)return NaN;const r=t.matrix[0].length;let s=1/0,n=!1;for(let a=0;a<i;a++)for(let o=0;o<r;o++){const h=t.matrix[a][o];isNaN(h)||(h<s&&(s=h),n=!0)}return n?s:NaN}}function no(e){return t=>{const i=t.matrix.length;if(i===0)return NaN;const r=t.matrix[0].length,s=new Map;let n=0,a=NaN;for(let o=0;o<i;o++)for(let h=0;h<r;h++){const u=t.matrix[o][h];if(!isNaN(u)){const l=(s.get(u)||0)+1;s.set(u,l),l>n?(n=l,a=u):l===n&&u<a&&(a=u)}}return a}}function ao(e){return(t,i)=>{const r=t.matrix.length,s=r>0?t.matrix[0].length:0;if(i instanceof M){const n=i.matrix.length,a=n>0?i.matrix[0].length:0;if(s!==n)return new M(0,0,NaN,e);const o=new M(r,a,0,e);for(let h=0;h<r;h++)for(let u=0;u<a;u++){let l=0;for(let f=0;f<s;f++)l+=t.matrix[h][f]*i.matrix[f][u];o.matrix[h][u]=l}return o}else if(i instanceof F||Array.isArray(i.array||i)){const n=i.array||i;if(s!==n.length)return new M(0,0,NaN,e);const a=new M(r,1,0,e);for(let o=0;o<r;o++){let h=0;for(let u=0;u<s;u++)h+=t.matrix[o][u]*n[u];a.matrix[o][0]=h}return a}else{const n=i,a=new M(r,s,NaN,e);for(let o=0;o<r;o++)for(let h=0;h<s;h++)a.matrix[o][h]=t.matrix[o][h]*n;return a}}}function oo(e){return t=>{const i=t.matrix.length,r=i>0?t.matrix[0].length:0;return i===r?new M(i,r,NaN,e):new M(r,i,NaN,e)}}function ho(e){return(t,i)=>{const r=t.matrix.length,s=r>0?t.matrix[0].length:0;if(r!==s)return new M(0,0,NaN,e);let n=new M(r,s,0,e);for(let h=0;h<r;h++)n.matrix[h][h]=1;let a=new M(r,s,NaN,e);for(let h=0;h<r;h++)a.matrix[h]=[...t.matrix[h]];let o=Math.floor(i);if(o<0)return new M(r,s,NaN,e);for(;o>0;){if(o%2===1){const u=new M(r,s,0,e);for(let l=0;l<r;l++)for(let f=0;f<s;f++){let g=0;for(let p=0;p<r;p++)g+=n.matrix[l][p]*a.matrix[p][f];u.matrix[l][f]=g}n=u}const h=new M(r,s,0,e);for(let u=0;u<r;u++)for(let l=0;l<s;l++){let f=0;for(let g=0;g<r;g++)f+=a.matrix[u][g]*a.matrix[g][l];h.matrix[u][l]=f}a=h,o=Math.floor(o/2)}return n}}function uo(e){return t=>{const i=t.matrix.length;if(i===0)return 0;const r=t.matrix[0].length,s=t.matrix.map(a=>[...a]);let n=0;for(let a=0;a<r&&n<i;a++){let o=n;for(;o<i&&Math.abs(s[o][a])<1e-10;)o++;if(o<i){[s[n],s[o]]=[s[o],s[n]];const h=s[n][a];for(let u=a;u<r;u++)s[n][u]/=h;for(let u=0;u<i;u++)if(u!==n){const l=s[u][a];for(let f=a;f<r;f++)s[u][f]-=l*s[n][f]}n++}}return n}}function co(e){return(t,i)=>{const r=t.matrix.length;if(r===0){const a=ge(t.matrix[0][0]);return new F([],a,e)}const s=[];for(let a=0;a<r;a++){const o=t.matrix[a].splice(i,1);s.push(o[0])}const n=ge(s[0]);return new F(s,n,e)}}function lo(e){return(t,i)=>{const r=t.matrix.splice(i,1),s=ge(r[0][0]);return new F(r[0]||[],s,e)}}function po(e){return(t,i,r)=>{const s=t.matrix.length,n=s>0?t.matrix[0].length:0,a=i*r,o=[];for(let l=0;l<s;l++)for(let f=0;f<n;f++)o.push(t.matrix[l][f]);for(;o.length<a;)o.push(NaN);o.length>a&&(o.length=a);const h=[];let u=0;for(let l=0;l<i;l++){const f=[];for(let g=0;g<r;g++)f.push(o[u++]);h.push(f)}t.matrix=h}}function fo(e){return t=>{t.matrix.reverse();for(const i of t.matrix)i.reverse()}}function mo(e){return(t,i)=>{if(!t.matrix[i]){const s=ge(t.matrix[0][0]);return new F([],s,e)}const r=ge(t.matrix[i][0]);return new F([...t.matrix[i]],r,e)}}function go(e){return t=>t.matrix.length}function xo(e){return(t,i,r,s)=>{t.matrix[i]&&(t.matrix[i][r]=s)}}function yo(e){return(t,i=0,r="asc")=>{t.matrix.length!==0&&t.matrix.sort((s,n)=>{const a=s[i],o=n[i];return a<o?r==="asc"?-1:1:a>o?r==="asc"?1:-1:0})}}function wo(e){return(t,i,r,s,n)=>{const a=r-i,o=n-s,h=new M(a,o,NaN,e);for(let u=0;u<a;u++){const l=i+u;if(l>=t.matrix.length)break;for(let f=0;f<o;f++){const g=s+f;if(g>=t.matrix[l].length)break;h.matrix[u][f]=t.matrix[l][g]}}return h}}function bo(e){return(t,i)=>{const r=t.matrix.length;if(r===0)return new M(0,0,NaN,e);const s=t.matrix[0].length,n=new M(r,s,NaN,e);if(i instanceof M)for(let a=0;a<r;a++)for(let o=0;o<s;o++){const h=t.matrix[a][o],u=i.matrix[a]&&i.matrix[a][o]!==void 0?i.matrix[a][o]:NaN;n.matrix[a][o]=h+u}else{const a=i;for(let o=0;o<r;o++)for(let h=0;h<s;h++)n.matrix[o][h]=t.matrix[o][h]+a}return n}}function vo(e){return(t,i,r)=>{const s=t.matrix.length;for(let n=0;n<s;n++){const a=t.matrix[n][i];t.matrix[n][i]=t.matrix[n][r],t.matrix[n][r]=a}}}function _o(e){return(t,i,r)=>{const s=t.matrix[i];t.matrix[i]=t.matrix[r],t.matrix[r]=s}}function So(e){return t=>{const i=t.matrix.length;if(i===0)return 0;const r=t.matrix[0].length,s=Math.min(i,r);let n=0;for(let a=0;a<s;a++)n+=t.matrix[a][a];return n}}function Eo(e){return t=>{const i=t.matrix.length;if(i===0)return new M(0,0,NaN,e);const r=t.matrix[0].length,s=new M(r,i,NaN,e);for(let n=0;n<i;n++)for(let a=0;a<r;a++)s.matrix[a][n]=t.matrix[n][a];return s}}var No=Object.defineProperty,Co=(e,t,i)=>t in e?No(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,I=(e,t,i)=>Co(e,typeof t!="symbol"?t+"":t,i);class M{constructor(t=0,i=0,r=NaN,s){if(this.context=s,I(this,"matrix"),I(this,"_add_col"),I(this,"_add_row"),I(this,"_avg"),I(this,"_col"),I(this,"_columns"),I(this,"_concat"),I(this,"_copy"),I(this,"_det"),I(this,"_diff"),I(this,"_eigenvalues"),I(this,"_eigenvectors"),I(this,"_elements_count"),I(this,"_fill"),I(this,"_get"),I(this,"_inv"),I(this,"_is_antidiagonal"),I(this,"_is_antisymmetric"),I(this,"_is_binary"),I(this,"_is_diagonal"),I(this,"_is_identity"),I(this,"_is_square"),I(this,"_is_stochastic"),I(this,"_is_symmetric"),I(this,"_is_triangular"),I(this,"_is_zero"),I(this,"_kron"),I(this,"_max"),I(this,"_median"),I(this,"_min"),I(this,"_mode"),I(this,"_mult"),I(this,"_pinv"),I(this,"_pow"),I(this,"_rank"),I(this,"_remove_col"),I(this,"_remove_row"),I(this,"_reshape"),I(this,"_reverse"),I(this,"_row"),I(this,"_rows"),I(this,"_set"),I(this,"_sort"),I(this,"_submatrix"),I(this,"_sum"),I(this,"_swap_columns"),I(this,"_swap_rows"),I(this,"_trace"),I(this,"_transpose"),this.matrix=[],t>0&&i>0)for(let n=0;n<t;n++)this.matrix.push(Array(i).fill(r));this._add_col=ka(this.context),this._add_row=Ia(this.context),this._avg=Aa(this.context),this._col=Pa(this.context),this._columns=Ta(this.context),this._concat=Ra(this.context),this._copy=Da(this.context),this._det=Oa(this.context),this._diff=Ma(this.context),this._eigenvalues=Ba(this.context),this._eigenvectors=Fa(this.context),this._elements_count=ja(this.context),this._fill=$a(this.context),this._get=Wa(this.context),this._inv=Ua(this.context),this._is_antidiagonal=Ka(this.context),this._is_antisymmetric=za(this.context),this._is_binary=Ha(this.context),this._is_diagonal=Ga(this.context),this._is_identity=Ya(this.context),this._is_square=Qa(this.context),this._is_stochastic=Xa(this.context),this._is_symmetric=Za(this.context),this._is_triangular=Ja(this.context),this._is_zero=eo(this.context),this._kron=to(this.context),this._max=io(this.context),this._median=ro(this.context),this._min=so(this.context),this._mode=no(this.context),this._mult=ao(this.context),this._pinv=oo(this.context),this._pow=ho(this.context),this._rank=uo(this.context),this._remove_col=co(this.context),this._remove_row=lo(this.context),this._reshape=po(this.context),this._reverse=fo(this.context),this._row=mo(this.context),this._rows=go(this.context),this._set=xo(this.context),this._sort=yo(this.context),this._submatrix=wo(this.context),this._sum=bo(this.context),this._swap_columns=vo(this.context),this._swap_rows=_o(this.context),this._trace=So(this.context),this._transpose=Eo(this.context)}toString(){let t="";for(let i=0;i<this.matrix.length;i++)t+=t===""?"":`
116
+ `,t+="["+this.matrix[i].join(", ")+"]";return t}add_col(...t){return this._add_col(this,...t)}add_row(...t){return this._add_row(this,...t)}avg(...t){return this._avg(this,...t)}col(...t){return this._col(this,...t)}columns(...t){return this._columns(this,...t)}concat(...t){return this._concat(this,...t)}copy(...t){return this._copy(this,...t)}det(...t){return this._det(this,...t)}diff(...t){return this._diff(this,...t)}eigenvalues(...t){return this._eigenvalues(this,...t)}eigenvectors(...t){return this._eigenvectors(this,...t)}elements_count(...t){return this._elements_count(this,...t)}fill(...t){return this._fill(this,...t)}get(...t){return this._get(this,...t)}inv(...t){return this._inv(this,...t)}is_antidiagonal(...t){return this._is_antidiagonal(this,...t)}is_antisymmetric(...t){return this._is_antisymmetric(this,...t)}is_binary(...t){return this._is_binary(this,...t)}is_diagonal(...t){return this._is_diagonal(this,...t)}is_identity(...t){return this._is_identity(this,...t)}is_square(...t){return this._is_square(this,...t)}is_stochastic(...t){return this._is_stochastic(this,...t)}is_symmetric(...t){return this._is_symmetric(this,...t)}is_triangular(...t){return this._is_triangular(this,...t)}is_zero(...t){return this._is_zero(this,...t)}kron(...t){return this._kron(this,...t)}max(...t){return this._max(this,...t)}median(...t){return this._median(this,...t)}min(...t){return this._min(this,...t)}mode(...t){return this._mode(this,...t)}mult(...t){return this._mult(this,...t)}pinv(...t){return this._pinv(this,...t)}pow(...t){return this._pow(this,...t)}rank(...t){return this._rank(this,...t)}remove_col(...t){return this._remove_col(this,...t)}remove_row(...t){return this._remove_row(this,...t)}reshape(...t){return this._reshape(this,...t)}reverse(...t){return this._reverse(this,...t)}row(...t){return this._row(this,...t)}rows(...t){return this._rows(this,...t)}set(...t){return this._set(this,...t)}sort(...t){return this._sort(this,...t)}submatrix(...t){return this._submatrix(this,...t)}sum(...t){return this._sum(this,...t)}swap_columns(...t){return this._swap_columns(this,...t)}swap_rows(...t){return this._swap_rows(this,...t)}trace(...t){return this._trace(this,...t)}transpose(...t){return this._transpose(this,...t)}}function ko(e){return(t,i,r)=>new M(t,i,r,e)}function Io(e){return(t,i=0)=>d.from(t).get(i)}class Ao{constructor(t){this.context=t,this.add_col=(i,...r)=>i.add_col(...r),this.add_row=(i,...r)=>i.add_row(...r),this.avg=(i,...r)=>i.avg(...r),this.col=(i,...r)=>i.col(...r),this.columns=(i,...r)=>i.columns(...r),this.concat=(i,...r)=>i.concat(...r),this.copy=(i,...r)=>i.copy(...r),this.det=(i,...r)=>i.det(...r),this.diff=(i,...r)=>i.diff(...r),this.eigenvalues=(i,...r)=>i.eigenvalues(...r),this.eigenvectors=(i,...r)=>i.eigenvectors(...r),this.elements_count=(i,...r)=>i.elements_count(...r),this.fill=(i,...r)=>i.fill(...r),this.get=(i,...r)=>i.get(...r),this.inv=(i,...r)=>i.inv(...r),this.is_antidiagonal=(i,...r)=>i.is_antidiagonal(...r),this.is_antisymmetric=(i,...r)=>i.is_antisymmetric(...r),this.is_binary=(i,...r)=>i.is_binary(...r),this.is_diagonal=(i,...r)=>i.is_diagonal(...r),this.is_identity=(i,...r)=>i.is_identity(...r),this.is_square=(i,...r)=>i.is_square(...r),this.is_stochastic=(i,...r)=>i.is_stochastic(...r),this.is_symmetric=(i,...r)=>i.is_symmetric(...r),this.is_triangular=(i,...r)=>i.is_triangular(...r),this.is_zero=(i,...r)=>i.is_zero(...r),this.kron=(i,...r)=>i.kron(...r),this.max=(i,...r)=>i.max(...r),this.median=(i,...r)=>i.median(...r),this.min=(i,...r)=>i.min(...r),this.mode=(i,...r)=>i.mode(...r),this.mult=(i,...r)=>i.mult(...r),this.new=ko(t),this.param=Io(),this.pinv=(i,...r)=>i.pinv(...r),this.pow=(i,...r)=>i.pow(...r),this.rank=(i,...r)=>i.rank(...r),this.remove_col=(i,...r)=>i.remove_col(...r),this.remove_row=(i,...r)=>i.remove_row(...r),this.reshape=(i,...r)=>i.reshape(...r),this.reverse=(i,...r)=>i.reverse(...r),this.row=(i,...r)=>i.row(...r),this.rows=(i,...r)=>i.rows(...r),this.set=(i,...r)=>i.set(...r),this.sort=(i,...r)=>i.sort(...r),this.submatrix=(i,...r)=>i.submatrix(...r),this.sum=(i,...r)=>i.sum(...r),this.swap_columns=(i,...r)=>i.swap_columns(...r),this.swap_rows=(i,...r)=>i.swap_rows(...r),this.trace=(i,...r)=>i.trace(...r),this.transpose=(i,...r)=>i.transpose(...r)}}var Po=Object.defineProperty,To=(e,t,i)=>t in e?Po(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Ro=(e,t,i)=>To(e,typeof t!="symbol"?t+"":t,i);class Do{constructor(t){this.context=t,Ro(this,"_live",!1)}setLive(){this._live=!0}get isnew(){return!this._live}get islast(){return this.context.idx===this.context.data.close.data.length-1}get isfirst(){return this.context.idx===0}get ishistory(){return this.context.idx<this.context.data.close.data.length-1}get isrealtime(){return this.context.idx===this.context.data.close.data.length-1}get isconfirmed(){return this.context.data.closeTime[this.context.data.closeTime.length-1]<=new Date().getTime()}get islastconfirmedhistory(){return this.context.data.closeTime[this.context.data.closeTime.length-1]<=new Date().getTime()}}const fr={series:e=>e instanceof d||typeof e=="number",string:e=>typeof e=="string",number:e=>typeof e=="number",boolean:e=>typeof e=="boolean",array:e=>Array.isArray(e),object:e=>typeof e=="object",primitive:e=>typeof e===null||typeof e!="object"&&typeof e!="function",function:e=>typeof e=="function",undefined:e=>e===void 0,null:e=>e===null,NaN:e=>isNaN(e),remaining_options:e=>typeof e=="object"&&!(e instanceof d)};function Ut(e,t,i){Array.isArray(t)&&typeof t[0]=="string"&&(t=[t]);const r={};let s={};const n=new Array(t.length).fill(!0);for(let a=0;a<e.length;a++){const o=e[a];if(fr.remaining_options(o)){s=o;break}const h=t.map((u,l)=>n[l]?u[a]:void 0);for(let u=0;u<h.length;u++){const l=h[u];if(l===void 0){n[u]=!1;continue}const f=fr[i[l]];typeof f=="function"&&f(o)?r[l]=o:n[u]=!1}}return{...s,...r}}var Vo=Object.defineProperty,Oo=(e,t,i)=>t in e?Vo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Mo=(e,t,i)=>Oo(e,typeof t!="symbol"?t+"":t,i);const Lo=["title","shorttitle","overlay","format","precision","scale","max_bars_back","timeframe","timeframe_gaps","explicit_plot_zorder","max_lines_count","max_labels_count","max_boxes_count","calc_bars_count","max_polylines_count","dynamic_requests","behind_chart"],Bo={title:"string",shorttitle:"string",overlay:"boolean",format:"string",precision:"number",scale:"string",max_bars_back:"number",timeframe:"string",timeframe_gaps:"boolean",explicit_plot_zorder:"boolean",max_lines_count:"number",max_labels_count:"number",max_boxes_count:"number",calc_bars_count:"number",max_polylines_count:"number",dynamic_requests:"boolean",behind_chart:"boolean"};function Fo(e){return Ut(e,Lo,Bo)}class jo{constructor(t){this.context=t,Mo(this,"color",{param:(i,r=0)=>d.from(i).get(r),rgb:(i,r,s,n)=>n?`rgba(${i}, ${r}, ${s}, ${n})`:`rgb(${i}, ${r}, ${s})`,new:(i,r)=>{if(i&&i.startsWith("#")){const s=i.slice(1),n=parseInt(s.slice(0,2),16),a=parseInt(s.slice(2,4),16),o=parseInt(s.slice(4,6),16);return r?`rgba(${n}, ${a}, ${o}, ${r})`:`rgb(${n}, ${a}, ${o})`}return r?`rgba(${i}, ${r})`:i},white:"white",lime:"lime",green:"green",red:"red",maroon:"maroon",black:"black",gray:"gray",blue:"blue",yellow:"yellow",orange:"orange",purple:"purple",pink:"pink",brown:"brown",teal:"teal",cyan:"cyan",navy:"navy",indigo:"indigo",violet:"violet",magenta:"magenta",rose:"rose",gold:"gold",silver:"silver",bronze:"bronze"})}extractPlotOptions(t){const i={};for(let r in t)i[r]=d.from(t[r]).get(0);return i}indicator(...t){const i=Fo(t),r={title:"",shorttitle:"",overlay:!1,format:"inherit",precision:10,scale:"points",max_bars_back:0,timeframe:"",timeframe_gaps:!0,explicit_plot_zorder:!1,max_lines_count:50,max_labels_count:50,max_boxes_count:50,calc_bars_count:0,max_polylines_count:50,dynamic_requests:!1,behind_chart:!0};return this.context.indicator={...r,...i},this.context.indicator}get bar_index(){return this.context.idx}na(t){return isNaN(d.from(t).get(0))}nz(t,i=0){const r=d.from(t).get(0),s=d.from(i).get(0);return isNaN(r)?s:r}fixnan(t){const i=d.from(t);for(let r=0;r<i.length;r++){const s=i.get(r);if(!isNaN(s))return s}return NaN}alertcondition(t,i,r){}bool(t){const i=d.from(t).get(0);return!isNaN(i)&&i!==0}int(t){const i=d.from(t).get(0);if(typeof i!="number")throw new Error(`Cannot call "int" with argument "x"="${i}". An argument of "literal string" type was used but a "simple int" is expected.`);return Math.floor(i)}float(t){const i=d.from(t).get(0);if(typeof i!="number")throw new Error(`Cannot call "float" with argument "x"="${i}". An argument of "literal string" type was used but a "const float" is expected.`);return i}string(t){return d.from(t).get(0).toString()}}const $o=[["defval","title","tooltip","inline","group","display"],["defval","title","tooltip","group","confirm","display"],["defval","title","tooltip","inline","group","confirm","display"],["defval","title","options","tooltip","inline","group","confirm","display"],["defval","title","minval","maxval","step","tooltip","inline","group","confirm","display"]],Wo={defval:"primitive",title:"string",tooltip:"string",inline:"string",group:"string",display:"string",confirm:"boolean",options:"array",minval:"number",maxval:"number",step:"number"};function re(e){return Ut(e,$o,Wo)}function qo(e){return(...t)=>re(t).defval}function Uo(e){return(...t)=>re(t).defval}function Ko(e){return(...t)=>re(t).defval}function zo(e){return(...t)=>re(t).defval}function Ho(e){return(...t)=>re(t).defval}function Go(e){return(...t)=>re(t).defval}function Yo(e){return(t,i=0)=>d.from(t).get(i)}function Qo(e){return(...t)=>re(t).defval}function Xo(e){return(...t)=>re(t).defval}function Zo(e){return(...t)=>re(t).defval}function Jo(e){return(...t)=>re(t).defval}function eh(e){return(...t)=>re(t).defval}function th(e){return(...t)=>re(t).defval}function ih(e){return(...t)=>re(t).defval}function rh(e){return(...t)=>re(t).defval}var sh=Object.defineProperty,nh=(e,t,i)=>t in e?sh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Z=(e,t,i)=>nh(e,typeof t!="symbol"?t+"":t,i);const ah={any:qo,bool:Uo,color:Ko,enum:zo,float:Ho,int:Go,param:Yo,price:Qo,session:Xo,source:Zo,string:Jo,symbol:eh,text_area:th,time:ih,timeframe:rh};class oh{constructor(t){this.context=t,Z(this,"any"),Z(this,"bool"),Z(this,"color"),Z(this,"enum"),Z(this,"float"),Z(this,"int"),Z(this,"param"),Z(this,"price"),Z(this,"session"),Z(this,"source"),Z(this,"string"),Z(this,"symbol"),Z(this,"text_area"),Z(this,"time"),Z(this,"timeframe"),Object.entries(ah).forEach(([i,r])=>{this[i]=r(t)})}}function hh(e){return t=>Math.abs(d.from(t).get(0))}function uh(e){return t=>Math.acos(d.from(t).get(0))}function ch(e){return t=>Math.asin(d.from(t).get(0))}function lh(e){return t=>Math.atan(d.from(t).get(0))}function ph(e){return(...t)=>{const i=t.map(r=>d.from(r).get(0));return i.reduce((r,s)=>r+s,0)/i.length}}function fh(e){return t=>Math.ceil(d.from(t).get(0))}function mh(e){return t=>Math.cos(d.from(t).get(0))}function dh(e){return()=>Math.E}function gh(e){return t=>Math.exp(d.from(t).get(0))}function xh(e){return t=>Math.floor(d.from(t).get(0))}function yh(e){return t=>Math.log(d.from(t).get(0))}function wh(e){return t=>Math.log(d.from(t).get(0))}function bh(e){return t=>Math.log10(d.from(t).get(0))}function vh(e){return(...t)=>{const i=t.map(r=>d.from(r).get(0));return Math.max(...i)}}function _h(e){return(...t)=>{const i=t.map(r=>d.from(r).get(0));return Math.min(...i)}}function Sh(e){return(t,i,r)=>typeof t=="string"?t:t instanceof d?i?new d(t.data,t.offset+i):t:!Array.isArray(t)&&typeof t=="object"?t:(e.params[r]||(e.params[r]=[]),Array.isArray(t)?new d(t,i||0):(e.params[r].length===0?e.params[r].push(t):e.params[r][e.params[r].length-1]=t,new d(e.params[r],0)))}function Eh(e){return()=>1.618033988749895}function Nh(e){return()=>Math.PI}function Ch(e){return(t,i)=>Math.pow(d.from(t).get(0),d.from(i).get(0))}function kh(e){return()=>Math.random()}function Ih(e){return t=>Math.round(d.from(t).get(0))}function Ah(e){return t=>e.precision(Math.round(d.from(t).get(0)/e.pine.syminfo.mintick)*e.pine.syminfo.mintick)}function Ph(e){return()=>.6180339887498948}function Th(e){return t=>Math.sign(d.from(t).get(0))}function Rh(e){return t=>Math.sin(d.from(t).get(0))}function Dh(e){return t=>Math.sqrt(d.from(t).get(0))}function Vh(e){return(t,i)=>{const r=d.from(i).get(0),s=d.from(t);let n=0;for(let a=0;a<r;a++){const o=s.get(a);n+=o}return n}}function Oh(e){return t=>Math.tan(d.from(t).get(0))}function Mh(e){return(t,i)=>{const r=d.from(t).get(0),s=d.from(i).get(0);return typeof r=="number"&&typeof s=="number"?isNaN(r)&&isNaN(s)?!0:isNaN(r)||isNaN(s)?!1:Math.abs(r-s)<1e-8:r===s}}var Lh=Object.defineProperty,Bh=(e,t,i)=>t in e?Lh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,L=(e,t,i)=>Bh(e,typeof t!="symbol"?t+"":t,i);const Fh={abs:hh,acos:uh,asin:ch,atan:lh,avg:ph,ceil:fh,cos:mh,e:dh,exp:gh,floor:xh,ln:yh,log:wh,log10:bh,max:vh,min:_h,param:Sh,phi:Eh,pi:Nh,pow:Ch,random:kh,round:Ih,round_to_mintick:Ah,rphi:Ph,sign:Th,sin:Rh,sqrt:Dh,sum:Vh,tan:Oh,__eq:Mh};class jh{constructor(t){this.context=t,L(this,"_cache",{}),L(this,"abs"),L(this,"acos"),L(this,"asin"),L(this,"atan"),L(this,"avg"),L(this,"ceil"),L(this,"cos"),L(this,"e"),L(this,"exp"),L(this,"floor"),L(this,"ln"),L(this,"log"),L(this,"log10"),L(this,"max"),L(this,"min"),L(this,"param"),L(this,"phi"),L(this,"pi"),L(this,"pow"),L(this,"random"),L(this,"round"),L(this,"round_to_mintick"),L(this,"rphi"),L(this,"sign"),L(this,"sin"),L(this,"sqrt"),L(this,"sum"),L(this,"tan"),L(this,"__eq"),Object.entries(Fh).forEach(([i,r])=>{this[i]=r(t)})}}function $h(e){return(t,i,r)=>{e.params[r]||(e.params[r]=[]);let s;if(t instanceof d)s=t.get(i||0);else if(Array.isArray(t)){const n=t.every(o=>o instanceof d),a=t.every(o=>!(o instanceof d)&&!Array.isArray(o));(n||a)&&t.length>=1?n?s=t.map(o=>o.get(0)):s=t:s=d.from(t).get(i||0)}else s=t;return e.params[r].length===0?e.params[r].push(s):e.params[r][e.params[r].length-1]=s,[s,r]}}const gt=["1","3","5","15","30","45","60","120","180","240","D","W","M"];function mr(e,t,i,r,s=!1){for(let n=0;n<i.length;n++)if(i[n]<=e&&t<=r[n])return s||t>=r[n]?n:n-1;return-1}function dr(e,t,i,r,s=!1,n,a=!1){for(let o=i.length-1;o>=0;o--){if(r[o]<=t&&i[o]>=e){const h=n&&t>n;if(a&&s)for(let u=0;u<i.length;u++){if(i[u]>=e&&i[u]<t)return u;if(i[u]>=t)break}if(h&&s&&!a)for(let u=0;u<i.length;u++){if(i[u]>=e&&i[u]<t)return u;if(i[u]>=t)break}return o}if(r[o]<e)break}return-1}function Wh(e){return async(t,i,r,s=!1,n=!1,a=!1,o=null,h=null)=>{const u=t[0],l=i[0],f=r[0],g=r[1],p=Array.isArray(s)?s[0]:s,x=Array.isArray(n)?n[0]:n;if(e.isSecondaryContext)return f;const y=gt.indexOf(e.timeframe),w=gt.indexOf(l);if(y==-1||w==-1)throw new Error("Invalid timeframe");if(y===w)return f;const E=y>w,A=d.from(e.data.openTime).get(0),k=d.from(e.data.closeTime).get(0),T=`${u}_${l}_${g}`,C=`${T}_prevIdx`;if(e.cache[T]){const nt=e.cache[T],wt=E?dr(A,k,nt.data.openTime.data,nt.data.closeTime.data,x,e.eDate,p):mr(A,k,nt.data.openTime.data,nt.data.closeTime.data,x);if(wt==-1)return NaN;const He=nt.params[g][wt];if(!E&&p){const yr=e.cache[C];return yr!==void 0&&yr===wt?NaN:(e.cache[C]=wt,Array.isArray(He)?[He]:He)}return Array.isArray(He)?[He]:He}const J=1e3*60*60*24*30,Y=e.sDate?e.sDate-J:void 0,H=e.sDate&&e.eDate?void 0:e.limit||1e3,st=new zt(e.source,u,l,H,Y,void 0);st.markAsSecondary();const Te=await st.run(e.pineTSCode);e.cache[T]=Te;const Yt=E?dr(A,k,Te.data.openTime.data,Te.data.closeTime.data,x,e.eDate,p):mr(A,k,Te.data.openTime.data,Te.data.closeTime.data,x);if(Yt==-1)return NaN;const Qt=Te.params[g][Yt];return!E&&p?(e.cache[C]=Yt,NaN):Array.isArray(Qt)?[Qt]:Qt}}function qh(e){return async(t,i,r,s=!1,n=null,a=!1,o=0)=>{const h=t[0],u=i[0],l=r[0],f=r[1];Array.isArray(s)&&s[0];const g=Array.isArray(a)?a[0]:a;if(e.isSecondaryContext)return Array.isArray(l)?[l]:l;const p=gt.indexOf(e.timeframe),x=gt.indexOf(u);if(p===-1||x===-1){if(g)return NaN;throw new Error("Invalid timeframe")}if(x>p){if(g)return NaN;throw new Error(`Timeframe ${u} is not lower than or equal to chart timeframe ${e.timeframe}`)}if(x===p)return[[l]];const y=`${h}_${u}_${f}_lower`;if(!e.cache[y]){const Y=e.sDate?e.sDate-2592e6:void 0,H=e.sDate&&e.eDate?void 0:e.limit||1e3,st=new zt(e.source,h,u,H,Y,e.eDate);st.markAsSecondary();const Te=await st.run(e.pineTSCode);e.cache[y]=Te}const w=e.cache[y],E=d.from(e.data.openTime).get(0),A=d.from(e.data.closeTime).get(0),k=w.data.openTime.data,T=w.data.closeTime.data,C=w.params[f];if(!C)return[];const J=[];for(let Y=0;Y<k.length;Y++){const H=k[Y];if(!(T[Y]<=E)){if(H>=A)break;H>=E&&H<A&&J.push(C[Y])}}return[J]}}var Uh=Object.defineProperty,Kh=(e,t,i)=>t in e?Uh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,xt=(e,t,i)=>Kh(e,typeof t!="symbol"?t+"":t,i);const zh={param:$h,security:Wh,security_lower_tf:qh};class Hh{constructor(t){this.context=t,xt(this,"_cache",{}),xt(this,"param"),xt(this,"security"),xt(this,"security_lower_tf"),Object.entries(zh).forEach(([i,r])=>{this[i]=r(t)})}}function Gh(e){return t=>{e.taState||(e.taState={});const i=t||"accdist";e.taState[i]||(e.taState[i]={cumulativeSum:0});const r=e.taState[i],s=e.get(e.data.close,0),n=e.get(e.data.high,0),a=e.get(e.data.low,0),o=e.get(e.data.volume,0);if(isNaN(s)||isNaN(n)||isNaN(a)||isNaN(o))return e.precision(r.cumulativeSum);const h=n-a;let u=0;return h!==0&&(u=(s-a-(n-s))/h*o),r.cumulativeSum+=u,e.precision(r.cumulativeSum)}}function Yh(e){return(t,i,r,s,n)=>{const a=d.from(i).get(0),o=d.from(r).get(0),h=d.from(s).get(0);e.taState||(e.taState={});const u=n||`alma_${a}_${o}_${h}`;if(!e.taState[u]){const p=o*(a-1),x=a/h,y=[];let w=0;for(let E=0;E<a;E++){const A=Math.exp(-Math.pow(E-p,2)/(2*x*x));y.push(A),w+=A}for(let E=0;E<y.length;E++)y[E]/=w;e.taState[u]={window:[],weights:y}}const l=e.taState[u],f=d.from(t).get(0);if(l.window.unshift(f),l.window.length<a)return NaN;l.window.length>a&&l.window.pop();let g=0;for(let p=0;p<a;p++)g+=l.weights[p]*l.window[a-1-p];return e.precision(g)}}function Qh(e){return(t,i)=>{const r=d.from(t).get(0);e.taState||(e.taState={});const s=i||`atr_${r}`;e.taState[s]||(e.taState[s]={prevAtr:null,initSum:0,initCount:0,prevClose:null});const n=e.taState[s],a=e.get(e.data.high,0),o=e.get(e.data.low,0),h=e.get(e.data.close,0);if(isNaN(a)||isNaN(o)||isNaN(h))return NaN;let u;if(n.prevClose!==null){const f=a-o,g=Math.abs(a-n.prevClose),p=Math.abs(o-n.prevClose);u=Math.max(f,g,p)}else u=a-o;if(n.prevClose=h,n.initCount<r)return n.initSum+=u,n.initCount++,n.initCount===r?(n.prevAtr=n.initSum/r,e.precision(n.prevAtr)):NaN;const l=(n.prevAtr*(r-1)+u)/r;return n.prevAtr=l,e.precision(l)}}function Xh(e){return(t,i)=>{e.taState||(e.taState={});const r=i||"barssince";e.taState[r]||(e.taState[r]={lastTrueIndex:null});const s=e.taState[r];return d.from(t).get(0)?(s.lastTrueIndex=e.idx,0):s.lastTrueIndex===null?NaN:e.idx-s.lastTrueIndex}}function Zh(e){return(t,i,r,s)=>{const n=d.from(i).get(0),a=d.from(r).get(0);e.taState||(e.taState={});const o=s||`bb_${n}_${a}`;e.taState[o]||(e.taState[o]={window:[],sum:0});const h=e.taState[o],u=d.from(t).get(0);if(isNaN(u))return[[NaN,NaN,NaN]];if(h.window.unshift(u),h.sum+=u,h.window.length<n)return[[NaN,NaN,NaN]];if(h.window.length>n){const y=h.window.pop();h.sum-=y}const l=h.sum/n;let f=0;for(let y=0;y<n;y++)f+=Math.pow(h.window[y]-l,2);const g=Math.sqrt(f/n),p=l+a*g,x=l-a*g;return[[e.precision(p),e.precision(l),e.precision(x)]]}}function Jh(e){return(t,i,r,s)=>{const n=d.from(i).get(0),a=d.from(r).get(0);e.taState||(e.taState={});const o=s||`bbw_${n}_${a}`;e.taState[o]||(e.taState[o]={window:[],sum:0});const h=e.taState[o],u=d.from(t).get(0);if(isNaN(u))return NaN;if(h.window.unshift(u),h.sum+=u,h.window.length<n)return NaN;if(h.window.length>n){const w=h.window.pop();h.sum-=w}const l=h.sum/n;let f=0;for(let w=0;w<n;w++){const E=h.window[w]-l;f+=E*E}const g=f/n,p=Math.sqrt(g),x=a*p;if(l===0)return e.precision(0);const y=2*x/l*100;return e.precision(y)}}function eu(e){return(t,i,r)=>{const s=d.from(i).get(0);e.taState||(e.taState={});const n=r||`cci_${s}`;e.taState[n]||(e.taState[n]={window:[],sum:0});const a=e.taState[n],o=d.from(t).get(0);if(isNaN(o))return NaN;if(a.window.unshift(o),a.sum+=o,a.window.length<s)return NaN;if(a.window.length>s){const g=a.window.pop();a.sum-=g}const h=a.sum/s;let u=0;for(let g=0;g<s;g++)u+=Math.abs(a.window[g]-h);const l=u/s;if(l===0)return 0;const f=(o-h)/(.015*l);return e.precision(f)}}function tu(e){return(t,i=1,r)=>{typeof i=="string"&&(r=i,i=1);const s=d.from(i).get(0);e.taState||(e.taState={});const n=r||`change_${s}`;e.taState[n]||(e.taState[n]={window:[]});const a=e.taState[n],o=d.from(t).get(0);if(a.window.unshift(o),a.window.length<=s)return NaN;a.window.length>s+1&&a.window.pop();const h=o-a.window[s];return e.precision(h)}}function iu(e){return(t,i,r)=>{const s=d.from(i).get(0);e.taState||(e.taState={});const n=r||`cmo_${s}`;e.taState[n]||(e.taState[n]={gainsWindow:[],lossesWindow:[],gainsSum:0,lossesSum:0});const a=e.taState[n],o=d.from(t).get(0),h=d.from(t).get(1);if(isNaN(o)||isNaN(h))return NaN;const u=o-h,l=u>=0?u:0,f=u>=0?0:-u;if(a.gainsWindow.unshift(l),a.lossesWindow.unshift(f),a.gainsSum+=l,a.lossesSum+=f,a.gainsWindow.length<s)return NaN;if(a.gainsWindow.length>s){const x=a.gainsWindow.pop(),y=a.lossesWindow.pop();a.gainsSum-=x,a.lossesSum-=y}const g=a.gainsSum+a.lossesSum;if(g===0)return e.precision(0);const p=100*(a.gainsSum-a.lossesSum)/g;return e.precision(p)}}function ru(e){return(t,i,r)=>{const s=d.from(i).get(0),n=d.from(t);let a=0,o=!1;for(let l=0;l<s;l++){const f=n.get(l);if(isNaN(f)){o=!0;break}a+=f}if(o)return NaN;let h=0;for(let l=0;l<s;l++){const f=n.get(l);h+=f*(l+1)}if(a===0)return NaN;const u=-h/a;return e.precision(u)}}function su(e){return(t,i,r,s)=>{const n=d.from(r).get(0),a=d.from(t),o=d.from(i);if(e.idx<n-1)return NaN;let h=0,u=0,l=0,f=0,g=0,p=0;for(let A=0;A<n;A++){const k=a.get(A),T=o.get(A);isNaN(k)||isNaN(T)||(h+=k,u+=T,l+=k*T,f+=k*k,g+=T*T,p++)}if(p<2)return NaN;const x=p*l-h*u,y=p*f-h*h,w=p*g-u*u;if(y<=0||w<=0)return e.precision(0);const E=x/Math.sqrt(y*w);return e.precision(E)}}function nu(e){return(t,i,r)=>{const s=d.from(t),n=d.from(i),a=s.get(0),o=n.get(0),h=s.get(1),u=n.get(1);if(isNaN(a)||isNaN(o)||isNaN(h)||isNaN(u))return!1;const l=a>o&&h<=u,f=a<o&&h>=u;return l||f}}function au(e){return(t,i)=>{const r=d.from(t),s=d.from(i),n=r.get(0),a=s.get(0),o=r.get(1),h=s.get(1);return o<h&&n>a}}function ou(e){return(t,i)=>{const r=d.from(t),s=d.from(i),n=r.get(0),a=s.get(0),o=r.get(1),h=s.get(1);return o>h&&n<a}}function hu(e){return(t,i)=>{e.taState||(e.taState={});const r=i||"cum";e.taState[r]||(e.taState[r]={cumulativeSum:0});const s=e.taState[r],n=d.from(t).get(0);return isNaN(n)||(s.cumulativeSum+=n),e.precision(s.cumulativeSum)}}function uu(e){return(t,i,r)=>{const s=d.from(i).get(0);e.taState||(e.taState={});const n=r||`dev_${s}`;e.taState[n]||(e.taState[n]={window:[],sum:0});const a=e.taState[n],o=d.from(t).get(0)||0;if(a.window.unshift(o),a.sum+=o,a.window.length<s)return NaN;if(a.window.length>s){const f=a.window.pop();a.sum-=f}const h=a.sum/s;let u=0;for(let f=0;f<s;f++)u+=Math.abs(a.window[f]-h);const l=u/s;return e.precision(l)}}function cu(e){return(t,i,r)=>{const s=d.from(t).get(0),n=d.from(i).get(0);e.taState||(e.taState={});const a=r||`dmi_${s}_${n}`;e.taState[a]||(e.taState[a]={prevHigh:NaN,prevLow:NaN,prevClose:NaN,trInitSum:0,plusInitSum:0,minusInitSum:0,initCount:0,prevSmoothedTR:NaN,prevSmoothedPlus:NaN,prevSmoothedMinus:NaN,dxInitSum:0,adxInitCount:0,prevADX:NaN});const o=e.taState[a],h=e.get(e.data.high,0),u=e.get(e.data.low,0),l=e.get(e.data.close,0);if(isNaN(h)||isNaN(u)||isNaN(l))return[[NaN,NaN,NaN]];if(isNaN(o.prevHigh))return o.prevHigh=h,o.prevLow=u,o.prevClose=l,[[NaN,NaN,NaN]];const f=Math.max(h-u,Math.abs(h-o.prevClose),Math.abs(u-o.prevClose)),g=h-o.prevHigh,p=o.prevLow-u,x=g>p&&g>0?g:0,y=p>g&&p>0?p:0;o.prevHigh=h,o.prevLow=u,o.prevClose=l;let w,E,A;if(o.initCount++,o.initCount<=s)o.trInitSum+=f,o.plusInitSum+=x,o.minusInitSum+=y,o.initCount===s&&(o.prevSmoothedTR=o.trInitSum/s,o.prevSmoothedPlus=o.plusInitSum/s,o.prevSmoothedMinus=o.minusInitSum/s);else{const H=1/s;o.prevSmoothedTR=H*f+(1-H)*o.prevSmoothedTR,o.prevSmoothedPlus=H*x+(1-H)*o.prevSmoothedPlus,o.prevSmoothedMinus=H*y+(1-H)*o.prevSmoothedMinus}if(w=o.prevSmoothedTR,E=o.prevSmoothedPlus,A=o.prevSmoothedMinus,o.initCount<s)return[[NaN,NaN,NaN]];const k=w===0?0:100*E/w,T=w===0?0:100*A/w,C=k+T,J=C===0?0:100*Math.abs(k-T)/C;let Y=NaN;if(o.adxInitCount++,o.adxInitCount<=n)o.dxInitSum+=J,o.adxInitCount===n&&(o.prevADX=o.dxInitSum/n,Y=o.prevADX);else{const H=1/n;o.prevADX=H*J+(1-H)*o.prevADX,Y=o.prevADX}return[[e.precision(k),e.precision(T),e.precision(Y)]]}}function lu(e){return(t,i,r)=>{const s=d.from(i).get(0);e.taState||(e.taState={});const n=r||`ema_${s}`;e.taState[n]||(e.taState[n]={prevEma:null,initSum:0,initCount:0});const a=e.taState[n],o=d.from(t).get(0);if(o==null||isNaN(o))return NaN;if(a.initCount<s)return a.initSum+=o,a.initCount++,a.initCount===s?(a.prevEma=a.initSum/s,e.precision(a.prevEma)):NaN;const h=2/(s+1),u=o*h+a.prevEma*(1-h);return a.prevEma=u,e.precision(u)}}function pu(e){return(t,i,r)=>{const s=d.from(i).get(0),n=d.from(t);for(let a=0;a<s;a++){const o=n.get(a),h=n.get(a+1);if(isNaN(o)||isNaN(h)||o>=h)return!1}return!0}}function fu(e){return(t,i,r)=>{const s=d.from(i).get(0);e.taState||(e.taState={});const n=r||`highest_${s}`;e.taState[n]||(e.taState[n]={window:[]});const a=e.taState[n],o=d.from(t).get(0);if(a.window.unshift(o),a.window.length<s)return NaN;a.window.length>s&&a.window.pop();const h=Math.max(...a.window.filter(u=>!isNaN(u)));return e.precision(h)}}function mu(e){return(t,i,r)=>{const s=d.from(i).get(0),n=d.from(t);if(e.idx<s-1)return NaN;let a=-1/0,o=NaN;for(let h=0;h<s;h++){const u=n.get(h);isNaN(u)||(isNaN(o)||u>a)&&(a=u,o=-h)}return o}}function du(e){return(t,i,r)=>{const s=d.from(i).get(0),n=Math.floor(s/2),a=Math.floor(Math.sqrt(s)),o=e.ta.wma,h=o(t,n,r?`${r}_wma1`:void 0),u=o(t,s,r?`${r}_wma2`:void 0);if(isNaN(h)||isNaN(u))return NaN;e.taState||(e.taState={});const l=r||`hma_raw_${s}`;e.taState[l]||(e.taState[l]=[]);const f=2*h-u;e.taState[l].unshift(f);const g=r?`${r}_hma_final`:`hma_final_${s}`;e.taState[g]||(e.taState[g]={window:[]});const p=e.taState[g];if(p.window.unshift(f),p.window.length<a)return NaN;p.window.length>a&&p.window.pop();let x=0,y=0;for(let E=0;E<a;E++){const A=a-E;x+=p.window[E]*A,y+=A}const w=x/y;return e.precision(w)}}function gu(e){return t=>{const i=e.get(e.data.close,0),r=e.get(e.data.high,0),s=e.get(e.data.low,0),n=e.get(e.data.volume,0);if(isNaN(i)||isNaN(r)||isNaN(s)||isNaN(n))return NaN;const a=(r-s)*n;if(a===0)return e.precision(0);const o=(2*i-r-s)/a;return e.precision(o)}}function xu(e){return(t,i,r,s,n)=>{const a=d.from(i).get(0),o=d.from(r).get(0);let h=!0;typeof s=="string"?n=s:s!==void 0&&(h=d.from(s).get(0));let u;const l=e.get(e.data.high,0),f=e.get(e.data.low,0);if(h){const T=e.get(e.data.close,1);isNaN(T)?u=NaN:u=Math.max(l-f,Math.abs(l-T),Math.abs(f-T))}else u=l-f;const g=d.from(t).get(0);e.taState||(e.taState={});const p=n||`kc_${a}_${o}_${h}`;e.taState[p]||(e.taState[p]={basisState:{prevEma:null,initSum:0,initCount:0},rangeState:{prevEma:null,initSum:0,initCount:0}});const x=e.taState[p],y=(T,C,J)=>{if(isNaN(C))return NaN;if(T.initCount<J)return T.initSum+=C,T.initCount++,T.initCount===J?(T.prevEma=T.initSum/J,T.prevEma):NaN;const Y=2/(J+1);return T.prevEma=C*Y+T.prevEma*(1-Y),T.prevEma},w=y(x.basisState,g,a),E=y(x.rangeState,u,a);if(isNaN(w)||isNaN(E))return[[NaN,NaN,NaN]];const A=w+E*o,k=w-E*o;return[[e.precision(w),e.precision(A),e.precision(k)]]}}function yu(e){return(t,i,r,s,n)=>{const a=d.from(i).get(0),o=d.from(r).get(0);let h=!0;typeof s=="string"?n=s:s!==void 0&&(h=d.from(s).get(0)),e.taState||(e.taState={});const u=n||`kcw_${a}_${o}_${h}`;e.taState[u]||(e.taState[u]={basisState:{prevEma:null,initSum:0,initCount:0},rangeState:{prevEma:null,initSum:0,initCount:0}});const l=e.taState[u],f=(k,T,C)=>{if(isNaN(T))return NaN;if(k.initCount<C)return k.initSum+=T,k.initCount++,k.initCount===C?(k.prevEma=k.initSum/C,k.prevEma):NaN;const J=2/(C+1);return k.prevEma=T*J+k.prevEma*(1-J),k.prevEma};let g;const p=e.get(e.data.high,0),x=e.get(e.data.low,0);if(h){const k=e.get(e.data.close,1);isNaN(k)?g=NaN:g=Math.max(p-x,Math.abs(p-k),Math.abs(x-k))}else g=p-x;const y=d.from(t).get(0),w=f(l.basisState,y,a),E=f(l.rangeState,g,a);if(isNaN(w)||isNaN(E))return NaN;if(w===0)return e.precision(0);const A=2*E*o/w;return e.precision(A)}}function wu(e){return(t,i,r,s)=>{const n=d.from(i).get(0),a=d.from(r).get(0);e.taState||(e.taState={});const o=s||`linreg_${n}_${a}`;e.taState[o]||(e.taState[o]={window:[]});const h=e.taState[o],u=d.from(t).get(0);if(h.window.unshift(u),h.window.length<n)return NaN;h.window.length>n&&h.window.pop();let l=0,f=0,g=0,p=0;const x=n;for(let A=0;A<n;A++){const k=n-1-A,T=h.window[A];l+=k,f+=T,g+=k*T,p+=k*k}const y=x*p-l*l;if(y===0)return NaN;const w=(x*g-l*f)/y,E=(f-w*l)/x+w*(n-1-a);return e.precision(E)}}function bu(e){return(t,i,r)=>{const s=d.from(i).get(0);e.taState||(e.taState={});const n=r||`lowest_${s}`;e.taState[n]||(e.taState[n]={window:[]});const a=e.taState[n],o=d.from(t).get(0);if(a.window.unshift(o),a.window.length<s)return NaN;a.window.length>s&&a.window.pop();const h=a.window.filter(l=>!isNaN(l)&&l!==void 0),u=h.length>0?Math.min(...h):NaN;return e.precision(u)}}function vu(e){return(t,i,r)=>{const s=d.from(i).get(0),n=d.from(t);if(e.idx<s-1)return NaN;let a=1/0,o=NaN;for(let h=0;h<s;h++){const u=n.get(h);isNaN(u)||(isNaN(o)||u<a)&&(a=u,o=-h)}return o}}function _u(e){return(t,i,r,s,n)=>{const a=d.from(i).get(0),o=d.from(r).get(0),h=d.from(s).get(0),u=n||`macd_${a}_${o}_${h}`,l=`${u}_fast`,f=`${u}_slow`,g=`${u}_signal`,p=e.ta.ema(t,a,l),x=e.ta.ema(t,o,f);let y=NaN;!isNaN(p)&&!isNaN(x)&&(y=p-x);let w=NaN;isNaN(y)||(w=e.ta.ema(y,h,g));let E=NaN;return!isNaN(y)&&!isNaN(w)&&(E=y-w),[[e.precision(y),e.precision(w),e.precision(E)]]}}function Su(e){return(t,i,r)=>{const s=d.from(i).get(0);e.taState||(e.taState={});const n=r||`median_${s}`;e.taState[n]||(e.taState[n]={window:[]});const a=e.taState[n],o=d.from(t).get(0);if(a.window.unshift(o),a.window.length<s)return NaN;a.window.length>s&&a.window.pop();const h=a.window.slice().sort((f,g)=>f-g),u=Math.floor(s/2),l=s%2===0?(h[u-1]+h[u])/2:h[u];return e.precision(l)}}function Eu(e){return(t,i,r)=>{const s=d.from(i).get(0);e.taState||(e.taState={});const n=r||`mfi_${s}`;e.taState[n]||(e.taState[n]={upperWindow:[],lowerWindow:[],upperSum:0,lowerSum:0});const a=e.taState[n],o=d.from(t).get(0),h=d.from(t).get(1),u=e.get(e.data.volume,0);if(isNaN(o)||isNaN(u))return NaN;const l=isNaN(h)?NaN:o-h;let f=0,g=0;if(f=u*(l<=0?0:o),g=u*(l>=0?0:o),a.upperWindow.unshift(f),a.lowerWindow.unshift(g),a.upperSum+=f,a.lowerSum+=g,a.upperWindow.length<s)return NaN;if(a.upperWindow.length>s){const x=a.upperWindow.pop(),y=a.lowerWindow.pop();a.upperSum-=x,a.lowerSum-=y}if(a.lowerSum===0)return a.upperSum,e.precision(100);if(a.upperSum===0)return e.precision(0);const p=100-100/(1+a.upperSum/a.lowerSum);return e.precision(p)}}function Nu(e){return(t,i,r)=>{const s=d.from(i).get(0),n=d.from(t);if(e.idx<s-1)return NaN;const a=new Map;for(let u=0;u<s;u++){const l=n.get(u);isNaN(l)||a.set(l,(a.get(l)||0)+1)}if(a.size===0)return NaN;let o=NaN,h=-1;for(const[u,l]of a.entries())l>h?(h=l,o=u):l===h&&u<o&&(o=u);return o}}function Cu(e){return(t,i,r)=>{const s=d.from(i).get(0);return e.ta.change(t,s)}}function ku(e){return t=>{e.taState||(e.taState={});const i=t||"nvi";e.taState[i]||(e.taState[i]={nvi:1});const r=e.taState[i],s=e.get(e.data.close,0),n=e.get(e.data.close,1),a=e.get(e.data.volume,0),o=e.get(e.data.volume,1),h=isNaN(s)?0:s,u=isNaN(n)?0:n,l=isNaN(a)?0:a,f=isNaN(o)?0:o;if(!(h===0||u===0)&&l<f){const g=(h-u)/u;r.nvi=r.nvi+g*r.nvi}return e.precision(r.nvi)}}function Iu(e){return()=>{e.taState||(e.taState={});const t="obv";e.taState[t]||(e.taState[t]={prevOBV:0});const i=e.taState[t],r=e.get(e.data.close,0),s=e.get(e.data.volume,0),n=e.get(e.data.close,1);if(isNaN(n))return i.prevOBV=0,e.precision(0);let a;return r>n?a=i.prevOBV+s:r<n?a=i.prevOBV-s:a=i.prevOBV,i.prevOBV=a,e.precision(a)}}function Au(e){return(t,i,r)=>t instanceof d?i?new d(t.data,t.offset+i):t:(e.params[r]||(e.params[r]=[]),Array.isArray(t)?new d(t,i||0):(e.params[r].length===0?e.params[r].push(t):e.params[r][e.params[r].length-1]=t,new d(e.params[r],0)))}function Pu(e){return(t,i,r,s)=>{const n=d.from(i).get(0),a=d.from(r).get(0),o=d.from(t);if(e.idx<n-1)return NaN;const h=[];for(let x=0;x<n;x++){const y=o.get(x);if(isNaN(y))return NaN;h.push(y)}h.sort((x,y)=>x-y);let u=a/100*n-.5;u<0&&(u=0),u>n-1&&(u=n-1);const l=Math.floor(u),f=Math.ceil(u);if(l===f)return e.precision(h[l]);const g=u-l,p=h[l]+g*(h[f]-h[l]);return e.precision(p)}}function Tu(e){return(t,i,r,s)=>{const n=d.from(i).get(0),a=d.from(r).get(0),o=d.from(t);if(e.idx<n-1)return NaN;const h=[];for(let l=0;l<n;l++){const f=o.get(l);isNaN(f)||h.push(f)}if(h.length===0)return NaN;h.sort((l,f)=>l-f);let u=Math.ceil(a/100*h.length)-1;return u<0&&(u=0),u>=h.length&&(u=h.length-1),e.precision(h[u])}}function Ru(e){return(t,i,r)=>{const s=d.from(i).get(0),n=d.from(t);if(e.idx<s)return NaN;const a=n.get(0);if(isNaN(a))return NaN;let o=0,h=0;for(let u=1;u<=s;u++){const l=n.get(u);isNaN(l)||(h++,l<=a&&o++)}return h===0?NaN:e.precision(o/h*100)}}function Du(e,t,i){const r=new Array(e.length).fill(NaN);for(let s=t+i;s<e.length;s++){const n=e[s-i];let a=!0;for(let o=1;o<=t;o++)if(e[s-i-o]>=n){a=!1;break}if(a){for(let o=1;o<=i;o++)if(e[s-i+o]>=n){a=!1;break}}a&&(r[s]=n)}return r}function Vu(e){return(t,i,r,s)=>{typeof r=="string"&&(r=i,i=t,t=e.data.high);const n=d.from(i).get(0),a=d.from(r).get(0),o=d.from(t).toArray(),h=Du(o,n,a),u=e.idx;return e.precision(h[u])}}function Ou(e,t,i){const r=new Array(e.length).fill(NaN);for(let s=t+i;s<e.length;s++){const n=e[s-i];let a=!0;for(let o=1;o<=t;o++)if(e[s-i-o]<=n){a=!1;break}if(a){for(let o=1;o<=i;o++)if(e[s-i+o]<=n){a=!1;break}}a&&(r[s]=n)}return r}function Mu(e){return(t,i,r,s)=>{typeof r=="string"&&(r=i,i=t,t=e.data.low);const n=d.from(i).get(0),a=d.from(r).get(0),o=d.from(t).toArray(),h=Ou(o,n,a),u=e.idx;return e.precision(h[u])}}function Lu(e){return t=>{e.taState||(e.taState={});const i=t||"pvi";e.taState[i]||(e.taState[i]={pvi:1});const r=e.taState[i],s=e.get(e.data.close,0),n=e.get(e.data.close,1),a=e.get(e.data.volume,0),o=e.get(e.data.volume,1),h=isNaN(s)?0:s,u=isNaN(n)?0:n,l=isNaN(a)?0:a,f=isNaN(o)?0:o;if(!(h===0||u===0)&&l>f){const g=(h-u)/u;r.pvi=r.pvi+g*r.pvi}return e.precision(r.pvi)}}function Bu(e){return t=>{e.taState||(e.taState={});const i=t||"pvt";e.taState[i]||(e.taState[i]={cumulativeSum:0});const r=e.taState[i],s=e.get(e.data.close,0),n=e.get(e.data.close,1),a=e.get(e.data.volume,0);if(!isNaN(s)&&!isNaN(n)&&!isNaN(a)&&n!==0){const o=(s-n)/n*a;r.cumulativeSum+=o}return e.precision(r.cumulativeSum)}}function Fu(e){return(t,i,r)=>{const s=e.pine.ta.highest(t,i,(r||"range")+"_h"),n=e.pine.ta.lowest(t,i,(r||"range")+"_l");return isNaN(s)||isNaN(n)?NaN:e.precision(s-n)}}function ju(e){return(t,i,r)=>{const s=d.from(i).get(0),n=d.from(t);for(let a=0;a<s;a++){const o=n.get(a),h=n.get(a+1);if(isNaN(o)||isNaN(h)||o<=h)return!1}return!0}}function $u(e){return(t,i,r)=>{const s=d.from(i).get(0);e.taState||(e.taState={});const n=r||`rma_${s}`;e.taState[n]||(e.taState[n]={prevRma:null,initSum:0,initCount:0});const a=e.taState[n],o=d.from(t).get(0)||0;if(a.initCount<s)return a.initSum+=o,a.initCount++,a.initCount===s?(a.prevRma=a.initSum/s,e.precision(a.prevRma)):NaN;const h=1/s,u=o*h+a.prevRma*(1-h);return a.prevRma=u,e.precision(u)}}function Wu(e){return(t,i,r)=>{const s=d.from(i).get(0);e.taState||(e.taState={});const n=r||`roc_${s}`;e.taState[n]||(e.taState[n]={window:[]});const a=e.taState[n],o=d.from(t).get(0);if(a.window.unshift(o),a.window.length<=s)return NaN;a.window.length>s+1&&a.window.pop();const h=a.window[s],u=(o-h)/h*100;return e.precision(u)}}function qu(e){return(t,i,r)=>{const s=d.from(i).get(0);e.taState||(e.taState={});const n=r||`rsi_${s}`;e.taState[n]||(e.taState[n]={prevValue:null,avgGain:0,avgLoss:0,initGains:[],initLosses:[]});const a=e.taState[n],o=d.from(t).get(0);if(a.prevValue!==null){const h=o-a.prevValue,u=h>0?h:0,l=h<0?-h:0;if(a.initGains.length<s){if(a.initGains.push(u),a.initLosses.push(l),a.initGains.length===s){a.avgGain=a.initGains.reduce((p,x)=>p+x,0)/s,a.avgLoss=a.initLosses.reduce((p,x)=>p+x,0)/s,a.prevValue=o;const g=a.avgLoss===0?100:100-100/(1+a.avgGain/a.avgLoss);return e.precision(g)}return a.prevValue=o,NaN}a.avgGain=(a.avgGain*(s-1)+u)/s,a.avgLoss=(a.avgLoss*(s-1)+l)/s;const f=a.avgLoss===0?100:100-100/(1+a.avgGain/a.avgLoss);return a.prevValue=o,e.precision(f)}return a.prevValue=o,NaN}}function Uu(e){return(t,i,r,s)=>{const n=d.from(t).get(0),a=d.from(i).get(0),o=d.from(r).get(0);e.taState||(e.taState={});const h=s||`sar_${n}_${a}_${o}`;e.taState[h]||(e.taState[h]={result:NaN,maxMin:NaN,acceleration:NaN,isBelow:!1,barIndex:0});const u=e.taState[h],l=e.get(e.data.high,0),f=e.get(e.data.low,0),g=e.get(e.data.close,0),p=e.get(e.data.close,1),x=e.get(e.data.high,1),y=e.get(e.data.low,1),w=e.get(e.data.high,2),E=e.get(e.data.low,2);if(isNaN(l)||isNaN(f)||isNaN(g))return NaN;let A=!1;return u.barIndex===1&&(g>p?(u.isBelow=!0,u.maxMin=l,u.result=y):(u.isBelow=!1,u.maxMin=f,u.result=x),A=!0,u.acceleration=n),u.barIndex>=1&&(u.result=u.result+u.acceleration*(u.maxMin-u.result),u.isBelow?u.result>f&&(A=!0,u.isBelow=!1,u.result=Math.max(l,u.maxMin),u.maxMin=f,u.acceleration=n):u.result<l&&(A=!0,u.isBelow=!0,u.result=Math.min(f,u.maxMin),u.maxMin=l,u.acceleration=n),A||(u.isBelow?l>u.maxMin&&(u.maxMin=l,u.acceleration=Math.min(u.acceleration+a,o)):f<u.maxMin&&(u.maxMin=f,u.acceleration=Math.min(u.acceleration+a,o))),u.isBelow?(u.result=Math.min(u.result,y),u.barIndex>1&&(u.result=Math.min(u.result,E))):(u.result=Math.max(u.result,x),u.barIndex>1&&(u.result=Math.max(u.result,w)))),u.barIndex++,u.barIndex<=1?NaN:e.precision(u.result)}}function Ku(e){return(t,i,r)=>{const s=d.from(i).get(0);e.taState||(e.taState={});const n=r||`sma_${s}`;e.taState[n]||(e.taState[n]={window:[],sum:0});const a=e.taState[n],o=d.from(t).get(0)||0;if(a.window.unshift(o),a.sum+=o,a.window.length<s)return NaN;if(a.window.length>s){const u=a.window.pop();a.sum-=u}const h=a.sum/s;return e.precision(h)}}function zu(e){return(t,i,r=!0,s)=>{const n=d.from(i).get(0),a=d.from(r).get(0);e.taState||(e.taState={});const o=s||`stdev_${n}_${a}`;e.taState[o]||(e.taState[o]={window:[],sum:0});const h=e.taState[o],u=d.from(t).get(0);if(u==null||isNaN(u))return NaN;if(h.window.unshift(u),h.sum+=u,h.window.length<n)return NaN;if(h.window.length>n){const x=h.window.pop();h.sum-=x}const l=h.sum/n;let f=0;for(let x=0;x<n;x++)f+=Math.pow(h.window[x]-l,2);const g=a?n:n-1,p=Math.sqrt(f/g);return e.precision(p)}}function Hu(e){return(t,i,r,s,n)=>{const a=d.from(s).get(0);e.taState||(e.taState={});const o=n||`stoch_${a}`;e.taState[o]||(e.taState[o]={highWindow:[],lowWindow:[]});const h=e.taState[o],u=d.from(t).get(0),l=d.from(i).get(0),f=d.from(r).get(0);if(isNaN(u)||isNaN(l)||isNaN(f))return NaN;if(h.highWindow.unshift(l),h.lowWindow.unshift(f),h.highWindow.length<a)return NaN;h.highWindow.length>a&&(h.highWindow.pop(),h.lowWindow.pop());let g=h.highWindow[0],p=h.lowWindow[0];for(let w=1;w<a;w++)h.highWindow[w]>g&&(g=h.highWindow[w]),h.lowWindow[w]<p&&(p=h.lowWindow[w]);const x=g-p;if(x===0)return NaN;const y=100*(u-p)/x;return e.precision(y)}}function Gu(e){return(t,i,r)=>{const s=d.from(t).get(0),n=d.from(i).get(0);e.taState||(e.taState={});const a=r||`supertrend_${s}_${n}`;e.taState[a]||(e.taState[a]={trWindow:[],trSum:0,atrValue:NaN,atrCount:0,prevLowerBand:NaN,prevUpperBand:NaN,prevSuperTrend:NaN,prevDirection:NaN,prevClose:NaN});const o=e.taState[a],h=e.get(e.data.high,0),u=e.get(e.data.low,0),l=e.get(e.data.close,0);if(isNaN(h)||isNaN(u)||isNaN(l))return[[NaN,NaN]];const f=(h+u)/2;let g;isNaN(o.prevClose)?g=h-u:g=Math.max(h-u,Math.abs(h-o.prevClose),Math.abs(u-o.prevClose)),o.atrCount++,o.atrCount<=n?(o.trWindow.push(g),o.trSum+=g,o.atrCount===n&&(o.atrValue=o.trSum/n)):o.atrValue=(o.atrValue*(n-1)+g)/n;const p=o.atrValue,x=o.prevClose;if(o.prevClose=l,isNaN(p))return[[NaN,NaN]];let y=f+s*p,w=f-s*p;const E=isNaN(o.prevLowerBand)?0:o.prevLowerBand,A=isNaN(o.prevUpperBand)?0:o.prevUpperBand;isNaN(o.prevLowerBand)||w>E||x<E||(w=E),isNaN(o.prevUpperBand)||y<A||x>A||(y=A);let k,T;const C=o.prevSuperTrend;return o.atrCount===n?k=1:C===o.prevUpperBand?k=l>y?-1:1:k=l<w?1:-1,T=k===-1?w:y,o.prevLowerBand=w,o.prevUpperBand=y,o.prevSuperTrend=T,o.prevDirection=k,[[e.precision(T),k]]}}function Yu(e){return(t,i)=>{const r=[1,2,2,1],s=6;e.taState||(e.taState={});const n=i||"swma";e.taState[n]||(e.taState[n]={window:[]});const a=e.taState[n],o=d.from(t).get(0);if(a.window.unshift(o),a.window.length<4)return NaN;a.window.length>4&&a.window.pop();let h=0;for(let u=0;u<4;u++)h+=r[u]*a.window[3-u];return h/=s,e.precision(h)}}function Qu(e){return(t,i)=>{let r=!0;typeof t=="string"||t!==void 0&&(r=d.from(t).get(0));const s=e.get(e.data.high,0),n=e.get(e.data.low,0),a=e.get(e.data.close,1);if(isNaN(a))return r?e.precision(s-n):NaN;const o=Math.max(s-n,Math.abs(s-a),Math.abs(n-a));return e.precision(o)}}function Xu(e){return(t,i,r,s)=>{const n=d.from(i).get(0),a=d.from(r).get(0);e.taState||(e.taState={});const o=s||`tsi_${n}_${a}`;e.taState[o]||(e.taState[o]={prevSource:NaN,ema1_pc_multiplier:2/(a+1),ema1_pc_value:NaN,ema1_pc_count:0,ema1_pc_sum:0,ema2_pc_multiplier:2/(n+1),ema2_pc_value:NaN,ema2_pc_count:0,ema2_pc_sum:0,ema1_abs_multiplier:2/(a+1),ema1_abs_value:NaN,ema1_abs_count:0,ema1_abs_sum:0,ema2_abs_multiplier:2/(n+1),ema2_abs_value:NaN,ema2_abs_count:0,ema2_abs_sum:0});const h=e.taState[o],u=d.from(t).get(0);if(isNaN(u))return NaN;const l=isNaN(h.prevSource)?NaN:u-h.prevSource;if(h.prevSource=u,isNaN(l))return NaN;const f=Math.abs(l);if(h.ema1_pc_count++,h.ema1_pc_count<=a?(h.ema1_pc_sum+=l,h.ema1_pc_count===a&&(h.ema1_pc_value=h.ema1_pc_sum/a)):h.ema1_pc_value=l*h.ema1_pc_multiplier+h.ema1_pc_value*(1-h.ema1_pc_multiplier),h.ema1_abs_count++,h.ema1_abs_count<=a?(h.ema1_abs_sum+=f,h.ema1_abs_count===a&&(h.ema1_abs_value=h.ema1_abs_sum/a)):h.ema1_abs_value=f*h.ema1_abs_multiplier+h.ema1_abs_value*(1-h.ema1_abs_multiplier),isNaN(h.ema1_pc_value)||isNaN(h.ema1_abs_value))return NaN;if(h.ema2_pc_count++,h.ema2_pc_count<=n?(h.ema2_pc_sum+=h.ema1_pc_value,h.ema2_pc_count===n&&(h.ema2_pc_value=h.ema2_pc_sum/n)):h.ema2_pc_value=h.ema1_pc_value*h.ema2_pc_multiplier+h.ema2_pc_value*(1-h.ema2_pc_multiplier),h.ema2_abs_count++,h.ema2_abs_count<=n?(h.ema2_abs_sum+=h.ema1_abs_value,h.ema2_abs_count===n&&(h.ema2_abs_value=h.ema2_abs_sum/n)):h.ema2_abs_value=h.ema1_abs_value*h.ema2_abs_multiplier+h.ema2_abs_value*(1-h.ema2_abs_multiplier),isNaN(h.ema2_pc_value)||isNaN(h.ema2_abs_value))return NaN;if(h.ema2_abs_value===0)return e.precision(0);const g=h.ema2_pc_value/h.ema2_abs_value;return e.precision(g)}}function Zu(e){return(t,i,r,s)=>{e.taState||(e.taState={});const n=s||"valuewhen";e.taState[n]||(e.taState[n]={values:[]});const a=e.taState[n],o=d.from(t).get(0),h=d.from(i).get(0),u=d.from(r).get(0);if(o&&a.values.push(h),isNaN(u)||u<0)return NaN;const l=a.values.length-1-u;if(l<0)return NaN;const f=a.values[l];return typeof f=="number"?e.precision(f):f}}function Ju(e){return(t,i,r)=>{const s=d.from(i).get(0);e.taState||(e.taState={});const n=r||`variance_${s}`;e.taState[n]||(e.taState[n]={window:[]});const a=e.taState[n],o=d.from(t).get(0);if(a.window.unshift(o),a.window.length<s)return NaN;a.window.length>s&&a.window.pop();let h=0,u=0;for(let g=0;g<s;g++)h+=a.window[g],u+=a.window[g]*a.window[g];const l=h/s,f=u/s-l*l;return e.precision(f)}}function ec(e){return(t,i)=>{e.taState||(e.taState={});const r=i||"vwap";e.taState[r]||(e.taState[r]={cumulativePV:0,cumulativeVolume:0,lastSessionDate:null});const s=e.taState[r],n=d.from(t).get(0),a=d.from(e.data.volume).get(0),o=d.from(e.data.openTime).get(0),h=new Date(o).toISOString().slice(0,10);if(s.lastSessionDate!==h&&(s.cumulativePV=0,s.cumulativeVolume=0,s.lastSessionDate=h),s.cumulativePV+=n*a,s.cumulativeVolume+=a,s.cumulativeVolume===0)return NaN;const u=s.cumulativePV/s.cumulativeVolume;return e.precision(u)}}function tc(e){return(t,i,r)=>{const s=d.from(i).get(0);e.taState||(e.taState={});const n=r||`vwma_${s}`;e.taState[n]||(e.taState[n]={window:[],volumeWindow:[]});const a=e.taState[n],o=d.from(t).get(0),h=e.get(e.data.volume,0);if(a.window.unshift(o),a.volumeWindow.unshift(h),a.window.length<s)return NaN;a.window.length>s&&(a.window.pop(),a.volumeWindow.pop());let u=0,l=0;for(let g=0;g<s;g++)u+=a.window[g]*a.volumeWindow[g],l+=a.volumeWindow[g];const f=u/l;return e.precision(f)}}function ic(e){return t=>{e.taState||(e.taState={});const i=t||"wad";e.taState[i]||(e.taState[i]={cumulativeSum:0});const r=e.taState[i],s=e.get(e.data.close,0),n=e.get(e.data.high,0),a=e.get(e.data.low,0),o=e.get(e.data.close,1);if(isNaN(s)||isNaN(n)||isNaN(a))return e.precision(r.cumulativeSum);let h=0;if(!isNaN(o)){const u=Math.max(n,o),l=Math.min(a,o),f=s-o;f>0?h=s-l:f<0&&(h=s-u)}return r.cumulativeSum+=h,e.precision(r.cumulativeSum)}}function rc(e){return(t,i,r)=>{const s=d.from(i).get(0);e.taState||(e.taState={});const n=r||`wma_${s}`;e.taState[n]||(e.taState[n]={window:[]});const a=e.taState[n],o=d.from(t).get(0);if(a.window.unshift(o),a.window.length<s)return NaN;a.window.length>s&&a.window.pop();let h=0,u=0;for(let f=0;f<s;f++){const g=s-f;h+=a.window[f]*g,u+=g}const l=h/u;return e.precision(l)}}function sc(e){return(t,i)=>{const r=d.from(t).get(0);e.taState||(e.taState={});const s=i||`wpr_${r}`;e.taState[s]||(e.taState[s]={highWindow:[],lowWindow:[]});const n=e.taState[s],a=e.get(e.data.high,0),o=e.get(e.data.low,0),h=e.get(e.data.close,0);if(isNaN(a)||isNaN(o)||isNaN(h))return NaN;if(n.highWindow.unshift(a),n.lowWindow.unshift(o),n.highWindow.length<r)return NaN;n.highWindow.length>r&&(n.highWindow.pop(),n.lowWindow.pop());let u=n.highWindow[0],l=n.lowWindow[0];for(let p=1;p<r;p++)n.highWindow[p]>u&&(u=n.highWindow[p]),n.lowWindow[p]<l&&(l=n.lowWindow[p]);const f=u-l;if(f===0)return e.precision(0);const g=(u-h)/f*-100;return e.precision(g)}}function nc(e){return t=>{const i=e.get(e.data.close,0),r=e.get(e.data.open,0),s=e.get(e.data.high,0),n=e.get(e.data.low,0),a=e.get(e.data.volume,0);if(isNaN(i)||isNaN(r)||isNaN(s)||isNaN(n)||isNaN(a))return NaN;const o=s-n;if(o===0)return e.precision(0);const h=(i-r)/o*a;return e.precision(h)}}var ac=Object.defineProperty,oc=(e,t,i)=>t in e?ac(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,S=(e,t,i)=>oc(e,typeof t!="symbol"?t+"":t,i);const hc={accdist:Gh,alma:Yh,atr:Qh,barssince:Xh,bb:Zh,bbw:Jh,cci:eu,change:tu,cmo:iu,cog:ru,correlation:su,cross:nu,crossover:au,crossunder:ou,cum:hu,dev:uu,dmi:cu,ema:lu,falling:pu,highest:fu,highestbars:mu,hma:du,iii:gu,kc:xu,kcw:yu,linreg:wu,lowest:bu,lowestbars:vu,macd:_u,median:Su,mfi:Eu,mode:Nu,mom:Cu,nvi:ku,obv:Iu,param:Au,percentile_linear_interpolation:Pu,percentile_nearest_rank:Tu,percentrank:Ru,pivothigh:Vu,pivotlow:Mu,pvi:Lu,pvt:Bu,range:Fu,rising:ju,rma:$u,roc:Wu,rsi:qu,sar:Uu,sma:Ku,stdev:zu,stoch:Hu,supertrend:Gu,swma:Yu,tr:Qu,tsi:Xu,valuewhen:Zu,variance:Ju,vwap:ec,vwma:tc,wad:ic,wma:rc,wpr:sc,wvad:nc};class uc{constructor(t){this.context=t,S(this,"accdist"),S(this,"alma"),S(this,"atr"),S(this,"barssince"),S(this,"bb"),S(this,"bbw"),S(this,"cci"),S(this,"change"),S(this,"cmo"),S(this,"cog"),S(this,"correlation"),S(this,"cross"),S(this,"crossover"),S(this,"crossunder"),S(this,"cum"),S(this,"dev"),S(this,"dmi"),S(this,"ema"),S(this,"falling"),S(this,"highest"),S(this,"highestbars"),S(this,"hma"),S(this,"iii"),S(this,"kc"),S(this,"kcw"),S(this,"linreg"),S(this,"lowest"),S(this,"lowestbars"),S(this,"macd"),S(this,"median"),S(this,"mfi"),S(this,"mode"),S(this,"mom"),S(this,"nvi"),S(this,"obv"),S(this,"param"),S(this,"percentile_linear_interpolation"),S(this,"percentile_nearest_rank"),S(this,"percentrank"),S(this,"pivothigh"),S(this,"pivotlow"),S(this,"pvi"),S(this,"pvt"),S(this,"range"),S(this,"rising"),S(this,"rma"),S(this,"roc"),S(this,"rsi"),S(this,"sar"),S(this,"sma"),S(this,"stdev"),S(this,"stoch"),S(this,"supertrend"),S(this,"swma"),S(this,"tr"),S(this,"tsi"),S(this,"valuewhen"),S(this,"variance"),S(this,"vwap"),S(this,"vwma"),S(this,"wad"),S(this,"wma"),S(this,"wpr"),S(this,"wvad"),Object.entries(hc).forEach(([i,r])=>{this[i]=r(t)})}}class cc{constructor(t){this.context=t}logFormat(t,...i){return t.replace(/{(\d+)}/g,(r,s)=>i[s])}param(t,i=0,r){return d.from(t).get(i)}warning(t,...i){console.warn(this.logFormat(t,...i))}error(t,...i){console.error(this.logFormat(t,...i))}info(t,...i){console.log(this.logFormat(t,...i))}}class lc{constructor(t){this.context=t}param(t,i=0,r){return d.from(t).get(i)}tostring(t){return String(t)}tonumber(t){return Number(t)}lower(t){return String(t).toLowerCase()}upper(t){return String(t).toUpperCase()}trim(t){return String(t).trim()}repeat(t,i,r=""){return Array(i).fill(t).join(r||"")}replace_all(t,i,r){return String(t).replaceAll(i,r)}replace(t,i,r,s=0){const n=String(t),a=String(i),o=String(r),h=Math.floor(Number(s))||0;if(a==="")return n;let u=0,l=0;for(;;){const f=n.indexOf(a,u);if(f===-1)return n;if(l===h)return n.substring(0,f)+o+n.substring(f+a.length);l++,u=f+a.length}}contains(t,i){return String(t).includes(i)}endswith(t,i){return String(t).endsWith(i)}startswith(t,i){return String(t).startsWith(i)}pos(t,i){const r=String(t).indexOf(i);return r===-1?NaN:r}length(t){return String(t).length}match(t,i){return String(t).match(new RegExp(i))}split(t,i){return[String(t).split(i)]}substring(t,i,r){return String(t).substring(i,r)}format(t,...i){return t.replace(/{(\d+)}/g,(r,s)=>i[s])}}class pc{constructor(t){this.context=t}param(t,i=0,r){return d.from(t).get(i)}get main_period(){return this.context.timeframe}get period(){return this.context.timeframe}get multiplier(){const t=parseInt(this.context.timeframe);return isNaN(t)?1:t}get isdwm(){return["D","W","M"].includes(this.context.timeframe.slice(-1))}get isdaily(){return this.context.timeframe.slice(-1)==="D"}get isweekly(){return this.context.timeframe.slice(-1)==="W"}get ismonthly(){return this.context.timeframe.slice(-1)==="M"}get isseconds(){return this.context.timeframe.slice(-1)==="S"}get isminutes(){return parseInt(this.context.timeframe).toString()==this.context.timeframe.trim()}get isintraday(){return!this.isdwm}from_seconds(t){return t<60?Math.ceil(t/5)*5+"S":t<60*60*24?Math.ceil(t/60):t<=60*60*24*7*52?t%(60*60*24*7)===0?Math.ceil(t/604800)+"W":Math.ceil(t/(60*60*24))+"D":"12M"}in_seconds(t){const i=parseInt(t),r=t.slice(-1);return r==="S"?i:r==="D"?i*60*60*24:r==="W"?i*60*60*24*7:r==="M"?i*60*60*24*30:isNaN(i)?0:i*60}}const fc=["series","title","color","linewidth","style","trackprice","histbase","offset","join","editable","show_last","display","format","precision","force_overlay"],mc={series:"series",title:"string",color:"string",linewidth:"number",style:"string",trackprice:"boolean",histbase:"number",offset:"number",join:"bool",editable:"boolean",show_last:"number",display:"string",format:"string",precision:"number",force_overlay:"boolean"};class dc{constructor(t){this.context=t}extractPlotOptions(t){const i={};for(let r in t)i[r]=d.from(t[r]).get(0);return i}plotchar(t,i,r){this.context.plots[i]||(this.context.plots[i]={data:[],options:this.extractPlotOptions(r),title:i});const s=d.from(t).get(0);this.context.plots[i].data.push({time:this.context.marketData[this.context.idx].openTime,value:s,options:{...this.extractPlotOptions(r),style:"char"}})}plot(...t){const i=Ut(t,fc,mc),{series:r,title:s,...n}=i,a=this.extractPlotOptions(n);this.context.plots[s]||(this.context.plots[s]={data:[],options:a,title:s});const o=d.from(r).get(0);this.context.plots[s].data.push({time:this.context.marketData[this.context.idx].openTime,value:o,options:{color:a.color,offset:a.offset}})}}class gc{constructor(t){this.context=t}get style_dashed(){return"dashed"}get style_solid(){return"solid"}get style_dotted(){return"dotted"}param(t,i=0,r){return d.from(t).get(i)}any(t,i,r,s,n,a,o){return this.context.pine.plot(t,{title:i,color:r,linestyle:s,linewidth:n,editable:a,display:o})}}var xc=Object.defineProperty,yc=(e,t,i)=>t in e?xc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,j=(e,t,i)=>yc(e,typeof t!="symbol"?t+"":t,i);const gr=class Xt{constructor({marketData:t,source:i,tickerId:r,timeframe:s,limit:n,sDate:a,eDate:o,fullContext:h}){j(this,"data",{open:new d([]),high:new d([]),low:new d([]),close:new d([]),volume:new d([]),hl2:new d([]),hlc3:new d([]),ohlc4:new d([]),hlcc4:new d([])}),j(this,"indicator"),j(this,"cache",{}),j(this,"taState",{}),j(this,"isSecondaryContext",!1),j(this,"NA",NaN),j(this,"lang"),j(this,"pine"),j(this,"idx",0),j(this,"params",{}),j(this,"const",{}),j(this,"var",{}),j(this,"let",{}),j(this,"result"),j(this,"plots",{}),j(this,"marketData"),j(this,"source"),j(this,"tickerId"),j(this,"timeframe",""),j(this,"limit"),j(this,"sDate"),j(this,"eDate"),j(this,"fullContext"),j(this,"pineTSCode"),this.marketData=t,this.source=i,this.tickerId=r,this.timeframe=s,this.limit=n,this.sDate=a,this.eDate=o,this.fullContext=h||this;const u=new jo(this),l={na:u.na.bind(u),color:u.color,nz:u.nz.bind(u),indicator:u.indicator.bind(u),fixnan:u.fixnan.bind(u),alertcondition:u.alertcondition.bind(u),bool:u.bool.bind(u)},f=this;this.pine={input:new oh(this),ta:new uc(this),math:new jh(this),request:new Hh(this),array:new la(this),map:new Ca(this),matrix:new Ao(this),syminfo:null,timeframe:new pc(this),barstate:new Do(this),get bar_index(){return f.idx},get last_bar_index(){return f.data.close.length-1},get last_bar_time(){return f.data.openTime.get(f.data.openTime.length-1)},get timenow(){return new Date().getTime()},log:new cc(this),str:new lc(this),...l,...Gn};const g=new dc(this),p=new gc(this);this.bindContextObject(g,["plot","plotchar"]),this.bindContextObject(p,["any","style_dashed","style_solid","style_dotted","param"],"hline")}bindContextObject(t,i,r=""){r&&!this.pine[r]&&(this.pine[r]={});const s=r?this.pine[r]:this.pine;for(const n of i)typeof t[n]=="function"?s[n]=t[n].bind(t):s[n]=t[n]}init(t,i,r=0){let s;return i instanceof d?s=i.get(0):Array.isArray(i)?Array.isArray(i[0])?s=i[0]:s=i[i.length-1+r]:s=i,t?t instanceof d?(t.data[t.data.length-1]=s,t):Array.isArray(t)?(t[t.length-1]=s,new d(t)):new d([s]):new d([s])}initVar(t,i){if(t)return t;let r;return i instanceof d?r=i.get(0):Array.isArray(i)?Array.isArray(i[0])?r=i[0]:r=this.precision(i[i.length-1]):r=this.precision(i),new d([r])}precision(t,i=10){const r=10**i;return typeof t=="number"?Math.round(t*r)/r:t}param(t,i,r){return typeof t=="string"?t:t instanceof d?i?new d(t.data,t.offset+i):t:!Array.isArray(t)&&typeof t=="object"?t:(this.params[r]||(this.params[r]=[]),Array.isArray(t)?new d(t,i||0):(this.params[r].length===0?this.params[r].push(t):this.params[r][this.params[r].length-1]=t,new d(this.params[r],0)))}get(t,i){if(t instanceof d)return t.get(i);if(Array.isArray(t)){const r=t.length-1-i;return r<0||r>=t.length?NaN:t[r]}return t}set(t,i){if(t instanceof d){t.set(0,i);return}if(Array.isArray(t)){t.length>0?t[t.length-1]=i:t.push(i);return}}get math(){return this._showDeprecationWarning("const math = context.math","const { math, ta, input } = context.pine"),this.pine.math}get ta(){return this._showDeprecationWarning("const ta = context.ta","const { ta, math, input } = context.pine"),this.pine.ta}get input(){return this._showDeprecationWarning("const input = context.input","const { input, math, ta } = context.pine"),this.pine.input}get request(){return this._showDeprecationWarning("const request = context.request","const { request, math, ta } = context.pine"),this.pine.request}get array(){return this._showDeprecationWarning("const array = context.array","const { array, math, ta } = context.pine"),this.pine.array}get core(){return this._showDeprecationWarning("context.core.*","context.pine (e.g., const { na, plotchar, color, plot, nz } = context.pine)"),{na:this.pine.na,plotchar:this.pine.plotchar,color:this.pine.color,plot:this.pine.plot,nz:this.pine.nz}}_showDeprecationWarning(t,i){const r=`${t}->${i}`;Xt._deprecationWarningsShown.has(r)||(Xt._deprecationWarningsShown.add(r),typeof window<"u"?console.warn("%c[WARNING]%c %s syntax is deprecated. Use %s instead. This will be removed in a future version.","color: #FFA500; font-weight: bold;","color: #FFA500;",t,i):console.warn(`\x1B[33m[WARNING] ${t} syntax is deprecated. Use ${i} instead. This will be removed in a future version.\x1B[0m`))}};j(gr,"_deprecationWarningsShown",new Set);let Kt=gr;var wc=Object.defineProperty,bc=(e,t,i)=>t in e?wc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,K=(e,t,i)=>bc(e,typeof t!="symbol"?t+"":t,i);class zt{constructor(t,i,r,s,n,a){this.source=t,this.tickerId=i,this.timeframe=r,this.limit=s,this.sDate=n,this.eDate=a,K(this,"data",[]),K(this,"open",[]),K(this,"high",[]),K(this,"low",[]),K(this,"close",[]),K(this,"volume",[]),K(this,"hl2",[]),K(this,"hlc3",[]),K(this,"ohlc4",[]),K(this,"hlcc4",[]),K(this,"openTime",[]),K(this,"closeTime",[]),K(this,"_readyPromise",null),K(this,"_ready",!1),K(this,"_debugSettings",{ln:!1,debug:!1}),K(this,"_transpiledCode",null),K(this,"_isSecondaryContext",!1),K(this,"_syminfo"),this._readyPromise=new Promise(o=>{this.loadMarketData(t,i,r,s,n,a).then(h=>{const u=h;this.data=u;const l=u.map(C=>C.open),f=u.map(C=>C.close),g=u.map(C=>C.high),p=u.map(C=>C.low),x=u.map(C=>C.volume),y=u.map(C=>(C.high+C.low+C.close)/3),w=u.map(C=>(C.high+C.low)/2),E=u.map(C=>(C.high+C.low+C.open+C.close)/4),A=u.map(C=>(C.high+C.low+C.close+C.close)/4),k=u.map(C=>C.openTime),T=u.map(C=>C.closeTime);this.open=l,this.close=f,this.high=g,this.low=p,this.volume=x,this.hl2=w,this.hlc3=y,this.ohlc4=E,this.hlcc4=A,this.openTime=k,this.closeTime=T,t&&t.getSymbolInfo?t.getSymbolInfo(i).then(C=>{this._syminfo=C,this._ready=!0,o(!0)}).catch(C=>{console.warn("Failed to get symbol info, using default values:",C),this._ready=!0,o(!0)}):(this._ready=!0,o(!0))})})}get transpiledCode(){return this._transpiledCode}markAsSecondary(){this._isSecondaryContext=!0}setDebugSettings({ln:t,debug:i}){this._debugSettings.ln=t,this._debugSettings.debug=i}async loadMarketData(t,i,r,s,n,a){return Array.isArray(t)?t:t.getMarketData(i,r,s,n,a)}async ready(){if(this._ready)return!0;if(!this._readyPromise)throw new Error("PineTS is not ready");return this._readyPromise}run(t,i,r){if(r&&r>0){const s=typeof this.eDate>"u"&&!Array.isArray(this.source);return this._runPaginated(t,i,r,s)}else return this._runComplete(t,i)}async _runComplete(t,i){await this.ready(),i||(i=this.data.length);const r=this._initializeContext(t,this._isSecondaryContext);return this._transpiledCode=this._transpileCode(t),await this._executeIterations(r,this._transpiledCode,this.data.length-i,this.data.length),r}async*_runPaginated(t,i,r,s=!1){await this.ready(),i||(i=this.data.length);const n=this._initializeContext(t,this._isSecondaryContext);this._transpiledCode=this._transpileCode(t);let a=this.data.length-i;for(;;){const o=this.data.length-a;if(o>0){const l=Math.min(o,r),f=this._getResultLength(n.result);await this._executeIterations(n,this._transpiledCode,a,a+l),a+=l,yield this._createPageContext(n,f);continue}if(!s||Array.isArray(this.source))break;const{newCandles:h,updatedLastCandle:u}=await this._updateMarketData();if(h===0&&!u){yield null;continue}this._removeLastResult(n),a=this.data.length-(h+1),n.pine.barstate.setLive()}}_getResultLength(t){if(Array.isArray(t))return t.length;if(typeof t=="object"&&t!==null){const i=Object.keys(t);if(i.length>0&&Array.isArray(t[i[0]]))return t[i[0]].length}return 0}_createPageContext(t,i){const r=new Kt({marketData:this.data,source:this.source,tickerId:this.tickerId,timeframe:this.timeframe,limit:this.limit,sDate:this.sDate,eDate:this.eDate,fullContext:t});if(r.pineTSCode=t.pineTSCode,r.idx=t.idx,Array.isArray(t.result))r.result=t.result.slice(i);else if(typeof t.result=="object"&&t.result!==null){r.result={};for(let s in t.result)Array.isArray(t.result[s])?r.result[s]=t.result[s].slice(i):r.result[s]=t.result[s]}else r.result=t.result;return r.plots={...t.plots},r}async _updateMarketData(t){if(Array.isArray(this.source))return{newCandles:0,updatedLastCandle:!1};const i=this.source,r=this.data.length-1,s=this.data[r].openTime;try{const n=await i.getMarketData(this.tickerId,this.timeframe,void 0,s,t);if(!n||n.length===0)return{newCandles:0,updatedLastCandle:!1};let a=!1,o=0;for(let h=0;h<n.length;h++){const u=n[h];u.openTime===s?(this._replaceCandle(r,u),a=!0):u.openTime>s&&(this._appendCandle(u),o++)}return{newCandles:o,updatedLastCandle:a}}catch(n){return console.error("Error updating market data:",n),{newCandles:0,updatedLastCandle:!1}}}_replaceCandle(t,i){this.data[t]=i,this.open[t]=i.open,this.close[t]=i.close,this.high[t]=i.high,this.low[t]=i.low,this.volume[t]=i.volume,this.hl2[t]=(i.high+i.low)/2,this.hlc3[t]=(i.high+i.low+i.close)/3,this.ohlc4[t]=(i.high+i.low+i.open+i.close)/4,this.hlcc4[t]=(i.high+i.low+i.close+i.close)/4,this.openTime[t]=i.openTime,this.closeTime[t]=i.closeTime}_appendCandle(t){this.data.push(t),this.open.push(t.open),this.close.push(t.close),this.high.push(t.high),this.low.push(t.low),this.volume.push(t.volume),this.hl2.push((t.high+t.low)/2),this.hlc3.push((t.high+t.low+t.close)/3),this.ohlc4.push((t.high+t.low+t.open+t.close)/4),this.hlcc4.push((t.high+t.low+t.close+t.close)/4),this.openTime.push(t.openTime),this.closeTime.push(t.closeTime)}_removeLastResult(t){if(Array.isArray(t.result))t.result.pop();else if(typeof t.result=="object"&&t.result!==null)for(let i in t.result)Array.isArray(t.result[i])&&t.result[i].pop();t.data.close.data.pop(),t.data.open.data.pop(),t.data.high.data.pop(),t.data.low.data.pop(),t.data.volume.data.pop(),t.data.hl2.data.pop(),t.data.hlc3.data.pop(),t.data.ohlc4.data.pop(),t.data.hlcc4.data.pop(),t.data.openTime.data.pop(),t.data.closeTime&&t.data.closeTime.data.pop()}_initializeContext(t,i=!1){const r=new Kt({marketData:this.data,source:this.source,tickerId:this.tickerId,timeframe:this.timeframe,limit:this.limit,sDate:this.sDate,eDate:this.eDate});return r.pine.syminfo=this._syminfo,r.pineTSCode=t,r.isSecondaryContext=i,r.data.close=new d([]),r.data.open=new d([]),r.data.high=new d([]),r.data.low=new d([]),r.data.volume=new d([]),r.data.hl2=new d([]),r.data.hlc3=new d([]),r.data.ohlc4=new d([]),r.data.hlcc4=new d([]),r.data.openTime=new d([]),r.data.closeTime=new d([]),r}_transpileCode(t){return cn.bind(this)(t,this._debugSettings)}async _executeIterations(t,i,r,s){const n=["const","var","let","params"];for(let a=r;a<s;a++){t.idx=a,t.data.close.data.push(this.close[a]),t.data.open.data.push(this.open[a]),t.data.high.data.push(this.high[a]),t.data.low.data.push(this.low[a]),t.data.volume.data.push(this.volume[a]),t.data.hl2.data.push(this.hl2[a]),t.data.hlc3.data.push(this.hlc3[a]),t.data.ohlc4.data.push(this.ohlc4[a]),t.data.hlcc4.data.push(this.hlcc4[a]),t.data.openTime.data.push(this.openTime[a]),t.data.closeTime.data.push(this.closeTime[a]);const o=await i(t);if(typeof o=="object"){typeof t.result!="object"&&(t.result={});for(let h in o){t.result[h]===void 0&&(t.result[h]=[]);let u;o[h]instanceof d?u=o[h].get(0):Array.isArray(o[h])?u=o[h][o[h].length-1]:u=o[h],t.result[h].push(u)}}else Array.isArray(t.result)||(t.result=[]),t.result.push(o);for(let h of n)for(let u in t[h]){const l=t[h][u];if(l instanceof d){const f=l.get(0);l.data.push(f)}else if(Array.isArray(l)){const f=l[l.length-1];l.push(f)}}}}}var vc=Object.defineProperty,_c=(e,t,i)=>t in e?vc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Ht=(e,t,i)=>_c(e,typeof t!="symbol"?t+"":t,i);const xr="https://api.binance.com/api/v3",Gt={1:"1m",3:"3m",5:"5m",15:"15m",30:"30m",45:null,60:"1h",120:"2h",180:null,240:"4h","4H":"4h","1D":"1d",D:"1d","1W":"1w",W:"1w","1M":"1M",M:"1M"};class Sc{constructor(t=5*60*1e3){Ht(this,"cache"),Ht(this,"cacheDuration"),this.cache=new Map,this.cacheDuration=t}generateKey(t){return Object.entries(t).filter(([i,r])=>r!==void 0).map(([i,r])=>`${i}:${r}`).join("|")}get(t){const i=this.generateKey(t),r=this.cache.get(i);return r?Date.now()-r.timestamp>this.cacheDuration?(this.cache.delete(i),null):r.data:null}set(t,i){const r=this.generateKey(t);this.cache.set(r,{data:i,timestamp:Date.now()})}clear(){this.cache.clear()}cleanup(){const t=Date.now();for(const[i,r]of this.cache.entries())t-r.timestamp>this.cacheDuration&&this.cache.delete(i)}}class Ec{constructor(){Ht(this,"cacheManager"),this.cacheManager=new Sc(5*60*1e3)}async getMarketDataInterval(t,i,r,s){try{const n=Gt[i.toUpperCase()];if(!n)return console.error(`Unsupported timeframe: ${i}`),[];const a={"1m":60*1e3,"3m":3*60*1e3,"5m":5*60*1e3,"15m":15*60*1e3,"30m":30*60*1e3,"1h":60*60*1e3,"2h":2*60*60*1e3,"4h":4*60*60*1e3,"1d":24*60*60*1e3,"1w":7*24*60*60*1e3,"1M":30*24*60*60*1e3};let o=[],h=r;const u=s,l=a[n];if(!l)return console.error(`Duration not defined for interval: ${n}`),[];for(;h<u;){const f=Math.min(h+1e3*l,u),g=await this.getMarketData(t,i,1e3,h,f);if(g.length===0)break;o=o.concat(g),h=g[g.length-1].closeTime+1}return o}catch(n){return console.error("Error in getMarketDataInterval:",n),[]}}async getMarketData(t,i,r,s,n){try{const a=n!==void 0,o={tickerId:t,timeframe:i,limit:r,sDate:s,eDate:n};if(a){const g=this.cacheManager.get(o);if(g)return g}const h=Gt[i.toUpperCase()];if(!h)return console.error(`Unsupported timeframe: ${i}`),[];if(this.shouldPaginate(i,r,s,n)&&s&&n){const g=await this.getMarketDataInterval(t,i,s,n),p=r?g.slice(0,r):g;return this.cacheManager.set(o,p),p}let u=`${xr}/klines?symbol=${t}&interval=${h}`;r&&(u+=`&limit=${Math.min(r,1e3)}`),s&&(u+=`&startTime=${s}`),n&&(u+=`&endTime=${n}`);const l=await fetch(u);if(!l.ok)throw new Error(`HTTP error! status: ${l.status}`);const f=(await l.json()).map(g=>({openTime:parseInt(g[0]),open:parseFloat(g[1]),high:parseFloat(g[2]),low:parseFloat(g[3]),close:parseFloat(g[4]),volume:parseFloat(g[5]),closeTime:parseInt(g[6]),quoteAssetVolume:parseFloat(g[7]),numberOfTrades:parseInt(g[8]),takerBuyBaseAssetVolume:parseFloat(g[9]),takerBuyQuoteAssetVolume:parseFloat(g[10]),ignore:g[11]}));return a&&this.cacheManager.set(o,f),f}catch(a){return console.error("Error in binance.klines:",a),[]}}shouldPaginate(t,i,r,s){if(i&&i>1e3)return!0;if(r&&s){const n=Gt[t.toUpperCase()],a={"1m":60*1e3,"3m":3*60*1e3,"5m":5*60*1e3,"15m":15*60*1e3,"30m":30*60*1e3,"1h":60*60*1e3,"2h":2*60*60*1e3,"4h":4*60*60*1e3,"1d":24*60*60*1e3,"1w":7*24*60*60*1e3,"1M":30*24*60*60*1e3}[n];if(a)return Math.ceil((s-r)/a)>1e3}return!1}async getSymbolInfo(t){try{let i="crypto",r=xr,s=t,n="";t.endsWith(".P")?(i="futures",s=t.replace(".P",""),r="https://fapi.binance.com/fapi/v1",n="Perpetual"):t.includes("_")&&(i="futures",s=t,r="https://dapi.binance.com/dapi/v1",n="Delivery");const a=i==="crypto"?`${r}/exchangeInfo?symbol=${s}`:`${r}/exchangeInfo`,o=await fetch(a);if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);const h=(await o.json()).symbols;if(!h||h.length===0)return console.error(`Symbol ${t} not found`),null;const u=i==="futures"?h.find(k=>k.symbol===s):h[0];if(!u)return console.error(`Symbol ${s} not found in exchange info`),null;const l=u.filters?.find(k=>k.filterType==="PRICE_FILTER"),f=u.filters?.find(k=>k.filterType==="LOT_SIZE"),g=l?parseFloat(l.tickSize):.01,p=f?parseFloat(f.minQty):0,x=Math.round(1/g),y=u.baseAsset,w=u.quoteAsset,E=n?` ${n}`:"",A=`${y} / ${w}${E}`;return{ticker:t,tickerid:`BINANCE:${t}`,prefix:"BINANCE",root:y,description:A,type:i,main_tickerid:`BINANCE:${t}`,current_contract:n,isin:"",basecurrency:y,currency:w,timezone:"Etc/UTC",country:"",mintick:g,pricescale:x,minmove:1,pointvalue:u.contractSize||1,mincontract:p,session:"24x7",volumetype:"base",expiration_date:u.deliveryDate||0,employees:0,industry:"",sector:"",shareholders:0,shares_outstanding_float:0,shares_outstanding_total:0,recommendations_buy:0,recommendations_buy_strong:0,recommendations_date:0,recommendations_hold:0,recommendations_sell:0,recommendations_sell_strong:0,recommendations_total:0,target_price_average:0,target_price_date:0,target_price_estimates:0,target_price_high:0,target_price_low:0,target_price_median:0}}catch(i){return console.error("Error in binance.exchangeInfo:",i),null}}}class Nc{async getMarketData(){return[]}}const Cc=typeof process<"u"&&process.versions&&process.versions.node;let yt=null;if(Cc)try{yt=new Nc}catch{yt=null}const kc={Binance:new Ec,...yt?{Mock:yt}:{}};Ce.Context=Kt,Ce.PineTS=zt,Ce.Provider=kc,Object.defineProperty(Ce,"__esModule",{value:!0})});
117
+ ;var PineTS = PineTSLib.PineTS;PineTS.Provider = PineTSLib.Provider;PineTS.Context = PineTSLib.Context;//# sourceMappingURL=pinets.min.browser.js.map