@stacksjs/stx 0.2.645 → 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 (263) 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-apeyn69a.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-c96f3eq5.js → chunk-0z5cc7qn.js} +8 -8
  13. package/dist/{chunk-hpggz2t4.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-ph8dqgr5.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-me1tdtzz.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-r2seygb5.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-rmj0n3ss.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-gvr10eqb.js → chunk-a3d0g4mr.js} +2 -2
  57. package/dist/{chunk-wpc04ygt.js → chunk-a8j91pqz.js} +11 -11
  58. package/dist/{chunk-mfd3fca7.js → chunk-aah6csjm.js} +11 -11
  59. package/dist/{chunk-dmg8dpah.js → chunk-ajv5xmjx.js} +169 -169
  60. package/dist/chunk-apgb7r22.js +2 -0
  61. package/dist/{chunk-v1mvbf82.js → chunk-aprhqxky.js} +5 -5
  62. package/dist/{chunk-kfq594fh.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-392pj66x.js → chunk-cj2xj1v6.js} +29 -29
  73. package/dist/chunk-cs0dd5w8.js +2 -0
  74. package/dist/chunk-cwd65649.js +2 -0
  75. package/dist/{chunk-w9zxb26s.js → chunk-da7x7y7j.js} +1 -1
  76. package/dist/{chunk-9wbtj6tj.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-38ngmh6h.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-kchphxkm.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-3ns5k9nf.js → chunk-jsb4pvj1.js} +2 -2
  99. package/dist/{chunk-pf5s5gjp.js → chunk-jx3wpgv0.js} +2 -2
  100. package/dist/{chunk-2zcbx82x.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-75c46b62.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-r7haw6r7.js → chunk-mmwedr93.js} +5 -5
  108. package/dist/{chunk-dyg6sadv.js → chunk-mrrrngzd.js} +1 -1
  109. package/dist/{chunk-kvn23sz5.js → chunk-msr25dhc.js} +4 -4
  110. package/dist/chunk-myq3hrww.js +6 -0
  111. package/dist/{chunk-fk1rs7jb.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-7jgtphhg.js → chunk-nrvwejdw.js} +5 -5
  115. package/dist/{chunk-3cqxtkqv.js → chunk-p08x0z86.js} +7 -7
  116. package/dist/chunk-p22w6mwr.js +2 -0
  117. package/dist/{chunk-fb17t651.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-2bsrmqr8.js → chunk-qv6axke4.js} +2 -2
  123. package/dist/{chunk-n54c06wt.js → chunk-r3e6x87d.js} +3 -3
  124. package/dist/chunk-rb5xdcen.js +25 -0
  125. package/dist/{chunk-zm4s3n4p.js → chunk-rcadtv3x.js} +1 -1
  126. package/dist/{chunk-vbqts5sf.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-22hdbqad.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-g06qzkmp.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-qa625vwc.js → chunk-vgt9f7ac.js} +4 -4
  138. package/dist/{chunk-xbdbn3bf.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-0zr1zxar.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-g2mcw1r4.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-febtq3xj.js → chunk-ym41ybz2.js} +6 -6
  155. package/dist/chunk-z8p6tk5z.js +2 -0
  156. package/dist/{chunk-4g8zase6.js → chunk-zevx9866.js} +2 -2
  157. package/dist/chunk-zhf01af3.js +3 -0
  158. package/dist/{chunk-jtvcxbwd.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/process.js +4 -3
  174. package/dist/pwa.js +3 -3
  175. package/dist/server-bindings.js +12 -6
  176. package/dist/ssg.js +28 -28
  177. package/dist/utils.js +1 -2
  178. package/package.json +5 -5
  179. package/dist/chunk-1jgsst0v.js +0 -2
  180. package/dist/chunk-1vrqmdfe.js +0 -2
  181. package/dist/chunk-1vx1ha9v.js +0 -2
  182. package/dist/chunk-1y9jphbg.js +0 -2
  183. package/dist/chunk-22kgdhxy.js +0 -2
  184. package/dist/chunk-2etamr31.js +0 -4
  185. package/dist/chunk-2s49ggrz.js +0 -12
  186. package/dist/chunk-2zbnc6jq.js +0 -2
  187. package/dist/chunk-39beqd1g.js +0 -2
  188. package/dist/chunk-3q5yn5r0.js +0 -6
  189. package/dist/chunk-3tcy2hdt.js +0 -2
  190. package/dist/chunk-3ycbhpa2.js +0 -2
  191. package/dist/chunk-3yqs2ekt.js +0 -2
  192. package/dist/chunk-4mm9ttc7.js +0 -2
  193. package/dist/chunk-4q4vy4g6.js +0 -2
  194. package/dist/chunk-4zapx8zt.js +0 -20
  195. package/dist/chunk-5zkwems4.js +0 -2
  196. package/dist/chunk-6e4es31t.js +0 -3
  197. package/dist/chunk-6hmbzqt8.js +0 -2
  198. package/dist/chunk-7a3kffqy.js +0 -2
  199. package/dist/chunk-7mkw98cr.js +0 -3
  200. package/dist/chunk-7xks65hg.js +0 -3
  201. package/dist/chunk-8k38mddf.js +0 -2
  202. package/dist/chunk-8q05cxzd.js +0 -2
  203. package/dist/chunk-a7y0fk20.js +0 -12
  204. package/dist/chunk-abwxa3tj.js +0 -2
  205. package/dist/chunk-ayjje1hk.js +0 -2
  206. package/dist/chunk-c93291jk.js +0 -2
  207. package/dist/chunk-cf6d5kgb.js +0 -65
  208. package/dist/chunk-crahn5xa.js +0 -4
  209. package/dist/chunk-d1jyxxcm.js +0 -3
  210. package/dist/chunk-d365tseq.js +0 -20
  211. package/dist/chunk-d67qvrzc.js +0 -24
  212. package/dist/chunk-dwnvqy3f.js +0 -4
  213. package/dist/chunk-dxb7jw7g.js +0 -2
  214. package/dist/chunk-e8483tnk.js +0 -2
  215. package/dist/chunk-eaphbqqx.js +0 -2
  216. package/dist/chunk-em0chjea.js +0 -18
  217. package/dist/chunk-ercd4pqc.js +0 -2
  218. package/dist/chunk-ewj4gqwe.js +0 -31
  219. package/dist/chunk-f7bgg2e4.js +0 -2
  220. package/dist/chunk-g6s0xdgb.js +0 -4
  221. package/dist/chunk-jxsgky4v.js +0 -2
  222. package/dist/chunk-k90yzxwp.js +0 -2
  223. package/dist/chunk-kfx4cte8.js +0 -127
  224. package/dist/chunk-kxbw0e2f.js +0 -3
  225. package/dist/chunk-ky043mkv.js +0 -2
  226. package/dist/chunk-mbqqc20a.js +0 -2
  227. package/dist/chunk-mq2kpg6w.js +0 -2
  228. package/dist/chunk-n58ky78d.js +0 -2
  229. package/dist/chunk-n80wh9b5.js +0 -2
  230. package/dist/chunk-p7sfjgtm.js +0 -2
  231. package/dist/chunk-ps9htxmp.js +0 -2
  232. package/dist/chunk-qhaw7f32.js +0 -2
  233. package/dist/chunk-rh33ra9e.js +0 -2
  234. package/dist/chunk-rzs2hpqa.js +0 -2
  235. package/dist/chunk-s3sckkvv.js +0 -2
  236. package/dist/chunk-s89pq4v1.js +0 -2
  237. package/dist/chunk-sdqgmcbk.js +0 -2
  238. package/dist/chunk-srmm69d4.js +0 -2852
  239. package/dist/chunk-t00y30w3.js +0 -2
  240. package/dist/chunk-t1a39rpd.js +0 -2
  241. package/dist/chunk-tj4rzy69.js +0 -2
  242. package/dist/chunk-tme51pg1.js +0 -2
  243. package/dist/chunk-tv1qtqab.js +0 -3
  244. package/dist/chunk-twh5ck5w.js +0 -2
  245. package/dist/chunk-v4tt3t1y.js +0 -2
  246. package/dist/chunk-v5ekdsw0.js +0 -2
  247. package/dist/chunk-vdsrae92.js +0 -2
  248. package/dist/chunk-w88mpbxk.js +0 -11
  249. package/dist/chunk-wg6n7txf.js +0 -2
  250. package/dist/chunk-wj4rf7sb.js +0 -2
  251. package/dist/chunk-wrd5me1w.js +0 -33
  252. package/dist/chunk-xbevgwks.js +0 -2
  253. package/dist/chunk-y2k3ynr2.js +0 -2
  254. package/dist/chunk-y51ndrdb.js +0 -2
  255. package/dist/chunk-y9wqzvxt.js +0 -2
  256. package/dist/chunk-yn2d8x8m.js +0 -3
  257. package/dist/chunk-ysmt4jpn.js +0 -2
  258. package/dist/chunk-zmccfvbf.js +0 -2
  259. package/dist/chunk-ztpqxs72.js +0 -2
  260. package/dist/chunk-ztwnn466.js +0 -2
  261. package/dist/chunk-zx7v6a4g.js +0 -40
  262. package/dist/chunk-zx94g4pg.js +0 -2
  263. package/dist/chunk-zze1ez1c.js +0 -2
@@ -0,0 +1,406 @@
1
+ // @bun
2
+ import{Me,mn,ys,Bo,A}from"./chunk-5t4qtxgr.js";import{gn}from"./chunk-pdc9s7bg.js";import{br,x,ic,rt,Go,ac}from"./chunk-7rta163c.js";import{T}from"./chunk-ce6zddpf.js";import{bs,l,d,Nt,u,z,D,w,Ss,ve,je,ks}from"./chunk-bk96wjaz.js";import{o,Qe}from"./chunk-egg54kd0.js";import{p}from"./chunk-2a4szpje.js";import{H}from"./chunk-354jmw2k.js";import Xe from"path";import kt from"process";import{AsyncLocalStorage as no}from"async_hooks";var Qs=new no;function ln(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function er(e,s){return Qs.run(ln(e),s)}async function tr(e,s){let t=Qs.getStore();if(!t)throw Error("useServerData must run inside a <script server> render");if(typeof e!=="string"||!e.trim())throw TypeError("useServerData requires a non-empty string key");let i=t.pending.get(e);if(i)return i;let a=Promise.resolve().then(s).then((h)=>{let c=JSON.stringify(h,(E,R)=>{if(R===void 0||typeof R==="function"||typeof R==="symbol"||typeof R==="bigint"||typeof R==="number"&&!Number.isFinite(R))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(R&&typeof R==="object"&&!Array.isArray(R)&&Object.getPrototypeOf(R)!==Object.prototype&&Object.getPrototypeOf(R)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return R}),v=JSON.parse(c);return t.values.set(e,v),v}).catch((h)=>{throw t.pending.delete(e),h});return t.pending.set(e,a),a}function cr(e){let s=e.__stx_server_data;if(!s?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(s.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function L(e,s=!1){let t=o(e),i=[],a=new Set,h=0,c=0,v=t.length,E=()=>{if(h!==0)return;let R=t.slice(c).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(R){if(s&&R[1]==="const")return;let I=R[2];if(!a.has(I))i.push(I),a.add(I);return}let C=t.slice(c).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(C){if(s&&t.slice(c).startsWith("const"))return;C[1].split(",").forEach((I)=>{let N=I.trim();if(!N)return;let Z=N.indexOf(":"),V=(Z>=0?N.slice(Z+1).trim():N).split(/[\s=]/)[0];if(V&&!a.has(V))i.push(V),a.add(V)});return}let O=t.slice(c).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(O){if(s&&t.slice(c).startsWith("const"))return;O[1].split(",").forEach((I)=>{let N=I.trim().replace(/^\.\.\./,"");if(!N)return;let Z=N.split(/[\s=]/)[0];if(Z&&!a.has(Z))i.push(Z),a.add(Z)});return}if(s)return;let P=t.slice(c).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(P){let I=P[1];if(!a.has(I))i.push(I),a.add(I);return}let M=t.slice(c).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(M){let I=M[1];if(!a.has(I))i.push(I),a.add(I)}};while(c<v){if(t[c]==="{"){h++,c++;continue}if(t[c]==="}"){h--,c++;continue}if(h===0&&/[a-z]/i.test(t[c])&&(c===0||/\s|[;{}()]/.test(t[c-1])))E();c++}return i.join(", ")}function ns(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function so(e,s=L(e).split(",").map((t)=>t.trim()).filter(Boolean)){let t=new Set(L(e,!0).split(",").map((i)=>i.trim()));return s.map((i)=>t.has(i)?`get ${i}() { return ${i} }, set ${i}(__stxValue_${i}) { ${i} = __stxValue_${i} }`:i).join(", ")}function rs(e,s){let t=`{ ${so(e,s)} }`;return L(e).split(",").some((i)=>i.trim()==="__stxLiveBindings")?`Object.defineProperties(${t}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:t}import Rn from"fs";import ke from"path";function j(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var nr=new Map;function ss(e,s=!0){let t=nr.get(e);if(s&&t)return t;let i=new Map,a=[ke.join(e,"src"),ke.join(e,"dist"),e];function h(c,v){if(v>6)return;let E;try{E=Rn.readdirSync(c,{withFileTypes:!0})}catch{return}for(let R of E){let C=ke.join(c,R.name);if(R.isDirectory()){if(R.name==="node_modules"||R.name.startsWith("."))continue;h(C,v+1)}else if(R.isFile()&&R.name.endsWith(".stx")){let O=R.name.slice(0,-4);if(!i.has(O))i.set(O,C);let P=O.toLowerCase();if(!i.has(P))i.set(P,C);let M=j(O);if(!i.has(M))i.set(M,C)}}}for(let c of a)if(h(c,0),i.size>0)break;if(s)nr.set(e,i);return i}function os(e,s){if(e.startsWith(".")||e.startsWith("/"))return null;let t=s;while(!0){let i=ke.join(t,"node_modules",e);try{if(Rn.statSync(i).isDirectory())return i}catch{}let a=ke.dirname(t);if(a===t)return null;t=a}}function is(e,s,t={}){return[ke.resolve(ke.dirname(s),`${e}.stx`),ke.resolve(ke.dirname(s),e),ke.resolve(t.componentsDir||"components",`${e}.stx`),ke.resolve(t.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function ur(e){let s=e.endsWith(".stx")?e.slice(0,-4):e,t=s.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),i=j(s);return[s,t,i]}function So(e,s){let[t,i,a]=ur(e);for(let h of[t,t.toLowerCase(),i,a]){let c=s?.__importedComponents?.get(h);if(c!==void 0)return c}}function*ko(e,s,t={},i){let a=ur(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield ke.resolve(ke.dirname(s),`${a[0]}.stx`);return}let h=[...new Set(a.map((E)=>`${E}.stx`))],c=t.projectRoot||process.cwd(),v=[...i?.__originalFilePath?[ke.join(ke.dirname(i.__originalFilePath),"components")]:[],...t.componentsDir?[t.componentsDir]:[],ke.join(ke.dirname(s),"components"),ke.resolve(c,"src/components"),ke.resolve(c,"components"),...import.meta.dir?[ke.resolve(import.meta.dir,"components")]:[]];for(let E of new Set(v)){for(let R of h)yield ke.join(E,R);try{for(let R of Rn.readdirSync(E,{withFileTypes:!0}))if(R.isDirectory())for(let C of h)yield ke.join(E,R.name,C)}catch{}}}function fr(e,s,t={},i){let a=So(e,i);if(a!==void 0)return a;for(let h of ko(e,s,t,i))try{if(Rn.statSync(h,{throwIfNoEntry:!1})?.isFile())return h}catch{}return null}import Us from"fs";import oe from"path";import dt from"path";import Kt from"fs";var ro=new Set(["touchstart","touchmove","wheel","mousewheel"]);function Yn(e,s){if(s.passive)return!0;if(s.prevent||s.nonpassive)return!1;return ro.has(e.toLowerCase())}var pr=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","wheel","keydown","keyup","keypress","submit","reset","change","input","focus","blur","focusin","focusout","select","invalid","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","scroll","resize","load","error","abort","animationstart","animationend","animationiteration","transitionstart","transitionend","transitionrun","transitioncancel","mounted","unmounted"]),dr={enter:"Enter",tab:"Tab",delete:"Delete",backspace:"Backspace",esc:"Escape",escape:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown"},io=new Set(["ctrl","alt","shift","meta"]),hr={left:0,middle:1,right:2};function gr(e){let s={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let t of e){let i=t.toLowerCase();if(i==="prevent")s.prevent=!0;else if(i==="stop")s.stop=!0;else if(i==="once")s.once=!0;else if(i==="capture")s.capture=!0;else if(i==="self")s.self=!0;else if(i==="passive")s.passive=!0;else if(i==="nonpassive")s.nonpassive=!0;else if(io.has(i))s.systemKeys.push(i);else if(i in hr)s.mouse=i;else if(i in dr||/^[a-z]$/.test(i))s.keys.push(dr[i]||i.toUpperCase());else if(i.startsWith("debounce")){let a=i.match(/debounce(?:\.(\d+))?/);s.debounce=a?.[1]?Number.parseInt(a[1],10):300}else if(i.startsWith("throttle")){let a=i.match(/throttle(?:\.(\d+))?/);s.throttle=a?.[1]?Number.parseInt(a[1],10):300}}return s}function xr(e,s=""){let t=[],i=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,h;while((h=a.exec(e))!==null){let[c,v,E]=h,R=h.index,C=R+c.length,O=`__stx_evt_${s}${i++}`,P=[],M=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,I;while((I=M.exec(E))!==null){let[,Z,U]=I,V=Z.split("."),X=V[0];if(!pr.has(X))continue;P.push({attribute:`@${Z}`,event:X,handler:U,modifiers:gr(V.slice(1)),elementId:O})}let N=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((I=N.exec(E))!==null){let[,Z,U]=I,V=Z.split("."),X=V[0];if(!pr.has(X))continue;P.push({attribute:`@${Z}`,event:X,handler:U,modifiers:gr(V.slice(1)),elementId:O})}if(P.length>0)t.push({originalTag:c,elementId:O,events:P,startIndex:R,endIndex:C})}return t}function oo(e){let s=[],{modifiers:t}=e;if(t.self)s.push("if ($event.target !== $el) return");for(let i of t.systemKeys)s.push(`if (!$event.${i}Key) return`);if(t.keys.length>0){let i=t.keys.map((a)=>`$event.key === '${a}'`).join(" || ");s.push(`if (!(${i})) return`)}if(t.mouse!==null){let i=hr[t.mouse];s.push(`if ($event.button !== ${i}) return`)}if(t.prevent)s.push("$event.preventDefault()");if(t.stop)s.push("$event.stopPropagation()");return s.join("; ")}function ao(e,s){let t=e;if(s.debounce!==null)t=`__stx_debounce(() => { ${t} }, ${s.debounce})`;else if(s.throttle!==null)t=`__stx_throttle(() => { ${t} }, ${s.throttle})`;return t}function Qn(e){let s=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(s))return e;return`if (typeof ${s} === 'function' && !${s}._isSignal) ${s}($event);`}function co(e){let{modifiers:s}=e,t=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),i=oo(e),a=ao(Qn(e.handler),s),h=[];if(s.once)h.push("once: true");if(s.capture)h.push("capture: true");if(Yn(e.event,s))h.push("passive: true");let c=h.length>0?`, { ${h.join(", ")} }`:"",v=a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
3
+ (function() {
4
+ var $el = document.getElementById('${t}');
5
+ if (!$el) return;
6
+ // Run mounted handler immediately (DOM is ready)
7
+ var scope = $el.closest('[data-stx-scope]');
8
+ if (scope && scope.__stx_execute) {
9
+ scope.__stx_execute('${v}', null, $el);
10
+ }
11
+ else {
12
+ __stx_runHandler('${v}', null, $el);
13
+ }
14
+ })();`;if(e.event==="unmounted")return`
15
+ (function() {
16
+ var $el = document.getElementById('${t}');
17
+ if (!$el) return;
18
+ // Set up MutationObserver to detect removal
19
+ var observer = new MutationObserver(function(mutations) {
20
+ for (var m of mutations) {
21
+ for (var node of m.removedNodes) {
22
+ if (node === $el || (node.contains && node.contains($el))) {
23
+ observer.disconnect();
24
+ var scope = $el.closest('[data-stx-scope]');
25
+ if (scope && scope.__stx_execute) {
26
+ scope.__stx_execute('${v}', null, $el);
27
+ }
28
+ else {
29
+ __stx_runHandler('${v}', null, $el);
30
+ }
31
+ return;
32
+ }
33
+ }
34
+ }
35
+ });
36
+ observer.observe(document.body, { childList: true, subtree: true });
37
+ // Store observer for cleanup
38
+ $el.__stx_unmount_observer = observer;
39
+ })();`;return`
40
+ (function() {
41
+ var $el = document.getElementById('${t}');
42
+ if (!$el) return;
43
+ // eslint-disable-next-line pickier/no-unused-vars
44
+ $el.addEventListener('${e.event}', function($event) {
45
+ ${i?i+";":""}
46
+ // Find the closest reactive scope and execute within its context
47
+ var scope = $el.closest('[data-stx-scope]');
48
+ if (scope && scope.__stx_execute) {
49
+ scope.__stx_execute('${v}', $event, $el);
50
+ }
51
+ else {
52
+ // Fallback for non-reactive context (entity-safe; decoded + run in memory)
53
+ __stx_runHandler('${v}', $event, $el);
54
+ }
55
+ }${c});
56
+ })();`}function _o(e){if(e.length===0)return"";return`
57
+ <script data-stx-events>
58
+ (function() {
59
+ 'use strict';
60
+
61
+ // Utility functions
62
+ function __stx_debounce(fn, delay) {
63
+ var timeout;
64
+ return function() {
65
+ var args = arguments;
66
+ var ctx = this;
67
+ clearTimeout(timeout);
68
+ timeout = setTimeout(function() { fn.apply(ctx, args); }, delay);
69
+ };
70
+ }
71
+
72
+ function __stx_throttle(fn, delay) {
73
+ var last = 0;
74
+ return function() {
75
+ var now = Date.now();
76
+ if (now - last >= delay) {
77
+ last = now;
78
+ fn.apply(this, arguments);
79
+ }
80
+ };
81
+ }
82
+
83
+ // Non-reactive fallback runner. The handler is embedded HTML-entity-encoded
84
+ // so the surrounding script element can never contain raw markup, including
85
+ // its own closing tag; we decode it to JS only in memory here, then run it
86
+ // with $event/$el in scope.
87
+ //
88
+ // This comment must not spell that closing tag out. It used to, as an
89
+ // example, and a browser ends the script element at the FIRST one it sees \u2014
90
+ // so everything below this line, __stx_runHandler included, was emitted as
91
+ // page text and no listener was ever bound. The comment about escaping was
92
+ // the thing that needed escaping.
93
+ function __stx_runHandler(h, $event, $el) {
94
+ var code = h
95
+ .replace(/&lt;/g, '<')
96
+ .replace(/&gt;/g, '>')
97
+ .replace(/&quot;/g, '"')
98
+ .replace(/&#39;/g, "'")
99
+ .replace(/&#x27;/g, "'")
100
+ .replace(/&amp;/g, '&');
101
+ try {
102
+ // eslint-disable-next-line no-new-func
103
+ (new Function('$event', '$el', code)).call($el, $event, $el);
104
+ }
105
+ catch (e) {
106
+ if (typeof console !== 'undefined') console.error('[stx] event handler error:', e);
107
+ }
108
+ }
109
+
110
+ // Event listeners
111
+ ${e.map(co).join(`
112
+ `)}
113
+ })();
114
+ </script>`}function lo(e,s=""){let t=xr(e,s);if(t.length===0)return{template:e,bindings:[]};let i=e,a=[];for(let h=t.length-1;h>=0;h--){let c=t[h],v=c.originalTag;if(!v.includes(" id="))v=v.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${c.elementId}"`);else{let E=v.match(/id=["']([^"']+)["']/);if(E)for(let R of c.events)R.elementId=E[1]}for(let E of c.events){let R=E.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),C=new RegExp(`\\s*${R}\\s*=\\s*"[^"]*"`,"g"),O=new RegExp(`\\s*${R}\\s*=\\s*'[^']*'`,"g");v=v.replace(C,""),v=v.replace(O,"")}i=i.slice(0,c.startIndex)+v+i.slice(c.endIndex),a.push(...c.events)}return{template:i,bindings:a}}function mr(e){let s=e.$uid;return typeof s==="string"&&s?`${s}_`:""}function Ea(e,s,t){if(ac(e))return e;if(s.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test(e))return e;let{template:v,bindings:E}=lo(e,mr(s)),R=s.__stx_event_bindings||[];return s.__stx_event_bindings=[...R,...E],v}let i=xr(e,mr(s));if(i.length===0)return e;let a=e;for(let v=i.length-1;v>=0;v--){let E=i[v],R=E.originalTag;if(!R.includes(" id="))R=R.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${E.elementId}"`);else{let C=R.match(/id=["']([^"']+)["']/);if(C)for(let O of E.events)O.elementId=C[1]}for(let C of E.events){let O=C.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),P=new RegExp(`\\s*${O}\\s*=\\s*"[^"]*"`,"g"),M=new RegExp(`\\s*${O}\\s*=\\s*'[^']*'`,"g");R=R.replace(P,""),R=R.replace(M,"")}a=a.slice(0,E.startIndex)+R+a.slice(E.endIndex)}let h=_o(i.flatMap((v)=>v.events)),c=a.lastIndexOf("</body>");if(c!==-1)a=a.slice(0,c)+h+`
115
+ `+a.slice(c);else a+=h;return a}function yr(e,s){let t=new Set;for(let i of e.split(",")){let a=i.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(s){let h=a.lastIndexOf(":");if(h!==-1)a=a.slice(h+1).trim()}if(a=a.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(a))t.add(a)}return t}function Ht(e,s){let t=o(e),{depths:i,balanced:a}=Qe(t),h=(v)=>!a||i[v]===0,c=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${s}\\b)`,"g");for(let v of t.matchAll(c)){let E=(v.index??0)+v[0].length-v[1].length;if(h(E))return!0}for(let v of t.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(h(v.index??0)&&yr(v[1],!0).has(s))return!0;for(let v of t.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(h(v.index??0)&&yr(v[1],!1).has(s))return!0;return!1}var _r="",Cn,at=/^[A-Za-z_$][\w$]*$/,uo=new Set(["if","for","while","switch","with"]),wr=["(","[","{"],Sr=[")","]","}"],fo=new Set(["const","let","var","return","if","for","while","do","switch","try","throw","export"]);function po(e){let s=o(e),t=[];for(let i of s.matchAll(/[A-Za-z_$][\w$]*|=>|\.\.\.|[^\s]/g)){let a=i.index??0;t.push({text:i[0],start:a,end:a+i[0].length})}return{code:s,tokens:t}}function es(e){if(Cn&&e===_r)return Cn;let{code:s,tokens:t}=po(e),i=new Map,a=[];for(let I=0;I<t.length;I++){let N=t[I].text;if(["(","[","{"].includes(N))a.push(I);else if([")","]","}"].includes(N)){let Z=a.at(-1);if(Z!==void 0&&["()","[]","{}"].includes(t[Z].text+N))a.pop(),i.set(Z,I),i.set(I,Z)}}function h(I,N){let Z=[],U=I;for(let V=I;V<N;V++){if(["(","[","{"].includes(t[V].text)&&(i.get(V)??N)<N){V=i.get(V);continue}if(t[V].text===",")Z.push([U,V]),U=V+1}return Z.push([U,N]),Z}let c=[];function v(I,N,Z,U=!1){if(t[I]?.text==="...")I++;if(I>=N)return;let V=t[I].text;if(at.test(V)){if(Z.add(V),Z===C)c.push({name:V,token:I,functionScoped:U});return}if(V!=="{"&&V!=="[")return;let X=i.get(I);if(X===void 0||X>=N)return;for(let[Y,Q]of h(I+1,X)){let se=Y;if(V==="{")for(let pe=Y;pe<Q;pe++){if(t[pe].text===":"){se=pe+1;break}if(t[pe].text==="=")break;if(["(","[","{"].includes(t[pe].text)&&i.has(pe))pe=i.get(pe)}v(se,Q,Z,U)}}function E(I,N){let Z=new Set;for(let[U,V]of h(I,N))v(U,V,Z);return Z}function R(I){let N=I;for(;N<t.length;N++){let Z=t[N].text;if(["(","[","{"].includes(Z)&&i.has(N)){N=i.get(N);continue}if([",",";",")","]","}"].includes(Z))break}return t[Math.max(I,N-1)]?.end??s.length}let C=new Set,O=[];for(let I=0;I<t.length;I++)if(t[I].text==="=>"){let N=I-1,Z=N,U;if(t[N]?.text===")"&&i.has(N))Z=i.get(N),U=E(Z+1,N);else if(t[N]&&at.test(t[N].text))U=new Set([t[N].text]);else continue;let V=I+1,X=t[V]?.text==="{"&&i.has(V)?t[i.get(V)].end:R(V);O.push({start:t[Z].start,end:X,bodyStart:t[V]?.start??X,functionBody:!0,names:U})}else if(t[I].text==="("&&i.has(I)){let N=t[I-1]?.text;if(!N||uo.has(N)||!at.test(N)&&N!=="*"&&N!=="]")continue;let Z=i.get(I),U=Z+1;if(t[U]?.text===":"){U++;while(U<t.length&&!["{","=>",";","="].includes(t[U].text))U++}if(t[U]?.text!=="{"||!i.has(U))continue;O.push({start:t[I].start,end:t[i.get(U)].end,bodyStart:t[U].start,functionBody:N!=="catch",names:E(I+1,Z)})}function P(I){let N=I;for(;N<t.length;N++){let Z=t[N].text;if(wr.includes(Z)&&i.has(N)){N=i.get(N);continue}if(Z===";"||Sr.includes(Z))break;let U=t[N-1];if(N>I&&fo.has(Z)&&U.text!==".")break;if(N>I&&/[\n\r]/.test(s.slice(U.end,t[N].start))&&(/^[\w$]+$/.test(U.text)||Sr.includes(U.text)||['"',"'","`"].includes(U.text))&&at.test(Z)&&!["in","of","instanceof"].includes(Z))break}return N}let M=[];for(let I=0;I<t.length;I++){if(t[I].text!=="for")continue;let N=t[I+1]?.text==="await"?I+2:I+1;if(t[N]?.text!=="("||!i.has(N))continue;let Z=i.get(N),U=Z+1,V=t[U]?.text==="{"&&i.has(U)?i.get(U):P(U),X=t[V]?.text===";"||t[V]?.text==="}"?t[V].end:t[Math.max(U,V-1)]?.end??s.length;M.push({headStart:N,headEnd:Z,start:t[N].start,end:X})}for(let I=0;I<t.length;I++){let N=t[I].text,Z=t[I-1]?.text;if(Z==="."||t[I+1]?.text===":")continue;if(Z==="as"||Z==="<")continue;if(N==="const"||N==="let"||N==="var"){let U=P(I+1),V=I+1,X=!1,Y=!1,Q=0;for(let se=I+1;se<=U;se++){let pe=t[se]?.text;if(se<U&&wr.includes(pe)&&i.has(se)&&i.get(se)<U){se=i.get(se);continue}if(se<U&&pe===":"&&!Y)X=!0;else if(se<U&&pe==="="&&Q===0)X=!1,Y=!0;else if(se<U&&X&&pe==="<")Q++;else if(se<U&&X&&pe===">"&&Q>0)Q--;else if(se===U||pe===","&&Q===0)v(V,se,C,N==="var"),V=se+1,X=!1,Y=!1}}else if(N==="function"||N==="class"){let U=I+1;if(t[U]?.text==="*")U++;if(t[U]&&at.test(t[U].text)&&t[U].text!=="extends")C.add(t[U].text),c.push({name:t[U].text,token:U})}else if(N==="import"){let U=I+1;if(t[U]?.text==="*"&&t[U+1]?.text==="as")U+=2;let V=t[U]?.text;if(V&&at.test(V)&&V!=="type"&&t[U+1]?.text!=="("&&t[U+1]?.text!==".")C.add(V),c.push({name:V,token:U,file:!0});let X=t[U]?.text==="{"?U:t[U+1]?.text===","&&t[U+2]?.text==="{"?U+2:-1;if(X!==-1&&i.has(X)){let Y=i.get(X);for(let[Q,se]of h(X+1,Y)){let pe=se-1;while(pe>=Q&&!at.test(t[pe].text))pe--;if(pe>=Q&&t[pe].text!=="type")c.push({name:t[pe].text,token:pe,file:!0})}}}}return _r=e,Cn={code:s,scopes:O,loops:M,declarations:C,sites:c,tokens:t,pairs:i},Cn}function ts(e){let s=es(e);return{code:s.code,shadows:(t,i)=>s.scopes.some((a)=>i>=a.start&&i<a.end&&a.names.has(t))}}function Tn(e){return new Set(es(e).declarations)}function rn(e,s){let{scopes:t,loops:i,sites:a,tokens:h,pairs:c}=es(e),v=Array.from({length:h.length},()=>-1),E=[];for(let M=0;M<h.length;M++){v[M]=E.length?E[E.length-1]:-1;let I=h[M].text;if(I==="{"&&c.has(M))E.push(M);else if(I==="}"&&E.length&&c.get(M)===E[E.length-1])E.pop()}let R=new Set,C=new Map;for(let M of a){if(!s.has(M.name))continue;R.add(M.token);let I=M.file?-1:v[M.token],N=I===-1?[0,Number.POSITIVE_INFINITY]:[h[I].start,h[c.get(I)].end];if(M.functionScoped){let U=h[M.token].start,V=t.filter((X)=>X.functionBody&&U>=X.bodyStart&&U<X.end).sort((X,Y)=>X.end-X.bodyStart-(Y.end-Y.bodyStart))[0];N=V?[V.bodyStart,V.end]:[0,Number.POSITIVE_INFINITY]}else if(!M.file){let U=i.filter((V)=>M.token>V.headStart&&M.token<V.headEnd).sort((V,X)=>V.headEnd-V.headStart-(X.headEnd-X.headStart))[0];if(U)N=[U.start,U.end]}let Z=C.get(M.name);if(Z)Z.push(N);else C.set(M.name,[N])}let O=new Set;for(let M=0;M<h.length;M++){if(h[M].text!=="import"||h[M-1]?.text===".")continue;let I=M+1;if(h[I]?.text==="type")I++;if(h[I]&&at.test(h[I].text)&&h[I+1]?.text===",")I+=2;if(h[I]?.text==="{"&&c.has(I))for(let N=I+1;N<c.get(I);N++)O.add(N)}let P=new Set;for(let M=0;M<h.length;M++){let I=h[M].text;if(!s.has(I)||P.has(I)||R.has(M)||O.has(M))continue;let N=h[M-1]?.text;if(N==="#"||N==="."&&h[M-2]?.text!=="..")continue;if(h[M+1]?.text===":"&&(N==="{"||N===","))continue;let Z=h[M].start;if(C.get(I)?.some(([U,V])=>Z>=U&&Z<V))continue;if(t.some((U)=>Z>=U.start&&Z<U.end&&U.names.has(I)))continue;P.add(I)}return P}var Te="0.2.647";var $r=Symbol.for(`stx.lazy-module-promises.${Te}`);function mo(){let e=globalThis;return e[$r]??=new Map,e[$r]}function r(e,s){let t=mo(),i=`${import.meta.url}\x00${e}`,a=t.get(i);if(a)return a;let h=s();return t.set(i,h),h.catch(()=>{if(t.get(i)===h)t.delete(i)}),h}var ho=/<\/(script)/gi;function sn(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(ho,"<\\/$1")}import kr from"fs";class B{cache=new Map;maxSize;options;sizes;bytes=0;constructor(e=100,s){this.maxSize=e,this.options=s??null,this.sizes=s?new Map:null}get byteSize(){return this.bytes}setMaxBytes(e){if(!this.options)return;this.options={...this.options,maxBytes:e};while(this.bytes>e&&this.cache.size>0){let s=this.cache.keys().next().value;if(s===void 0)break;this.delete(s)}}get(e){if(!this.cache.has(e))return;let s=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,s),s}set(e,s){if(this.cache.has(e))this.delete(e);let t=this.options?this.options.sizeOf(s):0;if(this.options&&t>this.options.maxBytes)return;while(this.cache.size>0&&(this.cache.size>=this.maxSize||this.options!==null&&this.bytes+t>this.options.maxBytes)){let i=this.cache.keys().next().value;if(i===void 0)break;this.delete(i)}if(this.cache.set(e,s),this.sizes)this.sizes.set(e,t),this.bytes+=t}has(e){return this.cache.has(e)}delete(e){if(this.sizes){let s=this.sizes.get(e);if(s!==void 0)this.bytes-=s,this.sizes.delete(e)}return this.cache.delete(e)}clear(){this.cache.clear(),this.sizes?.clear(),this.bytes=0}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}var wt=new Map,xo=500;function Ct(e,s){if(s?.includes("g"))return new RegExp(e,s);let t=`${e}:${s||""}`;if(!wt.has(t)){if(wt.size>=xo){let i=wt.keys().next().value;if(i)wt.delete(i)}wt.set(t,new RegExp(e,s))}return wt.get(t)}class vr{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator(e){let s=Array.from(new Set(e)),t=s.sort().join(","),i=this.pool.find((v)=>v.context.join(",")===t);if(i)return i.func;let a=this.fnCache,h=this.fnCacheMaxSize,c=(...v)=>(E)=>{try{let R=`${t}:${E}`,C=a.get(R);if(!C){if(a.size>=h){let O=a.keys().next().value;if(O)a.delete(O)}C=Function(...s,`
116
+ 'use strict';
117
+ try {
118
+ return ${E};
119
+ }
120
+ catch (e) {
121
+ if (e instanceof ReferenceError || e instanceof TypeError) {
122
+ return undefined;
123
+ }
124
+ throw e;
125
+ }
126
+ `),a.set(R,C)}return C(...v)}catch{return}};if(this.pool.length<this.maxPoolSize)this.pool.push({func:c,context:s.slice()});return c}clear(){this.pool.length=0,this.fnCache.clear()}}var cu=new vr;class Er{metrics=new Map;budgets=new Map;violations=[];maxViolations=100;violationHandlers=[];enabled=!0;setEnabled(e){this.enabled=e}isEnabled(){return this.enabled}setBudget(e,s){this.budgets.set(e,{warnThreshold:0.8,action:"warn",...s})}setBudgets(e){for(let[s,t]of Object.entries(e))this.setBudget(s,t)}removeBudget(e){this.budgets.delete(e)}getBudgets(){let e={};for(let[s,t]of this.budgets.entries())e[s]=t;return e}onViolation(e){this.violationHandlers.push(e)}offViolation(e){let s=this.violationHandlers.indexOf(e);if(s!==-1)this.violationHandlers.splice(s,1)}time(e,s){if(!this.enabled)return s();let t=performance.now(),i=s(),a=performance.now()-t;return this.recordTime(e,a),this.checkBudget(e,a),i}async timeAsync(e,s){if(!this.enabled)return s();let t=performance.now(),i=await s(),a=performance.now()-t;return this.recordTime(e,a),this.checkBudget(e,a),i}checkBudget(e,s){let t=this.budgets.get(e);if(!t)return;let i=s/t.maxTime*100,a=t.warnThreshold!==void 0?s>=t.maxTime*t.warnThreshold&&s<t.maxTime:!1,h=s>=t.maxTime;if(!a&&!h)return;let c={label:e,actualTime:s,budgetTime:t.maxTime,exceedancePercent:i,timestamp:new Date,isWarning:a};this.violations.push(c);while(this.violations.length>this.maxViolations)this.violations.shift();for(let E of this.violationHandlers)try{E(c)}catch{}let v=a?`[Performance Warning] "${e}" took ${s.toFixed(2)}ms (${i.toFixed(1)}% of ${t.maxTime}ms budget)`:`[Performance Budget Exceeded] "${e}" took ${s.toFixed(2)}ms (exceeded ${t.maxTime}ms budget by ${(i-100).toFixed(1)}%)`;switch(t.action){case"log":console.log(v);break;case"warn":console.warn(v);break;case"error":console.error(v);break;case"throw":if(h)throw Error(v);else console.warn(v);break}}recordTime(e,s){let t=this.metrics.get(e);if(t)t.count++,t.totalTime+=s,t.maxTime=Math.max(t.maxTime,s),t.minTime=Math.min(t.minTime,s);else this.metrics.set(e,{count:1,totalTime:s,maxTime:s,minTime:s})}getStats(e){if(e){let t=this.metrics.get(e);if(!t)return{};let i=this.budgets.get(e);return{count:t.count,avgTime:t.totalTime/t.count,totalTime:t.totalTime,maxTime:t.maxTime,minTime:t.minTime,budget:i?.maxTime,budgetUtilization:i?t.totalTime/t.count/i.maxTime*100:void 0}}let s={};for(let[t,i]of this.metrics.entries()){let a=this.budgets.get(t);s[t]={count:i.count,avgTime:i.totalTime/i.count,totalTime:i.totalTime,maxTime:i.maxTime,minTime:i.minTime,budget:a?.maxTime,budgetUtilization:a?i.totalTime/i.count/a.maxTime*100:void 0}}return s}getViolations(e){if(e)return this.violations.filter((s)=>s.label===e);return[...this.violations]}getViolationStats(){let e={},s=0,t=0;for(let i of this.violations)if(e[i.label]=(e[i.label]||0)+1,i.isWarning)s++;else t++;return{total:this.violations.length,byLabel:e,warnings:s,errors:t}}clear(){this.metrics.clear()}clearViolations(){this.violations.length=0}clearBudgets(){this.budgets.clear()}reset(){this.clear(),this.clearViolations(),this.clearBudgets(),this.violationHandlers.length=0}}var fs=null;function bo(){if(!fs)fs=new Er;return fs}var te=new Proxy({},{get(e,s){return bo()[s]}});var Rr=[];function y(e){let s=new B(e);return Rr.push(s),s}function Ta(){for(let e of Rr)e.clear()}function b(e,...s){return`${s.map((t)=>String(t??"")).join("\x00")}\x00${e.length}\x00${Bun.hash(e)}`}function rr(e){let s=[];for(let t of new Set(e))try{s.push({path:t,mtimeMs:kr.statSync(t).mtimeMs})}catch{}return s}function as(e){for(let s of e)try{if(kr.statSync(s.path).mtimeMs!==s.mtimeMs)return!1}catch{return!1}return!0}var he=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useIntervalFn","useObjectUrl"];var yo=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function wo(e){if(e.startsWith(".")||e.startsWith("/"))return null;if(e.startsWith("@")){let t=e.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!t)return null;return{pkg:t[1],subpath:t[2]||""}}let s=e.match(/^([^/]+)(\/.*)?$/);if(!s)return null;return{pkg:s[1],subpath:s[2]||""}}function vo(e,s){let t=s;while(!0){let i=dt.join(t,"node_modules",e,"package.json");if(Kt.existsSync(i))return dt.dirname(i);let a=dt.dirname(t);if(a===t)return null;t=a}}function jo(e,s){if(!e||typeof e!=="object")return null;let t=(a)=>{if(typeof a==="string")return a;if(a&&typeof a==="object"){if(typeof a.import==="string")return a.import;if(typeof a.default==="string")return a.default;if(typeof a.import==="object")return t(a.import);if(typeof a.default==="object")return t(a.default)}return null};if(Object.prototype.hasOwnProperty.call(e,s))return t(e[s]);let i=null;for(let a of Object.keys(e)){let h=a.indexOf("*");if(h===-1)continue;let c=a.slice(0,h),v=a.slice(h+1);if(!s.startsWith(c)||!s.endsWith(v))continue;if(s.length<c.length+v.length)continue;if(!i||c.length>i.prefix.length)i={pattern:a,prefix:c,suffix:v}}if(i){let a=s.slice(i.prefix.length,s.length-i.suffix.length),h=t(e[i.pattern]);if(h)return h.replace("*",a)}return null}function zo(e,s){let t=wo(e);if(!t||!t.subpath)return null;let i=vo(t.pkg,s);if(!i)return null;let a;try{a=JSON.parse(Kt.readFileSync(dt.join(i,"package.json"),"utf8"))}catch{return null}let h=`.${t.subpath}`,c=jo(a.exports,h);if(!c)return null;let v=dt.resolve(i,c);return Kt.existsSync(v)?v:null}function Io(e,s){let t=s.filePath?dt.dirname(s.filePath):s.projectRoot||process.cwd(),i=s.projectRoot||process.cwd(),a=new Set,h=[],c=[];return{code:e.replace(yo,(E,R)=>{let C;try{if(R.startsWith("./")||R.startsWith("../")||R.startsWith("/")){if(C=R.startsWith("/")?R:dt.resolve(t,R),!Kt.existsSync(C))throw Error(`file not found: ${C}`)}else{let O=null;try{O=Bun.resolveSync(R,i)}catch{O=zo(R,i)}if(!O)throw Error(`could not resolve ${R} (Bun.resolveSync + exports fallback both failed)`);C=O}}catch(O){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(R)} (from ${s.filePath||"<unknown>"}): ${O?.message||O}`),c.push(R),""}if(a.has(C))return"";a.add(C);try{let O=Kt.readFileSync(C,"utf8");h.push({source:R,resolvedPath:C,contents:O})}catch(O){console.warn(`[stx:vendor-css] could not read ${C}: ${O?.message||O}`),c.push(R)}return""}),styles:h,unresolved:c}}function Wo(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Oo(e){if(e.length===0)return"";return`${e.map((s)=>`<style data-stx-vendor="${Wo(s.source)}" data-stx-layer="vendor">
127
+ @layer vendor {
128
+ ${s.contents}
129
+ }
130
+ </style>`).join(`
131
+ `)}
132
+ `}var Kl=x,Cr=y(256);function Pt(e){let s=b(e),t=Cr.get(s);if(!t)t=Fo(e),Cr.set(s,t);return{code:t.code,imports:[...t.imports],models:[...t.models]}}function Fo(e){let s=o(e),t=new Set;for(let v of e.matchAll(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm))for(let E of v[1].split(",")){let R=E.trim().split(/\s+as\s+/).pop()?.replace(/^type\s+/,"").trim();if(R)t.add(R)}let i=Tn(s),a=he.filter((v)=>{if(t.has(v)||i.has(v))return!1;return No(s,v,!0)}),h=Or(s).filter((v)=>!t.has(v)&&!i.has(v));if(a.length===0&&h.length===0)return{code:e,imports:a,models:h};return{code:`${[a.length>0?`import { ${a.join(", ")} } from '@stacksjs/browser'`:"",h.length>0?"import '@stacksjs/browser'":"",h.length>0?`const { ${h.join(", ")} } = window.StacksBrowser || {}`:""].filter(Boolean).join(`
133
+ `)}
134
+ ${e}`,imports:a,models:h}}var Vo=new Set(["Promise","Object","Array","Map","Set","Date","Error","JSON","Math","Number","String","RegExp","Symbol","WeakMap","WeakSet","Proxy","Reflect","Intl","URL","URLSearchParams","FormData","Headers","Request","Response","AbortController","EventTarget","Element","Document","Node","Window","Console","Storage","Navigator","Blob","File","FileReader","HTMLElement","SVGElement","Event","CustomEvent","DOMParser","XMLSerializer","WebSocket","Worker","SharedWorker","IntersectionObserver","MutationObserver","ResizeObserver","PerformanceObserver","Notification","Bun","Buffer","Process","Modal","Intl"]);function Or(e){let s=new Set,t=ts(e),i=Tn(e),a=/(?<![\w$.])([A-Z][a-zA-Z0-9]*)\s*\.\s*(all|find|first|get|where|orderBy|orderByDesc|limit|select|pluck|create|update|delete)\s*\(/g;for(let h of t.code.matchAll(a)){let c=h[1];if(Vo.has(c)||i.has(c)||c.length<3)continue;if(t.shadows(c,h.index??0))continue;s.add(c)}return Array.from(s)}function Uo(e){return Tn(e)}var Tr=y(128);function Wa(e){let s=b(e),t=Tr.get(s);if(!t)t=Ho(e),Tr.set(s,t);return{code:t.code,stxImports:[...t.stxImports],browserImports:[...t.browserImports]}}function Ho(e){let s=new Set,t=new Set,i=e;i=i.replace(/^[ \t]*import\s+type\s+\{[^}]*\}\s+from\s+['"][^'"]+['"][ \t]*;?[ \t]*$/gm,"// [type import stripped]");let a=new Set,h=/^[ \t]*import\s+(?:type\s+)?{\s*([^}]+)\s*}\s+from\s+['"](@stacksjs\/browser|@stacksjs\/stx|stx)['"][ \t]*;?[ \t]*$/gm,c;while((c=h.exec(e))!==null){let O=c[1],P=c[2];if(c[0].includes("import type"))continue;let M=[];for(let N of O.split(",")){let Z=N.trim();if(!Z||Z.startsWith("type "))continue;let U=Z.match(/^([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?$/);if(!U)continue;let V=U[1],X=U[2]||V;if(a.add(V),a.add(X),P==="stx"||P==="@stacksjs/stx")s.add(V);else t.add(V);if(X!==V)M.push(`${X} = ${V}`)}let I=M.length>0?`var ${M.join(", ")}; /* [auto-import processed] */`:"// [auto-import processed]";i=i.replace(c[0],I)}let v=Uo(i);for(let O of Kl){if(a.has(O)||v.has(O))continue;if(No(i,O,!0))s.add(O)}let E=o(i),R=new Set;for(let O of i.matchAll(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm))for(let P of O[1].split(",")){let M=P.trim().replace(/^type\s+/,"").split(/\s+as\s+/);for(let I of M){let N=I.trim();if(N)R.add(N)}}for(let O of he){if(a.has(O)||v.has(O)||R.has(O))continue;if(No(E,O))t.add(O)}let C=Or(E);for(let O of C)if(!a.has(O)&&!v.has(O))t.add(O);return{code:i,stxImports:Array.from(s),browserImports:Array.from(t)}}function No(e,s,t=!1){let i=ts(e);e=i.code;let a=new RegExp(`\\b${s.replace(/[$]/g,"\\$")}\\b`,"g");for(let h of e.matchAll(a)){let c=h.index??0;if(i.shadows(s,c))continue;let v=c+s.length,E=c-1;while(E>=0&&/\s/.test(e[E]))E--;if(e[E]==="."&&e.slice(Math.max(0,E-2),E+1)!=="...")continue;let R=v;while(R<e.length&&/\s/.test(e[R]))R++;if(e[R]===":"&&e[R+1]!==":"&&(e[E]==="{"||e[E]===","))continue;if(t&&!/^\s*(?:<[^>]*>)?\s*\(/.test(e.slice(v)))continue;if(Ko(e,v))continue;return!0}return!1}function Ko(e,s){let t=s;while(t<e.length&&(e[t]===" "||e[t]==="\t"))t++;if(e[t]!=="(")return!1;let i=0;for(;t<e.length;t++){let a=e[t];if(a==="(")i++;else if(a===")"){if(i--,i===0)break}}if(i!==0)return!1;t++;while(t<e.length&&(e[t]===" "||e[t]==="\t"))t++;return e[t]==="{"}function qa(e,s){let t=[];if(e.length>0)t.push(` var { ${e.join(", ")} } = window.stx || window;`);if(s.length>0)t.push(` var { ${s.join(", ")} } = window.StacksBrowser || {};`);if(t.length>0)return` // STX: auto-imported from stx and @stacksjs/browser
135
+ ${t.join(`
136
+ `)}
137
+ ${Zo(e,s)}`;return""}function $p(e,s=[]){let{browserImports:t}=Wa(e),i=new Set(s);return qa([],t.filter((a)=>!i.has(a)))}function Zo(e,s){let t=[...e.map((i)=>`['${i}', typeof ${i}, 'stx']`),...s.map((i)=>`['${i}', typeof ${i}, '@stacksjs/browser']`)];if(t.length===0)return"";return` // STX: report auto-imports the client runtime did not provide
138
+ [${t.join(", ")}].forEach(function (e) {
139
+ if (e[1] !== 'undefined') return;
140
+ console.error(
141
+ '[stx] "' + e[0] + '" is used in this client script and auto-imported from ' + e[2] + ', '
142
+ + 'but the client runtime does not provide it. Either it is not exported to the browser, '
143
+ + 'or it should be imported from a relative path so the bundler includes it.'
144
+ );
145
+ });
146
+ `}function Pe(e){let s=e.__stxClientPayload;if(s&&typeof s==="object"){let i={};for(let a in s){let h=s[a];if(typeof h==="function")continue;i[a]=h}return i.__stxDeclaredPayload=!0,i}let t={};for(let i in e){if(i.startsWith("__")||i.startsWith("$"))continue;let a=e[i];if(typeof a==="function")continue;t[i]=a}return t}var qo=/token|secret|passw|apikey|api_key|privatekey|private_key|credential|webhook|bearer|jwt|signature/i,Ar=new Set;function Xo(e,s){let t=qo.test(e),i=s.length>32768;if(!t&&!i)return;if(Ar.has(e))return;if(Ar.add(e),t)console.warn(`[stx] server\u2192client bridge is publishing "${e}" into the page body. If it holds a credential, rename it with a "__" prefix (never bridged) and pass only what the template needs. See stacksjs/stx#1831.`);if(i)console.warn(`[stx] server\u2192client bridge is publishing ${(s.length/1024).toFixed(1)}KB under "${e}". Every byte ships in the HTML on each request; prefix the binding with "__" and project just the fields the client reads.`)}function dn(e,s){if(!s)return"";let t=rn(e,new Set(Object.keys(s))),i=s.__stxDeclaredPayload===!0,a=[],h=Object.entries(s).sort(([c],[v])=>c<v?-1:c>v?1:0);for(let[c,v]of h){if(!/^[A-Za-z_$][\w$]*$/.test(c))continue;if(c.startsWith("__")||c.startsWith("$"))continue;if(!i&&!t.has(c))continue;if(Ht(e,c)){if(i)console.warn(`[stx] defineClientPayload declares "${c}", but this client block also declares "${c}" at the top level, so the server value is not published (emitting it would be a duplicate binding). Rename the local, or drop "${c}" from defineClientPayload.`);continue}let E;try{E=JSON.stringify(v)}catch{continue}if(E===void 0)continue;Xo(c,E),a.push(` var ${c} = ${E.replace(/</g,"\\u003c")};`)}if(a.length===0)return"";return` // stx: server -> client data bridge (seeded from server scope)
147
+ ${a.join(`
148
+ `)}
149
+ `}var Jo={left:0,middle:1,right:2};function Yo(e){let s=[];if(e.self)s.push("if ($event.target !== $el) return");for(let t of e.systemKeys)s.push(`if (!$event.${t}Key) return`);if(e.keys.length>0){let t=e.keys.map((i)=>`$event.key === '${i}'`).join(" || ");s.push(`if (!(${t})) return`)}if(e.mouse!==null){let t=Jo[e.mouse];s.push(`if ($event.button !== ${t}) return`)}if(e.prevent)s.push("$event.preventDefault()");if(e.stop)s.push("$event.stopPropagation()");return s.join("; ")}function Qo(e,s){let{elementId:t,event:i,modifiers:a}=e,h=Qn(e.handler),c=Yo(a),v=[];if(a.once)v.push("once: true");if(a.capture)v.push("capture: true");if(Yn(i,a))v.push("passive: true");let E=v.length>0?`, { ${v.join(", ")} }`:"",R="";if(c)R+=`${c}; `;let C=h.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),O=`var $emit = function(name, detail) {
150
+ $el.dispatchEvent(new CustomEvent(name, { detail: detail, bubbles: true, cancelable: true }))
151
+ };`;function P(M){if(/\$emit\s*\(/.test(M))return`${O}
152
+ ${M}`;return`var scope = $el.closest('[data-stx-scope]');
153
+ if (scope && scope.__stx_execute) {
154
+ scope.__stx_execute('${C}', $event, $el);
155
+ }
156
+ else {
157
+ ${M}
158
+ }`}if(a.debounce!==null)return` ;(function() {
159
+ // eslint-disable-next-line pickier/no-unused-vars
160
+ var $el = document.getElementById('${t}')
161
+ if (!$el) return
162
+ var __timer
163
+ $el.addEventListener('${i}', function($event) {
164
+ ${c?c+"; ":""}clearTimeout(__timer)
165
+ __timer = setTimeout(function() { ${P(h)} }, ${a.debounce})
166
+ }${E})
167
+ })()`;if(a.throttle!==null)return` ;(function() {
168
+ // eslint-disable-next-line pickier/no-unused-vars
169
+ var $el = document.getElementById('${t}')
170
+ if (!$el) return
171
+ var __last = 0
172
+ $el.addEventListener('${i}', function($event) {
173
+ ${c?c+"; ":""}var __now = Date.now()
174
+ if (__now - __last >= ${a.throttle}) {
175
+ __last = __now
176
+ ${P(h)}
177
+ }
178
+ }${E})
179
+ })()`;if(/\$emit\s*\(/.test(h))return` var $el = document.getElementById('${t}')
180
+ if ($el) $el.addEventListener('${i}', function($event) {
181
+ ${R}${O}
182
+ ${h}
183
+ }${E})`;return` var $el = document.getElementById('${t}')
184
+ if ($el) $el.addEventListener('${i}', function($event) {
185
+ ${R}var scope = $el.closest('[data-stx-scope]');
186
+ if (scope && scope.__stx_execute) {
187
+ scope.__stx_execute('${C}', $event, $el);
188
+ }
189
+ else {
190
+ ${h}
191
+ }
192
+ }${E})`}function ea(e){if(e.length===0)return"";return`
193
+ // STX: auto-generated event bindings
194
+ ${e.map((t,i)=>Qo(t,i)).join(`
195
+ `)}`}function Ir(e){let s=[],t=new Set,i=e.replace(/^\s*import\s+.*$/gm,""),a=0,h=i.length,c=0;while(c<h){let v=i[c];if(v==="'"||v==='"'||v==="`"){let E=v;if(c++,E==="`"){let R=0;while(c<h){if(i[c]==="\\"){c+=2;continue}if(i[c]==="`"&&R===0){c++;break}if(i[c]==="$"&&i[c+1]==="{"){R++,c+=2;continue}if(i[c]==="}"&&R>0){R--,c++;continue}c++}}else while(c<h){if(i[c]==="\\"){c+=2;continue}if(i[c]===E){c++;break}c++}continue}if(v==="/"&&i[c+1]==="/"){while(c<h&&i[c]!==`
196
+ `)c++;continue}if(v==="/"&&i[c+1]==="*"){c+=2;while(c<h-1&&!(i[c]==="*"&&i[c+1]==="/"))c++;c+=2;continue}if(v==="{"){a++,c++;continue}if(v==="}"){a--,c++;continue}if(a===0){let E=i.slice(c),R=E.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(R){let P=R[1];if(!P.startsWith("_")&&!t.has(P))s.push(P),t.add(P);c+=R[0].length;continue}let C=E.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(C){C[1].split(",").forEach((P)=>{let M=P.trim(),I=M.indexOf(":"),N=I>=0?M.slice(I+1).trim().split(/[\s=]/)[0]:M.split(/[\s=]/)[0];if(N&&!N.startsWith("_")&&!t.has(N))s.push(N),t.add(N)}),c+=C[0].length;continue}let O=E.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(O){let P=O[1];if(!P.startsWith("_")&&!t.has(P))s.push(P),t.add(P);c+=O[0].length;continue}}c++}return s}var ta=new Set(["if","else","true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","switch","case","break","continue","for","while","do","try","catch","finally","const","let","var","function","class","import","export","default","async","await","yield","with","debugger","console","window","document","Math","JSON","Date","Array","Object","String","Number","Boolean","Symbol","Map","Set","Promise","Error","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","setTimeout","setInterval","clearTimeout","clearInterval","fetch","alert","confirm","prompt","event"]);function na(e){let s=new Set,t=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function i(P){let M;while((M=t.exec(P))!==null){let I=M[0];if(!ta.has(I))s.add(I)}}let a=/\{\{([\s\S]*?)\}\}/g,h;while((h=a.exec(e))!==null)i(h[1]);let c=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((h=c.exec(e))!==null)i(h[1]);let v=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((h=v.exec(e))!==null)i(h[1]);let E=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((h=E.exec(e))!==null)i(h[1]);let R=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((h=R.exec(e))!==null)i(h[1]);let C=/@model\s*=\s*["']([^"']*)["']/gi;while((h=C.exec(e))!==null)i(h[1]);let O=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((h=O.exec(e))!==null)i(h[1]);return s}async function Ie(e,s={}){let t=e,i="",a=!1,h=[],c=Io(t,{filePath:s.filePath,projectRoot:s.projectRoot});t=c.code;let v=Oo(c.styles),E=Pt(t);t=E.code,h=[...E.imports,...E.models];let{hasUserImports:R,bundleClientScript:C}=await r("stx/client-script-bundler",()=>import("./chunk-1c5p7ede.js"));if(R(t))t=await C(t,s.filePath||"",{projectRoot:s.projectRoot,minify:s.production}),a=!0;if(s.autoImports!==!1){let X=Wa(t);t=X.code,i=qa(X.stxImports,X.browserImports.filter((Y)=>!h.includes(Y)))}if(i=`${dn(t,s.serverData)}${i}`,t=T(t),!a&&Oe(s.attrs||""))t=Ne(t);let O=ea(s.eventBindings||[]),P=(s.attrs||"").trim(),M=/\btype\s*=\s*["']module["']/i.test(P),I=s.instanceId?` data-stx-instance="${s.instanceId}"`:"";if(M){let X=P.replace(/\btype\s*=\s*["']module["']/i,"").trim(),Y=`type="module" data-stx-scoped${I}${X?` ${X}`:""}`;return`${v}<script ${Y}>
197
+ ${sn(`${i}${t}
198
+ ${O}`)}
199
+ </script>`}let N=Go(e),Z=/function __stx_setup_/.test(t),U=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test(e);function V(X){let Y=X.length>0?`
200
+ return ${rs(t,X)};`:"",Q=JSON.stringify(`[stx] client block failed${s.filePath?` (${s.filePath})`:""}; this block will not hydrate`);return`${v}<script data-stx-scoped data-stx-run="always"${I}>
201
+ window.stx.mount(function() {
202
+ 'use strict';
203
+ try {
204
+ ${sn(`${i}${t}
205
+ ${O}${Y}`)}
206
+ } catch (error) {
207
+ console.error(${Q}, error);
208
+ return {};
209
+ }
210
+ })</script>`}if(!U&&!Z){if(N)return V(Ir(e));if(s.templateContent){let X=Ir(e);if(X.length>0){let Y=na(s.templateContent);if(X.some((se)=>Y.has(se)))return V(X)}}}return`${v}<script data-stx-scoped data-stx-run="always"${I}>
211
+ ;(function() {
212
+ 'use strict';
213
+ try {
214
+ ${sn(`${i}${t}
215
+ ${O}`)}
216
+ } catch (error) {
217
+ console.error(${JSON.stringify(`[stx] client block failed${s.filePath?` (${s.filePath})`:""}; this block will not hydrate`)}, error);
218
+ }
219
+ })()</script>`}import{createHash as sa}from"crypto";var An="__stx_component_client_factories";function In(e){let s=e[An];return s instanceof Map?s:null}function za(e){e[An]=new Map}function xs(e,s){let t=In(e);if(!t)return null;let i=sa("sha256").update(s).digest("hex").slice(0,16),a=t.get(i);if(a)a.instances++;else t.set(i,{body:s,instances:1});return i}function Ha(e,s){let t=In(s);if(!t?.size)return e;let i=new Map;for(let[C,O]of t)if(O.instances===1)i.set(C,O.body);let a=[];if(i.size>0){let C=[...i.keys()].map((M)=>JSON.stringify(M).replace(/[$()*+.?[\\\]^{|}]/g,"\\$&")).join("|"),O=new RegExp(`window\\.__stxComponentFactories\\[(${C})\\]\\(("[^"]+")\\);`,"g"),P=O.exec(e);while(P!==null){let M=i.get(JSON.parse(P[1]));if(M!==void 0)a.push({start:P.index,end:P.index+P[0].length,replacement:`(${M})(${P[2]});`});P=O.exec(e)}}let h=[...t].filter(([,C])=>C.instances>1);if(h.length===0)return Pr(e,a);let v=`<script data-stx-scoped data-stx-run="always" data-stx-component-factories>
220
+ (function() {
221
+ const factories = window.__stxComponentFactories = window.__stxComponentFactories || {};
222
+ ${h.map(([C,O])=>` try { factories[${JSON.stringify(C)}] = factories[${JSON.stringify(C)}] || ${O.body}; }
223
+ catch (e) { console.error('[stx] component factory ' + ${JSON.stringify(C)} + ' failed to register; instances of it will not hydrate.', e); }`).join(`
224
+ `)}
225
+ })();
226
+ </script>`,E=e.search(/<script\b(?=[^>]*\bdata-stx-scoped\b)/i),R=E<0?0:E;return a.push({start:R,end:R,replacement:`${v}
227
+ `}),Pr(e,a)}function Pr(e,s){if(s.length===0)return e;s.sort((h,c)=>h.start-c.start||h.end-c.end);let t=Array(s.length*2+1),i=0,a=0;for(let h of s)t[a++]=e.slice(i,h.start),t[a++]=h.replacement,i=h.end;return t[a]=e.slice(i),t.join("")}function Mr(e){let s=In(e),t=new Map;if(s)for(let[i,a]of s)t.set(i,a.instances);return t}function Dr(e,s){let t=In(e);if(!t)return[];let i=[];for(let[a,h]of t){let c=h.instances-(s.get(a)??0);if(c>0)i.push({body:h.body,count:c})}return i}function jr(e,s){for(let{body:t,count:i}of s)for(let a=0;a<i;a++)xs(e,t)}function Ye(e,s,t=2){let i=0,a=null;for(let h=s+t;h<e.length;h++){let c=e[h];if(a){if(c==="\\"){h++;continue}if(c===a)a=null;continue}if(c==='"'||c==="'"||c==="`"){a=c;continue}if(c==="{"){i++;continue}if(c==="}"){if(i>0){i--;continue}let v=0;while(e[h+v]==="}")v++;if(v>=t)return h}}return-1}import Zr from"fs";var Nr=0,_s=new Map;function Xa(){Nr=0,_s.clear()}function On(e,s){let t=Nr++,i=`<!--__STX_${e.toUpperCase()}_${t}__-->`;return _s.set(i,{type:e,expression:s}),i}function Ja(){let e={};for(let[s,t]of _s)e[s]={type:t.type,expression:t.expression};return e}function Ya(e,s){let t=e;for(let[i,a]of s)t=t.split(i).join(a);return t}function Mo(e){return e.includes("<!--__STX_")}var ra=/@(?=[a-zA-Z_]\w*\s*\(|end[a-zA-Z]*\b|else(?:if)?\b|empty\b|case\b|default\b|break\b|continue\b|fallback\b)/g;function ia(e){return Array.from({length:e},()=>"&#123;").join("&#8288;")}function Lr(e){return e.replace(/\{{2,}/g,(s)=>ia(s.length)).replace(/\{(?=!)/g,"&#123;&#8288;").replace(ra,"&#64;")}function cs(e,s,t=!1){let i="",a=0;for(let R=0;R<s;R++){if(!e.startsWith("{{",R))continue;let C=Ye(e,R);if(C<0||C+2>s)break;i+=e.slice(a,R)+"x",R=C+1,a=C+2}i+=e.slice(a,s);let h=-1,c=null;for(let R=0;R<i.length;R++){let C=i[R];if(c){if(C===c)c=null;continue}if(h>=0||t){if(C==='"'||C==="'"){c=C;continue}if(C===">"){h=-1;continue}}if(C==="<")h=R}if(h<0&&!t)return null;let v=h>=0?i.slice(h+1):i;if(h>=0&&/^\s*[!/?]/.test(v))return/^\s*\/?\s*$/.test(v)?{kind:"tag-name"}:null;if(h>=0&&/^\s*$/.test(v))return{kind:"tag-name"};let E=0;if(h>=0)while(E<v.length&&!/\s/.test(v[E]))E++;while(E<v.length){while(/\s/.test(v[E]??"")&&E<v.length)E++;let R=E;while(E<v.length&&!/[\s=/>]/.test(v[E]))E++;let C=v.slice(R,E);if(!C)break;while(E<v.length&&/\s/.test(v[E]))E++;if(v[E]!=="=")continue;E++;while(E<v.length&&/\s/.test(v[E]))E++;let O=v[E];if(O==='"'||O==="'"){let P=++E,M=v.indexOf(O,E);if(M===-1)return{kind:"attribute",name:C,quote:O,valuePrefix:v.slice(P)};E=M+1}else{let P=E;while(E<v.length&&!/\s/.test(v[E]))E++;if(E===v.length)return{kind:"attribute",name:C,quote:null,valuePrefix:v.slice(P)}}}return{kind:"tag"}}class le extends Error{attribute;constructor(e,s){super(`Unsafe interpolation in ${e}: ${s}`);this.name="UnsafeInterpolationContextError",this.attribute=e}}var Br="unsafe:";var oa=/^(?:javascript|vbscript|livescript|mocha|view-source):/,aa=/^data:(?:text\/html|text\/xml|application\/xhtml\+xml|application\/xml|image\/svg\+xml)/,ca=/^data:(?:text\/html|application\/xhtml\+xml)/,la=new RegExp("[\\u0000-\\u0020\\u00A0\\u1680\\u2000-\\u200F\\u2028\\u2029\\u202F\\u205F\\u3000\\uFEFF]+","g");function ua(e){return e.replace(la,"").toLowerCase()}function ws(e){let s=e.toLowerCase();if(new RegExp("^(?:href|xlink:href|action|formaction|ping|cite|manifest|data|to)$").test(s))return"navigable";if(new RegExp("^(?:src|srcset|poster|background)$").test(s))return"fetched";return null}function Pn(e,s="navigable"){let t=ua(e);if(oa.test(t))return!0;return s==="navigable"?aa.test(t):ca.test(t)}function sr(e,s="navigable"){return Pn(e,s)?"unsafe:"+e:e}function fa(e){let s=e.match(/(?:^|[\s"'`/])([A-Za-z][\w:-]*)\s*=\s*(["'])([^"']*)$/);if(!s)return null;if(s[3].trim()!=="")return null;return ws(s[1])}function zr(e,s,t=256){if(s<=t)return e.slice(0,s);let i=e.slice(s-t,s),a=i.search(/[\s"'`/]/);return a===-1?"":i.slice(a)}function Wr(e,s,t=s){let i=fa(e);return i&&Pn(s,i)?"unsafe:"+t:t}var Mn=/<script\b[^>]*>/iy,Rs=/<\/script\s*>/ig,Dn=/<style\b[^>]*>/iy,Cs=/<\/style\s*>/ig;function Fr(e,s,t,i){t.lastIndex=s;let a=t.exec(e);if(!a||a.index!==s)return-1;i.lastIndex=t.lastIndex;let h=i.exec(e);if(!h)return-1;return h.index+h[0].length}function W(e,s){return Fr(e,s,Mn,Rs)}function on(e,s){return Fr(e,s,Dn,Cs)}function Re(e,s){if(!e.startsWith("<!--",s))return-1;let t=e.indexOf("-->",s+4);if(t===-1)return-1;return t+3}function Vr(e,s){if(e.startsWith("<!--",s)){let a=Re(e,s);return a===-1?e.length:a}if(Mn.lastIndex=s,Mn.exec(e)?.index===s){Rs.lastIndex=Mn.lastIndex;let a=Rs.exec(e);return a?a.index+a[0].length:e.length}if(Dn.lastIndex=s,Dn.exec(e)?.index===s){Cs.lastIndex=Dn.lastIndex;let a=Cs.exec(e);return a?a.index+a[0].length:e.length}return-1}function ae(e,s){let t=[],i=0,a=e.length,h=!1,c=null;while(i<a){let v=e[i];if(h){if(c){if(v===c)c=null}else if(v==='"'||v==="'")c=v;else if(v===">")h=!1;i++;continue}if(v!=="<"){let O=e.indexOf("<",i+1);if(O===-1)break;i=O;continue}let E=s(e,i);if(E>i){t.push({start:i,end:E,token:e.slice(i,E)}),i=E;continue}let R=Vr(e,i);if(R>i){i=R;continue}let C=e.charCodeAt(i+1);if(C>=65&&C<=90||C>=97&&C<=122)h=!0;i++}return t}function Ur(e){let s=0,t=0,i=0,a=!1,h=null;while(i<e.length){if(a){let O=e[i];if(h){if(O===h)h=null}else if(O==='"'||O==="'")h=O;else if(O===">")a=!1;i++;continue}let c=e.indexOf("<",i),v=c===-1?e.length:c;while(i<v){let O=e[i++];if(O==="{")s++;else if(O==="}")t++;if(s>=2&&t>=2)return!0}if(c===-1)break;let E=Vr(e,c);if(E>c){i=E;continue}let R=e.charCodeAt(c+1),C=R===47?e.charCodeAt(c+2):R;if(C>=65&&C<=90||C>=97&&C<=122)a=!0;i=c+1}return!1}function $a(e,s){while(e.size>=s){let t=e.keys().next();if(t.done)return;e.delete(t.value)}}var pa=1024,da=16777216,St=new Map,$s=0;function ga(e,s){St.set(e,s),$s+=e.length+s.output.length;for(let[t,i]of St){if($s<=da)break;St.delete(t),$s-=t.length+i.output.length}}function ce(e,s,t,i){let a=i!==void 0&&e.length>=pa,h=a?`${i}\x00${e}`:"";if(a){let C=St.get(h);if(C)return St.delete(h),St.set(h,C),{output:C.output,tokens:C.tokens.slice()}}let c=ae(e,s);if(c.length===0)return{output:e,tokens:[]};let v=c.map((C)=>C.token),E="",R=0;for(let C=0;C<c.length;C++){let O=c[C];E+=e.slice(R,O.start),E+=t(O.token,C),R=O.end}if(E+=e.slice(R),a)return ga(h,{output:E,tokens:v}),{output:E,tokens:v.slice()};return{output:E,tokens:v}}var ma=1024,ha=16777216,vt=new Map,vs=0;function xa(e,s){vt.set(e,s),vs+=e.length+s.output.length;for(let[t,i]of vt){if(vs<=ha)break;vt.delete(t),vs-=t.length+i.output.length}}function Es(e,s,t){return{output:s,scripts:t,restore:(i)=>i===s?e:or(i,t)}}function q(e){let s=e.length>=ma;if(s){let a=vt.get(e);if(a)return vt.delete(e),vt.set(e,a),Es(e,a.output,a.scripts.slice())}let{output:t,tokens:i}=ce(e,W,(a,h)=>`\x00STX_SCRIPT_${h}\x00`);if(s)return xa(e,{output:t,scripts:i}),Es(e,t,i.slice());return Es(e,t,i)}function or(e,s){if(s.length===0)return e;return e.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(t,i)=>s[+i]??"")}function Et(e){let s=e.indexOf(" as ");if(s!==-1){let h=e.slice(0,s).trim(),c=e.slice(s+4).trim();return h&&c?{arrayExpr:h,itemVar:c}:null}let t=/^\s*(.+?)\s+in\s+([\s\S]+)$/.exec(e);if(!t)return null;let i=t[1].trim().replace(/^\(([\s\S]*)\)$/,"$1").trim(),a=t[2].trim();return i&&a?{arrayExpr:a,itemVar:i}:null}function jn(e){let s=[],t=0,i="",a=0;for(let h=0;h<e.length;h++){let c=e[h];if(i){if(c==="\\")h++;else if(c===i)i="";continue}if(c==="'"||c==='"'||c==="`")i=c;else if(c==="("||c==="["||c==="{")t++;else if(c===")"||c==="]"||c==="}")t--;else if(c===","&&t===0)s.push(e.slice(a,h)),a=h+1}return s.push(e.slice(a)),s}function Hr(e,s){let t=0;for(let i=0;i<e.length;i++){let a=e[i];if(a==="("||a==="["||a==="{")t++;else if(a===")"||a==="]"||a==="}")t--;else if(a===s&&t===0)return i}return-1}function Kr(e){let s=0;for(let t=0;t<e.length;t++){let i=e[t];if(i==="("||i==="["||i==="{")s++;else if((i===")"||i==="]"||i==="}")&&--s===0)return t}return-1}function gt(e,s){let t=e.trim().replace(/^\.\.\./,"").trim(),i=Hr(t,"=");if(i!==-1&&t[i+1]!==">")t=t.slice(0,i).trim();if(!t)return;if(t.startsWith("{")&&t.endsWith("}")){for(let a of jn(t.slice(1,-1))){let h=a.trim();if(!h)continue;if(h.startsWith("...")){gt(h,s);continue}let c=Hr(h,":");gt(c===-1?h:h.slice(c+1),s)}return}if(t.startsWith("[")&&t.endsWith("]")){for(let a of jn(t.slice(1,-1)))gt(a,s);return}if(/^[A-Z_$][\w$]*$/i.test(t))s.push(t)}function Tt(e){let s=e.trim(),t=[],i=0;for(let h=0;h<s.length;h++){let c=s[h];if(c==="("||c==="["||c==="{")i++;else if(c===")"||c==="]"||c==="}")i--;else if(i===0&&/\s/.test(c)){if(!/^\s+(?:in|of)\s/.exec(s.slice(h)))continue;let E=s.slice(0,h).trim();if(E.startsWith("(")&&Kr(E)===E.length-1)E=E.slice(1,-1);for(let R of jn(E))gt(R,t);if(t.length>0)return t;break}}let a=/^[\s\S]+?\s+as\s+([\s\S]+)$/.exec(s);if(a){let h=a[1].trim();if(h.startsWith("(")&&Kr(h)===h.length-1)h=h.slice(1,-1);let c=/^([\w$]+)\s*=>\s*([\s\S]+)$/.exec(h);if(c)gt(c[2],t),gt(c[1],t);else for(let v of jn(h))gt(v,t)}return t}function ue(e,s){let t=s instanceof Set?s:new Set(s);if(t.size===0)return!1;let c=e.replace(/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"/g," ").replace(/`(?:[^`\\$]|\\.|\$(?!\{))*`/g," ").replace(/\??\.\s*[a-zA-Z_$][\w$]*/g," ").replace(/([{,]\s*)[a-zA-Z_$][\w$]*(\s*:(?!:))/g,"$1$2");for(let v of c.match(/[a-zA-Z_$][\w$]*/g)||[])if(t.has(v))return!0;return!1}var Nn="__stx_client_loop_names";function Ze(e){let s=e?.[Nn];return Array.isArray(s)?s:[]}function Ln(e){if(!e.includes("#")&&!e.includes("v-slot:"))return[];let s=[],t=[],i=/<!--[\s\S]*?-->|<script\b(?:"[^"]*"|'[^']*'|[^'">])*>[\s\S]*?<\/script\s*>|<style\b(?:"[^"]*"|'[^']*'|[^'">])*>[\s\S]*?<\/style\s*>|<\/?[a-z][\w:-]*\b(?:"[^"]*"|'[^']*'|[^'">])*>/gi;for(let a of e.matchAll(i)){let h=a[0];if(/^<\/template\s*>$/i.test(h)){let c=t.pop();if(c)c.end=a.index}else if(/^<template\b/i.test(h)&&!/\/\s*>$/.test(h)){let v=[...h.slice(9).matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g)].find((C)=>/^(?:#[\w-]+|v-slot:[\w-]+)$/i.test(C[1])),E=(v?.[2]??v?.[3])?.trim(),R=E?{start:a.index+h.length,end:e.length,binding:E}:void 0;if(t.push(R),R)s.push(R)}}return s}var qt={},qr=new Map;function ba(e){let s=qr.get(e);if(!s){let t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");s=new RegExp(`:${t}(?!\\w)`,"g"),qr.set(e,s)}return s.lastIndex=0,s}var hs={uppercase:(e,s)=>e!==void 0&&e!==null?String(e).toUpperCase():"",lowercase:(e,s)=>e!==void 0&&e!==null?String(e).toLowerCase():"",capitalize:(e,s)=>{if(e===void 0||e===null)return"";let t=String(e);return t.charAt(0).toUpperCase()+t.slice(1)},number:(e,s,t=0)=>{if(e===void 0||e===null)return"";try{let i=Number(e);return Number.isNaN(i)?"":i.toFixed(Number.parseInt(String(t),10))}catch{return""}},fmt:(e,s,t="en-US")=>{if(e===void 0||e===null)return"";try{let i=Number(e);if(Number.isNaN(i))return String(e);return i.toLocaleString(t)}catch{return String(e)}},join:(e,s,t=",")=>{if(!Array.isArray(e))return"";return e.join(String(t))},escape:(e,s)=>{if(e===void 0||e===null)return"";return F(String(e))},translate:(e,s,t={})=>{if(!s||!s.__translations)return e;let i=s.__translations,a=s.__i18nConfig?.fallbackToKey??!0,h=String(e).split("."),c=i;for(let E of h){if(c===void 0||c===null)break;c=c[E]}if(c===void 0||c===null)return a?e:"";let v=String(c);return Object.entries(t).forEach(([E,R])=>{v=v.replace(ba(E),()=>String(R))}),v},t:(e,s,t={})=>hs.translate(e,s,t),truncate:(e,s,t=50,i="...")=>{if(e===void 0||e===null)return"";let a=String(e);if(a.length<=t)return a;if(t<=i.length)return i.substring(0,t);return a.substring(0,t-i.length)+i},date:(e,s,t="short",i="en-US")=>{if(e===void 0||e===null)return"";try{let a=e instanceof Date?e:new Date(e);if(Number.isNaN(a.getTime()))return String(e);let h={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"},full:{dateStyle:"full"},time:{timeStyle:"short"},datetime:{dateStyle:"short",timeStyle:"short"},iso:{}};if(t==="iso")return a.toISOString();return new Intl.DateTimeFormat(i,h[t]||h.short).format(a)}catch{return String(e)}},currency:(e,s,t="USD",i="en-US")=>{if(e===void 0||e===null)return"";try{let a=Number(e);if(Number.isNaN(a))return String(e);return new Intl.NumberFormat(i,{style:"currency",currency:t}).format(a)}catch{return String(e)}},pluralize:(e,s,t,i)=>{let a=Number(e);if(Number.isNaN(a))return t;let h=i||`${t}s`;return a===1?t:h},first:(e,s)=>{if(e===void 0||e===null)return"";if(Array.isArray(e))return e.length===0?"":e[0];return String(e).charAt(0)},last:(e,s)=>{if(e===void 0||e===null)return"";if(Array.isArray(e))return e.length===0?"":e[e.length-1];let t=String(e);return t.charAt(t.length-1)},length:(e,s)=>{if(e===void 0||e===null)return 0;if(Array.isArray(e)||typeof e==="string")return e.length;if(e instanceof Map||e instanceof Set)return e.size;if(typeof e==="object")return Object.keys(e).length;return 0},json:(e,s,t=!1)=>{if(e===void 0)return"undefined";if(e===null)return"null";try{return t?JSON.stringify(e,null,2):JSON.stringify(e)}catch{return String(e)}},default:(e,s,t="")=>e===void 0||e===null||e===""?t:e,reverse:(e,s)=>{if(e===void 0||e===null)return"";if(Array.isArray(e))return[...e].reverse();return String(e).split("").reverse().join("")},slice:(e,s,t=0,i)=>{if(e===void 0||e===null)return"";if(Array.isArray(e)||typeof e==="string")return e.slice(t,i);return e},replace:(e,s,t,i="")=>{if(e===void 0||e===null)return"";let a=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String(e).replace(new RegExp(a,"g"),()=>i)},stripTags:(e,s)=>{if(e===void 0||e===null)return"";return String(e).replace(/<[^>]*>/g,"")},urlencode:(e,s)=>{if(e===void 0||e===null)return"";return encodeURIComponent(String(e))},abs:(e,s)=>{let t=Number(e);return Number.isNaN(t)?0:Math.abs(t)},round:(e,s,t=0)=>{let i=Number(e);if(Number.isNaN(i))return 0;let a=10**t;return Math.round(i*a)/a}};function ru(e,s){if(e in hs)console.warn(`Filter "${e}" already exists as a built-in filter. Custom filter will take precedence.`);qt[e]=s}function Ap(e){for(let[s,t]of Object.entries(e))ru(s,t)}function su(){return{...hs,...qt}}function Pp(){for(let e of Object.keys(qt))delete qt[e]}function It(e,s,t=2){let i="{".repeat(t);if(!e.includes(i))return e;let a="",h=0;for(;;){let c=e.indexOf(i,h);if(c===-1)break;let v=Ye(e,c,t);if(v===-1)break;a+=e.slice(h,c)+s(e.slice(c,v+t),e.slice(c+t,v),c),h=v+t}return h===0?e:a+e.slice(h)}function m(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function F(e){return Lr(m(e))}function ya(e){return e.replace(/ /g,"&#32;").replace(/\t/g,"&#9;").replace(/\n/g,"&#10;").replace(/\r/g,"&#13;").replace(/\f/g,"&#12;").replace(/=/g,"&#61;").replace(/`/g,"&#96;")}function _a(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\\([\dA-Fa-f]{1,6})\s?/g,(s,t)=>String.fromCodePoint(Number.parseInt(t,16))).replace(/\\([^\r\n])/g,"$1").replace(/[\u0000-\u0020]+/g,"").toLowerCase()}function wa(e,s){let t=_a(e);if(/@import|expression\(|behavior:|-moz-binding|(?:image-set|cross-fade)\(/.test(t))throw new le(s,"network-capable or executable CSS is not allowed in an escaped interpolation");let i=/url\(([^)]*)\)/g,a;while((a=i.exec(t))!==null){let h=a[1].replace(/^["']|["']$/g,""),c=h.startsWith("/")&&!h.startsWith("//")||h.startsWith("./")||h.startsWith("../")||h.startsWith("#"),v=/^data:image\/(?:avif|bmp|gif|jpeg|jpg|png|webp);base64,[a-z\d+/=]+$/i.test(h);if(!c&&!v)throw new le(s,"CSS URLs must be local paths or base64 raster images")}}function K(e,s,t,i=!1,a=0){let h=cs(e,s,i),c=F(t);if(!h)return c;if(h.kind==="tag-name"){if(!/^[A-Za-z][A-Za-z0-9:-]*$/.test(t))throw new le("tag name","dynamic tag names may contain only letters, digits, colons, and hyphens");return t}if(h.kind==="tag"){let R=e.slice(s+a).trimStart(),C=t.trim();if(!R.startsWith("=")&&(C===""||/^(?!on)[A-Za-z_:][\w:.-]*(?:\s+(?!on)[A-Za-z_:][\w:.-]*)*$/.test(C)))return C;throw new le("tag structure","only standalone boolean attributes may be interpolated into tag structure")}let v=h.name.toLowerCase();if(/^on[a-z]/.test(v))throw new le(h.name,"native event-handler attributes execute JavaScript; use an @event binding instead");if(v==="srcdoc")c=F(c);if(v==="style")wa(t,h.name);if(h.quote===null)c=ya(c);let E=ws(v);if(E&&h.valuePrefix.trim()===""&&Pn(t,E))return Br+c;return Wr(zr(e,s),t,c)}function fn(e,s){let t=` ${e}="`;return K(t,t.length,s,!0)}function ei(e){return e.flatMap((s)=>{let t=s.match(/^<script\b([^>]*)>([\s\S]*?)<\/script\s*>$/i);return!t||/\bserver\b|\bsrc\s*=/.test(t[1])?[]:[t[2]]})}function ye(e,s){let{scripts:t}=q(e);for(let i of ei(t)){if(/\b(state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^>]*>)?\s*\(/.test(i))return!0;if(br(i,s))return!0}if(/@(if|for|show)\s*=\s*["'][^"']*\(\s*\)/.test(e))return!0;if(/@for\s*=\s*["'][^"']*\s+(?:in|of)\s+[^"']*\(\s*\)/.test(e))return!0;if(/(?:^|[\s"'])(?::|x-)(?:for|if|else-if|else|show|text|html|model|bind)\b/.test(e))return!0;return!1}function ou(e){let s=[],t=/<([a-zA-Z][\w-]*)\b[^>]*?\s(?::for|x-for|@for)\s*=\s*(["'])([\s\S]*?)\2[^>]*>/g;for(let i=t.exec(e);i;i=t.exec(e)){let a=i[1].toLowerCase(),h=new Set(Tt(i[3]));if(h.size===0)continue;let c=i.index+i[0].length;if(i[0].endsWith("/>")){s.push({start:i.index,end:c,names:h});continue}let v=new RegExp(`<(/?)${a}\\b[^>]*?(/?)>`,"gi");v.lastIndex=c;let E=1,R=e.length;for(let C=v.exec(e);C;C=v.exec(e)){if(C[2]==="/")continue;if(E+=C[1]==="/"?-1:1,E===0){R=C.index+C[0].length;break}}s.push({start:i.index,end:R,names:h})}return s}function Xr(e,s,t){let i=o(t);for(let a of e){if(s<a.start||s>=a.end)continue;for(let h of a.names)if(new RegExp(`(?<![.#\\w$])${h.replace(/\$/g,"\\$")}(?![\\w$])`).test(i))return!0}return!1}function Jr(e,s){let t=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","URL","URLSearchParams","Intl","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined","NaN","Infinity","isNaN","isFinite","window","document","console","new","typeof","instanceof","in","void"],i=e.replace(/'[^']*'/g,"").replace(/"[^"]*"/g,""),a="",h=!1,c=0;for(let R=0;R<i.length;R++){let C=i[R];if(!h&&C==="`"){h=!0,c=0;continue}if(h){if(C==="`"&&c===0){h=!1;continue}if(C==="$"&&i[R+1]==="{"){c++,R++,a+=" ";continue}if(C==="}"&&c>0){c--;continue}if(c>0){a+=C;continue}continue}a+=C}i=a;let v=/(?<![a-zA-Z0-9_$])([a-zA-Z_$][a-zA-Z0-9_$]*)/g,E;while((E=v.exec(i))!==null){let R=E[1];if(!i.substring(0,E.index).trimEnd().endsWith(".")){if(!t.includes(R)&&!(R in s))return!1}}return!0}function Sa(e,s){let t=s.__stx_serverDeclared;if(!t||t.size===0)return!1;let i=o(e);for(let a of t)if(new RegExp(`(?<![.#\\w$])${a}(?![\\w$])`).test(i))return!0;return!1}var Gr=new Set;function Yr(e){return/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/.test(e.trim())}function Qr(e,s){let t=`${s??"<unknown>"}\x00${e}`;if(process.env.STX_DEBUG||!Gr.has(t))Gr.add(t),console.warn(`[stx] {{ ${e} }} in a <script> in ${s??"<unknown>"} has no server value, so it was emitted as undefined. A mustache left in JavaScript is a SyntaxError that takes the whole script down, so give the value a default in <script server>.`);return"undefined"}function Lo(e,s,t){let i=e;return i=i.replace(/\{!!([\s\S]*?)!!\}/g,(a,h)=>{try{let c=_(h,s);if(c===void 0)return Yr(h)?Qr(h.trim(),t):a;return c===null?"":String(c)}catch{return a}}),i=It(i,(a,h,c)=>{let v=h.trim();if(/^__[A-Z_]+__$/.test(v))return a;try{let E=_(h,s);if(E===void 0)return Yr(v)?Qr(v,t):a;return JSON.stringify(E).replace(/</g,"\\u003c").replace(/@/g,"\\u0040").replace(/\{{2,}/g,(R)=>"\\u007b".repeat(R.length)).replace(/\{(?=!)/g,"\\u007b")}catch{return a}}),i}function iu(e,s){if(!e.includes("{"))return e;let t=e;return t=t.replace(/\{!!([\s\S]*?)!!\}/g,(i,a)=>{try{let h=_(a,s);if(h===void 0)return i;return h===null?"":String(h)}catch{return i}}),t=It(t,(i,a,h)=>{let c=a.trim();if(/^__[A-Z_]+__$/.test(c))return i;try{let v=_(a,s);if(v===void 0)return i;if(v===null)return"";let E=String(v);return K(t,h,E,!0,i.length)}catch(v){if(v instanceof le)throw v;return i}}),t}function Ip(e,s,t={}){let{output:i,scripts:a}=q(e),h=a.map((c)=>{let v=c.match(/^<script\b((?:[^>\"']|\"[^\"]*\"|'[^']*')*)>/i),E=c.search(/<\/script\s*>$/i);if(!v||E===-1)return c;let R=v[1],C=c.slice(v[0].length,E);if(/\bdata-raw\b/.test(R))return c;if(t.skipServer&&/\bserver\b/.test(R))return c;let P=`<script${iu(R,s)}>`;if(/\bsrc\s*=/.test(R)||/\btype\s*=\s*["']application\/json["']/.test(R))return P+C+c.slice(E);return P+Lo(C,s)+c.slice(E)});return or(i,h)}function k(e,s,t){let i=e,a=(I,N)=>{let Z=on(I,N);if(Z===-1)return-1;return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(I.slice(N,Z))?-1:Z},h=(I,N,Z,U)=>{let V=Z.length,{output:X,tokens:Y}=ce(I,N,(Q,se)=>U(V+se));return Z.push(...Y),X},c=[];i=h(i,a,c,(I)=>`<!--__STX_STYLE_${I}__-->`);let v=[];i=h(i,W,v,(I)=>`<!--__STX_SCRIPT_EXPR_${I}__-->`);let E=s?.__stx_signals_gate===!0||ye(e),R=new Set([...Array.isArray(s?.__stx_client_signal_names)?s.__stx_client_signal_names:[],...Do(ei(v))]),C=new Set(Array.isArray(s?.__stx_preserved_client_expressions)?s.__stx_preserved_client_expressions:[]);i=It(i,(I,N,Z)=>{try{let U=_(N,s,!1,(V)=>Ts(V,I,t,e));return U!==void 0&&U!==null?String(U):""}catch(U){let V=U instanceof Error?U.message:String(U);return g("Expression",`Error evaluating: {{{ ${N.trim()}}}}: ${V}`,t,e,Z,I)}},3),i=i.replace(/\{!!([\s\S]*?)!!\}/g,(I,N,Z)=>{try{let U=_(N,s,!1,(V)=>Ts(V,I,t,e));if(U===void 0&&s.__stx_buildMode==="compile")return On("raw",N.trim());return U!==void 0&&U!==null?String(U):""}catch(U){if(s.__stx_buildMode==="compile")return On("raw",N.trim());let V=U instanceof Error?U.message:String(U);return g("Expression",`Error evaluating: {!! ${N.trim()} !!}: ${V}`,t,e,Z,I)}}),i=h(i,W,v,(I)=>`<!--__STX_SCRIPT_EXPR_${I}__-->`),i=h(i,a,c,(I)=>`<!--__STX_STYLE_${I}__-->`);let O=E?ou(i):[],P=Ln(i).map((I)=>({...I,names:new Set(Tt(`${I.binding} in __slot`))})),M=new Set(Ze(s));if(i=It(i,(I,N,Z)=>{let U=N.trim();if(Xr(P,Z,U))return I;if(ue(U,M))return I;if(O.length>0&&Xr(O,Z,U))return I;if(C.has(U))return I;let V=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined"],X=/^([a-zA-Z_$][a-zA-Z0-9_$]*)/,Q=U.match(X)?.[1],se=Q&&((Q in s)||V.includes(Q)),pe=Boolean(Q&&R.has(Q)),Se=/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/,Ee=U.match(Se),Be=Ee&&!V.includes(Ee[1])&&!(Ee[1]in s);if(/^__[A-Z_]+__$/.test(U))return"";if(pe)return I;let Ce;try{let Ue=_(N,s,!1,(mt)=>{Ce=mt});if(E&&!Jr(U,s))return I;if(Ce)Ts(Ce,I,t,e);if(s.__stx_buildMode==="compile"&&!E&&(Ue===void 0||Sa(U,s)))return On("expr",U);if(Ue===void 0||Ue===null)return"";let Je=String(Ue);return K(i,Z,Je,!1,I.length)}catch(Ue){if(Ue instanceof le)throw Ue;if(E&&!Jr(U,s))return I;if(Be)return I;let Je=Ue instanceof Error?Ue.message:String(Ue);return g("Expression",`Error evaluating: {{ ${U} }}: ${Je}`,t,e,Z,I)}}),v.length>0)i=i.replace(/<!--__STX_SCRIPT_EXPR_(\d+)__-->/g,(I,N)=>v[Number(N)]??I);if(c.length>0)i=i.replace(/<!--__STX_STYLE_(\d+)__-->/g,(I,N)=>c[Number(N)]??I);return i}function au(e,s,t){if(!s.trim())return e;let i=e,a=s.trim();while(a.length>0){let h=a.match(/^(\w+)/);if(!h)break;let c=h[1];a=a.substring(c.length).trim();let v=qt[c]||hs[c];if(!v)throw Error(`Filter not found: ${c}. Available filters: ${Object.keys(su()).join(", ")}`);let E=[];if(a.startsWith(":")){let R=a.match(/^:([^|\s]+)/);if(R){let C=R[1].trim();try{let O=Number(C);E=[Number.isNaN(O)?C:O]}catch{E=[C]}a=a.substring(R[0].length).trim()}}else if(a.startsWith("(")){let R=1,C=1;while(R>0&&C<a.length){if(a[C]==="(")R++;if(a[C]===")")R--;C++}if(R===0){let O=a.substring(1,C-1).trim();if(O)try{if(O.startsWith("{")&&O.endsWith("}"))E=[_(`(${O})`,t,!0)];else{let P=[],M="",I=null,N=0,Z=0,U=0,V=!1;for(let X=0;X<O.length;X++){let Y=O[X];if(V){M+=Y,V=!1;continue}if(Y==="\\"){M+=Y,V=!0;continue}if(I){if(M+=Y,Y===I)I=null;continue}if(Y==='"'||Y==="'"||Y==="`"){I=Y,M+=Y;continue}if(Y==="(")N++;else if(Y===")")N--;else if(Y==="[")Z++;else if(Y==="]")Z--;else if(Y==="{")U++;else if(Y==="}")U--;if(Y===","&&N===0&&Z===0&&U===0){P.push(M),M="";continue}M+=Y}if(M)P.push(M);E=P.map((X)=>{let Y=X.trim();return _(Y,t,!0)})}}catch{E=[O]}a=a.substring(C).trim()}}try{i=v(i,t,...E)}catch(R){let C=R instanceof Error?R.message:String(R);throw Error(`Error applying filter '${c}': ${C}`)}if(a.startsWith("|"))a=a.substring(1).trim();else break}return i}function va(e){let s=!1,t="",i=0,a=0,h=0,c=!1;for(let v=0;v<e.length;v++){let E=e[v],R=e[v+1];if(s&&c){c=!1;continue}if(s&&E==="\\"){c=!0;continue}if(c=!1,(E==='"'||E==="'"||E==="`")&&!c){if(!s)s=!0,t=E;else if(E===t)s=!1,t="";continue}if(s&&t==="`"&&E==="$"&&R==="{"){let C=1;v+=2;while(v<e.length&&C>0){if(e[v]==="{")C++;else if(e[v]==="}")C--;if(C>0)v++}continue}if(s)continue;if(E==="(")i++;else if(E===")")i--;else if(E==="[")a++;else if(E==="]")a--;else if(E==="{")h++;else if(E==="}")h--;if(E==="|"&&i===0&&a===0&&h===0){if(R==="|"){v++;continue}if(R==="="){v++;continue}return v}}return-1}var Zt=new Set,ka=1000;function Op(){Zt.clear()}function Ts(e,s,t,i){if(!H())return;let a=`${t}\x00${e.expression}`;if(Zt.has(a))return;if(Zt.size>=ka)Zt.clear();Zt.add(a);let h=t,c=i;try{if(t&&Zr.existsSync(t))c=Zr.readFileSync(t,"utf8")}catch{}let v=c.indexOf(s);if(v>=0)h=`${t}:${c.slice(0,v).split(`
228
+ `).length}`;console.warn(`${h}: stx warning: ${s} rendered as an empty string. The safe evaluator rejected \`${e.expression}\` (${e.rule}). Compute the value in <script server> and interpolate the variable instead.`)}function _(e,s,t=!1,i){try{let a=e.trim(),h=va(a);if(h>0){let v=a.substring(0,h).trim(),E=a.substring(h+1).trim(),R=_(v,s,!0,i);return au(R,E,s)}let c=bs(a);if(c!==null){i?.({expression:a,rule:c});return}try{let v=Object.keys(s),E=Object.values(s);return u(a,v)(...E)}catch{return l(a,s)}}catch(a){if(a instanceof ReferenceError){let h=/(\b\w+)\s+is not defined/.exec(a.message);if(h){let c=h[1],v=Ca(c,Object.keys(s));if(v&&v!==c)a.message=`${a.message} \u2014 did you mean '${v}'?`}}if(!t)console.error(`Error evaluating expression: ${e}`,a);throw a}}function Ca(e,s){let t=null;for(let a of s){if(a===e)continue;let h=Za(e,a);if(t===null||h<t.dist)t={key:a,dist:h}}if(!t)return null;let i=Math.max(e.length,t.key.length);if(t.dist<=2||t.dist/i<=0.35)return t.key;return null}function Za(e,s){if(e===s)return 0;if(e.length===0)return s.length;if(s.length===0)return e.length;let[t,i]=e.length<s.length?[e,s]:[s,e],a=Array(t.length+1),h=Array(t.length+1);for(let c=0;c<=t.length;c++)a[c]=c;for(let c=1;c<=i.length;c++){h[0]=c;for(let v=1;v<=t.length;v++){let E=t[v-1]===i[c-1]?0:1;h[v]=Math.min(h[v-1]+1,a[v]+1,a[v-1]+E)}for(let v=0;v<=t.length;v++)a[v]=h[v]}return a[t.length]}function Np(e){if(!e)return"";return e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#039;/g,"'").replace(/&#39;/g,"'").replace(/&amp;/g,"&")}import Qa from"process";function S(e="STX_PUBLIC_"){let s={},t={};for(let[i,a]of Object.entries(Qa.env)){if(!i.startsWith(e)||a===void 0)continue;s[`import.meta.env.${i}`]=JSON.stringify(a),t[i]=a}return s["import.meta.env"]=JSON.stringify(t),s}function ti(e,s=""){let t=`${e}${s}`,i=0;for(let a=0;a<t.length;a++){let h=t.charCodeAt(a);i=(i<<5)-i+h,i=i&i}return`stx-${Math.abs(i).toString(36)}`}function ni(e,s,t={}){let{prefix:i="",preserveHost:a=!0,scopeKeyframes:h=!0,scopeCustomProperties:c=!1}=t;if(!e.trim())return"";let v=As(e),E=[],R=new Map;if(h)for(let C of v){let O=C.selector.match(/@keyframes\s+([a-z_-][a-z0-9_-]*)/i);if(O){let P=O[1],M=`${s}_${P}`;R.set(P,M)}}for(let C of v){let O=si(C,s,i,a,R,c);E.push(O)}return E.join(`
229
+
230
+ `)}function As(e){let s=[],t=e.replace(/\/\*[\s\S]*?\*\//g,""),i=0,a="",h=!1,c="";for(let v=0;v<t.length;v++){let E=t[v];if(E==="@"&&i===0)h=!0;if(E==="{")i++;else if(E==="}"){if(i--,i===0){if(h){c+=E;let R=c.match(/@([a-z-]+)\s*([^{]*)\{([\s\S]*)\}/i);if(R){let[,C,O,P]=R;if(C==="keyframes")s.push({selector:`@keyframes ${O.trim()}`,declarations:P.trim()});else if(C==="media"||C==="supports"||C==="container"){let M=As(P);s.push({selector:`@${C} ${O.trim()}`,declarations:M.map((I)=>`${I.selector} { ${I.declarations} }`).join(`
231
+ `)})}else s.push({selector:`@${C} ${O.trim()}`,declarations:P.trim()})}c="",h=!1}else if(a.trim()){a+=E;let R=a.match(/([^{]+)\{([^}]*)\}/);if(R)s.push({selector:R[1].trim(),declarations:R[2].trim()});a=""}continue}}if(h)c+=E;else a+=E}return s}function si(e,s,t,i,a,h){let{selector:c,declarations:v}=e;if(c.startsWith("@")){if(c.startsWith("@keyframes")){let C=c.replace("@keyframes ","").trim();return`@keyframes ${a.get(C)||C} { ${v} }`}if(c.startsWith("@media")||c.startsWith("@supports")||c.startsWith("@container")){let O=As(`x { ${v} }`.replace(/x \{ /,"").replace(/ \}$/,"")).map((P)=>si(P,s,t,i,a,h)).join(`
232
+ `);return`${c} {
233
+ ${O}
234
+ }`}return`${c} { ${v} }`}let E=ec(c,s,t,i),R=v;for(let[C,O]of a)R=R.replace(new RegExp(`\\b${C}\\b`,"g"),O);if(h)R=R.replace(/--([a-z-]+)/gi,`--${s}-$1`);return`${E} { ${R} }`}function ec(e,s,t,i){let a=e.split(",").map((c)=>c.trim()),h=[];for(let c of a){if(c.startsWith(":host")){if(i)h.push(c);else{let R=c.replace(/:host(\([^)]*\))?/,`.${s}$1`);h.push(R)}continue}if(c.includes("::slotted")){h.push(c);continue}if(c===":root"){h.push(`:root .${s}`);continue}let v=t?`${t} .${s}`:`.${s}`;h.push(`${v} ${c}`);let E=tc(c,s);if(E)h.push(t?`${t} ${E}`:E)}return h.join(", ")}function tc(e,s){let t=0,i=e.length;for(let E=0;E<e.length;E++){let R=e[E];if(R==="["||R==="(")t++;else if(R==="]"||R===")")t--;else if(t===0&&(R===" "||R===">"||R==="+"||R==="~")){i=E;break}}let a=e.slice(0,i),h=e.slice(i);if(!a)return"";let c=a.length,v=0;for(let E=0;E<a.length;E++){let R=a[E];if(R==="["||R==="(")v++;else if(R==="]"||R===")")v--;else if(t===0&&v===0&&R===":"){c=E;break}}return`${a.slice(0,c)}.${s}${a.slice(c)}${h}`}var oi=String.raw`(?<![\w-])scoped(?![\w-])`,Is=/<style\s+([^>]*)>/gi,ri=/<style\s+([^>]*)>([\s\S]*?)<\/style>/gi,ai=new RegExp(oi,"i"),nc=new RegExp(oi,"gi"),Os=/<style\b[^>]*\bdata-stx-scoped(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?[^>]*>[\s\S]*?<\/style>\s*/gi;function sc(e){Is.lastIndex=0;let s=Is.exec(e);while(s!==null){if(ai.test(s[1]))return!0;s=Is.exec(e)}return!1}function Ro(e){let s=new Set,t=[];Os.lastIndex=0;let i=Os.exec(e);while(i!==null){let a=i[0].trim();if(s.has(a))t.push({start:i.index,end:i.index+i[0].length});else s.add(a);i=Os.exec(e)}return t}function an(e){let s=Ro(e);if(s.length===0)return e;let t=Array(s.length+1),i=0;for(let a=0;a<s.length;a++){let h=s[a];t[a]=e.slice(i,h.start),i=h.end}return t[s.length]=e.slice(i),t.join("")}function us(e,s){if(!sc(e))return{html:e,hasScoped:!1};let t=ti(s),i=`data-v-${t}`,a=e,h=!1;if(ri.lastIndex=0,a=a.replace(ri,(c,v,E)=>{if(!ai.test(v))return c;h=!0;let R=rc(E,i),C=v.replace(nc,"").trim(),O=C?` ${C}`:"";return`<style data-stx-scoped="${t}"${O}>${R}</style>`}),!h)return{html:e,hasScoped:!1};return a=cc(a,i),{html:a,hasScoped:!0}}function rc(e,s){return ni(e,"__SCOPE_PLACEHOLDER__",{preserveHost:!1}).replace(/\.(__SCOPE_PLACEHOLDER__) /g,`[${s}] `).replace(/\.(__SCOPE_PLACEHOLDER__)/g,`[${s}]`)}var oc=(e)=>`\x00stx-scope-mask-${e}\x00`,ii=/\u0000stx-scope-mask-(\d+)\u0000/g;function cc(e,s){let t=ce(e,(a,h)=>{let c=W(a,h);return c>h?c:on(a,h)},(a,h)=>oc(h)),i=lc(t.output,s);return ii.lastIndex=0,i.replace(ii,(a,h)=>t.tokens[Number(h)])}function lc(e,s){let t=new Set(["script","style","template","html","head","body","meta","link","title","base","!doctype","!DOCTYPE"]);return e.replace(/<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*)?\/?>/g,(i,a,h)=>{if(t.has(a.toLowerCase()))return i;if(i.includes(s))return i;if(a.toLowerCase()==="style"||a.toLowerCase()==="script")return i;if(h)return i.replace(`<${a}${h}`,`<${a} ${s}${h}`);if(i.endsWith("/>"))return`<${a} ${s} />`;return`<${a} ${s}>`})}var Xt=/<\/?template\b[^>]*>/gi,uc=/(?:^|\s)(?:id\s*=|(?:x-|[@:])(?:for|if|else(?:-if)?)(?=\s|=|$)|#[\w-]+(?:\s*=|\s|$)|v-slot(?::[\w-]+)?(?=\s|=|$)|slot\s*=)/i;function fc(e){let s=e.replace(/^<template\b/i,"").replace(/>$/,"");return uc.test(s)}function ie(e){Xt.lastIndex=0;let s;while((s=Xt.exec(e))!==null){if(s[0].startsWith("</")||fc(s[0]))continue;let t=s.index,i=Xt.lastIndex,a=1,h;while((h=Xt.exec(e))!==null)if(h[0].startsWith("</")){if(a--,a===0){let c=h.index;return{start:t,openEnd:i,closeStart:c,end:Xt.lastIndex,content:e.slice(i,c)}}}else a++;return null}return null}function ps(e,s){let t=e,i=/@json\s*\(/g,a;while((a=i.exec(t))!==null){let h=a.index,c=h+a[0].length-1,v=1,E=c+1,R=null,C=!1;while(E<t.length&&v>0){let X=t[E];if(C){C=!1,E++;continue}if(X==="\\"&&R){C=!0,E++;continue}if(R){if(X===R)R=null;E++;continue}if(X==='"'||X==="'"||X==="`"){R=X,E++;continue}if(X==="(")v++;else if(X===")"){if(v--,v===0)break}E++}if(v!==0)break;let O=t.substring(c+1,E).trim(),P=t.substring(h,E+1),M=-1,I=0,N=null,Z=!1;for(let X=0;X<O.length;X++){let Y=O[X];if(Z){Z=!1;continue}if(Y==="\\"&&N){Z=!0;continue}if(N){if(Y===N)N=null;continue}if(Y==='"'||Y==="'"||Y==="`"){N=Y;continue}if(Y==="("||Y==="["||Y==="{")I++;else if(Y===")"||Y==="]"||Y==="}")I--;if(Y===","&&I===0){M=X;break}}let U=M>=0?O.substring(0,M).trim():O,V=M>=0?O.substring(M+1).trim():void 0;try{let X=U.trim(),Y;if(d(X))Y=u(X,Object.keys(s))(...Object.values(s));else Y=void 0;let Q;if(V==="true")Q=JSON.stringify(Y,null,2);else Q=JSON.stringify(Y);let se=Q.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");t=t.substring(0,h)+se+t.substring(E+1),i.lastIndex=h+se.length}catch(X){D.log(X instanceof Error?X:Error(String(X)),{directive:"@json"},"error"),i.lastIndex=h+P.length}}return t}function gs(e){return e.replace(/@once\s*([\s\S]*?)@endonce/g,"$1")}function ja(e){let s=e,t=/@memo\s*\(/g,i,a=[];while((i=t.exec(s))!==null){let h=i.index,c=h+i[0].length,v=1,E=c;while(E<s.length&&v>0){if(s[E]==="(")v++;else if(s[E]===")")v--;E++}if(v!==0)continue;let R=s.slice(c,E-1).trim(),C=E,O=s.slice(C),P=O.indexOf("@endmemo");if(P===-1)continue;let M=O.slice(0,P),I=C+P+8,N=M.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)/),Z=N?N[0].length:0,U=M.slice(Z),V=M.match(/(\s*)$/),X=V?V[0].length:0,Y=U.slice(0,U.length-X),Q=Y.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)?(\/?)>/),se;if(Q){let[pe,Se,Ee="",Be]=Q,Ce=`<${Se}${Ee} data-stx-memo="${R}"${Be}>`;se=M.slice(0,Z)+Ce+Y.slice(pe.length)+M.slice(Z+Y.length)}else se=`${M.slice(0,Z)}<div data-stx-memo="${R}">${Y}</div>${M.slice(Z+Y.length)}`;a.push({start:h,end:I,replacement:se}),t.lastIndex=I}for(let h=a.length-1;h>=0;h--){let c=a[h];s=s.slice(0,c.start)+c.replacement+s.slice(c.end)}return s.replace(/@memo="([^"]*)"/g,'data-stx-memo="$1"')}function Ao(e){let s=e.replace(/@ref="([^"]+)"/g,'data-stx-ref="$1"');return s=s.replace(/(<[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?)\sref="([^"]+)"/g,'$1 data-stx-ref="$2"'),s}function fi(e,s){if(!/\bref\s*=/.test(e))return e;let t=/<\/?([a-zA-Z][\w-]*)\b(?:"[^"]*"|'[^']*'|[^'">])*>/y,i=ae(e,(E,R)=>{t.lastIndex=R;let C=t.exec(E);if(!C||/^(?:script|style)$/i.test(C[1]))return-1;return t.lastIndex}),a=[],h=0,c=0,v=[];for(let{start:E,end:R,token:C}of i){let O=/^<\/?([\w-]+)/.exec(C)[1].toLowerCase();if(C.startsWith("</")){let M;while(M=a.pop()){if(M.scoped)h--;if(M.name===O)break}continue}let P=/\sdata-stx-scope\s*=/.test(C);if(!h&&!P&&/\s(?:ref|@ref|:ref|x-ref|data-stx-ref)\s*=/.test(C)&&!/\sdata-stx-ref-caller\s*=/.test(C))v.push(e.slice(c,E),C.replace(/\s*\/?>$/,(M)=>` data-stx-ref-caller="${s}"${M}`)),c=R;if(!pi.has(O)&&!/\/>$/.test(C)){if(a.push({name:O,scoped:P}),P)h++}}return v.push(e.slice(c)),v.join("")}var pi=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),di=/(?:^|\s)x-no-cloak(?:=|\s|\/|>|$)/,ci=/<\/?\s*([a-z][\w-]*)/iy,pc=/\s/;function dc(e,s){let t=s-1;while(t>=0&&pc.test(e[t]))t--;return t>=0&&e[t]==="/"}function gc(e,s){let t=!1,i=!1;for(let a=s;a<e.length;a++){let h=e[a];if(t){if(h==="'")t=!1}else if(i){if(h==='"')i=!1}else if(h==="'")t=!0;else if(h==='"')i=!0;else if(h===">")return a}return-1}function mc(e,s){if(e.indexOf("{",s)===-1||e.indexOf("}",s)===-1)return!1;let t=0,i=s,a=!1,h=!1,c=!1;while(i<e.length){let v=e.indexOf("<",i),E=v===-1?e.length:v;if(E>i){if(t===0)while(i<E){let O=e.indexOf(h?"}":"{",i);if(O===-1||O>=E){if(h)c=!1;else a=!1;break}if(O>i)if(h)c=!1;else a=!1;if(h){if(c)return!0;c=!0}else if(a)h=!0,c=!1;else a=!0;i=O+1}i=E;continue}if(e.startsWith("<!--",i)){let O=e.indexOf("-->",i);i=O===-1?e.length:O+3;continue}let R=gc(e,i);if(R===-1)break;ci.lastIndex=i;let C=ci.exec(e)?.[1]?.toLowerCase()??"";if(e[i+1]==="/"){if(t===0)break;t--}else if(!dc(e,R)&&!pi.has(C))t++;i=R+1}return!1}var li=y(256);function Ba(e){if(e.length<1024)return ui(e);let s=b(e),t=li.get(s);if(t!==void 0)return t;let i=ui(e);return li.set(s,i),i}function ui(e){if(e.length>=32768&&!Ur(e))return e;let t=new RegExp(`<(${"div|span|p|h[1-6]|td|th|li|a|button|label|section|article|header|footer|main|nav|aside|dd|dt|figcaption|summary|caption|blockquote|pre|code|em|strong|small|sub|sup|time|mark|abbr|cite|q|s|u|b|i"})\\b`,"gi"),i="",a=0,h;while((h=t.exec(e))!==null){let c=h.index,v=c+h[0].length,E=!1,R=!1,C=-1;while(v<e.length){let P=e[v];if(E){if(P==="'")E=!1}else if(R){if(P==='"')R=!1}else if(P==="'")E=!0;else if(P==='"')R=!0;else if(P===">"){C=v;break}v++}if(C===-1)continue;let O=e.slice(c,C+1);if(di.test(O))continue;if(O.includes("x-cloak"))continue;if(mc(e,C+1))i+=e.slice(a,C)+" x-cloak>",a=C+1}return i+=e.slice(a),i}var hc=/(?:^|\s)(?::else-if|:if|:else|:show|x-else-if|x-if|x-else|x-show|@if|@show)(?:=|\s|\/|>|$)/,xc=/<\/script>/gi,bc=/<\/style>/gi;function Fa(e){let s=/<[a-z][\w-]*/gi,t="",i=0,a;while((a=s.exec(e))!==null){let h=a.index,c=a[0].slice(1).toLowerCase();if(c==="script"||c==="style"){let I=c==="script"?xc:bc;I.lastIndex=h;let N=I.exec(e);if(N!==null)s.lastIndex=N.index+N[0].length;continue}let v=h+a[0].length,E=!1,R=!1,C=-1;while(v<e.length){let I=e[v];if(E){if(I==="'")E=!1}else if(R){if(I==='"')R=!1}else if(I==="'")E=!0;else if(I==='"')R=!0;else if(I===">"){C=v;break}v++}if(C===-1)continue;let O=e.slice(h+a[0].length,C);if(di.test(O))continue;if(/(?:^|\s)x-cloak(?:=|\s|\/|>|$)/.test(O))continue;if(!hc.test(O))continue;let P=e[C-1]==="/",M=P?C-1:C;t+=`${e.slice(i,M)} x-cloak${P?" ":""}`,i=M}return t+=e.slice(i),t}import ki from"path";import Ms from"fs";import Jt from"path";function gi(e,s,t,i){let a=0;for(let h=s;h<e.length;h++)if(e[h]===t)a++;else if(e[h]===i&&!(i===">"&&e[h-1]==="=")){if(--a===0)return h}return-1}function yc(e){let s=o(e),t=0,i=0,a=[];for(let h=0;h<s.length;h++)if("([{".includes(s[h]))t++;else if(")]}".includes(s[h]))t--;else if(s[h]===","&&t===0)a.push(e.slice(i,h).trim()),i=h+1;return a.push(e.slice(i).trim()),a}function Ps(e,s){let t=o(e),i=new RegExp(`\\b(?:${s.map((a)=>a.replace(/[$]/g,"\\$&")).join("|")})\\s*(?=[<(])`,"g");for(let a of t.matchAll(i)){let h=a.index+a[0].length,c="";if(t[h]==="<"){let E=gi(t,h,"<",">");if(E<0)continue;c=e.slice(h+1,E),h=E+1;while(/\s/.test(t[h]||"")&&h<t.length)h++}if(t[h]!=="(")continue;let v=gi(t,h,"(",")");if(v>=0)return{type:c,args:yc(e.slice(h+1,v))}}return null}var mi=`
235
+ type __StxCtor<T> = T extends StringConstructor ? string : T extends NumberConstructor ? number : T extends BooleanConstructor ? boolean : T extends ArrayConstructor ? unknown[] : T extends ObjectConstructor ? object : T extends readonly unknown[] ? __StxCtor<T[number]> : T extends abstract new (...args: any[]) => infer V ? V : unknown;
236
+ type __StxWiden<T> = T extends string ? string : T extends number ? number : T extends boolean ? boolean : T;
237
+ type __StxOption<T> = T extends { type: infer C } ? __StxCtor<C> : T extends { default: infer D } ? D extends (...args: any[]) => infer V ? V : __StxWiden<D> : __StxCtor<T>;
238
+ type __StxRequired<O> = { [K in keyof O]-?: O[K] extends { required: true } ? K : never }[keyof O];
239
+ type __StxDefaulted<O> = { [K in keyof O]-?: O[K] extends { default: unknown } ? K : never }[keyof O];
240
+ type __StxOptions<O> = { [K in Exclude<__StxRequired<O>, __StxDefaulted<O>>]: __StxOption<O[K]> } & { [K in Exclude<keyof O, Exclude<__StxRequired<O>, __StxDefaulted<O>>>]?: __StxOption<O[K]> };
241
+ type __StxDefaults<P, K> = Omit<P, Extract<keyof P, K>> & Partial<Pick<P, Extract<keyof P, K>>>;
242
+ `;function hi(e,s){let t=[],i={defineProps:["defineProps"],defineEmits:["defineEmits"],withDefaults:["withDefaults"]},a=o(e),h=e.replace(/\bimport\s+(?:type\s+)?(\{[^}]*\}|\*\s+as\s+[\w$]+|[\w$]+)\s+from\s*(['"])([^'"]+)\2\s*;?/g,(P,M,I,N,Z)=>{if(a.slice(Z,Z+6)!=="import")return P;if(N.endsWith(".stx"))return"";let U=`${s}Import${t.length}`;if(t.push(`import * as ${U} from ${JSON.stringify(N)};`),M.startsWith("*"))return`import ${M.replace(/^\*\s+as\s+/,"")} = ${U};`;if(!M.startsWith("{"))return`import ${M} = ${U}.default;`;return M.slice(1,-1).split(",").map((V)=>{let[X,Y=X]=V.trim().replace(/^type\s+/,"").split(/\s+as\s+/);if(!X)return"";if(/^(?:stx|@stacksjs\/stx)(?:\/|$)/.test(N)&&X in i)i[X].push(Y);return`import ${Y} = ${U}.${X};`}).join(`
243
+ `)}),c=Ps(e,i.defineProps),v=Ps(e,i.defineEmits),E=Ps(e,i.withDefaults);if(!c&&!v)return{declarations:"",props:null,events:null};let R=[],C=null,O=null;if(c){R.push(`const __options = (${c.args[0]||"{}"}) as const;`),R.push(`const __defaults = (${E?.args[1]||"{}"});`);let P=c.type||"__StxOptions<typeof __options>";R.push(`export type __StxProps = __StxDefaults<${P}, keyof typeof __defaults | __StxDefaulted<typeof __options>>;`),C=`${s}.__StxProps`}if(v)R.push(`const __events = (${v.args[0]||"[]"}) as const;`),R.push(`export type __StxEvents = ${v.type||"Record<(typeof __events)[number], any[]>"};`),O=`${s}.__StxEvents`;return{declarations:`${t.join(`
244
+ `)}
245
+ namespace ${s} {
246
+ ${h}
247
+ ${R.join(`
248
+ `)}
249
+ }`,props:C,events:O}}var ir=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","component","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","path","circle","rect","line","polygon","polyline","ellipse","text","tspan","textPath","g","defs","use","symbol","image","clipPath","mask","pattern","marker","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","foreignObject","animate","animateMotion","animateTransform","set","mpath","desc","metadata","switch","view"]);function ar(e){if(e.includes("-")||e==="component")return!1;if(/^[A-Z]/.test(e))return!/[a-z]/.test(e)&&[...ir].some((s)=>s.toLowerCase()===e.toLowerCase());return ir.has(e)||/[A-Z]/.test(e)}function*_c(e){let s=/<([A-Za-z][\w.-]*)(?=[\s/>])/g,t;while(t=s.exec(e)){let i=s.lastIndex,a=[];while(i<e.length){while(/\s/.test(e[i]||""))i++;if(e[i]===">"||e.slice(i,i+2)==="/>"){i+=e[i]===">"?1:2;break}let h=/^[^\s=/>]+/.exec(e.slice(i))?.[0];if(!h){i++;continue}let c=i;i+=h.length;while(/\s/.test(e[i]||""))i++;if(e[i]!=="="){a.push({name:h,value:!0,offset:c,braced:!1});continue}i++;while(/\s/.test(e[i]||""))i++;let v=e[i],E=v==="{",R=v==='"'||v==="'";if(R||E)i++;let C=i;if(E){let O=o(e.slice(i)),P=1,M=0;for(;M<O.length;M++){if(O[M]==="{")P++;if(O[M]==="}"&&--P===0)break}i+=M}else if(R)while(i<e.length&&e[i]!==v)i++;else while(i<e.length&&!/[\s/>]/.test(e[i]))i++;if(a.push({name:h,value:e.slice(C,i),offset:C,braced:E}),R||E)i++}s.lastIndex=i,yield{name:t[1],offset:t.index,attributes:a}}}function xi(e,s,t){let i=[],a=[mi,"type __StxAssignedValue<T> = T extends { readonly _isSignal: true } | { readonly _isDerived: true } ? T extends () => infer V ? V : T : T;","type __StxProp<P, K> = K extends keyof P ? P[K] : unknown;",'type __StxEvent<E, K> = K extends keyof E ? E[K] extends readonly unknown[] ? Exclude<E[K]["length"], 0 | 1> extends never ? E[K][0] : E[K] : E[K] : any;'],h=new Map,c=new Map,v=new Map,E=t.scriptCode(e,t.filePath),R=o(E);for(let I of E.matchAll(/\bimport\s+(\{[^}]+\}|[\w$]+)\s+from\s*['"]([^'"]+)['"]/g)){if(R.slice(I.index,I.index+6)!=="import")continue;let N=I[2],Z=Jt.isAbsolute(N)||N.startsWith(".")?Jt.resolve(Jt.dirname(t.filePath),N):os(N,Jt.dirname(t.filePath));if(!Z)continue;let U=Z.endsWith(".stx")?Z:Ms.existsSync(`${Z}.stx`)?`${Z}.stx`:void 0,V=U?null:ss(Z,!1),X=I[1].startsWith("{")?I[1].slice(1,-1).split(","):[I[1]];for(let Y of X){let[Q,se=Q]=Y.trim().split(/\s+as\s+/),pe=U||V?.get(Q)||V?.get(Q.toLowerCase());if(pe)v.set(se,pe),v.set(se.toLowerCase(),pe),v.set(se.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),pe)}}for(let I of s.matchAll(/@import\s*\(([^)]+)\)/g))for(let N of I[1].matchAll(/['"]([^'"]+)['"]/g)){let Z=is(N[1],t.filePath,t).find((U)=>Ms.statSync(U,{throwIfNoEntry:!1})?.isFile());if(Z)v.set(Jt.basename(N[1]).replace(/\.stx$/,""),Z)}let C={__importedComponents:v},O=new Map,P=(I,N,Z)=>{let U=e.slice(0,I);return{code:N,offset:I,attribute:Z,anchor:!0,kind:"directive",line:U.split(`
250
+ `).length,column:I-U.lastIndexOf(`
251
+ `)}},M=(I,N,Z)=>i.push({expression:I,statement:{text:N+I.code+Z,prefixLength:N.length}});for(let I of _c(s)){if(ar(I.name)||I.name==="component")continue;let N=fr(I.name,t.filePath,t,C);if(!N)continue;let Z=O.get(N);if(!Z){let V;try{V=t.readComponent?t.readComponent(N):Ms.readFileSync(N,"utf8")}catch{continue}if(V===void 0)continue;c.set(N,V),Z=hi(t.scriptCode(V,N),`__StxComponent${O.size}`),O.set(N,Z),a.push(Z.declarations)}let U=[];for(let V of I.attributes){let{name:X,offset:Y}=V,Q=V.value===!0?"true":V.value;if(X.startsWith("@")||X.startsWith("v-on:")){if(Z.events&&V.value!==!0)h.set(Y,`__StxEvent<${Z.events}, ${JSON.stringify(X.replace(/^@|^v-on:/,"").split(".")[0])}>`);continue}let se=/^v-model(?::([\w-]+))?(?:\.[\w-]+)*$/.exec(X);if(X.startsWith("v-")&&!X.startsWith("v-bind:")&&!se)continue;if(/^(?:x-|:)(?:if|for|show|key|else)(?:$|[.:-])/.test(X))continue;let pe=(se?se[1]||"modelValue":X.replace(/^:|^v-bind:/,"")).replace(/-([a-z])/g,(Be,Ce)=>Ce.toUpperCase());if(U.push(pe),!Z.props)continue;let Ee=X.startsWith(":")||X.startsWith("v-bind:")||!!se||V.braced?Q:V.value!==!0?JSON.stringify(Q):"true";M(P(Y,Ee,X),";void ((",`) satisfies __StxProp<${Z.props}, ${JSON.stringify(pe)}>);`)}if(Z.props){let V=[...new Set(U)].map((Y)=>`${JSON.stringify(Y)}: undefined as any`).join(", "),X=P(I.offset,`<${I.name}>`);i.push({expression:X,statement:{text:`;void ({ ${V} } satisfies ${Z.props} & Record<string, unknown>);`,prefixLength:0}})}}return{declarations:O.size?a.join(`
252
+ `):"",checks:i,events:h,dependencies:c}}var bi=/<script(\s[^>]*)?>([\s\S]*?)<\/script>/gi;function wc(e){let s=(t)=>t.replace(/[^\n]/g," ");return e.replace(/<!--[\s\S]*?-->/g,s).replace(/\{\{--[\s\S]*?--\}\}/g,s)}function $t(e){let s=[],t=wc(e);bi.lastIndex=0;let i;while((i=bi.exec(t))!==null){let a=(i[1]||"").trim(),h=(i[0].match(/^<script(?:\s[^>]*)?>/i)?.[0]??"<script>").length,c=(i[0].match(/<\/script\s*>$/i)?.[0]??"</script>").length,v=i.index+h,E=i.index+i[0].length-c,R=e.slice(v,E);if(/\bsrc\s*=/.test(a))continue;let C=a.match(/\btype\s*=\s*["']([^"']+)["']/i);if(C&&!/^(?:module|text\/(?:javascript|typescript))$/i.test(C[1]))continue;let O=/\bserver\b/.test(a)?"server":/\bclient\b/.test(a)?"client":"plain",P=Gt(e,v);s.push({kind:O,code:R,startLine:P,startColumn:Yt(e,v),offset:v,attrs:a})}return s}function Gt(e,s){let t=1;for(let i=0;i<s&&i<e.length;i++)if(e.charCodeAt(i)===10)t++;return t}function Yt(e,s){let t=e.lastIndexOf(`
253
+ `,s-1)+1;return s-t+1}function Bn(e){let s=e.split(""),t=(a,h)=>{for(let c=a;c<h&&c<s.length;c++)if(s[c]!==`
254
+ `)s[c]=" "},i=[/<script(?:\s[^>]*)?>[\s\S]*?<\/script>/gi,/<style(?:\s[^>]*)?>[\s\S]*?<\/style>/gi,/<!--[\s\S]*?-->/g,/\{\{--[\s\S]*?--\}\}/g,/@verbatim\b[\s\S]*?@endverbatim\b/g];for(let a of i){a.lastIndex=0;let h;while((h=a.exec(e))!==null)t(h.index,h.index+h[0].length)}return s.join("")}function Sc(e){let s=0,t="";for(let i=0;i<e.length;i++){let a=e[i];if(t){if(a==="\\"){i++;continue}if(a===t)t="";continue}if(a==='"'||a==="'"||a==="`"){t=a;continue}if(a==="("||a==="["||a==="{"){s++;continue}if(a===")"||a==="]"||a==="}"){s--;continue}if(a==="|"&&s===0){if(e[i+1]==="|"){i++;continue}if(e[i-1]==="|")continue;return e.slice(0,i)}}return e}var Ri=new Set([":for","x-for","v-for"]),zn=/(?:^|\s)((?::|x-|v-|@)[\w.:-]+)\s*=\s*(["'])([\s\S]*?)\2/g,Ds="__stx_interpolated",yi="__StxElement",Ci="__StxTemplateValue",$c=`type ${Ci}<T> = T extends { readonly _isSignal: true } | { readonly _isDerived: true } ? (T extends () => infer V ? T & V : T) : T`;function _i(e){return e.replace(/\{\{[\s\S]*?\}\}/g,Ds).replace(/\{!![\s\S]*?!!\}/g,Ds)}function Co(e){return e.replace(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/g,(s)=>{let t=s.split(`
255
+ `).length-1,i=s.length-t;return`0${" ".repeat(Math.max(0,i-1))}${`
256
+ `.repeat(t)}`})}var vc=["foreach","endforeach","forelse","endforelse","for","endfor","while","endwhile","empty","if","elseif","else","endif","unless","endunless","isset","endisset","switch","case","default","endswitch","auth","endauth","guest","endguest","env","endenv","once","endonce","break","continue"],Ec=new RegExp(String.raw`^[ \t]*@(?:${vc.join("|")})\b[ \t]*(\([^\n)]*\))?[ \t]*$`,"gm");function Eo(e){return e.replace(Ec,(s)=>s.replace(/[^\n]/g," "))}var wi=new Set(["x-cloak","x-ref","x-transition","x-teleport","v-slot","x-hydrate",":key","x-tooltip","x-tooltip-position"]);function Fl(e){let s=Bn(e),t=[],i=/(@?)\{\{([\s\S]*?)\}\}|(@?)\{!!([\s\S]*?)!!\}/g,a;while((a=i.exec(s))!==null){if(a[1]||a[3])continue;let v=a[2]??a[4]??"",E=a[2]!==void 0?2:3,R=Sc(v);if(!R.trim())continue;let C=a.index+E+(R.length-R.trimStart().length);t.push({code:R.trim(),line:Gt(s,C),column:Yt(s,C),offset:C,kind:"interpolation"})}let h=/@(if|elseif|else\s+if|unless)\b\s*\(/g;while((a=h.exec(s))!==null){let c=a.index+a[0].length-1,v=0,E=c;for(;E<s.length;E++){let P=s[E];if(P==="(")v++;else if(P===")"){if(v--,v===0)break}}if(v!==0)continue;let R=s.slice(c+1,E),C=R.trim();if(h.lastIndex=E+1,!C)continue;let O=c+1+(R.length-R.trimStart().length);t.push({code:C,line:Gt(s,O),column:Yt(s,O),offset:a.index,kind:"condition"})}zn.lastIndex=0;while((a=zn.exec(s))!==null){let c=a[1],v=a[3]??"",E=c.replace(/\..*$/,"").replace(/^([^:].*?):.*$/,"$1");if(wi.has(E)||wi.has(c))continue;if(!v.trim())continue;let R=a.index+a[0].indexOf(a[2],a[0].indexOf(c)+c.length)+1;if(Ri.has(E)){let O=v.match(/\s+(?:in|of)\s+/);if(!O||O.index===void 0)continue;let P=v.slice(O.index+O[0].length),M=O.index+O[0].length+(P.length-P.trimStart().length);t.push({code:_i(P.trim()),line:Gt(s,R+M),column:Yt(s,R+M),offset:R+M,kind:"directive",attribute:E});continue}let C=v.length-v.trimStart().length;t.push({code:_i(v.trim()),line:Gt(s,R+C),column:Yt(s,R+C),offset:R+C,kind:"directive",attribute:E})}return t.sort((c,v)=>c.line-v.line||c.column-v.column),t}var kc=2000;function Rc(e,s){let t=0,i=Math.min(e.length,s+kc);for(let a=s;a<i;a++){let h=e[a];if(h==="(")t++;else if(h===")"){if(t--,t===0)return e.slice(s+1,a)}}return null}function Cc(e){let s=new Map,t=(v,E)=>{let R=v.split(/[,[\]{}()\s]+/).filter(Boolean);for(let C of R){let O=C.replace(/^\.\.\./,"").trim();if(!/^\$?[A-Z_$][\w$]*$/i.test(O))continue;let P=R.length===1?E:void 0,M=s.get(O);if(!M)s.set(O,{name:O,iterable:P});else if(M.iterable!==P)M.iterable=void 0}},i=/^\$?[A-Z_$][\w$]*$/i,a=(v)=>{let E=v.trim();return i.test(E)?E:void 0};for(let v of e.matchAll(/@for(?:each|else)\s*\(/g)){let E=Rc(e,v.index+v[0].length-1);if(E===null)continue;let R=Et(E);if(!R)continue;t(R.itemVar.replace(/=>/g," "),a(R.arrayExpr))}for(let v of e.matchAll(/@for\s*\(\s*(?:(?:let|const|var)\s+)?([\w$]+|\[[^\]]*\]|\{[^}]*\})\s+(of|in)\s+([^)]*)/g))t(v[1],v[2]==="of"?a(v[3]):void 0);for(let v of e.matchAll(/@for\s*\(\s*(?:let|const|var)\s+([\w$]+)\s*[=;]/g))t(v[1]);let h=Bn(e);zn.lastIndex=0;let c;while((c=zn.exec(h))!==null){let v=c[1].replace(/\..*$/,"");if(!Ri.has(v))continue;let E=c[3].match(/\s+(?:in|of)\s+/);if(!E||E.index===void 0)continue;t(c[3].slice(0,E.index),a(c[3].slice(E.index+E[0].length)))}for(let v of e.matchAll(/@(?:php|js|ts)\b([\s\S]*?)@end(?:php|js|ts)\b/g))for(let E of v[1].matchAll(/\b(?:const|let|var|function|class)\s+([\w$]+)/g))t(E[1]);return[...s.values()].sort((v,E)=>v.name.localeCompare(E.name))}function Ae(e){let s=new Set;for(let t of e.matchAll(/^\s*(?:export\s+)?(?:const|let|var)\s+([\w$]+)/gm))s.add(t[1]);for(let t of e.matchAll(/^\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*([\w$]+)/gm))s.add(t[1]);for(let t of e.matchAll(/^\s*(?:export\s+)?class\s+([\w$]+)/gm))s.add(t[1]);for(let t of e.matchAll(/^\s*(?:export\s+)?(?:const|let|var)\s*[[{]([^\]}]*)[\]}]/gm))for(let i of t[1].split(",")){let a=i.split(":").pop().split("=")[0].replace(/^\.\.\./,"").trim();if(/^[A-Z_$][\w$]*$/i.test(a))s.add(a)}return[...s].sort()}var js=["params","query","cookies","host","ip","setResponseStatus","setResponseHeader","notFound","request","url","definePageMeta","defineClientPayload","defineStore","props","$props"],Tc={$bool:"declare function $bool(value: unknown, fallback?: boolean): boolean",$num:"declare function $num(value: unknown, fallback?: number): number",$uid:"declare var $uid: string"};function Ra(e=new Set){return[...js.filter((s)=>!e.has(s)).map((s)=>`declare var ${s}: any`),...Object.entries(Tc).filter(([s])=>!e.has(s)).map(([,s])=>s)].join(`
257
+ `)}function Aa(e){return new Set([...e.matchAll(/^declare (?:function|const|let|var)\s+([A-Za-z_$][\w$]*)/gm)].map((s)=>s[1]))}function Ti(e){let s=/\bdefineClientPayload\s*\(\s*\{([\s\S]*?)\}\s*\)/g,t,i=!1,a=new Set,h=o(e);while((t=s.exec(h))!==null){i=!0;for(let c of Ac(t[1])){let v=c.split(":")[0].trim();if(/^[A-Za-z_$][\w$]*$/.test(v))a.add(v)}}return i?[...a]:null}function Ac(e){let s=[],t=0,i="";for(let a of e){if(a===","&&t===0){s.push(i),i="";continue}if(a==="("||a==="["||a==="{")t++;else if(a===")"||a==="]"||a==="}")t--;i+=a}return s.push(i),s.filter((a)=>a.trim().length>0)}function Ic(e){let s=/^[ \t]*import\b[\s\S]*?(?:from\s*['"][^'"]*['"]|['"][^'"]*['"])[ \t]*;?[ \t]*$/gm,t=[],i=e.replace(s,(a)=>(t.push(a.trim()),a.split(`
258
+ `).map(()=>"").join(`
259
+ `)));return{imports:t.join(`
260
+ `),body:i}}function Ai(e){let s=o(e),t=Array(s.length),i=0;for(let v=0;v<s.length;v++){let E=s[v];if(E==="}"||E===")"||E==="]")i=Math.max(0,i-1);if(t[v]=i,E==="{"||E==="("||E==="[")i++}let a=[],h=/^[ \t]*(?:export[ \t]+)?(interface|type)[ \t]+([A-Za-z_$][\w$]*)/gm,c;while((c=h.exec(s))!==null){if(t[c.index]!==0)continue;let v=c[1],E=c[2],R;if(v==="interface"){let C=s.indexOf("{",c.index);if(C===-1)continue;let O=0;R=-1;for(let P=C;P<s.length;P++)if(s[P]==="{")O++;else if(s[P]==="}"&&--O===0){R=P+1;break}if(R===-1)continue}else{let C=0;R=s.length;for(let O=s.indexOf("=",c.index)+1;O<s.length;O++){let P=s[O];if(P==="{"||P==="["||P==="("||P==="<")C++;else if(P==="}"||P==="]"||P===")"||P===">")C--;else if(C<=0&&(P===";"||P===`
261
+ `&&!/[=|&,<([{]\s*$/.test(s.slice(Math.max(0,O-40),O)))){R=P===";"?O+1:O;break}}}a.push({name:E,text:e.slice(c.index,R).replace(/^[ \t]*export[ \t]+/,"")}),h.lastIndex=R}return a}function Oc(e){return new Set(Ai(e).map((s)=>s.name))}function Pa(e,s=""){let t=Ti(e),i=Oc(s),a=Ai(e).filter((R)=>!i.has(R.name)).map((R)=>R.text);if(!t){let R=Ae(e).filter((C)=>!Ht(s,C));if(R.length===0&&a.length===0)return"";return["",`// ${Pc}`,...a,...R.map((C)=>`declare var ${C}: any`)].join(`
262
+ `)}if(t.length===0)return a.length>0?["",`// ${Si}`,...a].join(`
263
+ `):"";let{imports:h,body:c}=Ic(e),v=c.replace(/^[ \t]*export[ \t]+(?=(?:const|let|var|function|async|class)\b)/gm,""),E=["",`// ${Si}`];if(h)E.push(h);return E.push(...a),E.push(`async function ${$i}() {`,v,` return { ${t.join(", ")} }`,"}",`type ${vi} = Awaited<ReturnType<typeof ${$i}>>`,...t.map((R)=>`declare var ${R}: ${vi}[${JSON.stringify(R)}]`)),E.join(`
264
+ `)}function To(e){let t=o(e).split(""),i=0;for(let a=0;a<t.length;a++){let h=t[a];if(h==="{"||h==="("||h==="["){i++;continue}if(h==="}"||h===")"||h==="]"){i=Math.max(0,i-1);continue}if(i>0&&h!==`
265
+ `)t[a]=" "}return Ae(t.join(""))}function Ia(e,s){if(Ti(e)!==null)return[];let t=To(e),i=rn(s,new Set(t)),a=new Set(x);return t.filter((h)=>{if(a.has(h))return!1;if(Ht(s,h))return!1;return i.has(h)})}var Si="stx: types for the declared client payload (#1868)",Pc="stx: untyped bridge names \u2014 declare a defineClientPayload to check these (#1868)",$i="__stxServerScope",vi="__StxClientPayload";var Ei=["$env","$user","$slot","$slots","$attrs","$props","$page","$route","$loop","loop","$errors","$csrf","props","slot"];var Mc=/^\s*[A-Z_$][\w$]*\s*=[^=]/i;function Dc(e){let s=new Map,t=/!|===|!==|==|!=|&&|\|\||<|>|\btypeof\b|\binstanceof\b|\bin\b/;for(let i of e){let a=o(i),{depths:h,balanced:c}=Qe(a);if(!c)continue;let v=/^([ \t]*(?:export[ \t]+)?const[ \t]+)([A-Za-z_$][\w$]*)[ \t]*(?::[^=\n]+)?=[ \t]*([^\n]+)$/gm;for(let E of a.matchAll(v)){let R=E.index??0;if(h[R+E[1].length]!==0)continue;let C=E[2],O=R+E[0].length-E[3].length,P=i.slice(O,R+E[0].length).trim().replace(/;$/,"").trim(),M=E[3],I=t.test(M)&&!/\bawait\b|=>|\bfunction\b|[{}]/.test(M)&&!/[,+\-*/%&|?:=]$/.test(P)&&Qe(M).balanced;s.set(C,s.has(C)||!I?null:P)}}return new Map([...s].filter((i)=>i[1]!==null))}function Ii(e,s,t=0,i=new Set){if(s.size===0||t>=5)return e;let a=o(e),h="",c=0;for(let v of a.matchAll(/[A-Za-z_$][\w$]*/g)){let E=v.index??0,R=v[0],C=s.get(R);if(!C||i.has(R))continue;let O=a.slice(0,E).trimEnd(),P=a.slice(E+R.length).trimStart();if(O.endsWith(".")||/^:(?!:)/.test(P)&&/[{,]$/.test(O))continue;if(E>0&&/[\w$]/.test(a[E-1]))continue;h+=`${e.slice(c,E)}(${Ii(C,s,t+1,new Set([...i,R]))})`,c=E+R.length}return h+e.slice(c)}function jc(e,s){let t=/@(if|unless|elseif|else|endif|endunless)\b\s*(\()?/g,i=[],a;while((a=t.exec(e))!==null){if(a.index>s)break;let h=a[1];if(a.index===s){if(h==="elseif"){let v=i[i.length-1];if(v?.current)v.seen.push(v.current);if(v)v.current=null}break}if(h==="endif"||h==="endunless"){i.pop();continue}let c="";if(a[2]==="("){let v=0,E=a.index+a[0].length-1,R=E+1;for(;E<e.length;E++){let C=e[E];if(C==="(")v++;else if(C===")"){if(v--,v===0)break}}c=e.slice(R,E).trim(),t.lastIndex=E+1}if(h==="if")i.push({seen:[],current:c});else if(h==="unless")i.push({seen:[],current:`!(${c})`});else if(h==="elseif"||h==="else"){let v=i[i.length-1];if(!v)continue;if(v.current)v.seen.push(v.current);v.current=h==="elseif"?c:null}}return i.flatMap((h)=>[...h.seen.map((c)=>`!(${c})`),...h.current?[h.current]:[]]).filter(Boolean)}function Nc(e){let s=e.code.trim();if(!s)return null;if(e.attribute?.startsWith("@")){if(Mc.test(s))return null;let i=";(($event: any): void => { ";return{text:`${i}${s} });`,prefixLength:i.length}}let t=";void ((";return{text:`${t}${s}));`,prefixLength:t.length}}var Lc=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.{1,2}\/[^'"\n]*)\2/g;function ls(e,s){if(!s)return e;return e.replace(Lc,(t,i,a,h)=>{let c=ki.resolve(s,h).replace(/\\/g,"/");return`${i}${a}${c}${a}`})}function $o(e){return" ".repeat(Math.max(0,(e.startColumn??1)-1))}function Bc(e){let s=new Set,t=o(e);for(let i of t.matchAll(/\bimport\s+(?:type\s+)?([\w$*{}\s,]+?)\s+from\b/g)){let a=i[1],h=/\{([^}]*)\}/.exec(a);for(let R of h?.[1].split(",")??[]){let C=R.trim().replace(/^type\s+/,"").split(/\s+as\s+/).pop()?.trim();if(C&&/^[A-Z_$][\w$]*$/i.test(C))s.add(C)}let c=a.replace(/\{[^}]*\}/,""),v=/\*\s*as\s+([A-Z_$][\w$]*)/i.exec(c);if(v)s.add(v[1]);let E=/^\s*([A-Z_$][\w$]*)/i.exec(c);if(E&&E[1]!=="type")s.add(E[1])}return[...s].sort()}function Oa(e,s={}){let t=$t(e),i=e.split(`
266
+ `),a=Array.from({length:i.length},()=>""),h=new Map,c=s.filePath&&s.templateExpressions!==!1?xi(e,Bn(e),{filePath:s.filePath,componentsDir:s.componentsDir,projectRoot:s.projectRoot,readComponent:s.readComponent,scriptCode:(O,P)=>$t(O).map((M)=>ls(M.code,ki.dirname(P))).join(`
267
+ `)}):void 0,v=new Set,E=[];for(let O of t){let P=Eo(Co(O.code)),M=ls(P,s.originDir??"").split(`
268
+ `);M.forEach((I,N)=>{let Z=O.startLine-1+N;if(Z<a.length)a[Z]=N===0?$o(O)+I:I,v.add(Z)}),E.push(O.startLine-1+M.length-1)}for(let O of E){let P=a[O]?.trim()===""?O:O+1;if(P<a.length&&a[P].trim()===""&&(P===O||!v.has(P)))a[P]=";"}let R=(O,P)=>{for(let[M,I]of O.split(`
269
+ `).entries())if(a.push(I),P)h.set(a.length,M===0?P:{...P,line:P.line+M,column:1,prefixLength:0})};if(s.globals!==!1){R("");let O=new Set([...t.flatMap((N)=>Ae(N.code)),...t.flatMap((N)=>Bc(N.code))]),P=(N)=>{if(!O.has(N))R(`declare var ${N}: any`)};if(s.runtimeGlobals!==!1){if(!O.has("window"))R("declare var window: any");for(let N of x)P(N)}let M=[...new Set([...js,...he,...Ei])].filter((N)=>s.runtimeGlobals!==!1||!x.includes(N));if(s.contextScope==="global"){R("declare global {");for(let N of M)R(` var ${N}: any`);R("}")}else{for(let N of js)P(N);for(let N of he)P(N);for(let N of Ei)P(N)}R(`declare var ${Ds}: any`);let I=new Set(t.flatMap((N)=>Ae(N.code)));R(`type ${yi}<T> = T extends readonly (infer E)[] ? E : T extends Iterable<infer E2> ? E2 : any`);for(let N of Cc(e)){if(I.has(N.name))continue;let Z=N.iterable&&I.has(N.iterable)?`${yi}<typeof ${N.iterable}>`:"any";R(`declare var ${N.name}: ${Z}`)}}if(s.templateExpressions!==!1){if(c?.declarations)for(let P of c.declarations.split(`
270
+ `))R(P);let O=Fl(e).map((P)=>{let M=c?.events.get(P.offset??-1);if(M){P.anchor=!0;let I=P.code.trim(),N=/^([\w$]+)\s*=\s*([^=][\s\S]*)$/.exec(I),Z=N?`void ((${N[2]}) satisfies __StxAssignedValue<typeof ${N[1]}>)`:/^[\w$]+(?:\.[\w$]+)*$/.test(I)?`${I} satisfies (($event: ${M}) => unknown)`:I,U=`;(($event: ${M}): void => { `;return{expression:P,statement:{text:`${U}${Z} });`,prefixLength:U.length}}}return{expression:P,statement:Nc(P)}}).filter((P)=>P.statement!==null);if(O.push(...c?.checks||[]),O.length>0){let P=Bn(e),M=Ln(P),I=Dc(t.map((V)=>V.code)),Z=[...new Set(t.flatMap((V)=>Ae(V.code)))].filter((V)=>/^[A-Z_$][\w$]*$/i.test(V)),U=0;if(Z.length>0){R($c);for(let V of Z)R(`function __StxRead_${V}() { return ${V} }`),R(`type __StxT_${V} = ${Ci}<ReturnType<typeof __StxRead_${V}>>`);R(`;((${Z.map((V)=>`${V}: __StxT_${V}`).join(", ")}) => {`),U=1}for(let{expression:V,statement:X}of O){let Y=" ".repeat(U),Q=V.offset===void 0?[]:M.filter((Ce)=>V.offset>=Ce.start&&V.offset<Ce.end),se=Q.map((Ce)=>`;((${Ce.binding.replace(/[\r\n]/g," ")}: any) => { `).join(""),pe=" });".repeat(Q.length),Se=V.offset===void 0?[]:jc(P,V.offset),Ee=Se.length>0?`${Se.map((Ce)=>`if (${Ii(Ce,I)}) `).join("")}{ `:"",Be=Se.length>0?" }":"";R(Y+se+Ee+X.text+Be+pe,{line:V.line,column:V.column,expression:V,prefixLength:X.prefixLength+Y.length+se.length+Ee.length,guardPrefixLength:Y.length+se.length+Ee.length})}if(U>0)R("});")}}let C=!1;if(s.reference&&a[0]!==void 0&&a[0].trim()==="")a[0]=`/// <reference path=${JSON.stringify(s.reference.replace(/\\/g,"/"))} />`,C=!0;return R("export {}"),{text:a.join(`
271
+ `),lineMap:h,sourceLineCount:i.length,componentDependencies:c?.dependencies,referenced:C}}function Na(e,s){if(!e.expression)return!1;return e.inGuard===!0||s===2774}function Da(e,s,t){let i=e.lineMap.get(s);if(!i)return s<=e.sourceLineCount?{line:s,column:t}:null;let a=i.expression?.anchor?0:Math.max(0,t-1-(i.prefixLength??0));return{line:i.line,column:i.column+a,expression:i.expression,inGuard:t<=(i.guardPrefixLength??0)}}var Ns=y(256),zc=[{pattern:/document\.getElementById\s*\(/g,message:"document.getElementById() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.querySelector\s*\(/g,message:"document.querySelector() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.querySelectorAll\s*\(/g,message:"document.querySelectorAll() is prohibited",suggestion:'Use useRef("name") and access children instead'},{pattern:/document\.getElementsBy\w+\s*\(/g,message:"document.getElementsBy*() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.createElement\s*\(/g,message:"document.createElement() is prohibited",suggestion:"Use template directives or component composition instead"},{pattern:/document\.activeElement(?![A-Za-z])/g,message:"document.activeElement is prohibited",suggestion:"Use useRef() to track focused elements"},{pattern:/document\.title\s*=/g,message:"document.title assignment is prohibited",suggestion:"Use useTitle() from composables"},{pattern:/document\.cookie(?![A-Za-z])/g,message:"document.cookie is prohibited",suggestion:"Use useCookie() from composables"},{pattern:/document\.addEventListener\s*\(/g,message:"document.addEventListener() is prohibited",suggestion:"Use useEventListener() or template @event directives"},{pattern:/window\.location(?![A-Za-z])/g,message:"window.location is prohibited",suggestion:"Use navigate() or useRoute()"},{pattern:/window\.history(?![A-Za-z])/g,message:"window.history is prohibited",suggestion:"Use navigate(), goBack(), goForward()"},{pattern:/window\.addEventListener\s*\(/g,message:"window.addEventListener() is prohibited",suggestion:"Use useEventListener() or @click directives"},{pattern:/(?:\bwindow\.)?localStorage(?![A-Za-z])/g,message:"window.localStorage is prohibited",suggestion:"Use useLocalStorage() from composables \u2014 or, where this must run before first paint and the runtime does not exist yet, the colorMode config for a light/dark theme, or @appearanceBootstrap when there is a second appearance axis"},{pattern:/window\.sessionStorage(?![A-Za-z])/g,message:"window.sessionStorage is prohibited",suggestion:"Use useSessionStorage() from composables"},{pattern:/window\.scrollTo\s*\(/g,message:"window.scrollTo() is prohibited",suggestion:"Use useScroll().scrollTo() from composables"},{pattern:/window\.alert\s*\(/g,message:"window.alert() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/window\.confirm\s*\(/g,message:"window.confirm() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/window\.prompt\s*\(/g,message:"window.prompt() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/(?<!\w)setTimeout\s*\(/g,message:"setTimeout() is prohibited",suggestion:"Use useTimeout() or useDebounce() from composables"},{pattern:/(?<!\w)setInterval\s*\(/g,message:"setInterval() is prohibited",suggestion:"Use useInterval() from composables"},{pattern:/(?<!\w)clearTimeout\s*\(/g,message:"clearTimeout() is prohibited",suggestion:"Use useTimeout().stop() or useDebounce().cancel()"},{pattern:/(?<!\w)clearInterval\s*\(/g,message:"clearInterval() is prohibited",suggestion:"Use useInterval().pause()"},{pattern:/(?<!\w)location\.href\s*=/g,message:"location.href assignment is prohibited",suggestion:"Use navigate() instead"},{pattern:/(?<!\w)location\.assign\s*\(/g,message:"location.assign() is prohibited",suggestion:"Use navigate() instead"},{pattern:/(?<!\w)location\.replace\s*\(/g,message:"location.replace() is prohibited",suggestion:"Use navigate() instead"}],Oi=/(?:\/\/|\/\*|\{\{--)\s*stx-strict-ignore(-next-line)?([^\n*}]*)/g;function Wc(e){let s=Array.from(e,(a)=>a===`
272
+ `?`
273
+ `:" "),t=0,i="";while(t<e.length){let a=e[t],h=e[t+1];if(i){if(a==="\\"){t+=2;continue}if(a===i)i="";t++;continue}if(a==='"'||a==="'"||a==="`"){i=a,t++;continue}if(a==="/"&&h==="/"){while(t<e.length&&e[t]!==`
274
+ `)s[t]=e[t],t++;continue}if(a==="/"&&h==="*"){let c=e.indexOf("*/",t+2),v=c===-1?e.length:c+2;for(;t<v;t++)s[t]=e[t];continue}if(a==="{"&&h==="{"&&e.slice(t,t+4)==="{{--"){let c=e.indexOf("--}}",t+4),v=c===-1?e.length:c+4;for(;t<v;t++)s[t]=e[t];continue}t++}return s.join("")}function Fc(e){let s=new Map,t=Wc(e).split(`
275
+ `),i=e.split(`
276
+ `);return t.forEach((a,h)=>{Oi.lastIndex=0;for(let c of a.matchAll(Oi)){let v=c[1]==="-next-line",E=(i[h]??"").slice(0,c.index).trim(),R=v||E===""?h+2:h+1,O=(c[2]??"").split("--")[0].split(/[\s,]+/).filter(Boolean),P=O.filter((I)=>/\w/.test(I));if(O.length>0&&P.length===0)continue;let M=s.get(R);if(M&&M.size===0)continue;if(P.length===0){s.set(R,new Set);continue}if(M)P.forEach((I)=>M.add(I));else s.set(R,new Set(P))}}),s}function Vc(e,s,t){let i=e.get(s);if(!i)return!1;if(i.size===0)return!0;return[...i].some((a)=>t.includes(a))}function $e(e,s,t,i){let a=typeof t==="boolean"?{enabled:t,failOnViolation:t}:t??{enabled:!1};if(!a.enabled)return;let h=b(e,s,i,JSON.stringify(a)),c=Ns.get(h);if(c!==void 0){if(c&&a.failOnViolation)throw new z(c,i??s);return}let v=a.allowPatterns??[],E=Fc(e),R=[],C=o(e.replace(/\{\{--[\s\S]*?--\}\}/g,(I)=>I.replace(/[^\n]/g," ")));for(let{pattern:I,message:N,suggestion:Z}of zc){if(v.some((V)=>/\w/.test(V)&&N.includes(V)))continue;I.lastIndex=0;let U=C.match(I);if(U&&U.length>0){let V=C.split(`
277
+ `),X=e.split(`
278
+ `),Y=[];if(V.forEach((Se,Ee)=>{if(I.lastIndex=0,I.test(Se)&&!Vc(E,Ee+1,N))Y.push(Ee+1)}),Y.length===0&&V.some((Se)=>(I.lastIndex=0,I.test(Se))))continue;let Q=Y.length>0?` (script line${Y.length>1?"s":""} ${Y.join(", ")})`:"",se=Y.slice(0,3).map((Se)=>` ${Se} | ${(X[Se-1]??"").trim().slice(0,100)}`).join(`
279
+ `),pe=se?`
280
+ ${se}`:"";R.push(` \u2717 ${N}${Q}
281
+ \u2192 ${Z}${pe}`)}}if(R.length===0){Ns.set(h,"");return}let O=(I)=>{let N=`${process.cwd()}/`;return I.startsWith(N)?I.slice(N.length):I},M=`[STX] DOM API violation in ${i&&i!==s?`${O(i)} (composed into ${O(s)})`:O(s)}:
282
+ ${R.join(`
283
+ `)}
284
+ Tip: prefer useRef(), navigate(), and composables for component code`;if(Ns.set(h,M),console.warn(M),a.failOnViolation)throw new z(M,i??s)}var Uc=[{open:"@if",close:"@endif",name:"if"},{open:"@unless",close:"@endunless",name:"unless"},{open:"@foreach",close:"@endforeach",name:"foreach"},{open:"@for",close:"@endfor",name:"for"},{open:"@while",close:"@endwhile",name:"while"},{open:"@forelse",close:"@endforelse",name:"forelse"},{open:"@switch",close:"@endswitch",name:"switch"},{open:"@isset",close:"@endisset",name:"isset"},{open:"@empty",close:"@endempty",name:"empty"},{open:"@auth",close:"@endauth",name:"auth"},{open:"@guest",close:"@endguest",name:"guest"},{open:"@can",close:"@endcan",name:"can"},{open:"@cannot",close:"@endcannot",name:"cannot"},{open:"@section",close:"@endsection",name:"section",altClose:"@show"},{open:"@push",close:"@endpush",name:"push"},{open:"@prepend",close:"@endprepend",name:"prepend"},{open:"@once",close:"@endonce",name:"once"},{open:"@markdown",close:"@endmarkdown",name:"markdown"},{open:"@component",close:"@endcomponent",name:"component"}],Hc=[{pattern:/@if\s*[^(]/,message:"@if directive missing parentheses",suggestion:"Use @if(condition)"},{pattern:/@foreach\s*[^(]/,message:"@foreach directive missing parentheses",suggestion:"Use @foreach(items as item)"},{pattern:/@foreach\([^)]*\)\s*[^@\n<]/,message:"@foreach may have content on same line",suggestion:"Put content on new line after @foreach()"},{pattern:/@include\s*[^(]/,message:"@include directive missing parentheses",suggestion:"Use @include('partial-name')"},{pattern:/@extends\s*[^(]/,message:"@extends directive missing parentheses",suggestion:"Use @extends('layout-name') or @layout('layout-name')"},{pattern:/@layout\s*[^(]/,message:"@layout directive missing parentheses",suggestion:"Use @layout('layout-name')"}],Kc=[{pattern:/\{\{\s*constructor\s*\}\}/,message:"Attempting to access constructor property"},{pattern:/\{\{\s*__proto__\s*\}\}/,message:"Attempting to access __proto__ property"},{pattern:/\{\{\s*eval\s*\(/,message:"Attempting to use eval in expression"}];function Xl(e){let s=[],t=[];return Zc(e,s),qc(e,s,t),Xc(e,t),Jc(e,s),{valid:s.length===0,errors:s,warnings:t}}function Zc(e,s){let t=(e.match(/\{\{/g)||[]).length,i=(e.match(/\}\}/g)||[]).length;if(t!==i)s.push({type:"expression",message:`Unclosed expression brackets: found ${t} opening '{{' and ${i} closing '}}'`,suggestion:"Ensure every {{ has a matching }}"})}function qc(e,s,t){for(let i of Uc){let a=new RegExp(`${i.open}(?:\\s|\\()`,"g"),h=new RegExp(i.close,"g"),c=(e.match(a)||[]).length,v=(e.match(h)||[]).length;if(i.altClose){let E=new RegExp(i.altClose,"g");v+=(e.match(E)||[]).length}if(c>v)s.push({type:"directive",message:`Unclosed @${i.name} directive: found ${c} opening and ${v} closing`,suggestion:`Add ${c-v} missing ${i.close} tag(s)`});else if(v>c)t.push({type:"directive",message:`Extra ${i.close} found: ${v-c} more closing than opening`,suggestion:`Check for orphaned ${i.close} tags`})}}function Xc(e,s){for(let t of Hc)if(t.pattern.test(e))s.push({type:"syntax",message:t.message,suggestion:t.suggestion})}function Jc(e,s){for(let t of Kc)if(t.pattern.test(e))s.push({type:"expression",message:`Security warning: ${t.message}`,suggestion:"Remove dangerous code from template expressions"})}function Jl(e,s){let t=e.slice(0,s).split(`
285
+ `);return{line:t.length,column:t[t.length-1].length+1}}function Yl(e,s,t){let i=[];switch(e){case"if":case"elseif":case"unless":if(t.length===0)i.push({type:"syntax",message:`@${e} requires a condition`,suggestion:`Use @${e}(condition)`});break;case"foreach":if(t.length===0||!t[0].includes(" as "))i.push({type:"syntax",message:'@foreach requires "items as item" syntax',suggestion:"Use @foreach(items as item) or @foreach(items as key => value)"});break;case"for":if(t.length===0)i.push({type:"syntax",message:"@for requires loop parameters",suggestion:"Use @for(let i = 0; i < 10; i++)"});break;case"switch":if(t.length===0)i.push({type:"syntax",message:"@switch requires an expression",suggestion:"Use @switch(expression)"});break;case"case":if(t.length===0)i.push({type:"syntax",message:"@case requires a value",suggestion:"Use @case(value)"});break;case"include":case"extends":case"component":if(t.length===0)i.push({type:"syntax",message:`@${e} requires a path`,suggestion:`Use @${e}('path/to/template')`});break}return i}function Zl(e){return/@[a-z]+/i.test(e)||/\{\{/.test(e)}function Ql(e){let s=e.matchAll(/@([a-z]+)/gi),t=new Set;for(let i of s){let a=i[1].toLowerCase();if(!a.startsWith("end"))t.add(a)}return Array.from(t)}var Qt=new B(500),Fn=new B(1000),zs=new B(2000),Ws=new B(500),Bi=33554432,Fs=Bi;function Gc(e){let s=e.componentRenderCacheBytes;if(typeof s!=="number"||s<0||s===Fs)return;Fs=s,Vn.setMaxBytes(s)}var Vn=new B(2000,{maxBytes:Bi,sizeOf:(e)=>e.output.length});function Yc(e){let s=new WeakSet;try{let t=(i)=>{if(i===void 0)return{__stxType:"undefined"};if(typeof i==="bigint")return{__stxType:"bigint",value:i.toString()};if(typeof i==="function"||typeof i==="symbol")throw TypeError("Non-serializable component input");if(i===null||typeof i!=="object")return i;if(s.has(i))throw TypeError("Circular component input");s.add(i);try{if(i instanceof Date)return{__stxType:"date",value:i.toISOString()};if(Array.isArray(i))return i.map(t);let a=Object.getPrototypeOf(i);if(a!==Object.prototype&&a!==null)throw TypeError("Non-plain component input");let h={};for(let c of Object.keys(i).sort())h[c]=t(i[c]);return h}finally{s.delete(i)}};return JSON.stringify(t(e))}catch{return null}}function Qc(e){let s={};for(let[t,i]of Object.entries(e))if(!t.startsWith("__")||t==="__stxServeContext")s[t]=i;return s}function Ls(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ms(e){let s=process.cwd(),t=`${s}\x00${e}`,i=Pi.get(t);if(i===void 0)i=Bun.hash(zi(e,s).split(oe.sep).join("/")).toString(36).slice(0,6),Pi.set(t,i);return i}var Pi=new Map;function zi(e,s){if(!oe.isAbsolute(e))return e;let t=(i)=>{try{return Us.realpathSync(i)}catch{return i}};return oe.relative(t(s),t(e))}function eu(e){return/\bjs\b/.test(e)||/\blang\s*=\s*["']?(js|javascript)["']?/i.test(e)}function Oe(e){return!eu(e)}var Wn=new Map;function G(e){let s;try{s=JSON.stringify(e)}catch{return new Bun.Transpiler(e)}let t=Wn.get(s);if(t)return t;if(Wn.size>=16)Wn.clear();let i=new Bun.Transpiler(e);return Wn.set(s,i),i}var Mi=new WeakMap,el=256;function Ne(e){try{let s=G({loader:"ts",target:"browser",define:S()}),t=Mi.get(s);if(!t)t=new Map,Mi.set(s,t);let i=t.get(e);if(i!==void 0)return i;let a=e.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");a=a.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");let h=[];a=a.replace(/\{!![\s\S]*?!!\}/g,(v)=>{let E=h.length;return h.push(v),`"__STX_EXPR_${E}__"`}),a=a.replace(/\{\{\{[\s\S]*?\}\}\}/g,(v)=>{let E=h.length;return h.push(v),`"__STX_EXPR_${E}__"`}),a=a.replace(/\{\{[\s\S]*?\}\}/g,(v)=>{let E=h.length;return h.push(v),`"__STX_EXPR_${E}__"`});let c=s.transformSync(a);for(let v=0;v<h.length;v++)c=c.replace(`"__STX_EXPR_${v}__"`,h[v]),c=c.replace(`'__STX_EXPR_${v}__'`,h[v]);if(t.size>=el){let v=t.keys().next();if(!v.done)t.delete(v.value)}return t.set(e,c),c}catch(s){if(process.env.STX_DEBUG_TS)console.warn("[STX] TypeScript transpilation error:",s);return e}}function tl(e){let s=[],t=new Set,i=0,a=0,h=e.length,c=(C)=>{a++;while(a<h){if(e[a]==="\\"){a+=2;continue}if(e[a]===C){a++;return}a++}},v=()=>{a++;while(a<h){if(e[a]==="\\"){a+=2;continue}if(e[a]==="`"){a++;return}if(e[a]==="$"&&e[a+1]==="{"){a+=2;let C=1;while(a<h&&C>0)if(e[a]==="{")C++,a++;else if(e[a]==="}")C--,a++;else if(e[a]==="'"||e[a]==='"')c(e[a]);else if(e[a]==="`")v();else a++;continue}a++}},E=()=>{if(e[a]==="/"&&e[a+1]==="/"){while(a<h&&e[a]!==`
286
+ `)a++;return!0}if(e[a]==="/"&&e[a+1]==="*"){a+=2;while(a<h-1&&!(e[a]==="*"&&e[a+1]==="/"))a++;return a+=2,!0}return!1},R=()=>{if(i!==0)return;let C=e.slice(a).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(C){let I=C[2].split(",").map((N)=>{let Z=N.trim().split(":");return Z[Z.length-1].trim()});for(let N of I)if(N&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(N)&&!t.has(N))s.push(N),t.add(N);return}let O=e.slice(a).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(O){let I=O[2];if(!t.has(I))s.push(I),t.add(I);return}let P=e.slice(a).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(P){let I=P[1];if(!t.has(I))s.push(I),t.add(I);return}let M=e.slice(a).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(M){let I=M[1];if(!t.has(I))s.push(I),t.add(I)}};while(a<h){if(E())continue;if(e[a]==="'"||e[a]==='"'){c(e[a]);continue}if(e[a]==="`"){v();continue}if(e[a]==="{"){i++,a++;continue}if(e[a]==="}"){i--,a++;continue}if(i===0&&/[a-z]/i.test(e[a])&&(a===0||/\s|[;{}()]/.test(e[a-1])))R();a++}return s}function nl(e){let s=[],t=0,i=0,a=null;for(let h=0;h<e.length;h++){let c=e[h];if(a){if(c==="\\"){h++;continue}if(c===a)a=null;continue}if(c==='"'||c==="'"||c==="`"){a=c;continue}if(c==="("||c==="["||c==="{")t++;else if(c===")"||c==="]"||c==="}")t--;else if(c===","&&t===0)s.push(e.slice(i,h)),i=h+1}if(i<e.length)s.push(e.slice(i));return s}function sl(e){let s=0,t=null;for(let i=0;i<e.length;i++){let a=e[i];if(t){if(a==="\\"){i++;continue}if(a===t)t=null;continue}if(a==='"'||a==="'"||a==="`"){t=a;continue}if(a==="("||a==="["||a==="{")s++;else if(a===")"||a==="]"||a==="}")s--;else if(a==="="&&s===0){let h=e[i-1],c=e[i+1];if(h==="!"||h==="<"||h===">"||h==="=")continue;if(c==="="||c===">")continue;return i}}return-1}function rl(e,s){try{let t=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec(e);if(!t)return;let i=t.index-1;while(i>=0&&/\s/.test(e[i]))i--;if(e[i]!=="}")return;let a=i,h=0,c=-1;for(;i>=0;i--){let E=e[i];if(E==="}")h++;else if(E==="{"){if(h--,h===0){c=i;break}}}if(c===-1)return;let v=e.slice(c+1,a);for(let E of nl(v)){let R=E.trim();if(!R||R.startsWith("..."))continue;let C=sl(R);if(C===-1)continue;let O=R.slice(0,C).trim();if(!/^[A-Z_$][\w$]*$/i.test(O))continue;if(s[O]!==void 0)continue;let P=R.slice(C+1).trim();if(!P)continue;try{let M=Object.keys(s).filter(Nt),I=Function(...M,`"use strict"; return (${P});`);s[O]=I(...M.map((N)=>s[N]))}catch{}}}catch{}}var il=new Set(["tr","td","th","thead","tbody","tfoot","caption","colgroup","col","option","optgroup","li","dt","dd","span"]);function tu(e,s){let t=e.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)<([a-zA-Z][a-zA-Z0-9-]*)/s);if(!t)return null;let i=t[2].toLowerCase();if(!il.has(i))return null;let a=new RegExp(`<\\/?${i}(?=[\\s/>])(?:[^>"']|"[^"]*"|'[^']*')*>`,"iy"),h=ae(e,(R,C)=>(a.lastIndex=C,a.exec(R)?.index===C?a.lastIndex:-1));if(i==="span"&&/\sdata-stx-scope\s*=/.test(h[0]?.token||""))return null;let c=0,v=!1;for(let R of h){if(c+=R.token.startsWith("</")?-1:1,c<0)return null;if(c===0){if(e.slice(R.end).trim())return null;v=!0;break}}if(!v)return null;let E=t[0].length;return e.slice(0,E)+s+e.slice(E)}async function lr(e,s,t,i,a){let h=e.endsWith(".stx")?e.slice(0,-4):e,c=(Q)=>Q.split("-").map((se)=>se.charAt(0).toUpperCase()+se.slice(1)).join(""),v=t.__importedComponents;if(v){for(let Q of[h,h.toLowerCase(),c(h),j(h)])if(v.has(Q))return!0}let E=[...new Set([`${h}.stx`,`${c(h)}.stx`,`${j(h)}.stx`])],R=typeof a.root==="string"?oe.resolve(a.root):void 0,C=R??oe.dirname(i),O=[],P=(Q)=>{if(Q&&!O.includes(Q))O.push(Q)},M=t.__originalFilePath;if(M)P(oe.join(oe.dirname(M),"components"));P(s),P(a._rootComponentsDir),P(oe.join(oe.dirname(i),"components")),P(a.componentsDir);let I=a._targetComponentFallbackNames?.some((Q)=>Q.toLowerCase()===h.toLowerCase());if(!I)for(let Q of a._targetComponentDirs??[])P(Q);if(R)P(oe.resolve(R,"resources/views/components")),P(oe.resolve(R,"resources/components")),P(oe.resolve(R,"src/components")),P(oe.resolve(R,"components"));for(let Q of a._layerComponentDirs??[])P(Q);let N=a._pluginComponentDirs;if(Array.isArray(N))for(let Q of N)P(typeof Q==="string"?Q:null);if(P(a.fallbackComponentsDir),I)for(let Q of a._targetComponentDirs??[])P(Q);if(h.startsWith("./")||h.startsWith("../"))return n(oe.resolve(oe.dirname(i),`${h}.stx`));let Z=Di(oe.resolve(import.meta.dir,"components")),U=O.map((Q)=>oe.isAbsolute(Q)?Q:oe.resolve(C,Q)),V=`${E.join("\x00")}\x00\x00${U.join("\x00")}`,X=zs.get(V);if(X!==void 0)return X;let Y=!1;e:for(let Q of U){if(Di(Q)===Z)continue;for(let se of E)if(await n(oe.join(Q,se))){Y=!0;break e}}return zs.set(V,Y),Y}function Di(e){let s=Ws.get(e);if(s!==void 0)return s;let t=e;try{t=Us.realpathSync(e)}catch{}return Ws.set(e,t),t}function nu(e){return e==="visible"||e==="idle"||e==="interaction"||e.startsWith("media:")}function Ga(e){if(!e)return!1;let s=e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(s)}function ol(e,s,t){if(!e.includes("{{")&&!e.includes("{!!"))return e;let i=(a,h)=>{let c;try{c=_(a,s)}catch{return h}if(c===void 0||c===null)return"";let v=String(c);if(/<\/style/i.test(v))return console.warn(`[stx] a <style> expression in ${t??"<unknown>"} evaluated to CSS containing a closing style tag, which would end the element early, so it was dropped rather than emitted.`),"";return v};return e.replace(/\{!!([\s\S]*?)!!\}/g,(a,h)=>i(h,a)).replace(/\{\{([\s\S]*?)\}\}/g,(a,h)=>i(h,a))}var ji=new Set;function Ni(e,s,t,i){let a=`${e}\x00${s}\x00${i??""}`;if(!process.env.STX_DEBUG&&ji.has(a))return;ji.add(a);let h=s?` used in ${s}`:"",c=i?` Cause: ${i}.`:"",v=t.length>0?`
287
+ searched:
288
+ ${t.map((E)=>` - ${E}`).join(`
289
+ `)}`:"";console.error(`[stx] component <${e}> could not be resolved${h}, so it rendered as nothing.${c}${v}`)}function Li(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}function Do(e){let s=new Set,t=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let i of e){let a;while((a=t.exec(i))!==null)s.add(a[1]);t.lastIndex=0}return[...s]}async function De(e,s,t,i,a,h,c,v=new Set,E,R=Ze(a),C,O=e){let{extractVariables:P}=await r("stx/variable-extractor",()=>import("./chunk-tkkvvt26.js")),M=v??new Set;if(M.has(e))return`[Circular component reference: ${e}]`;let I=new Set(M);I.add(e);let N=typeof s.client==="string"?s.client.trim():"";if("client"in s)delete s.client;let Z=N&&N!=="load"&&nu(N)?N:"";try{let U=(re)=>re.split("-").map((ne)=>ne.charAt(0).toUpperCase()+ne.slice(1)).join(""),V=O.endsWith(".stx")?O.slice(0,-4):O,X=null,Y=a.__importedComponents;if(Y){let re=[V,V.toLowerCase(),U(V),j(V)];for(let ne of re)if(Y.has(ne)){X=Y.get(ne);break}}let Q=[];if(!X){let re=[`${V}.stx`,`${U(V)}.stx`,`${j(V)}.stx`],ne=[...new Set(re)],ge=a.__originalFilePath,me=[];if(me.push(...c._layerComponentDirs??[]),ge){let _e=oe.join(oe.dirname(ge),"components");me.push(_e)}if(i)me.push(i);let Ve=c._rootComponentsDir;if(typeof Ve==="string"&&!me.includes(Ve))me.push(Ve);let Le=oe.join(oe.dirname(h),"components");if(!me.includes(Le))me.push(Le);if(c.componentsDir&&c.componentsDir!==i&&!me.includes(c.componentsDir))me.push(c.componentsDir);let it=c._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(V),bt=(C?.events??[]).map((_e)=>_e.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),ot=Object.hasOwn(s,"checked")||Boolean(C?.reactiveProps?.includes("checked")),yt=Object.hasOwn(s,"value")||Boolean(C?.reactiveProps?.includes("value")),_n=!bt.includes("valuechange")&&(ot||bt.includes("change")&&!yt),wn=c._targetComponentFallbackNames?.some((_e)=>_e.toLowerCase()===V.toLowerCase())&&(!it||_n);for(let _e of wn?[]:c._targetComponentDirs??[])if(_e&&!me.includes(_e))me.push(_e);let qe=typeof c.root==="string"?oe.resolve(c.root):void 0,Sn=qe??oe.dirname(h),nt=[];if(qe)nt.push(oe.resolve(qe,"resources/views/components")),nt.push(oe.resolve(qe,"resources/components")),nt.push(oe.resolve(qe,"src/components")),nt.push(oe.resolve(qe,"components"));nt.push(oe.resolve(import.meta.dir,"components"));for(let _e of nt)if(!me.includes(_e))me.push(_e);let Vt=c._pluginComponentDirs;if(Array.isArray(Vt)){for(let _e of Vt)if(typeof _e==="string"&&!me.includes(_e))me.push(_e)}if(c.fallbackComponentsDir&&!me.includes(c.fallbackComponentsDir))me.push(c.fallbackComponentsDir);if(wn){for(let _e of c._targetComponentDirs??[])if(_e&&!me.includes(_e))me.push(_e)}let Ut=[...new Set(me.map((_e)=>{if(!_e)return _e;return oe.isAbsolute(_e)?_e:oe.resolve(Sn,_e)}))];me.length=0,me.push(...Ut);let _t=`${V}\x00${h}\x00${Ut.join("\x00")}`,Xn=Fn.get(_t);if(Xn)if(await n(Xn))X=Xn;else Fn.delete(_t);if(!X&&(V.startsWith("./")||V.startsWith("../")))X=oe.resolve(oe.dirname(h),`${V}.stx`),Q.push(X);else if(!X)for(let _e of me){if(!_e)continue;for(let $n of ne){let vn=oe.join(_e,$n);if(Q.push(vn),await n(vn)){X=vn;break}}if(X)break;if(!X)try{let $n=await import("fs");if(!$n.statSync(_e,{throwIfNoEntry:!1})?.isDirectory())continue;let eo=8,Jn=[{path:_e,depth:0}];while(Jn.length>0&&!X){let En=Jn.pop();if(En.depth>=eo)continue;let Gs;try{Gs=$n.readdirSync(En.path,{withFileTypes:!0})}catch{continue}for(let kn of Gs){if(!kn.isDirectory())continue;if(kn.name==="node_modules"||kn.name.startsWith("."))continue;let Ys=oe.join(En.path,kn.name);for(let to of ne){let Gn=oe.join(Ys,to);if(Q.push(Gn),await n(Gn)){X=Gn;break}}if(X)break;Jn.push({path:Ys,depth:En.depth+1})}}}catch{}if(X)break}if(X)Fn.set(_t,X)}if(!X||!await n(X))return Ni(e,h,Q),Li(e);E.add(X);let se;if(Qt.has(X))se=Qt.get(X);else try{se=await Bun.file(X).text(),Qt.set(X,se)}catch(re){let ne=re instanceof Error?re.message:String(re);return Ni(e,h,[X],ne),Li(e)}if(C)for(let re of new Set([...Object.keys(s),...C.reactiveProps??[]])){let ne=re.toLowerCase();if(ne.startsWith("aria-")||ne.startsWith("data-"))continue;let ge=re.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${ge}\\b`).test(se))C.declaredProps.add(re);if(new RegExp(`\\$props\\s*(?:\\.\\s*${ge}\\b|\\[\\s*['"]${ge}['"]\\s*\\])`).test(se)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${ge}['"]`).test(se))C.consumedProps?.add(re)}let pe=new Set(["__originalFilePath","__importedComponents",An,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),Se={};for(let[re,ne]of Object.entries(a))if(!re.startsWith("__")||pe.has(re))Se[re]=ne;let Ee=R.length>0?{[Nn]:[...R]}:{},Be=t;if(t.includes("@include")){let{processIncludes:re}=await r("stx/includes",()=>import("./chunk-5e20mvke.js"));Be=await re(t,a,h,c,E)}if(/<[A-Z][\w.-]*[\s/>]/.test(Be)){let{processComponents:re}=await r("stx/component-renderer",()=>import("./chunk-9qeg5trh.js"));Be=await re(Be,{...a,__processedComponents:M,...Ee},h,c,E)}let Ce=[];if(Ga(Be)){let{processExpressions:re}=await r("stx/expressions",()=>import("./chunk-p22w6mwr.js")),ne=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...Ee}:R.length>0?{...a,...Ee}:a;Be=re(Be,ne,h);for(let ge of Be.matchAll(/\{\{([\s\S]*?)\}\}/g))Ce.push(ge[1].trim())}let Ue=q(Be),Je=[],mt=Ue.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(re,ne)=>{let ge=Ue.scripts[Number(ne)]||"",me=ge.match(/^<script\b([^>]*)>/i)?.[1]||"",Ve=me.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Le=!Ve||["module","text/javascript","application/javascript"].includes(Ve),it=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${me}`);if(!/\bserver\b/i.test(me)&&Le&&!it)return Je.push(ge),"";return ge}),{extractSlotContent:Hn}=await r("stx/slots",()=>import("./chunk-qn63btbf.js")),ct=Hn(mt),lt={};if(ct.defaultSlot?.trim())lt.default=ct.defaultSlot;for(let[re,ne]of ct.namedSlots)lt[re]=ne.content;let ut=a.__stx_scope_seq??={n:0,key:ms(String(a.__filename??h))},Ot=zi(e,process.cwd()),ft=`stx_${(Ot.endsWith(".stx")?Ot.slice(0,-4):Ot).replace(/[^a-zA-Z0-9]/g,"_")}_${++ut.n}_${ut.key}`,We={...Se,$uid:ft,...s,props:s,slot:mt,$slots:lt,__processedComponents:I,__sections:{},__stx_signals_gate:ye(se)||Ga(t),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...Ce]};rl(se,We);let Mt=se,tn=ie(Mt);if(tn)Mt=tn.content.trim();let Kn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Dt=[...se.matchAll(Kn)];for(let[,re,ne]of Dt)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(re))$e(ne,X,c.strict);let Ge=[],jt=null,Zn=Dt.some((re)=>/\bserver\b/.test(re[1]||"")&&/\bcache\b/.test(re[1]||"")),ht=null,et=null,Lt=null,nn=0,Bt=null;if(Gc(c),Zn&&Fs>0){let re=Yc({props:s,slot:Be,slotContext:t.trim()?Qc(Se):void 0,buildMode:c.buildMode??"",skipEventDirectives:c.skipEventDirectives===!0,clientLoopNames:[...R].sort(),layers:c._layerGraph?.layers.map((ne)=>ne.configFile),uid:ft});if(re!==null){ht=`${X}\x00${b(se)}\x00${re}`;let ne=Vn.get(ht);if(ne){for(let ge of ne.dependencies)E.add(ge);if(jr(a,ne.clientFactories),ut.n+=ne.uidsConsumed,ne.preservedClientExpressions.length>0){let ge=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let me of ne.preservedClientExpressions)ge.add(me);a.__stx_preserved_client_expressions=[...ge]}return ne.output}et=new Set(E),Lt=Mr(a),nn=ut.n,Bt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let zt=new Set;for(let re of Dt){let ne=re[1]||"",ge=re[2]||"",me=ne.includes("server");if(Oe(ne)&&ge.trim())ge=Ne(ge);if(me&&ge){for(let Le of Ae(ge))zt.add(Le);try{await P(ge,We,X,{onFailure:(Le)=>{if(Le.kind!=="unknown")jt=Le.kind}})}catch(Le){}}if(!me){let Le=ge.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),it=Le.includes("{{")&&Le.includes("}}"),bt=Le.includes("{!!")&&Le.includes("!!}");if(it||bt)Le=Lo(Le,We,X);let ot=ne.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");Ge.push(`<script${ot}>${Le}</script>`)}}let He=q(se).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),Wt=He?He[1]:"",qn=He?He[2]:"",tt="",J=Wt&&/\bscoped\b/i.test(Wt);if(He)tt=`<style${Wt}>${ol(qn,We,X)}</style>`;let ee=Mt;if(ee=ee.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),He)ee=ee.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let re=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,ne=[];if(ee=ee.replace(re,(ge,me)=>{let Ve=me.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(Ve)ne.push(`<style${Ve[1]}>${Ve[2]}</style>`);return""}),ee=ee.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),ne.length>0)tt=`${tt}${ne.join(`
290
+ `)}`}if(t&&ee.includes("{{ text || slot }}"))ee=ee.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>t);let{applySlots:fe}=await r("stx/slots",()=>import("./chunk-qn63btbf.js")),{defaultSlot:xe,namedSlots:we}=ct,ze=Ge.some((re)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(re)),pt=(re)=>ze?fi(re,ft):re,Js=new Map([...we].map(([re,ne])=>[re,{...ne,content:pt(ne.content)}]));ee=await fe(ee,pt(xe),Js,We);let hn=Do(Ge),xn=(Array.isArray(We.__stx_client_signal_names)?We.__stx_client_signal_names:[]).filter((re)=>!zt.has(re));if(hn.length>0||xn.length>0)We.__stx_client_signal_names=[...new Set([...xn,...hn])];else delete We.__stx_client_signal_names;let Ft=R.filter((re)=>!zt.has(re)&&!(re in s));if(Ft.length>0)We[Nn]=Ft;let bn={...c,_rootComponentsDir:c._rootComponentsDir||c.componentsDir,componentsDir:oe.dirname(X),skipSignalsRuntime:!0,skipEventDirectives:c._nativeHostAttrs===!0||ze||Ge.length===0,defaultLayout:void 0};We.__stxProcessingDepth=(a.__stxProcessingDepth||0)+1;let{processDirectives:yn}=await r("stx/process",()=>import("./chunk-cs0dd5w8.js")),st=await yn(ee,We,X,bn,E),xt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let re of st.matchAll(/\{\{([\s\S]*?)\}\}/g))xt.add(re[1].trim());if(xt.size>0)a.__stx_preserved_client_expressions=[...xt];let Ke=ft,Fe=st;if(ze){let re="";if(Object.keys(s).length>0)try{re=` data-stx-props="${Ls(JSON.stringify(s))}"`}catch{}let ne=Z?` stx-hydrate="${Ls(Z)}"`:"",ge=Object.fromEntries(Object.entries(lt).map(([ot,yt])=>[ot,Boolean(yt)])),me=Object.keys(ge).length>0?` data-stx-slots="${Ls(JSON.stringify(ge))}"`:"",Ve=` data-stx-scope="${Ke}"${re}${me}${ne}`,Le=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<span(?=[\s/>])/i.test(st),it=Le?"span":"div";Fe=tu(st,Ve)??`<${it}${Ve} data-stx-component-wrapper${Le?' style="display:contents"':""}>${st}</${it}>`;let bt=await Promise.all(Ge.map(async(ot)=>{let yt=ot.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!yt)return ot;let[,_n,wn]=yt,qe=await ll(wn,X,c.buildMode==="compile"),Sn=dn(qe.clientCode,Pe(We)),{vendorStyleTags:nt}=qe,Vt=Sn?`function(__scopeId) {
291
+ ${Sn}
292
+ return (${qe.factoryBody})(__scopeId);
293
+ }`:qe.factoryBody,Ut=Z?null:xs(a,Vt),_t=Ut?`window.__stxComponentFactories[${JSON.stringify(Ut)}](${JSON.stringify(Ke)});`:`(${Vt})(${JSON.stringify(Ke)});`;if(Z)return`${nt}<script type="stx/island" data-stx-island="${Ke}" data-stx-scoped data-stx-owner="${Ke}"${_n}>${_t}</script>`;return`${nt}<script data-stx-scoped data-stx-run="always" data-stx-owner="${Ke}"${_n}>${_t}</script>`}));if(Fe=Fe+`
294
+ `+bt.join(`
295
+ `),tt)Fe+=`
296
+ `+tt}else{if(tt)Fe+=`
297
+ `+tt;if(Ge.length>0){let re=We.__stx_event_bindings||[],ne=Pe(We),ge=await Promise.all(Ge.map(async(me)=>{let Ve=me.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!Ve)return me;return await Ie(Ve[1],{eventBindings:re,templateContent:Fe,filePath:X,projectRoot:process.cwd(),serverData:ne,instanceId:ft})}));Fe+=`
298
+ `+ge.join(`
299
+ `),We.__stx_event_bindings=[]}}if(J){let re=us(Fe,X);if(re.hasScoped)Fe=re.html}if(ht&&et){let re=Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[];Vn.set(ht,{output:Fe,dependencies:[...E].filter((ne)=>!et.has(ne)),clientFactories:Lt?Dr(a,Lt):[],uidsConsumed:ut.n-nn,preservedClientExpressions:Bt?re.filter((ne)=>!Bt.has(ne)):[]})}if(jt)Fe=`<!--stx-render-failed:${jt}-->${Fe}`;return Je.length>0?`${Fe}
300
+ ${Je.join(`
301
+ `)}`:Fe}catch(U){if(U instanceof z)throw U;return`[Error processing component: ${U instanceof Error?U.message:String(U)}]`}finally{M.delete(e)}}async function n(e){return Bun.file(e).exists()}function Vs(e,s){let t=oe.resolve(s),i=oe.resolve(e),a=t.endsWith(oe.sep)?t:t+oe.sep;if(i===t||i.startsWith(a))return i;return null}async function al(e,s,t,i){let a=s.startsWith("layouts/")?s.slice(8):s,h=oe.join(e,a);for(let c of h.endsWith(".stx")?[h]:[h,`${h}.stx`])if(await n(c)){if(i)console.log(`Found layout in ${e}: ${c}`);return t?.add(c),c}return null}async function pn(e,s,t,i){let a=await cl(e,s,t,i);if(a===null)return null;let h=Vs(a,process.cwd());if(h)return h;let c=[t.root,t.layoutsDir,t.fallbackLayoutsDir,t.componentsDir,t.partialsDir,t.pagesDir,...t._layerLayoutDirs??[]].filter((v)=>typeof v==="string"&&v.length>0);for(let v of c){let E=oe.isAbsolute(v)?v:oe.resolve(process.cwd(),v);if(Vs(a,E))return oe.resolve(a)}return console.warn(`[stx] rejected resolved template path that escapes project root: ${a} (template: ${e}, from: ${s})`),null}async function cl(e,s,t,i){if(t.debug)console.log(`Resolving template path: ${e} from ${s}`);let a=oe.dirname(s),h=process.cwd();if(e.startsWith("/")){let P=oe.join(h,e),M=Vs(P,h);if(!M)return console.warn(`[stx] rejected template path that escapes project root: ${e} (from ${s})`),null;if(t.debug)console.log(`Checking absolute path: ${M}`);if(await n(M)&&i)i.add(M);return M}let c=oe.join(a,e);if(await n(c)){if(t.debug)console.log(`Found direct path: ${c}`);if(i)i.add(c);return c}if(!e.endsWith(".stx")&&!e.endsWith(".jsx")&&!e.endsWith(".tsx"))for(let P of[".stx",".tsx",".jsx"]){let M=`${c}${P}`;if(await n(M)){if(t.debug)console.log(`Found direct path with extension: ${M}`);if(i)i.add(M);return M}}let v=[];if(v.push(...t._layerLayoutDirs??[]),t.layoutsDir)v.push(oe.isAbsolute(t.layoutsDir)?t.layoutsDir:oe.resolve(process.cwd(),t.layoutsDir));let E=oe.resolve(a),R=process.cwd();for(let P=0;P<10;P++){let M=oe.join(E,"layouts"),I=!1;try{I=Us.statSync(M,{throwIfNoEntry:!1})?.isDirectory()??!1}catch{}if(I){v.push(M);break}let N=oe.dirname(E);if(N===E||N.length<R.length)break;E=N}for(let P of v){let M=await al(P,e,i,t.debug);if(M)return M}if(t.fallbackLayoutsDir){let P=oe.isAbsolute(t.fallbackLayoutsDir)?t.fallbackLayoutsDir:oe.resolve(process.cwd(),t.fallbackLayoutsDir),M=e.startsWith("layouts/")?e.slice(8):e,I=[oe.join(P,M)];if(!e.endsWith(".stx"))I.push(`${I[0]}.stx`);for(let N of I)if(await n(N)){if(t.debug)console.log(`Found in options.fallbackLayoutsDir: ${N}`);if(i)i.add(N);return N}}if(e.startsWith("layouts/")||e.includes("/layouts/")){let P=e.split("layouts/"),M=oe.join(t.partialsDir||a,"layouts",P[1]);if(await n(M)){if(t.debug)console.log(`Found in layouts path: ${M}`);if(i)i.add(M);return M}if(!M.endsWith(".stx")){let I=`${M}.stx`;if(await n(I)){if(t.debug)console.log(`Found in layouts path with extension: ${I}`);if(i)i.add(I);return I}}}if(t.partialsDir){let P=oe.join(t.partialsDir,"layouts");if(await n(P)){let M=oe.join(P,e);if(await n(M)){if(t.debug)console.log(`Found in partials layouts dir: ${M}`);if(i)i.add(M);return M}if(!e.endsWith(".stx")){let I=`${M}.stx`;if(await n(I)){if(t.debug)console.log(`Found in partials layouts dir with extension: ${I}`);if(i)i.add(I);return I}}}}let C=t.partialsDir||oe.join(process.cwd(),"views"),O=oe.join(C,e);if(await n(O)){if(t.debug)console.log(`Found in views path: ${O}`);if(i)i.add(O);return O}if(!e.endsWith(".stx")){let P=`${O}.stx`;if(await n(P)){if(t.debug)console.log(`Found in views path with extension: ${P}`);if(i)i.add(P);return P}}if(a.includes("temp")){let P=oe.join(oe.dirname(a),"layouts",e);if(await n(P)){if(t.debug)console.log(`Found in temp layouts dir: ${P}`);if(i)i.add(P);return P}if(!e.endsWith(".stx")){let M=`${P}.stx`;if(await n(M)){if(t.debug)console.log(`Found in temp layouts dir with extension: ${M}`);if(i)i.add(M);return M}}}if(t.debug)console.warn(`Template not found after trying all paths: ${e} (referenced from ${s})`);else console.warn(`Template not found: ${e} (referenced from ${s})`);return null}function Ka(e,s,t){let i=0,a="",h="";try{if(typeof s==="number"&&s>=0){let c=e.split(`
302
+ `),v=0;for(let E=0;E<c.length;E++)if(v+=c[E].length+1,v>=s){i=E+1,a=c[E].trim();let R=Math.max(0,E-2),C=Math.min(c.length,E+3);h=c.slice(R,C).map((O,P)=>{let M=R+P+1;return`${M===i?"> ":" "}${M}: ${O}`}).join(`
303
+ `);break}}else if(t){let c=e.indexOf(t);if(c>=0)return Ka(e,c)}}catch{}return{lineNumber:i,lineContent:a,context:h}}var be={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",yellow:"\x1B[33m",blue:"\x1B[34m",cyan:"\x1B[36m",gray:"\x1B[90m",bgRed:"\x1B[41m",bgYellow:"\x1B[43m"};function g(e,s,t,i,a,h){let{lineNumber:c,context:v}=Ka(i,a,h),E=t.split("/").pop(),R=0;if(typeof a==="number"&&a>=0&&i){let O=i.lastIndexOf(`
304
+ `,Math.max(0,a-1));R=a-(O+1)+1}let C="";if(c>0)C+=`
305
+ ${t}:${c}${R>0?`:${R}`:""}: ${e.toLowerCase()} error: ${s}
306
+ `;if(C+=`
307
+ ${be.bold}${be.red}\u256D\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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E${be.reset}
308
+ `,C+=`${be.bold}${be.red}\u2502${be.reset} ${be.bold}${be.bgRed} ERROR ${be.reset} ${be.red}${e} Error${be.reset}${" ".repeat(Math.max(0,43-e.length))}${be.bold}${be.red}\u2502${be.reset}
309
+ `,C+=`${be.bold}${be.red}\u2570\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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F${be.reset}
310
+ `,C+=`
311
+ ${be.cyan}${be.bold}File:${be.reset} ${be.dim}${E}${be.reset}`,c>0)C+=` ${be.gray}(line ${c}${R>0?`, col ${R}`:""})${be.reset}`;if(C+=`
312
+ ${be.yellow}${be.bold}Message:${be.reset} ${s}
313
+ `,v)C+=`
314
+ ${be.blue}${be.bold}Context:${be.reset}
315
+ ${be.dim}${v}${be.reset}
316
+ `;return C}function de(){Qt.clear(),Fn.clear(),zs.clear(),Ws.clear(),Vn.clear()}function Rp(){return{size:Qt.size,maxSize:500}}var Bs=y(128);async function ll(e,s,t){let i=b(e,s,t),a=Bs.get(i);if(a){if(as(a.deps))return a;Bs.delete(i)}let h=Io(e,{filePath:s,projectRoot:process.cwd()}),c=h.code,v=Oo(h.styles);c=Pt(c).code;let{hasUserImports:E,bundleClientScript:R}=await r("stx/client-script-bundler",()=>import("./chunk-1c5p7ede.js")),C=[],O=!1;if(E(c)){let V=c;c=await R(V,s,{projectRoot:process.cwd(),minify:t,collectInputs:C}),O=c===V}let{stripStxRuntimeImports:P}=await r("stx/signal-processing",()=>import("./chunk-fygp3cs9.js"));c=P(c);let M=T(c),I=tl(M),N=new Set(L(M,!0).split(",").map((V)=>V.trim())),Z=`function(__scopeId) {
317
+ ${rt("const",[...ic,...I],M)}
318
+ const __scope = window.stx._scopes = window.stx._scopes || {};
319
+ const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
320
+ __scopeVars.$refs = __scopeVars.$refs || {};
321
+ const __previousCurrentElement = window.__STX_CURRENT_ELEMENT__;
322
+ const __previousCurrentProps = window.__STX_CURRENT_PROPS__;
323
+ // A clone the runtime is setting up may not be in the document yet (rows
324
+ // a loop builds inside a closed :if), where a lookup cannot see it, so the
325
+ // runtime hands its root over in __STX_SETUP_ROOT__ (signals.ts).
326
+ const __setupRoot = window.__STX_SETUP_ROOT__;
327
+ const __componentElement = (__setupRoot && __setupRoot.getAttribute('data-stx-scope') === __scopeId && __setupRoot) || document.querySelector('[data-stx-scope="' + __scopeId + '"]');
328
+ __scopeVars.$slots = Object.create(null);
329
+ if (__componentElement) {
330
+ try { Object.assign(__scopeVars.$slots, JSON.parse(__componentElement.getAttribute('data-stx-slots') || '{}')); }
331
+ catch {}
332
+ }
333
+ window.__STX_CURRENT_ELEMENT__ = __componentElement;
334
+ let __componentProps = __componentElement && __componentElement.__stx_props;
335
+ if (!__componentProps && __componentElement) {
336
+ try { __componentProps = JSON.parse(__componentElement.getAttribute('data-stx-props') || '{}'); }
337
+ catch { __componentProps = {}; }
338
+ }
339
+ window.__STX_CURRENT_PROPS__ = __componentProps && typeof __componentProps === 'object' && !Array.isArray(__componentProps) ? __componentProps : {};
340
+
341
+ // Scope-specific lifecycle callbacks. The queues drain as they run; the
342
+ // hook lists keep what setup registered, because a component behind an :if
343
+ // unmounts at each hide and mounts again at each show (signals.ts,
344
+ // suspendSubtreeScopes).
345
+ if (__scopeVars.__suspended && !__scopeVars.__mounted) {
346
+ // Set up again after an :if hid it -- a <template :if> clones the
347
+ // component afresh on every show, and the clone's script runs. This run's
348
+ // hooks close over this run's state, so they replace the ones the hide
349
+ // kept for a re-show rather than queueing beside them.
350
+ __scopeVars.__mountCallbacks = [];
351
+ __scopeVars.__destroyCallbacks = [];
352
+ __scopeVars.__mountHooks = [];
353
+ __scopeVars.__destroyHooks = [];
354
+ }
355
+ __scopeVars.__mountCallbacks = __scopeVars.__mountCallbacks || [];
356
+ __scopeVars.__destroyCallbacks = __scopeVars.__destroyCallbacks || [];
357
+ __scopeVars.__mountHooks = __scopeVars.__mountHooks || [];
358
+ __scopeVars.__destroyHooks = __scopeVars.__destroyHooks || [];
359
+ let __registeringSetupHooks = true;
360
+ const onMount = (fn) => { __scopeVars.__mountCallbacks.push(fn); __scopeVars.__mountHooks.push(fn); };
361
+ const onDestroy = (fn) => {
362
+ __scopeVars.__destroyCallbacks.push(fn);
363
+ // A teardown registered inside onMount belongs to this mount alone.
364
+ // Replaying it AND registering the next mount's teardown doubles cleanup.
365
+ if (__registeringSetupHooks) __scopeVars.__destroyHooks.push(fn);
366
+ };
367
+
368
+ try {
369
+ ${M}
370
+
371
+ // Register all defined signals and functions in this scope
372
+ const __localVars = {};
373
+ try {
374
+ ${I.map((V)=>N.has(V)?`Object.defineProperty(__localVars, '${V}', ${ns(V)});`:`if (typeof ${V} !== 'undefined') __localVars['${V}'] = ${V};`).join(`
375
+ `)}
376
+ }
377
+ catch (e) {}
378
+ Object.defineProperties(__scopeVars, Object.getOwnPropertyDescriptors(__localVars));
379
+ if (typeof __stxLiveBindings !== 'undefined') Object.defineProperties(__scopeVars, Object.getOwnPropertyDescriptors(__stxLiveBindings));
380
+ }
381
+ finally {
382
+ __registeringSetupHooks = false;
383
+ window.__STX_CURRENT_ELEMENT__ = __previousCurrentElement;
384
+ window.__STX_CURRENT_PROPS__ = __previousCurrentProps;
385
+ }
386
+ }`,U={vendorStyleTags:v,factoryBody:Z,clientCode:M,deps:rr([...C,...h.styles.map((V)=>V.resolvedPath)])};if(!O&&h.unresolved.length===0)Bs.set(i,U);return U}var un=["module","exports","require","props","$props","$bool","$num","defineProps","withDefaults","defineClientPayload","useServerData","useRuntimeConfig","useServerRuntimeConfig","state","derived","effect","batch","onMount","onDestroy","definePageMeta","useRoute","useRouter","useHead","useSeoMeta","setResponseStatus","setResponseHeader","notFound","ref","reactive","computed","watch","onMounted","onUnmounted","nextTick","defineEmits","defineExpose","defineSlots","provide","inject","useColorMode","useDark","useMediaQuery","useScrollLock","usePreferredDark","usePreferredLight","usePreferredReducedMotion","usePreferredContrast","window","document","console","confirm","alert","fetch","params"];var ul=100,fl=599,Ks="__stxResponseStatus",en="__stxResponseHeaders";function Un(e){return typeof e==="number"&&Number.isInteger(e)&&e>=ul&&e<=fl}function cn(e){for(let s of e.matchAll(/\bdefinePageMeta\s*\(\s*\{([\s\S]*?)\}\s*\)/g)){let t=s[1].match(/(?:^|,)\s*status\s*:\s*(\d{3})(?=\s*(?:,|$))/);if(!t)continue;let i=Number(t[1]);if(Un(i))return i}return}function Hs(e,s){if(!e||typeof e!=="object")return!1;let t=typeof s==="string"&&/^\d+$/.test(s.trim())?Number(s.trim()):s;if(!Un(t))return!1;return e[Ks]=t,!0}function pl(e,s,t){if(!e||typeof e!=="object")return;let i=String(s??"").trim();if(!i)return;e[en]={...e[en],[i]:String(t)}}function Rt(e){let s=e?.[Ks];return Un(s)?s:void 0}function At(e){let s=e?.[en];if(!s||typeof s!=="object")return;let t=Object.entries(s).map(([i,a])=>[i,String(a)]);return t.length>0?Object.fromEntries(t):void 0}function Ma(e,s){if(!e||!s||e===s||typeof s!=="object")return;let t=Rt(e);if(t!==void 0)s[Ks]=t;let i=At(e);if(i)s[en]={...s[en],...i}}function ds(e){return{setResponseStatus:(s)=>{Hs(e,s)},notFound:(s=404)=>{let t=Un(s)&&s>=400?s:404;Hs(e,t)},setResponseHeader:(s,t)=>{pl(e,s,t)}}}function La(e,s,t={}){if(!e.includes("@status"))return e;let{filePath:i,buildMode:a}=t,h=a==="compile",c="",v=0,E=/@status\s*\(/g,R;while((R=E.exec(e))!==null){let C=dl(e,R.index+R[0].length-1);if(C<0)break;let O=e.slice(R.index+R[0].length,C).trim(),P=/^\d+$/.test(O)?Number(O):l(O,s),M=i?` in ${i}`:"";if(h)console.warn(`[stx] @status(${O})${M} is skipped when precompiling: the build has no request, so the branch it sits in is not the one a visitor will get. Call notFound() or setResponseStatus(${O}) from <script server> instead \u2014 that runs per request.`);else if(!Hs(s,P))console.warn(`[stx] @status(${O})${M} is not an HTTP status (100-599) \u2014 ignoring it.`);c+=e.slice(v,R.index),v=C+1+(e.slice(C+1).match(/^[^\S\n]*\n?/)?.[0].length??0),E.lastIndex=v}return v===0?e:c+e.slice(v)}function dl(e,s){let t=1,i=null,a=!1;for(let h=s+1;h<e.length;h++){let c=e[h];if(a){a=!1;continue}if(i){if(c==="\\")a=!0;else if(c===i)i=null;continue}if(c==='"'||c==="'"||c==="`"){i=c;continue}if(c==="(")t++;else if(c===")"&&--t===0)return h}return-1}var Wi=new Set(un),gl=new Set(["props","$props","defineProps"]),ml=new Set(["stx","@stacksjs/stx"]),Fi=y(128),Vi=y(64);function hl(e){let s=[],t=0,i=e.split(`
387
+ `);for(let a of i){let h=t,c=null,v=!1;for(let E=0;E<a.length;E++){let R=a[E];if(v){v=!1;continue}if(R==="\\"){v=!0;continue}if(c){if(R===c)c=null;continue}if(R==="'"||R==='"'||R==="`"){c=R;continue}if(R==="/"&&E+1<a.length&&a[E+1]==="/")break;if(R==="{")t++;else if(R==="}")t--}if(h===0){let E=a.match(/(?:const|let|var)\s+(\w+)\s*=/);if(E)s.push(E[1]);else if(/^\s*(?:const|let|var)\s+\w+\s*;?\s*$/.test(a)){let R=a.match(/(?:const|let|var)\s+(\w+)/);if(R)s.push(R[1])}else{let R=a.match(/(?:const|let|var)\s+(\{[^}]+\}|\[[^\]]+\])\s*=/);if(R){let O=R[1].slice(1,-1).split(",").map((P)=>{let M=P.split(":");return(M.length>1?M[1]:M[0]).trim()}).filter((P)=>/^\w+$/.test(P));s.push(...O)}}}}return[...new Set(s)]}function zl(e){let s=e;s=s.replace(/^\s*import\s+.*?from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),s=s.replace(/^\s*import\s+['"][^'"]+['"]\s*;?\s*$/gm,""),s=s.replace(/^\s*interface\s+\w+\s*\{[\s\S]*?\n\}\s*$/gm,""),s=s.replace(/^\s*type\s+\w+\s*=[\s\S]*?(?=\n(?:const|let|var|function|export|interface|type|$))/gm,""),s=s.replace(/^(\s*(?:export\s+)?(?:const|let|var)\s+)(\w+|\{[^}]+\}|\[[^\]]+\])\s*:\s*[^=]+(\s*=)/gm,"$1$2$3");function t(i){if(!i.includes(":"))return i;let a=[],h="",c=0,v=0,E=null;for(let R=0;R<i.length;R++){let C=i[R];if(E){if(h+=C,C===E)E=null;continue}if(C==='"'||C==="'"||C==="`"){E=C,h+=C;continue}if(C==="<")c++;else if(C===">"&&c>0)c--;else if(C==="(")v++;else if(C===")")v--;if(C===","&&c===0&&v===0){a.push(h),h="";continue}h+=C}if(h)a.push(h);return a.map((R)=>{let C=R.trim(),O=C.startsWith("..."),P=O?C.slice(3):C,M=-1,I=0;for(let Q=0;Q<P.length;Q++)if(P[Q]==="<")I++;else if(P[Q]===">")I--;else if(P[Q]===":"&&I===0){M=Q;break}if(M===-1)return R;let Z=P.substring(0,M).trim().replace(/\?$/,""),U=P.substring(M+1),V=-1,X=0;for(let Q=0;Q<U.length;Q++)if(U[Q]==="<")X++;else if(U[Q]===">")X--;else if(U[Q]==="="&&X===0){V=Q;break}let Y=O?"...":"";if(V!==-1)return`${Y}${Z} = ${U.substring(V+1).trim()}`;return`${Y}${Z}`}).join(", ")}s=s.replace(/\b(function\s+\w*\s*)\(([^)]*)\)/g,(i,a,h)=>{if(!h.includes(":"))return i;return`${a}(${t(h)})`});{let i=/\b(function\s+\w*\s*)\(/g,a,h=[];while((a=i.exec(s))!==null){let c=a.index+a[0].length-1,v=1,E=c+1,R=0,C=null;while(E<s.length&&v>0){let M=s[E];if(C){if(M===C)C=null;E++;continue}if(M==='"'||M==="'"||M==="`"){C=M,E++;continue}if(M==="<")R++;else if(M===">"&&R>0)R--;else if(R===0){if(M==="(")v++;else if(M===")")v--}if(v>0)E++}if(v!==0)continue;let O=s.substring(c+1,E);if(!O.includes(":"))continue;let P=t(O);h.push({start:c+1,end:E,replacement:P})}for(let c=h.length-1;c>=0;c--){let{start:v,end:E,replacement:R}=h[c];s=s.substring(0,v)+R+s.substring(E)}}return s=s.replace(/\(([^)]*)\)\s*(?::\s*[^=]+)?\s*=>/g,(i,a)=>{if(!a.includes(":"))return i;if(a.includes("{")||a.includes("}"))return i;return`(${a.split(",").map((c)=>{let[v,...E]=c.split("="),R=v.split(":")[0].trim();if(E.length>0)return`${R} = ${E.join("=").trim()}`;return R}).join(", ")}) =>`}),s=s.replace(/(\))\s*:\s*([A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined)(?:<[^>]+>)?(?:\s*\|\s*(?:[A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined))*\s*(\{)/g,"$1$3"),s=s.replace(/(\b(?:function|class|interface|type|extends|implements)\s+\w+)\s*<[^<>()]*>/g,"$1"),s=s.replace(/(\b(?:defineProps|withDefaults|defineEmits|defineSlots|Array|Promise|Map|Set|Record|Partial|Required|Readonly|Pick|Omit|Exclude|Extract))\s*<[^<>()]*>/g,"$1"),s=s.replace(/(\w+)\s*<[A-Z][^<>()]*>\s*(?=\()/g,"$1"),s=s.replace(/\s+as\s+(?:const|[A-Za-z]\w*(?:\[\])?(?:\s*\|\s*\w+(?:\[\])?)*)/g,""),s=s.replace(/\s+satisfies\s+\w+(?:<[^>]*>)?/g,""),s=s.replace(/(\w|\)|\])\s*!(?!=)/g,"$1"),s=s.replace(/^\s*(?:export\s+)?(?:const\s+)?enum\s+\w+\s*\{[^}]*\}\s*$/gm,""),s=s.replace(/(?<=[\s=,(])<[A-Z]\w*(?:\[\])?>/g,""),s=s.replace(/\n\s*\n\s*\n/g,`
388
+
389
+ `),s}function Hl(e){return e.replace(/\s*(?:imported from|from)\s+(?:(['"])([^'"\r\n]+)\1|(\S+))/g,(s,...t)=>{let[,i,a]=t,h=i??a;return/(?:[/\\]packages[/\\]stx[/\\]|@stacksjs[/\\]stx[/\\])/.test(h)?"":s})}function Vl(e){return/cannot find module|cannot find package|could not resolve|module not found|failed to resolve/i.test(e)}function Ul(e){if(e instanceof SyntaxError)return!0;let s=e instanceof Error?e.message:String(e);return/SyntaxError|Unexpected (token|identifier|string|number|keyword|end of)|Unterminated|Expected .+ but found/i.test(s)}function Wl(e){if(!/is not defined|can't find variable/i.test(e))return!1;return!/\b(document|window|navigator|localStorage|sessionStorage|self)\b/.test(e)}var Ui=new Set;async function f(e,s,t,i={}){if(!e.trim())return;let a=S(),h=b(e,JSON.stringify(a)),c=Fi.get(h);if(c===void 0){try{let J=G({loader:"ts",target:"browser",define:a}),ee=e.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");ee=ee.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,""),c=J.transformSync(ee)}catch{c=zl(e)}Fi.set(h,c)}let v={exports:{}},E=v.exports,R=kt.cwd(),C={},O=[...c.matchAll(/require\s*\(\s*['"]([^'"]+)['"]\s*\)/g)||[]].map((J)=>J[1]).filter((J)=>!J.startsWith("node:")&&!["fs","path","os","child_process","crypto","http","https","url","util","stream","events","buffer","net","querystring","zlib","tls"].includes(J)),P=new Map;for(let J of O)try{if(J.startsWith(".")){C[J]=await import(Xe.resolve(Xe.dirname(t),J));continue}let ee=Xe.resolve(R,"node_modules",J),fe=Xe.join(ee,"package.json"),xe=JSON.parse(p("fs").readFileSync(fe,"utf8")),we=xe.main||"index.js";if(xe.exports){let ze=typeof xe.exports==="string"?xe.exports:xe.exports["."];if(typeof ze==="string")we=ze;else if(ze?.bun)we=ze.bun;else if(ze?.import)we=ze.import;else if(ze?.default)we=ze.default}C[J]=await import(Xe.resolve(ee,we))}catch(ee){if(J.startsWith("."))P.set(J,ee instanceof Error?ee.message:String(ee))}let M=(J)=>{if(C[J])return C[J];let ee=P.get(J);if(ee!==void 0)throw Error(`Cannot require '${J}' from ${t}: ${ee}`);return p(J)},I=s.props||{},N=(J)=>{if(!J)return I;let ee={};for(let[fe,xe]of Object.entries(J)){let we=I[fe];if(we!==void 0)ee[fe]=we;else if(typeof xe==="function")ee[fe]=xe();else ee[fe]=xe}return ee};for(let[J,ee]of Object.entries(I))Object.defineProperty(N,J,{value:ee,enumerable:!0,configurable:!0,writable:!0});let Z=(J,ee=!1)=>{if(J===void 0||J===null)return ee;if(typeof J==="string"){let fe=J.trim().toLowerCase();if(fe===""||fe==="true"||fe==="1"||fe==="on"||fe==="yes")return!0;if(fe==="false"||fe==="0"||fe==="off"||fe==="no")return!1;return!0}return Boolean(J)},U=(J,ee=0)=>{if(J===void 0||J===null)return ee;if(typeof J==="string"){let xe=J.trim();if(xe==="")return ee;let we=Number(xe);return Number.isFinite(we)?we:ee}let fe=Number(J);return Number.isFinite(fe)?fe:ee};for(let J of["name","length","caller","arguments"]){if(Object.prototype.hasOwnProperty.call(I,J))continue;try{Object.defineProperty(N,J,{value:void 0,enumerable:!1,configurable:!0,writable:!0})}catch{}}let V=(J)=>{if(!J)return I;let ee={...I};for(let[fe,xe]of Object.entries(J)){let we=xe&&typeof xe==="object"&&!Array.isArray(xe)?xe:{type:xe};if(ee[fe]===void 0&&we.default!==void 0)ee[fe]=typeof we.default==="function"?we.default():we.default}return ee},X=()=>s.slots||{},Y=(J,ee)=>{let fe={...J};for(let[xe,we]of Object.entries(ee))if(fe[xe]===void 0)if(typeof we==="function")fe[xe]=we();else fe[xe]=we;return fe},Q=(J)=>{let ee=()=>J;return ee.set=(fe)=>{},ee.update=(fe)=>{},ee},se=(J)=>{let ee,fe=!1;return()=>{if(!fe)try{ee=J(),fe=!0}catch{ee=void 0}return ee}},pe=(J)=>{},Se=(J)=>J(),Ee=(J)=>{},Be=(J)=>{},Ce=ds(s);function Ue(J){let ee=J||{};if(ee.title!==void 0||ee.description!==void 0)lt({title:ee.title,description:ee.description})}function Je(J){if(!J||typeof J!=="object")return;let ee=s.__stxClientPayload??{};Object.assign(ee,J),s.__stxClientPayload=ee}let mt=()=>{let J=s.__stxServeContext,ee=s.__stxServeSearch??J?.search??"",fe=J?.path??"",xe=Object.fromEntries(new URLSearchParams(ee)),we=s.query,ze=Object.keys(xe).length>0?xe:we??{},pt=ee||(Object.keys(ze).length>0?`?${new URLSearchParams(ze).toString()}`:"");return{params:s.params??{},query:ze,path:fe,name:"",fullPath:fe+pt,hash:"",matched:[]}},Hn=()=>({push:(J)=>{},replace:(J)=>{},back:()=>{},forward:()=>{},go:(J)=>{}}),ct=(J)=>{let ee=s.__stx_runtime_head||{};s.__stx_runtime_head=je(ee,ve(J||{},{known:Ss,source:"useHead()"}))},lt=(J)=>{ct(ks(J||{}))},ut=(J)=>({value:J}),Ot=(J)=>J,qs=(J)=>({value:typeof J==="function"?J():J}),ft=(J,ee)=>{},We=(J)=>{},Mt=(J)=>{},tn=(J)=>J?J():Promise.resolve(),Kn=(J)=>(ee,...fe)=>{},Dt=(J)=>{},Ge=(J,ee)=>{},jt=(J,ee)=>ee,Zn=()=>({value:"light"}),ht=()=>Q(!1),et=(J)=>Q(!1),Lt=()=>Q(!1),nn=()=>et("(prefers-color-scheme: dark)"),Bt=()=>et("(prefers-color-scheme: light)"),zt=()=>et("(prefers-reduced-motion: reduce)"),Xs=()=>et("(prefers-contrast: more)"),He={siteId:void 0,API_ENDPOINT:"",ANALYTICS_SITE_ID:void 0,location:{href:"",pathname:"",search:"",hash:"",origin:"",host:"",hostname:"",protocol:"https:",assign:()=>{},replace:()=>{},reload:()=>{}},localStorage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{}},sessionStorage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{}},fetch:globalThis.fetch,addEventListener:()=>{},removeEventListener:()=>{},setTimeout:()=>0,clearTimeout:()=>{},setInterval:()=>0,clearInterval:()=>{},requestAnimationFrame:()=>0,cancelAnimationFrame:()=>{},alert:()=>{},confirm:()=>!1,prompt:()=>null,getComputedStyle:()=>({}),matchMedia:()=>({matches:!1,addListener:()=>{},removeListener:()=>{}}),getDateRangeParams:()=>"",stx:{}},Wt=new Proxy(He,{get(J,ee){if(ee in J)return J[ee];return},set(J,ee,fe){return J[ee]=fe,!0}}),qn={getElementById:()=>null,querySelector:()=>null,querySelectorAll:()=>[],createElement:()=>({}),createTextNode:()=>({}),body:{},head:{},documentElement:{},addEventListener:()=>{},removeEventListener:()=>{}},tt=console;try{let J=Po(c,t),ee=new Set(Object.keys(I)),fe=Object.keys(s).filter((ne)=>!ee.has(ne)&&!gl.has(ne)&&Nt(ne)),xe=fe.map((ne)=>s[ne]);if(!fe.includes("__stxServeContext"))fe.push("__stxServeContext"),xe.push(void 0);if(!ee.has("cookies")){let ne=s.cookies??s.__stxServeContext?.cookies??{},ge=fe.indexOf("cookies");if(ge<0)fe.push("cookies"),xe.push(ne);else xe[ge]=ne}let we=new Set(["async","module","exports","require","params","window","document","console","state","derived","effect"]),ze=[],pt=[];for(let[ne,ge]of Object.entries(I)){if(!Nt(ne))continue;if(we.has(ne))continue;if(new RegExp(`(?:^|[\\s;{])(?:const|let|var|function)\\s+${ne}\\b`).test(J))continue;ze.push(ne),pt.push(ge)}let hn=hl(J).map((ne)=>`module.exports.${ne} = typeof ${ne} !== 'undefined' ? ${ne} : module.exports.${ne};`).join(`
390
+ `),xn=s.params??{},Ft=[],bn=[];for(let ne=0;ne<fe.length;ne++){if(fe[ne]==="params")continue;Ft.push(fe[ne]),bn.push(xe[ne])}let yn=[...un,...ze,...Ft],st=`return (async () => {
391
+ ${J}
392
+ ${hn}
393
+ return module.exports
394
+ })()`,xt=b(st,yn.join("\x00")),Ke=Vi.get(xt);if(!Ke)Ke=Function(...yn,st),Vi.set(xt,Ke);let Fe=s.__stx_options?.runtimeConfig;if(Fe||/\buse(?:Server)?RuntimeConfig\b/.test(c))await gn(s,t,Fe);let re=await Me(s.__stx_runtime_config??mn()??A(),()=>er(s,()=>Ke(v,E,M,I,N,Z,U,V,Y,Je,tr,Bo,ys,Q,se,pe,Se,Ee,Be,Ue,mt,Hn,ct,lt,Ce.setResponseStatus,Ce.setResponseHeader,Ce.notFound,ut,Ot,qs,ft,We,Mt,tn,Kn,Dt,X,Ge,jt,Zn,ht,et,Lt,nn,Bt,zt,Xs,Wt,qn,tt,He.confirm,He.alert,He.fetch,xn,...pt,...bn)));if(i.preserveExisting){for(let[ne,ge]of Object.entries(re))if(!(ne in s)||s[ne]===void 0)s[ne]=ge}else Object.assign(s,re);for(let[ne,ge]of Object.entries(I))if(!(ne in s))s[ne]=ge}catch(J){if(s.__stx_strict_hydration)throw J;let ee=Hl(J instanceof Error?J.message:String(J));if(Vl(ee))console.warn(`[stx] server <script> in ${t??"<unknown>"} imports a module that does not resolve, so every variable in that script is undefined. Cause: ${ee}`),i.onFailure?.({kind:"module-resolution",message:ee,error:J});else if(Ul(J))console.warn(`[stx] server <script> in ${t??"<unknown>"} does not parse, so every variable in that script is undefined. Cause: ${ee}`),i.onFailure?.({kind:"syntax",message:ee,error:J});else if(Wl(ee))console.warn(`[stx] server <script> in ${t??"<unknown>"} names something that does not exist, so every variable in that script is undefined. Optional chaining does not help here: an undefined identifier throws before the chain is reached. Cause: ${ee}`),i.onFailure?.({kind:"missing-binding",message:ee,error:J});else{let fe=`${t??"<unknown>"}\x00${ee}`;if(kt.env.STX_DEBUG||!Ui.has(fe))Ui.add(fe),console.warn(`[stx] server <script> in ${t??"<unknown>"} threw, so every variable in that script is undefined and anything that reads one renders empty. Cause: ${ee}`);i.onFailure?.({kind:"unknown",message:ee,error:J})}try{await Sl(c,s,t)}catch(fe){if(kt.env.STX_DEBUG){let xe=fe instanceof Error?fe.message:String(fe);console.warn(`[stx] fallback extraction also failed in ${t??"<unknown>"}: ${xe}`)}}}}function ql(e){let s=0,t=null,i=!1,a=!1;for(let h=0;h<e.length;h++){let c=e[h];if(t){if(c===t){if(t=null,i||s===0)a=!0}continue}if(c==="'"||c==='"'||c==="`"){t=c;continue}if(c==="{")s++;else if(c==="}")s--;else if(e.startsWith("from",h)&&s===0)i=!0}return t===null&&s===0&&a}var xl=/^(?:export\s+)?(?:const|let|var)\s+[A-Za-z_$][\w$]*(?:\s*,\s*[A-Za-z_$][\w$]*)*\s*;?$/;function Po(e,s){let t=s?Xe.dirname(s):kt.cwd(),i=kt.cwd(),a=e.split(`
395
+ `),h=[],c=0;while(c<a.length){let v=a[c].trim();if(v.startsWith("interface ")||v.startsWith("export interface ")||v.startsWith("type ")||v.startsWith("export type ")){if(v.includes("{")&&!v.includes("}")){let E=0;for(;c<a.length;c++){for(let R of a[c])if(R==="{")E++;else if(R==="}")E--;if(E<=0)break}}c++;continue}if(v.startsWith("definePageMeta(")){let E=0,R=!1,C=c;for(let M=c;M<a.length&&!R;M++){let I=null,N=!1,Z=a[M];for(let U=0;U<Z.length;U++){let V=Z[U];if(N){N=!1;continue}if(V==="\\"){N=!0;continue}if(I){if(V===I)I=null;continue}if(V==='"'||V==="'"||V==="`"){I=V;continue}if(V==="(")E++;else if(V===")"){if(E--,E===0){c=M+1,R=!0;break}}}}if(!R)c=a.length;let O=a.slice(C,c).join(`
396
+ `),P=[];for(let M of["title","description"]){let I=new RegExp(`\\b${M}\\s*:\\s*(['"\`])((?:\\\\.|(?!\\1)[^\\\\])*)\\1`).exec(O);if(I)P.push(`${M}: ${JSON.stringify(I[2])}`)}if(P.length>0)h.push(`useSeoMeta({ ${P.join(", ")} });`);continue}if(v.startsWith("import ")||v==="import"||v.startsWith("import{")||/^import['"]/.test(v)){let E=v,R=0;while(!ql(E)&&c+R+1<a.length)R++,E=`${E} ${a[c+R].trim()}`;c+=R;let C=E.match(/^import\s+(\w+)\s+from\s+['"](.+?)['"]/),O=E.match(/^import\s+\{([^}]*)\}\s+from\s+['"](.+?)['"]/),P=E.match(/^import\s*['"](.+?)['"]/),M=E,I=(N)=>{if(N.startsWith("."))return Xe.resolve(t,N);if(N.startsWith("~/")||N.startsWith("@/"))return Xe.resolve(i,N.slice(2));try{return Bun.resolveSync(N,t)}catch{return N}};if(C){let[,N,Z]=C,U=I(Z);h.push(`const ${N} = (await import('${U}')).default`),h.push(`module.exports.${N} = ${N};`)}else if(O){let[,N,Z]=O,U=I(Z),V=[],X=[],Y=ml.has(Z);for(let Q of N.split(",")){let se=Q.trim();if(!se)continue;let pe=se.split(/\s+as\s+/);if(pe.length===2){let[Se,Ee]=[pe[0].trim(),pe[1].trim()];if(Y&&Wi.has(Se)){h.push(`const ${Ee} = ${Se};`);continue}V.push(`${Se}: ${Ee}`),X.push(Ee)}else{if(Y&&Wi.has(se))continue;V.push(se),X.push(se)}}if(V.length>0)h.push(`const { ${V.join(", ")} } = await import('${U}')`);for(let Q of X)h.push(`module.exports.${Q} = ${Q};`)}else if(P){let N=I(P[1]);h.push(`await import('${N}')`)}else h.push(M);c++;continue}if(xl.test(v))h.push(a[c]),c++;else if(v.startsWith("export const ")||v.startsWith("export let ")||v.startsWith("export var ")){let E=Ki(a,c),{type:R,name:C,value:O}=E;h.push(`${R} ${C} = ${O};`),h.push(`module.exports.${C} = ${C};`),c=E.nextIndex}else if(v.startsWith("export function ")||v.startsWith("export async function ")){let E=Zs(a,c);h.push(E.functionCode),h.push(`module.exports.${E.name} = ${E.name};`),c=E.nextIndex}else if(v.startsWith("const ")||v.startsWith("let ")||v.startsWith("var ")){let E=Ki(a,c),{type:R,name:C,value:O}=E;h.push(`${R} ${C} = ${O};`),h.push(`module.exports.${C} = ${C};`),c=E.nextIndex}else if(v.startsWith("function ")||v.startsWith("async function ")){let E=Zs(a,c);h.push(E.functionCode),h.push(`module.exports.${E.name} = ${E.name};`),c=E.nextIndex}else if(v.startsWith("export default function ")||v.startsWith("export default async function ")){let E=a[c].replace(/^(\s*)export\s+default\s+/,"$1"),R=[...a];R[c]=E;let C=Zs(R,c);if(h.push(C.functionCode),C.name)h.push(`module.exports.default = ${C.name};`);c=C.nextIndex}else if(v.startsWith("export default ")){let E=v.replace(/^export\s+default\s+/,"").replace(/;$/,"");h.push(`module.exports.default = ${E};`),c++}else if(v.startsWith("class ")||v.startsWith("export class ")){let E=v.match(/(?:export\s+)?class\s+(\w+)/);if(E){let R=E[1],C=a[c].replace(/^export\s+/,""),O=0,P=c;for(;P<a.length;P++){let M=a[P];for(let I of M)if(I==="{")O++;else if(I==="}")O--;if(P>c)C+=`
397
+ `+M;if(O<=0&&P>=c)break}h.push(C),h.push(`module.exports.${R} = ${R};`),c=P+1}else h.push(v),c++}else if(v.includes("module.exports"))h.push(v),c++;else if(v.trim()&&!v.startsWith("//"))h.push(v),c++;else c++}return bl(h.join(`
398
+ `),t,i)}function bl(e,s,t){let i=e.length,a="",h=0,c=null,v=!1,E=!1,R=0;while(h<i){let C=e[h],O=e[h+1];if(v){if(a+=C,C===`
399
+ `)v=!1;h++;continue}if(E){if(a+=C,C==="*"&&O==="/"){a+=O,h+=2,E=!1;continue}h++;continue}if(!c&&C==="/"&&O==="/"){v=!0,a+=C,h++;continue}if(!c&&C==="/"&&O==="*"){E=!0,a+=C,h++;continue}if(c){if(a+=C,C==="\\"){a+=O,h+=2;continue}if(C===c&&c!=="`"){c=null,h++;continue}if(c==="`"){if(C==="$"&&O==="{"){R++,a+=O,h+=2;continue}if(C==="`"){c=null,h++;continue}}h++;continue}if(R>0){if(C==="{")R++;else if(C==="}")R--}if(C==='"'||C==="'"||C==="`"){c=C,a+=C,h++;continue}if(C==="a"&&e.startsWith("await",h)){let P=yl(e,h);if(P){let{quote:M,path:I,end:N}=P;if(I.startsWith(".")||I.startsWith("~/")||I.startsWith("@/")){let Z=I.startsWith(".")?Xe.resolve(s,I):Xe.resolve(t,I.slice(2));a+=`await import(${M}${Z}${M})`,h=N;continue}}}a+=C,h++}return a}function yl(e,s){let t=s+5;if(t>=e.length)return null;if(!/\s/.test(e[t]))return null;while(t<e.length&&/\s/.test(e[t]))t++;if(!e.startsWith("import",t))return null;t+=6;while(t<e.length&&/\s/.test(e[t]))t++;if(e[t]!=="(")return null;t++;while(t<e.length&&/\s/.test(e[t]))t++;let i=e[t];if(i!=="'"&&i!=='"')return null;t++;let a=t;while(t<e.length&&e[t]!==i)if(e[t]==="\\")t+=2;else t++;if(t>=e.length)return null;let h=e.slice(a,t);t++;while(t<e.length&&/\s/.test(e[t]))t++;if(e[t]!==")")return null;return{quote:i,path:h,end:t+1}}function Ji(e,s){let t=e[s];if(t!=="{"&&t!=="[")return null;let a=w(e,t,t==="{"?"}":"]",s);if(a===-1)return null;return{pattern:e.slice(s,a+1),endPos:a+1}}function Gi(e){let s=[],t=e.slice(1,-1).trim();if(!t)return s;let i=0,a=0,h="";while(i<t.length){let c=t[i];if(c==="{"||c==="["){let v=a===0?Ji(t,i):null;if(v){s.push(...Gi(v.pattern)),i=v.endPos,h="";continue}a++}else if(c==="}"||c==="]")a--;if(a>0){i++;continue}if(c===","){if(h.trim())s.push(h.trim());h="",i++;continue}if(c===":"){h="",i++;continue}if(c==="="){if(h.trim())s.push(h.trim());h="",i++;while(i<t.length&&t[i]!==","&&a===0){if(t[i]==="{"||t[i]==="[")a++;else if(t[i]==="}"||t[i]==="]")a--;i++}continue}if(/[\w$]/.test(c))h+=c;i++}if(h.trim())s.push(h.trim());return s}function Gl(e){let s=/^(?:export\s+)?(const|let|var)\s+([A-Za-z_$][\w$]*)/.exec(e);if(!s)return null;let t=s[0].length,i=(a)=>a===" "||a==="\t";while(t<e.length&&i(e[t]))t++;if(e[t]===":"){let a=0,h=null;t++;for(;t<e.length;t++){let c=e[t];if(h){if(c==="\\"){t++;continue}if(c===h)h=null;continue}if(c==="'"||c==='"'||c==="`"){h=c;continue}if(c==="("||c==="["||c==="{"||c==="<"){a++;continue}if(c===")"||c==="]"||c==="}"||c===">"){a--;continue}if(c==="="&&a<=0){let v=e[t+1],E=e[t-1];if(v!=="="&&v!==">"&&E!=="="&&E!=="!"&&E!=="<"&&E!==">")break}}if(e[t]!=="=")return null}while(t<e.length&&i(e[t]))t++;if(e[t]!=="=")return null;return{type:s[1],name:s[2],value:e.slice(t+1).trim()}}function Hi(e,s,t,i){let a=null,h=!1;for(let c of e){if(h){h=!1;continue}if(c==="\\"){h=!0;continue}if(a){if(c===a)a=null;continue}if(c==="'"||c==='"'||c==="`"){a=c;continue}if(c===s)i++;else if(c===t)i--}return i}function Ki(e,s){let t=e[s].trim(),i=Gl(t),a=i?[t,i.type,i.name,i.value]:null;if(!a){let C=t.match(/^(?:export\s+)?(const|let|var)\s+/);if(C){let O=t.slice(C[0].length),P=s;if(O.startsWith("{")||O.startsWith("[")){let I=O[0],N=I==="{"?"}":"]",Z=Hi(O,I,N,0),U=O;for(let V=s+1;V<e.length&&Z>0;V++)U+=` ${e[V].trim()}`,P=V,Z=Hi(e[V],I,N,Z);if(Z>0)U=O,P=s;O=U}let M=Ji(O,0);if(M){let I=C[1],N=M.pattern,Z=O.slice(M.endPos).trim();if(Z.startsWith("=")){let U=Z.slice(1).trim(),V=U,X=Math.max(P,s);if(Zi(U)){let pe=qi(e,X,U);V=pe.value,X=pe.nextIndex}else X=X+1;V=V.trim().replace(/;$/,"");let Y=Gi(N),Q=`__stx_src_${s}`,se=Y.map((pe)=>`module.exports.${pe} = ${pe};`).join(`
400
+ `);return{type:I,name:Q,value:`${V}; ${I} ${N} = ${Q};
401
+ ${se}`,nextIndex:X}}}}throw Error(`Failed to parse variable declaration: ${t}`)}let[,h,c,v]=a,E=v,R=s;if(Zi(v)){let C=qi(e,s,v);E=C.value,R=C.nextIndex}else R=s+1;while(R<e.length){let C=e[R].trim();if(C.startsWith(".")||C.startsWith("?."))E+=`
402
+ ${e[R]}`,R++;else break}return E=E.trim().replace(/;$/,""),{type:h,name:c,value:E,nextIndex:R}}function Zs(e,s){let t=e[s].trim(),i=t.match(/^(?:export\s+)?(?:async\s+)?function\s+(\w+)/);if(!i)throw Error(`Failed to parse function declaration: ${t}`);let[,a]=i,h=t.replace(/^export\s+/,""),c=s;if(_l(t)){let v=wl(e,s,h);h=v.functionCode,c=v.nextIndex}else c=s+1;return{name:a,functionCode:h,nextIndex:c}}function Zi(e){let s=e.trim();if(s.startsWith("{"))return w(s,"{","}",0)===-1;if(s.startsWith("["))return w(s,"[","]",0)===-1;return!Yi(s)}function Yi(e){let s={paren:0,bracket:0,brace:0},t=null,i=0;for(let a=0;a<e.length;a++){let h=e[a];if((a>0?e[a-1]:"")==="\\"&&t)continue;if((h==='"'||h==="'")&&!t){t=h;continue}if(h===t&&t!=="`"){t=null;continue}if(h==="`"&&!t){t="`";continue}if(h==="`"&&t==="`"&&i===0){t=null;continue}if(t==="`"&&h==="$"&&e[a+1]==="{"){i++,a++;continue}if(i>0&&h==="{"){i++;continue}if(i>0&&h==="}"){i--;continue}if(t)continue;if(h==="(")s.paren++;else if(h===")")s.paren--;else if(h==="[")s.bracket++;else if(h==="]")s.bracket--;else if(h==="{")s.brace++;else if(h==="}")s.brace--}return s.paren===0&&s.bracket===0&&s.brace===0&&t===null}function Qi(e){let s=e.indexOf("(");if(s===-1)return e.indexOf("{");let t=w(e,"(",")",s);if(t===-1)return-1;return e.indexOf("{",t)}function _l(e){let s=Qi(e);if(s===-1)return!0;return w(e,"{","}",s)===-1}function qi(e,s,t){let i=t,a=s+1;while(a<e.length&&!Yi(i)){let h=e[a];i+=`
403
+ ${h}`,a++}while(a<e.length){let h=e[a].trim();if(h.startsWith(".")||h.startsWith("?."))i+=`
404
+ ${e[a]}`,a++;else break}return{value:i,nextIndex:a}}function wl(e,s,t){let i=t,a=s+1;while(a<e.length){let h=Qi(i);if(h!==-1){if(w(i,"{","}",h)!==-1)break}let c=e[a];i+=`
405
+ ${c}`,a++}return{functionCode:i,nextIndex:a}}function Xi(e,s){let t=l(e,s)??l(`(${e})`,s);if(t!==void 0)return t;if(!/\bprocess\b/.test(e))return;let i={...s,process:Object.freeze({env:{...kt.env}})},a=Object.keys(i).filter(Nt),h=a.map((c)=>i[c]);try{return Function(...a,`'use strict'; return (${e});`)(...h)}catch{try{return Function(...a,`'use strict'; return ${e};`)(...h)}catch{return}}}async function Sl(e,s,t){let i=e.matchAll(/export\s+(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:export\s+|$))/g);for(let h of i){let[,,c,v]=h;try{let E=v.trim().replace(/;$/,""),R=Xi(E,s);if(R!==void 0)s[c]=R}catch(E){console.warn(`Failed to parse export ${c} in fallback:`,E)}}let a=e.matchAll(/(?:^|\n)\s*(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:(?:const|let|var|function|export)\s+|$))/g);for(let h of a){let[,,c,v]=h;if(!(c in s))try{let E=v.trim().replace(/;$/,""),R=Xi(E,s);if(R!==void 0)s[c]=R}catch{}}}function Va(e){let s=e.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),t=s?s[1]:"",i=s?e.replace(/<script\b[^>]*>[\s\S]*?<\/script>/i,""):e;return{scriptContent:t,templateWithoutScript:i}}function Ua(e){let s=e.trim();if(!s)return!1;return/(?:const|let|var|function)\s+\w+/.test(s)}
406
+ export{Te,Ye,L,ns,rs,j,ss,os,is,So,ko,_o,Ea,rn,r,sn,B,Ct,te,y,Ta,b,rr,as,he,S,$e,ie,sr,W,on,Re,ae,$a,ce,q,or,cs,le,Et,Tt,ue,Ze,ir,ar,$t,Co,Eo,Fl,Ae,Ra,Aa,Pa,To,Ia,ls,$o,Oa,Na,Da,Ro,an,us,cn,Rt,At,Ma,ds,La,ln,cr,ps,gs,ja,Ao,Ba,Fa,za,Ha,un,zl,Hl,Vl,Ul,Wl,f,ql,Po,Gl,Va,Ua,Io,Oo,Kl,Pt,Wa,No,qa,$p,Pe,dn,Ie,Xl,Jl,Yl,Zl,Ql,ms,eu,Oe,G,Ne,tu,lr,nu,Ga,Do,De,n,pn,Ka,g,de,Rp,Xa,Ja,Ya,Mo,hs,ru,Ap,su,Pp,It,m,F,K,fn,ye,ou,Lo,iu,Ip,k,au,Op,_,Np};