@stacksjs/stx 0.2.861 → 0.2.862

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 (290) hide show
  1. package/dist/analytics.js +3 -2
  2. package/dist/animation.js +3 -3
  3. package/dist/app-shell.js +4 -3
  4. package/dist/{chunk-14cvwsy1.js → chunk-01c16zw4.js} +2 -2
  5. package/dist/chunk-0bfgsv31.js +2 -0
  6. package/dist/chunk-0c9c9v03.js +14 -0
  7. package/dist/{chunk-naj146zq.js → chunk-0fh47gp0.js} +2 -2
  8. package/dist/chunk-0fpx3ctt.js +2 -0
  9. package/dist/chunk-0twkeh31.js +2 -0
  10. package/dist/chunk-0xtda6aw.js +2 -0
  11. package/dist/chunk-12sv6b9c.js +2 -0
  12. package/dist/chunk-194t5qat.js +2 -0
  13. package/dist/chunk-1crn4fv0.js +2 -0
  14. package/dist/chunk-1d3swbqw.js +2 -0
  15. package/dist/{chunk-9syvkm5z.js → chunk-1mqcttg3.js} +6 -6
  16. package/dist/chunk-1qf07v41.js +2 -0
  17. package/dist/chunk-24hq8mka.js +3 -0
  18. package/dist/chunk-2asyyky3.js +2 -0
  19. package/dist/chunk-2dpessnc.js +54 -0
  20. package/dist/{chunk-h4aqpf2r.js → chunk-2jgtfjyr.js} +5 -5
  21. package/dist/chunk-2kfayg4t.js +712 -0
  22. package/dist/chunk-2rff5mbj.js +4 -0
  23. package/dist/chunk-2s7rmn9r.js +3 -0
  24. package/dist/{chunk-avp271q4.js → chunk-2srjavsn.js} +2 -2
  25. package/dist/chunk-2zqh7xct.js +2 -0
  26. package/dist/chunk-321fbxnm.js +1327 -0
  27. package/dist/chunk-3gk1e2b1.js +2 -0
  28. package/dist/chunk-3ryp43f3.js +2 -0
  29. package/dist/{chunk-12r22pf0.js → chunk-3z1mmar2.js} +2 -2
  30. package/dist/{chunk-zhxdpzga.js → chunk-46ddesnf.js} +3 -3
  31. package/dist/chunk-46pxmpeb.js +3 -0
  32. package/dist/chunk-4pr29yrx.js +2 -0
  33. package/dist/{chunk-6nb49h13.js → chunk-4xanjv22.js} +125 -126
  34. package/dist/chunk-4ykgjewy.js +16 -0
  35. package/dist/{chunk-tjz3r7rj.js → chunk-55zq2ha8.js} +5 -5
  36. package/dist/{chunk-gggadrs4.js → chunk-5a0d3048.js} +3 -3
  37. package/dist/chunk-5ertqfs3.js +2 -0
  38. package/dist/chunk-627hzzs3.js +2 -0
  39. package/dist/chunk-64ebysb4.js +2 -0
  40. package/dist/{chunk-4rrxrxp6.js → chunk-669b2bya.js} +4 -4
  41. package/dist/{chunk-38qp2pg2.js → chunk-67dgp45w.js} +2 -2
  42. package/dist/chunk-6fstz73t.js +2 -0
  43. package/dist/{chunk-5xdkmn39.js → chunk-6ftee542.js} +2 -2
  44. package/dist/{chunk-5wr1qqz3.js → chunk-6k4ac74t.js} +2 -2
  45. package/dist/{chunk-121cgm3s.js → chunk-6m63rc7m.js} +8 -8
  46. package/dist/{chunk-c2w4wc9f.js → chunk-6m6y9bbx.js} +1 -1
  47. package/dist/chunk-6pczzq5f.js +2 -0
  48. package/dist/{chunk-6tp0w6hf.js → chunk-7ayvybdy.js} +3 -3
  49. package/dist/chunk-7mjf144y.js +2 -0
  50. package/dist/{chunk-5neezkj1.js → chunk-7mpqfg98.js} +21 -21
  51. package/dist/chunk-7q5h2cve.js +2 -0
  52. package/dist/chunk-7wqevtks.js +2 -0
  53. package/dist/chunk-84ztb43k.js +2 -0
  54. package/dist/{chunk-bag9q4m0.js → chunk-8502xb4n.js} +39 -39
  55. package/dist/{chunk-5ka3h8dy.js → chunk-85j9qh7v.js} +45 -46
  56. package/dist/{chunk-cxpq2zna.js → chunk-8arfg8kp.js} +3 -3
  57. package/dist/{chunk-xmy6g81m.js → chunk-8hhhmscy.js} +2 -2
  58. package/dist/{chunk-fyfvqd2s.js → chunk-8me8hamk.js} +2 -2
  59. package/dist/{chunk-pb09xy77.js → chunk-8s6s6nd0.js} +2 -2
  60. package/dist/chunk-8v1zpdef.js +2 -0
  61. package/dist/chunk-94mpe1ny.js +3 -0
  62. package/dist/chunk-94wnfxnd.js +2 -0
  63. package/dist/chunk-9jxs8sw2.js +2 -0
  64. package/dist/{chunk-eye156nv.js → chunk-9y9jecky.js} +1 -1
  65. package/dist/{chunk-mzes9ds7.js → chunk-9zrvh3pz.js} +2 -2
  66. package/dist/{chunk-68w65mhs.js → chunk-adb045wf.js} +3 -3
  67. package/dist/{chunk-fpkp0bqf.js → chunk-adqh1gp1.js} +1 -1
  68. package/dist/chunk-az5xw3w8.js +2 -0
  69. package/dist/chunk-ba91r7q9.js +2 -0
  70. package/dist/{chunk-qkcn0exq.js → chunk-brzjass3.js} +6 -6
  71. package/dist/chunk-bv7g3b3b.js +2 -0
  72. package/dist/chunk-bwdbj60y.js +3 -0
  73. package/dist/chunk-bwz2ehq9.js +33 -0
  74. package/dist/{chunk-3wg9kr5z.js → chunk-bx5d87xx.js} +6 -7
  75. package/dist/chunk-bz6dg4k8.js +3 -0
  76. package/dist/chunk-c34qn4k8.js +16 -0
  77. package/dist/{chunk-37tefp7s.js → chunk-cqhwzd9y.js} +5 -5
  78. package/dist/chunk-cvgbtmxp.js +2 -0
  79. package/dist/chunk-czpn3n1p.js +2 -0
  80. package/dist/chunk-dhnw2qwq.js +25 -0
  81. package/dist/{chunk-65cbfx5x.js → chunk-dpmayc2w.js} +2 -2
  82. package/dist/{chunk-d6216bcw.js → chunk-dtarm8x9.js} +9 -9
  83. package/dist/chunk-dydy9zrq.js +3 -0
  84. package/dist/chunk-eafqxbr0.js +2 -0
  85. package/dist/{chunk-hyea17hp.js → chunk-eeq8k81z.js} +155 -157
  86. package/dist/{chunk-qjm23ma2.js → chunk-ew5cey88.js} +1 -1
  87. package/dist/chunk-fa97kz5j.js +2 -0
  88. package/dist/{chunk-xppm4cs4.js → chunk-farh4p7f.js} +3 -3
  89. package/dist/{chunk-b1tctqn5.js → chunk-fnxg6134.js} +10 -10
  90. package/dist/chunk-g075cc67.js +2 -0
  91. package/dist/{chunk-zpkgs5d3.js → chunk-g5xth2yx.js} +6 -6
  92. package/dist/{chunk-q6w7a1vc.js → chunk-gbtbfg7e.js} +3 -3
  93. package/dist/{chunk-15jymk6t.js → chunk-gd56arnm.js} +2 -2
  94. package/dist/chunk-gmm3kffd.js +2 -0
  95. package/dist/{chunk-8hck9qqm.js → chunk-gp8hgpt9.js} +4 -4
  96. package/dist/chunk-h2qgqjkn.js +2 -0
  97. package/dist/chunk-h65shwe9.js +2 -0
  98. package/dist/chunk-hdjn7nw9.js +20 -0
  99. package/dist/{chunk-cq2hedwn.js → chunk-hev4t4d5.js} +6 -6
  100. package/dist/chunk-hf5fj7pr.js +2 -0
  101. package/dist/{chunk-7yhhwv07.js → chunk-hmdkf6c6.js} +2 -2
  102. package/dist/chunk-hsp9h3jn.js +2 -0
  103. package/dist/{chunk-vggtxttf.js → chunk-j1efsjsb.js} +5 -5
  104. package/dist/chunk-j4zrq17p.js +2 -0
  105. package/dist/chunk-jx5mss16.js +2 -0
  106. package/dist/chunk-jz84z19v.js +2 -0
  107. package/dist/{chunk-5rxks14t.js → chunk-k32q90b2.js} +2 -2
  108. package/dist/{chunk-x69457q9.js → chunk-kbdz4762.js} +8 -8
  109. package/dist/chunk-kw11yydy.js +2 -0
  110. package/dist/{chunk-wrbhq1y2.js → chunk-kwk3kxrx.js} +3 -3
  111. package/dist/chunk-kyer53x3.js +2 -0
  112. package/dist/chunk-m9cperj4.js +2 -0
  113. package/dist/{chunk-zs4s9fcq.js → chunk-mcnwvh06.js} +6 -6
  114. package/dist/chunk-meqsd5bt.js +2 -0
  115. package/dist/{chunk-dba4bwkd.js → chunk-mfa07erx.js} +16 -16
  116. package/dist/chunk-mj4wbrw7.js +2 -0
  117. package/dist/{chunk-76360zky.js → chunk-mjy98ppb.js} +9 -9
  118. package/dist/{chunk-jh2v1vvb.js → chunk-mrh08821.js} +3 -3
  119. package/dist/{chunk-15rkvc0t.js → chunk-n058hznh.js} +5 -5
  120. package/dist/{chunk-9n8t7v78.js → chunk-n3jw3xpj.js} +2 -2
  121. package/dist/chunk-nz9z3ct9.js +2 -0
  122. package/dist/chunk-p0tkhd12.js +2 -0
  123. package/dist/chunk-p2etn78y.js +2 -0
  124. package/dist/{chunk-1nankvf6.js → chunk-pbakxcv8.js} +2 -2
  125. package/dist/{chunk-t5q31st4.js → chunk-q1wxgw5s.js} +2 -2
  126. package/dist/chunk-qa5y30sy.js +72 -0
  127. package/dist/{chunk-m3p4hksq.js → chunk-qbghf76y.js} +4 -4
  128. package/dist/{chunk-a6d92kv6.js → chunk-qcxrcypb.js} +2 -2
  129. package/dist/{chunk-1jwcp2k0.js → chunk-qjey0jk6.js} +2 -2
  130. package/dist/chunk-rqa92xm4.js +2 -0
  131. package/dist/chunk-rvhrtnv3.js +12 -0
  132. package/dist/{chunk-bg0ywp5w.js → chunk-s0sad753.js} +2 -2
  133. package/dist/chunk-s92j8k4z.js +2 -0
  134. package/dist/chunk-s9df8srx.js +6 -0
  135. package/dist/{chunk-dt73ww6m.js → chunk-sb8n32rn.js} +1 -1
  136. package/dist/chunk-snz2cxqv.js +2 -0
  137. package/dist/{chunk-36vksrry.js → chunk-srgnevws.js} +2 -2
  138. package/dist/chunk-srgpz94e.js +42 -0
  139. package/dist/{chunk-9pyvc0dc.js → chunk-tnp2ta5q.js} +2 -2
  140. package/dist/{chunk-gx96hctv.js → chunk-v37zmez0.js} +2 -2
  141. package/dist/chunk-v408qsze.js +2 -0
  142. package/dist/{chunk-thdnk1kd.js → chunk-v4xes880.js} +3 -3
  143. package/dist/chunk-vfx1p83g.js +33 -0
  144. package/dist/chunk-vk98r75z.js +2 -0
  145. package/dist/{chunk-yj9nyt93.js → chunk-vvzys1x7.js} +3 -3
  146. package/dist/{chunk-f1vvhbmw.js → chunk-w6pzkcjp.js} +2 -2
  147. package/dist/chunk-x0s68p47.js +2 -0
  148. package/dist/{chunk-3gfd9t8a.js → chunk-x512h2gv.js} +4 -4
  149. package/dist/{chunk-nwxjh1gv.js → chunk-x7redxyd.js} +4 -4
  150. package/dist/chunk-xjxcwrqs.js +2 -0
  151. package/dist/chunk-xsq2jf96.js +2 -0
  152. package/dist/chunk-xymr4ys9.js +3 -0
  153. package/dist/{chunk-7bajrfb1.js → chunk-y3qg95wa.js} +8 -8
  154. package/dist/chunk-y7f2x57s.js +2 -0
  155. package/dist/chunk-ymdw4fhd.js +3 -0
  156. package/dist/chunk-ymjjn9pw.js +20 -0
  157. package/dist/chunk-ynkbv9jq.js +4 -0
  158. package/dist/{chunk-e8nzbz66.js → chunk-ysfeg3cn.js} +2 -2
  159. package/dist/chunk-ytzzth34.js +2 -0
  160. package/dist/chunk-yxpjj003.js +2 -0
  161. package/dist/chunk-z1rs6b4x.js +2 -0
  162. package/dist/{chunk-tm201m9x.js → chunk-z512gt4v.js} +3 -3
  163. package/dist/chunk-z6ntmv5x.js +2 -0
  164. package/dist/{chunk-5n7m8vqx.js → chunk-zbvfjm4a.js} +2 -2
  165. package/dist/chunk-zsnmk5me.js +2 -0
  166. package/dist/cli.js +35 -35
  167. package/dist/craft-entry.js +2 -2
  168. package/dist/craft.js +2 -2
  169. package/dist/dev-server/serve-app.js +3 -2
  170. package/dist/dev-server/serve-multi.js +3 -4
  171. package/dist/dev-server/ts-css.js +4 -5
  172. package/dist/document-shell.js +4 -3
  173. package/dist/document-tags.d.ts +8 -0
  174. package/dist/document-tags.js +37 -0
  175. package/dist/events.js +2 -1
  176. package/dist/head-injection.js +2 -1
  177. package/dist/heatmap.js +2 -1
  178. package/dist/hot-reload.js +3 -1
  179. package/dist/index.d.ts +1 -1
  180. package/dist/index.js +1 -1
  181. package/dist/native-build.js +3 -3
  182. package/dist/process.js +5 -6
  183. package/dist/production-build.js +3 -3
  184. package/dist/pwa/inject.js +3 -3
  185. package/dist/pwa.js +3 -3
  186. package/dist/reactive-bindings.js +2 -1
  187. package/dist/reactive.js +2 -1
  188. package/dist/render.js +1 -1
  189. package/dist/runtime-injection.js +6 -6
  190. package/dist/serve.js +1 -1
  191. package/dist/site-builder/build.js +1 -1
  192. package/dist/site-builder/i18n.js +2 -2
  193. package/dist/site-builder/router.js +1 -1
  194. package/dist/site-builder/theme.js +1 -1
  195. package/dist/ssg.js +30 -31
  196. package/dist/template-hydrator.js +2 -1
  197. package/dist/web-components/css-scoping.js +3 -3
  198. package/dist/x-element.js +2 -1
  199. package/package.json +5 -5
  200. package/dist/body-close.d.ts +0 -13
  201. package/dist/body-close.js +0 -8
  202. package/dist/chunk-02css3vk.js +0 -14
  203. package/dist/chunk-0hqr6bff.js +0 -2
  204. package/dist/chunk-15sgdvyd.js +0 -2
  205. package/dist/chunk-261t62q4.js +0 -712
  206. package/dist/chunk-2b4a8tbd.js +0 -3
  207. package/dist/chunk-2fw36w1x.js +0 -2
  208. package/dist/chunk-2jcxsw75.js +0 -2
  209. package/dist/chunk-2pbhdaka.js +0 -2
  210. package/dist/chunk-2wba5ypm.js +0 -2
  211. package/dist/chunk-353gnvfe.js +0 -2
  212. package/dist/chunk-3cr5y8v1.js +0 -2
  213. package/dist/chunk-3y7yp0ka.js +0 -2
  214. package/dist/chunk-41wwqw0q.js +0 -2
  215. package/dist/chunk-4a1y51fs.js +0 -2
  216. package/dist/chunk-4a751brg.js +0 -2
  217. package/dist/chunk-4jgcd4d9.js +0 -33
  218. package/dist/chunk-5awhm4na.js +0 -2
  219. package/dist/chunk-5fhp9hxd.js +0 -2
  220. package/dist/chunk-5mg443dw.js +0 -2
  221. package/dist/chunk-5q4tncfw.js +0 -18
  222. package/dist/chunk-5x9ajbq0.js +0 -2
  223. package/dist/chunk-6g7tkmty.js +0 -2
  224. package/dist/chunk-72bj7ea4.js +0 -2
  225. package/dist/chunk-74g64pzt.js +0 -20
  226. package/dist/chunk-7de5y29a.js +0 -54
  227. package/dist/chunk-7ycmnsh5.js +0 -2
  228. package/dist/chunk-811hh6vp.js +0 -2
  229. package/dist/chunk-830ej8d2.js +0 -72
  230. package/dist/chunk-8fkmxrat.js +0 -2
  231. package/dist/chunk-8p9npc8y.js +0 -2
  232. package/dist/chunk-9fz3h6sx.js +0 -2
  233. package/dist/chunk-9jr30fns.js +0 -2
  234. package/dist/chunk-9xr628ew.js +0 -3
  235. package/dist/chunk-a9m6ajd7.js +0 -2
  236. package/dist/chunk-aj6vqdf7.js +0 -25
  237. package/dist/chunk-asr5v51s.js +0 -2
  238. package/dist/chunk-b7nmgkwa.js +0 -42
  239. package/dist/chunk-bv14vry8.js +0 -3
  240. package/dist/chunk-byx82s10.js +0 -2
  241. package/dist/chunk-c9y1g61m.js +0 -2
  242. package/dist/chunk-ck5nzbbv.js +0 -2
  243. package/dist/chunk-cvdm0hgq.js +0 -2
  244. package/dist/chunk-e0fxgbcc.js +0 -2
  245. package/dist/chunk-ed2m6pjf.js +0 -2
  246. package/dist/chunk-ednwdhv0.js +0 -2
  247. package/dist/chunk-egtphftq.js +0 -2
  248. package/dist/chunk-f18rxz70.js +0 -2
  249. package/dist/chunk-fahqq7c4.js +0 -2
  250. package/dist/chunk-fcbpzdyz.js +0 -2
  251. package/dist/chunk-gc79s0wh.js +0 -20
  252. package/dist/chunk-gjnrmz2q.js +0 -4
  253. package/dist/chunk-gp1dt8b8.js +0 -33
  254. package/dist/chunk-h0dsxxz4.js +0 -2
  255. package/dist/chunk-h2cvfp9y.js +0 -2
  256. package/dist/chunk-jhm1228j.js +0 -4
  257. package/dist/chunk-k3yym9zg.js +0 -2
  258. package/dist/chunk-k9fsd6t3.js +0 -2
  259. package/dist/chunk-kepxsjfx.js +0 -2
  260. package/dist/chunk-kgrvvtcy.js +0 -3
  261. package/dist/chunk-kh01rvag.js +0 -2
  262. package/dist/chunk-kv40xq53.js +0 -1329
  263. package/dist/chunk-mad172af.js +0 -2
  264. package/dist/chunk-mjkdskeg.js +0 -12
  265. package/dist/chunk-npt0mdzb.js +0 -2
  266. package/dist/chunk-p95fsnbk.js +0 -2
  267. package/dist/chunk-ptc3yqn3.js +0 -2
  268. package/dist/chunk-pybm7c9p.js +0 -2
  269. package/dist/chunk-q87hkwfg.js +0 -3
  270. package/dist/chunk-qe6631me.js +0 -2
  271. package/dist/chunk-qnx71b17.js +0 -2
  272. package/dist/chunk-qx8cav4w.js +0 -2
  273. package/dist/chunk-rb7cwck6.js +0 -2
  274. package/dist/chunk-s1e0t3hv.js +0 -2
  275. package/dist/chunk-s7vfmasx.js +0 -2
  276. package/dist/chunk-scwbttvt.js +0 -3
  277. package/dist/chunk-shy2hkvj.js +0 -2
  278. package/dist/chunk-sxtvy0sm.js +0 -3
  279. package/dist/chunk-t7z67vf6.js +0 -2
  280. package/dist/chunk-tarvase5.js +0 -2
  281. package/dist/chunk-tqs9pcga.js +0 -2
  282. package/dist/chunk-twjfrywv.js +0 -2
  283. package/dist/chunk-v0wdgxga.js +0 -3
  284. package/dist/chunk-vyna2rsq.js +0 -2
  285. package/dist/chunk-w4gjx2zs.js +0 -18
  286. package/dist/chunk-xhe7pw6e.js +0 -2
  287. package/dist/chunk-y86mpnrg.js +0 -2
  288. package/dist/chunk-z99bf0q0.js +0 -3
  289. package/dist/chunk-zm0g7ntw.js +0 -2
  290. package/dist/chunk-zrm2x65c.js +0 -2
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- function Sa(e){return e}class a{plugins=new Map;sortedPlugins=[];initialized=!1;async register(e,t){if(this.plugins.has(e.name))throw Error(`Plugin "${e.name}" is already registered`);if(e.dependencies){for(let r of e.dependencies)if(!this.plugins.has(r))throw Error(`Plugin "${e.name}" depends on "${r}" which is not registered`)}if(this.plugins.set(e.name,e),e.onRegister)await e.onRegister(t);this.sortPlugins()}async unregister(e){let t=this.plugins.get(e);if(!t)return!1;for(let[r,i]of this.plugins)if(i.dependencies?.includes(e))throw Error(`Cannot unregister "${e}" because "${r}" depends on it`);if(t.onUnregister)await t.onUnregister();return this.plugins.delete(e),this.sortPlugins(),!0}get(e){return this.plugins.get(e)}has(e){return this.plugins.has(e)}getAll(){return[...this.sortedPlugins]}getAllDirectives(){let e=[];for(let t of this.sortedPlugins)if(t.registerDirectives)e.push(...t.registerDirectives());return e}getAllFilters(){let e={};for(let t of this.sortedPlugins)if(t.registerFilters)Object.assign(e,t.registerFilters());return e}async runBeforeProcess(e){return this.runHooks("beforeProcess",e)}async runAfterParse(e){return this.runHooks("afterParse",e)}async runBeforeDirective(e,t){return this.runDirectiveHooks("beforeDirective",e,t)}async runAfterDirective(e,t){return this.runDirectiveHooks("afterDirective",e,t)}async runBeforeRender(e){return this.runHooks("beforeRender",e)}async runAfterRender(e){return this.runHooks("afterRender",e)}async runOnError(e){for(let t of this.sortedPlugins)if(t.onError)try{let r=await t.onError(e);if(r){if(r.template!==void 0)e.template=r.template;if(r.context)e.context={...e.context,...r.context};if(r.metadata)e.metadata={...e.metadata,...r.metadata};if(r.skip)return e}}catch(r){console.error(`Error in plugin "${t.name}" onError hook:`,r)}return null}sortPlugins(){this.sortedPlugins=Array.from(this.plugins.values()).sort((e,t)=>(e.priority??100)-(t.priority??100))}async runHooks(e,t){let r={...t};for(let i of this.sortedPlugins){let s=i[e];if(s)try{let n=await s(r);if(n){if(n.template!==void 0)r.template=n.template;if(n.context)r.context={...r.context,...n.context};if(n.metadata)r.metadata={...r.metadata,...n.metadata};if(n.skip)break}}catch(n){console.error(`Error in plugin "${i.name}" ${e} hook:`,n)}}return r}async runDirectiveHooks(e,t,r){let i={...r};for(let s of this.sortedPlugins){let n=s[e];if(n)try{let o=await n(t,i);if(o){if(o.template!==void 0)i.template=o.template;if(o.context)i.context={...i.context,...o.context};if(o.metadata)i.metadata={...i.metadata,...o.metadata};if(o.skip)break}}catch(o){console.error(`Error in plugin "${s.name}" ${e} hook:`,o)}}return i}}var $m=new a;var u=Sa({name:"stx-debug",version:"1.0.0",description:"Logs all plugin lifecycle events for debugging",priority:0,beforeProcess(e){console.log("[stx-debug] beforeProcess:",e.filePath)},afterParse(e){console.log("[stx-debug] afterParse:",e.template.length,"chars")},beforeDirective(e,t){console.log("[stx-debug] beforeDirective:",e)},afterDirective(e,t){console.log("[stx-debug] afterDirective:",e)},beforeRender(e){console.log("[stx-debug] beforeRender")},afterRender(e){console.log("[stx-debug] afterRender:",e.template.length,"chars")},onError(e){console.error("[stx-debug] onError:",e.error.message,"in phase:",e.phase)}}),l=Sa({name:"stx-timing",version:"1.0.0",description:"Measures template processing time",priority:1,beforeProcess(e){e.metadata.startTime=performance.now()},afterRender(e){let t=e.metadata.startTime;if(t){let r=performance.now()-t;console.log(`[stx-timing] Processing took ${r.toFixed(2)}ms`)}}});export{Sa,$m};
2
+ function Ea(e){return e}class a{plugins=new Map;sortedPlugins=[];initialized=!1;async register(e,t){if(this.plugins.has(e.name))throw Error(`Plugin "${e.name}" is already registered`);if(e.dependencies){for(let r of e.dependencies)if(!this.plugins.has(r))throw Error(`Plugin "${e.name}" depends on "${r}" which is not registered`)}if(this.plugins.set(e.name,e),e.onRegister)await e.onRegister(t);this.sortPlugins()}async unregister(e){let t=this.plugins.get(e);if(!t)return!1;for(let[r,i]of this.plugins)if(i.dependencies?.includes(e))throw Error(`Cannot unregister "${e}" because "${r}" depends on it`);if(t.onUnregister)await t.onUnregister();return this.plugins.delete(e),this.sortPlugins(),!0}get(e){return this.plugins.get(e)}has(e){return this.plugins.has(e)}getAll(){return[...this.sortedPlugins]}getAllDirectives(){let e=[];for(let t of this.sortedPlugins)if(t.registerDirectives)e.push(...t.registerDirectives());return e}getAllFilters(){let e={};for(let t of this.sortedPlugins)if(t.registerFilters)Object.assign(e,t.registerFilters());return e}async runBeforeProcess(e){return this.runHooks("beforeProcess",e)}async runAfterParse(e){return this.runHooks("afterParse",e)}async runBeforeDirective(e,t){return this.runDirectiveHooks("beforeDirective",e,t)}async runAfterDirective(e,t){return this.runDirectiveHooks("afterDirective",e,t)}async runBeforeRender(e){return this.runHooks("beforeRender",e)}async runAfterRender(e){return this.runHooks("afterRender",e)}async runOnError(e){for(let t of this.sortedPlugins)if(t.onError)try{let r=await t.onError(e);if(r){if(r.template!==void 0)e.template=r.template;if(r.context)e.context={...e.context,...r.context};if(r.metadata)e.metadata={...e.metadata,...r.metadata};if(r.skip)return e}}catch(r){console.error(`Error in plugin "${t.name}" onError hook:`,r)}return null}sortPlugins(){this.sortedPlugins=Array.from(this.plugins.values()).sort((e,t)=>(e.priority??100)-(t.priority??100))}async runHooks(e,t){let r={...t};for(let i of this.sortedPlugins){let s=i[e];if(s)try{let n=await s(r);if(n){if(n.template!==void 0)r.template=n.template;if(n.context)r.context={...r.context,...n.context};if(n.metadata)r.metadata={...r.metadata,...n.metadata};if(n.skip)break}}catch(n){console.error(`Error in plugin "${i.name}" ${e} hook:`,n)}}return r}async runDirectiveHooks(e,t,r){let i={...r};for(let s of this.sortedPlugins){let n=s[e];if(n)try{let o=await n(t,i);if(o){if(o.template!==void 0)i.template=o.template;if(o.context)i.context={...i.context,...o.context};if(o.metadata)i.metadata={...i.metadata,...o.metadata};if(o.skip)break}}catch(o){console.error(`Error in plugin "${s.name}" ${e} hook:`,o)}}return i}}var Pm=new a;var u=Ea({name:"stx-debug",version:"1.0.0",description:"Logs all plugin lifecycle events for debugging",priority:0,beforeProcess(e){console.log("[stx-debug] beforeProcess:",e.filePath)},afterParse(e){console.log("[stx-debug] afterParse:",e.template.length,"chars")},beforeDirective(e,t){console.log("[stx-debug] beforeDirective:",e)},afterDirective(e,t){console.log("[stx-debug] afterDirective:",e)},beforeRender(e){console.log("[stx-debug] beforeRender")},afterRender(e){console.log("[stx-debug] afterRender:",e.template.length,"chars")},onError(e){console.error("[stx-debug] onError:",e.error.message,"in phase:",e.phase)}}),l=Ea({name:"stx-timing",version:"1.0.0",description:"Measures template processing time",priority:1,beforeProcess(e){e.metadata.startTime=performance.now()},afterRender(e){let t=e.metadata.startTime;if(t){let r=performance.now()-t;console.log(`[stx-timing] Processing took ${r.toFixed(2)}ms`)}}});export{Ea,Pm};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ur,po,nm,Bl,fo}from"./chunk-g5xth2yx.js";export{nm as buildModuleRegistryScript,fo as buildSharedModuleRegistries,Bl as exportsMutableBinding,Ur as registeredModuleIdsIn,po as registeredModuleNamesIn};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- function I(s){let o=/import\s*\{([^}]+)\}\s*from\s*['"](@stores|stx\/stores)['"]\s*;?\n?/g;s=s.replace(o,(e,t)=>`const { ${t.split(",").map((r)=>r.trim()).filter(Boolean).join(", ")} } = window.__STX_STORES__
2
+ function N(s){let o=/import\s*\{([^}]+)\}\s*from\s*['"](@stores|stx\/stores)['"]\s*;?\n?/g;s=s.replace(o,(e,t)=>`const { ${t.split(",").map((r)=>r.trim()).filter(Boolean).join(", ")} } = window.__STX_STORES__
3
3
  `);let n=/import\s*\{([^}]+)\}\s*from\s*['"]@composables['"]\s*;?\n?/g;return s=s.replace(n,(e,t)=>`const { ${t.split(",").map((r)=>r.trim()).filter(Boolean).join(", ")} } = window.__composables
4
- `),s}function An(s){return s.replace(/^import\s+[^'"]*?from\s*['"][^'"]+['"]\s*;?[ \t]*$/gm,"").replace(/^import\s+['"][^'"]+['"]\s*;?[ \t]*$/gm,"")}
5
- export{I,An};
4
+ `),s}function On(s){return s.replace(/^import\s+[^'"]*?from\s*['"][^'"]+['"]\s*;?[ \t]*$/gm,"").replace(/^import\s+['"][^'"]+['"]\s*;?[ \t]*$/gm,"")}
5
+ export{N,On};
@@ -1,21 +1,21 @@
1
1
  // @bun
2
- import{ut,kl}from"./chunk-1jwcp2k0.js";import{I}from"./chunk-xppm4cs4.js";import{V,Ds,o,ae,q,y,zc,jt,vn,Fe,ze}from"./chunk-261t62q4.js";import{pr}from"./chunk-02css3vk.js";import{B}from"./chunk-pb09xy77.js";import{fn}from"./chunk-h2cvfp9y.js";var X=`(?:"[^"]*"|'[^']*'|[^>"'])*`,H=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s,Q=65536,J=4,O=new Map;function Xh(){O.clear()}function K(e){let c=[];for(let t of y(e,q)){let n=t.token.match(/^<script\b([^>]*)>/i),s=t.token.match(/<\/script\s*>$/i);if(!n||!s)continue;let u=n[0].length,f=t.token.length-s[0].length;c.push(Object.freeze({fullMatch:t.token,attrs:n[1],body:t.token.slice(u,f),start:t.start,end:t.end}))}return c}function ys(e,c={}){let t=e.length>=Q,n=t?O.get(e):void 0;if(n===void 0){if(n=K(e),t)zc(O,J),O.set(e,n)}let s=c.skipAttrs;if(!s)return n.slice();let u=[];for(let f of n)if(s.lastIndex=0,!s.test(f.attrs))u.push(f);return u}function Go(e){let c=e.trim(),t=c.match(/^([\s\S]+?)\s+as\s+(.+)$/);if(t){let s=t[1].trim(),u=t[2].trim(),{itemVar:f,indexVar:i}=z(u);if(f)return{style:"as",iterable:s,itemVar:f,indexVar:i}}let n=c.match(/^(\([^)]+\)|\w+(?:\s*,\s*\w+)?)\s+(?:in|of)\s+([\s\S]+)$/);if(n){let s=n[1].trim(),u=n[2].trim(),{itemVar:f,indexVar:i}=z(s);if(f)return{style:"in",iterable:u,itemVar:f,indexVar:i}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function z(e){let c=e.trim(),t=c.match(/^(\w+)\s*=>\s*(\w+)$/);if(t)return{itemVar:t[2],indexVar:t[1]};let n=c.match(/^\(\s*(\w+)(?:\s*,\s*(\w+))?\s*\)$/);if(n)return{itemVar:n[1],indexVar:n[2]||null};let s=c.match(/^(\w+)\s*,\s*(\w+)$/);if(s)return{itemVar:s[1],indexVar:s[2]};let u=c.match(/^(\w+)$/);if(u)return{itemVar:u[1],indexVar:null};return{itemVar:null,indexVar:null}}function bs(e,c){return kl(e,c)}function Y(e){let c=/@(if\s*\(|endif|elseif\s*\(|else\b)/g,t=0,n;while((n=c.exec(e))!==null){let s=n[1];if(s.startsWith("if"))t++;else if(s==="endif")t--;else if(t===0)return!0}return!1}function ur(e){let c=new Set,t=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,n=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel)\s*(?:<[^>]*>)?\s*\(/g,s;while((s=t.exec(e))!==null){let u=s[1],f;while((f=n.exec(u))!==null)c.add(f[1])}return c}function ee(e){if(!/[:@]for\s*=/.test(e)&&!/\bx-for\s*=/.test(e))return[];let c=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${X})>`,"iy"),t=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,n=y(e,(u,f)=>{c.lastIndex=f;let i=c.exec(u);if(!i||i.index!==f||!t.test(i[2]))return-1;return c.lastIndex}),s=[];for(let u of n){c.lastIndex=0;let f=c.exec(u.token);if(!f)continue;let i=f[2].match(t),p=Go(i?.[1]??i?.[2]??""),m=[p.itemVar,p.indexVar].filter(Boolean);if(m.length===0)continue;let r=f[1],g=/\/\s*>$/.test(u.token)||P.has(r.toLowerCase())?u.end:D(e,u.start,r,u.end);if(g!==-1)s.push({start:u.start,end:g,vars:new Set(m)})}return s}var W=new Set(["true","false","null","undefined","NaN","Infinity","typeof","instanceof","in","of","new","void","delete","this","Math","JSON","Date","Number","String","Boolean","Array","Object","RegExp","Map","Set","Symbol","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","window","document","console"]);function te(e){return e.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function Z(e,c,t,n){if(!e)return!1;let s=te(e),u=!1,f=!1,i=!1,p=/([a-zA-Z_$][\w$]*)/g,m;while((m=p.exec(s))!==null){let l=m[1];if(s.slice(0,m.index).trimEnd().endsWith("."))continue;if(W.has(l))continue;if(c.has(l)||n?.has(l))u=!0;else if(t&&l in t)f=!0}let r=/([a-zA-Z_$][\w$]*)(?:\.[a-zA-Z_$][\w$]*)*\s*\(\s*\)/g,a;while((a=r.exec(s))!==null){let l=a[1];if(s.slice(0,a.index).trimEnd().endsWith("."))continue;if(W.has(l)||t&&l in t)continue;i=!0}return(u||i)&&!f}function M(e,c,t){let n=t===void 0?` ${c}`:` ${c}="${t.replace(/"/g,"&quot;")}"`,s=e.trim(),u=s.match(H);if(u&&ne(u[3],u[1])){let[,f,i,p]=u;return`<${f}${i}${n}>${p}</${f}>`}return`<template${n}>${s}</template>`}function ne(e,c){let t=new RegExp(`<(/)?${c}(?=[\\s/>])`,"gi"),n=0,s;while((s=t.exec(e))!==null)if(s[1]){if(n--,n<0)return!1}else n++;return!0}function Xo(e,c){let t=ur(e);function n(s){let u=s,f=ee(s),i=(a)=>{let g=new Set;for(let l of f)if(a>l.start&&a<l.end)for(let d of l.vars)g.add(d);return g},p=/@if\s*\(/g,m,r=[];while((m=p.exec(u))!==null){let a=m.index,g=a+m[0].length,l=1,d=g;while(d<u.length&&l>0){if(u[d]==="(")l++;else if(u[d]===")")l--;d++}if(l!==0)continue;let b=u.substring(g,d-1).trim(),S=d,w=1,E=S,x=/@(if\s*\(|endif)/g;x.lastIndex=S;let h;while((h=x.exec(u))!==null)if(h[1].startsWith("if"))w++;else if(h[1]==="endif"){if(w--,w===0){E=h.index+h[0].length;break}}if(w!==0)continue;let R=u.substring(S,E-6).trim(),A;if(Y(R)){let C=fn(u.substring(a,E));if(C.length===0)continue;let k=C[0].branches.filter((_)=>_.type!=="else"),L=i(a);if(!(k.length>0&&k.every((_)=>Z(_.condition,t,c,L))))continue;A=C[0].branches.map((_)=>{let N=n(_.content);if(_.type==="elseif")return M(N,"@else-if",_.condition??"");if(_.type==="else")return M(N,"@else");return M(N,"@if",_.condition??"")}).join(`
3
- `)}else{if(!Z(b,t,c,i(a)))continue;A=M(n(R),"@if",b)}r.push({start:a,end:E,replacement:A}),p.lastIndex=E}for(let a=r.length-1;a>=0;a--){let{start:g,end:l,replacement:d}=r[a];u=u.substring(0,g)+d+u.substring(l)}return u}return n(e)}function se(e){let c=e.trim();if(c==="")return;if(c==="true")return!0;if(c==="false")return!1;if(c==="null")return!1;if(c==="undefined")return!1;if(c==="NaN")return!1;if(/^-?\d+(?:\.\d+)?$/.test(c)){let s=Number(c);return s!==0&&!Number.isNaN(s)}let t=c.match(/^'((?:\\.|[^'\\])*)'$/);if(t)return t[1].length>0;let n=c.match(/^"((?:\\.|[^"\\])*)"$/);if(n)return n[1].length>0;return}var P=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),F=/<(script|style)\b/iy,re=/<\/script/gi,ie=/<\/style/gi;function D(e,c,t,n){if(P.has(t.toLowerCase()))return n;let s=t.toLowerCase(),u=e.length,f=1,i=n;while(i<u){let p=e.indexOf("<",i);if(p===-1)return-1;if(i=p,e.startsWith("<!--",i)){let g=e.indexOf("-->",i+4);if(g===-1)return-1;i=g+3;continue}F.lastIndex=i;let m=F.exec(e);if(m){let g=e.indexOf(">",i);if(g===-1)return-1;if(e[g-1]==="/"){i=g+1;continue}let l=m[1].toLowerCase()==="script"?re:ie;l.lastIndex=i;let d=l.exec(e);if(d===null)return-1;let b=e.indexOf(">",d.index);if(b===-1)return-1;i=b+1;continue}if(e[i+1]==="/"){let g=/^<\/([a-z][\w-]*)\s*>/i.exec(e.slice(i,i+64));if(!g){i++;continue}if(g[1].toLowerCase()===s){if(f--,i+=g[0].length,f===0)return i;continue}i+=g[0].length;continue}let r=/^<([a-z][\w-]*)\b/i.exec(e.slice(i,i+64));if(!r){i++;continue}let a=e.indexOf(">",i);if(a===-1)return-1;if(r[1].toLowerCase()===s){let g=e.slice(i,a+1);if(!(/\/\s*>$/.test(g)||P.has(s)))f++}i=a+1}return-1}var oe=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function ce(e,c){let t=c,n=e.length;for(;;){while(t<n&&e[t]!=="<")t++;if(t>=n)return!1;if(e.startsWith("<!--",t)){let f=e.indexOf("-->",t+4);if(f===-1)return!1;t=f+3;continue}break}if(e[t+1]==="/")return!1;let s=e.indexOf(">",t);if(s===-1)return!1;let u=e.slice(t,s+1);return oe.test(u)}function Jo(e){if(!e.includes(":if")&&!e.includes(":show")&&!e.includes("x-if")&&!e.includes("x-show")&&!e.includes("@if=")&&!e.includes("@show="))return e;let c=[],t=/<([a-zA-Z][\w-]*)/y,n=/\s/,s=new Set([":if",":show","x-if","x-show","@if","@show"]);y(e,(r,a)=>{t.lastIndex=a;let g=t.exec(r);if(!g||/^(?:script|style)$/i.test(g[1]))return-1;let l=t.lastIndex,d;while(l<r.length){let b=l;while(l<r.length&&n.test(r[l]))l++;let S=l;if(r[S]==="/"){S++;while(S<r.length&&n.test(r[S]))S++}if(r[S]===">"){if(d)c.push({start:a,end:S+1,tag:g[1],...d});return-1}if(l===b)return-1;let w=l;while(l<r.length&&!n.test(r[l])&&r[l]!=="="&&r[l]!==">")l++;if(l===w)return-1;let E=r.slice(w,l);if(E.startsWith("@")&&E.includes("("))return-1;let x=l,h=l;while(h<r.length&&n.test(r[h]))h++;if(r[h]!=="="){l=x;continue}h++;while(h<r.length&&n.test(r[h]))h++;let R=r[h];if(R==='"'||R==="'"){let A=r.indexOf(R,h+1);if(A===-1)return-1;if(!d&&R==='"'&&s.has(E))d={attrName:E,attrStart:b,attrEnd:A+1,value:r.slice(h+1,A)};l=A+1}else{l=h;while(l<r.length&&!n.test(r[l])&&r[l]!==">")l++}}return-1});let u=[],f=-1;for(let r of c){let{start:a,end:g,tag:l,attrName:d,value:b}=r;if(a<f)continue;let S=se(b);if(S===void 0)continue;let x=/\/\s*>$/.test(e.slice(a,g))||P.has(l.toLowerCase())?g:D(e,a,l,g);if(x===-1)continue;if((d===":if"||d==="x-if"||d==="@if")&&ce(e,x))continue;if(S===!0){let R=e.slice(a,r.attrStart)+e.slice(r.attrEnd,g);u.push({start:a,end:g,replacement:R});continue}u.push({start:a,end:x,replacement:""}),f=x}if(u.length===0)return e;u.sort((r,a)=>r.start-a.start);let i=[],p=-1;for(let r of u){if(r.start<p)continue;i.push(r),p=r.end}let m=e;for(let r=i.length-1;r>=0;r--){let{start:a,end:g,replacement:l}=i[r];m=m.substring(0,a)+l+m.substring(g)}return m}var U=[":for","@for","x-for"];function Xf(e){let c=/(\s)((?::|@|x-|v-)[\w.:-]+)\s*=\s*"([^"]*\{\{[^"]*)"/g;return e.replace(c,(t,n,s,u)=>{let f=u.replace(/'((?:[^'\\]|\\.)*)'/g,(i,p)=>{if(!p.includes("{{"))return i;return`\`${p.replace(/`/g,"\\`").replace(/\$\{/g,"\\${").replace(/\{\{\s*([^}]+?)\s*\}\}/g,(r,a)=>`\${${a}}`)}\``});return`${n}${s}="${f}"`})}function ws(e,c){if(!c||Object.keys(c).length===0)return e;if(!U.some((i)=>e.includes(`${i}=`)))return e;let t=ur(e);if(Array.isArray(c.__stx_client_signal_names)){for(let i of c.__stx_client_signal_names)if(typeof i==="string")t.add(i)}let n=e,s=[],u=/<([a-zA-Z][\w-]*)((?:[^>"']|"[^"]*"|'[^']*')*)>/g,f;while((f=u.exec(n))!==null){let[i,p,m]=f,r=f.index,a=r+i.length,g=U.map((A)=>({attr:A,m:new RegExp(`\\s${A}="([^"]*)"`).exec(m)})).find((A)=>A.m!==null);if(!g||!g.m)continue;let l=Go(g.m[1]);if(!l.iterable||!l.itemVar)continue;let d=l.iterable.trim().split(/[.[(]/)[0].trim();if(!d||t.has(d)||!(d in c))continue;let b=D(n,r,p,a);if(b===-1)continue;let S=m.replace(new RegExp(`\\s${g.attr}="[^"]*"`),"").replace(/\s:key="[^"]*"/,"").replace(/\sx-cloak(?=\s|$)/,""),w=n.slice(a,b-`</${p}>`.length),E={...c,[l.itemVar]:void 0};if(l.indexVar)E[l.indexVar]=void 0;let x=ws(w,E),h=l.indexVar?`${l.iterable} as ${l.indexVar} => ${l.itemVar}`:`${l.iterable} as ${l.itemVar}`,R=p.toLowerCase()==="template"?x:`<${p}${S}>${x}</${p}>`;s.push({start:r,end:b,replacement:`@foreach(${h})${R}@endforeach`}),u.lastIndex=b}for(let i=s.length-1;i>=0;i--){let{start:p,end:m,replacement:r}=s[i];n=n.slice(0,p)+r+n.slice(m)}return n}function vs(e,c){let t=e,n=/@(for|foreach)\s*\(/g,s,u=[],f=[];while((s=n.exec(t))!==null){let i=s[1],p=s.index,m=p+s[0].length,r=1,a=m;while(a<t.length&&r>0){if(t[a]==="(")r++;else if(t[a]===")")r--;a++}if(r!==0)continue;let g=t.substring(m,a-1).trim(),l=a,d=Go(g),b=i==="for"?"@endfor":"@endforeach",S=1,w=l,E=i==="for"?new RegExp("@(for(?!each)\\s*\\(|endfor(?!each))","g"):new RegExp(`@(${i}\\s*\\(|end${i})`,"g");E.lastIndex=l;let x;while((x=E.exec(t))!==null)if(x[1].startsWith(i))S++;else if(S--,S===0){w=x.index+x[0].length;break}if(S!==0)continue;let h=()=>{let v=[d.itemVar,d.indexVar].filter(Boolean);if(v.length)f.push({start:p,end:w,vars:v})};if(d.iterable){let v=d.iterable.trim();if(v.startsWith("[")||v.startsWith("{")||v.startsWith("'")||v.startsWith('"')||v.startsWith("`")||/^-?\d/.test(v)){h();continue}let T=v.split(/[.[(]/)[0].trim(),_=c?T in c:!1,N=f.some((j)=>p>j.start&&p<j.end&&j.vars.includes(T));if(T&&(_||N)){h();continue}}if(d.style==="as")g=d.indexVar?`(${d.itemVar}, ${d.indexVar}) in ${d.iterable}`:`${d.itemVar} in ${d.iterable}`;let R=t.substring(l,w-b.length).trim(),A=c?{...c}:{};if(d.itemVar)delete A[d.itemVar];if(d.indexVar)delete A[d.indexVar];let C=Xf(vs(R,A)),k=C.match(H),L;if(k){let[,v,T,_]=k;L=`<${v}${T} @for="${g}">${_}</${v}>`}else L=`<template @for="${g}">${C}</template>`;u.push({start:p,end:w,replacement:L}),n.lastIndex=w}for(let i=u.length-1;i>=0;i--){let{start:p,end:m,replacement:r}=u[i];t=t.substring(0,p)+r+t.substring(m)}return t}function le(e){let c=new Set,t=[],n=0,s=0,u=e.length,f=(r)=>{let a=n+1;while(a<u){let g=e[a];if(g==="\\"){a+=2;continue}if(g===r)return a+1;a++}return u},i=()=>{let r=n+2;while(r<u&&e[r]!==`
2
+ import{ft,El}from"./chunk-qjey0jk6.js";import{N}from"./chunk-farh4p7f.js";import{q,Bs,o,ue,X,w,Uc,zt,kn,Ve,Ue}from"./chunk-2kfayg4t.js";import{mr}from"./chunk-0c9c9v03.js";import{H}from"./chunk-8s6s6nd0.js";import{hn}from"./chunk-zsnmk5me.js";var U=`(?:"[^"]*"|'[^']*'|[^>"'])*`,G=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s,Q=65536,J=4,M=new Map;function Zh(){M.clear()}function K(e){let c=[];for(let t of w(e,X)){let n=t.token.match(/^<script\b([^>]*)>/i),s=t.token.match(/<\/script\s*>$/i);if(!n||!s)continue;let u=n[0].length,f=t.token.length-s[0].length;c.push(Object.freeze({fullMatch:t.token,attrs:n[1],body:t.token.slice(u,f),start:t.start,end:t.end}))}return c}function vs(e,c={}){let t=e.length>=Q,n=t?M.get(e):void 0;if(n===void 0){if(n=K(e),t)Uc(M,J),M.set(e,n)}let s=c.skipAttrs;if(!s)return n.slice();let u=[];for(let f of n)if(s.lastIndex=0,!s.test(f.attrs))u.push(f);return u}function Yo(e){let c=e.trim(),t=c.match(/^([\s\S]+?)\s+as\s+(.+)$/);if(t){let s=t[1].trim(),u=t[2].trim(),{itemVar:f,indexVar:i}=D(u);if(f)return{style:"as",iterable:s,itemVar:f,indexVar:i}}let n=c.match(/^(\([^)]+\)|\w+(?:\s*,\s*\w+)?)\s+(?:in|of)\s+([\s\S]+)$/);if(n){let s=n[1].trim(),u=n[2].trim(),{itemVar:f,indexVar:i}=D(s);if(f)return{style:"in",iterable:u,itemVar:f,indexVar:i}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function D(e){let c=e.trim(),t=c.match(/^(\w+)\s*=>\s*(\w+)$/);if(t)return{itemVar:t[2],indexVar:t[1]};let n=c.match(/^\(\s*(\w+)(?:\s*,\s*(\w+))?\s*\)$/);if(n)return{itemVar:n[1],indexVar:n[2]||null};let s=c.match(/^(\w+)\s*,\s*(\w+)$/);if(s)return{itemVar:s[1],indexVar:s[2]};let u=c.match(/^(\w+)$/);if(u)return{itemVar:u[1],indexVar:null};return{itemVar:null,indexVar:null}}function xs(e,c){return El(e,c)}function Y(e){let c=/@(if\s*\(|endif|elseif\s*\(|else\b)/g,t=0,n;while((n=c.exec(e))!==null){let s=n[1];if(s.startsWith("if"))t++;else if(s==="endif")t--;else if(t===0)return!0}return!1}function fr(e){let c=new Set,t=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,n=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel)\s*(?:<[^>]*>)?\s*\(/g,s;while((s=t.exec(e))!==null){let u=s[1],f;while((f=n.exec(u))!==null)c.add(f[1])}return c}function ee(e){if(!/[:@]for\s*=/.test(e)&&!/\bx-for\s*=/.test(e))return[];let c=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${U})>`,"iy"),t=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,n=w(e,(u,f)=>{c.lastIndex=f;let i=c.exec(u);if(!i||i.index!==f||!t.test(i[2]))return-1;return c.lastIndex}),s=[];for(let u of n){c.lastIndex=0;let f=c.exec(u.token);if(!f)continue;let i=f[2].match(t),p=Yo(i?.[1]??i?.[2]??""),m=[p.itemVar,p.indexVar].filter(Boolean);if(m.length===0)continue;let r=f[1],g=/\/\s*>$/.test(u.token)||O.has(r.toLowerCase())?u.end:j(e,u.start,r,u.end);if(g!==-1)s.push({start:u.start,end:g,vars:new Set(m)})}return s}var z=new Set(["true","false","null","undefined","NaN","Infinity","typeof","instanceof","in","of","new","void","delete","this","Math","JSON","Date","Number","String","Boolean","Array","Object","RegExp","Map","Set","Symbol","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","window","document","console"]);function te(e){return e.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function W(e,c,t,n){if(!e)return!1;let s=te(e),u=!1,f=!1,i=!1,p=/([a-zA-Z_$][\w$]*)/g,m;while((m=p.exec(s))!==null){let l=m[1];if(s.slice(0,m.index).trimEnd().endsWith("."))continue;if(z.has(l))continue;if(c.has(l)||n?.has(l))u=!0;else if(t&&l in t)f=!0}let r=/([a-zA-Z_$][\w$]*)(?:\.[a-zA-Z_$][\w$]*)*\s*\(\s*\)/g,a;while((a=r.exec(s))!==null){let l=a[1];if(s.slice(0,a.index).trimEnd().endsWith("."))continue;if(z.has(l)||t&&l in t)continue;i=!0}return(u||i)&&!f}function L(e,c,t){let n=t===void 0?` ${c}`:` ${c}="${t.replace(/"/g,"&quot;")}"`,s=e.trim(),u=s.match(G);if(u&&ne(u[3],u[1])){let[,f,i,p]=u;return`<${f}${i}${n}>${p}</${f}>`}return`<template${n}>${s}</template>`}function ne(e,c){let t=new RegExp(`<(/)?${c}(?=[\\s/>])`,"gi"),n=0,s;while((s=t.exec(e))!==null)if(s[1]){if(n--,n<0)return!1}else n++;return!0}function Zo(e,c){let t=fr(e);function n(s){let u=s,f=ee(s),i=(a)=>{let g=new Set;for(let l of f)if(a>l.start&&a<l.end)for(let d of l.vars)g.add(d);return g},p=/@if\s*\(/g,m,r=[];while((m=p.exec(u))!==null){let a=m.index,g=a+m[0].length,l=1,d=g;while(d<u.length&&l>0){if(u[d]==="(")l++;else if(u[d]===")")l--;d++}if(l!==0)continue;let b=u.substring(g,d-1).trim(),S=d,E=1,y=S,x=/@(if\s*\(|endif)/g;x.lastIndex=S;let h;while((h=x.exec(u))!==null)if(h[1].startsWith("if"))E++;else if(h[1]==="endif"){if(E--,E===0){y=h.index+h[0].length;break}}if(E!==0)continue;let R=u.substring(S,y-6).trim(),A;if(Y(R)){let C=hn(u.substring(a,y));if(C.length===0)continue;let T=C[0].branches.filter((_)=>_.type!=="else"),k=i(a);if(!(T.length>0&&T.every((_)=>W(_.condition,t,c,k))))continue;A=C[0].branches.map((_)=>{let V=n(_.content);if(_.type==="elseif")return L(V,"@else-if",_.condition??"");if(_.type==="else")return L(V,"@else");return L(V,"@if",_.condition??"")}).join(`
3
+ `)}else{if(!W(b,t,c,i(a)))continue;A=L(n(R),"@if",b)}r.push({start:a,end:y,replacement:A}),p.lastIndex=y}for(let a=r.length-1;a>=0;a--){let{start:g,end:l,replacement:d}=r[a];u=u.substring(0,g)+d+u.substring(l)}return u}return n(e)}function se(e){let c=e.trim();if(c==="")return;if(c==="true")return!0;if(c==="false")return!1;if(c==="null")return!1;if(c==="undefined")return!1;if(c==="NaN")return!1;if(/^-?\d+(?:\.\d+)?$/.test(c)){let s=Number(c);return s!==0&&!Number.isNaN(s)}let t=c.match(/^'((?:\\.|[^'\\])*)'$/);if(t)return t[1].length>0;let n=c.match(/^"((?:\\.|[^"\\])*)"$/);if(n)return n[1].length>0;return}var O=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),B=/<(script|style)\b/iy,re=/<\/script/gi,ie=/<\/style/gi;function j(e,c,t,n){if(O.has(t.toLowerCase()))return n;let s=t.toLowerCase(),u=e.length,f=1,i=n;while(i<u){let p=e.indexOf("<",i);if(p===-1)return-1;if(i=p,e.startsWith("<!--",i)){let g=e.indexOf("-->",i+4);if(g===-1)return-1;i=g+3;continue}B.lastIndex=i;let m=B.exec(e);if(m){let g=e.indexOf(">",i);if(g===-1)return-1;if(e[g-1]==="/"){i=g+1;continue}let l=m[1].toLowerCase()==="script"?re:ie;l.lastIndex=i;let d=l.exec(e);if(d===null)return-1;let b=e.indexOf(">",d.index);if(b===-1)return-1;i=b+1;continue}if(e[i+1]==="/"){let g=/^<\/([a-z][\w-]*)\s*>/i.exec(e.slice(i,i+64));if(!g){i++;continue}if(g[1].toLowerCase()===s){if(f--,i+=g[0].length,f===0)return i;continue}i+=g[0].length;continue}let r=/^<([a-z][\w-]*)\b/i.exec(e.slice(i,i+64));if(!r){i++;continue}let a=e.indexOf(">",i);if(a===-1)return-1;if(r[1].toLowerCase()===s){let g=e.slice(i,a+1);if(!(/\/\s*>$/.test(g)||O.has(s)))f++}i=a+1}return-1}var oe=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function ce(e,c){let t=c,n=e.length;for(;;){while(t<n&&e[t]!=="<")t++;if(t>=n)return!1;if(e.startsWith("<!--",t)){let f=e.indexOf("-->",t+4);if(f===-1)return!1;t=f+3;continue}break}if(e[t+1]==="/")return!1;let s=e.indexOf(">",t);if(s===-1)return!1;let u=e.slice(t,s+1);return oe.test(u)}function Qo(e){if(!e.includes(":if")&&!e.includes(":show")&&!e.includes("x-if")&&!e.includes("x-show")&&!e.includes("@if=")&&!e.includes("@show="))return e;let c=[],t=/<([a-zA-Z][\w-]*)/y,n=/\s/,s=new Set([":if",":show","x-if","x-show","@if","@show"]);w(e,(r,a)=>{t.lastIndex=a;let g=t.exec(r);if(!g||/^(?:script|style)$/i.test(g[1]))return-1;let l=t.lastIndex,d;while(l<r.length){let b=l;while(l<r.length&&n.test(r[l]))l++;let S=l;if(r[S]==="/"){S++;while(S<r.length&&n.test(r[S]))S++}if(r[S]===">"){if(d)c.push({start:a,end:S+1,tag:g[1],...d});return-1}if(l===b)return-1;let E=l;while(l<r.length&&!n.test(r[l])&&r[l]!=="="&&r[l]!==">")l++;if(l===E)return-1;let y=r.slice(E,l);if(y.startsWith("@")&&y.includes("("))return-1;let x=l,h=l;while(h<r.length&&n.test(r[h]))h++;if(r[h]!=="="){l=x;continue}h++;while(h<r.length&&n.test(r[h]))h++;let R=r[h];if(R==='"'||R==="'"){let A=r.indexOf(R,h+1);if(A===-1)return-1;if(!d&&R==='"'&&s.has(y))d={attrName:y,attrStart:b,attrEnd:A+1,value:r.slice(h+1,A)};l=A+1}else{l=h;while(l<r.length&&!n.test(r[l])&&r[l]!==">")l++}}return-1});let u=[],f=-1;for(let r of c){let{start:a,end:g,tag:l,attrName:d,value:b}=r;if(a<f)continue;let S=se(b);if(S===void 0)continue;let x=/\/\s*>$/.test(e.slice(a,g))||O.has(l.toLowerCase())?g:j(e,a,l,g);if(x===-1)continue;if((d===":if"||d==="x-if"||d==="@if")&&ce(e,x))continue;if(S===!0){let R=e.slice(a,r.attrStart)+e.slice(r.attrEnd,g);u.push({start:a,end:g,replacement:R});continue}u.push({start:a,end:x,replacement:""}),f=x}if(u.length===0)return e;u.sort((r,a)=>r.start-a.start);let i=[],p=-1;for(let r of u){if(r.start<p)continue;i.push(r),p=r.end}let m=e;for(let r=i.length-1;r>=0;r--){let{start:a,end:g,replacement:l}=i[r];m=m.substring(0,a)+l+m.substring(g)}return m}var Z=[":for","@for","x-for"];function Zf(e){let c=/(\s)((?::|@|x-|v-)[\w.:-]+)\s*=\s*"([^"]*\{\{[^"]*)"/g;return e.replace(c,(t,n,s,u)=>{let f=u.replace(/'((?:[^'\\]|\\.)*)'/g,(i,p)=>{if(!p.includes("{{"))return i;return`\`${p.replace(/`/g,"\\`").replace(/\$\{/g,"\\${").replace(/\{\{\s*([^}]+?)\s*\}\}/g,(r,a)=>`\${${a}}`)}\``});return`${n}${s}="${f}"`})}function Ss(e,c){if(!c||Object.keys(c).length===0)return e;if(!Z.some((i)=>e.includes(`${i}=`)))return e;let t=fr(e);if(Array.isArray(c.__stx_client_signal_names)){for(let i of c.__stx_client_signal_names)if(typeof i==="string")t.add(i)}let n=e,s=[],u=/<([a-zA-Z][\w-]*)((?:[^>"']|"[^"]*"|'[^']*')*)>/g,f;while((f=u.exec(n))!==null){let[i,p,m]=f,r=f.index,a=r+i.length,g=Z.map((A)=>({attr:A,m:new RegExp(`\\s${A}="([^"]*)"`).exec(m)})).find((A)=>A.m!==null);if(!g||!g.m)continue;let l=Yo(g.m[1]);if(!l.iterable||!l.itemVar)continue;let d=l.iterable.trim().split(/[.[(]/)[0].trim();if(!d||t.has(d)||!(d in c))continue;let b=j(n,r,p,a);if(b===-1)continue;let S=m.replace(new RegExp(`\\s${g.attr}="[^"]*"`),"").replace(/\s:key="[^"]*"/,"").replace(/\sx-cloak(?=\s|$)/,""),E=n.slice(a,b-`</${p}>`.length),y={...c,[l.itemVar]:void 0};if(l.indexVar)y[l.indexVar]=void 0;let x=Ss(E,y),h=l.indexVar?`${l.iterable} as ${l.indexVar} => ${l.itemVar}`:`${l.iterable} as ${l.itemVar}`,R=p.toLowerCase()==="template"?x:`<${p}${S}>${x}</${p}>`;s.push({start:r,end:b,replacement:`@foreach(${h})${R}@endforeach`}),u.lastIndex=b}for(let i=s.length-1;i>=0;i--){let{start:p,end:m,replacement:r}=s[i];n=n.slice(0,p)+r+n.slice(m)}return n}function ks(e,c){let t=e,n=/@(for|foreach)\s*\(/g,s,u=[],f=[];while((s=n.exec(t))!==null){let i=s[1],p=s.index,m=p+s[0].length,r=1,a=m;while(a<t.length&&r>0){if(t[a]==="(")r++;else if(t[a]===")")r--;a++}if(r!==0)continue;let g=t.substring(m,a-1).trim(),l=a,d=Yo(g),b=i==="for"?"@endfor":"@endforeach",S=1,E=l,y=i==="for"?new RegExp("@(for(?!each)\\s*\\(|endfor(?!each))","g"):new RegExp(`@(${i}\\s*\\(|end${i})`,"g");y.lastIndex=l;let x;while((x=y.exec(t))!==null)if(x[1].startsWith(i))S++;else if(S--,S===0){E=x.index+x[0].length;break}if(S!==0)continue;let h=()=>{let v=[d.itemVar,d.indexVar].filter(Boolean);if(v.length)f.push({start:p,end:E,vars:v})};if(d.iterable){let v=d.iterable.trim();if(v.startsWith("[")||v.startsWith("{")||v.startsWith("'")||v.startsWith('"')||v.startsWith("`")||/^-?\d/.test(v)){h();continue}let I=v.split(/[.[(]/)[0].trim(),_=c?I in c:!1,V=f.some((P)=>p>P.start&&p<P.end&&P.vars.includes(I));if(I&&(_||V)){h();continue}}if(d.style==="as")g=d.indexVar?`(${d.itemVar}, ${d.indexVar}) in ${d.iterable}`:`${d.itemVar} in ${d.iterable}`;let R=t.substring(l,E-b.length).trim(),A=c?{...c}:{};if(d.itemVar)delete A[d.itemVar];if(d.indexVar)delete A[d.indexVar];let C=Zf(ks(R,A)),T=C.match(G),k;if(T){let[,v,I,_]=T;k=`<${v}${I} @for="${g}">${_}</${v}>`}else k=`<template @for="${g}">${C}</template>`;u.push({start:p,end:E,replacement:k}),n.lastIndex=E}for(let i=u.length-1;i>=0;i--){let{start:p,end:m,replacement:r}=u[i];t=t.substring(0,p)+r+t.substring(m)}return t}function ae(e){let c=new Set,t=[],n=0,s=0,u=e.length,f=(r)=>{let a=n+1;while(a<u){let g=e[a];if(g==="\\"){a+=2;continue}if(g===r)return a+1;a++}return u},i=()=>{let r=n+2;while(r<u&&e[r]!==`
4
4
  `)r++;return r},p=()=>{let r=n+2;while(r<u-1){if(e[r]==="*"&&e[r+1]==="/")return r+2;r++}return u},m=(r)=>{let a=r,g=0;while(a<u){let l=e[a];if(l==="/"&&e[a+1]==="/"){let d=a+2;while(d<u&&e[d]!==`
5
- `)d++;a=d;continue}if(l==="/"&&e[a+1]==="*"){let d=a+2;while(d<u-1&&!(e[d]==="*"&&e[d+1]==="/"))d++;a=d+2;continue}if(l==='"'||l==="'"||l==="`"){let d=a+1;while(d<u){if(e[d]==="\\"){d+=2;continue}if(e[d]===l){d++;break}d++}a=d;continue}if(l==="("||l==="["||l==="{"){g++,a++;continue}if(l===")"||l==="]"||l==="}"){g--,a++;continue}if(l===";"&&g===0)return a+1;a++}return u};while(n<u){let r=e[n];if(r==="/"&&e[n+1]==="/"){let a=i();t.push(e.slice(n,a)),n=a;continue}if(r==="/"&&e[n+1]==="*"){let a=p();t.push(e.slice(n,a)),n=a;continue}if(r==='"'||r==="'"||r==="`"){let a=f(r);t.push(e.slice(n,a)),n=a;continue}if(r==="{"){s++,t.push(r),n++;continue}if(r==="}"){s--,t.push(r),n++;continue}if(s===0){let a=n>0?e[n-1]:"";if(a===""||/\s/.test(a)||a===";"||a==="}"||a==="{"){let l=e.slice(n).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(l){let d=l[2],b=m(n+l[0].length);if(c.has(d)){t.push(`/* stx: deduped const ${d} */`),n=b;continue}c.add(d),t.push(e.slice(n,b)),n=b;continue}}}t.push(r),n++}return t.join("")}var ue=new Set(["script","style","html","head","meta","link","title","!doctype"]);function fe(e){let c=new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${X})>`,"iy"),t=null,n=null;return y(e,(s,u)=>{c.lastIndex=u;let f=c.exec(s);if(!f)return-1;let i=f[1].toLowerCase();if(i==="script"||i==="style")return-1;let p=u+f[0].length-1;if(i==="body"&&n===null)n=p;if(t===null&&!ue.has(i))t=p;return u+f[0].length}),n??t}function de(e,c,t,n){let s=[],u=` data-stx="${n}"`,f=0,i=!1,p=(m)=>{if(t!==null&&!i&&t>=f&&t<=m)s.push(e.slice(f,t),u,e.slice(t,m)),i=!0;else s.push(e.slice(f,m))};for(let m of c){if(m.start<f)continue;p(m.start),f=m.end}return p(e.length),s.join("")}async function xs(e,c,t,n={}){let s=ys(e,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),u=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|keptState|useCookie|useId|useModel|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,f=[],{hasUserImports:i,bundleClientScript:p}=await o("stx/client-script-bundler",()=>import("./chunk-mad172af.js"));for(let x of s){let h=x.body;if(Fe(x.attrs))h=ze(h);if(n.forceClientSetup||u.test(h)){f.push({content:h,start:x.start,end:x.end});continue}if(!i(h))continue;try{let R=await p(jt(h).code,c||"",{projectRoot:process.cwd(),externalizeUserModules:!1});if(u.test(R))f.push({content:h,start:x.start,end:x.end})}catch{}}if(f.length===0)return{output:e,setupCode:null};let m=`${c??""}\x00${f.map((x)=>x.content).join("\x00")}`,r=`__stx_setup_${Bun.hash(m).toString(36).slice(0,10)}`,a=[];for(let x=0;x<f.length;x++){let h=f[x].bundled??jt(f[x].content).code;if(!f[x].bundled&&i(h))h=await p(h,c||"",{projectRoot:process.cwd()});h=St(h);let R=I(h);a.push(`// \u2500\u2500 merged signal script #${x+1} \u2500\u2500
5
+ `)d++;a=d;continue}if(l==="/"&&e[a+1]==="*"){let d=a+2;while(d<u-1&&!(e[d]==="*"&&e[d+1]==="/"))d++;a=d+2;continue}if(l==='"'||l==="'"||l==="`"){let d=a+1;while(d<u){if(e[d]==="\\"){d+=2;continue}if(e[d]===l){d++;break}d++}a=d;continue}if(l==="("||l==="["||l==="{"){g++,a++;continue}if(l===")"||l==="]"||l==="}"){g--,a++;continue}if(l===";"&&g===0)return a+1;a++}return u};while(n<u){let r=e[n];if(r==="/"&&e[n+1]==="/"){let a=i();t.push(e.slice(n,a)),n=a;continue}if(r==="/"&&e[n+1]==="*"){let a=p();t.push(e.slice(n,a)),n=a;continue}if(r==='"'||r==="'"||r==="`"){let a=f(r);t.push(e.slice(n,a)),n=a;continue}if(r==="{"){s++,t.push(r),n++;continue}if(r==="}"){s--,t.push(r),n++;continue}if(s===0){let a=n>0?e[n-1]:"";if(a===""||/\s/.test(a)||a===";"||a==="}"||a==="{"){let l=e.slice(n).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(l){let d=l[2],b=m(n+l[0].length);if(c.has(d)){t.push(`/* stx: deduped const ${d} */`),n=b;continue}c.add(d),t.push(e.slice(n,b)),n=b;continue}}}t.push(r),n++}return t.join("")}var le=new Set(["script","style","html","head","meta","link","title","!doctype"]);function fe(e){let c=new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${U})>`,"iy"),t=null,n=null;return w(e,(s,u)=>{c.lastIndex=u;let f=c.exec(s);if(!f)return-1;let i=f[1].toLowerCase();if(i==="script"||i==="style")return-1;let p=u+f[0].length-1;if(i==="body"&&n===null)n=p;if(t===null&&!le.has(i))t=p;return u+f[0].length}),n??t}function de(e,c,t,n){let s=[],u=` data-stx="${n}"`,f=0,i=!1,p=(m)=>{if(t!==null&&!i&&t>=f&&t<=m)s.push(e.slice(f,t),u,e.slice(t,m)),i=!0;else s.push(e.slice(f,m))};for(let m of c){if(m.start<f)continue;p(m.start),f=m.end}return p(e.length),s.join("")}async function _s(e,c,t,n={}){let s=vs(e,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),u=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|keptState|useCookie|useId|useModel|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,f=[],{hasUserImports:i,bundleClientScript:p}=await o("stx/client-script-bundler",()=>import("./chunk-12sv6b9c.js"));for(let x of s){let h=x.body;if(Ve(x.attrs))h=Ue(h);if(n.forceClientSetup||u.test(h)){f.push({content:h,start:x.start,end:x.end});continue}if(!i(h))continue;try{let R=await p(zt(h).code,c||"",{projectRoot:process.cwd(),externalizeUserModules:!1});if(u.test(R))f.push({content:h,start:x.start,end:x.end})}catch{}}if(f.length===0)return{output:e,setupCode:null};let m=`${c??""}\x00${f.map((x)=>x.content).join("\x00")}`,r=`__stx_setup_${Bun.hash(m).toString(36).slice(0,10)}`,a=[];for(let x=0;x<f.length;x++){let h=f[x].bundled??zt(f[x].content).code;if(!f[x].bundled&&i(h))h=await p(h,c||"",{projectRoot:process.cwd()});h=Ct(h);let R=N(h);a.push(`// \u2500\u2500 merged signal script #${x+1} \u2500\u2500
6
6
  ${R}`)}let g=a.join(`
7
7
 
8
- `);g=le(g);let d=V(g).split(",").map((x)=>x.trim()).filter(Boolean),b=vn(g,t),S=`
8
+ `);g=ae(g);let d=q(g).split(",").map((x)=>x.trim()).filter(Boolean),b=kn(g,t),S=`
9
9
  <script data-stx-scoped>
10
10
  function ${r}() {
11
- ${ut("const",d)}
12
- ${ae(`${b}${g}`)}
13
- return ${Ds(g,d)};
11
+ ${ft("const",d)}
12
+ ${ue(`${b}${g}`)}
13
+ return ${Bs(g,d)};
14
14
  }
15
15
  window.__stx_latestSetup=${r};
16
16
  if(window.stx)window.stx._latestSetup=${r};
17
- </script>`,w=fe(e);return{output:de(e,f,w,r),setupCode:S}}async function Yo(e,c,t,n){if(!bs(e,t))return e;let s=e;if(c.skipSignalsRuntime)return s;let{output:u,setupCode:f}=await xs(s,t,n);if(s=u,!f){let i=B(s);if(i&&!/data-stx/.test(i.attrs)&&!/data-stx-auto/.test(i.attrs)){let p=i.tag.replace(/^<body([^>]*)>$/i,"<body$1 data-stx-auto>");s=s.slice(0,i.index)+p+s.slice(i.index+i.tag.length)}}if(s=await pr(s,c),f){let i=bc(s,/<\/head>/i),p=i===-1?bc(s,/<body[^>]*>/i):-1;if(i!==-1)s=`${s.slice(0,i)}${f}
17
+ </script>`,E=fe(e);return{output:de(e,f,E,r),setupCode:S}}async function ei(e,c,t,n){if(!xs(e,t))return e;let s=e;if(c.skipSignalsRuntime)return s;let{output:u,setupCode:f}=await _s(s,t,n);if(s=u,!f){let i=H(s);if(i&&!/data-stx/.test(i.attrs)&&!/data-stx-auto/.test(i.attrs)){let p=i.tag.replace(/^<body([^>]*)>$/i,"<body$1 data-stx-auto>");s=s.slice(0,i.index)+p+s.slice(i.index+i.tag.length)}}if(s=await mr(s,c),f){let i=xc(s,/<\/head>/i),p=i===-1?xc(s,/<body[^>]*>/i):-1;if(i!==-1)s=`${s.slice(0,i)}${f}
18
18
  ${s.slice(i)}`;else if(p!==-1){let m=/<body[^>]*>/i.exec(s.slice(p))[0],r=p+m.length;s=`${s.slice(0,r)}
19
19
  ${f}${s.slice(r)}`}else s=`${s}
20
- ${f}`}return s}function bc(e,c){let t=/<(script|style)\b[\s\S]*?<\/\1>/gi,n=[],s;while((s=t.exec(e))!==null)n.push([s.index,s.index+s[0].length]);let u=new RegExp(c.source,c.flags.replace(/[gy]/g,"")),f=0;while(f<e.length){let i=u.exec(e.slice(f));if(!i)return-1;let p=f+i.index;if(!n.some(([r,a])=>p>=r&&p<a))return p;f=p+Math.max(i[0].length,1)}return-1}var G="/* [stx import stripped, resolved via window.stx in __stx_setup] */";function Jf(e){let c=[];for(let t of e.split(",")){let n=t.trim();if(!n||n.startsWith("type "))continue;let s=n.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(s&&s[1]!==s[2])c.push(`${s[2]} = ${s[1]}`)}if(c.length===0)return G;return`var ${c.join(", ")}; ${G}`}var ge=/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"](?:stx|@stacksjs\/stx|@stacksjs\/browser)['"]\s*;?\s*$/gm;function St(e){return e.replace(ge,(c,t)=>Jf(t))}
21
- export{Xh,ys,Go,bs,ur,Xo,Jo,Xf,ws,vs,xs,Yo,bc,Jf,St};
20
+ ${f}`}return s}function xc(e,c){let t=/<(script|style)\b[\s\S]*?<\/\1>/gi,n=[],s;while((s=t.exec(e))!==null)n.push([s.index,s.index+s[0].length]);let u=new RegExp(c.source,c.flags.replace(/[gy]/g,"")),f=0;while(f<e.length){let i=u.exec(e.slice(f));if(!i)return-1;let p=f+i.index;if(!n.some(([r,a])=>p>=r&&p<a))return p;f=p+Math.max(i[0].length,1)}return-1}var F="/* [stx import stripped, resolved via window.stx in __stx_setup] */";function Qf(e){let c=[];for(let t of e.split(",")){let n=t.trim();if(!n||n.startsWith("type "))continue;let s=n.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(s&&s[1]!==s[2])c.push(`${s[2]} = ${s[1]}`)}if(c.length===0)return F;return`var ${c.join(", ")}; ${F}`}var ge=/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"](?:stx|@stacksjs\/stx|@stacksjs\/browser)['"]\s*;?\s*$/gm;function Ct(e){return e.replace(ge,(c,t)=>Qf(t))}
21
+ export{Zh,vs,Yo,xs,fr,Zo,Qo,Zf,Ss,ks,_s,ei,xc,Qf,Ct};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{eg,Qh,ey,ty,ny,tg,ng,ry,sy,ni,oy,hr,yr,Es}from"./chunk-2s7rmn9r.js";import{at}from"./chunk-n3jw3xpj.js";import"./chunk-2kfayg4t.js";import"./chunk-0fh47gp0.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{ny as __setSignalsGeneratorsForTest,at as cacheEngineFingerprint,yr as cacheTemplate,hr as checkCache,oy as clearDevCaches,ng as getCachedRouterScript,tg as getCachedSignalsRuntime,ry as getServeClientAsset,ni as getServeModuleBundle,Es as hashFilePath,ey as invalidateFileCache,ty as invalidateFileCacheByDir,Qh as readFileCached,sy as registerServeModuleBundle,eg as templateCache};
@@ -1,9 +1,9 @@
1
1
  // @bun
2
- import R from"path";var O=/__stxModules\["((?:[^"\\]|\\.)*)"\]/g;function zr(...g){let d=new Set;for(let c of g){if(!c||!c.includes("__stxModules["))continue;for(let s of c.matchAll(O))try{d.add(JSON.parse(`"${s[1]}"`))}catch{}}return[...d].sort()}function co(...g){let d=new Map,c=(s,e)=>{let r=d.get(s);if(r===null)return;if(e===null){d.set(s,null);return}let n=r??new Set;for(let i of e)n.add(i);d.set(s,n)};for(let s of g){if(!s||!s.includes("__stxModules["))continue;let e=[];for(let n of s.matchAll(/([\w$]+)\s*=\s*globalThis\.__stxModules\s*&&\s*globalThis\.__stxModules\["((?:[^"\\]|\\.)*)"\]/g)){let i;try{i=JSON.parse(`"${n[2]}"`)}catch{continue}e.push({variable:n[1],id:i,start:n.index+n[0].length,end:s.length})}let r=s.match(/__stxModules\["(?:[^"\\]|\\.)*"\]/g)?.length??0;if(e.length===0||r!==e.length){for(let n of zr(s))c(n,null);continue}for(let[n,i]of e.entries()){let p=e.slice(n+1).find((h)=>h.variable===i.variable);i.end=p?p.start:s.length}for(let n of e){let i=new Set,p=!1,h=n.variable.replace(/[$]/g,"\\$&"),o=s.slice(n.start,n.end);for(let l of o.matchAll(new RegExp(`(?<![\\w$.])${h}(?![\\w$])`,"g"))){let f=o.slice(l.index+n.variable.length,l.index+n.variable.length+200),a=/^\s*\[\s*(["'])([A-Za-z_$][\w$]*)\1\s*\]/.exec(f)??/^\s*\.\s*([A-Za-z_$][\w$]*)/.exec(f);if(a){i.add(a[a.length-1]);continue}if(/^\s*[!=]==?\s*(?:undefined|void 0)\b/.test(f))continue;p=!0;break}c(n.id,p?null:i)}}return d}function v(g,d,c){let s=[],e=[];return g.forEach((r,n)=>{let i=r.startsWith("npm:")?r.slice(4):R.resolve(d,r),p=`__stxRegistered${n}`,h=JSON.stringify(r),o=c?.get(r);if(o&&[...o].every((l)=>/^[A-Za-z_$][\w$]*$/.test(l))){let l=[...o].sort(),f=l.map((m,_)=>`${m} as ${p}_${_}`);s.push(l.length>0?`import { ${f.join(", ")} } from ${JSON.stringify(i)};`:`import ${JSON.stringify(i)};`);let a=l.map((m,_)=>`get ${JSON.stringify(m)}() { return ${p}_${_}; }`).join(", ");e.push(`if (!globalThis.__stxModules[${h}]) globalThis.__stxModules[${h}] = { ${a} };`);return}s.push(`import * as ${p} from ${JSON.stringify(i)};`),e.push(`if (!globalThis.__stxModules[${h}]) globalThis.__stxModules[${h}] = ${p};`)}),[...s,"globalThis.__stxModules = globalThis.__stxModules || {};",...e].join(`
3
- `)}async function Qg(g,d={}){if(g.length===0)return null;let c=process.cwd(),s=v(g,c,d.names),e;try{let{bundleClientScript:l}=await import("./chunk-mad172af.js"),f=()=>l(s,R.join(c,".stx-module-registry.ts"),{projectRoot:c,minify:d.minify,externalizeUserModules:!1,collectInputs:d.collectInputs,throwOnFailure:!0});try{e=await f()}catch(a){if(!d.names)throw a;s=v(g,c,void 0),e=await f()}}catch(l){let{formatBuildFailure:f}=await import("./chunk-shy2hkvj.js"),a=f(l);console.warn(`[stx] could not build the page module registry (#1957): ${a}`);let m=`[stx] the page module registry did not build, so ${g.join(", ")} cannot load (#1957): ${a}`;return`;console.error(${JSON.stringify(m)});`}let{transformAutoImports:r,generateAutoImportDestructuring:n}=await import("./chunk-tqs9pcga.js"),i=r(e),p=n(i.stxImports,i.browserImports),{transformStoreImports:h}=await import("./chunk-f18rxz70.js");e=h(i.code);let o=JSON.stringify(new Bun.CryptoHasher("md5").update(s).digest("hex").slice(0,12));return[";(function() {"," var __stxBundles = globalThis.__stxModuleBundles || (globalThis.__stxModuleBundles = {});",` if (__stxBundles[${o}]) return;`,` __stxBundles[${o}] = true;`,p,e,"})();"].join(`
2
+ import R from"path";var O=/__stxModules\["((?:[^"\\]|\\.)*)"\]/g;function Ur(...g){let d=new Set;for(let c of g){if(!c||!c.includes("__stxModules["))continue;for(let s of c.matchAll(O))try{d.add(JSON.parse(`"${s[1]}"`))}catch{}}return[...d].sort()}function po(...g){let d=new Map,c=(s,e)=>{let r=d.get(s);if(r===null)return;if(e===null){d.set(s,null);return}let n=r??new Set;for(let i of e)n.add(i);d.set(s,n)};for(let s of g){if(!s||!s.includes("__stxModules["))continue;let e=[];for(let n of s.matchAll(/([\w$]+)\s*=\s*globalThis\.__stxModules\s*&&\s*globalThis\.__stxModules\["((?:[^"\\]|\\.)*)"\]/g)){let i;try{i=JSON.parse(`"${n[2]}"`)}catch{continue}e.push({variable:n[1],id:i,start:n.index+n[0].length,end:s.length})}let r=s.match(/__stxModules\["(?:[^"\\]|\\.)*"\]/g)?.length??0;if(e.length===0||r!==e.length){for(let n of Ur(s))c(n,null);continue}for(let[n,i]of e.entries()){let p=e.slice(n+1).find((h)=>h.variable===i.variable);i.end=p?p.start:s.length}for(let n of e){let i=new Set,p=!1,h=n.variable.replace(/[$]/g,"\\$&"),o=s.slice(n.start,n.end);for(let l of o.matchAll(new RegExp(`(?<![\\w$.])${h}(?![\\w$])`,"g"))){let f=o.slice(l.index+n.variable.length,l.index+n.variable.length+200),a=/^\s*\[\s*(["'])([A-Za-z_$][\w$]*)\1\s*\]/.exec(f)??/^\s*\.\s*([A-Za-z_$][\w$]*)/.exec(f);if(a){i.add(a[a.length-1]);continue}if(/^\s*[!=]==?\s*(?:undefined|void 0)\b/.test(f))continue;p=!0;break}c(n.id,p?null:i)}}return d}function v(g,d,c){let s=[],e=[];return g.forEach((r,n)=>{let i=r.startsWith("npm:")?r.slice(4):R.resolve(d,r),p=`__stxRegistered${n}`,h=JSON.stringify(r),o=c?.get(r);if(o&&[...o].every((l)=>/^[A-Za-z_$][\w$]*$/.test(l))){let l=[...o].sort(),f=l.map((m,_)=>`${m} as ${p}_${_}`);s.push(l.length>0?`import { ${f.join(", ")} } from ${JSON.stringify(i)};`:`import ${JSON.stringify(i)};`);let a=l.map((m,_)=>`get ${JSON.stringify(m)}() { return ${p}_${_}; }`).join(", ");e.push(`if (!globalThis.__stxModules[${h}]) globalThis.__stxModules[${h}] = { ${a} };`);return}s.push(`import * as ${p} from ${JSON.stringify(i)};`),e.push(`if (!globalThis.__stxModules[${h}]) globalThis.__stxModules[${h}] = ${p};`)}),[...s,"globalThis.__stxModules = globalThis.__stxModules || {};",...e].join(`
3
+ `)}async function nm(g,d={}){if(g.length===0)return null;let c=process.cwd(),s=v(g,c,d.names),e;try{let{bundleClientScript:l}=await import("./chunk-12sv6b9c.js"),f=()=>l(s,R.join(c,".stx-module-registry.ts"),{projectRoot:c,minify:d.minify,externalizeUserModules:!1,collectInputs:d.collectInputs,throwOnFailure:!0});try{e=await f()}catch(a){if(!d.names)throw a;s=v(g,c,void 0),e=await f()}}catch(l){let{formatBuildFailure:f}=await import("./chunk-cvgbtmxp.js"),a=f(l);console.warn(`[stx] could not build the page module registry (#1957): ${a}`);let m=`[stx] the page module registry did not build, so ${g.join(", ")} cannot load (#1957): ${a}`;return`;console.error(${JSON.stringify(m)});`}let{transformAutoImports:r,generateAutoImportDestructuring:n}=await import("./chunk-xsq2jf96.js"),i=r(e),p=n(i.stxImports,i.browserImports),{transformStoreImports:h}=await import("./chunk-4pr29yrx.js");e=h(i.code);let o=JSON.stringify(new Bun.CryptoHasher("md5").update(s).digest("hex").slice(0,12));return[";(function() {"," var __stxBundles = globalThis.__stxModuleBundles || (globalThis.__stxModuleBundles = {});",` if (__stxBundles[${o}]) return;`,` __stxBundles[${o}] = true;`,p,e,"})();"].join(`
4
4
  `)}var P=/^import(?:[ \t]*(\{[^}]*\})[ \t]*from|[ \t]*\*[ \t]*as[ \t]+([\w$]+)[ \t]+from)?[ \t]*["']\.\/(chunk-[\w-]+)\.js["'][ \t]*;?[ \t]*$/gm,j=/^export\s*\{([^}]*)\}\s*;?[ \t]*$/gm,I=new Set(["__preload","__chunks"]),N=/^("[^"]*"|[\w$]+)(?:\s+as\s+("[^"]*"|[\w$]+))?$/;function J(g){let d=[],c=[],s=!0,r=g.replace(/^var __chunkGraphs;[\s\S]*?^var __chunks = [\s\S]*?^\};[ \t]*\n?/m,"").replace(/^__chunks\(import\.meta\.url,[^\n]*\);[ \t]*\n?/gm,"").replace(P,(h,o,l,f)=>{let a=`__stxChunkExports${d.length}`;if(d.push(f),c.push(`var ${a} = __stxChunk(${JSON.stringify(f)});`),l)c.push(`var ${l} = ${a};`);else if(o)for(let m of o.slice(1,-1).split(",")){let _=m.trim();if(!_)continue;let w=N.exec(_);if(!w){s=!1;continue}if(I.has(w[1]))continue;let M=w[1].startsWith('"')?JSON.parse(w[1]):w[1],t=w[2]??w[1];if(t.startsWith('"')){s=!1;continue}c.push(`var ${t} = ${a}[${JSON.stringify(M)}];`)}return""});if(!s)throw Error("an import it does not read");let n=[];r=r.replace(/\(\s*__preload\([^)]*\)\s*,\s*import\(\s*["']\.\/(chunk-[\w-]+)\.js["']\s*\)\s*\)|\bimport\(\s*["']\.\/(chunk-[\w-]+)\.js["']\s*\)/g,(h,o,l)=>{let f=o??l;return n.push(f),`Promise.resolve().then(function () { return __stxChunk(${JSON.stringify(f)}); })`});let i=[];r=r.replace(j,(h,o)=>{for(let l of o.split(",")){let f=l.trim();if(!f)continue;let a=N.exec(f);if(!a||a[1].startsWith('"')){s=!1;continue}if(I.has(a[1]))continue;let m=a[2]??a[1];i.push([a[1],m.startsWith('"')?JSON.parse(m):m])}return""});let p=[/\bimport\.meta\b/,/\b__chunks\b/,/\b__preload\b/,/^\s*export\s+(?:default\b|const\b|let\b|var\b|function\b|class\b|async\b|\*|\{)/m,/\bfrom\s*["']\.\/chunk-/,/^\s*import\s*["']\.\/chunk-/m].find((h)=>h.test(r));if(!s||p)throw Error(`${p?`${p.source} is left in it`:"an export it does not read"}`);return{reads:c.join(`
5
- `),chunks:d,lazy:n,body:r,exports:i}}function Dl(g){if(/\bexport\s+(?:let|var)\b/.test(g))return!0;if(g.length/Math.max(1,g.split(`
6
- `).length)>200)return!1;for(let d of g.matchAll(/\bexport\s*\{([^}]*)\}(?!\s*from\b)/g))for(let c of d[1].split(",")){let s=c.trim().split(/\s+as\s+/)[0].trim();if(!/^[A-Za-z_$][\w$]*$/.test(s))continue;let e=s.replace(/[$]/g,"\\$&");if(!new RegExp(`(?<![\\w$.])(?:let|var)\\s+${e}(?![\\w$])`,"g").test(g))continue;let n=new RegExp(`(?<![\\w$.])${e}\\s*(?:=(?![=>])|[-+*/%&|^]=|\\*\\*=|<<=|>>>?=|&&=|\\|\\|=|\\?\\?=|\\+\\+|--)|(?:\\+\\+|--)\\s*${e}(?![\\w$])`,"g"),i=new RegExp(`(?<![\\w$.])(?:let|var|const)\\s+${e}\\s*=`,"g");if((g.match(n)?.length??0)>(g.match(i)?.length??0))return!0}return!1}async function lo(g,d={}){let c=g.filter((e)=>e.ids.length>0);if(c.length===0)return{chunks:new Map,routes:new Map,reads:new Map};let s=process.cwd();try{let{bundleClientEntriesSplit:e}=await import("./chunk-mad172af.js"),r=[],n=await e(new Map(c.map((t)=>[t.name,v(t.ids,s,t.names)])),{projectRoot:s,filePath:R.join(s,".stx-module-registry.ts"),collectInputs:r});d.collectInputs?.push(...r);let{transformAutoImports:i,generateAutoImportDestructuring:p}=await import("./chunk-tqs9pcga.js"),{transformStoreImports:h}=await import("./chunk-f18rxz70.js"),o=new Map;for(let[t,u]of[...n.chunks,...n.entries])try{o.set(t,J(u))}catch(b){throw Error(`cannot read ${t}: ${b instanceof Error?b.message:String(b)}`)}for(let[t,u]of[...n.chunks,...n.entries])if(/\b__esm\(/.test(u))throw Error(`${t} initialises a module lazily`);for(let t of r)if(/\.(?:[cm]?[jt]sx?)$/.test(t)&&Dl(await Bun.file(t).text()))throw Error(`${t} exports a binding that changes after it is read`);let l=new Set,f=new Set,a=(t)=>{if(f.has(t))return;if(l.has(t))throw Error(`the chunks import each other (${t})`);l.add(t);for(let u of o.get(t)?.chunks??[]){if(!o.has(u))throw Error(`${t} imports ${u}, which was not built`);a(u)}for(let u of o.get(t)?.lazy??[])if(!o.has(u))throw Error(`${t} imports ${u}, which was not built`);l.delete(t),f.add(t)};for(let t of o.keys())a(t);let m=(t)=>{let u=i(t.body);return{prelude:p(u.stxImports,u.browserImports),body:h(u.code)}},_=new Map;for(let t of n.chunks.keys()){let u=o.get(t),{prelude:b,body:k}=m(u),y=u.exports.map(([S,x])=>`get ${JSON.stringify(x)}() { return ${S}; }`).join(", ");_.set(t,`function (__stxChunk) {
5
+ `),chunks:d,lazy:n,body:r,exports:i}}function Bl(g){if(/\bexport\s+(?:let|var)\b/.test(g))return!0;if(g.length/Math.max(1,g.split(`
6
+ `).length)>200)return!1;for(let d of g.matchAll(/\bexport\s*\{([^}]*)\}(?!\s*from\b)/g))for(let c of d[1].split(",")){let s=c.trim().split(/\s+as\s+/)[0].trim();if(!/^[A-Za-z_$][\w$]*$/.test(s))continue;let e=s.replace(/[$]/g,"\\$&");if(!new RegExp(`(?<![\\w$.])(?:let|var)\\s+${e}(?![\\w$])`,"g").test(g))continue;let n=new RegExp(`(?<![\\w$.])${e}\\s*(?:=(?![=>])|[-+*/%&|^]=|\\*\\*=|<<=|>>>?=|&&=|\\|\\|=|\\?\\?=|\\+\\+|--)|(?:\\+\\+|--)\\s*${e}(?![\\w$])`,"g"),i=new RegExp(`(?<![\\w$.])(?:let|var|const)\\s+${e}\\s*=`,"g");if((g.match(n)?.length??0)>(g.match(i)?.length??0))return!0}return!1}async function fo(g,d={}){let c=g.filter((e)=>e.ids.length>0);if(c.length===0)return{chunks:new Map,routes:new Map,reads:new Map};let s=process.cwd();try{let{bundleClientEntriesSplit:e}=await import("./chunk-12sv6b9c.js"),r=[],n=await e(new Map(c.map((t)=>[t.name,v(t.ids,s,t.names)])),{projectRoot:s,filePath:R.join(s,".stx-module-registry.ts"),collectInputs:r});d.collectInputs?.push(...r);let{transformAutoImports:i,generateAutoImportDestructuring:p}=await import("./chunk-xsq2jf96.js"),{transformStoreImports:h}=await import("./chunk-4pr29yrx.js"),o=new Map;for(let[t,u]of[...n.chunks,...n.entries])try{o.set(t,J(u))}catch(b){throw Error(`cannot read ${t}: ${b instanceof Error?b.message:String(b)}`)}for(let[t,u]of[...n.chunks,...n.entries])if(/\b__esm\(/.test(u))throw Error(`${t} initialises a module lazily`);for(let t of r)if(/\.(?:[cm]?[jt]sx?)$/.test(t)&&Bl(await Bun.file(t).text()))throw Error(`${t} exports a binding that changes after it is read`);let l=new Set,f=new Set,a=(t)=>{if(f.has(t))return;if(l.has(t))throw Error(`the chunks import each other (${t})`);l.add(t);for(let u of o.get(t)?.chunks??[]){if(!o.has(u))throw Error(`${t} imports ${u}, which was not built`);a(u)}for(let u of o.get(t)?.lazy??[])if(!o.has(u))throw Error(`${t} imports ${u}, which was not built`);l.delete(t),f.add(t)};for(let t of o.keys())a(t);let m=(t)=>{let u=i(t.body);return{prelude:p(u.stxImports,u.browserImports),body:h(u.code)}},_=new Map;for(let t of n.chunks.keys()){let u=o.get(t),{prelude:b,body:k}=m(u),y=u.exports.map(([S,x])=>`get ${JSON.stringify(x)}() { return ${S}; }`).join(", ");_.set(t,`function (__stxChunk) {
7
7
  ${b}
8
8
  ${u.reads}
9
9
  ${k}
@@ -13,5 +13,5 @@ var __stxChunk = function (name) { return globalThis.__stxNativeRuntime.chunk(na
13
13
  ${b}
14
14
  ${u.reads}
15
15
  ${k}
16
- })();`);let y=new Set,S=(x)=>{if(y.has(x))return;y.add(x);let E=o.get(x);for(let A of[...E.chunks,...E.lazy])S(A)};for(let x of[...u.chunks,...u.lazy])S(x);M.set(t,[...y].sort())}return{chunks:_,routes:w,reads:M}}catch(e){let{formatBuildFailure:r}=await import("./chunk-shy2hkvj.js");return console.warn(`[stx] could not share the native routes' modules, building each route's alone: ${r(e)}`),null}}
17
- export{zr,co,Qg,Dl,lo};
16
+ })();`);let y=new Set,S=(x)=>{if(y.has(x))return;y.add(x);let E=o.get(x);for(let A of[...E.chunks,...E.lazy])S(A)};for(let x of[...u.chunks,...u.lazy])S(x);M.set(t,[...y].sort())}return{chunks:_,routes:w,reads:M}}catch(e){let{formatBuildFailure:r}=await import("./chunk-cvgbtmxp.js");return console.warn(`[stx] could not share the native routes' modules, building each route's alone: ${r(e)}`),null}}
17
+ export{Ur,po,nm,Bl,fo};
@@ -45,12 +45,12 @@ var p=0;function f(){return`stx-teleport-${++p}`}function g(t){let e=t.split(","
45
45
  });
46
46
  })();
47
47
  </script>
48
- `}function oh(t,e,l){p=0;let o=/@teleport\s*\(([^)]+)\)\s*([\s\S]*?)@endteleport/g;return t.replace(o,(r,s,d)=>{let a=f(),{target:u,disabled:n}=g(s),c=d.trim();if(n)try{let i=!1;if(n==="true")i=!0;else if(n==="false")i=!1;else if(n in e)i=Boolean(e[n]);if(i)return`<div class="stx-teleport-inline" data-teleport-disabled>${c}</div>`}catch{}let m=h(a,u);return`
48
+ `}function ch(t,e,l){p=0;let o=/@teleport\s*\(([^)]+)\)\s*([\s\S]*?)@endteleport/g;return t.replace(o,(r,s,d)=>{let a=f(),{target:u,disabled:n}=g(s),c=d.trim();if(n)try{let i=!1;if(n==="true")i=!0;else if(n==="false")i=!1;else if(n in e)i=Boolean(e[n]);if(i)return`<div class="stx-teleport-inline" data-teleport-disabled>${c}</div>`}catch{}let m=h(a,u);return`
49
49
  <div id="${a}" class="stx-teleport-source" style="display: none;">
50
50
  <template>${c}</template>
51
51
  </div>
52
52
  ${m}
53
- `})}function ih(){return`
53
+ `})}function lh(){return`
54
54
  <script>
55
55
  (function() {
56
56
  // Common teleport targets
@@ -68,4 +68,4 @@ var p=0;function f(){return`stx-teleport-${++p}`}function g(t){let e=t.split(","
68
68
  })();
69
69
  </script>
70
70
  `}
71
- export{oh,ih};
71
+ export{ch,lh};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{se}from"./chunk-fyfvqd2s.js";import R from"fs";import g from"path";import C from"crypto";var S=new Set(["webp","avif","jpeg","png"]),T=new Set(["cover","contain","fill","inside","outside"]),q=new Set([".jpg",".jpeg",".png",".webp",".avif",".gif"]),k=4096,D=80,U="cover";async function xa(e,t){let r=t.routePath??"/_stx/img",h=new URL(e.url);if(h.pathname!==r)return null;let a=A(h,t);if(!a.ok)return new Response(a.error,{status:a.status,headers:{"Content-Type":"text/plain"}});let{srcFsPath:n,srcUrl:d,width:l,height:i,format:s,quality:u,fit:c}=a,m;try{m=R.statSync(n)}catch{return new Response(`Source image not found: ${d}`,{status:404,headers:{"Content-Type":"text/plain"}})}if(!m.isFile())return new Response("Not a file",{status:404,headers:{"Content-Type":"text/plain"}});let w=t.cacheDir??".stx/cache/img";await R.promises.mkdir(w,{recursive:!0});let b=`${n}:${m.mtimeMs}:${m.size}`,I=`${l}x${i}:${s}:${u}:${c}`,f=C.createHash("sha256").update(`${b}|${I}`).digest("hex").slice(0,16),o=g.join(w,`${f}.${s}`),p={"Content-Type":se(s),"Cache-Control":"public, max-age=31536000, immutable",ETag:`"${f}"`,"X-Stx-Image-Cache":"HIT"};if(e.headers.get("if-none-match")===`"${f}"`)return new Response(null,{status:304,headers:p});let v=Bun.file(o);if(await v.exists())return new Response(v,{headers:p});try{let x=Buffer.from(await Bun.file(n).arrayBuffer()),{resizeAndConvert:P}=await L(),F=await P(x,{width:l,height:i,format:s,quality:u,fit:c});return await Bun.write(o,F),p["X-Stx-Image-Cache"]="MISS",new Response(new Uint8Array(F),{headers:p})}catch(x){let P=x.message;return new Response(`Image processing failed: ${P}`,{status:500,headers:{"Content-Type":"text/plain"}})}}function Yl(e){return async(t)=>await xa(t,e)??new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain"}})}function A(e,t){let r=e.searchParams.get("src");if(!r)return{ok:!1,error:"Missing required param: src",status:400};if(!r.startsWith("/"))return{ok:!1,error:"src must be an absolute URL path (start with /)",status:400};if(r.startsWith("//"))return{ok:!1,error:"src must be a local path",status:400};let h=g.extname(r).toLowerCase();if(!q.has(h))return{ok:!1,error:`Unsupported source extension: ${h}`,status:400};let a=g.resolve(t.publicDir),n=g.resolve(a,r.slice(1));if(!n.startsWith(`${a}${g.sep}`)&&n!==a)return{ok:!1,error:"src is outside publicDir",status:400};let d=t.maxWidth??k,l=t.maxHeight??k,i=e.searchParams.get("w"),s=e.searchParams.get("h"),u=i?Number.parseInt(i,10):0,c=s?Number.parseInt(s,10):0;if(i&&(!Number.isFinite(u)||u<=0))return{ok:!1,error:"Invalid w (must be positive integer)",status:400};if(s&&(!Number.isFinite(c)||c<=0))return{ok:!1,error:"Invalid h (must be positive integer)",status:400};if(!i&&!s)return{ok:!1,error:"At least one of w or h is required",status:400};let m=Math.min(u||d,d),w=Math.min(c||l,l),b=e.searchParams.get("f")||"webp";if(!S.has(b))return{ok:!1,error:`Invalid f (must be one of: ${[...S].join(", ")})`,status:400};let I=b,f=e.searchParams.get("q"),o=f?Number.parseInt(f,10):t.defaultQuality??D;if(!Number.isFinite(o)||o<1||o>100)return{ok:!1,error:"Invalid q (must be 1-100)",status:400};let y=e.searchParams.get("fit")||t.defaultFit||U;if(!T.has(y))return{ok:!1,error:`Invalid fit (must be one of: ${[...T].join(", ")})`,status:400};return{ok:!0,srcFsPath:n,srcUrl:r,width:m,height:w,format:I,quality:o,fit:y}}async function L(){return await import("./chunk-2pbhdaka.js")}
3
- export{xa,Yl};
2
+ import{ae}from"./chunk-8me8hamk.js";import R from"fs";import g from"path";import C from"crypto";var S=new Set(["webp","avif","jpeg","png"]),T=new Set(["cover","contain","fill","inside","outside"]),q=new Set([".jpg",".jpeg",".png",".webp",".avif",".gif"]),k=4096,D=80,U="cover";async function Ca(e,t){let r=t.routePath??"/_stx/img",h=new URL(e.url);if(h.pathname!==r)return null;let a=A(h,t);if(!a.ok)return new Response(a.error,{status:a.status,headers:{"Content-Type":"text/plain"}});let{srcFsPath:n,srcUrl:d,width:l,height:i,format:s,quality:u,fit:c}=a,m;try{m=R.statSync(n)}catch{return new Response(`Source image not found: ${d}`,{status:404,headers:{"Content-Type":"text/plain"}})}if(!m.isFile())return new Response("Not a file",{status:404,headers:{"Content-Type":"text/plain"}});let w=t.cacheDir??".stx/cache/img";await R.promises.mkdir(w,{recursive:!0});let b=`${n}:${m.mtimeMs}:${m.size}`,I=`${l}x${i}:${s}:${u}:${c}`,f=C.createHash("sha256").update(`${b}|${I}`).digest("hex").slice(0,16),o=g.join(w,`${f}.${s}`),p={"Content-Type":ae(s),"Cache-Control":"public, max-age=31536000, immutable",ETag:`"${f}"`,"X-Stx-Image-Cache":"HIT"};if(e.headers.get("if-none-match")===`"${f}"`)return new Response(null,{status:304,headers:p});let v=Bun.file(o);if(await v.exists())return new Response(v,{headers:p});try{let x=Buffer.from(await Bun.file(n).arrayBuffer()),{resizeAndConvert:P}=await L(),F=await P(x,{width:l,height:i,format:s,quality:u,fit:c});return await Bun.write(o,F),p["X-Stx-Image-Cache"]="MISS",new Response(new Uint8Array(F),{headers:p})}catch(x){let P=x.message;return new Response(`Image processing failed: ${P}`,{status:500,headers:{"Content-Type":"text/plain"}})}}function eu(e){return async(t)=>await Ca(t,e)??new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain"}})}function A(e,t){let r=e.searchParams.get("src");if(!r)return{ok:!1,error:"Missing required param: src",status:400};if(!r.startsWith("/"))return{ok:!1,error:"src must be an absolute URL path (start with /)",status:400};if(r.startsWith("//"))return{ok:!1,error:"src must be a local path",status:400};let h=g.extname(r).toLowerCase();if(!q.has(h))return{ok:!1,error:`Unsupported source extension: ${h}`,status:400};let a=g.resolve(t.publicDir),n=g.resolve(a,r.slice(1));if(!n.startsWith(`${a}${g.sep}`)&&n!==a)return{ok:!1,error:"src is outside publicDir",status:400};let d=t.maxWidth??k,l=t.maxHeight??k,i=e.searchParams.get("w"),s=e.searchParams.get("h"),u=i?Number.parseInt(i,10):0,c=s?Number.parseInt(s,10):0;if(i&&(!Number.isFinite(u)||u<=0))return{ok:!1,error:"Invalid w (must be positive integer)",status:400};if(s&&(!Number.isFinite(c)||c<=0))return{ok:!1,error:"Invalid h (must be positive integer)",status:400};if(!i&&!s)return{ok:!1,error:"At least one of w or h is required",status:400};let m=Math.min(u||d,d),w=Math.min(c||l,l),b=e.searchParams.get("f")||"webp";if(!S.has(b))return{ok:!1,error:`Invalid f (must be one of: ${[...S].join(", ")})`,status:400};let I=b,f=e.searchParams.get("q"),o=f?Number.parseInt(f,10):t.defaultQuality??D;if(!Number.isFinite(o)||o<1||o>100)return{ok:!1,error:"Invalid q (must be 1-100)",status:400};let y=e.searchParams.get("fit")||t.defaultFit||U;if(!T.has(y))return{ok:!1,error:`Invalid fit (must be one of: ${[...T].join(", ")})`,status:400};return{ok:!0,srcFsPath:n,srcUrl:r,width:m,height:w,format:I,quality:o,fit:y}}async function L(){return await import("./chunk-0twkeh31.js")}
3
+ export{Ca,eu};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Vf,yc,Vh,bc,Uf,Wf,mn,dr,Uh,qf,Kf,Wh,x}from"./chunk-4ykgjewy.js";import"./chunk-2s7rmn9r.js";import"./chunk-2kfayg4t.js";import"./chunk-0fh47gp0.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{mn as buildCss,qf as extractClassNames,Wf as fingerprintConfig,Kf as generateCss,Uh as getCachedCSS,Vf as getCssServeAsset,x as injectCss,yc as loadCssEngine,bc as loadCssEngineConfig,dr as rebuildCss,Vh as resetCssCache,Uf as resolveUserCssConfig,Wh as withLinkedModuleBundles};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- var g=0;function p(){return`async-${++g}-${Date.now().toString(36)}`}function Im(e,t={},c){let o=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@error\s*([\s\S]*?)@endasync/gi,i=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@endasync/gi,n=e;return n=n.replace(o,(r,s,a,d)=>{let l=p(),y=u(s);return m(l,y,a.trim(),d.trim())}),n=n.replace(i,(r,s,a)=>{let d=p(),l=u(s);return m(d,l,a.trim(),'<div class="stx-async-error">Failed to load component</div>')}),n}function u(e){let t={component:"",timeout:30000,delay:200,suspensible:!0,retries:0},c=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,o;while((o=c.exec(e))!==null){let i=o[1],n=o[2]||o[3],r=o[4],s=o[5];switch(i){case"component":t.component=n||s||"";break;case"timeout":t.timeout=r?parseInt(r,10):30000;break;case"delay":t.delay=r?parseInt(r,10):200;break;case"suspensible":t.suspensible=s==="true";break;case"retries":t.retries=r?parseInt(r,10):0;break;case"loadingComponent":t.loadingComponent=n||s;break;case"errorComponent":t.errorComponent=n||s;break}}return t}function m(e,t,c,o){let{component:i,timeout:n,delay:r,suspensible:s,retries:a}=t;return`
2
+ var g=0;function p(){return`async-${++g}-${Date.now().toString(36)}`}function Mm(e,t={},c){let o=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@error\s*([\s\S]*?)@endasync/gi,i=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@endasync/gi,n=e;return n=n.replace(o,(r,s,a,d)=>{let l=p(),y=u(s);return m(l,y,a.trim(),d.trim())}),n=n.replace(i,(r,s,a)=>{let d=p(),l=u(s);return m(d,l,a.trim(),'<div class="stx-async-error">Failed to load component</div>')}),n}function u(e){let t={component:"",timeout:30000,delay:200,suspensible:!0,retries:0},c=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,o;while((o=c.exec(e))!==null){let i=o[1],n=o[2]||o[3],r=o[4],s=o[5];switch(i){case"component":t.component=n||s||"";break;case"timeout":t.timeout=r?parseInt(r,10):30000;break;case"delay":t.delay=r?parseInt(r,10):200;break;case"suspensible":t.suspensible=s==="true";break;case"retries":t.retries=r?parseInt(r,10):0;break;case"loadingComponent":t.loadingComponent=n||s;break;case"errorComponent":t.errorComponent=n||s;break}}return t}function m(e,t,c,o){let{component:i,timeout:n,delay:r,suspensible:s,retries:a}=t;return`
3
3
  <div class="stx-async-component" data-async-id="${e}" data-component="${i}" data-status="pending">
4
4
  <div class="stx-async-loading" data-async-loading="${e}">
5
5
  ${c}
@@ -226,7 +226,7 @@ catch (error) {
226
226
  loadComponent();
227
227
  })();
228
228
  </script>
229
- `}function Om(e){return{__asyncComponent:!0,...typeof e==="function"?{loader:e}:e}}function Nm(e){return typeof e==="object"&&e!==null&&"__asyncComponent"in e&&e.__asyncComponent===!0}function Mm(){return`
229
+ `}function Dm(e){return{__asyncComponent:!0,...typeof e==="function"?{loader:e}:e}}function Lm(e){return typeof e==="object"&&e!==null&&"__asyncComponent"in e&&e.__asyncComponent===!0}function jm(){return`
230
230
  /* STX Async Component Styles */
231
231
  .stx-async-component {
232
232
  position: relative;
@@ -300,7 +300,7 @@ catch (error) {
300
300
  background-size: 200% 100%;
301
301
  }
302
302
  }
303
- `}function Dm(){return`
303
+ `}function Bm(){return`
304
304
  // STX Async Component Runtime
305
305
  (function() {
306
306
  if (typeof window === 'undefined') return;
@@ -355,4 +355,4 @@ catch (error) {
355
355
  console.log('[stx] Async component runtime initialized');
356
356
  })();
357
357
  `}
358
- export{Im,Om,Nm,Mm,Dm};
358
+ export{Mm,Dm,Lm,jm,Bm};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{sg,si}from"./chunk-tnp2ta5q.js";export{sg as looksLikeGlob,si as resolveStxTargets};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Wi,qi,Ki,Gg,Xg,Jg,Ll,Yg,Zg}from"./chunk-6m6y9bbx.js";export{Wi as ImageProcessorCache,Ll as applyTransformations,Gg as clearImageCache,Yg as generateResponsiveVariants,Zg as generateSrcset,qi as getCachedImageResult,Jg as optimizeImage,Xg as processImage,Ki as setCachedImageResult};
@@ -0,0 +1,20 @@
1
+ // @bun
2
+ import{ar,Oe}from"./chunk-9zrvh3pz.js";import{q,S,Cr,Vs,T}from"./chunk-2kfayg4t.js";import{a,D}from"./chunk-4xanjv22.js";import{Fo}from"./chunk-n058hznh.js";import{at}from"./chunk-n3jw3xpj.js";import{l}from"./chunk-46pxmpeb.js";import{r,we}from"./chunk-x7redxyd.js";import d from"path";import j from"fs";import{AsyncLocalStorage as ot}from"async_hooks";import{randomUUID as bt}from"crypto";var $t=11;function J(t,e,n){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(d.basename(t))||Fo(t,e,n)}var lt=2;function Nf(t){let e=process.env.STX_BUNDLE_CACHE_DIR?.trim();return e?d.resolve(e):l(t,"bundle-cache")}function nt(t,e){let n=t;for(let i of wt(e))if(i!==d.sep)n=n.split(i).join("\x00root");return n}var st=new Map;function wt(t){let e=d.resolve(t),n=st.get(e);if(!n){let i=e;try{i=j.realpathSync(e)}catch{}n=[...new Set([e,i])].sort((c,p)=>p.length-c.length),st.set(e,n)}return n}function St(t,e){try{let n=j.statSync(t),i=d.resolve(e),c=t.startsWith(`${i}${d.sep}`);return{path:c?d.relative(i,t):t,...c?{inRoot:!0}:{},mtimeMs:n.mtimeMs,size:n.size,hash:Bun.hash(j.readFileSync(t)).toString(36)}}catch{return null}}function ct(t,e){return t.inRoot?d.join(d.resolve(e),t.path):t.path}function vt(t,e){for(let n of t){let i=ct(n,e);try{let c=j.statSync(i);if(c.size!==n.size)return!1;if(c.mtimeMs!==n.mtimeMs&&Bun.hash(j.readFileSync(i)).toString(36)!==n.hash)return!1}catch{return!1}}return!0}var ut=new Map,Bt=100;function Mf(t=process.env){let e=Number(t.STX_BUNDLE_CACHE_LIMIT);return Number.isFinite(e)&&e>=1?Math.floor(e):2000}var G=new Map;async function jt(t){let e=G.get(t)??0;if(e>0&&e<Bt){G.set(t,e+1);return}G.set(t,1);try{let n=(await j.promises.readdir(t)).filter((o)=>o.endsWith(".js")),i=Mf();if(n.length<=i)return;let p=(await Promise.all(n.map(async(o)=>{try{return{name:o,at:(await j.promises.stat(d.join(t,o))).mtimeMs}}catch{return null}}))).filter((o)=>o!==null);p.sort((o,b)=>b.at-o.at);for(let o of p.slice(i)){let b=o.name.slice(0,-3);await j.promises.rm(d.join(t,`${b}.js`),{force:!0}),await j.promises.rm(d.join(t,`${b}.deps.json`),{force:!0})}N("pruned bundle cache to",i,"entries")}catch{}}function xe(t){return ut.get(t)??[]}function Z(t,e){if(t)ut.set(t,e)}function Df(t=process.env){return t.STX_DEBUG==="true"||t.STX_DEBUG==="1"}function N(...t){if(Df())console.log("[stx:bundler]",...t)}var K=[];function pc(t,e,n){K.push({filePath:t||"<inline>",message:e,details:n})}function cn(){return K.slice()}function ln(){K.length=0}var Q;function Fh(t){Q=t}function fc(){if(Q)return Q;try{let t=D.strict;return typeof t==="object"&&t!==null?t.bundlerFallback??"warn":"warn"}catch{return"warn"}}var Y=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function un(t){let e=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,n;while((n=e.exec(t))!==null){let c=n[1];if(!Y.some((o)=>o.test(c)))return N("detected user import:",c),!0}let i=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((n=i.exec(t))!==null){let c=n[1];if(/\.css(?:\?.*)?$/.test(c))continue;if(!Y.some((o)=>o.test(c)))return N("detected side-effect import:",c),!0}return!1}var ir="stx-module:",Et=/\.(?:[cm]?[jt]sx?|json)$/i;function Lf(t,e){return d.relative(t,e).split(d.sep).join("/")}function jf(t,e){if(e.size===0)return t;return t.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(n,i,c,p)=>{let o=e.get(p);return o&&!p.startsWith(ir)?`${i}${c}${o}${c}`:n})}function Bf(t,e){let n=0,i=(p)=>{let o=`__stxMod${n++}`,b=JSON.stringify(p);return e.push(`var ${o} = globalThis.__stxModules && globalThis.__stxModules[${b}];`,`if (${o} === undefined) throw new Error("[stx] module " + ${JSON.stringify(b)} + " is not registered on this page (#1957)");`),o},c=(p,o)=>{for(let b of p.split(",")){let I=b.trim();if(!I)continue;let M=I.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!M)continue;let w=M[1].startsWith('"')?JSON.parse(M[1]):M[1],f=M[2]??w;e.push(`var ${f} = ${o}[${JSON.stringify(w)}];`)}};return t=t.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(p,o,b)=>{let I=b.slice(ir.length),M=i(I),w=o.trim(),f=w.match(/^([\w$]+)\s*(?:,\s*|$)/);if(f&&!w.startsWith("{")&&!w.startsWith("*"))e.push(`var ${f[1]} = ${M}.default;`),w=w.slice(f[0].length).trim();let v=w.match(/^\*\s*as\s+([\w$]+)$/);if(v)e.push(`var ${v[1]} = ${M};`);else if(w.startsWith("{"))c(w.replace(/^\{|\}$/g,""),M);return""}),t=t.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(p,o)=>(i(o.slice(ir.length)),"")),t}function rt(t){let e=[t,`${t}.ts`,`${t}.tsx`,`${t}.js`,`${t}.mjs`,`${t}.jsx`,d.join(t,"index.ts"),d.join(t,"index.tsx"),d.join(t,"index.js"),d.join(t,"index.mjs")];for(let n of e)try{if(j.existsSync(n)&&j.statSync(n,{throwIfNoEntry:!1})?.isFile())return n}catch{}return}var X=new ot;function ds(t,e){let n=new Bun.CryptoHasher("md5");for(let[i,c]of[...t].sort(([p],[o])=>p<o?-1:p>o?1:0))n.update(`${i}\x00${c}\x00`);return X.run({modules:t,key:n.digest("hex").slice(0,12)},e)}var dt=new ot;function Ff(t){return dt.run(!0,t)}function zf(){return dt.getStore()===!0}function gc(t){if(!zf())return;throw Error(`The client script of ${t} needs bundling, and it is being rendered inside a Bun.build loader, where Bun never finishes a second build. Make the page an entrypoint of the build (bun-plugin-stx renders entrypoints before the bundler starts), or render it once outside the build so its bundle is cached.`)}function dn(){return X.getStore()?.key??""}function pt(t,e,n,i,c,p,o=new Map,b,I,M){let w=new Map([[n,i],...M??[]]),f=(B)=>B!==void 0&&w.has(B),v=(B,s,u)=>{if(J(s,t,b))return null;if(!p||!f(B)||!Et.test(s))return null;try{if(!j.statSync(s,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}c.add(s);let E=`${ir}${Lf(process.cwd(),s)}`;return o.set(u,E),{path:E,external:!0}},y=(B,s)=>{let u=f(B)?e:d.dirname(B),E=d.resolve(u,s);return rt(E)??E};return{name:"stx-client-bundle",setup(B){if(B.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(s)=>({path:s.path,external:!0})),B.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(s)=>({path:s.path,external:!0})),B.onResolve({filter:/^\//},(s)=>{if(f(s.path))return{path:s.path};let u=rt(s.path);if(u){let E=v(s.importer,u,s.path);if(E)return E;if(!f(u))c.add(u);return{path:u}}return{path:s.path,external:!0}}),B.onResolve({filter:/^\.\.?\//},(s)=>{let u=y(s.importer,s.path),E=v(s.importer,u,s.path);if(E)return E;return c.add(u),{path:u}}),B.onResolve({filter:/^[@~]\//},(s)=>{let u=d.resolve(t,s.path.slice(2)),E=[u,`${u}.ts`,`${u}.tsx`,`${u}.js`,`${u}.mjs`,`${u}.jsx`,d.join(u,"index.ts"),d.join(u,"index.tsx"),d.join(u,"index.js"),d.join(u,"index.mjs")];for(let h of E)if(j.existsSync(h)&&j.statSync(h,{throwIfNoEntry:!1})?.isFile()){let C=v(s.importer,h,s.path);if(C)return C;return N(`resolved ${s.path[0]}/ import:`,s.path,"\u2192",h),c.add(h),{path:h}}return console.warn(`[stx:bundler] could not resolve ${s.path[0]}/ import:`,s.path),{path:u}}),p)B.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(s)=>{if(!f(s.importer))return;let u=`${ir}npm:${s.path}`;return o.set(s.path,u),{path:u,external:!0}});B.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(s)=>{if(w.has(s.path))return{contents:w.get(s.path),loader:"ts"};if(J(s.path,t,b))throw Error(`Server-only API source cannot be imported by a client script: ${s.path}`);let u=d.extname(s.path).toLowerCase(),E=u===".json"?"json":u===".tsx"?"tsx":u===".jsx"?"jsx":u===".ts"||u===".mts"||u===".cts"?"ts":"js";if(!f(s.path))c.add(s.path);let h=I?.get(s.path);if(h!==void 0)return{contents:h,loader:"js"};return{contents:j.readFileSync(s.path,"utf8"),loader:E}})}}}var H=new Map,z=S(64),it=Symbol.for("stx.client-bundle-build-queue");function Hf(t){let e=globalThis,i=(e[it]??Promise.resolve()).then(t,t);return e[it]=i.then(()=>{return},()=>{return}),i}async function pn(t,e,n={}){let i=n.projectRoot||process.cwd(),c=(await a(i)).serverApi,p=n.minify??!1,o=n.externalizeUserModules??!0,b=n.expose?.length?[...new Set(n.expose)].sort():void 0,I=n.cacheDir||Nf(i),M=X.getStore(),w=new Bun.CryptoHasher("md5");w.update(`${$t}\x00${at()}\x00${JSON.stringify(c??!1)}\x00${o?"registry":"inline"}\x00${b?b.join(","):"*"}\x00${p?"minified":"readable"}\x00${M?.key??""}\x00${nt(t,i)}\x00${nt(e,i)}`);let f=w.digest("hex").slice(0,12),v=d.join(I,`${f}.js`),y=z.get(v);if(y){if(Vs(y.files)&&y.files.every((h)=>!J(h.path,i,c))){N("memo hit:",f);let h=y.files.map((C)=>C.path);return Z(e,h),n.collectInputs?.push(...h),y.code}z.delete(v),N("memo invalidated by dep change:",f)}let B=d.join(I,`${f}.deps.json`),s=Bun.file(v);if(await s.exists()){let h=Bun.file(B),C=!1,k=null;if(await h.exists())try{let O=JSON.parse(await h.text());if(O.metadataVersion===lt&&Array.isArray(O.files)&&vt(O.files,i))k=Cr(O.files.map((g)=>ct(g,i))),C=k.length===O.files.length&&!k.some((g)=>J(g.path,i,c))}catch{C=!1}if(C){if(N("cache hit:",f),k)Z(e,k.map((U)=>U.path)),n.collectInputs?.push(...k.map((U)=>U.path));let O=await s.text(),g=new Date;if(j.promises.utimes(v,g,g).catch(()=>{}),k)z.set(v,{code:O,files:k});return O}N("cache invalidated by dep change:",f)}let u=H.get(f);if(u){let h=await u;if(n.collectInputs)n.collectInputs.push(...(z.get(v)?.files??[]).map((C)=>C.path));return h}gc(e);let E=Hf(()=>_t(t,e,{projectRoot:i,minify:p,cacheDir:I,hash:f,cachePath:v,depsPath:B,collectInputs:n.collectInputs,externalizeUserModules:o,serverApi:c,expose:b,throwOnFailure:n.throwOnFailure,substitutes:M?.modules}));H.set(f,E);try{return await E}finally{H.delete(f)}}function mc(t){return`${t}-${process.pid}-${bt()}`}async function zh(t,e){let{projectRoot:n}=e,i=mc(new Bun.CryptoHasher("md5").update([...t.keys()].join("\x00")).digest("hex").slice(0,12)),c=d.join(l(n,"bundle-tmp"),"out",i);j.mkdirSync(c,{recursive:!0});let p=new Map,o=new Map,b=0;for(let[f,v]of t){let y=d.join(n,`.stx-split-${i}-${b++}.ts`);p.set(y,v),o.set(d.basename(y).replace(/\.ts$/,""),f)}let[I,M]=[...p][0],w=new Set;gc(e.filePath);try{let f=await Bun.build({entrypoints:[...p.keys()],outdir:c,target:"browser",format:"esm",splitting:!0,minify:!1,naming:{entry:"[name].js",chunk:"chunk-[hash].js"},plugins:[pt(n,d.dirname(e.filePath),I,M,w,!1,new Map,void 0,X.getStore()?.modules,p)],define:{"process.env.NODE_ENV":'"development"',...T()},root:n});if(!f.success)throw Error(f.logs.filter((y)=>y.level==="error").map((y)=>y.message).join(", ")||"Unable to bundle the entries");let v={entries:new Map,chunks:new Map};for(let y of f.outputs){let B=d.basename(y.path);if(y.kind==="entry-point"){let s=o.get(B.replace(/\.js$/,""));if(s!==void 0)v.entries.set(s,await y.text())}else if(y.kind==="chunk")v.chunks.set(B.replace(/\.js$/,""),await y.text())}return e.collectInputs?.push(...w),v}finally{try{j.rmSync(c,{recursive:!0,force:!0})}catch{}}}async function _t(t,e,n){let{projectRoot:i,minify:c,cacheDir:p,hash:o,cachePath:b,depsPath:I,externalizeUserModules:M}=n,w=l(i,"bundle-tmp"),f=mc(o),v=d.join(i,`.stx-client-${f}.ts`),y=d.join(w,"out",f);j.mkdirSync(y,{recursive:!0});let B=d.dirname(e),s=new Set,u=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,E=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,h=r(t),{depths:C,balanced:k}=we(h),O=(R)=>!k||C[R]===0,g;while((g=u.exec(h))!==null){if(g[1])continue;if(!O(g.index))continue;if(g[2])g[2].split(",").forEach((R)=>{let m=Mt(R);if(m)s.add(m)});else if(g[3])s.add(g[3])}while((g=E.exec(h))!==null){if(g[1])continue;if(!O(g.index))continue;s.add(g[2])}let U=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((g=U.exec(h))!==null){if(!O(g.index))continue;let R=/^\s*['"]([^'"]+)['"]/.exec(t.slice(g.index+g[0].length))?.[1];if(R&&Y.some((m)=>m.test(R)))continue;if(g[1])s.add(g[1]);if(g[2])s.add(g[2]);for(let m of(g[3]??"").split(",")){let _=m.trim();if(!_||/^type\s/.test(_))continue;let L=/\bas\s+(\w+)\s*$/.exec(_)?.[1]??/^\w+$/.exec(_)?.[0];if(L)s.add(L)}}for(let R of h.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let m of R[1].split(",")){let _=/\bas\s+(\w+)\s*$/.exec(m)?.[1]??/^\s*(\w+)\s*$/.exec(m)?.[1];if(_)s.delete(_)}let ft=s.size>0?`
3
+ export { ${[...s].join(", ")} }`:"";N("bundling:",o,"from:",d.basename(e));let tt=new Set,et=new Map;try{let R=await Bun.build({entrypoints:[v],outdir:y,target:"browser",format:"esm",minify:c?{whitespace:!1,identifiers:!0,syntax:!0}:!1,plugins:[pt(i,B,v,t+ft,tt,M,et,n.serverApi,n.substitutes)],define:{"process.env.NODE_ENV":c?'"production"':'"development"',...T()},root:i});if(!R.success){let F=R.logs.filter((A)=>A.level==="error").map((A)=>A.message).join(", ")||`Unable to bundle ${d.basename(e)}`,P=ar(R.logs,e||void 0);if(console.warn("[stx:bundler] build failed:",F),pc(e||"",F,P),n.throwOnFailure||fc()==="error")throw Error(F);return t}let m="";for(let x of R.outputs){m=await x.text();break}let _=[];for(let x of m.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let F of x[1].split(",")){let P=F.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(P){_.push([P[2],P[1]]);continue}let A=F.trim();if(/^[A-Za-z_$][\w$]*$/.test(A))_.push([A,A])}if(n.expose){let x=new Set(n.expose);for(let F=_.length-1;F>=0;F--)if(!x.has(_[F][0]))_.splice(F,1)}let L=[];m=Bf(jf(m,et),L);let mt=m.match(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm)||[];if(m=m.replace(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),c&&m)try{m=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(m)}catch{}let V=`__stxBundle_${o}`,gt=new Set(q(t,!0).split(",").map((x)=>x.trim())),ht=_.map(([x,F])=>`get ${JSON.stringify(x)}() { return ${F} }${gt.has(x)?`, set ${JSON.stringify(x)}(__stxValue_${F}) { ${F} = __stxValue_${F} }`:""}`).join(", "),xt=_.map(([x])=>`var ${x} = undefined;`).join(`
4
+ `),yt=_.map(([x])=>`${x} = ${V}[${JSON.stringify(x)}];`).join(`
5
+ `);if(m=`${mt.join(`
6
+ `)}
7
+ ${xt}
8
+ var ${V} = (function() {
9
+ ${L.join(`
10
+ `)}
11
+ ${m}
12
+ return { ${ht} };
13
+ })();
14
+ ${yt}
15
+ var __stxLiveBindings = typeof __stxLiveBindings === 'undefined' ? {} : __stxLiveBindings;
16
+ Object.keys(${V}).forEach(function(name) {
17
+ if (!Object.prototype.hasOwnProperty.call(__stxLiveBindings, name))
18
+ Object.defineProperty(__stxLiveBindings, name, Object.getOwnPropertyDescriptor(${V}, name));
19
+ });`.trim(),N("bundled:",o,"output:",m.length,"bytes"),s.size>0&&_.length===0)return console.warn(`[stx:bundler] dropped every binding for ${d.basename(e)} (${o}); serving the unbundled source and not caching this result`),t;j.mkdirSync(p,{recursive:!0}),await Bun.write(b,m);let W=Cr(tt);return await Bun.write(I,JSON.stringify({metadataVersion:lt,files:W.map((x)=>St(x.path,i)).filter((x)=>x!==null)})),Z(e,W.map((x)=>x.path)),n.collectInputs?.push(...W.map((x)=>x.path)),z.set(b,{code:m,files:W}),await jt(p),m}catch(R){let m=ar(R,e||void 0),_=Oe(R,e||void 0);if(console.warn(`[stx:bundler] error: ${_}`),pc(e||"",_,m),n.throwOnFailure||fc()==="error")throw R;return t}finally{try{j.rmSync(y,{recursive:!0,force:!0})}catch{}}}function Mt(t){let e=t.trim();if(!e)return null;let n=e.indexOf("=");if(n!==-1)e=e.slice(0,n).trim();let i=e.indexOf(":");if(i!==-1)e=e.slice(i+1).trim();if(e.startsWith("..."))e=e.slice(3).trim();return/^[A-Za-z_$][\w$]*$/.test(e)?e:null}
20
+ export{Nf,Mf,xe,Df,pc,cn,ln,Fh,fc,un,ir,Lf,jf,Bf,ds,Ff,zf,gc,dn,Hf,pn,mc,zh};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- function ka(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="id",dynamicHeight:d=!1,estimatedItemHeight:g=l,direction:x="vertical"}=c,e=[...v],t=0,n=new Map;function f(){if(d)return h();let i=Math.max(0,Math.floor(t/l)-s),r=Math.ceil(u/l),m=Math.min(e.length-1,i+r+s*2);return{startIndex:i,endIndex:m}}function h(){let i=0,r=0,m=e.length-1;for(let p=0;p<e.length;p++){let M=n.get(p)||g;if(i+M>t){r=Math.max(0,p-s);break}i+=M}i=0;for(let p=0;p<e.length;p++){let M=n.get(p)||g;if(i+=M,i>t+u){m=Math.min(e.length-1,p+s);break}}return{startIndex:r,endIndex:m}}function w(){if(d){let i=0;for(let r=0;r<e.length;r++)i+=n.get(r)||g;return i}return e.length*l}function y(i){if(d){let r=0;for(let m=0;m<i;m++)r+=n.get(m)||g;return r}return i*l}function S(){let{startIndex:i,endIndex:r}=f();return{startIndex:i,endIndex:r,scrollTop:t,totalHeight:w(),visibleItems:e.slice(i,r+1),itemHeights:new Map(n)}}function L(i,r="auto"){let m=y(i);a(m,r)}function a(i,r="auto"){t=Math.max(0,Math.min(i,w()-u))}function o(){f()}function H(i){e=[...i],n.clear(),o()}function I(){e=[],n.clear()}return{scrollToIndex:L,scrollToOffset:a,getState:S,refresh:o,setItems:H,destroy:I}}function _a(v,c={},l){let u=/@virtualList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@endvirtualList/gi;return v.replace(u,(s,b,d,g)=>{let x=b.trim(),e=c[x];if(!e||!Array.isArray(e))return`<!-- virtualList: items "${x}" not found or not an array -->`;let t={itemHeight:50,containerHeight:400,overscan:3};if(d)try{let a=d.trim(),o=Function(`return ${a}`)();t={...t,...o}}catch{}let n=`vlist-${Math.random().toString(36).substring(2,9)}`,f=Math.ceil(t.containerHeight/t.itemHeight),h=t.overscan||3,w=0,y=Math.min(e.length-1,f+h),S="";for(let a=w;a<=y&&a<e.length;a++){let o=e[a],H=g.replace(/\{\{\s*item\s*\}\}/g,typeof o==="object"?JSON.stringify(o):String(o)).replace(/\{\{\s*item\.(\w+)\s*\}\}/g,(I,i)=>{if(typeof o==="object"&&o!==null)return String(o[i]??"");return""}).replace(/\{\{\s*index\s*\}\}/g,String(a));S+=`
2
+ function Ta(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="id",dynamicHeight:d=!1,estimatedItemHeight:g=l,direction:x="vertical"}=c,e=[...v],t=0,n=new Map;function f(){if(d)return h();let i=Math.max(0,Math.floor(t/l)-s),r=Math.ceil(u/l),m=Math.min(e.length-1,i+r+s*2);return{startIndex:i,endIndex:m}}function h(){let i=0,r=0,m=e.length-1;for(let p=0;p<e.length;p++){let M=n.get(p)||g;if(i+M>t){r=Math.max(0,p-s);break}i+=M}i=0;for(let p=0;p<e.length;p++){let M=n.get(p)||g;if(i+=M,i>t+u){m=Math.min(e.length-1,p+s);break}}return{startIndex:r,endIndex:m}}function w(){if(d){let i=0;for(let r=0;r<e.length;r++)i+=n.get(r)||g;return i}return e.length*l}function y(i){if(d){let r=0;for(let m=0;m<i;m++)r+=n.get(m)||g;return r}return i*l}function S(){let{startIndex:i,endIndex:r}=f();return{startIndex:i,endIndex:r,scrollTop:t,totalHeight:w(),visibleItems:e.slice(i,r+1),itemHeights:new Map(n)}}function L(i,r="auto"){let m=y(i);a(m,r)}function a(i,r="auto"){t=Math.max(0,Math.min(i,w()-u))}function o(){f()}function H(i){e=[...i],n.clear(),o()}function I(){e=[],n.clear()}return{scrollToIndex:L,scrollToOffset:a,getState:S,refresh:o,setItems:H,destroy:I}}function $a(v,c={},l){let u=/@virtualList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@endvirtualList/gi;return v.replace(u,(s,b,d,g)=>{let x=b.trim(),e=c[x];if(!e||!Array.isArray(e))return`<!-- virtualList: items "${x}" not found or not an array -->`;let t={itemHeight:50,containerHeight:400,overscan:3};if(d)try{let a=d.trim(),o=Function(`return ${a}`)();t={...t,...o}}catch{}let n=`vlist-${Math.random().toString(36).substring(2,9)}`,f=Math.ceil(t.containerHeight/t.itemHeight),h=t.overscan||3,w=0,y=Math.min(e.length-1,f+h),S="";for(let a=w;a<=y&&a<e.length;a++){let o=e[a],H=g.replace(/\{\{\s*item\s*\}\}/g,typeof o==="object"?JSON.stringify(o):String(o)).replace(/\{\{\s*item\.(\w+)\s*\}\}/g,(I,i)=>{if(typeof o==="object"&&o!==null)return String(o[i]??"");return""}).replace(/\{\{\s*index\s*\}\}/g,String(a));S+=`
3
3
  <div class="virtual-item ${t.itemClass||""}"
4
4
  style="position: absolute; top: ${a*t.itemHeight}px; height: ${t.itemHeight}px; width: 100%;"
5
5
  data-index="${a}">
@@ -76,7 +76,7 @@ function ka(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
76
76
  };
77
77
  })();
78
78
  </script>
79
- `})}function ru(){return`
79
+ `})}function iu(){return`
80
80
  .virtual-list-container {
81
81
  position: relative;
82
82
  overflow-y: auto;
@@ -124,7 +124,7 @@ function ka(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
124
124
  0% { background-position: 200% 0; }
125
125
  100% { background-position: -200% 0; }
126
126
  }
127
- `}function su(v,c){let l=null,u=()=>{if(!l)l=ka(v(),c);return l};return{visibleItems:()=>u().getState().visibleItems,totalHeight:()=>u().getState().totalHeight,containerProps:()=>({style:{height:`${c.containerHeight}px`,overflow:"auto",position:"relative"},onScroll:(s)=>{let b=s.target;if(l)l.scrollToOffset(b.scrollTop)}}),itemProps:(s)=>({style:{position:"absolute",top:`${s*c.itemHeight}px`,height:`${c.itemHeight}px`,width:"100%"},"data-index":s}),scrollToIndex:(s)=>{u().scrollToIndex(s)}}}function ou(v,c={},l){let u=/@infiniteList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@loading\s*([\s\S]*?)@endinfiniteList/gi;return v.replace(u,(s,b,d,g,x)=>{let e=b.trim(),t=c[e];if(!t||!Array.isArray(t))return`<!-- infiniteList: items "${e}" not found or not an array -->`;let n={itemHeight:50,containerHeight:400,overscan:3,threshold:100,hasMore:!0};if(d)try{let w=Function(`return ${d.trim()}`)();n={...n,...w}}catch{}let f=`ilist-${Math.random().toString(36).substring(2,9)}`,h=_a(`@virtualList(${e}, ${JSON.stringify({itemHeight:n.itemHeight,containerHeight:n.containerHeight,overscan:n.overscan,containerClass:n.containerClass})})${g}@endvirtualList`,c);return h=h.replace("</script>",`
127
+ `}function au(v,c){let l=null,u=()=>{if(!l)l=Ta(v(),c);return l};return{visibleItems:()=>u().getState().visibleItems,totalHeight:()=>u().getState().totalHeight,containerProps:()=>({style:{height:`${c.containerHeight}px`,overflow:"auto",position:"relative"},onScroll:(s)=>{let b=s.target;if(l)l.scrollToOffset(b.scrollTop)}}),itemProps:(s)=>({style:{position:"absolute",top:`${s*c.itemHeight}px`,height:`${c.itemHeight}px`,width:"100%"},"data-index":s}),scrollToIndex:(s)=>{u().scrollToIndex(s)}}}function cu(v,c={},l){let u=/@infiniteList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@loading\s*([\s\S]*?)@endinfiniteList/gi;return v.replace(u,(s,b,d,g,x)=>{let e=b.trim(),t=c[e];if(!t||!Array.isArray(t))return`<!-- infiniteList: items "${e}" not found or not an array -->`;let n={itemHeight:50,containerHeight:400,overscan:3,threshold:100,hasMore:!0};if(d)try{let w=Function(`return ${d.trim()}`)();n={...n,...w}}catch{}let f=`ilist-${Math.random().toString(36).substring(2,9)}`,h=$a(`@virtualList(${e}, ${JSON.stringify({itemHeight:n.itemHeight,containerHeight:n.containerHeight,overscan:n.overscan,containerClass:n.containerClass})})${g}@endvirtualList`,c);return h=h.replace("</script>",`
128
128
  // Infinite scroll detection
129
129
  container.addEventListener('scroll', function() {
130
130
  const scrollBottom = container.scrollTop + container.clientHeight;
@@ -142,7 +142,7 @@ function ka(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
142
142
  ${x}
143
143
  </div>
144
144
  </div>
145
- `})}function iu(v,c={},l){let u=/@virtualGrid\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@endvirtualGrid/gi;return v.replace(u,(s,b,d,g)=>{let x=b.trim(),e=c[x];if(!e||!Array.isArray(e))return`<!-- virtualGrid: items "${x}" not found or not an array -->`;let t={columns:3,rowHeight:100,containerHeight:400,gap:10,overscan:2};if(d)try{let o=Function(`return ${d.trim()}`)();t={...t,...o}}catch{}let n=`vgrid-${Math.random().toString(36).substring(2,9)}`,f=Math.ceil(e.length/t.columns),h=f*(t.rowHeight+(t.gap||0)),w=Math.ceil(t.containerHeight/(t.rowHeight+(t.gap||0))),y=t.overscan||2,S=0,L=Math.min(f-1,w+y),a="";for(let o=S;o<=L;o++)for(let H=0;H<t.columns;H++){let I=o*t.columns+H;if(I>=e.length)break;let i=e[I],r=H*(100/t.columns),m=o*(t.rowHeight+(t.gap||0)),p=g.replace(/\{\{\s*item\s*\}\}/g,typeof i==="object"?JSON.stringify(i):String(i)).replace(/\{\{\s*item\.(\w+)\s*\}\}/g,(M,T)=>{if(typeof i==="object"&&i!==null)return String(i[T]??"");return""}).replace(/\{\{\s*index\s*\}\}/g,String(I));a+=`
145
+ `})}function lu(v,c={},l){let u=/@virtualGrid\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@endvirtualGrid/gi;return v.replace(u,(s,b,d,g)=>{let x=b.trim(),e=c[x];if(!e||!Array.isArray(e))return`<!-- virtualGrid: items "${x}" not found or not an array -->`;let t={columns:3,rowHeight:100,containerHeight:400,gap:10,overscan:2};if(d)try{let o=Function(`return ${d.trim()}`)();t={...t,...o}}catch{}let n=`vgrid-${Math.random().toString(36).substring(2,9)}`,f=Math.ceil(e.length/t.columns),h=f*(t.rowHeight+(t.gap||0)),w=Math.ceil(t.containerHeight/(t.rowHeight+(t.gap||0))),y=t.overscan||2,S=0,L=Math.min(f-1,w+y),a="";for(let o=S;o<=L;o++)for(let H=0;H<t.columns;H++){let I=o*t.columns+H;if(I>=e.length)break;let i=e[I],r=H*(100/t.columns),m=o*(t.rowHeight+(t.gap||0)),p=g.replace(/\{\{\s*item\s*\}\}/g,typeof i==="object"?JSON.stringify(i):String(i)).replace(/\{\{\s*item\.(\w+)\s*\}\}/g,(M,T)=>{if(typeof i==="object"&&i!==null)return String(i[T]??"");return""}).replace(/\{\{\s*index\s*\}\}/g,String(I));a+=`
146
146
  <div class="virtual-grid-item"
147
147
  style="position: absolute; top: ${m}px; left: ${r}%; width: calc(${100/t.columns}% - ${t.gap||0}px); height: ${t.rowHeight}px;"
148
148
  data-index="${I}">
@@ -212,5 +212,5 @@ function ka(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
212
212
  });
213
213
  })();
214
214
  </script>
215
- `})}var Um={createVirtualList:ka,processVirtualListDirectives:_a,processInfiniteListDirectives:ou,processVirtualGridDirectives:iu,generateVirtualListCSS:ru,useVirtualList:su};
216
- export{ka,_a,ru,su,ou,iu,Um};
215
+ `})}var Km={createVirtualList:Ta,processVirtualListDirectives:$a,processInfiniteListDirectives:cu,processVirtualGridDirectives:lu,generateVirtualListCSS:iu,useVirtualList:au};
216
+ export{Ta,$a,iu,au,cu,lu,Km};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{um}from"./chunk-s0sad753.js";import"./chunk-4xanjv22.js";import"./chunk-adb045wf.js";import"./chunk-tnp2ta5q.js";import"./chunk-669b2bya.js";import"./chunk-mfa07erx.js";import"./chunk-x512h2gv.js";import"./chunk-2kfayg4t.js";import"./chunk-0fh47gp0.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{um as buildApp};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- function xc(){return`
2
+ function _c(){return`
3
3
  (function(){
4
4
  var tip=null,hideTimer=null,currentEl=null;
5
5
 
@@ -103,4 +103,4 @@ document.addEventListener("focusout",function(e){
103
103
  });
104
104
  })();
105
105
  `}
106
- export{xc};
106
+ export{_c};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{fn,Lo,jo,Bo,Hh,Fo}from"./chunk-n058hznh.js";import"./chunk-669b2bya.js";import"./chunk-x512h2gv.js";import"./chunk-k32q90b2.js";export{jo as buildServerApi,Hh as createServerApi,fn as discoverServerApi,Lo as generateApiTypes,Fo as isServerApiSource,Bo as productionApiDispatcher};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- var c=0;function l(){return`suspense-${++c}-${Date.now().toString(36)}`}function fh(s,n={},t){let e=/@suspense(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@fallback\s*([\s\S]*?)@endsuspense/gi;return s.replace(e,(r,i,o,d)=>{let u=l(),a=p(i||"");return f(u,o.trim(),d.trim(),a)})}function p(s){let n={},t=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,e;while((e=t.exec(s))!==null){let r=e[1],i=e[2]||e[3],o=e[4];switch(r){case"id":n.id=i;break;case"timeout":n.timeout=o?parseInt(o,10):void 0;break}}return n}function f(s,n,t,e){let r=e.timeout||30000,i=e.id||s;return`
2
+ var c=0;function l(){return`suspense-${++c}-${Date.now().toString(36)}`}function hh(s,n={},t){let e=/@suspense(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@fallback\s*([\s\S]*?)@endsuspense/gi;return s.replace(e,(r,i,o,d)=>{let u=l(),a=p(i||"");return f(u,o.trim(),d.trim(),a)})}function p(s){let n={},t=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,e;while((e=t.exec(s))!==null){let r=e[1],i=e[2]||e[3],o=e[4];switch(r){case"id":n.id=i;break;case"timeout":n.timeout=o?parseInt(o,10):void 0;break}}return n}function f(s,n,t,e){let r=e.timeout||30000,i=e.id||s;return`
3
3
  <div class="stx-suspense" data-suspense-id="${s}" data-custom-id="${i}" data-status="pending">
4
4
  <div class="stx-suspense-fallback" data-suspense-fallback="${s}">
5
5
  ${t}
@@ -189,7 +189,7 @@ else {
189
189
  }, 0);
190
190
  })();
191
191
  </script>
192
- `}function gh(s,n,t){return{id:s,fallback:t,content:n}}async function mh(s){let n=s.map((e)=>`
192
+ `}function yh(s,n,t){return{id:s,fallback:t,content:n}}async function bh(s){let n=s.map((e)=>`
193
193
  <div id="stx-ssr-suspense-${e.id}" class="stx-ssr-suspense">
194
194
  ${e.fallback}
195
195
  </div>
@@ -214,7 +214,7 @@ else {
214
214
  }
215
215
  })();
216
216
  </script>
217
- `}}return{initial:n,streaming:t()}}function hh(){return`
217
+ `}}return{initial:n,streaming:t()}}function wh(){return`
218
218
  /* STX Suspense Styles */
219
219
  .stx-suspense {
220
220
  position: relative;
@@ -270,7 +270,7 @@ else {
270
270
  background-size: 200% 100%;
271
271
  }
272
272
  }
273
- `}function yh(){return`
273
+ `}function vh(){return`
274
274
  // STX Suspense Runtime
275
275
  (function() {
276
276
  if (typeof window === 'undefined') return;
@@ -338,4 +338,4 @@ else {
338
338
  console.log('[stx] Suspense runtime initialized');
339
339
  })();
340
340
  `}
341
- export{fh,gh,mh,hh,yh};
341
+ export{hh,yh,bh,wh,vh};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{hh,yh,bh,wh,vh}from"./chunk-j1efsjsb.js";export{yh as createSSRSuspense,wh as generateSuspenseCSS,vh as generateSuspenseRuntime,hh as processSuspenseDirectives,bh as renderSSRSuspense};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Jh,Yh,Xf,bs}from"./chunk-srgpz94e.js";import"./chunk-24hq8mka.js";import"./chunk-xymr4ys9.js";import"./chunk-zsnmk5me.js";import{Ar}from"./chunk-2kfayg4t.js";import"./chunk-0fh47gp0.js";import"./chunk-k32q90b2.js";import{ut}from"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{ut as freeIdentifiers,bs as processComponents,Xf as processESImports,Ar as rendersAsElement,Jh as resetMarginStackWarnings,Yh as resetTemplateLoopWarnings};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{lm}from"./chunk-2jgtfjyr.js";import"./chunk-321fbxnm.js";import"./chunk-4ykgjewy.js";import"./chunk-2dpessnc.js";import"./chunk-q1wxgw5s.js";import"./chunk-srgpz94e.js";import"./chunk-24hq8mka.js";import"./chunk-dhnw2qwq.js";import"./chunk-xymr4ys9.js";import"./chunk-fnxg6134.js";import"./chunk-0c9c9v03.js";import"./chunk-zsnmk5me.js";import"./chunk-2s7rmn9r.js";import"./chunk-4xanjv22.js";import"./chunk-adb045wf.js";import"./chunk-tnp2ta5q.js";import"./chunk-669b2bya.js";import"./chunk-mfa07erx.js";import"./chunk-x512h2gv.js";import"./chunk-2kfayg4t.js";import"./chunk-0fh47gp0.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{lm as startInteractive};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{AsyncLocalStorage as R}from"async_hooks";var b=Symbol.for("stx.runtime-config.scope"),y=globalThis,m=y[b]??=new R;function Ve(n,f){return m.run(n,f)}function Cn(){return m.getStore()}function Xs(){let n=m.getStore();if(!n)throw Error("useServerRuntimeConfig requires a server request or template render");return Object.freeze(Object.defineProperty({public:n.public},"private",{value:n.private}))}function Ri(){return Xs().public}function M(n={},f=process.env){let s=new Set;function o(e,i){if(i===null)return e===null;if(Array.isArray(i))return Array.isArray(e)&&(!i.length||e.every((r)=>i.some((u)=>o(r,u))));if(typeof i==="object")return e!==null&&typeof e==="object"&&!Array.isArray(e)&&Object.entries(i).every(([r,u])=>Object.hasOwn(e,r)&&o(e[r],u));return typeof e===typeof i}function g(e,i){if(e&&typeof e==="object"&&!Array.isArray(e)){if(Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`);let t=Object.create(null);for(let[c,l]of Object.entries(e)){if(!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(c)||["constructor","prototype","__proto__"].includes(c))throw TypeError(`Invalid runtime config key: ${c}`);t[c]=g(l,[...i,c])}return Object.freeze(t)}let r=`STX_RUNTIME_${i.map((t)=>t.replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()).join("__")}`;if(s.has(r))throw TypeError(`Ambiguous runtime config environment key: ${r}`);s.add(r);let u=f[r],a=e;if(u!==void 0){try{a=typeof e==="string"?u:JSON.parse(u)}catch{throw TypeError(`Invalid runtime config override: ${r}`)}if(!o(a,e))throw TypeError(`Wrong runtime config override type: ${r}`)}function p(t){if(t===null||typeof t==="string"||typeof t==="boolean")return t;if(typeof t==="number"&&Number.isFinite(t))return t;if(Array.isArray(t))return Object.freeze(t.map(p));if(t&&typeof t==="object"&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null))return Object.freeze(Object.fromEntries(Object.entries(t).map(([c,l])=>[c,p(l)])));throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`)}return p(a)}return Object.freeze({public:g(n.public??{},["public"]),private:g(n.private??{},["private"])})}function C(n){return`<script data-stx-scoped data-stx-runtime-config type="application/json">${JSON.stringify(n.public).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function Bt(n,f){let s=n.replace(/<script\b[^>]*\bdata-stx-runtime-config\b[^>]*>[\s\S]*?<\/script>/gi,""),o=/<head\b[^>]*>/i.exec(s),g=o?o.index+o[0].length:0;return s.slice(0,g)+C(f)+s.slice(g)}
3
- export{Ve,Cn,Xs,Ri,M,Bt};
2
+ import{AsyncLocalStorage as R}from"async_hooks";var b=Symbol.for("stx.runtime-config.scope"),y=globalThis,m=y[b]??=new R;function qe(n,f){return m.run(n,f)}function $n(){return m.getStore()}function Zs(){let n=m.getStore();if(!n)throw Error("useServerRuntimeConfig requires a server request or template render");return Object.freeze(Object.defineProperty({public:n.public},"private",{value:n.private}))}function Ii(){return Zs().public}function j(n={},f=process.env){let s=new Set;function o(e,i){if(i===null)return e===null;if(Array.isArray(i))return Array.isArray(e)&&(!i.length||e.every((r)=>i.some((u)=>o(r,u))));if(typeof i==="object")return e!==null&&typeof e==="object"&&!Array.isArray(e)&&Object.entries(i).every(([r,u])=>Object.hasOwn(e,r)&&o(e[r],u));return typeof e===typeof i}function g(e,i){if(e&&typeof e==="object"&&!Array.isArray(e)){if(Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`);let t=Object.create(null);for(let[c,l]of Object.entries(e)){if(!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(c)||["constructor","prototype","__proto__"].includes(c))throw TypeError(`Invalid runtime config key: ${c}`);t[c]=g(l,[...i,c])}return Object.freeze(t)}let r=`STX_RUNTIME_${i.map((t)=>t.replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()).join("__")}`;if(s.has(r))throw TypeError(`Ambiguous runtime config environment key: ${r}`);s.add(r);let u=f[r],a=e;if(u!==void 0){try{a=typeof e==="string"?u:JSON.parse(u)}catch{throw TypeError(`Invalid runtime config override: ${r}`)}if(!o(a,e))throw TypeError(`Wrong runtime config override type: ${r}`)}function p(t){if(t===null||typeof t==="string"||typeof t==="boolean")return t;if(typeof t==="number"&&Number.isFinite(t))return t;if(Array.isArray(t))return Object.freeze(t.map(p));if(t&&typeof t==="object"&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null))return Object.freeze(Object.fromEntries(Object.entries(t).map(([c,l])=>[c,p(l)])));throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`)}return p(a)}return Object.freeze({public:g(n.public??{},["public"]),private:g(n.private??{},["private"])})}function C(n){return`<script data-stx-scoped data-stx-runtime-config type="application/json">${JSON.stringify(n.public).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function Ht(n,f){let s=n.replace(/<script\b[^>]*\bdata-stx-runtime-config\b[^>]*>[\s\S]*?<\/script>/gi,""),o=/<head\b[^>]*>/i.exec(s),g=o?o.index+o[0].length:0;return s.slice(0,g)+C(f)+s.slice(g)}
3
+ export{qe,$n,Zs,Ii,j,Ht};