From d8c9a4713faf3ea0d7b6ad045d5f9b9602602ba1 Mon Sep 17 00:00:00 2001 From: maxgfr <25312957+maxgfr@users.noreply.github.com> Date: Wed, 30 Sep 2026 19:22:33 +0200 Subject: [PATCH] fix(js-ts): keep the `export default Foo;` pass linear on comment runs DEFAULT_ID_RE matched the whitespace around the line with `\s*`. Comments are blanked to spaces and newlines before it runs, so from every line the leading `\s*` crossed all the blank lines after it before failing: 20,000 comment lines took ~8 s, 50,000 ~33 s. Match horizontal whitespace only and end the line on `\r?\n`, so CRLF files still read. --- scripts/engine.browser.mjs | 2 +- scripts/engine.mjs | 2 +- src/lang/js-ts.ts | 4 +++- tests/regex-tier.test.ts | 18 ++++++++++++++++++ 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/scripts/engine.browser.mjs b/scripts/engine.browser.mjs index a5d0622..90c9bba 100644 --- a/scripts/engine.browser.mjs +++ b/scripts/engine.browser.mjs @@ -11,7 +11,7 @@ var lb=Object.defineProperty;var U=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&( `)){let s=r.trim();if(n){n=!s.includes("*/");continue}if(!s||s.startsWith("//"))continue;if(s.startsWith("/*")){n=!s.includes("*/");continue}let o=/^package[ \t]+(object[ \t]+)?([\w.`]+)/.exec(s);if(!o||(t.push(o[2].replace(/`/g,"")),o[1]))break}return t.length?t.join("."):void 0}function em(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===95||e===lm||e>127}function _r(e){let t=e.length,n=new ni(e),r=[],s=0,o=c=>{let d=c;for(;d{let d=c-1;for(;d>=0&&n.codeAt(d)<=am;)d--;if(d<0)return!0;let u=n.codeAt(d);if(qw.has(u))return!0;if(!em(u))return!1;let f=d;for(;f>0&&em(e.charCodeAt(f-1));)f--;return Vw.has(e.slice(f,d+1))},l=0;for(;l0&&e.charCodeAt(l-1)===Ac;)l--;let c=s-l;if(t.raw==="r"?/[rR]$/.test(e.slice(Math.max(0,l-2),l)):c>0){let u=e.indexOf('"'+"#".repeat(c),s+1),f=u===-1?n:u;r.blank(s+1,f),s=u===-1?n:u+1+c;continue}}let a=o===Ys||o===ea&&t.squote==="string";if(a||o===ti&&t.backtick){let l=a&&t.triple&&e.charCodeAt(s+1)===o&&e.charCodeAt(s+2)===o,c=s+(l?3:1),d=c;if(l){let f=e.indexOf(o===Ys?'"""':"'''",c);d=f===-1?n:f}else for(;d{n.get(o)===!0&&n.delete(o),n.set(o,!1)},s=o=>{n.has(o)||n.set(o,!0)};if(Pw.has(e)){if(!t.includes("import")&&!t.includes("require")&&!t.includes("from"))return[];let o=_r(t);for(let a of[Kw,Xw,Zw,Yw]){a.lastIndex=0;for(let l;l=a.exec(o);){let[c,d]=l.indices[1];r(t.slice(c,d))}}}else if(Dw.has(e)){if(!t.includes("import"))return[];let o=Jw(t);nm.lastIndex=0;for(let a;a=nm.exec(o);){let l=a[1];if(l!==void 0){if(r(l),!l||l==="__future__")continue;let c=a[2].startsWith("(")?a[2].slice(1,-1):a[2].replace(/\\\r?\n/g," ");for(let d of c.split(",")){let u=d.trim().split(/\s+as\s+/)[0].trim();/^[A-Za-z_]\w*$/.test(u)&&s(tx(l,u))}continue}for(let c of a[3].split(",")){let d=c.trim().split(/\s+as\s+/)[0].trim();d&&/^[\w.]+$/.test(d)&&r(d)}}}else if(e===".go"){let o=t.split(/\r?\n/),a=!1;for(let l of o){let c=l.trim();if(a){if(c===")"){a=!1;continue}let u=/"([^"]+)"/.exec(c);u&&r(u[1]);continue}if(/^import\s*\($/.test(c)){a=!0;continue}let d=/^import\s+(?:[\w.]+\s+)?"([^"]+)"/.exec(c);d&&r(d[1])}}else if(e===".rs"){let o,a=new Set,l=/#\[\s*path\s*=\s*"([^"]+)"\s*\]\s*(?:(?:#\[[^\]]*\]|\/\/[^\n]*)\s*)*(?:pub(?:\([^)]*\))?\s+)?mod\s+[A-Za-z_]\w*\s*;/g;for(;o=l.exec(t);)r(`mod-path ${o[1]}`),a.add(o.index+o[0].length);let c=/^\s*(?:pub(?:\([^)]*\))?\s+)?mod\s+([A-Za-z_]\w*)\s*;/gm;for(;o=c.exec(t);)a.has(o.index+o[0].length)||r(`mod ${o[1]}`);let d=/^\s*(?:pub(?:\([^)]*\))?\s+)?use\s+([^;]+);/gm;for(;o=d.exec(t);)for(let u of Mc(o[1].trim()))r(u)}else if(e===".java"){let o,a=/^\s*import\s+(?:static\s+)?([\w.]+(?:\.\*)?)\s*;/gm;for(;o=a.exec(t);)r(o[1])}else if(e===".rb"||e===".rake"){let o,a=/^\s*require_relative\s+['"]([^'"]+)['"]/gm;for(;o=a.exec(t);)r(Rc(o[1]));let l=/^\s*require\s+['"]([^'"]+)['"]/gm;for(;o=l.exec(t);)r(o[1])}else if(Lw.has(e)){let o,a=/^\s*#\s*include\s*"([^"]+)"/gm;for(;o=a.exec(t);)r(o[1])}else if(e===".php"){let o,a=Qw.exec(t)?.index??1/0;for(rm.lastIndex=0;o=rm.exec(t);){if(o[1]&&o.index>a)continue;let l=o[2].trim().replace(/^(?:function|const)\s+/,""),c=/^\\?([\w\\]*?)\\?\s*\{([^}]*)\}$/.exec(l),d=c?c[2].split(",").map(u=>`${c[1]}\\${u.trim()}`):l.split(",");for(let u of d){let f=u.trim().replace(/\\(?:function|const)\s+/,"\\").replace(/\s+as\s+\w+$/,"").replace(/^\\/,"");ex.test(f)&&r(f)}}for(sm.lastIndex=0;o=sm.exec(t);){let{here:l,up:c,levels:d,path:u}=o.groups;r(l?Rc(u.replace(/^\/+/,"")):c?"../".repeat(Number(d??1))+u.replace(/^\/+/,""):Rc(u))}}else if(e===".cs"){let o,a=/^\s*(?:global\s+)?using\s+(?:static\s+)?([A-Za-z_][\w.]*)\s*;/gm;for(;o=a.exec(t);)r(o[1])}else if(im.has(e)){let o,a=/^[ \t]*import[ \t]+([\w.`*]+)/gm;for(;o=a.exec(t);){let l=Cc(o[1]);l&&r(l)}}else if(om.has(e)){let o,a=/^[ \t]*import[ \t]+((?:[^\n;{]|\{[^}]*\})+)/gm;for(;o=a.exec(t);){let l=[],c=0,d="";for(let u of o[1].replace(/\/\/.*$/gm,""))u==="{"?c++:u==="}"&&c--,u===","&&c===0?(Zf(d,l),d=""):d+=u;Zf(d,l);for(let u of l)r(u)}}else if(e===".dart"){let o,a=/^[ \t]*(?:import|export|part)[ \t]+(?:'([^'\n]+)'|"([^"\n]+)")/gm;for(;o=a.exec(t);)r(o[1]??o[2])}else if(e===".lua"){let o,a=/\brequire\s*\(?\s*['"]([\w-]+(?:[./][\w-]+)*)['"]/g;for(;o=a.exec(t);)r(o[1])}else if(jw.has(e)){let o,a=/(?:^|[;&|]|\b(?:then|do|else)\b)[ \t]*(?:source|\.)[ \t]+([^\n]+)/gm;for(;o=a.exec(t);){let l=Bw(o[1]);l&&r(l)}}else if(e===".ex"||e===".exs"){let o,a=/^[ \t]*(?:alias|import|require|use)[ \t]+([A-Z]\w*(?:\.[A-Z]\w*)*)(?:\.\{([^}]*)\})?/gm;for(;o=a.exec(t);){if(o[2]===void 0){r(o[1]);continue}let l=0;for(let c of o[2].split(",")){let d=c.trim();/^[A-Z]\w*(?:\.[A-Z]\w*)*$/.test(d)&&l++a?{kind:"import",spec:o,soft:!0}:{kind:"import",spec:o})}function ta(e,t){if(e===".java")return/^\s*package\s+([\w.]+)\s*;/m.exec(t)?.[1];if(e===".cs")return/^\s*(?:file-scoped\s+)?namespace\s+([\w.]+)/m.exec(t)?.[1];if(im.has(e)){let n=/^[ \t]*package[ \t]+([\w.`]+)/m.exec(t);return n?n[1].replace(/`/g,""):void 0}if(om.has(e))return Uw(t)}var Pw,Dw,Lw,im,om,jw,Qo,Ww,ni,Yf,ri,am,Ac,lm,ea,Ys,Qs,Sn,Hw,ei,zw,ti,Qf,Gw,qw,Vw,tm,Yo,vc,Kw,Xw,Zw,Yw,nm,Qw,rm,ex,sm,ct=U(()=>{"use strict";A();Pw=new Set([".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"]),Dw=new Set([".py",".pyi"]),Lw=new Set([".c",".h",".cc",".cpp",".cxx",".hpp",".hh"]),im=new Set([".kt",".kts"]),om=new Set([".scala",".sc"]),jw=new Set([".sh",".bash",".zsh",".ksh",".fish"]),Qo=16;Ww=/^(["']?)(?:\$\(\s*dirname\s+(["']?)\$(?:0|\{BASH_SOURCE(?:\[0\])?\}|BASH_SOURCE)\2\s*\)|\$\{(?:BASH_SOURCE(?:\[0\])?|0)%\/\*\})\//;ni=class{constructor(t){this.src=t}src;codes;blank(t,n){if(n<=t)return;let r=this.codes;if(!r){r=this.codes=new Uint16Array(this.src.length);for(let s=0;s~^"].map(e=>e.charCodeAt(0))),Vw=new Set(["return","typeof","instanceof","in","of","new","delete","void","throw","case","do","else","yield","await"]),tm=/\bimport\(\s*['"][^'"\n]*['"]\s*[,)]|@import\b[^'"@]{0,2048}?\bfrom\s*['"][^'"\n]*['"]/g;Yo=/'(?:\\(?:u\{[0-9A-Fa-f]{1,6}\}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{2}|.)|[^\\'\n])'/y;vc="[\\w$\\u00a0-\\uffff]+",Kw=new RegExp(`(?:^|[^\\w$.])(?:import|export)\\b\\s*(?:(?:type|typeof|defer|source)\\s+)?(?:${vc}\\s*,\\s*)?(?:${vc}|\\*\\s*(?:as\\s+${vc})?|\\{[^{}]*\\})\\s*from\\s*['"]([^'"]+)['"]`,"dg"),Xw=/(?:^|[\n;])[ \t]*import\s*['"]([^'"]+)['"]/dg,Zw=/\brequire\(\s*['"]([^'"]+)['"]\s*\)/dg,Yw=/\bimport\(\s*['"]([^'"]+)['"]\s*[,)]/dg,nm=/(?:^|;)[ \t]*(?:from[ \t]+(\.*[\w.]*)[ \t]+import\b[ \t]*(\([^)]*\)|(?:\\\r?\n|[^\n;])*)|import[ \t]+([^\n;]*))/gm,Qw=/^[ \t]*(?:(?:abstract|final|readonly)[ \t]+)*(?:class|interface|trait|enum)[ \t]+[A-Za-z_]/m,rm=/^([ \t]*)use\s+([^;]*);/gm,ex=/^[A-Za-z_][\w\\]*$/,sm=/\b(?:require|include)(?:_once)?\s*\(?\s*(?:(?__DIR__|dirname\(\s*__FILE__\s*\))\s*\.\s*|(?dirname\(\s*__DIR__\s*(?:,\s*(?\d+)\s*)?\))\s*\.\s*)?['"](?[^'"]+)['"]/g});function ix(e){return(e.split("/").pop()??"").replace(/\.[^.]+$/,"")}function ox(e,t){let n=o=>{if(!(!o||o==="default"))for(let a of t)a.name===o&&(a.exported=!0)},r=(o,a)=>{for(let l of o.split(",")){let c=l.trim().replace(/^type\s+/,"");if(!c)continue;let d=/^([\w$]+)\s+as\s+([\w$]+)$/.exec(c);if(d){d[2]!=="default"&&n(d[1]);continue}if(a){let u=/^([\w$]+)\s*:\s*([\w$]+)$/.exec(c);if(u){n(u[1]),n(u[2]);continue}}n(/^([\w$]+)/.exec(c)?.[1])}},s;for(cm.lastIndex=0;s=cm.exec(e);)s[2]||r(s[1]??"",!1);for(dm.lastIndex=0;s=dm.exec(e);)r(s[1]??"",!0);for(um.lastIndex=0;s=um.exec(e);)n(s[2])}var rt,Tc,Et,tt,nx,rx,sx,cm,dm,um,fm,mm=U(()=>{"use strict";A();ct();et();rt=`(?${ke})`,Tc=String.raw`function(?:\s*\*\s*|\s+)`,Et=String.raw`(?:declare\s+)?`,tt=e=>new RegExp(e,"u"),nx=[{re:tt(String.raw`^\s*export\s+${Et}(?:async\s+)?${Tc}${rt}`),kind:"function",exported:!0},{re:tt(String.raw`^\s*export\s+default\s+(?:async\s+)?${Tc}${rt}`),kind:"function",exported:!0},{re:tt(String.raw`^\s*export\s+default\s+(?:abstract\s+)?class\s+(?!extends\b)${rt}`),kind:"class",exported:!0},{re:tt(String.raw`^\s*${Et}(?:async\s+)?${Tc}${rt}`),kind:"function",exported:!1},{re:tt(String.raw`^\s*export\s+${Et}(?:abstract\s+)?class\s+${rt}`),kind:"class",exported:!0},{re:tt(String.raw`^\s*${Et}(?:abstract\s+)?class\s+${rt}`),kind:"class",exported:!1},{re:tt(String.raw`^\s*export\s+${Et}interface\s+${rt}`),kind:"interface",exported:!0},{re:tt(String.raw`^\s*${Et}interface\s+${rt}`),kind:"interface",exported:!1},{re:tt(String.raw`^\s*export\s+${Et}type\s+${rt}`),kind:"type",exported:!0},{re:tt(String.raw`^\s*${Et}type\s+${rt}\s*[=<]`),kind:"type",exported:!1},{re:tt(String.raw`^\s*export\s+${Et}(?:const\s+)?enum\s+${rt}`),kind:"enum",exported:!0},{re:tt(String.raw`^\s*export\s+${Et}(?:namespace|module)\s+(?${ke}(?:\.${ke})*)`),kind:"namespace",exported:!0},{re:tt(String.raw`^\s*${Et}(?:namespace|module)\s+(?${ke}(?:\.${ke})*)\s*\{`),kind:"namespace",exported:!1},{re:tt(String.raw`^\s*export\s+${Et}(?:const|let|var)\s+${rt}\s*[:=;]`),kind:"const",exported:!0},{re:tt(String.raw`^\s*exports\.${rt}\s*=`),kind:"const",exported:!0},{re:tt(String.raw`^\s*module\.exports\.${rt}\s*=`),kind:"const",exported:!0},{re:tt(String.raw`^\s*(?:const|let)\s+${rt}\s*=\s*(?:async\s*)?\([^)]*\)\s*(?::[^=]+)?=>`),kind:"const",exported:!1},{re:tt(String.raw`^${Et}(?:const|let|var)\s+${rt}\s*[:=]`),kind:"const",exported:!1},{re:tt(String.raw`^\s*export\s+default\s+${rt}\s*;?\s*$`),kind:"default",exported:!0}],rx=/^\s*export\s+default\s+(?:async\s+)?(?:function|class)?\s*(?:\(|\{|extends\b)/,sx=/^\s*export\s+default\s+(?:async\s+)?(?:function|class)\s+(?!extends\b)[\w$]+/;cm=/export\s*\{([^}]*)\}\s*(from\b)?/g,dm=/module\.exports\s*=\s*\{([^}]*)\}/g,um=/(^|\n)\s*export(?:\s+default\s+|\s*=\s*)([A-Za-z_$][\w$]*)\s*;?\s*(?=\n|$)/g;fm={lang:"javascript/typescript",exts:[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],lexis:{mask:_r,comment:/^\s*\/\//,block:!0,decoration:/^\s*@/},extract(e,t,n=t){let r=e.match(/\.(ts|tsx|mts|cts)$/)?"typescript":"javascript",s=Se(e,t,r,nx,n),o=n.split(/\r?\n/);for(let a=0;a{"use strict";A();et();na=e=>!e.startsWith("_")||e.startsWith("__"),ax=[{re:/^(?:async\s+)?def\s+(?[\w]+)\s*\(/,kind:"function",exported:e=>na(e.groups.name)},{re:/^\s+(?:async\s+)?def\s+(?[\w]+)\s*\(/,kind:"method",exported:e=>na(e.groups.name)},{re:/^class\s+(?[\w]+)/,kind:"class",exported:e=>na(e.groups.name)},{re:/^\s+class\s+(?[\w]+)/,kind:"class",exported:e=>na(e.groups.name)}],pm={lang:"python",exts:[".py",".pyi"],lexis:{comment:/^\s*#(?!!)/,decoration:/^\s*@/},extract(e,t){return Se(e,t,"python",ax)}}});function hm(e){return[{re:new RegExp(String.raw`${e}(?${ke})${ra}\s+struct\b`,"u"),kind:"struct",exported:kn},{re:new RegExp(String.raw`${e}(?${ke})${ra}\s+interface\b`,"u"),kind:"interface",exported:kn},{re:new RegExp(String.raw`${e}(?${ke})${ra}\s+`,"u"),kind:"type",exported:kn}]}function fx(e,t,n){let r=[],s=t.split(/\r?\n/),o=n.split(/\r?\n/);for(let a=0;a{"use strict";A();ct();et();lx=e=>/^\p{Lu}/u.test(e),kn=e=>lx(e.groups.name),ra=String.raw`(?:\[[^\]]*\])?`,cx=[{re:new RegExp(String.raw`^func\s+\([^)]*\)\s+(?${ke})\s*\(`,"u"),kind:"method",exported:kn},{re:new RegExp(String.raw`^func\s+(?${ke})${ra}\s*\(`,"u"),kind:"function",exported:kn},...hm("^type\\s+"),{re:new RegExp(String.raw`^const\s+(?(?!_\b)${ke})`,"u"),kind:"const",exported:kn},{re:new RegExp(String.raw`^var\s+(?(?!_\b)${ke})`,"u"),kind:"var",exported:kn}];dx=/^(const|var|type)\s*\(\s*$/,ux={const:[{re:new RegExp(String.raw`^\s+(?(?!_\b)${ke})\b`,"u"),kind:"const",exported:kn}],var:[{re:new RegExp(String.raw`^\s+(?(?!_\b)${ke})\b`,"u"),kind:"var",exported:kn}],type:hm("^\\s+")};ym={lang:"go",exts:[".go"],lexis:{mask:e=>Ke(e,{squote:"char",backtick:!0}),comment:/^\s*\/\//,block:!0},extract(e,t,n){let r=Se(e,t,"go",cx,n),s=n===void 0?[]:fx(e,t,n);return s.length?[...r,...s].sort((o,a)=>o.line-a.line):r}}});var mx,bm,wm=U(()=>{"use strict";A();et();mx=[{re:/^\s*def\s+(?:self\.)?(?[\w?!=]+)/,kind:"method",exported:!0},{re:/^\s*(?public|private|protected|module_function|(?:public|private)_class_method)\s+def\s+(?:self\.)?(?[\w?!=]+)/,kind:"method",exported:e=>/^(public|module_function|public_class_method)$/.test(e.groups.vis)},{re:/^\s*class\s+(?[\w:]+)/,kind:"class",exported:!0},{re:/^\s*module\s+(?[\w:]+)/,kind:"module",exported:!0}],bm={lang:"ruby",exts:[".rb",".rake"],lexis:{comment:/^\s*#(?![!{])/},extract(e,t){return Se(e,t,"ruby",mx)}}});var px,xm,Sm=U(()=>{"use strict";A();ct();et();px=[{re:/^\s*(?:public|protected|private)?\s*(?:abstract\s+|final\s+)?class\s+(?[\w]+)/,kind:"class",exported:(e,t)=>/\bpublic\b/.test(t)},{re:/^\s*(?:public|protected|private)?\s*interface\s+(?[\w]+)/,kind:"interface",exported:(e,t)=>/\bpublic\b/.test(t)},{re:/^\s*(?:public|protected|private)?\s*enum\s+(?[\w]+)/,kind:"enum",exported:(e,t)=>/\bpublic\b/.test(t)},{re:/^\s*(?:public|protected|private)\s+(?:static\s+|final\s+|abstract\s+|synchronized\s+)*[\w<>\[\],.?\s]+\s+(?[\w]+)\s*\(/,kind:"method",exported:(e,t)=>/\bpublic\b/.test(t)}],xm={lang:"java",exts:[".java"],lexis:{mask:e=>Ke(e,{triple:!0,squote:"char"}),comment:/^\s*\/\//,block:!0,decoration:/^\s*@/},extract(e,t,n){return Se(e,t,"java",px,n)}}});var ii,gx,km,Em=U(()=>{"use strict";A();ct();et();ii=(e,t)=>/^\s*pub\b/.test(t),gx=[{re:/^\s*(?:pub(?:\([^)]*\))?\s+)?(?:async\s+)?(?:unsafe\s+)?fn\s+(?[\w]+)/,kind:"function",exported:ii},{re:/^\s*(?:pub(?:\([^)]*\))?\s+)?struct\s+(?[\w]+)/,kind:"struct",exported:ii},{re:/^\s*(?:pub(?:\([^)]*\))?\s+)?enum\s+(?[\w]+)/,kind:"enum",exported:ii},{re:/^\s*(?:pub(?:\([^)]*\))?\s+)?trait\s+(?[\w]+)/,kind:"trait",exported:ii},{re:/^\s*(?:pub(?:\([^)]*\))?\s+)?type\s+(?[\w]+)/,kind:"type",exported:ii}],km={lang:"rust",exts:[".rs"],lexis:{mask:e=>Ke(e,{nested:!0,squote:"char",multiline:!0,raw:"r"}),comment:/^\s*\/\/(?!!)/,block:!0,decoration:/^\s*#\[/},extract(e,t,n){return Se(e,t,"rust",gx,n)}}});var oi,hx,vm,Rm=U(()=>{"use strict";A();ct();et();oi=(e,t)=>/\b(public|internal)\b/.test(t),hx=[{re:/^\s*(?:public|internal|protected|private)?\s*(?:static\s+|sealed\s+|abstract\s+|partial\s+)*(?:class|record)\s+(?\w+)/,kind:"class",exported:oi},{re:/^\s*(?:public|internal|protected|private)?\s*(?:partial\s+)?interface\s+(?\w+)/,kind:"interface",exported:oi},{re:/^\s*(?:public|internal|protected|private)?\s*(?:readonly\s+)?(?:ref\s+)?struct\s+(?\w+)/,kind:"struct",exported:oi},{re:/^\s*(?:public|internal|protected|private)?\s*enum\s+(?\w+)/,kind:"enum",exported:oi},{re:/^\s*(?:public|internal|protected|private)\s+(?:static\s+|virtual\s+|override\s+|async\s+|sealed\s+|abstract\s+|new\s+)*[\w<>\[\],.?]+\s+(?\w+)\s*(?:<[^>]*>)?\s*\(/,kind:"method",exported:oi}],vm={lang:"csharp",exts:[".cs"],lexis:{mask:e=>Ke(e,{squote:"char"}),comment:/^\s*\/\//,block:!0,decoration:/^\s*\[/},extract(e,t,n){return Se(e,t,"csharp",hx,n)}}});var yx,Mm,Cm=U(()=>{"use strict";A();ct();et();yx=[{re:/^\s*(?:abstract\s+|final\s+)*class\s+(?\w+)/,kind:"class",exported:!0},{re:/^\s*interface\s+(?\w+)/,kind:"interface",exported:!0},{re:/^\s*trait\s+(?\w+)/,kind:"trait",exported:!0},{re:/^\s*enum\s+(?\w+)/,kind:"enum",exported:!0},{re:/^\s*(?:public\s+|protected\s+|private\s+|static\s+|abstract\s+|final\s+)*function\s+(?\w+)\s*\(/,kind:"function",exported:(e,t)=>!/\b(private|protected)\b/.test(t)}],Mm={lang:"php",exts:[".php"],lexis:{mask:e=>Ke(e,{hash:!0,squote:"string",multiline:!0}),comment:/^\s*(?:\/\/|#(?!\[))/,block:!0,decoration:/^\s*#\[/},extract(e,t,n){return Se(e,t,"php",yx,n)}}});var ss,_x,bx,is,br,wx,Am,Tm=U(()=>{"use strict";A();ct();et();ss=(e,t)=>!/\b(?:private|fileprivate)\b(?!\s*\(\s*set\s*\))/.test(t),_x=String.raw`(?:@${ke}(?:\([^)]*\))?\s+)*`,bx=String.raw`(?:(?:public|open|internal|private|fileprivate|package|final|static|class|override|mutating|nonmutating|convenience|required|dynamic|lazy|weak|unowned|indirect|nonisolated|isolated|distributed|optional|prefix|postfix|infix|async)(?:\([^)]*\))?\s+)*`,is=String.raw`^\s*${_x}${bx}`,br=(e,t,n={})=>({re:new RegExp(String.raw`${is}${e}\s+(?!(?:func|var|let|subscript|init)\b)(?${ke})`,"u"),kind:t,exported:ss,...n}),wx=[br("class","class"),br("struct","struct"),br("enum","enum"),br("protocol","protocol"),br("actor","actor"),{re:new RegExp(String.raw`${is}extension\s+(?${ke}(?:\.${ke})*)`,"u"),kind:"extension",exported:ss},br("typealias","type"),br("func","function"),{re:new RegExp(String.raw`${is}(?init)[?!]?\s*[<(]`,"u"),kind:"constructor",exported:ss},{re:new RegExp(String.raw`${is}(?deinit)\s*\{`,"u"),kind:"destructor",exported:ss},{re:new RegExp(String.raw`${is}(?subscript)\s*[<(]`,"u"),kind:"method",exported:ss},{re:new RegExp(String.raw`${is}(?:let|var)\s+(?${ke})\s*[:={]`,"u"),kind:"property",exported:ss,scope:"member"}],Am={lang:"swift",exts:[".swift"],lexis:{mask:e=>Ke(e,{nested:!0,triple:!0,squote:"none",raw:"#"}),comment:/^\s*\/\//,block:!0,decoration:/^\s*@/},extract(e,t,n){return Se(e,t,"swift",wx,n)}}});var Bn,xx,Sx,Un,Im,kx,$m,Fm=U(()=>{"use strict";A();ct();et();Bn=(e,t)=>!/\bprivate\b/.test(t),xx=String.raw`(?:@[\w.:]+(?:\([^)]*\))?\s+)*`,Sx=String.raw`(?:(?:public|internal|private|protected|abstract|sealed|open|final|data|value|inline|inner|override|suspend|operator|infix|tailrec|external|lateinit|expect|actual|const|companion|enum|annotation)\s+)*`,Un=String.raw`^\s*${xx}${Sx}`,Im=String.raw`(?:${ke}(?:<[^()=]*>)?\??\.)*`,kx=[{re:new RegExp(String.raw`${Un}enum\s+class\s+(?${ke})`,"u"),kind:"enum",exported:Bn},{re:new RegExp(String.raw`${Un}annotation\s+class\s+(?${ke})`,"u"),kind:"annotation",exported:Bn},{re:new RegExp(String.raw`${Un}class\s+(?${ke})`,"u"),kind:"class",exported:Bn},{re:new RegExp(String.raw`${Un}(?:fun\s+)?interface\s+(?${ke})`,"u"),kind:"interface",exported:Bn},{re:new RegExp(String.raw`${Un}object\s+(?${ke})`,"u"),kind:"object",exported:Bn},{re:new RegExp(String.raw`${Un}typealias\s+(?${ke})`,"u"),kind:"type",exported:Bn},{re:new RegExp(String.raw`${Un}fun\s+(?:<[^>]*(?:>[^>]*)?>\s*)?${Im}(?${ke})\s*\(`,"u"),kind:"function",exported:Bn},{re:new RegExp(String.raw`${Un}(?:val|var)\s+(?:<[^>]*>\s*)?${Im}(?${ke})\s*(?:[:=]|by\b)`,"u"),kind:"property",exported:Bn,scope:"member"}],$m={lang:"kotlin",exts:[".kt",".kts"],lexis:{mask:e=>Ke(e,{nested:!0,triple:!0,squote:"char"}),comment:/^\s*\/\//,block:!0,decoration:/^\s*@/},extract(e,t,n){return Se(e,t,"kotlin",kx,n)}}});var Ex,vx,Om,Nm=U(()=>{"use strict";A();ct();et();Ex="(?!\\s*(?:if|for|while|switch|return|else|do|sizeof|typedef)\\b)",vx=[{re:/^\s*(?:class|struct)\s+(?[A-Za-z_]\w+)\s*(?:[:{]|$)/,kind:"class",exported:!0},{re:/^\s*namespace\s+(?[A-Za-z_]\w+)/,kind:"namespace",exported:!0},{re:/^\s*(?:typedef\s+)?(?:struct|enum|union)\s+(?[A-Za-z_]\w+)\s*\{/,kind:"struct",exported:!0},{re:new RegExp(`^${Ex}[A-Za-z_][\\w\\s\\*&<>:,]*?\\b(?[A-Za-z_]\\w+)\\s*\\([^;{]*\\)\\s*(?:const)?\\s*\\{?\\s*$`),kind:"function",exported:!0}],Om={lang:"c/cpp",exts:[".c",".h",".cc",".cpp",".cxx",".hpp",".hh"],lexis:{mask:e=>Ke(e,{squote:"char"}),comment:/^\s*\/\//,block:!0},extract(e,t,n){return Se(e,t,e.match(/\.(c|h)$/)?"c":"cpp",vx,n)}}});var Rx,Pm,Dm=U(()=>{"use strict";A();et();Rx=[{re:/^\s*local\s+function\s+(?[\w.:]+)\s*\(/,kind:"function",exported:!1},{re:/^\s*function\s+(?[\w.:]+)\s*\(/,kind:"function",exported:!0},{re:/^\s*(?:local\s+)?(?[\w.]+)\s*=\s*function\s*\(/,kind:"function",exported:!0}],Pm={lang:"lua",exts:[".lua"],lexis:{comment:/^\s*--/},extract(e,t){return Se(e,t,"lua",Rx).map(n=>{let r=Math.max(n.name.lastIndexOf("."),n.name.lastIndexOf(":"));return r>0&&r{"use strict";A();et();Mx=[{re:/^\s*function\s+(?[\w:-]+)\s*(?:\(\))?\s*\{?/,kind:"function",exported:!0},{re:/^\s*(?[A-Za-z_][\w:-]*)\s*\(\)\s*\{?/,kind:"function",exported:!0}],Lm={lang:"shell",exts:[".sh",".bash",".zsh",".ksh"],lexis:{comment:/^\s*#(?!!)/},extract(e,t){return Se(e,t,"shell",Mx)}}});var Cx,Wm,Bm=U(()=>{"use strict";A();et();Cx=[{re:/^\s*defmodule\s+(?[\w.]+)/,kind:"module",exported:!0},{re:/^\s*defp\s+(?[\w?!]+)/,kind:"function",exported:!1},{re:/^\s*def\s+(?[\w?!]+)/,kind:"function",exported:!0},{re:/^\s*defmacrop\s+(?[\w?!]+)/,kind:"macro",exported:!1},{re:/^\s*defmacro\s+(?[\w?!]+)/,kind:"macro",exported:!0},{re:/^\s*defguardp\s+(?[\w?!]+)/,kind:"guard",exported:!1},{re:/^\s*defguard\s+(?[\w?!]+)/,kind:"guard",exported:!0}],Wm={lang:"elixir",exts:[".ex",".exs"],lexis:{comment:/^\s*#/,decoration:/^\s*@(?!(?:doc|moduledoc|typedoc)\b)\w+/,docAttr:!0},extract(e,t){return Se(e,t,"elixir",Cx)}}});var Ax,Um,Hm=U(()=>{"use strict";A();ct();et();Ax=[{re:/^\s*(?:final\s+|sealed\s+|abstract\s+|implicit\s+)*(?:case\s+)?class\s+(?\w+)/,kind:"class",exported:!0},{re:/^\s*(?:sealed\s+)?trait\s+(?\w+)/,kind:"trait",exported:!0},{re:/^\s*(?:case\s+)?object\s+(?\w+)/,kind:"object",exported:!0},{re:/^\s*(?:override\s+|final\s+|private\s+|protected\s+|implicit\s+)*def\s+(?\w+)/,kind:"def",exported:(e,t)=>!/\b(private|protected)\b/.test(t)}],Um={lang:"scala",exts:[".scala",".sc"],lexis:{mask:e=>Ke(e,{nested:!0,triple:!0,squote:"char"}),comment:/^\s*\/\//,block:!0,decoration:/^\s*@/},extract(e,t,n){return Se(e,t,"scala",Ax,n)}}});function Fx(e,t,n,r){let s=[],o=n.split(/\r?\n/),a=t.split(/\r?\n/),l,c=0,d;for(let u=0;uc?g:-1),g!==d||r.has(u+1))continue;let p=$x.exec(f);if(!p||p.groups.type!==l)continue;let h=p.groups.name??l;s.push({name:h,kind:"constructor",file:e,line:u+1,signature:a[u].trim().slice(0,200),exported:!h.startsWith("_")&&!l.startsWith("_"),lang:"dart"})}return s}var Yt,ia,sa,zm,Gm,Tx,Ix,$x,qm,Vm=U(()=>{"use strict";A();ct();et();Yt=e=>!(e.groups?.name??"").startsWith("_"),ia=String.raw`(?:@[\w$.]+(?:\([^)]*\))?\s+)*`,sa=String.raw`(?!(?:return|await|throw|new|else|if|for|while|do|switch|yield|case|const|final|var|late|factory|get|set|is|as|in)\b)[\w$.]+(?:<[^;{}()=]*>)?\??`,zm=String.raw`(?!(?:if|for|while|switch|catch|return|assert|super|this|Function)\b)`,Gm=String.raw`\((?:[^()]|\([^()]*\))*(?:\)\s*(?:async\s*\*?|sync\s*\*)?\s*(?:=>|\{|;)|$)`,Tx=[{re:/^\s*(?:(?:abstract|base|final|sealed|interface|mixin)\s+)*class\s+(?[\w$]+)/,kind:"class",exported:Yt},{re:/^\s*(?:base\s+)?mixin\s+(?[\w$]+)/,kind:"mixin",exported:Yt},{re:/^\s*extension\s+(?:type\s+(?:const\s+)?)?(?!on\b)(?[\w$]+)/,kind:"extension",exported:Yt},{re:/^\s*enum\s+(?[\w$]+)/,kind:"enum",exported:Yt},{re:/^\s*typedef\s+(?[\w$]+)/,kind:"type",exported:Yt},{re:new RegExp(String.raw`^\s*${ia}(?:(?:static|external)\s+)*(?:${sa}\s+)?get\s+(?[\w$]+)\s*(?:=>|\{|;|async\b|sync\b)`),kind:"getter",exported:Yt},{re:new RegExp(String.raw`^\s*${ia}(?:(?:static|external)\s+)*(?:void\s+)?set\s+(?[\w$]+)\s*\(`),kind:"setter",exported:Yt},{re:new RegExp(String.raw`^\s*${ia}(?:(?:static|external)\s+)*${sa}\s+${zm}(?[\w$]+)\s*(?:<[^()]*>)?\s*${Gm}`),kind:"function",exported:Yt},{re:new RegExp(String.raw`^${zm}(?[\w$]+)\s*(?:<[^()]*>)?\s*${Gm}`),kind:"function",exported:Yt},{re:new RegExp(String.raw`^(?:const|final)\s+(?:${sa}\s+)?(?[\w$]+)\s*[=;]`),kind:"const",exported:Yt},{re:new RegExp(String.raw`^(?:late\s+final|late|var)\s+(?:${sa}\s+)?(?[\w$]+)\s*[=;]`),kind:"var",exported:Yt}],Ix=/^(?\s*)(?:(?:abstract|base|final|sealed|interface|mixin)\s+)*(?:class|enum|mixin|extension(?:\s+type(?:\s+const)?)?)\s+(?[\w$]+)/,$x=new RegExp(String.raw`^(?\s*)${ia}(?:(?:const|factory|external)\s+)*(?[\w$]+)(?:\.(?[\w$]+))?\s*\(`);qm={lang:"dart",exts:[".dart"],lexis:{mask:e=>Ke(e,{nested:!0,triple:!0,squote:"string"}),comment:/^\s*\/\//,block:!0,decoration:/^\s*@/},extract(e,t,n=t){let r=Se(e,t,"dart",Tx,n),s=Fx(e,t,n,new Set(r.map(o=>o.line)));return s.length?[...r,...s].sort((o,a)=>o.line-a.line):r}}});function $c(e,t,n){let r=Ic.get(t),s;if(!r)s=[];else try{let l=r.lexis,c=l?.mask?.(n);s=r.extract(e,n,c),l&&(s=Xf(s,n,l,c))}catch{s=[]}let o=new Set(s.map(l=>l.name)),a=Zo(e,n,s).filter(l=>!o.has(l.name));return a.length?[...s,...a]:s}function Fc(e){return Ic.get(e)?.lang??Zt(e)}var Ox,Ic,wr=U(()=>{"use strict";A();et();mm();gm();_m();wm();Sm();Em();Rm();Cm();Tm();Fm();Nm();Dm();jm();Bm();Hm();Vm();Ox=[fm,pm,ym,bm,xm,km,vm,Mm,Am,$m,Om,Pm,Lm,Wm,Um,qm],Ic=new Map;for(let e of Ox)for(let t of e.exts)Ic.set(t,e)});function Jm(e,t){let n=e.split("/").pop().toLowerCase();return Px.has(t)||Nx.test(n)||Dx.test(e)}function Wx(e,t){let n=e.split("/").pop().toLowerCase();return Lx.has(n)||jx.has(t)}function Km(e){return!Bx.has(Fc(e))}function vt(e,t){return Km(t)?"code":Jm(e,t)?"doc":Wx(e,t)?"config":"other"}var Nx,Px,Dx,Lx,jx,Oc,Bx,Hn=U(()=>{"use strict";A();wr();Nx=/^(readme|changelog|contributing|history|news|authors|notice|security|code_of_conduct|faq|getting[-_]?started|usage|guide|tutorial)\b/i,Px=new Set([".md",".mdx",".rst",".adoc",".txt"]),Dx=/^(docs?|documentation|wiki|guides?|website|site|book)\//i,Lx=new Set(["package.json","pnpm-workspace.yaml","tsconfig.json","jsconfig.json","pyproject.toml","setup.py","setup.cfg","requirements.txt","pipfile","go.mod","cargo.toml","gemfile","pom.xml","build.gradle","build.gradle.kts","composer.json","mix.exs","pubspec.yaml","build.sbt","dockerfile","docker-compose.yml","docker-compose.yaml","makefile",".env.example","manifest.json"]),jx=new Set([".json",".yaml",".yml",".toml",".ini",".cfg"]),Oc=new Set([".md",".mdx"]);Bx=new Set(["markdown","restructuredtext","text","json","yaml","toml","ini","other","html","css","scss"])});function Nc(e){let t="";for(let n=0;nt.some(r=>r.test(n))}function Pc(e){if(!e||e.length===0)return null;let t=e.map(n=>n.split("/").map(r=>r.includes("**")?null:Nc(r)));return n=>{let r=n.split("/");return t.some(s=>{for(let o=0;on.endsWith("/**")&&n.length>3).map(n=>Nc(n.slice(0,-3)));return t.length===0?null:n=>t.some(r=>r.test(n))}function Zm(e){if(!e||e.length===0)return null;let t=Rt(e.filter(r=>!r.startsWith("!"))),n=Rt(e.filter(r=>r.startsWith("!")).map(r=>r.slice(1)));return r=>(!t||t(r))&&!n?.(r)}var ai=U(()=>{"use strict";A();Ye()});function Ux(e){let t=e.split(/\r?\n/),n=[],r=null,s=!1,o=!1,a=!0;for(let l of t){if(r){r.test(l)&&(r=null),n.push("");continue}let c=/^\s*(`{3,}|~{3,})/.exec(l);if(c){r=new RegExp(`^\\s*${c[1][0]}{${c[1].length},}\\s*$`),o=!1,a=!1,n.push("");continue}let d=!l.trim(),u=/^(?: {4}|\t)/.test(l);if(o&&(d||u)){n.push("");continue}if(o=!1,u&&a&&!s){o=!0,n.push("");continue}d||(/^ {0,3}(?:[-*+]|\d+[.)])(?:\s|$)/.test(l)?s=!0:a&&!/^\s/.test(l)&&(s=!1)),a=d,n.push(l)}return n.join(` +`,s),c=l===-1?n:l;r.blank(s,c),s=c;continue}if(o===Sn&&e.charCodeAt(s+1)===Qs){let l=s+2,c=1;for(;l0&&e.charCodeAt(l-1)===Ac;)l--;let c=s-l;if(t.raw==="r"?/[rR]$/.test(e.slice(Math.max(0,l-2),l)):c>0){let u=e.indexOf('"'+"#".repeat(c),s+1),f=u===-1?n:u;r.blank(s+1,f),s=u===-1?n:u+1+c;continue}}let a=o===Ys||o===ea&&t.squote==="string";if(a||o===ti&&t.backtick){let l=a&&t.triple&&e.charCodeAt(s+1)===o&&e.charCodeAt(s+2)===o,c=s+(l?3:1),d=c;if(l){let f=e.indexOf(o===Ys?'"""':"'''",c);d=f===-1?n:f}else for(;d{n.get(o)===!0&&n.delete(o),n.set(o,!1)},s=o=>{n.has(o)||n.set(o,!0)};if(Pw.has(e)){if(!t.includes("import")&&!t.includes("require")&&!t.includes("from"))return[];let o=_r(t);for(let a of[Kw,Xw,Zw,Yw]){a.lastIndex=0;for(let l;l=a.exec(o);){let[c,d]=l.indices[1];r(t.slice(c,d))}}}else if(Dw.has(e)){if(!t.includes("import"))return[];let o=Jw(t);nm.lastIndex=0;for(let a;a=nm.exec(o);){let l=a[1];if(l!==void 0){if(r(l),!l||l==="__future__")continue;let c=a[2].startsWith("(")?a[2].slice(1,-1):a[2].replace(/\\\r?\n/g," ");for(let d of c.split(",")){let u=d.trim().split(/\s+as\s+/)[0].trim();/^[A-Za-z_]\w*$/.test(u)&&s(tx(l,u))}continue}for(let c of a[3].split(",")){let d=c.trim().split(/\s+as\s+/)[0].trim();d&&/^[\w.]+$/.test(d)&&r(d)}}}else if(e===".go"){let o=t.split(/\r?\n/),a=!1;for(let l of o){let c=l.trim();if(a){if(c===")"){a=!1;continue}let u=/"([^"]+)"/.exec(c);u&&r(u[1]);continue}if(/^import\s*\($/.test(c)){a=!0;continue}let d=/^import\s+(?:[\w.]+\s+)?"([^"]+)"/.exec(c);d&&r(d[1])}}else if(e===".rs"){let o,a=new Set,l=/#\[\s*path\s*=\s*"([^"]+)"\s*\]\s*(?:(?:#\[[^\]]*\]|\/\/[^\n]*)\s*)*(?:pub(?:\([^)]*\))?\s+)?mod\s+[A-Za-z_]\w*\s*;/g;for(;o=l.exec(t);)r(`mod-path ${o[1]}`),a.add(o.index+o[0].length);let c=/^\s*(?:pub(?:\([^)]*\))?\s+)?mod\s+([A-Za-z_]\w*)\s*;/gm;for(;o=c.exec(t);)a.has(o.index+o[0].length)||r(`mod ${o[1]}`);let d=/^\s*(?:pub(?:\([^)]*\))?\s+)?use\s+([^;]+);/gm;for(;o=d.exec(t);)for(let u of Mc(o[1].trim()))r(u)}else if(e===".java"){let o,a=/^\s*import\s+(?:static\s+)?([\w.]+(?:\.\*)?)\s*;/gm;for(;o=a.exec(t);)r(o[1])}else if(e===".rb"||e===".rake"){let o,a=/^\s*require_relative\s+['"]([^'"]+)['"]/gm;for(;o=a.exec(t);)r(Rc(o[1]));let l=/^\s*require\s+['"]([^'"]+)['"]/gm;for(;o=l.exec(t);)r(o[1])}else if(Lw.has(e)){let o,a=/^\s*#\s*include\s*"([^"]+)"/gm;for(;o=a.exec(t);)r(o[1])}else if(e===".php"){let o,a=Qw.exec(t)?.index??1/0;for(rm.lastIndex=0;o=rm.exec(t);){if(o[1]&&o.index>a)continue;let l=o[2].trim().replace(/^(?:function|const)\s+/,""),c=/^\\?([\w\\]*?)\\?\s*\{([^}]*)\}$/.exec(l),d=c?c[2].split(",").map(u=>`${c[1]}\\${u.trim()}`):l.split(",");for(let u of d){let f=u.trim().replace(/\\(?:function|const)\s+/,"\\").replace(/\s+as\s+\w+$/,"").replace(/^\\/,"");ex.test(f)&&r(f)}}for(sm.lastIndex=0;o=sm.exec(t);){let{here:l,up:c,levels:d,path:u}=o.groups;r(l?Rc(u.replace(/^\/+/,"")):c?"../".repeat(Number(d??1))+u.replace(/^\/+/,""):Rc(u))}}else if(e===".cs"){let o,a=/^\s*(?:global\s+)?using\s+(?:static\s+)?([A-Za-z_][\w.]*)\s*;/gm;for(;o=a.exec(t);)r(o[1])}else if(im.has(e)){let o,a=/^[ \t]*import[ \t]+([\w.`*]+)/gm;for(;o=a.exec(t);){let l=Cc(o[1]);l&&r(l)}}else if(om.has(e)){let o,a=/^[ \t]*import[ \t]+((?:[^\n;{]|\{[^}]*\})+)/gm;for(;o=a.exec(t);){let l=[],c=0,d="";for(let u of o[1].replace(/\/\/.*$/gm,""))u==="{"?c++:u==="}"&&c--,u===","&&c===0?(Zf(d,l),d=""):d+=u;Zf(d,l);for(let u of l)r(u)}}else if(e===".dart"){let o,a=/^[ \t]*(?:import|export|part)[ \t]+(?:'([^'\n]+)'|"([^"\n]+)")/gm;for(;o=a.exec(t);)r(o[1]??o[2])}else if(e===".lua"){let o,a=/\brequire\s*\(?\s*['"]([\w-]+(?:[./][\w-]+)*)['"]/g;for(;o=a.exec(t);)r(o[1])}else if(jw.has(e)){let o,a=/(?:^|[;&|]|\b(?:then|do|else)\b)[ \t]*(?:source|\.)[ \t]+([^\n]+)/gm;for(;o=a.exec(t);){let l=Bw(o[1]);l&&r(l)}}else if(e===".ex"||e===".exs"){let o,a=/^[ \t]*(?:alias|import|require|use)[ \t]+([A-Z]\w*(?:\.[A-Z]\w*)*)(?:\.\{([^}]*)\})?/gm;for(;o=a.exec(t);){if(o[2]===void 0){r(o[1]);continue}let l=0;for(let c of o[2].split(",")){let d=c.trim();/^[A-Z]\w*(?:\.[A-Z]\w*)*$/.test(d)&&l++a?{kind:"import",spec:o,soft:!0}:{kind:"import",spec:o})}function ta(e,t){if(e===".java")return/^\s*package\s+([\w.]+)\s*;/m.exec(t)?.[1];if(e===".cs")return/^\s*(?:file-scoped\s+)?namespace\s+([\w.]+)/m.exec(t)?.[1];if(im.has(e)){let n=/^[ \t]*package[ \t]+([\w.`]+)/m.exec(t);return n?n[1].replace(/`/g,""):void 0}if(om.has(e))return Uw(t)}var Pw,Dw,Lw,im,om,jw,Qo,Ww,ni,Yf,ri,am,Ac,lm,ea,Ys,Qs,Sn,Hw,ei,zw,ti,Qf,Gw,qw,Vw,tm,Yo,vc,Kw,Xw,Zw,Yw,nm,Qw,rm,ex,sm,ct=U(()=>{"use strict";A();Pw=new Set([".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"]),Dw=new Set([".py",".pyi"]),Lw=new Set([".c",".h",".cc",".cpp",".cxx",".hpp",".hh"]),im=new Set([".kt",".kts"]),om=new Set([".scala",".sc"]),jw=new Set([".sh",".bash",".zsh",".ksh",".fish"]),Qo=16;Ww=/^(["']?)(?:\$\(\s*dirname\s+(["']?)\$(?:0|\{BASH_SOURCE(?:\[0\])?\}|BASH_SOURCE)\2\s*\)|\$\{(?:BASH_SOURCE(?:\[0\])?|0)%\/\*\})\//;ni=class{constructor(t){this.src=t}src;codes;blank(t,n){if(n<=t)return;let r=this.codes;if(!r){r=this.codes=new Uint16Array(this.src.length);for(let s=0;s~^"].map(e=>e.charCodeAt(0))),Vw=new Set(["return","typeof","instanceof","in","of","new","delete","void","throw","case","do","else","yield","await"]),tm=/\bimport\(\s*['"][^'"\n]*['"]\s*[,)]|@import\b[^'"@]{0,2048}?\bfrom\s*['"][^'"\n]*['"]/g;Yo=/'(?:\\(?:u\{[0-9A-Fa-f]{1,6}\}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{2}|.)|[^\\'\n])'/y;vc="[\\w$\\u00a0-\\uffff]+",Kw=new RegExp(`(?:^|[^\\w$.])(?:import|export)\\b\\s*(?:(?:type|typeof|defer|source)\\s+)?(?:${vc}\\s*,\\s*)?(?:${vc}|\\*\\s*(?:as\\s+${vc})?|\\{[^{}]*\\})\\s*from\\s*['"]([^'"]+)['"]`,"dg"),Xw=/(?:^|[\n;])[ \t]*import\s*['"]([^'"]+)['"]/dg,Zw=/\brequire\(\s*['"]([^'"]+)['"]\s*\)/dg,Yw=/\bimport\(\s*['"]([^'"]+)['"]\s*[,)]/dg,nm=/(?:^|;)[ \t]*(?:from[ \t]+(\.*[\w.]*)[ \t]+import\b[ \t]*(\([^)]*\)|(?:\\\r?\n|[^\n;])*)|import[ \t]+([^\n;]*))/gm,Qw=/^[ \t]*(?:(?:abstract|final|readonly)[ \t]+)*(?:class|interface|trait|enum)[ \t]+[A-Za-z_]/m,rm=/^([ \t]*)use\s+([^;]*);/gm,ex=/^[A-Za-z_][\w\\]*$/,sm=/\b(?:require|include)(?:_once)?\s*\(?\s*(?:(?__DIR__|dirname\(\s*__FILE__\s*\))\s*\.\s*|(?dirname\(\s*__DIR__\s*(?:,\s*(?\d+)\s*)?\))\s*\.\s*)?['"](?[^'"]+)['"]/g});function ix(e){return(e.split("/").pop()??"").replace(/\.[^.]+$/,"")}function ox(e,t){let n=o=>{if(!(!o||o==="default"))for(let a of t)a.name===o&&(a.exported=!0)},r=(o,a)=>{for(let l of o.split(",")){let c=l.trim().replace(/^type\s+/,"");if(!c)continue;let d=/^([\w$]+)\s+as\s+([\w$]+)$/.exec(c);if(d){d[2]!=="default"&&n(d[1]);continue}if(a){let u=/^([\w$]+)\s*:\s*([\w$]+)$/.exec(c);if(u){n(u[1]),n(u[2]);continue}}n(/^([\w$]+)/.exec(c)?.[1])}},s;for(cm.lastIndex=0;s=cm.exec(e);)s[2]||r(s[1]??"",!1);for(dm.lastIndex=0;s=dm.exec(e);)r(s[1]??"",!0);for(um.lastIndex=0;s=um.exec(e);)n(s[2])}var rt,Tc,Et,tt,nx,rx,sx,cm,dm,um,fm,mm=U(()=>{"use strict";A();ct();et();rt=`(?${ke})`,Tc=String.raw`function(?:\s*\*\s*|\s+)`,Et=String.raw`(?:declare\s+)?`,tt=e=>new RegExp(e,"u"),nx=[{re:tt(String.raw`^\s*export\s+${Et}(?:async\s+)?${Tc}${rt}`),kind:"function",exported:!0},{re:tt(String.raw`^\s*export\s+default\s+(?:async\s+)?${Tc}${rt}`),kind:"function",exported:!0},{re:tt(String.raw`^\s*export\s+default\s+(?:abstract\s+)?class\s+(?!extends\b)${rt}`),kind:"class",exported:!0},{re:tt(String.raw`^\s*${Et}(?:async\s+)?${Tc}${rt}`),kind:"function",exported:!1},{re:tt(String.raw`^\s*export\s+${Et}(?:abstract\s+)?class\s+${rt}`),kind:"class",exported:!0},{re:tt(String.raw`^\s*${Et}(?:abstract\s+)?class\s+${rt}`),kind:"class",exported:!1},{re:tt(String.raw`^\s*export\s+${Et}interface\s+${rt}`),kind:"interface",exported:!0},{re:tt(String.raw`^\s*${Et}interface\s+${rt}`),kind:"interface",exported:!1},{re:tt(String.raw`^\s*export\s+${Et}type\s+${rt}`),kind:"type",exported:!0},{re:tt(String.raw`^\s*${Et}type\s+${rt}\s*[=<]`),kind:"type",exported:!1},{re:tt(String.raw`^\s*export\s+${Et}(?:const\s+)?enum\s+${rt}`),kind:"enum",exported:!0},{re:tt(String.raw`^\s*export\s+${Et}(?:namespace|module)\s+(?${ke}(?:\.${ke})*)`),kind:"namespace",exported:!0},{re:tt(String.raw`^\s*${Et}(?:namespace|module)\s+(?${ke}(?:\.${ke})*)\s*\{`),kind:"namespace",exported:!1},{re:tt(String.raw`^\s*export\s+${Et}(?:const|let|var)\s+${rt}\s*[:=;]`),kind:"const",exported:!0},{re:tt(String.raw`^\s*exports\.${rt}\s*=`),kind:"const",exported:!0},{re:tt(String.raw`^\s*module\.exports\.${rt}\s*=`),kind:"const",exported:!0},{re:tt(String.raw`^\s*(?:const|let)\s+${rt}\s*=\s*(?:async\s*)?\([^)]*\)\s*(?::[^=]+)?=>`),kind:"const",exported:!1},{re:tt(String.raw`^${Et}(?:const|let|var)\s+${rt}\s*[:=]`),kind:"const",exported:!1},{re:tt(String.raw`^\s*export\s+default\s+${rt}\s*;?\s*$`),kind:"default",exported:!0}],rx=/^\s*export\s+default\s+(?:async\s+)?(?:function|class)?\s*(?:\(|\{|extends\b)/,sx=/^\s*export\s+default\s+(?:async\s+)?(?:function|class)\s+(?!extends\b)[\w$]+/;cm=/export\s*\{([^}]*)\}\s*(from\b)?/g,dm=/module\.exports\s*=\s*\{([^}]*)\}/g,um=/(^|\n)[ \t]*export(?:\s+default\s+|\s*=\s*)([A-Za-z_$][\w$]*)[ \t]*;?[ \t]*(?=\r?\n|$)/g;fm={lang:"javascript/typescript",exts:[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],lexis:{mask:_r,comment:/^\s*\/\//,block:!0,decoration:/^\s*@/},extract(e,t,n=t){let r=e.match(/\.(ts|tsx|mts|cts)$/)?"typescript":"javascript",s=Se(e,t,r,nx,n),o=n.split(/\r?\n/);for(let a=0;a{"use strict";A();et();na=e=>!e.startsWith("_")||e.startsWith("__"),ax=[{re:/^(?:async\s+)?def\s+(?[\w]+)\s*\(/,kind:"function",exported:e=>na(e.groups.name)},{re:/^\s+(?:async\s+)?def\s+(?[\w]+)\s*\(/,kind:"method",exported:e=>na(e.groups.name)},{re:/^class\s+(?[\w]+)/,kind:"class",exported:e=>na(e.groups.name)},{re:/^\s+class\s+(?[\w]+)/,kind:"class",exported:e=>na(e.groups.name)}],pm={lang:"python",exts:[".py",".pyi"],lexis:{comment:/^\s*#(?!!)/,decoration:/^\s*@/},extract(e,t){return Se(e,t,"python",ax)}}});function hm(e){return[{re:new RegExp(String.raw`${e}(?${ke})${ra}\s+struct\b`,"u"),kind:"struct",exported:kn},{re:new RegExp(String.raw`${e}(?${ke})${ra}\s+interface\b`,"u"),kind:"interface",exported:kn},{re:new RegExp(String.raw`${e}(?${ke})${ra}\s+`,"u"),kind:"type",exported:kn}]}function fx(e,t,n){let r=[],s=t.split(/\r?\n/),o=n.split(/\r?\n/);for(let a=0;a{"use strict";A();ct();et();lx=e=>/^\p{Lu}/u.test(e),kn=e=>lx(e.groups.name),ra=String.raw`(?:\[[^\]]*\])?`,cx=[{re:new RegExp(String.raw`^func\s+\([^)]*\)\s+(?${ke})\s*\(`,"u"),kind:"method",exported:kn},{re:new RegExp(String.raw`^func\s+(?${ke})${ra}\s*\(`,"u"),kind:"function",exported:kn},...hm("^type\\s+"),{re:new RegExp(String.raw`^const\s+(?(?!_\b)${ke})`,"u"),kind:"const",exported:kn},{re:new RegExp(String.raw`^var\s+(?(?!_\b)${ke})`,"u"),kind:"var",exported:kn}];dx=/^(const|var|type)\s*\(\s*$/,ux={const:[{re:new RegExp(String.raw`^\s+(?(?!_\b)${ke})\b`,"u"),kind:"const",exported:kn}],var:[{re:new RegExp(String.raw`^\s+(?(?!_\b)${ke})\b`,"u"),kind:"var",exported:kn}],type:hm("^\\s+")};ym={lang:"go",exts:[".go"],lexis:{mask:e=>Ke(e,{squote:"char",backtick:!0}),comment:/^\s*\/\//,block:!0},extract(e,t,n){let r=Se(e,t,"go",cx,n),s=n===void 0?[]:fx(e,t,n);return s.length?[...r,...s].sort((o,a)=>o.line-a.line):r}}});var mx,bm,wm=U(()=>{"use strict";A();et();mx=[{re:/^\s*def\s+(?:self\.)?(?[\w?!=]+)/,kind:"method",exported:!0},{re:/^\s*(?public|private|protected|module_function|(?:public|private)_class_method)\s+def\s+(?:self\.)?(?[\w?!=]+)/,kind:"method",exported:e=>/^(public|module_function|public_class_method)$/.test(e.groups.vis)},{re:/^\s*class\s+(?[\w:]+)/,kind:"class",exported:!0},{re:/^\s*module\s+(?[\w:]+)/,kind:"module",exported:!0}],bm={lang:"ruby",exts:[".rb",".rake"],lexis:{comment:/^\s*#(?![!{])/},extract(e,t){return Se(e,t,"ruby",mx)}}});var px,xm,Sm=U(()=>{"use strict";A();ct();et();px=[{re:/^\s*(?:public|protected|private)?\s*(?:abstract\s+|final\s+)?class\s+(?[\w]+)/,kind:"class",exported:(e,t)=>/\bpublic\b/.test(t)},{re:/^\s*(?:public|protected|private)?\s*interface\s+(?[\w]+)/,kind:"interface",exported:(e,t)=>/\bpublic\b/.test(t)},{re:/^\s*(?:public|protected|private)?\s*enum\s+(?[\w]+)/,kind:"enum",exported:(e,t)=>/\bpublic\b/.test(t)},{re:/^\s*(?:public|protected|private)\s+(?:static\s+|final\s+|abstract\s+|synchronized\s+)*[\w<>\[\],.?\s]+\s+(?[\w]+)\s*\(/,kind:"method",exported:(e,t)=>/\bpublic\b/.test(t)}],xm={lang:"java",exts:[".java"],lexis:{mask:e=>Ke(e,{triple:!0,squote:"char"}),comment:/^\s*\/\//,block:!0,decoration:/^\s*@/},extract(e,t,n){return Se(e,t,"java",px,n)}}});var ii,gx,km,Em=U(()=>{"use strict";A();ct();et();ii=(e,t)=>/^\s*pub\b/.test(t),gx=[{re:/^\s*(?:pub(?:\([^)]*\))?\s+)?(?:async\s+)?(?:unsafe\s+)?fn\s+(?[\w]+)/,kind:"function",exported:ii},{re:/^\s*(?:pub(?:\([^)]*\))?\s+)?struct\s+(?[\w]+)/,kind:"struct",exported:ii},{re:/^\s*(?:pub(?:\([^)]*\))?\s+)?enum\s+(?[\w]+)/,kind:"enum",exported:ii},{re:/^\s*(?:pub(?:\([^)]*\))?\s+)?trait\s+(?[\w]+)/,kind:"trait",exported:ii},{re:/^\s*(?:pub(?:\([^)]*\))?\s+)?type\s+(?[\w]+)/,kind:"type",exported:ii}],km={lang:"rust",exts:[".rs"],lexis:{mask:e=>Ke(e,{nested:!0,squote:"char",multiline:!0,raw:"r"}),comment:/^\s*\/\/(?!!)/,block:!0,decoration:/^\s*#\[/},extract(e,t,n){return Se(e,t,"rust",gx,n)}}});var oi,hx,vm,Rm=U(()=>{"use strict";A();ct();et();oi=(e,t)=>/\b(public|internal)\b/.test(t),hx=[{re:/^\s*(?:public|internal|protected|private)?\s*(?:static\s+|sealed\s+|abstract\s+|partial\s+)*(?:class|record)\s+(?\w+)/,kind:"class",exported:oi},{re:/^\s*(?:public|internal|protected|private)?\s*(?:partial\s+)?interface\s+(?\w+)/,kind:"interface",exported:oi},{re:/^\s*(?:public|internal|protected|private)?\s*(?:readonly\s+)?(?:ref\s+)?struct\s+(?\w+)/,kind:"struct",exported:oi},{re:/^\s*(?:public|internal|protected|private)?\s*enum\s+(?\w+)/,kind:"enum",exported:oi},{re:/^\s*(?:public|internal|protected|private)\s+(?:static\s+|virtual\s+|override\s+|async\s+|sealed\s+|abstract\s+|new\s+)*[\w<>\[\],.?]+\s+(?\w+)\s*(?:<[^>]*>)?\s*\(/,kind:"method",exported:oi}],vm={lang:"csharp",exts:[".cs"],lexis:{mask:e=>Ke(e,{squote:"char"}),comment:/^\s*\/\//,block:!0,decoration:/^\s*\[/},extract(e,t,n){return Se(e,t,"csharp",hx,n)}}});var yx,Mm,Cm=U(()=>{"use strict";A();ct();et();yx=[{re:/^\s*(?:abstract\s+|final\s+)*class\s+(?\w+)/,kind:"class",exported:!0},{re:/^\s*interface\s+(?\w+)/,kind:"interface",exported:!0},{re:/^\s*trait\s+(?\w+)/,kind:"trait",exported:!0},{re:/^\s*enum\s+(?\w+)/,kind:"enum",exported:!0},{re:/^\s*(?:public\s+|protected\s+|private\s+|static\s+|abstract\s+|final\s+)*function\s+(?\w+)\s*\(/,kind:"function",exported:(e,t)=>!/\b(private|protected)\b/.test(t)}],Mm={lang:"php",exts:[".php"],lexis:{mask:e=>Ke(e,{hash:!0,squote:"string",multiline:!0}),comment:/^\s*(?:\/\/|#(?!\[))/,block:!0,decoration:/^\s*#\[/},extract(e,t,n){return Se(e,t,"php",yx,n)}}});var ss,_x,bx,is,br,wx,Am,Tm=U(()=>{"use strict";A();ct();et();ss=(e,t)=>!/\b(?:private|fileprivate)\b(?!\s*\(\s*set\s*\))/.test(t),_x=String.raw`(?:@${ke}(?:\([^)]*\))?\s+)*`,bx=String.raw`(?:(?:public|open|internal|private|fileprivate|package|final|static|class|override|mutating|nonmutating|convenience|required|dynamic|lazy|weak|unowned|indirect|nonisolated|isolated|distributed|optional|prefix|postfix|infix|async)(?:\([^)]*\))?\s+)*`,is=String.raw`^\s*${_x}${bx}`,br=(e,t,n={})=>({re:new RegExp(String.raw`${is}${e}\s+(?!(?:func|var|let|subscript|init)\b)(?${ke})`,"u"),kind:t,exported:ss,...n}),wx=[br("class","class"),br("struct","struct"),br("enum","enum"),br("protocol","protocol"),br("actor","actor"),{re:new RegExp(String.raw`${is}extension\s+(?${ke}(?:\.${ke})*)`,"u"),kind:"extension",exported:ss},br("typealias","type"),br("func","function"),{re:new RegExp(String.raw`${is}(?init)[?!]?\s*[<(]`,"u"),kind:"constructor",exported:ss},{re:new RegExp(String.raw`${is}(?deinit)\s*\{`,"u"),kind:"destructor",exported:ss},{re:new RegExp(String.raw`${is}(?subscript)\s*[<(]`,"u"),kind:"method",exported:ss},{re:new RegExp(String.raw`${is}(?:let|var)\s+(?${ke})\s*[:={]`,"u"),kind:"property",exported:ss,scope:"member"}],Am={lang:"swift",exts:[".swift"],lexis:{mask:e=>Ke(e,{nested:!0,triple:!0,squote:"none",raw:"#"}),comment:/^\s*\/\//,block:!0,decoration:/^\s*@/},extract(e,t,n){return Se(e,t,"swift",wx,n)}}});var Bn,xx,Sx,Un,Im,kx,$m,Fm=U(()=>{"use strict";A();ct();et();Bn=(e,t)=>!/\bprivate\b/.test(t),xx=String.raw`(?:@[\w.:]+(?:\([^)]*\))?\s+)*`,Sx=String.raw`(?:(?:public|internal|private|protected|abstract|sealed|open|final|data|value|inline|inner|override|suspend|operator|infix|tailrec|external|lateinit|expect|actual|const|companion|enum|annotation)\s+)*`,Un=String.raw`^\s*${xx}${Sx}`,Im=String.raw`(?:${ke}(?:<[^()=]*>)?\??\.)*`,kx=[{re:new RegExp(String.raw`${Un}enum\s+class\s+(?${ke})`,"u"),kind:"enum",exported:Bn},{re:new RegExp(String.raw`${Un}annotation\s+class\s+(?${ke})`,"u"),kind:"annotation",exported:Bn},{re:new RegExp(String.raw`${Un}class\s+(?${ke})`,"u"),kind:"class",exported:Bn},{re:new RegExp(String.raw`${Un}(?:fun\s+)?interface\s+(?${ke})`,"u"),kind:"interface",exported:Bn},{re:new RegExp(String.raw`${Un}object\s+(?${ke})`,"u"),kind:"object",exported:Bn},{re:new RegExp(String.raw`${Un}typealias\s+(?${ke})`,"u"),kind:"type",exported:Bn},{re:new RegExp(String.raw`${Un}fun\s+(?:<[^>]*(?:>[^>]*)?>\s*)?${Im}(?${ke})\s*\(`,"u"),kind:"function",exported:Bn},{re:new RegExp(String.raw`${Un}(?:val|var)\s+(?:<[^>]*>\s*)?${Im}(?${ke})\s*(?:[:=]|by\b)`,"u"),kind:"property",exported:Bn,scope:"member"}],$m={lang:"kotlin",exts:[".kt",".kts"],lexis:{mask:e=>Ke(e,{nested:!0,triple:!0,squote:"char"}),comment:/^\s*\/\//,block:!0,decoration:/^\s*@/},extract(e,t,n){return Se(e,t,"kotlin",kx,n)}}});var Ex,vx,Om,Nm=U(()=>{"use strict";A();ct();et();Ex="(?!\\s*(?:if|for|while|switch|return|else|do|sizeof|typedef)\\b)",vx=[{re:/^\s*(?:class|struct)\s+(?[A-Za-z_]\w+)\s*(?:[:{]|$)/,kind:"class",exported:!0},{re:/^\s*namespace\s+(?[A-Za-z_]\w+)/,kind:"namespace",exported:!0},{re:/^\s*(?:typedef\s+)?(?:struct|enum|union)\s+(?[A-Za-z_]\w+)\s*\{/,kind:"struct",exported:!0},{re:new RegExp(`^${Ex}[A-Za-z_][\\w\\s\\*&<>:,]*?\\b(?[A-Za-z_]\\w+)\\s*\\([^;{]*\\)\\s*(?:const)?\\s*\\{?\\s*$`),kind:"function",exported:!0}],Om={lang:"c/cpp",exts:[".c",".h",".cc",".cpp",".cxx",".hpp",".hh"],lexis:{mask:e=>Ke(e,{squote:"char"}),comment:/^\s*\/\//,block:!0},extract(e,t,n){return Se(e,t,e.match(/\.(c|h)$/)?"c":"cpp",vx,n)}}});var Rx,Pm,Dm=U(()=>{"use strict";A();et();Rx=[{re:/^\s*local\s+function\s+(?[\w.:]+)\s*\(/,kind:"function",exported:!1},{re:/^\s*function\s+(?[\w.:]+)\s*\(/,kind:"function",exported:!0},{re:/^\s*(?:local\s+)?(?[\w.]+)\s*=\s*function\s*\(/,kind:"function",exported:!0}],Pm={lang:"lua",exts:[".lua"],lexis:{comment:/^\s*--/},extract(e,t){return Se(e,t,"lua",Rx).map(n=>{let r=Math.max(n.name.lastIndexOf("."),n.name.lastIndexOf(":"));return r>0&&r{"use strict";A();et();Mx=[{re:/^\s*function\s+(?[\w:-]+)\s*(?:\(\))?\s*\{?/,kind:"function",exported:!0},{re:/^\s*(?[A-Za-z_][\w:-]*)\s*\(\)\s*\{?/,kind:"function",exported:!0}],Lm={lang:"shell",exts:[".sh",".bash",".zsh",".ksh"],lexis:{comment:/^\s*#(?!!)/},extract(e,t){return Se(e,t,"shell",Mx)}}});var Cx,Wm,Bm=U(()=>{"use strict";A();et();Cx=[{re:/^\s*defmodule\s+(?[\w.]+)/,kind:"module",exported:!0},{re:/^\s*defp\s+(?[\w?!]+)/,kind:"function",exported:!1},{re:/^\s*def\s+(?[\w?!]+)/,kind:"function",exported:!0},{re:/^\s*defmacrop\s+(?[\w?!]+)/,kind:"macro",exported:!1},{re:/^\s*defmacro\s+(?[\w?!]+)/,kind:"macro",exported:!0},{re:/^\s*defguardp\s+(?[\w?!]+)/,kind:"guard",exported:!1},{re:/^\s*defguard\s+(?[\w?!]+)/,kind:"guard",exported:!0}],Wm={lang:"elixir",exts:[".ex",".exs"],lexis:{comment:/^\s*#/,decoration:/^\s*@(?!(?:doc|moduledoc|typedoc)\b)\w+/,docAttr:!0},extract(e,t){return Se(e,t,"elixir",Cx)}}});var Ax,Um,Hm=U(()=>{"use strict";A();ct();et();Ax=[{re:/^\s*(?:final\s+|sealed\s+|abstract\s+|implicit\s+)*(?:case\s+)?class\s+(?\w+)/,kind:"class",exported:!0},{re:/^\s*(?:sealed\s+)?trait\s+(?\w+)/,kind:"trait",exported:!0},{re:/^\s*(?:case\s+)?object\s+(?\w+)/,kind:"object",exported:!0},{re:/^\s*(?:override\s+|final\s+|private\s+|protected\s+|implicit\s+)*def\s+(?\w+)/,kind:"def",exported:(e,t)=>!/\b(private|protected)\b/.test(t)}],Um={lang:"scala",exts:[".scala",".sc"],lexis:{mask:e=>Ke(e,{nested:!0,triple:!0,squote:"char"}),comment:/^\s*\/\//,block:!0,decoration:/^\s*@/},extract(e,t,n){return Se(e,t,"scala",Ax,n)}}});function Fx(e,t,n,r){let s=[],o=n.split(/\r?\n/),a=t.split(/\r?\n/),l,c=0,d;for(let u=0;uc?g:-1),g!==d||r.has(u+1))continue;let p=$x.exec(f);if(!p||p.groups.type!==l)continue;let h=p.groups.name??l;s.push({name:h,kind:"constructor",file:e,line:u+1,signature:a[u].trim().slice(0,200),exported:!h.startsWith("_")&&!l.startsWith("_"),lang:"dart"})}return s}var Yt,ia,sa,zm,Gm,Tx,Ix,$x,qm,Vm=U(()=>{"use strict";A();ct();et();Yt=e=>!(e.groups?.name??"").startsWith("_"),ia=String.raw`(?:@[\w$.]+(?:\([^)]*\))?\s+)*`,sa=String.raw`(?!(?:return|await|throw|new|else|if|for|while|do|switch|yield|case|const|final|var|late|factory|get|set|is|as|in)\b)[\w$.]+(?:<[^;{}()=]*>)?\??`,zm=String.raw`(?!(?:if|for|while|switch|catch|return|assert|super|this|Function)\b)`,Gm=String.raw`\((?:[^()]|\([^()]*\))*(?:\)\s*(?:async\s*\*?|sync\s*\*)?\s*(?:=>|\{|;)|$)`,Tx=[{re:/^\s*(?:(?:abstract|base|final|sealed|interface|mixin)\s+)*class\s+(?[\w$]+)/,kind:"class",exported:Yt},{re:/^\s*(?:base\s+)?mixin\s+(?[\w$]+)/,kind:"mixin",exported:Yt},{re:/^\s*extension\s+(?:type\s+(?:const\s+)?)?(?!on\b)(?[\w$]+)/,kind:"extension",exported:Yt},{re:/^\s*enum\s+(?[\w$]+)/,kind:"enum",exported:Yt},{re:/^\s*typedef\s+(?[\w$]+)/,kind:"type",exported:Yt},{re:new RegExp(String.raw`^\s*${ia}(?:(?:static|external)\s+)*(?:${sa}\s+)?get\s+(?[\w$]+)\s*(?:=>|\{|;|async\b|sync\b)`),kind:"getter",exported:Yt},{re:new RegExp(String.raw`^\s*${ia}(?:(?:static|external)\s+)*(?:void\s+)?set\s+(?[\w$]+)\s*\(`),kind:"setter",exported:Yt},{re:new RegExp(String.raw`^\s*${ia}(?:(?:static|external)\s+)*${sa}\s+${zm}(?[\w$]+)\s*(?:<[^()]*>)?\s*${Gm}`),kind:"function",exported:Yt},{re:new RegExp(String.raw`^${zm}(?[\w$]+)\s*(?:<[^()]*>)?\s*${Gm}`),kind:"function",exported:Yt},{re:new RegExp(String.raw`^(?:const|final)\s+(?:${sa}\s+)?(?[\w$]+)\s*[=;]`),kind:"const",exported:Yt},{re:new RegExp(String.raw`^(?:late\s+final|late|var)\s+(?:${sa}\s+)?(?[\w$]+)\s*[=;]`),kind:"var",exported:Yt}],Ix=/^(?\s*)(?:(?:abstract|base|final|sealed|interface|mixin)\s+)*(?:class|enum|mixin|extension(?:\s+type(?:\s+const)?)?)\s+(?[\w$]+)/,$x=new RegExp(String.raw`^(?\s*)${ia}(?:(?:const|factory|external)\s+)*(?[\w$]+)(?:\.(?[\w$]+))?\s*\(`);qm={lang:"dart",exts:[".dart"],lexis:{mask:e=>Ke(e,{nested:!0,triple:!0,squote:"string"}),comment:/^\s*\/\//,block:!0,decoration:/^\s*@/},extract(e,t,n=t){let r=Se(e,t,"dart",Tx,n),s=Fx(e,t,n,new Set(r.map(o=>o.line)));return s.length?[...r,...s].sort((o,a)=>o.line-a.line):r}}});function $c(e,t,n){let r=Ic.get(t),s;if(!r)s=[];else try{let l=r.lexis,c=l?.mask?.(n);s=r.extract(e,n,c),l&&(s=Xf(s,n,l,c))}catch{s=[]}let o=new Set(s.map(l=>l.name)),a=Zo(e,n,s).filter(l=>!o.has(l.name));return a.length?[...s,...a]:s}function Fc(e){return Ic.get(e)?.lang??Zt(e)}var Ox,Ic,wr=U(()=>{"use strict";A();et();mm();gm();_m();wm();Sm();Em();Rm();Cm();Tm();Fm();Nm();Dm();jm();Bm();Hm();Vm();Ox=[fm,pm,ym,bm,xm,km,vm,Mm,Am,$m,Om,Pm,Lm,Wm,Um,qm],Ic=new Map;for(let e of Ox)for(let t of e.exts)Ic.set(t,e)});function Jm(e,t){let n=e.split("/").pop().toLowerCase();return Px.has(t)||Nx.test(n)||Dx.test(e)}function Wx(e,t){let n=e.split("/").pop().toLowerCase();return Lx.has(n)||jx.has(t)}function Km(e){return!Bx.has(Fc(e))}function vt(e,t){return Km(t)?"code":Jm(e,t)?"doc":Wx(e,t)?"config":"other"}var Nx,Px,Dx,Lx,jx,Oc,Bx,Hn=U(()=>{"use strict";A();wr();Nx=/^(readme|changelog|contributing|history|news|authors|notice|security|code_of_conduct|faq|getting[-_]?started|usage|guide|tutorial)\b/i,Px=new Set([".md",".mdx",".rst",".adoc",".txt"]),Dx=/^(docs?|documentation|wiki|guides?|website|site|book)\//i,Lx=new Set(["package.json","pnpm-workspace.yaml","tsconfig.json","jsconfig.json","pyproject.toml","setup.py","setup.cfg","requirements.txt","pipfile","go.mod","cargo.toml","gemfile","pom.xml","build.gradle","build.gradle.kts","composer.json","mix.exs","pubspec.yaml","build.sbt","dockerfile","docker-compose.yml","docker-compose.yaml","makefile",".env.example","manifest.json"]),jx=new Set([".json",".yaml",".yml",".toml",".ini",".cfg"]),Oc=new Set([".md",".mdx"]);Bx=new Set(["markdown","restructuredtext","text","json","yaml","toml","ini","other","html","css","scss"])});function Nc(e){let t="";for(let n=0;nt.some(r=>r.test(n))}function Pc(e){if(!e||e.length===0)return null;let t=e.map(n=>n.split("/").map(r=>r.includes("**")?null:Nc(r)));return n=>{let r=n.split("/");return t.some(s=>{for(let o=0;on.endsWith("/**")&&n.length>3).map(n=>Nc(n.slice(0,-3)));return t.length===0?null:n=>t.some(r=>r.test(n))}function Zm(e){if(!e||e.length===0)return null;let t=Rt(e.filter(r=>!r.startsWith("!"))),n=Rt(e.filter(r=>r.startsWith("!")).map(r=>r.slice(1)));return r=>(!t||t(r))&&!n?.(r)}var ai=U(()=>{"use strict";A();Ye()});function Ux(e){let t=e.split(/\r?\n/),n=[],r=null,s=!1,o=!1,a=!0;for(let l of t){if(r){r.test(l)&&(r=null),n.push("");continue}let c=/^\s*(`{3,}|~{3,})/.exec(l);if(c){r=new RegExp(`^\\s*${c[1][0]}{${c[1].length},}\\s*$`),o=!1,a=!1,n.push("");continue}let d=!l.trim(),u=/^(?: {4}|\t)/.test(l);if(o&&(d||u)){n.push("");continue}if(o=!1,u&&a&&!s){o=!0,n.push("");continue}d||(/^ {0,3}(?:[-*+]|\d+[.)])(?:\s|$)/.test(l)?s=!0:a&&!/^\s/.test(l)&&(s=!1)),a=d,n.push(l)}return n.join(` `)}function Hx(e){return!e||e.startsWith("#")||e.startsWith("//")?!0:/^[a-z][a-z0-9+.-]*:/i.test(e)}function Ym(e){return e.replace(/!\[[^\]]*\]\([^)]*\)/g,"").replace(/`([^`]*)`/g,"$1").replace(/\*\*([^*]+)\*\*/g,"$1").replace(/\*([^*]+)\*/g,"$1").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/[#>*_~-]+/g," ").replace(/\s+/g," ").trim()}function zx(e){return/[A-Za-zÀ-ɏ]{3,}/.test(e)}function Gx(e){return/^(all notable changes to this project|in the interest of fostering|this project adheres to|we as members and leaders|table of contents)\b/i.test(e)}function Vx(e){let t=e.trim();return!!t&&!/^ {4}|^\t/.test(e)&&!/^([-*+]|\d+[.)])(\s|$)/.test(t)&&!/^[>|<]/.test(t)}function Dc(e){let t=e,n,r=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/.exec(t);if(r){let _=/(^|\n)title:\s*["']?(.+?)["']?\s*(\n|$)/i.exec(r[1]);_&&(n=_[2].trim()),t=t.slice(r[0].length)}let s=Ux(t),o=s.split(/\r?\n/),a=[],l=n,c,d=!1,u=(_,b)=>{let E=Ym(b);a.push(E),!l&&_===1&&(l=E),!c&&_>=2&&(d=!0)};for(let _=0;_");)_++;continue}if(!c&&!d&&k&&!/^([-*+]|\d+\.)\s/.test(k)&&!k.startsWith("|")&&!k.startsWith("<")){let C=Ym(k);C.length>=8&&zx(C)&&!C.endsWith(":")&&!Gx(C)&&(c=C.slice(0,200))}}let f=[],m=new Set,g=_=>{let b=_.trim();b=b.replace(/\s+["'(].*$/,"").trim(),b=b.replace(/^<|>$/g,""),!Hx(b)&&(m.has(b)||(m.add(b),f.push({kind:"doc-link",spec:b})))},p=/!?\[[^\]]*\]\(([^)]+)\)/g,h;for(;h=p.exec(s);)g(h[1]);let y=/^\s*\[[^\]]+\]:\s+(\S+)/gm;for(;h=y.exec(s);)g(h[1]);return{title:l,summary:c,headings:a,refs:f}}var qx,Jx,Lc=U(()=>{"use strict";A();qx=/^ {0,3}(=+|-+)\s*$/;Jx=/^>\s*\[!(?:note|tip|important|warning|caution)\]\s*$/i});function Kx(e,t){if(!oa.test(e))return!1;let n=e.trimEnd().length;return n>=[...t.trim()].length||n>=4}function Qm(e){return e.replace(/``([^`]+)``/g,"$1").replace(/:[\w:.+-]+:`([^`<]*?)\s*<[^`>]*>`/g,"$1").replace(/:doc:`([^`]*)`/g,(t,n)=>n.slice(n.lastIndexOf("/")+1)).replace(/:[\w:.+-]+:`!?~?([^`]*)`/g,(t,n)=>n.startsWith("~")?n.slice(n.lastIndexOf(".")+1):n).replace(/`([^`<]*?)\s*<[^`>]*>`__?/g,"$1").replace(/`([^`]+)`__?/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\*\*([^*]+)\*\*/g,"$1").replace(/\*([^*]+)\*/g,"$1").replace(/\|([^|\s][^|]*)\|/g,"$1").replace(/\s+/g," ").trim()}function jc(e,t,n,r){let s=t.trim();if(!s||s==="self"||/[:*?[\]\s]/.test(s))return;if(!s.startsWith("/")){r({kind:"doc-link",spec:s+n});return}let o=e.split("/").length-1;for(let a=0;a<=o;a++)r({kind:"doc-link",spec:"../".repeat(a)+s.slice(1)+n,soft:!0})}function Bc(e,t){let n=t.split(/\r?\n/),r=[],s,o,a=[],l=!1,c=[],d=new Set,u=_=>{let b=`${_.soft?"~":""}${_.spec}`;d.has(b)||(d.add(b),c.push(_))},f=(_,b)=>{let E=a.indexOf(_);E===-1&&(E=a.push(_)-1);let S=Qm(b);r.push(S),s||(s=S),E>0&&!o&&(l=!0)},m=_=>!(n[_]??"").trim();for(let _=0;_]+)>\s*$/.exec(O);jc(e,x?x[1]:O,".rst",u)}else Yx.has(k)||g($)}_=v-1;continue}if(/^\s*\.\.(?:\s|$)/.test(b)){_=p(_);continue}g(b),!o&&!l&&h(_)&&(o=y(_)),/::\s*$/.test(b)&&(_=p(_))}return{title:s,summary:o,headings:r,refs:c};function g(_){for(let b of _.matchAll(Zx))jc(e,b[1]??b[2],".rst",u)}function p(_){let b=Wc(n[_]);for(;_+1b);)_++;return _}function h(_){let b=n[_];return!!b.trim()&&!/^\s/.test(b)&&(_===0||m(_-1))}function y(_){if(/^(?:[-*+•]\s|#\.\s|\d+[.)]\s|\(?[a-z0-9]\)\s|[+=|]|:[^:\s][^:]*:(?:\s|$))/i.test(n[_]))return;let b=[];for(let k=_;k{"use strict";A();oa=/^([!-/:-@[-`{-~])\1+\s*$/;Wc=e=>e.length-e.trimStart().length,Xx=/^(\s*)\.\.\s+([\w:-]+)::\s*(.*)$/,Zx=/:doc:`(?:[^`<]*<([^`>]+)>|([^`]+))`/g,Yx=new Set(["code-block","code","sourcecode","literalinclude","doctest","testcode","testoutput","testsetup","testcleanup","ipython","math","raw","graphviz","productionlist","highlight","jinja"])});function rS(e){return e.lengthep?!1:nS.test(e)}function sS(e){let t=e.trim();return!t||t.length>ep||tS.has(t)?!1:Number.isFinite(Number(t))}function Hc(e){let t=e,n=/^(?:[rRbBuUfF]{1,2}|@|\$)?(?:#*)?(['"`])/.exec(t);if(n){let r=n[1],s=t.indexOf(r),o=t.lastIndexOf(r),a=t.startsWith(r.repeat(3),s)&&o-s>=5&&t.endsWith(r.repeat(3),o+1)?3:1;o>s&&(t=t.slice(s+a,o+1-a))}return t}var ep,Qx,eS,tS,nS,zn,aa=U(()=>{"use strict";A();le();ep=80,Qx=2,eS=256,tS=new Set(["0","1","-1","2","-2"]),nS=/[\p{L}\p{N}]/u;zn=class{seen=new Set;out=[];get full(){return this.out.length>=eS}add(t,n,r){if(this.full||t==="string"&&!rS(n)||t==="number"&&!sS(n)||t==="regex"&&!n)return;let s=`${t}\0${n}\0${r}`;this.seen.has(s)||(this.seen.add(s),this.out.push({value:n,line:r,kind:t}))}addString(t,n){this.add("string",Hc(t),n)}result(){if(this.out.length)return this.out.sort((t,n)=>T(t.value,n.value)||t.line-n.line||T(t.kind,n.kind))}}});function tp(){return"/home"}function np(){return"/tmp"}function la(){return typeof navigator<"u"&&navigator?.hardwareConcurrency?navigator.hardwareConcurrency:1}function rp(){return Array.from({length:la()},()=>({model:"browser",speed:0,times:{user:0,nice:0,sys:0,idle:0,irq:0}}))}var ca=U(()=>{A()});function da(e){let t=typeof e=="string"?e:e.href;try{return decodeURIComponent(new URL(t).pathname)}catch{return t}}function li(e){return new URL(`file://${e.startsWith("/")?"":"/"}${e}`)}var ua=U(()=>{A()});var zc={};ac(zc,{createRequire:()=>oS,default:()=>aS});var oS,aS,Gc=U(()=>{A();oS=()=>{throw new Error("node-only API in the browser build")},aS={}});function os(e){if(e!==Gn)throw new Error("Illegal constructor")}function di(e){return!!e&&typeof e.row=="number"&&typeof e.column=="number"}function up(e){M=e}function as(e){try{return new FinalizationRegistry(e)}catch(t){console.error("Unsupported FinalizationRegistry:",t);return}}function Zc(e,t,n,r){let s=n-t,o=e.textCallback(t,r);if(o){for(t+=o.length;t0)t+=a.length,o+=a;else break}t>n&&(o=o.slice(0,s))}return o??""}function Xc(e,t,n,r,s){for(let o=0,a=s.length;o>>0,column:M.getValue(e+re,"i32")>>>0}}function mp(e,t){Nt(e,t.startPosition),e+=un,Nt(e,t.endPosition),e+=un,M.setValue(e,t.startIndex,"i32"),e+=re,M.setValue(e,t.endIndex,"i32"),e+=re}function ma(e){let t={};return t.startPosition=xr(e),e+=un,t.endPosition=xr(e),e+=un,t.startIndex=M.getValue(e,"i32")>>>0,e+=re,t.endIndex=M.getValue(e,"i32")>>>0,t}function pp(e,t=ne){Nt(t,e.startPosition),t+=un,Nt(t,e.oldEndPosition),t+=un,Nt(t,e.newEndPosition),t+=un,M.setValue(t,e.startIndex,"i32"),t+=re,M.setValue(t,e.oldEndIndex,"i32"),t+=re,M.setValue(t,e.newEndIndex,"i32"),t+=re}function gp(e){let t=M.getValue(e,"i32"),n=M.getValue(e+=re,"i32"),r=M.getValue(e+=re,"i32");return{major_version:t,minor_version:n,patch_version:r}}async function hp(moduleArg={}){var moduleRtn,Module=moduleArg,ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof WorkerGlobalScope<"u",ENVIRONMENT_IS_NODE=typeof F=="object"&&F.versions?.node&&F.type!="renderer";if(ENVIRONMENT_IS_NODE){let{createRequire:e}=await Promise.resolve().then(()=>(Gc(),zc));var require=e(import.meta.url)}Module.currentQueryProgressCallback=null,Module.currentProgressCallback=null,Module.currentLogCallback=null,Module.currentParseCallback=null;var arguments_=[],thisProgram="./this.program",quit_=D((e,t)=>{throw t},"quit_"),_scriptName=import.meta.url,scriptDirectory="";function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}D(locateFile,"locateFile");var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs");_scriptName.startsWith("file:")&&(scriptDirectory=require("path").dirname(require("url").fileURLToPath(_scriptName))+"/"),readBinary=D(e=>{e=isFileURI(e)?new URL(e):e;var t=fs.readFileSync(e);return t},"readBinary"),readAsync=D(async(e,t=!0)=>{e=isFileURI(e)?new URL(e):e;var n=fs.readFileSync(e,t?void 0:"utf8");return n},"readAsync"),F.argv.length>1&&(thisProgram=F.argv[1].replace(/\\/g,"/")),arguments_=F.argv.slice(2),quit_=D((e,t)=>{throw F.exitCode=e,t},"quit_")}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){try{scriptDirectory=new URL(".",_scriptName).href}catch{}ENVIRONMENT_IS_WORKER&&(readBinary=D(e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)},"readBinary")),readAsync=D(async e=>{if(isFileURI(e))return new Promise((n,r)=>{var s=new XMLHttpRequest;s.open("GET",e,!0),s.responseType="arraybuffer",s.onload=()=>{if(s.status==200||s.status==0&&s.response){n(s.response);return}r(s.status)},s.onerror=r,s.send(null)});var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw new Error(t.status+" : "+t.url)},"readAsync")}var out=console.log.bind(console),err=console.error.bind(console),dynamicLibraries=[],wasmBinary,ABORT=!1,EXITSTATUS,isFileURI=D(e=>e.startsWith("file://"),"isFileURI"),readyPromiseResolve,readyPromiseReject,wasmMemory,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,HEAP64,HEAPU64,HEAP_DATA_VIEW,runtimeInitialized=!1;function updateMemoryViews(){var e=wasmMemory.buffer;Module.HEAP8=HEAP8=new Int8Array(e),Module.HEAP16=HEAP16=new Int16Array(e),Module.HEAPU8=HEAPU8=new Uint8Array(e),Module.HEAPU16=HEAPU16=new Uint16Array(e),Module.HEAP32=HEAP32=new Int32Array(e),Module.HEAPU32=HEAPU32=new Uint32Array(e),Module.HEAPF32=HEAPF32=new Float32Array(e),Module.HEAPF64=HEAPF64=new Float64Array(e),Module.HEAP64=HEAP64=new BigInt64Array(e),Module.HEAPU64=HEAPU64=new BigUint64Array(e),Module.HEAP_DATA_VIEW=HEAP_DATA_VIEW=new DataView(e),LE_HEAP_UPDATE()}D(updateMemoryViews,"updateMemoryViews");function initMemory(){if(Module.wasmMemory)wasmMemory=Module.wasmMemory;else{var e=Module.INITIAL_MEMORY||33554432;wasmMemory=new WebAssembly.Memory({initial:e/65536,maximum:32768})}updateMemoryViews()}D(initMemory,"initMemory");var __RELOC_FUNCS__=[];function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(onPreRuns)}D(preRun,"preRun");function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),wasmExports.__wasm_call_ctors(),callRuntimeCallbacks(onPostCtors)}D(initRuntime,"initRuntime");function preMain(){}D(preMain,"preMain");function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(onPostRuns)}D(postRun,"postRun");function abort(e){Module.onAbort?.(e),e="Aborted("+e+")",err(e),ABORT=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw readyPromiseReject?.(t),t}D(abort,"abort");var wasmBinaryFile;function findWasmBinary(){return Module.locateFile?locateFile("web-tree-sitter.wasm"):new URL("web-tree-sitter.wasm",import.meta.url).href}D(findWasmBinary,"findWasmBinary");function getBinarySync(e){if(e==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(e);throw"both async and sync fetching of the wasm failed"}D(getBinarySync,"getBinarySync");async function getWasmBinary(e){if(!wasmBinary)try{var t=await readAsync(e);return new Uint8Array(t)}catch{}return getBinarySync(e)}D(getWasmBinary,"getWasmBinary");async function instantiateArrayBuffer(e,t){try{var n=await getWasmBinary(e),r=await WebAssembly.instantiate(n,t);return r}catch(s){err(`failed to asynchronously prepare wasm: ${s}`),abort(s)}}D(instantiateArrayBuffer,"instantiateArrayBuffer");async function instantiateAsync(e,t,n){if(!e&&!isFileURI(t)&&!ENVIRONMENT_IS_NODE)try{var r=fetch(t,{credentials:"same-origin"}),s=await WebAssembly.instantiateStreaming(r,n);return s}catch(o){err(`wasm streaming compile failed: ${o}`),err("falling back to ArrayBuffer instantiation")}return instantiateArrayBuffer(t,n)}D(instantiateAsync,"instantiateAsync");function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}D(getWasmImports,"getWasmImports");async function createWasm(){function e(o,a){wasmExports=o.exports,wasmExports=relocateExports(wasmExports,1024);var l=getDylinkMetadata(a);return l.neededDynlibs&&(dynamicLibraries=l.neededDynlibs.concat(dynamicLibraries)),mergeLibSymbols(wasmExports,"main"),LDSO.init(),loadDylibs(),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),assignWasmExports(wasmExports),wasmExports}D(e,"receiveInstance");function t(o){return e(o.instance,o.module)}D(t,"receiveInstantiationResult");var n=getWasmImports();if(Module.instantiateWasm)return new Promise((o,a)=>{Module.instantiateWasm(n,(l,c)=>{o(e(l,c))})});wasmBinaryFile??=findWasmBinary();var r=await instantiateAsync(wasmBinary,wasmBinaryFile,n),s=t(r);return s}D(createWasm,"createWasm");class ExitStatus{static{D(this,"ExitStatus")}name="ExitStatus";constructor(t){this.message=`Program terminated with exit(${t})`,this.status=t}}var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(e,t){var n=GOT[t];return n||(n=GOT[t]=new WebAssembly.Global({value:"i32",mutable:!0})),currentModuleWeakSymbols.has(t)||(n.required=!0),n}},LE_ATOMICS_NATIVE_BYTE_ORDER=[],LE_HEAP_LOAD_F32=D(e=>HEAP_DATA_VIEW.getFloat32(e,!0),"LE_HEAP_LOAD_F32"),LE_HEAP_LOAD_F64=D(e=>HEAP_DATA_VIEW.getFloat64(e,!0),"LE_HEAP_LOAD_F64"),LE_HEAP_LOAD_I16=D(e=>HEAP_DATA_VIEW.getInt16(e,!0),"LE_HEAP_LOAD_I16"),LE_HEAP_LOAD_I32=D(e=>HEAP_DATA_VIEW.getInt32(e,!0),"LE_HEAP_LOAD_I32"),LE_HEAP_LOAD_I64=D(e=>HEAP_DATA_VIEW.getBigInt64(e,!0),"LE_HEAP_LOAD_I64"),LE_HEAP_LOAD_U32=D(e=>HEAP_DATA_VIEW.getUint32(e,!0),"LE_HEAP_LOAD_U32"),LE_HEAP_STORE_F32=D((e,t)=>HEAP_DATA_VIEW.setFloat32(e,t,!0),"LE_HEAP_STORE_F32"),LE_HEAP_STORE_F64=D((e,t)=>HEAP_DATA_VIEW.setFloat64(e,t,!0),"LE_HEAP_STORE_F64"),LE_HEAP_STORE_I16=D((e,t)=>HEAP_DATA_VIEW.setInt16(e,t,!0),"LE_HEAP_STORE_I16"),LE_HEAP_STORE_I32=D((e,t)=>HEAP_DATA_VIEW.setInt32(e,t,!0),"LE_HEAP_STORE_I32"),LE_HEAP_STORE_I64=D((e,t)=>HEAP_DATA_VIEW.setBigInt64(e,t,!0),"LE_HEAP_STORE_I64"),LE_HEAP_STORE_U32=D((e,t)=>HEAP_DATA_VIEW.setUint32(e,t,!0),"LE_HEAP_STORE_U32"),callRuntimeCallbacks=D(e=>{for(;e.length>0;)e.shift()(Module)},"callRuntimeCallbacks"),onPostRuns=[],addOnPostRun=D(e=>onPostRuns.push(e),"addOnPostRun"),onPreRuns=[],addOnPreRun=D(e=>onPreRuns.push(e),"addOnPreRun"),UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,findStringEnd=D((e,t,n,r)=>{var s=t+n;if(r)return s;for(;e[t]&&!(t>=s);)++t;return t},"findStringEnd"),UTF8ArrayToString=D((e,t=0,n,r)=>{var s=findStringEnd(e,t,n,r);if(s-t>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,s));for(var o="";t>10,56320|d&1023)}}return o},"UTF8ArrayToString"),getDylinkMetadata=D(e=>{var t=0,n=0;function r(){return e[t++]}D(r,"getU8");function s(){for(var R=0,I=1;;){var N=e[t++];if(R+=(N&127)*I,I*=128,!(N&128))break}return R}D(s,"getLEB");function o(){var R=s();return t+=R,UTF8ArrayToString(e,t-R,R)}D(o,"getString");function a(){for(var R=s(),I=[];R--;)I.push(o());return I}D(a,"getStringList");function l(R,I){if(R)throw new Error(I)}if(D(l,"failIf"),e instanceof WebAssembly.Module){var c=WebAssembly.Module.customSections(e,"dylink.0");l(c.length===0,"need dylink section"),e=new Uint8Array(c[0]),n=e.length}else{var d=new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer),u=d[0]==1836278016||d[0]==6386541;l(!u,"need to see wasm magic number"),l(e[8]!==0,"need the dylink section to be first"),t=9;var f=s();n=t+f;var m=o();l(m!=="dylink.0")}for(var g={neededDynlibs:[],tlsExports:new Set,weakImports:new Set,runtimePaths:[]},p=1,h=2,y=3,_=4,b=5,E=256,S=3,k=1;t>1)*2);case"i32":return LE_HEAP_LOAD_I32((e>>2)*4);case"i64":return LE_HEAP_LOAD_I64((e>>3)*8);case"float":return LE_HEAP_LOAD_F32((e>>2)*4);case"double":return LE_HEAP_LOAD_F64((e>>3)*8);case"*":return LE_HEAP_LOAD_U32((e>>2)*4);default:abort(`invalid type for getValue: ${t}`)}}D(getValue,"getValue");var newDSO=D((e,t,n)=>{var r={refcount:1/0,name:e,exports:n,global:!0};return LDSO.loadedLibsByName[e]=r,t!=null&&(LDSO.loadedLibsByHandle[t]=r),r},"newDSO"),LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=82240,alignMemory=D((e,t)=>Math.ceil(e/t)*t,"alignMemory"),getMemory=D(e=>{if(runtimeInitialized)return _calloc(e,1);var t=___heap_base,n=t+alignMemory(e,16);return ___heap_base=n,GOT.__heap_base.value=n,t},"getMemory"),isInternalSym=D(e=>["__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(e)||e.startsWith("__em_js__"),"isInternalSym"),uleb128EncodeWithLen=D(e=>{let t=e.length;return[t%128|128,t>>7,...e]},"uleb128EncodeWithLen"),wasmTypeCodes={i:127,p:127,j:126,f:125,d:124,e:111},generateTypePack=D(e=>uleb128EncodeWithLen(Array.from(e,t=>{var n=wasmTypeCodes[t];return n})),"generateTypePack"),convertJsFunctionToWasm=D((e,t)=>{var n=Uint8Array.of(0,97,115,109,1,0,0,0,1,...uleb128EncodeWithLen([1,96,...generateTypePack(t.slice(1)),...generateTypePack(t[0]==="v"?"":t[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),r=new WebAssembly.Module(n),s=new WebAssembly.Instance(r,{e:{f:e}}),o=s.exports.f;return o},"convertJsFunctionToWasm"),wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:31,element:"anyfunc"}),getWasmTableEntry=D(e=>{var t=wasmTableMirror[e];return t||(wasmTableMirror[e]=t=wasmTable.get(e)),t},"getWasmTableEntry"),updateTableMap=D((e,t)=>{if(functionsInTableMap)for(var n=e;n(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(e)||0),"getFunctionAddress"),freeTableIndexes=[],getEmptyTableSlot=D(()=>freeTableIndexes.length?freeTableIndexes.pop():wasmTable.grow(1),"getEmptyTableSlot"),setWasmTableEntry=D((e,t)=>{wasmTable.set(e,t),wasmTableMirror[e]=wasmTable.get(e)},"setWasmTableEntry"),addFunction=D((e,t)=>{var n=getFunctionAddress(e);if(n)return n;var r=getEmptyTableSlot();try{setWasmTableEntry(r,e)}catch(o){if(!(o instanceof TypeError))throw o;var s=convertJsFunctionToWasm(e,t);setWasmTableEntry(r,s)}return functionsInTableMap.set(e,r),r},"addFunction"),updateGOT=D((e,t)=>{for(var n in e)if(!isInternalSym(n)){var r=e[n];GOT[n]||=new WebAssembly.Global({value:"i32",mutable:!0}),(t||GOT[n].value==0)&&(typeof r=="function"?GOT[n].value=addFunction(r):typeof r=="number"?GOT[n].value=r:err(`unhandled export type for '${n}': ${typeof r}`))}},"updateGOT"),relocateExports=D((e,t,n)=>{var r={};for(var s in e){var o=e[s];typeof o=="object"&&(o=o.value),typeof o=="number"&&(o+=t),r[s]=o}return updateGOT(r,n),r},"relocateExports"),isSymbolDefined=D(e=>{var t=wasmImports[e];return!(!t||t.stub)},"isSymbolDefined"),dynCall=D((e,t,n=[],r=!1)=>{var s=getWasmTableEntry(t),o=s(...n);function a(l){return l}return D(a,"convert"),o},"dynCall"),stackSave=D(()=>_emscripten_stack_get_current(),"stackSave"),stackRestore=D(e=>__emscripten_stack_restore(e),"stackRestore"),createInvokeFunction=D(e=>(t,...n)=>{var r=stackSave();try{return dynCall(e,t,n)}catch(s){if(stackRestore(r),s!==s+0)throw s;if(_setThrew(1,0),e[0]=="j")return 0n}},"createInvokeFunction"),resolveGlobalSymbol=D((e,t=!1)=>{var n;return isSymbolDefined(e)?n=wasmImports[e]:e.startsWith("invoke_")&&(n=wasmImports[e]=createInvokeFunction(e.split("_")[1])),{sym:n,name:e}},"resolveGlobalSymbol"),onPostCtors=[],addOnPostCtor=D(e=>onPostCtors.push(e),"addOnPostCtor"),UTF8ToString=D((e,t,n)=>e?UTF8ArrayToString(HEAPU8,e,t,n):"","UTF8ToString"),loadWebAssemblyModule=D((binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);function loadModule(){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;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);var moduleExports;function resolveSymbol(e){var t=resolveGlobalSymbol(e).sym;return!t&&localScope&&(t=localScope[e]),t||(t=moduleExports[e]),t}D(resolveSymbol,"resolveSymbol");var proxyHandler={get(e,t){switch(t){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(t in wasmImports&&!wasmImports[t].stub){var n=wasmImports[t];return n}if(!(t in e)){var r;e[t]=(...s)=>(r||=resolveSymbol(t),r(...s))}return e[t]}},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){updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols();function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if(D(addEmAsm,"addEmAsm"),"__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;start ${body};`;moduleExports[name]=eval(func)}D(addEmJs,"addEmJs");for(var name in 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(D(postInstantiation,"postInstantiation"),flags.loadAsync)return(async()=>{var e;return binary instanceof WebAssembly.Module?e=new WebAssembly.Instance(binary,info):{module:binary,instance:e}=await WebAssembly.instantiate(binary,info),postInstantiation(binary,e)})();var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}return D(loadModule,"loadModule"),flags={...flags,rpath:{parentLibPath:libName,paths:metadata.runtimePaths}},flags.loadAsync?metadata.neededDynlibs.reduce((e,t)=>e.then(()=>loadDynamicLibrary(t,flags,localScope)),Promise.resolve()).then(loadModule):(metadata.neededDynlibs.forEach(e=>loadDynamicLibrary(e,flags,localScope)),loadModule())},"loadWebAssemblyModule"),mergeLibSymbols=D((e,t)=>{for(var[n,r]of Object.entries(e)){let s=D(a=>{isSymbolDefined(a)||(wasmImports[a]=r)},"setImport");s(n);let o="__main_argc_argv";n=="main"&&s(o),n==o&&s("main")}},"mergeLibSymbols"),asyncLoad=D(async e=>{var t=await readAsync(e);return new Uint8Array(t)},"asyncLoad");function loadDynamicLibrary(e,t={global:!0,nodelete:!0},n,r){var s=LDSO.loadedLibsByName[e];if(s)return t.global?s.global||(s.global=!0,mergeLibSymbols(s.exports,e)):n&&Object.assign(n,s.exports),t.nodelete&&s.refcount!==1/0&&(s.refcount=1/0),s.refcount++,r&&(LDSO.loadedLibsByHandle[r]=s),t.loadAsync?Promise.resolve(!0):!0;s=newDSO(e,r,"loading"),s.refcount=t.nodelete?1/0:1,s.global=t.global;function o(){if(r){var c=LE_HEAP_LOAD_U32((r+28>>2)*4),d=LE_HEAP_LOAD_U32((r+32>>2)*4);if(c&&d){var u=HEAP8.slice(c,c+d);return t.loadAsync?Promise.resolve(u):u}}var f=locateFile(e);if(t.loadAsync)return asyncLoad(f);if(!readBinary)throw new Error(`${f}: file not found, and synchronous loading of external files is not available`);return readBinary(f)}D(o,"loadLibData");function a(){return t.loadAsync?o().then(c=>loadWebAssemblyModule(c,t,e,n,r)):loadWebAssemblyModule(o(),t,e,n,r)}D(a,"getExports");function l(c){s.global?mergeLibSymbols(c,e):n&&Object.assign(n,c),s.exports=c}return D(l,"moduleLoaded"),t.loadAsync?a().then(c=>(l(c),!0)):(l(a()),!0)}D(loadDynamicLibrary,"loadDynamicLibrary");var reportUndefinedSymbols=D(()=>{for(var[e,t]of Object.entries(GOT))if(t.value==0){var n=resolveGlobalSymbol(e,!0).sym;if(!n&&!t.required)continue;if(typeof n=="function")t.value=addFunction(n,n.sig);else if(typeof n=="number")t.value=n;else throw new Error(`bad export type for '${e}': ${typeof n}`)}},"reportUndefinedSymbols"),runDependencies=0,dependenciesFulfilled=null,removeRunDependency=D(e=>{if(runDependencies--,Module.monitorRunDependencies?.(runDependencies),runDependencies==0&&dependenciesFulfilled){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}},"removeRunDependency"),addRunDependency=D(e=>{runDependencies++,Module.monitorRunDependencies?.(runDependencies)},"addRunDependency"),loadDylibs=D(async()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency("loadDylibs");for(var e of dynamicLibraries)await loadDynamicLibrary(e,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0});reportUndefinedSymbols(),removeRunDependency("loadDylibs")},"loadDylibs"),noExitRuntime=!0;function setValue(e,t,n="i8"){switch(n.endsWith("*")&&(n="*"),n){case"i1":HEAP8[e]=t;break;case"i8":HEAP8[e]=t;break;case"i16":LE_HEAP_STORE_I16((e>>1)*2,t);break;case"i32":LE_HEAP_STORE_I32((e>>2)*4,t);break;case"i64":LE_HEAP_STORE_I64((e>>3)*8,BigInt(t));break;case"float":LE_HEAP_STORE_F32((e>>2)*4,t);break;case"double":LE_HEAP_STORE_F64((e>>3)*8,t);break;case"*":LE_HEAP_STORE_U32((e>>2)*4,t);break;default:abort(`invalid type for setValue: ${n}`)}}D(setValue,"setValue");var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_high=82240,___stack_low=16704,___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},82240),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),__abort_js=D(()=>abort(""),"__abort_js");__abort_js.sig="v";var getHeapMax=D(()=>2147483648,"getHeapMax"),growMemory=D(e=>{var t=wasmMemory.buffer.byteLength,n=(e-t+65535)/65536|0;try{return wasmMemory.grow(n),updateMemoryViews(),1}catch{}},"growMemory"),_emscripten_resize_heap=D(e=>{var t=HEAPU8.length;e>>>=0;var n=getHeapMax();if(e>n)return!1;for(var r=1;r<=4;r*=2){var s=t*(1+.2/r);s=Math.min(s,e+100663296);var o=Math.min(n,alignMemory(Math.max(e,s),65536)),a=growMemory(o);if(a)return!0}return!1},"_emscripten_resize_heap");_emscripten_resize_heap.sig="ip";var _fd_close=D(e=>52,"_fd_close");_fd_close.sig="ii";var INT53_MAX=9007199254740992,INT53_MIN=-9007199254740992,bigintToI53Checked=D(e=>eINT53_MAX?NaN:Number(e),"bigintToI53Checked");function _fd_seek(e,t,n,r){return t=bigintToI53Checked(t),70}D(_fd_seek,"_fd_seek"),_fd_seek.sig="iijip";var printCharBuffers=[null,[],[]],printChar=D((e,t)=>{var n=printCharBuffers[e];t===0||t===10?((e===1?out:err)(UTF8ArrayToString(n)),n.length=0):n.push(t)},"printChar"),_fd_write=D((e,t,n,r)=>{for(var s=0,o=0;o>2)*4),l=LE_HEAP_LOAD_U32((t+4>>2)*4);t+=8;for(var c=0;c>2)*4,s),0},"_fd_write");_fd_write.sig="iippp";function _tree_sitter_log_callback(e,t){if(Module.currentLogCallback){let n=UTF8ToString(t);Module.currentLogCallback(n,e!==0)}}D(_tree_sitter_log_callback,"_tree_sitter_log_callback");function _tree_sitter_parse_callback(e,t,n,r,s){let a=Module.currentParseCallback(t,{row:n,column:r});typeof a=="string"?(setValue(s,a.length,"i32"),stringToUTF16(a,e,10240)):setValue(s,0,"i32")}D(_tree_sitter_parse_callback,"_tree_sitter_parse_callback");function _tree_sitter_progress_callback(e,t){return Module.currentProgressCallback?Module.currentProgressCallback({currentOffset:e,hasError:t}):!1}D(_tree_sitter_progress_callback,"_tree_sitter_progress_callback");function _tree_sitter_query_progress_callback(e){return Module.currentQueryProgressCallback?Module.currentQueryProgressCallback({currentOffset:e}):!1}D(_tree_sitter_query_progress_callback,"_tree_sitter_query_progress_callback");var runtimeKeepaliveCounter=0,keepRuntimeAlive=D(()=>noExitRuntime||runtimeKeepaliveCounter>0,"keepRuntimeAlive"),_proc_exit=D(e=>{EXITSTATUS=e,keepRuntimeAlive()||(Module.onExit?.(e),ABORT=!0),quit_(e,new ExitStatus(e))},"_proc_exit");_proc_exit.sig="vi";var exitJS=D((e,t)=>{EXITSTATUS=e,_proc_exit(e)},"exitJS"),handleException=D(e=>{if(e instanceof ExitStatus||e=="unwind")return EXITSTATUS;quit_(1,e)},"handleException"),lengthBytesUTF8=D(e=>{for(var t=0,n=0;n=55296&&r<=57343?(t+=4,++n):t+=3}return t},"lengthBytesUTF8"),stringToUTF8Array=D((e,t,n,r)=>{if(!(r>0))return 0;for(var s=n,o=n+r-1,a=0;a=o)break;t[n++]=l}else if(l<=2047){if(n+1>=o)break;t[n++]=192|l>>6,t[n++]=128|l&63}else if(l<=65535){if(n+2>=o)break;t[n++]=224|l>>12,t[n++]=128|l>>6&63,t[n++]=128|l&63}else{if(n+3>=o)break;t[n++]=240|l>>18,t[n++]=128|l>>12&63,t[n++]=128|l>>6&63,t[n++]=128|l&63,a++}}return t[n]=0,n-s},"stringToUTF8Array"),stringToUTF8=D((e,t,n)=>stringToUTF8Array(e,HEAPU8,t,n),"stringToUTF8"),stackAlloc=D(e=>__emscripten_stack_alloc(e),"stackAlloc"),stringToUTF8OnStack=D(e=>{var t=lengthBytesUTF8(e)+1,n=stackAlloc(t);return stringToUTF8(e,n,t),n},"stringToUTF8OnStack"),AsciiToString=D(e=>{for(var t="";;){var n=HEAPU8[e++];if(!n)return t;t+=String.fromCharCode(n)}},"AsciiToString"),stringToUTF16=D((e,t,n)=>{if(n??=2147483647,n<2)return 0;n-=2;for(var r=t,s=n>1)*2,a),t+=2}return LE_HEAP_STORE_I16((t>>1)*2,0),t-r},"stringToUTF16");LE_ATOMICS_NATIVE_BYTE_ORDER=new Int8Array(new Int16Array([1]).buffer)[0]===1?[(e=>e),(e=>e),void 0,(e=>e)]:[(e=>e),(e=>((e&65280)<<8|(e&255)<<24)>>16),void 0,(e=>e>>24&255|e>>8&65280|(e&65280)<<8|(e&255)<<24)];function LE_HEAP_UPDATE(){HEAPU16.unsigned=(e=>e&65535),HEAPU32.unsigned=(e=>e>>>0)}if(D(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(typeof Module.preInit=="function"&&(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={},_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_copy,_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,_iswpunct,_iswupper,_iswxdigit,_memchr,_strlen,_strcmp,_strncat,_strncpy,_towlower,_towupper,_setThrew,__emscripten_stack_restore,__emscripten_stack_alloc,_emscripten_stack_get_current,___wasm_apply_data_relocs;function assignWasmExports(e){Module._malloc=_malloc=e.malloc,Module._calloc=_calloc=e.calloc,Module._realloc=_realloc=e.realloc,Module._free=_free=e.free,Module._ts_range_edit=_ts_range_edit=e.ts_range_edit,Module._memcmp=_memcmp=e.memcmp,Module._ts_language_symbol_count=_ts_language_symbol_count=e.ts_language_symbol_count,Module._ts_language_state_count=_ts_language_state_count=e.ts_language_state_count,Module._ts_language_abi_version=_ts_language_abi_version=e.ts_language_abi_version,Module._ts_language_name=_ts_language_name=e.ts_language_name,Module._ts_language_field_count=_ts_language_field_count=e.ts_language_field_count,Module._ts_language_next_state=_ts_language_next_state=e.ts_language_next_state,Module._ts_language_symbol_name=_ts_language_symbol_name=e.ts_language_symbol_name,Module._ts_language_symbol_for_name=_ts_language_symbol_for_name=e.ts_language_symbol_for_name,Module._strncmp=_strncmp=e.strncmp,Module._ts_language_symbol_type=_ts_language_symbol_type=e.ts_language_symbol_type,Module._ts_language_field_name_for_id=_ts_language_field_name_for_id=e.ts_language_field_name_for_id,Module._ts_lookahead_iterator_new=_ts_lookahead_iterator_new=e.ts_lookahead_iterator_new,Module._ts_lookahead_iterator_delete=_ts_lookahead_iterator_delete=e.ts_lookahead_iterator_delete,Module._ts_lookahead_iterator_reset_state=_ts_lookahead_iterator_reset_state=e.ts_lookahead_iterator_reset_state,Module._ts_lookahead_iterator_reset=_ts_lookahead_iterator_reset=e.ts_lookahead_iterator_reset,Module._ts_lookahead_iterator_next=_ts_lookahead_iterator_next=e.ts_lookahead_iterator_next,Module._ts_lookahead_iterator_current_symbol=_ts_lookahead_iterator_current_symbol=e.ts_lookahead_iterator_current_symbol,Module._ts_point_edit=_ts_point_edit=e.ts_point_edit,Module._ts_parser_delete=_ts_parser_delete=e.ts_parser_delete,Module._ts_parser_reset=_ts_parser_reset=e.ts_parser_reset,Module._ts_parser_set_language=_ts_parser_set_language=e.ts_parser_set_language,Module._ts_parser_set_included_ranges=_ts_parser_set_included_ranges=e.ts_parser_set_included_ranges,Module._ts_query_new=_ts_query_new=e.ts_query_new,Module._ts_query_delete=_ts_query_delete=e.ts_query_delete,Module._iswspace=_iswspace=e.iswspace,Module._iswalnum=_iswalnum=e.iswalnum,Module._ts_query_copy=_ts_query_copy=e.ts_query_copy,Module._ts_query_pattern_count=_ts_query_pattern_count=e.ts_query_pattern_count,Module._ts_query_capture_count=_ts_query_capture_count=e.ts_query_capture_count,Module._ts_query_string_count=_ts_query_string_count=e.ts_query_string_count,Module._ts_query_capture_name_for_id=_ts_query_capture_name_for_id=e.ts_query_capture_name_for_id,Module._ts_query_capture_quantifier_for_id=_ts_query_capture_quantifier_for_id=e.ts_query_capture_quantifier_for_id,Module._ts_query_string_value_for_id=_ts_query_string_value_for_id=e.ts_query_string_value_for_id,Module._ts_query_predicates_for_pattern=_ts_query_predicates_for_pattern=e.ts_query_predicates_for_pattern,Module._ts_query_start_byte_for_pattern=_ts_query_start_byte_for_pattern=e.ts_query_start_byte_for_pattern,Module._ts_query_end_byte_for_pattern=_ts_query_end_byte_for_pattern=e.ts_query_end_byte_for_pattern,Module._ts_query_is_pattern_rooted=_ts_query_is_pattern_rooted=e.ts_query_is_pattern_rooted,Module._ts_query_is_pattern_non_local=_ts_query_is_pattern_non_local=e.ts_query_is_pattern_non_local,Module._ts_query_is_pattern_guaranteed_at_step=_ts_query_is_pattern_guaranteed_at_step=e.ts_query_is_pattern_guaranteed_at_step,Module._ts_query_disable_capture=_ts_query_disable_capture=e.ts_query_disable_capture,Module._ts_query_disable_pattern=_ts_query_disable_pattern=e.ts_query_disable_pattern,Module._ts_tree_copy=_ts_tree_copy=e.ts_tree_copy,Module._ts_tree_delete=_ts_tree_delete=e.ts_tree_delete,Module._ts_init=_ts_init=e.ts_init,Module._ts_parser_new_wasm=_ts_parser_new_wasm=e.ts_parser_new_wasm,Module._ts_parser_enable_logger_wasm=_ts_parser_enable_logger_wasm=e.ts_parser_enable_logger_wasm,Module._ts_parser_parse_wasm=_ts_parser_parse_wasm=e.ts_parser_parse_wasm,Module._ts_parser_included_ranges_wasm=_ts_parser_included_ranges_wasm=e.ts_parser_included_ranges_wasm,Module._ts_language_type_is_named_wasm=_ts_language_type_is_named_wasm=e.ts_language_type_is_named_wasm,Module._ts_language_type_is_visible_wasm=_ts_language_type_is_visible_wasm=e.ts_language_type_is_visible_wasm,Module._ts_language_metadata_wasm=_ts_language_metadata_wasm=e.ts_language_metadata_wasm,Module._ts_language_supertypes_wasm=_ts_language_supertypes_wasm=e.ts_language_supertypes_wasm,Module._ts_language_subtypes_wasm=_ts_language_subtypes_wasm=e.ts_language_subtypes_wasm,Module._ts_tree_root_node_wasm=_ts_tree_root_node_wasm=e.ts_tree_root_node_wasm,Module._ts_tree_root_node_with_offset_wasm=_ts_tree_root_node_with_offset_wasm=e.ts_tree_root_node_with_offset_wasm,Module._ts_tree_edit_wasm=_ts_tree_edit_wasm=e.ts_tree_edit_wasm,Module._ts_tree_included_ranges_wasm=_ts_tree_included_ranges_wasm=e.ts_tree_included_ranges_wasm,Module._ts_tree_get_changed_ranges_wasm=_ts_tree_get_changed_ranges_wasm=e.ts_tree_get_changed_ranges_wasm,Module._ts_tree_cursor_new_wasm=_ts_tree_cursor_new_wasm=e.ts_tree_cursor_new_wasm,Module._ts_tree_cursor_copy_wasm=_ts_tree_cursor_copy_wasm=e.ts_tree_cursor_copy_wasm,Module._ts_tree_cursor_delete_wasm=_ts_tree_cursor_delete_wasm=e.ts_tree_cursor_delete_wasm,Module._ts_tree_cursor_reset_wasm=_ts_tree_cursor_reset_wasm=e.ts_tree_cursor_reset_wasm,Module._ts_tree_cursor_reset_to_wasm=_ts_tree_cursor_reset_to_wasm=e.ts_tree_cursor_reset_to_wasm,Module._ts_tree_cursor_goto_first_child_wasm=_ts_tree_cursor_goto_first_child_wasm=e.ts_tree_cursor_goto_first_child_wasm,Module._ts_tree_cursor_goto_last_child_wasm=_ts_tree_cursor_goto_last_child_wasm=e.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=e.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=e.ts_tree_cursor_goto_first_child_for_position_wasm,Module._ts_tree_cursor_goto_next_sibling_wasm=_ts_tree_cursor_goto_next_sibling_wasm=e.ts_tree_cursor_goto_next_sibling_wasm,Module._ts_tree_cursor_goto_previous_sibling_wasm=_ts_tree_cursor_goto_previous_sibling_wasm=e.ts_tree_cursor_goto_previous_sibling_wasm,Module._ts_tree_cursor_goto_descendant_wasm=_ts_tree_cursor_goto_descendant_wasm=e.ts_tree_cursor_goto_descendant_wasm,Module._ts_tree_cursor_goto_parent_wasm=_ts_tree_cursor_goto_parent_wasm=e.ts_tree_cursor_goto_parent_wasm,Module._ts_tree_cursor_current_node_type_id_wasm=_ts_tree_cursor_current_node_type_id_wasm=e.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=e.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=e.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=e.ts_tree_cursor_current_node_is_missing_wasm,Module._ts_tree_cursor_current_node_id_wasm=_ts_tree_cursor_current_node_id_wasm=e.ts_tree_cursor_current_node_id_wasm,Module._ts_tree_cursor_start_position_wasm=_ts_tree_cursor_start_position_wasm=e.ts_tree_cursor_start_position_wasm,Module._ts_tree_cursor_end_position_wasm=_ts_tree_cursor_end_position_wasm=e.ts_tree_cursor_end_position_wasm,Module._ts_tree_cursor_start_index_wasm=_ts_tree_cursor_start_index_wasm=e.ts_tree_cursor_start_index_wasm,Module._ts_tree_cursor_end_index_wasm=_ts_tree_cursor_end_index_wasm=e.ts_tree_cursor_end_index_wasm,Module._ts_tree_cursor_current_field_id_wasm=_ts_tree_cursor_current_field_id_wasm=e.ts_tree_cursor_current_field_id_wasm,Module._ts_tree_cursor_current_depth_wasm=_ts_tree_cursor_current_depth_wasm=e.ts_tree_cursor_current_depth_wasm,Module._ts_tree_cursor_current_descendant_index_wasm=_ts_tree_cursor_current_descendant_index_wasm=e.ts_tree_cursor_current_descendant_index_wasm,Module._ts_tree_cursor_current_node_wasm=_ts_tree_cursor_current_node_wasm=e.ts_tree_cursor_current_node_wasm,Module._ts_node_symbol_wasm=_ts_node_symbol_wasm=e.ts_node_symbol_wasm,Module._ts_node_field_name_for_child_wasm=_ts_node_field_name_for_child_wasm=e.ts_node_field_name_for_child_wasm,Module._ts_node_field_name_for_named_child_wasm=_ts_node_field_name_for_named_child_wasm=e.ts_node_field_name_for_named_child_wasm,Module._ts_node_children_by_field_id_wasm=_ts_node_children_by_field_id_wasm=e.ts_node_children_by_field_id_wasm,Module._ts_node_first_child_for_byte_wasm=_ts_node_first_child_for_byte_wasm=e.ts_node_first_child_for_byte_wasm,Module._ts_node_first_named_child_for_byte_wasm=_ts_node_first_named_child_for_byte_wasm=e.ts_node_first_named_child_for_byte_wasm,Module._ts_node_grammar_symbol_wasm=_ts_node_grammar_symbol_wasm=e.ts_node_grammar_symbol_wasm,Module._ts_node_child_count_wasm=_ts_node_child_count_wasm=e.ts_node_child_count_wasm,Module._ts_node_named_child_count_wasm=_ts_node_named_child_count_wasm=e.ts_node_named_child_count_wasm,Module._ts_node_child_wasm=_ts_node_child_wasm=e.ts_node_child_wasm,Module._ts_node_named_child_wasm=_ts_node_named_child_wasm=e.ts_node_named_child_wasm,Module._ts_node_child_by_field_id_wasm=_ts_node_child_by_field_id_wasm=e.ts_node_child_by_field_id_wasm,Module._ts_node_next_sibling_wasm=_ts_node_next_sibling_wasm=e.ts_node_next_sibling_wasm,Module._ts_node_prev_sibling_wasm=_ts_node_prev_sibling_wasm=e.ts_node_prev_sibling_wasm,Module._ts_node_next_named_sibling_wasm=_ts_node_next_named_sibling_wasm=e.ts_node_next_named_sibling_wasm,Module._ts_node_prev_named_sibling_wasm=_ts_node_prev_named_sibling_wasm=e.ts_node_prev_named_sibling_wasm,Module._ts_node_descendant_count_wasm=_ts_node_descendant_count_wasm=e.ts_node_descendant_count_wasm,Module._ts_node_parent_wasm=_ts_node_parent_wasm=e.ts_node_parent_wasm,Module._ts_node_child_with_descendant_wasm=_ts_node_child_with_descendant_wasm=e.ts_node_child_with_descendant_wasm,Module._ts_node_descendant_for_index_wasm=_ts_node_descendant_for_index_wasm=e.ts_node_descendant_for_index_wasm,Module._ts_node_named_descendant_for_index_wasm=_ts_node_named_descendant_for_index_wasm=e.ts_node_named_descendant_for_index_wasm,Module._ts_node_descendant_for_position_wasm=_ts_node_descendant_for_position_wasm=e.ts_node_descendant_for_position_wasm,Module._ts_node_named_descendant_for_position_wasm=_ts_node_named_descendant_for_position_wasm=e.ts_node_named_descendant_for_position_wasm,Module._ts_node_start_point_wasm=_ts_node_start_point_wasm=e.ts_node_start_point_wasm,Module._ts_node_end_point_wasm=_ts_node_end_point_wasm=e.ts_node_end_point_wasm,Module._ts_node_start_index_wasm=_ts_node_start_index_wasm=e.ts_node_start_index_wasm,Module._ts_node_end_index_wasm=_ts_node_end_index_wasm=e.ts_node_end_index_wasm,Module._ts_node_to_string_wasm=_ts_node_to_string_wasm=e.ts_node_to_string_wasm,Module._ts_node_children_wasm=_ts_node_children_wasm=e.ts_node_children_wasm,Module._ts_node_named_children_wasm=_ts_node_named_children_wasm=e.ts_node_named_children_wasm,Module._ts_node_descendants_of_type_wasm=_ts_node_descendants_of_type_wasm=e.ts_node_descendants_of_type_wasm,Module._ts_node_is_named_wasm=_ts_node_is_named_wasm=e.ts_node_is_named_wasm,Module._ts_node_has_changes_wasm=_ts_node_has_changes_wasm=e.ts_node_has_changes_wasm,Module._ts_node_has_error_wasm=_ts_node_has_error_wasm=e.ts_node_has_error_wasm,Module._ts_node_is_error_wasm=_ts_node_is_error_wasm=e.ts_node_is_error_wasm,Module._ts_node_is_missing_wasm=_ts_node_is_missing_wasm=e.ts_node_is_missing_wasm,Module._ts_node_is_extra_wasm=_ts_node_is_extra_wasm=e.ts_node_is_extra_wasm,Module._ts_node_parse_state_wasm=_ts_node_parse_state_wasm=e.ts_node_parse_state_wasm,Module._ts_node_next_parse_state_wasm=_ts_node_next_parse_state_wasm=e.ts_node_next_parse_state_wasm,Module._ts_query_matches_wasm=_ts_query_matches_wasm=e.ts_query_matches_wasm,Module._ts_query_captures_wasm=_ts_query_captures_wasm=e.ts_query_captures_wasm,Module._memset=_memset=e.memset,Module._memcpy=_memcpy=e.memcpy,Module._memmove=_memmove=e.memmove,Module._iswalpha=_iswalpha=e.iswalpha,Module._iswblank=_iswblank=e.iswblank,Module._iswdigit=_iswdigit=e.iswdigit,Module._iswlower=_iswlower=e.iswlower,Module._iswpunct=_iswpunct=e.iswpunct,Module._iswupper=_iswupper=e.iswupper,Module._iswxdigit=_iswxdigit=e.iswxdigit,Module._memchr=_memchr=e.memchr,Module._strlen=_strlen=e.strlen,Module._strcmp=_strcmp=e.strcmp,Module._strncat=_strncat=e.strncat,Module._strncpy=_strncpy=e.strncpy,Module._towlower=_towlower=e.towlower,Module._towupper=_towupper=e.towupper,_setThrew=e.setThrew,__emscripten_stack_restore=e._emscripten_stack_restore,__emscripten_stack_alloc=e._emscripten_stack_alloc,_emscripten_stack_get_current=e.emscripten_stack_get_current,___wasm_apply_data_relocs=e.__wasm_apply_data_relocs}D(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(e=[]){var t=resolveGlobalSymbol("main").sym;if(t){e.unshift(thisProgram);var n=e.length,r=stackAlloc((n+1)*4),s=r;e.forEach(a=>{LE_HEAP_STORE_U32((s>>2)*4,stringToUTF8OnStack(a)),s+=4}),LE_HEAP_STORE_U32((s>>2)*4,0);try{var o=t(n,r);return exitJS(o,!0),o}catch(a){return handleException(a)}}}D(callMain,"callMain");function run(e=arguments_){if(runDependencies>0){dependenciesFulfilled=run;return}if(preRun(),runDependencies>0){dependenciesFulfilled=run;return}function t(){if(Module.calledRun=!0,!ABORT){initRuntime(),readyPromiseResolve?.(Module),Module.onRuntimeInitialized?.();var n=Module.noInitialRun||!1;n||callMain(e),postRun()}}D(t,"doRun"),Module.setStatus?(Module.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>Module.setStatus(""),1),t()},1)):t()}D(run,"run");var wasmExports;return wasmExports=await createWasm(),run(),runtimeInitialized?moduleRtn=Module:moduleRtn=new Promise((e,t)=>{readyPromiseResolve=e,readyPromiseReject=t}),moduleRtn}async function _p(e){return yp??=await pS(e)}function bp(){return!!yp}function xp(e,t,n,r){if(e.length!==3)throw new Error(`Wrong number of arguments to \`#${n}\` predicate. Expected 2, got ${e.length-1}`);if(!cp(e[1]))throw new Error(`First argument of \`#${n}\` predicate must be a capture. Got "${e[1].value}"`);let s=n==="eq?"||n==="any-eq?",o=!n.startsWith("any-");if(cp(e[2])){let a=e[1].name,l=e[2].name;r[t].push(c=>{let d=[],u=[];for(let m of c)m.name===a&&d.push(m.node),m.name===l&&u.push(m.node);let f=D((m,g,p)=>p?m.text===g.text:m.text!==g.text,"compare");return o?d.every(m=>u.some(g=>f(m,g,s))):d.some(m=>u.some(g=>f(m,g,s)))})}else{let a=e[1].name,l=e[2].value,c=D(u=>u.text===l,"matches"),d=D(u=>u.text!==l,"doesNotMatch");r[t].push(u=>{let f=[];for(let g of u)g.name===a&&f.push(g.node);let m=s?c:d;return o?f.every(m):f.some(m)})}}function Sp(e,t,n,r){if(e.length!==3)throw new Error(`Wrong number of arguments to \`#${n}\` predicate. Expected 2, got ${e.length-1}.`);if(e[1].type!=="capture")throw new Error(`First argument of \`#${n}\` predicate must be a capture. Got "${e[1].value}".`);if(e[2].type!=="string")throw new Error(`Second argument of \`#${n}\` predicate must be a string. Got @${e[2].name}.`);let s=n==="match?"||n==="any-match?",o=!n.startsWith("any-"),a=e[1].name,l=new RegExp(e[2].value);r[t].push(c=>{let d=[];for(let f of c)f.name===a&&d.push(f.node.text);let u=D((f,m)=>m?l.test(f):!l.test(f),"test");return d.length===0?!s:o?d.every(f=>u(f,s)):d.some(f=>u(f,s))})}function kp(e,t,n,r){if(e.length<2)throw new Error(`Wrong number of arguments to \`#${n}\` predicate. Expected at least 1. Got ${e.length-1}.`);if(e[1].type!=="capture")throw new Error(`First argument of \`#${n}\` predicate must be a capture. Got "${e[1].value}".`);let s=n==="any-of?",o=e[1].name,a=e.slice(2);if(!a.every(ed))throw new Error(`Arguments to \`#${n}\` predicate must be strings.".`);let l=a.map(c=>c.value);r[t].push(c=>{let d=[];for(let u of c)u.name===o&&d.push(u.node.text);return d.length===0?!s:d.every(u=>l.includes(u))===s})}function Ep(e,t,n,r,s){if(e.length<2||e.length>3)throw new Error(`Wrong number of arguments to \`#${n}\` predicate. Expected 1 or 2. Got ${e.length-1}.`);if(!e.every(ed))throw new Error(`Arguments to \`#${n}\` predicate must be strings.".`);let o=n==="is?"?r:s;o[t]||(o[t]={}),o[t][e[1].value]=e[2]?.value??null}function vp(e,t,n){if(e.length<2||e.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${e.length-1}.`);if(!e.every(ed))throw new Error('Arguments to `#set!` predicate must be strings.".');n[t]||(n[t]={}),n[t][e[1].value]=e[2]?.value??null}function Rp(e,t,n,r,s,o,a,l,c,d,u){if(t===gS){let f=r[n];o.push({type:"capture",name:f})}else if(t===hS)o.push({type:"string",value:s[n]});else if(o.length>0){if(o[0].type!=="string")throw new Error("Predicates must begin with a literal value");let f=o[0].value;switch(f){case"any-not-eq?":case"not-eq?":case"any-eq?":case"eq?":xp(o,e,f,a);break;case"any-not-match?":case"not-match?":case"any-match?":case"match?":Sp(o,e,f,a);break;case"not-any-of?":case"any-of?":kp(o,e,f,a);break;case"is?":case"is-not?":Ep(o,e,f,d,u);break;case"set!":vp(o,e,c);break;default:l[e].push({operator:f,operands:o.slice(1)})}o.length=0}}var lS,D,e$,sp,re,qc,_t,un,ui,yt,Gn,M,ip,cS,op,dS,ap,uS,fS,mS,Yc,pS,yp,ne,Vc,Jc,lp,Qc,gS,hS,yS,t$,cp,ed,Qt,ci,dp,Mp,td=U(()=>{A();lS=Object.defineProperty,D=(e,t)=>lS(e,"name",{value:t,configurable:!0}),e$=class{static{D(this,"Edit")}startPosition;oldEndPosition;newEndPosition;startIndex;oldEndIndex;newEndIndex;constructor({startIndex:e,oldEndIndex:t,newEndIndex:n,startPosition:r,oldEndPosition:s,newEndPosition:o}){this.startIndex=e>>>0,this.oldEndIndex=t>>>0,this.newEndIndex=n>>>0,this.startPosition=r,this.oldEndPosition=s,this.newEndPosition=o}editPoint(e,t){let n=t,r={...e};if(t>=this.oldEndIndex){n=this.newEndIndex+(t-this.oldEndIndex);let s=e.row;r.row=this.newEndPosition.row+(e.row-this.oldEndPosition.row),r.column=s===this.oldEndPosition.row?this.newEndPosition.column+(e.column-this.oldEndPosition.column):e.column}else t>this.startIndex&&(n=this.newEndIndex,r.row=this.newEndPosition.row,r.column=this.newEndPosition.column);return{point:r,index:n}}editRange(e){let t={startIndex:e.startIndex,startPosition:{...e.startPosition},endIndex:e.endIndex,endPosition:{...e.endPosition}};return e.endIndex>=this.oldEndIndex?e.endIndex!==Number.MAX_SAFE_INTEGER&&(t.endIndex=this.newEndIndex+(e.endIndex-this.oldEndIndex),t.endPosition={row:this.newEndPosition.row+(e.endPosition.row-this.oldEndPosition.row),column:e.endPosition.row===this.oldEndPosition.row?this.newEndPosition.column+(e.endPosition.column-this.oldEndPosition.column):e.endPosition.column},t.endIndexthis.startIndex&&(t.endIndex=this.startIndex,t.endPosition={...this.startPosition}),e.startIndex>=this.oldEndIndex?(t.startIndex=this.newEndIndex+(e.startIndex-this.oldEndIndex),t.startPosition={row:this.newEndPosition.row+(e.startPosition.row-this.oldEndPosition.row),column:e.startPosition.row===this.oldEndPosition.row?this.newEndPosition.column+(e.startPosition.column-this.oldEndPosition.column):e.startPosition.column},t.startIndexthis.startIndex&&(t.startIndex=this.startIndex,t.startPosition={...this.startPosition}),t}},sp=2,re=4,qc=4*re,_t=5*re,un=2*re,ui=2*re+2*un,yt={row:0,column:0},Gn=Symbol("INTERNAL");D(os,"assertInternal");D(di,"isPoint");D(up,"setModule");D(as,"newFinalizer");ip=as(e=>{M._ts_lookahead_iterator_delete(e)}),cS=class{static{D(this,"LookaheadIterator")}0=0;language;positioned=!1;constructor(e,t,n){os(e),this[0]=t,this.language=n,ip?.register(this,t,this)}get currentTypeId(){return this.positioned?M._ts_lookahead_iterator_current_symbol(this[0]):null}get currentType(){let e=this.currentTypeId;return e===null?null:this.language.types[e]??M.UTF8ToString(M._ts_language_symbol_name(this.language[0],e))}delete(){ip?.unregister(this),M._ts_lookahead_iterator_delete(this[0]),this[0]=0}reset(e,t){return M._ts_lookahead_iterator_reset(this[0],e[0],t)?(this.language=e,this.positioned=!1,!0):!1}resetState(e){return M._ts_lookahead_iterator_reset_state(this[0],e)?(this.positioned=!1,!0):!1}[Symbol.iterator](){return{next:D(()=>{this.positioned=!!M._ts_lookahead_iterator_next(this[0]);let e=this.currentType;return e===null?{done:!0,value:""}:{done:!1,value:e}},"next")}}};D(Zc,"getText");op=as(e=>{M._ts_tree_delete(e)}),dS=class Kc{static{D(this,"Tree")}0=0;textCallback;language;constructor(t,n,r,s){os(t),this[0]=n,this.language=r,this.textCallback=s,op?.register(this,n,this)}copy(){let t=M._ts_tree_copy(this[0]);return new Kc(Gn,t,this.language,this.textCallback)}delete(){op?.unregister(this),M._ts_tree_delete(this[0]),this[0]=0}get rootNode(){return M._ts_tree_root_node_wasm(this[0]),Pe(this)}rootNodeWithOffset(t,n){let r=ne+_t;return M.setValue(r,t,"i32"),Nt(r+re,n),M._ts_tree_root_node_with_offset_wasm(this[0]),Pe(this)}edit(t){pp(t),M._ts_tree_edit_wasm(this[0])}walk(){return this.rootNode.walk()}getChangedRanges(t){if(!(t instanceof Kc))throw new TypeError("Argument must be a Tree");M._ts_tree_get_changed_ranges_wasm(this[0],t[0]);let n=M.getValue(ne,"i32"),r=M.getValue(ne+re,"i32"),s=new Array(n);if(n>0){let o=r;for(let a=0;a0){let s=n;for(let o=0;o{M._ts_tree_cursor_delete_wasm(e)}),uS=class fp{static{D(this,"TreeCursor")}0=0;1=0;2=0;3=0;tree;constructor(t,n){os(t),this.tree=n,Mt(this),ap?.register(this,this.tree[0],this)}copy(){let t=new fp(Gn,this.tree);return M._ts_tree_cursor_copy_wasm(this.tree[0]),Mt(t),t}delete(){ap?.unregister(this),Te(this),M._ts_tree_cursor_delete_wasm(this.tree[0]),this[0]=this[1]=this[2]=0}get currentNode(){return Te(this),M._ts_tree_cursor_current_node_wasm(this.tree[0]),Pe(this.tree)}get currentFieldId(){return Te(this),M._ts_tree_cursor_current_field_id_wasm(this.tree[0])}get currentFieldName(){return this.tree.language.fields[this.currentFieldId]}get currentDepth(){return Te(this),M._ts_tree_cursor_current_depth_wasm(this.tree[0])}get currentDescendantIndex(){return Te(this),M._ts_tree_cursor_current_descendant_index_wasm(this.tree[0])}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return Te(this),M._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeStateId(){return Te(this),M._ts_tree_cursor_current_node_state_id_wasm(this.tree[0])}get nodeId(){return Te(this),M._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return Te(this),M._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])===1}get nodeIsMissing(){return Te(this),M._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])===1}get nodeText(){Te(this);let t=M._ts_tree_cursor_start_index_wasm(this.tree[0]),n=M._ts_tree_cursor_end_index_wasm(this.tree[0]);M._ts_tree_cursor_start_position_wasm(this.tree[0]);let r=xr(ne);return Zc(this.tree,t,n,r)}get startPosition(){return Te(this),M._ts_tree_cursor_start_position_wasm(this.tree[0]),xr(ne)}get endPosition(){return Te(this),M._ts_tree_cursor_end_position_wasm(this.tree[0]),xr(ne)}get startIndex(){return Te(this),M._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return Te(this),M._ts_tree_cursor_end_index_wasm(this.tree[0])}gotoFirstChild(){Te(this);let t=M._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return Mt(this),t===1}gotoLastChild(){Te(this);let t=M._ts_tree_cursor_goto_last_child_wasm(this.tree[0]);return Mt(this),t===1}gotoParent(){Te(this);let t=M._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return Mt(this),t===1}gotoNextSibling(){Te(this);let t=M._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return Mt(this),t===1}gotoPreviousSibling(){Te(this);let t=M._ts_tree_cursor_goto_previous_sibling_wasm(this.tree[0]);return Mt(this),t===1}gotoDescendant(t){Te(this),M._ts_tree_cursor_goto_descendant_wasm(this.tree[0],t),Mt(this)}gotoFirstChildForIndex(t){Te(this),M.setValue(ne+qc,t,"i32");let n=M._ts_tree_cursor_goto_first_child_for_index_wasm(this.tree[0]);return Mt(this),n===1}gotoFirstChildForPosition(t){Te(this),Nt(ne+qc,t);let n=M._ts_tree_cursor_goto_first_child_for_position_wasm(this.tree[0]);return Mt(this),n===1}reset(t){fe(t),Te(this,ne+_t),M._ts_tree_cursor_reset_wasm(this.tree[0]),Mt(this)}resetTo(t){Te(this,ne),Te(t,ne+qc),M._ts_tree_cursor_reset_to_wasm(this.tree[0],t.tree[0]),Mt(this)}},fS=class{static{D(this,"Node")}0=0;_children;_namedChildren;constructor(e,{id:t,tree:n,startIndex:r,startPosition:s,other:o}){os(e),this[0]=o,this.id=t,this.tree=n,this.startIndex=r,this.startPosition=s}id;startIndex;startPosition;tree;get typeId(){return fe(this),M._ts_node_symbol_wasm(this.tree[0])}get grammarId(){return fe(this),M._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 fe(this),M._ts_node_is_named_wasm(this.tree[0])===1}get isExtra(){return fe(this),M._ts_node_is_extra_wasm(this.tree[0])===1}get isError(){return fe(this),M._ts_node_is_error_wasm(this.tree[0])===1}get isMissing(){return fe(this),M._ts_node_is_missing_wasm(this.tree[0])===1}get hasChanges(){return fe(this),M._ts_node_has_changes_wasm(this.tree[0])===1}get hasError(){return fe(this),M._ts_node_has_error_wasm(this.tree[0])===1}get endIndex(){return fe(this),M._ts_node_end_index_wasm(this.tree[0])}get endPosition(){return fe(this),M._ts_node_end_point_wasm(this.tree[0]),xr(ne)}get text(){return Zc(this.tree,this.startIndex,this.endIndex,this.startPosition)}get parseState(){return fe(this),M._ts_node_parse_state_wasm(this.tree[0])}get nextParseState(){return fe(this),M._ts_node_next_parse_state_wasm(this.tree[0])}equals(e){return this.tree===e.tree&&this.id===e.id}child(e){return fe(this),M._ts_node_child_wasm(this.tree[0],e),Pe(this.tree)}namedChild(e){return fe(this),M._ts_node_named_child_wasm(this.tree[0],e),Pe(this.tree)}childForFieldId(e){return fe(this),M._ts_node_child_by_field_id_wasm(this.tree[0],e),Pe(this.tree)}childForFieldName(e){let t=this.tree.language.fields.indexOf(e);return t!==-1?this.childForFieldId(t):null}fieldNameForChild(e){fe(this);let t=M._ts_node_field_name_for_child_wasm(this.tree[0],e);return t?M.AsciiToString(t):null}fieldNameForNamedChild(e){fe(this);let t=M._ts_node_field_name_for_named_child_wasm(this.tree[0],e);return t?M.AsciiToString(t):null}childrenForFieldName(e){let t=this.tree.language.fields.indexOf(e);return t!==-1&&t!==0?this.childrenForFieldId(t):[]}childrenForFieldId(e){fe(this),M._ts_node_children_by_field_id_wasm(this.tree[0],e);let t=M.getValue(ne,"i32"),n=M.getValue(ne+re,"i32"),r=new Array(t);if(t>0){let s=n;for(let o=0;o0){let n=t;for(let r=0;r0){let n=t;for(let r=0;r0){let d=l;for(let u=0;u=e.oldEndIndex){this.startIndex=e.newEndIndex+(this.startIndex-e.oldEndIndex);let t,n;this.startPosition.row>e.oldEndPosition.row?(t=this.startPosition.row-e.oldEndPosition.row,n=this.startPosition.column):(t=0,n=this.startPosition.column,this.startPosition.column>=e.oldEndPosition.column&&(n=this.startPosition.column-e.oldEndPosition.column)),t>0?(this.startPosition.row+=t,this.startPosition.column=n):this.startPosition.column+=n}else this.startIndex>e.startIndex&&(this.startIndex=e.newEndIndex,this.startPosition.row=e.newEndPosition.row,this.startPosition.column=e.newEndPosition.column)}toString(){fe(this);let e=M._ts_node_to_string_wasm(this.tree[0]),t=M.AsciiToString(e);return M._free(e),t}};D(Xc,"unmarshalCaptures");D(fe,"marshalNode");D(Pe,"unmarshalNode");D(Te,"marshalTreeCursor");D(Mt,"unmarshalTreeCursor");D(Nt,"marshalPoint");D(xr,"unmarshalPoint");D(mp,"marshalRange");D(ma,"unmarshalRange");D(pp,"marshalEdit");D(gp,"unmarshalLanguageMetadata");mS=/^tree_sitter_\w+$/,Yc=class fa{static{D(this,"Language")}0=0;types;fields;constructor(t,n){os(t),this[0]=n,this.types=new Array(M._ts_language_symbol_count(this[0]));for(let r=0,s=this.types.length;r0){let s=n;for(let o=0;o0){let o=r;for(let a=0;a(Gc(),zc))).readFile(t);else{let s=await fetch(t);if(!s.ok){let a=await s.text();throw new Error(`Language.load failed with status ${s.status}. ${a}`)}let o=s.clone();try{n=await WebAssembly.compileStreaming(s)}catch(a){console.error("wasm streaming compile failed:",a),console.error("falling back to ArrayBuffer instantiation"),n=new Uint8Array(await o.arrayBuffer())}}let r=await M.loadWebAssemblyModule(n,{loadAsync:!0});return fa.loadFromWasmExports(r,{sync:!1})}static loadFromWasmExports(t,{sync:n}){let r=Object.keys(t),s=r.find(a=>mS.test(a)&&!a.includes("external_scanner_"));if(!s)throw console.log(`Couldn't find language function in Wasm file. Symbols: diff --git a/scripts/engine.mjs b/scripts/engine.mjs index 6aaf05c..604be53 100755 --- a/scripts/engine.mjs +++ b/scripts/engine.mjs @@ -2492,7 +2492,7 @@ var init_js_ts = __esm({ NAMED_DEFAULT_RE = /^\s*export\s+default\s+(?:async\s+)?(?:function|class)\s+(?!extends\b)[\w$]+/; EXPORT_LIST_RE = /export\s*\{([^}]*)\}\s*(from\b)?/g; CJS_OBJECT_RE = /module\.exports\s*=\s*\{([^}]*)\}/g; - DEFAULT_ID_RE = /(^|\n)\s*export(?:\s+default\s+|\s*=\s*)([A-Za-z_$][\w$]*)\s*;?\s*(?=\n|$)/g; + DEFAULT_ID_RE = /(^|\n)[ \t]*export(?:\s+default\s+|\s*=\s*)([A-Za-z_$][\w$]*)[ \t]*;?[ \t]*(?=\r?\n|$)/g; jsTs = { lang: "javascript/typescript", exts: [".ts", ".tsx", ".mts", ".cts", ".js", ".jsx", ".mjs", ".cjs"], diff --git a/src/lang/js-ts.ts b/src/lang/js-ts.ts index 9f9a13c..69f20b3 100644 --- a/src/lang/js-ts.ts +++ b/src/lang/js-ts.ts @@ -80,7 +80,9 @@ function stemOf(rel: string): string { // so does a declaration file's `export = Foo;`. const EXPORT_LIST_RE = /export\s*\{([^}]*)\}\s*(from\b)?/g; const CJS_OBJECT_RE = /module\.exports\s*=\s*\{([^}]*)\}/g; -const DEFAULT_ID_RE = /(^|\n)\s*export(?:\s+default\s+|\s*=\s*)([A-Za-z_$][\w$]*)\s*;?\s*(?=\n|$)/g; +// Horizontal whitespace only around the line: comments are blanked to spaces +// and newlines, so a `\s*` here rescanned every blank line after each one. +const DEFAULT_ID_RE = /(^|\n)[ \t]*export(?:\s+default\s+|\s*=\s*)([A-Za-z_$][\w$]*)[ \t]*;?[ \t]*(?=\r?\n|$)/g; function applyExportLists(content: string, symbols: CodeSymbol[]): void { const markExported = (name: string | undefined): void => { diff --git a/tests/regex-tier.test.ts b/tests/regex-tier.test.ts index e152f98..023f944 100644 --- a/tests/regex-tier.test.ts +++ b/tests/regex-tier.test.ts @@ -344,6 +344,24 @@ describe("TS/JS fallback: generators, ambient declarations, Unicode names", () = // `export = Emitter` is how a declaration file exports its one value. expect(syms("d.ts", src).find((s) => s.name === "Emitter")?.exported).toBe(true); }); + + it("reads `export default Foo;` and `export = Foo` in a CRLF file", () => { + const exported = (src: string) => syms("d.ts", src).find((s) => s.kind === "class" && s.name === "Foo")?.exported; + expect(exported("class Foo {\r\n}\r\nexport default Foo;\r\n")).toBe(true); + expect(exported("declare class Foo {}\r\nexport = Foo \r\n")).toBe(true); + expect(exported("class Foo {\r\n}\r\nexport default Foo.bar;\r\n")).toBe(false); + }); + + it("stays linear on a long run of comment lines (previously ~33 s)", () => { + // Comments are blanked to spaces and newlines before the export-list pass, + // and `export default Foo;` used to be matched with a `\s*` that crossed + // them: every line rescanned all the blank lines after it. + const comments = Array.from({ length: 50000 }, (_, i) => `// comment line ${i}`).join("\n"); + const src = `class Foo {}\n${comments}\nconst tail = 1;\nexport default Foo;\n`; + const t0 = performance.now(); + expect(syms("big.ts", src).find((s) => s.kind === "class" && s.name === "Foo")?.exported).toBe(true); + expect(performance.now() - t0).toBeLessThan(1500); + }); }); describe("doc comments and body spans on the regex tier", () => {