@ecopages/radiant 0.3.0-alpha.0 → 0.3.0-alpha.2

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 (410) hide show
  1. package/README.md +5 -1
  2. package/dist/{chunk-scfk041e.js → chunk-0bswvy25.js} +3 -3
  3. package/dist/{chunk-scfk041e.js.map → chunk-0bswvy25.js.map} +1 -1
  4. package/dist/chunk-0btkzzyc.js +4 -0
  5. package/dist/{chunk-r75y7ydb.js.map → chunk-0btkzzyc.js.map} +1 -1
  6. package/dist/chunk-0g0j9re6.js +4 -0
  7. package/dist/{chunk-0zq7e1ne.js.map → chunk-0g0j9re6.js.map} +1 -1
  8. package/dist/chunk-1x26p09c.js +4 -0
  9. package/dist/{chunk-d4v5qpxa.js.map → chunk-1x26p09c.js.map} +1 -1
  10. package/dist/{chunk-jg20mzg8.js → chunk-21a7jask.js} +3 -3
  11. package/dist/{chunk-jg20mzg8.js.map → chunk-21a7jask.js.map} +1 -1
  12. package/dist/chunk-25zjh0kg.js +4 -0
  13. package/dist/{chunk-60q4y3k5.js.map → chunk-25zjh0kg.js.map} +1 -1
  14. package/dist/chunk-30x4hggg.js +4 -0
  15. package/dist/{chunk-zb7wh7w4.js.map → chunk-30x4hggg.js.map} +1 -1
  16. package/dist/chunk-3ryr5wx2.js +4 -0
  17. package/dist/{chunk-9554n9t4.js.map → chunk-3ryr5wx2.js.map} +2 -2
  18. package/dist/chunk-3xxvmd5c.js +4 -0
  19. package/dist/chunk-3xxvmd5c.js.map +10 -0
  20. package/dist/chunk-3ynk7e1e.js +4 -0
  21. package/dist/{chunk-d7hh3ze6.js.map → chunk-3ynk7e1e.js.map} +1 -1
  22. package/dist/chunk-4e559cy5.js +4 -0
  23. package/dist/chunk-4e559cy5.js.map +10 -0
  24. package/dist/chunk-5b1en9vz.js +4 -0
  25. package/dist/chunk-5b1en9vz.js.map +10 -0
  26. package/dist/chunk-5bkat72n.js +4 -0
  27. package/dist/{chunk-5td6v9k3.js.map → chunk-5bkat72n.js.map} +2 -2
  28. package/dist/{chunk-4srpf0y5.js → chunk-5qeaq3tj.js} +3 -3
  29. package/dist/{chunk-4srpf0y5.js.map → chunk-5qeaq3tj.js.map} +1 -1
  30. package/dist/{chunk-73x7jpdd.js → chunk-66e6s792.js} +2 -2
  31. package/dist/{chunk-73x7jpdd.js.map → chunk-66e6s792.js.map} +1 -1
  32. package/dist/{chunk-paehjz94.js → chunk-79jg8q67.js} +2 -2
  33. package/dist/{chunk-paehjz94.js.map → chunk-79jg8q67.js.map} +1 -1
  34. package/dist/{chunk-8vak8w5w.js → chunk-8d5ddvvf.js} +3 -3
  35. package/dist/{chunk-8vak8w5w.js.map → chunk-8d5ddvvf.js.map} +1 -1
  36. package/dist/{chunk-tyysm4gk.js → chunk-8e9fgtbn.js} +3 -3
  37. package/dist/{chunk-tyysm4gk.js.map → chunk-8e9fgtbn.js.map} +1 -1
  38. package/dist/{chunk-8dexhy6c.js → chunk-9mqtp3js.js} +2 -2
  39. package/dist/{chunk-8dexhy6c.js.map → chunk-9mqtp3js.js.map} +1 -1
  40. package/dist/chunk-9rj2rwes.js +4 -0
  41. package/dist/{chunk-3b033cgq.js.map → chunk-9rj2rwes.js.map} +1 -1
  42. package/dist/{chunk-x0522ksh.js → chunk-atms6yrh.js} +3 -3
  43. package/dist/{chunk-x0522ksh.js.map → chunk-atms6yrh.js.map} +1 -1
  44. package/dist/{chunk-qdj6r8jn.js → chunk-bk2nbmcd.js} +2 -2
  45. package/dist/{chunk-qdj6r8jn.js.map → chunk-bk2nbmcd.js.map} +1 -1
  46. package/dist/{chunk-qd28hvdx.js → chunk-bk6qkvfp.js} +2 -2
  47. package/dist/{chunk-qd28hvdx.js.map → chunk-bk6qkvfp.js.map} +1 -1
  48. package/dist/chunk-c0qyz98c.js +4 -0
  49. package/dist/chunk-c0qyz98c.js.map +10 -0
  50. package/dist/chunk-c52qhh0j.js +4 -0
  51. package/dist/{chunk-60015zxq.js.map → chunk-c52qhh0j.js.map} +1 -1
  52. package/dist/{chunk-8tvt04cm.js → chunk-cnyxrh9r.js} +2 -2
  53. package/dist/{chunk-8tvt04cm.js.map → chunk-cnyxrh9r.js.map} +1 -1
  54. package/dist/chunk-dabagjk6.js +4 -0
  55. package/dist/chunk-dabagjk6.js.map +10 -0
  56. package/dist/chunk-e0r6ca2g.js +4 -0
  57. package/dist/chunk-e0r6ca2g.js.map +10 -0
  58. package/dist/chunk-eevw1j2q.js +4 -0
  59. package/dist/{chunk-0y78f8hj.js.map → chunk-eevw1j2q.js.map} +2 -2
  60. package/dist/{chunk-s4qgct1z.js → chunk-ek664x1c.js} +3 -3
  61. package/dist/{chunk-s4qgct1z.js.map → chunk-ek664x1c.js.map} +1 -1
  62. package/dist/{chunk-9gjmqxp2.js → chunk-eyw14d6y.js} +2 -2
  63. package/dist/{chunk-9gjmqxp2.js.map → chunk-eyw14d6y.js.map} +1 -1
  64. package/dist/{chunk-hkmm3dj9.js → chunk-fs4j94bk.js} +3 -3
  65. package/dist/{chunk-hkmm3dj9.js.map → chunk-fs4j94bk.js.map} +1 -1
  66. package/dist/{chunk-chyn72n9.js → chunk-g2z3mm6b.js} +3 -3
  67. package/dist/{chunk-chyn72n9.js.map → chunk-g2z3mm6b.js.map} +1 -1
  68. package/dist/chunk-g5n3m11h.js +4 -0
  69. package/dist/chunk-g5n3m11h.js.map +10 -0
  70. package/dist/{chunk-84fc8cz9.js → chunk-gdkte2vd.js} +3 -3
  71. package/dist/{chunk-84fc8cz9.js.map → chunk-gdkte2vd.js.map} +1 -1
  72. package/dist/chunk-gg74gdpv.js +4 -0
  73. package/dist/chunk-gg74gdpv.js.map +10 -0
  74. package/dist/{chunk-hn4j8rt5.js → chunk-h9k7crjc.js} +3 -3
  75. package/dist/{chunk-hn4j8rt5.js.map → chunk-h9k7crjc.js.map} +1 -1
  76. package/dist/{chunk-ksv01cey.js → chunk-hpzgnxgq.js} +3 -3
  77. package/dist/{chunk-ksv01cey.js.map → chunk-hpzgnxgq.js.map} +1 -1
  78. package/dist/chunk-hrjc8b1y.js +4 -0
  79. package/dist/chunk-hrjc8b1y.js.map +10 -0
  80. package/dist/chunk-hvy4zvcc.js +4 -0
  81. package/dist/{chunk-t7a1bbxq.js.map → chunk-hvy4zvcc.js.map} +1 -1
  82. package/dist/{chunk-ms6a9zdt.js → chunk-hztr86b4.js} +2 -2
  83. package/dist/{chunk-ms6a9zdt.js.map → chunk-hztr86b4.js.map} +1 -1
  84. package/dist/chunk-j3v7rca5.js +4 -0
  85. package/dist/{chunk-4fqkmpra.js.map → chunk-j3v7rca5.js.map} +1 -1
  86. package/dist/chunk-j864sv4w.js +4 -0
  87. package/dist/{chunk-w50v38rv.js.map → chunk-j864sv4w.js.map} +1 -1
  88. package/dist/chunk-kakpjgzf.js +4 -0
  89. package/dist/{chunk-d98q3myg.js.map → chunk-kakpjgzf.js.map} +2 -2
  90. package/dist/{chunk-1w1dm68j.js → chunk-kmebacvv.js} +2 -2
  91. package/dist/{chunk-1w1dm68j.js.map → chunk-kmebacvv.js.map} +1 -1
  92. package/dist/chunk-knqsm6v3.js +4 -0
  93. package/dist/{chunk-5bym7y1d.js.map → chunk-knqsm6v3.js.map} +2 -2
  94. package/dist/chunk-mp2vtrkg.js +4 -0
  95. package/dist/{chunk-zj9ez73m.js.map → chunk-mp2vtrkg.js.map} +1 -1
  96. package/dist/chunk-mpsj3cjs.js +4 -0
  97. package/dist/{chunk-qe6sjr27.js.map → chunk-mpsj3cjs.js.map} +1 -1
  98. package/dist/{chunk-dscj0sk9.js → chunk-n4p2542b.js} +3 -3
  99. package/dist/{chunk-dscj0sk9.js.map → chunk-n4p2542b.js.map} +1 -1
  100. package/dist/{chunk-agjb2a3r.js → chunk-nctznxyz.js} +3 -3
  101. package/dist/{chunk-agjb2a3r.js.map → chunk-nctznxyz.js.map} +1 -1
  102. package/dist/chunk-ndw3hc3v.js +4 -0
  103. package/dist/{chunk-2tgrfv09.js.map → chunk-ndw3hc3v.js.map} +2 -2
  104. package/dist/{chunk-57w3vmme.js → chunk-nnnb6pac.js} +3 -3
  105. package/dist/{chunk-57w3vmme.js.map → chunk-nnnb6pac.js.map} +1 -1
  106. package/dist/{chunk-8n2dhx28.js → chunk-nssj2x13.js} +2 -2
  107. package/dist/{chunk-8n2dhx28.js.map → chunk-nssj2x13.js.map} +1 -1
  108. package/dist/chunk-nvr37vma.js +4 -0
  109. package/dist/{chunk-mqxmfvyp.js.map → chunk-nvr37vma.js.map} +1 -1
  110. package/dist/chunk-p8k4g99a.js +4 -0
  111. package/dist/{chunk-vpfm9yw8.js.map → chunk-p8k4g99a.js.map} +2 -2
  112. package/dist/chunk-pkszgjqf.js +4 -0
  113. package/dist/{chunk-c8vqg7r1.js.map → chunk-pkszgjqf.js.map} +1 -1
  114. package/dist/{chunk-nerd6fmg.js → chunk-q9z6tnzw.js} +2 -2
  115. package/dist/{chunk-nerd6fmg.js.map → chunk-q9z6tnzw.js.map} +1 -1
  116. package/dist/chunk-qdz5sncz.js +4 -0
  117. package/dist/{chunk-a7hzs37s.js.map → chunk-qdz5sncz.js.map} +1 -1
  118. package/dist/chunk-qe0eww1n.js +4 -0
  119. package/dist/{chunk-ak97hp4w.js.map → chunk-qe0eww1n.js.map} +2 -2
  120. package/dist/{chunk-d0n7njdy.js → chunk-r33zvvda.js} +3 -3
  121. package/dist/{chunk-d0n7njdy.js.map → chunk-r33zvvda.js.map} +1 -1
  122. package/dist/{chunk-xd1xn3vy.js → chunk-rkh1vkb9.js} +2 -2
  123. package/dist/{chunk-xd1xn3vy.js.map → chunk-rkh1vkb9.js.map} +1 -1
  124. package/dist/chunk-rrg759ht.js +4 -0
  125. package/dist/{chunk-42tyhfvh.js.map → chunk-rrg759ht.js.map} +1 -1
  126. package/dist/{chunk-par0t822.js → chunk-s09s5ayx.js} +3 -3
  127. package/dist/{chunk-par0t822.js.map → chunk-s09s5ayx.js.map} +1 -1
  128. package/dist/chunk-s5p5z3z4.js +4 -0
  129. package/dist/chunk-s5p5z3z4.js.map +10 -0
  130. package/dist/chunk-sf4a2gy5.js +4 -0
  131. package/dist/chunk-sf4a2gy5.js.map +10 -0
  132. package/dist/{chunk-dx1wqc00.js → chunk-ssnnxzrj.js} +3 -3
  133. package/dist/{chunk-dx1wqc00.js.map → chunk-ssnnxzrj.js.map} +1 -1
  134. package/dist/{chunk-4cc2syf5.js → chunk-t8xtvgyg.js} +2 -2
  135. package/dist/{chunk-4cc2syf5.js.map → chunk-t8xtvgyg.js.map} +1 -1
  136. package/dist/chunk-v3ta7hnv.js +4 -0
  137. package/dist/{chunk-aajhkdmn.js.map → chunk-v3ta7hnv.js.map} +1 -1
  138. package/dist/{chunk-bmhn4nbp.js → chunk-v92hp9g0.js} +3 -3
  139. package/dist/{chunk-bmhn4nbp.js.map → chunk-v92hp9g0.js.map} +1 -1
  140. package/dist/{chunk-8xy18qmz.js → chunk-vgtggzb6.js} +2 -2
  141. package/dist/{chunk-8xy18qmz.js.map → chunk-vgtggzb6.js.map} +1 -1
  142. package/dist/{chunk-5a2xez36.js → chunk-vk48hgm4.js} +3 -3
  143. package/dist/{chunk-5a2xez36.js.map → chunk-vk48hgm4.js.map} +1 -1
  144. package/dist/{chunk-k5hr781q.js → chunk-w8s5fnsq.js} +3 -3
  145. package/dist/{chunk-k5hr781q.js.map → chunk-w8s5fnsq.js.map} +1 -1
  146. package/dist/{chunk-13ydx769.js → chunk-wd23rn4q.js} +2 -2
  147. package/dist/{chunk-13ydx769.js.map → chunk-wd23rn4q.js.map} +1 -1
  148. package/dist/chunk-wds4href.js +4 -0
  149. package/dist/{chunk-147yvtsn.js.map → chunk-wds4href.js.map} +2 -2
  150. package/dist/{chunk-qbnedp0y.js → chunk-wvd1ffe4.js} +2 -2
  151. package/dist/{chunk-qbnedp0y.js.map → chunk-wvd1ffe4.js.map} +1 -1
  152. package/dist/{chunk-g0gz7ypq.js → chunk-wwbjz9k4.js} +2 -2
  153. package/dist/{chunk-g0gz7ypq.js.map → chunk-wwbjz9k4.js.map} +1 -1
  154. package/dist/{chunk-qaagk55a.js → chunk-x2k0ngpz.js} +3 -3
  155. package/dist/{chunk-qaagk55a.js.map → chunk-x2k0ngpz.js.map} +1 -1
  156. package/dist/{chunk-t6x9e177.js → chunk-x457d0ap.js} +3 -3
  157. package/dist/{chunk-t6x9e177.js.map → chunk-x457d0ap.js.map} +1 -1
  158. package/dist/chunk-xbhtzkre.js +4 -0
  159. package/dist/{chunk-p6pxdvkk.js.map → chunk-xbhtzkre.js.map} +1 -1
  160. package/dist/{chunk-cbvd18v1.js → chunk-y139ycfm.js} +2 -2
  161. package/dist/{chunk-cbvd18v1.js.map → chunk-y139ycfm.js.map} +1 -1
  162. package/dist/chunk-z9kxfckm.js +4 -0
  163. package/dist/{chunk-mpjnqmbq.js.map → chunk-z9kxfckm.js.map} +1 -1
  164. package/dist/chunk-zx5txex8.js +4 -0
  165. package/dist/chunk-zx5txex8.js.map +10 -0
  166. package/dist/client/hydrator.d.ts +19 -0
  167. package/dist/client/hydrator.js +3 -0
  168. package/dist/{core/slot-projection.js.map → client/hydrator.js.map} +1 -1
  169. package/dist/client/install-hydrator.d.ts +1 -0
  170. package/dist/client/install-hydrator.js +3 -0
  171. package/dist/client/install-hydrator.js.map +10 -0
  172. package/dist/context/context-consumer-bootstrap.js +2 -2
  173. package/dist/context/context-consumer-bootstrap.js.map +1 -1
  174. package/dist/context/context-consumer-runtime.js +2 -2
  175. package/dist/context/context-consumer-runtime.js.map +1 -1
  176. package/dist/context/context-provider.js +2 -2
  177. package/dist/context/context-provider.js.map +1 -1
  178. package/dist/context/context-ssr-bridge.js +2 -2
  179. package/dist/context/context-ssr-bridge.js.map +1 -1
  180. package/dist/context/create-context.js +2 -2
  181. package/dist/context/create-context.js.map +1 -1
  182. package/dist/context/decorators/consume-context.js +2 -2
  183. package/dist/context/decorators/consume-context.js.map +1 -1
  184. package/dist/context/decorators/context-selection-delivery.js +2 -2
  185. package/dist/context/decorators/context-selection-delivery.js.map +1 -1
  186. package/dist/context/decorators/context-selector.d.ts +0 -5
  187. package/dist/context/decorators/context-selector.js +2 -2
  188. package/dist/context/decorators/context-selector.js.map +1 -1
  189. package/dist/context/decorators/legacy/consume-context.js +2 -2
  190. package/dist/context/decorators/legacy/consume-context.js.map +1 -1
  191. package/dist/context/decorators/legacy/context-selector-field.js +2 -2
  192. package/dist/context/decorators/legacy/context-selector-field.js.map +1 -1
  193. package/dist/context/decorators/legacy/context-selector.js +2 -2
  194. package/dist/context/decorators/legacy/context-selector.js.map +1 -1
  195. package/dist/context/decorators/legacy/provide-context.js +2 -2
  196. package/dist/context/decorators/legacy/provide-context.js.map +1 -1
  197. package/dist/context/decorators/on-context-update.js +2 -2
  198. package/dist/context/decorators/on-context-update.js.map +1 -1
  199. package/dist/context/decorators/provide-context.js +2 -2
  200. package/dist/context/decorators/provide-context.js.map +1 -1
  201. package/dist/context/decorators/standard/consume-context.js +2 -2
  202. package/dist/context/decorators/standard/consume-context.js.map +1 -1
  203. package/dist/context/decorators/standard/context-selector-field.js +2 -2
  204. package/dist/context/decorators/standard/context-selector-field.js.map +1 -1
  205. package/dist/context/decorators/standard/context-selector.js +2 -2
  206. package/dist/context/decorators/standard/context-selector.js.map +1 -1
  207. package/dist/context/decorators/standard/provide-context.js +2 -2
  208. package/dist/context/decorators/standard/provide-context.js.map +1 -1
  209. package/dist/context/events.js +2 -2
  210. package/dist/context/events.js.map +1 -1
  211. package/dist/context/hydration-script.d.ts +0 -4
  212. package/dist/context/hydration-script.js +2 -2
  213. package/dist/context/hydration-script.js.map +1 -1
  214. package/dist/core/custom-element-metadata.js +2 -2
  215. package/dist/core/custom-element-metadata.js.map +1 -1
  216. package/dist/core/hydration-codec.js +2 -2
  217. package/dist/core/hydration-codec.js.map +1 -1
  218. package/dist/core/radiant-component-ssr-registry.d.ts +54 -0
  219. package/dist/core/radiant-component-ssr-registry.js +3 -0
  220. package/dist/core/radiant-component-ssr-registry.js.map +9 -0
  221. package/dist/core/radiant-component-ssr.js +2 -2
  222. package/dist/core/radiant-component-ssr.js.map +1 -1
  223. package/dist/core/radiant-component.d.ts +9 -2
  224. package/dist/core/radiant-component.js +2 -2
  225. package/dist/core/radiant-component.js.map +1 -1
  226. package/dist/core/radiant-element.js +2 -2
  227. package/dist/core/radiant-element.js.map +1 -1
  228. package/dist/core/radiant-hydrator-state.d.ts +20 -0
  229. package/dist/core/radiant-hydrator-state.js +3 -0
  230. package/dist/core/radiant-hydrator-state.js.map +9 -0
  231. package/dist/core/reactive-jsx-value.js +2 -2
  232. package/dist/core/reactive-jsx-value.js.map +1 -1
  233. package/dist/core/reactive-prop-metadata.js +2 -2
  234. package/dist/core/reactive-prop-metadata.js.map +1 -1
  235. package/dist/core/{slot-projection.d.ts → slot-projection-runtime.d.ts} +0 -20
  236. package/dist/core/slot-projection-runtime.js +3 -0
  237. package/dist/core/slot-projection-runtime.js.map +9 -0
  238. package/dist/core/ssr-preparation.js +2 -2
  239. package/dist/core/ssr-preparation.js.map +1 -1
  240. package/dist/decorators/bound.js +2 -2
  241. package/dist/decorators/bound.js.map +1 -1
  242. package/dist/decorators/bridge.js +2 -2
  243. package/dist/decorators/bridge.js.map +1 -1
  244. package/dist/decorators/custom-element.js +2 -2
  245. package/dist/decorators/custom-element.js.map +1 -1
  246. package/dist/decorators/debounce.js +2 -2
  247. package/dist/decorators/debounce.js.map +1 -1
  248. package/dist/decorators/event.js +2 -2
  249. package/dist/decorators/event.js.map +1 -1
  250. package/dist/decorators/legacy/bound.js +2 -2
  251. package/dist/decorators/legacy/bound.js.map +1 -1
  252. package/dist/decorators/legacy/custom-element.js +2 -2
  253. package/dist/decorators/legacy/custom-element.js.map +1 -1
  254. package/dist/decorators/legacy/debounce.js +2 -2
  255. package/dist/decorators/legacy/debounce.js.map +1 -1
  256. package/dist/decorators/legacy/event.js +2 -2
  257. package/dist/decorators/legacy/event.js.map +1 -1
  258. package/dist/decorators/legacy/instance-initializers.js +2 -2
  259. package/dist/decorators/legacy/instance-initializers.js.map +1 -1
  260. package/dist/decorators/legacy/on-event.js +2 -2
  261. package/dist/decorators/legacy/on-event.js.map +1 -1
  262. package/dist/decorators/legacy/on-updated.js +2 -2
  263. package/dist/decorators/legacy/on-updated.js.map +1 -1
  264. package/dist/decorators/legacy/query-slot.js +2 -2
  265. package/dist/decorators/legacy/query-slot.js.map +1 -1
  266. package/dist/decorators/legacy/query.js +2 -2
  267. package/dist/decorators/legacy/query.js.map +1 -1
  268. package/dist/decorators/legacy/reactive-field.js +2 -2
  269. package/dist/decorators/legacy/reactive-field.js.map +1 -1
  270. package/dist/decorators/legacy/reactive-prop.js +2 -2
  271. package/dist/decorators/legacy/reactive-prop.js.map +1 -1
  272. package/dist/decorators/legacy/signal.js +2 -2
  273. package/dist/decorators/legacy/signal.js.map +1 -1
  274. package/dist/decorators/on-event.js +2 -2
  275. package/dist/decorators/on-event.js.map +1 -1
  276. package/dist/decorators/on-updated.js +2 -2
  277. package/dist/decorators/on-updated.js.map +1 -1
  278. package/dist/decorators/prop.js +2 -2
  279. package/dist/decorators/prop.js.map +1 -1
  280. package/dist/decorators/query-slot.js +2 -2
  281. package/dist/decorators/query-slot.js.map +1 -1
  282. package/dist/decorators/query.js +2 -2
  283. package/dist/decorators/query.js.map +1 -1
  284. package/dist/decorators/signal.js +2 -2
  285. package/dist/decorators/signal.js.map +1 -1
  286. package/dist/decorators/standard/bound.js +2 -2
  287. package/dist/decorators/standard/bound.js.map +1 -1
  288. package/dist/decorators/standard/custom-element.js +2 -2
  289. package/dist/decorators/standard/custom-element.js.map +1 -1
  290. package/dist/decorators/standard/debounce.js +2 -2
  291. package/dist/decorators/standard/debounce.js.map +1 -1
  292. package/dist/decorators/standard/event.js +2 -2
  293. package/dist/decorators/standard/event.js.map +1 -1
  294. package/dist/decorators/standard/on-event.js +2 -2
  295. package/dist/decorators/standard/on-event.js.map +1 -1
  296. package/dist/decorators/standard/on-updated.js +2 -2
  297. package/dist/decorators/standard/on-updated.js.map +1 -1
  298. package/dist/decorators/standard/query-slot.js +2 -2
  299. package/dist/decorators/standard/query-slot.js.map +1 -1
  300. package/dist/decorators/standard/query.js +2 -2
  301. package/dist/decorators/standard/query.js.map +1 -1
  302. package/dist/decorators/standard/reactive-field.js +2 -2
  303. package/dist/decorators/standard/reactive-field.js.map +1 -1
  304. package/dist/decorators/standard/reactive-prop.js +2 -2
  305. package/dist/decorators/standard/reactive-prop.js.map +1 -1
  306. package/dist/decorators/standard/signal.js +2 -2
  307. package/dist/decorators/standard/signal.js.map +1 -1
  308. package/dist/decorators/state.js +2 -2
  309. package/dist/decorators/state.js.map +1 -1
  310. package/dist/helpers/create-event-listener.js +2 -2
  311. package/dist/helpers/create-event-listener.js.map +1 -1
  312. package/dist/helpers/create-event.js +2 -2
  313. package/dist/helpers/create-event.js.map +1 -1
  314. package/dist/helpers/create-query-slot.js +2 -2
  315. package/dist/helpers/create-query-slot.js.map +1 -1
  316. package/dist/helpers/create-query.js +2 -2
  317. package/dist/helpers/create-query.js.map +1 -1
  318. package/dist/helpers/debounce.js +2 -2
  319. package/dist/helpers/debounce.js.map +1 -1
  320. package/dist/helpers/index.js +2 -2
  321. package/dist/helpers/index.js.map +1 -1
  322. package/dist/index.d.ts +1 -0
  323. package/dist/index.js +2 -2
  324. package/dist/index.js.map +1 -1
  325. package/dist/server/context-ssr.js +2 -2
  326. package/dist/server/context-ssr.js.map +1 -1
  327. package/dist/server/html-parser.d.ts +21 -0
  328. package/dist/server/html-parser.js +3 -0
  329. package/dist/server/html-parser.js.map +9 -0
  330. package/dist/server/install-light-dom-shim.js +2 -2
  331. package/dist/server/install-light-dom-shim.js.map +2 -2
  332. package/dist/server/light-dom-shim.js +2 -2
  333. package/dist/server/light-dom-shim.js.map +1 -1
  334. package/dist/server/project-root.js +1 -1
  335. package/dist/server/radiant-component-ssr-runtime.d.ts +9 -0
  336. package/dist/server/radiant-component-ssr-runtime.js +3 -0
  337. package/dist/server/radiant-component-ssr-runtime.js.map +9 -0
  338. package/dist/server/render-component.d.ts +5 -5
  339. package/dist/server/render-component.js +2 -2
  340. package/dist/server/render-component.js.map +3 -3
  341. package/dist/server/slot-projection-html.d.ts +3 -0
  342. package/dist/server/slot-projection-html.js +3 -0
  343. package/dist/server/slot-projection-html.js.map +10 -0
  344. package/dist/signals/host-resource.js +1 -1
  345. package/dist/signals/host-signal.js +2 -2
  346. package/dist/signals/host-signal.js.map +1 -1
  347. package/dist/signals/hydration-script.d.ts +0 -4
  348. package/dist/signals/hydration-script.js +2 -2
  349. package/dist/signals/hydration-script.js.map +1 -1
  350. package/dist/tools/escape-script-json.js +2 -2
  351. package/dist/tools/escape-script-json.js.map +1 -1
  352. package/dist/tools/event-emitter.js +2 -2
  353. package/dist/tools/event-emitter.js.map +1 -1
  354. package/dist/tools/index.js +2 -2
  355. package/dist/tools/index.js.map +1 -1
  356. package/dist/tools/render-jsx-template.js +1 -1
  357. package/dist/tools/stringify-typed.js +1 -1
  358. package/dist/types.d.ts +0 -21
  359. package/dist/types.js +1 -1
  360. package/dist/types.js.map +2 -2
  361. package/dist/utils/attribute-utils.js +2 -2
  362. package/dist/utils/attribute-utils.js.map +1 -1
  363. package/dist/utils/index.js +2 -2
  364. package/dist/utils/index.js.map +1 -1
  365. package/package.json +14 -1
  366. package/size-budget.json +2 -8
  367. package/dist/chunk-0y78f8hj.js +0 -4
  368. package/dist/chunk-0zq7e1ne.js +0 -4
  369. package/dist/chunk-147yvtsn.js +0 -4
  370. package/dist/chunk-17earqbr.js +0 -4
  371. package/dist/chunk-17earqbr.js.map +0 -10
  372. package/dist/chunk-2tgrfv09.js +0 -4
  373. package/dist/chunk-3b033cgq.js +0 -4
  374. package/dist/chunk-42tyhfvh.js +0 -4
  375. package/dist/chunk-4fqkmpra.js +0 -4
  376. package/dist/chunk-5bym7y1d.js +0 -4
  377. package/dist/chunk-5td6v9k3.js +0 -4
  378. package/dist/chunk-60015zxq.js +0 -4
  379. package/dist/chunk-60q4y3k5.js +0 -4
  380. package/dist/chunk-6kdxrppw.js +0 -4
  381. package/dist/chunk-6kdxrppw.js.map +0 -10
  382. package/dist/chunk-6z34stya.js +0 -4
  383. package/dist/chunk-6z34stya.js.map +0 -10
  384. package/dist/chunk-9554n9t4.js +0 -4
  385. package/dist/chunk-9ascmjk3.js +0 -4
  386. package/dist/chunk-9ascmjk3.js.map +0 -10
  387. package/dist/chunk-a7hzs37s.js +0 -4
  388. package/dist/chunk-aajhkdmn.js +0 -4
  389. package/dist/chunk-ak97hp4w.js +0 -4
  390. package/dist/chunk-c8vqg7r1.js +0 -4
  391. package/dist/chunk-d4v5qpxa.js +0 -4
  392. package/dist/chunk-d7hh3ze6.js +0 -4
  393. package/dist/chunk-d98q3myg.js +0 -4
  394. package/dist/chunk-jce9gqqw.js +0 -4
  395. package/dist/chunk-jce9gqqw.js.map +0 -10
  396. package/dist/chunk-mpjnqmbq.js +0 -4
  397. package/dist/chunk-mqxmfvyp.js +0 -4
  398. package/dist/chunk-nw171z6m.js +0 -4
  399. package/dist/chunk-nw171z6m.js.map +0 -10
  400. package/dist/chunk-p6pxdvkk.js +0 -4
  401. package/dist/chunk-qe6sjr27.js +0 -4
  402. package/dist/chunk-r1cvaz1t.js +0 -4
  403. package/dist/chunk-r1cvaz1t.js.map +0 -10
  404. package/dist/chunk-r75y7ydb.js +0 -4
  405. package/dist/chunk-t7a1bbxq.js +0 -4
  406. package/dist/chunk-vpfm9yw8.js +0 -4
  407. package/dist/chunk-w50v38rv.js +0 -4
  408. package/dist/chunk-zb7wh7w4.js +0 -4
  409. package/dist/chunk-zj9ez73m.js +0 -4
  410. package/dist/core/slot-projection.js +0 -3
@@ -5,6 +5,6 @@
5
5
  "import type { RadiantElement } from '../../core/radiant-element';\nimport { registerReactivePropDefinition } from '../../core/reactive-prop-metadata';\nimport { type AttributeTypeConstant, isValueOfType } from '../../utils/attribute-utils';\nimport { registerLegacyInstanceInitializer } from './instance-initializers';\n\ntype ReactivePropertyOptions<T> = {\n\ttype: AttributeTypeConstant;\n\treflect?: boolean;\n\tattribute?: string;\n\tdefaultValue?: T;\n\tbind?: boolean | string;\n};\n\n/**\n * A decorator to define a reactive property.\n * Every time the property changes, the `updated` method will be called.\n * @param options The options for the reactive property.\n * @param options.type The type of the property value.\n * @param options.reflect Whether to reflect the property to the attribute.\n * @param options.attribute The name of the attribute.\n * @param options.defaultValue The default value of the property.\n */\nexport function reactiveProp<T = unknown>({\n\ttype,\n\tattribute,\n\treflect,\n\tdefaultValue,\n\tbind,\n}: ReactivePropertyOptions<T>) {\n\tif (defaultValue !== undefined && !isValueOfType(type, defaultValue)) {\n\t\tthrow new Error(`defaultValue does not match the expected type for ${type.name}`);\n\t}\n\n\treturn (target: RadiantElement, propertyName: string) => {\n\t\tconst attributeKey = attribute ?? propertyName;\n\t\tregisterReactivePropDefinition(target, propertyName, {\n\t\t\ttype,\n\t\t\treflect,\n\t\t\tattribute: attributeKey,\n\t\t\tdefaultValue,\n\t\t\tbind,\n\t\t});\n\n\t\tconst ssrStoreKey = Symbol.for(`@ecopages/radiant.ssr-prop:${propertyName}`);\n\n\t\tObject.defineProperty(target, propertyName, {\n\t\t\tget(this: RadiantElement & Record<PropertyKey, unknown>) {\n\t\t\t\treturn this[ssrStoreKey] ?? defaultValue;\n\t\t\t},\n\t\t\tset(this: RadiantElement & Record<PropertyKey, unknown>, value: T) {\n\t\t\t\tthis[ssrStoreKey] = value;\n\t\t\t},\n\t\t\tconfigurable: true,\n\t\t\tenumerable: true,\n\t\t});\n\n\t\tregisterLegacyInstanceInitializer(target, (element) => {\n\t\t\telement.registerConnectedCallback(() => {\n\t\t\t\tconst initializerValue = element[propertyName as keyof typeof element] as T | undefined;\n\t\t\t\tconst resolvedDefaultValue = defaultValue === undefined ? initializerValue : defaultValue;\n\n\t\t\t\telement.createReactiveProp(propertyName, {\n\t\t\t\t\ttype,\n\t\t\t\t\treflect,\n\t\t\t\t\tattribute: attributeKey,\n\t\t\t\t\tdefaultValue: resolvedDefaultValue,\n\t\t\t\t\tbind,\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t};\n}\n"
6
6
  ],
7
7
  "mappings": "uIAsBO,GAAS,LAAyB,EACxC,OACA,YACA,UACA,eACA,QAC8B,CAC9B,GAAI,IAAiB,QAAa,CAAC,EAAc,EAAM,CAAY,EAClE,MAAU,MAAM,qDAAqD,EAAK,MAAM,EAGjF,MAAO,CAAC,EAAwB,IAAyB,CACxD,IAAM,EAAe,GAAa,EAClC,EAA+B,EAAQ,EAAc,CACpD,OACA,UACA,UAAW,EACX,eACA,MACD,CAAC,EAED,IAAM,EAAc,OAAO,IAAI,8BAA8B,GAAc,EAE3E,OAAO,eAAe,EAAQ,EAAc,CAC3C,GAAG,EAAsD,CACxD,OAAO,KAAK,IAAgB,GAE7B,GAAG,CAAsD,EAAU,CAClE,KAAK,GAAe,GAErB,aAAc,GACd,WAAY,EACb,CAAC,EAED,EAAkC,EAAQ,CAAC,IAAY,CACtD,EAAQ,0BAA0B,IAAM,CACvC,IAAM,EAAmB,EAAQ,GAC3B,EAAuB,IAAiB,OAAY,EAAmB,EAE7E,EAAQ,mBAAmB,EAAc,CACxC,OACA,UACA,UAAW,EACX,aAAc,EACd,MACD,CAAC,EACD,EACD",
8
- "debugId": "24C7AB7D5BA15E9864756E2164756E21",
8
+ "debugId": "5474F34EDDA8C4B864756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,4 +1,4 @@
1
1
  function n(i){return function(e,t){t.addInitializer(function(){if(this[t.name]=this[t.name].bind(this),Array.isArray(i))for(let a of i)this.registerUpdateCallback(a,this[t.name]);else if(typeof i==="string")this.registerUpdateCallback(i,this[t.name])})}}
2
- export{n as Ea};
2
+ export{n as oa};
3
3
 
4
- //# debugId=27FD3BFA6064B80A64756E2164756E21
4
+ //# debugId=ACB1089A920794A264756E2164756E21
@@ -5,6 +5,6 @@
5
5
  "import type { RadiantElement } from '../../core/radiant-element';\nimport type { Method } from '../../types';\n\nexport function onUpdated(keyOrKeys: string | string[]) {\n\treturn function <T extends Method>(_: T, context: ClassMethodDecoratorContext): void {\n\t\tcontext.addInitializer(function (this: any) {\n\t\t\tthis[context.name] = this[context.name].bind(this);\n\t\t\tif (Array.isArray(keyOrKeys)) {\n\t\t\t\tfor (const key of keyOrKeys) {\n\t\t\t\t\t(this as RadiantElement).registerUpdateCallback(key, this[context.name]);\n\t\t\t\t}\n\t\t\t} else if (typeof keyOrKeys === 'string') {\n\t\t\t\t(this as RadiantElement).registerUpdateCallback(keyOrKeys, this[context.name]);\n\t\t\t}\n\t\t});\n\t};\n}\n"
6
6
  ],
7
7
  "mappings": "AAGO,SAAS,CAAS,CAAC,EAA8B,CACvD,OAAO,QAA2B,CAAC,EAAM,EAA4C,CACpF,EAAQ,eAAe,QAAS,EAAY,CAE3C,GADA,KAAK,EAAQ,MAAQ,KAAK,EAAQ,MAAM,KAAK,IAAI,EAC7C,MAAM,QAAQ,CAAS,EAC1B,QAAW,KAAO,EAChB,KAAwB,uBAAuB,EAAK,KAAK,EAAQ,KAAK,EAElE,QAAI,OAAO,IAAc,SAC9B,KAAwB,uBAAuB,EAAW,KAAK,EAAQ,KAAK,EAE9E",
8
- "debugId": "27FD3BFA6064B80A64756E2164756E21",
8
+ "debugId": "ACB1089A920794A264756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,4 +1,4 @@
1
1
  function H(j,A={}){let B=null,D,E=()=>{if(A.all)return typeof j.getSlotElements==="function"?j.getSlotElements(A.name):[];return typeof j.getSlotElement==="function"?j.getSlotElement(A.name):null};return{get value(){if(A.cache===!1)return E();let G=j.slotProjectionVersion??0;if(D!==G)B=E(),D=G;return B}}}
2
- export{H as rb};
2
+ export{H as Ab};
3
3
 
4
- //# debugId=F198B669EF7F9C8F64756E2164756E21
4
+ //# debugId=ACFD968428E9366D64756E2164756E21
@@ -5,6 +5,6 @@
5
5
  "export type QuerySlotConfig = {\n\tall?: boolean;\n\tcache?: boolean;\n\tname?: string;\n};\n\ntype SlotQueryHost = HTMLElement & {\n\tgetSlotElement<T extends Element = Element>(name?: string): T | null;\n\tgetSlotElements<T extends Element = Element>(name?: string): T[];\n};\n\ntype QuerySlotResult<T extends Element | Element[]> = {\n\tget value(): T | null;\n};\n\n/**\n * Creates a lazy slot query accessor bound to a host element.\n * Functional equivalent of the `@querySlot` decorator for vanilla JS usage.\n * @param host The host element to query slots within.\n * @param options {@link QuerySlotConfig} The slot query configuration.\n */\nexport function createQuerySlot<T extends Element | Element[] = Element>(\n\thost: SlotQueryHost,\n\toptions: QuerySlotConfig = {},\n): QuerySlotResult<T> {\n\tlet cached: T | null = null;\n\tlet cachedVersion: number | undefined;\n\n\tconst executeQuery = (): T | null => {\n\t\tif (options.all) {\n\t\t\treturn (typeof host.getSlotElements === 'function' ? host.getSlotElements(options.name) : []) as T;\n\t\t}\n\t\treturn (typeof host.getSlotElement === 'function' ? host.getSlotElement(options.name) : null) as T | null;\n\t};\n\n\treturn {\n\t\tget value(): T | null {\n\t\t\tif (options.cache === false) {\n\t\t\t\treturn executeQuery();\n\t\t\t}\n\n\t\t\tconst currentVersion = (host as unknown as Record<string, number | undefined>).slotProjectionVersion ?? 0;\n\n\t\t\tif (cachedVersion !== currentVersion) {\n\t\t\t\tcached = executeQuery();\n\t\t\t\tcachedVersion = currentVersion;\n\t\t\t}\n\n\t\t\treturn cached;\n\t\t},\n\t};\n}\n"
6
6
  ],
7
7
  "mappings": "AAqBO,SAAS,CAAwD,CACvE,EACA,EAA2B,CAAC,EACP,CACrB,IAAI,EAAmB,KACnB,EAEE,EAAe,IAAgB,CACpC,GAAI,EAAQ,IACX,OAAQ,OAAO,EAAK,kBAAoB,WAAa,EAAK,gBAAgB,EAAQ,IAAI,EAAI,CAAC,EAE5F,OAAQ,OAAO,EAAK,iBAAmB,WAAa,EAAK,eAAe,EAAQ,IAAI,EAAI,MAGzF,MAAO,IACF,MAAK,EAAa,CACrB,GAAI,EAAQ,QAAU,GACrB,OAAO,EAAa,EAGrB,IAAM,EAAkB,EAAuD,uBAAyB,EAExG,GAAI,IAAkB,EACrB,EAAS,EAAa,EACtB,EAAgB,EAGjB,OAAO,EAET",
8
- "debugId": "F198B669EF7F9C8F64756E2164756E21",
8
+ "debugId": "ACFD968428E9366D64756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -0,0 +1,4 @@
1
+ import{sb as k,tb as q}from"./chunk-hpzgnxgq.js";function A(j){return k({type:"context",...j})}function B(j){return q(j)}
2
+ export{A as W,B as X};
3
+
4
+ //# debugId=DC63A933A8AED8BC64756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/context/hydration-script.ts"],
4
+ "sourcesContent": [
5
+ "import { createHydrationScriptTag, escapeHydrationJson } from '../core/hydration-codec';\n\n/**\n * Creates the raw `<script type=\"application/json\">` tag used to hydrate a\n * serialized context provider.\n */\nexport function createContextHydrationScriptTag(options: { hydrationKey?: string; serializedValue: string }): string {\n\treturn createHydrationScriptTag({ type: 'context', ...options });\n}\n\n/**\n * Escapes serialized JSON so it remains safe when embedded inside an HTML\n * script tag.\n */\nexport function escapeContextHydrationJson(value: string): string {\n\treturn escapeHydrationJson(value);\n}\n"
6
+ ],
7
+ "mappings": "iDAMO,SAAS,CAA+B,CAAC,EAAqE,CACpH,OAAO,EAAyB,CAAE,KAAM,aAAc,CAAQ,CAAC,EAOzD,SAAS,CAA0B,CAAC,EAAuB,CACjE,OAAO,EAAoB,CAAK",
8
+ "debugId": "DC63A933A8AED8BC64756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ import{qa as B}from"./chunk-25zjh0kg.js";import{ra as F}from"./chunk-mp2vtrkg.js";function I(j,q){return function(z,A){if(typeof A<"u")return F(j,q)(z,A);return B(j,q)(z)}}
2
+ export{I as pa};
3
+
4
+ //# debugId=7409CEC560D37CFF64756E2164756E21
@@ -5,6 +5,6 @@
5
5
  "import type {\n\tLegacyClassDecoratorArgs,\n\tStandardClassDecoratorArgs,\n\tStandardOrLegacyClassDecoratorArgs,\n} from '../types';\nimport { customElement as legacyCustomElement } from './legacy/custom-element';\nimport { customElement as standardCustomElement } from './standard/custom-element';\n\n/**\n * Registers a web component with the given name on the global `window.customElements` registry.\n * @param name selector name.\n * @param options {@link ElementDefinitionOptions}\n */\nexport function customElement(name: string, options?: ElementDefinitionOptions) {\n\treturn function (\n\t\tprotoOrTarget: StandardOrLegacyClassDecoratorArgs['protoOrTarget'],\n\t\tnameOrContext?: StandardOrLegacyClassDecoratorArgs['nameOrContext'],\n\t): any {\n\t\tif (typeof nameOrContext !== 'undefined') {\n\t\t\treturn standardCustomElement(name, options)(\n\t\t\t\tprotoOrTarget as StandardClassDecoratorArgs['protoOrTarget'],\n\t\t\t\tnameOrContext as StandardClassDecoratorArgs['nameOrContext'],\n\t\t\t);\n\t\t}\n\t\treturn legacyCustomElement(name, options)(protoOrTarget as LegacyClassDecoratorArgs['protoOrTarget']);\n\t};\n}\n"
6
6
  ],
7
7
  "mappings": "wFAaO,GAAS,CAAa,CAAC,EAAc,EAAoC,CAC/E,OAAO,QAAS,CACf,EACA,EACM,CACN,GAAI,OAAO,EAAkB,IAC5B,OAAO,EAAsB,EAAM,CAAO,EACzC,EACA,CACD,EAED,OAAO,EAAoB,EAAM,CAAO,EAAE,CAA0D",
8
- "debugId": "5E9D1A8A31F3D3E464756E2164756E21",
8
+ "debugId": "7409CEC560D37CFF64756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,4 +1,4 @@
1
1
  var D=Symbol.for("@ecopages/radiant.legacy-instance-initializers");function J(B,j){let q=B[D];if(Array.isArray(q)){q.push(j);return}Object.defineProperty(B,D,{value:[j],configurable:!0})}function K(B){let j=[],k=Object.getPrototypeOf(B);while(k&&k!==Object.prototype)j.push(k),k=Object.getPrototypeOf(k);for(let q=j.length-1;q>=0;q-=1){let F=j[q][D];if(!Array.isArray(F))continue;for(let H of F)H(B)}}
2
- export{J as La,K as Ma};
2
+ export{J as Ma,K as Na};
3
3
 
4
- //# debugId=3E1487D5388368CE64756E2164756E21
4
+ //# debugId=482D7DF0E4F53FE864756E2164756E21
@@ -5,6 +5,6 @@
5
5
  "import type { RadiantElement } from '../../core/radiant-element';\n\ntype LegacyInstanceInitializer = (instance: RadiantElement) => void;\n\nconst LEGACY_INSTANCE_INITIALIZERS = Symbol.for('@ecopages/radiant.legacy-instance-initializers');\n\n/**\n * Registers per-instance initialization work for a legacy decorator.\n *\n * Legacy decorators execute against the prototype, so any initialization that\n * needs the concrete element instance must be deferred until construction time.\n */\nexport function registerLegacyInstanceInitializer(proto: object, initializer: LegacyInstanceInitializer): void {\n\tconst target = proto as Record<PropertyKey, unknown>;\n\tconst ownInitializers = target[LEGACY_INSTANCE_INITIALIZERS];\n\n\tif (Array.isArray(ownInitializers)) {\n\t\townInitializers.push(initializer);\n\t\treturn;\n\t}\n\n\tObject.defineProperty(proto, LEGACY_INSTANCE_INITIALIZERS, {\n\t\tvalue: [initializer],\n\t\tconfigurable: true,\n\t});\n}\n\n/**\n * Runs all legacy decorator initializers for a newly constructed element.\n *\n * Initializers are collected from the prototype chain and executed from base to\n * derived class so inherited setup remains stable.\n */\nexport function runLegacyInstanceInitializers(instance: RadiantElement): void {\n\tconst prototypes: object[] = [];\n\tlet currentPrototype = Object.getPrototypeOf(instance);\n\n\twhile (currentPrototype && currentPrototype !== Object.prototype) {\n\t\tprototypes.push(currentPrototype);\n\t\tcurrentPrototype = Object.getPrototypeOf(currentPrototype);\n\t}\n\n\tfor (let index = prototypes.length - 1; index >= 0; index -= 1) {\n\t\tconst initializers = (prototypes[index] as Record<PropertyKey, unknown>)[LEGACY_INSTANCE_INITIALIZERS] as\n\t\t\t| LegacyInstanceInitializer[]\n\t\t\t| undefined;\n\n\t\tif (!Array.isArray(initializers)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tfor (const initializer of initializers) {\n\t\t\tinitializer(instance);\n\t\t}\n\t}\n}\n"
6
6
  ],
7
7
  "mappings": "AAIA,IAAM,EAA+B,OAAO,IAAI,gDAAgD,EAQzF,SAAS,CAAiC,CAAC,EAAe,EAA8C,CAE9G,IAAM,EADS,EACgB,GAE/B,GAAI,MAAM,QAAQ,CAAe,EAAG,CACnC,EAAgB,KAAK,CAAW,EAChC,OAGD,OAAO,eAAe,EAAO,EAA8B,CAC1D,MAAO,CAAC,CAAW,EACnB,aAAc,EACf,CAAC,EASK,SAAS,CAA6B,CAAC,EAAgC,CAC7E,IAAM,EAAuB,CAAC,EAC1B,EAAmB,OAAO,eAAe,CAAQ,EAErD,MAAO,GAAoB,IAAqB,OAAO,UACtD,EAAW,KAAK,CAAgB,EAChC,EAAmB,OAAO,eAAe,CAAgB,EAG1D,QAAS,EAAQ,EAAW,OAAS,EAAG,GAAS,EAAG,GAAS,EAAG,CAC/D,IAAM,EAAgB,EAAW,GAAwC,GAIzE,GAAI,CAAC,MAAM,QAAQ,CAAY,EAC9B,SAGD,QAAW,KAAe,EACzB,EAAY,CAAQ",
8
- "debugId": "3E1487D5388368CE64756E2164756E21",
8
+ "debugId": "482D7DF0E4F53FE864756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -0,0 +1,4 @@
1
+ import{sb as j,tb as k}from"./chunk-hpzgnxgq.js";function w(b){return j({type:"signal",...b})}function x(b){return k(b)}
2
+ export{w as Ha,x as Ia};
3
+
4
+ //# debugId=72C259D774D1692864756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/signals/hydration-script.ts"],
4
+ "sourcesContent": [
5
+ "import { createHydrationScriptTag, escapeHydrationJson } from '../core/hydration-codec';\n\n/** Creates the raw `<script type=\"application/json\">` tag used to hydrate a signal field. */\nexport function createSignalHydrationScriptTag(options: { hydrationKey?: string; serializedValue: string }): string {\n\treturn createHydrationScriptTag({ type: 'signal', ...options });\n}\n\n/** Escapes serialized JSON so it remains safe inside an HTML script tag. */\nexport function escapeSignalHydrationJson(value: string): string {\n\treturn escapeHydrationJson(value);\n}\n"
6
+ ],
7
+ "mappings": "iDAGO,SAAS,CAA8B,CAAC,EAAqE,CACnH,OAAO,EAAyB,CAAE,KAAM,YAAa,CAAQ,CAAC,EAIxD,SAAS,CAAyB,CAAC,EAAuB,CAChE,OAAO,EAAoB,CAAK",
8
+ "debugId": "72C259D774D1692864756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ var a=Symbol.for("@ecopages/radiant.component-ssr-runtime");function c(){return globalThis[a]}function d(b){globalThis[a]=b}
2
+ export{c as Ta,d as Ua};
3
+
4
+ //# debugId=9846209F4F44FF0E64756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/core/radiant-component-ssr-registry.ts"],
4
+ "sourcesContent": [
5
+ "import type { JsxRenderable } from '@ecopages/jsx';\nimport type { RenderToStringOptions } from '@ecopages/jsx/server';\n\n/**\n * Optional SSR hooks exposed by `RadiantComponent` instances to the shared\n * server runtime.\n *\n * The bridge lets the runtime detect whether a component is still using the\n * inherited host SSR implementation or has taken ownership of host rendering\n * through explicit overrides.\n */\nexport type RadiantComponentRenderBridge = {\n\trenderHost?: () => JsxRenderable;\n\trenderHostToString?: (options?: RenderToStringOptions) => string;\n};\n\n/**\n * Runtime shape required by the shared Radiant SSR helpers.\n *\n * This is intentionally narrower than `RadiantComponent` itself so the server\n * runtime can stay decoupled from the full client base-class implementation.\n */\nexport type RadiantComponentSsrCapable = HTMLElement & {\n\tresolveSsrRenderBridge?: () => RadiantComponentRenderBridge;\n\tgetHostSsrAttributes?: () => Record<string, string>;\n\trenderToString(options?: RenderToStringOptions): string;\n\trenderHost?(): JsxRenderable;\n\trenderHostToString(options?: RenderToStringOptions): string;\n};\n\n/**\n * Shared SSR runtime contract registered on `globalThis`.\n *\n * Server entrypoints install one implementation that both direct component SSR\n * and nested JSX custom-element SSR can reuse without importing client-only\n * internals into every call site.\n */\nexport type RadiantComponentSsrRuntime = {\n\tgetHostAttributes(component: RadiantComponentSsrCapable): Record<string, string>;\n\trenderHost(component: RadiantComponentSsrCapable): JsxRenderable;\n\trenderHostToString(component: RadiantComponentSsrCapable, options?: RenderToStringOptions): string;\n\tresolveRenderBridge(component: RadiantComponentSsrCapable): RadiantComponentRenderBridge | undefined;\n\trenderView(component: RadiantComponentSsrCapable, options?: RenderToStringOptions): string;\n};\n\nconst RADIANT_COMPONENT_SSR_RUNTIME_SYMBOL = Symbol.for('@ecopages/radiant.component-ssr-runtime');\n\ntype GlobalSsrRuntimeState = typeof globalThis & {\n\t[RADIANT_COMPONENT_SSR_RUNTIME_SYMBOL]?: RadiantComponentSsrRuntime;\n};\n\n/**\n * Reads the currently registered Radiant SSR runtime from `globalThis`.\n *\n * Returns `undefined` when no server entrypoint has installed the runtime yet.\n */\nexport function getRadiantComponentSsrRuntime(): RadiantComponentSsrRuntime | undefined {\n\treturn (globalThis as GlobalSsrRuntimeState)[RADIANT_COMPONENT_SSR_RUNTIME_SYMBOL];\n}\n\n/**\n * Registers the shared Radiant SSR runtime on `globalThis`.\n *\n * The latest registration wins, which keeps server adapters free to install\n * the runtime eagerly from their own explicit entrypoint.\n */\nexport function registerRadiantComponentSsrRuntime(runtime: RadiantComponentSsrRuntime): void {\n\t(globalThis as GlobalSsrRuntimeState)[RADIANT_COMPONENT_SSR_RUNTIME_SYMBOL] = runtime;\n}\n"
6
+ ],
7
+ "mappings": "AA6CA,IAAM,EAAuC,OAAO,IAAI,yCAAyC,EAW1F,SAAS,CAA6B,EAA2C,CACvF,OAAQ,WAAqC,GASvC,SAAS,CAAkC,CAAC,EAA2C,CAC5F,WAAqC,GAAwC",
8
+ "debugId": "9846209F4F44FF0E64756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ import{wa as A}from"./chunk-knqsm6v3.js";import{Aa as E}from"./chunk-v92hp9g0.js";import{Oa as z}from"./chunk-q9z6tnzw.js";function K(k={}){return function(F,G){return z(E(k),A(k),F,G)}}
2
+ export{K as va};
3
+
4
+ //# debugId=0E72FB78441CB14164756E2164756E21
@@ -4,7 +4,7 @@
4
4
  "sourcesContent": [
5
5
  "import type { StandardOrLegacyFieldDecoratorArgs } from '../types';\nimport type { QuerySlotConfig } from '../helpers/create-query-slot';\nimport { querySlot as legacyQuerySlot } from './legacy/query-slot';\nimport { querySlot as standardQuerySlot } from './standard/query-slot';\nimport { fieldDecoratorBridge } from './bridge';\n\nexport type { QuerySlotConfig };\n\n/**\n * Queries projected light-DOM content assigned to a RadiantComponent slot.\n *\n * The decorator returns assigned elements from the default slot when `name` is\n * omitted, or from the named slot when `name` is provided. Results are cached\n * by default and automatically invalidated when slot projection changes.\n *\n * @param options Slot query options.\n */\nexport function querySlot<T extends Element | Element[]>(options: QuerySlotConfig = {}) {\n\treturn function (\n\t\tprotoOrTarget: StandardOrLegacyFieldDecoratorArgs['protoOrTarget'],\n\t\tnameOrContext: StandardOrLegacyFieldDecoratorArgs['nameOrContext'],\n\t): any {\n\t\treturn fieldDecoratorBridge(\n\t\t\tstandardQuerySlot(options),\n\t\t\tlegacyQuerySlot<T>(options),\n\t\t\tprotoOrTarget,\n\t\t\tnameOrContext,\n\t\t);\n\t};\n}\n"
6
6
  ],
7
- "mappings": "sIAiBO,GAAS,LAAwC,CAAC,EAA2B,CAAC,EAAG,CACvF,OAAO,QAAS,CACf,EACA,EACM,CACN,OAAO,EACN,EAAkB,CAAO,EACzB,EAAmB,CAAO,EAC1B,EACA,CACD",
8
- "debugId": "7E28710D2CFCA22564756E2164756E21",
7
+ "mappings": "uIAiBO,GAAS,LAAwC,CAAC,EAA2B,CAAC,EAAG,CACvF,OAAO,QAAS,CACf,EACA,EACM,CACN,OAAO,EACN,EAAkB,CAAO,EACzB,EAAmB,CAAO,EAC1B,EACA,CACD",
8
+ "debugId": "0E72FB78441CB14164756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,4 +1,4 @@
1
- import{D as F,F as G}from"./chunk-1w1dm68j.js";import{bb as D}from"./chunk-4cc2syf5.js";function K(f,j,B,w={}){let z=D(j);if(!z)return!1;if(B(z),f.connectedContextCallback(j),w.emitMounted)f.dispatchEvent(new CustomEvent("context-mounted",{detail:z}));return!0}function L(f,j,B,w={}){f.dispatchEvent(new F(j,(z)=>{if(B(z),f.connectedContextCallback(j),w.emitMounted)f.dispatchEvent(new CustomEvent("context-mounted",{detail:z}))}))}function M(f,j,B){let w=D(f);if(!w)return!1;let z=w.getContext();return j(B?B(z):z),!0}function N(f,j,B,w){f.dispatchEvent(new G(j,B,w.select,w.subscribe))}
2
- export{K as y,L as z,M as A,N as B};
1
+ import{T as F,V as G}from"./chunk-kmebacvv.js";import{$a as D}from"./chunk-t8xtvgyg.js";function K(f,j,B,w={}){let z=D(j);if(!z)return!1;if(B(z),f.connectedContextCallback(j),w.emitMounted)f.dispatchEvent(new CustomEvent("context-mounted",{detail:z}));return!0}function L(f,j,B,w={}){f.dispatchEvent(new F(j,(z)=>{if(B(z),f.connectedContextCallback(j),w.emitMounted)f.dispatchEvent(new CustomEvent("context-mounted",{detail:z}))}))}function M(f,j,B){let w=D(f);if(!w)return!1;let z=w.getContext();return j(B?B(z):z),!0}function N(f,j,B,w){f.dispatchEvent(new G(j,B,w.select,w.subscribe))}
2
+ export{K as L,L as M,M as N,N as O};
3
3
 
4
- //# debugId=1085D4D6940B573964756E2164756E21
4
+ //# debugId=C4FE9659AFA3430064756E2164756E21
@@ -5,6 +5,6 @@
5
5
  "import type { RadiantElement } from '../core/radiant-element';\nimport { resolveAmbientSsrContextProvider } from './context-ssr-bridge';\nimport { ContextEventsTypes, ContextRequestEvent, ContextSubscriptionRequestEvent } from './events';\nimport type { ContextType, UnknownContext } from './types';\n\ntype ConsumedContextAssignment = (provider: unknown) => void;\n\n/**\n * Resolves a consumed context from the active SSR provider stack when one is available.\n *\n * This keeps SSR-specific lookup outside decorator implementations while preserving\n * the same consumer initialization contract for both standard and legacy decorators.\n *\n * @returns `true` when the context was resolved synchronously from SSR state.\n */\nexport function initializeConsumedContext(\n\thost: RadiantElement,\n\tcontext: UnknownContext,\n\tassign: ConsumedContextAssignment,\n\toptions: { emitMounted?: boolean } = {},\n): boolean {\n\tconst provider = resolveAmbientSsrContextProvider(context);\n\n\tif (!provider) {\n\t\treturn false;\n\t}\n\n\tassign(provider);\n\thost.connectedContextCallback(context);\n\n\tif (options.emitMounted) {\n\t\thost.dispatchEvent(new CustomEvent(ContextEventsTypes.MOUNTED, { detail: provider }));\n\t}\n\n\treturn true;\n}\n\n/**\n * Requests a context provider through the DOM event channel when SSR state is not active.\n */\nexport function requestConsumedContext(\n\thost: RadiantElement,\n\tcontext: UnknownContext,\n\tassign: ConsumedContextAssignment,\n\toptions: { emitMounted?: boolean } = {},\n): void {\n\thost.dispatchEvent(\n\t\tnew ContextRequestEvent(context, (provider) => {\n\t\t\tassign(provider);\n\t\t\thost.connectedContextCallback(context);\n\n\t\t\tif (options.emitMounted) {\n\t\t\t\thost.dispatchEvent(new CustomEvent(ContextEventsTypes.MOUNTED, { detail: provider }));\n\t\t\t}\n\t\t}),\n\t);\n}\n\n/**\n * Resolves a selected context value from the active SSR provider stack when available.\n *\n * @returns `true` when the selection callback was satisfied synchronously from SSR state.\n */\nexport function initializeContextSelection<TContext extends UnknownContext>(\n\tcontext: TContext,\n\tcallback: (value: unknown) => void,\n\tselect?: (context: ContextType<TContext>) => unknown,\n): boolean {\n\tconst provider = resolveAmbientSsrContextProvider(context);\n\n\tif (!provider) {\n\t\treturn false;\n\t}\n\n\tconst resolvedContext = provider.getContext() as ContextType<TContext>;\n\tcallback(select ? select(resolvedContext) : resolvedContext);\n\treturn true;\n}\n\n/**\n * Requests a selected context value through the DOM event channel.\n */\nexport function requestContextSelection<TContext extends UnknownContext>(\n\thost: RadiantElement,\n\tcontext: TContext,\n\tcallback: (value: unknown) => void,\n\toptions: {\n\t\tselect?: (context: ContextType<TContext>) => unknown;\n\t\tsubscribe?: boolean;\n\t},\n): void {\n\thost.dispatchEvent(new ContextSubscriptionRequestEvent(context, callback, options.select, options.subscribe));\n}\n"
6
6
  ],
7
7
  "mappings": "8FAeO,GAAS,CAAyB,CACxC,EACA,EACA,EACA,EAAqC,CAAC,EAC5B,CACV,IAAM,EAAW,EAAiC,CAAO,EAEzD,GAAI,CAAC,EACJ,MAAO,GAMR,GAHA,EAAO,CAAQ,EACf,EAAK,yBAAyB,CAAO,EAEjC,EAAQ,YACX,EAAK,cAAc,IAAI,8BAAwC,CAAE,OAAQ,CAAS,CAAC,CAAC,EAGrF,MAAO,GAMD,SAAS,CAAsB,CACrC,EACA,EACA,EACA,EAAqC,CAAC,EAC/B,CACP,EAAK,cACJ,IAAI,EAAoB,EAAS,CAAC,IAAa,CAI9C,GAHA,EAAO,CAAQ,EACf,EAAK,yBAAyB,CAAO,EAEjC,EAAQ,YACX,EAAK,cAAc,IAAI,8BAAwC,CAAE,OAAQ,CAAS,CAAC,CAAC,EAErF,CACF,EAQM,SAAS,CAA2D,CAC1E,EACA,EACA,EACU,CACV,IAAM,EAAW,EAAiC,CAAO,EAEzD,GAAI,CAAC,EACJ,MAAO,GAGR,IAAM,EAAkB,EAAS,WAAW,EAE5C,OADA,EAAS,EAAS,EAAO,CAAe,EAAI,CAAe,EACpD,GAMD,SAAS,CAAwD,CACvE,EACA,EACA,EACA,EAIO,CACP,EAAK,cAAc,IAAI,EAAgC,EAAS,EAAU,EAAQ,OAAQ,EAAQ,SAAS,CAAC",
8
- "debugId": "1085D4D6940B573964756E2164756E21",
8
+ "debugId": "C4FE9659AFA3430064756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,4 +1,4 @@
1
1
  var F=Symbol(),H=Symbol();function J(q,j){let w=q[F];if(Array.isArray(w)){w.push(j);return}Object.defineProperty(q,F,{value:[j],configurable:!0})}function M(q){let j=q,D=j[F];if(!Array.isArray(D))return;j[H]=!0;try{for(let w of D)w()}finally{delete j[H]}}
2
- export{H as _,J as $,M as aa};
2
+ export{H as xa,J as ya,M as za};
3
3
 
4
- //# debugId=1DDCC51925B4B7D964756E2164756E21
4
+ //# debugId=C5C01CE67512BC4264756E2164756E21
@@ -5,6 +5,6 @@
5
5
  "type SsrPreparationCallback = () => void;\n\nconst SSR_PREPARATION_CALLBACKS = Symbol();\nexport const SSR_PREPARATION_RUNNING = Symbol();\n\n/**\n * Registers instance-local SSR preparation work that should run immediately\n * before a Radiant host serializes its first server render.\n *\n * Decorators use this to defer SSR-only setup until after class fields,\n * reactive props, and authored host content have all been applied.\n */\nexport function registerSsrPreparationCallback(host: object, callback: SsrPreparationCallback): void {\n\tconst target = host as Record<PropertyKey, unknown>;\n\tconst existingCallbacks = target[SSR_PREPARATION_CALLBACKS];\n\n\tif (Array.isArray(existingCallbacks)) {\n\t\texistingCallbacks.push(callback);\n\t\treturn;\n\t}\n\n\tObject.defineProperty(host, SSR_PREPARATION_CALLBACKS, {\n\t\tvalue: [callback],\n\t\tconfigurable: true,\n\t});\n}\n\n/**\n * Runs all registered SSR preparation callbacks for the provided host.\n *\n * The callbacks are intentionally retained so repeated SSR serializations stay\n * deterministic after later host mutations.\n */\nexport function runSsrPreparationCallbacks(host: object): void {\n\tconst target = host as Record<PropertyKey, unknown>;\n\tconst callbacks = target[SSR_PREPARATION_CALLBACKS];\n\n\tif (!Array.isArray(callbacks)) {\n\t\treturn;\n\t}\n\n\ttarget[SSR_PREPARATION_RUNNING] = true;\n\n\ttry {\n\t\tfor (const callback of callbacks as SsrPreparationCallback[]) {\n\t\t\tcallback();\n\t\t}\n\t} finally {\n\t\tdelete target[SSR_PREPARATION_RUNNING];\n\t}\n}\n"
6
6
  ],
7
7
  "mappings": "AAEA,IAAM,EAA4B,OAAO,EAC5B,EAA0B,OAAO,EASvC,SAAS,CAA8B,CAAC,EAAc,EAAwC,CAEpG,IAAM,EADS,EACkB,GAEjC,GAAI,MAAM,QAAQ,CAAiB,EAAG,CACrC,EAAkB,KAAK,CAAQ,EAC/B,OAGD,OAAO,eAAe,EAAM,EAA2B,CACtD,MAAO,CAAC,CAAQ,EAChB,aAAc,EACf,CAAC,EASK,SAAS,CAA0B,CAAC,EAAoB,CAC9D,IAAM,EAAS,EACT,EAAY,EAAO,GAEzB,GAAI,CAAC,MAAM,QAAQ,CAAS,EAC3B,OAGD,EAAO,GAA2B,GAElC,GAAI,CACH,QAAW,KAAY,EACtB,EAAS,SAET,CACD,OAAO,EAAO",
8
- "debugId": "1DDCC51925B4B7D964756E2164756E21",
8
+ "debugId": "C5C01CE67512BC4264756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,4 +1,4 @@
1
- import{u as y,w as A}from"./chunk-vpfm9yw8.js";function G(f){return(D,j)=>{let k=String(j.name),q=(b,c)=>{b[k]=c},w=(b,c={})=>{if(b[k])return!0;return A(b,f,(B)=>{q(b,B)},c)};j.addInitializer(function(){if(y(this,f,(b)=>{q(this,b)},{emitMounted:!0}))return;this.registerConnectedCallback(()=>{if(w(this,{emitMounted:!0}))return;queueMicrotask(()=>{w(this,{emitMounted:!0})})})})}}
2
- export{G as l};
1
+ import{H as y,J as A}from"./chunk-p8k4g99a.js";function G(f){return(D,j)=>{let k=String(j.name),q=(b,c)=>{b[k]=c},w=(b,c={})=>{if(b[k])return!0;return A(b,f,(B)=>{q(b,B)},c)};j.addInitializer(function(){if(y(this,f,(b)=>{q(this,b)},{emitMounted:!0}))return;this.registerConnectedCallback(()=>{if(w(this,{emitMounted:!0}))return;queueMicrotask(()=>{w(this,{emitMounted:!0})})})})}}
2
+ export{G as x};
3
3
 
4
- //# debugId=F3A04E8722B07CD364756E2164756E21
4
+ //# debugId=DE6BB729795F345764756E2164756E21
@@ -5,6 +5,6 @@
5
5
  "import type { RadiantElement } from '../../../core/radiant-element';\nimport { bootstrapSsrConsumedContext, connectConsumedContext } from '../../context-consumer-bootstrap';\nimport type { UnknownContext } from '../../types';\n\nexport function consumeContext(consumedContext: UnknownContext) {\n\treturn <T extends RadiantElement, V>(_: undefined, context: ClassFieldDecoratorContext<T, V>) => {\n\t\tconst contextName = String(context.name);\n\t\tconst assignContextProvider = (host: T, provider: unknown) => {\n\t\t\t(host as any)[contextName] = provider;\n\t\t};\n\t\tconst initializeConsumedContextForHost = (host: T, options: { emitMounted?: boolean } = {}) => {\n\t\t\tif ((host as any)[contextName]) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn connectConsumedContext(\n\t\t\t\thost,\n\t\t\t\tconsumedContext,\n\t\t\t\t(provider) => {\n\t\t\t\t\tassignContextProvider(host, provider);\n\t\t\t\t},\n\t\t\t\toptions,\n\t\t\t);\n\t\t};\n\n\t\tcontext.addInitializer(function (this: T) {\n\t\t\tif (\n\t\t\t\tbootstrapSsrConsumedContext(\n\t\t\t\t\tthis,\n\t\t\t\t\tconsumedContext,\n\t\t\t\t\t(provider) => {\n\t\t\t\t\t\tassignContextProvider(this, provider);\n\t\t\t\t\t},\n\t\t\t\t\t{ emitMounted: true },\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.registerConnectedCallback(() => {\n\t\t\t\tif (initializeConsumedContextForHost(this, { emitMounted: true })) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tinitializeConsumedContextForHost(this, { emitMounted: true });\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t};\n}\n"
6
6
  ],
7
7
  "mappings": "+CAIO,SAAS,CAAc,CAAC,EAAiC,CAC/D,MAAO,CAA8B,EAAc,IAA8C,CAChG,IAAM,EAAc,OAAO,EAAQ,IAAI,EACjC,EAAwB,CAAC,EAAS,IAAsB,CAC5D,EAAa,GAAe,GAExB,EAAmC,CAAC,EAAS,EAAqC,CAAC,IAAM,CAC9F,GAAK,EAAa,GACjB,MAAO,GAGR,OAAO,EACN,EACA,EACA,CAAC,IAAa,CACb,EAAsB,EAAM,CAAQ,GAErC,CACD,GAGD,EAAQ,eAAe,QAAS,EAAU,CACzC,GACC,EACC,KACA,EACA,CAAC,IAAa,CACb,EAAsB,KAAM,CAAQ,GAErC,CAAE,YAAa,EAAK,CACrB,EAEA,OAGD,KAAK,0BAA0B,IAAM,CACpC,GAAI,EAAiC,KAAM,CAAE,YAAa,EAAK,CAAC,EAC/D,OAGD,eAAe,IAAM,CACpB,EAAiC,KAAM,CAAE,YAAa,EAAK,CAAC,EAC5D,EACD,EACD",
8
- "debugId": "F3A04E8722B07CD364756E2164756E21",
8
+ "debugId": "DE6BB729795F345764756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,4 +1,4 @@
1
- import{t as A}from"./chunk-5td6v9k3.js";import{v as w,x as z}from"./chunk-vpfm9yw8.js";function L(B){let{context:h,select:j,subscribe:E=!0}=B;return function(I,k){let F=String(k.name);return k.addInitializer(function(){let g=A(this,(G)=>{let H=this;H[F]=G},!0);if(w(this,h,g,j))return;let q=()=>{z(this,h,g,{select:j,subscribe:E})};this.registerConnectedCallback(()=>{q()}),queueMicrotask(q)}),function(g){return g}}}
2
- export{L as m};
1
+ import{G as A}from"./chunk-5bkat72n.js";import{I as w,K as z}from"./chunk-p8k4g99a.js";function L(B){let{context:h,select:j,subscribe:E=!0}=B;return function(I,k){let F=String(k.name);return k.addInitializer(function(){let g=A(this,(G)=>{let H=this;H[F]=G},!0);if(w(this,h,g,j))return;let q=()=>{z(this,h,g,{select:j,subscribe:E})};this.registerConnectedCallback(()=>{q()}),queueMicrotask(q)}),function(g){return g}}}
2
+ export{L as D};
3
3
 
4
- //# debugId=80F3FE5E70AD98A264756E2164756E21
4
+ //# debugId=5CF0DC612E14240B64756E2164756E21
@@ -5,6 +5,6 @@
5
5
  "import type { RadiantElement } from '../../../core/radiant-element';\nimport { bootstrapSsrContextSelection, connectContextSelection } from '../../context-consumer-bootstrap';\nimport type { Context, ContextType } from '../../types';\nimport { createContextSelectionDelivery } from '../context-selection-delivery';\n\nexport type ContextSelectorFieldOptions<T extends Context<unknown, unknown>, Selected = ContextType<T>> = {\n\tcontext: T;\n\tselect?: (context: ContextType<T>) => Selected;\n\tsubscribe?: boolean;\n};\n\nexport function contextSelectorField<T extends Context<unknown, unknown>, Selected = ContextType<T>>(\n\toptions: ContextSelectorFieldOptions<T, Selected>,\n) {\n\tconst { context, select, subscribe = true } = options;\n\n\treturn function <Host extends RadiantElement>(\n\t\t_: undefined,\n\t\tfieldContext: ClassFieldDecoratorContext<Host, Selected>,\n\t) {\n\t\tconst propertyName = String(fieldContext.name);\n\n\t\tfieldContext.addInitializer(function (this: Host) {\n\t\t\tconst applyValue = createContextSelectionDelivery(\n\t\t\t\tthis,\n\t\t\t\t(value) => {\n\t\t\t\t\tconst record = this as unknown as Record<string, unknown>;\n\t\t\t\t\trecord[propertyName] = value;\n\t\t\t\t},\n\t\t\t\ttrue,\n\t\t\t);\n\n\t\t\tif (bootstrapSsrContextSelection(this, context, applyValue, select as any)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst connectSelection = () => {\n\t\t\t\tconnectContextSelection(this, context, applyValue, {\n\t\t\t\t\tselect: select as any,\n\t\t\t\t\tsubscribe,\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tthis.registerConnectedCallback(() => {\n\t\t\t\tconnectSelection();\n\t\t\t});\n\n\t\t\tqueueMicrotask(connectSelection);\n\t\t});\n\n\t\treturn function (this: Host, initialValue: Selected) {\n\t\t\treturn initialValue;\n\t\t};\n\t};\n}\n"
6
6
  ],
7
7
  "mappings": "6FAWO,GAAS,CAAoF,CACnG,EACC,CACD,IAAQ,UAAS,SAAQ,YAAY,IAAS,EAE9C,OAAO,QAAsC,CAC5C,EACA,EACC,CACD,IAAM,EAAe,OAAO,EAAa,IAAI,EA8B7C,OA5BA,EAAa,eAAe,QAAS,EAAa,CACjD,IAAM,EAAa,EAClB,KACA,CAAC,IAAU,CACV,IAAM,EAAS,KACf,EAAO,GAAgB,GAExB,EACD,EAEA,GAAI,EAA6B,KAAM,EAAS,EAAY,CAAa,EACxE,OAGD,IAAM,EAAmB,IAAM,CAC9B,EAAwB,KAAM,EAAS,EAAY,CAClD,OAAQ,EACR,WACD,CAAC,GAGF,KAAK,0BAA0B,IAAM,CACpC,EAAiB,EACjB,EAED,eAAe,CAAgB,EAC/B,EAEM,QAAS,CAAa,EAAwB,CACpD,OAAO",
8
- "debugId": "80F3FE5E70AD98A264756E2164756E21",
8
+ "debugId": "5CF0DC612E14240B64756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -0,0 +1,4 @@
1
+ import{C as w}from"./chunk-s09s5ayx.js";import{D as z}from"./chunk-g2z3mm6b.js";import{E as v}from"./chunk-x2k0ngpz.js";import{F as u}from"./chunk-kakpjgzf.js";function G(j){return function(k,b,q){if(typeof b==="object"){if(b.kind==="field")return z(j)(k,b);return v(j)(k,b)}if(q)return u(j)(k,b,q);return w(j)(k,b)}}
2
+ export{G as B};
3
+
4
+ //# debugId=18BD725C32637F8D64756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/context/decorators/context-selector.ts"],
4
+ "sourcesContent": [
5
+ "import type {\n\tLegacyFieldDecoratorArgs,\n\tLegacyMethodDecoratorArgs,\n\tMethod,\n\tStandardFieldDecoratorArgs,\n\tStandardMethodDecoratorArgs,\n} from '../../types';\nimport type { RadiantElement } from '../../core/radiant-element';\nimport type { Context, ContextType, UnknownContext } from '../types';\nimport type { OnContextUpdateOptions } from './on-context-update';\nimport { contextSelector as legacyContextSelectorMethod } from './legacy/context-selector';\nimport { contextSelector as standardContextSelectorMethod } from './standard/context-selector';\nimport { contextSelectorField as legacyContextSelectorField } from './legacy/context-selector-field';\nimport { contextSelectorField as standardContextSelectorField } from './standard/context-selector-field';\n\nexport type ContextSelectorOptions<T extends UnknownContext, Selected = ContextType<T>> = {\n\t/** Context token to resolve from ancestor providers. */\n\tcontext: T;\n\t/** Optional projection that narrows the resolved context before delivery. */\n\tselect?: (context: ContextType<T>) => Selected;\n\t/** Whether client-side event-channel subscriptions should stay active after the first value. */\n\tsubscribe?: boolean;\n};\n\ntype ContextUpdateMethod<Selected> = (value: Selected) => unknown;\n\ntype ContextSelectorDecorator<Selected> = {\n\t<Host extends RadiantElement>(\n\t\tprotoOrTarget: undefined,\n\t\tnameOrContext: ClassFieldDecoratorContext<Host, Selected>,\n\t): (this: Host, initialValue: Selected) => Selected;\n\t<Host extends RadiantElement, TMethod extends ContextUpdateMethod<Selected>>(\n\t\tprotoOrTarget: TMethod,\n\t\tnameOrContext: ClassMethodDecoratorContext<Host, TMethod>,\n\t): void;\n\t(protoOrTarget: RadiantElement, nameOrContext: string): void;\n\t(\n\t\tprotoOrTarget: RadiantElement,\n\t\tnameOrContext: string,\n\t\tdescriptor: TypedPropertyDescriptor<ContextUpdateMethod<Selected>>,\n\t): TypedPropertyDescriptor<ContextUpdateMethod<Selected>> | void;\n};\n\n/**\n * Subscribes a field or method to the current value, or a selected slice, of a context.\n *\n * **Field form (preferred):** The field holds the latest context value and is\n * updated whenever the provider changes. On `RadiantComponent` hosts, each\n * update schedules `requestUpdate()` automatically so `render()` stays in sync.\n *\n * **Method form (deprecated — use `@onContextUpdate`):** The method is called\n * with the new value on each change.\n *\n * @param options Context subscription configuration.\n */\nexport function contextSelector<T extends Context<unknown, unknown>, Selected = ContextType<T>>(\n\toptions: ContextSelectorOptions<T, Selected>,\n): ContextSelectorDecorator<Selected> {\n\treturn function (\n\t\tprotoOrTarget: RadiantElement | Method | undefined,\n\t\tnameOrContext:\n\t\t\t| string\n\t\t\t| ClassFieldDecoratorContext<RadiantElement, Selected>\n\t\t\t| ClassMethodDecoratorContext<RadiantElement, ContextUpdateMethod<Selected>>,\n\t\tdescriptor?: TypedPropertyDescriptor<ContextUpdateMethod<Selected>>,\n\t):\n\t\t| ((this: RadiantElement, initialValue: Selected) => Selected)\n\t\t| TypedPropertyDescriptor<ContextUpdateMethod<Selected>>\n\t\t| void {\n\t\tif (typeof nameOrContext === 'object') {\n\t\t\tif (nameOrContext.kind === 'field') {\n\t\t\t\treturn standardContextSelectorField(options)(\n\t\t\t\t\tprotoOrTarget as StandardFieldDecoratorArgs<RadiantElement, Selected>['protoOrTarget'],\n\t\t\t\t\tnameOrContext as StandardFieldDecoratorArgs<RadiantElement, Selected>['nameOrContext'],\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn standardContextSelectorMethod(options as OnContextUpdateOptions<T, Selected>)(\n\t\t\t\tprotoOrTarget as StandardMethodDecoratorArgs['protoOrTarget'],\n\t\t\t\tnameOrContext as StandardMethodDecoratorArgs['nameOrContext'],\n\t\t\t);\n\t\t}\n\n\t\tif (descriptor) {\n\t\t\treturn legacyContextSelectorMethod(options as OnContextUpdateOptions<T, Selected>)(\n\t\t\t\tprotoOrTarget as LegacyMethodDecoratorArgs['protoOrTarget'],\n\t\t\t\tnameOrContext as LegacyMethodDecoratorArgs['nameOrContext'],\n\t\t\t\tdescriptor as LegacyMethodDecoratorArgs['descriptor'],\n\t\t\t);\n\t\t}\n\n\t\treturn legacyContextSelectorField(options)(\n\t\t\tprotoOrTarget as LegacyFieldDecoratorArgs['protoOrTarget'],\n\t\t\tnameOrContext as LegacyFieldDecoratorArgs['nameOrContext'],\n\t\t);\n\t} as ContextSelectorDecorator<Selected>;\n}\n"
6
+ ],
7
+ "mappings": "kLAuDO,GAAS,LAA+E,LAC9F,EACqC,CACrC,OAAO,QAAS,CACf,EACA,EAIA,EAIO,CACP,GAAI,OAAO,IAAkB,SAAU,CACtC,GAAI,EAAc,OAAS,QAC1B,OAAO,EAA6B,CAAO,EAC1C,EACA,CACD,EAGD,OAAO,EAA8B,CAA8C,EAClF,EACA,CACD,EAGD,GAAI,EACH,OAAO,EAA4B,CAA8C,EAChF,EACA,EACA,CACD,EAGD,OAAO,EAA2B,CAAO,EACxC,EACA,CACD",
8
+ "debugId": "18BD725C32637F8D64756E2164756E21",
9
+ "names": []
10
+ }
@@ -1,4 +1,4 @@
1
- import{aa as F}from"./chunk-9gjmqxp2.js";import{Ma as A}from"./chunk-8tvt04cm.js";import{Sa as H,Ta as O,Ua as M,Va as L}from"./chunk-73x7jpdd.js";import{createSubscribableJsxValue as I}from"@ecopages/jsx";import{trackDependency as x}from"@ecopages/signals";var z=D();class B{read;subscribers=new Set;watcherListeners=new Set;version=0;constructor(j){this.read=j}get(){return x(this),this.read()}subscribe(j){return this.subscribers.add(j),()=>{this.subscribers.delete(j)}}addWatcher(j){return this.watcherListeners.add(j),()=>{this.watcherListeners.delete(j)}}getVersion(){return this.version}notify(j){this.version+=1;let G;try{this.notifyWatchers()}catch(Q){G=Q}if(this.publish(j),G)throw G}publish(j){for(let G of this.subscribers)G(j)}notifyWatchers(){let j=[];for(let G of this.watcherListeners)try{G()}catch(Q){j.push(Q)}if(j.length===1)throw j[0];if(j.length>1)throw AggregateError(j,"Multiple reactive dependency notifications failed.")}}function D(){if(typeof HTMLElement<"u")return HTMLElement;throw Error("RadiantElement requires HTMLElement. Install '@ecopages/radiant/server/light-dom-shim' before importing Radiant components in SSR.")}class K extends z{bindings;$;reactiveProperties=new Map;reactiveFields=new Map;reactiveDependencies=new Map;reactiveDependencyReaders=new Map;reactiveBindings=new Map;contextProviders=new Map;hydrationBindings=new Map;updateCallbacks=new Map;eventSubscriptions=new Map;eventEmitters=new Map;onConnectedCallbacks=[];onDisconnectedCallback=[];elementReady=!1;constructor(){super();let j=this.createReactiveBindingNamespace();this.bindings=j,this.$=j,A(this)}createReactiveBindingNamespace(){return new Proxy(Object.create(null),{get:(j,G)=>{if(typeof G!=="string")return;return this.getReactiveBinding(G)}})}connectedCallback(){this.elementReady=!0;for(let j of this.onConnectedCallbacks)j()}connectedContextCallback(j){}disconnectedCallback(){this.removeAllSubscribedEvents();for(let j of this.onDisconnectedCallback)j()}notifyUpdate(j,G,Q){if(G===Q)return;this.reactiveDependencies.get(j)?.notify(Q);let U=this.updateCallbacks.get(j);if(U)for(let X of U)X()}transformAttributeValue(j,G){return j!==null?G?.converter.fromAttribute(j):j}attributeChangedCallback(j,G,Q){if(G===Q||!this.elementReady)return;if(this.reactiveProperties.has(j)){let U=this.reactiveProperties.get(j),X=this.transformAttributeValue(Q,U),Y=this.transformAttributeValue(G,U),Z=U?U.attribute:j;this[Z]=X,this.notifyUpdate(j,Y,X)}}renderTemplate({target:j=this,template:G,insert:Q="replace",sanitize:U}){let X=U?U(G):G;switch(Q){case"replace":j.innerHTML=X;break;case"beforeend":j.insertAdjacentHTML("beforeend",X);break;case"afterbegin":j.insertAdjacentHTML("afterbegin",X);break;case"beforebegin":j.insertAdjacentHTML("beforebegin",X);break;case"afterend":j.insertAdjacentHTML("afterend",X);break}}registerReactiveProperty(j){this.reactiveProperties.set(j.name,j)}getReactiveProperties(){return Array.from(this.reactiveProperties.values())}registerReactiveField(j){this.reactiveFields.set(j.name,j)}registerReactiveDependencyReader(j,G){this.reactiveDependencyReaders.set(j,G)}registerContextProvider(j,G){this.contextProviders.set(j,G),this.registerHydrationBinding(j,G)}registerHydrationBinding(j,G){this.hydrationBindings.set(j,G)}getContextProviders(){return Array.from(this.contextProviders.values())}getHydrationBindings(){return Array.from(this.hydrationBindings.values())}prepareForSsr(){F(this)}shouldAutoBindReactiveMembers(){return!1}registerUpdateCallback(j,G){if(!this.updateCallbacks.has(j))this.updateCallbacks.set(j,new Set);let Q=this.updateCallbacks.get(j);return Q.add(G),()=>{if(Q.delete(G),Q.size===0)this.updateCallbacks.delete(j)}}getReactiveBinding(j){let G=this.reactiveBindings.get(j);if(G)return G;let Q=I({getValue:()=>this.readReactiveBindingValue(j),subscribe:(U)=>this.registerUpdateCallback(j,()=>{U(this.readReactiveBindingValue(j))})});return this.reactiveBindings.set(j,Q),Q}bind(j){return this.getReactiveBinding(j)}defineReactiveBinding(j,G=!0){let Q=typeof G==="string"?G:G?`$${j}`:void 0;if(!Q||Object.prototype.hasOwnProperty.call(this,Q))return;Object.defineProperty(this,Q,{get:function(){return this.getReactiveBinding(j)},enumerable:!1,configurable:!0})}getReactiveDependency(j){let G=this.reactiveDependencies.get(j);if(G)return G;let Q=new B(()=>this.readReactiveDependencyValue(j));return this.reactiveDependencies.set(j,Q),Q}trackReactiveRead(j){x(this.getReactiveDependency(j))}readReactiveDependencyValue(j){let G=this.reactiveDependencyReaders.get(j);if(G)return G();return this.readReactiveBindingValue(j)}readReactiveBindingValue(j){let G=this[j];if(P(G))return G.get();return G}subscribeEvents(j){let G=[];for(let Q of j)G.push(this.subscribeEvent(Q));return G}subscribeEvent(j){let G=(U)=>{if(U.target&&U.target.matches(j.selector))j.listener.call(this,U)},Q=`${j.type}:${j.selector}`;return this.addEventListener(j.type,G,j.options),this.eventSubscriptions.set(Q,{...j,listener:G}),this.unsubscribeEvent.bind(this,Q)}unsubscribeEvent(j){let G=this.eventSubscriptions.get(j);if(G)this.removeEventListener(G.type,G.listener,G.options),this.eventSubscriptions.delete(j)}removeAllSubscribedEvents(){for(let j of this.eventSubscriptions.values())this.removeEventListener(j.type,j.listener,j.options);this.eventSubscriptions.clear()}registerCleanupCallback(j){this.onDisconnectedCallback.push(j)}registerConnectedCallback(j){this.onConnectedCallbacks.push(j)}registerEventEmitter(j,G){this.eventEmitters.set(j,G)}getRef(j,G=!1){let Q=`[data-ref="${j}"]`;if(G)return Array.from(this.querySelectorAll(Q));return this.querySelector(Q)??null}createReactiveField(j,G,Q={}){let U=Q.bind??this.shouldAutoBindReactiveMembers(),X={name:j,value:G,initialValue:G};this.registerReactiveField(X),this.defineReactiveBinding(j,U),this.registerReactiveDependencyReader(j,()=>this.reactiveFields.get(j)?.value),Object.defineProperty(this,j,{get(){return this.trackReactiveRead(j),this.reactiveFields.get(j)?.value??void 0},set(Y){let Z=this.reactiveFields.get(j)?.value;if(Z!==Y)this.reactiveFields.set(j,{...X,value:Y}),this.notifyUpdate(j,Z,Y)},enumerable:!0,configurable:!0}),this.notifyUpdate(j,void 0,G)}createReactiveProp(j,G){let{type:Q,attribute:U,reflect:X,defaultValue:Y}=G,Z=G.bind??this.shouldAutoBindReactiveMembers(),_=U??j;if(Y!==void 0&&!M(Q,Y))throw Error(`defaultValue does not match the expected type for ${Q.name}`);let $=L(this,Q,_,Y);if(this.hasAttribute(_)&&(!X||$==null||$===""))this.removeAttribute(_);let T={type:Q,name:j,value:$,initialValue:$,attribute:_,converter:{fromAttribute:(W)=>H(W,Q),toAttribute:(W)=>O(W,Q)}};this.registerReactiveProperty(T),this.defineReactiveBinding(j,Z),this.registerReactiveDependencyReader(j,()=>this.reactiveProperties.get(j)?.value);let q=(W)=>{if(X)if(W==null||W===""||W===!1)this.removeAttribute(_);else{let J=T.converter.toAttribute(W);this.setAttribute(_,J)}};if(Object.defineProperty(this,j,{get:function(){return this.trackReactiveRead(j),this.reactiveProperties.get(j)?.value??void 0},set:function(W){let J=this.reactiveProperties.get(j)?.value;if(J!==W)this.reactiveProperties.set(j,{...T,value:W}),q(W),this.notifyUpdate(j,J,W)},enumerable:!0,configurable:!0}),$!==void 0)queueMicrotask(()=>{let W=this.reactiveProperties.get(j)?.value;if(W===void 0)return;q(W),this.notifyUpdate(j,void 0,W)})}}function P(j){return typeof j==="object"&&j!==null&&typeof j.get==="function"}
2
- export{K as H};
1
+ import{za as F}from"./chunk-eyw14d6y.js";import{Na as A}from"./chunk-cnyxrh9r.js";import{db as H,eb as O,fb as M,gb as L}from"./chunk-66e6s792.js";import{createSubscribableJsxValue as I}from"@ecopages/jsx";import{trackDependency as x}from"@ecopages/signals";var z=D();class B{read;subscribers=new Set;watcherListeners=new Set;version=0;constructor(j){this.read=j}get(){return x(this),this.read()}subscribe(j){return this.subscribers.add(j),()=>{this.subscribers.delete(j)}}addWatcher(j){return this.watcherListeners.add(j),()=>{this.watcherListeners.delete(j)}}getVersion(){return this.version}notify(j){this.version+=1;let G;try{this.notifyWatchers()}catch(Q){G=Q}if(this.publish(j),G)throw G}publish(j){for(let G of this.subscribers)G(j)}notifyWatchers(){let j=[];for(let G of this.watcherListeners)try{G()}catch(Q){j.push(Q)}if(j.length===1)throw j[0];if(j.length>1)throw AggregateError(j,"Multiple reactive dependency notifications failed.")}}function D(){if(typeof HTMLElement<"u")return HTMLElement;throw Error("RadiantElement requires HTMLElement. Install '@ecopages/radiant/server/light-dom-shim' before importing Radiant components in SSR.")}class K extends z{bindings;$;reactiveProperties=new Map;reactiveFields=new Map;reactiveDependencies=new Map;reactiveDependencyReaders=new Map;reactiveBindings=new Map;contextProviders=new Map;hydrationBindings=new Map;updateCallbacks=new Map;eventSubscriptions=new Map;eventEmitters=new Map;onConnectedCallbacks=[];onDisconnectedCallback=[];elementReady=!1;constructor(){super();let j=this.createReactiveBindingNamespace();this.bindings=j,this.$=j,A(this)}createReactiveBindingNamespace(){return new Proxy(Object.create(null),{get:(j,G)=>{if(typeof G!=="string")return;return this.getReactiveBinding(G)}})}connectedCallback(){this.elementReady=!0;for(let j of this.onConnectedCallbacks)j()}connectedContextCallback(j){}disconnectedCallback(){this.removeAllSubscribedEvents();for(let j of this.onDisconnectedCallback)j()}notifyUpdate(j,G,Q){if(G===Q)return;this.reactiveDependencies.get(j)?.notify(Q);let U=this.updateCallbacks.get(j);if(U)for(let X of U)X()}transformAttributeValue(j,G){return j!==null?G?.converter.fromAttribute(j):j}attributeChangedCallback(j,G,Q){if(G===Q||!this.elementReady)return;if(this.reactiveProperties.has(j)){let U=this.reactiveProperties.get(j),X=this.transformAttributeValue(Q,U),Y=this.transformAttributeValue(G,U),Z=U?U.attribute:j;this[Z]=X,this.notifyUpdate(j,Y,X)}}renderTemplate({target:j=this,template:G,insert:Q="replace",sanitize:U}){let X=U?U(G):G;switch(Q){case"replace":j.innerHTML=X;break;case"beforeend":j.insertAdjacentHTML("beforeend",X);break;case"afterbegin":j.insertAdjacentHTML("afterbegin",X);break;case"beforebegin":j.insertAdjacentHTML("beforebegin",X);break;case"afterend":j.insertAdjacentHTML("afterend",X);break}}registerReactiveProperty(j){this.reactiveProperties.set(j.name,j)}getReactiveProperties(){return Array.from(this.reactiveProperties.values())}registerReactiveField(j){this.reactiveFields.set(j.name,j)}registerReactiveDependencyReader(j,G){this.reactiveDependencyReaders.set(j,G)}registerContextProvider(j,G){this.contextProviders.set(j,G),this.registerHydrationBinding(j,G)}registerHydrationBinding(j,G){this.hydrationBindings.set(j,G)}getContextProviders(){return Array.from(this.contextProviders.values())}getHydrationBindings(){return Array.from(this.hydrationBindings.values())}prepareForSsr(){F(this)}shouldAutoBindReactiveMembers(){return!1}registerUpdateCallback(j,G){if(!this.updateCallbacks.has(j))this.updateCallbacks.set(j,new Set);let Q=this.updateCallbacks.get(j);return Q.add(G),()=>{if(Q.delete(G),Q.size===0)this.updateCallbacks.delete(j)}}getReactiveBinding(j){let G=this.reactiveBindings.get(j);if(G)return G;let Q=I({getValue:()=>this.readReactiveBindingValue(j),subscribe:(U)=>this.registerUpdateCallback(j,()=>{U(this.readReactiveBindingValue(j))})});return this.reactiveBindings.set(j,Q),Q}bind(j){return this.getReactiveBinding(j)}defineReactiveBinding(j,G=!0){let Q=typeof G==="string"?G:G?`$${j}`:void 0;if(!Q||Object.prototype.hasOwnProperty.call(this,Q))return;Object.defineProperty(this,Q,{get:function(){return this.getReactiveBinding(j)},enumerable:!1,configurable:!0})}getReactiveDependency(j){let G=this.reactiveDependencies.get(j);if(G)return G;let Q=new B(()=>this.readReactiveDependencyValue(j));return this.reactiveDependencies.set(j,Q),Q}trackReactiveRead(j){x(this.getReactiveDependency(j))}readReactiveDependencyValue(j){let G=this.reactiveDependencyReaders.get(j);if(G)return G();return this.readReactiveBindingValue(j)}readReactiveBindingValue(j){let G=this[j];if(P(G))return G.get();return G}subscribeEvents(j){let G=[];for(let Q of j)G.push(this.subscribeEvent(Q));return G}subscribeEvent(j){let G=(U)=>{if(U.target&&U.target.matches(j.selector))j.listener.call(this,U)},Q=`${j.type}:${j.selector}`;return this.addEventListener(j.type,G,j.options),this.eventSubscriptions.set(Q,{...j,listener:G}),this.unsubscribeEvent.bind(this,Q)}unsubscribeEvent(j){let G=this.eventSubscriptions.get(j);if(G)this.removeEventListener(G.type,G.listener,G.options),this.eventSubscriptions.delete(j)}removeAllSubscribedEvents(){for(let j of this.eventSubscriptions.values())this.removeEventListener(j.type,j.listener,j.options);this.eventSubscriptions.clear()}registerCleanupCallback(j){this.onDisconnectedCallback.push(j)}registerConnectedCallback(j){this.onConnectedCallbacks.push(j)}registerEventEmitter(j,G){this.eventEmitters.set(j,G)}getRef(j,G=!1){let Q=`[data-ref="${j}"]`;if(G)return Array.from(this.querySelectorAll(Q));return this.querySelector(Q)??null}createReactiveField(j,G,Q={}){let U=Q.bind??this.shouldAutoBindReactiveMembers(),X={name:j,value:G,initialValue:G};this.registerReactiveField(X),this.defineReactiveBinding(j,U),this.registerReactiveDependencyReader(j,()=>this.reactiveFields.get(j)?.value),Object.defineProperty(this,j,{get(){return this.trackReactiveRead(j),this.reactiveFields.get(j)?.value??void 0},set(Y){let Z=this.reactiveFields.get(j)?.value;if(Z!==Y)this.reactiveFields.set(j,{...X,value:Y}),this.notifyUpdate(j,Z,Y)},enumerable:!0,configurable:!0}),this.notifyUpdate(j,void 0,G)}createReactiveProp(j,G){let{type:Q,attribute:U,reflect:X,defaultValue:Y}=G,Z=G.bind??this.shouldAutoBindReactiveMembers(),_=U??j;if(Y!==void 0&&!M(Q,Y))throw Error(`defaultValue does not match the expected type for ${Q.name}`);let $=L(this,Q,_,Y);if(this.hasAttribute(_)&&(!X||$==null||$===""))this.removeAttribute(_);let T={type:Q,name:j,value:$,initialValue:$,attribute:_,converter:{fromAttribute:(W)=>H(W,Q),toAttribute:(W)=>O(W,Q)}};this.registerReactiveProperty(T),this.defineReactiveBinding(j,Z),this.registerReactiveDependencyReader(j,()=>this.reactiveProperties.get(j)?.value);let q=(W)=>{if(X)if(W==null||W===""||W===!1)this.removeAttribute(_);else{let J=T.converter.toAttribute(W);this.setAttribute(_,J)}};if(Object.defineProperty(this,j,{get:function(){return this.trackReactiveRead(j),this.reactiveProperties.get(j)?.value??void 0},set:function(W){let J=this.reactiveProperties.get(j)?.value;if(J!==W)this.reactiveProperties.set(j,{...T,value:W}),q(W),this.notifyUpdate(j,J,W)},enumerable:!0,configurable:!0}),$!==void 0)queueMicrotask(()=>{let W=this.reactiveProperties.get(j)?.value;if(W===void 0)return;q(W),this.notifyUpdate(j,void 0,W)})}}function P(j){return typeof j==="object"&&j!==null&&typeof j.get==="function"}
2
+ export{K as Y};
3
3
 
4
- //# debugId=C55FCA1B9513CFE664756E2164756E21
4
+ //# debugId=E825FDA4BDC6619564756E2164756E21
@@ -5,6 +5,6 @@
5
5
  "import type { EventEmitter } from '../tools';\nimport { createSubscribableJsxValue, type JsxRenderable, type SubscribableJsxValue } from '@ecopages/jsx';\nimport { trackDependency, type DependencyNode, type SignalSubscriber } from '@ecopages/signals';\nimport type { SsrSerializableContextProvider } from '../context/context-provider';\nimport type { UnknownContext } from '../context/types';\nimport { runLegacyInstanceInitializers } from '../decorators/legacy/instance-initializers';\nimport type { SsrSerializableHydrationBinding } from './ssr-hydration-binding';\nimport { runSsrPreparationCallbacks } from './ssr-preparation';\nimport {\n\ttype AttributeTypeConstant,\n\ttype ReadAttributeValueReturnType,\n\ttype WriteAttributeValueReturnType,\n\tgetInitialValue,\n\tisValueOfType,\n\treadAttributeValue,\n\twriteAttributeValue,\n} from '../utils/attribute-utils';\n\nconst RadiantElementBase = resolveRadiantElementBase();\n\ntype ReactiveDependencyReader = () => unknown;\n\nclass ReactiveHostDependency implements DependencyNode {\n\tprivate readonly subscribers = new Set<SignalSubscriber<unknown>>();\n\tprivate readonly watcherListeners = new Set<() => void>();\n\tprivate version = 0;\n\n\tconstructor(private readonly read: ReactiveDependencyReader) {}\n\n\tpublic get(): unknown {\n\t\ttrackDependency(this);\n\t\treturn this.read();\n\t}\n\n\tpublic subscribe(notify: SignalSubscriber<unknown>): () => void {\n\t\tthis.subscribers.add(notify);\n\n\t\treturn () => {\n\t\t\tthis.subscribers.delete(notify);\n\t\t};\n\t}\n\n\tpublic addWatcher(notify: () => void): () => void {\n\t\tthis.watcherListeners.add(notify);\n\n\t\treturn () => {\n\t\t\tthis.watcherListeners.delete(notify);\n\t\t};\n\t}\n\n\tpublic getVersion(): number {\n\t\treturn this.version;\n\t}\n\n\tpublic notify(nextValue: unknown): void {\n\t\tthis.version += 1;\n\t\tlet watcherError: unknown;\n\n\t\ttry {\n\t\t\tthis.notifyWatchers();\n\t\t} catch (error) {\n\t\t\twatcherError = error;\n\t\t}\n\n\t\tthis.publish(nextValue);\n\n\t\tif (watcherError) {\n\t\t\tthrow watcherError;\n\t\t}\n\t}\n\n\tprivate publish(nextValue: unknown): void {\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tsubscriber(nextValue);\n\t\t}\n\t}\n\n\tprivate notifyWatchers(): void {\n\t\tconst errors: unknown[] = [];\n\n\t\tfor (const listener of this.watcherListeners) {\n\t\t\ttry {\n\t\t\t\tlistener();\n\t\t\t} catch (error) {\n\t\t\t\terrors.push(error);\n\t\t\t}\n\t\t}\n\n\t\tif (errors.length === 1) {\n\t\t\tthrow errors[0];\n\t\t}\n\n\t\tif (errors.length > 1) {\n\t\t\tthrow new AggregateError(errors, 'Multiple reactive dependency notifications failed.');\n\t\t}\n\t}\n}\n\nfunction resolveRadiantElementBase(): typeof HTMLElement {\n\tif (typeof HTMLElement !== 'undefined') {\n\t\treturn HTMLElement;\n\t}\n\n\tthrow new Error(\n\t\t\"RadiantElement requires HTMLElement. Install '@ecopages/radiant/server/light-dom-shim' before importing Radiant components in SSR.\",\n\t);\n}\n\n/**\n * Possible positions to insert a rendered template.\n */\nexport type RenderInsertPosition = 'replace' | 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend';\n\n/**\n * Represents a Radiant element event listener.\n */\nexport type RadiantElementEventListener = {\n\tselector: string;\n\ttype: string;\n\tlistener: EventListener;\n\toptions?: AddEventListenerOptions;\n};\n\n/**\n * Represents a property metadata object.\n */\nexport interface ReactiveProperty<T = unknown> {\n\ttype: AttributeTypeConstant;\n\tvalue?: T;\n\tinitialValue?: T;\n\tname: string;\n\tattribute: string;\n\tconverter: {\n\t\tfromAttribute: (value: string) => ReadAttributeValueReturnType;\n\t\ttoAttribute: (value: any) => WriteAttributeValueReturnType;\n\t};\n}\n\n/**\n * Represents the options for a reactive property.\n */\nexport type ReactivePropertyOptions<T> = {\n\ttype: AttributeTypeConstant;\n\treflect?: boolean;\n\tattribute?: string;\n\tdefaultValue?: T;\n\t/**\n\t * Exposes a JSX binding companion for the reactive property.\n\t *\n\t * - `true` creates a `$propertyName` accessor.\n\t * - a string creates a custom accessor with that name.\n\t * - `undefined` defers to the host default.\n\t *\n\t * The generated accessor returns a subscribable JSX child value so JSX can\n\t * patch only the affected child part when the property changes.\n\t */\n\tbind?: boolean | string;\n};\n\nexport type ReactiveBindingOption = boolean | string;\n\nexport type ReactiveFieldOptions = {\n\t/**\n\t * Exposes a JSX binding companion for the reactive field.\n\t *\n\t * - `true` creates a `$fieldName` accessor.\n\t * - a string creates a custom accessor with that name.\n\t * - `undefined` defers to the host default.\n\t */\n\tbind?: ReactiveBindingOption;\n};\n\nexport type ReactiveField<T = unknown> = {\n\tname: string;\n\tvalue: T;\n\tinitialValue: T;\n};\n\ntype StringPropertyKey<Value> = Extract<keyof Value, string>;\n\n/**\n * Value type produced by a JSX binding for a selected reactive member.\n *\n * Bindings preserve the original property type when it is already renderable by\n * the Ecopages JSX runtime. For non-renderable values, the binding falls back\n * to the broader `JsxRenderable` contract consumed by the renderer.\n */\nexport type ReactiveBindingValue<\n\tHost extends object,\n\tProperty extends StringPropertyKey<Host>,\n> = Host[Property] extends JsxRenderable ? Host[Property] : JsxRenderable;\n\n/**\n * Namespace of cached JSX bindings keyed by the explicit bindable shape.\n *\n * Radiant exposes this namespace twice on every host:\n *\n * - `host.bindings.key` for the explicit form\n * - `host.$.key` for the short form\n *\n * Both aliases resolve through the same cached binding objects as\n * `host.bind('key')`.\n */\nexport type ReactiveBindings<Bindings extends object> = {\n\treadonly [Property in StringPropertyKey<Bindings>]: SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>>;\n};\n\n/**\n * Represents an interface for a Radiant element.\n * @typeParam Bindings - Explicit internal bindable shape used to type `bind()` and `getReactiveBinding()`.\n *\n * This shape describes which reactive members are exposed through `bindings`,\n * `$`, and `bind(...)`. It does not automatically define the public JSX\n * attribute contract for the custom element.\n */\nexport interface IRadiantElement<Bindings extends object = {}> {\n\t/**\n\t * Namespace of cached JSX bindings keyed by the explicit bindable shape.\n\t */\n\treadonly bindings: ReactiveBindings<Bindings>;\n\n\t/**\n\t * Short alias for {@link bindings}.\n\t */\n\treadonly $: ReactiveBindings<Bindings>;\n\n\t/**\n\t * Called when a property of the element is updated.\n\t * @param changedProperty - The name of the changed property.\n\t * @param oldValue - The old value of the property.\n\t * @param newValue - The new value of the property.\n\t */\n\tnotifyUpdate(changedProperty: string, oldValue: unknown, newValue: unknown): void;\n\n\t/**\n\t * Subscribes to a Radiant element event.\n\t * @param event - The event listener to subscribe to.\n\t */\n\tsubscribeEvent(event: RadiantElementEventListener): void;\n\n\t/**\n\t * Registers a callback to be invoked when a reactive property or field changes.\n\t *\n\t * @returns A cleanup function that unregisters the callback.\n\t */\n\tregisterUpdateCallback(property: string, update: (...rest: any[]) => any): () => void;\n\n\t/**\n\t * Returns a subscribable JSX child binding for a reactive property or field.\n\t *\n\t * Prefer `this.bindings.key` or `this.$.key` in JSX render code when you want\n\t * property access syntax without string literals.\n\t */\n\tbind<Property extends StringPropertyKey<Bindings>>(\n\t\tproperty: Property,\n\t): SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>>;\n\n\t/**\n\t * Returns a subscribable JSX child binding for a reactive property or field.\n\t *\n\t * This is the primitive lookup used by `bind()`, `bindings.key`, and `$.key`.\n\t */\n\tgetReactiveBinding<Property extends StringPropertyKey<Bindings>>(\n\t\tproperty: Property,\n\t): SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>>;\n\n\t/**\n\t * Defines a stable JSX binding companion accessor for a reactive member.\n\t *\n\t * Companion bindings create properties such as `$count` directly on the host.\n\t * Prefer the `bindings` or `$` namespace for new code when you want typed,\n\t * explicit access to the configured bindable shape.\n\t */\n\tdefineReactiveBinding(property: string, bind?: ReactiveBindingOption): void;\n\n\t/**\n\t * Subscribes to multiple Radiant element events.\n\t * @param events - The array of event listeners to subscribe to.\n\t */\n\tsubscribeEvents(events: RadiantElementEventListener[]): void;\n\n\t/**\n\t * It adds a callback to be executed when the Radiant element is disconnected from the DOM.\n\t */\n\tregisterCleanupCallback(callback: () => void): void;\n\n\t/**\n\t * Registers a callback to run on each future host connection.\n\t *\n\t * The callback is only invoked from `connectedCallback()`. Registering it\n\t * after the host is already connected does not invoke it immediately.\n\t */\n\tregisterConnectedCallback(callback: () => void): void;\n\n\t/**\n\t * Registers a raw value reader for a reactive member so that tracked render\n\t * dependencies can read the underlying value without triggering the public\n\t * getter's dependency tracking.\n\t */\n\tregisterReactiveDependencyReader(property: string, read: () => unknown): void;\n\n\t/**\n\t * Records a tracked read of a reactive member during a component render,\n\t * allowing the signals runtime to re-render only the affected parts.\n\t */\n\ttrackReactiveRead(property: string): void;\n\n\t/**\n\t * Renders a trusted HTML template string into the specified target element.\n\t *\n\t * **Security:** The `template` string is written to the DOM via `innerHTML`\n\t * or `insertAdjacentHTML` without built-in sanitization. Callers are\n\t * responsible for ensuring the input is trusted. Supply a `sanitize`\n\t * function to transform the template before insertion.\n\t *\n\t * @param options - The rendering options.\n\t * @param options.target - The target element to render the template into.\n\t * @param options.template - The template string to render.\n\t * @param options.insert - The position to insert the rendered template. (optional)\n\t * @param options.sanitize - An optional function that transforms the template string before insertion.\n\t */\n\trenderTemplate(options: {\n\t\ttarget: HTMLElement;\n\t\ttemplate: string;\n\t\tinsert?: RenderInsertPosition;\n\t\tsanitize?: (html: string) => string;\n\t}): void;\n\n\t/**\n\t * Called when the Radiant element is connected to a context.\n\t * @param context - The connected context.\n\t */\n\tconnectedContextCallback(context: UnknownContext): void;\n\n\t/**\n\t * Gets a reference to a child element by its data-ref attribute.\n\t * @param ref - The data-ref attribute value of the element to get.\n\t * @param all - Whether to get all elements with the specified data-ref attribute value.\n\t * @returns The element with the specified data-ref attribute value, an array of elements or null if no element was found.\n\t */\n\tgetRef<T extends Element = Element>(ref: string, all: true): T[];\n\tgetRef<T extends Element = Element>(ref: string, all?: false): T | null;\n}\n\n/**\n * A base class for creating custom elements with reactive properties and event subscriptions.\n * @typeParam Bindings - Explicit internal bindable shape. Include only the\n * prop/state keys that JSX bindings should accept.\n *\n * Prefer a separate public props type for custom-element JSX declarations when\n * the external attribute contract differs from the component's internal\n * reactive state. Reuse the same type only when the public props and bindable\n * members are intentionally identical.\n * @extends HTMLElement\n * @implements IRadiantElement<Bindings>\n */\nexport class RadiantElement<Bindings extends object = {}>\n\textends RadiantElementBase\n\timplements IRadiantElement<Bindings>\n{\n\tpublic readonly bindings: ReactiveBindings<Bindings>;\n\tpublic readonly $: ReactiveBindings<Bindings>;\n\n\t/**\n\t * A map of property metadata objects, it contains useful information about the properties configured via decorators.\n\t */\n\tprivate reactiveProperties = new Map<string, ReactiveProperty>();\n\n\t/**\n\t * A map of reactive fields, it contains the reactive fields configured via decorators.\n\t */\n\tprivate reactiveFields = new Map<string, ReactiveField>();\n\n\t/**\n\t * Stable dependency nodes used when plain reactive member reads participate\n\t * in tracked component renders.\n\t */\n\tprivate reactiveDependencies = new Map<string, ReactiveHostDependency>();\n\n\t/**\n\t * Raw value readers for reactive members whose public getter should also\n\t * register tracked render dependencies.\n\t */\n\tprivate reactiveDependencyReaders = new Map<string, ReactiveDependencyReader>();\n\n\t/**\n\t * Stable subscribable JSX bindings keyed by reactive property name.\n\t */\n\tprivate reactiveBindings = new Map<string, SubscribableJsxValue>();\n\n\t/**\n\t * Registered context providers keyed by decorated property name.\n\t */\n\tprivate contextProviders = new Map<string, SsrSerializableContextProvider>();\n\n\t/**\n\t * Registered keyed hydration payload producers appended to SSR host output.\n\t */\n\tprivate hydrationBindings = new Map<string, SsrSerializableHydrationBinding>();\n\n\t/**\n\t * A map of property update callbacks. These callbacks are called when a property is updated.\n\t */\n\tprivate updateCallbacks = new Map<string, Set<(...rest: any[]) => any>>();\n\n\t/**\n\t * A map of event subscriptions used to manage event listeners on the Radiant element.\n\t */\n\tprivate eventSubscriptions = new Map<string, RadiantElementEventListener>();\n\n\t/**\n\t * A map for event emitters\n\t */\n\tprivate eventEmitters = new Map<string, EventEmitter>();\n\n\t/**\n\t * Callbacks executed whenever the Radiant element is connected to the DOM.\n\t */\n\tprivate onConnectedCallbacks: (() => void)[] = [];\n\n\t/**\n\t * An array of cleanup callbacks to be executed when the Radiant element is disconnected from the DOM.\n\t */\n\tprivate onDisconnectedCallback: (() => void)[] = [];\n\n\t/**\n\t * A flag indicating whether the element has been connected to the DOM.\n\t */\n\tprivate elementReady = false;\n\n\tconstructor() {\n\t\tsuper();\n\t\tconst bindingNamespace = this.createReactiveBindingNamespace();\n\t\tthis.bindings = bindingNamespace;\n\t\tthis.$ = bindingNamespace;\n\t\trunLegacyInstanceInitializers(this);\n\t}\n\n\tprivate createReactiveBindingNamespace(): ReactiveBindings<Bindings> {\n\t\treturn new Proxy(Object.create(null) as ReactiveBindings<Bindings>, {\n\t\t\tget: (_target, property) => {\n\t\t\t\tif (typeof property !== 'string') {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn this.getReactiveBinding(property as StringPropertyKey<Bindings>);\n\t\t\t},\n\t\t}) as ReactiveBindings<Bindings>;\n\t}\n\n\tconnectedCallback() {\n\t\tthis.elementReady = true;\n\n\t\tfor (const callback of this.onConnectedCallbacks) {\n\t\t\tcallback();\n\t\t}\n\t}\n\n\tconnectedContextCallback(_contextName: UnknownContext): void {}\n\n\tdisconnectedCallback() {\n\t\tthis.removeAllSubscribedEvents();\n\t\tfor (const cleanup of this.onDisconnectedCallback) {\n\t\t\tcleanup();\n\t\t}\n\t}\n\n\tpublic notifyUpdate(changedProperty: string, oldValue: unknown, value: unknown) {\n\t\tif (oldValue === value) return;\n\n\t\tthis.reactiveDependencies.get(changedProperty)?.notify(value);\n\t\tconst updates = this.updateCallbacks.get(changedProperty);\n\n\t\tif (updates) {\n\t\t\tfor (const update of updates) {\n\t\t\t\tupdate();\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate transformAttributeValue(value: string | null, config: any): unknown {\n\t\treturn value !== null ? config?.converter.fromAttribute(value) : value;\n\t}\n\n\tattributeChangedCallback(name: string, oldValue: string | null, newValue: string | null) {\n\t\tif (oldValue === newValue || !this.elementReady) return;\n\n\t\tif (this.reactiveProperties.has(name)) {\n\t\t\tconst config = this.reactiveProperties.get(name);\n\n\t\t\tconst transformedValue = this.transformAttributeValue(newValue, config);\n\t\t\tconst transformedOldValue = this.transformAttributeValue(oldValue, config);\n\n\t\t\tconst key = config ? config.attribute : name;\n\t\t\t(this as any)[key] = transformedValue;\n\t\t\tthis.notifyUpdate(name, transformedOldValue, transformedValue);\n\t\t}\n\t}\n\n\t/**\n\t * Renders a trusted HTML template string into the specified target element.\n\t *\n\t * **Security:** The `template` string is written to the DOM via `innerHTML`\n\t * or `insertAdjacentHTML` without built-in sanitization. Callers are\n\t * responsible for ensuring the input is trusted. Supply a `sanitize`\n\t * function to transform the template before insertion.\n\t */\n\tpublic renderTemplate({\n\t\ttarget = this,\n\t\ttemplate,\n\t\tinsert = 'replace',\n\t\tsanitize,\n\t}: {\n\t\ttarget: HTMLElement;\n\t\ttemplate: string;\n\t\tinsert?: RenderInsertPosition;\n\t\tsanitize?: (html: string) => string;\n\t}) {\n\t\tconst html = sanitize ? sanitize(template) : template;\n\t\tswitch (insert) {\n\t\t\tcase 'replace':\n\t\t\t\ttarget.innerHTML = html;\n\t\t\t\tbreak;\n\t\t\tcase 'beforeend':\n\t\t\t\ttarget.insertAdjacentHTML('beforeend', html);\n\t\t\t\tbreak;\n\t\t\tcase 'afterbegin':\n\t\t\t\ttarget.insertAdjacentHTML('afterbegin', html);\n\t\t\t\tbreak;\n\t\t\tcase 'beforebegin':\n\t\t\t\ttarget.insertAdjacentHTML('beforebegin', html);\n\t\t\t\tbreak;\n\t\t\tcase 'afterend':\n\t\t\t\ttarget.insertAdjacentHTML('afterend', html);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tpublic registerReactiveProperty(config: ReactiveProperty) {\n\t\tthis.reactiveProperties.set(config.name, config);\n\t}\n\n\tprotected getReactiveProperties(): ReactiveProperty[] {\n\t\treturn Array.from(this.reactiveProperties.values());\n\t}\n\n\tpublic registerReactiveField<T>(config: ReactiveField<T>) {\n\t\tthis.reactiveFields.set(config.name, config);\n\t}\n\n\tpublic registerReactiveDependencyReader(property: string, read: ReactiveDependencyReader): void {\n\t\tthis.reactiveDependencyReaders.set(property, read);\n\t}\n\n\tpublic registerContextProvider(name: string, provider: SsrSerializableContextProvider): void {\n\t\tthis.contextProviders.set(name, provider);\n\t\tthis.registerHydrationBinding(name, provider);\n\t}\n\n\tpublic registerHydrationBinding(name: string, binding: SsrSerializableHydrationBinding): void {\n\t\tthis.hydrationBindings.set(name, binding);\n\t}\n\n\tprotected getContextProviders(): SsrSerializableContextProvider[] {\n\t\treturn Array.from(this.contextProviders.values());\n\t}\n\n\tprotected getHydrationBindings(): SsrSerializableHydrationBinding[] {\n\t\treturn Array.from(this.hydrationBindings.values());\n\t}\n\n\t/**\n\t * Flushes any deferred SSR-only preparation work before the host is\n\t * serialized.\n\t *\n\t * Radiant uses this to reapply SSR consumer state after construction so the\n\t * first server render sees finalized fields, props, and authored content.\n\t */\n\tprotected prepareForSsr(): void {\n\t\trunSsrPreparationCallbacks(this);\n\t}\n\n\t/**\n\t * Returns the default JSX binding policy for reactive members on this host.\n\t *\n\t * Plain `RadiantElement` instances keep binding opt-in. JSX-first hosts such\n\t * as `RadiantComponent` override this hook to opt into automatic bindings for\n\t * `@prop`, `@state`, and direct `createReactiveProp`/`createReactiveField`\n\t * calls when no explicit `bind` option is supplied.\n\t */\n\tprotected shouldAutoBindReactiveMembers(): boolean {\n\t\treturn false;\n\t}\n\n\tpublic registerUpdateCallback(property: string, update: (...rest: any[]) => any): () => void {\n\t\tif (!this.updateCallbacks.has(property)) {\n\t\t\tthis.updateCallbacks.set(property, new Set());\n\t\t}\n\n\t\tconst callbacks = this.updateCallbacks.get(property)!;\n\t\tcallbacks.add(update);\n\n\t\treturn () => {\n\t\t\tcallbacks.delete(update);\n\n\t\t\tif (callbacks.size === 0) {\n\t\t\t\tthis.updateCallbacks.delete(property);\n\t\t\t}\n\t\t};\n\t}\n\n\tpublic getReactiveBinding<Property extends StringPropertyKey<Bindings>>(\n\t\tproperty: Property,\n\t): SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>> {\n\t\tconst cachedBinding = this.reactiveBindings.get(property);\n\n\t\tif (cachedBinding) {\n\t\t\treturn cachedBinding as SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>>;\n\t\t}\n\n\t\tconst binding = createSubscribableJsxValue<ReactiveBindingValue<Bindings, Property>>({\n\t\t\tgetValue: () => this.readReactiveBindingValue(property) as ReactiveBindingValue<Bindings, Property>,\n\t\t\tsubscribe: (notify) =>\n\t\t\t\tthis.registerUpdateCallback(property, () => {\n\t\t\t\t\tnotify(this.readReactiveBindingValue(property) as ReactiveBindingValue<Bindings, Property>);\n\t\t\t\t}),\n\t\t});\n\n\t\tthis.reactiveBindings.set(property, binding);\n\t\treturn binding;\n\t}\n\n\tpublic bind<Property extends StringPropertyKey<Bindings>>(\n\t\tproperty: Property,\n\t): SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>> {\n\t\treturn this.getReactiveBinding(property) as SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>>;\n\t}\n\n\tpublic defineReactiveBinding(property: string, bind: ReactiveBindingOption = true): void {\n\t\tconst bindingPropertyName = typeof bind === 'string' ? bind : bind ? `$${property}` : undefined;\n\n\t\tif (!bindingPropertyName || Object.prototype.hasOwnProperty.call(this, bindingPropertyName)) {\n\t\t\treturn;\n\t\t}\n\n\t\tObject.defineProperty(this, bindingPropertyName, {\n\t\t\tget: function (this: RadiantElement<Bindings>) {\n\t\t\t\treturn this.getReactiveBinding(property as StringPropertyKey<Bindings>);\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t\tconfigurable: true,\n\t\t});\n\t}\n\n\tprivate getReactiveDependency(property: string): ReactiveHostDependency {\n\t\tconst cachedDependency = this.reactiveDependencies.get(property);\n\n\t\tif (cachedDependency) {\n\t\t\treturn cachedDependency;\n\t\t}\n\n\t\tconst dependency = new ReactiveHostDependency(() => this.readReactiveDependencyValue(property));\n\t\tthis.reactiveDependencies.set(property, dependency);\n\t\treturn dependency;\n\t}\n\n\tpublic trackReactiveRead(property: string): void {\n\t\ttrackDependency(this.getReactiveDependency(property));\n\t}\n\n\tprivate readReactiveDependencyValue(property: string): unknown {\n\t\tconst reader = this.reactiveDependencyReaders.get(property);\n\n\t\tif (reader) {\n\t\t\treturn reader();\n\t\t}\n\n\t\treturn this.readReactiveBindingValue(property as StringPropertyKey<Bindings>);\n\t}\n\n\tprivate readReactiveBindingValue<Property extends StringPropertyKey<Bindings>>(property: Property): unknown {\n\t\tconst value = (this as unknown as Record<string, unknown>)[property];\n\n\t\tif (isSignalLikeBindingValue(value)) {\n\t\t\treturn value.get();\n\t\t}\n\n\t\treturn value;\n\t}\n\n\tpublic subscribeEvents(events: RadiantElementEventListener[]): Array<() => void> {\n\t\tconst unsubscribers: Array<() => void> = [];\n\t\tfor (const event of events) {\n\t\t\tunsubscribers.push(this.subscribeEvent(event));\n\t\t}\n\t\treturn unsubscribers;\n\t}\n\n\tpublic subscribeEvent(eventConfig: RadiantElementEventListener): () => void {\n\t\tconst delegatedListener = (delegatedEvent: Event) => {\n\t\t\tif (delegatedEvent.target && (delegatedEvent.target as Element).matches(eventConfig.selector)) {\n\t\t\t\teventConfig.listener.call(this, delegatedEvent);\n\t\t\t}\n\t\t};\n\t\tconst subscriptionId = `${eventConfig.type}:${eventConfig.selector}`;\n\t\tthis.addEventListener(eventConfig.type, delegatedListener, eventConfig.options);\n\t\tthis.eventSubscriptions.set(subscriptionId, {\n\t\t\t...eventConfig,\n\t\t\tlistener: delegatedListener,\n\t\t});\n\n\t\treturn this.unsubscribeEvent.bind(this, subscriptionId);\n\t}\n\n\tprivate unsubscribeEvent(id: string): void {\n\t\tconst eventSubscription = this.eventSubscriptions.get(id);\n\t\tif (eventSubscription) {\n\t\t\tthis.removeEventListener(eventSubscription.type, eventSubscription.listener, eventSubscription.options);\n\t\t\tthis.eventSubscriptions.delete(id);\n\t\t}\n\t}\n\n\tprivate removeAllSubscribedEvents(): void {\n\t\tfor (const eventSubscription of this.eventSubscriptions.values()) {\n\t\t\tthis.removeEventListener(eventSubscription.type, eventSubscription.listener, eventSubscription.options);\n\t\t}\n\t\tthis.eventSubscriptions.clear();\n\t}\n\n\t/**\n\t * Registers a callback that runs on every future disconnect.\n\t */\n\tpublic registerCleanupCallback(callback: () => void): void {\n\t\tthis.onDisconnectedCallback.push(callback);\n\t}\n\n\t/**\n\t * Registers a callback that runs from `connectedCallback()` on future host\n\t * connections.\n\t *\n\t * Registering after the host is already connected does not invoke the\n\t * callback immediately.\n\t */\n\tpublic registerConnectedCallback(callback: () => void): void {\n\t\tthis.onConnectedCallbacks.push(callback);\n\t}\n\n\tpublic registerEventEmitter(name: string, emitter: EventEmitter) {\n\t\tthis.eventEmitters.set(name, emitter);\n\t}\n\n\tpublic getRef<T extends Element = Element>(ref: string, all: true): T[];\n\tpublic getRef<T extends Element = Element>(ref: string, all?: false): T | null;\n\tpublic getRef<T extends Element = Element>(ref: string, all = false): T | T[] | null {\n\t\tconst selector = `[data-ref=\"${ref}\"]`;\n\t\tif (all) {\n\t\t\treturn Array.from(this.querySelectorAll(selector)) as T[];\n\t\t}\n\t\treturn (this.querySelector(selector) as T) ?? null;\n\t}\n\n\tpublic createReactiveField<T>(propertyName: string, initialValue: T, options: ReactiveFieldOptions = {}): void {\n\t\tconst bind = options.bind ?? this.shouldAutoBindReactiveMembers();\n\t\tconst reactiveField: ReactiveField<T> = {\n\t\t\tname: propertyName,\n\t\t\tvalue: initialValue,\n\t\t\tinitialValue: initialValue,\n\t\t};\n\n\t\tthis.registerReactiveField(reactiveField);\n\t\tthis.defineReactiveBinding(propertyName, bind);\n\t\tthis.registerReactiveDependencyReader(propertyName, () => this.reactiveFields.get(propertyName)?.value);\n\n\t\tObject.defineProperty(this, propertyName, {\n\t\t\tget(this: RadiantElement) {\n\t\t\t\tthis.trackReactiveRead(propertyName);\n\t\t\t\treturn this.reactiveFields.get(propertyName)?.value ?? undefined;\n\t\t\t},\n\t\t\tset(this: RadiantElement, newValue: T) {\n\t\t\t\tconst oldValue = this.reactiveFields.get(propertyName)?.value;\n\t\t\t\tif (oldValue !== newValue) {\n\t\t\t\t\tthis.reactiveFields.set(propertyName, { ...reactiveField, value: newValue });\n\t\t\t\t\tthis.notifyUpdate(propertyName, oldValue, newValue);\n\t\t\t\t}\n\t\t\t},\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t});\n\n\t\tthis.notifyUpdate(propertyName, undefined, initialValue);\n\t}\n\n\tpublic createReactiveProp<T = unknown>(propertyName: string, options: ReactivePropertyOptions<T>): void {\n\t\tconst { type, attribute, reflect, defaultValue } = options;\n\t\tconst bind = options.bind ?? this.shouldAutoBindReactiveMembers();\n\t\tconst attributeKey = attribute ?? propertyName;\n\n\t\tif (defaultValue !== undefined && !isValueOfType(type, defaultValue)) {\n\t\t\tthrow new Error(`defaultValue does not match the expected type for ${type.name}`);\n\t\t}\n\n\t\tconst initialValue: T | undefined = getInitialValue(this, type, attributeKey, defaultValue) as T;\n\n\t\tif (this.hasAttribute(attributeKey) && (!reflect || initialValue == null || initialValue === '')) {\n\t\t\tthis.removeAttribute(attributeKey);\n\t\t}\n\n\t\tconst propertyMapping: ReactiveProperty<T> = {\n\t\t\ttype,\n\t\t\tname: propertyName,\n\t\t\tvalue: initialValue,\n\t\t\tinitialValue,\n\t\t\tattribute: attributeKey,\n\t\t\tconverter: {\n\t\t\t\tfromAttribute: (value) => readAttributeValue(value, type),\n\t\t\t\ttoAttribute: (value) => writeAttributeValue(value, type),\n\t\t\t},\n\t\t};\n\n\t\tthis.registerReactiveProperty(propertyMapping);\n\t\tthis.defineReactiveBinding(propertyName, bind);\n\t\tthis.registerReactiveDependencyReader(propertyName, () => this.reactiveProperties.get(propertyName)?.value);\n\n\t\tconst handleReflectRequest = (value: T) => {\n\t\t\tif (reflect) {\n\t\t\t\tif (value == null || value === '' || value === false) {\n\t\t\t\t\tthis.removeAttribute(attributeKey);\n\t\t\t\t} else {\n\t\t\t\t\tconst attributeValue = propertyMapping.converter.toAttribute(value);\n\t\t\t\t\tthis.setAttribute(attributeKey, attributeValue);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tObject.defineProperty(this, propertyName, {\n\t\t\tget: function (this: RadiantElement) {\n\t\t\t\tthis.trackReactiveRead(propertyName);\n\t\t\t\treturn this.reactiveProperties.get(propertyName)?.value ?? undefined;\n\t\t\t},\n\t\t\tset: function (this: RadiantElement, newValue: T) {\n\t\t\t\tconst oldValue = this.reactiveProperties.get(propertyName)?.value;\n\t\t\t\tif (oldValue !== newValue) {\n\t\t\t\t\tthis.reactiveProperties.set(propertyName, { ...propertyMapping, value: newValue });\n\t\t\t\t\thandleReflectRequest(newValue);\n\t\t\t\t\tthis.notifyUpdate(propertyName, oldValue, newValue);\n\t\t\t\t}\n\t\t\t},\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t});\n\n\t\tif (initialValue !== undefined) {\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tconst currentValue = this.reactiveProperties.get(propertyName)?.value as T | undefined;\n\t\t\t\tif (currentValue === undefined) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\thandleReflectRequest(currentValue);\n\t\t\t\tthis.notifyUpdate(propertyName, undefined, currentValue);\n\t\t\t});\n\t\t}\n\t}\n}\n\nfunction isSignalLikeBindingValue(value: unknown): value is { get(): unknown } {\n\treturn typeof value === 'object' && value !== null && typeof (value as { get?: unknown }).get === 'function';\n}\n"
6
6
  ],
7
7
  "mappings": "+JACA,+BAAS,gBACT,0BAAS,0BAgBT,IAAM,EAAqB,EAA0B,EAIrD,MAAM,CAAiD,CAKzB,KAJZ,YAAc,IAAI,IAClB,iBAAmB,IAAI,IAChC,QAAU,EAElB,WAAW,CAAkB,EAAgC,CAAhC,YAE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AC1C,GAAI,EACH,GAAI,GAAS,MAAQ,IAAU,IAAM,IAAU,GAC9C,KAAK,gBAAgB,CAAY,EAC3B,KACN,IAAM,EAAiB,EAAgB,UAAU,YAAY,CAAK,EAClE,KAAK,aAAa,EAAc,CAAc,IAsBjD,GAjBA,OAAO,eAAe,KAAM,EAAc,CACzC,IAAK,QAAS,EAAuB,CAEpC,OADA,KAAK,kBAAkB,CAAY,EAC5B,KAAK,mBAAmB,IAAI,CAAY,GAAG,OAAS,QAE5D,IAAK,QAAS,CAAuB,EAAa,CACjD,IAAM,EAAW,KAAK,mBAAmB,IAAI,CAAY,GAAG,MAC5D,GAAI,IAAa,EAChB,KAAK,mBAAmB,IAAI,EAAc,IAAK,EAAiB,MAAO,CAAS,CAAC,EACjF,EAAqB,CAAQ,EAC7B,KAAK,aAAa,EAAc,EAAU,CAAQ,GAGpD,WAAY,GACZ,aAAc,EACf,CAAC,EAEG,IAAiB,OACpB,eAAe,IAAM,CACpB,IAAM,EAAe,KAAK,mBAAmB,IAAI,CAAY,GAAG,MAChE,GAAI,IAAiB,OACpB,OAGD,EAAqB,CAAY,EACjC,KAAK,aAAa,EAAc,OAAW,CAAY,EACvD,EAGJ,CAEA,SAAS,CAAwB,CAAC,EAA6C,CAC9E,OAAO,OAAO,IAAU,UAAY,IAAU,MAAQ,OAAQ,EAA4B,MAAQ",
8
- "debugId": "C55FCA1B9513CFE664756E2164756E21",
8
+ "debugId": "E825FDA4BDC6619564756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -0,0 +1,4 @@
1
+ var a=Symbol.for("@ecopages/radiant.hydrator-installed");function b(){globalThis[a]=!0}function c(){delete globalThis[a]}function d(){return globalThis[a]===!0}
2
+ export{b as Qa,c as Ra,d as Sa};
3
+
4
+ //# debugId=FBA0BA95E617859164756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/core/radiant-hydrator-state.ts"],
4
+ "sourcesContent": [
5
+ "const RADIANT_HYDRATOR_INSTALLED_SYMBOL = Symbol.for('@ecopages/radiant.hydrator-installed');\n\ntype GlobalHydratorState = typeof globalThis & Record<PropertyKey, unknown>;\n\n/**\n * Marks the current JavaScript environment as hydration-enabled for first\n * custom-element connect.\n *\n * `RadiantComponent` reads this flag before deciding whether SSR markup should\n * hydrate in place or be replaced by a fresh client render.\n */\nexport function installRadiantHydratorState(): void {\n\t(globalThis as GlobalHydratorState)[RADIANT_HYDRATOR_INSTALLED_SYMBOL] = true;\n}\n\n/**\n * Clears the explicit hydration-enabled flag from `globalThis`.\n *\n * This is mainly used by tests so they can assert both hydrated and non-\n * hydrated first-connect behavior deterministically.\n */\nexport function uninstallRadiantHydratorState(): void {\n\tdelete (globalThis as GlobalHydratorState)[RADIANT_HYDRATOR_INSTALLED_SYMBOL];\n}\n\n/**\n * Returns whether first-connect hydration is currently enabled for this\n * JavaScript environment.\n */\nexport function isRadiantHydratorInstalled(): boolean {\n\treturn (globalThis as GlobalHydratorState)[RADIANT_HYDRATOR_INSTALLED_SYMBOL] === true;\n}\n"
6
+ ],
7
+ "mappings": "AAAA,IAAM,EAAoC,OAAO,IAAI,sCAAsC,EAWpF,SAAS,CAA2B,EAAS,CAClD,WAAmC,GAAqC,GASnE,SAAS,CAA6B,EAAS,CACrD,OAAQ,WAAmC,GAOrC,SAAS,CAA0B,EAAY,CACrD,OAAQ,WAAmC,KAAuC",
8
+ "debugId": "FBA0BA95E617859164756E2164756E21",
9
+ "names": []
10
+ }
@@ -1,4 +1,4 @@
1
- import{qb as o}from"./chunk-13ydx769.js";function d(n){return(c,u,t)=>{let i=t.value,r=new WeakMap;return t.value=function(...a){let e=r.get(this);if(!e)e=o((...p)=>{return i.apply(this,p)},n),r.set(this,e);e(...a)},t}}
2
- export{d as Aa};
1
+ import{zb as o}from"./chunk-wd23rn4q.js";function d(n){return(c,u,t)=>{let i=t.value,r=new WeakMap;return t.value=function(...a){let e=r.get(this);if(!e)e=o((...p)=>{return i.apply(this,p)},n),r.set(this,e);e(...a)},t}}
2
+ export{d as ka};
3
3
 
4
- //# debugId=AFD1D9E6D220D0D464756E2164756E21
4
+ //# debugId=DC8D7CC44F15D92164756E2164756E21
@@ -5,6 +5,6 @@
5
5
  "import type { RadiantElement } from '../../core/radiant-element';\nimport { debounce as debounceFunction } from '../../helpers/debounce';\n\nexport function debounce(\n\ttimeout: number,\n): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor {\n\treturn (_target: RadiantElement, _propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor => {\n\t\tconst originalMethod = descriptor.value;\n\t\tconst debouncedByInstance = new WeakMap<object, ReturnType<typeof debounceFunction<typeof originalMethod>>>();\n\n\t\tdescriptor.value = function debounce(this: object, ...args: Parameters<typeof originalMethod>) {\n\t\t\tlet debounced = debouncedByInstance.get(this);\n\n\t\t\tif (!debounced) {\n\t\t\t\tdebounced = debounceFunction((...innerArgs: Parameters<typeof originalMethod>) => {\n\t\t\t\t\treturn originalMethod.apply(this, innerArgs);\n\t\t\t\t}, timeout);\n\t\t\t\tdebouncedByInstance.set(this, debounced);\n\t\t\t}\n\n\t\t\tdebounced(...args);\n\t\t};\n\n\t\treturn descriptor;\n\t};\n}\n"
6
6
  ],
7
7
  "mappings": "yCAGO,SAAS,CAAQ,CACvB,EAC2F,CAC3F,MAAO,CAAC,EAAyB,EAAsB,IAAuD,CAC7G,IAAM,EAAiB,EAAW,MAC5B,EAAsB,IAAI,QAehC,OAbA,EAAW,MAAQ,QAAiB,IAAkB,EAAyC,CAC9F,IAAI,EAAY,EAAoB,IAAI,IAAI,EAE5C,GAAI,CAAC,EACJ,EAAY,EAAiB,IAAI,IAAiD,CACjF,OAAO,EAAe,MAAM,KAAM,CAAS,GACzC,CAAO,EACV,EAAoB,IAAI,KAAM,CAAS,EAGxC,EAAU,GAAG,CAAI,GAGX",
8
- "debugId": "AFD1D9E6D220D0D464756E2164756E21",
8
+ "debugId": "DC8D7CC44F15D92164756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,4 +1,4 @@
1
- import{nb as j}from"./chunk-8n2dhx28.js";var X="data-hydration",w="data-hydration-type",V="data-hydration-key";function W(q){let z=q.hydrationKey?` ${V}="${F(q.hydrationKey)}"`:"";return`<script type="application/json" ${X} ${w}="${q.type}"${z}>${q.serializedValue}</script>`}function P(q){return j(q)}function C(q,z){let G=q.textContent;if(!G)return z;try{return JSON.parse(G)}catch{if(typeof console<"u")console.warn(`[@ecopages/radiant] Failed to parse hydration payload from <script ${X}>:`,G.slice(0,120));return z}}function S(q,z,G){let M=q.children;if(!M||M.length===0){let L=q.childNodes;if(!L||L.length===0)return null;for(let Q=0;Q<L.length;Q+=1){let Z=L[Q];if(Z.nodeType!==1)continue;let $=Z;if(g($,z,G))return $}return null}for(let L=0;L<M.length;L+=1)if(g(M[L],z,G))return M[L];return null}function g(q,z,G){if(q.tagName!=="SCRIPT"||!q.hasAttribute(X)||q.getAttribute(w)!==z)return!1;if(G!==void 0)return q.getAttribute(V)===G;return!q.hasAttribute(V)}function F(q){return q.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
2
- export{X as gb,w as hb,V as ib,W as jb,P as kb,C as lb,S as mb};
1
+ import{wb as j}from"./chunk-nssj2x13.js";var X="data-hydration",w="data-hydration-type",V="data-hydration-key";function W(q){let z=q.hydrationKey?` ${V}="${F(q.hydrationKey)}"`:"";return`<script type="application/json" ${X} ${w}="${q.type}"${z}>${q.serializedValue}</script>`}function P(q){return j(q)}function C(q,z){let G=q.textContent;if(!G)return z;try{return JSON.parse(G)}catch{if(typeof console<"u")console.warn(`[@ecopages/radiant] Failed to parse hydration payload from <script ${X}>:`,G.slice(0,120));return z}}function S(q,z,G){let M=q.children;if(!M||M.length===0){let L=q.childNodes;if(!L||L.length===0)return null;for(let Q=0;Q<L.length;Q+=1){let Z=L[Q];if(Z.nodeType!==1)continue;let $=Z;if(g($,z,G))return $}return null}for(let L=0;L<M.length;L+=1)if(g(M[L],z,G))return M[L];return null}function g(q,z,G){if(q.tagName!=="SCRIPT"||!q.hasAttribute(X)||q.getAttribute(w)!==z)return!1;if(G!==void 0)return q.getAttribute(V)===G;return!q.hasAttribute(V)}function F(q){return q.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
2
+ export{X as pb,w as qb,V as rb,W as sb,P as tb,C as ub,S as vb};
3
3
 
4
- //# debugId=C37C424DD167983864756E2164756E21
4
+ //# debugId=A274AAF950CB806764756E2164756E21
@@ -5,6 +5,6 @@
5
5
  "import { escapeScriptJson } from '../tools/escape-script-json';\n\n/** Attribute marker used to identify hydration payloads inside a host. */\nexport const HYDRATION_ATTRIBUTE = 'data-hydration';\n/** Discriminator that scopes a hydration payload to a specific feature. */\nexport const HYDRATION_TYPE_ATTRIBUTE = 'data-hydration-type';\n/** Optional key that scopes a hydration payload to a specific decorated field. */\nexport const HYDRATION_KEY_ATTRIBUTE = 'data-hydration-key';\n\nexport type HydrationPayloadType = 'signal' | 'context';\n\n/** Creates a `<script type=\"application/json\">` tag for a hydration payload. */\nexport function createHydrationScriptTag(options: {\n\ttype: HydrationPayloadType;\n\thydrationKey?: string;\n\tserializedValue: string;\n}): string {\n\tconst keyAttribute = options.hydrationKey\n\t\t? ` ${HYDRATION_KEY_ATTRIBUTE}=\"${escapeHtmlAttribute(options.hydrationKey)}\"`\n\t\t: '';\n\n\treturn `<script type=\"application/json\" ${HYDRATION_ATTRIBUTE} ${HYDRATION_TYPE_ATTRIBUTE}=\"${options.type}\"${keyAttribute}>${options.serializedValue}</script>`;\n}\n\n/** Escapes serialized JSON so it remains safe inside an HTML script tag. */\nexport function escapeHydrationJson(value: string): string {\n\treturn escapeScriptJson(value);\n}\n\n/** Parses JSON from a hydration script element, returning the fallback on failure. */\nexport function parseHydrationPayload<T>(element: Element, fallback: T): T {\n\tconst textContent = element.textContent;\n\n\tif (!textContent) {\n\t\treturn fallback;\n\t}\n\n\ttry {\n\t\treturn JSON.parse(textContent) as T;\n\t} catch {\n\t\tif (typeof console !== 'undefined') {\n\t\t\tconsole.warn(\n\t\t\t\t`[@ecopages/radiant] Failed to parse hydration payload from <script ${HYDRATION_ATTRIBUTE}>:`,\n\t\t\t\ttextContent.slice(0, 120),\n\t\t\t);\n\t\t}\n\t\treturn fallback;\n\t}\n}\n\n/**\n * Finds a hydration script element inside a host by type and optional key.\n *\n * When a key is provided, looks for an exact `data-hydration-key` match.\n * Otherwise, returns the first unkeyed script matching the type.\n */\nexport function findHydrationScript(host: Element, type: HydrationPayloadType, hydrationKey?: string): Element | null {\n\tconst children = host.children;\n\n\tif (!children || children.length === 0) {\n\t\tconst childNodes = (host as Partial<{ childNodes: ArrayLike<{ nodeType: number }> }>).childNodes;\n\n\t\tif (!childNodes || childNodes.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tfor (let i = 0; i < childNodes.length; i += 1) {\n\t\t\tconst node = childNodes[i]!;\n\n\t\t\tif (node.nodeType !== 1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst element = node as unknown as Element;\n\n\t\t\tif (matchesHydrationScript(element, type, hydrationKey)) {\n\t\t\t\treturn element;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tfor (let i = 0; i < children.length; i += 1) {\n\t\tif (matchesHydrationScript(children[i]!, type, hydrationKey)) {\n\t\t\treturn children[i]!;\n\t\t}\n\t}\n\n\treturn null;\n}\n\nfunction matchesHydrationScript(element: Element, type: HydrationPayloadType, hydrationKey?: string): boolean {\n\tif (\n\t\telement.tagName !== 'SCRIPT' ||\n\t\t!element.hasAttribute(HYDRATION_ATTRIBUTE) ||\n\t\telement.getAttribute(HYDRATION_TYPE_ATTRIBUTE) !== type\n\t) {\n\t\treturn false;\n\t}\n\n\tif (hydrationKey !== undefined) {\n\t\treturn element.getAttribute(HYDRATION_KEY_ATTRIBUTE) === hydrationKey;\n\t}\n\n\treturn !element.hasAttribute(HYDRATION_K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,EAAgC,CAC7G,GACC,EAAQ,UAAY,UACpB,CAAC,EAAQ,aAAa,CAAmB,GACzC,EAAQ,aAAa,CAAwB,IAAM,EAEnD,MAAO,GAGR,GAAI,IAAiB,OACpB,OAAO,EAAQ,aAAa,CAAuB,IAAM,EAG1D,MAAO,CAAC,EAAQ,aAAa,CAAuB,EAGrD,SAAS,CAAmB,CAAC,EAAuB,CACnD,OAAO,EAAM,QAAQ,KAAM,OAAO,EAAE,QAAQ,KAAM,QAAQ,EAAE,QAAQ,KAAM,MAAM,EAAE,QAAQ,KAAM,MAAM",
8
- "debugId": "C37C424DD167983864756E2164756E21",
8
+ "debugId": "A274AAF950CB806764756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -0,0 +1,4 @@
1
+ var Q=Symbol("radiant.shadowRootListenerHooks"),Y=Symbol("radiant.patchedAttachShadow");function Z(x,j,z,B){let I=(G)=>{if(G.target instanceof Element&&G.target.matches(z))B(G)};return x.addEventListener(j.type,I,j.options),()=>{x.removeEventListener(j.type,I,j.options)}}function _(x,j){let z=x;if(!z[Q])z[Q]=new Set;if(z[Q].add(j),z[Y])return;let B=x.attachShadow;x.attachShadow=function(G){let N=B.call(this,G);for(let P of z[Q]??[])P();return N},z[Y]=!0}function $(x,j,z){let B=z.bind(x),I=null,G=null,N=null,P=null,V=!1,W=()=>{I?.(),G?.(),N?.(),P?.(),I=null,G=null,N=null,P=null},U=()=>{if(V)return;if("window"in j&&!I)window.addEventListener(j.type,B,j.options),I=()=>{window.removeEventListener(j.type,B,j.options)};if("document"in j&&!G)document.addEventListener(j.type,B,j.options),G=()=>{document.removeEventListener(j.type,B,j.options)};if("selector"in j||"ref"in j){let X="selector"in j?j.selector:`[data-ref='${CSS.escape(j.ref)}']`;if(j.scope!=="shadow"&&!N)N=Z(x,j,X,B);if(j.scope!=="light"&&x.shadowRoot&&!P)P=Z(x.shadowRoot,j,X,B)}};if("selector"in j||"ref"in j){if(j.scope!=="light")_(x,()=>{if(x.isConnected)U()})}if(x.registerConnectedCallback(U),x.registerCleanupCallback(W),x.isConnected)U();return()=>{V=!0,W()}}
2
+ export{$ as Cb};
3
+
4
+ //# debugId=DB4D49CB458BEF8364756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/helpers/create-event-listener.ts"],
4
+ "sourcesContent": [
5
+ "import type { RadiantElement } from '../core/radiant-element';\nimport type { RadiantElementEventListener } from '../core/radiant-element';\n\n/**\n * Selects which DOM tree delegated event listeners should observe.\n */\nexport type OnEventScope = 'light' | 'shadow' | 'both';\n\ntype BaseOnEventConfig = Pick<RadiantElementEventListener, 'type' | 'options'> & {\n\tscope?: OnEventScope;\n};\n\nexport type OnEventConfig = BaseOnEventConfig &\n\t(\n\t\t| {\n\t\t\t\tselector: string;\n\t\t }\n\t\t| {\n\t\t\t\tref: string;\n\t\t }\n\t\t| {\n\t\t\t\twindow: true;\n\t\t }\n\t\t| {\n\t\t\t\tdocument: true;\n\t\t }\n\t);\n\ntype DelegatedEventRoot = HTMLElement | ShadowRoot;\n\nconst shadowRootListenerHooksKey = Symbol('radiant.shadowRootListenerHooks');\nconst patchedAttachShadowKey = Symbol('radiant.patchedAttachShadow');\n\ntype ShadowRootHookHost = RadiantElement & {\n\t[patchedAttachShadowKey]?: true;\n\t[shadowRootListenerHooksKey]?: Set<() => void>;\n};\n\nfunction addDelegatedListener(\n\troot: DelegatedEventRoot,\n\tconfig: Pick<OnEventConfig, 'type' | 'options'>,\n\tselector: string,\n\tlistener: EventListener,\n): () => void {\n\tconst delegatedListener = (event: Event) => {\n\t\tif (event.target instanceof Element && event.target.matches(selector)) {\n\t\t\tlistener(event);\n\t\t}\n\t};\n\n\troot.addEventListener(config.type, delegatedListener, config.options);\n\n\treturn () => {\n\t\troot.removeEventListener(config.type, delegatedListener, config.options);\n\t};\n}\n\nfunction registerShadowRootHook(host: RadiantElement, hook: () => void): void {\n\tconst shadowAwareHost = host as ShadowRootHookHost;\n\n\tif (!shadowAwareHost[shadowRootListenerHooksKey]) {\n\t\tshadowAwareHost[shadowRootListenerHooksKey] = new Set();\n\t}\n\n\tshadowAwareHost[shadowRootListenerHooksKey].add(hook);\n\n\tif (shadowAwareHost[patchedAttachShadowKey]) {\n\t\treturn;\n\t}\n\n\tconst originalAttachShadow = host.attachShadow;\n\n\thost.attachShadow = function patchedAttachShadow(init: ShadowRootInit): ShadowRoot {\n\t\tconst shadowRoot = originalAttachShadow.call(this, init);\n\t\tfor (const shadowRootHook of shadowAwareHost[shadowRootListenerHooksKey] ?? []) {\n\t\t\tshadowRootHook();\n\t\t}\n\t\treturn shadowRoot;\n\t};\n\n\tshadowAwareHost[patchedAttachShadowKey] = true;\n}\n\n/**\n * Subscribes to a DOM event with delegation, window, or document targeting.\n * Functional equivalent of the `@onEvent` decorator for vanilla JS usage.\n * Returns a cleanup function to remove the listener.\n * @param host The host RadiantElement.\n * @param config The event listener configuration.\n * @param callback The event handler function.\n */\nexport function createEventListener(\n\thost: RadiantElement,\n\tconfig: OnEventConfig,\n\tcallback: (event: Event) => void,\n): () => void {\n\tconst boundCallback = callback.bind(host);\n\tlet windowCleanup: (() => void) | null = null;\n\tlet documentCleanup: (() => void) | null = null;\n\tlet lightCleanup: (() => void) | null = null;\n\tlet shadowCleanup: (() => void) | null = null;\n\tlet disposed = false;\n\n\tconst detachListeners = () => {\n\t\twindowCleanup?.();\n\t\tdocumentCleanup?.();\n\t\tlightCleanup?.();\n\t\tshadowCleanup?.();\n\n\t\twindowCleanup = null;\n\t\tdocumentCleanup = null;\n\t\tlightCleanup = null;\n\t\tshadowCleanup = null;\n\t};\n\n\tconst attachListeners = () => {\n\t\tif (disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ('window' in config && !windowCleanup) {\n\t\t\twindow.addEventListener(config.type, boundCallback, config.options);\n\t\t\twindowCleanup = () => {\n\t\t\t\twindow.removeEventListener(config.type, boundCallback, config.options);\n\t\t\t};\n\t\t}\n\n\t\tif ('document' in config && !documentCleanup) {\n\t\t\tdocument.addEventListener(config.type, boundCallback, config.options);\n\t\t\tdocumentCleanup = () => {\n\t\t\t\tdocument.removeEventListener(config.type, boundCallback, config.options);\n\t\t\t};\n\t\t}\n\n\t\tif ('selector' in config || 'ref' in config) {\n\t\t\tconst selector = 'selector' in config ? config.selector : `[data-ref='${CSS.escape(config.ref)}']`;\n\n\t\t\tif (config.scope !== 'shadow' && !lightCleanup) {\n\t\t\t\tlightCleanup = addDelegatedListener(host, config, selector, boundCallback);\n\t\t\t}\n\n\t\t\tif (config.scope !== 'light' && host.shadowRoot && !shadowCleanup) {\n\t\t\t\tshadowCleanup = addDelegatedListener(host.shadowRoot, config, selector, boundCallback);\n\t\t\t}\n\t\t}\n\t};\n\n\tif ('selector' in config || 'ref' in config) {\n\t\tif (config.scope !== 'light') {\n\t\t\tregisterShadowRootHook(host, () => {\n\t\t\t\tif (host.isConnected) {\n\t\t\t\t\tattachListeners();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\thost.registerConnectedCallback(attachListeners);\n\thost.registerCleanupCallback(detachListeners);\n\n\tif (host.isConnected) {\n\t\tattachListeners();\n\t}\n\n\treturn () => {\n\t\tdisposed = true;\n\t\tdetachListeners();\n\t};\n}\n"
6
+ ],
7
+ "mappings": "AA8BA,IAAM,EAA6B,OAAO,iCAAiC,EACrE,EAAyB,OAAO,6BAA6B,EAOnE,SAAS,CAAoB,CAC5B,EACA,EACA,EACA,EACa,CACb,IAAM,EAAoB,CAAC,IAAiB,CAC3C,GAAI,EAAM,kBAAkB,SAAW,EAAM,OAAO,QAAQ,CAAQ,EACnE,EAAS,CAAK,GAMhB,OAFA,EAAK,iBAAiB,EAAO,KAAM,EAAmB,EAAO,OAAO,EAE7D,IAAM,CACZ,EAAK,oBAAoB,EAAO,KAAM,EAAmB,EAAO,OAAO,GAIzE,SAAS,CAAsB,CAAC,EAAsB,EAAwB,CAC7E,IAAM,EAAkB,EAExB,GAAI,CAAC,EAAgB,GACpB,EAAgB,GAA8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AAM,IAAM,CAClC,GAAI,EAAK,YACR,EAAgB,EAEjB,EAOH,GAHA,EAAK,0BAA0B,CAAe,EAC9C,EAAK,wBAAwB,CAAe,EAExC,EAAK,YACR,EAAgB,EAGjB,MAAO,IAAM,CACZ,EAAW,GACX,EAAgB",
8
+ "debugId": "DB4D49CB458BEF8364756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ import{Ma as f}from"./chunk-cnyxrh9r.js";function k(h,d){f(h,(b)=>{b.registerConnectedCallback(()=>{b.createReactiveField(d,b[d],{bind:b.shouldAutoBindReactiveMembers?.()??!1})})})}
2
+ export{k as Ka};
3
+
4
+ //# debugId=2E4613E2DB32C17264756E2164756E21
@@ -5,6 +5,6 @@
5
5
  "import type { RadiantElement } from '../../core/radiant-element';\nimport { registerLegacyInstanceInitializer } from './instance-initializers';\n\n/**\n * A decorator to define a reactive field.\n * Every time the property changes, the `updated` method will be called.\n * Due the fact the value is always undefined before the first update,\n * we are adding a `isDefined` WeakSet to track if the property has been defined.\n * @param target The target element.\n * @param propertyKey The property key.\n */\nexport function reactiveField(target: RadiantElement, propertyKey: string) {\n\tregisterLegacyInstanceInitializer(target, (element) => {\n\t\telement.registerConnectedCallback(() => {\n\t\t\telement.createReactiveField(propertyKey, element[propertyKey as keyof typeof element], {\n\t\t\t\tbind:\n\t\t\t\t\t(\n\t\t\t\t\t\telement as unknown as { shouldAutoBindReactiveMembers?: () => boolean }\n\t\t\t\t\t).shouldAutoBindReactiveMembers?.() ?? false,\n\t\t\t});\n\t\t});\n\t});\n}\n"
6
6
  ],
7
7
  "mappings": "yCAWO,SAAS,CAAa,CAAC,EAAwB,EAAqB,CAC1E,EAAkC,EAAQ,CAAC,IAAY,CACtD,EAAQ,0BAA0B,IAAM,CACvC,EAAQ,oBAAoB,EAAa,EAAQ,GAAsC,CACtF,KAEE,EACC,gCAAgC,GAAK,EACzC,CAAC,EACD,EACD",
8
- "debugId": "D7248CDCD58824E864756E2164756E21",
8
+ "debugId": "2E4613E2DB32C17264756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,4 +1,4 @@
1
1
  var e=Symbol.for("@ecopages/radiant.customElementTagName");function n(t,o){t[e]=o}function s(t){return t[e]}
2
- export{e as Wa,n as Xa,s as Ya};
2
+ export{e as Va,n as Wa,s as Xa};
3
3
 
4
- //# debugId=F8D5F842D8F7D14264756E2164756E21
4
+ //# debugId=DF04F4DED5A8A34364756E2164756E21