@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,774 +1,832 @@
1
- const require_StateContainerRegistry = require("./StateContainerRegistry-vXMWtG7J.cjs");
2
- const require_config = require("./config-D3jisfdj.cjs");
1
+ const require_StateContainerRegistry = require('./StateContainerRegistry-vXMWtG7J.cjs');
2
+ const require_config = require('./config-D3jisfdj.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 === 0) return /* @__PURE__ */ new Set();
251
- if (paths.size === 1) return new Set(paths);
252
- const sortedPaths = Array.from(paths).sort((a, b) => b.length - a.length);
253
- const optimized = /* @__PURE__ */ new Set();
254
- for (const path of sortedPaths) {
255
- let hasMoreSpecificChild = false;
256
- for (const optimizedPath of optimized) if (isChildPath(optimizedPath, path)) {
257
- hasMoreSpecificChild = true;
258
- break;
259
- }
260
- if (!hasMoreSpecificChild) optimized.add(path);
261
- }
262
- const arrayParents = /* @__PURE__ */ new Set();
263
- for (const path of optimized) {
264
- const arrayParent = getArrayParentPath(path);
265
- if (arrayParent) arrayParents.add(arrayParent);
266
- }
267
- for (const arrayParent of arrayParents) optimized.add(arrayParent);
268
- return optimized;
269
- }
270
- /**
271
- * @internal
272
- */
263
+ if (paths.size === 0) return /* @__PURE__ */ new Set();
264
+ if (paths.size === 1) return new Set(paths);
265
+ const sortedPaths = Array.from(paths).sort((a, b) => b.length - a.length);
266
+ const optimized = /* @__PURE__ */ new Set();
267
+ for (const path of sortedPaths) {
268
+ let hasMoreSpecificChild = false;
269
+ for (const optimizedPath of optimized)
270
+ if (isChildPath(optimizedPath, path)) {
271
+ hasMoreSpecificChild = true;
272
+ break;
273
+ }
274
+ if (!hasMoreSpecificChild) optimized.add(path);
275
+ }
276
+ const arrayParents = /* @__PURE__ */ new Set();
277
+ for (const path of optimized) {
278
+ const arrayParent = getArrayParentPath(path);
279
+ if (arrayParent) arrayParents.add(arrayParent);
280
+ }
281
+ for (const arrayParent of arrayParents) optimized.add(arrayParent);
282
+ return optimized;
283
+ }
284
+ /**
285
+ * @internal
286
+ */
273
287
  function createDependencyState() {
274
- return {
275
- proxyState: createProxyState(),
276
- previousRenderPaths: /* @__PURE__ */ new Set(),
277
- currentRenderPaths: /* @__PURE__ */ new Set(),
278
- pathCache: /* @__PURE__ */ new Map(),
279
- lastCheckedState: null,
280
- lastCheckedValues: /* @__PURE__ */ new Map()
281
- };
282
- }
283
- /**
284
- * @internal
285
- */
288
+ return {
289
+ proxyState: createProxyState(),
290
+ previousRenderPaths: /* @__PURE__ */ new Set(),
291
+ currentRenderPaths: /* @__PURE__ */ new Set(),
292
+ pathCache: /* @__PURE__ */ new Map(),
293
+ lastCheckedState: null,
294
+ lastCheckedValues: /* @__PURE__ */ new Map(),
295
+ };
296
+ }
297
+ /**
298
+ * @internal
299
+ */
286
300
  function startDependency(tracker) {
287
- startProxy(tracker.proxyState);
301
+ startProxy(tracker.proxyState);
288
302
  }
289
303
  /**
290
- * @internal
291
- */
304
+ * @internal
305
+ */
292
306
  function createDependencyProxy(tracker, state) {
293
- return createForTarget(tracker.proxyState, state);
307
+ return createForTarget(tracker.proxyState, state);
294
308
  }
295
309
  /**
296
- * @internal
297
- */
310
+ * @internal
311
+ */
298
312
  function capturePaths(tracker, state) {
299
- tracker.previousRenderPaths = tracker.currentRenderPaths;
300
- tracker.currentRenderPaths = optimizeTrackedPaths(stopProxy(tracker.proxyState));
301
- if (tracker.previousRenderPaths.size === 0 && tracker.currentRenderPaths.size === 0) return;
302
- const trackedPathsUnion = new Set(tracker.previousRenderPaths);
303
- for (const path of tracker.currentRenderPaths) trackedPathsUnion.add(path);
304
- const canReuseCache = tracker.lastCheckedState === state;
305
- for (const path of trackedPathsUnion) if (!tracker.pathCache.has(path)) {
306
- const segments = parsePath(path);
307
- const value = canReuseCache && tracker.lastCheckedValues.has(path) ? tracker.lastCheckedValues.get(path) : getValueAtPath(state, segments);
308
- tracker.pathCache.set(path, {
309
- segments,
310
- value
311
- });
312
- } else {
313
- const info = tracker.pathCache.get(path);
314
- if (!info) continue;
315
- info.value = canReuseCache && tracker.lastCheckedValues.has(path) ? tracker.lastCheckedValues.get(path) : getValueAtPath(state, info.segments);
316
- }
317
- tracker.lastCheckedValues.clear();
318
- }
319
- /**
320
- * @internal
321
- */
313
+ tracker.previousRenderPaths = tracker.currentRenderPaths;
314
+ tracker.currentRenderPaths = optimizeTrackedPaths(
315
+ stopProxy(tracker.proxyState),
316
+ );
317
+ if (
318
+ tracker.previousRenderPaths.size === 0 &&
319
+ tracker.currentRenderPaths.size === 0
320
+ )
321
+ return;
322
+ const trackedPathsUnion = new Set(tracker.previousRenderPaths);
323
+ for (const path of tracker.currentRenderPaths) trackedPathsUnion.add(path);
324
+ const canReuseCache = tracker.lastCheckedState === state;
325
+ for (const path of trackedPathsUnion)
326
+ if (!tracker.pathCache.has(path)) {
327
+ const segments = parsePath(path);
328
+ const value =
329
+ canReuseCache && tracker.lastCheckedValues.has(path)
330
+ ? tracker.lastCheckedValues.get(path)
331
+ : getValueAtPath(state, segments);
332
+ tracker.pathCache.set(path, {
333
+ segments,
334
+ value,
335
+ });
336
+ } else {
337
+ const info = tracker.pathCache.get(path);
338
+ if (!info) continue;
339
+ info.value =
340
+ canReuseCache && tracker.lastCheckedValues.has(path)
341
+ ? tracker.lastCheckedValues.get(path)
342
+ : getValueAtPath(state, info.segments);
343
+ }
344
+ tracker.lastCheckedValues.clear();
345
+ }
346
+ /**
347
+ * @internal
348
+ */
322
349
  function hasDependencyChanges(tracker, state) {
323
- if (tracker.pathCache.size === 0) return true;
324
- tracker.lastCheckedValues.clear();
325
- for (const [path, info] of tracker.pathCache.entries()) {
326
- const currentValue = getValueAtPath(state, info.segments);
327
- tracker.lastCheckedValues.set(path, currentValue);
328
- if (!Object.is(currentValue, info.value)) {
329
- tracker.lastCheckedState = state;
330
- return true;
331
- }
332
- }
333
- tracker.lastCheckedState = state;
334
- return false;
335
- }
336
- /**
337
- * @internal
338
- */
350
+ if (tracker.pathCache.size === 0) return true;
351
+ tracker.lastCheckedValues.clear();
352
+ for (const [path, info] of tracker.pathCache.entries()) {
353
+ const currentValue = getValueAtPath(state, info.segments);
354
+ tracker.lastCheckedValues.set(path, currentValue);
355
+ if (!Object.is(currentValue, info.value)) {
356
+ tracker.lastCheckedState = state;
357
+ return true;
358
+ }
359
+ }
360
+ tracker.lastCheckedState = state;
361
+ return false;
362
+ }
363
+ /**
364
+ * @internal
365
+ */
339
366
  function hasTrackedData(tracker) {
340
- return tracker.proxyState.trackedPaths.size > 0 || tracker.pathCache.size > 0 || tracker.previousRenderPaths.size > 0;
367
+ return (
368
+ tracker.proxyState.trackedPaths.size > 0 ||
369
+ tracker.pathCache.size > 0 ||
370
+ tracker.previousRenderPaths.size > 0
371
+ );
341
372
  }
342
373
  const descriptorCache = /* @__PURE__ */ new WeakMap();
343
374
  const blocProxyCache = /* @__PURE__ */ new WeakMap();
344
375
  const activeTrackerMap = /* @__PURE__ */ new WeakMap();
345
- const MAX_GETTER_DEPTH = require_StateContainerRegistry.BLAC_DEFAULTS.MAX_GETTER_DEPTH;
376
+ const MAX_GETTER_DEPTH =
377
+ require_StateContainerRegistry.BLAC_DEFAULTS.MAX_GETTER_DEPTH;
346
378
  /**
347
- * @internal
348
- */
379
+ * @internal
380
+ */
349
381
  function getDescriptor(obj, prop) {
350
- const constructor = obj.constructor;
351
- let constructorCache = descriptorCache.get(constructor);
352
- if (constructorCache?.has(prop)) return constructorCache.get(prop);
353
- let current = obj;
354
- let descriptor;
355
- while (current && current !== Object.prototype) {
356
- descriptor = Object.getOwnPropertyDescriptor(current, prop);
357
- if (descriptor) break;
358
- current = Object.getPrototypeOf(current);
359
- }
360
- if (!constructorCache) {
361
- constructorCache = /* @__PURE__ */ new Map();
362
- descriptorCache.set(constructor, constructorCache);
363
- }
364
- constructorCache.set(prop, descriptor);
365
- return descriptor;
366
- }
367
- /**
368
- * @internal
369
- */
382
+ const constructor = obj.constructor;
383
+ let constructorCache = descriptorCache.get(constructor);
384
+ if (constructorCache?.has(prop)) return constructorCache.get(prop);
385
+ let current = obj;
386
+ let descriptor;
387
+ while (current && current !== Object.prototype) {
388
+ descriptor = Object.getOwnPropertyDescriptor(current, prop);
389
+ if (descriptor) break;
390
+ current = Object.getPrototypeOf(current);
391
+ }
392
+ if (!constructorCache) {
393
+ constructorCache = /* @__PURE__ */ new Map();
394
+ descriptorCache.set(constructor, constructorCache);
395
+ }
396
+ constructorCache.set(prop, descriptor);
397
+ return descriptor;
398
+ }
399
+ /**
400
+ * @internal
401
+ */
370
402
  function isGetter(obj, prop) {
371
- return getDescriptor(obj, prop)?.get !== void 0;
403
+ return getDescriptor(obj, prop)?.get !== void 0;
372
404
  }
373
405
  /**
374
- * @internal
375
- */
406
+ * @internal
407
+ */
376
408
  function createGetterState() {
377
- return {
378
- trackedValues: /* @__PURE__ */ new Map(),
379
- currentlyAccessing: /* @__PURE__ */ new Set(),
380
- trackedGetters: /* @__PURE__ */ new Set(),
381
- isTracking: false,
382
- renderCache: /* @__PURE__ */ new Map(),
383
- cacheValid: false,
384
- depth: 0,
385
- visitedBlocs: /* @__PURE__ */ new Set()
386
- };
387
- }
388
- /**
389
- * @internal
390
- */
409
+ return {
410
+ trackedValues: /* @__PURE__ */ new Map(),
411
+ currentlyAccessing: /* @__PURE__ */ new Set(),
412
+ trackedGetters: /* @__PURE__ */ new Set(),
413
+ isTracking: false,
414
+ renderCache: /* @__PURE__ */ new Map(),
415
+ cacheValid: false,
416
+ depth: 0,
417
+ visitedBlocs: /* @__PURE__ */ new Set(),
418
+ };
419
+ }
420
+ /**
421
+ * @internal
422
+ */
391
423
  function setActiveTracker(bloc, tracker) {
392
- activeTrackerMap.set(bloc, tracker);
424
+ activeTrackerMap.set(bloc, tracker);
393
425
  }
394
426
  /**
395
- * @internal
396
- */
427
+ * @internal
428
+ */
397
429
  function clearActiveTracker(bloc) {
398
- activeTrackerMap.delete(bloc);
430
+ activeTrackerMap.delete(bloc);
399
431
  }
400
432
  /**
401
- * @internal
402
- */
433
+ * @internal
434
+ */
403
435
  function commitTrackedGetters(tracker) {
404
- if (tracker.currentlyAccessing.size > 0) tracker.trackedGetters = new Set(tracker.currentlyAccessing);
405
- tracker.currentlyAccessing.clear();
436
+ if (tracker.currentlyAccessing.size > 0)
437
+ tracker.trackedGetters = new Set(tracker.currentlyAccessing);
438
+ tracker.currentlyAccessing.clear();
406
439
  }
407
440
  /**
408
- * Execute a tracked getter with depth/circular dependency checks and context management.
409
- * @internal
410
- */
441
+ * Execute a tracked getter with depth/circular dependency checks and context management.
442
+ * @internal
443
+ */
411
444
  function executeTrackedGetter(target, prop, tracker) {
412
- tracker.currentlyAccessing.add(prop);
413
- if (tracker.cacheValid && tracker.renderCache.has(prop)) {
414
- const cachedValue = tracker.renderCache.get(prop);
415
- tracker.trackedValues.set(prop, cachedValue);
416
- return cachedValue;
417
- }
418
- 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}.`);
419
- if (tracker.visitedBlocs.has(target)) throw new Error(`${require_StateContainerRegistry.BLAC_ERROR_PREFIX} Circular dependency detected: getter "${String(prop)}" on ${target.constructor.name}.`);
420
- const prevDepth = tracker.depth;
421
- const prevVisited = new Set(tracker.visitedBlocs);
422
- tracker.depth++;
423
- tracker.visitedBlocs.add(target);
424
- try {
425
- const descriptor = getDescriptor(target, prop);
426
- if (!descriptor?.get) return target[prop];
427
- const value = descriptor.get.call(target);
428
- tracker.trackedValues.set(prop, value);
429
- return value;
430
- } catch (error) {
431
- tracker.currentlyAccessing.delete(prop);
432
- throw error;
433
- } finally {
434
- tracker.depth = prevDepth;
435
- tracker.visitedBlocs = prevVisited;
436
- }
437
- }
438
- /**
439
- * @internal
440
- */
445
+ tracker.currentlyAccessing.add(prop);
446
+ if (tracker.cacheValid && tracker.renderCache.has(prop)) {
447
+ const cachedValue = tracker.renderCache.get(prop);
448
+ tracker.trackedValues.set(prop, cachedValue);
449
+ return cachedValue;
450
+ }
451
+ if (tracker.depth >= MAX_GETTER_DEPTH)
452
+ throw new Error(
453
+ `${require_StateContainerRegistry.BLAC_ERROR_PREFIX} Maximum getter depth (${MAX_GETTER_DEPTH}) exceeded. Possible circular dependency in getter "${String(prop)}" on ${target.constructor.name}.`,
454
+ );
455
+ if (tracker.visitedBlocs.has(target))
456
+ throw new Error(
457
+ `${require_StateContainerRegistry.BLAC_ERROR_PREFIX} Circular dependency detected: getter "${String(prop)}" on ${target.constructor.name}.`,
458
+ );
459
+ const prevDepth = tracker.depth;
460
+ const prevVisited = new Set(tracker.visitedBlocs);
461
+ tracker.depth++;
462
+ tracker.visitedBlocs.add(target);
463
+ try {
464
+ const descriptor = getDescriptor(target, prop);
465
+ if (!descriptor?.get) return target[prop];
466
+ const value = descriptor.get.call(target);
467
+ tracker.trackedValues.set(prop, value);
468
+ return value;
469
+ } catch (error) {
470
+ tracker.currentlyAccessing.delete(prop);
471
+ throw error;
472
+ } finally {
473
+ tracker.depth = prevDepth;
474
+ tracker.visitedBlocs = prevVisited;
475
+ }
476
+ }
477
+ /**
478
+ * @internal
479
+ */
441
480
  function createBlocProxy(bloc) {
442
- const cached = blocProxyCache.get(bloc);
443
- if (cached) return cached;
444
- const proxy = new Proxy(bloc, { get(target, prop, receiver) {
445
- const tracker = activeTrackerMap.get(target);
446
- if (tracker?.isTracking && isGetter(target, prop)) return executeTrackedGetter(target, prop, tracker);
447
- return Reflect.get(target, prop, receiver);
448
- } });
449
- blocProxyCache.set(bloc, proxy);
450
- return proxy;
451
- }
452
- /**
453
- * @internal
454
- */
481
+ const cached = blocProxyCache.get(bloc);
482
+ if (cached) return cached;
483
+ const proxy = new Proxy(bloc, {
484
+ get(target, prop, receiver) {
485
+ const tracker = activeTrackerMap.get(target);
486
+ if (tracker?.isTracking && isGetter(target, prop))
487
+ return executeTrackedGetter(target, prop, tracker);
488
+ return Reflect.get(target, prop, receiver);
489
+ },
490
+ });
491
+ blocProxyCache.set(bloc, proxy);
492
+ return proxy;
493
+ }
494
+ /**
495
+ * @internal
496
+ */
455
497
  function hasGetterChanges(bloc, tracker) {
456
- if (!tracker || tracker.trackedGetters.size === 0) return false;
457
- tracker.renderCache.clear();
458
- let hasAnyChange = false;
459
- for (const prop of tracker.trackedGetters) try {
460
- const descriptor = getDescriptor(bloc, prop);
461
- if (!descriptor?.get) continue;
462
- const newValue = descriptor.get.call(bloc);
463
- const oldValue = tracker.trackedValues.get(prop);
464
- tracker.renderCache.set(prop, newValue);
465
- tracker.trackedValues.set(prop, newValue);
466
- if (!Object.is(newValue, oldValue)) hasAnyChange = true;
467
- } catch (error) {
468
- console.warn(`${require_StateContainerRegistry.BLAC_ERROR_PREFIX} Getter "${String(prop)}" threw error during change detection. Stopping tracking for this getter.`, error);
469
- tracker.trackedGetters.delete(prop);
470
- tracker.trackedValues.delete(prop);
471
- tracker.cacheValid = false;
472
- return true;
473
- }
474
- tracker.cacheValid = true;
475
- return hasAnyChange;
476
- }
477
- /**
478
- * @internal
479
- */
498
+ if (!tracker || tracker.trackedGetters.size === 0) return false;
499
+ tracker.renderCache.clear();
500
+ let hasAnyChange = false;
501
+ for (const prop of tracker.trackedGetters)
502
+ try {
503
+ const descriptor = getDescriptor(bloc, prop);
504
+ if (!descriptor?.get) continue;
505
+ const newValue = descriptor.get.call(bloc);
506
+ const oldValue = tracker.trackedValues.get(prop);
507
+ tracker.renderCache.set(prop, newValue);
508
+ tracker.trackedValues.set(prop, newValue);
509
+ if (!Object.is(newValue, oldValue)) hasAnyChange = true;
510
+ } catch (error) {
511
+ console.warn(
512
+ `${require_StateContainerRegistry.BLAC_ERROR_PREFIX} Getter "${String(prop)}" threw error during change detection. Stopping tracking for this getter.`,
513
+ error,
514
+ );
515
+ tracker.trackedGetters.delete(prop);
516
+ tracker.trackedValues.delete(prop);
517
+ tracker.cacheValid = false;
518
+ return true;
519
+ }
520
+ tracker.cacheValid = true;
521
+ return hasAnyChange;
522
+ }
523
+ /**
524
+ * @internal
525
+ */
480
526
  function invalidateRenderCache(tracker) {
481
- tracker.cacheValid = false;
527
+ tracker.cacheValid = false;
482
528
  }
483
529
  /**
484
- * Create a new tracking proxy state.
485
- */
530
+ * Create a new tracking proxy state.
531
+ */
486
532
  function createState() {
487
- return {
488
- dependencyState: createDependencyState(),
489
- getterState: createGetterState(),
490
- dependencies: /* @__PURE__ */ new Set(),
491
- isTracking: false
492
- };
533
+ return {
534
+ dependencyState: createDependencyState(),
535
+ getterState: createGetterState(),
536
+ dependencies: /* @__PURE__ */ new Set(),
537
+ isTracking: false,
538
+ };
493
539
  }
494
540
  /**
495
- * Start tracking on a tracking proxy.
496
- */
541
+ * Start tracking on a tracking proxy.
542
+ */
497
543
  function startTracking(tracker) {
498
- tracker.isTracking = true;
499
- tracker.dependencies.clear();
500
- tracker.getterState.isTracking = true;
501
- startDependency(tracker.dependencyState);
544
+ tracker.isTracking = true;
545
+ tracker.dependencies.clear();
546
+ tracker.getterState.isTracking = true;
547
+ startDependency(tracker.dependencyState);
502
548
  }
503
549
  /**
504
- * Stop tracking and collect all dependencies.
505
- */
550
+ * Stop tracking and collect all dependencies.
551
+ */
506
552
  function stopTracking(tracker, bloc) {
507
- tracker.isTracking = false;
508
- tracker.getterState.isTracking = false;
509
- capturePaths(tracker.dependencyState, bloc.state);
510
- commitTrackedGetters(tracker.getterState);
511
- return new Set(tracker.dependencies);
553
+ tracker.isTracking = false;
554
+ tracker.getterState.isTracking = false;
555
+ capturePaths(tracker.dependencyState, bloc.state);
556
+ commitTrackedGetters(tracker.getterState);
557
+ return new Set(tracker.dependencies);
512
558
  }
513
559
  /**
514
- * Check if tracked state or getters have changed.
515
- */
560
+ * Check if tracked state or getters have changed.
561
+ */
516
562
  function hasChanges(tracker, bloc) {
517
- invalidateRenderCache(tracker.getterState);
518
- const stateChanged = hasDependencyChanges(tracker.dependencyState, bloc.state);
519
- const getterChanged = hasGetterChanges(bloc, tracker.getterState);
520
- return stateChanged || getterChanged;
521
- }
522
- /**
523
- * Create a tracking proxy for a bloc instance.
524
- * Tracks both state property access and getter access.
525
- */
563
+ invalidateRenderCache(tracker.getterState);
564
+ const stateChanged = hasDependencyChanges(
565
+ tracker.dependencyState,
566
+ bloc.state,
567
+ );
568
+ const getterChanged = hasGetterChanges(bloc, tracker.getterState);
569
+ return stateChanged || getterChanged;
570
+ }
571
+ /**
572
+ * Create a tracking proxy for a bloc instance.
573
+ * Tracks both state property access and getter access.
574
+ */
526
575
  function createTrackingProxy(bloc, tracker) {
527
- tracker.dependencies.add(bloc);
528
- const stateProxyCache = /* @__PURE__ */ new WeakMap();
529
- return new Proxy(bloc, { get(target, prop, receiver) {
530
- if (prop === "state") {
531
- if (!tracker.isTracking) return target.state;
532
- const rawState = target.state;
533
- if (rawState === null || typeof rawState !== "object") return rawState;
534
- if (stateProxyCache.has(rawState)) return stateProxyCache.get(rawState);
535
- const stateProxy = createDependencyProxy(tracker.dependencyState, rawState);
536
- stateProxyCache.set(rawState, stateProxy);
537
- return stateProxy;
538
- }
539
- if (typeof prop === "symbol") return Reflect.get(target, prop, receiver);
540
- const value = Reflect.get(target, prop, receiver);
541
- if (typeof value === "function") return value.bind(target);
542
- if (tracker.isTracking && isGetter(target, prop)) return executeTrackedGetter(target, prop, tracker.getterState);
543
- return value;
544
- } });
576
+ tracker.dependencies.add(bloc);
577
+ const stateProxyCache = /* @__PURE__ */ new WeakMap();
578
+ return new Proxy(bloc, {
579
+ get(target, prop, receiver) {
580
+ if (prop === 'state') {
581
+ if (!tracker.isTracking) return target.state;
582
+ const rawState = target.state;
583
+ if (rawState === null || typeof rawState !== 'object') return rawState;
584
+ if (stateProxyCache.has(rawState)) return stateProxyCache.get(rawState);
585
+ const stateProxy = createDependencyProxy(
586
+ tracker.dependencyState,
587
+ rawState,
588
+ );
589
+ stateProxyCache.set(rawState, stateProxy);
590
+ return stateProxy;
591
+ }
592
+ if (typeof prop === 'symbol') return Reflect.get(target, prop, receiver);
593
+ const value = Reflect.get(target, prop, receiver);
594
+ if (typeof value === 'function') return value.bind(target);
595
+ if (tracker.isTracking && isGetter(target, prop))
596
+ return executeTrackedGetter(target, prop, tracker.getterState);
597
+ return value;
598
+ },
599
+ });
545
600
  }
546
601
  //#endregion
547
602
  //#region src/tracking/dependency-manager.ts
548
603
  /**
549
- * Manages subscriptions to state container dependencies.
550
- * Provides efficient sync mechanism to add/remove subscriptions
551
- * as dependencies change between callback invocations.
552
- */
604
+ * Manages subscriptions to state container dependencies.
605
+ * Provides efficient sync mechanism to add/remove subscriptions
606
+ * as dependencies change between callback invocations.
607
+ */
553
608
  var DependencyManager = class {
554
- constructor() {
555
- this.subscriptions = /* @__PURE__ */ new Map();
556
- this.currentDeps = /* @__PURE__ */ new Set();
557
- }
558
- /**
559
- * Sync subscriptions with a new set of dependencies.
560
- * Adds subscriptions for new deps, removes subscriptions for stale deps.
561
- *
562
- * @param newDeps - The new set of dependencies to subscribe to
563
- * @param onChange - Callback to invoke when any dependency changes
564
- * @param exclude - Optional instance to exclude from subscriptions (e.g., primary bloc)
565
- * @returns true if the dependency set changed, false if unchanged
566
- */
567
- sync(newDeps, onChange, exclude) {
568
- const filteredNewDeps = /* @__PURE__ */ new Set();
569
- for (const dep of newDeps) if (dep !== exclude && !dep.isDisposed) filteredNewDeps.add(dep);
570
- if (this.areSetsEqual(this.currentDeps, filteredNewDeps)) return false;
571
- for (const dep of this.currentDeps) if (!filteredNewDeps.has(dep)) {
572
- const unsub = this.subscriptions.get(dep);
573
- if (unsub) {
574
- unsub();
575
- this.subscriptions.delete(dep);
576
- }
577
- }
578
- for (const dep of filteredNewDeps) if (!this.currentDeps.has(dep) && !this.subscriptions.has(dep)) {
579
- const unsub = dep.subscribe(onChange);
580
- this.subscriptions.set(dep, unsub);
581
- }
582
- this.currentDeps = filteredNewDeps;
583
- return true;
584
- }
585
- /**
586
- * Add a single dependency subscription.
587
- */
588
- add(dep, onChange) {
589
- if (this.subscriptions.has(dep) || dep.isDisposed) return;
590
- const unsub = dep.subscribe(onChange);
591
- this.subscriptions.set(dep, unsub);
592
- this.currentDeps.add(dep);
593
- }
594
- /**
595
- * Check if a dependency is currently subscribed.
596
- */
597
- has(dep) {
598
- return this.currentDeps.has(dep);
599
- }
600
- /**
601
- * Get the current set of dependencies.
602
- */
603
- getDependencies() {
604
- return new Set(this.currentDeps);
605
- }
606
- /**
607
- * Clean up all active subscriptions.
608
- */
609
- cleanup() {
610
- for (const unsub of this.subscriptions.values()) unsub();
611
- this.subscriptions.clear();
612
- this.currentDeps.clear();
613
- }
614
- areSetsEqual(a, b) {
615
- if (a.size !== b.size) return false;
616
- for (const item of a) if (!b.has(item)) return false;
617
- return true;
618
- }
609
+ constructor() {
610
+ this.subscriptions = /* @__PURE__ */ new Map();
611
+ this.currentDeps = /* @__PURE__ */ new Set();
612
+ }
613
+ /**
614
+ * Sync subscriptions with a new set of dependencies.
615
+ * Adds subscriptions for new deps, removes subscriptions for stale deps.
616
+ *
617
+ * @param newDeps - The new set of dependencies to subscribe to
618
+ * @param onChange - Callback to invoke when any dependency changes
619
+ * @param exclude - Optional instance to exclude from subscriptions (e.g., primary bloc)
620
+ * @returns true if the dependency set changed, false if unchanged
621
+ */
622
+ sync(newDeps, onChange, exclude) {
623
+ const filteredNewDeps = /* @__PURE__ */ new Set();
624
+ for (const dep of newDeps)
625
+ if (dep !== exclude && !dep.isDisposed) filteredNewDeps.add(dep);
626
+ if (this.areSetsEqual(this.currentDeps, filteredNewDeps)) return false;
627
+ for (const dep of this.currentDeps)
628
+ if (!filteredNewDeps.has(dep)) {
629
+ const unsub = this.subscriptions.get(dep);
630
+ if (unsub) {
631
+ unsub();
632
+ this.subscriptions.delete(dep);
633
+ }
634
+ }
635
+ for (const dep of filteredNewDeps)
636
+ if (!this.currentDeps.has(dep) && !this.subscriptions.has(dep)) {
637
+ const unsub = dep.subscribe(onChange);
638
+ this.subscriptions.set(dep, unsub);
639
+ }
640
+ this.currentDeps = filteredNewDeps;
641
+ return true;
642
+ }
643
+ /**
644
+ * Add a single dependency subscription.
645
+ */
646
+ add(dep, onChange) {
647
+ if (this.subscriptions.has(dep) || dep.isDisposed) return;
648
+ const unsub = dep.subscribe(onChange);
649
+ this.subscriptions.set(dep, unsub);
650
+ this.currentDeps.add(dep);
651
+ }
652
+ /**
653
+ * Check if a dependency is currently subscribed.
654
+ */
655
+ has(dep) {
656
+ return this.currentDeps.has(dep);
657
+ }
658
+ /**
659
+ * Get the current set of dependencies.
660
+ */
661
+ getDependencies() {
662
+ return new Set(this.currentDeps);
663
+ }
664
+ /**
665
+ * Clean up all active subscriptions.
666
+ */
667
+ cleanup() {
668
+ for (const unsub of this.subscriptions.values()) unsub();
669
+ this.subscriptions.clear();
670
+ this.currentDeps.clear();
671
+ }
672
+ areSetsEqual(a, b) {
673
+ if (a.size !== b.size) return false;
674
+ for (const item of a) if (!b.has(item)) return false;
675
+ return true;
676
+ }
619
677
  };
620
678
  //#endregion
621
679
  //#region src/tracking/resolve-dependencies.ts
622
680
  /**
623
- * Resolve all transitive dependencies of a bloc via BFS over `dependencies` maps.
624
- * Uses cycle detection to avoid infinite loops.
625
- * @internal
626
- */
681
+ * Resolve all transitive dependencies of a bloc via BFS over `dependencies` maps.
682
+ * Uses cycle detection to avoid infinite loops.
683
+ * @internal
684
+ */
627
685
  function resolveDependencies(bloc) {
628
- const result = /* @__PURE__ */ new Set();
629
- const visited = /* @__PURE__ */ new Set();
630
- const queue = [bloc];
631
- while (queue.length > 0) {
632
- const current = queue.shift();
633
- if (!current) break;
634
- for (const [Type, key] of current.dependencies) {
635
- const visitKey = `${Type.name}::${key}`;
636
- if (visited.has(visitKey)) continue;
637
- visited.add(visitKey);
638
- const dep = require_config.getRegistry().ensure(Type, key);
639
- result.add(dep);
640
- if (dep.dependencies.size > 0) queue.push(dep);
641
- }
642
- }
643
- result.delete(bloc);
644
- return result;
686
+ const result = /* @__PURE__ */ new Set();
687
+ const visited = /* @__PURE__ */ new Set();
688
+ const queue = [bloc];
689
+ while (queue.length > 0) {
690
+ const current = queue.shift();
691
+ if (!current) break;
692
+ for (const [Type, key] of current.dependencies) {
693
+ const visitKey = `${Type.name}::${key}`;
694
+ if (visited.has(visitKey)) continue;
695
+ visited.add(visitKey);
696
+ const dep = require_config.getRegistry().ensure(Type, key);
697
+ result.add(dep);
698
+ if (dep.dependencies.size > 0) queue.push(dep);
699
+ }
700
+ }
701
+ result.delete(bloc);
702
+ return result;
645
703
  }
646
704
  //#endregion
647
- Object.defineProperty(exports, "DependencyManager", {
648
- enumerable: true,
649
- get: function() {
650
- return DependencyManager;
651
- }
705
+ Object.defineProperty(exports, 'DependencyManager', {
706
+ enumerable: true,
707
+ get: function () {
708
+ return DependencyManager;
709
+ },
652
710
  });
653
- Object.defineProperty(exports, "capturePaths", {
654
- enumerable: true,
655
- get: function() {
656
- return capturePaths;
657
- }
711
+ Object.defineProperty(exports, 'capturePaths', {
712
+ enumerable: true,
713
+ get: function () {
714
+ return capturePaths;
715
+ },
658
716
  });
659
- Object.defineProperty(exports, "clearActiveTracker", {
660
- enumerable: true,
661
- get: function() {
662
- return clearActiveTracker;
663
- }
717
+ Object.defineProperty(exports, 'clearActiveTracker', {
718
+ enumerable: true,
719
+ get: function () {
720
+ return clearActiveTracker;
721
+ },
664
722
  });
665
- Object.defineProperty(exports, "commitTrackedGetters", {
666
- enumerable: true,
667
- get: function() {
668
- return commitTrackedGetters;
669
- }
723
+ Object.defineProperty(exports, 'commitTrackedGetters', {
724
+ enumerable: true,
725
+ get: function () {
726
+ return commitTrackedGetters;
727
+ },
670
728
  });
671
- Object.defineProperty(exports, "createBlocProxy", {
672
- enumerable: true,
673
- get: function() {
674
- return createBlocProxy;
675
- }
729
+ Object.defineProperty(exports, 'createBlocProxy', {
730
+ enumerable: true,
731
+ get: function () {
732
+ return createBlocProxy;
733
+ },
676
734
  });
677
- Object.defineProperty(exports, "createDependencyProxy", {
678
- enumerable: true,
679
- get: function() {
680
- return createDependencyProxy;
681
- }
735
+ Object.defineProperty(exports, 'createDependencyProxy', {
736
+ enumerable: true,
737
+ get: function () {
738
+ return createDependencyProxy;
739
+ },
682
740
  });
683
- Object.defineProperty(exports, "createDependencyState", {
684
- enumerable: true,
685
- get: function() {
686
- return createDependencyState;
687
- }
741
+ Object.defineProperty(exports, 'createDependencyState', {
742
+ enumerable: true,
743
+ get: function () {
744
+ return createDependencyState;
745
+ },
688
746
  });
689
- Object.defineProperty(exports, "createGetterState", {
690
- enumerable: true,
691
- get: function() {
692
- return createGetterState;
693
- }
747
+ Object.defineProperty(exports, 'createGetterState', {
748
+ enumerable: true,
749
+ get: function () {
750
+ return createGetterState;
751
+ },
694
752
  });
695
- Object.defineProperty(exports, "createState", {
696
- enumerable: true,
697
- get: function() {
698
- return createState;
699
- }
753
+ Object.defineProperty(exports, 'createState', {
754
+ enumerable: true,
755
+ get: function () {
756
+ return createState;
757
+ },
700
758
  });
701
- Object.defineProperty(exports, "createTrackingProxy", {
702
- enumerable: true,
703
- get: function() {
704
- return createTrackingProxy;
705
- }
759
+ Object.defineProperty(exports, 'createTrackingProxy', {
760
+ enumerable: true,
761
+ get: function () {
762
+ return createTrackingProxy;
763
+ },
706
764
  });
707
- Object.defineProperty(exports, "hasChanges", {
708
- enumerable: true,
709
- get: function() {
710
- return hasChanges;
711
- }
765
+ Object.defineProperty(exports, 'hasChanges', {
766
+ enumerable: true,
767
+ get: function () {
768
+ return hasChanges;
769
+ },
712
770
  });
713
- Object.defineProperty(exports, "hasDependencyChanges", {
714
- enumerable: true,
715
- get: function() {
716
- return hasDependencyChanges;
717
- }
771
+ Object.defineProperty(exports, 'hasDependencyChanges', {
772
+ enumerable: true,
773
+ get: function () {
774
+ return hasDependencyChanges;
775
+ },
718
776
  });
719
- Object.defineProperty(exports, "hasGetterChanges", {
720
- enumerable: true,
721
- get: function() {
722
- return hasGetterChanges;
723
- }
777
+ Object.defineProperty(exports, 'hasGetterChanges', {
778
+ enumerable: true,
779
+ get: function () {
780
+ return hasGetterChanges;
781
+ },
724
782
  });
725
- Object.defineProperty(exports, "hasTrackedData", {
726
- enumerable: true,
727
- get: function() {
728
- return hasTrackedData;
729
- }
783
+ Object.defineProperty(exports, 'hasTrackedData', {
784
+ enumerable: true,
785
+ get: function () {
786
+ return hasTrackedData;
787
+ },
730
788
  });
731
- Object.defineProperty(exports, "invalidateRenderCache", {
732
- enumerable: true,
733
- get: function() {
734
- return invalidateRenderCache;
735
- }
789
+ Object.defineProperty(exports, 'invalidateRenderCache', {
790
+ enumerable: true,
791
+ get: function () {
792
+ return invalidateRenderCache;
793
+ },
736
794
  });
737
- Object.defineProperty(exports, "resolveDependencies", {
738
- enumerable: true,
739
- get: function() {
740
- return resolveDependencies;
741
- }
795
+ Object.defineProperty(exports, 'resolveDependencies', {
796
+ enumerable: true,
797
+ get: function () {
798
+ return resolveDependencies;
799
+ },
742
800
  });
743
- Object.defineProperty(exports, "setActiveTracker", {
744
- enumerable: true,
745
- get: function() {
746
- return setActiveTracker;
747
- }
801
+ Object.defineProperty(exports, 'setActiveTracker', {
802
+ enumerable: true,
803
+ get: function () {
804
+ return setActiveTracker;
805
+ },
748
806
  });
749
- Object.defineProperty(exports, "shallowEqual", {
750
- enumerable: true,
751
- get: function() {
752
- return shallowEqual;
753
- }
807
+ Object.defineProperty(exports, 'shallowEqual', {
808
+ enumerable: true,
809
+ get: function () {
810
+ return shallowEqual;
811
+ },
754
812
  });
755
- Object.defineProperty(exports, "startDependency", {
756
- enumerable: true,
757
- get: function() {
758
- return startDependency;
759
- }
813
+ Object.defineProperty(exports, 'startDependency', {
814
+ enumerable: true,
815
+ get: function () {
816
+ return startDependency;
817
+ },
760
818
  });
761
- Object.defineProperty(exports, "startTracking", {
762
- enumerable: true,
763
- get: function() {
764
- return startTracking;
765
- }
819
+ Object.defineProperty(exports, 'startTracking', {
820
+ enumerable: true,
821
+ get: function () {
822
+ return startTracking;
823
+ },
766
824
  });
767
- Object.defineProperty(exports, "stopTracking", {
768
- enumerable: true,
769
- get: function() {
770
- return stopTracking;
771
- }
825
+ Object.defineProperty(exports, 'stopTracking', {
826
+ enumerable: true,
827
+ get: function () {
828
+ return stopTracking;
829
+ },
772
830
  });
773
831
 
774
- //# sourceMappingURL=resolve-dependencies-DSQNXvnV.cjs.map
832
+ //# sourceMappingURL=resolve-dependencies-DSQNXvnV.cjs.map