codebaseiq 0.1.0 → 0.2.0

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 (422) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist/augment-vue-worker.js +1 -1
  3. package/dist/{chunk-DQMDCD24.js → chunk-27PHVDKL.js} +2 -2
  4. package/dist/{chunk-ZMI2JSX2.js → chunk-2DMVFAY7.js} +2 -2
  5. package/dist/{chunk-5PUWMSDU.js → chunk-2E6BTWER.js} +2 -2
  6. package/dist/{chunk-YESXMKX3.js → chunk-2F5ERMNI.js} +2 -2
  7. package/dist/chunk-2VKB5CMA.js +60 -0
  8. package/dist/{chunk-NNJ2KZZG.js → chunk-327YK6TB.js} +4 -4
  9. package/dist/chunk-347TXATM.js +2 -0
  10. package/dist/{chunk-VEXUL62T.js → chunk-35YYZD3D.js} +2 -2
  11. package/dist/chunk-36WRYYTE.js +3 -0
  12. package/dist/chunk-37TKC6MB.js +2 -0
  13. package/dist/{chunk-FAJQ7LWY.js → chunk-3AC56WAR.js} +2 -2
  14. package/dist/{chunk-JE3WZ6II.js → chunk-3NUZVLR7.js} +2 -2
  15. package/dist/{chunk-UZGZB3VB.js → chunk-3XFJUWJE.js} +2 -2
  16. package/dist/{chunk-OVTS4DKB.js → chunk-4AOOSCZ7.js} +2 -2
  17. package/dist/{chunk-LU3BMVH2.js → chunk-4IFISPQW.js} +2 -2
  18. package/dist/chunk-4NHWNAWQ.js +11 -0
  19. package/dist/chunk-4O52YNKL.js +5 -0
  20. package/dist/{chunk-HPJRBHVT.js → chunk-54K6556S.js} +2 -2
  21. package/dist/{chunk-HRWGYWRJ.js → chunk-57GCCPLS.js} +2 -2
  22. package/dist/{chunk-J77SU6VA.js → chunk-57KEZDPT.js} +2 -2
  23. package/dist/{chunk-OFBE4NGP.js → chunk-57KFVPVZ.js} +2 -2
  24. package/dist/{chunk-WOQBZPIF.js → chunk-5BDK6QC3.js} +2 -2
  25. package/dist/{chunk-7MGU3HPH.js → chunk-5IO2APSS.js} +2 -2
  26. package/dist/chunk-5NJPH3QZ.js +61 -0
  27. package/dist/{chunk-GW6Z3WGY.js → chunk-5WXOEJ4G.js} +2 -2
  28. package/dist/chunk-5XEVXVTK.js +3 -0
  29. package/dist/{chunk-RR7SX44N.js → chunk-6OVNYYY4.js} +2 -2
  30. package/dist/{chunk-ZV3JV5G5.js → chunk-6SDEQTVY.js} +2 -2
  31. package/dist/{chunk-EF2R3WNQ.js → chunk-6URCE5QY.js} +2 -2
  32. package/dist/{chunk-UCD3H3UZ.js → chunk-6ZV5EDUT.js} +2 -2
  33. package/dist/{chunk-C6SBF2WH.js → chunk-77GHPR2R.js} +2 -2
  34. package/dist/{chunk-YVCIMIOC.js → chunk-7R64XY4Y.js} +2 -2
  35. package/dist/{chunk-VXYS3FZD.js → chunk-7Z7HCZ7J.js} +2 -2
  36. package/dist/{chunk-CO5R3UNA.js → chunk-A67HT5FR.js} +2 -2
  37. package/dist/{chunk-UDS562V4.js → chunk-A7XQT7MH.js} +2 -2
  38. package/dist/{chunk-RDBI2RXU.js → chunk-ACZDU5GK.js} +2 -2
  39. package/dist/{chunk-FETNQCFO.js → chunk-AM5SUGHF.js} +2 -2
  40. package/dist/{chunk-NNOKTMZT.js → chunk-B2E3HZ2A.js} +2 -2
  41. package/dist/{chunk-CVYSU6BX.js → chunk-BH5CE4LN.js} +2 -2
  42. package/dist/chunk-BLKYYQ7C.js +543 -0
  43. package/dist/{chunk-4WKDMDEW.js → chunk-BX2U3QQV.js} +2 -2
  44. package/dist/{chunk-ZKX2FRS6.js → chunk-CANBLFVQ.js} +2 -2
  45. package/dist/{chunk-SMRBZ6EC.js → chunk-CCRZLRWJ.js} +2 -2
  46. package/dist/chunk-CDWSLAPN.js +21 -0
  47. package/dist/chunk-CIVYHK7U.js +22 -0
  48. package/dist/{chunk-L57ZKWVG.js → chunk-CMXW7MFV.js} +2 -2
  49. package/dist/{chunk-T3DGWPXM.js → chunk-CSZOQ7YO.js} +2 -2
  50. package/dist/{chunk-ZZXSWSN6.js → chunk-CWMHWD56.js} +2 -2
  51. package/dist/{chunk-6NW7MU72.js → chunk-CZEIHYMP.js} +2 -2
  52. package/dist/{chunk-DO6WQD2T.js → chunk-D62CTZX6.js} +2 -2
  53. package/dist/{chunk-XWUOUWYI.js → chunk-DFPAZXLU.js} +2 -2
  54. package/dist/{chunk-MOVBWNIP.js → chunk-DKJXK3HA.js} +2 -2
  55. package/dist/{chunk-XMQ23E27.js → chunk-DLC6JDN7.js} +2 -2
  56. package/dist/chunk-DUKHVPU5.js +4 -0
  57. package/dist/{chunk-ID63777H.js → chunk-DVYG3JTA.js} +2 -2
  58. package/dist/{chunk-NE6IU5ZD.js → chunk-EFFMFK7C.js} +2 -2
  59. package/dist/{chunk-I2T2LLK2.js → chunk-EM5UHLAM.js} +2 -2
  60. package/dist/chunk-EN4AHLL3.js +3 -0
  61. package/dist/chunk-EXMVF3JR.js +3 -0
  62. package/dist/{chunk-SWHMHUKF.js → chunk-FEBLLMTL.js} +2 -2
  63. package/dist/chunk-FIXYHQ3W.js +3 -0
  64. package/dist/{chunk-RKEJ6VTF.js → chunk-FLLXYUOL.js} +2 -2
  65. package/dist/{chunk-KWVHSKHK.js → chunk-FPDL2TUB.js} +2 -2
  66. package/dist/chunk-FQA3KIFX.js +17 -0
  67. package/dist/chunk-FWY2PRIF.js +3 -0
  68. package/dist/chunk-FY5V4V4F.js +2 -0
  69. package/dist/chunk-G2XUZCF2.js +88 -0
  70. package/dist/{chunk-QHRNXP3C.js → chunk-GXVDTHFC.js} +2 -2
  71. package/dist/{chunk-6MUIJMVL.js → chunk-H3CKAL6P.js} +2 -2
  72. package/dist/chunk-H5QXP63L.js +2 -0
  73. package/dist/{chunk-VUIYB2V3.js → chunk-HBQGKMM3.js} +2 -2
  74. package/dist/{chunk-PYAB5SM6.js → chunk-HBXZAGY6.js} +2 -2
  75. package/dist/{chunk-NNO6A2PO.js → chunk-HCMQZPEO.js} +2 -2
  76. package/dist/{chunk-Q65CQ4XL.js → chunk-HHBBGWES.js} +2 -2
  77. package/dist/{chunk-GTXSJDCO.js → chunk-HIEXRDJF.js} +2 -2
  78. package/dist/{chunk-4FC325IF.js → chunk-HYKSLTAR.js} +2 -2
  79. package/dist/{chunk-XLQ3GLWZ.js → chunk-I2KP4AGR.js} +2 -2
  80. package/dist/chunk-I5FCDTK2.js +2 -0
  81. package/dist/{chunk-QKPLA6IC.js → chunk-I645ZF75.js} +2 -2
  82. package/dist/{chunk-FDGD5AB5.js → chunk-IBM3F2BJ.js} +2 -2
  83. package/dist/{chunk-Q72QSKXC.js → chunk-IEL6Q5W3.js} +38 -38
  84. package/dist/{chunk-NCZUNH3E.js → chunk-IGQQUENU.js} +12 -12
  85. package/dist/chunk-IGYAZPRX.js +4 -0
  86. package/dist/chunk-IOVPAZWP.js +3 -0
  87. package/dist/{chunk-OL6KJP3N.js → chunk-IVJJNVSX.js} +2 -2
  88. package/dist/{chunk-AKB7V7TV.js → chunk-IWAMYGPN.js} +2 -2
  89. package/dist/chunk-IYBIBMPF.js +90 -0
  90. package/dist/{chunk-IOP6FWIM.js → chunk-J24VICI5.js} +2 -2
  91. package/dist/{chunk-C7QOQX32.js → chunk-JN5LIBT3.js} +2 -2
  92. package/dist/{chunk-O6QTXQPJ.js → chunk-JOALNFY3.js} +2 -2
  93. package/dist/{chunk-GCHRX4YW.js → chunk-JUO3Z644.js} +2 -2
  94. package/dist/{chunk-BJ6SQAEN.js → chunk-JXHLB7TP.js} +2 -2
  95. package/dist/{chunk-IJ4HMYBE.js → chunk-JYX5UZSZ.js} +2 -2
  96. package/dist/chunk-K2O7SBAU.js +2 -0
  97. package/dist/{chunk-OLF4MA5W.js → chunk-K5G7SPAG.js} +2 -2
  98. package/dist/{chunk-YSNONTJ2.js → chunk-KDYQQJ6X.js} +2 -2
  99. package/dist/{chunk-7NVGT435.js → chunk-KM4QRWI5.js} +2 -2
  100. package/dist/{chunk-HKQUXIFO.js → chunk-KNV5VFDV.js} +2 -2
  101. package/dist/chunk-L3YSDLNB.js +2 -0
  102. package/dist/{chunk-EZNMUY67.js → chunk-LAGDJXFY.js} +2 -2
  103. package/dist/{chunk-ENCCHKM6.js → chunk-LY2NB5XR.js} +4 -4
  104. package/dist/chunk-M4EVGA5S.js +14 -0
  105. package/dist/chunk-M7LAIM77.js +127 -0
  106. package/dist/{chunk-BVAJLC5A.js → chunk-MRGTCMDK.js} +2 -2
  107. package/dist/{chunk-OZYRSMSH.js → chunk-MT5W4DUG.js} +2 -2
  108. package/dist/{chunk-VE5AVNMP.js → chunk-MTMF4N7F.js} +2 -2
  109. package/dist/chunk-N3Q3AWGW.js +545 -0
  110. package/dist/{chunk-TXXOEMZJ.js → chunk-NDGTJHQN.js} +2 -2
  111. package/dist/chunk-NIO346UL.js +2 -0
  112. package/dist/chunk-NJA4MMBD.js +2 -0
  113. package/dist/{chunk-7FND7D7N.js → chunk-NK76RSB6.js} +2 -2
  114. package/dist/{chunk-H3LGFZVK.js → chunk-NTRW52UR.js} +2 -2
  115. package/dist/{chunk-JOIRNPPY.js → chunk-OJFLPVBP.js} +2 -2
  116. package/dist/{chunk-KMITESMT.js → chunk-OMBRP7BB.js} +2 -2
  117. package/dist/{chunk-UP3BUZR5.js → chunk-OVKZM2XI.js} +2 -2
  118. package/dist/{chunk-MVB3DAEY.js → chunk-PARCKE3Q.js} +2 -2
  119. package/dist/{chunk-CAUCPUOF.js → chunk-PFPHS4NO.js} +2 -2
  120. package/dist/chunk-PHPQ24UG.js +22 -0
  121. package/dist/chunk-PLZXWZHY.js +77 -0
  122. package/dist/{chunk-34WBMAYK.js → chunk-PNVZIJ57.js} +2 -2
  123. package/dist/{chunk-SYDJMPES.js → chunk-QKVTWODE.js} +2 -2
  124. package/dist/{chunk-FW53T7EB.js → chunk-QLTFXVUI.js} +2 -2
  125. package/dist/{chunk-PBI2LFKH.js → chunk-QMGWSEPL.js} +2 -2
  126. package/dist/{chunk-CQP3THUZ.js → chunk-QVHZB75Z.js} +2 -2
  127. package/dist/{chunk-6BQ3DSPK.js → chunk-QVWDQTMG.js} +2 -2
  128. package/dist/{chunk-ST7V3SKN.js → chunk-RCPZOPV6.js} +2 -2
  129. package/dist/chunk-RJWAB4VR.js +345 -0
  130. package/dist/chunk-RRPK327J.js +20 -0
  131. package/dist/chunk-RVYLJDXC.js +21 -0
  132. package/dist/chunk-RWKEXCHU.js +3 -0
  133. package/dist/{chunk-L4NRUAGJ.js → chunk-S5SKXCND.js} +2 -2
  134. package/dist/{chunk-RBAS5ZHI.js → chunk-S64NCE2Z.js} +2 -2
  135. package/dist/{chunk-WMPRTGH2.js → chunk-SF34QLK2.js} +2 -2
  136. package/dist/{chunk-ANFVSJWQ.js → chunk-SJZQ2PTZ.js} +2 -2
  137. package/dist/{chunk-4XTAUQFD.js → chunk-SRY26ITJ.js} +2 -2
  138. package/dist/chunk-SV2LEFVM.js +2 -0
  139. package/dist/{chunk-7XAN6GKB.js → chunk-T3YFIJ5P.js} +2 -2
  140. package/dist/chunk-T55YPJGB.js +3 -0
  141. package/dist/chunk-TAJ6UGCO.js +21 -0
  142. package/dist/{chunk-PIOMTC27.js → chunk-TUTSO7UZ.js} +2 -2
  143. package/dist/{chunk-FQKZWM4L.js → chunk-U24M5RQM.js} +5 -5
  144. package/dist/{chunk-XME3HPXZ.js → chunk-U2XX3BT4.js} +2 -2
  145. package/dist/{chunk-SZD2KF7Q.js → chunk-UWB5WMC2.js} +2 -2
  146. package/dist/{chunk-6CS3UQTN.js → chunk-VCL7FK3E.js} +2 -2
  147. package/dist/{chunk-N3IQCBCF.js → chunk-VCWAJPXQ.js} +2 -2
  148. package/dist/{chunk-LZYFLFEH.js → chunk-VG55NFXF.js} +2 -2
  149. package/dist/{chunk-PTAWHLVJ.js → chunk-VLTUX4IF.js} +2 -2
  150. package/dist/{chunk-JEJLSICM.js → chunk-VVCBMH5O.js} +2 -2
  151. package/dist/{chunk-JSOYNVWH.js → chunk-VYZQZ4ZN.js} +2 -2
  152. package/dist/chunk-W3FK73MD.js +8 -0
  153. package/dist/{chunk-UNBY47BC.js → chunk-W6C6QTXJ.js} +2 -2
  154. package/dist/chunk-WH5SYOMD.js +2 -0
  155. package/dist/chunk-WJOQC4P7.js +7 -0
  156. package/dist/chunk-WO47BIPY.js +3 -0
  157. package/dist/chunk-WOOTEWQT.js +239 -0
  158. package/dist/{chunk-UBGWN7I4.js → chunk-X5I2BQGX.js} +2 -2
  159. package/dist/{chunk-PX4RYAAK.js → chunk-XNUWRTYM.js} +2 -2
  160. package/dist/{chunk-ICFDQHAM.js → chunk-XUJM6474.js} +2 -2
  161. package/dist/chunk-XYLV727H.js +21 -0
  162. package/dist/{chunk-TRRC4ZJ7.js → chunk-YFQPWKHR.js} +2 -2
  163. package/dist/{chunk-NEDP5RFQ.js → chunk-YIOQJ45A.js} +2 -2
  164. package/dist/{chunk-Y6KHROC3.js → chunk-YXJ4IAHH.js} +2 -2
  165. package/dist/chunk-YYFV32WR.js +3 -0
  166. package/dist/{chunk-BH5F2Q4O.js → chunk-ZB3V5QM7.js} +2 -2
  167. package/dist/chunk-ZJZQ7Q2Q.js +3 -0
  168. package/dist/{chunk-EMNIHCRB.js → chunk-ZNQCR656.js} +2 -2
  169. package/dist/{chunk-TIIC3ZE7.js → chunk-ZOEDRCR4.js} +2 -2
  170. package/dist/cli-context-TSADTXLB.js +2 -0
  171. package/dist/cli-context-XEPPF4RX.js +3 -0
  172. package/dist/cli-program-KJGQEM72.js +7 -0
  173. package/dist/cli.js +1 -1
  174. package/dist/{code-DlqpBDd0.d.ts → code-CDe-mIjx.d.ts} +1 -1
  175. package/dist/code-viewer-YGDON6SY.js +12 -0
  176. package/dist/code-viewer-ZCTHXQ5C.js +11 -0
  177. package/dist/command-descriptors-5VAB2MZX.js +335 -0
  178. package/dist/command-descriptors-EAHKIRAG.js +337 -0
  179. package/dist/{config-types-BNoC96J3.d.ts → config-types-D6X5S68_.d.ts} +50 -0
  180. package/dist/{db-D7sauVFH.d.ts → db-DmRNdCtm.d.ts} +1 -1
  181. package/dist/direct-navigation-B3SGOOBW.js +2 -0
  182. package/dist/direct-navigation-ZL362KXF.js +3 -0
  183. package/dist/{graph-evidence-BIFqyisO.d.ts → graph-evidence-Bs54NWws.d.ts} +1 -1
  184. package/dist/{health-DJaZXg8I.d.ts → health-BnzbSLCE.d.ts} +1 -1
  185. package/dist/index.d.ts +2 -2
  186. package/dist/index.js +1 -1
  187. package/dist/invocation-command-descriptors-CSUGUHTT.js +2 -0
  188. package/dist/invocation-command-descriptors-PPVZOIE5.js +3 -0
  189. package/dist/output-continuation-command-FTVVBVSN.js +2 -0
  190. package/dist/output-continuation-command-ITPRC3YV.js +3 -0
  191. package/dist/project-reindex-7HZSLLLY.js +3 -0
  192. package/dist/project-reindex-NGM3DYBN.js +2 -0
  193. package/dist/queries/affected.d.ts +2 -2
  194. package/dist/queries/affected.js +1 -1
  195. package/dist/queries/anchors.d.ts +2 -2
  196. package/dist/queries/anchors.js +1 -1
  197. package/dist/queries/architecture.d.ts +2 -2
  198. package/dist/queries/architecture.js +1 -1
  199. package/dist/queries/bottlenecks.d.ts +2 -2
  200. package/dist/queries/bottlenecks.js +1 -1
  201. package/dist/queries/by-kind.d.ts +2 -2
  202. package/dist/queries/by-kind.js +1 -1
  203. package/dist/queries/call-graph.d.ts +2 -2
  204. package/dist/queries/call-graph.js +1 -1
  205. package/dist/queries/change-surface.d.ts +2 -2
  206. package/dist/queries/change-surface.js +1 -1
  207. package/dist/queries/cleanup-plan.d.ts +2 -2
  208. package/dist/queries/cleanup-plan.js +1 -1
  209. package/dist/queries/co-change.d.ts +2 -2
  210. package/dist/queries/co-change.js +1 -1
  211. package/dist/queries/code.d.ts +3 -3
  212. package/dist/queries/code.js +1 -1
  213. package/dist/queries/complexity-hotspots.d.ts +2 -2
  214. package/dist/queries/complexity-hotspots.js +1 -1
  215. package/dist/queries/complexity.d.ts +2 -2
  216. package/dist/queries/complexity.js +1 -1
  217. package/dist/queries/context.d.ts +2 -2
  218. package/dist/queries/context.js +1 -1
  219. package/dist/queries/convergence.d.ts +2 -2
  220. package/dist/queries/convergence.js +1 -1
  221. package/dist/queries/coupling.d.ts +2 -2
  222. package/dist/queries/coupling.js +1 -1
  223. package/dist/queries/cycles.d.ts +2 -2
  224. package/dist/queries/cycles.js +1 -1
  225. package/dist/queries/dataflow.d.ts +2 -2
  226. package/dist/queries/dataflow.js +1 -1
  227. package/dist/queries/dead.d.ts +2 -2
  228. package/dist/queries/dead.js +1 -1
  229. package/dist/queries/decorative-checkers.d.ts +2 -2
  230. package/dist/queries/decorative-checkers.js +1 -1
  231. package/dist/queries/deep-chains.d.ts +2 -2
  232. package/dist/queries/deep-chains.js +1 -1
  233. package/dist/queries/dependence-slice.d.ts +3 -3
  234. package/dist/queries/dependence-slice.js +1 -1
  235. package/dist/queries/dependency-depth.d.ts +2 -2
  236. package/dist/queries/dependency-depth.js +1 -1
  237. package/dist/queries/deps.d.ts +2 -2
  238. package/dist/queries/deps.js +1 -1
  239. package/dist/queries/diff-impact.d.ts +2 -2
  240. package/dist/queries/diff-impact.js +1 -1
  241. package/dist/queries/doc-drift.d.ts +2 -2
  242. package/dist/queries/doc-drift.js +1 -1
  243. package/dist/queries/drift.d.ts +2 -2
  244. package/dist/queries/drift.js +1 -1
  245. package/dist/queries/duplicate-bodies.d.ts +2 -2
  246. package/dist/queries/duplicate-bodies.js +1 -1
  247. package/dist/queries/entry-map.d.ts +2 -2
  248. package/dist/queries/entry-map.js +1 -1
  249. package/dist/queries/evidence.d.ts +3 -3
  250. package/dist/queries/evidence.js +1 -1
  251. package/dist/queries/extract-candidates.d.ts +2 -2
  252. package/dist/queries/extract-candidates.js +1 -1
  253. package/dist/queries/fan.d.ts +2 -2
  254. package/dist/queries/fan.js +1 -1
  255. package/dist/queries/files.d.ts +2 -2
  256. package/dist/queries/files.js +1 -1
  257. package/dist/queries/health.d.ts +3 -3
  258. package/dist/queries/health.js +1 -1
  259. package/dist/queries/hierarchy.d.ts +2 -2
  260. package/dist/queries/hierarchy.js +1 -1
  261. package/dist/queries/hotspots.d.ts +2 -2
  262. package/dist/queries/hotspots.js +1 -1
  263. package/dist/queries/imports.d.ts +2 -2
  264. package/dist/queries/imports.js +1 -1
  265. package/dist/queries/incomplete-migration.d.ts +2 -2
  266. package/dist/queries/incomplete-migration.js +1 -1
  267. package/dist/queries/index.d.ts +5 -5
  268. package/dist/queries/index.js +1 -1
  269. package/dist/queries/isolated.d.ts +2 -2
  270. package/dist/queries/isolated.js +1 -1
  271. package/dist/queries/locality-candidates.d.ts +2 -2
  272. package/dist/queries/locality-candidates.js +1 -1
  273. package/dist/queries/members.d.ts +2 -2
  274. package/dist/queries/members.js +1 -1
  275. package/dist/queries/methods.d.ts +2 -2
  276. package/dist/queries/methods.js +1 -1
  277. package/dist/queries/not-implemented.d.ts +2 -2
  278. package/dist/queries/not-implemented.js +1 -1
  279. package/dist/queries/outline.d.ts +2 -2
  280. package/dist/queries/outline.js +1 -1
  281. package/dist/queries/passthrough-candidates.d.ts +2 -2
  282. package/dist/queries/passthrough-candidates.js +1 -1
  283. package/dist/queries/plan-context.d.ts +2 -2
  284. package/dist/queries/plan-context.js +1 -1
  285. package/dist/queries/react-component-duplicates.d.ts +2 -2
  286. package/dist/queries/react-component-duplicates.js +1 -1
  287. package/dist/queries/react-hook-candidates.d.ts +2 -2
  288. package/dist/queries/react-hook-candidates.js +1 -1
  289. package/dist/queries/react-large-component-pressure.d.ts +2 -2
  290. package/dist/queries/react-large-component-pressure.js +1 -1
  291. package/dist/queries/recent-duplicates.d.ts +2 -2
  292. package/dist/queries/recent-duplicates.js +1 -1
  293. package/dist/queries/redundant-reexports.d.ts +2 -2
  294. package/dist/queries/redundant-reexports.js +1 -1
  295. package/dist/queries/reference-neighborhood.d.ts +2 -2
  296. package/dist/queries/reference-neighborhood.js +1 -1
  297. package/dist/queries/reference-reachability.d.ts +2 -2
  298. package/dist/queries/reference-reachability.js +1 -1
  299. package/dist/queries/refs.d.ts +2 -2
  300. package/dist/queries/refs.js +1 -1
  301. package/dist/queries/self-audit.d.ts +2 -2
  302. package/dist/queries/self-audit.js +1 -1
  303. package/dist/queries/similar-chains.d.ts +2 -2
  304. package/dist/queries/similar-chains.js +1 -1
  305. package/dist/queries/similar-files.d.ts +2 -2
  306. package/dist/queries/similar-files.js +1 -1
  307. package/dist/queries/similar-signatures.d.ts +2 -2
  308. package/dist/queries/similar-signatures.js +1 -1
  309. package/dist/queries/similar.d.ts +2 -2
  310. package/dist/queries/similar.js +1 -1
  311. package/dist/queries/slice.d.ts +2 -2
  312. package/dist/queries/slice.js +1 -1
  313. package/dist/queries/source-inspection.d.ts +4 -4
  314. package/dist/queries/source-inspection.js +1 -1
  315. package/dist/queries/source-search.d.ts +2 -2
  316. package/dist/queries/source-search.js +1 -1
  317. package/dist/queries/stale-abstractions.d.ts +2 -2
  318. package/dist/queries/stale-abstractions.js +1 -1
  319. package/dist/queries/stats.d.ts +2 -2
  320. package/dist/queries/surface.d.ts +2 -2
  321. package/dist/queries/surface.js +1 -1
  322. package/dist/queries/symbols.d.ts +2 -2
  323. package/dist/queries/symbols.js +1 -1
  324. package/dist/queries/system-map.d.ts +2 -2
  325. package/dist/queries/system-map.js +1 -1
  326. package/dist/queries/system.d.ts +2 -2
  327. package/dist/queries/system.js +1 -1
  328. package/dist/queries/test-quality.d.ts +2 -2
  329. package/dist/queries/test-quality.js +1 -1
  330. package/dist/queries/trace.d.ts +2 -2
  331. package/dist/queries/trace.js +1 -1
  332. package/dist/queries/twin-ab.d.ts +2 -2
  333. package/dist/queries/twin-ab.js +1 -1
  334. package/dist/queries/twin-drift.d.ts +2 -2
  335. package/dist/queries/twin-drift.js +1 -1
  336. package/dist/queries/unused-imports.d.ts +2 -2
  337. package/dist/queries/unused-imports.js +1 -1
  338. package/dist/queries/unused-params.d.ts +2 -2
  339. package/dist/queries/unused-params.js +1 -1
  340. package/dist/queries/value-flow.d.ts +3 -3
  341. package/dist/queries/value-flow.js +1 -1
  342. package/dist/queries/vue-component-duplicates.d.ts +2 -2
  343. package/dist/queries/vue-component-duplicates.js +1 -1
  344. package/dist/queries/vue-composable-candidates.d.ts +2 -2
  345. package/dist/queries/vue-composable-candidates.js +1 -1
  346. package/dist/queries/vue-large-view-pressure.d.ts +2 -2
  347. package/dist/queries/vue-large-view-pressure.js +1 -1
  348. package/dist/queries/wrapper-candidates.d.ts +2 -2
  349. package/dist/queries/wrapper-candidates.js +1 -1
  350. package/dist/reindex-worker.js +1 -1
  351. package/dist/reindex.d.ts +3 -3
  352. package/dist/reindex.js +31 -31
  353. package/dist/runtime.d.ts +24 -4
  354. package/dist/runtime.js +3 -3
  355. package/dist/rust-semantic-session-server.js +1 -1
  356. package/dist/rust-semantic-session-worker.js +1 -1
  357. package/dist/rust-semantic-worker.js +1 -1
  358. package/dist/{scip-cli-B7N3haxa.d.ts → scip-cli-BRFKkHQn.d.ts} +1 -1
  359. package/dist/sentinel-ensure-command-KYYULCFU.js +2 -0
  360. package/dist/sentinel-ensure-command-RIZA3RY7.js +3 -0
  361. package/dist/sentinel-hook.js +39 -0
  362. package/dist/sentinel-worker.js +16 -0
  363. package/dist/typescript-mailbox-worker.js +1 -1
  364. package/dist/watch-server.js +6 -6
  365. package/docs/COMMAND_REFERENCE.md +5 -3
  366. package/docs/schemas/project-config.schema.json +159 -0
  367. package/package.json +9 -5
  368. package/skills/codebaseiq/SKILL.md +1 -1
  369. package/skills/concrete-plan/SKILL.md +1 -1
  370. package/ui/view/api.js +450 -0
  371. package/ui/view/app.js +394 -0
  372. package/ui/view/builder.js +323 -0
  373. package/ui/view/file-panel.js +170 -0
  374. package/ui/view/focus.js +379 -0
  375. package/ui/view/index.html +54 -0
  376. package/ui/view/map.js +424 -0
  377. package/ui/view/styles.css +1125 -0
  378. package/dist/chunk-2X7V4HS4.js +0 -88
  379. package/dist/chunk-3IER7Q6H.js +0 -12
  380. package/dist/chunk-3JSXXYTZ.js +0 -345
  381. package/dist/chunk-476NR5B7.js +0 -2
  382. package/dist/chunk-5VKBFZZU.js +0 -3
  383. package/dist/chunk-ADTBPVUZ.js +0 -21
  384. package/dist/chunk-BFFZDZQV.js +0 -2
  385. package/dist/chunk-BMYOV5GP.js +0 -77
  386. package/dist/chunk-C74PPYLA.js +0 -3
  387. package/dist/chunk-CWONGW6P.js +0 -3
  388. package/dist/chunk-DDZ7VHWV.js +0 -20
  389. package/dist/chunk-DR2LURYU.js +0 -3
  390. package/dist/chunk-ECQBG7PW.js +0 -564
  391. package/dist/chunk-FM5BPL4V.js +0 -60
  392. package/dist/chunk-G6XFR4ZL.js +0 -4
  393. package/dist/chunk-GTIYTDRE.js +0 -562
  394. package/dist/chunk-HOA5YGOH.js +0 -3
  395. package/dist/chunk-KUW32IRO.js +0 -2
  396. package/dist/chunk-LTA3BRZX.js +0 -2
  397. package/dist/chunk-NAUD7LCA.js +0 -2
  398. package/dist/chunk-OGTFJ3XD.js +0 -2
  399. package/dist/chunk-Q5ELPRKQ.js +0 -2
  400. package/dist/chunk-QCN62RTF.js +0 -3
  401. package/dist/chunk-QW7EP6WI.js +0 -21
  402. package/dist/chunk-RU65DDUP.js +0 -215
  403. package/dist/chunk-SELM5MER.js +0 -2
  404. package/dist/chunk-SNNWPCN7.js +0 -4
  405. package/dist/chunk-TFZB6XTM.js +0 -239
  406. package/dist/chunk-UXM43C7T.js +0 -3
  407. package/dist/chunk-VFY6Y2H6.js +0 -61
  408. package/dist/chunk-WE5RZHZ7.js +0 -5
  409. package/dist/chunk-Z54RD7VL.js +0 -3
  410. package/dist/cli-context-3SNLDYBM.js +0 -3
  411. package/dist/cli-context-T3B7W6GG.js +0 -2
  412. package/dist/cli-program-YNOXO72B.js +0 -7
  413. package/dist/command-descriptors-6AOUKWW7.js +0 -346
  414. package/dist/command-descriptors-ZFKJSRUP.js +0 -344
  415. package/dist/direct-navigation-DP4LVMRX.js +0 -3
  416. package/dist/direct-navigation-FLUS3BT6.js +0 -2
  417. package/dist/invocation-command-descriptors-QT2JMY5J.js +0 -3
  418. package/dist/invocation-command-descriptors-YN4QJEAX.js +0 -2
  419. package/dist/output-continuation-command-2V2SL4TD.js +0 -2
  420. package/dist/output-continuation-command-65J5IP3O.js +0 -3
  421. package/dist/project-reindex-5JOKXAXT.js +0 -2
  422. package/dist/project-reindex-UQBIKO4M.js +0 -3
@@ -1,345 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as sn,Z as dr,ca as pr,ea as ge,g as Wi,h as D,i as at,ka as fr,la as mr,ma as gr,na as yr,u as ct,v as qi,x as Ki,y as Gi,ya as ke,za as Y}from"./chunk-2X7V4HS4.js";import{q as st,w as on,x as zi}from"./chunk-SNNWPCN7.js";import{createHash as Pc}from"crypto";import{existsSync as wc,mkdirSync as Lc}from"fs";import{dirname as Ji,join as kc}from"path";import hr from"better-sqlite3";function Xi(){let e=new WeakMap;return{cache:e,ensure(t){let n=e.get(t);return n||(n=new Map,e.set(t,n)),n}}}function v(e,t){let{cache:n,ensure:r}=Xi(),i={get(o,s,a){let c=r(o);if(c.has(s))return c.get(s);let l=a();return c.set(s,l),l},invalidate(o,s){n.get(o)?.delete(s)},invalidateAll(o){n.delete(o)},size(o){return n.get(o)?.size??0}};return ct({name:e,groups:t.clearGroups,clearAll:o=>i.invalidateAll(o),clearFile:(o,s)=>i.invalidate(o,s)}),i}function ye(e,t){let n=new WeakMap,r={get(i,o){let s=n.get(i);if(s)return s.value;let a=o();return n.set(i,{value:a}),a},invalidate(i){n.delete(i)},has(i){return n.has(i)}};return ct({name:e,groups:t.clearGroups,clearAll:i=>r.invalidate(i)}),r}var Tc={clearGroups:["whole-project","source-file"]};function De(e){return ze(e,Tc)}function ze(e,t){let{cache:n,ensure:r}=Xi(),i={get(o,s,a,c){let l=r(o),u=l.get(s);if(u&&u.source===a)return u.value;let d=c();return l.set(s,{source:a,value:d}),d},invalidate(o,s){n.get(o)?.delete(s)},invalidateAll(o){n.delete(o)}};return ct({name:e,groups:t.clearGroups,clearAll:o=>i.invalidateAll(o),clearFile:(o,s)=>i.invalidate(o,s)}),i}var Dc="evidence.db";var Ac=["source-facts","definition-exclusions","doc-path-tokens","react-component-behavior-profiles"],Sr=new Set(Ac),Oc=25e4,Mc=512*1024*1024,$c=6e4,ut=new WeakMap;qi({name:"evidence-connections",close:Qi});var Bc=v("evidence-content-hash",{clearGroups:["whole-project","source-file"]}),jc=v("evidence-project-fingerprint",{clearGroups:["whole-project"]}),G="evidence-v1",lt="version NOT LIKE 'evidence-%'";function Ne(e){return Pc("sha256").update(e).digest("hex")}function he(e,t,n){return Bc.get(e,t,()=>Ne(n))}function We(e){return jc.get(e,"current",()=>{try{if(!e.generation.metadataRaw)return null;let t=sn(e.generation.metadataRaw);if(t.kind!=="legacy"&&t.kind!=="supported"||!t.capabilities.usableForEvidenceCache)return null;let n=t.metadata,r=[...n.indexedLanguages??[]].sort();return Ne(JSON.stringify({fingerprint:n.fingerprint,indexedLanguages:r,status:n.status}))}catch(t){return Ae("project fingerprint unavailable",t),null}})}function Ae(e,t){process.env.CODEBASEIQ_DEBUG&&console.error(`evidence-cache: ${e}: ${t instanceof Error?t.message:String(t)}`)}function Ee(e){if(ut.has(e))return ut.get(e)??null;let t=null;try{let n=new hr(kc(Ji(e.config.dbPath),Dc));n.pragma("journal_mode = WAL"),n.pragma("busy_timeout = 5000"),n.pragma("synchronous = NORMAL"),n.exec(`
3
- CREATE TABLE IF NOT EXISTS file_evidence (
4
- kind TEXT NOT NULL,
5
- relative_path TEXT NOT NULL,
6
- content_hash TEXT NOT NULL,
7
- version TEXT NOT NULL,
8
- payload TEXT NOT NULL,
9
- PRIMARY KEY (kind, relative_path)
10
- );
11
- CREATE TABLE IF NOT EXISTS project_evidence (
12
- kind TEXT NOT NULL,
13
- cache_key TEXT NOT NULL,
14
- project_fingerprint TEXT NOT NULL,
15
- version TEXT NOT NULL,
16
- payload TEXT NOT NULL,
17
- PRIMARY KEY (kind, cache_key)
18
- );
19
- CREATE TABLE IF NOT EXISTS semantic_callees (
20
- relative_path TEXT NOT NULL,
21
- symbol TEXT NOT NULL,
22
- content_hash TEXT NOT NULL,
23
- deps_digest TEXT NOT NULL,
24
- version TEXT NOT NULL,
25
- payload TEXT NOT NULL,
26
- PRIMARY KEY (relative_path, symbol)
27
- );
28
- CREATE TABLE IF NOT EXISTS semantic_references (
29
- relative_path TEXT NOT NULL,
30
- symbol TEXT NOT NULL,
31
- project_fingerprint TEXT NOT NULL,
32
- version TEXT NOT NULL,
33
- payload TEXT NOT NULL,
34
- PRIMARY KEY (relative_path, symbol)
35
- );
36
- `),t={evidence:n,shared:Vc(e.config.sharedEvidenceDbPath),readFileEvidence:n.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),readLegacyFileEvidence:n.prepare(`SELECT payload FROM file_evidence
37
- WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${lt}
38
- ORDER BY version DESC
39
- LIMIT 1`),writeFileEvidence:n.prepare("INSERT OR REPLACE INTO file_evidence (kind, relative_path, content_hash, version, payload) VALUES (?, ?, ?, ?, ?)"),readProjectEvidence:n.prepare("SELECT payload FROM project_evidence WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND version = ?"),readLegacyProjectEvidence:n.prepare(`SELECT payload FROM project_evidence
40
- WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND ${lt}
41
- ORDER BY version DESC
42
- LIMIT 1`),writeProjectEvidence:n.prepare("INSERT OR REPLACE INTO project_evidence (kind, cache_key, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)"),readCallees:n.prepare(`SELECT payload FROM semantic_callees
43
- WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCallees:n.prepare(`SELECT payload FROM semantic_callees
44
- WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND ${lt}
45
- ORDER BY version DESC
46
- LIMIT 1`),readCalleesForFile:n.prepare(`SELECT symbol, payload FROM semantic_callees
47
- WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCalleesForFile:n.prepare(`SELECT symbol, payload FROM semantic_callees
48
- WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND ${lt}
49
- ORDER BY symbol, version DESC`),writeCallees:n.prepare(`INSERT OR REPLACE INTO semantic_callees
50
- (relative_path, symbol, content_hash, deps_digest, version, payload) VALUES (?, ?, ?, ?, ?, ?)`),dropStaleCallees:n.prepare("DELETE FROM semantic_callees WHERE relative_path = ? AND content_hash != ?"),readReferences:n.prepare(`SELECT payload FROM semantic_references
51
- WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferences:n.prepare(`SELECT payload FROM semantic_references
52
- WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND ${lt}
53
- ORDER BY version DESC
54
- LIMIT 1`),readReferencesForFile:n.prepare(`SELECT symbol, payload FROM semantic_references
55
- WHERE relative_path = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferencesForFile:n.prepare(`SELECT symbol, payload FROM semantic_references
56
- WHERE relative_path = ? AND project_fingerprint = ? AND ${lt}
57
- ORDER BY symbol, version DESC`),writeReferences:n.prepare(`INSERT OR REPLACE INTO semantic_references
58
- (relative_path, symbol, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)`),dropStaleReferences:n.prepare("DELETE FROM semantic_references WHERE relative_path = ? AND project_fingerprint != ?")}}catch(n){Ae("disabled (open failed)",n)}return ut.set(e,t),t}function Ce(e,t,n){Ae(`disabled (${t})`,n);try{Qi(e)}catch(r){Ae("close failed while disabling",r)}ut.set(e,null)}function Qi(e){let t=ut.get(e);if(ut.delete(e),!t)return;let n,r;try{t.shared?.evidence.close()}catch(i){n=i}try{t.evidence.close()}catch(i){r=i}if(n!==void 0&&r!==void 0)throw new AggregateError([n,r],"Shared and project evidence connections failed to close.");if(n!==void 0)throw n;if(r!==void 0)throw r}function Vc(e){if(!e)return null;try{Lc(Ji(e),{recursive:!0});let t=new hr(e);return t.pragma("journal_mode = WAL"),t.pragma("busy_timeout = 250"),t.pragma("synchronous = NORMAL"),t.exec(`
59
- CREATE TABLE IF NOT EXISTS file_evidence (
60
- kind TEXT NOT NULL,
61
- relative_path TEXT NOT NULL,
62
- content_hash TEXT NOT NULL,
63
- version TEXT NOT NULL,
64
- payload TEXT NOT NULL,
65
- last_accessed_at INTEGER NOT NULL,
66
- PRIMARY KEY (kind, relative_path, content_hash, version)
67
- );
68
- CREATE INDEX IF NOT EXISTS idx_file_evidence_lru
69
- ON file_evidence(last_accessed_at, kind, relative_path, content_hash, version);
70
- `),{evidence:t,readFileEvidence:t.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),writeFileEvidence:t.prepare(`INSERT INTO file_evidence (kind, relative_path, content_hash, version, payload, last_accessed_at)
71
- VALUES (?, ?, ?, ?, ?, ?)
72
- ON CONFLICT(kind, relative_path, content_hash, version)
73
- DO UPDATE SET payload = excluded.payload, last_accessed_at = excluded.last_accessed_at`),touchFileEvidence:t.prepare(`UPDATE file_evidence
74
- SET last_accessed_at = ?
75
- WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?
76
- AND last_accessed_at < ?`)}}catch(t){return Ae("shared cache disabled (open failed)",t),null}}function br(e,t,n){Ae(`shared cache disabled (${t})`,n);try{e.shared?.evidence.close()}catch{}e.shared=null}function PS(e,t={}){if(!wc(e))return null;let n;try{n=new hr(e),n.pragma("busy_timeout = 50"),n.exec(`CREATE INDEX IF NOT EXISTS idx_file_evidence_lru
77
- ON file_evidence(last_accessed_at, kind, relative_path, content_hash, version)`),n.pragma("wal_checkpoint(TRUNCATE)");let r=n.prepare("SELECT COUNT(*) AS count FROM file_evidence").get().count,i=t.maxRows??Oc,o=t.budgetBytes??Mc,s=Number(n.pragma("page_size",{simple:!0})),a=Number(n.pragma("page_count",{simple:!0})),c=Number(n.pragma("freelist_count",{simple:!0})),l=Math.max(0,a-c)*s,u=r>0&&l>o?Math.min(r,Math.ceil((l-o)/Math.max(1,l/r))):0,d=Math.max(r-i,u);return d>0&&(n.prepare(`DELETE FROM file_evidence WHERE rowid IN (
78
- SELECT rowid FROM file_evidence ORDER BY last_accessed_at ASC, rowid ASC LIMIT ?
79
- )`).run(d),n.pragma("wal_checkpoint(TRUNCATE)")),{deletedRows:d,remainingRows:r-d}}catch(r){return Ae("shared cache maintenance skipped",r),null}finally{try{n?.close()}catch{}}}function Zi(e,t,n,r){let i=Ee(e);if(!i)return null;try{let o=i.readFileEvidence.get(t,n,r,G)??i.readLegacyFileEvidence.get(t,n,r);if(o?.payload!==void 0)return o.payload;if(!Sr.has(t)||!i.shared)return null;try{let s=i.shared.readFileEvidence.get(t,n,r,G);return s?.payload!==void 0&&Uc(i.shared,t,n,r),s?.payload??null}catch(s){return br(i,"file_evidence read",s),null}}catch(o){return Ce(e,"file_evidence read",o),null}}function Uc(e,t,n,r){let i=Date.now();try{e.touchFileEvidence.run(i,t,n,r,G,i-$c)}catch(o){Ae("shared file_evidence recency touch skipped",o)}}function Yi(e,t,n,r,i){let o=Ee(e);if(o)try{if(o.writeFileEvidence.run(t,n,r,G,i),Sr.has(t)&&o.shared)try{o.shared.writeFileEvidence.run(t,n,r,G,i,Date.now())}catch(s){br(o,"file_evidence write",s)}}catch(s){Ce(e,"file_evidence write",s)}}function eo(e,t){if(t.length===0)return;let n=Ee(e);if(n)try{n.evidence.transaction(()=>{for(let i of t)n.writeFileEvidence.run(i.kind,i.relativePath,i.contentHash,G,i.payload)})();let r=t.filter(i=>Sr.has(i.kind));if(r.length>0&&n.shared)try{n.shared.evidence.transaction(()=>{for(let i of r)n.shared.writeFileEvidence.run(i.kind,i.relativePath,i.contentHash,G,i.payload,Date.now())})()}catch(i){br(n,"file_evidence batch write",i)}}catch(r){Ce(e,"file_evidence batch write",r)}}function to(e,t,n,r){let i=Ee(e);if(!i)return null;try{return(i.readProjectEvidence.get(t,n,r,G)??i.readLegacyProjectEvidence.get(t,n,r))?.payload??null}catch(o){return Ce(e,"project_evidence read",o),null}}function no(e,t,n,r,i){let o=Ee(e);if(o)try{o.writeProjectEvidence.run(t,n,r,G,i)}catch(s){Ce(e,"project_evidence write",s)}}function wS(e,t,n,r){let i=Ee(e);if(!i)return new Map;try{let o=i.readCalleesForFile.all(t,n,r,G),s=i.readLegacyCalleesForFile.all(t,n,r);return ro([...s,...o])}catch(o){return Ce(e,"semantic_callees bulk read",o),new Map}}function LS(e,t,n){let r=Ee(e);if(!r)return new Map;try{let i=r.readReferencesForFile.all(t,n,G),o=r.readLegacyReferencesForFile.all(t,n);return ro([...o,...i])}catch(i){return Ce(e,"semantic_references bulk read",i),new Map}}function ro(e){let t=new Map;for(let n of e)t.set(n.symbol,n.payload);return t}function kS(e,t){if(t.length===0)return;let n=Ee(e);if(n)try{n.evidence.transaction(()=>{let r=new Set;for(let i of t){let o=`${i.relativePath}\0${i.contentHash}`;r.has(o)||(r.add(o),n.dropStaleCallees.run(i.relativePath,i.contentHash)),n.writeCallees.run(i.relativePath,i.symbol,i.contentHash,i.depsDigest,G,i.payload)}})()}catch(r){Ce(e,"semantic_callees write",r)}}function DS(e,t){if(t.length===0)return;let n=Ee(e);if(n)try{n.evidence.transaction(()=>{let r=new Set;for(let i of t){let o=`${i.relativePath}\0${i.projectFingerprint}`;r.has(o)||(r.add(o),n.dropStaleReferences.run(i.relativePath,i.projectFingerprint)),n.writeReferences.run(i.relativePath,i.symbol,i.projectFingerprint,G,i.payload)}})()}catch(r){Ce(e,"semantic_references write",r)}}import{basename as io}from"path";var Hc=v("indexed-document-paths",{clearGroups:["whole-project"]});function ee(e,t={}){let n=zc(t);return[...Hc.get(e,n,()=>{let i=t.scope?"AND relative_path LIKE ?":"",o=t.like?"AND relative_path LIKE ?":"",s=[...t.scope?[`%${t.scope}%`]:[],...t.like?[t.like]:[]],a=e.all(`SELECT relative_path
80
- FROM documents
81
- WHERE 1 = 1
82
- ${e.pathExclusionsFor("documents")}
83
- ${i}
84
- ${o}
85
- ORDER BY relative_path`,...s).map(l=>l.relative_path),c=t.extensions?a.filter(l=>t.extensions.some(u=>l.toLowerCase().endsWith(u.toLowerCase()))):a;return t.includeIgnored===!1?c.filter(l=>!e.isIgnored(l)):c})]}function zc(e){let t=e.extensions?[...new Set(e.extensions.map(n=>n.toLowerCase()))].sort():null;return JSON.stringify({scope:e.scope??null,like:e.like??null,extensions:t,includeIgnored:e.includeIgnored!==!1})}function so(e,t,n){let r=ao(t);if(!r)return[];let i=e.all(`SELECT relative_path
86
- FROM documents
87
- WHERE relative_path = ?
88
- ${e.pathExclusionsFor("documents")}`,r).filter(c=>!e.isIgnored(c.relative_path)).map(c=>({relativePath:c.relative_path,score:oo(c.relative_path,r)}));if(i.length>0)return i;let o=ee(e,{includeIgnored:!1}).map(c=>({relativePath:c,score:oo(c,r)})).filter(c=>c.score>0).sort((c,l)=>l.score-c.score||c.relativePath.localeCompare(l.relativePath)),s=o.filter(c=>c.score>=1100);if(s.length>0)return n.allowMultiple?s:[s[0]];let a=o.filter(c=>c.score>=800);return a.length>0?n.allowMultiple?a:[a[0]]:n.allowMultiple?o:o.slice(0,1)}function oo(e,t){let n=ao(e),r=io(n),i=io(t),o=0;return n===t&&(o+=1200),n.endsWith(`/${t}`)&&(o+=1100),r===i&&(o+=900),n.startsWith(`${t}/`)&&(o+=850),n.includes(t)&&(o+=250),o}function ao(e){return e.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}var Wc=[U("source-facts",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/source/source-facts.ts"}),U("file-definitions",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/symbols/definition-catalog.ts"}),U("definition-exclusions",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/analysis/framework-patterns.ts"}),U("doc-path-tokens",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-products.test.ts",owner:"tests/storage/evidence-cache.test.ts"}),U("doc-path-evidence",{dependsOn:["content-hash","git-history","git-head","tool-version"],keyParts:["kind","relativePath","contentHash","trackedFiles","historyWindow","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/queries/cleanup/doc-drift.ts"}),U("source-imports",{dependsOn:["content-hash","import-resolution-fingerprint","config","tool-version"],keyParts:["kind","relativePath","contentHash","importResolutionFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/language-parsers/index.ts"}),U("source-reexports",{dependsOn:["content-hash","import-resolution-fingerprint","config","tool-version"],keyParts:["kind","relativePath","contentHash","importResolutionFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/language-parsers/index.ts"}),U("source-fingerprints",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/symbols/definition-catalog.test.ts",owner:"src/queries/cleanup/similar.ts"}),U("consumer-file-usage",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/queries/internal/consumer-evidence.ts"}),U("react-component-behavior-profiles",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/source/react-profile.ts"}),U("git-file-adds",{dependsOn:["git-head","git-history","tool-version"],keyParts:["kind","cacheKey","head","historyWindow","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/analysis/git-history.ts"}),U("typescript-reference-fragments",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-reference-fragments.test.ts",owner:"src/semantic/typescript/reference-fragment-shadow.ts"}),U("typescript-import-usage",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-semantic-provider.test.ts",owner:"src/semantic/shared-primitives.ts"}),U("typescript-signatures",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-semantic-provider.test.ts",owner:"src/semantic/shared-primitives.ts"}),an("file-dependency-graph",{dependsOn:["project-fingerprint","indexed-language-set","import-resolution-fingerprint","tool-version"],keyParts:["kind","scope","projectFingerprint","payloadVersion"],stalenessTest:"tests/symbols/file-dep-graph.test.ts",owner:"src/symbols/graph/file-dep-graph.ts"}),an("semantic-import-usage",{dependsOn:["project-fingerprint","indexed-language-set","import-resolution-fingerprint","tool-version"],keyParts:["kind","relativePath","projectFingerprint","language","semanticEngine","payloadVersion"],stalenessTest:"tests/semantic/rust/rust-semantic-cache-gate.test.ts",owner:"src/semantic/shared-primitives.ts"}),an("semantic-signatures",{dependsOn:["project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","symbol","projectFingerprint","language","semanticEngine","payloadVersion"],stalenessTest:"tests/semantic/rust/rust-semantic-cache-gate.test.ts",owner:"src/semantic/shared-primitives.ts"}),an("health-semantic-prewarm",{dependsOn:["project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","scope","cliVersion","projectFingerprint","payloadVersion"],stalenessTest:"tests/runtime/cli-support.test.ts",owner:"src/runtime/cli-support.ts"})];function le(e){let t=new Map;return{kind:e.kind,read(n,r,i){let o=!1,s=0,a;if(dr()){let c=We(n);if(c){let l=`${c}\0${r}\0${i}`;a=t.get(l),a||(a=pr(["evidence-product-file-read-v1",e.kind,c,r,i]),t.set(l,a))}}return ge("evidence-product.file.read",()=>{let c=Zi(n,e.kind,r,i);if(c===null)return null;s=c.length;try{let l=e.deserialize(c);return o=l!==null,l}catch{return null}},()=>({...a?{workIdentity:a,workOutcome:"computed"}:{},scope:"file",kind:e.kind,available:!0,hit:o,payloadBytes:s}))},write(n,r,i,o){Yi(n,e.kind,r,i,e.serialize(o))},writeBatch(n,r){eo(n,r.map(i=>({kind:e.kind,relativePath:i.relativePath,contentHash:i.contentHash,payload:e.serialize(i.value)})))}}}function co(e){let t=new Map;return{kind:e.kind,read(n,r,i){let o=!1,s=0,a;if(dr()){let c=`${i}\0${r}`;a=t.get(c),a||(a=pr(["evidence-product-project-read-v1",e.kind,i,r]),t.set(c,a))}return ge("evidence-product.project.read",()=>{let c=to(n,e.kind,r,i);if(c===null)return null;s=c.length;try{let l=e.deserialize(c);return o=l!==null,l}catch{return null}},()=>({...a?{workIdentity:a,workOutcome:"computed"}:{},scope:"project",kind:e.kind,available:!0,hit:o,payloadBytes:s}))},write(n,r,i,o){no(n,e.kind,r,i,e.serialize(o))}}}function X(e){let t=Wc.find(n=>n.kind===e);if(!t)throw new Error(`missing evidence product manifest entry for ${e}`);return t.invalidation}function U(e,t){return{scope:"file",kind:e,invalidation:{scope:"file",...t}}}function an(e,t){return{scope:"project",kind:e,invalidation:{scope:"project",...t}}}var qc=v("source-text",{clearGroups:["whole-project","source-file"]}),Kc=v("source-lines",{clearGroups:["whole-project","source-file"]});function x(e,t){let n=t.replace(/\\/g,"/");return qc.get(e,n,()=>{try{return gr(e.config.projectRoot,n,{inputKind:"indexed source file"})}catch(r){if(yr(r))return"";throw r}})}function Ft(e,t){let n=t.replace(/\\/g,"/");return Kc.get(e,n,()=>{let r=x(e,n);return r?r.split(`
89
- `):[]})}var Gc=/^\s*(?:\/\/|#|\/\*+|\*)\s*codebaseiq[\s:-]*ignore(?:[\s:-]+(dead(?:-code)?|stale|wrapper|passthrough|drift|extract|similar|twin))?\b/i;function Xc(e){let t=Gc.exec(e);return t?t[1]??"":null}function qS(e,t,n){return lo(e,t,n).length>0}function KS(e,t,n,r){let i=r.toLowerCase();return lo(e,t,n).some(o=>o.toLowerCase()===i)}function lo(e,t,n){if(n<=0)return[];let r=Ft(e,t);if(r.length===0)return[];let i=[];for(let o=n-1;o>=0&&o>=n-5;o-=1){let s=(r[o]??"").trim();if(s==="")continue;let a=Xc(s);if(a!==null){i.push(a);continue}if(!s.startsWith("//")&&!s.startsWith("*")&&!s.startsWith("/*")&&!s.startsWith("@")&&!s.startsWith("#"))return i}return i}import{readdirSync as Jc}from"fs";import{execFileSync as Qc}from"child_process";import{extname as cn,join as Zc}from"path";var Yc=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".clj",".cljs",".cljc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],eb=[".vue"],uo=[".tsx",".jsx"],po=[".vue"],el=[...uo,...po],tl=new Set(uo),nl=new Set(po),fo=new Set(Yc.map(e=>e.toLowerCase())),rl=[...fo].sort().join(","),mo=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs","out","coverage",".codebaseiq-cache","__pycache__",".venv","venv",".idea",".vscode"]);function H(e,t={}){let n=t.includeIndexed??!0,r=t.includeAuxiliary??!0,i=t.extensions?.map(c=>c.toLowerCase()),o=i?new Set(i):fo,s=i?[...o].sort().join(","):rl,a=`${n?"1":"0"}|${r?"1":"0"}|${s}`;return il.get(e,a,()=>{let c=new Set;if(n)for(let l of ee(e,{includeIgnored:!1}))o.has(cn(l).toLowerCase())&&c.add(l);if(r)for(let l of ol(e.config.projectRoot,o))e.isIgnored(l)||n&&c.has(l)||c.add(l);return[...c].sort()})}function tb(e,t={}){let n=!1,r=!1;for(let i of H(e,{extensions:el})){if(t.scope&&!i.includes(t.scope))continue;let o=cn(i).toLowerCase();if(n||=tl.has(o),r||=nl.has(o),n&&r)break}return{react:n,vue:r}}var il=v("source-files",{clearGroups:[]});function ol(e,t){return sl(e,t)??cl(e,t)}function sl(e,t){try{let n=Qc("git",["ls-files","--cached","--others","--exclude-standard"],{cwd:e,encoding:"utf-8",timeout:1e4,killSignal:"SIGKILL",stdio:["ignore","pipe","ignore"],windowsHide:!0}),r=new Set;for(let i of n.split(`
90
- `)){let o=i.trim();o&&(al(o)||t.has(cn(o).toLowerCase())&&r.add(o))}return r}catch{return null}}function al(e){return e.split("/").some(t=>mo.has(t))}function cl(e,t){let n=new Set,r=i=>{let o=i?Zc(e,i):e,s;try{s=Jc(o,{withFileTypes:!0})}catch{return}for(let a of s)if(!mo.has(a.name)){if(a.isDirectory()){r(i?`${i}/${a.name}`:a.name);continue}t.has(cn(a.name).toLowerCase())&&n.add(i?`${i}/${a.name}`:a.name)}};return r(""),n}var ll={"/":"namespace","#":"type",".":"term","[":"type-param",":":"meta","!":"macro"};function ue(e){if(e.startsWith("local "))return{kind:"local",id:e.slice(6),raw:e};let t=e.split(" ");if(t.length<4)return{scheme:t[0]??"",manager:t[1]??"",packageName:t[2]??"",version:"",descriptors:[],raw:e};let n=t[0],r=t[1],i=e.slice(n.length+1+r.length+1),o;if(i.startsWith("`")){let l=i.indexOf("`",1);l===-1?(o=i.slice(1),i=""):(o=i.slice(1,l),i=i.slice(l+2))}else{let l=i.indexOf(" ");l===-1?(o=i,i=""):(o=i.slice(0,l),i=i.slice(l+1))}let s,a=i.indexOf(" ");a===-1?(s=i,i=""):(s=i.slice(0,a),i=i.slice(a+1));let c=ul(i);return{scheme:n,manager:r,packageName:o,version:s,descriptors:c,raw:e}}function te(e){let t=ue(e);if("kind"in t)return null;for(let n=t.descriptors.length-2;n>=0;n--){let r=t.descriptors[n];if(r?.suffix==="type")return r.name}return null}function ul(e){let t=[],n=0;for(;n<e.length;){if(e[n]==="["){let o=e.indexOf("]",n+1);if(o===-1){t.push({name:e.slice(n+1),suffix:"type-param"});break}t.push({name:e.slice(n+1,o),suffix:"type-param"}),n=o+1;continue}if(e[n]==="("&&(t.length===0||n===0||go(e[n-1]))){let o=e.indexOf(")",n+1);if(o!==-1&&e[o+1]!=="."){t.push({name:e.slice(n+1,o),suffix:"parameter"}),n=o+1;continue}}let r;if(e[n]==="`"){let o=e.indexOf("`",n+1);if(o===-1){r=e.slice(n+1),t.push({name:r,suffix:"term"});break}r=e.slice(n+1,o),n=o+1}else{let o=n;for(;n<e.length&&!go(e[n]);)n++;r=e.slice(o,n)}if(n>=e.length){r&&t.push({name:r,suffix:"term"});break}let i=e[n];if(i==="("){let o=e.indexOf(")",n+1);o!==-1&&e[o+1]==="."?(t.push({name:r,suffix:"method"}),n=o+2):o!==-1?(t.push({name:r,suffix:"method"}),n=o+1):(t.push({name:r,suffix:"term"}),n++)}else{let o=ll[i];o&&t.push({name:r,suffix:o}),n+=1}}return t}function go(e){return e==="/"||e==="#"||e==="."||e==="("||e==="["||e===":"||e==="!"}function Oe(e){let t=ue(e);if("kind"in t&&t.kind==="local")return`local:${t.id}`;let n=t;if(n.descriptors.length===0)return n.raw;let r=[];for(let i of n.descriptors){let o=dl(i);o&&r.push(o)}return r.join(":")}function dl(e){let t=e.suffix==="namespace"?pl(e.name):e.name;return t?e.suffix==="method"?`${t}()`:t:""}function pl(e){return e.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"").replace(/\.(py|pyi)$/,"").replace(/\.(rs)$/,"").replace(/\.(java|scala|kt|kts)$/,"").replace(/\.(rb)$/,"").replace(/\.(go)$/,"").replace(/\.(cs|vb)$/,"").replace(/\.(dart)$/,"").replace(/\.(php)$/,"").replace(/\.(c|cc|cpp|cxx|h|hpp)$/,"")}function z(e){let t=ue(e);if("kind"in t&&t.kind==="local")return t.id;let n=t;return n.descriptors.length===0?"":n.descriptors[n.descriptors.length-1].name}function qe(e){let t=ue(e);if("kind"in t&&t.kind==="local")return null;let n=t;return n.descriptors[n.descriptors.length-1]?.suffix??null}function xr(e){return e.endsWith("().")||qe(e)==="method"}function Tt(e){let t=qe(e);return t==="method"?!0:t!=="term"?!1:e.endsWith("().")?!0:e.startsWith("rust-analyzer ")&&e.includes("#")?!1:e.startsWith("scip-typescript ")?!/#[A-Za-z0-9_$]+\.$/.test(e):!0}function yo(e){return qe(e)==="namespace"}var fl=/^rust-analyzer\b.*[\s/]impl#\[[^\]]+\]\[[^\]]+\]/;function rb(e){return fl.test(e)}var ml=new Set(["test","tests","_tests"]);function ib(e){let t=ue(e);if("kind"in t)return!1;for(let n=0;n<t.descriptors.length-1;n+=1){let r=t.descriptors[n];if(r?.suffix==="namespace"&&r.name&&ml.has(r.name))return!0}return!1}function ob(e,t){let n=ue(e),r=ue(t);if("kind"in n||"kind"in r)return!1;let i=n.descriptors,o=r.descriptors;if(o.length!==i.length+1)return!1;for(let s=0;s<i.length;s++){let a=i[s],c=o[s];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}function sb(e,t){let n=ue(e),r=ue(t);if("kind"in n||"kind"in r)return!1;let i=n.descriptors,o=r.descriptors;if(o.length<=i.length)return!1;for(let s=0;s<i.length;s++){let a=i[s],c=o[s];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}import{extname as ho}from"path";var gl={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb",".clj":"clojure",".cljs":"clojure",".cljc":"clojure"};function W(e){return gl[ho(e).toLowerCase()]??null}function Se(e){return ho(e).toLowerCase()===".vue"}import{createRequire as yl}from"module";var V=yl(import.meta.url),Pt=null,vr=!1;function So(){if(vr)return null;if(Pt)return Pt;try{return Pt=V("tree-sitter"),Pt}catch{return vr=!0,null}}function bb(e){if(e==="clojure")return"reader";let t=So();if(!t)return"unavailable";let n=bo(e);if(!n)return"unavailable";try{return new t().setLanguage(n),"ast"}catch{return dt.add(e),"unavailable"}}var Nr=new Map,dt=new Set;function bo(e){if(dt.has(e))return null;let t=Nr.get(e);if(t)return t;let n;try{switch(e){case"rust":n=V("tree-sitter-rust");break;case"typescript":n=V("tree-sitter-typescript").typescript;break;case"tsx":n=V("tree-sitter-typescript").tsx;break;case"javascript":n=V("tree-sitter-javascript");break;case"python":n=V("tree-sitter-python");break;case"java":n=V("tree-sitter-java");break;case"kotlin":n=V("tree-sitter-kotlin");break;case"scala":n=V("tree-sitter-scala");break;case"ruby":n=V("tree-sitter-ruby");break;case"c":n=V("tree-sitter-c");break;case"cpp":n=V("tree-sitter-cpp");break;case"csharp":n=V("tree-sitter-c-sharp");break;case"php":n=V("tree-sitter-php").php;break;case"vb":{let r=V("tree-sitter-vb-dotnet");n=r.language??r;break}case"clojure":return dt.add(e),null}}catch{return dt.add(e),null}return Nr.set(e,n),n}var Er=new Map;function xb(){Pt=null,vr=!1,Nr.clear(),dt.clear(),Er.clear(),bl.clear()}function hl(e){let t=Er.get(e);if(t)return t;let n=bo(e);if(!n)return null;let r=So();if(!r)return null;let i=new r;try{i.setLanguage(n)}catch{return dt.add(e),null}return Er.set(e,i),i}function Sl(e,t){return e.parse(r=>r>=t.length?null:t.slice(r,Math.min(t.length,r+16384)))}function Ke(e,t){let n=hl(e);if(!n)return null;try{return Sl(n,t)}catch{return null}}var bl=new Map;import{posix as Cr}from"path";import{parse as xl}from"@vue/compiler-sfc";var vl=De("vue-sfc-units");function pt(e,t){let n=No(t),r=x(e,n);return vl.get(e,n,r,()=>_r(e,n,r))}function No(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function Nl(e){let t=e?.toLowerCase();return!t||t==="js"||t==="javascript"||t==="jsx"?"javascript":t==="ts"||t==="typescript"?"typescript":t==="tsx"?"tsx":null}function Ge(e){return!e||e.body.length===0?0:e.body.split(`
91
- `).length}function _r(e,t,n){let r={relativePath:t,template:null,scripts:[],styles:[],customBlocks:[],errors:[]};if(!n)return r;let i;try{i=xl(n,{filename:t})}catch(s){return r.errors.push(vo(s)),r}r.errors.push(...i.errors.map(vo));let{descriptor:o}=i;return o.template&&(r.template=ln(e,t,"template",o.template)),o.script&&r.scripts.push(xo(e,t,o.script,!1)),o.scriptSetup&&r.scripts.push(xo(e,t,o.scriptSetup,!0)),r.styles=o.styles.map(s=>ln(e,t,"style",s)),r.customBlocks=o.customBlocks.map(s=>ln(e,t,"custom",s)),r.errors.push(...[r.template,...r.scripts,...r.styles,...r.customBlocks].flatMap(s=>s?.errors??[])),r}function xo(e,t,n,r){let i=ln(e,t,"script",n);return{...i,kind:"script",setup:r,astLanguage:Nl(i.lang)}}function ln(e,t,n,r){let i=Cl(r.attrs),o=typeof i.lang=="string"?i.lang:null,s=typeof i.src=="string"?i.src:typeof r.src=="string"?r.src:void 0;if(s){let c=El(t,s);if(!c)return{kind:n,ownerPath:t,sourcePath:t,external:!0,src:s,attrs:i,lang:o,body:"",startLine:0,endLine:0,errors:[`Could not resolve Vue ${n} block source: ${s}`]};let l=x(e,c),u=l?Math.max(0,l.split(`
92
- `).length-1):0;return{kind:n,ownerPath:t,sourcePath:c,external:!0,src:s,attrs:i,lang:o,body:l,startLine:0,endLine:u,errors:l?[]:[`Vue ${n} block source not found: ${c}`]}}let a=Math.max(0,r.loc.start.line-1);return{kind:n,ownerPath:t,sourcePath:t,external:!1,attrs:i,lang:o,body:r.content,startLine:a,endLine:Math.max(a,r.loc.end.line-1),errors:[]}}function El(e,t){let n=t.split(/[?#]/,1)[0];if(!n||n.startsWith("/")||n.includes("://"))return null;let r=No(Cr.normalize(Cr.join(Cr.dirname(e),n)));return r===".."||r.startsWith("../")?null:r}function Cl(e){return{...e}}function vo(e){return e instanceof Error?e.message:String(e)}function wt(e,t,n){let i=_r(e,t,n).scripts.filter(s=>s.astLanguage&&s.body.length>0),o=i[0]?.astLanguage;return o?{body:i.map(s=>`${`
93
- `.repeat(s.startLine)}${s.body}`).join(`
94
- `),startLine:0,language:o}:null}var Eo=ze("ast-trees",{clearGroups:["whole-project","source-file"]});function R(e,t){if(Se(t))return _l(e,t);let n=W(t);if(!n)return null;let r=x(e,t);return r?Eo.get(e,t,r,()=>Ke(n,r)):null}function Lt(e,t,n){if(Se(t)){let o=wt(e,t,n);if(!o)return null;let s=Ke(o.language,`
95
- `.repeat(o.startLine)+o.body);return s?{tree:s,language:o.language}:null}let r=W(t);if(!r)return null;let i=Ke(r,n);return i?{tree:i,language:r}:null}function _l(e,t){let n=x(e,t);return n?Eo.get(e,t,n,()=>{let r=wt(e,t,n);if(!r)return null;let i=`
96
- `.repeat(r.startLine)+r.body;return Ke(r.language,i)}):null}function ft(e,t){let n=Rl(e,t);if(!n)return null;let r=_e(n);if(!r)return null;let i=Fl(n);return{calleeLeaf:r,calleeQualifier:i?Il(n):void 0,calleeText:n.text,memberAccess:i,line:e.startPosition.row}}function Il(e){return(e.childForFieldName("object")??e.childForFieldName("value")??e.namedChild(0)??void 0)?.text||void 0}function Rl(e,t){if(t==="rust")return e.type==="call_expression"?e.childForFieldName("function")??e.namedChild(0):e.type==="macro_invocation"?e.childForFieldName("macro")??e.namedChild(0):null;if(t==="python")return e.type!=="call"?null:e.childForFieldName("function")??e.namedChild(0);if(t==="typescript"||t==="tsx"||t==="javascript"){if(e.type==="call_expression")return e.childForFieldName("function")??e.namedChild(0);if(e.type==="new_expression")return e.childForFieldName("constructor")??e.namedChild(0)}return null}function Fl(e){switch(e.type){case"field_expression":case"member_expression":case"attribute":return!0;default:return!1}}function _e(e){switch(e.type){case"identifier":case"type_identifier":case"field_identifier":case"property_identifier":case"private_property_identifier":case"shorthand_property_identifier":return e.text.replace(/^#/u,"");case"field_expression":case"member_expression":case"attribute":{let t=e.namedChild(e.namedChildCount-1);return t?_e(t):null}case"generic_function":{let t=e.childForFieldName("function")??e.namedChild(0);return t?_e(t):null}case"scoped_identifier":{let t=e.childForFieldName("name")??e.namedChild(e.namedChildCount-1);return t?_e(t):null}case"super":case"self":case"this":return null;default:return null}}function kt(e){return e.type==="comment"||e.type==="line_comment"||e.type==="block_comment"}var Tl=new Set(["function_declaration","generator_function_declaration","method_definition","method_signature","function_signature"]),Co=new Set(["arrow_function","function_expression","generator_function"]);function un(e,t){let n=wl(e,t);if(n)return{name:n.name,startLine:n.definitionNode.startPosition.row,endLine:n.definitionNode.endPosition.row,paramCount:Fo(n.functionNode),params:_o(n.functionNode),paramsEndLine:Io(n.functionNode),isLiteralPassthrough:To(n.functionNode,t)};if(!Pl(e.type,t))return null;let r=e.childForFieldName("name")??e.namedChildren.find(i=>i.type==="identifier"||i.type==="property_identifier");return r?{name:r.text,startLine:e.startPosition.row,endLine:e.endPosition.row,paramCount:Fo(e),params:_o(e),paramsEndLine:Io(e),isLiteralPassthrough:To(e,t)}:null}function Po(e){return e.namedChildren.find(t=>t.type==="parameters"||t.type==="formal_parameters")}function _o(e){let t=Po(e);if(!t)return[];let n=[];for(let r of t.namedChildren){if(kt(r))continue;if(r.type==="identifier"){n.push({name:r.text,simple:!0});continue}let i=r.namedChildren.some(a=>a.type.endsWith("_modifier"))||/^\s*(?:public|private|protected|readonly|override)\b/.test(r.text),o=r.childForFieldName("pattern");if(!i&&o&&o.type==="identifier"){n.push({name:o.text,simple:!0});continue}let s=r.namedChildren.find(a=>a.type==="identifier");n.push({name:o?.type==="identifier"?o.text:s?.text??"",simple:!1})}return n}function Io(e){let t=Po(e);return t?t.endPosition.row:e.startPosition.row}function Pl(e,t){return t==="rust"?e==="function_item"||e==="function_signature_item":t==="python"?e==="function_definition":t==="typescript"||t==="tsx"||t==="javascript"?Tl.has(e):!1}function wl(e,t){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript")return null;if(e.type==="variable_declarator"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(!n||!r)return null;let i=Ro(r);return i?{name:n.text,definitionNode:e,functionNode:i}:null}if(e.type==="public_field_definition"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(!n||!r)return null;let i=Ro(r);return i?{name:n.text,definitionNode:e,functionNode:i}:null}return null}function Ro(e){if(Co.has(e.type))return e;if(e.type!=="call_expression"||(e.childForFieldName("function")??e.namedChild(0))?.type!=="call_expression")return null;let r=((e.childForFieldName("arguments")??e.namedChildren.find(i=>i.type==="arguments"))?.namedChildren??[]).filter(i=>Co.has(i.type));return r.length===1?r[0]:null}function Fo(e){let t=e.namedChildren.find(r=>r.type==="parameters"||r.type==="formal_parameters");if(!t)return 0;let n=0;for(let r of t.namedChildren)kt(r)||(n+=1);return n}function To(e,t){let n=e.namedChildren.find(d=>d.type==="block"||d.type==="statement_block");if(!n)return!1;let r=n.namedChildren.filter(d=>!kt(d));if(r.length!==1)return!1;let i=r[0],o=null;if(i.type==="return_statement"||i.type==="expression_statement"?o=i.namedChild(0)??null:t==="rust"&&(i.type==="call_expression"||i.type==="macro_invocation")&&(o=i),!o)return!1;let s=t==="python"?"call":"call_expression";if(o.type!==s)return!1;let a=o.namedChildren.find(d=>d.type==="arguments"||d.type==="argument_list");if(!a)return!1;let c=a.namedChildren.filter(d=>!kt(d)),l=e.namedChildren.find(d=>d.type==="parameters"||d.type==="formal_parameters");if(!l)return!1;let u=[];for(let d of l.namedChildren){if(d.type==="identifier"){u.push(d.text);continue}let p=d.namedChildren.find(f=>f.type==="identifier");p&&u.push(p.text)}if(c.length!==u.length)return!1;for(let d=0;d<u.length;d+=1){let p=c[d];if(p.type!=="identifier"||p.text!==u[d])return!1}return!0}var Ll=new Set(["identifier","type_identifier","field_identifier"]),kl=new Set(["identifier"]),Dl=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),Al=new Set(["rust","python"]),Ol=/\{([^{}]*)\}/g,Ml=/\b([A-Za-z_][\w]*)\b/g;function wo(e,t){return $l(t).has(e.type)}function Lo(e,t){return Al.has(t)&&e.type==="string_content"}function Ir(e){let t=0;for(let r of e.values()){let i=r[r.length-1];i!==void 0&&i>t&&(t=i)}let n=new Array(t+1);for(let r=0;r<=t;r+=1)n[r]=new Set;for(let[r,i]of e)for(let o of i)n[o].add(r);return n}function $l(e){return e==="rust"?Ll:e==="python"?kl:Dl}function ko(e,t){let n=e.startPosition.row;for(let r of e.text.matchAll(Ol)){let i=r[1]??"";for(let o of i.matchAll(Ml))o[1]&&t(o[1],n)}}var Bl=[/\bdefault\s*=\s*"([^"]+)"/g,/\bwith\s*=\s*"([^"]+)"/g,/\bserialize_with\s*=\s*"([^"]+)"/g,/\bdeserialize_with\s*=\s*"([^"]+)"/g,/\bskip_serializing_if\s*=\s*"([^"]+)"/g,/\bgetter\s*=\s*"([^"]+)"/g,/\brename_all_with\s*=\s*"([^"]+)"/g,/\bschema_with\s*=\s*"([^"]+)"/g],jl=/^#!?\[\s*serde\s*\(/,Vl=/^#!?\[\s*schemars\s*\(/,Ul=/^#!?\[\s*validate\s*\(/,Hl=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function Do(e,t,n){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript"||e.type!=="call_expression")return;let r=e.childForFieldName("function")??e.namedChild(0);if(!r)return;let i=_e(r);if(!i||!Hl.has(i))return;let o=e.namedChildren.find(c=>c.type==="arguments");if(!o)return;let s=o.namedChild(0);if(!s||s.type!=="string")return;let a=s.namedChildren.find(c=>c.type==="string_fragment");a&&n.add(a.text)}function Ao(e,t){let n=jl.test(e),r=Vl.test(e),i=Ul.test(e);if(!(!n&&!r&&!i))for(let o of Bl){o.lastIndex=0;let s;for(;(s=o.exec(e))!==null;){let a=s[1],c=a.split("::").pop()??a;c==="is_none"&&/\bOption\b/.test(a)||c==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(a)||c&&t.add(c)}}}function Oo(e,t){let n=new Map,r=(s,a)=>{if(s===a)return;let c=n.get(s);c||(c=new Set,n.set(s,c)),c.add(a)},i=t==="python"?new Set(["identifier"]):new Set(["type_identifier"]),o=(s,a)=>{let c=l=>{i.has(l.type)&&l.text!==a&&r(l.text,a);for(let u of l.children)c(u)};for(let l of s.children)c(l)};if(t==="rust")for(let s of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let a=s.namedChildren.find(l=>l.type==="type_identifier")?.text;if(!a)continue;let c=s.namedChildren.find(l=>l.type==="field_declaration_list"||l.type==="enum_variant_list"||l.type==="ordered_field_declaration_list");c&&o(c,a),s.type==="type_item"&&o(s,a)}else if(t==="python")for(let s of e.rootNode.descendantsOfType("class_definition")){let a=s.namedChildren.find(u=>u.type==="identifier")?.text;if(!a)continue;let c=s.childForFieldName("superclasses");c&&o(c,a);let l=s.namedChildren.find(u=>u.type==="block");if(l)for(let u of l.descendantsOfType("type"))for(let d of u.descendantsOfType("identifier"))d.text!==a&&r(d.text,a)}else for(let s of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let a=s.namedChildren.find(c=>c.type==="type_identifier")?.text;a&&o(s,a)}return n}var zl=new Map([["defn","function"],["defn-","function"],["defmacro","macro"],["defmacro-","macro"],["defmethod","method"]]),Rr=new Set(["catch","comment","def","defprotocol","defrecord","deftype","defmethod","defmacro","defmacro-","defn","defn-","do","doseq","dotimes","fn","for","if","let","loop","ns","quote","recur","throw","try","extend-protocol","extend-type","when","when-let","when-not"]);function Mo(e){let t=[],n=[],r=[],i=new Map,o=[],s=0,a=0,c=(l,u)=>{let d=i.get(l);if(!d){i.set(l,[u]);return}d[d.length-1]!==u&&d.push(u)};for(;a<e.length;){let l=e[a];if(l===`
97
- `){s+=1,a+=1;continue}if(/\s|,/.test(l)){a+=1;continue}if(l===";"){a=pn(e,a);continue}if(l==='"'){let m=At(e,a,s);s=m.line,a=m.index;continue}if(l==="("||l==="["||l==="{"){o.push({kind:l,startLine:s,endLine:s,headTokens:[],tokens:[],children:[]}),a+=1;continue}if(l===")"||l==="]"||l==="}"){let m=o.pop();m&&(m.endLine=s,Wl(m,{callables:t,callSites:n,clojureMembers:r,recordIdentifier:c}),o[o.length-1]?.children.push(m)),a+=1;continue}if(Fr(l)){a+=1;continue}let u=s,d=a;for(;a<e.length&&!Tr(e[a]);)a+=1;let p=e.slice(d,a);if(!p)continue;let f={text:p,line:u};ql(o[o.length-1],f),c(ne(p),u)}return{language:"clojure",callables:t,callSites:n,clojureMembers:r,typeContainerMap:new Map,identifierLineMap:i,identifiersByLine:Ql(i),fileIdentifiers:new Set(i.keys()),rustAttrReferencedNames:new Set,crossLanguageDispatchNames:new Set}}function Wl(e,t){if(e.kind!=="("||e.headTokens.length===0)return;let n=e.headTokens[0],r=ne(n.text),i=zl.get(n.text);if(i){let s=e.headTokens[1];if(s){let a=ne(s.text);t.recordIdentifier(a,s.line),t.callables.push({name:a,startLine:e.startLine,endLine:e.endLine,paramCount:0,params:[],paramsEndLine:s.line,isLiteralPassthrough:!1,clojureKind:i})}}if(Kl(e,t),!r||Rr.has(n.text)||Rr.has(r)||r.startsWith(":"))return;let o=Jl(n.text);t.callSites.push({calleeLeaf:o.leaf,calleeQualifier:o.qualifier,calleeText:o.text,memberAccess:!1,line:n.line})}function ql(e,t){e&&(e.headTokens.length<2&&e.headTokens.push(t),e.tokens.length<200&&e.tokens.push(t))}function Kl(e,t){let n=ne(e.tokens[0]?.text??"");if(n==="defprotocol"){let r=ne(e.tokens[1]?.text??"");if(!r)return;for(let i of dn(e))Dt(t,r,"protocol",i,"protocol-method");return}if(n==="defrecord"||n==="deftype"){let r=ne(e.tokens[1]?.text??"");if(!r)return;let i=n==="defrecord"?"record":"type",o=n==="defrecord"?"record-method":"type-method";for(let s of dn(e))Dt(t,r,i,s,o);return}if(n==="extend-type"){let r=ne(e.tokens[1]?.text??"");if(!r)return;for(let i of dn(e))Dt(t,r,"extension",i,"extension-method");return}if(n==="extend-protocol"){let r=ne(e.tokens[1]?.text??"");for(let i of dn(e)){r&&Dt(t,r,"extension",i,"extension-method");let o=Xl(e,i.startLine);o&&o!==r&&Dt(t,o,"extension",i,"extension-method")}}}function dn(e){return e.children.filter(Gl)}function Gl(e){if(e.kind!=="(")return!1;let t=ne(e.tokens[0]?.text??"");return!!(t&&!Rr.has(t)&&!t.startsWith(":"))}function Dt(e,t,n,r,i){let o=r.tokens[0],s=ne(o?.text??"");!o||!s||(e.recordIdentifier(s,o.line),e.clojureMembers.push({ownerName:t,ownerKind:n,memberName:s,memberKind:i,startLine:r.startLine,endLine:r.endLine}))}function Xl(e,t){let n=null;for(let r=2;r<e.tokens.length;r+=1){let i=e.tokens[r];if(i.line>t)break;let o=ne(i.text);o&&!o.startsWith(":")&&(n=o)}return n}function ne(e){return e.replace(/^#?['`~@]+/,"").split("/").pop()?.replace(/^\./,"")??""}function Jl(e){let t=e.replace(/^#?['`~@]+/,""),n=t.lastIndexOf("/"),r=ne(t);if(n<=0)return{leaf:r,text:t};let i=t.slice(0,n);return{leaf:r,qualifier:i,text:t}}function pn(e,t){let n=t;for(;n<e.length&&e[n]!==`
98
- `;)n+=1;return n}function At(e,t,n){let r=t+1,i=n;for(;r<e.length;){let o=e[r];if(o==="\\"){r+=2;continue}if(o===`
99
- `&&(i+=1),r+=1,o==='"')break}return{index:r,line:i}}function Fr(e){return e==="'"||e==="`"||e==="~"||e==="@"||e==="^"||e==="#"}function Tr(e){return/\s|,/.test(e)||e==="("||e===")"||e==="["||e==="]"||e==="{"||e==="}"||e==='"'||e===";"}function Ql(e){let t=[];for(let[n,r]of e)for(let i of r)t[i]??=new Set,t[i].add(n);return t}var $o=6,Zl=ze("source-facts",{clearGroups:["whole-project","source-file"]}),Pr=le({kind:"source-facts",invalidation:X("source-facts"),serialize:tu,deserialize:nu});function A(e,t){return wr(e,t).facts}function wr(e,t){let n=x(e,t);if(!n)return{facts:null};let r=Yl(e,t,n);return r?Zl.get(e,t,n,()=>eu(e,t,r,n)):{facts:null}}function Yl(e,t,n){return Se(t)?wt(e,t,n)?.language??null:W(t)}function eu(e,t,n,r){let i=he(e,t,r),o=Pr.read(e,t,i);if(o&&o.language===n)return{facts:o};if(n==="clojure"){let c=Mo(r);return Pr.write(e,t,i,c),{facts:c}}let s=R(e,t);if(!s)return{facts:null,unavailable:{language:n,reason:"parser-unavailable"}};let a=su(s,n);return Pr.write(e,t,i,a),{facts:a}}function tu(e){let t={version:$o,language:e.language,callables:e.callables,callSites:e.callSites,clojureMembers:e.clojureMembers,typeContainerMap:[...e.typeContainerMap.entries()].map(([n,r])=>[n,[...r]]),identifierLineMap:[...e.identifierLineMap.entries()],rustAttrReferencedNames:[...e.rustAttrReferencedNames],crossLanguageDispatchNames:[...e.crossLanguageDispatchNames]};return JSON.stringify(t)}function nu(e){try{let t=JSON.parse(e);if(t.version!==$o||t.language==="clojure"&&(t.clojureMembers===void 0||t.callSites.some(r=>r.calleeText===void 0)))return null;let n=new Map(t.identifierLineMap);return{language:t.language,callables:t.callables,callSites:t.callSites,clojureMembers:t.clojureMembers??[],typeContainerMap:new Map(t.typeContainerMap.map(([r,i])=>[r,new Set(i)])),identifierLineMap:n,identifiersByLine:Ir(n),fileIdentifiers:new Set(n.keys()),rustAttrReferencedNames:new Set(t.rustAttrReferencedNames),crossLanguageDispatchNames:new Set(t.crossLanguageDispatchNames)}}catch{return null}}function ru(e,t,n,r){let i=A(e,t);return i?ou(i,n,r)?.isLiteralPassthrough??!0:!0}function iu(e,t){return t.relativePath.includes(".clj-kondo/hooks/")?!0:A(e,t.relativePath)?.callables.find(r=>r.startLine===t.startLine&&r.endLine===t.endLine)?.clojureKind==="macro"}function ou(e,t,n){return e.callables.find(r=>r.startLine===t&&r.endLine===n)??null}function su(e,t){let n=[],r=[],i=new Set,o=new Set,s=new Map,a=(l,u)=>{let d=s.get(l);if(!d){s.set(l,[u]);return}d[d.length-1]!==u&&d.push(u)},c=l=>{let u=un(l,t);u&&n.push(u);let d=ft(l,t);d&&r.push(d),Do(l,t,o),t==="rust"&&(l.type==="attribute_item"||l.type==="inner_attribute_item")&&Ao(l.text,i),wo(l,t)&&a(l.text,l.startPosition.row),Lo(l,t)&&ko(l,a);for(let p of l.children)c(p)};return c(e.rootNode),{language:t,callables:n,callSites:r,clojureMembers:[],typeContainerMap:Oo(e,t),identifierLineMap:s,identifiersByLine:Ir(s),fileIdentifiers:new Set(s.keys()),rustAttrReferencedNames:i,crossLanguageDispatchNames:o}}var Bo=new Set(["rust","typescript","tsx","javascript","python","clojure"]);function Lr(e,t){let n=A(e,t);return!n||!Bo.has(n.language)?null:n.callables.map(r=>({name:r.name,startLine:r.startLine,endLine:r.endLine}))}function au(e,t){let n=A(e,t);return!n||!Bo.has(n.language)?null:n.callSites}function cu(e,t){return A(e,t)?.typeContainerMap??new Map}import{ElementTypes as uu,NodeTypes as kr,parse as du}from"@vue/compiler-dom";import{parse as ux}from"@vue/compiler-sfc";var lu=new Set(["children","className","data","e","err","error","ev","event","false","id","idx","index","item","key","null","props","res","result","state","style","true","undefined","val","value"]);function fn(e){return e.length<=2||lu.has(e)}function mn(e,t){return e.split(t).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")}var pu=De("vue-template-facts"),fu=new Set(["component","keep-alive","slot","suspense","teleport","template","transition","transition-group"]),mu=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),gu=new Set(["div","span","template"]),yu=new Set(["as","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","from","function","if","import","in","instanceof","let","new","null","of","return","super","switch","this","throw","true","try","typeof","undefined","var","void","while","with","yield"]);function gn(e,t){let n=t.replace(/\\/g,"/"),r=x(e,n);return pu.get(e,n,r,()=>hu(n,pt(e,n).template))}function hu(e,t){let n={relativePath:e,template:t?{startLine:t.startLine,endLine:t.endLine}:null,componentTags:[],nativeTags:[],builtinTags:[],props:[],events:[],directives:[],slots:[],expressionIdentifiers:[],structuralTokens:[]};if(!t)return n;let r;try{r=du(t.body,{comments:!1})}catch{return n}let i=new Set,o=s=>{s.trim()&&i.add(s)};return Vo(r.children,t.startLine,n,o),n.structuralTokens=[...i].sort(),n}function Vo(e,t,n,r){for(let i of e)if(i.type===kr.ELEMENT)Su(i,t,n,r),Vo(i.children,t,n,r);else if(i.type===kr.INTERPOLATION){r("interpolation");let o=Dr(i.content);o&&Uo(o,t,i.loc.start.line,n,r)}}function Su(e,t,n,r){let i=_u(e.tag),o={tag:e.tag,normalized:i,kind:Cu(e),startLine:mt(t,e.loc.start.line),endLine:mt(t,e.loc.end.line)};o.kind==="component"?(n.componentTags.push(o),r(`component:${i}`)):o.kind==="builtin"?(n.builtinTags.push(o),r(`builtin:${i}`)):(n.nativeTags.push(o),gu.has(e.tag)||r(`native:${e.tag}`));for(let s of e.props)bu(s,t,n,r)}function bu(e,t,n,r){if(e.type===kr.ATTRIBUTE){let a=e.value?.content??null,c=jo("prop",e.name,a,t,e.loc.start.line,e.loc.end.line);n.props.push(c),r(`prop:${e.name}`);return}let i=vu(e),o=Dr(e.exp),s=jo(xu(e.name),i,o,t,e.loc.start.line,e.loc.end.line);switch(s.kind){case"prop":n.props.push(s),r(`prop:${i}`);break;case"event":n.events.push(s),r(`event:${i}`);break;case"slot":n.slots.push(s),r(`slot:${i}`);break;case"directive":n.directives.push(s),r(`directive:${i}`);break}o&&Uo(o,t,e.loc.start.line,n,r)}function jo(e,t,n,r,i,o){return{kind:e,name:t,value:n,startLine:mt(r,i),endLine:mt(r,o)}}function xu(e){switch(e){case"bind":case"model":return"prop";case"on":return"event";case"slot":return"slot";default:return"directive"}}function vu(e){let t=Dr(e.arg);return t||e.name}function Dr(e){if(!e)return null;let t=("content"in e&&typeof e.content=="string"?e.content:e.loc.source).trim();return t||null}function Uo(e,t,n,r,i){for(let o of Nu(e)){let s={name:o,startLine:mt(t,n),endLine:mt(t,n)};r.expressionIdentifiers.push(s),i(`id:${o}`)}}function Nu(e){let t=new Set,n=Eu(e),r=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,i;for(;i=r.exec(n);){let o=i[0];yu.has(o)||fn(o)||/^[A-Z_]+$/.test(o)||t.add(o)}return[...t].sort()}function Eu(e){return e.replace(/\/\*[\s\S]*?\*\//g," ").replace(/\/\/.*$/gm," ").replace(/`(?:\\[\s\S]|\$\{([^}]*)\}|[^`\\])*`/g,(t,n)=>n??" ").replace(/'(?:\\[\s\S]|[^'\\])*'/g," ").replace(/"(?:\\[\s\S]|[^"\\])*"/g," ")}function Cu(e){let t=e.tag;return e.tagType===uu.COMPONENT?"component":fu.has(t)?"builtin":mu.has(t)?"native":/^[A-Z]/.test(t)||t.includes("-")?"component":"native"}function _u(e){return mn(e,/[-_:]/)}function mt(e,t){return e+Math.max(0,t-1)}import{createRequire as Ou}from"module";import{existsSync as Qe}from"fs";import{basename as zo,dirname as J,extname as Ie,join as re,relative as Xe,resolve as O,sep as Mu}from"path";import{existsSync as Or,readdirSync as Iu,statSync as Ru}from"fs";import{join as gt,relative as Fu}from"path";function Ho(e){let t=Tu(e)??ku(e);if(!t||t.length===0)return[];let n=[],r=new Set;for(let i of t)for(let o of Du(e,i)){if(r.has(o))continue;r.add(o);let s=Au(e,o);s&&n.push(s)}return n}function Tu(e){let t=gt(e,"pnpm-workspace.yaml");if(!Or(t))return null;try{return Pu(st(t,"pnpm workspace manifest"))}catch{return null}}function Pu(e){let t=[],n=!1;for(let r of e.split(/\r?\n/)){let i=wu(r);if(!n){/^packages\s*:\s*$/.test(i.trim())&&(n=!0);continue}let o=/^\s+-\s*(.+)$/.exec(i);if(o){let s=Lu(o[1].trim());s&&t.push(s);continue}if(i.trim()!=="")break}return t}function wu(e){let t=e.indexOf("#");return t===-1?e:e.slice(0,t)}function Lu(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e}function ku(e){let t=gt(e,"package.json");if(!Or(t))return null;try{let n=JSON.parse(st(t,"workspace package manifest"));return n.workspaces?Array.isArray(n.workspaces)?n.workspaces:n.workspaces.packages??[]:null}catch{return null}}function Du(e,t){if(!t||t.startsWith("!")||t.includes("node_modules"))return[];if(!t.includes("*")){let s=gt(e,t);return Ar(s)?[s]:[]}let n=t.indexOf("*"),r=t.slice(0,n).replace(/\/$/,""),i=t.slice(n+1).replace(/^\//,""),o=gt(e,r||".");return Ar(o)?Iu(o).map(s=>gt(o,s,i)).filter(Ar):[]}function Ar(e){try{return Ru(e).isDirectory()}catch{return!1}}function Au(e,t){let n=gt(t,"package.json");if(!Or(n))return null;try{let r=JSON.parse(st(n,"workspace package manifest"));return typeof r.name!="string"||r.name.length===0?null:{name:r.name,relativeDir:Fu(e,t).replace(/\\/g,"/"),exports:r.exports}}catch{return null}}var $u=ye("indexed-paths",{clearGroups:[]}),Bu=ye("indexed-path-digest",{clearGroups:[]}),ju=v("tsconfig-alias-config",{clearGroups:["whole-project"]}),Vu=v("tsconfig-alias-config-for-dir",{clearGroups:["whole-project"]}),Uu=Ou(import.meta.url),Ot;function Hu(){if(Ot!==void 0)return Ot;try{Ot=Uu("typescript")}catch{Ot=null}return Ot}var zu=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"],Wu=ye("workspace-packages",{clearGroups:["whole-project"]}),Je=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],yn=[".py",".pyi"],Q=[".java",".scala",".kt",".kts"],hn=[".rs"],Sn=[".rb"],bn=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],Me=[".cs",".vb"],xn=[".dart"],Ze=[".php"],yt=[".clj",".cljs",".cljc"],qu=new Set(Je),Mr=new Set(yn),Wo=new Set(Q),$r=new Set(hn),Br=new Set(Sn),qo=new Set(bn),Ko=new Set(Me),jr=new Set(xn),Go=new Set(Ze),Xo=new Set(yt),Ku=[{extensions:Je,lookup:qu},{extensions:yn,lookup:Mr},{extensions:Q,lookup:Wo},{extensions:hn,lookup:$r},{extensions:Sn,lookup:Br},{extensions:bn,lookup:qo},{extensions:Me,lookup:Ko},{extensions:xn,lookup:jr},{extensions:Ze,lookup:Go},{extensions:yt,lookup:Xo}];function Re(e,t){return t.has(Ie(e).toLowerCase())}function Gu(e){return Re(e,Mr)}function Xu(e){return Re(e,Wo)}function Ju(e){return Re(e,$r)}function Qu(e){return Re(e,Br)}function Zu(e){return Re(e,qo)}function Yu(e){return Re(e,Ko)}function Jo(e){return Ie(e).toLowerCase()===".vb"}function ed(e){return Re(e,jr)}function td(e){return Re(e,Go)}function nd(e){return Re(e,Xo)}function Vr(e){let t=Ie(e).toLowerCase();for(let n of Ku)if(n.lookup.has(t))return n.extensions;return Je}function rd(e){return Xu(e)||Yu(e)||td(e)}function be(e,t,n){return Gu(t)?ht(e,t,n):Ju(t)?Fe(e,t,n):Qu(t)?vn(e,t,n):Zu(t)?Nn(e,t,n):rd(t)?w(e,n.replace(/\\/g,"."),Vr(t)):ed(t)?En(e,t,n):nd(t)?Ur(e,n):id(e,t,n)}function id(e,t,n){if(!n.startsWith(".")&&!n.startsWith("/"))return od(e,t,n)??ad(e,n);let r=J(re(e.config.projectRoot,t)),i=O(r,n),o=Te(e);for(let s of zr(i)){let a=D(Xe(e.config.projectRoot,s));if(o.has(a)||Qe(s))return a}return D(Xe(e.config.projectRoot,i))}function od(e,t,n){let r=fd(e,t);if(!r)return null;let i=Te(e);for(let o of sd(r,n)){let s=O(r.baseUrl,o);for(let a of zr(s)){let c=D(Xe(e.config.projectRoot,a));if(i.has(c)||Qe(a))return c}}return null}function sd(e,t){let n=[];for(let[r,i]of Object.entries(e.paths)){let o=r.indexOf("*");if(o===-1){if(t!==r)continue;n.push(...i);continue}let s=r.slice(0,o),a=r.slice(o+1);if(!t.startsWith(s)||!t.endsWith(a)||t.length<s.length+a.length)continue;let c=t.slice(s.length,t.length-a.length);for(let l of i)n.push(l.includes("*")?l.replace("*",c):l)}return n}function ad(e,t){let n=ld(cd(e),t);if(!n)return null;let r=Te(e);for(let i of ud(n)){let o=O(e.config.projectRoot,n.pkg.relativeDir,i);for(let s of zr(o)){let a=D(Xe(e.config.projectRoot,s));if(r.has(a)||Qe(s))return a}}return null}function cd(e){return Wu.get(e,()=>Ho(e.config.projectRoot))}function ld(e,t){let n=null;for(let r of e){let i=null;t===r.name?i="":t.startsWith(`${r.name}/`)&&(i=t.slice(r.name.length+1)),i!==null&&(!n||r.name.length>n.pkg.name.length)&&(n={pkg:r,subpath:i})}return n}function ud(e){let t=[],n=dd(e.pkg.exports,e.subpath);if(n){let r=pd(n);r&&t.push(r)}return t.push(e.subpath?`src/${e.subpath}`:"src/index"),t}function dd(e,t){if(!e||typeof e!="object")return null;let n=t===""?".":`./${t}`;return Qo(e[n])}function Qo(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;let t=e;for(let n of["types","import","default","require","node"]){let r=Qo(t[n]);if(r)return r}return null}function pd(e){let t=e.replace(/^\.\//,"");return t.startsWith("dist/")?`src/${t.slice(5)}`:null}function fd(e,t){let n=D(J(t));return Vu.get(e,n,()=>md(e,n))}function md(e,t){let n=Hu();if(!n)return null;let r=O(e.config.projectRoot),i=O(r,t);for(;i===r||i.startsWith(r+Mu);){for(let s of zu){let a=re(i,s);if(!Qe(a))continue;let c=ju.get(e,a,()=>gd(n,a));if(c)return c}let o=J(i);if(o===i)break;i=o}return null}function gd(e,t){try{let n=e.readConfigFile(t,e.sys.readFile);if(n.error||!n.config)return null;let r=e.parseJsonConfigFileContent(n.config,e.sys,J(t)),i=r.options.paths;return!i||Object.keys(i).length===0?null:{baseUrl:r.options.baseUrl?O(J(t),r.options.baseUrl):J(t),paths:i}}catch{return null}}function ht(e,t,n){let r=Te(e),i;if(n.startsWith(".")){let o=n.match(/^(\.+)(.*)$/);if(!o)return null;let s=o[1].length,a=o[2].replace(/^\./,""),c=J(re(e.config.projectRoot,t));for(let l=1;l<s;l++)c=J(c);i=a?O(c,a.replace(/\./g,"/")):c}else i=O(e.config.projectRoot,n.replace(/\./g,"/"));for(let o of yd(i)){let s=D(Xe(e.config.projectRoot,o));if(r.has(s)||Qe(o))return s}return null}function Fe(e,t,n){if(!n)return null;let r=n.replace(/\s+as\s+.+$/,"").trim();if(!r.startsWith("crate::")&&!r.startsWith("self::")&&!r.startsWith("super::"))return null;let i=J(re(e.config.projectRoot,t)),o;return r.startsWith("crate::")?o=O(e.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?o=O(i,r.slice(6).replace(/::/g,"/")):o=O(J(i),r.slice(7).replace(/::/g,"/")),Hr(e,hd(o))}function vn(e,t,n){let r=J(re(e.config.projectRoot,t)),i=O(r,n);return Hr(e,Sd(i))}function Nn(e,t,n){let r=J(re(e.config.projectRoot,t)),i=[O(r,n),O(e.config.projectRoot,n),O(e.config.projectRoot,"include",n),O(e.config.projectRoot,"src",n)];return Hr(e,i)}function w(e,t,n){let r=Te(e),i=t.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),o=i.replace(/\./g,"/"),s=i.split(".").pop()??i;for(let c of n){let l=`${o}${c}`,u=[...r].find(d=>d.endsWith(l));if(u)return u}for(let c of n){let l=[...r].find(u=>zo(u)===`${s}${c}`);if(l)return l}let a=[...r].filter(c=>n.includes(Ie(c).toLowerCase())).filter(c=>c.includes(`/${o}/`)||c.includes(`/${s}/`)).sort((c,l)=>c.localeCompare(l));return a.length===1?a[0]:null}function En(e,t,n){let r=Te(e);if(n.startsWith("package:")){let s=n.slice(8),a=s.indexOf("/");if(a<0)return null;let c=s.slice(a+1),l=D(c.startsWith("lib/")?c:`lib/${c}`);return r.has(l)?l:null}let i=J(re(e.config.projectRoot,t)),o=O(i,n);for(let s of bd(o)){let a=D(Xe(e.config.projectRoot,s));if(r.has(a)||Qe(s))return a}return null}function Ur(e,t){let n=t.replace(/-/g,"_").replace(/\./g,"/"),r=Te(e);for(let i of yt){let o=`${n}${i}`,s=[...r].find(a=>a.endsWith(o));if(s)return s}for(let i of yt){let o=[...r].find(s=>zo(s)===`${n.split("/").pop()}${i}`);if(o)return o}return null}function yd(e){let t=Ie(e);return Mr.has(t)?[e]:[`${e}.py`,`${e}.pyi`,re(e,"__init__.py"),re(e,"__init__.pyi")]}function Hr(e,t){let n=Te(e);for(let r of t){let i=D(Xe(e.config.projectRoot,r));if(n.has(i)||Qe(r))return i}return null}function hd(e){let t=Ie(e);return $r.has(t)?[e]:[`${e}.rs`,re(e,"mod.rs")]}function Sd(e){let t=Ie(e);return Br.has(t)?[e]:[`${e}.rb`,re(e,"index.rb")]}function bd(e){let t=Ie(e);return jr.has(t)?[e]:[`${e}.dart`,e]}function zr(e){let t=Ie(e),n=new Set;if(t){n.add(e);for(let r of Je)n.add(e.slice(0,-t.length)+r)}else for(let r of Je)n.add(`${e}${r}`),n.add(re(e,`index${r}`));return[...n]}function Te(e){return $u.get(e,()=>new Set(ee(e,{includeIgnored:!1}).map(D)))}function Wr(e){return Bu.get(e,()=>Ne([...Te(e)].sort().join(`
100
- `)))}var xd=new Set(["ref","shallowRef","reactive","computed","watch","watchEffect"]),vd=new Set(["onBeforeMount","onMounted","onBeforeUpdate","onUpdated","onBeforeUnmount","onUnmounted","onActivated","onDeactivated","onErrorCaptured"]),Nd=new Set(["axios","fetch","runRequest","useAsyncData","useFetch","useResource"]),Ed=new Set(["defineEmits","defineExpose","defineModel","defineOptions","defineProps","withDefaults"]),Cd=new Set(["catch","for","function","if","return","switch","while"]);function _n(e){let t={imports:[],functions:[],calls:[],composables:[],stores:[],reactivity:[],lifecycle:[],requests:[],macros:[],lineCount:0,externalLineCount:0,externalScriptPaths:[],unresolvedScripts:[]};for(let n of e.scripts){t.lineCount+=Ge(n),n.external&&(t.externalLineCount+=Ge(n),t.externalScriptPaths.push(n.sourcePath));for(let i of n.errors)t.unresolvedScripts.push({sourcePath:n.sourcePath,reason:i});if(!n.body||!n.astLanguage){n.astLanguage||t.unresolvedScripts.push({sourcePath:n.sourcePath,reason:`Unsupported Vue script language: ${n.lang??"unknown"}`});continue}t.imports.push(...Fd(n));let r=Ke(n.astLanguage,n.body);r?Id(n,r.rootNode,t):Rd(n,t)}return _d(t),t.externalScriptPaths=Yo(t.externalScriptPaths),t}function _d(e){e.composables=St(e,"composable"),e.stores=St(e,"store"),e.reactivity=St(e,"reactivity"),e.lifecycle=St(e,"lifecycle"),e.requests=St(e,"request"),e.macros=St(e,"macro")}function St(e,t){return Yo(e.calls.filter(n=>n.categories.includes(t)).map(n=>n.name))}function Id(e,t,n){let r=new Set,i=new Set,o=s=>{let a=un(s,e.astLanguage);if(a){let l=`${a.name}:${a.startLine}:${a.endLine}`;i.has(l)||(i.add(l),n.functions.push({name:a.name,sourcePath:e.sourcePath,startLine:e.startLine+a.startLine,endLine:e.startLine+a.endLine,setup:e.setup}))}let c=ft(s,e.astLanguage);if(c){let l=`${c.calleeLeaf}:${c.line}`;r.has(l)||(r.add(l),n.calls.push({name:c.calleeLeaf,sourcePath:e.sourcePath,line:e.startLine+c.line,categories:Zo(c.calleeLeaf),setup:e.setup}))}for(let l of s.children)o(l)};o(t)}function Rd(e,t){for(let n of e.body.matchAll(/\b([A-Za-z_$][\w$]*)\s*\(/g)){let r=n[1];!r||Cd.has(r)||t.calls.push({name:r,sourcePath:e.sourcePath,line:e.startLine+Cn(e.body,n.index??0),categories:Zo(r),setup:e.setup})}for(let n of e.body.matchAll(/\bfunction\s+([A-Za-z_$][\w$]*)\b/g)){let r=n[1];if(!r)continue;let i=e.startLine+Cn(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:i,endLine:i,setup:e.setup})}for(let n of e.body.matchAll(/\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*(?:async\s*)?(?:function\b|\([^)]*\)\s*=>|[A-Za-z_$][\w$]*\s*=>)/g)){let r=n[1];if(!r)continue;let i=e.startLine+Cn(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:i,endLine:i,setup:e.setup})}}function Fd(e){let t=[];for(let n of e.body.matchAll(/\bimport\s+(?:type\s+)?([^'";]+?)\s+from\s+['"]([^'"]+)['"]/g)){let r=n[1]?.trim(),i=n[2];if(!r||!i)continue;let o=e.startLine+Cn(e.body,n.index??0);for(let s of Td(r))t.push({local:s,source:i,sourcePath:e.sourcePath,line:o,setup:e.setup})}return t}function Td(e){let t=[],r=e.split(",").map(s=>s.trim()).filter(Boolean)[0];r&&!r.startsWith("{")&&!r.startsWith("*")&&t.push(r);let i=/\{([^}]*)\}/.exec(e)?.[1];if(i)for(let s of i.split(",")){let a=s.trim();if(!a)continue;let c=/\bas\s+([A-Za-z_$][\w$]*)$/.exec(a)?.[1];t.push(c??a.replace(/^type\s+/,"").trim())}let o=/\*\s+as\s+([A-Za-z_$][\w$]*)/.exec(e)?.[1];return o&&t.push(o),t.filter(s=>/^[A-Za-z_$][\w$]*$/.test(s))}function Zo(e){let t=["call"];return/^use[A-Z0-9_]/.test(e)&&t.push("composable"),/^use[A-Z0-9_].*Store$/.test(e)&&t.push("store"),xd.has(e)&&t.push("reactivity"),vd.has(e)&&t.push("lifecycle"),Nd.has(e)&&t.push("request"),Ed.has(e)&&t.push("macro"),t}function Cn(e,t){let n=0;for(let r=0;r<t&&r<e.length;r+=1)e.charCodeAt(r)===10&&(n+=1);return n}function Yo(e){return[...new Set(e)].sort()}var Pd=new Set(["in","key","of"]),wd=new Set(["computed","defineEmits","defineProps","reactive","ref","watch","watchEffect"]),Ld=De("vue-component-behavior-profiles");function es(e,t={}){let n=H(e,{extensions:[".vue"]}).filter(i=>!t.scope||i.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).map(i=>qr(e,i)).filter(i=>(t.minTemplateTokens===void 0||i.templateTokens.size>=t.minTemplateTokens)&&(t.minBehaviorTokens===void 0||i.behaviorTokens.size>=t.minBehaviorTokens))}function qr(e,t){let n=t.replace(/\\/g,"/"),r=x(e,n),i=Ld.get(e,n,r,()=>kd(e,n,r));return Ad(i)}function kd(e,t,n){let r=pt(e,t),i=gn(e,t),o=_n(r),s=$d(i),a=i.expressionIdentifiers.map(y=>y.name).filter(y=>!s.includes(y)).filter((y,S,b)=>b.indexOf(y)===S).sort(),c=i.componentTags.map(y=>y.normalized).filter((y,S,b)=>b.indexOf(y)===S).sort(),l=n?n.split(`
101
- `).length:0,u=Ge(r.template),d=o.lineCount,p=r.styles.reduce((y,S)=>y+Ge(S),0),f=r.customBlocks.reduce((y,S)=>y+Ge(S),0),{lines:m,paths:g}=Dd(e,t,o);return{file:t,sfc:r,templateFacts:i,scriptFacts:o,templateTokens:new Set(i.structuralTokens),behaviorTokens:Md(i,o,a),templateBindingNames:a,templateLocalNames:s,componentNames:c,sfcLines:l,totalLines:l+o.externalLineCount,templateLines:u,scriptLines:d,styleLines:p,externalScriptLines:o.externalLineCount,externalScriptPaths:o.externalScriptPaths,customBlockLines:f,delegatedComposableLines:m,delegatedComposablePaths:g}}function Dd(e,t,n){let r=new Set;for(let s of n.composables){let a=n.imports.find(l=>l.local===s);if(!a)continue;let c=be(e,a.sourcePath,a.source);!c||c===t||r.add(c)}let i=[...r].sort();return{lines:i.reduce((s,a)=>{let c=x(e,a);return s+(c?c.split(`
102
- `).length:0)},0),paths:i}}function Ad(e){let t=Od(e.scriptFacts);return{...e,scriptFacts:t,templateTokens:new Set(e.templateTokens),behaviorTokens:new Set(e.behaviorTokens),templateBindingNames:[...e.templateBindingNames],templateLocalNames:[...e.templateLocalNames],componentNames:[...e.componentNames],externalScriptPaths:t.externalScriptPaths,delegatedComposablePaths:[...e.delegatedComposablePaths]}}function Od(e){return{...e,imports:e.imports.map(t=>({...t})),functions:e.functions.map(t=>({...t})),calls:e.calls.map(t=>({...t,categories:[...t.categories]})),composables:[...e.composables],stores:[...e.stores],reactivity:[...e.reactivity],lifecycle:[...e.lifecycle],requests:[...e.requests],macros:[...e.macros],externalScriptPaths:[...e.externalScriptPaths],unresolvedScripts:e.unresolvedScripts.map(t=>({...t}))}}function Md(e,t,n){let r=new Set;for(let i of t.composables)r.add(`composable:${i}`);for(let i of t.stores)r.add(`store:${i}`);for(let i of t.reactivity)r.add(`reactivity:${i}`);for(let i of t.lifecycle)r.add(`lifecycle:${i}`);for(let i of t.requests)r.add(`request:${i}`);for(let i of t.macros)r.add(`macro:${i}`);for(let i of t.functions){if(wd.has(i.name))continue;r.add(`function:${i.name}`);let o=/^[a-z]+/.exec(i.name)?.[0]??null;o&&o.length>2&&o!==i.name&&r.add(`function-verb:${o}`)}for(let i of e.events)r.add(`template-event:${i.name}`);for(let i of n)r.add(`template-binding:${i}`);return r}function $d(e){let t=new Set;for(let n of e.directives)if(n.name==="for"&&n.value)for(let r of Bd(n.value))t.add(r);for(let n of e.slots)if(n.value)for(let r of ts(n.value))t.add(r);return[...t].sort()}function Bd(e){let t=/^(.*?)\s+(?:in|of)\s+/.exec(e.trim());return t?ts(t[1]??""):[]}function ts(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];Pd.has(r)||t.push(r)}return t}import{extname as jd}from"path";var Vd=[".tsx",".jsx"],ns=new Set(["useActionState","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useOptimistic","useReducer","useRef","useState","useSyncExternalStore","useTransition"]),Ud=new Set(["useEffect","useInsertionEffect","useLayoutEffect"]),Hd=new Set(["useActionState","useOptimistic","useReducer","useRef","useState"]),zd=new Set(["useLocation","useNavigate","useParams","useSearchParams","useTranslation"]),Wd=new Set(["axios","fetch","gql","graphql","mutate","query","request","useMutation","useQuery","useSuspenseQuery"]),qd=new Set(["add","apply","cancel","change","clear","close","create","delete","fetch","filter","handle","load","open","refresh","remove","render","reset","save","select","submit","toggle","update"]),Kd=new Set(["aria-hidden","className","clipRule","d","fill","fillRule","height","role","stroke","strokeLinecap","strokeLinejoin","strokeWidth","style","viewBox","width","xmlns"]),Gd=De("react-component-behavior-profiles"),rs=le({kind:"react-component-behavior-profiles",invalidation:X("react-component-behavior-profiles"),serialize:Zd,deserialize:Yd});function as(e,t={}){let n=H(e,{extensions:Vd}).filter(i=>!t.scope||i.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).flatMap(i=>Gr(e,i)).filter(i=>(t.minJsxTokens===void 0||i.jsxTokens.size>=t.minJsxTokens)&&(t.minBehaviorTokens===void 0||i.behaviorTokens.size>=t.minBehaviorTokens))}function Gr(e,t){let n=t.replace(/\\/g,"/"),r=x(e,n);return Gd.get(e,n,r,()=>Xd(e,n,r)).map(Qd)}function Xd(e,t,n){let r=he(e,t,n),i=rs.read(e,t,r);if(i)return i;let o=Jd(e,t);return rs.write(e,t,r,o),o}function Jd(e,t){let n=tp(t);if(!n)return[];let r=R(e,t);if(!r)return[];let i=Ft(e,t).length;return np(r.rootNode,n).filter(s=>s.kind==="hook"||Xr(s.bodyNode)).map(s=>{let a=lp(s.bodyNode),c=mp(s.bodyNode,n);return{file:t,name:s.name,kind:s.kind,startLine:s.node.startPosition.row,endLine:s.node.endPosition.row,loc:Math.max(1,s.node.endPosition.row-s.node.startPosition.row+1),fileLines:i,jsxTokens:a.tokens,behaviorTokens:c.tokens,componentNames:Pe(a.componentNames),nativeTags:Pe(a.nativeTags),propNames:Pe(a.propNames),eventNames:Pe(a.eventNames),hookNames:Pe(c.hookNames),requestNames:Pe(c.requestNames),stateNames:Pe(c.stateNames),effectNames:Pe(c.effectNames),handlerNames:Pe(c.handlerNames)}})}function Qd(e){return{...e,jsxTokens:new Set(e.jsxTokens),behaviorTokens:new Set(e.behaviorTokens),componentNames:[...e.componentNames],nativeTags:[...e.nativeTags],propNames:[...e.propNames],eventNames:[...e.eventNames],hookNames:[...e.hookNames],requestNames:[...e.requestNames],stateNames:[...e.stateNames],effectNames:[...e.effectNames],handlerNames:[...e.handlerNames]}}function Zd(e){return JSON.stringify(e.map(t=>({...t,jsxTokens:[...t.jsxTokens],behaviorTokens:[...t.behaviorTokens]})))}function Yd(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=[];for(let r of t){let i=ep(r);if(!i)return null;n.push(i)}return n}catch{return null}}function ep(e){if(!ke(e))return null;let{file:t,name:n,kind:r,startLine:i,endLine:o,loc:s,fileLines:a,jsxTokens:c,behaviorTokens:l,componentNames:u,nativeTags:d,propNames:p,eventNames:f,hookNames:m,requestNames:g,stateNames:y,effectNames:S,handlerNames:b}=e;if(typeof t!="string"||typeof n!="string"||r!=="component"&&r!=="hook"||!In(i)||!In(o)||!In(s)||!In(a))return null;let N={jsxTokens:Y(c),behaviorTokens:Y(l),componentNames:Y(u),nativeTags:Y(d),propNames:Y(p),eventNames:Y(f),hookNames:Y(m),requestNames:Y(g),stateNames:Y(y),effectNames:Y(S),handlerNames:Y(b)};return Object.values(N).some(E=>E===null)?null:{file:t,name:n,kind:r,startLine:i,endLine:o,loc:s,fileLines:a,jsxTokens:new Set(N.jsxTokens),behaviorTokens:new Set(N.behaviorTokens),componentNames:N.componentNames,nativeTags:N.nativeTags,propNames:N.propNames,eventNames:N.eventNames,hookNames:N.hookNames,requestNames:N.requestNames,stateNames:N.stateNames,effectNames:N.effectNames,handlerNames:N.handlerNames}}function In(e){return typeof e=="number"&&Number.isFinite(e)}function tp(e){let t=jd(e).toLowerCase();return t!==".tsx"&&t!==".jsx"?null:W(e)}function np(e,t){let n=[],r=new Set,i=o=>{let s=rp(o);if(s&&(!ap(o)||s.kind==="component")){let a=`${s.name}:${s.node.startIndex}:${s.node.endIndex}`;r.has(a)||(r.add(a),n.push(s))}for(let a of o.namedChildren)i(a)};return(t==="tsx"||t==="javascript")&&i(e),n}function rp(e){if(e.type==="class_declaration"){let o=Kr(e);if(!o||!/^[A-Z]/.test(o))return null;let s=ip(e);return!s||!op(e)&&!Xr(s)?null:{name:o,kind:"component",node:e,bodyNode:s}}if(e.type==="function_declaration"){let o=Kr(e);return!o||!is(o)?null:{name:o,kind:os(o),node:e,bodyNode:e}}if(e.type!=="variable_declarator")return null;let t=e.childForFieldName("name")??e.namedChild(0),n=e.childForFieldName("value")??e.namedChild(1),r=Mt(t);if(!r||!n||!is(r))return null;let i=sp(n);return i?{name:r,kind:os(r),node:e,bodyNode:i}:null}function ip(e){for(let t of e.namedChildren)if(t.type==="class_body")for(let n of t.namedChildren){if(n.type!=="method_definition")continue;if((n.childForFieldName("name")??n.namedChild(0))?.text==="render")return n}return null}function op(e){return/\b(?:React\.)?(?:Pure)?Component\b/.test(e.text)}function is(e){return/^[A-Z]/.test(e)||/^use[A-Z0-9_]/.test(e)}function os(e){return/^use[A-Z0-9_]/.test(e)?"hook":"component"}function sp(e){if(e.type==="arrow_function"||e.type==="function_expression")return e;if(e.type!=="call_expression")return null;let t=cp(e);return t!=="memo"&&t!=="forwardRef"?null:e.namedChildren.find(i=>i.type==="arguments")?.namedChildren.find(i=>i.type==="arrow_function"||i.type==="function_expression")??null}function ap(e){let t=e.parent;for(;t;){if(t.type==="function_declaration"||t.type==="function_expression"||t.type==="arrow_function"||t.type==="method_definition")return!0;t=t.parent}return!1}function Kr(e){return Mt(e.childForFieldName("name")??e.namedChild(0))}function cp(e){let t=e.childForFieldName("function")??e.namedChild(0);return t?t.text.split(".").pop()??t.text:null}function Xr(e){return e.type.startsWith("jsx_")?!0:e.namedChildren.some(Xr)}function lp(e){let t={tokens:new Set,componentNames:new Set,nativeTags:new Set,propNames:new Set,eventNames:new Set},n=r=>{r.type==="jsx_opening_element"||r.type==="jsx_self_closing_element"?up(r,t):r.type==="jsx_element"&&r.text.trimStart().startsWith("<>")?t.tokens.add("jsx:fragment"):r.type==="jsx_expression"?dp(r,t):r.type==="jsx_fragment"&&t.tokens.add("jsx:fragment");for(let i of r.children)n(i)};return n(e),t}function up(e,t){let n=pp(e),r=!1;if(n){let i=ss(n),o=i==="Fragment"||i==="React.Fragment";r=bp(i)&&!o,o?t.tokens.add("jsx:fragment"):r?(t.componentNames.add(i),t.tokens.add(`component:${i}`)):(t.nativeTags.add(i),t.tokens.add(`native:${i}`))}for(let i of e.namedChildren)if(i.type==="jsx_attribute"){let o=fp(i);if(!o)continue;let s=ss(o);if(s.startsWith("on")&&s.length>2){let a=s.slice(2).replace(/^[A-Z]/,c=>c.toLowerCase());t.eventNames.add(a),t.tokens.add(`event:${a}`)}else Kd.has(s)||(t.propNames.add(s),t.tokens.add(`${r?"prop":"native-prop"}:${s}`))}else i.type==="jsx_spread_attribute"&&t.tokens.add(cs(i))}function dp(e,t){let n=e.text;/^\{\s*\.\.\./.test(n)&&t.tokens.add(cs(e)),ls(e)&&t.tokens.add("jsx:conditional"),(n.includes(".map(")||n.includes(".flatMap("))&&t.tokens.add("jsx:list");for(let r of xp(n))fn(r)||t.tokens.add(`binding:${r}`)}function cs(e){let t=/^\{\s*\.\.\.\s*([^}]+)\s*\}$/.exec(e.text)?.[1],n=e.namedChildren.find(o=>o.type!=="comment"),r=t??n?.text??"",i=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/.exec(r.trim())?.[0];return i?`prop:spread:${i}`:"prop:spread"}function ls(e){return e.type==="ternary_expression"||e.type==="conditional_expression"?!0:e.namedChildren.some(ls)}function pp(e){for(let t of e.namedChildren)if(t.type==="identifier"||t.type==="jsx_identifier"||t.type==="property_identifier"||t.type==="member_expression"||t.type==="jsx_member_expression")return t.text;return/^<\s*([A-Za-z][\w$.]*)/.exec(e.text)?.[1]??null}function fp(e){for(let t of e.namedChildren)if(t.type==="property_identifier"||t.type==="identifier"||t.type==="jsx_identifier")return t.text;return/^([A-Za-z_$][\w$:-]*)/.exec(e.text)?.[1]??null}function mp(e,t){let n={tokens:new Set,hookNames:new Set,requestNames:new Set,stateNames:new Set,effectNames:new Set,handlerNames:new Set},r=i=>{if(i.type==="call_expression"){let o=ft(i,t);o&&gp(o.calleeLeaf,n)}else if(i.type==="variable_declarator")hp(i,n);else if(i.type==="function_declaration"){let o=Kr(i);o&&us(o,n)}for(let o of i.namedChildren)r(o)};return r(e),n}function gp(e,t){/^use[A-Z0-9_]/.test(e)&&(t.hookNames.add(e),!ns.has(e)&&!zd.has(e)&&t.tokens.add(`hook:${e}`)),ns.has(e)&&t.tokens.add(`react-hook:${e}`),Ud.has(e)&&(t.effectNames.add(e),t.tokens.add(`effect:${e}`)),Hd.has(e)&&t.tokens.add(`state-hook:${e}`),yp(e)&&(t.requestNames.add(e),t.tokens.add(`request:${e}`))}function yp(e){if(Wd.has(e))return!0;let t=/^use([A-Z0-9_].*)$/.exec(e)?.[1];return t?/(Query|Mutation|Fetch|Resource)$/.test(t):!1}function hp(e,t){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(n?.type==="array_pattern"&&r?.text.includes("useState")){let o=n.namedChildren.find(a=>Mt(a)),s=Mt(o);s&&(t.stateNames.add(s),t.tokens.add(`state:${s}`))}let i=Mt(n);i&&us(i,t)}function us(e,t){let n=Sp(e);!n||!qd.has(n)||(t.handlerNames.add(e),t.tokens.add(`handler:${e}`),t.tokens.add(`handler-verb:${n}`))}function Sp(e){let t=e.startsWith("handle")&&e.length>6?e.slice(6).replace(/^[A-Z]/,n=>n.toLowerCase()):e;return/^[a-z]+/.exec(t)?.[0]??null}function bp(e){return/^[A-Z]/.test(e)||e.includes(".")}function ss(e){return e.replace(/^this\./,"").replace(/\$/g,".")}function Mt(e){return e&&(e.type==="identifier"||e.type==="property_identifier"||e.type==="shorthand_property_identifier"||/^[A-Za-z_$][\w$]*$/.test(e.text))?e.text:null}function xp(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];t.includes(r)||t.push(r)}return t}function Pe(e){return[...e].sort()}function sv(e){return{capability:(t,n)=>vp(t,n),reactProfiles:(t={})=>as(e,t),reactProfilesForFile:t=>Gr(e,t),vueProfiles:(t={})=>es(e,t),vueProfileForFile:t=>qr(e,t),vueTemplateFacts:t=>gn(e,t),vueScriptFacts:t=>_n(pt(e,t))}}function vp(e,t){let n=e.startsWith("react-")?"react":"vue";if(t===void 0)return{slot:e,available:!0,framework:n};let r=t.replace(/\\/g,"/").toLowerCase();return n==="react"&&!r.endsWith(".tsx")&&!r.endsWith(".jsx")?{slot:e,available:!1,framework:n,reason:"React behavior profiles are only available for .tsx and .jsx files"}:n==="vue"&&!r.endsWith(".vue")?{slot:e,available:!1,framework:n,reason:"Vue behavior facts are only available for .vue files"}:{slot:e,available:!0,framework:n}}function Np(e,t,n={}){let r=A(e,t);if(!r)return[];let i=[];if(n.includeCrossLanguageDispatchNames)for(let o of r.crossLanguageDispatchNames)i.push({name:o,kind:"cross-language-dispatch",occurrences:1});if(n.includeRustAttributeNames&&r.language==="rust")for(let o of r.rustAttrReferencedNames)i.push({name:o,kind:"rust-attribute",occurrences:1});return i}import{basename as ps}from"path";function ie(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Qr(e){return e.replace(/'''[\s\S]*?'''/g,$e).replace(/"""[\s\S]*?"""/g,$e).replace(/#.*$/gm,$e).replace(/\/\/.*$/gm,$e).replace(/\/\*[\s\S]*?\*\//g,$e).replace(/`(?:\\[\s\S]|[^`])*`/g,$e).replace(/'(?:\\.|[^'\\\r\n])*'/g,$e).replace(/"(?:\\.|[^"\\\r\n])*"/g,$e)}function Nv(e){return ds(e,{maskStrings:!1})}function Ev(e){return ds(e,{maskStrings:!0})}function ds(e,t){let n="",r=0,i=e.length;for(;r<i;){if(e[r]==="/"&&e[r+1]==="/"){let s=e.indexOf(`
103
- `,r),a=s===-1?i:s;n+=Jr(e,r,a),r=a;continue}if(e[r]==="/"&&e[r+1]==="*"){let s=e.indexOf("*/",r+2),a=s===-1?i:s+2;n+=Jr(e,r,a),r=a;continue}let o=e[r];if(o==="`"||o==="'"||o==='"'){let s=o,a=r+1;for(;a<i;){if(e[a]==="\\"){a+=2;continue}if(e[a]===s){a+=1;break}if(s!=="`"&&e[a]===`
104
- `)break;a+=1}n+=t.maskStrings?Jr(e,r,a):e.slice(r,a),r=a;continue}n+=o,r+=1}return n}function Jr(e,t,n){let r="";for(let i=t;i<n;i+=1)r+=e[i]===`
105
- `?`
106
- `:" ";return r}function $e(e){return e.replace(/[^\r\n]/g," ")}var Cv=ze("stripped-lines",{clearGroups:["whole-project","source-file"]});ct({name:"stripped-source-singleton",groups:["whole-project","source-file"],clearAll:()=>{Rn=null,$t=""},clearFile:()=>{Rn=null,$t=""}});var Rn=null,$t="";function Ep(e){return Rn===e||(Rn=e,$t=Qr(e)),$t}function Be(e,t,n){let r=Ep(e);return`${r.slice(0,t)}${" ".repeat(n-t)}${r.slice(n)}`}function q(e,t){return new RegExp(`\\b${ie(t)}\\b`,"m").test(e)}function bt(e,t){let n=new Set,r=new RegExp(`\\b${ie(t)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let i of e.matchAll(r)){let o=i[1];o&&n.add(o)}return[...n]}function Zr(e){let t=0;for(let n of e)n==="("&&(t+=1),n===")"&&(t-=1);return t}var Cp=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]);function K(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let o=e[i];(o==="{"||o==="["||o==="(")&&n++,(o==="}"||o==="]"||o===")")&&n--,o===","&&n===0&&(t.push(e.slice(r,i)),r=i+1)}return t.push(e.slice(r)),t}function Z(e,t){for(let n of e.namedChildren)if(n.type===t)return n;return null}function L(e,t){let n=new Set,r=(i,o)=>{let s=o||t.has(i.type);!s&&Cp.has(i.type)&&n.add(i.text);for(let a of i.children)r(a,s)};return r(e.rootNode,!1),n}function de(e,t,n,r,i,o,s){return{importedName:i,localName:o,sourcePath:s??w(e,r,Vr(t)),kind:"named",used:q(n,o),usedMembers:[]}}function T(e,t,n,r,i="named",o={}){return{importedName:e,localName:t,sourcePath:n,kind:i,used:r.has(t),usedMembers:[],isTypeOnly:o.isTypeOnly}}function we(e,t,n,r,i="named",o=[],s={}){return{importedName:e,localName:t,sourcePath:n,kind:i,used:r,usedMembers:o,isTypeOnly:s.isTypeOnly}}function Ye(e,t){return{importedName:e,localName:null,sourcePath:t,kind:"side-effect",used:!0,usedMembers:[]}}function et(e,t,n={}){return{importedName:e,localName:n.localName??null,sourcePath:t,kind:"namespace",used:n.used??!0,usedMembers:n.usedMembers??[],isTypeOnly:n.isTypeOnly}}function oe(e,t,n){let r=[];for(let i of e.matchAll(t)){let o=i[0];if(!o||typeof i.index!="number")continue;let s=Be(e,i.index,i.index+o.length);for(let a of n(i,s))r.push(a)}return r}function se(e,t,n,r,i){let o=Lt(e,t,i)?.tree??null;if(o){let s=n(o);if(s)return s}return r()}function Fn(e,t,n,r,i){let o=Lt(e,t,i)?.tree??null,s=W(t),a=s?n[s]:void 0;return o&&a?a(o):r()}function fs(e,t,n){return se(e,t,r=>Ip(e,t,r),()=>_p(e,t,n),n)}function _p(e,t,n){return oe(n,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(r,i)=>{let o=r[1]?.trim();if(!o)return[];let s=ps(o).replace(/\.[^.]+$/,"");return[we(o,s,Nn(e,t,o),q(i,s))]})}function Ip(e,t,n){let r=L(n,new Set(["preproc_include"])),i=[];for(let o of n.rootNode.descendantsOfType("preproc_include")){let s=null;for(let c of o.namedChildren){if(c.type==="system_lib_string"){s=c.text.replace(/^<|>$/g,"");break}if(c.type==="string_literal"){s=c.namedChildren.find(u=>u.type==="string_content")?.text??c.text.replace(/^"|"$/g,"");break}}if(!s)continue;let a=ps(s).replace(/\.[^.]+$/,"");i.push(T(s,a,Nn(e,t,s),r))}return i}var Rp=new Set([":require",":require-macros",":use"]),ti=String.raw`A-Za-z0-9_$*+!?.<>=-`;function gs(e,t,n){let r=$p(n);if(!r)return[];let i=Mp(n,r.start,r.end),o=[];for(let s of r.children.slice(2)){if(s.type!=="list"||s.children.length===0)continue;let a=ae(s.children[0]);if(a){if(Rp.has(a)){for(let c of Pp(s.children.slice(1)))o.push(...Tp(e,c,i));continue}if(a===":import")for(let c of Lp(s.children.slice(1)))o.push(c)}}return o}function Fp(e){return e.type==="list"&&ae(e.children[0])==="ns"}function Tp(e,t,n){let r=Ur(e,t.namespace),i=t.alias??t.namespace,o=Dp(n,i),s=[{importedName:t.namespace,localName:i,sourcePath:r,kind:"namespace",used:t.refers.length>0||t.referAll||o.length>0||Ap(n,t.namespace),usedMembers:o}];t.referAll&&s.push({importedName:"*",localName:null,sourcePath:r,kind:"side-effect",used:!0,usedMembers:[]});for(let a of t.refers)s.push({importedName:a,localName:a,sourcePath:r,kind:"named",used:Op(n,a),usedMembers:[]});return s}function Pp(e){return e.flatMap(t=>Tn(t,null))}function Tn(e,t){if(e.type==="atom")return e.text.startsWith(":")?[]:[{namespace:ei(t,e.text),alias:null,refers:[],referAll:!1}];if(e.type==="vector")return e.children.length>0&&ae(e.children[0])===null?e.children.flatMap(n=>Tn(n,t)):wp(e,t);if(e.type==="list"&&e.children.length>0){let n=ae(e.children[0]);return n?!n||n.startsWith(":")?[]:e.children.slice(1).flatMap(r=>Tn(r,ei(t,n))):e.children.flatMap(r=>Tn(r,t))}return[]}function wp(e,t){let n=ae(e.children[0]);if(!n||n.startsWith(":"))return[];let r={namespace:ei(t,n),alias:null,refers:[],referAll:!1};for(let i=1;i<e.children.length;i+=1){let o=ae(e.children[i]);if(!o?.startsWith(":"))continue;let s=e.children[i+1];if((o===":as"||o===":as-alias")&&s){r.alias=ae(s),i+=1;continue}o===":refer"&&s&&(ae(s)===":all"?r.referAll=!0:(s.type==="vector"||s.type==="list")&&r.refers.push(...s.children.map(ae).filter(kp)),i+=1)}return[r]}function Lp(e){let t=[];for(let n of e){if(n.type==="atom"){let i=n.text.split(".").pop()??n.text;t.push(we(i,i,null,!0));continue}if(n.type!=="vector")continue;let r=ae(n.children[0]);if(r)for(let i of n.children.slice(1)){let o=ae(i);o&&t.push(we(`${r}.${o}`,o,null,!0))}}return t}function ei(e,t){return e?`${e}.${t}`:t}function ae(e){return e?.type==="atom"?e.text:null}function kp(e){return!!(e&&!e.startsWith(":"))}function Dp(e,t){let n=new Set,r=new RegExp(`${ni()}${ie(t)}\\s*/\\s*([${ti}]+)`,"g");for(let i of e.matchAll(r)){let o=i[1];o&&n.add(o)}return[...n]}function Ap(e,t){return new RegExp(`${ni()}${ie(t)}\\s*/`,"m").test(e)}function Op(e,t){return new RegExp(`${ni()}${ie(t)}(?![${ti}])`,"m").test(e)}function ni(){return`(?<![${ti}])`}function Mp(e,t,n){let r="",i=0;for(;i<e.length;){if(i>=t&&i<n){r+=e[i]===`
107
- `?`
108
- `:" ",i+=1;continue}let o=e[i];if(o===";"){let s=pn(e,i);r+=ms(e.slice(i,s)),i=s;continue}if(o==='"'){let s=At(e,i,0).index;r+=ms(e.slice(i,s)),i=s;continue}r+=o,i+=1}return r}function $p(e){let t=0;for(;t<e.length&&(t=ri(e,t),!(t>=e.length));){let n=Pn(e,t);if(!n){t+=1;continue}if(Fp(n.form))return n.form;t=n.index}return null}function Pn(e,t){let n=ri(e,t);if(e.startsWith("#?@",n)||e.startsWith("#?",n))return Bp(e,n);if(e.startsWith("#_",n)){let i=Pn(e,n+2);return i?{form:{type:"atom",text:"",start:n,end:i.index},index:i.index}:null}for(;Fr(e[n]);)n+=1;let r=e[n];return r?r==="("?Yr(e,n,"list",")"):r==="["?Yr(e,n,"vector","]"):r==="{"?Yr(e,n,"map","}"):r==='"'?{form:{type:"atom",text:"",start:n,end:At(e,n,0).index},index:At(e,n,0).index}:Vp(e,n):null}function Bp(e,t){let n=e.startsWith("#?@",t)?3:2,r=Pn(e,t+n);return r?{form:{type:"list",children:r.form.type==="list"||r.form.type==="vector"||r.form.type==="map"?jp(r.form.children):[],start:t,end:r.index},index:r.index}:null}function jp(e){let t=[];for(let n=0;n<e.length;n+=2){let r=ae(e[n]),i=e[n+1];r?.startsWith(":")&&i&&t.push(i)}return t}function Yr(e,t,n,r){let i=[],o=t+1;for(;o<e.length;){if(o=ri(e,o),e[o]===r)return{form:{type:n,children:i,start:t,end:o+1},index:o+1};let s=Pn(e,o);if(!s){o+=1;continue}s.form.type==="atom"&&s.form.text===""||i.push(s.form),o=s.index}return{form:{type:n,children:i,start:t,end:e.length},index:e.length}}function Vp(e,t){let n=t;for(;n<e.length&&!Tr(e[n]);)n+=1;return{form:{type:"atom",text:e.slice(t,n),start:t,end:n},index:n}}function ri(e,t){let n=t;for(;n<e.length;){let r=e[n];if(/\s|,/.test(r)){n+=1;continue}if(r===";"){n=pn(e,n);continue}break}return n}function ms(e){return e.replace(/[^\r\n]/g," ")}function ys(e,t,n){let r=[];for(let i of n.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let o=i[1]?.trim(),s=i[2]?.trim()??null,a=i[0];if(!o||!a||typeof i.index!="number")continue;let c=Be(n,i.index,i.index+a.length);r.push({importedName:o,localName:s,sourcePath:En(e,t,o),kind:s?"namespace":"side-effect",used:s?q(c,s):!0,usedMembers:s?bt(c,s):[]})}return r}function hs(e,t,n){let r=[];for(let i of n.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let o=i[1]?.trim();o&&r.push({specifier:o,sourcePath:En(e,t,o)})}return r}function Ss(e,t,n){return Fn(e,t,{csharp:r=>Hp(e,t,r),vb:r=>Up(e,t,r)},()=>{let r=Jo(t)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return oe(n,r,(i,o)=>{let s=i[1]?.trim();if(!s)return[];let[a,c]=s.split(/\s*=\s*/),l=!!c,u=(l?c:a)?.trim()??s,d=u.split(".").pop()??u,p=l?a?.trim()??d:d;return[de(e,t,o,u,d,p,w(e,u,Me))]})},n)}function Up(e,t,n){let r=L(n,new Set(["imports_statement"])),i=[];for(let o of n.rootNode.descendantsOfType("imports_statement")){let s=o.namedChildren.filter(p=>p.type==="namespace_name");if(s.length===0)continue;let a=s[s.length-1],c=s.length>1?s[0]:null,l=a.text,u=l.split(".").pop()??l,d=c?.text??u;i.push(T(u,d,w(e,l,Me),r,c?"namespace":"named"))}return i}function Hp(e,t,n){let r=L(n,new Set(["using_directive"])),i=[];for(let o of n.rootNode.descendantsOfType("using_directive")){let s=o.namedChildren;if(s.length===0)continue;let a=null,c;s.length>=2&&s[0].type==="identifier"&&(s[1].type==="qualified_name"||s[1].type==="identifier")?(a=s[0],c=s[1]):c=s[s.length-1];let l=c.text,u=l.split(".").pop()??l,d=a?.text??u;i.push(T(u,d,w(e,l,Me),r,a?"namespace":"named"))}return i}var zp=v("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function bs(e,t){return zp.get(e,t,()=>{let n=new Set,r=x(e,t);if(!r)return n;let o=r.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,s=>s.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,s=>s.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,s=>s.replace(/[^\r\n]/g," "));for(let s of o.matchAll(/[A-Za-z_$][\w$]*/g))n.add(s[0]);return n})}function ii(e,t,n){return se(e,t,r=>qp(e,t,r),()=>Wp(e,t,n),n)}function Wp(e,t,n){return rf(n).flatMap(r=>of(e,t,r.clause,r.specifier,r.start,r.end,n))}function qp(e,t,n){let r=Kp(e,t,n),i=[];for(let o of n.rootNode.descendantsOfType("import_statement"))i.push(...Gp(e,t,n,o,r));return i}function Kp(e,t,n){let r=L(n,new Set(["import_statement"]));if(Se(t))for(let i of bs(e,t))r.add(i);return r}function Gp(e,t,n,r,i){let o=Yp(r);if(!o)return[];let s=be(e,t,o),a=Z(r,"import_clause");return a?Xp(n,a,s,i,ef(r.text)):[Ye("*",s)]}function Xp(e,t,n,r,i){let o=[];for(let s of t.namedChildren)if(s.type==="identifier")o.push(Jp(s.text,n,r,i));else if(s.type==="namespace_import"){let a=Qp(e,s,n,r,i);a&&o.push(a)}else s.type==="named_imports"&&o.push(...Zp(s,n,r,i));return o}function Jp(e,t,n,r){return T("default",e,t,n,"default",{isTypeOnly:r})}function Qp(e,t,n,r,i){let s=Z(t,"identifier")?.text??"";if(!s)return null;let a=nf(e,s);return et("*",n,{localName:s,usedMembers:a,isTypeOnly:i,used:a.length>0||r.has(s)})}function Zp(e,t,n,r){let i=[];for(let o of e.namedChildren){if(o.type!=="import_specifier")continue;let s=o.namedChild(0),a=o.namedChild(1);if(!s)continue;let c=s.text,l=a?.text??c;i.push(T(c,l,t,n,"named",{isTypeOnly:r||tf(o.text)}))}return i}function Yp(e){let t=Z(e,"string");if(!t)return null;let n=Z(t,"string_fragment");return n?n.text:null}function ef(e){return/^\s*import\s+type\b/.test(e)}function tf(e){return/^\s*type\b/.test(e.trim())}function nf(e,t){let n=new Set;for(let r of e.rootNode.descendantsOfType("member_expression")){let i=r.namedChild(0),o=r.namedChild(1);!i||!o||i.type!=="identifier"||i.text!==t||(o.type==="property_identifier"||o.type==="identifier")&&n.add(o.text)}return[...n]}function rf(e){let t=[],n=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let i of e.matchAll(n)){let o=i[0],s=i[1],a=i[2];!o||!a||typeof i.index!="number"||t.push({clause:s,specifier:a,start:i.index,end:i.index+o.length})}let r=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let i of e.matchAll(r)){let o=i[0],s=i[1];!o||!s||typeof i.index!="number"||t.push({clause:null,specifier:s,start:i.index,end:i.index+o.length})}return t.sort((i,o)=>i.start-o.start)}function of(e,t,n,r,i,o,s){let a=be(e,t,r),c=Be(s,i,o);return n?sf(n).map(u=>({...u,sourcePath:a})).map(u=>{if(u.kind==="namespace"){let d=bt(c,u.localName);return et(u.importedName,u.sourcePath,{localName:u.localName,usedMembers:d,used:d.length>0||q(c,u.localName),isTypeOnly:u.isTypeOnly})}return u.kind==="side-effect"?Ye(u.importedName,u.sourcePath):we(u.importedName,u.localName??"",u.sourcePath,u.localName?q(c,u.localName):!1,u.kind,[],{isTypeOnly:u.isTypeOnly})}):[Ye("*",a)]}function sf(e){let t=e.trim(),n=/^type\b/.test(t),r=t.replace(/^type\s+/,""),[i,o]=af(r),s=[];return i&&s.push(...xs(i,n)),o&&s.push(...xs(o,n)),s}function xs(e,t){let n=e.trim();if(!n)return[];if(n.startsWith("{")){let r=n.slice(1,-1).trim();return r?K(r).map(i=>{let o=i.trim(),s=t||/^type\b/.test(o),a=o.replace(/^type\s+/,""),[c,l]=a.split(/\s+as\s+/);return{importedName:c.trim(),localName:(l??c).trim(),kind:"named",isTypeOnly:s}}):[]}return n.startsWith("* as ")?[{importedName:"*",localName:n.slice(5).trim(),kind:"namespace",isTypeOnly:t}]:[{importedName:"default",localName:n,kind:"default",isTypeOnly:t}]}function af(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];if(r==="{"&&t++,r==="}"&&t--,r===","&&t===0)return[e.slice(0,n).trim(),e.slice(n+1).trim()]}return[e.trim(),null]}function oi(e,t,n){let r=R(e,t);return r?ff(e,t,r):cf(e,t,n)}function cf(e,t,n){return[...lf(e,t,n),...uf(e,t,n),...df(e,t,n)]}function lf(e,t,n){let r=[],i=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of n.matchAll(i)){if(typeof o.index!="number")continue;let s=o[1]??"",a=o[2]??"",c=K(s).map(d=>pf(d.trim())).filter(d=>!!d),l=xt(n,o.index),u=xt(n,o.index+o[0].length-1);r.push({kind:"named",sourcePath:be(e,t,a),names:c,startLine:l,endLine:u})}return r}function uf(e,t,n){let r=[],i=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of n.matchAll(i)){if(typeof o.index!="number")continue;let s=o[2]??"",a=xt(n,o.index),c=xt(n,o.index+o[0].length-1);r.push({kind:"star-as",sourcePath:be(e,t,s),names:o[1]?[o[1]]:[],startLine:a,endLine:c})}return r}function df(e,t,n){let r=[],i=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of n.matchAll(i)){if(typeof o.index!="number")continue;let s=o[1]??"",a=xt(n,o.index),c=xt(n,o.index+o[0].length-1);r.push({kind:"star",sourcePath:be(e,t,s),names:[],startLine:a,endLine:c})}return r}function pf(e){if(!e)return null;let t=e.replace(/^type\s+/,"").trim();if(!t)return null;let n=t.match(/^(\w+)\s+as\s+(\w+)$/);if(n)return n[2]??null;let r=t.match(/^(\w+)$/);return r?r[1]??null:null}function xt(e,t){let n=0;for(let r=0;r<t&&r<e.length;r++)e.charCodeAt(r)===10&&n++;return n}function ff(e,t,n){let r=[];for(let i of n.rootNode.descendantsOfType("export_statement")){let o=mf(e,t,i);if(o===void 0)continue;let s=i.startPosition.row,a=i.endPosition.row,c=gf(i,o,s,a);r.push(c)}return r}function mf(e,t,n){let r=Z(n,"string");if(!r)return;let i=Z(r,"string_fragment");if(i)return be(e,t,i.text)}function gf(e,t,n,r){let i=Z(e,"export_clause");if(i){let s=[];for(let a of i.namedChildren){if(a.type!=="export_specifier")continue;let c=a.namedChild(0),l=a.namedChild(1);c&&s.push((l??c).text)}return{kind:"named",sourcePath:t,names:s,startLine:n,endLine:r}}let o=Z(e,"namespace_export");if(o){let s=o.namedChildren.find(a=>a.type==="identifier"||a.type==="type_identifier")?.text;return{kind:"star-as",sourcePath:t,names:s?[s]:[],startLine:n,endLine:r}}return{kind:"star",sourcePath:t,names:[],startLine:n,endLine:r}}function vs(e,t,n){return Fn(e,t,{java:r=>yf(e,t,r),kotlin:r=>hf(e,t,r),scala:r=>Sf(e,t,r)},()=>oe(n,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(r,i)=>{let o=r[1]?.trim();return o?bf(e,t,o,i):[]}),n)}function yf(e,t,n){let r=L(n,new Set(["import_declaration"])),i=[];for(let o of n.rootNode.descendantsOfType("import_declaration")){let s=o.children.some(d=>d.type==="asterisk"),c=o.namedChildren.find(d=>d.type==="scoped_identifier")??o.namedChildren.find(d=>d.type==="identifier");if(!c)continue;let l=c.text;if(s){i.push(et("*",w(e,l,Q)));continue}let u=l.split(".").pop()??l;i.push(T(u,u,w(e,l,Q),r))}return i}function hf(e,t,n){let r=L(n,new Set(["import_header","import_list"])),i=[];for(let o of n.rootNode.descendantsOfType("import_header")){let s=o.namedChildren.find(f=>f.type==="identifier");if(!s)continue;let a=o.namedChildren.some(f=>f.type==="wildcard_import"),c=o.namedChildren.find(f=>f.type==="import_alias");if(a){i.push(et("*",w(e,s.text,Q)));continue}let l=s.text,u=l.split(".").pop()??l,p=c?.namedChild(0)?.text??u;i.push(T(u,p,w(e,l,Q),r))}return i}function Sf(e,t,n){let r=L(n,new Set(["import_declaration"])),i=[];for(let o of n.rootNode.descendantsOfType("import_declaration")){let s=o.namedChildren.find(d=>d.type==="namespace_selectors"||d.type==="namespace_wildcard"),a=o.namedChildren.filter(d=>d!==s&&(d.type==="identifier"||d.type==="stable_identifier")),c=a.map(d=>d.text).join(".");if(!c)continue;if(s?.type==="namespace_wildcard"){i.push(et("*",w(e,c,Q)));continue}if(s?.type==="namespace_selectors"){for(let d of s.namedChildren)if(d.type==="arrow_renamed_identifier"){let[p,f]=d.namedChildren;if(!p)continue;let m=p.text,g=f?.text??m;if(m==="_")continue;i.push(T(m,g,w(e,`${c}.${m}`,Q),r))}else if(d.type==="identifier"){let p=d.text;i.push(T(p,p,w(e,`${c}.${p}`,Q),r))}continue}let l=a[a.length-1]?.text??c,u=a.slice(0,-1).map(d=>d.text).join(".")||c;i.push(T(l,l,w(e,u&&a.length>1?`${u}.${l}`:c,Q),r))}return i}function bf(e,t,n,r){if(n.includes("{")&&n.includes("}")){let i=n.slice(0,n.indexOf("{")).replace(/\.$/,"").trim(),o=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return K(o).flatMap(s=>{let a=s.trim();if(!a)return[];let[c,l]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),u=c?.trim();if(!u||u==="_")return[];let d=(l??u.split(".").pop()??u).trim(),p=u==="_"?i:`${i}.${u}`.replace(/\.\./g,".");return[de(e,t,r,p,u,d)]})}return[de(e,t,r,n,n.split(".").pop()??n,n.split(".").pop()??n)]}function Es(e,t,n){return se(e,t,r=>xf(e,t,r),()=>oe(n,/^[ \t]*use\s+(.+?)\s*;$/gm,(r,i)=>{let o=r[1]?.trim();return o?K(o).flatMap(s=>{let a=s.trim();if(!a)return[];let[c,l]=a.split(/\s+as\s+/i),u=c?.trim()??a,d=u.split("\\").pop()??u,p=(l??d).trim();return[de(e,t,i,u,d,p,w(e,u.replace(/\\/g,"."),Ze))]}):[]}),n)}function xf(e,t,n){let r=L(n,new Set(["namespace_use_declaration"])),i=[],o=(s,a,c)=>{i.push(T(a,c,w(e,s.replace(/\\/g,"."),Ze),r))};for(let s of n.rootNode.descendantsOfType("namespace_use_declaration")){let a=s.namedChildren.find(c=>c.type==="namespace_use_group");if(a){let c=s.namedChildren.find(l=>l.type==="namespace_name")?.text??"";for(let l of a.namedChildren){if(l.type!=="namespace_use_clause")continue;let{importedName:u,localName:d,qualified:p}=Ns(l,c);u&&o(p,u,d)}continue}for(let c of s.namedChildren){if(c.type!=="namespace_use_clause")continue;let{importedName:l,localName:u,qualified:d}=Ns(c,"");l&&o(d,l,u)}}return i}function Ns(e,t){let n=e.namedChildren.find(l=>l.type==="qualified_name"),r=e.namedChildren.filter(l=>l.type==="name"),i="";n?i=n.text:r.length>=1&&(i=r[0].text);let o=n&&r.length>0?r[r.length-1]:null,s=i.split("\\").pop()??i,a=o?.text??s,c=t?`${t}\\${i}`:i;return{importedName:s,localName:a,qualified:c}}function _s(e,t,n){return se(e,t,r=>vf(e,t,r),()=>Ef(n).flatMap(r=>_f(e,t,r,n)),n)}function vf(e,t,n){let r=L(n,new Set(["import_statement","import_from_statement"])),i=[];for(let o of n.rootNode.descendantsOfType("import_statement"))for(let s of o.namedChildren){let a=Cs(s);if(!a)continue;let c=ht(e,t,a.qualifiedName);i.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:c,kind:"namespace",used:r.has(a.localName),usedMembers:[]})}for(let o of n.rootNode.descendantsOfType("import_from_statement")){let s=o.namedChild(0);if(!s)continue;let a=Nf(s);if(a===null)continue;let c=ht(e,t,a);for(let l=1;l<o.namedChildCount;l+=1){let u=o.namedChild(l);if(u.type==="wildcard_import"){i.push({importedName:"*",localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]});continue}let d=Cs(u);d&&i.push({importedName:d.qualifiedName,localName:d.localName,sourcePath:c,kind:"named",used:r.has(d.localName),usedMembers:[]})}}return i}function Cs(e){if(e.type==="aliased_import"){let t=e.namedChild(0),n=e.namedChild(1);return!t||!n?null:{qualifiedName:t.text,localName:n.text}}if(e.type==="dotted_name"){let t=e.text;return{qualifiedName:t,localName:t.split(".")[0]??t}}return e.type==="identifier"?{qualifiedName:e.text,localName:e.text}:null}function Nf(e){if(e.type==="dotted_name")return e.text;if(e.type==="relative_import"){let t=Z(e,"import_prefix")?.text??"",n=Z(e,"dotted_name")?.text??"";return`${t}${n}`}return null}function Ef(e){let t=e.split(`
109
- `),n=[],r=0;for(let i=0;i<t.length;i++){let o=t[i],s=o.trimStart(),a=r;if(r+=o.length+1,!s.startsWith("import ")&&!s.startsWith("from "))continue;let c=o,l=a+o.length,u=Zr(o);for(;i+1<t.length&&(u>0||c.trimEnd().endsWith("\\"));){i++;let p=t[i];c+=`
110
- ${p}`,l+=1+p.length,u+=Zr(p),r+=p.length+1}let d=Cf(c);d&&n.push({...d,start:a,end:l})}return n}function Cf(e){let t=e.replace(/\\\s*\n/g," ").trim();if(t.startsWith("import "))return{kind:"import",module:null,clause:t.slice(7).trim()};let n=t.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!n)return null;let r=n[2].trim();return r.startsWith("(")&&r.endsWith(")")&&(r=r.slice(1,-1).trim()),{kind:"from",module:n[1],clause:r}}function _f(e,t,n,r){let i=Be(r,n.start,n.end),o=n.clause.replace(/\n/g," ").trim();if(n.kind==="import")return K(o).flatMap(c=>{let l=c.trim().replace(/,$/,"");if(!l)return[];let[u,d]=l.split(/\s+as\s+/),p=u.trim(),f=(d??p.split(".")[0]??p).trim(),m=ht(e,t,p),g=bt(i,f);return[{importedName:p,localName:f,sourcePath:m,kind:"namespace",used:q(i,f)||g.length>0,usedMembers:g}]});let s=n.module?ht(e,t,n.module):null,a=[];for(let c of K(o)){let l=c.trim().replace(/,$/,"");if(!l)continue;if(l==="*"){a.push({importedName:"*",localName:null,sourcePath:s,kind:"side-effect",used:!0,usedMembers:[]});continue}let[u,d]=l.split(/\s+as\s+/),p=(d??u).trim();a.push({importedName:u.trim(),localName:p,sourcePath:s,kind:"named",used:q(i,p),usedMembers:[]})}return a}import{basename as If}from"path";function Is(e,t,n){return se(e,t,r=>Ff(e,t,r),()=>Rf(e,t,n),n)}function Rf(e,t,n){return oe(n,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(r,i)=>{let o=r[1],s=r[2];if(!o||!s)return[];let a=o==="require_relative"?vn(e,t,s):null;if(a){let c=Rs(s);return[we(c,c,a,q(i,c))]}return[Ye(s,a)]})}function Ff(e,t,n){let r=L(n,new Set([])),i=[],o=new Set(["require","require_relative","load"]);for(let s of n.rootNode.descendantsOfType("call")){let a=s.namedChild(0);if(!a||a.type!=="identifier"||!o.has(a.text))continue;let l=s.namedChildren.find(f=>f.type==="argument_list")?.namedChild(0);if(!l||l.type!=="string")continue;let d=l.namedChildren.find(f=>f.type==="string_content")?.text;if(!d)continue;let p=a.text==="require_relative"?vn(e,t,d):null;if(p){let f=Rs(d);i.push(T(f,f,p,r))}else i.push(Ye(d,p))}return i}function Rs(e){return mn(If(e).replace(/\.[^.]+$/,""),/_/)}function Fs(e,t,n){return se(e,t,r=>Tf(e,t,r),()=>oe(n,/^[ \t]*use\s+(.+?)\s*;$/gm,(r,i)=>{let o=r[1]?.trim();return o?Pf(e,t,o,i):[]}),n)}function Tf(e,t,n){let r=L(n,new Set(["use_declaration"])),i=[];for(let o of n.rootNode.descendantsOfType("use_declaration")){let s=o.namedChild(0);if(s)for(let a of Bt(s,"")){if(!a.importedName||a.importedName==="*")continue;let c=Fe(e,t,a.qualifiedName)??Fe(e,t,a.qualifiedName.split("::").slice(0,-1).join("::"));i.push(T(a.importedName,a.localName,c,r))}}return i}function Bt(e,t){switch(e.type){case"identifier":case"super":case"crate":{let n=e.text;return[{qualifiedName:wn(t,n),importedName:n,localName:n}]}case"self":{let n=t.split("::").filter(Boolean).pop()??"self";return[{qualifiedName:t||"self",importedName:n,localName:n}]}case"scoped_identifier":{let n=e.text,r=n.split("::").pop()??n;return[{qualifiedName:wn(t,n),importedName:r,localName:r}]}case"scoped_use_list":{let n=e.namedChild(0),r=e.namedChild(1);if(!n||!r)return[];let i=wn(t,n.text),o=[];for(let s of r.namedChildren)o.push(...Bt(s,i));return o}case"use_list":{let n=[];for(let r of e.namedChildren)n.push(...Bt(r,t));return n}case"use_as_clause":{let n=e.namedChild(0),r=e.namedChild(1);if(!n||!r)return[];let i=Bt(n,t),o=r.text;return i.map(s=>({...s,localName:o}))}case"use_wildcard":{let n=e.namedChild(0),r=n?n.text:"";return[{qualifiedName:wn(t,`${r}::*`),importedName:"*",localName:"*"}]}default:return[]}}function wn(e,t){return e?t?`${e}::${t}`:e:t}function Pf(e,t,n,r){let i=n.trim();if(i.includes("{")&&i.includes("}")){let u=i.slice(0,i.indexOf("{")).replace(/::$/,"").trim(),d=i.slice(i.indexOf("{")+1,i.lastIndexOf("}")).trim();return K(d).flatMap(p=>{let f=p.trim();if(!f)return[];if(f==="self"){let N=u.split("::").filter(Boolean).pop();return N?[de(e,t,r,u,N,N)]:[]}let[m,g]=f.split(/\s+as\s+/),y=m?.trim();if(!y)return[];let S=(g??y.split("::").pop()??y).trim(),b=`${u}::${y}`.replace(/::::/g,"::");return[de(e,t,r,b,y.split("::").pop()??y,S,Fe(e,t,u))]})}let[o,s]=i.split(/\s+as\s+/),a=o?.trim()??i,c=(s??a.split("::").pop()??a).trim(),l=Fe(e,t,a)??Fe(e,t,a.split("::").slice(0,-1).join("::"));return[de(e,t,r,a,a.split("::").pop()??a,c,l)]}function Ts(e,t,n){let r=R(e,t);if(r)return wf(e,t,r);let i=[];for(let o of n.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let s=o[1]?.trim();s&&i.push(...kf(e,t,s))}return i}function wf(e,t,n){let r=[];for(let i of n.rootNode.descendantsOfType("use_declaration")){if(!Lf(i))continue;let o=i.namedChildren.find(s=>s.type!=="visibility_modifier");if(o)for(let s of Bt(o,""))s.importedName&&r.push(si(e,t,s.qualifiedName))}return r}function Lf(e){for(let t of e.children)if(t.type==="visibility_modifier"&&t.text.startsWith("pub"))return!0;return!1}function kf(e,t,n){let r=n.trim();if(r.includes("{")&&r.includes("}")){let i=r.slice(0,r.indexOf("{")).replace(/::$/,"").trim(),o=r.slice(r.indexOf("{")+1,r.lastIndexOf("}")).trim();return K(o).flatMap(s=>{let a=s.trim();if(!a||a==="self")return[];let[c]=a.split(/\s+as\s+/),l=`${i}::${c?.trim()??a}`.replace(/::::/g,"::");return[si(e,t,l)]})}return[si(e,t,r)]}function si(e,t,n){return{specifier:n,sourcePath:Fe(e,t,n)??Fe(e,t,n.split("::").slice(0,-1).join("::"))}}function je({language:e,extensions:t,imports:n,parseImports:r}){return{language:e,extensions:t,capabilities:{imports:n},parseImports:r}}function Ps(e,t){let n=t.toLowerCase();for(let r of e)for(let i of r.extensions)if(n.endsWith(i))return r;return null}var Df={language:"javascript",extensions:Je,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:ii,parseReExports:oi},Af=je({language:"python",extensions:yn,imports:"ast-with-regex-fallback",parseImports:_s}),Of=je({language:"jvm",extensions:Q,imports:"ast-dispatch-with-regex-fallback",parseImports:vs}),Mf={language:"rust",extensions:hn,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:Fs,parseExports:Ts},$f=je({language:"ruby",extensions:Sn,imports:"ast-with-regex-fallback",parseImports:Is}),Bf=je({language:"c/cpp",extensions:bn,imports:"ast-with-regex-fallback",parseImports:fs}),jf=je({language:"dotnet",extensions:Me,imports:"ast-dispatch-with-regex-fallback",parseImports:Ss}),Vf={language:"dart",extensions:xn,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:ys,parseExports:hs},Uf=je({language:"php",extensions:Ze,imports:"ast-with-regex-fallback",parseImports:Es}),Hf=je({language:"clojure",extensions:yt,imports:"regex-only",parseImports:gs}),ws=[Df,Af,Of,Mf,$f,Bf,jf,Vf,Uf,Hf];function Ln(e){return Ps(ws,e)}function UN(e){return ws.find(n=>n.language===e)?.capabilities??null}var ai={clearGroups:["whole-project","source-file"]},zf=v("source-imports",ai),Wf=v("source-exports",ai),qf=v("source-reexports",ai),Ls=le({kind:"source-imports",invalidation:X("source-imports"),serialize:Kf,deserialize:Gf}),ks=le({kind:"source-reexports",invalidation:X("source-reexports"),serialize:Xf,deserialize:Jf});function Ve(e,t){let n=D(t);return qf.get(e,n,()=>{let r=Ln(n);if(!r?.parseReExports)return[];let i=x(e,n);if(!i)return[];let o=he(e,n,i),s=Wr(e),a=ks.read(e,n,o);if(a?.resolutionFingerprint===s)return a.reExports;let c=r.parseReExports(e,n,i);return ks.write(e,n,o,{resolutionFingerprint:s,reExports:c}),c})}function M(e,t){let n=D(t);return zf.get(e,n,()=>{let r=Ln(n);if(!r)return[];let i=x(e,n);if(!i)return[];let o=he(e,n,i),s=Wr(e),a=Ls.read(e,n,o);if(a?.resolutionFingerprint===s)return a.imports;let c=r.parseImports(e,n,i);return Ls.write(e,n,o,{resolutionFingerprint:s,imports:c}),c})}function QN(e,t){let n=D(t);return Wf.get(e,n,()=>{let r=Ln(n);if(!r?.parseExports)return[];let i=x(e,n);return i?r.parseExports(e,n,i):[]})}function Kf(e){return JSON.stringify(e)}function Gf(e){try{let t=JSON.parse(e);return!ke(t)||typeof t.resolutionFingerprint!="string"||!Array.isArray(t.imports)?null:{resolutionFingerprint:t.resolutionFingerprint,imports:t.imports}}catch{return null}}function Xf(e){return JSON.stringify(e)}function Jf(e){try{let t=JSON.parse(e);return!ke(t)||typeof t.resolutionFingerprint!="string"||!Array.isArray(t.reExports)?null:{resolutionFingerprint:t.resolutionFingerprint,reExports:t.reExports}}catch{return null}}function kn(e){return{forFile(t,n){return Ds(e,t,n)},forFiles(t,n){let r=new Map;for(let i of t)r.set(i,Ds(e,i,n));return r}}}function Ds(e,t,n){let r={file:t},i=n.facts||n.identifiers;if(n.text&&(r.text=x(e,t)),n.lines&&(r.lines=Ft(e,t)),n.ast&&(r.ast=R(e,t)),n.imports&&(r.imports=M(e,t)),n.reexports&&(r.reexports=Ve(e,t)),i){let o=wr(e,t),s=o.facts;n.facts&&(r.facts=s),o.unavailable&&(r.sourceFactsUnavailable=o.unavailable),n.identifiers&&s&&(r.identifiers=s.fileIdentifiers,r.identifierLineMap=s.identifierLineMap)}return r}function Ue(e,t){return e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.start_char, der.end_line, der.end_char, d.relative_path, gs.display_name, gs.documentation
111
- FROM global_symbols gs
112
- JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
113
- JOIN documents d ON der.document_id = d.id
114
- WHERE ${t.where}
115
- ${e.pathExclusionsFor("d")}
116
- ${Os(t.orderBy)}
117
- ${Ms(t.limit)}`,...t.params??[])}function tt(e,t){return e.all(`SELECT
118
- gs.id,
119
- gs.symbol,
120
- c.document_id,
121
- MIN(c.start_line) AS start_line,
122
- 0 AS start_char,
123
- MAX(c.end_line) AS end_line,
124
- 0 AS end_char,
125
- d.relative_path,
126
- gs.display_name,
127
- gs.documentation
128
- FROM global_symbols gs
129
- JOIN mentions m ON m.symbol_id = gs.id
130
- JOIN chunks c ON m.chunk_id = c.id
131
- JOIN documents d ON c.document_id = d.id
132
- WHERE m.role = 1
133
- AND ${t.where}
134
- ${e.pathExclusionsFor("d")}
135
- GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name, gs.documentation
136
- ${Os(t.orderBy)}
137
- ${Ms(t.limit)}`,...t.params??[])}function Os(e){return e?`ORDER BY ${e}`:""}function Ms(e){return typeof e=="number"?`LIMIT ${e}`:""}function ci(e){return!e||!e.trim()?null:e.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim()||null}function li(e){if(!e)return null;let t=As(e);if(t)return t.replace(/\n/g," ");let n=e.indexOf("|");if(n===-1)return e.replace(/\n/g," ");let r=e.slice(n+1);return(As(r)??r).replace(/\n/g," ")}function As(e){return/^```(?:\w+)?\s*\n?([\s\S]*?)\n?```/.exec(e.trimStart())?.[1]?.trim()||null}function Qf(e,t={}){if(te(e.symbol)!==null)return t.includeClassMemberFallbacks===!0;let i=(e.documentation??"").replace(/^```\w*\s*/,"").replace(/\s*```$/,"").trim();return/^(?:var|let|const|function|class|interface|type|enum)\b/.test(i)}function Le(e,t,n={}){let r=new Map;for(let o of t)e.length>0&&!Qf(o,{includeClassMemberFallbacks:n.includeClassMemberFallbacks})||r.set(o.id,o);for(let o of e)r.set(o.id,o);let i=[...r.values()];return n.sort?i.sort((o,s)=>o.start_line-s.start_line||o.end_line-s.end_line||o.symbol.localeCompare(s.symbol)):i}function SE(e){let t=new Map;for(let n of e){if(!n.leaf)continue;let r=t.get(n.leaf)??[];r.push(n),t.set(n.leaf,r)}return t}var Zf=v("file-definitions",{clearGroups:["definition-catalog"]}),Yf=ye("scoped-matched-definitions",{clearGroups:["definition-catalog"]}),em=v("file-function-like-definitions",{clearGroups:["definition-catalog"]}),$s=new WeakMap;function F(e,t,n={}){return n.includeClassMemberFallbacks?ui(e,t,void 0,{includeClassMemberFallbacks:!0}):Zf.get(e,t,()=>{let r=Us(e,t);if(r)return r;let i=ui(e,t),o=We(e),s=kn(e).forFile(t,{text:!0}).text;return o&&s&&Vs.write(e,t,he(e,t,s),{projectFingerprint:o,definitions:i.map(a=>({...a}))}),i})}function tm(e,t){return em.get(e,t,()=>{let n=Us(e,t);return n?n.filter(r=>r.isFunctionLike):ui(e,t,r=>r.isFunctionLike)})}var Vs=le({kind:"file-definitions",invalidation:X("file-definitions"),serialize:nm,deserialize:rm});function Us(e,t){let n=We(e);if(!n)return null;let r=kn(e).forFile(t,{text:!0}).text;if(!r)return null;let i=Vs.read(e,t,he(e,t,r));return i?im(i,n,t):null}function nm(e){return JSON.stringify(e)}function rm(e){try{let t=JSON.parse(e);return!ke(t)||typeof t.projectFingerprint!="string"||!Array.isArray(t.definitions)?null:{projectFingerprint:t.projectFingerprint,definitions:t.definitions}}catch{return null}}function im(e,t,n){if(e.projectFingerprint!==t)return null;let r=[];for(let i of e.definitions){let o=om(i,n);if(!o)return null;r.push(o)}return r}function om(e,t){return!ke(e)||typeof e.symbolId!="number"||typeof e.symbol!="string"||typeof e.documentId!="number"||typeof e.startLine!="number"||typeof e.startChar!="number"&&e.startChar!==void 0||typeof e.endLine!="number"||typeof e.endChar!="number"&&e.endChar!==void 0||e.relativePath!==t||typeof e.leaf!="string"||typeof e.parentTypeName!="string"&&e.parentTypeName!==null||typeof e.isFunctionLike!="boolean"||typeof e.isTypeLike!="boolean"||typeof e.kind!="number"&&e.kind!==null||typeof e.documentation!="string"&&e.documentation!==null||typeof e.enclosingSymbol!="string"&&e.enclosingSymbol!==null?null:{symbolId:e.symbolId,symbol:e.symbol,documentId:e.documentId,startLine:e.startLine,startChar:e.startChar,endLine:e.endLine,endChar:e.endChar,relativePath:e.relativePath,leaf:e.leaf,parentTypeName:e.parentTypeName,isFunctionLike:e.isFunctionLike,isTypeLike:e.isTypeLike,kind:e.kind,documentation:e.documentation,enclosingSymbol:e.enclosingSymbol}}function ui(e,t,n,r={}){let i=Le(sm(e,t),am(e,t),{sort:!0,includeClassMemberFallbacks:r.includeClassMemberFallbacks}).map(Hs);return n&&(i=i.filter(n)),Ws(e,t,i)}function sm(e,t){return e.all(`SELECT
138
- gs.id,
139
- gs.symbol,
140
- der.document_id,
141
- der.start_line,
142
- der.start_char,
143
- der.end_line,
144
- der.end_char,
145
- d.relative_path,
146
- gs.display_name,
147
- gs.kind,
148
- gs.documentation,
149
- gs.enclosing_symbol
150
- FROM global_symbols gs
151
- JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
152
- JOIN documents d ON der.document_id = d.id
153
- WHERE d.relative_path = ?
154
- ${e.symbolNoiseFor("gs")}
155
- ORDER BY der.start_line, der.end_line`,t)}function am(e,t){return e.all(`SELECT
156
- gs.id,
157
- gs.symbol,
158
- c.document_id,
159
- MIN(c.start_line) AS start_line,
160
- 0 AS start_char,
161
- MAX(c.end_line) AS end_line,
162
- 0 AS end_char,
163
- d.relative_path,
164
- gs.display_name,
165
- gs.kind,
166
- gs.documentation,
167
- gs.enclosing_symbol
168
- FROM global_symbols gs
169
- JOIN mentions m ON m.symbol_id = gs.id
170
- JOIN chunks c ON m.chunk_id = c.id
171
- JOIN documents d ON c.document_id = d.id
172
- WHERE d.relative_path = ?
173
- AND m.role = 1
174
- ${e.symbolNoiseFor("gs")}
175
- GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
176
- ORDER BY start_line, end_line`,t)}function Hs(e){return{symbolId:e.id,symbol:e.symbol,documentId:e.document_id,startLine:e.start_line,startChar:e.start_char??0,endLine:e.end_line,endChar:e.end_char??0,relativePath:e.relative_path,leaf:z(e.symbol),parentTypeName:te(e.symbol),isFunctionLike:Tt(e.symbol),isTypeLike:qe(e.symbol)==="type",kind:e.kind??null,documentation:e.documentation??null,enclosingSymbol:e.enclosing_symbol??null}}function bE(e,t={}){return cm(e,t.scope)}function cm(e,t){return ee(e,{scope:t,includeIgnored:!1}).flatMap(n=>F(e,n)).filter(n=>!e.isIgnored(n.relativePath))}function xE(e,t){return ee(e,{scope:t,includeIgnored:!1}).flatMap(n=>tm(e,n)).filter(n=>!e.isIgnored(n.relativePath))}function vE(e,t){let n=Yf.get(e,()=>new WeakMap),r=n.get(t.symbolMatches);r||(r=new Map,n.set(t.symbolMatches,r));let i=JSON.stringify({scope:t.scope??null,sqlPrefilter:t.sqlPrefilter??null}),o=r.get(i);if(o)return[...o];let s=Bs(lm(e,t.scope,t.sqlPrefilter)),a=Bs(um(e,t.scope,t.sqlPrefilter)),c=new Set([...s.keys(),...a.keys()]),l=[];for(let u of[...c].sort()){if(e.isIgnored(u))continue;let d=Le(s.get(u)??[],a.get(u)??[],{sort:!0}).filter(p=>t.symbolMatches(p.symbol));d.length!==0&&l.push(...Ws(e,u,d.map(Hs)))}return r.set(i,l),[...l]}function lm(e,t,n){let r=t?"AND d.relative_path LIKE ?":"",i=n?`AND ${zs("gs",n)}`:"",o=t?[`%${t}%`]:[];return e.all(`SELECT
177
- gs.id,
178
- gs.symbol,
179
- der.document_id,
180
- der.start_line,
181
- der.start_char,
182
- der.end_line,
183
- der.end_char,
184
- d.relative_path,
185
- gs.display_name,
186
- gs.kind,
187
- gs.documentation,
188
- gs.enclosing_symbol
189
- FROM global_symbols gs
190
- JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
191
- JOIN documents d ON der.document_id = d.id
192
- WHERE 1 = 1
193
- ${e.pathExclusionsFor("d")}
194
- ${r}
195
- ${i}
196
- ${e.symbolNoiseFor("gs")}
197
- ORDER BY d.relative_path, der.start_line, der.end_line`,...o)}function um(e,t,n){let r=t?"AND d.relative_path LIKE ?":"",i=n?`AND ${zs("gs",n)}`:"",o=t?[`%${t}%`]:[];return e.all(`SELECT
198
- gs.id,
199
- gs.symbol,
200
- c.document_id,
201
- MIN(c.start_line) AS start_line,
202
- 0 AS start_char,
203
- MAX(c.end_line) AS end_line,
204
- 0 AS end_char,
205
- d.relative_path,
206
- gs.display_name,
207
- gs.kind,
208
- gs.documentation,
209
- gs.enclosing_symbol
210
- FROM global_symbols gs
211
- JOIN mentions m ON m.symbol_id = gs.id
212
- JOIN chunks c ON m.chunk_id = c.id
213
- JOIN documents d ON c.document_id = d.id
214
- WHERE m.role = 1
215
- AND NOT EXISTS (
216
- SELECT 1
217
- FROM defn_enclosing_ranges existing_der
218
- WHERE existing_der.symbol_id = gs.id
219
- )
220
- ${e.pathExclusionsFor("d")}
221
- ${r}
222
- ${i}
223
- ${e.symbolNoiseFor("gs")}
224
- GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
225
- ORDER BY d.relative_path, start_line, end_line`,...o)}function dm(e){return`(${e}.symbol LIKE '%().' OR ${e}.symbol LIKE '%()')`}function zs(e,t){return t==="callable"?dm(e):pm(e)}function pm(e){return`(${e}.symbol LIKE '%.' OR ${e}.symbol LIKE '%()')`}function Bs(e){let t=new Map;for(let n of e){let r=t.get(n.relative_path);r?r.push(n):t.set(n.relative_path,[n])}return t}function NE(e,t,n={}){if(t.length===0)return[];let r=t.flatMap(i=>F(e,i)).filter(i=>!e.isIgnored(i.relativePath));return n.onlyDocumented&&(r=r.filter(i=>i.documentation!==null&&i.documentation!=="")),n.sort&&(r=r.sort((i,o)=>i.relativePath.localeCompare(o.relativePath)||i.startLine-o.startLine||i.endLine-o.endLine)),r.map(i=>({startLine:i.startLine,endLine:i.endLine,symbol:i.symbol,shortName:Oe(i.symbol),signature:ci(li(i.documentation)),relativePath:i.relativePath,enclosingSymbol:i.enclosingSymbol}))}function fm(e){let t=new Map,n=e.map((r,i)=>({definition:r,index:i,span:r.endLine-r.startLine})).sort((r,i)=>r.span-i.span||r.index-i.index);for(let{definition:r}of n)for(let i=r.startLine;i<=r.endLine;i+=1)t.has(i)||t.set(i,r);return t}function vt(e,t){let n=$s.get(e);return n||(n=fm(e),$s.set(e,n)),n.get(t)??null}function Dn(e,t){let n=F(e,t.relative_path).find(r=>r.symbolId===t.id);return n?{symbolId:n.symbolId,symbol:n.symbol,documentId:n.documentId,startLine:n.startLine,startChar:n.startChar,endLine:n.endLine,endChar:n.endChar,relativePath:n.relativePath}:{symbolId:t.id,symbol:t.symbol,documentId:t.document_id,startLine:t.start_line,startChar:t.start_char??0,endLine:t.end_line,endChar:t.end_char??0,relativePath:t.relative_path}}function Ws(e,t,n){let r=kn(e).forFile(t,{text:!0}).text,i=Lr(e,t);return i?bm(n,i,r):r?mm(n,r):n}function mm(e,t){let n=t.split(/\r?\n/),r=gm(e,n),i=ym(e,r),o=hm(i,n);return Sm(e,o)}function gm(e,t){let n=e.some(i=>An(i.symbol))?Im(t):null,r=new Map;for(let i of e)r.set(i.symbolId,_m(t,n,i));return r}function ym(e,t){return e.filter(n=>An(n.symbol)).map(n=>({definition:n,startLine:t.get(n.symbolId)??n.startLine})).sort((n,r)=>n.startLine-r.startLine||n.definition.startLine-r.definition.startLine||n.definition.symbol.localeCompare(r.definition.symbol))}function hm(e,t){let n=new Map;for(let r=0;r<e.length;r+=1){let i=e[r],o=e[r+1],s=o?Math.max(i.startLine,o.startLine-1):t.length-1;n.set(i.definition.symbolId,{startLine:i.startLine,endLine:Rm(t,i.definition,i.startLine,s)})}return n}function Sm(e,t){return e.map(n=>{let r=t.get(n.symbolId);return r?{...n,startLine:r.startLine,endLine:r.endLine}:n})}function bm(e,t,n=null){let r=new Map;for(let i of t){let o=r.get(i.name);o?o.push(i):r.set(i.name,[i])}return e.map(i=>{if(!Cm(i)||!i.leaf)return js(i,n);let o=r.get(i.leaf);if(!o||o.length===0)return js(i,n);let s=n?xm(i,o,n):null;if(s)return{...i,startLine:s.startLine,endLine:s.endLine};let a=o[0],c=Math.abs(a.startLine-i.startLine);for(let l=1;l<o.length;l+=1){let u=o[l],d=Math.abs(u.startLine-i.startLine);d<c&&(a=u,c=d)}return{...i,startLine:a.startLine,endLine:a.endLine}})}function xm(e,t,n){let r=vm(e.symbol);if(!r)return null;let i=n.split(/\r?\n/),o=new RegExp(`\\b${ie(r)}\\b`);for(let s of t){let a=Nm(i,s.startLine);if(a&&o.test(a))return s}return null}function vm(e){return e.match(/\/impl#\[([^\]]+)\]/)?.[1]??null}function Nm(e,t){for(let n=t;n>=0;n-=1){let r=e[n]?.trim()??"";if(r){if(/^impl\b/.test(r))return Em(e,n,t);if(/^(?:struct|enum|trait|mod)\b/.test(r))return null}}return null}function Em(e,t,n){let r=[];for(let i=t;i<=n;i+=1){let o=e[i]??"";if(r.push(o),o.includes("{"))break}return r.join(" ")}function Cm(e){return An(e.symbol)?!0:qe(e.symbol)==="term"&&te(e.symbol)===null}function js(e,t){if(!t||!e.leaf||qe(e.symbol)!=="term"||te(e.symbol)!==null)return e;let n=ie(e.leaf),r=new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+${n}\\b`),o=t.split(/\r?\n/).findIndex(s=>r.test(s));return o>=0?{...e,startLine:o,endLine:o}:e}function _m(e,t,n){if(!An(n.symbol))return n.startLine;let r=Math.max(0,Math.min(n.startLine,e.length-1));if(!t)return r;let i=t.get(n.leaf);if(!i||i.length===0)return r;let o=null;for(let s of i){let a=Math.abs(s-n.startLine);(!o||a<o.distance)&&(o={line:s,distance:a})}return o?.line??r}function Im(e){let t=/\b(?:function|def|fn)\s+([A-Za-z_$][\w$]*)/g,n=/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s*)?(?:function\b|\()/g,r=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,i=/\b([A-Za-z_$][\w$]*)\s*\(/g,o=new Map,s=(a,c)=>{let l=o.get(a);if(!l){o.set(a,[c]);return}l[l.length-1]!==c&&l.push(c)};for(let a=0;a<e.length;a+=1){let c=e[a]??"";for(let u of c.matchAll(t))u[1]&&s(u[1],a);for(let u of c.matchAll(n))u[1]&&s(u[1],a);let l=c.match(r);l?.[1]&&s(l[1],a);for(let u of c.matchAll(i))u[1]&&s(u[1],a)}return o}function Rm(e,t,n,r){let i=Math.max(n,Math.min(e.length-1,r)),o=Math.max(n,Math.min(i,t.endLine)),s=0,a=0,c=!1;for(let l=n;l<=i;l+=1){let u=Fm(e[l]??"");for(let d of u)d==="{"?(s+=1,c=!0):d==="}"?s=Math.max(0,s-1):d==="("?a+=1:d===")"&&(a=Math.max(0,a-1));if(c&&s===0||!c&&a===0&&l>=o)return l}return o}function Fm(e){let t="",n=null,r=!1;for(let i=0;i<e.length;i+=1){let o=e[i],s=e[i+1];if(!n&&o==="/"&&s==="/"){t+=" ".repeat(e.length-i);break}if(n){if(r){r=!1,t+=" ";continue}if(o==="\\"){r=!0,t+=" ";continue}o===n&&(n=null),t+=" ";continue}if(o==='"'||o==="'"||o==="`"){n=o,t+=" ";continue}t+=o}return t}function An(e){return e.includes("().")}function EE(e){let t=ue(e);if("kind"in t)return[];let n=[];for(let r=t.descriptors.length-2;r>=0;r-=1){let i=t.descriptors[r];i?.suffix==="type"&&i.name&&n.push(i.name)}return n}var Tm=v("symbol-resolution",{clearGroups:[]});function LE(e,t){return Pm(e,t).match}function Pm(e,t){return Tm.get(e,t,()=>{let n=Gs(e,t.trim()).filter(s=>!e.isIgnored(s.relative_path));if(n.length>0)return Nt(e,n);let r=$m(e,t);if(r&&!e.isIgnored(r.relative_path))return Nt(e,[r]);let i=wm(e,t);if(i.length>0)return Nt(e,i);let o=Lm(e,t);return o.length>0?Nt(e,o):Om(e,t)})}function wm(e,t){let n=t.trim().replace(/\(\)$/u,""),r=n.lastIndexOf(":");if(r<=0||r===n.length-1||n.startsWith("local:"))return[];let i=n.slice(r+1);if(!/^[\p{L}_$][\p{L}\p{N}_$]*$/u.test(i))return[];let o=[`/${i}().`,`/${i}.`,`/${i}#`,`#${i}().`,`#${i}.`,`/${i}/`],s=`gs.display_name = ? OR ${o.map(()=>"instr(gs.symbol, ?) > 0").join(" OR ")}`,a=[i,...o],c=Ue(e,{where:s,params:a,orderBy:"d.relative_path, der.start_line",limit:200}),l=c.length>0?[]:tt(e,{where:s,params:a,orderBy:"d.relative_path, start_line",limit:200}),u=Le(c,l).filter(d=>!e.isIgnored(d.relative_path)).filter(d=>Oe(d.symbol).replace(/\(\)$/u,"")===n);return[...new Map(u.map(d=>[`${d.symbol}\0${d.relative_path}`,d])).values()]}function Lm(e,t){let n=On(t),r=di(n);if(!r)return[];let i=`%${r.path}%`,o=r.leaf;return km(e,i,o,n)}function km(e,t,n,r){let i=Le([],[...Dm(e,t,n),...Am(e,t,n)]).filter(o=>!e.isIgnored(o.relative_path)).filter(o=>Et(o,r)>1);return i.sort((o,s)=>Et(s,r)-Et(o,r)||o.end_line-o.start_line-(s.end_line-s.start_line)||o.start_line-s.start_line||o.symbol.localeCompare(s.symbol)),i}function Dm(e,t,n){return Ue(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[t,n,`%/${n}.%`]})}function Am(e,t,n){return tt(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[t,n,`%/${n}.%`]})}function Om(e,t){let n=On(t),r=zm(t),i=Um(e,r),o=Wm(i,t,n).filter(a=>!e.isIgnored(a.relative_path));if(o.length>0)return Nt(e,o);let s=[];for(let a of i){if(e.isIgnored(a.relative_path))continue;let c=Hm(a,t,n,r);c<=0||s.push({row:a,score:c})}return s.sort((a,c)=>c.score-a.score||a.row.end_line-a.row.start_line-(c.row.end_line-c.row.start_line)||a.row.relative_path.localeCompare(c.row.relative_path)||a.row.symbol.localeCompare(c.row.symbol)),Nt(e,s.map(a=>a.row))}function Nt(e,t){let n=t.map(i=>Dn(e,i)),r=n[0]??null;return{match:r,candidates:r?Mm(n,r):[],total:n.length}}function Mm(e,t){let n=new Set([`${t.symbolId}:${t.relativePath}:${t.startLine}`]),r=[];for(let i of e){let o=`${i.symbolId}:${i.relativePath}:${i.startLine}`;if(!n.has(o)&&(n.add(o),r.push({symbol:i.symbol,shortName:Oe(i.symbol),relativePath:i.relativePath,startLine:i.startLine}),r.length>=5))break}return r}function $m(e,t){let n=t.match(/^(.+):(\d+)(?:-(\d+))?$/);if(!n)return;let[,r,i,o]=n,s=so(e,r,{allowMultiple:!1})[0]?.relativePath;if(!s)return;let a=Math.max(0,parseInt(i,10)-1),c=o?Math.max(a,parseInt(o,10)-1):a;return Bm(e,s,a,c)??jm(e,s,a,c)}function Bm(e,t,n,r){return Ue(e,{where:"d.relative_path = ? AND der.start_line <= ? AND der.end_line >= ?",params:[t,n,r],orderBy:"(der.end_line - der.start_line) ASC",limit:1})[0]}function jm(e,t,n,r){return tt(e,{where:"d.relative_path = ? AND c.start_line <= ? AND c.end_line >= ?",params:[t,n,r],orderBy:"(MAX(c.end_line) - MIN(c.start_line)) ASC",limit:1})[0]}function kE(e,t){let n=Gs(e,t).find(r=>!e.isIgnored(r.relative_path));return n?Dn(e,n):null}function Gs(e,t){let n=Ue(e,{where:"gs.symbol = ?",params:[t],orderBy:"d.relative_path, der.start_line"}),r=n.length>0?[]:tt(e,{where:"gs.symbol = ?",params:[t],orderBy:"d.relative_path, start_line"});return Le(n,r)}function jt(e,t){if("symbol"in t&&"relativePath"in t)return t;let n=Vm(e,t.symbolId)[0];return n?Dn(e,n):null}function Vm(e,t){let n=Ue(e,{where:"gs.id = ?",params:[t],orderBy:"der.start_line, der.end_line"}),r=tt(e,{where:"gs.id = ?",params:[t],orderBy:"start_line, end_line"});return Le(n,r)}function Um(e,t){let n=t.map(()=>"(gs.symbol LIKE ? OR d.relative_path LIKE ? OR COALESCE(gs.display_name, '') LIKE ?)"),r=t.flatMap(a=>{let c=`%${a}%`;return[c,c,c]}),i=n.join(`
226
- AND `),o=Ue(e,{where:i,params:r,limit:200}),s=tt(e,{where:i,params:r,limit:200});return Le(o,s)}function Hm(e,t,n,r){let i=t.trim(),o=n,s=o.replace(/\(\)$/,""),a=t.toLowerCase(),c=n.toLowerCase(),l=c.replace(/\(\)$/,""),u=e.symbol,d=Oe(e.symbol),p=z(e.symbol),f=e.display_name??"",m=e.symbol.toLowerCase(),g=d.toLowerCase(),y=p.toLowerCase(),S=f.toLowerCase(),b=e.relative_path.toLowerCase(),N=/[/:.]/.test(n),E=di(n),I=E?.leaf.toLowerCase(),h=0;return(u===i||u===o)&&(h+=1150),(d===i||d===o)&&(h+=1100),f===s&&(h+=1180),p===s&&(h+=1160),(`${p}()`===i||`${p}()`===o)&&(h+=955),(m===a||m===c)&&(h+=1e3),(g===a||g===c)&&(h+=950),(b===a||b===c)&&(h+=925),(b.endsWith(`/${c}`)||b.endsWith(`/${a}`))&&(h+=875),S===l&&(h+=850),y===l&&(h+=825),(`${y}()`===a||`${y}()`===c)&&(h+=820),(g.endsWith(`:${c}`)||g.endsWith(`:${l}`)||g.endsWith(`:${l}()`))&&(h+=800),m.includes(c)&&(h+=120),g.includes(c)&&(h+=140),b.includes(c)&&(h+=140),S.includes(c)&&(h+=110),r.every(C=>{let _=C.toLowerCase();return m.includes(_)||g.includes(_)||b.includes(_)||S.includes(_)})&&(h+=100+r.length*15),E&&b.includes(E.path.toLowerCase())&&(h+=360,I&&(y===I||`${y}()`===I||`${y}()`==`${I}()`)&&(h+=700),xr(e.symbol)&&(h+=180)),Tt(e.symbol)&&y===l&&(h+=60),!N&&yo(e.symbol)&&(h-=160),h-=Math.min(50,Math.max(0,e.end_line-e.start_line)),h}function di(e){let t=e.trim().replace(/\\/g,"/"),n=t.lastIndexOf("/");if(n<=0||n===t.length-1)return null;let r=t.slice(n+1).replace(/\(\)$/,"");return!r||r.includes(".")?null:{path:t.slice(0,n),leaf:r}}function On(e){return e.trim().replace(/\(\)$/,"").replace(/\(.*$/,"")}function zm(e){let t=On(e),n=t.split(/[^A-Za-z0-9_]+/).map(r=>r.trim()).filter(r=>r.length>0);return n.length>0?[...new Set(n)]:[t]}function Wm(e,t,n){let r=t.trim(),i=e.filter(a=>{let c=Oe(a.symbol),l=z(a.symbol),u=(a.display_name??"").trim();return a.symbol===r||c===r||c===n||l===r||l===n||`${l}()`===r||u===r||u===n||`${u}()`===r||Et(a,n)>1||a.relative_path===r});if(i.length===0)return[];let o=n.replace(/\(\)$/u,""),s=i.filter(a=>z(a.symbol)===o);if(s.length>0){s.sort((c,l)=>qs(c,l,n));let a=s.filter(c=>Tt(c.symbol));return a.length>0?a:s}return i.sort((a,c)=>qs(a,c,n)),i}function qs(e,t,n){return Et(t,n)-Et(e,n)||e.end_line-e.start_line-(t.end_line-t.start_line)||e.relative_path.localeCompare(t.relative_path)||e.symbol.localeCompare(t.symbol)}function Et(e,t){let n=di(t);if(!n)return 0;let r=e.relative_path.toLowerCase(),i=z(e.symbol).toLowerCase(),o=n.path.toLowerCase(),s=n.leaf.toLowerCase();return r.includes(o)?i!==s?1:xr(e.symbol)?te(e.symbol)===null?5:4:te(e.symbol)===null?3:2:0}function DE(e,t,n=5){let r=Ks(t);if(!r)return[];let i=Ue(e,{where:"1 = 1",orderBy:"d.relative_path, der.start_line",limit:5e3}),o=new Map;for(let s of i){if(e.isIgnored(s.relative_path))continue;let a=Oe(s.symbol),c=z(s.symbol),l=s.display_name??c,u=[a,c,l].filter(f=>f.trim().length>0),d=Math.min(...u.map(f=>qm(Ks(f),r))),p=o.get(a);(!p||d<p.distance)&&o.set(a,{shortName:a,distance:d})}return[...o.values()].sort((s,a)=>s.distance-a.distance||s.shortName.localeCompare(a.shortName)).slice(0,n).map(s=>s.shortName)}function Ks(e){return On(e).toLowerCase().replace(/[^a-z0-9_]+/g,"")}function qm(e,t){if(e===t)return 0;if(e.length===0)return t.length;if(t.length===0)return e.length;let n=Array.from({length:t.length+1},(r,i)=>i);for(let r=0;r<e.length;r++){let i=[r+1];for(let o=0;o<t.length;o++){let s=e[r]===t[o]?0:1;i[o+1]=Math.min(i[o]+1,n[o+1]+1,n[o]+s)}n=i}return n[t.length]}function HE(e,t){let n=Xs(e);return n?t.filter(r=>Xs(r.file)===n):t}function zE(e,t,n,r,i){let o=n.find(s=>s.file===t);if(o)return o;if(r){let s=i?.match(/^[A-Za-z_$][\w$]*/u)?.[0];if(!s)return null;let a=M(e,t),c=new Set(a.filter(p=>p.localName===s||p.importedName===s).map(p=>p.sourcePath).filter(p=>!!p));for(let p of n)for(let f of c)if(at(f,p.file))return p;let l=Km(x(e,t)??"",s);if(l.size===0)return null;let u=new Set(a.filter(p=>l.has(p.localName??p.importedName)).map(p=>p.sourcePath).filter(p=>!!p)),d=n.filter(p=>l.has(te(p.symbol)??"")&&[...u].some(f=>at(f,p.file)));return d.length===1?d[0]:null}return n.length===1?n[0]:null}function Km(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&"),r=new Set,i=[new RegExp(`\\b${n}\\s*:\\s*([A-Za-z_$][\\w$]*)`,"gu"),new RegExp(`\\b${n}\\s*=\\s*(?:new\\s+)?([A-Za-z_$][\\w$]*)\\s*\\(`,"gu")];for(let o of i)for(let s of e.matchAll(o))r.add(s[1]);return r.size===1?r:new Set}function Xs(e){let t=W(e);return t?t==="typescript"||t==="tsx"||t==="javascript"?"javascript-family":t:null}var Gm=ye("global-leaf-index",{clearGroups:["whole-project"]});function pi(e){return Gm.get(e,()=>{let t=e.all(`SELECT gs.id, gs.symbol,
227
- COALESCE(der_doc.relative_path, mention_doc.relative_path) AS relative_path
228
- FROM global_symbols gs
229
- LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
230
- LEFT JOIN documents der_doc ON der_doc.id = der.document_id
231
- LEFT JOIN (
232
- SELECT m.symbol_id, MIN(d.relative_path) AS relative_path
233
- FROM mentions m
234
- JOIN chunks c ON m.chunk_id = c.id
235
- JOIN documents d ON c.document_id = d.id
236
- WHERE m.role = 1
237
- GROUP BY m.symbol_id
238
- ) mention_doc ON mention_doc.symbol_id = gs.id
239
- WHERE 1 = 1
240
- ${e.symbolNoiseFor("gs")}`),n=new Map;for(let r of t){if(!r.relative_path||e.isIgnored(r.relative_path))continue;let i=z(r.symbol);if(!i)continue;let o=n.get(i);o||(o=[],n.set(i,o)),o.some(s=>s.symbolId===r.id)||o.push({symbol:r.symbol,symbolId:r.id,file:r.relative_path})}return n})}function Mn(e,t,n,r={}){if(!n)return[];let i=x(e,t);return i?i.indexOf(n)===-1?[]:(fi(e,t).get(n)??[]).filter(s=>!Xm(s,r)):[]}function Xm(e,t){return typeof t.excludeStartLine=="number"&&typeof t.excludeEndLine=="number"&&e>=t.excludeStartLine&&e<=t.excludeEndLine}var Jm=v("file-identifiers",{clearGroups:["whole-project","source-file"]});function Js(e,t){let n=A(e,t);return n?n.fileIdentifiers:Jm.get(e,t,()=>new Set(fi(e,t).keys()))}var Qm=v("file-ident-lines",{clearGroups:["whole-project","source-file"]});function fi(e,t){let n=A(e,t);return n?n.identifierLineMap:Qm.get(e,t,()=>Ym(e,t))}var Zm=v("file-idents-by-line",{clearGroups:["whole-project","source-file"]});function JE(e,t){let n=A(e,t);return n?n.identifiersByLine:Zm.get(e,t,()=>{let r=fi(e,t),i=0;for(let s of r.values()){let a=s[s.length-1];a!==void 0&&a>i&&(i=a)}let o=new Array(i+1);for(let s=0;s<=i;s+=1)o[s]=new Set;for(let[s,a]of r)for(let c of a)o[c].add(s);return o})}function Ym(e,t){let n=new Map,r=(a,c)=>{let l=n.get(a);if(!l){n.set(a,[c]);return}l[l.length-1]!==c&&l.push(c)},i=x(e,t);if(!i)return n;let o=Qr(i).split(/\r?\n/),s=/\b([A-Za-z_$][\w$]*)\b/g;for(let a=0;a<o.length;a+=1){let c=o[a]??"";for(let l of c.matchAll(s))l[1]&&r(l[1],a)}return n}var Qs=/[A-Za-z_$][A-Za-z0-9_$]*/g,Zs=/^[A-Za-z_$][A-Za-z0-9_$]*$/,eg=512;function mi(e){let t=[],n=!1;for(let r of e)r&&(n=!0,Zs.test(r)||t.push(r));return{candidateNames:e,hasUsableCandidate:n,nonIdentifierNames:t}}function Ys(e,t){let n=tg(t)?t:mi(t);if(n.candidateNames.size===0||!n.hasUsableCandidate)return!0;if(n.candidateNames.size<=eg){for(let i of n.candidateNames)if(i){if(Zs.test(i)){if(ng(i).test(e))return!0;continue}if(e.includes(i))return!0}return!1}Qs.lastIndex=0;let r;for(;(r=Qs.exec(e))!==null;)if(n.candidateNames.has(r[0]))return!0;for(let i of n.nonIdentifierNames)if(e.includes(i))return!0;return!1}function tg(e){return"candidateNames"in e}function ng(e){return new RegExp(`(?<![A-Za-z_$0-9])${ie(e)}(?![A-Za-z_$0-9])`)}var rg=v("source-import-paths-by-local-name",{clearGroups:["whole-project","source-file"]});function ta(e,t){let n=Wi(t);return rg.get(e,n,()=>ig(e,n))}function ig(e,t){let n=new Map;for(let r of M(e,t)){if(!r.sourcePath)continue;let i=r.localName??r.importedName;if(i&&ea(n,i,r.sourcePath),r.kind==="namespace")for(let o of r.usedMembers)ea(n,o,r.sourcePath)}return n}function ea(e,t,n){let r=e.get(t);r||(r=new Set,e.set(t,r)),r.add(n)}function gi(e,t,n){let r=pi(e).get(n);if(!r||r.length===0)return[];if(r.length===1)return[Vt(r[0])];let i=r.filter(c=>c.file===t);if(i.length>0)return i.map(Vt);let o=ta(e,t),s=o.get(n);if(s)for(let c of s){let l=r.filter(u=>at(c,u.file));if(l.length>0)return l.map(Vt)}let a=new Set;for(let c of o.values())for(let l of c)a.add(l);for(let c of a){let l=r.filter(u=>at(c,u.file));if(l.length>0&&l.length===r.length)return l.map(Vt)}return[]}function mC(e,t,n){let r=gi(e,t,n);if(r.length>0)return r;let i=pi(e).get(n);return!i||i.length===0?[]:i.map(Vt)}function na(e,t,n={}){let r=og(e,t);if(!r)return[];let i=jt(e,t);if(n.semantic!==!1&&n.semanticEvidence){let s=n.semanticEvidence.references(e,{...i,leaf:r.identifier,parentTypeName:null,isFunctionLike:!1,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null});if(s.length>0){let a=new Map;for(let c of s){let l=a.get(c.file)??[];l.push(c.line),a.set(c.file,l)}return $n(e,a)}}let o=new Map;for(let s of H(e)){let a=sg(e,r,s);a.length>0&&o.set(s,a)}return $n(e,o)}function og(e,t){let n=jt(e,t);if(!n)return null;let r=z(n.symbol);return r?{symbolId:n.symbolId,relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,identifier:r}:null}function sg(e,t,n){let r=x(e,n);return!r||r.indexOf(t.identifier)===-1?[]:n!==t.relativePath&&!gi(e,n,t.identifier).some(o=>o.symbolId===t.symbolId)?[]:Mn(e,n,t.identifier,n===t.relativePath?{excludeStartLine:t.startLine,excludeEndLine:t.endLine}:{})}function gC(e,t,n={}){let r=new Map;for(let c of t){if(!c.leaf)continue;let l=r.get(c.leaf)??[];l.push(c),r.set(c.leaf,l)}if(r.size===0)return new Map;let i=new Set(t.map(c=>c.symbolId)),o=new Set(r.keys()),s=mi(o),a=new Map;for(let c of H(e)){if(n.skipPath?.(c)||!Ys(x(e,c),s))continue;let l=Js(e,c);if(l.size!==0){for(let u of l)if(r.has(u))for(let d of gi(e,c,u)){if(!i.has(d.symbolId)||c===d.relativePath)continue;let p=a.get(d.symbolId);p||(p=new Set,a.set(d.symbolId,p)),p.add(c)}}}return a}function Vt(e){return{symbolId:e.symbolId,symbol:e.symbol,relativePath:e.file}}function $n(e,t){let n=[],r=new Set;for(let[i,o]of t){let s=F(e,i);for(let a of o){let c=vt(s,a),l=`${i}|${a}|${c?.symbol??""}`;r.has(l)||(r.add(l),n.push({file:i,line:a,enclosingSymbol:c?.symbol??null}))}}return n}function hC(e,t){return Bn(e,t,n=>{let r=n?`AND m.symbol_id IN (${n.map(()=>"?").join(",")})`:"";return e.all(`SELECT
241
- m.symbol_id,
242
- d.relative_path,
243
- COUNT(*) AS ref_count
244
- FROM mentions m
245
- JOIN chunks c ON m.chunk_id = c.id
246
- JOIN documents d ON c.document_id = d.id
247
- WHERE m.role != 1
248
- ${r}
249
- ${e.pathExclusionsFor("d")}
250
- GROUP BY m.symbol_id, d.relative_path`,...n??[])})}function SC(e,t){return Bn(e,t,n=>{let r=n?`AND m.symbol_id IN (${n.map(()=>"?").join(",")})`:"";return e.all(`SELECT DISTINCT m.symbol_id, d.relative_path
251
- FROM mentions m
252
- JOIN chunks c ON m.chunk_id = c.id
253
- JOIN documents d ON c.document_id = d.id
254
- WHERE m.role != 1
255
- ${r}
256
- ${e.pathExclusionsFor("d")}`,...n??[])}).filter(n=>n.symbol_id!==null)}function bC(e,t){return Bn(e,t,n=>{let r=n?`AND m.symbol_id IN (${n.map(()=>"?").join(",")})`:"";return e.all(`SELECT DISTINCT m.symbol_id
257
- FROM mentions m
258
- WHERE m.role != 1
259
- ${r}`,...n??[])}).filter(n=>n.symbol_id!==null)}function ra(e,t){return Bn(e,t,n=>{let r=n?`AND m.symbol_id IN (${n.map(()=>"?").join(",")})`:"";return e.all(`SELECT DISTINCT m.symbol_id, d.relative_path, c.document_id,
260
- c.start_line AS chunk_start, c.end_line AS chunk_end
261
- FROM mentions m
262
- JOIN chunks c ON m.chunk_id = c.id
263
- JOIN documents d ON c.document_id = d.id
264
- WHERE m.role != 1
265
- ${r}
266
- ${e.pathExclusionsFor("d")}
267
- ORDER BY d.relative_path, c.start_line`,...n??[])})}function Bn(e,t,n){if(!t)return n();if(t.length===0)return[];let r=[];for(let i=0;i<t.length;i+=750)r.push(...n(t.slice(i,i+750)));return r}function ag(e,t){return cg(e,[t]).get(t.symbolId)??[]}function cg(e,t){let n=t.map(o=>({symbolId:o.symbolId,prelude:fg(e,o)})).filter(o=>o.prelude!==null),r=ug(e,n.map(o=>o.symbolId)),i=new Map;for(let{symbolId:o,prelude:s}of n){let a=lg(e,r.get(o)??new Map,s.match,s.identifier);i.set(o,$n(e,a))}return i}function IC(e,t,n={}){return yi(e,t,n).map(r=>({file:r.file,line:r.line,enclosingSymbol:r.enclosingSymbol}))}function yi(e,t,n={}){let r=na(e,t,{semantic:n.semantic,semanticEvidence:n.semanticEvidence}),i=r.length>0?ia(r,"source-attribution"):ia(ag(e,t),"scip-reference-chunk");return n.includeIgnored===!0?i:i.filter(o=>!e.isIgnored(o.file))}function ia(e,t){return e.map(n=>({...n,provenance:t}))}function lg(e,t,n,r){let i=new Map;for(let[o,s]of t)i.set(o,dg(e,o,s,n,r));return i}function ug(e,t){let n=new Map;for(let r of ra(e,t)){if(e.isIgnored(r.relative_path))continue;let i=n.get(r.symbol_id);i||(i=new Map,n.set(r.symbol_id,i));let o=i.get(r.relative_path);o||(o=[],i.set(r.relative_path,o)),o.push({start_line:r.chunk_start,end_line:r.chunk_end})}return n}function dg(e,t,n,r,i){let o=t===r.relativePath?{excludeStartLine:r.startLine,excludeEndLine:r.endLine}:{},s=i?Mn(e,t,i,o):[];return n.flatMap(a=>pg(s,a))}function pg(e,t){let n=e.filter(r=>r>=t.start_line&&r<=t.end_line);return n.length>0?n:[t.start_line]}function fg(e,t){let n=jt(e,t);return n?{match:n,identifier:z(n.symbol)||null}:null}import{execFileSync as ca,spawnSync as Ng}from"child_process";import{platform as Eg}from"os";import{resolve as Cg}from"path";import{createHash as mg}from"crypto";import{existsSync as oa,renameSync as gg,rmSync as yg,writeFileSync as hg}from"fs";import{tmpdir as Sg}from"os";import{join as bg}from"path";var sa=`'use strict';
268
- const NativeRegExp = globalThis.RegExp;
269
- const escapeLoneSeparator = (args) =>
270
- typeof args[0] === 'string' && args[0] === '\\\\' ? ['\\\\\\\\', ...args.slice(1)] : args;
271
- globalThis.RegExp = new Proxy(NativeRegExp, {
272
- construct(target, args) {
273
- return Reflect.construct(target, escapeLoneSeparator(args));
274
- },
275
- apply(target, thisArg, args) {
276
- return Reflect.apply(target, thisArg, escapeLoneSeparator(args));
277
- },
278
- });
279
- `,xg=/scip-python/i;function aa(e,t=process.platform){return t!=="win32"||!xg.test(e)?[]:["--require",vg()]}function vg(e=Sg()){let t=mg("sha256").update(sa).digest("hex").slice(0,16),n=bg(e,`codebaseiq-indexer-compat-${t}.cjs`);if(oa(n))return n;let r=`${n}.${process.pid}.tmp`;hg(r,sa);try{gg(r,n)}catch{if(yg(r,{force:!0}),!oa(n))throw new Error(`could not materialize indexer compatibility preload at ${n}`)}return n}var la=Eg()==="win32";function MC(e,t=Ng){try{return t(e,["--version"],{stdio:"ignore",timeout:1e4}).status===0}catch{return!1}}function ua(e){let t=la?"where":"which";try{return ca(t,[e],{stdio:"pipe",timeout:1e4,killSignal:"SIGKILL"}),!0}catch{return!1}}var _g=/\.(?:c|m)?js$/i,Ig=/\.(?:exe|com)$/i;function $C(e,t){return _g.test(e)?{binary:process.execPath,args:[...aa(e),e,...t]}:{binary:e,args:[...t]}}function Rg(e,t){return ca(e,t,{stdio:["ignore","pipe","ignore"],windowsHide:!0,encoding:"utf8",timeout:1e4,killSignal:"SIGKILL"})}function da(e,t={}){let n=t.isWindows??la,r=t.lookup??Rg,i;try{i=r(n?"where":"which",[e])}catch{return null}let o=i.split(/\r?\n/).map(s=>s.trim()).filter(Boolean);if(!n){let s=o[0];return s?Cg(s):null}return o.find(s=>Ig.test(s))??null}import{execFileSync as fa}from"child_process";import{createHash as Fg}from"crypto";import{existsSync as jn,statSync as Tg}from"fs";import{createRequire as Pg}from"module";import{platform as wg}from"os";import{dirname as pa,join as Ut}from"path";var Lg=Pg(import.meta.url),XC={language:"rust",indexerBinary:"rust-analyzer",installUrl:"https://github.com/rust-lang/rust-analyzer"};function hi(e){return[e.indexerBinary,...e.binaryAliases??[]]}function kg(e){let t=hi(e);return t.length===1?t[0]:t.join(" or ")}function Si(e){for(let t of hi(e)){let n=da(t);if(n)return n}return Ag(e)}function JC(e){return Si(e)!==null||Dg(e)}function Dg(e){return ma(e)!==null}function Ag(e){let t=ma(e);if(!t)return null;let r=JSON.parse(st(t,"indexer package manifest")).bin;if(!r)return null;if(typeof r=="string")return Ut(pa(t),r);for(let i of hi(e)){let o=r[i];if(o)return Ut(pa(t),o)}return null}function ma(e){if(!e.bundledNpmPackage)return null;try{return Lg.resolve(`${e.bundledNpmPackage}/package.json`)}catch{return null}}function Og(e,t){for(let n of e.projectLocalBinaries??[]){let r=Ut(t,n);if(jn(r))return r}return null}function Mg(e,t){for(let n of e.projectLocalBinaries??[]){let r=Ut(t,n);if(jn(r))return ga(t,n,r)}return null}function QC(e,t){let n=$g(e,t);if(!n||n.canonicalPath!==t.canonicalPath||n.sha256!==t.sha256||n.size!==t.size||n.mtimeMs!==t.mtimeMs||n.device!==t.device||n.inode!==t.inode||n.executable!==t.executable)throw new Error(`refusing changed project-local indexer ${t.relativePath}; review the current file and rerun with --trust-project-tools`)}function $g(e,t){try{return ga(e,t.relativePath,t.configuredPath)}catch{return null}}function ga(e,t,n){let r={maxBytes:268435456,inputKind:"project-local indexer"},i=fr(e,t,r),o=mr(e,t,r),s=Tg(i.absolutePath);return{configuredPath:n,canonicalPath:i.absolutePath,relativePath:t,sha256:Fg("sha256").update(o).digest("hex"),size:i.size,mtimeMs:i.mtimeMs,device:i.device,inode:i.inode,executable:(s.mode&73)!==0}}function Bg(e,t,n={}){return(n.trustProjectTools?Mg(e,t)?.canonicalPath:null)??Si(e)}function ZC(e,t=process.env,n=e.indexerBinary){if(e.indexerBinary!=="scip-dotnet"||bi(n,t))return t;let r=ya(n,t);return r?{...t,DOTNET_ROOT:r}:t}function YC(e,t,n={}){let r=kg(e),i=t?Bg(e,t,n):Si(e);if(!i)return{language:e.language,binaryLabel:r,installed:!1,runnable:!1,resolvedBinary:null,installUrl:e.installUrl,...t&&Og(e,t)?{note:"project-local indexer available only with --trust-project-tools"}:{}};if(e.indexerBinary!=="scip-dotnet")return{language:e.language,binaryLabel:r,installed:!0,runnable:!0,resolvedBinary:i};let o=jg(i);return{language:e.language,binaryLabel:r,installed:!0,runnable:o.runnable,resolvedBinary:i,installUrl:e.installUrl,note:o.note}}function jg(e){if(bi(e,process.env))return{runnable:!0};let t=ya(e,process.env);if(t)return{runnable:!0,note:`using .NET 9 runtime from ${t}`};let n=ha(process.env);return{runnable:!1,note:n.length>0?`.NET 9 runtime still unavailable after checking ${n.join(", ")}`:"binary is present, but scip-dotnet still needs a .NET 9 runtime"}}function ya(e,t){for(let n of ha(t))if(bi(e,{...t,DOTNET_ROOT:n}))return n;return null}function ha(e){let t=[],n=e.DOTNET_ROOT;if(n&&jn(n)&&t.push(n),wg()==="darwin"&&ua("brew"))try{let r=fa("brew",["--prefix","dotnet@9"],{stdio:"pipe",windowsHide:!0,env:e,timeout:1e4,killSignal:"SIGKILL"}).toString().trim(),i=Ut(r,"libexec");jn(i)&&!t.includes(i)&&t.push(i)}catch{}return t}function bi(e,t){try{return fa(e,["--version"],{stdio:"pipe",windowsHide:!0,env:t,timeout:1e4,killSignal:"SIGKILL"}),!0}catch{return!1}}var Sa=co({kind:"file-dependency-graph",invalidation:X("file-dependency-graph"),serialize:e=>JSON.stringify(e),deserialize:Kg}),Vg=v("file-dep-graph",{clearGroups:["whole-project"]});function Vn(e,t,n={}){let r=n.scipEdges??"all-references",i=n.sourceEdges??"imports-only",o=zg(t,r,i);return Vg.get(e,o,()=>{let s=new Set(ee(e,{includeIgnored:!1})),a=We(e),c=0,l=0,u=null,d=!1,p=0,f=0;return ge("file-dep-graph.product",()=>{if(a){let S=Sa.read(e,o,a);if(S){d=!0;let b=qg(S);return c=S.sourceFileCount,l=S.sourceEdgeCount,p=S.scipEdgeCount,f=b.size,u=S.sourceDependencyFingerprint,b}}let m=ge("file-dep-graph.source-imports",()=>{let S=Ug(e,s,t,i);return c=S.files.length,l=S.edges.length,u=S.fingerprint,S},()=>({scope:t??null,sourceEdges:i,files:c,edges:l})),g=new Map,y=(S,b)=>Qg(e,g,s,S,b);ge("file-dep-graph.scip-edges",()=>{for(let S of Jg(e,t,r))p+=1,y(S.from_file,S.to_file)},()=>({scope:t??null,edges:p}));for(let S of m.edges)y(S.fromFile,S.toFile);return f=g.size,a&&Sa.write(e,o,a,{sourceDependencyFingerprint:m.fingerprint,sourceFileCount:m.files.length,sourceEdgeCount:m.edges.length,scipEdgeCount:p,graph:Wg(g)}),g},()=>({scope:t??null,available:a!==null,hit:d,files:c,sourceEdges:l,sourceEdgeMode:i,scipEdges:p,graphFiles:f,sourceDependencyFingerprint:u}))})}function Ug(e,t,n,r){let i=[],o=[];for(let s of t)if(!(n&&!s.includes(n))){i.push(s);for(let a of M(e,s))a.sourcePath&&o.push({fromFile:s,toFile:a.sourcePath});if(r==="imports-and-reexports")for(let a of Ve(e,s))a.sourcePath&&o.push({fromFile:s,toFile:a.sourcePath})}return{files:i,edges:o,fingerprint:Hg(i,o)}}function Hg(e,t){let n=t.map(r=>`${r.fromFile}\0${r.toFile}`).sort();return Ne(JSON.stringify({files:e,edges:n}))}function zg(e,t,n){return`edge-mode-v3:${t}:${n}:${e??"<all>"}`}function Wg(e){return[...e].map(([t,n])=>[t,[...n]])}function qg(e){return new Map(e.graph.map(([t,n])=>[t,new Set(n)]))}function Kg(e){let t=JSON.parse(e);return Gg(t)?t:null}function Gg(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.sourceDependencyFingerprint=="string"&&typeof t.sourceFileCount=="number"&&typeof t.sourceEdgeCount=="number"&&typeof t.scipEdgeCount=="number"&&Array.isArray(t.graph)&&t.graph.every(Xg)}function Xg(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="string"&&Array.isArray(e[1])&&e[1].every(t=>typeof t=="string")}function Jg(e,t,n){let r=t?"AND d1.relative_path LIKE ?":"",i=t?[`%${t}%`]:[],o=n==="imports-only"?"AND m.role = 2":"AND m.role != 1";return e.all(`SELECT DISTINCT
280
- d1.relative_path AS from_file,
281
- d2.relative_path AS to_file
282
- FROM mentions m
283
- JOIN chunks c ON m.chunk_id = c.id
284
- JOIN documents d1 ON c.document_id = d1.id
285
- JOIN global_symbols gs ON m.symbol_id = gs.id
286
- JOIN (
287
- SELECT m2.symbol_id, c2.document_id
288
- FROM mentions m2
289
- JOIN chunks c2 ON m2.chunk_id = c2.id
290
- WHERE m2.role = 1
291
- GROUP BY m2.symbol_id
292
- ) sym_def ON sym_def.symbol_id = gs.id
293
- JOIN documents d2 ON sym_def.document_id = d2.id
294
- WHERE d1.id != d2.id
295
- ${o}
296
- ${e.pathExclusionsFor("d1","d2")}
297
- ${r}`,...i)}function Qg(e,t,n,r,i){if(r===i||e.isIgnored(r)||e.isIgnored(i)||!n.has(i))return;let o=t.get(r);o||(o=new Set,t.set(r,o)),o.add(i)}var Zg=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function Un(e){let t=e.toLowerCase();return Zg.some(n=>t.endsWith(n))}function zn(e){let t=Hn(e.projectFiles),n=new Set(t),r=new Map(e.snapshot.files.map(d=>[d.path,d])),i=e.snapshot.files.filter(d=>{let p=Ki(d.path,["typescript"]);return p==="config"||p==="ambient"}).map(d=>d.path),o=Hn([...t,...i]),s=o.find(d=>!r.has(d)),a=new Set(e.snapshot.files.map(d=>d.path)).size!==e.snapshot.files.length,c=!s&&o.some(d=>ba(r.get(d))),l=Ne(JSON.stringify({pnpmWorkspaces:e.snapshot.pnpmWorkspaces,typescriptProjectMode:e.snapshot.typescriptProjectMode,typescriptProjects:Hn(e.snapshot.typescriptProjects),membership:t})),u=new Map;return{identityFor(d,p){if(!n.has(d))return Ct("target-outside-project");if(a)return Ct("duplicate-input-path");if(s)return Ct("missing-input-fingerprint");if(c)return Ct("unreadable-input");let f=[],m,g;if(e.graph===null)f.push("dependency-graph-unavailable"),g="whole-project",m=o;else{let b=ey(d,e.graph,u);if(b.find(E=>!r.has(E)))return Ct("missing-input-fingerprint");if(m=Hn([...b,...i]),m.some(E=>ba(r.get(E))))return Ct("unreadable-input");g="dependency-closure"}let y=m.map(b=>ty(r.get(b)));return{version:1,key:Ne(JSON.stringify({version:1,engineIdentity:e.engineIdentity,schemaVersion:p,projectIdentity:l,inputs:y})),mode:g,inputFiles:m,reasons:f}}}}function Yg(e,t){let n=new Set,r=[e];for(let i=0;i<r.length;i+=1){let o=r[i];if(!(o===void 0||n.has(o))){n.add(o);for(let s of[...t.get(o)??[]].sort())n.has(s)||r.push(s)}}return[...n].sort()}function ey(e,t,n){let r=n.get(e);if(r)return r;let i=Yg(e,t);return n.set(e,i),i}function ty(e){return{path:e.path,size:e.size,hash:e.hash}}function ba(e){return e.size<0||e.hash==="unreadable"}function Ct(e){return{version:1,key:null,mode:"unkeyed",inputFiles:[],reasons:[e]}}function Hn(e){return[...new Set(e)].sort()}import{createRequire as ny}from"module";var xa=ny(import.meta.url),Ht,Wn;function ry(){if(Ht!==void 0)return Ht;try{Ht=xa("ts-morph")}catch{Ht=null}return Ht}function qn(){if(Wn)return Wn;let e=ry();if(!e)return"ts-morph:unavailable";let t="unknown";try{t=xa("ts-morph/package.json").version??"unknown"}catch{}return Wn=`ts-morph:${t}:typescript:${e.ts.version}`,Wn}function f_(e,t){return t.map(n=>({tsconfigPath:n,project:new e.Project({tsConfigFilePath:n,skipFileDependencyResolution:!0})}))}function m_(e,t,n){return{language:"typescript",availability:()=>({available:!1,reason:e,tsconfigPath:t,tsconfigPaths:n}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}var iy=ye("typescript-semantic-identity-context",{clearGroups:["whole-project"]});function xi(e,t,n){let r=iy.get(e,()=>oy(e));if(!r)return null;let i=`${n}\0${t}`,o=r.identities.get(i);if(o)return o;let s=r.builder.identityFor(t,n);return r.identities.set(i,s),s}function zt(e){return ee(e,{includeIgnored:!1}).filter(Un).sort()}function oy(e){try{if(!e.generation.metadataRaw)return null;let t=sn(e.generation.metadataRaw);if(t.kind!=="legacy"&&t.kind!=="supported"||!t.capabilities.usableForEvidenceCache)return null;let n=Gi(t.metadata.fingerprint);return n?{builder:zn({projectFiles:zt(e),snapshot:n,graph:Vn(e),engineIdentity:qn()}),identities:new Map}:null}catch{return null}}function Kn(e,t){let n=new Map(e.map(i=>[i.symbol,i])),r=new Map(e.map(i=>[i.symbolId,[]]));for(let i of t.values())for(let o of i){let s=n.get(o.targetSymbol);s&&r.get(s.symbolId).push(o.location)}for(let[i,o]of r)r.set(i,sy(o));return r}function Ea(e,t,n){let r=Na(e,t),i=Na(e,n),o=[...r].filter(d=>!i.has(d)).sort(),s=[...i].filter(d=>!r.has(d)).sort(),a=va(e,t),c=va(e,n),l=[...a].filter(d=>!c.has(d)).sort(),u=[...c].filter(d=>!a.has(d)).sort();return{passed:o.length===0&&s.length===0,expectedCount:r.size,actualCount:i.size,missing:o,extra:s,callerFiles:{passed:l.length===0&&u.length===0,expectedCount:a.size,actualCount:c.size,missing:l,extra:u}}}function va(e,t){let n=new Set;for(let r of e)for(let i of t.get(r.symbolId)??[])i.file!==r.relativePath&&n.add(`${r.symbol}\0${i.file}`);return n}function __(e,t,n){let r=new Set(n),i=new Map(n.map(o=>[o,[]]));for(let o of e)for(let s of t.get(o.symbolId)??[])r.has(s.file)&&i.get(s.file).push({targetSymbol:o.symbol,location:s});for(let[o,s]of i)i.set(o,ay(s));return i}function Na(e,t){let n=new Set;for(let r of e)for(let i of t.get(r.symbolId)??[])n.add(`${r.symbol}\0${i.file}\0${i.line}\0${i.column}`);return n}function sy(e){let t=new Map;for(let n of e)t.set(`${n.file}\0${n.line}\0${n.column}`,n);return[...t.values()].sort(Ca)}function ay(e){let t=new Map;for(let n of e){let{location:r}=n;t.set(`${n.targetSymbol}\0${r.file}\0${r.line}\0${r.column}`,n)}return[...t.values()].sort((n,r)=>n.targetSymbol.localeCompare(r.targetSymbol)||Ca(n.location,r.location))}function Ca(e,t){return e.file.localeCompare(t.file)||e.line-t.line||e.column-t.column}var vi="typescript-reference-fragment-v3-incomplete-scan",Gn=le({kind:"typescript-reference-fragments",invalidation:X("typescript-reference-fragments"),serialize:e=>JSON.stringify(e),deserialize:ly});function A_(e,t,n,r=e){let i=zt(e),o=zn({projectFiles:i,snapshot:t,graph:Vn(e),engineIdentity:qn()}),s=[...n].map(([a,c])=>({relativePath:a,contentHash:o.identityFor(a,vi).key,value:[...c]}));if(s.some(a=>a.contentHash===null))throw new Error("TypeScript reference fragment identity is unavailable for an affected document.");return Gn.writeBatch(r,s.map(a=>({...a,contentHash:a.contentHash}))),s.length}function O_(e,t,n,r){let i=t.filter(s=>Un(s.relativePath));if(i.length===0)return Wt("no TypeScript definitions");let o=Wt("shadow did not run");return ge("typescript.reference-fragments.shadow",()=>{try{let s=r(i[0].relativePath);if(!s.availability().available||!s.referenceFragmentsForFiles)return o=Wt("TypeScript reference fragment provider is unavailable"),o;let a=zt(e),c=new Set(a),l=s.referenceFragmentsForFiles(a),u=a.filter(m=>!l.has(m));if(u.length>0)return o=Wt(`TypeScript reference lookup was incomplete for ${u.length} file(s)`),o;let d=Kn(i,l),p=Ea(i,cy(n,c),d);if(!p.passed)return o={state:"failing",files:a.length,keyedFiles:0,writtenFiles:0,...p},o;let f=[];for(let m of a){let g=xi(e,m,vi);g?.key&&f.push({relativePath:m,contentHash:g.key,value:l.get(m)??[]})}return Gn.writeBatch(e,f),o={state:"passing",files:a.length,keyedFiles:f.length,writtenFiles:f.length,...p},o}catch(s){return o=Wt(s instanceof Error?s.message:String(s)),o}},()=>({...o}))}function cy(e,t){return new Map([...e].map(([n,r])=>[n,r.filter(i=>t.has(i.file))]))}function M_(e,t,n){if(t.length===0)return{references:new Map,files:0,cacheHits:0,cacheMisses:0,computedFiles:0};let r="fallback",i=0,o=0,s=0,a=0;return ge("typescript.reference-fragments.materialize",()=>{try{let c=zt(e);i=c.length;let l=new Map,u=new Map,d=[];for(let m of c){let g=xi(e,m,vi);if(!g?.key)return null;l.set(m,g.key);let y=Gn.read(e,m,g.key);y===null?(s+=1,d.push(m)):(o+=1,u.set(m,y))}if(s===0)return r="hit",{references:Kn(t,u),files:i,cacheHits:o,cacheMisses:s,computedFiles:a};let p=n(t[0].relativePath);if(!p.availability().available||!p.referenceFragmentsForFiles)return null;let f=p.referenceFragmentsForFiles(d);if(d.some(m=>!f.has(m)))return null;a=f.size,Gn.writeBatch(e,d.map(m=>({relativePath:m,contentHash:l.get(m),value:f.get(m)??[]})));for(let[m,g]of f)u.set(m,g);return r="computed",{references:Kn(t,u),files:i,cacheHits:o,cacheMisses:s,computedFiles:a}}catch{return null}},()=>({state:r,files:i,cacheHits:o,cacheMisses:s,computedFiles:a}))}function Wt(e){return{state:"unavailable",files:0,keyedFiles:0,writtenFiles:0,expectedCount:0,actualCount:0,missing:[],extra:[],reason:e}}function ly(e){try{let t=JSON.parse(e);return!Array.isArray(t)||!t.every(uy)?null:t}catch{return null}}function uy(e){if(!e||typeof e!="object")return!1;let t=e,n=t.location;return typeof t.targetSymbol=="string"&&!!n&&typeof n.file=="string"&&typeof n.line=="number"&&typeof n.column=="number"}import{spawn as my}from"child_process";import{platform as Aa}from"os";import{performance as Oa}from"perf_hooks";import{execFileSync as Ra}from"child_process";import{platform as dy}from"os";var Fa=1e3,Ta=2*1024*1024,py=25;function Pa(e,t,n=Da){let r=n.readIdentity(e),i=new Map;return r&&i.set(e,r),{rootPid:e,rootIdentity:r,ownsProcessGroup:t,knownMembers:i}}async function wa(e,t,n=Da){if(!e.rootIdentity){let c=await qt(e,t.gracefulMs+t.forceMs,n);return{reaped:c,reason:c?"terminated":"identity-unavailable",detail:c?void 0:`Could not establish the birth identity of process ${e.rootPid}.`}}let r=La(e,n);if(r==="mismatch")return{reaped:!1,reason:"identity-mismatch",detail:`Process ${e.rootPid} no longer has the identity owned by this runner.`};if(r==="exited"&&!ka(e,n))return{reaped:!0,reason:"terminated"};if(n.platform==="win32"){try{n.terminateWindowsTree(e.rootPid)}catch(l){let u=await qt(e,t.forceMs,n);return{reaped:u,reason:u?"terminated":"signal-failed",detail:u?void 0:Ni(l)}}let c=await qt(e,t.forceMs,n);return{reaped:c,reason:c?"terminated":"deadline"}}let i=_a(e,"SIGTERM",n);if(await qt(e,t.gracefulMs,n))return{reaped:!0,reason:"terminated"};let s=_a(e,"SIGKILL",n);return await qt(e,t.forceMs,n)?{reaped:!0,reason:"terminated"}:s?{reaped:!1,reason:s.reason,detail:s.detail}:i?{reaped:!1,reason:i.reason,detail:i.detail}:{reaped:!1,reason:"deadline",detail:`Process tree ${e.rootPid} did not exit before its termination deadline.`}}function La(e,t){let n=t.readIdentity(e.rootPid);if(!n)return"exited";if(!e.rootIdentity||!on(e.rootIdentity,n))return"mismatch";e.knownMembers.set(e.rootPid,n);for(let r of t.listDescendantPids(e.rootPid)){let i=t.readIdentity(r);i&&e.knownMembers.set(r,i)}return"owned"}function _a(e,t,n){let r=La(e,n);if(r==="mismatch")return{reason:"identity-mismatch",detail:`Process ${e.rootPid} changed identity before ${t}.`};if(r==="owned"&&e.ownsProcessGroup)try{return n.signal(-e.rootPid,t),null}catch(o){if(!Ia(o))return{reason:"signal-failed",detail:Ni(o)}}let i=null;for(let o of e.knownMembers.values()){let s=n.readIdentity(o.pid);if(!(!s||!on(o,s)))try{n.signal(o.pid,t)}catch(a){!Ia(a)&&i===null&&(i=Ni(a))}}return i===null?null:{reason:"signal-failed",detail:i}}async function qt(e,t,n){let r=n.now()+t;for(;ka(e,n);){if(n.now()>=r)return!1;await n.sleep(Math.min(py,Math.max(1,r-n.now())))}return!0}function ka(e,t){if(!e.rootIdentity&&t.isProcessAlive(e.rootPid))return!0;for(let n of e.knownMembers.values()){let r=t.readIdentity(n.pid);if(r&&on(n,r))return!0}return!!(e.ownsProcessGroup&&t.isProcessGroupAlive(e.rootPid))}function fy(e){let t=Ra("ps",["-axo","pid=,ppid="],{encoding:"utf8",timeout:Fa,maxBuffer:Ta,env:{...process.env,LC_ALL:"C",LANG:"C"},stdio:["ignore","pipe","ignore"],windowsHide:!0}),n=new Map;for(let s of t.split(/\r?\n/)){let a=/^\s*(\d+)\s+(\d+)\s*$/.exec(s);if(!a)continue;let c=Number(a[1]),l=Number(a[2]),u=n.get(l)??[];u.push(c),n.set(l,u)}let r=[],i=[...n.get(e)??[]],o=new Set;for(;i.length>0;){let s=i.pop();o.has(s)||(o.add(s),r.push(s),i.push(...n.get(s)??[]))}return r}function Ia(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="ESRCH"}function Ni(e){return e instanceof Error?e.message:String(e)}var Da={platform:dy(),now:Date.now,readIdentity:zi,isProcessAlive(e){try{return process.kill(e,0),!0}catch(t){return typeof t=="object"&&t!==null&&"code"in t&&t.code==="EPERM"}},isProcessGroupAlive(e){if(this.platform==="win32")return!1;try{return process.kill(-e,0),!0}catch(t){return typeof t=="object"&&t!==null&&"code"in t&&t.code==="EPERM"}},listDescendantPids(e){if(this.platform==="win32")return[];try{return fy(e)}catch{return[]}},signal(e,t){process.kill(e,t)},terminateWindowsTree(e){Ra("taskkill.exe",["/PID",String(e),"/T","/F"],{timeout:Fa,maxBuffer:Ta,stdio:"ignore",windowsHide:!0})},async sleep(e){await new Promise(t=>setTimeout(t,e))}};var K_={probe:1e4,git:3e4,analysis:18e4,install:3e5,indexer:6e5},Gt=class extends Error{constructor(n,r,i,o={}){super(i,o.cause===void 0?void 0:{cause:o.cause});this.kind=n;this.label=r;this.name="BoundedProcessError",this.timedOut=o.timedOut??!1,this.reaped=o.reaped??!1,this.stdout=o.stdout??"",this.stderr=o.stderr??"",this.stdoutTruncated=o.stdoutTruncated??!1,this.stderrTruncated=o.stderrTruncated??!1}kind;label;timedOut;reaped;stdout;stderr;stdoutTruncated;stderrTruncated};function Kt(e,t){if(!Number.isFinite(e)||e<=0)throw new TypeError(`${t} must be a positive finite number.`)}function Ma(e,t,n,r){let i=Math.max(0,r-n);i>0&&e.push(t.subarray(0,i))}function $a(e,t,n){let r=Buffer.concat([...e,t]);e.length=0,e.push(r.subarray(Math.max(0,r.length-n)))}function G_(e){Kt(e.timeoutMs,"timeoutMs"),Kt(e.maxStdoutBytes,"maxStdoutBytes"),Kt(e.maxStderrBytes,"maxStderrBytes");let t=e.terminationGraceMs??1e3;Kt(t,"terminationGraceMs");let n=e.terminationForceMs??t;return Kt(n,"terminationForceMs"),new Promise((r,i)=>{let o=Oa.now(),s;try{let h=Aa()!=="win32";s=my(e.command,[...e.args??[]],{cwd:e.cwd,env:e.env,detached:h?!0:e.detached,stdio:["pipe","pipe","pipe"],windowsHide:!0})}catch(h){i(new Gt("spawn",e.label,`${e.label} could not start.`,{cause:h,reaped:!0}));return}let a=[],c=[],l=0,u=0,d=!1,p=!1,f=null,m=!1,g=Aa()!=="win32",y=s.pid===void 0?null:Pa(s.pid,g),S=()=>{clearTimeout(E),e.signal?.removeEventListener("abort",I)},b=h=>{if(m||!f)return;m=!0,S();let C=Buffer.concat(a).toString("utf8"),_=Buffer.concat(c).toString("utf8"),k=h.reaped||!h.detail?"":` Process-tree cleanup failed: ${h.detail}`;i(new Gt(f.kind,e.label,`${f.message}${k}`,{timedOut:f.timedOut,reaped:h.reaped,stdout:C,stderr:_,stdoutTruncated:d,stderrTruncated:p}))},N=h=>{if(!(f||m)){if(f=h,!y){b({reaped:s.pid===void 0,reason:s.pid===void 0?"terminated":"identity-unavailable"});return}wa(y,{gracefulMs:t,forceMs:n}).then(b,C=>{b({reaped:!1,reason:"signal-failed",detail:C instanceof Error?C.message:String(C)})})}},E=setTimeout(()=>{N({kind:"timeout",timedOut:!0,message:`${e.label} timed out after ${e.timeoutMs}ms.`})},e.timeoutMs);E.unref();let I=()=>{N({kind:"aborted",timedOut:!1,message:`${e.label} was cancelled.`})};e.signal?.addEventListener("abort",I,{once:!0}),e.signal?.aborted&&I(),s.stdout.on("data",h=>{let C=Buffer.isBuffer(h)?h:Buffer.from(h);e.outputLimitBehavior==="truncate-tail"?$a(a,C,e.maxStdoutBytes):Ma(a,C,l,e.maxStdoutBytes),l+=C.length,l>e.maxStdoutBytes&&(d=!0,e.outputLimitBehavior!=="truncate-tail"&&N({kind:"stdout-limit",timedOut:!1,message:`${e.label} exceeded stdout limit (${e.maxStdoutBytes} bytes).`}))}),s.stderr.on("data",h=>{let C=Buffer.isBuffer(h)?h:Buffer.from(h);e.outputLimitBehavior==="truncate-tail"?$a(c,C,e.maxStderrBytes):Ma(c,C,u,e.maxStderrBytes),u+=C.length,u>e.maxStderrBytes&&(p=!0,e.outputLimitBehavior!=="truncate-tail"&&N({kind:"stderr-limit",timedOut:!1,message:`${e.label} exceeded stderr limit (${e.maxStderrBytes} bytes).`}))}),s.on("error",h=>{if(!m&&!f){if(s.pid===void 0){S(),m=!0,i(new Gt("spawn",e.label,`${e.label} could not start: ${h.message}`,{cause:h,reaped:!0}));return}N({kind:"spawn",timedOut:!1,message:`${e.label} failed after start: ${h.message}`})}}),s.on("close",(h,C)=>{if(m||f)return;m=!0,S();let _=Buffer.concat(a).toString("utf8"),k=Buffer.concat(c).toString("utf8");r({status:h,signal:C,stdout:_,stderr:k,timedOut:!1,durationMs:Oa.now()-o,stdoutTruncated:d,stderrTruncated:p})}),e.input===void 0?s.stdin.end():s.stdin.end(e.input)})}function Ba(e){let t=D(e);return gy(t)?"test":yy(t)?"worker":hy(t)?"entry":Sy(t)?"barrel":"source"}function gy(e){return!!(/\.(?:test|spec)\.[a-z0-9]+$/i.test(e)||/(?:^|\/)(?:_)?test_[^/]+$/i.test(e)||/(?:^|\/)spec_[^/]+$/i.test(e)||/(?:^|\/)[^/]+_test\.[a-z0-9]+$/i.test(e)||/(?:^|\/)[^/]+_tests\.rs$/i.test(e)||/(?:^|\/)tests\.rs$/i.test(e)||/(?:^|\/)[^/]+_spec\.[a-z0-9]+$/i.test(e)||/(?:^|\/)__tests__\//i.test(e)||/(?:^|\/)test\//i.test(e)||/(?:^|\/)tests\//i.test(e)||/(?:^|\/)__fixtures__\//i.test(e)||/(?:^|\/)__mocks__\//i.test(e)||/(?:^|\/)test-support\//i.test(e)||/(?:^|\/)test-utils\//i.test(e)||/(?:^|\/)testing\//i.test(e))}function yy(e){return/(?:^|\/)[^/]*worker\.(?:ts|tsx|js|mjs|cjs|rs|py|go)$/.test(e)}function hy(e){let t=e.split("/"),n=t[t.length-1]??e;return n==="cli.ts"||n==="cli.js"||n==="postinstall.ts"||n==="postinstall.js"||n==="main.ts"||n==="main.js"||n==="main.rs"||n==="main.go"||n==="main.py"||n==="build.rs"||n==="lib.rs"||/\bsrc\/bin\/[^/]+\.rs$/.test(e)||/(?:^|\/)examples\/[^/]+\.rs$/.test(e)||/(?:^|\/)tests\/[^/]+\.rs$/.test(e)||/(?:^|\/)benches\/[^/]+\.rs$/.test(e)?!0:n==="index.ts"||n==="index.js"?/(?:^|\/)(?:apps|services)\/[^/]+\/src\/index\.(?:ts|js)$/.test(e)?!0:t.length<=2:!1}function Sy(e){return e==="index.ts"||e==="index.js"||e.endsWith("/index.ts")||e.endsWith("/index.js")||e.endsWith("/mod.rs")||e.endsWith("/__init__.py")}var by=4;function nt(e,t,n,r={}){return ja(e,t,n,r.maxReexportDepth??by,0,new Set)}function ja(e,t,n,r,i,o){let s=`${t}\0${n}`;if(o.has(s)||i>r)return[];o.add(s);let a=F(e,t).filter(c=>c.leaf===n);return a.length>0?a:Ve(e,t).flatMap(c=>c.sourcePath?c.kind==="named"&&!c.names.includes(n)?[]:ja(e,c.sourcePath,n,r,i+1,new Set(o)):[])}import{createHash as _c}from"crypto";import{createHash as $y}from"crypto";var Xn=8;function _t(e,t,n){return Ri(Va(e,t,_i(n),0,new Set))}function Ii(e,t,n){return Ei(e,t,n,0,new Set)}function Va(e,t,n,r,i){if(r>Xn)return[];let o=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(n);return o?Ua(e,t,o[1],o[2],r,i):/^[A-Za-z_$][\w$]*$/u.test(n)?Ha(e,t,n,r,i):[]}function Ua(e,t,n,r,i,o){let s=[];for(let a of Ei(e,t,n,i+1,new Set(o))){let c=Cy(a.initializer);for(let l of c.namedChildren){if(l.type==="pair"){let u=l.childForFieldName("key")??l.namedChild(0);if(_y(u)!==r)continue;let d=l.childForFieldName("value")??l.namedChild(1);d&&s.push(...Va(e,a.definition.relativePath,_i(d.text),i+1,new Set(o)));continue}if(/(?:method|function)/u.test(l.type)){if((l.childForFieldName("name")??l.namedChild(0))?.text!==r)continue;let d=Ny(e,a.definition.relativePath,r,l);s.push(...d.length>0?d:[xy(a.definition,r,l)]);continue}if(l.type==="spread_element"){let u=l.namedChild(0);if(!u)continue;for(let d of Ei(e,a.definition.relativePath,_i(u.text),i+1,new Set(o)))s.push(...Ua(e,d.definition.relativePath,d.definition.leaf,r,i+1,new Set(o)))}}}return Ri(s)}function xy(e,t,n){return{documentId:e.documentId,symbolId:-1,symbol:`source-callable:${e.relativePath}:${n.startPosition.row}:${t}`,relativePath:e.relativePath,startLine:n.startPosition.row,startChar:n.startPosition.column,endLine:n.endPosition.row,endChar:n.endPosition.column,leaf:t,parentTypeName:e.leaf,isFunctionLike:!0,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:e.symbol}}function Ei(e,t,n,r,i){return r>Xn||!/^[A-Za-z_$][\w$]*$/u.test(n)?[]:Ha(e,t,n,r,i).flatMap(o=>{let s=R(e,o.relativePath)?.rootNode,a=s?Ey(s,o.leaf):null;return a?[{definition:o,initializer:a}]:[]})}function Ha(e,t,n,r,i){if(r>Xn)return[];let o=`${t}\0${n}`;if(i.has(o))return[];i.add(o);let s=F(e,t).filter(l=>l.leaf===n);if(s.length>0)return s;let a=vy(e,t,n);if(a.length>0)return a;let c=M(e,t).find(l=>l.localName===n&&l.sourcePath);if(c?.sourcePath){let l=c.kind==="namespace"||c.importedName==="default"?n:c.importedName;return Ci(e,c.sourcePath,l,r+1,new Set(i))}return Ci(e,t,n,r+1,new Set(i))}function vy(e,t,n){let r=e.get("SELECT id FROM documents WHERE relative_path = ?",t)?.id;return r===void 0?[]:(A(e,t)?.callables??[]).filter(i=>i.name===n).map(i=>({documentId:r,symbolId:-1,symbol:`source-callable:${t}:${i.startLine}:${n}`,relativePath:t,startLine:i.startLine,startChar:0,endLine:i.endLine,endChar:0,leaf:n,parentTypeName:null,isFunctionLike:!0,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null}))}function Ci(e,t,n,r,i){if(r>Xn)return[];let o=F(e,t).filter(s=>s.leaf===n);return o.length>0?o:Ri(Ve(e,t).flatMap(s=>s.sourcePath?s.kind==="named"&&!s.names.includes(n)?[]:Ci(e,s.sourcePath,n,r+1,new Set(i)):[]))}function Ny(e,t,n,r){return F(e,t).filter(i=>i.leaf===n&&i.startLine<=r.startPosition.row&&i.endLine>=r.endPosition.row)}function Ey(e,t){let n=null;return za(e,r=>{n||r.type!=="variable_declarator"||(r.childForFieldName("name")??r.namedChild(0))?.text.trim()!==t||(n=r.childForFieldName("value")??r.namedChild(1))}),n}function Cy(e){let t=e;for(;["as_expression","satisfies_expression","type_assertion","parenthesized_expression"].includes(t.type)&&t.namedChildren.length>0;)t=t.namedChildren[0];return t}function _y(e){return e?.text.replace(/^['"`]|['"`]$/gu,"")??null}function _i(e){return e.replace(/\s+/gu,"").replace(/^\.\.\./u,"")}function Ri(e){return[...new Map(e.map(t=>[t.symbol,t])).values()]}function za(e,t){t(e);for(let n of e.namedChildren)za(n,t)}function Jn(e){let t=e.replaceAll("\\","/");return Ba(t)==="test"?/(?:^|\/)__fixtures__\//iu.test(t)?"fixture":"test":/(?:^|\/)(?:fixtures?|testdata)\//iu.test(t)?"fixture":/(?:^|\/)(?:examples?|demos?|previews?)\//iu.test(t)?"example":/(?:^|\/)(?:generated|dist|build|coverage)\//iu.test(t)||/\.generated\./iu.test(t)?"generated":/^(?:scripts?|tools?)\//iu.test(t)?"script":"production"}var Iy=8;function fe(e,t){return t?It(e,t,0,new Set):null}function It(e,t,n,r){if(n>Iy)return xe(t,"value-evaluation-depth");let i=qa(t),o=Ly(i);if(o)return ky(e.file,i,o.term,o.value,o.precision);if(i.type==="binary_expression"&&/\+/u.test(i.text)){let c=i.namedChildren.map(l=>It(e,l,n+1,new Set(r)));if(c.length>=2&&c.every(l=>l!==null)){let l={kind:"concat",parts:c.map(d=>d.term)},u=c.map(d=>d.value).join("");return Dy(e.file,i,l,u,c.some(d=>d.precision!=="literal")?"constrained-pattern":"literal",c)}}let s=i.text.trim();if(/^[A-Za-z_$][\w$]*$/u.test(s))return Py(e,s,i,n,r);let a=Ay(i);return a?wy(e,a.base,a.properties,i,n,r):i.type==="call_expression"||i.type==="call"?Ry(e,i,n,r):xe(i,`unsupported-expression:${i.type}`)}function Ry(e,t,n,r){let o=(t.childForFieldName("function")??t.namedChild(0))?.text.replace(/\s+/gu,"").replace(/<.*>$/u,"")??"",s=Fy(e,o);if(s.length!==1)return xe(t,s.length===0?"call-target-unresolved":"call-target-ambiguous");let a=s[0],c=`${a.relativePath}\0${a.symbol}`;if(r.has(c))return xe(t,"call-return-cycle");let l=R(e.db,a.relativePath)?.rootNode;if(!l)return xe(t,"call-target-unparsed");let u=My(l,a.startLine,a.endLine);if(!u)return xe(t,"call-target-syntax-unavailable");let d=Ty(u);if(!d)return xe(t,"call-return-not-single-expression");let p=new Set(r);p.add(c);let f=It({db:e.db,file:a.relativePath,root:l},d,n+1,p);return f?Qn(t,"bounded-call-return",f,a.symbol):xe(t,"call-return-unresolved")}function Fy(e,t){if(/^[A-Za-z_$][\w$]*$/u.test(t)){let i=F(e.db,e.file).filter(s=>s.isFunctionLike&&s.leaf===t);if(i.length>0)return i;let o=M(e.db,e.file).find(s=>s.localName===t&&s.sourcePath&&s.kind!=="namespace");return o?.sourcePath?nt(e.db,o.sourcePath,o.importedName==="default"?t:o.importedName).filter(s=>s.isFunctionLike):[]}let n=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(t);if(!n)return[];let r=M(e.db,e.file).find(i=>i.kind==="namespace"&&i.localName===n[1]&&i.sourcePath);return r?.sourcePath?nt(e.db,r.sourcePath,n[2]).filter(i=>i.isFunctionLike):[]}function Ty(e){let t=e.childForFieldName("body");if(e.type==="arrow_function"&&t&&t.type!=="statement_block")return t;let n=[];return Wa(t??e,t??e,n),n.length!==1?null:n[0].childForFieldName("argument")??n[0].namedChild(0)}function Wa(e,t,n){if(!(t!==e&&(/(?:function|method|lambda)/u.test(t.type)||t.type==="arrow_function"))){if(t.type==="return_statement"){n.push(t);return}for(let r of t.namedChildren)Wa(e,r,n)}}function Py(e,t,n,r,i){let o=`${e.file}\0${t}`;if(i.has(o))return xe(n,"value-cycle");i.add(o);let s=Fi(e.root,t);if(s){let m=It(e,s,r+1,i);return m?Qn(n,"local-constant",m):xe(n,"non-foldable-local")}let a=M(e.db,e.file).find(m=>m.localName===t&&m.sourcePath);if(!a?.sourcePath)return pe(n,t,"unresolved-identifier");if(a.kind==="namespace")return pe(n,t,"namespace-import-requires-property");let c=a.importedName==="default"?t:a.importedName,l=nt(e.db,a.sourcePath,c);if(l.length!==1)return pe(n,t,l.length===0?"import-definition-missing":"import-definition-ambiguous");let u=l[0],d=R(e.db,u.relativePath)?.rootNode;if(!d)return pe(n,u.symbol,"import-definition-unparsed");let p=Fi(d,u.leaf);if(!p)return pe(n,u.symbol,"import-definition-non-value");let f=It({db:e.db,file:u.relativePath,root:d},p,r+1,i);return f?Qn(n,"imported-constant",f,u.symbol):pe(n,u.symbol,"import-value-unresolved")}function wy(e,t,n,r,i,o){let s=M(e.db,e.file).find(f=>f.localName===t&&f.sourcePath),a=e.file,c=t,l;if(s?.sourcePath){s.kind==="namespace"?(c=n[0]??"",n=n.slice(1)):c=s.importedName==="default"?t:s.importedName;let f=nt(e.db,s.sourcePath,c);if(f.length!==1)return pe(r,`${t}.${n.join(".")}`,f.length===0?"member-definition-missing":"member-definition-ambiguous");a=f[0].relativePath,c=f[0].leaf,l=f[0].symbol}let u=a===e.file?e.root:R(e.db,a)?.rootNode;if(!u)return pe(r,l??t,"member-definition-unparsed");let d=Fi(u,c);if(!d)return pe(r,l??t,"member-base-non-value");for(let f of n){let m=qa(d);if(d=Oy(m,f),!d)return pe(r,l??`${t}.${n.join(".")}`,`member-property-missing:${f}`)}let p=It({db:e.db,file:a,root:u},d,i+1,o);return p?Qn(r,"member-constant",p,l):pe(r,l??t,"member-value-unresolved")}function Ly(e){let t=e.text.trim(),n=t[0];if(n!=="'"&&n!=='"'&&n!=="`"||t.at(-1)!==n)return null;let r=t.slice(1,-1);if(n!=="`"||!r.includes("${"))return{term:{kind:"literal",value:r},value:r,precision:"literal"};let i=[],o=0,s=/\$\{([^}]*)\}/gu;for(let a of r.matchAll(s)){let c=a.index??0;c>o&&i.push({kind:"literal",value:r.slice(o,c)}),i.push({kind:"unknown",reason:`template-hole:${a[1]?.trim()||"expression"}`}),o=c+a[0].length}return o<r.length&&i.push({kind:"literal",value:r.slice(o)}),{term:{kind:"pattern",language:"template",value:r.replace(s,"{}")},value:r.replace(s,"{}"),precision:"constrained-pattern"}}function ky(e,t,n,r,i){return{value:r,evidence:"literal",term:n,precision:i,derivation:Zn("direct-literal","direct",e,t)}}function Dy(e,t,n,r,i,o){return{value:r,evidence:"constant",term:n,precision:i,derivation:{...Zn("constant-concatenation","mechanically-derived",e,t),inputFactIds:o.flatMap(s=>s.derivation.inputFactIds),sourceSpans:o.flatMap(s=>s.derivation.sourceSpans)}}}function Qn(e,t,n,r){return n.evidence==="expression"?{...n,derivation:{kind:"heuristic",rule:t,ruleVersion:"1",inputFactIds:[...n.derivation.inputFactIds,...r?[r]:[]],sourceSpans:n.derivation.sourceSpans}}:{...n,evidence:"constant",derivation:{kind:"mechanically-derived",rule:t,ruleVersion:"1",inputFactIds:[...n.derivation.inputFactIds,...r?[r]:[]],sourceSpans:n.derivation.sourceSpans}}}function pe(e,t,n){return{value:e.text.trim(),evidence:"expression",term:{kind:"symbol",symbol:t},precision:"symbolic",derivation:Zn(n,"heuristic","",e)}}function xe(e,t){return{value:e.text.trim(),evidence:"expression",term:{kind:"unknown",reason:t},precision:"unknown",derivation:Zn(t,"heuristic","",e)}}function Zn(e,t,n,r){return{kind:t,rule:e,ruleVersion:"1",inputFactIds:[],sourceSpans:n?[{file:n,startLine:r.startPosition.row,endLine:r.endPosition.row}]:[]}}function Ay(e){let t=e.text.replace(/\s+/gu,"");if(!/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)+$/u.test(t))return null;let[n,...r]=t.split(".");return n?{base:n,properties:r}:null}function Fi(e,t){let n=null;return Ti(e,r=>{if(n||r.type!=="variable_declarator"||(r.childForFieldName("name")??r.namedChild(0))?.text.trim()!==t)return;let o=r.parent;!o||o.type!=="lexical_declaration"||!/^\s*(?:export\s+)?const\b/u.test(o.text)||(n=r.childForFieldName("value")??r.namedChild(1))}),n}function Oy(e,t){for(let n of e.namedChildren)if(!(n.type!=="pair"||(n.childForFieldName("key")??n.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"")!==t))return n.childForFieldName("value")??n.namedChild(1);return null}function qa(e){let t=e;for(;["as_expression","satisfies_expression","type_assertion","parenthesized_expression"].includes(t.type)&&t.namedChildren.length>0;)t=t.namedChildren[0];return t}function My(e,t,n){let r=null;return Ti(e,i=>{!/(?:function|method|lambda)/u.test(i.type)&&i.type!=="arrow_function"||i.startPosition.row>t||i.endPosition.row<n||(!r||i.endIndex-i.startIndex<r.endIndex-r.startIndex)&&(r=i)}),r}function Ti(e,t){t(e);for(let n of e.namedChildren)Ti(n,t)}var Ja=new Set(["delete","get","head","options","patch","post","put"]),By=/(?:^|\.)(?:app|router|server)$/u,jy=new Set(["findFirst","findMany","findUnique","from","get","select"]),Vy=new Set(["create","delete","insert","remove","update","upsert"]),Uy=new Set(["execute","query","raw"]),Li=[qy(),Wy(),Hy(),Ky(),Xy(),Jy(),Zy()],wi=new Set(["exec","execFile","execFileSync","execSync","fork","spawn","spawnSync"]);function Hy(){return{id:"builtin.node-child-process",supports:e=>/(?:from\s*|require\s*\(\s*)['"](?:node:)?child_process['"]/u.test(e)&&/\b(?:exec|execFile|execFileSync|execSync|fork|spawn|spawnSync)\s*\(/u.test(e),extract:e=>{let t=zy(e.source),n=[];return me(e.root,r=>{if(r.type!=="call_expression")return;let i=Qt(r);if(!i)return;let o=t.direct.get(i),s=/^(.*?)\.([A-Za-z_$][\w$]*)$/u.exec(i),a=s&&t.namespaces.has(s[1])?s[2]:null,c=o??a;if(!c||!wi.has(c))return;let l=rt(r),u=ce(l[0],e)??{value:l[0]?.text.trim()||"<missing>",evidence:"expression"},d=["exec","execFile","execFileSync","execSync"].includes(c)?"process.exec":"process.spawn";n.push(B(e,r,"builtin.node-child-process",d,[{name:"operation",value:c,evidence:"literal"},{name:"executable",...u}],"exact","node-child-process-import"))}),n}}}function zy(e){let t=new Map,n=new Set,r=String.raw`['"](?:node:)?child_process['"]`,i=new RegExp(String.raw`\bimport\s*\{([^}]*)\}\s*from\s*${r}`,"gu");for(let c of e.matchAll(i))for(let l of(c[1]??"").split(",")){let u=/^\s*([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?\s*$/u.exec(l);u&&wi.has(u[1])&&t.set(u[2]??u[1],u[1])}let o=new RegExp(String.raw`\b(?:const|let)\s*\{([^}]*)\}\s*=\s*require\s*\(\s*${r}\s*\)`,"gu");for(let c of e.matchAll(o))for(let l of(c[1]??"").split(",")){let u=/^\s*([A-Za-z_$][\w$]*)(?:\s*:\s*([A-Za-z_$][\w$]*))?\s*$/u.exec(l);u&&wi.has(u[1])&&t.set(u[2]??u[1],u[1])}let s=new RegExp(String.raw`\bimport\s*\*\s*as\s*([A-Za-z_$][\w$]*)\s*from\s*${r}`,"gu");for(let c of e.matchAll(s))n.add(c[1]);let a=new RegExp(String.raw`\b(?:const|let)\s+([A-Za-z_$][\w$]*)\s*=\s*require\s*\(\s*${r}\s*\)`,"gu");for(let c of e.matchAll(a))n.add(c[1]);return{direct:t,namespaces:n}}function j(e,t){let n=R(e,t)?.rootNode;if(!n)return null;let r=x(e,t),i=F(e,t),o=A(e,t)?.callables??[];return{db:e,file:t,source:r,root:n,constants:ih(n),ownerAt:s=>{let a=i.filter(l=>l.startLine<=s&&l.endLine>=s).sort((l,u)=>l.endLine-l.startLine-(u.endLine-u.startLine)||l.startLine-u.startLine)[0];if(a)return{file:t,symbol:a.symbol,name:a.leaf,startLine:a.startLine,endLine:a.endLine};let c=o.filter(l=>l.startLine<=s&&l.endLine>=s).sort((l,u)=>l.endLine-l.startLine-(u.endLine-u.startLine)||l.startLine-u.startLine)[0];return{file:t,symbol:null,name:c?.name??null,startLine:c?.startLine??s,endLine:c?.endLine??s}}}}function Wy(){return{id:"builtin.effect-httpapi",supports:e=>Xt(e,"HttpApiEndpoint").size>0||Xt(e,"HttpApiBuilder").size>0,extract:e=>{let t=[],n=Xt(e.source,"HttpApiEndpoint"),r=Xt(e.source,"HttpApiGroup"),i=Xt(e.source,"HttpApiBuilder");return me(e.root,o=>{if(o.type!=="call_expression")return;let s=Qa(o);if(!s)return;let a=rt(o);if(n.has(s.receiver)&&Ja.has(s.member)){let g=ce(a[0],e),y=ce(a[1],e),S=Ga(o,r,"make",0,e);if(!g||!y||!S)return;let b=s.member.toUpperCase();t.push(B(e,o,"builtin.effect-httpapi","http.handle",[{name:"method",value:b,evidence:"literal"},{name:"path",...y}],ve([{name:"path",...y}]),"effect-httpapi-endpoint-declaration")),t.push(B(e,o,"builtin.effect-httpapi","framework.declare",Pi(S,g),ve(Pi(S,g)),"effect-httpapi-operation-declaration"));return}if(!["handle","handleRaw"].includes(s.member))return;let c=Ga(o,i,"group",1,e),l=ce(a[0],e),u=a[1];if(!c||!l||!u)return;let d=Pi(c,l),p=_t(e.db,e.file,u.text),f=B(e,o,"builtin.effect-httpapi","framework.handle",d,p.length===1?ve(d):"candidate","effect-httpapi-handler-registration"),m=p[0];p.length===1&&m&&(f.owner={file:m.relativePath,symbol:m.symbol,name:m.leaf,startLine:m.startLine,endLine:m.endLine}),t.push(f)}),t}}}function Pi(e,t){return[{name:"adapter",value:"effect-httpapi",evidence:"literal"},{name:"group",...e},{name:"operation",...t}]}function Xt(e,t){let n=new Set,r=/\bimport\s*\{([\s\S]*?)\}\s*from\s*['"]([^'"]+)['"]/gu;for(let o of e.matchAll(r)){let s=o[2]??"";if(Ka(s))for(let a of(o[1]??"").split(",")){let c=a.trim().replace(/^type\s+/u,""),l=/^([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?$/u.exec(c);l?.[1]===t&&n.add(l[2]??l[1])}}let i=/\bimport\s*\*\s*as\s*([A-Za-z_$][\w$]*)\s*from\s*['"]([^'"]+)['"]/gu;for(let o of e.matchAll(i)){let s=o[2]??"";s.endsWith(`/${t}`)&&Ka(s)&&n.add(o[1])}return n}function Ka(e){return e==="effect/unstable/httpapi"||e==="@effect/platform"||e.startsWith("@effect/platform/HttpApi")}function Ga(e,t,n,r,i){let o=e.parent;for(;o;){if(o.type==="call_expression"){let s=Xa(o,t,n,r,i);if(s)return s;let a=o.childForFieldName("function")??o.namedChild(0),c=null;if(a&&me(a,l=>{!c&&l.type==="call_expression"&&(c=Xa(l,t,n,r,i))}),c)return c}o=o.parent}return null}function Xa(e,t,n,r,i){let o=Qa(e);return!o||o.member!==n||!t.has(o.receiver)?null:ce(rt(e)[r],i)}function Qa(e){let t=e.childForFieldName("function")??e.namedChild(0);if(!t||!["member_expression","subscript_expression"].includes(t.type))return null;let n=t.childForFieldName("object")??t.namedChild(0),r=t.childForFieldName("property")??t.childForFieldName("index")??t.namedChild(1);return!n||!r?null:{receiver:n.text.replace(/\s+/gu,""),member:r.text.replace(/^['"`]|['"`]$/gu,"")}}function qy(){return{id:"builtin.http",supports:e=>/\bfetch\s*\(|\baxios\b|\b(?:app|router|server)\s*\.\s*(?:get|post|put|patch|delete|options|head)\s*\(/u.test(e)||Jt(e,["axios"])||/\b(?:FastAPI|Flask|APIRouter|axum|Router::new)\b/u.test(e),extract:e=>{let t=[];return me(e.root,n=>{if(n.type==="decorator"){let p=/^@[^\s(]+\.(get|post|put|patch|delete|options|head)\s*\(\s*(['"`])([^'"`]+)\2/iu.exec(n.text.trim());if(!p||!Jt(e.source,["fastapi","flask"]))return;t.push(B(e,n,"builtin.http","http.handle",[{name:"method",value:p[1].toUpperCase(),evidence:"literal"},{name:"path",value:p[3],evidence:"literal"}],"exact","framework-decorator"));return}if(n.type!=="call_expression")return;let r=Qt(n);if(!r)return;let i=r.split(".").at(-1)?.toLowerCase()??"",o=r.includes(".")?r.slice(0,r.lastIndexOf(".")):"",s=rt(n);if(i==="route"&&Jt(e.source,["axum"])){let p=ce(s[0],e),f=/^\s*(get|post|put|patch|delete|options|head)\s*\(/iu.exec(s[1]?.text??"")?.[1];if(!p||!f)return;t.push(B(e,n,"builtin.http","http.handle",[{name:"method",value:f.toUpperCase(),evidence:"literal"},{name:"path",...p}],ve([{name:"path",...p}]),"framework-adapter"));return}if(r==="fetch"||r.endsWith(".fetch")){let p=ce(s[0],e);if(!p)return;let m=/\bmethod\s*:\s*['"`]([A-Za-z]+)['"`]/u.exec(s[1]?.text??"")?.[1]?.toUpperCase()??(s[1]?null:"GET"),g=[...m?[{name:"method",value:m,evidence:"literal"}]:[],{name:"path",...p}];t.push(B(e,n,"builtin.http","http.request",g,m?ve(g):"candidate","call-expression"));return}if(!Ja.has(i))return;let a=ce(s[0],e);if(!a)return;let c=i.toUpperCase();if(By.test(o)&&Jt(e.source,["express","fastify","hono","koa-router","@koa/router"])){t.push(B(e,n,"builtin.http","http.handle",[{name:"method",value:c,evidence:"literal"},{name:"path",...a}],ve([{name:"path",...a}]),"framework-adapter"));return}let u=th(e.source,["axios"]),d=o.split(".")[0]??"";u.has(d)&&t.push(B(e,n,"builtin.http","http.request",[{name:"method",value:c,evidence:"literal"},{name:"path",...a}],ve([{name:"path",...a}]),"client-adapter"))}),t}}}function Ky(){return{id:"builtin.capability-registry",supports:e=>/\b(?:execute|handler|invoke|run)\s*(?:[:(])/u.test(e)||/['"`][^'"`\n]{0,256}\b[A-Za-z_$][\w$-]*\s*\(/u.test(e),extract:e=>{let t=[],n=new Set;return me(e.root,r=>{if(r.type==="pair"){let o=r.childForFieldName("key")??r.namedChild(0),s=r.childForFieldName("value")??r.namedChild(1),a=o?.text.replace(/^['"`]|['"`]$/gu,"");if(a!=="name"&&a!=="id")return;let c=Za(s,e),l=sh(r);if(!c||c.evidence!=="literal"||!l)return;let u=`handle\0${c.value}\0${l.startPosition.row}`;if(n.has(u))return;n.add(u),t.push(B(e,l,"builtin.capability-registry","registry.handle",[{name:"key",...c}],"exact","capability-descriptor"));return}if(!["string","string_literal","template_string"].includes(r.type))return;let i=r.text.replace(/^['"`]|['"`]$/gu,"");for(let o of i.matchAll(/\b([A-Za-z_$][\w$-]*)\s*\(/gu)){let s=o[1];if(!Gy(i,s,o.index))continue;let a=`reference\0${s}\0${r.startPosition.row}`;n.has(a)||(n.add(a),t.push(B(e,r,"builtin.capability-registry","registry.reference",[{name:"key",value:s,evidence:"literal"}],"exact","capability-instruction-reference")))}}),t}}}function Gy(e,t,n){if(t.includes("_")||t.includes("-"))return!0;let r=e.slice(Math.max(0,n-64),n);return/\b(?:use|call|invoke|run|via|with|read|stop)(?:\s+the)?(?:\s+(?:tool|capability|command))?\s*$/iu.test(r)}function Xy(){return{id:"builtin.registry",supports:e=>/(?:Handlers?|Registry|Routes?)\b/iu.test(e),extract:e=>{let t=[];return me(e.root,n=>{if(n.type==="pair"){let o=oh(n);if(!o)return;let s=n.childForFieldName("key")??n.namedChild(0),a=n.childForFieldName("value")??n.namedChild(1),c=Za(s,e);if(!c||!a||!Ya(a))return;let l=ki(a)?"exact":"candidate";t.push(B(e,n,"builtin.registry","registry.handle",[{name:"registry",value:o,evidence:"identifier"},{name:"key",...c}],ve([{name:"key",...c}],l),"object-member"));return}if(n.type!=="call_expression")return;let r=n.childForFieldName("function")??n.namedChild(0);if(!r)return;let i=/^([A-Za-z_$][\w$]*)\s*\[\s*(['"`])([^'"`]+)\2\s*\]$/u.exec(r.text.trim());i&&t.push(B(e,n,"builtin.registry","registry.dispatch",[{name:"registry",value:i[1],evidence:"identifier"},{name:"key",value:i[3],evidence:"literal"}],"exact","indexed-access-call"))}),t}}}function Jy(){return{id:"builtin.persistence",supports:e=>/\b(?:db|database|prisma|drizzle|[A-Za-z_$][\w$]*(?:Repository|Repo))\b[^;]{0,1024}?\.\s*(?:findFirst|findMany|findUnique|from|get|select|create|delete|insert|remove|update|upsert|execute|query|raw|transaction)(?:\s*<[^()]{1,512}>)?\s*\(/iu.test(e),extract:e=>{let t=[],n=ch(e.root);return me(e.root,r=>{if(r.type!=="call_expression")return;let i=Qt(r);if(!i)return;let o=i.split("."),s=o.at(-1)??"",a=rt(r),c=a[0]?.text??"",l=ah(s,c);if(!l)return;let u=ec(o,n);if(!u)return;let d=Qy(a[0],e)??lh(c),p=uh(u,o,s,d);if(!p)return;let f=s==="insert"?"persistence-insert":l==="database.read"&&/\bFOR\s+UPDATE\s+SKIP\s+LOCKED\b/iu.test(c)?"persistence-skip-locked-claim":"persistence-adapter";t.push(B(e,r,"builtin.persistence",l,[{name:"resource",...p}],ve([{name:"resource",...p}]),f))}),t}}}function Qy(e,t){if(!e)return null;let n=e.text.replace(/\s+/gu,"");return/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/u.test(n)?{value:n.split(".").at(-1),evidence:"identifier",term:{kind:"symbol",symbol:n}}:ce(e,t)}function Zy(){return{id:"builtin.queue",supports:e=>Jt(e,["amqplib","bullmq","kafkajs","@aws-sdk/client-sqs","rabbitmq"])&&/\.(?:sendToQueue|consume|send|subscribe)\s*\(/u.test(e),extract:e=>{let t=[];return me(e.root,n=>{if(n.type!=="call_expression")return;let r=Qt(n);if(!r)return;let i=r.split(".").at(-1)??"",o=rt(n),s=i==="sendToQueue"||i==="send"?"queue.send":i==="consume"||i==="subscribe"?"queue.consume":null;if(!s)return;let a=i==="send"||i==="subscribe"?nh(o[0],"topic",e):ce(o[0],e);a&&t.push(B(e,n,"builtin.queue",s,[{name:"address",...a}],ve([{name:"address",...a}]),"framework-adapter"))}),t}}}function B(e,t,n,r,i,o,s){let a=e.ownerAt(t.startPosition.row),c=JSON.stringify({extractor:n,action:r,file:e.file,line:t.startPosition.row,keyParts:i});return{id:`boundary:${$y("sha256").update(c).digest("hex").slice(0,16)}`,extractor:n,action:r,owner:a,source:{file:e.file,startLine:t.startPosition.row,endLine:t.endPosition.row},keyParts:i,evidence:s,strength:o,protocol:r.split(".")[0]??r,role:Yy(r),executionDomain:eh(e.file),derivation:{kind:o==="candidate"?"heuristic":o==="derived"?"mechanically-derived":"direct",rule:s,ruleVersion:"1",inputFactIds:i.flatMap(l=>l.derivation?.inputFactIds??[]),sourceSpans:[{file:e.file,startLine:t.startPosition.row,endLine:t.endPosition.row},...i.flatMap(l=>l.derivation?.sourceSpans??[])]},valuePrecision:i.some(l=>l.evidence==="expression")?"unknown":i.some(l=>l.evidence==="identifier")?"symbolic":"literal",modality:"may",resolution:"unresolved",sourceScope:Jn(e.file)}}function Yy(e){let t=e.split(".").at(-1)??e;return["handle","subscribe","consume","read"].includes(t)?"consumer":["request","publish","send","write","dispatch","reference","invoke","spawn","exec"].includes(t)?"producer":"observe"}function eh(e){let t=e.replaceAll("\\","/"),n=/^(apps|services|packages)\/([^/]+)/u.exec(t);return n?`${n[1]}/${n[2]}`:null}function Jt(e,t){return t.some(n=>{let r=n.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&");return new RegExp(`(?:\\bfrom\\s+${r}\\b|\\buse\\s+${r}\\b|(?:\\bfrom\\s*|\\brequire\\s*\\(\\s*)['"]${r}(?:[/']|"))`,"u").test(e)})}function th(e,t){let n=new Set;for(let r of t){let i=r.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&"),o=new RegExp(`(?:import\\s+([A-Za-z_$][\\w$]*)[^;]*?\\sfrom\\s*|(?:const|let)\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*require\\s*\\(\\s*)['"]${i}(?:[/']|")`,"gu");for(let s of e.matchAll(o)){let a=s[1]??s[2];a&&n.add(a)}}return n}function Yn(e,t,n,r,i,o,s){return B(e,t,n,r,i,o,s)}function Qt(e){return(e.childForFieldName("function")??e.namedChild(0))?.text.replace(/\s+/gu,"")??null}function rt(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function ce(e,t){let n=fe(t,e);return n?{value:n.value,evidence:n.evidence,term:n.term,derivation:n.derivation}:null}function nh(e,t,n){if(!e)return null;let r=e.namedChildren.find(o=>o.type!=="pair"?!1:(o.childForFieldName("key")??o.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"")===t),i=r?.childForFieldName("value")??r?.namedChild(1);return ce(i,n)}function Za(e,t){if(!e)return null;let n=ce(e,t);if(n?.evidence==="literal"||n?.evidence==="constant")return n;let r=e.text.trim();return/^[A-Za-z_$][\w$]*$/u.test(r)?{value:r,evidence:"identifier",term:{kind:"symbol",symbol:r}}:n}function ve(e,t="exact"){return t==="candidate"||e.some(n=>n.evidence==="expression")?"candidate":t==="derived"||e.some(n=>n.evidence==="constant")?"derived":"exact"}function rh(e){let t=e.text.trim(),n=t[0];if(n!=="'"&&n!=='"'&&n!=="`"||t.at(-1)!==n)return null;let r=t.slice(1,-1);return n==="`"&&r.includes("${")?null:r}function ih(e){let t=new Map;return me(e,n=>{if(n.type!=="variable_declarator")return;let r=n.childForFieldName("name")??n.namedChild(0),i=n.childForFieldName("value")??n.namedChild(1);if(!r||!i||!/^[A-Za-z_$][\w$]*$/u.test(r.text))return;let o=rh(i);o!==null&&t.set(r.text,o)}),t}function oh(e){let t=e.parent,n=t?.parent??null;for(;n&&["as_expression","satisfies_expression","type_assertion","parenthesized_expression"].includes(n.type);)n=n.parent;if(!t||!n||n.type!=="variable_declarator")return null;let i=(n.childForFieldName("name")??n.namedChild(0))?.text??"";return/(?:handlers?|registry|routes?)$/iu.test(i)?i:null}function ki(e){return/(?:function|lambda|method)/u.test(e.type)||e.type==="arrow_function"}function Ya(e){return ki(e)||e.type==="member_expression"?!0:e.type==="identifier"&&/(?:command|controller|dispatch|handle|handler)/iu.test(e.text)}function sh(e){let t=e.parent;for(;t&&t.type!=="variable_declarator";){if(["object","object_literal","dictionary"].includes(t.type))for(let n of t.namedChildren){if(n.type==="pair"){let i=n.childForFieldName("key")??n.namedChild(0),o=n.childForFieldName("value")??n.namedChild(1),s=i?.text.replace(/^['"`]|['"`]$/gu,"");if(s&&["execute","handler","invoke","run"].includes(s)&&o&&Ya(o))return t}let r=n.childForFieldName("name")??n.namedChild(0);if(r&&["execute","handler","invoke","run"].includes(r.text.replace(/^['"`]|['"`]$/gu,""))&&/(?:function|method)/u.test(n.type))return t}t=t.parent}return null}function ec(e,t=new Set){let n=e.slice(0,-1).map(r=>r.replace(/\([^)]*\)/gu,""));return n.some(r=>/^(?:prisma|drizzle)$/iu.test(r))?"orm":n.some(r=>/(?:Repository|Repo)$/u.test(r))?"repository":n.some(r=>/^(?:db|database)$/iu.test(r)||t.has(r))?"database":null}function ah(e,t){if(jy.has(e))return"database.read";if(Vy.has(e))return"database.write";if(!Uy.has(e))return null;let n=/\b(SELECT|INSERT|UPDATE|DELETE)\b/iu.exec(t)?.[1]?.toUpperCase();return n==="SELECT"?"database.read":n?"database.write":null}function ch(e){let t=new Set;return me(e,n=>{if(n.type!=="call_expression")return;let r=Qt(n);if(!r)return;let i=r.split(".");if(!(i.at(-1)!=="transaction"||!ec(i)))for(let o of rt(n)){if(!ki(o))continue;let a=(o.childForFieldName("parameters")??o.namedChildren.find(l=>/parameters/u.test(l.type)))?.namedChildren[0],c=a?tc(a):null;c&&t.add(c)}}),t}function tc(e){if(e.type==="identifier")return e.text;let t=e.childForFieldName("name")??e.childForFieldName("pattern");return t?tc(t):e.namedChildren.find(n=>n.type==="identifier")?.text??null}function lh(e){let t=nc(e);return t?{value:t,evidence:"identifier",term:{kind:"symbol",symbol:t}}:null}function uh(e,t,n,r){if(e==="orm"&&t.length>=3)return{value:t.at(-2).replace(/\([^)]*\)/gu,""),evidence:"identifier"};if(e==="repository"){let o=t.at(-2)?.replace(/(?:Repository|Repo)$/u,"");return o?{value:o,evidence:"identifier"}:null}if(!r)return null;if(n==="from"||n==="insert")return r;let i=nc(r.value);return i?{value:i,evidence:r.evidence}:null}function nc(e){return/\b(?:from|into|update|table)\s+(?:\$\{\s*)?['"`]?([A-Za-z_$][\w$.-]*)/iu.exec(e)?.[1]??null}function me(e,t){t(e);for(let n of e.namedChildren)me(n,t)}var dh=v("resolved-call-syntax",{clearGroups:[]}),ph=v("resolved-call-sites",{clearGroups:[]});function Zt(e,t){return ph.get(e,t.symbolId,()=>fh(e,t))}function fh(e,t){let n=[],r=[],i=new Set,o=new Set;for(let s of yi(e,t,{semantic:!1})){i.add(s.file);let a=dh.get(e,s.file,()=>mh(e,s.file));if(!a){r.push({callee:t,file:s.file,line:s.line,reason:"ast-unavailable",candidates:0,referenceProvenance:s.provenance});continue}let c=(a.byLeaf.get(t.leaf)??[]).filter(({callNode:d})=>d.startPosition.row<=s.line&&d.endPosition.row>=s.line);if(c.length!==1){r.push({callee:t,file:s.file,line:s.line,reason:c.length===0?"call-not-found":"ambiguous-call",candidates:c.length,referenceProvenance:s.provenance});continue}let l=c[0],u=`${s.file}\0${l.callNode.startIndex}\0${l.callNode.endIndex}`;o.has(u)||(o.add(u),n.push({callee:t,caller:vt(F(e,s.file),l.callNode.startPosition.row),file:s.file,line:s.line,startLine:l.callNode.startPosition.row,endLine:l.callNode.endPosition.row,targetText:l.targetNode.text,callNode:l.callNode,targetNode:l.targetNode,arguments:l.arguments,referenceProvenance:s.provenance}))}return{sites:n,unresolved:r,filesVisited:i.size}}function mh(e,t){let n=R(e,t)?.rootNode;if(!n)return null;let r=new Map;return rc(n,i=>{if(i.type!=="call_expression"&&i.type!=="call")return;let o=i.childForFieldName("function")??i.namedChild(0);if(!o)return;let s=_e(o);if(!s)return;let a=i.childForFieldName("arguments")??i.namedChildren.find(u=>u.type==="arguments"),c={callNode:i,targetNode:o,arguments:a?.namedChildren??[]},l=r.get(s);l?l.push(c):r.set(s,[c])}),{byLeaf:r}}function rc(e,t){t(e);for(let n of e.namedChildren)rc(n,t)}var gh=v("call-parameter-value-flow",{clearGroups:[]});function Yt(e,t){let n=`${t.callee.symbolId}\0${t.file}\0${t.callNode.startIndex}\0${t.callNode.endIndex}`;return gh.get(e,n,()=>yh(e,t))}function en(e,t){let n=new Set(t);return[...new Set(e.transfers.flatMap(r=>n.has(r.calleePosition)?[r.callerPosition]:[]))].sort((r,i)=>r-i)}function yh(e,t){let n={file:t.file,startLine:t.startLine,endLine:t.endLine};if(!t.caller)return{callee:t.callee,caller:null,call:n,transfers:[],unknown:t.arguments.map((c,l)=>({calleePosition:l,argumentText:c.text.trim(),reason:"caller-unavailable",proof:n}))};let r=R(e,t.caller.relativePath)?.rootNode,i=r?hh(r,t.caller.startLine,t.caller.endLine):null;if(!i)return{callee:t.callee,caller:t.caller,call:n,transfers:[],unknown:t.arguments.map((c,l)=>({calleePosition:l,argumentText:c.text.trim(),reason:"caller-syntax-unavailable",proof:n}))};let o=Sh(i),s=[],a=[];return t.arguments.forEach((c,l)=>{let u=c.text.trim(),d=o.indexOf(u);d>=0?s.push({calleePosition:l,callerPosition:d,argumentText:u,proof:n}):a.push({calleePosition:l,argumentText:u,reason:"argument-not-direct-parameter",proof:n})}),{callee:t.callee,caller:t.caller,call:n,transfers:s,unknown:a}}function hh(e,t,n){let r=null;return oc(e,i=>{!/(?:function|method|lambda)/u.test(i.type)&&i.type!=="arrow_function"||i.startPosition.row>t||i.endPosition.row<n||(!r||i.endIndex-i.startIndex<r.endIndex-r.startIndex)&&(r=i)}),r}function Sh(e){return(e.childForFieldName("parameters")??e.namedChildren.find(n=>/parameters/u.test(n.type)))?.namedChildren.map(ic)??[]}function ic(e){if(e.type==="identifier")return e.text;let t=e.childForFieldName("name")??e.childForFieldName("pattern");return t?ic(t):e.namedChildren.find(n=>n.type==="identifier")?.text??null}function oc(e,t){t(e);for(let n of e.namedChildren)oc(n,t)}var bh=8,xh=8;function ac(e,t){let n=[],r=vh(e,n),i=r.summaries,o=Nh(e,t,i,n),s=Eh(e,t,n);return{observations:Dh([...o.observations,...s]),bodySummaries:i.size,discriminatorSummaries:o.summaries,filesInspected:r.filesInspected,errors:n}}function vh(e,t){let n=new Map,r=[],i=H(e);for(let o of i){let s=x(e,o);if(!/\bJSON\.stringify\s*\(/u.test(s)||!/\bbody\s*:/u.test(s))continue;let a=j(e,o);if(a)for(let[c,l]of Ch(a)){let u={definition:c,parameterIndexes:l,depth:0,proofSpans:[{file:o,startLine:c.startLine,endLine:c.endLine}]};n.set(c.symbol,u),r.push(u)}}for(;r.length>0;){let o=r.shift();if(!(o.depth>=bh))try{for(let s of Zt(e,o.definition).sites){if(!j(e,s.file))continue;let c=s.caller;if(!c)continue;let l=en(Yt(e,s),o.parameterIndexes);if(l.length===0)continue;let u={definition:c,parameterIndexes:mc(l),depth:o.depth+1,proofSpans:[...o.proofSpans,{file:s.file,startLine:s.startLine,endLine:s.endLine}]};Fh(n,u)&&r.push(n.get(c.symbol))}}catch(s){t.push(`builtin.carrier body summary failed for ${o.definition.relativePath}: ${Mi(s)}`)}}return{summaries:n,filesInspected:i.length}}function Nh(e,t,n,r){let i=new Map,o=[],s=[];for(let a of t){if(a.action!=="http.request"||a.strength==="candidate"||a.sourceScope!=="production")continue;let c=cc(a);if(!c)continue;let l=j(e,a.source.file);if(!l)continue;let u=dc(l.root,a.source.startLine),d=u.find(b=>b.startPosition.row===a.source.startLine)??u[0];if(!d)continue;let p=Oi(d);if(!p)continue;let f=_t(e,a.source.file,p.text);if(f.length!==1)continue;let m=n.get(f[0].symbol);if(!m)continue;let g=a.owner.symbol?F(e,a.owner.file).find(b=>b.symbol===a.owner.symbol):null;if(!g)continue;let y=Th(l,g),S=tr(d);for(let b of m.parameterIndexes){let N=wh(l,S[b]);if(N)for(let E of Lh(N)){let I=pc(E),h=fc(E);if(!I||!h)continue;let C=y.indexOf(h.text.trim());if(C>=0){let k={definition:g,carrier:c,field:I,parameterIndex:C,depth:0,proofObservationIds:[a.id],proofSpans:[a.source,{file:a.source.file,startLine:E.startPosition.row,endLine:E.endPosition.row}]},$=sc(k);i.has($)||(i.set($,k),o.push(k));continue}let _=fe(l,h);!_||_.evidence==="expression"||s.push(Ai(l,E,"carrier.publish",c,I,_.value,[a.id]))}}}for(;o.length>0;){let a=o.shift();if(!(a.depth>=xh))try{for(let c of Zt(e,a.definition).sites){let l=j(e,c.file);if(!l)continue;let u=c.callNode,d=tr(u)[a.parameterIndex];if(!d)continue;let p=fe(l,d);p&&p.evidence!=="expression"&&s.push(Ai(l,u,"carrier.publish",a.carrier,a.field,p.value,a.proofObservationIds));let f=c.caller;if(!f)continue;let m=Yt(e,c).transfers.find(S=>S.calleePosition===a.parameterIndex)?.callerPosition;if(m===void 0)continue;let g={...a,definition:f,parameterIndex:m,depth:a.depth+1,proofSpans:[...a.proofSpans,{file:c.file,startLine:c.startLine,endLine:c.endLine}]},y=sc(g);i.has(y)||(i.set(y,g),o.push(g))}}catch(c){r.push(`builtin.carrier discriminator summary failed for ${a.definition.relativePath}: ${Mi(c)}`)}}return{observations:s,summaries:i.size}}function Eh(e,t,n){let r=[],i=t.filter(o=>o.action==="registry.handle"&&o.strength!=="candidate"&&o.sourceScope==="production");for(let o of t){if(o.action!=="http.handle"||o.strength==="candidate"||o.sourceScope!=="production")continue;let s=cc(o);if(!s)continue;let a=j(e,o.source.file);if(!a)continue;let c=dc(a.root,o.source.startLine)[0];if(c)for(let l of tr(c).slice(1)){let u=_t(e,o.source.file,l.text);for(let d of u)try{let p=j(e,d.relativePath);if(!p)continue;let f=er(p.root,d.startLine,d.endLine);if(!f)continue;He(f,m=>{if(m.type!=="call_expression")return;let g=Oi(m);if(!g)return;let y=/^([A-Za-z_$][\w$]*)\s*\[\s*([A-Za-z_$][\w$]*)\s*\]$/u.exec(g.text.trim());if(!y)return;let S=y[1],b=y[2],N=Ih(e,p,d,b);if(!N)return;let E=Rh(e,d.relativePath,S);for(let I of i){let h=I.keyParts.find($=>$.name==="registry")?.value,C=I.keyParts.find($=>$.name==="key")?.value;if(!h||!C||!E.some($=>$.file===I.source.file&&$.binding===h))continue;let _=j(e,I.source.file),k=_?Ph(_.root,I.source.startLine):null;!_||!k||r.push(Ai(_,k,"carrier.consume",s,N,C,[o.id,I.id]))}})}catch(p){n.push(`builtin.carrier consumer analysis failed for ${d.relativePath}: ${Mi(p)}`)}}}return r}function Ch(e){let t=F(e.db,e.file),n=new Map;return He(e.root,r=>{if(r.type!=="pair"||pc(r)?.toLowerCase()!=="body")return;let i=fc(r);if(!i||!/\bJSON\.stringify\s*\(/u.test(i.text))return;let o=vt(t,r.startPosition.row),s=_h(r);if(!o||!s)return;let a=lc(s),c=new Set;kh(i,a,c);let l=n.get(o.symbol)??new Set;a.forEach((u,d)=>{u&&c.has(u)&&l.add(d)}),l.size>0&&n.set(o.symbol,l)}),t.flatMap(r=>{let i=n.get(r.symbol);return i?[[r,[...i].sort((o,s)=>o-s)]]:[]})}function _h(e){let t=e.parent;for(;t;){if(/(?:function|method|lambda)/u.test(t.type)||t.type==="arrow_function")return t;t=t.parent}return null}function Ih(e,t,n,r){let i=er(t.root,n.startLine,n.endLine);if(!i)return null;let o=new RegExp(`\\.body\\??\\.${Di(r)}\\b`,"u");if(o.test(i.text))return r;let s=null;if(He(i,u=>{if(s||u.type!=="variable_declarator")return;let d=u.childForFieldName("name")??u.namedChild(0),p=u.childForFieldName("value")??u.namedChild(1);!d||!p||!new RegExp(`(?:^|[,{}])\\s*${Di(r)}\\s*(?:[,}]|$)`,"u").test(d.text)||p.type==="call_expression"&&(s=Oi(p)?.text??null)}),!s)return null;let a=_t(e,n.relativePath,s);if(a.length!==1)return null;let c=j(e,a[0].relativePath),l=c?er(c.root,a[0].startLine,a[0].endLine):null;return l&&o.test(l.text)&&new RegExp(`\\b${Di(r)}\\s*[,}]`,"u").test(l.text)?r:null}function Rh(e,t,n){let r=[];for(let i of Ii(e,t,n)){let o=tn(i.initializer);if(o.type==="call_expression")for(let s of tr(o)){let a=s.text.trim();if(/^[A-Za-z_$][\w$]*$/u.test(a))for(let c of Ii(e,i.definition.relativePath,a))r.push({file:c.definition.relativePath,binding:c.definition.leaf})}}return[...new Map(r.map(i=>[`${i.file}\0${i.binding}`,i])).values()]}function Ai(e,t,n,r,i,o,s){let c=Yn(e,t,"builtin.carrier",n,[{name:"carrier",value:r,evidence:"constant",term:{kind:"literal",value:r}},{name:"field",value:i,evidence:"literal",term:{kind:"literal",value:i}},{name:"value",value:o,evidence:"constant",term:{kind:"literal",value:o}}],"derived","http-body-registry-discriminator");return c.derivation={kind:"mechanically-derived",rule:"http-body-registry-discriminator",ruleVersion:"1",inputFactIds:[...s],sourceSpans:[c.source]},c}function cc(e){let t=e.keyParts.find(r=>r.name==="method"&&r.evidence!=="expression")?.value,n=e.keyParts.find(r=>r.name==="path"&&r.evidence!=="expression")?.value;return t&&n?`${t.toUpperCase()} ${n}`:null}function Fh(e,t){let n=e.get(t.definition.symbol);if(!n)return e.set(t.definition.symbol,t),!0;let r=mc([...n.parameterIndexes,...t.parameterIndexes]);return r.length===n.parameterIndexes.length&&t.depth>=n.depth?!1:(e.set(t.definition.symbol,{...n,parameterIndexes:r,depth:Math.min(n.depth,t.depth),proofSpans:[...n.proofSpans,...t.proofSpans]}),!0)}function sc(e){return`${e.definition.symbol}\0${e.carrier}\0${e.field}\0${e.parameterIndex}`}function Th(e,t){let n=er(e.root,t.startLine,t.endLine);return n?lc(n):[]}function lc(e){return(e.childForFieldName("parameters")??e.namedChildren.find(n=>/parameters/u.test(n.type)))?.namedChildren.map(uc)??[]}function uc(e){if(e.type==="identifier")return e.text;let t=e.childForFieldName("name")??e.childForFieldName("pattern");return t?uc(t):e.namedChildren.find(n=>n.type==="identifier")?.text??null}function er(e,t,n){let r=null;return He(e,i=>{!/(?:function|method|lambda)/u.test(i.type)&&i.type!=="arrow_function"||i.startPosition.row>t||i.endPosition.row<n||(!r||i.endIndex-i.startIndex<r.endIndex-r.startIndex)&&(r=i)}),r}function Ph(e,t){let n=null;return He(e,r=>{r.startPosition.row>t||r.endPosition.row<t||(!n||r.endIndex-r.startIndex<n.endIndex-n.startIndex)&&(n=r)}),n}function dc(e,t){let n=[];return He(e,r=>{r.type==="call_expression"&&r.startPosition.row<=t&&r.endPosition.row>=t&&n.push(r)}),n.sort((r,i)=>r.endIndex-r.startIndex-(i.endIndex-i.startIndex))}function Oi(e){return e.childForFieldName("function")??e.namedChild(0)}function tr(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function wh(e,t){if(!t)return null;let n=t.text.trim();if(!/^[A-Za-z_$][\w$]*$/u.test(n))return tn(t);let r=null;return He(e.root,i=>{r||i.type!=="variable_declarator"||(i.childForFieldName("name")??i.namedChild(0))?.text.trim()!==n||(r=i.childForFieldName("value")??i.namedChild(1))}),tn(r||t)}function Lh(e){let t=tn(e);return t.type==="object"?t.namedChildren.filter(n=>n.type==="pair"||n.type==="shorthand_property_identifier"):[]}function pc(e){return e.type==="shorthand_property_identifier"?e.text:(e.childForFieldName("key")??e.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"")??null}function fc(e){return e.type==="shorthand_property_identifier"?e:e.childForFieldName("value")??e.namedChild(1)}function tn(e){let t=e;for(;["as_expression","satisfies_expression","type_assertion","parenthesized_expression"].includes(t.type)&&t.namedChildren.length>0;)t=t.namedChildren[0];return t}function kh(e,t,n){let r=new Set(e.text.match(/[A-Za-z_$][\w$]*/gu)??[]);for(let i of t)i&&r.has(i)&&n.add(i)}function mc(e){return[...new Set(e)].sort((t,n)=>t-n)}function Dh(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function Di(e){return e.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")}function Mi(e){return e instanceof Error?e.message:String(e)}function He(e,t){t(e);for(let n of e.namedChildren)He(n,t)}import{createHash as Ah}from"crypto";function gc(e,t){let n=new Map;for(let o of t){if(o.action!=="http.handle"||o.sourceScope!=="production")continue;let s=n.get(o.source.file)??[];s.push(o),n.set(o.source.file,s)}let r=[],i=Oh(e);for(let o of i.mounts)for(let s of o.targetFiles)for(let a of n.get(s)??[]){let c=a.keyParts.find(p=>p.name==="path");if(!c||c.evidence==="expression")continue;let l=$h(o.prefix.value,c.value),u=a.keyParts.map(p=>p.name==="path"?{name:"path",value:l,evidence:"constant",term:{kind:"concat",parts:[o.prefix.term??{kind:"literal",value:o.prefix.value},c.term??{kind:"literal",value:c.value}]},derivation:{kind:"mechanically-derived",rule:"http.mount-prefix",ruleVersion:"1",inputFactIds:[a.id],sourceSpans:[a.source,{file:o.file,startLine:o.line,endLine:o.line},...o.prefix.derivation?.sourceSpans??[],...c.derivation?.sourceSpans??[]]}}:p),d=`${a.id}\0${o.file}\0${o.line}\0${l}`;r.push({...a,id:`boundary:${Ah("sha256").update(d).digest("hex").slice(0,16)}`,keyParts:u,strength:"derived",evidence:"framework-mount-composition",derivation:{kind:"mechanically-derived",rule:"http.mount-prefix",ruleVersion:"1",inputFactIds:[a.id],sourceSpans:[a.source,{file:o.file,startLine:o.line,endLine:o.line}]},resolution:"unresolved"}),a.strength="candidate",a.resolution="unresolved"}return{observations:r,filesInspected:i.filesInspected,mounts:i.mounts.length}}function Oh(e){let t=[],n=H(e);for(let r of n){let i=x(e,r);if(!Bh(i))continue;let o=j(e,r);o&&yc(o.root,s=>{if(s.type!=="call_expression")return;let a=s.childForFieldName("function")??s.namedChild(0);if(!a||!/\.use$/u.test(a.text.replace(/\s+/gu,"")))return;let c=jh(s);if(c.length<2)return;let l=fe(o,c[0]);if(!l||l.evidence==="expression")return;let u=Mh(e,r,c[1]);u.length!==0&&t.push({file:r,line:s.startPosition.row,prefix:{value:l.value,evidence:l.evidence,term:l.term,derivation:l.derivation},targetFiles:u})})}return{mounts:t,filesInspected:n.length}}function Mh(e,t,n){let r=n.text.replace(/\s+/gu,""),i=/^([A-Za-z_$][\w$]*)/u.exec(r)?.[1];if(!i)return[];let o=M(e,t).find(c=>c.localName===i&&c.sourcePath);if(!o?.sourcePath)return[t];if(o.kind==="namespace")return[o.sourcePath];let s=o.importedName==="default"?i:o.importedName,a=nt(e,o.sourcePath,s);return[...new Set(a.map(c=>c.relativePath))]}function $h(e,t){let n=e==="/"?"":e.replace(/\/+$/u,""),r=t.startsWith("/")?t:`/${t}`;return`${n}${r}`||"/"}function Bh(e){return/(?:\bfrom\s*|\brequire\s*\(\s*)['"](?:express|fastify|hono|koa-router|@koa\/router)(?:[/']|")/u.test(e)}function jh(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function yc(e,t){t(e);for(let n of e.namedChildren)yc(n,t)}import{createHash as Vh}from"crypto";var $i=new Set(["DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT"]),Uh=8;function bc(e,t){let n=new Map,r=[],i=[],o=new Set,s=[],a=[];for(let c of t){if(c.action!=="http.request"||!c.owner.symbol||c.evidence!=="call-expression"&&c.evidence!=="client-adapter")continue;let l=F(e,c.owner.file).find(f=>f.symbol===c.owner.symbol);if(!l)continue;let u=j(e,l.relativePath);if(!u)continue;let d=hc(u,l),p={definition:l,...d,constantMethods:c.keyParts.flatMap(f=>f.name==="method"&&f.evidence!=="expression"&&$i.has(f.value.toUpperCase())?[f.value.toUpperCase()]:[]),depth:0,proofObservationIds:[c.id],proofSpans:[c.source]};Sc(n,p)&&r.push(n.get(l.symbol))}for(;r.length>0;){let c=r.shift();if(!(c.depth>=Uh))try{let l=Zt(e,c.definition);a.push(...l.unresolved.map(u=>Hh(c,u)));for(let u of l.sites){let d=j(e,u.file);if(!d)continue;o.add(u.file);let p=u.callNode,f=Wh(c,p,d);f&&i.push(f);let m=u.caller;if(!m)continue;let g=hc(d,m),y=qh(e,c,u),S={definition:m,pathParameterIndexes:nr([...g.pathParameterIndexes,...y.pathParameterIndexes]),methodParameterIndexes:nr([...g.methodParameterIndexes,...y.methodParameterIndexes]),constantMethods:Rt([...c.constantMethods,...g.constantMethods]),depth:c.depth+1,proofObservationIds:Rt([...c.proofObservationIds,...f?[f.id]:[]]),proofSpans:[...c.proofSpans,{file:u.file,startLine:u.startLine,endLine:u.endLine}]};Sc(n,S)&&r.push(n.get(m.symbol))}}catch(l){s.push(`builtin.http-summary failed for ${c.definition.relativePath}:${c.definition.startLine+1}: ${l instanceof Error?l.message:String(l)}`)}}return{observations:i,frontiers:zh(a),summaries:n.size,filesInspected:o.size,errors:s}}function Hh(e,t){let n=Rt([...e.pathParameterIndexes.length>0?["path"]:[],...e.methodParameterIndexes.length>0&&e.constantMethods.length!==1?["method"]:[]]),r=e.constantMethods.length===1?e.constantMethods[0]:"?",i=`${e.definition.symbol}\0${t.file}\0${t.line}\0${t.reason}`;return{observationId:`frontier:${Vh("sha256").update(i).digest("hex").slice(0,16)}`,kind:"call-resolution",action:"http.request",strength:"candidate",source:{file:t.file,startLine:t.line,endLine:t.line},ownerShortName:null,address:`method=${r??"?"} path=?`,reason:`Compiler identity found a reference to ${e.definition.leaf}, but exact call recovery stopped with ${t.reason} (${t.candidates} syntax candidate(s)); HTTP value propagation did not cross this site.`,missingKeyParts:n.length>0?n:["call"],sourceScope:Jn(t.file)}}function zh(e){return[...new Map(e.map(t=>[t.observationId,t])).values()].sort((t,n)=>t.observationId.localeCompare(n.observationId))}function Wh(e,t,n){let r=vc(t),i=e.pathParameterIndexes.flatMap(d=>{let p=fe(n,r[d]);return p&&p.evidence!=="expression"&&Jh(p.value)?[{index:d,value:p}]:[]}),o=e.methodParameterIndexes.flatMap(d=>{let p=fe(n,r[d]),f=p?.value.toUpperCase();return p&&f&&p.evidence!=="expression"&&$i.has(f)?[{index:d,value:{...p,value:f}}]:[]}),s=Rt([...e.constantMethods,...o.map(d=>d.value.value)]);if(i.length!==1||s.length!==1)return null;let a=i[0].value,c=o.find(d=>d.value.value===s[0])?.value,l=[{name:"method",value:s[0],evidence:c?"constant":"literal",term:c?.term??{kind:"literal",value:s[0]},derivation:c?.derivation},{name:"path",value:a.value,evidence:"constant",term:a.term,derivation:a.derivation}],u=Yn(n,t,"builtin.http-summary","http.request",l,"derived","compiler-resolved-http-summary");return u.derivation={kind:"mechanically-derived",rule:"compiler-resolved-http-summary",ruleVersion:"1",inputFactIds:e.proofObservationIds,sourceSpans:[...e.proofSpans,u.source]},u}function hc(e,t){let n=Xh(e.root,t.startLine,t.endLine);if(!n)return{pathParameterIndexes:[],methodParameterIndexes:[],constantMethods:[]};let r=Gh(n),i=new Set,o=new Set,s=new Set;return Bi(n,a=>{if(a.type==="call_expression"&&((a.childForFieldName("function")??a.namedChild(0))?.text.replace(/\s+/gu,"").split(".").at(-1)??"")==="fetch"){let f=vc(a);nn(f[0],r,i);let m=Kh(f[1],"method");if(m){nn(m,r,o);let g=fe(e,m),y=g?.value.toUpperCase();y&&g?.evidence!=="expression"&&$i.has(y)&&s.add(y)}else nn(f[1],r,o)}if(a.type!=="pair")return;let c=a.childForFieldName("key")??a.namedChild(0),l=a.childForFieldName("value")??a.namedChild(1),u=c?.text.replace(/^['"`]|['"`]$/gu,"").toLowerCase();(u==="url"||u==="path"||u==="endpoint")&&nn(l,r,i),(u==="init"||u==="requestinit"||u==="options")&&nn(l,r,o)}),{pathParameterIndexes:r.flatMap((a,c)=>a&&i.has(a)?[c]:[]),methodParameterIndexes:r.flatMap((a,c)=>a&&o.has(a)?[c]:[]),constantMethods:[...s].sort()}}function qh(e,t,n){let r=Yt(e,n);return{pathParameterIndexes:en(r,t.pathParameterIndexes),methodParameterIndexes:en(r,t.methodParameterIndexes)}}function Sc(e,t){let n=e.get(t.definition.symbol);if(!n)return e.set(t.definition.symbol,t),!0;let r=nr([...n.pathParameterIndexes,...t.pathParameterIndexes]),i=nr([...n.methodParameterIndexes,...t.methodParameterIndexes]),o=Rt([...n.constantMethods,...t.constantMethods]);return r.length!==n.pathParameterIndexes.length||i.length!==n.methodParameterIndexes.length||o.length!==n.constantMethods.length||t.depth<n.depth?(e.set(t.definition.symbol,{...n,pathParameterIndexes:r,methodParameterIndexes:i,constantMethods:o,depth:Math.min(n.depth,t.depth),proofObservationIds:Rt([...n.proofObservationIds,...t.proofObservationIds]),proofSpans:[...n.proofSpans,...t.proofSpans]}),!0):!1}function Kh(e,t){if(!e)return null;for(let n of e.namedChildren)if(!(n.type!=="pair"||(n.childForFieldName("key")??n.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"").toLowerCase()!==t))return n.childForFieldName("value")??n.namedChild(1);return null}function nn(e,t,n){if(!e)return;let r=new Set(e.text.match(/[A-Za-z_$][\w$]*/gu)??[]);for(let i of t)i&&r.has(i)&&n.add(i)}function Gh(e){return(e.childForFieldName("parameters")??e.namedChildren.find(n=>/parameters/u.test(n.type)))?.namedChildren.map(xc)??[]}function xc(e){if(e.type==="identifier")return e.text;let t=e.childForFieldName("name")??e.childForFieldName("pattern");return t?xc(t):e.namedChildren.find(n=>n.type==="identifier")?.text??null}function Xh(e,t,n){let r=null;return Bi(e,i=>{!/(?:function|method|lambda)/u.test(i.type)&&i.type!=="arrow_function"||i.startPosition.row>t||i.endPosition.row<n||(!r||i.endIndex-i.startIndex<r.endIndex-r.startIndex)&&(r=i)}),r}function vc(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function Jh(e){return e.startsWith("/")||/^https?:\/\//iu.test(e)}function nr(e){return[...new Set(e)].sort((t,n)=>t-n)}function Rt(e){return[...new Set(e)].sort()}function Bi(e,t){t(e);for(let n of e.namedChildren)Bi(n,t)}import{createHash as Qh}from"crypto";function Cc(e){let t=Nc(e.filter(r=>r.action==="database.read"&&r.evidence==="persistence-skip-locked-claim")),n=Nc(e.filter(r=>r.action==="database.write"&&r.evidence==="persistence-insert"));return e.flatMap(r=>r.action==="database.write"&&r.evidence==="persistence-insert"?ji(r).flatMap(i=>{let o=t.get(i)?.[0];return o?[Ec(r,o,i,"queue.send")]:[]}):r.action==="database.read"&&r.evidence==="persistence-skip-locked-claim"?ji(r).flatMap(i=>{let o=n.get(i)?.[0];return o?[Ec(r,o,i,"queue.consume")]:[]}):[])}function Nc(e){let t=new Map;for(let n of e)for(let r of ji(n)){let i=t.get(r);i?i.push(n):t.set(r,[n])}for(let n of t.values())n.sort((r,i)=>r.id.localeCompare(i.id));return t}function ji(e){return e.keyParts.filter(t=>t.name==="resource").map(t=>t.value)}function Ec(e,t,n,r){let i=`database:${n}`,o=r==="queue.send"?"database-queue-insert":"database-queue-skip-locked-claim",s=[e.id,r,i,o].join("\0");return{...e,id:`boundary:${Qh("sha256").update(s).digest("hex").slice(0,16)}`,extractor:"builtin.database-queue",action:r,keyParts:[{name:"address",value:i,evidence:"identifier",term:{kind:"symbol",symbol:n},derivation:{kind:"mechanically-derived",rule:"database-work-queue.resource",ruleVersion:"1",inputFactIds:[e.id,t.id],sourceSpans:[e.source,t.source]}}],evidence:o,strength:"derived",protocol:"queue",role:r==="queue.send"?"producer":"consumer",derivation:{kind:"mechanically-derived",rule:"database-work-queue.insert-skip-locked",ruleVersion:"1",inputFactIds:[e.id,t.id],sourceSpans:[e.source,t.source]},valuePrecision:"symbolic",resolution:"unresolved"}}var Vi="runtime-boundaries-v15",or=[{id:"http.method-path",protocol:"http",producerActions:["http.request"],consumerActions:["http.handle"],keyNames:["method","path"],traversable:!0},{id:"registry.identity-key",protocol:"registry",producerActions:["registry.dispatch"],consumerActions:["registry.handle"],keyNames:["registry","key"],traversable:!0},{id:"registry.capability-key",protocol:"registry",producerActions:["registry.reference"],consumerActions:["registry.handle"],keyNames:["key"],traversable:!0,requireUniqueConsumer:!0},{id:"queue.address",protocol:"queue",producerActions:["queue.send"],consumerActions:["queue.consume"],keyNames:["address"],traversable:!0},{id:"carrier.discriminator",protocol:"carrier",producerActions:["carrier.publish"],consumerActions:["carrier.consume"],keyNames:["carrier","field","value"],traversable:!0},{id:"resource.identity",protocol:"database",producerActions:["database.write"],consumerActions:["database.read"],keyNames:["resource"],traversable:!1},{id:"framework.effect-httpapi-operation",protocol:"framework",producerActions:[],consumerActions:["framework.handle"],declarationActions:["framework.declare"],keyNames:["adapter","group","operation"],traversable:!0,linkFrom:"declaration",requireUniquePair:!0}],Zh=64;function Yh(e,t={}){let n=H(e),r=new Set(n),i=new Set((t.affectedFiles??[]).map(rS)),o=t.previousGraph?.fileCoverage,s=i.size>0&&t.previousGraph?.extractorVersion===Vi&&o!==void 0&&o.length===t.previousGraph.coverage.filesScanned,a=s?o.filter(P=>r.has(P.file)&&!i.has(P.file)):[],c=new Set(a.flatMap(P=>P.observationIds)),l=s?t.previousGraph.observations.filter(P=>c.has(P.id)&&r.has(P.source.file)):[],u=s?n.filter(P=>i.has(P)):n,d=[],p=o?.reduce((P,ur)=>P+ur.observationIds.length,0)??0,f=performance.now(),m=eS(e,u);it(d,"direct-extraction",f,u.length,m.observations.length,{filesVisited:u.length,filesReused:a.length,factsReused:l.length,factsInvalidated:Math.max(0,p-l.length)});let g=[...a,...m.fileCoverage].sort((P,ur)=>P.file.localeCompare(ur.file)),y=nS(g),S=g.flatMap(P=>P.extractionErrors),b=rn([...l,...m.observations]),N=rn([...b,...Cc(b)]);f=performance.now();let E=bc(e,N);it(d,"http-summary",f,N.length,E.observations.length,{filesVisited:E.filesInspected}),y.set("builtin.wrapper",{id:"builtin.wrapper",applicableFiles:E.filesInspected,observations:E.observations.length,errors:E.errors.length}),S.push(...E.errors);let I=rn([...N,...E.observations]);f=performance.now();let h=gc(e,I);it(d,"http-mount",f,I.length,h.observations.length,{filesVisited:h.filesInspected});let C=rn([...I,...h.observations]);f=performance.now();let _=ac(e,C);it(d,"carrier",f,C.length,_.observations.length,{filesVisited:_.filesInspected}),y.set("builtin.carrier",{id:"builtin.carrier",applicableFiles:_.bodySummaries,observations:_.observations.length,errors:_.errors.length}),S.push(..._.errors);let k=rn([...C,..._.observations]);f=performance.now();let $=iS(k);it(d,"relations",f,k.length,$.length),f=performance.now();let Ui=sS(k,$);it(d,"links",f,$.length,Ui.length),aS(k,$),f=performance.now();let Hi=uS([...cS(k,$),...E.frontiers]);return it(d,"frontiers",f,k.length,Hi.length),{schemaVersion:2,extractorVersion:Vi,observations:k,relationGroups:$,links:Ui,frontiers:Hi,coverage:{filesScanned:n.length,filesWithAst:g.filter(P=>P.hasAst).length,filesWithoutAst:g.filter(P=>!P.hasAst).length,...s?{filesReused:a.length}:{},extractors:[...y.values()],extractionErrors:S,phases:d},fileCoverage:g}}function it(e,t,n,r,i,o={}){e.push({id:t,durationMs:Math.max(0,performance.now()-n),inputFacts:r,outputFacts:i,...o})}function eS(e,t){let n=[],r=[];for(let i of t){let o=x(e,i),s=Li.filter(l=>l.supports(o)),a=s.length>0?j(e,i):null,c={file:i,hasAst:a!==null||tS(i,o),observationIds:[],extractors:[],extractionErrors:[]};if(a)for(let l of s){let u={id:l.id,applicableFiles:1,observations:0,errors:0};try{let d=l.extract(a);u.observations=d.length,n.push(...d),c.observationIds.push(...d.map(p=>p.id))}catch(d){u.errors=1,c.extractionErrors.push(`${l.id} failed for ${i}: ${d instanceof Error?d.message:String(d)}`)}c.extractors.push(u)}r.push(c)}return{observations:n,fileCoverage:r}}function tS(e,t){return t?Se(e)?/<script\b/iu.test(t):W(e)!==null:!1}function nS(e){let t=new Map(Li.map(n=>[n.id,{id:n.id,applicableFiles:0,observations:0,errors:0}]));for(let n of e)for(let r of n.extractors){let i=t.get(r.id);i&&(i.applicableFiles+=r.applicableFiles,i.observations+=r.observations,i.errors+=r.errors)}return t}function rS(e){return e.replaceAll("\\","/").replace(/^\.\//u,"")}function iS(e){let t=new Map;for(let n of or){let r=new Set([...n.producerActions,...n.consumerActions,...n.declarationActions??[]]);for(let i of e){if(!r.has(i.action)||i.strength==="candidate")continue;let o=dS(i,n.keyNames);if(!o)continue;let s=o.map(d=>`${d.name}=${Rc(d.name,d.value)}`).join("\0"),a=i.sourceScope==="production"?"production":i.sourceScope,c=`${n.id}\0${a}\0${s}`,l=`boundary-group:${_c("sha256").update(c).digest("hex").slice(0,16)}`,u=t.get(l)??{id:l,protocol:n.protocol,joinRule:n.id,normalizedKey:s,keyParts:o,producerIds:[],consumerIds:[],declarationIds:[],derivation:{kind:"mechanically-derived",rule:n.id,ruleVersion:"2",inputFactIds:[],sourceSpans:[]}};n.producerActions.includes(i.action)&&u.producerIds.push(i.id),n.consumerActions.includes(i.action)&&u.consumerIds.push(i.id),n.declarationActions?.includes(i.action)&&u.declarationIds.push(i.id),u.derivation.inputFactIds.push(i.id),u.derivation.sourceSpans.push(i.source),t.set(l,u)}}return[...t.values()].map(oS).sort(fS)}function oS(e){return{...e,producerIds:rr(e.producerIds),consumerIds:rr(e.consumerIds),declarationIds:rr(e.declarationIds),derivation:{...e.derivation,inputFactIds:rr(e.derivation.inputFactIds),sourceSpans:[...new Map(e.derivation.sourceSpans.map(t=>[`${t.file}:${t.startLine}:${t.endLine}`,t])).values()]}}}function sS(e,t){let n=new Map(e.map(i=>[i.id,i])),r=new Map;for(let i of t){let o=or.find(a=>a.id===i.joinRule);if(!o?.traversable)continue;let s=o.linkFrom==="declaration"?i.declarationIds:i.producerIds;if(!(s.length===0||i.consumerIds.length===0)&&!(o.requireUniquePair&&(s.length!==1||i.consumerIds.length!==1))&&!(o.requireUniqueConsumer&&i.consumerIds.length!==1)&&!(s.length*i.consumerIds.length>Zh))for(let a of s)for(let c of i.consumerIds){let l=n.get(a),u=n.get(c);if(!l||!u||pS(l,u))continue;let d=l.strength==="derived"||u.strength==="derived"?"derived":"exact",p=`${i.joinRule}\0${a}\0${c}`,f={id:`boundary-link:${_c("sha256").update(p).digest("hex").slice(0,16)}`,from:a,to:c,joinRule:i.joinRule,matchedKeyParts:i.keyParts,strength:d,derivation:{kind:"mechanically-derived",rule:i.joinRule,ruleVersion:"2",inputFactIds:[a,c],sourceSpans:[l.source,u.source]}};r.set(f.id,f)}}return[...r.values()].sort(mS)}function aS(e,t){let n=new Set(t.filter(Ic).flatMap(ir)),r=new Set(t.filter(lS).flatMap(ir));for(let i of e)i.resolution=n.has(i.id)?"locally-linked":r.has(i.id)?"ambiguous":"unresolved"}function cS(e,t){let n=new Set(e.filter(o=>o.strength!=="candidate").map(o=>`${o.action}\0${o.source.file}\0${o.source.startLine}\0${o.source.endLine}`)),r=new Set(t.flatMap(ir)),i=new Set(t.filter(Ic).flatMap(ir));return e.filter(o=>o.sourceScope==="production").filter(o=>o.strength!=="candidate"||!n.has(`${o.action}\0${o.source.file}\0${o.source.startLine}\0${o.source.endLine}`)).filter(o=>!i.has(o.id)).map(o=>{let s=o.keyParts.filter(c=>c.evidence==="expression"||c.value.length===0).map(c=>c.name),a=s.length>0?`${o.extractor} observed ${o.action}, but ${s.join(", ")} remained symbolic or unknown.`:o.resolution==="ambiguous"?`${o.extractor} established the address for ${o.action}, but more than one indexed peer has the same runtime key.`:r.has(o.id)?`${o.extractor} established the address for ${o.action}, but the indexed production scope contains no counterpart role in that relation group.`:`${o.extractor} observed ${o.action}, but no supported factorization rule could establish its addressed relation.`;return{observationId:o.id,reason:a,missingKeyParts:s,sourceScope:o.sourceScope}}).sort((o,s)=>o.observationId.localeCompare(s.observationId))}function ir(e){return[...e.producerIds,...e.consumerIds,...e.declarationIds]}function Ic(e){let t=or.find(r=>r.id===e.joinRule);if(!t)return!1;let n=t.linkFrom==="declaration"?e.declarationIds:e.producerIds;return n.length===0||e.consumerIds.length===0?!1:!t.requireUniquePair||n.length===1&&e.consumerIds.length===1}function lS(e){let t=or.find(r=>r.id===e.joinRule);if(!t?.requireUniquePair)return!1;let n=t.linkFrom==="declaration"?e.declarationIds:e.producerIds;return n.length>0&&e.consumerIds.length>0&&(n.length!==1||e.consumerIds.length!==1)}function uS(e){return[...new Map(e.map(t=>[t.observationId,t])).values()].sort((t,n)=>t.observationId.localeCompare(n.observationId))}function dS(e,t){let n=[];for(let r of t){let i=e.keyParts.find(o=>o.name===r);if(!i||i.evidence==="expression"||i.value.length===0)return null;n.push({...i,value:Rc(r,i.value)})}return n}function Rc(e,t){if(e==="method")return t.toUpperCase();if(e!=="path")return t;let n=t.startsWith("/")?t:`/${t}`;return n.length>1?n.replace(/\/+$/u,""):n}function pS(e,t){return e.source.file===t.source.file&&e.source.startLine===t.source.startLine}function rn(e){return[...new Map(e.map(t=>[t.id,t])).values()].sort((t,n)=>t.source.file.localeCompare(n.source.file)||t.source.startLine-n.source.startLine||t.action.localeCompare(n.action))}function rr(e){return[...new Set(e)].sort()}function fS(e,t){return e.joinRule.localeCompare(t.joinRule)||e.normalizedKey.localeCompare(t.normalizedKey)}function mS(e,t){return e.joinRule.localeCompare(t.joinRule)||e.from.localeCompare(t.from)||e.to.localeCompare(t.to)}import gS from"better-sqlite3";var ar="codebaseiq_runtime_boundaries",ot="codebaseiq_runtime_observations",cr="codebaseiq_runtime_relation_groups",lr="codebaseiq_runtime_relation_participants";function yS(e,t){let n=new gS(e);try{n.exec(`
298
- CREATE TABLE IF NOT EXISTS ${ar} (
299
- singleton INTEGER PRIMARY KEY CHECK (singleton = 1),
300
- schema_version INTEGER NOT NULL,
301
- extractor_version TEXT NOT NULL,
302
- payload TEXT NOT NULL
303
- )
304
- `),SS(n),n.transaction(()=>{n.prepare(`INSERT OR REPLACE INTO ${ar} (singleton, schema_version, extractor_version, payload) VALUES (1, ?, ?, ?)`).run(t.schemaVersion,t.extractorVersion,JSON.stringify(t)),n.prepare(`DELETE FROM ${ot}`).run(),n.prepare(`DELETE FROM ${lr}`).run(),n.prepare(`DELETE FROM ${cr}`).run();let r=n.prepare(`INSERT INTO ${ot}
305
- (id, protocol, action, role, strength, source_scope, resolution, file, start_line, end_line, owner_symbol, payload)
306
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`);for(let s of t.observations)r.run(s.id,s.protocol,s.action,s.role,s.strength,s.sourceScope,s.resolution,s.source.file,s.source.startLine,s.source.endLine,s.owner.symbol,JSON.stringify(s));let i=n.prepare(`INSERT INTO ${cr} (id, protocol, join_rule, normalized_key, payload) VALUES (?, ?, ?, ?, ?)`),o=n.prepare(`INSERT INTO ${lr} (group_id, observation_id, participant_role) VALUES (?, ?, ?)`);for(let s of t.relationGroups){i.run(s.id,s.protocol,s.joinRule,s.normalizedKey,JSON.stringify(s));for(let a of s.producerIds)o.run(s.id,a,"producer");for(let a of s.consumerIds)o.run(s.id,a,"consumer");for(let a of s.declarationIds)o.run(s.id,a,"declaration")}})()}finally{n.close()}}function hS(e,t={}){if(!bS(e,ot))return Fc(e)?.observations??[];let n=[],r=[];return sr(n,r,"protocol",t.protocols),sr(n,r,"action",t.actions),sr(n,r,"source_scope",t.sourceScopes),sr(n,r,"file",t.files),e.all(`SELECT payload FROM ${ot}${n.length>0?` WHERE ${n.join(" AND ")}`:""} ORDER BY file, start_line, id`,...r).flatMap(o=>xS(o.payload))}function SS(e){e.exec(`
307
- CREATE TABLE IF NOT EXISTS ${ot} (
308
- id TEXT PRIMARY KEY,
309
- protocol TEXT NOT NULL,
310
- action TEXT NOT NULL,
311
- role TEXT NOT NULL,
312
- strength TEXT NOT NULL,
313
- source_scope TEXT NOT NULL,
314
- resolution TEXT NOT NULL,
315
- file TEXT NOT NULL,
316
- start_line INTEGER NOT NULL,
317
- end_line INTEGER NOT NULL,
318
- owner_symbol TEXT,
319
- payload TEXT NOT NULL
320
- );
321
- CREATE INDEX IF NOT EXISTS idx_runtime_observations_protocol_action_scope
322
- ON ${ot}(protocol, action, source_scope);
323
- CREATE INDEX IF NOT EXISTS idx_runtime_observations_file_line
324
- ON ${ot}(file, start_line);
325
-
326
- CREATE TABLE IF NOT EXISTS ${cr} (
327
- id TEXT PRIMARY KEY,
328
- protocol TEXT NOT NULL,
329
- join_rule TEXT NOT NULL,
330
- normalized_key TEXT NOT NULL,
331
- payload TEXT NOT NULL
332
- );
333
- CREATE INDEX IF NOT EXISTS idx_runtime_groups_protocol_key
334
- ON ${cr}(protocol, join_rule, normalized_key);
335
-
336
- CREATE TABLE IF NOT EXISTS ${lr} (
337
- group_id TEXT NOT NULL,
338
- observation_id TEXT NOT NULL,
339
- participant_role TEXT NOT NULL,
340
- PRIMARY KEY (group_id, observation_id, participant_role)
341
- );
342
- CREATE INDEX IF NOT EXISTS idx_runtime_participants_observation
343
- ON ${lr}(observation_id, participant_role);
344
- `)}function bS(e,t){return!!e.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",t)}function sr(e,t,n,r){!r||r.length===0||(e.push(`${n} IN (${r.map(()=>"?").join(", ")})`),t.push(...r))}function xS(e){try{return[JSON.parse(e)]}catch{return[]}}function Fc(e){if(!e.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",ar))return null;let n=e.get(`SELECT schema_version, payload FROM ${ar} WHERE singleton = 1`);if(!n||n.schema_version!==2)return null;try{let r=JSON.parse(n.payload);return r.schemaVersion===2&&Array.isArray(r.observations)&&Array.isArray(r.relationGroups)&&Array.isArray(r.links)?r:null}catch{return null}}export{v as a,ye as b,Ne as c,he as d,We as e,PS as f,wS as g,LS as h,kS as i,DS as j,ee as k,so as l,Ho as m,Du as n,yt as o,be as p,le as q,co as r,X as s,x as t,Ft as u,Xc as v,qS as w,KS as x,ie as y,Qr as z,Nv as A,Ev as B,Zr as C,W as D,Se as E,bb as F,xb as G,R as H,A as I,ru as J,iu as K,Lr as L,au as M,cu as N,eb as O,mo as P,H as Q,tb as R,sv as S,Np as T,wn as U,UN as V,Ve as W,M as X,QN as Y,Vn as Z,kn as _,ue as $,te as aa,Oe as ba,z as ca,qe as da,xr as ea,Tt as fa,yo as ga,rb as ha,ib as ia,ob as ja,sb as ka,ci as la,li as ma,SE as na,F as oa,bE as pa,cm as qa,xE as ra,vE as sa,NE as ta,fm as ua,vt as va,EE as wa,Ba as xa,Mn as ya,fi as za,JE as Aa,LE as Ba,Pm as Ca,kE as Da,DE as Ea,hC as Fa,SC as Ga,bC as Ha,ra as Ia,HE as Ja,zE as Ka,pi as La,mi as Ma,Ys as Na,ta as Oa,gi as Pa,mC as Qa,og as Ra,sg as Sa,gC as Ta,ag as Ua,cg as Va,IC as Wa,yi as Xa,MC as Ya,ua as Za,$C as _a,da as $a,XC as ab,kg as bb,Si as cb,JC as db,Og as eb,Mg as fb,QC as gb,ZC as hb,YC as ib,wa as jb,Zg as kb,Un as lb,ry as mb,f_ as nb,m_ as ob,__ as pb,zn as qb,xi as rb,A_ as sb,O_ as tb,M_ as ub,Jn as vb,nt as wb,fe as xb,Zt as yb,Yt as zb,Vi as Ab,Yh as Bb,yS as Cb,hS as Db,Fc as Eb,K_ as Fb,Gt as Gb,G_ as Hb};
345
- //# sourceMappingURL=chunk-3JSXXYTZ.js.map