@stacksjs/stx 0.2.644 → 0.2.647

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 (265) hide show
  1. package/dist/builtins/attrs.js +6 -6
  2. package/dist/builtins/escape.d.ts +0 -11
  3. package/dist/builtins/escape.js +2 -1
  4. package/dist/builtins/safe-image.js +1 -3
  5. package/dist/builtins/stx-image.js +1 -3
  6. package/dist/builtins/stx-link.d.ts +3 -0
  7. package/dist/builtins/stx-link.js +1 -3
  8. package/dist/{chunk-1m5cjrpw.js → chunk-04kg16qs.js} +4 -4
  9. package/dist/chunk-0jq3w712.js +65 -0
  10. package/dist/chunk-0ky1j84b.js +2 -0
  11. package/dist/chunk-0m08316b.js +2 -0
  12. package/dist/{chunk-qf210sfx.js → chunk-0z5cc7qn.js} +8 -8
  13. package/dist/{chunk-0ergsswn.js → chunk-120ze5ms.js} +3 -3
  14. package/dist/chunk-1c5p7ede.js +2 -0
  15. package/dist/chunk-1q6yvbdx.js +2 -0
  16. package/dist/chunk-1x4qn6fy.js +2 -0
  17. package/dist/chunk-20f1veqy.js +3 -0
  18. package/dist/chunk-2a4szpje.js +3 -0
  19. package/dist/chunk-2c3w367n.js +2 -0
  20. package/dist/chunk-2cxav9xe.js +2 -0
  21. package/dist/chunk-2f17h17f.js +2 -0
  22. package/dist/{chunk-ktvr45qg.js → chunk-2qbvsvwc.js} +2 -2
  23. package/dist/chunk-2v4s7xtx.js +2 -0
  24. package/dist/chunk-31714f76.js +2 -0
  25. package/dist/chunk-354jmw2k.js +3 -0
  26. package/dist/chunk-3e7haxwt.js +2 -0
  27. package/dist/{chunk-afsf6sp0.js → chunk-3ghbxena.js} +14 -14
  28. package/dist/chunk-40y6mb8t.js +2 -0
  29. package/dist/chunk-42rghbqe.js +12 -0
  30. package/dist/chunk-4fz2eq7g.js +2 -0
  31. package/dist/{chunk-1t0m4pwg.js → chunk-4yf1w261.js} +2 -2
  32. package/dist/chunk-4yt8tg4j.js +2 -0
  33. package/dist/chunk-52gp2xxk.js +2 -0
  34. package/dist/chunk-55x799st.js +49 -0
  35. package/dist/chunk-5e20mvke.js +2 -0
  36. package/dist/chunk-5fzh8n52.js +2 -0
  37. package/dist/chunk-5gtpswnm.js +2 -0
  38. package/dist/{chunk-a0ygyftk.js → chunk-5t4qtxgr.js} +2 -2
  39. package/dist/chunk-5yg3tkth.js +2 -0
  40. package/dist/chunk-67kj14at.js +2 -0
  41. package/dist/{chunk-gqz26wza.js → chunk-6ajahb2x.js} +3 -3
  42. package/dist/chunk-6vzktvyw.js +2 -0
  43. package/dist/chunk-70pmthc3.js +2 -0
  44. package/dist/chunk-74pej67a.js +18 -0
  45. package/dist/{chunk-g1ae3haw.js → chunk-7rta163c.js} +2 -2
  46. package/dist/chunk-7s32fe6k.js +3 -0
  47. package/dist/chunk-84djpte6.js +3 -0
  48. package/dist/chunk-864qtx7y.js +2 -0
  49. package/dist/chunk-8ttg2d3m.js +2 -0
  50. package/dist/{chunk-9yk5rasj.js → chunk-9am6dsb1.js} +3 -3
  51. package/dist/{chunk-5e063mgs.js → chunk-9p6efb17.js} +1 -1
  52. package/dist/chunk-9qeg5trh.js +2 -0
  53. package/dist/chunk-9szxxgv5.js +2 -0
  54. package/dist/{chunk-bsts9pr5.js → chunk-9y2ncrnq.js} +2 -2
  55. package/dist/chunk-9z9jtwct.js +33 -0
  56. package/dist/{chunk-y255yybn.js → chunk-a3d0g4mr.js} +2 -2
  57. package/dist/{chunk-9939fjh4.js → chunk-a8j91pqz.js} +11 -11
  58. package/dist/{chunk-hshcbe3p.js → chunk-aah6csjm.js} +11 -11
  59. package/dist/{chunk-cw8mx4qf.js → chunk-ajv5xmjx.js} +169 -169
  60. package/dist/chunk-apgb7r22.js +2 -0
  61. package/dist/{chunk-c858mepd.js → chunk-aprhqxky.js} +5 -5
  62. package/dist/{chunk-29sq7kqw.js → chunk-ar22s1e1.js} +2 -2
  63. package/dist/chunk-asqnaddf.js +3 -0
  64. package/dist/chunk-aze7k3a5.js +2 -0
  65. package/dist/chunk-b07djygp.js +18 -0
  66. package/dist/chunk-b0vhe6d4.js +4 -0
  67. package/dist/chunk-b4fd2dtk.js +2 -0
  68. package/dist/chunk-bk96wjaz.js +61 -0
  69. package/dist/chunk-c7fs96n6.js +4 -0
  70. package/dist/chunk-c9k40352.js +2 -0
  71. package/dist/{chunk-ahyq08mp.js → chunk-ce6zddpf.js} +3 -3
  72. package/dist/{chunk-cpxtmmvv.js → chunk-cj2xj1v6.js} +39 -40
  73. package/dist/chunk-cs0dd5w8.js +2 -0
  74. package/dist/chunk-cwd65649.js +2 -0
  75. package/dist/{chunk-2s3sxt48.js → chunk-da7x7y7j.js} +1 -1
  76. package/dist/{chunk-wjq1wqn6.js → chunk-dgb4z4kw.js} +2 -2
  77. package/dist/chunk-dpjnjs09.js +888 -0
  78. package/dist/chunk-e7sg0fa0.js +2 -0
  79. package/dist/chunk-edz1h5f9.js +2 -0
  80. package/dist/chunk-egg54kd0.js +12 -0
  81. package/dist/chunk-ek2adv0n.js +2 -0
  82. package/dist/chunk-emaexvgz.js +2 -0
  83. package/dist/{chunk-pp6ycfay.js → chunk-ewcrsyr7.js} +2 -2
  84. package/dist/chunk-fcn71bq1.js +2 -0
  85. package/dist/{chunk-dcwhp21g.js → chunk-fg3jw17w.js} +48 -48
  86. package/dist/chunk-fygp3cs9.js +2 -0
  87. package/dist/chunk-g2jmwh7p.js +2 -0
  88. package/dist/chunk-g8r0km7g.js +106 -0
  89. package/dist/{chunk-gmxrckgj.js → chunk-gc9ftf7r.js} +3 -3
  90. package/dist/chunk-ggwm8w5m.js +2 -0
  91. package/dist/chunk-h5zr710w.js +2 -0
  92. package/dist/chunk-hgy4c6mm.js +11 -0
  93. package/dist/chunk-hvtzw1jh.js +2 -0
  94. package/dist/{chunk-4n24jbfs.js → chunk-hvzzhkhr.js} +2 -2
  95. package/dist/chunk-j0v970k3.js +2 -0
  96. package/dist/chunk-jk41jwsc.js +2 -0
  97. package/dist/{chunk-6mnwvn9v.js → chunk-jkvr7e91.js} +2 -2
  98. package/dist/{chunk-639ngkgb.js → chunk-jsb4pvj1.js} +2 -2
  99. package/dist/{chunk-pf5s5gjp.js → chunk-jx3wpgv0.js} +2 -2
  100. package/dist/{chunk-fztvkacg.js → chunk-jxda11cg.js} +2 -2
  101. package/dist/chunk-jyth1zjy.js +127 -0
  102. package/dist/chunk-k2pa44rf.js +2 -0
  103. package/dist/{chunk-kad2cp0z.js → chunk-k79x96ra.js} +37 -37
  104. package/dist/{chunk-qy11cp1v.js → chunk-kgfgb971.js} +4 -4
  105. package/dist/chunk-ma7d95f0.js +31 -0
  106. package/dist/chunk-mmm6mm16.js +3 -0
  107. package/dist/{chunk-88p10v0w.js → chunk-mmwedr93.js} +5 -5
  108. package/dist/{chunk-dyg6sadv.js → chunk-mrrrngzd.js} +1 -1
  109. package/dist/{chunk-w41kp60h.js → chunk-msr25dhc.js} +4 -4
  110. package/dist/chunk-myq3hrww.js +6 -0
  111. package/dist/{chunk-fwdptew6.js → chunk-n38yb274.js} +6 -6
  112. package/dist/chunk-n4cvg2sw.js +2 -0
  113. package/dist/chunk-nph4d1ff.js +42 -0
  114. package/dist/{chunk-aztp8r80.js → chunk-nrvwejdw.js} +5 -5
  115. package/dist/{chunk-17x6e5mm.js → chunk-p08x0z86.js} +7 -7
  116. package/dist/chunk-p22w6mwr.js +2 -0
  117. package/dist/{chunk-xsmvcnmx.js → chunk-pdc9s7bg.js} +2 -2
  118. package/dist/chunk-pfk9ffbz.js +3 -0
  119. package/dist/{chunk-pvfx0dgz.js → chunk-prf164ct.js} +2 -2
  120. package/dist/chunk-pw9bhdaz.js +4 -0
  121. package/dist/chunk-qn63btbf.js +2 -0
  122. package/dist/{chunk-eyy6zmdk.js → chunk-qv6axke4.js} +2 -2
  123. package/dist/{chunk-60azcvwr.js → chunk-r3e6x87d.js} +3 -3
  124. package/dist/chunk-rb5xdcen.js +25 -0
  125. package/dist/{chunk-45xhjrha.js → chunk-rcadtv3x.js} +1 -1
  126. package/dist/{chunk-j00v4m56.js → chunk-rjh2jwxx.js} +9 -9
  127. package/dist/chunk-rwrbdpdk.js +2 -0
  128. package/dist/chunk-sf0wsq74.js +2 -0
  129. package/dist/chunk-shkysa02.js +20 -0
  130. package/dist/chunk-shpc1ttk.js +2 -0
  131. package/dist/{chunk-48yja477.js → chunk-t2pzy3x1.js} +3 -3
  132. package/dist/chunk-t6yjxhn8.js +2 -0
  133. package/dist/chunk-tkkvvt26.js +2 -0
  134. package/dist/{chunk-b4j5bpec.js → chunk-tre98h62.js} +2 -2
  135. package/dist/chunk-vac56rgd.js +12 -0
  136. package/dist/chunk-vdxjy7j2.js +4 -0
  137. package/dist/{chunk-gsp3627d.js → chunk-vgt9f7ac.js} +4 -4
  138. package/dist/{chunk-vq4sh8aq.js → chunk-vmwdt8fr.js} +5 -5
  139. package/dist/chunk-vn3yx05b.js +2 -0
  140. package/dist/{chunk-fqg0espy.js → chunk-vqc4h16r.js} +2 -2
  141. package/dist/chunk-w1v1d7rq.js +406 -0
  142. package/dist/chunk-w2q32x72.js +2 -0
  143. package/dist/chunk-weqc0ssb.js +2 -0
  144. package/dist/{chunk-kjspmegt.js → chunk-wpmrz872.js} +2 -2
  145. package/dist/chunk-wq712sw1.js +2 -0
  146. package/dist/chunk-wzgn9fv7.js +20 -0
  147. package/dist/{chunk-s775b8ra.js → chunk-x8k64g1e.js} +2 -2
  148. package/dist/chunk-xaa36b0x.js +3 -0
  149. package/dist/chunk-xnjf1zbn.js +21 -0
  150. package/dist/chunk-xyjn0rvj.js +3 -0
  151. package/dist/chunk-y3vget29.js +2 -0
  152. package/dist/chunk-y9x4pyp2.js +2 -0
  153. package/dist/chunk-yfrvbnc6.js +1312 -0
  154. package/dist/{chunk-drrczm0b.js → chunk-ym41ybz2.js} +6 -6
  155. package/dist/chunk-z8p6tk5z.js +2 -0
  156. package/dist/{chunk-gbxzqvez.js → chunk-zevx9866.js} +2 -2
  157. package/dist/chunk-zhf01af3.js +3 -0
  158. package/dist/{chunk-6avpd901.js → chunk-zqtbtqbq.js} +2 -2
  159. package/dist/chunk-ztbzktzg.js +2 -0
  160. package/dist/cli.js +62 -62
  161. package/dist/craft-entry.js +2 -2
  162. package/dist/craft.js +2 -2
  163. package/dist/expressions.d.ts +6 -21
  164. package/dist/expressions.js +12 -41
  165. package/dist/forms-validation.d.ts +0 -16
  166. package/dist/forms-validation.js +4 -2
  167. package/dist/forms.js +8 -6
  168. package/dist/i18n.js +6 -4
  169. package/dist/interpolation-context.js +69 -28
  170. package/dist/loops.js +70 -90
  171. package/dist/mustache-span.d.ts +21 -0
  172. package/dist/mustache-span.js +35 -0
  173. package/dist/native-build.d.ts +5 -0
  174. package/dist/native-build.js +11 -27
  175. package/dist/process.js +4 -3
  176. package/dist/pwa.js +3 -3
  177. package/dist/server-bindings.js +12 -6
  178. package/dist/ssg.js +28 -28
  179. package/dist/utils.js +1 -2
  180. package/package.json +5 -5
  181. package/dist/chunk-12677ap2.js +0 -31
  182. package/dist/chunk-162gprh9.js +0 -2
  183. package/dist/chunk-1p6yd17s.js +0 -2
  184. package/dist/chunk-29gd2kkk.js +0 -20
  185. package/dist/chunk-3hkp5hym.js +0 -2
  186. package/dist/chunk-3jrssj8g.js +0 -2
  187. package/dist/chunk-444pz8yk.js +0 -2
  188. package/dist/chunk-47shfmkf.js +0 -3
  189. package/dist/chunk-4b5f28te.js +0 -2
  190. package/dist/chunk-4dpq1bnh.js +0 -2
  191. package/dist/chunk-4mm9ttc7.js +0 -2
  192. package/dist/chunk-5c511mj0.js +0 -2
  193. package/dist/chunk-5kbkx0np.js +0 -3
  194. package/dist/chunk-5wyp57g3.js +0 -4
  195. package/dist/chunk-6bdr0x43.js +0 -18
  196. package/dist/chunk-6vmvra0f.js +0 -65
  197. package/dist/chunk-70et0fbw.js +0 -12
  198. package/dist/chunk-7mkw98cr.js +0 -3
  199. package/dist/chunk-7qgsgfnt.js +0 -2
  200. package/dist/chunk-87kza2ez.js +0 -2
  201. package/dist/chunk-8bk1ghb7.js +0 -127
  202. package/dist/chunk-8cqx63aw.js +0 -3
  203. package/dist/chunk-8k5eac6p.js +0 -2
  204. package/dist/chunk-9nvrkpee.js +0 -2
  205. package/dist/chunk-9ny6xzw0.js +0 -2
  206. package/dist/chunk-9r538d93.js +0 -2
  207. package/dist/chunk-9xaztqhw.js +0 -2
  208. package/dist/chunk-b2teprjf.js +0 -2
  209. package/dist/chunk-bnfjwgtm.js +0 -20
  210. package/dist/chunk-br7xk2hb.js +0 -2
  211. package/dist/chunk-c8p5jwdq.js +0 -2
  212. package/dist/chunk-cd76dwdn.js +0 -2
  213. package/dist/chunk-degxqdbb.js +0 -2
  214. package/dist/chunk-dr4325et.js +0 -2
  215. package/dist/chunk-e7bd4vxb.js +0 -2
  216. package/dist/chunk-eh7qq39j.js +0 -2
  217. package/dist/chunk-ek5vrw4r.js +0 -2
  218. package/dist/chunk-erweevv2.js +0 -2
  219. package/dist/chunk-fdxyj3pk.js +0 -2
  220. package/dist/chunk-ft3r2rzs.js +0 -2
  221. package/dist/chunk-fywp8fcr.js +0 -2
  222. package/dist/chunk-g14mwhqz.js +0 -2
  223. package/dist/chunk-g6s0xdgb.js +0 -4
  224. package/dist/chunk-grg366m9.js +0 -2852
  225. package/dist/chunk-h3brvxbf.js +0 -3
  226. package/dist/chunk-hbk20w21.js +0 -2
  227. package/dist/chunk-hrdnz5q9.js +0 -2
  228. package/dist/chunk-hvk5zkpm.js +0 -4
  229. package/dist/chunk-j0jz4mfm.js +0 -2
  230. package/dist/chunk-j37720vw.js +0 -2
  231. package/dist/chunk-j6fxzkn5.js +0 -2
  232. package/dist/chunk-ja3m0h9h.js +0 -12
  233. package/dist/chunk-jmdrhpy7.js +0 -2
  234. package/dist/chunk-jshv1ye7.js +0 -2
  235. package/dist/chunk-jtk2p5p0.js +0 -2
  236. package/dist/chunk-k46gqnmk.js +0 -2
  237. package/dist/chunk-ktjvqwp4.js +0 -2
  238. package/dist/chunk-kv5mn1qr.js +0 -6
  239. package/dist/chunk-kxbw0e2f.js +0 -3
  240. package/dist/chunk-ky043mkv.js +0 -2
  241. package/dist/chunk-m2bnyrft.js +0 -2
  242. package/dist/chunk-m92q2jyt.js +0 -40
  243. package/dist/chunk-mbqqc20a.js +0 -2
  244. package/dist/chunk-mqmxhggf.js +0 -2
  245. package/dist/chunk-myq0m4h4.js +0 -2
  246. package/dist/chunk-nkgzwyad.js +0 -2
  247. package/dist/chunk-ns4pc13z.js +0 -2
  248. package/dist/chunk-nv9syzs0.js +0 -2
  249. package/dist/chunk-pn719qwa.js +0 -2
  250. package/dist/chunk-qmh6f1bt.js +0 -24
  251. package/dist/chunk-r00nn2qs.js +0 -4
  252. package/dist/chunk-re2mry1d.js +0 -2
  253. package/dist/chunk-s0tbc9t1.js +0 -33
  254. package/dist/chunk-s7e9ztgq.js +0 -2
  255. package/dist/chunk-t6awky15.js +0 -11
  256. package/dist/chunk-tcq0me7c.js +0 -2
  257. package/dist/chunk-vse0hhn9.js +0 -2
  258. package/dist/chunk-vvgs62za.js +0 -2
  259. package/dist/chunk-wj4rf7sb.js +0 -2
  260. package/dist/chunk-x901zq4q.js +0 -2
  261. package/dist/chunk-xe8qmf1d.js +0 -2
  262. package/dist/chunk-xqtzk9wr.js +0 -2
  263. package/dist/chunk-y51ndrdb.js +0 -2
  264. package/dist/chunk-yn2d8x8m.js +0 -3
  265. package/dist/chunk-zrngcg6r.js +0 -2
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Wo,Dp,Mp,oc,je,cu,ks,Lp,jp,Bp,Fp,zp,Hp,Vp,Up,Wp}from"./chunk-bk96wjaz.js";export{Hp as applyHead,Lp as definePageMeta,Wo as getHead,Dp as getPageMeta,je as mergeHeadConfigs,Vp as processHeadDirective,Wp as processMetaDirective,Up as processTitleDirective,zp as renderBodyAttrs,Bp as renderHead,Fp as renderHtmlAttrs,Mp as resetHead,ks as seoMetaToHeadConfig,oc as useHead,jp as usePageTitle,cu as useSeoMeta,jp as useTitle};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{zn,_e}from"./chunk-9y2ncrnq.js";export{zn as describeBuildFailure,_e as formatBuildFailure};
@@ -0,0 +1,12 @@
1
+ // @bun
2
+ function w(t,i){let n=t[i],e=i+1;while(e<t.length){if(t[e]==="\\"){e+=2;continue}if(t[e]===n)return e+1;e++}return t.length}function b(t,i){let n=i+1;while(n<t.length){if(t[n]==="\\"){n+=2;continue}if(t[n]==="`")return n+1;if(t[n]==="$"&&t[n+1]==="{"){if(n=Za(t,n+2),n<t.length)n++;continue}n++}return t.length}function Za(t,i){let n=1,e=i,r="{",s="";while(e<t.length){let l=t[e];if(l==="\\"){e+=2;continue}if(l==='"'||l==="'"){e=w(t,e),r=u,s="";continue}if(l==="`"){e=b(t,e),r=u,s="";continue}if(l==="/"&&t[e+1]==="/"){while(e<t.length&&t[e]!==`
3
+ `)e++;continue}if(l==="/"&&t[e+1]==="*"){e+=2;while(e<t.length&&t.slice(e,e+2)!=="*/")e++;e+=2;continue}if(l==="/"&&g(r,s)){let f=a(t,e);if(f!==-1){e=f,r=u,s="";continue}}if(l==="{")n++;else if(l==="}"){if(n--,n===0)return e}if(/[\w$]/.test(l))s=/[\w$]/.test(r)?s+l:l,r=l;else if(!/\s/.test(l))r=l,s="";e++}return t.length}var m=new Set(["return","typeof","instanceof","in","of","new","delete","void","throw","case","do","else","yield","await"]);function g(t,i){if(i)return m.has(i);return!(t===")"||t==="]"||t===u)}var u="\x00";function a(t,i){let n=i+1,e=!1;while(n<t.length){let r=t[n];if(r===`
4
+ `)return-1;if(r==="\\"){n+=2;continue}if(r==="[")e=!0;else if(r==="]")e=!1;else if(r==="/"&&!e){n++;while(n<t.length&&/[a-z]/i.test(t[n]))n++;return n}n++}return-1}function o(t){let i="",n=0,e="",r="";while(n<t.length){let s=t.slice(n,n+2);if(s==="//"){while(n<t.length&&t[n]!==`
5
+ `)i+=" ",n++;continue}if(s==="/*"){while(n<t.length&&t.slice(n,n+2)!=="*/")i+=t[n]===`
6
+ `?`
7
+ `:" ",n++;i+=" ",n+=2;continue}let l=t[n];if(l==='"'||l==="'"){let f=l;i+=" ",n++;while(n<t.length&&t[n]!==f){if(t[n]==="\\"){i+=" ",n+=2;continue}i+=t[n]===`
8
+ `?`
9
+ `:" ",n++}i+=" ",n++,e=u,r="";continue}if(l==="/"&&g(e,r)){let f=a(t,n);if(f!==-1){i+=`/${" ".repeat(f-n-2)}/`,n=f,e=u,r="";continue}}if(l==="`"){i+=" ",n++;while(n<t.length&&t[n]!=="`"){if(t[n]==="\\"){i+=" ",n+=2;continue}if(t[n]==="$"&&t[n+1]==="{"){let f=n+2,h=Za(t,f);if(i+=" ",i+=o(t.slice(f,h)),h<t.length)i+=" ";n=h+1;continue}i+=t[n]===`
10
+ `?`
11
+ `:" ",n++}i+=" ",n++,e=u,r="";continue}if(i+=l,n++,/[\w$]/.test(l))r=/[\w$]/.test(e)?r+l:l,e=l;else if(!/\s/.test(l))e=l,r=""}return i}function Qe(t){let i=new Uint16Array(t.length),n=0,e=!0;for(let r=0;r<t.length;r++){let s=t[r];if(s===")"||s==="]"||s==="}")if(n===0)e=!1;else n--;if(i[r]=n,s==="("||s==="["||s==="{")n++}return{depths:i,balanced:e&&n===0}}
12
+ export{Za,o,Qe};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{N,Rl,po,i,R,xp,Sp}from"./chunk-yfrvbnc6.js";import"./chunk-pw9bhdaz.js";import"./chunk-a3d0g4mr.js";import"./chunk-04kg16qs.js";import"./chunk-0jq3w712.js";import"./chunk-vgt9f7ac.js";import"./chunk-w1v1d7rq.js";import"./chunk-pdc9s7bg.js";import"./chunk-5t4qtxgr.js";import"./chunk-bk96wjaz.js";import"./chunk-ce6zddpf.js";import"./chunk-7rta163c.js";export{R as config,N as defaultConfig,xp as defineStxConfig,po as discoverConfig,i as loadStxConfig,Rl as resolveStxDirectories,Sp as validateConfig};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{op,na,ip,ra,yl,bl,en,Wn,ap,vl,wl,cp,h}from"./chunk-74pej67a.js";import"./chunk-xyjn0rvj.js";import"./chunk-w1v1d7rq.js";import"./chunk-pdc9s7bg.js";import"./chunk-5t4qtxgr.js";import"./chunk-bk96wjaz.js";import"./chunk-ce6zddpf.js";import"./chunk-7rta163c.js";export{en as buildCss,vl as extractClassNames,bl as fingerprintConfig,wl as generateCss,ap as getCachedCSS,op as getCssServeAsset,h as injectCss,na as loadCssEngine,ra as loadCssEngineConfig,Wn as rebuildCss,ip as resetCssCache,yl as resolveUserCssConfig,cp as withLinkedModuleBundles};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- var l=new Map,u=new Map;function m(t){if(l.set(t.name,t),t.client)u.set(t.name,t.client)}function it(t){return m(t),{name:t.name,hasEndTag:t.hasEndTag??!0,description:t.description,handler:async(r,o,a,s)=>{let n=f(o,t.defaults);if(t.validate){let e=t.validate(n);if(e!==!0){let d=typeof e==="string"?e:`Invalid parameters for @${t.name}`;throw Error(d)}}let i=r;if(t.transform)i=await t.transform(r,n,a,s);if(t.clientScript){let e=t.clientScript(n);i+=`<script>${e}</script>`}if(t.css){let e=t.css(n);i+=`<style>${e}</style>`}return i}}}function f(t,c){let r={...c};for(let o of t){let a=o.indexOf(":"),s=o.indexOf("="),n=a>=0&&(s<0||a<s)?a:s;if(n>=0){let i=o.slice(0,n).trim(),e=o.slice(n+1).trim();if(e==="true")e=!0;else if(e==="false")e=!1;else if(e==="null")e=null;else if(!Number.isNaN(Number(e)))e=Number(e);else if(typeof e==="string"&&e.startsWith("{"))try{e=JSON.parse(e)}catch{}r[i]=e}else{let i=Object.keys(r).filter((e)=>!c||!(e in c)).length;r[i===0?"value":`arg${i}`]=o}}return r}
3
- export{it};
2
+ var l=new Map,u=new Map;function m(t){if(l.set(t.name,t),t.client)u.set(t.name,t.client)}function yt(t){return m(t),{name:t.name,hasEndTag:t.hasEndTag??!0,description:t.description,handler:async(r,o,a,s)=>{let n=f(o,t.defaults);if(t.validate){let e=t.validate(n);if(e!==!0){let d=typeof e==="string"?e:`Invalid parameters for @${t.name}`;throw Error(d)}}let i=r;if(t.transform)i=await t.transform(r,n,a,s);if(t.clientScript){let e=t.clientScript(n);i+=`<script>${e}</script>`}if(t.css){let e=t.css(n);i+=`<style>${e}</style>`}return i}}}function f(t,c){let r={...c};for(let o of t){let a=o.indexOf(":"),s=o.indexOf("="),n=a>=0&&(s<0||a<s)?a:s;if(n>=0){let i=o.slice(0,n).trim(),e=o.slice(n+1).trim();if(e==="true")e=!0;else if(e==="false")e=!1;else if(e==="null")e=null;else if(!Number.isNaN(Number(e)))e=Number(e);else if(typeof e==="string"&&e.startsWith("{"))try{e=JSON.parse(e)}catch{}r[i]=e}else{let i=Object.keys(r).filter((e)=>!c||!(e in c)).length;r[i===0?"value":`arg${i}`]=o}}return r}
3
+ export{yt};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Oi,Xu}from"./chunk-rcadtv3x.js";export{Oi as definePlugin,Xu as pluginManager};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{ca,la,ua}from"./chunk-g1ae3haw.js";import{X,dn,pn,as,tr,nr,fn,gn,cs,rr}from"./chunk-5kbkx0np.js";function z(t,a,i,r,d,y){let o=!0,u=new Set,f=(p)=>r.get?r.get(p):p,l=()=>f(t());return Object.defineProperty(l,"_isSignal",{value:!0}),Object.defineProperty(l,"modifiers",{get:a}),l.set=(p)=>{if(!o)return;let h=a(),e=r.set?r.set(p,h):p;if(h.trim&&typeof e==="string")e=e.trim();if(h.number&&typeof e==="string"&&e!==""){let s=Number(e);if(!Number.isNaN(s))e=s}if(Object.is(t(),e))return;t.set(e),i(e)},l.update=(p)=>l.set(p(l())),l.input=(p)=>{if(!a().lazy)l.set(p)},l.change=(p)=>{if(a().lazy)l.set(p)},l.subscribe=(p)=>{if(!o)return()=>{};let h=t.subscribe((e,s)=>p(f(e),f(s)));return u.add(h),()=>{h(),u.delete(h)}},Object.defineProperty(l,"value",{get:l,set:l.set}),d(()=>{o=!1,u.forEach((p)=>p()),u.clear()}),y?.(()=>{o=!0}),l}function Q(t,a=!0,i){if(!a||!t||typeof window>"u")return;let r=window;if(!r.__STX_DATA__){let y=document.querySelector("script[data-stx-server-data]");try{let o=JSON.parse(y?.textContent||"{}");r.__STX_DATA__=o&&typeof o==="object"&&!Array.isArray(o)?o:{}}catch{r.__STX_DATA__={}}}let d=r.__STX_DATA__;if(d&&Object.prototype.hasOwnProperty.call(d,t))try{return{data:i?i(d[t]):d[t]}}catch(y){return{data:null,error:y instanceof Error?y:Error(String(y))}}return}function Y(t){if(typeof window>"u")return;let a=window;if(t===void 0)a.__STX_DATA__={};else{if(!a.__STX_DATA__)try{let i=JSON.parse(document.querySelector("script[data-stx-server-data]")?.textContent||"{}");a.__STX_DATA__=i&&typeof i==="object"&&!Array.isArray(i)?i:{}}catch{a.__STX_DATA__={}}if(a.__STX_DATA__)delete a.__STX_DATA__[t]}}function J(t){let a=null;try{a=typeof indexedDB<"u"?indexedDB:null}catch{a=null}if(!a)return null;let i=a,r=t||"stx-kept",d=null,y=()=>{if(!d)d=new Promise((u,f)=>{let l=i.open(r,1);l.onupgradeneeded=()=>{l.result.createObjectStore("kv")},l.onsuccess=()=>u(l.result),l.onerror=()=>f(l.error),l.onblocked=()=>f(Error("blocked"))}),d.catch(()=>{d=null});return d},o=(u,f)=>y().then((l)=>new Promise((p,h)=>{let e=l.transaction("kv",u),s=f(e.objectStore("kv"));e.oncomplete=()=>p(s?s.result:void 0),e.onerror=()=>h(e.error),e.onabort=()=>h(e.error)}));return{get:(u)=>o("readonly",(f)=>f.get(u)),set:(u,f)=>o("readwrite",(l)=>{l.put(f,u)}),remove:(u)=>o("readwrite",(f)=>{f.delete(u)}),removePrefix:(u)=>o("readwrite",(f)=>{f.delete(IDBKeyRange.bound(u,`${u}\uFFFF`))})}}function Z(t,a){let i=t||{},r=null;if(i.storage!==void 0)r=i.storage;else try{r=typeof localStorage<"u"?localStorage:null}catch{r=null}let d=null,y=i.backend!==void 0;if(y)d=i.backend||null;let o=()=>{if(y)return d;y=!0;try{d=a?a():null}catch{d=null}if(d){let n=d;n.get("__stx_probe__").catch(()=>{if(d===n)d=null})}return d},u=i.limit||32768,f=i.defer||((n)=>{let c=typeof requestIdleCallback==="function"?requestIdleCallback:null;if(c)c(n,{timeout:200});else setTimeout(n,16)}),l=new Map,p=new Set,h=new Map,e=!1,s=Promise.resolve(),v=(n)=>{try{return JSON.parse(n)}catch{return n}},m=(n,c)=>{if(!r)return!1;try{return r.setItem(n,c),!0}catch{return!1}},E=(n)=>{try{if(r)r.removeItem(n)}catch{}},S=()=>{if(e=!1,!h.size)return s;let n=Array.from(h.entries());return h.clear(),s=s.then(()=>Promise.all(n.map(([c,g])=>{if(!d){p.delete(c);try{m(c,JSON.stringify(g===void 0?null:g))}catch{}return}let _;try{return _={v:g},d.set(c,_).catch(()=>{let x;try{x=JSON.stringify(g)}catch{return}return d?d.set(c,{j:x}).catch(()=>{m(c,x)}):void 0})}catch{return}}))).then(()=>{}),s},N=(n,c)=>{if(h.set(n,c),p.add(n),e)return;e=!0,f(()=>{S()})},D=(n)=>{if(!n||typeof n!=="object")return;let c=n;if("v"in c)return{value:c.v};if(typeof c.j==="string")return{value:v(c.j)};return},k={peek(n){if(l.has(n))return{value:l.get(n)};let c=null;try{c=r?r.getItem(n):null}catch{c=null}if(c===null||c===void 0)return;let g=v(c);return l.set(n,g),{value:g}},load(n){let c=k.peek(n),g=c?null:o();if(c||!g)return Promise.resolve(c);return g.get(n).then((_)=>{if(l.has(n))return{value:l.get(n)};let x=D(_);if(x)l.set(n,x.value),p.add(n);return x},()=>{return})},set(n,c){if(l.set(n,c),d&&p.has(n)){N(n,c);return}let g;try{g=JSON.stringify(c===void 0?null:c)}catch{return}if(g.length<=u&&m(n,g))return;if(!o()){if(g.length>u)m(n,g);return}E(n),N(n,c)},forget(n){for(let g of Array.from(l.keys()))if(g.indexOf(n)===0)l.delete(g);for(let g of Array.from(h.keys()))if(g.indexOf(n)===0)h.delete(g);for(let g of Array.from(p))if(g.indexOf(n)===0)p.delete(g);try{if(r)for(let g=r.length-1;g>=0;g--){let _=r.key(g);if(_&&_.indexOf(n)===0)r.removeItem(_)}}catch{}let c=o();if(!c)return s;return s=s.then(()=>c.removePrefix(n)).catch(()=>{}),s},flush(){return S()}};try{if(typeof document<"u"&&document.addEventListener)document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden")S()});if(typeof addEventListener==="function")addEventListener("pagehide",()=>{S()})}catch{}return k}function ee(t,a){if(!t)return!1;if(t===a.key)return!0;if(!a.url)return!1;if(t===a.url)return!0;try{let i=typeof location<"u"&&location.origin&&location.origin!=="null"?location.origin:"http://localhost",r=new URL(t,i),d=new URL(a.url,i);if(r.origin!==d.origin||r.pathname!==d.pathname)return!1;return!r.search||r.search===d.search}catch{return!1}}function te(t){let a=t.prefix||"stx:kept:",i=t.matches||((e,s)=>e===s.key||e===s.url),r=new Set,d=new Map,y,o=(e)=>e===void 0?y:e,u=(e,s)=>{let v=o(s);if(v===!1||v===null||v==="")return null;return`${a}${v===void 0?"":`${v}:`}query:${e}`},f=(e)=>{let s=e&&e.value;if(!s||typeof s!=="object"||!("d"in s))return;return{data:s.d,at:Number(s.at)||0}},l=()=>{let e=globalThis;return e.__stx_outboxes instanceof Map?e.__stx_outboxes:null},p={setScope(e){y=e},scope:()=>y,keyFor:u,seed(e,s){let v=u(e,s);return v?f(t.kept.peek(v)):void 0},restore(e,s){let v=u(e,s);return v?t.kept.load(v).then(f):Promise.resolve(void 0)},persist(e,s,v){let m=u(e,v);if(m)t.kept.set(m,{d:s,at:Date.now()})},overlay(e,s,v){let m=l();if(!m||!m.size)return s;let E=s;return m.forEach((S)=>{try{E=S.overlay(e,E,v)}catch{}}),E},watch(e){return r.add(e),()=>{r.delete(e)}},cachedQuery(e,s){let v=d.get(e);if(v){if(s&&v.__options)v.__options(s);return v}let m=s||{},E=m.initial===void 0?null:m.initial,S=()=>typeof m.scope==="function"?m.scope():m.scope,N=()=>(typeof m.url==="function"?m.url():m.url)||null,D=()=>({key:e,url:N()}),k=S(),n=E,c=0,g=t.sharedRequest(),_=0,x=p.seed(e,k);if(x)n=x.data;let I=t.state(p.overlay(D(),n)),U=t.state(!1),q=t.state(!1),K=t.state(null),P=t.state(x?x.at:0),R=0,F=()=>{I.set(p.overlay(D(),n))},W=(b)=>{let w=R;p.restore(e,b).then((T)=>{if(!T||w!==R||c)return;n=T.data,P.set(T.at),F()})};if(!x)W(k);let wt=()=>{let b=S();if(b===k)return;k=b,R++,_=0,q.set(!1),U.set(!1),c=0;let w=p.seed(e,k);if(n=w?w.data:E,P.set(w?w.at:0),F(),!w)W(k)},_t=(b,w)=>{let T=m.timeoutMs||15000,C=typeof AbortController<"u"?new AbortController:null,O=null,j=new Promise((M,V)=>{O=setTimeout(()=>{if(C)C.abort();V(Error("The request took too long."))},T)}),A;if(m.load)A=m.load({force:b,url:w,signal:C?C.signal:void 0});else if(w){let M=m.fetch||((L,H)=>fetch(L,H)),V={method:"GET",headers:{Accept:"application/json"}};if(b)V.cache="no-cache";if(C)V.signal=C.signal;A=M(w,V).then((L)=>{if(!L.ok)return L.json().catch(()=>null).then((H)=>{throw Error(H&&(H.error||H.message)||`Request failed (${L.status})`)});return L.json()})}else return Promise.resolve(I());return Promise.race([A,j]).then((M)=>{if(O)clearTimeout(O);return m.transform?m.transform(M):M},(M)=>{if(O)clearTimeout(O);throw M})},G=(b)=>{let w=R,T=N(),C=()=>{if(w!==R)return Promise.resolve(I());if(_++,q.set(!0),c===0&&!P())U.set(!0);let j=()=>{if(w!==R)return;if(_=Math.max(0,_-1),!_)q.set(!1),U.set(!1)};return _t(b,T).then((A)=>{if(w!==R||T!==N())return j(),I();return n=A,c=Date.now(),P.set(c),K.set(null),p.persist(e,A,k),F(),j(),I()},(A)=>{if(w===R&&T===N())K.set(A&&A.message?A.message:"Could not load.");return j(),I()})},O=`${w} ${T||""}`;return b?g.fresh(O,C):g.run(O,C)},B={data:I,loading:U,isFetching:q,error:K,updatedAt:P,get key(){return e},load(b){if(wt(),!b&&c&&Date.now()-c<(m.staleTime||0))return Promise.resolve(I());return G(!!b)},refresh(){return B.load(!0)},set(b){n=typeof b==="function"?b(n):b,p.persist(e,n,k),F()},invalidate(){c=0},__options(b){m={...m,...b}}};if(r.add({target:D,updated:()=>{if(c||P())G(!1)},outbox:(b)=>{if(b)n=p.overlay(D(),n,b.id),c=0,G(!0);F()}}),d.set(e,B),m.immediate)B.load();return B}},h=typeof window<"u"?window:typeof addEventListener==="function"?globalThis:null;if(t.listen!==!1&&h&&typeof h.addEventListener==="function")h.addEventListener("stx:updated",(e)=>{let s=e.detail||{};if(s.kind!=="api"||typeof s.url!=="string")return;r.forEach((v)=>{if(i(s.url,v.target()))v.updated()})}),h.addEventListener("stx:outbox",(e)=>{let s=e.detail||{},v=s.sent&&typeof s.sent.id==="string"?s.sent:null;r.forEach((m)=>{if(v){let E=Array.isArray(v.affects)?v.affects:[],S=m.target();if(!E.some((N)=>i(N,S)))return}m.outbox(v)})});return p}function ne(t){let a=t&&t.covers||((o,u)=>Object.is(o,u)),i=[],r=[],d=0,y=(o,u)=>{let f;try{f=Promise.resolve(u())}catch(h){f=Promise.reject(h)}let l={key:o,promise:f};i.push(l);let p=()=>{let h=i.indexOf(l);if(h!==-1)i.splice(h,1)};return f.then(p,p),f};return{run(o,u){for(let f of i)if(a(f.key,o))return f.promise;for(let f of r)if(a(f.key,o))return f.promise;return y(o,u)},fresh(o,u){for(let h of r)if(a(h.key,o))return h.promise;let f=i.filter((h)=>a(h.key,o)).map((h)=>h.promise);if(!f.length)return y(o,u);let l={key:o,promise:null},p=()=>{};return l.promise=Promise.all(f.map((h)=>h.then(p,p))).then(()=>{let h=r.indexOf(l);if(h!==-1)r.splice(h,1);return y(o,u)}),r.push(l),l.promise},latest(){let o=++d;return()=>o===d},get busy(){return i.length>0||r.length>0}}}var re=` function useColorMode(options) {
2
+ import{dc,pc,fc}from"./chunk-7rta163c.js";import{se,Nn,Dn,Hs,Pr,Ir,Mn,Ln,Vs,Or}from"./chunk-84djpte6.js";function z(t,a,i,r,d,y){let o=!0,u=new Set,f=(p)=>r.get?r.get(p):p,l=()=>f(t());return Object.defineProperty(l,"_isSignal",{value:!0}),Object.defineProperty(l,"modifiers",{get:a}),l.set=(p)=>{if(!o)return;let h=a(),e=r.set?r.set(p,h):p;if(h.trim&&typeof e==="string")e=e.trim();if(h.number&&typeof e==="string"&&e!==""){let s=Number(e);if(!Number.isNaN(s))e=s}if(Object.is(t(),e))return;t.set(e),i(e)},l.update=(p)=>l.set(p(l())),l.input=(p)=>{if(!a().lazy)l.set(p)},l.change=(p)=>{if(a().lazy)l.set(p)},l.subscribe=(p)=>{if(!o)return()=>{};let h=t.subscribe((e,s)=>p(f(e),f(s)));return u.add(h),()=>{h(),u.delete(h)}},Object.defineProperty(l,"value",{get:l,set:l.set}),d(()=>{o=!1,u.forEach((p)=>p()),u.clear()}),y?.(()=>{o=!0}),l}function X(t,a=!0,i){if(!a||!t||typeof window>"u")return;let r=window;if(!r.__STX_DATA__){let y=document.querySelector("script[data-stx-server-data]");try{let o=JSON.parse(y?.textContent||"{}");r.__STX_DATA__=o&&typeof o==="object"&&!Array.isArray(o)?o:{}}catch{r.__STX_DATA__={}}}let d=r.__STX_DATA__;if(d&&Object.prototype.hasOwnProperty.call(d,t))try{return{data:i?i(d[t]):d[t]}}catch(y){return{data:null,error:y instanceof Error?y:Error(String(y))}}return}function Q(t){if(typeof window>"u")return;let a=window;if(t===void 0)a.__STX_DATA__={};else{if(!a.__STX_DATA__)try{let i=JSON.parse(document.querySelector("script[data-stx-server-data]")?.textContent||"{}");a.__STX_DATA__=i&&typeof i==="object"&&!Array.isArray(i)?i:{}}catch{a.__STX_DATA__={}}if(a.__STX_DATA__)delete a.__STX_DATA__[t]}}function Y(t){let a=null;try{a=typeof indexedDB<"u"?indexedDB:null}catch{a=null}if(!a)return null;let i=a,r=t||"stx-kept",d=null,y=()=>{if(!d)d=new Promise((u,f)=>{let l=i.open(r,1);l.onupgradeneeded=()=>{l.result.createObjectStore("kv")},l.onsuccess=()=>u(l.result),l.onerror=()=>f(l.error),l.onblocked=()=>f(Error("blocked"))}),d.catch(()=>{d=null});return d},o=(u,f)=>y().then((l)=>new Promise((p,h)=>{let e=l.transaction("kv",u),s=f(e.objectStore("kv"));e.oncomplete=()=>p(s?s.result:void 0),e.onerror=()=>h(e.error),e.onabort=()=>h(e.error)}));return{get:(u)=>o("readonly",(f)=>f.get(u)),set:(u,f)=>o("readwrite",(l)=>{l.put(f,u)}),remove:(u)=>o("readwrite",(f)=>{f.delete(u)}),removePrefix:(u)=>o("readwrite",(f)=>{f.delete(IDBKeyRange.bound(u,`${u}\uFFFF`))})}}function J(t,a){let i=t||{},r=null;if(i.storage!==void 0)r=i.storage;else try{r=typeof localStorage<"u"?localStorage:null}catch{r=null}let d=null,y=i.backend!==void 0;if(y)d=i.backend||null;let o=()=>{if(y)return d;y=!0;try{d=a?a():null}catch{d=null}if(d){let n=d;n.get("__stx_probe__").catch(()=>{if(d===n)d=null})}return d},u=i.limit||32768,f=i.defer||((n)=>{let c=typeof requestIdleCallback==="function"?requestIdleCallback:null;if(c)c(n,{timeout:200});else setTimeout(n,16)}),l=new Map,p=new Set,h=new Map,e=!1,s=Promise.resolve(),v=(n)=>{try{return JSON.parse(n)}catch{return n}},m=(n,c)=>{if(!r)return!1;try{return r.setItem(n,c),!0}catch{return!1}},E=(n)=>{try{if(r)r.removeItem(n)}catch{}},S=()=>{if(e=!1,!h.size)return s;let n=Array.from(h.entries());return h.clear(),s=s.then(()=>Promise.all(n.map(([c,g])=>{if(!d){p.delete(c);try{m(c,JSON.stringify(g===void 0?null:g))}catch{}return}let _;try{return _={v:g},d.set(c,_).catch(()=>{let x;try{x=JSON.stringify(g)}catch{return}return d?d.set(c,{j:x}).catch(()=>{m(c,x)}):void 0})}catch{return}}))).then(()=>{}),s},N=(n,c)=>{if(h.set(n,c),p.add(n),e)return;e=!0,f(()=>{S()})},D=(n)=>{if(!n||typeof n!=="object")return;let c=n;if("v"in c)return{value:c.v};if(typeof c.j==="string")return{value:v(c.j)};return},k={peek(n){if(l.has(n))return{value:l.get(n)};let c=null;try{c=r?r.getItem(n):null}catch{c=null}if(c===null||c===void 0)return;let g=v(c);return l.set(n,g),{value:g}},load(n){let c=k.peek(n),g=c?null:o();if(c||!g)return Promise.resolve(c);return g.get(n).then((_)=>{if(l.has(n))return{value:l.get(n)};let x=D(_);if(x)l.set(n,x.value),p.add(n);return x},()=>{return})},set(n,c){if(l.set(n,c),d&&p.has(n)){N(n,c);return}let g;try{g=JSON.stringify(c===void 0?null:c)}catch{return}if(g.length<=u&&m(n,g))return;if(!o()){if(g.length>u)m(n,g);return}E(n),N(n,c)},forget(n){for(let g of Array.from(l.keys()))if(g.indexOf(n)===0)l.delete(g);for(let g of Array.from(h.keys()))if(g.indexOf(n)===0)h.delete(g);for(let g of Array.from(p))if(g.indexOf(n)===0)p.delete(g);try{if(r)for(let g=r.length-1;g>=0;g--){let _=r.key(g);if(_&&_.indexOf(n)===0)r.removeItem(_)}}catch{}let c=o();if(!c)return s;return s=s.then(()=>c.removePrefix(n)).catch(()=>{}),s},flush(){return S()}};try{if(typeof document<"u"&&document.addEventListener)document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden")S()});if(typeof addEventListener==="function")addEventListener("pagehide",()=>{S()})}catch{}return k}function Z(t,a){if(!t)return!1;if(t===a.key)return!0;if(!a.url)return!1;if(t===a.url)return!0;try{let i=typeof location<"u"&&location.origin&&location.origin!=="null"?location.origin:"http://localhost",r=new URL(t,i),d=new URL(a.url,i);if(r.origin!==d.origin||r.pathname!==d.pathname)return!1;return!r.search||r.search===d.search}catch{return!1}}function ee(t){let a=t.prefix||"stx:kept:",i=t.matches||((e,s)=>e===s.key||e===s.url),r=new Set,d=new Map,y,o=(e)=>e===void 0?y:e,u=(e,s)=>{let v=o(s);if(v===!1||v===null||v==="")return null;return`${a}${v===void 0?"":`${v}:`}query:${e}`},f=(e)=>{let s=e&&e.value;if(!s||typeof s!=="object"||!("d"in s))return;return{data:s.d,at:Number(s.at)||0}},l=()=>{let e=globalThis;return e.__stx_outboxes instanceof Map?e.__stx_outboxes:null},p={setScope(e){y=e},scope:()=>y,keyFor:u,seed(e,s){let v=u(e,s);return v?f(t.kept.peek(v)):void 0},restore(e,s){let v=u(e,s);return v?t.kept.load(v).then(f):Promise.resolve(void 0)},persist(e,s,v){let m=u(e,v);if(m)t.kept.set(m,{d:s,at:Date.now()})},overlay(e,s,v){let m=l();if(!m||!m.size)return s;let E=s;return m.forEach((S)=>{try{E=S.overlay(e,E,v)}catch{}}),E},watch(e){return r.add(e),()=>{r.delete(e)}},cachedQuery(e,s){let v=d.get(e);if(v){if(s&&v.__options)v.__options(s);return v}let m=s||{},E=m.initial===void 0?null:m.initial,S=()=>typeof m.scope==="function"?m.scope():m.scope,N=()=>(typeof m.url==="function"?m.url():m.url)||null,D=()=>({key:e,url:N()}),k=S(),n=E,c=0,g=t.sharedRequest(),_=0,x=p.seed(e,k);if(x)n=x.data;let I=t.state(p.overlay(D(),n)),U=t.state(!1),q=t.state(!1),K=t.state(null),P=t.state(x?x.at:0),R=0,F=()=>{I.set(p.overlay(D(),n))},W=(b)=>{let w=R;p.restore(e,b).then((T)=>{if(!T||w!==R||c)return;n=T.data,P.set(T.at),F()})};if(!x)W(k);let wt=()=>{let b=S();if(b===k)return;k=b,R++,_=0,q.set(!1),U.set(!1),c=0;let w=p.seed(e,k);if(n=w?w.data:E,P.set(w?w.at:0),F(),!w)W(k)},_t=(b,w)=>{let T=m.timeoutMs||15000,C=typeof AbortController<"u"?new AbortController:null,O=null,j=new Promise((M,V)=>{O=setTimeout(()=>{if(C)C.abort();V(Error("The request took too long."))},T)}),A;if(m.load)A=m.load({force:b,url:w,signal:C?C.signal:void 0});else if(w){let M=m.fetch||((L,H)=>fetch(L,H)),V={method:"GET",headers:{Accept:"application/json"}};if(b)V.cache="no-cache";if(C)V.signal=C.signal;A=M(w,V).then((L)=>{if(!L.ok)return L.json().catch(()=>null).then((H)=>{throw Error(H&&(H.error||H.message)||`Request failed (${L.status})`)});return L.json()})}else return Promise.resolve(I());return Promise.race([A,j]).then((M)=>{if(O)clearTimeout(O);return m.transform?m.transform(M):M},(M)=>{if(O)clearTimeout(O);throw M})},G=(b)=>{let w=R,T=N(),C=()=>{if(w!==R)return Promise.resolve(I());if(_++,q.set(!0),c===0&&!P())U.set(!0);let j=()=>{if(w!==R)return;if(_=Math.max(0,_-1),!_)q.set(!1),U.set(!1)};return _t(b,T).then((A)=>{if(w!==R||T!==N())return j(),I();return n=A,c=Date.now(),P.set(c),K.set(null),p.persist(e,A,k),F(),j(),I()},(A)=>{if(w===R&&T===N())K.set(A&&A.message?A.message:"Could not load.");return j(),I()})},O=`${w} ${T||""}`;return b?g.fresh(O,C):g.run(O,C)},B={data:I,loading:U,isFetching:q,error:K,updatedAt:P,get key(){return e},load(b){if(wt(),!b&&c&&Date.now()-c<(m.staleTime||0))return Promise.resolve(I());return G(!!b)},refresh(){return B.load(!0)},set(b){n=typeof b==="function"?b(n):b,p.persist(e,n,k),F()},invalidate(){c=0},__options(b){m={...m,...b}}};if(r.add({target:D,updated:()=>{if(c||P())G(!1)},outbox:(b)=>{if(b)n=p.overlay(D(),n,b.id),c=0,G(!0);F()}}),d.set(e,B),m.immediate)B.load();return B}},h=typeof window<"u"?window:typeof addEventListener==="function"?globalThis:null;if(t.listen!==!1&&h&&typeof h.addEventListener==="function")h.addEventListener("stx:updated",(e)=>{let s=e.detail||{};if(s.kind!=="api"||typeof s.url!=="string")return;r.forEach((v)=>{if(i(s.url,v.target()))v.updated()})}),h.addEventListener("stx:outbox",(e)=>{let s=e.detail||{},v=s.sent&&typeof s.sent.id==="string"?s.sent:null;r.forEach((m)=>{if(v){let E=Array.isArray(v.affects)?v.affects:[],S=m.target();if(!E.some((N)=>i(N,S)))return}m.outbox(v)})});return p}function te(t){let a=t&&t.covers||((o,u)=>Object.is(o,u)),i=[],r=[],d=0,y=(o,u)=>{let f;try{f=Promise.resolve(u())}catch(h){f=Promise.reject(h)}let l={key:o,promise:f};i.push(l);let p=()=>{let h=i.indexOf(l);if(h!==-1)i.splice(h,1)};return f.then(p,p),f};return{run(o,u){for(let f of i)if(a(f.key,o))return f.promise;for(let f of r)if(a(f.key,o))return f.promise;return y(o,u)},fresh(o,u){for(let h of r)if(a(h.key,o))return h.promise;let f=i.filter((h)=>a(h.key,o)).map((h)=>h.promise);if(!f.length)return y(o,u);let l={key:o,promise:null},p=()=>{};return l.promise=Promise.all(f.map((h)=>h.then(p,p))).then(()=>{let h=r.indexOf(l);if(h!==-1)r.splice(h,1);return y(o,u)}),r.push(l),l.promise},latest(){let o=++d;return()=>o===d},get busy(){return i.length>0||r.length>0}}}var ne=` function useColorMode(options) {
3
3
  options = options || {};
4
4
  // The pre-paint boot script (stacksjs/stx#1794) publishes the app's
5
5
  // configured options here. Reading them makes a bare useColorMode() agree
@@ -281,7 +281,7 @@ catch (e) {} }
281
281
  function usePreferredLight() { return useMediaQuery('(prefers-color-scheme: light)'); }
282
282
  function usePreferredReducedMotion() { return useMediaQuery('(prefers-reduced-motion: reduce)'); }
283
283
  function usePreferredContrast() { return useMediaQuery('(prefers-contrast: more)'); }
284
- `;function oe(t){return` var __stxGeneratedIdCounter = 0;
284
+ `;function re(t){return` var __stxGeneratedIdCounter = 0;
285
285
 
286
286
  // Stable, scope-aware DOM ids for component authoring. A component setup
287
287
  // runs with window.__STX_CURRENT_ELEMENT__ pointing at its compiled root, so
@@ -472,7 +472,7 @@ catch (e) {} }
472
472
  target.addEventListener(event, handler, opts);
473
473
  onDestroy(function() { target.removeEventListener(event, handler, opts); });
474
474
  }
475
- `}var se=` // Minimal attribute-only pass for the host element of a deferred subtree.
475
+ `}var oe=` // Minimal attribute-only pass for the host element of a deferred subtree.
476
476
  // The full walk happens on children via processElement.
477
477
  function processAttributesOnly(el, scope) {
478
478
  // Just call processElement but mark it as already visited to prevent
@@ -6169,7 +6169,7 @@ else {
6169
6169
  }
6170
6170
  };
6171
6171
  }
6172
- `;var ze=` // ==========================================================================
6172
+ `;var We=` // ==========================================================================
6173
6173
  // Optimistic State (useOptimistic) \u2014 stacksjs/stx#1742
6174
6174
  // ==========================================================================
6175
6175
  // Mirrors signals-api.ts useOptimistic. Shows base + pending actions while an
@@ -6202,7 +6202,7 @@ else {
6202
6202
  }
6203
6203
  return [optimistic, addOptimistic];
6204
6204
  }
6205
- `;var Xe=` // \u2500\u2500 Overlay stack \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
6205
+ `;var ze=` // \u2500\u2500 Overlay stack \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
6206
6206
  //
6207
6207
  // One stack for everything that takes over the page: stxAlert/stxConfirm,
6208
6208
  // the runtime modal and drawer, @stacksjs/components' Dialog and Drawer, and
@@ -6576,7 +6576,7 @@ else {
6576
6576
  else modal.open(id);
6577
6577
  }
6578
6578
  };
6579
- `;var Qe=` // ==========================================================================
6579
+ `;var Xe=` // ==========================================================================
6580
6580
  // Advanced Data Fetching (useQuery / useMutation)
6581
6581
  // ==========================================================================
6582
6582
 
@@ -6926,7 +6926,7 @@ finally {
6926
6926
  reset: function() { data.set(null); error.set(null); loading.set(false); }
6927
6927
  };
6928
6928
  }
6929
- `;var Ye=` // ==========================================================================
6929
+ `;var Qe=` // ==========================================================================
6930
6930
  // Notify
6931
6931
  // ==========================================================================
6932
6932
 
@@ -6951,7 +6951,7 @@ finally {
6951
6951
  collectSubscribers(subscribers, reached);
6952
6952
  reached.forEach(function(e) { e(); });
6953
6953
  }
6954
- `;function Je(t,a,i){return`${t} // ==========================================================================
6954
+ `;function Ye(t,a,i){return`${t} // ==========================================================================
6955
6955
  // Reactive Core
6956
6956
  // ==========================================================================
6957
6957
 
@@ -6960,7 +6960,7 @@ ${a}
6960
6960
  const effectStack = [];
6961
6961
  const pendingEffects = new Set();
6962
6962
  let isBatching = false;
6963
- ${Ye}
6963
+ ${Qe}
6964
6964
 
6965
6965
  // DevTools Phase 2 (#1747): dev-mode reactivity instrumentation. OFF by
6966
6966
  // default \u2014 even in the dev runtime \u2014 so set()/effect-run stay zero-overhead
@@ -6979,7 +6979,7 @@ ${Ye}
6979
6979
  function __stxDevtoolsRecordQuery(rec) { if (!__stxDevtoolsTracking) return; __stxDevtoolsQueries.push(rec); if (__stxDevtoolsQueries.length > 100) __stxDevtoolsQueries.shift(); }
6980
6980
  ${i}
6981
6981
  let activeDisposers = null; // Array | null \u2014 when non-null, effects auto-register their dispose fn
6982
- const targetMap = new WeakMap();`}var Ze=` // Vue-compat aliases
6982
+ const targetMap = new WeakMap();`}var Je=` // Vue-compat aliases
6983
6983
  var ref = state;
6984
6984
 
6985
6985
  // reactive() used to be a bare alias of state(), which made it the most
@@ -7044,7 +7044,7 @@ ${i}
7044
7044
  return proxy;
7045
7045
  }
7046
7046
  var computed = derived;
7047
- var watchEffect = function(fn) { return effect(fn); };`;var et=` // ==========================================================================
7047
+ var watchEffect = function(fn) { return effect(fn); };`;var Ze=` // ==========================================================================
7048
7048
  // Pipe Syntax Support (Feature #2)
7049
7049
  // ==========================================================================
7050
7050
 
@@ -7220,7 +7220,7 @@ else {
7220
7220
 
7221
7221
  return value;
7222
7222
  }
7223
- `;function tt(t,a,i){return` // skipChildren: this element's bindings only, because something else already
7223
+ `;function et(t,a,i){return` // skipChildren: this element's bindings only, because something else already
7224
7224
  // knows where the rest are. The manifest path passes it for every entry, so
7225
7225
  // the tree is never walked; see processFromManifest.
7226
7226
  function processElement(el, scope = componentScope, skipChildren) {
@@ -7932,7 +7932,7 @@ catch (e) {
7932
7932
  processElement(child, scope);
7933
7933
  });
7934
7934
  }
7935
- }`}var nt=` // ==========================================================================
7935
+ }`}var tt=` // ==========================================================================
7936
7936
  // Auto-unwrap Signals (Feature #1)
7937
7937
  // ==========================================================================
7938
7938
 
@@ -8009,7 +8009,7 @@ catch (e) {
8009
8009
  },
8010
8010
  });
8011
8011
  }
8012
- `;function rt(t){return` // Component mount system
8012
+ `;function nt(t){return` // Component mount system
8013
8013
  var mountQueue = [];
8014
8014
 
8015
8015
  // MERGE, never replace (#1804). Three client bundles assign window.stx and
@@ -8131,7 +8131,7 @@ ${t}
8131
8131
  _scopes: {}, // Component-level scopes
8132
8132
  _scopeCounter: 0, // Counter for generating unique scope IDs during SPA navigation
8133
8133
  _latestSetup: window.__stx_latestSetup || null, // Latest SFC setup function (including scripts parsed before the runtime)
8134
- _stores: new Map(), // Global store registry \u2014 survives SPA navigation`}var ot=` // ==========================================================================
8134
+ _stores: new Map(), // Global store registry \u2014 survives SPA navigation`}var rt=` // ==========================================================================
8135
8135
  // Template Refs (useRef)
8136
8136
  // ==========================================================================
8137
8137
 
@@ -8163,7 +8163,7 @@ ${t}
8163
8163
  Object.defineProperty(read, 'value', { get: read, enumerable: true });
8164
8164
  return read;
8165
8165
  }
8166
- `;var st=` // ==========================================================================
8166
+ `;var ot=` // ==========================================================================
8167
8167
  // Scope Disposal
8168
8168
  // ==========================================================================
8169
8169
 
@@ -8357,7 +8357,7 @@ ${t}
8357
8357
  delete scopes[id];
8358
8358
  }
8359
8359
  }
8360
- `;var at=` // Helper to process elements while skipping already-processed scoped containers
8360
+ `;var st=` // Helper to process elements while skipping already-processed scoped containers
8361
8361
  function processElementSkipScopes(el, processedScopes) {
8362
8362
  if (processedScopes.has(el)) return;
8363
8363
  if (el.nodeType === Node.TEXT_NODE) {
@@ -8398,7 +8398,7 @@ ${t}
8398
8398
  if (el.tagName !== 'SCRIPT' && el.tagName !== 'STYLE') {
8399
8399
  Array.from(el.childNodes).forEach(child => processElementSkipScopes(child, processedScopes));
8400
8400
  }
8401
- }`;var it=` function bindShow(el, expr, passedScope = componentScope, attrName = '@show') {
8401
+ }`;var at=` function bindShow(el, expr, passedScope = componentScope, attrName = '@show') {
8402
8402
  if (el.__stx_show_bound) return;
8403
8403
  el.__stx_show_bound = true;
8404
8404
 
@@ -8451,7 +8451,7 @@ ${t}
8451
8451
  }
8452
8452
  el.removeAttribute(attrName);
8453
8453
  }
8454
- `;var lt=` // Re-initialize components after SPA content swap.
8454
+ `;var it=` // Re-initialize components after SPA content swap.
8455
8455
  // Debounce to handle rapid re-fires (HMR triggers navigate which triggers stx:load again).
8456
8456
  var _stxLoadTimer = null;
8457
8457
  if (window.__stxLoadHandler) {
@@ -8492,7 +8492,7 @@ ${t}
8492
8492
  var departingDestroys = null;
8493
8493
  function beginSwap() {
8494
8494
  departingDestroys = (departingDestroys || []).concat(destroyCallbacks.splice(0));
8495
- }`;var ct=` function _handleStxLoad() {
8495
+ }`;var lt=` function _handleStxLoad() {
8496
8496
  _stxLoadTimer = null;
8497
8497
  console.log('[stx:load] START. mountQueue:', mountQueue.length, '_latestSetup:', !!window.stx._latestSetup);
8498
8498
 
@@ -8678,7 +8678,7 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
8678
8678
  // Everything that should have hydrated has now had its chance (#1773).
8679
8679
  auditHydration(container, 'stx:load');
8680
8680
  }
8681
- `;var dt=` // ==========================================================================
8681
+ `;var ct=` // ==========================================================================
8682
8682
  // State Signal
8683
8683
  // ==========================================================================
8684
8684
 
@@ -8829,7 +8829,7 @@ finally {
8829
8829
  function memo(compute, equals) {
8830
8830
  return derived(compute, { equals: typeof equals === 'function' ? equals : Object.is });
8831
8831
  }
8832
- `;var ut=` // \u2500\u2500 Store System \u2500\u2500
8832
+ `;var dt=` // \u2500\u2500 Store System \u2500\u2500
8833
8833
  // Pinia-inspired, signals-based. Stores survive SPA navigation.
8834
8834
 
8835
8835
  defineStore: function(id, setupOrOptions, storeOptions) {
@@ -9289,7 +9289,7 @@ finally {
9289
9289
  }
9290
9290
  console.log('[stx:store] useStore:', id);
9291
9291
  return store;
9292
- },`;var pt=` // Storage access is guarded end to end (stacksjs/stx#1793). Every one of
9292
+ },`;var ut=` // Storage access is guarded end to end (stacksjs/stx#1793). Every one of
9293
9293
  // these can throw, and each throw took down the whole client script for the
9294
9294
  // page rather than just the composable:
9295
9295
  //
@@ -10332,21 +10332,21 @@ else if (timer === null) {
10332
10332
  subscribe: subscribe
10333
10333
  };
10334
10334
  }
10335
- `;function We(){let t=xt(un());try{let i=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t);return i=i.replace(/\}(var |let |const |function )/g,"};$1"),i}catch{return t}}function xt(t){let a=[],i=0,r="console.log(";while(i<t.length){let d=t.indexOf(r,i);if(d===-1){a.push(t.slice(i));break}a.push(t.slice(i,d));let y=1,o=d+r.length;while(o<t.length&&y>0){let u=t[o];if(u==='"'||u==="'"||u==="`"){let f=u;o++;while(o<t.length&&t[o]!==f){if(t[o]==="\\")o++;o++}o++;continue}if(u==="(")y++;else if(u===")")y--;o++}a.push("0"),i=o}return a.join("")}function un(){return`${ae}${Oe}
10336
- ${Je(ie,Se,Ee)}
10335
+ `;function pt(){let t=xt(On());try{let i=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t);return i=i.replace(/\}(var |let |const |function )/g,"};$1"),i}catch{return t}}function xt(t){let a=[],i=0,r="console.log(";while(i<t.length){let d=t.indexOf(r,i);if(d===-1){a.push(t.slice(i));break}a.push(t.slice(i,d));let y=1,o=d+r.length;while(o<t.length&&y>0){let u=t[o];if(u==='"'||u==="'"||u==="`"){let f=u;o++;while(o<t.length&&t[o]!==f){if(t[o]==="\\")o++;o++}o++;continue}if(u==="(")y++;else if(u===")")y--;o++}a.push("0"),i=o}return a.join("")}function On(){return`${ae}${Oe}
10336
+ ${Ye(ie,Se,Ee)}
10337
10337
 
10338
10338
  ${Re}
10339
- ${nt}
10340
- ${et}
10341
- ${dt}
10339
+ ${tt}
10340
+ ${Ze}
10341
+ ${ct}
10342
10342
  ${_e}
10343
10343
  ${Ve}
10344
10344
  ${bt}
10345
- ${Te(Q.toString(),Y.toString())}
10346
- ${ot}
10345
+ ${Te(X.toString(),Q.toString())}
10346
+ ${rt}
10347
10347
  ${$e}
10348
- ${Qe}
10349
- ${ze}
10348
+ ${Xe}
10349
+ ${We}
10350
10350
  // ==========================================================================
10351
10351
  // Template Binding
10352
10352
  // ==========================================================================
@@ -10355,14 +10355,14 @@ ${ke}
10355
10355
  ${xe}
10356
10356
  ${Ce}
10357
10357
  ${je}
10358
- ${se}
10358
+ ${oe}
10359
10359
  ${de}
10360
10360
  ${fe}
10361
10361
  ${Be}
10362
- ${tt(la(),ua(),ca())}
10362
+ ${et(pc(),fc(),dc())}
10363
10363
 
10364
10364
  ${ft}
10365
- ${it}
10365
+ ${at}
10366
10366
  ${Ke}
10367
10367
  ${le}
10368
10368
  ${ht}
@@ -10377,25 +10377,25 @@ ${Pe}
10377
10377
  ${Le}
10378
10378
  ${ce}
10379
10379
  ${mt}
10380
- ${re}
10381
- ${Ze}
10380
+ ${ne}
10381
+ ${Je}
10382
10382
 
10383
- ${pt}
10383
+ ${ut}
10384
10384
 
10385
- ${Fe(Z.toString(),J.toString(),te.toString(),ee.toString(),ne.toString())}
10385
+ ${Fe(J.toString(),Y.toString(),ee.toString(),Z.toString(),te.toString())}
10386
10386
  ${ge}
10387
- ${oe(z.toString())}
10387
+ ${re(z.toString())}
10388
10388
  ${Ie}
10389
10389
  ${vt}
10390
10390
 
10391
- ${Xe}
10391
+ ${ze}
10392
10392
  ${ve}
10393
10393
  ${we}
10394
10394
  ${gt}
10395
10395
  ${Me}
10396
- ${rt(pe)}
10396
+ ${nt(pe)}
10397
10397
 
10398
- ${ut}
10398
+ ${dt}
10399
10399
 
10400
10400
  ${Ge}
10401
10401
  });
@@ -10403,12 +10403,12 @@ ${Ge}
10403
10403
  ${Ne}
10404
10404
  ${ye}
10405
10405
  ${be}
10406
- ${st}
10406
+ ${ot}
10407
10407
  ${De}
10408
10408
  ${me}
10409
+ ${it}
10409
10410
  ${lt}
10410
- ${ct}
10411
- ${at}
10411
+ ${st}
10412
10412
  })();
10413
- `}var Ru={state:X,derived:dn,effect:pn,batch:as,onMount:tr,onDestroy:nr,isSignal:fn,isDerived:gn,untrack:cs,peek:rr,generateSignalsRuntime:We,generateSignalsRuntimeDev:un};
10414
- export{We,un,Ru};
10413
+ `}var Vd={state:se,derived:Nn,effect:Dn,batch:Hs,onMount:Pr,onDestroy:Ir,isSignal:Mn,isDerived:Ln,untrack:Vs,peek:Or,generateSignalsRuntime:pt,generateSignalsRuntimeDev:On};
10414
+ export{pt,On,Vd};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{fp,_l,oo,Fr,io,ao,zr,Hr,Vr,co,ia,Cl,mt}from"./chunk-xnjf1zbn.js";import"./chunk-vac56rgd.js";import"./chunk-3e7haxwt.js";import"./chunk-yfrvbnc6.js";import"./chunk-pw9bhdaz.js";import"./chunk-a3d0g4mr.js";import"./chunk-04kg16qs.js";import"./chunk-0jq3w712.js";import"./chunk-vgt9f7ac.js";import{L}from"./chunk-w1v1d7rq.js";import"./chunk-pdc9s7bg.js";import"./chunk-5t4qtxgr.js";import"./chunk-bk96wjaz.js";import"./chunk-ce6zddpf.js";import"./chunk-7rta163c.js";export{fp as clearScriptScanCache,zr as convertServerLoopAttributesToDirectives,io as convertSignalDirectivesToAttributes,Hr as convertSignalLoopsToAttributes,L as extractExports,ia as findMarkupIndexOutsideScripts,Fr as hasSignalsSyntax,oo as parseLoopExpression,ao as preEvalLiteralReactiveIfs,Vr as processScriptSetup,co as processSignals,Cl as rewriteStxImportSpecifiers,_l as scanScriptTags,mt as stripStxRuntimeImports};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ws,qi,Gi,np}from"./chunk-120ze5ms.js";export{Ws as NATIVE_COMPONENTS,qi as compileToNative,Gi as createHotReloadServer,np as default};
@@ -0,0 +1,106 @@
1
+ // @bun
2
+ function la(){return`
3
+ (function(){
4
+ var tip=null,hideTimer=null,currentEl=null;
5
+
6
+ function createTip(){
7
+ tip=document.createElement("div");
8
+ tip.id="stx-tooltip";
9
+ tip.style.cssText="position:absolute;background:#1f2937;color:#fff;font-size:12px;line-height:1.4;padding:6px 10px;border-radius:6px;max-width:250px;z-index:999999;pointer-events:none;opacity:0;transition:opacity .15s ease;white-space:pre-wrap;word-wrap:break-word;box-shadow:0 2px 8px rgba(0,0,0,.25)";
10
+ var arrow=document.createElement("div");
11
+ arrow.className="stx-tip-arrow";
12
+ arrow.style.cssText="position:absolute;width:0;height:0;border:5px solid transparent";
13
+ tip.appendChild(arrow);
14
+ var text=document.createElement("span");
15
+ text.className="stx-tip-text";
16
+ tip.appendChild(text);
17
+ document.body.appendChild(tip);
18
+ }
19
+
20
+ function position(el){
21
+ var pos=el.getAttribute("x-tooltip-position")||"top";
22
+ var r=el.getBoundingClientRect();
23
+ var sy=window.scrollY,sx=window.scrollX;
24
+ tip.style.display="block";
25
+ tip.style.opacity="0";
26
+ // Force layout so we can measure
27
+ var tw=tip.offsetWidth,th=tip.offsetHeight;
28
+ var arrow=tip.querySelector(".stx-tip-arrow");
29
+ var left,top;
30
+
31
+ if(pos==="top"){
32
+ left=r.left+r.width/2-tw/2+sx;
33
+ top=r.top-th-8+sy;
34
+ if(top-sy<0){pos="bottom";}
35
+ }
36
+ if(pos==="bottom"){
37
+ left=r.left+r.width/2-tw/2+sx;
38
+ top=r.bottom+8+sy;
39
+ arrow.style.cssText="position:absolute;width:0;height:0;border:5px solid transparent;border-bottom-color:#1f2937;top:-10px;left:50%;transform:translateX(-50%)";
40
+ }
41
+ if(pos==="left"){
42
+ left=r.left-tw-8+sx;
43
+ top=r.top+r.height/2-th/2+sy;
44
+ if(left-sx<0){pos="right";}
45
+ }
46
+ if(pos==="right"){
47
+ left=r.right+8+sx;
48
+ top=r.top+r.height/2-th/2+sy;
49
+ arrow.style.cssText="position:absolute;width:0;height:0;border:5px solid transparent;border-right-color:#1f2937;left:-10px;top:50%;transform:translateY(-50%)";
50
+ }
51
+
52
+ // Set arrow for top/left after potential flips
53
+ if(pos==="top"){
54
+ arrow.style.cssText="position:absolute;width:0;height:0;border:5px solid transparent;border-top-color:#1f2937;bottom:-10px;left:50%;transform:translateX(-50%)";
55
+ }
56
+ if(pos==="left"){
57
+ arrow.style.cssText="position:absolute;width:0;height:0;border:5px solid transparent;border-left-color:#1f2937;right:-10px;top:50%;transform:translateY(-50%)";
58
+ }
59
+
60
+ // Clamp horizontal
61
+ if(left<sx+4) left=sx+4;
62
+ if(left+tw>sx+window.innerWidth-4) left=sx+window.innerWidth-tw-4;
63
+
64
+ tip.style.left=left+"px";
65
+ tip.style.top=top+"px";
66
+ tip.style.opacity="1";
67
+ }
68
+
69
+ function showTip(el){
70
+ if(hideTimer){clearTimeout(hideTimer);hideTimer=null;}
71
+ if(!tip) createTip();
72
+ var text=el.getAttribute("x-tooltip");
73
+ if(!text) return;
74
+ tip.querySelector(".stx-tip-text").textContent=text;
75
+ currentEl=el;
76
+ position(el);
77
+ }
78
+
79
+ function hideTip(){
80
+ if(!tip) return;
81
+ tip.style.opacity="0";
82
+ hideTimer=setTimeout(function(){
83
+ if(tip) tip.style.display="none";
84
+ currentEl=null;
85
+ },150);
86
+ }
87
+
88
+ document.addEventListener("mouseover",function(e){
89
+ var el=e.target.closest("[x-tooltip]");
90
+ if(el) showTip(el);
91
+ });
92
+ document.addEventListener("mouseout",function(e){
93
+ var el=e.target.closest("[x-tooltip]");
94
+ if(el&&el===currentEl) hideTip();
95
+ });
96
+ document.addEventListener("focusin",function(e){
97
+ var el=e.target.closest("[x-tooltip]");
98
+ if(el) showTip(el);
99
+ });
100
+ document.addEventListener("focusout",function(e){
101
+ var el=e.target.closest("[x-tooltip]");
102
+ if(el) hideTip();
103
+ });
104
+ })();
105
+ `}
106
+ export{la};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{existsSync as A,mkdtempSync as D,readdirSync as M,rmSync as b,statSync as g,writeFileSync as k}from"fs";import{constants as P,tmpdir as x}from"os";import{join as s}from"path";import t from"process";var _=/^stx-(?:.+-)?p(\d+)-\w{6}$/,v=".stx-keep",I=60000,N=["SIGINT","SIGTERM","SIGHUP"],i=new Set,y=new Set,c=!1,S=new Set;function p(e){try{b(e,{recursive:!0,force:!0})}catch{}}function R(){for(let e of i)p(e);i.clear(),f()}function E(){for(let e of i)p(e);i.clear()}function C(e){if(R(),t.listenerCount(e)===0)t.exit(128+(P.signals[e]??1))}var h=new Map(N.map((e)=>[e,()=>C(e)]));function G(){if(c)return;c=!0,t.on("exit",E);for(let[e,n]of h)try{t.on(e,n)}catch{}}function f(){if(!c)return;c=!1,t.off("exit",E);for(let[e,n]of h)t.off(e,n)}function K(e){try{return t.kill(e,0),!0}catch(n){return n.code==="EPERM"}}function O(e={}){let n=e.root??x(),r=e.isAlive??K,w=e.minAgeMs??I,T=e.now??Date.now(),a=[],u;try{u=M(n)}catch{return a}for(let d of u){let l=_.exec(d);if(!l)continue;let m=Number(l[1]);if(m===t.pid||r(m))continue;let o=s(n,d);try{if(!g(o).isDirectory())continue;if(T-g(o).mtimeMs<w)continue;if(A(s(o,v)))continue}catch{continue}p(o),a.push(o)}return a}function L(e){let n=e.replace(/^stx-/,"").replace(/-+$/,"");return n?`stx-${n}-p${t.pid}-`:`stx-p${t.pid}-`}function z(e=t.env){let n=e.STX_KEEP_TEMP?.trim().toLowerCase();return!!n&&n!=="0"&&n!=="false"}function Ce(e="stx",n=x()){if(!S.has(n))S.add(n),O({root:n});let r=D(s(n,L(e)));if(z())return H(r),console.warn(`[stx] STX_KEEP_TEMP: keeping ${r}`),r;return G(),i.add(r),r}function U(e){if(y.has(e))return;if(p(e),i.delete(e),i.size===0)f()}function H(e){try{k(s(e,v),`kept by pid ${t.pid}
3
- `)}catch{}if(y.add(e),i.delete(e),i.size===0)f()}async function ri(e,n){let r=Ce(e);try{return await n(r)}finally{U(r)}}
4
- export{Ce,U,ri};
2
+ import{existsSync as A,mkdtempSync as D,readdirSync as M,rmSync as b,statSync as g,writeFileSync as k}from"fs";import{constants as P,tmpdir as x}from"os";import{join as s}from"path";import t from"process";var _=/^stx-(?:.+-)?p(\d+)-\w{6}$/,v=".stx-keep",I=60000,N=["SIGINT","SIGTERM","SIGHUP"],i=new Set,y=new Set,c=!1,S=new Set;function p(e){try{b(e,{recursive:!0,force:!0})}catch{}}function R(){for(let e of i)p(e);i.clear(),f()}function E(){for(let e of i)p(e);i.clear()}function C(e){if(R(),t.listenerCount(e)===0)t.exit(128+(P.signals[e]??1))}var h=new Map(N.map((e)=>[e,()=>C(e)]));function G(){if(c)return;c=!0,t.on("exit",E);for(let[e,n]of h)try{t.on(e,n)}catch{}}function f(){if(!c)return;c=!1,t.off("exit",E);for(let[e,n]of h)t.off(e,n)}function K(e){try{return t.kill(e,0),!0}catch(n){return n.code==="EPERM"}}function O(e={}){let n=e.root??x(),r=e.isAlive??K,w=e.minAgeMs??I,T=e.now??Date.now(),a=[],u;try{u=M(n)}catch{return a}for(let d of u){let l=_.exec(d);if(!l)continue;let m=Number(l[1]);if(m===t.pid||r(m))continue;let o=s(n,d);try{if(!g(o).isDirectory())continue;if(T-g(o).mtimeMs<w)continue;if(A(s(o,v)))continue}catch{continue}p(o),a.push(o)}return a}function L(e){let n=e.replace(/^stx-/,"").replace(/-+$/,"");return n?`stx-${n}-p${t.pid}-`:`stx-p${t.pid}-`}function z(e=t.env){let n=e.STX_KEEP_TEMP?.trim().toLowerCase();return!!n&&n!=="0"&&n!=="false"}function ze(e="stx",n=x()){if(!S.has(n))S.add(n),O({root:n});let r=D(s(n,L(e)));if(z())return H(r),console.warn(`[stx] STX_KEEP_TEMP: keeping ${r}`),r;return G(),i.add(r),r}function Q(e){if(y.has(e))return;if(p(e),i.delete(e),i.size===0)f()}function H(e){try{k(s(e,v),`kept by pid ${t.pid}
3
+ `)}catch{}if(y.add(e),i.delete(e),i.size===0)f()}async function Xi(e,n){let r=ze(e);try{return await n(r)}finally{Q(r)}}
4
+ export{ze,Q,Xi};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{gn,jo}from"./chunk-pdc9s7bg.js";import"./chunk-5t4qtxgr.js";export{jo as generateRuntimeConfigTypes,gn as prepareRuntimeConfig};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Qs,eo,to,dp,jr,pp}from"./chunk-nph4d1ff.js";export{jr as clearImageDeliveryCatalog,dp as deliveredImage,to as efficientDeliverySources,Qs as getImageDelivery,eo as isTransparentImage,pp as prepareImageDelivery};
@@ -0,0 +1,11 @@
1
+ // @bun
2
+ import{x}from"./chunk-7rta163c.js";import{T,vn}from"./chunk-ce6zddpf.js";import{S,G}from"./chunk-w1v1d7rq.js";import{i}from"./chunk-yfrvbnc6.js";import{ke,Xt,Jt,Yt}from"./chunk-wzgn9fv7.js";import{mt}from"./chunk-xnjf1zbn.js";import{dt,In,Wt,re}from"./chunk-vdxjy7j2.js";import{E,yr}from"./chunk-354jmw2k.js";import p from"path";var a=new Map;function A(c,n){for(let s of c.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(s[1])n.add(s[1]);for(let s of c.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let o of(s[1]??"").split(",")){let l=((o.includes(":")?o.split(":").pop():o)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(l))n.add(l)}for(let s of c.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let o of(s[1]??"").split(",")){let r=o.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(r))n.add(r)}}async function Bd(c){let n;if(c)n=p.resolve(c);else{let t=await i();n=p.resolve(t.root||process.cwd(),t.storesDir||"stores")}let s=`${n}\x00${Jt()}`,o=new Bun.Glob("*.ts"),r=[];try{for await(let t of o.scan({cwd:n,absolute:!0})){let e=p.basename(t,".ts");if(["index","types"].includes(e))continue;if(t.includes(".d.ts"))continue;r.push(t)}}catch{return re(a,s,"",""),null}let l=()=>[...new Set([...r,...r.flatMap((t)=>ke(t))])],f=dt(l()),d=Wt(a,s,f);if(d!==void 0)return d||null;if(r.length===0)return re(a,s,f,""),null;let u=[];for(let t of r){let e=await Bun.file(t).text();u.push({file:t,hasUseStore:/useStore\s*\(/.test(e)})}u.sort((t,e)=>{if(t.hasUseStore===e.hasUseStore)return 0;return t.hasUseStore?1:-1});let y=u.map((t)=>t.file),m=[],g=new Set,v=G({loader:"ts",target:"browser",define:S()});for(let t of y)try{let e=await Bun.file(t).text(),_=p.basename(t,".ts");if(A(e,g),Xt(e))e=await Yt(e,t,{projectRoot:process.cwd(),externalizeUserModules:E()});e=mt(e),e=T(e),e=vn(e),e=e.replace(/^export\s+(default\s+)?/gm,""),e=v.transformSync(e),m.push(`// Store: ${_}
3
+ ${e.trim()}`)}catch(e){console.warn(`[stx] Failed to load store ${t}:`,e)}if(m.length===0)return re(a,s,f,""),null;let h=m.join(`
4
+
5
+ `),w=`;(function(){
6
+ var __stx = window.stx || {};
7
+ ${x.filter((t)=>!g.has(t)&&new RegExp(`\\b${t}\\b`).test(h)).map((t)=>`var ${t} = __stx[${JSON.stringify(t)}];`).join(`
8
+ `)}
9
+ ${h}
10
+ })();`,b=E()?yr(w):w;return f=dt(l()),re(a,s,f,b),b}function Fd(){a.clear(),In()}
11
+ export{Bd,Fd};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{T,vn}from"./chunk-ce6zddpf.js";export{vn as stripModuleImports,T as transformStoreImports};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{createHash as g}from"crypto";import{readFile as b,stat as y}from"fs/promises";async function R(e){try{let t=await b(e);return g("sha256").update(t).digest("hex").slice(0,16)}catch{return""}}function l(e){return g("sha256").update(e).digest("hex").slice(0,16)}function m(e,t){let r=JSON.stringify(t,Object.keys(t).sort());return`${l(e)}-${l(r)}`}async function h(e){try{return(await y(e)).mtimeMs}catch{return 0}}async function k(e){try{return await y(e),!0}catch{return!1}}import{mkdir as v,readFile as A,writeFile as P,readdir as B,rm as D,stat as H}from"fs/promises";import{join as w,dirname as E}from"path";var c=new Map,d={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500};async function S(e){try{await v(e,{recursive:!0})}catch{}}function p(e,t,r){return w(e,r,`${t}.json`)}async function C(e,t,r){if((Date.now()-e.createdAt)/86400000>r)return!1;if(await h(t)!==e.srcMtime)return!1;return!0}async function sn(e,t,r,a=d){if(!a.enabled)return null;let n=m(e,t),i=c.get(n);if(i){if(await C(i,e,a.maxAge))return i.lastAccessedAt=Date.now(),i.data;c.delete(n)}let o=p(a.directory,n,r);if(await k(o))try{let u=await A(o,"utf-8"),s=JSON.parse(u);if(await C(s,e,a.maxAge))return s.lastAccessedAt=Date.now(),c.set(n,s),s.data}catch{}return null}async function on(e,t,r,a,n=d){if(!n.enabled)return;let i=m(e,t),o=await R(e),u=await h(e),s={key:i,src:e,srcHash:o,srcMtime:u,optionsHash:m("",t),data:r,createdAt:Date.now(),lastAccessedAt:Date.now()};c.set(i,s);let f=p(n.directory,i,a);try{await S(E(f)),await P(f,JSON.stringify(s,null,2))}catch(x){console.warn(`[stx-media] Failed to write cache: ${x}`)}}async function an(e,t=d){if(e==="all")c.clear();else c.clear();let r=e==="all"?["image","video"]:[e];for(let a of r){let n=w(t.directory,a);try{await D(n,{recursive:!0,force:!0})}catch{}}}
3
- export{R,k,sn,on,an};
2
+ import{createHash as g}from"crypto";import{readFile as b,stat as y}from"fs/promises";async function M(e){try{let t=await b(e);return g("sha256").update(t).digest("hex").slice(0,16)}catch{return""}}function l(e){return g("sha256").update(e).digest("hex").slice(0,16)}function m(e,t){let r=JSON.stringify(t,Object.keys(t).sort());return`${l(e)}-${l(r)}`}async function h(e){try{return(await y(e)).mtimeMs}catch{return 0}}async function I(e){try{return await y(e),!0}catch{return!1}}import{mkdir as v,readFile as A,writeFile as P,readdir as B,rm as k,stat as H}from"fs/promises";import{join as w,dirname as D}from"path";var c=new Map,d={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500};async function E(e){try{await v(e,{recursive:!0})}catch{}}function p(e,t,r){return w(e,r,`${t}.json`)}async function C(e,t,r){if((Date.now()-e.createdAt)/86400000>r)return!1;if(await h(t)!==e.srcMtime)return!1;return!0}async function vr(e,t,r,a=d){if(!a.enabled)return null;let n=m(e,t),i=c.get(n);if(i){if(await C(i,e,a.maxAge))return i.lastAccessedAt=Date.now(),i.data;c.delete(n)}let o=p(a.directory,n,r);if(await I(o))try{let u=await A(o,"utf-8"),s=JSON.parse(u);if(await C(s,e,a.maxAge))return s.lastAccessedAt=Date.now(),c.set(n,s),s.data}catch{}return null}async function wr(e,t,r,a,n=d){if(!n.enabled)return;let i=m(e,t),o=await M(e),u=await h(e),s={key:i,src:e,srcHash:o,srcMtime:u,optionsHash:m("",t),data:r,createdAt:Date.now(),lastAccessedAt:Date.now()};c.set(i,s);let f=p(n.directory,i,a);try{await E(D(f)),await P(f,JSON.stringify(s,null,2))}catch(x){console.warn(`[stx-media] Failed to write cache: ${x}`)}}async function xr(e,t=d){if(e==="all")c.clear();else c.clear();let r=e==="all"?["image","video"]:[e];for(let a of r){let n=w(t.directory,a);try{await k(n,{recursive:!0,force:!0})}catch{}}}
3
+ export{M,I,vr,wr,xr};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Lu,ju,Bu,Fu,Dc,zu,Hu,Vu,Uu,Wu,qu,Gu}from"./chunk-jxda11cg.js";export{qu as Broadcast,Gu as BroadcastServer,Dc as broadcast,Uu as broadcastPresence,Vu as broadcastPrivate,Wu as channel,Lu as getBroadcastServer,Fu as loadChannels,ju as startBroadcasting,Bu as stopBroadcasting,zu as toUser,Hu as toUsers};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Nc,Du}from"./chunk-zqtbtqbq.js";export{Nc as captureScreenshot,Du as captureScreenshots};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import c from"path";var s=[{label:"Mobile (Small)",width:320,height:568},{label:"Mobile (Medium)",width:375,height:667},{label:"Mobile (Large)",width:414,height:896},{label:"Tablet",width:768,height:1024},{label:"Laptop",width:1024},{label:"Desktop",width:1280},{label:"Desktop (Large)",width:1920}],n=[{label:"Transparent",color:"transparent",contrastColor:"#333"},{label:"White",color:"#ffffff",contrastColor:"#333"},{label:"Light Gray",color:"#f5f5f5",contrastColor:"#333"},{label:"Dark Gray",color:"#333333",contrastColor:"#fff"},{label:"Black",color:"#000000",contrastColor:"#fff"}],i={file:"title",order:"asc",groups:[]},d={enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],tree:i,theme:{title:"STX Components",defaultColorScheme:"auto",darkClass:"dark"},responsivePresets:s,backgroundPresets:n,autoApplyContrastColor:!1,port:6006};function l(e){let t={...d,...e};return{enabled:t.enabled??!0,outDir:t.outDir??".stx/dist/story",storyMatch:t.storyMatch??["**/*.story.stx"],storyIgnored:t.storyIgnored??["**/node_modules/**","**/dist/**","**/.stx/**"],tree:{...i,...t.tree},theme:{title:"STX Components",defaultColorScheme:"auto",darkClass:"dark",...t.theme},responsivePresets:t.responsivePresets??s,backgroundPresets:t.backgroundPresets??n,autoApplyContrastColor:t.autoApplyContrastColor??!1,setupFile:t.setupFile,port:t.port??6006}}async function je(e){let t=e.root??process.cwd(),o;try{let r=await import(c.join(t,"stx.config.ts"));o=(r.default||r).story}catch{}let a={...o,...e.config},f=l(a);return{root:t,config:f,storyFiles:[],tree:void 0,mode:e.mode}}function Be(e,t){e.storyFiles=t}function Fe(e,t){e.tree=t}
3
- export{je,Be,Fe};
2
+ import c from"path";var s=[{label:"Mobile (Small)",width:320,height:568},{label:"Mobile (Medium)",width:375,height:667},{label:"Mobile (Large)",width:414,height:896},{label:"Tablet",width:768,height:1024},{label:"Laptop",width:1024},{label:"Desktop",width:1280},{label:"Desktop (Large)",width:1920}],n=[{label:"Transparent",color:"transparent",contrastColor:"#333"},{label:"White",color:"#ffffff",contrastColor:"#333"},{label:"Light Gray",color:"#f5f5f5",contrastColor:"#333"},{label:"Dark Gray",color:"#333333",contrastColor:"#fff"},{label:"Black",color:"#000000",contrastColor:"#fff"}],i={file:"title",order:"asc",groups:[]},d={enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],tree:i,theme:{title:"STX Components",defaultColorScheme:"auto",darkClass:"dark"},responsivePresets:s,backgroundPresets:n,autoApplyContrastColor:!1,port:6006};function l(e){let t={...d,...e};return{enabled:t.enabled??!0,outDir:t.outDir??".stx/dist/story",storyMatch:t.storyMatch??["**/*.story.stx"],storyIgnored:t.storyIgnored??["**/node_modules/**","**/dist/**","**/.stx/**"],tree:{...i,...t.tree},theme:{title:"STX Components",defaultColorScheme:"auto",darkClass:"dark",...t.theme},responsivePresets:t.responsivePresets??s,backgroundPresets:t.backgroundPresets??n,autoApplyContrastColor:t.autoApplyContrastColor??!1,setupFile:t.setupFile,port:t.port??6006}}async function ot(e){let t=e.root??process.cwd(),o;try{let r=await import(c.join(t,"stx.config.ts"));o=(r.default||r).story}catch{}let a={...o,...e.config},f=l(a);return{root:t,config:f,storyFiles:[],tree:void 0,mode:e.mode}}function it(e,t){e.storyFiles=t}function at(e,t){e.tree=t}
3
+ export{ot,it,at};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{V}from"./chunk-s775b8ra.js";import R from"fs";import g from"path";import C from"crypto";var S=new Set(["webp","avif","jpeg","png"]),T=new Set(["cover","contain","fill","inside","outside"]),q=new Set([".jpg",".jpeg",".png",".webp",".avif",".gif"]),k=4096,D=80,U="cover";async function Bo(e,t){let r=t.routePath??"/_stx/img",h=new URL(e.url);if(h.pathname!==r)return null;let a=A(h,t);if(!a.ok)return new Response(a.error,{status:a.status,headers:{"Content-Type":"text/plain"}});let{srcFsPath:n,srcUrl:d,width:l,height:i,format:s,quality:u,fit:c}=a,m;try{m=R.statSync(n)}catch{return new Response(`Source image not found: ${d}`,{status:404,headers:{"Content-Type":"text/plain"}})}if(!m.isFile())return new Response("Not a file",{status:404,headers:{"Content-Type":"text/plain"}});let w=t.cacheDir??".stx/cache/img";await R.promises.mkdir(w,{recursive:!0});let b=`${n}:${m.mtimeMs}:${m.size}`,I=`${l}x${i}:${s}:${u}:${c}`,f=C.createHash("sha256").update(`${b}|${I}`).digest("hex").slice(0,16),o=g.join(w,`${f}.${s}`),p={"Content-Type":V(s),"Cache-Control":"public, max-age=31536000, immutable",ETag:`"${f}"`,"X-Stx-Image-Cache":"HIT"};if(e.headers.get("if-none-match")===`"${f}"`)return new Response(null,{status:304,headers:p});let v=Bun.file(o);if(await v.exists())return new Response(v,{headers:p});try{let x=Buffer.from(await Bun.file(n).arrayBuffer()),{resizeAndConvert:P}=await L(),F=await P(x,{width:l,height:i,format:s,quality:u,fit:c});return await Bun.write(o,F),p["X-Stx-Image-Cache"]="MISS",new Response(new Uint8Array(F),{headers:p})}catch(x){let P=x.message;return new Response(`Image processing failed: ${P}`,{status:500,headers:{"Content-Type":"text/plain"}})}}function Pa(e){return async(t)=>await Bo(t,e)??new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain"}})}function A(e,t){let r=e.searchParams.get("src");if(!r)return{ok:!1,error:"Missing required param: src",status:400};if(!r.startsWith("/"))return{ok:!1,error:"src must be an absolute URL path (start with /)",status:400};if(r.startsWith("//"))return{ok:!1,error:"src must be a local path",status:400};let h=g.extname(r).toLowerCase();if(!q.has(h))return{ok:!1,error:`Unsupported source extension: ${h}`,status:400};let a=g.resolve(t.publicDir),n=g.resolve(a,r.slice(1));if(!n.startsWith(`${a}${g.sep}`)&&n!==a)return{ok:!1,error:"src is outside publicDir",status:400};let d=t.maxWidth??k,l=t.maxHeight??k,i=e.searchParams.get("w"),s=e.searchParams.get("h"),u=i?Number.parseInt(i,10):0,c=s?Number.parseInt(s,10):0;if(i&&(!Number.isFinite(u)||u<=0))return{ok:!1,error:"Invalid w (must be positive integer)",status:400};if(s&&(!Number.isFinite(c)||c<=0))return{ok:!1,error:"Invalid h (must be positive integer)",status:400};if(!i&&!s)return{ok:!1,error:"At least one of w or h is required",status:400};let m=Math.min(u||d,d),w=Math.min(c||l,l),b=e.searchParams.get("f")||"webp";if(!S.has(b))return{ok:!1,error:`Invalid f (must be one of: ${[...S].join(", ")})`,status:400};let I=b,f=e.searchParams.get("q"),o=f?Number.parseInt(f,10):t.defaultQuality??D;if(!Number.isFinite(o)||o<1||o>100)return{ok:!1,error:"Invalid q (must be 1-100)",status:400};let y=e.searchParams.get("fit")||t.defaultFit||U;if(!T.has(y))return{ok:!1,error:`Invalid fit (must be one of: ${[...T].join(", ")})`,status:400};return{ok:!0,srcFsPath:n,srcUrl:r,width:m,height:w,format:I,quality:o,fit:y}}async function L(){return await import("./chunk-j6fxzkn5.js")}
3
- export{Bo,Pa};
2
+ import{Z}from"./chunk-x8k64g1e.js";import R from"fs";import g from"path";import C from"crypto";var S=new Set(["webp","avif","jpeg","png"]),T=new Set(["cover","contain","fill","inside","outside"]),q=new Set([".jpg",".jpeg",".png",".webp",".avif",".gif"]),k=4096,D=80,U="cover";async function Ii(e,t){let r=t.routePath??"/_stx/img",h=new URL(e.url);if(h.pathname!==r)return null;let a=A(h,t);if(!a.ok)return new Response(a.error,{status:a.status,headers:{"Content-Type":"text/plain"}});let{srcFsPath:n,srcUrl:d,width:l,height:i,format:s,quality:u,fit:c}=a,m;try{m=R.statSync(n)}catch{return new Response(`Source image not found: ${d}`,{status:404,headers:{"Content-Type":"text/plain"}})}if(!m.isFile())return new Response("Not a file",{status:404,headers:{"Content-Type":"text/plain"}});let w=t.cacheDir??".stx/cache/img";await R.promises.mkdir(w,{recursive:!0});let b=`${n}:${m.mtimeMs}:${m.size}`,I=`${l}x${i}:${s}:${u}:${c}`,f=C.createHash("sha256").update(`${b}|${I}`).digest("hex").slice(0,16),o=g.join(w,`${f}.${s}`),p={"Content-Type":Z(s),"Cache-Control":"public, max-age=31536000, immutable",ETag:`"${f}"`,"X-Stx-Image-Cache":"HIT"};if(e.headers.get("if-none-match")===`"${f}"`)return new Response(null,{status:304,headers:p});let v=Bun.file(o);if(await v.exists())return new Response(v,{headers:p});try{let x=Buffer.from(await Bun.file(n).arrayBuffer()),{resizeAndConvert:P}=await L(),F=await P(x,{width:l,height:i,format:s,quality:u,fit:c});return await Bun.write(o,F),p["X-Stx-Image-Cache"]="MISS",new Response(new Uint8Array(F),{headers:p})}catch(x){let P=x.message;return new Response(`Image processing failed: ${P}`,{status:500,headers:{"Content-Type":"text/plain"}})}}function Mc(e){return async(t)=>await Ii(t,e)??new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain"}})}function A(e,t){let r=e.searchParams.get("src");if(!r)return{ok:!1,error:"Missing required param: src",status:400};if(!r.startsWith("/"))return{ok:!1,error:"src must be an absolute URL path (start with /)",status:400};if(r.startsWith("//"))return{ok:!1,error:"src must be a local path",status:400};let h=g.extname(r).toLowerCase();if(!q.has(h))return{ok:!1,error:`Unsupported source extension: ${h}`,status:400};let a=g.resolve(t.publicDir),n=g.resolve(a,r.slice(1));if(!n.startsWith(`${a}${g.sep}`)&&n!==a)return{ok:!1,error:"src is outside publicDir",status:400};let d=t.maxWidth??k,l=t.maxHeight??k,i=e.searchParams.get("w"),s=e.searchParams.get("h"),u=i?Number.parseInt(i,10):0,c=s?Number.parseInt(s,10):0;if(i&&(!Number.isFinite(u)||u<=0))return{ok:!1,error:"Invalid w (must be positive integer)",status:400};if(s&&(!Number.isFinite(c)||c<=0))return{ok:!1,error:"Invalid h (must be positive integer)",status:400};if(!i&&!s)return{ok:!1,error:"At least one of w or h is required",status:400};let m=Math.min(u||d,d),w=Math.min(c||l,l),b=e.searchParams.get("f")||"webp";if(!S.has(b))return{ok:!1,error:`Invalid f (must be one of: ${[...S].join(", ")})`,status:400};let I=b,f=e.searchParams.get("q"),o=f?Number.parseInt(f,10):t.defaultQuality??D;if(!Number.isFinite(o)||o<1||o>100)return{ok:!1,error:"Invalid q (must be 1-100)",status:400};let y=e.searchParams.get("fit")||t.defaultFit||U;if(!T.has(y))return{ok:!1,error:`Invalid fit (must be one of: ${[...T].join(", ")})`,status:400};return{ok:!0,srcFsPath:n,srcUrl:r,width:m,height:w,format:I,quality:o,fit:y}}async function L(){return await import("./chunk-y3vget29.js")}
3
+ export{Ii,Mc};