@stacksjs/stx 0.2.563 → 0.2.565

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 (223) hide show
  1. package/dist/app-shell.d.ts +3 -0
  2. package/dist/app-shell.js +27 -3
  3. package/dist/{chunk-2tm3vzm7.js → chunk-01s01ten.js} +5 -5
  4. package/dist/chunk-04qvjcsr.js +2 -0
  5. package/dist/chunk-125rc958.js +3 -0
  6. package/dist/chunk-15g5sc0p.js +3 -0
  7. package/dist/{chunk-171xv81z.js → chunk-18270qgd.js} +2 -2
  8. package/dist/{chunk-g6cwhsb4.js → chunk-1hrj0t0j.js} +11 -11
  9. package/dist/chunk-1zfg1kd5.js +2 -0
  10. package/dist/chunk-203rr1c8.js +3 -0
  11. package/dist/{chunk-xb739v4r.js → chunk-2ernwctg.js} +6 -6
  12. package/dist/chunk-2xbrrc5a.js +2 -0
  13. package/dist/chunk-2yypassp.js +2 -0
  14. package/dist/{chunk-fgmv8f14.js → chunk-325p135t.js} +12 -12
  15. package/dist/{chunk-v1m9nrn9.js → chunk-36aj0yzt.js} +1 -1
  16. package/dist/chunk-375skn32.js +2 -0
  17. package/dist/{chunk-qmza4327.js → chunk-39tkfkp7.js} +3 -3
  18. package/dist/{chunk-jjwg83xv.js → chunk-3hkv4e7t.js} +1 -1
  19. package/dist/chunk-3wyxe996.js +2 -0
  20. package/dist/chunk-4mmdpb46.js +2 -0
  21. package/dist/chunk-4q5d5r7s.js +2 -0
  22. package/dist/{chunk-mtdx75j5.js → chunk-4zb2ga7p.js} +2 -2
  23. package/dist/{chunk-vb1w9wy4.js → chunk-55hfvmvv.js} +13 -13
  24. package/dist/{chunk-7t05bpf7.js → chunk-5grx48s2.js} +2 -2
  25. package/dist/{chunk-7wfh2hqy.js → chunk-5s555c1r.js} +4 -4
  26. package/dist/chunk-5ytg0wbc.js +2 -0
  27. package/dist/{chunk-8227vfw0.js → chunk-68b64sj4.js} +1 -1
  28. package/dist/chunk-6qyters0.js +2 -0
  29. package/dist/{chunk-6bxy1b9q.js → chunk-6sf4v894.js} +5 -5
  30. package/dist/{chunk-yp00nht2.js → chunk-6vnnx536.js} +2 -2
  31. package/dist/chunk-6yn90mq9.js +2 -0
  32. package/dist/chunk-7d2vyre0.js +2 -0
  33. package/dist/{chunk-r4199q6x.js → chunk-7m0r2qs2.js} +2 -2
  34. package/dist/chunk-7pewegtw.js +2 -0
  35. package/dist/chunk-7w0qa3n0.js +2 -0
  36. package/dist/{chunk-5fx8m234.js → chunk-7wyyjdks.js} +2 -2
  37. package/dist/{chunk-nd8v4xgb.js → chunk-7ze47qgv.js} +5 -5
  38. package/dist/{chunk-x8rx0s3h.js → chunk-8afnq4qx.js} +3 -3
  39. package/dist/{chunk-gxtk4fbm.js → chunk-8cpqy9ea.js} +1726 -1726
  40. package/dist/{chunk-97vj2cqz.js → chunk-8cs45k3f.js} +3 -3
  41. package/dist/chunk-8d788kvt.js +2 -0
  42. package/dist/{chunk-s040j1bv.js → chunk-8nr1kras.js} +6 -6
  43. package/dist/{chunk-912cj8pq.js → chunk-8txqk9nq.js} +2 -2
  44. package/dist/chunk-90qywh24.js +31 -0
  45. package/dist/{chunk-nda4xq79.js → chunk-9tcvkbb5.js} +2 -2
  46. package/dist/{chunk-vpmb8gcc.js → chunk-9ya4tdpz.js} +4 -4
  47. package/dist/{chunk-n1cqg89v.js → chunk-b76jbdtk.js} +2 -2
  48. package/dist/chunk-bdhtq3vs.js +2 -0
  49. package/dist/chunk-brnapchc.js +2 -0
  50. package/dist/chunk-c765y72x.js +18 -0
  51. package/dist/chunk-c78327kx.js +2 -0
  52. package/dist/chunk-cbyh8fhn.js +4 -0
  53. package/dist/chunk-d19w3e4x.js +2 -0
  54. package/dist/{chunk-jen9yg68.js → chunk-d1mqedk0.js} +7 -7
  55. package/dist/{chunk-6v1gwdbv.js → chunk-d4ybwtqt.js} +2 -2
  56. package/dist/chunk-da649d3k.js +2 -0
  57. package/dist/chunk-da9avgd9.js +2 -0
  58. package/dist/chunk-dkyjw3hc.js +3 -0
  59. package/dist/{chunk-ff61d2wr.js → chunk-dmf1jmge.js} +3 -3
  60. package/dist/chunk-e3njkecx.js +2 -0
  61. package/dist/chunk-efzc1nw8.js +2 -0
  62. package/dist/{chunk-h23bjqn1.js → chunk-ev3qnr9q.js} +31 -31
  63. package/dist/{chunk-y0pbnxjg.js → chunk-f46a7pvn.js} +2 -2
  64. package/dist/{chunk-azb58ven.js → chunk-ffxwsa94.js} +2 -2
  65. package/dist/chunk-fm4w1r9e.js +2 -0
  66. package/dist/{chunk-8jc86h7n.js → chunk-fpa1nq88.js} +2 -2
  67. package/dist/{chunk-tc2z8t2q.js → chunk-g1epk002.js} +5 -5
  68. package/dist/{chunk-8a4g0mex.js → chunk-g8tx0yf8.js} +7 -7
  69. package/dist/chunk-gan95hj0.js +2 -0
  70. package/dist/{chunk-e124cgb6.js → chunk-ghnkphy4.js} +2 -2
  71. package/dist/{chunk-m5fw8jq1.js → chunk-gjx5256r.js} +5 -5
  72. package/dist/chunk-hg7amzgz.js +2 -0
  73. package/dist/chunk-hmk7z0z6.js +2 -0
  74. package/dist/chunk-hn105xy3.js +2 -0
  75. package/dist/{chunk-8nwzd6eg.js → chunk-jbmhdyzz.js} +3 -3
  76. package/dist/chunk-jq079mrx.js +2 -0
  77. package/dist/chunk-jr149mmp.js +2 -0
  78. package/dist/{chunk-v79qs0qh.js → chunk-jra9r8fq.js} +1 -1
  79. package/dist/{chunk-zmq9hwta.js → chunk-k2dgwy05.js} +2 -2
  80. package/dist/chunk-k50k9zbw.js +2 -0
  81. package/dist/{chunk-xab6b4mt.js → chunk-kch9a9v1.js} +2 -2
  82. package/dist/chunk-kwxy0e3r.js +2 -0
  83. package/dist/chunk-kza3nxr0.js +2 -0
  84. package/dist/{chunk-g12j8ahm.js → chunk-m6m19hwd.js} +4 -4
  85. package/dist/{chunk-a5kaw8sc.js → chunk-m8qgr307.js} +8 -8
  86. package/dist/chunk-m9cmc6np.js +2 -0
  87. package/dist/chunk-m9r4x7e6.js +2 -0
  88. package/dist/chunk-mahv855w.js +2 -0
  89. package/dist/{chunk-27t55gtk.js → chunk-mb59b499.js} +6 -6
  90. package/dist/chunk-mbwdn96z.js +2 -0
  91. package/dist/chunk-mdxg95mq.js +2 -0
  92. package/dist/{chunk-2m91qmby.js → chunk-mm1vvk49.js} +5 -5
  93. package/dist/chunk-mqje968d.js +2 -0
  94. package/dist/{chunk-pp9jgyb6.js → chunk-mt8sew7a.js} +10 -10
  95. package/dist/{chunk-7gdvp6py.js → chunk-n1xcmhjw.js} +3 -3
  96. package/dist/chunk-n2g9mj2h.js +2 -0
  97. package/dist/chunk-n2nha538.js +2 -0
  98. package/dist/{chunk-f92hq39b.js → chunk-n6va14bt.js} +2 -2
  99. package/dist/chunk-nebw444s.js +2 -0
  100. package/dist/{chunk-gbx3gx8a.js → chunk-nm0y4qjg.js} +4 -4
  101. package/dist/chunk-nmt7kw0e.js +2 -0
  102. package/dist/chunk-pq8mz4ma.js +2 -0
  103. package/dist/chunk-pxcmv1xz.js +2 -0
  104. package/dist/chunk-pxes1ft6.js +2 -0
  105. package/dist/{chunk-v09hk0j6.js → chunk-pzasxhwz.js} +1 -1
  106. package/dist/{chunk-v2b8pa86.js → chunk-q94wdmdp.js} +3 -3
  107. package/dist/chunk-qajc13zq.js +2 -0
  108. package/dist/{chunk-1c4t7ncb.js → chunk-qj4j547f.js} +2 -2
  109. package/dist/chunk-qtnqmw1n.js +2 -0
  110. package/dist/chunk-r3zdgeah.js +2 -0
  111. package/dist/{chunk-4r7s3862.js → chunk-r47cs92n.js} +2 -2
  112. package/dist/chunk-r5htacg5.js +2 -0
  113. package/dist/chunk-rf2rwddd.js +2 -0
  114. package/dist/{chunk-1xgs9gd5.js → chunk-rgage0vm.js} +2 -2
  115. package/dist/{chunk-1zeqghsw.js → chunk-s1xxkzc9.js} +9 -9
  116. package/dist/chunk-s833fbvf.js +2 -0
  117. package/dist/{chunk-tqnh98j7.js → chunk-saf7kypg.js} +3 -3
  118. package/dist/chunk-sgvszh9s.js +2 -0
  119. package/dist/{chunk-emta09j6.js → chunk-ss78553t.js} +1 -1
  120. package/dist/chunk-t5r3s1wj.js +2 -0
  121. package/dist/{chunk-bqdsc6rm.js → chunk-tc01jkfc.js} +1 -1
  122. package/dist/{chunk-p2mxsjv1.js → chunk-tfeenp4h.js} +10 -10
  123. package/dist/chunk-tjprg6kq.js +2 -0
  124. package/dist/{chunk-hj67a88k.js → chunk-tsmbstj6.js} +7 -7
  125. package/dist/chunk-v0dzrwg8.js +2 -0
  126. package/dist/chunk-vtz9empe.js +2 -0
  127. package/dist/chunk-wa6nzq5b.js +2 -0
  128. package/dist/{chunk-3nc2fr4q.js → chunk-wm11csdm.js} +2 -2
  129. package/dist/{chunk-xj45mw7v.js → chunk-wsdn5fxe.js} +3 -3
  130. package/dist/{chunk-ah7h9q0x.js → chunk-wwn9dh6p.js} +2 -2
  131. package/dist/{chunk-yn3kp3qy.js → chunk-wy4hfmjs.js} +5 -5
  132. package/dist/{chunk-qfc912e5.js → chunk-xfpfs9zq.js} +2 -2
  133. package/dist/chunk-xw8kzm6b.js +2834 -0
  134. package/dist/chunk-xyhg70x9.js +63 -0
  135. package/dist/{chunk-w8q1xp9e.js → chunk-ymdy7b8z.js} +2 -2
  136. package/dist/chunk-ytdzgctp.js +2 -0
  137. package/dist/{chunk-wk85dz07.js → chunk-z06npyzn.js} +3 -3
  138. package/dist/chunk-z2n1rtj5.js +2 -0
  139. package/dist/cli.js +22 -22
  140. package/dist/craft-entry.js +2 -2
  141. package/dist/craft.js +2 -2
  142. package/dist/database.js +2 -2
  143. package/dist/native/components/primitives.d.ts +20 -4
  144. package/dist/native/index.d.ts +3 -0
  145. package/dist/native/primitives/Map.stx +2 -1
  146. package/dist/native/prop-names.js +3 -0
  147. package/dist/native/runtime/craft-bridge.js +24 -11
  148. package/dist/native/runtime/craft.d.ts +6 -5
  149. package/dist/pwa.js +3 -3
  150. package/dist/ssg.js +11 -11
  151. package/dist/stx.d.ts +1 -1028
  152. package/dist/variable-extractor.js +2 -2
  153. package/package.json +5 -5
  154. package/stx.d.ts +2 -0
  155. package/dist/chunk-00dp53cx.js +0 -2
  156. package/dist/chunk-0pvn63x7.js +0 -2
  157. package/dist/chunk-0vpmdhfm.js +0 -2
  158. package/dist/chunk-10jwyvm0.js +0 -2
  159. package/dist/chunk-1ena03xn.js +0 -2
  160. package/dist/chunk-2bpj2dsh.js +0 -2
  161. package/dist/chunk-31ez1sq0.js +0 -2
  162. package/dist/chunk-3m2h76cz.js +0 -2
  163. package/dist/chunk-3n26hf93.js +0 -2
  164. package/dist/chunk-3nk8cnrm.js +0 -3
  165. package/dist/chunk-3tccqahy.js +0 -2
  166. package/dist/chunk-40fqmb3q.js +0 -2
  167. package/dist/chunk-45tq56qf.js +0 -2
  168. package/dist/chunk-46wykvrs.js +0 -2
  169. package/dist/chunk-4cmqjmqr.js +0 -3
  170. package/dist/chunk-56mkcxvb.js +0 -2
  171. package/dist/chunk-56wcmck6.js +0 -2
  172. package/dist/chunk-5eyf2zeg.js +0 -2
  173. package/dist/chunk-68ph8r20.js +0 -2
  174. package/dist/chunk-6bcvd3pg.js +0 -2
  175. package/dist/chunk-6n8jzdnm.js +0 -18
  176. package/dist/chunk-6va8wt88.js +0 -2
  177. package/dist/chunk-7acxdp9r.js +0 -2
  178. package/dist/chunk-7h324n17.js +0 -2
  179. package/dist/chunk-8fpz04kx.js +0 -2
  180. package/dist/chunk-8fwczr4s.js +0 -63
  181. package/dist/chunk-9skdekv5.js +0 -2
  182. package/dist/chunk-c3v5zmnq.js +0 -2
  183. package/dist/chunk-ce7zwt4v.js +0 -2
  184. package/dist/chunk-cp4dr9ch.js +0 -2
  185. package/dist/chunk-d7mfkc61.js +0 -2
  186. package/dist/chunk-d8fhthyf.js +0 -2
  187. package/dist/chunk-dekpf1ry.js +0 -2
  188. package/dist/chunk-dyavx9a1.js +0 -2
  189. package/dist/chunk-dz7v901d.js +0 -2
  190. package/dist/chunk-e099d50m.js +0 -2
  191. package/dist/chunk-e473tm1d.js +0 -2
  192. package/dist/chunk-eeadhr78.js +0 -2
  193. package/dist/chunk-evwj0k99.js +0 -2834
  194. package/dist/chunk-f11sx09b.js +0 -3
  195. package/dist/chunk-fdkyvr7y.js +0 -2
  196. package/dist/chunk-fqge0zn8.js +0 -2
  197. package/dist/chunk-fz7dxc1q.js +0 -2
  198. package/dist/chunk-hp8g2q2n.js +0 -2
  199. package/dist/chunk-hpeg9erh.js +0 -3
  200. package/dist/chunk-hv2kxb94.js +0 -2
  201. package/dist/chunk-j9c0yam7.js +0 -2
  202. package/dist/chunk-k9nd7z8j.js +0 -2
  203. package/dist/chunk-m7jmpech.js +0 -2
  204. package/dist/chunk-m7ktr4xn.js +0 -2
  205. package/dist/chunk-mjdyyekx.js +0 -4
  206. package/dist/chunk-njrakvz7.js +0 -2
  207. package/dist/chunk-nr5jf1hp.js +0 -2
  208. package/dist/chunk-qd7bqhm3.js +0 -2
  209. package/dist/chunk-qprkb5qe.js +0 -2
  210. package/dist/chunk-schxd5k5.js +0 -2
  211. package/dist/chunk-sn5c0x7q.js +0 -2
  212. package/dist/chunk-sx4wmprc.js +0 -2
  213. package/dist/chunk-t94z65ry.js +0 -2
  214. package/dist/chunk-vakryadj.js +0 -2
  215. package/dist/chunk-vgge9rf4.js +0 -2
  216. package/dist/chunk-w36w5jgs.js +0 -30
  217. package/dist/chunk-wzymzex7.js +0 -2
  218. package/dist/chunk-x07x8hzs.js +0 -2
  219. package/dist/chunk-z9q5p39g.js +0 -2
  220. package/dist/chunk-zfypzka2.js +0 -2
  221. package/dist/chunk-zh0jbzvk.js +0 -2
  222. package/dist/chunk-zpf9he2x.js +0 -2
  223. package/dist/chunk-zpftj8s8.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{b,d,n,g,R}from"./chunk-evwj0k99.js";import q from"path";var M={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},C=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var O=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function z(e){let t=[],o=0,s;O.lastIndex=0;while((s=O.exec(e))!==null){if(s.index>o){let a=e.slice(o,s.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let r=s[1],i=s[2];t.push({type:"suspense",name:r,content:i}),o=s.index+s[0].length}if(o<e.length){let r=e.slice(o);if(r.trim())t.push({type:t.length===0?"shell":"content",content:r})}if(t.length===0)t.push({type:"shell",content:e});return t}async function fd(e,t={},o={}){let s={...R,...o,streaming:{...M,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:q.dirname(e)};if(m.trim())await d(m,y,e);let T=z(c),u=new Set;if(!T.some((h)=>h.type==="suspense")){let h=s.streaming?.strategy||"auto",S=new RegExp(C.source,"g");if(!(h!=="manual"&&S.test(c))){let p=await n(c,y,e,s,u);for(let x=0;x<p.length;x+=r)i.enqueue(p.slice(x,x+r)),await new Promise((f)=>setTimeout(f,0))}else{let p=[],x=new RegExp(C.source,"g"),f;while((f=x.exec(c))!==null)p.push({name:f[1],content:f[2],start:f.index,end:f.index+f[0].length});let E=0;for(let _ of p){if(_.start>E){let k=c.slice(E,_.start);if(k.trim()){let D=await n(k,y,e,s,u);i.enqueue(D),await new Promise((H)=>setTimeout(H,0))}}let I=await n(_.content,y,e,s,u);i.enqueue(I),await new Promise((k)=>setTimeout(k,0)),E=_.end}if(E<c.length){let _=c.slice(E);if(_.trim()){let I=await n(_,y,e,s,u);i.enqueue(I)}}}}else{let h=new Map;for(let l of T)if(l.type==="shell"||l.type==="content"){let p=await n(l.content,y,e,s,u);i.enqueue(p)}else if(l.type==="suspense"&&l.name){let p=`stx-suspense-${l.name}`;i.enqueue(`<div id="${p}" data-suspense="${l.name}" style="display:contents;">
2
+ import{b,d,n,g,R}from"./chunk-xw8kzm6b.js";import q from"path";var M={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},C=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var O=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function z(e){let t=[],o=0,s;O.lastIndex=0;while((s=O.exec(e))!==null){if(s.index>o){let a=e.slice(o,s.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let r=s[1],i=s[2];t.push({type:"suspense",name:r,content:i}),o=s.index+s[0].length}if(o<e.length){let r=e.slice(o);if(r.trim())t.push({type:t.length===0?"shell":"content",content:r})}if(t.length===0)t.push({type:"shell",content:e});return t}async function gd(e,t={},o={}){let s={...R,...o,streaming:{...M,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:q.dirname(e)};if(m.trim())await d(m,y,e);let T=z(c),u=new Set;if(!T.some((h)=>h.type==="suspense")){let h=s.streaming?.strategy||"auto",S=new RegExp(C.source,"g");if(!(h!=="manual"&&S.test(c))){let p=await n(c,y,e,s,u);for(let x=0;x<p.length;x+=r)i.enqueue(p.slice(x,x+r)),await new Promise((f)=>setTimeout(f,0))}else{let p=[],x=new RegExp(C.source,"g"),f;while((f=x.exec(c))!==null)p.push({name:f[1],content:f[2],start:f.index,end:f.index+f[0].length});let E=0;for(let _ of p){if(_.start>E){let k=c.slice(E,_.start);if(k.trim()){let D=await n(k,y,e,s,u);i.enqueue(D),await new Promise((H)=>setTimeout(H,0))}}let I=await n(_.content,y,e,s,u);i.enqueue(I),await new Promise((k)=>setTimeout(k,0)),E=_.end}if(E<c.length){let _=c.slice(E);if(_.trim()){let I=await n(_,y,e,s,u);i.enqueue(I)}}}}else{let h=new Map;for(let l of T)if(l.type==="shell"||l.type==="content"){let p=await n(l.content,y,e,s,u);i.enqueue(p)}else if(l.type==="suspense"&&l.name){let p=`stx-suspense-${l.name}`;i.enqueue(`<div id="${p}" data-suspense="${l.name}" style="display:contents;">
3
3
  <template data-suspense-fallback>Loading...</template>
4
4
  </div>`),h.set(l.name,n(l.content,y,e,s,u))}i.enqueue(`
5
5
  <script>
@@ -17,13 +17,13 @@ import{b,d,n,g,R}from"./chunk-evwj0k99.js";import q from"path";var M={enabled:!0
17
17
  }
18
18
  };
19
19
  })();
20
- </script>`);let S=Array.from(h.entries()).map(async([l,p])=>{i.enqueue(await Co(l,p))});await Promise.all(S)}i.close()}catch(a){i.error(a)}}})}async function Co(e,t){try{let s=(await t).replace(/`/g,"\\`").replace(/<\/script>/gi,"<\\/script>");return`
20
+ </script>`);let S=Array.from(h.entries()).map(async([l,p])=>{i.enqueue(await Eo(l,p))});await Promise.all(S)}i.close()}catch(a){i.error(a)}}})}async function Eo(e,t){try{let s=(await t).replace(/`/g,"\\`").replace(/<\/script>/gi,"<\\/script>");return`
21
21
  <script>
22
22
  window.__stxSuspense.resolve('${e}', \`${s}\`);
23
23
  </script>`}catch(o){let s=o instanceof Error?o.message:String(o);return`
24
24
  <script>
25
25
  window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading content: ${b(s)}</div>');
26
- </script>`}}var Ha=`
26
+ </script>`}}var Ua=`
27
27
  <script>
28
28
  (function(){
29
29
  window.__stxSuspense = window.__stxSuspense || {
@@ -43,12 +43,12 @@ window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading conte
43
43
  }
44
44
  };
45
45
  })();
46
- </script>`;function A(e,t,o){if(!t||t<=0)return e;let s,r=new Promise((i,a)=>{s=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,r]).finally(()=>clearTimeout(s))}function gd(e,t=[],o={}){let s=o.timeoutMs??0;return new ReadableStream({async start(r){try{if(r.enqueue(e),t.length>0)r.enqueue(Ha),await Promise.all(t.map(async(i)=>{let a=A(i.render(),s,i.id);r.enqueue(await Co(i.id,a))}));r.close()}catch(i){r.error(i)}}})}var B=/@stream\s*\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)@endstream/gi;function md(e,t){return e.replace(B,(o,s,r)=>{let i=s.trim(),a=r.split(/@fallback/i),w=a[0].trim(),m=a.length>1?a.slice(1).join("@fallback").trim():"";if(!t.__streamTemplates)t.__streamTemplates={};return t.__streamTemplates[i]=w,`<div data-suspense="${i}">${m}</div>`})}function hd(e){let t=e?.streamBoundaries;if(!t||typeof t!=="object")return;let o=Object.entries(t).filter(([,s])=>typeof s==="function");return o.length>0?o.map(([s,r])=>({id:s,render:r})):void 0}async function yd(e,t={},o={}){let s={...R,...o,streaming:{...M,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:q.dirname(e)};if(m.trim())await d(m,y,e);let T=new Set,u=s.streaming?.strategy||"auto",v=new RegExp(C.source,"g");if(!(u!=="manual"&&v.test(c))){let S=await n(c,y,e,s,T);for(let l=0;l<S.length;l+=r)i.enqueue(S.slice(l,l+r))}else{let S=[],l=new RegExp(C.source,"g"),p;while((p=l.exec(c))!==null)S.push({name:p[1],content:p[2],start:p.index,end:p.index+p[0].length});let x=0;for(let f of S){if(f.start>x){let _=c.slice(x,f.start);if(_.trim()){let I=await n(_,y,e,s,T);i.enqueue(I)}}let E=await n(f.content,y,e,s,T);i.enqueue(E),x=f.end}if(x<c.length){let f=c.slice(x);if(f.trim()){let E=await n(f,y,e,s,T);i.enqueue(E)}}}i.close()}catch(a){i.error(a)}}})}async function bd(e,t={}){let o={...R,...t,streaming:{...M,...t.streaming}},s=await Bun.file(e).text(),r=s.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),i=r?r[1]:"",a=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),w=a,m={},c;C.lastIndex=0;while((c=C.exec(a))!==null){let u=c[1],v=c[2];m[u]=v}let y=a.replace(C,"");return{renderShell:async(u={})=>{let v={...u,__filename:e,__dirname:q.dirname(e)};return await d(i,v,e),n(y,v,e,o,new Set)},renderSection:async(u,v={})=>{try{if(!m[u])return`<div class="error-message">Section "${b(u)}" not found in template "${b(e)}"</div>`;let h={...v,__filename:e,__dirname:q.dirname(e)};await d(i,h,e);let S=new Set;return await n(m[u],h,e,o,S)}catch(h){let S=h instanceof Error?h.message:String(h);return g("Expression",S,e,m[u]||"",0,m[u]||"")}},getSections:()=>Object.keys(m),getTemplate:()=>w}}var Ua={name:"suspense",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Suspense directive requires a name parameter");let r=t[0].replace(/['"`]/g,"");return`<!-- @suspense:${r} -->${e}<!-- @endsuspense:${r} -->`}},Va={name:"island",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Island directive requires a name parameter");let r=t[0].replace(/['"`]/g,""),i=t[1]?t[1].replace(/['"`]/g,""):"lazy",a=`island-${r}-${Math.random().toString(36).substring(2,9)}`,w=e.match(/<script\s+props\s*>([\s\S]*?)<\/script>/i),m=w?w[1].trim():"",c=w?e.replace(w[0],""):e;return`<div data-island="${r}" data-island-id="${a}" data-priority="${i}">
46
+ </script>`;function A(e,t,o){if(!t||t<=0)return e;let s,r=new Promise((i,a)=>{s=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,r]).finally(()=>clearTimeout(s))}function md(e,t=[],o={}){let s=o.timeoutMs??0;return new ReadableStream({async start(r){try{if(r.enqueue(e),t.length>0)r.enqueue(Ua),await Promise.all(t.map(async(i)=>{let a=A(i.render(),s,i.id);r.enqueue(await Eo(i.id,a))}));r.close()}catch(i){r.error(i)}}})}var B=/@stream\s*\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)@endstream/gi;function hd(e,t){return e.replace(B,(o,s,r)=>{let i=s.trim(),a=r.split(/@fallback/i),w=a[0].trim(),m=a.length>1?a.slice(1).join("@fallback").trim():"";if(!t.__streamTemplates)t.__streamTemplates={};return t.__streamTemplates[i]=w,`<div data-suspense="${i}">${m}</div>`})}function yd(e){let t=e?.streamBoundaries;if(!t||typeof t!=="object")return;let o=Object.entries(t).filter(([,s])=>typeof s==="function");return o.length>0?o.map(([s,r])=>({id:s,render:r})):void 0}async function bd(e,t={},o={}){let s={...R,...o,streaming:{...M,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:q.dirname(e)};if(m.trim())await d(m,y,e);let T=new Set,u=s.streaming?.strategy||"auto",v=new RegExp(C.source,"g");if(!(u!=="manual"&&v.test(c))){let S=await n(c,y,e,s,T);for(let l=0;l<S.length;l+=r)i.enqueue(S.slice(l,l+r))}else{let S=[],l=new RegExp(C.source,"g"),p;while((p=l.exec(c))!==null)S.push({name:p[1],content:p[2],start:p.index,end:p.index+p[0].length});let x=0;for(let f of S){if(f.start>x){let _=c.slice(x,f.start);if(_.trim()){let I=await n(_,y,e,s,T);i.enqueue(I)}}let E=await n(f.content,y,e,s,T);i.enqueue(E),x=f.end}if(x<c.length){let f=c.slice(x);if(f.trim()){let E=await n(f,y,e,s,T);i.enqueue(E)}}}i.close()}catch(a){i.error(a)}}})}async function wd(e,t={}){let o={...R,...t,streaming:{...M,...t.streaming}},s=await Bun.file(e).text(),r=s.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),i=r?r[1]:"",a=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),w=a,m={},c;C.lastIndex=0;while((c=C.exec(a))!==null){let u=c[1],v=c[2];m[u]=v}let y=a.replace(C,"");return{renderShell:async(u={})=>{let v={...u,__filename:e,__dirname:q.dirname(e)};return await d(i,v,e),n(y,v,e,o,new Set)},renderSection:async(u,v={})=>{try{if(!m[u])return`<div class="error-message">Section "${b(u)}" not found in template "${b(e)}"</div>`;let h={...v,__filename:e,__dirname:q.dirname(e)};await d(i,h,e);let S=new Set;return await n(m[u],h,e,o,S)}catch(h){let S=h instanceof Error?h.message:String(h);return g("Expression",S,e,m[u]||"",0,m[u]||"")}},getSections:()=>Object.keys(m),getTemplate:()=>w}}var Va={name:"suspense",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Suspense directive requires a name parameter");let r=t[0].replace(/['"`]/g,"");return`<!-- @suspense:${r} -->${e}<!-- @endsuspense:${r} -->`}},Wa={name:"island",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Island directive requires a name parameter");let r=t[0].replace(/['"`]/g,""),i=t[1]?t[1].replace(/['"`]/g,""):"lazy",a=`island-${r}-${Math.random().toString(36).substring(2,9)}`,w=e.match(/<script\s+props\s*>([\s\S]*?)<\/script>/i),m=w?w[1].trim():"",c=w?e.replace(w[0],""):e;return`<div data-island="${r}" data-island-id="${a}" data-priority="${i}">
47
47
  ${c}
48
48
  <script type="application/json" data-island-props="${a}">
49
49
  ${m?`{${m}}`:"{}"}
50
50
  </script>
51
- </div>`}};function wd(e={}){let t=[];if(e.streaming?.enabled)t.push(Ua);if(e.hydration?.enabled)t.push(Va);return t}async function vd(e,t,o,s={}){return e}function xd(e,t={}){let o=new TextEncoder,s=e.pipeThrough(new TransformStream({transform(i,a){a.enqueue(o.encode(i))}})),r=new Headers(t.headers);if(!r.has("Content-Type"))r.set("Content-Type","text/html; charset=utf-8");if(!r.has("Transfer-Encoding"))r.set("Transfer-Encoding","chunked");if(!r.has("X-Content-Type-Options"))r.set("X-Content-Type-Options","nosniff");if(!r.has("X-Accel-Buffering"))r.set("X-Accel-Buffering","no");return new Response(s,{...t,headers:r})}function Sd(e={mode:"full"}){let{mode:t,components:o={},dynamicImports:s=!0}=e,r=Object.entries(o).map(([i,a])=>`'${i}': ${s?`() => import('${a}')`:`require('${a}')`}`).join(`,
51
+ </div>`}};function vd(e={}){let t=[];if(e.streaming?.enabled)t.push(Va);if(e.hydration?.enabled)t.push(Wa);return t}async function xd(e,t,o,s={}){return e}function Sd(e,t={}){let o=new TextEncoder,s=e.pipeThrough(new TransformStream({transform(i,a){a.enqueue(o.encode(i))}})),r=new Headers(t.headers);if(!r.has("Content-Type"))r.set("Content-Type","text/html; charset=utf-8");if(!r.has("Transfer-Encoding"))r.set("Transfer-Encoding","chunked");if(!r.has("X-Content-Type-Options"))r.set("X-Content-Type-Options","nosniff");if(!r.has("X-Accel-Buffering"))r.set("X-Accel-Buffering","no");return new Response(s,{...t,headers:r})}function kd(e={mode:"full"}){let{mode:t,components:o={},dynamicImports:s=!0}=e,r=Object.entries(o).map(([i,a])=>`'${i}': ${s?`() => import('${a}')`:`require('${a}')`}`).join(`,
52
52
  `);if(t==="loader")return`
53
53
  (function() {
54
54
  window.__stx = window.__stx || {};
@@ -191,4 +191,4 @@ else {
191
191
  stx.hydrate();
192
192
  }
193
193
  })();`}
194
- export{fd,Co,Ha,gd,md,hd,yd,bd,Ua,Va,wd,vd,xd,Sd};
194
+ export{gd,Eo,Ua,md,hd,yd,bd,wd,Va,Wa,vd,xd,Sd,kd};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Yl,Zl,Ql,ed,td}from"./chunk-wy4hfmjs.js";export{Zl as createSSRSuspense,ed as generateSuspenseCSS,td as generateSuspenseRuntime,Yl as processSuspenseDirectives,Ql as renderSSRSuspense};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{fl,gl,ml,hl,da,yl,bl,wl,vl,xl,Sl,kl}from"./chunk-6vnnx536.js";export{Sl as Broadcast,kl as BroadcastServer,da as broadcast,vl as broadcastPresence,wl as broadcastPrivate,xl as channel,fl as getBroadcastServer,hl as loadChannels,gl as startBroadcasting,ml as stopBroadcasting,yl as toUser,bl as toUsers};
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import{nn,ce}from"./chunk-azb58ven.js";import{m,rn,w,je,o,A}from"./chunk-evwj0k99.js";import{Yr}from"./chunk-2tm3vzm7.js";import{s,ve}from"./chunk-7wfh2hqy.js";import{a}from"./chunk-4cmqjmqr.js";import h from"path";import v from"fs";var pe=10;function V(e,n,i){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(h.basename(e))||Yr(e,n,i)}var ne=1,re=new Map,W=600,fe=100,P=new Map;async function me(e){let n=P.get(e)??0;if(n>0&&n<fe){P.set(e,n+1);return}P.set(e,1);try{let i=(await v.promises.readdir(e)).filter((u)=>u.endsWith(".js"));if(i.length<=W)return;let g=(await Promise.all(i.map(async(u)=>{try{return{name:u,at:(await v.promises.stat(h.join(e,u))).mtimeMs}}catch{return null}}))).filter((u)=>u!==null);g.sort((u,l)=>l.at-u.at);for(let u of g.slice(W)){let l=u.name.slice(0,-3);await v.promises.rm(h.join(e,`${l}.js`),{force:!0}),await v.promises.rm(h.join(e,`${l}.deps.json`),{force:!0})}I("pruned bundle cache to",W,"entries")}catch{}}function ae(e){return re.get(e)??[]}function X(e,n){if(e)re.set(e,n)}function Ya(e=process.env){return e.STX_DEBUG==="true"||e.STX_DEBUG==="1"}function I(...e){if(Ya())console.log("[stx:bundler]",...e)}var Z=[];function Uo(e,n,i){Z.push({filePath:e||"<inline>",message:n,details:i})}function yt(){return Z.slice()}function bt(){Z.length=0}var q;function Pd(e){q=e}function Vo(){if(q)return q;try{let e=A.strict;return typeof e==="object"&&e!==null?e.bundlerFallback??"warn":"warn"}catch{return"warn"}}var H=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function wt(e){let n=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,i;while((i=n.exec(e))!==null){let g=i[1];if(!H.some((l)=>l.test(g)))return I("detected user import:",g),!0}let c=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((i=c.exec(e))!==null){let g=i[1];if(/\.css(?:\?.*)?$/.test(g))continue;if(!H.some((l)=>l.test(g)))return I("detected side-effect import:",g),!0}return!1}var tn="stx-module:",ge=/\.(?:[cm]?[jt]sx?|json)$/i;function Za(e,n){return h.relative(e,n).split(h.sep).join("/")}function Qa(e,n){if(n.size===0)return e;return e.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(i,c,g,u)=>{let l=n.get(u);return l&&!u.startsWith(tn)?`${c}${g}${l}${g}`:i})}function ec(e,n){let i=0,c=(u)=>{let l=`__stxMod${i++}`,S=JSON.stringify(u);return n.push(`var ${l} = globalThis.__stxModules && globalThis.__stxModules[${S}];`,`if (${l} === undefined) throw new Error("[stx] module " + ${JSON.stringify(S)} + " is not registered on this page (#1957)");`),l},g=(u,l)=>{for(let S of u.split(",")){let M=S.trim();if(!M)continue;let f=M.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!f)continue;let t=f[1].startsWith('"')?JSON.parse(f[1]):f[1],r=f[2]??t;n.push(`var ${r} = ${l}[${JSON.stringify(t)}];`)}};return e=e.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(u,l,S)=>{let M=S.slice(tn.length),f=c(M),t=l.trim(),r=t.match(/^([\w$]+)\s*(?:,\s*|$)/);if(r&&!t.startsWith("{")&&!t.startsWith("*"))n.push(`var ${r[1]} = ${f}.default;`),t=t.slice(r[0].length).trim();let d=t.match(/^\*\s*as\s+([\w$]+)$/);if(d)n.push(`var ${d[1]} = ${f};`);else if(t.startsWith("{"))g(t.replace(/^\{|\}$/g,""),f);return""}),e=e.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(u,l)=>(c(l.slice(tn.length)),"")),e}function ee(e){let n=[e,`${e}.ts`,`${e}.tsx`,`${e}.js`,`${e}.mjs`,`${e}.jsx`,h.join(e,"index.ts"),h.join(e,"index.tsx"),h.join(e,"index.js"),h.join(e,"index.mjs")];for(let i of n)try{if(v.existsSync(i)&&v.statSync(i,{throwIfNoEntry:!1})?.isFile())return i}catch{}return}function he(e,n,i,c,g,u=new Map,l){let S=(f,t,r)=>{if(V(t,e,l))return null;if(!g||f!==i||!ge.test(t))return null;try{if(!v.statSync(t,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}c.add(t);let d=`${tn}${Za(process.cwd(),t)}`;return u.set(r,d),{path:d,external:!0}},M=(f,t)=>{let r=f===i?n:h.dirname(f),d=h.resolve(r,t);return ee(d)??d};return{name:"stx-client-bundle",setup(f){if(f.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(t)=>({path:t.path,external:!0})),f.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(t)=>({path:t.path,external:!0})),f.onResolve({filter:/^\//},(t)=>{let r=ee(t.path);if(r){let d=S(t.importer,r,t.path);if(d)return d;if(r!==i)c.add(r);return{path:r}}return{path:t.path,external:!0}}),f.onResolve({filter:/^\.\.?\//},(t)=>{let r=M(t.importer,t.path),d=S(t.importer,r,t.path);if(d)return d;return c.add(r),{path:r}}),f.onResolve({filter:/^[@~]\//},(t)=>{let r=h.resolve(e,t.path.slice(2)),d=[r,`${r}.ts`,`${r}.tsx`,`${r}.js`,`${r}.mjs`,`${r}.jsx`,h.join(r,"index.ts"),h.join(r,"index.tsx"),h.join(r,"index.js"),h.join(r,"index.mjs")];for(let E of d)if(v.existsSync(E)&&v.statSync(E,{throwIfNoEntry:!1})?.isFile()){let C=S(t.importer,E,t.path);if(C)return C;return I(`resolved ${t.path[0]}/ import:`,t.path,"\u2192",E),c.add(E),{path:E}}return console.warn(`[stx:bundler] could not resolve ${t.path[0]}/ import:`,t.path),{path:r}}),g)f.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(t)=>{if(t.importer!==i)return;let r=`${tn}npm:${t.path}`;return u.set(t.path,r),{path:r,external:!0}});f.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(t)=>{if(V(t.path,e,l))throw Error(`Server-only API source cannot be imported by a client script: ${t.path}`);let r=h.extname(t.path).toLowerCase(),d=r===".json"?"json":r===".tsx"?"tsx":r===".jsx"?"jsx":r===".ts"||r===".mts"||r===".cts"?"ts":"js";if(t.path!==i)c.add(t.path);return{contents:v.readFileSync(t.path,"utf8"),loader:d}})}}}var G=new Map,L=m(64),te=Symbol.for("stx.client-bundle-build-queue");function tc(e){let n=globalThis,c=(n[te]??Promise.resolve()).then(e,e);return n[te]=c.then(()=>{return},()=>{return}),c}async function vt(e,n,i={}){let c=i.projectRoot||process.cwd(),g=(await o(c)).serverApi,u=i.minify??!1,l=i.externalizeUserModules??!0,S=i.expose?.length?[...new Set(i.expose)].sort():void 0,M=i.cacheDir||a(c,"bundle-cache"),f=new Bun.CryptoHasher("md5");f.update(`${pe}\x00${je()}\x00${JSON.stringify(g??!1)}\x00${l?"registry":"inline"}\x00${S?S.join(","):"*"}\x00${e}\x00${n}`);let t=f.digest("hex").slice(0,12),r=h.join(M,`${t}.js`),d=L.get(r);if(d){if(rn(d.files)&&d.files.every((N)=>!V(N.path,c,g))){I("memo hit:",t);let N=d.files.map((B)=>B.path);return X(n,N),i.collectInputs?.push(...N),d.code}L.delete(r),I("memo invalidated by dep change:",t)}let E=h.join(M,`${t}.deps.json`),C=Bun.file(r);if(await C.exists()){let N=Bun.file(E),B=!1,R=null;if(await N.exists())try{let O=JSON.parse(await N.text());if(O.metadataVersion!==ne||!Array.isArray(O.files))B=!1;else R=O.files,B=!0;if(R&&(!rn(R)||R.some((D)=>V(D.path,c,g))))B=!1}catch{B=!1}if(B){if(I("cache hit:",t),R)X(n,R.map((D)=>D.path)),i.collectInputs?.push(...R.map((D)=>D.path));let O=await C.text();if(R)L.set(r,{code:O,files:R});return O}I("cache invalidated by dep change:",t)}let _=G.get(t);if(_){let N=await _;if(i.collectInputs)i.collectInputs.push(...(L.get(r)?.files??[]).map((B)=>B.path));return N}let z=tc(()=>$e(e,n,{projectRoot:c,minify:u,cacheDir:M,hash:t,cachePath:r,depsPath:E,collectInputs:i.collectInputs,externalizeUserModules:l,serverApi:g,expose:S,throwOnFailure:i.throwOnFailure}));G.set(t,z);try{return await z}finally{G.delete(t)}}var xe=0;function nc(e){return`${e}-${process.pid}-${++xe}`}async function $e(e,n,i){let{projectRoot:c,minify:g,cacheDir:u,hash:l,cachePath:S,depsPath:M,externalizeUserModules:f}=i,t=a(c,"bundle-tmp"),r=nc(l),d=h.join(t,`${r}.ts`),E=h.join(t,"out",r);v.mkdirSync(t,{recursive:!0}),v.mkdirSync(E,{recursive:!0});let C=h.dirname(n),_=new Set,z=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,N=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,B=s(e),{depths:R,balanced:O}=ve(B),D=(j)=>!O||R[j]===0,y;while((y=z.exec(B))!==null){if(y[1])continue;if(!D(y.index))continue;if(y[2])y[2].split(",").forEach((j)=>{let p=we(j);if(p)_.add(p)});else if(y[3])_.add(y[3])}while((y=N.exec(B))!==null){if(y[1])continue;if(!D(y.index))continue;_.add(y[2])}let se=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((y=se.exec(B))!==null){if(!D(y.index))continue;let j=/^\s*['"]([^'"]+)['"]/.exec(e.slice(y.index+y[0].length))?.[1];if(j&&H.some((p)=>p.test(j)))continue;if(y[1])_.add(y[1]);if(y[2])_.add(y[2]);for(let p of(y[3]??"").split(",")){let b=p.trim();if(!b||/^type\s/.test(b))continue;let U=/\bas\s+(\w+)\s*$/.exec(b)?.[1]??/^\w+$/.exec(b)?.[0];if(U)_.add(U)}}for(let j of B.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let p of j[1].split(",")){let b=/\bas\s+(\w+)\s*$/.exec(p)?.[1]??/^\s*(\w+)\s*$/.exec(p)?.[1];if(b)_.delete(b)}let ie=_.size>0?`
3
- export { ${[..._].join(", ")} }`:"";await Bun.write(d,e+ie),I("bundling:",l,"from:",h.basename(n));let Y=new Set,Q=new Map;try{let j=await Bun.build({entrypoints:[d],outdir:E,target:"browser",format:"esm",minify:g?{whitespace:!1,identifiers:!0,syntax:!0}:!1,plugins:[he(c,C,d,Y,f,Q,i.serverApi)],define:{"process.env.NODE_ENV":g?'"production"':'"development"',...w()},root:c});if(!j.success){let F=j.logs.filter((T)=>T.level==="error").map((T)=>T.message).join(", ")||`Unable to bundle ${h.basename(n)}`,k=nn(j.logs,n||void 0);if(console.warn("[stx:bundler] build failed:",F),Uo(n||"",F,k),i.throwOnFailure||Vo()==="error")throw Error(F);return e}let p="";for(let x of j.outputs){p=await x.text();break}let b=[];for(let x of p.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let F of x[1].split(",")){let k=F.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(k){b.push([k[2],k[1]]);continue}let T=F.trim();if(/^[A-Za-z_$][\w$]*$/.test(T))b.push([T,T])}if(i.expose){let x=new Set(i.expose);for(let F=b.length-1;F>=0;F--)if(!x.has(b[F][0]))b.splice(F,1)}let U=[];p=ec(Qa(p,Q),U);let oe=p.match(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm)||[];if(p=p.replace(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),g&&p)try{p=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(p)}catch{}let K=`__stxBundle_${l}`,le=b.map(([x,F])=>`${JSON.stringify(x)}: ${F}`).join(", "),ue=b.map(([x])=>`var ${x} = undefined;`).join(`
2
+ import{rn,le}from"./chunk-ffxwsa94.js";import{m,sn,w,Be,o,A}from"./chunk-xw8kzm6b.js";import{Zr}from"./chunk-01s01ten.js";import{s,xe}from"./chunk-5s555c1r.js";import{a}from"./chunk-203rr1c8.js";import h from"path";import v from"fs";var pe=10;function V(e,n,i){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(h.basename(e))||Zr(e,n,i)}var ne=1,re=new Map,W=600,fe=100,P=new Map;async function me(e){let n=P.get(e)??0;if(n>0&&n<fe){P.set(e,n+1);return}P.set(e,1);try{let i=(await v.promises.readdir(e)).filter((u)=>u.endsWith(".js"));if(i.length<=W)return;let g=(await Promise.all(i.map(async(u)=>{try{return{name:u,at:(await v.promises.stat(h.join(e,u))).mtimeMs}}catch{return null}}))).filter((u)=>u!==null);g.sort((u,l)=>l.at-u.at);for(let u of g.slice(W)){let l=u.name.slice(0,-3);await v.promises.rm(h.join(e,`${l}.js`),{force:!0}),await v.promises.rm(h.join(e,`${l}.deps.json`),{force:!0})}I("pruned bundle cache to",W,"entries")}catch{}}function ce(e){return re.get(e)??[]}function X(e,n){if(e)re.set(e,n)}function Za(e=process.env){return e.STX_DEBUG==="true"||e.STX_DEBUG==="1"}function I(...e){if(Za())console.log("[stx:bundler]",...e)}var Z=[];function Vo(e,n,i){Z.push({filePath:e||"<inline>",message:n,details:i})}function bt(){return Z.slice()}function wt(){Z.length=0}var q;function Id(e){q=e}function Wo(){if(q)return q;try{let e=A.strict;return typeof e==="object"&&e!==null?e.bundlerFallback??"warn":"warn"}catch{return"warn"}}var H=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function vt(e){let n=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,i;while((i=n.exec(e))!==null){let g=i[1];if(!H.some((l)=>l.test(g)))return I("detected user import:",g),!0}let c=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((i=c.exec(e))!==null){let g=i[1];if(/\.css(?:\?.*)?$/.test(g))continue;if(!H.some((l)=>l.test(g)))return I("detected side-effect import:",g),!0}return!1}var nn="stx-module:",ge=/\.(?:[cm]?[jt]sx?|json)$/i;function Qa(e,n){return h.relative(e,n).split(h.sep).join("/")}function ec(e,n){if(n.size===0)return e;return e.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(i,c,g,u)=>{let l=n.get(u);return l&&!u.startsWith(nn)?`${c}${g}${l}${g}`:i})}function tc(e,n){let i=0,c=(u)=>{let l=`__stxMod${i++}`,S=JSON.stringify(u);return n.push(`var ${l} = globalThis.__stxModules && globalThis.__stxModules[${S}];`,`if (${l} === undefined) throw new Error("[stx] module " + ${JSON.stringify(S)} + " is not registered on this page (#1957)");`),l},g=(u,l)=>{for(let S of u.split(",")){let M=S.trim();if(!M)continue;let f=M.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!f)continue;let t=f[1].startsWith('"')?JSON.parse(f[1]):f[1],r=f[2]??t;n.push(`var ${r} = ${l}[${JSON.stringify(t)}];`)}};return e=e.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(u,l,S)=>{let M=S.slice(nn.length),f=c(M),t=l.trim(),r=t.match(/^([\w$]+)\s*(?:,\s*|$)/);if(r&&!t.startsWith("{")&&!t.startsWith("*"))n.push(`var ${r[1]} = ${f}.default;`),t=t.slice(r[0].length).trim();let d=t.match(/^\*\s*as\s+([\w$]+)$/);if(d)n.push(`var ${d[1]} = ${f};`);else if(t.startsWith("{"))g(t.replace(/^\{|\}$/g,""),f);return""}),e=e.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(u,l)=>(c(l.slice(nn.length)),"")),e}function ee(e){let n=[e,`${e}.ts`,`${e}.tsx`,`${e}.js`,`${e}.mjs`,`${e}.jsx`,h.join(e,"index.ts"),h.join(e,"index.tsx"),h.join(e,"index.js"),h.join(e,"index.mjs")];for(let i of n)try{if(v.existsSync(i)&&v.statSync(i,{throwIfNoEntry:!1})?.isFile())return i}catch{}return}function he(e,n,i,c,g,u=new Map,l){let S=(f,t,r)=>{if(V(t,e,l))return null;if(!g||f!==i||!ge.test(t))return null;try{if(!v.statSync(t,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}c.add(t);let d=`${nn}${Qa(process.cwd(),t)}`;return u.set(r,d),{path:d,external:!0}},M=(f,t)=>{let r=f===i?n:h.dirname(f),d=h.resolve(r,t);return ee(d)??d};return{name:"stx-client-bundle",setup(f){if(f.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(t)=>({path:t.path,external:!0})),f.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(t)=>({path:t.path,external:!0})),f.onResolve({filter:/^\//},(t)=>{let r=ee(t.path);if(r){let d=S(t.importer,r,t.path);if(d)return d;if(r!==i)c.add(r);return{path:r}}return{path:t.path,external:!0}}),f.onResolve({filter:/^\.\.?\//},(t)=>{let r=M(t.importer,t.path),d=S(t.importer,r,t.path);if(d)return d;return c.add(r),{path:r}}),f.onResolve({filter:/^[@~]\//},(t)=>{let r=h.resolve(e,t.path.slice(2)),d=[r,`${r}.ts`,`${r}.tsx`,`${r}.js`,`${r}.mjs`,`${r}.jsx`,h.join(r,"index.ts"),h.join(r,"index.tsx"),h.join(r,"index.js"),h.join(r,"index.mjs")];for(let E of d)if(v.existsSync(E)&&v.statSync(E,{throwIfNoEntry:!1})?.isFile()){let C=S(t.importer,E,t.path);if(C)return C;return I(`resolved ${t.path[0]}/ import:`,t.path,"\u2192",E),c.add(E),{path:E}}return console.warn(`[stx:bundler] could not resolve ${t.path[0]}/ import:`,t.path),{path:r}}),g)f.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(t)=>{if(t.importer!==i)return;let r=`${nn}npm:${t.path}`;return u.set(t.path,r),{path:r,external:!0}});f.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(t)=>{if(V(t.path,e,l))throw Error(`Server-only API source cannot be imported by a client script: ${t.path}`);let r=h.extname(t.path).toLowerCase(),d=r===".json"?"json":r===".tsx"?"tsx":r===".jsx"?"jsx":r===".ts"||r===".mts"||r===".cts"?"ts":"js";if(t.path!==i)c.add(t.path);return{contents:v.readFileSync(t.path,"utf8"),loader:d}})}}}var G=new Map,L=m(64),te=Symbol.for("stx.client-bundle-build-queue");function nc(e){let n=globalThis,c=(n[te]??Promise.resolve()).then(e,e);return n[te]=c.then(()=>{return},()=>{return}),c}async function xt(e,n,i={}){let c=i.projectRoot||process.cwd(),g=(await o(c)).serverApi,u=i.minify??!1,l=i.externalizeUserModules??!0,S=i.expose?.length?[...new Set(i.expose)].sort():void 0,M=i.cacheDir||a(c,"bundle-cache"),f=new Bun.CryptoHasher("md5");f.update(`${pe}\x00${Be()}\x00${JSON.stringify(g??!1)}\x00${l?"registry":"inline"}\x00${S?S.join(","):"*"}\x00${e}\x00${n}`);let t=f.digest("hex").slice(0,12),r=h.join(M,`${t}.js`),d=L.get(r);if(d){if(sn(d.files)&&d.files.every((N)=>!V(N.path,c,g))){I("memo hit:",t);let N=d.files.map((B)=>B.path);return X(n,N),i.collectInputs?.push(...N),d.code}L.delete(r),I("memo invalidated by dep change:",t)}let E=h.join(M,`${t}.deps.json`),C=Bun.file(r);if(await C.exists()){let N=Bun.file(E),B=!1,R=null;if(await N.exists())try{let O=JSON.parse(await N.text());if(O.metadataVersion!==ne||!Array.isArray(O.files))B=!1;else R=O.files,B=!0;if(R&&(!sn(R)||R.some((D)=>V(D.path,c,g))))B=!1}catch{B=!1}if(B){if(I("cache hit:",t),R)X(n,R.map((D)=>D.path)),i.collectInputs?.push(...R.map((D)=>D.path));let O=await C.text();if(R)L.set(r,{code:O,files:R});return O}I("cache invalidated by dep change:",t)}let _=G.get(t);if(_){let N=await _;if(i.collectInputs)i.collectInputs.push(...(L.get(r)?.files??[]).map((B)=>B.path));return N}let z=nc(()=>we(e,n,{projectRoot:c,minify:u,cacheDir:M,hash:t,cachePath:r,depsPath:E,collectInputs:i.collectInputs,externalizeUserModules:l,serverApi:g,expose:S,throwOnFailure:i.throwOnFailure}));G.set(t,z);try{return await z}finally{G.delete(t)}}var $e=0;function rc(e){return`${e}-${process.pid}-${++$e}`}async function we(e,n,i){let{projectRoot:c,minify:g,cacheDir:u,hash:l,cachePath:S,depsPath:M,externalizeUserModules:f}=i,t=a(c,"bundle-tmp"),r=rc(l),d=h.join(t,`${r}.ts`),E=h.join(t,"out",r);v.mkdirSync(t,{recursive:!0}),v.mkdirSync(E,{recursive:!0});let C=h.dirname(n),_=new Set,z=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,N=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,B=s(e),{depths:R,balanced:O}=xe(B),D=(j)=>!O||R[j]===0,y;while((y=z.exec(B))!==null){if(y[1])continue;if(!D(y.index))continue;if(y[2])y[2].split(",").forEach((j)=>{let p=ye(j);if(p)_.add(p)});else if(y[3])_.add(y[3])}while((y=N.exec(B))!==null){if(y[1])continue;if(!D(y.index))continue;_.add(y[2])}let se=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((y=se.exec(B))!==null){if(!D(y.index))continue;let j=/^\s*['"]([^'"]+)['"]/.exec(e.slice(y.index+y[0].length))?.[1];if(j&&H.some((p)=>p.test(j)))continue;if(y[1])_.add(y[1]);if(y[2])_.add(y[2]);for(let p of(y[3]??"").split(",")){let b=p.trim();if(!b||/^type\s/.test(b))continue;let U=/\bas\s+(\w+)\s*$/.exec(b)?.[1]??/^\w+$/.exec(b)?.[0];if(U)_.add(U)}}for(let j of B.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let p of j[1].split(",")){let b=/\bas\s+(\w+)\s*$/.exec(p)?.[1]??/^\s*(\w+)\s*$/.exec(p)?.[1];if(b)_.delete(b)}let ie=_.size>0?`
3
+ export { ${[..._].join(", ")} }`:"";await Bun.write(d,e+ie),I("bundling:",l,"from:",h.basename(n));let Y=new Set,Q=new Map;try{let j=await Bun.build({entrypoints:[d],outdir:E,target:"browser",format:"esm",minify:g?{whitespace:!1,identifiers:!0,syntax:!0}:!1,plugins:[he(c,C,d,Y,f,Q,i.serverApi)],define:{"process.env.NODE_ENV":g?'"production"':'"development"',...w()},root:c});if(!j.success){let F=j.logs.filter((T)=>T.level==="error").map((T)=>T.message).join(", ")||`Unable to bundle ${h.basename(n)}`,k=rn(j.logs,n||void 0);if(console.warn("[stx:bundler] build failed:",F),Vo(n||"",F,k),i.throwOnFailure||Wo()==="error")throw Error(F);return e}let p="";for(let x of j.outputs){p=await x.text();break}let b=[];for(let x of p.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let F of x[1].split(",")){let k=F.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(k){b.push([k[2],k[1]]);continue}let T=F.trim();if(/^[A-Za-z_$][\w$]*$/.test(T))b.push([T,T])}if(i.expose){let x=new Set(i.expose);for(let F=b.length-1;F>=0;F--)if(!x.has(b[F][0]))b.splice(F,1)}let U=[];p=tc(ec(p,Q),U);let oe=p.match(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm)||[];if(p=p.replace(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),g&&p)try{p=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(p)}catch{}let K=`__stxBundle_${l}`,ae=b.map(([x,F])=>`${JSON.stringify(x)}: ${F}`).join(", "),ue=b.map(([x])=>`var ${x} = undefined;`).join(`
4
4
  `),de=b.map(([x])=>`${x} = ${K}[${JSON.stringify(x)}];`).join(`
5
5
  `);if(p=`${oe.join(`
6
6
  `)}
@@ -9,7 +9,7 @@ var ${K} = (function() {
9
9
  ${U.join(`
10
10
  `)}
11
11
  ${p}
12
- return { ${le} };
12
+ return { ${ae} };
13
13
  })();
14
- ${de}`.trim(),I("bundled:",l,"output:",p.length,"bytes"),_.size>0&&b.length===0)return console.warn(`[stx:bundler] dropped every binding for ${h.basename(n)} (${l}); serving the unbundled source and not caching this result`),e;v.mkdirSync(u,{recursive:!0}),await Bun.write(S,p);let J=Array.from(Y).map((x)=>{try{return{path:x,mtimeMs:v.statSync(x).mtimeMs}}catch{return null}}).filter((x)=>x!==null);return await Bun.write(M,JSON.stringify({metadataVersion:ne,files:J})),X(n,J.map((x)=>x.path)),i.collectInputs?.push(...J.map((x)=>x.path)),L.set(S,{code:p,files:J}),await me(u),p}catch(j){let p=nn(j,n||void 0),b=ce(j,n||void 0);if(console.warn(`[stx:bundler] error: ${b}`),Uo(n||"",b,p),i.throwOnFailure||Vo()==="error")throw j;return e}finally{try{v.rmSync(d,{force:!0}),v.rmSync(E,{recursive:!0,force:!0})}catch{}}}function we(e){let n=e.trim();if(!n)return null;let i=n.indexOf("=");if(i!==-1)n=n.slice(0,i).trim();let c=n.indexOf(":");if(c!==-1)n=n.slice(c+1).trim();if(n.startsWith("..."))n=n.slice(3).trim();return/^[A-Za-z_$][\w$]*$/.test(n)?n:null}
15
- export{ae,Ya,Uo,yt,bt,Pd,Vo,wt,tn,Za,Qa,ec,tc,vt,nc};
14
+ ${de}`.trim(),I("bundled:",l,"output:",p.length,"bytes"),_.size>0&&b.length===0)return console.warn(`[stx:bundler] dropped every binding for ${h.basename(n)} (${l}); serving the unbundled source and not caching this result`),e;v.mkdirSync(u,{recursive:!0}),await Bun.write(S,p);let J=Array.from(Y).map((x)=>{try{return{path:x,mtimeMs:v.statSync(x).mtimeMs}}catch{return null}}).filter((x)=>x!==null);return await Bun.write(M,JSON.stringify({metadataVersion:ne,files:J})),X(n,J.map((x)=>x.path)),i.collectInputs?.push(...J.map((x)=>x.path)),L.set(S,{code:p,files:J}),await me(u),p}catch(j){let p=rn(j,n||void 0),b=le(j,n||void 0);if(console.warn(`[stx:bundler] error: ${b}`),Vo(n||"",b,p),i.throwOnFailure||Wo()==="error")throw j;return e}finally{try{v.rmSync(d,{force:!0}),v.rmSync(E,{recursive:!0,force:!0})}catch{}}}function ye(e){let n=e.trim();if(!n)return null;let i=n.indexOf("=");if(i!==-1)n=n.slice(0,i).trim();let c=n.indexOf(":");if(c!==-1)n=n.slice(c+1).trim();if(n.startsWith("..."))n=n.slice(3).trim();return/^[A-Za-z_$][\w$]*$/.test(n)?n:null}
15
+ export{ce,Za,Vo,bt,wt,Id,Wo,vt,nn,Qa,ec,tc,nc,xt,rc};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Rl,Al,Pl,Il,Ol,Dl,Ml}from"./chunk-gjx5256r.js";export{Al as createKeepAliveCache,Il as generateKeepAliveCSS,Ol as generateKeepAliveRuntime,Dl as onActivated,Ml as onDeactivated,Rl as processKeepAliveDirectives,Pl as shouldCacheComponent};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{t,i}from"./chunk-a5kaw8sc.js";import{Ye,Ze,Qe,pe,xe,_,or,yn,ge}from"./chunk-g6cwhsb4.js";var I=/(?<![\w$@])@meta\s*\(/g,C=/(?<![\w$@])@metaTag\s*\(/g,k=/(?<![\w$@])@structuredData\s*\(/g,N=/(?<![\w$@])@seo\s*\(/g;function D(e,r){return(n)=>_(e,n,"the call has no closing parenthesis",r,t.INVALID_DIRECTIVE_SYNTAX)}function j(e){return"property"in e?`<meta property="${l(e.property)}" content="${l(e.content)}">`:`<meta name="${l(e.name)}" content="${l(e.content)}">`}function Rs(e,r,n,g){if(!e.includes("@meta"))return e;let a=Ye(e,I,(s,c)=>{let o=yn(Ze(s),r);if(o.kind==="tag")return j(o.tag);if(o.kind==="empty")return"";return _("Meta",c,o.message,n,o.code)},D("Meta",n));return a=Ye(a,C,(s,c)=>{let o=Qe(s,r);if(!o.ok)return _("MetaTag",c,o.message,n,o.code);if(o.value===void 0||o.value===null)return"";if(!xe(o.value))return _("MetaTag",c,`expected an object such as { name, content }, got ${pe(o.value)}`,n,t.TYPE_ERROR);let u=o.value;if(!u.name&&!u.property&&!u.httpEquiv)return _("MetaTag",c,"the tag needs a name, property or httpEquiv",n,t.INVALID_DIRECTIVE_SYNTAX);if(u.content===void 0||u.content===null||u.content===""||u.content===!1)return"";let p="<meta";if(u.name)p+=` name="${l(u.name)}"`;if(u.property)p+=` property="${l(u.property)}"`;if(u.httpEquiv)p+=` http-equiv="${l(u.httpEquiv)}"`;return p+=` content="${l(u.content)}">`,p},D("MetaTag",n)),a}function v(e){let r=(n)=>n["@context"]?{...n}:{...n,"@context":"https://schema.org"};if(xe(e))return r(e);if(Array.isArray(e)&&e.length>0&&e.every(xe))return e.map(r);return null}function A(e){return`<script type="application/ld+json">${JSON.stringify(e).replace(/<\//g,"<\\/")}</script>`}function As(e,r,n){if(!e.includes("@structuredData"))return e;return Ye(e,k,(g,a)=>{let s=Qe(g,r);if(!s.ok)return _("StructuredData",a,s.message,n,s.code);if(s.value===void 0||s.value===null)return"";let c=v(s.value);if(!c)return _("StructuredData",a,`expected an object or an array of objects, got ${pe(s.value)}`,n,t.TYPE_ERROR);try{return A(c)}catch(o){let u=o instanceof Error?o.message:String(o);return _("StructuredData",a,`the data cannot be written as JSON: ${u}`,n,t.EVALUATION_ERROR)}},D("StructuredData",n))}var L=new Set(["title","description","keywords","robots","canonical","openGraph","twitter","structuredData"]),R={image:"openGraph.image",url:"canonical or openGraph.url",type:"openGraph.type",siteName:"openGraph.siteName",locale:"openGraph.locale",og:"openGraph",author:"@meta('author', ...)"};function Ps(e,r,n,g){if(!e.includes("@seo"))return e;return Ye(e,N,(a,s)=>{if(!a.trim())return _("SEO",s,"expected an object: @seo({ title, description }) or @seo(seoVariable)",n,t.INVALID_DIRECTIVE_SYNTAX);let c=Qe(a,r);if(!c.ok)return _("SEO",s,c.message,n,c.code);if(c.value===void 0||c.value===null)return"";if(!xe(c.value))return _("SEO",s,`expected an object such as { title, description }, got ${pe(c.value)}`,n,t.TYPE_ERROR);try{return q(c.value,s,n)}catch(o){let u=o instanceof Error?o.message:String(o);return _("SEO",s,`Error processing @seo directive: ${u}`,n,t.EVALUATION_ERROR)}},D("SEO",n))}function b(e,r,n,g){let a=e[r];if(a===void 0||a===null||a===!1)return;if(xe(a))return a;or(n,`${r} must be an object, got ${pe(a)}; its tags were left out`,g);return}function q(e,r,n){let g=Object.keys(e).filter((o)=>!L.has(o));if(g.length>0){let o=g.map((u)=>R[u]?`${u} (use ${R[u]})`:u).join(", ");or(r,`@seo does not read ${o}; ${g.length===1?"it was":"they were"} ignored`,n)}let a="";if(e.title)a+=`<title>${l(e.title)}</title>
2
+ import{t,i}from"./chunk-m8qgr307.js";import{Ze,Qe,et,fe,Se,E,ir,bn,me}from"./chunk-1hrj0t0j.js";var I=/(?<![\w$@])@meta\s*\(/g,C=/(?<![\w$@])@metaTag\s*\(/g,k=/(?<![\w$@])@structuredData\s*\(/g,N=/(?<![\w$@])@seo\s*\(/g;function _(e,r){return(n)=>E(e,n,"the call has no closing parenthesis",r,t.INVALID_DIRECTIVE_SYNTAX)}function j(e){return"property"in e?`<meta property="${l(e.property)}" content="${l(e.content)}">`:`<meta name="${l(e.name)}" content="${l(e.content)}">`}function As(e,r,n,g){if(!e.includes("@meta"))return e;let a=Ze(e,I,(s,c)=>{let o=bn(Qe(s),r);if(o.kind==="tag")return j(o.tag);if(o.kind==="empty")return"";return E("Meta",c,o.message,n,o.code)},_("Meta",n));return a=Ze(a,C,(s,c)=>{let o=et(s,r);if(!o.ok)return E("MetaTag",c,o.message,n,o.code);if(o.value===void 0||o.value===null)return"";if(!Se(o.value))return E("MetaTag",c,`expected an object such as { name, content }, got ${fe(o.value)}`,n,t.TYPE_ERROR);let u=o.value;if(!u.name&&!u.property&&!u.httpEquiv)return E("MetaTag",c,"the tag needs a name, property or httpEquiv",n,t.INVALID_DIRECTIVE_SYNTAX);if(u.content===void 0||u.content===null||u.content===""||u.content===!1)return"";let p="<meta";if(u.name)p+=` name="${l(u.name)}"`;if(u.property)p+=` property="${l(u.property)}"`;if(u.httpEquiv)p+=` http-equiv="${l(u.httpEquiv)}"`;return p+=` content="${l(u.content)}">`,p},_("MetaTag",n)),a}function v(e){let r=(n)=>n["@context"]?{...n}:{...n,"@context":"https://schema.org"};if(Se(e))return r(e);if(Array.isArray(e)&&e.length>0&&e.every(Se))return e.map(r);return null}function A(e){return`<script type="application/ld+json">${JSON.stringify(e).replace(/<\//g,"<\\/")}</script>`}function Ps(e,r,n){if(!e.includes("@structuredData"))return e;return Ze(e,k,(g,a)=>{let s=et(g,r);if(!s.ok)return E("StructuredData",a,s.message,n,s.code);if(s.value===void 0||s.value===null)return"";let c=v(s.value);if(!c)return E("StructuredData",a,`expected an object or an array of objects, got ${fe(s.value)}`,n,t.TYPE_ERROR);try{return A(c)}catch(o){let u=o instanceof Error?o.message:String(o);return E("StructuredData",a,`the data cannot be written as JSON: ${u}`,n,t.EVALUATION_ERROR)}},_("StructuredData",n))}var L=new Set(["title","description","keywords","robots","canonical","openGraph","twitter","structuredData"]),R={image:"openGraph.image",url:"canonical or openGraph.url",type:"openGraph.type",siteName:"openGraph.siteName",locale:"openGraph.locale",og:"openGraph",author:"@meta('author', ...)"};function Is(e,r,n,g){if(!e.includes("@seo"))return e;return Ze(e,N,(a,s)=>{if(!a.trim())return E("SEO",s,"expected an object: @seo({ title, description }) or @seo(seoVariable)",n,t.INVALID_DIRECTIVE_SYNTAX);let c=et(a,r);if(!c.ok)return E("SEO",s,c.message,n,c.code);if(c.value===void 0||c.value===null)return"";if(!Se(c.value))return E("SEO",s,`expected an object such as { title, description }, got ${fe(c.value)}`,n,t.TYPE_ERROR);try{return q(c.value,s,n)}catch(o){let u=o instanceof Error?o.message:String(o);return E("SEO",s,`Error processing @seo directive: ${u}`,n,t.EVALUATION_ERROR)}},_("SEO",n))}function b(e,r,n,g){let a=e[r];if(a===void 0||a===null||a===!1)return;if(Se(a))return a;ir(n,`${r} must be an object, got ${fe(a)}; its tags were left out`,g);return}function q(e,r,n){let g=Object.keys(e).filter((o)=>!L.has(o));if(g.length>0){let o=g.map((u)=>R[u]?`${u} (use ${R[u]})`:u).join(", ");ir(r,`@seo does not read ${o}; ${g.length===1?"it was":"they were"} ignored`,n)}let a="";if(e.title)a+=`<title>${l(e.title)}</title>
3
3
  `,a+=`<meta name="title" content="${l(e.title)}">
4
4
  `;if(e.description)a+=`<meta name="description" content="${l(e.description)}">
5
5
  `;if(e.keywords){let o=Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords;a+=`<meta name="keywords" content="${l(o)}">
@@ -25,10 +25,10 @@ import{t,i}from"./chunk-a5kaw8sc.js";import{Ye,Ze,Qe,pe,xe,_,or,yn,ge}from"./chu
25
25
  `}if(c.site)a+=`<meta name="twitter:site" content="${l(c.site)}">
26
26
  `;if(c.creator)a+=`<meta name="twitter:creator" content="${l(c.creator)}">
27
27
  `}if(e.structuredData!==void 0&&e.structuredData!==null){let o=v(e.structuredData);if(o)a+=`${A(o)}
28
- `;else or(r,`structuredData must be an object or an array of objects, got ${pe(e.structuredData)}; it was left out`,n)}return a.trim()}function Is(e,r,n){if(n.seo?.enabled===!1)return e;if(e.includes("<!-- stx SEO Tags -->")||r.__stx_seo_staged===!0||n.skipDefaultSeoTags===!0)return e;let g=r.__stx_runtime_head;if(!!(g?.title||g?.meta?.some((S)=>S.property==="og:title"||S.name==="og:title"||S.name==="twitter:title"||S.name==="description")))return e;if(/<meta\s+(?:[^>]*\s)?property=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']twitter:title["']/i.test(e))return e;if(!e.includes("<head>")&&!e.includes("<head "))return e;let s=e.includes("<title>")||e.includes("</title>"),c=M(e),o=V(c),u=U(c),p="";if(r.title)p=r.title;else if(r.meta&&r.meta.title)p=r.meta.title;else if(o)p=o;else if(n.seo?.defaultConfig?.title)p=n.seo.defaultConfig.title;else p=n.defaultTitle||"stx Project";let m="";if(r.description)m=r.description;else if(r.meta&&r.meta.description)m=r.meta.description;else if(u)m=u;else if(n.seo?.defaultConfig?.description)m=n.seo.defaultConfig.description;else m=n.defaultDescription||"A website built with stx templating engine";let d="";if(r.image)d=r.image;else if(r.meta&&r.meta.image)d=r.meta.image;else if(r.openGraph&&r.openGraph.image)d=r.openGraph.image;else if(n.seo?.defaultImage)d=n.seo.defaultImage;else if(n.defaultImage)d=n.defaultImage;let f=s?"":`
29
- <meta name="title" content="${l(p)}">`,E=G(c)?"":`
28
+ `;else ir(r,`structuredData must be an object or an array of objects, got ${fe(e.structuredData)}; it was left out`,n)}return a.trim()}function Os(e,r,n){if(n.seo?.enabled===!1)return e;if(e.includes("<!-- stx SEO Tags -->")||r.__stx_seo_staged===!0||n.skipDefaultSeoTags===!0)return e;let g=r.__stx_runtime_head;if(!!(g?.title||g?.meta?.some((S)=>S.property==="og:title"||S.name==="og:title"||S.name==="twitter:title"||S.name==="description")))return e;if(/<meta\s+(?:[^>]*\s)?property=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']twitter:title["']/i.test(e))return e;if(!e.includes("<head>")&&!e.includes("<head "))return e;let s=e.includes("<title>")||e.includes("</title>"),c=M(e),o=V(c),u=U(c),p="";if(r.title)p=r.title;else if(r.meta&&r.meta.title)p=r.meta.title;else if(o)p=o;else if(n.seo?.defaultConfig?.title)p=n.seo.defaultConfig.title;else p=n.defaultTitle||"stx Project";let m="";if(r.description)m=r.description;else if(r.meta&&r.meta.description)m=r.meta.description;else if(u)m=u;else if(n.seo?.defaultConfig?.description)m=n.seo.defaultConfig.description;else m=n.defaultDescription||"A website built with stx templating engine";let d="";if(r.image)d=r.image;else if(r.meta&&r.meta.image)d=r.meta.image;else if(r.openGraph&&r.openGraph.image)d=r.openGraph.image;else if(n.seo?.defaultImage)d=n.seo.defaultImage;else if(n.defaultImage)d=n.defaultImage;let f=s?"":`
29
+ <meta name="title" content="${l(p)}">`,D=G(c)?"":`
30
30
  <meta name="description" content="${l(m)}">`,y=`
31
- <!-- stx SEO Tags -->${f}${E}
31
+ <!-- stx SEO Tags -->${f}${D}
32
32
  <meta property="og:title" content="${l(p)}">
33
33
  <meta property="og:description" content="${l(m)}">
34
34
  <meta property="og:type" content="website">
@@ -43,23 +43,23 @@ import{t,i}from"./chunk-a5kaw8sc.js";import{Ye,Ze,Qe,pe,xe,_,or,yn,ge}from"./chu
43
43
  ${y}
44
44
  `),h;return h.replace(/<head[^>]*>/,`$&
45
45
  ${y}
46
- `)}function M(e){let r=e.search(/<\/head\s*>/i);return r===-1?e:e.slice(0,r)}function x(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#0*39;|&apos;/g,"'").replace(/&amp;/g,"&")}function V(e){let r=e.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return r?x(r[1].trim()):""}function O(e){return(e.match(/<meta\s[^>]*>/gi)||[]).filter((r)=>/\sname\s*=\s*["']description["']/i.test(r))}function G(e){return O(e).length>0}function U(e){for(let r of O(e)){let n=r.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),g=(n?.[1]??n?.[2]??"").trim();if(g)return x(g)}return""}function l(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var nr={name:"meta",rawParams:!0,handler:(e,r,n,g)=>{let a=yn(r,n??{});if(a.kind==="error")return _("Meta",`@meta(${r.join(", ")})`,a.message,g,a.code);if(a.kind==="empty")return"";if(n)n.__stx_runtime_head=ge(n.__stx_runtime_head??{},{meta:[a.tag]});return""},hasEndTag:!1},rr={name:"structuredData",handler:(e,r,n,g)=>{if(e.trim()==="")return i("StructuredData","structuredData directive requires JSON-LD content",t.INVALID_DIRECTIVE_SYNTAX);try{let a=JSON.parse(e);if(!a["@context"])a["@context"]="https://schema.org";if(!a["@type"])return i("StructuredData","structuredData requires @type property",t.INVALID_DIRECTIVE_SYNTAX);return A(a)}catch(a){let s=a instanceof Error?a.message:String(a);return i("StructuredData",s,t.EVALUATION_ERROR)}},hasEndTag:!0};function su(){return[nr,rr]}function ou(e,r){let{baseUrl:n,defaultChangefreq:g="weekly",defaultPriority:a=0.5,includeLastmod:s=!0}=r,c=n.replace(/\/$/,""),o=(m)=>m.startsWith("http")?m:`${c}${m.startsWith("/")?"":"/"}${m}`,u=e.map((m)=>{let d=o(m.loc),f=m.lastmod||(s?new Date().toISOString().split("T")[0]:void 0),E=m.changefreq||g,y=m.priority??a,h=` <url>
46
+ `)}function M(e){let r=e.search(/<\/head\s*>/i);return r===-1?e:e.slice(0,r)}function x(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#0*39;|&apos;/g,"'").replace(/&amp;/g,"&")}function V(e){let r=e.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return r?x(r[1].trim()):""}function O(e){return(e.match(/<meta\s[^>]*>/gi)||[]).filter((r)=>/\sname\s*=\s*["']description["']/i.test(r))}function G(e){return O(e).length>0}function U(e){for(let r of O(e)){let n=r.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),g=(n?.[1]??n?.[2]??"").trim();if(g)return x(g)}return""}function l(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var rr={name:"meta",rawParams:!0,handler:(e,r,n,g)=>{let a=bn(r,n??{});if(a.kind==="error")return E("Meta",`@meta(${r.join(", ")})`,a.message,g,a.code);if(a.kind==="empty")return"";if(n)n.__stx_runtime_head=me(n.__stx_runtime_head??{},{meta:[a.tag]});return""},hasEndTag:!1},sr={name:"structuredData",handler:(e,r,n,g)=>{if(e.trim()==="")return i("StructuredData","structuredData directive requires JSON-LD content",t.INVALID_DIRECTIVE_SYNTAX);try{let a=JSON.parse(e);if(!a["@context"])a["@context"]="https://schema.org";if(!a["@type"])return i("StructuredData","structuredData requires @type property",t.INVALID_DIRECTIVE_SYNTAX);return A(a)}catch(a){let s=a instanceof Error?a.message:String(a);return i("StructuredData",s,t.EVALUATION_ERROR)}},hasEndTag:!0};function ou(){return[rr,sr]}function iu(e,r){let{baseUrl:n,defaultChangefreq:g="weekly",defaultPriority:a=0.5,includeLastmod:s=!0}=r,c=n.replace(/\/$/,""),o=(m)=>m.startsWith("http")?m:`${c}${m.startsWith("/")?"":"/"}${m}`,u=e.map((m)=>{let d=o(m.loc),f=m.lastmod||(s?new Date().toISOString().split("T")[0]:void 0),D=m.changefreq||g,y=m.priority??a,h=` <url>
47
47
  <loc>${T(d)}</loc>`;for(let w of m.alternates??[])h+=`
48
48
  <xhtml:link rel="alternate" hreflang="${T(w.hreflang)}" href="${T(o(w.href))}"/>`;if(f)h+=`
49
49
  <lastmod>${f}</lastmod>`;return h+=`
50
- <changefreq>${E}</changefreq>`,h+=`
50
+ <changefreq>${D}</changefreq>`,h+=`
51
51
  <priority>${y.toFixed(1)}</priority>`,h+=`
52
52
  </url>`,h});return`<?xml version="1.0" encoding="UTF-8"?>
53
53
  <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"${e.some((m)=>m.alternates?.length)?' xmlns:xhtml="http://www.w3.org/1999/xhtml"':""}>
54
54
  ${u.join(`
55
55
  `)}
56
- </urlset>`}function iu(e,r){let n=r.replace(/\/$/,""),g=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
56
+ </urlset>`}function au(e,r){let n=r.replace(/\/$/,""),g=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
57
57
  <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
58
58
  ${e.map((s)=>{let c=s.startsWith("http")?s:`${n}${s.startsWith("/")?"":"/"}${s}`;return` <sitemap>
59
59
  <loc>${T(c)}</loc>
60
60
  <lastmod>${g}</lastmod>
61
61
  </sitemap>`}).join(`
62
62
  `)}
63
- </sitemapindex>`}async function au(e,r){let{extensions:n=[".stx",".html",".htm"],ignore:g=["_*",".*","node_modules","components","partials","layouts"]}=r,a=[],s=n.length===1?`*${n[0]}`:`*{${n.join(",")}}`,c=new Bun.Glob(`**/${s}`);for await(let o of c.scan(e)){if(g.some((f)=>{if(f.startsWith("*"))return o.includes(f.slice(1));return o.startsWith(f)||o.includes(`/${f}`)}))continue;let p=o.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!p.startsWith("/"))p=`/${p}`;if(p!=="/"&&p.endsWith("/"))p=p.slice(0,-1);let m=`${e}/${o}`,d;try{let f=await Bun.file(m).stat();if(f)d=new Date(f.mtime).toISOString().split("T")[0]}catch{}a.push({loc:p||"/",lastmod:d,priority:p==="/"?1:0.5})}return a.sort((o,u)=>o.loc.localeCompare(u.loc)),a}function sr(e){let r=[];for(let n of e.rules){if(r.push(`User-agent: ${n.userAgent}`),n.allow)for(let g of n.allow)r.push(`Allow: ${g}`);if(n.disallow)for(let g of n.disallow)r.push(`Disallow: ${g}`);if(n.crawlDelay!==void 0)r.push(`Crawl-delay: ${n.crawlDelay}`);r.push("")}if(e.sitemap){let n=Array.isArray(e.sitemap)?e.sitemap:[e.sitemap];for(let g of n)r.push(`Sitemap: ${g}`)}if(e.host)r.push(`Host: ${e.host}`);return r.join(`
64
- `).trim()}function cu(e){return sr({rules:[{userAgent:"*",allow:["/"]}],sitemap:e})}function T(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}
65
- export{Rs,As,Ps,Is,nr,rr,su,ou,iu,au,sr,cu};
63
+ </sitemapindex>`}async function cu(e,r){let{extensions:n=[".stx",".html",".htm"],ignore:g=["_*",".*","node_modules","components","partials","layouts"]}=r,a=[],s=n.length===1?`*${n[0]}`:`*{${n.join(",")}}`,c=new Bun.Glob(`**/${s}`);for await(let o of c.scan(e)){if(g.some((f)=>{if(f.startsWith("*"))return o.includes(f.slice(1));return o.startsWith(f)||o.includes(`/${f}`)}))continue;let p=o.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!p.startsWith("/"))p=`/${p}`;if(p!=="/"&&p.endsWith("/"))p=p.slice(0,-1);let m=`${e}/${o}`,d;try{let f=await Bun.file(m).stat();if(f)d=new Date(f.mtime).toISOString().split("T")[0]}catch{}a.push({loc:p||"/",lastmod:d,priority:p==="/"?1:0.5})}return a.sort((o,u)=>o.loc.localeCompare(u.loc)),a}function or(e){let r=[];for(let n of e.rules){if(r.push(`User-agent: ${n.userAgent}`),n.allow)for(let g of n.allow)r.push(`Allow: ${g}`);if(n.disallow)for(let g of n.disallow)r.push(`Disallow: ${g}`);if(n.crawlDelay!==void 0)r.push(`Crawl-delay: ${n.crawlDelay}`);r.push("")}if(e.sitemap){let n=Array.isArray(e.sitemap)?e.sitemap:[e.sitemap];for(let g of n)r.push(`Sitemap: ${g}`)}if(e.host)r.push(`Host: ${e.host}`);return r.join(`
64
+ `).trim()}function lu(e){return or({rules:[{userAgent:"*",allow:["/"]}],sitemap:e})}function T(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}
65
+ export{As,Ps,Is,Os,rr,sr,ou,iu,au,cu,or,lu};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{U}from"./chunk-w8q1xp9e.js";function g(e,t){let r={};for(let n of e)r[n]=U(t(n));return new Proxy({},{get:(n,a)=>r[a]?.(),set:(n,a,o)=>{if(r[a])r[a].set(o);else r[a]=U(o);return!0},has:(n,a)=>(a in r),deleteProperty:(n,a)=>(delete r[a],!0),ownKeys:()=>Reflect.ownKeys(r),getOwnPropertyDescriptor:(n,a)=>(a in r)?{enumerable:!0,configurable:!0,writable:!0,value:r[a]()}:void 0})}function v(e,t){let r={};for(let n of t)r[n]=e[n];return r}function ko(e,t){let r=Object.keys(e),n=g(r,(i)=>t?.[i]??e[i].getDefaultValue()),a=g(r,()=>[]),o=g(r,()=>!1),c=g(r,()=>!1),f=g(r,()=>!1),s=U(!1);async function u(i){f[i]=!0;let d=await e[i].validate(n[i],n);return a[i]=d,f[i]=!1,d.length===0}async function l(){s.set(!0);let i=await Promise.all(r.map(u));return s.set(!1),i.every(Boolean)}function m(){for(let i of r)n[i]=t?.[i]??e[i].getDefaultValue(),a[i]=[],o[i]=!1,c[i]=!1}function h(i){for(let d of r)if(d in i)n[d]=i[d],c[d]=!0}function b(i,d){n[i]=d,c[i]=!0}function y(i,d=!0){if(o[i]=d,d)u(i)}function p(i){return{value:n[i],errors:a[i],touched:o[i],dirty:c[i],valid:a[i].length===0,validating:f[i]}}function V(i){return async(d)=>{d?.preventDefault?.();for(let w of r)o[w]=!0;if(await l())await i(v(n,r))}}return{values:n,errors:a,touched:o,dirty:c,get isValid(){return r.every((i)=>a[i].length===0)},get isValidating(){return s()||r.some((i)=>f[i])},get isDirty(){return r.some((i)=>c[i])},validate:l,validateField:u,reset:m,setValues:h,setFieldValue:b,setFieldTouched:y,getFieldState:p,handleSubmit:V}}var La=ko;class Gt{rules=[];defaultValue="";addRule(e){let t=new Gt;return t.rules=[...this.rules,e],t.defaultValue=this.defaultValue,t}required(e="This field is required"){return this.addRule({name:"required",message:e,validate:(t)=>{if(t===null||t===void 0)return e;if(typeof t==="string"&&t.trim()==="")return e;if(Array.isArray(t)&&t.length===0)return e;return!0}})}email(e="Please enter a valid email"){return this.addRule({name:"email",message:e,validate:(t)=>{if(!t)return!0;return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t))||e}})}url(e="Please enter a valid URL"){return this.addRule({name:"url",message:e,validate:(t)=>{if(!t)return!0;try{return new URL(String(t)),!0}catch{return e}}})}min(e,t){let r=t||`Must be at least ${e} characters`;return this.addRule({name:"min",message:r,validate:(n)=>{if(!n)return!0;return String(n).length>=e||r}})}max(e,t){let r=t||`Must be no more than ${e} characters`;return this.addRule({name:"max",message:r,validate:(n)=>{if(!n)return!0;return String(n).length<=e||r}})}length(e,t,r){let n=r||`Must be between ${e} and ${t} characters`;return this.addRule({name:"length",message:n,validate:(a)=>{if(!a)return!0;let o=String(a).length;return o>=e&&o<=t||n}})}pattern(e,t="Invalid format"){return this.addRule({name:"pattern",message:t,validate:(r)=>{if(!r)return!0;return e.test(String(r))||t}})}hasUppercase(e="Must contain an uppercase letter"){return this.pattern(/[A-Z]/,e)}hasLowercase(e="Must contain a lowercase letter"){return this.pattern(/[a-z]/,e)}hasNumber(e="Must contain a number"){return this.pattern(/\d/,e)}hasSpecial(e="Must contain a special character"){return this.pattern(/[!@#$%^&*(),.?":{}|<>]/,e)}alphanumeric(e="Only letters and numbers allowed"){return this.pattern(/^[a-zA-Z0-9]+$/,e)}startsWithLetter(e="Must start with a letter"){return this.pattern(/^[a-zA-Z]/,e)}noSpaces(e="Spaces are not allowed"){return this.addRule({name:"noSpaces",message:e,validate:(t)=>{if(!t)return!0;return!String(t).includes(" ")||e}})}number(e="Must be a number"){let t=this.addRule({name:"number",message:e,validate:(r)=>{if(!r&&r!==0)return!0;return!Number.isNaN(Number(r))||e}});return t.defaultValue=0,t}integer(e="Must be a whole number"){return this.addRule({name:"integer",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number.isInteger(Number(t))||e}})}positive(e="Must be a positive number"){return this.addRule({name:"positive",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number(t)>0||e}})}negative(e="Must be a negative number"){return this.addRule({name:"negative",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number(t)<0||e}})}minValue(e,t){let r=t||`Must be at least ${e}`;return this.addRule({name:"minValue",message:r,validate:(n)=>{if(!n&&n!==0)return!0;return Number(n)>=e||r}})}maxValue(e,t){let r=t||`Must be no more than ${e}`;return this.addRule({name:"maxValue",message:r,validate:(n)=>{if(!n&&n!==0)return!0;return Number(n)<=e||r}})}between(e,t,r){let n=r||`Must be between ${e} and ${t}`;return this.addRule({name:"between",message:n,validate:(a)=>{if(!a&&a!==0)return!0;let o=Number(a);return o>=e&&o<=t||n}})}matches(e,t){let r=t||`Must match ${e}`;return this.addRule({name:"matches",message:r,validate:(n,a)=>{if(!a)return!0;return n===a[e]||r}})}oneOf(e,t){let r=t||`Must be one of: ${e.join(", ")}`;return this.addRule({name:"oneOf",message:r,validate:(n)=>{if(!n)return!0;return e.includes(n)||r}})}notOneOf(e,t){let r=t||`Cannot be one of: ${e.join(", ")}`;return this.addRule({name:"notOneOf",message:r,validate:(n)=>{if(!n)return!0;return!e.includes(n)||r}})}date(e="Must be a valid date"){return this.addRule({name:"date",message:e,validate:(t)=>{if(!t)return!0;let r=new Date(String(t));return!Number.isNaN(r.getTime())||e}})}before(e,t){let r=new Date(e),n=t||`Must be before ${r.toLocaleDateString()}`;return this.addRule({name:"before",message:n,validate:(a)=>{if(!a)return!0;return new Date(String(a))<r||n}})}after(e,t){let r=new Date(e),n=t||`Must be after ${r.toLocaleDateString()}`;return this.addRule({name:"after",message:n,validate:(a)=>{if(!a)return!0;return new Date(String(a))>r||n}})}custom(e,t="Invalid value"){return this.addRule({name:"custom",message:t,validate:e})}async(e,t="Invalid value"){return this.addRule({name:"async",message:t,async:!0,validate:e})}when(e,t){let r=new Gt;r.rules=[...this.rules],r.defaultValue=this.defaultValue;for(let n of t.getRules())r.rules.push({...n,validate:(a,o)=>{if(!e(a,o||{}))return!0;return n.validate(a,o)}});return r}getRules(){return this.rules}getDefaultValue(){return this.defaultValue}default(e){let t=new Gt;return t.rules=[...this.rules],t.defaultValue=e,t}async validate(e,t){let r=[];for(let n of this.rules){let a=await n.validate(e,t);if(a!==!0)r.push(a)}return r}validateSync(e,t){let r=[];for(let n of this.rules){if(n.async)continue;let a=n.validate(e,t);if(a!==!0)r.push(a)}return r}}var Ll=new Gt;function ja(e,t,r){let n=/@error\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderror/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return u.map((l)=>c.replace(/\{\{\s*message\s*\}\}/g,l)).join(`
3
- `)}catch{return""}})}function Ba(e,t,r){let n=/@errors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderrors/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return u.map((l)=>c.replace(/\{\{\s*message\s*\}\}/g,l)).join(`
4
- `)}catch{return""}})}function Fa(e,t,r){let n=/@hasErrors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@endhasErrors/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return c}catch{return""}})}function jl(e,t,r){let n=e;return n=ja(n,t,r),n=Ba(n,t,r),n=Fa(n,t,r),n}export{ko,La,Gt,Ll,ja,Ba,Fa,jl};
2
+ import{V}from"./chunk-ymdy7b8z.js";function g(e,t){let r={};for(let n of e)r[n]=V(t(n));return new Proxy({},{get:(n,a)=>r[a]?.(),set:(n,a,o)=>{if(r[a])r[a].set(o);else r[a]=V(o);return!0},has:(n,a)=>(a in r),deleteProperty:(n,a)=>(delete r[a],!0),ownKeys:()=>Reflect.ownKeys(r),getOwnPropertyDescriptor:(n,a)=>(a in r)?{enumerable:!0,configurable:!0,writable:!0,value:r[a]()}:void 0})}function R(e,t){let r={};for(let n of t)r[n]=e[n];return r}function Co(e,t){let r=Object.keys(e),n=g(r,(i)=>t?.[i]??e[i].getDefaultValue()),a=g(r,()=>[]),o=g(r,()=>!1),c=g(r,()=>!1),f=g(r,()=>!1),s=V(!1);async function u(i){f[i]=!0;let d=await e[i].validate(n[i],n);return a[i]=d,f[i]=!1,d.length===0}async function l(){s.set(!0);let i=await Promise.all(r.map(u));return s.set(!1),i.every(Boolean)}function m(){for(let i of r)n[i]=t?.[i]??e[i].getDefaultValue(),a[i]=[],o[i]=!1,c[i]=!1}function h(i){for(let d of r)if(d in i)n[d]=i[d],c[d]=!0}function b(i,d){n[i]=d,c[i]=!0}function y(i,d=!0){if(o[i]=d,d)u(i)}function p(i){return{value:n[i],errors:a[i],touched:o[i],dirty:c[i],valid:a[i].length===0,validating:f[i]}}function w(i){return async(d)=>{d?.preventDefault?.();for(let v of r)o[v]=!0;if(await l())await i(R(n,r))}}return{values:n,errors:a,touched:o,dirty:c,get isValid(){return r.every((i)=>a[i].length===0)},get isValidating(){return s()||r.some((i)=>f[i])},get isDirty(){return r.some((i)=>c[i])},validate:l,validateField:u,reset:m,setValues:h,setFieldValue:b,setFieldTouched:y,getFieldState:p,handleSubmit:w}}var ja=Co;class Kt{rules=[];defaultValue="";addRule(e){let t=new Kt;return t.rules=[...this.rules,e],t.defaultValue=this.defaultValue,t}required(e="This field is required"){return this.addRule({name:"required",message:e,validate:(t)=>{if(t===null||t===void 0)return e;if(typeof t==="string"&&t.trim()==="")return e;if(Array.isArray(t)&&t.length===0)return e;return!0}})}email(e="Please enter a valid email"){return this.addRule({name:"email",message:e,validate:(t)=>{if(!t)return!0;return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t))||e}})}url(e="Please enter a valid URL"){return this.addRule({name:"url",message:e,validate:(t)=>{if(!t)return!0;try{return new URL(String(t)),!0}catch{return e}}})}min(e,t){let r=t||`Must be at least ${e} characters`;return this.addRule({name:"min",message:r,validate:(n)=>{if(!n)return!0;return String(n).length>=e||r}})}max(e,t){let r=t||`Must be no more than ${e} characters`;return this.addRule({name:"max",message:r,validate:(n)=>{if(!n)return!0;return String(n).length<=e||r}})}length(e,t,r){let n=r||`Must be between ${e} and ${t} characters`;return this.addRule({name:"length",message:n,validate:(a)=>{if(!a)return!0;let o=String(a).length;return o>=e&&o<=t||n}})}pattern(e,t="Invalid format"){return this.addRule({name:"pattern",message:t,validate:(r)=>{if(!r)return!0;return e.test(String(r))||t}})}hasUppercase(e="Must contain an uppercase letter"){return this.pattern(/[A-Z]/,e)}hasLowercase(e="Must contain a lowercase letter"){return this.pattern(/[a-z]/,e)}hasNumber(e="Must contain a number"){return this.pattern(/\d/,e)}hasSpecial(e="Must contain a special character"){return this.pattern(/[!@#$%^&*(),.?":{}|<>]/,e)}alphanumeric(e="Only letters and numbers allowed"){return this.pattern(/^[a-zA-Z0-9]+$/,e)}startsWithLetter(e="Must start with a letter"){return this.pattern(/^[a-zA-Z]/,e)}noSpaces(e="Spaces are not allowed"){return this.addRule({name:"noSpaces",message:e,validate:(t)=>{if(!t)return!0;return!String(t).includes(" ")||e}})}number(e="Must be a number"){let t=this.addRule({name:"number",message:e,validate:(r)=>{if(!r&&r!==0)return!0;return!Number.isNaN(Number(r))||e}});return t.defaultValue=0,t}integer(e="Must be a whole number"){return this.addRule({name:"integer",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number.isInteger(Number(t))||e}})}positive(e="Must be a positive number"){return this.addRule({name:"positive",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number(t)>0||e}})}negative(e="Must be a negative number"){return this.addRule({name:"negative",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number(t)<0||e}})}minValue(e,t){let r=t||`Must be at least ${e}`;return this.addRule({name:"minValue",message:r,validate:(n)=>{if(!n&&n!==0)return!0;return Number(n)>=e||r}})}maxValue(e,t){let r=t||`Must be no more than ${e}`;return this.addRule({name:"maxValue",message:r,validate:(n)=>{if(!n&&n!==0)return!0;return Number(n)<=e||r}})}between(e,t,r){let n=r||`Must be between ${e} and ${t}`;return this.addRule({name:"between",message:n,validate:(a)=>{if(!a&&a!==0)return!0;let o=Number(a);return o>=e&&o<=t||n}})}matches(e,t){let r=t||`Must match ${e}`;return this.addRule({name:"matches",message:r,validate:(n,a)=>{if(!a)return!0;return n===a[e]||r}})}oneOf(e,t){let r=t||`Must be one of: ${e.join(", ")}`;return this.addRule({name:"oneOf",message:r,validate:(n)=>{if(!n)return!0;return e.includes(n)||r}})}notOneOf(e,t){let r=t||`Cannot be one of: ${e.join(", ")}`;return this.addRule({name:"notOneOf",message:r,validate:(n)=>{if(!n)return!0;return!e.includes(n)||r}})}date(e="Must be a valid date"){return this.addRule({name:"date",message:e,validate:(t)=>{if(!t)return!0;let r=new Date(String(t));return!Number.isNaN(r.getTime())||e}})}before(e,t){let r=new Date(e),n=t||`Must be before ${r.toLocaleDateString()}`;return this.addRule({name:"before",message:n,validate:(a)=>{if(!a)return!0;return new Date(String(a))<r||n}})}after(e,t){let r=new Date(e),n=t||`Must be after ${r.toLocaleDateString()}`;return this.addRule({name:"after",message:n,validate:(a)=>{if(!a)return!0;return new Date(String(a))>r||n}})}custom(e,t="Invalid value"){return this.addRule({name:"custom",message:t,validate:e})}async(e,t="Invalid value"){return this.addRule({name:"async",message:t,async:!0,validate:e})}when(e,t){let r=new Kt;r.rules=[...this.rules],r.defaultValue=this.defaultValue;for(let n of t.getRules())r.rules.push({...n,validate:(a,o)=>{if(!e(a,o||{}))return!0;return n.validate(a,o)}});return r}getRules(){return this.rules}getDefaultValue(){return this.defaultValue}default(e){let t=new Kt;return t.rules=[...this.rules],t.defaultValue=e,t}async validate(e,t){let r=[];for(let n of this.rules){let a=await n.validate(e,t);if(a!==!0)r.push(a)}return r}validateSync(e,t){let r=[];for(let n of this.rules){if(n.async)continue;let a=n.validate(e,t);if(a!==!0)r.push(a)}return r}}var jl=new Kt;function Ba(e,t,r){let n=/@error\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderror/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return u.map((l)=>c.replace(/\{\{\s*message\s*\}\}/g,l)).join(`
3
+ `)}catch{return""}})}function Fa(e,t,r){let n=/@errors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderrors/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return u.map((l)=>c.replace(/\{\{\s*message\s*\}\}/g,l)).join(`
4
+ `)}catch{return""}})}function za(e,t,r){let n=/@hasErrors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@endhasErrors/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return c}catch{return""}})}function Bl(e,t,r){let n=e;return n=Ba(n,t,r),n=Fa(n,t,r),n=za(n,t,r),n}export{Co,ja,Kt,jl,Ba,Fa,za,Bl};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{R,zc,o,A,ru,su}from"./chunk-xw8kzm6b.js";import"./chunk-8afnq4qx.js";import"./chunk-4zb2ga7p.js";import"./chunk-dmf1jmge.js";import"./chunk-8txqk9nq.js";import"./chunk-ghnkphy4.js";import"./chunk-mt8sew7a.js";import"./chunk-1hrj0t0j.js";import"./chunk-m8qgr307.js";import"./chunk-d4ybwtqt.js";import"./chunk-7m0r2qs2.js";import"./chunk-ev3qnr9q.js";import"./chunk-rgage0vm.js";export{A as config,R as defaultConfig,ru as defineStxConfig,o as loadStxConfig,zc as resolveStxDirectories,su as validateConfig};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ce,Za,Vo,bt,wt,Id,Wo,vt,nn,Qa,ec,tc,nc,xt,rc}from"./chunk-mm1vvk49.js";import"./chunk-01s01ten.js";import"./chunk-ffxwsa94.js";import"./chunk-xw8kzm6b.js";import"./chunk-8afnq4qx.js";import"./chunk-4zb2ga7p.js";import"./chunk-dmf1jmge.js";import"./chunk-8txqk9nq.js";import"./chunk-ghnkphy4.js";import"./chunk-mt8sew7a.js";import"./chunk-1hrj0t0j.js";import"./chunk-m8qgr307.js";import"./chunk-d4ybwtqt.js";import"./chunk-7m0r2qs2.js";import"./chunk-ev3qnr9q.js";import"./chunk-rgage0vm.js";export{nn as MODULE_SPECIFIER_PREFIX,xt as bundleClientScript,wt as clearBundleFailures,ce as clientBundleDependencies,bt as getBundleFailures,vt as hasUserImports,ec as normalizeRegistrySpecifiers,nc as queueClientBundleBuild,Vo as recordBundleFailure,Qa as registryIdForPath,Wo as resolveBundlerFallback,tc as rewriteRegistryImports,Id as setBundlerFallbackMode,Za as shouldLogBundlerDiagnostics,rc as tempBuildName};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{o}from"./chunk-evwj0k99.js";import{Rr}from"./chunk-n1cqg89v.js";import p from"path";async function kl(t={}){let d=performance.now(),s=t.root||process.cwd(),e=await o(s),u=t.ssr?.routeRules??e.routeRules??{};if(Rr(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-8fpz04kx.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{kl};
2
+ import{o}from"./chunk-xw8kzm6b.js";import{Ar}from"./chunk-b76jbdtk.js";import p from"path";async function Cl(t={}){let d=performance.now(),s=t.root||process.cwd(),e=await o(s),u=t.ssr?.routeRules??e.routeRules??{};if(Ar(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-kza3nxr0.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{Cl};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{So,ko,Ca,Ea,_a,Ta,Nl}from"./chunk-2ernwctg.js";export{So as createVirtualList,Nl as default,Ca as generateVirtualListCSS,_a as processInfiniteListDirectives,Ta as processVirtualGridDirectives,ko as processVirtualListDirectives,Ea as useVirtualList};
@@ -1,11 +1,11 @@
1
1
  // @bun
2
- import{y}from"./chunk-r4199q6x.js";import{I,It}from"./chunk-6v1gwdbv.js";import{w,We,L,o}from"./chunk-evwj0k99.js";import{ae,wt,vt}from"./chunk-2m91qmby.js";import{Oe,Kt,gt,H}from"./chunk-mjdyyekx.js";import f from"path";var l=new Map;function v(a,s){for(let n of a.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(n[1])s.add(n[1]);for(let n of a.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let r of(n[1]??"").split(",")){let i=((r.includes(":")?r.split(":").pop():r)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(i))s.add(i)}for(let n of a.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let r of(n[1]??"").split(",")){let c=r.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(c))s.add(c)}}async function id(a){let s;if(a)s=f.resolve(a);else{let t=await o();s=f.resolve(t.root||process.cwd(),t.storesDir||"stores")}let n=new Bun.Glob("*.ts"),r=[];try{for await(let t of n.scan({cwd:s,absolute:!0})){let e=f.basename(t,".ts");if(["index","types"].includes(e))continue;if(t.includes(".d.ts"))continue;r.push(t)}}catch{return H(l,s,"",""),null}let c=()=>[...new Set([...r,...r.flatMap((t)=>ae(t))])],i=Oe(c()),d=gt(l,s,i);if(d!==void 0)return d||null;if(r.length===0)return H(l,s,i,""),null;let p=[];for(let t of r){let e=await Bun.file(t).text();p.push({file:t,hasUseStore:/useStore\s*\(/.test(e)})}p.sort((t,e)=>{if(t.hasUseStore===e.hasUseStore)return 0;return t.hasUseStore?1:-1});let h=p.map((t)=>t.file),u=[],m=new Set,b=L({loader:"ts",target:"browser",define:w()});for(let t of h)try{let e=await Bun.file(t).text(),x=f.basename(t,".ts");if(v(e,m),wt(e))e=await vt(e,t,{projectRoot:process.cwd(),externalizeUserModules:!1});e=We(e),e=I(e),e=It(e),e=e.replace(/^export\s+(default\s+)?/gm,""),e=b.transformSync(e),u.push(`// Store: ${x}
3
- ${e.trim()}`)}catch(e){console.warn(`[stx] Failed to load store ${t}:`,e)}if(u.length===0)return H(l,s,i,""),null;let g=u.join(`
2
+ import{y}from"./chunk-7m0r2qs2.js";import{I,Ot}from"./chunk-d4ybwtqt.js";import{w,qe,L,o}from"./chunk-xw8kzm6b.js";import{ce,vt,xt}from"./chunk-mm1vvk49.js";import{De,Xt,mt,U}from"./chunk-cbyh8fhn.js";import f from"path";var l=new Map;function v(a,s){for(let n of a.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(n[1])s.add(n[1]);for(let n of a.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let r of(n[1]??"").split(",")){let i=((r.includes(":")?r.split(":").pop():r)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(i))s.add(i)}for(let n of a.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let r of(n[1]??"").split(",")){let c=r.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(c))s.add(c)}}async function ad(a){let s;if(a)s=f.resolve(a);else{let t=await o();s=f.resolve(t.root||process.cwd(),t.storesDir||"stores")}let n=new Bun.Glob("*.ts"),r=[];try{for await(let t of n.scan({cwd:s,absolute:!0})){let e=f.basename(t,".ts");if(["index","types"].includes(e))continue;if(t.includes(".d.ts"))continue;r.push(t)}}catch{return U(l,s,"",""),null}let c=()=>[...new Set([...r,...r.flatMap((t)=>ce(t))])],i=De(c()),d=mt(l,s,i);if(d!==void 0)return d||null;if(r.length===0)return U(l,s,i,""),null;let p=[];for(let t of r){let e=await Bun.file(t).text();p.push({file:t,hasUseStore:/useStore\s*\(/.test(e)})}p.sort((t,e)=>{if(t.hasUseStore===e.hasUseStore)return 0;return t.hasUseStore?1:-1});let h=p.map((t)=>t.file),u=[],m=new Set,b=L({loader:"ts",target:"browser",define:w()});for(let t of h)try{let e=await Bun.file(t).text(),x=f.basename(t,".ts");if(v(e,m),vt(e))e=await xt(e,t,{projectRoot:process.cwd(),externalizeUserModules:!1});e=qe(e),e=I(e),e=Ot(e),e=e.replace(/^export\s+(default\s+)?/gm,""),e=b.transformSync(e),u.push(`// Store: ${x}
3
+ ${e.trim()}`)}catch(e){console.warn(`[stx] Failed to load store ${t}:`,e)}if(u.length===0)return U(l,s,i,""),null;let g=u.join(`
4
4
 
5
5
  `),S=`;(function(){
6
6
  var __stx = window.stx || {};
7
7
  ${y.filter((t)=>!m.has(t)&&new RegExp(`\\b${t}\\b`).test(g)).map((t)=>`var ${t} = __stx[${JSON.stringify(t)}];`).join(`
8
8
  `)}
9
9
  ${g}
10
- })();`;return i=Oe(c()),H(l,s,i,S),S}function ad(){l.clear(),Kt()}
11
- export{id,ad};
10
+ })();`;return i=De(c()),U(l,s,i,S),S}function cd(){l.clear(),Xt()}
11
+ export{ad,cd};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ln,wc,us}from"./chunk-xw8kzm6b.js";import"./chunk-8afnq4qx.js";import"./chunk-4zb2ga7p.js";import"./chunk-dmf1jmge.js";import"./chunk-8txqk9nq.js";import"./chunk-ghnkphy4.js";import"./chunk-mt8sew7a.js";import"./chunk-1hrj0t0j.js";import{Ce}from"./chunk-m8qgr307.js";import"./chunk-d4ybwtqt.js";import"./chunk-7m0r2qs2.js";import"./chunk-ev3qnr9q.js";import"./chunk-rgage0vm.js";export{Ce as freeIdentifiers,us as processComponents,wc as processESImports,ln as rendersAsElement};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ul,Vl}from"./chunk-39tkfkp7.js";export{Vl as ensureTeleportTargets,Ul as processTeleportDirectives};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{I,Ot}from"./chunk-d4ybwtqt.js";export{Ot as stripModuleImports,I as transformStoreImports};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Fn,Le,Uo,Ya}from"./chunk-9ya4tdpz.js";export{Fn as generateServiceWorker,Ya as generateServiceWorkerAuto,Le as getServiceWorkerFileName,Uo as isWorkboxEnabled};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-r4199q6x.js";import"./chunk-6v1gwdbv.js";import{m,h,w,L}from"./chunk-evwj0k99.js";import"./chunk-a5kaw8sc.js";import"./chunk-mtdx75j5.js";import"./chunk-h23bjqn1.js";import"./chunk-g6cwhsb4.js";import"./chunk-pp9jgyb6.js";import"./chunk-ff61d2wr.js";import"./chunk-e124cgb6.js";import"./chunk-912cj8pq.js";import"./chunk-1xgs9gd5.js";import"./chunk-x8rx0s3h.js";import f from"path";var S=["applyOfflineUpdate","broadcast","cacheMedia","calculateDistance","canNotify","clearCookies","clearFetchCache","clearOfflineData","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","onOfflineUpdateReady","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAmbientSound","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBreathPacer","useBroadcastChannel","useBroadcastStream","useChannel","useChildListObserver","useClipboard","useColorHistory","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useOutbox","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVisibility","useWakeLock","useWindowSize"],_=new Set(S);var l=new Map,x=m(64),y=new Set,O=0,R=new Set(S);function W(){l.clear(),x.clear()}function P(o){let n=new Map;for(let r of o){let a=f.basename(r);if(a.endsWith(".d.ts"))continue;let t=a.replace(/\.[jt]s$/,"");if(t==="index")continue;if(t===a)continue;let i=n.get(t);if(i&&!i.endsWith(".js"))continue;n.set(t,r)}return[...n.values()].sort()}function I(o,n){let r=n.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${r}\\b`).test(o)}function M(o){if(!o)return[];let n=h(o,O),r=x.get(n);if(r)return r.slice();let a=o.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),t=[];for(let i of R){if(y.has(i))continue;let u=i.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${u}\\s*\\(`).test(a))t.push(i)}return t.sort(),x.set(n,t),t.slice()}async function A(o,n){let r=M(o);if(r.length===0)return null;let a=n??f.join(import.meta.dir,"composables"),t=`${a}\x00${r.join(",")}`,i=l.get(t);if(i!==void 0)return i||null;let u=L({loader:"ts",target:"browser",define:w()}),C=new Set(r),d=[],g=new Set,p=[];try{let s=new Bun.Glob("*.{ts,js}");for await(let e of s.scan({cwd:a,absolute:!0}))p.push(e)}catch{return l.set(t,""),null}p=P(p);for(let s of p){let e;try{e=await Bun.file(s).text()}catch{continue}let b=[];try{b=u.scan(e).exports.filter((c)=>c!=="default")}catch{continue}if(!b.some((c)=>C.has(c)))continue;try{e=e.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^import\s+type\s+.*$/gm,""),e=e.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),e=e.replace(/^export\s+default\s+/gm,""),e=e.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),d.push(`// ${f.basename(s).replace(/\.[jt]s$/,"")}
2
+ import"./chunk-7m0r2qs2.js";import"./chunk-d4ybwtqt.js";import{m,h,w,L}from"./chunk-xw8kzm6b.js";import"./chunk-m8qgr307.js";import"./chunk-4zb2ga7p.js";import"./chunk-ev3qnr9q.js";import"./chunk-1hrj0t0j.js";import"./chunk-mt8sew7a.js";import"./chunk-dmf1jmge.js";import"./chunk-ghnkphy4.js";import"./chunk-8txqk9nq.js";import"./chunk-rgage0vm.js";import"./chunk-8afnq4qx.js";import f from"path";var S=["applyOfflineUpdate","broadcast","cacheMedia","calculateDistance","canNotify","clearCookies","clearFetchCache","clearOfflineData","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","onOfflineUpdateReady","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAmbientSound","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBreathPacer","useBroadcastChannel","useBroadcastStream","useChannel","useChildListObserver","useClipboard","useColorHistory","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useOutbox","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVisibility","useWakeLock","useWindowSize"],_=new Set(S);var l=new Map,x=m(64),y=new Set,O=0,R=new Set(S);function W(){l.clear(),x.clear()}function P(o){let n=new Map;for(let r of o){let a=f.basename(r);if(a.endsWith(".d.ts"))continue;let t=a.replace(/\.[jt]s$/,"");if(t==="index")continue;if(t===a)continue;let i=n.get(t);if(i&&!i.endsWith(".js"))continue;n.set(t,r)}return[...n.values()].sort()}function I(o,n){let r=n.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${r}\\b`).test(o)}function M(o){if(!o)return[];let n=h(o,O),r=x.get(n);if(r)return r.slice();let a=o.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),t=[];for(let i of R){if(y.has(i))continue;let u=i.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${u}\\s*\\(`).test(a))t.push(i)}return t.sort(),x.set(n,t),t.slice()}async function A(o,n){let r=M(o);if(r.length===0)return null;let a=n??f.join(import.meta.dir,"composables"),t=`${a}\x00${r.join(",")}`,i=l.get(t);if(i!==void 0)return i||null;let u=L({loader:"ts",target:"browser",define:w()}),C=new Set(r),d=[],g=new Set,p=[];try{let s=new Bun.Glob("*.{ts,js}");for await(let e of s.scan({cwd:a,absolute:!0}))p.push(e)}catch{return l.set(t,""),null}p=P(p);for(let s of p){let e;try{e=await Bun.file(s).text()}catch{continue}let b=[];try{b=u.scan(e).exports.filter((c)=>c!=="default")}catch{continue}if(!b.some((c)=>C.has(c)))continue;try{e=e.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^import\s+type\s+.*$/gm,""),e=e.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),e=e.replace(/^export\s+default\s+/gm,""),e=e.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),d.push(`// ${f.basename(s).replace(/\.[jt]s$/,"")}
3
3
  ${u.transformSync(e).trim()}`);for(let c of b)g.add(c)}catch(c){console.warn(`[stx] framework composable ${f.basename(s)} could not be bundled:`,c)}}let v=r.filter((s)=>!g.has(s)&&!I(o,s));if(v.length>0)console.warn(`[stx] could not bundle ${v.join(", ")} from @stacksjs/stx/composables \u2014 `+"calls to them will throw ReferenceError in the browser. Import them explicitly so the bundler inlines them, or use a runtime equivalent from window.stx.");if(d.length===0)return l.set(t,""),null;let E=[...g].map((s)=>` try { if (!(${JSON.stringify(s)} in __s)) { __s[${JSON.stringify(s)}] = ${s}; if (!(${JSON.stringify(s)} in window)) window[${JSON.stringify(s)}] = ${s}; } } catch (e) {}`).join(`
4
4
  `),k=`<script data-stx-scoped data-stx-run="always" data-stx-framework-composables>
5
5
  ;(function(){
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{ie,ht}from"./chunk-97vj2cqz.js";import{me}from"./chunk-3nk8cnrm.js";function m(e){let t={"cache-first":{className:"CacheFirst",importFrom:"workbox-strategies"},"network-first":{className:"NetworkFirst",importFrom:"workbox-strategies"},"stale-while-revalidate":{className:"StaleWhileRevalidate",importFrom:"workbox-strategies"},"network-only":{className:"NetworkOnly",importFrom:"workbox-strategies"},"cache-only":{className:"CacheOnly",importFrom:"workbox-strategies"}};return t[e]||t["network-first"]}function g(e){return m(e).className}function d(e){let t=e.pwa;if(!t?.enabled)return"";let r=t.routes||[],n=t.cacheStorage,c=[];for(let a of r){let i=g(a.strategy),s=[];if(a.maxAgeSeconds||a.maxEntries||n?.maxEntries){let o=a.maxEntries||n?.maxEntries||100,u=a.maxAgeSeconds||(n?.maxAge?n.maxAge*24*60*60:void 0);s.push(`new ExpirationPlugin({
2
+ import{ae,yt}from"./chunk-8cs45k3f.js";import{he}from"./chunk-dkyjw3hc.js";function m(e){let t={"cache-first":{className:"CacheFirst",importFrom:"workbox-strategies"},"network-first":{className:"NetworkFirst",importFrom:"workbox-strategies"},"stale-while-revalidate":{className:"StaleWhileRevalidate",importFrom:"workbox-strategies"},"network-only":{className:"NetworkOnly",importFrom:"workbox-strategies"},"cache-only":{className:"CacheOnly",importFrom:"workbox-strategies"}};return t[e]||t["network-first"]}function g(e){return m(e).className}function d(e){let t=e.pwa;if(!t?.enabled)return"";let r=t.routes||[],n=t.cacheStorage,c=[];for(let a of r){let i=g(a.strategy),s=[];if(a.maxAgeSeconds||a.maxEntries||n?.maxEntries){let o=a.maxEntries||n?.maxEntries||100,u=a.maxAgeSeconds||(n?.maxAge?n.maxAge*24*60*60:void 0);s.push(`new ExpirationPlugin({
3
3
  maxEntries: ${o},
4
4
  ${u?`maxAgeSeconds: ${u},`:""}
5
5
  purgeOnQuotaError: true,
@@ -17,7 +17,7 @@ registerRoute(
17
17
  ],`:""}
18
18
  })
19
19
  );`)}return c.join(`
20
- `)}function p(e){if(e.startsWith("*.")){let t=e.slice(2);return`({ request }) => request.destination === '${f(t)}'`}if(e.endsWith("/**"))return`({ url }) => url.pathname.startsWith('${e.slice(0,-3)}')`;if(e.endsWith("/*")){let t=e.slice(0,-2);return`({ url }) => url.pathname.startsWith('${t}') && !url.pathname.slice(${t.length+1}).includes('/')`}if(e.includes("*")&&!e.startsWith("*")){let[t,r]=e.split("*");return`({ url }) => url.pathname.startsWith('${t}') && url.pathname.endsWith('${r}')`}if(e==="/"||!e.includes("*"))return`({ url }) => url.pathname === '${e}'`;return`new RegExp('${x(e).replace(/\\\*/g,".*")}')`}function f(e){return{js:"script",mjs:"script",css:"style",html:"document",htm:"document",png:"image",jpg:"image",jpeg:"image",gif:"image",svg:"image",webp:"image",avif:"image",ico:"image",woff:"font",woff2:"font",ttf:"font",eot:"font",otf:"font"}[e.toLowerCase()]||"empty"}function h(e){return"stx-"+e.replace(/[^\w]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase().slice(0,30)+"-cache"}function x(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function b(e,t){let r=e.pwa;if(!r?.enabled)return{mode:"generate",modules:[],skipWaiting:!0,clientsClaim:!0};let n=r.serviceWorker||{},c=r.routes||[],a=[{name:"workbox-precaching",exports:["precacheAndRoute","cleanupOutdatedCaches"]},{name:"workbox-routing",exports:["registerRoute","NavigationRoute","setDefaultHandler"]}],i=new Set;for(let o of c)i.add(g(o.strategy));if(i.size>0)a.push({name:"workbox-strategies",exports:Array.from(i)});if(c.some((o)=>o.maxAgeSeconds||o.maxEntries)||r.cacheStorage)a.push({name:"workbox-expiration",exports:["ExpirationPlugin"]});if(c.some((o)=>o.strategy==="network-first"||o.strategy==="stale-while-revalidate"))a.push({name:"workbox-cacheable-response",exports:["CacheableResponsePlugin"]});if(r.backgroundSync?.enabled)a.push({name:"workbox-background-sync",exports:["BackgroundSyncPlugin","Queue"]});if(n.navigationPreload)a.push({name:"workbox-navigation-preload",exports:["enable"]});let l=t?ie(t,e):void 0;return{mode:"generate",modules:a,precacheManifest:l?.entries,skipWaiting:n.skipWaiting??!0,clientsClaim:n.clientsClaim??!0,offlineFallback:r.offline?.enabled?"/offline.html":void 0,navigationPreload:n.navigationPreload??!1,cacheVersion:n.cacheVersion||"1.0.0"}}function W(e,t){let r=e.pwa;if(!r?.enabled)return"";let n=b(e,t),c=r.serviceWorker||{},{push:a,backgroundSync:i}=r,s=t?ie(t,e):null,l=s?ht(s):"[]",o=k(n.modules),u=d(e);return`/**
20
+ `)}function p(e){if(e.startsWith("*.")){let t=e.slice(2);return`({ request }) => request.destination === '${f(t)}'`}if(e.endsWith("/**"))return`({ url }) => url.pathname.startsWith('${e.slice(0,-3)}')`;if(e.endsWith("/*")){let t=e.slice(0,-2);return`({ url }) => url.pathname.startsWith('${t}') && !url.pathname.slice(${t.length+1}).includes('/')`}if(e.includes("*")&&!e.startsWith("*")){let[t,r]=e.split("*");return`({ url }) => url.pathname.startsWith('${t}') && url.pathname.endsWith('${r}')`}if(e==="/"||!e.includes("*"))return`({ url }) => url.pathname === '${e}'`;return`new RegExp('${x(e).replace(/\\\*/g,".*")}')`}function f(e){return{js:"script",mjs:"script",css:"style",html:"document",htm:"document",png:"image",jpg:"image",jpeg:"image",gif:"image",svg:"image",webp:"image",avif:"image",ico:"image",woff:"font",woff2:"font",ttf:"font",eot:"font",otf:"font"}[e.toLowerCase()]||"empty"}function h(e){return"stx-"+e.replace(/[^\w]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase().slice(0,30)+"-cache"}function x(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function b(e,t){let r=e.pwa;if(!r?.enabled)return{mode:"generate",modules:[],skipWaiting:!0,clientsClaim:!0};let n=r.serviceWorker||{},c=r.routes||[],a=[{name:"workbox-precaching",exports:["precacheAndRoute","cleanupOutdatedCaches"]},{name:"workbox-routing",exports:["registerRoute","NavigationRoute","setDefaultHandler"]}],i=new Set;for(let o of c)i.add(g(o.strategy));if(i.size>0)a.push({name:"workbox-strategies",exports:Array.from(i)});if(c.some((o)=>o.maxAgeSeconds||o.maxEntries)||r.cacheStorage)a.push({name:"workbox-expiration",exports:["ExpirationPlugin"]});if(c.some((o)=>o.strategy==="network-first"||o.strategy==="stale-while-revalidate"))a.push({name:"workbox-cacheable-response",exports:["CacheableResponsePlugin"]});if(r.backgroundSync?.enabled)a.push({name:"workbox-background-sync",exports:["BackgroundSyncPlugin","Queue"]});if(n.navigationPreload)a.push({name:"workbox-navigation-preload",exports:["enable"]});let l=t?ae(t,e):void 0;return{mode:"generate",modules:a,precacheManifest:l?.entries,skipWaiting:n.skipWaiting??!0,clientsClaim:n.clientsClaim??!0,offlineFallback:r.offline?.enabled?"/offline.html":void 0,navigationPreload:n.navigationPreload??!1,cacheVersion:n.cacheVersion||"1.0.0"}}function W(e,t){let r=e.pwa;if(!r?.enabled)return"";let n=b(e,t),c=r.serviceWorker||{},{push:a,backgroundSync:i}=r,s=t?ae(t,e):null,l=s?yt(s):"[]",o=k(n.modules),u=d(e);return`/**
21
21
  * Service Worker - Generated by stx with Workbox
22
22
  * Cache Version: ${n.cacheVersion}
23
23
  *
@@ -41,7 +41,7 @@ importScripts('https://storage.googleapis.com/workbox-cdn/releases/7.0.0/workbox
41
41
  // build's transpiler folds that particular read to a constant, so every
42
42
  // published copy of stx emitted "debug: true" and no app could turn Workbox's
43
43
  // logging off in production however it set NODE_ENV (see ../env.ts).
44
- workbox.setConfig({ debug: ${!me()} });
44
+ workbox.setConfig({ debug: ${!he()} });
45
45
 
46
46
  // Extract modules from workbox global
47
47
  ${o}
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{zr,Fl,zl}from"./chunk-d1mqedk0.js";import"./chunk-mm1vvk49.js";import"./chunk-01s01ten.js";import"./chunk-ffxwsa94.js";import"./chunk-xw8kzm6b.js";import"./chunk-8afnq4qx.js";import"./chunk-4zb2ga7p.js";import"./chunk-dmf1jmge.js";import"./chunk-8txqk9nq.js";import"./chunk-ghnkphy4.js";import"./chunk-mt8sew7a.js";import"./chunk-1hrj0t0j.js";import"./chunk-m8qgr307.js";import"./chunk-d4ybwtqt.js";import"./chunk-7m0r2qs2.js";import"./chunk-ev3qnr9q.js";import"./chunk-rgage0vm.js";export{zl as clearComposableCache,Fl as getComposableScript,zr as listComposableModules};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import c from"path";var s=[{label:"Mobile (Small)",width:320,height:568},{label:"Mobile (Medium)",width:375,height:667},{label:"Mobile (Large)",width:414,height:896},{label:"Tablet",width:768,height:1024},{label:"Laptop",width:1024},{label:"Desktop",width:1280},{label:"Desktop (Large)",width:1920}],n=[{label:"Transparent",color:"transparent",contrastColor:"#333"},{label:"White",color:"#ffffff",contrastColor:"#333"},{label:"Light Gray",color:"#f5f5f5",contrastColor:"#333"},{label:"Dark Gray",color:"#333333",contrastColor:"#fff"},{label:"Black",color:"#000000",contrastColor:"#fff"}],i={file:"title",order:"asc",groups:[]},d={enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],tree:i,theme:{title:"STX Components",defaultColorScheme:"auto",darkClass:"dark"},responsivePresets:s,backgroundPresets:n,autoApplyContrastColor:!1,port:6006};function l(e){let t={...d,...e};return{enabled:t.enabled??!0,outDir:t.outDir??".stx/dist/story",storyMatch:t.storyMatch??["**/*.story.stx"],storyIgnored:t.storyIgnored??["**/node_modules/**","**/dist/**","**/.stx/**"],tree:{...i,...t.tree},theme:{title:"STX Components",defaultColorScheme:"auto",darkClass:"dark",...t.theme},responsivePresets:t.responsivePresets??s,backgroundPresets:t.backgroundPresets??n,autoApplyContrastColor:t.autoApplyContrastColor??!1,setupFile:t.setupFile,port:t.port??6006}}async function Te(e){let t=e.root??process.cwd(),o;try{let r=await import(c.join(t,"stx.config.ts"));o=(r.default||r).story}catch{}let a={...o,...e.config},f=l(a);return{root:t,config:f,storyFiles:[],tree:void 0,mode:e.mode}}function $e(e,t){e.storyFiles=t}function Re(e,t){e.tree=t}
3
- export{Te,$e,Re};
2
+ import c from"path";var s=[{label:"Mobile (Small)",width:320,height:568},{label:"Mobile (Medium)",width:375,height:667},{label:"Mobile (Large)",width:414,height:896},{label:"Tablet",width:768,height:1024},{label:"Laptop",width:1024},{label:"Desktop",width:1280},{label:"Desktop (Large)",width:1920}],n=[{label:"Transparent",color:"transparent",contrastColor:"#333"},{label:"White",color:"#ffffff",contrastColor:"#333"},{label:"Light Gray",color:"#f5f5f5",contrastColor:"#333"},{label:"Dark Gray",color:"#333333",contrastColor:"#fff"},{label:"Black",color:"#000000",contrastColor:"#fff"}],i={file:"title",order:"asc",groups:[]},d={enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],tree:i,theme:{title:"STX Components",defaultColorScheme:"auto",darkClass:"dark"},responsivePresets:s,backgroundPresets:n,autoApplyContrastColor:!1,port:6006};function l(e){let t={...d,...e};return{enabled:t.enabled??!0,outDir:t.outDir??".stx/dist/story",storyMatch:t.storyMatch??["**/*.story.stx"],storyIgnored:t.storyIgnored??["**/node_modules/**","**/dist/**","**/.stx/**"],tree:{...i,...t.tree},theme:{title:"STX Components",defaultColorScheme:"auto",darkClass:"dark",...t.theme},responsivePresets:t.responsivePresets??s,backgroundPresets:t.backgroundPresets??n,autoApplyContrastColor:t.autoApplyContrastColor??!1,setupFile:t.setupFile,port:t.port??6006}}async function $e(e){let t=e.root??process.cwd(),o;try{let r=await import(c.join(t,"stx.config.ts"));o=(r.default||r).story}catch{}let a={...o,...e.config},f=l(a);return{root:t,config:f,storyFiles:[],tree:void 0,mode:e.mode}}function Re(e,t){e.storyFiles=t}function Ae(e,t){e.tree=t}
3
+ export{$e,Re,Ae};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Hc,_s}from"./chunk-4zb2ga7p.js";export{Hc as looksLikeGlob,_s as resolveStxTargets};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{wo,El}from"./chunk-3hkv4e7t.js";export{wo as definePlugin,El as pluginManager};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- var l=new Map,u=new Map;function m(t){if(l.set(t.name,t),t.client)u.set(t.name,t.client)}function Xe(t){return m(t),{name:t.name,hasEndTag:t.hasEndTag??!0,description:t.description,handler:async(r,o,a,s)=>{let n=f(o,t.defaults);if(t.validate){let e=t.validate(n);if(e!==!0){let d=typeof e==="string"?e:`Invalid parameters for @${t.name}`;throw Error(d)}}let i=r;if(t.transform)i=await t.transform(r,n,a,s);if(t.clientScript){let e=t.clientScript(n);i+=`<script>${e}</script>`}if(t.css){let e=t.css(n);i+=`<style>${e}</style>`}return i}}}function f(t,c){let r={...c};for(let o of t){let a=o.indexOf(":"),s=o.indexOf("="),n=a>=0&&(s<0||a<s)?a:s;if(n>=0){let i=o.slice(0,n).trim(),e=o.slice(n+1).trim();if(e==="true")e=!0;else if(e==="false")e=!1;else if(e==="null")e=null;else if(!Number.isNaN(Number(e)))e=Number(e);else if(typeof e==="string"&&e.startsWith("{"))try{e=JSON.parse(e)}catch{}r[i]=e}else{let i=Object.keys(r).filter((e)=>!c||!(e in c)).length;r[i===0?"value":`arg${i}`]=o}}return r}
3
- export{Xe};
2
+ var l=new Map,u=new Map;function m(t){if(l.set(t.name,t),t.client)u.set(t.name,t.client)}function Je(t){return m(t),{name:t.name,hasEndTag:t.hasEndTag??!0,description:t.description,handler:async(r,o,a,s)=>{let n=f(o,t.defaults);if(t.validate){let e=t.validate(n);if(e!==!0){let d=typeof e==="string"?e:`Invalid parameters for @${t.name}`;throw Error(d)}}let i=r;if(t.transform)i=await t.transform(r,n,a,s);if(t.clientScript){let e=t.clientScript(n);i+=`<script>${e}</script>`}if(t.css){let e=t.css(n);i+=`<style>${e}</style>`}return i}}}function f(t,c){let r={...c};for(let o of t){let a=o.indexOf(":"),s=o.indexOf("="),n=a>=0&&(s<0||a<s)?a:s;if(n>=0){let i=o.slice(0,n).trim(),e=o.slice(n+1).trim();if(e==="true")e=!0;else if(e==="false")e=!1;else if(e==="null")e=null;else if(!Number.isNaN(Number(e)))e=Number(e);else if(typeof e==="string"&&e.startsWith("{"))try{e=JSON.parse(e)}catch{}r[i]=e}else{let i=Object.keys(r).filter((e)=>!c||!(e in c)).length;r[i===0?"value":`arg${i}`]=o}}return r}
3
+ export{Je};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ct,bs,mi,Ac}from"./chunk-xw8kzm6b.js";import"./chunk-8afnq4qx.js";import"./chunk-4zb2ga7p.js";import"./chunk-dmf1jmge.js";import"./chunk-8txqk9nq.js";import"./chunk-ghnkphy4.js";import"./chunk-mt8sew7a.js";import"./chunk-1hrj0t0j.js";import"./chunk-m8qgr307.js";import"./chunk-d4ybwtqt.js";import"./chunk-7m0r2qs2.js";import"./chunk-ev3qnr9q.js";import"./chunk-rgage0vm.js";export{Ac as declareBareLoopHead,Ct as parseLoopBinding,mi as processLoops,bs as reportDeferredLoopWarnings};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ls,du,uu,Mi,me,Uc,cr,pu,fu,gu,mu,hu,yu,bu,wu,vu}from"./chunk-1hrj0t0j.js";import"./chunk-m8qgr307.js";export{yu as applyHead,pu as definePageMeta,Ls as getHead,du as getPageMeta,me as mergeHeadConfigs,bu as processHeadDirective,vu as processMetaDirective,wu as processTitleDirective,hu as renderBodyAttrs,gu as renderHead,mu as renderHtmlAttrs,uu as resetHead,cr as seoMetaToHeadConfig,Mi as useHead,fu as usePageTitle,Uc as useSeoMeta,fu as useTitle};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
2
  var f=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),b=new Set(["html","head","body","p","li","dt","dd","rt","rp","option","optgroup","thead","tbody","tfoot","tr","td","th","colgroup","caption"]);function l(i){return i.replace(/[^\n]/g," ")}function w(i){let o=i.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,l).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,l).replace(/<!--[\s\S]*?-->/g,l).replace(/\{\{\{[\s\S]*?\}\}\}/g,l).replace(/\{\{[\s\S]*?\}\}/g,l).replace(/\{!![\s\S]*?!!\}/g,l),s=new Map,r=new Map,p=/<(\/?)([A-Za-z][\w-]*)\b(?:[^<>"']|"[^"]*"|'[^']*')*?(\/?)>/g,t;while((t=p.exec(o))!==null){let e=t[1]==="/",n=t[2],a=t[3]==="/";if(f.has(n.toLowerCase()))continue;if(a)continue;if(e)r.set(n,(r.get(n)??0)+1);else{let g=s.get(n);if(g)g.count++;else{let d=o.slice(0,t.index).split(`
3
- `).length;s.set(n,{count:1,firstLine:d})}}}let c=[];for(let e of new Set([...s.keys(),...r.keys()])){if(b.has(e.toLowerCase()))continue;let n=s.get(e)?.count??0,a=r.get(e)??0;if(n!==a)c.push({tag:e,opened:n,closed:a,firstOpenLine:s.get(e)?.firstLine??0})}return c}var u=new Set;function Vs(i,o){let s;try{s=w(i)}catch{return}if(s.length===0)return;let r=`${o}:${i.length}`;if(u.has(r))return;u.add(r);let p=o?o.split(/[/\\]/).pop()||o:"template";for(let{tag:t,opened:c,closed:e,firstOpenLine:n}of s)if(c>e){let a=n?` (first opened at line ${n})`:"";console.warn(`[stx] ${p}: <${t}> ${c} opened, ${e} closed \u2014 an unclosed <${t}>${a} may swallow the content that follows it.`)}else console.warn(`[stx] ${p}: <${t}> ${c} opened, ${e} closed \u2014 ${e-c} stray </${t}>.`)}
4
- export{Vs};
3
+ `).length;s.set(n,{count:1,firstLine:d})}}}let c=[];for(let e of new Set([...s.keys(),...r.keys()])){if(b.has(e.toLowerCase()))continue;let n=s.get(e)?.count??0,a=r.get(e)??0;if(n!==a)c.push({tag:e,opened:n,closed:a,firstOpenLine:s.get(e)?.firstLine??0})}return c}var u=new Set;function Ws(i,o){let s;try{s=w(i)}catch{return}if(s.length===0)return;let r=`${o}:${i.length}`;if(u.has(r))return;u.add(r);let p=o?o.split(/[/\\]/).pop()||o:"template";for(let{tag:t,opened:c,closed:e,firstOpenLine:n}of s)if(c>e){let a=n?` (first opened at line ${n})`:"";console.warn(`[stx] ${p}: <${t}> ${c} opened, ${e} closed \u2014 an unclosed <${t}>${a} may swallow the content that follows it.`)}else console.warn(`[stx] ${p}: <${t}> ${c} opened, ${e} closed \u2014 ${e-c} stray </${t}>.`)}
4
+ export{Ws};