tjs-lang 0.8.6 → 0.8.7

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.
@@ -1,4 +1,4 @@
1
- var fa=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ei=fa((Pc,Fo)=>{Fo.exports={name:"tjs-lang",version:"0.8.6",description:"Type-safe JavaScript dialect with runtime validation, sandboxed VM execution, and AI agent orchestration. Transpiles TypeScript to validated JS with fuel-metered execution for untrusted code.",keywords:["typescript","transpiler","runtime-validation","type-safety","sandbox","virtual-machine","wasm-alternative","ai-agents","llm","orchestration","security","fuel-metering","capability-based","json-ast","untrusted-code"],license:"Apache-2.0",main:"./dist/index.js",types:"./dist/src/index.d.ts",typesVersions:{"*":{eval:["./dist/src/lang/eval.d.ts"],lang:["./dist/src/lang/transpiler.d.ts"],"lang/from-ts":["./dist/src/lang/emitters/from-ts.d.ts"],browser:["./dist/src/lang/browser.d.ts"],"browser/from-ts":["./dist/src/lang/browser-from-ts.d.ts"],vm:["./dist/src/vm/index.d.ts"],batteries:["./dist/src/batteries/index.d.ts"]}},exports:{".":{bun:"./src/index.ts",types:"./dist/src/index.d.ts",default:"./dist/index.js"},"./eval":{bun:"./src/lang/eval.ts",types:"./dist/src/lang/eval.d.ts",default:"./dist/tjs-eval.js"},"./lang":{bun:"./src/lang/transpiler.ts",types:"./dist/src/lang/transpiler.d.ts",default:"./dist/tjs-lang.js"},"./lang/from-ts":{bun:"./src/lang/emitters/from-ts.ts",types:"./dist/src/lang/emitters/from-ts.d.ts",default:"./dist/tjs-from-ts.js"},"./browser":{types:"./dist/src/lang/browser.d.ts",default:"./dist/tjs-browser.js"},"./browser/from-ts":{types:"./dist/src/lang/browser-from-ts.d.ts",default:"./dist/tjs-browser-from-ts.js"},"./vm":{bun:"./src/vm/index.ts",types:"./dist/src/vm/index.d.ts",default:"./dist/tjs-vm.js"},"./batteries":{bun:"./src/batteries/index.ts",types:"./dist/src/batteries/index.d.ts",default:"./dist/tjs-batteries.js"},"./linalg":{bun:"./src/linalg/index.tjs",default:"./dist/tjs-linalg.js"},"./src":"./src/index.ts","./editors/monaco":"./editors/monaco/ajs-monarch.js","./editors/codemirror":"./editors/codemirror/ajs-language.js","./editors/ace":"./editors/ace/ajs-mode.js"},bin:{tjs:"./src/cli/tjs.ts",tjsx:"./src/cli/tjsx.ts","tjs-playground":"./src/cli/playground.ts","create-tjs-app":"./src/cli/create-app.ts","ajs-install-vscode":"./bin/install-vscode.sh","ajs-install-cursor":"./bin/install-cursor.sh"},type:"module",files:["dist","src","docs","editors","bin","demo","tjs-lang.svg","CONTEXT.md","CLAUDE.md","llms.txt"],sideEffects:!1,repository:{type:"git",url:"https://github.com/tonioloewald/tjs-lang.git"},devDependencies:{"@codemirror/lang-css":"^6.3.1","@codemirror/lang-html":"^6.4.11","@codemirror/lang-javascript":"^6.2.4","@codemirror/lang-markdown":"^6.5.0","@codemirror/state":"^6.5.3","@codemirror/theme-one-dark":"^6.1.3","@codemirror/view":"^6.39.9","@eslint/js":"^10.0.1","@happy-dom/global-registrator":"^20.1.0","@types/bun":"latest","@types/jsdom":"^21.1.7","acorn-walk":"^8.3.4",chokidar:"^4.0.3",codemirror:"^6.0.2",esbuild:"^0.28.0",eslint:"^10.4.1",firebase:"^10.12.0","firebase-admin":"^13.6.0","firebase-functions":"^7.0.5",globals:"^17.6.0",marked:"^9.1.6",prettier:"^2.8.8",tosijs:"^1.5.6","tosijs-ui":"^1.4.7",typescript:"^5.6.2","typescript-eslint":"^8.61.0",valibot:"^0.36.0",vitest:"^2.0.5"},scripts:{format:"bun eslint src --fix && bun prettier --write .",lint:"eslint src","build:grammars":"bun editors/build-grammars.ts","test:fast":"SKIP_LLM_TESTS=1 SKIP_BENCHMARKS=1 bun test","test:llm":"bun test src/batteries/models.integration.test.ts",bench:"bun bin/benchmarks.ts",make:"rm -rf dist && bun format && bun run build:grammars && tsc -p tsconfig.build.json && bun scripts/build.ts","build:bundles":"bun scripts/build.ts",typecheck:"tsc --noEmit",latest:"rm -rf node_modules && bun install",docs:"node bin/docs.js",dev:"bun run bin/dev.ts","build:demo":"bun scripts/build-demo.ts","build:cli":"bun build src/cli/tjs.ts --compile --outfile=dist/tjs && bun build src/cli/tjsx.ts --compile --outfile=dist/tjsx","functions:build":"cd functions && npm run build","functions:deploy":"cd functions && npm run deploy","functions:serve":"cd functions && npm run serve","deploy:hosting":"bun run build:demo && firebase deploy --only hosting",deploy:"bun run build:demo && bun run functions:deploy && firebase deploy --only hosting",start:"bun run build:demo && bun run dev"},dependencies:{acorn:"^8.15.0","acorn-loose":"^8.5.2","acorn-walk":"^8.3.4","tosijs-schema":"^1.3.0"}}});var pa=[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],Yr=[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],ha="\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",Xr="\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",Rn={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"},Mn="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",da={5:Mn,"5module":Mn+" export import",6:Mn+" const class extends export import super"},ma=/^in(stanceof)?$/,ga=new RegExp("["+Xr+"]"),ya=new RegExp("["+Xr+ha+"]");function Bn(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function Ce(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&ga.test(String.fromCharCode(e)):t===!1?!1:Bn(e,Yr)}function Je(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&&ya.test(String.fromCharCode(e)):t===!1?!1:Bn(e,Yr)||Bn(e,pa)}var q=function(t,n){n===void 0&&(n={}),this.label=t,this.keyword=n.keyword,this.beforeExpr=!!n.beforeExpr,this.startsExpr=!!n.startsExpr,this.isLoop=!!n.isLoop,this.isAssign=!!n.isAssign,this.prefix=!!n.prefix,this.postfix=!!n.postfix,this.binop=n.binop||null,this.updateContext=null};function be(e,t){return new q(e,{beforeExpr:!0,binop:t})}var xe={beforeExpr:!0},de={startsExpr:!0},Vn={};function L(e,t){return t===void 0&&(t={}),t.keyword=e,Vn[e]=new q(e,t)}var h={num:new q("num",de),regexp:new q("regexp",de),string:new q("string",de),name:new q("name",de),privateId:new q("privateId",de),eof:new q("eof"),bracketL:new q("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new q("]"),braceL:new q("{",{beforeExpr:!0,startsExpr:!0}),braceR:new q("}"),parenL:new q("(",{beforeExpr:!0,startsExpr:!0}),parenR:new q(")"),comma:new q(",",xe),semi:new q(";",xe),colon:new q(":",xe),dot:new q("."),question:new q("?",xe),questionDot:new q("?."),arrow:new q("=>",xe),template:new q("template"),invalidTemplate:new q("invalidTemplate"),ellipsis:new q("...",xe),backQuote:new q("`",de),dollarBraceL:new q("${",{beforeExpr:!0,startsExpr:!0}),eq:new q("=",{beforeExpr:!0,isAssign:!0}),assign:new q("_=",{beforeExpr:!0,isAssign:!0}),incDec:new q("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new q("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:be("||",1),logicalAND:be("&&",2),bitwiseOR:be("|",3),bitwiseXOR:be("^",4),bitwiseAND:be("&",5),equality:be("==/!=/===/!==",6),relational:be("</>/<=/>=",7),bitShift:be("<</>>/>>>",8),plusMin:new q("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:be("%",10),star:be("*",10),slash:be("/",10),starstar:new q("**",{beforeExpr:!0}),coalesce:be("??",1),_break:L("break"),_case:L("case",xe),_catch:L("catch"),_continue:L("continue"),_debugger:L("debugger"),_default:L("default",xe),_do:L("do",{isLoop:!0,beforeExpr:!0}),_else:L("else",xe),_finally:L("finally"),_for:L("for",{isLoop:!0}),_function:L("function",de),_if:L("if"),_return:L("return",xe),_switch:L("switch"),_throw:L("throw",xe),_try:L("try"),_var:L("var"),_const:L("const"),_while:L("while",{isLoop:!0}),_with:L("with"),_new:L("new",{beforeExpr:!0,startsExpr:!0}),_this:L("this",de),_super:L("super",de),_class:L("class",de),_extends:L("extends",xe),_export:L("export"),_import:L("import",de),_null:L("null",de),_true:L("true",de),_false:L("false",de),_in:L("in",{beforeExpr:!0,binop:7}),_instanceof:L("instanceof",{beforeExpr:!0,binop:7}),_typeof:L("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:L("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:L("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},me=/\r\n?|\n|\u2028|\u2029/,ba=new RegExp(me.source,"g");function ct(e){return e===10||e===13||e===8232||e===8233}function es(e,t,n){n===void 0&&(n=e.length);for(var r=t;r<n;r++){var s=e.charCodeAt(r);if(ct(s))return r<n-1&&s===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var ts=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,oe=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ns=Object.prototype,xa=ns.hasOwnProperty,_a=ns.toString,lt=Object.hasOwn||(function(e,t){return xa.call(e,t)}),Gr=Array.isArray||(function(e){return _a.call(e)==="[object Array]"}),Hr=Object.create(null);function We(e){return Hr[e]||(Hr[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function Be(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var wa=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,vt=function(t,n){this.line=t,this.column=n};vt.prototype.offset=function(t){return new vt(this.line,this.column+t)};var Xt=function(t,n,r){this.start=n,this.end=r,t.sourceFile!==null&&(this.source=t.sourceFile)};function rs(e,t){for(var n=1,r=0;;){var s=es(e,r,t);if(s<0)return new vt(n,t-r);++n,r=s}}var Fn={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},Kr=!1;function Sa(e){var t={};for(var n in Fn)t[n]=e&&lt(e,n)?e[n]:Fn[n];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!Kr&&typeof console=="object"&&console.warn&&(Kr=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
1
+ var fa=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ei=fa((Pc,Fo)=>{Fo.exports={name:"tjs-lang",version:"0.8.7",description:"Type-safe JavaScript dialect with runtime validation, sandboxed VM execution, and AI agent orchestration. Transpiles TypeScript to validated JS with fuel-metered execution for untrusted code.",keywords:["typescript","transpiler","runtime-validation","type-safety","sandbox","virtual-machine","wasm-alternative","ai-agents","llm","orchestration","security","fuel-metering","capability-based","json-ast","untrusted-code"],license:"Apache-2.0",main:"./dist/index.js",types:"./dist/src/index.d.ts",typesVersions:{"*":{eval:["./dist/src/lang/eval.d.ts"],lang:["./dist/src/lang/transpiler.d.ts"],"lang/from-ts":["./dist/src/lang/emitters/from-ts.d.ts"],browser:["./dist/src/lang/browser.d.ts"],"browser/from-ts":["./dist/src/lang/browser-from-ts.d.ts"],vm:["./dist/src/vm/index.d.ts"],batteries:["./dist/src/batteries/index.d.ts"]}},exports:{".":{bun:"./src/index.ts",types:"./dist/src/index.d.ts",default:"./dist/index.js"},"./eval":{bun:"./src/lang/eval.ts",types:"./dist/src/lang/eval.d.ts",default:"./dist/tjs-eval.js"},"./lang":{bun:"./src/lang/transpiler.ts",types:"./dist/src/lang/transpiler.d.ts",default:"./dist/tjs-lang.js"},"./lang/from-ts":{bun:"./src/lang/emitters/from-ts.ts",types:"./dist/src/lang/emitters/from-ts.d.ts",default:"./dist/tjs-from-ts.js"},"./browser":{types:"./dist/src/lang/browser.d.ts",default:"./dist/tjs-browser.js"},"./browser/from-ts":{types:"./dist/src/lang/browser-from-ts.d.ts",default:"./dist/tjs-browser-from-ts.js"},"./vm":{bun:"./src/vm/index.ts",types:"./dist/src/vm/index.d.ts",default:"./dist/tjs-vm.js"},"./batteries":{bun:"./src/batteries/index.ts",types:"./dist/src/batteries/index.d.ts",default:"./dist/tjs-batteries.js"},"./linalg":{bun:"./src/linalg/index.tjs",default:"./dist/tjs-linalg.js"},"./src":"./src/index.ts","./editors/monaco":"./editors/monaco/ajs-monarch.js","./editors/codemirror":"./editors/codemirror/ajs-language.js","./editors/ace":"./editors/ace/ajs-mode.js"},bin:{tjs:"./src/cli/tjs.ts",tjsx:"./src/cli/tjsx.ts","tjs-playground":"./src/cli/playground.ts","create-tjs-app":"./src/cli/create-app.ts","ajs-install-vscode":"./bin/install-vscode.sh","ajs-install-cursor":"./bin/install-cursor.sh"},type:"module",files:["dist","src","docs","editors","bin","demo","tjs-lang.svg","CONTEXT.md","CLAUDE.md","llms.txt"],sideEffects:!1,repository:{type:"git",url:"https://github.com/tonioloewald/tjs-lang.git"},devDependencies:{"@codemirror/lang-css":"^6.3.1","@codemirror/lang-html":"^6.4.11","@codemirror/lang-javascript":"^6.2.4","@codemirror/lang-markdown":"^6.5.0","@codemirror/state":"^6.5.3","@codemirror/theme-one-dark":"^6.1.3","@codemirror/view":"^6.39.9","@eslint/js":"^10.0.1","@happy-dom/global-registrator":"^20.1.0","@types/bun":"latest","@types/jsdom":"^21.1.7","acorn-walk":"^8.3.4",chokidar:"^4.0.3",codemirror:"^6.0.2",esbuild:"^0.28.0",eslint:"^10.4.1",firebase:"^10.12.0","firebase-admin":"^13.6.0","firebase-functions":"^7.0.5",globals:"^17.6.0",marked:"^9.1.6",prettier:"^2.8.8",tosijs:"^1.5.6","tosijs-ui":"^1.4.7",typescript:"^5.6.2","typescript-eslint":"^8.61.0",valibot:"^0.36.0",vitest:"^2.0.5"},scripts:{format:"bun eslint src --fix && bun prettier --write .",lint:"eslint src","build:grammars":"bun editors/build-grammars.ts","test:fast":"SKIP_LLM_TESTS=1 SKIP_BENCHMARKS=1 bun test","test:llm":"bun test src/batteries/models.integration.test.ts",bench:"bun bin/benchmarks.ts",make:"rm -rf dist && bun format && bun run build:grammars && tsc -p tsconfig.build.json && bun scripts/build.ts","build:bundles":"bun scripts/build.ts",typecheck:"tsc --noEmit",latest:"rm -rf node_modules && bun install",docs:"node bin/docs.js",dev:"bun run bin/dev.ts","build:demo":"bun scripts/build-demo.ts","build:cli":"bun build src/cli/tjs.ts --compile --outfile=dist/tjs && bun build src/cli/tjsx.ts --compile --outfile=dist/tjsx","functions:build":"cd functions && npm run build","functions:deploy":"cd functions && npm run deploy","functions:serve":"cd functions && npm run serve","deploy:hosting":"bun run build:demo && firebase deploy --only hosting",deploy:"bun run build:demo && bun run functions:deploy && firebase deploy --only hosting",start:"bun run build:demo && bun run dev"},dependencies:{acorn:"^8.15.0","acorn-loose":"^8.5.2","acorn-walk":"^8.3.4","tosijs-schema":"^1.3.0"}}});var pa=[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],Yr=[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],ha="\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",Xr="\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",Rn={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"},Mn="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",da={5:Mn,"5module":Mn+" export import",6:Mn+" const class extends export import super"},ma=/^in(stanceof)?$/,ga=new RegExp("["+Xr+"]"),ya=new RegExp("["+Xr+ha+"]");function Bn(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function Ce(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&ga.test(String.fromCharCode(e)):t===!1?!1:Bn(e,Yr)}function Je(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&&ya.test(String.fromCharCode(e)):t===!1?!1:Bn(e,Yr)||Bn(e,pa)}var q=function(t,n){n===void 0&&(n={}),this.label=t,this.keyword=n.keyword,this.beforeExpr=!!n.beforeExpr,this.startsExpr=!!n.startsExpr,this.isLoop=!!n.isLoop,this.isAssign=!!n.isAssign,this.prefix=!!n.prefix,this.postfix=!!n.postfix,this.binop=n.binop||null,this.updateContext=null};function be(e,t){return new q(e,{beforeExpr:!0,binop:t})}var xe={beforeExpr:!0},de={startsExpr:!0},Vn={};function L(e,t){return t===void 0&&(t={}),t.keyword=e,Vn[e]=new q(e,t)}var h={num:new q("num",de),regexp:new q("regexp",de),string:new q("string",de),name:new q("name",de),privateId:new q("privateId",de),eof:new q("eof"),bracketL:new q("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new q("]"),braceL:new q("{",{beforeExpr:!0,startsExpr:!0}),braceR:new q("}"),parenL:new q("(",{beforeExpr:!0,startsExpr:!0}),parenR:new q(")"),comma:new q(",",xe),semi:new q(";",xe),colon:new q(":",xe),dot:new q("."),question:new q("?",xe),questionDot:new q("?."),arrow:new q("=>",xe),template:new q("template"),invalidTemplate:new q("invalidTemplate"),ellipsis:new q("...",xe),backQuote:new q("`",de),dollarBraceL:new q("${",{beforeExpr:!0,startsExpr:!0}),eq:new q("=",{beforeExpr:!0,isAssign:!0}),assign:new q("_=",{beforeExpr:!0,isAssign:!0}),incDec:new q("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new q("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:be("||",1),logicalAND:be("&&",2),bitwiseOR:be("|",3),bitwiseXOR:be("^",4),bitwiseAND:be("&",5),equality:be("==/!=/===/!==",6),relational:be("</>/<=/>=",7),bitShift:be("<</>>/>>>",8),plusMin:new q("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:be("%",10),star:be("*",10),slash:be("/",10),starstar:new q("**",{beforeExpr:!0}),coalesce:be("??",1),_break:L("break"),_case:L("case",xe),_catch:L("catch"),_continue:L("continue"),_debugger:L("debugger"),_default:L("default",xe),_do:L("do",{isLoop:!0,beforeExpr:!0}),_else:L("else",xe),_finally:L("finally"),_for:L("for",{isLoop:!0}),_function:L("function",de),_if:L("if"),_return:L("return",xe),_switch:L("switch"),_throw:L("throw",xe),_try:L("try"),_var:L("var"),_const:L("const"),_while:L("while",{isLoop:!0}),_with:L("with"),_new:L("new",{beforeExpr:!0,startsExpr:!0}),_this:L("this",de),_super:L("super",de),_class:L("class",de),_extends:L("extends",xe),_export:L("export"),_import:L("import",de),_null:L("null",de),_true:L("true",de),_false:L("false",de),_in:L("in",{beforeExpr:!0,binop:7}),_instanceof:L("instanceof",{beforeExpr:!0,binop:7}),_typeof:L("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:L("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:L("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},me=/\r\n?|\n|\u2028|\u2029/,ba=new RegExp(me.source,"g");function ct(e){return e===10||e===13||e===8232||e===8233}function es(e,t,n){n===void 0&&(n=e.length);for(var r=t;r<n;r++){var s=e.charCodeAt(r);if(ct(s))return r<n-1&&s===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var ts=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,oe=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ns=Object.prototype,xa=ns.hasOwnProperty,_a=ns.toString,lt=Object.hasOwn||(function(e,t){return xa.call(e,t)}),Gr=Array.isArray||(function(e){return _a.call(e)==="[object Array]"}),Hr=Object.create(null);function We(e){return Hr[e]||(Hr[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function Be(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var wa=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,vt=function(t,n){this.line=t,this.column=n};vt.prototype.offset=function(t){return new vt(this.line,this.column+t)};var Xt=function(t,n,r){this.start=n,this.end=r,t.sourceFile!==null&&(this.source=t.sourceFile)};function rs(e,t){for(var n=1,r=0;;){var s=es(e,r,t);if(s<0)return new vt(n,t-r);++n,r=s}}var Fn={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},Kr=!1;function Sa(e){var t={};for(var n in Fn)t[n]=e&&lt(e,n)?e[n]:Fn[n];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!Kr&&typeof console=="object"&&console.warn&&(Kr=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
2
2
  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),Gr(t.onToken)){var r=t.onToken;t.onToken=function(s){return r.push(s)}}return Gr(t.onComment)&&(t.onComment=va(t,t.onComment)),t}function va(e,t){return function(n,r,s,a,i,o){var u={type:n?"Block":"Line",value:r,start:s,end:a};e.locations&&(u.loc=new Xt(this,i,o)),e.ranges&&(u.range=[s,a]),t.push(u)}}var kt=1,ft=2,qn=4,ss=8,Un=16,is=32,en=64,as=128,Ze=256,Et=512,tn=kt|ft|Ze;function Wn(e,t){return ft|(e?qn:0)|(t?ss:0)}var Kt=0,Jn=1,De=2,os=3,us=4,cs=5,ne=function(t,n,r){this.options=t=Sa(t),this.sourceFile=t.sourceFile,this.keywords=We(da[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var s="";t.allowReserved!==!0&&(s=Rn[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(s+=" await")),this.reservedWords=We(s);var a=(s?s+" ":"")+Rn.strict;this.reservedWordsStrict=We(a),this.reservedWordsStrictBind=We(a+" "+Rn.strictBind),this.input=String(n),this.containsEsc=!1,r?(this.pos=r,this.lineStart=this.input.lastIndexOf(`
3
3
  `,r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(me).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=h.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(kt),this.regexpState=null,this.privateNameStack=[]},Ae={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}};ne.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};Ae.inFunction.get=function(){return(this.currentVarScope().flags&ft)>0};Ae.inGenerator.get=function(){return(this.currentVarScope().flags&ss)>0};Ae.inAsync.get=function(){return(this.currentVarScope().flags&qn)>0};Ae.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],n=t.flags;if(n&(Ze|Et))return!1;if(n&ft)return(n&qn)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};Ae.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags;return(t&en)>0||this.options.allowSuperOutsideMethod};Ae.allowDirectSuper.get=function(){return(this.currentThisScope().flags&as)>0};Ae.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};Ae.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],n=t.flags;if(n&(Ze|Et)||n&ft&&!(n&Un))return!0}return!1};Ae.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Ze)>0};ne.extend=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];for(var r=this,s=0;s<t.length;s++)r=t[s](r);return r};ne.parse=function(t,n){return new this(n,t).parse()};ne.parseExpressionAt=function(t,n,r){var s=new this(r,t,n);return s.nextToken(),s.parseExpression()};ne.tokenizer=function(t,n){return new this(n,t)};Object.defineProperties(ne.prototype,Ae);var pe=ne.prototype,ka=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;pe.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){oe.lastIndex=e,e+=oe.exec(this.input)[0].length;var t=ka.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){oe.lastIndex=e+t[0].length;var n=oe.exec(this.input),r=n.index+n[0].length,s=this.input.charAt(r);return s===";"||s==="}"||me.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(s)||s==="!"&&this.input.charAt(r+1)==="=")}e+=t[0].length,oe.lastIndex=e,e+=oe.exec(this.input)[0].length,this.input[e]===";"&&e++}};pe.eat=function(e){return this.type===e?(this.next(),!0):!1};pe.isContextual=function(e){return this.type===h.name&&this.value===e&&!this.containsEsc};pe.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};pe.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};pe.canInsertSemicolon=function(){return this.type===h.eof||this.type===h.braceR||me.test(this.input.slice(this.lastTokEnd,this.start))};pe.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};pe.semicolon=function(){!this.eat(h.semi)&&!this.insertSemicolon()&&this.unexpected()};pe.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0};pe.expect=function(e){this.eat(e)||this.unexpected()};pe.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var nn=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};pe.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?"Assigning to rvalue":"Parenthesized pattern")}};pe.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property")};pe.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")};pe.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var j=ne.prototype;j.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==h.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,s=Object.keys(this.undefinedExports);r<s.length;r+=1){var a=s[r];this.raiseRecoverable(this.undefinedExports[a].start,"Export '"+a+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var zn={kind:"loop"},Ea={kind:"switch"};j.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;oe.lastIndex=this.pos;var t=oe.exec(this.input),n=this.pos+t[0].length,r=this.input.charCodeAt(n);if(r===91||r===92)return!0;if(e)return!1;if(r===123||r>55295&&r<56320)return!0;if(Ce(r,!0)){for(var s=n+1;Je(r=this.input.charCodeAt(s),!0);)++s;if(r===92||r>55295&&r<56320)return!0;var a=this.input.slice(n,s);if(!ma.test(a))return!0}return!1};j.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;oe.lastIndex=this.pos;var e=oe.exec(this.input),t=this.pos+e[0].length,n;return!me.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(Je(n=this.input.charCodeAt(t+8))||n>55295&&n<56320))};j.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;oe.lastIndex=this.pos;var n=oe.exec(this.input),r=this.pos+n[0].length;if(me.test(this.input.slice(this.pos,r)))return!1;if(e){var s=r+5,a;if(this.input.slice(r,s)!=="using"||s===this.input.length||Je(a=this.input.charCodeAt(s))||a>55295&&a<56320)return!1;oe.lastIndex=s;var i=oe.exec(this.input);if(i&&me.test(this.input.slice(s,s+i[0].length)))return!1}if(t){var o=r+2,u;if(this.input.slice(r,o)==="of"&&(o===this.input.length||!Je(u=this.input.charCodeAt(o))&&!(u>55295&&u<56320)))return!1}var c=this.input.charCodeAt(r);return Ce(c,!0)||c===92};j.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)};j.isUsing=function(e){return this.isUsingKeyword(!1,e)};j.parseStatement=function(e,t,n){var r=this.type,s=this.startNode(),a;switch(this.isLet(e)&&(r=h._var,a="let"),r){case h._break:case h._continue:return this.parseBreakContinueStatement(s,r.keyword);case h._debugger:return this.parseDebuggerStatement(s);case h._do:return this.parseDoStatement(s);case h._for:return this.parseForStatement(s);case h._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case h._class:return e&&this.unexpected(),this.parseClass(s,!0);case h._if:return this.parseIfStatement(s);case h._return:return this.parseReturnStatement(s);case h._switch:return this.parseSwitchStatement(s);case h._throw:return this.parseThrowStatement(s);case h._try:return this.parseTryStatement(s);case h._const:case h._var:return a=a||this.value,e&&a!=="var"&&this.unexpected(),this.parseVarStatement(s,a);case h._while:return this.parseWhileStatement(s);case h._with:return this.parseWithStatement(s);case h.braceL:return this.parseBlock(!0,s);case h.semi:return this.parseEmptyStatement(s);case h._export:case h._import:if(this.options.ecmaVersion>10&&r===h._import){oe.lastIndex=this.pos;var i=oe.exec(this.input),o=this.pos+i[0].length,u=this.input.charCodeAt(o);if(u===40||u===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===h._import?this.parseImport(s):this.parseExport(s,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,!0,!e);var c=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(c)return t&&this.options.sourceType==="script"&&this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script`"),c==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(s,!1,c),this.semicolon(),this.finishNode(s,"VariableDeclaration");var l=this.value,p=this.parseExpression();return r===h.name&&p.type==="Identifier"&&this.eat(h.colon)?this.parseLabeledStatement(s,l,p,e):this.parseExpressionStatement(s,p)}};j.parseBreakContinueStatement=function(e,t){var n=t==="break";this.next(),this.eat(h.semi)||this.insertSemicolon()?e.label=null:this.type!==h.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&&(n||s.kind==="loop")||e.label&&n))break}return r===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,n?"BreakStatement":"ContinueStatement")};j.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};j.parseDoStatement=function(e){return this.next(),this.labels.push(zn),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(h._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(h.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};j.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(zn),this.enterScope(0),this.expect(h.parenL),this.type===h.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===h._var||this.type===h._const||n){var r=this.startNode(),s=n?"let":this.value;return this.next(),this.parseVar(r,!0,s),this.finishNode(r,"VariableDeclaration"),this.parseForAfterInit(e,r,t)}var a=this.isContextual("let"),i=!1,o=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(o){var u=this.startNode();return this.next(),o==="await using"&&this.next(),this.parseVar(u,!0,o),this.finishNode(u,"VariableDeclaration"),this.parseForAfterInit(e,u,t)}var c=this.containsEsc,l=new nn,p=this.start,f=t>-1?this.parseExprSubscripts(l,"await"):this.parseExpression(!0,l);return this.type===h._in||(i=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===h._in&&this.unexpected(t),e.await=!0):i&&this.options.ecmaVersion>=8&&(f.start===p&&!c&&f.type==="Identifier"&&f.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),a&&i&&this.raise(f.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(f,!1,l),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(l,!0),t>-1&&this.unexpected(t),this.parseFor(e,f))};j.parseForAfterInit=function(e,t,n){return(this.type===h._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&t.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===h._in?n>-1&&this.unexpected(n):e.await=n>-1),this.parseForIn(e,t)):(n>-1&&this.unexpected(n),this.parseFor(e,t))};j.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,St|(n?0:Dn),!1,t)};j.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(h._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};j.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(h.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};j.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(h.braceL),this.labels.push(Ea),this.enterScope(0);for(var t,n=!1;this.type!==h.braceR;)if(this.type===h._case||this.type===h._default){var r=this.type===h._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),n=!0,t.test=null),this.expect(h.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")};j.parseThrowStatement=function(e){return this.next(),me.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 Ta=[];j.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?is:0),this.checkLValPattern(e,t?us:De),this.expect(h.parenR),e};j.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===h._catch){var t=this.startNode();this.next(),this.eat(h.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(h._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};j.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,"VariableDeclaration")};j.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(zn),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};j.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")};j.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};j.parseLabeledStatement=function(e,t,n,r){for(var s=0,a=this.labels;s<a.length;s+=1){var i=a[s];i.name===t&&this.raise(n.start,"Label '"+t+"' is already declared")}for(var o=this.type.isLoop?"loop":this.type===h._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=n,this.finishNode(e,"LabeledStatement")};j.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};j.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(h.braceL),e&&this.enterScope(0);this.type!==h.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")};j.parseFor=function(e,t){return e.init=t,this.expect(h.semi),e.test=this.type===h.semi?null:this.parseExpression(),this.expect(h.semi),e.update=this.type===h.parenR?null:this.parseExpression(),this.expect(h.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};j.parseForIn=function(e,t){var n=this.type===h._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(n?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(h.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,n?"ForInStatement":"ForOfStatement")};j.parseVar=function(e,t,n,r){for(e.declarations=[],e.kind=n;;){var s=this.startNode();if(this.parseVarId(s,n),this.eat(h.eq)?s.init=this.parseMaybeAssign(t):!r&&n==="const"&&!(this.type===h._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!r&&(n==="using"||n==="await using")&&this.options.ecmaVersion>=17&&this.type!==h._in&&!this.isContextual("of")?this.raise(this.lastTokEnd,"Missing initializer in "+n+" declaration"):!r&&s.id.type!=="Identifier"&&!(t&&(this.type===h._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(h.comma))break}return e};j.parseVarId=function(e,t){e.id=t==="using"||t==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?Jn:De,!1)};var St=1,Dn=2,ls=4;j.parseFunction=function(e,t,n,r,s){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===h.star&&t&Dn&&this.unexpected(),e.generator=this.eat(h.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&St&&(e.id=t&ls&&this.type!==h.name?null:this.parseIdent(),e.id&&!(t&Dn)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Jn:De:os));var a=this.yieldPos,i=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Wn(e.async,e.generator)),t&St||(e.id=this.type===h.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,s),this.yieldPos=a,this.awaitPos=i,this.awaitIdentPos=o,this.finishNode(e,t&St?"FunctionDeclaration":"FunctionExpression")};j.parseFunctionParams=function(e){this.expect(h.parenL),e.params=this.parseBindingList(h.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};j.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),s=this.startNode(),a=!1;for(s.body=[],this.expect(h.braceL);this.type!==h.braceR;){var i=this.parseClassElement(e.superClass!==null);i&&(s.body.push(i),i.type==="MethodDefinition"&&i.kind==="constructor"?(a&&this.raiseRecoverable(i.start,"Duplicate constructor in the same class"),a=!0):i.key&&i.key.type==="PrivateIdentifier"&&$a(r,i)&&this.raiseRecoverable(i.key.start,"Identifier '#"+i.key.name+"' has already been declared"))}return this.strict=n,this.next(),e.body=this.finishNode(s,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};j.parseClassElement=function(e){if(this.eat(h.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r="",s=!1,a=!1,i="method",o=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(h.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===h.star?o=!0:r="static"}if(n.static=o,!r&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===h.star)&&!this.canInsertSemicolon()?a=!0:r="async"),!r&&(t>=9||!a)&&this.eat(h.star)&&(s=!0),!r&&!a&&!s){var u=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?i=u:r=u)}if(r?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,"Identifier")):this.parseClassElementName(n),t<13||this.type===h.parenL||i!=="method"||s||a){var c=!n.static&&Zt(n,"constructor"),l=c&&e;c&&i!=="method"&&this.raise(n.key.start,"Constructor can't have get/set modifier"),n.kind=c?"constructor":i,this.parseClassMethod(n,s,a,l)}else this.parseClassField(n);return n};j.isClassElementNameStart=function(){return this.type===h.name||this.type===h.privateId||this.type===h.num||this.type===h.string||this.type===h.bracketL||this.type.keyword};j.parseClassElementName=function(e){this.type===h.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)};j.parseClassMethod=function(e,t,n,r){var s=e.key;e.kind==="constructor"?(t&&this.raise(s.start,"Constructor can't be a generator"),n&&this.raise(s.start,"Constructor can't be an async method")):e.static&&Zt(e,"prototype")&&this.raise(s.start,"Classes may not have a static property named prototype");var a=e.value=this.parseMethod(t,n,r);return e.kind==="get"&&a.params.length!==0&&this.raiseRecoverable(a.start,"getter should have no params"),e.kind==="set"&&a.params.length!==1&&this.raiseRecoverable(a.start,"setter should have exactly one param"),e.kind==="set"&&a.params[0].type==="RestElement"&&this.raiseRecoverable(a.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};j.parseClassField=function(e){return Zt(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&Zt(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(h.eq)?(this.enterScope(Et|en),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")};j.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(Ze|en);this.type!==h.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};j.parseClassId=function(e,t){this.type===h.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,De,!1)):(t===!0&&this.unexpected(),e.id=null)};j.parseClassSuper=function(e){e.superClass=this.eat(h._extends)?this.parseExprSubscripts(null,!1):null};j.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};j.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,n=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,s=r===0?null:this.privateNameStack[r-1],a=0;a<n.length;++a){var i=n[a];lt(t,i.name)||(s?s.used.push(i):this.raiseRecoverable(i.start,"Private field '#"+i.name+"' must be declared in an enclosing class"))}};function $a(e,t){var n=t.key.name,r=e[n],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[n]="true",!1):r?!0:(e[n]=s,!1)}function Zt(e,t){var n=e.computed,r=e.key;return!n&&(r.type==="Identifier"&&r.name===t||r.type==="Literal"&&r.value===t)}j.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!==h.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};j.parseExport=function(e,t){if(this.next(),this.eat(h.star))return this.parseExportAllDeclaration(e,t);if(this.eat(h._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,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==h.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var n=0,r=e.specifiers;n<r.length;n+=1){var s=r[n];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.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")};j.parseExportDeclaration=function(e){return this.parseStatement(null)};j.parseExportDefaultDeclaration=function(){var e;if(this.type===h._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,St|ls,!1,e)}else if(this.type===h._class){var n=this.startNode();return this.parseClass(n,"nullableID")}else{var r=this.parseMaybeAssign();return this.semicolon(),r}};j.checkExport=function(e,t,n){e&&(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),lt(e,t)&&this.raiseRecoverable(n,"Duplicate export '"+t+"'"),e[t]=!0)};j.checkPatternExport=function(e,t){var n=t.type;if(n==="Identifier")this.checkExport(e,t,t.start);else if(n==="ObjectPattern")for(var r=0,s=t.properties;r<s.length;r+=1){var a=s[r];this.checkPatternExport(e,a)}else if(n==="ArrayPattern")for(var i=0,o=t.elements;i<o.length;i+=1){var u=o[i];u&&this.checkPatternExport(e,u)}else n==="Property"?this.checkPatternExport(e,t.value):n==="AssignmentPattern"?this.checkPatternExport(e,t.left):n==="RestElement"&&this.checkPatternExport(e,t.argument)};j.checkVariableExport=function(e,t){if(e)for(var n=0,r=t;n<r.length;n+=1){var s=r[n];this.checkPatternExport(e,s.id)}};j.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};j.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")};j.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(h.braceL);!this.eat(h.braceR);){if(n)n=!1;else if(this.expect(h.comma),this.afterTrailingComma(h.braceR))break;t.push(this.parseExportSpecifier(e))}return t};j.parseImport=function(e){return this.next(),this.type===h.string?(e.specifiers=Ta,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===h.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")};j.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,De),this.finishNode(e,"ImportSpecifier")};j.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,De),this.finishNode(e,"ImportDefaultSpecifier")};j.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,De),this.finishNode(e,"ImportNamespaceSpecifier")};j.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===h.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(h.comma)))return e;if(this.type===h.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(h.braceL);!this.eat(h.braceR);){if(t)t=!1;else if(this.expect(h.comma),this.afterTrailingComma(h.braceR))break;e.push(this.parseImportSpecifier())}return e};j.parseWithClause=function(){var e=[];if(!this.eat(h._with))return e;this.expect(h.braceL);for(var t={},n=!0;!this.eat(h.braceR);){if(n)n=!1;else if(this.expect(h.comma),this.afterTrailingComma(h.braceR))break;var r=this.parseImportAttribute(),s=r.key.type==="Identifier"?r.key.name:r.key.value;lt(t,s)&&this.raiseRecoverable(r.key.start,"Duplicate attribute key '"+s+"'"),t[s]=!0,e.push(r)}return e};j.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===h.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(h.colon),this.type!==h.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")};j.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===h.string){var e=this.parseLiteral(this.value);return wa.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};j.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)};j.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 we=ne.prototype;we.toAssignable=function(e,t,n){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",n&&this.checkPatternErrors(n,!0);for(var r=0,s=e.properties;r<s.length;r+=1){var a=s[r];this.toAssignable(a,t),a.type==="RestElement"&&(a.argument.type==="ArrayPattern"||a.argument.type==="ObjectPattern")&&this.raise(a.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",n&&this.checkPatternErrors(n,!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,n);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 n&&this.checkPatternErrors(n,!0);return e};we.toAssignableList=function(e,t){for(var n=e.length,r=0;r<n;r++){var s=e[r];s&&this.toAssignable(s,t)}if(n){var a=e[n-1];this.options.ecmaVersion===6&&t&&a&&a.type==="RestElement"&&a.argument.type!=="Identifier"&&this.unexpected(a.argument.start)}return e};we.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")};we.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==h.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};we.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case h.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(h.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case h.braceL:return this.parseObj(!0)}return this.parseIdent()};we.parseBindingList=function(e,t,n,r){for(var s=[],a=!0;!this.eat(e);)if(a?a=!1:this.expect(h.comma),t&&this.type===h.comma)s.push(null);else{if(n&&this.afterTrailingComma(e))break;if(this.type===h.ellipsis){var i=this.parseRestBinding();this.parseBindingListItem(i),s.push(i),this.type===h.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};we.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t};we.parseBindingListItem=function(e){return e};we.parseMaybeDefault=function(e,t,n){if(n=n||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(h.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")};we.checkLValSimple=function(e,t,n){t===void 0&&(t=Kt);var r=t!==Kt;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===De&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),n&&(lt(n,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),n[e.name]=!0),t!==cs&&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,n);default:this.raise(e.start,(r?"Binding":"Assigning to")+" rvalue")}};we.checkLValPattern=function(e,t,n){switch(t===void 0&&(t=Kt),e.type){case"ObjectPattern":for(var r=0,s=e.properties;r<s.length;r+=1){var a=s[r];this.checkLValInnerPattern(a,t,n)}break;case"ArrayPattern":for(var i=0,o=e.elements;i<o.length;i+=1){var u=o[i];u&&this.checkLValInnerPattern(u,t,n)}break;default:this.checkLValSimple(e,t,n)}};we.checkLValInnerPattern=function(e,t,n){switch(t===void 0&&(t=Kt),e.type){case"Property":this.checkLValInnerPattern(e.value,t,n);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,n);break;case"RestElement":this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var ke=function(t,n,r,s,a){this.token=t,this.isExpr=!!n,this.preserveSpace=!!r,this.override=s,this.generator=!!a},Q={b_stat:new ke("{",!1),b_expr:new ke("{",!0),b_tmpl:new ke("${",!1),p_stat:new ke("(",!1),p_expr:new ke("(",!0),q_tmpl:new ke("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new ke("function",!1),f_expr:new ke("function",!0),f_expr_gen:new ke("function",!0,!1,null,!0),f_gen:new ke("function",!1,!1,null,!0)},pt=ne.prototype;pt.initialContext=function(){return[Q.b_stat]};pt.curContext=function(){return this.context[this.context.length-1]};pt.braceIsBlock=function(e){var t=this.curContext();return t===Q.f_expr||t===Q.f_stat?!0:e===h.colon&&(t===Q.b_stat||t===Q.b_expr)?!t.isExpr:e===h._return||e===h.name&&this.exprAllowed?me.test(this.input.slice(this.lastTokEnd,this.start)):e===h._else||e===h.semi||e===h.eof||e===h.parenR||e===h.arrow?!0:e===h.braceL?t===Q.b_stat:e===h._var||e===h._const||e===h.name?!1:!this.exprAllowed};pt.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};pt.updateContext=function(e){var t,n=this.type;n.keyword&&e===h.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr};pt.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)};h.parenR.updateContext=h.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===Q.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr};h.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?Q.b_stat:Q.b_expr),this.exprAllowed=!0};h.dollarBraceL.updateContext=function(){this.context.push(Q.b_tmpl),this.exprAllowed=!0};h.parenL.updateContext=function(e){var t=e===h._if||e===h._for||e===h._with||e===h._while;this.context.push(t?Q.p_stat:Q.p_expr),this.exprAllowed=!0};h.incDec.updateContext=function(){};h._function.updateContext=h._class.updateContext=function(e){e.beforeExpr&&e!==h._else&&!(e===h.semi&&this.curContext()!==Q.p_stat)&&!(e===h._return&&me.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===h.colon||e===h.braceL)&&this.curContext()===Q.b_stat)?this.context.push(Q.f_expr):this.context.push(Q.f_stat),this.exprAllowed=!1};h.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0};h.backQuote.updateContext=function(){this.curContext()===Q.q_tmpl?this.context.pop():this.context.push(Q.q_tmpl),this.exprAllowed=!1};h.star.updateContext=function(e){if(e===h._function){var t=this.context.length-1;this.context[t]===Q.f_expr?this.context[t]=Q.f_expr_gen:this.context[t]=Q.f_gen}this.exprAllowed=!0};h.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==h.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var R=ne.prototype;R.checkPropClash=function(e,t,n){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 a=e.kind;if(this.options.ecmaVersion>=6){s==="__proto__"&&a==="init"&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=r.start):this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),t.proto=!0);return}s="$"+s;var i=t[s];if(i){var o;a==="init"?o=this.strict&&i.init||i.get||i.set:o=i.init||i[a],o&&this.raiseRecoverable(r.start,"Redefinition of property")}else i=t[s]={init:!1,get:!1,set:!1};i[a]=!0}};R.parseExpression=function(e,t){var n=this.start,r=this.startLoc,s=this.parseMaybeAssign(e,t);if(this.type===h.comma){var a=this.startNodeAt(n,r);for(a.expressions=[s];this.eat(h.comma);)a.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(a,"SequenceExpression")}return s};R.parseMaybeAssign=function(e,t,n){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,s=-1,a=-1,i=-1;t?(s=t.parenthesizedAssign,a=t.trailingComma,i=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new nn,r=!0);var o=this.start,u=this.startLoc;(this.type===h.parenL||this.type===h.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var c=this.parseMaybeConditional(e,t);if(n&&(c=n.call(this,c,o,u)),this.type.isAssign){var l=this.startNodeAt(o,u);return l.operator=this.value,this.type===h.eq&&(c=this.toAssignable(c,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=c.start&&(t.shorthandAssign=-1),this.type===h.eq?this.checkLValPattern(c):this.checkLValSimple(c),l.left=c,this.next(),l.right=this.parseMaybeAssign(e),i>-1&&(t.doubleProto=i),this.finishNode(l,"AssignmentExpression")}else r&&this.checkExpressionErrors(t,!0);return s>-1&&(t.parenthesizedAssign=s),a>-1&&(t.trailingComma=a),c};R.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,s=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return s;if(this.eat(h.question)){var a=this.startNodeAt(n,r);return a.test=s,a.consequent=this.parseMaybeAssign(),this.expect(h.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,"ConditionalExpression")}return s};R.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,s=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||s.start===n&&s.type==="ArrowFunctionExpression"?s:this.parseExprOp(s,n,r,-1,e)};R.parseExprOp=function(e,t,n,r,s){var a=this.type.binop;if(a!=null&&(!s||this.type!==h._in)&&a>r){var i=this.type===h.logicalOR||this.type===h.logicalAND,o=this.type===h.coalesce;o&&(a=h.logicalAND.binop);var u=this.value;this.next();var c=this.start,l=this.startLoc,p=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,s),c,l,a,s),f=this.buildBinary(t,n,e,p,u,i||o);return(i&&this.type===h.coalesce||o&&(this.type===h.logicalOR||this.type===h.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(f,t,n,r,s)}return e};R.buildBinary=function(e,t,n,r,s,a){r.type==="PrivateIdentifier"&&this.raise(r.start,"Private identifier can only be left side of binary expression");var i=this.startNodeAt(e,t);return i.left=n,i.operator=s,i.right=r,this.finishNode(i,a?"LogicalExpression":"BinaryExpression")};R.parseMaybeUnary=function(e,t,n,r){var s=this.start,a=this.startLoc,i;if(this.isContextual("await")&&this.canAwait)i=this.parseAwait(r),t=!0;else if(this.type.prefix){var o=this.startNode(),u=this.type===h.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"&&fs(o.argument)?this.raiseRecoverable(o.start,"Deleting local variable in strict mode"):o.operator==="delete"&&Ln(o.argument)?this.raiseRecoverable(o.start,"Private fields can not be deleted"):t=!0,i=this.finishNode(o,u?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===h.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),i=this.parsePrivateIdent(),this.type!==h._in&&this.unexpected();else{if(i=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return i;for(;this.type.postfix&&!this.canInsertSemicolon();){var c=this.startNodeAt(s,a);c.operator=this.value,c.prefix=!1,c.argument=i,this.checkLValSimple(i),this.next(),i=this.finishNode(c,"UpdateExpression")}}if(!n&&this.eat(h.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(s,a,i,this.parseMaybeUnary(null,!1,!1,r),"**",!1);else return i};function fs(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&fs(e.expression)}function Ln(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&Ln(e.expression)||e.type==="ParenthesizedExpression"&&Ln(e.expression)}R.parseExprSubscripts=function(e,t){var n=this.start,r=this.startLoc,s=this.parseExprAtom(e,t);if(s.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return s;var a=this.parseSubscripts(s,n,r,!1,t);return e&&a.type==="MemberExpression"&&(e.parenthesizedAssign>=a.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=a.start&&(e.parenthesizedBind=-1),e.trailingComma>=a.start&&(e.trailingComma=-1)),a};R.parseSubscripts=function(e,t,n,r,s){for(var a=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,i=!1;;){var o=this.parseSubscript(e,t,n,r,a,i,s);if(o.optional&&(i=!0),o===e||o.type==="ArrowFunctionExpression"){if(i){var u=this.startNodeAt(t,n);u.expression=o,o=this.finishNode(u,"ChainExpression")}return o}e=o}};R.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(h.arrow)};R.parseSubscriptAsyncArrow=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,r)};R.parseSubscript=function(e,t,n,r,s,a,i){var o=this.options.ecmaVersion>=11,u=o&&this.eat(h.questionDot);r&&u&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var c=this.eat(h.bracketL);if(c||u&&this.type!==h.parenL&&this.type!==h.backQuote||this.eat(h.dot)){var l=this.startNodeAt(t,n);l.object=e,c?(l.property=this.parseExpression(),this.expect(h.bracketR)):this.type===h.privateId&&e.type!=="Super"?l.property=this.parsePrivateIdent():l.property=this.parseIdent(this.options.allowReserved!=="never"),l.computed=!!c,o&&(l.optional=u),e=this.finishNode(l,"MemberExpression")}else if(!r&&this.eat(h.parenL)){var p=new nn,f=this.yieldPos,d=this.awaitPos,g=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var y=this.parseExprList(h.parenR,this.options.ecmaVersion>=8,!1,p);if(s&&!u&&this.shouldParseAsyncArrow())return this.checkPatternErrors(p,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=f,this.awaitPos=d,this.awaitIdentPos=g,this.parseSubscriptAsyncArrow(t,n,y,i);this.checkExpressionErrors(p,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=d||this.awaitPos,this.awaitIdentPos=g||this.awaitIdentPos;var w=this.startNodeAt(t,n);w.callee=e,w.arguments=y,o&&(w.optional=u),e=this.finishNode(w,"CallExpression")}else if(this.type===h.backQuote){(u||a)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var k=this.startNodeAt(t,n);k.tag=e,k.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(k,"TaggedTemplateExpression")}return e};R.parseExprAtom=function(e,t,n){this.type===h.slash&&this.readRegexp();var r,s=this.potentialArrowAt===this.start;switch(this.type){case h._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),r=this.startNode(),this.next(),this.type===h.parenL&&!this.allowDirectSuper&&this.raise(r.start,"super() call outside constructor of a subclass"),this.type!==h.dot&&this.type!==h.bracketL&&this.type!==h.parenL&&this.unexpected(),this.finishNode(r,"Super");case h._this:return r=this.startNode(),this.next(),this.finishNode(r,"ThisExpression");case h.name:var a=this.start,i=this.startLoc,o=this.containsEsc,u=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&u.name==="async"&&!this.canInsertSemicolon()&&this.eat(h._function))return this.overrideContext(Q.f_expr),this.parseFunction(this.startNodeAt(a,i),0,!1,!0,t);if(s&&!this.canInsertSemicolon()){if(this.eat(h.arrow))return this.parseArrowExpression(this.startNodeAt(a,i),[u],!1,t);if(this.options.ecmaVersion>=8&&u.name==="async"&&this.type===h.name&&!o&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return u=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(h.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,i),[u],!0,t)}return u;case h.regexp:var c=this.value;return r=this.parseLiteral(c.value),r.regex={pattern:c.pattern,flags:c.flags},r;case h.num:case h.string:return this.parseLiteral(this.value);case h._null:case h._true:case h._false:return r=this.startNode(),r.value=this.type===h._null?null:this.type===h._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,"Literal");case h.parenL:var l=this.start,p=this.parseParenAndDistinguishExpression(s,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(p)&&(e.parenthesizedAssign=l),e.parenthesizedBind<0&&(e.parenthesizedBind=l)),p;case h.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(h.bracketR,!0,!0,e),this.finishNode(r,"ArrayExpression");case h.braceL:return this.overrideContext(Q.b_expr),this.parseObj(!1,e);case h._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case h._class:return this.parseClass(this.startNode(),!1);case h._new:return this.parseNew();case h.backQuote:return this.parseTemplate();case h._import:return this.options.ecmaVersion>=11?this.parseExprImport(n):this.unexpected();default:return this.parseExprAtomDefault()}};R.parseExprAtomDefault=function(){this.unexpected()};R.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===h.parenL&&!e)return this.parseDynamicImport(t);if(this.type===h.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name="import",t.meta=this.finishNode(n,"Identifier"),this.parseImportMeta(t)}else this.unexpected()};R.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(h.parenR)?e.options=null:(this.expect(h.comma),this.afterTrailingComma(h.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(h.parenR)||(this.expect(h.comma),this.afterTrailingComma(h.parenR)||this.unexpected())));else if(!this.eat(h.parenR)){var t=this.start;this.eat(h.comma)&&this.eat(h.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")};R.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")};R.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.value!=null?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")};R.parseParenExpression=function(){this.expect(h.parenL);var e=this.parseExpression();return this.expect(h.parenR),e};R.shouldParseArrow=function(e){return!this.canInsertSemicolon()};R.parseParenAndDistinguishExpression=function(e,t){var n=this.start,r=this.startLoc,s,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var i=this.start,o=this.startLoc,u=[],c=!0,l=!1,p=new nn,f=this.yieldPos,d=this.awaitPos,g;for(this.yieldPos=0,this.awaitPos=0;this.type!==h.parenR;)if(c?c=!1:this.expect(h.comma),a&&this.afterTrailingComma(h.parenR,!0)){l=!0;break}else if(this.type===h.ellipsis){g=this.start,u.push(this.parseParenItem(this.parseRestBinding())),this.type===h.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else u.push(this.parseMaybeAssign(!1,p,this.parseParenItem));var y=this.lastTokEnd,w=this.lastTokEndLoc;if(this.expect(h.parenR),e&&this.shouldParseArrow(u)&&this.eat(h.arrow))return this.checkPatternErrors(p,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=d,this.parseParenArrowList(n,r,u,t);(!u.length||l)&&this.unexpected(this.lastTokStart),g&&this.unexpected(g),this.checkExpressionErrors(p,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=d||this.awaitPos,u.length>1?(s=this.startNodeAt(i,o),s.expressions=u,this.finishNodeAt(s,"SequenceExpression",y,w)):s=u[0]}else s=this.parseParenExpression();if(this.options.preserveParens){var k=this.startNodeAt(n,r);return k.expression=s,this.finishNode(k,"ParenthesizedExpression")}else return s};R.parseParenItem=function(e){return e};R.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var Ca=[];R.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===h.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var n=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'"),n&&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(h.parenL)?e.arguments=this.parseExprList(h.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Ca,this.finishNode(e,"NewExpression")};R.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===h.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),n.value={raw:this.value.replace(/\r\n?/g,`
4
4
  `),cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
@@ -32,7 +32,7 @@ ${S.join(`
32
32
  `)}
33
33
  return __tjs.typeError('${p}', 'no matching overload', __args)
34
34
  }
35
- `;l+=b}return{source:l,polymorphicNames:n}}function Zs(e){return e.replace(/(?<=^|[;\n{])\s*([A-Z][a-zA-Z0-9_]*)\s*=(?!=)/gm,(t,n)=>t.replace(n,`const ${n}`))}function Qs(e,t=!1){let n=[],r=[],s="",a=0;for(;a<e.length;){let i=e.slice(a).match(/^\btest\s+/);if(i){let o=a,u=a+i[0].length,c,l=e.slice(u).match(/^(['"`])([^]*?)\1\s*/);if(l&&(c=l[2],u+=l[0].length),e[u]==="{"){let p=u+1,f=1,d=p,g=null,y=!1;for(;d<e.length&&f>0;){let w=e[d];if(y){y=!1,d++;continue}if(w==="\\"&&g){y=!0,d++;continue}if(g){w===g&&(g=null),d++;continue}if(w==="/"&&e[d+1]==="/"){let k=e.indexOf(`
35
+ `;l+=b}return{source:l,polymorphicNames:n}}function Zs(e){let t=new Set,n=/\b(?:let|const|var|function|class)\s+([A-Z][a-zA-Z0-9_]*)/g;for(let r;r=n.exec(e);)t.add(r[1]);return e.replace(/(?<=^|[;\n{])(\s*)([A-Z][a-zA-Z0-9_]*)\s*=(?!=)/gm,(r,s,a)=>t.has(a)?r:r.replace(a,`const ${a}`))}function Qs(e,t=!1){let n=[],r=[],s="",a=0;for(;a<e.length;){let i=e.slice(a).match(/^\btest\s+/);if(i){let o=a,u=a+i[0].length,c,l=e.slice(u).match(/^(['"`])([^]*?)\1\s*/);if(l&&(c=l[2],u+=l[0].length),e[u]==="{"){let p=u+1,f=1,d=p,g=null,y=!1;for(;d<e.length&&f>0;){let w=e[d];if(y){y=!1,d++;continue}if(w==="\\"&&g){y=!0,d++;continue}if(g){w===g&&(g=null),d++;continue}if(w==="/"&&e[d+1]==="/"){let k=e.indexOf(`
36
36
  `,d);d=k===-1?e.length:k+1;continue}if(w==="/"&&e[d+1]==="*"){let k=e.indexOf("*/",d+2);d=k===-1?e.length:k+2;continue}if(w==="'"||w==='"'||w==="`"){g=w,d++;continue}w==="{"?f++:w==="}"&&f--,d++}if(f===0){let w=e.slice(p,d-1).trim(),k=d,S=(e.slice(0,o).match(/\n/g)||[]).length+1;if(n.push({description:c,body:w,start:o,end:k,line:S}),!t)try{new Function(w)()}catch(v){let x=c||`test at line ${S}`;r.push(`Test failed: ${x} (line ${S})
37
37
  ${v.message||v}`)}let _=(e.slice(o,k).match(/\n/g)||[]).length;s+=`
38
38
  `.repeat(_),a=k;continue}}}s+=e[a],a++}return{source:s,tests:n,errors:r}}function Ys(e,t){let n=new Set,r=/\bclass\s+(\w+)(\s+extends\s+\w+)?\s*\{/g,s,a=[];for(;(s=r.exec(e))!==null;){let o=s[1],u=s[2]?.trim()||"",c=s.index+s[0].length-1,l=Ct(e,c),p=e.slice(c,l);a.push({className:o,extendsClause:u,bodyStart:c,bodyEnd:l,body:p})}let i=e;for(let o=a.length-1;o>=0;o--){let{className:u,extendsClause:c,bodyStart:l,bodyEnd:p,body:f}=a[o],d=/\bconstructor\s*\(/g,g,y=[];for(;(g=d.exec(f))!==null;)y.push(g.index);if(y.length<2)continue;n.add(u);let w=[];for(let v=0;v<y.length;v++){let x=y[v],E=f.indexOf("(",x),$=1,C=E+1;for(;C<f.length&&$>0;)f[C]==="("&&$++,f[C]===")"&&$--,C++;let I=f.slice(E+1,C-1),M=C;for(;M<f.length&&f[M]!=="{";)M++;let F=Ct(f,M),N=f.slice(M+1,F-1);w.push({index:v+1,paramStr:I,bodyText:N,fullStart:x,fullEnd:F})}let k=f;for(let v=w.length-1;v>=1;v--){let x=w[v],E=x.fullStart;for(;E>0&&k[E-1]===" ";)E--;E>0&&k[E-1]===`
@@ -55,7 +55,7 @@ function ${u}$dispatch(t, a) {
55
55
  `&&(i="normal"),r++;continue;case"block-comment":if(n+=f,f==="*"&&d==="/"){n+=d,r+=2,i="normal";continue}r++;continue;case"regex":if(n+=f,f==="\\"&&r+1<e.length){n+=d,r+=2;continue}if(f==="["){for(r++;r<e.length&&e[r]!=="]";)n+=e[r],e[r]==="\\"&&r+1<e.length?(n+=e[r+1],r+=2):r++;r<e.length&&(n+=e[r],r++);continue}if(f==="/"){for(r++;r<e.length&&/[gimsuy]/.test(e[r]);)n+=e[r],r++;i="normal";continue}r++;continue;case"normal":if(o.length>0){if(f==="{")o[o.length-1]++;else if(f==="}"&&(o[o.length-1]--,o[o.length-1]===0)){o.pop(),n+=f,r++,i="template-string";continue}}if(f==="'"){n+=f,r++,i="single-string";continue}if(f==='"'){n+=f,r++,i="double-string";continue}if(f==="`"){n+=f,r++,i="template-string";continue}if(f==="/"&&d==="/"){n+=f+d,r+=2,i="line-comment";continue}if(f==="/"&&d==="*"){n+=f+d,r+=2,i="block-comment";continue}if(f==="/"){let b=n.trimEnd();if(!b[b.length-1]||/[=(!,;:{[&|?+\-*%<>~^]$/.test(b)||/\b(return|case|throw|in|of|typeof|instanceof|new|delete|void)\s*$/.test(b)){n+=f,r++,i="regex";continue}}break}if(f==="{"){c++,n+=f,r++;continue}if(f==="}"){c--;let b=u[u.length-1];b&&c===b.braceDepth&&u.pop(),n+=f,r++;continue}let g=e.slice(r).match(/^class\s+\w+(?:\s+extends\s+\w+)?\s*\{/);if(g){let b=g[0].slice(0,-1);n+=b,r+=b.length,u.push({type:"class-body",braceDepth:c});continue}let y=e.slice(r).match(/^function\s+(\w+)\s*\(/);if(y){let b=y[1],_=y[0].length,v=e[r+_],x,E=r+_;(v==="?"||v==="!")&&(x=v,E++,x==="!"?t.unsafeFunctions.add(b):t.safeFunctions.add(b)),n+=`function ${b}(`,r=E;let $=un(e,r,"(",")");if(!$){n+=e[r],r++;continue}let{content:C,endPos:I}=$;r=I;let M=Zn(C,t,!0);n+=M+")";let F=r;for(;F<e.length&&/\s/.test(e[F]);)F++;if(e[F]===":"){let U=e.slice(F,F+2),J;for(U===":?"||U===":!"?(F+=2,J=U===":?"?"safe":"unsafe"):F+=1;F<e.length&&/\s/.test(e[F]);)F++;let X=Kn(e,F);X&&(s===void 0&&(s=X.type,J&&(a=J)),r=X.endPos)}let N=r;for(;N<e.length&&/\s/.test(e[N]);)N++;if(e[N]==="="&&e[N+1]===">")throw new te("Unexpected '=>' after function declaration. Function declarations use `function name(params) { body }`, not arrow syntax. Remove the `=>`.",Le(t.originalSource,N),t.originalSource);continue}let w=e.slice(r).match(/^(constructor|(?:get|set)\s+\w+|async\s+\w+|\w+)\s*\(/),k=(()=>{for(let b=n.length-1;b>=0;b--)if(!/\s/.test(n[b]))return n[b];return`
56
56
  `})(),S=k!=="="&&k!==","&&k!=="("&&k!=="["&&k!==">";if(w&&p()&&!S){let b=w[1].length;n+=e.slice(r,r+b),r+=b;continue}if(w&&p()&&S){let b=w[1],_=w[0].length,v=r+_;n+=b+"(",r=v;let x=un(e,r,"(",")");if(!x){n+=e[r],r++;continue}let{content:E,endPos:$}=x;r=$;let C=Zn(E,t,!0);n+=C+")";let I=r;for(;I<e.length&&/\s/.test(e[I]);)I++;if(e[I]===":"){let F=e.slice(I,I+2);for(F===":?"||F===":!"?I+=2:I++;I<e.length&&/\s/.test(e[I]);)I++;let N=Kn(e,I);N&&(r=N.endPos)}let M=r;for(;M<e.length&&/\s/.test(e[M]);)M++;if(e[M]==="="&&e[M+1]===">")throw new te("Unexpected '=>' after method declaration. Methods use `name(params) { body }`, not arrow syntax. Remove the `=>`.",Le(t.originalSource,M),t.originalSource);continue}if(e[r]==="("){let b=un(e,r+1,"(",")");if(!b){n+=e[r],r++;continue}let _=b.content,v=b.endPos,x=v;for(;x<e.length&&/\s/.test(e[x]);)x++;let E;if(e[x]===":"){let $=e.slice(x,x+2);for($===":?"||$===":!"?x+=2:x++;x<e.length&&/\s/.test(e[x]);)x++;let C=Kn(e,x);if(C)for(E=C.type,x=C.endPos;x<e.length&&/\s/.test(e[x]);)x++}if(e.slice(x,x+2)==="=>"){let $=null,C=_,I=_.trimStart();I.startsWith("?")&&(I.length===1||/\s/.test(I[1]))?($="?",C=I.slice(1)):I.startsWith("!")&&(I.length===1||/\s/.test(I[1]))&&($="!",C=I.slice(1));let M=Zn(C,t,!1);for(n+=`(${$==="?"?"/* safe */ ":$==="!"?"/* unsafe */ ":""}${M})`,r=v;r<x&&/\s/.test(e[r]);)n+=e[r],r++;E&&(r=x)}else{let $=fn(_,t);n+=`(${$.source})`,r=v}continue}n+=e[r],r++}return{source:n,returnType:s,returnSafety:a}}function un(e,t,n,r){let s=1,a=t,i=!1,o="";for(;a<e.length&&s>0;){let u=e[a];!i&&(u==="'"||u==='"'||u==="`")?(i=!0,o=u):i&&u===o&&e[a-1]!=="\\"?i=!1:i||(u===n?s++:u===r&&s--),a++}return s!==0?null:{content:e.slice(t,a-1),endPos:a}}function ai(e,t){let n=t;for(;n<e.length&&/\s/.test(e[n]);)n++;if(n>=e.length)return null;let r=n,s=e[n];if(s==="{"||s==="["){let i=s==="{"?"}":"]",o=un(e,n+1,s,i);return o?{value:e.slice(r,o.endPos),endPos:o.endPos}:null}if(s==="'"||s==='"'||s==="`"){for(n++;n<e.length;){if(e[n]===s&&e[n-1]!=="\\")return n++,{value:e.slice(r,n),endPos:n};n++}return null}if(/[-+\d]/.test(s)){for(;n<e.length&&/[\d.eE+-]/.test(e[n]);)n++;return{value:e.slice(r,n),endPos:n}}let a=e.slice(n).match(/^(true|false|null|undefined)\b/);return a?{value:a[1],endPos:n+a[1].length}:null}function It(e){return e.replace(/(?<!\|)\|(?!\|)/g," || ")}function Kn(e,t){let n=t,r=0,s=!1,a="",i=!1,o=u=>({type:It(e.slice(t,u).trim()),endPos:u});for(;n<e.length;){let u=e[n];if(!s&&(u==="'"||u==='"'||u==="`")){s=!0,a=u,i=!0,n++;continue}if(s){if(u===a&&e[n-1]!=="\\"){if(s=!1,n++,r===0){let c=n;for(;c<e.length&&/\s/.test(e[c]);)c++;if(e[c]==="{"&&!e.slice(c+1).match(/^\s*(\w+)\s*:/)||e[c]!=="|"&&e[c]!=="&")return o(n)}continue}n++;continue}if(u==="{"||u==="["||u==="("){r++,i=!0,n++;continue}if(u==="}"||u==="]"||u===")"){if(r--,r===0){n++;let c=n;for(;c<e.length&&/\s/.test(e[c]);)c++;if(e[c]==="|"||e[c]==="&")continue;return o(n)}n++;continue}if(r===0&&u==="{"){if(i)return o(n);if(e.slice(n+1).match(/^\s*(\w+)\s*:/)){r++,i=!0,n++;continue}return o(n)}if(r===0&&(u==="|"||u==="&")){for(n++,n<e.length&&e[n]==="|"&&n++;n<e.length&&/\s/.test(e[n]);)n++;continue}if(r===0&&(/\d/.test(u)||u==="-"&&/\d/.test(e[n+1]))){let c=n;for(e[c]==="-"&&c++;c<e.length&&/\d/.test(e[c]);)c++;if(c<e.length&&e[c]==="."&&/\d/.test(e[c+1]))for(c++;c<e.length&&/\d/.test(e[c]);)c++;if(c<e.length&&(e[c]==="e"||e[c]==="E"))for(c++,c<e.length&&(e[c]==="+"||e[c]==="-")&&c++;c<e.length&&/\d/.test(e[c]);)c++;for(i=!0,n=c;n<e.length&&/\s/.test(e[n]);)n++;if(n<e.length&&e[n]==="{")return{type:It(e.slice(t,c).trim()),endPos:c};if(e[n]!=="|"&&e[n]!=="&")return{type:It(e.slice(t,c).trim()),endPos:c};continue}if(r===0&&/[a-zA-Z_]/.test(u)){let c=n;for(;c<e.length&&/\w/.test(e[c]);)c++;for(i=!0,n=c;n<e.length&&/\s/.test(e[n]);)n++;if(n<e.length&&e[n]==="("){r++,n++;continue}if(n<e.length&&e[n]==="{"&&!e.slice(n+1).match(/^\s*(\w+)\s*:/)){let p=c;for(;p>t&&/\s/.test(e[p-1]);)p--;return{type:It(e.slice(t,p).trim()),endPos:c}}if(e[n]!=="|"&&e[n]!=="&")return{type:It(e.slice(t,c).trim()),endPos:c};continue}n++}return i?o(n):null}function pn(e){let t=[],n="",r=0,s=!1,a=!1,i=0;for(;i<e.length;){let o=e[i],u=e[i+1];if(!a&&o==="/"&&u==="/"){s=!0,n+="//",i+=2;continue}if(!s&&o==="/"&&u==="*"){a=!0,n+="/*",i+=2;continue}if(s&&o===`
57
57
  `){s=!1,n+=o,i++;continue}if(a&&o==="*"&&u==="/"){a=!1,n+="*/",i+=2;continue}if(s||a){n+=o,i++;continue}o==="("||o==="{"||o==="["?(r++,n+=o):o===")"||o==="}"||o==="]"?(r--,n+=o):o===","&&r===0?(t.push(n),n=""):n+=o,i++}return n.trim()&&t.push(n),t}function Zn(e,t,n){let r=fn(e,{originalSource:e,requiredParams:t.requiredParams,unsafeFunctions:t.unsafeFunctions,safeFunctions:t.safeFunctions}).source,s=pn(r),a=!1,i=new Set,o=c=>{if(n&&/^\w+$/.test(c)){if(i.has(c))throw new Error(`Duplicate parameter name '${c}'`);i.add(c)}};return s.map(c=>{let l=c.trim();if(!l)return c;if(n&&l.startsWith("{")&&l.endsWith("}")){let d=l.slice(1,-1);return`{ ${oi(d,t)} }`}if(n&&l.startsWith("[")&&l.endsWith("]")){let d=l.slice(1,-1);return`[ ${oi(d,t)} ]`}if(l.startsWith("...")){let d=ui(l);return d!==-1?l.slice(0,d).trim():c}let p=l.match(/^(\w+)\s*\?\s*:\s*(.+)$/);if(p){let[,d,g]=p;return o(d),a=!0,`${d} = ${g}`}if(!oo(l)){let d=l.match(/^(\w+)\s*=/);return d&&o(d[1]),a=!0,c}let f=ui(l);if(f!==-1){let d=l.slice(0,f).trim(),g=l.slice(f+1).trim();return o(d),a&&n&&/^\w+$/.test(d),n&&/^\w+$/.test(d)&&t.requiredParams.add(d),`${d} = ${g}`}return c}).join(",")}function oi(e,t){return pn(e).map(s=>{let a=s.trim();if(!a)return s;let i=a.match(/^(\w+)\s*:\s*(\{[\s\S]*\})$/);if(i){let[,c,l]=i;t.requiredParams.add(c);let p=cn(l);return`${c} = ${p}`}let o=a.match(/^(\w+)\s*:\s*(\[[\s\S]*\])$/);if(o){let[,c,l]=o;t.requiredParams.add(c);let p=ln(l);return`${c} = ${p}`}let u=a.match(/^(\w+)\s*:\s*([\s\S]+)$/);if(u){let[,c,l]=u;return t.requiredParams.add(c),`${c} = ${l}`}return s}).join(", ")}function cn(e){let t=e.slice(1,-1).trim();return`{ ${pn(t).map(s=>{let a=s.trim();if(!a)return s;let i=a.match(/^(\w+)\s*:\s*(\{[\s\S]*\})$/);if(i){let[,p,f]=i;return`${p}: ${cn(f)}`}let o=a.match(/^(\w+)\s*=\s*(\{[\s\S]*\})$/);if(o){let[,p,f]=o;return`${p}: ${cn(f)}`}let u=a.match(/^(\w+)\s*:\s*(\[[\s\S]*\])$/);if(u){let[,p,f]=u;return`${p}: ${ln(f)}`}let c=a.match(/^(\w+)\s*=\s*(\[[\s\S]*\])$/);if(c){let[,p,f]=c;return`${p}: ${ln(f)}`}let l=a.match(/^(\w+)\s*=\s*([\s\S]+)$/);if(l){let[,p,f]=l;return`${p}: ${f}`}return s}).join(", ")} }`}function ln(e){let t=e.slice(1,-1).trim();return`[ ${pn(t).map(s=>{let a=s.trim();return a?a.startsWith("{")&&a.endsWith("}")?cn(a):a.startsWith("[")&&a.endsWith("]")?ln(a):s:s}).join(", ")} ]`}function oo(e){let t=0,n=!1,r=!1,s=!1,a="";for(let i=0;i<e.length;i++){let o=e[i];if(!s&&(o==="'"||o==='"'||o==="`")){s=!0,a=o;continue}if(s){o===a&&e[i-1]!=="\\"&&(s=!1);continue}o==="("||o==="{"||o==="["?t++:o===")"||o==="}"||o==="]"?t--:t===0&&(o===":"&&(n=!0),o==="="&&e[i+1]!==">"&&(r=!0))}return n&&!r}function ui(e){let t=0,n=!1,r="";for(let s=0;s<e.length;s++){let a=e[s];if(!n&&(a==="'"||a==='"'||a==="`")){n=!0,r=a;continue}if(n){a===r&&e[s-1]!=="\\"&&(n=!1);continue}if(a==="("||a==="{"||a==="[")t++;else if(a===")"||a==="}"||a==="]")t--;else if(t===0&&a===":")return s}return-1}function Qn(e){let t="",n=0;for(;n<e.length;){let r=e[n];if(r==="'"||r==='"'||r==="`"){let s=r;for(t+=r,n++;n<e.length&&e[n]!==s;)e[n]==="\\"&&(t+=e[n++]),n<e.length&&(t+=e[n++]);n<e.length&&(t+=e[n++]);continue}if(r==="/"&&e[n+1]==="*"){let s=e.indexOf("*/",n+2),a=s===-1?e.slice(n):e.slice(n,s+2);t+=a,n+=a.length;continue}if(r==="/"&&e[n+1]==="/"){let s=e.indexOf(`
58
- `,n),a=s===-1?e.length:s;t+=" ".repeat(a-n),n=a;continue}t+=r,n++}return t}function hn(e,t={}){let n=e,r,s=new Set,a=new Set,i=new Set,o=/\/\*\s*tjs\s*<-\s*\S+\s*\*\//.test(e),u=t.dialect==="js"?!0:t.dialect==="tjs"?!1:o||t.vmTarget,c=u?{tjsEquals:!1,tjsClass:!1,tjsDate:!1,tjsNoeval:!1,tjsStandard:!1,tjsSafeEval:!1,tjsNoVar:!1,tjsSafeAssign:!1}:{tjsEquals:!0,tjsClass:!0,tjsDate:!0,tjsNoeval:!0,tjsStandard:!0,tjsSafeEval:!1,tjsNoVar:!0,tjsSafeAssign:!0};u&&(r="none");let l=e.match(/^(\s*(?:\/\/[^\n]*\n|\/\*[\s\S]*?\*\/\s*)*)\s*safety\s+(none|inputs|all)\b/);l&&(r=l[2],e=e.replace(/^(\s*(?:\/\/[^\n]*\n|\/\*[\s\S]*?\*\/\s*)*)\s*safety\s+(none|inputs|all)\s*/,"$1"));let p=/^(\s*(?:\/\/[^\n]*\n|\/\*[\s\S]*?\*\/\s*)*)\s*(TjsStrict|TjsCompat|TjsEquals|TjsClass|TjsDate|TjsNoeval|TjsNoVar|TjsStandard|TjsSafeEval|TjsSafeAssign)\b/,f;for(;f=e.match(p);){let I=f[2];I==="TjsStrict"?(c.tjsEquals=!0,c.tjsClass=!0,c.tjsDate=!0,c.tjsNoeval=!0,c.tjsNoVar=!0,c.tjsStandard=!0,c.tjsSafeAssign=!0):I==="TjsCompat"?(c.tjsEquals=!1,c.tjsClass=!1,c.tjsDate=!1,c.tjsNoeval=!1,c.tjsNoVar=!1,c.tjsStandard=!1,c.tjsSafeEval=!1,c.tjsSafeAssign=!1):I==="TjsEquals"?c.tjsEquals=!0:I==="TjsClass"?c.tjsClass=!0:I==="TjsDate"?c.tjsDate=!0:I==="TjsNoeval"?c.tjsNoeval=!0:I==="TjsNoVar"?c.tjsNoVar=!0:I==="TjsStandard"?c.tjsStandard=!0:I==="TjsSafeEval"?c.tjsSafeEval=!0:I==="TjsSafeAssign"&&(c.tjsSafeAssign=!0),e=e.replace(new RegExp(`^(\\s*(?:\\/\\/[^\\n]*\\n|\\/\\*[\\s\\S]*?\\*\\/\\s*)*)\\s*${I}\\s*`),"$1")}e=Qn(e),c.tjsStandard&&(e=Vs(e)),e=ti(e),e=si(e);let d=ii(e);e=d.source;let g=d.annotations,y=Ds(e);e=y.source,e=At(e),c.tjsEquals&&!t.vmTarget&&(e=Pt(e)),e=qs(e),e=Ws(e),e=Us(e),e=Js(e),e=zs(e),e=Zs(e);let w=Ls(e,{loader:t.moduleLoader,importerPath:t.filename});e=w.source;let{source:k,returnType:S,returnSafety:b}=fn(e,{originalSource:n,requiredParams:s,unsafeFunctions:a,safeFunctions:i});e=k;let _=Gs(e);e=_.source,e=Bs(e);let v=Ks(e,s);e=v.source;let x=Fs(e);e=x.source;let E=[...y.blocks,...w.blocks,...x.blocks],$=Qs(e,t.dangerouslySkipTests);e=$.source;let C=Ys(e,s);e=C.source;for(let I of C.polyCtorClasses)a.add(`${I}$dispatch`);return c.tjsClass&&(e=Xs(e,C.polyCtorClasses)),c.tjsDate&&(e=ei(e)),c.tjsNoeval&&(e=ri(e)),c.tjsNoVar&&(e=ni(e)),e=jt(e,_.extensions),{source:e,returnType:S,returnSafety:b,moduleSafety:r,tjsModes:c,originalSource:n,requiredParams:s,unsafeFunctions:a,safeFunctions:i,wasmBlocks:E,tests:$.tests,testErrors:$.errors,polymorphicNames:v.polymorphicNames,extensions:_.extensions,letAnnotations:g}}function Qe(e,t={}){let{filename:n="<source>",colonShorthand:r=!0,vmTarget:s=!1,dialect:a}=t,{source:i,returnType:o,returnSafety:u,moduleSafety:c,originalSource:l,requiredParams:p,unsafeFunctions:f,safeFunctions:d,wasmBlocks:g,tests:y,testErrors:w,letAnnotations:k,tjsModes:S}=r?hn(e,{vmTarget:s,dialect:a,moduleLoader:t.moduleLoader,filename:t.filename}):{source:e,returnType:void 0,returnSafety:void 0,moduleSafety:void 0,originalSource:e,requiredParams:new Set,unsafeFunctions:new Set,safeFunctions:new Set,wasmBlocks:[],tests:[],testErrors:[],letAnnotations:new Map,tjsModes:{tjsEquals:!1,tjsClass:!1,tjsDate:!1,tjsNoeval:!1,tjsStandard:!1,tjsSafeEval:!1,tjsNoVar:!1,tjsSafeAssign:!1}};try{return{ast:je(i,{ecmaVersion:2022,sourceType:"module",locations:!0,allowReturnOutsideFunction:!1}),returnType:o,returnSafety:u,moduleSafety:c,originalSource:l,requiredParams:p,unsafeFunctions:f,safeFunctions:d,wasmBlocks:g,tests:y,testErrors:w,letAnnotations:k,tjsModes:S}}catch(b){let _=b.loc||{line:1,column:0};throw new te(b.message.replace(/\s*\(\d+:\d+\)$/,""),_,l,n)}}function ci(e,t){for(let a of e.body){if(a.type==="ImportDeclaration")throw new te("Imports are not supported. All atoms must be registered with the VM.",a.loc?.start||{line:1,column:0},void 0,t);if(a.type==="ExportNamedDeclaration"||a.type==="ExportDefaultDeclaration")throw new te("Exports are not supported. The function is automatically exported.",a.loc?.start||{line:1,column:0},void 0,t);if(a.type==="ClassDeclaration")throw new te("Classes are not supported. Agent99 uses functional composition.",a.loc?.start||{line:1,column:0},void 0,t)}let n=e.body.filter(a=>a.type==="FunctionDeclaration");if(n.length===0)throw new te("Source must contain a function declaration",{line:1,column:0},void 0,t);let r=n[n.length-1],s=new Map;for(let a=0;a<n.length-1;a++){let i=n[a],o=i.id?.name;if(!o)throw new te("Helper function must have a name",i.loc?.start||{line:1,column:0},void 0,t);if(s.has(o))throw new te(`Duplicate helper function name: ${o}`,i.loc?.start||{line:1,column:0},void 0,t);if(o===r.id?.name)throw new te(`Helper function cannot share a name with the entry function: ${o}`,i.loc?.start||{line:1,column:0},void 0,t);s.set(o,i)}return{entry:r,helpers:s}}function Nt(e,t){let n={params:{}};if(!t.loc)return n;let r=e.substring(0,t.start),s=[...r.matchAll(/\/\*#([\s\S]*?)\*\//g)];if(s.length>0){let l=s[s.length-1],p=r.substring(l.index+l[0].length);if(/^(?:\s|\/\/[^\n]*)*$/.test(p)){let f=l[1],d=f.split(`
58
+ `,n),a=s===-1?e.length:s;t+=" ".repeat(a-n),n=a;continue}t+=r,n++}return t}function hn(e,t={}){let n=e,r,s=new Set,a=new Set,i=new Set,o=/\/\*\s*tjs\s*<-\s*\S+\s*\*\//.test(e),u=t.dialect==="js"?!0:t.dialect==="tjs"?!1:o||t.vmTarget,c=u?{tjsEquals:!1,tjsClass:!1,tjsDate:!1,tjsNoeval:!1,tjsStandard:!1,tjsSafeEval:!1,tjsNoVar:!1,tjsSafeAssign:!1}:{tjsEquals:!0,tjsClass:!0,tjsDate:!0,tjsNoeval:!0,tjsStandard:!0,tjsSafeEval:!1,tjsNoVar:!0,tjsSafeAssign:!0};u&&(r="none");let l=e.match(/^(\s*(?:\/\/[^\n]*\n|\/\*[\s\S]*?\*\/\s*)*)\s*safety\s+(none|inputs|all)\b/);l&&(r=l[2],e=e.replace(/^(\s*(?:\/\/[^\n]*\n|\/\*[\s\S]*?\*\/\s*)*)\s*safety\s+(none|inputs|all)\s*/,"$1"));let p=/^(\s*(?:\/\/[^\n]*\n|\/\*[\s\S]*?\*\/\s*)*)\s*(TjsStrict|TjsCompat|TjsEquals|TjsClass|TjsDate|TjsNoeval|TjsNoVar|TjsStandard|TjsSafeEval|TjsSafeAssign)\b/,f;for(;f=e.match(p);){let I=f[2];I==="TjsStrict"?(c.tjsEquals=!0,c.tjsClass=!0,c.tjsDate=!0,c.tjsNoeval=!0,c.tjsNoVar=!0,c.tjsStandard=!0,c.tjsSafeAssign=!0):I==="TjsCompat"?(c.tjsEquals=!1,c.tjsClass=!1,c.tjsDate=!1,c.tjsNoeval=!1,c.tjsNoVar=!1,c.tjsStandard=!1,c.tjsSafeEval=!1,c.tjsSafeAssign=!1):I==="TjsEquals"?c.tjsEquals=!0:I==="TjsClass"?c.tjsClass=!0:I==="TjsDate"?c.tjsDate=!0:I==="TjsNoeval"?c.tjsNoeval=!0:I==="TjsNoVar"?c.tjsNoVar=!0:I==="TjsStandard"?c.tjsStandard=!0:I==="TjsSafeEval"?c.tjsSafeEval=!0:I==="TjsSafeAssign"&&(c.tjsSafeAssign=!0),e=e.replace(new RegExp(`^(\\s*(?:\\/\\/[^\\n]*\\n|\\/\\*[\\s\\S]*?\\*\\/\\s*)*)\\s*${I}\\s*`),"$1")}e=Qn(e),c.tjsStandard&&(e=Vs(e)),e=ti(e),e=si(e);let d=ii(e);e=d.source;let g=d.annotations,y=Ds(e);e=y.source,e=At(e),c.tjsEquals&&!t.vmTarget&&(e=Pt(e)),e=qs(e),e=Ws(e),e=Us(e),e=Js(e),e=zs(e),c.tjsSafeAssign&&(e=Zs(e));let w=Ls(e,{loader:t.moduleLoader,importerPath:t.filename});e=w.source;let{source:k,returnType:S,returnSafety:b}=fn(e,{originalSource:n,requiredParams:s,unsafeFunctions:a,safeFunctions:i});e=k;let _=Gs(e);e=_.source,e=Bs(e);let v=Ks(e,s);e=v.source;let x=Fs(e);e=x.source;let E=[...y.blocks,...w.blocks,...x.blocks],$=Qs(e,t.dangerouslySkipTests);e=$.source;let C=Ys(e,s);e=C.source;for(let I of C.polyCtorClasses)a.add(`${I}$dispatch`);return c.tjsClass&&(e=Xs(e,C.polyCtorClasses)),c.tjsDate&&(e=ei(e)),c.tjsNoeval&&(e=ri(e)),c.tjsNoVar&&(e=ni(e)),e=jt(e,_.extensions),{source:e,returnType:S,returnSafety:b,moduleSafety:r,tjsModes:c,originalSource:n,requiredParams:s,unsafeFunctions:a,safeFunctions:i,wasmBlocks:E,tests:$.tests,testErrors:$.errors,polymorphicNames:v.polymorphicNames,extensions:_.extensions,letAnnotations:g}}function Qe(e,t={}){let{filename:n="<source>",colonShorthand:r=!0,vmTarget:s=!1,dialect:a}=t,{source:i,returnType:o,returnSafety:u,moduleSafety:c,originalSource:l,requiredParams:p,unsafeFunctions:f,safeFunctions:d,wasmBlocks:g,tests:y,testErrors:w,letAnnotations:k,tjsModes:S}=r?hn(e,{vmTarget:s,dialect:a,moduleLoader:t.moduleLoader,filename:t.filename}):{source:e,returnType:void 0,returnSafety:void 0,moduleSafety:void 0,originalSource:e,requiredParams:new Set,unsafeFunctions:new Set,safeFunctions:new Set,wasmBlocks:[],tests:[],testErrors:[],letAnnotations:new Map,tjsModes:{tjsEquals:!1,tjsClass:!1,tjsDate:!1,tjsNoeval:!1,tjsStandard:!1,tjsSafeEval:!1,tjsNoVar:!1,tjsSafeAssign:!1}};try{return{ast:je(i,{ecmaVersion:2022,sourceType:"module",locations:!0,allowReturnOutsideFunction:!1}),returnType:o,returnSafety:u,moduleSafety:c,originalSource:l,requiredParams:p,unsafeFunctions:f,safeFunctions:d,wasmBlocks:g,tests:y,testErrors:w,letAnnotations:k,tjsModes:S}}catch(b){let _=b.loc||{line:1,column:0};throw new te(b.message.replace(/\s*\(\d+:\d+\)$/,""),_,l,n)}}function ci(e,t){for(let a of e.body){if(a.type==="ImportDeclaration")throw new te("Imports are not supported. All atoms must be registered with the VM.",a.loc?.start||{line:1,column:0},void 0,t);if(a.type==="ExportNamedDeclaration"||a.type==="ExportDefaultDeclaration")throw new te("Exports are not supported. The function is automatically exported.",a.loc?.start||{line:1,column:0},void 0,t);if(a.type==="ClassDeclaration")throw new te("Classes are not supported. Agent99 uses functional composition.",a.loc?.start||{line:1,column:0},void 0,t)}let n=e.body.filter(a=>a.type==="FunctionDeclaration");if(n.length===0)throw new te("Source must contain a function declaration",{line:1,column:0},void 0,t);let r=n[n.length-1],s=new Map;for(let a=0;a<n.length-1;a++){let i=n[a],o=i.id?.name;if(!o)throw new te("Helper function must have a name",i.loc?.start||{line:1,column:0},void 0,t);if(s.has(o))throw new te(`Duplicate helper function name: ${o}`,i.loc?.start||{line:1,column:0},void 0,t);if(o===r.id?.name)throw new te(`Helper function cannot share a name with the entry function: ${o}`,i.loc?.start||{line:1,column:0},void 0,t);s.set(o,i)}return{entry:r,helpers:s}}function Nt(e,t){let n={params:{}};if(!t.loc)return n;let r=e.substring(0,t.start),s=[...r.matchAll(/(?<=^[ \t]*)\/\*#([\s\S]*?)\*\//gm)];if(s.length>0){let l=s[s.length-1],p=r.substring(l.index+l[0].length);if(/^(?:\s|\/\/[^\n]*)*$/.test(p)){let f=l[1],d=f.split(`
59
59
  `),g=d.filter(y=>y.trim().length>0).reduce((y,w)=>{let k=w.match(/^(\s*)/)?.[1].length||0;return Math.min(y,k)},1/0);return g>0&&g<1/0&&(f=d.map(y=>y.slice(g)).join(`
60
60
  `)),n.description=f.trim(),n}}let a=r.match(/\/\*\*[\s\S]*?\*\/\s*$/);if(!a)return n;let i=a[0],o=i.match(/\/\*\*\s*\n?\s*\*?\s*([^@\n][^\n]*)/m);o&&(n.description=o[1].trim());let u=/@param\s+(?:\{[^}]+\}\s+)?(\w+)\s*-?\s*(.*)/g,c;for(;(c=u.exec(i))!==null;)n.params[c[1]]=c[2].trim();return n}function ue(e){switch(e.type){case"Literal":{let t=e.value;if(t===null)return{kind:"null"};if(typeof t=="string")return{kind:"string"};if(typeof t=="number"){let n=e.raw;return n&&n.includes(".")?{kind:"number"}:{kind:"integer"}}return typeof t=="boolean"?{kind:"boolean"}:{kind:"any"}}case"ArrayExpression":{let t=e.elements;if(t.length===0)return{kind:"array",items:{kind:"any"}};let n=t.filter(i=>i!=null).map(i=>ue(i));if(n.length===0)return{kind:"array",items:{kind:"any"}};let r=new Map;for(let i of n){let o=JSON.stringify(i);r.has(o)||r.set(o,i)}let s=[...r.values()];return{kind:"array",items:s.length===1?s[0]:{kind:"union",members:s}}}case"ObjectExpression":{let t=e.properties,n={};for(let r of t)if(r.type==="Property"&&r.key.type==="Identifier"){let s=r.key.name;n[s]=ue(r.value)}return{kind:"object",shape:n}}case"LogicalExpression":{let{operator:t,left:n,right:r}=e;return t==="||"?ue(n):t==="&&"||t==="??"?ue(r):{kind:"any"}}case"BinaryExpression":{let{operator:t,left:n,right:r}=e;if(t==="|"){let s=ue(n),a=ue(r);return a.kind==="null"?{...s,nullable:!0}:s.kind==="null"?{...a,nullable:!0}:{kind:"union",members:[s,a]}}return{kind:"any"}}case"Identifier":return e.name==="undefined"?{kind:"undefined"}:{kind:"any"};case"ArrowFunctionExpression":case"FunctionExpression":{let t=e,n=t.params.map(s=>uo(s)),r={kind:"any"};return t.type==="ArrowFunctionExpression"&&t.body&&t.body.type!=="BlockStatement"&&(r=ue(t.body)),{kind:"function",params:n,returns:r}}case"UnaryExpression":{let t=e.operator,n=e.argument;if(t==="+"&&n.type==="Literal"&&typeof n.value=="number")return{kind:"non-negative-integer"};if(t==="-"&&n.type==="Literal"&&typeof n.value=="number"){let s=n.raw;return s&&s.includes(".")?{kind:"number"}:{kind:"integer"}}return{kind:"any"}}default:return{kind:"any"}}}function uo(e){return e.type==="Identifier"?{name:e.name,type:{kind:"any"}}:e.type==="AssignmentPattern"&&e.left?.type==="Identifier"?{name:e.left.name,type:ue(e.right)}:e.type==="RestElement"&&e.argument?.type==="Identifier"?{name:`...${e.argument.name}`,type:{kind:"array",items:{kind:"any"}}}:{name:"?",type:{kind:"any"}}}function Ge(e,t){if(e.type==="Identifier")return{name:e.name,type:{kind:"any"},required:!0};if(e.type==="AssignmentPattern"){let{left:n,right:r}=e;if(n.type!=="Identifier")throw new K("Only simple parameter names are supported",Z(e));let s=n.name,a=t?.has(s)??!1,i=ue(r),o=Ie(r);return{name:s,type:i,required:a,default:a?null:o,example:o,loc:{start:e.start,end:e.end}}}if(e.type==="ObjectPattern"){let n=e.properties,r={},s={};for(let a of n)if(a.type==="Property"){let i=a.key.type==="Identifier"?a.key.name:String(a.key.value);if(a.value.type==="Identifier")r[i]={kind:"any"},s[i]={name:i,type:{kind:"any"},required:!0};else if(a.value.type==="AssignmentPattern"){let o=Ge(a.value,t),u=t?.has(i)??!1;r[i]=o.type,s[i]={name:i,type:o.type,required:u,default:u?null:o.example,example:o.example}}}return{name:"__destructured__",type:{kind:"object",shape:r,destructuredParams:s},required:!0}}throw new K(`Unsupported parameter pattern: ${e.type}`,Z(e))}function Ie(e){switch(e.type){case"Literal":return e.value;case"ArrayExpression":return e.elements.map(t=>t?Ie(t):null);case"ObjectExpression":{let t={};for(let n of e.properties)n.type==="Property"&&n.key.type==="Identifier"&&(t[n.key.name]=Ie(n.value));return t}case"UnaryExpression":if(e.operator==="-"){let t=Ie(e.argument);return typeof t=="number"?-t:void 0}if(e.operator==="+"){let t=Ie(e.argument);return typeof t=="number"?+t:void 0}return;case"BinaryExpression":{let{operator:t,left:n}=e;return t==="|"?Ie(n):void 0}case"LogicalExpression":{let{operator:t,left:n,right:r}=e;return t==="&&"&&n.type==="Literal"&&n.value===null?null:t==="||"||t==="??"?Ie(n)??Ie(r):void 0}default:return}}function li(e){try{let t=$t(e,0,{ecmaVersion:2022});return ue(t)}catch{return{kind:"any"}}}function Yn(e){switch(e.kind){case"string":return e.nullable?"string | null":"string";case"number":return e.nullable?"number | null":"number";case"integer":return e.nullable?"integer | null":"integer";case"non-negative-integer":return e.nullable?"non-negative integer | null":"non-negative integer";case"boolean":return e.nullable?"boolean | null":"boolean";case"null":return"null";case"any":return"any";case"array":{let t=e.items?Yn(e.items):"any";return e.nullable?`${t}[] | null`:`${t}[]`}case"object":{if(!e.shape||Object.keys(e.shape).length===0)return e.nullable?"object | null":"object";let t=Object.entries(e.shape).map(([n,r])=>`${n}: ${Yn(r)}`).join(", ");return e.nullable?`{ ${t} } | null`:`{ ${t} }`}case"union":return e.members?.map(Yn).join(" | ")||"any";default:return"any"}}function dn(e){switch(e.kind){case"string":return{type:"string"};case"number":return{type:"number"};case"boolean":return{type:"boolean"};case"null":return{};case"undefined":return{};case"any":return{};case"array":return{type:"array",items:e.items?dn(e.items):{}};case"object":if(e.shape){let t={};for(let[n,r]of Object.entries(e.shape))t[n]=dn(r);return{type:"object",properties:t,additionalProperties:!1}}return{type:"object"};case"union":return e.members?{oneOf:e.members.map(dn)}:{};default:return{}}}function co(e){let t={},n=[];for(let[r,s]of Object.entries(e))t[r]=dn(s.type),s.required&&n.push(r);return{type:"object",properties:t,required:n.length>0?n:void 0,additionalProperties:!1}}function Xn(e,t,n,r={},s,a){let i=Nt(t,e),o=new Map;for(let S of e.params){let b=Ge(S,s);if(b.name==="__destructured__"&&b.type.kind==="object"&&b.type.destructuredParams)for(let[_,v]of Object.entries(b.type.destructuredParams))o.set(_,{...v,description:i.params[_]});else b.description=i.params[b.name],o.set(b.name,b)}let u;n&&(u=li(n));let c={depth:0,locals:new Map,parameters:o,atoms:new Set(Object.keys(r.atoms||{})),warnings:[],source:t,filename:r.filename||"<source>",options:r,helpers:a,helperSteps:a?new Map:void 0,helperTransforming:a?new Set:void 0},l=Ee(e.body,c),p=[],f=[],d=[];for(let[S,b]of o.entries())b.required?f.push(S):b.default!==void 0?d.push({name:S,defaultValue:b.default}):f.push(S);f.length>0&&p.push({op:"varsImport",keys:f});for(let{name:S,defaultValue:b}of d)p.push({op:"varsImport",keys:[S]}),p.push({op:"if",condition:{$expr:"binary",op:"==",left:{$expr:"ident",name:S},right:{$expr:"literal",value:null}},then:[{op:"varSet",key:S,value:b}]});p.push(...l);let g=Object.fromEntries(o),y={name:e.id?.name||"anonymous",description:i.description,parameters:g,returns:u},w=co(g),k=c.helperSteps&&c.helperSteps.size>0?Object.fromEntries(c.helperSteps):void 0;return{ast:{op:"seq",steps:p,inputSchema:w,...k&&{helpers:k}},signature:y,warnings:c.warnings}}function Ee(e,t){let n=[];for(let r of e.body){let s=Rt(r,t);s&&(Array.isArray(s)?n.push(...s):n.push(s))}return n}function Rt(e,t){switch(e.type){case"VariableDeclaration":return lo(e,t);case"ExpressionStatement":return fo(e,t);case"IfStatement":return ho(e,t);case"WhileStatement":return mo(e,t);case"ForOfStatement":return go(e,t);case"TryStatement":return yo(e,t);case"ReturnStatement":return bo(e,t);case"ThrowStatement":throw new K("'throw' is not supported in AsyncJS. Use Error('message') to trigger error flow",Z(e),t.source,t.filename);case"BlockStatement":return{op:"scope",steps:Ee(e,Se(t))};case"EmptyStatement":return null;default:throw new K(`Unsupported statement type: ${e.type}`,Z(e),t.source,t.filename)}}function lo(e,t){let n=[],r=e.kind==="const",s=r?"constSet":"varSet";for(let a of e.declarations){if(a.id.type!=="Identifier")throw new K("Only simple variable names are supported",Z(a),t.source,t.filename);let i=a.id.name;if(a.init){let{step:o,resultVar:u}=Ye(a.init,t,i,r);o?n.push(o):u!==i&&n.push({op:s,key:i,value:u});let c=ue(a.init);t.locals.set(i,c)}else{if(r)throw new K("const declarations must be initialized",Z(a),t.source,t.filename);n.push({op:"varSet",key:i,value:null}),t.locals.set(i,{kind:"any",nullable:!0})}}return n}function fo(e,t){let n=e.expression;if(n.type==="AssignmentExpression")return po(n,t);if(n.type==="CallExpression"){let{step:r,resultVar:s}=Ye(n,t);return r||(s?{op:"varSet",key:"_",value:s}:null)}return t.warnings.push({message:"Expression statement has no effect",line:Z(e).line,column:Z(e).column}),null}function po(e,t){if(e.left.type!=="Identifier")throw new K("Only simple variable assignment is supported",Z(e),t.source,t.filename);let n=e.left.name,{step:r,resultVar:s}=Ye(e.right,t,n);return r||{op:"varSet",key:n,value:s}}function ho(e,t){let n=G(e.test,t),r=e.consequent.type==="BlockStatement"?Ee(e.consequent,Se(t)):[Rt(e.consequent,t)].filter(Boolean),s;return e.alternate&&(s=e.alternate.type==="BlockStatement"?Ee(e.alternate,Se(t)):[Rt(e.alternate,t)].filter(Boolean)),{op:"if",condition:n,then:r,...s&&{else:s}}}function mo(e,t){let n=G(e.test,t),r=e.body.type==="BlockStatement"?Ee(e.body,Se(t)):[Rt(e.body,t)].filter(Boolean);return{op:"while",condition:n,body:r}}function go(e,t){let n;if(e.left.type==="VariableDeclaration"){let i=e.left.declarations[0];if(i.id.type!=="Identifier")throw new K("Only simple variable names are supported in for...of",Z(e.left),t.source,t.filename);n=i.id.name}else if(e.left.type==="Identifier")n=e.left.name;else throw new K("Unsupported for...of left-hand side",Z(e.left),t.source,t.filename);let r=ie(e.right,t),s=Se(t);s.locals.set(n,{kind:"any"});let a=e.body.type==="BlockStatement"?Ee(e.body,s):[Rt(e.body,s)].filter(Boolean);return{op:"map",items:r,as:n,steps:a}}function yo(e,t){let n=Ee(e.block,Se(t)),r,s;if(e.handler){let a=Se(t);e.handler.param?.type==="Identifier"&&(s=e.handler.param.name,a.locals.set(s,{kind:"any"})),r=Ee(e.handler.body,a)}return{op:"try",try:n,...r&&{catch:r},...s&&{catchParam:s}}}function bo(e,t){if(!e.argument)return{op:"return",value:{}};let{step:n,resultVar:r}=Ye(e.argument,t,"__returnVal__");return n?[n,{op:"return",value:r}]:{op:"return",value:ie(e.argument,t)}}var pi=new Set(["Math","JSON","Array","Object","String","Number","console","Date","Schema"]),xo=new Set(["parseInt","parseFloat","isNaN","isFinite","encodeURI","decodeURI","encodeURIComponent","decodeURIComponent","Set","Date","filter"]),Mt=new Set(["RegExp","Promise","Map","WeakSet","WeakMap","Symbol","Proxy","Reflect","Function","eval","setTimeout","setInterval","fetch","require","import","process","window","document","global","globalThis"]),_o=new Set(["toUpperCase","toLowerCase","trim","trimStart","trimEnd","charAt","charCodeAt","codePointAt","concat","includes","indexOf","lastIndexOf","startsWith","endsWith","slice","substring","substr","replace","replaceAll","match","search","padStart","padEnd","repeat","normalize","localeCompare","toString","valueOf","at","reverse","sort","fill","copyWithin","flat","flatMap","every","some","forEach","add","remove","has","clear","toArray","union","intersection","diff","format","isBefore","isAfter"]);function wo(e){if(e.callee.type==="Identifier"){let t=e.callee.name;return xo.has(t)||Mt.has(t)}if(e.callee.type==="MemberExpression"){let t=e.callee;if(t.object.type==="Identifier"){let n=t.object.name;if(pi.has(n)||Mt.has(n))return!0}if(t.property.type==="Identifier"){let n=t.property.name;if(_o.has(n))return!0}}return!1}function So(e){if(e.object.type==="Identifier"){let t=e.object.name;return pi.has(t)||Mt.has(t)}return!1}var fi={RegExp:"RegExp is not available. Use string methods or the regexMatch atom.",Promise:"Promise is not needed. All operations are implicitly async.",Map:"Map is not available. Use plain objects instead.",WeakSet:"WeakSet is not available.",WeakMap:"WeakMap is not available.",Symbol:"Symbol is not available.",Proxy:"Proxy is not available.",Reflect:"Reflect is not available.",Function:"Function constructor is not available. Define functions normally.",eval:"eval is not available. Code is compiled, not evaluated.",setTimeout:"setTimeout is not available. Use the delay atom.",setInterval:"setInterval is not available. Use while loops with delay.",fetch:"fetch is not available. Use the httpFetch atom.",require:"require is not available. Atoms must be registered with the VM.",import:"import is not available. Atoms must be registered with the VM.",process:"process is not available. AsyncJS runs in a sandboxed environment.",window:"window is not available. AsyncJS runs in a sandboxed environment.",document:"document is not available. AsyncJS runs in a sandboxed environment.",global:"global is not available. AsyncJS runs in a sandboxed environment.",globalThis:"globalThis is not available. Use builtins directly."};function vo(e){if(e.callee.type==="Identifier"){let t=e.callee.name;if(Mt.has(t))return fi[t]||`${t} is not available in AsyncJS.`}if(e.callee.type==="MemberExpression"){let t=e.callee;if(t.object.type==="Identifier"){let n=t.object.name;if(Mt.has(n))return fi[n]||`${n} is not available in AsyncJS.`}}return null}function hi(e){return{Date:" Use Date() or Date('2024-01-15') instead - no 'new' needed.",Set:" Use Set([items]) instead - no 'new' needed.",Map:" Use plain objects instead of Map.",Array:" Use array literals like [1, 2, 3] instead.",Object:" Use object literals like { key: value } instead.",Error:" Return an error object like { error: 'message' } instead.",RegExp:" Use string methods or the regexMatch atom.",Promise:" Not needed - all operations are implicitly async.",WeakSet:" WeakSet is not available.",WeakMap:" WeakMap is not available."}[e]||" Use factory functions or object literals instead."}function Ye(e,t,n,r){let s=r?"constSet":"varSet";if(e.type==="ChainExpression")return Ye(e.expression,t,n,r);if(e.type==="NewExpression"){let i=e,o="constructor";i.callee.type==="Identifier"&&(o=i.callee.name);let u=hi(o);throw new K(`The 'new' keyword is not supported in AsyncJS.${u}`,Z(e),t.source,t.filename)}if(e.type==="CallExpression"){let i=vo(e);if(i)throw new K(i,Z(e),t.source,t.filename)}if(e.type==="CallExpression"&&wo(e)){let i=G(e,t);return n?{step:{op:s,key:n,value:i},resultVar:n}:{step:null,resultVar:i}}if(e.type==="MemberExpression"&&So(e)){let i=G(e,t);return n?{step:{op:s,key:n,value:i},resultVar:n}:{step:null,resultVar:i}}if(e.type==="CallExpression")return ko(e,t,n,r);if(e.type==="TemplateLiteral")return $o(e,t,n,r);if(e.type==="BinaryExpression"||e.type==="LogicalExpression"||e.type==="UnaryExpression"){let i=G(e,t);return n?{step:{op:s,key:n,value:i},resultVar:n}:{step:null,resultVar:i}}return{step:null,resultVar:ie(e,t)}}function ko(e,t,n,r){let s,a=!1,i;if(e.callee.type==="Identifier")s=e.callee.name;else if(e.callee.type==="MemberExpression"){let u=e.callee;if(u.property.type==="Identifier")s=u.property.name,a=!0,i=ie(u.object,t);else throw new K("Computed method names are not supported",Z(e),t.source,t.filename)}else throw new K("Only named function calls are supported",Z(e),t.source,t.filename);if(a)return To(s,i,e.arguments,t,n,r);if(s==="console"&&e.callee.type,t.helpers?.has(s)){let u=Eo(s,t,e),c=e.arguments.map(l=>ie(l,t));if(c.length!==u.length)throw new K(`Helper '${s}' expects ${u.length} argument(s), got ${c.length}`,Z(e),t.source,t.filename);return{step:{op:"callLocal",name:s,args:c,...n&&{result:n},...n&&r&&{resultConst:!0}},resultVar:n}}let o=Co(e,t);return{step:{op:s,...o,...n&&{result:n},...n&&r&&{resultConst:!0}},resultVar:n}}function Eo(e,t,n){let r=t.helpers.get(e),s=[];for(let a of r.params){let i;if(a.type==="Identifier"?i=a:a.type==="AssignmentPattern"&&a.left?.type==="Identifier"&&(i=a.left),!i)throw new K(`Helper '${e}' parameters must be plain identifiers (optionally with an example value); destructuring is not supported`,a.loc?.start??Z(n),t.source,t.filename);s.push(i.name)}if(t.helperSteps.has(e)||t.helperTransforming.has(e))return s;t.helperTransforming.add(e);try{let a={depth:0,locals:new Map,parameters:new Map(s.map(o=>[o,{name:o,type:{kind:"any"},required:!0}])),atoms:t.atoms,warnings:t.warnings,source:t.source,filename:t.filename,options:t.options,helpers:t.helpers,helperSteps:t.helperSteps,helperTransforming:t.helperTransforming},i=Ee(r.body,a);t.helperSteps.set(e,{steps:i,paramNames:s})}finally{t.helperTransforming.delete(e)}return s}function To(e,t,n,r,s,a){switch(e){case"map":if(n.length>0&&(n[0].type==="ArrowFunctionExpression"||n[0].type==="FunctionExpression")){let i=n[0],o=i.params[0],u=o?.type==="Identifier"?o.name:"item",c=Se(r);c.locals.set(u,{kind:"any"});let l;if(i.body.type==="BlockStatement")l=Ee(i.body,c);else{let{step:p,resultVar:f}=Ye(i.body,c,"result");l=p?[p]:[{op:"varSet",key:"result",value:f}]}return{step:{op:"map",items:t,as:u,steps:l,...s&&{result:s},...s&&a&&{resultConst:!0}},resultVar:s}}break;case"filter":if(n.length>0&&(n[0].type==="ArrowFunctionExpression"||n[0].type==="FunctionExpression")){let i=n[0],o=i.params[0],u=o?.type==="Identifier"?o.name:"item",c=Se(r);c.locals.set(u,{kind:"any"});let l;if(i.body.type==="BlockStatement")throw new K("filter callback must be an expression, not a block",Z(n[0]),r.source,r.filename);return l=G(i.body,c),{step:{op:"filter",items:t,as:u,condition:l,...s&&{result:s},...s&&a&&{resultConst:!0}},resultVar:s}}break;case"find":if(n.length>0&&(n[0].type==="ArrowFunctionExpression"||n[0].type==="FunctionExpression")){let i=n[0],o=i.params[0],u=o?.type==="Identifier"?o.name:"item",c=Se(r);c.locals.set(u,{kind:"any"});let l;if(i.body.type==="BlockStatement")throw new K("find callback must be an expression, not a block",Z(n[0]),r.source,r.filename);return l=G(i.body,c),{step:{op:"find",items:t,as:u,condition:l,...s&&{result:s},...s&&a&&{resultConst:!0}},resultVar:s}}break;case"reduce":if(n.length>=2&&(n[0].type==="ArrowFunctionExpression"||n[0].type==="FunctionExpression")){let i=n[0],o=i.params[0],u=i.params[1],c=o?.type==="Identifier"?o.name:"acc",l=u?.type==="Identifier"?u.name:"item",p=Se(r);p.locals.set(c,{kind:"any"}),p.locals.set(l,{kind:"any"});let f;if(i.body.type==="BlockStatement")f=Ee(i.body,p);else{let{step:g,resultVar:y}=Ye(i.body,p,"result");f=g?[g]:[{op:"varSet",key:"result",value:y}]}let d=ie(n[1],r);return{step:{op:"reduce",items:t,as:l,accumulator:c,initial:d,steps:f,...s&&{result:s},...s&&a&&{resultConst:!0}},resultVar:s}}break;case"slice":break;case"push":return{step:{op:"push",list:t,item:ie(n[0],r),...s&&{result:s},...s&&a&&{resultConst:!0}},resultVar:s};case"join":return{step:{op:"join",list:t,sep:n.length>0?ie(n[0],r):"",...s&&{result:s},...s&&a&&{resultConst:!0}},resultVar:s};case"split":return{step:{op:"split",str:t,sep:n.length>0?ie(n[0],r):"",...s&&{result:s},...s&&a&&{resultConst:!0}},resultVar:s}}return r.warnings.push({message:`Unknown method '${e}' - treating as atom call`,line:0,column:0}),{step:{op:e,receiver:t,args:n.map(i=>ie(i,r)),...s&&{result:s},...s&&a&&{resultConst:!0}},resultVar:s}}function $o(e,t,n,r){let s="",a={};for(let i=0;i<e.quasis.length;i++)if(s+=e.quasis[i].value.cooked||e.quasis[i].value.raw,i<e.expressions.length){let o=e.expressions[i],u=`_${i}`;a[u]=ie(o,t),s+=`{{${u}}}`}return{step:{op:"template",tmpl:s,vars:a,...n&&{result:n},...n&&r&&{resultConst:!0}},resultVar:n}}function G(e,t){switch(e.type){case"Literal":return{$expr:"literal",value:e.value};case"Identifier":return{$expr:"ident",name:e.name};case"MemberExpression":{let n=e,r=G(n.object,t),s=n.optional===!0;if(n.computed){let i=n.property;return i.type==="Literal"?{$expr:"member",object:r,property:String(i.value),computed:!0,...s&&{optional:!0}}:{$expr:"member",object:r,property:G(i,t),computed:!0,...s&&{optional:!0}}}let a=n.property.name;return{$expr:"member",object:r,property:a,...s&&{optional:!0}}}case"ChainExpression":return G(e.expression,t);case"BinaryExpression":{let n=e;return{$expr:"binary",op:n.operator,left:G(n.left,t),right:G(n.right,t)}}case"LogicalExpression":{let n=e;return{$expr:"logical",op:n.operator,left:G(n.left,t),right:G(n.right,t)}}case"UnaryExpression":{let n=e;return{$expr:"unary",op:n.operator,argument:G(n.argument,t)}}case"ConditionalExpression":{let n=e;return{$expr:"conditional",test:G(n.test,t),consequent:G(n.consequent,t),alternate:G(n.alternate,t)}}case"ArrayExpression":return{$expr:"array",elements:e.elements.filter(r=>r!==null).map(r=>G(r,t))};case"ObjectExpression":{let n=e,r=[];for(let s of n.properties)if(s.type==="Property"){let a=s.key.type==="Identifier"?s.key.name:String(s.key.value);r.push({key:a,value:G(s.value,t)})}return{$expr:"object",properties:r}}case"CallExpression":{let n=e;if(n.callee.type==="MemberExpression"){let r=n.callee,s=r.property.type==="Identifier"?r.property.name:String(r.property.value),a=r.optional===!0||n.optional===!0;return{$expr:"methodCall",object:G(r.object,t),method:s,arguments:n.arguments.map(i=>G(i,t)),...a&&{optional:!0}}}if(n.callee.type==="Identifier"){let r=n.callee.name;if(t.helpers?.has(r))throw new K(`Helper '${r}' cannot be called inside an expression. Assign its result to a variable first: const result = ${r}(...); then use result.`,Z(e),t.source,t.filename);return{$expr:"call",callee:r,arguments:n.arguments.map(s=>G(s,t))}}throw new K("Complex function calls in expressions should be lifted to statements",Z(e),t.source,t.filename)}case"NewExpression":{let n=e,r="constructor";n.callee.type==="Identifier"&&(r=n.callee.name);let s=hi(r);throw new K(`The 'new' keyword is not supported in AsyncJS.${s}`,Z(e),t.source,t.filename)}case"TemplateLiteral":throw new K("Template literals inside expressions are not supported. Assign to a variable first: const msg = `hello ${name}`; then use msg",Z(e),t.source,t.filename);default:throw new K(`Unsupported expression type in condition: ${e.type}`,Z(e),t.source,t.filename)}}function ie(e,t){switch(e.type){case"Literal":return e.value;case"Identifier":return e.name;case"MemberExpression":{let n=e;if(n.optional===!0)return G(e,t);let s=ie(n.object,t);if(s&&typeof s=="object"&&s.$expr){let i=n.computed?String(n.property.value):n.property.name;return{$expr:"member",object:s,property:i,...n.computed&&{computed:!0}}}if(n.computed)return G(e,t);let a=n.property.name;return typeof s=="string"?`${s}.${a}`:s&&s.$kind==="arg"?{$kind:"arg",path:`${s.path}.${a}`}:`${s}.${a}`}case"ChainExpression":return ie(e.expression,t);case"ArrayExpression":return e.elements.map(n=>n?ie(n,t):null);case"ObjectExpression":{let n={};for(let r of e.properties)if(r.type==="Property"){let s=r.key.type==="Identifier"?r.key.name:String(r.key.value);n[s]=ie(r.value,t)}return n}case"TemplateLiteral":return G(e,t);case"CallExpression":return G(e,t);case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"ConditionalExpression":return G(e,t);default:return null}}function Co(e,t){if(e.arguments.length===1&&e.arguments[0].type==="ObjectExpression"){let n=e.arguments[0],r={};for(let s of n.properties)if(s.type==="Property"){let a=s.key.type==="Identifier"?s.key.name:String(s.key.value);r[a]=ie(s.value,t)}return r}return{args:e.arguments.map(n=>ie(n,t))}}function Ao(e,t){let n=t;for(;n>0&&e[n-1]!==`
61
61
  `;)n--;if(e.slice(n,t).includes("//"))return!0;let s=0,a=!1;for(;s<t;)!a&&e.slice(s,s+2)==="/*"?(a=!0,s+=2):a&&e.slice(s,s+2)==="*/"?(a=!1,s+=2):s++;return a}function Po(e){let t=[],n=/\/\*test\s+'([^']*)'\s*\{([\s\S]*?)\}\s*\*\/|\/\*test\s+"([^"]*)"\s*\{([\s\S]*?)\}\s*\*\/|\/\*test\s+`([^`]*)`\s*\{([\s\S]*?)\}\s*\*\/|\/\*test\s*\{([\s\S]*?)\}\s*\*\//g,r;for(;(r=n.exec(e))!==null;){let s=r[1]||r[3]||r[5]||`embedded test ${t.length+1}`,a=(r[2]||r[4]||r[6]||r[7]||"").trim();t.push({description:s,body:a,line:er(e,r.index)})}return t}function tr(e){let t=[],n=[],r=Po(e);t.push(...r);let s=/test\s+'([^']*)'\s*\{|test\s+"([^"]*)"\s*\{|test\s+`([^`]*)`\s*\{|test\s*\(\s*'([^']*)'\s*\)\s*\{|test\s*\(\s*"([^"]*)"\s*\)\s*\{|test\s*\(\s*`([^`]*)`\s*\)\s*\{|test\s*\{/g,a=/mock\s*\{/g,i=e,o,u=[];for(;(o=s.exec(e))!==null;){let f=o.index;if(Ao(e,f))continue;let d=o[1]||o[2]||o[3]||o[4]||o[5]||o[6]||`test ${t.length+1}`,g=o.index+o[0].length,y=di(e,g-1);if(y===-1)continue;let w=e.slice(g,y).trim();t.push({description:d,body:w,line:er(e,f)}),u.push({start:f,end:y+1,desc:d})}let c=[];for(;(o=a.exec(e))!==null;){let f=o.index,d=o.index+o[0].length,g=di(e,d-1);if(g===-1)continue;let y=e.slice(d,g).trim();n.push({body:y,line:er(e,f)}),c.push({start:f,end:g+1})}let l=[...u,...c].sort((f,d)=>d.start-f.start);for(let f of l)i=i.slice(0,f.start)+i.slice(f.end);i=i.replace(/\n\s*\n\s*\n/g,`