@surething/cockpit 1.0.200 → 1.0.201
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next-prod/BUILD_ID +1 -1
- package/.next-prod/app-path-routes-manifest.json +7 -7
- package/.next-prod/build-manifest.json +2 -2
- package/.next-prod/prerender-manifest.json +3 -3
- package/.next-prod/required-server-files.js +2 -1
- package/.next-prod/required-server-files.json +2 -1
- package/.next-prod/server/app/_global-error/page.js.nft.json +1 -1
- package/.next-prod/server/app/_global-error.html +1 -1
- package/.next-prod/server/app/_global-error.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found/page.js.nft.json +1 -1
- package/.next-prod/server/app/_not-found.html +1 -1
- package/.next-prod/server/app/_not-found.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next-prod/server/app/api/bash/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/codex/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/deepseek/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/kimi/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/ollama/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/claude-stats/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/commands/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/comments/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/columns/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/connect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/disconnect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/export/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/query/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/schemas/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/extension/version/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/file/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/blame/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/clipboard/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/copy/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/delete/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/expanded/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/index/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/init/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/paste/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/read/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/readdir/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/recent/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/save/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/search/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/stat/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/text/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/branch-diff/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/branches/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/commit-diff/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/commits/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/diff/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/discard/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/stage/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/status/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/unstage/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/worktree/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/global-state/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/jupyter/load/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/jupyter/save/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/jupyter/shutdown/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/definition/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/hover/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/references/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/status/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/warmup/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/columns/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/connect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/disconnect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/export/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/query/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/schemas/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/neo4j/connect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/neo4j/disconnect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/neo4j/query/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/neo4j/schema/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/note/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/ollama/models/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/ollama/start/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/open-cursor/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/open-vscode/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/pick-folder/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/pinned-sessions/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/project-settings/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/project-state/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/file/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/file/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/file-functions/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/file-functions/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/search/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/search/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projects/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/command/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/connect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/delete/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/disconnect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/get/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/keys/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/set/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/[id]/comments/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/[id]/replies/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/[id]/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/identify/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/order/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/share-info/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/users/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/scheduled-tasks/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/services/config/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/services/scripts/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/fork/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/history/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/session-by-path/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/sessions/projects/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/sessions/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/settings/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/skills/[id]/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/skills/content/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/skills/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/aliases/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/autocomplete/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/bubble-order/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/env/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/history/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/version/route.js.nft.json +1 -1
- package/.next-prod/server/app/favicon.ico/route.js.nft.json +1 -1
- package/.next-prod/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/.next-prod/server/app/page.js.nft.json +1 -1
- package/.next-prod/server/app/project/page.js +17 -20
- package/.next-prod/server/app/project/page.js.nft.json +1 -1
- package/.next-prod/server/app/review/[id]/page.js.nft.json +1 -1
- package/.next-prod/server/app-paths-manifest.json +7 -7
- package/.next-prod/server/chunks/7051.js +1 -0
- package/.next-prod/server/middleware-build-manifest.js +1 -1
- package/.next-prod/server/pages/404.html +1 -1
- package/.next-prod/server/pages/500.html +1 -1
- package/.next-prod/server/server-reference-manifest.json +1 -1
- package/.next-prod/server/webpack-runtime.js +1 -1
- package/.next-prod/trace +12 -12
- package/.next-prod/trace-build +1 -1
- package/next.config.mjs +8 -0
- package/package.json +1 -1
- package/.next-prod/server/chunks/2491.js +0 -1
- package/.next-prod/server/chunks/4796.js +0 -4
- package/.next-prod/server/chunks/static/media/web-tree-sitter.f7f7244f.wasm +0 -0
- /package/.next-prod/static/{yaVe-Z92QwkIrhkztzo43 → 34fvdBz-F3Orx91-TIIGP}/_buildManifest.js +0 -0
- /package/.next-prod/static/{yaVe-Z92QwkIrhkztzo43 → 34fvdBz-F3Orx91-TIIGP}/_ssgManifest.js +0 -0
package/.next-prod/trace-build
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"name":"run-webpack","duration":
|
|
1
|
+
[{"name":"run-webpack","duration":13595060,"timestamp":126558652,"id":14,"parentId":1,"tags":{},"startTime":1778083057076,"traceId":"602d1debeaa4fd83"},{"name":"run-typescript","duration":14961256,"timestamp":140157438,"id":1436,"parentId":1,"tags":{},"startTime":1778083070675,"traceId":"602d1debeaa4fd83"},{"name":"static-check","duration":832976,"timestamp":155157672,"id":1439,"parentId":1,"tags":{},"startTime":1778083085675,"traceId":"602d1debeaa4fd83"},{"name":"static-generation","duration":4507609,"timestamp":156097648,"id":1675,"parentId":1,"tags":{},"startTime":1778083086615,"traceId":"602d1debeaa4fd83"},{"name":"collect-build-traces","duration":16758468,"timestamp":155991417,"id":1672,"parentId":1,"tags":{},"startTime":1778083086509,"traceId":"602d1debeaa4fd83"},{"name":"telemetry-flush","duration":51,"timestamp":172753540,"id":1684,"parentId":1,"tags":{},"startTime":1778083103271,"traceId":"602d1debeaa4fd83"},{"name":"next-build","duration":46352265,"timestamp":126401338,"id":1,"tags":{"buildMode":"default","version":"16.2.4","bundler":"webpack","has-custom-webpack-config":"true","use-build-worker":"false"},"startTime":1778083056918,"traceId":"602d1debeaa4fd83"}]
|
package/next.config.mjs
CHANGED
|
@@ -40,9 +40,17 @@ const nextConfig = {
|
|
|
40
40
|
// 这些包不让 webpack 打包,运行时从 node_modules 加载
|
|
41
41
|
// claude-agent-sdk: 内部通过 __dirname 定位 cli.js,打包会把路径硬编码为构建机路径
|
|
42
42
|
// node-pty: 原生模块,不能被 webpack 打包
|
|
43
|
+
// web-tree-sitter: 它的 ESM 包对 Node 环境会做 `await import("module")`
|
|
44
|
+
// 来拿 createRequire。一旦被 webpack 打包,"module" 走 webpack 的 chunk
|
|
45
|
+
// loader (__webpack_require__.t with mode 19),对 Node built-in 的
|
|
46
|
+
// namespace 包装跟原生 ESM 不完全一致,destructure 出来的
|
|
47
|
+
// createRequire 会是 undefined → "createRequire is not a function"。
|
|
48
|
+
// 作为 external 后,Node 用真正的 ESM 解析器加载,import("module")
|
|
49
|
+
// 命中 node:module 内置,行为正常。
|
|
43
50
|
serverExternalPackages: [
|
|
44
51
|
'@anthropic-ai/claude-agent-sdk',
|
|
45
52
|
'node-pty',
|
|
53
|
+
'web-tree-sitter',
|
|
46
54
|
],
|
|
47
55
|
// For webpack (used by `next build --webpack`), use the standard fallback
|
|
48
56
|
// mechanism. `false` = "this module is unavailable, drop the import."
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@surething/cockpit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.201",
|
|
4
4
|
"description": "Claude Code GUI for parallel AI coding — multi-project sessions, terminal, browser & DB bubbles, code review, and slash modes. Built on the official Claude Agent SDK. Local-first, open source.",
|
|
5
5
|
"author": "Robert",
|
|
6
6
|
"license": "MIT",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
exports.id=2491,exports.ids=[2491],exports.modules={48388:(a,b,c)=>{"use strict";c.d(b,{E:()=>au,s7:()=>at,u$:()=>ao,cl:()=>ap,bQ:()=>av});var d=c(73024),e=c(76760),f=c.n(e),g=c(94796);let h=f().join(process.cwd(),"public","tree-sitter"),i=null,j=new Map,k=new Map;async function l(a){let b,c=k.get(a);if(c)return c;let d=await (!(b=j.get(a))&&(b=(async()=>(await (!i&&(i=g.iX.init({locateFile:a=>f().join(h,a)})),i),g.TM.load(f().join(h,`tree-sitter-${a}.wasm`))))(),j.set(a,b)),b);return(c=new g.iX).setLanguage(d),k.set(a,c),c}let m=new Set(["typescript","tsx","javascript","python","go","rust"]);var n=c(31421),o=c(57975);let p=new Map;function q(a){p.set(a.grammarId,a)}function r(a){let b=p.get(a);if(!b)throw Error(`[codeMap] no handler registered for grammar '${a}' — did the handler module get imported (handlers/index.ts barrel)?`);return b}let s=(0,o.promisify)(n.exec),t=new Set([".git","node_modules"]);function u(a){let b=a.toLowerCase(),c=b.lastIndexOf(".");if(c<0)return!1;let d=b.slice(c);for(let a of function(){let a=new Set;for(let b of p.values())for(let c of b.extensions)a.add(c.toLowerCase());return[...a]}())if(a.toLowerCase()===d)return!0;return!1}async function v(a){try{await s("git rev-parse --git-dir",{cwd:a})}catch{return null}let{stdout:b}=await s("git -c core.quotePath=false ls-files --cached --others --exclude-standard",{cwd:a,maxBuffer:0x3200000}),c=[];for(let a of b.split("\n")){let b=a.trim();if(b&&u(b.slice(b.lastIndexOf("/")+1))&&(c.push(b),c.length>=8e3))break}return c}async function w(a,b,c){let e;if(!(c.length>=8e3)){try{e=await d.promises.readdir(a,{withFileTypes:!0})}catch{return}for(let d of e){if(c.length>=8e3)return;if(t.has(d.name)||d.name.startsWith(".git"))continue;let e=f().join(a,d.name);d.isDirectory()?await w(e,b,c):d.isFile()&&u(d.name)&&c.push(f().relative(b,e))}}}let x=[".ts",".tsx",".js",".jsx",".mjs",".cjs"],y=[".js",".jsx",".mjs",".cjs"];function z(a,b,c){let d=f().relative(b,a);if(d.startsWith(".."))return null;for(let a of y)if(d.endsWith(a)){d=d.slice(0,-a.length);break}if(c.has(d))return d;for(let a of x){let b=d+a;if(c.has(b))return b}for(let a of x){let b=f().join(d,"index"+a);if(c.has(b))return b}return null}async function A(a,b){let c=await B(a);if(0===c.length)return new Map;let e=[];try{let{stdout:b}=await s("git -c core.quotePath=false ls-files --cached --others --exclude-standard",{cwd:a,maxBuffer:0x3200000});e=b.split("\n").map(a=>a.trim()).filter(a=>a.endsWith("/package.json")&&!a.includes("node_modules/"))}catch{return new Map}let g=e.filter(a=>{let b=a.slice(0,-13);return c.some(a=>{var c;return c=b,RegExp("^"+a.replace(/\\/g,"/").replace(/[.+^${}()|[\]]/g,"\\$&").replace(/\*\*/g,"___DOUBLESTAR___").replace(/\*/g,"[^/]*").replace(/___DOUBLESTAR___/g,".*")+"$").test(c)})}),h=new Map;for(let c of g){let e;try{e=JSON.parse(await d.promises.readFile(f().join(a,c),"utf8"))}catch{continue}if("string"!=typeof e.name)continue;let g=f().dirname(c),i=function(a,b,c){let d,e=b=>{let d=b.replace(/^\.\//,"");return C(f().posix.join(a,d),c)},g=b.exports;if("string"==typeof g)d=g;else if(g&&"object"==typeof g&&g["."]){let a=g["."];"string"==typeof a?d=a:a&&"object"==typeof a&&(d=a.types??a.import??a.default??a.require)}if("string"==typeof d){let a=e(d);if(a)return a}if("string"==typeof b.main){let a=e(b.main);if(a)return a}for(let b of["src/index.ts","src/index.tsx","index.ts","index.tsx","src/index.js","index.js"])if(c.has(f().posix.join(a,b)))return f().posix.join(a,b);return null}(g,e,b);h.set(e.name,{name:e.name,dir:g,entryFile:i})}return h}async function B(a){try{var b=await d.promises.readFile(f().join(a,"pnpm-workspace.yaml"),"utf8");let c=[],e=!1;for(let a of b.split("\n")){let b=a.replace(/#.*$/,"");if(/^packages\s*:/.test(b)){e=!0;continue}if(!e)continue;let d=b.match(/^\s*-\s*['"]?([^'"#\s]+)['"]?\s*$/);d?c.push(d[1]):/^\S/.test(b)&&(e=!1)}return c}catch{}try{let b=JSON.parse(await d.promises.readFile(f().join(a,"package.json"),"utf8")),c=b?.workspaces;if(Array.isArray(c))return c.filter(a=>"string"==typeof a);if(c&&Array.isArray(c.packages))return c.packages.filter(a=>"string"==typeof a)}catch{}return[]}function C(a,b){if(a.startsWith("..")||a.startsWith("/"))return null;for(let b of y)if(a.endsWith(b)){a=a.slice(0,-b.length);break}if(b.has(a))return a;for(let c of x){let d=a+c;if(b.has(d))return d}for(let c of x){let d=f().posix.join(a,"index"+c);if(b.has(d))return d}return null}async function D(a,b){let c,e=new Map;try{let b=(await d.promises.readFile(a,"utf8")).replace(/^\s*\/\/.*$/gm,"");c=JSON.parse(b)}catch{return e}let g=c?.compilerOptions?.baseUrl??".",h=c?.compilerOptions?.paths??{},i=f().resolve(f().dirname(a),g),j=f().relative(b,i)||".";for(let[a,b]of Object.entries(h)){if(!Array.isArray(b)||0===b.length)continue;let c=a.replace(/\/\*$/,""),d=b[0].replace(/\/\*$/,"");e.set(c,f().join(j,d))}return e}async function E(a){let b=[],c=[];try{let{stdout:b}=await s("git -c core.quotePath=false ls-files --cached --others --exclude-standard",{cwd:a,maxBuffer:0x3200000});c=b.split("\n").map(a=>a.trim()).filter(a=>/(^|\/)tsconfig[^/]*\.json$/.test(a)&&!a.includes("node_modules/"))}catch{try{await d.promises.access(f().join(a,"tsconfig.json")),c=["tsconfig.json"]}catch{}}for(let d of c){let c=await D(f().join(a,d),a);if(0===c.size)continue;let e=f().dirname(d);b.push({scope:"."===e?"":e,aliases:c,sortedAliases:F(c)})}let e=b.find(a=>""===a.scope);return e||(e={scope:"",aliases:new Map,sortedAliases:[]},b.push(e)),e.aliases.has("@")||(e.aliases.set("@","./src"),e.sortedAliases=F(e.aliases)),b.sort((a,b)=>b.scope.length-a.scope.length)}function F(a){return[...a.entries()].sort(([a],[b])=>b.length-a.length)}function G(a){let b=0xdeadbeef,c=0x41c6ce57;for(let d=0;d<a.length;d++){let e=a.charCodeAt(d);b=Math.imul(b^e,0x9e3779b1),c=Math.imul(c^e,0x5f356495)}return b=Math.imul(b^b>>>16,0x85ebca6b)^Math.imul(c^c>>>13,0xc2b2ae35),(0x100000000*(2097151&(c=Math.imul(c^c>>>16,0x85ebca6b)^Math.imul(b^b>>>13,0xc2b2ae35)))+(b>>>0)>>>0).toString(16)}function H(a){return a.replace(/\s+/g," ").trim()}function I(a,b){return a?`${a}>${b}`:b}function J(a){let b=a.childForFieldName("name");if(b)return b.text;for(let b=0;b<a.namedChildCount;b++){let c=a.namedChild(b);if(c&&("identifier"===c.type||"type_identifier"===c.type||"property_identifier"===c.type))return c.text}return"<anonymous>"}function K(a,b,c,d,e=[],f){return{qualifiedName:I(d,b),name:b,kind:c,startLine:a.startPosition.row+1,endLine:a.endPosition.row+1,contentHash:G(H(a.text)),children:e,params:f}}function L(a){let b=a.childForFieldName("parameter");if(b)return[b.text];let c=a.childForFieldName("parameters");if(!c)return;let d=[];for(let a=0;a<c.namedChildCount;a++){let b=c.namedChild(a);b&&d.push(function a(b){switch(b.type){case"required_parameter":case"optional_parameter":{let c=b.childForFieldName("pattern");return c?a(c):b.text}case"assignment_pattern":{let c=b.childForFieldName("left");return c?a(c):b.text}case"default_parameter":case"typed_default_parameter":{let a=b.childForFieldName("name");return a?a.text:b.text}case"typed_parameter":for(let a=0;a<b.namedChildCount;a++){let c=b.namedChild(a);if(c?.type==="identifier")return c.text}return b.text;default:return b.text}}(b))}return d}function M(a,b){let c=a.text.split("\n"),d=c.length;if(0===d)return[];let e=new Uint8Array(d+2);for(let a of b){let b=Math.max(1,a.startLine),c=Math.min(d,a.endLine);for(let a=b;a<=c;a++)e[a]=1}let f=[],g=(a,b)=>{let d=!1;for(let e=a;e<=b;e++){let a=c[e-1];if(a&&a.trim().length>0){d=!0;break}}if(!d)return;let e=c.slice(a-1,b).join("\n");f.push({qualifiedName:`__code_${a}_${b}__`,name:"code",kind:"unknown",startLine:a,endLine:b,contentHash:G(H(e)),children:[]})},h=-1;for(let a=1;a<=d;a++)e[a]?h>=0&&(g(h,a-1),h=-1):h<0&&(h=a);return h>=0&&g(h,d),f}function N(a){let b=[],c=function(a){let b=[],c=-1,d=-1;for(let e=0;e<a.namedChildCount;e++){let f=a.namedChild(e);if(f){if("import_statement"===f.type||"export_statement"===f.type&&null!==f.childForFieldName("source")||"import_from_statement"===f.type||"future_import_statement"===f.type)b.push(f),c<0&&(c=f.startPosition.row+1),d=f.endPosition.row+1;else if(c>=0)break}}return c<0?null:{qualifiedName:"__imports__",name:"imports",kind:"unknown",startLine:c,endLine:d,contentHash:G(H(b.map(a=>a.text).join("\n"))),children:[]}}(a);c&&b.push(c);for(let c=0;c<a.namedChildCount;c++){let d=a.namedChild(c);d&&b.push(...function a(b,c,d=!1){switch(b.type){case"export_statement":case"export_default_declaration":{let d=[];for(let e=0;e<b.namedChildCount;e++){let f=b.namedChild(e);f&&d.push(...a(f,c,!0))}return d}case"function_declaration":case"generator_function_declaration":case"function_definition":return[K(b,J(b),"function",c,[],L(b))];case"class_declaration":case"abstract_class_declaration":{let a=J(b),d=I(c,a),e=function(a,b){if(!a)return[];let c=[];for(let d=0;d<a.namedChildCount;d++){let e=a.namedChild(d);if(e){if("method_definition"===e.type)c.push(K(e,J(e),"method",b,[],L(e)));else if("public_field_definition"===e.type){let a=e.childForFieldName("value");a&&("arrow_function"===a.type||"function_expression"===a.type)&&c.push(K(e,J(e),"method",b,[],L(a)))}}}return c}(b.childForFieldName("body"),d);return[K(b,a,"class",c,e)]}case"interface_declaration":return[K(b,J(b),"interface",c)];case"type_alias_declaration":return[K(b,J(b),"type",c)];case"enum_declaration":return[K(b,J(b),"enum",c)];case"lexical_declaration":case"variable_declaration":return function(a,b){let c=[];for(let d=0;d<a.namedChildCount;d++){let e=a.namedChild(d);if(!e||"variable_declarator"!==e.type)continue;let f=e.childForFieldName("name"),g=e.childForFieldName("value");if(!f)continue;let h=f.text,i=g&&("arrow_function"===g.type||"function_expression"===g.type),j=i&&g?L(g):void 0;if(c.push(K(a,h,i?"function":"const",b,[],j)),g&&"object"===g.type&&!i){let a=b?`${b}>${h}`:h;for(let b=0;b<g.namedChildCount;b++){let d=g.namedChild(b);if(d){if("pair"===d.type){let b=d.childForFieldName("key"),e=d.childForFieldName("value");if(!b||!e||"property_identifier"!==b.type&&"identifier"!==b.type||"arrow_function"!==e.type&&"function_expression"!==e.type)continue;c.push(K(d,b.text,"method",a,[],L(e)))}else if("method_definition"===d.type){let b=J(d);b&&c.push(K(d,b,"method",a,[],L(d)))}}}}}return c}(b,c);case"class_definition":{let a=J(b),d=I(c,a),e=function a(b,c){if(!b)return[];let d=[];for(let e=0;e<b.namedChildCount;e++){let f=b.namedChild(e);if(f){if("function_definition"===f.type)d.push(K(f,J(f),"method",c,[],L(f)));else if("decorated_definition"===f.type){let b=f.childForFieldName("definition");if(b?.type==="function_definition")d.push({...K(b,J(b),"method",c,[],L(b)),startLine:f.startPosition.row+1,contentHash:G(H(f.text))});else if(b?.type==="class_definition"){let e=J(b),g=I(c,e),h=a(b.childForFieldName("body"),g);d.push({...K(b,e,"class",c,h),startLine:f.startPosition.row+1,contentHash:G(H(f.text))})}}else if("class_definition"===f.type){let b=J(f),e=I(c,b),g=a(f.childForFieldName("body"),e);d.push(K(f,b,"class",c,g))}}}return d}(b.childForFieldName("body"),d);return[K(b,a,"class",c,e)]}case"decorated_definition":{let d=b.childForFieldName("definition");if(!d)return[];return a(d,c,!1).map(a=>({...a,startLine:b.startPosition.row+1,contentHash:G(H(b.text))}))}case"expression_statement":{let a=[];for(let d=0;d<b.namedChildCount;d++){let e=b.namedChild(d);if(e?.type==="assignment"){let d=function(a,b,c){let d=b.childForFieldName("left");if(!d||"identifier"!==d.type)return null;let e=d.text;return{qualifiedName:I(c,e),name:e,kind:"const",startLine:a.startPosition.row+1,endLine:a.endPosition.row+1,contentHash:G(H(a.text)),children:[]}}(b,e,c);d&&a.push(d)}}return a.push(...function(a,b){let c=null;for(let b=0;b<a.namedChildCount;b++){let d=a.namedChild(b);if(d){if("call_expression"===d.type){c=d;break}if("await_expression"===d.type){for(let a=0;a<d.namedChildCount;a++){let b=d.namedChild(a);if(b?.type==="call_expression"){c=b;break}}break}}}if(!c)return[];let d=c.childForFieldName("function"),e=c.childForFieldName("arguments");if(!d||!e)return[];let f=null,g=[];for(let a=0;a<e.namedChildCount;a++){let b=e.namedChild(a);if(b){if(null===f&&("string"===b.type||"template_string"===b.type)){let a=b.text;f=a.length>=2&&/^["'`]/.test(a)?a.slice(1,-1):a}("arrow_function"===b.type||"function_expression"===b.type)&&g.push(b)}}if(0===g.length||!f)return[];let h=function a(b){if("identifier"===b.type)return b.text;if("member_expression"===b.type){let a=b.childForFieldName("property");return a?.text??""}if("call_expression"===b.type){let c=b.childForFieldName("function");return c?a(c):""}return""}(d),i=h?`${h} ${f}`:f;return g.map((a,c)=>K(a,g.length>1?`${i} #${c+1}`:i,"function",b,[],L(a)))}(b,c)),a}default:return[]}}(d,void 0,!1))}return b.push(...M(a,b)),b}function O(a){let b=[];return!function a(c){if("call_expression"===c.type||"call"===c.type){let a=c.childForFieldName("function"),d=function a(b){if(!b)return null;if("identifier"===b.type||"shorthand_property_identifier"===b.type)return b.text;if("member_expression"===b.type){let a=b.childForFieldName("property");return a?.text??null}if("attribute"===b.type){let a=b.childForFieldName("attribute");return a?.text??null}return"call_expression"===b.type||"call"===b.type?a(b.childForFieldName("function")):null}(a);if(d){let e=function(a){if(!a||"member_expression"!==a.type&&"attribute"!==a.type)return;let b=a;for(;b;){if("identifier"===b.type)return b.text;if("this"===b.type||"super"===b.type)break;if("member_expression"===b.type||"attribute"===b.type){b=b.childForFieldName("object");continue}break}}(a);b.push({calleeName:d,line:c.startPosition.row+1,...e?{receiverName:e}:{}})}}else if("jsx_opening_element"===c.type||"jsx_self_closing_element"===c.type){let a=function a(b){return b?"identifier"===b.type?/^[A-Z]/.test(b.text)?b.text:null:"member_expression"===b.type||"jsx_member_expression"===b.type?a(b.childForFieldName("object")??b.namedChild(0)):null:null}(c.childForFieldName("name"));a&&b.push({calleeName:a,line:c.startPosition.row+1})}for(let b=0;b<c.childCount;b++){let d=c.child(b);d&&a(d)}}(a),b}function P(a){let b=[];for(let c=0;c<a.namedChildCount;c++){let d=a.namedChild(c);if(d)if("import_statement"===d.type){let a=d.childForFieldName("source");a?function(a,b,c){let d=Q(b.text),e=null;for(let b=0;b<a.namedChildCount;b++){let c=a.namedChild(b);if(c?.type==="import_clause"){e=c;break}}if(e)for(let a=0;a<e.namedChildCount;a++){let b=e.namedChild(a);if(b){if("identifier"===b.type)c.push({specifier:d,importedName:"default",localName:b.text});else if("namespace_import"===b.type){let a=function(a,b){for(let c=0;c<a.namedChildCount;c++){let d=a.namedChild(c);if(d?.type===b)return d}return null}(b,"identifier");a&&c.push({specifier:d,importedName:"*",localName:a.text})}else if("named_imports"===b.type)for(let a=0;a<b.namedChildCount;a++){let e=b.namedChild(a);if(!e||"import_specifier"!==e.type)continue;let f=e.childForFieldName("name"),g=e.childForFieldName("alias");f&&c.push({specifier:d,importedName:f.text,localName:g?.text??f.text})}}}}(d,a,b):function(a,b){for(let c=0;c<a.childCount;c++){let d=a.child(c);if(d&&"name"===a.fieldNameForChild(c)){if("dotted_name"===d.type){let a=d.text,c=a.split(".")[0];b.push({specifier:a,importedName:"*",localName:c})}else if("aliased_import"===d.type){let a=d.childForFieldName("name"),c=d.childForFieldName("alias");a?.type==="dotted_name"&&c&&b.push({specifier:a.text,importedName:"*",localName:c.text})}}}}(d,b)}else"import_from_statement"===d.type&&function(a,b){let c=a.childForFieldName("module_name"),d="";if(c){if("dotted_name"===c.type)d=c.text;else if("relative_import"===c.type){let a="",b="";for(let d=0;d<c.namedChildCount;d++){let e=c.namedChild(d);e&&("import_prefix"===e.type?a=e.text:"dotted_name"===e.type&&(b=e.text))}d=a+b}}if(!d)return;let e=!1;for(let c=0;c<a.childCount;c++){let f=a.child(c);if(!f)continue;let g=a.fieldNameForChild(c);if("wildcard_import"===f.type){e=!0;continue}if("name"===g){if("dotted_name"===f.type){let a=f.text;b.push({specifier:d,importedName:a,localName:a})}else if("aliased_import"===f.type){let a=f.childForFieldName("name"),c=f.childForFieldName("alias");a?.type==="dotted_name"&&c&&b.push({specifier:d,importedName:a.text,localName:c.text})}}}e&&b.push({specifier:d,importedName:"*",localName:"*"})}(d,b)}return b}function Q(a){return a.length>=2&&('"'===a[0]||"'"===a[0])&&a[a.length-1]===a[0]?a.slice(1,-1):a}function R(a){let b=[];function c(a){if(!a||"string"!==a.type)return null;for(let b=0;b<a.namedChildCount;b++){let c=a.namedChild(b);if(c&&"string_fragment"===c.type)return c.text}return""}return!function a(d){switch(d.type){case"import_statement":case"export_statement":{let a=c(d.childForFieldName("source"));a&&b.push(a);return}case"call_expression":{let a=d.childForFieldName("function");if(a){let e="import"===a.type,f="identifier"===a.type&&"require"===a.text;if(e||f){let a=d.childForFieldName("arguments");if(a&&a.namedChildCount>0){let d=c(a.namedChild(0));d&&b.push(d)}}}}}for(let b=0;b<d.namedChildCount;b++){let c=d.namedChild(b);c&&a(c)}}(a),b}let S={typescript:R,tsx:R,javascript:R,python:function(a){let b=[];return!function a(c){switch(c.type){case"import_statement":for(let a=0;a<c.childCount;a++){let d=c.child(a);if(d&&"name"===c.fieldNameForChild(a)){if("dotted_name"===d.type)b.push(d.text);else if("aliased_import"===d.type){let a=d.childForFieldName("name");a?.type==="dotted_name"&&b.push(a.text)}}}return;case"import_from_statement":{let a=function(a){let b=a.childForFieldName("module_name");if(!b)return"";if("dotted_name"===b.type)return b.text;if("relative_import"===b.type){let a="",c="";for(let d=0;d<b.namedChildCount;d++){let e=b.namedChild(d);e&&("import_prefix"===e.type?a=e.text:"dotted_name"===e.type&&(c=e.text))}return a+c}return""}(c);a&&b.push(a);return}}for(let b=0;b<c.namedChildCount;b++){let d=c.namedChild(b);d&&a(d)}}(a),b}};function T(a,b){let c=S[b];return c?c(a):[]}function U(a){return"function"===a||"class"===a||"method"===a}function V(a,b){return{grammarId:a,extensions:b,extractSymbols:(a,b)=>N(a),extractImports:b=>({specs:T(b,a),bindings:[...P(b),...function(a){let b=[];for(let c=0;c<a.namedChildCount;c++){let d=a.namedChild(c);if(!d||"export_statement"!==d.type)continue;let e=d.childForFieldName("source");if(!e)continue;let f=Q(e.text),g=null;for(let a=0;a<d.namedChildCount;a++){let b=d.namedChild(a);if(b?.type==="export_clause"){g=b;break}}if(g)for(let a=0;a<g.namedChildCount;a++){let c=g.namedChild(a);if(!c||"export_specifier"!==c.type)continue;let d=c.childForFieldName("name"),e=c.childForFieldName("alias");if(!d)continue;let h=d.text,i=e?.text??h;b.push({localName:i,specifier:f,importedName:h,isReexport:!0})}}return b}(b)]}),extractCallSites:(a,b)=>O(a),async buildProjectContext(a,b){let c=new Set(b),d=await E(a),e=await A(a,c),f=[...e.keys()].sort((a,b)=>b.length-a.length);return{cwd:a,tsconfigs:d,workspaces:e,sortedWsNames:f,owningScopesCache:new Map}},resolveSpecifier(a,b,c,d){let e=c.owningScopesCache.get(b);if(e||(e=c.tsconfigs.filter(a=>{var c;return""===(c=a.scope)||b===c||b.startsWith(c+"/")}),c.owningScopesCache.set(b,e)),a.startsWith("./")||a.startsWith("../"))return z(f().resolve(c.cwd,f().dirname(b),a),c.cwd,d);if(a.startsWith("/"))return z(f().resolve(c.cwd,a.slice(1)),c.cwd,d);for(let b of e){let e=b.sortedAliases.find(([b])=>a===b||a.startsWith(b+"/"));if(!e)continue;let[g,h]=e,i=a===g?"":a.slice(g.length+1),j=z(f().resolve(c.cwd,h,i),c.cwd,d);if(j)return j}for(let b of c.sortedWsNames){if(a!==b&&!a.startsWith(b+"/"))continue;let e=c.workspaces.get(b);if(a===b)return e.entryFile;let g=a.slice(b.length+1);return C(f().posix.join(e.dir,g),d)??C(f().posix.join(e.dir,"src",g),d)}return null},resolveCall(a,b,c,d,e){if(a.receiverName){let b=c.bindingsByLocalName.get(a.receiverName);if(!b)return[];let e=c.resolvedImports.get(b.specifier);if(!e)return[];let f=d.get(e);if(!f)return[];let g=function a(b,c,d,e,f,g){if(e>5||f.has(b.path))return null;if(f.add(b.path),"*"!==c){let a=`${c}>${d}`,e=b.symbolsByQname.get(a);if(e&&U(e.kind))return e}if("*"===c){let a=b.symbolsByName.get(d);if(a){let b=null;for(let c of a)!c.qualifiedName.includes(">")&&U(c.kind)&&(!b||c.endLine-c.startLine>b.endLine-b.startLine)&&(b=c);if(b)return b}}let h=b.reexportsByLocalName.get(c);if(h){let c=b.resolvedImports.get(h.specifier);if(c){let b=g.get(c);if(b){let c=a(b,h.importedName,d,e+1,f,g);if(c)return c}}}return null}(f,b.importedName,a.calleeName,0,new Set,d);return g?[{kind:"symbol",addr:{filePath:g.filePath,qualifiedName:g.qualifiedName}}]:[{kind:"method-unresolved",receiverName:a.receiverName,methodName:a.calleeName}]}let f=c.symbolsByName.get(a.calleeName);if(f&&f.length>0){let a=[];for(let c of f)c.qualifiedName!==b.qualifiedName&&U(c.kind)&&a.push({kind:"symbol",addr:{filePath:c.filePath,qualifiedName:c.qualifiedName}});return a}let g=c.bindingsByLocalName.get(a.calleeName);if(!g)return[];let h=c.resolvedImports.get(g.specifier);if(!h)return[{kind:"external",name:g.importedName,packageSpec:g.specifier}];let i=d.get(h);if(!i)return[];let j=function a(b,c,d,e,f){if(d>5||e.has(b.path))return null;e.add(b.path);let g=b.symbolsByName.get(c);if(g){let a=null;for(let b of g)U(b.kind)&&(!a||b.endLine-b.startLine>a.endLine-a.startLine)&&(a=b);if(a)return a}let h=b.reexportsByLocalName.get(c);if(h){let c=b.resolvedImports.get(h.specifier);if(c){let b=f.get(c);if(b){let c=a(b,h.importedName,d+1,e,f);if(c)return c}}}return null}(i,g.importedName,0,new Set,d);return j?[{kind:"symbol",addr:{filePath:j.filePath,qualifiedName:j.qualifiedName}}]:[]},moduleForFile:(a,b)=>a}}let W=V("typescript",[".ts"]),X=V("tsx",[".tsx",".jsx"]),Y=V("javascript",[".js",".mjs",".cjs"]);function Z(a){return"function"===a||"class"===a||"method"===a}function $(a,b,c){let d=b.replace(/\./g,"/"),e=(...a)=>a.filter(a=>""!==a&&"."!==a).join("/");if(!d){let b=e(a,"__init__.py");return c.has(b)?b:null}let f=e(a,d+".py");if(c.has(f))return f;let g=e(a,d,"__init__.py");return c.has(g)?g:null}function _(a,b,c,d,e=[],f){return{qualifiedName:d?`${d}>${b}`:b,name:b,kind:c,startLine:a.startPosition.row+1,endLine:a.endPosition.row+1,contentHash:G(H(a.text)),children:e,params:f}}function aa(a){let b=a.childForFieldName("parameters");if(!b)return;let c=[];for(let a=0;a<b.namedChildCount;a++){let d=b.namedChild(a);if(d){if("parameter_declaration"===d.type){let a=d.childForFieldName("name");if(!a){c.push("_");continue}if("identifier"===a.type)c.push(a.text);else if("identifier_list"===a.type)for(let b=0;b<a.namedChildCount;b++){let d=a.namedChild(b);d?.type==="identifier"&&c.push(d.text)}else c.push(a.text)}else if("variadic_parameter_declaration"===d.type){let a=d.childForFieldName("name");a?.type==="identifier"?c.push(`...${a.text}`):c.push("...")}}}return c}async function ab(a){try{let b=await d.promises.readFile(f().join(a,"go.mod"),"utf8"),c=/^\s*module\s+(\S+)/m.exec(b);return c?c[1].trim():null}catch{return null}}function ac(a){return"function"===a||"class"===a||"method"===a}function ad(a,b,c,d,e=[],f){return{qualifiedName:d?`${d}>${b}`:b,name:b,kind:c,startLine:a.startPosition.row+1,endLine:a.endPosition.row+1,contentHash:G(H(a.text)),children:e,params:f}}function ae(a){let b=a.childForFieldName("parameters");if(!b)return;let c=[];for(let a=0;a<b.namedChildCount;a++){let d=b.namedChild(a);if(d)if("self_parameter"===d.type)c.push(d.text);else if("parameter"===d.type){let a=d.childForFieldName("pattern");a?c.push(a.text):c.push("_")}else"variadic_parameter"===d.type&&c.push("...")}return c}async function af(a,b){let c=new Map,e=new Map,g=new Set;async function h(i,j){let k;if(g.has(j))return;g.add(j),c.set(i,j),e.set(j,i);try{k=await d.promises.readFile(f().join(a,j),"utf8")}catch{return}let l=function(a){let b,c=a.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/.*$/gm,"").replace(/"(?:\\.|[^"\\\n])*"/g,'""'),d=[],e=/\b(?:pub(?:\s*\([^)]*\))?\s+)?mod\s+(\w+)\s*;/g;for(;null!==(b=e.exec(c));)d.push(b[1]);return d}(k);if(0===l.length)return;let m=f().dirname(j),n=f().basename(j,".rs"),o="mod"===n||"lib"===n||"main"===n?[m]:[m,f().join(m,n)];for(let a of l){let c=`${i}::${a}`,d=null;for(let c of o){for(let e of[f().join(c,`${a}.rs`),f().join(c,a,"mod.rs")]){let a=e.startsWith("./")?e.slice(2):e;if(b.has(a)){d=a;break}}if(d)break}d&&await h(c,d)}}for(let a of function(a){let b=[];for(let c of a)("src/lib.rs"===c||"src/main.rs"===c||c.endsWith("/src/lib.rs")||c.endsWith("/src/main.rs")||/^src\/bin\/[^/]+\.rs$/.test(c)||/\/src\/bin\/[^/]+\.rs$/.test(c))&&b.push(c);return b}(b))if("src/lib.rs"===a||"src/main.rs"===a)await h("crate",a);else if(a.startsWith("src/bin/"))await h("crate",a);else{let b=a.split("/"),c=b.indexOf("src");if(c>0){let d=b[c-1];await h(d,a)}}return{modTree:c,fileToMod:e}}function ag(a){return"function"===a||"class"===a||"method"===a}async function ah(a,b,c){let d=Array(a.length),e=0;async function f(){for(;e<a.length;){let b=e++;d[b]=await c(a[b])}}return await Promise.all(Array.from({length:Math.min(b,a.length)},f)),d}async function ai(a,b){let c,e,f=function(a){switch(a.slice(a.lastIndexOf(".")).toLowerCase()){case".ts":return"typescript";case".tsx":case".jsx":return"tsx";case".js":case".mjs":case".cjs":return"javascript";case".py":case".pyi":return"python";case".go":return"go";case".rs":return"rust";default:return null}}(b);if(!f)return null;try{c=await d.promises.readFile(a,"utf8")}catch{return null}if(c.length>1e6)return null;let g=await l(f);try{e=g.parse(c)}catch(a){return console.error("[codeIndex] parse failed for",b,a),null}if(!e)return null;try{let a,d=r(f),g=d.extractSymbols(e.rootNode,c),h=(a=[],!function c(d){for(let e of d)a.push({filePath:b,qualifiedName:e.qualifiedName,name:e.name,kind:e.kind,startLine:e.startLine,endLine:e.endLine,params:e.params}),c(e.children)}(g),a),{specs:i,bindings:j}=d.extractImports(e.rootNode),k=d.extractCallSites(e.rootNode,h);return{path:b,language:f,symbolsTree:g,flatSymbols:h,importBindings:j,importSpecifiers:i,rawCalls:k}}finally{e.delete()}}q(W),q(X),q(Y),q({grammarId:"python",extensions:[".py",".pyi"],extractSymbols:(a,b)=>N(a),extractImports:a=>({specs:T(a,"python"),bindings:P(a)}),extractCallSites:(a,b)=>O(a),buildProjectContext(a,b){let c=[a],d=!1;if(b.has("src/__init__.py"))d=!0;else for(let a of b)if(a.startsWith("src/")&&a.endsWith(".py")){d=!0;break}return d&&c.push(f().join(a,"src")),{cwd:a,pythonRoots:c}},resolveSpecifier(a,b,c,d){let e=/^(\.+)/.exec(a);if(e){let c=e[1].length,g=a.slice(c),h=f().dirname(b);for(let a=1;a<c;a++)h=f().dirname(h);return $(h||".",g,d)}for(let b of c.pythonRoots){let e=$(f().relative(c.cwd,b)||".",a,d);if(e)return e}return null},resolveCall(a,b,c,d,e){if(a.receiverName){let b=c.bindingsByLocalName.get(a.receiverName);if(!b)return[];let e=c.resolvedImports.get(b.specifier);if(!e)return[];let f=d.get(e);if(!f)return[];let g=function(a,b,c){if("*"!==b){let d=`${b}>${c}`,e=a.symbolsByQname.get(d);if(e&&Z(e.kind))return e}if("*"===b){let b=a.symbolsByName.get(c);if(b){let a=null;for(let c of b)!c.qualifiedName.includes(">")&&Z(c.kind)&&(!a||c.endLine-c.startLine>a.endLine-a.startLine)&&(a=c);if(a)return a}}return null}(f,b.importedName,a.calleeName);return g?[{kind:"symbol",addr:{filePath:g.filePath,qualifiedName:g.qualifiedName}}]:[{kind:"method-unresolved",receiverName:a.receiverName,methodName:a.calleeName}]}let f=c.symbolsByName.get(a.calleeName);if(f&&f.length>0){let a=[];for(let c of f)c.qualifiedName!==b.qualifiedName&&Z(c.kind)&&a.push({kind:"symbol",addr:{filePath:c.filePath,qualifiedName:c.qualifiedName}});return a}let g=c.bindingsByLocalName.get(a.calleeName);if(!g)return[];let h=c.resolvedImports.get(g.specifier);if(!h)return[{kind:"external",name:g.importedName,packageSpec:g.specifier}];let i=d.get(h);if(!i)return[];let j=function(a,b){let c=a.symbolsByName.get(b);if(!c)return null;let d=null;for(let a of c)Z(a.kind)&&(!d||a.endLine-a.startLine>d.endLine-d.startLine)&&(d=a);return d}(i,g.importedName);return j?[{kind:"symbol",addr:{filePath:j.filePath,qualifiedName:j.qualifiedName}}]:[]},moduleForFile:(a,b)=>a}),q({grammarId:"go",extensions:[".go"],extractSymbols(a,b){let c=[],d=function(a){let b=[],c=-1,d=-1;for(let e=0;e<a.namedChildCount;e++){let f=a.namedChild(e);if(f){if("import_declaration"===f.type)b.push(f),c<0&&(c=f.startPosition.row+1),d=f.endPosition.row+1;else if("package_clause"===f.type)continue;else if(c>=0)break}}return c<0?null:{qualifiedName:"__imports__",name:"imports",kind:"unknown",startLine:c,endLine:d,contentHash:G(H(b.map(a=>a.text).join("\n"))),children:[]}}(a);d&&c.push(d);let{symbols:e,pendingMethods:f}=function(a){let b=[],c=[];for(let d=0;d<a.namedChildCount;d++){let e=a.namedChild(d);if(e)switch(e.type){case"function_declaration":{let a=e.childForFieldName("name");if(!a)break;b.push(_(e,a.text,"function",void 0,[],aa(e)));break}case"method_declaration":{let a=e.childForFieldName("name");if(!a)break;let d=function(a){let b=a.childForFieldName("receiver");if(!b)return null;for(let a=0;a<b.namedChildCount;a++){let c=b.namedChild(a);if(c?.type!=="parameter_declaration")continue;let d=c.childForFieldName("type");if(!d)break;return function a(b){if("type_identifier"===b.type)return b.text;if("pointer_type"===b.type){for(let c=0;c<b.namedChildCount;c++){let d=b.namedChild(c);if(d){let b=a(d);if(b)return b}}return null}if("generic_type"===b.type){let c=b.childForFieldName("type");if(c)return a(c)}return null}(d)}return null}(e),f=_(e,a.text,"method",d??void 0,[],aa(e));d?c.push({receiverType:d,symbol:f}):b.push(f);break}case"type_declaration":b.push(...function(a,b){let c=[];for(let d=0;d<a.namedChildCount;d++){let e=a.namedChild(d);if(e&&("type_spec"===e.type||"type_alias"===e.type)){let a=e.childForFieldName("name"),d=e.childForFieldName("type");if(!a)continue;let f=a.text,g=d?.type==="interface_type"?"interface":"class";c.push(_(e,f,g,b))}}return c}(e,void 0));break;case"var_declaration":case"const_declaration":b.push(...function(a,b){let c=[];for(let d=0;d<a.namedChildCount;d++){let e=a.namedChild(d);if(e&&("var_spec"===e.type||"const_spec"===e.type)){let a=e.childForFieldName("name");if(!a)continue;if("identifier_list"===a.type)for(let d=0;d<a.namedChildCount;d++){let f=a.namedChild(d);f?.type==="identifier"&&c.push(_(e,f.text,"const",b))}else"identifier"===a.type&&c.push(_(e,a.text,"const",b))}}return c}(e,void 0))}}return{symbols:b,pendingMethods:c}}(a);return c.push(...function(a,b){if(0===b.length)return a;let c=new Map;for(let b of a)("class"===b.kind||"interface"===b.kind)&&c.set(b.name,b);let d=[];for(let a of b){let b=c.get(a.receiverType);b?b.children=[...b.children,a.symbol]:d.push(a.symbol)}return[...a,...d]}(e,f)),c.push(...M(a,c)),c},extractImports:a=>(function(a){let b=[],c=[];function d(a){var d;let e,f=a.childForFieldName("path");if(!f)return;let g=(d=f.text).length>=2&&('"'===d[0]||"'"===d[0]||"`"===d[0])&&d[d.length-1]===d[0]?d.slice(1,-1):d;if(!g)return;b.push(g);let h=a.childForFieldName("name");if(h)e=h.text;else{let a=g.split("/");e=a[a.length-1]||g}c.push({specifier:g,importedName:"*",localName:e})}return!function a(b){if("import_declaration"===b.type){for(let a=0;a<b.namedChildCount;a++){let c=b.namedChild(a);if(c){if("import_spec"===c.type)d(c);else if("import_spec_list"===c.type)for(let a=0;a<c.namedChildCount;a++){let b=c.namedChild(a);b?.type==="import_spec"&&d(b)}}}return}for(let c=0;c<b.namedChildCount;c++){let d=b.namedChild(c);d&&a(d)}}(a),{specs:b,bindings:c}})(a),extractCallSites:(a,b)=>{let c;return c=[],!function a(b){if("call_expression"===b.type){let a=b.childForFieldName("function"),d=function a(b){if(!b)return null;if("identifier"===b.type)return b.text;if("selector_expression"===b.type){let a=b.childForFieldName("field");return a?.text??null}return"call_expression"===b.type?a(b.childForFieldName("function")):null}(a);if(d){let e=function(a){if(!a||"selector_expression"!==a.type)return;let b=a;for(;b;){if("identifier"===b.type)return b.text;if("selector_expression"===b.type){b=b.childForFieldName("operand");continue}break}}(a);c.push({calleeName:d,line:b.startPosition.row+1,...e?{receiverName:e}:{}})}}for(let c=0;c<b.childCount;c++){let d=b.child(c);d&&a(d)}}(a),c},async buildProjectContext(a,b){let c=await ab(a);return{cwd:a,modulePath:c,dirToGoFiles:function(a){let b=new Map;for(let c of a){if(!c.endsWith(".go"))continue;let a=f().dirname(c),d=b.get(a);d?d.push(c):b.set(a,[c])}return b}(b)}},resolveSpecifier(a,b,c,d){if(!c.modulePath)return null;if(a===c.modulePath){let a=c.dirToGoFiles.get(".");return a?.[0]??null}if(a.startsWith(c.modulePath+"/")){let b=a.slice(c.modulePath.length+1),d=c.dirToGoFiles.get(b);return d?.[0]??null}return null},resolveCall(a,b,c,d,e){let g=f().dirname(c.path),h=e.dirToGoFiles.get(g)??[c.path];if(a.receiverName){let b=c.bindingsByLocalName.get(a.receiverName);if(b){let g=c.resolvedImports.get(b.specifier);if(!g)return[{kind:"external",name:a.calleeName,packageSpec:b.specifier}];let h=f().dirname(g);for(let b of e.dirToGoFiles.get(h)??[]){let c,e=d.get(b);if(!e)continue;let f=e.symbolsByName.get(a.calleeName);if(f){for(let a of f)if(!a.qualifiedName.includes(">")&&ac(a.kind)){c=a;break}if(c)return[{kind:"symbol",addr:{filePath:c.filePath,qualifiedName:c.qualifiedName}}]}}return[{kind:"external",name:a.calleeName,packageSpec:b.specifier}]}let g=`${a.receiverName}>${a.calleeName}`;for(let a of h){let b=d.get(a);if(!b)continue;let c=b.symbolsByQname.get(g);if(c&&ac(c.kind))return[{kind:"symbol",addr:{filePath:c.filePath,qualifiedName:c.qualifiedName}}]}return[{kind:"method-unresolved",receiverName:a.receiverName,methodName:a.calleeName}]}let i=[];for(let c of h){let e=d.get(c);if(!e)continue;let f=e.symbolsByName.get(a.calleeName);if(f)for(let a of f)!(a.qualifiedName===b.qualifiedName||a.qualifiedName.includes(">"))&&ac(a.kind)&&i.push({kind:"symbol",addr:{filePath:a.filePath,qualifiedName:a.qualifiedName}})}return i},moduleForFile(a,b){let c=f().dirname(a);return b?.modulePath?"."===c?b.modulePath:`${b.modulePath}/${c}`:c}}),q({grammarId:"rust",extensions:[".rs"],extractSymbols(a,b){let c=[],d=function(a){let b=[],c=-1,d=-1;for(let e=0;e<a.namedChildCount;e++){let f=a.namedChild(e);if(f){if("use_declaration"===f.type||"extern_crate_declaration"===f.type)b.push(f),c<0&&(c=f.startPosition.row+1),d=f.endPosition.row+1;else if(c>=0)break}}return c<0?null:{qualifiedName:"__imports__",name:"imports",kind:"unknown",startLine:c,endLine:d,contentHash:G(H(b.map(a=>a.text).join("\n"))),children:[]}}(a);d&&c.push(d);let{symbols:e,pendingImpls:f}=function(a){let b=[],c=[];for(let d=0;d<a.namedChildCount;d++){let e=a.namedChild(d);if(e)switch(e.type){case"function_item":{let a=e.childForFieldName("name");if(!a)break;b.push(ad(e,a.text,"function",void 0,[],ae(e)));break}case"struct_item":case"union_item":{let a=e.childForFieldName("name");if(!a)break;b.push(ad(e,a.text,"class",void 0));break}case"enum_item":{let a=e.childForFieldName("name");if(!a)break;b.push(ad(e,a.text,"enum",void 0));break}case"trait_item":{let a=e.childForFieldName("name");if(!a)break;let c=function(a,b){let c=a.childForFieldName("body");if(!c)return[];let d=[];for(let a=0;a<c.namedChildCount;a++){let e=c.namedChild(a);if(e&&("function_item"===e.type||"function_signature_item"===e.type)){let a=e.childForFieldName("name");if(!a)continue;d.push(ad(e,a.text,"method",b,[],ae(e)))}}return d}(e,a.text);b.push(ad(e,a.text,"interface",void 0,c));break}case"impl_item":{let a=function(a){let b=a.childForFieldName("type");return b?function a(b){if("type_identifier"===b.type)return b.text;if("generic_type"===b.type){let c=b.childForFieldName("type");if(c)return a(c)}if("reference_type"===b.type)for(let c=0;c<b.namedChildCount;c++){let d=b.namedChild(c);if(d){let b=a(d);if(b)return b}}if("scoped_type_identifier"===b.type){let a=b.childForFieldName("name");if(a?.type==="type_identifier")return a.text}return null}(b):null}(e);if(!a)break;let b=function(a,b){let c=a.childForFieldName("body");if(!c)return[];let d=[];for(let a=0;a<c.namedChildCount;a++){let e=c.namedChild(a);if(e){if("function_item"===e.type){let a=e.childForFieldName("name");if(!a)continue;d.push(ad(e,a.text,"method",b,[],ae(e)))}else if("function_signature_item"===e.type){let a=e.childForFieldName("name");if(!a)continue;d.push(ad(e,a.text,"method",b,[],ae(e)))}}}return d}(e,a);b.length>0&&c.push({targetType:a,methods:b});break}case"const_item":case"static_item":{let a=e.childForFieldName("name");if(!a)break;b.push(ad(e,a.text,"const",void 0));break}case"type_item":{let a=e.childForFieldName("name");if(!a)break;b.push(ad(e,a.text,"type",void 0));break}case"mod_item":{let a=e.childForFieldName("name"),c=e.childForFieldName("body");if(!a||!c)break;b.push(ad(e,a.text,"class",void 0))}}}return{symbols:b,pendingImpls:c}}(a);return c.push(...function(a,b){if(0===b.length)return a;let c=new Map;for(let b of a)("class"===b.kind||"enum"===b.kind||"interface"===b.kind)&&c.set(b.name,b);let d=[];for(let a of b){let b=c.get(a.targetType);b?b.children=[...b.children,...a.methods]:d.push(...a.methods)}return[...a,...d]}(e,f)),c.push(...M(a,c)),c},extractImports:a=>(function(a){let b=[],c=[];function d(a){if("identifier"===a.type||"crate"===a.type||"self"===a.type||"super"===a.type)return a.text;if("scoped_identifier"===a.type){let b=a.childForFieldName("path"),c=a.childForFieldName("name"),e=b?d(b):"",f=c?.text??"";return e?`${e}::${f}`:f}return a.text}function e(a,b){return a?b?`${a}::${b}`:a:b}function f(a){let b=a.split("::");return b[b.length-1]??a}return!function a(g){if("use_declaration"===g.type)return void function(a){for(let g=0;g<a.namedChildCount;g++){let h=a.namedChild(g);h&&function a(g,h){switch(g.type){case"use_as_clause":{let a=g.childForFieldName("path"),i=g.childForFieldName("alias");if(a&&i){let g=e(h,d(a));b.push(g),c.push({specifier:g,importedName:f(g),localName:i.text})}break}case"use_list":for(let b=0;b<g.namedChildCount;b++){let c=g.namedChild(b);c&&a(c,h)}break;case"scoped_use_list":{let b=g.childForFieldName("path"),c=g.childForFieldName("list"),f=b?e(h,d(b)):h;if(c)for(let b=0;b<c.namedChildCount;b++){let d=c.namedChild(b);d&&a(d,f)}break}case"use_wildcard":{let a=g.childForFieldName("path"),f=a?e(h,d(a)):h;f&&(b.push(f),c.push({specifier:f,importedName:"*",localName:"*"}));break}case"identifier":case"self":case"super":case"crate":case"scoped_identifier":{let a=e(h,d(g));a&&(b.push(a),c.push({specifier:a,importedName:f(a),localName:f(a)}))}}}(h,"")}}(g);if("extern_crate_declaration"===g.type){let a=g.childForFieldName("name");a&&(b.push(a.text),c.push({specifier:a.text,importedName:"*",localName:a.text}));return}if("mod_item"===g.type){let a=g.childForFieldName("body"),c=g.childForFieldName("name");!a&&c&&b.push(c.text);return}for(let b=0;b<g.namedChildCount;b++){let c=g.namedChild(b);c&&a(c)}}(a),{specs:b,bindings:c}})(a),extractCallSites:(a,b)=>{let c;return c=[],!function a(b){if("call_expression"===b.type){let a=b.childForFieldName("function"),d=function(a){if(!a)return null;if("identifier"===a.type)return a.text;if("scoped_identifier"===a.type){let b=a.childForFieldName("name");return b?.text??null}if("field_expression"===a.type){let b=a.childForFieldName("field");return b?.text??null}return null}(a);if(d){let e=function(a){if(a){if("scoped_identifier"===a.type){let b=a;for(;b;){if("identifier"===b.type)return b.text;if("scoped_identifier"===b.type){b=b.childForFieldName("path");continue}break}}if("field_expression"===a.type){let b=a.childForFieldName("value");if(b?.type==="identifier")return b.text}}}(a);c.push({calleeName:d,line:b.startPosition.row+1,...e?{receiverName:e}:{}})}}else if("method_call_expression"===b.type){let a=b.childForFieldName("method"),d=b.childForFieldName("value");if(a){let e=d?.type==="identifier"?d.text:void 0;c.push({calleeName:a.text,line:b.startPosition.row+1,...e?{receiverName:e}:{}})}}for(let c=0;c<b.childCount;c++){let d=b.child(c);d&&a(d)}}(a),c},async buildProjectContext(a,b){let{modTree:c,fileToMod:d}=await af(a,b);return{cwd:a,modTree:c,fileToMod:d}},resolveSpecifier(a,b,c,d){let e=c.fileToMod.get(b);if(!e)return null;let f=function(a,b){if(a.startsWith("crate::"))return a;if("crate"===a)return"crate";if(a.startsWith("self::"))return`${b}::${a.slice(6)}`;if("self"===a)return b;if(a.startsWith("super::")){let c=b,d=a;for(;d.startsWith("super::");){let a=c.lastIndexOf("::");if(a<0)return null;c=c.slice(0,a),d=d.slice(7)}if("super"===d){let a=c.lastIndexOf("::");return a<0?null:c.slice(0,a)}return d?`${c}::${d}`:c}return null}(a,e);if(!f)return null;if(c.modTree.has(f))return c.modTree.get(f);let g=f.split("::");for(;g.length>1;){g.pop();let a=g.join("::"),b=c.modTree.get(a);if(b)return b}return null},resolveCall(a,b,c,d,e){let f;if(a.receiverName){let b=c.bindingsByLocalName.get(a.receiverName);if(b){let e=c.resolvedImports.get(b.specifier);if(!e)return[{kind:"external",name:a.calleeName,packageSpec:b.specifier}];let f=d.get(e);if(!f)return[];let g=f.symbolsByName.get(a.calleeName);if(g){for(let a of g)if(!a.qualifiedName.includes(">")&&ag(a.kind))return[{kind:"symbol",addr:{filePath:a.filePath,qualifiedName:a.qualifiedName}}]}let h=`${b.importedName}>${a.calleeName}`,i=f.symbolsByQname.get(h);return i&&ag(i.kind)?[{kind:"symbol",addr:{filePath:i.filePath,qualifiedName:i.qualifiedName}}]:[{kind:"method-unresolved",receiverName:a.receiverName,methodName:a.calleeName}]}let e=`${a.receiverName}>${a.calleeName}`,f=c.symbolsByQname.get(e);if(f)return[{kind:"symbol",addr:{filePath:f.filePath,qualifiedName:f.qualifiedName}}];let g=[],h=c.symbolsByName.get(a.calleeName);if(h)for(let a of h)"method"===a.kind&&g.push({kind:"symbol",addr:{filePath:a.filePath,qualifiedName:a.qualifiedName}});return g.length>0?g:[{kind:"method-unresolved",receiverName:a.receiverName,methodName:a.calleeName}]}let g=[],h=c.symbolsByName.get(a.calleeName);if(h)for(let a of h)!(a.qualifiedName===b.qualifiedName||a.qualifiedName.includes(">"))&&ag(a.kind)&&g.push({kind:"symbol",addr:{filePath:a.filePath,qualifiedName:a.qualifiedName}});if(g.length>0)return g;let i=c.bindingsByLocalName.get(a.calleeName);if(!i)return[];let j=c.resolvedImports.get(i.specifier);if(!j)return[{kind:"external",name:i.importedName,packageSpec:i.specifier}];let k=d.get(j);if(!k)return[];let l=k.symbolsByName.get(i.importedName);if(l){for(let a of l)if(!a.qualifiedName.includes(">")&&ag(a.kind)){f=a;break}}return f?[{kind:"symbol",addr:{filePath:f.filePath,qualifiedName:f.qualifiedName}}]:[]},moduleForFile:(a,b)=>b?.fileToMod.get(a)??f().dirname(a)});let aj=new Set(["function","class","method"]);function ak(a){return aj.has(a.kind)}async function al(a){let b=Date.now(),c=await v(a);c||(c=[],await w(a,a,c));let d=c.length>8e3;d&&(c=c.slice(0,8e3));let e=new Set(c),g=await E(a),h=await A(a,e),i=new Map;for(let b of m){let c=r(b);i.set(b,await c.buildProjectContext(a,e))}let j=(await ah(c,50,b=>ai(f().join(a,b),b))).filter(a=>null!==a),k=new Map;for(let a of j){let b=r(a.language),c=i.get(a.language),d=new Map,f=new Set;for(let g of a.importSpecifiers){if(d.has(g))continue;let h=b.resolveSpecifier(g,a.path,c,e);h&&h!==a.path&&(d.set(g,h),f.add(h))}let g=new Map,h=new Map;for(let b of a.flatSymbols){h.set(b.qualifiedName,b);let a=g.get(b.name);a?a.push(b):g.set(b.name,[b])}let j=new Map,l=new Map;for(let b of a.importBindings)b.isReexport?l.set(b.localName,b):j.set(b.localName,b);k.set(a.path,{path:a.path,language:a.language,symbolsTree:a.symbolsTree,flatSymbols:a.flatSymbols,importedFiles:f,importedBy:new Set,importBindings:a.importBindings,resolvedImports:d,intraCalls:[],outgoingCalls:[],incomingCalls:[],externalCalls:[],methodCalls:[],symbolsByName:g,symbolsByQname:h,bindingsByLocalName:j,reexportsByLocalName:l})}for(let a of k.values())for(let b of a.importedFiles){let c=k.get(b);c&&c.importedBy.add(a.path)}for(let a of j){let b=k.get(a.path),c=r(a.language),d=i.get(a.language),e=new Map,f=new Map,g=new Map,h=new Map;for(let i of a.rawCalls){let a=function(a,b){let c=null;for(let d of a)d.startLine<=b&&b<=d.endLine&&(!c||d.endLine-d.startLine<c.endLine-c.startLine)&&(c=d);return c}(b.flatSymbols,i.line);if(a){for(let j of c.resolveCall(i,a,b,k,d))if("symbol"===j.kind)if(j.addr.filePath===b.path){let c=`${a.qualifiedName}${j.addr.qualifiedName}`,d=e.get(c);if(d)d.lines.push(i.line);else{let d={from:a.qualifiedName,to:j.addr.qualifiedName,lines:[i.line]};e.set(c,d),b.intraCalls.push(d)}}else{let c=`${a.qualifiedName}${j.addr.filePath}${j.addr.qualifiedName}`,d=f.get(c);if(d)d.lines.push(i.line);else{let d={from:a.qualifiedName,to:{filePath:j.addr.filePath,qualifiedName:j.addr.qualifiedName},lines:[i.line]};f.set(c,d),b.outgoingCalls.push(d)}}else if("external"===j.kind){let c=`${a.qualifiedName}${j.packageSpec}${j.name}`,d=g.get(c);if(d)d.lines.push(i.line);else{let d={from:a.qualifiedName,packageSpec:j.packageSpec,importedName:j.name,lines:[i.line]};g.set(c,d),b.externalCalls.push(d)}}else if("method-unresolved"===j.kind){let c=b.bindingsByLocalName.get(j.receiverName),d=c?b.resolvedImports.get(c.specifier)??"":"",e=`${a.qualifiedName}${j.receiverName}${j.methodName}`,f=h.get(e);if(f)f.lines.push(i.line);else{let c={from:a.qualifiedName,receiverName:j.receiverName,methodName:j.methodName,receiverFilePath:d,lines:[i.line]};h.set(e,c),b.methodCalls.push(c)}}}}for(let a of b.intraCalls)a.lines.sort((a,b)=>a-b);for(let a of b.outgoingCalls)a.lines.sort((a,b)=>a-b);for(let a of b.externalCalls)a.lines.sort((a,b)=>a-b);for(let a of b.methodCalls)a.lines.sort((a,b)=>a-b)}for(let a of k.values())for(let b of a.outgoingCalls){let c=k.get(b.to.filePath);c&&c.incomingCalls.push({from:{filePath:a.path,qualifiedName:b.from},to:b.to.qualifiedName,lines:b.lines})}return{cwd:a,files:k,truncated:d,fileCountCap:d?8e3:void 0,tsconfigs:g,workspaces:h,generatedAt:Date.now(),buildMs:Date.now()-b}}let am=new Map,an=new Map;async function ao(a,b={}){b.forceRefresh&&am.delete(a);let c=am.get(a);if(c)return c;let d=an.get(a);if(d)return d;let e=al(a).then(b=>(am.set(a,b),an.delete(a),b));return an.set(a,e),e}function ap(a){if(!a){am.clear(),an.clear();return}am.delete(a),an.delete(a)}function aq(a){return{filePath:a.filePath,qualifiedName:a.qualifiedName,name:a.name,kind:a.kind,startLine:a.startLine,endLine:a.endLine,params:a.params}}function ar(a){let b=a.indexOf(">");return b>=0?a.slice(0,b):a}function as(a){if(a.length<2)return a;let b=[a[0]];for(let c=1;c<a.length;c++)a[c]!==a[c-1]&&b.push(a[c]);return b}function at(a,b){let c=a.files.get(b);if(!c)return null;let d=c.flatSymbols.filter(a=>!a.qualifiedName.includes(">")).map(aq).sort((a,b)=>a.startLine-b.startLine),e=new Set(d.map(a=>a.qualifiedName)),f=new Map,g=[];for(let a of c.intraCalls){let b=ar(a.from),c=ar(a.to);if(b===c||!e.has(b)||!e.has(c))continue;let d=`${b}|${c}`,h=f.get(d);if(h)for(let b of a.lines)h.lines.push(b);else{let e={from:b,to:c,lines:a.lines.slice()};f.set(d,e),g.push(e)}}for(let a of g)a.lines.sort((a,b)=>a-b),a.lines=as(a.lines);let h=[],i=new Map;for(let b of c.outgoingCalls){let d=ar(b.from);if(!e.has(d)||b.to.filePath===c.path)continue;let f=a.files.get(b.to.filePath);if(!f)continue;let g=f.symbolsByQname.get(b.to.qualifiedName);if(!g||!ak(g))continue;let j=`${g.filePath}|${g.qualifiedName}|${d}`,k=i.get(j);if(k)for(let a of b.lines)k.lines.push(a);else{let a={external:aq(g),focalQname:d,lines:b.lines.slice()};i.set(j,a),h.push(a)}}let j=[],k=new Map;for(let b of c.incomingCalls){let d=ar(b.to);if(!e.has(d)||b.from.filePath===c.path)continue;let f=a.files.get(b.from.filePath);if(!f)continue;let g=f.symbolsByQname.get(b.from.qualifiedName);if(!g||!ak(g))continue;let h=`${g.filePath}|${g.qualifiedName}|${d}`,i=k.get(h);if(i)for(let a of b.lines)i.lines.push(a);else{let a={external:aq(g),focalQname:d,lines:b.lines.slice()};k.set(h,a),j.push(a)}}for(let a of h)a.lines.sort((a,b)=>a-b),a.lines=as(a.lines);for(let a of j)a.lines.sort((a,b)=>a-b),a.lines=as(a.lines);let l=[],m=new Map;for(let a of c.externalCalls){let b=ar(a.from);if(!e.has(b))continue;let c=`${b}|${a.packageSpec}|${a.importedName}`,d=m.get(c);if(d)for(let b of a.lines)d.lines.push(b);else{let d={external:{name:a.importedName,packageSpec:a.packageSpec},focalQname:b,lines:a.lines.slice()};m.set(c,d),l.push(d)}}for(let a of l)a.lines.sort((a,b)=>a-b),a.lines=as(a.lines);let n=[],o=new Map;for(let a of c.methodCalls){let b=ar(a.from);if(!e.has(b))continue;let c=`${b}|${a.receiverName}|${a.methodName}`,d=o.get(c);if(d)for(let b of a.lines)d.lines.push(b);else{let d={focalQname:b,receiverName:a.receiverName,methodName:a.methodName,receiverFilePath:a.receiverFilePath,lines:a.lines.slice()};o.set(c,d),n.push(d)}}for(let a of n)a.lines.sort((a,b)=>a-b),a.lines=as(a.lines);let p=(a,b)=>a.external.filePath.localeCompare(b.external.filePath)||a.external.qualifiedName.localeCompare(b.external.qualifiedName);return j.sort(p),h.sort(p),l.sort((a,b)=>a.external.packageSpec.localeCompare(b.external.packageSpec)||a.external.name.localeCompare(b.external.name)),n.sort((a,b)=>a.receiverName.localeCompare(b.receiverName)||a.methodName.localeCompare(b.methodName)),{filePath:c.path,language:c.language,fileCount:a.files.size,functions:d,intraCalls:g,externalCalls:l,methodCalls:n,upstreamCalls:j,downstreamCalls:h}}function au(a,b){let c=a.files.get(b);return c?{filePath:c.path,language:c.language,symbols:c.symbolsTree}:null}function av(a,b,c){let d=b.trim().toLowerCase();if(!d)return{files:[],symbols:[]};let e=[];for(let b of a.files.values()){if(e.length>=c)break;b.path.toLowerCase().includes(d)&&e.push({type:"file",label:function(a){let b=a.lastIndexOf("/");return b>=0?a.slice(b+1):a}(b.path),hint:b.path,target:{kind:"file",filePath:b.path}})}let f=[];for(let b of a.files.values()){let a=!1;if(!function a(b,c){for(let d of b)if(c(d)||a(d.children,c))return!0;return!1}(b.symbolsTree,e=>f.length>=c?(a=!0,!0):(e.name.toLowerCase().includes(d)&&f.push({type:"symbol",label:e.name,hint:`${e.kind} \xb7 ${b.path}`,target:{kind:"symbol",filePath:b.path,line:e.startLine,symbolName:e.name,symbolKind:e.kind,qualifiedName:e.qualifiedName}}),!1)),a)break}return{files:e,symbols:f}}},78335:()=>{},93764:(a,b,c)=>{"use strict";c.d(b,{L8:()=>p,No:()=>h,Pe:()=>o,VA:()=>q,hC:()=>m,hH:()=>l,hn:()=>s,iF:()=>r,lU:()=>t,nw:()=>n,pZ:()=>g});var d=c(79748),e=c(33873),f=c.n(e);let g=0xa00000,h=0x3200000,i=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".ico",".bmp",".avif"]),j=new Set([".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".zip",".tar",".gz",".rar",".7z",".exe",".dll",".so",".dylib",".mp3",".mp4",".avi",".mov",".mkv",".wav",".flac",".ttf",".otf",".woff",".woff2",".eot",".db",".sqlite",".sqlite3",".pyc",".class",".o",".a"]),k={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".avif":"image/avif"};function l(a){return k[a.toLowerCase()]||"application/octet-stream"}function m(a,b){if("string"!=typeof b||0===b.length)return null;let c=f().resolve(a),d=f().resolve(c,b);return d===c||d.startsWith(c+f().sep)?d:null}async function n(a){let b;if("string"!=typeof a||0===a.length)return{ok:!1,reason:"Missing cwd parameter"};if(!f().isAbsolute(a))return{ok:!1,reason:"cwd must be an absolute path"};let c=f().resolve(a);try{b=await (0,d.stat)(c)}catch{return{ok:!1,reason:"cwd does not exist"}}return b.isDirectory()?{ok:!0,abs:c}:{ok:!1,reason:"cwd is not a directory"}}function o(a,b){return`"${a.toString(36)}-${Math.floor(b).toString(36)}"`}function p(a,b){let c=a.startsWith(".")?a.toLowerCase():f().extname(a).toLowerCase();return i.has(c)?b>h?"too-large":"image":j.has(c)?"binary":b>g?"too-large":"text"}function q(a){let b=0,c=Math.min(a.length,1e3);for(let d=0;d<c;d++){let c=a.charCodeAt(d);if(0===c)return!0;c<32&&9!==c&&10!==c&&13!==c&&b++}return c>0&&b/c>.1}async function r(a){let b,c=!1;try{(await (0,d.lstat)(a)).isSymbolicLink()&&(c=!0,b=await (0,d.readlink)(a))}catch{}let e=await (0,d.stat)(a);return{size:e.size,mtimeMs:e.mtimeMs,isDirectory:e.isDirectory(),isSymlink:c,symlinkTarget:b}}function s(a,b){return{ETag:a,"Last-Modified":new Date(b).toUTCString(),"Cache-Control":"no-cache, must-revalidate"}}function t(a,b){return!!a&&a.split(",").map(a=>a.trim().replace(/^W\//,"")).includes(b)}},96487:()=>{}};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=4796,exports.ids=[4796],exports.modules={48111:(a,b,c)=>{a.exports=c.p+"static/media/web-tree-sitter.f7f7244f.wasm"},94796:(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{TM:()=>Language,iX:()=>Parser});var C,TRANSFER_BUFFER,LANGUAGE_VERSION,MIN_COMPATIBLE_VERSION,__defProp=Object.defineProperty,__name=(a,b)=>__defProp(a,"name",{value:b,configurable:!0}),Edit=class{static{__name(this,"Edit")}startPosition;oldEndPosition;newEndPosition;startIndex;oldEndIndex;newEndIndex;constructor({startIndex:a,oldEndIndex:b,newEndIndex:c,startPosition:d,oldEndPosition:e,newEndPosition:f}){this.startIndex=a>>>0,this.oldEndIndex=b>>>0,this.newEndIndex=c>>>0,this.startPosition=d,this.oldEndPosition=e,this.newEndPosition=f}editPoint(a,b){let c=b,d={...a};if(b>=this.oldEndIndex){c=this.newEndIndex+(b-this.oldEndIndex);let e=a.row;d.row=this.newEndPosition.row+(a.row-this.oldEndPosition.row),d.column=e===this.oldEndPosition.row?this.newEndPosition.column+(a.column-this.oldEndPosition.column):a.column}else b>this.startIndex&&(c=this.newEndIndex,d.row=this.newEndPosition.row,d.column=this.newEndPosition.column);return{point:d,index:c}}editRange(a){let b={startIndex:a.startIndex,startPosition:{...a.startPosition},endIndex:a.endIndex,endPosition:{...a.endPosition}};return a.endIndex>=this.oldEndIndex?a.endIndex!==Number.MAX_SAFE_INTEGER&&(b.endIndex=this.newEndIndex+(a.endIndex-this.oldEndIndex),b.endPosition={row:this.newEndPosition.row+(a.endPosition.row-this.oldEndPosition.row),column:a.endPosition.row===this.oldEndPosition.row?this.newEndPosition.column+(a.endPosition.column-this.oldEndPosition.column):a.endPosition.column},b.endIndex<this.newEndIndex&&(b.endIndex=Number.MAX_SAFE_INTEGER,b.endPosition={row:Number.MAX_SAFE_INTEGER,column:Number.MAX_SAFE_INTEGER})):a.endIndex>this.startIndex&&(b.endIndex=this.startIndex,b.endPosition={...this.startPosition}),a.startIndex>=this.oldEndIndex?(b.startIndex=this.newEndIndex+(a.startIndex-this.oldEndIndex),b.startPosition={row:this.newEndPosition.row+(a.startPosition.row-this.oldEndPosition.row),column:a.startPosition.row===this.oldEndPosition.row?this.newEndPosition.column+(a.startPosition.column-this.oldEndPosition.column):a.startPosition.column},b.startIndex<this.newEndIndex&&(b.startIndex=Number.MAX_SAFE_INTEGER,b.startPosition={row:Number.MAX_SAFE_INTEGER,column:Number.MAX_SAFE_INTEGER})):a.startIndex>this.startIndex&&(b.startIndex=this.startIndex,b.startPosition={...this.startPosition}),b}},SIZE_OF_SHORT=2,SIZE_OF_INT=4,SIZE_OF_CURSOR=4*SIZE_OF_INT,SIZE_OF_NODE=5*SIZE_OF_INT,SIZE_OF_POINT=2*SIZE_OF_INT,SIZE_OF_RANGE=2*SIZE_OF_INT+2*SIZE_OF_POINT,ZERO_POINT={row:0,column:0},INTERNAL=Symbol("INTERNAL");function assertInternal(a){if(a!==INTERNAL)throw Error("Illegal constructor")}function isPoint(a){return!!a&&"number"==typeof a.row&&"number"==typeof a.column}function setModule(a){C=a}__name(assertInternal,"assertInternal"),__name(isPoint,"isPoint"),__name(setModule,"setModule");var LookaheadIterator=class{static{__name(this,"LookaheadIterator")}0=0;language;constructor(a,b,c){assertInternal(a),this[0]=b,this.language=c}get currentTypeId(){return C._ts_lookahead_iterator_current_symbol(this[0])}get currentType(){return this.language.types[this.currentTypeId]||"ERROR"}delete(){C._ts_lookahead_iterator_delete(this[0]),this[0]=0}reset(a,b){return!!C._ts_lookahead_iterator_reset(this[0],a[0],b)&&(this.language=a,!0)}resetState(a){return!!C._ts_lookahead_iterator_reset_state(this[0],a)}[Symbol.iterator](){return{next:__name(()=>C._ts_lookahead_iterator_next(this[0])?{done:!1,value:this.currentType}:{done:!0,value:""},"next")}}};function getText(a,b,c,d){let e=c-b,f=a.textCallback(b,d);if(f){for(b+=f.length;b<c;){let c=a.textCallback(b,d);if(c&&c.length>0)b+=c.length,f+=c;else break}b>c&&(f=f.slice(0,e))}return f??""}__name(getText,"getText");var Tree=class _Tree{static{__name(this,"Tree")}0=0;textCallback;language;constructor(a,b,c,d){assertInternal(a),this[0]=b,this.language=c,this.textCallback=d}copy(){return new _Tree(INTERNAL,C._ts_tree_copy(this[0]),this.language,this.textCallback)}delete(){C._ts_tree_delete(this[0]),this[0]=0}get rootNode(){return C._ts_tree_root_node_wasm(this[0]),unmarshalNode(this)}rootNodeWithOffset(a,b){let c=TRANSFER_BUFFER+SIZE_OF_NODE;return C.setValue(c,a,"i32"),marshalPoint(c+SIZE_OF_INT,b),C._ts_tree_root_node_with_offset_wasm(this[0]),unmarshalNode(this)}edit(a){marshalEdit(a),C._ts_tree_edit_wasm(this[0])}walk(){return this.rootNode.walk()}getChangedRanges(a){if(!(a instanceof _Tree))throw TypeError("Argument must be a Tree");C._ts_tree_get_changed_ranges_wasm(this[0],a[0]);let b=C.getValue(TRANSFER_BUFFER,"i32"),c=C.getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),d=Array(b);if(b>0){let a=c;for(let c=0;c<b;c++)d[c]=unmarshalRange(a),a+=SIZE_OF_RANGE;C._free(c)}return d}getIncludedRanges(){C._ts_tree_included_ranges_wasm(this[0]);let a=C.getValue(TRANSFER_BUFFER,"i32"),b=C.getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),c=Array(a);if(a>0){let d=b;for(let b=0;b<a;b++)c[b]=unmarshalRange(d),d+=SIZE_OF_RANGE;C._free(b)}return c}},TreeCursor=class _TreeCursor{static{__name(this,"TreeCursor")}0=0;1=0;2=0;3=0;tree;constructor(a,b){assertInternal(a),this.tree=b,unmarshalTreeCursor(this)}copy(){let a=new _TreeCursor(INTERNAL,this.tree);return C._ts_tree_cursor_copy_wasm(this.tree[0]),unmarshalTreeCursor(a),a}delete(){marshalTreeCursor(this),C._ts_tree_cursor_delete_wasm(this.tree[0]),this[0]=this[1]=this[2]=0}get currentNode(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_wasm(this.tree[0]),unmarshalNode(this.tree)}get currentFieldId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_field_id_wasm(this.tree[0])}get currentFieldName(){return this.tree.language.fields[this.currentFieldId]}get currentDepth(){return marshalTreeCursor(this),C._ts_tree_cursor_current_depth_wasm(this.tree[0])}get currentDescendantIndex(){return marshalTreeCursor(this),C._ts_tree_cursor_current_descendant_index_wasm(this.tree[0])}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeStateId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_state_id_wasm(this.tree[0])}get nodeId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return marshalTreeCursor(this),1===C._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])}get nodeIsMissing(){return marshalTreeCursor(this),1===C._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])}get nodeText(){marshalTreeCursor(this);let a=C._ts_tree_cursor_start_index_wasm(this.tree[0]),b=C._ts_tree_cursor_end_index_wasm(this.tree[0]);C._ts_tree_cursor_start_position_wasm(this.tree[0]);let c=unmarshalPoint(TRANSFER_BUFFER);return getText(this.tree,a,b,c)}get startPosition(){return marshalTreeCursor(this),C._ts_tree_cursor_start_position_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get endPosition(){return marshalTreeCursor(this),C._ts_tree_cursor_end_position_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get startIndex(){return marshalTreeCursor(this),C._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return marshalTreeCursor(this),C._ts_tree_cursor_end_index_wasm(this.tree[0])}gotoFirstChild(){marshalTreeCursor(this);let a=C._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return unmarshalTreeCursor(this),1===a}gotoLastChild(){marshalTreeCursor(this);let a=C._ts_tree_cursor_goto_last_child_wasm(this.tree[0]);return unmarshalTreeCursor(this),1===a}gotoParent(){marshalTreeCursor(this);let a=C._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return unmarshalTreeCursor(this),1===a}gotoNextSibling(){marshalTreeCursor(this);let a=C._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return unmarshalTreeCursor(this),1===a}gotoPreviousSibling(){marshalTreeCursor(this);let a=C._ts_tree_cursor_goto_previous_sibling_wasm(this.tree[0]);return unmarshalTreeCursor(this),1===a}gotoDescendant(a){marshalTreeCursor(this),C._ts_tree_cursor_goto_descendant_wasm(this.tree[0],a),unmarshalTreeCursor(this)}gotoFirstChildForIndex(a){marshalTreeCursor(this),C.setValue(TRANSFER_BUFFER+SIZE_OF_CURSOR,a,"i32");let b=C._ts_tree_cursor_goto_first_child_for_index_wasm(this.tree[0]);return unmarshalTreeCursor(this),1===b}gotoFirstChildForPosition(a){marshalTreeCursor(this),marshalPoint(TRANSFER_BUFFER+SIZE_OF_CURSOR,a);let b=C._ts_tree_cursor_goto_first_child_for_position_wasm(this.tree[0]);return unmarshalTreeCursor(this),1===b}reset(a){marshalNode(a),marshalTreeCursor(this,TRANSFER_BUFFER+SIZE_OF_NODE),C._ts_tree_cursor_reset_wasm(this.tree[0]),unmarshalTreeCursor(this)}resetTo(a){marshalTreeCursor(this,TRANSFER_BUFFER),marshalTreeCursor(a,TRANSFER_BUFFER+SIZE_OF_CURSOR),C._ts_tree_cursor_reset_to_wasm(this.tree[0],a.tree[0]),unmarshalTreeCursor(this)}},Node=class{static{__name(this,"Node")}0=0;_children;_namedChildren;constructor(a,{id:b,tree:c,startIndex:d,startPosition:e,other:f}){assertInternal(a),this[0]=f,this.id=b,this.tree=c,this.startIndex=d,this.startPosition=e}id;startIndex;startPosition;tree;get typeId(){return marshalNode(this),C._ts_node_symbol_wasm(this.tree[0])}get grammarId(){return marshalNode(this),C._ts_node_grammar_symbol_wasm(this.tree[0])}get type(){return this.tree.language.types[this.typeId]||"ERROR"}get grammarType(){return this.tree.language.types[this.grammarId]||"ERROR"}get isNamed(){return marshalNode(this),1===C._ts_node_is_named_wasm(this.tree[0])}get isExtra(){return marshalNode(this),1===C._ts_node_is_extra_wasm(this.tree[0])}get isError(){return marshalNode(this),1===C._ts_node_is_error_wasm(this.tree[0])}get isMissing(){return marshalNode(this),1===C._ts_node_is_missing_wasm(this.tree[0])}get hasChanges(){return marshalNode(this),1===C._ts_node_has_changes_wasm(this.tree[0])}get hasError(){return marshalNode(this),1===C._ts_node_has_error_wasm(this.tree[0])}get endIndex(){return marshalNode(this),C._ts_node_end_index_wasm(this.tree[0])}get endPosition(){return marshalNode(this),C._ts_node_end_point_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get text(){return getText(this.tree,this.startIndex,this.endIndex,this.startPosition)}get parseState(){return marshalNode(this),C._ts_node_parse_state_wasm(this.tree[0])}get nextParseState(){return marshalNode(this),C._ts_node_next_parse_state_wasm(this.tree[0])}equals(a){return this.tree===a.tree&&this.id===a.id}child(a){return marshalNode(this),C._ts_node_child_wasm(this.tree[0],a),unmarshalNode(this.tree)}namedChild(a){return marshalNode(this),C._ts_node_named_child_wasm(this.tree[0],a),unmarshalNode(this.tree)}childForFieldId(a){return marshalNode(this),C._ts_node_child_by_field_id_wasm(this.tree[0],a),unmarshalNode(this.tree)}childForFieldName(a){let b=this.tree.language.fields.indexOf(a);return -1!==b?this.childForFieldId(b):null}fieldNameForChild(a){marshalNode(this);let b=C._ts_node_field_name_for_child_wasm(this.tree[0],a);return b?C.AsciiToString(b):null}fieldNameForNamedChild(a){marshalNode(this);let b=C._ts_node_field_name_for_named_child_wasm(this.tree[0],a);return b?C.AsciiToString(b):null}childrenForFieldName(a){let b=this.tree.language.fields.indexOf(a);return -1!==b&&0!==b?this.childrenForFieldId(b):[]}childrenForFieldId(a){marshalNode(this),C._ts_node_children_by_field_id_wasm(this.tree[0],a);let b=C.getValue(TRANSFER_BUFFER,"i32"),c=C.getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),d=Array(b);if(b>0){let a=c;for(let c=0;c<b;c++)d[c]=unmarshalNode(this.tree,a),a+=SIZE_OF_NODE;C._free(c)}return d}firstChildForIndex(a){marshalNode(this);let b=TRANSFER_BUFFER+SIZE_OF_NODE;return C.setValue(b,a,"i32"),C._ts_node_first_child_for_byte_wasm(this.tree[0]),unmarshalNode(this.tree)}firstNamedChildForIndex(a){marshalNode(this);let b=TRANSFER_BUFFER+SIZE_OF_NODE;return C.setValue(b,a,"i32"),C._ts_node_first_named_child_for_byte_wasm(this.tree[0]),unmarshalNode(this.tree)}get childCount(){return marshalNode(this),C._ts_node_child_count_wasm(this.tree[0])}get namedChildCount(){return marshalNode(this),C._ts_node_named_child_count_wasm(this.tree[0])}get firstChild(){return this.child(0)}get firstNamedChild(){return this.namedChild(0)}get lastChild(){return this.child(this.childCount-1)}get lastNamedChild(){return this.namedChild(this.namedChildCount-1)}get children(){if(!this._children){marshalNode(this),C._ts_node_children_wasm(this.tree[0]);let a=C.getValue(TRANSFER_BUFFER,"i32"),b=C.getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32");if(this._children=Array(a),a>0){let c=b;for(let b=0;b<a;b++)this._children[b]=unmarshalNode(this.tree,c),c+=SIZE_OF_NODE;C._free(b)}}return this._children}get namedChildren(){if(!this._namedChildren){marshalNode(this),C._ts_node_named_children_wasm(this.tree[0]);let a=C.getValue(TRANSFER_BUFFER,"i32"),b=C.getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32");if(this._namedChildren=Array(a),a>0){let c=b;for(let b=0;b<a;b++)this._namedChildren[b]=unmarshalNode(this.tree,c),c+=SIZE_OF_NODE;C._free(b)}}return this._namedChildren}descendantsOfType(a,b=ZERO_POINT,c=ZERO_POINT){Array.isArray(a)||(a=[a]);let d=[],e=this.tree.language.types;for(let b of a)"ERROR"==b&&d.push(65535);for(let b=0,c=e.length;b<c;b++)a.includes(e[b])&&d.push(b);let f=C._malloc(SIZE_OF_INT*d.length);for(let a=0,b=d.length;a<b;a++)C.setValue(f+a*SIZE_OF_INT,d[a],"i32");marshalNode(this),C._ts_node_descendants_of_type_wasm(this.tree[0],f,d.length,b.row,b.column,c.row,c.column);let g=C.getValue(TRANSFER_BUFFER,"i32"),h=C.getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),i=Array(g);if(g>0){let a=h;for(let b=0;b<g;b++)i[b]=unmarshalNode(this.tree,a),a+=SIZE_OF_NODE}return C._free(h),C._free(f),i}get nextSibling(){return marshalNode(this),C._ts_node_next_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get previousSibling(){return marshalNode(this),C._ts_node_prev_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get nextNamedSibling(){return marshalNode(this),C._ts_node_next_named_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get previousNamedSibling(){return marshalNode(this),C._ts_node_prev_named_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get descendantCount(){return marshalNode(this),C._ts_node_descendant_count_wasm(this.tree[0])}get parent(){return marshalNode(this),C._ts_node_parent_wasm(this.tree[0]),unmarshalNode(this.tree)}childWithDescendant(a){return marshalNode(this),marshalNode(a,1),C._ts_node_child_with_descendant_wasm(this.tree[0]),unmarshalNode(this.tree)}descendantForIndex(a,b=a){if("number"!=typeof a||"number"!=typeof b)throw Error("Arguments must be numbers");marshalNode(this);let c=TRANSFER_BUFFER+SIZE_OF_NODE;return C.setValue(c,a,"i32"),C.setValue(c+SIZE_OF_INT,b,"i32"),C._ts_node_descendant_for_index_wasm(this.tree[0]),unmarshalNode(this.tree)}namedDescendantForIndex(a,b=a){if("number"!=typeof a||"number"!=typeof b)throw Error("Arguments must be numbers");marshalNode(this);let c=TRANSFER_BUFFER+SIZE_OF_NODE;return C.setValue(c,a,"i32"),C.setValue(c+SIZE_OF_INT,b,"i32"),C._ts_node_named_descendant_for_index_wasm(this.tree[0]),unmarshalNode(this.tree)}descendantForPosition(a,b=a){if(!isPoint(a)||!isPoint(b))throw Error("Arguments must be {row, column} objects");marshalNode(this);let c=TRANSFER_BUFFER+SIZE_OF_NODE;return marshalPoint(c,a),marshalPoint(c+SIZE_OF_POINT,b),C._ts_node_descendant_for_position_wasm(this.tree[0]),unmarshalNode(this.tree)}namedDescendantForPosition(a,b=a){if(!isPoint(a)||!isPoint(b))throw Error("Arguments must be {row, column} objects");marshalNode(this);let c=TRANSFER_BUFFER+SIZE_OF_NODE;return marshalPoint(c,a),marshalPoint(c+SIZE_OF_POINT,b),C._ts_node_named_descendant_for_position_wasm(this.tree[0]),unmarshalNode(this.tree)}walk(){return marshalNode(this),C._ts_tree_cursor_new_wasm(this.tree[0]),new TreeCursor(INTERNAL,this.tree)}edit(a){if(this.startIndex>=a.oldEndIndex){let b,c;this.startIndex=a.newEndIndex+(this.startIndex-a.oldEndIndex),this.startPosition.row>a.oldEndPosition.row?(b=this.startPosition.row-a.oldEndPosition.row,c=this.startPosition.column):(b=0,c=this.startPosition.column,this.startPosition.column>=a.oldEndPosition.column&&(c=this.startPosition.column-a.oldEndPosition.column)),b>0?(this.startPosition.row+=b,this.startPosition.column=c):this.startPosition.column+=c}else this.startIndex>a.startIndex&&(this.startIndex=a.newEndIndex,this.startPosition.row=a.newEndPosition.row,this.startPosition.column=a.newEndPosition.column)}toString(){marshalNode(this);let a=C._ts_node_to_string_wasm(this.tree[0]),b=C.AsciiToString(a);return C._free(a),b}};function unmarshalCaptures(a,b,c,d,e){for(let f=0,g=e.length;f<g;f++){let g=C.getValue(c,"i32"),h=unmarshalNode(b,c+=SIZE_OF_INT);c+=SIZE_OF_NODE,e[f]={patternIndex:d,name:a.captureNames[g],node:h}}return c}function marshalNode(a,b=0){let c=TRANSFER_BUFFER+b*SIZE_OF_NODE;C.setValue(c,a.id,"i32"),c+=SIZE_OF_INT,C.setValue(c,a.startIndex,"i32"),c+=SIZE_OF_INT,C.setValue(c,a.startPosition.row,"i32"),c+=SIZE_OF_INT,C.setValue(c,a.startPosition.column,"i32"),c+=SIZE_OF_INT,C.setValue(c,a[0],"i32")}function unmarshalNode(a,b=TRANSFER_BUFFER){let c=C.getValue(b,"i32");if(b+=SIZE_OF_INT,0===c)return null;let d=C.getValue(b,"i32");b+=SIZE_OF_INT;let e=C.getValue(b,"i32");b+=SIZE_OF_INT;let f=C.getValue(b,"i32");return b+=SIZE_OF_INT,new Node(INTERNAL,{id:c,tree:a,startIndex:d,startPosition:{row:e,column:f},other:C.getValue(b,"i32")})}function marshalTreeCursor(a,b=TRANSFER_BUFFER){C.setValue(b+0*SIZE_OF_INT,a[0],"i32"),C.setValue(b+ +SIZE_OF_INT,a[1],"i32"),C.setValue(b+2*SIZE_OF_INT,a[2],"i32"),C.setValue(b+3*SIZE_OF_INT,a[3],"i32")}function unmarshalTreeCursor(a){a[0]=C.getValue(TRANSFER_BUFFER+0*SIZE_OF_INT,"i32"),a[1]=C.getValue(TRANSFER_BUFFER+ +SIZE_OF_INT,"i32"),a[2]=C.getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),a[3]=C.getValue(TRANSFER_BUFFER+3*SIZE_OF_INT,"i32")}function marshalPoint(a,b){C.setValue(a,b.row,"i32"),C.setValue(a+SIZE_OF_INT,b.column,"i32")}function unmarshalPoint(a){return{row:C.getValue(a,"i32")>>>0,column:C.getValue(a+SIZE_OF_INT,"i32")>>>0}}function marshalRange(a,b){marshalPoint(a,b.startPosition),marshalPoint(a+=SIZE_OF_POINT,b.endPosition),a+=SIZE_OF_POINT,C.setValue(a,b.startIndex,"i32"),a+=SIZE_OF_INT,C.setValue(a,b.endIndex,"i32")}function unmarshalRange(a){let b={};return b.startPosition=unmarshalPoint(a),b.endPosition=unmarshalPoint(a+=SIZE_OF_POINT),a+=SIZE_OF_POINT,b.startIndex=C.getValue(a,"i32")>>>0,a+=SIZE_OF_INT,b.endIndex=C.getValue(a,"i32")>>>0,b}function marshalEdit(a,b=TRANSFER_BUFFER){marshalPoint(b,a.startPosition),marshalPoint(b+=SIZE_OF_POINT,a.oldEndPosition),marshalPoint(b+=SIZE_OF_POINT,a.newEndPosition),b+=SIZE_OF_POINT,C.setValue(b,a.startIndex,"i32"),b+=SIZE_OF_INT,C.setValue(b,a.oldEndIndex,"i32"),b+=SIZE_OF_INT,C.setValue(b,a.newEndIndex,"i32")}function unmarshalLanguageMetadata(a){let b=C.getValue(a,"i32");return{major_version:b,minor_version:C.getValue(a+=SIZE_OF_INT,"i32"),patch_version:C.getValue(a+=SIZE_OF_INT,"i32")}}__name(unmarshalCaptures,"unmarshalCaptures"),__name(marshalNode,"marshalNode"),__name(unmarshalNode,"unmarshalNode"),__name(marshalTreeCursor,"marshalTreeCursor"),__name(unmarshalTreeCursor,"unmarshalTreeCursor"),__name(marshalPoint,"marshalPoint"),__name(unmarshalPoint,"unmarshalPoint"),__name(marshalRange,"marshalRange"),__name(unmarshalRange,"unmarshalRange"),__name(marshalEdit,"marshalEdit"),__name(unmarshalLanguageMetadata,"unmarshalLanguageMetadata");var LANGUAGE_FUNCTION_REGEX=/^tree_sitter_\w+$/,Language=class _Language{static{__name(this,"Language")}0=0;types;fields;constructor(a,b){assertInternal(a),this[0]=b,this.types=Array(C._ts_language_symbol_count(this[0]));for(let a=0,b=this.types.length;a<b;a++)2>C._ts_language_symbol_type(this[0],a)&&(this.types[a]=C.UTF8ToString(C._ts_language_symbol_name(this[0],a)));this.fields=Array(C._ts_language_field_count(this[0])+1);for(let a=0,b=this.fields.length;a<b;a++){const b=C._ts_language_field_name_for_id(this[0],a);0!==b?this.fields[a]=C.UTF8ToString(b):this.fields[a]=null}}get name(){let a=C._ts_language_name(this[0]);return 0===a?null:C.UTF8ToString(a)}get abiVersion(){return C._ts_language_abi_version(this[0])}get metadata(){return(C._ts_language_metadata_wasm(this[0]),0===C.getValue(TRANSFER_BUFFER,"i32"))?null:unmarshalLanguageMetadata(TRANSFER_BUFFER+SIZE_OF_INT)}get fieldCount(){return this.fields.length-1}get stateCount(){return C._ts_language_state_count(this[0])}fieldIdForName(a){let b=this.fields.indexOf(a);return -1!==b?b:null}fieldNameForId(a){return this.fields[a]??null}idForNodeType(a,b){let c=C.lengthBytesUTF8(a),d=C._malloc(c+1);C.stringToUTF8(a,d,c+1);let e=C._ts_language_symbol_for_name(this[0],d,c,+!!b);return C._free(d),e||null}get nodeTypeCount(){return C._ts_language_symbol_count(this[0])}nodeTypeForId(a){let b=C._ts_language_symbol_name(this[0],a);return b?C.UTF8ToString(b):null}nodeTypeIsNamed(a){return!!C._ts_language_type_is_named_wasm(this[0],a)}nodeTypeIsVisible(a){return!!C._ts_language_type_is_visible_wasm(this[0],a)}get supertypes(){C._ts_language_supertypes_wasm(this[0]);let a=C.getValue(TRANSFER_BUFFER,"i32"),b=C.getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),c=Array(a);if(a>0){let d=b;for(let b=0;b<a;b++)c[b]=C.getValue(d,"i16"),d+=SIZE_OF_SHORT}return c}subtypes(a){C._ts_language_subtypes_wasm(this[0],a);let b=C.getValue(TRANSFER_BUFFER,"i32"),c=C.getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),d=Array(b);if(b>0){let a=c;for(let c=0;c<b;c++)d[c]=C.getValue(a,"i16"),a+=SIZE_OF_SHORT}return d}nextState(a,b){return C._ts_language_next_state(this[0],a,b)}lookaheadIterator(a){let b=C._ts_lookahead_iterator_new(this[0],a);return b?new LookaheadIterator(INTERNAL,b,this):null}static async load(a){let b;if(a instanceof Uint8Array)b=a;else if(globalThis.process?.versions.node){let c=await Promise.resolve().then(__webpack_require__.t.bind(__webpack_require__,79748,19));b=await c.readFile(a)}else{let c=await fetch(a);if(!c.ok){let a=await c.text();throw Error(`Language.load failed with status ${c.status}.
|
|
2
|
-
|
|
3
|
-
${a}`)}let d=c.clone();try{b=await WebAssembly.compileStreaming(c)}catch(a){console.error("wasm streaming compile failed:",a),console.error("falling back to ArrayBuffer instantiation"),b=new Uint8Array(await d.arrayBuffer())}}let c=await C.loadWebAssemblyModule(b,{loadAsync:!0}),d=Object.keys(c),e=d.find(a=>LANGUAGE_FUNCTION_REGEX.test(a)&&!a.includes("external_scanner_"));if(!e)throw console.log(`Couldn't find language function in Wasm file. Symbols:
|
|
4
|
-
${JSON.stringify(d,null,2)}`),Error("Language.load failed: no language function found in Wasm file");return new _Language(INTERNAL,c[e]())}};async function Module2(moduleArg={}){var moduleRtn,readAsync,readBinary,wasmBinary,EXITSTATUS,readyPromiseResolve,readyPromiseReject,wasmMemory,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,HEAP64,HEAPU64,HEAP_DATA_VIEW,wasmBinaryFile,functionsInTableMap,_malloc,_calloc,_realloc,_free,_ts_range_edit,_memcmp,_ts_language_symbol_count,_ts_language_state_count,_ts_language_abi_version,_ts_language_name,_ts_language_field_count,_ts_language_next_state,_ts_language_symbol_name,_ts_language_symbol_for_name,_strncmp,_ts_language_symbol_type,_ts_language_field_name_for_id,_ts_lookahead_iterator_new,_ts_lookahead_iterator_delete,_ts_lookahead_iterator_reset_state,_ts_lookahead_iterator_reset,_ts_lookahead_iterator_next,_ts_lookahead_iterator_current_symbol,_ts_point_edit,_ts_parser_delete,_ts_parser_reset,_ts_parser_set_language,_ts_parser_set_included_ranges,_ts_query_new,_ts_query_delete,_iswspace,_iswalnum,_ts_query_pattern_count,_ts_query_capture_count,_ts_query_string_count,_ts_query_capture_name_for_id,_ts_query_capture_quantifier_for_id,_ts_query_string_value_for_id,_ts_query_predicates_for_pattern,_ts_query_start_byte_for_pattern,_ts_query_end_byte_for_pattern,_ts_query_is_pattern_rooted,_ts_query_is_pattern_non_local,_ts_query_is_pattern_guaranteed_at_step,_ts_query_disable_capture,_ts_query_disable_pattern,_ts_tree_copy,_ts_tree_delete,_ts_init,_ts_parser_new_wasm,_ts_parser_enable_logger_wasm,_ts_parser_parse_wasm,_ts_parser_included_ranges_wasm,_ts_language_type_is_named_wasm,_ts_language_type_is_visible_wasm,_ts_language_metadata_wasm,_ts_language_supertypes_wasm,_ts_language_subtypes_wasm,_ts_tree_root_node_wasm,_ts_tree_root_node_with_offset_wasm,_ts_tree_edit_wasm,_ts_tree_included_ranges_wasm,_ts_tree_get_changed_ranges_wasm,_ts_tree_cursor_new_wasm,_ts_tree_cursor_copy_wasm,_ts_tree_cursor_delete_wasm,_ts_tree_cursor_reset_wasm,_ts_tree_cursor_reset_to_wasm,_ts_tree_cursor_goto_first_child_wasm,_ts_tree_cursor_goto_last_child_wasm,_ts_tree_cursor_goto_first_child_for_index_wasm,_ts_tree_cursor_goto_first_child_for_position_wasm,_ts_tree_cursor_goto_next_sibling_wasm,_ts_tree_cursor_goto_previous_sibling_wasm,_ts_tree_cursor_goto_descendant_wasm,_ts_tree_cursor_goto_parent_wasm,_ts_tree_cursor_current_node_type_id_wasm,_ts_tree_cursor_current_node_state_id_wasm,_ts_tree_cursor_current_node_is_named_wasm,_ts_tree_cursor_current_node_is_missing_wasm,_ts_tree_cursor_current_node_id_wasm,_ts_tree_cursor_start_position_wasm,_ts_tree_cursor_end_position_wasm,_ts_tree_cursor_start_index_wasm,_ts_tree_cursor_end_index_wasm,_ts_tree_cursor_current_field_id_wasm,_ts_tree_cursor_current_depth_wasm,_ts_tree_cursor_current_descendant_index_wasm,_ts_tree_cursor_current_node_wasm,_ts_node_symbol_wasm,_ts_node_field_name_for_child_wasm,_ts_node_field_name_for_named_child_wasm,_ts_node_children_by_field_id_wasm,_ts_node_first_child_for_byte_wasm,_ts_node_first_named_child_for_byte_wasm,_ts_node_grammar_symbol_wasm,_ts_node_child_count_wasm,_ts_node_named_child_count_wasm,_ts_node_child_wasm,_ts_node_named_child_wasm,_ts_node_child_by_field_id_wasm,_ts_node_next_sibling_wasm,_ts_node_prev_sibling_wasm,_ts_node_next_named_sibling_wasm,_ts_node_prev_named_sibling_wasm,_ts_node_descendant_count_wasm,_ts_node_parent_wasm,_ts_node_child_with_descendant_wasm,_ts_node_descendant_for_index_wasm,_ts_node_named_descendant_for_index_wasm,_ts_node_descendant_for_position_wasm,_ts_node_named_descendant_for_position_wasm,_ts_node_start_point_wasm,_ts_node_end_point_wasm,_ts_node_start_index_wasm,_ts_node_end_index_wasm,_ts_node_to_string_wasm,_ts_node_children_wasm,_ts_node_named_children_wasm,_ts_node_descendants_of_type_wasm,_ts_node_is_named_wasm,_ts_node_has_changes_wasm,_ts_node_has_error_wasm,_ts_node_is_error_wasm,_ts_node_is_missing_wasm,_ts_node_is_extra_wasm,_ts_node_parse_state_wasm,_ts_node_next_parse_state_wasm,_ts_query_matches_wasm,_ts_query_captures_wasm,_memset,_memcpy,_memmove,_iswalpha,_iswblank,_iswdigit,_iswlower,_iswupper,_iswxdigit,_memchr,_strlen,_strcmp,_strncat,_strncpy,_towlower,_towupper,_setThrew,__emscripten_stack_restore,__emscripten_stack_alloc,_emscripten_stack_get_current,___wasm_apply_data_relocs,wasmExports,Module=moduleArg,ENVIRONMENT_IS_WEB="object"==typeof window,ENVIRONMENT_IS_WORKER="u">typeof WorkerGlobalScope,ENVIRONMENT_IS_NODE="object"==typeof process&&process.versions?.node&&"renderer"!=process.type;if(ENVIRONMENT_IS_NODE){let{createRequire}=await Promise.resolve().then(__webpack_require__.t.bind(__webpack_require__,8086,19));var require=createRequire("file:///home/runner/work/cockpit/cockpit/node_modules/web-tree-sitter/web-tree-sitter.js")}Module.currentQueryProgressCallback=null,Module.currentProgressCallback=null,Module.currentLogCallback=null,Module.currentParseCallback=null;var arguments_=[],thisProgram="./this.program",quit_=__name((a,b)=>{throw b},"quit_"),_scriptName="file:///home/runner/work/cockpit/cockpit/node_modules/web-tree-sitter/web-tree-sitter.js",scriptDirectory="";function locateFile(a){return Module.locateFile?Module.locateFile(a,scriptDirectory):scriptDirectory+a}if(__name(locateFile,"locateFile"),ENVIRONMENT_IS_NODE){var fs=require("fs");_scriptName.startsWith("file:")&&(scriptDirectory=require("path").dirname(require("url").fileURLToPath(_scriptName))+"/"),readBinary=__name(a=>(a=isFileURI(a)?new URL(a):a,fs.readFileSync(a)),"readBinary"),readAsync=__name(async(a,b=!0)=>(a=isFileURI(a)?new URL(a):a,fs.readFileSync(a,b?void 0:"utf8")),"readAsync"),process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),quit_=__name((a,b)=>{throw process.exitCode=a,b},"quit_")}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){try{scriptDirectory=new URL(".",_scriptName).href}catch{}ENVIRONMENT_IS_WORKER&&(readBinary=__name(a=>{var b=new XMLHttpRequest;return b.open("GET",a,!1),b.responseType="arraybuffer",b.send(null),new Uint8Array(b.response)},"readBinary")),readAsync=__name(async a=>{if(isFileURI(a))return new Promise((b,c)=>{var d=new XMLHttpRequest;d.open("GET",a,!0),d.responseType="arraybuffer",d.onload=()=>{200==d.status||0==d.status&&d.response?b(d.response):c(d.status)},d.onerror=c,d.send(null)});var b=await fetch(a,{credentials:"same-origin"});if(b.ok)return b.arrayBuffer();throw Error(b.status+" : "+b.url)},"readAsync")}var out=console.log.bind(console),err=console.error.bind(console),dynamicLibraries=[],ABORT=!1,isFileURI=__name(a=>a.startsWith("file://"),"isFileURI"),runtimeInitialized=!1;function updateMemoryViews(){var a=wasmMemory.buffer;Module.HEAP8=HEAP8=new Int8Array(a),Module.HEAP16=HEAP16=new Int16Array(a),Module.HEAPU8=HEAPU8=new Uint8Array(a),Module.HEAPU16=HEAPU16=new Uint16Array(a),Module.HEAP32=HEAP32=new Int32Array(a),Module.HEAPU32=HEAPU32=new Uint32Array(a),Module.HEAPF32=HEAPF32=new Float32Array(a),Module.HEAPF64=HEAPF64=new Float64Array(a),Module.HEAP64=HEAP64=new BigInt64Array(a),Module.HEAPU64=HEAPU64=new BigUint64Array(a),Module.HEAP_DATA_VIEW=HEAP_DATA_VIEW=new DataView(a),LE_HEAP_UPDATE()}function initMemory(){if(Module.wasmMemory)wasmMemory=Module.wasmMemory;else{var a=Module.INITIAL_MEMORY||0x2000000;wasmMemory=new WebAssembly.Memory({initial:a/65536,maximum:32768})}updateMemoryViews()}__name(updateMemoryViews,"updateMemoryViews"),__name(initMemory,"initMemory");var __RELOC_FUNCS__=[];function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(onPreRuns)}function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),wasmExports.__wasm_call_ctors(),callRuntimeCallbacks(onPostCtors)}function preMain(){}function postRun(){if(Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(onPostRuns)}function abort(a){Module.onAbort?.(a),err(a="Aborted("+a+")"),ABORT=!0,a+=". Build with -sASSERTIONS for more info.";var b=new WebAssembly.RuntimeError(a);throw readyPromiseReject?.(b),b}function findWasmBinary(){return Module.locateFile?locateFile("web-tree-sitter.wasm"):new __webpack_require__.U(__webpack_require__(48111)).href}function getBinarySync(a){if(a==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(a);throw"both async and sync fetching of the wasm failed"}async function getWasmBinary(a){if(!wasmBinary)try{var b=await readAsync(a);return new Uint8Array(b)}catch{}return getBinarySync(a)}async function instantiateArrayBuffer(a,b){try{var c=await getWasmBinary(a);return await WebAssembly.instantiate(c,b)}catch(a){err(`failed to asynchronously prepare wasm: ${a}`),abort(a)}}async function instantiateAsync(a,b,c){if(!a&&!isFileURI(b)&&!ENVIRONMENT_IS_NODE)try{var d=fetch(b,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(d,c)}catch(a){err(`wasm streaming compile failed: ${a}`),err("falling back to ArrayBuffer instantiation")}return instantiateArrayBuffer(b,c)}function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}async function createWasm(){function a(a,b){wasmExports=relocateExports(wasmExports=a.exports,1024);var c=getDylinkMetadata(b);return c.neededDynlibs&&(dynamicLibraries=c.neededDynlibs.concat(dynamicLibraries)),mergeLibSymbols(wasmExports,"main"),LDSO.init(),loadDylibs(),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),assignWasmExports(wasmExports),wasmExports}function b(b){return a(b.instance,b.module)}__name(a,"receiveInstance"),__name(b,"receiveInstantiationResult");var c=getWasmImports();return Module.instantiateWasm?new Promise((b,d)=>{Module.instantiateWasm(c,(c,d)=>{b(a(c,d))})}):(wasmBinaryFile??=findWasmBinary(),b(await instantiateAsync(wasmBinary,wasmBinaryFile,c)))}__name(preRun,"preRun"),__name(initRuntime,"initRuntime"),__name(preMain,"preMain"),__name(postRun,"postRun"),__name(abort,"abort"),__name(findWasmBinary,"findWasmBinary"),__name(getBinarySync,"getBinarySync"),__name(getWasmBinary,"getWasmBinary"),__name(instantiateArrayBuffer,"instantiateArrayBuffer"),__name(instantiateAsync,"instantiateAsync"),__name(getWasmImports,"getWasmImports"),__name(createWasm,"createWasm");class ExitStatus{static{__name(this,"ExitStatus")}name="ExitStatus";constructor(a){this.message=`Program terminated with exit(${a})`,this.status=a}}var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(a,b){var c=GOT[b];return c||(c=GOT[b]=new WebAssembly.Global({value:"i32",mutable:!0})),currentModuleWeakSymbols.has(b)||(c.required=!0),c}},LE_ATOMICS_NATIVE_BYTE_ORDER=[],LE_HEAP_LOAD_F32=__name(a=>HEAP_DATA_VIEW.getFloat32(a,!0),"LE_HEAP_LOAD_F32"),LE_HEAP_LOAD_F64=__name(a=>HEAP_DATA_VIEW.getFloat64(a,!0),"LE_HEAP_LOAD_F64"),LE_HEAP_LOAD_I16=__name(a=>HEAP_DATA_VIEW.getInt16(a,!0),"LE_HEAP_LOAD_I16"),LE_HEAP_LOAD_I32=__name(a=>HEAP_DATA_VIEW.getInt32(a,!0),"LE_HEAP_LOAD_I32"),LE_HEAP_LOAD_I64=__name(a=>HEAP_DATA_VIEW.getBigInt64(a,!0),"LE_HEAP_LOAD_I64"),LE_HEAP_LOAD_U32=__name(a=>HEAP_DATA_VIEW.getUint32(a,!0),"LE_HEAP_LOAD_U32"),LE_HEAP_STORE_F32=__name((a,b)=>HEAP_DATA_VIEW.setFloat32(a,b,!0),"LE_HEAP_STORE_F32"),LE_HEAP_STORE_F64=__name((a,b)=>HEAP_DATA_VIEW.setFloat64(a,b,!0),"LE_HEAP_STORE_F64"),LE_HEAP_STORE_I16=__name((a,b)=>HEAP_DATA_VIEW.setInt16(a,b,!0),"LE_HEAP_STORE_I16"),LE_HEAP_STORE_I32=__name((a,b)=>HEAP_DATA_VIEW.setInt32(a,b,!0),"LE_HEAP_STORE_I32"),LE_HEAP_STORE_I64=__name((a,b)=>HEAP_DATA_VIEW.setBigInt64(a,b,!0),"LE_HEAP_STORE_I64"),LE_HEAP_STORE_U32=__name((a,b)=>HEAP_DATA_VIEW.setUint32(a,b,!0),"LE_HEAP_STORE_U32"),callRuntimeCallbacks=__name(a=>{for(;a.length>0;)a.shift()(Module)},"callRuntimeCallbacks"),onPostRuns=[],addOnPostRun=__name(a=>onPostRuns.push(a),"addOnPostRun"),onPreRuns=[],addOnPreRun=__name(a=>onPreRuns.push(a),"addOnPreRun"),UTF8Decoder="u">typeof TextDecoder?new TextDecoder:void 0,findStringEnd=__name((a,b,c,d)=>{var e=b+c;if(d)return e;for(;a[b]&&!(b>=e);)++b;return b},"findStringEnd"),UTF8ArrayToString=__name((a,b=0,c,d)=>{var e=findStringEnd(a,b,c,d);if(e-b>16&&a.buffer&&UTF8Decoder)return UTF8Decoder.decode(a.subarray(b,e));for(var f="";b<e;){var g=a[b++];if(!(128&g)){f+=String.fromCharCode(g);continue}var h=63&a[b++];if((224&g)==192){f+=String.fromCharCode((31&g)<<6|h);continue}var i=63&a[b++];if((g=(240&g)==224?(15&g)<<12|h<<6|i:(7&g)<<18|h<<12|i<<6|63&a[b++])<65536)f+=String.fromCharCode(g);else{var j=g-65536;f+=String.fromCharCode(55296|j>>10,56320|1023&j)}}return f},"UTF8ArrayToString"),getDylinkMetadata=__name(a=>{var b=0,c=0;function d(){return a[b++]}function e(){for(var c=0,d=1;;){var e=a[b++];if(c+=(127&e)*d,d*=128,!(128&e))break}return c}function f(){var c=e();return b+=c,UTF8ArrayToString(a,b-c,c)}function g(){for(var a=e(),b=[];a--;)b.push(f());return b}function h(a,b){if(a)throw Error(b)}if(__name(d,"getU8"),__name(e,"getLEB"),__name(f,"getString"),__name(g,"getStringList"),__name(h,"failIf"),a instanceof WebAssembly.Module){var i=WebAssembly.Module.customSections(a,"dylink.0");h(0===i.length,"need dylink section"),c=(a=new Uint8Array(i[0])).length}else{var j=new Uint32Array(new Uint8Array(a.subarray(0,24)).buffer);h(0x6d736100!=j[0]&&6386541!=j[0],"need to see wasm magic number"),h(0!==a[8],"need the dylink section to be first"),b=9;var k=e();c=b+k,h("dylink.0"!==f())}for(var l={neededDynlibs:[],tlsExports:new Set,weakImports:new Set,runtimePaths:[]},m=1,n=2,o=3,p=4,q=5,r=256,s=3,t=1;b<c;){var u=d(),v=e();if(u===m)l.memorySize=e(),l.memoryAlign=e(),l.tableSize=e(),l.tableAlign=e();else if(u===n)l.neededDynlibs=g();else if(u===o)for(var w=e();w--;){var x=f(),y=e();y&r&&l.tlsExports.add(x)}else if(u===p)for(var w=e();w--;){f();var x=f(),y=e();(y&s)==t&&l.weakImports.add(x)}else u===q?l.runtimePaths=g():b+=v}return l},"getDylinkMetadata");function getValue(a,b="i8"){switch(b.endsWith("*")&&(b="*"),b){case"i1":case"i8":return HEAP8[a];case"i16":return LE_HEAP_LOAD_I16((a>>1)*2);case"i32":return LE_HEAP_LOAD_I32((a>>2)*4);case"i64":return LE_HEAP_LOAD_I64((a>>3)*8);case"float":return LE_HEAP_LOAD_F32((a>>2)*4);case"double":return LE_HEAP_LOAD_F64((a>>3)*8);case"*":return LE_HEAP_LOAD_U32((a>>2)*4);default:abort(`invalid type for getValue: ${b}`)}}__name(getValue,"getValue");var newDSO=__name((a,b,c)=>{var d={refcount:1/0,name:a,exports:c,global:!0};return LDSO.loadedLibsByName[a]=d,void 0!=b&&(LDSO.loadedLibsByHandle[b]=d),d},"newDSO"),LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=78240,alignMemory=__name((a,b)=>Math.ceil(a/b)*b,"alignMemory"),getMemory=__name(a=>{if(runtimeInitialized)return _calloc(a,1);var b=___heap_base,c=b+alignMemory(a,16);return ___heap_base=c,GOT.__heap_base.value=c,b},"getMemory"),isInternalSym=__name(a=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(a)||a.startsWith("__em_js__"),"isInternalSym"),uleb128EncodeWithLen=__name(a=>{let b=a.length;return[b%128|128,b>>7,...a]},"uleb128EncodeWithLen"),wasmTypeCodes={i:127,p:127,j:126,f:125,d:124,e:111},generateTypePack=__name(a=>uleb128EncodeWithLen(Array.from(a,a=>wasmTypeCodes[a])),"generateTypePack"),convertJsFunctionToWasm=__name((a,b)=>{var c=Uint8Array.of(0,97,115,109,1,0,0,0,1,...uleb128EncodeWithLen([1,96,...generateTypePack(b.slice(1)),...generateTypePack("v"===b[0]?"":b[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),d=new WebAssembly.Module(c);return new WebAssembly.Instance(d,{e:{f:a}}).exports.f},"convertJsFunctionToWasm"),wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:31,element:"anyfunc"}),getWasmTableEntry=__name(a=>{var b=wasmTableMirror[a];return b||(wasmTableMirror[a]=b=wasmTable.get(a)),b},"getWasmTableEntry"),updateTableMap=__name((a,b)=>{if(functionsInTableMap)for(var c=a;c<a+b;c++){var d=getWasmTableEntry(c);d&&functionsInTableMap.set(d,c)}},"updateTableMap"),getFunctionAddress=__name(a=>(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(a)||0),"getFunctionAddress"),freeTableIndexes=[],getEmptyTableSlot=__name(()=>freeTableIndexes.length?freeTableIndexes.pop():wasmTable.grow(1),"getEmptyTableSlot"),setWasmTableEntry=__name((a,b)=>{wasmTable.set(a,b),wasmTableMirror[a]=wasmTable.get(a)},"setWasmTableEntry"),addFunction=__name((a,b)=>{var c=getFunctionAddress(a);if(c)return c;var d=getEmptyTableSlot();try{setWasmTableEntry(d,a)}catch(c){if(!(c instanceof TypeError))throw c;setWasmTableEntry(d,convertJsFunctionToWasm(a,b))}return functionsInTableMap.set(a,d),d},"addFunction"),updateGOT=__name((a,b)=>{for(var c in a)if(!isInternalSym(c)){var d=a[c];GOT[c]||=new WebAssembly.Global({value:"i32",mutable:!0}),(b||0==GOT[c].value)&&("function"==typeof d?GOT[c].value=addFunction(d):"number"==typeof d?GOT[c].value=d:err(`unhandled export type for '${c}': ${typeof d}`))}},"updateGOT"),relocateExports=__name((a,b,c)=>{var d={};for(var e in a){var f=a[e];"object"==typeof f&&(f=f.value),"number"==typeof f&&(f+=b),d[e]=f}return updateGOT(d,c),d},"relocateExports"),isSymbolDefined=__name(a=>{var b=wasmImports[a];return!!b&&!b.stub},"isSymbolDefined"),dynCall=__name((a,b,c=[],d=!1)=>{var e=getWasmTableEntry(b)(...c);function f(a){return a}return __name(f,"convert"),f(e)},"dynCall"),stackSave=__name(()=>_emscripten_stack_get_current(),"stackSave"),stackRestore=__name(a=>__emscripten_stack_restore(a),"stackRestore"),createInvokeFunction=__name(a=>(b,...c)=>{var d=stackSave();try{return dynCall(a,b,c)}catch(b){if(stackRestore(d),b!==b+0)throw b;if(_setThrew(1,0),"j"==a[0])return 0n}},"createInvokeFunction"),resolveGlobalSymbol=__name((a,b=!1)=>{var c;return isSymbolDefined(a)?c=wasmImports[a]:a.startsWith("invoke_")&&(c=wasmImports[a]=createInvokeFunction(a.split("_")[1])),{sym:c,name:a}},"resolveGlobalSymbol"),onPostCtors=[],addOnPostCtor=__name(a=>onPostCtors.push(a),"addOnPostCtor"),UTF8ToString=__name((a,b,c)=>a?UTF8ArrayToString(HEAPU8,a,b,c):"","UTF8ToString"),loadWebAssemblyModule=__name((binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);function loadModule(){var moduleExports,memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;function resolveSymbol(a){var b=resolveGlobalSymbol(a).sym;return!b&&localScope&&(b=localScope[a]),b||(b=moduleExports[a]),b}handle&&(HEAP8[handle+8]=1,LE_HEAP_STORE_U32((handle+12>>2)*4,memoryBase),LE_HEAP_STORE_I32((handle+16>>2)*4,metadata.memorySize),LE_HEAP_STORE_U32((handle+20>>2)*4,tableBase),LE_HEAP_STORE_I32((handle+24>>2)*4,metadata.tableSize)),metadata.tableSize&&wasmTable.grow(metadata.tableSize),__name(resolveSymbol,"resolveSymbol");var proxyHandler={get(a,b){switch(b){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(b in wasmImports&&!wasmImports[b].stub){var c;return wasmImports[b]}return b in a||(a[b]=(...a)=>(c||=resolveSymbol(b))(...a)),a[b]}},proxy=new Proxy({},proxyHandler);currentModuleWeakSymbols=metadata.weakImports;var info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){function addEmAsm(addr,body){for(var args=[],arity=0;arity<16;arity++)if(-1!=body.indexOf("$"+arity))args.push("$"+arity);else break;args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if(updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols(),__name(addEmAsm,"addEmAsm"),"__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;start<stop;){var jsString=UTF8ToString(start);addEmAsm(start,jsString),start=HEAPU8.indexOf(0,start)+1}function addEmJs(name,cSig,body){var jsArgs=[];if(cSig=cSig.slice(1,-1),"void"!=cSig)for(var i in cSig=cSig.split(",")){var jsArg=cSig[i].split(" ").pop();jsArgs.push(jsArg.replace("*",""))}var func=`(${jsArgs}) => ${body};`;moduleExports[name]=eval(func)}for(var name in __name(addEmJs,"addEmJs"),moduleExports)if(name.startsWith("__em_js__")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;applyRelocs&&(runtimeInitialized?applyRelocs():__RELOC_FUNCS__.push(applyRelocs));var init=moduleExports.__wasm_call_ctors;return init&&(runtimeInitialized?init():addOnPostCtor(init)),moduleExports}if(__name(postInstantiation,"postInstantiation"),flags.loadAsync)return(async()=>{var a;return binary instanceof WebAssembly.Module?a=new WebAssembly.Instance(binary,info):{module:binary,instance:a}=await WebAssembly.instantiate(binary,info),postInstantiation(binary,a)})();var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}return(__name(loadModule,"loadModule"),flags={...flags,rpath:{parentLibPath:libName,paths:metadata.runtimePaths}},flags.loadAsync)?metadata.neededDynlibs.reduce((a,b)=>a.then(()=>loadDynamicLibrary(b,flags,localScope)),Promise.resolve()).then(loadModule):(metadata.neededDynlibs.forEach(a=>loadDynamicLibrary(a,flags,localScope)),loadModule())},"loadWebAssemblyModule"),mergeLibSymbols=__name((a,b)=>{for(var[c,d]of Object.entries(a)){let a=__name(a=>{isSymbolDefined(a)||(wasmImports[a]=d)},"setImport");a(c);let b="__main_argc_argv";"main"==c&&a(b),c==b&&a("main")}},"mergeLibSymbols"),asyncLoad=__name(async a=>new Uint8Array(await readAsync(a)),"asyncLoad");function loadDynamicLibrary(a,b={global:!0,nodelete:!0},c,d){var e=LDSO.loadedLibsByName[a];if(e)return b.global?e.global||(e.global=!0,mergeLibSymbols(e.exports,a)):c&&Object.assign(c,e.exports),b.nodelete&&e.refcount!==1/0&&(e.refcount=1/0),e.refcount++,d&&(LDSO.loadedLibsByHandle[d]=e),!b.loadAsync||Promise.resolve(!0);function f(){if(d){var c=LE_HEAP_LOAD_U32((d+28>>2)*4),e=LE_HEAP_LOAD_U32((d+32>>2)*4);if(c&&e){var f=HEAP8.slice(c,c+e);return b.loadAsync?Promise.resolve(f):f}}var g=locateFile(a);if(b.loadAsync)return asyncLoad(g);if(!readBinary)throw Error(`${g}: file not found, and synchronous loading of external files is not available`);return readBinary(g)}function g(){return b.loadAsync?f().then(e=>loadWebAssemblyModule(e,b,a,c,d)):loadWebAssemblyModule(f(),b,a,c,d)}function h(b){e.global?mergeLibSymbols(b,a):c&&Object.assign(c,b),e.exports=b}return((e=newDSO(a,d,"loading")).refcount=b.nodelete?1/0:1,e.global=b.global,__name(f,"loadLibData"),__name(g,"getExports"),__name(h,"moduleLoaded"),b.loadAsync)?g().then(a=>(h(a),!0)):(h(g()),!0)}__name(loadDynamicLibrary,"loadDynamicLibrary");var reportUndefinedSymbols=__name(()=>{for(var[a,b]of Object.entries(GOT))if(0==b.value){var c=resolveGlobalSymbol(a,!0).sym;if(!c&&!b.required)continue;if("function"==typeof c)b.value=addFunction(c,c.sig);else if("number"==typeof c)b.value=c;else throw Error(`bad export type for '${a}': ${typeof c}`)}},"reportUndefinedSymbols"),runDependencies=0,dependenciesFulfilled=null,removeRunDependency=__name(a=>{if(runDependencies--,Module.monitorRunDependencies?.(runDependencies),0==runDependencies&&dependenciesFulfilled){var b=dependenciesFulfilled;dependenciesFulfilled=null,b()}},"removeRunDependency"),addRunDependency=__name(a=>{runDependencies++,Module.monitorRunDependencies?.(runDependencies)},"addRunDependency"),loadDylibs=__name(async()=>{if(!dynamicLibraries.length)return void reportUndefinedSymbols();for(var a of(addRunDependency("loadDylibs"),dynamicLibraries))await loadDynamicLibrary(a,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0});reportUndefinedSymbols(),removeRunDependency("loadDylibs")},"loadDylibs"),noExitRuntime=!0;function setValue(a,b,c="i8"){switch(c.endsWith("*")&&(c="*"),c){case"i1":case"i8":HEAP8[a]=b;break;case"i16":LE_HEAP_STORE_I16((a>>1)*2,b);break;case"i32":LE_HEAP_STORE_I32((a>>2)*4,b);break;case"i64":LE_HEAP_STORE_I64((a>>3)*8,BigInt(b));break;case"float":LE_HEAP_STORE_F32((a>>2)*4,b);break;case"double":LE_HEAP_STORE_F64((a>>3)*8,b);break;case"*":LE_HEAP_STORE_U32((a>>2)*4,b);break;default:abort(`invalid type for setValue: ${c}`)}}__name(setValue,"setValue");var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_high=78240,___stack_low=12704,___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},78240),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),__abort_js=__name(()=>abort(""),"__abort_js");__abort_js.sig="v";var getHeapMax=__name(()=>0x80000000,"getHeapMax"),growMemory=__name(a=>{var b=(a-wasmMemory.buffer.byteLength+65535)/65536|0;try{return wasmMemory.grow(b),updateMemoryViews(),1}catch(a){}},"growMemory"),_emscripten_resize_heap=__name(a=>{var b=HEAPU8.length;a>>>=0;var c=getHeapMax();if(a>c)return!1;for(var d=1;d<=4;d*=2){var e=b*(1+.2/d);if(e=Math.min(e,a+0x6000000),growMemory(Math.min(c,alignMemory(Math.max(a,e),65536))))return!0}return!1},"_emscripten_resize_heap");_emscripten_resize_heap.sig="ip";var _fd_close=__name(a=>52,"_fd_close");_fd_close.sig="ii";var INT53_MAX=0x20000000000000,INT53_MIN=-0x20000000000000,bigintToI53Checked=__name(a=>a<INT53_MIN||a>INT53_MAX?NaN:Number(a),"bigintToI53Checked");function _fd_seek(a,b,c,d){return b=bigintToI53Checked(b),70}__name(_fd_seek,"_fd_seek"),_fd_seek.sig="iijip";var printCharBuffers=[null,[],[]],printChar=__name((a,b)=>{var c=printCharBuffers[a];0===b||10===b?((1===a?out:err)(UTF8ArrayToString(c)),c.length=0):c.push(b)},"printChar"),_fd_write=__name((a,b,c,d)=>{for(var e=0,f=0;f<c;f++){var g=LE_HEAP_LOAD_U32((b>>2)*4),h=LE_HEAP_LOAD_U32((b+4>>2)*4);b+=8;for(var i=0;i<h;i++)printChar(a,HEAPU8[g+i]);e+=h}return LE_HEAP_STORE_U32((d>>2)*4,e),0},"_fd_write");function _tree_sitter_log_callback(a,b){if(Module.currentLogCallback){let c=UTF8ToString(b);Module.currentLogCallback(c,0!==a)}}function _tree_sitter_parse_callback(a,b,c,d,e){let f=10240,g=Module.currentParseCallback(b,{row:c,column:d});"string"==typeof g?(setValue(e,g.length,"i32"),stringToUTF16(g,a,f)):setValue(e,0,"i32")}function _tree_sitter_progress_callback(a,b){return!!Module.currentProgressCallback&&Module.currentProgressCallback({currentOffset:a,hasError:b})}function _tree_sitter_query_progress_callback(a){return!!Module.currentQueryProgressCallback&&Module.currentQueryProgressCallback({currentOffset:a})}_fd_write.sig="iippp",__name(_tree_sitter_log_callback,"_tree_sitter_log_callback"),__name(_tree_sitter_parse_callback,"_tree_sitter_parse_callback"),__name(_tree_sitter_progress_callback,"_tree_sitter_progress_callback"),__name(_tree_sitter_query_progress_callback,"_tree_sitter_query_progress_callback");var runtimeKeepaliveCounter=0,keepRuntimeAlive=__name(()=>noExitRuntime||runtimeKeepaliveCounter>0,"keepRuntimeAlive"),_proc_exit=__name(a=>{EXITSTATUS=a,keepRuntimeAlive()||(Module.onExit?.(a),ABORT=!0),quit_(a,new ExitStatus(a))},"_proc_exit");_proc_exit.sig="vi";var exitJS=__name((a,b)=>{EXITSTATUS=a,_proc_exit(a)},"exitJS"),handleException=__name(a=>{if(a instanceof ExitStatus||"unwind"==a)return EXITSTATUS;quit_(1,a)},"handleException"),lengthBytesUTF8=__name(a=>{for(var b=0,c=0;c<a.length;++c){var d=a.charCodeAt(c);d<=127?b++:d<=2047?b+=2:d>=55296&&d<=57343?(b+=4,++c):b+=3}return b},"lengthBytesUTF8"),stringToUTF8Array=__name((a,b,c,d)=>{if(!(d>0))return 0;for(var e=c,f=c+d-1,g=0;g<a.length;++g){var h=a.codePointAt(g);if(h<=127){if(c>=f)break;b[c++]=h}else if(h<=2047){if(c+1>=f)break;b[c++]=192|h>>6,b[c++]=128|63&h}else if(h<=65535){if(c+2>=f)break;b[c++]=224|h>>12,b[c++]=128|h>>6&63,b[c++]=128|63&h}else{if(c+3>=f)break;b[c++]=240|h>>18,b[c++]=128|h>>12&63,b[c++]=128|h>>6&63,b[c++]=128|63&h,g++}}return b[c]=0,c-e},"stringToUTF8Array"),stringToUTF8=__name((a,b,c)=>stringToUTF8Array(a,HEAPU8,b,c),"stringToUTF8"),stackAlloc=__name(a=>__emscripten_stack_alloc(a),"stackAlloc"),stringToUTF8OnStack=__name(a=>{var b=lengthBytesUTF8(a)+1,c=stackAlloc(b);return stringToUTF8(a,c,b),c},"stringToUTF8OnStack"),AsciiToString=__name(a=>{for(var b="";;){var c=HEAPU8[a++];if(!c)return b;b+=String.fromCharCode(c)}},"AsciiToString"),stringToUTF16=__name((a,b,c)=>{if((c??=0x7fffffff)<2)return 0;for(var d=b,e=(c-=2)<2*a.length?c/2:a.length,f=0;f<e;++f)LE_HEAP_STORE_I16((b>>1)*2,a.charCodeAt(f)),b+=2;return LE_HEAP_STORE_I16((b>>1)*2,0),b-d},"stringToUTF16");function LE_HEAP_UPDATE(){HEAPU16.unsigned=a=>65535&a,HEAPU32.unsigned=a=>a>>>0}if(LE_ATOMICS_NATIVE_BYTE_ORDER=1===new Int8Array(new Int16Array([1]).buffer)[0]?[a=>a,a=>a,void 0,a=>a]:[a=>a,a=>((65280&a)<<8|(255&a)<<24)>>16,void 0,a=>a>>24&255|a>>8&65280|(65280&a)<<8|(255&a)<<24],__name(LE_HEAP_UPDATE,"LE_HEAP_UPDATE"),initMemory(),Module.noExitRuntime&&(noExitRuntime=Module.noExitRuntime),Module.print&&(out=Module.print),Module.printErr&&(err=Module.printErr),Module.dynamicLibraries&&(dynamicLibraries=Module.dynamicLibraries),Module.wasmBinary&&(wasmBinary=Module.wasmBinary),Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram),Module.preInit)for("function"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.shift()();Module.setValue=setValue,Module.getValue=getValue,Module.UTF8ToString=UTF8ToString,Module.stringToUTF8=stringToUTF8,Module.lengthBytesUTF8=lengthBytesUTF8,Module.AsciiToString=AsciiToString,Module.stringToUTF16=stringToUTF16,Module.loadWebAssemblyModule=loadWebAssemblyModule,Module.LE_HEAP_STORE_I64=LE_HEAP_STORE_I64;var ASM_CONSTS={};function assignWasmExports(a){Module._malloc=_malloc=a.malloc,Module._calloc=_calloc=a.calloc,Module._realloc=_realloc=a.realloc,Module._free=_free=a.free,Module._ts_range_edit=_ts_range_edit=a.ts_range_edit,Module._memcmp=_memcmp=a.memcmp,Module._ts_language_symbol_count=_ts_language_symbol_count=a.ts_language_symbol_count,Module._ts_language_state_count=_ts_language_state_count=a.ts_language_state_count,Module._ts_language_abi_version=_ts_language_abi_version=a.ts_language_abi_version,Module._ts_language_name=_ts_language_name=a.ts_language_name,Module._ts_language_field_count=_ts_language_field_count=a.ts_language_field_count,Module._ts_language_next_state=_ts_language_next_state=a.ts_language_next_state,Module._ts_language_symbol_name=_ts_language_symbol_name=a.ts_language_symbol_name,Module._ts_language_symbol_for_name=_ts_language_symbol_for_name=a.ts_language_symbol_for_name,Module._strncmp=_strncmp=a.strncmp,Module._ts_language_symbol_type=_ts_language_symbol_type=a.ts_language_symbol_type,Module._ts_language_field_name_for_id=_ts_language_field_name_for_id=a.ts_language_field_name_for_id,Module._ts_lookahead_iterator_new=_ts_lookahead_iterator_new=a.ts_lookahead_iterator_new,Module._ts_lookahead_iterator_delete=_ts_lookahead_iterator_delete=a.ts_lookahead_iterator_delete,Module._ts_lookahead_iterator_reset_state=_ts_lookahead_iterator_reset_state=a.ts_lookahead_iterator_reset_state,Module._ts_lookahead_iterator_reset=_ts_lookahead_iterator_reset=a.ts_lookahead_iterator_reset,Module._ts_lookahead_iterator_next=_ts_lookahead_iterator_next=a.ts_lookahead_iterator_next,Module._ts_lookahead_iterator_current_symbol=_ts_lookahead_iterator_current_symbol=a.ts_lookahead_iterator_current_symbol,Module._ts_point_edit=_ts_point_edit=a.ts_point_edit,Module._ts_parser_delete=_ts_parser_delete=a.ts_parser_delete,Module._ts_parser_reset=_ts_parser_reset=a.ts_parser_reset,Module._ts_parser_set_language=_ts_parser_set_language=a.ts_parser_set_language,Module._ts_parser_set_included_ranges=_ts_parser_set_included_ranges=a.ts_parser_set_included_ranges,Module._ts_query_new=_ts_query_new=a.ts_query_new,Module._ts_query_delete=_ts_query_delete=a.ts_query_delete,Module._iswspace=_iswspace=a.iswspace,Module._iswalnum=_iswalnum=a.iswalnum,Module._ts_query_pattern_count=_ts_query_pattern_count=a.ts_query_pattern_count,Module._ts_query_capture_count=_ts_query_capture_count=a.ts_query_capture_count,Module._ts_query_string_count=_ts_query_string_count=a.ts_query_string_count,Module._ts_query_capture_name_for_id=_ts_query_capture_name_for_id=a.ts_query_capture_name_for_id,Module._ts_query_capture_quantifier_for_id=_ts_query_capture_quantifier_for_id=a.ts_query_capture_quantifier_for_id,Module._ts_query_string_value_for_id=_ts_query_string_value_for_id=a.ts_query_string_value_for_id,Module._ts_query_predicates_for_pattern=_ts_query_predicates_for_pattern=a.ts_query_predicates_for_pattern,Module._ts_query_start_byte_for_pattern=_ts_query_start_byte_for_pattern=a.ts_query_start_byte_for_pattern,Module._ts_query_end_byte_for_pattern=_ts_query_end_byte_for_pattern=a.ts_query_end_byte_for_pattern,Module._ts_query_is_pattern_rooted=_ts_query_is_pattern_rooted=a.ts_query_is_pattern_rooted,Module._ts_query_is_pattern_non_local=_ts_query_is_pattern_non_local=a.ts_query_is_pattern_non_local,Module._ts_query_is_pattern_guaranteed_at_step=_ts_query_is_pattern_guaranteed_at_step=a.ts_query_is_pattern_guaranteed_at_step,Module._ts_query_disable_capture=_ts_query_disable_capture=a.ts_query_disable_capture,Module._ts_query_disable_pattern=_ts_query_disable_pattern=a.ts_query_disable_pattern,Module._ts_tree_copy=_ts_tree_copy=a.ts_tree_copy,Module._ts_tree_delete=_ts_tree_delete=a.ts_tree_delete,Module._ts_init=_ts_init=a.ts_init,Module._ts_parser_new_wasm=_ts_parser_new_wasm=a.ts_parser_new_wasm,Module._ts_parser_enable_logger_wasm=_ts_parser_enable_logger_wasm=a.ts_parser_enable_logger_wasm,Module._ts_parser_parse_wasm=_ts_parser_parse_wasm=a.ts_parser_parse_wasm,Module._ts_parser_included_ranges_wasm=_ts_parser_included_ranges_wasm=a.ts_parser_included_ranges_wasm,Module._ts_language_type_is_named_wasm=_ts_language_type_is_named_wasm=a.ts_language_type_is_named_wasm,Module._ts_language_type_is_visible_wasm=_ts_language_type_is_visible_wasm=a.ts_language_type_is_visible_wasm,Module._ts_language_metadata_wasm=_ts_language_metadata_wasm=a.ts_language_metadata_wasm,Module._ts_language_supertypes_wasm=_ts_language_supertypes_wasm=a.ts_language_supertypes_wasm,Module._ts_language_subtypes_wasm=_ts_language_subtypes_wasm=a.ts_language_subtypes_wasm,Module._ts_tree_root_node_wasm=_ts_tree_root_node_wasm=a.ts_tree_root_node_wasm,Module._ts_tree_root_node_with_offset_wasm=_ts_tree_root_node_with_offset_wasm=a.ts_tree_root_node_with_offset_wasm,Module._ts_tree_edit_wasm=_ts_tree_edit_wasm=a.ts_tree_edit_wasm,Module._ts_tree_included_ranges_wasm=_ts_tree_included_ranges_wasm=a.ts_tree_included_ranges_wasm,Module._ts_tree_get_changed_ranges_wasm=_ts_tree_get_changed_ranges_wasm=a.ts_tree_get_changed_ranges_wasm,Module._ts_tree_cursor_new_wasm=_ts_tree_cursor_new_wasm=a.ts_tree_cursor_new_wasm,Module._ts_tree_cursor_copy_wasm=_ts_tree_cursor_copy_wasm=a.ts_tree_cursor_copy_wasm,Module._ts_tree_cursor_delete_wasm=_ts_tree_cursor_delete_wasm=a.ts_tree_cursor_delete_wasm,Module._ts_tree_cursor_reset_wasm=_ts_tree_cursor_reset_wasm=a.ts_tree_cursor_reset_wasm,Module._ts_tree_cursor_reset_to_wasm=_ts_tree_cursor_reset_to_wasm=a.ts_tree_cursor_reset_to_wasm,Module._ts_tree_cursor_goto_first_child_wasm=_ts_tree_cursor_goto_first_child_wasm=a.ts_tree_cursor_goto_first_child_wasm,Module._ts_tree_cursor_goto_last_child_wasm=_ts_tree_cursor_goto_last_child_wasm=a.ts_tree_cursor_goto_last_child_wasm,Module._ts_tree_cursor_goto_first_child_for_index_wasm=_ts_tree_cursor_goto_first_child_for_index_wasm=a.ts_tree_cursor_goto_first_child_for_index_wasm,Module._ts_tree_cursor_goto_first_child_for_position_wasm=_ts_tree_cursor_goto_first_child_for_position_wasm=a.ts_tree_cursor_goto_first_child_for_position_wasm,Module._ts_tree_cursor_goto_next_sibling_wasm=_ts_tree_cursor_goto_next_sibling_wasm=a.ts_tree_cursor_goto_next_sibling_wasm,Module._ts_tree_cursor_goto_previous_sibling_wasm=_ts_tree_cursor_goto_previous_sibling_wasm=a.ts_tree_cursor_goto_previous_sibling_wasm,Module._ts_tree_cursor_goto_descendant_wasm=_ts_tree_cursor_goto_descendant_wasm=a.ts_tree_cursor_goto_descendant_wasm,Module._ts_tree_cursor_goto_parent_wasm=_ts_tree_cursor_goto_parent_wasm=a.ts_tree_cursor_goto_parent_wasm,Module._ts_tree_cursor_current_node_type_id_wasm=_ts_tree_cursor_current_node_type_id_wasm=a.ts_tree_cursor_current_node_type_id_wasm,Module._ts_tree_cursor_current_node_state_id_wasm=_ts_tree_cursor_current_node_state_id_wasm=a.ts_tree_cursor_current_node_state_id_wasm,Module._ts_tree_cursor_current_node_is_named_wasm=_ts_tree_cursor_current_node_is_named_wasm=a.ts_tree_cursor_current_node_is_named_wasm,Module._ts_tree_cursor_current_node_is_missing_wasm=_ts_tree_cursor_current_node_is_missing_wasm=a.ts_tree_cursor_current_node_is_missing_wasm,Module._ts_tree_cursor_current_node_id_wasm=_ts_tree_cursor_current_node_id_wasm=a.ts_tree_cursor_current_node_id_wasm,Module._ts_tree_cursor_start_position_wasm=_ts_tree_cursor_start_position_wasm=a.ts_tree_cursor_start_position_wasm,Module._ts_tree_cursor_end_position_wasm=_ts_tree_cursor_end_position_wasm=a.ts_tree_cursor_end_position_wasm,Module._ts_tree_cursor_start_index_wasm=_ts_tree_cursor_start_index_wasm=a.ts_tree_cursor_start_index_wasm,Module._ts_tree_cursor_end_index_wasm=_ts_tree_cursor_end_index_wasm=a.ts_tree_cursor_end_index_wasm,Module._ts_tree_cursor_current_field_id_wasm=_ts_tree_cursor_current_field_id_wasm=a.ts_tree_cursor_current_field_id_wasm,Module._ts_tree_cursor_current_depth_wasm=_ts_tree_cursor_current_depth_wasm=a.ts_tree_cursor_current_depth_wasm,Module._ts_tree_cursor_current_descendant_index_wasm=_ts_tree_cursor_current_descendant_index_wasm=a.ts_tree_cursor_current_descendant_index_wasm,Module._ts_tree_cursor_current_node_wasm=_ts_tree_cursor_current_node_wasm=a.ts_tree_cursor_current_node_wasm,Module._ts_node_symbol_wasm=_ts_node_symbol_wasm=a.ts_node_symbol_wasm,Module._ts_node_field_name_for_child_wasm=_ts_node_field_name_for_child_wasm=a.ts_node_field_name_for_child_wasm,Module._ts_node_field_name_for_named_child_wasm=_ts_node_field_name_for_named_child_wasm=a.ts_node_field_name_for_named_child_wasm,Module._ts_node_children_by_field_id_wasm=_ts_node_children_by_field_id_wasm=a.ts_node_children_by_field_id_wasm,Module._ts_node_first_child_for_byte_wasm=_ts_node_first_child_for_byte_wasm=a.ts_node_first_child_for_byte_wasm,Module._ts_node_first_named_child_for_byte_wasm=_ts_node_first_named_child_for_byte_wasm=a.ts_node_first_named_child_for_byte_wasm,Module._ts_node_grammar_symbol_wasm=_ts_node_grammar_symbol_wasm=a.ts_node_grammar_symbol_wasm,Module._ts_node_child_count_wasm=_ts_node_child_count_wasm=a.ts_node_child_count_wasm,Module._ts_node_named_child_count_wasm=_ts_node_named_child_count_wasm=a.ts_node_named_child_count_wasm,Module._ts_node_child_wasm=_ts_node_child_wasm=a.ts_node_child_wasm,Module._ts_node_named_child_wasm=_ts_node_named_child_wasm=a.ts_node_named_child_wasm,Module._ts_node_child_by_field_id_wasm=_ts_node_child_by_field_id_wasm=a.ts_node_child_by_field_id_wasm,Module._ts_node_next_sibling_wasm=_ts_node_next_sibling_wasm=a.ts_node_next_sibling_wasm,Module._ts_node_prev_sibling_wasm=_ts_node_prev_sibling_wasm=a.ts_node_prev_sibling_wasm,Module._ts_node_next_named_sibling_wasm=_ts_node_next_named_sibling_wasm=a.ts_node_next_named_sibling_wasm,Module._ts_node_prev_named_sibling_wasm=_ts_node_prev_named_sibling_wasm=a.ts_node_prev_named_sibling_wasm,Module._ts_node_descendant_count_wasm=_ts_node_descendant_count_wasm=a.ts_node_descendant_count_wasm,Module._ts_node_parent_wasm=_ts_node_parent_wasm=a.ts_node_parent_wasm,Module._ts_node_child_with_descendant_wasm=_ts_node_child_with_descendant_wasm=a.ts_node_child_with_descendant_wasm,Module._ts_node_descendant_for_index_wasm=_ts_node_descendant_for_index_wasm=a.ts_node_descendant_for_index_wasm,Module._ts_node_named_descendant_for_index_wasm=_ts_node_named_descendant_for_index_wasm=a.ts_node_named_descendant_for_index_wasm,Module._ts_node_descendant_for_position_wasm=_ts_node_descendant_for_position_wasm=a.ts_node_descendant_for_position_wasm,Module._ts_node_named_descendant_for_position_wasm=_ts_node_named_descendant_for_position_wasm=a.ts_node_named_descendant_for_position_wasm,Module._ts_node_start_point_wasm=_ts_node_start_point_wasm=a.ts_node_start_point_wasm,Module._ts_node_end_point_wasm=_ts_node_end_point_wasm=a.ts_node_end_point_wasm,Module._ts_node_start_index_wasm=_ts_node_start_index_wasm=a.ts_node_start_index_wasm,Module._ts_node_end_index_wasm=_ts_node_end_index_wasm=a.ts_node_end_index_wasm,Module._ts_node_to_string_wasm=_ts_node_to_string_wasm=a.ts_node_to_string_wasm,Module._ts_node_children_wasm=_ts_node_children_wasm=a.ts_node_children_wasm,Module._ts_node_named_children_wasm=_ts_node_named_children_wasm=a.ts_node_named_children_wasm,Module._ts_node_descendants_of_type_wasm=_ts_node_descendants_of_type_wasm=a.ts_node_descendants_of_type_wasm,Module._ts_node_is_named_wasm=_ts_node_is_named_wasm=a.ts_node_is_named_wasm,Module._ts_node_has_changes_wasm=_ts_node_has_changes_wasm=a.ts_node_has_changes_wasm,Module._ts_node_has_error_wasm=_ts_node_has_error_wasm=a.ts_node_has_error_wasm,Module._ts_node_is_error_wasm=_ts_node_is_error_wasm=a.ts_node_is_error_wasm,Module._ts_node_is_missing_wasm=_ts_node_is_missing_wasm=a.ts_node_is_missing_wasm,Module._ts_node_is_extra_wasm=_ts_node_is_extra_wasm=a.ts_node_is_extra_wasm,Module._ts_node_parse_state_wasm=_ts_node_parse_state_wasm=a.ts_node_parse_state_wasm,Module._ts_node_next_parse_state_wasm=_ts_node_next_parse_state_wasm=a.ts_node_next_parse_state_wasm,Module._ts_query_matches_wasm=_ts_query_matches_wasm=a.ts_query_matches_wasm,Module._ts_query_captures_wasm=_ts_query_captures_wasm=a.ts_query_captures_wasm,Module._memset=_memset=a.memset,Module._memcpy=_memcpy=a.memcpy,Module._memmove=_memmove=a.memmove,Module._iswalpha=_iswalpha=a.iswalpha,Module._iswblank=_iswblank=a.iswblank,Module._iswdigit=_iswdigit=a.iswdigit,Module._iswlower=_iswlower=a.iswlower,Module._iswupper=_iswupper=a.iswupper,Module._iswxdigit=_iswxdigit=a.iswxdigit,Module._memchr=_memchr=a.memchr,Module._strlen=_strlen=a.strlen,Module._strcmp=_strcmp=a.strcmp,Module._strncat=_strncat=a.strncat,Module._strncpy=_strncpy=a.strncpy,Module._towlower=_towlower=a.towlower,Module._towupper=_towupper=a.towupper,_setThrew=a.setThrew,__emscripten_stack_restore=a._emscripten_stack_restore,__emscripten_stack_alloc=a._emscripten_stack_alloc,_emscripten_stack_get_current=a.emscripten_stack_get_current,___wasm_apply_data_relocs=a.__wasm_apply_data_relocs}__name(assignWasmExports,"assignWasmExports");var wasmImports={__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_high:___stack_high,__stack_low:___stack_low,__stack_pointer:___stack_pointer,__table_base:___table_base,_abort_js:__abort_js,emscripten_resize_heap:_emscripten_resize_heap,fd_close:_fd_close,fd_seek:_fd_seek,fd_write:_fd_write,memory:wasmMemory,tree_sitter_log_callback:_tree_sitter_log_callback,tree_sitter_parse_callback:_tree_sitter_parse_callback,tree_sitter_progress_callback:_tree_sitter_progress_callback,tree_sitter_query_progress_callback:_tree_sitter_query_progress_callback};function callMain(a=[]){var b=resolveGlobalSymbol("main").sym;if(b){a.unshift(thisProgram);var c=a.length,d=stackAlloc((c+1)*4),e=d;a.forEach(a=>{LE_HEAP_STORE_U32((e>>2)*4,stringToUTF8OnStack(a)),e+=4}),LE_HEAP_STORE_U32((e>>2)*4,0);try{var f=b(c,d);return exitJS(f,!0),f}catch(a){return handleException(a)}}}function run(a=arguments_){if(runDependencies>0||(preRun(),runDependencies>0)){dependenciesFulfilled=run;return}function b(){if(Module.calledRun=!0,!ABORT){initRuntime(),readyPromiseResolve?.(Module),Module.onRuntimeInitialized?.();var b=Module.noInitialRun||!1;b||callMain(a),postRun()}}__name(b,"doRun"),Module.setStatus?(Module.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>Module.setStatus(""),1),b()},1)):b()}return __name(callMain,"callMain"),__name(run,"run"),wasmExports=await createWasm(),run(),moduleRtn=runtimeInitialized?Module:new Promise((a,b)=>{readyPromiseResolve=a,readyPromiseReject=b})}__name(Module2,"Module");var web_tree_sitter_default=Module2,Module3=null;async function initializeBinding(a){return Module3??=await web_tree_sitter_default(a)}function checkModule(){return!!Module3}__name(initializeBinding,"initializeBinding"),__name(checkModule,"checkModule");var Parser=class{static{__name(this,"Parser")}0=0;1=0;logCallback=null;language=null;static async init(a){setModule(await initializeBinding(a)),TRANSFER_BUFFER=C._ts_init(),LANGUAGE_VERSION=C.getValue(TRANSFER_BUFFER,"i32"),MIN_COMPATIBLE_VERSION=C.getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32")}constructor(){this.initialize()}initialize(){if(!checkModule())throw Error("cannot construct a Parser before calling `init()`");C._ts_parser_new_wasm(),this[0]=C.getValue(TRANSFER_BUFFER,"i32"),this[1]=C.getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32")}delete(){C._ts_parser_delete(this[0]),C._free(this[1]),this[0]=0,this[1]=0}setLanguage(a){let b;if(a)if(a.constructor===Language){b=a[0];let c=C._ts_language_abi_version(b);if(c<MIN_COMPATIBLE_VERSION||LANGUAGE_VERSION<c)throw Error(`Incompatible language version ${c}. Compatibility range ${MIN_COMPATIBLE_VERSION} through ${LANGUAGE_VERSION}.`);this.language=a}else throw Error("Argument must be a Language");else b=0,this.language=null;return C._ts_parser_set_language(this[0],b),this}parse(a,b,c){if("string"==typeof a)C.currentParseCallback=b=>a.slice(b);else if("function"==typeof a)C.currentParseCallback=a;else throw Error("Argument must be a string or a function");c?.progressCallback?C.currentProgressCallback=c.progressCallback:C.currentProgressCallback=null,this.logCallback?(C.currentLogCallback=this.logCallback,C._ts_parser_enable_logger_wasm(this[0],1)):(C.currentLogCallback=null,C._ts_parser_enable_logger_wasm(this[0],0));let d=0,e=0;if(c?.includedRanges){d=c.includedRanges.length;let a=e=C._calloc(d,SIZE_OF_RANGE);for(let b=0;b<d;b++)marshalRange(a,c.includedRanges[b]),a+=SIZE_OF_RANGE}let f=C._ts_parser_parse_wasm(this[0],this[1],b?b[0]:0,e,d);if(!f)return C.currentParseCallback=null,C.currentLogCallback=null,C.currentProgressCallback=null,null;if(!this.language)throw Error("Parser must have a language to parse");let g=new Tree(INTERNAL,f,this.language,C.currentParseCallback);return C.currentParseCallback=null,C.currentLogCallback=null,C.currentProgressCallback=null,g}reset(){C._ts_parser_reset(this[0])}getIncludedRanges(){C._ts_parser_included_ranges_wasm(this[0]);let a=C.getValue(TRANSFER_BUFFER,"i32"),b=C.getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),c=Array(a);if(a>0){let d=b;for(let b=0;b<a;b++)c[b]=unmarshalRange(d),d+=SIZE_OF_RANGE;C._free(b)}return c}setLogger(a){if(a)if("function"!=typeof a)throw Error("Logger callback must be a function");else this.logCallback=a;else this.logCallback=null;return this}getLogger(){return this.logCallback}},PREDICATE_STEP_TYPE_CAPTURE=1,PREDICATE_STEP_TYPE_STRING=2,QUERY_WORD_REGEX=/[\w-]+/g,CaptureQuantifier={},isCaptureStep=__name(a=>"capture"===a.type,"isCaptureStep"),isStringStep=__name(a=>"string"===a.type,"isStringStep"),QueryErrorKind={Syntax:1,NodeName:2,FieldName:3,CaptureName:4,PatternStructure:5},QueryError=class _QueryError extends Error{constructor(a,b,c,d){super(_QueryError.formatMessage(a,b)),this.kind=a,this.info=b,this.index=c,this.length=d,this.name="QueryError"}static{__name(this,"QueryError")}static formatMessage(a,b){switch(a){case QueryErrorKind.NodeName:return`Bad node name '${b.word}'`;case QueryErrorKind.FieldName:return`Bad field name '${b.word}'`;case QueryErrorKind.CaptureName:return`Bad capture name @${b.word}`;case QueryErrorKind.PatternStructure:return`Bad pattern structure at offset ${b.suffix}`;case QueryErrorKind.Syntax:return`Bad syntax at offset ${b.suffix}`}}};function parseAnyPredicate(a,b,c,d){if(3!==a.length)throw Error(`Wrong number of arguments to \`#${c}\` predicate. Expected 2, got ${a.length-1}`);if(!isCaptureStep(a[1]))throw Error(`First argument of \`#${c}\` predicate must be a capture. Got "${a[1].value}"`);let e="eq?"===c||"any-eq?"===c,f=!c.startsWith("any-");if(isCaptureStep(a[2])){let c=a[1].name,g=a[2].name;d[b].push(a=>{let b=[],d=[];for(let e of a)e.name===c&&b.push(e.node),e.name===g&&d.push(e.node);let h=__name((a,b,c)=>c?a.text===b.text:a.text!==b.text,"compare");return f?b.every(a=>d.some(b=>h(a,b,e))):b.some(a=>d.some(b=>h(a,b,e)))})}else{let c=a[1].name,g=a[2].value,h=__name(a=>a.text===g,"matches"),i=__name(a=>a.text!==g,"doesNotMatch");d[b].push(a=>{let b=[];for(let d of a)d.name===c&&b.push(d.node);let d=e?h:i;return f?b.every(d):b.some(d)})}}function parseMatchPredicate(a,b,c,d){if(3!==a.length)throw Error(`Wrong number of arguments to \`#${c}\` predicate. Expected 2, got ${a.length-1}.`);if("capture"!==a[1].type)throw Error(`First argument of \`#${c}\` predicate must be a capture. Got "${a[1].value}".`);if("string"!==a[2].type)throw Error(`Second argument of \`#${c}\` predicate must be a string. Got @${a[2].name}.`);let e="match?"===c||"any-match?"===c,f=!c.startsWith("any-"),g=a[1].name,h=new RegExp(a[2].value);d[b].push(a=>{let b=[];for(let c of a)c.name===g&&b.push(c.node.text);let c=__name((a,b)=>b?h.test(a):!h.test(a),"test");return 0===b.length?!e:f?b.every(a=>c(a,e)):b.some(a=>c(a,e))})}function parseAnyOfPredicate(a,b,c,d){if(a.length<2)throw Error(`Wrong number of arguments to \`#${c}\` predicate. Expected at least 1. Got ${a.length-1}.`);if("capture"!==a[1].type)throw Error(`First argument of \`#${c}\` predicate must be a capture. Got "${a[1].value}".`);let e="any-of?"===c,f=a[1].name,g=a.slice(2);if(!g.every(isStringStep))throw Error(`Arguments to \`#${c}\` predicate must be strings.".`);let h=g.map(a=>a.value);d[b].push(a=>{let b=[];for(let c of a)c.name===f&&b.push(c.node.text);return 0===b.length?!e:b.every(a=>h.includes(a))===e})}function parseIsPredicate(a,b,c,d,e){if(a.length<2||a.length>3)throw Error(`Wrong number of arguments to \`#${c}\` predicate. Expected 1 or 2. Got ${a.length-1}.`);if(!a.every(isStringStep))throw Error(`Arguments to \`#${c}\` predicate must be strings.".`);let f="is?"===c?d:e;f[b]||(f[b]={}),f[b][a[1].value]=a[2]?.value??null}function parseSetDirective(a,b,c){if(a.length<2||a.length>3)throw Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${a.length-1}.`);if(!a.every(isStringStep))throw Error('Arguments to `#set!` predicate must be strings.".');c[b]||(c[b]={}),c[b][a[1].value]=a[2]?.value??null}function parsePattern(a,b,c,d,e,f,g,h,i,j,k){if(b===PREDICATE_STEP_TYPE_CAPTURE){let a=d[c];f.push({type:"capture",name:a})}else if(b===PREDICATE_STEP_TYPE_STRING)f.push({type:"string",value:e[c]});else if(f.length>0){if("string"!==f[0].type)throw Error("Predicates must begin with a literal value");let b=f[0].value;switch(b){case"any-not-eq?":case"not-eq?":case"any-eq?":case"eq?":parseAnyPredicate(f,a,b,g);break;case"any-not-match?":case"not-match?":case"any-match?":case"match?":parseMatchPredicate(f,a,b,g);break;case"not-any-of?":case"any-of?":parseAnyOfPredicate(f,a,b,g);break;case"is?":case"is-not?":parseIsPredicate(f,a,b,j,k);break;case"set!":parseSetDirective(f,a,i);break;default:h[a].push({operator:b,operands:f.slice(1)})}f.length=0}}__name(parseAnyPredicate,"parseAnyPredicate"),__name(parseMatchPredicate,"parseMatchPredicate"),__name(parseAnyOfPredicate,"parseAnyOfPredicate"),__name(parseIsPredicate,"parseIsPredicate"),__name(parseSetDirective,"parseSetDirective"),__name(parsePattern,"parsePattern");var Query=class{static{__name(this,"Query")}0=0;exceededMatchLimit;textPredicates;captureNames;captureQuantifiers;predicates;setProperties;assertedProperties;refutedProperties;matchLimit;constructor(a,b){const c=C.lengthBytesUTF8(b),d=C._malloc(c+1);C.stringToUTF8(b,d,c+1);const e=C._ts_query_new(a[0],d,c,TRANSFER_BUFFER,TRANSFER_BUFFER+SIZE_OF_INT);if(!e){const a=C.getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),c=C.getValue(TRANSFER_BUFFER,"i32"),e=C.UTF8ToString(d,c).length,f=b.slice(e,e+100).split("\n")[0],g=f.match(QUERY_WORD_REGEX)?.[0]??"";switch(C._free(d),a){case QueryErrorKind.Syntax:throw new QueryError(QueryErrorKind.Syntax,{suffix:`${e}: '${f}'...`},e,0);case QueryErrorKind.NodeName:case QueryErrorKind.FieldName:case QueryErrorKind.CaptureName:throw new QueryError(a,{word:g},e,g.length);case QueryErrorKind.PatternStructure:throw new QueryError(a,{suffix:`${e}: '${f}'...`},e,0)}}const f=C._ts_query_string_count(e),g=C._ts_query_capture_count(e),h=C._ts_query_pattern_count(e),i=Array(g),j=Array(h),k=Array(f);for(let a=0;a<g;a++){const b=C._ts_query_capture_name_for_id(e,a,TRANSFER_BUFFER),c=C.getValue(TRANSFER_BUFFER,"i32");i[a]=C.UTF8ToString(b,c)}for(let a=0;a<h;a++){const b=Array(g);for(let c=0;c<g;c++){const d=C._ts_query_capture_quantifier_for_id(e,a,c);b[c]=d}j[a]=b}for(let a=0;a<f;a++){const b=C._ts_query_string_value_for_id(e,a,TRANSFER_BUFFER),c=C.getValue(TRANSFER_BUFFER,"i32");k[a]=C.UTF8ToString(b,c)}const l=Array(h),m=Array(h),n=Array(h),o=Array(h),p=Array(h);for(let a=0;a<h;a++){const b=C._ts_query_predicates_for_pattern(e,a,TRANSFER_BUFFER),c=C.getValue(TRANSFER_BUFFER,"i32");o[a]=[],p[a]=[];const d=[];let f=b;for(let b=0;b<c;b++){const b=C.getValue(f,"i32");f+=SIZE_OF_INT;const c=C.getValue(f,"i32");f+=SIZE_OF_INT,parsePattern(a,b,c,i,k,d,p,o,l,m,n)}Object.freeze(p[a]),Object.freeze(o[a]),Object.freeze(l[a]),Object.freeze(m[a]),Object.freeze(n[a])}C._free(d),this[0]=e,this.captureNames=i,this.captureQuantifiers=j,this.textPredicates=p,this.predicates=o,this.setProperties=l,this.assertedProperties=m,this.refutedProperties=n,this.exceededMatchLimit=!1}delete(){C._ts_query_delete(this[0]),this[0]=0}matches(a,b={}){let c=b.startPosition??ZERO_POINT,d=b.endPosition??ZERO_POINT,e=b.startIndex??0,f=b.endIndex??0,g=b.startContainingPosition??ZERO_POINT,h=b.endContainingPosition??ZERO_POINT,i=b.startContainingIndex??0,j=b.endContainingIndex??0,k=b.matchLimit??0xffffffff,l=b.maxStartDepth??0xffffffff,m=b.progressCallback;if("number"!=typeof k)throw Error("Arguments must be numbers");if(this.matchLimit=k,0!==f&&e>f)throw Error("`startIndex` cannot be greater than `endIndex`");if(d!==ZERO_POINT&&(c.row>d.row||c.row===d.row&&c.column>d.column))throw Error("`startPosition` cannot be greater than `endPosition`");if(0!==j&&i>j)throw Error("`startContainingIndex` cannot be greater than `endContainingIndex`");if(h!==ZERO_POINT&&(g.row>h.row||g.row===h.row&&g.column>h.column))throw Error("`startContainingPosition` cannot be greater than `endContainingPosition`");m&&(C.currentQueryProgressCallback=m),marshalNode(a),C._ts_query_matches_wasm(this[0],a.tree[0],c.row,c.column,d.row,d.column,e,f,g.row,g.column,h.row,h.column,i,j,k,l);let n=C.getValue(TRANSFER_BUFFER,"i32"),o=C.getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),p=C.getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),q=Array(n);this.exceededMatchLimit=!!p;let r=0,s=o;for(let b=0;b<n;b++){let b=C.getValue(s,"i32");s+=SIZE_OF_INT;let c=C.getValue(s,"i32");s+=SIZE_OF_INT;let d=Array(c);if(s=unmarshalCaptures(this,a.tree,s,b,d),this.textPredicates[b].every(a=>a(d))){q[r]={patternIndex:b,captures:d};let a=this.setProperties[b];q[r].setProperties=a;let c=this.assertedProperties[b];q[r].assertedProperties=c;let e=this.refutedProperties[b];q[r].refutedProperties=e,r++}}return q.length=r,C._free(o),C.currentQueryProgressCallback=null,q}captures(a,b={}){let c=b.startPosition??ZERO_POINT,d=b.endPosition??ZERO_POINT,e=b.startIndex??0,f=b.endIndex??0,g=b.startContainingPosition??ZERO_POINT,h=b.endContainingPosition??ZERO_POINT,i=b.startContainingIndex??0,j=b.endContainingIndex??0,k=b.matchLimit??0xffffffff,l=b.maxStartDepth??0xffffffff,m=b.progressCallback;if("number"!=typeof k)throw Error("Arguments must be numbers");if(this.matchLimit=k,0!==f&&e>f)throw Error("`startIndex` cannot be greater than `endIndex`");if(d!==ZERO_POINT&&(c.row>d.row||c.row===d.row&&c.column>d.column))throw Error("`startPosition` cannot be greater than `endPosition`");if(0!==j&&i>j)throw Error("`startContainingIndex` cannot be greater than `endContainingIndex`");if(h!==ZERO_POINT&&(g.row>h.row||g.row===h.row&&g.column>h.column))throw Error("`startContainingPosition` cannot be greater than `endContainingPosition`");m&&(C.currentQueryProgressCallback=m),marshalNode(a),C._ts_query_captures_wasm(this[0],a.tree[0],c.row,c.column,d.row,d.column,e,f,g.row,g.column,h.row,h.column,i,j,k,l);let n=C.getValue(TRANSFER_BUFFER,"i32"),o=C.getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),p=C.getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),q=[];this.exceededMatchLimit=!!p;let r=[],s=o;for(let b=0;b<n;b++){let b=C.getValue(s,"i32");s+=SIZE_OF_INT;let c=C.getValue(s,"i32");s+=SIZE_OF_INT;let d=C.getValue(s,"i32");if(s+=SIZE_OF_INT,r.length=c,s=unmarshalCaptures(this,a.tree,s,b,r),this.textPredicates[b].every(a=>a(r))){let a=r[d];a.setProperties=this.setProperties[b],a.assertedProperties=this.assertedProperties[b],a.refutedProperties=this.refutedProperties[b],q.push(a)}}return C._free(o),C.currentQueryProgressCallback=null,q}predicatesForPattern(a){return this.predicates[a]}disableCapture(a){let b=C.lengthBytesUTF8(a),c=C._malloc(b+1);C.stringToUTF8(a,c,b+1),C._ts_query_disable_capture(this[0],c,b),C._free(c)}disablePattern(a){if(a>=this.predicates.length)throw Error(`Pattern index is ${a} but the pattern count is ${this.predicates.length}`);C._ts_query_disable_pattern(this[0],a)}didExceedMatchLimit(){return this.exceededMatchLimit}startIndexForPattern(a){if(a>=this.predicates.length)throw Error(`Pattern index is ${a} but the pattern count is ${this.predicates.length}`);return C._ts_query_start_byte_for_pattern(this[0],a)}endIndexForPattern(a){if(a>=this.predicates.length)throw Error(`Pattern index is ${a} but the pattern count is ${this.predicates.length}`);return C._ts_query_end_byte_for_pattern(this[0],a)}patternCount(){return C._ts_query_pattern_count(this[0])}captureIndexForName(a){return this.captureNames.indexOf(a)}isPatternRooted(a){return 1===C._ts_query_is_pattern_rooted(this[0],a)}isPatternNonLocal(a){return 1===C._ts_query_is_pattern_non_local(this[0],a)}isPatternGuaranteedAtStep(a){return 1===C._ts_query_is_pattern_guaranteed_at_step(this[0],a)}}}};
|
|
Binary file
|
/package/.next-prod/static/{yaVe-Z92QwkIrhkztzo43 → 34fvdBz-F3Orx91-TIIGP}/_buildManifest.js
RENAMED
|
File without changes
|
|
File without changes
|