@blac/core 2.0.13 → 2.0.14

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,771 +1,830 @@
1
- const require_StateContainerRegistry = require("./StateContainerRegistry-Upsrlg9G.cjs");
2
- const require_config = require("./config-BR0Xy-Tn.cjs");
1
+ const require_StateContainerRegistry = require('./StateContainerRegistry-Upsrlg9G.cjs');
2
+ const require_config = require('./config-BR0Xy-Tn.cjs');
3
3
  //#region src/tracking/path-utils.ts
4
4
  /**
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
- */
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
+ */
26
26
  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
- */
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
+ */
61
61
  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
- */
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
+ */
84
84
  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;
85
+ if (arr1.length !== arr2.length) return false;
86
+ for (let i = 0; i < arr1.length; i++)
87
+ if (!Object.is(arr1[i], arr2[i])) return false;
88
+ return true;
88
89
  }
89
90
  //#endregion
90
91
  //#region src/tracking/tracking-proxy.ts
91
92
  /**
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
- */
93
+ * Consolidated Tracking System
94
+ *
95
+ * This module provides all dependency and getter tracking functionality:
96
+ * - Proxy creation for automatic property access tracking
97
+ * - Dependency path tracking and change detection
98
+ * - Getter execution tracking for computed properties
99
+ * - Combined tracking proxy for watch/waitUntil use cases
100
+ */
101
+ /**
102
+ * Check if a value can be proxied
103
+ * Returns true for plain objects and arrays only.
104
+ * @internal
105
+ */
105
106
  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;
107
+ if (typeof value !== 'object' || value === null) return false;
108
+ const proto = Object.getPrototypeOf(value);
109
+ return proto === Object.prototype || proto === Array.prototype;
109
110
  }
110
111
  /**
111
- * Create a new proxy tracker state
112
- * @internal
113
- */
112
+ * Create a new proxy tracker state
113
+ * @internal
114
+ */
114
115
  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
- */
116
+ return {
117
+ trackedPaths: /* @__PURE__ */ new Set(),
118
+ isTracking: false,
119
+ proxyCache: /* @__PURE__ */ new WeakMap(),
120
+ boundFunctionsCache: null,
121
+ lastProxiedState: null,
122
+ lastProxy: null,
123
+ maxDepth: 10,
124
+ };
125
+ }
126
+ /**
127
+ * Start tracking property accesses
128
+ * @internal
129
+ */
129
130
  function startProxy(state) {
130
- state.isTracking = true;
131
- state.trackedPaths.clear();
131
+ state.isTracking = true;
132
+ state.trackedPaths.clear();
132
133
  }
133
134
  /**
134
- * Stop tracking and return the tracked paths
135
- * @internal
136
- */
135
+ * Stop tracking and return the tracked paths
136
+ * @internal
137
+ */
137
138
  function stopProxy(state) {
138
- state.isTracking = false;
139
- return new Set(state.trackedPaths);
139
+ state.isTracking = false;
140
+ return new Set(state.trackedPaths);
140
141
  }
141
142
  /**
142
- * Create a proxy for an array with property access tracking
143
- * @internal
144
- */
143
+ * Create a proxy for an array with property access tracking
144
+ * @internal
145
+ */
145
146
  function createArrayProxy(state, target, path, depth = 0) {
146
- const proxy = new Proxy(target, { get: (arr, prop) => {
147
- if (typeof prop === "symbol") return Reflect.get(arr, prop);
148
- const value = Reflect.get(arr, prop);
149
- if (typeof value === "function") {
150
- if (!state.boundFunctionsCache) state.boundFunctionsCache = /* @__PURE__ */ new WeakMap();
151
- const cached = state.boundFunctionsCache.get(value);
152
- if (cached) return cached;
153
- const bound = value.bind(arr);
154
- state.boundFunctionsCache.set(value, bound);
155
- return bound;
156
- }
157
- if (prop === "length") {
158
- if (state.isTracking) {
159
- const fullPath = path ? `${path}.length` : "length";
160
- state.trackedPaths.add(fullPath);
161
- }
162
- return value;
163
- }
164
- let fullPath;
165
- if (typeof prop === "string") {
166
- const index = Number(prop);
167
- if (!isNaN(index) && index >= 0) fullPath = path ? `${path}[${index}]` : `[${index}]`;
168
- else fullPath = path ? `${path}.${prop}` : prop;
169
- } else return value;
170
- if (isProxyable(value)) return createInternal(state, value, fullPath, depth + 1);
171
- if (state.isTracking) state.trackedPaths.add(fullPath);
172
- return value;
173
- } });
174
- state.proxyCache.set(target, proxy);
175
- return proxy;
176
- }
177
- /**
178
- * Create a proxy for an object with property access tracking
179
- * @internal
180
- */
181
- function createInternal(state, target, path = "", depth = 0) {
182
- if (!state.isTracking || !isProxyable(target)) return target;
183
- if (depth >= state.maxDepth) {
184
- console.warn(`${require_StateContainerRegistry.BLAC_ERROR_PREFIX} Proxy depth limit (${state.maxDepth}) reached at path "${path}". Deeper property accesses won't be tracked for re-renders.`);
185
- return target;
186
- }
187
- if (state.proxyCache.has(target)) return state.proxyCache.get(target);
188
- if (Array.isArray(target)) return createArrayProxy(state, target, path, depth);
189
- const proxy = new Proxy(target, {
190
- get: (obj, prop) => {
191
- if (typeof prop === "symbol") return Reflect.get(obj, prop);
192
- const value = Reflect.get(obj, prop);
193
- if (typeof value === "function") {
194
- if (!state.boundFunctionsCache) state.boundFunctionsCache = /* @__PURE__ */ new WeakMap();
195
- const cached = state.boundFunctionsCache.get(value);
196
- if (cached) return cached;
197
- const bound = value.bind(obj);
198
- state.boundFunctionsCache.set(value, bound);
199
- return bound;
200
- }
201
- const fullPath = path ? `${path}.${String(prop)}` : String(prop);
202
- if (typeof prop === "string" && state.isTracking) {
203
- if (!prop.startsWith("_") && !prop.startsWith("$$")) state.trackedPaths.add(fullPath);
204
- }
205
- if (isProxyable(value)) return createInternal(state, value, fullPath, depth + 1);
206
- return value;
207
- },
208
- has: (obj, prop) => {
209
- if (typeof prop === "string" && state.isTracking) {
210
- const fullPath = path ? `${path}.${prop}` : prop;
211
- state.trackedPaths.add(fullPath);
212
- }
213
- return Reflect.has(obj, prop);
214
- },
215
- ownKeys: (obj) => {
216
- if (state.isTracking && path) state.trackedPaths.add(path);
217
- return Reflect.ownKeys(obj);
218
- }
219
- });
220
- state.proxyCache.set(target, proxy);
221
- return proxy;
222
- }
223
- /**
224
- * Create a proxy for a target with caching
225
- * @internal
226
- */
147
+ const proxy = new Proxy(target, {
148
+ 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)
153
+ state.boundFunctionsCache = /* @__PURE__ */ new WeakMap();
154
+ const cached = state.boundFunctionsCache.get(value);
155
+ if (cached) return cached;
156
+ const bound = value.bind(arr);
157
+ state.boundFunctionsCache.set(value, bound);
158
+ return bound;
159
+ }
160
+ if (prop === 'length') {
161
+ if (state.isTracking) {
162
+ const fullPath = path ? `${path}.length` : 'length';
163
+ state.trackedPaths.add(fullPath);
164
+ }
165
+ return value;
166
+ }
167
+ let fullPath;
168
+ if (typeof prop === 'string') {
169
+ const index = Number(prop);
170
+ if (!isNaN(index) && index >= 0)
171
+ fullPath = path ? `${path}[${index}]` : `[${index}]`;
172
+ else fullPath = path ? `${path}.${prop}` : prop;
173
+ } else return value;
174
+ if (isProxyable(value))
175
+ return createInternal(state, value, fullPath, depth + 1);
176
+ if (state.isTracking) state.trackedPaths.add(fullPath);
177
+ return value;
178
+ },
179
+ });
180
+ state.proxyCache.set(target, proxy);
181
+ return proxy;
182
+ }
183
+ /**
184
+ * Create a proxy for an object with property access tracking
185
+ * @internal
186
+ */
187
+ function createInternal(state, target, path = '', depth = 0) {
188
+ if (!state.isTracking || !isProxyable(target)) return target;
189
+ if (depth >= state.maxDepth) {
190
+ console.warn(
191
+ `${require_StateContainerRegistry.BLAC_ERROR_PREFIX} Proxy depth limit (${state.maxDepth}) reached at path "${path}". Deeper property accesses won't be tracked for re-renders.`,
192
+ );
193
+ return target;
194
+ }
195
+ if (state.proxyCache.has(target)) return state.proxyCache.get(target);
196
+ if (Array.isArray(target))
197
+ return createArrayProxy(state, target, path, depth);
198
+ const proxy = new Proxy(target, {
199
+ get: (obj, prop) => {
200
+ if (typeof prop === 'symbol') return Reflect.get(obj, prop);
201
+ const value = Reflect.get(obj, prop);
202
+ if (typeof value === 'function') {
203
+ if (!state.boundFunctionsCache)
204
+ state.boundFunctionsCache = /* @__PURE__ */ new WeakMap();
205
+ const cached = state.boundFunctionsCache.get(value);
206
+ if (cached) return cached;
207
+ const bound = value.bind(obj);
208
+ state.boundFunctionsCache.set(value, bound);
209
+ return bound;
210
+ }
211
+ const fullPath = path ? `${path}.${String(prop)}` : String(prop);
212
+ if (typeof prop === 'string' && state.isTracking) {
213
+ if (!prop.startsWith('_') && !prop.startsWith('$$'))
214
+ state.trackedPaths.add(fullPath);
215
+ }
216
+ if (isProxyable(value))
217
+ return createInternal(state, value, fullPath, depth + 1);
218
+ return value;
219
+ },
220
+ has: (obj, prop) => {
221
+ if (typeof prop === 'string' && state.isTracking) {
222
+ const fullPath = path ? `${path}.${prop}` : prop;
223
+ state.trackedPaths.add(fullPath);
224
+ }
225
+ return Reflect.has(obj, prop);
226
+ },
227
+ ownKeys: (obj) => {
228
+ if (state.isTracking && path) state.trackedPaths.add(path);
229
+ return Reflect.ownKeys(obj);
230
+ },
231
+ });
232
+ state.proxyCache.set(target, proxy);
233
+ return proxy;
234
+ }
235
+ /**
236
+ * Create a proxy for a target with caching
237
+ * @internal
238
+ */
227
239
  function createForTarget(state, target) {
228
- if (state.lastProxiedState === target && state.lastProxy) return state.lastProxy;
229
- state.proxyCache = /* @__PURE__ */ new WeakMap();
230
- state.boundFunctionsCache = null;
231
- const proxy = createInternal(state, target, "", 0);
232
- state.lastProxiedState = target;
233
- state.lastProxy = proxy;
234
- return proxy;
240
+ if (state.lastProxiedState === target && state.lastProxy)
241
+ return state.lastProxy;
242
+ state.proxyCache = /* @__PURE__ */ new WeakMap();
243
+ state.boundFunctionsCache = null;
244
+ const proxy = createInternal(state, target, '', 0);
245
+ state.lastProxiedState = target;
246
+ state.lastProxy = proxy;
247
+ return proxy;
235
248
  }
236
249
  function isChildPath(child, parent) {
237
- if (child === parent) return false;
238
- return child.startsWith(parent + ".") || child.startsWith(parent + "[");
250
+ if (child === parent) return false;
251
+ return child.startsWith(parent + '.') || child.startsWith(parent + '[');
239
252
  }
240
253
  function getArrayParentPath(path) {
241
- if (path.endsWith(".length")) return path.slice(0, -7);
242
- const arrayIndexMatch = path.match(/^(.+?)\[\d+\]/);
243
- if (arrayIndexMatch) return arrayIndexMatch[1];
244
- return null;
254
+ if (path.endsWith('.length')) return path.slice(0, -7);
255
+ const arrayIndexMatch = path.match(/^(.+?)\[\d+\]/);
256
+ if (arrayIndexMatch) return arrayIndexMatch[1];
257
+ return null;
245
258
  }
246
259
  /**
247
- * @internal
248
- */
260
+ * @internal
261
+ */
249
262
  function optimizeTrackedPaths(paths) {
250
- if (paths.size <= 1) return new Set(paths);
251
- const sortedPaths = Array.from(paths).sort((a, b) => a > b ? -1 : a < b ? 1 : 0);
252
- const optimized = /* @__PURE__ */ new Set();
253
- let lastKept;
254
- for (const path of sortedPaths) {
255
- if (lastKept !== void 0 && isChildPath(lastKept, path)) continue;
256
- optimized.add(path);
257
- lastKept = path;
258
- }
259
- const arrayParents = /* @__PURE__ */ new Set();
260
- for (const path of optimized) {
261
- const arrayParent = getArrayParentPath(path);
262
- if (arrayParent) arrayParents.add(arrayParent);
263
- }
264
- for (const arrayParent of arrayParents) optimized.add(arrayParent);
265
- return optimized;
266
- }
267
- /**
268
- * @internal
269
- */
263
+ if (paths.size <= 1) return new Set(paths);
264
+ const sortedPaths = Array.from(paths).sort((a, b) =>
265
+ a > b ? -1 : a < b ? 1 : 0,
266
+ );
267
+ const optimized = /* @__PURE__ */ new Set();
268
+ let lastKept;
269
+ for (const path of sortedPaths) {
270
+ if (lastKept !== void 0 && isChildPath(lastKept, path)) continue;
271
+ optimized.add(path);
272
+ lastKept = path;
273
+ }
274
+ const arrayParents = /* @__PURE__ */ new Set();
275
+ for (const path of optimized) {
276
+ const arrayParent = getArrayParentPath(path);
277
+ if (arrayParent) arrayParents.add(arrayParent);
278
+ }
279
+ for (const arrayParent of arrayParents) optimized.add(arrayParent);
280
+ return optimized;
281
+ }
282
+ /**
283
+ * @internal
284
+ */
270
285
  function createDependencyState() {
271
- return {
272
- proxyState: createProxyState(),
273
- previousRenderPaths: /* @__PURE__ */ new Set(),
274
- currentRenderPaths: /* @__PURE__ */ new Set(),
275
- pathCache: /* @__PURE__ */ new Map(),
276
- lastCheckedState: null,
277
- lastCheckedValues: /* @__PURE__ */ new Map()
278
- };
279
- }
280
- /**
281
- * @internal
282
- */
286
+ return {
287
+ proxyState: createProxyState(),
288
+ previousRenderPaths: /* @__PURE__ */ new Set(),
289
+ currentRenderPaths: /* @__PURE__ */ new Set(),
290
+ pathCache: /* @__PURE__ */ new Map(),
291
+ lastCheckedState: null,
292
+ lastCheckedValues: /* @__PURE__ */ new Map(),
293
+ };
294
+ }
295
+ /**
296
+ * @internal
297
+ */
283
298
  function startDependency(tracker) {
284
- startProxy(tracker.proxyState);
299
+ startProxy(tracker.proxyState);
285
300
  }
286
301
  /**
287
- * @internal
288
- */
302
+ * @internal
303
+ */
289
304
  function createDependencyProxy(tracker, state) {
290
- return createForTarget(tracker.proxyState, state);
305
+ return createForTarget(tracker.proxyState, state);
291
306
  }
292
307
  /**
293
- * @internal
294
- */
308
+ * @internal
309
+ */
295
310
  function capturePaths(tracker, state) {
296
- tracker.previousRenderPaths = tracker.currentRenderPaths;
297
- tracker.currentRenderPaths = optimizeTrackedPaths(stopProxy(tracker.proxyState));
298
- if (tracker.previousRenderPaths.size === 0 && tracker.currentRenderPaths.size === 0) return;
299
- const trackedPathsUnion = new Set(tracker.previousRenderPaths);
300
- for (const path of tracker.currentRenderPaths) trackedPathsUnion.add(path);
301
- const canReuseCache = tracker.lastCheckedState === state;
302
- for (const path of trackedPathsUnion) if (!tracker.pathCache.has(path)) {
303
- const segments = parsePath(path);
304
- const value = canReuseCache && tracker.lastCheckedValues.has(path) ? tracker.lastCheckedValues.get(path) : getValueAtPath(state, segments);
305
- tracker.pathCache.set(path, {
306
- segments,
307
- value
308
- });
309
- } else {
310
- const info = tracker.pathCache.get(path);
311
- if (!info) continue;
312
- info.value = canReuseCache && tracker.lastCheckedValues.has(path) ? tracker.lastCheckedValues.get(path) : getValueAtPath(state, info.segments);
313
- }
314
- tracker.lastCheckedValues.clear();
315
- }
316
- /**
317
- * @internal
318
- */
311
+ tracker.previousRenderPaths = tracker.currentRenderPaths;
312
+ tracker.currentRenderPaths = optimizeTrackedPaths(
313
+ stopProxy(tracker.proxyState),
314
+ );
315
+ if (
316
+ tracker.previousRenderPaths.size === 0 &&
317
+ tracker.currentRenderPaths.size === 0
318
+ )
319
+ return;
320
+ const trackedPathsUnion = new Set(tracker.previousRenderPaths);
321
+ for (const path of tracker.currentRenderPaths) trackedPathsUnion.add(path);
322
+ const canReuseCache = tracker.lastCheckedState === state;
323
+ for (const path of trackedPathsUnion)
324
+ if (!tracker.pathCache.has(path)) {
325
+ const segments = parsePath(path);
326
+ const value =
327
+ canReuseCache && tracker.lastCheckedValues.has(path)
328
+ ? tracker.lastCheckedValues.get(path)
329
+ : getValueAtPath(state, segments);
330
+ tracker.pathCache.set(path, {
331
+ segments,
332
+ value,
333
+ });
334
+ } else {
335
+ const info = tracker.pathCache.get(path);
336
+ if (!info) continue;
337
+ info.value =
338
+ canReuseCache && tracker.lastCheckedValues.has(path)
339
+ ? tracker.lastCheckedValues.get(path)
340
+ : getValueAtPath(state, info.segments);
341
+ }
342
+ tracker.lastCheckedValues.clear();
343
+ }
344
+ /**
345
+ * @internal
346
+ */
319
347
  function hasDependencyChanges(tracker, state) {
320
- if (tracker.pathCache.size === 0) return true;
321
- tracker.lastCheckedValues.clear();
322
- for (const [path, info] of tracker.pathCache.entries()) {
323
- const currentValue = getValueAtPath(state, info.segments);
324
- tracker.lastCheckedValues.set(path, currentValue);
325
- if (!Object.is(currentValue, info.value)) {
326
- tracker.lastCheckedState = state;
327
- return true;
328
- }
329
- }
330
- tracker.lastCheckedState = state;
331
- return false;
332
- }
333
- /**
334
- * @internal
335
- */
348
+ if (tracker.pathCache.size === 0) return true;
349
+ tracker.lastCheckedValues.clear();
350
+ for (const [path, info] of tracker.pathCache.entries()) {
351
+ const currentValue = getValueAtPath(state, info.segments);
352
+ tracker.lastCheckedValues.set(path, currentValue);
353
+ if (!Object.is(currentValue, info.value)) {
354
+ tracker.lastCheckedState = state;
355
+ return true;
356
+ }
357
+ }
358
+ tracker.lastCheckedState = state;
359
+ return false;
360
+ }
361
+ /**
362
+ * @internal
363
+ */
336
364
  function hasTrackedData(tracker) {
337
- return tracker.proxyState.trackedPaths.size > 0 || tracker.pathCache.size > 0 || tracker.previousRenderPaths.size > 0;
365
+ return (
366
+ tracker.proxyState.trackedPaths.size > 0 ||
367
+ tracker.pathCache.size > 0 ||
368
+ tracker.previousRenderPaths.size > 0
369
+ );
338
370
  }
339
371
  const descriptorCache = /* @__PURE__ */ new WeakMap();
340
372
  const blocProxyCache = /* @__PURE__ */ new WeakMap();
341
373
  const activeTrackerMap = /* @__PURE__ */ new WeakMap();
342
- const MAX_GETTER_DEPTH = require_StateContainerRegistry.BLAC_DEFAULTS.MAX_GETTER_DEPTH;
374
+ const MAX_GETTER_DEPTH =
375
+ require_StateContainerRegistry.BLAC_DEFAULTS.MAX_GETTER_DEPTH;
343
376
  /**
344
- * @internal
345
- */
377
+ * @internal
378
+ */
346
379
  function getDescriptor(obj, prop) {
347
- const constructor = obj.constructor;
348
- let constructorCache = descriptorCache.get(constructor);
349
- if (constructorCache?.has(prop)) return constructorCache.get(prop);
350
- let current = obj;
351
- let descriptor;
352
- while (current && current !== Object.prototype) {
353
- descriptor = Object.getOwnPropertyDescriptor(current, prop);
354
- if (descriptor) break;
355
- current = Object.getPrototypeOf(current);
356
- }
357
- if (!constructorCache) {
358
- constructorCache = /* @__PURE__ */ new Map();
359
- descriptorCache.set(constructor, constructorCache);
360
- }
361
- constructorCache.set(prop, descriptor);
362
- return descriptor;
363
- }
364
- /**
365
- * @internal
366
- */
380
+ const constructor = obj.constructor;
381
+ let constructorCache = descriptorCache.get(constructor);
382
+ if (constructorCache?.has(prop)) return constructorCache.get(prop);
383
+ let current = obj;
384
+ let descriptor;
385
+ while (current && current !== Object.prototype) {
386
+ descriptor = Object.getOwnPropertyDescriptor(current, prop);
387
+ if (descriptor) break;
388
+ current = Object.getPrototypeOf(current);
389
+ }
390
+ if (!constructorCache) {
391
+ constructorCache = /* @__PURE__ */ new Map();
392
+ descriptorCache.set(constructor, constructorCache);
393
+ }
394
+ constructorCache.set(prop, descriptor);
395
+ return descriptor;
396
+ }
397
+ /**
398
+ * @internal
399
+ */
367
400
  function isGetter(obj, prop) {
368
- return getDescriptor(obj, prop)?.get !== void 0;
401
+ return getDescriptor(obj, prop)?.get !== void 0;
369
402
  }
370
403
  /**
371
- * @internal
372
- */
404
+ * @internal
405
+ */
373
406
  function createGetterState() {
374
- return {
375
- trackedValues: /* @__PURE__ */ new Map(),
376
- currentlyAccessing: /* @__PURE__ */ new Set(),
377
- trackedGetters: /* @__PURE__ */ new Set(),
378
- isTracking: false,
379
- renderCache: /* @__PURE__ */ new Map(),
380
- cacheValid: false,
381
- depth: 0,
382
- visitedBlocs: /* @__PURE__ */ new Set()
383
- };
384
- }
385
- /**
386
- * @internal
387
- */
407
+ return {
408
+ trackedValues: /* @__PURE__ */ new Map(),
409
+ currentlyAccessing: /* @__PURE__ */ new Set(),
410
+ trackedGetters: /* @__PURE__ */ new Set(),
411
+ isTracking: false,
412
+ renderCache: /* @__PURE__ */ new Map(),
413
+ cacheValid: false,
414
+ depth: 0,
415
+ visitedBlocs: /* @__PURE__ */ new Set(),
416
+ };
417
+ }
418
+ /**
419
+ * @internal
420
+ */
388
421
  function setActiveTracker(bloc, tracker) {
389
- activeTrackerMap.set(bloc, tracker);
422
+ activeTrackerMap.set(bloc, tracker);
390
423
  }
391
424
  /**
392
- * @internal
393
- */
425
+ * @internal
426
+ */
394
427
  function clearActiveTracker(bloc) {
395
- activeTrackerMap.delete(bloc);
428
+ activeTrackerMap.delete(bloc);
396
429
  }
397
430
  /**
398
- * @internal
399
- */
431
+ * @internal
432
+ */
400
433
  function commitTrackedGetters(tracker) {
401
- if (tracker.currentlyAccessing.size > 0) tracker.trackedGetters = new Set(tracker.currentlyAccessing);
402
- tracker.currentlyAccessing.clear();
434
+ if (tracker.currentlyAccessing.size > 0)
435
+ tracker.trackedGetters = new Set(tracker.currentlyAccessing);
436
+ tracker.currentlyAccessing.clear();
403
437
  }
404
438
  /**
405
- * Execute a tracked getter with depth/circular dependency checks and context management.
406
- * @internal
407
- */
439
+ * Execute a tracked getter with depth/circular dependency checks and context management.
440
+ * @internal
441
+ */
408
442
  function executeTrackedGetter(target, prop, tracker) {
409
- tracker.currentlyAccessing.add(prop);
410
- if (tracker.cacheValid && tracker.renderCache.has(prop)) {
411
- const cachedValue = tracker.renderCache.get(prop);
412
- tracker.trackedValues.set(prop, cachedValue);
413
- return cachedValue;
414
- }
415
- if (tracker.depth >= MAX_GETTER_DEPTH) throw new Error(`${require_StateContainerRegistry.BLAC_ERROR_PREFIX} Maximum getter depth (${MAX_GETTER_DEPTH}) exceeded. Possible circular dependency in getter "${String(prop)}" on ${target.constructor.name}.`);
416
- if (tracker.visitedBlocs.has(target)) throw new Error(`${require_StateContainerRegistry.BLAC_ERROR_PREFIX} Circular dependency detected: getter "${String(prop)}" on ${target.constructor.name}.`);
417
- const prevDepth = tracker.depth;
418
- const prevVisited = new Set(tracker.visitedBlocs);
419
- tracker.depth++;
420
- tracker.visitedBlocs.add(target);
421
- try {
422
- const descriptor = getDescriptor(target, prop);
423
- if (!descriptor?.get) return target[prop];
424
- const value = descriptor.get.call(target);
425
- tracker.trackedValues.set(prop, value);
426
- return value;
427
- } catch (error) {
428
- tracker.currentlyAccessing.delete(prop);
429
- throw error;
430
- } finally {
431
- tracker.depth = prevDepth;
432
- tracker.visitedBlocs = prevVisited;
433
- }
434
- }
435
- /**
436
- * @internal
437
- */
443
+ tracker.currentlyAccessing.add(prop);
444
+ if (tracker.cacheValid && tracker.renderCache.has(prop)) {
445
+ const cachedValue = tracker.renderCache.get(prop);
446
+ tracker.trackedValues.set(prop, cachedValue);
447
+ return cachedValue;
448
+ }
449
+ if (tracker.depth >= MAX_GETTER_DEPTH)
450
+ throw new Error(
451
+ `${require_StateContainerRegistry.BLAC_ERROR_PREFIX} Maximum getter depth (${MAX_GETTER_DEPTH}) exceeded. Possible circular dependency in getter "${String(prop)}" on ${target.constructor.name}.`,
452
+ );
453
+ if (tracker.visitedBlocs.has(target))
454
+ throw new Error(
455
+ `${require_StateContainerRegistry.BLAC_ERROR_PREFIX} Circular dependency detected: getter "${String(prop)}" on ${target.constructor.name}.`,
456
+ );
457
+ const prevDepth = tracker.depth;
458
+ const prevVisited = new Set(tracker.visitedBlocs);
459
+ tracker.depth++;
460
+ tracker.visitedBlocs.add(target);
461
+ try {
462
+ const descriptor = getDescriptor(target, prop);
463
+ if (!descriptor?.get) return target[prop];
464
+ const value = descriptor.get.call(target);
465
+ tracker.trackedValues.set(prop, value);
466
+ return value;
467
+ } catch (error) {
468
+ tracker.currentlyAccessing.delete(prop);
469
+ throw error;
470
+ } finally {
471
+ tracker.depth = prevDepth;
472
+ tracker.visitedBlocs = prevVisited;
473
+ }
474
+ }
475
+ /**
476
+ * @internal
477
+ */
438
478
  function createBlocProxy(bloc) {
439
- const cached = blocProxyCache.get(bloc);
440
- if (cached) return cached;
441
- const proxy = new Proxy(bloc, { get(target, prop, receiver) {
442
- const tracker = activeTrackerMap.get(target);
443
- if (tracker?.isTracking && isGetter(target, prop)) return executeTrackedGetter(target, prop, tracker);
444
- return Reflect.get(target, prop, receiver);
445
- } });
446
- blocProxyCache.set(bloc, proxy);
447
- return proxy;
448
- }
449
- /**
450
- * @internal
451
- */
479
+ const cached = blocProxyCache.get(bloc);
480
+ if (cached) return cached;
481
+ const proxy = new Proxy(bloc, {
482
+ get(target, prop, receiver) {
483
+ const tracker = activeTrackerMap.get(target);
484
+ if (tracker?.isTracking && isGetter(target, prop))
485
+ return executeTrackedGetter(target, prop, tracker);
486
+ return Reflect.get(target, prop, receiver);
487
+ },
488
+ });
489
+ blocProxyCache.set(bloc, proxy);
490
+ return proxy;
491
+ }
492
+ /**
493
+ * @internal
494
+ */
452
495
  function hasGetterChanges(bloc, tracker) {
453
- if (!tracker || tracker.trackedGetters.size === 0) return false;
454
- tracker.renderCache.clear();
455
- let hasAnyChange = false;
456
- for (const prop of tracker.trackedGetters) try {
457
- const descriptor = getDescriptor(bloc, prop);
458
- if (!descriptor?.get) continue;
459
- const newValue = descriptor.get.call(bloc);
460
- const oldValue = tracker.trackedValues.get(prop);
461
- tracker.renderCache.set(prop, newValue);
462
- tracker.trackedValues.set(prop, newValue);
463
- if (!Object.is(newValue, oldValue)) hasAnyChange = true;
464
- } catch (error) {
465
- console.warn(`${require_StateContainerRegistry.BLAC_ERROR_PREFIX} Getter "${String(prop)}" threw error during change detection. Stopping tracking for this getter.`, error);
466
- tracker.trackedGetters.delete(prop);
467
- tracker.trackedValues.delete(prop);
468
- tracker.cacheValid = false;
469
- return true;
470
- }
471
- tracker.cacheValid = true;
472
- return hasAnyChange;
473
- }
474
- /**
475
- * @internal
476
- */
496
+ if (!tracker || tracker.trackedGetters.size === 0) return false;
497
+ tracker.renderCache.clear();
498
+ let hasAnyChange = false;
499
+ for (const prop of tracker.trackedGetters)
500
+ try {
501
+ const descriptor = getDescriptor(bloc, prop);
502
+ if (!descriptor?.get) continue;
503
+ const newValue = descriptor.get.call(bloc);
504
+ const oldValue = tracker.trackedValues.get(prop);
505
+ tracker.renderCache.set(prop, newValue);
506
+ tracker.trackedValues.set(prop, newValue);
507
+ if (!Object.is(newValue, oldValue)) hasAnyChange = true;
508
+ } catch (error) {
509
+ console.warn(
510
+ `${require_StateContainerRegistry.BLAC_ERROR_PREFIX} Getter "${String(prop)}" threw error during change detection. Stopping tracking for this getter.`,
511
+ error,
512
+ );
513
+ tracker.trackedGetters.delete(prop);
514
+ tracker.trackedValues.delete(prop);
515
+ tracker.cacheValid = false;
516
+ return true;
517
+ }
518
+ tracker.cacheValid = true;
519
+ return hasAnyChange;
520
+ }
521
+ /**
522
+ * @internal
523
+ */
477
524
  function invalidateRenderCache(tracker) {
478
- tracker.cacheValid = false;
525
+ tracker.cacheValid = false;
479
526
  }
480
527
  /**
481
- * Create a new tracking proxy state.
482
- */
528
+ * Create a new tracking proxy state.
529
+ */
483
530
  function createState() {
484
- return {
485
- dependencyState: createDependencyState(),
486
- getterState: createGetterState(),
487
- dependencies: /* @__PURE__ */ new Set(),
488
- isTracking: false
489
- };
531
+ return {
532
+ dependencyState: createDependencyState(),
533
+ getterState: createGetterState(),
534
+ dependencies: /* @__PURE__ */ new Set(),
535
+ isTracking: false,
536
+ };
490
537
  }
491
538
  /**
492
- * Start tracking on a tracking proxy.
493
- */
539
+ * Start tracking on a tracking proxy.
540
+ */
494
541
  function startTracking(tracker) {
495
- tracker.isTracking = true;
496
- tracker.dependencies.clear();
497
- tracker.getterState.isTracking = true;
498
- startDependency(tracker.dependencyState);
542
+ tracker.isTracking = true;
543
+ tracker.dependencies.clear();
544
+ tracker.getterState.isTracking = true;
545
+ startDependency(tracker.dependencyState);
499
546
  }
500
547
  /**
501
- * Stop tracking and collect all dependencies.
502
- */
548
+ * Stop tracking and collect all dependencies.
549
+ */
503
550
  function stopTracking(tracker, bloc) {
504
- tracker.isTracking = false;
505
- tracker.getterState.isTracking = false;
506
- capturePaths(tracker.dependencyState, bloc.state);
507
- commitTrackedGetters(tracker.getterState);
508
- return new Set(tracker.dependencies);
551
+ tracker.isTracking = false;
552
+ tracker.getterState.isTracking = false;
553
+ capturePaths(tracker.dependencyState, bloc.state);
554
+ commitTrackedGetters(tracker.getterState);
555
+ return new Set(tracker.dependencies);
509
556
  }
510
557
  /**
511
- * Check if tracked state or getters have changed.
512
- */
558
+ * Check if tracked state or getters have changed.
559
+ */
513
560
  function hasChanges(tracker, bloc) {
514
- invalidateRenderCache(tracker.getterState);
515
- const stateChanged = hasDependencyChanges(tracker.dependencyState, bloc.state);
516
- const getterChanged = hasGetterChanges(bloc, tracker.getterState);
517
- return stateChanged || getterChanged;
518
- }
519
- /**
520
- * Create a tracking proxy for a bloc instance.
521
- * Tracks both state property access and getter access.
522
- */
561
+ invalidateRenderCache(tracker.getterState);
562
+ const stateChanged = hasDependencyChanges(
563
+ tracker.dependencyState,
564
+ bloc.state,
565
+ );
566
+ const getterChanged = hasGetterChanges(bloc, tracker.getterState);
567
+ return stateChanged || getterChanged;
568
+ }
569
+ /**
570
+ * Create a tracking proxy for a bloc instance.
571
+ * Tracks both state property access and getter access.
572
+ */
523
573
  function createTrackingProxy(bloc, tracker) {
524
- tracker.dependencies.add(bloc);
525
- const stateProxyCache = /* @__PURE__ */ new WeakMap();
526
- return new Proxy(bloc, { get(target, prop, receiver) {
527
- if (prop === "state") {
528
- if (!tracker.isTracking) return target.state;
529
- const rawState = target.state;
530
- if (rawState === null || typeof rawState !== "object") return rawState;
531
- if (stateProxyCache.has(rawState)) return stateProxyCache.get(rawState);
532
- const stateProxy = createDependencyProxy(tracker.dependencyState, rawState);
533
- stateProxyCache.set(rawState, stateProxy);
534
- return stateProxy;
535
- }
536
- if (typeof prop === "symbol") return Reflect.get(target, prop, receiver);
537
- const value = Reflect.get(target, prop, receiver);
538
- if (typeof value === "function") return value.bind(target);
539
- if (tracker.isTracking && isGetter(target, prop)) return executeTrackedGetter(target, prop, tracker.getterState);
540
- return value;
541
- } });
574
+ tracker.dependencies.add(bloc);
575
+ const stateProxyCache = /* @__PURE__ */ new WeakMap();
576
+ return new Proxy(bloc, {
577
+ get(target, prop, receiver) {
578
+ if (prop === 'state') {
579
+ if (!tracker.isTracking) return target.state;
580
+ const rawState = target.state;
581
+ if (rawState === null || typeof rawState !== 'object') return rawState;
582
+ if (stateProxyCache.has(rawState)) return stateProxyCache.get(rawState);
583
+ const stateProxy = createDependencyProxy(
584
+ tracker.dependencyState,
585
+ rawState,
586
+ );
587
+ stateProxyCache.set(rawState, stateProxy);
588
+ return stateProxy;
589
+ }
590
+ if (typeof prop === 'symbol') return Reflect.get(target, prop, receiver);
591
+ const value = Reflect.get(target, prop, receiver);
592
+ if (typeof value === 'function') return value.bind(target);
593
+ if (tracker.isTracking && isGetter(target, prop))
594
+ return executeTrackedGetter(target, prop, tracker.getterState);
595
+ return value;
596
+ },
597
+ });
542
598
  }
543
599
  //#endregion
544
600
  //#region src/tracking/dependency-manager.ts
545
601
  /**
546
- * Manages subscriptions to state container dependencies.
547
- * Provides efficient sync mechanism to add/remove subscriptions
548
- * as dependencies change between callback invocations.
549
- */
602
+ * Manages subscriptions to state container dependencies.
603
+ * Provides efficient sync mechanism to add/remove subscriptions
604
+ * as dependencies change between callback invocations.
605
+ */
550
606
  var DependencyManager = class {
551
- constructor() {
552
- this.subscriptions = /* @__PURE__ */ new Map();
553
- this.currentDeps = /* @__PURE__ */ new Set();
554
- }
555
- /**
556
- * Sync subscriptions with a new set of dependencies.
557
- * Adds subscriptions for new deps, removes subscriptions for stale deps.
558
- *
559
- * @param newDeps - The new set of dependencies to subscribe to
560
- * @param onChange - Callback to invoke when any dependency changes
561
- * @param exclude - Optional instance to exclude from subscriptions (e.g., primary bloc)
562
- * @returns true if the dependency set changed, false if unchanged
563
- */
564
- sync(newDeps, onChange, exclude) {
565
- const filteredNewDeps = /* @__PURE__ */ new Set();
566
- for (const dep of newDeps) if (dep !== exclude && !dep.isDisposed) filteredNewDeps.add(dep);
567
- if (this.areSetsEqual(this.currentDeps, filteredNewDeps)) return false;
568
- for (const dep of this.currentDeps) if (!filteredNewDeps.has(dep)) {
569
- const unsub = this.subscriptions.get(dep);
570
- if (unsub) {
571
- unsub();
572
- this.subscriptions.delete(dep);
573
- }
574
- }
575
- for (const dep of filteredNewDeps) if (!this.currentDeps.has(dep) && !this.subscriptions.has(dep)) {
576
- const unsub = dep.subscribe(onChange);
577
- this.subscriptions.set(dep, unsub);
578
- }
579
- this.currentDeps = filteredNewDeps;
580
- return true;
581
- }
582
- /**
583
- * Add a single dependency subscription.
584
- */
585
- add(dep, onChange) {
586
- if (this.subscriptions.has(dep) || dep.isDisposed) return;
587
- const unsub = dep.subscribe(onChange);
588
- this.subscriptions.set(dep, unsub);
589
- this.currentDeps.add(dep);
590
- }
591
- /**
592
- * Check if a dependency is currently subscribed.
593
- */
594
- has(dep) {
595
- return this.currentDeps.has(dep);
596
- }
597
- /**
598
- * Get the current set of dependencies.
599
- */
600
- getDependencies() {
601
- return new Set(this.currentDeps);
602
- }
603
- /**
604
- * Clean up all active subscriptions.
605
- */
606
- cleanup() {
607
- for (const unsub of this.subscriptions.values()) unsub();
608
- this.subscriptions.clear();
609
- this.currentDeps.clear();
610
- }
611
- areSetsEqual(a, b) {
612
- if (a.size !== b.size) return false;
613
- for (const item of a) if (!b.has(item)) return false;
614
- return true;
615
- }
607
+ constructor() {
608
+ this.subscriptions = /* @__PURE__ */ new Map();
609
+ this.currentDeps = /* @__PURE__ */ new Set();
610
+ }
611
+ /**
612
+ * Sync subscriptions with a new set of dependencies.
613
+ * Adds subscriptions for new deps, removes subscriptions for stale deps.
614
+ *
615
+ * @param newDeps - The new set of dependencies to subscribe to
616
+ * @param onChange - Callback to invoke when any dependency changes
617
+ * @param exclude - Optional instance to exclude from subscriptions (e.g., primary bloc)
618
+ * @returns true if the dependency set changed, false if unchanged
619
+ */
620
+ sync(newDeps, onChange, exclude) {
621
+ const filteredNewDeps = /* @__PURE__ */ new Set();
622
+ for (const dep of newDeps)
623
+ if (dep !== exclude && !dep.isDisposed) filteredNewDeps.add(dep);
624
+ if (this.areSetsEqual(this.currentDeps, filteredNewDeps)) return false;
625
+ for (const dep of this.currentDeps)
626
+ if (!filteredNewDeps.has(dep)) {
627
+ const unsub = this.subscriptions.get(dep);
628
+ if (unsub) {
629
+ unsub();
630
+ this.subscriptions.delete(dep);
631
+ }
632
+ }
633
+ for (const dep of filteredNewDeps)
634
+ if (!this.currentDeps.has(dep) && !this.subscriptions.has(dep)) {
635
+ const unsub = dep.subscribe(onChange);
636
+ this.subscriptions.set(dep, unsub);
637
+ }
638
+ this.currentDeps = filteredNewDeps;
639
+ return true;
640
+ }
641
+ /**
642
+ * Add a single dependency subscription.
643
+ */
644
+ add(dep, onChange) {
645
+ if (this.subscriptions.has(dep) || dep.isDisposed) return;
646
+ const unsub = dep.subscribe(onChange);
647
+ this.subscriptions.set(dep, unsub);
648
+ this.currentDeps.add(dep);
649
+ }
650
+ /**
651
+ * Check if a dependency is currently subscribed.
652
+ */
653
+ has(dep) {
654
+ return this.currentDeps.has(dep);
655
+ }
656
+ /**
657
+ * Get the current set of dependencies.
658
+ */
659
+ getDependencies() {
660
+ return new Set(this.currentDeps);
661
+ }
662
+ /**
663
+ * Clean up all active subscriptions.
664
+ */
665
+ cleanup() {
666
+ for (const unsub of this.subscriptions.values()) unsub();
667
+ this.subscriptions.clear();
668
+ this.currentDeps.clear();
669
+ }
670
+ areSetsEqual(a, b) {
671
+ if (a.size !== b.size) return false;
672
+ for (const item of a) if (!b.has(item)) return false;
673
+ return true;
674
+ }
616
675
  };
617
676
  //#endregion
618
677
  //#region src/tracking/resolve-dependencies.ts
619
678
  /**
620
- * Resolve all transitive dependencies of a bloc via BFS over `dependencies` maps.
621
- * Uses cycle detection to avoid infinite loops.
622
- * @internal
623
- */
679
+ * Resolve all transitive dependencies of a bloc via BFS over `dependencies` maps.
680
+ * Uses cycle detection to avoid infinite loops.
681
+ * @internal
682
+ */
624
683
  function resolveDependencies(bloc) {
625
- const result = /* @__PURE__ */ new Set();
626
- const visited = /* @__PURE__ */ new Set();
627
- const queue = [bloc];
628
- let head = 0;
629
- while (head < queue.length) {
630
- const current = queue[head++];
631
- for (const [Type, key] of current.dependencies) {
632
- const visitKey = `${Type.name}::${key}`;
633
- if (visited.has(visitKey)) continue;
634
- visited.add(visitKey);
635
- const dep = require_config.getRegistry().ensure(Type, key);
636
- result.add(dep);
637
- if (dep.dependencies.size > 0) queue.push(dep);
638
- }
639
- }
640
- result.delete(bloc);
641
- return result;
684
+ const result = /* @__PURE__ */ new Set();
685
+ const visited = /* @__PURE__ */ new Set();
686
+ const queue = [bloc];
687
+ let head = 0;
688
+ while (head < queue.length) {
689
+ const current = queue[head++];
690
+ for (const [Type, key] of current.dependencies) {
691
+ const visitKey = `${Type.name}::${key}`;
692
+ if (visited.has(visitKey)) continue;
693
+ visited.add(visitKey);
694
+ const dep = require_config.getRegistry().ensure(Type, key);
695
+ result.add(dep);
696
+ if (dep.dependencies.size > 0) queue.push(dep);
697
+ }
698
+ }
699
+ result.delete(bloc);
700
+ return result;
642
701
  }
643
702
  //#endregion
644
- Object.defineProperty(exports, "DependencyManager", {
645
- enumerable: true,
646
- get: function() {
647
- return DependencyManager;
648
- }
703
+ Object.defineProperty(exports, 'DependencyManager', {
704
+ enumerable: true,
705
+ get: function () {
706
+ return DependencyManager;
707
+ },
649
708
  });
650
- Object.defineProperty(exports, "capturePaths", {
651
- enumerable: true,
652
- get: function() {
653
- return capturePaths;
654
- }
709
+ Object.defineProperty(exports, 'capturePaths', {
710
+ enumerable: true,
711
+ get: function () {
712
+ return capturePaths;
713
+ },
655
714
  });
656
- Object.defineProperty(exports, "clearActiveTracker", {
657
- enumerable: true,
658
- get: function() {
659
- return clearActiveTracker;
660
- }
715
+ Object.defineProperty(exports, 'clearActiveTracker', {
716
+ enumerable: true,
717
+ get: function () {
718
+ return clearActiveTracker;
719
+ },
661
720
  });
662
- Object.defineProperty(exports, "commitTrackedGetters", {
663
- enumerable: true,
664
- get: function() {
665
- return commitTrackedGetters;
666
- }
721
+ Object.defineProperty(exports, 'commitTrackedGetters', {
722
+ enumerable: true,
723
+ get: function () {
724
+ return commitTrackedGetters;
725
+ },
667
726
  });
668
- Object.defineProperty(exports, "createBlocProxy", {
669
- enumerable: true,
670
- get: function() {
671
- return createBlocProxy;
672
- }
727
+ Object.defineProperty(exports, 'createBlocProxy', {
728
+ enumerable: true,
729
+ get: function () {
730
+ return createBlocProxy;
731
+ },
673
732
  });
674
- Object.defineProperty(exports, "createDependencyProxy", {
675
- enumerable: true,
676
- get: function() {
677
- return createDependencyProxy;
678
- }
733
+ Object.defineProperty(exports, 'createDependencyProxy', {
734
+ enumerable: true,
735
+ get: function () {
736
+ return createDependencyProxy;
737
+ },
679
738
  });
680
- Object.defineProperty(exports, "createDependencyState", {
681
- enumerable: true,
682
- get: function() {
683
- return createDependencyState;
684
- }
739
+ Object.defineProperty(exports, 'createDependencyState', {
740
+ enumerable: true,
741
+ get: function () {
742
+ return createDependencyState;
743
+ },
685
744
  });
686
- Object.defineProperty(exports, "createGetterState", {
687
- enumerable: true,
688
- get: function() {
689
- return createGetterState;
690
- }
745
+ Object.defineProperty(exports, 'createGetterState', {
746
+ enumerable: true,
747
+ get: function () {
748
+ return createGetterState;
749
+ },
691
750
  });
692
- Object.defineProperty(exports, "createState", {
693
- enumerable: true,
694
- get: function() {
695
- return createState;
696
- }
751
+ Object.defineProperty(exports, 'createState', {
752
+ enumerable: true,
753
+ get: function () {
754
+ return createState;
755
+ },
697
756
  });
698
- Object.defineProperty(exports, "createTrackingProxy", {
699
- enumerable: true,
700
- get: function() {
701
- return createTrackingProxy;
702
- }
757
+ Object.defineProperty(exports, 'createTrackingProxy', {
758
+ enumerable: true,
759
+ get: function () {
760
+ return createTrackingProxy;
761
+ },
703
762
  });
704
- Object.defineProperty(exports, "hasChanges", {
705
- enumerable: true,
706
- get: function() {
707
- return hasChanges;
708
- }
763
+ Object.defineProperty(exports, 'hasChanges', {
764
+ enumerable: true,
765
+ get: function () {
766
+ return hasChanges;
767
+ },
709
768
  });
710
- Object.defineProperty(exports, "hasDependencyChanges", {
711
- enumerable: true,
712
- get: function() {
713
- return hasDependencyChanges;
714
- }
769
+ Object.defineProperty(exports, 'hasDependencyChanges', {
770
+ enumerable: true,
771
+ get: function () {
772
+ return hasDependencyChanges;
773
+ },
715
774
  });
716
- Object.defineProperty(exports, "hasGetterChanges", {
717
- enumerable: true,
718
- get: function() {
719
- return hasGetterChanges;
720
- }
775
+ Object.defineProperty(exports, 'hasGetterChanges', {
776
+ enumerable: true,
777
+ get: function () {
778
+ return hasGetterChanges;
779
+ },
721
780
  });
722
- Object.defineProperty(exports, "hasTrackedData", {
723
- enumerable: true,
724
- get: function() {
725
- return hasTrackedData;
726
- }
781
+ Object.defineProperty(exports, 'hasTrackedData', {
782
+ enumerable: true,
783
+ get: function () {
784
+ return hasTrackedData;
785
+ },
727
786
  });
728
- Object.defineProperty(exports, "invalidateRenderCache", {
729
- enumerable: true,
730
- get: function() {
731
- return invalidateRenderCache;
732
- }
787
+ Object.defineProperty(exports, 'invalidateRenderCache', {
788
+ enumerable: true,
789
+ get: function () {
790
+ return invalidateRenderCache;
791
+ },
733
792
  });
734
- Object.defineProperty(exports, "resolveDependencies", {
735
- enumerable: true,
736
- get: function() {
737
- return resolveDependencies;
738
- }
793
+ Object.defineProperty(exports, 'resolveDependencies', {
794
+ enumerable: true,
795
+ get: function () {
796
+ return resolveDependencies;
797
+ },
739
798
  });
740
- Object.defineProperty(exports, "setActiveTracker", {
741
- enumerable: true,
742
- get: function() {
743
- return setActiveTracker;
744
- }
799
+ Object.defineProperty(exports, 'setActiveTracker', {
800
+ enumerable: true,
801
+ get: function () {
802
+ return setActiveTracker;
803
+ },
745
804
  });
746
- Object.defineProperty(exports, "shallowEqual", {
747
- enumerable: true,
748
- get: function() {
749
- return shallowEqual;
750
- }
805
+ Object.defineProperty(exports, 'shallowEqual', {
806
+ enumerable: true,
807
+ get: function () {
808
+ return shallowEqual;
809
+ },
751
810
  });
752
- Object.defineProperty(exports, "startDependency", {
753
- enumerable: true,
754
- get: function() {
755
- return startDependency;
756
- }
811
+ Object.defineProperty(exports, 'startDependency', {
812
+ enumerable: true,
813
+ get: function () {
814
+ return startDependency;
815
+ },
757
816
  });
758
- Object.defineProperty(exports, "startTracking", {
759
- enumerable: true,
760
- get: function() {
761
- return startTracking;
762
- }
817
+ Object.defineProperty(exports, 'startTracking', {
818
+ enumerable: true,
819
+ get: function () {
820
+ return startTracking;
821
+ },
763
822
  });
764
- Object.defineProperty(exports, "stopTracking", {
765
- enumerable: true,
766
- get: function() {
767
- return stopTracking;
768
- }
823
+ Object.defineProperty(exports, 'stopTracking', {
824
+ enumerable: true,
825
+ get: function () {
826
+ return stopTracking;
827
+ },
769
828
  });
770
829
 
771
- //# sourceMappingURL=resolve-dependencies-KSpTt4jy.cjs.map
830
+ //# sourceMappingURL=resolve-dependencies-KSpTt4jy.cjs.map