@dtsx/dtsx 0.11.37 → 0.11.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/dist/bin/cli.js +3 -3
  2. package/dist/{chunk-wrnz0e76.js → chunk-082w7zvy.js} +3 -3
  3. package/dist/{chunk-psrgw9f8.js → chunk-0k0fhq13.js} +7 -7
  4. package/dist/{chunk-69dbf6de.js → chunk-0rmbc5zp.js} +2 -2
  5. package/dist/{chunk-nn9tpxx3.js → chunk-0yg5mcrf.js} +2 -2
  6. package/dist/chunk-0zfzhn19.js +31 -0
  7. package/dist/chunk-189nn4fc.js +3 -0
  8. package/dist/{chunk-cen2t56g.js → chunk-1qtghb2x.js} +2 -2
  9. package/dist/{chunk-r4zkf9ag.js → chunk-2436cnmb.js} +2 -2
  10. package/dist/{chunk-py7pj8aj.js → chunk-2qd3axyx.js} +4 -4
  11. package/dist/{chunk-n2nyd0ck.js → chunk-32qexm3w.js} +2 -2
  12. package/dist/{chunk-1pz7zxhc.js → chunk-3fbt79hx.js} +2 -2
  13. package/dist/{chunk-gpq2kggq.js → chunk-3t57mzvf.js} +2 -2
  14. package/dist/{chunk-2kwjbk55.js → chunk-42j9cfte.js} +2 -2
  15. package/dist/{chunk-vtskg4r2.js → chunk-4fygcxtb.js} +2 -2
  16. package/dist/{chunk-437g8zz6.js → chunk-50h54rax.js} +3 -3
  17. package/dist/{chunk-aw48mk3t.js → chunk-6yvk3q1e.js} +2 -2
  18. package/dist/chunk-73dzve1s.js +3 -0
  19. package/dist/chunk-7tremqhs.js +14 -0
  20. package/dist/{chunk-mt9219xc.js → chunk-83qnrx0m.js} +5 -5
  21. package/dist/{chunk-ckq8g1ck.js → chunk-88gwzbew.js} +3 -3
  22. package/dist/{chunk-90aptjh6.js → chunk-8d3sdkv4.js} +19 -19
  23. package/dist/{chunk-srg5qhch.js → chunk-8tzd98q8.js} +4 -4
  24. package/dist/{chunk-fy97syc2.js → chunk-96atbsd3.js} +2 -2
  25. package/dist/{chunk-h7k9wamx.js → chunk-9gts9ymh.js} +2 -2
  26. package/dist/{chunk-sq34kkhy.js → chunk-9menejdz.js} +2 -2
  27. package/dist/{chunk-1h6ycqza.js → chunk-a7nvyxpg.js} +4 -4
  28. package/dist/{chunk-j6pfxvy8.js → chunk-ag1b6d30.js} +2 -2
  29. package/dist/{chunk-0ke9xh7t.js → chunk-bnry23ve.js} +3 -3
  30. package/dist/{chunk-wzcwctba.js → chunk-bxc2herz.js} +3 -3
  31. package/dist/{chunk-pzedkn7z.js → chunk-cpmqa8kd.js} +2 -2
  32. package/dist/{chunk-rdzfdjkb.js → chunk-cv29b4zb.js} +3 -3
  33. package/dist/{chunk-xr1h3tv2.js → chunk-cyr45de1.js} +2 -2
  34. package/dist/{chunk-m1khpcqb.js → chunk-d0bazr3p.js} +1 -1
  35. package/dist/{chunk-vae5wxar.js → chunk-danfamyx.js} +2 -2
  36. package/dist/{chunk-853ftm92.js → chunk-davy89dj.js} +5 -5
  37. package/dist/{chunk-n6nw7sn2.js → chunk-e29rp5xj.js} +5 -5
  38. package/dist/{chunk-p7w9ydhe.js → chunk-eba562w8.js} +2 -2
  39. package/dist/{chunk-v44crx69.js → chunk-ebjafajx.js} +11 -11
  40. package/dist/{chunk-g9d5r6a8.js → chunk-ft2zk7jx.js} +2 -2
  41. package/dist/chunk-g2120ysy.js +3 -0
  42. package/dist/chunk-ghfd34r7.js +3 -0
  43. package/dist/{chunk-sjneg7p7.js → chunk-gspsxc9d.js} +8 -8
  44. package/dist/{chunk-n3p7wedp.js → chunk-h3n6256r.js} +2 -2
  45. package/dist/{chunk-4f2mwn7p.js → chunk-hnqm1zb3.js} +4 -4
  46. package/dist/{chunk-gs7wfk8b.js → chunk-htgy94y3.js} +1 -1
  47. package/dist/{chunk-knrtwppp.js → chunk-hv8bx8xx.js} +6 -6
  48. package/dist/chunk-hzn9kmq7.js +3 -0
  49. package/dist/{chunk-nchp0pqa.js → chunk-ja7bp731.js} +2 -2
  50. package/dist/chunk-jcckwgb9.js +3 -0
  51. package/dist/{chunk-s0mvstt0.js → chunk-kfk554fj.js} +2 -2
  52. package/dist/{chunk-1e10w914.js → chunk-kkshxyex.js} +3 -3
  53. package/dist/{chunk-bdxq6500.js → chunk-kpbz61yy.js} +3 -3
  54. package/dist/{chunk-w9av39jy.js → chunk-mkakbjvs.js} +2 -2
  55. package/dist/{chunk-xsf941gw.js → chunk-mwyjxjqa.js} +2 -2
  56. package/dist/{chunk-n37yj3xv.js → chunk-p023fhce.js} +3 -3
  57. package/dist/chunk-p9vfxn8g.js +3 -0
  58. package/dist/{chunk-q0hn0ymb.js → chunk-pjqzkgzk.js} +4 -4
  59. package/dist/chunk-qzjzw9p2.js +3 -0
  60. package/dist/{chunk-acyj1dev.js → chunk-rbx6q1r0.js} +2 -2
  61. package/dist/{chunk-fgbdm1y6.js → chunk-rkstz4w1.js} +4 -4
  62. package/dist/{chunk-gsv5yc32.js → chunk-rz060wxt.js} +4 -4
  63. package/dist/{chunk-z4mvkazp.js → chunk-sd8bywh9.js} +11 -11
  64. package/dist/{chunk-dv5hhg1a.js → chunk-sv8h007a.js} +2 -2
  65. package/dist/{chunk-1bpv3tck.js → chunk-t4va49p3.js} +4 -4
  66. package/dist/{chunk-bqabznps.js → chunk-tka2m4af.js} +2 -2
  67. package/dist/{chunk-7610h2tf.js → chunk-v93389xm.js} +1 -1
  68. package/dist/{chunk-wnk9yjw2.js → chunk-vf3ybe5r.js} +2 -2
  69. package/dist/{chunk-ezbp8tss.js → chunk-vkahj2ab.js} +8 -8
  70. package/dist/chunk-wnqg6hem.js +27 -0
  71. package/dist/chunk-xa6rsd4b.js +29 -0
  72. package/dist/{chunk-gsb3ty07.js → chunk-xfjfhe9d.js} +2 -2
  73. package/dist/{chunk-5n0tfrpc.js → chunk-xwpn40p0.js} +3 -3
  74. package/dist/chunk-y1g6v96c.js +10 -0
  75. package/dist/{chunk-r4s18nn5.js → chunk-y5k0szq6.js} +2 -2
  76. package/dist/{chunk-km8t8gqg.js → chunk-yay68832.js} +2 -2
  77. package/dist/{chunk-strqhcqs.js → chunk-yrv6z221.js} +2 -2
  78. package/dist/chunk-yx1jy7fx.js +37 -0
  79. package/dist/{chunk-ggbahdr2.js → chunk-zgcdx773.js} +3 -3
  80. package/dist/{chunk-60ssvwc8.js → chunk-zk3w5sqv.js} +2 -2
  81. package/dist/src/augmentation-graph.js +1 -1
  82. package/dist/src/binding-patterns.js +1 -1
  83. package/dist/src/branded-types.js +1 -1
  84. package/dist/src/bundle-linker.js +1 -1
  85. package/dist/src/bundler.js +1 -1
  86. package/dist/src/cache.js +1 -1
  87. package/dist/src/call-signatures.js +1 -1
  88. package/dist/src/circular.js +1 -1
  89. package/dist/src/compat.js +1 -1
  90. package/dist/src/computed-keys.js +1 -1
  91. package/dist/src/config.js +1 -1
  92. package/dist/src/dangling-refs.js +1 -1
  93. package/dist/src/declaration-project.js +1 -1
  94. package/dist/src/declaration-publication.js +1 -1
  95. package/dist/src/declaration-references.js +1 -1
  96. package/dist/src/diff.js +1 -1
  97. package/dist/src/docs.js +1 -1
  98. package/dist/src/enum-declarations.js +1 -1
  99. package/dist/src/errors.js +1 -1
  100. package/dist/src/extractor/directives.js +1 -1
  101. package/dist/src/extractor/extract.js +1 -1
  102. package/dist/src/extractor/scanner.js +1 -1
  103. package/dist/src/extractor.js +1 -1
  104. package/dist/src/formats.js +1 -1
  105. package/dist/src/formatter.js +1 -1
  106. package/dist/src/function-properties.js +1 -1
  107. package/dist/src/generator.js +1 -1
  108. package/dist/src/global-types.js +1 -1
  109. package/dist/src/import-sorter.js +1 -1
  110. package/dist/src/incremental.js +1 -1
  111. package/dist/src/index.js +1 -1
  112. package/dist/src/inferred-imports.js +1 -1
  113. package/dist/src/json-config.js +1 -1
  114. package/dist/src/logger.js +1 -1
  115. package/dist/src/lsp.js +1 -1
  116. package/dist/src/memory.js +1 -1
  117. package/dist/src/merger.js +1 -1
  118. package/dist/src/module-graph.js +1 -1
  119. package/dist/src/native-checker.js +1 -1
  120. package/dist/src/native-engine.js +1 -1
  121. package/dist/src/native-extractor.js +1 -1
  122. package/dist/src/native-generation.js +1 -1
  123. package/dist/src/native-project.js +1 -1
  124. package/dist/src/optimizer.js +1 -1
  125. package/dist/src/output-normalizer.js +1 -1
  126. package/dist/src/parallel-processor.js +1 -1
  127. package/dist/src/parameters.js +1 -1
  128. package/dist/src/parser.js +1 -1
  129. package/dist/src/plugins/bun.js +1 -1
  130. package/dist/src/plugins/esbuild.js +1 -1
  131. package/dist/src/plugins/index.js +1 -1
  132. package/dist/src/plugins/tsdown.js +1 -1
  133. package/dist/src/plugins/tsup.js +1 -1
  134. package/dist/src/plugins/vite.js +1 -1
  135. package/dist/src/plugins/webpack.js +1 -1
  136. package/dist/src/plugins.js +1 -1
  137. package/dist/src/process-source.js +1 -1
  138. package/dist/src/processor/cache.js +1 -1
  139. package/dist/src/processor/comments.js +1 -1
  140. package/dist/src/processor/declarations.js +1 -1
  141. package/dist/src/processor/import-usage.js +1 -1
  142. package/dist/src/processor/imports.js +1 -1
  143. package/dist/src/processor/index.js +1 -1
  144. package/dist/src/processor/type-inference.js +1 -1
  145. package/dist/src/processor.js +1 -1
  146. package/dist/src/profiling.js +1 -1
  147. package/dist/src/return-type-scope.js +1 -1
  148. package/dist/src/security.js +1 -1
  149. package/dist/src/source-cache.js +1 -1
  150. package/dist/src/sourcemap.js +1 -1
  151. package/dist/src/stx.js +1 -1
  152. package/dist/src/syntax-validator.js +1 -1
  153. package/dist/src/tracking.js +1 -1
  154. package/dist/src/transformers.js +1 -1
  155. package/dist/src/tree-shaker.js +1 -1
  156. package/dist/src/tsconfig.js +1 -1
  157. package/dist/src/type-mappings.js +1 -1
  158. package/dist/src/utils.js +1 -1
  159. package/dist/src/value-inference.js +1 -1
  160. package/dist/src/vue.js +1 -1
  161. package/dist/src/watcher.js +1 -1
  162. package/dist/src/worker-thread.js +1 -1
  163. package/dist/src/worker.js +1 -1
  164. package/dist/src/workspace.js +1 -1
  165. package/package.json +1 -1
  166. package/dist/chunk-0azm93j9.js +0 -31
  167. package/dist/chunk-25vyhfzh.js +0 -3
  168. package/dist/chunk-79nv7twc.js +0 -14
  169. package/dist/chunk-cs4gwz1k.js +0 -27
  170. package/dist/chunk-d43bpfk6.js +0 -3
  171. package/dist/chunk-dfye109x.js +0 -3
  172. package/dist/chunk-n94729d9.js +0 -3
  173. package/dist/chunk-p2qz2nk2.js +0 -3
  174. package/dist/chunk-qnf4byak.js +0 -3
  175. package/dist/chunk-rmdwvzgn.js +0 -3
  176. package/dist/chunk-s6c98nad.js +0 -29
  177. package/dist/chunk-t1jtn2r0.js +0 -10
  178. package/dist/chunk-ttc5pr8y.js +0 -37
  179. package/dist/chunk-xb92nrsm.js +0 -3
@@ -1,24 +1,24 @@
1
1
  // @bun
2
- import{t}from"./chunk-1j6092xz.js";import{jn,_n,Gn}from"./chunk-n2nyd0ck.js";import{Ae}from"./chunk-69dbf6de.js";import{Te}from"./chunk-rdzfdjkb.js";var Q=20,Y=!1,M=null;function _(e){return mt(e).replace(/\n[ \t]*(?=\n)/g,"")}function mt(e){if(e.indexOf("/*")===-1)return e.trim();let r=[],s=0,i=0,l=e.length;while(i<l)if(e.charCodeAt(i)===47&&i+1<l&&e.charCodeAt(i+1)===42){if(i>s)r.push(e.substring(s,i));i+=2;while(i<l-1){if(e.charCodeAt(i)===42&&e.charCodeAt(i+1)===47){i+=2;break}i++}s=i}else i++;if(s<l)r.push(e.substring(s));return r.join("").trim()}function Pt(){Y=!0,M=null}function Dt(){Y=!1;let e=M;return M=null,e}function it(e){let c=e.length;if(c===0)return!1;let r=0;if(e.charCodeAt(r)===45)r++;if(r>=c)return!1;let s=r;while(r<c&&e.charCodeAt(r)>=48&&e.charCodeAt(r)<=57)r++;if(r===s)return!1;if(r<c&&e.charCodeAt(r)===46){r++;let i=r;while(r<c&&e.charCodeAt(r)>=48&&e.charCodeAt(r)<=57)r++;if(r===i)return!1}return r===c}function xt(e){for(let c=0,r=e.length-1;c<r;c++){let s=e.charCodeAt(c);if(s<48||s>57)return!1}return!0}function Z(e,c){let r=0,s=0;while((s=e.indexOf(c,s))!==-1)r++,s+=c.length;return r}function lt(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===36||e===95||e===46||e===58||e===45}function z(e){let c=e.trim();if(c.length<3||c.charCodeAt(0)!==60)return!1;if(c.startsWith("<>"))return c.endsWith("</>");let r=c.charCodeAt(1);if(!(r>=65&&r<=90||r>=97&&r<=122||r===36||r===95))return!1;let i=2;while(i<c.length&&lt(c.charCodeAt(i)))i++;let l=c.slice(1,i),f=c.charCodeAt(i);if(f>32&&f!==62&&f!==47)return!1;if(c.endsWith("/>"))return!0;let u=c.lastIndexOf("</");if(u===-1)return!1;let a=u+2;while(a<c.length&&lt(c.charCodeAt(a)))a++;return c.slice(u+2,a)===l&&c.charCodeAt(a)===62&&a===c.length-1}function X(e){let c=e.length,r=!1;for(let f=1;f<c;f++)if(e.charCodeAt(f)<=32&&e.charCodeAt(f-1)<=32){r=!0;break}if(!r)for(let f=0;f<c;f++){let u=e.charCodeAt(f);if(u===10||u===13||u===9){r=!0;break}}if(!r)return e;let s=[],i=-1,l=!1;for(let f=0;f<c;f++)if(e.charCodeAt(f)<=32){if(!l){if(i>=0)s.push(e.substring(i,f));s.push(" "),l=!0,i=-1}}else{if(l||i<0)i=f;l=!1}if(i>=0)s.push(e.substring(i));return s.join("")}function n(e,c=!1,r=!1,s=0,i){if(!e||typeof e!=="string")return"unknown";if(s>=Q)return"unknown";let l=e.trim();if(z(l))return"JSX.Element";if(l.startsWith("BigInt("))return"bigint";if(l.startsWith("Symbol.for("))return"symbol";if(l.includes(".raw`")||l.includes("String.raw`"))return"string";if(l.startsWith("`")&&l.endsWith("`")){if(!c||l.includes("${")||l.includes(`
3
- `)||l.includes("\r"))return"string";return l}if(l.charCodeAt(0)===39||l.charCodeAt(0)===34){let u=$t(l);if(u!==null){if(u==="string"||!c)return"string";return u}}if(it(l)){if(!c)return"number";return l}if(l==="true"||l==="false"){if(!c)return"boolean";return l}if(l==="null")return"null";if(l==="undefined")return"undefined";if(l.startsWith("[")&&l.endsWith("]"))return $e(l,c,s+1,i);if(l.startsWith("{")&&l.endsWith("}"))return Ze(l,c,s+1,i);if(l.startsWith("class ")||l.startsWith("class{"))return Kt(l);if(l.startsWith("new "))return Bt(l);if(l.endsWith("as const")){let u=l.slice(0,-8).trim();if(u.startsWith("[")&&u.endsWith("]")){let a=u.slice(1,-1).trim();if(!a)return"readonly []";let h=re(a),p=[];for(let y=0;y<h.length;y++){let A=h[y].trim();if(A.startsWith("...")){let m=A.slice(3).trim();if(F(m))p.push(`...typeof ${m}`);else{let g=n(m,!0,!1,s+1,i);p.push(g.startsWith("readonly [")||g.endsWith("[]")?`...${g}`:"...unknown[]")}}else p.push(n(A,!0,!1,s+1,i))}return`readonly [${p.join(", ")}]`}return n(u,!0,r,s+1,i)}if(q(l)!==-1||l.startsWith("function")||l.startsWith("async"))return Qe(l,r,s,c);if(l.startsWith("`")&&l.endsWith("`"))return Nt(l,c);if(l.startsWith("Promise."))return yt(l,c,s,i);if(l.startsWith("await "))return"unknown";if(l.startsWith("typeof ")&&U(l.slice(7)))return"string";if(l.startsWith("void ")&&U(l.slice(5)))return"undefined";if(l.startsWith("delete ")&&U(l.slice(7)))return"boolean";if(l.charCodeAt(l.length-1)===110&&l.length>1&&xt(l)){if(c)return l;return"bigint"}if(l.startsWith("Symbol(")||l==="Symbol.for")return"symbol";let f=Ee(l);if(f!==null)return f;if(pt(l))return"boolean";if(St(l))return"number";return"unknown"}function ft(e){let c=e.charCodeAt(0);if(c!==39&&c!==34)return!1;return B(e,0,c)===e.length}function $t(e){if(ft(e))return e;let c=bt(e);if(c.length<2)return null;let r=!1,s=!0,i="";for(let l of c){let f=l.trim();if(ft(f))r=!0,i+=Tt(f);else s=!1}if(s)return kt(i);if(r)return"string";return null}function bt(e){let c=[],r=0,s=0,i=0;while(i<e.length){let l=e.charCodeAt(i);if(l===39||l===34||l===96){i=B(e,i,l);continue}if(l===40||l===91||l===123)r++;else if(l===41||l===93||l===125)r--;else if(l===43&&r===0)c.push(e.slice(s,i)),s=i+1;i++}return c.push(e.slice(s)),c}function Tt(e){return e.slice(1,-1).replace(/\\(.)/g,(r,s)=>{if(s==="n")return`
4
- `;if(s==="t")return"\t";if(s==="r")return"\r";if(s==="0")return"\x00";return s})}function kt(e){return`'${e.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}'`}function St(e){if(e==="")return!1;let c=!1,r=!1;for(let s=0;s<e.length;s++){let i=e.charCodeAt(s);if(i>=48&&i<=57){c=!0;continue}if(i===43||i===45||i===42||i===47||i===37){r=!0;continue}if(i===46||i===40||i===41||i<=32)continue;return!1}return c&&r}function pt(e){let c=0;for(let r=0;r<e.length;r++){let s=e.charCodeAt(r);if(s===34||s===39||s===96){r=B(e,r,s)-1;continue}if(s===40||s===91||s===123){c++;continue}if(s===41||s===93||s===125){c--;continue}if(c!==0)continue;if(e.startsWith("===",r)||e.startsWith("!==",r)||e.startsWith("==",r)||e.startsWith("!=",r)||e.startsWith(">=",r)||e.startsWith("<=",r))return!0;if((s===62||s===60)&&e.charCodeAt(r-1)!==61&&e.charCodeAt(r+1)!==61)return!0}return!1}function Rt(e,c=!1,r=0,s){return n(e,c,!0,r,s)}function O(e,c=!1,r="",s,i){let l=v(r,s),f=[],u=!1,a=0;while(a<e.length){let p=e.charCodeAt(a);if(p===34||p===39||p===96){a=B(e,a,p);continue}if(p===47&&e.charCodeAt(a+1)===47){a+=2;while(a<e.length&&e.charCodeAt(a)!==10&&e.charCodeAt(a)!==13)a++;continue}if(p===47&&e.charCodeAt(a+1)===42){let A=e.indexOf("*/",a+2);a=A===-1?e.length:A+2;continue}if(e.startsWith("function",a)&&G(e,a,8)||e.startsWith("class",a)&&G(e,a,5)){let A=jt(e,a);if(A!==-1){a=H(e,A);continue}}if(p===61&&e.charCodeAt(a+1)===62){let A=At(e,a+2);if(e.charCodeAt(A)===123){a=H(e,A);continue}}if(e.startsWith("return",a)&&(a===0||!R(e.charCodeAt(a-1)))&&!R(e.charCodeAt(a+6))){a+=6;let A=!1;while(a<e.length&&e.charCodeAt(a)<=32){let x=e.charCodeAt(a);if(x===10||x===13)A=!0;a++}if(A||a>=e.length||e.charCodeAt(a)===59||e.charCodeAt(a)===125){u=!0;continue}let m=a,g=0,C=0,d=0;while(a<e.length){let x=e.charCodeAt(a);if(x===34||x===39||x===96){a=B(e,a,x);continue}if(x===47&&e.charCodeAt(a+1)===47){if(g===0&&C===0&&d===0)break;while(a<e.length&&e.charCodeAt(a)!==10&&e.charCodeAt(a)!==13)a++;continue}if(x===47&&e.charCodeAt(a+1)===42){let T=e.indexOf("*/",a+2);a=T===-1?e.length:T+2;continue}if(x===40)g++;else if(x===41)g--;else if(x===91)C++;else if(x===93)C--;else if(x===123)d++;else if(x===125){if(d===0&&g===0&&C===0)break;d--}else if(x===59&&g===0&&C===0&&d===0)break;else if((x===10||x===13)&&g===0&&C===0&&d===0){let T=a+1;while(T<e.length&&e.charCodeAt(T)<=32)T++;if(e.startsWith("return",T)&&!R(e.charCodeAt(T+6)))break}a++}let w=e.slice(m,a).trim(),b=_(K(w,l,s,i,m));if(!f.includes(b))f.push(b);continue}a++}if(u&&!f.includes("undefined"))f.push("undefined");let h=f.includes("unknown")?"unknown":f.length===0?"void":Ct(f);return c&&!h.startsWith("Promise<")?`Promise<${h}>`:h}function v(e,c){let r=new Map,s=e.startsWith("(")&&e.endsWith(")")?e.slice(1,-1):e,i=t(s),l=0,f=0,u=[];for(let a of i){let h=s.slice(a.start,a.end);if(h===","&&f===0)u.push(s.slice(l,a.start)),l=a.end;if(["(","[","{","<"].includes(h))f++;else if([")","]","}"].includes(h)||h===">"&&s[a.start-1]!=="=")f--}u.push(s.slice(l));for(let a of u){let h=t(a),p=-1,y=-1,A=0;for(let C of h){let d=a.slice(C.start,C.end);if(A===0&&d===":"&&p===-1)p=C.start;if(A===0&&d==="="&&a[C.end]!==">"){y=C.start;break}if(["(","[","{","<"].includes(d))A++;else if([")","]","}"].includes(d)||d===">"&&a[C.start-1]!=="=")A--}let m=a.slice(0,p!==-1?p:y!==-1?y:void 0).trim().replace(/^\.\.\./,"").replace(/\?$/,"");if(!J(m))continue;let g=p!==-1?a.slice(p+1,y!==-1?y:void 0).trim():"";if(!g&&y!==-1){let C=a.slice(y+1).trim();g=c?.(C)??n(C,!1)}if(g){if(y===-1&&a.slice(0,p).trim().endsWith("?"))g=`(${g}) | undefined`;r.set(m,g)}}return r}function Ot(e,c){if(e=e.trim(),!e.startsWith("{")||!e.endsWith("}"))return;let r=e.slice(1,-1),s=t(r),i=0,l=0;for(let f=0;f<=s.length;f++){let u=s[f],a=u?r.slice(u.start,u.end):";";if(l===0&&(a===";"||a===",")){let h=r.slice(i,u?.start).trim(),p=h.indexOf(":");if(p!==-1&&h.slice(0,p).trim()===c)return h.slice(p+1).trim();i=u?.end??r.length}if(["(","[","{","<"].includes(a))l++;else if([")","]","}"].includes(a)||a===">"&&u&&r[u.start-1]!=="=")l--}return}function K(e,c,r,s,i=0,l=0){if(l>=Q)return"unknown";let f=e.trim();while(st(f))f=f.slice(1,-1).trim();let u=r?.(f);if(u)return u;if(z(f))return"JSX.Element";if(f.startsWith("await ")){let d=K(f.slice(6),c,r,s,i,l+1);return d.startsWith("Promise<")&&d.endsWith(">")?d.slice(8,-1):d}if(c.has(f))return c.get(f);let a=/^([\w$]+)\.([\w$]+)$/.exec(f);if(a){let d=c.get(a[1]),w=d&&Ot(d,a[2]);if(w)return w}if(f.startsWith("!"))return"boolean";if(f.startsWith("fetch("))return"Promise<Response>";if(Et(f))return n(f,!1);let h=Mt(f);if(h){let d=K(h.whenTrue,c,r,s,i,l+1),w=K(h.whenFalse,c,r,s,i,l+1);return d===w?d:Ct([d,w])}let p=It(f);if(p&&s)return s(p,i);if(pt(f))return"boolean";let y=0;for(let d=f.length-1;d>=0;d--){let w=f.charCodeAt(d);if(w===41||w===93||w===125)y++;else if(w===40||w===91||w===123)y--;else if(y===0&&(w===43||w===45||w===42||w===47||w===37)){let b=K(f.slice(0,d),c,r,s,i,l+1),x=K(f.slice(d+1),c,r,s,i,l+1);if(w===43&&(b==="string"||x==="string"))return"string";if(b==="number"&&x==="number")return"number";break}}let A=f.startsWith("{")&&f.endsWith("}")?Ze(f,!1,l+1,void 0,(d)=>K(d,c,r,s,i,l+1)):n(f,!1),m=t(A),g="",C=0;for(let d=0;d<m.length;d++){let w=m[d];if(w.kind!=="word"||A.slice(w.start,w.end)!=="typeof")continue;let b=m[d+1];if(!b||b.kind!=="word")continue;let x=c.get(A.slice(b.start,b.end)),T=!x,k=w.start,S=b.end,E=d;d++;while(m[d+1]&&A.slice(m[d+1].start,m[d+1].end)==="."&&m[d+2]?.kind==="word"){let L=m[d+2];if(!T)x=`(${x})["${A.slice(L.start,L.end)}"]`;S=L.end,d+=2}if(T&&E>=2&&A.slice(m[E-2].start,m[E-2].end)==="ReturnType"&&A.slice(m[E-1].start,m[E-1].end)==="<"&&m[d+1]&&A.slice(m[d+1].start,m[d+1].end)===">")k=m[E-2].start,S=m[++d].end;g+=A.slice(C,k)+(x??"unknown"),C=S}return g+A.slice(C)}function It(e){let c=t(e),r=0,s=-1;for(let l=0;l<c.length;l++){let f=c[l],u=e.slice(f.start,f.end);if(f.kind!=="punctuation"&&f.kind!=="word")continue;if(["(","[","{"].includes(u))r++;else if([")","]","}"].includes(u))r--;else if(!r&&u==="as"&&l>0&&e.slice(c[l-1].start,c[l-1].end)!==".")s=l}if(s===-1||s+1===c.length)return;let i=e.slice(c[s].end).trim();if(i==="const")return;r=0;for(let l of c.slice(s+1)){if(l.kind!=="punctuation")continue;let f=e.slice(l.start,l.end);if(["(","[","{","<"].includes(f))r++;else if([")","]","}",">"].includes(f))r--;else if(!r&&["+","-","*","/","%","=","!",";"].includes(f))return}return i}function Ct(e){return e.map((c)=>e.length>1&&q(c)!==-1?`(${c})`:c).join(" | ")}function at(e){let c=0;while(c<e.length){let i=e.charCodeAt(c);if(i<=32)c++;else if(i===47&&e.charCodeAt(c+1)===47){c+=2;while(c<e.length&&e.charCodeAt(c)!==10&&e.charCodeAt(c)!==13)c++}else if(i===47&&e.charCodeAt(c+1)===42){let l=e.indexOf("*/",c+2);c=l===-1?e.length:l+2}else break}let r=c,s=c;while(s<e.length){let i=e.charCodeAt(s);if(i===34||i===39||i===96){s=B(e,s,i),r=s;continue}if(i===92){s=Math.min(s+2,e.length),r=s;continue}if(i===47&&e.charCodeAt(s+1)===47){while(s<e.length&&e.charCodeAt(s)!==10&&e.charCodeAt(s)!==13)s++;continue}if(i===47&&e.charCodeAt(s+1)===42){let l=e.indexOf("*/",s+2);s=l===-1?e.length:l+2;continue}if(s++,i>32)r=s}return e.slice(c,r)}function U(e){let c=0;for(let r=0;r<e.length;r++){let s=e[r];if(s==="'"||s==='"'||s==="`"){let i=r+1;while(i<e.length&&e[i]!==s){if(e[i]==="\\")i++;i++}r=i;continue}if(s==="("||s==="["||s==="{")c++;else if(s===")"||s==="]"||s==="}")c--;else if(c!==0)continue;else if(s==="?"){if(e[r+1]!==".")return!1}else if("=!<>&|+-*/%,:".includes(s))return!1;else if(s===" "||s==="\t"||s===`
5
- `||s==="\r"){let i=e.slice(r).trimStart();if(i&&i[0]!=="."&&i[0]!=="?"&&i[0]!=="("&&i[0]!=="[")return!1}}return!0}function Et(e){if(e.startsWith("function")&&G(e,0,8))return!0;let c=q(e);if(c===-1)return!1;let r=e.slice(0,c).trim();if(r.startsWith("async")&&G(r,0,5))r=r.slice(5).trim();if(r.startsWith("<")){let i=o(r,0,"<",">");if(i===-1)return!1;r=r.slice(i+1).trim()}if(r.startsWith("(")){let i=o(r,0,"(",")");if(i===-1)return!1;let l=r.slice(i+1).trim();if(l&&!l.startsWith(":"))return!1}let s=rt(r);return st(s.params)||J(s.params)}function st(e){if(!e.startsWith("(")||!e.endsWith(")"))return!1;let c=0;for(let r=0;r<e.length;r++){let s=e.charCodeAt(r);if(s===40)c++;else if(s===41&&--c===0)return r===e.length-1}return!1}function Mt(e){let c=0,r=-1;for(let s=0;s<e.length;s++){let i=e.charCodeAt(s);if(i===34||i===39||i===96){s=B(e,s,i)-1;continue}if(i===47&&(e.charCodeAt(s+1)===47||e.charCodeAt(s+1)===42)){if(e.charCodeAt(s+1)===47)while(s+1<e.length&&e.charCodeAt(s+1)!==10&&e.charCodeAt(s+1)!==13)s++;else{let l=e.indexOf("*/",s+2);s=l===-1?e.length:l+1}continue}if(i===40||i===91||i===123)c++;else if(i===41||i===93||i===125)c--;else if(i===63&&c===0&&e.charCodeAt(s+1)!==63)r=s;else if(i===58&&c===0&&r!==-1)return{whenTrue:at(e.slice(r+1,s)),whenFalse:at(e.slice(s+1))}}return null}function G(e,c,r){return(c===0||!R(e.charCodeAt(c-1)))&&!R(e.charCodeAt(c+r))}function At(e,c){let r=c;while(r<e.length){if(e.charCodeAt(r)<=32){r++;continue}if(e.startsWith("//",r)){while(r<e.length&&e.charCodeAt(r)!==10&&e.charCodeAt(r)!==13)r++;continue}if(e.startsWith("/*",r)){let s=e.indexOf("*/",r+2);r=s<0?e.length:s+2;continue}break}return r}function jt(e,c){let r=0,s=0,i=0,l=!1,f=!1;for(let u=c;u<e.length;u++){if(u=At(e,u),u>=e.length)break;let a=e.charCodeAt(u);if(a===34||a===39||a===96){u=B(e,u,a)-1,f=!1;continue}if(R(a)||a>=128){let h=u;while(u+1<e.length&&(R(e.charCodeAt(u+1))||e.charCodeAt(u+1)>=128))u++;f=l&&["keyof","typeof","readonly","unique","new","abstract","infer","extends"].includes(e.slice(h,u+1));continue}if(a===61&&e.charCodeAt(u+1)===62){u++,f=l;continue}if(a===40)r++;else if(a===41)r--,f=!1;else if(a===91)s++;else if(a===93)s--,f=!1;else if(a===60&&r===0&&s===0)i++;else if(a===62&&i>0&&r===0&&s===0)i--,f=!1;else if(a===123)if(r||s||i||l&&f)u=H(e,u)-1,f=!1;else return u;else if(r===0&&s===0&&i===0){if(a===58)l=!0,f=!0;else if(l&&[124,38,63].includes(a))f=!0;else if(a===59)return-1}}return-1}function H(e,c){let r=1,s=c+1;while(s<e.length&&r>0){let i=e.charCodeAt(s);if(i===34||i===39||i===96){s=B(e,s,i);continue}if(i===47&&e.charCodeAt(s+1)===47){s+=2;while(s<e.length&&e.charCodeAt(s)!==10&&e.charCodeAt(s)!==13)s++;continue}if(i===47&&e.charCodeAt(s+1)===42){let l=e.indexOf("*/",s+2);s=l===-1?e.length:l+2;continue}if(i===123)r++;else if(i===125)r--;s++}return s}function B(e,c,r){let s=c+1;while(s<e.length){let i=e.charCodeAt(s);if(i===92){s+=2;continue}if(r===96&&i===36&&e.charCodeAt(s+1)===123){s=H(e,s+1);continue}if(s++,i===r)break}return s}function Nt(e,c){if(e.includes(".raw`")||e.includes("String.raw`"))return"string";if(!c||e.includes("${")||e.includes(`
6
- `)||e.includes("\r"))return"string";return e}function Bt(e){let c=4;while(c<e.length&&e.charCodeAt(c)<=32)c++;let r=c,s=e.charCodeAt(c);if(s<65||s>90)return"unknown";while(c<e.length&&(R(e.charCodeAt(c))||e.charCodeAt(c)===46))c++;if(c===r)return"unknown";let i=e.slice(r,c);{let l=e.slice(c),f=l;if(l.startsWith("<")){let a=0,h=-1;for(let p=0;p<l.length;p++)if(l[p]==="<")a++;else if(l[p]===">"){if(a--,a===0){h=p;break}}if(h!==-1){let p=l.slice(0,h+1);f=l.slice(h+1);let y=f.indexOf("(");if(y!==-1){let A=0,m=-1;for(let g=y;g<f.length;g++)if(f[g]==="(")A++;else if(f[g]===")"){if(A--,A===0){m=g;break}}if(m!==-1){if(f.slice(m+1).trimStart().startsWith("."))return"unknown"}}return`${i}${p}`}}let u=f.indexOf("(");if(u!==-1){let a=0,h=-1;for(let p=u;p<f.length;p++)if(f[p]==="(")a++;else if(f[p]===")"){if(a--,a===0){h=p;break}}if(h!==-1){if(f.slice(h+1).trimStart().startsWith("."))return"unknown"}}switch(i){case"Date":return"Date";case"Map":return"Map<any, any>";case"Set":return"Set<any>";case"WeakMap":return"WeakMap<any, any>";case"WeakSet":return"WeakSet<any>";case"RegExp":return"RegExp";case"Error":return"Error";case"Array":return"any[]";case"Object":return"object";case"Function":return"Function";case"Promise":return"Promise<any>";default:return i}}return"unknown"}function Kt(e){return"{ new (...args: any[]): any }"}function yt(e,c,r=0,s){if(e.startsWith("Promise.resolve(")){let l=e.indexOf(")",16);if(l!==-1){let f=e.slice(16,l).trim();if(f)return`Promise<${n(f,c,!1,r+1,s)}>`}return"Promise<unknown>"}if(e.startsWith("Promise.reject("))return"Promise<never>";if(e.startsWith("Promise.all(")){let i=e.indexOf("[",12),l=e.lastIndexOf("]");if(i!==-1&&l>i){let f=e.slice(i+1,l).trim(),u=re(f),a=[];for(let h=0;h<u.length;h++){let p=u[h].trim();if(p.startsWith("Promise.resolve(")){let y=yt(p,c,r+1,s),A=y.indexOf("<"),m=y.lastIndexOf(">");a.push(A!==-1&&m>A?y.slice(A+1,m):"unknown")}else a.push(n(p,c,!1,r+1,s))}return`Promise<[${a.join(", ")}]>`}return"Promise<unknown[]>"}return"Promise<unknown>"}function $e(e,c,r=0,s){let i=e.slice(1,-1).trim();if(!i)return"never[]";if(r>=Q)return"unknown[]";let l=re(i),f=!1;for(let m=0;m<l.length;m++){let g=l[m],C=g.length;while(C>0&&g.charCodeAt(C-1)<=32)C--;if(C>=8&&g.slice(C-8,C)==="as const"){f=!0;break}}if(f){let m=[];for(let g=0;g<l.length;g++){let C=l[g].trim();if(C.endsWith("as const")){let d=C.slice(0,-8).trim();if(d.startsWith("[")&&d.endsWith("]")){let w=d.slice(1,-1).trim(),b=re(w),x=[];for(let T=0;T<b.length;T++)x.push(n(b[T].trim(),!0,!1,r+1,s));m.push(`readonly [${x.join(", ")}]`)}else m.push(n(d,!0,!1,r+1,s))}else if(C.startsWith("[")&&C.endsWith("]"))m.push($e(C,!0,r+1,s));else m.push(n(C,!0,!1,r+1,s))}return`readonly [
2
+ import{t}from"./chunk-1j6092xz.js";import{Un,zn,Hn}from"./chunk-32qexm3w.js";import{De}from"./chunk-0rmbc5zp.js";import{Pe}from"./chunk-cv29b4zb.js";var Q=20,Y=!1,E=null;function _(e){return Ct(e).replace(/\n[ \t]*(?=\n)/g,"")}function Ct(e){if(e.indexOf("/*")===-1)return e.trim();let r=[],s=0,i=0,l=e.length;while(i<l)if(e.charCodeAt(i)===47&&i+1<l&&e.charCodeAt(i+1)===42){if(i>s)r.push(e.substring(s,i));i+=2;while(i<l-1){if(e.charCodeAt(i)===42&&e.charCodeAt(i+1)===47){i+=2;break}i++}s=i}else i++;if(s<l)r.push(e.substring(s));return r.join("").trim()}function Rt(){Y=!0,E=null}function Mt(){Y=!1;let e=E;return E=null,e}function ot(e){let c=e.length;if(c===0)return!1;let r=0;if(e.charCodeAt(r)===45)r++;if(r>=c)return!1;let s=r;while(r<c&&e.charCodeAt(r)>=48&&e.charCodeAt(r)<=57)r++;if(r===s)return!1;if(r<c&&e.charCodeAt(r)===46){r++;let i=r;while(r<c&&e.charCodeAt(r)>=48&&e.charCodeAt(r)<=57)r++;if(r===i)return!1}return r===c}function bt(e){for(let c=0,r=e.length-1;c<r;c++){let s=e.charCodeAt(c);if(s<48||s>57)return!1}return!0}function Z(e,c){let r=0,s=0;while((s=e.indexOf(c,s))!==-1)r++,s+=c.length;return r}function at(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===36||e===95||e===46||e===58||e===45}function z(e){let c=e.trim();if(c.length<3||c.charCodeAt(0)!==60)return!1;if(c.startsWith("<>"))return c.endsWith("</>");let r=c.charCodeAt(1);if(!(r>=65&&r<=90||r>=97&&r<=122||r===36||r===95))return!1;let i=2;while(i<c.length&&at(c.charCodeAt(i)))i++;let l=c.slice(1,i),f=c.charCodeAt(i);if(f>32&&f!==62&&f!==47)return!1;if(c.endsWith("/>"))return!0;let u=c.lastIndexOf("</");if(u===-1)return!1;let a=u+2;while(a<c.length&&at(c.charCodeAt(a)))a++;return c.slice(u+2,a)===l&&c.charCodeAt(a)===62&&a===c.length-1}function X(e){let c=e.length,r=!1;for(let f=1;f<c;f++)if(e.charCodeAt(f)<=32&&e.charCodeAt(f-1)<=32){r=!0;break}if(!r)for(let f=0;f<c;f++){let u=e.charCodeAt(f);if(u===10||u===13||u===9){r=!0;break}}if(!r)return e;let s=[],i=-1,l=!1;for(let f=0;f<c;f++)if(e.charCodeAt(f)<=32){if(!l){if(i>=0)s.push(e.substring(i,f));s.push(" "),l=!0,i=-1}}else{if(l||i<0)i=f;l=!1}if(i>=0)s.push(e.substring(i));return s.join("")}function n(e,c=!1,r=!1,s=0,i){if(!e||typeof e!=="string")return"unknown";if(s>=Q)return"unknown";let l=e.trim();if(z(l))return"JSX.Element";if(l.startsWith("BigInt("))return"bigint";if(l.startsWith("Symbol.for("))return"symbol";if(l.includes(".raw`")||l.includes("String.raw`"))return"string";if(l.startsWith("`")&&l.endsWith("`")){if(!c||l.includes("${")||l.includes(`
3
+ `)||l.includes("\r"))return"string";return l}if(l.charCodeAt(0)===39||l.charCodeAt(0)===34){let u=Tt(l);if(u!==null){if(u==="string"||!c)return"string";return u}}if(ot(l)){if(!c)return"number";return l}if(l==="true"||l==="false"){if(!c)return"boolean";return l}if(l==="null")return"null";if(l==="undefined")return"undefined";if(l.startsWith("[")&&l.endsWith("]"))return ke(l,c,s+1,i);if(l.startsWith("{")&&l.endsWith("}"))return et(l,c,s+1,i);if(l.startsWith("class ")||l.startsWith("class{"))return Ft(l);if(l.startsWith("new "))return Lt(l);if(l.endsWith("as const")){let u=l.slice(0,-8).trim();if(u.startsWith("[")&&u.endsWith("]")){let a=u.slice(1,-1).trim();if(!a)return"readonly []";let h=oe(a),p=[];for(let y=0;y<h.length;y++){let A=h[y].trim();if(A.startsWith("...")){let m=A.slice(3).trim();if(F(m))p.push(`...typeof ${m}`);else{let g=n(m,!0,!1,s+1,i);p.push(g.startsWith("readonly [")||g.endsWith("[]")?`...${g}`:"...unknown[]")}}else p.push(n(A,!0,!1,s+1,i))}return`readonly [${p.join(", ")}]`}return n(u,!0,r,s+1,i)}if(q(l)!==-1||l.startsWith("function")||l.startsWith("async"))return tt(l,r,s,c);if(l.startsWith("`")&&l.endsWith("`"))return Kt(l,c);if(l.startsWith("Promise."))return Wt(l,c,s,i);if(l.startsWith("await "))return"unknown";if(l.startsWith("typeof ")&&U(l.slice(7)))return"string";if(l.startsWith("void ")&&U(l.slice(5)))return"undefined";if(l.startsWith("delete ")&&U(l.slice(7)))return"boolean";if(l.charCodeAt(l.length-1)===110&&l.length>1&&bt(l)){if(c)return l;return"bigint"}if(l.startsWith("Symbol(")||l==="Symbol.for")return"symbol";let f=Te(l);if(f!==null)return f;if(At(l))return"boolean";if(It(l))return"number";return"unknown"}function ut(e){let c=e.charCodeAt(0);if(c!==39&&c!==34)return!1;return B(e,0,c)===e.length}function Tt(e){if(ut(e))return e;let c=kt(e);if(c.length<2)return null;let r=!1,s=!0,i="";for(let l of c){let f=l.trim();if(ut(f))r=!0,i+=St(f);else s=!1}if(s)return Pt(i);if(r)return"string";return null}function kt(e){let c=[],r=0,s=0,i=0;while(i<e.length){let l=e.charCodeAt(i);if(l===39||l===34||l===96){i=B(e,i,l);continue}if(l===40||l===91||l===123)r++;else if(l===41||l===93||l===125)r--;else if(l===43&&r===0)c.push(e.slice(s,i)),s=i+1;i++}return c.push(e.slice(s)),c}function St(e){return e.slice(1,-1).replace(/\\(.)/g,(r,s)=>{if(s==="n")return`
4
+ `;if(s==="t")return"\t";if(s==="r")return"\r";if(s==="0")return"\x00";return s})}function Pt(e){return`'${e.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}'`}function It(e){if(e==="")return!1;let c=!1,r=!1;for(let s=0;s<e.length;s++){let i=e.charCodeAt(s);if(i>=48&&i<=57){c=!0;continue}if(i===43||i===45||i===42||i===47||i===37){r=!0;continue}if(i===46||i===40||i===41||i<=32)continue;return!1}return c&&r}function At(e){let c=0;for(let r=0;r<e.length;r++){let s=e.charCodeAt(r);if(s===34||s===39||s===96){r=B(e,r,s)-1;continue}if(s===40||s===91||s===123){c++;continue}if(s===41||s===93||s===125){c--;continue}if(c!==0)continue;if(e.startsWith("===",r)||e.startsWith("!==",r)||e.startsWith("==",r)||e.startsWith("!=",r)||e.startsWith(">=",r)||e.startsWith("<=",r))return!0;if((s===62||s===60)&&e.charCodeAt(r-1)!==61&&e.charCodeAt(r+1)!==61)return!0}return!1}function Ot(e,c=!1,r=0,s){return n(e,c,!0,r,s)}function I(e,c=!1,r="",s,i){let l=v(r,s),f=[],u=!1,a=0;while(a<e.length){let p=e.charCodeAt(a);if(p===34||p===39||p===96){a=B(e,a,p);continue}if(p===47&&e.charCodeAt(a+1)===47){a+=2;while(a<e.length&&e.charCodeAt(a)!==10&&e.charCodeAt(a)!==13)a++;continue}if(p===47&&e.charCodeAt(a+1)===42){let A=e.indexOf("*/",a+2);a=A===-1?e.length:A+2;continue}if(e.startsWith("function",a)&&G(e,a,8)||e.startsWith("class",a)&&G(e,a,5)){let A=Bt(e,a);if(A!==-1){a=H(e,A);continue}}if(p===61&&e.charCodeAt(a+1)===62){let A=wt(e,a+2);if(e.charCodeAt(A)===123){a=H(e,A);continue}}if(e.startsWith("return",a)&&(a===0||!R(e.charCodeAt(a-1)))&&!R(e.charCodeAt(a+6))){a+=6;let A=!1;while(a<e.length&&e.charCodeAt(a)<=32){let W=e.charCodeAt(a);if(W===10||W===13)A=!0;a++}if(A||a>=e.length||e.charCodeAt(a)===59||e.charCodeAt(a)===125){u=!0;continue}let m=a,g=0,C=0,d=0;while(a<e.length){let W=e.charCodeAt(a);if(W===34||W===39||W===96){a=B(e,a,W);continue}if(W===47&&e.charCodeAt(a+1)===47){if(g===0&&C===0&&d===0)break;while(a<e.length&&e.charCodeAt(a)!==10&&e.charCodeAt(a)!==13)a++;continue}if(W===47&&e.charCodeAt(a+1)===42){let b=e.indexOf("*/",a+2);a=b===-1?e.length:b+2;continue}if(W===40)g++;else if(W===41)g--;else if(W===91)C++;else if(W===93)C--;else if(W===123)d++;else if(W===125){if(d===0&&g===0&&C===0)break;d--}else if(W===59&&g===0&&C===0&&d===0)break;else if((W===10||W===13)&&g===0&&C===0&&d===0){let b=a+1;while(b<e.length&&e.charCodeAt(b)<=32)b++;if(e.startsWith("return",b)&&!R(e.charCodeAt(b+6)))break}a++}let w=e.slice(m,a).trim(),x=_(K(w,l,s,i,m));if(!f.includes(x))f.push(x);continue}a++}if(u&&!f.includes("undefined"))f.push("undefined");let h=f.includes("unknown")?"unknown":f.length===0?"void":yt(f);return c&&!h.startsWith("Promise<")?`Promise<${h}>`:h}function v(e,c){let r=new Map,s=e.startsWith("(")&&e.endsWith(")")?e.slice(1,-1):e,i=t(s),l=0,f=0,u=[];for(let a of i){let h=s.slice(a.start,a.end);if(h===","&&f===0)u.push(s.slice(l,a.start)),l=a.end;if(["(","[","{","<"].includes(h))f++;else if([")","]","}"].includes(h)||h===">"&&s[a.start-1]!=="=")f--}u.push(s.slice(l));for(let a of u){let h=t(a),p=-1,y=-1,A=0;for(let C of h){let d=a.slice(C.start,C.end);if(A===0&&d===":"&&p===-1)p=C.start;if(A===0&&d==="="&&a[C.end]!==">"){y=C.start;break}if(["(","[","{","<"].includes(d))A++;else if([")","]","}"].includes(d)||d===">"&&a[C.start-1]!=="=")A--}let m=a.slice(0,p!==-1?p:y!==-1?y:void 0).trim().replace(/^\.\.\./,"").replace(/\?$/,"");if(!J(m))continue;let g=p!==-1?a.slice(p+1,y!==-1?y:void 0).trim():"";if(!g&&y!==-1){let C=a.slice(y+1).trim();g=c?.(C)??n(C,!1)}if(g){if(y===-1&&a.slice(0,p).trim().endsWith("?"))g=`(${g}) | undefined`;r.set(m,g)}}return r}function Et(e,c){if(e=e.trim(),!e.startsWith("{")||!e.endsWith("}"))return;let r=e.slice(1,-1),s=t(r),i=0,l=0;for(let f=0;f<=s.length;f++){let u=s[f],a=u?r.slice(u.start,u.end):";";if(l===0&&(a===";"||a===",")){let h=r.slice(i,u?.start).trim(),p=h.indexOf(":");if(p!==-1&&h.slice(0,p).trim()===c)return h.slice(p+1).trim();i=u?.end??r.length}if(["(","[","{","<"].includes(a))l++;else if([")","]","}"].includes(a)||a===">"&&u&&r[u.start-1]!=="=")l--}return}function K(e,c,r,s,i=0,l=0){if(l>=Q)return"unknown";let f=e.trim();while(ct(f))f=f.slice(1,-1).trim();let u=r?.(f);if(u)return u;if(z(f))return"JSX.Element";if(f.startsWith("await ")){let d=K(f.slice(6),c,r,s,i,l+1);return d.startsWith("Promise<")&&d.endsWith(">")?d.slice(8,-1):d}if(c.has(f))return c.get(f);let a=/^([\w$]+)\.([\w$]+)$/.exec(f);if(a){let d=c.get(a[1]),w=d&&Et(d,a[2]);if(w)return w}if(f.startsWith("!"))return"boolean";if(f.startsWith("fetch("))return"Promise<Response>";if(Dt(f))return n(f,!1);let h=Nt(f);if(h){let d=K(h.whenTrue,c,r,s,i,l+1),w=K(h.whenFalse,c,r,s,i,l+1);return d===w?d:yt([d,w])}let p=jt(f);if(p&&s)return s(p,i);if(At(f))return"boolean";let y=0;for(let d=f.length-1;d>=0;d--){let w=f.charCodeAt(d);if(w===41||w===93||w===125)y++;else if(w===40||w===91||w===123)y--;else if(y===0&&(w===43||w===45||w===42||w===47||w===37)){let x=K(f.slice(0,d),c,r,s,i,l+1),W=K(f.slice(d+1),c,r,s,i,l+1);if(w===43&&(x==="string"||W==="string"))return"string";if(x==="number"&&W==="number")return"number";break}}let A=f.startsWith("{")&&f.endsWith("}")?et(f,!1,l+1,void 0,(d)=>K(d,c,r,s,i,l+1)):n(f,!1),m=t(A),g="",C=0;for(let d=0;d<m.length;d++){let w=m[d];if(w.kind!=="word"||A.slice(w.start,w.end)!=="typeof")continue;let x=m[d+1];if(!x||x.kind!=="word")continue;let W=c.get(A.slice(x.start,x.end)),b=!W,T=w.start,k=x.end,O=d;d++;while(m[d+1]&&A.slice(m[d+1].start,m[d+1].end)==="."&&m[d+2]?.kind==="word"){let L=m[d+2];if(!b)W=`(${W})["${A.slice(L.start,L.end)}"]`;k=L.end,d+=2}if(b&&O>=2&&A.slice(m[O-2].start,m[O-2].end)==="ReturnType"&&A.slice(m[O-1].start,m[O-1].end)==="<"&&m[d+1]&&A.slice(m[d+1].start,m[d+1].end)===">")T=m[O-2].start,k=m[++d].end;g+=A.slice(C,T)+(W??"unknown"),C=k}return g+A.slice(C)}function jt(e){let c=t(e),r=0,s=-1;for(let l=0;l<c.length;l++){let f=c[l],u=e.slice(f.start,f.end);if(f.kind!=="punctuation"&&f.kind!=="word")continue;if(["(","[","{"].includes(u))r++;else if([")","]","}"].includes(u))r--;else if(!r&&u==="as"&&l>0&&e.slice(c[l-1].start,c[l-1].end)!==".")s=l}if(s===-1||s+1===c.length)return;let i=e.slice(c[s].end).trim();if(i==="const")return;r=0;for(let l of c.slice(s+1)){if(l.kind!=="punctuation")continue;let f=e.slice(l.start,l.end);if(["(","[","{","<"].includes(f))r++;else if([")","]","}",">"].includes(f))r--;else if(!r&&["+","-","*","/","%","=","!",";"].includes(f))return}return i}function yt(e){return e.map((c)=>e.length>1&&q(c)!==-1?`(${c})`:c).join(" | ")}function ht(e){let c=0;while(c<e.length){let i=e.charCodeAt(c);if(i<=32)c++;else if(i===47&&e.charCodeAt(c+1)===47){c+=2;while(c<e.length&&e.charCodeAt(c)!==10&&e.charCodeAt(c)!==13)c++}else if(i===47&&e.charCodeAt(c+1)===42){let l=e.indexOf("*/",c+2);c=l===-1?e.length:l+2}else break}let r=c,s=c;while(s<e.length){let i=e.charCodeAt(s);if(i===34||i===39||i===96){s=B(e,s,i),r=s;continue}if(i===92){s=Math.min(s+2,e.length),r=s;continue}if(i===47&&e.charCodeAt(s+1)===47){while(s<e.length&&e.charCodeAt(s)!==10&&e.charCodeAt(s)!==13)s++;continue}if(i===47&&e.charCodeAt(s+1)===42){let l=e.indexOf("*/",s+2);s=l===-1?e.length:l+2;continue}if(s++,i>32)r=s}return e.slice(c,r)}function U(e){let c=0;for(let r=0;r<e.length;r++){let s=e[r];if(s==="'"||s==='"'||s==="`"){let i=r+1;while(i<e.length&&e[i]!==s){if(e[i]==="\\")i++;i++}r=i;continue}if(s==="("||s==="["||s==="{")c++;else if(s===")"||s==="]"||s==="}")c--;else if(c!==0)continue;else if(s==="?"){if(e[r+1]!==".")return!1}else if("=!<>&|+-*/%,:".includes(s))return!1;else if(s===" "||s==="\t"||s===`
5
+ `||s==="\r"){let i=e.slice(r).trimStart();if(i&&i[0]!=="."&&i[0]!=="?"&&i[0]!=="("&&i[0]!=="[")return!1}}return!0}function Dt(e){if(e.startsWith("function")&&G(e,0,8))return!0;let c=q(e);if(c===-1)return!1;let r=e.slice(0,c).trim();if(r.startsWith("async")&&G(r,0,5))r=r.slice(5).trim();if(r.startsWith("<")){let i=o(r,0,"<",">");if(i===-1)return!1;r=r.slice(i+1).trim()}if(r.startsWith("(")){let i=o(r,0,"(",")");if(i===-1)return!1;let l=r.slice(i+1).trim();if(l&&!l.startsWith(":"))return!1}let s=st(r);return ct(s.params)||J(s.params)}function ct(e){if(!e.startsWith("(")||!e.endsWith(")"))return!1;let c=0;for(let r=0;r<e.length;r++){let s=e.charCodeAt(r);if(s===40)c++;else if(s===41&&--c===0)return r===e.length-1}return!1}function Nt(e){let c=0,r=-1;for(let s=0;s<e.length;s++){let i=e.charCodeAt(s);if(i===34||i===39||i===96){s=B(e,s,i)-1;continue}if(i===47&&(e.charCodeAt(s+1)===47||e.charCodeAt(s+1)===42)){if(e.charCodeAt(s+1)===47)while(s+1<e.length&&e.charCodeAt(s+1)!==10&&e.charCodeAt(s+1)!==13)s++;else{let l=e.indexOf("*/",s+2);s=l===-1?e.length:l+1}continue}if(i===40||i===91||i===123)c++;else if(i===41||i===93||i===125)c--;else if(i===63&&c===0&&e.charCodeAt(s+1)!==63)r=s;else if(i===58&&c===0&&r!==-1)return{whenTrue:ht(e.slice(r+1,s)),whenFalse:ht(e.slice(s+1))}}return null}function G(e,c,r){return(c===0||!R(e.charCodeAt(c-1)))&&!R(e.charCodeAt(c+r))}function wt(e,c){let r=c;while(r<e.length){if(e.charCodeAt(r)<=32){r++;continue}if(e.startsWith("//",r)){while(r<e.length&&e.charCodeAt(r)!==10&&e.charCodeAt(r)!==13)r++;continue}if(e.startsWith("/*",r)){let s=e.indexOf("*/",r+2);r=s<0?e.length:s+2;continue}break}return r}function Bt(e,c){let r=0,s=0,i=0,l=!1,f=!1;for(let u=c;u<e.length;u++){if(u=wt(e,u),u>=e.length)break;let a=e.charCodeAt(u);if(a===34||a===39||a===96){u=B(e,u,a)-1,f=!1;continue}if(R(a)||a>=128){let h=u;while(u+1<e.length&&(R(e.charCodeAt(u+1))||e.charCodeAt(u+1)>=128))u++;f=l&&["keyof","typeof","readonly","unique","new","abstract","infer","extends"].includes(e.slice(h,u+1));continue}if(a===61&&e.charCodeAt(u+1)===62){u++,f=l;continue}if(a===40)r++;else if(a===41)r--,f=!1;else if(a===91)s++;else if(a===93)s--,f=!1;else if(a===60&&r===0&&s===0)i++;else if(a===62&&i>0&&r===0&&s===0)i--,f=!1;else if(a===123)if(r||s||i||l&&f)u=H(e,u)-1,f=!1;else return u;else if(r===0&&s===0&&i===0){if(a===58)l=!0,f=!0;else if(l&&[124,38,63].includes(a))f=!0;else if(a===59)return-1}}return-1}function H(e,c){let r=1,s=c+1;while(s<e.length&&r>0){let i=e.charCodeAt(s);if(i===34||i===39||i===96){s=B(e,s,i);continue}if(i===47&&e.charCodeAt(s+1)===47){s+=2;while(s<e.length&&e.charCodeAt(s)!==10&&e.charCodeAt(s)!==13)s++;continue}if(i===47&&e.charCodeAt(s+1)===42){let l=e.indexOf("*/",s+2);s=l===-1?e.length:l+2;continue}if(i===123)r++;else if(i===125)r--;s++}return s}function B(e,c,r){let s=c+1;while(s<e.length){let i=e.charCodeAt(s);if(i===92){s+=2;continue}if(r===96&&i===36&&e.charCodeAt(s+1)===123){s=H(e,s+1);continue}if(s++,i===r)break}return s}function Kt(e,c){if(e.includes(".raw`")||e.includes("String.raw`"))return"string";if(!c||e.includes("${")||e.includes(`
6
+ `)||e.includes("\r"))return"string";return e}function Lt(e){let c=4;while(c<e.length&&e.charCodeAt(c)<=32)c++;let r=c,s=e.charCodeAt(c);if(s<65||s>90)return"unknown";while(c<e.length&&(R(e.charCodeAt(c))||e.charCodeAt(c)===46))c++;if(c===r)return"unknown";let i=e.slice(r,c);{let l=e.slice(c),f=l;if(l.startsWith("<")){let a=0,h=-1;for(let p=0;p<l.length;p++)if(l[p]==="<")a++;else if(l[p]===">"){if(a--,a===0){h=p;break}}if(h!==-1){let p=l.slice(0,h+1);f=l.slice(h+1);let y=f.indexOf("(");if(y!==-1){let A=0,m=-1;for(let g=y;g<f.length;g++)if(f[g]==="(")A++;else if(f[g]===")"){if(A--,A===0){m=g;break}}if(m!==-1){if(f.slice(m+1).trimStart().startsWith("."))return"unknown"}}return`${i}${p}`}}let u=f.indexOf("(");if(u!==-1){let a=0,h=-1;for(let p=u;p<f.length;p++)if(f[p]==="(")a++;else if(f[p]===")"){if(a--,a===0){h=p;break}}if(h!==-1){if(f.slice(h+1).trimStart().startsWith("."))return"unknown"}}switch(i){case"Date":return"Date";case"Map":return"Map<any, any>";case"Set":return"Set<any>";case"WeakMap":return"WeakMap<any, any>";case"WeakSet":return"WeakSet<any>";case"RegExp":return"RegExp";case"Error":return"Error";case"Array":return"any[]";case"Object":return"object";case"Function":return"Function";case"Promise":return"Promise<any>";default:return i}}return"unknown"}function Ft(e){return"{ new (...args: any[]): any }"}function Wt(e,c,r=0,s){if(e.startsWith("Promise.resolve(")){let l=e.indexOf(")",16);if(l!==-1){let f=e.slice(16,l).trim();if(f)return`Promise<${n(f,c,!1,r+1,s)}>`}return"Promise<unknown>"}if(e.startsWith("Promise.reject("))return"Promise<never>";if(e.startsWith("Promise.all(")){let i=e.indexOf("[",12),l=e.lastIndexOf("]");if(i!==-1&&l>i){let f=e.slice(i+1,l).trim(),u=oe(f),a=[];for(let h=0;h<u.length;h++){let p=u[h].trim();if(p.startsWith("Promise.resolve(")){let y=Wt(p,c,r+1,s),A=y.indexOf("<"),m=y.lastIndexOf(">");a.push(A!==-1&&m>A?y.slice(A+1,m):"unknown")}else a.push(n(p,c,!1,r+1,s))}return`Promise<[${a.join(", ")}]>`}return"Promise<unknown[]>"}return"Promise<unknown>"}function ke(e,c,r=0,s){let i=e.slice(1,-1).trim();if(!i)return"never[]";if(r>=Q)return"unknown[]";let l=oe(i),f=!1;for(let m=0;m<l.length;m++){let g=l[m],C=g.length;while(C>0&&g.charCodeAt(C-1)<=32)C--;if(C>=8&&g.slice(C-8,C)==="as const"){f=!0;break}}if(f){let m=[];for(let g=0;g<l.length;g++){let C=l[g].trim();if(C.endsWith("as const")){let d=C.slice(0,-8).trim();if(d.startsWith("[")&&d.endsWith("]")){let w=d.slice(1,-1).trim(),x=oe(w),W=[];for(let b=0;b<x.length;b++)W.push(n(x[b].trim(),!0,!1,r+1,s));m.push(`readonly [${W.join(", ")}]`)}else m.push(n(d,!0,!1,r+1,s))}else if(C.startsWith("[")&&C.endsWith("]"))m.push(ke(C,!0,r+1,s));else m.push(n(C,!0,!1,r+1,s))}return`readonly [
7
7
  ${m.join(` |
8
8
  `)}
9
- ]`}let u=Y&&!c,a=[],h=[];for(let m of l){let g=m.trim(),C=M;if(M=null,g.startsWith("...")){let d=g.slice(3).trim(),w=n(d,!1,!1,r+1,s);if(w.endsWith("[]"))a.push(w.slice(0,-2));else if(w.startsWith("readonly [")&&w.endsWith("]"))a.push(w.slice(10,-1));else if(F(d))a.push(`(typeof ${d})[number]`);else a.push("unknown")}else if(g.startsWith("[")&&g.endsWith("]"))a.push($e(g,c,r+1,s));else a.push(Rt(g,c,r+1,s));if(u)h.push(M);M=C}if(u)if(et(e))M=X(e);else{let m=[];for(let g=0;g<l.length;g++){let C=l[g].trim();if(C.endsWith("as const"))continue;if(tt(C)||C==="null"||C==="undefined")m.push(C);else if(C.startsWith("[")&&et(C))m.push(X(C));else if(C.startsWith("{")){if(h[g])m.push(h[g])}else{let d=n(C,!1,!1,0,s);if(d!=="unknown")m.push(d)}}if(m.length>0)M=`[${m.join(", ")}]`}if(c)return`readonly [${a.join(", ")}]`;let p=new Set,y=[],A=!0;for(let m of a){if(!p.has(m))p.add(m),y.push(m);if(A){if(!(it(m)||m==="true"||m==="false"||m.charCodeAt(0)===34&&m.charCodeAt(m.length-1)===34||m.charCodeAt(0)===39&&m.charCodeAt(m.length-1)===39))A=!1}}if(A&&a.length<=10)return`readonly [${a.join(", ")}]`;if(y.length===1)return`${y[0]}[]`;return`(${y.join(" | ")})[]`}function re(e){let c=[],r=0,s=!1,i=0,l=-1,f=0;for(let u=0;u<e.length;u++){let a=e.charCodeAt(u);if(s){if(a===92)u++;else if(a===i)s=!1;f=u+1;continue}if(a===47&&e.charCodeAt(u+1)===47){let h=e.indexOf(`
10
- `,u+2);u=(h===-1?e.length:h)-1;continue}if(a===47&&e.charCodeAt(u+1)===42){let h=e.indexOf("*/",u+2);u=(h===-1?e.length:h+2)-1;continue}if(a===32||a===9||a===10||a===13)continue;if(a===44&&r===0){if(l!==-1)c.push(e.slice(l,f));l=-1;continue}if(a===34||a===39||a===96)s=!0,i=a;else if(a===91||a===123||a===40)r++;else if(a===93||a===125||a===41)r--;if(l===-1)l=u;f=u+1}if(l!==-1)c.push(e.slice(l,f));return c}function tt(e){if(it(e))return!0;if(e==="true"||e==="false")return!0;if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return!0;return!1}function Lt(e){return e==="number"||e==="string"||e==="boolean"}function et(e){let c=!1,r=0,s=e.length;for(let i=0;i<s;i++){let l=e.charCodeAt(i);if(c){if(l===92){i++;continue}if(l===r)c=!1;continue}if(l===34||l===39||l===96){c=!0,r=l;continue}if(l===61&&i+1<s&&e.charCodeAt(i+1)===62)return!1;if(l===47&&(e.charCodeAt(i+1)===47||e.charCodeAt(i+1)===42))return!1;if(l>=97&&l<=122){let f=i;while(i<s&&(e.charCodeAt(i)>=97&&e.charCodeAt(i)<=122||e.charCodeAt(i)>=65&&e.charCodeAt(i)<=90||e.charCodeAt(i)>=48&&e.charCodeAt(i)<=57||e.charCodeAt(i)===95||e.charCodeAt(i)===36))i++;let u=e.slice(f,i);if(u==="new"||u==="async"||u==="await"||u==="function"||u==="yield"||u==="console"||u==="process")return!1;let a=i;while(a<s&&e.charCodeAt(a)<=32)a++;if(a<s&&e.charCodeAt(a)===40)return!1;i--}}return!0}function Ze(e,c,r=0,s,i){let l=e.slice(1,-1).trim();if(!l)return"{}";if(r>=Q)return"Record<string, unknown>";let f=Gt(l),u=new Set(f.flatMap(([d])=>{let w=dt(nt(d).key);return w?.kind==="get"?[w.name]:[]})),a=[],h=[],p=[],y=!1,A=Y&&!c,m=[];for(let[d,w]of f){let{comments:b,key:x}=nt(d),T=b?`${b}
11
- `:"",k=dt(x);if(k&&Gn(k.name))continue;let S=x,E=!1;if(x==="..."){let I=w.trim(),N=F(I)?`typeof ${I}`:n(I,c,!1,r+1,s);if(N!=="unknown")h.push(N);if(A&&(F(I)||I.startsWith("{")))m.push(`...${X(I)}`);continue}let L=M;M=null;let P,D=w.trim();if(D===x&&J(D))P=(c?void 0:s?.mutableBindingTypes?.get(D))??`typeof ${D}`;else if(Xt(D)){E=!0;let I=Ht(x);if(I){S=I.name;let N="";if(D.startsWith("async "))N="async ";if(D.charCodeAt(N.length)===42)N+="*";P=gt(I.name,N+I.typeParams+D.slice(N.length))}else P=gt(x,D)}else{if(P=i?.(w)??n(w,c,!1,r+1,s),P==="unknown"&&F(D))P=(c?void 0:s?.mutableBindingTypes?.get(D))??`typeof ${D}`;if(P.includes("=>")||P.includes("function")||P.includes("async"))P=ut(P)}let ct=M;M=L;let Wt=S,j=w.trim(),V=jn(S,s);if(!_n(k?.name??S,s)&&!(k?.kind==="set"&&u.has(k.name)))p.push(k?zt(k.kind,P):P);if(V&&"index"in V)y=!0;else{if(V&&"name"in V)S=V.name;if(k){let I=Jt(k.kind,k.name,P);if(I){a.push(`${T}${I}`);continue}}if(!c&&Lt(P)&&tt(j))a.push(`${T}/** @defaultValue ${Te(j)} */
12
- ${S}: ${P}`);else a.push(`${T}${c?"readonly ":""}${S}: ${P}`)}if(A){let I=mt(Wt);if(j.endsWith("as const"));else if(tt(j))m.push(`${I}: ${j}`);else if(j.startsWith("[")&&et(j))m.push(`${I}: ${X(j)}`);else if(j.startsWith("{")){if(ct)m.push(`${I}: ${ct}`)}else if(E)m.push(`${I}: ${_(ut(P))}`);else if(!j.startsWith("[")&&(j.includes("=>")||j.startsWith("function")||j.startsWith("async"))){let N=Qe(j,!1,0,!0);m.push(`${I}: ${_(N)}`)}}}if(A&&m.length>0){let d=r>0?(r-1)/2:0,w=`{ ${m.join(", ")} }`;if(w.length<=80)M=w;else{let b=" ".repeat((d+1)*2),x=" ".repeat(d*2);M=`{
13
- ${b}${m.join(`,
14
- ${b}`)}
15
- ${x}}`}}if(y&&h.length===0){let d=[...new Set(p)].map((w)=>w.includes("=>")||w.includes(" & ")?`(${w})`:w);a.unshift(`${c?"readonly ":""}[x: string]: ${d.join(" | ")}`)}let g=a.length>0?`{
9
+ ]`}let u=Y&&!c,a=[],h=[];for(let m of l){let g=m.trim(),C=E;if(E=null,g.startsWith("...")){let d=g.slice(3).trim(),w=n(d,!1,!1,r+1,s);if(w.endsWith("[]"))a.push(w.slice(0,-2));else if(w.startsWith("readonly [")&&w.endsWith("]"))a.push(w.slice(10,-1));else if(F(d))a.push(`(typeof ${d})[number]`);else a.push("unknown")}else if(g.startsWith("[")&&g.endsWith("]"))a.push(ke(g,c,r+1,s));else a.push(Ot(g,c,r+1,s));if(u)h.push(E);E=C}if(u)if(rt(e))E=X(e);else{let m=[];for(let g=0;g<l.length;g++){let C=l[g].trim();if(C.endsWith("as const"))continue;if(nt(C)||C==="null"||C==="undefined")m.push(C);else if(C.startsWith("[")&&rt(C))m.push(X(C));else if(C.startsWith("{")){if(h[g])m.push(h[g])}else{let d=n(C,!1,!1,0,s);if(d!=="unknown")m.push(d)}}if(m.length>0)E=`[${m.join(", ")}]`}if(c)return`readonly [${a.join(", ")}]`;let p=new Set,y=[],A=!0;for(let m of a){if(!p.has(m))p.add(m),y.push(m);if(A){if(!(ot(m)||m==="true"||m==="false"||m.charCodeAt(0)===34&&m.charCodeAt(m.length-1)===34||m.charCodeAt(0)===39&&m.charCodeAt(m.length-1)===39))A=!1}}if(A&&a.length<=10)return`readonly [${a.join(", ")}]`;if(y.length===1)return`${y[0]}[]`;return`(${y.join(" | ")})[]`}function oe(e){let c=[],r=0,s=!1,i=0,l=-1,f=0;for(let u=0;u<e.length;u++){let a=e.charCodeAt(u);if(s){if(a===92)u++;else if(a===i)s=!1;f=u+1;continue}if(a===47&&e.charCodeAt(u+1)===47){let h=e.indexOf(`
10
+ `,u+2);u=(h===-1?e.length:h)-1;continue}if(a===47&&e.charCodeAt(u+1)===42){let h=e.indexOf("*/",u+2);u=(h===-1?e.length:h+2)-1;continue}if(a===32||a===9||a===10||a===13)continue;if(a===44&&r===0){if(l!==-1)c.push(e.slice(l,f));l=-1;continue}if(a===34||a===39||a===96)s=!0,i=a;else if(a===91||a===123||a===40)r++;else if(a===93||a===125||a===41)r--;if(l===-1)l=u;f=u+1}if(l!==-1)c.push(e.slice(l,f));return c}function nt(e){if(ot(e))return!0;if(e==="true"||e==="false")return!0;if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return!0;return!1}function qt(e){return e==="number"||e==="string"||e==="boolean"}function rt(e){let c=!1,r=0,s=e.length;for(let i=0;i<s;i++){let l=e.charCodeAt(i);if(c){if(l===92){i++;continue}if(l===r)c=!1;continue}if(l===34||l===39||l===96){c=!0,r=l;continue}if(l===61&&i+1<s&&e.charCodeAt(i+1)===62)return!1;if(l===47&&(e.charCodeAt(i+1)===47||e.charCodeAt(i+1)===42))return!1;if(l>=97&&l<=122){let f=i;while(i<s&&(e.charCodeAt(i)>=97&&e.charCodeAt(i)<=122||e.charCodeAt(i)>=65&&e.charCodeAt(i)<=90||e.charCodeAt(i)>=48&&e.charCodeAt(i)<=57||e.charCodeAt(i)===95||e.charCodeAt(i)===36))i++;let u=e.slice(f,i);if(u==="new"||u==="async"||u==="await"||u==="function"||u==="yield"||u==="console"||u==="process")return!1;let a=i;while(a<s&&e.charCodeAt(a)<=32)a++;if(a<s&&e.charCodeAt(a)===40)return!1;i--}}return!0}function et(e,c,r=0,s,i){let l=e.slice(1,-1).trim();if(!l)return"{}";if(r>=Q)return"Record<string, unknown>";let f=zt(l),u=new Set(f.flatMap(([d])=>{let w=mt(it(d).key);return w?.kind==="get"?[w.name]:[]})),a=[],h=[],p=[],y=!1,A=Y&&!c,m=[];for(let[d,w]of f){let{comments:x,key:W}=it(d),b=x?`${x}
11
+ `:"",T=mt(W);if(T&&Hn(T.name))continue;let k=W,O=!1;if(W==="..."){let P=w.trim(),N=F(P)?`typeof ${P}`:n(P,c,!1,r+1,s);if(N!=="unknown")h.push(N);if(A&&(F(P)||P.startsWith("{")))m.push(`...${X(P)}`);continue}let L=E;E=null;let S,D=w.trim();if(D===W&&J(D))S=(c?void 0:s?.mutableBindingTypes?.get(D))??`typeof ${D}`;else if(Qt(D)){O=!0;let P=Yt(W);if(P){k=P.name;let N="";if(D.startsWith("async "))N="async ";if(D.charCodeAt(N.length)===42)N+="*";S=pt(P.name,N+P.typeParams+D.slice(N.length))}else S=pt(W,D)}else{if(S=i?.(w)??n(w,c,!1,r+1,s),S==="unknown"&&F(D))S=(c?void 0:s?.mutableBindingTypes?.get(D))??`typeof ${D}`;if(S.includes("=>")||S.includes("function")||S.includes("async"))S=dt(S)}let ft=E;E=L;let $t=k,M=w.trim(),V=Un(k,s);if(!zn(T?.name??k,s)&&!(T?.kind==="set"&&u.has(T.name)))p.push(T?Ht(T.kind,S):S);if(V&&"index"in V)y=!0;else{if(V&&"name"in V)k=V.name;if(T){let P=Xt(T.kind,T.name,S);if(P){a.push(`${b}${P}`);continue}}if(!c&&qt(S)&&nt(M))a.push(`${b}/** @defaultValue ${Pe(M)} */
12
+ ${k}: ${S}`);else a.push(`${b}${c?"readonly ":""}${k}: ${S}`)}if(A){let P=Ct($t);if(M.endsWith("as const"));else if(nt(M))m.push(`${P}: ${M}`);else if(M.startsWith("[")&&rt(M))m.push(`${P}: ${X(M)}`);else if(M.startsWith("{")){if(ft)m.push(`${P}: ${ft}`)}else if(O)m.push(`${P}: ${_(dt(S))}`);else if(!M.startsWith("[")&&(M.includes("=>")||M.startsWith("function")||M.startsWith("async"))){let N=tt(M,!1,0,!0);m.push(`${P}: ${_(N)}`)}}}if(A&&m.length>0){let d=r>0?(r-1)/2:0,w=`{ ${m.join(", ")} }`;if(w.length<=80)E=w;else{let x=" ".repeat((d+1)*2),W=" ".repeat(d*2);E=`{
13
+ ${x}${m.join(`,
14
+ ${x}`)}
15
+ ${W}}`}}if(y&&h.length===0){let d=[...new Set(p)].map((w)=>w.includes("=>")||w.includes(" & ")?`(${w})`:w);a.unshift(`${c?"readonly ":""}[x: string]: ${d.join(" | ")}`)}let g=a.length>0?`{
16
16
  ${a.join(`;
17
17
  `)}
18
- }`:"{}";if(h.length===0)return g;let C=h[0];for(let d=1;d<h.length;d++)C=`Omit<${C}, keyof ${h[d]}> & ${h[d]}`;return a.length>0?`Omit<${C}, keyof ${g}> & ${g}`:C}function J(e){if(!e)return!1;let c=e.charCodeAt(0);if(!(c>=65&&c<=90||c>=97&&c<=122||c===95||c===36||c>127))return!1;for(let r=1;r<e.length;r++)if(!R(e.charCodeAt(r)))return!1;return!0}function F(e){let c=e.split(".");return c.length>0&&c.every(J)}function Ft(e){let c=!1,r="";for(let s=0;s<e.length;s++){let i=e[s];if(c){if(i==="\\")s++;else if(i===r)c=!1;continue}if(i==='"'||i==="'"||i==="`"){c=!0,r=i;continue}if(i==="(")return s;if(i==="<"){let l=o(e,s,"<",">");if(l!==-1)s=l}}return-1}function Ee(e){if(e.length<3||!e.endsWith(")"))return null;let c=Ft(e);if(c===-1||o(e,c,"(",")")!==e.length-1)return null;let r=e.slice(0,c).trim(),s=!1;if(r.endsWith("?."))s=!0,r=r.slice(0,-2).trim();let i=r,l=!1,f=r.indexOf("<");if(f!==-1){if(o(r,f,"<",">")!==r.length-1)return null;i=r.slice(0,f).trim(),l=!0}if(!F(i))return null;let u=e.slice(c+1,-1).trim(),a=q(u)!==-1||u.startsWith("function")||u.startsWith("async function"),h=F(u),p=!a&&u.endsWith(")")&&Ee(u)!==null,y=i.indexOf(".");if(y!==-1){if(i.indexOf(".",y+1)!==-1)return null}else if(!l&&!s&&!a&&!h&&!p)return null;let A=`ReturnType<typeof ${r}>`;return s?`${A} | undefined`:A}function ut(e){let r=e.split(`
19
- `).map((p)=>wt(p)).join(`
20
- `),s=r.indexOf("async");if(s!==-1){let p=s>0?r.charCodeAt(s-1):32,y=s+5<r.length?r.charCodeAt(s+5):32;if(!R(p)&&!R(y))r=(r.slice(0,s)+r.slice(s+5)).trim()}let i=r.indexOf("(");if(i!==-1){let p=o(r,i,"(",")");if(p!==-1){let y=r.slice(i,p+1),A=ie(y);r=r.slice(0,i)+A+r.slice(p+1)}}let l=r.length,f="",u=[],a=!1,h=!1;for(let p=0;p<l;p++){let y=r.charCodeAt(p);if(y===123||y===40)u.push(y);else if(y===125||y===41)u.pop();if(y<=32){if(a=!0,y===10||y===13)h=!0;continue}if(a&&f.length>0){let m=(u.length>0?u[u.length-1]:0)===123;if(h&&m){let g=f.charCodeAt(f.length-1),C=g===59||g===44||g===123||y===125,d=f.length>=2&&f.charCodeAt(f.length-1)===47&&f.charCodeAt(f.length-2)===42;if(!C&&!d)f+="; ";else f+=" "}else f+=" "}a=!1,h=!1,f+=r[p]}return f.trim()}function R(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95||e===36}function ie(e){let c=e.trim(),r,s=!1;if(c.startsWith("(")&&c.endsWith(")"))r=c.slice(1,-1),s=!0;else r=c;let i=r.trim();if(!i)return s?"()":"";let l=!1;{let g=0;for(let C=0;C<i.length;C++){let d=i.charCodeAt(C);if(d===40||d===60||d===91||d===123)g++;else if(d===41||d===93||d===125||d===62&&i.charCodeAt(C-1)!==61)g--;else if(g===0&&d===61){let w=C>0?i.charCodeAt(C-1):0,b=C+1<i.length?i.charCodeAt(C+1):0;if(w!==61&&w!==33&&w!==60&&w!==62&&b!==61&&b!==62){l=!0;break}}}}if(!l)return c;let f=[],u=[],a=0,h=0,p=!1,y=0;for(let g=0;g<=i.length;g++){if(g===i.length){f.push(i.slice(a));break}let C=i.charCodeAt(g);if(p){if(C===92){g++;continue}if(C===y)p=!1;continue}if(C===47&&g+1<i.length){let d=i.charCodeAt(g+1);if(d===42){g+=2;while(g+1<i.length&&!(i.charCodeAt(g)===42&&i.charCodeAt(g+1)===47))g++;g++;continue}if(d===47){while(g<i.length&&i.charCodeAt(g)!==10)g++;continue}}if(C===39||C===34||C===96){p=!0,y=C;continue}if(C===40||C===60||C===91||C===123)h++;else if(C===41||C===93||C===125||C===62&&i.charCodeAt(g-1)!==61)h--;else if(C===44&&h===0){f.push(i.slice(a,g));let d=",",w=g+1;while(w<i.length&&i.charCodeAt(w)<=32)d+=i[w],w++;u.push(d),a=w}}let A=[];for(let g of f){let C=g.trim();if(!C){A.push(g);continue}if(C.startsWith("//"))continue;let d=wt(C),w=g.slice(0,g.length-g.trimStart().length);A.push(w+qt(d))}let m=A[0]||"";for(let g=1;g<A.length;g++)m+=(u[g-1]||", ")+A[g];return Ae(s?`(${m})`:m)}function wt(e){let c=!1,r=0;for(let s=0;s<e.length-1;s++){let i=e.charCodeAt(s);if(c){if(i===92){s++;continue}if(i===r)c=!1;continue}if(i===39||i===34||i===96){c=!0,r=i;continue}if(i===47&&e.charCodeAt(s+1)===47)return e.slice(0,s).trimEnd()}return e}function qt(e){if(e.startsWith("..."))return e;let c=-1,r=-1,s=0,i=!1,l=0;for(let u=0;u<e.length;u++){let a=e.charCodeAt(u);if(i){if(a===92){u++;continue}if(a===l)i=!1;continue}if(a===47&&u+1<e.length){let h=e.charCodeAt(u+1);if(h===42){u+=2;while(u+1<e.length&&!(e.charCodeAt(u)===42&&e.charCodeAt(u+1)===47))u++;u++;continue}if(h===47){while(u<e.length&&e.charCodeAt(u)!==10)u++;continue}}if(a===39||a===34||a===96){i=!0,l=a;continue}if(a===40||a===60||a===91||a===123)s++;else if(a===41||a===93||a===125||a===62&&e.charCodeAt(u-1)!==61)s--;else if(s===0){if(a===58&&c===-1)c=u;else if(a===61&&r===-1&&(u===0||e.charCodeAt(u-1)!==61)&&(u+1>=e.length||e.charCodeAt(u+1)!==61&&e.charCodeAt(u+1)!==62))r=u}}let f=r!==-1;if(c!==-1&&(r===-1||c<r)){let u=e.slice(0,c).trim(),a=r!==-1?e.slice(c+1,r).trim():e.slice(c+1).trim(),h=f&&!u.endsWith("?")?"?":"";return`${u}${h}: ${a}`}else if(r!==-1){let u=e.slice(0,r).trim(),a=!u.endsWith("?")?"?":"",h=e.slice(r+1).trim(),p="unknown";if(h==="true"||h==="false")p="boolean";else if(/^-?\d+(\.\d+)?$/.test(h))p="number";else if(h.startsWith("'")&&h.endsWith("'")||h.startsWith('"')&&h.endsWith('"'))p="string";else if(h.startsWith("["))p="unknown[]";else if(h.startsWith("{"))p="Record<string, unknown>";return`${u}${a}: ${p}`}return e}function Vt(e){let c=0,r=e.length;while(c<r){while(c<r&&(e.charCodeAt(c)===32||e.charCodeAt(c)===9||e.charCodeAt(c)===10||e.charCodeAt(c)===13))c++;if(c+1<r&&e.charCodeAt(c)===47&&e.charCodeAt(c+1)===42){c+=2;while(c+1<r&&!(e.charCodeAt(c)===42&&e.charCodeAt(c+1)===47))c++;c+=2;continue}break}return c}function nt(e){let c=[],r=0,s=e.length;while(r<s){while(r<s&&e.charCodeAt(r)<=32)r++;if(r+1>=s||e.charCodeAt(r)!==47||e.charCodeAt(r+1)!==42)break;let i=r;r+=2;while(r+1<s&&!(e.charCodeAt(r)===42&&e.charCodeAt(r+1)===47))r++;r=Math.min(r+2,s),c.push(e.slice(i,r).trim())}return{comments:c.join(`
21
- `),key:e.slice(r).trim()}}function Gt(e){let c=[],r="",s="",i=0,l=!1,f="",u=!0,a=!1,h=0,p=!1,y=!1,A=0,m=!1,g=!1;for(let C=0;C<e.length;C++){let d=e.charCodeAt(C),w=C>0?e.charCodeAt(C-1):0,b=C<e.length-1?e.charCodeAt(C+1):0;if(!l&&!a&&d===47&&b===47){r=r.replace(/[ \t]+$/,""),C+=2;while(C<e.length&&e.charCodeAt(C)!==10)C++;C--;continue}if(!l&&!a&&d===47&&b===42){a=!0,h=1,r+="/*",C++;continue}else if(a&&d===42&&b===47){if(h--,r+="*/",C++,h===0)a=!1;continue}else if(a&&d===47&&b===42){h++,r+="/*",C++;continue}let x=e[C];if(!l&&!a&&(d===34||d===39||d===96))l=!0,f=x,r+=x;else if(l&&x===f&&w!==92)l=!1,r+=x;else if(!l&&!a)if(d===40&&i===0&&u&&A===0){s=r.trim();let T=Vt(s),k=T>0?s.slice(0,T):"",S=s.slice(T),E="";if(S.startsWith("async ")||S.startsWith("async\t")||S.startsWith(`async
22
- `))S=S.slice(6).trimStart(),E="async ";if(S.startsWith("*"))S=S.slice(1).trimStart(),E+="*";s=k+S,r=E+x,u=!1,m=!0,g=!1,i=1}else if(d===123||d===91||d===40){if(i++,r+=x,g&&d===123)g=!1}else if(d===125||d===93||d===41){if(i--,r+=x,d===41&&i===0&&!u&&!m)p=!0;if(m){if(d===41&&i===0&&!g)g=!0;else if(d===125&&i===0)m=!1,g=!1}}else if(d===58&&i===0&&u&&A===0)s=r.trim(),r="",u=!1;else if(d===58&&i===0&&p)y=!0,r+=x;else if(d===60&&y)A++,r+=x;else if(d===60&&u&&i===0)A++,r+=x;else if(d===62&&A>0&&w!==61)A--,r+=x;else if(d===61&&b===62&&y&&A===0)y=!1,p=!1,r+=x;else if(d===44&&i===0&&A===0&&!g){if(s&&r.trim()){let T=r.trim();c.push([s,T])}else if(u&&r.trim())ht(c,r.trim());r="",s="",u=!0,p=!1,y=!1,A=0}else r+=x;else r+=x}if(s&&r.trim()){let C=r.trim();c.push([s,C])}else if(u&&r.trim())ht(c,r.trim());return c}function ht(e,c){let{comments:r,key:s}=nt(c);if(J(s))e.push([r?`${r}
23
- ${s}`:s,s]);else if(s.startsWith("...")&&s.length>3)e.push(["...",s.slice(3).trim()])}function dt(e){let c=e.trim();if(c.startsWith("get ")&&c.length>4){let r=c.slice(4).trim();if(r)return{kind:"get",name:r}}if(c.startsWith("set ")&&c.length>4){let r=c.slice(4).trim();if(r)return{kind:"set",name:r}}return null}function Jt(e,c,r){let s=r.trim();if(s.charCodeAt(0)!==40)return null;let i=o(s,0,"(",")");if(i===-1)return null;let l=s.slice(1,i).trim(),f=s.slice(i+1).trimStart();if(!f.startsWith("=>"))return null;let u=f.slice(2).trim();if(e==="get")return`get ${c}(): ${u||"unknown"}`;return`set ${c}(${l})`}function zt(e,c){let r=c.trim(),s=o(r,0,"(",")");if(!r.startsWith("(")||s===-1)return"unknown";if(e==="get"){let u=r.slice(s+1).trim();return u.startsWith("=>")?u.slice(2).trim():"unknown"}let i=r.slice(1,s).trim(),l=i.startsWith("{")?o(i,0,"{","}"):i.startsWith("[")?o(i,0,"[","]"):0,f=i.indexOf(":",Math.max(0,l));return f===-1?"unknown":i.slice(f+1).trim()}function Xt(e){let c=e;if(c.startsWith("async ")||c.startsWith("async\t"))c=c.slice(5).trimStart();if(c.startsWith("*"))c=c.slice(1).trimStart();if(!c.startsWith("("))return!1;let r=0;for(let s=0;s<c.length;s++){let i=c.charCodeAt(s);if(i===40)r++;else if(i===41){if(r--,r===0){let l=c.slice(s+1).trimStart();if(l.startsWith("{"))return!0;if(l.startsWith(":")){let f=ot(l,1);if(f?.kind==="arrow")return!1;if(f?.kind==="body")return!0}return!1}}}return!1}function Ht(e){let c=e.trimEnd();if(!c.endsWith(">"))return null;let r=0,s=-1;for(let l=c.length-1;l>=0;l--){let f=c.charCodeAt(l);if(f===62){if(l>0&&c.charCodeAt(l-1)===61)continue;r++}else if(f===60){if(r--,r===0){s=l;break}}}if(s===-1)return null;let i=c.slice(0,s).trimEnd();if(!i)return null;return{name:i,typeParams:c.slice(s)}}function gt(e,c){let r=c.trimStart(),s=!1,i=!1;if(r.startsWith("async ")||r.startsWith("async\t"))s=!0,r=r.slice(5).trimStart();if(r.startsWith("*"))i=!0,r=r.slice(1).trimStart();let l="";if(r.charCodeAt(0)===60){let A=0,m=-1;for(let g=0;g<r.length;g++)if(r.charCodeAt(g)===60)A++;else if(r.charCodeAt(g)===62&&!(g>0&&r.charCodeAt(g-1)===61)){if(A--,A===0){m=g;break}}if(m!==-1)l=r.slice(0,m+1),r=r.slice(m+1).trimStart()}let f=r.indexOf("("),u=o(r,f,"(",")");if(f===-1||u===-1)return"() => unknown";let a=r.slice(f,u+1),h="unknown",p=r.slice(u+1).trimStart();if(p.charCodeAt(0)===58){let A=p.slice(1),m=ot(A,0);if(m)h=A.slice(0,m.index).trim();else h=A.trim()}if(h==="unknown"&&!i&&p.charCodeAt(0)===123){let A=o(p,0,"{","}");if(A!==-1){let m=O(p.slice(1,A),s,a);if(m!=="unknown"&&m!=="Promise<unknown>")h=s&&m.startsWith("Promise<")?m.slice(8,-1):m;else if(s)h="Promise<unknown>"}}if(h==="unknown"){if(s&&i)h="AsyncGenerator<unknown, void, unknown>";else if(i)h="Generator<unknown, void, unknown>";else if(s)h="Promise<void>"}else if(s&&!h.startsWith("Promise<")&&!h.startsWith("AsyncGenerator<"))h=`Promise<${h}>`;let y=ie(a);return`${l}${y} => ${h}`}function ot(e,c){let r=0,s=0,i=0,l=0,f=!1,u=0;for(let a=c;a<e.length;a++){let h=e.charCodeAt(a);if(f){if(h===92)a++;else if(h===u)f=!1;continue}if(h===34||h===39||h===96){f=!0,u=h;continue}if(h===40)r++;else if(h===41&&r>0)r--;else if(h===91)s++;else if(h===93&&s>0)s--;else if(h===60)i++;else if(h===62&&i>0&&e.charCodeAt(a-1)!==61)i--;else if(h===125&&l>0)l--;else if(h===123){let p=r>0||s>0||i>0||l>0,y=e.slice(c,a).trimEnd(),A=y.charCodeAt(y.length-1),m=y.length===0||A===38||A===124||A===40||A===44||A===58||A===61||A===91;if(p||m)l++;else return{index:a,kind:"body"}}else if(h===61&&a+1<e.length&&e.charCodeAt(a+1)===62&&r===0&&s===0&&i===0&&l===0)return{index:a,kind:"arrow"}}return null}function o(e,c,r,s){let i=0;for(let l=c;l<e.length;l++)if(e[l]===r)i++;else if(e[l]===s){if(s===">"&&l>0&&e[l-1]==="=")continue;if(i--,i===0)return l}return-1}function q(e){let c=0,r=0,s=!1,i="";for(let l=0;l<e.length-1;l++){let f=e[l],u=e[l+1],a=l>0?e[l-1]:"";if(!s&&(f==='"'||f==="'"||f==="`"))s=!0,i=f;else if(s&&f===i&&a!=="\\")s=!1;if(!s){if(f==="<"){let h=o(e,l,"<",">");if(h!==-1){l=h;continue}}if(f==="(")c++;else if(f===")")c--;else if(f==="[")r++;else if(f==="]")r--;if(f==="="&&u===">"&&c===0&&r===0)return l}}return-1}function Qe(e,c=!1,r=0,s=!0){let i=e.trim();if(i.length>200&&Z(i,"=>")>2&&Z(i,"<")>5&&!i.startsWith("function"))return c?"((...args: any[]) => any)":"(...args: any[]) => any";if(i.startsWith("async ")&&i.includes("=>")){let f=i.slice(5).trim(),u=q(f);if(u===-1)return c?"(() => Promise<unknown>)":"() => Promise<unknown>";let a=f.substring(0,u).trim(),h=f.substring(u+2).trim(),p=rt(a),{params:y,returnType:A}=p;if(y=ie(y),y==="()"||y==="")y="()";else if(!y.startsWith("("))y=`(${y})`;let m=A;if(m);else if(h.startsWith("{"))m=O(h.slice(1,h.endsWith("}")?-1:void 0),!0,p.params);else m=K(h,v(p.params));let g=`${y} => ${A||m.startsWith("Promise<")?m:`Promise<${m}>`}`;return c?`(${g})`:g}if(i.includes("=>")){let f="",u=i;if(i.startsWith("<")){let d=o(i,0,"<",">");if(d!==-1)f=i.substring(0,d+1),u=i.substring(d+1).trim()}let a=q(u);if(a===-1)return c?"(() => unknown)":"() => unknown";let h=u.substring(0,a).trim(),p=u.substring(a+2).trim(),y=rt(h),{params:A,returnType:m}=y;if(A=ie(A),A==="()"||A==="")A="()";else if(!A.startsWith("("))A=`(${A})`;let g="unknown";if(m)g=m;else if(p.startsWith("{"))g=O(p.slice(1,p.endsWith("}")?-1:void 0),!1,y.params);else if(z(p)||st(p)&&z(p.slice(1,-1).trim()))g="JSX.Element";else if(p.includes("=>")){let d=p.trimStart(),w=d.indexOf("("),b=w!==-1?o(d,w,"(",")"):-1,x=b!==-1?d.indexOf("=>",b):-1;if(w===0&&b!==-1&&x!==-1){let T=d.substring(w+1,b).trim(),k=ie(T);if(f.includes("T")&&k.includes("T"))g=`(${k}) => T`;else g=`(${k}) => any`}else g="any"}else g=K(p,v(y.params));let C=`${f}${A} => ${g}`;return c?`(${C})`:C}if(i.startsWith("function")){let f=8,u=i.length;while(f<u&&i.charCodeAt(f)<=32)f++;let a=!1;if(f<u&&i.charCodeAt(f)===42){a=!0,f++;while(f<u&&i.charCodeAt(f)<=32)f++}let h="";if(f<u&&i.charCodeAt(f)===60){let A=f,m=1;f++;while(f<u&&m>0){let g=i.charCodeAt(f);if(g===60)m++;else if(g===62&&i.charCodeAt(f-1)!==61)m--;f++}h=i.substring(A,f);while(f<u&&i.charCodeAt(f)<=32)f++}let p=i.indexOf("(",f);if(p!==-1){let A=1,m=p+1;while(m<u&&A>0){let x=i.charCodeAt(m);if(x===40)A++;else if(x===41)A--;m++}let g=i.substring(p+1,m-1).trim(),C=g?ie(`(${g})`):"()";if(a){let x=i.substring(m).trim(),T=x.indexOf("Generator<");if(T!==-1){let S=T+10,E=x.indexOf(">",S);if(E!==-1){let L=x.substring(S,E),P=`${h}${C} => Generator<${L}>`;return c?`(${P})`:P}}let k=`${h}${C} => Generator<any, any, any>`;return c?`(${k})`:k}let d="unknown",w=i.substring(m).trimStart();if(w.charCodeAt(0)===58){let x=w.slice(1),T=ot(x,0),k=(T?x.slice(0,T.index):x).trim();if(k)d=k}let b=`${h}${C} => ${d}`;return c?`(${b})`:b}let y="(...args: any[]) => unknown";return c?`(${y})`:y}if(i.includes("=>")&&i.includes("(")&&i.includes(")")){if(i.length>100||Z(i,"=>")>2){let f="";if(i.charCodeAt(0)===60){let y=o(i,0,"<",">");if(y!==-1)f=i.substring(0,y+1)}let u=i.indexOf("("),a=u!==-1?o(i,u,"(",")"):-1,h=u!==-1&&a!==-1?i.substring(u,a+1):"(...args: any[])";h=ie(h);let p=`${f}${h} => any`;return c?`(${p})`:p}return c?`(${i})`:i}let l="() => unknown";return c?`(${l})`:l}function rt(e){let c=e.trim();if(!c.startsWith("("))return{params:c,returnType:""};let r=o(c,0,"(",")");if(r===-1)return{params:c,returnType:""};let s=c.slice(r+1).trim();return{params:c.slice(0,r+1),returnType:s.startsWith(":")?s.slice(1).trim():""}}function ke(e){let c=e.trim();if(c==="any"||c==="object"||c==="unknown")return!0;if(c.startsWith("Record<")&&c.endsWith(">"))return!0;if(c.startsWith("Array<")&&c.endsWith(">"))return!0;if(/^\{\s*\[[^\]]*\]:\s*(any|string|number|unknown)\s*\}$/.test(c))return!0;return!1}function W(e){let c=-1,r=0;for(let i=0;i<e.length;i++){let l=e.charCodeAt(i);if(l===34||l===39||l===96){i=B(e,i,l)-1;continue}if(l===47&&e.charCodeAt(i+1)===47){while(i<e.length&&e.charCodeAt(i)!==10)i++;continue}if(l===47&&e.charCodeAt(i+1)===42){let f=e.indexOf("*/",i+2);i=f===-1?e.length:f+1;continue}if(l===47){let f=i-1;while(f>=0&&e.charCodeAt(f)<=32)f--;if(f<0||"([{:;,=!?&|+*-~>".includes(e[f])){let u=!1;for(i++;i<e.length;i++){let a=e.charCodeAt(i);if(a===92)i++;else if(a===91)u=!0;else if(a===93)u=!1;else if(a===47&&!u)break}continue}}if(l===40||l===91||l===123)r++;else if(l===41||l===93||l===125)r--;else if(r===0&&e.startsWith("satisfies",i)&&G(e,i,9)&&e[i-1]!==".")c=i}if(c===-1)return null;let s=e.slice(c+9).trim();if(s.endsWith(";"))s=s.slice(0,-1).trim();return s||null}function Ta(e){let c=e.trim(),r=c.match(/^\{\s*\[(\w+)\s+in\s+(.+?)\](\?)?\s*:\s*(.+)\s*\}$/);if(r){let[,l,f,u,a]=r;return`{ [${l} in ${f}]${u?"?":""}: ${a} }`}let s=c.match(/^\{\s*readonly\s+\[(\w+)\s+in\s+(.+?)\](\?)?\s*:\s*(.+)\s*\}$/);if(s){let[,l,f,u,a]=s;return`{ readonly [${l} in ${f}]${u?"?":""}: ${a} }`}let i=c.match(/^\{\s*(-?readonly\s+)?\[(\w+)\s+in\s+(.+?)\](-?\?)?\s*:\s*(.+)\s*\}$/);if(i){let[,l,f,u,a,h]=i;return`{ ${l?`${l.trim()} `:""}[${f} in ${u}]${a||""}: ${h} }`}return null}function Aa(e){let c=e.trim(),r=c.indexOf(" extends ");if(r===-1)return null;let s=c.slice(r+9),i=Qt(s);if(i===-1)return null;let l=Yt(s,i);if(l===-1)return null;let f=c.slice(0,r).trim(),u=s.slice(0,i).trim(),a=s.slice(i+1,l).trim(),h=s.slice(l+1).trim();return`${f} extends ${u} ? ${a} : ${h}`}function Qt(e){let c=0,r=!1,s="";for(let i=0;i<e.length;i++){let l=e[i],f=i>0?e[i-1]:"";if(!r&&(l==='"'||l==="'"||l==="`"))r=!0,s=l;else if(r&&l===s&&f!=="\\")r=!1;if(!r){if(l==="<"||l==="("||l==="["||l==="{")c++;if(l===">"||l===")"||l==="]"||l==="}")c--;if(l==="?"&&c===0)return i}}return-1}function Yt(e,c){let r=0,s=!1,i="";for(let l=c+1;l<e.length;l++){let f=e[l],u=l>0?e[l-1]:"";if(!s&&(f==='"'||f==="'"||f==="`"))s=!0,i=f;else if(s&&f===i&&u!=="\\")s=!1;if(!s){if(f==="<"||f==="("||f==="["||f==="{")r++;if(f===">"||f===")"||f==="]"||f==="}")r--;if(f==="?"&&r===0)r++;if(f===":"&&r===0)return l;if(f===":"&&r>0)r--}}return-1}function Pa(e){let c=e.trim();if(!c.startsWith("`")||!c.endsWith("`"))return null;let r=c.slice(1,-1);if(!r.includes("${"))return c;let s=[],i="",l=0;while(l<r.length)if(r[l]==="$"&&r[l+1]==="{"){if(i)s.push(`"${i}"`),i="";let f=1,u="";l+=2;while(l<r.length&&f>0){if(r[l]==="{")f++;if(r[l]==="}")f--;if(f>0)u+=r[l];l++}s.push(u.trim())}else i+=r[l],l++;if(i)s.push(`"${i}"`);return c}function Da(e){let c=[],r=/infer\s+(\w+)/g,s;while((s=r.exec(e))!==null)c.push(s[1]);return c}function Ra(e){let r=e.trim(),s=r.indexOf("[");if(s!==-1){if(r.indexOf(" in ",s)!==-1)return!0}let i=r.indexOf(" extends ");if(i!==-1){let f=r.indexOf(" ? ",i);if(f!==-1&&r.indexOf(" : ",f)!==-1)return!0}if(r.charCodeAt(0)===96&&r.charCodeAt(r.length-1)===96){if(r.indexOf("${")!==-1)return!0}let l=r.indexOf("infer ");if(l!==-1){if(l===0||!R(r.charCodeAt(l-1)))return!0}return!1}function Ma(e,c=3){let r=e.trim(),s=0,i=0;for(let l of r){if(l==="<"||l==="("||l==="["||l==="{")s++,i=Math.max(i,s);if(l===">"||l===")"||l==="]"||l==="}")s--}if(i>c){let l=r.match(/^(\w+)</);if(l)return`${l[1]}<any>`;return"unknown"}return r}function Oa(e){let r=e.trim().match(/^(\w+)<(.+)>$/);if(!r)return null;let s=r[1],i=r[2],l=ea(i);if(["Partial","Required","Readonly","Pick","Omit","Record","Exclude","Extract","NonNullable","ReturnType","Parameters","ConstructorParameters","InstanceType","ThisParameterType","OmitThisParameter","ThisType","Uppercase","Lowercase","Capitalize","Uncapitalize","Awaited","NoInfer"].includes(s))return{name:s,params:l};return null}function ea(e){let c=[],r="",s=0,i=!1,l="";for(let f=0;f<e.length;f++){let u=e[f],a=f>0?e[f-1]:"";if(!i&&(u==='"'||u==="'"||u==="`"))i=!0,l=u;else if(i&&u===l&&a!=="\\")i=!1;if(!i){if(u==="<"||u==="("||u==="["||u==="{")s++;if(u===">"||u===")"||u==="]"||u==="}")s--;if(u===","&&s===0){c.push(r.trim()),r="";continue}}r+=u}if(r.trim())c.push(r.trim());return c}function Ia(e){let c=e.trim();if(c.startsWith("keyof "))return c;return null}function Fa(e){let c=e.trim();if(c.startsWith("typeof "))return c;return null}function La(e){let c=e.trim();if(c.length===0||c.charCodeAt(0)===91)return!1;if(c.charCodeAt(c.length-1)!==93)return!1;let r=c.indexOf("[");if(r<=0)return!1;for(let s=0;s<r;s++){let i=c.charCodeAt(s);if(!R(i)&&i!==46)return!1}return!0}
24
- export{Pt,Dt,n,Rt,O,$e,re,Ze,Ee,ie,o,Qe,ke,W,Ta,Aa,Pa,Da,Ra,Ma,Oa,ea,Ia,Fa,La};
18
+ }`:"{}";if(h.length===0)return g;let C=h[0];for(let d=1;d<h.length;d++)C=`Omit<${C}, keyof ${h[d]}> & ${h[d]}`;return a.length>0?`Omit<${C}, keyof ${g}> & ${g}`:C}function J(e){if(!e)return!1;let c=e.charCodeAt(0);if(!(c>=65&&c<=90||c>=97&&c<=122||c===95||c===36||c>127))return!1;for(let r=1;r<e.length;r++)if(!R(e.charCodeAt(r)))return!1;return!0}function F(e){let c=e.split(".");return c.length>0&&c.every(J)}function Vt(e){let c=!1,r="";for(let s=0;s<e.length;s++){let i=e[s];if(c){if(i==="\\")s++;else if(i===r)c=!1;continue}if(i==='"'||i==="'"||i==="`"){c=!0,r=i;continue}if(i==="(")return s;if(i==="<"){let l=o(e,s,"<",">");if(l!==-1)s=l}}return-1}function Te(e){if(e.length<3||!e.endsWith(")"))return null;let c=Vt(e);if(c===-1||o(e,c,"(",")")!==e.length-1)return null;let r=e.slice(0,c).trim(),s=!1;if(r.endsWith("?."))s=!0,r=r.slice(0,-2).trim();let i=r,l=!1,f=r.indexOf("<");if(f!==-1){if(o(r,f,"<",">")!==r.length-1)return null;i=r.slice(0,f).trim(),l=!0}if(!F(i))return null;let u=e.slice(c+1,-1).trim(),a=q(u)!==-1||u.startsWith("function")||u.startsWith("async function"),h=F(u),p=!a&&u.endsWith(")")&&Te(u)!==null,y=i.indexOf(".");if(y!==-1){if(i.indexOf(".",y+1)!==-1)return null}else if(!l&&!s&&!a&&!h&&!p)return null;let A=`ReturnType<typeof ${r}>`;return s?`${A} | undefined`:A}function dt(e){let r=e.split(`
19
+ `).map((p)=>xt(p)).join(`
20
+ `),s=r.indexOf("async");if(s!==-1){let p=s>0?r.charCodeAt(s-1):32,y=s+5<r.length?r.charCodeAt(s+5):32;if(!R(p)&&!R(y))r=(r.slice(0,s)+r.slice(s+5)).trim()}let i=r.indexOf("(");if(i!==-1){let p=o(r,i,"(",")");if(p!==-1){let y=r.slice(i,p+1),A=ae(y);r=r.slice(0,i)+A+r.slice(p+1)}}let l=r.length,f="",u=[],a=!1,h=!1;for(let p=0;p<l;p++){let y=r.charCodeAt(p);if(y===123||y===40)u.push(y);else if(y===125||y===41)u.pop();if(y<=32){if(a=!0,y===10||y===13)h=!0;continue}if(a&&f.length>0){let m=(u.length>0?u[u.length-1]:0)===123;if(h&&m){let g=f.charCodeAt(f.length-1),C=g===59||g===44||g===123||y===125,d=f.length>=2&&f.charCodeAt(f.length-1)===47&&f.charCodeAt(f.length-2)===42;if(!C&&!d)f+="; ";else f+=" "}else f+=" "}a=!1,h=!1,f+=r[p]}return f.trim()}function R(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95||e===36}function ae(e){let c=e.trim(),r,s=!1;if(c.startsWith("(")&&c.endsWith(")"))r=c.slice(1,-1),s=!0;else r=c;let i=r.trim();if(!i)return s?"()":"";let l=!1;{let g=0;for(let C=0;C<i.length;C++){let d=i.charCodeAt(C);if(d===40||d===60||d===91||d===123)g++;else if(d===41||d===93||d===125||d===62&&i.charCodeAt(C-1)!==61)g--;else if(g===0&&d===61){let w=C>0?i.charCodeAt(C-1):0,x=C+1<i.length?i.charCodeAt(C+1):0;if(w!==61&&w!==33&&w!==60&&w!==62&&x!==61&&x!==62){l=!0;break}}}}if(!l)return c;let f=[],u=[],a=0,h=0,p=!1,y=0;for(let g=0;g<=i.length;g++){if(g===i.length){f.push(i.slice(a));break}let C=i.charCodeAt(g);if(p){if(C===92){g++;continue}if(C===y)p=!1;continue}if(C===47&&g+1<i.length){let d=i.charCodeAt(g+1);if(d===42){g+=2;while(g+1<i.length&&!(i.charCodeAt(g)===42&&i.charCodeAt(g+1)===47))g++;g++;continue}if(d===47){while(g<i.length&&i.charCodeAt(g)!==10)g++;continue}}if(C===39||C===34||C===96){p=!0,y=C;continue}if(C===40||C===60||C===91||C===123)h++;else if(C===41||C===93||C===125||C===62&&i.charCodeAt(g-1)!==61)h--;else if(C===44&&h===0){f.push(i.slice(a,g));let d=",",w=g+1;while(w<i.length&&i.charCodeAt(w)<=32)d+=i[w],w++;u.push(d),a=w}}let A=[];for(let g of f){let C=g.trim();if(!C){A.push(g);continue}if(C.startsWith("//"))continue;let d=xt(C),w=g.slice(0,g.length-g.trimStart().length);A.push(w+Gt(d))}let m=A[0]||"";for(let g=1;g<A.length;g++)m+=(u[g-1]||", ")+A[g];return De(s?`(${m})`:m)}function xt(e){let c=!1,r=0;for(let s=0;s<e.length-1;s++){let i=e.charCodeAt(s);if(c){if(i===92){s++;continue}if(i===r)c=!1;continue}if(i===39||i===34||i===96){c=!0,r=i;continue}if(i===47&&e.charCodeAt(s+1)===47)return e.slice(0,s).trimEnd()}return e}function Gt(e){if(e.startsWith("..."))return e;let c=-1,r=-1,s=0,i=!1,l=0;for(let u=0;u<e.length;u++){let a=e.charCodeAt(u);if(i){if(a===92){u++;continue}if(a===l)i=!1;continue}if(a===47&&u+1<e.length){let h=e.charCodeAt(u+1);if(h===42){u+=2;while(u+1<e.length&&!(e.charCodeAt(u)===42&&e.charCodeAt(u+1)===47))u++;u++;continue}if(h===47){while(u<e.length&&e.charCodeAt(u)!==10)u++;continue}}if(a===39||a===34||a===96){i=!0,l=a;continue}if(a===40||a===60||a===91||a===123)s++;else if(a===41||a===93||a===125||a===62&&e.charCodeAt(u-1)!==61)s--;else if(s===0){if(a===58&&c===-1)c=u;else if(a===61&&r===-1&&(u===0||e.charCodeAt(u-1)!==61)&&(u+1>=e.length||e.charCodeAt(u+1)!==61&&e.charCodeAt(u+1)!==62))r=u}}let f=r!==-1;if(c!==-1&&(r===-1||c<r)){let u=e.slice(0,c).trim(),a=r!==-1?e.slice(c+1,r).trim():e.slice(c+1).trim(),h=f&&!u.endsWith("?")?"?":"";return`${u}${h}: ${a}`}else if(r!==-1){let u=e.slice(0,r).trim(),a=!u.endsWith("?")?"?":"",h=e.slice(r+1).trim(),p="unknown";if(h==="true"||h==="false")p="boolean";else if(/^-?\d+(\.\d+)?$/.test(h))p="number";else if(h.startsWith("'")&&h.endsWith("'")||h.startsWith('"')&&h.endsWith('"'))p="string";else if(h.startsWith("["))p="unknown[]";else if(h.startsWith("{"))p="Record<string, unknown>";return`${u}${a}: ${p}`}return e}function Jt(e){let c=0,r=e.length;while(c<r){while(c<r&&(e.charCodeAt(c)===32||e.charCodeAt(c)===9||e.charCodeAt(c)===10||e.charCodeAt(c)===13))c++;if(c+1<r&&e.charCodeAt(c)===47&&e.charCodeAt(c+1)===42){c+=2;while(c+1<r&&!(e.charCodeAt(c)===42&&e.charCodeAt(c+1)===47))c++;c+=2;continue}break}return c}function it(e){let c=[],r=0,s=e.length;while(r<s){while(r<s&&e.charCodeAt(r)<=32)r++;if(r+1>=s||e.charCodeAt(r)!==47||e.charCodeAt(r+1)!==42)break;let i=r;r+=2;while(r+1<s&&!(e.charCodeAt(r)===42&&e.charCodeAt(r+1)===47))r++;r=Math.min(r+2,s),c.push(e.slice(i,r).trim())}return{comments:c.join(`
21
+ `),key:e.slice(r).trim()}}function zt(e){let c=[],r="",s="",i=0,l=!1,f="",u=!0,a=!1,h=0,p=!1,y=!1,A=0,m=!1,g=!1;for(let C=0;C<e.length;C++){let d=e.charCodeAt(C),w=C>0?e.charCodeAt(C-1):0,x=C<e.length-1?e.charCodeAt(C+1):0;if(!l&&!a&&d===47&&x===47){r=r.replace(/[ \t]+$/,""),C+=2;while(C<e.length&&e.charCodeAt(C)!==10)C++;C--;continue}if(!l&&!a&&d===47&&x===42){a=!0,h=1,r+="/*",C++;continue}else if(a&&d===42&&x===47){if(h--,r+="*/",C++,h===0)a=!1;continue}else if(a&&d===47&&x===42){h++,r+="/*",C++;continue}let W=e[C];if(!l&&!a&&(d===34||d===39||d===96))l=!0,f=W,r+=W;else if(l&&W===f&&w!==92)l=!1,r+=W;else if(!l&&!a)if(d===40&&i===0&&u&&A===0){s=r.trim();let b=Jt(s),T=b>0?s.slice(0,b):"",k=s.slice(b),O="";if(k.startsWith("async ")||k.startsWith("async\t")||k.startsWith(`async
22
+ `))k=k.slice(6).trimStart(),O="async ";if(k.startsWith("*"))k=k.slice(1).trimStart(),O+="*";s=T+k,r=O+W,u=!1,m=!0,g=!1,i=1}else if(d===123||d===91||d===40){if(i++,r+=W,g&&d===123)g=!1}else if(d===125||d===93||d===41){if(i--,r+=W,d===41&&i===0&&!u&&!m)p=!0;if(m){if(d===41&&i===0&&!g)g=!0;else if(d===125&&i===0)m=!1,g=!1}}else if(d===58&&i===0&&u&&A===0)s=r.trim(),r="",u=!1;else if(d===58&&i===0&&p)y=!0,r+=W;else if(d===60&&y)A++,r+=W;else if(d===60&&u&&i===0)A++,r+=W;else if(d===62&&A>0&&w!==61)A--,r+=W;else if(d===61&&x===62&&y&&A===0)y=!1,p=!1,r+=W;else if(d===44&&i===0&&A===0&&!g){if(s&&r.trim()){let b=r.trim();c.push([s,b])}else if(u&&r.trim())gt(c,r.trim());r="",s="",u=!0,p=!1,y=!1,A=0}else r+=W;else r+=W}if(s&&r.trim()){let C=r.trim();c.push([s,C])}else if(u&&r.trim())gt(c,r.trim());return c}function gt(e,c){let{comments:r,key:s}=it(c);if(J(s))e.push([r?`${r}
23
+ ${s}`:s,s]);else if(s.startsWith("...")&&s.length>3)e.push(["...",s.slice(3).trim()])}function mt(e){let c=e.trim();if(c.startsWith("get ")&&c.length>4){let r=c.slice(4).trim();if(r)return{kind:"get",name:r}}if(c.startsWith("set ")&&c.length>4){let r=c.slice(4).trim();if(r)return{kind:"set",name:r}}return null}function Xt(e,c,r){let s=r.trim();if(s.charCodeAt(0)!==40)return null;let i=o(s,0,"(",")");if(i===-1)return null;let l=s.slice(1,i).trim(),f=s.slice(i+1).trimStart();if(!f.startsWith("=>"))return null;let u=f.slice(2).trim();if(e==="get")return`get ${c}(): ${u||"unknown"}`;return`set ${c}(${l})`}function Ht(e,c){let r=c.trim(),s=o(r,0,"(",")");if(!r.startsWith("(")||s===-1)return"unknown";if(e==="get"){let u=r.slice(s+1).trim();return u.startsWith("=>")?u.slice(2).trim():"unknown"}let i=r.slice(1,s).trim(),l=i.startsWith("{")?o(i,0,"{","}"):i.startsWith("[")?o(i,0,"[","]"):0,f=i.indexOf(":",Math.max(0,l));return f===-1?"unknown":i.slice(f+1).trim()}function Qt(e){let c=e;if(c.startsWith("async ")||c.startsWith("async\t"))c=c.slice(5).trimStart();if(c.startsWith("*"))c=c.slice(1).trimStart();if(!c.startsWith("("))return!1;let r=0;for(let s=0;s<c.length;s++){let i=c.charCodeAt(s);if(i===40)r++;else if(i===41){if(r--,r===0){let l=c.slice(s+1).trimStart();if(l.startsWith("{"))return!0;if(l.startsWith(":")){let f=lt(l,1);if(f?.kind==="arrow")return!1;if(f?.kind==="body")return!0}return!1}}}return!1}function Yt(e){let c=e.trimEnd();if(!c.endsWith(">"))return null;let r=0,s=-1;for(let l=c.length-1;l>=0;l--){let f=c.charCodeAt(l);if(f===62){if(l>0&&c.charCodeAt(l-1)===61)continue;r++}else if(f===60){if(r--,r===0){s=l;break}}}if(s===-1)return null;let i=c.slice(0,s).trimEnd();if(!i)return null;return{name:i,typeParams:c.slice(s)}}function pt(e,c){let r=c.trimStart(),s=!1,i=!1;if(r.startsWith("async ")||r.startsWith("async\t"))s=!0,r=r.slice(5).trimStart();if(r.startsWith("*"))i=!0,r=r.slice(1).trimStart();let l="";if(r.charCodeAt(0)===60){let A=0,m=-1;for(let g=0;g<r.length;g++)if(r.charCodeAt(g)===60)A++;else if(r.charCodeAt(g)===62&&!(g>0&&r.charCodeAt(g-1)===61)){if(A--,A===0){m=g;break}}if(m!==-1)l=r.slice(0,m+1),r=r.slice(m+1).trimStart()}let f=r.indexOf("("),u=o(r,f,"(",")");if(f===-1||u===-1)return"() => unknown";let a=r.slice(f,u+1),h="unknown",p=r.slice(u+1).trimStart();if(p.charCodeAt(0)===58){let A=p.slice(1),m=lt(A,0);if(m)h=A.slice(0,m.index).trim();else h=A.trim()}if(h==="unknown"&&!i&&p.charCodeAt(0)===123){let A=o(p,0,"{","}");if(A!==-1){let m=I(p.slice(1,A),s,a);if(m!=="unknown"&&m!=="Promise<unknown>")h=s&&m.startsWith("Promise<")?m.slice(8,-1):m;else if(s)h="Promise<unknown>"}}if(h==="unknown"){if(s&&i)h="AsyncGenerator<unknown, void, unknown>";else if(i)h="Generator<unknown, void, unknown>";else if(s)h="Promise<void>"}else if(s&&!h.startsWith("Promise<")&&!h.startsWith("AsyncGenerator<"))h=`Promise<${h}>`;let y=ae(a);return`${l}${y} => ${h}`}function lt(e,c){let r=0,s=0,i=0,l=0,f=!1,u=0;for(let a=c;a<e.length;a++){let h=e.charCodeAt(a);if(f){if(h===92)a++;else if(h===u)f=!1;continue}if(h===34||h===39||h===96){f=!0,u=h;continue}if(h===40)r++;else if(h===41&&r>0)r--;else if(h===91)s++;else if(h===93&&s>0)s--;else if(h===60)i++;else if(h===62&&i>0&&e.charCodeAt(a-1)!==61)i--;else if(h===125&&l>0)l--;else if(h===123){let p=r>0||s>0||i>0||l>0,y=e.slice(c,a).trimEnd(),A=y.charCodeAt(y.length-1),m=y.length===0||A===38||A===124||A===40||A===44||A===58||A===61||A===91;if(p||m)l++;else return{index:a,kind:"body"}}else if(h===61&&a+1<e.length&&e.charCodeAt(a+1)===62&&r===0&&s===0&&i===0&&l===0)return{index:a,kind:"arrow"}}return null}function o(e,c,r,s){let i=0;for(let l=c;l<e.length;l++)if(e[l]===r)i++;else if(e[l]===s){if(s===">"&&l>0&&e[l-1]==="=")continue;if(i--,i===0)return l}return-1}function q(e){let c=0,r=0,s=!1,i="";for(let l=0;l<e.length-1;l++){let f=e[l],u=e[l+1],a=l>0?e[l-1]:"";if(!s&&(f==='"'||f==="'"||f==="`"))s=!0,i=f;else if(s&&f===i&&a!=="\\")s=!1;if(!s){if(f==="<"){let h=o(e,l,"<",">");if(h!==-1){l=h;continue}}if(f==="(")c++;else if(f===")")c--;else if(f==="[")r++;else if(f==="]")r--;if(f==="="&&u===">"&&c===0&&r===0)return l}}return-1}function tt(e,c=!1,r=0,s=!0){let i=e.trim();if(i.length>200&&Z(i,"=>")>2&&Z(i,"<")>5&&!i.startsWith("function"))return c?"((...args: any[]) => any)":"(...args: any[]) => any";if(i.startsWith("async ")&&i.includes("=>")){let f=i.slice(5).trim(),u=q(f);if(u===-1)return c?"(() => Promise<unknown>)":"() => Promise<unknown>";let a=f.substring(0,u).trim(),h=f.substring(u+2).trim(),p=st(a),{params:y,returnType:A}=p;if(y=ae(y),y==="()"||y==="")y="()";else if(!y.startsWith("("))y=`(${y})`;let m=A;if(m);else if(h.startsWith("{"))m=I(h.slice(1,h.endsWith("}")?-1:void 0),!0,p.params);else m=K(h,v(p.params));let g=`${y} => ${A||m.startsWith("Promise<")?m:`Promise<${m}>`}`;return c?`(${g})`:g}if(i.includes("=>")){let f="",u=i;if(i.startsWith("<")){let d=o(i,0,"<",">");if(d!==-1)f=i.substring(0,d+1),u=i.substring(d+1).trim()}let a=q(u);if(a===-1)return c?"(() => unknown)":"() => unknown";let h=u.substring(0,a).trim(),p=u.substring(a+2).trim(),y=st(h),{params:A,returnType:m}=y;if(A=ae(A),A==="()"||A==="")A="()";else if(!A.startsWith("("))A=`(${A})`;let g="unknown";if(m)g=m;else if(p.startsWith("{"))g=I(p.slice(1,p.endsWith("}")?-1:void 0),!1,y.params);else if(z(p)||ct(p)&&z(p.slice(1,-1).trim()))g="JSX.Element";else if(p.includes("=>")){let d=p.trimStart(),w=d.indexOf("("),x=w!==-1?o(d,w,"(",")"):-1,W=x!==-1?d.indexOf("=>",x):-1;if(w===0&&x!==-1&&W!==-1){let b=d.substring(w+1,x).trim(),T=ae(b);if(f.includes("T")&&T.includes("T"))g=`(${T}) => T`;else g=`(${T}) => any`}else g="any"}else g=K(p,v(y.params));let C=`${f}${A} => ${g}`;return c?`(${C})`:C}if(i.startsWith("function")){let f=8,u=i.length;while(f<u&&i.charCodeAt(f)<=32)f++;let a=!1;if(f<u&&i.charCodeAt(f)===42){a=!0,f++;while(f<u&&i.charCodeAt(f)<=32)f++}let h="";if(f<u&&i.charCodeAt(f)===60){let A=f,m=1;f++;while(f<u&&m>0){let g=i.charCodeAt(f);if(g===60)m++;else if(g===62&&i.charCodeAt(f-1)!==61)m--;f++}h=i.substring(A,f);while(f<u&&i.charCodeAt(f)<=32)f++}let p=i.indexOf("(",f);if(p!==-1){let A=1,m=p+1;while(m<u&&A>0){let W=i.charCodeAt(m);if(W===40)A++;else if(W===41)A--;m++}let g=i.substring(p+1,m-1).trim(),C=g?ae(`(${g})`):"()";if(a){let W=i.substring(m).trim(),b=W.indexOf("Generator<");if(b!==-1){let k=b+10,O=W.indexOf(">",k);if(O!==-1){let L=W.substring(k,O),S=`${h}${C} => Generator<${L}>`;return c?`(${S})`:S}}let T=`${h}${C} => Generator<any, any, any>`;return c?`(${T})`:T}let d="unknown",w=i.substring(m).trimStart();if(w.charCodeAt(0)===58){let W=w.slice(1),b=lt(W,0),T=(b?W.slice(0,b.index):W).trim();if(T)d=T}let x=`${h}${C} => ${d}`;return c?`(${x})`:x}let y="(...args: any[]) => unknown";return c?`(${y})`:y}if(i.includes("=>")&&i.includes("(")&&i.includes(")")){if(i.length>100||Z(i,"=>")>2){let f="";if(i.charCodeAt(0)===60){let y=o(i,0,"<",">");if(y!==-1)f=i.substring(0,y+1)}let u=i.indexOf("("),a=u!==-1?o(i,u,"(",")"):-1,h=u!==-1&&a!==-1?i.substring(u,a+1):"(...args: any[])";h=ae(h);let p=`${f}${h} => any`;return c?`(${p})`:p}return c?`(${i})`:i}let l="() => unknown";return c?`(${l})`:l}function st(e){let c=e.trim();if(!c.startsWith("("))return{params:c,returnType:""};let r=o(c,0,"(",")");if(r===-1)return{params:c,returnType:""};let s=c.slice(r+1).trim();return{params:c.slice(0,r+1),returnType:s.startsWith(":")?s.slice(1).trim():""}}function Ae(e){let c=e.trim();if(c==="any"||c==="object"||c==="unknown")return!0;if(c.startsWith("Record<")&&c.endsWith(">"))return!0;if(c.startsWith("Array<")&&c.endsWith(">"))return!0;if(/^\{\s*\[[^\]]*\]:\s*(any|string|number|unknown)\s*\}$/.test(c))return!0;return!1}function j(e){let c=-1,r=0;for(let i=0;i<e.length;i++){let l=e.charCodeAt(i);if(l===34||l===39||l===96){i=B(e,i,l)-1;continue}if(l===47&&e.charCodeAt(i+1)===47){while(i<e.length&&e.charCodeAt(i)!==10)i++;continue}if(l===47&&e.charCodeAt(i+1)===42){let f=e.indexOf("*/",i+2);i=f===-1?e.length:f+1;continue}if(l===47){let f=i-1;while(f>=0&&e.charCodeAt(f)<=32)f--;if(f<0||"([{:;,=!?&|+*-~>".includes(e[f])){let u=!1;for(i++;i<e.length;i++){let a=e.charCodeAt(i);if(a===92)i++;else if(a===91)u=!0;else if(a===93)u=!1;else if(a===47&&!u)break}continue}}if(l===40||l===91||l===123)r++;else if(l===41||l===93||l===125)r--;else if(r===0&&e.startsWith("satisfies",i)&&G(e,i,9)&&e[i-1]!==".")c=i}if(c===-1)return null;let s=e.slice(c+9).trim();if(s.endsWith(";"))s=s.slice(0,-1).trim();return s||null}function Ta(e){let c=e.trim(),r=c.match(/^\{\s*\[(\w+)\s+in\s+(.+?)\](\?)?\s*:\s*(.+)\s*\}$/);if(r){let[,l,f,u,a]=r;return`{ [${l} in ${f}]${u?"?":""}: ${a} }`}let s=c.match(/^\{\s*readonly\s+\[(\w+)\s+in\s+(.+?)\](\?)?\s*:\s*(.+)\s*\}$/);if(s){let[,l,f,u,a]=s;return`{ readonly [${l} in ${f}]${u?"?":""}: ${a} }`}let i=c.match(/^\{\s*(-?readonly\s+)?\[(\w+)\s+in\s+(.+?)\](-?\?)?\s*:\s*(.+)\s*\}$/);if(i){let[,l,f,u,a,h]=i;return`{ ${l?`${l.trim()} `:""}[${f} in ${u}]${a||""}: ${h} }`}return null}function Aa(e){let c=e.trim(),r=c.indexOf(" extends ");if(r===-1)return null;let s=c.slice(r+9),i=Zt(s);if(i===-1)return null;let l=Ut(s,i);if(l===-1)return null;let f=c.slice(0,r).trim(),u=s.slice(0,i).trim(),a=s.slice(i+1,l).trim(),h=s.slice(l+1).trim();return`${f} extends ${u} ? ${a} : ${h}`}function Zt(e){let c=0,r=!1,s="";for(let i=0;i<e.length;i++){let l=e[i],f=i>0?e[i-1]:"";if(!r&&(l==='"'||l==="'"||l==="`"))r=!0,s=l;else if(r&&l===s&&f!=="\\")r=!1;if(!r){if(l==="<"||l==="("||l==="["||l==="{")c++;if(l===">"||l===")"||l==="]"||l==="}")c--;if(l==="?"&&c===0)return i}}return-1}function Ut(e,c){let r=0,s=!1,i="";for(let l=c+1;l<e.length;l++){let f=e[l],u=l>0?e[l-1]:"";if(!s&&(f==='"'||f==="'"||f==="`"))s=!0,i=f;else if(s&&f===i&&u!=="\\")s=!1;if(!s){if(f==="<"||f==="("||f==="["||f==="{")r++;if(f===">"||f===")"||f==="]"||f==="}")r--;if(f==="?"&&r===0)r++;if(f===":"&&r===0)return l;if(f===":"&&r>0)r--}}return-1}function Pa(e){let c=e.trim();if(!c.startsWith("`")||!c.endsWith("`"))return null;let r=c.slice(1,-1);if(!r.includes("${"))return c;let s=[],i="",l=0;while(l<r.length)if(r[l]==="$"&&r[l+1]==="{"){if(i)s.push(`"${i}"`),i="";let f=1,u="";l+=2;while(l<r.length&&f>0){if(r[l]==="{")f++;if(r[l]==="}")f--;if(f>0)u+=r[l];l++}s.push(u.trim())}else i+=r[l],l++;if(i)s.push(`"${i}"`);return c}function Da(e){let c=[],r=/infer\s+(\w+)/g,s;while((s=r.exec(e))!==null)c.push(s[1]);return c}function Ra(e){let r=e.trim(),s=r.indexOf("[");if(s!==-1){if(r.indexOf(" in ",s)!==-1)return!0}let i=r.indexOf(" extends ");if(i!==-1){let f=r.indexOf(" ? ",i);if(f!==-1&&r.indexOf(" : ",f)!==-1)return!0}if(r.charCodeAt(0)===96&&r.charCodeAt(r.length-1)===96){if(r.indexOf("${")!==-1)return!0}let l=r.indexOf("infer ");if(l!==-1){if(l===0||!R(r.charCodeAt(l-1)))return!0}return!1}function Ma(e,c=3){let r=e.trim(),s=0,i=0;for(let l of r){if(l==="<"||l==="("||l==="["||l==="{")s++,i=Math.max(i,s);if(l===">"||l===")"||l==="]"||l==="}")s--}if(i>c){let l=r.match(/^(\w+)</);if(l)return`${l[1]}<any>`;return"unknown"}return r}function Oa(e){let r=e.trim().match(/^(\w+)<(.+)>$/);if(!r)return null;let s=r[1],i=r[2],l=ca(i);if(["Partial","Required","Readonly","Pick","Omit","Record","Exclude","Extract","NonNullable","ReturnType","Parameters","ConstructorParameters","InstanceType","ThisParameterType","OmitThisParameter","ThisType","Uppercase","Lowercase","Capitalize","Uncapitalize","Awaited","NoInfer"].includes(s))return{name:s,params:l};return null}function ca(e){let c=[],r="",s=0,i=!1,l="";for(let f=0;f<e.length;f++){let u=e[f],a=f>0?e[f-1]:"";if(!i&&(u==='"'||u==="'"||u==="`"))i=!0,l=u;else if(i&&u===l&&a!=="\\")i=!1;if(!i){if(u==="<"||u==="("||u==="["||u==="{")s++;if(u===">"||u===")"||u==="]"||u==="}")s--;if(u===","&&s===0){c.push(r.trim()),r="";continue}}r+=u}if(r.trim())c.push(r.trim());return c}function Ia(e){let c=e.trim();if(c.startsWith("keyof "))return c;return null}function Fa(e){let c=e.trim();if(c.startsWith("typeof "))return c;return null}function La(e){let c=e.trim();if(c.length===0||c.charCodeAt(0)===91)return!1;if(c.charCodeAt(c.length-1)!==93)return!1;let r=c.indexOf("[");if(r<=0)return!1;for(let s=0;s<r;s++){let i=c.charCodeAt(s);if(!R(i)&&i!==46)return!1}return!0}
24
+ export{Rt,Mt,n,Ot,I,ke,oe,et,Te,ae,o,tt,Ae,j,Ta,Aa,Pa,Da,Ra,Ma,Oa,ca,Ia,Fa,La};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{r}from"./chunk-qnf4byak.js";import{l}from"./chunk-t1jtn2r0.js";import{existsSync as P,readFileSync as b,unwatchFile as w}from"fs";var Cr;((o)=>{o[o.Error=1]="Error";o[o.Warning=2]="Warning";o[o.Information=3]="Information";o[o.Hint=4]="Hint"})(Cr||={});var vr;((s)=>{s[s.File=1]="File";s[s.Module=2]="Module";s[s.Namespace=3]="Namespace";s[s.Package=4]="Package";s[s.Class=5]="Class";s[s.Method=6]="Method";s[s.Property=7]="Property";s[s.Field=8]="Field";s[s.Constructor=9]="Constructor";s[s.Enum=10]="Enum";s[s.Interface=11]="Interface";s[s.Function=12]="Function";s[s.Variable=13]="Variable";s[s.Constant=14]="Constant";s[s.String=15]="String";s[s.Number=16]="Number";s[s.Boolean=17]="Boolean";s[s.Array=18]="Array";s[s.Object=19]="Object";s[s.Key=20]="Key";s[s.Null=21]="Null";s[s.EnumMember=22]="EnumMember";s[s.Struct=23]="Struct";s[s.Event=24]="Event";s[s.Operator=25]="Operator";s[s.TypeParameter=26]="TypeParameter"})(vr||={});var Sr;((c)=>{c[c.Text=1]="Text";c[c.Method=2]="Method";c[c.Function=3]="Function";c[c.Constructor=4]="Constructor";c[c.Field=5]="Field";c[c.Variable=6]="Variable";c[c.Class=7]="Class";c[c.Interface=8]="Interface";c[c.Module=9]="Module";c[c.Property=10]="Property";c[c.Unit=11]="Unit";c[c.Value=12]="Value";c[c.Enum=13]="Enum";c[c.Keyword=14]="Keyword";c[c.Snippet=15]="Snippet";c[c.Color=16]="Color";c[c.File=17]="File";c[c.Reference=18]="Reference";c[c.Folder=19]="Folder";c[c.EnumMember=20]="EnumMember";c[c.Constant=21]="Constant";c[c.Struct=22]="Struct";c[c.Event=23]="Event";c[c.Operator=24]="Operator";c[c.TypeParameter=25]="TypeParameter"})(Sr||={});var $r;((n)=>{n[n.Text=1]="Text";n[n.Read=2]="Read";n[n.Write=3]="Write"})($r||={});class zt{documents=new Map;rootUri=null;config={};messageId=0;watchers=new Map;initialize(t){return this.rootUri=t.rootUri,{capabilities:{textDocumentSync:1,hoverProvider:!0,completionProvider:{triggerCharacters:[".",":","<",'"',"'","/"],resolveProvider:!0},definitionProvider:!0,referencesProvider:!0,renameProvider:{prepareProvider:!0},documentSymbolProvider:!0,workspaceSymbolProvider:!0,codeActionProvider:{codeActionKinds:["quickfix","refactor","source"]},signatureHelpProvider:{triggerCharacters:["(",","],retriggerCharacters:[","]},documentHighlightProvider:!0,documentFormattingProvider:!0,diagnosticProvider:{interFileDependencies:!0,workspaceDiagnostics:!0}}}}didOpen(t){let{uri:e,text:i,version:n}=t.textDocument;this.updateDocument(e,i,n)}didChange(t){let{uri:e,version:i}=t.textDocument,n=t.contentChanges[0]?.text||"";this.updateDocument(e,n,i)}didClose(t){let e=t.textDocument.uri;if(this.documents.delete(e),this.watchers.get(e))w(this.uriToPath(e)),this.watchers.delete(e)}updateDocument(t,e,i){let n=this.uriToPath(t),o=r(e,n,!0);this.documents.set(t,{content:e,version:i,declarations:o})}getDiagnostics(t){let e=this.documents.get(t);if(!e)return[];let i=[];for(let n of e.declarations){if(n.isExported&&n.kind==="variable"&&!n.typeAnnotation)i.push({range:this.getDeclarationRange(n,e.content),severity:2,code:"missing-type",source:"dtsx",message:`Exported variable '${n.name}' should have an explicit type annotation for better declaration generation`});if(n.typeAnnotation==="any"||n.returnType==="any")i.push({range:this.getDeclarationRange(n,e.content),severity:3,code:"any-type",source:"dtsx",message:"Consider using a more specific type instead of 'any'"});if(n.kind==="function"&&n.isExported&&!n.returnType)i.push({range:this.getDeclarationRange(n,e.content),severity:3,code:"missing-return-type",source:"dtsx",message:`Function '${n.name}' should have an explicit return type for better declaration generation`})}return i}hover(t){let e=this.documents.get(t.textDocument.uri);if(!e)return null;let{line:i,character:n}=t.position,a=e.content.split(`
2
+ import{r}from"./chunk-jcckwgb9.js";import{l}from"./chunk-y1g6v96c.js";import{existsSync as P,readFileSync as b,unwatchFile as w}from"fs";var Dr;((o)=>{o[o.Error=1]="Error";o[o.Warning=2]="Warning";o[o.Information=3]="Information";o[o.Hint=4]="Hint"})(Dr||={});var Rr;((s)=>{s[s.File=1]="File";s[s.Module=2]="Module";s[s.Namespace=3]="Namespace";s[s.Package=4]="Package";s[s.Class=5]="Class";s[s.Method=6]="Method";s[s.Property=7]="Property";s[s.Field=8]="Field";s[s.Constructor=9]="Constructor";s[s.Enum=10]="Enum";s[s.Interface=11]="Interface";s[s.Function=12]="Function";s[s.Variable=13]="Variable";s[s.Constant=14]="Constant";s[s.String=15]="String";s[s.Number=16]="Number";s[s.Boolean=17]="Boolean";s[s.Array=18]="Array";s[s.Object=19]="Object";s[s.Key=20]="Key";s[s.Null=21]="Null";s[s.EnumMember=22]="EnumMember";s[s.Struct=23]="Struct";s[s.Event=24]="Event";s[s.Operator=25]="Operator";s[s.TypeParameter=26]="TypeParameter"})(Rr||={});var Mr;((c)=>{c[c.Text=1]="Text";c[c.Method=2]="Method";c[c.Function=3]="Function";c[c.Constructor=4]="Constructor";c[c.Field=5]="Field";c[c.Variable=6]="Variable";c[c.Class=7]="Class";c[c.Interface=8]="Interface";c[c.Module=9]="Module";c[c.Property=10]="Property";c[c.Unit=11]="Unit";c[c.Value=12]="Value";c[c.Enum=13]="Enum";c[c.Keyword=14]="Keyword";c[c.Snippet=15]="Snippet";c[c.Color=16]="Color";c[c.File=17]="File";c[c.Reference=18]="Reference";c[c.Folder=19]="Folder";c[c.EnumMember=20]="EnumMember";c[c.Constant=21]="Constant";c[c.Struct=22]="Struct";c[c.Event=23]="Event";c[c.Operator=24]="Operator";c[c.TypeParameter=25]="TypeParameter"})(Mr||={});var Or;((n)=>{n[n.Text=1]="Text";n[n.Read=2]="Read";n[n.Write=3]="Write"})(Or||={});class Yt{documents=new Map;rootUri=null;config={};messageId=0;watchers=new Map;initialize(t){return this.rootUri=t.rootUri,{capabilities:{textDocumentSync:1,hoverProvider:!0,completionProvider:{triggerCharacters:[".",":","<",'"',"'","/"],resolveProvider:!0},definitionProvider:!0,referencesProvider:!0,renameProvider:{prepareProvider:!0},documentSymbolProvider:!0,workspaceSymbolProvider:!0,codeActionProvider:{codeActionKinds:["quickfix","refactor","source"]},signatureHelpProvider:{triggerCharacters:["(",","],retriggerCharacters:[","]},documentHighlightProvider:!0,documentFormattingProvider:!0,diagnosticProvider:{interFileDependencies:!0,workspaceDiagnostics:!0}}}}didOpen(t){let{uri:e,text:i,version:n}=t.textDocument;this.updateDocument(e,i,n)}didChange(t){let{uri:e,version:i}=t.textDocument,n=t.contentChanges[0]?.text||"";this.updateDocument(e,n,i)}didClose(t){let e=t.textDocument.uri;if(this.documents.delete(e),this.watchers.get(e))w(this.uriToPath(e)),this.watchers.delete(e)}updateDocument(t,e,i){let n=this.uriToPath(t),o=r(e,n,!0);this.documents.set(t,{content:e,version:i,declarations:o})}getDiagnostics(t){let e=this.documents.get(t);if(!e)return[];let i=[];for(let n of e.declarations){if(n.isExported&&n.kind==="variable"&&!n.typeAnnotation)i.push({range:this.getDeclarationRange(n,e.content),severity:2,code:"missing-type",source:"dtsx",message:`Exported variable '${n.name}' should have an explicit type annotation for better declaration generation`});if(n.typeAnnotation==="any"||n.returnType==="any")i.push({range:this.getDeclarationRange(n,e.content),severity:3,code:"any-type",source:"dtsx",message:"Consider using a more specific type instead of 'any'"});if(n.kind==="function"&&n.isExported&&!n.returnType)i.push({range:this.getDeclarationRange(n,e.content),severity:3,code:"missing-return-type",source:"dtsx",message:`Function '${n.name}' should have an explicit return type for better declaration generation`})}return i}hover(t){let e=this.documents.get(t.textDocument.uri);if(!e)return null;let{line:i,character:n}=t.position,a=e.content.split(`
3
3
  `)[i]||"",u=a.slice(0,n).match(/[\w$]+$/),d=a.slice(n).match(/^[\w$]+/);if(!u&&!d)return null;let g=(u?.[0]||"")+(d?.[0]||""),f=e.declarations.find((x)=>x.name===g);if(!f)return null;let m=`\`\`\`typescript
4
4
  ${this.buildSignature(f)}
5
5
  \`\`\``;if(f.leadingComments&&f.leadingComments.length>0){let v=f.leadingComments.join(`
@@ -14,9 +14,9 @@ ${v[1].trim()}`}return{contents:{kind:"markdown",value:m}}}completion(t){let e=t
14
14
  `)[e.line]||"",a=o.slice(0,e.character).match(/[\w$]+$/),u=o.slice(e.character).match(/^[\w$]+/);if(!a&&!u)return null;return(a?.[0]||"")+(u?.[0]||"")}getWordAtRange(t,e){let i=this.documents.get(t);if(!i)return null;let n=i.content.split(`
15
15
  `);if(e.start.line===e.end.line)return n[e.start.line]?.slice(e.start.character,e.end.character)||null;return null}getDeclarationAtPosition(t,e){let i=this.documents.get(t);if(!i)return null;for(let n of i.declarations){let o=this.getDeclarationRange(n,i.content);if(this.positionInRange(e,o))return n}return null}positionInRange(t,e){if(t.line<e.start.line||t.line>e.end.line)return!1;if(t.line===e.start.line&&t.character<e.start.character)return!1;if(t.line===e.end.line&&t.character>e.end.character)return!1;return!0}declarationKindToSymbolKind(t){switch(t){case"function":return 12;case"class":return 5;case"interface":return 11;case"type":return 11;case"enum":return 10;case"variable":return 13;case"const":return 14;case"property":return 7;case"method":return 6;case"module":return 2;case"namespace":return 3;default:return 13}}generateDts(t){let e=this.documents.get(t);if(!e)return null;let i={filePath:this.uriToPath(t),sourceCode:e.content,declarations:e.declarations};return l(e.declarations,i,!0,this.config.importOrder)}buildSignature(t){switch(t.kind){case"function":{let e=t.parameters?.map((o)=>{let a="";if(o.rest)a+="...";if(a+=o.name,o.optional)a+="?";if(o.type)a+=`: ${o.type}`;return a}).join(", ")||"",i=t.generics||"",n=t.returnType?`: ${t.returnType}`:"";return`function ${t.name}${i}(${e})${n}`}case"variable":return`const ${t.name}: ${t.typeAnnotation||"unknown"}`;case"interface":return`interface ${t.name}${t.generics||""}${t.extends?` extends ${t.extends}`:""}`;case"type":return`type ${t.name}${t.generics||""} = ${t.typeAnnotation||"unknown"}`;case"class":return`class ${t.name}${t.generics||""}${t.extends?` extends ${t.extends}`:""}`;case"enum":return`enum ${t.name}`;default:return t.name}}getDeclarationRange(t,e){if(t.start!==void 0&&t.end!==void 0)return{start:this.offsetToPosition(t.start,e),end:this.offsetToPosition(t.end,e)};let i=e.split(`
16
16
  `);for(let n=0;n<i.length;n++){let o=i[n].indexOf(t.name);if(o!==-1)return{start:{line:n,character:o},end:{line:n,character:o+t.name.length}}}return{start:{line:0,character:0},end:{line:0,character:0}}}offsetToPosition(t,e){let i=0,n=0;for(let o=0;o<t&&o<e.length;o++)if(e[o]===`
17
- `)i++,n=0;else n++;return{line:i,character:n}}uriToPath(t){if(t.startsWith("file://"))return decodeURIComponent(t.slice(7));return t}pathToUri(t){return`file://${encodeURIComponent(t).replace(/%2F/g,"/")}`}handleMessage(t){if(t.method==="initialize")return{jsonrpc:"2.0",id:t.id,result:this.initialize(t.params)};if(t.method==="initialized")return null;if(t.method==="shutdown")return{jsonrpc:"2.0",id:t.id,result:null};if(t.method==="exit")process.exit(0);let e=t.params;if(t.method==="textDocument/didOpen")return this.didOpen(e),null;if(t.method==="textDocument/didChange")return this.didChange(e),null;if(t.method==="textDocument/didClose")return this.didClose(e),null;if(t.method==="textDocument/hover")return{jsonrpc:"2.0",id:t.id,result:this.hover(e)};if(t.method==="textDocument/completion")return{jsonrpc:"2.0",id:t.id,result:this.completion(e)};if(t.method==="textDocument/definition")return{jsonrpc:"2.0",id:t.id,result:this.definition(e)};if(t.method==="textDocument/references")return{jsonrpc:"2.0",id:t.id,result:this.references(e)};if(t.method==="textDocument/prepareRename")return{jsonrpc:"2.0",id:t.id,result:this.prepareRename(e)};if(t.method==="textDocument/rename")return{jsonrpc:"2.0",id:t.id,result:this.rename(e)};if(t.method==="textDocument/documentSymbol")return{jsonrpc:"2.0",id:t.id,result:this.documentSymbols(e)};if(t.method==="workspace/symbol")return{jsonrpc:"2.0",id:t.id,result:this.workspaceSymbols(e)};if(t.method==="textDocument/codeAction")return{jsonrpc:"2.0",id:t.id,result:this.codeActions(e)};if(t.method==="textDocument/signatureHelp")return{jsonrpc:"2.0",id:t.id,result:this.signatureHelp(e)};if(t.method==="textDocument/documentHighlight")return{jsonrpc:"2.0",id:t.id,result:this.documentHighlight(e)};if(t.method==="textDocument/formatting")return{jsonrpc:"2.0",id:t.id,result:this.formatting(e)};if(t.method==="textDocument/diagnostic"){let i=e?.textDocument?.uri;return{jsonrpc:"2.0",id:t.id,result:{kind:"full",items:i?this.getDiagnostics(i):[]}}}if(t.id!==void 0)return{jsonrpc:"2.0",id:t.id,error:{code:-32601,message:`Method not found: ${t.method}`}};return null}}function rs(){let t=new zt,e="";process.stdin.setEncoding("utf8"),process.stdin.on("data",(i)=>{e+=i;while(!0){let n=e.indexOf(`\r
17
+ `)i++,n=0;else n++;return{line:i,character:n}}uriToPath(t){if(t.startsWith("file://"))return decodeURIComponent(t.slice(7));return t}pathToUri(t){return`file://${encodeURIComponent(t).replace(/%2F/g,"/")}`}handleMessage(t){if(t.method==="initialize")return{jsonrpc:"2.0",id:t.id,result:this.initialize(t.params)};if(t.method==="initialized")return null;if(t.method==="shutdown")return{jsonrpc:"2.0",id:t.id,result:null};if(t.method==="exit")process.exit(0);let e=t.params;if(t.method==="textDocument/didOpen")return this.didOpen(e),null;if(t.method==="textDocument/didChange")return this.didChange(e),null;if(t.method==="textDocument/didClose")return this.didClose(e),null;if(t.method==="textDocument/hover")return{jsonrpc:"2.0",id:t.id,result:this.hover(e)};if(t.method==="textDocument/completion")return{jsonrpc:"2.0",id:t.id,result:this.completion(e)};if(t.method==="textDocument/definition")return{jsonrpc:"2.0",id:t.id,result:this.definition(e)};if(t.method==="textDocument/references")return{jsonrpc:"2.0",id:t.id,result:this.references(e)};if(t.method==="textDocument/prepareRename")return{jsonrpc:"2.0",id:t.id,result:this.prepareRename(e)};if(t.method==="textDocument/rename")return{jsonrpc:"2.0",id:t.id,result:this.rename(e)};if(t.method==="textDocument/documentSymbol")return{jsonrpc:"2.0",id:t.id,result:this.documentSymbols(e)};if(t.method==="workspace/symbol")return{jsonrpc:"2.0",id:t.id,result:this.workspaceSymbols(e)};if(t.method==="textDocument/codeAction")return{jsonrpc:"2.0",id:t.id,result:this.codeActions(e)};if(t.method==="textDocument/signatureHelp")return{jsonrpc:"2.0",id:t.id,result:this.signatureHelp(e)};if(t.method==="textDocument/documentHighlight")return{jsonrpc:"2.0",id:t.id,result:this.documentHighlight(e)};if(t.method==="textDocument/formatting")return{jsonrpc:"2.0",id:t.id,result:this.formatting(e)};if(t.method==="textDocument/diagnostic"){let i=e?.textDocument?.uri;return{jsonrpc:"2.0",id:t.id,result:{kind:"full",items:i?this.getDiagnostics(i):[]}}}if(t.id!==void 0)return{jsonrpc:"2.0",id:t.id,error:{code:-32601,message:`Method not found: ${t.method}`}};return null}}function As(){let t=new Yt,e="";process.stdin.setEncoding("utf8"),process.stdin.on("data",(i)=>{e+=i;while(!0){let n=e.indexOf(`\r
18
18
  \r
19
19
  `);if(n===-1)break;let a=e.slice(0,n).match(/Content-Length:\s*(\d+)/i);if(!a){e=e.slice(n+4);continue}let u=Number.parseInt(a[1],10),d=n+4,g=d+u;if(e.length<g)break;let f=e.slice(d,g);e=e.slice(g);try{let p=JSON.parse(f),m=t.handleMessage(p);if(m){let x=JSON.stringify(m),v=Buffer.byteLength(x,"utf8");process.stdout.write(`Content-Length: ${v}\r
20
20
  \r
21
- ${x}`)}}catch(p){console.error("Error parsing LSP message:",p)}}})}function is(t,e){return(i)=>{if(!P(i))return;let n=b(i,"utf-8"),o=`file://${i}`;t.didOpen({textDocument:{uri:o,languageId:"typescript",version:1,text:n}});let a=t.getDiagnostics(o);e(o,a)}}
22
- export{Cr,vr,Sr,$r,zt,rs,is};
21
+ ${x}`)}}catch(p){console.error("Error parsing LSP message:",p)}}})}function Ps(t,e){return(i)=>{if(!P(i))return;let n=b(i,"utf-8"),o=`file://${i}`;t.didOpen({textDocument:{uri:o,languageId:"typescript",version:1,text:n}});let a=t.getDiagnostics(o);e(o,a)}}
22
+ export{Dr,Rr,Mr,Or,Yt,As,Ps};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{N}from"./chunk-v44crx69.js";import{T}from"./chunk-d43bpfk6.js";import{me,ge}from"./chunk-853ftm92.js";import{createHash as x}from"crypto";import{readFile as d}from"fs/promises";import{resolve as m}from"path";async function Xt(g){let e={...N,...g},n=e.moduleSpecifierMode??"preserve";if(n!=="node"&&n!=="preserve")throw Error("moduleSpecifierMode must be preserve or node");if(e.plugins?.length)throw Error("Native project planning does not support generation plugins");let o=await me(e),l=[];for(let r of o.files){let s=await d(r),a=s.toString("utf8");if(!Buffer.from(a,"utf8").equals(s))throw Error(`Native declaration source must be valid UTF-8: ${r}`);let u=o.outputBySource.get(r),v=ge(r,e,o.resolver),i=[],S=new Set(T(a,{includeImports:!0}).map((t)=>t.specifier));for(let t of S){let p=v(t);if(p.kind!=="local")continue;let{resolvedSource:h,declarationOutput:w,emittedSpecifier:y}=p;i.push({specifier:t,resolvedSource:h,declarationOutput:w,emittedSpecifier:y})}let c={version:1,moduleSpecifierMode:n,sourceFile:r,outputFile:u,sourceHash:x("sha256").update(s).digest("hex"),rewrites:i};if(!e.isolatedDeclarations&&i.length)c.inferenceSources=await Promise.all(i.map(async(t)=>({specifier:t.specifier,source:await d(t.resolvedSource,"utf8")})));let f=o.augmentationImports.get(r);if(f?.size)c.augmentationImports=[...f];l.push(Object.freeze({sourceFile:r,outputFile:u,source:a,context:c}))}return Object.freeze({version:1,rootPath:m(e.cwd,e.root),outdirPath:m(e.cwd,e.outdir),files:Object.freeze(l)})}
3
- export{Xt};
2
+ import{N}from"./chunk-ebjafajx.js";import{k}from"./chunk-p9vfxn8g.js";import{ye,be}from"./chunk-davy89dj.js";import{createHash as x}from"crypto";import{readFile as d}from"fs/promises";import{resolve as m}from"path";async function vn(g){let e={...N,...g},n=e.moduleSpecifierMode??"preserve";if(n!=="node"&&n!=="preserve")throw Error("moduleSpecifierMode must be preserve or node");if(e.plugins?.length)throw Error("Native project planning does not support generation plugins");let o=await ye(e),l=[];for(let r of o.files){let s=await d(r),a=s.toString("utf8");if(!Buffer.from(a,"utf8").equals(s))throw Error(`Native declaration source must be valid UTF-8: ${r}`);let u=o.outputBySource.get(r),v=be(r,e,o.resolver),i=[],S=new Set(k(a,{includeImports:!0}).map((t)=>t.specifier));for(let t of S){let p=v(t);if(p.kind!=="local")continue;let{resolvedSource:h,declarationOutput:w,emittedSpecifier:y}=p;i.push({specifier:t,resolvedSource:h,declarationOutput:w,emittedSpecifier:y})}let c={version:1,moduleSpecifierMode:n,sourceFile:r,outputFile:u,sourceHash:x("sha256").update(s).digest("hex"),rewrites:i};if(!e.isolatedDeclarations&&i.length)c.inferenceSources=await Promise.all(i.map(async(t)=>({specifier:t.specifier,source:await d(t.resolvedSource,"utf8")})));let f=o.augmentationImports.get(r);if(f?.size)c.augmentationImports=[...f];l.push(Object.freeze({sourceFile:r,outputFile:u,source:a,context:c}))}return Object.freeze({version:1,rootPath:m(e.cwd,e.root),outdirPath:m(e.cwd,e.outdir),files:Object.freeze(l)})}
3
+ export{vn};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{basename as e,dirname as n,isAbsolute as i,join as o,relative as a,resolve as s}from"path";function Os(t){if(!t||typeof t!=="string")throw Error("Invalid file path: must be a non-empty string");return t}function Is(t){if(!t||typeof t!=="string")throw Error("Invalid directory path: must be a non-empty string");return t}function Fs(t){if(!t||typeof t!=="string")throw Error("Invalid glob pattern: must be a non-empty string");return t}function Ls(t){if(typeof t!=="string")throw TypeError("Invalid source code: must be a string");return t}function Ns(t){if(typeof t!=="string")throw TypeError("Invalid DTS content: must be a string");return t}function Bs(t){if(!t||typeof t!=="string")throw Error("Invalid module specifier: must be a non-empty string");return t}function Ws(t){if(!t||typeof t!=="string")throw Error("Invalid type name: must be a non-empty string");if(!["string","number","boolean","symbol","bigint","undefined","null","void","never","any","unknown","object"].includes(t)&&!/^[A-Z_$]/.test(t));return t}function js(t){if(!t||typeof t!=="string")throw Error("Invalid declaration name: must be a non-empty string");return t}function _s(t){if(!t||typeof t!=="string")throw Error("Invalid absolute path: must be a non-empty string");if(!t.startsWith("/")&&!/^[A-Z]:/i.test(t))throw Error("Invalid absolute path: must start with / or drive letter");return t}function Gs(t){if(!t||typeof t!=="string")throw Error("Invalid relative path: must be a non-empty string");if(t.startsWith("/")||/^[A-Z]:/i.test(t))throw Error("Invalid relative path: must not be absolute");return t}function Vs(t){if(typeof t!=="string")throw TypeError("Invalid JSON string: must be a string");try{JSON.parse(t)}catch{throw Error("Invalid JSON string: must be valid JSON")}return t}function Us(t,r){return typeof t==="string"||typeof t==="number"}function zs(t){return t}var Hs={join(t,...r){return o(t,...r)},dirname(t){return n(t)},basename(t){return e(t)},resolve(...t){return s(...t)},isAbsolute(t){return i(t)},relative(t,r){return a(t,r)}};
3
- export{Os,Is,Fs,Ls,Ns,Bs,Ws,js,_s,Gs,Vs,Us,zs,Hs};
2
+ import{basename as e,dirname as n,isAbsolute as i,join as o,relative as a,resolve as s}from"path";function $i(t){if(!t||typeof t!=="string")throw Error("Invalid file path: must be a non-empty string");return t}function Ei(t){if(!t||typeof t!=="string")throw Error("Invalid directory path: must be a non-empty string");return t}function ki(t){if(!t||typeof t!=="string")throw Error("Invalid glob pattern: must be a non-empty string");return t}function Ti(t){if(typeof t!=="string")throw TypeError("Invalid source code: must be a string");return t}function Ai(t){if(typeof t!=="string")throw TypeError("Invalid DTS content: must be a string");return t}function Pi(t){if(!t||typeof t!=="string")throw Error("Invalid module specifier: must be a non-empty string");return t}function Di(t){if(!t||typeof t!=="string")throw Error("Invalid type name: must be a non-empty string");if(!["string","number","boolean","symbol","bigint","undefined","null","void","never","any","unknown","object"].includes(t)&&!/^[A-Z_$]/.test(t));return t}function Ri(t){if(!t||typeof t!=="string")throw Error("Invalid declaration name: must be a non-empty string");return t}function Mi(t){if(!t||typeof t!=="string")throw Error("Invalid absolute path: must be a non-empty string");if(!t.startsWith("/")&&!/^[A-Z]:/i.test(t))throw Error("Invalid absolute path: must start with / or drive letter");return t}function Oi(t){if(!t||typeof t!=="string")throw Error("Invalid relative path: must be a non-empty string");if(t.startsWith("/")||/^[A-Z]:/i.test(t))throw Error("Invalid relative path: must not be absolute");return t}function Ii(t){if(typeof t!=="string")throw TypeError("Invalid JSON string: must be a string");try{JSON.parse(t)}catch{throw Error("Invalid JSON string: must be valid JSON")}return t}function Fi(t,r){return typeof t==="string"||typeof t==="number"}function Li(t){return t}var Ni={join(t,...r){return o(t,...r)},dirname(t){return n(t)},basename(t){return e(t)},resolve(...t){return s(...t)},isAbsolute(t){return i(t)},relative(t,r){return a(t,r)}};
3
+ export{$i,Ei,ki,Ti,Ai,Pi,Di,Ri,Mi,Oi,Ii,Fi,Li,Ni};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{s}from"./chunk-0azm93j9.js";function le(d={}){let{onBuildStart:u=!1,onBuildEnd:f=!0,onGenerated:l,onError:i,...c}=d,o,r,e=async()=>{let t={...c};if(!t.outdir&&o)t.outdir=o;if(!t.entrypoints&&r)t.entrypoints=r;try{let n=await s(t);l?.(n)}catch(n){let a=n instanceof Error?n:Error(String(n));if(i?.(a),!i)console.error("[dtsx] Generation failed:",a.message)}};return{name:"dtsx",esbuildOptions(t){if(t.outdir&&typeof t.outdir==="string")o=t.outdir;if(t.entryPoints){if(Array.isArray(t.entryPoints))r=t.entryPoints;else if(typeof t.entryPoints==="object")r=Object.values(t.entryPoints)}},async buildStart(){if(u)await e()},async buildEnd(t){if(f)await e()}}}var ma=le,Yn=le,ga=le;
3
- export{le,ma,Yn,ga};
2
+ import{s}from"./chunk-0zfzhn19.js";function le(d={}){let{onBuildStart:u=!1,onBuildEnd:f=!0,onGenerated:l,onError:i,...c}=d,o,r,e=async()=>{let t={...c};if(!t.outdir&&o)t.outdir=o;if(!t.entrypoints&&r)t.entrypoints=r;try{let n=await s(t);l?.(n)}catch(n){let a=n instanceof Error?n:Error(String(n));if(i?.(a),!i)console.error("[dtsx] Generation failed:",a.message)}};return{name:"dtsx",esbuildOptions(t){if(t.outdir&&typeof t.outdir==="string")o=t.outdir;if(t.entryPoints){if(Array.isArray(t.entryPoints))r=t.entryPoints;else if(typeof t.entryPoints==="object")r=Object.values(t.entryPoints)}},async buildStart(){if(u)await e()},async buildEnd(t){if(f)await e()}}}var ha=le,Yn=le,ya=le;
3
+ export{le,ha,Yn,ya};
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import{r}from"./chunk-qnf4byak.js";import{be}from"./chunk-vae5wxar.js";import{readFileSync as u}from"fs";import{readFile as p}from"fs/promises";import{resolve as g}from"path";function m(t){return t.replace(/\/\*[\s\S]*?\*\//g,"").replace(/^\s*\/\/.*$/gm,"").replace(/,\s*([}\]])/g,"$1")}function vs(t,e){try{return{...JSON.parse(m(u(t,"utf8"))).compilerOptions,...e}}catch(s){throw Error(`Error reading tsconfig.json: ${s instanceof Error?s.message:String(s)}`)}}function f(t,e){let s=e.declarationsOnly?t.filter((o)=>o.endsWith(".d.ts")):t;if(e.include?.length){let o=e.include.map((n)=>new RegExp(n.replace(/\*/g,".*")));s=s.filter((n)=>o.some((i)=>i.test(n)))}if(e.exclude?.length){let o=e.exclude.map((n)=>new RegExp(n.replace(/\*/g,".*")));s=s.filter((n)=>!o.some((i)=>i.test(n)))}return s}async function lt(t,e={}){let s=performance.now(),o=f(t,e),n=[];for(let a of o)try{let c=await p(a,"utf8");for(let l of be(c))n.push({file:a,line:l.line,column:l.column,message:l.message,code:Number(l.code.slice(4)),severity:"error",category:"Error"})}catch(c){n.push({file:a,line:0,column:0,message:c instanceof Error?c.message:String(c),code:1000,severity:"error",category:"Error"})}let i=e.maxErrors?n.slice(0,e.maxErrors):n;return{success:i.length===0,diagnostics:i,errorCount:i.length,warningCount:0,infoCount:0,filesChecked:o,durationMs:performance.now()-s}}function Ar(t,e={}){return lt(t,{...e,declarationsOnly:!0})}async function Ss(t){let e=new Map;for(let s of t){let o=await p(s,"utf8").catch(()=>""),n=[];for(let i of r(o,s,!1,!0))if(i.isExported&&i.kind==="function"&&!i.returnType)n.push({line:1,column:1,message:"Exported function requires an explicit return type",declarationName:i.name,missingAnnotation:"return"});e.set(s,{compatible:n.length===0,issues:n})}return e}function d(t,e,s){let o=t.split(`
3
- `);if(e<1||e>o.length||s<1||s>o[e-1].length+1)return null;let n=s-1;for(let i=0;i<e-1;i++)n+=o[i].length+1;return n}function Pr(t,e,s){try{let o=u(t,"utf8"),n=d(o,e,s);if(n===null)return null;let i=r(o,t,!1).find((a)=>n>=(a.start??0)&&n<=(a.end??o.length));return i?.typeAnnotation??i?.returnType??i?.text??null}catch{return null}}function $s(t,e,s){let o=Pr(t,e,s);return o?{type:o}:null}function Es(t){if(t.success)return`\u2713 Type check passed (${t.filesChecked.length} files checked in ${t.durationMs}ms)`;return["\u2717 Type check failed",` ${t.errorCount} error(s), ${t.warningCount} warning(s)`,...t.diagnostics.map((e)=>`\u2717 ${e.file}:${e.line}:${e.column}
2
+ import{r}from"./chunk-jcckwgb9.js";import{me}from"./chunk-danfamyx.js";import{readFileSync as u}from"fs";import{readFile as p}from"fs/promises";import{resolve as g}from"path";function m(t){return t.replace(/\/\*[\s\S]*?\*\//g,"").replace(/^\s*\/\/.*$/gm,"").replace(/,\s*([}\]])/g,"$1")}function hs(t,e){try{return{...JSON.parse(m(u(t,"utf8"))).compilerOptions,...e}}catch(s){throw Error(`Error reading tsconfig.json: ${s instanceof Error?s.message:String(s)}`)}}function f(t,e){let s=e.declarationsOnly?t.filter((o)=>o.endsWith(".d.ts")):t;if(e.include?.length){let o=e.include.map((n)=>new RegExp(n.replace(/\*/g,".*")));s=s.filter((n)=>o.some((i)=>i.test(n)))}if(e.exclude?.length){let o=e.exclude.map((n)=>new RegExp(n.replace(/\*/g,".*")));s=s.filter((n)=>!o.some((i)=>i.test(n)))}return s}async function at(t,e={}){let s=performance.now(),o=f(t,e),n=[];for(let a of o)try{let c=await p(a,"utf8");for(let l of me(c))n.push({file:a,line:l.line,column:l.column,message:l.message,code:Number(l.code.slice(4)),severity:"error",category:"Error"})}catch(c){n.push({file:a,line:0,column:0,message:c instanceof Error?c.message:String(c),code:1000,severity:"error",category:"Error"})}let i=e.maxErrors?n.slice(0,e.maxErrors):n;return{success:i.length===0,diagnostics:i,errorCount:i.length,warningCount:0,infoCount:0,filesChecked:o,durationMs:performance.now()-s}}function xr(t,e={}){return at(t,{...e,declarationsOnly:!0})}async function ys(t){let e=new Map;for(let s of t){let o=await p(s,"utf8").catch(()=>""),n=[];for(let i of r(o,s,!1,!0))if(i.isExported&&i.kind==="function"&&!i.returnType)n.push({line:1,column:1,message:"Exported function requires an explicit return type",declarationName:i.name,missingAnnotation:"return"});e.set(s,{compatible:n.length===0,issues:n})}return e}function d(t,e,s){let o=t.split(`
3
+ `);if(e<1||e>o.length||s<1||s>o[e-1].length+1)return null;let n=s-1;for(let i=0;i<e-1;i++)n+=o[i].length+1;return n}function Cr(t,e,s){try{let o=u(t,"utf8"),n=d(o,e,s);if(n===null)return null;let i=r(o,t,!1).find((a)=>n>=(a.start??0)&&n<=(a.end??o.length));return i?.typeAnnotation??i?.returnType??i?.text??null}catch{return null}}function bs(t,e,s){let o=Cr(t,e,s);return o?{type:o}:null}function ws(t){if(t.success)return`\u2713 Type check passed (${t.filesChecked.length} files checked in ${t.durationMs}ms)`;return["\u2717 Type check failed",` ${t.errorCount} error(s), ${t.warningCount} warning(s)`,...t.diagnostics.map((e)=>`\u2717 ${e.file}:${e.line}:${e.column}
4
4
  ${e.message}`)].join(`
5
- `)}function ks(t){return lt(t.entrypoints.map((e)=>g(t.cwd,e)),{tsconfigPath:t.tsconfigPath,rootDir:t.root})}async function Ts(t,e){let o=(await Promise.all([lt(t),Ar(e)])).flatMap((n)=>n.diagnostics).map((n)=>({sourceName:n.file,sourceType:n.message,dtsType:"<invalid>"}));return{valid:o.length===0,mismatches:o}}
6
- export{vs,lt,Ar,Ss,Pr,$s,Es,ks,Ts};
5
+ `)}function xs(t){return at(t.entrypoints.map((e)=>g(t.cwd,e)),{tsconfigPath:t.tsconfigPath,rootDir:t.root})}async function Cs(t,e){let o=(await Promise.all([at(t),xr(e)])).flatMap((n)=>n.diagnostics).map((n)=>({sourceName:n.file,sourceType:n.message,dtsType:"<invalid>"}));return{valid:o.length===0,mismatches:o}}
6
+ export{hs,at,xr,ys,Cr,bs,ws,xs,Cs};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{t,F}from"./chunk-1j6092xz.js";import{Hn}from"./chunk-2kwjbk55.js";function et(o){let f=t(o);if(f.length!==1||f[0].kind!=="word")return;let l=o.slice(f[0].start,f[0].end);return["true","false","null","undefined","this","super"].includes(l)?void 0:l}function Mt(o){let f=t(o);if(f.length===0)return!0;let l=f[f.length-1],s=o.slice(l.start,l.end);if(l.kind==="word"&&(s==="is"||s==="extends"))return!0;if(s==="|"||s==="&")return!0;let n=f[f.length-2];return s===">"&&n!==void 0&&o.slice(n.start,n.end)==="="}function j(o){return w(o,F(o))}function Vn(o){for(let f=1024;f<o.length;f*=8){let l=o.slice(0,f),s=v(l,t(l),f);if(s!==void 0)return s}return w(o,t(o))}function w(o,f){return v(o,f,1/0)??!1}function v(o,f,l){let s=0;for(let n=0;n<f.length;n++){let a=f[n];if(a.end>=l)return;if(a.kind==="punctuation"){let d=o.charCodeAt(a.start);if(d===123||d===40||d===91)s++;else if(d===125||d===41||d===93)s--;continue}if(s!==0||a.kind!=="word"||a.end-a.start!==6)continue;let c=o.slice(a.start,a.end);if(c==="export")return!0;if(c==="import"){let d=f[n+1];if(d===void 0?l!==1/0:d.end>=l)return;let x=d?o.slice(d.start,d.end):"";if(x!=="("&&x!==".")return!0}}return l===1/0?!1:void 0}function Un(o){if(o.isExported)return!1;if(["function","variable","interface","type","class","enum","namespace"].includes(o.kind))return!0;return o.kind==="module"&&(o.moduleForm==="namespace"||o.moduleForm==="identifier")}function zn(o,f){let l=o.text,s=t(l),n=(i)=>s[i]?l.slice(s[i].start,s[i].end):"",a=(i)=>s[i]?.kind==="word",c=new Map,d=[];for(let i=0;i<s.length;i++){let e=n(i);if(e==="("||e==="["||e==="{"||e==="<")d.push(i);else if(e===")"||e==="]"||e==="}"||e===">"&&n(i-1)!=="="){let r=d.at(-1);if(r!==void 0&&(n(r)==="("&&e===")"||n(r)==="["&&e==="]"||n(r)==="{"&&e==="}"||n(r)==="<"&&e===">"))d.pop(),c.set(r,i)}}let x=[];for(let i=0;i<s.length;i++){if(n(i)!=="(")continue;let e=c.get(i);if(e===void 0||!(n(e+1)===":"||n(e+1)==="="&&n(e+2)===">"))continue;let r=new Set,u=i+1;while(u<e){let m=u;while(m<e&&n(m)!==","){let b=c.get(m);if(b!==void 0)m=b+1;else m++}let g=u;while(g<m&&n(g)!==":"&&n(g)!=="="){let b=c.get(g);if(b!==void 0)g=b+1;else g++}let h=u;while([".","public","private","protected","readonly","override"].includes(n(h)))h++;if(n(h)==="{"||n(h)==="[")for(let b of Hn(l.slice(s[h].start,s[g-1].end)))r.add(b);else if(a(h))r.add(n(h));u=m+1}let p=e+(n(e+1)===":"?2:3);while(p<s.length){if([";",",",")","]","}"].includes(n(p))||n(p)===">"&&n(p-1)!=="=")break;let m=c.get(p);if(m!==void 0)p=m+1;else p++}x.push({start:i,end:p,names:r})}let y=(i)=>{if(!a(i))return;let e=n(i);if(!x.some((r)=>i>=r.start&&i<r.end&&r.names.has(e)))f.add(e)},k=(i,e)=>{for(let r=i;r<e;r++){if(n(r)==="<"&&c.has(r)){r=c.get(r);continue}if(!a(r)||n(r-1)==="."||n(r+1)===":")continue;if(["true","false","null","undefined","new","this","super","as","satisfies","typeof","void","keyof"].includes(n(r)))continue;y(r)}};for(let i=0;i<s.length;i++){if(n(i)==="typeof")y(i+1);if(n(i)==="export"){let e=i+1;if(n(e)==="default"){if(!["function","class","abstract"].includes(n(e+1)))k(e+1,s.length);continue}if(n(e)==="type")e++;if(n(e)==="{"){let r=c.get(e);if(r===void 0||n(r+1)==="from")continue;for(let u=e+1;u<r;){if(n(u)==="type"&&a(u+1)&&n(u+1)!=="as")u++;y(u);while(u<r&&n(u)!==",")u++;u++}}}if(n(i)==="["){let e=c.get(i);if(e!==void 0&&[":","?","("].includes(n(e+1))&&n(i+2)!==":"&&n(i+2)!=="in")k(i+1,e)}}if(o.kind==="class"){let i=-1;for(let e=0;e<s.length&&n(e)!=="{";e++)if(n(e)==="<"&&c.has(e))e=c.get(e);else if(n(e)==="extends"){i=e;break}if(i!==-1){let e=i+1;while(e<s.length&&n(e)!=="{"&&n(e)!=="implements"){let r=c.get(e);if(r!==void 0)e=r+1;else e++}k(i+1,e)}}}
3
- export{et,Mt,j,Vn,Un,zn};
2
+ import{t,F}from"./chunk-1j6092xz.js";import{Kn}from"./chunk-42j9cfte.js";function Qe(o){let f=t(o);if(f.length!==1||f[0].kind!=="word")return;let l=o.slice(f[0].start,f[0].end);return["true","false","null","undefined","this","super"].includes(l)?void 0:l}function Dt(o){let f=t(o);if(f.length===0)return!0;let l=f[f.length-1],s=o.slice(l.start,l.end);if(l.kind==="word"&&(s==="is"||s==="extends"))return!0;if(s==="|"||s==="&")return!0;let n=f[f.length-2];return s===">"&&n!==void 0&&o.slice(n.start,n.end)==="="}function W(o){return w(o,F(o))}function jn(o){for(let f=1024;f<o.length;f*=8){let l=o.slice(0,f),s=v(l,t(l),f);if(s!==void 0)return s}return w(o,t(o))}function w(o,f){return v(o,f,1/0)??!1}function v(o,f,l){let s=0;for(let n=0;n<f.length;n++){let a=f[n];if(a.end>=l)return;if(a.kind==="punctuation"){let d=o.charCodeAt(a.start);if(d===123||d===40||d===91)s++;else if(d===125||d===41||d===93)s--;continue}if(s!==0||a.kind!=="word"||a.end-a.start!==6)continue;let c=o.slice(a.start,a.end);if(c==="export")return!0;if(c==="import"){let d=f[n+1];if(d===void 0?l!==1/0:d.end>=l)return;let x=d?o.slice(d.start,d.end):"";if(x!=="("&&x!==".")return!0}}return l===1/0?!1:void 0}function _n(o){if(o.isExported)return!1;if(["function","variable","interface","type","class","enum","namespace"].includes(o.kind))return!0;return o.kind==="module"&&(o.moduleForm==="namespace"||o.moduleForm==="identifier")}function Gn(o,f){let l=o.text,s=t(l),n=(i)=>s[i]?l.slice(s[i].start,s[i].end):"",a=(i)=>s[i]?.kind==="word",c=new Map,d=[];for(let i=0;i<s.length;i++){let e=n(i);if(e==="("||e==="["||e==="{"||e==="<")d.push(i);else if(e===")"||e==="]"||e==="}"||e===">"&&n(i-1)!=="="){let r=d.at(-1);if(r!==void 0&&(n(r)==="("&&e===")"||n(r)==="["&&e==="]"||n(r)==="{"&&e==="}"||n(r)==="<"&&e===">"))d.pop(),c.set(r,i)}}let x=[];for(let i=0;i<s.length;i++){if(n(i)!=="(")continue;let e=c.get(i);if(e===void 0||!(n(e+1)===":"||n(e+1)==="="&&n(e+2)===">"))continue;let r=new Set,u=i+1;while(u<e){let m=u;while(m<e&&n(m)!==","){let b=c.get(m);if(b!==void 0)m=b+1;else m++}let g=u;while(g<m&&n(g)!==":"&&n(g)!=="="){let b=c.get(g);if(b!==void 0)g=b+1;else g++}let h=u;while([".","public","private","protected","readonly","override"].includes(n(h)))h++;if(n(h)==="{"||n(h)==="[")for(let b of Kn(l.slice(s[h].start,s[g-1].end)))r.add(b);else if(a(h))r.add(n(h));u=m+1}let p=e+(n(e+1)===":"?2:3);while(p<s.length){if([";",",",")","]","}"].includes(n(p))||n(p)===">"&&n(p-1)!=="=")break;let m=c.get(p);if(m!==void 0)p=m+1;else p++}x.push({start:i,end:p,names:r})}let y=(i)=>{if(!a(i))return;let e=n(i);if(!x.some((r)=>i>=r.start&&i<r.end&&r.names.has(e)))f.add(e)},k=(i,e)=>{for(let r=i;r<e;r++){if(n(r)==="<"&&c.has(r)){r=c.get(r);continue}if(!a(r)||n(r-1)==="."||n(r+1)===":")continue;if(["true","false","null","undefined","new","this","super","as","satisfies","typeof","void","keyof"].includes(n(r)))continue;y(r)}};for(let i=0;i<s.length;i++){if(n(i)==="typeof")y(i+1);if(n(i)==="export"){let e=i+1;if(n(e)==="default"){if(!["function","class","abstract"].includes(n(e+1)))k(e+1,s.length);continue}if(n(e)==="type")e++;if(n(e)==="{"){let r=c.get(e);if(r===void 0||n(r+1)==="from")continue;for(let u=e+1;u<r;){if(n(u)==="type"&&a(u+1)&&n(u+1)!=="as")u++;y(u);while(u<r&&n(u)!==",")u++;u++}}}if(n(i)==="["){let e=c.get(i);if(e!==void 0&&[":","?","("].includes(n(e+1))&&n(i+2)!==":"&&n(i+2)!=="in")k(i+1,e)}}if(o.kind==="class"){let i=-1;for(let e=0;e<s.length&&n(e)!=="{";e++)if(n(e)==="<"&&c.has(e))e=c.get(e);else if(n(e)==="extends"){i=e;break}if(i!==-1){let e=i+1;while(e<s.length&&n(e)!=="{"&&n(e)!=="implements"){let r=c.get(e);if(r!==void 0)e=r+1;else e++}k(i+1,e)}}}
3
+ export{Qe,Dt,W,jn,_n,Gn};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{r}from"./chunk-qnf4byak.js";import{existsSync as g,readFileSync as h,writeFileSync as b}from"fs";function d(t){let e=[],s=/\b([A-Z][a-zA-Z0-9]*)\b/g,o;while((o=s.exec(t))!==null){let i=o[1];if(!D(i))e.push(i)}return[...new Set(e)]}function D(t){return new Set(["Array","Object","String","Number","Boolean","Symbol","BigInt","Function","Promise","Map","Set","WeakMap","WeakSet","Date","RegExp","Error","TypeError","RangeError","SyntaxError","Partial","Required","Readonly","Pick","Omit","Record","Exclude","Extract","NonNullable","ReturnType","Parameters","ConstructorParameters","InstanceType","ThisType","Uppercase","Lowercase","Capitalize","Uncapitalize","Awaited","NoInfer","Generator","AsyncGenerator","IterableIterator","AsyncIterableIterator","PropertyKey","Iterable","AsyncIterable","ArrayLike","PromiseLike","ArrayBuffer","SharedArrayBuffer","DataView","Int8Array","Uint8Array","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"]).has(t)}function x(t){if(t.kind!=="type")return!1;let e=t.typeAnnotation||"";if(t.generics)return!1;if(e.includes("{")||e.includes("(")||e.includes("<"))return!1;return/^[\w\s|&]+$/.test(e)}function v(t){if(t.kind!=="interface")return!1;if(!t.members||t.members.length===0){if(!t.extends)return!0}return!1}function I(t,e){let s={...t,members:[...t.members||[],...e.members||[]],leadingComments:[...t.leadingComments||[],...e.leadingComments||[]]};if(t.extends&&e.extends){let o=t.extends.split(",").map((n)=>n.trim()),i=e.extends.split(",").map((n)=>n.trim());s.extends=[...new Set([...o,...i])].join(", ")}else s.extends=t.extends||e.extends;return s}function A(t){let e={import:0,interface:1,type:2,class:3,enum:4,function:5,variable:6,export:7};return[...t].sort((s,o)=>{let i=e[s.kind]??99,n=e[o.kind]??99;if(i!==n)return i-n;return s.name.localeCompare(o.name)})}function T(t){let e=[],s=[];for(let i=0;i<t.length;i++){let n=t[i];if(n.kind==="import")e.push(n);else s.push(n)}return[...[...e].sort((i,n)=>{let a=i.source||"",c=n.source||"",p=a.startsWith("node:")||a==="bun",m=c.startsWith("node:")||c==="bun";if(p&&!m)return-1;if(!p&&m)return 1;let l=!a.startsWith("."),u=!c.startsWith(".");if(l&&!u)return-1;if(!l&&u)return 1;return a.localeCompare(c)}),...s]}function S(t){let e=new Set;for(let i of t){if(i.kind==="import")continue;let n=i.text||"",a=i.typeAnnotation||"",c=i.returnType||"",p=i.extends||"",m=i.implements?.join(" ")||"",l=`${n} ${a} ${c} ${p} ${m}`;for(let u of d(l))e.add(u);if(i.members)for(let u of i.members){let f=`${u.typeAnnotation||""} ${u.returnType||""}`;for(let y of d(f))e.add(y)}if(i.parameters){for(let u of i.parameters)if(u.type)for(let f of d(u.type))e.add(f)}}let s=0;return{declarations:t.map((i)=>{if(i.kind!=="import"||!i.specifiers)return i;let n=i.specifiers.filter((a)=>{let c=a.alias||a.name;return e.has(c)});if(n.length===0){if(!i.isSideEffect)return s++,null}if(n.length<(i.specifiers?.length||0))return s+=(i.specifiers?.length||0)-n.length,{...i,specifiers:n};return i}).filter((i)=>i!==null),removed:s}}function k(t){let e=new Map,s=0;for(let o of t){if(o.kind==="import"){let n=`import:${o.source}`;if(e.has(n)){let a=e.get(n),c=[...a.specifiers||[],...o.specifiers||[]],p=Array.from(new Map(c.map((m)=>[m.alias||m.name,m])).values());e.set(n,{...a,specifiers:p}),s++}else e.set(n,o);continue}let i=`${o.kind}:${o.name}`;if(e.has(i))s++;else e.set(i,o)}return{declarations:Array.from(e.values()),removed:s}}function z(t){let e=new Map,s=[];for(let n of t)if(n.kind==="interface"){let a=n.name;if(!e.has(a))e.set(a,[]);e.get(a).push(n)}else s.push(n);let o=0,i=[];for(let[n,a]of e)if(a.length>1){let c=a[0];for(let p=1;p<a.length;p++)c=I(c,a[p]),o++;i.push(c)}else i.push(a[0]);return{declarations:[...s,...i],merged:o}}function w(t){let e=new Map,s=new Set;for(let n of t)if(x(n))e.set(n.name,n.typeAnnotation||""),s.add(n.name);if(e.size===0)return{declarations:t,inlined:0};function o(n){let a=n;for(let[c,p]of e){let m=new RegExp(`\\b${c}\\b`,"g");a=a.replace(m,p)}return a}return{declarations:t.filter((n)=>n.kind!=="type"||!s.has(n.name)).map((n)=>{if(n.typeAnnotation)n={...n,typeAnnotation:o(n.typeAnnotation)};if(n.returnType)n={...n,returnType:o(n.returnType)};if(n.extends)n={...n,extends:o(n.extends)};return n}),inlined:e.size}}function R(t){let e=t.length,s=t.filter((o)=>!v(o));return{declarations:s,removed:e-s.length}}function Dr(t,e={}){let s=[...t],o={originalSize:0,optimizedSize:0,savings:0,savingsPercent:0,removedImports:0,removedDeclarations:0,mergedInterfaces:0,inlinedTypes:0};if(e.removeUnusedImports){let{declarations:i,removed:n}=S(s);s=i,o.removedImports=n}if(e.deduplicateDeclarations){let{declarations:i,removed:n}=k(s);s=i,o.removedDeclarations+=n}if(e.mergeInterfaces){let{declarations:i,merged:n}=z(s);s=i,o.mergedInterfaces=n}if(e.removeEmptyInterfaces){let{declarations:i,removed:n}=R(s);s=i,o.removedDeclarations+=n}if(e.inlineSimpleTypes){let{declarations:i,inlined:n}=w(s);s=i,o.inlinedTypes=n}if(e.sortImports)s=T(s);if(e.sortDeclarations)s=A(s);return{declarations:s,result:o}}async function As(t,e={}){if(!g(t))throw Error(`File not found: ${t}`);let s=h(t,"utf-8"),o=Buffer.byteLength(s,"utf-8"),i=r(s,t,!e.removeComments),{declarations:n,result:a}=Dr(i,e),c=C(n,e);if(e.minify)c=Rr(c);let p=Buffer.byteLength(c,"utf-8");return a.originalSize=o,a.optimizedSize=p,a.savings=o-p,a.savingsPercent=Math.round(a.savings/o*100),b(t,c),a}function C(t,e){let s=[];for(let o of t){if(!e.removeComments&&o.leadingComments)for(let i of o.leadingComments)s.push(i);if(o.text)s.push(o.text);else s.push(E(o));s.push("")}return s.join(`
3
- `)}function E(t){let e=[];if(t.isExported)e.push("export");if(t.isDefault)e.push("default");switch(t.kind){case"import":if(t.isTypeOnly)e.push("import type");else e.push("import");if(t.specifiers&&t.specifiers.length>0){let s=t.specifiers.map((o)=>{let i=o.isType?"type ":"";return o.alias?`${i}${o.name} as ${o.alias}`:`${i}${o.name}`}).join(", ");e.push(`{ ${s} }`)}e.push("from"),e.push(`'${t.source}'`);break;case"function":if(e.push("declare function"),e.push(t.name),t.generics)e.push(t.generics);if(e.push(`(${B(t.parameters)})`),t.returnType)e.push(`: ${t.returnType}`);break;case"variable":if(e.push("declare const"),e.push(t.name),t.typeAnnotation)e.push(`: ${t.typeAnnotation}`);break;case"interface":if(e.push("interface"),e.push(t.name),t.generics)e.push(t.generics);if(t.extends)e.push(`extends ${t.extends}`);if(e.push("{"),t.members)for(let s of t.members)e.push(` ${s.name}${s.typeAnnotation?`: ${s.typeAnnotation}`:""}`);e.push("}");break;case"type":if(e.push("type"),e.push(t.name),t.generics)e.push(t.generics);e.push("="),e.push(t.typeAnnotation||"unknown");break;case"class":if(e.push("declare class"),e.push(t.name),t.generics)e.push(t.generics);if(t.extends)e.push(`extends ${t.extends}`);if(t.implements?.length)e.push(`implements ${t.implements.join(", ")}`);e.push("{ }");break;case"enum":e.push("declare enum"),e.push(t.name),e.push("{ }");break;default:return t.text||""}return e.join(" ")}function B(t){if(!t)return"";return t.map((e)=>{let s="";if(e.rest)s+="...";if(s+=e.name,e.optional)s+="?";if(e.type)s+=`: ${e.type}`;return s}).join(", ")}function Rr(t){return t.replace(/(?<!\/\*\*)\/\/[^\n]*/g,"").replace(/^\s*[\r\n]/gm,"").replace(/ {2,}/g," ").replace(/\s*([{}[\]();,:])\s*/g,"$1").replace(/(\w)(\{)/g,"$1 $2").replace(/(\})([a-z])/gi,"$1 $2").replace(/(export|import|type|interface|class|function|const|let|var|extends|implements|declare)\s*/g,"$1 ").trim()}
4
- export{Dr,As,Rr};
2
+ import{r}from"./chunk-jcckwgb9.js";import{existsSync as g,readFileSync as h,writeFileSync as b}from"fs";function d(t){let e=[],s=/\b([A-Z][a-zA-Z0-9]*)\b/g,o;while((o=s.exec(t))!==null){let i=o[1];if(!D(i))e.push(i)}return[...new Set(e)]}function D(t){return new Set(["Array","Object","String","Number","Boolean","Symbol","BigInt","Function","Promise","Map","Set","WeakMap","WeakSet","Date","RegExp","Error","TypeError","RangeError","SyntaxError","Partial","Required","Readonly","Pick","Omit","Record","Exclude","Extract","NonNullable","ReturnType","Parameters","ConstructorParameters","InstanceType","ThisType","Uppercase","Lowercase","Capitalize","Uncapitalize","Awaited","NoInfer","Generator","AsyncGenerator","IterableIterator","AsyncIterableIterator","PropertyKey","Iterable","AsyncIterable","ArrayLike","PromiseLike","ArrayBuffer","SharedArrayBuffer","DataView","Int8Array","Uint8Array","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"]).has(t)}function x(t){if(t.kind!=="type")return!1;let e=t.typeAnnotation||"";if(t.generics)return!1;if(e.includes("{")||e.includes("(")||e.includes("<"))return!1;return/^[\w\s|&]+$/.test(e)}function v(t){if(t.kind!=="interface")return!1;if(!t.members||t.members.length===0){if(!t.extends)return!0}return!1}function I(t,e){let s={...t,members:[...t.members||[],...e.members||[]],leadingComments:[...t.leadingComments||[],...e.leadingComments||[]]};if(t.extends&&e.extends){let o=t.extends.split(",").map((n)=>n.trim()),i=e.extends.split(",").map((n)=>n.trim());s.extends=[...new Set([...o,...i])].join(", ")}else s.extends=t.extends||e.extends;return s}function A(t){let e={import:0,interface:1,type:2,class:3,enum:4,function:5,variable:6,export:7};return[...t].sort((s,o)=>{let i=e[s.kind]??99,n=e[o.kind]??99;if(i!==n)return i-n;return s.name.localeCompare(o.name)})}function T(t){let e=[],s=[];for(let i=0;i<t.length;i++){let n=t[i];if(n.kind==="import")e.push(n);else s.push(n)}return[...[...e].sort((i,n)=>{let a=i.source||"",c=n.source||"",p=a.startsWith("node:")||a==="bun",m=c.startsWith("node:")||c==="bun";if(p&&!m)return-1;if(!p&&m)return 1;let l=!a.startsWith("."),u=!c.startsWith(".");if(l&&!u)return-1;if(!l&&u)return 1;return a.localeCompare(c)}),...s]}function S(t){let e=new Set;for(let i of t){if(i.kind==="import")continue;let n=i.text||"",a=i.typeAnnotation||"",c=i.returnType||"",p=i.extends||"",m=i.implements?.join(" ")||"",l=`${n} ${a} ${c} ${p} ${m}`;for(let u of d(l))e.add(u);if(i.members)for(let u of i.members){let f=`${u.typeAnnotation||""} ${u.returnType||""}`;for(let y of d(f))e.add(y)}if(i.parameters){for(let u of i.parameters)if(u.type)for(let f of d(u.type))e.add(f)}}let s=0;return{declarations:t.map((i)=>{if(i.kind!=="import"||!i.specifiers)return i;let n=i.specifiers.filter((a)=>{let c=a.alias||a.name;return e.has(c)});if(n.length===0){if(!i.isSideEffect)return s++,null}if(n.length<(i.specifiers?.length||0))return s+=(i.specifiers?.length||0)-n.length,{...i,specifiers:n};return i}).filter((i)=>i!==null),removed:s}}function k(t){let e=new Map,s=0;for(let o of t){if(o.kind==="import"){let n=`import:${o.source}`;if(e.has(n)){let a=e.get(n),c=[...a.specifiers||[],...o.specifiers||[]],p=Array.from(new Map(c.map((m)=>[m.alias||m.name,m])).values());e.set(n,{...a,specifiers:p}),s++}else e.set(n,o);continue}let i=`${o.kind}:${o.name}`;if(e.has(i))s++;else e.set(i,o)}return{declarations:Array.from(e.values()),removed:s}}function z(t){let e=new Map,s=[];for(let n of t)if(n.kind==="interface"){let a=n.name;if(!e.has(a))e.set(a,[]);e.get(a).push(n)}else s.push(n);let o=0,i=[];for(let[n,a]of e)if(a.length>1){let c=a[0];for(let p=1;p<a.length;p++)c=I(c,a[p]),o++;i.push(c)}else i.push(a[0]);return{declarations:[...s,...i],merged:o}}function w(t){let e=new Map,s=new Set;for(let n of t)if(x(n))e.set(n.name,n.typeAnnotation||""),s.add(n.name);if(e.size===0)return{declarations:t,inlined:0};function o(n){let a=n;for(let[c,p]of e){let m=new RegExp(`\\b${c}\\b`,"g");a=a.replace(m,p)}return a}return{declarations:t.filter((n)=>n.kind!=="type"||!s.has(n.name)).map((n)=>{if(n.typeAnnotation)n={...n,typeAnnotation:o(n.typeAnnotation)};if(n.returnType)n={...n,returnType:o(n.returnType)};if(n.extends)n={...n,extends:o(n.extends)};return n}),inlined:e.size}}function R(t){let e=t.length,s=t.filter((o)=>!v(o));return{declarations:s,removed:e-s.length}}function Qn(t,e={}){let s=[...t],o={originalSize:0,optimizedSize:0,savings:0,savingsPercent:0,removedImports:0,removedDeclarations:0,mergedInterfaces:0,inlinedTypes:0};if(e.removeUnusedImports){let{declarations:i,removed:n}=S(s);s=i,o.removedImports=n}if(e.deduplicateDeclarations){let{declarations:i,removed:n}=k(s);s=i,o.removedDeclarations+=n}if(e.mergeInterfaces){let{declarations:i,merged:n}=z(s);s=i,o.mergedInterfaces=n}if(e.removeEmptyInterfaces){let{declarations:i,removed:n}=R(s);s=i,o.removedDeclarations+=n}if(e.inlineSimpleTypes){let{declarations:i,inlined:n}=w(s);s=i,o.inlinedTypes=n}if(e.sortImports)s=T(s);if(e.sortDeclarations)s=A(s);return{declarations:s,result:o}}async function vi(t,e={}){if(!g(t))throw Error(`File not found: ${t}`);let s=h(t,"utf-8"),o=Buffer.byteLength(s,"utf-8"),i=r(s,t,!e.removeComments),{declarations:n,result:a}=Qn(i,e),c=C(n,e);if(e.minify)c=er(c);let p=Buffer.byteLength(c,"utf-8");return a.originalSize=o,a.optimizedSize=p,a.savings=o-p,a.savingsPercent=Math.round(a.savings/o*100),b(t,c),a}function C(t,e){let s=[];for(let o of t){if(!e.removeComments&&o.leadingComments)for(let i of o.leadingComments)s.push(i);if(o.text)s.push(o.text);else s.push(E(o));s.push("")}return s.join(`
3
+ `)}function E(t){let e=[];if(t.isExported)e.push("export");if(t.isDefault)e.push("default");switch(t.kind){case"import":if(t.isTypeOnly)e.push("import type");else e.push("import");if(t.specifiers&&t.specifiers.length>0){let s=t.specifiers.map((o)=>{let i=o.isType?"type ":"";return o.alias?`${i}${o.name} as ${o.alias}`:`${i}${o.name}`}).join(", ");e.push(`{ ${s} }`)}e.push("from"),e.push(`'${t.source}'`);break;case"function":if(e.push("declare function"),e.push(t.name),t.generics)e.push(t.generics);if(e.push(`(${B(t.parameters)})`),t.returnType)e.push(`: ${t.returnType}`);break;case"variable":if(e.push("declare const"),e.push(t.name),t.typeAnnotation)e.push(`: ${t.typeAnnotation}`);break;case"interface":if(e.push("interface"),e.push(t.name),t.generics)e.push(t.generics);if(t.extends)e.push(`extends ${t.extends}`);if(e.push("{"),t.members)for(let s of t.members)e.push(` ${s.name}${s.typeAnnotation?`: ${s.typeAnnotation}`:""}`);e.push("}");break;case"type":if(e.push("type"),e.push(t.name),t.generics)e.push(t.generics);e.push("="),e.push(t.typeAnnotation||"unknown");break;case"class":if(e.push("declare class"),e.push(t.name),t.generics)e.push(t.generics);if(t.extends)e.push(`extends ${t.extends}`);if(t.implements?.length)e.push(`implements ${t.implements.join(", ")}`);e.push("{ }");break;case"enum":e.push("declare enum"),e.push(t.name),e.push("{ }");break;default:return t.text||""}return e.join(" ")}function B(t){if(!t)return"";return t.map((e)=>{let s="";if(e.rest)s+="...";if(s+=e.name,e.optional)s+="?";if(e.type)s+=`: ${e.type}`;return s}).join(", ")}function er(t){return t.replace(/(?<!\/\*\*)\/\/[^\n]*/g,"").replace(/^\s*[\r\n]/gm,"").replace(/ {2,}/g," ").replace(/\s*([{}[\]();,:])\s*/g,"$1").replace(/(\w)(\{)/g,"$1 $2").replace(/(\})([a-z])/gi,"$1 $2").replace(/(export|import|type|interface|class|function|const|let|var|extends|implements|declare)\s*/g,"$1 ").trim()}
4
+ export{Qn,vi,er};
@@ -1,9 +1,9 @@
1
1
  // @bun
2
- class de{plugins=[];config=null;register(t){if(this.plugins.some((n)=>n.name===t.name))throw Error(`Plugin "${t.name}" is already registered`);this.plugins.push(t)}hasDeclarationHooks(){return this.plugins.some((t)=>t.onDeclarations!==void 0)}unregister(t){let n=this.plugins.findIndex((r)=>r.name===t);if(n>=0)return this.plugins.splice(n,1),!0;return!1}getPlugins(){return this.plugins}createLogger(t){return{debug:(n)=>console.debug(`[${t}] ${n}`),info:(n)=>console.info(`[${t}] ${n}`),warn:(n)=>console.warn(`[${t}] ${n}`),error:(n)=>console.error(`[${t}] ${n}`)}}async runOnStart(t){let n=t;for(let r of this.plugins)if(r.onStart){let e=await r.onStart(n);if(e)n=e}return this.config=n,n}async runOnBeforeFile(t,n){let r=n;for(let e of this.plugins)if(e.onBeforeFile){let i={filePath:t,sourceCode:n,content:r,config:this.config,log:this.createLogger(e.name)},o=await e.onBeforeFile(i);if(typeof o==="string")r=o}return r}async runOnDeclarations(t,n,r){let e=r;for(let i of this.plugins)if(i.onDeclarations){let o={filePath:t,sourceCode:n,declarations:e,config:this.config,log:this.createLogger(i.name)},s=await i.onDeclarations(o);if(s)e=s}return e}async runOnAfterFile(t,n,r){let e=r;for(let i of this.plugins)if(i.onAfterFile){let o={filePath:t,sourceCode:n,content:e,config:this.config,log:this.createLogger(i.name)},s=await i.onAfterFile(o);if(typeof s==="string")e=s}return e}async runOnEnd(t){for(let n of this.plugins)if(n.onEnd)await n.onEnd(t)}async runOnError(t,n,r){for(let e of this.plugins)if(e.onError){let i={filePath:n,sourceCode:r,config:this.config,log:this.createLogger(e.name)};await e.onError(t,i)}}}var xo=new de;function H(t){return t}var Co=H({name:"strip-internal",version:"1.0.0",description:"Removes declarations marked with @internal",onDeclarations:(t)=>t.declarations.filter((n)=>{if(n.leadingComments){if(n.leadingComments.some((e)=>e.includes("@internal")))return t.log.debug(`Stripping internal declaration: ${n.name}`),!1}return!0})});function vo(t){return H({name:"banner",version:"1.0.0",description:"Adds a banner comment to generated files",onAfterFile:(n)=>`/**
2
+ class he{plugins=[];config=null;register(t){if(this.plugins.some((n)=>n.name===t.name))throw Error(`Plugin "${t.name}" is already registered`);this.plugins.push(t)}hasDeclarationHooks(){return this.plugins.some((t)=>t.onDeclarations!==void 0)}unregister(t){let n=this.plugins.findIndex((r)=>r.name===t);if(n>=0)return this.plugins.splice(n,1),!0;return!1}getPlugins(){return this.plugins}createLogger(t){return{debug:(n)=>console.debug(`[${t}] ${n}`),info:(n)=>console.info(`[${t}] ${n}`),warn:(n)=>console.warn(`[${t}] ${n}`),error:(n)=>console.error(`[${t}] ${n}`)}}async runOnStart(t){let n=t;for(let r of this.plugins)if(r.onStart){let e=await r.onStart(n);if(e)n=e}return this.config=n,n}async runOnBeforeFile(t,n){let r=n;for(let e of this.plugins)if(e.onBeforeFile){let i={filePath:t,sourceCode:n,content:r,config:this.config,log:this.createLogger(e.name)},o=await e.onBeforeFile(i);if(typeof o==="string")r=o}return r}async runOnDeclarations(t,n,r){let e=r;for(let i of this.plugins)if(i.onDeclarations){let o={filePath:t,sourceCode:n,declarations:e,config:this.config,log:this.createLogger(i.name)},s=await i.onDeclarations(o);if(s)e=s}return e}async runOnAfterFile(t,n,r){let e=r;for(let i of this.plugins)if(i.onAfterFile){let o={filePath:t,sourceCode:n,content:e,config:this.config,log:this.createLogger(i.name)},s=await i.onAfterFile(o);if(typeof s==="string")e=s}return e}async runOnEnd(t){for(let n of this.plugins)if(n.onEnd)await n.onEnd(t)}async runOnError(t,n,r){for(let e of this.plugins)if(e.onError){let i={filePath:n,sourceCode:r,config:this.config,log:this.createLogger(e.name)};await e.onError(t,i)}}}var Wo=new he;function q(t){return t}var jo=q({name:"strip-internal",version:"1.0.0",description:"Removes declarations marked with @internal",onDeclarations:(t)=>t.declarations.filter((n)=>{if(n.leadingComments){if(n.leadingComments.some((e)=>e.includes("@internal")))return t.log.debug(`Stripping internal declaration: ${n.name}`),!1}return!0})});function _o(t){return q({name:"banner",version:"1.0.0",description:"Adds a banner comment to generated files",onAfterFile:(n)=>`/**
3
3
  * ${t.split(`
4
4
  `).join(`
5
5
  * `)}
6
6
  */
7
7
 
8
- `+n.content})}function So(t){return H({name:"filter",version:"1.0.0",description:"Filters declarations by name",onDeclarations:(n)=>n.declarations.filter((r)=>{if(r.kind==="import")return!0;return t(r.name)})})}
9
- export{de,xo,H,Co,vo,So};
8
+ `+n.content})}function Go(t){return q({name:"filter",version:"1.0.0",description:"Filters declarations by name",onDeclarations:(n)=>n.declarations.filter((r)=>{if(r.kind==="import")return!0;return t(r.name)})})}
9
+ export{he,Wo,q,jo,_o,Go};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- function Re(h){let a="",i=0,e=0;while(i<h.length){let r=h.charCodeAt(i);if(e){if(a+=h[i],r===92&&i+1<h.length){a+=h[i+1],i+=2;continue}if(r===e)e=0;i++;continue}if(r===34){e=r,a+=h[i++];continue}if(r===47&&h.charCodeAt(i+1)===47){i+=2;while(i<h.length&&h.charCodeAt(i)!==10&&h.charCodeAt(i)!==13)i++;continue}if(r===47&&h.charCodeAt(i+1)===42){i+=2;while(i+1<h.length&&!(h.charCodeAt(i)===42&&h.charCodeAt(i+1)===47)){if(h.charCodeAt(i)===10)a+=`
2
+ function ve(h){let a="",i=0,e=0;while(i<h.length){let r=h.charCodeAt(i);if(e){if(a+=h[i],r===92&&i+1<h.length){a+=h[i+1],i+=2;continue}if(r===e)e=0;i++;continue}if(r===34){e=r,a+=h[i++];continue}if(r===47&&h.charCodeAt(i+1)===47){i+=2;while(i<h.length&&h.charCodeAt(i)!==10&&h.charCodeAt(i)!==13)i++;continue}if(r===47&&h.charCodeAt(i+1)===42){i+=2;while(i+1<h.length&&!(h.charCodeAt(i)===42&&h.charCodeAt(i+1)===47)){if(h.charCodeAt(i)===10)a+=`
3
3
  `;i++}i=Math.min(i+2,h.length);continue}if(r===44){let c=i+1;while(c<h.length){while(c<h.length&&h.charCodeAt(c)<=32)c++;if(h.charCodeAt(c)===47&&h.charCodeAt(c+1)===47){c+=2;while(c<h.length&&h.charCodeAt(c)!==10&&h.charCodeAt(c)!==13)c++;continue}if(h.charCodeAt(c)===47&&h.charCodeAt(c+1)===42){c+=2;while(c+1<h.length&&!(h.charCodeAt(c)===42&&h.charCodeAt(c+1)===47))c++;c=Math.min(c+2,h.length);continue}break}let t=h.charCodeAt(c);if(t===93||t===125){i++;continue}}a+=h[i++]}return a}
4
- export{Re};
4
+ export{ve};
@@ -1,7 +1,7 @@
1
1
  // @bun
2
- function u(r,e=!0){if(!e||!r||r.length===0)return"";if(r.length===1){let t=r[0];if(t.length>0&&t.charCodeAt(0)>32&&t.charCodeAt(t.length-1)>32)return`${t}
2
+ function f(r,e=!0){if(!e||!r||r.length===0)return"";if(r.length===1){let t=r[0];if(t.length>0&&t.charCodeAt(0)>32&&t.charCodeAt(t.length-1)>32)return`${t}
3
3
  `;return`${t.trim()}
4
4
  `}let n="";for(let t=0;t<r.length;t++){if(t>0)n+=`
5
5
  `;n+=r[t].trim()}return`${n}
6
- `}function Te(r){return r.replaceAll("*/","*\\/")}
7
- export{u,Te};
6
+ `}function Pe(r){return r.replaceAll("*/","*\\/")}
7
+ export{f,Pe};
@@ -1,8 +1,8 @@
1
1
  // @bun
2
- import{t,F}from"./chunk-1j6092xz.js";import{n}from"./chunk-90aptjh6.js";function An(p,y,D,k){let r=new Map,i=new Map;for(let e of[...y,...D.values(),...[...k.values()].flat()])if(r.set(e.name,e),e.kind==="function"&&!i.has(e.name))i.set(e.name,e);for(let[e,o]of k)if(o.length)i.set(e,o[0]);if(!i.size)return;let u=new Set;for(let[e,o]of k)if(o.length>1)u.add(e);let a=new Map;for(let e of y)if(e.kind==="function"){let o=(a.get(e.name)??0)+1;if(a.set(e.name,o),o>1)u.add(e.name)}let s=F(p),d=(e)=>s[e]?p.slice(s[e].start,s[e].end):"",g=new Map,h=0;for(let e=0;e<s.length;e++){let o=s[e];if(o.kind==="punctuation"){let l=p.charCodeAt(o.start);if(l===40||l===91||l===123)h++;else if(l===41||l===93||l===125)h--;continue}if(h||s[e+2]?.kind!=="word"||d(e+1)!=="."||d(e+3)!=="=")continue;let c=d(e);if(!i.has(c))continue;let b=d(e+2),x=e+4,f=x,m=0;for(;f<s.length;f++){let l=d(f);if(!m&&l===";")break;if(!m&&f>x&&/[\r\n]/.test(p.slice(s[f-1].end,s[f].start))&&(["export","const","let","var","function","class"].includes(l)||i.has(l)&&d(f+1)==="."))break;if(["(","[","{"].includes(l))m++;else if([")","]","}"].includes(l))m--}if(f===x)continue;let w=A(p.slice(s[x].start,s[f-1].end),r,u),M=g.get(c);if(!M)g.set(c,M=new Map);let v=M.get(b);if(!v)M.set(b,v=[]);if(!v.includes(w))v.push(w);e=f-1}for(let[e,o]of g){let c=i.get(e),b=[...o].map(([f,m])=>` let ${f}: ${m.map((w)=>w.includes("=>")&&m.length>1?`(${w})`:w).join(" | ")};`).join(`
2
+ import{t,F}from"./chunk-1j6092xz.js";import{n}from"./chunk-8d3sdkv4.js";function Rn(p,y,D,k){let r=new Map,i=new Map;for(let e of[...y,...D.values(),...[...k.values()].flat()])if(r.set(e.name,e),e.kind==="function"&&!i.has(e.name))i.set(e.name,e);for(let[e,o]of k)if(o.length)i.set(e,o[0]);if(!i.size)return;let u=new Set;for(let[e,o]of k)if(o.length>1)u.add(e);let a=new Map;for(let e of y)if(e.kind==="function"){let o=(a.get(e.name)??0)+1;if(a.set(e.name,o),o>1)u.add(e.name)}let s=F(p),d=(e)=>s[e]?p.slice(s[e].start,s[e].end):"",g=new Map,h=0;for(let e=0;e<s.length;e++){let o=s[e];if(o.kind==="punctuation"){let l=p.charCodeAt(o.start);if(l===40||l===91||l===123)h++;else if(l===41||l===93||l===125)h--;continue}if(h||s[e+2]?.kind!=="word"||d(e+1)!=="."||d(e+3)!=="=")continue;let c=d(e);if(!i.has(c))continue;let b=d(e+2),x=e+4,f=x,m=0;for(;f<s.length;f++){let l=d(f);if(!m&&l===";")break;if(!m&&f>x&&/[\r\n]/.test(p.slice(s[f-1].end,s[f].start))&&(["export","const","let","var","function","class"].includes(l)||i.has(l)&&d(f+1)==="."))break;if(["(","[","{"].includes(l))m++;else if([")","]","}"].includes(l))m--}if(f===x)continue;let w=A(p.slice(s[x].start,s[f-1].end),r,u),M=g.get(c);if(!M)g.set(c,M=new Map);let v=M.get(b);if(!v)M.set(b,v=[]);if(!v.includes(w))v.push(w);e=f-1}for(let[e,o]of g){let c=i.get(e),b=[...o].map(([f,m])=>` let ${f}: ${m.map((w)=>w.includes("=>")&&m.length>1?`(${w})`:w).join(" | ")};`).join(`
3
3
  `),x=c.isExported&&!c.isDefault?"export ":"";if(c.isDefault)c.text=c.text.replace("export default function ","declare function ");if(c.text+=`
4
4
  ${x}declare namespace ${e} {
5
5
  ${b}
6
6
  }`,c.isDefault)c.text+=`
7
7
  export default ${e};`}}function A(p,y,D,k=0){let r=p.trim(),i=y.get(r);if(i?.kind==="variable"&&k<64){if(i.typeAnnotation)return i.typeAnnotation==="unique symbol"?`typeof ${r}`:i.typeAnnotation;if(typeof i.value==="string")return A(i.value,y,D,k+1)}let u=n(r,!1);if(u!=="unknown")return u;let a=t(r);if(a[0]?.kind==="word"&&a[1]&&r.slice(a[1].start,a[1].end)==="("&&r.endsWith(")")){let s=0,d=-1;for(let e=1;e<a.length;e++){let o=r.slice(a[e].start,a[e].end);if(o==="(")s++;else if(o===")"&&--s===0){d=e;break}}if(d!==a.length-1)return u;let g=r.slice(a[0].start,a[0].end),h=y.get(g);if(h?.kind==="function"&&!h.generics&&!D.has(g))return`ReturnType<typeof ${g}>`}if(/^[$A-Z_a-z][$\w]*(?:\.[$A-Z_a-z][$\w]*)*$/.test(r))return`typeof ${r}`;return u}
8
- export{An};
8
+ export{Rn};