@blac/core 2.0.13 → 2.0.15

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 (379) hide show
  1. package/README.md +85 -3
  2. package/dist/Cubit-9jal5zdZ.cjs +1 -1
  3. package/dist/Cubit-BAUPiUF7.cjs +359 -286
  4. package/dist/Cubit-BBKF3PIg.js +269 -230
  5. package/dist/Cubit-BC70gaiA.js +453 -0
  6. package/dist/Cubit-BC70gaiA.js.map +1 -0
  7. package/dist/Cubit-BOgUZva7.js +342 -266
  8. package/dist/Cubit-BOxMvpfc.js +273 -232
  9. package/dist/Cubit-BTznt8zg.js +1 -1
  10. package/dist/Cubit-BogJXkLm.js +260 -225
  11. package/dist/Cubit-C-8R_8db.cjs +475 -0
  12. package/dist/Cubit-C-8R_8db.cjs.map +1 -0
  13. package/dist/Cubit-C3Mw3EoO.cjs +401 -0
  14. package/dist/Cubit-C3Mw3EoO.cjs.map +1 -0
  15. package/dist/Cubit-CO8Fr72L.cjs +447 -0
  16. package/dist/Cubit-CO8Fr72L.cjs.map +1 -0
  17. package/dist/Cubit-COfHT1Bm.cjs +300 -259
  18. package/dist/Cubit-CROWjjs9.js +481 -0
  19. package/dist/Cubit-CROWjjs9.js.map +1 -0
  20. package/dist/Cubit-CWP8Ddzx.cjs +510 -0
  21. package/dist/Cubit-CWP8Ddzx.cjs.map +1 -0
  22. package/dist/Cubit-CXxh9iol.js +284 -242
  23. package/dist/Cubit-CYOWfzQt.cjs +297 -254
  24. package/dist/Cubit-CZaf_fp4.cjs +1 -1
  25. package/dist/Cubit-C_dUEUdd.cjs +359 -286
  26. package/dist/Cubit-C_rxRCTN.cjs +523 -0
  27. package/dist/Cubit-C_rxRCTN.cjs.map +1 -0
  28. package/dist/Cubit-CcKgMEBO.js +281 -239
  29. package/dist/Cubit-CfT6Y1jl.js +328 -280
  30. package/dist/Cubit-CynJruuO.js +369 -0
  31. package/dist/Cubit-CynJruuO.js.map +1 -0
  32. package/dist/Cubit-D2vQ6nMb.js +342 -266
  33. package/dist/Cubit-D7jOZCoZ.js +342 -266
  34. package/dist/Cubit-D9j3IGPc.cjs +523 -0
  35. package/dist/Cubit-D9j3IGPc.cjs.map +1 -0
  36. package/dist/Cubit-DKEY9WYq.cjs +276 -240
  37. package/dist/Cubit-DMV_0TCp.js +481 -0
  38. package/dist/Cubit-DMV_0TCp.js.map +1 -0
  39. package/dist/Cubit-DP5DXPUK.js +342 -266
  40. package/dist/Cubit-DRFkzD2h.js +426 -0
  41. package/dist/Cubit-DRFkzD2h.js.map +1 -0
  42. package/dist/Cubit-DbnhTUaZ.cjs +359 -286
  43. package/dist/Cubit-DrqG3SP3.cjs +349 -300
  44. package/dist/Cubit-DsDkCo42.cjs +292 -250
  45. package/dist/Cubit-DwRw1E9D.cjs +289 -247
  46. package/dist/Cubit-Dw_kFBgc.js +1 -1
  47. package/dist/Cubit-KiXZCubP.cjs +1 -1
  48. package/dist/Cubit-Ksj7G4uR.js +342 -266
  49. package/dist/Cubit-MkjbpcPf.cjs +359 -286
  50. package/dist/Cubit-NRhvdDQ6.js +279 -239
  51. package/dist/Cubit-PMTXxI_u.js +1 -1
  52. package/dist/Cubit-VJuu2tt9.js +481 -0
  53. package/dist/Cubit-VJuu2tt9.js.map +1 -0
  54. package/dist/Cubit-jz922NKf.cjs +300 -257
  55. package/dist/Cubit-kU5_4jgC.cjs +359 -286
  56. package/dist/StateContainerRegistry-B4yVMYbx.cjs +1057 -0
  57. package/dist/StateContainerRegistry-B4yVMYbx.cjs.map +1 -0
  58. package/dist/StateContainerRegistry-BAcxouCu.js +683 -615
  59. package/dist/StateContainerRegistry-BK57H92E.js +701 -630
  60. package/dist/StateContainerRegistry-BRBATSrx.cjs +1030 -0
  61. package/dist/StateContainerRegistry-BRBATSrx.cjs.map +1 -0
  62. package/dist/StateContainerRegistry-BgBIKcQF.js +956 -0
  63. package/dist/StateContainerRegistry-BgBIKcQF.js.map +1 -0
  64. package/dist/StateContainerRegistry-BglEhqdA.js +669 -606
  65. package/dist/StateContainerRegistry-BhcnG0DF.js +625 -562
  66. package/dist/StateContainerRegistry-BpO5t-0i.js +642 -580
  67. package/dist/StateContainerRegistry-BqS-wpb_.js +957 -0
  68. package/dist/StateContainerRegistry-BqS-wpb_.js.map +1 -0
  69. package/dist/StateContainerRegistry-BrEGYPZT.cjs +1029 -0
  70. package/dist/StateContainerRegistry-BrEGYPZT.cjs.map +1 -0
  71. package/dist/StateContainerRegistry-Bxfne4A7.cjs +908 -0
  72. package/dist/StateContainerRegistry-Bxfne4A7.cjs.map +1 -0
  73. package/dist/StateContainerRegistry-C0E7vsgy.js +758 -0
  74. package/dist/StateContainerRegistry-C0E7vsgy.js.map +1 -0
  75. package/dist/StateContainerRegistry-C0I77Ndz.cjs +920 -0
  76. package/dist/StateContainerRegistry-C0I77Ndz.cjs.map +1 -0
  77. package/dist/StateContainerRegistry-CDH9mnQS.cjs +668 -614
  78. package/dist/StateContainerRegistry-CTOXUf75.cjs +695 -640
  79. package/dist/StateContainerRegistry-CX2CBOmv.cjs +739 -679
  80. package/dist/StateContainerRegistry-CXnnf2-l.js +867 -0
  81. package/dist/StateContainerRegistry-CXnnf2-l.js.map +1 -0
  82. package/dist/StateContainerRegistry-CehuIpK_.cjs +811 -0
  83. package/dist/StateContainerRegistry-CehuIpK_.cjs.map +1 -0
  84. package/dist/StateContainerRegistry-Ci0ajc5g.js +680 -612
  85. package/dist/StateContainerRegistry-Ck2-XmT_.js +587 -527
  86. package/dist/StateContainerRegistry-D1lVJFGL.cjs +706 -646
  87. package/dist/StateContainerRegistry-DC4N73O6.js +632 -569
  88. package/dist/StateContainerRegistry-DOuGI-l5.js +645 -582
  89. package/dist/StateContainerRegistry-DT66lr3I.cjs +651 -596
  90. package/dist/StateContainerRegistry-DmmzYa7S.js +974 -0
  91. package/dist/StateContainerRegistry-DmmzYa7S.js.map +1 -0
  92. package/dist/StateContainerRegistry-Upsrlg9G.cjs +709 -649
  93. package/dist/StateContainerRegistry-WznfcA-Q.js +855 -0
  94. package/dist/StateContainerRegistry-WznfcA-Q.js.map +1 -0
  95. package/dist/StateContainerRegistry-Yph6UCA_.js +637 -569
  96. package/dist/StateContainerRegistry-mseeTqSA.cjs +671 -616
  97. package/dist/StateContainerRegistry-pRNxHNFD.cjs +658 -603
  98. package/dist/StateContainerRegistry-vXMWtG7J.cjs +613 -561
  99. package/dist/StateContainerRegistry-v_prqMcI.cjs +663 -603
  100. package/dist/branded-BSeA_mZO.cjs.map +1 -1
  101. package/dist/branded-DCqi3De1.cjs +11 -11
  102. package/dist/branded-DwtzSsg0.js.map +1 -1
  103. package/dist/branded-Max3xOTA.js +6 -6
  104. package/dist/config-0ZD9i3wy.js +16 -0
  105. package/dist/config-0ZD9i3wy.js.map +1 -0
  106. package/dist/config-B3NIwDQv.cjs +20 -20
  107. package/dist/config-BKGHop0V.js +5 -5
  108. package/dist/config-BKoaAlmb.js +5 -5
  109. package/dist/config-BPj08-8h.cjs +32 -0
  110. package/dist/config-BPj08-8h.cjs.map +1 -0
  111. package/dist/config-BR0Xy-Tn.cjs +20 -20
  112. package/dist/config-B_4xXpvK.cjs +32 -0
  113. package/dist/config-B_4xXpvK.cjs.map +1 -0
  114. package/dist/config-BflrQM4_.cjs +32 -0
  115. package/dist/config-BflrQM4_.cjs.map +1 -0
  116. package/dist/config-BzObBsk2.cjs +32 -0
  117. package/dist/config-BzObBsk2.cjs.map +1 -0
  118. package/dist/config-C0yumL1H.cjs +32 -0
  119. package/dist/config-C0yumL1H.cjs.map +1 -0
  120. package/dist/config-C8xqVHTf.js +16 -0
  121. package/dist/config-C8xqVHTf.js.map +1 -0
  122. package/dist/config-CCUhIYIF.js +5 -5
  123. package/dist/config-CGo__MAt.js +16 -0
  124. package/dist/config-CGo__MAt.js.map +1 -0
  125. package/dist/config-CQH9fTY-.cjs +20 -20
  126. package/dist/config-CR_Bz7RD.js +5 -5
  127. package/dist/config-CTOa-yPN.cjs +20 -20
  128. package/dist/config-Cd7Q-B4g.js +16 -0
  129. package/dist/config-Cd7Q-B4g.js.map +1 -0
  130. package/dist/config-CmDEX-1o.js +16 -0
  131. package/dist/config-CmDEX-1o.js.map +1 -0
  132. package/dist/config-CoNMTnMA.cjs +32 -0
  133. package/dist/config-CoNMTnMA.cjs.map +1 -0
  134. package/dist/config-Cwj8-C1J.js +5 -5
  135. package/dist/config-D3jisfdj.cjs +20 -20
  136. package/dist/config-D4GifZQ4.js +5 -5
  137. package/dist/config-DDrSQGpQ.cjs +20 -20
  138. package/dist/config-DEcslxan.cjs +20 -20
  139. package/dist/config-DMNZ2YLV.cjs +20 -20
  140. package/dist/config-De9oQ6Ki.js +5 -5
  141. package/dist/config-DoHx0Xsl.js +16 -0
  142. package/dist/config-DoHx0Xsl.js.map +1 -0
  143. package/dist/config-DokTzpr8.cjs +20 -20
  144. package/dist/config-DslYBm4Z.js +5 -5
  145. package/dist/config-H6FAqbW4.cjs +20 -20
  146. package/dist/config-Yp645dGK.js +5 -5
  147. package/dist/config-ispAzOZV.js +5 -5
  148. package/dist/config.d.cts +72 -0
  149. package/dist/config.d.ts +72 -0
  150. package/dist/constants.d.cts +13 -0
  151. package/dist/constants.d.ts +13 -0
  152. package/dist/core/Cubit.d.ts +14 -4
  153. package/dist/core/StateContainer.d.ts +111 -11
  154. package/dist/core/StateContainerRegistry.d.ts +55 -11
  155. package/dist/core/symbols.d.ts +26 -0
  156. package/dist/debug.cjs +3 -3
  157. package/dist/debug.js +3 -3
  158. package/dist/decorators/blac.d.ts +17 -0
  159. package/dist/ensure-9VEq5H0L.js +3 -3
  160. package/dist/ensure-BB6xHQAF.cjs +14 -0
  161. package/dist/ensure-BB6xHQAF.cjs.map +1 -0
  162. package/dist/ensure-BNDfTzqg.cjs +8 -8
  163. package/dist/ensure-BVCnjU7r.js +343 -267
  164. package/dist/ensure-BbzGXjep.cjs +8 -8
  165. package/dist/ensure-BlIaQai6.js +9 -0
  166. package/dist/ensure-BlIaQai6.js.map +1 -0
  167. package/dist/ensure-Bm3oHxga.js +9 -0
  168. package/dist/ensure-Bm3oHxga.js.map +1 -0
  169. package/dist/ensure-C3eIRs6e.cjs +8 -8
  170. package/dist/ensure-CJZL7bcA.cjs +365 -292
  171. package/dist/ensure-CN6unBOe.cjs +8 -8
  172. package/dist/ensure-CU-B1ywv.js +3 -3
  173. package/dist/ensure-CWKzeno7.js +3 -3
  174. package/dist/ensure-CkENsuQ9.js +9 -0
  175. package/dist/ensure-CkENsuQ9.js.map +1 -0
  176. package/dist/ensure-Cm-4_LSh.cjs +14 -0
  177. package/dist/ensure-Cm-4_LSh.cjs.map +1 -0
  178. package/dist/ensure-Cqex5r1P.cjs +14 -0
  179. package/dist/ensure-Cqex5r1P.cjs.map +1 -0
  180. package/dist/ensure-Cv5AbNGZ.js +9 -0
  181. package/dist/ensure-Cv5AbNGZ.js.map +1 -0
  182. package/dist/ensure-D63lEMUK.cjs +8 -8
  183. package/dist/ensure-DGEtPU9A.cjs +8 -8
  184. package/dist/ensure-DM3qb336.cjs +14 -0
  185. package/dist/ensure-DM3qb336.cjs.map +1 -0
  186. package/dist/ensure-DME-_T0j.cjs +8 -8
  187. package/dist/ensure-DWd0GCYB.js +3 -3
  188. package/dist/ensure-DamKOP6q.cjs +8 -8
  189. package/dist/ensure-Dcfptl-A.js +9 -0
  190. package/dist/ensure-Dcfptl-A.js.map +1 -0
  191. package/dist/ensure-Def-EBWG.js +3 -3
  192. package/dist/ensure-DnHL5QiQ.cjs +14 -0
  193. package/dist/ensure-DnHL5QiQ.cjs.map +1 -0
  194. package/dist/ensure-Dr7I78Ku.cjs +8 -8
  195. package/dist/ensure-SLVdGd5b.js +3 -3
  196. package/dist/ensure-Sb92MCXu.js +3 -3
  197. package/dist/ensure-gFlvevGm.cjs +14 -0
  198. package/dist/ensure-gFlvevGm.cjs.map +1 -0
  199. package/dist/ensure-l2-H7S5W.js +3 -3
  200. package/dist/ensure-mkL-3qh8.js +9 -0
  201. package/dist/ensure-mkL-3qh8.js.map +1 -0
  202. package/dist/ensure-n80crSlX.js +3 -3
  203. package/dist/ensure-nCxg7MCN.js +3 -3
  204. package/dist/ensure-vS71MV4q.cjs +8 -8
  205. package/dist/index.cjs +37 -14
  206. package/dist/index.cjs.map +1 -1
  207. package/dist/index.d.cts +14 -4
  208. package/dist/index.d.ts +14 -4
  209. package/dist/index.js +23 -10
  210. package/dist/index.js.map +1 -1
  211. package/dist/management-6oQbmf0z.js +41 -0
  212. package/dist/management-6oQbmf0z.js.map +1 -0
  213. package/dist/management-B46QwA9Y.js +20 -11
  214. package/dist/management-B9yrRpeg.js +41 -0
  215. package/dist/management-B9yrRpeg.js.map +1 -0
  216. package/dist/management-BCKTEZ8Q.js +20 -11
  217. package/dist/management-BbMzdXbT.js +41 -0
  218. package/dist/management-BbMzdXbT.js.map +1 -0
  219. package/dist/management-Bg652agq.js +20 -11
  220. package/dist/management-BnedF5ZD.cjs +50 -50
  221. package/dist/management-BoUa99eB.cjs +79 -0
  222. package/dist/management-BoUa99eB.cjs.map +1 -0
  223. package/dist/management-C4SHcrJm.cjs +79 -0
  224. package/dist/management-C4SHcrJm.cjs.map +1 -0
  225. package/dist/management-CK-GL3wY.js +20 -11
  226. package/dist/management-CPhgY8OE.js +41 -0
  227. package/dist/management-CPhgY8OE.js.map +1 -0
  228. package/dist/management-CU_V3LIP.js +20 -11
  229. package/dist/management-CUwXDSi9.cjs +79 -0
  230. package/dist/management-CUwXDSi9.cjs.map +1 -0
  231. package/dist/management-CaqiyNzB.js +20 -11
  232. package/dist/management-Cin-JvYe.js +20 -11
  233. package/dist/management-ClaXym0F.cjs +50 -50
  234. package/dist/management-DL0Uzsoz.js +20 -11
  235. package/dist/management-DLdAQfqk.cjs +79 -0
  236. package/dist/management-DLdAQfqk.cjs.map +1 -0
  237. package/dist/management-DMZ8qpwr.cjs +50 -50
  238. package/dist/management-DTzcC6aD.cjs +79 -0
  239. package/dist/management-DTzcC6aD.cjs.map +1 -0
  240. package/dist/management-DYLNyj9p.cjs +50 -50
  241. package/dist/management-Dag9u4t6.cjs +50 -50
  242. package/dist/management-DbMRdDBo.cjs +50 -50
  243. package/dist/management-DfnDAKmP.js +41 -0
  244. package/dist/management-DfnDAKmP.js.map +1 -0
  245. package/dist/management-DjBU1gtb.cjs +50 -50
  246. package/dist/management-DwCozsY8.js +20 -11
  247. package/dist/management-H4m3ciJO.js +32 -0
  248. package/dist/management-H4m3ciJO.js.map +1 -0
  249. package/dist/management-Xo3A6Za3.cjs +79 -0
  250. package/dist/management-Xo3A6Za3.cjs.map +1 -0
  251. package/dist/management-ZU2YzOkr.js +18 -10
  252. package/dist/management-baPDwA9n.cjs +50 -50
  253. package/dist/management-jQGCvZNN.cjs +44 -44
  254. package/dist/management-ry_KteFK.cjs +50 -50
  255. package/dist/plugin/BlacPlugin.d.ts +89 -15
  256. package/dist/plugin/PluginManager.d.ts +65 -5
  257. package/dist/plugins.cjs +1 -1
  258. package/dist/plugins.d.cts +2 -2
  259. package/dist/plugins.d.ts +2 -2
  260. package/dist/plugins.js +1 -1
  261. package/dist/registry/acquire.d.ts +9 -2
  262. package/dist/registry/ensure.d.ts +2 -2
  263. package/dist/registry/index.d.ts +1 -1
  264. package/dist/resolve-dependencies-B2QggQAi.js +641 -558
  265. package/dist/resolve-dependencies-B6JDXvpr.js +651 -566
  266. package/dist/resolve-dependencies-BAKAoD0U.js +878 -0
  267. package/dist/resolve-dependencies-BAKAoD0U.js.map +1 -0
  268. package/dist/resolve-dependencies-BFZQq60Y.cjs +724 -666
  269. package/dist/resolve-dependencies-BGafS3Ww.js +643 -561
  270. package/dist/resolve-dependencies-BHd34gS3.cjs +724 -666
  271. package/dist/resolve-dependencies-BNeayhbQ.cjs +732 -671
  272. package/dist/resolve-dependencies-BWEMpuDy.js +641 -558
  273. package/dist/resolve-dependencies-BiWkW2eS.js +643 -561
  274. package/dist/resolve-dependencies-BjxCztYD.js +739 -0
  275. package/dist/resolve-dependencies-BjxCztYD.js.map +1 -0
  276. package/dist/resolve-dependencies-BlyBV0hB.cjs +969 -0
  277. package/dist/resolve-dependencies-BlyBV0hB.cjs.map +1 -0
  278. package/dist/resolve-dependencies-By26rT_i.js +651 -566
  279. package/dist/resolve-dependencies-C9Kf7AzY.cjs +724 -666
  280. package/dist/resolve-dependencies-CTzV1txG.js +643 -561
  281. package/dist/resolve-dependencies-CWjuGHiF.cjs +969 -0
  282. package/dist/resolve-dependencies-CWjuGHiF.cjs.map +1 -0
  283. package/dist/resolve-dependencies-ClSsP0DJ.cjs +722 -663
  284. package/dist/resolve-dependencies-D0vTzZgs.js +643 -561
  285. package/dist/resolve-dependencies-D2WnZMF-.cjs +724 -666
  286. package/dist/resolve-dependencies-DCBLTeza.cjs +969 -0
  287. package/dist/resolve-dependencies-DCBLTeza.cjs.map +1 -0
  288. package/dist/resolve-dependencies-DMlqYJR2.js +643 -561
  289. package/dist/resolve-dependencies-DP6U1EYB.cjs +840 -0
  290. package/dist/resolve-dependencies-DP6U1EYB.cjs.map +1 -0
  291. package/dist/resolve-dependencies-DSQNXvnV.cjs +724 -666
  292. package/dist/resolve-dependencies-DV3HO_uH.js +878 -0
  293. package/dist/resolve-dependencies-DV3HO_uH.js.map +1 -0
  294. package/dist/resolve-dependencies-DXwMhP0Y.js +878 -0
  295. package/dist/resolve-dependencies-DXwMhP0Y.js.map +1 -0
  296. package/dist/resolve-dependencies-DbRWlt9u.js +878 -0
  297. package/dist/resolve-dependencies-DbRWlt9u.js.map +1 -0
  298. package/dist/resolve-dependencies-DcUUva2P.cjs +724 -666
  299. package/dist/resolve-dependencies-Dd8T6TLt.cjs +724 -666
  300. package/dist/resolve-dependencies-Dfdp_DZd.cjs +732 -671
  301. package/dist/resolve-dependencies-GJ8PNyNB.cjs +969 -0
  302. package/dist/resolve-dependencies-GJ8PNyNB.cjs.map +1 -0
  303. package/dist/resolve-dependencies-KSpTt4jy.cjs +722 -663
  304. package/dist/resolve-dependencies-Nvjp4CwS.js +643 -561
  305. package/dist/resolve-dependencies-f-QUqYiL.js +643 -561
  306. package/dist/testing.cjs +27 -20
  307. package/dist/testing.cjs.map +1 -1
  308. package/dist/testing.d.cts +22 -1
  309. package/dist/testing.d.ts +22 -1
  310. package/dist/testing.js +27 -21
  311. package/dist/testing.js.map +1 -1
  312. package/dist/tracked-B77j2g9M.js +171 -151
  313. package/dist/tracked-BDVi2LKM.cjs +196 -175
  314. package/dist/tracked-BFdJCzL0.cjs +242 -0
  315. package/dist/tracked-BFdJCzL0.cjs.map +1 -0
  316. package/dist/tracked-BH-gX4T1.cjs +196 -175
  317. package/dist/tracked-BTHok3Dl.cjs +196 -175
  318. package/dist/tracked-BTbFkFeM.js +186 -166
  319. package/dist/tracked-BU_OBWqM.cjs +242 -0
  320. package/dist/tracked-BU_OBWqM.cjs.map +1 -0
  321. package/dist/tracked-BfctH2es.cjs +242 -0
  322. package/dist/tracked-BfctH2es.cjs.map +1 -0
  323. package/dist/tracked-BhQtzUhZ.js +186 -166
  324. package/dist/tracked-BnqrYXiO.js +212 -0
  325. package/dist/tracked-BnqrYXiO.js.map +1 -0
  326. package/dist/tracked-BtgFOGup.js +212 -0
  327. package/dist/tracked-BtgFOGup.js.map +1 -0
  328. package/dist/tracked-C3nIS4J7.cjs +242 -0
  329. package/dist/tracked-C3nIS4J7.cjs.map +1 -0
  330. package/dist/tracked-C52awNV9.js +171 -151
  331. package/dist/tracked-CGzduF2m.js +186 -166
  332. package/dist/tracked-CK_-ixtX.cjs +196 -175
  333. package/dist/tracked-CLlvURln.js +186 -166
  334. package/dist/tracked-CgHWmuGC.cjs +211 -190
  335. package/dist/tracked-CoAlC8fs.js +171 -151
  336. package/dist/tracked-D3Xjm1H1.cjs +211 -190
  337. package/dist/tracked-DB6yMV5F.js +212 -0
  338. package/dist/tracked-DB6yMV5F.js.map +1 -0
  339. package/dist/tracked-DBn-bs_G.js +171 -151
  340. package/dist/tracked-DMBTDF0P.js +171 -151
  341. package/dist/tracked-DN3h3Rp1.js +171 -151
  342. package/dist/tracked-DOGh1Q5Z.cjs +242 -0
  343. package/dist/tracked-DOGh1Q5Z.cjs.map +1 -0
  344. package/dist/tracked-DUkp4zve.cjs +196 -175
  345. package/dist/tracked-D_ou7mYG.js +212 -0
  346. package/dist/tracked-D_ou7mYG.js.map +1 -0
  347. package/dist/tracked-Dcu6EATB.js +171 -151
  348. package/dist/tracked-GvAJQVAI.cjs +227 -196
  349. package/dist/tracked-O2lv-kJV.cjs +211 -190
  350. package/dist/tracked-WF6aXuAo.js +186 -162
  351. package/dist/tracked-d_sQWU3c.cjs +196 -175
  352. package/dist/tracked-n9TMK-30.cjs +196 -175
  353. package/dist/tracked-njU-_pVa.cjs +211 -190
  354. package/dist/tracked-zAgmKIlC.js +212 -0
  355. package/dist/tracked-zAgmKIlC.js.map +1 -0
  356. package/dist/tracking/dependency-manager.d.ts +33 -29
  357. package/dist/tracking/index.d.ts +16 -1
  358. package/dist/tracking/iteration-perf.bench.d.ts +1 -0
  359. package/dist/tracking/path-utils.d.ts +18 -1
  360. package/dist/tracking/resolve-dependencies.d.ts +3 -1
  361. package/dist/tracking/tracked.d.ts +37 -34
  362. package/dist/tracking/tracking-proxy.d.ts +94 -47
  363. package/dist/tracking.cjs +12 -9
  364. package/dist/tracking.js +32 -2
  365. package/dist/types/utilities.d.ts +15 -3
  366. package/dist/types.cjs +1 -1
  367. package/dist/types.js +1 -1
  368. package/dist/utils/static-props.d.ts +14 -0
  369. package/dist/utils/structural-key.d.ts +14 -0
  370. package/dist/watch/watch.d.ts +1 -1
  371. package/dist/watch-BpwaUL8r.cjs +68 -0
  372. package/dist/watch-BpwaUL8r.cjs.map +1 -0
  373. package/dist/watch-DWCqXllW.js +57 -0
  374. package/dist/watch-DWCqXllW.js.map +1 -0
  375. package/dist/watch-entry.cjs +3 -6
  376. package/dist/watch-entry.d.cts +1 -3
  377. package/dist/watch-entry.d.ts +1 -3
  378. package/dist/watch-entry.js +2 -2
  379. package/package.json +4 -14
@@ -1,654 +1,739 @@
1
- import { c as BLAC_DEFAULTS, l as BLAC_ERROR_PREFIX } from "./StateContainerRegistry-BK57H92E.js";
2
- import { t as getRegistry } from "./config-ispAzOZV.js";
1
+ import {
2
+ c as BLAC_DEFAULTS,
3
+ l as BLAC_ERROR_PREFIX,
4
+ } from './StateContainerRegistry-BK57H92E.js';
5
+ import { t as getRegistry } from './config-ispAzOZV.js';
3
6
  //#region src/tracking/path-utils.ts
4
7
  /**
5
- * Path utilities for dependency tracking
6
- *
7
- * Provides utilities for parsing property paths and extracting values
8
- * from nested objects using path strings.
9
- *
10
- * @internal
11
- */
12
- /**
13
- * Parse a property path string into an array of segments
14
- *
15
- * @internal
16
- *
17
- * Handles both dot notation (a.b.c) and bracket notation (a[0].b)
18
- *
19
- * @example
20
- * ```ts
21
- * parsePath('user.name') // ['user', 'name']
22
- * parsePath('items[0].name') // ['items', '0', 'name']
23
- * parsePath('data.users[2].address.city') // ['data', 'users', '2', 'address', 'city']
24
- * ```
25
- */
8
+ * Path utilities for dependency tracking
9
+ *
10
+ * Provides utilities for parsing property paths and extracting values
11
+ * from nested objects using path strings.
12
+ *
13
+ * @internal
14
+ */
15
+ /**
16
+ * Parse a property path string into an array of segments
17
+ *
18
+ * @internal
19
+ *
20
+ * Handles both dot notation (a.b.c) and bracket notation (a[0].b)
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * parsePath('user.name') // ['user', 'name']
25
+ * parsePath('items[0].name') // ['items', '0', 'name']
26
+ * parsePath('data.users[2].address.city') // ['data', 'users', '2', 'address', 'city']
27
+ * ```
28
+ */
26
29
  function parsePath(path) {
27
- const segments = [];
28
- let current = "";
29
- let i = 0;
30
- while (i < path.length) {
31
- const char = path[i];
32
- if (char === ".") {
33
- if (current) segments.push(current);
34
- current = "";
35
- } else if (char === "[") {
36
- if (current) segments.push(current);
37
- current = "";
38
- i++;
39
- while (i < path.length && path[i] !== "]") current += path[i++];
40
- if (current) segments.push(current);
41
- current = "";
42
- } else current += char;
43
- i++;
44
- }
45
- if (current) segments.push(current);
46
- return segments;
47
- }
48
- /**
49
- * Get a value from an object using a path of segments
50
- *
51
- * @example
52
- * ```ts
53
- * const obj = { user: { name: 'Alice', age: 30 } }
54
- * getValueAtPath(obj, ['user', 'name']) // 'Alice'
55
- * getValueAtPath(obj, ['user', 'age']) // 30
56
- * getValueAtPath(obj, ['user', 'missing']) // undefined
57
- * ```
58
- *
59
- * @internal
60
- */
30
+ const segments = [];
31
+ let current = '';
32
+ let i = 0;
33
+ while (i < path.length) {
34
+ const char = path[i];
35
+ if (char === '.') {
36
+ if (current) segments.push(current);
37
+ current = '';
38
+ } else if (char === '[') {
39
+ if (current) segments.push(current);
40
+ current = '';
41
+ i++;
42
+ while (i < path.length && path[i] !== ']') current += path[i++];
43
+ if (current) segments.push(current);
44
+ current = '';
45
+ } else current += char;
46
+ i++;
47
+ }
48
+ if (current) segments.push(current);
49
+ return segments;
50
+ }
51
+ /**
52
+ * Get a value from an object using a path of segments
53
+ *
54
+ * @example
55
+ * ```ts
56
+ * const obj = { user: { name: 'Alice', age: 30 } }
57
+ * getValueAtPath(obj, ['user', 'name']) // 'Alice'
58
+ * getValueAtPath(obj, ['user', 'age']) // 30
59
+ * getValueAtPath(obj, ['user', 'missing']) // undefined
60
+ * ```
61
+ *
62
+ * @internal
63
+ */
61
64
  function getValueAtPath(obj, segments) {
62
- if (obj == null) return void 0;
63
- let current = obj;
64
- for (let i = 0; i < segments.length; i++) {
65
- current = current[segments[i]];
66
- if (current == null) return void 0;
67
- }
68
- return current;
69
- }
70
- /**
71
- * Shallow equality comparison for arrays
72
- *
73
- * Compares two arrays element-by-element using Object.is
74
- *
75
- * @example
76
- * ```ts
77
- * shallowEqual([1, 2, 3], [1, 2, 3]) // true
78
- * shallowEqual([1, 2, 3], [1, 2, 4]) // false
79
- * shallowEqual([1, 2], [1, 2, 3]) // false
80
- * ```
81
- *
82
- * @internal
83
- */
65
+ if (obj == null) return void 0;
66
+ let current = obj;
67
+ for (let i = 0; i < segments.length; i++) {
68
+ current = current[segments[i]];
69
+ if (current == null) return void 0;
70
+ }
71
+ return current;
72
+ }
73
+ /**
74
+ * Shallow equality comparison for arrays
75
+ *
76
+ * Compares two arrays element-by-element using Object.is
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * shallowEqual([1, 2, 3], [1, 2, 3]) // true
81
+ * shallowEqual([1, 2, 3], [1, 2, 4]) // false
82
+ * shallowEqual([1, 2], [1, 2, 3]) // false
83
+ * ```
84
+ *
85
+ * @internal
86
+ */
84
87
  function shallowEqual(arr1, arr2) {
85
- if (arr1.length !== arr2.length) return false;
86
- for (let i = 0; i < arr1.length; i++) if (!Object.is(arr1[i], arr2[i])) return false;
87
- return true;
88
+ if (arr1.length !== arr2.length) return false;
89
+ for (let i = 0; i < arr1.length; i++)
90
+ if (!Object.is(arr1[i], arr2[i])) return false;
91
+ return true;
88
92
  }
89
93
  //#endregion
90
94
  //#region src/tracking/tracking-proxy.ts
91
95
  /**
92
- * Consolidated Tracking System
93
- *
94
- * This module provides all dependency and getter tracking functionality:
95
- * - Proxy creation for automatic property access tracking
96
- * - Dependency path tracking and change detection
97
- * - Getter execution tracking for computed properties
98
- * - Combined tracking proxy for watch/waitUntil use cases
99
- */
100
- /**
101
- * Check if a value can be proxied
102
- * Returns true for plain objects and arrays only.
103
- * @internal
104
- */
96
+ * Consolidated Tracking System
97
+ *
98
+ * This module provides all dependency and getter tracking functionality:
99
+ * - Proxy creation for automatic property access tracking
100
+ * - Dependency path tracking and change detection
101
+ * - Getter execution tracking for computed properties
102
+ * - Combined tracking proxy for watch/waitUntil use cases
103
+ */
104
+ /**
105
+ * Check if a value can be proxied
106
+ * Returns true for plain objects and arrays only.
107
+ * @internal
108
+ */
105
109
  function isProxyable(value) {
106
- if (typeof value !== "object" || value === null) return false;
107
- const proto = Object.getPrototypeOf(value);
108
- return proto === Object.prototype || proto === Array.prototype;
110
+ if (typeof value !== 'object' || value === null) return false;
111
+ const proto = Object.getPrototypeOf(value);
112
+ return proto === Object.prototype || proto === Array.prototype;
109
113
  }
110
114
  /**
111
- * Create a new proxy tracker state
112
- * @internal
113
- */
115
+ * Create a new proxy tracker state
116
+ * @internal
117
+ */
114
118
  function createProxyState() {
115
- return {
116
- trackedPaths: /* @__PURE__ */ new Set(),
117
- isTracking: false,
118
- proxyCache: /* @__PURE__ */ new WeakMap(),
119
- boundFunctionsCache: null,
120
- lastProxiedState: null,
121
- lastProxy: null,
122
- maxDepth: 10
123
- };
124
- }
125
- /**
126
- * Start tracking property accesses
127
- * @internal
128
- */
119
+ return {
120
+ trackedPaths: /* @__PURE__ */ new Set(),
121
+ isTracking: false,
122
+ proxyCache: /* @__PURE__ */ new WeakMap(),
123
+ boundFunctionsCache: null,
124
+ lastProxiedState: null,
125
+ lastProxy: null,
126
+ maxDepth: 10,
127
+ };
128
+ }
129
+ /**
130
+ * Start tracking property accesses
131
+ * @internal
132
+ */
129
133
  function startProxy(state) {
130
- state.isTracking = true;
131
- state.trackedPaths.clear();
134
+ state.isTracking = true;
135
+ state.trackedPaths.clear();
132
136
  }
133
137
  /**
134
- * Stop tracking and return the tracked paths
135
- * @internal
136
- */
138
+ * Stop tracking and return the tracked paths
139
+ * @internal
140
+ */
137
141
  function stopProxy(state) {
138
- state.isTracking = false;
139
- const paths = state.trackedPaths;
140
- state.trackedPaths = /* @__PURE__ */ new Set();
141
- return paths;
142
+ state.isTracking = false;
143
+ const paths = state.trackedPaths;
144
+ state.trackedPaths = /* @__PURE__ */ new Set();
145
+ return paths;
142
146
  }
143
147
  /**
144
- * Create a proxy for an array with property access tracking
145
- * @internal
146
- */
148
+ * Create a proxy for an array with property access tracking
149
+ * @internal
150
+ */
147
151
  function createArrayProxy(state, target, path, depth = 0) {
148
- const proxy = new Proxy(target, { get: (arr, prop) => {
149
- if (typeof prop === "symbol") return Reflect.get(arr, prop);
150
- const value = Reflect.get(arr, prop);
151
- if (typeof value === "function") {
152
- if (!state.boundFunctionsCache) state.boundFunctionsCache = /* @__PURE__ */ new WeakMap();
153
- const cached = state.boundFunctionsCache.get(value);
154
- if (cached) return cached;
155
- const bound = value.bind(arr);
156
- state.boundFunctionsCache.set(value, bound);
157
- return bound;
158
- }
159
- if (prop === "length") {
160
- if (state.isTracking) {
161
- const fullPath = path ? `${path}.length` : "length";
162
- state.trackedPaths.add(fullPath);
163
- }
164
- return value;
165
- }
166
- let fullPath;
167
- if (typeof prop === "string") {
168
- const index = Number(prop);
169
- if (!isNaN(index) && index >= 0) fullPath = path ? `${path}[${index}]` : `[${index}]`;
170
- else fullPath = path ? `${path}.${prop}` : prop;
171
- } else return value;
172
- if (isProxyable(value)) return createInternal(state, value, fullPath, depth + 1);
173
- if (state.isTracking) state.trackedPaths.add(fullPath);
174
- return value;
175
- } });
176
- state.proxyCache.set(target, proxy);
177
- return proxy;
178
- }
179
- /**
180
- * Create a proxy for an object with property access tracking
181
- * @internal
182
- */
183
- function createInternal(state, target, path = "", depth = 0) {
184
- if (!state.isTracking || !isProxyable(target)) return target;
185
- if (depth >= state.maxDepth) {
186
- console.warn(`${BLAC_ERROR_PREFIX} Proxy depth limit (${state.maxDepth}) reached at path "${path}". Deeper property accesses won't be tracked for re-renders.`);
187
- return target;
188
- }
189
- if (state.proxyCache.has(target)) return state.proxyCache.get(target);
190
- if (Array.isArray(target)) return createArrayProxy(state, target, path, depth);
191
- const proxy = new Proxy(target, {
192
- get: (obj, prop) => {
193
- if (typeof prop === "symbol") return Reflect.get(obj, prop);
194
- const value = Reflect.get(obj, prop);
195
- if (typeof value === "function") {
196
- if (!state.boundFunctionsCache) state.boundFunctionsCache = /* @__PURE__ */ new WeakMap();
197
- const cached = state.boundFunctionsCache.get(value);
198
- if (cached) return cached;
199
- const bound = value.bind(obj);
200
- state.boundFunctionsCache.set(value, bound);
201
- return bound;
202
- }
203
- const fullPath = path ? `${path}.${String(prop)}` : String(prop);
204
- if (typeof prop === "string" && state.isTracking) {
205
- if (!prop.startsWith("_") && !prop.startsWith("$$")) state.trackedPaths.add(fullPath);
206
- }
207
- if (isProxyable(value)) return createInternal(state, value, fullPath, depth + 1);
208
- return value;
209
- },
210
- has: (obj, prop) => {
211
- if (typeof prop === "string" && state.isTracking) {
212
- const fullPath = path ? `${path}.${prop}` : prop;
213
- state.trackedPaths.add(fullPath);
214
- }
215
- return Reflect.has(obj, prop);
216
- },
217
- ownKeys: (obj) => {
218
- if (state.isTracking && path) state.trackedPaths.add(path);
219
- return Reflect.ownKeys(obj);
220
- }
221
- });
222
- state.proxyCache.set(target, proxy);
223
- return proxy;
224
- }
225
- /**
226
- * Create a proxy for a target with caching
227
- * @internal
228
- */
152
+ const proxy = new Proxy(target, {
153
+ get: (arr, prop) => {
154
+ if (typeof prop === 'symbol') return Reflect.get(arr, prop);
155
+ const value = Reflect.get(arr, prop);
156
+ if (typeof value === 'function') {
157
+ if (!state.boundFunctionsCache)
158
+ state.boundFunctionsCache = /* @__PURE__ */ new WeakMap();
159
+ const cached = state.boundFunctionsCache.get(value);
160
+ if (cached) return cached;
161
+ const bound = value.bind(arr);
162
+ state.boundFunctionsCache.set(value, bound);
163
+ return bound;
164
+ }
165
+ if (prop === 'length') {
166
+ if (state.isTracking) {
167
+ const fullPath = path ? `${path}.length` : 'length';
168
+ state.trackedPaths.add(fullPath);
169
+ }
170
+ return value;
171
+ }
172
+ let fullPath;
173
+ if (typeof prop === 'string') {
174
+ const index = Number(prop);
175
+ if (!isNaN(index) && index >= 0)
176
+ fullPath = path ? `${path}[${index}]` : `[${index}]`;
177
+ else fullPath = path ? `${path}.${prop}` : prop;
178
+ } else return value;
179
+ if (isProxyable(value))
180
+ return createInternal(state, value, fullPath, depth + 1);
181
+ if (state.isTracking) state.trackedPaths.add(fullPath);
182
+ return value;
183
+ },
184
+ });
185
+ state.proxyCache.set(target, proxy);
186
+ return proxy;
187
+ }
188
+ /**
189
+ * Create a proxy for an object with property access tracking
190
+ * @internal
191
+ */
192
+ function createInternal(state, target, path = '', depth = 0) {
193
+ if (!state.isTracking || !isProxyable(target)) return target;
194
+ if (depth >= state.maxDepth) {
195
+ console.warn(
196
+ `${BLAC_ERROR_PREFIX} Proxy depth limit (${state.maxDepth}) reached at path "${path}". Deeper property accesses won't be tracked for re-renders.`,
197
+ );
198
+ return target;
199
+ }
200
+ if (state.proxyCache.has(target)) return state.proxyCache.get(target);
201
+ if (Array.isArray(target))
202
+ return createArrayProxy(state, target, path, depth);
203
+ const proxy = new Proxy(target, {
204
+ get: (obj, prop) => {
205
+ if (typeof prop === 'symbol') return Reflect.get(obj, prop);
206
+ const value = Reflect.get(obj, prop);
207
+ if (typeof value === 'function') {
208
+ if (!state.boundFunctionsCache)
209
+ state.boundFunctionsCache = /* @__PURE__ */ new WeakMap();
210
+ const cached = state.boundFunctionsCache.get(value);
211
+ if (cached) return cached;
212
+ const bound = value.bind(obj);
213
+ state.boundFunctionsCache.set(value, bound);
214
+ return bound;
215
+ }
216
+ const fullPath = path ? `${path}.${String(prop)}` : String(prop);
217
+ if (typeof prop === 'string' && state.isTracking) {
218
+ if (!prop.startsWith('_') && !prop.startsWith('$$'))
219
+ state.trackedPaths.add(fullPath);
220
+ }
221
+ if (isProxyable(value))
222
+ return createInternal(state, value, fullPath, depth + 1);
223
+ return value;
224
+ },
225
+ has: (obj, prop) => {
226
+ if (typeof prop === 'string' && state.isTracking) {
227
+ const fullPath = path ? `${path}.${prop}` : prop;
228
+ state.trackedPaths.add(fullPath);
229
+ }
230
+ return Reflect.has(obj, prop);
231
+ },
232
+ ownKeys: (obj) => {
233
+ if (state.isTracking && path) state.trackedPaths.add(path);
234
+ return Reflect.ownKeys(obj);
235
+ },
236
+ });
237
+ state.proxyCache.set(target, proxy);
238
+ return proxy;
239
+ }
240
+ /**
241
+ * Create a proxy for a target with caching
242
+ * @internal
243
+ */
229
244
  function createForTarget(state, target) {
230
- if (state.lastProxiedState === target && state.lastProxy) return state.lastProxy;
231
- if (state.lastProxiedState !== null) state.proxyCache.delete(state.lastProxiedState);
232
- state.boundFunctionsCache = null;
233
- const proxy = createInternal(state, target, "", 0);
234
- state.lastProxiedState = target;
235
- state.lastProxy = proxy;
236
- return proxy;
245
+ if (state.lastProxiedState === target && state.lastProxy)
246
+ return state.lastProxy;
247
+ if (state.lastProxiedState !== null)
248
+ state.proxyCache.delete(state.lastProxiedState);
249
+ state.boundFunctionsCache = null;
250
+ const proxy = createInternal(state, target, '', 0);
251
+ state.lastProxiedState = target;
252
+ state.lastProxy = proxy;
253
+ return proxy;
237
254
  }
238
255
  function isChildPath(child, parent) {
239
- if (child === parent) return false;
240
- return child.startsWith(parent + ".") || child.startsWith(parent + "[");
256
+ if (child === parent) return false;
257
+ return child.startsWith(parent + '.') || child.startsWith(parent + '[');
241
258
  }
242
259
  function getArrayParentPath(path) {
243
- if (path.endsWith(".length")) return path.slice(0, -7);
244
- const arrayIndexMatch = path.match(/^(.+?)\[\d+\]/);
245
- if (arrayIndexMatch) return arrayIndexMatch[1];
246
- return null;
260
+ if (path.endsWith('.length')) return path.slice(0, -7);
261
+ const arrayIndexMatch = path.match(/^(.+?)\[\d+\]/);
262
+ if (arrayIndexMatch) return arrayIndexMatch[1];
263
+ return null;
247
264
  }
248
265
  /**
249
- * @internal
250
- */
266
+ * @internal
267
+ */
251
268
  function optimizeTrackedPaths(paths) {
252
- if (paths.size <= 1) return paths;
253
- let allFlat = true;
254
- for (const path of paths) if (path.charCodeAt(path.length - 1) === 93 || path.includes(".")) {
255
- allFlat = false;
256
- break;
257
- }
258
- if (allFlat) return paths;
259
- const sortedPaths = Array.from(paths).sort((a, b) => a > b ? -1 : a < b ? 1 : 0);
260
- const optimized = /* @__PURE__ */ new Set();
261
- let lastKept;
262
- for (const path of sortedPaths) {
263
- if (lastKept !== void 0 && isChildPath(lastKept, path)) continue;
264
- optimized.add(path);
265
- lastKept = path;
266
- }
267
- const arrayParents = /* @__PURE__ */ new Set();
268
- for (const path of optimized) {
269
- const arrayParent = getArrayParentPath(path);
270
- if (arrayParent) arrayParents.add(arrayParent);
271
- }
272
- for (const arrayParent of arrayParents) optimized.add(arrayParent);
273
- return optimized;
274
- }
275
- /**
276
- * @internal
277
- */
269
+ if (paths.size <= 1) return paths;
270
+ let allFlat = true;
271
+ for (const path of paths)
272
+ if (path.charCodeAt(path.length - 1) === 93 || path.includes('.')) {
273
+ allFlat = false;
274
+ break;
275
+ }
276
+ if (allFlat) return paths;
277
+ const sortedPaths = Array.from(paths).sort((a, b) =>
278
+ a > b ? -1 : a < b ? 1 : 0,
279
+ );
280
+ const optimized = /* @__PURE__ */ new Set();
281
+ let lastKept;
282
+ for (const path of sortedPaths) {
283
+ if (lastKept !== void 0 && isChildPath(lastKept, path)) continue;
284
+ optimized.add(path);
285
+ lastKept = path;
286
+ }
287
+ const arrayParents = /* @__PURE__ */ new Set();
288
+ for (const path of optimized) {
289
+ const arrayParent = getArrayParentPath(path);
290
+ if (arrayParent) arrayParents.add(arrayParent);
291
+ }
292
+ for (const arrayParent of arrayParents) optimized.add(arrayParent);
293
+ return optimized;
294
+ }
295
+ /**
296
+ * @internal
297
+ */
278
298
  function createDependencyState() {
279
- return {
280
- proxyState: createProxyState(),
281
- previousRenderPaths: /* @__PURE__ */ new Set(),
282
- currentRenderPaths: /* @__PURE__ */ new Set(),
283
- pathCache: /* @__PURE__ */ new Map(),
284
- lastCheckedState: null,
285
- lastCheckedValues: /* @__PURE__ */ new Map()
286
- };
287
- }
288
- /**
289
- * @internal
290
- */
299
+ return {
300
+ proxyState: createProxyState(),
301
+ previousRenderPaths: /* @__PURE__ */ new Set(),
302
+ currentRenderPaths: /* @__PURE__ */ new Set(),
303
+ pathCache: /* @__PURE__ */ new Map(),
304
+ lastCheckedState: null,
305
+ lastCheckedValues: /* @__PURE__ */ new Map(),
306
+ };
307
+ }
308
+ /**
309
+ * @internal
310
+ */
291
311
  function startDependency(tracker) {
292
- startProxy(tracker.proxyState);
312
+ startProxy(tracker.proxyState);
293
313
  }
294
314
  /**
295
- * @internal
296
- */
315
+ * @internal
316
+ */
297
317
  function createDependencyProxy(tracker, state) {
298
- return createForTarget(tracker.proxyState, state);
318
+ return createForTarget(tracker.proxyState, state);
299
319
  }
300
320
  /**
301
- * @internal
302
- */
321
+ * @internal
322
+ */
303
323
  function capturePaths(tracker, state) {
304
- tracker.previousRenderPaths = tracker.currentRenderPaths;
305
- tracker.currentRenderPaths = optimizeTrackedPaths(stopProxy(tracker.proxyState));
306
- if (tracker.previousRenderPaths.size === 0 && tracker.currentRenderPaths.size === 0) return;
307
- const trackedPathsUnion = new Set(tracker.previousRenderPaths);
308
- for (const path of tracker.currentRenderPaths) trackedPathsUnion.add(path);
309
- const canReuseCache = tracker.lastCheckedState === state;
310
- for (const path of trackedPathsUnion) if (!tracker.pathCache.has(path)) {
311
- const segments = parsePath(path);
312
- const value = canReuseCache && tracker.lastCheckedValues.has(path) ? tracker.lastCheckedValues.get(path) : getValueAtPath(state, segments);
313
- tracker.pathCache.set(path, {
314
- segments,
315
- value
316
- });
317
- } else {
318
- const info = tracker.pathCache.get(path);
319
- if (!info) continue;
320
- info.value = canReuseCache && tracker.lastCheckedValues.has(path) ? tracker.lastCheckedValues.get(path) : getValueAtPath(state, info.segments);
321
- }
322
- tracker.lastCheckedValues.clear();
323
- }
324
- /**
325
- * @internal
326
- */
324
+ tracker.previousRenderPaths = tracker.currentRenderPaths;
325
+ tracker.currentRenderPaths = optimizeTrackedPaths(
326
+ stopProxy(tracker.proxyState),
327
+ );
328
+ if (
329
+ tracker.previousRenderPaths.size === 0 &&
330
+ tracker.currentRenderPaths.size === 0
331
+ )
332
+ return;
333
+ const trackedPathsUnion = new Set(tracker.previousRenderPaths);
334
+ for (const path of tracker.currentRenderPaths) trackedPathsUnion.add(path);
335
+ const canReuseCache = tracker.lastCheckedState === state;
336
+ for (const path of trackedPathsUnion)
337
+ if (!tracker.pathCache.has(path)) {
338
+ const segments = parsePath(path);
339
+ const value =
340
+ canReuseCache && tracker.lastCheckedValues.has(path)
341
+ ? tracker.lastCheckedValues.get(path)
342
+ : getValueAtPath(state, segments);
343
+ tracker.pathCache.set(path, {
344
+ segments,
345
+ value,
346
+ });
347
+ } else {
348
+ const info = tracker.pathCache.get(path);
349
+ if (!info) continue;
350
+ info.value =
351
+ canReuseCache && tracker.lastCheckedValues.has(path)
352
+ ? tracker.lastCheckedValues.get(path)
353
+ : getValueAtPath(state, info.segments);
354
+ }
355
+ tracker.lastCheckedValues.clear();
356
+ }
357
+ /**
358
+ * @internal
359
+ */
327
360
  function hasDependencyChanges(tracker, state) {
328
- if (tracker.pathCache.size === 0) return true;
329
- tracker.lastCheckedValues.clear();
330
- for (const [path, info] of tracker.pathCache.entries()) {
331
- const currentValue = getValueAtPath(state, info.segments);
332
- tracker.lastCheckedValues.set(path, currentValue);
333
- if (!Object.is(currentValue, info.value)) {
334
- tracker.lastCheckedState = state;
335
- return true;
336
- }
337
- }
338
- tracker.lastCheckedState = state;
339
- return false;
340
- }
341
- /**
342
- * @internal
343
- */
361
+ if (tracker.pathCache.size === 0) return true;
362
+ tracker.lastCheckedValues.clear();
363
+ for (const [path, info] of tracker.pathCache.entries()) {
364
+ const currentValue = getValueAtPath(state, info.segments);
365
+ tracker.lastCheckedValues.set(path, currentValue);
366
+ if (!Object.is(currentValue, info.value)) {
367
+ tracker.lastCheckedState = state;
368
+ return true;
369
+ }
370
+ }
371
+ tracker.lastCheckedState = state;
372
+ return false;
373
+ }
374
+ /**
375
+ * @internal
376
+ */
344
377
  function hasTrackedData(tracker) {
345
- return tracker.proxyState.trackedPaths.size > 0 || tracker.pathCache.size > 0 || tracker.previousRenderPaths.size > 0;
378
+ return (
379
+ tracker.proxyState.trackedPaths.size > 0 ||
380
+ tracker.pathCache.size > 0 ||
381
+ tracker.previousRenderPaths.size > 0
382
+ );
346
383
  }
347
384
  const descriptorCache = /* @__PURE__ */ new WeakMap();
348
385
  const blocProxyCache = /* @__PURE__ */ new WeakMap();
349
386
  const activeTrackerMap = /* @__PURE__ */ new WeakMap();
350
387
  const MAX_GETTER_DEPTH = BLAC_DEFAULTS.MAX_GETTER_DEPTH;
351
388
  /**
352
- * @internal
353
- */
389
+ * @internal
390
+ */
354
391
  function getDescriptor(obj, prop) {
355
- const constructor = obj.constructor;
356
- let constructorCache = descriptorCache.get(constructor);
357
- if (constructorCache?.has(prop)) return constructorCache.get(prop);
358
- let current = obj;
359
- let descriptor;
360
- while (current && current !== Object.prototype) {
361
- descriptor = Object.getOwnPropertyDescriptor(current, prop);
362
- if (descriptor) break;
363
- current = Object.getPrototypeOf(current);
364
- }
365
- if (!constructorCache) {
366
- constructorCache = /* @__PURE__ */ new Map();
367
- descriptorCache.set(constructor, constructorCache);
368
- }
369
- constructorCache.set(prop, descriptor);
370
- return descriptor;
371
- }
372
- /**
373
- * @internal
374
- */
392
+ const constructor = obj.constructor;
393
+ let constructorCache = descriptorCache.get(constructor);
394
+ if (constructorCache?.has(prop)) return constructorCache.get(prop);
395
+ let current = obj;
396
+ let descriptor;
397
+ while (current && current !== Object.prototype) {
398
+ descriptor = Object.getOwnPropertyDescriptor(current, prop);
399
+ if (descriptor) break;
400
+ current = Object.getPrototypeOf(current);
401
+ }
402
+ if (!constructorCache) {
403
+ constructorCache = /* @__PURE__ */ new Map();
404
+ descriptorCache.set(constructor, constructorCache);
405
+ }
406
+ constructorCache.set(prop, descriptor);
407
+ return descriptor;
408
+ }
409
+ /**
410
+ * @internal
411
+ */
375
412
  function isGetter(obj, prop) {
376
- return getDescriptor(obj, prop)?.get !== void 0;
413
+ return getDescriptor(obj, prop)?.get !== void 0;
377
414
  }
378
415
  /**
379
- * @internal
380
- */
416
+ * @internal
417
+ */
381
418
  function createGetterState() {
382
- return {
383
- trackedValues: /* @__PURE__ */ new Map(),
384
- currentlyAccessing: /* @__PURE__ */ new Set(),
385
- trackedGetters: /* @__PURE__ */ new Set(),
386
- isTracking: false,
387
- renderCache: /* @__PURE__ */ new Map(),
388
- cacheValid: false,
389
- depth: 0,
390
- visitedBlocs: /* @__PURE__ */ new Set()
391
- };
392
- }
393
- /**
394
- * @internal
395
- */
419
+ return {
420
+ trackedValues: /* @__PURE__ */ new Map(),
421
+ currentlyAccessing: /* @__PURE__ */ new Set(),
422
+ trackedGetters: /* @__PURE__ */ new Set(),
423
+ isTracking: false,
424
+ renderCache: /* @__PURE__ */ new Map(),
425
+ cacheValid: false,
426
+ depth: 0,
427
+ visitedBlocs: /* @__PURE__ */ new Set(),
428
+ };
429
+ }
430
+ /**
431
+ * @internal
432
+ */
396
433
  function setActiveTracker(bloc, tracker) {
397
- activeTrackerMap.set(bloc, tracker);
434
+ activeTrackerMap.set(bloc, tracker);
398
435
  }
399
436
  /**
400
- * @internal
401
- */
437
+ * @internal
438
+ */
402
439
  function clearActiveTracker(bloc) {
403
- activeTrackerMap.delete(bloc);
440
+ activeTrackerMap.delete(bloc);
404
441
  }
405
442
  /**
406
- * @internal
407
- */
443
+ * @internal
444
+ */
408
445
  function commitTrackedGetters(tracker) {
409
- if (tracker.currentlyAccessing.size > 0) tracker.trackedGetters = new Set(tracker.currentlyAccessing);
410
- tracker.currentlyAccessing.clear();
446
+ if (tracker.currentlyAccessing.size > 0)
447
+ tracker.trackedGetters = new Set(tracker.currentlyAccessing);
448
+ tracker.currentlyAccessing.clear();
411
449
  }
412
450
  /**
413
- * Execute a tracked getter with depth/circular dependency checks and context management.
414
- * @internal
415
- */
451
+ * Execute a tracked getter with depth/circular dependency checks and context management.
452
+ * @internal
453
+ */
416
454
  function executeTrackedGetter(target, prop, tracker) {
417
- tracker.currentlyAccessing.add(prop);
418
- if (tracker.cacheValid && tracker.renderCache.has(prop)) {
419
- const cachedValue = tracker.renderCache.get(prop);
420
- tracker.trackedValues.set(prop, cachedValue);
421
- return cachedValue;
422
- }
423
- if (tracker.depth >= MAX_GETTER_DEPTH) throw new Error(`${BLAC_ERROR_PREFIX} Maximum getter depth (${MAX_GETTER_DEPTH}) exceeded. Possible circular dependency in getter "${String(prop)}" on ${target.constructor.name}.`);
424
- if (tracker.visitedBlocs.has(target)) throw new Error(`${BLAC_ERROR_PREFIX} Circular dependency detected: getter "${String(prop)}" on ${target.constructor.name}.`);
425
- const prevDepth = tracker.depth;
426
- const prevVisited = new Set(tracker.visitedBlocs);
427
- tracker.depth++;
428
- tracker.visitedBlocs.add(target);
429
- try {
430
- const descriptor = getDescriptor(target, prop);
431
- if (!descriptor?.get) return target[prop];
432
- const value = descriptor.get.call(target);
433
- tracker.trackedValues.set(prop, value);
434
- return value;
435
- } catch (error) {
436
- tracker.currentlyAccessing.delete(prop);
437
- throw error;
438
- } finally {
439
- tracker.depth = prevDepth;
440
- tracker.visitedBlocs = prevVisited;
441
- }
442
- }
443
- /**
444
- * @internal
445
- */
455
+ tracker.currentlyAccessing.add(prop);
456
+ if (tracker.cacheValid && tracker.renderCache.has(prop)) {
457
+ const cachedValue = tracker.renderCache.get(prop);
458
+ tracker.trackedValues.set(prop, cachedValue);
459
+ return cachedValue;
460
+ }
461
+ if (tracker.depth >= MAX_GETTER_DEPTH)
462
+ throw new Error(
463
+ `${BLAC_ERROR_PREFIX} Maximum getter depth (${MAX_GETTER_DEPTH}) exceeded. Possible circular dependency in getter "${String(prop)}" on ${target.constructor.name}.`,
464
+ );
465
+ if (tracker.visitedBlocs.has(target))
466
+ throw new Error(
467
+ `${BLAC_ERROR_PREFIX} Circular dependency detected: getter "${String(prop)}" on ${target.constructor.name}.`,
468
+ );
469
+ const prevDepth = tracker.depth;
470
+ const prevVisited = new Set(tracker.visitedBlocs);
471
+ tracker.depth++;
472
+ tracker.visitedBlocs.add(target);
473
+ try {
474
+ const descriptor = getDescriptor(target, prop);
475
+ if (!descriptor?.get) return target[prop];
476
+ const value = descriptor.get.call(target);
477
+ tracker.trackedValues.set(prop, value);
478
+ return value;
479
+ } catch (error) {
480
+ tracker.currentlyAccessing.delete(prop);
481
+ throw error;
482
+ } finally {
483
+ tracker.depth = prevDepth;
484
+ tracker.visitedBlocs = prevVisited;
485
+ }
486
+ }
487
+ /**
488
+ * @internal
489
+ */
446
490
  function createBlocProxy(bloc) {
447
- const cached = blocProxyCache.get(bloc);
448
- if (cached) return cached;
449
- const proxy = new Proxy(bloc, { get(target, prop, receiver) {
450
- const tracker = activeTrackerMap.get(target);
451
- if (tracker?.isTracking && isGetter(target, prop)) return executeTrackedGetter(target, prop, tracker);
452
- return Reflect.get(target, prop, receiver);
453
- } });
454
- blocProxyCache.set(bloc, proxy);
455
- return proxy;
456
- }
457
- /**
458
- * @internal
459
- */
491
+ const cached = blocProxyCache.get(bloc);
492
+ if (cached) return cached;
493
+ const proxy = new Proxy(bloc, {
494
+ get(target, prop, receiver) {
495
+ const tracker = activeTrackerMap.get(target);
496
+ if (tracker?.isTracking && isGetter(target, prop))
497
+ return executeTrackedGetter(target, prop, tracker);
498
+ return Reflect.get(target, prop, receiver);
499
+ },
500
+ });
501
+ blocProxyCache.set(bloc, proxy);
502
+ return proxy;
503
+ }
504
+ /**
505
+ * @internal
506
+ */
460
507
  function hasGetterChanges(bloc, tracker) {
461
- if (!tracker || tracker.trackedGetters.size === 0) return false;
462
- tracker.renderCache.clear();
463
- let hasAnyChange = false;
464
- for (const prop of tracker.trackedGetters) try {
465
- const descriptor = getDescriptor(bloc, prop);
466
- if (!descriptor?.get) continue;
467
- const newValue = descriptor.get.call(bloc);
468
- const oldValue = tracker.trackedValues.get(prop);
469
- tracker.renderCache.set(prop, newValue);
470
- tracker.trackedValues.set(prop, newValue);
471
- if (!Object.is(newValue, oldValue)) hasAnyChange = true;
472
- } catch (error) {
473
- console.warn(`${BLAC_ERROR_PREFIX} Getter "${String(prop)}" threw error during change detection. Stopping tracking for this getter.`, error);
474
- tracker.trackedGetters.delete(prop);
475
- tracker.trackedValues.delete(prop);
476
- tracker.cacheValid = false;
477
- return true;
478
- }
479
- tracker.cacheValid = true;
480
- return hasAnyChange;
481
- }
482
- /**
483
- * @internal
484
- */
508
+ if (!tracker || tracker.trackedGetters.size === 0) return false;
509
+ tracker.renderCache.clear();
510
+ let hasAnyChange = false;
511
+ for (const prop of tracker.trackedGetters)
512
+ try {
513
+ const descriptor = getDescriptor(bloc, prop);
514
+ if (!descriptor?.get) continue;
515
+ const newValue = descriptor.get.call(bloc);
516
+ const oldValue = tracker.trackedValues.get(prop);
517
+ tracker.renderCache.set(prop, newValue);
518
+ tracker.trackedValues.set(prop, newValue);
519
+ if (!Object.is(newValue, oldValue)) hasAnyChange = true;
520
+ } catch (error) {
521
+ console.warn(
522
+ `${BLAC_ERROR_PREFIX} Getter "${String(prop)}" threw error during change detection. Stopping tracking for this getter.`,
523
+ error,
524
+ );
525
+ tracker.trackedGetters.delete(prop);
526
+ tracker.trackedValues.delete(prop);
527
+ tracker.cacheValid = false;
528
+ return true;
529
+ }
530
+ tracker.cacheValid = true;
531
+ return hasAnyChange;
532
+ }
533
+ /**
534
+ * @internal
535
+ */
485
536
  function invalidateRenderCache(tracker) {
486
- tracker.cacheValid = false;
537
+ tracker.cacheValid = false;
487
538
  }
488
539
  /**
489
- * Create a new tracking proxy state.
490
- */
540
+ * Create a new tracking proxy state.
541
+ */
491
542
  function createState() {
492
- return {
493
- dependencyState: createDependencyState(),
494
- getterState: createGetterState(),
495
- dependencies: /* @__PURE__ */ new Set(),
496
- isTracking: false
497
- };
543
+ return {
544
+ dependencyState: createDependencyState(),
545
+ getterState: createGetterState(),
546
+ dependencies: /* @__PURE__ */ new Set(),
547
+ isTracking: false,
548
+ };
498
549
  }
499
550
  /**
500
- * Start tracking on a tracking proxy.
501
- */
551
+ * Start tracking on a tracking proxy.
552
+ */
502
553
  function startTracking(tracker) {
503
- tracker.isTracking = true;
504
- tracker.dependencies.clear();
505
- tracker.getterState.isTracking = true;
506
- startDependency(tracker.dependencyState);
554
+ tracker.isTracking = true;
555
+ tracker.dependencies.clear();
556
+ tracker.getterState.isTracking = true;
557
+ startDependency(tracker.dependencyState);
507
558
  }
508
559
  /**
509
- * Stop tracking and collect all dependencies.
510
- */
560
+ * Stop tracking and collect all dependencies.
561
+ */
511
562
  function stopTracking(tracker, bloc) {
512
- tracker.isTracking = false;
513
- tracker.getterState.isTracking = false;
514
- capturePaths(tracker.dependencyState, bloc.state);
515
- commitTrackedGetters(tracker.getterState);
516
- return new Set(tracker.dependencies);
563
+ tracker.isTracking = false;
564
+ tracker.getterState.isTracking = false;
565
+ capturePaths(tracker.dependencyState, bloc.state);
566
+ commitTrackedGetters(tracker.getterState);
567
+ return new Set(tracker.dependencies);
517
568
  }
518
569
  /**
519
- * Check if tracked state or getters have changed.
520
- */
570
+ * Check if tracked state or getters have changed.
571
+ */
521
572
  function hasChanges(tracker, bloc) {
522
- invalidateRenderCache(tracker.getterState);
523
- const stateChanged = hasDependencyChanges(tracker.dependencyState, bloc.state);
524
- const getterChanged = hasGetterChanges(bloc, tracker.getterState);
525
- return stateChanged || getterChanged;
526
- }
527
- /**
528
- * Create a tracking proxy for a bloc instance.
529
- * Tracks both state property access and getter access.
530
- */
573
+ invalidateRenderCache(tracker.getterState);
574
+ const stateChanged = hasDependencyChanges(
575
+ tracker.dependencyState,
576
+ bloc.state,
577
+ );
578
+ const getterChanged = hasGetterChanges(bloc, tracker.getterState);
579
+ return stateChanged || getterChanged;
580
+ }
581
+ /**
582
+ * Create a tracking proxy for a bloc instance.
583
+ * Tracks both state property access and getter access.
584
+ */
531
585
  function createTrackingProxy(bloc, tracker) {
532
- tracker.dependencies.add(bloc);
533
- const stateProxyCache = /* @__PURE__ */ new WeakMap();
534
- return new Proxy(bloc, { get(target, prop, receiver) {
535
- if (prop === "state") {
536
- if (!tracker.isTracking) return target.state;
537
- const rawState = target.state;
538
- if (rawState === null || typeof rawState !== "object") return rawState;
539
- if (stateProxyCache.has(rawState)) return stateProxyCache.get(rawState);
540
- const stateProxy = createDependencyProxy(tracker.dependencyState, rawState);
541
- stateProxyCache.set(rawState, stateProxy);
542
- return stateProxy;
543
- }
544
- if (typeof prop === "symbol") return Reflect.get(target, prop, receiver);
545
- const value = Reflect.get(target, prop, receiver);
546
- if (typeof value === "function") return value.bind(target);
547
- if (tracker.isTracking && isGetter(target, prop)) return executeTrackedGetter(target, prop, tracker.getterState);
548
- return value;
549
- } });
586
+ tracker.dependencies.add(bloc);
587
+ const stateProxyCache = /* @__PURE__ */ new WeakMap();
588
+ return new Proxy(bloc, {
589
+ get(target, prop, receiver) {
590
+ if (prop === 'state') {
591
+ if (!tracker.isTracking) return target.state;
592
+ const rawState = target.state;
593
+ if (rawState === null || typeof rawState !== 'object') return rawState;
594
+ if (stateProxyCache.has(rawState)) return stateProxyCache.get(rawState);
595
+ const stateProxy = createDependencyProxy(
596
+ tracker.dependencyState,
597
+ rawState,
598
+ );
599
+ stateProxyCache.set(rawState, stateProxy);
600
+ return stateProxy;
601
+ }
602
+ if (typeof prop === 'symbol') return Reflect.get(target, prop, receiver);
603
+ const value = Reflect.get(target, prop, receiver);
604
+ if (typeof value === 'function') return value.bind(target);
605
+ if (tracker.isTracking && isGetter(target, prop))
606
+ return executeTrackedGetter(target, prop, tracker.getterState);
607
+ return value;
608
+ },
609
+ });
550
610
  }
551
611
  //#endregion
552
612
  //#region src/tracking/dependency-manager.ts
553
613
  /**
554
- * Manages subscriptions to state container dependencies.
555
- * Provides efficient sync mechanism to add/remove subscriptions
556
- * as dependencies change between callback invocations.
557
- */
614
+ * Manages subscriptions to state container dependencies.
615
+ * Provides efficient sync mechanism to add/remove subscriptions
616
+ * as dependencies change between callback invocations.
617
+ */
558
618
  var DependencyManager = class {
559
- constructor() {
560
- this.subscriptions = /* @__PURE__ */ new Map();
561
- this.currentDeps = /* @__PURE__ */ new Set();
562
- }
563
- /**
564
- * Sync subscriptions with a new set of dependencies.
565
- * Adds subscriptions for new deps, removes subscriptions for stale deps.
566
- *
567
- * @param newDeps - The new set of dependencies to subscribe to
568
- * @param onChange - Callback to invoke when any dependency changes
569
- * @param exclude - Optional instance to exclude from subscriptions (e.g., primary bloc)
570
- * @returns true if the dependency set changed, false if unchanged
571
- */
572
- sync(newDeps, onChange, exclude) {
573
- const filteredNewDeps = /* @__PURE__ */ new Set();
574
- for (const dep of newDeps) if (dep !== exclude && !dep.isDisposed) filteredNewDeps.add(dep);
575
- if (this.areSetsEqual(this.currentDeps, filteredNewDeps)) return false;
576
- for (const dep of this.currentDeps) if (!filteredNewDeps.has(dep)) {
577
- const unsub = this.subscriptions.get(dep);
578
- if (unsub) {
579
- unsub();
580
- this.subscriptions.delete(dep);
581
- }
582
- }
583
- for (const dep of filteredNewDeps) if (!this.currentDeps.has(dep) && !this.subscriptions.has(dep)) {
584
- const unsub = dep.subscribe(onChange);
585
- this.subscriptions.set(dep, unsub);
586
- }
587
- this.currentDeps = filteredNewDeps;
588
- return true;
589
- }
590
- /**
591
- * Add a single dependency subscription.
592
- */
593
- add(dep, onChange) {
594
- if (this.subscriptions.has(dep) || dep.isDisposed) return;
595
- const unsub = dep.subscribe(onChange);
596
- this.subscriptions.set(dep, unsub);
597
- this.currentDeps.add(dep);
598
- }
599
- /**
600
- * Check if a dependency is currently subscribed.
601
- */
602
- has(dep) {
603
- return this.currentDeps.has(dep);
604
- }
605
- /**
606
- * Get the current set of dependencies.
607
- */
608
- getDependencies() {
609
- return new Set(this.currentDeps);
610
- }
611
- /**
612
- * Clean up all active subscriptions.
613
- */
614
- cleanup() {
615
- for (const unsub of this.subscriptions.values()) unsub();
616
- this.subscriptions.clear();
617
- this.currentDeps.clear();
618
- }
619
- areSetsEqual(a, b) {
620
- if (a.size !== b.size) return false;
621
- for (const item of a) if (!b.has(item)) return false;
622
- return true;
623
- }
619
+ constructor() {
620
+ this.subscriptions = /* @__PURE__ */ new Map();
621
+ this.currentDeps = /* @__PURE__ */ new Set();
622
+ }
623
+ /**
624
+ * Sync subscriptions with a new set of dependencies.
625
+ * Adds subscriptions for new deps, removes subscriptions for stale deps.
626
+ *
627
+ * @param newDeps - The new set of dependencies to subscribe to
628
+ * @param onChange - Callback to invoke when any dependency changes
629
+ * @param exclude - Optional instance to exclude from subscriptions (e.g., primary bloc)
630
+ * @returns true if the dependency set changed, false if unchanged
631
+ */
632
+ sync(newDeps, onChange, exclude) {
633
+ const filteredNewDeps = /* @__PURE__ */ new Set();
634
+ for (const dep of newDeps)
635
+ if (dep !== exclude && !dep.isDisposed) filteredNewDeps.add(dep);
636
+ if (this.areSetsEqual(this.currentDeps, filteredNewDeps)) return false;
637
+ for (const dep of this.currentDeps)
638
+ if (!filteredNewDeps.has(dep)) {
639
+ const unsub = this.subscriptions.get(dep);
640
+ if (unsub) {
641
+ unsub();
642
+ this.subscriptions.delete(dep);
643
+ }
644
+ }
645
+ for (const dep of filteredNewDeps)
646
+ if (!this.currentDeps.has(dep) && !this.subscriptions.has(dep)) {
647
+ const unsub = dep.subscribe(onChange);
648
+ this.subscriptions.set(dep, unsub);
649
+ }
650
+ this.currentDeps = filteredNewDeps;
651
+ return true;
652
+ }
653
+ /**
654
+ * Add a single dependency subscription.
655
+ */
656
+ add(dep, onChange) {
657
+ if (this.subscriptions.has(dep) || dep.isDisposed) return;
658
+ const unsub = dep.subscribe(onChange);
659
+ this.subscriptions.set(dep, unsub);
660
+ this.currentDeps.add(dep);
661
+ }
662
+ /**
663
+ * Check if a dependency is currently subscribed.
664
+ */
665
+ has(dep) {
666
+ return this.currentDeps.has(dep);
667
+ }
668
+ /**
669
+ * Get the current set of dependencies.
670
+ */
671
+ getDependencies() {
672
+ return new Set(this.currentDeps);
673
+ }
674
+ /**
675
+ * Clean up all active subscriptions.
676
+ */
677
+ cleanup() {
678
+ for (const unsub of this.subscriptions.values()) unsub();
679
+ this.subscriptions.clear();
680
+ this.currentDeps.clear();
681
+ }
682
+ areSetsEqual(a, b) {
683
+ if (a.size !== b.size) return false;
684
+ for (const item of a) if (!b.has(item)) return false;
685
+ return true;
686
+ }
624
687
  };
625
688
  //#endregion
626
689
  //#region src/tracking/resolve-dependencies.ts
627
690
  /**
628
- * Resolve all transitive dependencies of a bloc via BFS over `dependencies` maps.
629
- * Uses cycle detection to avoid infinite loops.
630
- * @internal
631
- */
691
+ * Resolve all transitive dependencies of a bloc via BFS over `dependencies` maps.
692
+ * Uses cycle detection to avoid infinite loops.
693
+ * @internal
694
+ */
632
695
  function resolveDependencies(bloc) {
633
- const result = /* @__PURE__ */ new Set();
634
- const visited = /* @__PURE__ */ new Set();
635
- const queue = [bloc];
636
- let head = 0;
637
- while (head < queue.length) {
638
- const current = queue[head++];
639
- for (const [Type, key] of current.dependencies) {
640
- const visitKey = `${Type.name}::${key}`;
641
- if (visited.has(visitKey)) continue;
642
- visited.add(visitKey);
643
- const dep = getRegistry().ensure(Type, key);
644
- result.add(dep);
645
- if (dep.dependencies.size > 0) queue.push(dep);
646
- }
647
- }
648
- result.delete(bloc);
649
- return result;
696
+ const result = /* @__PURE__ */ new Set();
697
+ const visited = /* @__PURE__ */ new Set();
698
+ const queue = [bloc];
699
+ let head = 0;
700
+ while (head < queue.length) {
701
+ const current = queue[head++];
702
+ for (const [Type, key] of current.dependencies) {
703
+ const visitKey = `${Type.name}::${key}`;
704
+ if (visited.has(visitKey)) continue;
705
+ visited.add(visitKey);
706
+ const dep = getRegistry().ensure(Type, key);
707
+ result.add(dep);
708
+ if (dep.dependencies.size > 0) queue.push(dep);
709
+ }
710
+ }
711
+ result.delete(bloc);
712
+ return result;
650
713
  }
651
714
  //#endregion
652
- export { setActiveTracker as _, commitTrackedGetters as a, stopTracking as b, createDependencyState as c, createTrackingProxy as d, hasChanges as f, invalidateRenderCache as g, hasTrackedData as h, clearActiveTracker as i, createGetterState as l, hasGetterChanges as m, DependencyManager as n, createBlocProxy as o, hasDependencyChanges as p, capturePaths as r, createDependencyProxy as s, resolveDependencies as t, createState as u, startDependency as v, shallowEqual as x, startTracking as y };
715
+ export {
716
+ setActiveTracker as _,
717
+ commitTrackedGetters as a,
718
+ stopTracking as b,
719
+ createDependencyState as c,
720
+ createTrackingProxy as d,
721
+ hasChanges as f,
722
+ invalidateRenderCache as g,
723
+ hasTrackedData as h,
724
+ clearActiveTracker as i,
725
+ createGetterState as l,
726
+ hasGetterChanges as m,
727
+ DependencyManager as n,
728
+ createBlocProxy as o,
729
+ hasDependencyChanges as p,
730
+ capturePaths as r,
731
+ createDependencyProxy as s,
732
+ resolveDependencies as t,
733
+ createState as u,
734
+ startDependency as v,
735
+ shallowEqual as x,
736
+ startTracking as y,
737
+ };
653
738
 
654
- //# sourceMappingURL=resolve-dependencies-B6JDXvpr.js.map
739
+ //# sourceMappingURL=resolve-dependencies-B6JDXvpr.js.map