@stacksjs/stx 0.2.453 → 0.2.455

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 (224) hide show
  1. package/dist/app-service-worker.d.ts +4 -1
  2. package/dist/chunk-06gzq9xe.js +17 -0
  3. package/dist/{chunk-yx37nrgr.js → chunk-0trfbqa7.js} +4 -4
  4. package/dist/{chunk-8ah8npj3.js → chunk-0v5dpk7r.js} +1 -1
  5. package/dist/{chunk-z68rb7qp.js → chunk-0vae943t.js} +5 -5
  6. package/dist/chunk-143gpdxy.js +2 -0
  7. package/dist/{chunk-w8ek4fe8.js → chunk-1sdtg9np.js} +2 -2
  8. package/dist/chunk-1vgmzmsw.js +2 -0
  9. package/dist/{chunk-aem9hs8n.js → chunk-1vm403b2.js} +2 -2
  10. package/dist/{chunk-7mbx7dzg.js → chunk-2bdthb37.js} +2 -2
  11. package/dist/{chunk-149r1q6c.js → chunk-2cy956js.js} +2 -2
  12. package/dist/chunk-2hddf9pn.js +2 -0
  13. package/dist/chunk-2jxe6y8h.js +2 -0
  14. package/dist/chunk-32t5agpk.js +2 -0
  15. package/dist/chunk-3ar8gdyd.js +2 -0
  16. package/dist/{chunk-697zcjzg.js → chunk-3jc6pahv.js} +12 -12
  17. package/dist/chunk-3s2vnqcf.js +2 -0
  18. package/dist/{chunk-hhjff2r8.js → chunk-44msrx2e.js} +3 -3
  19. package/dist/{chunk-0tchj3ct.js → chunk-462jmw0a.js} +6 -6
  20. package/dist/chunk-4bd491yq.js +2 -0
  21. package/dist/{chunk-g8k5rsqq.js → chunk-4fa3jec9.js} +12 -12
  22. package/dist/chunk-4henqdjf.js +2 -0
  23. package/dist/chunk-4qv9me8f.js +2 -0
  24. package/dist/chunk-561yczfn.js +2 -0
  25. package/dist/chunk-58n62bxb.js +3 -0
  26. package/dist/chunk-5m8q7c5r.js +2 -0
  27. package/dist/{chunk-pkpmyr0x.js → chunk-5p56w2ke.js} +3 -3
  28. package/dist/chunk-5pjsc9zv.js +3 -0
  29. package/dist/{chunk-n9jn3qzw.js → chunk-5qns2sdz.js} +2 -2
  30. package/dist/{chunk-2428rqy1.js → chunk-5ryntw3w.js} +6 -6
  31. package/dist/chunk-68dsxv8z.js +2 -0
  32. package/dist/chunk-68txmj8d.js +2 -0
  33. package/dist/{chunk-45rfv3a5.js → chunk-6cp3afft.js} +2 -2
  34. package/dist/chunk-6nec76z0.js +2 -0
  35. package/dist/chunk-6qv189mb.js +2 -0
  36. package/dist/{chunk-dwp3knc4.js → chunk-6r2709dj.js} +3 -3
  37. package/dist/chunk-77hanm4y.js +2 -0
  38. package/dist/chunk-7tt84v1y.js +3 -0
  39. package/dist/chunk-8efg91ak.js +4 -0
  40. package/dist/chunk-8nd0f6z0.js +2 -0
  41. package/dist/{chunk-73h7qjgq.js → chunk-8xz8t9xp.js} +2 -2
  42. package/dist/{chunk-qbhbe9cw.js → chunk-9ac40ggt.js} +5 -5
  43. package/dist/chunk-9mtz7tyv.js +2 -0
  44. package/dist/chunk-9t50hw97.js +2 -0
  45. package/dist/chunk-9z22zs86.js +2 -0
  46. package/dist/chunk-a32kqsff.js +2 -0
  47. package/dist/{chunk-19h1j59a.js → chunk-ab56jdah.js} +1 -1
  48. package/dist/chunk-adjf8fvc.js +3 -0
  49. package/dist/{chunk-33xh91s8.js → chunk-am1hw771.js} +2 -2
  50. package/dist/chunk-bpzrfqvw.js +2 -0
  51. package/dist/{chunk-0xztxj98.js → chunk-bq2e9qf6.js} +3 -3
  52. package/dist/{chunk-hqywyyez.js → chunk-c491hsm1.js} +5 -5
  53. package/dist/chunk-czvkkrww.js +2 -0
  54. package/dist/{chunk-jn8tj4kn.js → chunk-d3mpxr3s.js} +4 -4
  55. package/dist/{chunk-849wf19d.js → chunk-dxxs52yw.js} +3 -3
  56. package/dist/chunk-e78ame3h.js +2 -0
  57. package/dist/chunk-ef0gstkd.js +2 -0
  58. package/dist/{chunk-zqzv5jy2.js → chunk-exgyf65a.js} +4 -4
  59. package/dist/{chunk-538h1sfc.js → chunk-f4c39nfh.js} +2 -2
  60. package/dist/{chunk-3nydw825.js → chunk-fen7zb1b.js} +8 -8
  61. package/dist/{chunk-s5drjm2j.js → chunk-gkqxnetc.js} +6 -6
  62. package/dist/{chunk-47jq9j1w.js → chunk-gyv7dcyx.js} +2 -2
  63. package/dist/{chunk-axydabse.js → chunk-h9e032kq.js} +3 -3
  64. package/dist/chunk-ha5z623e.js +2 -0
  65. package/dist/chunk-hehtgsrt.js +2 -0
  66. package/dist/{chunk-3pc22sve.js → chunk-hg7abc58.js} +6 -6
  67. package/dist/chunk-hjg3e338.js +2 -0
  68. package/dist/chunk-hqsgp9wy.js +2 -0
  69. package/dist/chunk-hqzq3a61.js +2 -0
  70. package/dist/chunk-hskrxdcc.js +2 -0
  71. package/dist/chunk-hvx3pc13.js +2 -0
  72. package/dist/{chunk-9zbjk8pg.js → chunk-jckvavdb.js} +8 -8
  73. package/dist/chunk-jdhs9w6h.js +2 -0
  74. package/dist/{chunk-4q366fhp.js → chunk-jpgma7e8.js} +5 -5
  75. package/dist/chunk-jtmfwhsy.js +11 -0
  76. package/dist/{chunk-dqr5n49p.js → chunk-jz7pvh7b.js} +2 -2
  77. package/dist/chunk-kcs71ks8.js +2 -0
  78. package/dist/chunk-kda62f5h.js +2 -0
  79. package/dist/{chunk-26wmppja.js → chunk-kppgyqwb.js} +1 -1
  80. package/dist/chunk-kwct777t.js +2831 -0
  81. package/dist/chunk-m7p98cmy.js +4 -0
  82. package/dist/chunk-mbapk9ka.js +2 -0
  83. package/dist/chunk-me5039d4.js +2 -0
  84. package/dist/{chunk-fmj4xvqm.js → chunk-mhpsz5m0.js} +5 -5
  85. package/dist/{chunk-b1q5sh7x.js → chunk-n1dyjhte.js} +3 -3
  86. package/dist/{chunk-mnz6bdp3.js → chunk-n866vbgj.js} +5 -5
  87. package/dist/chunk-n8hd5qap.js +2 -0
  88. package/dist/{chunk-s59r34p5.js → chunk-nmf12mx3.js} +4 -4
  89. package/dist/chunk-nqvb9094.js +2 -0
  90. package/dist/chunk-p4zeqzmr.js +2 -0
  91. package/dist/chunk-pcp5twev.js +2 -0
  92. package/dist/chunk-pe214qcn.js +2 -0
  93. package/dist/{chunk-4yyzje7d.js → chunk-pw34r8r5.js} +1 -1
  94. package/dist/{chunk-81v9crqy.js → chunk-q8ttp85g.js} +1 -1
  95. package/dist/chunk-q98v7bhs.js +2 -0
  96. package/dist/chunk-qhwvjsbx.js +2 -0
  97. package/dist/chunk-qrgr2h1n.js +2 -0
  98. package/dist/{chunk-5xj1df83.js → chunk-r6pax860.js} +7 -7
  99. package/dist/{chunk-rdq113p4.js → chunk-r80km6mn.js} +2 -2
  100. package/dist/{chunk-tehvry9a.js → chunk-rcr57c30.js} +10 -10
  101. package/dist/{chunk-8fj8sm1a.js → chunk-ree9weje.js} +2 -2
  102. package/dist/{chunk-x4ztj64h.js → chunk-rgwvqmhh.js} +2 -2
  103. package/dist/chunk-rsj5q7zm.js +2 -0
  104. package/dist/{chunk-tn85vr56.js → chunk-rvgvt161.js} +2 -2
  105. package/dist/chunk-rwx1s3b5.js +2 -0
  106. package/dist/chunk-rzmvsqc7.js +2 -0
  107. package/dist/{chunk-rbkna5rw.js → chunk-skgdg84c.js} +11 -11
  108. package/dist/{chunk-yfd0e7dr.js → chunk-tbjyp03h.js} +1 -1
  109. package/dist/chunk-tmn8hxm6.js +2 -0
  110. package/dist/{chunk-g2afpsw0.js → chunk-tpeyn7wr.js} +2 -2
  111. package/dist/{chunk-s6e8mmk1.js → chunk-tpvc8xnk.js} +6 -6
  112. package/dist/chunk-tr7dz5g5.js +2 -0
  113. package/dist/{chunk-5cyme1g0.js → chunk-v3yqeh15.js} +2 -2
  114. package/dist/{chunk-9ndzk9r4.js → chunk-vg7wfkt5.js} +3 -3
  115. package/dist/chunk-vrvnctex.js +2 -0
  116. package/dist/chunk-w00khg58.js +2 -0
  117. package/dist/chunk-w1h9ts86.js +2 -0
  118. package/dist/{chunk-afhkvj3k.js → chunk-w1zvh5y7.js} +2 -2
  119. package/dist/chunk-w62ettpr.js +2 -0
  120. package/dist/{chunk-b5wh10s9.js → chunk-xd71zy8q.js} +78 -78
  121. package/dist/chunk-xe90p9rp.js +2 -0
  122. package/dist/{chunk-56rk985x.js → chunk-y3cqh2jv.js} +3 -3
  123. package/dist/{chunk-0vbpcef6.js → chunk-z2daw0th.js} +4 -4
  124. package/dist/{chunk-nw8p8eg9.js → chunk-z3etxty5.js} +5 -5
  125. package/dist/{chunk-vraddzkf.js → chunk-z6tag2ng.js} +4 -4
  126. package/dist/{chunk-g3h7j2n7.js → chunk-z80d9dd2.js} +2 -2
  127. package/dist/chunk-z990jtmx.js +2 -0
  128. package/dist/chunk-zjp0v2ja.js +33 -0
  129. package/dist/{chunk-d1xbamr1.js → chunk-znj79hta.js} +2 -2
  130. package/dist/chunk-zrbpy3m5.js +2 -0
  131. package/dist/{chunk-jwpcck1b.js → chunk-zydg3wgt.js} +2 -2
  132. package/dist/cli.js +20 -20
  133. package/dist/client-script.d.ts +0 -21
  134. package/dist/client-script.js +21 -0
  135. package/dist/composable-loader.js +41 -17
  136. package/dist/compression.js +25 -6
  137. package/dist/craft-entry.js +2 -2
  138. package/dist/craft.js +2 -2
  139. package/dist/html-masking.js +36 -8
  140. package/dist/i18n.js +4 -3
  141. package/dist/includes.js +6 -2
  142. package/dist/misc-directives.d.ts +0 -10
  143. package/dist/misc-directives.js +12 -0
  144. package/dist/native/runtime/native-host.d.ts +1 -0
  145. package/dist/native/runtime/native-host.js +63 -12
  146. package/dist/native/runtime/shared-screen.js +11 -2
  147. package/dist/offline/app-service-worker.d.ts +4 -1
  148. package/dist/offline/app-service-worker.js +62 -27
  149. package/dist/process.js +4 -0
  150. package/dist/pwa.js +3 -3
  151. package/dist/source-signature.d.ts +5 -2
  152. package/dist/source-signature.js +7 -0
  153. package/dist/ssg.js +8 -8
  154. package/dist/store-loader.js +2 -1
  155. package/dist/utils.js +27 -15
  156. package/package.json +5 -5
  157. package/dist/chunk-14x69rt4.js +0 -2
  158. package/dist/chunk-1kmd0g1k.js +0 -3
  159. package/dist/chunk-3wezvz6m.js +0 -2
  160. package/dist/chunk-5402rpwg.js +0 -2
  161. package/dist/chunk-58ymq1h4.js +0 -2
  162. package/dist/chunk-5rtbs8zv.js +0 -2
  163. package/dist/chunk-5tx1wqns.js +0 -2
  164. package/dist/chunk-6fw3rfcj.js +0 -2
  165. package/dist/chunk-6nfecsbt.js +0 -2
  166. package/dist/chunk-6sw7sxh2.js +0 -17
  167. package/dist/chunk-7qbv0xh6.js +0 -2
  168. package/dist/chunk-7vdsd9rn.js +0 -2
  169. package/dist/chunk-8gk34047.js +0 -2
  170. package/dist/chunk-8nsfkr5n.js +0 -2
  171. package/dist/chunk-90562q79.js +0 -3
  172. package/dist/chunk-a1dggchm.js +0 -2
  173. package/dist/chunk-a1kv42kp.js +0 -2
  174. package/dist/chunk-a5695s8k.js +0 -2
  175. package/dist/chunk-avjgetkh.js +0 -2
  176. package/dist/chunk-bcgth8qf.js +0 -2
  177. package/dist/chunk-bemksdz5.js +0 -33
  178. package/dist/chunk-br3ktpyq.js +0 -2
  179. package/dist/chunk-by1s70jp.js +0 -2
  180. package/dist/chunk-cwc3p6p7.js +0 -2
  181. package/dist/chunk-e593pr1r.js +0 -2
  182. package/dist/chunk-e8y69gg0.js +0 -2
  183. package/dist/chunk-eam7eann.js +0 -2
  184. package/dist/chunk-ej7m406s.js +0 -2
  185. package/dist/chunk-es85mgdw.js +0 -2
  186. package/dist/chunk-fa5x9zbk.js +0 -2
  187. package/dist/chunk-fkrzsk74.js +0 -2
  188. package/dist/chunk-fm3k5v8s.js +0 -2
  189. package/dist/chunk-fmc9fj4a.js +0 -2
  190. package/dist/chunk-fn863yek.js +0 -2
  191. package/dist/chunk-fv30avp2.js +0 -2
  192. package/dist/chunk-gpmk4s4f.js +0 -2
  193. package/dist/chunk-hd64hz1n.js +0 -2
  194. package/dist/chunk-hd75916k.js +0 -4
  195. package/dist/chunk-hz6a476h.js +0 -2
  196. package/dist/chunk-j7zywbq0.js +0 -4
  197. package/dist/chunk-jjm3754f.js +0 -2
  198. package/dist/chunk-ktk30f6d.js +0 -2
  199. package/dist/chunk-m3f50p6c.js +0 -2
  200. package/dist/chunk-m90a5dpn.js +0 -2
  201. package/dist/chunk-mmp7x8f0.js +0 -2
  202. package/dist/chunk-nqcg2bf0.js +0 -2
  203. package/dist/chunk-nrp8qg9j.js +0 -2831
  204. package/dist/chunk-ns7e951g.js +0 -2
  205. package/dist/chunk-nycvwnty.js +0 -2
  206. package/dist/chunk-p9shre7t.js +0 -2
  207. package/dist/chunk-pe9hxhrb.js +0 -2
  208. package/dist/chunk-ph6xg67j.js +0 -11
  209. package/dist/chunk-qewxfhex.js +0 -2
  210. package/dist/chunk-qfrg8mnf.js +0 -2
  211. package/dist/chunk-rmnhy5az.js +0 -2
  212. package/dist/chunk-t6m5wmpy.js +0 -2
  213. package/dist/chunk-v404gvm0.js +0 -2
  214. package/dist/chunk-vgvsefz8.js +0 -2
  215. package/dist/chunk-w9k7pvre.js +0 -2
  216. package/dist/chunk-wf09xg7j.js +0 -2
  217. package/dist/chunk-wgqt5pnv.js +0 -2
  218. package/dist/chunk-wr3h8dmt.js +0 -2
  219. package/dist/chunk-wtqjfar3.js +0 -2
  220. package/dist/chunk-x1xncm97.js +0 -2
  221. package/dist/chunk-yd50awqp.js +0 -3
  222. package/dist/chunk-ykxd78b2.js +0 -2
  223. package/dist/chunk-yqsza22w.js +0 -3
  224. package/dist/chunk-zj80vrv6.js +0 -2
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{al}from"./chunk-znj79hta.js";import"./chunk-kwct777t.js";import"./chunk-bq2e9qf6.js";import"./chunk-8xz8t9xp.js";import"./chunk-0trfbqa7.js";import"./chunk-1vm403b2.js";import"./chunk-zydg3wgt.js";import"./chunk-4fa3jec9.js";import"./chunk-exgyf65a.js";import"./chunk-r6pax860.js";import"./chunk-h9e032kq.js";import"./chunk-w1zvh5y7.js";import"./chunk-nmf12mx3.js";import"./chunk-jz7pvh7b.js";export{al as buildApp};
@@ -1,12 +1,12 @@
1
1
  // @bun
2
- function a(t,e){let n=t[e],i=e+1;while(i<t.length){if(t[i]==="\\"){i+=2;continue}if(t[i]===n)return i+1;i++}return t.length}function w(t,e){let n=e+1;while(n<t.length){if(t[n]==="\\"){n+=2;continue}if(t[n]==="`")return n+1;if(t[n]==="$"&&t[n+1]==="{"){if(n=gi(t,n+2),n<t.length)n++;continue}n++}return t.length}function gi(t,e){let n=1,i=e;while(i<t.length){let l=t[i];if(l==="\\"){i+=2;continue}if(l==='"'||l==="'"){i=a(t,i);continue}if(l==="`"){i=w(t,i);continue}if(l==="/"&&t[i+1]==="/"){while(i<t.length&&t[i]!==`
2
+ function a(t,e){let n=t[e],i=e+1;while(i<t.length){if(t[i]==="\\"){i+=2;continue}if(t[i]===n)return i+1;i++}return t.length}function w(t,e){let n=e+1;while(n<t.length){if(t[n]==="\\"){n+=2;continue}if(t[n]==="`")return n+1;if(t[n]==="$"&&t[n+1]==="{"){if(n=mi(t,n+2),n<t.length)n++;continue}n++}return t.length}function mi(t,e){let n=1,i=e;while(i<t.length){let l=t[i];if(l==="\\"){i+=2;continue}if(l==='"'||l==="'"){i=a(t,i);continue}if(l==="`"){i=w(t,i);continue}if(l==="/"&&t[i+1]==="/"){while(i<t.length&&t[i]!==`
3
3
  `)i++;continue}if(l==="/"&&t[i+1]==="*"){i+=2;while(i<t.length&&t.slice(i,i+2)!=="*/")i++;i+=2;continue}if(l==="{"){n++,i++;continue}if(l==="}"){if(n--,n===0)return i;i++;continue}i++}return t.length}var o=new Set(["return","typeof","instanceof","in","of","new","delete","void","throw","case","do","else","yield","await"]);function b(t,e){if(e)return o.has(e);return!(t===")"||t==="]"||t===h)}var h="\x00";function m(t,e){let n=e+1,i=!1;while(n<t.length){let l=t[n];if(l===`
4
4
  `)return-1;if(l==="\\"){n+=2;continue}if(l==="[")i=!0;else if(l==="]")i=!1;else if(l==="/"&&!i){n++;while(n<t.length&&/[a-z]/i.test(t[n]))n++;return n}n++}return-1}function s(t){let e="",n=0,i="",l="";while(n<t.length){let u=t.slice(n,n+2);if(u==="//"){while(n<t.length&&t[n]!==`
5
5
  `)e+=" ",n++;continue}if(u==="/*"){while(n<t.length&&t.slice(n,n+2)!=="*/")e+=t[n]===`
6
6
  `?`
7
7
  `:" ",n++;e+=" ",n+=2;continue}let r=t[n];if(r==='"'||r==="'"){let f=r;e+=" ",n++;while(n<t.length&&t[n]!==f){if(t[n]==="\\"){e+=" ",n+=2;continue}e+=t[n]===`
8
8
  `?`
9
- `:" ",n++}e+=" ",n++,i=h,l="";continue}if(r==="/"&&b(i,l)){let f=m(t,n);if(f!==-1){e+=`/${" ".repeat(f-n-2)}/`,n=f,i=h,l="";continue}}if(r==="`"){e+=" ",n++;while(n<t.length&&t[n]!=="`"){if(t[n]==="\\"){e+=" ",n+=2;continue}if(t[n]==="$"&&t[n+1]==="{"){let f=n+2,g=gi(t,f);if(e+=" ",e+=s(t.slice(f,g)),g<t.length)e+=" ";n=g+1;continue}e+=t[n]===`
9
+ `:" ",n++}e+=" ",n++,i=h,l="";continue}if(r==="/"&&b(i,l)){let f=m(t,n);if(f!==-1){e+=`/${" ".repeat(f-n-2)}/`,n=f,i=h,l="";continue}}if(r==="`"){e+=" ",n++;while(n<t.length&&t[n]!=="`"){if(t[n]==="\\"){e+=" ",n+=2;continue}if(t[n]==="$"&&t[n+1]==="{"){let f=n+2,g=mi(t,f);if(e+=" ",e+=s(t.slice(f,g)),g<t.length)e+=" ";n=g+1;continue}e+=t[n]===`
10
10
  `?`
11
11
  `:" ",n++}e+=" ",n++,i=h,l="";continue}if(e+=r,n++,/[\w$]/.test(r))l=/[\w$]/.test(i)?l+r:r,i=r;else if(!/\s/.test(r))i=r,l=""}return e}function be(t){let e=new Uint16Array(t.length),n=0,i=!0;for(let l=0;l<t.length;l++){let u=t[l];if(u===")"||u==="]"||u==="}")if(n===0)i=!1;else n--;if(e[l]=n,u==="("||u==="["||u==="{")n++}return{depths:e,balanced:i&&n===0}}
12
- export{gi,s,be};
12
+ export{mi,s,be};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- var g=0;function p(){return`async-${++g}-${Date.now().toString(36)}`}function Il(e,t={},c){let o=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@error\s*([\s\S]*?)@endasync/gi,i=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@endasync/gi,n=e;return n=n.replace(o,(r,s,a,d)=>{let l=p(),y=u(s);return m(l,y,a.trim(),d.trim())}),n=n.replace(i,(r,s,a)=>{let d=p(),l=u(s);return m(d,l,a.trim(),'<div class="stx-async-error">Failed to load component</div>')}),n}function u(e){let t={component:"",timeout:30000,delay:200,suspensible:!0,retries:0},c=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,o;while((o=c.exec(e))!==null){let i=o[1],n=o[2]||o[3],r=o[4],s=o[5];switch(i){case"component":t.component=n||s||"";break;case"timeout":t.timeout=r?parseInt(r,10):30000;break;case"delay":t.delay=r?parseInt(r,10):200;break;case"suspensible":t.suspensible=s==="true";break;case"retries":t.retries=r?parseInt(r,10):0;break;case"loadingComponent":t.loadingComponent=n||s;break;case"errorComponent":t.errorComponent=n||s;break}}return t}function m(e,t,c,o){let{component:i,timeout:n,delay:r,suspensible:s,retries:a}=t;return`
2
+ var g=0;function p(){return`async-${++g}-${Date.now().toString(36)}`}function Dl(e,t={},c){let o=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@error\s*([\s\S]*?)@endasync/gi,i=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@endasync/gi,n=e;return n=n.replace(o,(r,s,a,d)=>{let l=p(),y=u(s);return m(l,y,a.trim(),d.trim())}),n=n.replace(i,(r,s,a)=>{let d=p(),l=u(s);return m(d,l,a.trim(),'<div class="stx-async-error">Failed to load component</div>')}),n}function u(e){let t={component:"",timeout:30000,delay:200,suspensible:!0,retries:0},c=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,o;while((o=c.exec(e))!==null){let i=o[1],n=o[2]||o[3],r=o[4],s=o[5];switch(i){case"component":t.component=n||s||"";break;case"timeout":t.timeout=r?parseInt(r,10):30000;break;case"delay":t.delay=r?parseInt(r,10):200;break;case"suspensible":t.suspensible=s==="true";break;case"retries":t.retries=r?parseInt(r,10):0;break;case"loadingComponent":t.loadingComponent=n||s;break;case"errorComponent":t.errorComponent=n||s;break}}return t}function m(e,t,c,o){let{component:i,timeout:n,delay:r,suspensible:s,retries:a}=t;return`
3
3
  <div class="stx-async-component" data-async-id="${e}" data-component="${i}" data-status="pending">
4
4
  <div class="stx-async-loading" data-async-loading="${e}">
5
5
  ${c}
@@ -226,7 +226,7 @@ catch (error) {
226
226
  loadComponent();
227
227
  })();
228
228
  </script>
229
- `}function Dl(e){return{__asyncComponent:!0,...typeof e==="function"?{loader:e}:e}}function Ol(e){return typeof e==="object"&&e!==null&&"__asyncComponent"in e&&e.__asyncComponent===!0}function Ml(){return`
229
+ `}function Ol(e){return{__asyncComponent:!0,...typeof e==="function"?{loader:e}:e}}function Ml(e){return typeof e==="object"&&e!==null&&"__asyncComponent"in e&&e.__asyncComponent===!0}function Nl(){return`
230
230
  /* STX Async Component Styles */
231
231
  .stx-async-component {
232
232
  position: relative;
@@ -300,7 +300,7 @@ catch (error) {
300
300
  background-size: 200% 100%;
301
301
  }
302
302
  }
303
- `}function Nl(){return`
303
+ `}function Ll(){return`
304
304
  // STX Async Component Runtime
305
305
  (function() {
306
306
  if (typeof window === 'undefined') return;
@@ -355,4 +355,4 @@ catch (error) {
355
355
  console.log('[stx] Async component runtime initialized');
356
356
  })();
357
357
  `}
358
- export{Il,Dl,Ol,Ml,Nl};
358
+ export{Dl,Ol,Ml,Nl,Ll};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- var d=0;function l(){return`keep-alive-${++d}-${Date.now().toString(36)}`}function Ll(e,t={},n){let i=/@keepAlive(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@endkeepAlive/gi;return e.replace(i,(a,c,o)=>{let s=l(),r=u(c||"");return p(s,o.trim(),r)})}function u(e){let t={max:10},n=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,i;while((i=n.exec(e))!==null){let a=i[1],c=i[2]||i[3],o=i[4];switch(a){case"max":t.max=o?parseInt(o,10):10;break;case"include":t.include=c;break;case"exclude":t.exclude=c;break;case"id":t.id=c;break}}return t}function p(e,t,n){let{max:i,include:a,exclude:c}=n,o=n.id||e;return`
2
+ var d=0;function l(){return`keep-alive-${++d}-${Date.now().toString(36)}`}function jl(e,t={},n){let i=/@keepAlive(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@endkeepAlive/gi;return e.replace(i,(a,c,o)=>{let s=l(),r=u(c||"");return p(s,o.trim(),r)})}function u(e){let t={max:10},n=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,i;while((i=n.exec(e))!==null){let a=i[1],c=i[2]||i[3],o=i[4];switch(a){case"max":t.max=o?parseInt(o,10):10;break;case"include":t.include=c;break;case"exclude":t.exclude=c;break;case"id":t.id=c;break}}return t}function p(e,t,n){let{max:i,include:a,exclude:c}=n,o=n.id||e;return`
3
3
  <div class="stx-keep-alive" data-keep-alive-id="${e}" data-custom-id="${o}">
4
4
  <div class="stx-keep-alive-content" data-keep-alive-content="${e}">
5
5
  ${t}
@@ -286,7 +286,7 @@ else {
286
286
  });
287
287
  })();
288
288
  </script>
289
- `}function jl(e={}){return{id:e.id||l(),cache:new Map,max:e.max||10,include:e.include?e.include.split(",").map((n)=>n.trim()):null,exclude:e.exclude?e.exclude.split(",").map((n)=>n.trim()):null}}function Bl(e,t){if(t.exclude&&t.exclude.includes(e))return!1;if(t.include&&!t.include.includes(e))return!1;return!0}function Fl(){return`
289
+ `}function Bl(e={}){return{id:e.id||l(),cache:new Map,max:e.max||10,include:e.include?e.include.split(",").map((n)=>n.trim()):null,exclude:e.exclude?e.exclude.split(",").map((n)=>n.trim()):null}}function Fl(e,t){if(t.exclude&&t.exclude.includes(e))return!1;if(t.include&&!t.include.includes(e))return!1;return!0}function zl(){return`
290
290
  /* STX Keep-Alive Styles */
291
291
  .stx-keep-alive {
292
292
  position: relative;
@@ -311,7 +311,7 @@ else {
311
311
  .stx-keep-alive-content > [data-activated] {
312
312
  opacity: 1;
313
313
  }
314
- `}function zl(){return`
314
+ `}function Hl(){return`
315
315
  // STX Keep-Alive Runtime
316
316
  (function() {
317
317
  if (typeof window === 'undefined') return;
@@ -347,5 +347,5 @@ else {
347
347
 
348
348
  console.log('[stx] Keep-alive runtime initialized');
349
349
  })();
350
- `}function Hl(e){if(typeof document<"u")document.addEventListener("stx:activated",(t)=>{e(t.detail)})}function Vl(e){if(typeof document<"u")document.addEventListener("stx:deactivated",(t)=>{e(t.detail)})}
351
- export{Ll,jl,Bl,Fl,zl,Hl,Vl};
350
+ `}function Vl(e){if(typeof document<"u")document.addEventListener("stx:activated",(t)=>{e(t.detail)})}function Ul(e){if(typeof document<"u")document.addEventListener("stx:deactivated",(t)=>{e(t.detail)})}
351
+ export{jl,Bl,Fl,zl,Hl,Vl,Ul};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Pn,Oe,Ne,me,Uo,Nn,Z,q,nn,d,n,A}from"./chunk-nrp8qg9j.js";import{dirname as C,resolve as R}from"path";function h(o){return o.endsWith(".md")||o.endsWith(".markdown")}function _(o){let e=[];m(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let r=[...e];m(/<code\b[^>]*>[\s\S]*?<\/code>/gi,r);function m(s,p){let u;while((u=s.exec(o))!==null){let t=u.index,i=t+u[0].length;if(p?.some((l)=>t>=l.start&&i<=l.end))continue;e.push({start:t,end:i})}}if(e.length===0)return o;e.sort((s,p)=>s.start-p.start);let a="",c=0;for(let s of e){if(s.start<c)continue;a+=o.slice(c,s.start),a+=`@raw${o.slice(s.start,s.end)}@endraw`,c=s.end}return a+=o.slice(c),a}async function b(o,e={}){let{data:r,content:m}=Pn(o),c=await(e.renderer??((s)=>Oe(s)))(m);return{html:_(c),frontmatter:r??{}}}function k(o){let e=o,r=Z(o);if(r)e=r.content.trim();let m=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,a=[],c=[],s=[],p=(i)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(i),u;while((u=m.exec(o))!==null){let i=u[1],l=u[2],f=u[0],g=i.includes("server");if(p(l))s.push(f);else if(g)c.push(l);else a.push(f)}let t=e;{let i=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,l,f=[];while((l=i.exec(t))!==null){let g=l.index+l[0].length,x=t.indexOf("</script>",g);if(x===-1)continue;f.push({start:l.index,end:x+9}),i.lastIndex=x+9}for(let g=f.length-1;g>=0;g--)t=t.substring(0,f[g].start)+t.substring(f[g].end)}for(let i of a)t=t.replace(i,"");return{templateContent:t,serverScripts:c,clientScripts:a,signalsScripts:s}}function v(o,e){return`<!DOCTYPE html>
2
+ import{In,Oe,Ne,me,Wo,Ln,Z,K,rn,d,n,I}from"./chunk-kwct777t.js";import{dirname as C,resolve as R}from"path";function h(o){return o.endsWith(".md")||o.endsWith(".markdown")}function _(o){let e=[];m(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let r=[...e];m(/<code\b[^>]*>[\s\S]*?<\/code>/gi,r);function m(s,p){let u;while((u=s.exec(o))!==null){let t=u.index,i=t+u[0].length;if(p?.some((l)=>t>=l.start&&i<=l.end))continue;e.push({start:t,end:i})}}if(e.length===0)return o;e.sort((s,p)=>s.start-p.start);let a="",c=0;for(let s of e){if(s.start<c)continue;a+=o.slice(c,s.start),a+=`@raw${o.slice(s.start,s.end)}@endraw`,c=s.end}return a+=o.slice(c),a}async function b(o,e={}){let{data:r,content:m}=In(o),c=await(e.renderer??((s)=>Oe(s)))(m);return{html:_(c),frontmatter:r??{}}}function k(o){let e=o,r=Z(o);if(r)e=r.content.trim();let m=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,a=[],c=[],s=[],p=(i)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(i),u;while((u=m.exec(o))!==null){let i=u[1],l=u[2],f=u[0],g=i.includes("server");if(p(l))s.push(f);else if(g)c.push(l);else a.push(f)}let t=e;{let i=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,l,f=[];while((l=i.exec(t))!==null){let g=l.index+l[0].length,x=t.indexOf("</script>",g);if(x===-1)continue;f.push({start:l.index,end:x+9}),i.lastIndex=x+9}for(let g=f.length-1;g>=0;g--)t=t.substring(0,f[g].start)+t.substring(f[g].end)}for(let i of a)t=t.replace(i,"");return{templateContent:t,serverScripts:c,clientScripts:a,signalsScripts:s}}function v(o,e){return`<!DOCTYPE html>
3
3
  <html lang="en">
4
4
  <head>
5
5
  <meta charset="UTF-8">
@@ -9,10 +9,10 @@ import{Pn,Oe,Ne,me,Uo,Nn,Z,q,nn,d,n,A}from"./chunk-nrp8qg9j.js";import{dirname a
9
9
  <body>
10
10
  ${o}
11
11
  </body>
12
- </html>`}async function Eo(o,e={}){let r=R(o),m=Bun.file(r);if(!await m.exists())throw Error(`Template file not found: ${r}`);let a=await m.text(),c=null;if(h(r)){let s=await b(a,{renderer:e.markdownRenderer});a=s.html,c=s.frontmatter}if(c)e={...e,context:{...c,...e.context||{}}};if(e.layout){let s=R(e.layout),p=Bun.file(s);if(!await p.exists())throw Error(`Layout template not found: ${s}`);let{layout:u,injectCSS:t,...i}=e,l={...e.context||{}};nn(l);let f=await S(a,r,{...i,context:{...l,__stx_defer_server_data:!0},injectCSS:!1}),g=await p.text(),x={...l,content:f},w={...i,context:x,injectCSS:t};return S(g,s,w)}return S(a,r,e)}async function S(o,e,r={}){let{templateContent:m,serverScripts:a,clientScripts:c}=k(o),s={...A,...r.options},p={__filename:e,__dirname:C(e),__stx:{},__stx_options:s,__stx_sfc_mode:!0,__stx_inject_css:r.injectCSS===!0,__stxServeContext:void 0,...Nn(r.context??{}),definePageMeta:()=>{},...r.context||{}};for(let i of a)await d(i,p,e);let u=new Set,t=m;if(t=await n(t,p,e,s,u),Uo(p,r.context),r.templateOnly){if(t=t.replace(/<script data-stx-scoped>[\s\S]*?<\/script>\s*/gi,""),t=t.replace(/<!-- stx SEO Tags -->[\s\S]*?(?=<)/i,""),c.length>0)t+=`
12
+ </html>`}async function To(o,e={}){let r=R(o),m=Bun.file(r);if(!await m.exists())throw Error(`Template file not found: ${r}`);let a=await m.text(),c=null;if(h(r)){let s=await b(a,{renderer:e.markdownRenderer});a=s.html,c=s.frontmatter}if(c)e={...e,context:{...c,...e.context||{}}};if(e.layout){let s=R(e.layout),p=Bun.file(s);if(!await p.exists())throw Error(`Layout template not found: ${s}`);let{layout:u,injectCSS:t,...i}=e,l={...e.context||{}};rn(l);let f=await S(a,r,{...i,context:{...l,__stx_defer_server_data:!0},injectCSS:!1}),g=await p.text(),x={...l,content:f},w={...i,context:x,injectCSS:t};return S(g,s,w)}return S(a,r,e)}async function S(o,e,r={}){let{templateContent:m,serverScripts:a,clientScripts:c}=k(o),s={...I,...r.options},p={__filename:e,__dirname:C(e),__stx:{},__stx_options:s,__stx_sfc_mode:!0,__stx_inject_css:r.injectCSS===!0,__stxServeContext:void 0,...Ln(r.context??{}),definePageMeta:()=>{},...r.context||{}};for(let i of a)await d(i,p,e);let u=new Set,t=m;if(t=await n(t,p,e,s,u),Wo(p,r.context),r.templateOnly){if(t=t.replace(/<script data-stx-scoped>[\s\S]*?<\/script>\s*/gi,""),t=t.replace(/<!-- stx SEO Tags -->[\s\S]*?(?=<)/i,""),c.length>0)t+=`
13
13
  ${c.join(`
14
14
  `)}`}else{if(r.processClientScripts!==!1&&c.length>0){let i=p.__stx_event_bindings||[],l=Ne(p),g=(await Promise.all(c.map(async(w)=>{let y=w.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!y)return w;return await me(y[1],{eventBindings:i,templateContent:t,serverData:l,filePath:e})}))).join(`
15
15
  `);if(t.match(/(<\/body>)/i))t=t.replace(/(<\/body>)/i,`${g}
16
16
  $1`);else t+=`
17
- ${g}`}t=await q(t)}if(r.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=v(t,r.title)}if(r.injectCSS)try{let{injectCss:i}=await import("./chunk-wr3h8dmt.js");t=await i(t)}catch{}return t}
18
- export{Eo};
17
+ ${g}`}t=await K(t)}if(r.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=v(t,r.title)}if(r.injectCSS)try{let{injectCss:i}=await import("./chunk-tmn8hxm6.js");t=await i(t)}catch{}return t}
18
+ export{To};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import I from"fs";import u from"path";import V from"os";import x from"crypto";import{generatePlaceholder as C,processImage as D}from"ts-images";var L=[320,640,768,1024,1280,1536,1920],j=["webp","jpeg"],B=80,O=[".jpg",".jpeg",".png",".webp",".avif",".gif",".svg"],k={webp:"image/webp",avif:"image/avif",jpeg:"image/jpeg",png:"image/png"},w=null,v=!1;async function p(){if(v)return w;v=!0;try{let t=await import("sharp");return w=t.default||t,w}catch{return null}}async function Dt(){return await p()!==null}async function G(){return!0}async function se(t,e={}){let{widths:a=L,formats:r=j,quality:n=B,fit:i="cover",placeholder:m="none",outputDir:o=".stx/images",baseUrl:b="/images"}=e,h,g;if(typeof t==="string"){if(g=t,!await Bun.file(t).exists())throw new $n(`Image not found: ${t}`,"NOT_FOUND");h=await Bun.file(t).arrayBuffer().then((s)=>Buffer.from(s))}else g="buffer-input",h=t;let y=x.createHash("sha256").update(h).digest("hex").slice(0,12),R=await Cn(h),{width:c,height:S}=R,P=c/S;await I.promises.mkdir(o,{recursive:!0});let E=[],T=u.basename(g,u.extname(g)),l=a.filter((s)=>s<=c);if(!l.includes(c)&&c<=Math.max(...a))l.push(c);l.sort((s,f)=>s-f);for(let s of l){let f=Math.round(s/P);for(let d of r){let U=`${T}-${s}w-${y}.${d}`,A=u.join(o,U),z=`${b}/${U}`,q=await Gi(h,{width:s,height:f,format:d,quality:n,fit:i});await Bun.write(A,q),E.push({path:A,url:z,width:s,height:f,format:d,size:q.length})}}let M;if(m!=="none")M=await _(h,m);return{src:g,variants:E,placeholder:M,width:c,height:S,aspectRatio:P,hash:y}}async function Cn(t){let e=typeof t==="string"?Buffer.from(await Bun.file(t).arrayBuffer()):t,a=await p();if(a){let n=await a(e).metadata();return{width:n.width||0,height:n.height||0,format:n.format||"unknown",hasAlpha:n.hasAlpha}}return N(e)}function N(t){if(t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71){let e=t.readUInt32BE(16),a=t.readUInt32BE(20);return{width:e,height:a,format:"png",hasAlpha:!0}}if(t[0]===255&&t[1]===216){let e=2;while(e<t.length){if(t[e]!==255)break;let a=t[e+1];if(a>=192&&a<=207&&a!==196&&a!==200&&a!==204){let n=t.readUInt16BE(e+5);return{width:t.readUInt16BE(e+7),height:n,format:"jpeg",hasAlpha:!1}}let r=t.readUInt16BE(e+2);e+=2+r}}if(t.toString("utf8",0,4)==="RIFF"&&t.toString("utf8",8,12)==="WEBP"){let e=t.toString("utf8",12,16);if(e==="VP8 "){let a=t.readUInt16LE(26)&16383,r=t.readUInt16LE(28)&16383;return{width:a,height:r,format:"webp",hasAlpha:!1}}if(e==="VP8L"){let a=t.readUInt32LE(21),r=(a&16383)+1,n=(a>>14&16383)+1;return{width:r,height:n,format:"webp",hasAlpha:!0}}}if(t.toString("utf8",0,3)==="GIF"){let e=t.readUInt16LE(6),a=t.readUInt16LE(8);return{width:e,height:a,format:"gif",hasAlpha:!0}}throw new $n("Unable to parse image dimensions","PARSE_ERROR")}async function Gi(t,e){let a=await p();if(a){let n=a(t).resize(e.width,e.height,{fit:e.fit});switch(e.format){case"webp":n=n.webp({quality:e.quality});break;case"avif":n=n.avif({quality:e.quality});break;case"jpeg":n=n.jpeg({quality:e.quality});break;case"png":n=n.png({quality:e.quality});break}return n.toBuffer()}let r=u.join(V.tmpdir(),`stx-img-${x.randomBytes(8).toString("hex")}.${e.format}`);try{return await D({input:t,output:r,format:e.format,quality:e.quality,resize:{width:e.width,height:e.height,fit:e.fit}}),Buffer.from(await Bun.file(r).arrayBuffer())}finally{await I.promises.unlink(r).catch(()=>{})}}async function _(t,e){let a=await p();if(e==="blur"&&a){let m=(await a(t).resize(20).blur(10).toBuffer()).toString("base64"),o=await Cn(t);return`data:${k[o.format]||"image/jpeg"};base64,${m}`}if(e==="dominant-color"&&a){let{dominant:i}=await a(t).resize(1,1).toBuffer().then(async(m)=>{let o=await a(m).metadata();return{dominant:{r:128,g:128,b:128}}}).catch(()=>({dominant:{r:128,g:128,b:128}}));return`rgb(${i.r}, ${i.g}, ${i.b})`}let r=await Cn(t),n=u.join(V.tmpdir(),`stx-ph-${x.randomBytes(8).toString("hex")}.${r.format==="unknown"?"bin":r.format}`);try{await Bun.write(n,t);let i=e==="blur"?"blur":e==="thumbhash"?"thumbhash":"dominant-color",o=await C(n,{strategy:i,width:i==="thumbhash"?void 0:32});if(e==="dominant-color"&&o.dominantColor)return o.dominantColor;if(o.dataURL)return o.dataURL;return"rgb(128, 128, 128)"}catch{return"rgb(128, 128, 128)"}finally{await I.promises.unlink(n).catch(()=>{})}}function Re(t,e){return(e?t.filter((r)=>r.format===e):t).sort((r,n)=>r.width-n.width).map((r)=>`${r.url} ${r.width}w`).join(", ")}function ut(t){if(!t||Object.keys(t).length===0)return"100vw";return Object.entries(t).sort((a,r)=>{let n=Number.parseInt(a[0].replace(/\D/g,""))||0;return(Number.parseInt(r[0].replace(/\D/g,""))||0)-n}).map(([a,r])=>`(max-width: ${a}) ${r}`).join(", ")+", 100vw"}function Ot(t){let e=t.filter((r)=>r.format==="jpeg");if(e.length===0)return t[Math.floor(t.length/2)];let a=e.sort((r,n)=>r.width-n.width);return a[Math.floor(a.length/2)]}function Mt(t){let e=new Map;for(let a of t){let r=e.get(a.format)||[];r.push(a),e.set(a.format,r)}return e}function Nt(t){let e=u.extname(t).toLowerCase();return O.includes(e)}function F(t){return k[t]||"application/octet-stream"}function Lt(t){return t.reduce((e,a)=>e+a.size,0)}function jt(t){if(t<1024)return`${t} B`;if(t<1048576)return`${(t/1024).toFixed(1)} KB`;return`${(t/1048576).toFixed(2)} MB`}class $n extends Error{code;constructor(t,e){super(t);this.name="ImageProcessingError",this.code=e}}
3
- export{L,j,B,Dt,G,se,Cn,Gi,Re,ut,Ot,Mt,Nt,F,Lt,jt,$n};
2
+ import I from"fs";import u from"path";import V from"os";import x from"crypto";import{generatePlaceholder as C,processImage as D}from"ts-images";var j=[320,640,768,1024,1280,1536,1920],B=["webp","jpeg"],F=80,O=[".jpg",".jpeg",".png",".webp",".avif",".gif",".svg"],L={webp:"image/webp",avif:"image/avif",jpeg:"image/jpeg",png:"image/png"},w=null,v=!1;async function p(){if(v)return w;v=!0;try{let t=await import("sharp");return w=t.default||t,w}catch{return null}}async function Ot(){return await p()!==null}async function J(){return!0}async function se(t,e={}){let{widths:a=j,formats:r=B,quality:n=F,fit:i="cover",placeholder:m="none",outputDir:o=".stx/images",baseUrl:b="/images"}=e,h,g;if(typeof t==="string"){if(g=t,!await Bun.file(t).exists())throw new En(`Image not found: ${t}`,"NOT_FOUND");h=await Bun.file(t).arrayBuffer().then((s)=>Buffer.from(s))}else g="buffer-input",h=t;let y=x.createHash("sha256").update(h).digest("hex").slice(0,12),k=await $n(h),{width:c,height:S}=k,P=c/S;await I.promises.mkdir(o,{recursive:!0});let E=[],R=u.basename(g,u.extname(g)),l=a.filter((s)=>s<=c);if(!l.includes(c)&&c<=Math.max(...a))l.push(c);l.sort((s,f)=>s-f);for(let s of l){let f=Math.round(s/P);for(let d of r){let U=`${R}-${s}w-${y}.${d}`,A=u.join(o,U),T=`${b}/${U}`,q=await Ji(h,{width:s,height:f,format:d,quality:n,fit:i});await Bun.write(A,q),E.push({path:A,url:T,width:s,height:f,format:d,size:q.length})}}let M;if(m!=="none")M=await _(h,m);return{src:g,variants:E,placeholder:M,width:c,height:S,aspectRatio:P,hash:y}}async function $n(t){let e=typeof t==="string"?Buffer.from(await Bun.file(t).arrayBuffer()):t,a=await p();if(a){let n=await a(e).metadata();return{width:n.width||0,height:n.height||0,format:n.format||"unknown",hasAlpha:n.hasAlpha}}return N(e)}function N(t){if(t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71){let e=t.readUInt32BE(16),a=t.readUInt32BE(20);return{width:e,height:a,format:"png",hasAlpha:!0}}if(t[0]===255&&t[1]===216){let e=2;while(e<t.length){if(t[e]!==255)break;let a=t[e+1];if(a>=192&&a<=207&&a!==196&&a!==200&&a!==204){let n=t.readUInt16BE(e+5);return{width:t.readUInt16BE(e+7),height:n,format:"jpeg",hasAlpha:!1}}let r=t.readUInt16BE(e+2);e+=2+r}}if(t.toString("utf8",0,4)==="RIFF"&&t.toString("utf8",8,12)==="WEBP"){let e=t.toString("utf8",12,16);if(e==="VP8 "){let a=t.readUInt16LE(26)&16383,r=t.readUInt16LE(28)&16383;return{width:a,height:r,format:"webp",hasAlpha:!1}}if(e==="VP8L"){let a=t.readUInt32LE(21),r=(a&16383)+1,n=(a>>14&16383)+1;return{width:r,height:n,format:"webp",hasAlpha:!0}}}if(t.toString("utf8",0,3)==="GIF"){let e=t.readUInt16LE(6),a=t.readUInt16LE(8);return{width:e,height:a,format:"gif",hasAlpha:!0}}throw new En("Unable to parse image dimensions","PARSE_ERROR")}async function Ji(t,e){let a=await p();if(a){let n=a(t).resize(e.width,e.height,{fit:e.fit});switch(e.format){case"webp":n=n.webp({quality:e.quality});break;case"avif":n=n.avif({quality:e.quality});break;case"jpeg":n=n.jpeg({quality:e.quality});break;case"png":n=n.png({quality:e.quality});break}return n.toBuffer()}let r=u.join(V.tmpdir(),`stx-img-${x.randomBytes(8).toString("hex")}.${e.format}`);try{return await D({input:t,output:r,format:e.format,quality:e.quality,resize:{width:e.width,height:e.height,fit:e.fit}}),Buffer.from(await Bun.file(r).arrayBuffer())}finally{await I.promises.unlink(r).catch(()=>{})}}async function _(t,e){let a=await p();if(e==="blur"&&a){let m=(await a(t).resize(20).blur(10).toBuffer()).toString("base64"),o=await $n(t);return`data:${L[o.format]||"image/jpeg"};base64,${m}`}if(e==="dominant-color"&&a){let{dominant:i}=await a(t).resize(1,1).toBuffer().then(async(m)=>{let o=await a(m).metadata();return{dominant:{r:128,g:128,b:128}}}).catch(()=>({dominant:{r:128,g:128,b:128}}));return`rgb(${i.r}, ${i.g}, ${i.b})`}let r=await $n(t),n=u.join(V.tmpdir(),`stx-ph-${x.randomBytes(8).toString("hex")}.${r.format==="unknown"?"bin":r.format}`);try{await Bun.write(n,t);let i=e==="blur"?"blur":e==="thumbhash"?"thumbhash":"dominant-color",o=await C(n,{strategy:i,width:i==="thumbhash"?void 0:32});if(e==="dominant-color"&&o.dominantColor)return o.dominantColor;if(o.dataURL)return o.dataURL;return"rgb(128, 128, 128)"}catch{return"rgb(128, 128, 128)"}finally{await I.promises.unlink(n).catch(()=>{})}}function Re(t,e){return(e?t.filter((r)=>r.format===e):t).sort((r,n)=>r.width-n.width).map((r)=>`${r.url} ${r.width}w`).join(", ")}function ut(t){if(!t||Object.keys(t).length===0)return"100vw";return Object.entries(t).sort((a,r)=>{let n=Number.parseInt(a[0].replace(/\D/g,""))||0;return(Number.parseInt(r[0].replace(/\D/g,""))||0)-n}).map(([a,r])=>`(max-width: ${a}) ${r}`).join(", ")+", 100vw"}function Mt(t){let e=t.filter((r)=>r.format==="jpeg");if(e.length===0)return t[Math.floor(t.length/2)];let a=e.sort((r,n)=>r.width-n.width);return a[Math.floor(a.length/2)]}function Nt(t){let e=new Map;for(let a of t){let r=e.get(a.format)||[];r.push(a),e.set(a.format,r)}return e}function Lt(t){let e=u.extname(t).toLowerCase();return O.includes(e)}function z(t){return L[t]||"application/octet-stream"}function jt(t){return t.reduce((e,a)=>e+a.size,0)}function Bt(t){if(t<1024)return`${t} B`;if(t<1048576)return`${(t/1024).toFixed(1)} KB`;return`${(t/1048576).toFixed(2)} MB`}class En extends Error{code;constructor(t,e){super(t);this.name="ImageProcessingError",this.code=e}}
3
+ export{j,B,F,Ot,J,se,$n,Ji,Re,ut,Mt,Nt,Lt,z,jt,Bt,En};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{to,Gi}from"./chunk-rgwvqmhh.js";import"./chunk-z80d9dd2.js";export{Gi as createImageHandler,to as handleImageRequest};
@@ -0,0 +1,33 @@
1
+ // @bun
2
+ import{y}from"./chunk-w1zvh5y7.js";import{P,_t}from"./chunk-h9e032kq.js";import{m,h,w,ze,L,o}from"./chunk-kwct777t.js";import{ie,ht,yt}from"./chunk-06gzq9xe.js";import{Ae,Ut,dt,H}from"./chunk-8efg91ak.js";import _ from"path";var S=new Map,B=new Map,D=m(64),N=new Map,U=["composables","functions"];function O(t){let r=_.basename(t,".ts");return r==="index"||r==="types"||t.endsWith(".d.ts")}async function W(t){if(t)return _.resolve(t);let r=`<default>:${process.cwd()}`,c=N.get(r);if(c!==void 0)return c;let e=await X();if(e!==null)N.set(r,e);return e}async function X(){let t=await o(),r=t.root||process.cwd(),c=t.composablesDir;if(c)return _.resolve(r,c);for(let e of U){let i=_.resolve(r,e);try{let l=new Bun.Glob("**/*.ts");for await(let a of l.scan({cwd:i,absolute:!0}))if(!O(a))return i}catch{}}return null}async function G(t){let r=Array.isArray(t)?t:t?[_.resolve(t)]:(await o())._layerComposableDirs??[await W()].filter((e)=>!!e),c=new Map;for(let e of r){let i=new Bun.Glob("**/*.ts");try{for await(let l of i.scan({cwd:e,absolute:!0})){let a=_.relative(e,l);if(!O(l)&&!c.has(a))c.set(a,l)}}catch{}}return{key:r.join("\x00"),files:[...c.values()].sort()}}async function Or(t){let{files:r}=await G(t),c=L({loader:"ts",target:"browser",define:w()}),e=[];for(let i of r)try{let l=await Bun.file(i).text(),a=c.scan(l).exports.filter((f)=>f!=="default");if(a.length>0)e.push({file:i,names:a})}catch{}return e}function Z(t,r){return new RegExp(`\\b${r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(t)}function q(t,r){let c=new Set(t.match(/\w+/g)),e=new Set;for(let i of r)if(/^\w+$/.test(i)?c.has(i):Z(t,i))e.add(i);return e}function Q(t,r,c){let e=new Map;for(let{file:f,names:d}of t)for(let u of d)if(!e.has(u))e.set(u,f);let i=(f)=>{let d=[];for(let u of q(f,e.keys()))d.push(e.get(u));return d},l=new Set,a=c.flatMap(i);while(a.length>0){let f=[];for(let d of a){if(l.has(d))continue;l.add(d);for(let u of i(r.get(d)??""))if(!l.has(u))f.push(u)}a=f}return l}async function yl(t,r,c){let{key:e,files:i}=await G(t);if(!e)return null;let l=()=>[...new Set([...i,...i.flatMap((n)=>ie(n))])],a=Ae(l());if(i.length===0)return H(S,e,a,""),null;i.sort();let f=L({loader:"ts",target:"browser",define:w()}),d=dt(B,e,a);if(!d){let n=new Map,s=[];for(let p of i)try{let g=await Bun.file(p).text();n.set(p,g);let R=f.scan(g).exports.filter((z)=>z!=="default");if(R.length>0)s.push({file:p,names:R})}catch{n.set(p,"")}d=H(B,e,a,{codeByFile:n,modules:s})}let{codeByFile:u,modules:J}=d,b;if(r===void 0)b=new Set(i);else{let n=c?[r,...c]:[r],s=h(n.join("\x00"),e,n.length,a),p=D.get(s);if(b=p??Q(J,u,n),!p)D.set(s,b)}if(b.size===0)return null;let k=i.filter((n)=>b.has(n)),C=`${e}\x00${k.join("\x00")}`,I=dt(S,C,a);if(I!==void 0)return I||null;let v=[],x=new Set,E=new Set;for(let n of k)try{let s=u.get(n)??await Bun.file(n).text(),p=_.basename(n,".ts");for(let g of s.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(g[1])E.add(g[1]);try{for(let g of f.scan(s).exports)if(g!=="default")x.add(g)}catch{}if(s=P(s),ht(s))s=await yt(s,n,{projectRoot:process.cwd(),externalizeUserModules:!1}),s=ze(s);s=_t(s),s=s.replace(/^export\s+(default\s+)?/gm,""),s=f.transformSync(s),v.push(`// Composable: ${p}
3
+ ${s.trim()}`)}catch(s){console.warn(`[stx] Failed to load composable ${n}:`,s)}if(v.length===0||x.size===0)return H(S,C,a,""),null;let K=[...x].map((n)=>` try { if (!(${JSON.stringify(n)} in __c)) __c[${JSON.stringify(n)}] = ${n}; } catch (e) {}`).join(`
4
+ `),F=JSON.stringify([...x]),M=v.join(`
5
+
6
+ `),T=y.filter((n)=>!E.has(n)&&new RegExp(`\\b${n}\\b`).test(M)).map((n)=>`var ${n} = __stx[${JSON.stringify(n)}];`).join(`
7
+ `),j=JSON.stringify(new Bun.CryptoHasher("md5").update(`${F}\x00${M}`).digest("hex").slice(0,12)),A=`;(function(){
8
+ var __bundles = window.__stxComposableBundles || (window.__stxComposableBundles = {});
9
+ if (__bundles[${j}]) return;
10
+ __bundles[${j}] = true;
11
+ var __published = window.__stxComposableGlobals || (window.__stxComposableGlobals = {});
12
+ window.__composables = window.__composables || {};
13
+ var __c = window.__composables;
14
+ var __stx = window.stx || {};
15
+ ${T}
16
+ ${M}
17
+ ${K}
18
+ var __names = ${F};
19
+ for (var __i = 0; __i < __names.length; __i++) {
20
+ var __n = __names[__i];
21
+ if (!(__n in __c) || __published[__n]) continue;
22
+ var __takenByBuiltin = !!(window.stx && __n in window.stx);
23
+ if (__takenByBuiltin || __n in window) {
24
+ console.warn('[stx] composable "' + __n + '" is not available as a bare identifier: '
25
+ + (__takenByBuiltin ? 'a built-in of that name already exists' : 'window already defines that property')
26
+ + '. Rename it, or use: import { ' + __n + ' } from "@composables"');
27
+ continue;
28
+ }
29
+ window[__n] = __c[__n];
30
+ __published[__n] = true;
31
+ }
32
+ })();`;return a=Ae(l()),H(S,C,a,A),A}function bl(){S.clear(),Ut(),B.clear(),D.clear(),N.clear()}
33
+ export{Or,yl,bl};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{o}from"./chunk-nrp8qg9j.js";import{Sr}from"./chunk-rdq113p4.js";import p from"path";async function il(t={}){let d=performance.now(),s=t.root||process.cwd(),e=await o(s),u=t.ssr?.routeRules??e.routeRules??{};if(Sr(u),!e.ssr&&Object.keys(u).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!e.ssr&&(t.ssr?.serverApi??e.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let r=e.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${r.toUpperCase()}${e.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let n,l;if(r==="ssg"){let{generateStaticSite:i}=await import("./ssg.js");n=await i({pagesDir:p.join(e.root||".",e.pagesDir||e.build?.pagesDir||"pages"),publicDir:e.publicDir||e.build?.publicDir||"public",outputDir:e.build?.outputDir||"dist",generate404:e.build?.generate404??!0,minify:e.build?.minify??!0,cleanOutput:e.build?.cleanOutput??!0,router:e.router,...t.ssg})}else{let{buildForProduction:i}=await import("./chunk-w9k7pvre.js");l=await i({root:s,outputDir:".output",debug:t.debug,...t.ssr})}let a=Math.round(performance.now()-d);return{mode:r,ssg:n,ssr:l,duration:a}}
3
- export{il};
2
+ import{o}from"./chunk-kwct777t.js";import{kr}from"./chunk-r80km6mn.js";import p from"path";async function al(t={}){let d=performance.now(),s=t.root||process.cwd(),e=await o(s),u=t.ssr?.routeRules??e.routeRules??{};if(kr(u),!e.ssr&&Object.keys(u).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!e.ssr&&(t.ssr?.serverApi??e.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let r=e.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${r.toUpperCase()}${e.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let n,l;if(r==="ssg"){let{generateStaticSite:i}=await import("./ssg.js");n=await i({pagesDir:p.join(e.root||".",e.pagesDir||e.build?.pagesDir||"pages"),publicDir:e.publicDir||e.build?.publicDir||"public",outputDir:e.build?.outputDir||"dist",generate404:e.build?.generate404??!0,minify:e.build?.minify??!0,cleanOutput:e.build?.cleanOutput??!0,router:e.router,...t.ssg})}else{let{buildForProduction:i}=await import("./chunk-9mtz7tyv.js");l=await i({root:s,outputDir:".output",debug:t.debug,...t.ssr})}let a=Math.round(performance.now()-d);return{mode:r,ssg:n,ssr:l,duration:a}}
3
+ export{al};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Nu,sc,ns,rs,qo,Ko,ss,os,Bn,oc,Xo,Go,ic,ze}from"./chunk-kwct777t.js";import"./chunk-bq2e9qf6.js";import"./chunk-8xz8t9xp.js";import"./chunk-0trfbqa7.js";import"./chunk-1vm403b2.js";import"./chunk-zydg3wgt.js";import"./chunk-4fa3jec9.js";import"./chunk-exgyf65a.js";import"./chunk-r6pax860.js";import"./chunk-h9e032kq.js";import"./chunk-w1zvh5y7.js";import"./chunk-nmf12mx3.js";import"./chunk-jz7pvh7b.js";export{Nu as clearScriptScanCache,ss as convertServerLoopAttributesToDirectives,qo as convertSignalDirectivesToAttributes,os as convertSignalLoopsToAttributes,oc as extractExports,Go as findMarkupIndexOutsideScripts,rs as hasSignalsSyntax,ns as parseLoopExpression,Ko as preEvalLiteralReactiveIfs,Bn as processScriptSetup,Xo as processSignals,ic as rewriteStxImportSpecifiers,sc as scanScriptTags,ze as stripStxRuntimeImports};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{AsyncLocalStorage as R}from"async_hooks";var b=Symbol.for("stx.runtime-config.scope"),y=globalThis,m=y[b]??=new R;function le(n,f){return m.run(n,f)}function $t(){return m.getStore()}function Gn(){let n=m.getStore();if(!n)throw Error("useServerRuntimeConfig requires a server request or template render");return Object.freeze(Object.defineProperty({public:n.public},"private",{value:n.private}))}function xs(){return Gn().public}function S(n={},f=process.env){let s=new Set;function o(e,i){if(i===null)return e===null;if(Array.isArray(i))return Array.isArray(e)&&(!i.length||e.every((r)=>i.some((u)=>o(r,u))));if(typeof i==="object")return e!==null&&typeof e==="object"&&!Array.isArray(e)&&Object.entries(i).every(([r,u])=>Object.hasOwn(e,r)&&o(e[r],u));return typeof e===typeof i}function g(e,i){if(e&&typeof e==="object"&&!Array.isArray(e)){if(Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`);let t=Object.create(null);for(let[c,l]of Object.entries(e)){if(!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(c)||["constructor","prototype","__proto__"].includes(c))throw TypeError(`Invalid runtime config key: ${c}`);t[c]=g(l,[...i,c])}return Object.freeze(t)}let r=`STX_RUNTIME_${i.map((t)=>t.replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()).join("__")}`;if(s.has(r))throw TypeError(`Ambiguous runtime config environment key: ${r}`);s.add(r);let u=f[r],a=e;if(u!==void 0){try{a=typeof e==="string"?u:JSON.parse(u)}catch{throw TypeError(`Invalid runtime config override: ${r}`)}if(!o(a,e))throw TypeError(`Wrong runtime config override type: ${r}`)}function p(t){if(t===null||typeof t==="string"||typeof t==="boolean")return t;if(typeof t==="number"&&Number.isFinite(t))return t;if(Array.isArray(t))return Object.freeze(t.map(p));if(t&&typeof t==="object"&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null))return Object.freeze(Object.fromEntries(Object.entries(t).map(([c,l])=>[c,p(l)])));throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`)}return p(a)}return Object.freeze({public:g(n.public??{},["public"]),private:g(n.private??{},["private"])})}function C(n){return`<script data-stx-scoped data-stx-runtime-config type="application/json">${JSON.stringify(n.public).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function Ke(n,f){let s=n.replace(/<script\b[^>]*\bdata-stx-runtime-config\b[^>]*>[\s\S]*?<\/script>/gi,""),o=/<head\b[^>]*>/i.exec(s),g=o?o.index+o[0].length:0;return s.slice(0,g)+C(f)+s.slice(g)}
3
- export{le,$t,Gn,xs,S,Ke};
2
+ import{AsyncLocalStorage as R}from"async_hooks";var b=Symbol.for("stx.runtime-config.scope"),y=globalThis,m=y[b]??=new R;function le(n,f){return m.run(n,f)}function Et(){return m.getStore()}function Jn(){let n=m.getStore();if(!n)throw Error("useServerRuntimeConfig requires a server request or template render");return Object.freeze(Object.defineProperty({public:n.public},"private",{value:n.private}))}function Ss(){return Jn().public}function C(n={},f=process.env){let s=new Set;function o(e,i){if(i===null)return e===null;if(Array.isArray(i))return Array.isArray(e)&&(!i.length||e.every((r)=>i.some((u)=>o(r,u))));if(typeof i==="object")return e!==null&&typeof e==="object"&&!Array.isArray(e)&&Object.entries(i).every(([r,u])=>Object.hasOwn(e,r)&&o(e[r],u));return typeof e===typeof i}function g(e,i){if(e&&typeof e==="object"&&!Array.isArray(e)){if(Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`);let t=Object.create(null);for(let[c,l]of Object.entries(e)){if(!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(c)||["constructor","prototype","__proto__"].includes(c))throw TypeError(`Invalid runtime config key: ${c}`);t[c]=g(l,[...i,c])}return Object.freeze(t)}let r=`STX_RUNTIME_${i.map((t)=>t.replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()).join("__")}`;if(s.has(r))throw TypeError(`Ambiguous runtime config environment key: ${r}`);s.add(r);let u=f[r],a=e;if(u!==void 0){try{a=typeof e==="string"?u:JSON.parse(u)}catch{throw TypeError(`Invalid runtime config override: ${r}`)}if(!o(a,e))throw TypeError(`Wrong runtime config override type: ${r}`)}function p(t){if(t===null||typeof t==="string"||typeof t==="boolean")return t;if(typeof t==="number"&&Number.isFinite(t))return t;if(Array.isArray(t))return Object.freeze(t.map(p));if(t&&typeof t==="object"&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null))return Object.freeze(Object.fromEntries(Object.entries(t).map(([c,l])=>[c,p(l)])));throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`)}return p(a)}return Object.freeze({public:g(n.public??{},["public"]),private:g(n.private??{},["private"])})}function d(n){return`<script data-stx-scoped data-stx-runtime-config type="application/json">${JSON.stringify(n.public).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function Ke(n,f){let s=n.replace(/<script\b[^>]*\bdata-stx-runtime-config\b[^>]*>[\s\S]*?<\/script>/gi,""),o=/<head\b[^>]*>/i.exec(s),g=o?o.index+o[0].length:0;return s.slice(0,g)+d(f)+s.slice(g)}
3
+ export{le,Et,Jn,Ss,C,Ke};