@stacksjs/stx 0.2.582 → 0.2.584

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 (261) hide show
  1. package/dist/{chunk-qazn64pm.js → chunk-03qf2z4d.js} +1 -1
  2. package/dist/{chunk-yk3fbzx5.js → chunk-07869zev.js} +4 -4
  3. package/dist/chunk-08g5j4fq.js +2 -0
  4. package/dist/chunk-0hpw65yr.js +2 -0
  5. package/dist/chunk-11jmasqb.js +2 -0
  6. package/dist/chunk-2c7ysn9s.js +2 -0
  7. package/dist/chunk-2wb1w0p6.js +2 -0
  8. package/dist/chunk-2wx2aczp.js +2 -0
  9. package/dist/chunk-325dn55d.js +4 -0
  10. package/dist/chunk-34kxj258.js +2 -0
  11. package/dist/{chunk-ktyctev3.js → chunk-3y5tzxm6.js} +2 -2
  12. package/dist/{chunk-h0a2s340.js → chunk-49xtxzr8.js} +2 -2
  13. package/dist/chunk-4efqcpg5.js +2 -0
  14. package/dist/{chunk-5kh5ehfh.js → chunk-4h58as2c.js} +2 -2
  15. package/dist/chunk-4k6h00kk.js +2 -0
  16. package/dist/{chunk-y8q1n7hx.js → chunk-4myvw20e.js} +10 -10
  17. package/dist/chunk-4szz2esp.js +2 -0
  18. package/dist/chunk-4wkghwag.js +2 -0
  19. package/dist/chunk-53grq69s.js +2 -0
  20. package/dist/chunk-55n8mhq4.js +2 -0
  21. package/dist/chunk-5s229r1e.js +2 -0
  22. package/dist/chunk-5zg3xj45.js +18 -0
  23. package/dist/{chunk-hzfhn2vr.js → chunk-67m2prah.js} +2 -2
  24. package/dist/chunk-6djvj6hg.js +2 -0
  25. package/dist/chunk-6ebj7gfr.js +2 -0
  26. package/dist/{chunk-g4crr86j.js → chunk-6hgngmn0.js} +3 -3
  27. package/dist/chunk-71tnfe1n.js +2 -0
  28. package/dist/{chunk-101ekf6y.js → chunk-794v5crp.js} +2 -2
  29. package/dist/chunk-7dkwf9h5.js +2 -0
  30. package/dist/{chunk-cnknvvwm.js → chunk-7fghm9zy.js} +1 -1
  31. package/dist/{chunk-ayy9mmrw.js → chunk-7ra30crf.js} +7 -7
  32. package/dist/{chunk-117xss52.js → chunk-7xw1e8t6.js} +2 -2
  33. package/dist/{chunk-c0s3k64c.js → chunk-7ydavm3h.js} +2 -2
  34. package/dist/{chunk-qdyp2zqf.js → chunk-82bttwqm.js} +2 -2
  35. package/dist/chunk-8992smwz.js +2 -0
  36. package/dist/{chunk-0vnngvy1.js → chunk-8s7zbhdd.js} +4 -4
  37. package/dist/chunk-8zn83jfs.js +2 -0
  38. package/dist/{chunk-zz02hwec.js → chunk-96zgn94z.js} +26 -26
  39. package/dist/{chunk-43h8q2cm.js → chunk-9cpxzze0.js} +9 -9
  40. package/dist/{chunk-vx75fb0d.js → chunk-9e091vkf.js} +3 -3
  41. package/dist/chunk-9pk5jhqa.js +3 -0
  42. package/dist/{chunk-dvgvvy5b.js → chunk-9r5w6s80.js} +3 -3
  43. package/dist/{chunk-c0h2eqe0.js → chunk-a8n6mt7s.js} +2 -2
  44. package/dist/{chunk-djft0m5h.js → chunk-agy4mxn8.js} +2 -2
  45. package/dist/{chunk-ev5f79mg.js → chunk-axz1x4r9.js} +5 -5
  46. package/dist/{chunk-6w2yqtrd.js → chunk-b5van393.js} +2 -2
  47. package/dist/{chunk-w3rmepwy.js → chunk-bfbmdjh4.js} +2 -2
  48. package/dist/chunk-bqtph83n.js +2 -0
  49. package/dist/chunk-bs1bdhvp.js +2 -0
  50. package/dist/{chunk-0k5faspy.js → chunk-bsy10tz6.js} +6 -6
  51. package/dist/chunk-c1c4sh7t.js +2 -0
  52. package/dist/{chunk-zk2xk0wd.js → chunk-c6egfhy6.js} +2 -2
  53. package/dist/chunk-ce2d0hz9.js +2 -0
  54. package/dist/chunk-cjq9k1xb.js +2 -0
  55. package/dist/{chunk-k9th7hc4.js → chunk-d2jb1rkp.js} +5 -5
  56. package/dist/{chunk-yfq2v7x5.js → chunk-d4awfk42.js} +7 -7
  57. package/dist/chunk-d9vjsqs4.js +2 -0
  58. package/dist/{chunk-8v19753h.js → chunk-e26pzdxy.js} +1 -1
  59. package/dist/{chunk-nrfh7gaa.js → chunk-e556dvy4.js} +3 -3
  60. package/dist/{chunk-3qrrv6af.js → chunk-e6h7pzym.js} +1 -1
  61. package/dist/{chunk-cb2pyg5t.js → chunk-ebfpjnf3.js} +2 -2
  62. package/dist/chunk-ede39b7h.js +3 -0
  63. package/dist/chunk-f0fxyh3e.js +2 -0
  64. package/dist/{chunk-4srg0qbv.js → chunk-f29fk7dw.js} +2 -2
  65. package/dist/chunk-fjyhc41r.js +2 -0
  66. package/dist/{chunk-1v1mew46.js → chunk-fkq55rh7.js} +1 -1
  67. package/dist/chunk-fn4wwgnc.js +2 -0
  68. package/dist/{chunk-t8wpzqs4.js → chunk-g8mxprxj.js} +1 -1
  69. package/dist/chunk-h2534p6q.js +2 -0
  70. package/dist/{chunk-9jh2ake5.js → chunk-h7atbtds.js} +5 -5
  71. package/dist/{chunk-yy3ser06.js → chunk-h988fxh3.js} +5 -5
  72. package/dist/chunk-hr34x6sx.js +2 -0
  73. package/dist/{chunk-ta3wn842.js → chunk-hsy9rhct.js} +2 -2
  74. package/dist/chunk-hygxh993.js +2 -0
  75. package/dist/{chunk-s12bnv32.js → chunk-hz11wmx9.js} +2 -2
  76. package/dist/{chunk-71sdgv7e.js → chunk-j7kcjgxy.js} +215 -56
  77. package/dist/chunk-j87tntna.js +2 -0
  78. package/dist/{chunk-tszkg6sj.js → chunk-jqbk6pfk.js} +2 -2
  79. package/dist/{chunk-be2ba3hj.js → chunk-k1szsenr.js} +2 -2
  80. package/dist/{chunk-3wy8q3aq.js → chunk-k3rnpjxf.js} +5 -5
  81. package/dist/{chunk-jtbzmbzz.js → chunk-k71e38fk.js} +4 -4
  82. package/dist/chunk-kgtnfvqb.js +2 -0
  83. package/dist/chunk-krwrx9x9.js +2 -0
  84. package/dist/{chunk-t61vdbje.js → chunk-ktvr45qg.js} +6 -6
  85. package/dist/{chunk-4rkvwm6v.js → chunk-m3w67x05.js} +9 -9
  86. package/dist/chunk-m5j8hht5.js +2 -0
  87. package/dist/chunk-mc8j6dwa.js +2 -0
  88. package/dist/{chunk-vpdx7qr3.js → chunk-mmbspaqh.js} +2 -2
  89. package/dist/{chunk-pmpb34md.js → chunk-n0t938d2.js} +7 -7
  90. package/dist/{chunk-c1r7zq0q.js → chunk-n2gy2arh.js} +89 -89
  91. package/dist/chunk-n2j3pn9s.js +2 -0
  92. package/dist/{chunk-sv5nvfmb.js → chunk-np6nm4rq.js} +2 -2
  93. package/dist/chunk-ns1jqzqk.js +2 -0
  94. package/dist/chunk-p973efbe.js +2 -0
  95. package/dist/{chunk-m8tm44rq.js → chunk-pg164sdw.js} +2 -2
  96. package/dist/{chunk-yhpyqsbr.js → chunk-pxw4edw8.js} +4 -4
  97. package/dist/{chunk-1r1maqep.js → chunk-q1cvef6b.js} +3 -3
  98. package/dist/chunk-q765v7b2.js +2 -0
  99. package/dist/{chunk-620szfcp.js → chunk-qebxzf9w.js} +3 -3
  100. package/dist/{chunk-jpqkm8tm.js → chunk-qf3axv86.js} +3 -3
  101. package/dist/{chunk-7hkc96de.js → chunk-qhr1tkhj.js} +7 -7
  102. package/dist/chunk-qq59xzwc.js +2 -0
  103. package/dist/chunk-r0e743c3.js +2 -0
  104. package/dist/{chunk-qccgncp2.js → chunk-rdm5mfc5.js} +6 -6
  105. package/dist/chunk-s043hpvd.js +2 -0
  106. package/dist/{chunk-rr8a7d4q.js → chunk-s1ptn02h.js} +3 -3
  107. package/dist/{chunk-xpnpg967.js → chunk-s5vxxwg6.js} +2 -2
  108. package/dist/chunk-sckze59r.js +2 -0
  109. package/dist/chunk-sjkdpsca.js +3 -0
  110. package/dist/chunk-sr1md7vv.js +2845 -0
  111. package/dist/chunk-t431anrx.js +2 -0
  112. package/dist/chunk-t7mxbt40.js +2 -0
  113. package/dist/{chunk-r47cs92n.js → chunk-tc15vkfh.js} +2 -2
  114. package/dist/{chunk-6z3e1tyz.js → chunk-tnafnb23.js} +1 -1
  115. package/dist/{chunk-ah9xyss2.js → chunk-v8ze2q95.js} +2 -2
  116. package/dist/{chunk-t4g2fptt.js → chunk-vf15db1j.js} +6 -6
  117. package/dist/chunk-vvqxbhfx.js +2 -0
  118. package/dist/{chunk-cdgwkzms.js → chunk-w24qmxc3.js} +3 -3
  119. package/dist/chunk-w7zgftez.js +2 -0
  120. package/dist/chunk-wfp36qf4.js +2 -0
  121. package/dist/chunk-wn2gzwmv.js +2 -0
  122. package/dist/{chunk-wwj8zbzc.js → chunk-wywprjc5.js} +5 -5
  123. package/dist/chunk-x5qymgxa.js +2 -0
  124. package/dist/chunk-xfe2nzxd.js +2 -0
  125. package/dist/chunk-xjwgzp6s.js +2 -0
  126. package/dist/chunk-xyepqdjy.js +2 -0
  127. package/dist/chunk-y5ryjdpv.js +122 -0
  128. package/dist/{chunk-3e3dpp7w.js → chunk-y5x8xnnf.js} +3 -3
  129. package/dist/{chunk-74j18qk0.js → chunk-y8h823cb.js} +28 -28
  130. package/dist/chunk-yhqaafsw.js +2 -0
  131. package/dist/chunk-yn2d8x8m.js +3 -0
  132. package/dist/{chunk-kp0hg06s.js → chunk-z2mg470f.js} +4 -4
  133. package/dist/chunk-z7trbwn3.js +2 -0
  134. package/dist/{chunk-eww6sdzz.js → chunk-zgv1h2np.js} +2 -2
  135. package/dist/{chunk-bj29pwm0.js → chunk-zrw1zf54.js} +3 -3
  136. package/dist/chunk-zxf8f71v.js +2 -0
  137. package/dist/chunk-zxt75k06.js +2 -0
  138. package/dist/cli.js +46 -46
  139. package/dist/client/signals-authoring-runtime.js +13 -6
  140. package/dist/client/signals-binding-utils-runtime.js +14 -1
  141. package/dist/client/signals-component-api-runtime.js +3 -1
  142. package/dist/client/signals-event-shorthand-runtime.js +1 -1
  143. package/dist/client/signals-expression-runtime.js +1 -1
  144. package/dist/client/signals-host-runtime.js +72 -1
  145. package/dist/client/signals-manifest-hydration-runtime.js +20 -0
  146. package/dist/client/signals-model-runtime.js +2 -0
  147. package/dist/client/signals-mount-runtime.js +5 -1
  148. package/dist/client/signals-overlay-runtime.js +29 -6
  149. package/dist/client/signals-process-element-runtime.js +22 -7
  150. package/dist/client/signals-public-api-runtime.js +2 -0
  151. package/dist/client/signals-style-runtime.js +1 -1
  152. package/dist/component-model.d.ts +1 -1
  153. package/dist/component-model.js +6 -3
  154. package/dist/component-renderer.js +26 -6
  155. package/dist/composition-api.js +3 -2
  156. package/dist/craft-entry.js +2 -2
  157. package/dist/craft.js +2 -2
  158. package/dist/native/compiler/bundle.js +8 -3
  159. package/dist/native/compiler/design-tokens.d.ts +4 -0
  160. package/dist/native/compiler/design-tokens.js +28 -0
  161. package/dist/native/compiler/headwind-to-style.d.ts +5 -4
  162. package/dist/native/compiler/headwind-to-style.js +105 -65
  163. package/dist/native/compiler/html-to-ir.d.ts +5 -1
  164. package/dist/native/compiler/html-to-ir.js +75 -244
  165. package/dist/native/compiler/inline-style.d.ts +13 -0
  166. package/dist/native/compiler/inline-style.js +285 -0
  167. package/dist/native/compiler/ir.d.ts +5 -1
  168. package/dist/native/compiler/render-screen.js +3 -1
  169. package/dist/native/compiler/style-variables.d.ts +8 -0
  170. package/dist/native/compiler/style-variables.js +142 -0
  171. package/dist/native/compiler/stylesheet-theme.d.ts +6 -0
  172. package/dist/native/compiler/stylesheet-theme.js +110 -0
  173. package/dist/native/runtime/binding-tree.js +12 -0
  174. package/dist/native/runtime/craft-bridge.js +5 -2
  175. package/dist/native/runtime/jsc-globals.d.ts +10 -3
  176. package/dist/native/runtime/jsc-globals.js +23 -4
  177. package/dist/native/runtime/native-host.d.ts +17 -2
  178. package/dist/native/runtime/native-host.js +492 -39
  179. package/dist/native/runtime/overlay-presenter.d.ts +29 -0
  180. package/dist/native/runtime/overlay-presenter.js +69 -0
  181. package/dist/native/runtime/shared-screen.js +13 -1
  182. package/dist/native/runtime/view-operations.d.ts +20 -0
  183. package/dist/native/runtime/view-operations.js +35 -0
  184. package/dist/native/testing-mutations.d.ts +4 -0
  185. package/dist/native/testing-mutations.js +64 -0
  186. package/dist/native/testing.d.ts +2 -0
  187. package/dist/native/testing.js +19 -2
  188. package/dist/pwa.js +3 -3
  189. package/dist/ssg.js +8 -8
  190. package/dist/testing.js +2 -0
  191. package/dist/types/config-types.d.ts +2 -0
  192. package/dist/utils.d.ts +1 -1
  193. package/dist/utils.js +25 -5
  194. package/package.json +5 -5
  195. package/dist/chunk-0047meje.js +0 -2
  196. package/dist/chunk-00p22wzr.js +0 -3
  197. package/dist/chunk-1cat8kdj.js +0 -2
  198. package/dist/chunk-1dwnp35v.js +0 -2
  199. package/dist/chunk-2dnr5qfk.js +0 -2
  200. package/dist/chunk-2rx9d75e.js +0 -4
  201. package/dist/chunk-2v73cjbc.js +0 -2
  202. package/dist/chunk-30rf7k4n.js +0 -122
  203. package/dist/chunk-3akgppsy.js +0 -2
  204. package/dist/chunk-3x6p9me0.js +0 -2
  205. package/dist/chunk-4t67wmcg.js +0 -2
  206. package/dist/chunk-51zn42jy.js +0 -2
  207. package/dist/chunk-5702x95v.js +0 -2
  208. package/dist/chunk-5db5sxy3.js +0 -3
  209. package/dist/chunk-5pgbsc3a.js +0 -2
  210. package/dist/chunk-60c2bsh9.js +0 -2
  211. package/dist/chunk-79v4d9qh.js +0 -2
  212. package/dist/chunk-7pp2vx1g.js +0 -2
  213. package/dist/chunk-84f9dnq5.js +0 -2
  214. package/dist/chunk-8tq5x4z8.js +0 -2
  215. package/dist/chunk-8zm6tkqb.js +0 -2
  216. package/dist/chunk-a1z36dt5.js +0 -2
  217. package/dist/chunk-atsf1fe0.js +0 -2
  218. package/dist/chunk-b8qd6h1q.js +0 -2
  219. package/dist/chunk-ccxs40xy.js +0 -2
  220. package/dist/chunk-cg8hg6cs.js +0 -3
  221. package/dist/chunk-cp442y7a.js +0 -2
  222. package/dist/chunk-d4en5d3s.js +0 -2
  223. package/dist/chunk-dh80d57p.js +0 -2
  224. package/dist/chunk-dpn1pmxj.js +0 -2
  225. package/dist/chunk-dtcc09x1.js +0 -2
  226. package/dist/chunk-dyqte1xq.js +0 -2
  227. package/dist/chunk-e4n4v022.js +0 -2
  228. package/dist/chunk-efgk2xv1.js +0 -2
  229. package/dist/chunk-faghmmrs.js +0 -2838
  230. package/dist/chunk-fj70wq7k.js +0 -2
  231. package/dist/chunk-g2fw68zm.js +0 -2
  232. package/dist/chunk-hcgm37dy.js +0 -2
  233. package/dist/chunk-hd2bn5q7.js +0 -2
  234. package/dist/chunk-j1nqnmcd.js +0 -18
  235. package/dist/chunk-k7jqkt93.js +0 -2
  236. package/dist/chunk-mhjwtkx9.js +0 -2
  237. package/dist/chunk-mqy7g74k.js +0 -2
  238. package/dist/chunk-mxe21m6q.js +0 -2
  239. package/dist/chunk-ne03tfje.js +0 -2
  240. package/dist/chunk-p2sns0bn.js +0 -2
  241. package/dist/chunk-q2a58n2a.js +0 -2
  242. package/dist/chunk-s1sycp43.js +0 -2
  243. package/dist/chunk-s932zfjz.js +0 -2
  244. package/dist/chunk-sp46w7z9.js +0 -2
  245. package/dist/chunk-sy1bk1ry.js +0 -2
  246. package/dist/chunk-t48ws5j0.js +0 -2
  247. package/dist/chunk-thbc9gtj.js +0 -2
  248. package/dist/chunk-tn9v10q2.js +0 -2
  249. package/dist/chunk-tpd5nwa3.js +0 -2
  250. package/dist/chunk-tpt4bgs5.js +0 -2
  251. package/dist/chunk-v8p5p2kp.js +0 -2
  252. package/dist/chunk-v9jd283e.js +0 -2
  253. package/dist/chunk-vq0cb1m9.js +0 -2
  254. package/dist/chunk-wg2w7zmt.js +0 -3
  255. package/dist/chunk-wgkxgsqx.js +0 -2
  256. package/dist/chunk-y1bppxgw.js +0 -2
  257. package/dist/chunk-yv5rwthv.js +0 -2
  258. package/dist/chunk-yygze2s0.js +0 -2
  259. package/dist/chunk-z1r4tdqy.js +0 -2
  260. package/dist/chunk-z732tf98.js +0 -2
  261. package/dist/chunk-zv288w4e.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Gi,Ki,Xi}from"./chunk-zk2xk0wd.js";import{W,Qt,en,qr,Gr,zn,tn,nn,Kr,Hn}from"./chunk-c0s3k64c.js";function X(e,a,i,o,u){let y=!0,s=new Set,h=(l)=>o.get?o.get(l):l,r=()=>h(e());return Object.defineProperty(r,"_isSignal",{value:!0}),Object.defineProperty(r,"modifiers",{get:a}),r.set=(l)=>{if(!y)return;let m=a(),d=o.set?o.set(l,m):l;if(m.trim&&typeof d==="string")d=d.trim();if(m.number&&typeof d==="string"&&d!==""){let n=Number(d);if(!Number.isNaN(n))d=n}if(Object.is(e(),d))return;e.set(d),i(d)},r.update=(l)=>r.set(l(r())),r.input=(l)=>{if(!a().lazy)r.set(l)},r.change=(l)=>{if(a().lazy)r.set(l)},r.subscribe=(l)=>{if(!y)return()=>{};let m=e.subscribe((d,n)=>l(h(d),h(n)));return s.add(m),()=>{m(),s.delete(m)}},Object.defineProperty(r,"value",{get:r,set:r.set}),u(()=>{y=!1,s.forEach((l)=>l()),s.clear()}),r}function Q(e,a=!0,i){if(!a||!e||typeof window>"u")return;let o=window;if(!o.__STX_DATA__){let y=document.querySelector("script[data-stx-server-data]");try{let s=JSON.parse(y?.textContent||"{}");o.__STX_DATA__=s&&typeof s==="object"&&!Array.isArray(s)?s:{}}catch{o.__STX_DATA__={}}}let u=o.__STX_DATA__;if(u&&Object.prototype.hasOwnProperty.call(u,e))try{return{data:i?i(u[e]):u[e]}}catch(y){return{data:null,error:y instanceof Error?y:Error(String(y))}}return}function Y(e){if(typeof window>"u")return;let a=window;if(e===void 0)a.__STX_DATA__={};else{if(!a.__STX_DATA__)try{let i=JSON.parse(document.querySelector("script[data-stx-server-data]")?.textContent||"{}");a.__STX_DATA__=i&&typeof i==="object"&&!Array.isArray(i)?i:{}}catch{a.__STX_DATA__={}}if(a.__STX_DATA__)delete a.__STX_DATA__[e]}}function J(e){let a=null;try{a=typeof indexedDB<"u"?indexedDB:null}catch{a=null}if(!a)return null;let i=a,o=e||"stx-kept",u=null,y=()=>{if(!u)u=new Promise((h,r)=>{let l=i.open(o,1);l.onupgradeneeded=()=>{l.result.createObjectStore("kv")},l.onsuccess=()=>h(l.result),l.onerror=()=>r(l.error),l.onblocked=()=>r(Error("blocked"))}),u.catch(()=>{u=null});return u},s=(h,r)=>y().then((l)=>new Promise((m,d)=>{let n=l.transaction("kv",h),p=r(n.objectStore("kv"));n.oncomplete=()=>m(p?p.result:void 0),n.onerror=()=>d(n.error),n.onabort=()=>d(n.error)}));return{get:(h)=>s("readonly",(r)=>r.get(h)),set:(h,r)=>s("readwrite",(l)=>{l.put(r,h)}),remove:(h)=>s("readwrite",(r)=>{r.delete(h)}),removePrefix:(h)=>s("readwrite",(r)=>{r.delete(IDBKeyRange.bound(h,`${h}\uFFFF`))})}}function Z(e,a){let i=e||{},o=null;if(i.storage!==void 0)o=i.storage;else try{o=typeof localStorage<"u"?localStorage:null}catch{o=null}let u=null,y=i.backend!==void 0;if(y)u=i.backend||null;let s=()=>{if(y)return u;y=!0;try{u=a?a():null}catch{u=null}if(u){let t=u;t.get("__stx_probe__").catch(()=>{if(u===t)u=null})}return u},h=i.limit||32768,r=i.defer||((t)=>{let c=typeof requestIdleCallback==="function"?requestIdleCallback:null;if(c)c(t,{timeout:200});else setTimeout(t,16)}),l=new Map,m=new Set,d=new Map,n=!1,p=Promise.resolve(),v=(t)=>{try{return JSON.parse(t)}catch{return t}},f=(t,c)=>{if(!o)return!1;try{return o.setItem(t,c),!0}catch{return!1}},E=(t)=>{try{if(o)o.removeItem(t)}catch{}},S=()=>{if(n=!1,!d.size)return p;let t=Array.from(d.entries());return d.clear(),p=p.then(()=>Promise.all(t.map(([c,g])=>{if(!u){m.delete(c);try{f(c,JSON.stringify(g===void 0?null:g))}catch{}return}let _;try{return _={v:g},u.set(c,_).catch(()=>{let x;try{x=JSON.stringify(g)}catch{return}return u?u.set(c,{j:x}).catch(()=>{f(c,x)}):void 0})}catch{return}}))).then(()=>{}),p},N=(t,c)=>{if(d.set(t,c),m.add(t),n)return;n=!0,r(()=>{S()})},D=(t)=>{if(!t||typeof t!=="object")return;let c=t;if("v"in c)return{value:c.v};if(typeof c.j==="string")return{value:v(c.j)};return},k={peek(t){if(l.has(t))return{value:l.get(t)};let c=null;try{c=o?o.getItem(t):null}catch{c=null}if(c===null||c===void 0)return;let g=v(c);return l.set(t,g),{value:g}},load(t){let c=k.peek(t),g=c?null:s();if(c||!g)return Promise.resolve(c);return g.get(t).then((_)=>{if(l.has(t))return{value:l.get(t)};let x=D(_);if(x)l.set(t,x.value),m.add(t);return x},()=>{return})},set(t,c){if(l.set(t,c),u&&m.has(t)){N(t,c);return}let g;try{g=JSON.stringify(c===void 0?null:c)}catch{return}if(g.length<=h&&f(t,g))return;if(!s()){if(g.length>h)f(t,g);return}E(t),N(t,c)},forget(t){for(let g of Array.from(l.keys()))if(g.indexOf(t)===0)l.delete(g);for(let g of Array.from(d.keys()))if(g.indexOf(t)===0)d.delete(g);for(let g of Array.from(m))if(g.indexOf(t)===0)m.delete(g);try{if(o)for(let g=o.length-1;g>=0;g--){let _=o.key(g);if(_&&_.indexOf(t)===0)o.removeItem(_)}}catch{}let c=s();if(!c)return p;return p=p.then(()=>c.removePrefix(t)).catch(()=>{}),p},flush(){return S()}};try{if(typeof document<"u"&&document.addEventListener)document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden")S()});if(typeof addEventListener==="function")addEventListener("pagehide",()=>{S()})}catch{}return k}function ee(e,a){if(!e)return!1;if(e===a.key)return!0;if(!a.url)return!1;if(e===a.url)return!0;try{let i=typeof location<"u"&&location.origin&&location.origin!=="null"?location.origin:"http://localhost",o=new URL(e,i),u=new URL(a.url,i);if(o.origin!==u.origin||o.pathname!==u.pathname)return!1;return!o.search||o.search===u.search}catch{return!1}}function te(e){let a=e.prefix||"stx:kept:",i=e.matches||((n,p)=>n===p.key||n===p.url),o=new Set,u=new Map,y,s=(n)=>n===void 0?y:n,h=(n,p)=>{let v=s(p);if(v===!1||v===null||v==="")return null;return`${a}${v===void 0?"":`${v}:`}query:${n}`},r=(n)=>{let p=n&&n.value;if(!p||typeof p!=="object"||!("d"in p))return;return{data:p.d,at:Number(p.at)||0}},l=()=>{let n=globalThis;return n.__stx_outboxes instanceof Map?n.__stx_outboxes:null},m={setScope(n){y=n},scope:()=>y,keyFor:h,seed(n,p){let v=h(n,p);return v?r(e.kept.peek(v)):void 0},restore(n,p){let v=h(n,p);return v?e.kept.load(v).then(r):Promise.resolve(void 0)},persist(n,p,v){let f=h(n,v);if(f)e.kept.set(f,{d:p,at:Date.now()})},overlay(n,p,v){let f=l();if(!f||!f.size)return p;let E=p;return f.forEach((S)=>{try{E=S.overlay(n,E,v)}catch{}}),E},watch(n){return o.add(n),()=>{o.delete(n)}},cachedQuery(n,p){let v=u.get(n);if(v){if(p&&v.__options)v.__options(p);return v}let f=p||{},E=f.initial===void 0?null:f.initial,S=()=>typeof f.scope==="function"?f.scope():f.scope,N=()=>(typeof f.url==="function"?f.url():f.url)||null,D=()=>({key:n,url:N()}),k=S(),t=E,c=0,g=e.sharedRequest(),_=0,x=m.seed(n,k);if(x)t=x.data;let I=e.state(m.overlay(D(),t)),U=e.state(!1),q=e.state(!1),K=e.state(null),P=e.state(x?x.at:0),R=0,F=()=>{I.set(m.overlay(D(),t))},z=(b)=>{let w=R;m.restore(n,b).then((T)=>{if(!T||w!==R||c)return;t=T.data,P.set(T.at),F()})};if(!x)z(k);let wt=()=>{let b=S();if(b===k)return;k=b,R++,_=0,q.set(!1),U.set(!1),c=0;let w=m.seed(n,k);if(t=w?w.data:E,P.set(w?w.at:0),F(),!w)z(k)},_t=(b,w)=>{let T=f.timeoutMs||15000,C=typeof AbortController<"u"?new AbortController:null,O=null,j=new Promise((M,V)=>{O=setTimeout(()=>{if(C)C.abort();V(Error("The request took too long."))},T)}),A;if(f.load)A=f.load({force:b,url:w,signal:C?C.signal:void 0});else if(w){let M=f.fetch||((L,H)=>fetch(L,H)),V={method:"GET",headers:{Accept:"application/json"}};if(b)V.cache="no-cache";if(C)V.signal=C.signal;A=M(w,V).then((L)=>{if(!L.ok)return L.json().catch(()=>null).then((H)=>{throw Error(H&&(H.error||H.message)||`Request failed (${L.status})`)});return L.json()})}else return Promise.resolve(I());return Promise.race([A,j]).then((M)=>{if(O)clearTimeout(O);return f.transform?f.transform(M):M},(M)=>{if(O)clearTimeout(O);throw M})},G=(b)=>{let w=R,T=N(),C=()=>{if(w!==R)return Promise.resolve(I());if(_++,q.set(!0),c===0&&!P())U.set(!0);let j=()=>{if(w!==R)return;if(_=Math.max(0,_-1),!_)q.set(!1),U.set(!1)};return _t(b,T).then((A)=>{if(w!==R||T!==N())return j(),I();return t=A,c=Date.now(),P.set(c),K.set(null),m.persist(n,A,k),F(),j(),I()},(A)=>{if(w===R&&T===N())K.set(A&&A.message?A.message:"Could not load.");return j(),I()})},O=`${w} ${T||""}`;return b?g.fresh(O,C):g.run(O,C)},B={data:I,loading:U,isFetching:q,error:K,updatedAt:P,get key(){return n},load(b){if(wt(),!b&&c&&Date.now()-c<(f.staleTime||0))return Promise.resolve(I());return G(!!b)},refresh(){return B.load(!0)},set(b){t=typeof b==="function"?b(t):b,m.persist(n,t,k),F()},invalidate(){c=0},__options(b){f={...f,...b}}};if(o.add({target:D,updated:()=>{if(c||P())G(!1)},outbox:(b)=>{if(b)t=m.overlay(D(),t,b.id),c=0,G(!0);F()}}),u.set(n,B),f.immediate)B.load();return B}},d=typeof window<"u"?window:typeof addEventListener==="function"?globalThis:null;if(e.listen!==!1&&d&&typeof d.addEventListener==="function")d.addEventListener("stx:updated",(n)=>{let p=n.detail||{};if(p.kind!=="api"||typeof p.url!=="string")return;o.forEach((v)=>{if(i(p.url,v.target()))v.updated()})}),d.addEventListener("stx:outbox",(n)=>{let p=n.detail||{},v=p.sent&&typeof p.sent.id==="string"?p.sent:null;o.forEach((f)=>{if(v){let E=Array.isArray(v.affects)?v.affects:[],S=f.target();if(!E.some((N)=>i(N,S)))return}f.outbox(v)})});return m}function ne(e){let a=e&&e.covers||((s,h)=>Object.is(s,h)),i=[],o=[],u=0,y=(s,h)=>{let r;try{r=Promise.resolve(h())}catch(d){r=Promise.reject(d)}let l={key:s,promise:r};i.push(l);let m=()=>{let d=i.indexOf(l);if(d!==-1)i.splice(d,1)};return r.then(m,m),r};return{run(s,h){for(let r of i)if(a(r.key,s))return r.promise;for(let r of o)if(a(r.key,s))return r.promise;return y(s,h)},fresh(s,h){for(let d of o)if(a(d.key,s))return d.promise;let r=i.filter((d)=>a(d.key,s)).map((d)=>d.promise);if(!r.length)return y(s,h);let l={key:s,promise:null},m=()=>{};return l.promise=Promise.all(r.map((d)=>d.then(m,m))).then(()=>{let d=o.indexOf(l);if(d!==-1)o.splice(d,1);return y(s,h)}),o.push(l),l.promise},latest(){let s=++u;return()=>s===u},get busy(){return i.length>0||o.length>0}}}var re=` function useColorMode(options) {
2
+ import{ea,ta,na}from"./chunk-c6egfhy6.js";import{W,nn,rn,es,Gn,Kn,sn,on,ts,Xn}from"./chunk-7ydavm3h.js";function X(t,a,i,r,d,y){let o=!0,u=new Set,f=(p)=>r.get?r.get(p):p,l=()=>f(t());return Object.defineProperty(l,"_isSignal",{value:!0}),Object.defineProperty(l,"modifiers",{get:a}),l.set=(p)=>{if(!o)return;let h=a(),e=r.set?r.set(p,h):p;if(h.trim&&typeof e==="string")e=e.trim();if(h.number&&typeof e==="string"&&e!==""){let s=Number(e);if(!Number.isNaN(s))e=s}if(Object.is(t(),e))return;t.set(e),i(e)},l.update=(p)=>l.set(p(l())),l.input=(p)=>{if(!a().lazy)l.set(p)},l.change=(p)=>{if(a().lazy)l.set(p)},l.subscribe=(p)=>{if(!o)return()=>{};let h=t.subscribe((e,s)=>p(f(e),f(s)));return u.add(h),()=>{h(),u.delete(h)}},Object.defineProperty(l,"value",{get:l,set:l.set}),d(()=>{o=!1,u.forEach((p)=>p()),u.clear()}),y?.(()=>{o=!0}),l}function Q(t,a=!0,i){if(!a||!t||typeof window>"u")return;let r=window;if(!r.__STX_DATA__){let y=document.querySelector("script[data-stx-server-data]");try{let o=JSON.parse(y?.textContent||"{}");r.__STX_DATA__=o&&typeof o==="object"&&!Array.isArray(o)?o:{}}catch{r.__STX_DATA__={}}}let d=r.__STX_DATA__;if(d&&Object.prototype.hasOwnProperty.call(d,t))try{return{data:i?i(d[t]):d[t]}}catch(y){return{data:null,error:y instanceof Error?y:Error(String(y))}}return}function Y(t){if(typeof window>"u")return;let a=window;if(t===void 0)a.__STX_DATA__={};else{if(!a.__STX_DATA__)try{let i=JSON.parse(document.querySelector("script[data-stx-server-data]")?.textContent||"{}");a.__STX_DATA__=i&&typeof i==="object"&&!Array.isArray(i)?i:{}}catch{a.__STX_DATA__={}}if(a.__STX_DATA__)delete a.__STX_DATA__[t]}}function J(t){let a=null;try{a=typeof indexedDB<"u"?indexedDB:null}catch{a=null}if(!a)return null;let i=a,r=t||"stx-kept",d=null,y=()=>{if(!d)d=new Promise((u,f)=>{let l=i.open(r,1);l.onupgradeneeded=()=>{l.result.createObjectStore("kv")},l.onsuccess=()=>u(l.result),l.onerror=()=>f(l.error),l.onblocked=()=>f(Error("blocked"))}),d.catch(()=>{d=null});return d},o=(u,f)=>y().then((l)=>new Promise((p,h)=>{let e=l.transaction("kv",u),s=f(e.objectStore("kv"));e.oncomplete=()=>p(s?s.result:void 0),e.onerror=()=>h(e.error),e.onabort=()=>h(e.error)}));return{get:(u)=>o("readonly",(f)=>f.get(u)),set:(u,f)=>o("readwrite",(l)=>{l.put(f,u)}),remove:(u)=>o("readwrite",(f)=>{f.delete(u)}),removePrefix:(u)=>o("readwrite",(f)=>{f.delete(IDBKeyRange.bound(u,`${u}\uFFFF`))})}}function Z(t,a){let i=t||{},r=null;if(i.storage!==void 0)r=i.storage;else try{r=typeof localStorage<"u"?localStorage:null}catch{r=null}let d=null,y=i.backend!==void 0;if(y)d=i.backend||null;let o=()=>{if(y)return d;y=!0;try{d=a?a():null}catch{d=null}if(d){let n=d;n.get("__stx_probe__").catch(()=>{if(d===n)d=null})}return d},u=i.limit||32768,f=i.defer||((n)=>{let c=typeof requestIdleCallback==="function"?requestIdleCallback:null;if(c)c(n,{timeout:200});else setTimeout(n,16)}),l=new Map,p=new Set,h=new Map,e=!1,s=Promise.resolve(),v=(n)=>{try{return JSON.parse(n)}catch{return n}},m=(n,c)=>{if(!r)return!1;try{return r.setItem(n,c),!0}catch{return!1}},E=(n)=>{try{if(r)r.removeItem(n)}catch{}},S=()=>{if(e=!1,!h.size)return s;let n=Array.from(h.entries());return h.clear(),s=s.then(()=>Promise.all(n.map(([c,g])=>{if(!d){p.delete(c);try{m(c,JSON.stringify(g===void 0?null:g))}catch{}return}let _;try{return _={v:g},d.set(c,_).catch(()=>{let x;try{x=JSON.stringify(g)}catch{return}return d?d.set(c,{j:x}).catch(()=>{m(c,x)}):void 0})}catch{return}}))).then(()=>{}),s},N=(n,c)=>{if(h.set(n,c),p.add(n),e)return;e=!0,f(()=>{S()})},D=(n)=>{if(!n||typeof n!=="object")return;let c=n;if("v"in c)return{value:c.v};if(typeof c.j==="string")return{value:v(c.j)};return},k={peek(n){if(l.has(n))return{value:l.get(n)};let c=null;try{c=r?r.getItem(n):null}catch{c=null}if(c===null||c===void 0)return;let g=v(c);return l.set(n,g),{value:g}},load(n){let c=k.peek(n),g=c?null:o();if(c||!g)return Promise.resolve(c);return g.get(n).then((_)=>{if(l.has(n))return{value:l.get(n)};let x=D(_);if(x)l.set(n,x.value),p.add(n);return x},()=>{return})},set(n,c){if(l.set(n,c),d&&p.has(n)){N(n,c);return}let g;try{g=JSON.stringify(c===void 0?null:c)}catch{return}if(g.length<=u&&m(n,g))return;if(!o()){if(g.length>u)m(n,g);return}E(n),N(n,c)},forget(n){for(let g of Array.from(l.keys()))if(g.indexOf(n)===0)l.delete(g);for(let g of Array.from(h.keys()))if(g.indexOf(n)===0)h.delete(g);for(let g of Array.from(p))if(g.indexOf(n)===0)p.delete(g);try{if(r)for(let g=r.length-1;g>=0;g--){let _=r.key(g);if(_&&_.indexOf(n)===0)r.removeItem(_)}}catch{}let c=o();if(!c)return s;return s=s.then(()=>c.removePrefix(n)).catch(()=>{}),s},flush(){return S()}};try{if(typeof document<"u"&&document.addEventListener)document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden")S()});if(typeof addEventListener==="function")addEventListener("pagehide",()=>{S()})}catch{}return k}function ee(t,a){if(!t)return!1;if(t===a.key)return!0;if(!a.url)return!1;if(t===a.url)return!0;try{let i=typeof location<"u"&&location.origin&&location.origin!=="null"?location.origin:"http://localhost",r=new URL(t,i),d=new URL(a.url,i);if(r.origin!==d.origin||r.pathname!==d.pathname)return!1;return!r.search||r.search===d.search}catch{return!1}}function te(t){let a=t.prefix||"stx:kept:",i=t.matches||((e,s)=>e===s.key||e===s.url),r=new Set,d=new Map,y,o=(e)=>e===void 0?y:e,u=(e,s)=>{let v=o(s);if(v===!1||v===null||v==="")return null;return`${a}${v===void 0?"":`${v}:`}query:${e}`},f=(e)=>{let s=e&&e.value;if(!s||typeof s!=="object"||!("d"in s))return;return{data:s.d,at:Number(s.at)||0}},l=()=>{let e=globalThis;return e.__stx_outboxes instanceof Map?e.__stx_outboxes:null},p={setScope(e){y=e},scope:()=>y,keyFor:u,seed(e,s){let v=u(e,s);return v?f(t.kept.peek(v)):void 0},restore(e,s){let v=u(e,s);return v?t.kept.load(v).then(f):Promise.resolve(void 0)},persist(e,s,v){let m=u(e,v);if(m)t.kept.set(m,{d:s,at:Date.now()})},overlay(e,s,v){let m=l();if(!m||!m.size)return s;let E=s;return m.forEach((S)=>{try{E=S.overlay(e,E,v)}catch{}}),E},watch(e){return r.add(e),()=>{r.delete(e)}},cachedQuery(e,s){let v=d.get(e);if(v){if(s&&v.__options)v.__options(s);return v}let m=s||{},E=m.initial===void 0?null:m.initial,S=()=>typeof m.scope==="function"?m.scope():m.scope,N=()=>(typeof m.url==="function"?m.url():m.url)||null,D=()=>({key:e,url:N()}),k=S(),n=E,c=0,g=t.sharedRequest(),_=0,x=p.seed(e,k);if(x)n=x.data;let I=t.state(p.overlay(D(),n)),U=t.state(!1),q=t.state(!1),K=t.state(null),P=t.state(x?x.at:0),R=0,F=()=>{I.set(p.overlay(D(),n))},z=(b)=>{let w=R;p.restore(e,b).then((A)=>{if(!A||w!==R||c)return;n=A.data,P.set(A.at),F()})};if(!x)z(k);let wt=()=>{let b=S();if(b===k)return;k=b,R++,_=0,q.set(!1),U.set(!1),c=0;let w=p.seed(e,k);if(n=w?w.data:E,P.set(w?w.at:0),F(),!w)z(k)},_t=(b,w)=>{let A=m.timeoutMs||15000,C=typeof AbortController<"u"?new AbortController:null,O=null,j=new Promise((M,V)=>{O=setTimeout(()=>{if(C)C.abort();V(Error("The request took too long."))},A)}),T;if(m.load)T=m.load({force:b,url:w,signal:C?C.signal:void 0});else if(w){let M=m.fetch||((L,H)=>fetch(L,H)),V={method:"GET",headers:{Accept:"application/json"}};if(b)V.cache="no-cache";if(C)V.signal=C.signal;T=M(w,V).then((L)=>{if(!L.ok)return L.json().catch(()=>null).then((H)=>{throw Error(H&&(H.error||H.message)||`Request failed (${L.status})`)});return L.json()})}else return Promise.resolve(I());return Promise.race([T,j]).then((M)=>{if(O)clearTimeout(O);return m.transform?m.transform(M):M},(M)=>{if(O)clearTimeout(O);throw M})},G=(b)=>{let w=R,A=N(),C=()=>{if(w!==R)return Promise.resolve(I());if(_++,q.set(!0),c===0&&!P())U.set(!0);let j=()=>{if(w!==R)return;if(_=Math.max(0,_-1),!_)q.set(!1),U.set(!1)};return _t(b,A).then((T)=>{if(w!==R||A!==N())return j(),I();return n=T,c=Date.now(),P.set(c),K.set(null),p.persist(e,T,k),F(),j(),I()},(T)=>{if(w===R&&A===N())K.set(T&&T.message?T.message:"Could not load.");return j(),I()})},O=`${w} ${A||""}`;return b?g.fresh(O,C):g.run(O,C)},B={data:I,loading:U,isFetching:q,error:K,updatedAt:P,get key(){return e},load(b){if(wt(),!b&&c&&Date.now()-c<(m.staleTime||0))return Promise.resolve(I());return G(!!b)},refresh(){return B.load(!0)},set(b){n=typeof b==="function"?b(n):b,p.persist(e,n,k),F()},invalidate(){c=0},__options(b){m={...m,...b}}};if(r.add({target:D,updated:()=>{if(c||P())G(!1)},outbox:(b)=>{if(b)n=p.overlay(D(),n,b.id),c=0,G(!0);F()}}),d.set(e,B),m.immediate)B.load();return B}},h=typeof window<"u"?window:typeof addEventListener==="function"?globalThis:null;if(t.listen!==!1&&h&&typeof h.addEventListener==="function")h.addEventListener("stx:updated",(e)=>{let s=e.detail||{};if(s.kind!=="api"||typeof s.url!=="string")return;r.forEach((v)=>{if(i(s.url,v.target()))v.updated()})}),h.addEventListener("stx:outbox",(e)=>{let s=e.detail||{},v=s.sent&&typeof s.sent.id==="string"?s.sent:null;r.forEach((m)=>{if(v){let E=Array.isArray(v.affects)?v.affects:[],S=m.target();if(!E.some((N)=>i(N,S)))return}m.outbox(v)})});return p}function ne(t){let a=t&&t.covers||((o,u)=>Object.is(o,u)),i=[],r=[],d=0,y=(o,u)=>{let f;try{f=Promise.resolve(u())}catch(h){f=Promise.reject(h)}let l={key:o,promise:f};i.push(l);let p=()=>{let h=i.indexOf(l);if(h!==-1)i.splice(h,1)};return f.then(p,p),f};return{run(o,u){for(let f of i)if(a(f.key,o))return f.promise;for(let f of r)if(a(f.key,o))return f.promise;return y(o,u)},fresh(o,u){for(let h of r)if(a(h.key,o))return h.promise;let f=i.filter((h)=>a(h.key,o)).map((h)=>h.promise);if(!f.length)return y(o,u);let l={key:o,promise:null},p=()=>{};return l.promise=Promise.all(f.map((h)=>h.then(p,p))).then(()=>{let h=r.indexOf(l);if(h!==-1)r.splice(h,1);return y(o,u)}),r.push(l),l.promise},latest(){let o=++d;return()=>o===d},get busy(){return i.length>0||r.length>0}}}var re=` function useColorMode(options) {
3
3
  options = options || {};
4
4
  // The pre-paint boot script (stacksjs/stx#1794) publishes the app's
5
5
  // configured options here. Reading them makes a bare useColorMode() agree
@@ -281,7 +281,7 @@ catch (e) {} }
281
281
  function usePreferredLight() { return useMediaQuery('(prefers-color-scheme: light)'); }
282
282
  function usePreferredReducedMotion() { return useMediaQuery('(prefers-reduced-motion: reduce)'); }
283
283
  function usePreferredContrast() { return useMediaQuery('(prefers-contrast: more)'); }
284
- `;function oe(e){return` var __stxGeneratedIdCounter = 0;
284
+ `;function oe(t){return` var __stxGeneratedIdCounter = 0;
285
285
 
286
286
  // Stable, scope-aware DOM ids for component authoring. A component setup
287
287
  // runs with window.__STX_CURRENT_ELEMENT__ pointing at its compiled root, so
@@ -305,7 +305,7 @@ catch (e) {} }
305
305
  return normalizedPrefix + '-' + __stxGeneratedIdCounter;
306
306
  }
307
307
 
308
- var createModelSignal = ${e};
308
+ var createModelSignal = ${t};
309
309
  function useModel(name, options) {
310
310
  if (typeof name !== 'string') { options = name || {}; name = 'modelValue'; }
311
311
  options = options || {};
@@ -314,7 +314,7 @@ catch (e) {} }
314
314
  var modifiers = useReactiveProp(modifierName, {});
315
315
  var emit = window.stx.defineEmits(['update:' + name]);
316
316
  return createModelSignal(source, function() { return modifiers() || {}; },
317
- function(value) { emit('update:' + name, value); }, options, onDestroy);
317
+ function(value) { emit('update:' + name, value); }, options, onDestroy, onMount);
318
318
  }
319
319
 
320
320
  // Reactive prop binding. Bridges the gap between a parent's clientReactive
@@ -389,7 +389,15 @@ catch (e) {} }
389
389
  var initial;
390
390
  var lastRaw = null;
391
391
  var initialAttribute = readAttribute();
392
- if (initialAttribute.has) {
392
+ var initialDirectValues = root && root.__stx_direct_prop_values;
393
+ var initialDirect = initialDirectValues && (initialDirectValues[name] || initialDirectValues[kebabName] || initialDirectValues[lowerName]);
394
+ if (initialDirect && initialDirect.raw === initialAttribute.raw) {
395
+ lastRaw = initialAttribute.raw;
396
+ initial = initialDirect.value;
397
+ Object.keys(initialDirectValues).forEach(function(key) {
398
+ if (initialDirectValues[key] === initialDirect) delete initialDirectValues[key];
399
+ });
400
+ } else if (initialAttribute.has) {
393
401
  lastRaw = initialAttribute.raw;
394
402
  initial = parse(lastRaw);
395
403
  } else if (typeof staticValue === 'string' && (opts.parse || typeof defaultValue !== 'string')) {
@@ -433,9 +441,8 @@ catch (e) {} }
433
441
  }
434
442
  if (next !== s()) s.set(next);
435
443
  }
436
- var observer = new MutationObserver(sync);
437
444
  var connected = true;
438
- observer.observe(root, { attributes: true, attributeFilter: attributeNames });
445
+ var stopObserving = stxHost.observeAttributes(root, attributeNames, sync);
439
446
  // An :if hides a component and shows it again with the same setup, so
440
447
  // the link to the parent is dropped on unmount and made again on mount.
441
448
  // Disconnected for good, a component re-shown in an :if kept the prop it
@@ -444,12 +451,12 @@ catch (e) {} }
444
451
  if (connected) return;
445
452
  connected = true;
446
453
  register();
447
- observer.observe(root, { attributes: true, attributeFilter: attributeNames });
454
+ stopObserving = stxHost.observeAttributes(root, attributeNames, sync);
448
455
  sync();
449
456
  });
450
457
  onDestroy(function() {
451
458
  connected = false;
452
- observer.disconnect();
459
+ stopObserving();
453
460
  attributeNames.forEach(function(attributeName) {
454
461
  if (propSignals[attributeName] === s) delete propSignals[attributeName];
455
462
  });
@@ -561,6 +568,17 @@ catch (e) {} }
561
568
  return false;
562
569
  }
563
570
 
571
+ function bindFormControlReset(el, key, read, write) {
572
+ if (!stxHost.onFormReset) return;
573
+ var bindings = el.__stx_form_resets || (el.__stx_form_resets = {});
574
+ if (bindings[key]) return;
575
+ var initial = peek(read);
576
+ bindings[key] = true;
577
+ var stop = stxHost.onFormReset(el, function() { write(initial); });
578
+ el.__stx_destroy = el.__stx_destroy || [];
579
+ el.__stx_destroy.push(function() { stop(); delete bindings[key]; });
580
+ }
581
+
564
582
  function syncComponentPropSignal(el, name, value) {
565
583
  if (!el || !el.getAttribute || value === undefined) return;
566
584
  var scopeId = el.getAttribute('data-stx-scope');
@@ -577,7 +595,6 @@ catch (e) {} }
577
595
  var propSignal = propSignals && (propSignals[name] || propSignals[camelName]);
578
596
  if (!propSignal && scopeVars)
579
597
  propSignal = scopeVars[name] || scopeVars[camelName];
580
- if (!propSignal || !propSignal._isSignal || typeof propSignal.set !== 'function') return;
581
598
  var directValues = el.__stx_direct_prop_values || (el.__stx_direct_prop_values = {});
582
599
  var directValue = {
583
600
  raw: el.hasAttribute(name) ? el.getAttribute(name) : null,
@@ -585,6 +602,9 @@ catch (e) {} }
585
602
  };
586
603
  directValues[name] = directValue;
587
604
  directValues[camelName] = directValue;
605
+ // The parent binding can run before child setup. Keep the typed value
606
+ // even then: JSON attributes cannot retain validators or other callbacks.
607
+ if (!propSignal || !propSignal._isSignal || typeof propSignal.set !== 'function') return;
588
608
  // This runs inside the parent binding effect. Reading the child prop
589
609
  // signal normally would subscribe that effect to its own output. Parent
590
610
  // expressions that return a fresh array or object would then recurse:
@@ -1209,7 +1229,9 @@ else {
1209
1229
  el.__stx_component_emits = el.__stx_component_emits || Object.create(null);
1210
1230
  el.__stx_component_emits[event] = true;
1211
1231
  }
1212
- target.dispatchEvent(new CustomEvent(event, { detail: payload, bubbles: true, cancelable: true }));
1232
+ var emitted = new CustomEvent(event, { detail: payload, bubbles: true, cancelable: true });
1233
+ emitted.__stx_emit_args = Array.prototype.slice.call(arguments, 1);
1234
+ stxHost.emitComponentEvent(target, emitted);
1213
1235
  };
1214
1236
  },
1215
1237
  defineExpose: function(exposed) {
@@ -2364,7 +2386,7 @@ finally {
2364
2386
  if (bareIdMatch) {
2365
2387
  const fn = scope[bareIdMatch[1]];
2366
2388
  if (typeof fn === 'function' && !fn._isSignal) {
2367
- return ($event) => fn($event);
2389
+ return (...args) => fn(...args);
2368
2390
  }
2369
2391
  }
2370
2392
 
@@ -2436,7 +2458,7 @@ finally {
2436
2458
  function findElementScope(el) {
2437
2459
  let current = el;
2438
2460
  while (current && current !== document) {
2439
- // Check element-local scope first (from stx.mount())
2461
+ // Explicit element-local mounts own their scope, ahead of a registry.
2440
2462
  if (current.__stx_scope) {
2441
2463
  return current.__stx_scope;
2442
2464
  }
@@ -2709,11 +2731,11 @@ catch (e) {
2709
2731
  }
2710
2732
  throw e;
2711
2733
  }
2712
- }`;function Te(e,a){return` // ==========================================================================
2734
+ }`;function Ae(t,a){return` // ==========================================================================
2713
2735
  // Declarative Data Fetching (Feature #6 - useFetch)
2714
2736
  // ==========================================================================
2715
2737
 
2716
- var readHydratedData = ${e};
2738
+ var readHydratedData = ${t};
2717
2739
  var clearServerData = ${a};
2718
2740
 
2719
2741
  function useFetch(urlOrFn, options = {}) {
@@ -2850,7 +2872,7 @@ else if (immediate) {
2850
2872
  get isEmpty() { return !loading() && !data(); }
2851
2873
  };
2852
2874
  }
2853
- `}var Ae=` function bindFor(el, passedScope = componentScope, attrName = '@for') {
2875
+ `}var Te=` function bindFor(el, passedScope = componentScope, attrName = '@for') {
2854
2876
  if (el.__stx_for_bound) return;
2855
2877
  el.__stx_for_bound = true;
2856
2878
  const expr = el.getAttribute(attrName);
@@ -3496,7 +3518,7 @@ catch (e) {
3496
3518
  if (tgIsGroup) parent.__stx_tg_init = true;
3497
3519
  });
3498
3520
  }
3499
- `;var Ce=` // Also expose globally for convenience
3521
+ `;var Ne=` // Also expose globally for convenience
3500
3522
  window.state = state;
3501
3523
  window.derived = derived;
3502
3524
  window.memo = memo;
@@ -3563,7 +3585,7 @@ catch (e) {
3563
3585
  // Note: SPA Router and View Transitions CSS are provided by the canonical
3564
3586
  // router script (packages/router/src/client.ts) which is injected alongside
3565
3587
  // the signals runtime or via the @stxRouter directive.
3566
- `;var Ie=` function expressionUsesSignalApi(expression, name) {
3588
+ `;var Ce=` function expressionUsesSignalApi(expression, name) {
3567
3589
  var escapedName = name.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');
3568
3590
  return expressionUsesSignalMethod(expression, name)
3569
3591
  || expressionUsesSignalValue(expression, name);
@@ -3642,7 +3664,7 @@ catch (e) {
3642
3664
  console.warn('[STX] Handler error:', expr, e);
3643
3665
  }
3644
3666
  }
3645
- `;var Re=` // ==========================================================================
3667
+ `;var Ie=` // ==========================================================================
3646
3668
  // Client-side useHead / useSeoMeta
3647
3669
  // ==========================================================================
3648
3670
 
@@ -3733,7 +3755,7 @@ catch (e) {
3733
3755
  if (config.canonical) meta.push({ property: 'og:url', content: config.canonical });
3734
3756
  useHead({ title: config.title || config.ogTitle, meta: meta });
3735
3757
  }
3736
- `;var Oe=` // ==========================================================================
3758
+ `;var Re=` // ==========================================================================
3737
3759
  // Global Helpers (Feature #5)
3738
3760
  // ==========================================================================
3739
3761
 
@@ -3862,7 +3884,7 @@ catch (e) {
3862
3884
  const deps = depsMap.get(key);
3863
3885
  if (deps) notifySubscribers(deps);
3864
3886
  }
3865
- `;var Me=` // \u2500\u2500 Host \u2500\u2500
3887
+ `;var Oe=` // \u2500\u2500 Host \u2500\u2500
3866
3888
  //
3867
3889
  // The tree this runtime mutates. Every write the binding layer makes to a
3868
3890
  // node goes through here, so the same runtime can drive something that is not
@@ -3876,6 +3898,14 @@ catch (e) {
3876
3898
  // branch swap, and nowhere near the line that caused it, which keeps the web path
3877
3899
  // exactly as it was: same calls, one property lookup earlier.
3878
3900
  var stxHost = window.__stx_host || {
3901
+ parent: function(node) { return node ? node.parentElement : null; },
3902
+ getAttribute: function(node, name) { return node && node.getAttribute ? node.getAttribute(name) : null; },
3903
+ observeChildren: function(node, callback) {
3904
+ var active = true;
3905
+ var observer = new MutationObserver(function() { if (active) callback(); });
3906
+ observer.observe(node, { childList: true, subtree: true });
3907
+ return function() { active = false; observer.disconnect(); };
3908
+ },
3879
3909
  setText: function(node, value) { node.textContent = value; },
3880
3910
  setMarkup: function(node, value) { node.innerHTML = value == null ? '' : value; },
3881
3911
  setAttribute: function(node, name, value) {
@@ -3889,7 +3919,55 @@ catch (e) {
3889
3919
  node.setAttribute(name, next);
3890
3920
  },
3891
3921
  removeAttribute: function(node, name) { node.removeAttribute(name); },
3892
- setStyle: function(node, value) {
3922
+ observeAttributes: function(node, names, callback) {
3923
+ var observer = new MutationObserver(callback);
3924
+ observer.observe(node, { attributes: true, attributeFilter: names });
3925
+ return function() { observer.disconnect(); };
3926
+ },
3927
+ setStyle: function(node, value, replaceBinding) {
3928
+ // A binding owns its current keys, not the element's entire inline style.
3929
+ // Keep the original value and priority so removing a key restores them.
3930
+ if (replaceBinding) {
3931
+ var next = Object.create(null);
3932
+ var priorities = Object.create(null);
3933
+ if (typeof value === 'string') {
3934
+ var parsed = document.createElement('div').style;
3935
+ parsed.cssText = value;
3936
+ for (var i = 0; i < parsed.length; i++) {
3937
+ var property = parsed.item(i);
3938
+ next[property] = parsed.getPropertyValue(property);
3939
+ priorities[property] = parsed.getPropertyPriority(property);
3940
+ }
3941
+ }
3942
+ else if (value && typeof value === 'object' && !Array.isArray(value)) {
3943
+ Object.keys(value).forEach(function(key) {
3944
+ if (value[key] == null || value[key] === '') return;
3945
+ var name = key.indexOf('--') === 0 ? key : key.replace(/[A-Z]/g, function(c) { return '-' + c.toLowerCase(); });
3946
+ next[name] = value[key];
3947
+ });
3948
+ }
3949
+ var baseline = node.__stx_bound_style_baseline || (node.__stx_bound_style_baseline = Object.create(null));
3950
+ Object.keys(baseline).forEach(function(name) {
3951
+ if (Object.prototype.hasOwnProperty.call(next, name)) return;
3952
+ var prior = baseline[name];
3953
+ if (prior.value) node.style.setProperty(name, prior.value, prior.priority);
3954
+ else node.style.removeProperty(name);
3955
+ if (name === 'display') node.__stx_display = prior.value;
3956
+ delete baseline[name];
3957
+ });
3958
+ Object.keys(next).forEach(function(name) {
3959
+ if (!Object.prototype.hasOwnProperty.call(baseline, name)) {
3960
+ baseline[name] = {
3961
+ value: name === 'display' && node.__stx_visible === false ? node.__stx_display || '' : node.style.getPropertyValue(name),
3962
+ priority: node.style.getPropertyPriority(name)
3963
+ };
3964
+ }
3965
+ node.style.setProperty(name, next[name], priorities[name] || '');
3966
+ if (name === 'display') node.__stx_display = next[name];
3967
+ });
3968
+ if (node.__stx_visible === false) node.style.display = 'none';
3969
+ return;
3970
+ }
3893
3971
  if (typeof value === 'object' && value !== null) {
3894
3972
  Object.assign(node.style, value);
3895
3973
  if (Object.prototype.hasOwnProperty.call(value, 'display')) node.__stx_display = value.display || '';
@@ -3921,6 +3999,21 @@ catch (e) {
3921
3999
  // parameter silently makes every touch listener blocking again, so it stays
3922
4000
  // in the signature and each host decides what to do with it.
3923
4001
  listen: function(node, event, handler, options) { node.addEventListener(event, handler, options); },
4002
+ emitComponentEvent: function(node, event) { return node.dispatchEvent(event); },
4003
+ onFormReset: function(node, callback) {
4004
+ var active = true;
4005
+ var document = node.ownerDocument;
4006
+ var listener = function(event) {
4007
+ if (event.target !== node.form) return;
4008
+ // The reset event precedes the browser default action and may be
4009
+ // canceled by a later listener. Synchronize models only afterward.
4010
+ queueMicrotask(function() {
4011
+ if (active && !event.defaultPrevented) callback();
4012
+ });
4013
+ };
4014
+ document.addEventListener('reset', listener, true);
4015
+ return function() { active = false; document.removeEventListener('reset', listener, true); };
4016
+ },
3924
4017
 
3925
4018
  // Returns the PREVIOUS visibility. bindShow needs to know whether it just
3926
4019
  // revealed something, and asking the node afterwards is the one read-back
@@ -4879,10 +4972,10 @@ else if (!value && isInserted) {
4879
4972
  }
4880
4973
  });
4881
4974
  }
4882
- `;function je(e,a,i,o,u){return` // One request for every caller that wants the same answer: run joins one
4975
+ `;function je(t,a,i,r,d){return` // One request for every caller that wants the same answer: run joins one
4883
4976
  // in flight, fresh waits one out and asks again, latest replaces a request
4884
4977
  // counter. See shared-request.ts; cached queries are built on it.
4885
- var sharedRequest = (${u});
4978
+ var sharedRequest = (${d});
4886
4979
 
4887
4980
  // A value kept between visits, for a phone app between launches: the tab a
4888
4981
  // user opens right after starting the app draws last time's data at once
@@ -4898,8 +4991,8 @@ else if (!value && isInserted) {
4898
4991
  // off the critical path and read back asynchronously. Values kept before it
4899
4992
  // are read where they are.
4900
4993
  var STX_KEPT_PREFIX = 'stx:kept:';
4901
- var __stxKept = (${e})(undefined, ${a});
4902
- var __stxQueries = (${i})({ state: state, kept: __stxKept, prefix: STX_KEPT_PREFIX, matches: ${o}, sharedRequest: sharedRequest });
4994
+ var __stxKept = (${t})(undefined, ${a});
4995
+ var __stxQueries = (${i})({ state: state, kept: __stxKept, prefix: STX_KEPT_PREFIX, matches: ${r}, sharedRequest: sharedRequest });
4903
4996
  function stxKeptPrefix(scope) {
4904
4997
  return STX_KEPT_PREFIX + (scope === undefined || scope === null || scope === '' ? '' : String(scope) + ':');
4905
4998
  }
@@ -5385,6 +5478,11 @@ else if (!value && isInserted) {
5385
5478
  // that no longer exists in the host tree. Browser hydration keeps its
5386
5479
  // existing behaviour because it does not pass resolvedNodes here.
5387
5480
  if (resolvedNodes && node.__stxId !== undefined && node.isConnected === false) continue;
5481
+ if (resolvedNodes && node.hasAttribute && node.hasAttribute('data-stx-scope')
5482
+ && !hasPendingLoopBoundary(node)) {
5483
+ node.__stx_parent_scope = resolveComponentCallerScope(node, scope);
5484
+ bindParentComponentProps(node, node.__stx_parent_scope);
5485
+ }
5388
5486
  processElement(node, scope, true);
5389
5487
  }
5390
5488
  return true;
@@ -5408,12 +5506,27 @@ else if (!value && isInserted) {
5408
5506
  var disposeEffects = trackEffects(function() {
5409
5507
  processFromManifest(root, scope, manifest, resolvedNodes);
5410
5508
  });
5509
+ // The manifest visits bindings, not every component. Static component
5510
+ // roots still own lifecycle hooks, and those hooks must see fully bound
5511
+ // props/refs. Detached conditional and loop sources must not mount.
5512
+ [root].concat(stxHost.descendants(root)).forEach(function(node) {
5513
+ if (!node || node.isConnected === false || !node.getAttribute || hasPendingLoopBoundary(node)) return;
5514
+ var scopeId = node.getAttribute('data-stx-scope');
5515
+ var local = scopeId && window.stx._scopes && window.stx._scopes[scopeId];
5516
+ if (!local || local.__mounted || local.__suspended) return;
5517
+ if (node.hasAttribute('stx-hydrate') && !node.__stx_hydrated) return;
5518
+ local.__el = node;
5519
+ local.__mounted = true;
5520
+ runMountCallbacks(local.__mountCallbacks || [], scopeDestroySink(local));
5521
+ });
5411
5522
  runMountCallbacks(localMountHooks, localDestroyHooks);
5412
5523
  var mounted = true;
5413
5524
  return function disposeHost() {
5414
5525
  if (!mounted) return;
5415
5526
  mounted = false;
5416
5527
  disposeEffects();
5528
+ disposeSubtreeEffects(root);
5529
+ disposeSubtreeScopes(root);
5417
5530
  var hooks = localDestroyHooks.splice(0, localDestroyHooks.length);
5418
5531
  for (var i = 0; i < hooks.length; i++) {
5419
5532
  try { hooks[i](); }
@@ -5481,6 +5594,8 @@ catch (e) {
5481
5594
  }
5482
5595
  };
5483
5596
 
5597
+ bindFormControlReset(el, 'model', getValue, setValue);
5598
+
5484
5599
  if (tag === 'input' && type === 'checkbox') {
5485
5600
  var syncCheckbox = () => {
5486
5601
  var current = getValue();
@@ -5775,7 +5890,11 @@ else {
5775
5890
  if (typeof scope === 'object' && scope !== null) {
5776
5891
  scope.$el = root;
5777
5892
  scope.$refs = scope.$refs || {};
5778
- root.__stx_scope = scope; // Store isolated scope on element
5893
+ // An auto-mounted page can start with a shared component. That
5894
+ // wrapper already owns a component scope: the page supplies its
5895
+ // caller, not a replacement for its handlers/refs/prop signals.
5896
+ if (root.hasAttribute('data-stx-component-wrapper')) root.__stx_parent_scope = scope;
5897
+ else root.__stx_scope = scope;
5779
5898
  Object.assign(componentScope, scope); // Keep for backwards compat
5780
5899
  }
5781
5900
 
@@ -6149,6 +6268,19 @@ else {
6149
6268
 
6150
6269
  // Lock, listen and inert to match the stack after any change.
6151
6270
  function _overlaySync() {
6271
+ if (stxHost.isNative) {
6272
+ stxHost.syncOverlays(_overlays.map(function(entry) {
6273
+ return Object.assign({}, entry, { onRequestClose: function(event) {
6274
+ if (entry.onRequestClose) { entry.onRequestClose(event); return; }
6275
+ var reason = event && (event.reason || (event.nativeEvent && event.nativeEvent.reason));
6276
+ if (reason === 'backdrop') { if (entry.onBackdrop) entry.onBackdrop(); }
6277
+ else if (reason === 'back' || reason === 'escape') { if (entry.onEscape) entry.onEscape(); }
6278
+ else if (!!entry.onBackdrop === !!entry.onEscape) { if (entry.onEscape) entry.onEscape(); }
6279
+ else console.warn('[stx:overlays] Native dismissal was denied: this host must report reason=backdrop or reason=back to honor different closeOnBackdrop/closeOnEscape policies.');
6280
+ } });
6281
+ }));
6282
+ return;
6283
+ }
6152
6284
  for (var i = 0; i < _overlayInerted.length; i++) {
6153
6285
  try { _overlayInerted[i].inert = false; }
6154
6286
  catch (_e) { /* element may be gone */ }
@@ -6297,10 +6429,15 @@ else {
6297
6429
  var at = _overlayIndex(id);
6298
6430
  if (at !== -1) {
6299
6431
  var existing = _overlays[at];
6432
+ var updated = Object.assign({}, existing);
6300
6433
  for (var key in opts) {
6301
- if (Object.prototype.hasOwnProperty.call(opts, key)) existing[key] = opts[key];
6434
+ if (Object.prototype.hasOwnProperty.call(opts, key)) updated[key] = opts[key];
6302
6435
  }
6303
- _overlaySync();
6436
+ // A native presenter holds callbacks for the last accepted entry.
6437
+ // Do not mutate it until the replacement has passed host validation.
6438
+ _overlays[at] = updated;
6439
+ try { _overlaySync(); }
6440
+ catch (e) { _overlays[at] = existing; throw e; }
6304
6441
  return;
6305
6442
  }
6306
6443
  var isModal = opts.modal !== false;
@@ -6311,18 +6448,23 @@ else {
6311
6448
  root: opts.root || null,
6312
6449
  zIndex: typeof opts.zIndex === 'number' ? opts.zIndex : null,
6313
6450
  onEscape: opts.onEscape || null,
6451
+ onBackdrop: opts.onBackdrop || null,
6314
6452
  initialFocus: opts.initialFocus || null,
6315
6453
  // A popup hands focus back itself, to its own trigger, and only when
6316
6454
  // focus was inside it; a modal layer always does.
6317
6455
  restoreFocus: opts.restoreFocus !== undefined ? opts.restoreFocus !== false : isModal,
6318
- opener: opts.opener !== undefined ? opts.opener : document.activeElement
6456
+ opener: opts.opener !== undefined ? opts.opener : (stxHost.isNative ? null : document.activeElement),
6457
+ // Native Modal reports backdrop/back dismissal through the same host
6458
+ // event. Shared components supply the applicable dismissal policy.
6459
+ onRequestClose: opts.onRequestClose || null
6319
6460
  };
6320
6461
  _overlays.push(entry);
6321
- _overlaySync();
6462
+ try { _overlaySync(); }
6463
+ catch (e) { _overlays.splice(_overlays.indexOf(entry), 1); throw e; }
6322
6464
  // Synchronously first, so a caller that asserts focus straight after
6323
6465
  // opening sees it; then retried for a panel that is not displayed yet.
6324
6466
  // A popup keeps focus where its own keyboard handling puts it.
6325
- if (isModal || opts.initialFocus) _overlayFocusIn(entry, 10);
6467
+ if (!stxHost.isNative && (isModal || opts.initialFocus)) _overlayFocusIn(entry, 10);
6326
6468
  },
6327
6469
  /** Take an overlay off the stack, wherever it is in it. */
6328
6470
  close: function(id) {
@@ -6334,7 +6476,7 @@ else {
6334
6476
  // Only the overlay that had the keyboard gives it back. Closing one
6335
6477
  // underneath (its owner went away) must not pull focus out of the top.
6336
6478
  var opener = entry.opener;
6337
- if (wasTop && entry.restoreFocus && opener && opener.isConnected !== false && typeof opener.focus === 'function') {
6479
+ if (!stxHost.isNative && wasTop && entry.restoreFocus && opener && opener.isConnected !== false && typeof opener.focus === 'function') {
6338
6480
  try { opener.focus(); }
6339
6481
  catch (_e) { /* gone; nothing to give focus back to */ }
6340
6482
  }
@@ -6762,7 +6904,7 @@ finally {
6762
6904
  collectSubscribers(subscribers, reached);
6763
6905
  reached.forEach(function(e) { e(); });
6764
6906
  }
6765
- `;function Je(e,a,i){return`${e} // ==========================================================================
6907
+ `;function Je(t,a,i){return`${t} // ==========================================================================
6766
6908
  // Reactive Core
6767
6909
  // ==========================================================================
6768
6910
 
@@ -7031,7 +7173,7 @@ else {
7031
7173
 
7032
7174
  return value;
7033
7175
  }
7034
- `;function tt(e,a,i){return` // skipChildren: this element's bindings only, because something else already
7176
+ `;function tt(t,a,i){return` // skipChildren: this element's bindings only, because something else already
7035
7177
  // knows where the rest are. The manifest path passes it for every entry, so
7036
7178
  // the tree is never walked; see processFromManifest.
7037
7179
  function processElement(el, scope = componentScope, skipChildren) {
@@ -7054,8 +7196,12 @@ else {
7054
7196
  return;
7055
7197
  }
7056
7198
 
7057
- if (el.nodeType === Node.ELEMENT_NODE && el.tagName === 'BUTTON' && el.hasAttribute && el.hasAttribute('@click')) {
7058
-
7199
+ if (el.nodeType === Node.ELEMENT_NODE && el.hasAttribute
7200
+ && el.hasAttribute('data-stx-scope') && !hasPendingLoopBoundary(el)) {
7201
+ // A page walk can reach a component before the dedicated scope pass.
7202
+ // Resolve its caller before props/events bind and their guards latch.
7203
+ el.__stx_parent_scope = el.__stx_parent_scope || resolveComponentCallerScope(el, scope);
7204
+ bindParentComponentProps(el, el.__stx_parent_scope);
7059
7205
  }
7060
7206
  if (el.nodeType === Node.ELEMENT_NODE && el.hasAttribute) {
7061
7207
  // x-data elements: the reactive bridge has registered their scope into window.stx._scopes.
@@ -7301,7 +7447,7 @@ catch (e2) {
7301
7447
  };
7302
7448
 
7303
7449
  // Known directive names to exclude from generic :attr binding
7304
- var DIRECTIVE_NAMES = ${e};
7450
+ var DIRECTIVE_NAMES = ${t};
7305
7451
 
7306
7452
  // A bound value cannot introduce a URL scheme the page did not ask for.
7307
7453
  // This is the client half of url-safety.ts: the server refuses a scheme
@@ -7382,6 +7528,13 @@ catch (e2) {
7382
7528
  var bindingScope = el.__stx_parent_scope && parentBindingNames.includes(attrName)
7383
7529
  ? el.__stx_parent_scope
7384
7530
  : attrCapturedScope;
7531
+ if ((attrName === 'value' || attrName === 'checked') && attrName in el) {
7532
+ var modelName = value.trim().match(/^([a-zA-Z_$][\\w$]*)(?:\\(\\))?$/);
7533
+ var resetModel = modelName && bindingScope[modelName[1]];
7534
+ if (resetModel && resetModel._isSignal && typeof resetModel.set === 'function') {
7535
+ bindFormControlReset(el, attrName, resetModel, function(initial) { resetModel.set(initial); });
7536
+ }
7537
+ }
7385
7538
  effect(() => {
7386
7539
  if (!attributesVisible()) return;
7387
7540
  const v = evalAttrExpr(value, bindingScope);
@@ -7535,6 +7688,9 @@ else if (name === 'ref' || name === ':ref' || name === 'x-ref' || name === 'data
7535
7688
  if (refOwnerScope.$refs) refOwnerScope.$refs[value] = el;
7536
7689
  }
7537
7690
  else {
7691
+ // Manifest hydration receives the page scope for each node. A
7692
+ // component-local ref still belongs to the node's owning scope.
7693
+ if (refOwnerScope && refOwnerScope.$refs) refOwnerScope.$refs[value] = el;
7538
7694
  if (scope.$refs) scope.$refs[value] = el;
7539
7695
  if (componentScope.$refs) componentScope.$refs[value] = el;
7540
7696
  }
@@ -7544,7 +7700,7 @@ else if (name === 'ref' || name === ':ref' || name === 'x-ref' || name === 'data
7544
7700
  // it silently returned undefined.
7545
7701
  var refTarget = refCaller && refOwnerScope
7546
7702
  ? refOwnerScope[value]
7547
- : (scope && scope[value]) || componentScope[value];
7703
+ : (refOwnerScope && refOwnerScope[value]) || (scope && scope[value]) || componentScope[value];
7548
7704
  if (refTarget && typeof refTarget === 'function' && refTarget._isSignal && typeof refTarget.set === 'function') {
7549
7705
  refTarget.set(el);
7550
7706
  }
@@ -7602,9 +7758,10 @@ else if (name === 'ref' || name === ':ref' || name === 'x-ref' || name === 'data
7602
7758
  // Vue-style component handlers receive the emitted payload directly.
7603
7759
  // Native root events still receive the Event object so server-only
7604
7760
  // components can forward clicks and other browser events.
7605
- var handlerEvent = isForwardedComponentEvent && event instanceof CustomEvent
7606
- ? event.detail
7607
- : event;
7761
+ var emittedArgs = isForwardedComponentEvent && event instanceof CustomEvent
7762
+ && Array.isArray(event.__stx_emit_args) ? event.__stx_emit_args : null;
7763
+ var handlerEvent = emittedArgs ? emittedArgs[0]
7764
+ : isForwardedComponentEvent && event instanceof CustomEvent ? event.detail : event;
7608
7765
 
7609
7766
  // Skip an opener click that reaches UI which just became visible in
7610
7767
  // this frame. A click whose target is inside the revealed subtree is
@@ -7637,7 +7794,7 @@ else if (name === 'ref' || name === ':ref' || name === 'x-ref' || name === 'data
7637
7794
  try {
7638
7795
  if (!value || /^__[A-Z_]+__$/.test(value.trim())) return;
7639
7796
  var shorthandFn = parseEventShorthand(value, eventCapturedScope);
7640
- if (shorthandFn) { shorthandFn(handlerEvent); return; }
7797
+ if (shorthandFn) { shorthandFn.apply(null, emittedArgs || [handlerEvent]); return; }
7641
7798
  // Check if any scope values are signals (x-data pattern)
7642
7799
  // A derived value reads like a signal in a handler, as it does in a
7643
7800
  // binding: \`pick(selectedPackage)\` passes the package. Leaving it
@@ -7805,7 +7962,7 @@ catch (e) {
7805
7962
  },
7806
7963
  });
7807
7964
  }
7808
- `;function rt(e){return` // Component mount system
7965
+ `;function rt(t){return` // Component mount system
7809
7966
  var mountQueue = [];
7810
7967
 
7811
7968
  // MERGE, never replace (#1804). Three client bundles assign window.stx and
@@ -7912,9 +8069,11 @@ catch (e) {
7912
8069
  confirm: stxConfirm,
7913
8070
  helpers: globalHelpers,
7914
8071
 
7915
- ${e}
8072
+ ${t}
7916
8073
 
7917
8074
  _mountCallbacks: mountCallbacks,
8075
+ // Internal adapter for the shared component library, not a DOM facade.
8076
+ _host: stxHost,
7918
8077
  _destroyCallbacks: destroyCallbacks,
7919
8078
  _cleanupContainer: cleanupContainer,
7920
8079
  _flushLoad: flushStxLoad,
@@ -9191,7 +9350,7 @@ catch (e2) {
9191
9350
  effect(() => {
9192
9351
  if (isVisible && !isVisible()) return;
9193
9352
  const value = evalExpr();
9194
- stxHost.setStyle(el, value);
9353
+ stxHost.setStyle(el, value, true);
9195
9354
  });
9196
9355
  }
9197
9356
  `;var ft=` // <Suspense> boundary (#1742). Aggregates the loading/error state of every
@@ -10101,17 +10260,17 @@ else if (timer === null) {
10101
10260
  subscribe: subscribe
10102
10261
  };
10103
10262
  }
10104
- `;function Ne(){let e=xt(Zt());try{let i=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(e);return i=i.replace(/\}(var |let |const |function )/g,"};$1"),i}catch{return e}}function xt(e){let a=[],i=0,o="console.log(";while(i<e.length){let u=e.indexOf(o,i);if(u===-1){a.push(e.slice(i));break}a.push(e.slice(i,u));let y=1,s=u+o.length;while(s<e.length&&y>0){let h=e[s];if(h==='"'||h==="'"||h==="`"){let r=h;s++;while(s<e.length&&e[s]!==r){if(e[s]==="\\")s++;s++}s++;continue}if(h==="(")y++;else if(h===")")y--;s++}a.push("0"),i=s}return a.join("")}function Zt(){return`${ae}${Me}
10263
+ `;function Me(){let t=xt(tn());try{let i=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t);return i=i.replace(/\}(var |let |const |function )/g,"};$1"),i}catch{return t}}function xt(t){let a=[],i=0,r="console.log(";while(i<t.length){let d=t.indexOf(r,i);if(d===-1){a.push(t.slice(i));break}a.push(t.slice(i,d));let y=1,o=d+r.length;while(o<t.length&&y>0){let u=t[o];if(u==='"'||u==="'"||u==="`"){let f=u;o++;while(o<t.length&&t[o]!==f){if(t[o]==="\\")o++;o++}o++;continue}if(u==="(")y++;else if(u===")")y--;o++}a.push("0"),i=o}return a.join("")}function tn(){return`${ae}${Oe}
10105
10264
  ${Je(ie,Se,Ee)}
10106
10265
 
10107
- ${Oe}
10266
+ ${Re}
10108
10267
  ${nt}
10109
10268
  ${et}
10110
10269
  ${dt}
10111
10270
  ${_e}
10112
10271
  ${He}
10113
10272
  ${bt}
10114
- ${Te(Q.toString(),Y.toString())}
10273
+ ${Ae(Q.toString(),Y.toString())}
10115
10274
  ${ot}
10116
10275
  ${We}
10117
10276
  ${Qe}
@@ -10122,13 +10281,13 @@ ${ze}
10122
10281
 
10123
10282
  ${ke}
10124
10283
  ${xe}
10125
- ${Ie}
10284
+ ${Ce}
10126
10285
  ${Ve}
10127
10286
  ${se}
10128
10287
  ${de}
10129
10288
  ${fe}
10130
10289
  ${Ke}
10131
- ${tt(Ki(),Xi(),Gi())}
10290
+ ${tt(ta(),na(),ea())}
10132
10291
 
10133
10292
  ${ft}
10134
10293
  ${it}
@@ -10139,7 +10298,7 @@ ${yt}
10139
10298
  ${Ue}
10140
10299
  ${ue}
10141
10300
  ${Be}
10142
- ${Ae}
10301
+ ${Te}
10143
10302
  ${qe}
10144
10303
  ${he}
10145
10304
  ${Le}
@@ -10154,7 +10313,7 @@ ${pt}
10154
10313
  ${je(Z.toString(),J.toString(),te.toString(),ee.toString(),ne.toString())}
10155
10314
  ${ge}
10156
10315
  ${oe(X.toString())}
10157
- ${Re}
10316
+ ${Ie}
10158
10317
  ${vt}
10159
10318
 
10160
10319
  ${Xe}
@@ -10169,7 +10328,7 @@ ${ut}
10169
10328
  ${$e}
10170
10329
  });
10171
10330
 
10172
- ${Ce}
10331
+ ${Ne}
10173
10332
  ${ye}
10174
10333
  ${be}
10175
10334
  ${st}
@@ -10179,5 +10338,5 @@ ${lt}
10179
10338
  ${ct}
10180
10339
  ${at}
10181
10340
  })();
10182
- `}var gd={state:W,derived:Qt,effect:en,batch:qr,onMount:Gr,onDestroy:zn,isSignal:tn,isDerived:nn,untrack:Kr,peek:Hn,generateSignalsRuntime:Ne,generateSignalsRuntimeDev:Zt};
10183
- export{Ne,Zt,gd};
10341
+ `}var xu={state:W,derived:nn,effect:rn,batch:es,onMount:Gn,onDestroy:Kn,isSignal:sn,isDerived:on,untrack:ts,peek:Xn,generateSignalsRuntime:Me,generateSignalsRuntimeDev:tn};
10342
+ export{Me,tn,xu};