@stacksjs/stx 0.2.94 → 0.2.95

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 (551) hide show
  1. package/dist/a11y.js +1 -1
  2. package/dist/analytics.js +1 -1
  3. package/dist/analyzer.js +1 -1
  4. package/dist/animation.js +1 -1
  5. package/dist/app-shell.js +1 -1
  6. package/dist/app.js +1 -1
  7. package/dist/assets.js +1 -1
  8. package/dist/ast.js +1 -1
  9. package/dist/async-components.js +1 -1
  10. package/dist/auth.js +1 -1
  11. package/dist/broadcasting.js +1 -1
  12. package/dist/browser-composables.js +1 -1
  13. package/dist/build-assets.js +1 -1
  14. package/dist/build-mode-detector.js +1 -1
  15. package/dist/build-optimizer.js +1 -1
  16. package/dist/build-views.js +1 -1
  17. package/dist/build.js +1 -1
  18. package/dist/builtins/drawer.js +1 -1
  19. package/dist/builtins/escape.js +1 -1
  20. package/dist/builtins/icon.js +1 -1
  21. package/dist/builtins/index.js +1 -1
  22. package/dist/builtins/modal.js +1 -1
  23. package/dist/builtins/safe-image.js +1 -1
  24. package/dist/builtins/stx-image.js +1 -1
  25. package/dist/builtins/stx-link.js +1 -1
  26. package/dist/builtins/stx-loading-indicator.js +1 -1
  27. package/dist/builtins/suspense.js +1 -1
  28. package/dist/builtins/toast.js +1 -1
  29. package/dist/builtins/tooltip.js +1 -1
  30. package/dist/builtins/transition-group.js +1 -1
  31. package/dist/bundle-analyzer/collector.js +1 -1
  32. package/dist/bundle-analyzer/index.js +1 -1
  33. package/dist/bundle-analyzer/report.js +1 -1
  34. package/dist/bundle-analyzer/treemap.js +1 -1
  35. package/dist/caching.js +1 -1
  36. package/dist/{chunk-eh8hact1.js → chunk-04n64bnt.js} +1 -1
  37. package/dist/{chunk-yexjrg9d.js → chunk-06w68hyg.js} +2 -2
  38. package/dist/{chunk-4j188175.js → chunk-07y6m5xx.js} +1 -1
  39. package/dist/{chunk-b3kkjcdh.js → chunk-09k66d8a.js} +1 -1
  40. package/dist/{chunk-bk8ew8ze.js → chunk-0a61y94n.js} +2 -2
  41. package/dist/{chunk-qdc3aav1.js → chunk-0dx4q6yq.js} +1 -1
  42. package/dist/{chunk-k8440jxh.js → chunk-0p0nyq50.js} +2 -2
  43. package/dist/{chunk-5qb761h2.js → chunk-0p1h3p3w.js} +1 -1
  44. package/dist/{chunk-znxp3zha.js → chunk-10debkj5.js} +1 -1
  45. package/dist/{chunk-bgec9r1v.js → chunk-15nesxgt.js} +2 -2
  46. package/dist/{chunk-mv03qb75.js → chunk-1sr54zp8.js} +1 -1
  47. package/dist/{chunk-0jkwrcwj.js → chunk-1v49fwr5.js} +1 -1
  48. package/dist/{chunk-w01y57f5.js → chunk-1xz0w746.js} +2 -2
  49. package/dist/{chunk-w4n8fqp7.js → chunk-20swzkx3.js} +1 -1
  50. package/dist/{chunk-cz25azze.js → chunk-27zsyhrd.js} +1 -1
  51. package/dist/{chunk-hjdc99kb.js → chunk-29y0hk5z.js} +2 -2
  52. package/dist/{chunk-tx6br9r4.js → chunk-2cdvw21b.js} +1 -1
  53. package/dist/{chunk-g2hekckm.js → chunk-2j21d3ka.js} +1 -1
  54. package/dist/chunk-2jxbwnkz.js +2 -0
  55. package/dist/{chunk-8fgwhhb8.js → chunk-31dr4bys.js} +2 -2
  56. package/dist/{chunk-x64kb787.js → chunk-35faj94w.js} +1 -1
  57. package/dist/{chunk-9yz5d003.js → chunk-3a4qsygv.js} +2 -2
  58. package/dist/{chunk-1z2yq9em.js → chunk-3te20hqw.js} +2 -2
  59. package/dist/{chunk-aw3rp9ac.js → chunk-43t7faps.js} +1 -1
  60. package/dist/{chunk-0m9tdm7t.js → chunk-47kpewks.js} +1 -1
  61. package/dist/{chunk-cygfdk1n.js → chunk-4d2y57k7.js} +2 -2
  62. package/dist/{chunk-0tatqxj2.js → chunk-4deg33rw.js} +2 -2
  63. package/dist/{chunk-a69tvya5.js → chunk-4qcy5tx6.js} +2 -2
  64. package/dist/{chunk-d77yxcds.js → chunk-4x7kae4j.js} +2 -2
  65. package/dist/{chunk-g8b81pzc.js → chunk-55nwdnsd.js} +1 -1
  66. package/dist/{chunk-svahbw0w.js → chunk-5f43yz6z.js} +2 -2
  67. package/dist/{chunk-fch9tk1k.js → chunk-5shey2e4.js} +1 -1
  68. package/dist/{chunk-nanw7yhz.js → chunk-6djzdes9.js} +1 -1
  69. package/dist/{chunk-yj560gp8.js → chunk-6eqbxcrd.js} +1 -1
  70. package/dist/{chunk-03c26pjz.js → chunk-7074g241.js} +1 -1
  71. package/dist/{chunk-e0zytzdh.js → chunk-7b6s3g65.js} +1 -1
  72. package/dist/{chunk-77tga15w.js → chunk-7dkz6z2s.js} +2 -2
  73. package/dist/{chunk-q60knhjf.js → chunk-7ed3tean.js} +1 -1
  74. package/dist/{chunk-b0cyc09a.js → chunk-7gd339hd.js} +1 -1
  75. package/dist/{chunk-xsqbk4yk.js → chunk-7j5e8sdj.js} +2 -2
  76. package/dist/{chunk-52agge4n.js → chunk-7n8g0nfn.js} +1 -1
  77. package/dist/{chunk-cn409b69.js → chunk-80g54ncj.js} +1 -1
  78. package/dist/{chunk-w21mwxdd.js → chunk-8a5bxece.js} +1 -1
  79. package/dist/{chunk-7rvh2wwv.js → chunk-8ahwt6a4.js} +1 -1
  80. package/dist/{chunk-fhawx87n.js → chunk-8b3z0zd5.js} +1 -1
  81. package/dist/{chunk-y86m1wr4.js → chunk-8dhdpa5h.js} +2 -2
  82. package/dist/{chunk-hje9v2zh.js → chunk-8n9nnqr6.js} +1 -1
  83. package/dist/{chunk-rb1e4cnb.js → chunk-8qc1bsym.js} +1 -1
  84. package/dist/{chunk-bwxda6n1.js → chunk-8va64c9n.js} +2 -2
  85. package/dist/{chunk-hrampcrj.js → chunk-8vtm0m84.js} +1 -1
  86. package/dist/{chunk-cp3kwv17.js → chunk-8xj7c3mf.js} +1 -1
  87. package/dist/{chunk-fe7r1mq1.js → chunk-988dw6q3.js} +2 -2
  88. package/dist/{chunk-wk07pwtd.js → chunk-9b6cec0v.js} +1 -1
  89. package/dist/{chunk-13yz561y.js → chunk-9cf97f9p.js} +2 -2
  90. package/dist/{chunk-rv002yn0.js → chunk-9ecv8aqj.js} +1 -1
  91. package/dist/{chunk-jbejwejg.js → chunk-9eq3ht5f.js} +1 -1
  92. package/dist/{chunk-dzw95th7.js → chunk-9jtj77jx.js} +2 -2
  93. package/dist/{chunk-57p201gb.js → chunk-9t14se2t.js} +1 -1
  94. package/dist/{chunk-qd5461tt.js → chunk-9wmq2272.js} +1 -1
  95. package/dist/{chunk-qm4yppj5.js → chunk-9zbk5zx5.js} +2 -2
  96. package/dist/{chunk-7b0xdy5h.js → chunk-a2g2qb2y.js} +1 -1
  97. package/dist/{chunk-26r6zh3t.js → chunk-a87qqft6.js} +2 -2
  98. package/dist/{chunk-5kt3ay7x.js → chunk-ah88wzbg.js} +1 -1
  99. package/dist/{chunk-0wdar532.js → chunk-akf1r75r.js} +1 -1
  100. package/dist/{chunk-wxvyj65q.js → chunk-amaa1bev.js} +1 -1
  101. package/dist/{chunk-ganag9dm.js → chunk-avx8aydt.js} +2 -2
  102. package/dist/{chunk-mgmyr1b9.js → chunk-ay9qf4zj.js} +1 -1
  103. package/dist/{chunk-haecq01c.js → chunk-aywxfqev.js} +1 -1
  104. package/dist/{chunk-4bt81cg3.js → chunk-azkegjd8.js} +1 -1
  105. package/dist/{chunk-e53h9qhd.js → chunk-b77wjyn7.js} +1 -1
  106. package/dist/{chunk-jfm69keq.js → chunk-baf1hfwh.js} +2 -2
  107. package/dist/{chunk-hke99a0v.js → chunk-bdk6g1vj.js} +2 -2
  108. package/dist/{chunk-kkp6rs2n.js → chunk-bhqgmyqw.js} +1 -1
  109. package/dist/{chunk-fs0qezn5.js → chunk-bk3j0n82.js} +1 -1
  110. package/dist/{chunk-sn07azv3.js → chunk-bndmdahk.js} +2 -2
  111. package/dist/{chunk-mrehzhxv.js → chunk-bs3gmfxz.js} +1 -1
  112. package/dist/{chunk-yach037f.js → chunk-bxc7kjsk.js} +1 -1
  113. package/dist/{chunk-gqpkp459.js → chunk-ckxjqqn9.js} +2 -2
  114. package/dist/{chunk-ncnfa8ae.js → chunk-d0zjtdw4.js} +2 -2
  115. package/dist/{chunk-qfwzdffx.js → chunk-d1qh1x2g.js} +2 -2
  116. package/dist/{chunk-gcf5v18y.js → chunk-djddhmcc.js} +1 -1
  117. package/dist/{chunk-fms20x0n.js → chunk-dqn9gyhb.js} +1 -1
  118. package/dist/{chunk-6w03t7h6.js → chunk-drjq2zwg.js} +2 -2
  119. package/dist/{chunk-91s2hres.js → chunk-e2q9c5vq.js} +1 -1
  120. package/dist/{chunk-3ngm57nt.js → chunk-e98v1bc6.js} +2 -2
  121. package/dist/chunk-ejayeex8.js +2 -0
  122. package/dist/{chunk-yr1gdceh.js → chunk-ejh8fyak.js} +1 -1
  123. package/dist/{chunk-6wn85hn6.js → chunk-ek2w6zvy.js} +1 -1
  124. package/dist/{chunk-7dy588as.js → chunk-ewa88139.js} +1 -1
  125. package/dist/{chunk-ht4j68cs.js → chunk-fjk3x41y.js} +2 -2
  126. package/dist/{chunk-x39sfpvm.js → chunk-frg705zq.js} +1 -1
  127. package/dist/{chunk-nap11ntr.js → chunk-g1vt329s.js} +2 -2
  128. package/dist/{chunk-6cr3eeh4.js → chunk-gkzq8zw4.js} +1 -1
  129. package/dist/{chunk-3rh7va1z.js → chunk-gz5fmp3q.js} +1 -1
  130. package/dist/{chunk-asarebzq.js → chunk-h0hjy0kn.js} +1 -1
  131. package/dist/{chunk-ywkrxp2h.js → chunk-h5jxydqq.js} +1 -1
  132. package/dist/{chunk-4qq8ffke.js → chunk-h7aq56qj.js} +1 -1
  133. package/dist/{chunk-hepg894w.js → chunk-hbehnm18.js} +2 -2
  134. package/dist/{chunk-gc84b1d2.js → chunk-hbgxbgam.js} +2 -2
  135. package/dist/{chunk-05hgyyqc.js → chunk-hc2mf5h6.js} +1 -1
  136. package/dist/{chunk-tr0z0e1g.js → chunk-hjm2xab3.js} +1 -1
  137. package/dist/{chunk-50vqeesm.js → chunk-hrnnh4tq.js} +2 -2
  138. package/dist/{chunk-hq5cem49.js → chunk-ht43ds42.js} +1 -1
  139. package/dist/{chunk-vdfwv0fp.js → chunk-hy8820vc.js} +1 -1
  140. package/dist/{chunk-vpe6napb.js → chunk-j447q024.js} +2 -2
  141. package/dist/{chunk-x4fze3q2.js → chunk-j58vh0w6.js} +1 -1
  142. package/dist/{chunk-z37xq5rx.js → chunk-j8tn8enq.js} +2 -2
  143. package/dist/{chunk-m59y310j.js → chunk-jjb05d21.js} +2 -2
  144. package/dist/{chunk-3bjtemm6.js → chunk-jjdq01dv.js} +1 -1
  145. package/dist/{chunk-b3prs7y0.js → chunk-jnmgm2xw.js} +1 -1
  146. package/dist/{chunk-5ggw1dyv.js → chunk-jpndqst5.js} +1 -1
  147. package/dist/{chunk-7sm05m0j.js → chunk-jt0ezawy.js} +1 -1
  148. package/dist/{chunk-6y4gqs1q.js → chunk-jz73j3qs.js} +1 -1
  149. package/dist/{chunk-jt98jhpt.js → chunk-k21df0pg.js} +1 -1
  150. package/dist/{chunk-zt2yag10.js → chunk-k848dzsa.js} +1 -1
  151. package/dist/{chunk-bjnjpsgn.js → chunk-kdfe4t91.js} +2 -2
  152. package/dist/{chunk-82t27pvd.js → chunk-keawsbpn.js} +1 -1
  153. package/dist/{chunk-5q87fgkk.js → chunk-khdn7jwe.js} +2 -2
  154. package/dist/{chunk-ca6qd1dx.js → chunk-km25cwz6.js} +1 -1
  155. package/dist/{chunk-pc31m5x5.js → chunk-knm8a8yx.js} +1 -1
  156. package/dist/{chunk-baa7h4yz.js → chunk-krqn0ddk.js} +2 -2
  157. package/dist/{chunk-0g4gece6.js → chunk-kx6eb6ma.js} +1 -1
  158. package/dist/{chunk-3yg9hbmb.js → chunk-kypas8vy.js} +1 -1
  159. package/dist/{chunk-7xcfy2fn.js → chunk-m167kjhv.js} +1 -1
  160. package/dist/{chunk-w959hm8j.js → chunk-m491r0rj.js} +1 -1
  161. package/dist/{chunk-x1hjv24z.js → chunk-m8448qby.js} +1 -1
  162. package/dist/{chunk-tj6zfxeb.js → chunk-mgj88zeq.js} +2 -2
  163. package/dist/{chunk-6djgb0hr.js → chunk-mhgk632d.js} +1 -1
  164. package/dist/{chunk-y5wazw6j.js → chunk-n5kg7fpx.js} +1 -1
  165. package/dist/{chunk-957amb71.js → chunk-n98x35xd.js} +1 -1
  166. package/dist/{chunk-04mvcmcr.js → chunk-n9dhs1dw.js} +1 -1
  167. package/dist/{chunk-75rndzbd.js → chunk-nd9rmddh.js} +1 -1
  168. package/dist/{chunk-y25pr13j.js → chunk-nhv099jv.js} +1 -1
  169. package/dist/{chunk-cpcc11vp.js → chunk-nm15ccsg.js} +2 -2
  170. package/dist/{chunk-z4djtgt0.js → chunk-npfmdb6y.js} +1 -1
  171. package/dist/{chunk-xhkjhxsp.js → chunk-p077sw22.js} +1 -1
  172. package/dist/{chunk-kfd2hf6f.js → chunk-p1h8065h.js} +2 -2
  173. package/dist/{chunk-647849kf.js → chunk-p3e0cqtt.js} +2 -2
  174. package/dist/{chunk-c53hyw5c.js → chunk-p3fpb79v.js} +1 -1
  175. package/dist/{chunk-adjcg6wa.js → chunk-p52yzjq6.js} +2 -2
  176. package/dist/{chunk-qgxwmagw.js → chunk-p73meypx.js} +1 -1
  177. package/dist/{chunk-bykjk6vj.js → chunk-pa9zb7ty.js} +1 -1
  178. package/dist/{chunk-qk584whs.js → chunk-pcm1vd8w.js} +1 -1
  179. package/dist/{chunk-bn08k7yy.js → chunk-pcntd9h4.js} +2 -2
  180. package/dist/{chunk-87kx8byz.js → chunk-psc3wfcf.js} +1 -1
  181. package/dist/{chunk-svhtdb0s.js → chunk-pznnww6k.js} +1 -1
  182. package/dist/{chunk-5ppkfyn2.js → chunk-q6zhd9yf.js} +1 -1
  183. package/dist/chunk-qa59zejf.js +246 -0
  184. package/dist/{chunk-hpqr9e3x.js → chunk-qvrbjpdc.js} +2 -2
  185. package/dist/{chunk-46mkpbkk.js → chunk-qygvvygy.js} +2 -2
  186. package/dist/{chunk-xygc53vr.js → chunk-r0jcmpv6.js} +1 -1
  187. package/dist/{chunk-yw2fzq86.js → chunk-r5m9xtm7.js} +2 -2
  188. package/dist/{chunk-174z0cd0.js → chunk-rpx5fa65.js} +2 -2
  189. package/dist/{chunk-tmgz5t2g.js → chunk-rqxf5hns.js} +1 -1
  190. package/dist/{chunk-5xvbq2gs.js → chunk-rtr974rc.js} +2 -2
  191. package/dist/{chunk-y4c744dk.js → chunk-rvptcndz.js} +2 -2
  192. package/dist/{chunk-25s7bckb.js → chunk-rw26rpek.js} +2 -2
  193. package/dist/{chunk-qhdtssn1.js → chunk-rw7937v4.js} +2 -2
  194. package/dist/{chunk-n46a5g1g.js → chunk-rwrv9wbf.js} +1 -1
  195. package/dist/{chunk-8qbax8xn.js → chunk-rz2ec6g7.js} +1 -1
  196. package/dist/{chunk-epj957jf.js → chunk-scpkdrdb.js} +1 -1
  197. package/dist/{chunk-q6h6yvzb.js → chunk-shv88d2d.js} +2 -2
  198. package/dist/{chunk-2w3302dh.js → chunk-t0c9wvpr.js} +1 -1
  199. package/dist/{chunk-6dqzky7x.js → chunk-tffh3b1e.js} +1 -1
  200. package/dist/{chunk-ceg2c2q2.js → chunk-tg2f1mzq.js} +2 -2
  201. package/dist/{chunk-eqeyaq6g.js → chunk-trfswy66.js} +1 -1
  202. package/dist/{chunk-t37dp99j.js → chunk-tzwtg722.js} +1 -1
  203. package/dist/{chunk-ghrx0hn1.js → chunk-v7f8jj15.js} +1 -1
  204. package/dist/{chunk-95w08s8v.js → chunk-v8j49spx.js} +1 -1
  205. package/dist/{chunk-yaan98dd.js → chunk-veeerpwa.js} +1 -1
  206. package/dist/{chunk-xcb0pbr6.js → chunk-vg5kt6az.js} +1 -1
  207. package/dist/{chunk-9tmbrwwx.js → chunk-vgv7jvyz.js} +1 -1
  208. package/dist/{chunk-2xen423s.js → chunk-vjbefncc.js} +1 -1
  209. package/dist/{chunk-jt44av4j.js → chunk-vmxjghsm.js} +1 -1
  210. package/dist/{chunk-mqwbpamc.js → chunk-vw7vqd76.js} +1 -1
  211. package/dist/{chunk-adqh2m9z.js → chunk-w3b6m427.js} +1 -1
  212. package/dist/{chunk-eds0f8f1.js → chunk-wazkqv7n.js} +2 -2
  213. package/dist/{chunk-y4md9hp0.js → chunk-wfg2gm11.js} +1 -1
  214. package/dist/{chunk-vv9wfz1c.js → chunk-wg9k6h8w.js} +2 -2
  215. package/dist/{chunk-1mmykse5.js → chunk-wkz2vwkr.js} +1 -1
  216. package/dist/{chunk-7a51hkpf.js → chunk-wvf31nzs.js} +1 -1
  217. package/dist/{chunk-dyjnn5k8.js → chunk-x05nxhyv.js} +2 -2
  218. package/dist/{chunk-kh6rfz2v.js → chunk-x0770gt9.js} +1 -1
  219. package/dist/{chunk-5p568px4.js → chunk-x24s4heg.js} +1 -1
  220. package/dist/{chunk-cdbwprfv.js → chunk-x3r64r0c.js} +2 -2
  221. package/dist/{chunk-fbxt2mrx.js → chunk-x5g9w4hh.js} +2 -2
  222. package/dist/{chunk-268adc7r.js → chunk-xgkv66q5.js} +1 -1
  223. package/dist/chunk-xqq1vxb6.js +1 -0
  224. package/dist/{chunk-qxs6et76.js → chunk-xs03kc1h.js} +1 -1
  225. package/dist/{chunk-3jm3snz8.js → chunk-xv34zbp4.js} +1 -1
  226. package/dist/{chunk-b5zc9y0y.js → chunk-xw36p73h.js} +2 -2
  227. package/dist/{chunk-j4s5qwd7.js → chunk-xyg1r5w0.js} +2 -2
  228. package/dist/{chunk-cyp4m0vh.js → chunk-xys2sxh6.js} +1 -1
  229. package/dist/{chunk-kdxa9epn.js → chunk-y1k17c8b.js} +2 -2
  230. package/dist/{chunk-cr3wbrcr.js → chunk-y6xsqe9a.js} +2 -2
  231. package/dist/{chunk-94g3cahw.js → chunk-yb1t2h8h.js} +2 -2
  232. package/dist/{chunk-vw6ejgmy.js → chunk-yj4x5ehw.js} +1 -1
  233. package/dist/{chunk-fk51yyrw.js → chunk-ynhngsdh.js} +1 -1
  234. package/dist/{chunk-vp2395eb.js → chunk-yrsb6j3z.js} +2 -2
  235. package/dist/chunk-yywfvfph.js +2 -0
  236. package/dist/{chunk-xhnpsngj.js → chunk-zcxzdrn7.js} +2 -2
  237. package/dist/{chunk-jjvp4t5w.js → chunk-zen6ax1y.js} +2 -2
  238. package/dist/{chunk-n944baxp.js → chunk-zf2pek72.js} +1 -1
  239. package/dist/{chunk-z8cjr9n9.js → chunk-zk3d0jjf.js} +1 -1
  240. package/dist/{chunk-9agvhp1x.js → chunk-zy3rp1ab.js} +1 -1
  241. package/dist/cli.js +1 -1
  242. package/dist/client/directive.js +1 -1
  243. package/dist/client/index.js +1 -1
  244. package/dist/client-helpers.js +1 -1
  245. package/dist/client-script-bundler.js +1 -1
  246. package/dist/client-script.js +1 -1
  247. package/dist/component-hmr.js +1 -1
  248. package/dist/component-processing.js +1 -1
  249. package/dist/component-registry.js +1 -1
  250. package/dist/component-renderer.js +1 -1
  251. package/dist/components.js +1 -1
  252. package/dist/composables/index.js +1 -1
  253. package/dist/composables/use-battery.js +1 -1
  254. package/dist/composables/use-broadcast-channel.js +1 -1
  255. package/dist/composables/use-channel.js +1 -1
  256. package/dist/composables/use-clipboard.js +1 -1
  257. package/dist/composables/use-color-mode.js +1 -1
  258. package/dist/composables/use-cookie.js +1 -1
  259. package/dist/composables/use-device-orientation.js +1 -1
  260. package/dist/composables/use-event-listener.js +1 -1
  261. package/dist/composables/use-event-source.js +1 -1
  262. package/dist/composables/use-eye-dropper.js +1 -1
  263. package/dist/composables/use-fetch.js +1 -1
  264. package/dist/composables/use-fullscreen.js +1 -1
  265. package/dist/composables/use-geolocation.js +1 -1
  266. package/dist/composables/use-idle.js +1 -1
  267. package/dist/composables/use-intersection-observer.js +1 -1
  268. package/dist/composables/use-keyboard.js +1 -1
  269. package/dist/composables/use-media-query.js +1 -1
  270. package/dist/composables/use-meta.js +1 -1
  271. package/dist/composables/use-mouse.js +1 -1
  272. package/dist/composables/use-mutation-observer.js +1 -1
  273. package/dist/composables/use-network.js +1 -1
  274. package/dist/composables/use-notification.js +1 -1
  275. package/dist/composables/use-permissions.js +1 -1
  276. package/dist/composables/use-resize-observer.js +1 -1
  277. package/dist/composables/use-router.js +1 -1
  278. package/dist/composables/use-share.js +1 -1
  279. package/dist/composables/use-speech.js +1 -1
  280. package/dist/composables/use-storage.js +1 -1
  281. package/dist/composables/use-text-selection.js +1 -1
  282. package/dist/composables/use-timer.js +1 -1
  283. package/dist/composables/use-utilities.js +1 -1
  284. package/dist/composables/use-wake-lock.js +1 -1
  285. package/dist/composables/use-websocket.js +1 -1
  286. package/dist/composables/use-window.js +1 -1
  287. package/dist/composables.js +1 -1
  288. package/dist/composition-api.js +1 -1
  289. package/dist/computed.js +1 -1
  290. package/dist/conditionals.js +1 -1
  291. package/dist/config.js +1 -1
  292. package/dist/craft-bridge.js +1 -1
  293. package/dist/craft-compiler.js +1 -1
  294. package/dist/craft-components.js +1 -1
  295. package/dist/craft-entry.js +1 -1
  296. package/dist/craft-ssr.js +1 -1
  297. package/dist/csp.js +1 -1
  298. package/dist/csrf.js +1 -1
  299. package/dist/custom-directives.js +1 -1
  300. package/dist/defer.js +1 -1
  301. package/dist/deploy/config-generators.js +1 -1
  302. package/dist/deploy/index.js +1 -1
  303. package/dist/deploy/netlify.js +1 -1
  304. package/dist/dev-server/crosswind.js +1 -1
  305. package/dist/dev-server/index.js +1 -1
  306. package/dist/dev-server/keyboard-shortcuts.js +1 -1
  307. package/dist/dev-server/native-window.js +1 -1
  308. package/dist/dev-server/port-utils.js +1 -1
  309. package/dist/dev-server/serve-app.js +1 -6
  310. package/dist/dev-server/serve-file.js +1 -6
  311. package/dist/dev-server/serve-markdown.js +1 -1
  312. package/dist/dev-server/serve-multi.js +1 -171
  313. package/dist/dev-server/terminal-colors.js +1 -1
  314. package/dist/dev-server/theme-selector.js +1 -1
  315. package/dist/dev-server/types.js +1 -1
  316. package/dist/dev-server.js +1 -1
  317. package/dist/devtools.js +1 -1
  318. package/dist/directive-api.js +1 -1
  319. package/dist/docs.js +1 -1
  320. package/dist/doctor.js +1 -1
  321. package/dist/document-shell.js +1 -1
  322. package/dist/dynamic-components.js +1 -1
  323. package/dist/edge-runtime.js +1 -1
  324. package/dist/env.js +1 -1
  325. package/dist/error-boundaries.js +1 -1
  326. package/dist/error-handling.js +1 -1
  327. package/dist/errors/codes.js +1 -1
  328. package/dist/errors/formatter.js +1 -1
  329. package/dist/errors/index.js +1 -1
  330. package/dist/errors/logger.js +1 -1
  331. package/dist/errors/sanitizer.js +1 -1
  332. package/dist/errors/types.js +1 -1
  333. package/dist/events.js +1 -1
  334. package/dist/expressions.js +1 -1
  335. package/dist/formatter.js +1 -1
  336. package/dist/forms-validation.js +1 -1
  337. package/dist/forms.js +1 -1
  338. package/dist/head.js +1 -1
  339. package/dist/heatmap.js +1 -1
  340. package/dist/hot-reload.js +1 -1
  341. package/dist/html-masking.js +1 -1
  342. package/dist/hydration-runtime.js +1 -1
  343. package/dist/hydration.js +1 -1
  344. package/dist/i18n.js +1 -1
  345. package/dist/image-optimization/auto-sibling.js +1 -1
  346. package/dist/image-optimization/build-plugin.js +1 -1
  347. package/dist/image-optimization/component.js +1 -1
  348. package/dist/image-optimization/directive.js +1 -1
  349. package/dist/image-optimization/index.js +1 -1
  350. package/dist/image-optimization/processor.js +1 -1
  351. package/dist/image-optimization/serve.js +1 -1
  352. package/dist/includes.js +1 -1
  353. package/dist/index.js +1 -1
  354. package/dist/init.js +1 -1
  355. package/dist/inline-assets.js +1 -1
  356. package/dist/interactive.js +1 -1
  357. package/dist/internal-markdown.js +1 -1
  358. package/dist/island-chunking.js +1 -1
  359. package/dist/js-ts.js +1 -1
  360. package/dist/jsx-runtime.js +1 -1
  361. package/dist/keep-alive.js +1 -1
  362. package/dist/lazy-loader.js +1 -1
  363. package/dist/loading-indicator.js +1 -1
  364. package/dist/loops.js +1 -1
  365. package/dist/manifest.js +1 -1
  366. package/dist/markdown.js +1 -1
  367. package/dist/media/client/blur-up.js +1 -1
  368. package/dist/media/client/index.js +1 -1
  369. package/dist/media/client/lazy-load.js +1 -1
  370. package/dist/media/client/upload-handler.js +1 -1
  371. package/dist/media/image/component.js +1 -1
  372. package/dist/media/image/directive.js +1 -1
  373. package/dist/media/image/editing.js +1 -1
  374. package/dist/media/image/index.js +1 -1
  375. package/dist/media/image/placeholder.js +1 -1
  376. package/dist/media/image/processor/cache.js +1 -1
  377. package/dist/media/image/processor/index.js +1 -1
  378. package/dist/media/image/processor/optimizer.js +1 -1
  379. package/dist/media/image/processor/responsive.js +1 -1
  380. package/dist/media/image/srcset.js +1 -1
  381. package/dist/media/index.js +1 -1
  382. package/dist/media/manager/embed.js +1 -1
  383. package/dist/media/protected/component.js +1 -1
  384. package/dist/media/protected/index.js +1 -1
  385. package/dist/media/protected/signature.js +1 -1
  386. package/dist/media/shared/cache.js +1 -1
  387. package/dist/media/shared/hash.js +1 -1
  388. package/dist/media/shared/index.js +1 -1
  389. package/dist/media/upload/component.js +1 -1
  390. package/dist/media/upload/index.js +1 -1
  391. package/dist/media/video/directive.js +1 -1
  392. package/dist/media/video/index.js +1 -1
  393. package/dist/media/video/processor/cache.js +1 -1
  394. package/dist/media/video/processor/index.js +1 -1
  395. package/dist/media/video/processor/streaming.js +1 -1
  396. package/dist/media/video/processor/thumbnail.js +1 -1
  397. package/dist/media/video/processor/transcoder.js +1 -1
  398. package/dist/method-spoofing.js +1 -1
  399. package/dist/middleware.js +1 -1
  400. package/dist/misc-directives.js +1 -1
  401. package/dist/native-build.js +1 -1
  402. package/dist/parser/directive-parser.js +1 -1
  403. package/dist/parser/expression-parser.js +1 -1
  404. package/dist/parser/index.js +1 -1
  405. package/dist/parser/tokenizer.js +1 -1
  406. package/dist/partial-hydration.js +1 -1
  407. package/dist/performance-utils.js +1 -1
  408. package/dist/placeholder.js +1 -1
  409. package/dist/plugin-system.js +1 -1
  410. package/dist/plugin.js +1 -1
  411. package/dist/precompiler.js +1 -1
  412. package/dist/process.js +1 -1
  413. package/dist/production-build.js +1 -1
  414. package/dist/production-builder.js +1 -1
  415. package/dist/production-server.js +1 -1
  416. package/dist/props.js +1 -1
  417. package/dist/public-env.js +1 -1
  418. package/dist/pwa/audit.js +1 -1
  419. package/dist/pwa/directives.js +1 -1
  420. package/dist/pwa/icons.js +1 -1
  421. package/dist/pwa/index.js +1 -1
  422. package/dist/pwa/inject.js +1 -1
  423. package/dist/pwa/manifest.js +1 -1
  424. package/dist/pwa/offline.js +1 -1
  425. package/dist/pwa/precache.js +1 -1
  426. package/dist/pwa/service-worker.js +1 -1
  427. package/dist/pwa/workbox-strategies.js +1 -1
  428. package/dist/pwa/workbox.js +1 -1
  429. package/dist/reactive-bindings.js +1 -1
  430. package/dist/reactive.js +1 -1
  431. package/dist/reactivity.js +1 -1
  432. package/dist/release.js +1 -1
  433. package/dist/render.js +1 -1
  434. package/dist/route-middleware.js +1 -1
  435. package/dist/router.js +1 -1
  436. package/dist/routes.js +1 -1
  437. package/dist/runtime-injection.js +1 -1
  438. package/dist/runtime.js +1 -1
  439. package/dist/safe-evaluator.js +1 -1
  440. package/dist/scaffolding.js +1 -1
  441. package/dist/screenshot.js +1 -1
  442. package/dist/script-classifier.js +1 -1
  443. package/dist/script-validation.js +1 -1
  444. package/dist/seo.js +1 -1
  445. package/dist/serve.js +1 -1
  446. package/dist/server-bindings.js +1 -1
  447. package/dist/server-components.js +1 -1
  448. package/dist/signal-processing.js +1 -1
  449. package/dist/signals-api.js +1 -1
  450. package/dist/signals.js +1 -1
  451. package/dist/site-builder/build.js +1 -1
  452. package/dist/site-builder/i18n.js +1 -1
  453. package/dist/site-builder/index.js +1 -1
  454. package/dist/site-builder/robots.js +1 -1
  455. package/dist/site-builder/router.js +1 -1
  456. package/dist/site-builder/seo.js +1 -1
  457. package/dist/site-builder/sitemap.js +1 -1
  458. package/dist/site-builder/theme.js +1 -1
  459. package/dist/slots.js +1 -1
  460. package/dist/source-maps.js +1 -1
  461. package/dist/spa-shell.js +1 -1
  462. package/dist/ssr.js +1 -1
  463. package/dist/state-management.js +1 -1
  464. package/dist/store-imports.js +1 -1
  465. package/dist/store-loader.js +1 -1
  466. package/dist/stores-client.js +1 -1
  467. package/dist/story/addons.js +1 -1
  468. package/dist/story/analytics.js +1 -1
  469. package/dist/story/auto-stories.js +1 -1
  470. package/dist/story/bookmarks.js +1 -1
  471. package/dist/story/bun-test.js +1 -1
  472. package/dist/story/cli.js +1 -1
  473. package/dist/story/collect/analyzer.js +1 -1
  474. package/dist/story/collect/index.js +1 -1
  475. package/dist/story/collect/parser.js +1 -1
  476. package/dist/story/collect/scanner.js +1 -1
  477. package/dist/story/collect/tree.js +1 -1
  478. package/dist/story/commands/build.js +1 -1
  479. package/dist/story/commands/dev.js +1 -1
  480. package/dist/story/commands/index.js +1 -1
  481. package/dist/story/commands/preview.js +1 -1
  482. package/dist/story/compiled-output.js +1 -1
  483. package/dist/story/composition.js +1 -1
  484. package/dist/story/config-watcher.js +1 -1
  485. package/dist/story/config.js +1 -1
  486. package/dist/story/context.js +1 -1
  487. package/dist/story/controls/index.js +1 -1
  488. package/dist/story/crosswind.js +1 -1
  489. package/dist/story/desktop-preview.js +1 -1
  490. package/dist/story/docs-generator.js +1 -1
  491. package/dist/story/errors.js +1 -1
  492. package/dist/story/figma-export.js +1 -1
  493. package/dist/story/generator.js +1 -1
  494. package/dist/story/hmr.js +1 -1
  495. package/dist/story/hot-swap.js +1 -1
  496. package/dist/story/index.js +1 -1
  497. package/dist/story/interactions.js +1 -1
  498. package/dist/story/keyboard-shortcuts.js +1 -1
  499. package/dist/story/output.js +1 -1
  500. package/dist/story/performance.js +1 -1
  501. package/dist/story/presets.js +1 -1
  502. package/dist/story/props-validation.js +1 -1
  503. package/dist/story/renderer.js +1 -1
  504. package/dist/story/search-index.js +1 -1
  505. package/dist/story/search.js +1 -1
  506. package/dist/story/server.js +1 -1
  507. package/dist/story/setup.js +1 -1
  508. package/dist/story/snapshots.js +1 -1
  509. package/dist/story/testing.js +1 -1
  510. package/dist/story/theme.js +1 -1
  511. package/dist/story/ui/code-panel.js +1 -1
  512. package/dist/story/ui/controls-panel.js +1 -1
  513. package/dist/story/ui/index.js +1 -1
  514. package/dist/story/ui/navigation.js +1 -1
  515. package/dist/story/ui/preview.js +1 -1
  516. package/dist/story/visual-testing.js +1 -1
  517. package/dist/streaming.js +1 -1
  518. package/dist/strict-lint.js +1 -1
  519. package/dist/style-scoping.js +1 -1
  520. package/dist/suspense.js +1 -1
  521. package/dist/teleport.js +1 -1
  522. package/dist/template-compiler.js +1 -1
  523. package/dist/template-hydrator.js +1 -1
  524. package/dist/template-tag-balance.js +1 -1
  525. package/dist/testing.js +1 -1
  526. package/dist/transitions.js +1 -1
  527. package/dist/type-checker.js +1 -1
  528. package/dist/types/directive-types.js +1 -1
  529. package/dist/types/index.js +1 -1
  530. package/dist/types.js +1 -1
  531. package/dist/typescript-templates.js +1 -1
  532. package/dist/utils.js +1 -1
  533. package/dist/validator.js +1 -1
  534. package/dist/variable-extractor.js +1 -1
  535. package/dist/view-composers.js +1 -1
  536. package/dist/virtual-scrolling.js +1 -1
  537. package/dist/visual-editor.js +1 -1
  538. package/dist/vue-template.js +1 -1
  539. package/dist/web-components/css-scoping.js +1 -1
  540. package/dist/web-components/index.js +1 -1
  541. package/dist/web-components/reactive-generator.js +1 -1
  542. package/dist/web-components.js +1 -1
  543. package/dist/x-element.js +1 -1
  544. package/package.json +6 -6
  545. package/dist/chunk-48cw2nde.js +0 -2
  546. package/dist/chunk-48r3qe0k.js +0 -3
  547. package/dist/chunk-h45py5w5.js +0 -2
  548. package/dist/chunk-jfrn43vh.js +0 -2
  549. package/dist/chunk-mwbng54r.js +0 -2
  550. package/dist/chunk-qwyd9a1d.js +0 -2
  551. package/dist/chunk-sjagg9qz.js +0 -66
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{$x as l,by as p,dy as c,fy as a}from"./chunk-yw2fzq86.js";import{ry as x}from"./chunk-jjvp4t5w.js";import{Ty as P}from"./chunk-cz25azze.js";import{lz as f}from"./chunk-hpqr9e3x.js";import{rz as v,sz as m,xz as h}from"./chunk-adqh2m9z.js";function o(G,K,q){let H=G,T=!0;while(T){T=!1;let $=H.match(/@switch\s*\(/);if(!$||$.index===void 0)break;let j=$.index,J=a(H,j);if(!J)break;try{let U;if(m(J.expression))U=h(J.expression,Object.keys(K))(...Object.values(K));else U=v(J.expression,K);let Y="",W=!1;for(let X of J.cases)if(X.type==="default"){if(!W)Y=X.content.trim()}else try{let F;if(X.value&&m(X.value))F=h(X.value,Object.keys(K))(...Object.values(K));else if(X.value)F=v(X.value,K);if(U===F){Y=X.content.trim(),W=!0;break}}catch{continue}H=H.substring(0,j)+Y+H.substring(J.end),T=!0}catch(U){let Y=U instanceof Error?U.message:String(U),W=x("Switch",`Error evaluating @switch expression: ${Y}`,P.EVALUATION_ERROR);H=H.substring(0,j)+W+H.substring(J.end);break}}return H}function KH(G,K,q){let H=G;H=o(H,K,q);{let $=!0;while($){$=!1;let j=H.match(/@unless\s*\(/);if(!j||j.index===void 0)break;let J=j.index,U=l(H,J+7);if(!U)break;let Y=U.endPos,W=p(H,"unless","endunless",Y);if(W===-1){console.warn(`[stx] @unless directive at position ${J} has no matching @endunless \u2014 the block was skipped. Check for typos or missing closers.`);break}let X=H.slice(Y,W),F=U.expression,O=-1;{let z=0,Q=/@(?:if|unless)\s*\(/g,_=/@(?:endif|endunless)(?![a-z])/g,V=/@else(?![a-z])/g,w=[],B;while((B=Q.exec(X))!==null)w.push({pos:B.index,type:"open"});while((B=_.exec(X))!==null)w.push({pos:B.index,type:"close"});while((B=V.exec(X))!==null)w.push({pos:B.index,type:"else"});w.sort((N,L)=>N.pos-L.pos);for(let N of w)if(N.type==="open")z++;else if(N.type==="close")z--;else if(N.type==="else"&&z===0){O=N.pos;break}}let Z;if(O!==-1){let z=X.slice(0,O),Q=X.slice(O+5);Z=`@if (${F})${Q}@else ${z}@endif`}else Z=`@if (!(${F}))${X}@endif`;H=H.substring(0,J)+Z+H.substring(W+10),$=!0}}H=s(H,K,q),H=n(H,K,q),H=r(H,K);let T=()=>{let $=c(H);if($.length===0)return!1;for(let j=$.length-1;j>=0;j--){let J=$[j];try{let U="",Y=!1;for(let W of J.branches){if(Y)break;if(W.type==="else")U=W.content,Y=!0;else try{let X;if(W.condition&&m(W.condition))X=h(W.condition,Object.keys(K))(...Object.values(K));else if(W.condition)X=v(W.condition,K);if(X)U=W.content,Y=!0}catch(X){U=x(W.type==="if"?"If":"Elseif",`Error in @${W.type}(${W.condition}): ${X instanceof Error?X.message:String(X)}`,P.EVALUATION_ERROR),Y=!0}}H=H.substring(0,J.start)+U+H.substring(J.end)}catch(U){let Y=U instanceof Error?U.message:String(U),W=x("If",`Error processing @if block: ${Y}`,P.EVALUATION_ERROR);H=H.substring(0,J.start)+W+H.substring(J.end)}}return!0};while(!0){let $=H;if(!T())break;if(H===$)break}return H}function u(G){let K=0;while(K<G.length&&/\s/.test(G[K]))K++;if(G[K]!=="(")return null;K++;while(K<G.length&&/\s/.test(G[K]))K++;let q=G[K];if(q!=="'"&&q!=='"')return null;K++;let H=[];while(K<G.length){let T=G[K];if(T==="\\"&&K+1<G.length){H.push(G[K+1]),K+=2;continue}if(T===q){K++;break}H.push(T),K++}while(K<G.length&&/\s/.test(G[K]))K++;if(G[K]!==")")return null;return K++,{value:H.join(""),consumed:K}}function r(G,K){let q=G;function H(J,U,Y,W){let X=1,F=W,O=new RegExp(`@${U}(?:\\s*\\(|\\s|$)`,"g"),Z=new RegExp(`@${Y}(?![a-z])`,"g");while(F<J.length&&X>0){O.lastIndex=F,Z.lastIndex=F;let z=O.exec(J),Q=Z.exec(J),_=z?z.index:1/0,V=Q?Q.index:1/0;if(_<V)X++,F=_+z[0].length;else if(V<1/0){if(X--,X===0)return V;F=V+Q[0].length}else break}return-1}function T(J,U,Y){let W=0,X=new RegExp(`@${U}(?:\\s*\\(|\\s|$)`,"g"),F=new RegExp(`@${Y}(?![a-z])`,"g"),O=/@else(?![a-z])/g,Z=[],z;while((z=X.exec(J))!==null)Z.push({pos:z.index,type:"open"});while((z=F.exec(J))!==null)Z.push({pos:z.index,type:"close"});while((z=O.exec(J))!==null)Z.push({pos:z.index,type:"else"});Z.sort((Q,_)=>Q.pos-_.pos);for(let Q of Z)if(Q.type==="open")W++;else if(Q.type==="close")W--;else if(Q.type==="else"&&W===0)return Q.pos;return-1}{let J=!0;while(J){J=!1;let U=q.match(/@auth(?:\s*\(|\s|(?=\n))/);if(!U||U.index===void 0)break;let Y=U.index,W,X,F=q.slice(Y+5),O=u(F);if(O)W=O.value,X=Y+5+O.consumed;else X=Y+5;let Z=H(q,"auth","endauth",X);if(Z===-1){console.warn(`[stx] @auth directive at position ${Y} has no matching @endauth \u2014 the block was skipped.`);break}let z=q.slice(X,Z),Q=T(z,"auth","endauth"),_;if(!K.auth)_=!1;else _=W?f(`auth?.check && auth?.user?.[${W}]`,K):f("auth?.check",K);let V;if(Q!==-1){let w=z.slice(0,Q),B=z.slice(Q+5);V=_?w:B}else V=_?z:"";q=q.substring(0,Y)+V+q.substring(Z+8),J=!0}}{let J=!0;while(J){J=!1;let U=q.match(/@guest(?:\s*\(|\s|(?=\n))/);if(!U||U.index===void 0)break;let Y=U.index,W,X,F=q.slice(Y+6),O=u(F);if(O)W=O.value,X=Y+6+O.consumed;else X=Y+6;let Z=H(q,"guest","endguest",X);if(Z===-1){console.warn(`[stx] @guest directive at position ${Y} has no matching @endguest \u2014 the block was skipped.`);break}let z=q.slice(X,Z),Q=T(z,"guest","endguest"),_;if(!K.auth)_=!0;else _=W?f(`!auth?.check || !auth?.user?.[${W}]`,K):f("!auth?.check",K);let V;if(Q!==-1){let w=z.slice(0,Q),B=z.slice(Q+5);V=_?w:B}else V=_?z:"";q=q.substring(0,Y)+V+q.substring(Z+9),J=!0}}function $(J,U,Y){if(K.userCan&&typeof K.userCan[J]==="boolean")return K.userCan[J];if(K.permissions?.check&&typeof K.permissions.check==="function")try{let W=[J];if(U)W.push(U);if(Y){let X=f(Y,K);W.push(X)}return K.permissions.check(...W)}catch{return!1}return!1}function j(J){let U=J.match(/^\s*\(\s*'([^']*)'(?:,\s*'([^']*)')?(?:,\s*([^)]*))?\)/);if(!U)return null;return{ability:U[1],type:U[2],id:U[3]?.trim(),paramsEnd:U[0].length}}for(let J of["can","cannot"]){let U=`end${J}`,Y=J==="can"?"elsecan":"elsecannot",W=!0;while(W){W=!1;let X=q.match(new RegExp(`@${J}\\s*\\(`));if(!X||X.index===void 0)break;let F=X.index,O=q.slice(F+`@${J}`.length),Z=j(O);if(!Z)break;let z=F+`@${J}`.length+Z.paramsEnd,Q=H(q,J,U,z);if(Q===-1){console.warn(`[stx] @${J} directive at position ${F} has no matching @${U} \u2014 the block was skipped.`);break}let _=q.slice(z,Q),V=[],w=0,B=new RegExp(`@${J}\\s*\\(`,"g"),N=new RegExp(`@${U}(?![a-z])`,"g"),L=new RegExp(`@${Y}\\s*\\(`,"g"),D=/@else(?![a-z])/g,M=[],k;while((k=B.exec(_))!==null)M.push({pos:k.index,type:"open"});while((k=N.exec(_))!==null)M.push({pos:k.index,type:"close"});while((k=L.exec(_))!==null)M.push({pos:k.index,type:"elseDirective"});while((k=D.exec(_))!==null)M.push({pos:k.index,type:"else"});M.sort((A,I)=>A.pos-I.pos);for(let A of M){if(A.type==="open"){w++;continue}if(A.type==="close"){w--;continue}if(w===0)V.push(A)}let R=[],b=0;for(let A=0;A<V.length;A++){let I=V[A];if(R.push({content:_.slice(b,I.pos),ability:void 0}),I.type==="elseDirective"){let C=_.slice(I.pos+`@${Y}`.length),E=j(C);if(E){R[R.length-1]={content:_.slice(b,I.pos)},b=I.pos+`@${Y}`.length+E.paramsEnd,R.push({content:"",ability:E.ability,type:E.type,id:E.id}),R.pop();let d=V[A+1],i=d?d.pos:_.length;R.push({content:_.slice(b,i),ability:E.ability,type:E.type,id:E.id}),b=i}}else b=I.pos+5}if(b<_.length){let A=R[R.length-1];if(V.length>0&&V[V.length-1].type==="else")R.push({content:_.slice(b),isFinalElse:!0});else if(R.length===0)R.push({content:_.slice(b)})}let y=$(Z.ability,Z.type,Z.id),S=J==="can"?y:!y,g="";if(S)g=R[0]?.content||"";else{let A=!1;for(let I=1;I<R.length;I++){let C=R[I];if(C.isFinalElse){g=C.content,A=!0;break}if(C.ability){let E=$(C.ability,C.type,C.id);if(J==="can"?E:!E){g=C.content,A=!0;break}}}if(!A&&R.length>0){let I=R[R.length-1];if(I.isFinalElse)g=I.content}}q=q.substring(0,F)+g+q.substring(Q+`@${U}`.length),W=!0}}return q}function s(G,K,q){let H=G;function T($,j,J,U,Y){let W=!0;while(W){W=!1;let X=new RegExp(`@${j}\\s*\\(`),F=$.match(X);if(!F||F.index===void 0)break;let O=F.index,Z=l($,O+`@${j}`.length);if(!Z)break;let z=Z.endPos,Q=p($,j,J,z);if(Q===-1){console.warn(`[stx] @${j} directive at position ${O} has no matching @${J} \u2014 the block was skipped.`);break}let _=$.slice(z,Q),V=Z.expression,w=-1,B=0,N=0;while(N<_.length){let L=_.indexOf("@",N);if(L===-1)break;let D=_.substring(L);if(/^@(?:if|unless|isset|empty)\s*\(/.test(D)){B++,N=L+1;continue}if(/^@(?:endif|endunless|endisset|endempty)(?![a-z])/.test(D)){B--,N=L+1;continue}if(B===0&&/^@else(?![a-z])/.test(D)){w=L;break}N=L+1}try{let L=U(V.trim()),D;if(w!==-1){let M=_.slice(0,w),k=_.slice(w+5);D=L?M:k}else D=L?_:"";$=$.substring(0,O)+D+$.substring(Q+`@${J}`.length),W=!0}catch(L){let D=L instanceof Error?L.message:String(L),M=x(Y,`Error processing @${j} directive: ${D}`,P.EVALUATION_ERROR);$=$.substring(0,O)+M+$.substring(Q+`@${J}`.length);break}}return $}return H=T(H,"isset","endisset",($)=>{let j=f($,K);return j!==void 0&&j!==null},"Isset"),H=T(H,"empty","endempty",($)=>{let j=f($,K);return j===void 0||j===null||j===""||j===0||j===!1||Array.isArray(j)&&j.length===0||typeof j==="object"&&j!==null&&Object.keys(j).length===0},"Empty"),H}function n(G,K,q){let H=G,T="development";function $(j,J,U,Y){let W=new RegExp(`@${J}(?![a-z])`,"g"),X=new RegExp(`@${U}(?![a-z])`,"g"),F=new RegExp(`^@${J}(?![a-z])`),O=new RegExp(`^@${U}(?![a-z])`),Z=j,z=!0;while(z){z=!1,W.lastIndex=0;let Q=W.exec(Z);if(!Q)break;let _=Q.index,V=_+Q[0].length;if(J==="env"){let y=Z.substring(V).match(/^\s*\(\s*(['"])([^'"]+)\1\s*\)/);if(!y)break;V+=y[0].length,Y=T===y[2]}let w=1,B=V,N=-1;while(w>0&&B<Z.length){W.lastIndex=B,X.lastIndex=B;let y=W.exec(Z),S=X.exec(Z),g=y?y.index:1/0,A=S?S.index:1/0;if(g<A)w++,B=g+y[0].length;else if(A<1/0){if(w--,w===0){N=A;break}B=A+S[0].length}else break}if(N===-1){console.warn(`[stx] @${J} directive at position ${_} has no matching @${U} \u2014 the block was skipped.`);break}let L=Z.substring(V,N),D=-1,M=0,k=0;while(k<L.length){let y=L.indexOf("@",k);if(y===-1)break;let S=L.substring(y);if(F.test(S)){M++,k=y+1;continue}if(O.test(S)){M--,k=y+1;continue}if(M===0&&/^@else(?![a-z])/.test(S)){D=y;break}k=y+1}let R;if(D!==-1){let y=L.slice(0,D),S=L.slice(D+5);R=Y?y:S}else R=Y?L:"";let b=`@${U}`.length;Z=Z.substring(0,_)+R+Z.substring(N+b),z=!0}return Z}return H=$(H,"env","endenv",!1),H=$(H,"production","endproduction",T==="production"),H=$(H,"development","enddevelopment",T==="development"),H=$(H,"staging","endstaging",T==="staging"),H=$(H,"testing","endtesting",T==="testing"),H}
3
- export{o as Qx,KH as Rx,r as Sx,s as Tx,n as Ux};
2
+ import{$x as p,Zx as l,by as c,dy as a}from"./chunk-r5m9xtm7.js";import{py as x}from"./chunk-zen6ax1y.js";import{Ry as P}from"./chunk-27zsyhrd.js";import{jz as f}from"./chunk-qvrbjpdc.js";import{pz as v,qz as m,vz as h}from"./chunk-w3b6m427.js";function o(G,K,q){let H=G,T=!0;while(T){T=!1;let $=H.match(/@switch\s*\(/);if(!$||$.index===void 0)break;let j=$.index,J=a(H,j);if(!J)break;try{let U;if(m(J.expression))U=h(J.expression,Object.keys(K))(...Object.values(K));else U=v(J.expression,K);let Y="",W=!1;for(let X of J.cases)if(X.type==="default"){if(!W)Y=X.content.trim()}else try{let F;if(X.value&&m(X.value))F=h(X.value,Object.keys(K))(...Object.values(K));else if(X.value)F=v(X.value,K);if(U===F){Y=X.content.trim(),W=!0;break}}catch{continue}H=H.substring(0,j)+Y+H.substring(J.end),T=!0}catch(U){let Y=U instanceof Error?U.message:String(U),W=x("Switch",`Error evaluating @switch expression: ${Y}`,P.EVALUATION_ERROR);H=H.substring(0,j)+W+H.substring(J.end);break}}return H}function KH(G,K,q){let H=G;H=o(H,K,q);{let $=!0;while($){$=!1;let j=H.match(/@unless\s*\(/);if(!j||j.index===void 0)break;let J=j.index,U=l(H,J+7);if(!U)break;let Y=U.endPos,W=p(H,"unless","endunless",Y);if(W===-1){console.warn(`[stx] @unless directive at position ${J} has no matching @endunless \u2014 the block was skipped. Check for typos or missing closers.`);break}let X=H.slice(Y,W),F=U.expression,O=-1;{let z=0,Q=/@(?:if|unless)\s*\(/g,_=/@(?:endif|endunless)(?![a-z])/g,V=/@else(?![a-z])/g,w=[],B;while((B=Q.exec(X))!==null)w.push({pos:B.index,type:"open"});while((B=_.exec(X))!==null)w.push({pos:B.index,type:"close"});while((B=V.exec(X))!==null)w.push({pos:B.index,type:"else"});w.sort((N,L)=>N.pos-L.pos);for(let N of w)if(N.type==="open")z++;else if(N.type==="close")z--;else if(N.type==="else"&&z===0){O=N.pos;break}}let Z;if(O!==-1){let z=X.slice(0,O),Q=X.slice(O+5);Z=`@if (${F})${Q}@else ${z}@endif`}else Z=`@if (!(${F}))${X}@endif`;H=H.substring(0,J)+Z+H.substring(W+10),$=!0}}H=s(H,K,q),H=n(H,K,q),H=r(H,K);let T=()=>{let $=c(H);if($.length===0)return!1;for(let j=$.length-1;j>=0;j--){let J=$[j];try{let U="",Y=!1;for(let W of J.branches){if(Y)break;if(W.type==="else")U=W.content,Y=!0;else try{let X;if(W.condition&&m(W.condition))X=h(W.condition,Object.keys(K))(...Object.values(K));else if(W.condition)X=v(W.condition,K);if(X)U=W.content,Y=!0}catch(X){U=x(W.type==="if"?"If":"Elseif",`Error in @${W.type}(${W.condition}): ${X instanceof Error?X.message:String(X)}`,P.EVALUATION_ERROR),Y=!0}}H=H.substring(0,J.start)+U+H.substring(J.end)}catch(U){let Y=U instanceof Error?U.message:String(U),W=x("If",`Error processing @if block: ${Y}`,P.EVALUATION_ERROR);H=H.substring(0,J.start)+W+H.substring(J.end)}}return!0};while(!0){let $=H;if(!T())break;if(H===$)break}return H}function u(G){let K=0;while(K<G.length&&/\s/.test(G[K]))K++;if(G[K]!=="(")return null;K++;while(K<G.length&&/\s/.test(G[K]))K++;let q=G[K];if(q!=="'"&&q!=='"')return null;K++;let H=[];while(K<G.length){let T=G[K];if(T==="\\"&&K+1<G.length){H.push(G[K+1]),K+=2;continue}if(T===q){K++;break}H.push(T),K++}while(K<G.length&&/\s/.test(G[K]))K++;if(G[K]!==")")return null;return K++,{value:H.join(""),consumed:K}}function r(G,K){let q=G;function H(J,U,Y,W){let X=1,F=W,O=new RegExp(`@${U}(?:\\s*\\(|\\s|$)`,"g"),Z=new RegExp(`@${Y}(?![a-z])`,"g");while(F<J.length&&X>0){O.lastIndex=F,Z.lastIndex=F;let z=O.exec(J),Q=Z.exec(J),_=z?z.index:1/0,V=Q?Q.index:1/0;if(_<V)X++,F=_+z[0].length;else if(V<1/0){if(X--,X===0)return V;F=V+Q[0].length}else break}return-1}function T(J,U,Y){let W=0,X=new RegExp(`@${U}(?:\\s*\\(|\\s|$)`,"g"),F=new RegExp(`@${Y}(?![a-z])`,"g"),O=/@else(?![a-z])/g,Z=[],z;while((z=X.exec(J))!==null)Z.push({pos:z.index,type:"open"});while((z=F.exec(J))!==null)Z.push({pos:z.index,type:"close"});while((z=O.exec(J))!==null)Z.push({pos:z.index,type:"else"});Z.sort((Q,_)=>Q.pos-_.pos);for(let Q of Z)if(Q.type==="open")W++;else if(Q.type==="close")W--;else if(Q.type==="else"&&W===0)return Q.pos;return-1}{let J=!0;while(J){J=!1;let U=q.match(/@auth(?:\s*\(|\s|(?=\n))/);if(!U||U.index===void 0)break;let Y=U.index,W,X,F=q.slice(Y+5),O=u(F);if(O)W=O.value,X=Y+5+O.consumed;else X=Y+5;let Z=H(q,"auth","endauth",X);if(Z===-1){console.warn(`[stx] @auth directive at position ${Y} has no matching @endauth \u2014 the block was skipped.`);break}let z=q.slice(X,Z),Q=T(z,"auth","endauth"),_;if(!K.auth)_=!1;else _=W?f(`auth?.check && auth?.user?.[${W}]`,K):f("auth?.check",K);let V;if(Q!==-1){let w=z.slice(0,Q),B=z.slice(Q+5);V=_?w:B}else V=_?z:"";q=q.substring(0,Y)+V+q.substring(Z+8),J=!0}}{let J=!0;while(J){J=!1;let U=q.match(/@guest(?:\s*\(|\s|(?=\n))/);if(!U||U.index===void 0)break;let Y=U.index,W,X,F=q.slice(Y+6),O=u(F);if(O)W=O.value,X=Y+6+O.consumed;else X=Y+6;let Z=H(q,"guest","endguest",X);if(Z===-1){console.warn(`[stx] @guest directive at position ${Y} has no matching @endguest \u2014 the block was skipped.`);break}let z=q.slice(X,Z),Q=T(z,"guest","endguest"),_;if(!K.auth)_=!0;else _=W?f(`!auth?.check || !auth?.user?.[${W}]`,K):f("!auth?.check",K);let V;if(Q!==-1){let w=z.slice(0,Q),B=z.slice(Q+5);V=_?w:B}else V=_?z:"";q=q.substring(0,Y)+V+q.substring(Z+9),J=!0}}function $(J,U,Y){if(K.userCan&&typeof K.userCan[J]==="boolean")return K.userCan[J];if(K.permissions?.check&&typeof K.permissions.check==="function")try{let W=[J];if(U)W.push(U);if(Y){let X=f(Y,K);W.push(X)}return K.permissions.check(...W)}catch{return!1}return!1}function j(J){let U=J.match(/^\s*\(\s*'([^']*)'(?:,\s*'([^']*)')?(?:,\s*([^)]*))?\)/);if(!U)return null;return{ability:U[1],type:U[2],id:U[3]?.trim(),paramsEnd:U[0].length}}for(let J of["can","cannot"]){let U=`end${J}`,Y=J==="can"?"elsecan":"elsecannot",W=!0;while(W){W=!1;let X=q.match(new RegExp(`@${J}\\s*\\(`));if(!X||X.index===void 0)break;let F=X.index,O=q.slice(F+`@${J}`.length),Z=j(O);if(!Z)break;let z=F+`@${J}`.length+Z.paramsEnd,Q=H(q,J,U,z);if(Q===-1){console.warn(`[stx] @${J} directive at position ${F} has no matching @${U} \u2014 the block was skipped.`);break}let _=q.slice(z,Q),V=[],w=0,B=new RegExp(`@${J}\\s*\\(`,"g"),N=new RegExp(`@${U}(?![a-z])`,"g"),L=new RegExp(`@${Y}\\s*\\(`,"g"),D=/@else(?![a-z])/g,M=[],k;while((k=B.exec(_))!==null)M.push({pos:k.index,type:"open"});while((k=N.exec(_))!==null)M.push({pos:k.index,type:"close"});while((k=L.exec(_))!==null)M.push({pos:k.index,type:"elseDirective"});while((k=D.exec(_))!==null)M.push({pos:k.index,type:"else"});M.sort((A,I)=>A.pos-I.pos);for(let A of M){if(A.type==="open"){w++;continue}if(A.type==="close"){w--;continue}if(w===0)V.push(A)}let R=[],b=0;for(let A=0;A<V.length;A++){let I=V[A];if(R.push({content:_.slice(b,I.pos),ability:void 0}),I.type==="elseDirective"){let C=_.slice(I.pos+`@${Y}`.length),E=j(C);if(E){R[R.length-1]={content:_.slice(b,I.pos)},b=I.pos+`@${Y}`.length+E.paramsEnd,R.push({content:"",ability:E.ability,type:E.type,id:E.id}),R.pop();let d=V[A+1],i=d?d.pos:_.length;R.push({content:_.slice(b,i),ability:E.ability,type:E.type,id:E.id}),b=i}}else b=I.pos+5}if(b<_.length){let A=R[R.length-1];if(V.length>0&&V[V.length-1].type==="else")R.push({content:_.slice(b),isFinalElse:!0});else if(R.length===0)R.push({content:_.slice(b)})}let y=$(Z.ability,Z.type,Z.id),S=J==="can"?y:!y,g="";if(S)g=R[0]?.content||"";else{let A=!1;for(let I=1;I<R.length;I++){let C=R[I];if(C.isFinalElse){g=C.content,A=!0;break}if(C.ability){let E=$(C.ability,C.type,C.id);if(J==="can"?E:!E){g=C.content,A=!0;break}}}if(!A&&R.length>0){let I=R[R.length-1];if(I.isFinalElse)g=I.content}}q=q.substring(0,F)+g+q.substring(Q+`@${U}`.length),W=!0}}return q}function s(G,K,q){let H=G;function T($,j,J,U,Y){let W=!0;while(W){W=!1;let X=new RegExp(`@${j}\\s*\\(`),F=$.match(X);if(!F||F.index===void 0)break;let O=F.index,Z=l($,O+`@${j}`.length);if(!Z)break;let z=Z.endPos,Q=p($,j,J,z);if(Q===-1){console.warn(`[stx] @${j} directive at position ${O} has no matching @${J} \u2014 the block was skipped.`);break}let _=$.slice(z,Q),V=Z.expression,w=-1,B=0,N=0;while(N<_.length){let L=_.indexOf("@",N);if(L===-1)break;let D=_.substring(L);if(/^@(?:if|unless|isset|empty)\s*\(/.test(D)){B++,N=L+1;continue}if(/^@(?:endif|endunless|endisset|endempty)(?![a-z])/.test(D)){B--,N=L+1;continue}if(B===0&&/^@else(?![a-z])/.test(D)){w=L;break}N=L+1}try{let L=U(V.trim()),D;if(w!==-1){let M=_.slice(0,w),k=_.slice(w+5);D=L?M:k}else D=L?_:"";$=$.substring(0,O)+D+$.substring(Q+`@${J}`.length),W=!0}catch(L){let D=L instanceof Error?L.message:String(L),M=x(Y,`Error processing @${j} directive: ${D}`,P.EVALUATION_ERROR);$=$.substring(0,O)+M+$.substring(Q+`@${J}`.length);break}}return $}return H=T(H,"isset","endisset",($)=>{let j=f($,K);return j!==void 0&&j!==null},"Isset"),H=T(H,"empty","endempty",($)=>{let j=f($,K);return j===void 0||j===null||j===""||j===0||j===!1||Array.isArray(j)&&j.length===0||typeof j==="object"&&j!==null&&Object.keys(j).length===0},"Empty"),H}function n(G,K,q){let H=G,T="development";function $(j,J,U,Y){let W=new RegExp(`@${J}(?![a-z])`,"g"),X=new RegExp(`@${U}(?![a-z])`,"g"),F=new RegExp(`^@${J}(?![a-z])`),O=new RegExp(`^@${U}(?![a-z])`),Z=j,z=!0;while(z){z=!1,W.lastIndex=0;let Q=W.exec(Z);if(!Q)break;let _=Q.index,V=_+Q[0].length;if(J==="env"){let y=Z.substring(V).match(/^\s*\(\s*(['"])([^'"]+)\1\s*\)/);if(!y)break;V+=y[0].length,Y=T===y[2]}let w=1,B=V,N=-1;while(w>0&&B<Z.length){W.lastIndex=B,X.lastIndex=B;let y=W.exec(Z),S=X.exec(Z),g=y?y.index:1/0,A=S?S.index:1/0;if(g<A)w++,B=g+y[0].length;else if(A<1/0){if(w--,w===0){N=A;break}B=A+S[0].length}else break}if(N===-1){console.warn(`[stx] @${J} directive at position ${_} has no matching @${U} \u2014 the block was skipped.`);break}let L=Z.substring(V,N),D=-1,M=0,k=0;while(k<L.length){let y=L.indexOf("@",k);if(y===-1)break;let S=L.substring(y);if(F.test(S)){M++,k=y+1;continue}if(O.test(S)){M--,k=y+1;continue}if(M===0&&/^@else(?![a-z])/.test(S)){D=y;break}k=y+1}let R;if(D!==-1){let y=L.slice(0,D),S=L.slice(D+5);R=Y?y:S}else R=Y?L:"";let b=`@${U}`.length;Z=Z.substring(0,_)+R+Z.substring(N+b),z=!0}return Z}return H=$(H,"env","endenv",!1),H=$(H,"production","endproduction",T==="production"),H=$(H,"development","enddevelopment",T==="development"),H=$(H,"staging","endstaging",T==="staging"),H=$(H,"testing","endtesting",T==="testing"),H}
3
+ export{o as Px,KH as Qx,r as Rx,s as Sx,n as Tx};
@@ -33,4 +33,4 @@ ${Y}`}),q=q.replace(/(<\/[^>]+>)(?=<|$)/g,(w,W,Y,X)=>{let Z=X.substring(Math.max
33
33
  `),w=[],W=0,Y=!1,X=q.useTabs?"\t":" ".repeat(q.indentSize);for(let Z=0;Z<j.length;Z++){let V=j[Z],G=V.trim();if(G===""){w.push("");continue}let H=G.match(/<script\b/i),z=G.match(/<\/script>/i);if(Y&&!z){w.push(V);continue}let J=G===">";if(_(G)&&!G.startsWith("<")&&!G.startsWith("@")){w.push(X.repeat(W)+G);continue}let R=G.startsWith("@end"),$=G.startsWith("@else")||G.startsWith("@elseif"),F=G.startsWith("@")&&x(G),y=G.startsWith("<!DOCTYPE")||G.startsWith("<!doctype"),A=G.startsWith("<!--"),U=G.startsWith("</"),B=G.startsWith("<")&&!U&&!A&&!y,k=G.includes("/>")||S(G),E=_(G);if(U||R)W=Math.max(0,W-1);let M=$?Math.max(0,W-1):W;if(J)w.push(V);else w.push(X.repeat(M)+G);if(B&&!k&&!E&&!J||F)W++;if(H)Y=!0;if(z)Y=!1}return w.join(`
34
34
  `)}function N(K,q){if(K=K.replace(/@(if|elseif|foreach|for|while)\s*\(\s*([^)]+)\s*\)/g,(Q,j,w)=>{let W=w.trim().replace(/\s+/g," ");return`@${j}(${W})`}),K=K.replace(/@(csrf|method)\s*\(\s*([^)]*)\s*\)/g,(Q,j,w)=>{if(w.trim()==="")return`@${j}`;return`@${j}(${w.trim()})`}),q.normalizeWhitespace)K=K.replace(/\{\{\s*([^}]+)\s*\}\}/g,(Q,j)=>{return`{{ ${j.trim()} }}`}),K=K.replace(/\{!!\s*([^!]+)\s*!!\}/g,(Q,j)=>{return`{!! ${j.trim()} !!}`});return K}function S(K){let q=["br","hr","img","input","meta","link","area","base","col","embed","source","track","wbr"];if(K.includes("/>"))return!0;let Q=K.match(/<(\w+)/);if(Q){let j=Q[1];return q.includes(j.toLowerCase())}return!1}function _(K){return/<(\w+)(?:\s[^>]*)?>[\s\S]*?<\/\1>/.test(K)}function x(K){let q=["if","unless","foreach","for","while","section","push","component","slot","markdown","wrap","error"];for(let Q of q)if(K.startsWith(`@${Q}`))return!K.includes(`@end${Q}`);return!1}function L(K,q){if(!q.sortAttributes)return K;return K.replace(/<(\w+)([^>]*)>/g,(Q,j,w)=>{if(!w.trim())return Q;if(w.includes("<")||w.includes(`
35
35
  `)||w.includes("@"))return Q;let W=/(\w+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,Y=[],X;while((X=W.exec(w))!==null)Y.push({name:X[1],value:X[2]});Y.sort((V,G)=>{if(V.name==="id")return-1;if(G.name==="id")return 1;if(V.name==="class")return-1;if(G.name==="class")return 1;return V.name.localeCompare(G.name)});let Z=Y.map((V)=>V.value?`${V.name}=${V.value}`:V.name).join(" ");return`<${j}${Z?` ${Z}`:""}>`})}
36
- export{O as _m,v as $m};
36
+ export{O as bn,v as cn};
@@ -338,4 +338,4 @@ else {
338
338
  console.log('[stx] Suspense runtime initialized');
339
339
  })();
340
340
  `}
341
- export{N as Gf,Q as Hf,T as If,U as Jf,W as Kf};
341
+ export{N as Jf,Q as Kf,T as Lf,U as Mf,W as Nf};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Ek as x,Fk as C}from"./chunk-5q87fgkk.js";import{Sk as U,Xk as k}from"./chunk-5ggw1dyv.js";import{rB as q}from"./chunk-3jm3snz8.js";import{resolve as B,basename as F,extname as T,join as z}from"path";import{mkdir as R}from"fs/promises";async function X(){try{return await import("ts-images")}catch{return null}}function A(K){switch(K){case"quality":return{jpeg:{quality:90,mozjpeg:!0,progressive:!0},png:{compressionLevel:6,palette:!1},webp:{quality:90,effort:6,smartSubsample:!0},avif:{quality:85,effort:6}};case"performance":return{jpeg:{quality:70,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!0},webp:{quality:70,effort:4,smartSubsample:!0},avif:{quality:60,effort:2}};case"web":default:return{jpeg:{quality:82,mozjpeg:!0,progressive:!0},png:{compressionLevel:8,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4}}}}function P(K,L){let N=L?A(L):A("web"),G=K.formatQuality||{};return{jpeg:{...N.jpeg,...G.jpeg},png:{...N.png,...G.png},webp:{...N.webp,...G.webp},avif:{...N.avif,...G.avif}}}async function f(K,L,N){let G=await X();if(!G)return console.warn("[stx-media] ts-images not installed, skipping optimization"),{src:K,processed:!1};let w=await x(K,L,N);if(w)return w;try{let O=B(K);if(!await k(O))return{src:K,processed:!1,errors:[`Source file not found: ${K}`]};let J=P(N,L.preset),Y=N.outputDir||"dist/images",E=N.baseUrl||"/images";await R(Y,{recursive:!0});let Z=await U(O),H=F(K,T(K)),S=L.outputFormat?[L.outputFormat]:N.defaultFormats||["avif","webp","jpeg"],M={src:K,processed:!0,variants:[],hash:Z},_=null;if(L.transformations&&L.transformations.length>0)_=await d(O,L.transformations,G);for(let V of S){let $=J[V]||{},j=`${H}-${Z}.${V}`,v=z(Y,j);try{let W=await G.optimizeImage({input:_||O,output:v,format:V,quality:$.quality,progressive:$.progressive});if(W){if(M.variants.push({path:v,url:`${E}/${j}`,width:W.width||0,height:W.height||0,format:V,size:W.outputSize||0}),!M.originalWidth&&W.width)M.originalWidth=W.width,M.originalHeight=W.height}}catch(W){M.errors=M.errors||[],M.errors.push(`Failed to optimize ${V}: ${W}`)}}if(L.embedThumbhash||L.placeholder==="thumbhash")try{let V=await G.generateThumbHash(O);M.placeholder=V.dataUrl}catch(V){M.errors=M.errors||[],M.errors.push(`Failed to generate thumbhash: ${V}`)}if(L.useDominantColor)try{let V=await G.generatePlaceholder(O,{strategy:"dominant-color"});M.dominantColor=V.dominantColor}catch(V){M.errors=M.errors||[],M.errors.push(`Failed to extract dominant color: ${V}`)}return await C(K,L,M,N),M}catch(O){return{src:K,processed:!1,errors:[`Processing failed: ${O}`]}}}async function n(K,L,N,G){let w=await X();if(!w)return{success:!1,error:"ts-images not installed"};try{return{success:!0,size:(await w.optimizeImage({input:K,output:G,format:L,quality:N}))?.outputSize}}catch(O){return{success:!1,error:String(O)}}}async function d(K,L,N){let G=N||await X();if(!G)return console.warn("[stx-media] ts-images not installed, skipping transformations"),null;try{let w=await G.decode(K);for(let O of L){let J=O.options||{};switch(O.type){case"resize":if(J.width||J.height)w=await G.resize(w,{width:J.width,height:J.height,fit:J.fit});break;case"blur":if(J.sigma!==void 0)w=await G.blur(w,J.sigma);break;case"sharpen":if(J.amount!==void 0)w=await G.sharpen(w,J.amount);break;case"grayscale":w=await G.grayscale(w);break;case"rotate":if(J.angle!==void 0)w=await G.rotate(w,J.angle);break;case"flip":w=await G.flip(w);break;case"flop":w=await G.flop(w);break;case"brightness":if(J.value!==void 0)w=await G.brightness(w,J.value);break;case"contrast":if(J.value!==void 0)w=await G.contrast(w,J.value);break;case"saturation":if(J.value!==void 0)w=await G.saturation(w,J.value);break}}return await G.encode(w,"png")}catch(w){return console.error(`[stx-media] Transformation failed: ${w}`),null}}
3
- export{f as Ak,n as Bk,d as Ck};
2
+ import{Hk as x,Ik as C}from"./chunk-khdn7jwe.js";import{Vk as U,_k as k}from"./chunk-jpndqst5.js";import{pB as q}from"./chunk-xv34zbp4.js";import{resolve as B,basename as F,extname as T,join as z}from"path";import{mkdir as R}from"fs/promises";async function X(){try{return await import("ts-images")}catch{return null}}function A(K){switch(K){case"quality":return{jpeg:{quality:90,mozjpeg:!0,progressive:!0},png:{compressionLevel:6,palette:!1},webp:{quality:90,effort:6,smartSubsample:!0},avif:{quality:85,effort:6}};case"performance":return{jpeg:{quality:70,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!0},webp:{quality:70,effort:4,smartSubsample:!0},avif:{quality:60,effort:2}};case"web":default:return{jpeg:{quality:82,mozjpeg:!0,progressive:!0},png:{compressionLevel:8,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4}}}}function P(K,L){let N=L?A(L):A("web"),G=K.formatQuality||{};return{jpeg:{...N.jpeg,...G.jpeg},png:{...N.png,...G.png},webp:{...N.webp,...G.webp},avif:{...N.avif,...G.avif}}}async function f(K,L,N){let G=await X();if(!G)return console.warn("[stx-media] ts-images not installed, skipping optimization"),{src:K,processed:!1};let w=await x(K,L,N);if(w)return w;try{let O=B(K);if(!await k(O))return{src:K,processed:!1,errors:[`Source file not found: ${K}`]};let J=P(N,L.preset),Y=N.outputDir||"dist/images",E=N.baseUrl||"/images";await R(Y,{recursive:!0});let Z=await U(O),H=F(K,T(K)),S=L.outputFormat?[L.outputFormat]:N.defaultFormats||["avif","webp","jpeg"],M={src:K,processed:!0,variants:[],hash:Z},_=null;if(L.transformations&&L.transformations.length>0)_=await d(O,L.transformations,G);for(let V of S){let $=J[V]||{},j=`${H}-${Z}.${V}`,v=z(Y,j);try{let W=await G.optimizeImage({input:_||O,output:v,format:V,quality:$.quality,progressive:$.progressive});if(W){if(M.variants.push({path:v,url:`${E}/${j}`,width:W.width||0,height:W.height||0,format:V,size:W.outputSize||0}),!M.originalWidth&&W.width)M.originalWidth=W.width,M.originalHeight=W.height}}catch(W){M.errors=M.errors||[],M.errors.push(`Failed to optimize ${V}: ${W}`)}}if(L.embedThumbhash||L.placeholder==="thumbhash")try{let V=await G.generateThumbHash(O);M.placeholder=V.dataUrl}catch(V){M.errors=M.errors||[],M.errors.push(`Failed to generate thumbhash: ${V}`)}if(L.useDominantColor)try{let V=await G.generatePlaceholder(O,{strategy:"dominant-color"});M.dominantColor=V.dominantColor}catch(V){M.errors=M.errors||[],M.errors.push(`Failed to extract dominant color: ${V}`)}return await C(K,L,M,N),M}catch(O){return{src:K,processed:!1,errors:[`Processing failed: ${O}`]}}}async function n(K,L,N,G){let w=await X();if(!w)return{success:!1,error:"ts-images not installed"};try{return{success:!0,size:(await w.optimizeImage({input:K,output:G,format:L,quality:N}))?.outputSize}}catch(O){return{success:!1,error:String(O)}}}async function d(K,L,N){let G=N||await X();if(!G)return console.warn("[stx-media] ts-images not installed, skipping transformations"),null;try{let w=await G.decode(K);for(let O of L){let J=O.options||{};switch(O.type){case"resize":if(J.width||J.height)w=await G.resize(w,{width:J.width,height:J.height,fit:J.fit});break;case"blur":if(J.sigma!==void 0)w=await G.blur(w,J.sigma);break;case"sharpen":if(J.amount!==void 0)w=await G.sharpen(w,J.amount);break;case"grayscale":w=await G.grayscale(w);break;case"rotate":if(J.angle!==void 0)w=await G.rotate(w,J.angle);break;case"flip":w=await G.flip(w);break;case"flop":w=await G.flop(w);break;case"brightness":if(J.value!==void 0)w=await G.brightness(w,J.value);break;case"contrast":if(J.value!==void 0)w=await G.contrast(w,J.value);break;case"saturation":if(J.value!==void 0)w=await G.saturation(w,J.value);break}}return await G.encode(w,"png")}catch(w){return console.error(`[stx-media] Transformation failed: ${w}`),null}}
3
+ export{f as Dk,n as Ek,d as Fk};
@@ -2,4 +2,4 @@
2
2
  class J{source;pos=0;line=1;column=0;tokens=[];constructor(b){this.source=b}tokenize(){this.tokens=[],this.pos=0,this.line=1,this.column=0;while(this.pos<this.source.length){let b=this.nextToken();if(b)this.tokens.push(b)}return this.tokens.push({type:"EOF",value:"",start:this.pos,end:this.pos,line:this.line,column:this.column}),this.tokens}nextToken(){if(this.pos>=this.source.length)return null;let b=this.pos,w=this.line,j=this.column,v=this.source[this.pos];if(/\s/.test(v))return this.readWhitespace(b,w,j);if(v==="/"&&this.peek(1)==="/")return this.readLineComment(b,w,j);if(v==="/"&&this.peek(1)==="*")return this.readBlockComment(b,w,j);if(v==='"'||v==="'")return this.readString(v,b,w,j);if(v==="`")return this.readTemplateString(b,w,j);if(/\d/.test(v)||v==="."&&/\d/.test(this.peek(1)||""))return this.readNumber(b,w,j);if(/[a-z_$]/i.test(v))return this.readIdentifier(b,w,j);if(v==="{"){if(this.peek(1)==="{"&&this.peek(2)==="{")return this.advance(3),{type:"RAW_START",value:"{{{",start:b,end:this.pos,line:w,column:j};if(this.peek(1)==="{")return this.advance(2),{type:"EXPRESSION_START",value:"{{",start:b,end:this.pos,line:w,column:j};if(this.peek(1)==="!"&&this.peek(2)==="!")return this.advance(3),{type:"RAW_START",value:"{!!",start:b,end:this.pos,line:w,column:j}}if(v==="}"){if(this.peek(1)==="}"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"}}}",start:b,end:this.pos,line:w,column:j};if(this.peek(1)==="}")return this.advance(2),{type:"EXPRESSION_END",value:"}}",start:b,end:this.pos,line:w,column:j}}if(v==="!"&&this.peek(1)==="!"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"!!}",start:b,end:this.pos,line:w,column:j};if(v==="@"&&/[a-z]/i.test(this.peek(1)||""))return this.readDirective(b,w,j);let z=["===","!==","==","!=","<=",">=","&&","||","??","++","--","+=","-=","*=","/=","%=","**","=>","?.","...","<<",">>",">>>","&=","|=","^="];for(let B of z)if(this.source.slice(this.pos,this.pos+B.length)===B)return this.advance(B.length),{type:"OPERATOR",value:B,start:b,end:this.pos,line:w,column:j};if(/[+\-*/%<>=!&|^~?:]/.test(v))return this.advance(),{type:"OPERATOR",value:v,start:b,end:this.pos,line:w,column:j};if(/[()[\]{},;.]/.test(v))return this.advance(),{type:"PUNCTUATION",value:v,start:b,end:this.pos,line:w,column:j};return this.advance(),{type:"PUNCTUATION",value:v,start:b,end:this.pos,line:w,column:j}}readWhitespace(b,w,j){while(this.pos<this.source.length&&/\s/.test(this.source[this.pos]))this.advance();return{type:"WHITESPACE",value:this.source.slice(b,this.pos),start:b,end:this.pos,line:w,column:j}}readLineComment(b,w,j){this.advance(2);while(this.pos<this.source.length&&this.source[this.pos]!==`
3
3
  `)this.advance();return{type:"COMMENT",value:this.source.slice(b,this.pos),start:b,end:this.pos,line:w,column:j}}readBlockComment(b,w,j){this.advance(2);while(this.pos<this.source.length-1){if(this.source[this.pos]==="*"&&this.source[this.pos+1]==="/"){this.advance(2);break}this.advance()}return{type:"COMMENT",value:this.source.slice(b,this.pos),start:b,end:this.pos,line:w,column:j}}readString(b,w,j,v){this.advance();while(this.pos<this.source.length){let z=this.source[this.pos];if(z==="\\"){this.advance(2);continue}if(z===b){this.advance();break}this.advance()}return{type:"STRING",value:this.source.slice(w,this.pos),start:w,end:this.pos,line:j,column:v}}readTemplateString(b,w,j){this.advance();let v=0,z=256;while(this.pos<this.source.length){let B=this.source[this.pos];if(B==="\\"){this.advance(2);continue}if(B==="$"&&this.peek(1)==="{"){if(v>=z){this.pos=this.source.length;break}this.advance(2),v++;continue}if(B==="{"&&v>0){v++,this.advance();continue}if(B==="}"&&v>0){v--,this.advance();continue}if(B==="`"&&v===0){this.advance();break}this.advance()}return{type:"TEMPLATE_STRING",value:this.source.slice(b,this.pos),start:b,end:this.pos,line:w,column:j}}readNumber(b,w,j){if(this.source[this.pos]==="0"){let v=this.peek(1)?.toLowerCase();if(v==="x"||v==="o"||v==="b"){this.advance(2);while(this.pos<this.source.length&&/[\da-f_]/i.test(this.source[this.pos]))this.advance();return{type:"NUMBER",value:this.source.slice(b,this.pos),start:b,end:this.pos,line:w,column:j}}}while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance();if(this.source[this.pos]==="."&&/\d/.test(this.peek(1)||"")){this.advance();while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance()}if(/e/i.test(this.source[this.pos]||"")){if(this.advance(),/[+-]/.test(this.source[this.pos]||""))this.advance();while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance()}if(this.source[this.pos]==="n")this.advance();return{type:"NUMBER",value:this.source.slice(b,this.pos),start:b,end:this.pos,line:w,column:j}}readIdentifier(b,w,j){while(this.pos<this.source.length&&/[\w$]/.test(this.source[this.pos]))this.advance();return{type:"IDENTIFIER",value:this.source.slice(b,this.pos),start:b,end:this.pos,line:w,column:j}}readDirective(b,w,j){this.advance();while(this.pos<this.source.length&&/[a-z]/i.test(this.source[this.pos]))this.advance();return{type:"DIRECTIVE",value:this.source.slice(b,this.pos),start:b,end:this.pos,line:w,column:j}}advance(b=1){for(let w=0;w<b&&this.pos<this.source.length;w++){if(this.source[this.pos]===`
4
4
  `)this.line++,this.column=0;else this.column++;this.pos++}}peek(b){return this.source[this.pos+b]}saveState(){return{pos:this.pos,line:this.line,column:this.column}}restoreState(b){this.pos=b.pos,this.line=b.line,this.column=b.column}}function K(b,w,j,v=0){let z=0,B=v,y=null,D=0,H=!1;while(B<b.length){let F=b[B];if(y&&H){H=!1,B++;continue}if(y&&F==="\\"){H=!0,B++;continue}if(H=!1,(F==='"'||F==="'"||F==="`")&&!y){y=F,B++;continue}if(F===y&&y!=="`"){y=null,B++;continue}if(y==="`"&&F==="$"&&b[B+1]==="{"){D++,B+=2;continue}if(D>0&&F==="}"){D--,B++;continue}if(F==="`"&&y==="`"&&D===0){y=null,B++;continue}if(y){B++;continue}if(F===w)z++;else if(F===j){if(z--,z===0)return B}B++}return-1}function O(b,w){let j=w,v={paren:0,bracket:0,brace:0},z=null,B=0;while(j<b.length){let y=b[j];if((j>0?b[j-1]:"")==="\\"&&z){j++;continue}if((y==='"'||y==="'")&&!z){z=y,j++;continue}if(y===z&&z!=="`"){z=null,j++;continue}if(y==="`"&&!z){z="`",j++;continue}if(y==="`"&&z==="`"&&B===0){z=null,j++;continue}if(z==="`"&&y==="$"&&b[j+1]==="{"){B++,j+=2;continue}if(B>0){if(y==="{")B++;else if(y==="}")B--;j++;continue}if(z){j++;continue}if(v.paren===0&&v.bracket===0&&v.brace===0){if(b.slice(j,j+2)==="}}"||b.slice(j,j+3)==="!!}")break;if(y===","||y===";")break}if(y==="(")v.paren++;else if(y===")"){if(v.paren--,v.paren<0)break}else if(y==="[")v.bracket++;else if(y==="]"){if(v.bracket--,v.bracket<0)break}else if(y==="{")v.brace++;else if(y==="}"){if(v.brace--,v.brace<0)break}j++}return{expression:b.slice(w,j),endPos:j}}function Q(b){let w=[],j="",v={paren:0,bracket:0,brace:0},z=null,B=0;for(let y=0;y<b.length;y++){let D=b[y];if((y>0?b[y-1]:"")==="\\"&&z){j+=D;continue}if((D==='"'||D==="'")&&!z){z=D,j+=D;continue}if(D===z&&z!=="`"){z=null,j+=D;continue}if(D==="`"&&!z){z="`",j+=D;continue}if(D==="`"&&z==="`"&&B===0){z=null,j+=D;continue}if(z==="`"&&D==="$"&&b[y+1]==="{"){B++,j+=D+b[y+1],y++;continue}if(B>0&&D==="{"){B++,j+=D;continue}if(B>0&&D==="}"){B--,j+=D;continue}if(z){j+=D;continue}if(D==="(")v.paren++;else if(D===")")v.paren--;else if(D==="[")v.bracket++;else if(D==="]")v.bracket--;else if(D==="{")v.brace++;else if(D==="}")v.brace--;if(D==="|"&&b[y+1]!=="|"&&(y===0||b[y-1]!=="|")&&b[y-1]!=="\\"&&v.paren===0&&v.bracket===0&&v.brace===0){w.push(j.trim()),j="";continue}if(D==="|"&&b[y-1]==="\\"&&!z){j=j.slice(0,-1)+D;continue}j+=D}if(j.trim())w.push(j.trim());return w}
5
- export{J as gy,K as hy,O as iy,Q as jy};
5
+ export{J as ey,K as fy,O as gy,Q as hy};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{rB as X}from"./chunk-3jm3snz8.js";function Z(k,q={}){let{includeVariants:z=!0,includeProps:A=!0,frameWidth:B=400,frameHeight:E=300,componentSpacing:K=40}=q,J={},L={},U=[],V=0;for(let Q of k){let R=j(),Y=_(Q,R,V,0,B,E,A);U.push(Y),J[R]={key:R,name:Q.name,description:Q.description||""},V+=B+K}return{name:"STX Components",lastModified:new Date().toISOString(),version:"1.0.0",document:{id:"0:0",name:"Document",type:"DOCUMENT",children:[{id:"0:1",name:"Components",type:"CANVAS",children:U}]},components:J,styles:L}}function _(k,q,z,A,B,E,K){let J=[];if(J.push({id:`${q}:title`,name:"Title",type:"TEXT",characters:k.name,style:{fontFamily:"Inter",fontWeight:600,fontSize:16},fills:[{type:"SOLID",color:{r:0,g:0,b:0,a:1}}]}),k.description)J.push({id:`${q}:desc`,name:"Description",type:"TEXT",characters:k.description,style:{fontFamily:"Inter",fontWeight:400,fontSize:12},fills:[{type:"SOLID",color:{r:0.4,g:0.4,b:0.4,a:1}}]});if(K&&k.props.length>0){let L=$(k.props,`${q}:props`);J.push(L)}return J.push({id:`${q}:preview`,name:"Preview",type:"RECTANGLE",absoluteBoundingBox:{x:0,y:0,width:B-32,height:150},fills:[{type:"SOLID",color:{r:0.95,g:0.95,b:0.95,a:1}}],strokes:[{type:"SOLID",color:{r:0.9,g:0.9,b:0.9,a:1}}],strokeWeight:1,cornerRadius:8}),{id:q,name:k.name,type:"COMPONENT",children:J,absoluteBoundingBox:{x:z,y:A,width:B,height:E},fills:[{type:"SOLID",color:{r:1,g:1,b:1,a:1}}],strokes:[{type:"SOLID",color:{r:0.9,g:0.9,b:0.9,a:1}}],strokeWeight:1,cornerRadius:12,paddingLeft:16,paddingRight:16,paddingTop:16,paddingBottom:16,itemSpacing:12,layoutMode:"VERTICAL",primaryAxisAlignItems:"MIN",counterAxisAlignItems:"MIN"}}function $(k,q){let z=[];z.push({id:`${q}:header`,name:"Props Header",type:"TEXT",characters:"Props",style:{fontFamily:"Inter",fontWeight:600,fontSize:12},fills:[{type:"SOLID",color:{r:0.4,g:0.4,b:0.4,a:1}}]});for(let A=0;A<k.length;A++){let B=k[A];z.push({id:`${q}:prop:${A}`,name:B.name,type:"TEXT",characters:`${B.name}: ${B.type}${B.required?" (required)":""}`,style:{fontFamily:"SF Mono",fontWeight:400,fontSize:11},fills:[{type:"SOLID",color:{r:0.2,g:0.2,b:0.2,a:1}}]})}return{id:q,name:"Props",type:"FRAME",children:z,fills:[{type:"SOLID",color:{r:0.98,g:0.98,b:0.98,a:1}}],cornerRadius:6,paddingLeft:12,paddingRight:12,paddingTop:8,paddingBottom:8,itemSpacing:4,layoutMode:"VERTICAL",primaryAxisAlignItems:"MIN",counterAxisAlignItems:"MIN"}}function j(){return`${Date.now()}:${Math.random().toString(36).slice(2,8)}`}async function D(k,q,z={}){let A=Z(k,z),B=JSON.stringify(A,null,2),E=await import("fs"),K=await import("path");await E.promises.mkdir(K.dirname(q),{recursive:!0}),await E.promises.writeFile(q,B)}function G(k){if(k.startsWith("#")){let z=k.slice(1),A=Number.parseInt(z.slice(0,2),16)/255,B=Number.parseInt(z.slice(2,4),16)/255,E=Number.parseInt(z.slice(4,6),16)/255,K=z.length===8?Number.parseInt(z.slice(6,8),16)/255:1;return{r:A,g:B,b:E,a:K}}let q=k.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);if(q)return{r:Number.parseInt(q[1])/255,g:Number.parseInt(q[2])/255,b:Number.parseInt(q[3])/255,a:q[4]?Number.parseFloat(q[4]):1};return{r:0,g:0,b:0,a:1}}function H(k){let q=Math.round(k.r*255),z=Math.round(k.g*255),A=Math.round(k.b*255);if(k.a===1)return`#${q.toString(16).padStart(2,"0")}${z.toString(16).padStart(2,"0")}${A.toString(16).padStart(2,"0")}`;return`rgba(${q}, ${z}, ${A}, ${k.a})`}function N(k){return{name:k,id:`stx-story-${k.toLowerCase().replace(/\s+/g,"-")}`,api:"1.0.0",main:"code.js",ui:"ui.html",editorType:["figma"],capabilities:["inspect"],permissions:["currentuser"]}}function T(k){let q=k.map((z)=>z.name).join(", ");return`
2
+ import{pB as X}from"./chunk-xv34zbp4.js";function Z(k,q={}){let{includeVariants:z=!0,includeProps:A=!0,frameWidth:B=400,frameHeight:E=300,componentSpacing:K=40}=q,J={},L={},U=[],V=0;for(let Q of k){let R=j(),Y=_(Q,R,V,0,B,E,A);U.push(Y),J[R]={key:R,name:Q.name,description:Q.description||""},V+=B+K}return{name:"STX Components",lastModified:new Date().toISOString(),version:"1.0.0",document:{id:"0:0",name:"Document",type:"DOCUMENT",children:[{id:"0:1",name:"Components",type:"CANVAS",children:U}]},components:J,styles:L}}function _(k,q,z,A,B,E,K){let J=[];if(J.push({id:`${q}:title`,name:"Title",type:"TEXT",characters:k.name,style:{fontFamily:"Inter",fontWeight:600,fontSize:16},fills:[{type:"SOLID",color:{r:0,g:0,b:0,a:1}}]}),k.description)J.push({id:`${q}:desc`,name:"Description",type:"TEXT",characters:k.description,style:{fontFamily:"Inter",fontWeight:400,fontSize:12},fills:[{type:"SOLID",color:{r:0.4,g:0.4,b:0.4,a:1}}]});if(K&&k.props.length>0){let L=$(k.props,`${q}:props`);J.push(L)}return J.push({id:`${q}:preview`,name:"Preview",type:"RECTANGLE",absoluteBoundingBox:{x:0,y:0,width:B-32,height:150},fills:[{type:"SOLID",color:{r:0.95,g:0.95,b:0.95,a:1}}],strokes:[{type:"SOLID",color:{r:0.9,g:0.9,b:0.9,a:1}}],strokeWeight:1,cornerRadius:8}),{id:q,name:k.name,type:"COMPONENT",children:J,absoluteBoundingBox:{x:z,y:A,width:B,height:E},fills:[{type:"SOLID",color:{r:1,g:1,b:1,a:1}}],strokes:[{type:"SOLID",color:{r:0.9,g:0.9,b:0.9,a:1}}],strokeWeight:1,cornerRadius:12,paddingLeft:16,paddingRight:16,paddingTop:16,paddingBottom:16,itemSpacing:12,layoutMode:"VERTICAL",primaryAxisAlignItems:"MIN",counterAxisAlignItems:"MIN"}}function $(k,q){let z=[];z.push({id:`${q}:header`,name:"Props Header",type:"TEXT",characters:"Props",style:{fontFamily:"Inter",fontWeight:600,fontSize:12},fills:[{type:"SOLID",color:{r:0.4,g:0.4,b:0.4,a:1}}]});for(let A=0;A<k.length;A++){let B=k[A];z.push({id:`${q}:prop:${A}`,name:B.name,type:"TEXT",characters:`${B.name}: ${B.type}${B.required?" (required)":""}`,style:{fontFamily:"SF Mono",fontWeight:400,fontSize:11},fills:[{type:"SOLID",color:{r:0.2,g:0.2,b:0.2,a:1}}]})}return{id:q,name:"Props",type:"FRAME",children:z,fills:[{type:"SOLID",color:{r:0.98,g:0.98,b:0.98,a:1}}],cornerRadius:6,paddingLeft:12,paddingRight:12,paddingTop:8,paddingBottom:8,itemSpacing:4,layoutMode:"VERTICAL",primaryAxisAlignItems:"MIN",counterAxisAlignItems:"MIN"}}function j(){return`${Date.now()}:${Math.random().toString(36).slice(2,8)}`}async function D(k,q,z={}){let A=Z(k,z),B=JSON.stringify(A,null,2),E=await import("fs"),K=await import("path");await E.promises.mkdir(K.dirname(q),{recursive:!0}),await E.promises.writeFile(q,B)}function G(k){if(k.startsWith("#")){let z=k.slice(1),A=Number.parseInt(z.slice(0,2),16)/255,B=Number.parseInt(z.slice(2,4),16)/255,E=Number.parseInt(z.slice(4,6),16)/255,K=z.length===8?Number.parseInt(z.slice(6,8),16)/255:1;return{r:A,g:B,b:E,a:K}}let q=k.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);if(q)return{r:Number.parseInt(q[1])/255,g:Number.parseInt(q[2])/255,b:Number.parseInt(q[3])/255,a:q[4]?Number.parseFloat(q[4]):1};return{r:0,g:0,b:0,a:1}}function H(k){let q=Math.round(k.r*255),z=Math.round(k.g*255),A=Math.round(k.b*255);if(k.a===1)return`#${q.toString(16).padStart(2,"0")}${z.toString(16).padStart(2,"0")}${A.toString(16).padStart(2,"0")}`;return`rgba(${q}, ${z}, ${A}, ${k.a})`}function N(k){return{name:k,id:`stx-story-${k.toLowerCase().replace(/\s+/g,"-")}`,api:"1.0.0",main:"code.js",ui:"ui.html",editorType:["figma"],capabilities:["inspect"],permissions:["currentuser"]}}function T(k){let q=k.map((z)=>z.name).join(", ");return`
3
3
  // Figma Plugin Code to import STX components
4
4
  // Run this in Figma's plugin console
5
5
 
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Sk as Z,Vk as U,Wk as X,Xk as _}from"./chunk-5ggw1dyv.js";import{mkdir as S,readFile as $,writeFile as V,readdir as v,rm as W,stat as A}from"fs/promises";import{join as R,dirname as K}from"path";var L=new Map,T={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500};async function M(b){try{await S(b,{recursive:!0})}catch{}}function w(b,q,G){return R(b,G,`${q}.json`)}async function Y(b,q,G){if((Date.now()-b.createdAt)/86400000>G)return!1;if(await X(q)!==b.srcMtime)return!1;return!0}async function F(b,q,G,B=T){if(!B.enabled)return null;let z=U(b,q),I=L.get(z);if(I){if(await Y(I,b,B.maxAge))return I.lastAccessedAt=Date.now(),I.data;L.delete(z)}let O=w(B.directory,z,G);if(await _(O))try{let J=await $(O,"utf-8"),N=JSON.parse(J);if(await Y(N,b,B.maxAge))return N.lastAccessedAt=Date.now(),L.set(z,N),N.data}catch{}return null}async function k(b,q,G,B,z=T){if(!z.enabled)return;let I=U(b,q),O=await Z(b),J=await X(b),N={key:I,src:b,srcHash:O,srcMtime:J,optionsHash:U("",q),data:G,createdAt:Date.now(),lastAccessedAt:Date.now()};L.set(I,N);let Q=w(z.directory,I,B);try{await M(K(Q)),await V(Q,JSON.stringify(N,null,2))}catch(H){console.warn(`[stx-media] Failed to write cache: ${H}`)}}async function D(b,q,G=T){for(let[B,z]of L.entries())if(z.src===b)L.delete(B)}async function P(b,q=T){if(b==="all")L.clear();else L.clear();let G=b==="all"?["image","video"]:[b];for(let B of G){let z=R(q.directory,B);try{await W(z,{recursive:!0,force:!0})}catch{}}}async function u(b=T){let q={memoryEntries:L.size,diskEntries:{image:0,video:0},totalSizeMB:0};for(let G of["image","video"]){let B=R(b.directory,G);try{let z=await v(B);q.diskEntries[G]=z.length;for(let I of z){let O=R(B,I),J=await A(O);q.totalSizeMB+=J.size/1048576}}catch{}}return q}async function d(b=T){let q=0,G=b.maxAge*24*60*60*1000;for(let B of["image","video"]){let z=R(b.directory,B);try{let I=await v(z);for(let O of I){let J=R(z,O);try{let N=await $(J,"utf-8"),Q=JSON.parse(N);if(Date.now()-Q.createdAt>G)await W(J),L.delete(Q.key),q++}catch{await W(J).catch(()=>{}),q++}}}catch{}}return q}
3
- export{T as Hk,F as Ik,k as Jk,D as Kk,P as Lk,u as Mk,d as Nk};
2
+ import{Vk as Z,Yk as U,Zk as X,_k as _}from"./chunk-jpndqst5.js";import{mkdir as S,readFile as $,writeFile as V,readdir as v,rm as W,stat as A}from"fs/promises";import{join as R,dirname as K}from"path";var L=new Map,T={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500};async function M(b){try{await S(b,{recursive:!0})}catch{}}function w(b,q,G){return R(b,G,`${q}.json`)}async function Y(b,q,G){if((Date.now()-b.createdAt)/86400000>G)return!1;if(await X(q)!==b.srcMtime)return!1;return!0}async function F(b,q,G,B=T){if(!B.enabled)return null;let z=U(b,q),I=L.get(z);if(I){if(await Y(I,b,B.maxAge))return I.lastAccessedAt=Date.now(),I.data;L.delete(z)}let O=w(B.directory,z,G);if(await _(O))try{let J=await $(O,"utf-8"),N=JSON.parse(J);if(await Y(N,b,B.maxAge))return N.lastAccessedAt=Date.now(),L.set(z,N),N.data}catch{}return null}async function k(b,q,G,B,z=T){if(!z.enabled)return;let I=U(b,q),O=await Z(b),J=await X(b),N={key:I,src:b,srcHash:O,srcMtime:J,optionsHash:U("",q),data:G,createdAt:Date.now(),lastAccessedAt:Date.now()};L.set(I,N);let Q=w(z.directory,I,B);try{await M(K(Q)),await V(Q,JSON.stringify(N,null,2))}catch(H){console.warn(`[stx-media] Failed to write cache: ${H}`)}}async function D(b,q,G=T){for(let[B,z]of L.entries())if(z.src===b)L.delete(B)}async function P(b,q=T){if(b==="all")L.clear();else L.clear();let G=b==="all"?["image","video"]:[b];for(let B of G){let z=R(q.directory,B);try{await W(z,{recursive:!0,force:!0})}catch{}}}async function u(b=T){let q={memoryEntries:L.size,diskEntries:{image:0,video:0},totalSizeMB:0};for(let G of["image","video"]){let B=R(b.directory,G);try{let z=await v(B);q.diskEntries[G]=z.length;for(let I of z){let O=R(B,I),J=await A(O);q.totalSizeMB+=J.size/1048576}}catch{}}return q}async function d(b=T){let q=0,G=b.maxAge*24*60*60*1000;for(let B of["image","video"]){let z=R(b.directory,B);try{let I=await v(z);for(let O of I){let J=R(z,O);try{let N=await $(J,"utf-8"),Q=JSON.parse(N);if(Date.now()-Q.createdAt>G)await W(J),L.delete(Q.key),q++}catch{await W(J).catch(()=>{}),q++}}}catch{}}return q}
3
+ export{T as Kk,F as Lk,k as Mk,D as Nk,P as Ok,u as Pk,d as Qk};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Rq as E}from"./chunk-6djgb0hr.js";import{rB as f}from"./chunk-3jm3snz8.js";import D from"path";import{extractLayoutMetadata as p}from"stx-router/layout-metadata";var P="stx-page-head:",R=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,H=null;function M(){if(H!==null)return H;try{let{getRouterScript:z}=f("stx-router");H=`<script>${z()}</script>`}catch{H=""}return H}async function x(z,X){if(X===!1)return null;if(X&&typeof X==="string"){let J=D.resolve(z,X);if(await Bun.file(J).exists())return J;return null}let w=D.join(z,"app.stx");if(await Bun.file(w).exists())return w;return null}async function y(z,X){try{let w=await Bun.file(z).text(),J=w,Y=w.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if(Y)J=Y[1].trim();let N=E(w),V=[...N.client.map((Q)=>Q.fullTag),...N.signals.map((Q)=>Q.fullTag)],F=[],Z=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,$;while(($=Z.exec(w))!==null)F.push($[0]);let B=J;for(let Q of N.server)B=B.replace(Q.fullTag,"");for(let Q of N.client)B=B.replace(Q.fullTag,"");B=B.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let j="<!--__STX_PAGE_SLOT__-->";if(B=B.replace(/<slot\s*\/>/gi,j).replace(/<slot\s*>\s*<\/slot>/gi,j),!B.includes(j))return console.warn(`[stx] Shell ${z} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:G,extractVariables:I,defaultConfig:W,loadStxConfig:K}=await import("././index.js"),A=await K(),q={__filename:z,__dirname:D.dirname(z)};for(let Q of V){let k=Q.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(k&&!Q.includes("client")&&!Q.includes('type="module"'))await I(k[1],q,z)}let U=await G(B,q,z,{...W,...A,...X},new Set),v=U.indexOf(j);if(v===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:U.substring(0,v),afterSlot:U.substring(v+j.length),filePath:z,shellScripts:V,shellStyles:F}}catch(w){return console.error(`[stx] Error processing shell ${z}:`,w),null}}function S(z,X,w){let J,Y="",N=X.match(R);if(N){X=X.replace(N[0],"");try{let B=Buffer.from(N[1],"base64").toString("utf8"),j=B.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(j)J=j[1].trim();Y=B.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let V=w||J||"stx App",F=M(),Z="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
2
+ import{Qq as E}from"./chunk-mhgk632d.js";import{pB as f}from"./chunk-xv34zbp4.js";import D from"path";import{extractLayoutMetadata as p}from"stx-router/layout-metadata";var P="stx-page-head:",R=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,H=null;function M(){if(H!==null)return H;try{let{getRouterScript:z}=f("stx-router");H=`<script>${z()}</script>`}catch{H=""}return H}async function x(z,X){if(X===!1)return null;if(X&&typeof X==="string"){let J=D.resolve(z,X);if(await Bun.file(J).exists())return J;return null}let w=D.join(z,"app.stx");if(await Bun.file(w).exists())return w;return null}async function y(z,X){try{let w=await Bun.file(z).text(),J=w,Y=w.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if(Y)J=Y[1].trim();let N=E(w),V=[...N.client.map((Q)=>Q.fullTag),...N.signals.map((Q)=>Q.fullTag)],F=[],Z=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,$;while(($=Z.exec(w))!==null)F.push($[0]);let B=J;for(let Q of N.server)B=B.replace(Q.fullTag,"");for(let Q of N.client)B=B.replace(Q.fullTag,"");B=B.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let j="<!--__STX_PAGE_SLOT__-->";if(B=B.replace(/<slot\s*\/>/gi,j).replace(/<slot\s*>\s*<\/slot>/gi,j),!B.includes(j))return console.warn(`[stx] Shell ${z} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:G,extractVariables:I,defaultConfig:W,loadStxConfig:K}=await import("././index.js"),A=await K(),q={__filename:z,__dirname:D.dirname(z)};for(let Q of V){let k=Q.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(k&&!Q.includes("client")&&!Q.includes('type="module"'))await I(k[1],q,z)}let U=await G(B,q,z,{...W,...A,...X},new Set),v=U.indexOf(j);if(v===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:U.substring(0,v),afterSlot:U.substring(v+j.length),filePath:z,shellScripts:V,shellStyles:F}}catch(w){return console.error(`[stx] Error processing shell ${z}:`,w),null}}function S(z,X,w){let J,Y="",N=X.match(R);if(N){X=X.replace(N[0],"");try{let B=Buffer.from(N[1],"base64").toString("utf8"),j=B.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(j)J=j[1].trim();Y=B.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let V=w||J||"stx App",F=M(),Z="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
3
3
  <html lang="en">
4
4
  <head>
5
5
  <meta charset="UTF-8">
@@ -26,4 +26,4 @@ ${F}
26
26
  `));if(W.length>0)q.push(W.join(`
27
27
  `));return q.push(I),q.join(`
28
28
  `)}
29
- export{x as Jq,y as Kq,S as Lq,b as Mq,C as Nq,g as Oq,p as Pq};
29
+ export{x as Iq,y as Jq,S as Kq,b as Lq,C as Mq,g as Nq,p as Oq};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Ar as W,ur as U}from"./chunk-w01y57f5.js";import{et as X}from"./chunk-nap11ntr.js";import{eu as R,fu as O}from"./chunk-tr0z0e1g.js";import{rB as Q}from"./chunk-3jm3snz8.js";async function F(j,N={}){return(await _(j,N)).html}async function V(j,N={}){let{html:J,context:A}=await _(j,N),{extractStreamBoundaries:G}=await import("././streaming.js"),z=G(A),w=j.streamTemplates;if(w&&Object.keys(w).length>0){let{processDirectives:$}=await import("././process.js"),{defaultConfig:D}=await import("././config.js"),Y=A.streamBoundaries||{},I={...D,autoShell:!1},Z=Object.keys(w).map((K)=>({id:K,render:async()=>{let M=typeof Y[K]==="function"?await Y[K]():void 0;return $(w[K],{...A,$boundary:M},j.sourceFile,I,new Set)}})),L=new Set(Z.map((K)=>K.id));z=[...(z||[]).filter((K)=>!L.has(K.id)),...Z]}return{html:J,boundaries:z&&z.length>0?z:void 0}}async function _(j,N){let J={__filename:j.sourceFile,__dirname:j.sourceFile.replace(/[/\\][^/\\]+$/,""),...N};if(!j.hasServerScripts&&!O(j.html))return{html:j.html,context:J};for(let G of j.serverScriptContent)try{await X(G,J,j.sourceFile)}catch(z){console.warn(`[stx] Server script error in ${j.sourceFile}:`,z)}if(!O(j.html))return{html:j.html,context:J};let A=new Map;for(let[G,z]of Object.entries(j.placeholders))if(z.expression)try{let w=W(z.expression,J);if(z.type==="raw")A.set(G,w!==void 0&&w!==null?String(w):"");else A.set(G,w!==void 0&&w!==null?U(String(w)):"")}catch{A.set(G,"")}return{html:R(j.html,A),context:J}}async function y(j,N={}){if(!j.hasServerScripts&&!O(j.fragment))return j.fragment;let J={__filename:j.sourceFile,__dirname:j.sourceFile.replace(/[/\\][^/\\]+$/,""),...N};for(let G of j.serverScriptContent)try{await X(G,J,j.sourceFile)}catch(z){console.warn(`[stx] Server script error in ${j.sourceFile}:`,z)}if(!O(j.fragment))return j.fragment;let A=new Map;for(let[G,z]of Object.entries(j.placeholders))if(z.expression)try{let w=W(z.expression,J);if(z.type==="raw")A.set(G,w!==void 0&&w!==null?String(w):"");else A.set(G,w!==void 0&&w!==null?U(String(w)):"")}catch{A.set(G,"")}return R(j.fragment,A)}
3
- export{F as Li,V as Mi,y as Ni};
2
+ import{tr as U,zr as W}from"./chunk-1xz0w746.js";import{dt as X}from"./chunk-g1vt329s.js";import{du as R,eu as O}from"./chunk-hjm2xab3.js";import{pB as Q}from"./chunk-xv34zbp4.js";async function F(j,N={}){return(await _(j,N)).html}async function V(j,N={}){let{html:J,context:A}=await _(j,N),{extractStreamBoundaries:G}=await import("././streaming.js"),z=G(A),w=j.streamTemplates;if(w&&Object.keys(w).length>0){let{processDirectives:$}=await import("././process.js"),{defaultConfig:D}=await import("././config.js"),Y=A.streamBoundaries||{},I={...D,autoShell:!1},Z=Object.keys(w).map((K)=>({id:K,render:async()=>{let M=typeof Y[K]==="function"?await Y[K]():void 0;return $(w[K],{...A,$boundary:M},j.sourceFile,I,new Set)}})),L=new Set(Z.map((K)=>K.id));z=[...(z||[]).filter((K)=>!L.has(K.id)),...Z]}return{html:J,boundaries:z&&z.length>0?z:void 0}}async function _(j,N){let J={__filename:j.sourceFile,__dirname:j.sourceFile.replace(/[/\\][^/\\]+$/,""),...N};if(!j.hasServerScripts&&!O(j.html))return{html:j.html,context:J};for(let G of j.serverScriptContent)try{await X(G,J,j.sourceFile)}catch(z){console.warn(`[stx] Server script error in ${j.sourceFile}:`,z)}if(!O(j.html))return{html:j.html,context:J};let A=new Map;for(let[G,z]of Object.entries(j.placeholders))if(z.expression)try{let w=W(z.expression,J);if(z.type==="raw")A.set(G,w!==void 0&&w!==null?String(w):"");else A.set(G,w!==void 0&&w!==null?U(String(w)):"")}catch{A.set(G,"")}return{html:R(j.html,A),context:J}}async function y(j,N={}){if(!j.hasServerScripts&&!O(j.fragment))return j.fragment;let J={__filename:j.sourceFile,__dirname:j.sourceFile.replace(/[/\\][^/\\]+$/,""),...N};for(let G of j.serverScriptContent)try{await X(G,J,j.sourceFile)}catch(z){console.warn(`[stx] Server script error in ${j.sourceFile}:`,z)}if(!O(j.fragment))return j.fragment;let A=new Map;for(let[G,z]of Object.entries(j.placeholders))if(z.expression)try{let w=W(z.expression,J);if(z.type==="raw")A.set(G,w!==void 0&&w!==null?String(w):"");else A.set(G,w!==void 0&&w!==null?U(String(w)):"")}catch{A.set(G,"")}return R(j.fragment,A)}
3
+ export{F as Oi,V as Pi,y as Qi};
@@ -57,4 +57,4 @@ ${j.inlineScript}
57
57
  <!-- Custom Analytics -->
58
58
  <script${w.length>0?` ${w.join(" ")}`:""} src="${J(j.scriptUrl)}" defer></script>
59
59
  `}function Y(q,j){let w=N(j);if(!w)return q;if(!q.includes("</head>")){let K=q.lastIndexOf("</body>");if(K!==-1)return q.slice(0,K)+w+q.slice(K);return q+w}return q.replace("</head>",`${w}</head>`)}function J(q){return q.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var Z={name:"analytics",hasEndTag:!1,handler:async(q,j,w,K)=>{let z=w.__stx_config||{};return N(z)}};
60
- export{N as mA,Y as nA,Z as oA};
60
+ export{N as kA,Y as lA,Z as mA};
@@ -18,4 +18,4 @@ ${_}
18
18
  `)}</p>`);if(j=D.join(`
19
19
  `),Q)j=j.replace(/\n/g,`<br />
20
20
  `);for(let q=0;q<O.length;q++)j=j.replace(`\x00CODEBLOCK${q}\x00`,O[q]);return j=j.replace(/<p>\s*<\/p>/g,""),j.trim()}
21
- export{A as gv,S as hv};
21
+ export{A as fv,S as gv};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Sr as E}from"./chunk-w01y57f5.js";import{rB as D}from"./chunk-3jm3snz8.js";import I from"path";async function M(q={}){let G=performance.now(),J=q.root||process.cwd(),j=await E(),y=j.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${y.toUpperCase()}${j.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let A,B;if(y==="ssg"){let{generateStaticSite:z}=await import("././ssg.js");A=await z({pagesDir:I.join(j.root||".",j.pagesDir||j.build?.pagesDir||"pages"),publicDir:j.publicDir||j.build?.publicDir||"public",outputDir:j.build?.outputDir||"dist",generate404:j.build?.generate404??!0,minify:j.build?.minify??!0,cleanOutput:j.build?.cleanOutput??!0,...q.ssg})}else{let{buildForProduction:z}=await import("././production-builder.js");B=await z({outputDir:".output",debug:q.debug,...q.ssr})}let H=Math.round(performance.now()-G);return{mode:y,ssg:A,ssr:B,duration:H}}
3
- export{M as Hp};
2
+ import{Rr as E}from"./chunk-1xz0w746.js";import{pB as D}from"./chunk-xv34zbp4.js";import I from"path";async function M(q={}){let G=performance.now(),J=q.root||process.cwd(),j=await E(),y=j.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${y.toUpperCase()}${j.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let A,B;if(y==="ssg"){let{generateStaticSite:z}=await import("././ssg.js");A=await z({pagesDir:I.join(j.root||".",j.pagesDir||j.build?.pagesDir||"pages"),publicDir:j.publicDir||j.build?.publicDir||"public",outputDir:j.build?.outputDir||"dist",generate404:j.build?.generate404??!0,minify:j.build?.minify??!0,cleanOutput:j.build?.cleanOutput??!0,...q.ssg})}else{let{buildForProduction:z}=await import("././production-builder.js");B=await z({outputDir:".output",debug:q.debug,...q.ssr})}let H=Math.round(performance.now()-G);return{mode:y,ssg:A,ssr:B,duration:H}}
3
+ export{M as Gp};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{fe as J}from"./chunk-0qnz93q2.js";import{rB as N}from"./chunk-3jm3snz8.js";import O from"fs";import z from"path";async function Q(A={}){console.log(`
2
+ import{fe as J}from"./chunk-0qnz93q2.js";import{pB as N}from"./chunk-xv34zbp4.js";import O from"fs";import z from"path";async function Q(A={}){console.log(`
3
3
  \uD83D\uDCD6 Previewing STX Story build...
4
4
  `);let g=await J({mode:"build"}),B=z.resolve(g.root,g.config.outDir),K=z.join(B,"index.html");try{await O.promises.access(K)}catch{console.log(` \u274C No build found at ${g.config.outDir}`),console.log(` Run "stx story build" first.
5
5
  `);return}let j=A.port??4173,L=Bun.serve({port:j,async fetch(k){let b=new URL(k.url).pathname;if(b==="/")b="/index.html";let G=z.join(B,b);try{let H=Bun.file(G);if(!await H.exists()){let M=`${G}.html`,I=Bun.file(M);if(await I.exists())return new Response(I);return new Response("Not found",{status:404})}return new Response(H)}catch{return new Response("Error",{status:500})}}});if(console.log(" \uD83D\uDCDA Preview server running at:"),console.log(` http://localhost:${j}
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ls as T,Rr as B}from"./chunk-w01y57f5.js";import{et as N}from"./chunk-nap11ntr.js";import{rB as M}from"./chunk-3jm3snz8.js";import O from"fs";import Z from"path";async function S(q,G={},z={}){let E=await Bun.file(q).text(),j=E.match(/<script\s+server\s*>([\s\S]*?)<\/script>/i),F=j?j[1]:"",J=j?E.replace(/<script\s+server\s*>[\s\S]*?<\/script>/i,""):E;J=J.replace(/<script\s+client\s*>/gi,"<script>");let K={__filename:q,__dirname:Z.dirname(q),props:G,...G};if(F)await N(F,K,q);let L={...B,...z};return await T(J,K,q,L,new Set)}async function y(q){let G=performance.now(),z={success:!0,views:[],errors:[],duration:0},{viewsDir:E,outputDir:j,componentsDir:F=Z.join(E,"components"),layoutsDir:J=Z.join(E,"layouts"),partialsDir:K=Z.join(E,"partials"),globalProps:L={},placeholders:Q={},views:U,debug:I=!1,generateManifest:R=!0}=q;if(I)console.log("Building STX views..."),console.log(` Source: ${E}`),console.log(` Output: ${j}`);O.mkdirSync(j,{recursive:!0});let A={componentsDir:F,layoutsDir:J,partialsDir:K,debug:I},_;if(U&&U.length>0)_=U;else _=O.readdirSync(E).filter((W)=>W.endsWith(".stx")).map((W)=>({input:W}));for(let H of _){let W=Z.join(E,H.input),X=H.output||H.input.replace(/\.stx$/,".html"),$=Z.join(j,X);if(I)console.log(` Building ${H.input}...`);try{let Y={...L,...H.props,...Q},k=await S(W,Y,A);await Bun.write($,k),z.views.push(X)}catch(Y){let k=Y instanceof Error?Y.message:String(Y);if(z.errors.push({file:H.input,error:k}),z.success=!1,I)console.error(` Error: ${k}`)}}if(R){let H={buildTime:new Date().toISOString(),views:z.views,placeholders:Q,errors:z.errors.length>0?z.errors:void 0};await Bun.write(Z.join(j,"manifest.json"),JSON.stringify(H,null,2))}if(z.duration=performance.now()-G,I)if(z.success)console.log(`
2
+ import{Ks as T,Qr as B}from"./chunk-1xz0w746.js";import{dt as N}from"./chunk-g1vt329s.js";import{pB as M}from"./chunk-xv34zbp4.js";import O from"fs";import Z from"path";async function S(q,G={},z={}){let E=await Bun.file(q).text(),j=E.match(/<script\s+server\s*>([\s\S]*?)<\/script>/i),F=j?j[1]:"",J=j?E.replace(/<script\s+server\s*>[\s\S]*?<\/script>/i,""):E;J=J.replace(/<script\s+client\s*>/gi,"<script>");let K={__filename:q,__dirname:Z.dirname(q),props:G,...G};if(F)await N(F,K,q);let L={...B,...z};return await T(J,K,q,L,new Set)}async function y(q){let G=performance.now(),z={success:!0,views:[],errors:[],duration:0},{viewsDir:E,outputDir:j,componentsDir:F=Z.join(E,"components"),layoutsDir:J=Z.join(E,"layouts"),partialsDir:K=Z.join(E,"partials"),globalProps:L={},placeholders:Q={},views:U,debug:I=!1,generateManifest:R=!0}=q;if(I)console.log("Building STX views..."),console.log(` Source: ${E}`),console.log(` Output: ${j}`);O.mkdirSync(j,{recursive:!0});let A={componentsDir:F,layoutsDir:J,partialsDir:K,debug:I},_;if(U&&U.length>0)_=U;else _=O.readdirSync(E).filter((W)=>W.endsWith(".stx")).map((W)=>({input:W}));for(let H of _){let W=Z.join(E,H.input),X=H.output||H.input.replace(/\.stx$/,".html"),$=Z.join(j,X);if(I)console.log(` Building ${H.input}...`);try{let Y={...L,...H.props,...Q},k=await S(W,Y,A);await Bun.write($,k),z.views.push(X)}catch(Y){let k=Y instanceof Error?Y.message:String(Y);if(z.errors.push({file:H.input,error:k}),z.success=!1,I)console.error(` Error: ${k}`)}}if(R){let H={buildTime:new Date().toISOString(),views:z.views,placeholders:Q,errors:z.errors.length>0?z.errors:void 0};await Bun.write(Z.join(j,"manifest.json"),JSON.stringify(H,null,2))}if(z.duration=performance.now()-G,I)if(z.success)console.log(`
3
3
  \u2705 Built ${z.views.length} views in ${z.duration.toFixed(0)}ms`);else console.log(`
4
4
  \u26A0\uFE0F Built ${z.views.length} views with ${z.errors.length} errors`);return z}function C(q,G){let z=O.watch(q.viewsDir,{recursive:!0},async(E,j)=>{if(!j)return;if(j.endsWith(".stx")||j.endsWith(".ts")||j.endsWith(".js")){if(q.debug)console.log(`
5
5
  File changed: ${j}, rebuilding...`);let F=await y(q);G?.(F)}});return{close:()=>z.close()}}async function g(q,G={},z={}){let E={...z,skipDefaultSeoTags:!0,skipSignalsRuntime:!0},j=await S(q,G,E);j=await x(j),j=j.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),j=j.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,""),j=j.replace(/<!--\s*stx SEO Tags\s*-->/gi,""),j=j.replace(/\n\s*\n\s*\n/g,`
@@ -9,4 +9,4 @@ File changed: ${j}, rebuilding...`);let F=await y(q);G?.(F)}});return{close:()=>
9
9
  `).replace(/<\/td>/gi,"\t").replace(/<[^>]*>/g,"").replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&copy;/g,"(c)").replace(/&middot;/g,"-").replace(/\n\s*\n\s*\n/g,`
10
10
 
11
11
  `).trim()}var u=y;
12
- export{S as Cq,y as Dq,C as Eq,g as Fq,u as Gq};
12
+ export{S as Bq,y as Cq,C as Dq,g as Eq,u as Fq};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ export{O as Wg};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  var O=new Set(["disabled","checked","readonly","required","autofocus","autoplay","controls","default","defer","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","reversed","selected"]);function L(k){if(typeof k==="string")return k;if(Array.isArray(k))return k.filter(Boolean).map((F)=>L(F)).join(" ");if(k&&typeof k==="object")return Object.entries(k).filter(([,F])=>F).map(([F])=>F).join(" ");return k?String(k):""}function B(k,F){if(!/:[\w-]+=/.test(k))return k;let Q=k,P=/<(script|style)\b[^>]*>[\s\S]*?<\/\1>/gi,E=[],q;while((q=P.exec(k))!==null)E.push([q.index,q.index+q[0].length]);function V(D){return E.some(([G,U])=>D>=G&&D<U)}let _=/<([a-zA-Z][a-zA-Z0-9-]*)((?:\s+(?:[^>"']|"[^"]*"|'[^']*'))*)\s*\/?>/g,Z=[];while((q=_.exec(Q))!==null){if(V(q.index))continue;let D=q[0],G=q[2];if(!G||!G.includes(":"))continue;let U=/\s:([a-zA-Z_][\w-]*)\s*=\s*"([^"]*)"/g,z,j=G,X=!1;while((z=U.exec(G))!==null){let I=z[1],H=z[2];if(H.includes("()")&&!H.includes(".get(")||H.includes("$store")||H.includes("$ref"))continue;try{let Y=Object.keys(F),K=Object.values(F),$=H.match(/^([a-zA-Z_$][\w$]*)/);if($&&!Y.includes($[1])&&!["true","false","null","undefined","Math","JSON","String","Number","Array","Object","Date","parseInt","parseFloat"].includes($[1]))continue;let J=Function(...Y,`return (${H})`)(...K);if(I==="class"){let W=L(J);if(W){let b=j.match(/\sclass="([^"]*)"/);if(b)j=j.replace(b[0],` class="${b[1]} ${W}"`);else j=j.replace(z[0],` class="${W}"`)}else j=j.replace(z[0],"");X=!0;continue}if(O.has(I)){if(J)j=j.replace(z[0],` ${I}`);else j=j.replace(z[0],"");X=!0;continue}if(J===null||J===void 0||J===!1)j=j.replace(z[0],"");else{let W=String(J).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;");j=j.replace(z[0],` ${I}="${W}"`)}X=!0}catch{continue}}if(X){let I=D.endsWith("/>")?" /":"",Y=`<${q[1]}${j}${I}>`;Z.push({start:q.index,end:q.index+D.length,replacement:Y})}}for(let D=Z.length-1;D>=0;D--){let{start:G,end:U,replacement:z}=Z[D];Q=Q.slice(0,G)+z+Q.slice(U)}return Q}
3
- export{B as Jt};
3
+ export{B as It};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
2
  var J=new WeakMap;function Q(j=16){let q=new Uint8Array(j);return crypto.getRandomValues(q),btoa(String.fromCharCode(...q))}function I(j,q){if(!j)return q?.nonceGenerator?.()??Q();let z=J.get(j);if(!z)z=q?.nonceGenerator?.()??Q(),J.set(j,z);return z}function A(j){J.delete(j)}function R(j,q){let z=[];for(let[F,E]of Object.entries(j)){if(E===void 0||E===null)continue;if(typeof E==="boolean"){if(E)z.push(F);continue}if(Array.isArray(E)){let B=[...E];if(q&&(F==="script-src"||F==="style-src"))B=B.filter((G)=>!G.startsWith("'nonce-")),B.push(`'nonce-${q}'`);if(B.length>0)z.push(`${F} ${B.join(" ")}`)}}return z.join("; ")}function L(j,q){return`<meta http-equiv="Content-Security-Policy" content="${R(j,q).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}">`}var X={"default-src":["'self'"],"script-src":["'self'","'strict-dynamic'"],"style-src":["'self'"],"img-src":["'self'","data:","https:"],"font-src":["'self'","https:","data:"],"connect-src":["'self'"],"media-src":["'self'"],"object-src":["'none'"],"frame-src":["'none'"],"base-uri":["'self'"],"form-action":["'self'"],"frame-ancestors":["'self'"],"upgrade-insecure-requests":!0},K={"default-src":["'self'"],"script-src":["'self'"],"style-src":["'self'","'unsafe-inline'"],"img-src":["'self'","data:","https:"],"font-src":["'self'","https:","data:"],"connect-src":["'self'","https:"],"media-src":["'self'"],"object-src":["'none'"],"frame-src":["'self'"],"base-uri":["'self'"],"form-action":["'self'"],"upgrade-insecure-requests":!0},Y={"default-src":["'self'"],"script-src":["'self'","'unsafe-inline'"],"style-src":["'self'","'unsafe-inline'"],"img-src":["'self'","data:","https:","http:"],"font-src":["'self'","https:","http:","data:"],"connect-src":["'self'","https:","http:","ws:","wss:"],"media-src":["'self'","https:","http:"],"object-src":["'none'"],"frame-src":["'self'","https:"],"base-uri":["'self'"]},Z={"default-src":["'none'"],"frame-ancestors":["'none'"]};function O(j){return{enabled:!0,directives:{strict:X,moderate:K,relaxed:Y,api:Z}[j]||K,useNonce:j==="strict",addMetaTag:!0}}function D(j,q){let z={...j};for(let[F,E]of Object.entries(q)){let B=F,G=z[B];if(E===void 0||E===null)continue;if(typeof E==="boolean")z[B]=G||E;else if(Array.isArray(E)){let U=Array.isArray(G)?G:[],W=[...new Set([...U,...E])];z[B]=W}}return z}function H(j,q,z){if(!q.enabled||!q.addMetaTag)return j;if(j.includes('http-equiv="Content-Security-Policy"'))return j;if(!j.includes("<head>")&&!j.includes("<head "))return j;let F=q.useNonce?I(z,q):void 0,E=L(q.directives,F);return j.replace(/<head([^>]*)>/,`<head$1>
3
3
  ${E}`)}function M(j,q){let z=j;return z=z.replace(/<script(?![^>]*\ssrc=)([^>]*)>/gi,(F,E)=>{if(E.includes("nonce="))return F;return`<script nonce="${q}"${E}>`}),z=z.replace(/<style([^>]*)>/gi,(F,E)=>{if(E.includes("nonce="))return F;return`<style nonce="${q}"${E}>`}),z}function S(j,q,z,F){let E=j,B=F.csp;if(E=E.replace(/@csp\b/g,()=>{if(!B?.enabled||!B.directives)return"<!-- CSP not configured -->";let G=B.useNonce?I(q,B):void 0;return L(B.directives,G)}),E=E.replace(/@cspNonce\b/g,()=>{if(!B?.enabled||!B.useNonce)return"";return I(q,B)}),B?.enabled&&B.useNonce)q.cspNonce=I(q,B);return E}var _={name:"csp",handler:(j,q,z,F)=>{let B=z.__stx_options?.csp;if(!B?.enabled||!B.directives)return"<!-- CSP not configured -->";let G=B.useNonce?I(z,B):void 0;return L(B.directives,G)},hasEndTag:!1,description:"Insert Content-Security-Policy meta tag"},$={name:"cspNonce",handler:(j,q,z,F)=>{let B=z.__stx_options?.csp;if(!B?.enabled||!B.useNonce)return"";return I(z,B)},hasEndTag:!1,description:"Output the current CSP nonce value"};function T(){return[_,$]}function V(j){let q=[];if(j["script-src"]?.includes("'unsafe-inline'"))q.push("CSP: Using unsafe-inline in script-src significantly reduces XSS protection");if(j["script-src"]?.includes("'unsafe-eval'"))q.push("CSP: Using unsafe-eval in script-src allows eval() and related functions");if(!j["default-src"])q.push("CSP: No default-src specified. Recommend adding default-src as a fallback");if(j["default-src"]?.includes("*"))q.push("CSP: Using * in default-src provides minimal protection");if(!j["object-src"]&&!j["default-src"]?.includes("'none'"))q.push("CSP: Consider adding object-src: none to block plugins");if(!j["base-uri"])q.push("CSP: Consider adding base-uri to prevent base tag injection attacks");for(let[z,F]of Object.entries(j))if(Array.isArray(F)&&F.includes("http:"))q.push(`CSP: Using http: in ${z} allows insecure resources`);return q}function k(j=!1){return j?"Content-Security-Policy-Report-Only":"Content-Security-Policy"}function y(j,q){if(!j.enabled)return{};let z=j.useNonce?I(q,j):void 0,F=R(j.directives,z);return{[k(j.reportOnly)]:F}}var P={enabled:!1,reportOnly:!1,directives:K,useNonce:!1,addMetaTag:!0};
4
- export{Q as _w,I as $w,A as ax,R as bx,L as cx,X as dx,K as ex,Y as fx,Z as gx,O as hx,D as ix,H as jx,M as kx,S as lx,_ as mx,$ as nx,T as ox,V as px,k as qx,y as rx,P as sx};
4
+ export{Q as Zw,I as _w,A as $w,R as ax,L as bx,X as cx,K as dx,Y as ex,Z as fx,O as gx,D as hx,H as ix,M as jx,S as kx,_ as lx,$ as mx,T as nx,V as ox,k as px,y as qx,P as rx};
@@ -3,4 +3,4 @@ function H(k,v){let z=k.url.replace(/\/$/,""),A=new Date().toISOString().slice(0
3
3
  `)}).join(`
4
4
  `),"</urlset>",""].join(`
5
5
  `)}function E(k){return k.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
6
- export{H as fh};
6
+ export{H as ih};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Ly as H}from"./chunk-fch9tk1k.js";import{Ty as A}from"./chunk-cz25azze.js";import K from"path";var I={showRelativePaths:!1,enableAutoRecovery:H(),logRecoveryWarnings:!0},B={...I};function W(j){B={...B,...j}}function X(){return{...B}}function Y(){B={...I}}function L(j){if(!B.showRelativePaths||!j)return j;let q=B.baseDir||process.cwd();try{let k=K.relative(q,j);return k.startsWith("..")?j:k}catch{return j}}class G extends Error{code;filePath;line;column;context;numericCode;constructor(j,q,k,w,y,z,J){super(j);this.code=q;this.filePath=k;this.line=w;this.column=y;this.context=z;if(this.name="StxError",this.numericCode=J||A.EVALUATION_ERROR,this.filePath)this.filePath=L(this.filePath)}}class M extends G{constructor(j,q,k,w,y,z){super(j,"stx_SYNTAX_ERROR",q,k,w,y,z||A.INVALID_DIRECTIVE_SYNTAX);this.name="StxSyntaxError"}}class N extends G{constructor(j,q,k,w,y,z){super(j,"stx_RUNTIME_ERROR",q,k,w,y,z||A.EVALUATION_ERROR);this.name="StxRuntimeError"}}class O extends G{constructor(j,q,k,w,y,z){super(j,"stx_SECURITY_ERROR",q,k,w,y,z||A.UNSAFE_EXPRESSION);this.name="StxSecurityError"}}class Q extends G{constructor(j,q,k,w,y,z){super(j,"stx_FILE_ERROR",q,k,w,y,z||A.FILE_NOT_FOUND);this.name="StxFileError"}}class R extends G{isFatal=!0;constructor(j,q,k,w,y,z){super(j,"stx_VALIDATION_ERROR",q,k,w,y,z||A.DOM_API_VIOLATION);this.name="StxValidationError"}}
3
- export{W as Ay,X as By,Y as Cy,L as Dy,G as Ey,M as Fy,N as Gy,O as Hy,Q as Iy,R as Jy};
2
+ import{Jy as H}from"./chunk-5shey2e4.js";import{Ry as A}from"./chunk-27zsyhrd.js";import K from"path";var I={showRelativePaths:!1,enableAutoRecovery:H(),logRecoveryWarnings:!0},B={...I};function W(j){B={...B,...j}}function X(){return{...B}}function Y(){B={...I}}function L(j){if(!B.showRelativePaths||!j)return j;let q=B.baseDir||process.cwd();try{let k=K.relative(q,j);return k.startsWith("..")?j:k}catch{return j}}class G extends Error{code;filePath;line;column;context;numericCode;constructor(j,q,k,w,y,z,J){super(j);this.code=q;this.filePath=k;this.line=w;this.column=y;this.context=z;if(this.name="StxError",this.numericCode=J||A.EVALUATION_ERROR,this.filePath)this.filePath=L(this.filePath)}}class M extends G{constructor(j,q,k,w,y,z){super(j,"stx_SYNTAX_ERROR",q,k,w,y,z||A.INVALID_DIRECTIVE_SYNTAX);this.name="StxSyntaxError"}}class N extends G{constructor(j,q,k,w,y,z){super(j,"stx_RUNTIME_ERROR",q,k,w,y,z||A.EVALUATION_ERROR);this.name="StxRuntimeError"}}class O extends G{constructor(j,q,k,w,y,z){super(j,"stx_SECURITY_ERROR",q,k,w,y,z||A.UNSAFE_EXPRESSION);this.name="StxSecurityError"}}class Q extends G{constructor(j,q,k,w,y,z){super(j,"stx_FILE_ERROR",q,k,w,y,z||A.FILE_NOT_FOUND);this.name="StxFileError"}}class R extends G{isFatal=!0;constructor(j,q,k,w,y,z){super(j,"stx_VALIDATION_ERROR",q,k,w,y,z||A.DOM_API_VIOLATION);this.name="StxValidationError"}}
3
+ export{W as yy,X as zy,Y as Ay,L as By,G as Cy,M as Dy,N as Ey,O as Fy,Q as Gy,R as Hy};
@@ -299,4 +299,4 @@ catch (error) {
299
299
  }
300
300
  })();
301
301
  </script>`}var N={name:"pwa.installButton",handler:(j,z,k,E)=>{let q=k.__stx_options||{};return H(j,q)},hasEndTag:!0,description:"Renders a PWA install prompt button that appears when the app can be installed"},Q={name:"pwa.updatePrompt",handler:(j,z,k,E)=>{let q=k.__stx_options||{};return J(j,q)},hasEndTag:!0,description:"Renders a PWA update notification UI when a new version is available"},T={name:"pwa.offlineIndicator",handler:(j,z,k,E)=>{let q=k.__stx_options||{};return L(j,q)},hasEndTag:!0,description:"Renders an offline status indicator that shows when the user loses connection"},V={name:"pwa.pushSubscribe",handler:(j,z,k,E)=>{let q=k.__stx_options||{};return M(j,q)},hasEndTag:!0,description:"Renders a push notification subscription button"},X=[N,Q,T,V];function Z(j){return[...j,...X]}
302
- export{N as Wt,Q as Xt,T as Yt,V as Zt,X as _t,Z as $t};
302
+ export{N as Vt,Q as Wt,T as Xt,V as Yt,X as Zt,Z as _t};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{aw as s,dw as a,ew as i}from"./chunk-bykjk6vj.js";import{hy as I}from"./chunk-mrehzhxv.js";import{Vy as c}from"./chunk-q60knhjf.js";import{rz as v}from"./chunk-adqh2m9z.js";import{rB as f}from"./chunk-3jm3snz8.js";import k from"path";import y from"process";function NQ(H){let Q=[],Z=0,z=H.split(`
2
+ import{$v as s,cw as a,dw as i}from"./chunk-pa9zb7ty.js";import{fy as I}from"./chunk-bs3gmfxz.js";import{Ty as c}from"./chunk-7ed3tean.js";import{pz as v}from"./chunk-w3b6m427.js";import{pB as f}from"./chunk-xv34zbp4.js";import k from"path";import y from"process";function NQ(H){let Q=[],Z=0,z=H.split(`
3
3
  `);for(let X of z){let Y=Z,$=null,_=!1;for(let J=0;J<X.length;J++){let G=X[J];if(_){_=!1;continue}if(G==="\\"){_=!0;continue}if($){if(G===$)$=null;continue}if(G==="'"||G==='"'||G==="`"){$=G;continue}if(G==="/"&&J+1<X.length&&X[J+1]==="/")break;if(G==="{")Z++;else if(G==="}")Z--}if(Y===0){let J=X.match(/(?:const|let|var)\s+(\w+)\s*=/);if(J)Q.push(J[1]);else if(/^\s*(?:const|let|var)\s+\w+\s*;?\s*$/.test(X)){let G=X.match(/(?:const|let|var)\s+(\w+)/);if(G)Q.push(G[1])}else{let G=X.match(/(?:const|let|var)\s+(\{[^}]+\}|\[[^\]]+\])\s*=/);if(G){let B=G[1].slice(1,-1).split(",").map((R)=>{let F=R.split(":");return(F.length>1?F[1]:F[0]).trim()}).filter((R)=>/^\w+$/.test(R));Q.push(...B)}}}}return[...new Set(Q)]}function EQ(H){let Q=H;Q=Q.replace(/^\s*import\s+.*?from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),Q=Q.replace(/^\s*import\s+['"][^'"]+['"]\s*;?\s*$/gm,""),Q=Q.replace(/^\s*interface\s+\w+\s*\{[\s\S]*?\n\}\s*$/gm,""),Q=Q.replace(/^\s*type\s+\w+\s*=[\s\S]*?(?=\n(?:const|let|var|function|export|interface|type|$))/gm,""),Q=Q.replace(/^(\s*(?:export\s+)?(?:const|let|var)\s+)(\w+|\{[^}]+\}|\[[^\]]+\])\s*:\s*[^=]+(\s*=)/gm,"$1$2$3");function Z(z){if(!z.includes(":"))return z;let X=[],Y="",$=0,_=0,J=null;for(let G=0;G<z.length;G++){let W=z[G];if(J){if(Y+=W,W===J)J=null;continue}if(W==='"'||W==="'"||W==="`"){J=W,Y+=W;continue}if(W==="<")$++;else if(W===">"&&$>0)$--;else if(W==="(")_++;else if(W===")")_--;if(W===","&&$===0&&_===0){X.push(Y),Y="";continue}Y+=W}if(Y)X.push(Y);return X.map((G)=>{let W=G.trim(),B=W.startsWith("..."),R=B?W.slice(3):W,F=-1,q=0;for(let N=0;N<R.length;N++)if(R[N]==="<")q++;else if(R[N]===">")q--;else if(R[N]===":"&&q===0){F=N;break}if(F===-1)return G;let M=R.substring(0,F).trim().replace(/\?$/,""),V=R.substring(F+1),b=-1,L=0;for(let N=0;N<V.length;N++)if(V[N]==="<")L++;else if(V[N]===">")L--;else if(V[N]==="="&&L===0){b=N;break}let D=B?"...":"";if(b!==-1)return`${D}${M} = ${V.substring(b+1).trim()}`;return`${D}${M}`}).join(", ")}Q=Q.replace(/\b(function\s+\w*\s*)\(([^)]*)\)/g,(z,X,Y)=>{if(!Y.includes(":"))return z;return`${X}(${Z(Y)})`});{let z=/\b(function\s+\w*\s*)\(/g,X,Y=[];while((X=z.exec(Q))!==null){let $=X.index+X[0].length-1,_=1,J=$+1,G=0,W=null;while(J<Q.length&&_>0){let F=Q[J];if(W){if(F===W)W=null;J++;continue}if(F==='"'||F==="'"||F==="`"){W=F,J++;continue}if(F==="<")G++;else if(F===">"&&G>0)G--;else if(G===0){if(F==="(")_++;else if(F===")")_--}if(_>0)J++}if(_!==0)continue;let B=Q.substring($+1,J);if(!B.includes(":"))continue;let R=Z(B);Y.push({start:$+1,end:J,replacement:R})}for(let $=Y.length-1;$>=0;$--){let{start:_,end:J,replacement:G}=Y[$];Q=Q.substring(0,_)+G+Q.substring(J)}}return Q=Q.replace(/\(([^)]*)\)\s*(?::\s*[^=]+)?\s*=>/g,(z,X)=>{if(!X.includes(":"))return z;if(X.includes("{")||X.includes("}"))return z;return`(${X.split(",").map(($)=>{let[_,...J]=$.split("="),G=_.split(":")[0].trim();if(J.length>0)return`${G} = ${J.join("=").trim()}`;return G}).join(", ")}) =>`}),Q=Q.replace(/(\))\s*:\s*([A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined)(?:<[^>]+>)?(?:\s*\|\s*(?:[A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined))*\s*(\{)/g,"$1$3"),Q=Q.replace(/(\b(?:function|class|interface|type|extends|implements)\s+\w+)\s*<[^<>()]*>/g,"$1"),Q=Q.replace(/(\b(?:defineProps|withDefaults|defineEmits|defineSlots|Array|Promise|Map|Set|Record|Partial|Required|Readonly|Pick|Omit|Exclude|Extract))\s*<[^<>()]*>/g,"$1"),Q=Q.replace(/(\w+)\s*<[A-Z][^<>()]*>\s*(?=\()/g,"$1"),Q=Q.replace(/\s+as\s+(?:const|[A-Za-z]\w*(?:\[\])?(?:\s*\|\s*\w+(?:\[\])?)*)/g,""),Q=Q.replace(/\s+satisfies\s+\w+(?:<[^>]*>)?/g,""),Q=Q.replace(/(\w|\)|\])\s*!(?!=)/g,"$1"),Q=Q.replace(/^\s*(?:export\s+)?(?:const\s+)?enum\s+\w+\s*\{[^}]*\}\s*$/gm,""),Q=Q.replace(/(?<=[\s=,(])<[A-Z]\w*(?:\[\])?>/g,""),Q=Q.replace(/\n\s*\n\s*\n/g,`
4
4
 
5
5
  `),Q}async function xQ(H,Q,Z,z={}){if(!H.trim())return;let X;try{let U=new Bun.Transpiler({loader:"ts",target:"browser",define:c()}),A=H.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");A=A.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,""),X=U.transformSync(A)}catch{X=EQ(H)}let Y={exports:{}},$=Y.exports,_=y.cwd(),J={},G=[...X.matchAll(/require\s*\(\s*['"]([^'"]+)['"]\s*\)/g)||[]].map((U)=>U[1]).filter((U)=>!U.startsWith("node:")&&!U.startsWith(".")&&!["fs","path","os","child_process","crypto","http","https","url","util","stream","events","buffer","net","querystring","zlib","tls"].includes(U));for(let U of G)try{let A=k.resolve(_,"node_modules",U),O=k.join(A,"package.json"),T=JSON.parse(f("fs").readFileSync(O,"utf8")),w=T.main||"index.js";if(T.exports){let j=typeof T.exports==="string"?T.exports:T.exports["."];if(typeof j==="string")w=j;else if(j?.bun)w=j.bun;else if(j?.import)w=j.import;else if(j?.default)w=j.default}J[U]=await import(k.resolve(A,w))}catch{}let W=(U)=>{if(J[U])return J[U];return f(U)},B=Q.props||{},R=(U)=>{if(!U)return B;let A={};for(let[O,T]of Object.entries(U)){let w=B[O];if(w!==void 0)A[O]=w;else if(typeof T==="function")A[O]=T();else A[O]=T}return A};for(let[U,A]of Object.entries(B))Object.defineProperty(R,U,{value:A,enumerable:!0,configurable:!0,writable:!0});let F=(U)=>{if(!U)return B;let A={...B};for(let[O,T]of Object.entries(U)){let w=T&&typeof T==="object"&&!Array.isArray(T)?T:{type:T};if(A[O]===void 0&&w.default!==void 0)A[O]=typeof w.default==="function"?w.default():w.default}return A},q=()=>Q.slots||{},E=(U,A)=>{let O={...U};for(let[T,w]of Object.entries(A))if(O[T]===void 0)if(typeof w==="function")O[T]=w();else O[T]=w;return O},M=(U)=>{let A=()=>U;return A.set=(O)=>{},A.update=(O)=>{},A},V=(U)=>{let A,O=!1;return()=>{if(!O)try{A=U(),O=!0}catch{A=void 0}return A}},b=(U)=>{},L=(U)=>U(),D=(U)=>{},N=(U)=>{},S=(U)=>{},e=()=>{let U=Q.__stxServeContext,A=Q.__stxServeSearch??U?.search??"",O=U?.path??"";return{params:Q.params??{},query:Object.fromEntries(new URLSearchParams(A)),path:O,name:"",fullPath:O+A,hash:"",matched:[]}},QQ=()=>({push:(U)=>{},replace:(U)=>{},back:()=>{},forward:()=>{},go:(U)=>{}}),XQ=(U)=>{a(U);let A=Q.__stx_runtime_head||{},O=U||{};Q.__stx_runtime_head={...A,...O.title&&{title:O.title},meta:[...A.meta||[],...O.meta||[]],link:[...A.link||[],...O.link||[]],script:[...A.script||[],...O.script||[]],htmlAttrs:{...A.htmlAttrs||{},...O.htmlAttrs||{}},bodyAttrs:{...A.bodyAttrs||{},...O.bodyAttrs||{}}}},YQ=(U)=>{i(U);let A=s();Q.__stx_runtime_head={...Q.__stx_runtime_head||{},...A.title&&{title:A.title},meta:A.meta?[...A.meta]:[]}},ZQ=(U)=>({value:U}),zQ=(U)=>U,GQ=(U)=>({value:typeof U==="function"?U():U}),$Q=(U,A)=>{},HQ=(U)=>{},UQ=(U)=>{},_Q=(U)=>U?U():Promise.resolve(),JQ=(U)=>(A,...O)=>{},WQ=(U)=>{},AQ=(U,A)=>{},BQ=(U,A)=>A,FQ=()=>({value:"light"}),OQ=()=>({value:!1}),C={siteId:void 0,API_ENDPOINT:"",ANALYTICS_SITE_ID:void 0,location:{href:"",pathname:"",search:"",hash:"",origin:"",host:"",hostname:"",protocol:"https:",assign:()=>{},replace:()=>{},reload:()=>{}},localStorage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{}},sessionStorage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{}},fetch:globalThis.fetch,addEventListener:()=>{},removeEventListener:()=>{},setTimeout:()=>0,clearTimeout:()=>{},setInterval:()=>0,clearInterval:()=>{},requestAnimationFrame:()=>0,cancelAnimationFrame:()=>{},alert:()=>{},confirm:()=>!1,prompt:()=>null,getComputedStyle:()=>({}),matchMedia:()=>({matches:!1,addListener:()=>{},removeListener:()=>{}}),getDateRangeParams:()=>"",stx:{}},RQ=new Proxy(C,{get(U,A){if(A in U)return U[A];return},set(U,A,O){return U[A]=O,!0}}),KQ={getElementById:()=>null,querySelector:()=>null,querySelectorAll:()=>[],createElement:()=>({}),createTextNode:()=>({}),body:{},head:{},documentElement:{},addEventListener:()=>{},removeEventListener:()=>{}},qQ=console;try{let U=MQ(X,Z),A=new Set(Object.keys(B)),O=Object.keys(Q).filter((K)=>!A.has(K)&&K!=="props"),T=O.map((K)=>Q[K]),w=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","finally","for","function","if","import","in","instanceof","let","new","return","super","switch","this","throw","try","typeof","var","void","while","with","yield","enum","await","async","module","exports","require","params","window","document","console","state","derived","effect"]),j=[],x=[];for(let[K,P]of Object.entries(B)){if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(K))continue;if(w.has(K))continue;if(new RegExp(`(?:^|[\\s;{])(?:const|let|var|function)\\s+${K}\\b`).test(U))continue;j.push(K),x.push(P)}let TQ=NQ(U).map((K)=>`module.exports.${K} = typeof ${K} !== 'undefined' ? ${K} : module.exports.${K};`).join(`
@@ -18,4 +18,4 @@ ${H[J]}`,J++;else break}return _=_.trim().replace(/;$/,""),{type:X,name:Y,value:
18
18
  ${Y}`,X++}while(X<H.length){let Y=H[X].trim();if(Y.startsWith(".")||Y.startsWith("?."))z+=`
19
19
  ${H[X]}`,X++;else break}return{value:z,nextIndex:X}}function LQ(H,Q,Z){let z=Z,X=Q+1;while(X<H.length){let Y=z.indexOf("{");if(Y!==-1){if(I(z,"{","}",Y)!==-1)break}let $=H[X];z+=`
20
20
  ${$}`,X++}return{functionCode:z,nextIndex:X}}function o(H,Q){let Z=v(H,Q)??v(`(${H})`,Q);if(Z!==void 0)return Z;if(!/\bprocess\b/.test(H))return;let z={...Q,process:Object.freeze({env:{...y.env}})};try{return Function(...Object.keys(z),`'use strict'; return (${H});`)(...Object.values(z))}catch{try{return Function(...Object.keys(z),`'use strict'; return ${H};`)(...Object.values(z))}catch{return}}}async function DQ(H,Q,Z){let z=H.matchAll(/export\s+(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:export\s+|$))/g);for(let Y of z){let[,,$,_]=Y;try{let J=_.trim().replace(/;$/,""),G=o(J,Q);if(G!==void 0)Q[$]=G}catch(J){console.warn(`Failed to parse export ${$} in fallback:`,J)}}let X=H.matchAll(/(?:^|\n)\s*(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:(?:const|let|var|function|export)\s+|$))/g);for(let Y of X){let[,,$,_]=Y;if(!($ in Q))try{let J=_.trim().replace(/;$/,""),G=o(J,Q);if(G!==void 0)Q[$]=G}catch{}}}function hQ(H){let Q=H.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),Z=Q?Q[1]:"",z=Q?H.replace(/<script\b[^>]*>[\s\S]*?<\/script>/i,""):H;return{scriptContent:Z,templateWithoutScript:z}}function mQ(H){let Q=H.trim();if(!Q)return!1;return/(?:const|let|var|function)\s+\w+/.test(Q)}
21
- export{EQ as dt,xQ as et,MQ as ft,hQ as gt,mQ as ht};
21
+ export{EQ as ct,xQ as dt,MQ as et,hQ as ft,mQ as gt};
@@ -20,4 +20,4 @@ function E(b){return b.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/
20
20
  </script>
21
21
  </body>
22
22
  </html>`}
23
- export{K as mg};
23
+ export{K as pg};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  function t(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
3
- export{t as iz};
3
+ export{t as gz};
@@ -289,4 +289,4 @@ else {
289
289
  pointer-events: none;
290
290
  }
291
291
  `.trim();return{html:X,script:Y,css:Z}}function M(j){return j.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function _(j){return j.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function $(j){if(j<1024)return`${j} B`;if(j<1048576)return`${(j/1024).toFixed(1)} KB`;return`${(j/1048576).toFixed(1)} MB`}
292
- export{g as uj};
292
+ export{g as xj};
@@ -144,4 +144,4 @@ var N=new Map,Q=new Map;function T(A){if(N.set(A.name,A),A.client)Q.set(A.name,A
144
144
  console.log('[stx] Directive runtime initialized');
145
145
  })();
146
146
  `}function $(A){let B=/v-(\w+)(?::(\w+))?(?:\.([\w.]+))?="([^"]*)"/g;return A.replace(B,(C,F,H,L,J)=>{let E=(L?L.split("."):[]).reduce((M,S)=>{return M[S]=!0,M},{});return`data-stx-directive="${F}:${J}" data-stx-directive-arg="${H||""}" data-stx-directive-modifiers='${JSON.stringify(E)}'`})}
147
- export{T as uw,V as vw,W as ww,X as xw,G as yw,Y as zw,Z as Aw,_ as Bw,$ as Cw};
147
+ export{T as tw,V as uw,W as vw,X as ww,G as xw,Y as yw,Z as zw,_ as Aw,$ as Bw};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{be as J}from"./chunk-05hgyyqc.js";import{fe as H}from"./chunk-0qnz93q2.js";import{rB as I}from"./chunk-3jm3snz8.js";async function P(j={}){let{describe:A,test:z,expect:k}=await import("bun:test"),D=await H({mode:"build"});A("STX Story Visual Tests",()=>{z("should pass visual regression tests",async()=>{let q=await J(D,{filter:j.filter,threshold:j.threshold,update:j.update});if(console.log(`
2
+ import{be as J}from"./chunk-hc2mf5h6.js";import{fe as H}from"./chunk-0qnz93q2.js";import{pB as I}from"./chunk-xv34zbp4.js";async function P(j={}){let{describe:A,test:z,expect:k}=await import("bun:test"),D=await H({mode:"build"});A("STX Story Visual Tests",()=>{z("should pass visual regression tests",async()=>{let q=await J(D,{filter:j.filter,threshold:j.threshold,update:j.update});if(console.log(`
3
3
  Visual Tests: ${q.passed}/${q.total} passed`),q.failed>0){console.log(`
4
4
  Failed tests:`);for(let E of q.failures)console.log(` \u2717 ${E.storyId} - ${E.variantId}`),console.log(` Difference: ${(E.difference??0).toFixed(2)}%`)}k(q.failed).toBe(0)},j.timeout||30000)})}async function Q(j={}){let{describe:A,test:z,expect:k}=await import("bun:test"),D=await H({mode:"build"}),{scanStoryFiles:q}=await import("./story/collect/scanner.js"),E=await q(D);A("STX Stories",()=>{for(let G of E){if(j.filter&&j.filter.length>0){if(!j.filter.some((K)=>G.fileName.toLowerCase().includes(K.toLowerCase())))continue}A(G.fileName,()=>{if(z("should render without errors",async()=>{let B=await Bun.file(G.path).text();k(B).toBeTruthy(),k(B.length).toBeGreaterThan(0)}),G.story)for(let B of G.story.variants)z(`variant: ${B.title}`,async()=>{if(k(B.title).toBeTruthy(),B.source)k(B.source.length).toBeGreaterThan(0)})})}})}async function L(j={}){let A=Date.now(),z=await H({mode:"build"}),k=await J(z,{filter:j.filter,threshold:j.threshold,update:j.update});return{passed:k.passed,failed:k.failed,total:k.total,duration:Date.now()-A}}function R(j){return`/**
5
5
  * Auto-generated story tests
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Rs as $}from"./chunk-w01y57f5.js";import{ry as Z}from"./chunk-jjvp4t5w.js";import{Ty as Y}from"./chunk-cz25azze.js";import{wz as _}from"./chunk-adqh2m9z.js";function A(L,K){let H={},B=L.trim();if(B.startsWith("{"))B=B.slice(1);if(B.endsWith("}"))B=B.slice(0,-1);if(B=B.trim(),!B)return H;let z=0;while(z<B.length){while(z<B.length&&/\s/.test(B[z]))z++;if(z>=B.length)break;let I="";if(B[z]==='"'||B[z]==="'"){let F=B[z];z++;while(z<B.length&&B[z]!==F)if(B[z]==="\\"&&z+1<B.length)I+=B[z+1],z+=2;else I+=B[z],z++;z++}else while(z<B.length&&/[\w$]/.test(B[z]))I+=B[z],z++;while(z<B.length&&/\s/.test(B[z]))z++;if(B[z]===":")z++;while(z<B.length&&/\s/.test(B[z]))z++;let G,Q=z;if(B[z]==='"'||B[z]==="'"){let F=B[z];z++;let M="";while(z<B.length&&B[z]!==F)if(B[z]==="\\"&&z+1<B.length)M+=B[z+1],z+=2;else M+=B[z],z++;z++,G=M}else if(B[z]==="{"){let F=1;z++;while(z<B.length&&F>0){if(B[z]==="{")F++;else if(B[z]==="}")F--;else if(B[z]==='"'||B[z]==="'"){let J=B[z];z++;while(z<B.length&&B[z]!==J){if(B[z]==="\\")z++;z++}}z++}let M=B.slice(Q,z);G=A(M,K)}else if(B[z]==="["){let F=1;z++;while(z<B.length&&F>0){if(B[z]==="[")F++;else if(B[z]==="]")F--;else if(B[z]==='"'||B[z]==="'"){let J=B[z];z++;while(z<B.length&&B[z]!==J){if(B[z]==="\\")z++;z++}}z++}let M=B.slice(Q,z);try{G=JSON.parse(M.replace(/'/g,'"'))}catch{G=M}}else{let F="";while(z<B.length&&B[z]!==","&&!/\s/.test(B[z]))F+=B[z],z++;if(F=F.trim(),F==="true")G=!0;else if(F==="false")G=!1;else if(F==="null")G=null;else if(F==="undefined")G=void 0;else if(/^-?\d+(\.\d+)?$/.test(F))G=Number(F);else if(F in K)G=K[F];else G=F}if(I)H[I]=G;while(z<B.length&&/\s/.test(B[z]))z++;if(B[z]===",")z++}return H}function D(L,K,H){let B=[];for(let[z,I]of Object.entries(K)){let G=L[z];if(I.required&&(G===void 0||G===null)){B.push(`Component "${H}": Missing required prop "${z}"`);continue}if(G===void 0||G===null)continue;let Q=Array.isArray(I.type)?I.type:[I.type];if(!Q.includes("any")){let F=O(G);if(!Q.includes(F))B.push(`Component "${H}": Prop "${z}" expected ${Q.join(" | ")}, got ${F}`)}if(I.validator&&!I.validator(G))B.push(`Component "${H}": Prop "${z}" failed custom validation`)}return B}function T(L,K){let H={...L};for(let[B,z]of Object.entries(K))if(H[B]===void 0&&z.default!==void 0)H[B]=typeof z.default==="function"?z.default():z.default;return H}function O(L){if(Array.isArray(L))return"array";if(L===null)return"null";return typeof L}var R={name:"component",handler:async(L,K,H,B)=>{if(K.length<1)return Z("Component","component directive requires at least the component name",Y.INVALID_DIRECTIVE_SYNTAX);let z=K[0].replace(/['"]/g,""),I={};if(K.length>1)try{let J=K.slice(1).join(",").trim();if(J.startsWith("{")){if(I=_(J,H),Object.keys(I).length===0)I=A(J,H)}else{let U=J.trim(),X=H[U];if(X&&typeof X==="object"&&!Array.isArray(X))I=X}}catch(J){let U=J instanceof Error?J.message:String(J);return console.error("Component props parsing error:",U),Z("Component",`Error parsing component props: ${U}`,Y.EVALUATION_ERROR)}let G=H.__stx_options||{},Q=G.componentsDir||"components",F=new Set;if(!H.__processedComponents)H.__processedComponents=new Set;let M=H.__processedComponents;try{return await $(z,I,"",Q,H,B,G,M,F)}catch(J){console.error("Component rendering error:",J);let U=J instanceof Error?J.message:String(J);return Z("Component",`Error rendering component: ${U}`,Y.COMPONENT_RENDER_ERROR)}},hasEndTag:!1};function q(){return[R]}
3
- export{D as gp,T as hp,R as ip,q as jp};
2
+ import{Qs as $}from"./chunk-1xz0w746.js";import{py as Z}from"./chunk-zen6ax1y.js";import{Ry as Y}from"./chunk-27zsyhrd.js";import{uz as _}from"./chunk-w3b6m427.js";function A(L,K){let H={},B=L.trim();if(B.startsWith("{"))B=B.slice(1);if(B.endsWith("}"))B=B.slice(0,-1);if(B=B.trim(),!B)return H;let z=0;while(z<B.length){while(z<B.length&&/\s/.test(B[z]))z++;if(z>=B.length)break;let I="";if(B[z]==='"'||B[z]==="'"){let F=B[z];z++;while(z<B.length&&B[z]!==F)if(B[z]==="\\"&&z+1<B.length)I+=B[z+1],z+=2;else I+=B[z],z++;z++}else while(z<B.length&&/[\w$]/.test(B[z]))I+=B[z],z++;while(z<B.length&&/\s/.test(B[z]))z++;if(B[z]===":")z++;while(z<B.length&&/\s/.test(B[z]))z++;let G,Q=z;if(B[z]==='"'||B[z]==="'"){let F=B[z];z++;let M="";while(z<B.length&&B[z]!==F)if(B[z]==="\\"&&z+1<B.length)M+=B[z+1],z+=2;else M+=B[z],z++;z++,G=M}else if(B[z]==="{"){let F=1;z++;while(z<B.length&&F>0){if(B[z]==="{")F++;else if(B[z]==="}")F--;else if(B[z]==='"'||B[z]==="'"){let J=B[z];z++;while(z<B.length&&B[z]!==J){if(B[z]==="\\")z++;z++}}z++}let M=B.slice(Q,z);G=A(M,K)}else if(B[z]==="["){let F=1;z++;while(z<B.length&&F>0){if(B[z]==="[")F++;else if(B[z]==="]")F--;else if(B[z]==='"'||B[z]==="'"){let J=B[z];z++;while(z<B.length&&B[z]!==J){if(B[z]==="\\")z++;z++}}z++}let M=B.slice(Q,z);try{G=JSON.parse(M.replace(/'/g,'"'))}catch{G=M}}else{let F="";while(z<B.length&&B[z]!==","&&!/\s/.test(B[z]))F+=B[z],z++;if(F=F.trim(),F==="true")G=!0;else if(F==="false")G=!1;else if(F==="null")G=null;else if(F==="undefined")G=void 0;else if(/^-?\d+(\.\d+)?$/.test(F))G=Number(F);else if(F in K)G=K[F];else G=F}if(I)H[I]=G;while(z<B.length&&/\s/.test(B[z]))z++;if(B[z]===",")z++}return H}function D(L,K,H){let B=[];for(let[z,I]of Object.entries(K)){let G=L[z];if(I.required&&(G===void 0||G===null)){B.push(`Component "${H}": Missing required prop "${z}"`);continue}if(G===void 0||G===null)continue;let Q=Array.isArray(I.type)?I.type:[I.type];if(!Q.includes("any")){let F=O(G);if(!Q.includes(F))B.push(`Component "${H}": Prop "${z}" expected ${Q.join(" | ")}, got ${F}`)}if(I.validator&&!I.validator(G))B.push(`Component "${H}": Prop "${z}" failed custom validation`)}return B}function T(L,K){let H={...L};for(let[B,z]of Object.entries(K))if(H[B]===void 0&&z.default!==void 0)H[B]=typeof z.default==="function"?z.default():z.default;return H}function O(L){if(Array.isArray(L))return"array";if(L===null)return"null";return typeof L}var R={name:"component",handler:async(L,K,H,B)=>{if(K.length<1)return Z("Component","component directive requires at least the component name",Y.INVALID_DIRECTIVE_SYNTAX);let z=K[0].replace(/['"]/g,""),I={};if(K.length>1)try{let J=K.slice(1).join(",").trim();if(J.startsWith("{")){if(I=_(J,H),Object.keys(I).length===0)I=A(J,H)}else{let U=J.trim(),X=H[U];if(X&&typeof X==="object"&&!Array.isArray(X))I=X}}catch(J){let U=J instanceof Error?J.message:String(J);return console.error("Component props parsing error:",U),Z("Component",`Error parsing component props: ${U}`,Y.EVALUATION_ERROR)}let G=H.__stx_options||{},Q=G.componentsDir||"components",F=new Set;if(!H.__processedComponents)H.__processedComponents=new Set;let M=H.__processedComponents;try{return await $(z,I,"",Q,H,B,G,M,F)}catch(J){console.error("Component rendering error:",J);let U=J instanceof Error?J.message:String(J);return Z("Component",`Error rendering component: ${U}`,Y.COMPONENT_RENDER_ERROR)}},hasEndTag:!1};function q(){return[R]}
3
+ export{D as fp,T as gp,R as hp,q as ip};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{ry as U}from"./chunk-jjvp4t5w.js";import{Ty as v}from"./chunk-cz25azze.js";import{wz as D}from"./chunk-adqh2m9z.js";function P(F,z,V,Y){let G=F;G=G.replace(/@meta\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"]\s*)?\)/g,($,N,A)=>{if(!A&&N.includes(":")){let Z=N.split(":"),q=N,B=Z.length>1?Z[1]:"";if(B&&z[B])A=z[B];else if(q.startsWith("og:")&&z.openGraph&&z.openGraph[Z[1]])A=z.openGraph[Z[1]];else A="";return A?`<meta property="${J(q)}" content="${J(A)}">`:""}return A?`<meta name="${J(N)}" content="${J(A)}">`:""});let I=/@metaTag\s*\(/g,_;while((_=I.exec(G))!==null){let $=_.index,N=$+_[0].length-1,A=1,Z=N+1;while(Z<G.length&&A>0){if(G[Z]==="(")A++;else if(G[Z]===")"){if(A--,A===0)break}Z++}if(A!==0)break;let q=G.substring(N+1,Z).trim(),B=Z+1,L=(()=>{try{let R=D(q,z);if(!R)return"";let j="<meta";if(R.name)j+=` name="${J(String(R.name))}"`;if(R.property)j+=` property="${J(String(R.property))}"`;if(R.httpEquiv)j+=` http-equiv="${J(String(R.httpEquiv))}"`;if(R.content)j+=` content="${J(String(R.content))}"`;return j+=">",j}catch(R){let j=R instanceof Error?R.message:String(R);return U("MetaTag",j,v.EVALUATION_ERROR)}})();G=G.substring(0,$)+L+G.substring(B),I.lastIndex=0}return G}function y(F,z,V){let Y=F,G=/@structuredData\s*\(/g,I;while((I=G.exec(Y))!==null){let _=I.index,$=_+I[0].length-1,N=1,A=$+1;while(A<Y.length&&N>0){if(Y[A]==="(")N++;else if(Y[A]===")"){if(N--,N===0)break}A++}if(N!==0)break;let Z=Y.substring($+1,A).trim(),q=A+1,B=(()=>{try{let L=D(Z,z);if(!L)return"";if(!L["@context"])L["@context"]="https://schema.org";return`<script type="application/ld+json">${JSON.stringify(L).replace(/<\//g,"<\\/")}</script>`}catch(L){let R=L instanceof Error?L.message:String(L);return U("StructuredData",R,v.EVALUATION_ERROR)}})();Y=Y.substring(0,_)+B+Y.substring(q),G.lastIndex=0}return Y}function T(F,z,V,Y){let G=F,I=/@seo\s*\(\s*\{/g,_;while((_=I.exec(G))!==null){let $=G.indexOf("{",_.index+4),N=1,A=$+1,Z=null,q=!1;while(A<G.length&&N>0){let O=G[A];if(q){q=!1,A++;continue}if(O==="\\"&&Z){q=!0,A++;continue}if(Z){if(O===Z)Z=null;A++;continue}if(O==='"'||O==="'"||O==="`"){Z=O,A++;continue}if(O==="{")N++;else if(O==="}")N--;A++}if(N!==0)break;let B=G.substring(A).match(/^\s*\)/);if(!B)break;let L=A+B[0].length,R=G.substring($,A),j=G.substring(_.index,L),X=((O)=>{try{let Q=D(O,z);if(!Q)return"";let k="";if(Q.title)k+=`<title>${J(Q.title)}</title>
2
+ import{py as U}from"./chunk-zen6ax1y.js";import{Ry as v}from"./chunk-27zsyhrd.js";import{uz as D}from"./chunk-w3b6m427.js";function P(F,z,V,Y){let G=F;G=G.replace(/@meta\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"]\s*)?\)/g,($,N,A)=>{if(!A&&N.includes(":")){let Z=N.split(":"),q=N,B=Z.length>1?Z[1]:"";if(B&&z[B])A=z[B];else if(q.startsWith("og:")&&z.openGraph&&z.openGraph[Z[1]])A=z.openGraph[Z[1]];else A="";return A?`<meta property="${J(q)}" content="${J(A)}">`:""}return A?`<meta name="${J(N)}" content="${J(A)}">`:""});let I=/@metaTag\s*\(/g,_;while((_=I.exec(G))!==null){let $=_.index,N=$+_[0].length-1,A=1,Z=N+1;while(Z<G.length&&A>0){if(G[Z]==="(")A++;else if(G[Z]===")"){if(A--,A===0)break}Z++}if(A!==0)break;let q=G.substring(N+1,Z).trim(),B=Z+1,L=(()=>{try{let R=D(q,z);if(!R)return"";let j="<meta";if(R.name)j+=` name="${J(String(R.name))}"`;if(R.property)j+=` property="${J(String(R.property))}"`;if(R.httpEquiv)j+=` http-equiv="${J(String(R.httpEquiv))}"`;if(R.content)j+=` content="${J(String(R.content))}"`;return j+=">",j}catch(R){let j=R instanceof Error?R.message:String(R);return U("MetaTag",j,v.EVALUATION_ERROR)}})();G=G.substring(0,$)+L+G.substring(B),I.lastIndex=0}return G}function y(F,z,V){let Y=F,G=/@structuredData\s*\(/g,I;while((I=G.exec(Y))!==null){let _=I.index,$=_+I[0].length-1,N=1,A=$+1;while(A<Y.length&&N>0){if(Y[A]==="(")N++;else if(Y[A]===")"){if(N--,N===0)break}A++}if(N!==0)break;let Z=Y.substring($+1,A).trim(),q=A+1,B=(()=>{try{let L=D(Z,z);if(!L)return"";if(!L["@context"])L["@context"]="https://schema.org";return`<script type="application/ld+json">${JSON.stringify(L).replace(/<\//g,"<\\/")}</script>`}catch(L){let R=L instanceof Error?L.message:String(L);return U("StructuredData",R,v.EVALUATION_ERROR)}})();Y=Y.substring(0,_)+B+Y.substring(q),G.lastIndex=0}return Y}function T(F,z,V,Y){let G=F,I=/@seo\s*\(\s*\{/g,_;while((_=I.exec(G))!==null){let $=G.indexOf("{",_.index+4),N=1,A=$+1,Z=null,q=!1;while(A<G.length&&N>0){let O=G[A];if(q){q=!1,A++;continue}if(O==="\\"&&Z){q=!0,A++;continue}if(Z){if(O===Z)Z=null;A++;continue}if(O==='"'||O==="'"||O==="`"){Z=O,A++;continue}if(O==="{")N++;else if(O==="}")N--;A++}if(N!==0)break;let B=G.substring(A).match(/^\s*\)/);if(!B)break;let L=A+B[0].length,R=G.substring($,A),j=G.substring(_.index,L),X=((O)=>{try{let Q=D(O,z);if(!Q)return"";let k="";if(Q.title)k+=`<title>${J(Q.title)}</title>
3
3
  `,k+=`<meta name="title" content="${J(Q.title)}">
4
4
  `;if(Q.description)k+=`<meta name="description" content="${J(Q.description)}">
5
5
  `;if(Q.keywords){let W=Array.isArray(Q.keywords)?Q.keywords.join(", "):Q.keywords;k+=`<meta name="keywords" content="${J(W)}">
@@ -55,4 +55,4 @@ ${F.map((I)=>{let _=I.startsWith("http")?I:`${V}${I.startsWith("/")?"":"/"}${I}`
55
55
  `)}
56
56
  </sitemapindex>`}async function d(F,z){let{extensions:V=[".stx",".html",".htm"],ignore:Y=["_*",".*","node_modules","components","partials","layouts"]}=z,G=[],I=V.length===1?`*${V[0]}`:`*{${V.join(",")}}`,_=new Bun.Glob(`**/${I}`);for await(let $ of _.scan(F)){if(Y.some((B)=>{if(B.startsWith("*"))return $.includes(B.slice(1));return $.startsWith(B)||$.includes(`/${B}`)}))continue;let A=$.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!A.startsWith("/"))A=`/${A}`;if(A!=="/"&&A.endsWith("/"))A=A.slice(0,-1);let Z=`${F}/${$}`,q;try{let B=await Bun.file(Z).stat();if(B)q=new Date(B.mtime).toISOString().split("T")[0]}catch{}G.push({loc:A||"/",lastmod:q,priority:A==="/"?1:0.5})}return G.sort(($,N)=>$.loc.localeCompare(N.loc)),G}function b(F){let z=[];for(let V of F.rules){if(z.push(`User-agent: ${V.userAgent}`),V.allow)for(let Y of V.allow)z.push(`Allow: ${Y}`);if(V.disallow)for(let Y of V.disallow)z.push(`Disallow: ${Y}`);if(V.crawlDelay!==void 0)z.push(`Crawl-delay: ${V.crawlDelay}`);z.push("")}if(F.sitemap){let V=Array.isArray(F.sitemap)?F.sitemap:[F.sitemap];for(let Y of V)z.push(`Sitemap: ${Y}`)}if(F.host)z.push(`Host: ${F.host}`);return z.join(`
57
57
  `).trim()}function u(F){return b({rules:[{userAgent:"*",allow:["/"]}],sitemap:F})}function C(F){return F.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}
58
- export{P as xt,y as yt,T as zt,H as At,S as Bt,w as Ct,f as Dt,x as Et,h as Ft,d as Gt,b as Ht,u as It};
58
+ export{P as wt,y as xt,T as yt,H as zt,S as At,w as Bt,f as Ct,x as Dt,h as Et,d as Ft,b as Gt,u as Ht};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{eA as Q}from"./chunk-x64kb787.js";import O from"fs";import R from"path";async function U(j,b={}){let q=Date.now(),z={total:0,passed:0,failed:0,new:0,failures:[],duration:0},K=b.snapshotDir||R.join(j.root,".stx","story","snapshots");await O.promises.mkdir(K,{recursive:!0});let B=j.storyFiles;if(b.filter&&b.filter.length>0)B=B.filter((J)=>b.filter.some((G)=>J.fileName.toLowerCase().includes(G.toLowerCase())));for(let J of B)await W(J,K,b,z);return z.duration=Date.now()-q,z}async function W(j,b,q,z){let K=j.story;if(!K)return;for(let B of K.variants){z.total++;let J=R.join(b,`${j.id}-${B.id}.snap`),G=X(B.source||""),L=await Z(J);if(q.update||!L){let M={storyId:j.id,variantId:B.id,component:j.fileName,timestamp:Date.now(),hash:G};if(await O.promises.writeFile(J,JSON.stringify(M,null,2)),!L)z.new++;z.passed++}else try{let M=await O.promises.readFile(J,"utf-8"),N=JSON.parse(M);if(N.hash===G)z.passed++;else z.failed++,z.failures.push({storyId:j.id,variantId:B.id,component:j.fileName,message:"Snapshot mismatch",difference:Y(N.hash,G)})}catch(M){z.failed++,z.failures.push({storyId:j.id,variantId:B.id,component:j.fileName,message:`Error reading snapshot: ${M}`})}}}async function k(j,b={}){return(await U(j,{...b,update:!0})).total}function X(j){let b=0;for(let q=0;q<j.length;q++){let z=j.charCodeAt(q);b=(b<<5)-b+z,b=b&b}return b.toString(16)}function Y(j,b){if(j===b)return 0;let q=Math.abs(Number.parseInt(j,16)-Number.parseInt(b,16));return Math.min(q/1e6,1)}async function Z(j){try{return await O.promises.access(j),!0}catch{return!1}}function w(j){let b=[];if(b.push(""),b.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),b.push(" STX Story Visual Regression Tests"),b.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),b.push(""),j.failures.length>0){b.push(" \u274C Failures:"),b.push("");for(let q of j.failures){if(b.push(` \u2022 ${q.component} / ${q.variantId}`),b.push(` ${q.message}`),q.difference!==void 0)b.push(` Difference: ${(q.difference*100).toFixed(2)}%`);b.push("")}}if(b.push(" Summary:"),b.push(` Total: ${j.total}`),b.push(` Passed: ${j.passed} \u2713`),b.push(` Failed: ${j.failed} \u2717`),j.new>0)b.push(` New: ${j.new} \u26A1`);return b.push(` Time: ${j.duration}ms`),b.push(""),b.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),b.push(""),b.join(`
2
+ import{cA as Q}from"./chunk-35faj94w.js";import O from"fs";import R from"path";async function U(j,b={}){let q=Date.now(),z={total:0,passed:0,failed:0,new:0,failures:[],duration:0},K=b.snapshotDir||R.join(j.root,".stx","story","snapshots");await O.promises.mkdir(K,{recursive:!0});let B=j.storyFiles;if(b.filter&&b.filter.length>0)B=B.filter((J)=>b.filter.some((G)=>J.fileName.toLowerCase().includes(G.toLowerCase())));for(let J of B)await W(J,K,b,z);return z.duration=Date.now()-q,z}async function W(j,b,q,z){let K=j.story;if(!K)return;for(let B of K.variants){z.total++;let J=R.join(b,`${j.id}-${B.id}.snap`),G=X(B.source||""),L=await Z(J);if(q.update||!L){let M={storyId:j.id,variantId:B.id,component:j.fileName,timestamp:Date.now(),hash:G};if(await O.promises.writeFile(J,JSON.stringify(M,null,2)),!L)z.new++;z.passed++}else try{let M=await O.promises.readFile(J,"utf-8"),N=JSON.parse(M);if(N.hash===G)z.passed++;else z.failed++,z.failures.push({storyId:j.id,variantId:B.id,component:j.fileName,message:"Snapshot mismatch",difference:Y(N.hash,G)})}catch(M){z.failed++,z.failures.push({storyId:j.id,variantId:B.id,component:j.fileName,message:`Error reading snapshot: ${M}`})}}}async function k(j,b={}){return(await U(j,{...b,update:!0})).total}function X(j){let b=0;for(let q=0;q<j.length;q++){let z=j.charCodeAt(q);b=(b<<5)-b+z,b=b&b}return b.toString(16)}function Y(j,b){if(j===b)return 0;let q=Math.abs(Number.parseInt(j,16)-Number.parseInt(b,16));return Math.min(q/1e6,1)}async function Z(j){try{return await O.promises.access(j),!0}catch{return!1}}function w(j){let b=[];if(b.push(""),b.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),b.push(" STX Story Visual Regression Tests"),b.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),b.push(""),j.failures.length>0){b.push(" \u274C Failures:"),b.push("");for(let q of j.failures){if(b.push(` \u2022 ${q.component} / ${q.variantId}`),b.push(` ${q.message}`),q.difference!==void 0)b.push(` Difference: ${(q.difference*100).toFixed(2)}%`);b.push("")}}if(b.push(" Summary:"),b.push(` Total: ${j.total}`),b.push(` Passed: ${j.passed} \u2713`),b.push(` Failed: ${j.failed} \u2717`),j.new>0)b.push(` New: ${j.new} \u26A1`);return b.push(` Time: ${j.duration}ms`),b.push(""),b.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),b.push(""),b.join(`
3
3
  `)}async function A(j,b={}){let q=performance.now(),z=[],K=0,B=0;for(let G of j.storyFiles)try{let L=await Bun.file(G.path).text(),M=await Q(L,G.path);if(M.length>0){for(let N of M)z.push({storyId:G.id,variantId:"default",component:G.component,message:`A11y: ${N.message}`,expected:"No accessibility violations",actual:`${N.type}: ${N.message} (impact: ${N.impact})`});B++}else K++}catch(L){z.push({storyId:G.id,variantId:"default",component:G.component,message:`Failed to check a11y: ${L instanceof Error?L.message:String(L)}`,expected:"File readable for a11y check",actual:"File read error"}),B++}let J=performance.now()-q;return{total:j.storyFiles.length,passed:K,failed:B,new:0,failures:z,duration:J}}
4
4
  export{U as be,k as ce,w as de,A as ee};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  var B=0,A=new Map;function F(){B=0,A.clear()}function G(b,q){let j=B++,w=`<!--__STX_${b.toUpperCase()}_${j}__-->`;return A.set(w,{type:b,expression:q}),w}function I(){let b={};for(let[q,j]of A)b[q]={type:j.type,expression:j.expression};return b}function J(b){let q={},j=/<!--__STX_(EXPR|COND|RAW)_(\d+)__-->/g,w;while((w=j.exec(b))!==null){let z=w[0],D=w[1].toLowerCase(),E=A.get(z);q[z]={type:D,expression:E?.expression||""}}return q}function K(b,q){let j=b;for(let[w,z]of q)j=j.split(w).join(z);return j}function N(b){return b.includes("<!--__STX_")}
3
- export{F as au,G as bu,I as cu,J as du,K as eu,N as fu};
3
+ export{F as $t,G as au,I as bu,J as cu,K as du,N as eu};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ss as J,Tr as H}from"./chunk-w01y57f5.js";import A from"fs";import $ from"path";async function B(z){try{let G=(await Bun.file(z).text()).match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(!G)return[];let K=G[1],q=[],j=/\/\*\*\s*([\s\S]*?)\s*\*\/\s*(?:(?:const|let|var)\s*)?(?:([\w$]+)\s*=|module\.exports\.([\w$]+)\s*=|\s*([\w$]+)\s*:)/g,O;while((O=j.exec(K))!==null){let Q=O[1],U=O[2]||O[3]||O[4];if(!U)continue;let V={name:U},X=Q.match(/@type\s+\{([^}]+)\}/i);if(X)V.type=X[1].trim();if(Q.match(/@required/i))V.required=!0;let S=Q.match(/@default\s+(.+?)(?:\s+|$)/i);if(S)V.default=S[1].trim();let _=Q.split(`
2
+ import{Rs as J,Sr as H}from"./chunk-1xz0w746.js";import A from"fs";import $ from"path";async function B(z){try{let G=(await Bun.file(z).text()).match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(!G)return[];let K=G[1],q=[],j=/\/\*\*\s*([\s\S]*?)\s*\*\/\s*(?:(?:const|let|var)\s*)?(?:([\w$]+)\s*=|module\.exports\.([\w$]+)\s*=|\s*([\w$]+)\s*:)/g,O;while((O=j.exec(K))!==null){let Q=O[1],U=O[2]||O[3]||O[4];if(!U)continue;let V={name:U},X=Q.match(/@type\s+\{([^}]+)\}/i);if(X)V.type=X[1].trim();if(Q.match(/@required/i))V.required=!0;let S=Q.match(/@default\s+(.+?)(?:\s+|$)/i);if(S)V.default=S[1].trim();let _=Q.split(`
3
3
  `).map((Z)=>Z.trim().replace(/^\*\s*/,"")).filter((Z)=>!Z.startsWith("@")&&Z.length>0);V.description=_.join(" ").trim(),q.push(V)}if(q.length===0){let Q=K.match(/module\.exports\s*=\s*\{([^}]+)\}/i);if(Q){let V=Q[1].split(",").map((X)=>X.trim()).filter(Boolean);for(let X of V){let[Y]=X.split(":").map((S)=>S.trim());if(Y)q.push({name:Y})}}}return q}catch(I){return console.error(`Error extracting props from ${z}:`,I),[]}}async function E(z){try{let I=await Bun.file(z).text(),G=I.match(/^\s*<!--\s*([\s\S]*?)\s*-->/)||I.match(/^\s*\/\*\*\s*([\s\S]*?)\s*\*\//);if(G)return G[1].split(`
4
4
  `).map((K)=>K.trim().replace(/^\*\s*/,"")).join(" ").trim();return""}catch{return""}}async function N(z,I=!1,G){let K=$.basename(z,".stx"),q=await B(z),j=await E(z),O="";if(I&&G)O=`<${G}></${G}>`;else{let Q=q.map((U)=>{if(U.type==="boolean")return`:${U.name}="true"`;return`${U.name}="value"`}).join(`
5
5
  `);O=`<${K}
@@ -139,4 +139,4 @@ import{Ss as J,Tr as H}from"./chunk-w01y57f5.js";import A from"fs";import $ from
139
139
  <td>${j.description||"-"}</td>
140
140
  <td>${j.hasEndTag?"Yes":"No"}</td>
141
141
  </tr>`;q+="</tbody></table>";for(let j of G)if(j.example)q+=`<h3>@${j.name}</h3>`,q+=`<p>${j.description||""}</p>`,q+="<h4>Example</h4>",q+=`<pre><code>${j.example.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}</code></pre>`}return q+="</body></html>",q}function u(z=[],I=[],G=[],K){return JSON.stringify({components:z,templates:I,directives:G,extraContent:K||""},null,2)}async function P(z){try{let{componentsDir:I,templatesDir:G,webComponentsConfig:K,customDirectives:q,config:j}=z;if(!j.enabled)return!1;let O=j.outputDir||"docs";if(await A.promises.mkdir(O,{recursive:!0}),console.log("Generating documentation..."),I)console.log(`Components directory: ${I}`);if(G)console.log(`Templates directory: ${G}`);console.log(`Output directory: ${O}`);let Q=[];if(j.components!==!1&&I)console.log("Generating component documentation..."),Q=await W(I,K),console.log(`Found ${Q.length} components`);let U=[];if(j.templates!==!1&&G)console.log("Generating template documentation..."),U=await F(G),console.log(`Found ${U.length} templates`);let V=[];if(j.directives!==!1)console.log("Generating directive documentation..."),V=await y(q),console.log(`Found ${V.length} directives`);let X=j.format||"markdown",Y=j.extraContent,S="",_="";switch(X){case"markdown":S=T(Q,U,V,Y),_="md";break;case"html":S=M(Q,U,V,Y),_="html";break;case"json":S=u(Q,U,V,Y),_="json";break;default:throw Error(`Unsupported documentation format: ${X}`)}let Z=$.join(O,`stx-docs.${_}`);return await Bun.write(Z,S),console.log(`Documentation generated: ${Z}`),!0}catch(I){return console.error("Error generating documentation:",I),!1}}async function g(z){let I={enabled:!0,outputDir:z.output||"docs",format:z.format||"markdown",components:z.components!==!1,templates:z.templates!==!1,directives:z.directives!==!1,extraContent:z.extraContent},G=z.componentsDir||H.componentsDir,K=z.templatesDir||".";return P({componentsDir:G,templatesDir:K,webComponentsConfig:H.webComponents,customDirectives:H.customDirectives,config:I})}
142
- export{B as an,E as bn,N as cn,L as dn,W as en,F as fn,y as gn,T as hn,M as in,u as jn,P as kn,g as ln};
142
+ export{B as dn,E as en,N as fn,L as gn,W as hn,F as in,y as jn,T as kn,M as ln,u as mn,P as nn,g as on};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{rB as B}from"./chunk-3jm3snz8.js";import z from"path";async function I(b){let j=b.pwa?.offline;if(!j?.enabled)return"";if(j.page){let k=z.isAbsolute(j.page)?j.page:z.resolve(process.cwd(),j.page);if(await Bun.file(k).exists())try{let{processDirectives:q}=await import("././process.js"),x=await Bun.file(k).text();return await q(x,{},k,b,new Set)}catch(q){console.warn(`[PWA] Failed to process custom offline page: ${q}`)}else console.warn(`[PWA] Custom offline page not found: ${k}`)}return F(b)}function F(b){let j=b.pwa?.offline,k=b.pwa?.manifest,q=j?.fallbackTitle||"You are offline",x=j?.fallbackMessage||"Please check your internet connection and try again.",y=k?.themeColor||"#4f46e5",A=k?.shortName||k?.name||"App";return`<!DOCTYPE html>
2
+ import{pB as B}from"./chunk-xv34zbp4.js";import z from"path";async function I(b){let j=b.pwa?.offline;if(!j?.enabled)return"";if(j.page){let k=z.isAbsolute(j.page)?j.page:z.resolve(process.cwd(),j.page);if(await Bun.file(k).exists())try{let{processDirectives:q}=await import("././process.js"),x=await Bun.file(k).text();return await q(x,{},k,b,new Set)}catch(q){console.warn(`[PWA] Failed to process custom offline page: ${q}`)}else console.warn(`[PWA] Custom offline page not found: ${k}`)}return F(b)}function F(b){let j=b.pwa?.offline,k=b.pwa?.manifest,q=j?.fallbackTitle||"You are offline",x=j?.fallbackMessage||"Please check your internet connection and try again.",y=k?.themeColor||"#4f46e5",A=k?.shortName||k?.name||"App";return`<!DOCTYPE html>
3
3
  <html lang="en">
4
4
  <head>
5
5
  <meta charset="UTF-8">