@ecopages/radiant 0.3.0-beta.2 → 0.3.0-beta.3

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 (302) hide show
  1. package/README.md +11 -7
  2. package/client/app-bootstrap.js +2 -2
  3. package/client/app-bootstrap.js.map +2 -2
  4. package/client/hydrator.js +2 -2
  5. package/client/hydrator.js.map +2 -2
  6. package/client/install-hydrator.js +2 -2
  7. package/client/install-hydrator.js.map +2 -2
  8. package/context/context-consumer-bootstrap.js +2 -2
  9. package/context/context-consumer-bootstrap.js.map +4 -4
  10. package/context/context-consumer-runtime.js +2 -2
  11. package/context/context-consumer-runtime.js.map +4 -4
  12. package/context/context-host.js +2 -2
  13. package/context/context-host.js.map +2 -2
  14. package/context/context-provider.js +2 -2
  15. package/context/context-provider.js.map +2 -2
  16. package/context/context-ssr-bridge.d.ts +1 -1
  17. package/context/context-ssr-bridge.js +2 -2
  18. package/context/context-ssr-bridge.js.map +3 -3
  19. package/context/create-context.js +2 -2
  20. package/context/create-context.js.map +2 -2
  21. package/context/decorators/consume-context.js +2 -2
  22. package/context/decorators/consume-context.js.map +4 -4
  23. package/context/decorators/context-selection-delivery.js +2 -2
  24. package/context/decorators/context-selection-delivery.js.map +2 -2
  25. package/context/decorators/context-selector.js +2 -2
  26. package/context/decorators/context-selector.js.map +4 -4
  27. package/context/decorators/legacy/consume-context.js +2 -2
  28. package/context/decorators/legacy/consume-context.js.map +4 -4
  29. package/context/decorators/legacy/context-selector-field.js +2 -2
  30. package/context/decorators/legacy/context-selector-field.js.map +4 -4
  31. package/context/decorators/legacy/context-selector.js +2 -2
  32. package/context/decorators/legacy/context-selector.js.map +4 -4
  33. package/context/decorators/legacy/provide-context.js +2 -2
  34. package/context/decorators/legacy/provide-context.js.map +2 -2
  35. package/context/decorators/on-context-update.js +2 -2
  36. package/context/decorators/on-context-update.js.map +4 -4
  37. package/context/decorators/provide-context.js +2 -2
  38. package/context/decorators/provide-context.js.map +2 -2
  39. package/context/decorators/standard/consume-context.js +2 -2
  40. package/context/decorators/standard/consume-context.js.map +4 -4
  41. package/context/decorators/standard/context-selector-field.js +2 -2
  42. package/context/decorators/standard/context-selector-field.js.map +4 -4
  43. package/context/decorators/standard/context-selector.js +2 -2
  44. package/context/decorators/standard/context-selector.js.map +4 -4
  45. package/context/decorators/standard/provide-context.js +2 -2
  46. package/context/decorators/standard/provide-context.js.map +2 -2
  47. package/context/decorators/standard-legacy-dispatch.js +2 -2
  48. package/context/decorators/standard-legacy-dispatch.js.map +2 -2
  49. package/context/events.js +2 -2
  50. package/context/events.js.map +2 -2
  51. package/context/hydration-script.js +2 -2
  52. package/context/hydration-script.js.map +2 -2
  53. package/context/index.js +2 -2
  54. package/context/index.js.map +4 -4
  55. package/controller-registry.js +2 -2
  56. package/controller-registry.js.map +2 -2
  57. package/core/controller-metadata.js +2 -2
  58. package/core/controller-metadata.js.map +2 -2
  59. package/core/custom-element-metadata.js +2 -2
  60. package/core/custom-element-metadata.js.map +2 -2
  61. package/core/event-subscription-registry.js +2 -2
  62. package/core/event-subscription-registry.js.map +2 -2
  63. package/core/host-ssr-registry.js +2 -2
  64. package/core/host-ssr-registry.js.map +2 -2
  65. package/core/hydration-capable-host.js +2 -2
  66. package/core/hydration-capable-host.js.map +2 -2
  67. package/core/hydration-codec.js +2 -2
  68. package/core/hydration-codec.js.map +2 -2
  69. package/core/radiant-controller.js +2 -2
  70. package/core/radiant-controller.js.map +2 -2
  71. package/core/radiant-element-brand.d.ts +2 -0
  72. package/core/radiant-element-brand.js +3 -0
  73. package/core/radiant-element-brand.js.map +10 -0
  74. package/core/radiant-element-ssr-host-source.d.ts +32 -0
  75. package/core/radiant-element-ssr-host-source.js +3 -0
  76. package/core/radiant-element-ssr-host-source.js.map +11 -0
  77. package/core/radiant-element-ssr-host.d.ts +5 -6
  78. package/core/radiant-element-ssr-host.js +1 -2
  79. package/core/radiant-element-ssr-host.js.map +3 -4
  80. package/core/radiant-element-ssr-registry.d.ts +24 -11
  81. package/core/radiant-element-ssr-registry.js +2 -2
  82. package/core/radiant-element-ssr-registry.js.map +3 -3
  83. package/core/radiant-element.d.ts +5 -3
  84. package/core/radiant-element.js +2 -2
  85. package/core/radiant-element.js.map +6 -5
  86. package/core/radiant-hydrator-state.js +2 -2
  87. package/core/radiant-hydrator-state.js.map +2 -2
  88. package/core/reactive-binding-adapter.js +2 -2
  89. package/core/reactive-binding-adapter.js.map +2 -2
  90. package/core/reactive-host.js +2 -2
  91. package/core/reactive-host.js.map +2 -2
  92. package/core/reactive-jsx-value.js +2 -2
  93. package/core/reactive-jsx-value.js.map +2 -2
  94. package/core/reactive-prop-core.js +2 -2
  95. package/core/reactive-prop-core.js.map +2 -2
  96. package/core/reactive-prop-metadata.js +2 -2
  97. package/core/reactive-prop-metadata.js.map +2 -2
  98. package/core/reactive-property-state.js +2 -2
  99. package/core/reactive-property-state.js.map +2 -2
  100. package/core/reactivity-adapter.js +2 -2
  101. package/core/reactivity-adapter.js.map +2 -2
  102. package/core/reactivity-runtime.js +2 -2
  103. package/core/reactivity-runtime.js.map +2 -2
  104. package/core/reactivity-signals.js +2 -2
  105. package/core/reactivity-signals.js.map +2 -2
  106. package/core/render-runtime.js +2 -2
  107. package/core/render-runtime.js.map +2 -2
  108. package/core/render-scheduler.js +2 -2
  109. package/core/render-scheduler.js.map +2 -2
  110. package/core/slot-projection-runtime.js +2 -2
  111. package/core/slot-projection-runtime.js.map +2 -2
  112. package/core/ssr-preparation.js +2 -2
  113. package/core/ssr-preparation.js.map +2 -2
  114. package/decorators/attr.js +2 -2
  115. package/decorators/attr.js.map +2 -2
  116. package/decorators/bound.js +2 -2
  117. package/decorators/bound.js.map +2 -2
  118. package/decorators/bridge.js +2 -2
  119. package/decorators/bridge.js.map +2 -2
  120. package/decorators/controller.js +2 -2
  121. package/decorators/controller.js.map +2 -2
  122. package/decorators/custom-element.js +2 -2
  123. package/decorators/custom-element.js.map +2 -2
  124. package/decorators/debounce.js +2 -2
  125. package/decorators/debounce.js.map +2 -2
  126. package/decorators/event.js +2 -2
  127. package/decorators/event.js.map +2 -2
  128. package/decorators/legacy/attr.js +2 -2
  129. package/decorators/legacy/attr.js.map +2 -2
  130. package/decorators/legacy/bound.js +2 -2
  131. package/decorators/legacy/bound.js.map +2 -2
  132. package/decorators/legacy/custom-element.js +2 -2
  133. package/decorators/legacy/custom-element.js.map +2 -2
  134. package/decorators/legacy/debounce.js +2 -2
  135. package/decorators/legacy/debounce.js.map +2 -2
  136. package/decorators/legacy/event.js +2 -2
  137. package/decorators/legacy/event.js.map +2 -2
  138. package/decorators/legacy/host-readiness.js +2 -2
  139. package/decorators/legacy/host-readiness.js.map +2 -2
  140. package/decorators/legacy/instance-initializers.js +2 -2
  141. package/decorators/legacy/instance-initializers.js.map +2 -2
  142. package/decorators/legacy/member-bootstrap.js +2 -2
  143. package/decorators/legacy/member-bootstrap.js.map +2 -2
  144. package/decorators/legacy/on-event.js +2 -2
  145. package/decorators/legacy/on-event.js.map +2 -2
  146. package/decorators/legacy/on-updated.js +2 -2
  147. package/decorators/legacy/on-updated.js.map +2 -2
  148. package/decorators/legacy/query-slot.js +2 -2
  149. package/decorators/legacy/query-slot.js.map +2 -2
  150. package/decorators/legacy/query.js +2 -2
  151. package/decorators/legacy/query.js.map +2 -2
  152. package/decorators/legacy/reactive-field.js +2 -2
  153. package/decorators/legacy/reactive-field.js.map +2 -2
  154. package/decorators/legacy/reactive-prop.js +2 -2
  155. package/decorators/legacy/reactive-prop.js.map +2 -2
  156. package/decorators/legacy/signal.js +2 -2
  157. package/decorators/legacy/signal.js.map +2 -2
  158. package/decorators/on-event.js +2 -2
  159. package/decorators/on-event.js.map +2 -2
  160. package/decorators/on-updated.js +2 -2
  161. package/decorators/on-updated.js.map +2 -2
  162. package/decorators/prop.js +2 -2
  163. package/decorators/prop.js.map +2 -2
  164. package/decorators/query-slot.js +2 -2
  165. package/decorators/query-slot.js.map +2 -2
  166. package/decorators/query.js +2 -2
  167. package/decorators/query.js.map +2 -2
  168. package/decorators/shared/auto-bind.js +2 -2
  169. package/decorators/shared/auto-bind.js.map +2 -2
  170. package/decorators/shared/reactive-attr.js +2 -2
  171. package/decorators/shared/reactive-attr.js.map +2 -2
  172. package/decorators/signal.js +2 -2
  173. package/decorators/signal.js.map +2 -2
  174. package/decorators/standard/attr.js +2 -2
  175. package/decorators/standard/attr.js.map +2 -2
  176. package/decorators/standard/bound.js +2 -2
  177. package/decorators/standard/bound.js.map +2 -2
  178. package/decorators/standard/custom-element.js +2 -2
  179. package/decorators/standard/custom-element.js.map +2 -2
  180. package/decorators/standard/debounce.js +2 -2
  181. package/decorators/standard/debounce.js.map +2 -2
  182. package/decorators/standard/event.js +2 -2
  183. package/decorators/standard/event.js.map +2 -2
  184. package/decorators/standard/on-event.js +2 -2
  185. package/decorators/standard/on-event.js.map +2 -2
  186. package/decorators/standard/on-updated.js +2 -2
  187. package/decorators/standard/on-updated.js.map +2 -2
  188. package/decorators/standard/query-slot.js +2 -2
  189. package/decorators/standard/query-slot.js.map +2 -2
  190. package/decorators/standard/query.js +2 -2
  191. package/decorators/standard/query.js.map +2 -2
  192. package/decorators/standard/reactive-field.js +2 -2
  193. package/decorators/standard/reactive-field.js.map +2 -2
  194. package/decorators/standard/reactive-prop.js +2 -2
  195. package/decorators/standard/reactive-prop.js.map +2 -2
  196. package/decorators/standard/signal.js +2 -2
  197. package/decorators/standard/signal.js.map +2 -2
  198. package/decorators/state.js +2 -2
  199. package/decorators/state.js.map +2 -2
  200. package/helpers/create-event-listener.js +2 -2
  201. package/helpers/create-event-listener.js.map +2 -2
  202. package/helpers/create-event.js +2 -2
  203. package/helpers/create-event.js.map +2 -2
  204. package/helpers/create-query-slot.js +2 -2
  205. package/helpers/create-query-slot.js.map +2 -2
  206. package/helpers/create-query.js +2 -2
  207. package/helpers/create-query.js.map +2 -2
  208. package/helpers/debounce.js +2 -2
  209. package/helpers/debounce.js.map +2 -2
  210. package/helpers/index.js +2 -2
  211. package/helpers/index.js.map +2 -2
  212. package/index.js +2 -2
  213. package/index.js.map +6 -5
  214. package/package.json +13 -3
  215. package/server/assert-light-dom-ssr.d.ts +10 -0
  216. package/server/assert-light-dom-ssr.js +3 -0
  217. package/server/assert-light-dom-ssr.js.map +10 -0
  218. package/server/context-ssr.d.ts +8 -19
  219. package/server/context-ssr.js +2 -2
  220. package/server/context-ssr.js.map +5 -5
  221. package/server/host-attribute-serialization.js +2 -2
  222. package/server/host-attribute-serialization.js.map +4 -4
  223. package/server/host-script-composition.js +2 -2
  224. package/server/host-script-composition.js.map +2 -2
  225. package/server/html-parser.js +2 -2
  226. package/server/html-parser.js.map +2 -2
  227. package/server/install-light-dom-shim.d.ts +2 -1
  228. package/server/install-light-dom-shim.js +2 -2
  229. package/server/install-light-dom-shim.js.map +9 -8
  230. package/server/install-ssr-runtime.d.ts +8 -0
  231. package/server/install-ssr-runtime.js +3 -0
  232. package/server/install-ssr-runtime.js.map +21 -0
  233. package/server/install-ssr-scope-adapters.d.ts +1 -0
  234. package/server/install-ssr-scope-adapters.js +3 -0
  235. package/server/install-ssr-scope-adapters.js.map +11 -0
  236. package/server/light-dom-shim.js +2 -2
  237. package/server/light-dom-shim.js.map +8 -7
  238. package/server/minimal-dom/dataset.d.ts +2 -0
  239. package/server/minimal-dom/dataset.js +3 -0
  240. package/server/minimal-dom/dataset.js.map +10 -0
  241. package/server/minimal-dom/document.js +2 -2
  242. package/server/minimal-dom/document.js.map +5 -6
  243. package/server/minimal-dom/html.d.ts +1 -2
  244. package/server/minimal-dom/html.js +2 -2
  245. package/server/minimal-dom/html.js.map +6 -5
  246. package/server/minimal-dom/install.d.ts +1 -0
  247. package/server/minimal-dom/install.js +2 -2
  248. package/server/minimal-dom/install.js.map +8 -7
  249. package/server/minimal-dom/nodes.d.ts +9 -0
  250. package/server/minimal-dom/nodes.js +3 -0
  251. package/server/minimal-dom/nodes.js.map +12 -0
  252. package/server/project-root.js +2 -2
  253. package/server/project-root.js.map +4 -5
  254. package/server/radiant-element-ssr-bridge.d.ts +9 -9
  255. package/server/radiant-element-ssr-bridge.js +2 -2
  256. package/server/radiant-element-ssr-bridge.js.map +27 -14
  257. package/server/radiant-element-ssr-extractor.d.ts +5 -1
  258. package/server/radiant-element-ssr-extractor.js +2 -2
  259. package/server/radiant-element-ssr-extractor.js.map +6 -5
  260. package/server/radiant-element-ssr-service.d.ts +4 -1
  261. package/server/radiant-element-ssr-service.js +2 -2
  262. package/server/radiant-element-ssr-service.js.map +15 -12
  263. package/server/radiant-element-ssr.d.ts +1 -1
  264. package/server/radiant-element-ssr.js +2 -2
  265. package/server/radiant-element-ssr.js.map +27 -14
  266. package/server/render-component.d.ts +3 -5
  267. package/server/render-component.js +2 -2
  268. package/server/render-component.js.map +27 -20
  269. package/server/render-controller.d.ts +1 -0
  270. package/server/render-controller.js +2 -2
  271. package/server/render-controller.js.map +30 -23
  272. package/server/render-fragment.js +2 -2
  273. package/server/render-fragment.js.map +2 -2
  274. package/server/slot-projection-html.js +2 -2
  275. package/server/slot-projection-html.js.map +5 -6
  276. package/signals/host-resource.js +2 -2
  277. package/signals/host-resource.js.map +2 -2
  278. package/signals/host-signal.js +2 -2
  279. package/signals/host-signal.js.map +2 -2
  280. package/signals/hydration-script.js +2 -2
  281. package/signals/hydration-script.js.map +2 -2
  282. package/tools/escape-css-identifier.js +2 -2
  283. package/tools/escape-css-identifier.js.map +2 -2
  284. package/tools/escape-script-json.js +2 -2
  285. package/tools/escape-script-json.js.map +2 -2
  286. package/tools/event-emitter.js +2 -2
  287. package/tools/event-emitter.js.map +2 -2
  288. package/tools/index.js +2 -2
  289. package/tools/index.js.map +2 -2
  290. package/tools/render-jsx-template.js +2 -2
  291. package/tools/render-jsx-template.js.map +2 -2
  292. package/types.js +2 -2
  293. package/types.js.map +2 -2
  294. package/utils/attribute-utils.js +2 -2
  295. package/utils/attribute-utils.js.map +2 -2
  296. package/utils/escape-html-attribute.js +2 -2
  297. package/utils/escape-html-attribute.js.map +2 -2
  298. package/utils/index.js +2 -2
  299. package/utils/index.js.map +2 -2
  300. package/server/internal-radiant-host.d.ts +0 -2
  301. package/server/internal-radiant-host.js +0 -3
  302. package/server/internal-radiant-host.js.map +0 -9
@@ -1,3 +1,3 @@
1
- var{defineProperty:F,getOwnPropertyNames:m,getOwnPropertyDescriptor:d}=Object,c=Object.prototype.hasOwnProperty;function p(P){return this[P]}var GP=(P)=>{var D=(U??=new WeakMap).get(P),q;if(D)return D;if(D=F({},"__esModule",{value:!0}),P&&typeof P==="object"||typeof P==="function"){for(var W of m(P))if(!c.call(D,W))F(D,W,{get:p.bind(P,W),enumerable:!(q=d(P,W))||q.enumerable})}return U.set(P,D),D},U;var l=(P)=>P;function u(P,D){this[P]=l.bind(null,D)}var XP=(P,D)=>{for(var q in D)F(P,q,{get:D[q],enumerable:!0,configurable:!0,set:u.bind(D,q)})};var YP=(P,D)=>()=>(P&&(D=P(P=0)),D);var s=((P)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(P,{get:(D,q)=>(typeof require<"u"?require:D)[q]}):P)(function(P){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+P+'" is not supported')});function _(P){return P.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var J=Symbol.for("@ecopages/radiant.reactivePropDefinitions");function KP(P,D,q){let W=P.constructor,Q=W[J]??[];if(Q.some((Z)=>Z.name===D))return;Q.push({name:D,options:q}),W[J]=Q}function j(P){return(P.constructor[J]??[]).slice()}var G=Symbol.for("@ecopages/radiant.legacy-instance-initializers"),X=Symbol.for("@ecopages/radiant.legacy-post-construction-initializers"),o=Symbol.for("@ecopages/radiant.legacy-executed-post-construction-initializers");function IP(P,D){B(P,G,D)}function wP(P,D){B(P,X,D)}function Y(P){i(P,G)}function R(P,D){let q=P;n(P,D,q[o]??=new Set)}function B(P,D,q){let W=P,Q=Object.prototype.hasOwnProperty.call(W,D)?W[D]:void 0;if(Array.isArray(Q)){Q.push(q);return}Object.defineProperty(W,D,{value:[q]})}function i(P,D){r(P,(q)=>{let W=q[D];if(!Array.isArray(W))return;for(let Q of W)Q(P)})}function n(P,D,q){for(let W of K(P)){let Q=W[X];if(!Array.isArray(Q))continue;for(let Z of Q){if(q.has(Z))continue;Z(P,D),q.add(Z)}}}function K(P){let D=[],q=Object.getPrototypeOf(P);while(q&&q!==Object.prototype)D.unshift(q),q=Object.getPrototypeOf(q);return D}function r(P,D){for(let q of K(P))D(q)}function H(P,D){switch(D){case"construct":Y(P);break;case"connect":R(P,"connect");break;case"ssr":R(P,"ssr");break}}function O(P){switch(P){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function a(P){switch(typeof P){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(P))return"array";if(Object.prototype.toString.call(P)==="[object Object]")return"object"}function t(P){switch(P){case Number:return 0;case String:return"";case Boolean:return!1;default:return null}}function e(P){try{return JSON.parse(P)}catch{throw TypeError("Invalid JSON string")}}var PP={array(P){let D=e(P);if(!Array.isArray(D))throw TypeError(`Expected an array but got a value of type "${typeof D}"`);return D},boolean(P){return!(P==="0"||String(P).toLowerCase()==="false")},number(P){return Number(P.replace(/_/g,""))},object(P){let D=JSON.parse(P);if(D===null||typeof D!=="object"||Array.isArray(D))throw TypeError(`expected value of type "object" but instead got value "${P}" of type "${a(D)}"`);return D},string(P){return P}},I={default:E,array:w,object:w};function w(P){return JSON.stringify(P)}function E(P){return`${P}`}function M(P,D){let q=O(D);if(!q)throw TypeError(`[radiant-element] Unknown type "${D}"`);return PP[q](P)}function C(P,D){let q=O(D);if(!q)throw TypeError(`[radiant-element] Unknown type "${D}"`);return(I[q]??I.default??E)(P)}function DP(P){return typeof P==="boolean"}function qP(P){return typeof P==="number"}function WP(P){return typeof P==="string"}function QP(P){return Array.isArray(P)}function ZP(P){return typeof P==="object"&&!Array.isArray(P)&&P!==null}function CP(P,D){switch(P){case Boolean:return DP(D);case Number:return qP(D);case String:return WP(D);case Array:return QP(D);case Object:return ZP(D);default:return!1}}var kP=(P,D,q,W)=>{if(D===Boolean){let Z=P.getAttribute(q);if(Z===null)return W;return Z===""?!0:M(Z,D)}let Q=P.getAttribute(q);return Q!==null?M(Q,D):W??t(D)};var k=Symbol.for("@ecopages/radiant.customElementTagName");function _P(P,D){P[k]=D}function x(P){return P[k]}function L(P){let D={},q=new Set;return FP(P,D,q),JP(P,D,q),RP(P,D),D}function N(P){return Object.entries(P).map(([D,q])=>` ${D}="${_(q)}"`).join("")}function FP(P,D,q){for(let W of P.getReactiveProperties()){let Q=P.getPropertyValue(W.name);if(Q===void 0||Q===null||Q===!1)continue;D[W.attribute]=String(W.converter.toAttribute(Q)),q.add(W.attribute)}}function JP(P,D,q){for(let W of P.getReactivePropDefinitions()){let Q=W.options.attribute??W.name;if(q.has(Q))continue;let Z=P.getPropertyValue(W.name);if(Z===void 0||Z===null||Z===!1)continue;D[Q]=String(C(Z,W.options.type)),q.add(Q)}}function RP(P,D){for(let q of P.getAttributeNames()){let W=P.getAttribute(q);if(W!==null)D[q]=W}}var T=Symbol.for("@ecopages/radiant.ssr-context-provider-resolver");function f(){return globalThis}function z(P){f()[T]=P}function AP(P){return f()[T]?.(P)}var $;function g(){if($!==void 0)return $;try{let{AsyncLocalStorage:P}=(()=>{throw new Error("Cannot require module "+"node:async_hooks");})();return $=new P,$}catch{return $=null,null}}var A=Symbol.for("@ecopages/radiant.ssr-context-fallback-stack");function S(){let P=globalThis;return P[A]??=[],P[A]}function V(P){if(P.length===0)return()=>{return};let D=new Map;for(let Q of P)D.set(Q.getContextKey(),Q);let q=g();if(q){let Q=q.getStore()??[],Z=[...Q,D];return q.enterWith(Z),()=>{q.enterWith(Q)}}let W=S();return W.push(D),()=>{let Q=W.lastIndexOf(D);if(Q>=0)W.splice(Q,1)}}function v(P){let D=g()?.getStore()??S();for(let q=D.length-1;q>=0;q-=1){let W=D[q]?.get(P);if(W)return W}return}function VP(P){let D=v(P);if(!D)return;return D.getContext()}z((P)=>v(P));function b(P,D){if(!D)return`${P.hostContent}${P.authoredHydrationMarkup}${P.slotProjectionScript}`;return`${P.hostContent}${P.slotProjectionScript}${P.hydrationScripts}`}function h(P){if(UP(P))return P;return}function UP(P){return typeof P.constructor==="function"&&typeof P.getAttribute==="function"&&typeof P.getAttributeNames==="function"&&typeof P.getAuthoredHydrationScriptMarkup==="function"&&typeof P.getContextProviders==="function"&&typeof P.getHydrationBindings==="function"&&typeof P.getReactiveProperties==="function"&&typeof P.getSlotProjectionScriptTag==="function"&&typeof P.resolveTrackedRenderOutput==="function"&&typeof P.renderViewToString==="function"}function y(P){let D=h(P);if(!D)throw Error("Radiant SSR runtime requires a server extraction host shape on the component.");return{constructor:D.constructor,getAttribute:(q)=>D.getAttribute(q),getAttributeNames:()=>D.getAttributeNames(),getAuthoredHydrationScriptMarkup:()=>D.getAuthoredHydrationScriptMarkup?.(),getContextProviders:()=>D.getContextProviders(),getHydrationBindings:()=>D.getHydrationBindings(),getReactiveProperties:()=>D.getReactiveProperties(),getReactivePropDefinitions:()=>j(P),getPropertyValue:(q)=>Reflect.get(P,q),getSlotProjectionScriptTag:()=>D.getSlotProjectionScriptTag?.(),resolveTrackedRenderOutput:()=>D.resolveTrackedRenderOutput(),renderViewToString:(q)=>D.renderViewToString(q)}}class jP{component;host;constructor(P){this.component=P,this.host=y(P)}ensureReady(){H(this.component,"ssr")}renderHost(){return this.ensureReady(),{nodeType:1,outerHTML:this.renderHostToString({mode:"hydrate"})}}renderHostToString(P={},D=this.getHostAttributes()){this.ensureReady();let q=this.getTagName(),W=V(this.host.getContextProviders());try{return`<${q}${N(D)}>${this.renderHostContent(P)}</${q}>`}finally{W()}}getHostAttributes(){return this.ensureReady(),L(this.host)}renderHostContent(P){let D=P.mode==="hydrate"||P.mode===void 0&&P.hydrate===!0,q=D?this.host.getHydrationBindings().map((W)=>W.renderHydrationScriptTag()).filter((W)=>typeof W==="string").join(""):"";return b({hostContent:this.host.renderViewToString(P),authoredHydrationMarkup:this.host.getAuthoredHydrationScriptMarkup?.()??"",slotProjectionScript:this.host.getSlotProjectionScriptTag?.()??"",hydrationScripts:q},D)}getTagName(){let P=x(this.host.constructor);if(!P)throw Error(`${this.host.constructor.name} is missing @customElement metadata.`);return P}}export{jP as RadiantElementSsrService};
1
+ function g(q){switch(q){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}var j={default:G,array:B,object:B};function B(q){return JSON.stringify(q)}function G(q){return`${q}`}function U(q,W){let F=g(W);if(!F)throw TypeError(`[radiant-element] Unknown type "${W}"`);return(j[F]??j.default??G)(q)}function Y(q){return q.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function H(q){let W={},F=new Set;return A(q,W,F),V(q,W,F),S(q,W),W}function M(q){return Object.entries(q).map(([W,F])=>` ${W}="${Y(F)}"`).join("")}function A(q,W,F){for(let Q of q.getReactiveProperties()){let X=q.getPropertyValue(Q.name);if(X===void 0||X===null||X===!1)continue;W[Q.attribute]=String(Q.converter.toAttribute(X)),F.add(Q.attribute)}}function V(q,W,F){for(let Q of q.getReactivePropDefinitions()){let X=Q.options.attribute??Q.name;if(F.has(X))continue;let Z=q.getPropertyValue(Q.name);if(Z===void 0||Z===null||Z===!1)continue;W[X]=String(U(Z,Q.options.type)),F.add(X)}}function S(q,W){for(let F of q.getAttributeNames()){let Q=q.getAttribute(F);if(Q!==null)W[F]=Q}}import{getActiveSsrScopeValue as D,withActiveSsrScopeValue as O}from"@ecopages/jsx/server";var v;function P(q){v=q}var $=Symbol.for("@ecopages/radiant.ssr-provider-stack");function Wq(q){if(D($)!==void 0)return q();return O($,[],q)}function x(q,W){if(q.length===0)return W();let F=D($);if(F===void 0)throw Error("SSR context providers require runWithSsrProviderStack(...). Wrap the sync render snapshot at the render boundary.");let Q=new Map;for(let X of q)Q.set(X.getContextKey(),X);return O($,[...F,Q],W)}function E(q){let W=D($);if(!W)return;for(let F=W.length-1;F>=0;F-=1){let Q=W[F]?.get(q);if(Q)return Q}return}function Fq(q){let W=E(q);if(!W)return;return W.getContext()}P((q)=>E(q));function K(q,W){if(!W)return`${q.hostContent}${q.authoredHydrationMarkup}${q.slotProjectionScript}`;return`${q.hostContent}${q.slotProjectionScript}${q.hydrationScripts}`}function L(q){if(q.renderRootMode!=="shadow")return;let W=typeof q.constructor==="function"&&q.constructor.name?q.constructor.name:"RadiantElement";throw Error(`${W} uses renderRootMode "shadow". Radiant SSR is light-DOM only; keep renderRootMode "light" for server rendering, or skip SSR for this host.`)}var b=Symbol.for("@ecopages/radiant.reactivePropDefinitions");function I(q){return(q.constructor[b]??[]).slice()}var k=Symbol.for("@ecopages/radiant.RadiantElement");function w(q){return typeof q==="object"&&q!==null&&k in q}function C(q){if(!w(q))throw Error("Radiant SSR runtime requires a RadiantElement host. Import a Radiant server SSR entrypoint and pass a RadiantElement instance.");return{constructor:q.constructor,renderRootMode:q.renderRootMode,getAttribute:(W)=>q.getAttribute(W),getAttributeNames:()=>q.getAttributeNames(),getAuthoredHydrationScriptMarkup:()=>q.getAuthoredHydrationScriptMarkup(),getContextProviders:()=>q.getContextProviders(),getHydrationBindings:()=>q.getHydrationBindings(),getReactiveProperties:()=>q.getReactiveProperties(),getReactivePropDefinitions:()=>I(q),getPropertyValue:(W)=>Reflect.get(q,W),getSlotProjectionScriptTag:()=>q.getSlotProjectionScriptTag(),resolveTrackedRenderOutput:()=>q.resolveTrackedRenderOutput()}}var y=Symbol.for("@ecopages/radiant.customElementTagName");function f(q){return q[y]}var h=Symbol.for("@ecopages/radiant.ssr-preparation-callbacks"),T=Symbol.for("@ecopages/radiant.ssr-preparation-running");function _(q){let W=q,F=W[h];if(!Array.isArray(F))return;W[T]=!0;try{for(let Q of F)Q()}finally{delete W[T]}}var m=Symbol.for("@ecopages/radiant.legacy-instance-initializers"),d=Symbol.for("@ecopages/radiant.legacy-post-construction-initializers"),c=Symbol.for("@ecopages/radiant.legacy-executed-post-construction-initializers");function N(q){p(q,m)}function J(q,W){let F=q;u(q,W,F[c]??=new Set)}function p(q,W){l(q,(F)=>{let Q=F[W];if(!Array.isArray(Q))return;for(let X of Q)X(q)})}function u(q,W,F){for(let Q of R(q)){let X=Q[d];if(!Array.isArray(X))continue;for(let Z of X){if(F.has(Z))continue;Z(q,W),F.add(Z)}}}function R(q){let W=[],F=Object.getPrototypeOf(q);while(F&&F!==Object.prototype)W.unshift(F),F=Object.getPrototypeOf(F);return W}function l(q,W){for(let F of R(q))W(F)}function z(q,W){switch(W){case"construct":N(q);break;case"connect":J(q,"connect");break;case"ssr":J(q,"ssr");break}}class s{component;host;renderView;constructor(q,W){this.component=q,this.host=C(q),this.renderView=W}ensureReady(){L(this.host),z(this.component,"ssr"),_(this.component)}renderHost(){return this.ensureReady(),{nodeType:1,outerHTML:this.renderHostToString({mode:"hydrate"})}}renderHostToString(q={},W=this.getHostAttributes()){this.ensureReady();let F=this.getTagName();return x(this.host.getContextProviders(),()=>`<${F}${M(W)}>${this.renderHostContent(q)}</${F}>`)}getHostAttributes(){return this.ensureReady(),H(this.host)}renderHostContent(q){let W=q.mode==="hydrate"||q.mode===void 0&&q.hydrate===!0,F=W?this.host.getHydrationBindings().map((Q)=>Q.renderHydrationScriptTag()).filter((Q)=>typeof Q==="string").join(""):"";return K({hostContent:this.renderView(this.host,q),authoredHydrationMarkup:this.host.getAuthoredHydrationScriptMarkup?.()??"",slotProjectionScript:this.host.getSlotProjectionScriptTag?.()??"",hydrationScripts:F},W)}getTagName(){let q=f(this.host.constructor);if(!q)throw Error(`${this.host.constructor.name} is missing @customElement metadata.`);return q}}export{s as RadiantElementSsrService};
2
2
 
3
- //# debugId=FD5B670481765E7264756E2164756E21
3
+ //# debugId=D702E076FD69320D64756E2164756E21
@@ -1,22 +1,25 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/utils/escape-html-attribute.ts", "../src/core/reactive-prop-metadata.ts", "../src/decorators/legacy/instance-initializers.ts", "../src/decorators/legacy/host-readiness.ts", "../src/utils/attribute-utils.ts", "../src/core/custom-element-metadata.ts", "../src/server/host-attribute-serialization.ts", "../src/context/context-ssr-bridge.ts", "../src/server/context-ssr.ts", "../src/server/host-script-composition.ts", "../src/core/radiant-element-ssr-host.ts", "../src/server/radiant-element-ssr-extractor.ts", "../src/server/radiant-element-ssr-service.ts"],
3
+ "sources": ["../src/utils/attribute-utils.ts", "../src/utils/escape-html-attribute.ts", "../src/server/host-attribute-serialization.ts", "../src/server/context-ssr.ts", "../src/context/context-ssr-bridge.ts", "../src/server/host-script-composition.ts", "../src/server/assert-light-dom-ssr.ts", "../src/core/reactive-prop-metadata.ts", "../src/core/radiant-element-brand.ts", "../src/core/radiant-element-ssr-host-source.ts", "../src/server/radiant-element-ssr-extractor.ts", "../src/core/custom-element-metadata.ts", "../src/core/ssr-preparation.ts", "../src/decorators/legacy/instance-initializers.ts", "../src/decorators/legacy/host-readiness.ts", "../src/server/radiant-element-ssr-service.ts"],
4
4
  "sourcesContent": [
5
+ "import type { RadiantElement } from '../core/radiant-element';\n\nexport type AttributeTypeConstant = typeof Array | typeof Boolean | typeof Number | typeof Object | typeof String;\n\nexport type AttributeTypeDefault = Array<unknown> | boolean | number | Record<string, unknown> | string;\n\n/**\n * Parses the given attribute type constant and returns its corresponding string representation.\n *\n * @param constant - The attribute type constant to parse.\n * @returns The string representation of the attribute type constant.\n */\nexport function parseAttributeTypeConstant(constant?: AttributeTypeConstant) {\n\tswitch (constant) {\n\t\tcase Array:\n\t\t\treturn 'array';\n\t\tcase Boolean:\n\t\t\treturn 'boolean';\n\t\tcase Number:\n\t\t\treturn 'number';\n\t\tcase Object:\n\t\t\treturn 'object';\n\t\tcase String:\n\t\t\treturn 'string';\n\t}\n}\n\n/**\n * Parses the attribute type default value and returns its type as a string.\n *\n * @param defaultValue - The default value of the attribute type.\n * @returns The type of the default value as a string.\n */\nexport function parseAttributeTypeDefault(defaultValue?: AttributeTypeDefault) {\n\tswitch (typeof defaultValue) {\n\t\tcase 'boolean':\n\t\t\treturn 'boolean';\n\t\tcase 'number':\n\t\t\treturn 'number';\n\t\tcase 'string':\n\t\t\treturn 'string';\n\t}\n\n\tif (Array.isArray(defaultValue)) return 'array';\n\tif (Object.prototype.toString.call(defaultValue) === '[object Object]') return 'object';\n}\n\n/**\n * Returns the default value for a given attribute type.\n *\n * @param type - The attribute type constant.\n * @returns The default value for the specified attribute type.\n */\nexport function defaultValueForType(type: AttributeTypeConstant): unknown {\n\tswitch (type) {\n\t\tcase Number:\n\t\t\treturn 0;\n\t\tcase String:\n\t\t\treturn '';\n\t\tcase Boolean:\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn null;\n\t}\n}\n\ntype Reader = (value: string) => number | string | boolean | object | unknown[];\n\n/**\n * Utility function to parse a JSON string safely\n */\nfunction parseJSON<T>(value: string): T {\n\ttry {\n\t\treturn JSON.parse(value);\n\t} catch {\n\t\tthrow new TypeError('Invalid JSON string');\n\t}\n}\n\n/**\n * Object that maps attribute types to reader functions.\n * @type {Object.<string, Reader>}\n */\nconst readers: { [type: string]: Reader } = {\n\tarray(value: string): unknown[] {\n\t\tconst array = parseJSON<unknown[]>(value);\n\t\tif (!Array.isArray(array)) {\n\t\t\tthrow new TypeError(`Expected an array but got a value of type \"${typeof array}\"`);\n\t\t}\n\t\treturn array;\n\t},\n\n\tboolean(value: string): boolean {\n\t\treturn !(value === '0' || String(value).toLowerCase() === 'false');\n\t},\n\n\tnumber(value: string): number {\n\t\tconst number = Number(value.replace(/_/g, ''));\n\t\treturn number;\n\t},\n\n\tobject(value: string): object {\n\t\tconst object = JSON.parse(value);\n\t\tif (object === null || typeof object !== 'object' || Array.isArray(object)) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`expected value of type \"object\" but instead got value \"${value}\" of type \"${parseAttributeTypeDefault(\n\t\t\t\t\tobject,\n\t\t\t\t)}\"`,\n\t\t\t);\n\t\t}\n\t\treturn object;\n\t},\n\n\tstring(value: string): string {\n\t\treturn value;\n\t},\n};\n\ntype Writer = (value: unknown) => string;\n\n/**\n * Object that maps attribute types to writer functions.\n * @type {Object.<string, Writer>}\n */\nconst writers: { [type: string]: Writer } = {\n\tdefault: writeString,\n\tarray: writeJSON,\n\tobject: writeJSON,\n};\n\nfunction writeJSON(value: unknown) {\n\treturn JSON.stringify(value);\n}\n\nfunction writeString(value: unknown) {\n\treturn `${value}`;\n}\n\n/**\n * Reads the attribute value based on the provided type.\n * @param value - The attribute value to be read.\n * @param type - The type of the attribute.\n * @returns The parsed attribute value.\n * @throws {TypeError} If the provided type is unknown.\n */\nexport function readAttributeValue(value: string, type: AttributeTypeConstant) {\n\tconst readerType = parseAttributeTypeConstant(type);\n\tif (!readerType) throw new TypeError(`[radiant-element] Unknown type \"${type}\"`);\n\treturn readers[readerType]!(value);\n}\n\nexport type ReadAttributeValueReturnType = ReturnType<typeof readAttributeValue>;\n\n/**\n * Writes the attribute value based on the provided type.\n *\n * @param value - The value to be written.\n * @param type - The type of the attribute.\n * @returns The written attribute value.\n * @throws {TypeError} If the provided type is unknown.\n */\nexport function writeAttributeValue(value: unknown, type: AttributeTypeConstant) {\n\tconst writerType = parseAttributeTypeConstant(type);\n\tif (!writerType) throw new TypeError(`[radiant-element] Unknown type \"${type}\"`);\n\tconst writer: Writer = writers[writerType] ?? writers.default ?? writeString;\n\treturn writer(value);\n}\n\nexport type WriteAttributeValueReturnType = ReturnType<typeof writeAttributeValue>;\n\n/*\n * Type guard functions for each type in AttributeTypeConstant\n */\nfunction isBoolean(value: unknown): value is boolean {\n\treturn typeof value === 'boolean';\n}\n\nfunction isNumber(value: unknown): value is number {\n\treturn typeof value === 'number';\n}\n\nfunction isString(value: unknown): value is string {\n\treturn typeof value === 'string';\n}\n\nfunction isArray(value: unknown): value is Array<unknown> {\n\treturn Array.isArray(value);\n}\n\nfunction isObject(value: unknown): value is object {\n\treturn typeof value === 'object' && !Array.isArray(value) && value !== null;\n}\n\n/*\n * Check function to ensure defaultValue matches the type\n */\nexport function isValueOfType(type: AttributeTypeConstant, defaultValue: unknown): boolean {\n\tswitch (type) {\n\t\tcase Boolean:\n\t\t\treturn isBoolean(defaultValue);\n\t\tcase Number:\n\t\t\treturn isNumber(defaultValue);\n\t\tcase String:\n\t\t\treturn isString(defaultValue);\n\t\tcase Array:\n\t\t\treturn isArray(defaultValue);\n\t\tcase Object:\n\t\t\treturn isObject(defaultValue);\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\nexport const getInitialValue = (\n\ttarget: RadiantElement,\n\ttype: AttributeTypeConstant,\n\tattributeKey: string,\n\tdefaultValue: unknown,\n) => {\n\tif (type === Boolean) {\n\t\tconst attributeValue = target.getAttribute(attributeKey);\n\t\tif (attributeValue === null) {\n\t\t\treturn defaultValue;\n\t\t}\n\n\t\treturn attributeValue === '' ? true : readAttributeValue(attributeValue, type);\n\t}\n\n\tconst attributeValue = target.getAttribute(attributeKey);\n\treturn attributeValue !== null\n\t\t? readAttributeValue(attributeValue, type)\n\t\t: (defaultValue ?? (defaultValueForType(type) as typeof defaultValue));\n};\n",
5
6
  "/** Escapes a string for safe interpolation inside a double-quoted HTML attribute value. */\nexport function escapeHtmlAttribute(value: string): string {\n\treturn value.replace(/&/g, '&amp;').replace(/\"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n}\n",
7
+ "import type { ReactiveProperty } from '../core/reactive-prop-core';\nimport type { ReactivePropDefinition } from '../core/reactive-prop-metadata';\nimport { writeAttributeValue } from '../utils/attribute-utils';\nimport { escapeHtmlAttribute } from '../utils/escape-html-attribute';\n\n/**\n * Minimal host shape needed by the attribute serialization policy.\n *\n * This interface defines the narrow contract that the serialization module\n * consumes, keeping it independent of the full {@link RadiantElementSsrHost}.\n */\nexport type HostAttributeSource = {\n\tgetReactiveProperties: () => ReactiveProperty[];\n\tgetReactivePropDefinitions: () => ReactivePropDefinition[];\n\tgetPropertyValue: (name: string) => unknown;\n\tgetAttributeNames: () => string[];\n\tgetAttribute: (name: string) => string | null;\n};\n\n/**\n * Resolves the final set of SSR host attributes from a Radiant Element Host.\n *\n * ## Source precedence (highest to lowest)\n *\n * 1. **Reactive properties** — legacy attribute reflection via `property.converter`.\n * These are already-registered reactive properties with established converters.\n * Falsy values (`undefined`, `null`, `false`) are omitted.\n *\n * 2. **Reactive prop definitions** — decorator-based definitions. Skipped when the\n * target attribute name was already emitted by source 1 (dedup via `seenAttributes`).\n * Uses `writeAttributeValue` for type-aware conversion.\n *\n * 3. **Authored attributes** — raw host-level attributes from the original markup.\n * These always win if present, regardless of whether sources 1 or 2 already\n * set the same name. This preserves explicit author intent in templates.\n *\n * @param host Host shape providing reactive state and attribute accessors.\n * @returns Flat record of attribute name → serialized value.\n */\nexport function resolveHostAttributes(host: HostAttributeSource): Record<string, string> {\n\tconst attributes: Record<string, string> = {};\n\tconst seenAttributes = new Set<string>();\n\n\tappendReactivePropertyAttributes(host, attributes, seenAttributes);\n\tappendReactivePropDefinitionAttributes(host, attributes, seenAttributes);\n\tappendAuthoredAttributes(host, attributes);\n\n\treturn attributes;\n}\n\n/**\n * Serializes a flat attribute record into an HTML attribute string.\n *\n * Each entry becomes ` name=\"escaped-value\"` with the leading space included.\n * The combined string is safe for direct interpolation into an opening tag.\n *\n * @param attributes Flat attribute record to serialize.\n * @returns HTML attribute string.\n */\nexport function stringifyHostAttributes(attributes: Record<string, string>): string {\n\treturn Object.entries(attributes)\n\t\t.map(([name, value]) => ` ${name}=\"${escapeHtmlAttribute(value)}\"`)\n\t\t.join('');\n}\n\n/**\n * Source 1: Reactive properties with established converters.\n *\n * Falsy runtime values are omitted — they should not appear as attributes\n * in SSR output.\n */\nfunction appendReactivePropertyAttributes(\n\thost: HostAttributeSource,\n\tattributes: Record<string, string>,\n\tseenAttributes: Set<string>,\n): void {\n\tfor (const property of host.getReactiveProperties()) {\n\t\tconst currentValue = host.getPropertyValue(property.name);\n\t\tif (currentValue === undefined || currentValue === null || currentValue === false) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tattributes[property.attribute] = String(property.converter.toAttribute(currentValue));\n\t\tseenAttributes.add(property.attribute);\n\t}\n}\n\n/**\n * Source 2: Decorator-based reactive prop definitions.\n *\n * Skipped when the attribute name was already emitted by source 1, preventing\n * duplicate or conflicting attribute values.\n */\nfunction appendReactivePropDefinitionAttributes(\n\thost: HostAttributeSource,\n\tattributes: Record<string, string>,\n\tseenAttributes: Set<string>,\n): void {\n\tfor (const definition of host.getReactivePropDefinitions()) {\n\t\tconst attributeName = definition.options.attribute ?? definition.name;\n\n\t\tif (seenAttributes.has(attributeName)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst currentValue = host.getPropertyValue(definition.name);\n\n\t\tif (currentValue === undefined || currentValue === null || currentValue === false) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tattributes[attributeName] = String(writeAttributeValue(currentValue, definition.options.type));\n\t\tseenAttributes.add(attributeName);\n\t}\n}\n\n/**\n * Source 3: Authored attributes from the original markup.\n *\n * These always overwrite — when an author explicitly sets an attribute in\n * markup, that intent takes precedence over reactive property reflection.\n */\nfunction appendAuthoredAttributes(host: HostAttributeSource, attributes: Record<string, string>): void {\n\tfor (const attributeName of host.getAttributeNames()) {\n\t\tconst attributeValue = host.getAttribute(attributeName);\n\t\tif (attributeValue !== null) {\n\t\t\tattributes[attributeName] = attributeValue;\n\t\t}\n\t}\n}\n",
8
+ "import { getActiveSsrScopeValue, withActiveSsrScopeValue } from '@ecopages/jsx/server';\nimport type { SsrSerializableContextProvider } from '../context/context-provider';\nimport { installSsrContextProviderResolver } from '../context/context-ssr-bridge';\nimport type { ContextType, UnknownContext } from '../context/types';\n\ntype ProviderFrame = Map<UnknownContext, SsrSerializableContextProvider>;\ntype ProviderStack = readonly ProviderFrame[];\n\nconst SSR_PROVIDER_STACK_KEY = Symbol.for('@ecopages/radiant.ssr-provider-stack');\n\n/**\n * Ensures an SSR provider stack exists on the active JSX SSR render scope.\n * Nested calls reuse the active stack. Call at render boundaries.\n */\nexport function runWithSsrProviderStack<T>(render: () => T): T {\n\tif (getActiveSsrScopeValue<ProviderStack>(SSR_PROVIDER_STACK_KEY) !== undefined) {\n\t\treturn render();\n\t}\n\n\treturn withActiveSsrScopeValue(SSR_PROVIDER_STACK_KEY, [], render);\n}\n\n/**\n * Runs work with one additional provider frame on the active SSR context stack.\n * Requires an active {@link runWithSsrProviderStack} boundary.\n */\nexport function withSsrContextProviders<T>(providers: readonly SsrSerializableContextProvider[], render: () => T): T {\n\tif (providers.length === 0) {\n\t\treturn render();\n\t}\n\n\tconst parent = getActiveSsrScopeValue<ProviderStack>(SSR_PROVIDER_STACK_KEY);\n\n\tif (parent === undefined) {\n\t\tthrow new Error(\n\t\t\t'SSR context providers require runWithSsrProviderStack(...). Wrap the sync render snapshot at the render boundary.',\n\t\t);\n\t}\n\n\tconst frame = new Map<UnknownContext, SsrSerializableContextProvider>();\n\n\tfor (const provider of providers) {\n\t\tframe.set(provider.getContextKey(), provider);\n\t}\n\n\treturn withActiveSsrScopeValue(SSR_PROVIDER_STACK_KEY, [...parent, frame], render);\n}\n\n/** Resolves the nearest SSR-visible provider for a context token (innermost first). */\nexport function resolveSsrContextProvider<T extends UnknownContext>(\n\tcontext: T,\n): SsrSerializableContextProvider | undefined {\n\tconst store = getActiveSsrScopeValue<ProviderStack>(SSR_PROVIDER_STACK_KEY);\n\n\tif (!store) {\n\t\treturn undefined;\n\t}\n\n\tfor (let index = store.length - 1; index >= 0; index -= 1) {\n\t\tconst provider = store[index]?.get(context);\n\n\t\tif (provider) {\n\t\t\treturn provider;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\n/** Resolves the current SSR-visible value for a context token. */\nexport function resolveSsrContextValue<T extends UnknownContext>(context: T): ContextType<T> | undefined {\n\tconst provider = resolveSsrContextProvider(context);\n\n\tif (!provider) {\n\t\treturn undefined;\n\t}\n\n\treturn provider.getContext() as ContextType<T>;\n}\n\ninstallSsrContextProviderResolver((context) => resolveSsrContextProvider(context));\n",
9
+ "import type { SsrSerializableContextProvider } from './context-provider';\nimport type { UnknownContext } from './types';\n\ntype SsrContextProviderResolver = (context: UnknownContext) => SsrSerializableContextProvider | undefined;\n\nlet ssrContextProviderResolver: SsrContextProviderResolver | undefined;\n\n/**\n * Installs the ambient SSR provider resolver used by shared context runtime helpers.\n *\n * Server-side rendering infrastructure owns the actual provider stack storage and\n * publishes a lookup function here so client/runtime code does not need to import\n * server-oriented modules. Module-local: SSR bundlers must resolve one radiant instance.\n */\nexport function installSsrContextProviderResolver(resolver: SsrContextProviderResolver): void {\n\tssrContextProviderResolver = resolver;\n}\n\n/**\n * Resolves an ambient SSR provider when a server render has published one.\n */\nexport function resolveAmbientSsrContextProvider(context: UnknownContext): SsrSerializableContextProvider | undefined {\n\treturn ssrContextProviderResolver?.(context);\n}\n",
10
+ "/**\n * Host script composition for Radiant SSR.\n *\n * This module owns the mode-sensitive ordering and inclusion rules for the\n * script payloads that appear inside a server-rendered Element Host.\n *\n * ## Composition rules\n *\n * | Mode | Order |\n * |-----------|-----------------------------------------------------------------|\n * | `plain` | view content → authored hydration markup → slot projection |\n * | `hydrate` | view content → slot projection → hydration binding scripts |\n *\n * In **plain** mode, authored hydration markup (script tags pre-authored on the\n * host) is preserved because the component may rely on them for standalone\n * behavior. Hydration binding scripts are omitted because there is no client\n * hydrator to consume them.\n *\n * In **hydrate** mode, authored hydration markup is superseded by the formal\n * hydration binding scripts. Slot projection comes before hydration scripts so\n * the client can reconstruct projected content before binding recovery.\n */\n\n/** Individual content parts that make up a server-rendered host's inner HTML. */\nexport type HostContentParts = {\n\t/** The rendered view HTML from `renderViewToString`. */\n\thostContent: string;\n\t/** Authored hydration script markup pre-existing on the host, if any. */\n\tauthoredHydrationMarkup: string;\n\t/** Slot projection JSON payload script tag, if any. */\n\tslotProjectionScript: string;\n\t/** Hydration binding script tags for client-side recovery, if any. */\n\thydrationScripts: string;\n};\n\n/**\n * Assembles the inner HTML of a server-rendered Element Host from its\n * individual content parts, respecting the mode-sensitive ordering rules.\n *\n * @param parts Individual content parts to compose.\n * @param hydrate Whether the output targets client-side hydration.\n * @returns Assembled inner HTML string.\n */\nexport function composeHostContent(parts: HostContentParts, hydrate: boolean): string {\n\tif (!hydrate) {\n\t\treturn `${parts.hostContent}${parts.authoredHydrationMarkup}${parts.slotProjectionScript}`;\n\t}\n\n\treturn `${parts.hostContent}${parts.slotProjectionScript}${parts.hydrationScripts}`;\n}\n",
11
+ "export type LightDomSsrCheckable = {\n\treadonly renderRootMode: unknown;\n\treadonly constructor?: Function;\n};\n\n/**\n * Radiant host SSR is light-DOM only. Shadow-mode hosts render into an open\n * shadow root on the client; the server pipeline does not emit declarative\n * shadow roots and must not silently serialize view HTML as light-DOM children.\n */\nexport function assertLightDomSsrSupported(component: LightDomSsrCheckable): void {\n\tif (component.renderRootMode !== 'shadow') {\n\t\treturn;\n\t}\n\n\tconst name =\n\t\ttypeof component.constructor === 'function' && component.constructor.name\n\t\t\t? component.constructor.name\n\t\t\t: 'RadiantElement';\n\n\tthrow new Error(\n\t\t`${name} uses renderRootMode \"shadow\". Radiant SSR is light-DOM only; keep renderRootMode \"light\" for server rendering, or skip SSR for this host.`,\n\t);\n}\n",
6
12
  "import type { ReactivePropertyOptions } from './reactive-prop-core';\n\nconst REACTIVE_PROP_DEFINITIONS = Symbol.for('@ecopages/radiant.reactivePropDefinitions');\n\nexport type ReactivePropDefinition = {\n\tname: string;\n\toptions: ReactivePropertyOptions<unknown>;\n};\n\ntype RadiantConstructorWithReactiveProps = CustomElementConstructor & {\n\t[REACTIVE_PROP_DEFINITIONS]?: ReactivePropDefinition[];\n};\n\nexport function registerReactivePropDefinition(\n\ttarget: object,\n\tpropertyName: string,\n\toptions: ReactivePropertyOptions<unknown>,\n): void {\n\tconst constructor = target.constructor as RadiantConstructorWithReactiveProps;\n\tconst definitions = constructor[REACTIVE_PROP_DEFINITIONS] ?? [];\n\n\tif (definitions.some((definition) => definition.name === propertyName)) {\n\t\treturn;\n\t}\n\n\tdefinitions.push({ name: propertyName, options });\n\tconstructor[REACTIVE_PROP_DEFINITIONS] = definitions;\n}\n\nexport function getReactivePropDefinitions(target: object): ReactivePropDefinition[] {\n\treturn ((target.constructor as RadiantConstructorWithReactiveProps)[REACTIVE_PROP_DEFINITIONS] ?? []).slice();\n}\n",
13
+ "/** Cross-realm Element Host brand for SSR extraction (survives duplicate package copies). */\nexport const RADIANT_ELEMENT_BRAND = Symbol.for('@ecopages/radiant.RadiantElement');\n",
14
+ "import type { JsxRenderable } from '@ecopages/jsx';\nimport type { SsrSerializableContextProvider } from '../context/context-provider';\nimport type { ReactiveProperty } from './reactive-prop-core';\nimport type { SsrSerializableHydrationBinding } from './ssr-hydration-binding';\nimport { RADIANT_ELEMENT_BRAND } from './radiant-element-brand';\n\n/**\n * Branded Element Host surface read by the server SSR pipeline.\n *\n * Lives in core so client-safe registry types and server extractors share one\n * contract without importing {@link RadiantElement} (HTMLElement at init).\n */\nexport type RadiantElementSsrHostSource = {\n\tconstructor: Function;\n\treadonly renderRootMode: 'light' | 'shadow';\n\tgetAttribute(name: string): string | null;\n\tgetAttributeNames(): string[];\n\tgetAuthoredHydrationScriptMarkup(): string | undefined;\n\tgetContextProviders(): SsrSerializableContextProvider[];\n\tgetHydrationBindings(): SsrSerializableHydrationBinding[];\n\tgetReactiveProperties(): ReactiveProperty[];\n\tgetSlotProjectionScriptTag(): string | undefined;\n\tresolveTrackedRenderOutput(): { containsSlots: boolean; value: JsxRenderable };\n};\n\nexport type BrandedRadiantElementSsrHost = RadiantElementSsrHostSource & {\n\treadonly [RADIANT_ELEMENT_BRAND]: true;\n};\n\nexport type RadiantElementViewRenderSource = Pick<\n\tRadiantElementSsrHostSource,\n\t'resolveTrackedRenderOutput' | 'renderRootMode'\n>;\n\n/** True when the value is a branded Radiant Element Host the server can serialize. */\nexport function isRadiantElementSsrHost(component: unknown): component is BrandedRadiantElementSsrHost {\n\treturn typeof component === 'object' && component !== null && RADIANT_ELEMENT_BRAND in component;\n}\n",
15
+ "import { getReactivePropDefinitions } from '../core/reactive-prop-metadata';\nimport { isRadiantElementSsrHost } from '../core/radiant-element-ssr-host-source';\nimport type { InternalRadiantSsrHost } from '../core/radiant-element-ssr-host';\n/**\n * Builds the private SSR host snapshot from a Radiant Element Host.\n * Extraction stays in the server layer; detection uses {@link RADIANT_ELEMENT_BRAND}.\n */\nexport function toInternalRadiantSsrHost(component: object): InternalRadiantSsrHost {\n\tif (!isRadiantElementSsrHost(component)) {\n\t\tthrow new Error(\n\t\t\t'Radiant SSR runtime requires a RadiantElement host. Import a Radiant server SSR entrypoint and pass a RadiantElement instance.',\n\t\t);\n\t}\n\n\treturn {\n\t\tconstructor: component.constructor as CustomElementConstructor,\n\t\trenderRootMode: component.renderRootMode,\n\t\tgetAttribute: (name) => component.getAttribute(name),\n\t\tgetAttributeNames: () => component.getAttributeNames(),\n\t\tgetAuthoredHydrationScriptMarkup: () => component.getAuthoredHydrationScriptMarkup(),\n\t\tgetContextProviders: () => component.getContextProviders(),\n\t\tgetHydrationBindings: () => component.getHydrationBindings(),\n\t\tgetReactiveProperties: () => component.getReactiveProperties(),\n\t\tgetReactivePropDefinitions: () => getReactivePropDefinitions(component),\n\t\tgetPropertyValue: (name) => Reflect.get(component, name),\n\t\tgetSlotProjectionScriptTag: () => component.getSlotProjectionScriptTag(),\n\t\tresolveTrackedRenderOutput: () => component.resolveTrackedRenderOutput(),\n\t};\n}\n",
16
+ "export const CUSTOM_ELEMENT_TAG_NAME = Symbol.for('@ecopages/radiant.customElementTagName');\n\ntype CustomElementConstructorWithMetadata = CustomElementConstructor & {\n\t[CUSTOM_ELEMENT_TAG_NAME]?: string;\n};\n\n/**\n * Sets the custom element tag name for a given constructor.\n * This is used internally to associate a class with its custom element tag, which is necessary for features like hydration and SSR support.\n * @param target The constructor of the custom element.\n * @param tagName The tag name to associate with the custom element.\n */\nexport function setCustomElementTagName(target: CustomElementConstructor, tagName: string): void {\n\t(target as CustomElementConstructorWithMetadata)[CUSTOM_ELEMENT_TAG_NAME] = tagName;\n}\n\n/**\n * Retrieves the custom element tag name associated with a given constructor.\n * @param target The constructor of the custom element.\n * @returns The tag name associated with the custom element, or `undefined` if not set.\n */\nexport function getCustomElementTagName(target: CustomElementConstructor): string | undefined {\n\treturn (target as CustomElementConstructorWithMetadata)[CUSTOM_ELEMENT_TAG_NAME];\n}\n",
17
+ "type SsrPreparationCallback = () => void;\n\nconst SSR_PREPARATION_CALLBACKS = Symbol.for('@ecopages/radiant.ssr-preparation-callbacks');\nexport const SSR_PREPARATION_RUNNING = Symbol.for('@ecopages/radiant.ssr-preparation-running');\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",
7
18
  "export type LegacyPostConstructionPhase = 'connect' | 'ssr';\n\ntype LegacyInstanceInitializer<T extends object = object> = (instance: T) => void;\ntype LegacyPostConstructionInitializer<T extends object = object> = (\n\tinstance: T,\n\tphase: LegacyPostConstructionPhase,\n) => void;\n\nconst LEGACY_INSTANCE_INITIALIZERS = Symbol.for('@ecopages/radiant.legacy-instance-initializers');\nconst LEGACY_POST_CONSTRUCTION_INITIALIZERS = Symbol.for('@ecopages/radiant.legacy-post-construction-initializers');\nconst LEGACY_EXECUTED_POST_CONSTRUCTION_INITIALIZERS = Symbol.for(\n\t'@ecopages/radiant.legacy-executed-post-construction-initializers',\n);\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<T extends object>(\n\tproto: T,\n\tinitializer: LegacyInstanceInitializer<T>,\n): void {\n\tregisterInitializer(proto, LEGACY_INSTANCE_INITIALIZERS, initializer);\n}\n\n/**\n * Registers post-construction work for a legacy decorator.\n *\n * This phase exists for decorators that eagerly write instance fields. With\n * legacy decorators plus `useDefineForClassFields`, subclass field definition\n * can overwrite values written during the base-class constructor.\n */\nexport function registerLegacyPostConstructionInitializer<T extends object>(\n\tproto: T,\n\tinitializer: LegacyPostConstructionInitializer<T>,\n): void {\n\tregisterInitializer(proto, LEGACY_POST_CONSTRUCTION_INITIALIZERS, initializer);\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<T extends object>(instance: T): void {\n\trunLegacyInitializers(instance, LEGACY_INSTANCE_INITIALIZERS);\n}\n\n/**\n * Runs legacy decorator setup that must happen after subclass field\n * initialization has completed.\n *\n * Each initializer runs at most once per instance even if multiple lifecycle\n * entrypoints call this helper.\n */\nexport function runLegacyPostConstructionInitializers<T extends object>(\n\tinstance: T,\n\tphase: LegacyPostConstructionPhase,\n): void {\n\tconst target = instance as Record<PropertyKey, unknown>;\n\n\trunLegacyPostConstructionInitializersOnPrototypeChain(\n\t\tinstance,\n\t\tphase,\n\t\t(target[LEGACY_EXECUTED_POST_CONSTRUCTION_INITIALIZERS] ??= new Set()) as Set<\n\t\t\tLegacyPostConstructionInitializer<T>\n\t\t>,\n\t);\n}\n\nfunction registerInitializer<T extends object>(\n\tproto: T,\n\tkey: symbol,\n\tinitializer: LegacyInstanceInitializer<T> | LegacyPostConstructionInitializer<T>,\n): void {\n\tconst target = proto as Record<PropertyKey, unknown>;\n\tconst ownInitializers = Object.prototype.hasOwnProperty.call(target, key) ? target[key] : undefined;\n\n\tif (Array.isArray(ownInitializers)) {\n\t\townInitializers.push(initializer);\n\t\treturn;\n\t}\n\n\tObject.defineProperty(target, key, {\n\t\tvalue: [initializer],\n\t});\n}\n\nfunction runLegacyInitializers<T extends object>(instance: T, key: symbol): void {\n\twalkPrototypeChain(instance, (prototype) => {\n\t\tconst initializers = (prototype as Record<PropertyKey, unknown>)[key] as\n\t\t\tLegacyInstanceInitializer<T>[] | undefined;\n\n\t\tif (!Array.isArray(initializers)) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const initializer of initializers) {\n\t\t\tinitializer(instance);\n\t\t}\n\t});\n}\n\nfunction runLegacyPostConstructionInitializersOnPrototypeChain<T extends object>(\n\tinstance: T,\n\tphase: LegacyPostConstructionPhase,\n\texecutedInitializers: Set<LegacyPostConstructionInitializer<T>>,\n): void {\n\tfor (const prototype of collectPrototypeChain(instance)) {\n\t\tconst initializers = (prototype as Record<PropertyKey, unknown>)[LEGACY_POST_CONSTRUCTION_INITIALIZERS] as\n\t\t\tLegacyPostConstructionInitializer<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\tif (executedInitializers.has(initializer)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tinitializer(instance, phase);\n\t\t\texecutedInitializers.add(initializer);\n\t\t}\n\t}\n}\n\nfunction collectPrototypeChain<T extends object>(instance: T): object[] {\n\tconst prototypes: object[] = [];\n\tlet prototype: object | null = Object.getPrototypeOf(instance);\n\n\twhile (prototype && prototype !== Object.prototype) {\n\t\tprototypes.unshift(prototype);\n\t\tprototype = Object.getPrototypeOf(prototype);\n\t}\n\n\treturn prototypes;\n}\n\nfunction walkPrototypeChain<T extends object>(instance: T, visit: (prototype: object) => void): void {\n\tfor (const prototype of collectPrototypeChain(instance)) {\n\t\tvisit(prototype);\n\t}\n}\n",
8
19
  "import { runLegacyInstanceInitializers, runLegacyPostConstructionInitializers } from './instance-initializers';\n\nexport type LegacyHostReadinessPhase = 'construct' | 'connect' | 'ssr';\n\n/**\n * Runs legacy decorator initialization for the requested lifecycle phase.\n *\n * Post-construction work is idempotent — multiple calls with `connect` or `ssr`\n * only execute each registered initializer once per instance.\n */\nexport function ensureLegacyHostReady<T extends object>(host: T, phase: LegacyHostReadinessPhase): void {\n\tswitch (phase) {\n\t\tcase 'construct':\n\t\t\trunLegacyInstanceInitializers(host);\n\t\t\tbreak;\n\t\tcase 'connect':\n\t\t\trunLegacyPostConstructionInitializers(host, 'connect');\n\t\t\tbreak;\n\t\tcase 'ssr':\n\t\t\trunLegacyPostConstructionInitializers(host, 'ssr');\n\t\t\tbreak;\n\t}\n}\n",
9
- "import type { RadiantElement } from '../core/radiant-element';\n\nexport type AttributeTypeConstant = typeof Array | typeof Boolean | typeof Number | typeof Object | typeof String;\n\nexport type AttributeTypeDefault = Array<unknown> | boolean | number | Record<string, unknown> | string;\n\n/**\n * Parses the given attribute type constant and returns its corresponding string representation.\n *\n * @param constant - The attribute type constant to parse.\n * @returns The string representation of the attribute type constant.\n */\nexport function parseAttributeTypeConstant(constant?: AttributeTypeConstant) {\n\tswitch (constant) {\n\t\tcase Array:\n\t\t\treturn 'array';\n\t\tcase Boolean:\n\t\t\treturn 'boolean';\n\t\tcase Number:\n\t\t\treturn 'number';\n\t\tcase Object:\n\t\t\treturn 'object';\n\t\tcase String:\n\t\t\treturn 'string';\n\t}\n}\n\n/**\n * Parses the attribute type default value and returns its type as a string.\n *\n * @param defaultValue - The default value of the attribute type.\n * @returns The type of the default value as a string.\n */\nexport function parseAttributeTypeDefault(defaultValue?: AttributeTypeDefault) {\n\tswitch (typeof defaultValue) {\n\t\tcase 'boolean':\n\t\t\treturn 'boolean';\n\t\tcase 'number':\n\t\t\treturn 'number';\n\t\tcase 'string':\n\t\t\treturn 'string';\n\t}\n\n\tif (Array.isArray(defaultValue)) return 'array';\n\tif (Object.prototype.toString.call(defaultValue) === '[object Object]') return 'object';\n}\n\n/**\n * Returns the default value for a given attribute type.\n *\n * @param type - The attribute type constant.\n * @returns The default value for the specified attribute type.\n */\nexport function defaultValueForType(type: AttributeTypeConstant): unknown {\n\tswitch (type) {\n\t\tcase Number:\n\t\t\treturn 0;\n\t\tcase String:\n\t\t\treturn '';\n\t\tcase Boolean:\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn null;\n\t}\n}\n\ntype Reader = (value: string) => number | string | boolean | object | unknown[];\n\n/**\n * Utility function to parse a JSON string safely\n */\nfunction parseJSON<T>(value: string): T {\n\ttry {\n\t\treturn JSON.parse(value);\n\t} catch {\n\t\tthrow new TypeError('Invalid JSON string');\n\t}\n}\n\n/**\n * Object that maps attribute types to reader functions.\n * @type {Object.<string, Reader>}\n */\nconst readers: { [type: string]: Reader } = {\n\tarray(value: string): unknown[] {\n\t\tconst array = parseJSON<unknown[]>(value);\n\t\tif (!Array.isArray(array)) {\n\t\t\tthrow new TypeError(`Expected an array but got a value of type \"${typeof array}\"`);\n\t\t}\n\t\treturn array;\n\t},\n\n\tboolean(value: string): boolean {\n\t\treturn !(value === '0' || String(value).toLowerCase() === 'false');\n\t},\n\n\tnumber(value: string): number {\n\t\tconst number = Number(value.replace(/_/g, ''));\n\t\treturn number;\n\t},\n\n\tobject(value: string): object {\n\t\tconst object = JSON.parse(value);\n\t\tif (object === null || typeof object !== 'object' || Array.isArray(object)) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`expected value of type \"object\" but instead got value \"${value}\" of type \"${parseAttributeTypeDefault(\n\t\t\t\t\tobject,\n\t\t\t\t)}\"`,\n\t\t\t);\n\t\t}\n\t\treturn object;\n\t},\n\n\tstring(value: string): string {\n\t\treturn value;\n\t},\n};\n\ntype Writer = (value: unknown) => string;\n\n/**\n * Object that maps attribute types to writer functions.\n * @type {Object.<string, Writer>}\n */\nconst writers: { [type: string]: Writer } = {\n\tdefault: writeString,\n\tarray: writeJSON,\n\tobject: writeJSON,\n};\n\nfunction writeJSON(value: unknown) {\n\treturn JSON.stringify(value);\n}\n\nfunction writeString(value: unknown) {\n\treturn `${value}`;\n}\n\n/**\n * Reads the attribute value based on the provided type.\n * @param value - The attribute value to be read.\n * @param type - The type of the attribute.\n * @returns The parsed attribute value.\n * @throws {TypeError} If the provided type is unknown.\n */\nexport function readAttributeValue(value: string, type: AttributeTypeConstant) {\n\tconst readerType = parseAttributeTypeConstant(type);\n\tif (!readerType) throw new TypeError(`[radiant-element] Unknown type \"${type}\"`);\n\treturn readers[readerType]!(value);\n}\n\nexport type ReadAttributeValueReturnType = ReturnType<typeof readAttributeValue>;\n\n/**\n * Writes the attribute value based on the provided type.\n *\n * @param value - The value to be written.\n * @param type - The type of the attribute.\n * @returns The written attribute value.\n * @throws {TypeError} If the provided type is unknown.\n */\nexport function writeAttributeValue(value: unknown, type: AttributeTypeConstant) {\n\tconst writerType = parseAttributeTypeConstant(type);\n\tif (!writerType) throw new TypeError(`[radiant-element] Unknown type \"${type}\"`);\n\tconst writer: Writer = writers[writerType] ?? writers.default ?? writeString;\n\treturn writer(value);\n}\n\nexport type WriteAttributeValueReturnType = ReturnType<typeof writeAttributeValue>;\n\n/*\n * Type guard functions for each type in AttributeTypeConstant\n */\nfunction isBoolean(value: unknown): value is boolean {\n\treturn typeof value === 'boolean';\n}\n\nfunction isNumber(value: unknown): value is number {\n\treturn typeof value === 'number';\n}\n\nfunction isString(value: unknown): value is string {\n\treturn typeof value === 'string';\n}\n\nfunction isArray(value: unknown): value is Array<unknown> {\n\treturn Array.isArray(value);\n}\n\nfunction isObject(value: unknown): value is object {\n\treturn typeof value === 'object' && !Array.isArray(value) && value !== null;\n}\n\n/*\n * Check function to ensure defaultValue matches the type\n */\nexport function isValueOfType(type: AttributeTypeConstant, defaultValue: unknown): boolean {\n\tswitch (type) {\n\t\tcase Boolean:\n\t\t\treturn isBoolean(defaultValue);\n\t\tcase Number:\n\t\t\treturn isNumber(defaultValue);\n\t\tcase String:\n\t\t\treturn isString(defaultValue);\n\t\tcase Array:\n\t\t\treturn isArray(defaultValue);\n\t\tcase Object:\n\t\t\treturn isObject(defaultValue);\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\nexport const getInitialValue = (\n\ttarget: RadiantElement,\n\ttype: AttributeTypeConstant,\n\tattributeKey: string,\n\tdefaultValue: unknown,\n) => {\n\tif (type === Boolean) {\n\t\tconst attributeValue = target.getAttribute(attributeKey);\n\t\tif (attributeValue === null) {\n\t\t\treturn defaultValue;\n\t\t}\n\n\t\treturn attributeValue === '' ? true : readAttributeValue(attributeValue, type);\n\t}\n\n\tconst attributeValue = target.getAttribute(attributeKey);\n\treturn attributeValue !== null\n\t\t? readAttributeValue(attributeValue, type)\n\t\t: (defaultValue ?? (defaultValueForType(type) as typeof defaultValue));\n};\n",
10
- "export const CUSTOM_ELEMENT_TAG_NAME = Symbol.for('@ecopages/radiant.customElementTagName');\n\ntype CustomElementConstructorWithMetadata = CustomElementConstructor & {\n\t[CUSTOM_ELEMENT_TAG_NAME]?: string;\n};\n\n/**\n * Sets the custom element tag name for a given constructor.\n * This is used internally to associate a class with its custom element tag, which is necessary for features like hydration and SSR support.\n * @param target The constructor of the custom element.\n * @param tagName The tag name to associate with the custom element.\n */\nexport function setCustomElementTagName(target: CustomElementConstructor, tagName: string): void {\n\t(target as CustomElementConstructorWithMetadata)[CUSTOM_ELEMENT_TAG_NAME] = tagName;\n}\n\n/**\n * Retrieves the custom element tag name associated with a given constructor.\n * @param target The constructor of the custom element.\n * @returns The tag name associated with the custom element, or `undefined` if not set.\n */\nexport function getCustomElementTagName(target: CustomElementConstructor): string | undefined {\n\treturn (target as CustomElementConstructorWithMetadata)[CUSTOM_ELEMENT_TAG_NAME];\n}\n",
11
- "import type { ReactiveProperty } from '../core/reactive-prop-core';\nimport type { ReactivePropDefinition } from '../core/reactive-prop-metadata';\nimport { writeAttributeValue } from '../utils/attribute-utils';\nimport { escapeHtmlAttribute } from '../utils/escape-html-attribute';\n\n/**\n * Minimal host shape needed by the attribute serialization policy.\n *\n * This interface defines the narrow contract that the serialization module\n * consumes, keeping it independent of the full {@link RadiantElementSsrHost}.\n */\nexport type HostAttributeSource = {\n\tgetReactiveProperties: () => ReactiveProperty[];\n\tgetReactivePropDefinitions: () => ReactivePropDefinition[];\n\tgetPropertyValue: (name: string) => unknown;\n\tgetAttributeNames: () => string[];\n\tgetAttribute: (name: string) => string | null;\n};\n\n/**\n * Resolves the final set of SSR host attributes from a Radiant Element Host.\n *\n * ## Source precedence (highest to lowest)\n *\n * 1. **Reactive properties** — legacy attribute reflection via `property.converter`.\n * These are already-registered reactive properties with established converters.\n * Falsy values (`undefined`, `null`, `false`) are omitted.\n *\n * 2. **Reactive prop definitions** — decorator-based definitions. Skipped when the\n * target attribute name was already emitted by source 1 (dedup via `seenAttributes`).\n * Uses `writeAttributeValue` for type-aware conversion.\n *\n * 3. **Authored attributes** — raw host-level attributes from the original markup.\n * These always win if present, regardless of whether sources 1 or 2 already\n * set the same name. This preserves explicit author intent in templates.\n *\n * @param host Host shape providing reactive state and attribute accessors.\n * @returns Flat record of attribute name → serialized value.\n */\nexport function resolveHostAttributes(host: HostAttributeSource): Record<string, string> {\n\tconst attributes: Record<string, string> = {};\n\tconst seenAttributes = new Set<string>();\n\n\tappendReactivePropertyAttributes(host, attributes, seenAttributes);\n\tappendReactivePropDefinitionAttributes(host, attributes, seenAttributes);\n\tappendAuthoredAttributes(host, attributes);\n\n\treturn attributes;\n}\n\n/**\n * Serializes a flat attribute record into an HTML attribute string.\n *\n * Each entry becomes ` name=\"escaped-value\"` with the leading space included.\n * The combined string is safe for direct interpolation into an opening tag.\n *\n * @param attributes Flat attribute record to serialize.\n * @returns HTML attribute string.\n */\nexport function stringifyHostAttributes(attributes: Record<string, string>): string {\n\treturn Object.entries(attributes)\n\t\t.map(([name, value]) => ` ${name}=\"${escapeHtmlAttribute(value)}\"`)\n\t\t.join('');\n}\n\n/**\n * Source 1: Reactive properties with established converters.\n *\n * Falsy runtime values are omitted — they should not appear as attributes\n * in SSR output.\n */\nfunction appendReactivePropertyAttributes(\n\thost: HostAttributeSource,\n\tattributes: Record<string, string>,\n\tseenAttributes: Set<string>,\n): void {\n\tfor (const property of host.getReactiveProperties()) {\n\t\tconst currentValue = host.getPropertyValue(property.name);\n\t\tif (currentValue === undefined || currentValue === null || currentValue === false) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tattributes[property.attribute] = String(property.converter.toAttribute(currentValue));\n\t\tseenAttributes.add(property.attribute);\n\t}\n}\n\n/**\n * Source 2: Decorator-based reactive prop definitions.\n *\n * Skipped when the attribute name was already emitted by source 1, preventing\n * duplicate or conflicting attribute values.\n */\nfunction appendReactivePropDefinitionAttributes(\n\thost: HostAttributeSource,\n\tattributes: Record<string, string>,\n\tseenAttributes: Set<string>,\n): void {\n\tfor (const definition of host.getReactivePropDefinitions()) {\n\t\tconst attributeName = definition.options.attribute ?? definition.name;\n\n\t\tif (seenAttributes.has(attributeName)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst currentValue = host.getPropertyValue(definition.name);\n\n\t\tif (currentValue === undefined || currentValue === null || currentValue === false) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tattributes[attributeName] = String(writeAttributeValue(currentValue, definition.options.type));\n\t\tseenAttributes.add(attributeName);\n\t}\n}\n\n/**\n * Source 3: Authored attributes from the original markup.\n *\n * These always overwrite — when an author explicitly sets an attribute in\n * markup, that intent takes precedence over reactive property reflection.\n */\nfunction appendAuthoredAttributes(host: HostAttributeSource, attributes: Record<string, string>): void {\n\tfor (const attributeName of host.getAttributeNames()) {\n\t\tconst attributeValue = host.getAttribute(attributeName);\n\t\tif (attributeValue !== null) {\n\t\t\tattributes[attributeName] = attributeValue;\n\t\t}\n\t}\n}\n",
12
- "import type { SsrSerializableContextProvider } from './context-provider';\nimport type { UnknownContext } from './types';\n\ntype SsrContextProviderResolver = (context: UnknownContext) => SsrSerializableContextProvider | undefined;\n\nconst SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL = Symbol.for('@ecopages/radiant.ssr-context-provider-resolver');\n\ntype GlobalResolverScope = typeof globalThis & {\n\t[SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL]?: SsrContextProviderResolver;\n};\n\nfunction getGlobalResolverScope(): GlobalResolverScope {\n\treturn globalThis as GlobalResolverScope;\n}\n\n/**\n * Installs the ambient SSR provider resolver used by shared context runtime helpers.\n *\n * Server-side rendering infrastructure owns the actual provider stack storage and\n * publishes a lookup function here so client/runtime code does not need to import\n * server-oriented modules.\n */\nexport function installSsrContextProviderResolver(resolver: SsrContextProviderResolver): void {\n\tgetGlobalResolverScope()[SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL] = resolver;\n}\n\n/**\n * Resolves an ambient SSR provider when a server render has published one.\n */\nexport function resolveAmbientSsrContextProvider(context: UnknownContext): SsrSerializableContextProvider | undefined {\n\treturn getGlobalResolverScope()[SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL]?.(context);\n}\n",
13
- "import type { AsyncLocalStorage } from 'node:async_hooks';\nimport type { SsrSerializableContextProvider } from '../context/context-provider';\nimport { installSsrContextProviderResolver } from '../context/context-ssr-bridge';\nimport type { ContextType, UnknownContext } from '../context/types';\n\ntype ProviderFrame = Map<UnknownContext, SsrSerializableContextProvider>;\ntype ProviderStack = ProviderFrame[];\n\nlet resolvedAsyncLocalStorage: AsyncLocalStorage<ProviderStack> | null | undefined;\n\n/**\n * Lazily resolves `AsyncLocalStorage` from `node:async_hooks`.\n *\n * The dynamic `require` is necessary because browser-based SSR tests import\n * this server-oriented module directly. A top-level static import would break\n * those browser bundles even though normal application SSR runs on the server.\n *\n * On the server (Node.js, Bun, Cloudflare Workers) the import always succeeds.\n * In browser test environments where SSR rendering is exercised without a real\n * server, the fallback global stack is used instead.\n */\nfunction getAsyncLocalStorage(): AsyncLocalStorage<ProviderStack> | null {\n\tif (resolvedAsyncLocalStorage !== undefined) {\n\t\treturn resolvedAsyncLocalStorage;\n\t}\n\n\ttry {\n\t\tconst { AsyncLocalStorage: ALS } = require('node:async_hooks') as typeof import('node:async_hooks');\n\t\tresolvedAsyncLocalStorage = new ALS<ProviderStack>();\n\t\treturn resolvedAsyncLocalStorage;\n\t} catch {\n\t\tresolvedAsyncLocalStorage = null;\n\t\treturn null;\n\t}\n}\n\nconst SSR_CONTEXT_FALLBACK_STACK_SYMBOL = Symbol.for('@ecopages/radiant.ssr-context-fallback-stack');\n\nfunction getFallbackStack(): ProviderStack {\n\tconst g = globalThis as typeof globalThis & { [SSR_CONTEXT_FALLBACK_STACK_SYMBOL]?: ProviderStack };\n\tg[SSR_CONTEXT_FALLBACK_STACK_SYMBOL] ??= [];\n\treturn g[SSR_CONTEXT_FALLBACK_STACK_SYMBOL];\n}\n\n/**\n * Pushes a temporary provider frame onto the SSR context stack.\n *\n * On the server, each call creates an isolated `AsyncLocalStorage` context so\n * concurrent renders cannot corrupt each other.\n *\n * In browser test environments where `AsyncLocalStorage` is unavailable, a\n * synchronous global stack is used as a fallback.\n */\nexport function withSsrContextProviders(providers: readonly SsrSerializableContextProvider[]): () => void {\n\tif (providers.length === 0) {\n\t\treturn () => undefined;\n\t}\n\n\tconst frame = new Map<UnknownContext, SsrSerializableContextProvider>();\n\n\tfor (const provider of providers) {\n\t\tframe.set(provider.getContextKey(), provider);\n\t}\n\n\tconst als = getAsyncLocalStorage();\n\n\tif (als) {\n\t\tconst parentStack = als.getStore() ?? [];\n\t\tconst childStack = [...parentStack, frame];\n\t\tals.enterWith(childStack);\n\n\t\treturn () => {\n\t\t\tals.enterWith(parentStack);\n\t\t};\n\t}\n\n\tconst stack = getFallbackStack();\n\tstack.push(frame);\n\n\treturn () => {\n\t\tconst index = stack.lastIndexOf(frame);\n\t\tif (index >= 0) stack.splice(index, 1);\n\t};\n}\n\n/**\n * Resolves the nearest SSR-visible provider for a given context token.\n *\n * Lookup walks the provider frames from innermost to outermost so nested host\n * serialization behaves the same way as runtime context resolution in the DOM.\n */\nexport function resolveSsrContextProvider<T extends UnknownContext>(\n\tcontext: T,\n): SsrSerializableContextProvider | undefined {\n\tconst store = getAsyncLocalStorage()?.getStore() ?? getFallbackStack();\n\n\tfor (let index = store.length - 1; index >= 0; index -= 1) {\n\t\tconst provider = store[index]?.get(context);\n\n\t\tif (provider) {\n\t\t\treturn provider;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Resolves the current SSR-visible value for a given context token.\n *\n * This is the ergonomic helper consumed by SSR-aware decorators and component\n * render paths when they only need the context payload instead of the full\n * provider instance.\n */\nexport function resolveSsrContextValue<T extends UnknownContext>(context: T): ContextType<T> | undefined {\n\tconst provider = resolveSsrContextProvider(context);\n\n\tif (!provider) {\n\t\treturn undefined;\n\t}\n\n\treturn provider.getContext() as ContextType<T>;\n}\n\ninstallSsrContextProviderResolver((context) => resolveSsrContextProvider(context));\n",
14
- "/**\n * Host script composition for Radiant SSR.\n *\n * This module owns the mode-sensitive ordering and inclusion rules for the\n * script payloads that appear inside a server-rendered Element Host.\n *\n * ## Composition rules\n *\n * | Mode | Order |\n * |-----------|-----------------------------------------------------------------|\n * | `plain` | view content → authored hydration markup → slot projection |\n * | `hydrate` | view content → slot projection → hydration binding scripts |\n *\n * In **plain** mode, authored hydration markup (script tags pre-authored on the\n * host) is preserved because the component may rely on them for standalone\n * behavior. Hydration binding scripts are omitted because there is no client\n * hydrator to consume them.\n *\n * In **hydrate** mode, authored hydration markup is superseded by the formal\n * hydration binding scripts. Slot projection comes before hydration scripts so\n * the client can reconstruct projected content before binding recovery.\n */\n\n/** Individual content parts that make up a server-rendered host's inner HTML. */\nexport type HostContentParts = {\n\t/** The rendered view HTML from `renderViewToString`. */\n\thostContent: string;\n\t/** Authored hydration script markup pre-existing on the host, if any. */\n\tauthoredHydrationMarkup: string;\n\t/** Slot projection JSON payload script tag, if any. */\n\tslotProjectionScript: string;\n\t/** Hydration binding script tags for client-side recovery, if any. */\n\thydrationScripts: string;\n};\n\n/**\n * Assembles the inner HTML of a server-rendered Element Host from its\n * individual content parts, respecting the mode-sensitive ordering rules.\n *\n * @param parts Individual content parts to compose.\n * @param hydrate Whether the output targets client-side hydration.\n * @returns Assembled inner HTML string.\n */\nexport function composeHostContent(parts: HostContentParts, hydrate: boolean): string {\n\tif (!hydrate) {\n\t\treturn `${parts.hostContent}${parts.authoredHydrationMarkup}${parts.slotProjectionScript}`;\n\t}\n\n\treturn `${parts.hostContent}${parts.slotProjectionScript}${parts.hydrationScripts}`;\n}\n",
15
- "import type { JsxRenderable } from '@ecopages/jsx';\nimport type { RenderToStringOptions } from '@ecopages/jsx/server';\nimport type { SsrSerializableContextProvider } from '../context/context-provider';\nimport type { ReactiveProperty } from './reactive-prop-core';\nimport type { ReactivePropDefinition } from './reactive-prop-metadata';\nimport type { SsrSerializableHydrationBinding } from './ssr-hydration-binding';\n\n/**\n * Unified SSR host shape shared by core resolution and server serialization.\n */\nexport type InternalRadiantSsrHost = {\n\tconstructor: CustomElementConstructor;\n\tgetAttribute(name: string): string | null;\n\tgetAttributeNames(): string[];\n\tgetAuthoredHydrationScriptMarkup?: () => string | undefined;\n\tgetContextProviders: () => SsrSerializableContextProvider[];\n\tgetHydrationBindings: () => SsrSerializableHydrationBinding[];\n\tgetReactiveProperties: () => ReactiveProperty[];\n\tgetReactivePropDefinitions: () => ReactivePropDefinition[];\n\tgetPropertyValue: (name: string) => unknown;\n\tgetSlotProjectionScriptTag?: () => string | undefined;\n\tresolveTrackedRenderOutput: () => { containsSlots: boolean; value: JsxRenderable };\n\trenderViewToString: (options?: RenderToStringOptions) => string;\n};\n\nexport type RadiantElementSsrHostSource = InternalRadiantSsrHost;\n\nexport function resolveRadiantElementSsrHostSource(component: object): InternalRadiantSsrHost | undefined {\n\tif (isInternalRadiantSsrHost(component)) {\n\t\treturn component;\n\t}\n\n\treturn undefined;\n}\n\nexport function isInternalRadiantSsrHost(component: object): component is InternalRadiantSsrHost {\n\treturn (\n\t\ttypeof component.constructor === 'function' &&\n\t\ttypeof (component as { getAttribute?: unknown }).getAttribute === 'function' &&\n\t\ttypeof (component as { getAttributeNames?: unknown }).getAttributeNames === 'function' &&\n\t\ttypeof (component as { getAuthoredHydrationScriptMarkup?: unknown }).getAuthoredHydrationScriptMarkup ===\n\t\t\t'function' &&\n\t\ttypeof (component as { getContextProviders?: unknown }).getContextProviders === 'function' &&\n\t\ttypeof (component as { getHydrationBindings?: unknown }).getHydrationBindings === 'function' &&\n\t\ttypeof (component as { getReactiveProperties?: unknown }).getReactiveProperties === 'function' &&\n\t\ttypeof (component as { getSlotProjectionScriptTag?: unknown }).getSlotProjectionScriptTag === 'function' &&\n\t\ttypeof (component as { resolveTrackedRenderOutput?: unknown }).resolveTrackedRenderOutput === 'function' &&\n\t\ttypeof (component as { renderViewToString?: unknown }).renderViewToString === 'function'\n\t);\n}\n",
16
- "import { getReactivePropDefinitions } from '../core/reactive-prop-metadata';\nimport { resolveRadiantElementSsrHostSource } from '../core/radiant-element-ssr-host';\nimport type { InternalRadiantSsrHost } from './internal-radiant-host';\n\nexport function toInternalRadiantSsrHost(component: object): InternalRadiantSsrHost {\n\tconst source = resolveRadiantElementSsrHostSource(component);\n\n\tif (!source) {\n\t\tthrow new Error('Radiant SSR runtime requires a server extraction host shape on the component.');\n\t}\n\n\treturn {\n\t\tconstructor: source.constructor as CustomElementConstructor,\n\t\tgetAttribute: (name) => source.getAttribute(name),\n\t\tgetAttributeNames: () => source.getAttributeNames(),\n\t\tgetAuthoredHydrationScriptMarkup: () => source.getAuthoredHydrationScriptMarkup?.(),\n\t\tgetContextProviders: () => source.getContextProviders(),\n\t\tgetHydrationBindings: () => source.getHydrationBindings(),\n\t\tgetReactiveProperties: () => source.getReactiveProperties(),\n\t\tgetReactivePropDefinitions: () => getReactivePropDefinitions(component),\n\t\tgetPropertyValue: (name) => Reflect.get(component, name),\n\t\tgetSlotProjectionScriptTag: () => source.getSlotProjectionScriptTag?.(),\n\t\tresolveTrackedRenderOutput: () => source.resolveTrackedRenderOutput(),\n\t\trenderViewToString: (options) => source.renderViewToString(options),\n\t};\n}\n",
17
- "import type { JsxRenderable } from '@ecopages/jsx';\nimport type { RenderToStringOptions } from '@ecopages/jsx/server';\nimport { getCustomElementTagName } from '../core/custom-element-metadata';\nimport { withSsrContextProviders } from './context-ssr';\nimport { composeHostContent } from './host-script-composition';\nimport { resolveHostAttributes, stringifyHostAttributes } from './host-attribute-serialization';\nimport { ensureLegacyHostReady } from '../decorators/legacy/host-readiness';\nimport { toInternalRadiantSsrHost } from './radiant-element-ssr-extractor';\nimport type { InternalRadiantSsrHost } from '../core/radiant-element-ssr-host';\n\nexport class RadiantElementSsrService {\n\tprivate readonly component: object;\n\tprivate readonly host: InternalRadiantSsrHost;\n\n\tconstructor(component: object) {\n\t\tthis.component = component;\n\t\tthis.host = toInternalRadiantSsrHost(component);\n\t}\n\n\tprivate ensureReady(): void {\n\t\tensureLegacyHostReady(this.component, 'ssr');\n\t}\n\n\tpublic renderHost(): JsxRenderable {\n\t\tthis.ensureReady();\n\n\t\treturn {\n\t\t\tnodeType: 1,\n\t\t\touterHTML: this.renderHostToString({ mode: 'hydrate' }),\n\t\t};\n\t}\n\n\tpublic renderHostToString(options: RenderToStringOptions = {}, attributes = this.getHostAttributes()): string {\n\t\tthis.ensureReady();\n\t\tconst tagName = this.getTagName();\n\t\tconst restoreSsrContexts = withSsrContextProviders(this.host.getContextProviders());\n\n\t\ttry {\n\t\t\treturn `<${tagName}${stringifyHostAttributes(attributes)}>${this.renderHostContent(options)}</${tagName}>`;\n\t\t} finally {\n\t\t\trestoreSsrContexts();\n\t\t}\n\t}\n\n\tpublic getHostAttributes(): Record<string, string> {\n\t\tthis.ensureReady();\n\t\treturn resolveHostAttributes(this.host);\n\t}\n\n\tprivate renderHostContent(options: RenderToStringOptions): string {\n\t\tconst hydrate = options.mode === 'hydrate' || (options.mode === undefined && options.hydrate === true);\n\n\t\tconst hydrationScripts = hydrate\n\t\t\t? this.host\n\t\t\t\t\t.getHydrationBindings()\n\t\t\t\t\t.map((binding) => binding.renderHydrationScriptTag())\n\t\t\t\t\t.filter((markup): markup is string => typeof markup === 'string')\n\t\t\t\t\t.join('')\n\t\t\t: '';\n\n\t\treturn composeHostContent(\n\t\t\t{\n\t\t\t\thostContent: this.host.renderViewToString(options),\n\t\t\t\tauthoredHydrationMarkup: this.host.getAuthoredHydrationScriptMarkup?.() ?? '',\n\t\t\t\tslotProjectionScript: this.host.getSlotProjectionScriptTag?.() ?? '',\n\t\t\t\thydrationScripts,\n\t\t\t},\n\t\t\thydrate,\n\t\t);\n\t}\n\n\tprivate getTagName(): string {\n\t\tconst tagName = getCustomElementTagName(this.host.constructor);\n\n\t\tif (!tagName) {\n\t\t\tthrow new Error(`${this.host.constructor.name} is missing @customElement metadata.`);\n\t\t}\n\n\t\treturn tagName;\n\t}\n}\n"
20
+ "import type { JsxRenderable } from '@ecopages/jsx';\nimport type { RenderToStringOptions } from '@ecopages/jsx/server';\nimport { getCustomElementTagName } from '../core/custom-element-metadata';\nimport { runSsrPreparationCallbacks } from '../core/ssr-preparation';\nimport { withSsrContextProviders } from './context-ssr';\nimport { composeHostContent } from './host-script-composition';\nimport { resolveHostAttributes, stringifyHostAttributes } from './host-attribute-serialization';\nimport { ensureLegacyHostReady } from '../decorators/legacy/host-readiness';\nimport { assertLightDomSsrSupported } from './assert-light-dom-ssr';\nimport { toInternalRadiantSsrHost } from './radiant-element-ssr-extractor';\nimport type { InternalRadiantSsrHost } from '../core/radiant-element-ssr-host';\n\nexport type RadiantElementViewRenderer = (host: InternalRadiantSsrHost, options?: RenderToStringOptions) => string;\n\nexport class RadiantElementSsrService {\n\tprivate readonly component: object;\n\tprivate readonly host: InternalRadiantSsrHost;\n\tprivate readonly renderView: RadiantElementViewRenderer;\n\n\tconstructor(component: object, renderView: RadiantElementViewRenderer) {\n\t\tthis.component = component;\n\t\tthis.host = toInternalRadiantSsrHost(component);\n\t\tthis.renderView = renderView;\n\t}\n\n\tprivate ensureReady(): void {\n\t\tassertLightDomSsrSupported(this.host);\n\t\tensureLegacyHostReady(this.component, 'ssr');\n\t\trunSsrPreparationCallbacks(this.component);\n\t}\n\n\tpublic renderHost(): JsxRenderable {\n\t\tthis.ensureReady();\n\n\t\treturn {\n\t\t\tnodeType: 1,\n\t\t\touterHTML: this.renderHostToString({ mode: 'hydrate' }),\n\t\t};\n\t}\n\n\tpublic renderHostToString(options: RenderToStringOptions = {}, attributes = this.getHostAttributes()): string {\n\t\tthis.ensureReady();\n\t\tconst tagName = this.getTagName();\n\n\t\treturn withSsrContextProviders(\n\t\t\tthis.host.getContextProviders(),\n\t\t\t() => `<${tagName}${stringifyHostAttributes(attributes)}>${this.renderHostContent(options)}</${tagName}>`,\n\t\t);\n\t}\n\n\tpublic getHostAttributes(): Record<string, string> {\n\t\tthis.ensureReady();\n\t\treturn resolveHostAttributes(this.host);\n\t}\n\n\tprivate renderHostContent(options: RenderToStringOptions): string {\n\t\tconst hydrate = options.mode === 'hydrate' || (options.mode === undefined && options.hydrate === true);\n\n\t\tconst hydrationScripts = hydrate\n\t\t\t? this.host\n\t\t\t\t\t.getHydrationBindings()\n\t\t\t\t\t.map((binding) => binding.renderHydrationScriptTag())\n\t\t\t\t\t.filter((markup): markup is string => typeof markup === 'string')\n\t\t\t\t\t.join('')\n\t\t\t: '';\n\n\t\treturn composeHostContent(\n\t\t\t{\n\t\t\t\thostContent: this.renderView(this.host, options),\n\t\t\t\tauthoredHydrationMarkup: this.host.getAuthoredHydrationScriptMarkup?.() ?? '',\n\t\t\t\tslotProjectionScript: this.host.getSlotProjectionScriptTag?.() ?? '',\n\t\t\t\thydrationScripts,\n\t\t\t},\n\t\t\thydrate,\n\t\t);\n\t}\n\n\tprivate getTagName(): string {\n\t\tconst tagName = getCustomElementTagName(this.host.constructor);\n\n\t\tif (!tagName) {\n\t\t\tthrow new Error(`${this.host.constructor.name} is missing @customElement metadata.`);\n\t\t}\n\n\t\treturn tagName;\n\t}\n}\n"
18
21
  ],
19
- "mappings": "o0BACO,SAAS,CAAmB,CAAC,EAAuB,CAC1D,OAAO,EAAM,QAAQ,KAAM,OAAO,EAAE,QAAQ,KAAM,QAAQ,EAAE,QAAQ,KAAM,MAAM,EAAE,QAAQ,KAAM,MAAM,ECAvG,IAAM,EAA4B,OAAO,IAAI,2CAA2C,EAWjF,SAAS,EAA8B,CAC7C,EACA,EACA,EACO,CACP,IAAM,EAAc,EAAO,YACrB,EAAc,EAAY,IAA8B,CAAC,EAE/D,GAAI,EAAY,KAAK,CAAC,IAAe,EAAW,OAAS,CAAY,EACpE,OAGD,EAAY,KAAK,CAAE,KAAM,EAAc,SAAQ,CAAC,EAChD,EAAY,GAA6B,EAGnC,SAAS,CAA0B,CAAC,EAA0C,CACpF,OAAS,EAAO,YAAoD,IAA8B,CAAC,GAAG,MAAM,ECtB7G,IAAM,EAA+B,OAAO,IAAI,gDAAgD,EAC1F,EAAwC,OAAO,IAAI,yDAAyD,EAC5G,EAAiD,OAAO,IAC7D,kEACD,EAQO,SAAS,EAAmD,CAClE,EACA,EACO,CACP,EAAoB,EAAO,EAA8B,CAAW,EAU9D,SAAS,EAA2D,CAC1E,EACA,EACO,CACP,EAAoB,EAAO,EAAuC,CAAW,EASvE,SAAS,CAA+C,CAAC,EAAmB,CAClF,EAAsB,EAAU,CAA4B,EAUtD,SAAS,CAAuD,CACtE,EACA,EACO,CACP,IAAM,EAAS,EAEf,EACC,EACA,EACC,EAAO,KAAoD,IAAI,GAGjE,EAGD,SAAS,CAAqC,CAC7C,EACA,EACA,EACO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6B,OAAO,IAAW,QAAQ,EAC/D,KAAK,EAAE,EACR,GAEH,OAAO,EACN,CACC,YAAa,KAAK,WAAW,KAAK,KAAM,CAAO,EAC/C,wBAAyB,KAAK,KAAK,mCAAmC,GAAK,GAC3E,qBAAsB,KAAK,KAAK,6BAA6B,GAAK,GAClE,kBACD,EACA,CACD,EAGO,UAAU,EAAW,CAC5B,IAAM,EAAU,EAAwB,KAAK,KAAK,WAAW,EAE7D,GAAI,CAAC,EACJ,MAAU,MAAM,GAAG,KAAK,KAAK,YAAY,0CAA0C,EAGpF,OAAO,EAET",
23
+ "debugId": "D702E076FD69320D64756E2164756E21",
21
24
  "names": []
22
25
  }
@@ -1 +1 @@
1
- export { createRadiantElementSsrService, getOrCreateRadiantElementSsrRuntime, getRadiantElementHostSsrAttributes, getRadiantElementTrackedRenderOutput, renderRadiantElementHost, renderRadiantElementHostToString, renderRadiantElementViewToString, renderRegisteredRadiantElementHost, renderRegisteredRadiantElementHostToString, resolveRadiantElementRenderBridge, resolveRadiantElementSsrHostBridge, resolveRegisteredRadiantElementPreview, withRadiantServerCustomElementRenderBridge, withServerRadiantElementSsrRuntime, } from './radiant-element-ssr-bridge';
1
+ export { createRadiantElementSsrService, getOrCreateRadiantElementSsrRuntime, getRadiantElementHostSsrAttributes, renderRadiantElementHost, renderRadiantElementHostToString, renderRadiantElementViewToString, renderRegisteredRadiantElementHost, renderRegisteredRadiantElementHostToString, resolveRadiantElementRenderBridge, withRadiantServerCustomElementRenderBridge, withServerRadiantElementSsrRuntime, } from './radiant-element-ssr-bridge';
@@ -1,3 +1,3 @@
1
- var{defineProperty:X,getOwnPropertyNames:QR,getOwnPropertyDescriptor:ZR}=Object,$R=Object.prototype.hasOwnProperty;function FR(R){return this[R]}var yR=(R)=>{var P=(O??=new WeakMap).get(R),q;if(P)return P;if(P=X({},"__esModule",{value:!0}),R&&typeof R==="object"||typeof R==="function"){for(var D of QR(R))if(!$R.call(P,D))X(P,D,{get:FR.bind(R,D),enumerable:!(q=ZR(R,D))||q.enumerable})}return O.set(R,P),P},O;var HR=(R)=>R;function JR(R,P){this[R]=HR.bind(null,P)}var mR=(R,P)=>{for(var q in P)X(R,q,{get:P[q],enumerable:!0,configurable:!0,set:JR.bind(P,q)})};var lR=(R,P)=>()=>(R&&(P=R(R=0)),P);var jR=((R)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(R,{get:(P,q)=>(typeof require<"u"?require:P)[q]}):R)(function(R){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+R+'" is not supported')});function h(R){return R.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var U=Symbol.for("@ecopages/radiant.reactivePropDefinitions");function uR(R,P,q){let D=R.constructor,W=D[U]??[];if(W.some((Q)=>Q.name===P))return;W.push({name:P,options:q}),D[U]=W}function C(R){return(R.constructor[U]??[]).slice()}var x=Symbol.for("@ecopages/radiant.legacy-instance-initializers"),I=Symbol.for("@ecopages/radiant.legacy-post-construction-initializers"),GR=Symbol.for("@ecopages/radiant.legacy-executed-post-construction-initializers");function pR(R,P){M(R,x,P)}function sR(R,P){M(R,I,P)}function k(R){XR(R,x)}function Y(R,P){let q=R;UR(R,P,q[GR]??=new Set)}function M(R,P,q){let D=R,W=Object.prototype.hasOwnProperty.call(D,P)?D[P]:void 0;if(Array.isArray(W)){W.push(q);return}Object.defineProperty(D,P,{value:[q]})}function XR(R,P){YR(R,(q)=>{let D=q[P];if(!Array.isArray(D))return;for(let W of D)W(R)})}function UR(R,P,q){for(let D of f(R)){let W=D[I];if(!Array.isArray(W))continue;for(let Q of W){if(q.has(Q))continue;Q(R,P),q.add(Q)}}}function f(R){let P=[],q=Object.getPrototypeOf(R);while(q&&q!==Object.prototype)P.unshift(q),q=Object.getPrototypeOf(q);return P}function YR(R,P){for(let q of f(R))P(q)}function g(R,P){switch(P){case"construct":k(R);break;case"connect":Y(R,"connect");break;case"ssr":Y(R,"ssr");break}}function N(R){switch(R){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function BR(R){switch(typeof R){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(R))return"array";if(Object.prototype.toString.call(R)==="[object Object]")return"object"}function ER(R){switch(R){case Number:return 0;case String:return"";case Boolean:return!1;default:return null}}function KR(R){try{return JSON.parse(R)}catch{throw TypeError("Invalid JSON string")}}var wR={array(R){let P=KR(R);if(!Array.isArray(P))throw TypeError(`Expected an array but got a value of type "${typeof P}"`);return P},boolean(R){return!(R==="0"||String(R).toLowerCase()==="false")},number(R){return Number(R.replace(/_/g,""))},object(R){let P=JSON.parse(R);if(P===null||typeof P!=="object"||Array.isArray(P))throw TypeError(`expected value of type "object" but instead got value "${R}" of type "${BR(P)}"`);return P},string(R){return R}},L={default:z,array:T,object:T};function T(R){return JSON.stringify(R)}function z(R){return`${R}`}function _(R,P){let q=N(P);if(!q)throw TypeError(`[radiant-element] Unknown type "${P}"`);return wR[q](R)}function A(R,P){let q=N(P);if(!q)throw TypeError(`[radiant-element] Unknown type "${P}"`);return(L[q]??L.default??z)(R)}function OR(R){return typeof R==="boolean"}function CR(R){return typeof R==="number"}function xR(R){return typeof R==="string"}function IR(R){return Array.isArray(R)}function kR(R){return typeof R==="object"&&!Array.isArray(R)&&R!==null}function nR(R,P){switch(R){case Boolean:return OR(P);case Number:return CR(P);case String:return xR(P);case Array:return IR(P);case Object:return kR(P);default:return!1}}var eR=(R,P,q,D)=>{if(P===Boolean){let Q=R.getAttribute(q);if(Q===null)return D;return Q===""?!0:_(Q,P)}let W=R.getAttribute(q);return W!==null?_(W,P):D??ER(P)};import{getActiveSsrScopeValue as MR,withActiveSsrScopeValue as fR}from"@ecopages/jsx/server";var S=Symbol.for("@ecopages/radiant.element-ssr-runtime");function PP(){return MR(S)}function V(R,P){return fR(S,R,P)}var v=Symbol.for("@ecopages/radiant.customElementTagName");function DP(R,P){R[v]=P}function b(R){return R[v]}function d(R){let P={},q=new Set;return LR(R,P,q),TR(R,P,q),_R(R,P),P}function y(R){return Object.entries(R).map(([P,q])=>` ${P}="${h(q)}"`).join("")}function LR(R,P,q){for(let D of R.getReactiveProperties()){let W=R.getPropertyValue(D.name);if(W===void 0||W===null||W===!1)continue;P[D.attribute]=String(D.converter.toAttribute(W)),q.add(D.attribute)}}function TR(R,P,q){for(let D of R.getReactivePropDefinitions()){let W=D.options.attribute??D.name;if(q.has(W))continue;let Q=R.getPropertyValue(D.name);if(Q===void 0||Q===null||Q===!1)continue;P[W]=String(A(Q,D.options.type)),q.add(W)}}function _R(R,P){for(let q of R.getAttributeNames()){let D=R.getAttribute(q);if(D!==null)P[q]=D}}var m=Symbol.for("@ecopages/radiant.ssr-context-provider-resolver");function l(){return globalThis}function c(R){l()[m]=R}function HP(R){return l()[m]?.(R)}var F;function i(){if(F!==void 0)return F;try{let{AsyncLocalStorage:R}=(()=>{throw new Error("Cannot require module "+"node:async_hooks");})();return F=new R,F}catch{return F=null,null}}var u=Symbol.for("@ecopages/radiant.ssr-context-fallback-stack");function p(){let R=globalThis;return R[u]??=[],R[u]}function s(R){if(R.length===0)return()=>{return};let P=new Map;for(let W of R)P.set(W.getContextKey(),W);let q=i();if(q){let W=q.getStore()??[],Q=[...W,P];return q.enterWith(Q),()=>{q.enterWith(W)}}let D=p();return D.push(P),()=>{let W=D.lastIndexOf(P);if(W>=0)D.splice(W,1)}}function r(R){let P=i()?.getStore()??p();for(let q=P.length-1;q>=0;q-=1){let D=P[q]?.get(R);if(D)return D}return}function GP(R){let P=r(R);if(!P)return;return P.getContext()}c((R)=>r(R));function a(R,P){if(!P)return`${R.hostContent}${R.authoredHydrationMarkup}${R.slotProjectionScript}`;return`${R.hostContent}${R.slotProjectionScript}${R.hydrationScripts}`}function $(R){if(NR(R))return R;return}function NR(R){return typeof R.constructor==="function"&&typeof R.getAttribute==="function"&&typeof R.getAttributeNames==="function"&&typeof R.getAuthoredHydrationScriptMarkup==="function"&&typeof R.getContextProviders==="function"&&typeof R.getHydrationBindings==="function"&&typeof R.getReactiveProperties==="function"&&typeof R.getSlotProjectionScriptTag==="function"&&typeof R.resolveTrackedRenderOutput==="function"&&typeof R.renderViewToString==="function"}function o(R){let P=$(R);if(!P)throw Error("Radiant SSR runtime requires a server extraction host shape on the component.");return{constructor:P.constructor,getAttribute:(q)=>P.getAttribute(q),getAttributeNames:()=>P.getAttributeNames(),getAuthoredHydrationScriptMarkup:()=>P.getAuthoredHydrationScriptMarkup?.(),getContextProviders:()=>P.getContextProviders(),getHydrationBindings:()=>P.getHydrationBindings(),getReactiveProperties:()=>P.getReactiveProperties(),getReactivePropDefinitions:()=>C(R),getPropertyValue:(q)=>Reflect.get(R,q),getSlotProjectionScriptTag:()=>P.getSlotProjectionScriptTag?.(),resolveTrackedRenderOutput:()=>P.resolveTrackedRenderOutput(),renderViewToString:(q)=>P.renderViewToString(q)}}class B{component;host;constructor(R){this.component=R,this.host=o(R)}ensureReady(){g(this.component,"ssr")}renderHost(){return this.ensureReady(),{nodeType:1,outerHTML:this.renderHostToString({mode:"hydrate"})}}renderHostToString(R={},P=this.getHostAttributes()){this.ensureReady();let q=this.getTagName(),D=s(this.host.getContextProviders());try{return`<${q}${y(P)}>${this.renderHostContent(R)}</${q}>`}finally{D()}}getHostAttributes(){return this.ensureReady(),d(this.host)}renderHostContent(R){let P=R.mode==="hydrate"||R.mode===void 0&&R.hydrate===!0,q=P?this.host.getHydrationBindings().map((D)=>D.renderHydrationScriptTag()).filter((D)=>typeof D==="string").join(""):"";return a({hostContent:this.host.renderViewToString(R),authoredHydrationMarkup:this.host.getAuthoredHydrationScriptMarkup?.()??"",slotProjectionScript:this.host.getSlotProjectionScriptTag?.()??"",hydrationScripts:q},P)}getTagName(){let R=b(this.host.constructor);if(!R)throw Error(`${this.host.constructor.name} is missing @customElement metadata.`);return R}}import{renderToString as zR}from"@ecopages/jsx/server";import{createServerHydrationBindingState as n,isServerRenderHydrationActive as e,withForcedServerCustomElementRendering as AR,withServerCustomElementRenderHook as SR,withServerHydrationBindingState as t}from"@ecopages/jsx/server";var j;function E(R){return new B(R)}function H(R){return{nodeType:1,outerHTML:Z(R,{mode:"hydrate"})}}function VR(R){if(J(R))return H(R);if(!G(R))return;return R.renderHost?.()??{nodeType:1,outerHTML:R.renderHostToString({mode:"hydrate"})}}function Z(R,P={}){return w(()=>E(R).renderHostToString(P,K(R)))}function vR(R,P={}){if(J(R))return Z(R,P);if(!G(R))return;return R.renderHostToString(P)}function bR(R,P){if(J(R))return H(R);if(!G(R))return;return R.renderHost?.()??{nodeType:1,outerHTML:P}}function RR(R,P={}){return w(()=>qR(()=>zR(DR(R).value,P)))}function K(R){return E(R).getHostAttributes()}function PR(R){if(!J(R))return;return{renderHost:()=>H(R),renderHostToString:(P)=>Z(R,P)}}function hR(R){return $(R)}function qR(R){return AR(()=>SR(({instance:P})=>{if(J(P))return{nodeType:1,get outerHTML(){let D=e(),W={hydrate:D,mode:D?"hydrate":"plain"};if(!D)return Z(P,W);return t(n(),()=>Z(P,W))}};if(!G(P))return;let q=P;return{nodeType:1,get outerHTML(){let D=e();if(!D)return q.renderHostToString({hydrate:D,mode:D?"hydrate":"plain"});return t(n(),()=>q.renderHostToString({hydrate:D,mode:D?"hydrate":"plain"}))}}},R))}function DR(R){if(dR(R))return R.resolveTrackedRenderOutput();let P=$(R);if(!P)throw Error("Radiant SSR runtime requires tracked render output support on the component.");return P.resolveTrackedRenderOutput()}function J(R){if(typeof R!=="object"||R===null)return!1;return $(R)!==void 0}function G(R){if(typeof R!=="object"||R===null)return!1;return typeof R.renderHostToString==="function"}function dR(R){if(typeof R!=="object"||R===null)return!1;return typeof R.resolveTrackedRenderOutput==="function"}function WR(){if(j)return j;return j={getHostAttributes:K,renderHost:H,renderHostToString:Z,resolveRenderBridge:PR,renderView:RR},j}function w(R){return V(WR(),R)}export{w as withServerRadiantElementSsrRuntime,qR as withRadiantServerCustomElementRenderBridge,bR as resolveRegisteredRadiantElementPreview,hR as resolveRadiantElementSsrHostBridge,PR as resolveRadiantElementRenderBridge,vR as renderRegisteredRadiantElementHostToString,VR as renderRegisteredRadiantElementHost,RR as renderRadiantElementViewToString,Z as renderRadiantElementHostToString,H as renderRadiantElementHost,DR as getRadiantElementTrackedRenderOutput,K as getRadiantElementHostSsrAttributes,WR as getOrCreateRadiantElementSsrRuntime,E as createRadiantElementSsrService};
1
+ function L0(f){switch(f){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}var r={default:p,array:m,object:m};function m(f){return JSON.stringify(f)}function p(f){return`${f}`}function i(f,x){let H=L0(x);if(!H)throw TypeError(`[radiant-element] Unknown type "${x}"`);return(r[H]??r.default??p)(f)}function K(f){return f.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function l(f){let x={},H=new Set;return D0(f,x,H),E0(f,x,H),z0(f,x),x}function n(f){return Object.entries(f).map(([x,H])=>` ${x}="${K(H)}"`).join("")}function D0(f,x,H){for(let g of f.getReactiveProperties()){let F=f.getPropertyValue(g.name);if(F===void 0||F===null||F===!1)continue;x[g.attribute]=String(g.converter.toAttribute(F)),H.add(g.attribute)}}function E0(f,x,H){for(let g of f.getReactivePropDefinitions()){let F=g.options.attribute??g.name;if(H.has(F))continue;let $=f.getPropertyValue(g.name);if($===void 0||$===null||$===!1)continue;x[F]=String(i($,g.options.type)),H.add(F)}}function z0(f,x){for(let H of f.getAttributeNames()){let g=f.getAttribute(H);if(g!==null)x[H]=g}}import{getActiveSsrScopeValue as I,withActiveSsrScopeValue as a}from"@ecopages/jsx/server";var M0;function o(f){M0=f}var B=Symbol.for("@ecopages/radiant.ssr-provider-stack");function t(f){if(I(B)!==void 0)return f();return a(B,[],f)}function e(f,x){if(f.length===0)return x();let H=I(B);if(H===void 0)throw Error("SSR context providers require runWithSsrProviderStack(...). Wrap the sync render snapshot at the render boundary.");let g=new Map;for(let F of f)g.set(F.getContextKey(),F);return a(B,[...H,g],x)}function f0(f){let x=I(B);if(!x)return;for(let H=x.length-1;H>=0;H-=1){let g=x[H]?.get(f);if(g)return g}return}function Jf(f){let x=f0(f);if(!x)return;return x.getContext()}o((f)=>f0(f));function x0(f,x){if(!x)return`${f.hostContent}${f.authoredHydrationMarkup}${f.slotProjectionScript}`;return`${f.hostContent}${f.slotProjectionScript}${f.hydrationScripts}`}function w(f){if(f.renderRootMode!=="shadow")return;let x=typeof f.constructor==="function"&&f.constructor.name?f.constructor.name:"RadiantElement";throw Error(`${x} uses renderRootMode "shadow". Radiant SSR is light-DOM only; keep renderRootMode "light" for server rendering, or skip SSR for this host.`)}var _0=Symbol.for("@ecopages/radiant.reactivePropDefinitions");function H0(f){return(f.constructor[_0]??[]).slice()}var g0=Symbol.for("@ecopages/radiant.RadiantElement");function J(f){return typeof f==="object"&&f!==null&&g0 in f}function F0(f){if(!J(f))throw Error("Radiant SSR runtime requires a RadiantElement host. Import a Radiant server SSR entrypoint and pass a RadiantElement instance.");return{constructor:f.constructor,renderRootMode:f.renderRootMode,getAttribute:(x)=>f.getAttribute(x),getAttributeNames:()=>f.getAttributeNames(),getAuthoredHydrationScriptMarkup:()=>f.getAuthoredHydrationScriptMarkup(),getContextProviders:()=>f.getContextProviders(),getHydrationBindings:()=>f.getHydrationBindings(),getReactiveProperties:()=>f.getReactiveProperties(),getReactivePropDefinitions:()=>H0(f),getPropertyValue:(x)=>Reflect.get(f,x),getSlotProjectionScriptTag:()=>f.getSlotProjectionScriptTag(),resolveTrackedRenderOutput:()=>f.resolveTrackedRenderOutput()}}var N0=Symbol.for("@ecopages/radiant.customElementTagName");function $0(f){return f[N0]}var k0=Symbol.for("@ecopages/radiant.ssr-preparation-callbacks"),q0=Symbol.for("@ecopages/radiant.ssr-preparation-running");function Q0(f){let x=f,H=x[k0];if(!Array.isArray(H))return;x[q0]=!0;try{for(let g of H)g()}finally{delete x[q0]}}var I0=Symbol.for("@ecopages/radiant.legacy-instance-initializers"),V0=Symbol.for("@ecopages/radiant.legacy-post-construction-initializers"),A0=Symbol.for("@ecopages/radiant.legacy-executed-post-construction-initializers");function Z0(f){S0(f,I0)}function V(f,x){let H=f;b0(f,x,H[A0]??=new Set)}function S0(f,x){y0(f,(H)=>{let g=H[x];if(!Array.isArray(g))return;for(let F of g)F(f)})}function b0(f,x,H){for(let g of X0(f)){let F=g[V0];if(!Array.isArray(F))continue;for(let $ of F){if(H.has($))continue;$(f,x),H.add($)}}}function X0(f){let x=[],H=Object.getPrototypeOf(f);while(H&&H!==Object.prototype)x.unshift(H),H=Object.getPrototypeOf(H);return x}function y0(f,x){for(let H of X0(f))x(H)}function W0(f,x){switch(x){case"construct":Z0(f);break;case"connect":V(f,"connect");break;case"ssr":V(f,"ssr");break}}class A{component;host;renderView;constructor(f,x){this.component=f,this.host=F0(f),this.renderView=x}ensureReady(){w(this.host),W0(this.component,"ssr"),Q0(this.component)}renderHost(){return this.ensureReady(),{nodeType:1,outerHTML:this.renderHostToString({mode:"hydrate"})}}renderHostToString(f={},x=this.getHostAttributes()){this.ensureReady();let H=this.getTagName();return e(this.host.getContextProviders(),()=>`<${H}${n(x)}>${this.renderHostContent(f)}</${H}>`)}getHostAttributes(){return this.ensureReady(),l(this.host)}renderHostContent(f){let x=f.mode==="hydrate"||f.mode===void 0&&f.hydrate===!0,H=x?this.host.getHydrationBindings().map((g)=>g.renderHydrationScriptTag()).filter((g)=>typeof g==="string").join(""):"";return x0({hostContent:this.renderView(this.host,f),authoredHydrationMarkup:this.host.getAuthoredHydrationScriptMarkup?.()??"",slotProjectionScript:this.host.getSlotProjectionScriptTag?.()??"",hydrationScripts:H},x)}getTagName(){let f=$0(this.host.constructor);if(!f)throw Error(`${this.host.constructor.name} is missing @customElement metadata.`);return f}}import{getActiveSsrScopeValue as h0,withActiveSsrScopeValue as v0}from"@ecopages/jsx/server";var J0=Symbol.for("@ecopages/radiant.element-ssr-runtime"),L;function P0(f){L=f}function j0(f,x){if(!L)throw Error("Radiant element SSR runtime requires the server scope adapters. Import a Radiant server SSR entrypoint before rendering.");if(L.get(J0)===f)return x();return L.withValue(J0,f,x)}P0({get:h0,withValue:v0});function P(f){return`data-${f.replace(/([A-Z])/g,"-$1").toLowerCase()}`}function S(f){return f.replace(/-([a-z])/g,(x,H)=>H.toUpperCase())}var b;function G0(f){b=f}function y(){if(!b)throw Error("Minimal DOM HTML parsers are not registered. Import @ecopages/radiant/server/install-ssr-runtime (or ./html) before using innerHTML.");return b}class Z extends EventTarget{nodeType;static DOCUMENT_NODE=9;static ELEMENT_NODE=1;static TEXT_NODE=3;childNodes=[];ownerDocument;parentNode=null;constructor(f,x=null){super();this.nodeType=f;this.ownerDocument=x}append(...f){for(let x of f)this.appendChild(typeof x==="string"?c0(x):x)}appendChild(f){if("parentNode"in f&&f.parentNode&&"removeChild"in f.parentNode)f.parentNode.removeChild(f);return this.childNodes.push(f),f.ownerDocument=this.nodeType===Z.DOCUMENT_NODE?this:this.ownerDocument,f.parentNode=this,f}removeChild(f){let x=this.childNodes.indexOf(f);if(x===-1)return f;return this.childNodes.splice(x,1),f.parentNode=null,f}replaceChildren(...f){for(let x of this.childNodes)x.parentNode=null;this.childNodes=[],this.append(...f)}get textContent(){return this.childNodes.map((f)=>f.textContent??"").join("")}set textContent(f){this.replaceChildren(f??"")}getRootNode(){let f=this;while("parentNode"in f&&f.parentNode)f=f.parentNode;return f}}class j extends Z{value;constructor(f,x=G()){super(Z.TEXT_NODE,x);this.value=f}get textContent(){return this.value}set textContent(f){this.value=f??""}}class O0{element;constructor(f){this.element=f}add(...f){let x=new Set(this.readTokens());for(let H of f)if(H!=="")x.add(H);this.writeTokens([...x])}remove(...f){let x=new Set(this.readTokens());for(let H of f)x.delete(H);this.writeTokens([...x])}toggle(f,x){let H=this.contains(f);if(x??!H)return this.add(f),!0;return this.remove(f),!1}contains(f){return this.readTokens().includes(f)}toString(){return this.value}get value(){return this.element.getAttribute("class")??""}readTokens(){return this.value.split(/\s+/).map((f)=>f.trim()).filter((f)=>f.length>0)}writeTokens(f){if(f.length===0){this.element.removeAttribute("class");return}this.element.setAttribute("class",f.join(" "))}}class U extends Z{attributes=new Map;classListValue;datasetValue;fragmentHtml;fragmentText;localName;tagName;constructor(f="div",x=G()){super(Z.ELEMENT_NODE,x);this.localName=f.toLowerCase(),this.tagName=this.localName.toUpperCase()}get id(){return this.getAttribute("id")??""}set id(f){if(f===""){this.removeAttribute("id");return}this.setAttribute("id",f)}get classList(){return this.classListValue??=new O0(this),this.classListValue}get dataset(){return this.datasetValue??=new Proxy({},{deleteProperty:(f,x)=>{if(typeof x!=="string")return!1;return this.removeAttribute(P(x)),!0},get:(f,x)=>{if(typeof x!=="string")return;return this.getAttribute(P(x))??void 0},getOwnPropertyDescriptor:(f,x)=>{if(typeof x!=="string")return;return{configurable:!0,enumerable:!0,value:this.getAttribute(P(x))??void 0,writable:!0}},has:(f,x)=>{return typeof x==="string"&&this.hasAttribute(P(x))},ownKeys:()=>{return this.getAttributeNames().filter((f)=>f.startsWith("data-")).map((f)=>S(f.slice(5)))},set:(f,x,H)=>{if(typeof x!=="string")return!1;return this.setAttribute(P(x),String(H)),!0}}),this.datasetValue}hasAttribute(f){return this.attributes.has(f)}getAttribute(f){return this.attributes.get(f)??null}getAttributeNames(){return Array.from(this.attributes.keys())}setAttribute(f,x){this.fragmentHtml=void 0,this.attributes.set(f,String(x))}toggleAttribute(f,x){if(x??!this.hasAttribute(f))return this.setAttribute(f,""),!0;return this.removeAttribute(f),!1}removeAttribute(f){this.fragmentHtml=void 0,this.attributes.delete(f)}querySelector(){return null}querySelectorAll(){return[]}matches(){return!1}get outerHTML(){if(this.fragmentHtml!==void 0)return this.fragmentHtml;let f=Array.from(this.attributes.entries()).map(([x,H])=>` ${x}="${K(H)}"`).join("");return`<${this.localName}${f}>${this.innerHTML}</${this.localName}>`}get innerHTML(){return this.childNodes.map((f)=>y().serializeNodeHtml(f)).join("")}set innerHTML(f){this.fragmentHtml=void 0,this.fragmentText=void 0,this.replaceChildren(...y().parseHtmlToNodes(f,this.ownerDocument))}get textContent(){return this.fragmentText??super.textContent??""}set textContent(f){this.fragmentHtml=void 0,this.fragmentText=f??"",super.textContent=f}setSerializedFragment(f,x,H){this.fragmentHtml=f,this.fragmentText=x,this.attributes=new Map(Object.entries(H)),this.replaceChildren()}}class Y{bubbles;cancelable;composed;type;constructor(f,x={}){this.type=f,this.bubbles=x.bubbles??!1,this.cancelable=x.cancelable??!1,this.composed=x.composed??!1}}class D extends Y{detail;constructor(f,x={}){super(f,x);this.detail=x.detail}}class X extends U{isConnected=!1;constructor(f="div",x=G()){super(f,x)}insertAdjacentHTML(f,x){this.append(...y().parseHtmlToNodes(x,this.ownerDocument))}}class W extends X{constructor(f=G()){super("script",f)}}function c0(f){return new j(f,G())}function G(){return globalThis.document??null}class E extends Z{constructor(){super(Z.DOCUMENT_NODE)}createElement(f){return f.toLowerCase()==="script"?new W(this):new X(f,this)}createTextNode(f){return new j(f,this)}querySelector(){return null}querySelectorAll(){return[]}}class h{definitions=new Map;define(f,x){if(this.definitions.has(f))return;this.definitions.set(f,x)}get(f){return this.definitions.get(f)}}var z=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function B0(f){let x=[],H=0;while(H<f.length){let g=H;if(f.startsWith("<!--",H)){let q=f.indexOf("-->",H+4);H=q===-1?f.length:q+3,x.push(f.slice(g,H));continue}if(f[H]!=="<"){let q=f.indexOf("<",H);H=q===-1?f.length:q,x.push(f.slice(g,H));continue}let F=T(f,H);if(!F){x.push(f.slice(g));break}if(F.type!=="open"||F.selfClosing||z.has(F.tagName)){H=F.end,x.push(f.slice(g,H));continue}H=F.end;let $=1;while(H<f.length&&$>0){let q=f.indexOf("<",H);if(q===-1){H=f.length;break}let Q=T(f,q);if(!Q){H=f.length;break}if(H=Q.end,Q.type==="comment"||Q.type==="declaration")continue;if(Q.type==="open"&&!Q.selfClosing&&!z.has(Q.tagName)){$+=1;continue}if(Q.type==="close")$-=1}x.push(f.slice(g,H))}return x.filter((g)=>g!=="")}function d0(f,x){let H;for(let g=x+1;g<f.length;g+=1){let F=f[g];if(H){if(F===H)H=void 0;continue}if(F==='"'||F==="'"){H=F;continue}if(F===">")return g+1}return f.length}function u0(f){let x={},H=/([:^@A-Za-z0-9_.-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>/]+)))?/g;for(let g of f.matchAll(H)){let[,F,$,q,Q]=g;if(!F)continue;x[F]=$??q??Q??""}return x}function T(f,x){if(f.startsWith("<!--",x)){let s=f.indexOf("-->",x+4);return{end:s===-1?f.length:s+3,type:"comment"}}let H=d0(f,x),g=f.slice(x+1,H-1).trim();if(g==="")return;if(g.startsWith("!")||g.startsWith("?"))return{end:H,type:"declaration"};if(g.startsWith("/"))return{end:H,type:"close"};let F=/\/\s*$/.test(g),$=F?g.replace(/\/\s*$/,"").trim():g,q=$.split(/[\s/>]/,1)[0]?.toLowerCase()??"",Q=q.length,R=$.slice(Q).trim(),k=F||z.has(q)?"":s0(f,x,H,q);return{attributes:u0(R),end:H,innerHtml:k,selfClosing:F,tagName:q,type:"open"}}function s0(f,x,H,g){let F=H,$=1;while(F<f.length&&$>0){let q=f.indexOf("<",F);if(q===-1)return f.slice(H);let Q=T(f,q);if(!Q)return f.slice(H);if(Q.type==="open"&&Q.tagName===g&&!Q.selfClosing&&!z.has(g))$+=1;if(Q.type==="close"){if(f.slice(q+2,Q.end-1).trim().toLowerCase()===g){if($-=1,$===0)return f.slice(H,q)}}F=Q.end}return f.slice(H)}function r0(f,x,H){let g=x.tagName==="script"?new W(H):new X(x.tagName,H);return g.setSerializedFragment(f,m0(x.innerHtml),x.attributes),g}function m0(f){return f.replace(/<!--.*?-->/gs,"").replace(/<[^>]+>/g,"")}function p0(f,x=G()){return B0(f).map((H)=>{if(!H.startsWith("<"))return new j(H,x);let g=T(H,0);if(!g||g.type!=="open")return new j(H,x);return r0(H,g,x)})}function i0(f){if(f.nodeType===Z.TEXT_NODE)return f.textContent??"";return"outerHTML"in f&&typeof f.outerHTML==="string"?f.outerHTML:f.textContent??""}G0({parseHtmlToNodes:p0,serializeNodeHtml:i0});function U0(f){let x=globalThis.CSS;if(typeof x?.escape==="function")return x.escape(f);let H="";for(let g=0;g<f.length;g+=1){let F=f[g]??"",$=F.codePointAt(0)??0;if($===0){H+="�";continue}let q=$>=1&&$<=31||$===127,Q=g===0&&$>=48&&$<=57,R=g===1&&$>=48&&$<=57&&(f[0]??"")==="-",k=g===0&&F==="-"&&f.length===1;if(q||Q||R){H+=`\\${$.toString(16)} `;continue}if($>=128||F==="-"||F==="_"||$>=48&&$<=57||$>=65&&$<=90||$>=97&&$<=122){H+=k?`\\${F}`:F;continue}H+=`\\${F}`}return H}var C,v={escape(f){return U0(String(f))}};function Y0(){let f=globalThis,x=f.customElements;if(typeof f.Node>"u"||typeof f.Document>"u"||typeof f.Element>"u"||typeof f.HTMLElement>"u"||typeof f.document>"u"||!x||typeof x.define!=="function"||typeof x.get!=="function")return;return f.window??{CSS:f.CSS??v,CustomEvent:f.CustomEvent??D,Document:f.Document,Element:f.Element,Event:f.Event??Y,EventTarget:f.EventTarget??EventTarget,HTMLScriptElement:f.HTMLScriptElement??f.HTMLElement,HTMLElement:f.HTMLElement,Node:f.Node,document:f.document,customElements:x}}function T0(){let f=Y0();if(f)return f;return M()}function l0(){return T0(),{prepareHost(f,x={}){if(x.authoredContent!==void 0)f.innerHTML=x.authoredContent}}}function M(){let f=Y0();if(f)return f;if(C)return C;let x=new h,H=new E,g=globalThis.Event??Y,F=globalThis.CustomEvent??D,$=E,q=globalThis.EventTarget??EventTarget;return C={CSS:globalThis.CSS??v,CustomEvent:F,Document:$,Element:U,Event:g,EventTarget:q,HTMLScriptElement:W,HTMLElement:X,Node:Z,document:H,customElements:x},Object.assign(globalThis,{CSS:globalThis.CSS??v,CustomEvent:F,Document:$,Element:U,Event:g,EventTarget:q,HTMLScriptElement:W,HTMLElement:X,Node:Z,document:H,customElements:x,window:C}),C}M();var q1=!0;var Z1=!0;import{renderToString as n0}from"@ecopages/jsx/server";import{createServerHydrationBindingState as o0,isServerRenderHydrationActive as a0,withServerCustomElementRenderHook as t0,withServerHydrationBindingState as e0}from"@ecopages/jsx/server";var _;function c(f){return new A(f,d)}function O(f,x={}){return u(()=>{let H=c(f);return H.renderHostToString(x,H.getHostAttributes())})}function N(f){return{nodeType:1,outerHTML:O(f,{mode:"hydrate"})}}function ff(f){if(!J(f))return;return N(f)}function xf(f,x={}){if(!J(f))return;return O(f,x)}function d(f,x={}){return w(f),u(()=>K0(()=>n0(f.resolveTrackedRenderOutput().value,x)))}function C0(f){return c(f).getHostAttributes()}function R0(f){if(!J(f))return;return{renderHost:()=>N(f),renderHostToString:(x)=>O(f,x)}}function K0(f){return t0(({instance:x})=>{if(!J(x))return;return{nodeType:1,get outerHTML(){return Hf(x)}}},f)}function Hf(f){let x=a0(),H={hydrate:x,mode:x?"hydrate":"plain"};if(!x)return O(f,H);return e0(o0(),()=>O(f,H))}function w0(){if(_)return _;return _={getHostAttributes:C0,renderHost:N,renderHostToString:O,resolveRenderBridge:R0,renderView:d},_}function u(f){return j0(w0(),()=>t(f))}export{u as withServerRadiantElementSsrRuntime,K0 as withRadiantServerCustomElementRenderBridge,R0 as resolveRadiantElementRenderBridge,xf as renderRegisteredRadiantElementHostToString,ff as renderRegisteredRadiantElementHost,d as renderRadiantElementViewToString,O as renderRadiantElementHostToString,N as renderRadiantElementHost,C0 as getRadiantElementHostSsrAttributes,w0 as getOrCreateRadiantElementSsrRuntime,c as createRadiantElementSsrService};
2
2
 
3
- //# debugId=F29E80800D56E7A264756E2164756E21
3
+ //# debugId=BDAFF4F47F07211964756E2164756E21