@dtsx/dtsx 0.11.52 → 0.11.54

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 (172) hide show
  1. package/dist/bin/cli.js +1 -1
  2. package/dist/{chunk-j0y149qx.js → chunk-0d5nemtn.js} +2 -2
  3. package/dist/{chunk-3z75j224.js → chunk-0gy70m6b.js} +2 -2
  4. package/dist/{chunk-p99myphf.js → chunk-0xjw2vdt.js} +2 -2
  5. package/dist/{chunk-dq0nmept.js → chunk-15qy51py.js} +2 -2
  6. package/dist/{chunk-vekg5zy6.js → chunk-193aw7d6.js} +1 -1
  7. package/dist/{chunk-m8w98p7p.js → chunk-1k5r7bpf.js} +3 -3
  8. package/dist/{chunk-e29deb0h.js → chunk-1mzxq1rg.js} +2 -2
  9. package/dist/{chunk-4sasxrdr.js → chunk-1t77gtcx.js} +2 -2
  10. package/dist/{chunk-6e5dyfx2.js → chunk-2q4d5dqw.js} +4 -4
  11. package/dist/{chunk-x67zh0tr.js → chunk-365k5pgj.js} +2 -2
  12. package/dist/{chunk-cq5zpg9c.js → chunk-3d49h0bx.js} +2 -2
  13. package/dist/{chunk-90jwk3zy.js → chunk-4rsk49xj.js} +2 -2
  14. package/dist/{chunk-02yqpwv0.js → chunk-6b6rt0yh.js} +2 -2
  15. package/dist/{chunk-g2191y9b.js → chunk-6c8nk9rm.js} +4 -4
  16. package/dist/{chunk-013mp499.js → chunk-6ekemc3h.js} +2 -2
  17. package/dist/{chunk-m9b6cqn7.js → chunk-6j4wx5mf.js} +17 -17
  18. package/dist/{chunk-n0tw6p7g.js → chunk-6r01zgys.js} +1 -1
  19. package/dist/{chunk-jkeqyj50.js → chunk-6sdswv08.js} +2 -2
  20. package/dist/chunk-6y728pph.js +3 -0
  21. package/dist/{chunk-k0exaspt.js → chunk-7dmn623d.js} +3 -3
  22. package/dist/{chunk-290jpwny.js → chunk-7pw9ayve.js} +3 -3
  23. package/dist/{chunk-czgjmefa.js → chunk-87mk4nnk.js} +4 -4
  24. package/dist/{chunk-7ryea8wn.js → chunk-8apqea4x.js} +2 -2
  25. package/dist/{chunk-4kv50gfv.js → chunk-8r7rmcz7.js} +5 -5
  26. package/dist/{chunk-3mp0jaa7.js → chunk-8vvryt8p.js} +2 -2
  27. package/dist/{chunk-anr9ncep.js → chunk-990m77vr.js} +2 -2
  28. package/dist/{chunk-5cgpcdsb.js → chunk-9bj73ygx.js} +3 -3
  29. package/dist/{chunk-9wxhpnya.js → chunk-9gdtzkjv.js} +2 -2
  30. package/dist/{chunk-zpvcnc7c.js → chunk-9mdgtq38.js} +2 -2
  31. package/dist/{chunk-kf4sza0n.js → chunk-9xvmk7pg.js} +4 -4
  32. package/dist/{chunk-sbmdk35p.js → chunk-aw6spwvp.js} +2 -2
  33. package/dist/{chunk-xsaw8abt.js → chunk-btcj8fgc.js} +3 -3
  34. package/dist/chunk-bys9tn88.js +3 -0
  35. package/dist/{chunk-fjkswqq2.js → chunk-cdq514ff.js} +1 -1
  36. package/dist/{chunk-dc0059dr.js → chunk-cp8xdvb6.js} +3 -3
  37. package/dist/{chunk-cx4rq49z.js → chunk-d6cwtv8p.js} +2 -2
  38. package/dist/{chunk-a0900w7b.js → chunk-dak0dhnx.js} +2 -2
  39. package/dist/{chunk-4xvx77zs.js → chunk-egmen4qn.js} +5 -5
  40. package/dist/{chunk-kcfc6zg6.js → chunk-fpa2ea8k.js} +3 -3
  41. package/dist/{chunk-t4cdpfrr.js → chunk-g3737b7k.js} +1 -1
  42. package/dist/{chunk-bkrftw1s.js → chunk-g743tp4d.js} +5 -5
  43. package/dist/{chunk-b7g1pyea.js → chunk-gdzqt46g.js} +4 -4
  44. package/dist/{chunk-7xgwvv94.js → chunk-geqq4mmz.js} +2 -2
  45. package/dist/{chunk-cyzr3xat.js → chunk-gwa4hmfa.js} +2 -2
  46. package/dist/{chunk-e4f5kxrh.js → chunk-h28vzayq.js} +2 -2
  47. package/dist/{chunk-1jmwmc2a.js → chunk-h6ddkhyq.js} +2 -2
  48. package/dist/{chunk-xph91r7p.js → chunk-h7nk8ywf.js} +3 -3
  49. package/dist/{chunk-taa77k3y.js → chunk-hbmnkmzb.js} +3 -3
  50. package/dist/{chunk-w60gzzxc.js → chunk-heqx5083.js} +4 -4
  51. package/dist/{chunk-r9gdz351.js → chunk-hkcqbex1.js} +2 -2
  52. package/dist/{chunk-9b0jah2a.js → chunk-j4w3zxc1.js} +2 -2
  53. package/dist/{chunk-937czex4.js → chunk-j67chb8m.js} +2 -2
  54. package/dist/{chunk-0v6vmemf.js → chunk-j7rpp55s.js} +3 -3
  55. package/dist/{chunk-1z9550gn.js → chunk-k8tnz2qd.js} +8 -8
  56. package/dist/{chunk-1y19tmb0.js → chunk-kkshxyex.js} +3 -3
  57. package/dist/{chunk-g9kqk7y0.js → chunk-mph001z4.js} +4 -4
  58. package/dist/{chunk-jwcw24cc.js → chunk-mqv5m22t.js} +4 -4
  59. package/dist/{chunk-9kfzjkd1.js → chunk-msa98cgm.js} +10 -10
  60. package/dist/{chunk-2q641ekp.js → chunk-mzxxgnp8.js} +1 -1
  61. package/dist/chunk-na7saw10.js +2 -0
  62. package/dist/{chunk-ktt2m4eh.js → chunk-nmht3krt.js} +3 -3
  63. package/dist/{chunk-dhzr60ge.js → chunk-nnayqrp5.js} +2 -2
  64. package/dist/{chunk-s6bjmr93.js → chunk-pggbb1c0.js} +2 -2
  65. package/dist/{chunk-xm63aee8.js → chunk-pnfjhm01.js} +2 -2
  66. package/dist/{chunk-8gksa73c.js → chunk-qbk49jz5.js} +3 -3
  67. package/dist/{chunk-19626hwq.js → chunk-r0mj8ky4.js} +2 -2
  68. package/dist/{chunk-m7jndt3v.js → chunk-rc1zpm7f.js} +3 -3
  69. package/dist/{chunk-5mh2gqd4.js → chunk-rymbw083.js} +2 -2
  70. package/dist/{chunk-s9e2a0t7.js → chunk-spdw3tc0.js} +2 -2
  71. package/dist/{chunk-6ekgn7sc.js → chunk-t5nmnzy6.js} +2 -2
  72. package/dist/{chunk-bsj770f8.js → chunk-tgaear7n.js} +4 -4
  73. package/dist/{chunk-rwdcmcx3.js → chunk-v22xpr7j.js} +3 -3
  74. package/dist/{chunk-bj3r4j0a.js → chunk-wvdy228e.js} +4 -4
  75. package/dist/{chunk-b6xcyrnx.js → chunk-x569v6av.js} +3 -3
  76. package/dist/{chunk-asws39qs.js → chunk-xn7p8w2c.js} +10 -10
  77. package/dist/{chunk-4nrrjn7g.js → chunk-ywff3fq9.js} +11 -11
  78. package/dist/{chunk-3e6q952c.js → chunk-z6amkx8m.js} +6 -6
  79. package/dist/{chunk-5ym0xgg0.js → chunk-zp7a7th9.js} +2 -2
  80. package/dist/src/augmentation-graph.js +1 -1
  81. package/dist/src/binding-patterns.js +1 -1
  82. package/dist/src/branded-types.js +1 -1
  83. package/dist/src/bundle-linker.js +1 -1
  84. package/dist/src/bundler.js +1 -1
  85. package/dist/src/cache.js +1 -1
  86. package/dist/src/call-signatures.js +1 -1
  87. package/dist/src/circular.js +1 -1
  88. package/dist/src/compat.js +1 -1
  89. package/dist/src/computed-keys.js +1 -1
  90. package/dist/src/config.js +1 -1
  91. package/dist/src/dangling-refs.js +1 -1
  92. package/dist/src/declaration-project.js +1 -1
  93. package/dist/src/declaration-publication.js +1 -1
  94. package/dist/src/declaration-references.js +1 -1
  95. package/dist/src/diff.js +1 -1
  96. package/dist/src/docs.js +1 -1
  97. package/dist/src/enum-declarations.js +1 -1
  98. package/dist/src/errors.js +1 -1
  99. package/dist/src/extractor/directives.js +1 -1
  100. package/dist/src/extractor/extract.js +1 -1
  101. package/dist/src/extractor/scanner.js +1 -1
  102. package/dist/src/extractor.js +1 -1
  103. package/dist/src/formats.js +1 -1
  104. package/dist/src/formatter.js +1 -1
  105. package/dist/src/function-properties.js +1 -1
  106. package/dist/src/generator.js +1 -1
  107. package/dist/src/global-types.js +1 -1
  108. package/dist/src/import-sorter.js +1 -1
  109. package/dist/src/incremental.js +1 -1
  110. package/dist/src/index.js +1 -1
  111. package/dist/src/inferred-imports.js +1 -1
  112. package/dist/src/initializer-type-spans.js +1 -1
  113. package/dist/src/logger.js +1 -1
  114. package/dist/src/lsp.js +1 -1
  115. package/dist/src/memory.js +1 -1
  116. package/dist/src/merger.js +1 -1
  117. package/dist/src/module-graph.js +1 -1
  118. package/dist/src/module-references.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/declarations.js +1 -1
  140. package/dist/src/processor/import-usage.js +1 -1
  141. package/dist/src/processor/imports.js +1 -1
  142. package/dist/src/processor/index.js +1 -1
  143. package/dist/src/processor/type-inference.js +1 -1
  144. package/dist/src/processor.js +1 -1
  145. package/dist/src/profiling.js +1 -1
  146. package/dist/src/return-type-scope.js +1 -1
  147. package/dist/src/security.js +1 -1
  148. package/dist/src/source-cache.js +1 -1
  149. package/dist/src/sourcemap.js +1 -1
  150. package/dist/src/stx.js +1 -1
  151. package/dist/src/tracking.js +1 -1
  152. package/dist/src/transformers.js +1 -1
  153. package/dist/src/tree-shaker.js +1 -1
  154. package/dist/src/type-mappings.js +1 -1
  155. package/dist/src/utils.js +1 -1
  156. package/dist/src/value-inference.d.ts +2 -0
  157. package/dist/src/value-inference.js +1 -1
  158. package/dist/src/vue.js +1 -1
  159. package/dist/src/watcher.js +1 -1
  160. package/dist/src/worker-thread.js +1 -1
  161. package/dist/src/worker.js +1 -1
  162. package/dist/src/workspace.js +1 -1
  163. package/native/darwin-arm64/libzig-dtsx.dylib +0 -0
  164. package/native/darwin-x64/libzig-dtsx.dylib +0 -0
  165. package/native/freebsd-x64/libzig-dtsx.so +0 -0
  166. package/native/linux-arm64/libzig-dtsx.so +0 -0
  167. package/native/linux-x64/libzig-dtsx.so +0 -0
  168. package/native/windows-x64/zig-dtsx.dll +0 -0
  169. package/package.json +4 -4
  170. package/dist/chunk-a04yhmwb.js +0 -3
  171. package/dist/chunk-nrb601nx.js +0 -2
  172. package/dist/chunk-zbrj37wa.js +0 -3
@@ -1,31 +1,31 @@
1
1
  // @bun
2
- import{EventEmitter as J}from"events";import w from"process";import D from"process";import N from"process";import B from"process";import S from"process";import H from"tty";import De,{stdin as it,stdout as nt}from"process";import{existsSync as Ue}from"fs";import V from"fs/promises";import U from"os";import A from"path";import b from"process";function M(e){return e.replace(/[<[].+/,"").trim()}function Q(e){let t=/<([^>]+)>/g,s=/\[([^\]]+)\]/g,i=[],o=(c)=>{let r=!1,n=c[1];if(n.startsWith("..."))n=n.slice(3),r=!0;else if(n.endsWith("..."))n=n.slice(0,-3),r=!0;return{required:c[0].startsWith("<"),value:n.trim(),variadic:r}},a;while(a=t.exec(e))i.push(o(a));let h;while(h=s.exec(e))i.push(o(h));return i}function X(e){let t={alias:{},boolean:[]};for(let[s,i]of e.entries()){if(i.names.length>1)t.alias[i.names[0]]=i.names.slice(1);if(i.isBoolean)if(i.negated){if(!e.some((a,h)=>h!==s&&a.names.some((c)=>i.names.includes(c))&&typeof a.required==="boolean"))t.boolean.push(i.names[0])}else t.boolean.push(i.names[0])}return t}function W(e){return e.reduce((t,s)=>t.length>=s.length?t:s,"")}function k(e,t){return e.length>=t?e:`${e}${" ".repeat(t-e.length)}`}function E(e){return e.replace(/([a-z])-([a-z])/g,(t,s,i)=>s+i.toUpperCase())}function Z(e,t,s){let i=0,o=t.length,a=e,h;for(;i<o;++i)h=a[t[i]],a=a[t[i]]=i===o-1?s:h!=null?h:!!~t[i+1].indexOf(".")||!(+t[i+1]>-1)?{}:[]}function ee(e,t){for(let s of Object.keys(t)){let i=t[s];if(e[s]===void 0)continue;if(i.shouldTransform){if(e[s]=Array.prototype.concat.call([],e[s]),typeof i.transformFunction==="function")e[s]=e[s].map(i.transformFunction)}}}function te(e){let t=/([^\\/]+)$/.exec(e);return t?t[1]:""}function _(e){return e.split(".").map((t,s)=>s===0?E(t):t).join(".")}class I extends Error{exitCode=2;isUsageError=!0;usage;constructor(e,t){super(e);if(this.name=this.constructor.name,t!==void 0)this.usage=t;if(typeof Error.captureStackTrace==="function")Error.captureStackTrace(this,this.constructor);else this.stack=Error(e).stack}format(e=!1){if(e&&this.stack)return`${this.message}
2
+ import{existsSync as J}from"fs";import k from"fs/promises";import D from"os";import V from"path";import b from"process";class W{configPath;config=null;events=[];retryCount=0;maxRetries=3;retryDelayMs=1000;constructor(){let e=D.homedir(),t=V.join(e,".config","clapp");this.configPath=V.join(t,"telemetry.json")}async isEnabled(){if(b.env.DO_NOT_TRACK==="1"||b.env.DO_NOT_TRACK==="true")return!1;if(b.env.NO_TELEMETRY==="1"||b.env.NO_TELEMETRY==="true")return!1;return(await this.loadConfig()).enabled}async enable(){let e=await this.loadConfig();if(e.enabled=!0,!e.userId)e.userId=this.generateUserId();await this.saveConfig(e)}async disable(){let e=await this.loadConfig();e.enabled=!1,await this.saveConfig(e)}async track(e,t){if(!await this.isEnabled())return;let i={event:e,...t,timestamp:Date.now(),platform:D.platform(),nodeVersion:b.version};if(this.events.push(i),this.events.length>=10)await this.send()}async trackCommand(e,t){await this.track("command",{command:e,duration:t})}async trackError(e,t){await this.track("error",{error:e,command:t})}async send(){if(!await this.isEnabled()||this.events.length===0)return!0;try{this.events=[],this.retryCount=0;let t=await this.loadConfig();return t.lastSent=Date.now(),await this.saveConfig(t),!0}catch{if(this.retryCount<this.maxRetries){this.retryCount++;let t=this.retryDelayMs*2**(this.retryCount-1);return await this.sleep(t),this.send()}return this.events=[],this.retryCount=0,!1}}async flush(){if(this.events.length===0)return!0;return this.send()}sleep(e){return new Promise((t)=>setTimeout(t,e))}async status(){let e=await this.loadConfig();return{enabled:e.enabled,doNotTrack:b.env.DO_NOT_TRACK==="1"||b.env.DO_NOT_TRACK==="true",eventsQueued:this.events.length,lastSent:e.lastSent}}async loadConfig(){if(this.config)return this.config;try{if(J(this.configPath)){let e=await k.readFile(this.configPath,"utf-8");return this.config=JSON.parse(e),this.config}}catch{}return this.config={enabled:!1},this.config}async saveConfig(e){this.config=e;try{let t=V.dirname(this.configPath);await k.mkdir(t,{recursive:!0}),await k.writeFile(this.configPath,JSON.stringify(e,null,2),"utf-8")}catch{}}generateUserId(){let e=Math.random().toString(36).substring(2,15),t=Date.now().toString(36);return`${e}-${t}`}}var Q=new W;import{EventEmitter as X}from"events";import w from"process";import P from"process";import N from"process";import B from"process";import S from"process";import G from"tty";import Pe,{stdin as ht,stdout as mt}from"process";function M(e){return e.replace(/[<[].+/,"").trim()}function Z(e){let t=/<([^>]+)>/g,s=/\[([^\]]+)\]/g,i=[],o=(c)=>{let r=!1,n=c[1];if(n.startsWith("..."))n=n.slice(3),r=!0;else if(n.endsWith("..."))n=n.slice(0,-3),r=!0;return{required:c[0].startsWith("<"),value:n.trim(),variadic:r}},a;while(a=t.exec(e))i.push(o(a));let h;while(h=s.exec(e))i.push(o(h));return i}function ee(e){let t={alias:{},boolean:[]};for(let[s,i]of e.entries()){if(i.names.length>1)t.alias[i.names[0]]=i.names.slice(1);if(i.isBoolean)if(i.negated){if(!e.some((a,h)=>h!==s&&a.names.some((c)=>i.names.includes(c))&&typeof a.required==="boolean"))t.boolean.push(i.names[0])}else t.boolean.push(i.names[0])}return t}function F(e){return e.reduce((t,s)=>t.length>=s.length?t:s,"")}function A(e,t){return e.length>=t?e:`${e}${" ".repeat(t-e.length)}`}function E(e){return e.replace(/([a-z])-([a-z])/g,(t,s,i)=>s+i.toUpperCase())}function te(e,t,s){let i=0,o=t.length,a=e,h;for(;i<o;++i)h=a[t[i]],a=a[t[i]]=i===o-1?s:h!=null?h:!!~t[i+1].indexOf(".")||!(+t[i+1]>-1)?{}:[]}function se(e,t){for(let s of Object.keys(t)){let i=t[s];if(e[s]===void 0)continue;if(i.shouldTransform){if(e[s]=Array.prototype.concat.call([],e[s]),typeof i.transformFunction==="function")e[s]=e[s].map(i.transformFunction)}}}function ie(e){let t=/([^\\/]+)$/.exec(e);return t?t[1]:""}function _(e){return e.split(".").map((t,s)=>s===0?E(t):t).join(".")}class I extends Error{exitCode=2;isUsageError=!0;usage;constructor(e,t){super(e);if(this.name=this.constructor.name,t!==void 0)this.usage=t;if(typeof Error.captureStackTrace==="function")Error.captureStackTrace(this,this.constructor);else this.stack=Error(e).stack}format(e=!1){if(e&&this.stack)return`${this.message}
3
3
 
4
4
  Stack trace:
5
- ${this.stack}`;return this.message}}function se(e){if(e instanceof I)return!0;return!!e&&typeof e==="object"&&e.name==="ClappError"&&typeof e.message==="string"}function ie(){let{env:e}=D,{TERM:t,TERM_PROGRAM:s}=e;if(D.platform!=="win32")return t!=="linux";return Boolean(e.WT_SESSION)||Boolean(e.TERMINUS_SUBLIME)||e.ConEmuTask==="{cmd::Cmder}"||s==="Terminus-Sublime"||s==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var T="\x1B",g=`${T}[`;var P={to(e,t){if(!t)return`${g}${e+1}G`;return`${g}${t+1};${e+1}H`},move(e,t){let s="";if(e<0)s+=`${g}${-e}D`;else if(e>0)s+=`${g}${e}C`;if(t<0)s+=`${g}${-t}A`;else if(t>0)s+=`${g}${t}B`;return s},up:(e=1)=>`${g}${e}A`,down:(e=1)=>`${g}${e}B`,forward:(e=1)=>`${g}${e}C`,backward:(e=1)=>`${g}${e}D`,nextLine:(e=1)=>`${g}E`.repeat(e),prevLine:(e=1)=>`${g}F`.repeat(e),left:`${g}G`,hide:`${g}?25l`,show:`${g}?25h`,save:`${T}7`,restore:`${T}8`};var ze={screen:`${g}2J`,up:(e=1)=>`${g}1J`.repeat(e),down:(e=1)=>`${g}J`.repeat(e),line:`${g}2K`,lineEnd:`${g}K`,lineStart:`${g}1K`,lines(e){let t="";for(let s=0;s<e;s++)t+=this.line+(s<e-1?P.up():"");if(e)t+=P.left;return t}},Ye={screen:`${T}c`};function ne(e,t){let s=[];for(let i=0;i<=t.length;i++)s[i]=[i];for(let i=0;i<=e.length;i++)s[0][i]=i;for(let i=1;i<=t.length;i++)for(let o=1;o<=e.length;o++)if(t.charAt(i-1)===e.charAt(o-1))s[i][o]=s[i-1][o-1];else s[i][o]=Math.min(s[i-1][o-1]+1,s[i][o-1]+1,s[i-1][o]+1);return s[t.length][e.length]}function G(e,t,s=2,i=3){return t.map((o)=>({cmd:o,distance:ne(e,o)})).filter(({distance:o})=>o<=s).sort((o,a)=>o.distance-a.distance).slice(0,i).map(({cmd:o})=>o)}function re(e,t={}){let s={_:[]},i=t.alias||{},o=new Set(t.boolean||[]),a={};for(let r of Object.keys(i))for(let n of i[r])a[n]=r;for(let r of o)if(i[r])for(let n of i[r])o.add(n);function h(r,n){if(r===void 0)return n;if(typeof n==="boolean")return n;return Array.isArray(r)?[...r,n]:[r,n]}function c(r,n){let u=a[r]||r,m=h(s[u],n);if(s[u]=m,i[u])for(let l of i[u])s[l]=m;if(a[r]&&i[a[r]])for(let l of i[a[r]])s[l]=m;s[r]=m}for(let r=0;r<e.length;r++){let n=e[r];if(n==="--"){s._.push(...e.slice(r+1));break}if(n.startsWith("--")){let u=n.indexOf("=");if(u!==-1){let m=E(n.slice(2,u)),l=n.slice(u+1);c(m,l)}else{let m=n.slice(2);if(m.startsWith("no-")){let f=E(m.slice(3));c(f,!1);continue}let l=E(m),v=a[l]||l;if(o.has(v)||o.has(l))c(l,!0);else{let f=e[r+1];if(f!==void 0&&!f.startsWith("-"))c(l,f),r++;else c(l,!0)}}}else if(n.startsWith("-")&&n.length>1){let u=n.slice(1);for(let m=0;m<u.length;m++){let l=u[m],v=a[l]||l;if(m===u.length-1&&!o.has(v)&&!o.has(l)){let f=e[r+1];if(f!==void 0&&!f.startsWith("-"))c(l,f),r++;else c(l,!0)}else c(l,!0)}}else s._.push(n)}return s}class K{rawName;description;name;names;isBoolean;required;config;negated;variadic;constructor(e,t,s){if(this.rawName=e,this.description=t,this.config=Object.assign({},s),e=e.replace(/\.\*/g,""),this.negated=!1,this.variadic=/[<[](?:\.\.\.[^\]>]+|[^\]>]+\.\.\.)[\]>]/.test(e),this.names=M(e).split(",").map((i)=>{let o=i.trim().replace(/^-{1,2}/,"");if(o.startsWith("no-"))this.negated=!0,o=o.replace(/^no-/,"");return _(o)}).sort((i,o)=>i.length>o.length?1:-1),this.name=this.names[this.names.length-1],this.negated&&this.config.default==null)this.config.default=!0;if(e.includes("<"))this.required=!0;else if(e.includes("["))this.required=!1;else this.isBoolean=!0}}var Qe=N.argv,oe=`${N.platform}-${N.arch} bun-v${typeof Bun<"u"?Bun.version:"unknown"}`,F=B.argv,ae=`${B.platform}-${B.arch} node-${B.version}`;class R{rawName;description;config;cli;options;aliasNames;name;namespace;args;commandAction;usageText;versionNumber;examples;helpCallback;globalCommand;beforeHooks;afterHooks;middleware;constructor(e,t,s,i){this.rawName=e,this.description=t,this.config=s,this.cli=i,this.options=[],this.aliasNames=[],this.name=M(e);let o=M(e),a=o.indexOf(":");if(a>0)this.namespace=o.substring(0,a),this.name=o.substring(a+1);if(this.args=Q(e),this.examples=[],this.beforeHooks=[],this.afterHooks=[],this.middleware=[],!s)this.config={}}usage(e){return this.usageText=e,this}allowUnknownOptions(){return this.config.allowUnknownOptions=!0,this}ignoreOptionDefaultValue(){return this.config.ignoreOptionDefaultValue=!0,this}version(e,t="-v, --version"){return this.versionNumber=e,this.option(t,"Display version number"),this}example(e){return this.examples.push(e),this}option(e,t,s){let i=new K(e,t,s);return this.options.push(i),this}alias(e){return this.aliasNames.push(e),this}action(e){return this.commandAction=e,this}before(e){return this.beforeHooks.push(e),this}after(e){return this.afterHooks.push(e),this}use(e){return this.middleware.push(e),this}isMatched(e){if(this.aliasNames.includes(e))return!0;if(this.namespace)return`${this.namespace}:${this.name}`===e;return this.name===e}get isDefaultCommand(){return this.name===""||this.aliasNames.includes("!")}get isGlobalCommand(){return this instanceof j}get displayName(){return this.namespace?`${this.namespace}:${this.name}`:this.name}hasOption(e){let t=_(e.split(".")[0]);return!!this.options.find((s)=>s.names.some((i)=>_(i)===t))}outputHelp(){let{name:e,commands:t}=this.cli,{versionNumber:s,options:i,helpCallback:o}=this.cli.globalCommand,a=[{body:`${e}${s?`/${s}`:""}`}];if(a.push({title:"Usage",body:` $ ${e} ${this.usageText||this.rawName}`}),(this.isGlobalCommand||this.isDefaultCommand)&&t.length>0){let n=W(t.map((f)=>f.rawName)),u=new Map,m=[];for(let f of t)if(f.namespace){if(!u.has(f.namespace))u.set(f.namespace,[]);u.get(f.namespace).push(f)}else m.push(f);let l="";if(m.sort((f,O)=>f.rawName<O.rawName?-1:f.rawName>O.rawName?1:0),m.length>0)l+=m.map((f)=>` ${k(f.rawName,n.length)} ${f.description}`).join(`
5
+ ${this.stack}`;return this.message}}function ne(e){if(e instanceof I)return!0;return!!e&&typeof e==="object"&&e.name==="ClappError"&&typeof e.message==="string"}function re(){let{env:e}=P,{TERM:t,TERM_PROGRAM:s}=e;if(P.platform!=="win32")return t!=="linux";return Boolean(e.WT_SESSION)||Boolean(e.TERMINUS_SUBLIME)||e.ConEmuTask==="{cmd::Cmder}"||s==="Terminus-Sublime"||s==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var T="\x1B",g=`${T}[`;var H={to(e,t){if(!t)return`${g}${e+1}G`;return`${g}${t+1};${e+1}H`},move(e,t){let s="";if(e<0)s+=`${g}${-e}D`;else if(e>0)s+=`${g}${e}C`;if(t<0)s+=`${g}${-t}A`;else if(t>0)s+=`${g}${t}B`;return s},up:(e=1)=>`${g}${e}A`,down:(e=1)=>`${g}${e}B`,forward:(e=1)=>`${g}${e}C`,backward:(e=1)=>`${g}${e}D`,nextLine:(e=1)=>`${g}E`.repeat(e),prevLine:(e=1)=>`${g}F`.repeat(e),left:`${g}G`,hide:`${g}?25l`,show:`${g}?25h`,save:`${T}7`,restore:`${T}8`};var st={screen:`${g}2J`,up:(e=1)=>`${g}1J`.repeat(e),down:(e=1)=>`${g}J`.repeat(e),line:`${g}2K`,lineEnd:`${g}K`,lineStart:`${g}1K`,lines(e){let t="";for(let s=0;s<e;s++)t+=this.line+(s<e-1?H.up():"");if(e)t+=H.left;return t}},it={screen:`${T}c`};function oe(e,t){let s=[];for(let i=0;i<=t.length;i++)s[i]=[i];for(let i=0;i<=e.length;i++)s[0][i]=i;for(let i=1;i<=t.length;i++)for(let o=1;o<=e.length;o++)if(t.charAt(i-1)===e.charAt(o-1))s[i][o]=s[i-1][o-1];else s[i][o]=Math.min(s[i-1][o-1]+1,s[i][o-1]+1,s[i-1][o]+1);return s[t.length][e.length]}function K(e,t,s=2,i=3){return t.map((o)=>({cmd:o,distance:oe(e,o)})).filter(({distance:o})=>o<=s).sort((o,a)=>o.distance-a.distance).slice(0,i).map(({cmd:o})=>o)}function ae(e,t={}){let s={_:[]},i=t.alias||{},o=new Set(t.boolean||[]),a={};for(let r of Object.keys(i))for(let n of i[r])a[n]=r;for(let r of o)if(i[r])for(let n of i[r])o.add(n);function h(r,n){if(r===void 0)return n;if(typeof n==="boolean")return n;return Array.isArray(r)?[...r,n]:[r,n]}function c(r,n){let u=a[r]||r,m=h(s[u],n);if(s[u]=m,i[u])for(let l of i[u])s[l]=m;if(a[r]&&i[a[r]])for(let l of i[a[r]])s[l]=m;s[r]=m}for(let r=0;r<e.length;r++){let n=e[r];if(n==="--"){s._.push(...e.slice(r+1));break}if(n.startsWith("--")){let u=n.indexOf("=");if(u!==-1){let m=E(n.slice(2,u)),l=n.slice(u+1);c(m,l)}else{let m=n.slice(2);if(m.startsWith("no-")){let f=E(m.slice(3));c(f,!1);continue}let l=E(m),v=a[l]||l;if(o.has(v)||o.has(l))c(l,!0);else{let f=e[r+1];if(f!==void 0&&!f.startsWith("-"))c(l,f),r++;else c(l,!0)}}}else if(n.startsWith("-")&&n.length>1){let u=n.slice(1);for(let m=0;m<u.length;m++){let l=u[m],v=a[l]||l;if(m===u.length-1&&!o.has(v)&&!o.has(l)){let f=e[r+1];if(f!==void 0&&!f.startsWith("-"))c(l,f),r++;else c(l,!0)}else c(l,!0)}}else s._.push(n)}return s}class q{rawName;description;name;names;isBoolean;required;config;negated;variadic;constructor(e,t,s){if(this.rawName=e,this.description=t,this.config=Object.assign({},s),e=e.replace(/\.\*/g,""),this.negated=!1,this.variadic=/[<[](?:\.\.\.[^\]>]+|[^\]>]+\.\.\.)[\]>]/.test(e),this.names=M(e).split(",").map((i)=>{let o=i.trim().replace(/^-{1,2}/,"");if(o.startsWith("no-"))this.negated=!0,o=o.replace(/^no-/,"");return _(o)}).sort((i,o)=>i.length>o.length?1:-1),this.name=this.names[this.names.length-1],this.negated&&this.config.default==null)this.config.default=!0;if(e.includes("<"))this.required=!0;else if(e.includes("["))this.required=!1;else this.isBoolean=!0}}var rt=N.argv,le=`${N.platform}-${N.arch} bun-v${typeof Bun<"u"?Bun.version:"unknown"}`,U=B.argv,ue=`${B.platform}-${B.arch} node-${B.version}`;class R{rawName;description;config;cli;options;aliasNames;name;namespace;args;commandAction;usageText;versionNumber;examples;helpCallback;globalCommand;beforeHooks;afterHooks;middleware;constructor(e,t,s,i){this.rawName=e,this.description=t,this.config=s,this.cli=i,this.options=[],this.aliasNames=[],this.name=M(e);let o=M(e),a=o.indexOf(":");if(a>0)this.namespace=o.substring(0,a),this.name=o.substring(a+1);if(this.args=Z(e),this.examples=[],this.beforeHooks=[],this.afterHooks=[],this.middleware=[],!s)this.config={}}usage(e){return this.usageText=e,this}allowUnknownOptions(){return this.config.allowUnknownOptions=!0,this}ignoreOptionDefaultValue(){return this.config.ignoreOptionDefaultValue=!0,this}version(e,t="-v, --version"){return this.versionNumber=e,this.option(t,"Display version number"),this}example(e){return this.examples.push(e),this}option(e,t,s){let i=new q(e,t,s);return this.options.push(i),this}alias(e){return this.aliasNames.push(e),this}action(e){return this.commandAction=e,this}before(e){return this.beforeHooks.push(e),this}after(e){return this.afterHooks.push(e),this}use(e){return this.middleware.push(e),this}isMatched(e){if(this.aliasNames.includes(e))return!0;if(this.namespace)return`${this.namespace}:${this.name}`===e;return this.name===e}get isDefaultCommand(){return this.name===""||this.aliasNames.includes("!")}get isGlobalCommand(){return this instanceof j}get displayName(){return this.namespace?`${this.namespace}:${this.name}`:this.name}hasOption(e){let t=_(e.split(".")[0]);return!!this.options.find((s)=>s.names.some((i)=>_(i)===t))}outputHelp(){let{name:e,commands:t}=this.cli,{versionNumber:s,options:i,helpCallback:o}=this.cli.globalCommand,a=[{body:`${e}${s?`/${s}`:""}`}];if(a.push({title:"Usage",body:` $ ${e} ${this.usageText||this.rawName}`}),(this.isGlobalCommand||this.isDefaultCommand)&&t.length>0){let n=F(t.map((f)=>f.rawName)),u=new Map,m=[];for(let f of t)if(f.namespace){if(!u.has(f.namespace))u.set(f.namespace,[]);u.get(f.namespace).push(f)}else m.push(f);let l="";if(m.sort((f,O)=>f.rawName<O.rawName?-1:f.rawName>O.rawName?1:0),m.length>0)l+=m.map((f)=>` ${A(f.rawName,n.length)} ${f.description}`).join(`
6
6
  `);let v=Array.from(u.keys()).sort();for(let f of v){let O=u.get(f);if(l.length>0)l+=`
7
7
 
8
8
  `;l+=` ${f}:
9
- `,l+=O.map((L)=>` ${k(L.rawName,n.length-2)} ${L.description}`).join(`
10
- `)}a.push({title:"Commands",body:l}),a.push({body:`Run \`${e} <command> --help\` for command details.`})}let c=new Set(this.options.flatMap((n)=>n.names)),r=this.isGlobalCommand?i:[...this.options,...(i||[]).filter((n)=>!n.names.some((u)=>c.has(u)))];if(!this.isGlobalCommand&&!this.isDefaultCommand)r=r.filter((n)=>n.name!=="version");if(r.length>0){let n=W(r.map((u)=>u.rawName));a.push({title:"Options",body:r.map((u)=>` ${k(u.rawName,n.length)} ${u.description} ${u.config.default===void 0?"":`(default: ${u.config.default})`}`).join(`
9
+ `,l+=O.map((L)=>` ${A(L.rawName,n.length-2)} ${L.description}`).join(`
10
+ `)}a.push({title:"Commands",body:l}),a.push({body:`Run \`${e} <command> --help\` for command details.`})}let c=new Set(this.options.flatMap((n)=>n.names)),r=this.isGlobalCommand?i:[...this.options,...(i||[]).filter((n)=>!n.names.some((u)=>c.has(u)))];if(!this.isGlobalCommand&&!this.isDefaultCommand)r=r.filter((n)=>n.name!=="version");if(r.length>0){let n=F(r.map((u)=>u.rawName));a.push({title:"Options",body:r.map((u)=>` ${A(u.rawName,n.length)} ${u.description} ${u.config.default===void 0?"":`(default: ${u.config.default})`}`).join(`
11
11
  `)})}if(this.examples.length>0)a.push({title:"Examples",body:this.examples.map((n)=>{if(typeof n==="function")return n(e);return n}).join(`
12
12
  `)});if(o)a=o(a)||a;console.log(a.map((n)=>n.title?`${n.title}:
13
13
  ${n.body}`:n.body).join(`
14
14
 
15
- `))}outputVersion(){let{name:e}=this.cli,{versionNumber:t}=this.cli.globalCommand;if(t)console.log(`${e}/${t} ${typeof Bun<"u"?oe:ae}`)}get usageLine(){return`$ ${this.cli.name} ${this.usageText||this.rawName}`}checkRequiredArgs(){let e=this.args.filter((t)=>t.required).length;if(this.cli.args.length<e){let s=this.args.filter((o)=>o.required).slice(this.cli.args.length),i=s.map((o)=>`<${o.value}>`).join(" ");throw new I(`Missing required argument${s.length>1?"s":""}: ${i}
15
+ `))}outputVersion(){let{name:e}=this.cli,{versionNumber:t}=this.cli.globalCommand;if(t)console.log(`${e}/${t} ${typeof Bun<"u"?le:ue}`)}get usageLine(){return`$ ${this.cli.name} ${this.usageText||this.rawName}`}checkRequiredArgs(){let e=this.args.filter((t)=>t.required).length;if(this.cli.args.length<e){let s=this.args.filter((o)=>o.required).slice(this.cli.args.length),i=s.map((o)=>`<${o.value}>`).join(" ");throw new I(`Missing required argument${s.length>1?"s":""}: ${i}
16
16
 
17
- Run \`${this.cli.name} ${this.rawName} --help\` for usage information.`,this.usageLine)}}checkUnknownOptions(){let{options:e,globalCommand:t}=this.cli;if(!this.config.allowUnknownOptions){for(let s of Object.keys(e))if(s!=="--"&&!this.hasOption(s)&&!t.hasOption(s)){let o=[...t.options,...this.options].flatMap((n)=>n.names),a=_(s.split(".")[0]),h=s.length>1?`--${s}`:`-${s}`,c=G(a,o),r=`Unknown option \`${h}\``;if(c.length>0)r+=`
17
+ Run \`${this.cli.name} ${this.rawName} --help\` for usage information.`,this.usageLine)}}checkUnknownOptions(){let{options:e,globalCommand:t}=this.cli;if(!this.config.allowUnknownOptions){for(let s of Object.keys(e))if(s!=="--"&&!this.hasOption(s)&&!t.hasOption(s)){let o=[...t.options,...this.options].flatMap((n)=>n.names),a=_(s.split(".")[0]),h=s.length>1?`--${s}`:`-${s}`,c=K(a,o),r=`Unknown option \`${h}\``;if(c.length>0)r+=`
18
18
 
19
19
  Did you mean one of these?`,c.forEach((n)=>{let u=n.length>1?`--${n}`:`-${n}`;r+=`
20
20
  \u2022 ${u}`});throw r+=`
21
21
 
22
22
  Run \`${this.cli.name} ${this.rawName} --help\` to see available options.`,new I(r,this.usageLine)}}}checkOptionValue(){let{options:e,globalCommand:t}=this.cli,s=[...t.options,...this.options];for(let i of s){let o=e[i.name.split(".")[0]];if(i.required){let a=s.some((h)=>h.negated&&h.names.includes(i.name));if(o===!0||o===!1&&!a)throw new I(`Option \`${i.rawName}\` requires a value.
23
23
 
24
- Example: ${this.cli.name} ${this.rawName} ${i.rawName} <value>`,this.usageLine)}}}}class j extends R{constructor(e){super("@@global@@","",{},e)}}var le=R,y={red:["\x1B[31m","\x1B[39m"],green:["\x1B[32m","\x1B[39m"],blue:["\x1B[34m","\x1B[39m"],yellow:["\x1B[33m","\x1B[39m"],cyan:["\x1B[36m","\x1B[39m"],magenta:["\x1B[35m","\x1B[39m"],white:["\x1B[37m","\x1B[39m"],gray:["\x1B[90m","\x1B[39m"],bgRed:["\x1B[41m","\x1B[49m"],bgGreen:["\x1B[42m","\x1B[49m"],bgBlue:["\x1B[44m","\x1B[49m"],bgYellow:["\x1B[43m","\x1B[49m"],bgCyan:["\x1B[46m","\x1B[49m"],bgMagenta:["\x1B[45m","\x1B[49m"],bold:["\x1B[1m","\x1B[22m"],italic:["\x1B[3m","\x1B[23m"],underline:["\x1B[4m","\x1B[24m"],dim:["\x1B[2m","\x1B[22m"],inverse:["\x1B[7m","\x1B[27m"],hidden:["\x1B[8m","\x1B[28m"],strikethrough:["\x1B[9m","\x1B[29m"]};var x={primary:"blue",secondary:"cyan",success:"green",warning:"yellow",error:"red",info:"magenta",muted:"gray"};function ue(){return!0}function ce(){let e={};e.supportsColor=ue();function t(i,o=[]){let a=i===""?[]:[...o,i],h=function(r){if(!e.supportsColor)return r;let n="",u="";for(let m of a)if(m in x&&x[m]in y){let l=x[m];n+=y[l][0],u=y[l][1]+u}else if(m in y)n+=y[m][0],u=y[m][1]+u;return n+r+u},c=[...Object.keys(y),...Object.keys(x)];for(let r of c)if(!(r in h))Object.defineProperty(h,r,{get(){return t(r,a)}});return h}let s=[...Object.keys(y),...Object.keys(x)];for(let i of s)if(!(i in e))Object.defineProperty(e,i,{get(){return t(i)}});return e}var C=ce();class he extends J{name;commands;globalCommand;matchedCommand;matchedCommandName;rawArgs;args;options;showHelpOnExit;showVersionOnExit;enableDidYouMean=!0;signalHandlersSet=!1;isVerbose=!1;isQuiet=!1;isDebug=!1;isNoInteraction=!1;environment;isDryRun=!1;isForce=!1;useEmoji=!0;theme;isNoCache=!1;constructor(e=""){super();this.name=e,this.commands=[],this.rawArgs=[],this.args=[],this.options={},this.globalCommand=new j(this),this.globalCommand.usage("<command> [options]")}handleSignals(e){if(this.signalHandlersSet)return this;let t=async(s)=>{if(console.log(`
24
+ Example: ${this.cli.name} ${this.rawName} ${i.rawName} <value>`,this.usageLine)}}}}class j extends R{constructor(e){super("@@global@@","",{},e)}}var ce=R,y={red:["\x1B[31m","\x1B[39m"],green:["\x1B[32m","\x1B[39m"],blue:["\x1B[34m","\x1B[39m"],yellow:["\x1B[33m","\x1B[39m"],cyan:["\x1B[36m","\x1B[39m"],magenta:["\x1B[35m","\x1B[39m"],white:["\x1B[37m","\x1B[39m"],gray:["\x1B[90m","\x1B[39m"],bgRed:["\x1B[41m","\x1B[49m"],bgGreen:["\x1B[42m","\x1B[49m"],bgBlue:["\x1B[44m","\x1B[49m"],bgYellow:["\x1B[43m","\x1B[49m"],bgCyan:["\x1B[46m","\x1B[49m"],bgMagenta:["\x1B[45m","\x1B[49m"],bold:["\x1B[1m","\x1B[22m"],italic:["\x1B[3m","\x1B[23m"],underline:["\x1B[4m","\x1B[24m"],dim:["\x1B[2m","\x1B[22m"],inverse:["\x1B[7m","\x1B[27m"],hidden:["\x1B[8m","\x1B[28m"],strikethrough:["\x1B[9m","\x1B[29m"]};var x={primary:"blue",secondary:"cyan",success:"green",warning:"yellow",error:"red",info:"magenta",muted:"gray"};function he(){return!0}function me(){let e={};e.supportsColor=he();function t(i,o=[]){let a=i===""?[]:[...o,i],h=function(r){if(!e.supportsColor)return r;let n="",u="";for(let m of a)if(m in x&&x[m]in y){let l=x[m];n+=y[l][0],u=y[l][1]+u}else if(m in y)n+=y[m][0],u=y[m][1]+u;return n+r+u},c=[...Object.keys(y),...Object.keys(x)];for(let r of c)if(!(r in h))Object.defineProperty(h,r,{get(){return t(r,a)}});return h}let s=[...Object.keys(y),...Object.keys(x)];for(let i of s)if(!(i in e))Object.defineProperty(e,i,{get(){return t(i)}});return e}var C=me();class fe extends X{name;commands;globalCommand;matchedCommand;matchedCommandName;rawArgs;args;options;showHelpOnExit;showVersionOnExit;enableDidYouMean=!0;signalHandlersSet=!1;isVerbose=!1;isQuiet=!1;isDebug=!1;isNoInteraction=!1;environment;isDryRun=!1;isForce=!1;useEmoji=!0;theme;isNoCache=!1;constructor(e=""){super();this.name=e,this.commands=[],this.rawArgs=[],this.args=[],this.options={},this.globalCommand=new j(this),this.globalCommand.usage("<command> [options]")}handleSignals(e){if(this.signalHandlersSet)return this;let t=async(s)=>{if(console.log(`
25
25
 
26
- Received ${s}, cleaning up...`),e)try{await e()}catch(i){console.error("Error during cleanup:",i)}w.exit(0)};return w.on("SIGINT",()=>t("SIGINT")),w.on("SIGTERM",()=>t("SIGTERM")),this.signalHandlersSet=!0,this}didYouMean(e=!0){return this.enableDidYouMean=e,this}verbose(){return this.globalCommand.option("-v, --verbose","Enable verbose output"),this}quiet(){return this.globalCommand.option("-q, --quiet","Suppress non-essential output"),this}debug(){return this.globalCommand.option("--debug","Enable debug mode with detailed error information"),this}noInteraction(){return this.globalCommand.option("-n, --no-interaction","Do not ask any interactive questions (for CI/CD)"),this}env(){return this.globalCommand.option("--env <environment>","Target environment (e.g., production, staging, local)"),this}dryRun(){return this.globalCommand.option("--dry-run","Preview actions without executing them"),this}force(){return this.globalCommand.option("-f, --force","Skip confirmation prompts"),this}emoji(){return this.globalCommand.option("--no-emoji","Disable emoji in output"),this}themes(){return this.globalCommand.option("--theme <theme>","Color theme (default, dracula, nord, solarized, monokai)"),this}cache(){return this.globalCommand.option("--no-cache","Disable caching"),this}usage(e){return this.globalCommand.usage(e),this}command(e,t,s){if(!s)s={};let i=new le(e,t||"",s,this);return i.globalCommand=this.globalCommand,this.commands.push(i),i}option(e,t,s){return this.globalCommand.option(e,t,s),this}help(e){return this.globalCommand.option("-h, --help","Display this message"),this.globalCommand.helpCallback=e,this.showHelpOnExit=!0,this}version(e,t="-v, --version"){return this.globalCommand.version(e,t),this.showVersionOnExit=!0,this}example(e){return this.globalCommand.example(e),this}outputHelp(){if(this.matchedCommand)this.matchedCommand.outputHelp();else this.globalCommand.outputHelp()}outputVersion(){this.globalCommand.outputVersion()}setParsedInfo({args:e,options:t},s,i){if(this.args=e,this.options=t,s)this.matchedCommand=s;if(i)this.matchedCommandName=i;return this}unsetMatchedCommand(){this.matchedCommand=void 0,this.matchedCommandName=void 0}showCommandNotFound(e){if(console.log(C.red(`
26
+ Received ${s}, cleaning up...`),e)try{await e()}catch(i){console.error("Error during cleanup:",i)}w.exit(0)};return w.on("SIGINT",()=>t("SIGINT")),w.on("SIGTERM",()=>t("SIGTERM")),this.signalHandlersSet=!0,this}didYouMean(e=!0){return this.enableDidYouMean=e,this}verbose(){return this.globalCommand.option("-v, --verbose","Enable verbose output"),this}quiet(){return this.globalCommand.option("-q, --quiet","Suppress non-essential output"),this}debug(){return this.globalCommand.option("--debug","Enable debug mode with detailed error information"),this}noInteraction(){return this.globalCommand.option("-n, --no-interaction","Do not ask any interactive questions (for CI/CD)"),this}env(){return this.globalCommand.option("--env <environment>","Target environment (e.g., production, staging, local)"),this}dryRun(){return this.globalCommand.option("--dry-run","Preview actions without executing them"),this}force(){return this.globalCommand.option("-f, --force","Skip confirmation prompts"),this}emoji(){return this.globalCommand.option("--no-emoji","Disable emoji in output"),this}themes(){return this.globalCommand.option("--theme <theme>","Color theme (default, dracula, nord, solarized, monokai)"),this}cache(){return this.globalCommand.option("--no-cache","Disable caching"),this}usage(e){return this.globalCommand.usage(e),this}command(e,t,s){if(!s)s={};let i=new ce(e,t||"",s,this);return i.globalCommand=this.globalCommand,this.commands.push(i),i}option(e,t,s){return this.globalCommand.option(e,t,s),this}help(e){return this.globalCommand.option("-h, --help","Display this message"),this.globalCommand.helpCallback=e,this.showHelpOnExit=!0,this}version(e,t="-v, --version"){return this.globalCommand.version(e,t),this.showVersionOnExit=!0,this}example(e){return this.globalCommand.example(e),this}outputHelp(){if(this.matchedCommand)this.matchedCommand.outputHelp();else this.globalCommand.outputHelp()}outputVersion(){this.globalCommand.outputVersion()}setParsedInfo({args:e,options:t},s,i){if(this.args=e,this.options=t,s)this.matchedCommand=s;if(i)this.matchedCommandName=i;return this}unsetMatchedCommand(){this.matchedCommand=void 0,this.matchedCommandName=void 0}showCommandNotFound(e){if(console.log(C.red(`
27
27
  \u2717 Command "${e}" not found.
28
- `)),this.enableDidYouMean){let t=[];for(let i of this.commands){if(i.displayName)t.push(i.displayName);if(i.aliasNames)t.push(...i.aliasNames)}let s=G(e,t);if(s.length>0)console.log(C.yellow("Did you mean one of these?")),s.forEach((i)=>console.log(` ${C.dim("\u2022")} ${this.name} ${i}`)),console.log("")}console.log(C.dim("Run"),`${this.name} --help`,C.dim("to see all available commands")),w.exit(1)}async parse(e=F,t={}){let{run:s=!0,exitOnError:i=!1}=t;if(i)try{return await this.parse(e,{run:s})}catch(r){throw this.handleUsageError(r),r}if(this.rawArgs=e,!this.name)this.name=e[1]?te(e[1]):"cli";let o=!0,a=e.slice(2),h=a[0];if(h&&!h.startsWith("-")){for(let r of this.commands)if(r.isMatched(h)){let n=this.mri(a,r);o=!1;let u={...n,args:n.args.slice(1)};this.setParsedInfo(u,r,h),this.emit(`command:${h}`,r);break}if(o){let r=a[1];if(r&&!r.startsWith("-")){let n=`${h}:${r}`;for(let u of this.commands)if(u.isMatched(n)){let m=this.mri(a,u);o=!1;let l={...m,args:m.args.slice(2)};this.setParsedInfo(l,u,n),this.emit(`command:${n}`,u);break}}}}if(o){for(let r of this.commands)if(r.name===""){o=!1;let n=this.mri(a,r);this.setParsedInfo(n,r),this.emit("command:!",r);break}}if(o){let r=this.mri(e.slice(2));this.setParsedInfo(r)}if(this.options.verbose)this.isVerbose=!0;if(this.options.quiet)this.isQuiet=!0;if(this.options.debug)this.isDebug=!0;if(this.options.noInteraction||this.options.interaction===!1)this.isNoInteraction=!0;if(this.options.env)this.environment=String(this.options.env);if(this.options.dryRun)this.isDryRun=!0;if(this.options.force)this.isForce=!0;if(this.options.noEmoji||this.options.emoji===!1)this.useEmoji=!1;if(this.options.theme)this.theme=String(this.options.theme);if(this.options.noCache||this.options.cache===!1)this.isNoCache=!0;if(this.options.help&&this.showHelpOnExit)this.outputHelp(),s=!1,this.unsetMatchedCommand();if(this.options.version&&this.showVersionOnExit&&this.matchedCommandName==null)this.outputVersion(),s=!1,this.unsetMatchedCommand();let c={args:this.args,options:this.options};if(s)await this.runMatchedCommand();if(!this.matchedCommand&&this.args[0]){if(this.emit("command:*"),!(this.listenerCount("command:*")>0))this.showCommandNotFound(this.args[0])}return c}mri(e,t){let s=[...this.globalCommand.options,...t?t.options:[]],i=X(s),o=[],a=e.indexOf("--");if(a>-1)o=e.slice(a+1),e=e.slice(0,a);let h=re(e,i),c={_:h._};for(let l of Object.keys(h))if(l!=="_")c[_(l)]=h[l];let r=c._,n={"--":o},u=t&&t.config.ignoreOptionDefaultValue?t.config.ignoreOptionDefaultValue:this.globalCommand.config.ignoreOptionDefaultValue,m=Object.create(null);for(let l of s){if(!u&&l.config.default!==void 0)for(let v of l.names)n[v]=l.config.default;if(Array.isArray(l.config.type)){if(m[l.name]===void 0)m[l.name]={shouldTransform:!0,transformFunction:l.config.type[0]}}}for(let l of Object.keys(c))if(l!=="_"){let v=l.split(".");Z(n,v,c[l]),ee(n,m)}for(let l of s){if(!l.variadic)continue;for(let v of l.names){let f=n[v];if(f===void 0||Array.isArray(f))continue;if(l.config.default!==void 0&&f===l.config.default)continue;n[v]=[f]}}return{args:r,options:n}}async run(e=F){return this.parse(e,{run:!0,exitOnError:!0})}handleUsageError(e){if(!se(e)||e.isUsageError===!1)return;let t=e.message||"command-line error",s=this.name?`${this.name}: `:"",i=/--help/.test(t)?"":e.usage?`
28
+ `)),this.enableDidYouMean){let t=[];for(let i of this.commands){if(i.displayName)t.push(i.displayName);if(i.aliasNames)t.push(...i.aliasNames)}let s=K(e,t);if(s.length>0)console.log(C.yellow("Did you mean one of these?")),s.forEach((i)=>console.log(` ${C.dim("\u2022")} ${this.name} ${i}`)),console.log("")}console.log(C.dim("Run"),`${this.name} --help`,C.dim("to see all available commands")),w.exit(1)}async parse(e=U,t={}){let{run:s=!0,exitOnError:i=!1}=t;if(i)try{return await this.parse(e,{run:s})}catch(r){throw this.handleUsageError(r),r}if(this.rawArgs=e,!this.name)this.name=e[1]?ie(e[1]):"cli";let o=!0,a=e.slice(2),h=a[0];if(h&&!h.startsWith("-")){for(let r of this.commands)if(r.isMatched(h)){let n=this.mri(a,r);o=!1;let u={...n,args:n.args.slice(1)};this.setParsedInfo(u,r,h),this.emit(`command:${h}`,r);break}if(o){let r=a[1];if(r&&!r.startsWith("-")){let n=`${h}:${r}`;for(let u of this.commands)if(u.isMatched(n)){let m=this.mri(a,u);o=!1;let l={...m,args:m.args.slice(2)};this.setParsedInfo(l,u,n),this.emit(`command:${n}`,u);break}}}}if(o){for(let r of this.commands)if(r.name===""){o=!1;let n=this.mri(a,r);this.setParsedInfo(n,r),this.emit("command:!",r);break}}if(o){let r=this.mri(e.slice(2));this.setParsedInfo(r)}if(this.options.verbose)this.isVerbose=!0;if(this.options.quiet)this.isQuiet=!0;if(this.options.debug)this.isDebug=!0;if(this.options.noInteraction||this.options.interaction===!1)this.isNoInteraction=!0;if(this.options.env)this.environment=String(this.options.env);if(this.options.dryRun)this.isDryRun=!0;if(this.options.force)this.isForce=!0;if(this.options.noEmoji||this.options.emoji===!1)this.useEmoji=!1;if(this.options.theme)this.theme=String(this.options.theme);if(this.options.noCache||this.options.cache===!1)this.isNoCache=!0;if(this.options.help&&this.showHelpOnExit)this.outputHelp(),s=!1,this.unsetMatchedCommand();if(this.options.version&&this.showVersionOnExit&&this.matchedCommandName==null)this.outputVersion(),s=!1,this.unsetMatchedCommand();let c={args:this.args,options:this.options};if(s)await this.runMatchedCommand();if(!this.matchedCommand&&this.args[0]){if(this.emit("command:*"),!(this.listenerCount("command:*")>0))this.showCommandNotFound(this.args[0])}return c}mri(e,t){let s=[...this.globalCommand.options,...t?t.options:[]],i=ee(s),o=[],a=e.indexOf("--");if(a>-1)o=e.slice(a+1),e=e.slice(0,a);let h=ae(e,i),c={_:h._};for(let l of Object.keys(h))if(l!=="_")c[_(l)]=h[l];let r=c._,n={"--":o},u=t&&t.config.ignoreOptionDefaultValue?t.config.ignoreOptionDefaultValue:this.globalCommand.config.ignoreOptionDefaultValue,m=Object.create(null);for(let l of s){if(!u&&l.config.default!==void 0)for(let v of l.names)n[v]=l.config.default;if(Array.isArray(l.config.type)){if(m[l.name]===void 0)m[l.name]={shouldTransform:!0,transformFunction:l.config.type[0]}}}for(let l of Object.keys(c))if(l!=="_"){let v=l.split(".");te(n,v,c[l]),se(n,m)}for(let l of s){if(!l.variadic)continue;for(let v of l.names){let f=n[v];if(f===void 0||Array.isArray(f))continue;if(l.config.default!==void 0&&f===l.config.default)continue;n[v]=[f]}}return{args:r,options:n}}async run(e=U){return this.parse(e,{run:!0,exitOnError:!0})}handleUsageError(e){if(!ne(e)||e.isUsageError===!1)return;let t=e.message||"command-line error",s=this.name?`${this.name}: `:"",i=/--help/.test(t)?"":e.usage?`
29
29
  Usage: ${e.usage}`:`
30
30
  Run \`${this.name??"cli"} --help\` for usage.`;w.stderr.write(`${s}${t}${i}
31
- `),w.exit(e.exitCode??2)}async runMatchedCommand(){let{args:e,options:t,matchedCommand:s}=this;if(!s||!s.commandAction)return;s.checkUnknownOptions(),s.checkOptionValue(),s.checkRequiredArgs();let i=[];s.args.forEach((c,r)=>{if(c.variadic)i.push(e.slice(r));else i.push(e[r])}),i.push(t);let o={command:s,args:i,options:t};for(let c of s.beforeHooks)await c(o);let a,h=async()=>{let c=s.commandAction.apply(this,i);if(c instanceof Promise)a=await c;else a=c;return a};if(s.middleware.length>0){let c=0,r=async()=>{if(c<s.middleware.length){let n=s.middleware[c++];await n({...o,next:r})}else await h()};await r()}else await h();for(let c of s.afterHooks)await c(o);return a}removeSignalHandlers(){if(!this.signalHandlersSet)return this;return w.removeAllListeners("SIGINT"),w.removeAllListeners("SIGTERM"),this.signalHandlersSet=!1,this}destroy(){this.removeSignalHandlers(),this.commands=[],this.rawArgs=[],this.args=[],this.options={},this.matchedCommand=void 0,this.matchedCommandName=void 0,this.removeAllListeners()}}class q{cache;enabled;cleanupInterval=null;hits=0;misses=0;constructor(){this.cache=new Map,this.enabled=!0,this.startCleanupInterval()}startCleanupInterval(){if(this.cleanupInterval)return;this.cleanupInterval=setInterval(()=>{this.cleanup()},30000),this.cleanupInterval.unref()}stopCleanup(){if(this.cleanupInterval)clearInterval(this.cleanupInterval),this.cleanupInterval=null}isEnabled(){return this.enabled}get(e){if(!this.enabled){this.misses++;return}let t=this.cache.get(e);if(!t){this.misses++;return}if(Date.now()-t.timestamp>t.ttl){this.cache.delete(e),this.misses++;return}return this.hits++,t.value}set(e,t,s=5000){if(!this.enabled)return;this.cache.set(e,{value:t,timestamp:Date.now(),ttl:s})}has(e){if(!this.enabled)return!1;let t=this.cache.get(e);if(!t)return!1;if(Date.now()-t.timestamp>t.ttl)return this.cache.delete(e),!1;return!0}delete(e){this.cache.delete(e)}clear(){this.cache.clear()}disable(){this.enabled=!1,this.clear()}enable(){this.enabled=!0}stats(){return{size:this.cache.size,enabled:this.enabled,hits:this.hits,misses:this.misses}}resetStats(){this.hits=0,this.misses=0}keys(){return Array.from(this.cache.keys())}cleanup(){let e=Date.now();for(let[t,s]of this.cache.entries())if(e-s.timestamp>s.ttl)this.cache.delete(t)}destroy(){this.stopCleanup(),this.clear(),this.resetStats()}}var Ze=new q;function me(){if("FORCE_COLOR"in S.env)return S.env.FORCE_COLOR!=="0";if("NO_COLOR"in S.env||S.env.TERM==="dumb")return!1;if(S.platform==="win32")return!0;return H.isatty(1)&&H.isatty(2)}var z=me();function p(e,t){if(!z)return(s)=>s;return(s)=>e+s+t}var fe=p("\x1B[0m","\x1B[0m"),de=p("\x1B[31m","\x1B[39m"),pe=p("\x1B[32m","\x1B[39m"),ge=p("\x1B[33m","\x1B[39m"),$e=p("\x1B[34m","\x1B[39m"),ve=p("\x1B[35m","\x1B[39m"),we=p("\x1B[36m","\x1B[39m"),ye=p("\x1B[37m","\x1B[39m"),be=p("\x1B[90m","\x1B[39m"),xe=p("\x1B[1m","\x1B[22m"),Ce=p("\x1B[3m","\x1B[23m"),Se=p("\x1B[4m","\x1B[24m"),_e=p("\x1B[2m","\x1B[22m"),Ie=p("\x1B[7m","\x1B[27m"),Oe=p("\x1B[8m","\x1B[28m"),Ee=p("\x1B[9m","\x1B[29m"),Be=p("\x1B[41m","\x1B[49m"),Te=p("\x1B[42m","\x1B[49m"),ke=p("\x1B[43m","\x1B[49m"),Ve=p("\x1B[44m","\x1B[49m"),Ae=p("\x1B[45m","\x1B[49m"),Me=p("\x1B[46m","\x1B[49m"),Ne=p("\x1B[47m","\x1B[49m"),Re=z,je={reset:fe,red:de,green:pe,yellow:ge,blue:$e,magenta:ve,cyan:we,white:ye,gray:be,bold:xe,italic:Ce,underline:Se,dim:_e,inverse:Ie,hidden:Oe,strikethrough:Ee,bgRed:Be,bgGreen:Te,bgYellow:ke,bgBlue:Ve,bgMagenta:Ae,bgCyan:Me,bgWhite:Ne,isColorSupported:Re},Le=je,We=["up","down","left","right","space","enter","cancel"],rt={actions:new Set(We),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"}};var ot=De.platform.startsWith("win"),at=Symbol("clapp:cancel");var Pe=ie();var d=(e,t)=>Pe?e:t,lt=d("\u25C6","*"),ut=d("\u25A0","x"),ct=d("\u25B2","x"),ht=d("\u25C7","o"),mt=d("\u250C","T"),Fe=d("\u2502","|"),ft=d("\u2514","\u2014"),dt=d("\u25CF",">"),pt=d("\u25CB"," "),gt=d("\u25FB","[\u2022]"),$t=d("\u25FC","[+]"),vt=d("\u25FB","[ ]"),wt=d("\u25AA","\u2022"),yt=d("\u2500","-"),bt=d("\u256E","+"),xt=d("\u251C","+"),Ct=d("\u256F","+"),St=d("\u25CF","\u2022"),_t=d("\u25C6","*"),It=d("\u25B2","!"),Ot=d("\u25A0","x");var Et={light:d("\u2500","-"),heavy:d("\u2501","="),block:d("\u2588","#")};function He(){return`${Le.gray(Fe)} `}var Bt=He();class Y{configPath;config=null;events=[];retryCount=0;maxRetries=3;retryDelayMs=1000;constructor(){let e=U.homedir(),t=A.join(e,".config","clapp");this.configPath=A.join(t,"telemetry.json")}async isEnabled(){if(b.env.DO_NOT_TRACK==="1"||b.env.DO_NOT_TRACK==="true")return!1;if(b.env.NO_TELEMETRY==="1"||b.env.NO_TELEMETRY==="true")return!1;return(await this.loadConfig()).enabled}async enable(){let e=await this.loadConfig();if(e.enabled=!0,!e.userId)e.userId=this.generateUserId();await this.saveConfig(e)}async disable(){let e=await this.loadConfig();e.enabled=!1,await this.saveConfig(e)}async track(e,t){if(!await this.isEnabled())return;let i={event:e,...t,timestamp:Date.now(),platform:U.platform(),nodeVersion:b.version};if(this.events.push(i),this.events.length>=10)await this.send()}async trackCommand(e,t){await this.track("command",{command:e,duration:t})}async trackError(e,t){await this.track("error",{error:e,command:t})}async send(){if(!await this.isEnabled()||this.events.length===0)return!0;try{this.events=[],this.retryCount=0;let t=await this.loadConfig();return t.lastSent=Date.now(),await this.saveConfig(t),!0}catch{if(this.retryCount<this.maxRetries){this.retryCount++;let t=this.retryDelayMs*2**(this.retryCount-1);return await this.sleep(t),this.send()}return this.events=[],this.retryCount=0,!1}}async flush(){if(this.events.length===0)return!0;return this.send()}sleep(e){return new Promise((t)=>setTimeout(t,e))}async status(){let e=await this.loadConfig();return{enabled:e.enabled,doNotTrack:b.env.DO_NOT_TRACK==="1"||b.env.DO_NOT_TRACK==="true",eventsQueued:this.events.length,lastSent:e.lastSent}}async loadConfig(){if(this.config)return this.config;try{if(Ue(this.configPath)){let e=await V.readFile(this.configPath,"utf-8");return this.config=JSON.parse(e),this.config}}catch{}return this.config={enabled:!1},this.config}async saveConfig(e){this.config=e;try{let t=A.dirname(this.configPath);await V.mkdir(t,{recursive:!0}),await V.writeFile(this.configPath,JSON.stringify(e,null,2),"utf-8")}catch{}}generateUserId(){let e=Math.random().toString(36).substring(2,15),t=Date.now().toString(36);return`${e}-${t}`}}var Nt=new Y;export{he as CLI};
31
+ `),w.exit(e.exitCode??2)}async runMatchedCommand(){let{args:e,options:t,matchedCommand:s}=this;if(!s||!s.commandAction)return;s.checkUnknownOptions(),s.checkOptionValue(),s.checkRequiredArgs();let i=[];s.args.forEach((c,r)=>{if(c.variadic)i.push(e.slice(r));else i.push(e[r])}),i.push(t);let o={command:s,args:i,options:t};for(let c of s.beforeHooks)await c(o);let a,h=async()=>{let c=s.commandAction.apply(this,i);if(c instanceof Promise)a=await c;else a=c;return a};if(s.middleware.length>0){let c=0,r=async()=>{if(c<s.middleware.length){let n=s.middleware[c++];await n({...o,next:r})}else await h()};await r()}else await h();for(let c of s.afterHooks)await c(o);return a}removeSignalHandlers(){if(!this.signalHandlersSet)return this;return w.removeAllListeners("SIGINT"),w.removeAllListeners("SIGTERM"),this.signalHandlersSet=!1,this}destroy(){this.removeSignalHandlers(),this.commands=[],this.rawArgs=[],this.args=[],this.options={},this.matchedCommand=void 0,this.matchedCommandName=void 0,this.removeAllListeners()}}class z{cache;enabled;cleanupInterval=null;hits=0;misses=0;constructor(){this.cache=new Map,this.enabled=!0,this.startCleanupInterval()}startCleanupInterval(){if(this.cleanupInterval)return;this.cleanupInterval=setInterval(()=>{this.cleanup()},30000),this.cleanupInterval.unref()}stopCleanup(){if(this.cleanupInterval)clearInterval(this.cleanupInterval),this.cleanupInterval=null}isEnabled(){return this.enabled}get(e){if(!this.enabled){this.misses++;return}let t=this.cache.get(e);if(!t){this.misses++;return}if(Date.now()-t.timestamp>t.ttl){this.cache.delete(e),this.misses++;return}return this.hits++,t.value}set(e,t,s=5000){if(!this.enabled)return;this.cache.set(e,{value:t,timestamp:Date.now(),ttl:s})}has(e){if(!this.enabled)return!1;let t=this.cache.get(e);if(!t)return!1;if(Date.now()-t.timestamp>t.ttl)return this.cache.delete(e),!1;return!0}delete(e){this.cache.delete(e)}clear(){this.cache.clear()}disable(){this.enabled=!1,this.clear()}enable(){this.enabled=!0}stats(){return{size:this.cache.size,enabled:this.enabled,hits:this.hits,misses:this.misses}}resetStats(){this.hits=0,this.misses=0}keys(){return Array.from(this.cache.keys())}cleanup(){let e=Date.now();for(let[t,s]of this.cache.entries())if(e-s.timestamp>s.ttl)this.cache.delete(t)}destroy(){this.stopCleanup(),this.clear(),this.resetStats()}}var at=new z;function de(){if("FORCE_COLOR"in S.env)return S.env.FORCE_COLOR!=="0";if("NO_COLOR"in S.env||S.env.TERM==="dumb")return!1;if(S.platform==="win32")return!0;return G.isatty(1)&&G.isatty(2)}var Y=de();function p(e,t){if(!Y)return(s)=>s;return(s)=>e+s+t}var pe=p("\x1B[0m","\x1B[0m"),ge=p("\x1B[31m","\x1B[39m"),$e=p("\x1B[32m","\x1B[39m"),ve=p("\x1B[33m","\x1B[39m"),we=p("\x1B[34m","\x1B[39m"),ye=p("\x1B[35m","\x1B[39m"),be=p("\x1B[36m","\x1B[39m"),xe=p("\x1B[37m","\x1B[39m"),Ce=p("\x1B[90m","\x1B[39m"),Se=p("\x1B[1m","\x1B[22m"),_e=p("\x1B[3m","\x1B[23m"),Ie=p("\x1B[4m","\x1B[24m"),Oe=p("\x1B[2m","\x1B[22m"),Ee=p("\x1B[7m","\x1B[27m"),Be=p("\x1B[8m","\x1B[28m"),Te=p("\x1B[9m","\x1B[29m"),ke=p("\x1B[41m","\x1B[49m"),Ve=p("\x1B[42m","\x1B[49m"),Ae=p("\x1B[43m","\x1B[49m"),Me=p("\x1B[44m","\x1B[49m"),Ne=p("\x1B[45m","\x1B[49m"),Re=p("\x1B[46m","\x1B[49m"),je=p("\x1B[47m","\x1B[49m"),Le=Y,De={reset:pe,red:ge,green:$e,yellow:ve,blue:we,magenta:ye,cyan:be,white:xe,gray:Ce,bold:Se,italic:_e,underline:Ie,dim:Oe,inverse:Ee,hidden:Be,strikethrough:Te,bgRed:ke,bgGreen:Ve,bgYellow:Ae,bgBlue:Me,bgMagenta:Ne,bgCyan:Re,bgWhite:je,isColorSupported:Le},We=De,Fe=["up","down","left","right","space","enter","cancel"],ft={actions:new Set(Fe),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"}};var dt=Pe.platform.startsWith("win"),pt=Symbol("clapp:cancel");var He=re();var d=(e,t)=>He?e:t,gt=d("\u25C6","*"),$t=d("\u25A0","x"),vt=d("\u25B2","x"),wt=d("\u25C7","o"),yt=d("\u250C","T"),Ue=d("\u2502","|"),bt=d("\u2514","\u2014"),xt=d("\u25CF",">"),Ct=d("\u25CB"," "),St=d("\u25FB","[\u2022]"),_t=d("\u25FC","[+]"),It=d("\u25FB","[ ]"),Ot=d("\u25AA","\u2022"),Et=d("\u2500","-"),Bt=d("\u256E","+"),Tt=d("\u251C","+"),kt=d("\u256F","+"),Vt=d("\u25CF","\u2022"),At=d("\u25C6","*"),Mt=d("\u25B2","!"),Nt=d("\u25A0","x");var Rt={light:d("\u2500","-"),heavy:d("\u2501","="),block:d("\u2588","#")};function Ge(){return`${We.gray(Ue)} `}var jt=Ge();export{fe as CLI};
@@ -1,18 +1,18 @@
1
1
  // @bun
2
- import{h,g}from"./chunk-cgqg1br8.js";import{t}from"./chunk-6ekgn7sc.js";import{Ge}from"./chunk-cyzr3xat.js";import{sr,or,ar}from"./chunk-r9gdz351.js";import{y,ee,K}from"./chunk-vk5r6pgx.js";import{H}from"./chunk-fjkswqq2.js";import{_e,we,je}from"./chunk-n0tw6p7g.js";import{be}from"./chunk-587w6ktw.js";var lt=20,ft=!1,_=null;function ht(e){return Ot(e).replace(/\n[ \t]*(?=\n)/g,"")}function Ot(e){if(e.indexOf("/*")===-1)return e.trim();let i=[],s=0,r=0,l=e.length;while(r<l)if(e.charCodeAt(r)===47&&r+1<l&&e.charCodeAt(r+1)===42){if(r>s)i.push(e.substring(s,r));r+=2;while(r<l-1){if(e.charCodeAt(r)===42&&e.charCodeAt(r+1)===47){r+=2;break}r++}s=r}else r++;if(s<l)i.push(e.substring(s));return i.join("").trim()}function Vt(){ft=!0,_=null}function zt(){ft=!1;let e=_;return _=null,e}function ut(e,c){let i=0,s=0;while((s=e.indexOf(c,s))!==-1)i++,s+=c.length;return i}function wt(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 rt(e){let c=e.trim();if(c.length<3||c.charCodeAt(0)!==60)return!1;if(c.startsWith("<>"))return c.endsWith("</>");let i=c.charCodeAt(1);if(!(i>=65&&i<=90||i>=97&&i<=122||i===36||i===95))return!1;let r=2;while(r<c.length&&wt(c.charCodeAt(r)))r++;let l=c.slice(1,r),f=c.charCodeAt(r);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&&wt(c.charCodeAt(a)))a++;return c.slice(u+2,a)===l&&c.charCodeAt(a)===62&&a===c.length-1}function it(e){let c=e.length,i=!1;for(let f=1;f<c;f++)if(e.charCodeAt(f)<=32&&e.charCodeAt(f-1)<=32){i=!0;break}if(!i)for(let f=0;f<c;f++){let u=e.charCodeAt(f);if(u===10||u===13||u===9){i=!0;break}}if(!i)return e;let s=[],r=-1,l=!1;for(let f=0;f<c;f++)if(e.charCodeAt(f)<=32){if(!l){if(r>=0)s.push(e.substring(r,f));s.push(" "),l=!0,r=-1}}else{if(l||r<0)r=f;l=!1}if(r>=0)s.push(e.substring(r));return s.join("")}function n(e,c=!1,i=!1,s=0,r){if(!e||typeof e!=="string")return"unknown";if(s>=lt)return"unknown";let l=e.trim();if(rt(l))return"JSX.Element";let f=jt(l);if(f)return f;if(l.startsWith("BigInt("))return"bigint";if(l.startsWith("Symbol.for("))return"symbol";if(!(l.startsWith("[")&&l.endsWith("]")||l.startsWith("{")&&l.endsWith("}"))&&(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 d=Bt(l);if(d!==null){if(d==="string"||!c)return"string";return d}}if(y(l)){if(!c)return"number";return K(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 Be(l,c,s+1,r);if(l.startsWith("{")&&l.endsWith("}"))return dt(l,c,s+1,r);if(l.startsWith("class ")||l.startsWith("class{"))return oe(l);if(l.startsWith("new "))return Ht(l);if(l.endsWith("as const")){let d=l.slice(0,-8).trim();if(d.startsWith("[")&&d.endsWith("]")){let x=d.slice(1,-1).trim();if(!x)return"readonly []";let T=Q(x),w=[];for(let A=0;A<T.length;A++){let p=T[A].trim();if(p.startsWith("...")){let m=p.slice(3).trim();if(Y(m))w.push(`...typeof ${m}`);else{let C=n(m,!0,!1,s+1,r);w.push(C.startsWith("readonly [")||C.endsWith("[]")?`...${C}`:"...unknown[]")}}else w.push(n(p,!0,!1,s+1,r))}return`readonly [${w.join(", ")}]`}return n(d,!0,i,s+1,r)}if(Z(l)!==-1||l.startsWith("function")||l.startsWith("async"))return pt(l,i,s,c);if(l.startsWith("`")&&l.endsWith("`"))return se(l,c);if(l.startsWith("Promise."))return Nt(l,c,s,r);if(l.startsWith("await "))return"unknown";if(l.startsWith("typeof ")&&nt(l.slice(7)))return"string";if(l.startsWith("void ")&&nt(l.slice(5)))return"undefined";if(l.startsWith("delete ")&&nt(l.slice(7)))return"boolean";if(ee(l)){if(c)return K(l);return"bigint"}if(l.startsWith("Symbol(")||l==="Symbol.for")return"symbol";let a=z(l);if(a!==null)return a;if(Pt(l))return"boolean";if(Gt(l))return"number";return"unknown"}function $t(e){let c=e.charCodeAt(0);if(c!==39&&c!==34)return!1;return J(e,0,c)===e.length}function Bt(e){if($t(e))return e;let c=Dt(e);if(c.length<2)return null;let i=!1,s=!0,r="";for(let l of c){let f=l.trim();if($t(f))i=!0,r+=Ft(f);else s=!1}if(s)return qt(r);if(i)return"string";return null}function Dt(e){let c=[],i=0,s=0,r=0;while(r<e.length){let l=e.charCodeAt(r);if(l===39||l===34||l===96){r=J(e,r,l);continue}if(l===40||l===91||l===123)i++;else if(l===41||l===93||l===125)i--;else if(l===43&&i===0)c.push(e.slice(s,r)),s=r+1;r++}return c.push(e.slice(s)),c}function Ft(e){return e.slice(1,-1).replace(/\\(.)/g,(i,s)=>{if(s==="n")return`
4
- `;if(s==="t")return"\t";if(s==="r")return"\r";if(s==="0")return"\x00";return s})}function qt(e){return`'${e.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}'`}function Gt(e){if(e==="")return!1;let c=!1,i=!1;for(let s=0;s<e.length;s++){let r=e.charCodeAt(s);if(r>=48&&r<=57){c=!0;continue}if(r===43||r===45||r===42||r===47||r===37){i=!0;continue}if(r===60||r===62){let l=s+1;while(l<e.length&&e.charCodeAt(l)===r)l++;let f=l-s;if(f!==2&&!(r===62&&f===3))return!1;i=!0,s=l-1;continue}if(r===46||r===40||r===41||r<=32)continue;return!1}return c&&i}function Pt(e){let c=0,i;for(let s=0;s<e.length;s++){let r=e.charCodeAt(s);if(r===34||r===39||r===96){s=J(e,s,r)-1;continue}if(r===47){if(e[s+1]==="/"){let l=e.indexOf(`
5
- `,s+2);s=l===-1?e.length:l;continue}if(e[s+1]==="*"){let l=e.indexOf("*/",s+2);s=l===-1?e.length:l+1;continue}if(h(e,s)){s=g(e,s)-1;continue}}if(r===40||r===91||r===123){c++;continue}if(r===41||r===93||r===125){c--;continue}if(c!==0)continue;if(r===60){i??=H(e);let l=i(s,0);if(l){s=l.end-1;continue}}if(e.startsWith("===",s)||e.startsWith("!==",s)||e.startsWith("==",s)||e.startsWith("!=",s)||e.startsWith(">=",s)||e.startsWith("<=",s))return!0;if((r===62||r===60)&&e.charCodeAt(s+1)===r){while(e.charCodeAt(s+1)===r)s++;continue}if((r===62||r===60)&&e.charCodeAt(s-1)!==61&&e.charCodeAt(s+1)!==61)return!0}return!1}function Ut(e,c=!1,i=0,s){return n(e,c,!0,i,s)}function B(e,c=!1,i="",s,r){let l=gt(i,s),f=[],u=!1,a=0;while(a<e.length){let x=e.charCodeAt(a);if(x===34||x===39||x===96){a=J(e,a,x);continue}if(x===47&&e.charCodeAt(a+1)===47){a+=2;while(a<e.length&&e.charCodeAt(a)!==10&&e.charCodeAt(a)!==13)a++;continue}if(x===47&&e.charCodeAt(a+1)===42){let w=e.indexOf("*/",a+2);a=w===-1?e.length:w+2;continue}if(e.startsWith("function",a)&&tt(e,a,8)||e.startsWith("class",a)&&tt(e,a,5)){let w=ie(e,a);if(w!==-1){a=ot(e,w);continue}}if(x===61&&e.charCodeAt(a+1)===62){let w=Mt(e,a+2);if(e.charCodeAt(w)===123){a=ot(e,w);continue}}if(e.startsWith("return",a)&&(a===0||!V(e.charCodeAt(a-1)))&&!V(e.charCodeAt(a+6))){a+=6;let w=!1;while(a<e.length&&e.charCodeAt(a)<=32){let k=e.charCodeAt(a);if(k===10||k===13)w=!0;a++}if(w||a>=e.length||e.charCodeAt(a)===59||e.charCodeAt(a)===125){u=!0;continue}let A=a,p=0,m=0,C=0;while(a<e.length){let k=e.charCodeAt(a);if(k===34||k===39||k===96){a=J(e,a,k);continue}if(k===47&&e.charCodeAt(a+1)===47){if(p===0&&m===0&&C===0)break;while(a<e.length&&e.charCodeAt(a)!==10&&e.charCodeAt(a)!==13)a++;continue}if(k===47&&e.charCodeAt(a+1)===42){let O=e.indexOf("*/",a+2);a=O===-1?e.length:O+2;continue}if(k===40)p++;else if(k===41)p--;else if(k===91)m++;else if(k===93)m--;else if(k===123)C++;else if(k===125){if(C===0&&p===0&&m===0)break;C--}else if(k===59&&p===0&&m===0&&C===0)break;else if((k===10||k===13)&&p===0&&m===0&&C===0){let O=a+1;while(O<e.length&&e.charCodeAt(O)<=32)O++;if(e.startsWith("return",O)&&!V(e.charCodeAt(O+6)))break}a++}let S=e.slice(A,a).trim(),b=ht(F(S,l,s,r,A));if(!f.includes(b))f.push(b);continue}a++}if(u&&!f.includes("undefined"))f.push("undefined");let d=f.includes("unknown")?"unknown":f.length===0?"void":Et(f);return c&&!d.startsWith("Promise<")?`Promise<${d}>`:d}function gt(e,c){let i=new Map,s=e.startsWith("(")&&e.endsWith(")")?e.slice(1,-1):e,r=t(s),l=0,f=0,u=[];for(let a of r){let d=s.slice(a.start,a.end);if(d===","&&f===0)u.push(s.slice(l,a.start)),l=a.end;if(["(","[","{","<"].includes(d))f++;else if([")","]","}"].includes(d)||d===">"&&s[a.start-1]!=="=")f--}u.push(s.slice(l));for(let a of u){let d=t(a),x=-1,T=-1,w=0;for(let C of d){let S=a.slice(C.start,C.end);if(w===0&&S===":"&&x===-1)x=C.start;if(w===0&&S==="="&&a[C.end]!==">"){T=C.start;break}if(["(","[","{","<"].includes(S))w++;else if([")","]","}"].includes(S)||S===">"&&a[C.start-1]!=="=")w--}let A=a.slice(0,x!==-1?x:T!==-1?T:void 0).trim().replace(/^\.\.\./,"").replace(/\?$/,""),p=x===-1&&T!==-1&&!a.trim().startsWith("...")?we(A,a.slice(T+1)):null;if(p){for(let C of p)i.set(C.alias,c?.(C.value)??n(C.value,!1));continue}if(!v(A)){if(A.startsWith("{")||A.startsWith("["))for(let C of Ge(A))i.set(C,"unknown");continue}let m=x!==-1?a.slice(x+1,T!==-1?T:void 0).trim():"";if(!m&&T!==-1){let C=a.slice(T+1).trim();m=c?.(C)??n(C,!1)}if(m){if(T===-1&&a.slice(0,x).trim().endsWith("?"))m=`(${m}) | undefined`;i.set(A,m)}else i.set(A,"unknown")}return i}var Wt={string:{at:"string | undefined",charAt:"string",charCodeAt:"number",codePointAt:"number | undefined",concat:"string",endsWith:"boolean",includes:"boolean",indexOf:"number",lastIndexOf:"number",localeCompare:"number",normalize:"string",padEnd:"string",padStart:"string",repeat:"string",replace:"string",replaceAll:"string",search:"number",slice:"string",split:"string[]",startsWith:"boolean",substring:"string",toLocaleLowerCase:"string",toLocaleUpperCase:"string",toLowerCase:"string",toString:"string",toUpperCase:"string",trim:"string",trimEnd:"string",trimStart:"string",valueOf:"string"},number:{toExponential:"string",toFixed:"string",toLocaleString:"string",toPrecision:"string",toString:"string",valueOf:"number"},bigint:{toLocaleString:"string",toString:"string",valueOf:"bigint"},boolean:{toString:"string",valueOf:"boolean"}};function Sa(e,c){let i=Object.hasOwn(Wt,e)?Wt[e]:void 0;return i&&Object.hasOwn(i,c)?i[c]:void 0}function W(e){return e.includes(`
2
+ import{h,g}from"./chunk-cgqg1br8.js";import{t}from"./chunk-t5nmnzy6.js";import{Ge}from"./chunk-gwa4hmfa.js";import{or,ar,cr}from"./chunk-hkcqbex1.js";import{y,ee,K}from"./chunk-vk5r6pgx.js";import{H}from"./chunk-cdq514ff.js";import{_e,we,je}from"./chunk-6r01zgys.js";import{be}from"./chunk-587w6ktw.js";var lt=20,ft=!1,_=null;function ht(e){return Ot(e).replace(/\n[ \t]*(?=\n)/g,"")}function Ot(e){if(e.indexOf("/*")===-1)return e.trim();let i=[],s=0,r=0,l=e.length;while(r<l)if(e.charCodeAt(r)===47&&r+1<l&&e.charCodeAt(r+1)===42){if(r>s)i.push(e.substring(s,r));r+=2;while(r<l-1){if(e.charCodeAt(r)===42&&e.charCodeAt(r+1)===47){r+=2;break}r++}s=r}else r++;if(s<l)i.push(e.substring(s));return i.join("").trim()}function zt(){ft=!0,_=null}function Ut(){ft=!1;let e=_;return _=null,e}function ut(e,c){let i=0,s=0;while((s=e.indexOf(c,s))!==-1)i++,s+=c.length;return i}function wt(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 rt(e){let c=e.trim();if(c.length<3||c.charCodeAt(0)!==60)return!1;if(c.startsWith("<>"))return c.endsWith("</>");let i=c.charCodeAt(1);if(!(i>=65&&i<=90||i>=97&&i<=122||i===36||i===95))return!1;let r=2;while(r<c.length&&wt(c.charCodeAt(r)))r++;let l=c.slice(1,r),f=c.charCodeAt(r);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&&wt(c.charCodeAt(a)))a++;return c.slice(u+2,a)===l&&c.charCodeAt(a)===62&&a===c.length-1}function it(e){let c=e.length,i=!1;for(let f=1;f<c;f++)if(e.charCodeAt(f)<=32&&e.charCodeAt(f-1)<=32){i=!0;break}if(!i)for(let f=0;f<c;f++){let u=e.charCodeAt(f);if(u===10||u===13||u===9){i=!0;break}}if(!i)return e;let s=[],r=-1,l=!1;for(let f=0;f<c;f++)if(e.charCodeAt(f)<=32){if(!l){if(r>=0)s.push(e.substring(r,f));s.push(" "),l=!0,r=-1}}else{if(l||r<0)r=f;l=!1}if(r>=0)s.push(e.substring(r));return s.join("")}function n(e,c=!1,i=!1,s=0,r){if(!e||typeof e!=="string")return"unknown";if(s>=lt)return"unknown";let l=e.trim();if(rt(l))return"JSX.Element";let f=jt(l);if(f)return f;if(l.startsWith("BigInt("))return"bigint";if(l.startsWith("Symbol.for("))return"symbol";if(!(l.startsWith("[")&&l.endsWith("]")||l.startsWith("{")&&l.endsWith("}"))&&(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 d=Bt(l);if(d!==null){if(d==="string"||!c)return"string";return d}}if(y(l)){if(!c)return"number";return K(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 Be(l,c,s+1,r);if(l.startsWith("{")&&l.endsWith("}"))return dt(l,c,s+1,r);if(l.startsWith("class ")||l.startsWith("class{"))return oe(l);if(l.startsWith("new "))return Kt(l);if(l.endsWith("as const")){let d=l.slice(0,-8).trim();if(d.startsWith("[")&&d.endsWith("]")){let x=d.slice(1,-1).trim();if(!x)return"readonly []";let T=Q(x),w=[];for(let A=0;A<T.length;A++){let p=T[A].trim();if(p.startsWith("...")){let m=p.slice(3).trim();if(Y(m))w.push(`...typeof ${m}`);else{let C=n(m,!0,!1,s+1,r);w.push(C.startsWith("readonly [")||C.endsWith("[]")?`...${C}`:"...unknown[]")}}else w.push(n(p,!0,!1,s+1,r))}return`readonly [${w.join(", ")}]`}return n(d,!0,i,s+1,r)}if(Z(l)!==-1||l.startsWith("function")||l.startsWith("async"))return pt(l,i,s,c);if(l.startsWith("`")&&l.endsWith("`"))return se(l,c);if(l.startsWith("Promise."))return Nt(l,c,s,r);if(l.startsWith("await "))return"unknown";if(l.startsWith("typeof ")&&nt(l.slice(7)))return"string";if(l.startsWith("void ")&&nt(l.slice(5)))return"undefined";if(l.startsWith("delete ")&&nt(l.slice(7)))return"boolean";if(ee(l)){if(c)return K(l);return"bigint"}if(l.startsWith("Symbol(")||l==="Symbol.for")return"symbol";let a=z(l);if(a!==null)return a;if(Pt(l))return"boolean";if(Gt(l))return"number";return"unknown"}function $t(e){let c=e.charCodeAt(0);if(c!==39&&c!==34)return!1;return J(e,0,c)===e.length}function Bt(e){if($t(e))return e;let c=Dt(e);if(c.length<2)return null;let i=!1,s=!0,r="";for(let l of c){let f=l.trim();if($t(f))i=!0,r+=Ft(f);else s=!1}if(s)return Vt(r);if(i)return"string";return null}function Dt(e){let c=[],i=0,s=0,r=0;while(r<e.length){let l=e.charCodeAt(r);if(l===39||l===34||l===96){r=J(e,r,l);continue}if(l===40||l===91||l===123)i++;else if(l===41||l===93||l===125)i--;else if(l===43&&i===0)c.push(e.slice(s,r)),s=r+1;r++}return c.push(e.slice(s)),c}function Ft(e){return e.slice(1,-1).replace(/\\(.)/g,(i,s)=>{if(s==="n")return`
4
+ `;if(s==="t")return"\t";if(s==="r")return"\r";if(s==="0")return"\x00";return s})}function Vt(e){return`'${e.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}'`}function Gt(e){if(e==="")return!1;let c=!1,i=!1;for(let s=0;s<e.length;s++){let r=e.charCodeAt(s);if(r>=48&&r<=57){c=!0;continue}if(r===43||r===45||r===42||r===47||r===37){i=!0;continue}if(r===60||r===62){let l=s+1;while(l<e.length&&e.charCodeAt(l)===r)l++;let f=l-s;if(f!==2&&!(r===62&&f===3))return!1;i=!0,s=l-1;continue}if(r===46||r===40||r===41||r<=32)continue;return!1}return c&&i}function Pt(e){let c=0,i;for(let s=0;s<e.length;s++){let r=e.charCodeAt(s);if(r===34||r===39||r===96){s=J(e,s,r)-1;continue}if(r===47){if(e[s+1]==="/"){let l=e.indexOf(`
5
+ `,s+2);s=l===-1?e.length:l;continue}if(e[s+1]==="*"){let l=e.indexOf("*/",s+2);s=l===-1?e.length:l+1;continue}if(h(e,s)){s=g(e,s)-1;continue}}if(r===40||r===91||r===123){c++;continue}if(r===41||r===93||r===125){c--;continue}if(c!==0)continue;if(r===60){i??=H(e);let l=i(s,0);if(l){s=l.end-1;continue}}if(e.startsWith("===",s)||e.startsWith("!==",s)||e.startsWith("==",s)||e.startsWith("!=",s)||e.startsWith(">=",s)||e.startsWith("<=",s))return!0;if((r===62||r===60)&&e.charCodeAt(s+1)===r){while(e.charCodeAt(s+1)===r)s++;continue}if((r===62||r===60)&&e.charCodeAt(s-1)!==61&&e.charCodeAt(s+1)!==61)return!0}return!1}function Ht(e,c=!1,i=0,s){return n(e,c,!0,i,s)}function B(e,c=!1,i="",s,r){let l=gt(i,s),f=[],u=!1,a=0;while(a<e.length){let x=e.charCodeAt(a);if(x===34||x===39||x===96){a=J(e,a,x);continue}if(x===47&&e.charCodeAt(a+1)===47){a+=2;while(a<e.length&&e.charCodeAt(a)!==10&&e.charCodeAt(a)!==13)a++;continue}if(x===47&&e.charCodeAt(a+1)===42){let w=e.indexOf("*/",a+2);a=w===-1?e.length:w+2;continue}if(e.startsWith("function",a)&&tt(e,a,8)||e.startsWith("class",a)&&tt(e,a,5)){let w=ie(e,a);if(w!==-1){a=ot(e,w);continue}}if(x===61&&e.charCodeAt(a+1)===62){let w=Mt(e,a+2);if(e.charCodeAt(w)===123){a=ot(e,w);continue}}if(e.startsWith("return",a)&&(a===0||!V(e.charCodeAt(a-1)))&&!V(e.charCodeAt(a+6))){a+=6;let w=!1;while(a<e.length&&e.charCodeAt(a)<=32){let k=e.charCodeAt(a);if(k===10||k===13)w=!0;a++}if(w||a>=e.length||e.charCodeAt(a)===59||e.charCodeAt(a)===125){u=!0;continue}let A=a,p=0,m=0,C=0;while(a<e.length){let k=e.charCodeAt(a);if(k===34||k===39||k===96){a=J(e,a,k);continue}if(k===47&&e.charCodeAt(a+1)===47){if(p===0&&m===0&&C===0)break;while(a<e.length&&e.charCodeAt(a)!==10&&e.charCodeAt(a)!==13)a++;continue}if(k===47&&e.charCodeAt(a+1)===42){let O=e.indexOf("*/",a+2);a=O===-1?e.length:O+2;continue}if(k===40)p++;else if(k===41)p--;else if(k===91)m++;else if(k===93)m--;else if(k===123)C++;else if(k===125){if(C===0&&p===0&&m===0)break;C--}else if(k===59&&p===0&&m===0&&C===0)break;else if((k===10||k===13)&&p===0&&m===0&&C===0){let O=a+1;while(O<e.length&&e.charCodeAt(O)<=32)O++;if(e.startsWith("return",O)&&!V(e.charCodeAt(O+6)))break}a++}let S=e.slice(A,a).trim(),b=ht(F(S,l,s,r,A));if(!f.includes(b))f.push(b);continue}a++}if(u&&!f.includes("undefined"))f.push("undefined");let d=f.includes("unknown")?"unknown":f.length===0?"void":Et(f);return c&&!d.startsWith("Promise<")?`Promise<${d}>`:d}function gt(e,c){let i=new Map,s=e.startsWith("(")&&e.endsWith(")")?e.slice(1,-1):e,r=t(s),l=0,f=0,u=[];for(let a of r){let d=s.slice(a.start,a.end);if(d===","&&f===0)u.push(s.slice(l,a.start)),l=a.end;if(["(","[","{","<"].includes(d))f++;else if([")","]","}"].includes(d)||d===">"&&s[a.start-1]!=="=")f--}u.push(s.slice(l));for(let a of u){let d=t(a),x=-1,T=-1,w=0;for(let C of d){let S=a.slice(C.start,C.end);if(w===0&&S===":"&&x===-1)x=C.start;if(w===0&&S==="="&&a[C.end]!==">"){T=C.start;break}if(["(","[","{","<"].includes(S))w++;else if([")","]","}"].includes(S)||S===">"&&a[C.start-1]!=="=")w--}let A=a.slice(0,x!==-1?x:T!==-1?T:void 0).trim().replace(/^\.\.\./,"").replace(/\?$/,""),p=x===-1&&T!==-1&&!a.trim().startsWith("...")?we(A,a.slice(T+1)):null;if(p){for(let C of p)i.set(C.alias,c?.(C.value)??n(C.value,!1));continue}if(!v(A)){if(A.startsWith("{")||A.startsWith("["))for(let C of Ge(A))i.set(C,"unknown");continue}let m=x!==-1?a.slice(x+1,T!==-1?T:void 0).trim():"";if(!m&&T!==-1){let C=a.slice(T+1).trim();m=c?.(C)??n(C,!1)}if(m){if(T===-1&&a.slice(0,x).trim().endsWith("?"))m=`(${m}) | undefined`;i.set(A,m)}else i.set(A,"unknown")}return i}var Wt={string:{at:"string | undefined",charAt:"string",charCodeAt:"number",codePointAt:"number | undefined",concat:"string",endsWith:"boolean",includes:"boolean",indexOf:"number",lastIndexOf:"number",localeCompare:"number",normalize:"string",padEnd:"string",padStart:"string",repeat:"string",replace:"string",replaceAll:"string",search:"number",slice:"string",split:"string[]",startsWith:"boolean",substring:"string",toLocaleLowerCase:"string",toLocaleUpperCase:"string",toLowerCase:"string",toString:"string",toUpperCase:"string",trim:"string",trimEnd:"string",trimStart:"string",valueOf:"string"},number:{toExponential:"string",toFixed:"string",toLocaleString:"string",toPrecision:"string",toString:"string",valueOf:"number"},bigint:{toLocaleString:"string",toString:"string",valueOf:"bigint"},boolean:{toString:"string",valueOf:"boolean"}};function $a(e,c){let i=Object.hasOwn(Wt,e)?Wt[e]:void 0;return i&&Object.hasOwn(i,c)?i[c]:void 0}function W(e){return e.includes(`
6
6
  `)?e.replaceAll(`
7
7
  `,`
8
- `):e}function Jt(e,c){if(e=e.trim(),!e.startsWith("{")||!e.endsWith("}"))return;let i=e.slice(1,-1),s=t(i),r=0,l=0;for(let f=0;f<=s.length;f++){let u=s[f],a=u?i.slice(u.start,u.end):";";if(l===0&&(a===";"||a===",")){let d=i.slice(r,u?.start).trim(),x=d.indexOf(":");if(x!==-1&&d.slice(0,x).trim()===c)return d.slice(x+1).trim();r=u?.end??i.length}if(["(","[","{","<"].includes(a))l++;else if([")","]","}"].includes(a)||a===">"&&u&&i[u.start-1]!=="=")l--}return}function F(e,c,i,s,r=0,l=0){if(l>=lt)return"unknown";let f=e.trim();while(at(f))f=f.slice(1,-1).trim();let u=i?.(f);if(u)return u;if(rt(f))return"JSX.Element";if(f.startsWith("await ")){let b=F(f.slice(6),c,i,s,r,l+1);return b.startsWith("Promise<")&&b.endsWith(">")?b.slice(8,-1):b}if(c.has(f))return c.get(f);let a=/^([\w$]+)\.([\w$]+(?:\.[\w$]+)*)$/.exec(f),d;if(a){let b=c.get(a[1]),k=b&&Jt(b,a[2]);if(k)return k;if(b)d=`typeof ${f}`}if(f.startsWith("!"))return"boolean";if(f.startsWith("fetch("))return"Promise<Response>";if(re(f))return n(f,!1);let x=Rt(f);if(x){let b=F(x.whenTrue,c,i,s,r,l+1),k=F(x.whenFalse,c,i,s,r,l+1);return b===k?b:Et([b,k])}for(let b of["??","||","&&"]){let k=It(f,b);if(k!==-1){let O=F(f.slice(0,k),c,i,s,r,l+1),P=F(f.slice(k+b.length),c,i,s,r,l+1);return vt(O,P,b)}}let T=Qt(f);if(T&&s)return s(T,r);let w=jt(f);if(w)return s?s(w,r):w;if(Pt(f))return"boolean";let A=0;for(let b=f.length-1;b>=0;b--){let k=f.charCodeAt(b);if(k===41||k===93||k===125)A++;else if(k===40||k===91||k===123)A--;else if(A===0&&(k===43||k===45||k===42||k===47||k===37)){let O=F(f.slice(0,b),c,i,s,r,l+1),P=F(f.slice(b+1),c,i,s,r,l+1);if(k===43&&(O==="string"||P==="string"))return"string";if(O==="number"&&P==="number")return"number";break}}if(f.startsWith("[")&&f.endsWith("]")){let b=Q(f.slice(1,-1));if(b.some((k)=>k.trim().startsWith("..."))){let k=b.map((O)=>{let P=O.trim();if(!P)return"undefined";let I=P.startsWith("..."),j=F(I?P.slice(3):P,c,i,s,r,l+1);return I?`(NonNullable<${j}> extends Iterable<infer Element> ? Element : never)`:j});return`(${[...new Set(k)].join(" | ")||"never"})[]`}}let p=d??(f.startsWith("{")&&f.endsWith("}")?dt(f,!1,l+1,void 0,(b)=>F(b,c,i,s,r,l+1)):n(f,!1));if(p==="unknown"&&v(f)&&s)return s(`typeof ${f}`,r);let m=t(p),C="",S=0;for(let b=0;b<m.length;b++){let k=m[b];if(k.kind!=="word"||p.slice(k.start,k.end)!=="typeof")continue;let O=m[b+1];if(!O||O.kind!=="word")continue;let P=c.get(p.slice(O.start,O.end)),I=P,j=!P,q=k.start,D=O.end,E=b,L=[];b++;while(m[b+1]&&p.slice(m[b+1].start,m[b+1].end)==="."&&m[b+2]?.kind==="word"){let N=m[b+2];if(L.push(p.slice(N.start,N.end)),!j)P=`(${P})["${p.slice(N.start,N.end)}"]`;D=N.end,b+=2}let X=m[b+1];if(X&&p.slice(X.start,X.end)==="<"){let N=o(p,X.start,"<",">");if(N!==-1){D=N+1;while(m[b+1]&&m[b+1].start<=N)b++;P=void 0,I=void 0,j=!0}}let et=E>=2&&p.slice(m[E-2].start,m[E-2].end)==="ReturnType"&&p.slice(m[E-1].start,m[E-1].end)==="<"&&m[b+1]&&p.slice(m[b+1].start,m[b+1].end)===">",M=I&&et&&L.length===1?Sa(I.trim(),L[0]):void 0;if(M){q=m[E-2].start,D=m[++b].end;let N=q===0&&D===p.length;C+=p.slice(S,q)+(N||!M.includes("|")?M:`(${M})`),S=D;continue}if(j&&et)q=m[E-2].start,D=m[++b].end;C+=p.slice(S,q)+(P??"unknown"),S=D}return C+p.slice(S)}function Qt(e){let c=t(e),i=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))i++;else if([")","]","}"].includes(u))i--;else if(!i&&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 r=e.slice(c[s].end).trim();if(r==="const")return;i=0;for(let l of c.slice(s+1)){if(l.kind!=="punctuation")continue;let f=e.slice(l.start,l.end);if(!i&&["??","||","&&"].some((u)=>e.startsWith(u,l.start)))return;if(["(","[","{","<"].includes(f))i++;else if([")","]","}",">"].includes(f))i--;else if(!i&&["+","-","*","/","%","=","!",";"].includes(f))return}return r}function It(e,c){let i=0;for(let s of t(e)){if(s.kind!=="punctuation")continue;let r=e.slice(s.start,s.end);if(["(","[","{"].includes(r))i++;else if([")","]","}"].includes(r))i--;if(!i&&e.startsWith(c,s.start))return s.start}return-1}function Xt(e){if(e.includes("=>"))return null;let c=[],i=0,s=0;for(let r=0;r<=e.length;r++){let l=r===e.length?"|":e[r];if(l==="'"||l==='"'||l==="`"){r++;while(r<e.length&&e[r]!==l)r+=e[r]==="\\"?2:1;if(r>=e.length)return null}else if(l==="("||l==="["||l==="{"||l==="<")i++;else if(l===")"||l==="]"||l==="}"||l===">")i--;else if(l==="|"&&i===0){let f=e.slice(s,r).trim();if(f)c.push(f);s=r+1}if(i<0)return null}return i===0?c:null}function Yt(e,c){let i=Xt(c);if(!i)return`${e} | ${c}`;let s=[];for(let d of[e,...i]){if(d==="unknown")return"unknown";if(!s.includes(d))s.push(d)}let r=s.includes("boolean")||s.includes("true")&&s.includes("false"),l=s.includes("string"),f=s.includes("number"),u=[],a=!1;for(let d of s)if(r&&(d==="true"||d==="false"||d==="boolean")){if(!a)u.push("boolean");a=!0}else if(l&&Zt(d))continue;else if(f&&/^-?\d+(?:\.\d+)?$/.test(d))continue;else u.push(d);return u.join(" | ")}function Zt(e){let c=e[0];return e.length>=2&&(c==="'"||c==='"')&&e.endsWith(c)&&!e.slice(1,-1).includes(c)}function vt(e,c,i){let s=Z(c)!==-1?`(${c.trim()})`:c;if(e.trim()==="unknown")return i==="&&"||s.trim()==="unknown"?"unknown":`{} | ${s}`;let r=e.trim();if(r==="boolean"||r==="string"||r==="number"){if(i==="??")return r;return Yt(i==="||"?r==="boolean"?"true":r:r==="boolean"?"false":r==="string"?"''":"0",s)}let l="false | 0 | 0n | '' | null | undefined";if(i==="??")return`([${e}] extends [NonNullable<${e}>] ? ${e} : NonNullable<${e}> | ${s})`;if(i==="||")return`([${e}] extends [object] ? ${e} : [Exclude<${e}, object> & (${l})] extends [never] ? ${e} : Exclude<NonNullable<${e}>, ${l}> | ${s})`;return`([${e}] extends [object] ? ${s} : [${e}] extends [${l}] ? ${e} : unknown extends (${e}) ? ${e} : (Exclude<${e}, object> & (${l})) | ${s})`}function te(e){let c=`(NonNullable<${e}> extends infer __dtsx_spread_value ? { -readonly [__dtsx_spread_key in keyof __dtsx_spread_value]: __dtsx_spread_value[__dtsx_spread_key] } : never)`,i=`(NonNullable<${e}> extends infer __dtsx_spread_value ? { -readonly [__dtsx_spread_key in keyof __dtsx_spread_value]?: __dtsx_spread_value[__dtsx_spread_key] } : never)`;return`([${e}] extends [null | undefined] ? {} : [${e}] extends [NonNullable<${e}>] ? ${c} : ${i})`}function ne(e,c){let i=e.trim();while(at(i))i=i.slice(1,-1).trim();let s=It(i,"??");if(s!==-1&&i.slice(s+2).trim()==="{}")return te(c(i.slice(0,s)));let r=Rt(i);if(r){if(r.whenFalse.trim()==="{}")return`Partial<${c(r.whenTrue)}>`;if(r.whenTrue.trim()==="{}")return`Partial<${c(r.whenFalse)}>`}return c(i)}function Et(e){return e.map((c)=>e.length>1&&Z(c)!==-1?`(${c})`:c).join(" | ")}function st(e){let c=0;while(c<e.length){let r=e.charCodeAt(c);if(r<=32)c++;else if(r===47&&e.charCodeAt(c+1)===47){c+=2;while(c<e.length&&e.charCodeAt(c)!==10&&e.charCodeAt(c)!==13)c++}else if(r===47&&e.charCodeAt(c+1)===42){let l=e.indexOf("*/",c+2);c=l===-1?e.length:l+2}else break}let i=c,s=c;while(s<e.length){let r=e.charCodeAt(s);if(r===34||r===39||r===96){s=J(e,s,r),i=s;continue}if(r===92){s=Math.min(s+2,e.length),i=s;continue}if(r===47&&e.charCodeAt(s+1)===47){while(s<e.length&&e.charCodeAt(s)!==10&&e.charCodeAt(s)!==13)s++;continue}if(r===47&&e.charCodeAt(s+1)===42){let l=e.indexOf("*/",s+2);s=l===-1?e.length:l+2;continue}if(s++,r>32)i=s}return e.slice(c,i)}function jt(e){if(!e.startsWith("<"))return;let c=H(e)(0,0);if(!c||c.parameters||c.completeOperand||!e.slice(c.end).trim()||!nt(e.slice(c.end).trim()))return;return e.slice(1,c.end-1).trim()}function nt(e){e=st(e);let c=0,i;for(let s=0;s<e.length;s++){let r=e[s];if(r==="'"||r==='"'||r==="`"){let l=s+1;while(l<e.length&&e[l]!==r){if(e[l]==="\\")l++;l++}s=l;continue}if(r==="/"){if(e[s+1]==="/"){let l=e.indexOf(`
8
+ `):e}function Jt(e,c){if(e=e.trim(),!e.startsWith("{")||!e.endsWith("}"))return;let i=e.slice(1,-1),s=t(i),r=0,l=0;for(let f=0;f<=s.length;f++){let u=s[f],a=u?i.slice(u.start,u.end):";";if(l===0&&(a===";"||a===",")){let d=i.slice(r,u?.start).trim(),x=d.indexOf(":");if(x!==-1&&d.slice(0,x).trim()===c)return d.slice(x+1).trim();r=u?.end??i.length}if(["(","[","{","<"].includes(a))l++;else if([")","]","}"].includes(a)||a===">"&&u&&i[u.start-1]!=="=")l--}return}function F(e,c,i,s,r=0,l=0){if(l>=lt)return"unknown";let f=e.trim();while(at(f))f=f.slice(1,-1).trim();let u=i?.(f);if(u)return u;if(rt(f))return"JSX.Element";if(f.startsWith("await ")){let b=F(f.slice(6),c,i,s,r,l+1);return b.startsWith("Promise<")&&b.endsWith(">")?b.slice(8,-1):b}if(c.has(f))return c.get(f);let a=/^([\w$]+)\.([\w$]+(?:\.[\w$]+)*)$/.exec(f),d;if(a){let b=c.get(a[1]),k=b&&Jt(b,a[2]);if(k)return k;if(b)d=`typeof ${f}`}if(f.startsWith("!"))return"boolean";if(f.startsWith("fetch("))return"Promise<Response>";if(re(f))return n(f,!1);let x=Rt(f);if(x){let b=F(x.whenTrue,c,i,s,r,l+1),k=F(x.whenFalse,c,i,s,r,l+1);return b===k?b:Et([b,k])}for(let b of["??","||","&&"]){let k=It(f,b);if(k!==-1){let O=F(f.slice(0,k),c,i,s,r,l+1),P=F(f.slice(k+b.length),c,i,s,r,l+1);return vt(O,P,b)}}let T=Qt(f);if(T&&s)return s(T,r);let w=jt(f);if(w)return s?s(w,r):w;if(Pt(f))return"boolean";let A=0;for(let b=f.length-1;b>=0;b--){let k=f.charCodeAt(b);if(k===41||k===93||k===125)A++;else if(k===40||k===91||k===123)A--;else if(A===0&&(k===43||k===45||k===42||k===47||k===37)){let O=F(f.slice(0,b),c,i,s,r,l+1),P=F(f.slice(b+1),c,i,s,r,l+1);if(k===43&&(O==="string"||P==="string"))return"string";if(O==="number"&&P==="number")return"number";break}}if(f.startsWith("[")&&f.endsWith("]")){let b=Q(f.slice(1,-1));if(b.some((k)=>k.trim().startsWith("..."))){let k=b.map((O)=>{let P=O.trim();if(!P)return"undefined";let I=P.startsWith("..."),j=F(I?P.slice(3):P,c,i,s,r,l+1);return I?`(NonNullable<${j}> extends Iterable<infer Element> ? Element : never)`:j});return`(${[...new Set(k)].join(" | ")||"never"})[]`}}let p=d??(f.startsWith("{")&&f.endsWith("}")?dt(f,!1,l+1,void 0,(b)=>F(b,c,i,s,r,l+1)):n(f,!1));if(p==="unknown"&&v(f)&&s)return s(`typeof ${f}`,r);let m=t(p),C="",S=0;for(let b=0;b<m.length;b++){let k=m[b];if(k.kind!=="word"||p.slice(k.start,k.end)!=="typeof")continue;let O=m[b+1];if(!O||O.kind!=="word")continue;let P=c.get(p.slice(O.start,O.end)),I=P,j=!P,q=k.start,D=O.end,E=b,L=[];b++;while(m[b+1]&&p.slice(m[b+1].start,m[b+1].end)==="."&&m[b+2]?.kind==="word"){let N=m[b+2];if(L.push(p.slice(N.start,N.end)),!j)P=`(${P})["${p.slice(N.start,N.end)}"]`;D=N.end,b+=2}let X=m[b+1];if(X&&p.slice(X.start,X.end)==="<"){let N=o(p,X.start,"<",">");if(N!==-1){D=N+1;while(m[b+1]&&m[b+1].start<=N)b++;P=void 0,I=void 0,j=!0}}let et=E>=2&&p.slice(m[E-2].start,m[E-2].end)==="ReturnType"&&p.slice(m[E-1].start,m[E-1].end)==="<"&&m[b+1]&&p.slice(m[b+1].start,m[b+1].end)===">",M=I&&et&&L.length===1?$a(I.trim(),L[0]):void 0;if(M){q=m[E-2].start,D=m[++b].end;let N=q===0&&D===p.length;C+=p.slice(S,q)+(N||!M.includes("|")?M:`(${M})`),S=D;continue}if(j&&et)q=m[E-2].start,D=m[++b].end;C+=p.slice(S,q)+(P??"unknown"),S=D}return C+p.slice(S)}function Qt(e){let c=t(e),i=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))i++;else if([")","]","}"].includes(u))i--;else if(!i&&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 r=e.slice(c[s].end).trim();if(r==="const")return;i=0;for(let l of c.slice(s+1)){if(l.kind!=="punctuation")continue;let f=e.slice(l.start,l.end);if(!i&&["??","||","&&"].some((u)=>e.startsWith(u,l.start)))return;if(["(","[","{","<"].includes(f))i++;else if([")","]","}",">"].includes(f))i--;else if(!i&&["+","-","*","/","%","=","!",";"].includes(f))return}return r}function It(e,c){let i=0;for(let s of t(e)){if(s.kind!=="punctuation")continue;let r=e.slice(s.start,s.end);if(["(","[","{"].includes(r))i++;else if([")","]","}"].includes(r))i--;if(!i&&e.startsWith(c,s.start))return s.start}return-1}function Xt(e){if(e.includes("=>"))return null;let c=[],i=0,s=0;for(let r=0;r<=e.length;r++){let l=r===e.length?"|":e[r];if(l==="'"||l==='"'||l==="`"){r++;while(r<e.length&&e[r]!==l)r+=e[r]==="\\"?2:1;if(r>=e.length)return null}else if(l==="("||l==="["||l==="{"||l==="<")i++;else if(l===")"||l==="]"||l==="}"||l===">")i--;else if(l==="|"&&i===0){let f=e.slice(s,r).trim();if(f)c.push(f);s=r+1}if(i<0)return null}return i===0?c:null}function Yt(e,c){let i=Xt(c);if(!i)return`${e} | ${c}`;let s=[];for(let d of[e,...i]){if(d==="unknown")return"unknown";if(!s.includes(d))s.push(d)}let r=s.includes("boolean")||s.includes("true")&&s.includes("false"),l=s.includes("string"),f=s.includes("number"),u=[],a=!1;for(let d of s)if(r&&(d==="true"||d==="false"||d==="boolean")){if(!a)u.push("boolean");a=!0}else if(l&&Zt(d))continue;else if(f&&/^-?\d+(?:\.\d+)?$/.test(d))continue;else u.push(d);return u.join(" | ")}function Zt(e){let c=e[0];return e.length>=2&&(c==="'"||c==='"')&&e.endsWith(c)&&!e.slice(1,-1).includes(c)}function vt(e,c,i){let s=Z(c)!==-1?`(${c.trim()})`:c;if(e.trim()==="unknown")return i==="&&"||s.trim()==="unknown"?"unknown":`{} | ${s}`;let r=e.trim();if(r==="boolean"||r==="string"||r==="number"){if(i==="??")return r;return Yt(i==="||"?r==="boolean"?"true":r:r==="boolean"?"false":r==="string"?"''":"0",s)}let l="false | 0 | 0n | '' | null | undefined";if(i==="??")return`([${e}] extends [NonNullable<${e}>] ? ${e} : NonNullable<${e}> | ${s})`;if(i==="||")return`([${e}] extends [object] ? ${e} : [Exclude<${e}, object> & (${l})] extends [never] ? ${e} : Exclude<NonNullable<${e}>, ${l}> | ${s})`;return`([${e}] extends [object] ? ${s} : [${e}] extends [${l}] ? ${e} : unknown extends (${e}) ? ${e} : (Exclude<${e}, object> & (${l})) | ${s})`}function te(e){let c=`(NonNullable<${e}> extends infer __dtsx_spread_value ? { -readonly [__dtsx_spread_key in keyof __dtsx_spread_value]: __dtsx_spread_value[__dtsx_spread_key] } : never)`,i=`(NonNullable<${e}> extends infer __dtsx_spread_value ? { -readonly [__dtsx_spread_key in keyof __dtsx_spread_value]?: __dtsx_spread_value[__dtsx_spread_key] } : never)`;return`([${e}] extends [null | undefined] ? {} : [${e}] extends [NonNullable<${e}>] ? ${c} : ${i})`}function ne(e,c){let i=e.trim();while(at(i))i=i.slice(1,-1).trim();let s=It(i,"??");if(s!==-1&&i.slice(s+2).trim()==="{}")return te(c(i.slice(0,s)));let r=Rt(i);if(r){if(r.whenFalse.trim()==="{}")return`Partial<${c(r.whenTrue)}>`;if(r.whenTrue.trim()==="{}")return`Partial<${c(r.whenFalse)}>`}return c(i)}function Et(e){return e.map((c)=>e.length>1&&Z(c)!==-1?`(${c})`:c).join(" | ")}function st(e){let c=0;while(c<e.length){let r=e.charCodeAt(c);if(r<=32)c++;else if(r===47&&e.charCodeAt(c+1)===47){c+=2;while(c<e.length&&e.charCodeAt(c)!==10&&e.charCodeAt(c)!==13)c++}else if(r===47&&e.charCodeAt(c+1)===42){let l=e.indexOf("*/",c+2);c=l===-1?e.length:l+2}else break}let i=c,s=c;while(s<e.length){let r=e.charCodeAt(s);if(r===34||r===39||r===96){s=J(e,s,r),i=s;continue}if(r===92){s=Math.min(s+2,e.length),i=s;continue}if(r===47&&e.charCodeAt(s+1)===47){while(s<e.length&&e.charCodeAt(s)!==10&&e.charCodeAt(s)!==13)s++;continue}if(r===47&&e.charCodeAt(s+1)===42){let l=e.indexOf("*/",s+2);s=l===-1?e.length:l+2;continue}if(s++,r>32)i=s}return e.slice(c,i)}function jt(e){if(!e.startsWith("<"))return;let c=H(e)(0,0);if(!c||c.parameters||c.completeOperand||!e.slice(c.end).trim()||!nt(e.slice(c.end).trim()))return;return e.slice(1,c.end-1).trim()}function nt(e){e=st(e);let c=0,i;for(let s=0;s<e.length;s++){let r=e[s];if(r==="'"||r==='"'||r==="`"){let l=s+1;while(l<e.length&&e[l]!==r){if(e[l]==="\\")l++;l++}s=l;continue}if(r==="/"){if(e[s+1]==="/"){let l=e.indexOf(`
9
9
  `,s+2);s=l===-1?e.length:l;continue}if(e[s+1]==="*"){let l=e.indexOf("*/",s+2);s=l===-1?e.length:l+1;continue}if(h(e,s)){s=g(e,s)-1;continue}}if(r==="<"&&c===0){i??=H(e);let l=i(s,0);if(l){s=l.end-1;continue}}if(r==="("||r==="["||r==="{")c++;else if(r===")"||r==="]"||r==="}")c--;else if(c!==0)continue;else if(r==="?"){if(e[s+1]!==".")return!1}else if("=!<>&|+-*/%,:".includes(r))return!1;else if(r===" "||r==="\t"||r===`
10
10
  `||r==="\r"){let l=e.slice(s).trimStart(),f=/[A-Za-z]+$/.exec(st(e.slice(0,s)))?.[0];if(s=e.length-l.length-1,f&&["new","void","typeof","delete","await","yield"].includes(f))continue;if(l&&l[0]!=="."&&l[0]!=="?"&&l[0]!=="("&&l[0]!=="[")return!1}}return!0}function re(e){if(e.startsWith("function")&&tt(e,0,8))return!0;let c=Z(e);if(c===-1)return!1;let i=e.slice(0,c).trim();if(i.startsWith("async")&&tt(i,0,5))i=i.slice(5).trim();if(i.startsWith("<")){let r=o(i,0,"<",">");if(r===-1)return!1;i=i.slice(r+1).trim()}if(i.startsWith("(")){let r=o(i,0,"(",")");if(r===-1)return!1;let l=i.slice(r+1).trim();if(l&&!l.startsWith(":"))return!1}let s=Ct(i);return at(s.params)||v(s.params)}function at(e){if(!e.startsWith("(")||!e.endsWith(")"))return!1;let c=0;for(let i=0;i<e.length;i++){let s=e.charCodeAt(i);if(s===40)c++;else if(s===41&&--c===0)return i===e.length-1}return!1}function Rt(e){let c=0,i=-1;for(let s=0;s<e.length;s++){let r=e.charCodeAt(s);if(r===34||r===39||r===96){s=J(e,s,r)-1;continue}if(r===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(r===40||r===91||r===123)c++;else if(r===41||r===93||r===125)c--;else if(r===63&&c===0&&e.charCodeAt(s+1)!==63)i=s;else if(r===58&&c===0&&i!==-1)return{whenTrue:st(e.slice(i+1,s)),whenFalse:st(e.slice(s+1))}}return null}function tt(e,c,i){return(c===0||!V(e.charCodeAt(c-1)))&&!V(e.charCodeAt(c+i))}function Mt(e,c){let i=c;while(i<e.length){if(e.charCodeAt(i)<=32){i++;continue}if(e.startsWith("//",i)){while(i<e.length&&e.charCodeAt(i)!==10&&e.charCodeAt(i)!==13)i++;continue}if(e.startsWith("/*",i)){let s=e.indexOf("*/",i+2);i=s<0?e.length:s+2;continue}break}return i}function ie(e,c){let i=0,s=0,r=0,l=!1,f=!1;for(let u=c;u<e.length;u++){if(u=Mt(e,u),u>=e.length)break;let a=e.charCodeAt(u);if(a===34||a===39||a===96){u=J(e,u,a)-1,f=!1;continue}if(V(a)||a>=128){let d=u;while(u+1<e.length&&(V(e.charCodeAt(u+1))||e.charCodeAt(u+1)>=128))u++;f=l&&["keyof","typeof","readonly","unique","new","abstract","infer","extends"].includes(e.slice(d,u+1));continue}if(a===61&&e.charCodeAt(u+1)===62){u++,f=l;continue}if(a===40)i++;else if(a===41)i--,f=!1;else if(a===91)s++;else if(a===93)s--,f=!1;else if(a===60&&i===0&&s===0)r++;else if(a===62&&r>0&&i===0&&s===0)r--,f=!1;else if(a===123)if(i||s||r||l&&f)u=ot(e,u)-1,f=!1;else return u;else if(i===0&&s===0&&r===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 ot(e,c){let i=1,s=c+1;while(s<e.length&&i>0){let r=e.charCodeAt(s);if(r===34||r===39||r===96){s=J(e,s,r);continue}if(r===47&&e.charCodeAt(s+1)===47){s+=2;while(s<e.length&&e.charCodeAt(s)!==10&&e.charCodeAt(s)!==13)s++;continue}if(r===47&&e.charCodeAt(s+1)===42){let l=e.indexOf("*/",s+2);s=l===-1?e.length:l+2;continue}if(r===123)i++;else if(r===125)i--;s++}return s}function J(e,c,i){let s=c+1;while(s<e.length){let r=e.charCodeAt(s);if(r===92){s+=2;continue}if(i===96&&r===36&&e.charCodeAt(s+1)===123){s=ot(e,s+1);continue}if(s++,r===i)break}return s}function se(e,c){if(e.includes(".raw`")||e.includes("String.raw`"))return"string";if(!c||e.includes("${")||e.includes(`
11
- `)||e.includes("\r"))return"string";return e}function Ht(e,c){let i=t(e),s=(a)=>i[a]?e.slice(i[a].start,i[a].end):"";if(s(0)!=="new"||i[1]?.kind!=="word"||["class","function","new","super"].includes(s(1)))return"unknown";let r=2,l=[s(1)];while(s(r)==="."&&i[r+1]?.kind==="word")l.push(s(r+1)),r+=2;let f=l.join(".");if(!c&&(f.charCodeAt(0)<65||f.charCodeAt(0)>90))return"unknown";let u="";if(s(r)==="<"){let a=i[r].start,d=H(e)(a,0);if(!d||!d.completeOperand||d.parameters)return"unknown";u=e.slice(a,d.end);while(r<i.length&&i[r].start<d.end)r++}if(r<i.length){if(s(r)!=="(")return"unknown";let a=0,d=!1;for(;r<i.length;r++)if(s(r)==="(")a++;else if(s(r)===")"&&--a===0){d=r===i.length-1;break}if(!d)return"unknown"}if(c)return c(f)?f+u:`InstanceType<typeof ${f}${u}>`;if(u)return f+u;switch(f){case"Map":return"Map<any, any>";case"Set":return"Set<any>";case"WeakMap":return"WeakMap<any, any>";case"WeakSet":return"WeakSet<any>";case"Array":return"any[]";case"Object":return"object";case"Promise":return"Promise<any>";default:return f}}function oe(e){return"{ new (...args: any[]): any }"}function Nt(e,c,i=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,i+1,s)}>`}return"Promise<unknown>"}if(e.startsWith("Promise.reject("))return"Promise<never>";if(e.startsWith("Promise.all(")){let r=e.indexOf("[",12),l=e.lastIndexOf("]");if(r!==-1&&l>r){let f=e.slice(r+1,l).trim(),u=Q(f),a=[];for(let d=0;d<u.length;d++){let x=u[d].trim();if(x.startsWith("Promise.resolve(")){let T=Nt(x,c,i+1,s),w=T.indexOf("<"),A=T.lastIndexOf(">");a.push(w!==-1&&A>w?T.slice(w+1,A):"unknown")}else a.push(n(x,c,!1,i+1,s))}return`Promise<[${a.join(", ")}]>`}return"Promise<unknown[]>"}return"Promise<unknown>"}function Be(e,c,i=0,s){let r=e.slice(1,-1).trim();if(!r)return"never[]";if(i>=lt)return"unknown[]";let l=Q(r),f=!1;for(let A=0;A<l.length;A++){let p=l[A],m=p.length;while(m>0&&p.charCodeAt(m-1)<=32)m--;if(m>=8&&p.slice(m-8,m)==="as const"){f=!0;break}}if(f){let A=[];for(let p=0;p<l.length;p++){let m=l[p].trim();if(m.endsWith("as const")){let C=m.slice(0,-8).trim();if(C.startsWith("[")&&C.endsWith("]")){let S=C.slice(1,-1).trim(),b=Q(S),k=[];for(let O=0;O<b.length;O++)k.push(n(b[O].trim(),!0,!1,i+1,s));A.push(`readonly [${k.join(", ")}]`)}else A.push(n(C,!0,!1,i+1,s))}else if(m.startsWith("[")&&m.endsWith("]"))A.push(Be(m,!0,i+1,s));else A.push(n(m,!0,!1,i+1,s))}return`readonly [
11
+ `)||e.includes("\r"))return"string";return e}function Kt(e,c){let i=t(e),s=(a)=>i[a]?e.slice(i[a].start,i[a].end):"";if(s(0)!=="new"||i[1]?.kind!=="word"||["class","function","new","super"].includes(s(1)))return"unknown";let r=2,l=[s(1)];while(s(r)==="."&&i[r+1]?.kind==="word")l.push(s(r+1)),r+=2;let f=l.join(".");if(!c&&(f.charCodeAt(0)<65||f.charCodeAt(0)>90))return"unknown";let u="";if(s(r)==="<"){let a=i[r].start,d=H(e)(a,0);if(!d||!d.completeOperand||d.parameters)return"unknown";u=e.slice(a,d.end);while(r<i.length&&i[r].start<d.end)r++}if(r<i.length){if(s(r)!=="(")return"unknown";let a=0,d=!1;for(;r<i.length;r++)if(s(r)==="(")a++;else if(s(r)===")"&&--a===0){d=r===i.length-1;break}if(!d)return"unknown"}if(c)return c(f)?f+u:`InstanceType<typeof ${f}${u}>`;if(u)return f+u;switch(f){case"Map":return"Map<any, any>";case"Set":return"Set<any>";case"WeakMap":return"WeakMap<any, any>";case"WeakSet":return"WeakSet<any>";case"Array":return"any[]";case"Object":return"object";case"Promise":return"Promise<any>";default:return f}}function oe(e){return"{ new (...args: any[]): any }"}function Nt(e,c,i=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,i+1,s)}>`}return"Promise<unknown>"}if(e.startsWith("Promise.reject("))return"Promise<never>";if(e.startsWith("Promise.all(")){let r=e.indexOf("[",12),l=e.lastIndexOf("]");if(r!==-1&&l>r){let f=e.slice(r+1,l).trim(),u=Q(f),a=[];for(let d=0;d<u.length;d++){let x=u[d].trim();if(x.startsWith("Promise.resolve(")){let T=Nt(x,c,i+1,s),w=T.indexOf("<"),A=T.lastIndexOf(">");a.push(w!==-1&&A>w?T.slice(w+1,A):"unknown")}else a.push(n(x,c,!1,i+1,s))}return`Promise<[${a.join(", ")}]>`}return"Promise<unknown[]>"}return"Promise<unknown>"}function Be(e,c,i=0,s){let r=e.slice(1,-1).trim();if(!r)return"never[]";if(i>=lt)return"unknown[]";let l=Q(r),f=!1;for(let A=0;A<l.length;A++){let p=l[A],m=p.length;while(m>0&&p.charCodeAt(m-1)<=32)m--;if(m>=8&&p.slice(m-8,m)==="as const"){f=!0;break}}if(f){let A=[];for(let p=0;p<l.length;p++){let m=l[p].trim();if(m.endsWith("as const")){let C=m.slice(0,-8).trim();if(C.startsWith("[")&&C.endsWith("]")){let S=C.slice(1,-1).trim(),b=Q(S),k=[];for(let O=0;O<b.length;O++)k.push(n(b[O].trim(),!0,!1,i+1,s));A.push(`readonly [${k.join(", ")}]`)}else A.push(n(C,!0,!1,i+1,s))}else if(m.startsWith("[")&&m.endsWith("]"))A.push(Be(m,!0,i+1,s));else A.push(n(m,!0,!1,i+1,s))}return`readonly [
12
12
  ${A.join(` |
13
13
  `)}
14
- ]`}let u=ft&&!c,a=[],d=[];for(let A of l){let p=A.trim(),m=_;if(_=null,p.startsWith("...")){let C=p.slice(3).trim(),S=n(C,!1,!1,i+1,s);if(S.endsWith("[]"))a.push(S.slice(0,-2));else if(S.startsWith("readonly [")&&S.endsWith("]"))a.push(S.slice(10,-1));else if(Y(C))a.push(`(typeof ${C})[number]`);else a.push("unknown")}else if(p.startsWith("[")&&p.endsWith("]"))a.push(Be(p,c,i+1,s));else a.push(Ut(p,c,i+1,s));if(u)d.push(_);_=m}if(u)if(mt(e))_=it(e);else{let A=[];for(let p=0;p<l.length;p++){let m=l[p].trim();if(m.endsWith("as const"))continue;if(ct(m)||m==="null"||m==="undefined")A.push(m);else if(m.startsWith("[")&&mt(m))A.push(it(m));else if(m.startsWith("{")){if(d[p])A.push(d[p])}else{let C=n(m,!1,!1,0,s);if(C!=="unknown")A.push(C)}}if(A.length>0)_=`[${A.join(", ")}]`}if(c)return`readonly [${a.join(", ")}]`;let x=new Set,T=[],w=!0;for(let A of a){if(!x.has(A))x.add(A),T.push(A);if(w){if(!(y(A)||A==="true"||A==="false"||A.charCodeAt(0)===34&&A.charCodeAt(A.length-1)===34||A.charCodeAt(0)===39&&A.charCodeAt(A.length-1)===39))w=!1}}if(w&&a.length<=10)return`readonly [${a.join(", ")}]`;if(T.length===1)return`${T[0]}[]`;return`(${T.join(" | ")})[]`}function Q(e){let c=[],i=0,s=!1,r=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===r)s=!1;f=u+1;continue}if(a===47&&e.charCodeAt(u+1)===47){let d=e.indexOf(`
15
- `,u+2);u=(d===-1?e.length:d)-1;continue}if(a===47&&e.charCodeAt(u+1)===42){let d=e.indexOf("*/",u+2);u=(d===-1?e.length:d+2)-1;continue}if(a===32||a===9||a===10||a===13)continue;if(a===44&&i===0){if(l!==-1)c.push(e.slice(l,f));l=-1;continue}if(a===34||a===39||a===96)s=!0,r=a;else if(a===91||a===123||a===40)i++;else if(a===93||a===125||a===41)i--;if(l===-1)l=u;f=u+1}if(l!==-1)c.push(e.slice(l,f));return c}function ct(e){if(y(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 rr(e){let c=[],i=0;while(i<e.length){while(i<e.length&&e.charCodeAt(i)<=32)i++;if(e.startsWith("/*",i)){let s=e.indexOf("*/",i+2);if(s===-1)break;c.push(e.slice(i,s+2)),i=s+2}else if(e.startsWith("//",i)){let s=i;while(s<e.length&&e.charCodeAt(s)!==10&&e.charCodeAt(s)!==13)s++;c.push(e.slice(i,s).trimEnd()),i=s}else break}return c}function Kt(e,c,i){let s=c.trim();if(!Lt(i)||!ct(s))return"";let r=(e??[]).map((f)=>f.trim()).filter((f)=>f.startsWith("/**")||f.startsWith("//")).join(`
14
+ ]`}let u=ft&&!c,a=[],d=[];for(let A of l){let p=A.trim(),m=_;if(_=null,p.startsWith("...")){let C=p.slice(3).trim(),S=n(C,!1,!1,i+1,s);if(S.endsWith("[]"))a.push(S.slice(0,-2));else if(S.startsWith("readonly [")&&S.endsWith("]"))a.push(S.slice(10,-1));else if(Y(C))a.push(`(typeof ${C})[number]`);else a.push("unknown")}else if(p.startsWith("[")&&p.endsWith("]"))a.push(Be(p,c,i+1,s));else a.push(Ht(p,c,i+1,s));if(u)d.push(_);_=m}if(u)if(mt(e))_=it(e);else{let A=[];for(let p=0;p<l.length;p++){let m=l[p].trim();if(m.endsWith("as const"))continue;if(ct(m)||m==="null"||m==="undefined")A.push(m);else if(m.startsWith("[")&&mt(m))A.push(it(m));else if(m.startsWith("{")){if(d[p])A.push(d[p])}else{let C=n(m,!1,!1,0,s);if(C!=="unknown")A.push(C)}}if(A.length>0)_=`[${A.join(", ")}]`}if(c)return`readonly [${a.join(", ")}]`;let x=new Set,T=[],w=!0;for(let A of a){if(!x.has(A))x.add(A),T.push(A);if(w){if(!(y(A)||A==="true"||A==="false"||A.charCodeAt(0)===34&&A.charCodeAt(A.length-1)===34||A.charCodeAt(0)===39&&A.charCodeAt(A.length-1)===39))w=!1}}if(w&&a.length<=10)return`readonly [${a.join(", ")}]`;if(T.length===1)return`${T[0]}[]`;return`(${T.join(" | ")})[]`}function Q(e){let c=[],i=0,s=!1,r=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===r)s=!1;f=u+1;continue}if(a===47&&e.charCodeAt(u+1)===47){let d=e.indexOf(`
15
+ `,u+2);u=(d===-1?e.length:d)-1;continue}if(a===47&&e.charCodeAt(u+1)===42){let d=e.indexOf("*/",u+2);u=(d===-1?e.length:d+2)-1;continue}if(a===32||a===9||a===10||a===13)continue;if(a===44&&i===0){if(l!==-1)c.push(e.slice(l,f));l=-1;continue}if(a===34||a===39||a===96)s=!0,r=a;else if(a===91||a===123||a===40)i++;else if(a===93||a===125||a===41)i--;if(l===-1)l=u;f=u+1}if(l!==-1)c.push(e.slice(l,f));return c}function ct(e){if(y(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 ir(e){let c=[],i=0;while(i<e.length){while(i<e.length&&e.charCodeAt(i)<=32)i++;if(e.startsWith("/*",i)){let s=e.indexOf("*/",i+2);if(s===-1)break;c.push(e.slice(i,s+2)),i=s+2}else if(e.startsWith("//",i)){let s=i;while(s<e.length&&e.charCodeAt(s)!==10&&e.charCodeAt(s)!==13)s++;c.push(e.slice(i,s).trimEnd()),i=s}else break}return c}function qt(e,c,i){let s=c.trim();if(!Lt(i)||!ct(s))return"";let r=(e??[]).map((f)=>f.trim()).filter((f)=>f.startsWith("/**")||f.startsWith("//")).join(`
16
16
  `),l;if(r.includes("@defaultValue"))l=r;else{let f=`@defaultValue ${be(s)}`;if(!r)l=`/** ${f} */`;else{let u=r.lastIndexOf("*/");if(u!==-1){let a=r.slice(0,u).trimEnd();if(a.startsWith("/** ")&&!a.includes(`
17
17
  `))a=`/**
18
18
  * ${a.slice(4)}`;l=`${a}
@@ -24,7 +24,7 @@ import{h,g}from"./chunk-cgqg1br8.js";import{t}from"./chunk-6ekgn7sc.js";import{G
24
24
  `).map((f)=>{let u=f.trim();if(!u)return"";return u.startsWith("*")?` ${u}`:` ${u}`}).join(`
25
25
  `)+`
26
26
  `}function mt(e){let c=!1,i=0,s=e.length;for(let r=0;r<s;r++){let l=e.charCodeAt(r);if(c){if(l===92){r++;continue}if(l===i)c=!1;continue}if(l===34||l===39||l===96){c=!0,i=l;continue}if(l===61&&r+1<s&&e.charCodeAt(r+1)===62)return!1;if(l===47&&(e.charCodeAt(r+1)===47||e.charCodeAt(r+1)===42))return!1;if(l>=97&&l<=122){let f=r;while(r<s&&(e.charCodeAt(r)>=97&&e.charCodeAt(r)<=122||e.charCodeAt(r)>=65&&e.charCodeAt(r)<=90||e.charCodeAt(r)>=48&&e.charCodeAt(r)<=57||e.charCodeAt(r)===95||e.charCodeAt(r)===36))r++;let u=e.slice(f,r);if(u==="new"||u==="async"||u==="await"||u==="function"||u==="yield"||u==="console"||u==="process")return!1;let a=r;while(a<s&&e.charCodeAt(a)<=32)a++;if(a<s&&e.charCodeAt(a)===40)return!1;r--}}return!0}function dt(e,c,i=0,s,r){let l=e.slice(1,-1).trim();if(!l)return"{}";if(i>=lt)return"Record<string, unknown>";let f=ae(l),u=new Set(f.flatMap(([S])=>{let b=Tt(At(S).key);return b?.kind==="get"?[b.name]:[]})),a=[],d=[],x=[],T=!1,w=ft&&!c,A=[],p=0;for(let[S,b]of f){let{comments:k,key:O}=At(S),P=k?`${k}
27
- `:"",I=Tt(O);if(I&&ar(I.name))continue;let j=O,q=!1;if(O==="..."){let R=b.trim(),G=r?ne(R,r):Y(R)?`typeof ${R}`:n(R,c,!1,i+1,s);if(G!=="unknown")d.push(G);if(w&&(Y(R)||R.startsWith("{")))A.push(`...${it(R)}`);continue}let D=_;_=null;let E,L=b.trim();if(L===O&&v(L))E=r?.(b)??(c?void 0:s?.mutableBindingTypes?.get(L))??`typeof ${L}`;else if(he(L)){q=!0;let R=ge(O);if(R){j=R.name;let G="";if(L.startsWith("async "))G="async ";if(L.charCodeAt(G.length)===42)G+="*";E=St(R.name,G+R.typeParams+L.slice(G.length))}else E=St(O,L)}else{if(E=r?.(b)??n(b,c,!1,i+1,s),E==="unknown"&&Y(L))E=(c?void 0:s?.mutableBindingTypes?.get(L))??`typeof ${L}`;if(E.includes("=>")||E.includes("function")||E.includes("async"))E=xt(E)}let X=_;_=D;let et=j,M=b.trim(),N=sr(j,s);if(!or(I?.name??j,s)&&!(I?.kind==="set"&&u.has(I.name)))x.push(I?de(I.kind,E):E);if(N&&"index"in N)T=!0;else{if(N&&"name"in N)j=N.name;if(I){let R=ue(I.kind,I.name,E);if(R){a.push(`${P}${W(R)}`);continue}}if(!c&&Lt(E)&&ct(M))a.push(`${P}/** @defaultValue ${be(M)} */
27
+ `:"",I=Tt(O);if(I&&cr(I.name))continue;let j=O,q=!1;if(O==="..."){let R=b.trim(),G=r?ne(R,r):Y(R)?`typeof ${R}`:n(R,c,!1,i+1,s);if(G!=="unknown")d.push(G);if(w&&(Y(R)||R.startsWith("{")))A.push(`...${it(R)}`);continue}let D=_;_=null;let E,L=b.trim();if(L===O&&v(L))E=r?.(b)??(c?void 0:s?.mutableBindingTypes?.get(L))??`typeof ${L}`;else if(he(L)){q=!0;let R=ge(O);if(R){j=R.name;let G="";if(L.startsWith("async "))G="async ";if(L.charCodeAt(G.length)===42)G+="*";E=St(R.name,G+R.typeParams+L.slice(G.length))}else E=St(O,L)}else{if(E=r?.(b)??n(b,c,!1,i+1,s),E==="unknown"&&Y(L))E=(c?void 0:s?.mutableBindingTypes?.get(L))??`typeof ${L}`;if(E.includes("=>")||E.includes("function")||E.includes("async"))E=xt(E)}let X=_;_=D;let et=j,M=b.trim(),N=or(j,s);if(!ar(I?.name??j,s)&&!(I?.kind==="set"&&u.has(I.name)))x.push(I?de(I.kind,E):E);if(N&&"index"in N)T=!0;else{if(N&&"name"in N)j=N.name;if(I){let R=ue(I.kind,I.name,E);if(R){a.push(`${P}${W(R)}`);continue}}if(!c&&Lt(E)&&ct(M))a.push(`${P}/** @defaultValue ${be(M)} */
28
28
  ${j}: ${W(E)}`);else a.push(`${P}${c?"readonly ":""}${j}: ${W(E)}`)}if(w){let R=Ot(et);if(M.endsWith("as const"));else if(ct(M))A.push(`${R}: ${M}`);else if(M.startsWith("[")&&mt(M))A.push(`${R}: ${it(M)}`);else if(M.startsWith("{")){if(X)A.push(`${R}: ${X}`)}else if(q)A.push(`${R}: ${ht(xt(E))}`),p++;else if(!M.startsWith("[")&&(M.includes("=>")||M.startsWith("function")||M.startsWith("async"))){let G=pt(M,!1,0,!0);A.push(`${R}: ${ht(G)}`),p++}}}if(w&&A.length>p){let S=i>0?(i-1)/2:0,b=`{ ${A.join(", ")} }`;if(b.length<=80)_=b;else{let k=" ".repeat((S+1)*2),O=" ".repeat(S*2);_=`{
29
29
  ${k}${A.join(`,
30
30
  ${k}`)}
@@ -36,5 +36,5 @@ ${O}}`}}if(T&&d.length===0){let S=[...new Set(x)].map((b)=>b.includes("=>")||b.i
36
36
  `),s=i.indexOf("async");if(s!==-1){let x=s>0?i.charCodeAt(s-1):32,T=s+5<i.length?i.charCodeAt(s+5):32;if(!V(x)&&!V(T))i=(i.slice(0,s)+i.slice(s+5)).trim()}let r=i.indexOf("(");if(r!==-1){let x=o(i,r,"(",")");if(x!==-1){let T=i.slice(r,x+1),w=ye(T);i=i.slice(0,r)+w+i.slice(x+1)}}let l=i.length,f="",u=[],a=!1,d=!1;for(let x=0;x<l;x++){let T=i.charCodeAt(x);if(T===123||T===40)u.push(T);else if(T===125||T===41)u.pop();if(T<=32){if(a=!0,T===10||T===13)d=!0;continue}if(a&&f.length>0){let A=(u.length>0?u[u.length-1]:0)===123;if(d&&A){let p=f.charCodeAt(f.length-1),m=p===59||p===44||p===123||T===125,C=f.length>=2&&f.charCodeAt(f.length-1)===47&&f.charCodeAt(f.length-2)===42;if(!m&&!C)f+="; ";else f+=" "}else f+=" "}a=!1,d=!1,f+=i[x]}return f.trim()}function V(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95||e===36}function ye(e){let c=e.trim(),i,s=!1;if(c.startsWith("(")&&c.endsWith(")"))i=c.slice(1,-1),s=!0;else i=c;let r=i.trim();if(!r)return s?"()":"";let l=!1;{let p=0;for(let m=0;m<r.length;m++){let C=r.charCodeAt(m);if(C===40||C===60||C===91||C===123)p++;else if(C===41||C===93||C===125||C===62&&r.charCodeAt(m-1)!==61)p--;else if(p===0&&C===61){let S=m>0?r.charCodeAt(m-1):0,b=m+1<r.length?r.charCodeAt(m+1):0;if(S!==61&&S!==33&&S!==60&&S!==62&&b!==61&&b!==62){l=!0;break}}}}if(!l)return c;let f=[],u=[],a=0,d=0,x=!1,T=0;for(let p=0;p<=r.length;p++){if(p===r.length){f.push(r.slice(a));break}let m=r.charCodeAt(p);if(x){if(m===92){p++;continue}if(m===T)x=!1;continue}if(m===47&&p+1<r.length){let C=r.charCodeAt(p+1);if(C===42){p+=2;while(p+1<r.length&&!(r.charCodeAt(p)===42&&r.charCodeAt(p+1)===47))p++;p++;continue}if(C===47){while(p<r.length&&r.charCodeAt(p)!==10)p++;continue}}if(m===39||m===34||m===96){x=!0,T=m;continue}if(m===40||m===60||m===91||m===123)d++;else if(m===41||m===93||m===125||m===62&&r.charCodeAt(p-1)!==61)d--;else if(m===44&&d===0){f.push(r.slice(a,p));let C=",",S=p+1;while(S<r.length&&r.charCodeAt(S)<=32)C+=r[S],S++;u.push(C),a=S}}let w=[];for(let p of f){let m=p.trim();if(!m){w.push(p);continue}if(m.startsWith("//"))continue;let C=_t(m),S=p.slice(0,p.length-p.trimStart().length);w.push(S+le(C))}let A=w[0]||"";for(let p=1;p<w.length;p++)A+=(u[p-1]||", ")+w[p];return _e(s?`(${A})`:A)}function _t(e){let c=!1,i=0;for(let s=0;s<e.length-1;s++){let r=e.charCodeAt(s);if(c){if(r===92){s++;continue}if(r===i)c=!1;continue}if(r===39||r===34||r===96){c=!0,i=r;continue}if(r===47&&e.charCodeAt(s+1)===47)return e.slice(0,s).trimEnd()}return e}function le(e){if(e.startsWith("..."))return e;let c=-1,i=-1,s=0,r=!1,l=0;for(let u=0;u<e.length;u++){let a=e.charCodeAt(u);if(r){if(a===92){u++;continue}if(a===l)r=!1;continue}if(a===47&&u+1<e.length){let d=e.charCodeAt(u+1);if(d===42){u+=2;while(u+1<e.length&&!(e.charCodeAt(u)===42&&e.charCodeAt(u+1)===47))u++;u++;continue}if(d===47){while(u<e.length&&e.charCodeAt(u)!==10)u++;continue}}if(a===39||a===34||a===96){r=!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&&i===-1&&(u===0||e.charCodeAt(u-1)!==61)&&(u+1>=e.length||e.charCodeAt(u+1)!==61&&e.charCodeAt(u+1)!==62))i=u}}let f=i!==-1;if(c!==-1&&(i===-1||c<i)){let u=e.slice(0,c).trim(),a=i!==-1?e.slice(c+1,i).trim():e.slice(c+1).trim(),d=f&&!u.endsWith("?")?"?":"";return`${u}${d}: ${a}`}else if(i!==-1){let u=e.slice(0,i).trim(),a=we(u,e.slice(i+1));if(a)return je(a,bt);let d=!u.endsWith("?")?"?":"";return`${u}${d}: ${bt(e.slice(i+1))}`}return e}function bt(e){let c=e.trim();if(c==="true"||c==="false")return"boolean";if(y(c))return"number";if(c.startsWith("'")&&c.endsWith("'")||c.startsWith('"')&&c.endsWith('"'))return"string";if(c.startsWith("["))return"unknown[]";if(c.startsWith("{"))return"Record<string, unknown>";return"unknown"}function fe(e){let c=0,i=e.length;while(c<i){while(c<i&&(e.charCodeAt(c)===32||e.charCodeAt(c)===9||e.charCodeAt(c)===10||e.charCodeAt(c)===13))c++;if(c+1<i&&e.charCodeAt(c)===47&&e.charCodeAt(c+1)===42){c+=2;while(c+1<i&&!(e.charCodeAt(c)===42&&e.charCodeAt(c+1)===47))c++;c+=2;continue}break}return c}function At(e){let c=[],i=0,s=e.length;while(i<s){while(i<s&&e.charCodeAt(i)<=32)i++;if(i+1>=s||e.charCodeAt(i)!==47||e.charCodeAt(i+1)!==42)break;let r=i;i+=2;while(i+1<s&&!(e.charCodeAt(i)===42&&e.charCodeAt(i+1)===47))i++;i=Math.min(i+2,s),c.push(e.slice(r,i).trim())}return{comments:c.join(`
37
37
  `),key:e.slice(i).trim()}}function ae(e){let c=[],i="",s="",r=0,l=!1,f="",u=!0,a=!1,d=0,x=!1,T=!1,w=0,A=!1,p=!1;for(let m=0;m<e.length;m++){let C=e.charCodeAt(m),S=m>0?e.charCodeAt(m-1):0,b=m<e.length-1?e.charCodeAt(m+1):0;if(!l&&!a&&C===47&&b===47){i=i.replace(/[ \t]+$/,""),m+=2;while(m<e.length&&e.charCodeAt(m)!==10)m++;m--;continue}if(!l&&!a&&C===47&&b===42){a=!0,d=1,i+="/*",m++;continue}else if(a&&C===42&&b===47){if(d--,i+="*/",m++,d===0)a=!1;continue}else if(a&&C===47&&b===42){d++,i+="/*",m++;continue}let k=e[m];if(!l&&!a&&(C===34||C===39||C===96))l=!0,f=k,i+=k;else if(l&&k===f&&S!==92)l=!1,i+=k;else if(!l&&!a)if(C===46&&b===46&&e.charCodeAt(m+2)===46&&r===0&&u)s=`${i.trim()}...`,i="",u=!1,A=!1,m+=2;else if(C===40&&r===0&&u&&w===0){s=i.trim();let O=fe(s),P=O>0?s.slice(0,O):"",I=s.slice(O),j="";if(I.startsWith("async ")||I.startsWith("async\t")||I.startsWith(`async
38
38
  `))I=I.slice(6).trimStart(),j="async ";if(I.startsWith("*"))I=I.slice(1).trimStart(),j+="*";s=P+I,i=j+k,u=!1,A=!0,p=!1,r=1}else if(C===123||C===91||C===40){if(r++,i+=k,p&&C===123)p=!1}else if(C===125||C===93||C===41){if(r--,i+=k,C===41&&r===0&&!u&&!A)x=!0;if(A){if(C===41&&r===0&&!p)p=!0;else if(C===125&&r===0)A=!1,p=!1}}else if(C===58&&r===0&&u&&w===0)s=i.trim(),i="",u=!1;else if(C===58&&r===0&&x)T=!0,i+=k;else if(C===60&&T)w++,i+=k;else if(C===60&&u&&r===0)w++,i+=k;else if(C===62&&w>0&&S!==61)w--,i+=k;else if(C===61&&b===62&&T&&w===0)T=!1,x=!1,i+=k;else if(C===44&&r===0&&w===0&&!p){if(s&&i.trim()){let O=i.trim();c.push([s,O])}else if(u&&i.trim())kt(c,i.trim());i="",s="",u=!0,x=!1,T=!1,w=0}else i+=k;else i+=k}if(s&&i.trim()){let m=i.trim();c.push([s,m])}else if(u&&i.trim())kt(c,i.trim());return c}function kt(e,c){let{comments:i,key:s}=At(c);if(v(s))e.push([i?`${i}
39
- ${s}`:s,s]);else if(s.startsWith("...")&&s.length>3)e.push(["...",s.slice(3).trim()])}function Tt(e){let c=e.trim();if(c.startsWith("get ")&&c.length>4){let i=c.slice(4).trim();if(i)return{kind:"get",name:i}}if(c.startsWith("set ")&&c.length>4){let i=c.slice(4).trim();if(i)return{kind:"set",name:i}}return null}function ue(e,c,i){let s=i.trim();if(s.charCodeAt(0)!==40)return null;let r=o(s,0,"(",")");if(r===-1)return null;let l=s.slice(1,r).trim(),f=s.slice(r+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 de(e,c){let i=c.trim(),s=o(i,0,"(",")");if(!i.startsWith("(")||s===-1)return"unknown";if(e==="get"){let u=i.slice(s+1).trim();return u.startsWith("=>")?u.slice(2).trim():"unknown"}let r=i.slice(1,s).trim(),l=r.startsWith("{")?o(r,0,"{","}"):r.startsWith("[")?o(r,0,"[","]"):0,f=r.indexOf(":",Math.max(0,l));return f===-1?"unknown":r.slice(f+1).trim()}function he(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 i=0;for(let s=0;s<c.length;s++){let r=c.charCodeAt(s);if(r===40)i++;else if(r===41){if(i--,i===0){let l=c.slice(s+1).trimStart();if(l.startsWith("{"))return!0;if(l.startsWith(":")){let f=yt(l,1);if(f?.kind==="arrow")return!1;if(f?.kind==="body")return!0}return!1}}}return!1}function ge(e){let c=e.trimEnd();if(!c.endsWith(">"))return null;let i=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;i++}else if(f===60){if(i--,i===0){s=l;break}}}if(s===-1)return null;let r=c.slice(0,s).trimEnd();if(!r)return null;return{name:r,typeParams:c.slice(s)}}function St(e,c){let i=c.trimStart(),s=!1,r=!1;if(i.startsWith("async ")||i.startsWith("async\t"))s=!0,i=i.slice(5).trimStart();if(i.startsWith("*"))r=!0,i=i.slice(1).trimStart();let l="";if(i.charCodeAt(0)===60){let w=0,A=-1;for(let p=0;p<i.length;p++)if(i.charCodeAt(p)===60)w++;else if(i.charCodeAt(p)===62&&!(p>0&&i.charCodeAt(p-1)===61)){if(w--,w===0){A=p;break}}if(A!==-1)l=i.slice(0,A+1),i=i.slice(A+1).trimStart()}let f=i.indexOf("("),u=o(i,f,"(",")");if(f===-1||u===-1)return"() => unknown";let a=i.slice(f,u+1),d="unknown",x=i.slice(u+1).trimStart();if(x.charCodeAt(0)===58){let w=x.slice(1),A=yt(w,0);if(A)d=w.slice(0,A.index).trim();else d=w.trim()}if(d==="unknown"&&!r&&x.charCodeAt(0)===123){let w=o(x,0,"{","}");if(w!==-1){let A=B(x.slice(1,w),s,a);if(A!=="unknown"&&A!=="Promise<unknown>")d=s&&A.startsWith("Promise<")?A.slice(8,-1):A;else if(s)d="Promise<unknown>"}}if(d==="unknown"){if(s&&r)d="AsyncGenerator<unknown, void, unknown>";else if(r)d="Generator<unknown, void, unknown>";else if(s)d="Promise<void>"}else if(s&&!d.startsWith("Promise<")&&!d.startsWith("AsyncGenerator<"))d=`Promise<${d}>`;let T=ye(a);return`${l}${T} => ${d}`}function yt(e,c){let i=0,s=0,r=0,l=0,f=!1,u=0;for(let a=c;a<e.length;a++){let d=e.charCodeAt(a);if(f){if(d===92)a++;else if(d===u)f=!1;continue}if(d===34||d===39||d===96){f=!0,u=d;continue}if(d===40)i++;else if(d===41&&i>0)i--;else if(d===91)s++;else if(d===93&&s>0)s--;else if(d===60)r++;else if(d===62&&r>0&&e.charCodeAt(a-1)!==61)r--;else if(d===125&&l>0)l--;else if(d===123){let x=i>0||s>0||r>0||l>0,T=e.slice(c,a).trimEnd(),w=T.charCodeAt(T.length-1),A=T.length===0||w===38||w===124||w===40||w===44||w===58||w===61||w===91;if(x||A)l++;else return{index:a,kind:"body"}}else if(d===61&&a+1<e.length&&e.charCodeAt(a+1)===62&&i===0&&s===0&&r===0&&l===0)return{index:a,kind:"arrow"}}return null}function o(e,c,i,s){let r=0;for(let l=c;l<e.length;l++)if(e[l]===i)r++;else if(e[l]===s){if(s===">"&&l>0&&e[l-1]==="=")continue;if(r--,r===0)return l}return-1}function Z(e){let c=0,i=0,s=!1,r="";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,r=f;else if(s&&f===r&&a!=="\\")s=!1;if(!s){if(f==="<"){let d=o(e,l,"<",">");if(d!==-1){l=d;continue}}if(f==="(")c++;else if(f===")")c--;else if(f==="[")i++;else if(f==="]")i--;if(f==="="&&u===">"&&c===0&&i===0)return l}}return-1}function pt(e,c=!1,i=0,s=!0){let r=e.trim();if(r.length>200&&ut(r,"=>")>2&&ut(r,"<")>5&&!r.startsWith("function"))return c?"((...args: any[]) => any)":"(...args: any[]) => any";if(r.startsWith("async ")&&r.includes("=>")){let f=r.slice(5).trim(),u=Z(f);if(u===-1)return c?"(() => Promise<unknown>)":"() => Promise<unknown>";let a=f.substring(0,u).trim(),d=f.substring(u+2).trim(),x=Ct(a),{params:T,returnType:w}=x;if(T=ye(T),T==="()"||T==="")T="()";else if(!T.startsWith("("))T=`(${T})`;let A=w;if(A);else if(d.startsWith("{"))A=B(d.slice(1,d.endsWith("}")?-1:void 0),!0,x.params);else A=F(d,gt(x.params));let p=`${T} => ${w||A.startsWith("Promise<")?A:`Promise<${A}>`}`;return c?`(${p})`:p}if(r.includes("=>")){let f="",u=r;if(r.startsWith("<")){let C=o(r,0,"<",">");if(C!==-1)f=r.substring(0,C+1),u=r.substring(C+1).trim()}let a=Z(u);if(a===-1)return c?"(() => unknown)":"() => unknown";let d=u.substring(0,a).trim(),x=u.substring(a+2).trim(),T=Ct(d),{params:w,returnType:A}=T;if(w=ye(w),w==="()"||w==="")w="()";else if(!w.startsWith("("))w=`(${w})`;let p="unknown";if(A)p=A;else if(x.startsWith("{"))p=B(x.slice(1,x.endsWith("}")?-1:void 0),!1,T.params);else if(rt(x)||at(x)&&rt(x.slice(1,-1).trim()))p="JSX.Element";else if(x.includes("=>")){let C=x.trimStart(),S=C.indexOf("("),b=S!==-1?o(C,S,"(",")"):-1,k=b!==-1?C.indexOf("=>",b):-1;if(S===0&&b!==-1&&k!==-1){let O=C.substring(S+1,b).trim(),P=ye(O);if(f.includes("T")&&P.includes("T"))p=`(${P}) => T`;else p=`(${P}) => any`}else p="any"}else p=F(x,gt(T.params));let m=`${f}${w} => ${p}`;return c?`(${m})`:m}if(r.startsWith("function")){let f=8,u=r.length;while(f<u&&r.charCodeAt(f)<=32)f++;let a=!1;if(f<u&&r.charCodeAt(f)===42){a=!0,f++;while(f<u&&r.charCodeAt(f)<=32)f++}let d="";if(f<u&&r.charCodeAt(f)===60){let w=f,A=1;f++;while(f<u&&A>0){let p=r.charCodeAt(f);if(p===60)A++;else if(p===62&&r.charCodeAt(f-1)!==61)A--;f++}d=r.substring(w,f);while(f<u&&r.charCodeAt(f)<=32)f++}let x=r.indexOf("(",f);if(x!==-1){let w=1,A=x+1;while(A<u&&w>0){let k=r.charCodeAt(A);if(k===40)w++;else if(k===41)w--;A++}let p=r.substring(x+1,A-1).trim(),m=p?ye(`(${p})`):"()";if(a){let k=r.substring(A).trim(),O=k.indexOf("Generator<");if(O!==-1){let I=O+10,j=k.indexOf(">",I);if(j!==-1){let q=k.substring(I,j),D=`${d}${m} => Generator<${q}>`;return c?`(${D})`:D}}let P=`${d}${m} => Generator<any, any, any>`;return c?`(${P})`:P}let C="unknown",S=r.substring(A).trimStart();if(S.charCodeAt(0)===58){let k=S.slice(1),O=yt(k,0),P=(O?k.slice(0,O.index):k).trim();if(P)C=P}let b=`${d}${m} => ${C}`;return c?`(${b})`:b}let T="(...args: any[]) => unknown";return c?`(${T})`:T}if(r.includes("=>")&&r.includes("(")&&r.includes(")")){if(r.length>100||ut(r,"=>")>2){let f="";if(r.charCodeAt(0)===60){let T=o(r,0,"<",">");if(T!==-1)f=r.substring(0,T+1)}let u=r.indexOf("("),a=u!==-1?o(r,u,"(",")"):-1,d=u!==-1&&a!==-1?r.substring(u,a+1):"(...args: any[])";d=ye(d);let x=`${f}${d} => any`;return c?`(${x})`:x}return c?`(${r})`:r}let l="() => unknown";return c?`(${l})`:l}function Ct(e){let c=e.trim();if(!c.startsWith("("))return{params:c,returnType:""};let i=o(c,0,"(",")");if(i===-1)return{params:c,returnType:""};let s=c.slice(i+1).trim();return{params:c.slice(0,i+1),returnType:s.startsWith(":")?s.slice(1).trim():""}}function We(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 U(e){let c=-1,i=0;for(let r=0;r<e.length;r++){let l=e.charCodeAt(r);if(l===34||l===39||l===96){r=J(e,r,l)-1;continue}if(l===47&&e.charCodeAt(r+1)===47){while(r<e.length&&e.charCodeAt(r)!==10)r++;continue}if(l===47&&e.charCodeAt(r+1)===42){let f=e.indexOf("*/",r+2);r=f===-1?e.length:f+1;continue}if(l===47){let f=r-1;while(f>=0&&e.charCodeAt(f)<=32)f--;if(f<0||"([{:;,=!?&|+*-~>".includes(e[f])){let u=!1;for(r++;r<e.length;r++){let a=e.charCodeAt(r);if(a===92)r++;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)i++;else if(l===41||l===93||l===125)i--;else if(i===0&&e.startsWith("satisfies",r)&&tt(e,r,9)&&e[r-1]!==".")c=r}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 Va(e){let c=e.trim(),i=c.match(/^\{\s*\[(\w+)\s+in\s+(.+?)\](\?)?\s*:\s*(.+)\s*\}$/);if(i){let[,l,f,u,a]=i;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 r=c.match(/^\{\s*(-?readonly\s+)?\[(\w+)\s+in\s+(.+?)\](-?\?)?\s*:\s*(.+)\s*\}$/);if(r){let[,l,f,u,a,d]=r;return`{ ${l?`${l.trim()} `:""}[${f} in ${u}]${a||""}: ${d} }`}return null}function za(e){let c=e.trim(),i=c.indexOf(" extends ");if(i===-1)return null;let s=c.slice(i+9),r=me(s);if(r===-1)return null;let l=pe(s,r);if(l===-1)return null;let f=c.slice(0,i).trim(),u=s.slice(0,r).trim(),a=s.slice(r+1,l).trim(),d=s.slice(l+1).trim();return`${f} extends ${u} ? ${a} : ${d}`}function me(e){let c=0,i=!1,s="";for(let r=0;r<e.length;r++){let l=e[r],f=r>0?e[r-1]:"";if(!i&&(l==='"'||l==="'"||l==="`"))i=!0,s=l;else if(i&&l===s&&f!=="\\")i=!1;if(!i){if(l==="<"||l==="("||l==="["||l==="{")c++;if(l===">"||l===")"||l==="]"||l==="}")c--;if(l==="?"&&c===0)return r}}return-1}function pe(e,c){let i=0,s=!1,r="";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,r=f;else if(s&&f===r&&u!=="\\")s=!1;if(!s){if(f==="<"||f==="("||f==="["||f==="{")i++;if(f===">"||f===")"||f==="]"||f==="}")i--;if(f==="?"&&i===0)i++;if(f===":"&&i===0)return l;if(f===":"&&i>0)i--}}return-1}function Ua(e){let c=e.trim();if(!c.startsWith("`")||!c.endsWith("`"))return null;let i=c.slice(1,-1);if(!i.includes("${"))return c;let s=[],r="",l=0;while(l<i.length)if(i[l]==="$"&&i[l+1]==="{"){if(r)s.push(`"${r}"`),r="";let f=1,u="";l+=2;while(l<i.length&&f>0){if(i[l]==="{")f++;if(i[l]==="}")f--;if(f>0)u+=i[l];l++}s.push(u.trim())}else r+=i[l],l++;if(r)s.push(`"${r}"`);return c}function Ha(e){let c=[],i=/infer\s+(\w+)/g,s;while((s=i.exec(e))!==null)c.push(s[1]);return c}function Ka(e){let i=e.trim(),s=i.indexOf("[");if(s!==-1){if(i.indexOf(" in ",s)!==-1)return!0}let r=i.indexOf(" extends ");if(r!==-1){let f=i.indexOf(" ? ",r);if(f!==-1&&i.indexOf(" : ",f)!==-1)return!0}if(i.charCodeAt(0)===96&&i.charCodeAt(i.length-1)===96){if(i.indexOf("${")!==-1)return!0}let l=i.indexOf("infer ");if(l!==-1){if(l===0||!V(i.charCodeAt(l-1)))return!0}return!1}function qa(e,c=3){let i=e.trim(),s=0,r=0;for(let l of i){if(l==="<"||l==="("||l==="["||l==="{")s++,r=Math.max(r,s);if(l===">"||l===")"||l==="]"||l==="}")s--}if(r>c){let l=i.match(/^(\w+)</);if(l)return`${l[1]}<any>`;return"unknown"}return i}function Ja(e){let i=e.trim().match(/^(\w+)<(.+)>$/);if(!i)return null;let s=i[1],r=i[2],l=$a(r);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 $a(e){let c=[],i="",s=0,r=!1,l="";for(let f=0;f<e.length;f++){let u=e[f],a=f>0?e[f-1]:"";if(!r&&(u==='"'||u==="'"||u==="`"))r=!0,l=u;else if(r&&u===l&&a!=="\\")r=!1;if(!r){if(u==="<"||u==="("||u==="["||u==="{")s++;if(u===">"||u===")"||u==="]"||u==="}")s--;if(u===","&&s===0){c.push(i.trim()),i="";continue}}i+=u}if(i.trim())c.push(i.trim());return c}function Ya(e){let c=e.trim();if(c.startsWith("keyof "))return c;return null}function Xa(e){let c=e.trim();if(c.startsWith("typeof "))return c;return null}function Za(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 i=c.indexOf("[");if(i<=0)return!1;for(let s=0;s<i;s++){let r=c.charCodeAt(s);if(!V(r)&&r!==46)return!1}return!0}
40
- export{Vt,zt,n,Ut,B,Sa,W,Ht,Be,Q,rr,Kt,dt,z,ye,o,pt,We,U,Va,za,Ua,Ha,Ka,qa,Ja,$a,Ya,Xa,Za};
39
+ ${s}`:s,s]);else if(s.startsWith("...")&&s.length>3)e.push(["...",s.slice(3).trim()])}function Tt(e){let c=e.trim();if(c.startsWith("get ")&&c.length>4){let i=c.slice(4).trim();if(i)return{kind:"get",name:i}}if(c.startsWith("set ")&&c.length>4){let i=c.slice(4).trim();if(i)return{kind:"set",name:i}}return null}function ue(e,c,i){let s=i.trim();if(s.charCodeAt(0)!==40)return null;let r=o(s,0,"(",")");if(r===-1)return null;let l=s.slice(1,r).trim(),f=s.slice(r+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 de(e,c){let i=c.trim(),s=o(i,0,"(",")");if(!i.startsWith("(")||s===-1)return"unknown";if(e==="get"){let u=i.slice(s+1).trim();return u.startsWith("=>")?u.slice(2).trim():"unknown"}let r=i.slice(1,s).trim(),l=r.startsWith("{")?o(r,0,"{","}"):r.startsWith("[")?o(r,0,"[","]"):0,f=r.indexOf(":",Math.max(0,l));return f===-1?"unknown":r.slice(f+1).trim()}function he(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 i=0;for(let s=0;s<c.length;s++){let r=c.charCodeAt(s);if(r===40)i++;else if(r===41){if(i--,i===0){let l=c.slice(s+1).trimStart();if(l.startsWith("{"))return!0;if(l.startsWith(":")){let f=yt(l,1);if(f?.kind==="arrow")return!1;if(f?.kind==="body")return!0}return!1}}}return!1}function ge(e){let c=e.trimEnd();if(!c.endsWith(">"))return null;let i=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;i++}else if(f===60){if(i--,i===0){s=l;break}}}if(s===-1)return null;let r=c.slice(0,s).trimEnd();if(!r)return null;return{name:r,typeParams:c.slice(s)}}function St(e,c){let i=c.trimStart(),s=!1,r=!1;if(i.startsWith("async ")||i.startsWith("async\t"))s=!0,i=i.slice(5).trimStart();if(i.startsWith("*"))r=!0,i=i.slice(1).trimStart();let l="";if(i.charCodeAt(0)===60){let w=0,A=-1;for(let p=0;p<i.length;p++)if(i.charCodeAt(p)===60)w++;else if(i.charCodeAt(p)===62&&!(p>0&&i.charCodeAt(p-1)===61)){if(w--,w===0){A=p;break}}if(A!==-1)l=i.slice(0,A+1),i=i.slice(A+1).trimStart()}let f=i.indexOf("("),u=o(i,f,"(",")");if(f===-1||u===-1)return"() => unknown";let a=i.slice(f,u+1),d="unknown",x=i.slice(u+1).trimStart();if(x.charCodeAt(0)===58){let w=x.slice(1),A=yt(w,0);if(A)d=w.slice(0,A.index).trim();else d=w.trim()}if(d==="unknown"&&!r&&x.charCodeAt(0)===123){let w=o(x,0,"{","}");if(w!==-1){let A=B(x.slice(1,w),s,a);if(A!=="unknown"&&A!=="Promise<unknown>")d=s&&A.startsWith("Promise<")?A.slice(8,-1):A;else if(s)d="Promise<unknown>"}}if(d==="unknown"){if(s&&r)d="AsyncGenerator<unknown, void, unknown>";else if(r)d="Generator<unknown, void, unknown>";else if(s)d="Promise<void>"}else if(s&&!d.startsWith("Promise<")&&!d.startsWith("AsyncGenerator<"))d=`Promise<${d}>`;let T=ye(a);return`${l}${T} => ${d}`}function yt(e,c){let i=0,s=0,r=0,l=0,f=!1,u=0;for(let a=c;a<e.length;a++){let d=e.charCodeAt(a);if(f){if(d===92)a++;else if(d===u)f=!1;continue}if(d===34||d===39||d===96){f=!0,u=d;continue}if(d===40)i++;else if(d===41&&i>0)i--;else if(d===91)s++;else if(d===93&&s>0)s--;else if(d===60)r++;else if(d===62&&r>0&&e.charCodeAt(a-1)!==61)r--;else if(d===125&&l>0)l--;else if(d===123){let x=i>0||s>0||r>0||l>0,T=e.slice(c,a).trimEnd(),w=T.charCodeAt(T.length-1),A=T.length===0||w===38||w===124||w===40||w===44||w===58||w===61||w===91;if(x||A)l++;else return{index:a,kind:"body"}}else if(d===61&&a+1<e.length&&e.charCodeAt(a+1)===62&&i===0&&s===0&&r===0&&l===0)return{index:a,kind:"arrow"}}return null}function o(e,c,i,s){let r=0;for(let l=c;l<e.length;l++)if(e[l]===i)r++;else if(e[l]===s){if(s===">"&&l>0&&e[l-1]==="=")continue;if(r--,r===0)return l}return-1}function Z(e){let c=0,i=0,s=!1,r="";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,r=f;else if(s&&f===r&&a!=="\\")s=!1;if(!s){if(f==="<"){let d=o(e,l,"<",">");if(d!==-1){l=d;continue}}if(f==="(")c++;else if(f===")")c--;else if(f==="[")i++;else if(f==="]")i--;if(f==="="&&u===">"&&c===0&&i===0)return l}}return-1}function pt(e,c=!1,i=0,s=!0){let r=e.trim();if(r.length>200&&ut(r,"=>")>2&&ut(r,"<")>5&&!r.startsWith("function"))return c?"((...args: any[]) => any)":"(...args: any[]) => any";if(r.startsWith("async ")&&r.includes("=>")){let f=r.slice(5).trim(),u=Z(f);if(u===-1)return c?"(() => Promise<unknown>)":"() => Promise<unknown>";let a=f.substring(0,u).trim(),d=f.substring(u+2).trim(),x=Ct(a),{params:T,returnType:w}=x;if(T=ye(T),T==="()"||T==="")T="()";else if(!T.startsWith("("))T=`(${T})`;let A=w;if(A);else if(d.startsWith("{"))A=B(d.slice(1,d.endsWith("}")?-1:void 0),!0,x.params);else A=F(d,gt(x.params));let p=`${T} => ${w||A.startsWith("Promise<")?A:`Promise<${A}>`}`;return c?`(${p})`:p}if(r.includes("=>")){let f="",u=r;if(r.startsWith("<")){let C=o(r,0,"<",">");if(C!==-1)f=r.substring(0,C+1),u=r.substring(C+1).trim()}let a=Z(u);if(a===-1)return c?"(() => unknown)":"() => unknown";let d=u.substring(0,a).trim(),x=u.substring(a+2).trim(),T=Ct(d),{params:w,returnType:A}=T;if(w=ye(w),w==="()"||w==="")w="()";else if(!w.startsWith("("))w=`(${w})`;let p="unknown";if(A)p=A;else if(x.startsWith("{"))p=B(x.slice(1,x.endsWith("}")?-1:void 0),!1,T.params);else if(rt(x)||at(x)&&rt(x.slice(1,-1).trim()))p="JSX.Element";else if(x.includes("=>")){let C=x.trimStart(),S=C.indexOf("("),b=S!==-1?o(C,S,"(",")"):-1,k=b!==-1?C.indexOf("=>",b):-1;if(S===0&&b!==-1&&k!==-1){let O=C.substring(S+1,b).trim(),P=ye(O);if(f.includes("T")&&P.includes("T"))p=`(${P}) => T`;else p=`(${P}) => any`}else p="any"}else p=F(x,gt(T.params));let m=`${f}${w} => ${p}`;return c?`(${m})`:m}if(r.startsWith("function")){let f=8,u=r.length;while(f<u&&r.charCodeAt(f)<=32)f++;let a=!1;if(f<u&&r.charCodeAt(f)===42){a=!0,f++;while(f<u&&r.charCodeAt(f)<=32)f++}let d="";if(f<u&&r.charCodeAt(f)===60){let w=f,A=1;f++;while(f<u&&A>0){let p=r.charCodeAt(f);if(p===60)A++;else if(p===62&&r.charCodeAt(f-1)!==61)A--;f++}d=r.substring(w,f);while(f<u&&r.charCodeAt(f)<=32)f++}let x=r.indexOf("(",f);if(x!==-1){let w=1,A=x+1;while(A<u&&w>0){let k=r.charCodeAt(A);if(k===40)w++;else if(k===41)w--;A++}let p=r.substring(x+1,A-1).trim(),m=p?ye(`(${p})`):"()";if(a){let k=r.substring(A).trim(),O=k.indexOf("Generator<");if(O!==-1){let I=O+10,j=k.indexOf(">",I);if(j!==-1){let q=k.substring(I,j),D=`${d}${m} => Generator<${q}>`;return c?`(${D})`:D}}let P=`${d}${m} => Generator<any, any, any>`;return c?`(${P})`:P}let C="unknown",S=r.substring(A).trimStart();if(S.charCodeAt(0)===58){let k=S.slice(1),O=yt(k,0),P=(O?k.slice(0,O.index):k).trim();if(P)C=P}let b=`${d}${m} => ${C}`;return c?`(${b})`:b}let T="(...args: any[]) => unknown";return c?`(${T})`:T}if(r.includes("=>")&&r.includes("(")&&r.includes(")")){if(r.length>100||ut(r,"=>")>2){let f="";if(r.charCodeAt(0)===60){let T=o(r,0,"<",">");if(T!==-1)f=r.substring(0,T+1)}let u=r.indexOf("("),a=u!==-1?o(r,u,"(",")"):-1,d=u!==-1&&a!==-1?r.substring(u,a+1):"(...args: any[])";d=ye(d);let x=`${f}${d} => any`;return c?`(${x})`:x}return c?`(${r})`:r}let l="() => unknown";return c?`(${l})`:l}function Ct(e){let c=e.trim();if(!c.startsWith("("))return{params:c,returnType:""};let i=o(c,0,"(",")");if(i===-1)return{params:c,returnType:""};let s=c.slice(i+1).trim();return{params:c.slice(0,i+1),returnType:s.startsWith(":")?s.slice(1).trim():""}}function We(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 U(e){let c=-1,i=0;for(let r=0;r<e.length;r++){let l=e.charCodeAt(r);if(l===34||l===39||l===96){r=J(e,r,l)-1;continue}if(l===47&&e.charCodeAt(r+1)===47){while(r<e.length&&e.charCodeAt(r)!==10)r++;continue}if(l===47&&e.charCodeAt(r+1)===42){let f=e.indexOf("*/",r+2);r=f===-1?e.length:f+1;continue}if(l===47){let f=r-1;while(f>=0&&e.charCodeAt(f)<=32)f--;if(f<0||"([{:;,=!?&|+*-~>".includes(e[f])){let u=!1;for(r++;r<e.length;r++){let a=e.charCodeAt(r);if(a===92)r++;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)i++;else if(l===41||l===93||l===125)i--;else if(i===0&&e.startsWith("satisfies",r)&&tt(e,r,9)&&e[r-1]!==".")c=r}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 za(e){let c=e.trim(),i=c.match(/^\{\s*\[(\w+)\s+in\s+(.+?)\](\?)?\s*:\s*(.+)\s*\}$/);if(i){let[,l,f,u,a]=i;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 r=c.match(/^\{\s*(-?readonly\s+)?\[(\w+)\s+in\s+(.+?)\](-?\?)?\s*:\s*(.+)\s*\}$/);if(r){let[,l,f,u,a,d]=r;return`{ ${l?`${l.trim()} `:""}[${f} in ${u}]${a||""}: ${d} }`}return null}function Ua(e){let c=e.trim(),i=c.indexOf(" extends ");if(i===-1)return null;let s=c.slice(i+9),r=me(s);if(r===-1)return null;let l=pe(s,r);if(l===-1)return null;let f=c.slice(0,i).trim(),u=s.slice(0,r).trim(),a=s.slice(r+1,l).trim(),d=s.slice(l+1).trim();return`${f} extends ${u} ? ${a} : ${d}`}function me(e){let c=0,i=!1,s="";for(let r=0;r<e.length;r++){let l=e[r],f=r>0?e[r-1]:"";if(!i&&(l==='"'||l==="'"||l==="`"))i=!0,s=l;else if(i&&l===s&&f!=="\\")i=!1;if(!i){if(l==="<"||l==="("||l==="["||l==="{")c++;if(l===">"||l===")"||l==="]"||l==="}")c--;if(l==="?"&&c===0)return r}}return-1}function pe(e,c){let i=0,s=!1,r="";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,r=f;else if(s&&f===r&&u!=="\\")s=!1;if(!s){if(f==="<"||f==="("||f==="["||f==="{")i++;if(f===">"||f===")"||f==="]"||f==="}")i--;if(f==="?"&&i===0)i++;if(f===":"&&i===0)return l;if(f===":"&&i>0)i--}}return-1}function Ha(e){let c=e.trim();if(!c.startsWith("`")||!c.endsWith("`"))return null;let i=c.slice(1,-1);if(!i.includes("${"))return c;let s=[],r="",l=0;while(l<i.length)if(i[l]==="$"&&i[l+1]==="{"){if(r)s.push(`"${r}"`),r="";let f=1,u="";l+=2;while(l<i.length&&f>0){if(i[l]==="{")f++;if(i[l]==="}")f--;if(f>0)u+=i[l];l++}s.push(u.trim())}else r+=i[l],l++;if(r)s.push(`"${r}"`);return c}function Ka(e){let c=[],i=/infer\s+(\w+)/g,s;while((s=i.exec(e))!==null)c.push(s[1]);return c}function qa(e){let i=e.trim(),s=i.indexOf("[");if(s!==-1){if(i.indexOf(" in ",s)!==-1)return!0}let r=i.indexOf(" extends ");if(r!==-1){let f=i.indexOf(" ? ",r);if(f!==-1&&i.indexOf(" : ",f)!==-1)return!0}if(i.charCodeAt(0)===96&&i.charCodeAt(i.length-1)===96){if(i.indexOf("${")!==-1)return!0}let l=i.indexOf("infer ");if(l!==-1){if(l===0||!V(i.charCodeAt(l-1)))return!0}return!1}function Ja(e,c=3){let i=e.trim(),s=0,r=0;for(let l of i){if(l==="<"||l==="("||l==="["||l==="{")s++,r=Math.max(r,s);if(l===">"||l===")"||l==="]"||l==="}")s--}if(r>c){let l=i.match(/^(\w+)</);if(l)return`${l[1]}<any>`;return"unknown"}return i}function Ya(e){let i=e.trim().match(/^(\w+)<(.+)>$/);if(!i)return null;let s=i[1],r=i[2],l=Ea(r);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=[],i="",s=0,r=!1,l="";for(let f=0;f<e.length;f++){let u=e[f],a=f>0?e[f-1]:"";if(!r&&(u==='"'||u==="'"||u==="`"))r=!0,l=u;else if(r&&u===l&&a!=="\\")r=!1;if(!r){if(u==="<"||u==="("||u==="["||u==="{")s++;if(u===">"||u===")"||u==="]"||u==="}")s--;if(u===","&&s===0){c.push(i.trim()),i="";continue}}i+=u}if(i.trim())c.push(i.trim());return c}function Xa(e){let c=e.trim();if(c.startsWith("keyof "))return c;return null}function Za(e){let c=e.trim();if(c.startsWith("typeof "))return c;return null}function Qa(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 i=c.indexOf("[");if(i<=0)return!1;for(let s=0;s<i;s++){let r=c.charCodeAt(s);if(!V(r)&&r!==46)return!1}return!0}
40
+ export{zt,Ut,n,Ht,B,$a,W,Kt,Be,Q,ir,qt,dt,z,ye,o,pt,We,U,za,Ua,Ha,Ka,qa,Ja,Ya,Ea,Xa,Za,Qa};
@@ -1,8 +1,8 @@
1
1
  // @bun
2
- import{r}from"./chunk-a04yhmwb.js";import{e}from"./chunk-3mp0jaa7.js";import{existsSync as j,mkdirSync as S,readFileSync as E,writeFileSync as f}from"fs";import{basename as h,join as g}from"path";function an(t){let n={description:"",params:[],examples:[],tags:{},see:[],throws:[]};if(!t||t.length===0)return n;for(let s of t){let o=s.replace(/^\/\*\*/,"").replace(/\*\/$/,"").split(`
2
+ import{r}from"./chunk-bys9tn88.js";import{e}from"./chunk-8vvryt8p.js";import{existsSync as j,mkdirSync as S,readFileSync as E,writeFileSync as f}from"fs";import{basename as h,join as g}from"path";function cn(t){let n={description:"",params:[],examples:[],tags:{},see:[],throws:[]};if(!t||t.length===0)return n;for(let s of t){let o=s.replace(/^\/\*\*/,"").replace(/\*\/$/,"").split(`
3
3
  `).map((p)=>p.replace(/^\s*\*\s?/,"")).join(`
4
- `).trim(),i=o.search(/@\w+/);if(i===-1){n.description=o;continue}else if(i>0)n.description=o.slice(0,i).trim(),o=o.slice(i);let a=/@(\w+)(?:\s+\{([^}]+)\})?\s*([^\n@]*(?:\n(?!@)[^\n@]*)*)/g,c;while((c=a.exec(o))!==null){let[,p,u,d]=c,m=d.trim();switch(p){case"param":{let l=m.match(/^(\[)?(\w+)\]?\s*(?:-\s*)?(.*)/);if(l)n.params.push({name:l[2],type:u,description:l[3].trim(),optional:!!l[1]});break}case"returns":case"return":n.returns={type:u,description:m};break;case"example":n.examples.push(m);break;case"deprecated":n.deprecated=m||"Deprecated";break;case"since":n.since=m;break;case"see":n.see.push(m);break;case"throws":case"throw":n.throws.push({type:u,description:m});break;case"category":n.category=m;break;default:if(!n.tags[p])n.tags[p]=[];n.tags[p].push(m)}}}return n}function w(t,n){let s=an(t.leadingComments),o="";switch(t.kind){case"function":o=M(t);break;case"variable":o=C(t);break;case"interface":o=P(t);break;case"type":o=v(t);break;case"class":o=T(t);break;case"enum":o=F(t);break;default:o=t.text||t.name}let i={name:t.name,kind:t.kind,signature:o,jsdoc:s,isExported:t.isExported,isDefault:t.isDefault,sourceFile:n};if(t.members&&t.members.length>0)i.members=t.members.map((a)=>w(a,n));return i}function M(t){let n=[];if(t.isExported)n.push("export");if(t.isDefault)n.push("default");if(n.push("function"),n.push(t.name),t.generics)n.push(t.generics);if(t.parameters){let s=t.parameters.map((o)=>{let i="";if(o.rest)i+="...";if(i+=o.name,o.optional)i+="?";if(o.type)i+=`: ${o.type}`;return i}).join(", ");n.push(`(${s})`)}else n.push("()");if(t.returnType)n.push(`: ${t.returnType}`);return n.join(" ").replace(/\s+/g," ")}function C(t){let n=[];if(t.isExported)n.push("export");if(n.push("const"),n.push(t.name),t.typeAnnotation)n.push(`: ${t.typeAnnotation}`);return n.join(" ")}function P(t){let n=[];if(t.isExported)n.push("export");if(n.push("interface"),n.push(t.name),t.generics)n.push(t.generics);if(t.extends)n.push(`extends ${t.extends}`);return n.join(" ")}function v(t){let n=[];if(t.isExported)n.push("export");if(n.push("type"),n.push(t.name),t.generics)n.push(t.generics);if(n.push("="),t.typeAnnotation)n.push(t.typeAnnotation);return n.join(" ")}function T(t){let n=[];if(t.isExported)n.push("export");if(t.isDefault)n.push("default");if(n.push("class"),n.push(t.name),t.generics)n.push(t.generics);if(t.extends)n.push(`extends ${t.extends}`);if(t.implements&&t.implements.length>0)n.push(`implements ${t.implements.join(", ")}`);return n.join(" ")}function F(t){let n=[];if(t.isExported)n.push("export");return n.push("enum"),n.push(t.name),n.join(" ")}async function cn(t,n={}){let s=[],o=new Map;for(let i of t){if(!j(i)){e.warn(`File not found: ${i}`);continue}let a=E(i,"utf-8"),c=r(a,i,!0);for(let p of c){if(p.kind==="import")continue;if(!n.includePrivate&&p.name.startsWith("_"))continue;if(!n.includeInternal&&p.leadingComments?.some((d)=>d.includes("@internal")))continue;let u=w(p,i);if(s.push(u),n.groupByCategory&&u.jsdoc.category){let d=u.jsdoc.category;if(!o.has(d))o.set(d,[]);o.get(d).push(u)}}}return{title:n.title||"API Documentation",description:n.description,entries:s,categories:o,generatedAt:new Date}}function Je(t,n={}){let s=[];if(s.push(`# ${t.title}`),s.push(""),t.description)s.push(t.description),s.push("");if(s.push(`> Generated on ${t.generatedAt.toISOString()}`),s.push(""),s.push("## Table of Contents"),s.push(""),n.groupByCategory&&t.categories.size>0)for(let o of t.categories.keys())s.push(`- [${o}](#${D(o)})`);else{let o=x(t.entries);for(let[i,a]of o)if(a.length>0)s.push(`- [${b(i)}](#${D(b(i))})`)}if(s.push(""),n.groupByCategory&&t.categories.size>0)for(let[o,i]of t.categories){s.push(`## ${o}`),s.push("");for(let a of i)s.push(...k(a,n))}else{let o=x(t.entries);for(let[i,a]of o)if(a.length>0){s.push(`## ${b(i)}`),s.push("");for(let c of a)s.push(...k(c,n))}}return s.join(`
5
- `)}function k(t,n){let s=[];if(s.push(`### ${t.name}`),s.push(""),t.jsdoc.deprecated)s.push(`> **Deprecated:** ${t.jsdoc.deprecated}`),s.push("");if(s.push("```typescript"),s.push(t.signature),s.push("```"),s.push(""),t.jsdoc.description)s.push(t.jsdoc.description),s.push("");if(t.jsdoc.params.length>0){s.push("**Parameters:**"),s.push(""),s.push("| Name | Type | Description |"),s.push("|------|------|-------------|");for(let o of t.jsdoc.params){let i=o.optional?" (optional)":"",a=o.type||"any";s.push(`| \`${o.name}\`${i} | \`${a}\` | ${o.description} |`)}s.push("")}if(t.jsdoc.returns){s.push("**Returns:**"),s.push("");let o=t.jsdoc.returns.type?`\`${t.jsdoc.returns.type}\``:"";s.push(`${o} ${t.jsdoc.returns.description}`),s.push("")}if(t.jsdoc.throws.length>0){s.push("**Throws:**"),s.push("");for(let o of t.jsdoc.throws){let i=o.type?`\`${o.type}\``:"";s.push(`- ${i} ${o.description}`)}s.push("")}if(t.jsdoc.examples.length>0){s.push("**Examples:**"),s.push("");for(let o of t.jsdoc.examples)s.push("```typescript"),s.push(o),s.push("```"),s.push("")}if(t.jsdoc.see.length>0){s.push("**See also:**"),s.push("");for(let o of t.jsdoc.see)s.push(`- ${o}`);s.push("")}if(t.jsdoc.since)s.push(`*Since: ${t.jsdoc.since}*`),s.push("");if(n.includeSourceLinks&&t.sourceFile){let o=t.sourceFile;if(n.sourceBaseUrl)s.push(`[Source](${n.sourceBaseUrl}/${o})`);else s.push(`*Source: ${o}*`);s.push("")}if(t.members&&t.members.length>0){s.push("**Members:**"),s.push("");for(let o of t.members)if(s.push(`#### ${o.name}`),s.push(""),s.push("```typescript"),s.push(o.signature),s.push("```"),s.push(""),o.jsdoc.description)s.push(o.jsdoc.description),s.push("")}return s.push("---"),s.push(""),s}function ln(t,n={}){let s=Je(t,n);return`<!DOCTYPE html>
4
+ `).trim(),i=o.search(/@\w+/);if(i===-1){n.description=o;continue}else if(i>0)n.description=o.slice(0,i).trim(),o=o.slice(i);let a=/@(\w+)(?:\s+\{([^}]+)\})?\s*([^\n@]*(?:\n(?!@)[^\n@]*)*)/g,c;while((c=a.exec(o))!==null){let[,p,u,d]=c,m=d.trim();switch(p){case"param":{let l=m.match(/^(\[)?(\w+)\]?\s*(?:-\s*)?(.*)/);if(l)n.params.push({name:l[2],type:u,description:l[3].trim(),optional:!!l[1]});break}case"returns":case"return":n.returns={type:u,description:m};break;case"example":n.examples.push(m);break;case"deprecated":n.deprecated=m||"Deprecated";break;case"since":n.since=m;break;case"see":n.see.push(m);break;case"throws":case"throw":n.throws.push({type:u,description:m});break;case"category":n.category=m;break;default:if(!n.tags[p])n.tags[p]=[];n.tags[p].push(m)}}}return n}function w(t,n){let s=cn(t.leadingComments),o="";switch(t.kind){case"function":o=M(t);break;case"variable":o=C(t);break;case"interface":o=P(t);break;case"type":o=v(t);break;case"class":o=T(t);break;case"enum":o=F(t);break;default:o=t.text||t.name}let i={name:t.name,kind:t.kind,signature:o,jsdoc:s,isExported:t.isExported,isDefault:t.isDefault,sourceFile:n};if(t.members&&t.members.length>0)i.members=t.members.map((a)=>w(a,n));return i}function M(t){let n=[];if(t.isExported)n.push("export");if(t.isDefault)n.push("default");if(n.push("function"),n.push(t.name),t.generics)n.push(t.generics);if(t.parameters){let s=t.parameters.map((o)=>{let i="";if(o.rest)i+="...";if(i+=o.name,o.optional)i+="?";if(o.type)i+=`: ${o.type}`;return i}).join(", ");n.push(`(${s})`)}else n.push("()");if(t.returnType)n.push(`: ${t.returnType}`);return n.join(" ").replace(/\s+/g," ")}function C(t){let n=[];if(t.isExported)n.push("export");if(n.push("const"),n.push(t.name),t.typeAnnotation)n.push(`: ${t.typeAnnotation}`);return n.join(" ")}function P(t){let n=[];if(t.isExported)n.push("export");if(n.push("interface"),n.push(t.name),t.generics)n.push(t.generics);if(t.extends)n.push(`extends ${t.extends}`);return n.join(" ")}function v(t){let n=[];if(t.isExported)n.push("export");if(n.push("type"),n.push(t.name),t.generics)n.push(t.generics);if(n.push("="),t.typeAnnotation)n.push(t.typeAnnotation);return n.join(" ")}function T(t){let n=[];if(t.isExported)n.push("export");if(t.isDefault)n.push("default");if(n.push("class"),n.push(t.name),t.generics)n.push(t.generics);if(t.extends)n.push(`extends ${t.extends}`);if(t.implements&&t.implements.length>0)n.push(`implements ${t.implements.join(", ")}`);return n.join(" ")}function F(t){let n=[];if(t.isExported)n.push("export");return n.push("enum"),n.push(t.name),n.join(" ")}async function ln(t,n={}){let s=[],o=new Map;for(let i of t){if(!j(i)){e.warn(`File not found: ${i}`);continue}let a=E(i,"utf-8"),c=r(a,i,!0);for(let p of c){if(p.kind==="import")continue;if(!n.includePrivate&&p.name.startsWith("_"))continue;if(!n.includeInternal&&p.leadingComments?.some((d)=>d.includes("@internal")))continue;let u=w(p,i);if(s.push(u),n.groupByCategory&&u.jsdoc.category){let d=u.jsdoc.category;if(!o.has(d))o.set(d,[]);o.get(d).push(u)}}}return{title:n.title||"API Documentation",description:n.description,entries:s,categories:o,generatedAt:new Date}}function Je(t,n={}){let s=[];if(s.push(`# ${t.title}`),s.push(""),t.description)s.push(t.description),s.push("");if(s.push(`> Generated on ${t.generatedAt.toISOString()}`),s.push(""),s.push("## Table of Contents"),s.push(""),n.groupByCategory&&t.categories.size>0)for(let o of t.categories.keys())s.push(`- [${o}](#${D(o)})`);else{let o=x(t.entries);for(let[i,a]of o)if(a.length>0)s.push(`- [${b(i)}](#${D(b(i))})`)}if(s.push(""),n.groupByCategory&&t.categories.size>0)for(let[o,i]of t.categories){s.push(`## ${o}`),s.push("");for(let a of i)s.push(...k(a,n))}else{let o=x(t.entries);for(let[i,a]of o)if(a.length>0){s.push(`## ${b(i)}`),s.push("");for(let c of a)s.push(...k(c,n))}}return s.join(`
5
+ `)}function k(t,n){let s=[];if(s.push(`### ${t.name}`),s.push(""),t.jsdoc.deprecated)s.push(`> **Deprecated:** ${t.jsdoc.deprecated}`),s.push("");if(s.push("```typescript"),s.push(t.signature),s.push("```"),s.push(""),t.jsdoc.description)s.push(t.jsdoc.description),s.push("");if(t.jsdoc.params.length>0){s.push("**Parameters:**"),s.push(""),s.push("| Name | Type | Description |"),s.push("|------|------|-------------|");for(let o of t.jsdoc.params){let i=o.optional?" (optional)":"",a=o.type||"any";s.push(`| \`${o.name}\`${i} | \`${a}\` | ${o.description} |`)}s.push("")}if(t.jsdoc.returns){s.push("**Returns:**"),s.push("");let o=t.jsdoc.returns.type?`\`${t.jsdoc.returns.type}\``:"";s.push(`${o} ${t.jsdoc.returns.description}`),s.push("")}if(t.jsdoc.throws.length>0){s.push("**Throws:**"),s.push("");for(let o of t.jsdoc.throws){let i=o.type?`\`${o.type}\``:"";s.push(`- ${i} ${o.description}`)}s.push("")}if(t.jsdoc.examples.length>0){s.push("**Examples:**"),s.push("");for(let o of t.jsdoc.examples)s.push("```typescript"),s.push(o),s.push("```"),s.push("")}if(t.jsdoc.see.length>0){s.push("**See also:**"),s.push("");for(let o of t.jsdoc.see)s.push(`- ${o}`);s.push("")}if(t.jsdoc.since)s.push(`*Since: ${t.jsdoc.since}*`),s.push("");if(n.includeSourceLinks&&t.sourceFile){let o=t.sourceFile;if(n.sourceBaseUrl)s.push(`[Source](${n.sourceBaseUrl}/${o})`);else s.push(`*Source: ${o}*`);s.push("")}if(t.members&&t.members.length>0){s.push("**Members:**"),s.push("");for(let o of t.members)if(s.push(`#### ${o.name}`),s.push(""),s.push("```typescript"),s.push(o.signature),s.push("```"),s.push(""),o.jsdoc.description)s.push(o.jsdoc.description),s.push("")}return s.push("---"),s.push(""),s}function un(t,n={}){let s=Je(t,n);return`<!DOCTYPE html>
6
6
  <html lang="en">
7
7
  <head>
8
8
  <meta charset="UTF-8">
@@ -97,6 +97,6 @@ import{r}from"./chunk-a04yhmwb.js";import{e}from"./chunk-3mp0jaa7.js";import{exi
97
97
  document.getElementById('content').innerHTML = marked.parse(markdown);
98
98
  </script>
99
99
  </body>
100
- </html>`}function un(t,n={}){let s={title:t.title,description:t.description,generatedAt:t.generatedAt.toISOString(),version:"1.0.0",entries:t.entries.map((o)=>({name:o.name,kind:o.kind,signature:o.signature,description:o.jsdoc.description,isExported:o.isExported,isDefault:o.isDefault,deprecated:o.jsdoc.deprecated,since:o.jsdoc.since,category:o.jsdoc.category,params:o.jsdoc.params,returns:o.jsdoc.returns,examples:o.jsdoc.examples,throws:o.jsdoc.throws,see:o.jsdoc.see,tags:o.jsdoc.tags,sourceFile:o.sourceFile,sourceLine:o.sourceLine,members:o.members?.map((i)=>({name:i.name,kind:i.kind,signature:i.signature,description:i.jsdoc.description,deprecated:i.jsdoc.deprecated,params:i.jsdoc.params,returns:i.jsdoc.returns}))})),categories:n.groupByCategory?Object.fromEntries(Array.from(t.categories.entries()).map(([o,i])=>[o,i.map((a)=>a.name)])):void 0};return JSON.stringify(s,null,2)}function Fr(t){let n={id:0,name:t.title,kind:1,kindString:"Project",flags:{},children:t.entries.map((s,o)=>({id:o+1,name:s.name,kind:y(s.kind),kindString:s.kind,flags:{isExported:s.isExported,isDefault:s.isDefault},comment:s.jsdoc.description?{summary:[{kind:"text",text:s.jsdoc.description}],blockTags:s.jsdoc.deprecated?[{tag:"@deprecated",content:[{kind:"text",text:s.jsdoc.deprecated}]}]:void 0}:void 0,sources:s.sourceFile?[{fileName:s.sourceFile,line:s.sourceLine||1,character:0}]:void 0,signatures:s.kind==="function"?[{id:o+1000,name:s.name,kind:4096,kindString:"Call signature",parameters:s.jsdoc.params.map((i,a)=>({id:o+2000+a,name:i.name,kind:32768,kindString:"Parameter",flags:{isOptional:i.optional},type:i.type?{type:"intrinsic",name:i.type}:void 0,comment:i.description?{summary:[{kind:"text",text:i.description}]}:void 0})),type:s.jsdoc.returns?.type?{type:"intrinsic",name:s.jsdoc.returns.type}:void 0}]:void 0,children:s.members?.map((i,a)=>({id:o+3000+a,name:i.name,kind:y(i.kind),kindString:i.kind,comment:i.jsdoc.description?{summary:[{kind:"text",text:i.jsdoc.description}]}:void 0}))}))};return JSON.stringify(n,null,2)}async function Ws(t,n){e.info("Extracting documentation...");let s=await cn(t,n);if(e.info(`Found ${s.entries.length} documented entries`),!j(n.outdir))S(n.outdir,{recursive:!0});if(n.format==="markdown")if(n.splitByModule){let o=I(s.entries);for(let[a,c]of o){let p={title:h(a,".ts"),description:`Documentation for ${a}`,entries:c,categories:new Map,generatedAt:s.generatedAt},u=Je(p,n),d=g(n.outdir,`${h(a,".ts")}.md`);f(d,u),e.info(`Generated: ${d}`)}let i=[`# ${s.title}`,"",s.description||"","","## Modules",""];for(let[a]of o){let c=h(a,".ts");i.push(`- [${c}](./${c}.md)`)}f(g(n.outdir,"README.md"),i.join(`
101
- `)),e.info(`Generated: ${g(n.outdir,"README.md")}`)}else{let o=Je(s,n),i=g(n.outdir,"API.md");f(i,o),e.info(`Generated: ${i}`)}else if(n.format==="json"){let o=un(s,n),i=g(n.outdir,"api.json");f(i,o),e.info(`Generated: ${i}`);let a=Fr(s),c=g(n.outdir,"typedoc.json");f(c,a),e.info(`Generated: ${c}`)}else{let o=ln(s,n),i=g(n.outdir,"index.html");f(i,o),e.info(`Generated: ${i}`)}}function D(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function b(t){return{function:"Functions",variable:"Variables",interface:"Interfaces",type:"Type Aliases",class:"Classes",enum:"Enums",export:"Exports",module:"Modules"}[t]||t}function x(t){let n=new Map,s=["function","class","interface","type","enum","variable"];for(let o of s)n.set(o,[]);for(let o of t){let i=o.kind;if(!n.has(i))n.set(i,[]);n.get(i).push(o)}return n}function A(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function I(t){let n=new Map;for(let s of t){let o=s.sourceFile||"unknown";if(!n.has(o))n.set(o,[]);n.get(o).push(s)}return n}function y(t){return{function:64,variable:32,interface:256,type:4194304,class:128,enum:8,property:1024,method:2048,module:2,namespace:4}[t]||0}function _s(t={}){return{extract:(n)=>cn(n,t),generateMarkdown:(n)=>Je(n,t),generateHTML:(n)=>ln(n,t),generateJSON:(n)=>un(n,t),parseJSDoc:an}}
102
- export{an,cn,Je,ln,un,Fr,Ws,_s};
100
+ </html>`}function fn(t,n={}){let s={title:t.title,description:t.description,generatedAt:t.generatedAt.toISOString(),version:"1.0.0",entries:t.entries.map((o)=>({name:o.name,kind:o.kind,signature:o.signature,description:o.jsdoc.description,isExported:o.isExported,isDefault:o.isDefault,deprecated:o.jsdoc.deprecated,since:o.jsdoc.since,category:o.jsdoc.category,params:o.jsdoc.params,returns:o.jsdoc.returns,examples:o.jsdoc.examples,throws:o.jsdoc.throws,see:o.jsdoc.see,tags:o.jsdoc.tags,sourceFile:o.sourceFile,sourceLine:o.sourceLine,members:o.members?.map((i)=>({name:i.name,kind:i.kind,signature:i.signature,description:i.jsdoc.description,deprecated:i.jsdoc.deprecated,params:i.jsdoc.params,returns:i.jsdoc.returns}))})),categories:n.groupByCategory?Object.fromEntries(Array.from(t.categories.entries()).map(([o,i])=>[o,i.map((a)=>a.name)])):void 0};return JSON.stringify(s,null,2)}function Br(t){let n={id:0,name:t.title,kind:1,kindString:"Project",flags:{},children:t.entries.map((s,o)=>({id:o+1,name:s.name,kind:y(s.kind),kindString:s.kind,flags:{isExported:s.isExported,isDefault:s.isDefault},comment:s.jsdoc.description?{summary:[{kind:"text",text:s.jsdoc.description}],blockTags:s.jsdoc.deprecated?[{tag:"@deprecated",content:[{kind:"text",text:s.jsdoc.deprecated}]}]:void 0}:void 0,sources:s.sourceFile?[{fileName:s.sourceFile,line:s.sourceLine||1,character:0}]:void 0,signatures:s.kind==="function"?[{id:o+1000,name:s.name,kind:4096,kindString:"Call signature",parameters:s.jsdoc.params.map((i,a)=>({id:o+2000+a,name:i.name,kind:32768,kindString:"Parameter",flags:{isOptional:i.optional},type:i.type?{type:"intrinsic",name:i.type}:void 0,comment:i.description?{summary:[{kind:"text",text:i.description}]}:void 0})),type:s.jsdoc.returns?.type?{type:"intrinsic",name:s.jsdoc.returns.type}:void 0}]:void 0,children:s.members?.map((i,a)=>({id:o+3000+a,name:i.name,kind:y(i.kind),kindString:i.kind,comment:i.jsdoc.description?{summary:[{kind:"text",text:i.jsdoc.description}]}:void 0}))}))};return JSON.stringify(n,null,2)}async function _s(t,n){e.info("Extracting documentation...");let s=await ln(t,n);if(e.info(`Found ${s.entries.length} documented entries`),!j(n.outdir))S(n.outdir,{recursive:!0});if(n.format==="markdown")if(n.splitByModule){let o=I(s.entries);for(let[a,c]of o){let p={title:h(a,".ts"),description:`Documentation for ${a}`,entries:c,categories:new Map,generatedAt:s.generatedAt},u=Je(p,n),d=g(n.outdir,`${h(a,".ts")}.md`);f(d,u),e.info(`Generated: ${d}`)}let i=[`# ${s.title}`,"",s.description||"","","## Modules",""];for(let[a]of o){let c=h(a,".ts");i.push(`- [${c}](./${c}.md)`)}f(g(n.outdir,"README.md"),i.join(`
101
+ `)),e.info(`Generated: ${g(n.outdir,"README.md")}`)}else{let o=Je(s,n),i=g(n.outdir,"API.md");f(i,o),e.info(`Generated: ${i}`)}else if(n.format==="json"){let o=fn(s,n),i=g(n.outdir,"api.json");f(i,o),e.info(`Generated: ${i}`);let a=Br(s),c=g(n.outdir,"typedoc.json");f(c,a),e.info(`Generated: ${c}`)}else{let o=un(s,n),i=g(n.outdir,"index.html");f(i,o),e.info(`Generated: ${i}`)}}function D(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function b(t){return{function:"Functions",variable:"Variables",interface:"Interfaces",type:"Type Aliases",class:"Classes",enum:"Enums",export:"Exports",module:"Modules"}[t]||t}function x(t){let n=new Map,s=["function","class","interface","type","enum","variable"];for(let o of s)n.set(o,[]);for(let o of t){let i=o.kind;if(!n.has(i))n.set(i,[]);n.get(i).push(o)}return n}function A(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function I(t){let n=new Map;for(let s of t){let o=s.sourceFile||"unknown";if(!n.has(o))n.set(o,[]);n.get(o).push(s)}return n}function y(t){return{function:64,variable:32,interface:256,type:4194304,class:128,enum:8,property:1024,method:2048,module:2,namespace:4}[t]||0}function js(t={}){return{extract:(n)=>ln(n,t),generateMarkdown:(n)=>Je(n,t),generateHTML:(n)=>un(n,t),generateJSON:(n)=>fn(n,t),parseJSDoc:cn}}
102
+ export{cn,ln,Je,un,fn,Br,_s,js};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{j}from"./chunk-m7jndt3v.js";import{P}from"./chunk-4sasxrdr.js";import{De,Pe}from"./chunk-m8w98p7p.js";import{createHash as x}from"crypto";import{readFile as d}from"fs/promises";import{resolve as m}from"path";async function Nn(g){let e={...j,...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 De(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=Pe(r,e,o.resolver),i=[],S=new Set(P(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{Nn};
2
+ import{j}from"./chunk-rc1zpm7f.js";import{P}from"./chunk-1t77gtcx.js";import{De,Pe}from"./chunk-1k5r7bpf.js";import{createHash as x}from"crypto";import{readFile as d}from"fs/promises";import{resolve as m}from"path";async function Fn(g){let e={...j,...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 De(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=Pe(r,e,o.resolver),i=[],S=new Set(P(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{Fn};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{sa,Re}from"../chunk-9b0jah2a.js";import"../chunk-t4cdpfrr.js";import"../chunk-02yqpwv0.js";import"../chunk-a04yhmwb.js";import"../chunk-cq5zpg9c.js";import"../chunk-kcfc6zg6.js";import"../chunk-8gksa73c.js";import"../chunk-937czex4.js";import"../chunk-srfpcjtn.js";import"../chunk-v6fwy63g.js";import"../chunk-m9b6cqn7.js";import"../chunk-3z75j224.js";import"../chunk-e4f5kxrh.js";import"../chunk-bkrftw1s.js";import"../chunk-zbrj37wa.js";import"../chunk-zpvcnc7c.js";import"../chunk-013mp499.js";import"../chunk-sbmdk35p.js";import"../chunk-4nrrjn7g.js";import"../chunk-587w6ktw.js";import"../chunk-r9gdz351.js";import"../chunk-fjkswqq2.js";import"../chunk-vk5r6pgx.js";import"../chunk-n0tw6p7g.js";import"../chunk-cyzr3xat.js";import"../chunk-2q641ekp.js";import"../chunk-6ekgn7sc.js";import"../chunk-cgqg1br8.js";export{Re as planAugmentationImports,sa as scanModuleAugmentations};
2
+ import{oa,Re}from"../chunk-j4w3zxc1.js";import"../chunk-g3737b7k.js";import"../chunk-6b6rt0yh.js";import"../chunk-bys9tn88.js";import"../chunk-3d49h0bx.js";import"../chunk-fpa2ea8k.js";import"../chunk-qbk49jz5.js";import"../chunk-j67chb8m.js";import"../chunk-srfpcjtn.js";import"../chunk-v6fwy63g.js";import"../chunk-6j4wx5mf.js";import"../chunk-0gy70m6b.js";import"../chunk-h28vzayq.js";import"../chunk-g743tp4d.js";import"../chunk-6y728pph.js";import"../chunk-9mdgtq38.js";import"../chunk-6ekemc3h.js";import"../chunk-aw6spwvp.js";import"../chunk-ywff3fq9.js";import"../chunk-587w6ktw.js";import"../chunk-hkcqbex1.js";import"../chunk-cdq514ff.js";import"../chunk-vk5r6pgx.js";import"../chunk-6r01zgys.js";import"../chunk-gwa4hmfa.js";import"../chunk-mzxxgnp8.js";import"../chunk-t5nmnzy6.js";import"../chunk-cgqg1br8.js";export{Re as planAugmentationImports,oa as scanModuleAugmentations};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ge,cr}from"../chunk-cyzr3xat.js";import"../chunk-6ekgn7sc.js";import"../chunk-cgqg1br8.js";export{Ge as bindingPatternNames,cr as projectBindingPattern};
2
+ import{Ge,lr}from"../chunk-gwa4hmfa.js";import"../chunk-t5nmnzy6.js";import"../chunk-cgqg1br8.js";export{Ge as bindingPatternNames,lr as projectBindingPattern};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{zi,Ui,Hi,Ki,qi,Ji,Yi,Xi,Zi,Qi,es,ts,ns,rs}from"../chunk-90jwk3zy.js";export{rs as BrandedPath,Zi as asAbsolutePath,Xi as asDeclarationName,Ui as asDirectoryPath,qi as asDtsContent,zi as asFilePath,Hi as asGlobPattern,es as asJsonString,Ji as asModuleSpecifier,Qi as asRelativePath,Ki as asSourceCode,Yi as asTypeName,ts as isBranded,ns as unwrap};
2
+ import{Ui,Hi,Ki,qi,Ji,Yi,Xi,Zi,Qi,es,ts,ns,rs,is}from"../chunk-4rsk49xj.js";export{is as BrandedPath,Qi as asAbsolutePath,Zi as asDeclarationName,Hi as asDirectoryPath,Ji as asDtsContent,Ui as asFilePath,Ki as asGlobPattern,ts as asJsonString,Yi as asModuleSpecifier,es as asRelativePath,qi as asSourceCode,Xi as asTypeName,ns as isBranded,rs as unwrap};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Oo,nt,Pn}from"../chunk-czgjmefa.js";import"../chunk-4sasxrdr.js";import"../chunk-x6ddycvm.js";import"../chunk-g9emajpc.js";import"../chunk-02yqpwv0.js";import"../chunk-3mp0jaa7.js";import"../chunk-m9b6cqn7.js";import"../chunk-3z75j224.js";import"../chunk-e4f5kxrh.js";import"../chunk-bkrftw1s.js";import"../chunk-zbrj37wa.js";import"../chunk-zpvcnc7c.js";import"../chunk-013mp499.js";import"../chunk-sbmdk35p.js";import"../chunk-4nrrjn7g.js";import"../chunk-587w6ktw.js";import"../chunk-r9gdz351.js";import"../chunk-fjkswqq2.js";import"../chunk-vk5r6pgx.js";import"../chunk-n0tw6p7g.js";import"../chunk-cyzr3xat.js";import"../chunk-2q641ekp.js";import"../chunk-6ekgn7sc.js";import"../chunk-cgqg1br8.js";export{Pn as linkBundle,nt as renameIdentifiers,Oo as splitTopLevelStatements};
2
+ import{Io,nt,Rn}from"../chunk-87mk4nnk.js";import"../chunk-1t77gtcx.js";import"../chunk-x6ddycvm.js";import"../chunk-g9emajpc.js";import"../chunk-6b6rt0yh.js";import"../chunk-8vvryt8p.js";import"../chunk-6j4wx5mf.js";import"../chunk-0gy70m6b.js";import"../chunk-h28vzayq.js";import"../chunk-g743tp4d.js";import"../chunk-6y728pph.js";import"../chunk-9mdgtq38.js";import"../chunk-6ekemc3h.js";import"../chunk-aw6spwvp.js";import"../chunk-ywff3fq9.js";import"../chunk-587w6ktw.js";import"../chunk-hkcqbex1.js";import"../chunk-cdq514ff.js";import"../chunk-vk5r6pgx.js";import"../chunk-6r01zgys.js";import"../chunk-gwa4hmfa.js";import"../chunk-mzxxgnp8.js";import"../chunk-t5nmnzy6.js";import"../chunk-cgqg1br8.js";export{Rn as linkBundle,nt as renameIdentifiers,Io as splitTopLevelStatements};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{ys,tn,Tr,bs,ws}from"../chunk-bj3r4j0a.js";import"../chunk-a04yhmwb.js";import"../chunk-cq5zpg9c.js";import"../chunk-kcfc6zg6.js";import"../chunk-8gksa73c.js";import"../chunk-937czex4.js";import"../chunk-srfpcjtn.js";import"../chunk-v6fwy63g.js";import"../chunk-m9b6cqn7.js";import"../chunk-3z75j224.js";import"../chunk-e4f5kxrh.js";import"../chunk-bkrftw1s.js";import"../chunk-zbrj37wa.js";import"../chunk-zpvcnc7c.js";import"../chunk-013mp499.js";import"../chunk-sbmdk35p.js";import"../chunk-4nrrjn7g.js";import"../chunk-587w6ktw.js";import"../chunk-r9gdz351.js";import"../chunk-fjkswqq2.js";import"../chunk-vk5r6pgx.js";import"../chunk-n0tw6p7g.js";import"../chunk-cyzr3xat.js";import"../chunk-2q641ekp.js";import"../chunk-6ekgn7sc.js";import"../chunk-cgqg1br8.js";export{Tr as bundleAndWrite,ys as bundleDeclarations,tn as bundleDtsFiles,bs as createBundler,ws as resolveEntryFiles};
2
+ import{bs,nn,Ar,ws,xs}from"../chunk-wvdy228e.js";import"../chunk-bys9tn88.js";import"../chunk-3d49h0bx.js";import"../chunk-fpa2ea8k.js";import"../chunk-qbk49jz5.js";import"../chunk-j67chb8m.js";import"../chunk-srfpcjtn.js";import"../chunk-v6fwy63g.js";import"../chunk-6j4wx5mf.js";import"../chunk-0gy70m6b.js";import"../chunk-h28vzayq.js";import"../chunk-g743tp4d.js";import"../chunk-6y728pph.js";import"../chunk-9mdgtq38.js";import"../chunk-6ekemc3h.js";import"../chunk-aw6spwvp.js";import"../chunk-ywff3fq9.js";import"../chunk-587w6ktw.js";import"../chunk-hkcqbex1.js";import"../chunk-cdq514ff.js";import"../chunk-vk5r6pgx.js";import"../chunk-6r01zgys.js";import"../chunk-gwa4hmfa.js";import"../chunk-mzxxgnp8.js";import"../chunk-t5nmnzy6.js";import"../chunk-cgqg1br8.js";export{Ar as bundleAndWrite,bs as bundleDeclarations,nn as bundleDtsFiles,ws as createBundler,xs as resolveEntryFiles};