@stacksjs/stx 0.2.914 → 0.2.917

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 (217) hide show
  1. package/dist/build-defer-scripts.d.ts +12 -0
  2. package/dist/build-defer-scripts.js +37 -0
  3. package/dist/build-externalize-repeated.js +2 -0
  4. package/dist/build-externalize.js +1 -1
  5. package/dist/builtins/image-delivery.js +2 -0
  6. package/dist/builtins/image-placeholder.js +2 -0
  7. package/dist/{chunk-2vdbt2a7.js → chunk-0adc8x2h.js} +1 -1
  8. package/dist/{chunk-tykdvjbe.js → chunk-0asdv3hk.js} +2 -2
  9. package/dist/{chunk-1mmv8wb8.js → chunk-0atz8fjx.js} +4 -4
  10. package/dist/chunk-0fm6avxt.js +3 -0
  11. package/dist/{chunk-5ya4nmmr.js → chunk-0sj79ha5.js} +4 -4
  12. package/dist/{chunk-dhkw1r4y.js → chunk-0v7555tr.js} +4 -4
  13. package/dist/{chunk-5jn2qyv7.js → chunk-11c7xg1z.js} +1 -1
  14. package/dist/chunk-11rnqey0.js +2 -0
  15. package/dist/{chunk-4b110x6r.js → chunk-16sfjkc4.js} +2 -2
  16. package/dist/{chunk-kmy34he2.js → chunk-1hbf5e1h.js} +2 -2
  17. package/dist/{chunk-9atdw0p8.js → chunk-1jvt9t3r.js} +2 -2
  18. package/dist/chunk-1mx3j280.js +2 -0
  19. package/dist/{chunk-0d3pkkrv.js → chunk-23x3k751.js} +2 -2
  20. package/dist/chunk-29v3b5ks.js +2 -0
  21. package/dist/chunk-2cay3heb.js +2 -0
  22. package/dist/{chunk-6yketqa1.js → chunk-2f5jjxcj.js} +2 -2
  23. package/dist/{chunk-razwegar.js → chunk-2vx2ben8.js} +2 -2
  24. package/dist/{chunk-132j46ey.js → chunk-302nw40c.js} +1 -1
  25. package/dist/chunk-31yx4sjh.js +2 -0
  26. package/dist/chunk-33fnbw33.js +2 -0
  27. package/dist/{chunk-wbsbrm6n.js → chunk-36cz2v8k.js} +30 -30
  28. package/dist/{chunk-9gptdyqq.js → chunk-388xpdw5.js} +31 -5
  29. package/dist/chunk-38kerh2r.js +2 -0
  30. package/dist/chunk-38y11q8x.js +2 -0
  31. package/dist/{chunk-kyfydbtg.js → chunk-3h4db9yb.js} +3 -3
  32. package/dist/{chunk-3m457a9q.js → chunk-3jc6yb02.js} +3 -3
  33. package/dist/chunk-3q80f7mt.js +2 -0
  34. package/dist/{chunk-fghf6amb.js → chunk-43sgpy4e.js} +5 -5
  35. package/dist/{chunk-w4177qn3.js → chunk-4e18r89n.js} +2 -2
  36. package/dist/chunk-4pve3r5a.js +2 -0
  37. package/dist/{chunk-c08jvjqt.js → chunk-4vz17ytv.js} +8 -8
  38. package/dist/chunk-5afnyvw5.js +2 -0
  39. package/dist/chunk-5d5dxts6.js +2 -0
  40. package/dist/chunk-5fdsyyfe.js +2 -0
  41. package/dist/chunk-67yr4m5h.js +2 -0
  42. package/dist/chunk-6aqr0e6s.js +2 -0
  43. package/dist/chunk-6bw02d1t.js +2 -0
  44. package/dist/chunk-76mn123c.js +2 -0
  45. package/dist/{chunk-3z3b98f0.js → chunk-789yp1tg.js} +3 -3
  46. package/dist/chunk-7ar11ccn.js +2 -0
  47. package/dist/chunk-7fc0vrs5.js +2 -0
  48. package/dist/chunk-82fg5gp6.js +2 -0
  49. package/dist/{chunk-gyv2bsmn.js → chunk-88fx8xc1.js} +2 -2
  50. package/dist/chunk-89r7bbsk.js +2 -0
  51. package/dist/{chunk-h8tgqq8x.js → chunk-8b8az19t.js} +5 -5
  52. package/dist/chunk-8egbh6z1.js +2 -0
  53. package/dist/chunk-8n9jd8cz.js +2 -0
  54. package/dist/{chunk-9tj16d70.js → chunk-8wqhzzkn.js} +2 -2
  55. package/dist/chunk-8x3yaahc.js +2 -0
  56. package/dist/{chunk-rcwg2pdk.js → chunk-91p8p2cc.js} +5 -5
  57. package/dist/chunk-94qc4zwb.js +2 -0
  58. package/dist/{chunk-d4hnj3ct.js → chunk-952dfmcb.js} +2 -2
  59. package/dist/{chunk-72pbhpq8.js → chunk-95j8660f.js} +2 -2
  60. package/dist/{chunk-75r2p1cz.js → chunk-9928zdej.js} +2 -2
  61. package/dist/{chunk-8f5x16ht.js → chunk-9ay18k46.js} +1 -1
  62. package/dist/{chunk-2gwgcybp.js → chunk-9kn81bmp.js} +1 -1
  63. package/dist/{chunk-9bexzgws.js → chunk-9tv0tw7f.js} +1 -1
  64. package/dist/{chunk-0h06ry05.js → chunk-9w9y84t5.js} +6 -6
  65. package/dist/chunk-a5h9bwrc.js +2 -0
  66. package/dist/{chunk-gg31th5s.js → chunk-ar6jeqmm.js} +4 -4
  67. package/dist/{chunk-kx3mmpfd.js → chunk-b5qzed8y.js} +37 -37
  68. package/dist/chunk-bej9kz05.js +2 -0
  69. package/dist/chunk-bh2khcet.js +2 -0
  70. package/dist/{chunk-4h48fgkz.js → chunk-bm6y085n.js} +3 -3
  71. package/dist/{chunk-9phqwza2.js → chunk-c13dv3wm.js} +10 -10
  72. package/dist/chunk-c6096ssb.js +2 -0
  73. package/dist/chunk-ccgabq3a.js +2 -0
  74. package/dist/{chunk-sdf4c754.js → chunk-cxsc37fg.js} +2 -2
  75. package/dist/{chunk-jap66ea8.js → chunk-da05660m.js} +37 -37
  76. package/dist/{chunk-2671myh8.js → chunk-dwt2drzf.js} +5 -5
  77. package/dist/chunk-e0tvd7jj.js +2 -0
  78. package/dist/{chunk-sg95ne5m.js → chunk-ezqfrea9.js} +5 -5
  79. package/dist/{chunk-z27szg5v.js → chunk-f0sxbgbm.js} +1 -1
  80. package/dist/{chunk-08bzdet4.js → chunk-fn1reean.js} +19 -19
  81. package/dist/{chunk-2m4d8jkv.js → chunk-frpsrv1e.js} +2 -2
  82. package/dist/{chunk-pc89t52s.js → chunk-ftvpz1j4.js} +5 -5
  83. package/dist/{chunk-zjrnz9yt.js → chunk-fvr3h2fr.js} +3 -3
  84. package/dist/{chunk-8p3vqt2q.js → chunk-fzcqw147.js} +2 -2
  85. package/dist/{chunk-jttzrv0w.js → chunk-gg715pj6.js} +5 -5
  86. package/dist/chunk-gmmqz698.js +2 -0
  87. package/dist/{chunk-nzw0y1ny.js → chunk-h0aw9hmc.js} +3 -3
  88. package/dist/chunk-hxftzw0x.js +2 -0
  89. package/dist/{chunk-mpfm5ctr.js → chunk-jr2r2nh5.js} +4 -4
  90. package/dist/chunk-js1wayhb.js +2 -0
  91. package/dist/chunk-k2t0w8z1.js +2 -0
  92. package/dist/chunk-k8s3hyh2.js +2 -0
  93. package/dist/chunk-kcpxqsdj.js +2 -0
  94. package/dist/{chunk-nan0ysys.js → chunk-m8n14s3z.js} +2 -2
  95. package/dist/{chunk-as1p2pch.js → chunk-ma5ptt4m.js} +2 -2
  96. package/dist/{chunk-fyb9qy7x.js → chunk-mf5cqv1k.js} +9 -9
  97. package/dist/{chunk-jhegz7az.js → chunk-mgj074y2.js} +5 -5
  98. package/dist/chunk-mjr5fkc2.js +2 -0
  99. package/dist/{chunk-gqh8shzf.js → chunk-mt5ewkbg.js} +2 -2
  100. package/dist/{chunk-0m0w8rr1.js → chunk-n4m50dpk.js} +14 -14
  101. package/dist/chunk-na0e3s88.js +2 -0
  102. package/dist/chunk-new89wh2.js +2 -0
  103. package/dist/{chunk-eyw4g6kq.js → chunk-ngqb22wj.js} +9 -9
  104. package/dist/{chunk-v0yay1kw.js → chunk-nhyv3w4r.js} +1 -1
  105. package/dist/{chunk-yzgtsrjb.js → chunk-npj20tj9.js} +2 -2
  106. package/dist/{chunk-j01a1am0.js → chunk-nwef47nx.js} +1 -1
  107. package/dist/{chunk-zk1c6tg7.js → chunk-p3fepzt9.js} +3 -3
  108. package/dist/{chunk-z8rf8abt.js → chunk-p3x84jj0.js} +1 -1
  109. package/dist/chunk-p9bghe13.js +2 -0
  110. package/dist/{chunk-fycxc75p.js → chunk-pyyda92j.js} +1 -1
  111. package/dist/chunk-q2cwzgd0.js +2 -0
  112. package/dist/chunk-q60afqr7.js +2 -0
  113. package/dist/chunk-qdwtemy1.js +2 -0
  114. package/dist/chunk-qp0ndbk6.js +2 -0
  115. package/dist/{chunk-1ezcxbpg.js → chunk-qsexsrw2.js} +5 -5
  116. package/dist/{chunk-w3y8408q.js → chunk-r7y1196g.js} +2 -2
  117. package/dist/{chunk-ta7cwykn.js → chunk-ra2tzsvz.js} +4 -4
  118. package/dist/chunk-rzsvxjse.js +2 -0
  119. package/dist/chunk-s2c0ynn9.js +2 -0
  120. package/dist/{chunk-6w9av0n9.js → chunk-sdmq09jw.js} +1 -1
  121. package/dist/{chunk-qvjg8w1a.js → chunk-t65f98qv.js} +2 -2
  122. package/dist/chunk-v1wr2vdx.js +2 -0
  123. package/dist/{chunk-4fmfc48n.js → chunk-v78hjbz0.js} +3 -3
  124. package/dist/{chunk-ekyx5z50.js → chunk-vayzmvf5.js} +6 -6
  125. package/dist/{chunk-f9vch452.js → chunk-w6ydg43d.js} +3 -3
  126. package/dist/{chunk-e52rtbde.js → chunk-wc10m4tp.js} +3 -3
  127. package/dist/chunk-wcxa8xy2.js +2 -0
  128. package/dist/chunk-wgrj0cvs.js +2 -0
  129. package/dist/{chunk-49n9xce7.js → chunk-wj9bqkc0.js} +1 -1
  130. package/dist/{chunk-r4za879x.js → chunk-wm24jx3t.js} +2 -2
  131. package/dist/chunk-wpkwx3wq.js +2 -0
  132. package/dist/chunk-wq17dce6.js +2 -0
  133. package/dist/chunk-wvc6eayq.js +2 -0
  134. package/dist/chunk-xa98a901.js +2 -0
  135. package/dist/chunk-xjt5129x.js +2 -0
  136. package/dist/{chunk-eca022er.js → chunk-xnp031ba.js} +6 -6
  137. package/dist/{chunk-hgtcgz9b.js → chunk-yc3frw0z.js} +2 -2
  138. package/dist/chunk-yn02d599.js +2 -0
  139. package/dist/{chunk-g9bsafzx.js → chunk-yq2krsc9.js} +4 -4
  140. package/dist/chunk-ywrpmyzj.js +5 -0
  141. package/dist/{chunk-95x3jvmz.js → chunk-z110bf2c.js} +8 -6
  142. package/dist/{chunk-3syagjd7.js → chunk-zv3rn0ch.js} +4 -4
  143. package/dist/cli.js +14 -14
  144. package/dist/client/signals-mount-runtime.js +4 -2
  145. package/dist/craft-entry.js +2 -2
  146. package/dist/craft.js +2 -2
  147. package/dist/dev-server/ts-css.d.ts +1 -1
  148. package/dist/dev-server/ts-css.js +2 -2
  149. package/dist/index.d.ts +2 -0
  150. package/dist/index.js +2 -0
  151. package/dist/native/compiler/html-to-ir.d.ts +3 -1
  152. package/dist/native/compiler/html-to-ir.js +30 -0
  153. package/dist/process.js +1 -1
  154. package/dist/pwa.js +3 -3
  155. package/dist/serve-page-assets.d.ts +2 -0
  156. package/dist/serve-page-assets.js +14 -0
  157. package/dist/ssg.js +25 -25
  158. package/dist/types/config-types.d.ts +2 -0
  159. package/package.json +5 -5
  160. package/dist/chunk-1dc6h93m.js +0 -2
  161. package/dist/chunk-1htdsypj.js +0 -3
  162. package/dist/chunk-1k5ns68h.js +0 -2
  163. package/dist/chunk-2870sk9z.js +0 -2
  164. package/dist/chunk-2fyey6pn.js +0 -2
  165. package/dist/chunk-2jkq15je.js +0 -2
  166. package/dist/chunk-3d3f35fz.js +0 -2
  167. package/dist/chunk-3e3zsgke.js +0 -2
  168. package/dist/chunk-3fabcebr.js +0 -2
  169. package/dist/chunk-41y868zf.js +0 -2
  170. package/dist/chunk-5xsghm23.js +0 -2
  171. package/dist/chunk-7k1thytm.js +0 -2
  172. package/dist/chunk-8n42epb6.js +0 -5
  173. package/dist/chunk-94r6mkcy.js +0 -2
  174. package/dist/chunk-9s8he3d1.js +0 -2
  175. package/dist/chunk-9y4gz22m.js +0 -2
  176. package/dist/chunk-a02sy0m5.js +0 -2
  177. package/dist/chunk-abs4fwmf.js +0 -2
  178. package/dist/chunk-abxwggen.js +0 -2
  179. package/dist/chunk-asewbsct.js +0 -2
  180. package/dist/chunk-bprjp80g.js +0 -2
  181. package/dist/chunk-c60egpe6.js +0 -2
  182. package/dist/chunk-cjq455ve.js +0 -2
  183. package/dist/chunk-cqq68aw8.js +0 -2
  184. package/dist/chunk-d9066gp6.js +0 -2
  185. package/dist/chunk-dmsrpf7h.js +0 -2
  186. package/dist/chunk-fzh73jtc.js +0 -2
  187. package/dist/chunk-g3a2gx3p.js +0 -2
  188. package/dist/chunk-g6s4151k.js +0 -2
  189. package/dist/chunk-gcc5tp4j.js +0 -2
  190. package/dist/chunk-gf4a9h9x.js +0 -2
  191. package/dist/chunk-gmczbe3j.js +0 -2
  192. package/dist/chunk-h13csdpm.js +0 -2
  193. package/dist/chunk-h7k1y40p.js +0 -2
  194. package/dist/chunk-h7xqba9k.js +0 -2
  195. package/dist/chunk-hpxhxwda.js +0 -2
  196. package/dist/chunk-j846tv4t.js +0 -2
  197. package/dist/chunk-jnk3nk5k.js +0 -2
  198. package/dist/chunk-jy5gh22e.js +0 -2
  199. package/dist/chunk-jzbte09f.js +0 -2
  200. package/dist/chunk-k0b1t59r.js +0 -2
  201. package/dist/chunk-k5v22gn4.js +0 -2
  202. package/dist/chunk-kwh5pjqd.js +0 -2
  203. package/dist/chunk-mgcakk1m.js +0 -2
  204. package/dist/chunk-n3bt1sv5.js +0 -2
  205. package/dist/chunk-n62nqhey.js +0 -2
  206. package/dist/chunk-n6ve45hj.js +0 -2
  207. package/dist/chunk-ptrz5xwt.js +0 -2
  208. package/dist/chunk-q3ha3fcj.js +0 -2
  209. package/dist/chunk-qgc59a7d.js +0 -2
  210. package/dist/chunk-qjkpwjg6.js +0 -2
  211. package/dist/chunk-t4paeg33.js +0 -2
  212. package/dist/chunk-tfn3x8t2.js +0 -2
  213. package/dist/chunk-vhk7a79j.js +0 -2
  214. package/dist/chunk-vmn8vpp8.js +0 -2
  215. package/dist/chunk-x1svtz8k.js +0 -2
  216. package/dist/chunk-ykx4zt07.js +0 -2
  217. package/dist/chunk-zb75qq5j.js +0 -2
@@ -27,7 +27,7 @@ ${"\x1B[31m"}\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\
27
27
  `),"utf-8")}}async flush(){await this.writeQueue}}var K=new Q,jn={isDevelopment(){return ne()},logDetailedError(e,t){if(!this.isDevelopment())return;if(console.error("=== stx Detailed Error ==="),console.error("Error:",e.message),console.error("Stack:",e.stack),t)console.error("Context:",t);console.error("========================")},createErrorReport(e,t){let r=["=== stx Error Report ===",`Time: ${new Date().toISOString()}`,`Error: ${e.message}`,`Type: ${e.constructor.name}`,`Stack: ${e.stack}`];if(t)r.push(`Context: ${JSON.stringify(t,null,2)}`);return r.push("========================"),r.join(`
28
28
  `)}};class be{context;source;pos=0;line=1;column=0;tokens=[];constructor(e,t="template"){this.context=t;this.source=e}tokenize(){this.tokens=[],this.pos=0,this.line=1,this.column=0;while(this.pos<this.source.length){let e=this.nextToken();if(e)this.tokens.push(e)}return this.tokens.push({type:"EOF",value:"",start:this.pos,end:this.pos,line:this.line,column:this.column}),this.tokens}nextToken(){if(this.pos>=this.source.length)return null;let e=this.pos,t=this.line,r=this.column,i=this.source[this.pos];if(/\s/.test(i))return this.readWhitespace(e,t,r);if(i==="/"&&this.peek(1)==="/")return this.readLineComment(e,t,r);if(i==="/"&&this.peek(1)==="*")return this.readBlockComment(e,t,r);if(i==='"'||i==="'")return this.readString(i,e,t,r);if(i==="`")return this.readTemplateString(e,t,r);if(/\d/.test(i)||i==="."&&/\d/.test(this.peek(1)||""))return this.readNumber(e,t,r);if(/[a-z_$]/i.test(i))return this.readIdentifier(e,t,r);if(this.context==="template"&&i==="{"){if(this.peek(1)==="{"&&this.peek(2)==="{")return this.advance(3),{type:"RAW_START",value:"{{{",start:e,end:this.pos,line:t,column:r};if(this.peek(1)==="{")return this.advance(2),{type:"EXPRESSION_START",value:"{{",start:e,end:this.pos,line:t,column:r};if(this.peek(1)==="!"&&this.peek(2)==="!")return this.advance(3),{type:"RAW_START",value:"{!!",start:e,end:this.pos,line:t,column:r}}if(this.context==="template"&&i==="}"){if(this.peek(1)==="}"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"}}}",start:e,end:this.pos,line:t,column:r};if(this.peek(1)==="}")return this.advance(2),{type:"EXPRESSION_END",value:"}}",start:e,end:this.pos,line:t,column:r}}if(this.context==="template"&&i==="!"&&this.peek(1)==="!"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"!!}",start:e,end:this.pos,line:t,column:r};if(i==="@"&&/[a-z]/i.test(this.peek(1)||""))return this.readDirective(e,t,r);let s=["===","!==","==","!=","<=",">=","&&","||","??","++","--","+=","-=","*=","/=","%=","**","=>","?.","...","<<",">>",">>>","&=","|=","^="];for(let o of s)if(this.source.slice(this.pos,this.pos+o.length)===o)return this.advance(o.length),{type:"OPERATOR",value:o,start:e,end:this.pos,line:t,column:r};if(/[+\-*/%<>=!&|^~?:]/.test(i))return this.advance(),{type:"OPERATOR",value:i,start:e,end:this.pos,line:t,column:r};if(/[()[\]{},;.]/.test(i))return this.advance(),{type:"PUNCTUATION",value:i,start:e,end:this.pos,line:t,column:r};return this.advance(),{type:"PUNCTUATION",value:i,start:e,end:this.pos,line:t,column:r}}readWhitespace(e,t,r){while(this.pos<this.source.length&&/\s/.test(this.source[this.pos]))this.advance();return{type:"WHITESPACE",value:this.source.slice(e,this.pos),start:e,end:this.pos,line:t,column:r}}readLineComment(e,t,r){this.advance(2);while(this.pos<this.source.length&&this.source[this.pos]!==`
29
29
  `)this.advance();return{type:"COMMENT",value:this.source.slice(e,this.pos),start:e,end:this.pos,line:t,column:r}}readBlockComment(e,t,r){this.advance(2);while(this.pos<this.source.length-1){if(this.source[this.pos]==="*"&&this.source[this.pos+1]==="/"){this.advance(2);break}this.advance()}return{type:"COMMENT",value:this.source.slice(e,this.pos),start:e,end:this.pos,line:t,column:r}}readString(e,t,r,i){this.advance();while(this.pos<this.source.length){let s=this.source[this.pos];if(s==="\\"){this.advance(2);continue}if(s===e){this.advance();break}this.advance()}return{type:"STRING",value:this.source.slice(t,this.pos),start:t,end:this.pos,line:r,column:i}}readTemplateString(e,t,r){this.advance();let i=0,s=256;while(this.pos<this.source.length){let o=this.source[this.pos];if(o==="\\"){this.advance(2);continue}if(o==="$"&&this.peek(1)==="{"){if(i>=s){this.pos=this.source.length;break}this.advance(2),i++;continue}if(o==="{"&&i>0){i++,this.advance();continue}if(o==="}"&&i>0){i--,this.advance();continue}if(o==="`"&&i===0){this.advance();break}this.advance()}return{type:"TEMPLATE_STRING",value:this.source.slice(e,this.pos),start:e,end:this.pos,line:t,column:r}}readNumber(e,t,r){if(this.source[this.pos]==="0"){let i=this.peek(1)?.toLowerCase();if(i==="x"||i==="o"||i==="b"){this.advance(2);while(this.pos<this.source.length&&/[\da-f_]/i.test(this.source[this.pos]))this.advance();return{type:"NUMBER",value:this.source.slice(e,this.pos),start:e,end:this.pos,line:t,column:r}}}while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance();if(this.source[this.pos]==="."&&(this.context==="javascript"||/\d/.test(this.peek(1)||""))){this.advance();while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance()}if(/e/i.test(this.source[this.pos]||"")){if(this.advance(),/[+-]/.test(this.source[this.pos]||""))this.advance();while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance()}if(this.source[this.pos]==="n")this.advance();return{type:"NUMBER",value:this.source.slice(e,this.pos),start:e,end:this.pos,line:t,column:r}}readIdentifier(e,t,r){while(this.pos<this.source.length&&/[\w$]/.test(this.source[this.pos]))this.advance();return{type:"IDENTIFIER",value:this.source.slice(e,this.pos),start:e,end:this.pos,line:t,column:r}}readDirective(e,t,r){this.advance();while(this.pos<this.source.length&&/[a-z]/i.test(this.source[this.pos]))this.advance();return{type:"DIRECTIVE",value:this.source.slice(e,this.pos),start:e,end:this.pos,line:t,column:r}}advance(e=1){for(let t=0;t<e&&this.pos<this.source.length;t++){if(this.source[this.pos]===`
30
- `)this.line++,this.column=0;else this.column++;this.pos++}}peek(e){return this.source[this.pos+e]}saveState(){return{pos:this.pos,line:this.line,column:this.column}}restoreState(e){this.pos=e.pos,this.line=e.line,this.column=e.column}}function _(e,t,r,i=0){let s=0,o=i,a=null,c=0,g=!1;while(o<e.length){let l=e[o];if(a&&g){g=!1,o++;continue}if(a&&l==="\\"){g=!0,o++;continue}if(g=!1,(l==='"'||l==="'"||l==="`")&&!a){a=l,o++;continue}if(l===a&&a!=="`"){a=null,o++;continue}if(a==="`"&&l==="$"&&e[o+1]==="{"){c++,o+=2;continue}if(c>0&&l==="}"){c--,o++;continue}if(l==="`"&&a==="`"&&c===0){a=null,o++;continue}if(a){o++;continue}if(l===t)s++;else if(l===r){if(s--,s===0)return o}o++}return-1}function Ol(e,t){let r=t,i={paren:0,bracket:0,brace:0},s=null,o=0;while(r<e.length){let a=e[r];if((r>0?e[r-1]:"")==="\\"&&s){r++;continue}if((a==='"'||a==="'")&&!s){s=a,r++;continue}if(a===s&&s!=="`"){s=null,r++;continue}if(a==="`"&&!s){s="`",r++;continue}if(a==="`"&&s==="`"&&o===0){s=null,r++;continue}if(s==="`"&&a==="$"&&e[r+1]==="{"){o++,r+=2;continue}if(o>0){if(a==="{")o++;else if(a==="}")o--;r++;continue}if(s){r++;continue}if(i.paren===0&&i.bracket===0&&i.brace===0){if(e.slice(r,r+2)==="}}"||e.slice(r,r+3)==="!!}")break;if(a===","||a===";")break}if(a==="(")i.paren++;else if(a===")"){if(i.paren--,i.paren<0)break}else if(a==="[")i.bracket++;else if(a==="]"){if(i.bracket--,i.bracket<0)break}else if(a==="{")i.brace++;else if(a==="}"){if(i.brace--,i.brace<0)break}r++}return{expression:e.slice(t,r),endPos:r}}var xt={maxSanitizeDepth:10,allowBracketNotation:!1},Te={...xt};var z=/\bnew\s+/,U="__stx_safe_ctors",Ae=["Bun","Deno","Buffer","fetch","atob","btoa","console","Response","Request","Headers","WebAssembly","structuredClone","queueMicrotask","crypto","performance","navigator","Worker","WebSocket","BroadcastChannel","EventSource","XMLHttpRequest","localStorage","sessionStorage"],ee=[...Ae,"Function","setTimeout","setInterval","setImmediate","process","require","exports","module","window","document","global","globalThis","Reflect","Proxy","Symbol","WeakMap","WeakSet","WeakRef","FinalizationRegistry"],we=ee.map(()=>{return}),re=Object.freeze(Object.assign(Object.create(null),{keys:Object.keys,values:Object.values,entries:Object.entries,fromEntries:Object.fromEntries,assign:Object.assign,hasOwn:Object.hasOwn,is:Object.is})),se=[/\b(eval|Function|setTimeout|setInterval|setImmediate)\b/,/\b(process|require|import|exports|module)\b/,/\b(window|document|global|globalThis)\b/,/\b(constructor|prototype|__proto__)\b/,/\b(Reflect|Proxy)\b/,/\bSymbol\b/,/\b(WeakMap|WeakSet|WeakRef|FinalizationRegistry)\b/,/\b(Generator|AsyncGenerator)\b/,/__\w+__/,/\.(bind|call|apply)\s*\(/,z,/\bdelete\s+/,/\bthis\b/,/\\u(?:\{[\dA-Fa-f]+\}|[\dA-Fa-f]{4})/],oe=new Set([...Ae,"eval","Function","setTimeout","setInterval","setImmediate","process","require","import","exports","module","window","document","global","globalThis","constructor","prototype","Reflect","Proxy","Symbol","WeakMap","WeakSet","WeakRef","FinalizationRegistry","Generator","AsyncGenerator","delete","this",U]),ae=new Set(["__proto__","constructor","prototype"]);function _e(e){let t="",r=[],i=null,s=!1;for(let o=0;o<e.length;o++){let a=e[o];if(s){s=!1;continue}if(a==="\\"&&i){s=!0;continue}if(i){if(i==="`"&&a==="$"&&o+1<e.length&&e[o+1]==="{"){let c=1;o+=2;while(o<e.length&&c>0){if(e[o]==="{")c++;else if(e[o]==="}")c--;if(c>0)t+=e[o],r.push(o),o++}continue}if(a===i)i=null;continue}if(a==='"'||a==="'"||a==="`"){i=a;continue}t+=a,r.push(o)}return{text:t,map:r}}function Ie(e){return _e(e).text}var Oe=["Collator","DateTimeFormat","DisplayNames","ListFormat","Locale","NumberFormat","PluralRules","RelativeTimeFormat","Segmenter"],Ne=(()=>{let e={Date,URL,URLSearchParams},t=Intl;for(let r of Oe)if(typeof t[r]==="function")e[`Intl_${r}`]=t[r];return Object.freeze(Object.assign(Object.create(null),e))})(),St=/^new(\s+)(Date|URLSearchParams|URL|Intl\s*\.\s*([A-Z_a-z]\w*))\s*\(/,Se=/(?<![\w$])new(?![\w$])/g,ke=`only new Date(), new URL(), new URLSearchParams() and new Intl.{${Oe.join(",")}}() are allowed`;function kt(e){let{text:t,map:r}=_e(e),i=[];Se.lastIndex=0;let s;while((s=Se.exec(t))!==null){let a=s.index;if(/(?<!\.)\.\s*$/.test(t.slice(0,a)))continue;let c=St.exec(t.slice(a)),g=c?.[3],l=!c?null:g?`Intl_${g}`:c[2];if(!c||!l||!(l in Ne))throw new S(`matched /${z.source}/; ${ke}`,e);let h=a+c[0].length,f=r[a],y=r[h-1]+1;if(e.slice(f,y)!==t.slice(a,h))throw new S(`matched /${z.source}/; ${ke}`,e);let b=f+3+c[1].length;i.push({start:b,end:b+c[2].length,key:l})}let o=e;for(let a=i.length-1;a>=0;a--){let c=i[a];o=`${o.slice(0,c.start)}${U}.${c.key}${o.slice(c.end)}`}return{source:o,usesSafeConstructors:i.length>0}}class S extends Error{rule;expression;constructor(e,t,r){super(r??`Potentially unsafe expression (${e}): ${t}`);this.name="UnsafeExpressionError",this.rule=e,this.expression=t}}function mo(e){try{return le(e),null}catch(t){return t instanceof S?t.rule:t instanceof Error?t.message:String(t)}}function Pe(e,t){let r=/[$A-Z_a-z][$\w]*/g,i;while((i=r.exec(e))!==null){let s=i[0],o=e[i.index-1];if(oe.has(s))throw new S(`matched /\\b${s}\\b/; identifier ${s}`,t);if(o==="."&&ae.has(s))throw new S(`matched /.${s}/; property ${s}`,t)}}function Me(e,t=!0){let r=/(?:[$\w)\].]|\?\.)\s*\[([^\]]*)\]/g,i=new Set,s;while((s=r.exec(e))!==null){let o=s.index+s[0].indexOf("["),a=e.slice(0,o);if(/(?:^|[^$\w])(?:let|const|var)\s*$/.test(a))continue;let c=s[1].trim(),g=/^'(?:[^'\\]|\\.)*'$/.test(c),l=/^"(?:[^"\\]|\\.)*"$/.test(c);if(/^\d+$/.test(c))continue;if(g||l){let f=c.slice(1,-1);if(ae.has(f))throw new S(`bracket key ${f}`,e);if(!Te.allowBracketNotation)throw new S("bracket notation with a string key; enable with configureSafeEvaluator({ allowBracketNotation: true })",e,`Bracket notation with strings not allowed: ${e}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);continue}if(t&&/^[$A-Z_a-z][$\w]*$/.test(c)){i.add(c);continue}throw new S("dynamic bracket notation is not allowed",e)}return[...i]}function le(e){let t=e.trim(),r=Ie(t);Pe(r,t);let i=Me(t);for(let s of se){if(s===z)continue;if(s.test(r))throw new S(`matched /${s.source}/`,t)}return{...kt(t),dynamicKeys:i}}function Zi(e){return le(e),e.trim()}var ho=Symbol("stx.sanitizeCache"),vt=4000,D=new Map;function $t(e){let t=D.get(e);if(t===void 0){if(t=se.some((r)=>r.test(e)),D.size>=vt)D.clear();D.set(e,t)}return t}function V(e){let t={},r=e[ho];t.Math=Math,t.JSON=JSON,t.Date=Date,t.String=String,t.Number=Number,t.Boolean=Boolean,t.Array=Array,t.Object=re,t.parseInt=Number.parseInt,t.parseFloat=Number.parseFloat,t.isNaN=Number.isNaN,t.isFinite=Number.isFinite,t.encodeURIComponent=encodeURIComponent,t.decodeURIComponent=decodeURIComponent;for(let[i,s]of Object.entries(e)){if(i.startsWith("__")||$t(i))continue;if(s&&typeof s==="object"&&!Array.isArray(s)){let o=r?.get(s);if(o===void 0)o=ie(s),r?.set(s,o);t[i]=o}else t[i]=s}return t}function ie(e,t=0){if(t>=Te.maxSanitizeDepth)return"[Object too deep]";if(e===null||typeof e!=="object")return e;if(Array.isArray(e))return e.map((i)=>ie(i,t+1));if(e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof Error)return e;let r={};for(let[i,s]of Object.entries(e)){if(i.startsWith("__")||i==="constructor"||i==="prototype")continue;if(s&&typeof s==="object")r[i]=ie(s,t+1);else r[i]=s}return r}function d(e,t){try{let r=V(t),i=Object.keys(r),s=Object.values(r);return p(e,i)(...s)}catch{return}}function m(e){try{return Zi(e),!0}catch{return!1}}var j=new Set;function Rt(e,t,r){if(!t.startsWith("__")||!(t in r))return;let i=`${t}\x00${e}`;if(j.has(i))return;if(j.add(i),j.size>500)j.clear();console.warn(`[stx] a condition reads \`${t}\`, which conditions cannot see, so \`${e.trim()}\` is false and nothing it guards is rendered. Names starting with \`__\` are withheld from @if, @elseif and @unless. Derive a plain value in the server script (for example \`const hasRows = ${t}.length > 0\`) and test that instead.`)}function Il(e,t){try{let r=V(t),i=Object.keys(r),s=Object.values(r),o=!1,c=p(e,i,(g)=>{o=!0,Rt(e,g,t)})(...s);return!o&&Boolean(c)}catch{return!1}}function M(e,t){try{let r=d(e,t);if(r&&typeof r==="object"&&!Array.isArray(r))return r;return{}}catch{return{}}}var Fe=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","yield","let","static","implements","interface","package","private","protected","public","arguments","eval","await"]),ve=`stx-compile-probe:${globalThis.crypto.randomUUID()}`,Ct=0,Tt=0;function At(e,t){let r="__stx_compile_probe";while(e.includes(r))r+="_";let i=Array.from({length:e.length+1});i[e.length]=ve;for(let s=0;s<16;s++){let o=`c${++Ct}`,a=`'use strict';if(${r}===${JSON.stringify(ve)})return ${JSON.stringify(o)};`,c=Function(...e,r,a+t);if(c(...i)===o)return c;Tt++}throw Error("[stx] the JavaScript runtime repeatedly returned code compiled from a different source; refusing to evaluate with it.")}var _t=2000,B=new Map;function $e(e,t){let r=`${e.join(",")}\x00${t}`,i=B.get(r);if(i)return i;let s=At(e,t);if(B.size>=_t)B.clear();return B.set(r,s),s}function Ee(e){return e.replace(/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*`/g," ").replace(/\??\.\s*[a-zA-Z_$][\w$]*/g," ").replace(/([{,]\s*)[a-zA-Z_$][\w$]*(\s*:)/g,"$1$2").match(/\b[a-zA-Z_$][\w$]*\b/g)||[]}var It=/^[A-Za-z_$][\w$]*$/;function Ur(e){return It.test(e)&&!Fe.has(e)}var Re=new T(2000,{maxBytes:2097152,sizeOf:(e)=>e.sourceBytes});function p(e,t,r){let i=JSON.stringify([e,t]),s=Re.get(i);if(!s)s=Ot(e,[...t]),s.sourceBytes+=i.length*2,Re.set(i,s);return Nt(Lt(s.buildFunc,s.filteredKeys,s.contextKeys,s.validEntries,s.validIndices,r),s.contextKeys,s.dynamicKeys)}function Ot(e,t){let{source:r,usesSafeConstructors:i,dynamicKeys:s}=le(e),o=[];for(let f=0;f<t.length;f++){if(!Ur(t[f]))continue;if(t[f]===U||t[f]==="Object"||oe.has(t[f]))continue;o.push({key:t[f],index:f})}o.sort((f,y)=>f.key<y.key?-1:1);let a=o.map((f)=>f.key),c=o.map((f)=>f.index),g=`
30
+ `)this.line++,this.column=0;else this.column++;this.pos++}}peek(e){return this.source[this.pos+e]}saveState(){return{pos:this.pos,line:this.line,column:this.column}}restoreState(e){this.pos=e.pos,this.line=e.line,this.column=e.column}}function _(e,t,r,i=0){let s=0,o=i,a=null,c=0,g=!1;while(o<e.length){let l=e[o];if(a&&g){g=!1,o++;continue}if(a&&l==="\\"){g=!0,o++;continue}if(g=!1,(l==='"'||l==="'"||l==="`")&&!a){a=l,o++;continue}if(l===a&&a!=="`"){a=null,o++;continue}if(a==="`"&&l==="$"&&e[o+1]==="{"){c++,o+=2;continue}if(c>0&&l==="}"){c--,o++;continue}if(l==="`"&&a==="`"&&c===0){a=null,o++;continue}if(a){o++;continue}if(l===t)s++;else if(l===r){if(s--,s===0)return o}o++}return-1}function Ml(e,t){let r=t,i={paren:0,bracket:0,brace:0},s=null,o=0;while(r<e.length){let a=e[r];if((r>0?e[r-1]:"")==="\\"&&s){r++;continue}if((a==='"'||a==="'")&&!s){s=a,r++;continue}if(a===s&&s!=="`"){s=null,r++;continue}if(a==="`"&&!s){s="`",r++;continue}if(a==="`"&&s==="`"&&o===0){s=null,r++;continue}if(s==="`"&&a==="$"&&e[r+1]==="{"){o++,r+=2;continue}if(o>0){if(a==="{")o++;else if(a==="}")o--;r++;continue}if(s){r++;continue}if(i.paren===0&&i.bracket===0&&i.brace===0){if(e.slice(r,r+2)==="}}"||e.slice(r,r+3)==="!!}")break;if(a===","||a===";")break}if(a==="(")i.paren++;else if(a===")"){if(i.paren--,i.paren<0)break}else if(a==="[")i.bracket++;else if(a==="]"){if(i.bracket--,i.bracket<0)break}else if(a==="{")i.brace++;else if(a==="}"){if(i.brace--,i.brace<0)break}r++}return{expression:e.slice(t,r),endPos:r}}var xt={maxSanitizeDepth:10,allowBracketNotation:!1},Te={...xt};var z=/\bnew\s+/,U="__stx_safe_ctors",Ae=["Bun","Deno","Buffer","fetch","atob","btoa","console","Response","Request","Headers","WebAssembly","structuredClone","queueMicrotask","crypto","performance","navigator","Worker","WebSocket","BroadcastChannel","EventSource","XMLHttpRequest","localStorage","sessionStorage"],ee=[...Ae,"Function","setTimeout","setInterval","setImmediate","process","require","exports","module","window","document","global","globalThis","Reflect","Proxy","Symbol","WeakMap","WeakSet","WeakRef","FinalizationRegistry"],we=ee.map(()=>{return}),re=Object.freeze(Object.assign(Object.create(null),{keys:Object.keys,values:Object.values,entries:Object.entries,fromEntries:Object.fromEntries,assign:Object.assign,hasOwn:Object.hasOwn,is:Object.is})),se=[/\b(eval|Function|setTimeout|setInterval|setImmediate)\b/,/\b(process|require|import|exports|module)\b/,/\b(window|document|global|globalThis)\b/,/\b(constructor|prototype|__proto__)\b/,/\b(Reflect|Proxy)\b/,/\bSymbol\b/,/\b(WeakMap|WeakSet|WeakRef|FinalizationRegistry)\b/,/\b(Generator|AsyncGenerator)\b/,/__\w+__/,/\.(bind|call|apply)\s*\(/,z,/\bdelete\s+/,/\bthis\b/,/\\u(?:\{[\dA-Fa-f]+\}|[\dA-Fa-f]{4})/],oe=new Set([...Ae,"eval","Function","setTimeout","setInterval","setImmediate","process","require","import","exports","module","window","document","global","globalThis","constructor","prototype","Reflect","Proxy","Symbol","WeakMap","WeakSet","WeakRef","FinalizationRegistry","Generator","AsyncGenerator","delete","this",U]),ae=new Set(["__proto__","constructor","prototype"]);function _e(e){let t="",r=[],i=null,s=!1;for(let o=0;o<e.length;o++){let a=e[o];if(s){s=!1;continue}if(a==="\\"&&i){s=!0;continue}if(i){if(i==="`"&&a==="$"&&o+1<e.length&&e[o+1]==="{"){let c=1;o+=2;while(o<e.length&&c>0){if(e[o]==="{")c++;else if(e[o]==="}")c--;if(c>0)t+=e[o],r.push(o),o++}continue}if(a===i)i=null;continue}if(a==='"'||a==="'"||a==="`"){i=a;continue}t+=a,r.push(o)}return{text:t,map:r}}function Ie(e){return _e(e).text}var Oe=["Collator","DateTimeFormat","DisplayNames","ListFormat","Locale","NumberFormat","PluralRules","RelativeTimeFormat","Segmenter"],Ne=(()=>{let e={Date,URL,URLSearchParams},t=Intl;for(let r of Oe)if(typeof t[r]==="function")e[`Intl_${r}`]=t[r];return Object.freeze(Object.assign(Object.create(null),e))})(),St=/^new(\s+)(Date|URLSearchParams|URL|Intl\s*\.\s*([A-Z_a-z]\w*))\s*\(/,Se=/(?<![\w$])new(?![\w$])/g,ke=`only new Date(), new URL(), new URLSearchParams() and new Intl.{${Oe.join(",")}}() are allowed`;function kt(e){let{text:t,map:r}=_e(e),i=[];Se.lastIndex=0;let s;while((s=Se.exec(t))!==null){let a=s.index;if(/(?<!\.)\.\s*$/.test(t.slice(0,a)))continue;let c=St.exec(t.slice(a)),g=c?.[3],l=!c?null:g?`Intl_${g}`:c[2];if(!c||!l||!(l in Ne))throw new S(`matched /${z.source}/; ${ke}`,e);let h=a+c[0].length,f=r[a],y=r[h-1]+1;if(e.slice(f,y)!==t.slice(a,h))throw new S(`matched /${z.source}/; ${ke}`,e);let b=f+3+c[1].length;i.push({start:b,end:b+c[2].length,key:l})}let o=e;for(let a=i.length-1;a>=0;a--){let c=i[a];o=`${o.slice(0,c.start)}${U}.${c.key}${o.slice(c.end)}`}return{source:o,usesSafeConstructors:i.length>0}}class S extends Error{rule;expression;constructor(e,t,r){super(r??`Potentially unsafe expression (${e}): ${t}`);this.name="UnsafeExpressionError",this.rule=e,this.expression=t}}function mo(e){try{return le(e),null}catch(t){return t instanceof S?t.rule:t instanceof Error?t.message:String(t)}}function Pe(e,t){let r=/[$A-Z_a-z][$\w]*/g,i;while((i=r.exec(e))!==null){let s=i[0],o=e[i.index-1];if(oe.has(s))throw new S(`matched /\\b${s}\\b/; identifier ${s}`,t);if(o==="."&&ae.has(s))throw new S(`matched /.${s}/; property ${s}`,t)}}function Me(e,t=!0){let r=/(?:[$\w)\].]|\?\.)\s*\[([^\]]*)\]/g,i=new Set,s;while((s=r.exec(e))!==null){let o=s.index+s[0].indexOf("["),a=e.slice(0,o);if(/(?:^|[^$\w])(?:let|const|var)\s*$/.test(a))continue;let c=s[1].trim(),g=/^'(?:[^'\\]|\\.)*'$/.test(c),l=/^"(?:[^"\\]|\\.)*"$/.test(c);if(/^\d+$/.test(c))continue;if(g||l){let f=c.slice(1,-1);if(ae.has(f))throw new S(`bracket key ${f}`,e);if(!Te.allowBracketNotation)throw new S("bracket notation with a string key; enable with configureSafeEvaluator({ allowBracketNotation: true })",e,`Bracket notation with strings not allowed: ${e}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);continue}if(t&&/^[$A-Z_a-z][$\w]*$/.test(c)){i.add(c);continue}throw new S("dynamic bracket notation is not allowed",e)}return[...i]}function le(e){let t=e.trim(),r=Ie(t);Pe(r,t);let i=Me(t);for(let s of se){if(s===z)continue;if(s.test(r))throw new S(`matched /${s.source}/`,t)}return{...kt(t),dynamicKeys:i}}function Zi(e){return le(e),e.trim()}var ho=Symbol("stx.sanitizeCache"),vt=4000,D=new Map;function $t(e){let t=D.get(e);if(t===void 0){if(t=se.some((r)=>r.test(e)),D.size>=vt)D.clear();D.set(e,t)}return t}function V(e){let t={},r=e[ho];t.Math=Math,t.JSON=JSON,t.Date=Date,t.String=String,t.Number=Number,t.Boolean=Boolean,t.Array=Array,t.Object=re,t.parseInt=Number.parseInt,t.parseFloat=Number.parseFloat,t.isNaN=Number.isNaN,t.isFinite=Number.isFinite,t.encodeURIComponent=encodeURIComponent,t.decodeURIComponent=decodeURIComponent;for(let[i,s]of Object.entries(e)){if(i.startsWith("__")||$t(i))continue;if(s&&typeof s==="object"&&!Array.isArray(s)){let o=r?.get(s);if(o===void 0)o=ie(s),r?.set(s,o);t[i]=o}else t[i]=s}return t}function ie(e,t=0){if(t>=Te.maxSanitizeDepth)return"[Object too deep]";if(e===null||typeof e!=="object")return e;if(Array.isArray(e))return e.map((i)=>ie(i,t+1));if(e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof Error)return e;let r={};for(let[i,s]of Object.entries(e)){if(i.startsWith("__")||i==="constructor"||i==="prototype")continue;if(s&&typeof s==="object")r[i]=ie(s,t+1);else r[i]=s}return r}function d(e,t){try{let r=V(t),i=Object.keys(r),s=Object.values(r);return p(e,i)(...s)}catch{return}}function m(e){try{return Zi(e),!0}catch{return!1}}var j=new Set;function Rt(e,t,r){if(!t.startsWith("__")||!(t in r))return;let i=`${t}\x00${e}`;if(j.has(i))return;if(j.add(i),j.size>500)j.clear();console.warn(`[stx] a condition reads \`${t}\`, which conditions cannot see, so \`${e.trim()}\` is false and nothing it guards is rendered. Names starting with \`__\` are withheld from @if, @elseif and @unless. Derive a plain value in the server script (for example \`const hasRows = ${t}.length > 0\`) and test that instead.`)}function Nl(e,t){try{let r=V(t),i=Object.keys(r),s=Object.values(r),o=!1,c=p(e,i,(g)=>{o=!0,Rt(e,g,t)})(...s);return!o&&Boolean(c)}catch{return!1}}function M(e,t){try{let r=d(e,t);if(r&&typeof r==="object"&&!Array.isArray(r))return r;return{}}catch{return{}}}var Fe=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","yield","let","static","implements","interface","package","private","protected","public","arguments","eval","await"]),ve=`stx-compile-probe:${globalThis.crypto.randomUUID()}`,Ct=0,Tt=0;function At(e,t){let r="__stx_compile_probe";while(e.includes(r))r+="_";let i=Array.from({length:e.length+1});i[e.length]=ve;for(let s=0;s<16;s++){let o=`c${++Ct}`,a=`'use strict';if(${r}===${JSON.stringify(ve)})return ${JSON.stringify(o)};`,c=Function(...e,r,a+t);if(c(...i)===o)return c;Tt++}throw Error("[stx] the JavaScript runtime repeatedly returned code compiled from a different source; refusing to evaluate with it.")}var _t=2000,B=new Map;function $e(e,t){let r=`${e.join(",")}\x00${t}`,i=B.get(r);if(i)return i;let s=At(e,t);if(B.size>=_t)B.clear();return B.set(r,s),s}function Ee(e){return e.replace(/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*`/g," ").replace(/\??\.\s*[a-zA-Z_$][\w$]*/g," ").replace(/([{,]\s*)[a-zA-Z_$][\w$]*(\s*:)/g,"$1$2").match(/\b[a-zA-Z_$][\w$]*\b/g)||[]}var It=/^[A-Za-z_$][\w$]*$/;function Ur(e){return It.test(e)&&!Fe.has(e)}var Re=new T(2000,{maxBytes:2097152,sizeOf:(e)=>e.sourceBytes});function p(e,t,r){let i=JSON.stringify([e,t]),s=Re.get(i);if(!s)s=Ot(e,[...t]),s.sourceBytes+=i.length*2,Re.set(i,s);return Nt(Lt(s.buildFunc,s.filteredKeys,s.contextKeys,s.validEntries,s.validIndices,r),s.contextKeys,s.dynamicKeys)}function Ot(e,t){let{source:r,usesSafeConstructors:i,dynamicKeys:s}=le(e),o=[];for(let f=0;f<t.length;f++){if(!Ur(t[f]))continue;if(t[f]===U||t[f]==="Object"||oe.has(t[f]))continue;o.push({key:t[f],index:f})}o.sort((f,y)=>f.key<y.key?-1:1);let a=o.map((f)=>f.key),c=o.map((f)=>f.index),g=`
31
31
  'use strict';
32
32
  try {
33
33
  return ${r};
@@ -44,10 +44,10 @@ catch (e) {
44
44
  `)o++;continue}if(c==="x"||c==="u"){let g=c==="u"&&t[o+1]==="{",l=g?t.indexOf("}",o+2):o+(c==="x"?2:4)+1,h=t.slice(o+(g?2:1),l);if(l<0||l>=t.length||!/^[\da-f]+$/i.test(h)||!g&&h.length!==(c==="x"?2:4))return null;let f=Number.parseInt(h,16);if(f>1114111)return null;i+=String.fromCodePoint(f),o=g?l:l-1;continue}i+=Object.hasOwn(s,c)?s[c]:c;continue}if(a===r||r!=="`"&&(a===`
45
45
  `||a==="\r"))return null;if(r==="`"&&a==="$"&&t[o+1]==="{")return null;if(r==="`"&&a==="\r"){if(t[o+1]===`
46
46
  `)o++;i+=`
47
- `}else i+=a}return i}var Pt=new Set(["true","false","null","undefined","typeof","void","new","in","of","instanceof","this","delete","await","async","function","return","NaN","Infinity"]);function Qt(e,t){let r=e.trim();if(!r)return{ok:!1,message:"the argument is empty",code:n.INVALID_DIRECTIVE_SYNTAX};let i=mo(r);if(i)return{ok:!1,message:`the expression is not allowed (${i})`,code:n.UNSAFE_EXPRESSION};let s=V(t),o;try{o=p(r,Object.keys(s))(...Object.values(s))}catch(c){return{ok:!1,message:`the expression could not be evaluated: ${c instanceof Error?c.message:String(c)}`,code:n.EVALUATION_ERROR}}if(o!==void 0&&o!==null)return{ok:!0,value:o};let a=[...new Set(Ee(r))].filter((c)=>!Pt.has(c)&&!(c in s)&&!(c in globalThis));if(a.length>0)return{ok:!1,message:`${a.map((g)=>`"${g}"`).join(", ")} ${a.length===1?"is":"are"} not defined here. Values a directive reads must come from <script server> or the render context; a plain <script> runs in the browser. To pass literal text, quote it.`,code:n.UNDEFINED_VARIABLE};if(o===void 0&&(r.startsWith("{")||r.startsWith("[")))return{ok:!1,message:"the expression threw while it was evaluated",code:n.EVALUATION_ERROR};return{ok:!0,value:o}}function tt(e){if(e===null)return"null";if(Array.isArray(e))return"an array";if(typeof e==="object")return"an object";if(typeof e==="string")return`a string ("${e.length>40?`${e.slice(0,40)}...`:e}")`;return`${/^[aeiou]/.test(typeof e)?"an":"a"} ${typeof e}`}function bt(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Be(e){if(!e)return"";return je.isAbsolute(e)?je.relative(process.cwd(),e)||e:e}function ue(e){let t=e.replace(/\s+/g," ").trim();return t.length>80?`${t.slice(0,77)}...`:t}function H(e,t,r,i,s=n.EVALUATION_ERROR){let o=i?` in ${Be(i)}`:"";return console.warn(`[stx] ${ue(t)}${o}: ${r}`),u(e,`${ue(t)}: ${r}`,s)}function bo(e,t,r){let i=r?` in ${Be(r)}`:"";console.warn(`[stx] ${ue(e)}${i}: ${t}`)}function ta(){return{afterOpen:[],beforeClose:[]}}function Mt(e){return e.afterOpen.length>0||e.beforeClose.length>0}function Nl(e,t){if(!Mt(t))return e;let r=t.afterOpen.join(""),i=t.beforeClose.join(""),s=L(e),o=r?Wr(e):null,a=i&&s!==-1?s:null;if(o===null&&a===null)return e;if(o!==null&&a!==null)return`${e.slice(0,o)}${r}${e.slice(o,a)}${i}${e.slice(a)}`;if(o!==null)return`${e.slice(0,o)}${r}${e.slice(o)}`;return`${e.slice(0,a)}${i}${e.slice(a)}`}var ze=/\s*<meta\b[^>]*\bcharset\b[^>]*>/iy;function Wr(e){let t=/<head\b[^>]*>/i.exec(e);if(!t)return null;let r=t.index+t[0].length;ze.lastIndex=r;let i=ze.exec(e);return i?r+i[0].length:r}var pe="data-stx-color-mode-boot",He="__STX_COLOR_MODE__",Ft=new Set(["light","dark","auto","system"]),Dt=new Set(["auto","system"]),jt=/^[a-z][\w:-]*$/i,Bt=/^[\w-]+$/;function zt(e){let t=e.storageKey??"stx-color-mode",r=e.initialMode??"auto",i=e.darkClass===void 0?"dark":e.darkClass,s=e.attribute??null,o=e.autoValue??null,a=e.respectExisting===!0;if(typeof t!=="string"||t.length===0)throw Error("colorMode.storageKey must be a non-empty string");if(!Ft.has(r))throw Error(`colorMode.initialMode must be one of light, dark, auto, system \u2014 got ${JSON.stringify(r)}`);if(i!==null&&(typeof i!=="string"||!Bt.test(i)))throw Error(`colorMode.darkClass must be a single CSS class name, or null to opt out \u2014 got ${JSON.stringify(i)}`);if(s!==null&&(typeof s!=="string"||!jt.test(s)))throw Error(`colorMode.attribute must be a valid HTML attribute name \u2014 got ${JSON.stringify(s)}`);if(o!==null&&!Dt.has(o))throw Error(`colorMode.autoValue must be 'auto' or 'system' \u2014 got ${JSON.stringify(o)}`);if(i===null&&s===null)throw Error("colorMode needs at least one of darkClass or attribute \u2014 with both null nothing would mark the mode on <html>");if(a&&s===null)throw Error("colorMode.respectExisting needs an attribute to read \u2014 the dark class alone cannot say whether a mode was chosen");return{storageKey:t,initialMode:r==="system"?"auto":r,darkClass:i,attribute:s,autoValue:o,respectExisting:a}}function Ht(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function fe(e={}){let t=zt(e),r=Ht(t),i=`(function(){"use strict";var o=window.${He};if(o&&typeof o.sync==="function"){o.sync();return}var c=${r};var r=document.documentElement;function read(){var p=c.initialMode,a=c.autoValue;try{var v=localStorage.getItem(c.storageKey);if(v==="light"||v==="dark"){p=v}else if(v==="auto"||v==="system"){p="auto";if(!a)a=v}}catch(e){}return{p:p,a:a}}function sys(){try{return matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){return"light"}}function stamp(m){if(c.attribute)r.setAttribute(c.attribute,m);if(c.darkClass){if(m==="dark")r.classList.add(c.darkClass);else r.classList.remove(c.darkClass)}}var s=read();var f=null;if(c.respectExisting&&c.attribute){var x=r.getAttribute(c.attribute);if(x==="light"||x==="dark")f=x}var m=f||(s.p==="auto"?sys():s.p);var p=s.p;stamp(m);var g=null;function sync(){var t=read(),n=f||(t.p==="auto"?sys():t.p);var moved=n!==m,chose=t.p!==p;if(moved){r.style.setProperty("transition","none","important");stamp(n);void r.offsetHeight;r.style.removeProperty("transition")}else stamp(n);m=n;p=t.p;if(g){g.mode=n;g.preference=t.p;if(t.a)g.autoValue=t.a}if(moved||chose){try{window.dispatchEvent(new CustomEvent("stx:color-mode",{detail:{mode:n,preference:t.p}}))}catch(e){}}}try{g=window.${He}={storageKey:c.storageKey,initialMode:c.initialMode,darkClass:c.darkClass,attribute:c.attribute,autoValue:s.a||"auto",respectExisting:c.respectExisting,forced:f,preference:p,mode:m,watching:true,sync:sync}}catch(e){}try{var q=matchMedia("(prefers-color-scheme: dark)");if(q.addEventListener)q.addEventListener("change",sync);else if(q.addListener)q.addListener(sync)}catch(e){}try{addEventListener("pageshow",sync);addEventListener("storage",function(e){if(e.key===null||e.key===c.storageKey)sync()});document.addEventListener("visibilitychange",function(){if(document.visibilityState==="visible")sync()})}catch(e){}}());`;return`<script ${pe}>${i}</script>`}function qr(e,t={}){if(e.includes(pe))return e;let r=ge(e);if(r===null)return e;let i=fe(t);return`${e.slice(0,r)}
47
+ `}else i+=a}return i}var Pt=new Set(["true","false","null","undefined","typeof","void","new","in","of","instanceof","this","delete","await","async","function","return","NaN","Infinity"]);function Qt(e,t){let r=e.trim();if(!r)return{ok:!1,message:"the argument is empty",code:n.INVALID_DIRECTIVE_SYNTAX};let i=mo(r);if(i)return{ok:!1,message:`the expression is not allowed (${i})`,code:n.UNSAFE_EXPRESSION};let s=V(t),o;try{o=p(r,Object.keys(s))(...Object.values(s))}catch(c){return{ok:!1,message:`the expression could not be evaluated: ${c instanceof Error?c.message:String(c)}`,code:n.EVALUATION_ERROR}}if(o!==void 0&&o!==null)return{ok:!0,value:o};let a=[...new Set(Ee(r))].filter((c)=>!Pt.has(c)&&!(c in s)&&!(c in globalThis));if(a.length>0)return{ok:!1,message:`${a.map((g)=>`"${g}"`).join(", ")} ${a.length===1?"is":"are"} not defined here. Values a directive reads must come from <script server> or the render context; a plain <script> runs in the browser. To pass literal text, quote it.`,code:n.UNDEFINED_VARIABLE};if(o===void 0&&(r.startsWith("{")||r.startsWith("[")))return{ok:!1,message:"the expression threw while it was evaluated",code:n.EVALUATION_ERROR};return{ok:!0,value:o}}function tt(e){if(e===null)return"null";if(Array.isArray(e))return"an array";if(typeof e==="object")return"an object";if(typeof e==="string")return`a string ("${e.length>40?`${e.slice(0,40)}...`:e}")`;return`${/^[aeiou]/.test(typeof e)?"an":"a"} ${typeof e}`}function bt(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Be(e){if(!e)return"";return je.isAbsolute(e)?je.relative(process.cwd(),e)||e:e}function ue(e){let t=e.replace(/\s+/g," ").trim();return t.length>80?`${t.slice(0,77)}...`:t}function H(e,t,r,i,s=n.EVALUATION_ERROR){let o=i?` in ${Be(i)}`:"";return console.warn(`[stx] ${ue(t)}${o}: ${r}`),u(e,`${ue(t)}: ${r}`,s)}function bo(e,t,r){let i=r?` in ${Be(r)}`:"";console.warn(`[stx] ${ue(e)}${i}: ${t}`)}function ta(){return{afterOpen:[],beforeClose:[]}}function Mt(e){return e.afterOpen.length>0||e.beforeClose.length>0}function Dl(e,t){if(!Mt(t))return e;let r=t.afterOpen.join(""),i=t.beforeClose.join(""),s=L(e),o=r?Wr(e):null,a=i&&s!==-1?s:null;if(o===null&&a===null)return e;if(o!==null&&a!==null)return`${e.slice(0,o)}${r}${e.slice(o,a)}${i}${e.slice(a)}`;if(o!==null)return`${e.slice(0,o)}${r}${e.slice(o)}`;return`${e.slice(0,a)}${i}${e.slice(a)}`}var ze=/\s*<meta\b[^>]*\bcharset\b[^>]*>/iy;function Wr(e){let t=/<head\b[^>]*>/i.exec(e);if(!t)return null;let r=t.index+t[0].length;ze.lastIndex=r;let i=ze.exec(e);return i?r+i[0].length:r}var pe="data-stx-color-mode-boot",He="__STX_COLOR_MODE__",Ft=new Set(["light","dark","auto","system"]),Dt=new Set(["auto","system"]),jt=/^[a-z][\w:-]*$/i,Bt=/^[\w-]+$/;function zt(e){let t=e.storageKey??"stx-color-mode",r=e.initialMode??"auto",i=e.darkClass===void 0?"dark":e.darkClass,s=e.attribute??null,o=e.autoValue??null,a=e.respectExisting===!0;if(typeof t!=="string"||t.length===0)throw Error("colorMode.storageKey must be a non-empty string");if(!Ft.has(r))throw Error(`colorMode.initialMode must be one of light, dark, auto, system \u2014 got ${JSON.stringify(r)}`);if(i!==null&&(typeof i!=="string"||!Bt.test(i)))throw Error(`colorMode.darkClass must be a single CSS class name, or null to opt out \u2014 got ${JSON.stringify(i)}`);if(s!==null&&(typeof s!=="string"||!jt.test(s)))throw Error(`colorMode.attribute must be a valid HTML attribute name \u2014 got ${JSON.stringify(s)}`);if(o!==null&&!Dt.has(o))throw Error(`colorMode.autoValue must be 'auto' or 'system' \u2014 got ${JSON.stringify(o)}`);if(i===null&&s===null)throw Error("colorMode needs at least one of darkClass or attribute \u2014 with both null nothing would mark the mode on <html>");if(a&&s===null)throw Error("colorMode.respectExisting needs an attribute to read \u2014 the dark class alone cannot say whether a mode was chosen");return{storageKey:t,initialMode:r==="system"?"auto":r,darkClass:i,attribute:s,autoValue:o,respectExisting:a}}function Ht(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function fe(e={}){let t=zt(e),r=Ht(t),i=`(function(){"use strict";var o=window.${He};if(o&&typeof o.sync==="function"){o.sync();return}var c=${r};var r=document.documentElement;function read(){var p=c.initialMode,a=c.autoValue;try{var v=localStorage.getItem(c.storageKey);if(v==="light"||v==="dark"){p=v}else if(v==="auto"||v==="system"){p="auto";if(!a)a=v}}catch(e){}return{p:p,a:a}}function sys(){try{return matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){return"light"}}function stamp(m){if(c.attribute)r.setAttribute(c.attribute,m);if(c.darkClass){if(m==="dark")r.classList.add(c.darkClass);else r.classList.remove(c.darkClass)}}var s=read();var f=null;if(c.respectExisting&&c.attribute){var x=r.getAttribute(c.attribute);if(x==="light"||x==="dark")f=x}var m=f||(s.p==="auto"?sys():s.p);var p=s.p;stamp(m);var g=null;function sync(){var t=read(),n=f||(t.p==="auto"?sys():t.p);var moved=n!==m,chose=t.p!==p;if(moved){r.style.setProperty("transition","none","important");stamp(n);void r.offsetHeight;r.style.removeProperty("transition")}else stamp(n);m=n;p=t.p;if(g){g.mode=n;g.preference=t.p;if(t.a)g.autoValue=t.a}if(moved||chose){try{window.dispatchEvent(new CustomEvent("stx:color-mode",{detail:{mode:n,preference:t.p}}))}catch(e){}}}try{g=window.${He}={storageKey:c.storageKey,initialMode:c.initialMode,darkClass:c.darkClass,attribute:c.attribute,autoValue:s.a||"auto",respectExisting:c.respectExisting,forced:f,preference:p,mode:m,watching:true,sync:sync}}catch(e){}try{var q=matchMedia("(prefers-color-scheme: dark)");if(q.addEventListener)q.addEventListener("change",sync);else if(q.addListener)q.addListener(sync)}catch(e){}try{addEventListener("pageshow",sync);addEventListener("storage",function(e){if(e.key===null||e.key===c.storageKey)sync()});document.addEventListener("visibilitychange",function(){if(document.visibilityState==="visible")sync()})}catch(e){}}());`;return`<script ${pe}>${i}</script>`}function qr(e,t={}){if(e.includes(pe))return e;let r=ge(e);if(r===null)return e;let i=fe(t);return`${e.slice(0,r)}
48
48
  ${i}${e.slice(r)}`}var ge=Wr,Ut=new RegExp(`<script\\b[^>]*\\b${pe}\\b[^>]*>[\\s\\S]*?<\\/script>`,"i"),Ue=/<meta\b[^>]*\bcharset\b[^>]*>/gi,Ve=/<\/head>/gi;function Vt(e){let t=/<head\b[^>]*>/i.exec(e);if(!t)return e;let r=t.index+t[0].length;Ve.lastIndex=r;let i=Ve.exec(e),s=i?i.index:e.length;Ue.lastIndex=r;let o=Ue.exec(e);if(!o||o.index>=s)return e;if(e.slice(r,o.index).trim()==="")return e;let a=o.index+o[0].length;return`${e.slice(0,r)}
49
- ${o[0]}${e.slice(r,o.index)}${e.slice(a,s)}${e.slice(s)}`}function Ml(e){return Wt(Vt(e))}function Wt(e){let t=Ut.exec(e);if(!t)return e;let r=ge(e);if(r===null)return e;if(t.index<=r||e.slice(r,t.index).trim()==="")return e;let i=e.slice(0,t.index)+e.slice(t.index+t[0].length),s=ge(i);if(s===null)return e;return`${i.slice(0,s)}
50
- ${t[0]}${i.slice(s)}`}var Kt="[data-stx-component-wrapper]:not([stx-hydrate]){display:contents}",Xe=`<style data-stx-cloak>[x-cloak]{display:none !important}${Kt}</style>`,W="data-stx-html-attrs",X="data-stx-html-class",qe=/^[A-Za-z_:][\w:.-]*$/;function k(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Xt(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function wt(e){if(e.name)return`name="${e.name}"`;if(e.property)return`property="${e.property}"`;if(e.charset!=null)return"charset=";if(e["http-equiv"])return`http-equiv="${e["http-equiv"]}"`;return""}function qt(e){let t=/^\s*<meta\b([^>]*)>/i.exec(e);if(!t)return null;let r={};for(let i of t[1].matchAll(/([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g))r[i[1].toLowerCase()]=i[2]??i[3]??i[4]??"";return r}function A(e,t){return Object.entries(e).filter(([r])=>!t?.(r)).map(([r,i])=>`${r}="${k(String(i))}"`).join(" ")}function q(e){let t=String(e.content),r=typeof e.type==="string"?e.type.trim().toLowerCase():"";return/json$|^importmap$/.test(r)?t.replace(/<\//g,"<\\/"):t}function Ge(e){let t=A(e,(r)=>r==="content");return`<script${t?` ${t}`:""}>${q(e)}</script>`}function Gt(e={},t="en"){let r=[],i=[],s="",o=t;for(let[c,g]of Object.entries(e||{})){if(g==null)continue;let l=c.trim();if(!qe.test(l))continue;let h=l.toLowerCase();if(h==="lang"){o=String(g);continue}if(h==="class"){s=String(g).trim();continue}r.push(` ${l}="${k(String(g))}"`),i.push(l)}let a=` lang="${k(o)}"`;if(s)a+=` class="${k(s)}"`;if(a+=r.join(""),s)a+=` ${X}="${k(s)}"`;if(i.length)a+=` ${W}="${k(i.join(" "))}"`;return a}function Dl(e={},t={}){let r={...e,...t};if(e.class&&t.class){let i=e.class.split(/\s+/).filter(Boolean);for(let s of t.class.split(/\s+/).filter(Boolean))if(!i.includes(s))i.push(s);r.class=i.join(" ")}return r}function Kr(e,t={}){if(!t||Object.keys(t).length===0)return e;let r=e.match(/<html\b([^>]*)>/i);if(!r)return e;let i={},s=[],o=/([A-Za-z_:][\w:.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,a;while((a=o.exec(r[1]))!==null){let h=a[1];if(!(h in i))s.push(h);i[h]=a[2]??a[3]??a[4]??""}let c=[],g=[];for(let[h,f]of Object.entries(t)){if(f==null)continue;let y=h.trim();if(!qe.test(y))continue;let b=y.toLowerCase();if(b==="class"){let w=(i.class||"").split(/\s+/).filter(Boolean);for(let x of String(f).split(/\s+/).filter(Boolean))if(!w.includes(x))w.push(x),c.push(x);if(!("class"in i))s.push("class");i.class=w.join(" ");continue}if(!(y in i))s.push(y);if(i[y]=String(f),b!=="lang")g.push(y)}if(c.length){if(!(X in i))s.push(X);i[X]=c.join(" ")}if(g.length){if(!(W in i))s.push(W);i[W]=g.join(" ")}let l=s.map((h)=>` ${h}="${k(i[h])}"`).join("");return e.replace(r[0],()=>`<html${l}>`)}function Ll(e){if(e.includes("data-stx-cloak"))return null;if(L(e)===-1)return null;return`${Xe}
49
+ ${o[0]}${e.slice(r,o.index)}${e.slice(a,s)}${e.slice(s)}`}function Ll(e){return Wt(Vt(e))}function Wt(e){let t=Ut.exec(e);if(!t)return e;let r=ge(e);if(r===null)return e;if(t.index<=r||e.slice(r,t.index).trim()==="")return e;let i=e.slice(0,t.index)+e.slice(t.index+t[0].length),s=ge(i);if(s===null)return e;return`${i.slice(0,s)}
50
+ ${t[0]}${i.slice(s)}`}var Kt="[data-stx-component-wrapper]:not([stx-hydrate]){display:contents}",Xe=`<style data-stx-cloak>[x-cloak]{display:none !important}${Kt}</style>`,W="data-stx-html-attrs",X="data-stx-html-class",qe=/^[A-Za-z_:][\w:.-]*$/;function k(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Xt(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function wt(e){if(e.name)return`name="${e.name}"`;if(e.property)return`property="${e.property}"`;if(e.charset!=null)return"charset=";if(e["http-equiv"])return`http-equiv="${e["http-equiv"]}"`;return""}function qt(e){let t=/^\s*<meta\b([^>]*)>/i.exec(e);if(!t)return null;let r={};for(let i of t[1].matchAll(/([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g))r[i[1].toLowerCase()]=i[2]??i[3]??i[4]??"";return r}function A(e,t){return Object.entries(e).filter(([r])=>!t?.(r)).map(([r,i])=>`${r}="${k(String(i))}"`).join(" ")}function q(e){let t=String(e.content),r=typeof e.type==="string"?e.type.trim().toLowerCase():"";return/json$|^importmap$/.test(r)?t.replace(/<\//g,"<\\/"):t}function Ge(e){let t=A(e,(r)=>r==="content");return`<script${t?` ${t}`:""}>${q(e)}</script>`}function Gt(e={},t="en"){let r=[],i=[],s="",o=t;for(let[c,g]of Object.entries(e||{})){if(g==null)continue;let l=c.trim();if(!qe.test(l))continue;let h=l.toLowerCase();if(h==="lang"){o=String(g);continue}if(h==="class"){s=String(g).trim();continue}r.push(` ${l}="${k(String(g))}"`),i.push(l)}let a=` lang="${k(o)}"`;if(s)a+=` class="${k(s)}"`;if(a+=r.join(""),s)a+=` ${X}="${k(s)}"`;if(i.length)a+=` ${W}="${k(i.join(" "))}"`;return a}function jl(e={},t={}){let r={...e,...t};if(e.class&&t.class){let i=e.class.split(/\s+/).filter(Boolean);for(let s of t.class.split(/\s+/).filter(Boolean))if(!i.includes(s))i.push(s);r.class=i.join(" ")}return r}function Kr(e,t={}){if(!t||Object.keys(t).length===0)return e;let r=e.match(/<html\b([^>]*)>/i);if(!r)return e;let i={},s=[],o=/([A-Za-z_:][\w:.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,a;while((a=o.exec(r[1]))!==null){let h=a[1];if(!(h in i))s.push(h);i[h]=a[2]??a[3]??a[4]??""}let c=[],g=[];for(let[h,f]of Object.entries(t)){if(f==null)continue;let y=h.trim();if(!qe.test(y))continue;let b=y.toLowerCase();if(b==="class"){let w=(i.class||"").split(/\s+/).filter(Boolean);for(let x of String(f).split(/\s+/).filter(Boolean))if(!w.includes(x))w.push(x),c.push(x);if(!("class"in i))s.push("class");i.class=w.join(" ");continue}if(!(y in i))s.push(y);if(i[y]=String(f),b!=="lang")g.push(y)}if(c.length){if(!(X in i))s.push(X);i[X]=c.join(" ")}if(g.length){if(!(W in i))s.push(W);i[W]=g.join(" ")}let l=s.map((h)=>` ${h}="${k(i[h])}"`).join("");return e.replace(r[0],()=>`<html${l}>`)}function Bl(e){if(e.includes("data-stx-cloak"))return null;if(L(e)===-1)return null;return`${Xe}
51
51
  `}function Jt(e){let t=[],r=0;while(r<e.length){let o=e.slice(r),a=o.match(/^\s+/);if(a){r+=a[0].length;continue}if(o.startsWith("<!--")){let f=e.indexOf("-->",r);if(f===-1)break;r=f+3;continue}let c=o.match(/^<script\b[^>]*>/i);if(c){let f=e.toLowerCase().indexOf("</script>",r+c[0].length);if(f===-1)break;r=f+9;continue}let g=o.match(/^<link\b[^>]*>/i);if(g){t.push(g[0]),r+=g[0].length;continue}let l=o.match(/^<meta\b[^>]*>/i);if(l){t.push(l[0]),r+=l[0].length;continue}let h=o.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(h){t.push(h[0]),r+=h[0].length;continue}break}if(t.length===0)return{body:e,hoisted:t};let i="",s=0;while(s<e.length&&s<r){let o=e.slice(s),a=o.match(/^<link\b[^>]*>/i);if(a&&t.includes(a[0])){s+=a[0].length;continue}let c=o.match(/^<meta\b[^>]*>/i);if(c&&t.includes(c[0])){s+=c[0].length;continue}let g=o.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(g&&t.includes(g[0])){s+=g[0].length;continue}i+=e[s],s++}return i+=e.slice(r),{body:i,hoisted:t}}function en(e,t={},r={}){let{title:i="stx App",lang:s="en",meta:o=[],link:a=[],script:c=[],headRaw:g="",htmlAttrs:l={},bodyClass:h="",bodyAttrs:f={}}=t,y=r.title||i,b=[{charset:"UTF-8"},{name:"viewport",content:"width=device-width, initial-scale=1.0"}],w=new Set(o.map(wt).filter(Boolean)),{body:x,hoisted:v}=Jt(e),C=new Set(v.flatMap((E)=>{let O=qt(E);return O?[wt(O)].filter(Boolean):[]})),et=[...b.filter((E)=>!w.has(wt(E))),...o].filter((E)=>!C.has(wt(E))).map((E)=>` <meta ${A(E)}>`).join(`
52
52
  `),rt=a.map((E)=>` <link ${A(E)}>`).join(`
53
53
  `),it=c.map((E)=>{if(E.src)return` <script ${A(E,(O)=>O==="content")}></script>`;if(E.content)return` ${Ge(E)}`;return""}).filter(Boolean).join(`
@@ -61,8 +61,8 @@ ${ct.join(`
61
61
  ${lt.join(`
62
62
  `)}
63
63
  </body>
64
- </html>`}var de=/\s+/y,me=/<(script|style)\b[^>]*>/iy,tn=/<\/script>/gi,nn=/<\/style>/gi,We=/<!DOCTYPE\b/iy,Ke=/<html[\s>]/iy;function Bn(e){let t=0;while(t<e.length){if(de.lastIndex=t,de.exec(e)){t=de.lastIndex;continue}if(e.startsWith("<!--",t)){let s=e.indexOf("-->",t);if(s===-1)return!1;t=s+3;continue}me.lastIndex=t;let i=me.exec(e);if(i){let s=i[1].toLowerCase()==="script"?tn:nn;s.lastIndex=me.lastIndex;let o=s.exec(e);if(o===null)return!1;t=o.index+o[0].length;continue}if(We.lastIndex=t,We.test(e))return!0;return Ke.lastIndex=t,Ke.test(e)}return!1}function na(e){return Bn(e)}function jl(e,t={}){let r=L(e);if(r===-1)return e;let{meta:i=[],link:s=[],script:o=[],headRaw:a=""}=t,c=e.slice(0,r),g=[];for(let l of i){let h=wt(l);if(h&&c.includes(h))continue;g.push(` <meta ${A(l)}>`)}for(let l of s){if(l.href&&c.includes(`href="${l.href}"`))continue;g.push(` <link ${A(l)}>`)}for(let l of o)if(l.src){if(c.includes(`src="${l.src}"`))continue;g.push(` <script ${A(l,(h)=>h==="content")}></script>`)}else if(l.content){if(c.includes(q(l)))continue;g.push(` ${Ge(l)}`)}if(a&&!c.includes(a))g.push(` ${a}`);if(g.length===0)return e;return`${e.slice(0,r)}${g.join(`
64
+ </html>`}var de=/\s+/y,me=/<(script|style)\b[^>]*>/iy,tn=/<\/script>/gi,nn=/<\/style>/gi,We=/<!DOCTYPE\b/iy,Ke=/<html[\s>]/iy;function Bn(e){let t=0;while(t<e.length){if(de.lastIndex=t,de.exec(e)){t=de.lastIndex;continue}if(e.startsWith("<!--",t)){let s=e.indexOf("-->",t);if(s===-1)return!1;t=s+3;continue}me.lastIndex=t;let i=me.exec(e);if(i){let s=i[1].toLowerCase()==="script"?tn:nn;s.lastIndex=me.lastIndex;let o=s.exec(e);if(o===null)return!1;t=o.index+o[0].length;continue}if(We.lastIndex=t,We.test(e))return!0;return Ke.lastIndex=t,Ke.test(e)}return!1}function na(e){return Bn(e)}function Fl(e,t={}){let r=L(e);if(r===-1)return e;let{meta:i=[],link:s=[],script:o=[],headRaw:a=""}=t,c=e.slice(0,r),g=[];for(let l of i){let h=wt(l);if(h&&c.includes(h))continue;g.push(` <meta ${A(l)}>`)}for(let l of s){if(l.href&&c.includes(`href="${l.href}"`))continue;g.push(` <link ${A(l)}>`)}for(let l of o)if(l.src){if(c.includes(`src="${l.src}"`))continue;g.push(` <script ${A(l,(h)=>h==="content")}></script>`)}else if(l.content){if(c.includes(q(l)))continue;g.push(` ${Ge(l)}`)}if(a&&!c.includes(a))g.push(` ${a}`);if(g.length===0)return e;return`${e.slice(0,r)}${g.join(`
65
65
  `)}
66
- ${e.slice(r)}`}function Xr(e,t={},r={},i){if(i??na(e))return e;return en(e,t,r)}var rn=["og:","article:","book:","profile:","fb:","music:","video:"],sn=/^[a-z][\w-]*(?::[\w:-]+)?$/i;function Gr(e,t){if(e.length<1)return{kind:"error",message:"meta directive requires at least the meta name",code:n.INVALID_DIRECTIVE_SYNTAX};if(e.length>2)return{kind:"error",message:`@meta takes a name and a value, got ${e.length} arguments`,code:n.INVALID_DIRECTIVE_SYNTAX};let r=on(e[0],t);if(typeof r!=="string")return r;let i;if(e.length===2){let o=an(e[1],t);if(typeof o!=="string")return o;i=o}else{let o=r.includes(":")?r.slice(r.indexOf(":")+1):r,a=t.openGraph,c=t[o]??(bt(a)?a[o]:void 0);i=c===void 0||c===null||typeof c==="object"?"":String(c)}if(!i)return{kind:"empty"};return{kind:"tag",tag:rn.some((o)=>r.startsWith(o))?{property:r,content:i}:{name:r,content:i}}}function on(e,t){let r=yt(e);if(r!==null)return r.trim()?r:{kind:"error",message:"the meta name is empty",code:n.INVALID_DIRECTIVE_SYNTAX};if(sn.test(e.trim()))return e.trim();let i=Qt(e,t);if(!i.ok)return{kind:"error",message:`meta name: ${i.message}`,code:i.code};if(typeof i.value!=="string"||!i.value.trim())return{kind:"error",message:`the meta name must be a non-empty string, got ${tt(i.value)}`,code:n.TYPE_ERROR};return i.value}function an(e,t){let r=yt(e);if(r!==null)return r;let i=Qt(e,t);if(!i.ok)return{kind:"error",message:i.message,code:i.code};let s=i.value;if(s===void 0||s===null||s===!1)return"";if(Array.isArray(s))return s.filter((o)=>o!==void 0&&o!==null&&o!=="").map(String).join(", ");if(typeof s==="object"&&!(s instanceof Date))return{kind:"error",message:`the content must be text, got ${tt(s)}`,code:n.TYPE_ERROR};return String(s)}var Jr=["title","lang","meta","link","script","headRaw","htmlAttrs","bodyClass","bodyAttrs"],wo=["title","titleTemplate","base","meta","link","script","style","htmlAttrs","bodyAttrs"],Ze={links:"link",metas:"meta",scripts:"script",styles:"style"},Ye=new Set,Je=new WeakMap;function he(e){if(Ye.has(e))return;Ye.add(e),console.warn(e)}function cn(e,t){let r=Array.from({length:t.length+1},(i,s)=>s);for(let i=1;i<=e.length;i++){let s=r[0];r[0]=i;for(let o=1;o<=t.length;o++){let a=r[o];r[o]=Math.min(r[o]+1,r[o-1]+1,s+(e[i-1]===t[o-1]?0:1)),s=a}}return r[t.length]}function ln(e,t){let r=e.toLowerCase(),i=t.find((g)=>g.toLowerCase()===r);if(i)return i;let s=Ze[r];if(s&&t.includes(s))return s;let o,a=1/0;for(let g of t){let l=cn(r,g.toLowerCase());if(l<a)o=g,a=l}let c=Math.min(e.length,o?.length??0)<=4?1:2;return a<=c?o:void 0}function Le(e,t){if(!e||typeof e!=="object"||Array.isArray(e))return e||{};let r=Je.get(e);if(r)return r;let{known:i,source:s}=t,o=e;for(let a of Object.keys(e)){if(i.includes(a))continue;let c=Ze[a];if(c&&i.includes(c)&&Array.isArray(e[a])){if(o===e)o={...e};let l=Array.isArray(o[c])?o[c]:[];o[c]=[...l,...e[a]],delete o[a],he(`[stx] ${s}.${a} is not a head key; reading it as ${s}.${c}. Rename it to \`${c}\`.`);continue}if(/^styles?$/.test(a)&&!i.includes("style")){he(`[stx] ${s}.${a} is not a head key and is ignored. Use \`link\` with rel: 'stylesheet', or \`headRaw\` for an inline <style>.`);continue}let g=ln(a,i);he(g?`[stx] ${s}.${a} is not a head key and is ignored. Did you mean \`${g}\`?`:`[stx] ${s}.${a} is not a head key and is ignored. Known keys: ${i.join(", ")}.`)}return Je.set(e,o),o}var R={},un=[],G={};function ra(){return R}function jy(){return G}function By(){R={},un.length=0,G={}}function Bl(e){R=nt(R,Le(e,{known:wo,source:"useHead()"}))}function Qe(e,t,r){let i=[...e||[]];for(let s of t||[]){let o=r(s),a=o?i.findIndex((c)=>r(c)===o):-1;if(a<0)i.push(s);else i[a]=s}return i}function nt(e,t){return{title:t.title??e.title,titleTemplate:t.titleTemplate??e.titleTemplate,base:t.base??e.base,meta:Qe(e.meta,t.meta,(r)=>r.name||r.property||(r.httpEquiv?`http:${r.httpEquiv}`:void 0)),link:Qe(e.link,t.link,(r)=>["icon","apple-touch-icon","canonical"].includes(r.rel||"")?[r.rel,r.type,r.media,r.sizes].join(":"):void 0),script:[...e.script||[],...t.script||[]],style:[...e.style||[],...t.style||[]],htmlAttrs:{...e.htmlAttrs,...t.htmlAttrs},bodyAttrs:{...e.bodyAttrs,...t.bodyAttrs}}}function tm(e){Bl(vo(e))}function vo(e){let t=[];if(e.description)t.push({name:"description",content:e.description});if(e.keywords){let g=Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords;t.push({name:"keywords",content:g})}if(e.author)t.push({name:"author",content:e.author});if(e.robots)t.push({name:"robots",content:e.robots});let r=e.ogTitle??e.title,i=e.ogDescription??e.description;if(r)t.push({property:"og:title",content:r});if(i)t.push({property:"og:description",content:i});if(e.ogImage){if(t.push({property:"og:image",content:e.ogImage}),e.ogImageType)t.push({property:"og:image:type",content:e.ogImageType});if(e.ogImageWidth)t.push({property:"og:image:width",content:String(e.ogImageWidth)});if(e.ogImageHeight)t.push({property:"og:image:height",content:String(e.ogImageHeight)});if(e.ogImageAlt)t.push({property:"og:image:alt",content:e.ogImageAlt})}if(e.ogUrl)t.push({property:"og:url",content:e.ogUrl});if(e.ogType)t.push({property:"og:type",content:e.ogType});if(e.ogSiteName)t.push({property:"og:site_name",content:e.ogSiteName});if(e.ogLocale)t.push({property:"og:locale",content:e.ogLocale});if(e.profileFirstName)t.push({property:"profile:first_name",content:e.profileFirstName});if(e.profileLastName)t.push({property:"profile:last_name",content:e.profileLastName});if(e.profileUsername)t.push({property:"profile:username",content:e.profileUsername});let s=e.twitterTitle??e.title,o=e.twitterDescription??e.description,a=e.twitterImage??e.ogImage;if(e.twitterCard)t.push({name:"twitter:card",content:e.twitterCard});if(s)t.push({name:"twitter:title",content:s});if(o)t.push({name:"twitter:description",content:o});if(a){t.push({name:"twitter:image",content:a});let g=e.twitterImageAlt??(e.twitterImage?void 0:e.ogImageAlt);if(g)t.push({name:"twitter:image:alt",content:g})}if(e.twitterSite)t.push({name:"twitter:site",content:e.twitterSite});if(e.twitterCreator)t.push({name:"twitter:creator",content:e.twitterCreator});if(e.articleAuthor)t.push({property:"article:author",content:e.articleAuthor});if(e.articlePublishedTime)t.push({property:"article:published_time",content:e.articlePublishedTime});if(e.articleModifiedTime)t.push({property:"article:modified_time",content:e.articleModifiedTime});if(e.articleSection)t.push({property:"article:section",content:e.articleSection});if(e.articleTags)for(let g of e.articleTags)t.push({property:"article:tag",content:g});let c=[];if(e.canonical)c.push({rel:"canonical",href:e.canonical});return{title:e.title,titleTemplate:e.titleTemplate,meta:t,link:c}}function Fy(e){if(G={...G,...e},e.title||e.description)tm({title:e.title,description:e.description})}function zy(e){let t=typeof e==="function"?e():e;Bl({title:t})}function Hy(e=R){let t=[];if(e.title){let r=e.title;if(e.titleTemplate)r=typeof e.titleTemplate==="function"?e.titleTemplate(r):e.titleTemplate.replace("%s",r);t.push(`<title>${I(r)}</title>`)}if(e.base){let r=Object.entries(e.base).map(([i,s])=>`${i}="${I(s)}"`).join(" ");t.push(`<base ${r}>`)}for(let r of e.meta||[]){let i=Object.entries(r).filter(([s,o])=>o!==void 0).map(([s,o])=>`${s==="httpEquiv"?"http-equiv":s}="${I(String(o))}"`).join(" ");t.push(`<meta ${i}>`)}for(let r of e.link||[]){let i=Object.entries(r).filter(([s,o])=>o!==void 0).map(([s,o])=>`${s}="${I(String(o))}"`).join(" ");t.push(`<link ${i}>`)}for(let r of e.script||[]){let{content:i,...s}=r,o=Object.entries(s).filter(([a,c])=>c!==void 0).map(([a,c])=>{if(typeof c==="boolean")return c?a:"";return`${a}="${I(String(c))}"`}).filter(Boolean).join(" ");if(i)t.push(`<script ${o}>${q(r)}</script>`);else t.push(`<script ${o}></script>`)}for(let r of e.style||[]){let i=r.type?` type="${r.type}"`:"";t.push(`<style${i}>${r.content}</style>`)}return t.join(`
67
- `)}function Uy(e=R){if(!e.htmlAttrs)return"";return Object.entries(e.htmlAttrs).map(([t,r])=>`${t}="${I(r)}"`).join(" ")}function Vy(e=R){if(!e.bodyAttrs)return"";return Object.entries(e.bodyAttrs).map(([t,r])=>`${t}="${I(r)}"`).join(" ")}function I(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function Wy(e=R){if(typeof document>"u")return;if(e.title){let t=e.title;if(e.titleTemplate)t=typeof e.titleTemplate==="function"?e.titleTemplate(t):e.titleTemplate.replace("%s",t);document.title=t}for(let t of e.meta||[]){let r=t.name?`meta[name="${t.name}"]`:t.property?`meta[property="${t.property}"]`:null;if(r){let i=document.querySelector(r);if(!i){if(i=document.createElement("meta"),t.name)i.setAttribute("name",t.name);if(t.property)i.setAttribute("property",t.property);document.head.appendChild(i)}i.setAttribute("content",t.content)}}for(let t of e.link||[]){let r=`link[rel="${t.rel}"]${t.href?`[href="${t.href}"]`:""}`,i=document.querySelector(r);if(!i)i=document.createElement("link"),document.head.appendChild(i);for(let[s,o]of Object.entries(t))if(o!==void 0)i.setAttribute(s,String(o))}if(e.htmlAttrs)for(let[t,r]of Object.entries(e.htmlAttrs))if(t==="class")for(let i of String(r).split(/\s+/).filter(Boolean))document.documentElement.classList.add(i);else document.documentElement.setAttribute(t,r);if(e.bodyAttrs)for(let[t,r]of Object.entries(e.bodyAttrs))document.body.setAttribute(t,r)}function qy(e){let t="";return{content:e.replace(/@head\s*([\s\S]*?)@endhead/g,(i,s)=>(t+=s.trim()+`
68
- `,"")),headContent:t.trim()}}function Ky(e,t){return e.replace(/@title\s*\(\s*(?:(['"`])(.+?)\1|([^)]+))\s*\)/g,(r,i,s,o)=>{let a=i?s:t[(o||"").trim()]??o,c=t.__stx_runtime_head??{};return t.__stx_runtime_head=nt(c,{title:a}),""})}function Xy(e,t,r=""){if(!e.includes("@meta"))return e;return Yt(e,/(?<![\w$@])@meta\s*\(/g,(i,s)=>{let o=Gr(Zt(i),t);if(o.kind==="error")return H("Meta",s,o.message,r,o.code);if(o.kind==="tag"){let a=t.__stx_runtime_head??{};t.__stx_runtime_head=nt(a,{meta:[o.tag]})}return""},(i)=>H("Meta",i,"the call has no closing parenthesis",r,n.INVALID_DIRECTIVE_SYNTAX))}export{mo,Zi,ho,d,m,Il,M,Ee,Ur,p,yo,n,ce,Vr,te,u,De,Qi,K,jn,be,_,Ol,ea,Yt,Zt,yt,Qt,tt,bt,H,bo,ta,Nl,Wr,qr,Ml,wt,Dl,Kr,Ll,Bn,na,jl,Xr,Gr,Jr,wo,Le,ra,jy,By,Bl,nt,tm,vo,Fy,zy,Hy,Uy,Vy,Wy,qy,Ky,Xy};
66
+ ${e.slice(r)}`}function Xr(e,t={},r={},i){if(i??na(e))return e;return en(e,t,r)}var rn=["og:","article:","book:","profile:","fb:","music:","video:"],sn=/^[a-z][\w-]*(?::[\w:-]+)?$/i;function Gr(e,t){if(e.length<1)return{kind:"error",message:"meta directive requires at least the meta name",code:n.INVALID_DIRECTIVE_SYNTAX};if(e.length>2)return{kind:"error",message:`@meta takes a name and a value, got ${e.length} arguments`,code:n.INVALID_DIRECTIVE_SYNTAX};let r=on(e[0],t);if(typeof r!=="string")return r;let i;if(e.length===2){let o=an(e[1],t);if(typeof o!=="string")return o;i=o}else{let o=r.includes(":")?r.slice(r.indexOf(":")+1):r,a=t.openGraph,c=t[o]??(bt(a)?a[o]:void 0);i=c===void 0||c===null||typeof c==="object"?"":String(c)}if(!i)return{kind:"empty"};return{kind:"tag",tag:rn.some((o)=>r.startsWith(o))?{property:r,content:i}:{name:r,content:i}}}function on(e,t){let r=yt(e);if(r!==null)return r.trim()?r:{kind:"error",message:"the meta name is empty",code:n.INVALID_DIRECTIVE_SYNTAX};if(sn.test(e.trim()))return e.trim();let i=Qt(e,t);if(!i.ok)return{kind:"error",message:`meta name: ${i.message}`,code:i.code};if(typeof i.value!=="string"||!i.value.trim())return{kind:"error",message:`the meta name must be a non-empty string, got ${tt(i.value)}`,code:n.TYPE_ERROR};return i.value}function an(e,t){let r=yt(e);if(r!==null)return r;let i=Qt(e,t);if(!i.ok)return{kind:"error",message:i.message,code:i.code};let s=i.value;if(s===void 0||s===null||s===!1)return"";if(Array.isArray(s))return s.filter((o)=>o!==void 0&&o!==null&&o!=="").map(String).join(", ");if(typeof s==="object"&&!(s instanceof Date))return{kind:"error",message:`the content must be text, got ${tt(s)}`,code:n.TYPE_ERROR};return String(s)}var Jr=["title","lang","meta","link","script","headRaw","htmlAttrs","bodyClass","bodyAttrs"],wo=["title","titleTemplate","base","meta","link","script","style","htmlAttrs","bodyAttrs"],Ze={links:"link",metas:"meta",scripts:"script",styles:"style"},Ye=new Set,Je=new WeakMap;function he(e){if(Ye.has(e))return;Ye.add(e),console.warn(e)}function cn(e,t){let r=Array.from({length:t.length+1},(i,s)=>s);for(let i=1;i<=e.length;i++){let s=r[0];r[0]=i;for(let o=1;o<=t.length;o++){let a=r[o];r[o]=Math.min(r[o]+1,r[o-1]+1,s+(e[i-1]===t[o-1]?0:1)),s=a}}return r[t.length]}function ln(e,t){let r=e.toLowerCase(),i=t.find((g)=>g.toLowerCase()===r);if(i)return i;let s=Ze[r];if(s&&t.includes(s))return s;let o,a=1/0;for(let g of t){let l=cn(r,g.toLowerCase());if(l<a)o=g,a=l}let c=Math.min(e.length,o?.length??0)<=4?1:2;return a<=c?o:void 0}function Le(e,t){if(!e||typeof e!=="object"||Array.isArray(e))return e||{};let r=Je.get(e);if(r)return r;let{known:i,source:s}=t,o=e;for(let a of Object.keys(e)){if(i.includes(a))continue;let c=Ze[a];if(c&&i.includes(c)&&Array.isArray(e[a])){if(o===e)o={...e};let l=Array.isArray(o[c])?o[c]:[];o[c]=[...l,...e[a]],delete o[a],he(`[stx] ${s}.${a} is not a head key; reading it as ${s}.${c}. Rename it to \`${c}\`.`);continue}if(/^styles?$/.test(a)&&!i.includes("style")){he(`[stx] ${s}.${a} is not a head key and is ignored. Use \`link\` with rel: 'stylesheet', or \`headRaw\` for an inline <style>.`);continue}let g=ln(a,i);he(g?`[stx] ${s}.${a} is not a head key and is ignored. Did you mean \`${g}\`?`:`[stx] ${s}.${a} is not a head key and is ignored. Known keys: ${i.join(", ")}.`)}return Je.set(e,o),o}var R={},un=[],G={};function ra(){return R}function Fy(){return G}function zy(){R={},un.length=0,G={}}function zl(e){R=nt(R,Le(e,{known:wo,source:"useHead()"}))}function Qe(e,t,r){let i=[...e||[]];for(let s of t||[]){let o=r(s),a=o?i.findIndex((c)=>r(c)===o):-1;if(a<0)i.push(s);else i[a]=s}return i}function nt(e,t){return{title:t.title??e.title,titleTemplate:t.titleTemplate??e.titleTemplate,base:t.base??e.base,meta:Qe(e.meta,t.meta,(r)=>r.name||r.property||(r.httpEquiv?`http:${r.httpEquiv}`:void 0)),link:Qe(e.link,t.link,(r)=>["icon","apple-touch-icon","canonical"].includes(r.rel||"")?[r.rel,r.type,r.media,r.sizes].join(":"):void 0),script:[...e.script||[],...t.script||[]],style:[...e.style||[],...t.style||[]],htmlAttrs:{...e.htmlAttrs,...t.htmlAttrs},bodyAttrs:{...e.bodyAttrs,...t.bodyAttrs}}}function rm(e){zl(vo(e))}function vo(e){let t=[];if(e.description)t.push({name:"description",content:e.description});if(e.keywords){let g=Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords;t.push({name:"keywords",content:g})}if(e.author)t.push({name:"author",content:e.author});if(e.robots)t.push({name:"robots",content:e.robots});let r=e.ogTitle??e.title,i=e.ogDescription??e.description;if(r)t.push({property:"og:title",content:r});if(i)t.push({property:"og:description",content:i});if(e.ogImage){if(t.push({property:"og:image",content:e.ogImage}),e.ogImageType)t.push({property:"og:image:type",content:e.ogImageType});if(e.ogImageWidth)t.push({property:"og:image:width",content:String(e.ogImageWidth)});if(e.ogImageHeight)t.push({property:"og:image:height",content:String(e.ogImageHeight)});if(e.ogImageAlt)t.push({property:"og:image:alt",content:e.ogImageAlt})}if(e.ogUrl)t.push({property:"og:url",content:e.ogUrl});if(e.ogType)t.push({property:"og:type",content:e.ogType});if(e.ogSiteName)t.push({property:"og:site_name",content:e.ogSiteName});if(e.ogLocale)t.push({property:"og:locale",content:e.ogLocale});if(e.profileFirstName)t.push({property:"profile:first_name",content:e.profileFirstName});if(e.profileLastName)t.push({property:"profile:last_name",content:e.profileLastName});if(e.profileUsername)t.push({property:"profile:username",content:e.profileUsername});let s=e.twitterTitle??e.title,o=e.twitterDescription??e.description,a=e.twitterImage??e.ogImage;if(e.twitterCard)t.push({name:"twitter:card",content:e.twitterCard});if(s)t.push({name:"twitter:title",content:s});if(o)t.push({name:"twitter:description",content:o});if(a){t.push({name:"twitter:image",content:a});let g=e.twitterImageAlt??(e.twitterImage?void 0:e.ogImageAlt);if(g)t.push({name:"twitter:image:alt",content:g})}if(e.twitterSite)t.push({name:"twitter:site",content:e.twitterSite});if(e.twitterCreator)t.push({name:"twitter:creator",content:e.twitterCreator});if(e.articleAuthor)t.push({property:"article:author",content:e.articleAuthor});if(e.articlePublishedTime)t.push({property:"article:published_time",content:e.articlePublishedTime});if(e.articleModifiedTime)t.push({property:"article:modified_time",content:e.articleModifiedTime});if(e.articleSection)t.push({property:"article:section",content:e.articleSection});if(e.articleTags)for(let g of e.articleTags)t.push({property:"article:tag",content:g});let c=[];if(e.canonical)c.push({rel:"canonical",href:e.canonical});return{title:e.title,titleTemplate:e.titleTemplate,meta:t,link:c}}function Hy(e){if(G={...G,...e},e.title||e.description)rm({title:e.title,description:e.description})}function Uy(e){let t=typeof e==="function"?e():e;zl({title:t})}function Vy(e=R){let t=[];if(e.title){let r=e.title;if(e.titleTemplate)r=typeof e.titleTemplate==="function"?e.titleTemplate(r):e.titleTemplate.replace("%s",r);t.push(`<title>${I(r)}</title>`)}if(e.base){let r=Object.entries(e.base).map(([i,s])=>`${i}="${I(s)}"`).join(" ");t.push(`<base ${r}>`)}for(let r of e.meta||[]){let i=Object.entries(r).filter(([s,o])=>o!==void 0).map(([s,o])=>`${s==="httpEquiv"?"http-equiv":s}="${I(String(o))}"`).join(" ");t.push(`<meta ${i}>`)}for(let r of e.link||[]){let i=Object.entries(r).filter(([s,o])=>o!==void 0).map(([s,o])=>`${s}="${I(String(o))}"`).join(" ");t.push(`<link ${i}>`)}for(let r of e.script||[]){let{content:i,...s}=r,o=Object.entries(s).filter(([a,c])=>c!==void 0).map(([a,c])=>{if(typeof c==="boolean")return c?a:"";return`${a}="${I(String(c))}"`}).filter(Boolean).join(" ");if(i)t.push(`<script ${o}>${q(r)}</script>`);else t.push(`<script ${o}></script>`)}for(let r of e.style||[]){let i=r.type?` type="${r.type}"`:"";t.push(`<style${i}>${r.content}</style>`)}return t.join(`
67
+ `)}function Wy(e=R){if(!e.htmlAttrs)return"";return Object.entries(e.htmlAttrs).map(([t,r])=>`${t}="${I(r)}"`).join(" ")}function qy(e=R){if(!e.bodyAttrs)return"";return Object.entries(e.bodyAttrs).map(([t,r])=>`${t}="${I(r)}"`).join(" ")}function I(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function Ky(e=R){if(typeof document>"u")return;if(e.title){let t=e.title;if(e.titleTemplate)t=typeof e.titleTemplate==="function"?e.titleTemplate(t):e.titleTemplate.replace("%s",t);document.title=t}for(let t of e.meta||[]){let r=t.name?`meta[name="${t.name}"]`:t.property?`meta[property="${t.property}"]`:null;if(r){let i=document.querySelector(r);if(!i){if(i=document.createElement("meta"),t.name)i.setAttribute("name",t.name);if(t.property)i.setAttribute("property",t.property);document.head.appendChild(i)}i.setAttribute("content",t.content)}}for(let t of e.link||[]){let r=`link[rel="${t.rel}"]${t.href?`[href="${t.href}"]`:""}`,i=document.querySelector(r);if(!i)i=document.createElement("link"),document.head.appendChild(i);for(let[s,o]of Object.entries(t))if(o!==void 0)i.setAttribute(s,String(o))}if(e.htmlAttrs)for(let[t,r]of Object.entries(e.htmlAttrs))if(t==="class")for(let i of String(r).split(/\s+/).filter(Boolean))document.documentElement.classList.add(i);else document.documentElement.setAttribute(t,r);if(e.bodyAttrs)for(let[t,r]of Object.entries(e.bodyAttrs))document.body.setAttribute(t,r)}function Xy(e){let t="";return{content:e.replace(/@head\s*([\s\S]*?)@endhead/g,(i,s)=>(t+=s.trim()+`
68
+ `,"")),headContent:t.trim()}}function Gy(e,t){return e.replace(/@title\s*\(\s*(?:(['"`])(.+?)\1|([^)]+))\s*\)/g,(r,i,s,o)=>{let a=i?s:t[(o||"").trim()]??o,c=t.__stx_runtime_head??{};return t.__stx_runtime_head=nt(c,{title:a}),""})}function Jy(e,t,r=""){if(!e.includes("@meta"))return e;return Yt(e,/(?<![\w$@])@meta\s*\(/g,(i,s)=>{let o=Gr(Zt(i),t);if(o.kind==="error")return H("Meta",s,o.message,r,o.code);if(o.kind==="tag"){let a=t.__stx_runtime_head??{};t.__stx_runtime_head=nt(a,{meta:[o.tag]})}return""},(i)=>H("Meta",i,"the call has no closing parenthesis",r,n.INVALID_DIRECTIVE_SYNTAX))}export{mo,Zi,ho,d,m,Nl,M,Ee,Ur,p,yo,n,ce,Vr,te,u,De,Qi,K,jn,be,_,Ml,ea,Yt,Zt,yt,Qt,tt,bt,H,bo,ta,Dl,Wr,qr,Ll,wt,jl,Kr,Bl,Bn,na,Fl,Xr,Gr,Jr,wo,Le,ra,Fy,zy,zl,nt,rm,vo,Hy,Uy,Vy,Wy,qy,Ky,Xy,Gy,Jy};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Va,Wa,Tu,$u,Ru,Au,fh}from"./chunk-gg715pj6.js";export{Va as createVirtualList,fh as default,Tu as generateVirtualListCSS,Ru as processInfiniteListDirectives,Au as processVirtualGridDirectives,Wa as processVirtualListDirectives,$u as useVirtualList};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Uo,qh,Kh}from"./chunk-wc10m4tp.js";import"./chunk-0atz8fjx.js";import"./chunk-0sj79ha5.js";import"./chunk-cwcmmgvz.js";import"./chunk-9w9y84t5.js";import"./chunk-8b8az19t.js";import"./chunk-nhyv3w4r.js";import"./chunk-0adc8x2h.js";import"./chunk-mf5cqv1k.js";import"./chunk-w6ydg43d.js";import"./chunk-2vx2ben8.js";import"./chunk-jr2r2nh5.js";import"./chunk-xnp031ba.js";import"./chunk-388xpdw5.js";import"./chunk-b5qzed8y.js";import"./chunk-p3x84jj0.js";import"./chunk-w98yt4d4.js";import"./chunk-4vz17ytv.js";import"./chunk-phzhmnnm.js";import"./chunk-9928zdej.js";import"./chunk-0jdz31q1.js";import"./chunk-16sfjkc4.js";export{Kh as clearComposableCache,qh as getComposableScript,Uo as listComposableModules};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ns,$o,Sm,iu,Ro}from"./chunk-91p8p2cc.js";import"./chunk-0adc8x2h.js";import"./chunk-9928zdej.js";import"./chunk-0jdz31q1.js";export{Sm as buildModuleRegistryScript,Ro as buildSharedModuleRegistries,iu as exportsMutableBinding,ns as registeredModuleIdsIn,$o as registeredModuleNamesIn};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{py,mg,lt,jc,fy,Ts,$s,Rs}from"./chunk-43sgpy4e.js";import"./chunk-0v7555tr.js";import"./chunk-0fm6avxt.js";import"./chunk-9tv0tw7f.js";import"./chunk-nhyv3w4r.js";import"./chunk-b5qzed8y.js";import"./chunk-p3x84jj0.js";import"./chunk-w98yt4d4.js";import"./chunk-4vz17ytv.js";import"./chunk-phzhmnnm.js";import"./chunk-9928zdej.js";import"./chunk-0jdz31q1.js";import"./chunk-16sfjkc4.js";export{fy as clearOnceStore,jc as onceStore,lt as partialsCache,Ts as processIncludes,$s as processStackPushDirectives,Rs as processStackReplacements,py as resetUnscopedSignalWarnings,mg as topLevelElements};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{yh,Ka,Wu,bh,wh,vh,xh,Sh,qu,Ku,kh,_h,Ch,Eh}from"./chunk-dwt2drzf.js";import"./chunk-n4m50dpk.js";import"./chunk-ngqb22wj.js";import"./chunk-43sgpy4e.js";import"./chunk-fs43342z.js";import"./chunk-0v7555tr.js";import"./chunk-0fm6avxt.js";import"./chunk-bm6y085n.js";import"./chunk-9tv0tw7f.js";import"./chunk-9w9y84t5.js";import"./chunk-8b8az19t.js";import"./chunk-nhyv3w4r.js";import"./chunk-t65f98qv.js";import"./chunk-0adc8x2h.js";import"./chunk-mf5cqv1k.js";import"./chunk-w6ydg43d.js";import"./chunk-2vx2ben8.js";import"./chunk-jr2r2nh5.js";import"./chunk-xnp031ba.js";import"./chunk-388xpdw5.js";import"./chunk-b5qzed8y.js";import"./chunk-p3x84jj0.js";import"./chunk-w98yt4d4.js";import"./chunk-4vz17ytv.js";import"./chunk-phzhmnnm.js";import"./chunk-9928zdej.js";import"./chunk-0jdz31q1.js";import"./chunk-16sfjkc4.js";export{Wu as SUSPENSE_RESOLVER_RUNTIME,Ka as buildSuspenseResolveScript,Sh as createStreamRenderer,vh as extractStreamBoundaries,Eh as generateHydrationRuntime,Ku as islandDirective,_h as processSectionDirectives,wh as processStreamDirectives,kh as registerStreamingDirectives,bh as renderStreamingPage,yh as streamTemplate,xh as streamTemplateSimple,Ch as streamToResponse,qu as streamingSuspenseDirective};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{vn,ei,ti,ni,cy,ri}from"./chunk-0sj79ha5.js";import"./chunk-jr2r2nh5.js";import"./chunk-388xpdw5.js";import"./chunk-w98yt4d4.js";export{ti as buildServerApi,cy as createServerApi,vn as discoverServerApi,ei as generateApiTypes,ri as isServerApiSource,ni as productionApiDispatcher};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ua,da,pa,gm,mm,hm,su,ym,bm}from"./chunk-pyyda92j.js";export{ua as ImageProcessorCache,su as applyTransformations,gm as clearImageCache,ym as generateResponsiveVariants,bm as generateSrcset,da as getCachedImageResult,hm as optimizeImage,mm as processImage,pa as setCachedImageResult};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{P}from"./chunk-kx3mmpfd.js";import{xe}from"./chunk-kmy34he2.js";function g(e,t){let r={};for(let n of e)r[n]=xe(t(n));return new Proxy({},{get:(n,a)=>r[a]?.(),set:(n,a,o)=>{if(r[a])r[a].set(o);else r[a]=xe(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 qa(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=xe(!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 Bu=qa;class rr{rules=[];defaultValue="";addRule(e){let t=new rr;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 rr;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 rr;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 fh=new rr;function Fu(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)=>P(c,{...t,message:l},r)).join(`
3
- `)}catch{return""}})}function zu(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)=>P(c,{...t,message:l},r)).join(`
4
- `)}catch{return""}})}function Hu(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 gh(e,t,r){let n=e;return n=Fu(n,t,r),n=zu(n,t,r),n=Hu(n,t,r),n}export{qa,Bu,rr,fh,Fu,zu,Hu,gh};
2
+ import{P}from"./chunk-b5qzed8y.js";import{xe}from"./chunk-1hbf5e1h.js";function g(e,t){let r={};for(let n of e)r[n]=xe(t(n));return new Proxy({},{get:(n,a)=>r[a]?.(),set:(n,a,o)=>{if(r[a])r[a].set(o);else r[a]=xe(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 qa(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=xe(!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 zu=qa;class rr{rules=[];defaultValue="";addRule(e){let t=new rr;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 rr;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 rr;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 mh=new rr;function Hu(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)=>P(c,{...t,message:l},r)).join(`
3
+ `)}catch{return""}})}function Uu(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)=>P(c,{...t,message:l},r)).join(`
4
+ `)}catch{return""}})}function Vu(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 hh(e,t,r){let n=e;return n=Hu(n,t,r),n=Uu(n,t,r),n=Vu(n,t,r),n}export{qa,zu,rr,mh,Hu,Uu,Vu,hh};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{hy,yy,hg,Ps}from"./chunk-0v7555tr.js";import"./chunk-0fm6avxt.js";import"./chunk-9tv0tw7f.js";import"./chunk-nhyv3w4r.js";import{Fr}from"./chunk-b5qzed8y.js";import"./chunk-p3x84jj0.js";import"./chunk-w98yt4d4.js";import{Ee}from"./chunk-4vz17ytv.js";import"./chunk-phzhmnnm.js";import"./chunk-9928zdej.js";import"./chunk-0jdz31q1.js";import"./chunk-16sfjkc4.js";export{Ee as freeIdentifiers,Ps as processComponents,hg as processESImports,Fr as rendersAsElement,hy as resetMarginStackWarnings,yy as resetTemplateLoopWarnings};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Oe,Vi,Wi,Hg,Gt,El,Ug,Tl,Oy,Ge,In,Je}from"./chunk-b5qzed8y.js";import"./chunk-p3x84jj0.js";import"./chunk-w98yt4d4.js";import"./chunk-4vz17ytv.js";import"./chunk-phzhmnnm.js";import"./chunk-9928zdej.js";import{Vl,t}from"./chunk-fvr3h2fr.js";import"./chunk-0jdz31q1.js";import"./chunk-16sfjkc4.js";export{Oe as BROWSER_CORE_IMPORTS,Hg as STX_AUTO_IMPORTS,Vi as extractAndStripCssImports,Ge as extractBridgeData,Vl as findInterpolationEnd,Tl as generateAutoImportDestructuring,Oy as generateBrowserAutoImportDestructuring,In as generateServerDataBridge,Gt as injectBrowserCoreAutoImports,Je as processClientScript,Ug as referencesName,Wi as renderVendorStyleTags,t as stripCommentsAndLiterals,El as transformAutoImports};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{q,_g,vi,Kc,a,j,Ey,Ty}from"./chunk-mf5cqv1k.js";import"./chunk-w6ydg43d.js";import"./chunk-2vx2ben8.js";import"./chunk-jr2r2nh5.js";import"./chunk-xnp031ba.js";import"./chunk-388xpdw5.js";import"./chunk-b5qzed8y.js";import"./chunk-p3x84jj0.js";import"./chunk-w98yt4d4.js";import"./chunk-4vz17ytv.js";import"./chunk-phzhmnnm.js";import"./chunk-9928zdej.js";import"./chunk-0jdz31q1.js";import"./chunk-16sfjkc4.js";export{j as config,q as defaultConfig,Ey as defineStxConfig,vi as discoverConfig,a as loadStxConfig,Kc as resolveInstalledPackage,_g as resolveStxDirectories,Ty as validateConfig};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{it,fe,Cc}from"./chunk-0vyytd9v.js";import v from"fs";import g from"path";import V from"crypto";var le=[320,640,768,1024,1280,1536,1920],ue=["webp","jpeg"],de=80,T=[".jpg",".jpeg",".png",".webp",".avif",".gif",".svg"],U={webp:"image/webp",avif:"image/avif",jpeg:"image/jpeg",png:"image/png"},I=null,M=!1;async function d(){if(M)return I;M=!0;try{let t=await import("sharp");return I=t.default||t,I}catch{return null}}async function Yn(){return await d()!==null}async function Te(){return!0}async function ze(t,e={}){let{widths:a=le,formats:n=ue,quality:r=de,fit:m="cover",placeholder:l="none",outputDir:o=".stx/images",baseUrl:c="/images"}=e,i,h;if(typeof t==="string"){if(h=t,!await Bun.file(t).exists())throw new ms(`Image not found: ${t}`,"NOT_FOUND");i=await Bun.file(t).arrayBuffer().then((s)=>Buffer.from(s))}else h="buffer-input",i=t;let b=V.createHash("sha256").update(i).digest("hex").slice(0,12),j=await gs(i),{width:u,height:x}=j,F=u/x;await v.promises.mkdir(o,{recursive:!0});let B=[],A=g.basename(h,g.extname(h)),f=a.filter((s)=>s<=u);if(!f.includes(u)&&u<=Math.max(...a))f.push(u);f.sort((s,p)=>s-p);for(let s of f){let p=Math.round(s/F);for(let w of n){let S=`${A}-${s}w-${b}.${w}`,P=g.join(o,S),q=`${c}/${S}`,E=await ku(i,{width:s,height:p,format:w,quality:r,fit:m});await Bun.write(P,E),B.push({path:P,url:q,width:s,height:p,format:w,size:E.length})}}let y;if(l!=="none")y=await D(i,l);return{src:h,variants:B,placeholder:y,width:u,height:x,aspectRatio:F,hash:b}}async function gs(t){let e=typeof t==="string"?Buffer.from(await Bun.file(t).arrayBuffer()):t,a=await d();if(a){let r=await a(e).metadata();return{width:r.width||0,height:r.height||0,format:r.format||"unknown",hasAlpha:r.hasAlpha}}return L(e)}function L(t){if(t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71){let e=t.readUInt32BE(16),a=t.readUInt32BE(20);return{width:e,height:a,format:"png",hasAlpha:!0}}if(t[0]===255&&t[1]===216){let e=2;while(e<t.length){if(t[e]!==255)break;let a=t[e+1];if(a>=192&&a<=207&&a!==196&&a!==200&&a!==204){let r=t.readUInt16BE(e+5);return{width:t.readUInt16BE(e+7),height:r,format:"jpeg",hasAlpha:!1}}let n=t.readUInt16BE(e+2);e+=2+n}}if(t.toString("utf8",0,4)==="RIFF"&&t.toString("utf8",8,12)==="WEBP"){let e=t.toString("utf8",12,16);if(e==="VP8 "){let a=t.readUInt16LE(26)&16383,n=t.readUInt16LE(28)&16383;return{width:a,height:n,format:"webp",hasAlpha:!1}}if(e==="VP8L"){let a=t.readUInt32LE(21),n=(a&16383)+1,r=(a>>14&16383)+1;return{width:n,height:r,format:"webp",hasAlpha:!0}}}if(t.toString("utf8",0,3)==="GIF"){let e=t.readUInt16LE(6),a=t.readUInt16LE(8);return{width:e,height:a,format:"gif",hasAlpha:!0}}throw new ms("Unable to parse image dimensions","PARSE_ERROR")}async function ku(t,e){let a=await d();if(a){let r=a(t).resize(e.width,e.height,{fit:e.fit});switch(e.format){case"webp":r=r.webp({quality:e.quality});break;case"avif":r=r.avif({quality:e.quality});break;case"jpeg":r=r.jpeg({quality:e.quality});break;case"png":r=r.png({quality:e.quality});break}return r.toBuffer()}let{processImage:n}=await import("ts-images");return await Cc("img",async(r)=>{let m=g.join(r,`out.${e.format}`);return await n({input:t,output:m,format:e.format,quality:e.quality,resize:{width:e.width,height:e.height,fit:e.fit}}),Buffer.from(await Bun.file(m).arrayBuffer())})}async function D(t,e){let a=await d();if(e==="blur"&&a){let c=(await a(t).resize(20).blur(10).toBuffer()).toString("base64"),i=await gs(t);return`data:${U[i.format]||"image/jpeg"};base64,${c}`}if(e==="dominant-color"&&a){let{dominant:o}=await a(t).resize(1,1).toBuffer().then(async(c)=>{let i=await a(c).metadata();return{dominant:{r:128,g:128,b:128}}}).catch(()=>({dominant:{r:128,g:128,b:128}}));return`rgb(${o.r}, ${o.g}, ${o.b})`}let{generatePlaceholder:n}=await import("ts-images"),r=await gs(t),m=it("ph"),l=g.join(m,`in.${r.format==="unknown"?"bin":r.format}`);try{await Bun.write(l,t);let o=e==="blur"?"blur":e==="thumbhash"?"thumbhash":"dominant-color",i=await n(l,{strategy:o,width:o==="thumbhash"?void 0:32});if(e==="dominant-color"&&i.dominantColor)return i.dominantColor;if(i.dataURL)return i.dataURL;return"rgb(128, 128, 128)"}catch{return"rgb(128, 128, 128)"}finally{fe(m)}}function $t(t,e){return(e?t.filter((n)=>n.format===e):t).sort((n,r)=>n.width-r.width).map((n)=>`${n.url} ${n.width}w`).join(", ")}function ln(t){if(!t||Object.keys(t).length===0)return"100vw";return Object.entries(t).sort((a,n)=>{let r=Number.parseInt(a[0].replace(/\D/g,""))||0;return(Number.parseInt(n[0].replace(/\D/g,""))||0)-r}).map(([a,n])=>`(max-width: ${a}) ${n}`).join(", ")+", 100vw"}function Zn(t){let e=t.filter((n)=>n.format==="jpeg");if(e.length===0)return t[Math.floor(t.length/2)];let a=e.sort((n,r)=>n.width-r.width);return a[Math.floor(a.length/2)]}function Qn(t){let e=new Map;for(let a of t){let n=e.get(a.format)||[];n.push(a),e.set(a.format,n)}return e}function er(t){let e=g.extname(t).toLowerCase();return T.includes(e)}function pe(t){return U[t]||"application/octet-stream"}function tr(t){return t.reduce((e,a)=>e+a.size,0)}function nr(t){if(t<1024)return`${t} B`;if(t<1048576)return`${(t/1024).toFixed(1)} KB`;return`${(t/1048576).toFixed(2)} MB`}class ms extends Error{code;constructor(t,e){super(t);this.name="ImageProcessingError",this.code=e}}
3
- export{le,ue,de,Yn,Te,ze,gs,ku,$t,ln,Zn,Qn,er,pe,tr,nr,ms};
2
+ import{it,fe,Cc}from"./chunk-0vyytd9v.js";import v from"fs";import g from"path";import V from"crypto";var le=[320,640,768,1024,1280,1536,1920],ue=["webp","jpeg"],de=80,T=[".jpg",".jpeg",".png",".webp",".avif",".gif",".svg"],U={webp:"image/webp",avif:"image/avif",jpeg:"image/jpeg",png:"image/png"},I=null,M=!1;async function d(){if(M)return I;M=!0;try{let t=await import("sharp");return I=t.default||t,I}catch{return null}}async function Yn(){return await d()!==null}async function Te(){return!0}async function ze(t,e={}){let{widths:a=le,formats:n=ue,quality:r=de,fit:m="cover",placeholder:l="none",outputDir:o=".stx/images",baseUrl:c="/images"}=e,i,h;if(typeof t==="string"){if(h=t,!await Bun.file(t).exists())throw new ms(`Image not found: ${t}`,"NOT_FOUND");i=await Bun.file(t).arrayBuffer().then((s)=>Buffer.from(s))}else h="buffer-input",i=t;let b=V.createHash("sha256").update(i).digest("hex").slice(0,12),j=await gs(i),{width:u,height:x}=j,F=u/x;await v.promises.mkdir(o,{recursive:!0});let B=[],A=g.basename(h,g.extname(h)),f=a.filter((s)=>s<=u);if(!f.includes(u)&&u<=Math.max(...a))f.push(u);f.sort((s,p)=>s-p);for(let s of f){let p=Math.round(s/F);for(let w of n){let S=`${A}-${s}w-${b}.${w}`,P=g.join(o,S),q=`${c}/${S}`,E=await Cu(i,{width:s,height:p,format:w,quality:r,fit:m});await Bun.write(P,E),B.push({path:P,url:q,width:s,height:p,format:w,size:E.length})}}let y;if(l!=="none")y=await D(i,l);return{src:h,variants:B,placeholder:y,width:u,height:x,aspectRatio:F,hash:b}}async function gs(t){let e=typeof t==="string"?Buffer.from(await Bun.file(t).arrayBuffer()):t,a=await d();if(a){let r=await a(e).metadata();return{width:r.width||0,height:r.height||0,format:r.format||"unknown",hasAlpha:r.hasAlpha}}return L(e)}function L(t){if(t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71){let e=t.readUInt32BE(16),a=t.readUInt32BE(20);return{width:e,height:a,format:"png",hasAlpha:!0}}if(t[0]===255&&t[1]===216){let e=2;while(e<t.length){if(t[e]!==255)break;let a=t[e+1];if(a>=192&&a<=207&&a!==196&&a!==200&&a!==204){let r=t.readUInt16BE(e+5);return{width:t.readUInt16BE(e+7),height:r,format:"jpeg",hasAlpha:!1}}let n=t.readUInt16BE(e+2);e+=2+n}}if(t.toString("utf8",0,4)==="RIFF"&&t.toString("utf8",8,12)==="WEBP"){let e=t.toString("utf8",12,16);if(e==="VP8 "){let a=t.readUInt16LE(26)&16383,n=t.readUInt16LE(28)&16383;return{width:a,height:n,format:"webp",hasAlpha:!1}}if(e==="VP8L"){let a=t.readUInt32LE(21),n=(a&16383)+1,r=(a>>14&16383)+1;return{width:n,height:r,format:"webp",hasAlpha:!0}}}if(t.toString("utf8",0,3)==="GIF"){let e=t.readUInt16LE(6),a=t.readUInt16LE(8);return{width:e,height:a,format:"gif",hasAlpha:!0}}throw new ms("Unable to parse image dimensions","PARSE_ERROR")}async function Cu(t,e){let a=await d();if(a){let r=a(t).resize(e.width,e.height,{fit:e.fit});switch(e.format){case"webp":r=r.webp({quality:e.quality});break;case"avif":r=r.avif({quality:e.quality});break;case"jpeg":r=r.jpeg({quality:e.quality});break;case"png":r=r.png({quality:e.quality});break}return r.toBuffer()}let{processImage:n}=await import("ts-images");return await Cc("img",async(r)=>{let m=g.join(r,`out.${e.format}`);return await n({input:t,output:m,format:e.format,quality:e.quality,resize:{width:e.width,height:e.height,fit:e.fit}}),Buffer.from(await Bun.file(m).arrayBuffer())})}async function D(t,e){let a=await d();if(e==="blur"&&a){let c=(await a(t).resize(20).blur(10).toBuffer()).toString("base64"),i=await gs(t);return`data:${U[i.format]||"image/jpeg"};base64,${c}`}if(e==="dominant-color"&&a){let{dominant:o}=await a(t).resize(1,1).toBuffer().then(async(c)=>{let i=await a(c).metadata();return{dominant:{r:128,g:128,b:128}}}).catch(()=>({dominant:{r:128,g:128,b:128}}));return`rgb(${o.r}, ${o.g}, ${o.b})`}let{generatePlaceholder:n}=await import("ts-images"),r=await gs(t),m=it("ph"),l=g.join(m,`in.${r.format==="unknown"?"bin":r.format}`);try{await Bun.write(l,t);let o=e==="blur"?"blur":e==="thumbhash"?"thumbhash":"dominant-color",i=await n(l,{strategy:o,width:o==="thumbhash"?void 0:32});if(e==="dominant-color"&&i.dominantColor)return i.dominantColor;if(i.dataURL)return i.dataURL;return"rgb(128, 128, 128)"}catch{return"rgb(128, 128, 128)"}finally{fe(m)}}function $t(t,e){return(e?t.filter((n)=>n.format===e):t).sort((n,r)=>n.width-r.width).map((n)=>`${n.url} ${n.width}w`).join(", ")}function ln(t){if(!t||Object.keys(t).length===0)return"100vw";return Object.entries(t).sort((a,n)=>{let r=Number.parseInt(a[0].replace(/\D/g,""))||0;return(Number.parseInt(n[0].replace(/\D/g,""))||0)-r}).map(([a,n])=>`(max-width: ${a}) ${n}`).join(", ")+", 100vw"}function Zn(t){let e=t.filter((n)=>n.format==="jpeg");if(e.length===0)return t[Math.floor(t.length/2)];let a=e.sort((n,r)=>n.width-r.width);return a[Math.floor(a.length/2)]}function Qn(t){let e=new Map;for(let a of t){let n=e.get(a.format)||[];n.push(a),e.set(a.format,n)}return e}function er(t){let e=g.extname(t).toLowerCase();return T.includes(e)}function pe(t){return U[t]||"application/octet-stream"}function tr(t){return t.reduce((e,a)=>e+a.size,0)}function nr(t){if(t<1024)return`${t} B`;if(t<1048576)return`${(t/1024).toFixed(1)} KB`;return`${(t/1048576).toFixed(2)} MB`}class ms extends Error{code;constructor(t,e){super(t);this.name="ImageProcessingError",this.code=e}}
3
+ export{le,ue,de,Yn,Te,ze,gs,Cu,$t,ln,Zn,Qn,er,pe,tr,nr,ms};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Bm}from"./chunk-ma5ptt4m.js";import"./chunk-3h4db9yb.js";import"./chunk-z110bf2c.js";import"./chunk-f0sxbgbm.js";import"./chunk-0sj79ha5.js";import"./chunk-n4m50dpk.js";import"./chunk-ngqb22wj.js";import"./chunk-43sgpy4e.js";import"./chunk-fs43342z.js";import"./chunk-0v7555tr.js";import"./chunk-0fm6avxt.js";import"./chunk-bm6y085n.js";import"./chunk-9tv0tw7f.js";import"./chunk-9w9y84t5.js";import"./chunk-8b8az19t.js";import"./chunk-nhyv3w4r.js";import"./chunk-t65f98qv.js";import"./chunk-0adc8x2h.js";import"./chunk-mf5cqv1k.js";import"./chunk-w6ydg43d.js";import"./chunk-2vx2ben8.js";import"./chunk-jr2r2nh5.js";import"./chunk-xnp031ba.js";import"./chunk-388xpdw5.js";import"./chunk-b5qzed8y.js";import"./chunk-p3x84jj0.js";import"./chunk-w98yt4d4.js";import"./chunk-4vz17ytv.js";import"./chunk-phzhmnnm.js";import"./chunk-9928zdej.js";import"./chunk-0jdz31q1.js";import"./chunk-16sfjkc4.js";export{Bm as buildForProduction};
@@ -1,14 +1,14 @@
1
1
  // @bun
2
- import{Ar}from"./chunk-9gptdyqq.js";import{Wr}from"./chunk-c08jvjqt.js";import{a}from"./chunk-fyb9qy7x.js";import{W,ut}from"./chunk-1jxkc6d0.js";import{zc}from"./chunk-sdf4c754.js";import{L,c}from"./chunk-8tfpv6zf.js";var x=/<style\b[^>]*>/iy,R=/<\/style>/gi,b=/<script\b[^>]*>/iy,S=/<template(?=[\s>/])[^>]*>/iy,w=/<\/template\s*>/iy;function _r(e){let r=0,t=0,s=-1;while(r<e.length){let n=e.indexOf("<",r);if(n===-1)return-1;if(e.startsWith("<!--",n)){let g=e.indexOf("-->",n+4);r=g===-1?e.length:g+3;continue}x.lastIndex=n;let u=x.exec(e);if(u){R.lastIndex=n+u[0].length;let g=R.exec(e);r=g===null?e.length:g.index+8;continue}S.lastIndex=n;let o=S.exec(e);if(o){if(t===0)s=n;t++,r=n+o[0].length;continue}w.lastIndex=n;let d=w.exec(e);if(d){if(t>0)t--;r=n+d[0].length;continue}if(b.lastIndex=n,b.test(e))return t>0?s:n;r=n+1}return-1}function re(e,r={}){return new Ar(e,r).routes}import y from"path";var T=new Map;async function h(e,r){let t=e,s=r;if(!t||!s)try{let d=await a();t||=d?.pagesDir||"pages",s||=d?.root||"."}catch{t||="pages",s||="."}let n=y.isAbsolute(t)?t:y.join(s,t),u=T.get(n);if(u)return u;let o=[];try{o=re(".",{pagesDir:n,emit:!1}).map((d)=>d.regex.source).filter(Boolean)}catch{o=[]}return T.set(n,o),o}function E(e){return e.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function l(e){return E(JSON.stringify(e))}function Ae(e){return e.includes("data-stx-runtime")}function Bc(e){let r=/window\.stx\s*\.\s*[A-Za-z_$]|\}\s*=\s*window\.stx\s*;/g;for(let t=r.exec(e);t!==null;t=r.exec(e)){let s=e.slice(Math.max(0,t.index-80),t.index);if(/if\s*\(\s*window\.stx\s*\)|window\.stx\s*&&/.test(s))continue;return!0}return!1}function p(e,r){let t=_r(e),s=e.search(/<!doctype\b/i);if(t!==-1&&(s===-1||t>s))return e.slice(0,t)+r+`
2
+ import{Ar}from"./chunk-388xpdw5.js";import{Wr}from"./chunk-4vz17ytv.js";import{a}from"./chunk-mf5cqv1k.js";import{W,ut}from"./chunk-1jxkc6d0.js";import{Uc}from"./chunk-cxsc37fg.js";import{L,c}from"./chunk-8tfpv6zf.js";var x=/<style\b[^>]*>/iy,R=/<\/style>/gi,b=/<script\b[^>]*>/iy,S=/<template(?=[\s>/])[^>]*>/iy,w=/<\/template\s*>/iy;function _r(e){let r=0,t=0,s=-1;while(r<e.length){let n=e.indexOf("<",r);if(n===-1)return-1;if(e.startsWith("<!--",n)){let g=e.indexOf("-->",n+4);r=g===-1?e.length:g+3;continue}x.lastIndex=n;let u=x.exec(e);if(u){R.lastIndex=n+u[0].length;let g=R.exec(e);r=g===null?e.length:g.index+8;continue}S.lastIndex=n;let o=S.exec(e);if(o){if(t===0)s=n;t++,r=n+o[0].length;continue}w.lastIndex=n;let d=w.exec(e);if(d){if(t>0)t--;r=n+d[0].length;continue}if(b.lastIndex=n,b.test(e))return t>0?s:n;r=n+1}return-1}function re(e,r={}){return new Ar(e,r).routes}import y from"path";var T=new Map;async function h(e,r){let t=e,s=r;if(!t||!s)try{let d=await a();t||=d?.pagesDir||"pages",s||=d?.root||"."}catch{t||="pages",s||="."}let n=y.isAbsolute(t)?t:y.join(s,t),u=T.get(n);if(u)return u;let o=[];try{o=re(".",{pagesDir:n,emit:!1}).map((d)=>d.regex.source).filter(Boolean)}catch{o=[]}return T.set(n,o),o}function E(e){return e.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function l(e){return E(JSON.stringify(e))}function Ae(e){return e.includes("data-stx-runtime")}function zc(e){let r=/window\.stx\s*\.\s*[A-Za-z_$]|\}\s*=\s*window\.stx\s*;/g;for(let t=r.exec(e);t!==null;t=r.exec(e)){let s=e.slice(Math.max(0,t.index-80),t.index);if(/if\s*\(\s*window\.stx\s*\)|window\.stx\s*&&/.test(s))continue;return!0}return!1}function p(e,r){let t=_r(e),s=e.search(/<!doctype\b/i);if(t!==-1&&(s===-1||t>s))return e.slice(0,t)+r+`
3
3
  `+e.slice(t);let n=Wr(e);if(n!==null)return`${e.slice(0,n)}
4
4
  ${r}${e.slice(n)}`;if(e.includes("</head>")){let o=L(e);return e.slice(0,o)+r+`
5
5
  `+e.slice(o)}if(W(e))return ut(e,(o)=>`${o}
6
6
  ${r}`);return`${r}
7
- ${e}`}async function Cr(e,r){if(e.includes("data-stx-runtime")||e.includes("window.stx.state")||e.includes("STX Signals Runtime"))return e;if(r.buildMode==="serve"){let{getServeClientAsset:n}=await import("./chunk-vhk7a79j.js"),{url:u}=await n("runtime",r.debug===!0);return p(e,`<script data-stx-runtime src="${u}"></script>`)}if(r.buildMode==="compile")return p(e,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:t}=await import("./chunk-vhk7a79j.js"),s=await t(r.debug);return p(e,`<script data-stx-scoped data-stx-runtime>${s}</script>`)}function O(e){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test(e)}function Fc(e){if(e.includes("data-stx-tooltip-runtime")||!O(e))return e;let r=`<script data-stx-scoped data-stx-tooltip-runtime>${zc()}</script>`,t=c(e);if(t===-1)return`${e}
7
+ ${e}`}async function Cr(e,r){if(e.includes("data-stx-runtime")||e.includes("window.stx.state")||e.includes("STX Signals Runtime"))return e;if(r.buildMode==="serve"){let{getServeClientAsset:n}=await import("./chunk-e0tvd7jj.js"),{url:u}=await n("runtime",r.debug===!0);return p(e,`<script data-stx-runtime src="${u}"></script>`)}if(r.buildMode==="compile")return p(e,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:t}=await import("./chunk-e0tvd7jj.js"),s=await t(r.debug);return p(e,`<script data-stx-scoped data-stx-runtime>${s}</script>`)}function O(e){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test(e)}function Hc(e){if(e.includes("data-stx-tooltip-runtime")||!O(e))return e;let r=`<script data-stx-scoped data-stx-tooltip-runtime>${Uc()}</script>`,t=c(e);if(t===-1)return`${e}
8
8
  ${r}`;return`${e.slice(0,t)}${r}
9
- ${e.slice(t)}`}var C=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function M(e){return C.test(e)||e.includes("__stxRouter)return")||e.includes("__stxRouter=true")}async function Pe(e,r){if(!e.includes("</body>"))return e;if(M(e))return e;let t=r?.router,s="",n="";{let i={};if(t){if(t.container)i.container=t.container;if(t.interceptAllLinks!==void 0)i.interceptAllLinks=t.interceptAllLinks;if(t.progress!==void 0)i.progress=t.progress;if(t.viewTransitions!==void 0)i.viewTransitions=t.viewTransitions;if(t.viewTransitionDuration!==void 0)i.viewTransitionDuration=t.viewTransitionDuration;if(t.viewTransitionEasing!==void 0)i.viewTransitionEasing=t.viewTransitionEasing;if(t.scrollToTop!==void 0)i.scrollToTop=t.scrollToTop;if(t.scrollRestoration!==void 0)i.scrollRestoration=t.scrollRestoration;if(t.prefetch!==void 0)i.prefetch=t.prefetch;if(t.cache!==void 0)i.cache=t.cache;if(t.progressColor!==void 0)i.progressColor=t.progressColor;if(t.progressHeight!==void 0)i.progressHeight=t.progressHeight;if(t.prefetchVisible!==void 0)i.prefetchVisible=t.prefetchVisible;if(t.prefetchVisibleMax!==void 0)i.prefetchVisibleMax=t.prefetchVisibleMax;if(t.prefetchBudgetBytes!==void 0)i.prefetchBudgetBytes=t.prefetchBudgetBytes;if(t.keepOpening!==void 0)i.keepOpening=t.keepOpening}try{let f=await h(r?.pagesDir,r?.root);if(f.length>0)if(r?.buildMode==="serve"){let{registerServeModuleBundle:_}=await import("./chunk-vhk7a79j.js");n=`<script data-stx-owned-routes src="${_(`(window.__stxRouterConfig=window.__stxRouterConfig||{}).ownedRoutes=${l(f)};
9
+ ${e.slice(t)}`}var C=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function M(e){return C.test(e)||e.includes("__stxRouter)return")||e.includes("__stxRouter=true")}async function Pe(e,r){if(!e.includes("</body>"))return e;if(M(e))return e;let t=r?.router,s="",n="";{let i={};if(t){if(t.container)i.container=t.container;if(t.interceptAllLinks!==void 0)i.interceptAllLinks=t.interceptAllLinks;if(t.progress!==void 0)i.progress=t.progress;if(t.viewTransitions!==void 0)i.viewTransitions=t.viewTransitions;if(t.viewTransitionDuration!==void 0)i.viewTransitionDuration=t.viewTransitionDuration;if(t.viewTransitionEasing!==void 0)i.viewTransitionEasing=t.viewTransitionEasing;if(t.scrollToTop!==void 0)i.scrollToTop=t.scrollToTop;if(t.scrollRestoration!==void 0)i.scrollRestoration=t.scrollRestoration;if(t.prefetch!==void 0)i.prefetch=t.prefetch;if(t.cache!==void 0)i.cache=t.cache;if(t.progressColor!==void 0)i.progressColor=t.progressColor;if(t.progressHeight!==void 0)i.progressHeight=t.progressHeight;if(t.prefetchVisible!==void 0)i.prefetchVisible=t.prefetchVisible;if(t.prefetchVisibleMax!==void 0)i.prefetchVisibleMax=t.prefetchVisibleMax;if(t.prefetchBudgetBytes!==void 0)i.prefetchBudgetBytes=t.prefetchBudgetBytes;if(t.keepOpening!==void 0)i.keepOpening=t.keepOpening}try{let f=await h(r?.pagesDir,r?.root);if(f.length>0)if(r?.buildMode==="serve"){let{registerServeModuleBundle:_}=await import("./chunk-e0tvd7jj.js");n=`<script data-stx-owned-routes src="${_(`(window.__stxRouterConfig=window.__stxRouterConfig||{}).ownedRoutes=${l(f)};
10
10
  `)}"></script>
11
11
  `}else i.ownedRoutes=f}catch{}if(Object.keys(i).length>0)s=`<script>window.__stxRouterConfig=${l(i)};</script>
12
- `}let{getCachedRouterScript:u,getServeClientAsset:o}=await import("./chunk-vhk7a79j.js"),d=r?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':r?.buildMode==="serve"?`<script data-stx-router src="${(await o("router")).url}"></script>`:`<script data-stx-router>${await u()}</script>`,g=c(e);return e.slice(0,g)+s+n+d+`
12
+ `}let{getCachedRouterScript:u,getServeClientAsset:o}=await import("./chunk-e0tvd7jj.js"),d=r?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':r?.buildMode==="serve"?`<script data-stx-router src="${(await o("router")).url}"></script>`:`<script data-stx-router>${await u()}</script>`,g=c(e);return e.slice(0,g)+s+n+d+`
13
13
  </body>`+e.slice(g+7)}
14
- export{_r,re,Ae,Bc,Cr,Fc,Pe};
14
+ export{_r,re,Ae,zc,Cr,Hc,Pe};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ua,Ym}from"./chunk-11c7xg1z.js";export{Ua as definePlugin,Ym as pluginManager};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{qo,Xa,Ga,ey}from"./chunk-fzcqw147.js";export{qo as NATIVE_COMPONENTS,Xa as compileToNative,Ga as createHotReloadServer,ey as default};
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import{existsSync as x,realpathSync as b,statSync as y}from"fs";import f from"path";import k from"process";var E=/^[\w-]+(?:\/[\w-]+)*$/,j=/^[\w-]+$/;async function rs(s,e){let a=f.resolve(s,e.dir);if(!e.languages?.length)throw Error("messages.languages must name at least one language");let n=new Map,r=new Map;for(let t of e.languages){if(!j.test(t))throw Error(`messages: "${t}" is not a language directory name`);let g=f.join(a,t);if(!x(g))throw Error(`messages: ${f.relative(s,g)} does not exist`);let o=new Map;for(let l of[...new Bun.Glob("**/*.{ts,js,mjs,json}").scanSync({cwd:g})].sort()){if(/\.(?:test|spec|d)\.[^.]+$/.test(l))continue;let c=l.replace(/\.[^./]+$/,"").split(f.sep).join("/");if(!E.test(c))throw Error(`messages: ${t}/${l} is not an area name`);if(o.has(c))throw Error(`messages: ${t}/${c} is defined twice`);let d=f.join(g,l),i=await import(d),m=Object.keys(i).filter((M)=>M!=="default");if(m.length)throw Error(`messages: ${t}/${l} exports ${m.join(", ")}; a message module exports its messages as default, and nothing else`);let u=i.default,p=u!==null&&typeof u==="object"&&!Array.isArray(u)?JSON.stringify(u):void 0;if(p===void 0||!Bun.deepEquals(JSON.parse(p),u,!0))throw Error(`messages: ${t}/${l} must export plain data (an object JSON can hold) as default`);o.set(c,p),n.set(d,{language:t,area:c})}r.set(t,o)}return{files:n,data:r}}function S(s,e){return`stx-messages:${s}:${e}`}function _(s,e){let a=JSON.stringify(S(s,e));return`var kept = globalThis.__stxMessages || (globalThis.__stxMessages = {});
3
- export default kept[${a}] || (kept[${a}] = {});`}var w=new Map;function ss(s){let e=[s];try{e.push(b(s))}catch{}for(let a of[...e])if(a.startsWith("/private/"))e.push(a.slice(8));return[...new Set(e)]}function xm(s,e=k.env){if(!s.messages||e.STX_PAGE_MESSAGES==="0")return!1;return e.STX_PAGE_MESSAGES==="1"||e.NODE_ENV==="production"}async function Sm(s,e){let a=f.resolve(s,e.dir),n=e.languages.map((i)=>{try{return`${i}:${y(f.join(a,i)).mtimeMs}`}catch{return`${i}:-`}}).join("|"),r=`${a}\x00${e.languages.join(",")}\x00${e.fallback??""}\x00${JSON.stringify(e.preload??[])}`,t=w.get(r);if(t&&t.signature===n)return t.messages;let g=await rs(s,e),o=new Map;for(let[i,{language:m,area:u}]of g.files){let p=_(m,u);for(let M of ss(i))o.set(M,p)}let l=e.fallback??e.languages[0];if(!e.languages.includes(l))throw Error(`messages.fallback "${l}" is not one of messages.languages`);let c=e.preload==="all"?[...e.languages]:[...e.preload??[]];for(let i of c)if(!e.languages.includes(i))throw Error(`messages.preload "${i}" is not one of messages.languages`);let d={...g,stubs:o,languages:[...e.languages],fallback:l,preload:c};return w.set(r,{signature:n,messages:d}),d}function km(...s){let e=new Set;for(let a of s){if(!a||!a.includes("stx-messages:"))continue;for(let n of a.matchAll(/stx-messages:[\w-]+:([\w/-]+)/g))e.add(n[1])}return e}function _m(s,e){let a=/<html\b[^>]*>/i.exec(s)?.[0]??"",n=/\slang\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(a),r=(n?n[1]??n[2]??n[3]??"":"").trim().toLowerCase(),t=new Map(e.languages.map((o)=>[o.toLowerCase(),o])),g=t.get(r)??t.get(r.split(/[-_]/)[0]??"");if(!g)return[...e.languages];return[...new Set([g,e.fallback,...e.preload??[]])]}var h=new WeakMap;function Cm(s,e,a){let n=[...a].sort(),r=h.get(s);if(!r)h.set(s,r=new Map);let t=`${e.join(",")}\x00${n.join(",")}`;if(r.has(t))return r.get(t);let g=P(s,e,n);return r.set(t,g),g}function P(s,e,a){let n=[];for(let r of e){let t=s.data.get(r);if(!t)continue;for(let g of a){let o=t.get(g);if(o!==void 0)n.push(`put(${JSON.stringify(S(r,g))},${JSON.stringify(o)})`)}}if(n.length===0)return null;return`;(function(){var kept=globalThis.__stxMessages||(globalThis.__stxMessages={}),filled=globalThis.__stxMessagesFilled||(globalThis.__stxMessagesFilled={});function put(key,json){if(filled[key])return;filled[key]=1;var into=kept[key]||(kept[key]={}),data=JSON.parse(json);for(var name in data)into[name]=data[name]}
3
+ export default kept[${a}] || (kept[${a}] = {});`}var w=new Map;function ss(s){let e=[s];try{e.push(b(s))}catch{}for(let a of[...e])if(a.startsWith("/private/"))e.push(a.slice(8));return[...new Set(e)]}function km(s,e=k.env){if(!s.messages||e.STX_PAGE_MESSAGES==="0")return!1;return e.STX_PAGE_MESSAGES==="1"||e.NODE_ENV==="production"}async function _m(s,e){let a=f.resolve(s,e.dir),n=e.languages.map((i)=>{try{return`${i}:${y(f.join(a,i)).mtimeMs}`}catch{return`${i}:-`}}).join("|"),r=`${a}\x00${e.languages.join(",")}\x00${e.fallback??""}\x00${JSON.stringify(e.preload??[])}`,t=w.get(r);if(t&&t.signature===n)return t.messages;let g=await rs(s,e),o=new Map;for(let[i,{language:m,area:u}]of g.files){let p=_(m,u);for(let M of ss(i))o.set(M,p)}let l=e.fallback??e.languages[0];if(!e.languages.includes(l))throw Error(`messages.fallback "${l}" is not one of messages.languages`);let c=e.preload==="all"?[...e.languages]:[...e.preload??[]];for(let i of c)if(!e.languages.includes(i))throw Error(`messages.preload "${i}" is not one of messages.languages`);let d={...g,stubs:o,languages:[...e.languages],fallback:l,preload:c};return w.set(r,{signature:n,messages:d}),d}function Cm(...s){let e=new Set;for(let a of s){if(!a||!a.includes("stx-messages:"))continue;for(let n of a.matchAll(/stx-messages:[\w-]+:([\w/-]+)/g))e.add(n[1])}return e}function Em(s,e){let a=/<html\b[^>]*>/i.exec(s)?.[0]??"",n=/\slang\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(a),r=(n?n[1]??n[2]??n[3]??"":"").trim().toLowerCase(),t=new Map(e.languages.map((o)=>[o.toLowerCase(),o])),g=t.get(r)??t.get(r.split(/[-_]/)[0]??"");if(!g)return[...e.languages];return[...new Set([g,e.fallback,...e.preload??[]])]}var h=new WeakMap;function Tm(s,e,a){let n=[...a].sort(),r=h.get(s);if(!r)h.set(s,r=new Map);let t=`${e.join(",")}\x00${n.join(",")}`;if(r.has(t))return r.get(t);let g=P(s,e,n);return r.set(t,g),g}function P(s,e,a){let n=[];for(let r of e){let t=s.data.get(r);if(!t)continue;for(let g of a){let o=t.get(g);if(o!==void 0)n.push(`put(${JSON.stringify(S(r,g))},${JSON.stringify(o)})`)}}if(n.length===0)return null;return`;(function(){var kept=globalThis.__stxMessages||(globalThis.__stxMessages={}),filled=globalThis.__stxMessagesFilled||(globalThis.__stxMessagesFilled={});function put(key,json){if(filled[key])return;filled[key]=1;var into=kept[key]||(kept[key]={}),data=JSON.parse(json);for(var name in data)into[name]=data[name]}
4
4
  ${n.join(`;
5
5
  `)};
6
6
  })();`}
7
- export{rs,ss,xm,Sm,km,_m,Cm};
7
+ export{rs,ss,km,_m,Cm,Em,Tm};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{by,Os,gi,Ns,kr,mi,hi,wg,Ms,Ds,Ls,yi,Fc,vg,Ot}from"./chunk-9w9y84t5.js";import"./chunk-8b8az19t.js";import"./chunk-nhyv3w4r.js";import"./chunk-mf5cqv1k.js";import"./chunk-w6ydg43d.js";import"./chunk-2vx2ben8.js";import"./chunk-jr2r2nh5.js";import"./chunk-xnp031ba.js";import"./chunk-388xpdw5.js";import{G}from"./chunk-b5qzed8y.js";import"./chunk-p3x84jj0.js";import"./chunk-w98yt4d4.js";import"./chunk-4vz17ytv.js";import"./chunk-phzhmnnm.js";import"./chunk-9928zdej.js";import"./chunk-0jdz31q1.js";import"./chunk-16sfjkc4.js";export{wg as bindLoopInterpolations,by as clearScriptScanCache,Ms as convertServerLoopAttributesToDirectives,mi as convertSignalDirectivesToAttributes,Ds as convertSignalLoopsToAttributes,kr as extractClientSignalNames,G as extractExports,Fc as findMarkupIndexOutsideScripts,Ns as hasSignalsSyntax,gi as parseLoopExpression,hi as preEvalLiteralReactiveIfs,Ls as processScriptSetup,yi as processSignals,vg as rewriteStxImportSpecifiers,Os as scanScriptTags,Ot as stripStxRuntimeImports};
@@ -1,13 +1,13 @@
1
1
  // @bun
2
- import{Z}from"./chunk-2vdbt2a7.js";import R from"path";var B=/__stxModules\["((?:[^"\\]|\\.)*)"\]/g;function ns(...d){let g=new Set;for(let l of d){if(!l||!l.includes("__stxModules["))continue;for(let e of l.matchAll(B))try{g.add(JSON.parse(`"${e[1]}"`))}catch{}}return[...g].sort()}function $o(...d){let g=new Map,l=(e,n)=>{let o=g.get(e);if(o===null)return;if(n===null){g.set(e,null);return}let s=o??new Set;for(let i of n)s.add(i);g.set(e,s)};for(let e of d){if(!e||!e.includes("__stxModules["))continue;let n=[];for(let s of e.matchAll(/([\w$]+)\s*=\s*globalThis\.__stxModules\s*&&\s*globalThis\.__stxModules\["((?:[^"\\]|\\.)*)"\]/g)){let i;try{i=JSON.parse(`"${s[2]}"`)}catch{continue}n.push({variable:s[1],id:i,start:s.index+s[0].length,end:e.length})}let o=e.match(/__stxModules\["(?:[^"\\]|\\.)*"\]/g)?.length??0;if(n.length===0||o!==n.length){for(let s of ns(e))l(s,null);continue}for(let[s,i]of n.entries()){let p=n.slice(s+1).find((h)=>h.variable===i.variable);i.end=p?p.start:e.length}for(let s of n){let i=new Set,p=!1,h=s.variable.replace(/[$]/g,"\\$&"),r=e.slice(s.start,s.end);for(let a of r.matchAll(new RegExp(`(?<![\\w$.])${h}(?![\\w$])`,"g"))){let f=r.slice(a.index+s.variable.length,a.index+s.variable.length+200),c=/^\s*\[\s*(["'])([A-Za-z_$][\w$]*)\1\s*\]/.exec(f)??/^\s*\.\s*([A-Za-z_$][\w$]*)/.exec(f);if(c){i.add(c[c.length-1]);continue}if(/^\s*[!=]==?\s*(?:undefined|void 0)\b/.test(f))continue;p=!0;break}l(s.id,p?null:i)}}return g}function k(d,g,l){let e=[],n=[];return d.forEach((o,s)=>{let i=o.startsWith("npm:")?o.slice(4):R.resolve(g,o),p=`__stxRegistered${s}`,h=JSON.stringify(o),r=l?.get(o);if(r&&[...r].every((a)=>/^[A-Za-z_$][\w$]*$/.test(a))){let a=[...r].sort(),f=a.map((m,_)=>`${m} as ${p}_${_}`);e.push(a.length>0?`import { ${f.join(", ")} } from ${JSON.stringify(i)};`:`import ${JSON.stringify(i)};`);let c=a.map((m,_)=>`get ${JSON.stringify(m)}() { return ${p}_${_}; }`).join(", ");n.push(`if (!globalThis.__stxModules[${h}]) globalThis.__stxModules[${h}] = { ${c} };`);return}e.push(`import * as ${p} from ${JSON.stringify(i)};`),n.push(`if (!globalThis.__stxModules[${h}]) globalThis.__stxModules[${h}] = ${p};`)}),[...e,"globalThis.__stxModules = globalThis.__stxModules || {};",...n].join(`
3
- `)}async function vm(d,g={}){if(d.length===0)return null;let l=process.cwd(),e=k(d,l,g.names),n;try{let{bundleClientScript:f}=await import("./chunk-g6s4151k.js"),c=()=>f(e,R.join(l,".stx-module-registry.ts"),{projectRoot:l,minify:g.minify,externalizeUserModules:!1,collectInputs:g.collectInputs,throwOnFailure:!0});try{n=await c()}catch(m){if(!g.names)throw m;e=k(d,l,void 0),n=await c()}}catch(f){let{formatBuildFailure:c}=await import("./chunk-nrap20qt.js"),m=c(f);console.warn(`[stx] could not build the page module registry (#1957): ${m}`);let _=`[stx] the page module registry did not build, so ${d.join(", ")} cannot load (#1957): ${m}`;return`;console.error(${JSON.stringify(_)});`}let{transformAutoImports:o,generateAutoImportDestructuring:s}=await import("./chunk-k0b1t59r.js"),i=o(n),p=s(i.stxImports,i.browserImports),{transformStoreImports:h}=await import("./chunk-q9yahsww.js");n=h(i.code);let r=JSON.stringify(new Bun.CryptoHasher("md5").update(e).digest("hex").slice(0,12)),a=Z(n);return[a?";await (async function() {":";(function() {"," var __stxBundles = globalThis.__stxModuleBundles || (globalThis.__stxModuleBundles = {});",` if (__stxBundles[${r}]) { ${a?"await __stxBundles["+r+"];":""} return; }`,a?`var __resolveBundle, __rejectBundle;
2
+ import{Z}from"./chunk-0adc8x2h.js";import R from"path";var B=/__stxModules\["((?:[^"\\]|\\.)*)"\]/g;function ns(...d){let g=new Set;for(let l of d){if(!l||!l.includes("__stxModules["))continue;for(let e of l.matchAll(B))try{g.add(JSON.parse(`"${e[1]}"`))}catch{}}return[...g].sort()}function $o(...d){let g=new Map,l=(e,n)=>{let o=g.get(e);if(o===null)return;if(n===null){g.set(e,null);return}let s=o??new Set;for(let i of n)s.add(i);g.set(e,s)};for(let e of d){if(!e||!e.includes("__stxModules["))continue;let n=[];for(let s of e.matchAll(/([\w$]+)\s*=\s*globalThis\.__stxModules\s*&&\s*globalThis\.__stxModules\["((?:[^"\\]|\\.)*)"\]/g)){let i;try{i=JSON.parse(`"${s[2]}"`)}catch{continue}n.push({variable:s[1],id:i,start:s.index+s[0].length,end:e.length})}let o=e.match(/__stxModules\["(?:[^"\\]|\\.)*"\]/g)?.length??0;if(n.length===0||o!==n.length){for(let s of ns(e))l(s,null);continue}for(let[s,i]of n.entries()){let p=n.slice(s+1).find((h)=>h.variable===i.variable);i.end=p?p.start:e.length}for(let s of n){let i=new Set,p=!1,h=s.variable.replace(/[$]/g,"\\$&"),r=e.slice(s.start,s.end);for(let a of r.matchAll(new RegExp(`(?<![\\w$.])${h}(?![\\w$])`,"g"))){let f=r.slice(a.index+s.variable.length,a.index+s.variable.length+200),c=/^\s*\[\s*(["'])([A-Za-z_$][\w$]*)\1\s*\]/.exec(f)??/^\s*\.\s*([A-Za-z_$][\w$]*)/.exec(f);if(c){i.add(c[c.length-1]);continue}if(/^\s*[!=]==?\s*(?:undefined|void 0)\b/.test(f))continue;p=!0;break}l(s.id,p?null:i)}}return g}function k(d,g,l){let e=[],n=[];return d.forEach((o,s)=>{let i=o.startsWith("npm:")?o.slice(4):R.resolve(g,o),p=`__stxRegistered${s}`,h=JSON.stringify(o),r=l?.get(o);if(r&&[...r].every((a)=>/^[A-Za-z_$][\w$]*$/.test(a))){let a=[...r].sort(),f=a.map((m,_)=>`${m} as ${p}_${_}`);e.push(a.length>0?`import { ${f.join(", ")} } from ${JSON.stringify(i)};`:`import ${JSON.stringify(i)};`);let c=a.map((m,_)=>`get ${JSON.stringify(m)}() { return ${p}_${_}; }`).join(", ");n.push(`if (!globalThis.__stxModules[${h}]) globalThis.__stxModules[${h}] = { ${c} };`);return}e.push(`import * as ${p} from ${JSON.stringify(i)};`),n.push(`if (!globalThis.__stxModules[${h}]) globalThis.__stxModules[${h}] = ${p};`)}),[...e,"globalThis.__stxModules = globalThis.__stxModules || {};",...n].join(`
3
+ `)}async function Sm(d,g={}){if(d.length===0)return null;let l=process.cwd(),e=k(d,l,g.names),n;try{let{bundleClientScript:f}=await import("./chunk-wq17dce6.js"),c=()=>f(e,R.join(l,".stx-module-registry.ts"),{projectRoot:l,minify:g.minify,externalizeUserModules:!1,collectInputs:g.collectInputs,throwOnFailure:!0});try{n=await c()}catch(m){if(!g.names)throw m;e=k(d,l,void 0),n=await c()}}catch(f){let{formatBuildFailure:c}=await import("./chunk-nrap20qt.js"),m=c(f);console.warn(`[stx] could not build the page module registry (#1957): ${m}`);let _=`[stx] the page module registry did not build, so ${d.join(", ")} cannot load (#1957): ${m}`;return`;console.error(${JSON.stringify(_)});`}let{transformAutoImports:o,generateAutoImportDestructuring:s}=await import("./chunk-7fc0vrs5.js"),i=o(n),p=s(i.stxImports,i.browserImports),{transformStoreImports:h}=await import("./chunk-q9yahsww.js");n=h(i.code);let r=JSON.stringify(new Bun.CryptoHasher("md5").update(e).digest("hex").slice(0,12)),a=Z(n);return[a?";await (async function() {":";(function() {"," var __stxBundles = globalThis.__stxModuleBundles || (globalThis.__stxModuleBundles = {});",` if (__stxBundles[${r}]) { ${a?"await __stxBundles["+r+"];":""} return; }`,a?`var __resolveBundle, __rejectBundle;
4
4
  __stxBundles[${r}]=new Promise(function(resolve,reject){__resolveBundle=resolve;__rejectBundle=reject;});
5
5
  __stxBundles[${r}].catch(function(){});
6
6
  try {`:`__stxBundles[${r}] = true;`,p,n,a?`__resolveBundle();
7
7
  } catch(error) { delete __stxBundles[${r}]; __rejectBundle(error); throw error; }`:"","})();"].join(`
8
8
  `)}var j=/^import(?:[ \t]*(\{[^}]*\})[ \t]*from|[ \t]*\*[ \t]*as[ \t]+([\w$]+)[ \t]+from)?[ \t]*["']\.\/(chunk-[\w-]+)\.js["'][ \t]*;?[ \t]*$/gm,O=/^export\s*\{([^}]*)\}\s*;?[ \t]*$/gm,I=new Set(["__preload","__chunks"]),N=/^("[^"]*"|[\w$]+)(?:\s+as\s+("[^"]*"|[\w$]+))?$/;function P(d){let g=[],l=[],e=!0,o=d.replace(/^var __chunkGraphs;[\s\S]*?^var __chunks = [\s\S]*?^\};[ \t]*\n?/m,"").replace(/^__chunks\(import\.meta\.url,[^\n]*\);[ \t]*\n?/gm,"").replace(j,(h,r,a,f)=>{let c=`__stxChunkExports${g.length}`;if(g.push(f),l.push(`var ${c} = __stxChunk(${JSON.stringify(f)});`),a)l.push(`var ${a} = ${c};`);else if(r)for(let m of r.slice(1,-1).split(",")){let _=m.trim();if(!_)continue;let w=N.exec(_);if(!w){e=!1;continue}if(I.has(w[1]))continue;let M=w[1].startsWith('"')?JSON.parse(w[1]):w[1],t=w[2]??w[1];if(t.startsWith('"')){e=!1;continue}l.push(`var ${t} = ${c}[${JSON.stringify(M)}];`)}return""});if(!e)throw Error("an import it does not read");let s=[];o=o.replace(/\(\s*__preload\([^)]*\)\s*,\s*import\(\s*["']\.\/(chunk-[\w-]+)\.js["']\s*\)\s*\)|\bimport\(\s*["']\.\/(chunk-[\w-]+)\.js["']\s*\)/g,(h,r,a)=>{let f=r??a;return s.push(f),`Promise.resolve().then(function () { return __stxChunk(${JSON.stringify(f)}); })`});let i=[];o=o.replace(O,(h,r)=>{for(let a of r.split(",")){let f=a.trim();if(!f)continue;let c=N.exec(f);if(!c||c[1].startsWith('"')){e=!1;continue}if(I.has(c[1]))continue;let m=c[2]??c[1];i.push([c[1],m.startsWith('"')?JSON.parse(m):m])}return""});let p=[/\bimport\.meta\b/,/\b__chunks\b/,/\b__preload\b/,/^\s*export\s+(?:default\b|const\b|let\b|var\b|function\b|class\b|async\b|\*|\{)/m,/\bfrom\s*["']\.\/chunk-/,/^\s*import\s*["']\.\/chunk-/m].find((h)=>h.test(o));if(!e||p)throw Error(`${p?`${p.source} is left in it`:"an export it does not read"}`);return{reads:l.join(`
9
- `),chunks:g,lazy:s,body:o,exports:i}}function su(d){if(/\bexport\s+(?:let|var)\b/.test(d))return!0;if(d.length/Math.max(1,d.split(`
10
- `).length)>200)return!1;for(let g of d.matchAll(/\bexport\s*\{([^}]*)\}(?!\s*from\b)/g))for(let l of g[1].split(",")){let e=l.trim().split(/\s+as\s+/)[0].trim();if(!/^[A-Za-z_$][\w$]*$/.test(e))continue;let n=e.replace(/[$]/g,"\\$&");if(!new RegExp(`(?<![\\w$.])(?:let|var)\\s+${n}(?![\\w$])`,"g").test(d))continue;let s=new RegExp(`(?<![\\w$.])${n}\\s*(?:=(?![=>])|[-+*/%&|^]=|\\*\\*=|<<=|>>>?=|&&=|\\|\\|=|\\?\\?=|\\+\\+|--)|(?:\\+\\+|--)\\s*${n}(?![\\w$])`,"g"),i=new RegExp(`(?<![\\w$.])(?:let|var|const)\\s+${n}\\s*=`,"g");if((d.match(s)?.length??0)>(d.match(i)?.length??0))return!0}return!1}async function Ro(d,g={}){let l=d.filter((n)=>n.ids.length>0);if(l.length===0)return{chunks:new Map,routes:new Map,reads:new Map};let e=process.cwd();try{let{bundleClientEntriesSplit:n}=await import("./chunk-g6s4151k.js"),o=[],s=await n(new Map(l.map((t)=>[t.name,k(t.ids,e,t.names)])),{projectRoot:e,filePath:R.join(e,".stx-module-registry.ts"),collectInputs:o});g.collectInputs?.push(...o);let{transformAutoImports:i,generateAutoImportDestructuring:p}=await import("./chunk-k0b1t59r.js"),{transformStoreImports:h}=await import("./chunk-q9yahsww.js"),r=new Map;for(let[t,u]of[...s.chunks,...s.entries])try{r.set(t,P(u))}catch(x){throw Error(`cannot read ${t}: ${x instanceof Error?x.message:String(x)}`)}for(let[t,u]of[...s.chunks,...s.entries])if(/\b__esm\(/.test(u))throw Error(`${t} initialises a module lazily`);for(let t of o)if(/\.(?:[cm]?[jt]sx?)$/.test(t)&&su(await Bun.file(t).text()))throw Error(`${t} exports a binding that changes after it is read`);let a=new Set,f=new Set,c=(t)=>{if(f.has(t))return;if(a.has(t))throw Error(`the chunks import each other (${t})`);a.add(t);for(let u of r.get(t)?.chunks??[]){if(!r.has(u))throw Error(`${t} imports ${u}, which was not built`);c(u)}for(let u of r.get(t)?.lazy??[])if(!r.has(u))throw Error(`${t} imports ${u}, which was not built`);a.delete(t),f.add(t)};for(let t of r.keys())c(t);let m=(t)=>{let u=i(t.body);return{prelude:p(u.stxImports,u.browserImports),body:h(u.code)}},_=new Map;for(let t of s.chunks.keys()){let u=r.get(t),{prelude:x,body:v}=m(u),b=u.exports.map(([S,y])=>`get ${JSON.stringify(y)}() { return ${S}; }`).join(", ");_.set(t,`function (__stxChunk) {
9
+ `),chunks:g,lazy:s,body:o,exports:i}}function iu(d){if(/\bexport\s+(?:let|var)\b/.test(d))return!0;if(d.length/Math.max(1,d.split(`
10
+ `).length)>200)return!1;for(let g of d.matchAll(/\bexport\s*\{([^}]*)\}(?!\s*from\b)/g))for(let l of g[1].split(",")){let e=l.trim().split(/\s+as\s+/)[0].trim();if(!/^[A-Za-z_$][\w$]*$/.test(e))continue;let n=e.replace(/[$]/g,"\\$&");if(!new RegExp(`(?<![\\w$.])(?:let|var)\\s+${n}(?![\\w$])`,"g").test(d))continue;let s=new RegExp(`(?<![\\w$.])${n}\\s*(?:=(?![=>])|[-+*/%&|^]=|\\*\\*=|<<=|>>>?=|&&=|\\|\\|=|\\?\\?=|\\+\\+|--)|(?:\\+\\+|--)\\s*${n}(?![\\w$])`,"g"),i=new RegExp(`(?<![\\w$.])(?:let|var|const)\\s+${n}\\s*=`,"g");if((d.match(s)?.length??0)>(d.match(i)?.length??0))return!0}return!1}async function Ro(d,g={}){let l=d.filter((n)=>n.ids.length>0);if(l.length===0)return{chunks:new Map,routes:new Map,reads:new Map};let e=process.cwd();try{let{bundleClientEntriesSplit:n}=await import("./chunk-wq17dce6.js"),o=[],s=await n(new Map(l.map((t)=>[t.name,k(t.ids,e,t.names)])),{projectRoot:e,filePath:R.join(e,".stx-module-registry.ts"),collectInputs:o});g.collectInputs?.push(...o);let{transformAutoImports:i,generateAutoImportDestructuring:p}=await import("./chunk-7fc0vrs5.js"),{transformStoreImports:h}=await import("./chunk-q9yahsww.js"),r=new Map;for(let[t,u]of[...s.chunks,...s.entries])try{r.set(t,P(u))}catch(x){throw Error(`cannot read ${t}: ${x instanceof Error?x.message:String(x)}`)}for(let[t,u]of[...s.chunks,...s.entries])if(/\b__esm\(/.test(u))throw Error(`${t} initialises a module lazily`);for(let t of o)if(/\.(?:[cm]?[jt]sx?)$/.test(t)&&iu(await Bun.file(t).text()))throw Error(`${t} exports a binding that changes after it is read`);let a=new Set,f=new Set,c=(t)=>{if(f.has(t))return;if(a.has(t))throw Error(`the chunks import each other (${t})`);a.add(t);for(let u of r.get(t)?.chunks??[]){if(!r.has(u))throw Error(`${t} imports ${u}, which was not built`);c(u)}for(let u of r.get(t)?.lazy??[])if(!r.has(u))throw Error(`${t} imports ${u}, which was not built`);a.delete(t),f.add(t)};for(let t of r.keys())c(t);let m=(t)=>{let u=i(t.body);return{prelude:p(u.stxImports,u.browserImports),body:h(u.code)}},_=new Map;for(let t of s.chunks.keys()){let u=r.get(t),{prelude:x,body:v}=m(u),b=u.exports.map(([S,y])=>`get ${JSON.stringify(y)}() { return ${S}; }`).join(", ");_.set(t,`function (__stxChunk) {
11
11
  ${x}
12
12
  ${u.reads}
13
13
  ${v}
@@ -18,4 +18,4 @@ ${x}
18
18
  ${u.reads}
19
19
  ${v}
20
20
  })();`);let b=new Set,S=(y)=>{if(b.has(y))return;b.add(y);let E=r.get(y);for(let A of[...E.chunks,...E.lazy])S(A)};for(let y of[...u.chunks,...u.lazy])S(y);M.set(t,[...b].sort())}return{chunks:_,routes:w,reads:M}}catch(n){let{formatBuildFailure:o}=await import("./chunk-nrap20qt.js");return console.warn(`[stx] could not share the native routes' modules, building each route's alone: ${o(n)}`),null}}
21
- export{ns,$o,vm,su,Ro};
21
+ export{ns,$o,Sm,iu,Ro};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{At,or,Xh}from"./chunk-z110bf2c.js";import{xe,ir,Gh,ar,Vo,hs,ys,Jh,Yh,Zh,cr,lr,Wo,bs,Qh}from"./chunk-1hbf5e1h.js";import"./chunk-16sfjkc4.js";export{Vo as batch,Xh as default,ir as derived,ar as effect,At as generateSignalsRuntime,or as generateSignalsRuntimeDev,lr as isDerived,cr as isSignal,Gh as memo,ys as onDestroy,hs as onMount,bs as peek,Zh as pendingLifecycleCounts,Yh as runDestroyCallbacks,Jh as runMountCallbacks,xe as state,Wo as untrack,Qh as useOptimistic};