@stacksjs/stx 0.2.861 → 0.2.863

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 (291) hide show
  1. package/dist/analytics.js +3 -2
  2. package/dist/animation.js +3 -3
  3. package/dist/app-shell.js +4 -3
  4. package/dist/{chunk-14cvwsy1.js → chunk-01c16zw4.js} +2 -2
  5. package/dist/chunk-021tjkd6.js +3 -0
  6. package/dist/chunk-0bfgsv31.js +2 -0
  7. package/dist/chunk-0twkeh31.js +2 -0
  8. package/dist/chunk-0xtda6aw.js +2 -0
  9. package/dist/chunk-15m7jnc0.js +33 -0
  10. package/dist/{chunk-7bajrfb1.js → chunk-1grdbpsk.js} +8 -8
  11. package/dist/{chunk-9syvkm5z.js → chunk-1mqcttg3.js} +6 -6
  12. package/dist/chunk-2asyyky3.js +2 -0
  13. package/dist/{chunk-eye156nv.js → chunk-2c18y094.js} +1 -1
  14. package/dist/chunk-2n932qtv.js +20 -0
  15. package/dist/{chunk-76360zky.js → chunk-32ty2zx6.js} +9 -9
  16. package/dist/chunk-36j129p1.js +2 -0
  17. package/dist/chunk-3gk1e2b1.js +2 -0
  18. package/dist/chunk-3ryp43f3.js +2 -0
  19. package/dist/{chunk-12r22pf0.js → chunk-3z1mmar2.js} +2 -2
  20. package/dist/{chunk-zhxdpzga.js → chunk-46ddesnf.js} +3 -3
  21. package/dist/chunk-46pxmpeb.js +3 -0
  22. package/dist/chunk-4pr29yrx.js +2 -0
  23. package/dist/{chunk-tjz3r7rj.js → chunk-55zq2ha8.js} +5 -5
  24. package/dist/{chunk-avp271q4.js → chunk-58sh82aj.js} +2 -2
  25. package/dist/{chunk-gggadrs4.js → chunk-5a0d3048.js} +3 -3
  26. package/dist/{chunk-121cgm3s.js → chunk-5p1k2h5q.js} +8 -8
  27. package/dist/chunk-5s1fb8z4.js +4 -0
  28. package/dist/{chunk-x69457q9.js → chunk-5zzrrxns.js} +8 -8
  29. package/dist/chunk-64ebysb4.js +2 -0
  30. package/dist/{chunk-4rrxrxp6.js → chunk-669b2bya.js} +4 -4
  31. package/dist/{chunk-38qp2pg2.js → chunk-67dgp45w.js} +2 -2
  32. package/dist/{chunk-5xdkmn39.js → chunk-6ftee542.js} +2 -2
  33. package/dist/{chunk-5wr1qqz3.js → chunk-6k4ac74t.js} +2 -2
  34. package/dist/{chunk-c2w4wc9f.js → chunk-6m6y9bbx.js} +1 -1
  35. package/dist/chunk-6pczzq5f.js +2 -0
  36. package/dist/{chunk-6tp0w6hf.js → chunk-7ayvybdy.js} +3 -3
  37. package/dist/chunk-7mjf144y.js +2 -0
  38. package/dist/chunk-7wqevtks.js +2 -0
  39. package/dist/{chunk-bag9q4m0.js → chunk-8502xb4n.js} +39 -39
  40. package/dist/chunk-85zmxbt0.js +33 -0
  41. package/dist/{chunk-cxpq2zna.js → chunk-8arfg8kp.js} +3 -3
  42. package/dist/{chunk-xmy6g81m.js → chunk-8hhhmscy.js} +2 -2
  43. package/dist/{chunk-fyfvqd2s.js → chunk-8me8hamk.js} +2 -2
  44. package/dist/{chunk-pb09xy77.js → chunk-8s6s6nd0.js} +2 -2
  45. package/dist/chunk-8v1zpdef.js +2 -0
  46. package/dist/chunk-94mpe1ny.js +3 -0
  47. package/dist/{chunk-mzes9ds7.js → chunk-9zrvh3pz.js} +2 -2
  48. package/dist/chunk-a4cn8rf4.js +2 -0
  49. package/dist/{chunk-fpkp0bqf.js → chunk-adqh1gp1.js} +1 -1
  50. package/dist/chunk-ap84eenm.js +2 -0
  51. package/dist/chunk-as2ffje6.js +2 -0
  52. package/dist/chunk-az5xw3w8.js +2 -0
  53. package/dist/chunk-b6w0f610.js +712 -0
  54. package/dist/chunk-ba91r7q9.js +2 -0
  55. package/dist/{chunk-qkcn0exq.js → chunk-brzjass3.js} +6 -6
  56. package/dist/chunk-bwdbj60y.js +3 -0
  57. package/dist/{chunk-3wg9kr5z.js → chunk-bx5d87xx.js} +6 -7
  58. package/dist/chunk-c0t2tdfk.js +2 -0
  59. package/dist/chunk-caxqwrnc.js +2 -0
  60. package/dist/{chunk-37tefp7s.js → chunk-cqhwzd9y.js} +5 -5
  61. package/dist/chunk-cvgbtmxp.js +2 -0
  62. package/dist/chunk-czca8yds.js +42 -0
  63. package/dist/chunk-d0afg5f7.js +2 -0
  64. package/dist/chunk-d9vzfbdp.js +2 -0
  65. package/dist/{chunk-65cbfx5x.js → chunk-dpmayc2w.js} +2 -2
  66. package/dist/{chunk-d6216bcw.js → chunk-dtarm8x9.js} +9 -9
  67. package/dist/chunk-e634vffz.js +3 -0
  68. package/dist/chunk-eafqxbr0.js +2 -0
  69. package/dist/{chunk-qjm23ma2.js → chunk-ew5cey88.js} +1 -1
  70. package/dist/{chunk-xppm4cs4.js → chunk-farh4p7f.js} +3 -3
  71. package/dist/chunk-fnv94wc6.js +2 -0
  72. package/dist/chunk-g4gcf4jn.js +2 -0
  73. package/dist/chunk-g65dptx2.js +2 -0
  74. package/dist/{chunk-q6w7a1vc.js → chunk-gbtbfg7e.js} +3 -3
  75. package/dist/{chunk-15jymk6t.js → chunk-gd56arnm.js} +2 -2
  76. package/dist/{chunk-5ka3h8dy.js → chunk-gjngg182.js} +45 -46
  77. package/dist/{chunk-8hck9qqm.js → chunk-gp8hgpt9.js} +4 -4
  78. package/dist/chunk-gw7t6a3t.js +2 -0
  79. package/dist/chunk-h2qgqjkn.js +2 -0
  80. package/dist/chunk-h65shwe9.js +2 -0
  81. package/dist/{chunk-zpkgs5d3.js → chunk-h816ta81.js} +6 -6
  82. package/dist/chunk-hc6111md.js +54 -0
  83. package/dist/{chunk-cq2hedwn.js → chunk-hev4t4d5.js} +6 -6
  84. package/dist/{chunk-7yhhwv07.js → chunk-hmdkf6c6.js} +2 -2
  85. package/dist/{chunk-vggtxttf.js → chunk-j1efsjsb.js} +5 -5
  86. package/dist/chunk-j4zrq17p.js +2 -0
  87. package/dist/chunk-jfmj0wsy.js +2 -0
  88. package/dist/{chunk-bg0ywp5w.js → chunk-jgra00m8.js} +2 -2
  89. package/dist/{chunk-5rxks14t.js → chunk-k32q90b2.js} +2 -2
  90. package/dist/{chunk-naj146zq.js → chunk-k7dxm48r.js} +2 -2
  91. package/dist/chunk-ks5p5w6z.js +25 -0
  92. package/dist/chunk-kw11yydy.js +2 -0
  93. package/dist/chunk-m9cperj4.js +2 -0
  94. package/dist/{chunk-zs4s9fcq.js → chunk-mcnwvh06.js} +6 -6
  95. package/dist/chunk-meqsd5bt.js +2 -0
  96. package/dist/{chunk-dba4bwkd.js → chunk-mfa07erx.js} +16 -16
  97. package/dist/{chunk-jh2v1vvb.js → chunk-mrh08821.js} +3 -3
  98. package/dist/{chunk-9n8t7v78.js → chunk-n3jw3xpj.js} +2 -2
  99. package/dist/chunk-ns04v3am.js +2 -0
  100. package/dist/chunk-ntbe5q5x.js +16 -0
  101. package/dist/chunk-nttsc0aw.js +14 -0
  102. package/dist/chunk-p0tkhd12.js +2 -0
  103. package/dist/chunk-p2etn78y.js +2 -0
  104. package/dist/{chunk-1nankvf6.js → chunk-pbakxcv8.js} +2 -2
  105. package/dist/{chunk-h4aqpf2r.js → chunk-prrvggcy.js} +5 -5
  106. package/dist/chunk-pyckafsb.js +12 -0
  107. package/dist/{chunk-t5q31st4.js → chunk-q1wxgw5s.js} +2 -2
  108. package/dist/chunk-qa5y30sy.js +72 -0
  109. package/dist/{chunk-m3p4hksq.js → chunk-qbghf76y.js} +4 -4
  110. package/dist/{chunk-a6d92kv6.js → chunk-qcxrcypb.js} +2 -2
  111. package/dist/{chunk-1jwcp2k0.js → chunk-qjey0jk6.js} +2 -2
  112. package/dist/chunk-qmkaqjba.js +2 -0
  113. package/dist/chunk-qxw9h564.js +2 -0
  114. package/dist/chunk-r23zq8yk.js +2 -0
  115. package/dist/{chunk-68w65mhs.js → chunk-r4v4vswq.js} +3 -3
  116. package/dist/chunk-reeaknf2.js +2 -0
  117. package/dist/chunk-rqa92xm4.js +2 -0
  118. package/dist/chunk-rqmb09ss.js +2 -0
  119. package/dist/chunk-s92j8k4z.js +2 -0
  120. package/dist/chunk-s9df8srx.js +6 -0
  121. package/dist/{chunk-dt73ww6m.js → chunk-sb8n32rn.js} +1 -1
  122. package/dist/{chunk-5neezkj1.js → chunk-sj3ry5ck.js} +33 -25
  123. package/dist/chunk-snz2cxqv.js +2 -0
  124. package/dist/{chunk-36vksrry.js → chunk-srgnevws.js} +2 -2
  125. package/dist/chunk-sz6d3v6b.js +2 -0
  126. package/dist/{chunk-9pyvc0dc.js → chunk-tnp2ta5q.js} +2 -2
  127. package/dist/{chunk-gx96hctv.js → chunk-v37zmez0.js} +2 -2
  128. package/dist/chunk-v408qsze.js +2 -0
  129. package/dist/{chunk-thdnk1kd.js → chunk-v4xes880.js} +3 -3
  130. package/dist/chunk-va07zs9v.js +2 -0
  131. package/dist/chunk-vc42mvjn.js +2 -0
  132. package/dist/chunk-vk98r75z.js +2 -0
  133. package/dist/{chunk-yj9nyt93.js → chunk-vvzys1x7.js} +3 -3
  134. package/dist/chunk-vwwpbhd2.js +3 -0
  135. package/dist/{chunk-hyea17hp.js → chunk-w468n41y.js} +155 -157
  136. package/dist/{chunk-f1vvhbmw.js → chunk-w6pzkcjp.js} +2 -2
  137. package/dist/{chunk-15rkvc0t.js → chunk-wk4wg6sn.js} +5 -5
  138. package/dist/chunk-wtfamngc.js +20 -0
  139. package/dist/chunk-x3p4emdp.js +2 -0
  140. package/dist/{chunk-3gfd9t8a.js → chunk-x512h2gv.js} +4 -4
  141. package/dist/{chunk-nwxjh1gv.js → chunk-x7redxyd.js} +4 -4
  142. package/dist/chunk-xcjvx6zt.js +2 -0
  143. package/dist/chunk-xfd3yqgj.js +1327 -0
  144. package/dist/chunk-xjxcwrqs.js +2 -0
  145. package/dist/chunk-xymr4ys9.js +3 -0
  146. package/dist/chunk-xzdkjkyp.js +2 -0
  147. package/dist/{chunk-b1tctqn5.js → chunk-y036cwc7.js} +10 -10
  148. package/dist/chunk-y190sh29.js +16 -0
  149. package/dist/{chunk-wrbhq1y2.js → chunk-yakdcak2.js} +3 -3
  150. package/dist/chunk-ybkwnscv.js +2 -0
  151. package/dist/{chunk-6nb49h13.js → chunk-yhc1c4tr.js} +125 -126
  152. package/dist/chunk-ymdw4fhd.js +3 -0
  153. package/dist/chunk-ynkbv9jq.js +4 -0
  154. package/dist/chunk-yr1zx78b.js +3 -0
  155. package/dist/{chunk-e8nzbz66.js → chunk-ysfeg3cn.js} +2 -2
  156. package/dist/chunk-ytzzth34.js +2 -0
  157. package/dist/chunk-yxpjj003.js +2 -0
  158. package/dist/chunk-z1rs6b4x.js +2 -0
  159. package/dist/chunk-z383x16t.js +2 -0
  160. package/dist/chunk-z3gz5fy4.js +2 -0
  161. package/dist/{chunk-tm201m9x.js → chunk-z512gt4v.js} +3 -3
  162. package/dist/{chunk-5n7m8vqx.js → chunk-zbvfjm4a.js} +2 -2
  163. package/dist/chunk-zr22gtpf.js +2 -0
  164. package/dist/chunk-zsnmk5me.js +2 -0
  165. package/dist/chunk-ztbexx3h.js +2 -0
  166. package/dist/cli.js +35 -35
  167. package/dist/client/signals-timer-runtime.js +12 -4
  168. package/dist/craft-entry.js +2 -2
  169. package/dist/craft.js +2 -2
  170. package/dist/dev-server/serve-app.js +3 -2
  171. package/dist/dev-server/serve-multi.js +3 -4
  172. package/dist/dev-server/ts-css.js +4 -5
  173. package/dist/document-shell.js +4 -3
  174. package/dist/document-tags.d.ts +8 -0
  175. package/dist/document-tags.js +37 -0
  176. package/dist/events.js +2 -1
  177. package/dist/head-injection.js +2 -1
  178. package/dist/heatmap.js +2 -1
  179. package/dist/hot-reload.js +3 -1
  180. package/dist/index.d.ts +1 -1
  181. package/dist/index.js +1 -1
  182. package/dist/native-build.js +3 -3
  183. package/dist/process.js +5 -6
  184. package/dist/production-build.js +3 -3
  185. package/dist/pwa/inject.js +3 -3
  186. package/dist/pwa.js +3 -3
  187. package/dist/reactive-bindings.js +2 -1
  188. package/dist/reactive.js +2 -1
  189. package/dist/render.js +1 -1
  190. package/dist/runtime-injection.js +6 -6
  191. package/dist/serve.js +1 -1
  192. package/dist/site-builder/build.js +1 -1
  193. package/dist/site-builder/i18n.js +2 -2
  194. package/dist/site-builder/router.js +1 -1
  195. package/dist/site-builder/theme.js +1 -1
  196. package/dist/ssg.js +30 -31
  197. package/dist/template-hydrator.js +2 -1
  198. package/dist/web-components/css-scoping.js +3 -3
  199. package/dist/x-element.js +2 -1
  200. package/package.json +5 -5
  201. package/dist/body-close.d.ts +0 -13
  202. package/dist/body-close.js +0 -8
  203. package/dist/chunk-02css3vk.js +0 -14
  204. package/dist/chunk-0hqr6bff.js +0 -2
  205. package/dist/chunk-15sgdvyd.js +0 -2
  206. package/dist/chunk-261t62q4.js +0 -712
  207. package/dist/chunk-2b4a8tbd.js +0 -3
  208. package/dist/chunk-2fw36w1x.js +0 -2
  209. package/dist/chunk-2jcxsw75.js +0 -2
  210. package/dist/chunk-2pbhdaka.js +0 -2
  211. package/dist/chunk-2wba5ypm.js +0 -2
  212. package/dist/chunk-353gnvfe.js +0 -2
  213. package/dist/chunk-3cr5y8v1.js +0 -2
  214. package/dist/chunk-3y7yp0ka.js +0 -2
  215. package/dist/chunk-41wwqw0q.js +0 -2
  216. package/dist/chunk-4a1y51fs.js +0 -2
  217. package/dist/chunk-4a751brg.js +0 -2
  218. package/dist/chunk-4jgcd4d9.js +0 -33
  219. package/dist/chunk-5awhm4na.js +0 -2
  220. package/dist/chunk-5fhp9hxd.js +0 -2
  221. package/dist/chunk-5mg443dw.js +0 -2
  222. package/dist/chunk-5q4tncfw.js +0 -18
  223. package/dist/chunk-5x9ajbq0.js +0 -2
  224. package/dist/chunk-6g7tkmty.js +0 -2
  225. package/dist/chunk-72bj7ea4.js +0 -2
  226. package/dist/chunk-74g64pzt.js +0 -20
  227. package/dist/chunk-7de5y29a.js +0 -54
  228. package/dist/chunk-7ycmnsh5.js +0 -2
  229. package/dist/chunk-811hh6vp.js +0 -2
  230. package/dist/chunk-830ej8d2.js +0 -72
  231. package/dist/chunk-8fkmxrat.js +0 -2
  232. package/dist/chunk-8p9npc8y.js +0 -2
  233. package/dist/chunk-9fz3h6sx.js +0 -2
  234. package/dist/chunk-9jr30fns.js +0 -2
  235. package/dist/chunk-9xr628ew.js +0 -3
  236. package/dist/chunk-a9m6ajd7.js +0 -2
  237. package/dist/chunk-aj6vqdf7.js +0 -25
  238. package/dist/chunk-asr5v51s.js +0 -2
  239. package/dist/chunk-b7nmgkwa.js +0 -42
  240. package/dist/chunk-bv14vry8.js +0 -3
  241. package/dist/chunk-byx82s10.js +0 -2
  242. package/dist/chunk-c9y1g61m.js +0 -2
  243. package/dist/chunk-ck5nzbbv.js +0 -2
  244. package/dist/chunk-cvdm0hgq.js +0 -2
  245. package/dist/chunk-e0fxgbcc.js +0 -2
  246. package/dist/chunk-ed2m6pjf.js +0 -2
  247. package/dist/chunk-ednwdhv0.js +0 -2
  248. package/dist/chunk-egtphftq.js +0 -2
  249. package/dist/chunk-f18rxz70.js +0 -2
  250. package/dist/chunk-fahqq7c4.js +0 -2
  251. package/dist/chunk-fcbpzdyz.js +0 -2
  252. package/dist/chunk-gc79s0wh.js +0 -20
  253. package/dist/chunk-gjnrmz2q.js +0 -4
  254. package/dist/chunk-gp1dt8b8.js +0 -33
  255. package/dist/chunk-h0dsxxz4.js +0 -2
  256. package/dist/chunk-h2cvfp9y.js +0 -2
  257. package/dist/chunk-jhm1228j.js +0 -4
  258. package/dist/chunk-k3yym9zg.js +0 -2
  259. package/dist/chunk-k9fsd6t3.js +0 -2
  260. package/dist/chunk-kepxsjfx.js +0 -2
  261. package/dist/chunk-kgrvvtcy.js +0 -3
  262. package/dist/chunk-kh01rvag.js +0 -2
  263. package/dist/chunk-kv40xq53.js +0 -1329
  264. package/dist/chunk-mad172af.js +0 -2
  265. package/dist/chunk-mjkdskeg.js +0 -12
  266. package/dist/chunk-npt0mdzb.js +0 -2
  267. package/dist/chunk-p95fsnbk.js +0 -2
  268. package/dist/chunk-ptc3yqn3.js +0 -2
  269. package/dist/chunk-pybm7c9p.js +0 -2
  270. package/dist/chunk-q87hkwfg.js +0 -3
  271. package/dist/chunk-qe6631me.js +0 -2
  272. package/dist/chunk-qnx71b17.js +0 -2
  273. package/dist/chunk-qx8cav4w.js +0 -2
  274. package/dist/chunk-rb7cwck6.js +0 -2
  275. package/dist/chunk-s1e0t3hv.js +0 -2
  276. package/dist/chunk-s7vfmasx.js +0 -2
  277. package/dist/chunk-scwbttvt.js +0 -3
  278. package/dist/chunk-shy2hkvj.js +0 -2
  279. package/dist/chunk-sxtvy0sm.js +0 -3
  280. package/dist/chunk-t7z67vf6.js +0 -2
  281. package/dist/chunk-tarvase5.js +0 -2
  282. package/dist/chunk-tqs9pcga.js +0 -2
  283. package/dist/chunk-twjfrywv.js +0 -2
  284. package/dist/chunk-v0wdgxga.js +0 -3
  285. package/dist/chunk-vyna2rsq.js +0 -2
  286. package/dist/chunk-w4gjx2zs.js +0 -18
  287. package/dist/chunk-xhe7pw6e.js +0 -2
  288. package/dist/chunk-y86mpnrg.js +0 -2
  289. package/dist/chunk-z99bf0q0.js +0 -3
  290. package/dist/chunk-zm0g7ntw.js +0 -2
  291. package/dist/chunk-zrm2x65c.js +0 -2
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ch,lh}from"./chunk-gbtbfg7e.js";export{lh as ensureTeleportTargets,ch as processTeleportDirectives};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{h}from"./chunk-kgrvvtcy.js";import{mkdir as w,writeFile as m}from"fs/promises";import{join as l}from"path";var f="https://api.iconify.design";async function D(){let e=await fetch(`${f}/collections`);if(!e.ok)throw Error(`Failed to fetch collections: ${e.statusText}`);return await e.json()}async function P(e,t){try{let c=h.resolve("@iconify/json"),r=`${`${c.substring(0,c.lastIndexOf("/node_modules/@iconify/json/"))}/node_modules/@iconify/json`}/json/${e}.json`,s=Bun.file(r);if(await s.exists()){let a=await s.json();if(t&&t.length>0){let d={};for(let y of t)if(a.icons[y])d[y]=a.icons[y];return{...a,icons:d}}return a}}catch{}let n=t&&t.length>0?`${f}/${e}.json?icons=${t.join(",")}`:`${f}/${e}.json`,i=await fetch(n);if(!i.ok)throw Error(`Failed to fetch icons for ${e}: ${i.statusText}`);return await i.json()}function F(e,t=24,n=24){return{body:e.body,width:e.width||t,height:e.height||n,viewBox:`0 0 ${e.width||t} ${e.height||n}`}}function T(e,t){let n=u(e);return`import type { IconData } from '@stacksjs/iconify-core'
2
+ import{b}from"./chunk-94mpe1ny.js";import{mkdir as I,writeFile as m}from"fs/promises";import{join as l}from"path";var g="https://api.iconify.design";async function D(){let e=await fetch(`${g}/collections`);if(!e.ok)throw Error(`Failed to fetch collections: ${e.statusText}`);return await e.json()}async function P(e,t){try{let c=b.resolve("@iconify/json"),r=`${`${c.substring(0,c.lastIndexOf("/node_modules/@iconify/json/"))}/node_modules/@iconify/json`}/json/${e}.json`,s=Bun.file(r);if(await s.exists()){let a=await s.json();if(t&&t.length>0){let d={};for(let u of t)if(a.icons[u])d[u]=a.icons[u];return{...a,icons:d}}return a}}catch{}let n=t&&t.length>0?`${g}/${e}.json?icons=${t.join(",")}`:`${g}/${e}.json`,i=await fetch(n);if(!i.ok)throw Error(`Failed to fetch icons for ${e}: ${i.statusText}`);return await i.json()}function F(e,t=24,n=24){return{body:e.body,width:e.width||t,height:e.height||n,viewBox:`0 0 ${e.width||t} ${e.height||n}`}}function T(e,t){let n=h(e);return`import type { IconData } from '@stacksjs/iconify-core'
3
3
 
4
4
  export const ${n}: IconData = ${JSON.stringify(t,null,2)}
5
5
 
@@ -44,7 +44,7 @@ const svg = \`<svg xmlns="http://www.w3.org/2000/svg" width="\${iconWidth}" heig
44
44
 
45
45
  {!! svg !!}
46
46
  `}function _(e){let t=new Set;return`// Icon data exports
47
- ${e.map((i)=>{let o=u(i);if(t.has(o)){let r=i.replace(/[^a-zA-Z0-9]/g,"_");if(/^[0-9]/.test(r))r=`_${r}`;o=r;let s=2;while(t.has(o))o=`${r}_${s}`,s++}return t.add(o),`export { default as ${o} } from './${i}.js'`}).join(`
47
+ ${e.map((i)=>{let o=h(i);if(t.has(o)){let r=i.replace(/[^a-zA-Z0-9]/g,"_");if(/^[0-9]/.test(r))r=`_${r}`;o=r;let s=2;while(t.has(o))o=`${r}_${s}`,s++}return t.add(o),`export { default as ${o} } from './${i}.js'`}).join(`
48
48
  `)}
49
49
 
50
50
  export * from './types.js'
@@ -155,7 +155,7 @@ ${t.license?.url?`License: ${t.license.url}`:""}
155
155
 
156
156
  - Icons: ${t.author?.name||"Iconify"}${t.author?.url?` (${t.author.url})`:""}
157
157
  - Iconify: https://iconify.design/
158
- `}function M(e,t,n){let i=n.length,c=n.slice(0,5).map(u),o=c.map((s)=>`${s.charAt(0).toUpperCase()}${s.slice(1)}Icon`),r=n.map((s)=>`- \`${u(s)}\``).join(`
158
+ `}function M(e,t,n){let i=n.length,c=n.slice(0,5).map(h),o=c.map((s)=>`${s.charAt(0).toUpperCase()}${s.slice(1)}Icon`),r=n.map((s)=>`- \`${h(s)}\``).join(`
159
159
  `);return`# ${t.name}
160
160
 
161
161
  > ${t.name} icons for stx from Iconify
@@ -338,14 +338,14 @@ You can also use the \`size\` property as a shorthand for setting both width and
338
338
  You can also control icon size via CSS:
339
339
 
340
340
  \`\`\`css
341
- .${u(e)}-icon {
341
+ .${h(e)}-icon {
342
342
  width: 1em;
343
343
  height: 1em;
344
344
  }
345
345
  \`\`\`
346
346
 
347
347
  \`\`\`html
348
- <${o[0]||"DraftsIcon"} class="${u(e)}-icon" />
348
+ <${o[0]||"DraftsIcon"} class="${h(e)}-icon" />
349
349
  \`\`\`
350
350
 
351
351
  ## Available Icons
@@ -502,4 +502,4 @@ ${t.license?.url?`See [license details](${t.license.url}) for more information.`
502
502
  - [Iconify documentation](https://iconify.design/docs/)
503
503
  - [stx iconify integration guide](../../docs/iconify.md)
504
504
  `}async function G(e,t,n,i){console.log(`
505
- \uD83D\uDCE6 Generating package for ${e}...`);let o=(await D())[e];if(!o)throw Error(`Collection ${e} not found`);console.log(` Collection: ${o.name}`),console.log(` Total icons: ${o.total}`);let r=await P(e,n),s=Object.keys(r.icons);console.log(` Generating ${s.length} icons...`);let a=l(t,`iconify-${e}`),d=l(a,"src");await w(d,{recursive:!0});let y=r.width||24,b=r.height||24;for(let p of s){let g=r.icons[p],I=F(g,y,b),z=T(p,I);await m(l(d,`${p}.ts`),z);let k=A(p,I);await m(l(d,`${p}-icon.stx`),k)}let v=_(s);await m(l(d,"index.ts"),v);let C=E(e);await m(l(d,"types.ts"),C);let S=N(e,o,s.length);await m(l(a,"package.json"),S);let x=U(e);await m(l(a,"build.ts"),x);let j=R(e,o,s.length);if(await m(l(a,"README.md"),j),i){let p=l(i,`iconify-${e}.md`),g=M(e,o,s);await w(i,{recursive:!0}),await m(p,g),console.log(` \u2713 Generated documentation in ${p}`)}console.log(` \u2713 Generated ${s.length} icons in ${a}`)}var B=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","let","static","yield","implements","interface","package","private","protected","public","await","eval","arguments"]);function u(e){let t=e.replace(/-([a-z0-9])/g,(n)=>n[1].toUpperCase());if(t=t.replace(/[^a-zA-Z0-9_$]/g,"_"),/^[0-9]/.test(t))t=`_${t}`;if(B.has(t))t=`${t}_`;return t}function W(e){let t=u(e);return t.charAt(0).toUpperCase()+t.slice(1)}export{D as fetchCollections,G as generatePackage};
505
+ \uD83D\uDCE6 Generating package for ${e}...`);let o=(await D())[e];if(!o)throw Error(`Collection ${e} not found`);console.log(` Collection: ${o.name}`),console.log(` Total icons: ${o.total}`);let r=await P(e,n),s=Object.keys(r.icons);console.log(` Generating ${s.length} icons...`);let a=l(t,`iconify-${e}`),d=l(a,"src");await I(d,{recursive:!0});let u=r.width||24,w=r.height||24;for(let p of s){let y=r.icons[p],f=F(y,u,w),z=T(p,f);await m(l(d,`${p}.ts`),z);let k=A(p,f);await m(l(d,`${p}-icon.stx`),k)}let v=_(s);await m(l(d,"index.ts"),v);let C=E(e);await m(l(d,"types.ts"),C);let S=N(e,o,s.length);await m(l(a,"package.json"),S);let x=U(e);await m(l(a,"build.ts"),x);let j=R(e,o,s.length);if(await m(l(a,"README.md"),j),i){let p=l(i,`iconify-${e}.md`),y=M(e,o,s);await I(i,{recursive:!0}),await m(p,y),console.log(` \u2713 Generated documentation in ${p}`)}console.log(` \u2713 Generated ${s.length} icons in ${a}`)}var B=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","let","static","yield","implements","interface","package","private","protected","public","await","eval","arguments"]);function h(e){let t=e.replace(/-([a-z0-9])/g,(n)=>n[1].toUpperCase());if(t=t.replace(/[^a-zA-Z0-9_$]/g,"_"),/^[0-9]/.test(t))t=`_${t}`;if(B.has(t))t=`${t}_`;return t}function W(e){let t=h(e);return t.charAt(0).toUpperCase()+t.slice(1)}export{D as fetchCollections,G as generatePackage};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ function A(){let{NODE_ENV:n}=process.env;return n==="production"}function Y(){let{STX_DEBUG:n}=process.env;return!A()||n==="true"}function Pn(){let{NODE_ENV:n}=process.env;return n==="test"}function Bi(n,t){return t??(n==="compile"||A())}function In(n){if(!n)return n;try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(n).trim()}catch{return n}}
3
+ export{A,Y,Pn,Bi,In};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Wt}from"./chunk-m3p4hksq.js";function ro(e){let n=e.pwa;if(!n?.enabled)return"";let r=n.manifest,t=n.icons?.outputDir?`/${n.icons.outputDir}`:"/pwa-icons",o=Wt(e),i=`
2
+ import{Gt}from"./chunk-qbghf76y.js";import{c,f}from"./chunk-s9df8srx.js";function io(e){let n=e.pwa;if(!n?.enabled)return"";let r=n.manifest,t=n.icons?.outputDir?`/${n.icons.outputDir}`:"/pwa-icons",o=Gt(e),i=`
3
3
  <!-- stx PWA Meta Tags -->
4
4
  <link rel="manifest" href="/manifest.json">
5
5
  <meta name="theme-color" content="${a(r?.themeColor||"#000000")}">
@@ -43,12 +43,11 @@ if ('serviceWorker' in navigator) {
43
43
  });
44
44
  }
45
45
  </script>
46
- <!-- End stx PWA -->`,i}function Bi(e,n){let r=n.pwa;if(!r?.enabled||r.autoInject===!1)return e;if(e.includes("<!-- stx PWA Meta Tags -->"))return e;if(!e.includes("</head>")){let o=e.lastIndexOf("</body>");if(o!==-1){let i=ro(n);return e.slice(0,o)+i+`
47
- `+e.slice(o)}return e+ro(n)}let t=ro(n);return e.replace("</head>",`${t}
48
- </head>`)}function Lg(e){if(!e.pwa?.enabled)return"";return`<script>
46
+ <!-- End stx PWA -->`,i}function Hi(e,n){let r=n.pwa;if(!r?.enabled||r.autoInject===!1)return e;if(e.includes("<!-- stx PWA Meta Tags -->"))return e;if(!e.includes("</head>")){let o=c(e);if(o!==-1){let i=io(n);return e.slice(0,o)+i+`
47
+ `+e.slice(o)}return e+io(n)}let t=io(n);return f(e,t)}function Fg(e){if(!e.pwa?.enabled)return"";return`<script>
49
48
  if ('serviceWorker' in navigator) {
50
49
  window.addEventListener('load', function() {
51
- navigator.serviceWorker.register('/${Wt(e)}')
50
+ navigator.serviceWorker.register('/${Gt(e)}')
52
51
  .then(function(registration) {
53
52
  console.log('[PWA] Service Worker registered:', registration.scope);
54
53
  })
@@ -57,5 +56,5 @@ if ('serviceWorker' in navigator) {
57
56
  });
58
57
  });
59
58
  }
60
- </script>`}function jg(){return'<link rel="manifest" href="/manifest.json">'}function Bg(e){return`<meta name="theme-color" content="${a(e)}">`}function a(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}
61
- export{ro,Bi,Lg,jg,Bg};
59
+ </script>`}function zg(){return'<link rel="manifest" href="/manifest.json">'}function Hg(e){return`<meta name="theme-color" content="${a(e)}">`}function a(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}
60
+ export{io,Hi,Fg,zg,Hg};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Jh,Yh,Xf,bs}from"./chunk-czca8yds.js";import"./chunk-e634vffz.js";import"./chunk-xymr4ys9.js";import"./chunk-zsnmk5me.js";import{Ar}from"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import{ut}from"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{ut as freeIdentifiers,bs as processComponents,Xf as processESImports,Ar as rendersAsElement,Jh as resetMarginStackWarnings,Yh as resetTemplateLoopWarnings};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{La,ja,Ba,Fa,Bh}from"./chunk-gjngg182.js";import"./chunk-8502xb4n.js";import"./chunk-ntbe5q5x.js";import"./chunk-vvzys1x7.js";import"./chunk-xfd3yqgj.js";import"./chunk-y190sh29.js";import"./chunk-hc6111md.js";import"./chunk-q1wxgw5s.js";import"./chunk-czca8yds.js";import"./chunk-e634vffz.js";import"./chunk-ks5p5w6z.js";import"./chunk-xymr4ys9.js";import"./chunk-y036cwc7.js";import"./chunk-nttsc0aw.js";import"./chunk-zsnmk5me.js";import"./chunk-021tjkd6.js";import"./chunk-yhc1c4tr.js";import"./chunk-r4v4vswq.js";import"./chunk-tnp2ta5q.js";import"./chunk-669b2bya.js";import"./chunk-mfa07erx.js";import"./chunk-x512h2gv.js";import"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{La as buildNative,Bh as default,ja as findCraftBinary,Fa as getAvailableFormats,Ba as getAvailableTargets};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- function m(e,t={}){return{enterFrom:t.enterClass||`${e}-enter-from`,enterActive:t.enterActiveClass||`${e}-enter-active`,enterTo:t.enterToClass||`${e}-enter-to`,leaveFrom:t.leaveClass||`${e}-leave-from`,leaveActive:t.leaveActiveClass||`${e}-leave-active`,leaveTo:t.leaveToClass||`${e}-leave-to`}}function u(e){let t=getComputedStyle(e),o=t.transitionDuration||"0s",n=t.animationDuration||"0s",s=(a)=>{let i=a.match(/^([\d.]+)(s|ms)?$/);if(!i)return 0;let r=parseFloat(i[1]);return(i[2]||"s")==="ms"?r:r*1000};return Math.max(s(o),s(n))}function v(e,t){return new Promise((o)=>{let n=t??u(e);if(n===0){o();return}let s=!1,a=()=>{if(s)return;s=!0,e.removeEventListener("transitionend",i),e.removeEventListener("animationend",i),o()},i=(r)=>{if(r.target===e)a()};e.addEventListener("transitionend",i),e.addEventListener("animationend",i),setTimeout(a,n+50)})}function f(e){e.offsetHeight}async function ah(e,t={}){let o=t.name||"stx",n=m(o,t),s=typeof t.duration==="object"?t.duration.enter:t.duration;if(t.onBeforeEnter?.(e),e.classList.add(n.enterFrom),e.classList.add(n.enterActive),f(e),e.classList.remove(n.enterFrom),e.classList.add(n.enterTo),t.onEnter)await new Promise((a)=>{t.onEnter(e,a)});else await v(e,s);e.classList.remove(n.enterActive),e.classList.remove(n.enterTo),t.onAfterEnter?.(e)}async function ch(e,t={}){let o=t.name||"stx",n=m(o,t),s=typeof t.duration==="object"?t.duration.leave:t.duration;if(t.onBeforeLeave?.(e),e.classList.add(n.leaveFrom),e.classList.add(n.leaveActive),f(e),e.classList.remove(n.leaveFrom),e.classList.add(n.leaveTo),t.onLeave)await new Promise((a)=>{t.onLeave(e,a)});else await v(e,s);e.classList.remove(n.leaveActive),e.classList.remove(n.leaveTo),t.onAfterLeave?.(e)}function lh(e,t={},o){let n=/@transition\s*\(([^)]*)\)([\s\S]*?)@endtransition/gi;return e.replace(n,(s,a,i)=>{let r=p(a),l=r.name||"stx",c=r.duration||300,d=`stx-transition-${Math.random().toString(36).slice(2,9)}`;return`
2
+ function m(e,t={}){return{enterFrom:t.enterClass||`${e}-enter-from`,enterActive:t.enterActiveClass||`${e}-enter-active`,enterTo:t.enterToClass||`${e}-enter-to`,leaveFrom:t.leaveClass||`${e}-leave-from`,leaveActive:t.leaveActiveClass||`${e}-leave-active`,leaveTo:t.leaveToClass||`${e}-leave-to`}}function u(e){let t=getComputedStyle(e),o=t.transitionDuration||"0s",n=t.animationDuration||"0s",s=(a)=>{let i=a.match(/^([\d.]+)(s|ms)?$/);if(!i)return 0;let r=parseFloat(i[1]);return(i[2]||"s")==="ms"?r:r*1000};return Math.max(s(o),s(n))}function v(e,t){return new Promise((o)=>{let n=t??u(e);if(n===0){o();return}let s=!1,a=()=>{if(s)return;s=!0,e.removeEventListener("transitionend",i),e.removeEventListener("animationend",i),o()},i=(r)=>{if(r.target===e)a()};e.addEventListener("transitionend",i),e.addEventListener("animationend",i),setTimeout(a,n+50)})}function f(e){e.offsetHeight}async function uh(e,t={}){let o=t.name||"stx",n=m(o,t),s=typeof t.duration==="object"?t.duration.enter:t.duration;if(t.onBeforeEnter?.(e),e.classList.add(n.enterFrom),e.classList.add(n.enterActive),f(e),e.classList.remove(n.enterFrom),e.classList.add(n.enterTo),t.onEnter)await new Promise((a)=>{t.onEnter(e,a)});else await v(e,s);e.classList.remove(n.enterActive),e.classList.remove(n.enterTo),t.onAfterEnter?.(e)}async function dh(e,t={}){let o=t.name||"stx",n=m(o,t),s=typeof t.duration==="object"?t.duration.leave:t.duration;if(t.onBeforeLeave?.(e),e.classList.add(n.leaveFrom),e.classList.add(n.leaveActive),f(e),e.classList.remove(n.leaveFrom),e.classList.add(n.leaveTo),t.onLeave)await new Promise((a)=>{t.onLeave(e,a)});else await v(e,s);e.classList.remove(n.leaveActive),e.classList.remove(n.leaveTo),t.onAfterLeave?.(e)}function ph(e,t={},o){let n=/@transition\s*\(([^)]*)\)([\s\S]*?)@endtransition/gi;return e.replace(n,(s,a,i)=>{let r=p(a),l=r.name||"stx",c=r.duration||300,d=`stx-transition-${Math.random().toString(36).slice(2,9)}`;return`
3
3
  <div
4
4
  class="stx-transition-wrapper"
5
5
  data-transition="${l}"
@@ -41,7 +41,7 @@ function m(e,t={}){return{enterFrom:t.enterClass||`${e}-enter-from`,enterActive:
41
41
  });
42
42
  })();
43
43
  </script>
44
- `})}function p(e){let t={},o=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,n;while((n=o.exec(e))!==null){let s=n[1],a=n[2]||n[3]||n[4]||n[5];switch(s){case"name":t.name=a;break;case"duration":t.duration=parseInt(a,10);break;case"mode":t.mode=a;break;case"easing":t.easing=a;break}}return t}function uh(){return`
44
+ `})}function p(e){let t={},o=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,n;while((n=o.exec(e))!==null){let s=n[1],a=n[2]||n[3]||n[4]||n[5];switch(s){case"name":t.name=a;break;case"duration":t.duration=parseInt(a,10);break;case"mode":t.mode=a;break;case"easing":t.easing=a;break}}return t}function fh(){return`
45
45
  /* STX Transition Presets */
46
46
 
47
47
  /* Fade */
@@ -228,7 +228,7 @@ function m(e,t={}){return{enterFrom:t.enterClass||`${e}-enter-from`,enterActive:
228
228
  opacity: 1;
229
229
  max-height: 1000px;
230
230
  }
231
- `}function dh(){return`
231
+ `}function gh(){return`
232
232
  // STX Transition Runtime
233
233
  (function() {
234
234
  if (typeof window === 'undefined') return;
@@ -317,5 +317,5 @@ else {
317
317
 
318
318
  console.log('[stx] Transition runtime initialized');
319
319
  })();
320
- `}function ph(e){let t=/@transition\.([a-z-]+)(?:\.(\d+))?="([^"]+)"/gi;return e.replace(t,(o,n,s,a)=>{let i=s||"300",r=`stx-t-${Math.random().toString(36).slice(2,7)}`;return`data-stx-transition="${n}" data-stx-transition-duration="${i}" data-stx-transition-condition="${a}" data-stx-transition-id="${r}"`})}
321
- export{ah,ch,lh,uh,dh,ph};
320
+ `}function mh(e){let t=/@transition\.([a-z-]+)(?:\.(\d+))?="([^"]+)"/gi;return e.replace(t,(o,n,s,a)=>{let i=s||"300",r=`stx-t-${Math.random().toString(36).slice(2,7)}`;return`data-stx-transition="${n}" data-stx-transition-duration="${i}" data-stx-transition-condition="${a}" data-stx-transition-id="${r}"`})}
321
+ export{uh,dh,ph,fh,gh,mh};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ar,Oe}from"./chunk-9zrvh3pz.js";export{ar as describeBuildFailure,Oe as formatBuildFailure};
@@ -0,0 +1,42 @@
1
+ // @bun
2
+ import{Tl,$l}from"./chunk-qjey0jk6.js";import{m,O,ut,p}from"./chunk-qa5y30sy.js";import{K,_r,Fs,zs,fi,mi,Hs,Lt,Be,ye,Q,Tr,$r,de,ee,L,ct,Rr,wi,Ir,We,s,g,G,En}from"./chunk-b6w0f610.js";import{n}from"./chunk-e634vffz.js";import{le}from"./chunk-xymr4ys9.js";import{pr}from"./chunk-01c16zw4.js";import{r}from"./chunk-x7redxyd.js";import{b}from"./chunk-94mpe1ny.js";import{createHash as kt}from"crypto";import Y from"fs";import Z from"path";import Le from"fs";function Ae(e,i,t){let o=Buffer.alloc(t),a=Le.readSync(e,o,0,t,i);return o.subarray(0,a)}function ze(e){if(e.length<25)return!1;let i=(o,a)=>String.fromCharCode(...e.subarray(o,a));if(i(0,4)!=="RIFF"||i(8,12)!=="WEBP")return!1;let t=i(12,16);if(t==="VP8X")return(e[20]&16)!==0;if(t==="VP8L")return((e[21]|e[22]<<8|e[23]<<16|e[24]<<24)>>>28&1)===1;return!1}function Ue(e){let i;try{i=Le.openSync(e,"r");let t=Ae(i,0,33);if(t.length>=3&&t[0]===255&&t[1]===216&&t[2]===255)return"none";if(t.length>=26&&t[0]===137&&t.toString("latin1",1,4)==="PNG"){let o=t[25];if(o===4||o===6)return"possible";let a=8;for(let c=0;c<64;c++){let l=Ae(i,a,8);if(l.length<8)return"unknown";let u=l.toString("latin1",4,8);if(u==="tRNS")return"possible";if(u==="IDAT"||u==="IEND")return"none";a+=12+l.readUInt32BE(0)}return"unknown"}if(t.length>=25&&t.toString("latin1",0,4)==="RIFF"&&t.toString("latin1",8,12)==="WEBP"){if(ze(t))return"possible";let o=t.toString("latin1",12,16);return o==="VP8 "||o==="VP8X"?"none":"unknown"}return"unknown"}catch{return"unknown"}finally{if(i!==void 0)Le.closeSync(i)}}import rn from"fs";import Fe from"os";import{fileURLToPath as yt}from"url";var _e=Symbol("stx.image-worker.unavailable");function sn(e=typeof Fe.availableParallelism==="function"?Fe.availableParallelism():Fe.cpus().length){return Math.max(1,Math.min(2,e-1))}var Pe=0,xt=[];async function on(){if(Pe<sn()){Pe++;return}await new Promise((e)=>xt.push(e)),Pe++}function an(){Pe--,xt.shift()?.()}var cn="@stacksjs/stx/builtins/image-warmup-worker";function ln(e=process.cwd()){let i=import.meta.url.endsWith(".ts")?"ts":"js";try{let t=new URL(`./image-warmup-worker.${i}`,import.meta.url);if(t.protocol==="file:"&&rn.existsSync(yt(t)))return yt(t)}catch{}return pr(cn,e)}var bt=!1;function fe(e){if(!bt)bt=!0,console.warn(`[stx] image worker unavailable (${e}); running the image pass on the serving thread instead. Results are the same, but requests may stall while it runs.`);return _e}function Ie(e){return e instanceof Error?e.message:String(e)}async function He(e,i){let t;try{t=(await import("worker_threads")).Worker}catch(a){return fe(`could not load node:worker_threads: ${Ie(a)}`)}if(typeof t!=="function")return fe("node:worker_threads has no Worker in this runtime");let o=ln();if(!o)return fe("no image-warmup-worker entry beside this module or in the installed @stacksjs/stx");await on();try{return await new Promise((a,c)=>{let l;try{l=new t(o)}catch(h){a(fe(`could not start ${o}: ${Ie(h)}`));return}let u=!1,f=!1,x=(h)=>{if(f)return;f=!0,h(),l.terminate()};l.on("message",(h)=>{if(h.type==="ready"){u=!0,l.postMessage({task:e,args:i});return}if(h.type==="result"){x(()=>a(h.value));return}let d=Error(h.error?.message??"image worker failed");if(h.error?.name)d.name=h.error.name;if(h.error?.stack)d.stack=h.error.stack;x(()=>c(d))}),l.on("error",(h)=>{x(()=>u?c(h instanceof Error?h:Error(Ie(h)||"image worker crashed")):a(fe(`the worker failed before it was ready: ${Ie(h)}`)))}),l.on("exit",(h)=>{x(()=>u?c(Error("image worker exited before it finished")):a(fe(`the worker exited with code ${h} before it was ready`)))})})}finally{an()}}var un=new Set([".avif",".jpeg",".jpg",".png",".webp"]),fn=[320,640,960,1280,1920],ve="/_stx/images",dn=`stx:${ve}:alpha-1`,gn=`stx:${ve}:opaque-1`,pn=["@stacksjs/ts-webp","@stacksjs/ts-avif","ts-images"],Ee;function mn(e,i){let t=Z.dirname(Bun.resolveSync(e,i));while(t!==Z.dirname(t)){let o=Z.join(t,"package.json");if(Y.existsSync(o)){let a=JSON.parse(Y.readFileSync(o,"utf8"));if(a.name===e)return a.version}t=Z.dirname(t)}return}function vt(){if(Ee!==void 0)return Ee;let e;try{e=Z.dirname(Bun.resolveSync("ts-images",import.meta.dir))}catch{}return Ee=pn.map((i)=>{let t;try{t=e?mn(i,e):void 0}catch{}return`${i.replace("@stacksjs/","")}@${t??"unknown"}`}).join("+"),Ee}var wt=Symbol.for("stx.image-delivery");function we(){let e=globalThis;return e[wt]??={catalog:new Map,transparent:new Set},e[wt]}var $t=new Set;function hn(e){return`/${e.split(Z.sep).map(encodeURIComponent).join("/")}`}function yn(e){let i=Z.extname(e),t=e.slice(0,-i.length).replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-+|-+$/g,""),o=kt("sha256").update(e).digest("hex").slice(0,8);return`${t||"image"}-${o}`}function St(e,i=`stx:${ve}`){let t=(o)=>`${ve}/${o.split("/").map(encodeURIComponent).join("/")}`;return{cacheNamespace:i,async stat(o){let a=Z.join(e,o);try{let c=await Y.promises.stat(a);return c.size>0?{bytes:c.size,path:a,url:t(o)}:null}catch{return null}},async write(o,a){let c=Z.join(e,o);await Y.promises.mkdir(Z.dirname(c),{recursive:!0});let l=`${c}.${process.pid}.tmp`;return await Y.promises.writeFile(l,a),await Y.promises.rename(l,c),{bytes:a.byteLength,path:c,url:t(o)}},url:t}}async function At(e,i=e){let t=await Y.promises.readdir(i,{withFileTypes:!0});t.sort((a,c)=>a.name.localeCompare(c.name));let o=[];for(let a of t){let c=Z.join(i,a.name);if(a.isDirectory()){o.push(...await At(e,c));continue}if(!a.isFile()||!un.has(Z.extname(a.name).toLowerCase()))continue;o.push({absolutePath:c,relativePath:Z.relative(e,c)})}return o}function Ct(e,i){return e.map((t)=>({key:hn(t.relativePath),input:t.absolutePath,name:yn(t.relativePath),...bn(t.absolutePath)?{options:{storage:i}}:{}}))}function bn(e){return Ue(e)==="possible"}function xn(e){for(let i=3;i<e.length;i+=4)if(e[i]!==255)return!0;return!1}async function vn(e){let i=Object.entries(e).filter(([,c])=>c.fallback.format==="png"),t=new Set,o=8;if(i.length===0)return t;let{decode:a}=await import("ts-images");for(let c=0;c<i.length;c+=8)await Promise.all(i.slice(c,c+8).map(async([l,u])=>{let f=u.variants.filter((x)=>x.format==="png").sort((x,h)=>x.width-h.width)[0];try{let x=await a(new Uint8Array(await Y.promises.readFile(f?.path??u.fallback.path)));if(xn(x.data))t.add(l)}catch{t.add(l)}}));return t}function wn(e,i){let t=[];for(let o of i){let a=e[o],c=a?.variants.filter((u)=>u.format==="webp")??[];if(!a||c.length===0)continue;if(!c.some((u)=>{let f;try{return f=Y.openSync(u.path,"r"),!ze(Ae(f,0,32))}catch{return!0}finally{if(f!==void 0)Y.closeSync(f)}}))continue;if(a.variants=a.variants.filter((u)=>u.format!=="webp"),delete a.sources.webp,t.push(o),!$t.has(o))$t.add(o),console.warn(`[stx-images] ${o} is transparent but its WebP variants have no alpha channel; serving PNG instead. Upgrade @stacksjs/ts-webp to 0.1.6 or later.`)}return t}async function $n(e){let i=[],t=8;if(e.length===0)return i;let{generateThumbHash:o}=await import("ts-images");for(let a=0;a<e.length;a+=8){let c=e.slice(a,a+8),l=await Promise.all(c.map(async(u)=>{try{return await o(u.absolutePath),u}catch{return console.warn(`[stx-images] Skipping unreadable raster: ${u.relativePath}`),null}}));i.push(...l.filter((u)=>u!==null))}return i}function qe(e){return Z.join(e,"undecodable.json")}function Sn(e){try{let i=Y.readFileSync(qe(e),"utf-8"),t=JSON.parse(i);return t&&typeof t==="object"?t:{}}catch{return{}}}function Cn(e,i){try{Y.mkdirSync(Z.dirname(qe(e)),{recursive:!0}),Y.writeFileSync(qe(e),JSON.stringify(i))}catch{}}function Rt(e){try{let i=Y.statSync(e);return{mtimeMs:i.mtimeMs,size:i.size}}catch{return}}function It(e){if(!e||e.startsWith("data:")||e.startsWith("blob:")||/^https?:\/\//i.test(e)||e.startsWith("//"))return;let i=e.split(/[?#]/,1)[0];if(!i)return;try{return`/${i.replace(/^\/+/,"").split("/").map(decodeURIComponent).map(encodeURIComponent).join("/")}`}catch{return}}function Uo(e){let i=It(e);return i?we().catalog.get(i):void 0}function Wo(e){let i=It(e);return i?we().transparent.has(i):!1}function qo(e){let i=(o)=>e.variants.filter((a)=>a.format===o).reduce((a,c)=>a+c.bytes,0),t=i(e.fallback.format);return["avif","webp"].map((o)=>({format:o,srcset:e.sources[o]||"",bytes:i(o)})).filter((o)=>o.srcset&&o.bytes>0&&o.bytes<t).sort((o,a)=>o.bytes-a.bytes).map(({format:o,srcset:a})=>({format:o,srcset:a}))}function Gh(e){let i=Uo(e);if(!i)return;return{src:i.fallback.url,srcset:i.sources[i.fallback.format]||"",sources:qo(i).map(({format:t,srcset:o})=>({type:`image/${t}`,srcset:o})),width:i.source.width,height:i.source.height,placeholder:Wo(e)?void 0:i.placeholder?.dataUrl}}function ys(){let e=we();e.catalog=new Map,e.transparent=new Set}function Rn(e){let i=we();i.catalog=new Map(e.entries),i.transparent=new Set(e.transparent)}async function Xh(e,i,t={}){if(!e||!Y.existsSync(e))return ys(),{count:0,fingerprint:""};if(t.offThread){let y=await He("delivery",{publicDir:e,outputDir:i});if(y!==_e)return Rn(y.state),y.result}let o=await At(e);if(o.length===0)return ys(),{count:0,fingerprint:""};let a=Sn(i),c=o.filter((y)=>{let w=a[y.relativePath];if(!w)return!0;let A=Rt(y.absolutePath);return!A||A.mtimeMs!==w.mtimeMs||A.size!==w.size});if(c.length===0)return ys(),{count:0,fingerprint:""};let l=St(Z.join(i,"_stx","images"),`${dn}:${vt()}`),u={outDir:Z.join(i,"_stx","images"),storage:St(Z.join(i,"_stx","images"),`${gn}:${vt()}`),baseUrl:ve,widths:fn,formats:["avif","webp"],quality:{avif:70,webp:78,jpeg:82,png:100},includeOriginal:!1,placeholder:!0,batchConcurrency:4,concurrency:4},{createImageDeliveryCatalog:f}=await import("ts-images/delivery"),x=c,h;try{h=await f({...u,entries:Ct(c,l)})}catch(y){if(x=await $n(c),x.length===c.length)throw y;let w=new Set(x.map((k)=>k.relativePath)),A=!1;for(let k of c){if(w.has(k.relativePath))continue;let R=Rt(k.absolutePath);if(!R)continue;a[k.relativePath]=R,A=!0}if(A)Cn(i,a);if(x.length===0)return ys(),{count:0,fingerprint:""};h=await f({...u,entries:Ct(x,l)})}let d=await vn(h.entries),C=wn(h.entries,d),v=we();v.catalog=new Map(Object.entries(h.entries)),v.transparent=d;let S=d.size===0&&C.length===0?h.fingerprint:kt("sha256").update(h.fingerprint).update(JSON.stringify({transparent:[...d].sort(),droppedWebp:C.sort()})).digest("hex");return{count:x.length,fingerprint:S}}class Pt{builtins=new Map;registerBuiltin(e){this.builtins.set(e.name.toLowerCase(),e);for(let i of e.aliases)this.builtins.set(i.toLowerCase(),e)}isBuiltin(e){return this.builtins.has(e.toLowerCase())}getBuiltin(e){return this.builtins.get(e.toLowerCase())??null}async resolveFile(e,i,t,o){let a=fi(e,o);if(a!==void 0)return a;for(let c of mi(e,i,t,o))if(await s(c))return c;return null}}var ge=new Pt;var se="\x00stx-boolean-attribute";function Xe(e){return e.indexOf("\x00")===-1?e:e.replace(/\0/g,"")}var kn=new Set(["accesskey","autocapitalize","autofocus","class","contenteditable","dir","draggable","enterkeyhint","exportparts","hidden","id","inert","inputmode","is","itemid","itemprop","itemref","itemscope","itemtype","lang","nonce","part","role","slot","spellcheck","style","tabindex","title","translate","accept","action","alt","autocomplete","capture","cite","cols","colspan","content","controls","datetime","default","download","enctype","for","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","href","hreflang","kind","label","loading","loop","max","maxlength","media","method","min","minlength","multiple","muted","name","open","pattern","placeholder","playsinline","poster","preload","readonly","referrerpolicy","rel","required","reversed","rows","rowspan","scope","selected","shape","size","span","src","srcdoc","srclang","srcset","start","step","target","type","usemap","value","width","wrap"]);function Ve(e){let i=e.toLowerCase();return i.startsWith("aria-")||i.startsWith("data-")||kn.has(i)}function ie(e,i){let t=[];for(let[o,a]of Object.entries(e.static)){if(i.has(o))continue;let c=e.staticNames?.[o]??o;if(typeof a==="boolean"){if(a)t.push(g(c));continue}if(a===se){t.push(g(c));continue}t.push(`${g(c)}="${En(c,Xe(String(a)))}"`)}return t}function oe(e,i){let t=[];for(let[o,a]of Object.entries(e.serverDynamic??{})){if(i.has(o))continue;if(a===null||a===void 0||a===!1)continue;let c=e.serverDynamicNames?.[o]??o;if(a===!0){t.push(g(c));continue}if(typeof a==="object")continue;t.push(`${g(c)}="${En(c,Xe(String(a)))}"`)}return t}function An(e){if(e.clientReactive.to)return{value:e.clientReactive.to,reactive:!0};if(e.serverDynamic.to!==void 0)return{value:String(e.serverDynamic.to),reactive:!1};if(typeof e.static.to==="string")return{value:e.static.to,reactive:!1};return{value:"#",reactive:!1}}var Ze={name:"StxLink",aliases:["stx-link"],render(e,i,t){let o=An(e),a=(typeof e.static.class==="string"?e.static.class:"")||(typeof e.static.className==="string"?e.static.className:""),c=typeof e.static.activeClass==="string"?e.static.activeClass:"active",l=typeof e.static.exactActiveClass==="string"?e.static.exactActiveClass:"exact-active",u=e.static.prefetch===!0||e.static.prefetch==="true"||e.serverDynamic.prefetch===!0,f=[];if(o.reactive)f.push(`:href="${n(o.value)}"`);else f.push(`href="${n(Tr(o.value,"navigable"))}"`);if(a)f.push(`class="${n(a)}"`);if(f.push("data-stx-link"),f.push(`data-stx-active-class="${n(c)}"`),f.push(`data-stx-exact-active-class="${n(l)}"`),u)f.push("data-stx-prefetch");let x=typeof e.static.activeMatch==="string"?e.static.activeMatch.trim():"";if(x)f.push(`data-stx-active-match="${n(x)}"`);let h=new Set(["to","class","className","activeClass","exactActiveClass","activeMatch","prefetch"]);return f.push(...ie(e,h)),f.push(...oe(e,h)),`<a ${f.join(" ")}>${i}</a>`}};var In=new Map;function Ge(e){if(!e)return;let i=e.split("?")[0].split("#")[0];return In.get(i)}var Pn={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},Ke=[320,640,768,1024,1280,1536,1920];function H(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);let t=e.static[i];if(typeof t==="string")return t;return}function Ne(e,i,t=!1){let o=e.serverDynamic[i];if(o!==void 0)return o!==!1&&o!=="false";let a=e.static[i];if(a!==void 0)return a!=="false"&&a!==!1;return t}function Je(e){if(e.includes("(")||e.includes(","))return e;let i=e.trim().split(/\s+/),t=[];for(let o of i)if(o.includes(":")){let[a,c]=o.split(":"),l=Pn[a];if(l)t.push(`(max-width: ${l}px) ${c}`);else{let u=Number.parseInt(a);if(!Number.isNaN(u))t.push(`(max-width: ${u}px) ${c}`)}}else t.push(o);return t.join(", ")}function Ye(e,i,t,o){return i.map((a)=>`${$e(e,a,void 0,t,o)} ${a}w`).join(", ")}function _n(e,i,t,o,a){return i.map((c)=>{let l=t?t*c:void 0;return`${$e(e,l,void 0,o,a)} ${c}x`}).join(", ")}function $e(e,i,t,o,a){if(!o||o==="local"||o==="static")return e;if(o==="cloudinary"){let c=[];if(i)c.push(`w_${i}`);if(t)c.push(`h_${t}`);if(a)c.push(`f_${a}`);c.push("q_auto");let l=c.join(",");return e.replace("/upload/",`/upload/${l}/`)}if(o==="imgix"){let c=new URLSearchParams;if(i)c.set("w",String(i));if(t)c.set("h",String(t));if(a)c.set("fm",a);c.set("auto","format");let l=e.includes("?")?"&":"?";return`${e}${l}${c.toString()}`}if(o==="bunny"){let c=new URLSearchParams;if(i)c.set("width",String(i));if(t)c.set("height",String(t));if(a)c.set("format",a);let l=e.includes("?")?"&":"?";return`${e}${l}${c.toString()}`}return e}function Nn(e){return`var s=this.style;${e.map((i)=>`s.${i}=''`).join(";")}`}function On(e,i,t="#e5e7eb"){let o=`<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${i}"><rect width="100%" height="100%" fill="${t}"/></svg>`;return`data:image/svg+xml;base64,${btoa(o)}`}var Qe={name:"StxImage",aliases:["Image","stx-image","stx-img"],render(e,i,t){let o=H(e,"src")||"",a=Uo(o),c=H(e,"alt")||"",l=H(e,"width")||(a?String(a.source.width):void 0),u=H(e,"height")||(a?String(a.source.height):void 0),f=H(e,"sizes"),x=H(e,"srcset"),h=H(e,"densities"),d=H(e,"format"),C=Wo(o)||Ge(o)?.transparent===!0,v=H(e,"placeholder")||(a&&!C?"thumbhash":void 0),S=H(e,"placeholderColor")||"#e5e7eb",y=H(e,"provider"),w=H(e,"class")||H(e,"className")||"",A=H(e,"style")||"",k=H(e,"objectFit")||H(e,"fit"),R=H(e,"objectPosition")||H(e,"position"),E=H(e,"quality"),J=Ne(e,"lazy",!0),M=Ne(e,"preload",!1),U=Ne(e,"priority",!1),z=H(e,"loading"),N=H(e,"decoding")||"async",q=!!a||Ne(e,"picture",!1)||!!d,I=l?Number.parseInt(l):void 0,_=u?Number.parseInt(u):void 0,T=x||"",F="";if(a)T=a.sources[a.fallback.format]||"",F=f?Je(f):"100vw";else if(!T&&f&&y&&y!=="local"&&y!=="static")T=Ye(o,Ke,y,d),F=Je(f);else if(!T&&h){let V=h.split(/\s+/).map((P)=>Number.parseFloat(P.replace("x","")));T=_n(o,V,I,y,d)}else if(f)F=Je(f);let D=[];if(A)D.push(A);if(k)D.push(`object-fit:${k}`);if(R)D.push(`object-position:${R}`);if(I&&_)D.push(`aspect-ratio:${I}/${_}`);let re=[],ae=v==="blur"||v==="color"||v==="thumbhash";if(ae&&!C){let V=a?.placeholder?{dataUrl:a.placeholder.dataUrl,color:S}:Ge(o);if(V&&v==="color")D.push(`background-color:${V.color}`),re.push("backgroundColor");else if(V)D.push(`background-color:${V.color}`),D.push(`background-image:url(${V.dataUrl})`),D.push("background-size:cover"),D.push("background-repeat:no-repeat"),re.push("backgroundColor","backgroundImage");else{let P=On(I||16,_||9,S);D.push(`background-image:url(${P})`),D.push("background-size:cover"),D.push("background-repeat:no-repeat"),re.push("backgroundImage")}}else if(!ae&&v&&v!=="empty"&&v!=="none")D.push(`background-image:url(${n(v)})`),D.push("background-size:cover"),D.push("background-repeat:no-repeat"),re.push("backgroundImage");let j=a?.fallback.url||$e(o,I,_,y,d),X=[];if(X.push(`src="${n(Tr(j,"fetched"))}"`),X.push(`alt="${n(c)}"`),l)X.push(`width="${n(l)}"`);if(u)X.push(`height="${n(u)}"`);let Re=z||(U||M?"eager":J?"lazy":"");if(Re)X.push(`loading="${n(Re)}"`);if(U)X.push('fetchpriority="high"');if(X.push(`decoding="${n(N)}"`),w)X.push(`class="${n(w)}"`);if(D.length>0)X.push(`style="${n(D.join(";"))}"`);if(T)X.push(`srcset="${n(Tr(T,"fetched"))}"`);if(F)X.push(`sizes="${n(F)}"`);let xe=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","objectFit","objectPosition","fit","position","format","provider","quality","densities","preload","priority","picture","loading","decoding"]);if(re.length>0){let V=typeof e.static.onload==="string"?e.static.onload:"",P=Nn(re)+(V?`;${V}`:"");X.push(`onload="${n(P)}"`),xe.add("onload")}X.push(...ie(e,xe)),X.push(...oe(e,xe));let ue=`<img ${X.join(" ")} />`,te="";if(M){let P=d==="webp"?"image/webp":d==="avif"?"image/avif":"";te=`<link rel="preload" as="image" href="${n(j)}"${P?` type="${P}"`:""}${T?` imagesrcset="${n(T)}"`:""}${F?` imagesizes="${n(F)}"`:""} />
3
+ `}if(q){let V=[];if(a)for(let P of qo(a))V.push(`<source type="image/${P.format}" srcset="${n(P.srcset)}"${F?` sizes="${n(F)}"`:""} />`);if(!a&&(d==="avif"||d==="auto")){let P=$e(o,I,_,y,"avif"),B=T?Ye(o,Ke,y,"avif"):`${P}`;V.push(`<source type="image/avif" srcset="${n(B)}"${F?` sizes="${n(F)}"`:""} />`)}if(!a&&(d==="webp"||d==="auto")){let P=$e(o,I,_,y,"webp"),B=T?Ye(o,Ke,y,"webp"):`${P}`;V.push(`<source type="image/webp" srcset="${n(B)}"${F?` sizes="${n(F)}"`:""} />`)}return`${te}<picture>
4
+ ${V.join(`
5
+ `)}
6
+ ${ue}
7
+ </picture>`}return`${te}${ue}`}};var _t="/images/safe-image-default.svg";function pe(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);let t=e.static[i];if(typeof t==="string")return t;return}var Bn=`<script>window.__stxSafeImageHandler||(window.__stxSafeImageHandler=function(i){if(i.__stx_fb)return;i.__stx_fb=1;var f=i.getAttribute('data-fallback')||'${_t}';var c=i.getAttribute('data-fallback-class');i.src=f;if(c)i.className=c;});</script>`,et={name:"SafeImage",aliases:["safe-image","safe-img"],render(e,i,t){let o=pe(e,"src")||"",a=pe(e,"alt")||"",c=pe(e,"fallback")||_t,l=pe(e,"class")||pe(e,"className")||"",u=pe(e,"fallbackClassName")||"",f=[];if(f.push(`src="${n(o)}"`),f.push(`alt="${n(a)}"`),l)f.push(`class="${n(l)}"`);if(f.push(`data-fallback="${n(c)}"`),u)f.push(`data-fallback-class="${n(u)}"`);f.push('onerror="window.__stxSafeImageHandler(this)"');let x=new Set(["src","alt","fallback","class","className","fallbackClassName"]);f.push(...ie(e,x)),f.push(...oe(e,x));let h=`<img ${f.join(" ")} />`,d=t.context;if(!d.__safeImageHandlerEmitted)return d.__safeImageHandlerEmitted=!0,`${Bn}${h}`;return h}};function tt(e){return e.replace(/[;{}()]/g,"").replace(/url/gi,"")}function Se(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);let t=e.static[i];if(typeof t==="string")return t;return}function Oe(e,i,t){let o=Se(e,i);if(o!==void 0){let a=Number.parseInt(o,10);if(!Number.isNaN(a))return a}return t}var nt={name:"StxLoadingIndicator",aliases:["stx-loading-indicator"],render(e,i,t){let o=tt(Se(e,"color")||"#6366f1"),a=tt(Se(e,"initialColor")||Se(e,"initial-color")||""),c=tt(Se(e,"height")||"3px"),l=Oe(e,"duration",2000),u=Oe(e,"throttle",200),f=Oe(e,"zIndex",999999)||Oe(e,"z-index",999999),x=a?`linear-gradient(to right, ${a}, ${o})`:o;return`
8
+ <div id="stx-loading-indicator" style="position:fixed;top:0;left:0;right:0;height:${c};background:${x};z-index:${f};transform:scaleX(0);transform-origin:left;transition:transform 0.1s ease-out,opacity 0.3s ease;opacity:0;pointer-events:none">
9
+ <div style="position:absolute;top:0;left:0;right:0;bottom:0;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,0.4) 50%,transparent 100%);animation:stx-shimmer 1.5s infinite"></div>
10
+ </div>
11
+ <style>@keyframes stx-shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}</style>
12
+ <script>
13
+ (function(){var el=document.getElementById('stx-loading-indicator'),p=0,l=!1,i=null;function u(v){p=Math.min(Math.max(v,0),100);if(el){el.style.opacity=p>0?'1':'0';el.style.transform='scaleX('+(p/100)+')'}}window.stxLoading={start:function(){l=!0;p=0;u(10);if(i)clearInterval(i);i=setInterval(function(){if(!l)return;var r=90-p,inc=Math.max(0.5,r*0.1);if(p<90)u(p+inc)},${u})},finish:function(){l=!1;if(i){clearInterval(i);i=null}u(100);setTimeout(function(){if(el)el.style.opacity='0';setTimeout(function(){p=0;if(el)el.style.transform='scaleX(0)'},300)},200)},set:function(v){u(v)},clear:function(){l=!1;p=0;if(i){clearInterval(i);i=null}if(el){el.style.opacity='0';el.style.transform='scaleX(0)'}}};document.addEventListener('click',function(e){var a=e.target.closest&&e.target.closest('a');if(!a)return;var h=a.getAttribute('href');if(!h||h.startsWith('http')||h.startsWith('#')||h.startsWith('mailto:')||h.startsWith('tel:')||a.target==='_blank')return;window.stxLoading.start()});window.addEventListener('popstate',function(){window.stxLoading.start()});window.addEventListener('load',function(){window.stxLoading.finish()})})();
14
+ </script>`}};function Nt(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);let t=e.static[i];if(typeof t==="string")return t;return}function Tn(e,i,t){let o=Nt(e,i);if(o!==void 0){let a=Number.parseInt(o,10);if(!Number.isNaN(a))return a}return t}var Et={"top-right":"top:1rem;right:1rem","top-left":"top:1rem;left:1rem","top-center":"top:1rem;left:50%;transform:translateX(-50%)","bottom-right":"bottom:1rem;right:1rem","bottom-left":"bottom:1rem;left:1rem","bottom-center":"bottom:1rem;left:50%;transform:translateX(-50%)"},rt={name:"StxToast",aliases:["stx-toast"],render(e,i,t){let o=n(Nt(e,"position")||"top-right"),a=Tn(e,"max",5),c=Et[o]||Et["top-right"];return`<div id="stx-toast-container" data-stx-toast-position="${o}" data-stx-toast-max="${a}" style="position:fixed;${c};z-index:999999;display:flex;flex-direction:column;gap:0.5rem;pointer-events:none;max-width:24rem;width:100%"></div>
15
+ <style>
16
+ @keyframes stx-toast-in{from{opacity:0;transform:translateX(100%)}to{opacity:1;transform:translateX(0)}}
17
+ @keyframes stx-toast-out{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(100%)}}
18
+ @keyframes stx-toast-in-left{from{opacity:0;transform:translateX(-100%)}to{opacity:1;transform:translateX(0)}}
19
+ @keyframes stx-toast-out-left{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-100%)}}
20
+ @keyframes stx-toast-in-center{from{opacity:0;transform:translateY(-1rem)}to{opacity:1;transform:translateY(0)}}
21
+ @keyframes stx-toast-out-center{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-1rem)}}
22
+ </style>`}};function Te(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);let t=e.static[i];if(typeof t==="string")return t;return}var Ot={sm:"max-width:24rem",md:"max-width:32rem",lg:"max-width:42rem",xl:"max-width:56rem",full:"max-width:calc(100vw - 2rem);max-height:calc(100vh - 2rem)"},st={name:"StxModal",aliases:["stx-modal"],render(e,i,t){let o=Te(e,"id");if(!o)return console.warn('[stx] <StxModal> requires an "id" prop'),"<!-- StxModal: missing id prop -->";let a=n(o),c=Te(e,"size")||"md",l=Te(e,"closeOnBackdrop")!=="false",u=Te(e,"closeOnEscape")!=="false",f=Ot[c]||Ot.md;return`<div id="stx-modal-${a}" class="stx-modal-backdrop" data-stx-modal="${a}" data-close-backdrop="${l}" data-close-escape="${u}" style="display:none;position:fixed;inset:0;z-index:99999;align-items:center;justify-content:center;background:rgba(0,0,0,0.5);backdrop-filter:blur(2px);opacity:0;transition:opacity 0.2s ease" aria-modal="true" role="dialog">
23
+ <div class="stx-modal-panel" style="${f};width:100%;margin:1rem;border-radius:0.75rem;box-shadow:0 20px 60px rgba(0,0,0,0.3);overflow:hidden;transform:scale(0.95) translateY(8px);transition:transform 0.2s ease,opacity 0.2s ease;opacity:0;background:var(--stx-modal-bg,#fff);color:var(--stx-modal-text,#1f2937)">
24
+ <div style="padding:1.5rem">${i}</div>
25
+ </div>
26
+ </div>
27
+ <style>
28
+ @media(prefers-color-scheme:dark){[data-stx-modal]{--stx-modal-bg:#1f2937;--stx-modal-text:#f3f4f6}}
29
+ .stx-modal-backdrop[data-stx-modal-open]{display:flex!important;opacity:1}
30
+ .stx-modal-backdrop[data-stx-modal-open] .stx-modal-panel{transform:scale(1) translateY(0);opacity:1}
31
+ </style>`}};function me(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);let t=e.static[i];if(typeof t==="string")return t;return}var Bt={sm:"16rem",md:"24rem",lg:"32rem",xl:"40rem"},it={name:"StxDrawer",aliases:["stx-drawer"],render(e,i,t){let o=me(e,"id");if(!o)return console.warn('[stx] <StxDrawer> requires an "id" prop'),"<!-- StxDrawer: missing id prop -->";let a=n(o),c=me(e,"side")||"right",l=me(e,"size")||"md",u=me(e,"closeOnBackdrop")!=="false",f=me(e,"closeOnEscape")!=="false",x=me(e,"overlay")!=="false",h=Bt[l]||Bt.md,d=c==="left",C=d?"left:0":"right:0",v=d?"translateX(-100%)":"translateX(100%)",S=d?"stx-drawer-slide-left":"stx-drawer-slide-right";return`<div id="stx-drawer-${a}" class="stx-drawer-backdrop" data-stx-drawer="${a}" data-close-backdrop="${u}" data-close-escape="${f}" style="display:none;position:fixed;inset:0;z-index:99999;${x?"background:rgba(0,0,0,0.5);backdrop-filter:blur(2px)":"background:transparent;pointer-events:none"};opacity:0;transition:opacity 0.2s ease" role="dialog" aria-modal="true">
32
+ <div class="stx-drawer-panel" style="position:fixed;top:0;bottom:0;${C};width:${h};max-width:100vw;transform:${v};transition:transform 0.3s cubic-bezier(0.4,0,0.2,1);background:var(--stx-drawer-bg,#fff);color:var(--stx-drawer-text,#1f2937);box-shadow:0 20px 60px rgba(0,0,0,0.3);overflow-y:auto;pointer-events:auto">
33
+ <div style="padding:1.5rem">${i}</div>
34
+ </div>
35
+ </div>
36
+ <style>
37
+ @media(prefers-color-scheme:dark){[data-stx-drawer]{--stx-drawer-bg:#1f2937;--stx-drawer-text:#f3f4f6}}
38
+ .stx-drawer-backdrop[data-stx-drawer-open]{display:block!important;opacity:1}
39
+ .stx-drawer-backdrop[data-stx-drawer-open] .stx-drawer-panel{transform:translateX(0)}
40
+ </style>`}};import{existsSync as Dn,readFileSync as jn}from"fs";var De=new Map,Tt=new Set;function Mn(e){if(Tt.has(e))return;Tt.add(e),console.warn(`[stx] icon collection "${e}" is not installed, so its icons render as nothing. Install it with \`bun add -d @iconify-json/${e}\`.`)}function Ln(e){let i=process.cwd();for(let t of[`${i}/node_modules/@iconify-json/${e}/icons.json`,`${i}/pantry/@iconify-json/${e}/icons.json`,`${i}/node_modules/@iconify/json/json/${e}.json`,`${i}/pantry/@iconify/json/json/${e}.json`])if(Dn(t))return t;for(let t of[`@iconify-json/${e}/icons.json`,`@iconify/json/json/${e}.json`])try{return b.resolve(t)}catch{}return null}function zn(e){if(De.has(e))return De.get(e);let i=Ln(e);if(!i)return Mn(e),null;try{let t=JSON.parse(jn(i,"utf8"));return De.set(e,t),t}catch{return null}}function Un(e,i,t,o){let a=[];if(i.rotate)a.push(`rotate(${i.rotate*90} ${t/2} ${o/2})`);if(i.hFlip)a.push(`translate(${t} 0) scale(-1 1)`);if(i.vFlip)a.push(`translate(0 ${o}) scale(1 -1)`);return a.length?`<g transform="${a.join(" ")}">${e}</g>`:e}function Fn(e,i){let t=i,o=e.icons[t],a={hFlip:!1,vFlip:!1,rotate:0};for(let u=0;!o&&u<8;u++){let f=e.aliases?.[t];if(!f)return null;if(f.hFlip)a.hFlip=!a.hFlip;if(f.vFlip)a.vFlip=!a.vFlip;if(f.rotate)a.rotate=((a.rotate+f.rotate)%4+4)%4;t=f.parent,o=e.icons[t]}if(!o)return null;let c=o.width??e.width??24,l=o.height??e.height??24;return{body:Un(o.body,a,c,l),width:c,height:l}}function he(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);if(e.static[i]!==void 0)return String(e.static[i]);if(e.clientReactive[i]!==void 0)return e.clientReactive[i];return}var ot={name:"Icon",aliases:["icon","stx-icon"],render(e,i,t){let o=he(e,"name")??he(e,"icon");if(!o)return"<!-- Icon: missing name/icon prop -->";let a="lucide",c=o;if(o.includes(":")){let w=o.split(":");a=w[0],c=w[1]}let l=n(he(e,"size")||"24"),u=n(he(e,"color")||"currentColor"),f=n(he(e,"class")||""),x=n(he(e,"style")||""),h=De.get(a)??zn(a);if(!h)return`<!-- Icon: collection "${a}" not loaded -->`;let d=Fn(h,c);if(!d)return`<!-- Icon: "${c}" not found in ${a} -->`;let C=`0 0 ${d.width} ${d.height}`,v=d.body;if(u!=="currentColor")v=v.replace(/currentColor/g,u);let S=f?` class="${f}"`:"",y=x?` style="${x}"`:"";return`<svg xmlns="http://www.w3.org/2000/svg" width="${l}" height="${l}" viewBox="${C}" fill="none"${S}${y}>${v}</svg>`}};function Dt(e,...i){for(let t of i){if(e.serverDynamic[t]!==void 0)return String(e.serverDynamic[t]);let o=e.static[t];if(typeof o==="string")return o}return}function jt(e,i){let t=new RegExp(`<(template|div|span)[^>]*\\bslot=["']${i}["'][^>]*>([\\s\\S]*?)<\\/\\1>`,"i"),o=e.match(t);if(!o)return{region:null,rest:e};return{region:o[2],rest:e.replace(o[0],"")}}var at={name:"Suspense",aliases:["suspense"],render(e,i,t){let o=jt(i,"fallback"),a=o.rest,c=jt(a,"error"),l=c.rest,u=o.region??Dt(e,"fallback")??'<div class="stx-suspense-loading">Loading\u2026</div>',f=c.region??Dt(e,"errorFallback","error-fallback")??'<div class="stx-suspense-error">Something went wrong.</div>';return`<div data-stx-suspense><div data-stx-suspense-fallback>${u}</div><div data-stx-suspense-error hidden>${f}</div><div data-stx-suspense-content hidden>${l}</div></div>`}};function je(e,...i){for(let t of i){if(e.serverDynamic[t]!==void 0)return String(e.serverDynamic[t]);let o=e.static[t];if(typeof o==="string")return o}return}var lt={name:"TransitionGroup",aliases:["transition-group"],render(e,i,t){let o=(je(e,"name")||"v").replace(/["'<>]/g,""),a=(je(e,"tag")||"div").replace(/[^a-z0-9-]/gi,"")||"div",c=je(e,"class"),l=je(e,"id"),u=[`data-stx-transition-group="${o}"`,c?`class="${c}"`:"",l?`id="${l}"`:""].filter(Boolean).join(" ");return`<${a} ${u}>${i}</${a}>`}};function Mt(e=ge){e.registerBuiltin(Ze),e.registerBuiltin(Qe),e.registerBuiltin(et),e.registerBuiltin(nt),e.registerBuiltin(rt),e.registerBuiltin(st),e.registerBuiltin(it),e.registerBuiltin(ot),e.registerBuiltin(at),e.registerBuiltin(lt)}var zt=new Map;function Wn(e){let i=zt.get(e.source);if(!i)i=new RegExp(`(${e.source})(?![\\w.:-])`,"y"),zt.set(e.source,i);return i}var Ut=new WeakMap;function Ft(e){let i=Ut.get(e);if(!i)i=new Set([...e].map((o)=>o.toLowerCase())),Ut.set(e,i);let t=i;return(o)=>!/[a-z]/.test(o)&&t.has(o.toLowerCase())}function Hn(e,i){let t="";for(let o=i;o<e.length;o++){let a=e[o];if(t){if(a==="\\")o++;else if(a===t)t=""}else if(a==='"'||a==="'")t=a;else if(a===">")return o}return e.length}function Wt(e,i,t){let o=[],a=0,c=typeof t==="function"?t:t?(l)=>t.has(l.toLowerCase()):void 0;while(a<e.length){let l=e.indexOf("<",a);if(l===-1)break;let u=Wn(i);u.lastIndex=l+1;let f=u.exec(e);if(!f){a=l+1;continue}let x=f[1];if(c&&c(x)){let w=l+1+x.length;while(w<e.length&&e[w]!==">")w++;a=w+1;continue}let h=l+1+x.length,d=null,C=h,v=-1,S=!1;while(h<e.length){let w=e[h];if(d){if(w==="\\"&&h+1<e.length){h+=2;continue}if(w===d)d=null;h++;continue}if(w==='"'||w==="'"){d=w,h++;continue}if(w==="/"&&h+1<e.length&&e[h+1]===">"){v=h+2,S=!0;break}if(w===">"){v=h+1;break}h++}if(v===-1){a=l+1;continue}let y=e.slice(C,S?v-2:v-1).trim();if(S)o.push({fullMatch:e.slice(l,v),tagName:x,attributes:y,content:"",startIndex:l,endIndex:v,isSelfClosing:!0}),a=v;else{let w=`<${x}`,A=`</${x}>`,k=1,R=v,E=-1;while(k>0&&R<e.length){let U=e.indexOf(w,R),z=e.indexOf(A,R);if(z===-1)break;if(U!==-1&&U<z){let N=e[U+w.length];if(N===" "||N===">"||N==="/"||N===`
41
+ `||N==="\t"){let q=Hn(e,U+w.length);if(e[q-1]!=="/")k++;R=q+1}else R=U+w.length}else{if(k--,k===0){E=z;break}R=z+A.length}}if(E===-1){a=v;continue}let J=e.slice(v,E),M=E+A.length;o.push({fullMatch:e.slice(l,M),tagName:x,attributes:y,content:J,startIndex:l,endIndex:M,isSelfClosing:!1}),a=M}}return o}function ft(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#0?39;/g,"'").replace(/&#x27;/gi,"'").replace(/&amp;/g,"&")}function Ht(e,i){try{let t=Buffer.from(e,"base64").toString("utf8");return JSON.parse(t)}catch{}try{let t=e.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&");return JSON.parse(t)}catch(t){if(i?.debug)console.error("Error decoding __stx_ prop:",t);return e}}function Me(e,i){let t=0,o="",a=i;while(a<e.length){let c=e[a];if(o){if(c==="\\")a++;else if(c===o)o=""}else if(c==='"'||c==="'"||c==="`")o=c;else if(c==="{")t++;else if(c==="}"){if(t--,t===0)return e.slice(i,a+1)}a++}return e.slice(i)}function qt(e){let i=e.trim();if(!i.startsWith("{")||!i.endsWith("}"))return null;if(Me(i,0).length!==i.length)return null;return i.slice(1,-1).trim()}function Xt(e){let i=[],t=0,o=e.length;while(t<o){while(t<o&&/\s/.test(e[t]))t++;if(t>=o)break;let a="";while(t<o&&!/[\s=]/.test(e[t]))a+=e[t],t++;if(!a)break;while(t<o&&/\s/.test(e[t]))t++;if(t<o&&e[t]==="="){t++;while(t<o&&/\s/.test(e[t]))t++;let c="";if(t<o&&(e[t]==='"'||e[t]==="'")){let l=e[t];t++;while(t<o&&e[t]!==l){if(e[t]==="\\"&&t+1<o)t++,c+=e[t];else c+=e[t];t++}if(t<o)t++}else if(e[t]==="{")c=Me(e,t),t+=c.length;else while(t<o&&!/\s/.test(e[t]))c+=e[t],t++;i.push({name:a,value:c})}else i.push({name:a,value:!0})}return i}var qn=new Set(["disabled","checked","readonly","required","autofocus","autoplay","controls","default","defer","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","reversed","selected"]),Xn=new Set([":for","x-for","v-for","@for"]),Vt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function Vn(e){return dt(e).map((i)=>[i.start,i.end])}function dt(e){let i=[],t=new Map;for(let o of Lt(e)){let a=o.name.toLowerCase();if(o.closing){let x=t.get(a)?.pop();if(x)x.end=o.end;continue}let l=/(?::for|x-for|v-for|@for)\s*=/.test(o.attributes)?Xt(o.attributes).find((x)=>Xn.has(x.name)):void 0,u=typeof l?.value==="string"?l.value:null,f=u!==null?{start:o.start,end:o.end,names:ee(u),tag:a}:null;if(f)i.push(f);if(!o.selfClosing&&!Vt.has(a)){let x=t.get(a);if(!x)x=[],t.set(a,x);x.push(f)}}return i}var Zn=/(?:^|\s)((?:[\w-]+:)*-?space-[xy]-(?!reverse(?:\s|$))[\w./[\]-]+)(?=\s|$)/;function Zt(e){let i=new Map,t=[];for(let o of Lt(e)){let a=o.name.toLowerCase();if(o.closing){for(let l=t.length-1;l>=0;l--)if(t[l].name===a){t.length=l;break}continue}let c=t.at(-1);if(c){if(c.utility&&c.children>0)i.set(o.start,c.utility);if(!/(?:^|\s)hidden(?=[\s=]|$)/.test(o.attributes))c.children++}if(!o.selfClosing&&!Vt.has(a)){let l=/(?:^|\s)class\s*=\s*(["'])([\s\S]*?)\1/.exec(o.attributes)?.[2];t.push({name:a,utility:l?Zn.exec(l)?.[1]??null:null,children:0})}}return i}function Gt(e){if(typeof e==="string")return e;if(Array.isArray(e))return e.filter(Boolean).map((i)=>Gt(i)).join(" ");if(e&&typeof e==="object")return Object.entries(e).filter(([,i])=>i).map(([i])=>i).join(" ");return e?String(e):""}function vc(e,i){if(!/:[\w-]+=/.test(e))return e;let t=e,o=/<(script|style)\b[^>]*>[\s\S]*?<\/\1>/gi,a=[],c;while((c=o.exec(e))!==null)a.push([c.index,c.index+c[0].length]);a.push(...Vn(e));let l=new Set([...ct(i),...Array.isArray(i.__stx_client_declared_names)?i.__stx_client_declared_names:[]]);function u(d){return a.some(([C,v])=>d>=C&&d<v)}let f=[],x=new Map,h=256;for(let d of Lt(t)){if(d.closing||u(d.start))continue;let C=d.attributes.trimEnd();if(!C||!C.includes(":"))continue;let v=/(?:^|\s)data-native(?:\s|=|$)/i.test(C.replace(/"[^"]*"|'[^']*'/g,"")),S=/\s:([a-zA-Z_][\w-]*)\s*=\s*"([^"]*)"/g,y,w=C,A=!1;while((y=S.exec(C))!==null){if($r(C,y.index,!0)?.kind==="attribute")continue;let k=y[1],R=y[2];if(Tl(k))continue;if(L(R,l))continue;if(R.includes("()")&&!R.includes(".get(")||R.includes("$store")||R.includes("$ref"))continue;try{let E=Object.keys(i),J=Object.values(i),M=R.match(/^([a-zA-Z_$][\w$]*)/);if(M&&!E.includes(M[1])&&!["true","false","null","undefined","Math","JSON","String","Number","Array","Object","Date","parseInt","parseFloat"].includes(M[1]))continue;let U=JSON.stringify([E,R]),z=x.get(U);if(!z){if(z=Function(...E,`return (${R})`),x.size>=h)x.clear();x.set(U,z)}let N=z(...J);if(k==="class"){let q=G(Gt(N));if(q){let I=w.match(/\sclass="([^"]*)"/);if(I)w=w.replace(I[0],()=>` class="${I[1]} ${q}"`);else w=w.replace(y[0],()=>` class="${q}"`)}else w=w.replace(y[0],"");A=!0;continue}if(qn.has(k)){if(N)w=w.replace(y[0],` ${k}`);else w=w.replace(y[0],"");A=!0;continue}if(N===null||N===void 0||N===!1)w=w.replace(y[0],"");else{let q=v&&typeof N==="object"?JSON.stringify(N):String(N),I=En(k,q);w=w.replace(y[0],()=>` ${k}="${I}"`)}A=!0}catch(E){if(E instanceof de)throw E;continue}}if(A){let k=d.selfClosing?" /":"",E=`<${d.name}${w}${k}>`;f.push({start:d.start,end:d.end,replacement:E})}}if(f.length>0){let d=Array(f.length*2+1),C=0;for(let v=0;v<f.length;v++){let{start:S,end:y,replacement:w}=f[v];d[v*2]=t.slice(C,S),d[v*2+1]=w,C=y}d[f.length*2]=t.slice(C),t=d.join("")}return t}import Kt from"fs";import Jt from"path";var Yt=!1;function Gn(e,i,t,o=!1,a=new Set){let c={static:{},staticNames:{},serverDynamic:{},serverDynamicNames:{},clientReactive:{},events:{}},l=new Set(Array.isArray(i.__stx_client_signal_names)?i.__stx_client_signal_names:[]),u=(d)=>{if(l.size===0)return!1;let C=r(d),v=C.match(/^\s*[!+~(-]*\s*([a-zA-Z_$][\w$]*)/)?.[1];if(v&&l.has(v))return!0;for(let S of l){let y=S.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`(?:^|[^\\w$.])${y}\\s*\\(`).test(C))return!0}return!1},f=new Set($l),x=(d)=>{if(!d.includes("-")||d.startsWith("@")||d.startsWith(":")||d.startsWith("x-")||d.startsWith("__"))return d;if(d.startsWith("aria-")||d.startsWith("data-"))return d;return d.replace(/-([a-z0-9])/g,(C,v)=>v.toUpperCase())},h=(d,C)=>{let v=x(d);if(c.static[v]=C,v!==d)c.staticNames[v]=d};for(let[d,C]of Object.entries(e)){let v=d.startsWith("x-")&&!f.has(d)&&!d.startsWith("x-bind:")&&!d.startsWith("x-on:")?`:${d.slice(2)}`:d;if(v.startsWith("@")){c.events[v]=C;continue}if(v.startsWith("__stx_")){let S=x(v.slice(6));c.serverDynamic[S]=Ht(C,t);continue}if(v.startsWith(":")){let S=x(v.slice(1)),y=C===se?S:C;if(S==="if"||S==="for"||S==="show"){c.clientReactive[S]=y;continue}if(o){c.clientReactive[S]=y;continue}if(L(y,a)){c.clientReactive[S]=y;continue}if(u(y)){c.clientReactive[S]=y;continue}try{if(!m(y)){if(t.debug)console.error(`Unsafe expression in :${S} binding: ${y}`);c.clientReactive[S]=y;continue}let w=Object.keys(i),A=new Set(["true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","if","else"]),k=new Set(Array.isArray(i.__stx_client_declared_names)?i.__stx_client_declared_names:[]);if(ut(y).some((M)=>!A.has(M)&&!w.includes(M)&&(!(M in globalThis)||k.has(M)))){c.clientReactive[S]=y;continue}let J=p(y,w)(...Object.values(i));if(c.serverDynamic[S]=J,S!==v.slice(1)&&c.serverDynamicNames)c.serverDynamicNames[S]=v.slice(1)}catch{c.clientReactive[S]=y}continue}if(typeof C==="string"&&C.includes("{{")&&C.includes("}}")){let S=Qn(C,a);if(S!==null){c.clientReactive[x(v)]=S;continue}let y=C.match(/^\{\{\s*([\s\S]+?)\s*\}\}$/);if(y)try{let w=y[1];if(m(w)){let k=p(w,Object.keys(i))(...Object.values(i));h(v,k!=null?String(k):"")}else{if(t.debug)console.error(`Unsafe expression in ${v}: ${w}`);h(v,C)}}catch(w){if(t.debug)console.error(`Error evaluating expression for ${v}:`,w);h(v,C)}else{let w=C,A=/\{\{\s*([\s\S]+?)\s*\}\}/g,k;while((k=A.exec(C))!==null)try{let R=k[1];if(!m(R)){if(t.debug)console.error(`Unsafe expression in ${v}: ${R}`);continue}let J=p(R,Object.keys(i))(...Object.values(i));w=w.replace(k[0],String(J??""))}catch(R){if(t.debug)console.error(`Error evaluating expression in ${v}:`,R)}h(v,w)}continue}h(v,C===se?"true":ft(C))}return c}var gt=new Set;function Jh(){gt.clear()}function Kn(e){let i=/^\s*(?:<!--[\s\S]*?-->\s*)*<(?:div|span)\b((?:[^>"']|"[^"]*"|'[^']*')*)>/.exec(e);return!!i&&/\sdata-stx-component-wrapper(?=[\s=]|$)/.test(i[1])&&!/\sstx-hydrate(?=[\s=]|$)/.test(i[1])}function Jn(e,i,t){let o=`${t}\x00${e}\x00${i}`;if(gt.has(o))return;gt.add(o);let a=/space-x-/.test(i)?"flex":"flex flex-col",c=i.replace(/space-[xy]-/,"gap-");console.warn(`[stx] <${e}> in ${t} is a later child of a "${i}" stack, so it gets no spacing: the utility puts its margin on the component's scope wrapper, which generates no box. Use "${a} ${c}" on the parent instead -- gap reaches through the wrapper.`)}var pt=new Set;function Yh(){pt.clear()}function Yn(e,i){let t=`${i}\x00${e}`;if(pt.has(t))return;pt.add(t),console.warn(`[stx] <${e}> in ${i} is inside a <template :for>, so its props and slot expressions will not see the loop variables and render empty. Put the directive on the element the loop repeats instead -- <tr :for="..."> or <span :for="..." class="contents"> -- which binds correctly.`)}function Qn(e,i){if(i.size===0)return null;let t=/\{\{\s*([\s\S]+?)\s*\}\}/g,o=[...e.matchAll(t)];if(!o.some((u)=>L(u[1],i)))return null;let a=e.match(/^\{\{\s*([\s\S]+?)\s*\}\}$/);if(a&&o.length===1)return a[1];let c="",l=0;for(let u of o)c+=e.slice(l,u.index).replace(/[`\\$]/g,(f)=>`\\${f}`),c+=`\${${u[1]}}`,l=u.index+u[0].length;return c+=e.slice(l).replace(/[`\\$]/g,(u)=>`\\${u}`),`\`${c}\``}var er=[[/@if\s*\(/,"@endif"],[/@unless\s*\(/,"@endunless"]];function tr(e,i,t){if(!e.includes("@"))return e;if(!er.some(([a,c])=>a.test(e)&&e.includes(c)))return e;try{return le(e,i,t)}catch{return e}}function be(e){let i={},t=0,o=e.length;while(t<o){while(t<o&&/\s/.test(e[t]))t++;if(t>=o)break;let a="";while(t<o&&!/[\s=]/.test(e[t]))a+=e[t],t++;if(!a)break;while(t<o&&/\s/.test(e[t]))t++;if(t<o&&e[t]==="="){t++;while(t<o&&/\s/.test(e[t]))t++;let c="";if(t<o&&(e[t]==='"'||e[t]==="'")){let l=e[t];t++;while(t<o){let u=e[t];if(u==="\\"&&t+1<o){t++,c+=e[t],t++;continue}if(u===l){t++;break}c+=u,t++}}else if(e[t]==="{"){c=Me(e,t),t+=c.length;let l=qt(c);if(l!==null){i[`:${a}`]=l;continue}}else while(t<o&&!/\s/.test(e[t]))c+=e[t],t++;i[a]=c}else i[a]=se}return i}function Qt(e){return Object.entries(e).map(([i,t])=>t===se?i:`${i}="${nr(t)}"`).join(" ")}function nr(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function rr(e){let i=new Set,t=/<([A-Z][A-Za-z0-9]*|stx-[a-z0-9-]+)\b[^>]*>/g,o;while((o=t.exec(e))!==null){let a=o[1];if(ge.isBuiltin(a))i.add(a)}return[...i].sort()}async function Xf(e,i,t,o,a){if(!/import\s/.test(e))return e;if(!i.__importedComponents)i.__importedComponents=new Map;let c=i.__importedComponents,l=Jt.dirname(t),u=[],f=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi;for(let d of e.matchAll(f)){let[C,v,S]=d,y=/import\s+(?:(\{[^}]*\})|([A-Za-z_$][\w$]*))\s+from\s+['"]([^'"]+)['"]\s*;?\s*\n?/g,w=S,A,k=[];while((A=y.exec(S))!==null){let[R,E,J,M]=A,U=null,z=null;if(M.startsWith(".")||M.startsWith("/")){let I=Jt.resolve(l,M);if(I.endsWith(".stx"))z=I;else{let _=`${I}.stx`;try{if(Kt.statSync(_).isFile())z=_}catch{try{if(Kt.statSync(I).isDirectory())U=I}catch{}}}}else U=Fs(M,l);if(!U&&!z)continue;let N=!1,q=(I,_)=>{c.set(I,_),c.set(I.toLowerCase(),_);let T=I.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();c.set(T,_),a.add(_)};if(J&&z)q(J,z),N=!0;else if(E){let I=E.slice(1,-1).split(",").map((T)=>T.trim()).filter(Boolean).map((T)=>{let F=T.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(F)return{source:F[1],local:F[2]};return{source:T,local:T}}),_=U?_r(U):null;for(let{source:T,local:F}of I){let D=null;if(z)D=z;else if(_)D=_.get(T)??_.get(T.toLowerCase())??_.get(T.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase())??null;if(D)q(F,D),N=!0}}if(N)k.push({start:A.index,end:A.index+R.length})}if(k.length===0)continue;for(let R=k.length-1;R>=0;R--)w=w.slice(0,k[R].start)+w.slice(k[R].end);u.push({start:d.index,end:d.index+C.length,value:`<script${v}>${w}</script>`})}if(u.length===0)return e;let x=[],h=0;for(let d of u)x.push(e.slice(h,d.start),d.value),h=d.end;return x.push(e.slice(h)),x.join("")}async function sr(e,i,t,o,a){let c=e;if(!i.__importedComponents)i.__importedComponents=new Map;let l=i.__importedComponents,u=/@import\s*\(\s*([^)]+)\s*\)/g,f;while((f=u.exec(c))!==null){let[x,h]=f,d=h.split(",").map((C)=>C.trim().replace(/^['"]|['"]$/g,"")).filter((C)=>C.length>0);for(let C of d){let v=C.split("/"),y=v[v.length-1].replace(/\.stx$/,""),w=y.includes("-")?y.split("-").map((R)=>R.charAt(0).toUpperCase()+R.slice(1)).join(""):y.charAt(0).toUpperCase()+y.slice(1),A=null,k=zs(C,t,o);for(let R of k)try{if(await Bun.file(R).exists()){A=R;break}}catch{}if(A){l.set(w,A),l.set(y,A),l.set(y.toLowerCase(),A);let R=w.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();if(l.set(R,A),a.add(A),o.debug)console.log(`Imported component: ${w} -> ${A}`)}else if(o.debug)console.warn(`Could not resolve imported component: ${C}`)}c=c.replace(x,""),u.lastIndex=0}return c}async function ir(e,i,t,o,a){let c=e,l=o.componentsDir||"components";if(!i.__processedComponents)i.__processedComponents=new Set;let u=i.__processedComponents,f=/@component\s*\(/g,x;while((x=f.exec(c))!==null){let h=x.index,d=h+x[0].length-1,C=1,v=d+1;while(v<c.length&&C>0){if(c[v]==="(")C++;else if(c[v]===")"){if(C--,C===0)break}v++}if(C!==0)break;let S=c.substring(d+1,v),y=v+1,w=S.match(/^\s*['"]([^'"]+)['"]/);if(!w){f.lastIndex=y;continue}let A=w[1],k,R=S.slice(w[0].length),E=R.match(/^\s*,\s*/);if(E)k=R.slice(E[0].length).trim();let J={};if(k)try{J=O(k,i)}catch(I){let _=I instanceof Error?I.message:String(I);c=c.replace(c.substring(h,y),`[Error parsing component props: ${_}]`);continue}let M="",U=y,N=c.substring(y).match(/^([\s\S]*?)@endcomponent/);if(N)M=N[1].trim(),U=y+N[0].length;let q=await We(A,J,M,l,i,t,o,u,a);c=c.substring(0,h)+q+c.substring(U),f.lastIndex=0}return c}async function or(e,i,t,o,a){if(!e)return e;let c=e,l=o.componentsDir||"components";if(!i.__processedComponents)i.__processedComponents=new Set;let u=i.__processedComponents,f=lr(c);if(f.size>0){let y=Array.isArray(i.__stx_client_declared_names)?i.__stx_client_declared_names:[];i.__stx_client_declared_names=[...new Set([...y,...f])]}let x=Q(c);c=x.output;let h=ct(i);return c=await S(c,/[a-z][a-z0-9]*-[a-z0-9-]*/,!1),c=await S(c,/[A-Z][a-zA-Z0-9]*/,!0,Ft(Rr)),c=await S(c,/[a-z][a-z0-9]*/,!1,Rr),c=x.restore(c),c;async function S(y,w,A,k){if(!y)return y;let R=y,E=Wt(R,w,k),J=dt(R),M=!o._nativeHostAttrs&&/space-[xy]-/.test(R),U,z=new Map;for(let I=E.length-1;I>=0;I--){let _=E[I],T=A?K(_.tagName):_.tagName,F=be(tr(_.attributes,i,t)),D=J.filter(({start:B,end:W})=>_.startIndex>=B&&_.startIndex<W);if(D.some((B)=>B.tag==="template"))Yn(_.tagName,t);let re=D.length>0,ae=new Set(h);for(let B of D)for(let W of B.names)ae.add(W);let j=Gn(F,i,o,re,ae);if(typeof j.clientReactive.for==="string")for(let B of ee(j.clientReactive.for))ae.add(B);let X=ge.getBuiltin(_.tagName),Re=X?await Ir(_.tagName,l,i,t,o):!1,xe=_.tagName==="Image"&&Hs([...Object.keys(j.static),...Object.keys(j.serverDynamic),...Object.keys(j.clientReactive)],Object.keys(j.events),{...j.static,...j.serverDynamic})&&(o._pluginComponentDirs??[]).some((B)=>_r(B).has("Image"));if(X&&!Re&&!xe){let B={context:i,filePath:t,options:o,dependencies:a},W=X.render(j,_.content,B);if(Object.keys(j.events).length>0){let ce=Qt(j.events);W=W.replace(/^(\s*<[a-zA-Z][a-zA-Z0-9-]*)/,`$1 ${ce}`)}if(Object.keys(j.clientReactive).length>0)W=en(W,j.clientReactive);z.set(I,W);continue}if(!A&&_.tagName.includes("-")&&!await Ir(T,l,i,t,o))continue;let ue={};for(let[B,W]of Object.entries(j.static))ue[B]=W;for(let[B,W]of Object.entries(j.serverDynamic))ue[B]=W;let te={declaredProps:new Set,consumedProps:new Set,reactiveProps:Object.keys(j.clientReactive),events:Object.keys(j.events)},V=await We(T,ue,x.restore(_.content),l,i,t,o,u,a,[...ae],te,_.tagName);if(M&&Kn(V)){U??=Zt(R);let B=U.get(_.startIndex);if(B)Jn(_.tagName,B,t)}let P=V;if(P=ar(P,j,te.declaredProps,te.consumedProps,o._nativeHostAttrs),o._nativeHostAttrs){let B=te.reactiveProps.filter((ne)=>!te.consumedProps.has(ne)&&!["if","for","show","key","ref"].includes(ne)).map(K),W=mt(P,!0);if(B.length&&W){if(!Object.hasOwn(be(P.slice(W.insertPos,W.tagEnd)),"data-stx-native-host-root"))P=P.slice(0,W.insertPos)+' data-stx-native-host-root="true"'+P.slice(W.insertPos);let ne=Ce(P);P=P.slice(0,ne.insertPos)+` data-stx-native-forward="${B.join(" ")}"`+P.slice(ne.insertPos)}let ce=mt(P,!0);if(ce){let ne=be(P.slice(ce.insertPos,ce.tagEnd)),ke=Ce(P),nn=be(P.slice(ke.insertPos,ke.tagEnd));if(Object.hasOwn(ne,"data-stx-native-host-root")&&!Object.hasOwn(nn,"data-stx-native-host-owner"))P=P.slice(0,ke.insertPos)+" data-stx-native-host-owner"+P.slice(ke.insertPos)}}if(Object.keys(j.events).length>0){let B=Ce(P);if(B){let W=Qt(j.events),ce=Object.keys(j.events).map((ne)=>ne.replace(/^@/,"").split(".")[0]).join(" ");P=P.substring(0,B.insertPos)+` data-stx-parent-events="${ce}" ${W}`+P.substring(B.insertPos)}}if(Object.keys(j.clientReactive).length>0)P=en(P,j.clientReactive);z.set(I,P)}if(z.size===0)return R;let N="",q=0;for(let I=0;I<E.length;I++){let _=z.get(I);if(_===void 0)continue;N+=R.slice(q,E[I].startIndex),N+=_,q=E[I].endIndex}return N+=R.slice(q),N}}function en(e,i){let t=new Set(["if","for"]),o=new Set(["show"]),a=Object.entries(i).filter(([h])=>!t.has(h)),c=a.filter(([h])=>!o.has(h)).map(([h])=>K(h)).join(" "),l=e,u=a.length>0?Ce(l):null;if(u){let h=a.map(([C,v])=>`:${K(C)}="${v.replace(/"/g,"&quot;")}"`).join(" "),d=c?` data-stx-parent-bindings="${c}"`:"";l=l.substring(0,u.insertPos)+`${d} ${h}`+l.substring(u.insertPos)}let f=i.if;if(f)l=`<template :if="${f.replace(/"/g,"&quot;")}">${l}</template>`;let x=i.for;if(x){let h=i.key,d=h?` :key="${h.replace(/"/g,"&quot;")}"`:"";l=`<template :for="${x.replace(/"/g,"&quot;")}"${d}>${l}</template>`}return l}function ar(e,i,t=new Set,o=new Set,a=!1){let c=mt(e,a);if(!c)return e;let l=e.slice(c.insertPos,c.tagEnd),u=i.serverDynamic.class??i.static.class;if(a&&typeof u==="string"&&u&&!o.has("class")){let S=/(^|\s)class\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i,y=S.test(l)?l.replace(S,(w,A,k,R,E)=>`${A}class="${n(`${ft(k??R??E)} ${u}`)}"`):` class="${n(u)}"${l}`;e=e.slice(0,c.insertPos)+y+e.slice(c.tagEnd),c.tagEnd+=y.length-l.length,l=y}let f=a||/\bdata-native(?:\s|=)/i.test(l),x=f?o:t,h=new Set(Object.keys(be(l))),d=new Set(["class","className"]);for(let S of Object.keys(i.static)){let y=i.staticNames[S]??S;if(h.has(y)||x.has(S)||!f&&!Ve(y))d.add(S)}for(let S of Object.keys(i.serverDynamic)){let y=i.serverDynamicNames?.[S]??S;if(h.has(y)||x.has(S)||!f&&!Ve(y))d.add(S)}let C=[];if(f){for(let[S,y]of Object.entries(i.static)){if(d.has(S)||y!==!0&&y!==se)continue;d.add(S),C.push(`${n(i.staticNames?.[S]??S)}="true"`)}for(let[S,y]of Object.entries(i.serverDynamic)){if(d.has(S)||y!==!0)continue;d.add(S),C.push(`${n(i.serverDynamicNames?.[S]??S)}="true"`)}}let v=[...ie(i,d),...oe(i,d),...C];if(f){for(let[S,y]of Object.entries(i.serverDynamic)){if(d.has(S)||y!==!1)continue;let w=i.serverDynamicNames?.[S]??S;v.push(`${n(w)}="false"`)}for(let[S,y]of Object.entries(i.serverDynamic)){if(d.has(S)||y===null||typeof y!=="object")continue;let w=JSON.stringify(y);if(w!==void 0){let A=i.serverDynamicNames?.[S]??S;v.push(`${n(A)}="${n(w)}"`)}}}if(v.length===0)return e;return`${e.slice(0,c.insertPos)} ${v.join(" ")}${e.slice(c.insertPos)}`}function Ce(e){let i=tn(e,0);if(i)return i;let t=/<([a-zA-Z][a-zA-Z0-9-]*)\b[^>]*\bdata-stx-scope(?:\s|=|>)/i.exec(e);if(t)return{insertPos:t.index+1+t[1].length,tagEnd:ht(e,t.index+1+t[1].length)};return null}function mt(e,i=!1){let t=Ce(e);if(!t)return null;let o=e.slice(t.insertPos,t.tagEnd),a=/\bdata-stx-component-wrapper(?:\s|=|>|$)/i.test(o)?tn(e,t.tagEnd+1):t;return a&&i?cr(e,a)??a:a}function cr(e,i){if(!e.includes("data-stx-native-host-root"))return null;let t=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),o=e.lastIndexOf("<",i.insertPos),a=0,c;while(o>=0&&o<e.length){if(e.startsWith("<!--",o)){let h=e.indexOf("-->",o+4);if(h<0)return null;o=e.indexOf("<",h+3);continue}let l=/^<(\/?)([a-z][\w-]*)\b/i.exec(e.slice(o));if(!l){o=e.indexOf("<",o+1);continue}let u=l[2].toLowerCase(),f=o+l[0].length,x=ht(e,f);if(l[1]){if(a--,c!==void 0&&a<c)c=void 0;if(a<=0)return null}else if(u==="script"||u==="style"){let h=new RegExp(`</${u}\\s*>`,"gi");if(h.lastIndex=x+1,!h.exec(e))return null;o=e.indexOf("<",h.lastIndex);continue}else{let h=be(e.slice(f,x)),d=a>0&&(Object.hasOwn(h,"data-stx-component-wrapper")||Object.hasOwn(h,"data-stx-native-host-owner"));if(c===void 0&&!d&&Object.hasOwn(h,"data-stx-native-host-root"))return{insertPos:f,tagEnd:x};if(!t.has(u)&&e[x-1]!=="/"){if(a++,c===void 0&&d)c=a}else if(a===0)return null}o=e.indexOf("<",x+1)}return null}function tn(e,i){let t=i;while(t<e.length){let o=e.slice(t),a=o.match(/^\s+/);if(a){t+=a[0].length;continue}if(o.startsWith("<!--")){let u=e.indexOf("-->",t+4);if(u===-1)return null;t=u+3;continue}let c=o.match(/^<(script|style)\b[^>]*>/i);if(c){let u=`</${c[1].toLowerCase()}>`,f=e.toLowerCase().indexOf(u,t+c[0].length);if(f===-1)return null;t=f+u.length;continue}let l=o.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(?:\s|>|\/)/);if(!l)return null;return{insertPos:t+1+l[1].length,tagEnd:ht(e,t+1+l[1].length)}}return null}function ht(e,i){let t="";for(let o=i;o<e.length;o++){let a=e[o];if(t){if(a==="\\")o++;else if(a===t)t=""}else if(a==='"'||a==="'")t=a;else if(a===">")return o}return e.length}function lr(e){let i=new Set;for(let t of e.matchAll(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi)){let o=t[1];if(!/\bclient\b/.test(o)||/\bserver\b/.test(o))continue;for(let a of wi(t[2]))i.add(a);for(let a of t[2].matchAll(/^\s*import\s+(?:type\s+)?(?:([\w$]+)\s*,?\s*)?(?:\{([^}]*)\}|\*\s+as\s+([\w$]+))?\s*from\s/gm)){if(a[1])i.add(a[1]);if(a[3])i.add(a[3]);for(let c of(a[2]??"").split(",")){let l=c.replace(/^\s*type\s+/,"").split(/\s+as\s+/).pop().trim();if(/^[A-Za-z_$][\w$]*$/.test(l))i.add(l)}}}return i}async function bs(e,i,t,o,a){if(!Yt)Mt(ge),Yt=!0;let c=await Xf(e,i,t,o,a);c=await sr(c,i,t,o,a),c=await ir(c,i,t,o,a);let l=[];for(let u=0;u<3;u++){let f=l.length,x=ye(c,Be,(d,C)=>`\x00STX_COMPONENT_COMMENT_${f+C}\x00`,`STX_COMPONENT_COMMENT:${f}`);l.push(...x.tokens);let h=c;if(c=await or(x.output,i,t,o,a),c===h)break}if(l.length>0)c=c.replace(/\x00STX_COMPONENT_COMMENT_(\d+)\x00/g,(u,f)=>l[Number(f)]??"");if(o.debug){let u=rr(c);if(u.length>0)console.warn(`[stx] ${t}: unresolved component tag(s) after render passes: ${u.join(", ")}. Check nested component output for malformed root tags or recursive component markup.`)}return c}
42
+ export{Uo,Wo,qo,Gh,ys,Xh,vc,Jh,Yh,Xf,bs};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{h,_i,ol,il,_g,Cg,Eg,Tg,$g,Js,Rg,Ve,te,Ue,Ag,Ir,Pg,ll,ul,Ti,We,s,_n,dl,y,be,gy}from"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{ul as SIGNAL_COMPOSABLE_CALL,be as clearComponentCache,Ti as componentClientSignalNames,_i as convertToCommonJS,y as createDetailedErrorMessage,$g as extractDirectiveNames,ol as extractScriptFromTemplate,h as extractVariables,s as fileExists,gy as getComponentCacheStats,Cg as getPositionInfo,te as getSharedTranspiler,dl as getSourceLineInfo,Tg as hasDirectives,il as hasVariables,Pg as isHydrateTrigger,Rg as isJavaScriptScript,We as renderComponentWithSlot,_n as resolveTemplatePath,Ag as scopeOnRootElement,Js as scopeSequenceKey,Ve as shouldTranspileTypeScript,ll as slotContentHasExpressions,Ue as transpileTypeScript,Ir as userComponentFileExists,Eg as validateDirective,_g as validateTemplate};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{xh,Co,Sh,kh,_h,Ch}from"./chunk-5p1k2h5q.js";import"./chunk-wtfamngc.js";import"./chunk-wk4wg6sn.js";import"./chunk-9zrvh3pz.js";import"./chunk-y036cwc7.js";import"./chunk-nttsc0aw.js";import"./chunk-zsnmk5me.js";import"./chunk-yhc1c4tr.js";import"./chunk-r4v4vswq.js";import"./chunk-tnp2ta5q.js";import"./chunk-669b2bya.js";import"./chunk-mfa07erx.js";import"./chunk-x512h2gv.js";import"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{Ch as clearStoreCache,xh as getStoreScript,_h as getStoreScriptFor,kh as pageStoresAll,Co as storesRead,Sh as storesReadInFiles};
@@ -1,8 +1,8 @@
1
1
  // @bun
2
- import d from"fs";import l from"path";function Al(n){let s=[],e=n.pwa;if(s.push({id:"pwa-enabled",name:"PWA Enabled",category:"required",passed:e?.enabled===!0,message:e?.enabled?"PWA is enabled":"PWA is not enabled in config"}),!e?.enabled)return s;s.push({id:"manifest-name",name:"App Name",category:"required",passed:Boolean(e.manifest?.name),message:e.manifest?.name?`App name: "${e.manifest.name}"`:"Missing required manifest name"}),s.push({id:"manifest-short-name",name:"Short Name",category:"recommended",passed:Boolean(e.manifest?.shortName),message:e.manifest?.shortName?`Short name: "${e.manifest.shortName}"`:"Short name not set (will use full name)"}),s.push({id:"manifest-description",name:"App Description",category:"recommended",passed:Boolean(e.manifest?.description),message:e.manifest?.description?"Description is set":"App description not provided"}),s.push({id:"manifest-theme-color",name:"Theme Color",category:"required",passed:Boolean(e.manifest?.themeColor),message:e.manifest?.themeColor?`Theme color: ${e.manifest.themeColor}`:"Theme color not set"}),s.push({id:"manifest-background-color",name:"Background Color",category:"required",passed:Boolean(e.manifest?.backgroundColor),message:e.manifest?.backgroundColor?`Background color: ${e.manifest.backgroundColor}`:"Background color not set"}),s.push({id:"manifest-display",name:"Display Mode",category:"required",passed:["standalone","fullscreen","minimal-ui"].includes(e.manifest?.display||""),message:e.manifest?.display?`Display mode: ${e.manifest.display}`:"Display mode should be standalone, fullscreen, or minimal-ui"}),s.push({id:"manifest-start-url",name:"Start URL",category:"required",passed:Boolean(e.manifest?.startUrl),message:e.manifest?.startUrl?`Start URL: ${e.manifest.startUrl}`:"Start URL not set"}),s.push({id:"icons-source",name:"Icon Source",category:"required",passed:Boolean(e.icons?.src),message:e.icons?.src?`Icon source: ${e.icons.src}`:"No icon source configured"});let a=e.icons?.sizes||[];s.push({id:"icons-192",name:"192x192 Icon",category:"required",passed:a.includes(192),message:a.includes(192)?"192x192 icon will be generated":"Missing 192x192 icon (required for Android)"}),s.push({id:"icons-512",name:"512x512 Icon",category:"required",passed:a.includes(512),message:a.includes(512)?"512x512 icon will be generated":"Missing 512x512 icon (required for splash screen)"}),s.push({id:"icons-maskable",name:"Maskable Icon",category:"recommended",passed:e.icons?.purpose?.includes("maskable")||!1,message:e.icons?.purpose?.includes("maskable")?"Maskable icon purpose is set":"Consider adding maskable icon purpose for adaptive icons"}),s.push({id:"sw-configured",name:"Service Worker",category:"required",passed:Boolean(e.serviceWorker),message:e.serviceWorker?"Service worker is configured":"Service worker configuration missing"}),s.push({id:"sw-cache-version",name:"Cache Version",category:"recommended",passed:Boolean(e.serviceWorker?.cacheVersion),message:e.serviceWorker?.cacheVersion?`Cache version: ${e.serviceWorker.cacheVersion}`:"Set cache version for proper cache busting"}),s.push({id:"offline-enabled",name:"Offline Support",category:"required",passed:e.offline?.enabled===!0,message:e.offline?.enabled?"Offline support is enabled":"Offline support is disabled"});let t=e.routes||[];return s.push({id:"caching-strategies",name:"Caching Strategies",category:"recommended",passed:t.length>0,message:t.length>0?`${t.length} route caching strategies configured`:"No custom caching strategies defined"}),s.push({id:"push-config",name:"Push Notifications",category:"optional",passed:!e.push?.enabled||Boolean(e.push?.vapidPublicKey),message:e.push?.enabled?e.push?.vapidPublicKey?"Push notifications configured with VAPID key":"Push enabled but missing VAPID key":"Push notifications not enabled"}),s.push({id:"share-target",name:"Share Target",category:"optional",passed:!0,message:e.shareTarget?.enabled?`Share target enabled at ${e.shareTarget.action}`:"Share target not enabled"}),s.push({id:"auto-inject",name:"Auto-injection",category:"recommended",passed:e.autoInject!==!1,message:e.autoInject!==!1?"PWA tags will be auto-injected":"Auto-injection disabled - manual tag insertion required"}),s}function Pl(n){let s=[],e=l.join(n,"manifest.json"),a=d.existsSync(e);if(s.push({id:"build-manifest",name:"Manifest File",category:"required",passed:a,message:a?"manifest.json exists":"manifest.json not found in build output"}),a)try{let r=JSON.parse(d.readFileSync(e,"utf-8"));s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!0,message:"Manifest is valid JSON"}),s.push({id:"build-manifest-icons",name:"Manifest Icons",category:"required",passed:Array.isArray(r.icons)&&r.icons.length>0,message:r.icons?.length?`${r.icons.length} icons defined in manifest`:"No icons defined in manifest"})}catch{s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!1,message:"Manifest is not valid JSON"})}let t=l.join(n,"sw.js"),c=d.existsSync(t);s.push({id:"build-sw",name:"Service Worker File",category:"required",passed:c,message:c?"Service worker (sw.js) exists":"Service worker not found in build output"});let o=l.join(n,"offline.html"),u=d.existsSync(o);s.push({id:"build-offline",name:"Offline Page",category:"recommended",passed:u,message:u?"Offline page exists":"No offline.html found"});let i=l.join(n,"pwa-icons");if(d.existsSync(i)){let r=d.readdirSync(i).filter((m)=>m.endsWith(".png")||m.endsWith(".webp"));s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:r.length>0,message:r.length>0?`${r.length} icon files generated`:"No icon files found"})}else s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:!1,message:"Icons directory not found"});return s}function Il(n){let s=n.filter((i)=>i.category==="required"),e=n.filter((i)=>i.category==="recommended"),a=s.filter((i)=>i.passed).length,t=e.filter((i)=>i.passed).length,c=s.length>0?a/s.length*70:70,o=e.length>0?t/e.length*30:30;return{score:Math.round(c+o),passed:n.filter((i)=>i.passed).length,failed:n.filter((i)=>!i.passed&&i.category==="required").length,warnings:n.filter((i)=>!i.passed&&i.category!=="required").length,checks:n}}function Mg(n,s){let e=Al(n),a=s&&d.existsSync(s)?Pl(s):[];return Il([...e,...a])}function Dg(n){let s=[];s.push(`
2
+ import d from"fs";import l from"path";function Ol(n){let s=[],e=n.pwa;if(s.push({id:"pwa-enabled",name:"PWA Enabled",category:"required",passed:e?.enabled===!0,message:e?.enabled?"PWA is enabled":"PWA is not enabled in config"}),!e?.enabled)return s;s.push({id:"manifest-name",name:"App Name",category:"required",passed:Boolean(e.manifest?.name),message:e.manifest?.name?`App name: "${e.manifest.name}"`:"Missing required manifest name"}),s.push({id:"manifest-short-name",name:"Short Name",category:"recommended",passed:Boolean(e.manifest?.shortName),message:e.manifest?.shortName?`Short name: "${e.manifest.shortName}"`:"Short name not set (will use full name)"}),s.push({id:"manifest-description",name:"App Description",category:"recommended",passed:Boolean(e.manifest?.description),message:e.manifest?.description?"Description is set":"App description not provided"}),s.push({id:"manifest-theme-color",name:"Theme Color",category:"required",passed:Boolean(e.manifest?.themeColor),message:e.manifest?.themeColor?`Theme color: ${e.manifest.themeColor}`:"Theme color not set"}),s.push({id:"manifest-background-color",name:"Background Color",category:"required",passed:Boolean(e.manifest?.backgroundColor),message:e.manifest?.backgroundColor?`Background color: ${e.manifest.backgroundColor}`:"Background color not set"}),s.push({id:"manifest-display",name:"Display Mode",category:"required",passed:["standalone","fullscreen","minimal-ui"].includes(e.manifest?.display||""),message:e.manifest?.display?`Display mode: ${e.manifest.display}`:"Display mode should be standalone, fullscreen, or minimal-ui"}),s.push({id:"manifest-start-url",name:"Start URL",category:"required",passed:Boolean(e.manifest?.startUrl),message:e.manifest?.startUrl?`Start URL: ${e.manifest.startUrl}`:"Start URL not set"}),s.push({id:"icons-source",name:"Icon Source",category:"required",passed:Boolean(e.icons?.src),message:e.icons?.src?`Icon source: ${e.icons.src}`:"No icon source configured"});let a=e.icons?.sizes||[];s.push({id:"icons-192",name:"192x192 Icon",category:"required",passed:a.includes(192),message:a.includes(192)?"192x192 icon will be generated":"Missing 192x192 icon (required for Android)"}),s.push({id:"icons-512",name:"512x512 Icon",category:"required",passed:a.includes(512),message:a.includes(512)?"512x512 icon will be generated":"Missing 512x512 icon (required for splash screen)"}),s.push({id:"icons-maskable",name:"Maskable Icon",category:"recommended",passed:e.icons?.purpose?.includes("maskable")||!1,message:e.icons?.purpose?.includes("maskable")?"Maskable icon purpose is set":"Consider adding maskable icon purpose for adaptive icons"}),s.push({id:"sw-configured",name:"Service Worker",category:"required",passed:Boolean(e.serviceWorker),message:e.serviceWorker?"Service worker is configured":"Service worker configuration missing"}),s.push({id:"sw-cache-version",name:"Cache Version",category:"recommended",passed:Boolean(e.serviceWorker?.cacheVersion),message:e.serviceWorker?.cacheVersion?`Cache version: ${e.serviceWorker.cacheVersion}`:"Set cache version for proper cache busting"}),s.push({id:"offline-enabled",name:"Offline Support",category:"required",passed:e.offline?.enabled===!0,message:e.offline?.enabled?"Offline support is enabled":"Offline support is disabled"});let t=e.routes||[];return s.push({id:"caching-strategies",name:"Caching Strategies",category:"recommended",passed:t.length>0,message:t.length>0?`${t.length} route caching strategies configured`:"No custom caching strategies defined"}),s.push({id:"push-config",name:"Push Notifications",category:"optional",passed:!e.push?.enabled||Boolean(e.push?.vapidPublicKey),message:e.push?.enabled?e.push?.vapidPublicKey?"Push notifications configured with VAPID key":"Push enabled but missing VAPID key":"Push notifications not enabled"}),s.push({id:"share-target",name:"Share Target",category:"optional",passed:!0,message:e.shareTarget?.enabled?`Share target enabled at ${e.shareTarget.action}`:"Share target not enabled"}),s.push({id:"auto-inject",name:"Auto-injection",category:"recommended",passed:e.autoInject!==!1,message:e.autoInject!==!1?"PWA tags will be auto-injected":"Auto-injection disabled - manual tag insertion required"}),s}function Nl(n){let s=[],e=l.join(n,"manifest.json"),a=d.existsSync(e);if(s.push({id:"build-manifest",name:"Manifest File",category:"required",passed:a,message:a?"manifest.json exists":"manifest.json not found in build output"}),a)try{let r=JSON.parse(d.readFileSync(e,"utf-8"));s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!0,message:"Manifest is valid JSON"}),s.push({id:"build-manifest-icons",name:"Manifest Icons",category:"required",passed:Array.isArray(r.icons)&&r.icons.length>0,message:r.icons?.length?`${r.icons.length} icons defined in manifest`:"No icons defined in manifest"})}catch{s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!1,message:"Manifest is not valid JSON"})}let t=l.join(n,"sw.js"),c=d.existsSync(t);s.push({id:"build-sw",name:"Service Worker File",category:"required",passed:c,message:c?"Service worker (sw.js) exists":"Service worker not found in build output"});let o=l.join(n,"offline.html"),u=d.existsSync(o);s.push({id:"build-offline",name:"Offline Page",category:"recommended",passed:u,message:u?"Offline page exists":"No offline.html found"});let i=l.join(n,"pwa-icons");if(d.existsSync(i)){let r=d.readdirSync(i).filter((m)=>m.endsWith(".png")||m.endsWith(".webp"));s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:r.length>0,message:r.length>0?`${r.length} icon files generated`:"No icon files found"})}else s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:!1,message:"Icons directory not found"});return s}function Ml(n){let s=n.filter((i)=>i.category==="required"),e=n.filter((i)=>i.category==="recommended"),a=s.filter((i)=>i.passed).length,t=e.filter((i)=>i.passed).length,c=s.length>0?a/s.length*70:70,o=e.length>0?t/e.length*30:30;return{score:Math.round(c+o),passed:n.filter((i)=>i.passed).length,failed:n.filter((i)=>!i.passed&&i.category==="required").length,warnings:n.filter((i)=>!i.passed&&i.category!=="required").length,checks:n}}function jg(n,s){let e=Ol(n),a=s&&d.existsSync(s)?Nl(s):[];return Ml([...e,...a])}function Bg(n){let s=[];s.push(`
3
3
  === PWA Audit Report ===
4
4
  `);let e=n.score>=90?"32":n.score>=70?"33":"31";s.push(`Score: \x1B[${e}m${n.score}/100\x1B[0m`),s.push(`Passed: ${n.passed} | Failed: ${n.failed} | Warnings: ${n.warnings}
5
5
  `);let a=["required","recommended","optional"];for(let t of a){let c=n.checks.filter((o)=>o.category===t);if(c.length===0)continue;s.push(`
6
6
  ${t.toUpperCase()}:`);for(let o of c){let u=o.passed?"\x1B[32m\u2713\x1B[0m":"\x1B[31m\u2717\x1B[0m";if(s.push(` ${u} ${o.name}: ${o.message}`),o.details)s.push(` ${o.details}`)}}return s.push(""),s.join(`
7
7
  `)}
8
- export{Al,Pl,Il,Mg,Dg};
8
+ export{Ol,Nl,Ml,jg,Bg};
@@ -1,30 +1,30 @@
1
1
  // @bun
2
- import S from"fs";import _ from"path";function go(e){let{token:t,baseUrl:i="https://api.netlify.com/api/v1"}=e;async function s(n,r,l={}){let p=`${i}${r}`,f={Authorization:`Bearer ${t}`,"User-Agent":"stx-deploy/1.0"},u;if(l.rawBody)f["Content-Type"]=l.contentType||"application/octet-stream",u=l.rawBody;else if(l.body)f["Content-Type"]="application/json",u=JSON.stringify(l.body);let o=await fetch(p,{method:n,headers:f,body:u});if(!o.ok){let g=Error(`Netlify API error: ${o.status} ${o.statusText}`);g.status=o.status;try{let b=await o.json();g.message=b.message||g.message,g.code=b.code,g.details=b}catch{}throw g}let a=await o.text();if(!a)return{};return JSON.parse(a)}return{async getSite(n){return s("GET",`/sites/${n}`)},async listSites(){return s("GET","/sites")},async createSite(n){let r={};if(n)r.name=n;return s("POST","/sites",{body:r})},async createDeploy(n,r){let l={files:r.files,draft:r.draft??!0,async:r.async??!0};if(r.title)l.title=r.title;if(r.branch)l.branch=r.branch;if(r.functions)l.functions=r.functions;return s("POST",`/sites/${n}/deploys`,{body:l})},async uploadFile(n,r,l){let p=r.startsWith("/")?r.slice(1):r;await s("PUT",`/deploys/${n}/files/${p}`,{rawBody:l,contentType:"application/octet-stream"})},async uploadFiles(n,r){let p=[...r],f=async()=>{while(p.length>0){let o=p.shift();if(o)await this.uploadFile(n,o.path,o.content)}},u=Array.from({length:Math.min(5,r.length)},()=>f());await Promise.all(u)},async getDeploy(n){return s("GET",`/deploys/${n}`)},async waitForDeploy(n,r={}){let{timeout:l=300000,pollInterval:p=2000,onProgress:f}=r,u=Date.now();while(!0){let o=await this.getDeploy(n);if(f)f(o);if(o.state==="ready")return o;if(o.state==="error"){let a=Error(`Deploy failed: ${o.error_message||"Unknown error"}`);throw a.status=500,a.details=o,a}if(Date.now()-u>l){let a=Error(`Deploy timed out after ${l}ms`);throw a.status=408,a.details=o,a}await new Promise((a)=>setTimeout(a,p))}},async lockDeploy(n){return s("POST",`/deploys/${n}/lock`)},async unlockDeploy(n){return s("POST",`/deploys/${n}/unlock`)}}}async function ca(e){let t=await crypto.subtle.digest("SHA-1",e);return Array.from(new Uint8Array(t)).map((s)=>s.toString(16).padStart(2,"0")).join("")}async function Kr(e,t={}){let{ignore:i=["node_modules",".git",".env*","*.map"]}=t,s=[],n=new Bun.Glob("**/*");for await(let r of n.scan({cwd:e,onlyFiles:!0,dot:!1})){if(i.some((a)=>{if(a.includes("*"))return new RegExp(`^${a.replace(/\*/g,".*")}$`).test(r);return r.includes(a)}))continue;let p=`${e}/${r}`,u=await Bun.file(p).arrayBuffer(),o=await ca(u);s.push({path:r,content:new Uint8Array(u),sha1:o})}return s}function mo(e){let t={};for(let i of e)t[`/${i.path}`]=i.sha1;return t}function ho(e,t){let i=new Set(t.map((s)=>s.startsWith("/")?s.slice(1):s));return e.filter((s)=>i.has(s.path))}function On(e){if(e<1024)return`${e} B`;if(e<1048576)return`${(e/1024).toFixed(1)} KB`;if(e<1073741824)return`${(e/1048576).toFixed(1)} MB`;return`${(e/1073741824).toFixed(1)} GB`}function Jt(e){return e.reduce((t,i)=>t+i.content.byteLength,0)}import m from"fs";import y from"path";function la(e){let t=[];if(t.push("[build]"),t.push(` command = "${d(e.build.command)}"`),t.push(` publish = "${d(e.build.publish)}"`),e.build.functions)t.push(` functions = "${d(e.build.functions)}"`);if(e.build.edge_functions)t.push(` edge_functions = "${d(e.build.edge_functions)}"`);if(e.build.environment&&Object.keys(e.build.environment).length>0){t.push(""),t.push("[build.environment]");for(let[i,s]of Object.entries(e.build.environment))t.push(` ${i} = "${d(s)}"`)}if(e.functions){if(t.push(""),t.push("[functions]"),e.functions.directory)t.push(` directory = "${d(e.functions.directory)}"`);if(e.functions.node_bundler)t.push(` node_bundler = "${e.functions.node_bundler}"`);if(e.functions.external_node_modules&&e.functions.external_node_modules.length>0)t.push(` external_node_modules = [${e.functions.external_node_modules.map((i)=>`"${i}"`).join(", ")}]`)}if(e.edge_functions&&e.edge_functions.length>0){t.push("");for(let i of e.edge_functions)t.push("[[edge_functions]]"),t.push(` function = "${d(i.function)}"`),t.push(` path = "${d(i.path)}"`)}if(e.redirects&&e.redirects.length>0){t.push("");for(let i of e.redirects){if(t.push("[[redirects]]"),t.push(` from = "${d(i.from)}"`),t.push(` to = "${d(i.to)}"`),i.status!==void 0)t.push(` status = ${i.status}`);if(i.force!==void 0)t.push(` force = ${i.force}`);if(i.conditions&&Object.keys(i.conditions).length>0){t.push(" [redirects.conditions]");for(let[s,n]of Object.entries(i.conditions))t.push(` ${s} = "${d(n)}"`)}}}if(e.headers&&e.headers.length>0){t.push("");for(let i of e.headers){t.push("[[headers]]"),t.push(` for = "${d(i.for)}"`),t.push(" [headers.values]");for(let[s,n]of Object.entries(i.values))t.push(` ${s} = "${d(n)}"`)}}if(e.plugins&&e.plugins.length>0){t.push("");for(let i of e.plugins)if(t.push("[[plugins]]"),t.push(` package = "${d(i.package)}"`),i.inputs&&Object.keys(i.inputs).length>0){t.push(" [plugins.inputs]");for(let[s,n]of Object.entries(i.inputs))if(typeof n==="string")t.push(` ${s} = "${d(n)}"`);else if(typeof n==="boolean"||typeof n==="number")t.push(` ${s} = ${n}`)}}if(e.context&&Object.keys(e.context).length>0)for(let[i,s]of Object.entries(e.context)){if(t.push(""),t.push(`[context.${i}]`),s.command)t.push(` command = "${d(s.command)}"`);if(s.publish)t.push(` publish = "${d(s.publish)}"`);if(s.environment&&Object.keys(s.environment).length>0){t.push(` [context.${i}.environment]`);for(let[n,r]of Object.entries(s.environment))t.push(` ${n} = "${d(r)}"`)}}return t.join(`
2
+ import S from"fs";import _ from"path";function yo(e){let{token:t,baseUrl:i="https://api.netlify.com/api/v1"}=e;async function s(n,r,l={}){let p=`${i}${r}`,f={Authorization:`Bearer ${t}`,"User-Agent":"stx-deploy/1.0"},u;if(l.rawBody)f["Content-Type"]=l.contentType||"application/octet-stream",u=l.rawBody;else if(l.body)f["Content-Type"]="application/json",u=JSON.stringify(l.body);let o=await fetch(p,{method:n,headers:f,body:u});if(!o.ok){let g=Error(`Netlify API error: ${o.status} ${o.statusText}`);g.status=o.status;try{let b=await o.json();g.message=b.message||g.message,g.code=b.code,g.details=b}catch{}throw g}let a=await o.text();if(!a)return{};return JSON.parse(a)}return{async getSite(n){return s("GET",`/sites/${n}`)},async listSites(){return s("GET","/sites")},async createSite(n){let r={};if(n)r.name=n;return s("POST","/sites",{body:r})},async createDeploy(n,r){let l={files:r.files,draft:r.draft??!0,async:r.async??!0};if(r.title)l.title=r.title;if(r.branch)l.branch=r.branch;if(r.functions)l.functions=r.functions;return s("POST",`/sites/${n}/deploys`,{body:l})},async uploadFile(n,r,l){let p=r.startsWith("/")?r.slice(1):r;await s("PUT",`/deploys/${n}/files/${p}`,{rawBody:l,contentType:"application/octet-stream"})},async uploadFiles(n,r){let p=[...r],f=async()=>{while(p.length>0){let o=p.shift();if(o)await this.uploadFile(n,o.path,o.content)}},u=Array.from({length:Math.min(5,r.length)},()=>f());await Promise.all(u)},async getDeploy(n){return s("GET",`/deploys/${n}`)},async waitForDeploy(n,r={}){let{timeout:l=300000,pollInterval:p=2000,onProgress:f}=r,u=Date.now();while(!0){let o=await this.getDeploy(n);if(f)f(o);if(o.state==="ready")return o;if(o.state==="error"){let a=Error(`Deploy failed: ${o.error_message||"Unknown error"}`);throw a.status=500,a.details=o,a}if(Date.now()-u>l){let a=Error(`Deploy timed out after ${l}ms`);throw a.status=408,a.details=o,a}await new Promise((a)=>setTimeout(a,p))}},async lockDeploy(n){return s("POST",`/deploys/${n}/lock`)},async unlockDeploy(n){return s("POST",`/deploys/${n}/unlock`)}}}async function pa(e){let t=await crypto.subtle.digest("SHA-1",e);return Array.from(new Uint8Array(t)).map((s)=>s.toString(16).padStart(2,"0")).join("")}async function Jr(e,t={}){let{ignore:i=["node_modules",".git",".env*","*.map"]}=t,s=[],n=new Bun.Glob("**/*");for await(let r of n.scan({cwd:e,onlyFiles:!0,dot:!1})){if(i.some((a)=>{if(a.includes("*"))return new RegExp(`^${a.replace(/\*/g,".*")}$`).test(r);return r.includes(a)}))continue;let p=`${e}/${r}`,u=await Bun.file(p).arrayBuffer(),o=await pa(u);s.push({path:r,content:new Uint8Array(u),sha1:o})}return s}function bo(e){let t={};for(let i of e)t[`/${i.path}`]=i.sha1;return t}function wo(e,t){let i=new Set(t.map((s)=>s.startsWith("/")?s.slice(1):s));return e.filter((s)=>i.has(s.path))}function Dn(e){if(e<1024)return`${e} B`;if(e<1048576)return`${(e/1024).toFixed(1)} KB`;if(e<1073741824)return`${(e/1048576).toFixed(1)} MB`;return`${(e/1073741824).toFixed(1)} GB`}function Qt(e){return e.reduce((t,i)=>t+i.content.byteLength,0)}import m from"fs";import y from"path";function fa(e){let t=[];if(t.push("[build]"),t.push(` command = "${d(e.build.command)}"`),t.push(` publish = "${d(e.build.publish)}"`),e.build.functions)t.push(` functions = "${d(e.build.functions)}"`);if(e.build.edge_functions)t.push(` edge_functions = "${d(e.build.edge_functions)}"`);if(e.build.environment&&Object.keys(e.build.environment).length>0){t.push(""),t.push("[build.environment]");for(let[i,s]of Object.entries(e.build.environment))t.push(` ${i} = "${d(s)}"`)}if(e.functions){if(t.push(""),t.push("[functions]"),e.functions.directory)t.push(` directory = "${d(e.functions.directory)}"`);if(e.functions.node_bundler)t.push(` node_bundler = "${e.functions.node_bundler}"`);if(e.functions.external_node_modules&&e.functions.external_node_modules.length>0)t.push(` external_node_modules = [${e.functions.external_node_modules.map((i)=>`"${i}"`).join(", ")}]`)}if(e.edge_functions&&e.edge_functions.length>0){t.push("");for(let i of e.edge_functions)t.push("[[edge_functions]]"),t.push(` function = "${d(i.function)}"`),t.push(` path = "${d(i.path)}"`)}if(e.redirects&&e.redirects.length>0){t.push("");for(let i of e.redirects){if(t.push("[[redirects]]"),t.push(` from = "${d(i.from)}"`),t.push(` to = "${d(i.to)}"`),i.status!==void 0)t.push(` status = ${i.status}`);if(i.force!==void 0)t.push(` force = ${i.force}`);if(i.conditions&&Object.keys(i.conditions).length>0){t.push(" [redirects.conditions]");for(let[s,n]of Object.entries(i.conditions))t.push(` ${s} = "${d(n)}"`)}}}if(e.headers&&e.headers.length>0){t.push("");for(let i of e.headers){t.push("[[headers]]"),t.push(` for = "${d(i.for)}"`),t.push(" [headers.values]");for(let[s,n]of Object.entries(i.values))t.push(` ${s} = "${d(n)}"`)}}if(e.plugins&&e.plugins.length>0){t.push("");for(let i of e.plugins)if(t.push("[[plugins]]"),t.push(` package = "${d(i.package)}"`),i.inputs&&Object.keys(i.inputs).length>0){t.push(" [plugins.inputs]");for(let[s,n]of Object.entries(i.inputs))if(typeof n==="string")t.push(` ${s} = "${d(n)}"`);else if(typeof n==="boolean"||typeof n==="number")t.push(` ${s} = ${n}`)}}if(e.context&&Object.keys(e.context).length>0)for(let[i,s]of Object.entries(e.context)){if(t.push(""),t.push(`[context.${i}]`),s.command)t.push(` command = "${d(s.command)}"`);if(s.publish)t.push(` publish = "${d(s.publish)}"`);if(s.environment&&Object.keys(s.environment).length>0){t.push(` [context.${i}.environment]`);for(let[n,r]of Object.entries(s.environment))t.push(` ${n} = "${d(r)}"`)}}return t.join(`
3
3
  `)+`
4
- `}function d(e){return e.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}async function Gr(e){let t={framework:"stx",buildCommand:"bun run build",outputDir:"dist"},i=y.join(e,"package.json");if(await Bun.file(i).exists())try{let u=JSON.parse(await Bun.file(i).text());if(u.scripts?.build)t.buildCommand="bun run build";let o={...u.dependencies,...u.devDependencies};if(o["@stacksjs/stx"]||o.stx)t.framework="stx"}catch{}let s=y.join(e,"stx.config.ts"),n=y.join(e,".config","stx.config.ts");if(await Bun.file(s).exists()||await Bun.file(n).exists())t.framework="stx";let r=["dist","build","out","public",".output"];for(let u of r){let o=y.join(e,u);if(m.existsSync(o)&&m.statSync(o).isDirectory()){t.outputDir=u;break}}let l=["functions","netlify/functions","api"];for(let u of l){let o=y.join(e,u);if(m.existsSync(o)&&m.statSync(o).isDirectory()){t.functionsDir=u;break}}let p=y.join(e,"netlify","edge-functions");if(m.existsSync(p))t.edgeFunctionsDir="netlify/edge-functions";let f=y.join(e,t.outputDir||"dist");if(m.existsSync(f)){let u=m.existsSync(y.join(f,"index.html")),o=m.readdirSync(f).filter((a)=>a.endsWith(".html"));t.isSPA=u&&o.length===1}return t}function Xr(e={}){let t={build:{command:e.buildCommand||"bun run build",publish:e.outputDir||"dist"}};if(e.functionsDir)t.build.functions=e.functionsDir,t.functions={directory:e.functionsDir,node_bundler:"esbuild"};if(e.edgeFunctionsDir)t.build.edge_functions=e.edgeFunctionsDir;if(t.headers=[{for:"/*",values:{"X-Frame-Options":"DENY","X-Content-Type-Options":"nosniff","X-XSS-Protection":"1; mode=block","Referrer-Policy":"strict-origin-when-cross-origin"}},{for:"/assets/*",values:{"Cache-Control":"public, max-age=31536000, immutable"}}],e.isSPA!==!1)t.redirects=[{from:"/*",to:"/index.html",status:200}];return t.context={production:{environment:{NODE_ENV:"production"}},"deploy-preview":{environment:{NODE_ENV:"development"}}},t}async function yo(e,t){let i=await Gr(e),s=t||Xr(i),n=la(s),r=y.join(e,"netlify.toml");return await Bun.write(r,n),r}function bo(e){return m.existsSync(y.join(e,"netlify.toml"))}async function lm(e={}){let t=Date.now(),i=[],s=e.cwd||process.cwd(),n=(c)=>{i.push(c)},r=(c)=>{if(e.onProgress)e.onProgress(c)},l=_.resolve(s,e.directory||"dist"),p=e.token||process.env.NETLIFY_AUTH_TOKEN,f=e.siteId||process.env.NETLIFY_SITE_ID;if(!p)throw new mt(`No Netlify auth token found.
4
+ `}function d(e){return e.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}async function Yr(e){let t={framework:"stx",buildCommand:"bun run build",outputDir:"dist"},i=y.join(e,"package.json");if(await Bun.file(i).exists())try{let u=JSON.parse(await Bun.file(i).text());if(u.scripts?.build)t.buildCommand="bun run build";let o={...u.dependencies,...u.devDependencies};if(o["@stacksjs/stx"]||o.stx)t.framework="stx"}catch{}let s=y.join(e,"stx.config.ts"),n=y.join(e,".config","stx.config.ts");if(await Bun.file(s).exists()||await Bun.file(n).exists())t.framework="stx";let r=["dist","build","out","public",".output"];for(let u of r){let o=y.join(e,u);if(m.existsSync(o)&&m.statSync(o).isDirectory()){t.outputDir=u;break}}let l=["functions","netlify/functions","api"];for(let u of l){let o=y.join(e,u);if(m.existsSync(o)&&m.statSync(o).isDirectory()){t.functionsDir=u;break}}let p=y.join(e,"netlify","edge-functions");if(m.existsSync(p))t.edgeFunctionsDir="netlify/edge-functions";let f=y.join(e,t.outputDir||"dist");if(m.existsSync(f)){let u=m.existsSync(y.join(f,"index.html")),o=m.readdirSync(f).filter((a)=>a.endsWith(".html"));t.isSPA=u&&o.length===1}return t}function Zr(e={}){let t={build:{command:e.buildCommand||"bun run build",publish:e.outputDir||"dist"}};if(e.functionsDir)t.build.functions=e.functionsDir,t.functions={directory:e.functionsDir,node_bundler:"esbuild"};if(e.edgeFunctionsDir)t.build.edge_functions=e.edgeFunctionsDir;if(t.headers=[{for:"/*",values:{"X-Frame-Options":"DENY","X-Content-Type-Options":"nosniff","X-XSS-Protection":"1; mode=block","Referrer-Policy":"strict-origin-when-cross-origin"}},{for:"/assets/*",values:{"Cache-Control":"public, max-age=31536000, immutable"}}],e.isSPA!==!1)t.redirects=[{from:"/*",to:"/index.html",status:200}];return t.context={production:{environment:{NODE_ENV:"production"}},"deploy-preview":{environment:{NODE_ENV:"development"}}},t}async function vo(e,t){let i=await Yr(e),s=t||Zr(i),n=fa(s),r=y.join(e,"netlify.toml");return await Bun.write(r,n),r}function xo(e){return m.existsSync(y.join(e,"netlify.toml"))}async function pm(e={}){let t=Date.now(),i=[],s=e.cwd||process.cwd(),n=(c)=>{i.push(c)},r=(c)=>{if(e.onProgress)e.onProgress(c)},l=_.resolve(s,e.directory||"dist"),p=e.token||process.env.NETLIFY_AUTH_TOKEN,f=e.siteId||process.env.NETLIFY_SITE_ID;if(!p)throw new bt(`No Netlify auth token found.
5
5
 
6
6
  To deploy to Netlify:
7
7
  1. Create account at https://app.netlify.com
8
8
  2. Get token at https://app.netlify.com/user/applications#personal-access-tokens
9
9
  3. Set NETLIFY_AUTH_TOKEN environment variable
10
10
 
11
- export NETLIFY_AUTH_TOKEN=your_token_here`,"NO_TOKEN");if(!f)throw new mt(`No Netlify site ID found.
11
+ export NETLIFY_AUTH_TOKEN=your_token_here`,"NO_TOKEN");if(!f)throw new bt(`No Netlify site ID found.
12
12
 
13
13
  Either:
14
14
  1. Set NETLIFY_SITE_ID environment variable
15
15
  2. Pass --site-id option
16
16
  3. Run \`stx deploy --init\` to set up
17
17
 
18
- Find your site ID at: https://app.netlify.com/sites/YOUR_SITE/settings/general`,"NO_SITE_ID");if(!S.existsSync(l))throw new mt(`Build directory not found: ${l}
18
+ Find your site ID at: https://app.netlify.com/sites/YOUR_SITE/settings/general`,"NO_SITE_ID");if(!S.existsSync(l))throw new bt(`Build directory not found: ${l}
19
19
 
20
- Run \`stx build\` first or specify a different directory with --directory`,"NO_BUILD_DIR");if(!(S.readdirSync(l).length>0))throw new mt(`Build directory is empty: ${l}
20
+ Run \`stx build\` first or specify a different directory with --directory`,"NO_BUILD_DIR");if(!(S.readdirSync(l).length>0))throw new bt(`Build directory is empty: ${l}
21
21
 
22
- Run \`stx build\` to generate files`,"EMPTY_BUILD_DIR");if(e.dryRun){r({stage:"collect",message:"Collecting files..."});let c=await Kr(l),w=Jt(c);return n(`Would deploy ${c.length} files (${On(w)})`),n(`From: ${l}`),n(`To: Site ${f}`),n(`Mode: ${e.production?"production":"draft"}`),{success:!0,url:`https://${f}.netlify.app (dry-run)`,deployId:"dry-run",logs:i,duration:Date.now()-t,filesUploaded:c.length,totalSize:w}}let o=go({token:p});r({stage:"collect",message:"Verifying site..."});try{let c=await o.getSite(f);n(`Deploying to: ${c.name} (${c.url})`)}catch(c){if(c.status===404)throw new mt(`Site not found: ${f}
22
+ Run \`stx build\` to generate files`,"EMPTY_BUILD_DIR");if(e.dryRun){r({stage:"collect",message:"Collecting files..."});let c=await Jr(l),w=Qt(c);return n(`Would deploy ${c.length} files (${Dn(w)})`),n(`From: ${l}`),n(`To: Site ${f}`),n(`Mode: ${e.production?"production":"draft"}`),{success:!0,url:`https://${f}.netlify.app (dry-run)`,deployId:"dry-run",logs:i,duration:Date.now()-t,filesUploaded:c.length,totalSize:w}}let o=yo({token:p});r({stage:"collect",message:"Verifying site..."});try{let c=await o.getSite(f);n(`Deploying to: ${c.name} (${c.url})`)}catch(c){if(c.status===404)throw new bt(`Site not found: ${f}
23
23
 
24
- Check your site ID or create a new site at https://app.netlify.com`,"SITE_NOT_FOUND");throw c}r({stage:"collect",message:"Collecting files..."});let a=await Kr(l),g=Jt(a);if(n(`Found ${a.length} files (${On(g)})`),a.length===0)throw new mt(`No files found in ${l}`,"NO_FILES");let b=mo(a);r({stage:"upload",message:"Creating deploy...",percent:0});let D=await o.createDeploy(f,{title:e.message||"Deploy from stx CLI",draft:!e.production,files:b});n(`Created deploy: ${D.id}`);let h=ho(a,D.required||[]);if(n(`Uploading ${h.length} files...`),h.length>0){let c=0,w=Jt(h);for(let x of h){await o.uploadFile(D.id,x.path,x.content),c++;let C=Math.round(c/h.length*100);r({stage:"upload",message:`Uploading: ${x.path}`,percent:C,details:{uploaded:c,total:h.length}})}n(`Uploaded ${On(w)}`)}else n("All files already on CDN (no upload needed)");r({stage:"process",message:"Processing deploy..."});let N=await o.waitForDeploy(D.id,{onProgress:(c)=>{r({stage:"process",message:`Status: ${c.state}`,details:c})}}),P=Date.now()-t;if(r({stage:"done",message:"Deploy complete!"}),n(`Deploy complete in ${(P/1000).toFixed(1)}s`),n(`URL: ${N.deploy_ssl_url}`),e.production)n(`Site: ${N.ssl_url}`);if(e.open){let c=e.production?N.ssl_url:N.deploy_ssl_url;I(c)}return{success:!0,url:N.deploy_ssl_url,siteUrl:e.production?N.ssl_url:void 0,deployId:N.id,logs:i,duration:P,filesUploaded:h.length,totalSize:Jt(h)}}async function um(e={}){let t=e.directory||process.cwd(),i;if(bo(t))i=_.join(t,"netlify.toml");else{let s=await Gr(t);i=await yo(t,Xr(s))}if(e.siteId){let s=_.join(t,".env.local"),n="";if(await Bun.file(s).exists()){if(n=await Bun.file(s).text(),n=n.split(`
24
+ Check your site ID or create a new site at https://app.netlify.com`,"SITE_NOT_FOUND");throw c}r({stage:"collect",message:"Collecting files..."});let a=await Jr(l),g=Qt(a);if(n(`Found ${a.length} files (${Dn(g)})`),a.length===0)throw new bt(`No files found in ${l}`,"NO_FILES");let b=bo(a);r({stage:"upload",message:"Creating deploy...",percent:0});let D=await o.createDeploy(f,{title:e.message||"Deploy from stx CLI",draft:!e.production,files:b});n(`Created deploy: ${D.id}`);let h=wo(a,D.required||[]);if(n(`Uploading ${h.length} files...`),h.length>0){let c=0,w=Qt(h);for(let x of h){await o.uploadFile(D.id,x.path,x.content),c++;let C=Math.round(c/h.length*100);r({stage:"upload",message:`Uploading: ${x.path}`,percent:C,details:{uploaded:c,total:h.length}})}n(`Uploaded ${Dn(w)}`)}else n("All files already on CDN (no upload needed)");r({stage:"process",message:"Processing deploy..."});let N=await o.waitForDeploy(D.id,{onProgress:(c)=>{r({stage:"process",message:`Status: ${c.state}`,details:c})}}),P=Date.now()-t;if(r({stage:"done",message:"Deploy complete!"}),n(`Deploy complete in ${(P/1000).toFixed(1)}s`),n(`URL: ${N.deploy_ssl_url}`),e.production)n(`Site: ${N.ssl_url}`);if(e.open){let c=e.production?N.ssl_url:N.deploy_ssl_url;I(c)}return{success:!0,url:N.deploy_ssl_url,siteUrl:e.production?N.ssl_url:void 0,deployId:N.id,logs:i,duration:P,filesUploaded:h.length,totalSize:Qt(h)}}async function fm(e={}){let t=e.directory||process.cwd(),i;if(xo(t))i=_.join(t,"netlify.toml");else{let s=await Yr(t);i=await vo(t,Zr(s))}if(e.siteId){let s=_.join(t,".env.local"),n="";if(await Bun.file(s).exists()){if(n=await Bun.file(s).text(),n=n.split(`
25
25
  `).filter((r)=>!r.startsWith("NETLIFY_SITE_ID=")).join(`
26
26
  `),n&&!n.endsWith(`
27
27
  `))n+=`
28
28
  `}n+=`NETLIFY_SITE_ID=${e.siteId}
29
- `,await Bun.write(s,n)}return{configPath:i,siteId:e.siteId}}class mt extends Error{code;constructor(e,t){super(e);this.name="DeployError",this.code=t}}function I(e){let t=process.platform,i=t==="darwin"?"open":t==="win32"?"start":"xdg-open";Bun.spawn([i,e],{stdio:["ignore","ignore","ignore"]})}
30
- export{go,ca,Kr,mo,ho,On,Jt,la,Gr,Xr,yo,bo,lm,um,mt};
29
+ `,await Bun.write(s,n)}return{configPath:i,siteId:e.siteId}}class bt extends Error{code;constructor(e,t){super(e);this.name="DeployError",this.code=t}}function I(e){let t=process.platform,i=t==="darwin"?"open":t==="win32"?"start":"xdg-open";Bun.spawn([i,e],{stdio:["ignore","ignore","ignore"]})}
30
+ export{yo,pa,Jr,bo,wo,Dn,Qt,fa,Yr,Zr,vo,xo,pm,fm,bt};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{G}from"./chunk-b6w0f610.js";function n(t){return G(t)}
3
+ export{n};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Vl,ga,Ul,Wl,ma,ql,Kl,Gl,Xl,ha,Jl,gm}from"./chunk-mcnwvh06.js";import{Ca,eu}from"./chunk-gd56arnm.js";import{se,oe,ie,zn,ve,Ie,es,vt,tn,Hn,Vn,Un,ae,Wn,qn,ts}from"./chunk-8me8hamk.js";import{ou}from"./chunk-ysfeg3cn.js";import"./chunk-vvzys1x7.js";export{oe as DEFAULT_FORMATS,ie as DEFAULT_QUALITY,se as DEFAULT_WIDTHS,ts as ImageProcessingError,Wl as clearImageCache,ma as createImageDirective,eu as createImageHandler,Kl as createImagePlugin,gm as defaultImageConfig,qn as formatSize,ha as generateImageManifest,tn as generateSizes,vt as generateSrcSet,Hn as getFallbackVariant,es as getImageMetadata,ae as getMimeType,Wn as getTotalSize,Vn as groupVariantsByFormat,Ca as handleImageRequest,ql as imageDirective,ve as isImageBackendAvailable,Un as isImageFile,zn as isSharpAvailable,Xl as optimizeDirectory,Gl as optimizeImage,ga as parseImageComponent,Ie as processImage,Ul as processImageComponents,Vl as renderImageComponent,ou as rewriteImagesWithSiblings,Jl as writeImageManifest};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- function Sa(e){return e}class a{plugins=new Map;sortedPlugins=[];initialized=!1;async register(e,t){if(this.plugins.has(e.name))throw Error(`Plugin "${e.name}" is already registered`);if(e.dependencies){for(let r of e.dependencies)if(!this.plugins.has(r))throw Error(`Plugin "${e.name}" depends on "${r}" which is not registered`)}if(this.plugins.set(e.name,e),e.onRegister)await e.onRegister(t);this.sortPlugins()}async unregister(e){let t=this.plugins.get(e);if(!t)return!1;for(let[r,i]of this.plugins)if(i.dependencies?.includes(e))throw Error(`Cannot unregister "${e}" because "${r}" depends on it`);if(t.onUnregister)await t.onUnregister();return this.plugins.delete(e),this.sortPlugins(),!0}get(e){return this.plugins.get(e)}has(e){return this.plugins.has(e)}getAll(){return[...this.sortedPlugins]}getAllDirectives(){let e=[];for(let t of this.sortedPlugins)if(t.registerDirectives)e.push(...t.registerDirectives());return e}getAllFilters(){let e={};for(let t of this.sortedPlugins)if(t.registerFilters)Object.assign(e,t.registerFilters());return e}async runBeforeProcess(e){return this.runHooks("beforeProcess",e)}async runAfterParse(e){return this.runHooks("afterParse",e)}async runBeforeDirective(e,t){return this.runDirectiveHooks("beforeDirective",e,t)}async runAfterDirective(e,t){return this.runDirectiveHooks("afterDirective",e,t)}async runBeforeRender(e){return this.runHooks("beforeRender",e)}async runAfterRender(e){return this.runHooks("afterRender",e)}async runOnError(e){for(let t of this.sortedPlugins)if(t.onError)try{let r=await t.onError(e);if(r){if(r.template!==void 0)e.template=r.template;if(r.context)e.context={...e.context,...r.context};if(r.metadata)e.metadata={...e.metadata,...r.metadata};if(r.skip)return e}}catch(r){console.error(`Error in plugin "${t.name}" onError hook:`,r)}return null}sortPlugins(){this.sortedPlugins=Array.from(this.plugins.values()).sort((e,t)=>(e.priority??100)-(t.priority??100))}async runHooks(e,t){let r={...t};for(let i of this.sortedPlugins){let s=i[e];if(s)try{let n=await s(r);if(n){if(n.template!==void 0)r.template=n.template;if(n.context)r.context={...r.context,...n.context};if(n.metadata)r.metadata={...r.metadata,...n.metadata};if(n.skip)break}}catch(n){console.error(`Error in plugin "${i.name}" ${e} hook:`,n)}}return r}async runDirectiveHooks(e,t,r){let i={...r};for(let s of this.sortedPlugins){let n=s[e];if(n)try{let o=await n(t,i);if(o){if(o.template!==void 0)i.template=o.template;if(o.context)i.context={...i.context,...o.context};if(o.metadata)i.metadata={...i.metadata,...o.metadata};if(o.skip)break}}catch(o){console.error(`Error in plugin "${s.name}" ${e} hook:`,o)}}return i}}var $m=new a;var u=Sa({name:"stx-debug",version:"1.0.0",description:"Logs all plugin lifecycle events for debugging",priority:0,beforeProcess(e){console.log("[stx-debug] beforeProcess:",e.filePath)},afterParse(e){console.log("[stx-debug] afterParse:",e.template.length,"chars")},beforeDirective(e,t){console.log("[stx-debug] beforeDirective:",e)},afterDirective(e,t){console.log("[stx-debug] afterDirective:",e)},beforeRender(e){console.log("[stx-debug] beforeRender")},afterRender(e){console.log("[stx-debug] afterRender:",e.template.length,"chars")},onError(e){console.error("[stx-debug] onError:",e.error.message,"in phase:",e.phase)}}),l=Sa({name:"stx-timing",version:"1.0.0",description:"Measures template processing time",priority:1,beforeProcess(e){e.metadata.startTime=performance.now()},afterRender(e){let t=e.metadata.startTime;if(t){let r=performance.now()-t;console.log(`[stx-timing] Processing took ${r.toFixed(2)}ms`)}}});export{Sa,$m};
2
+ function Ea(e){return e}class a{plugins=new Map;sortedPlugins=[];initialized=!1;async register(e,t){if(this.plugins.has(e.name))throw Error(`Plugin "${e.name}" is already registered`);if(e.dependencies){for(let r of e.dependencies)if(!this.plugins.has(r))throw Error(`Plugin "${e.name}" depends on "${r}" which is not registered`)}if(this.plugins.set(e.name,e),e.onRegister)await e.onRegister(t);this.sortPlugins()}async unregister(e){let t=this.plugins.get(e);if(!t)return!1;for(let[r,i]of this.plugins)if(i.dependencies?.includes(e))throw Error(`Cannot unregister "${e}" because "${r}" depends on it`);if(t.onUnregister)await t.onUnregister();return this.plugins.delete(e),this.sortPlugins(),!0}get(e){return this.plugins.get(e)}has(e){return this.plugins.has(e)}getAll(){return[...this.sortedPlugins]}getAllDirectives(){let e=[];for(let t of this.sortedPlugins)if(t.registerDirectives)e.push(...t.registerDirectives());return e}getAllFilters(){let e={};for(let t of this.sortedPlugins)if(t.registerFilters)Object.assign(e,t.registerFilters());return e}async runBeforeProcess(e){return this.runHooks("beforeProcess",e)}async runAfterParse(e){return this.runHooks("afterParse",e)}async runBeforeDirective(e,t){return this.runDirectiveHooks("beforeDirective",e,t)}async runAfterDirective(e,t){return this.runDirectiveHooks("afterDirective",e,t)}async runBeforeRender(e){return this.runHooks("beforeRender",e)}async runAfterRender(e){return this.runHooks("afterRender",e)}async runOnError(e){for(let t of this.sortedPlugins)if(t.onError)try{let r=await t.onError(e);if(r){if(r.template!==void 0)e.template=r.template;if(r.context)e.context={...e.context,...r.context};if(r.metadata)e.metadata={...e.metadata,...r.metadata};if(r.skip)return e}}catch(r){console.error(`Error in plugin "${t.name}" onError hook:`,r)}return null}sortPlugins(){this.sortedPlugins=Array.from(this.plugins.values()).sort((e,t)=>(e.priority??100)-(t.priority??100))}async runHooks(e,t){let r={...t};for(let i of this.sortedPlugins){let s=i[e];if(s)try{let n=await s(r);if(n){if(n.template!==void 0)r.template=n.template;if(n.context)r.context={...r.context,...n.context};if(n.metadata)r.metadata={...r.metadata,...n.metadata};if(n.skip)break}}catch(n){console.error(`Error in plugin "${i.name}" ${e} hook:`,n)}}return r}async runDirectiveHooks(e,t,r){let i={...r};for(let s of this.sortedPlugins){let n=s[e];if(n)try{let o=await n(t,i);if(o){if(o.template!==void 0)i.template=o.template;if(o.context)i.context={...i.context,...o.context};if(o.metadata)i.metadata={...i.metadata,...o.metadata};if(o.skip)break}}catch(o){console.error(`Error in plugin "${s.name}" ${e} hook:`,o)}}return i}}var Pm=new a;var u=Ea({name:"stx-debug",version:"1.0.0",description:"Logs all plugin lifecycle events for debugging",priority:0,beforeProcess(e){console.log("[stx-debug] beforeProcess:",e.filePath)},afterParse(e){console.log("[stx-debug] afterParse:",e.template.length,"chars")},beforeDirective(e,t){console.log("[stx-debug] beforeDirective:",e)},afterDirective(e,t){console.log("[stx-debug] afterDirective:",e)},beforeRender(e){console.log("[stx-debug] beforeRender")},afterRender(e){console.log("[stx-debug] afterRender:",e.template.length,"chars")},onError(e){console.error("[stx-debug] onError:",e.error.message,"in phase:",e.phase)}}),l=Ea({name:"stx-timing",version:"1.0.0",description:"Measures template processing time",priority:1,beforeProcess(e){e.metadata.startTime=performance.now()},afterRender(e){let t=e.metadata.startTime;if(t){let r=performance.now()-t;console.log(`[stx-timing] Processing took ${r.toFixed(2)}ms`)}}});export{Ea,Pm};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- function I(s){let o=/import\s*\{([^}]+)\}\s*from\s*['"](@stores|stx\/stores)['"]\s*;?\n?/g;s=s.replace(o,(e,t)=>`const { ${t.split(",").map((r)=>r.trim()).filter(Boolean).join(", ")} } = window.__STX_STORES__
2
+ function N(s){let o=/import\s*\{([^}]+)\}\s*from\s*['"](@stores|stx\/stores)['"]\s*;?\n?/g;s=s.replace(o,(e,t)=>`const { ${t.split(",").map((r)=>r.trim()).filter(Boolean).join(", ")} } = window.__STX_STORES__
3
3
  `);let n=/import\s*\{([^}]+)\}\s*from\s*['"]@composables['"]\s*;?\n?/g;return s=s.replace(n,(e,t)=>`const { ${t.split(",").map((r)=>r.trim()).filter(Boolean).join(", ")} } = window.__composables
4
- `),s}function An(s){return s.replace(/^import\s+[^'"]*?from\s*['"][^'"]+['"]\s*;?[ \t]*$/gm,"").replace(/^import\s+['"][^'"]+['"]\s*;?[ \t]*$/gm,"")}
5
- export{I,An};
4
+ `),s}function On(s){return s.replace(/^import\s+[^'"]*?from\s*['"][^'"]+['"]\s*;?[ \t]*$/gm,"").replace(/^import\s+['"][^'"]+['"]\s*;?[ \t]*$/gm,"")}
5
+ export{N,On};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{St,Xn,$h}from"./chunk-sj3ry5ck.js";import{ge,Jn,Rh,Yn,To,ns,rs,Ah,Ph,Ih,Zn,Qn,$o,ss,Oh}from"./chunk-67dgp45w.js";import"./chunk-qjey0jk6.js";export{To as batch,$h as default,Jn as derived,Yn as effect,St as generateSignalsRuntime,Xn as generateSignalsRuntimeDev,Qn as isDerived,Zn as isSignal,Rh as memo,rs as onDestroy,ns as onMount,ss as peek,Ih as pendingLifecycleCounts,Ph as runDestroyCallbacks,Ah as runMountCallbacks,ge as state,$o as untrack,Oh as useOptimistic};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{eg,Qh,ey,ty,ny,tg,ng,ry,sy,ni,oy,hr,yr,Es}from"./chunk-021tjkd6.js";import{at}from"./chunk-n3jw3xpj.js";import"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{ny as __setSignalsGeneratorsForTest,at as cacheEngineFingerprint,yr as cacheTemplate,hr as checkCache,oy as clearDevCaches,ng as getCachedRouterScript,tg as getCachedSignalsRuntime,ry as getServeClientAsset,ni as getServeModuleBundle,Es as hashFilePath,ey as invalidateFileCache,ty as invalidateFileCacheByDir,Qh as readFileCached,sy as registerServeModuleBundle,eg as templateCache};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ws,Jf,Ko,Yf}from"./chunk-ks5p5w6z.js";import"./chunk-xymr4ys9.js";import"./chunk-y036cwc7.js";import"./chunk-nttsc0aw.js";import"./chunk-zsnmk5me.js";import"./chunk-yhc1c4tr.js";import"./chunk-r4v4vswq.js";import"./chunk-tnp2ta5q.js";import"./chunk-669b2bya.js";import"./chunk-mfa07erx.js";import"./chunk-x512h2gv.js";import{jt}from"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{Yf as declareBareLoopHead,jt as parseLoopBinding,Jf as processLoops,Ko as processLoopsAsync,ws as reportDeferredLoopWarnings};