@stacksjs/stx 0.2.819 → 0.2.820

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 (211) hide show
  1. package/dist/{chunk-p7hy0seh.js → chunk-01cwrww2.js} +1 -1
  2. package/dist/{chunk-nsxjt6h3.js → chunk-06hc6rs6.js} +1 -1
  3. package/dist/{chunk-skht06a2.js → chunk-076fj387.js} +1 -1
  4. package/dist/chunk-09285y4b.js +2 -0
  5. package/dist/chunk-0e0z4ab6.js +2 -0
  6. package/dist/{chunk-12sd0ep5.js → chunk-0p797a25.js} +15 -15
  7. package/dist/{chunk-g7mjv276.js → chunk-1f7d1c0y.js} +2 -2
  8. package/dist/{chunk-brbqz5he.js → chunk-2235krey.js} +13 -13
  9. package/dist/{chunk-fmawgk87.js → chunk-2nj9aewf.js} +1 -1
  10. package/dist/{chunk-m7hfcxt3.js → chunk-2vqpz4qv.js} +2 -2
  11. package/dist/{chunk-dq9djbgq.js → chunk-30rpspzt.js} +4 -4
  12. package/dist/{chunk-ax16vnn5.js → chunk-36sb6j2v.js} +6 -6
  13. package/dist/{chunk-1hg0zb3p.js → chunk-3axb6t08.js} +2 -2
  14. package/dist/chunk-3bf48zrh.js +2 -0
  15. package/dist/chunk-3kaw5zjm.js +2 -0
  16. package/dist/chunk-3na8kkec.js +2 -0
  17. package/dist/{chunk-mr2ke5km.js → chunk-3yh6y00f.js} +6 -6
  18. package/dist/{chunk-m9dyqae7.js → chunk-3zhwcckc.js} +5 -5
  19. package/dist/chunk-49hywhze.js +2 -0
  20. package/dist/{chunk-1a8qtvs1.js → chunk-4mj9dem1.js} +2 -2
  21. package/dist/chunk-4qsamkyc.js +2 -0
  22. package/dist/{chunk-rccv14mn.js → chunk-4t4af1mb.js} +5 -5
  23. package/dist/{chunk-e4d0jgcw.js → chunk-5e88021j.js} +6 -6
  24. package/dist/{chunk-vmxzktdr.js → chunk-67kbsav0.js} +1 -1
  25. package/dist/chunk-6h1qa3hw.js +2 -0
  26. package/dist/{chunk-xc7nynb9.js → chunk-6qvn1h09.js} +3 -3
  27. package/dist/{chunk-k3t72x38.js → chunk-76eh43e9.js} +2 -2
  28. package/dist/chunk-77s1kvzj.js +2 -0
  29. package/dist/chunk-7ffmz1fb.js +2 -0
  30. package/dist/chunk-7pz76f28.js +2 -0
  31. package/dist/{chunk-6s9bk98p.js → chunk-7yb82rm6.js} +2 -2
  32. package/dist/{chunk-72jt897s.js → chunk-8ttmzcxb.js} +12 -12
  33. package/dist/{chunk-035m9ada.js → chunk-8w9spdbn.js} +4 -4
  34. package/dist/{chunk-6a0ekt1n.js → chunk-90p175a7.js} +3 -3
  35. package/dist/chunk-91s9c9wa.js +2 -0
  36. package/dist/{chunk-e3t2bqyf.js → chunk-9gmceny5.js} +5 -5
  37. package/dist/chunk-a8fy7jv8.js +2 -0
  38. package/dist/{chunk-4fbg7gq8.js → chunk-akj26p4b.js} +2 -2
  39. package/dist/{chunk-93f6kwht.js → chunk-aqh663ef.js} +2 -2
  40. package/dist/{chunk-1p3vmy65.js → chunk-atszywea.js} +4 -4
  41. package/dist/chunk-b22yj5j5.js +2 -0
  42. package/dist/{chunk-b9d70mgr.js → chunk-b4x5ndt9.js} +3 -3
  43. package/dist/{chunk-j476jghg.js → chunk-b89wsq8r.js} +1 -1
  44. package/dist/{chunk-zhvmcj78.js → chunk-bfbh0hfn.js} +5 -5
  45. package/dist/{chunk-cbt1dchd.js → chunk-bfztkcfe.js} +4 -4
  46. package/dist/{chunk-3dg2zg8d.js → chunk-bkdfkm10.js} +3 -3
  47. package/dist/{chunk-0rjcbqk3.js → chunk-brhas9mp.js} +2 -2
  48. package/dist/{chunk-x46hqa74.js → chunk-bsg90smr.js} +4 -4
  49. package/dist/{chunk-1tzqqr0p.js → chunk-bt0amey5.js} +2 -2
  50. package/dist/{chunk-1rvgv1fr.js → chunk-btxnrqxf.js} +5 -5
  51. package/dist/chunk-c1e45rtv.js +2 -0
  52. package/dist/chunk-cckq47hd.js +2 -0
  53. package/dist/{chunk-tj6zvs8f.js → chunk-cxz4cdcn.js} +2 -2
  54. package/dist/{chunk-mbhvf0sv.js → chunk-d6d2s7n6.js} +2 -2
  55. package/dist/chunk-det3z847.js +2 -0
  56. package/dist/{chunk-gcje06er.js → chunk-e4jwhmpb.js} +30 -30
  57. package/dist/chunk-ec2f30f7.js +3 -0
  58. package/dist/{chunk-ngh1aeff.js → chunk-exghjgzk.js} +4 -4
  59. package/dist/{chunk-mjg9cx5a.js → chunk-f0txsdpa.js} +3 -3
  60. package/dist/{chunk-0s93s6ep.js → chunk-ftfjwjes.js} +3 -3
  61. package/dist/chunk-g8kcg8v2.js +2 -0
  62. package/dist/chunk-g8nqmnb7.js +2 -0
  63. package/dist/{chunk-hwcfgs3e.js → chunk-gjf8cjdt.js} +3 -3
  64. package/dist/{chunk-xka9fdye.js → chunk-gywyr2x3.js} +2 -2
  65. package/dist/{chunk-p3dc6rg2.js → chunk-h1hm975m.js} +6 -6
  66. package/dist/chunk-h67pm636.js +2 -0
  67. package/dist/{chunk-jdddw8en.js → chunk-h7fgk4ew.js} +2 -2
  68. package/dist/chunk-hb8jxg45.js +2 -0
  69. package/dist/{chunk-s6mte5vy.js → chunk-hbdzhpy1.js} +4 -4
  70. package/dist/chunk-he6tejhc.js +2 -0
  71. package/dist/chunk-hfgzqapw.js +2 -0
  72. package/dist/chunk-j0hrk24j.js +2 -0
  73. package/dist/chunk-j2fgv2pe.js +2 -0
  74. package/dist/{chunk-vhzngsmd.js → chunk-j4cjn4m1.js} +79 -79
  75. package/dist/{chunk-k3zcadcc.js → chunk-j737tnvt.js} +4 -4
  76. package/dist/chunk-j79bjm48.js +2 -0
  77. package/dist/chunk-jjbdtj4w.js +2 -0
  78. package/dist/{chunk-nqdh7z2d.js → chunk-jzgyrxye.js} +1 -1
  79. package/dist/{chunk-bnewgd23.js → chunk-k0bztfk3.js} +2 -2
  80. package/dist/chunk-k0xdvegc.js +2 -0
  81. package/dist/{chunk-9gwhs0gk.js → chunk-k81trehg.js} +2 -2
  82. package/dist/chunk-m3wk6b1r.js +2 -0
  83. package/dist/chunk-m7nsk6fb.js +2 -0
  84. package/dist/chunk-m934bzg2.js +2 -0
  85. package/dist/{chunk-znx5m1jv.js → chunk-me6kgvsm.js} +1 -1
  86. package/dist/chunk-mmeck545.js +2 -0
  87. package/dist/{chunk-s9b6abkb.js → chunk-mwxbdpb1.js} +2 -2
  88. package/dist/chunk-mz6qjee1.js +2 -0
  89. package/dist/chunk-mzvccryg.js +2 -0
  90. package/dist/chunk-n4pzq9k7.js +2 -0
  91. package/dist/{chunk-baj6w8ja.js → chunk-n7arptzc.js} +2 -2
  92. package/dist/{chunk-7c5b0th8.js → chunk-nb5d00dz.js} +10 -10
  93. package/dist/{chunk-v041eh5f.js → chunk-nype1b17.js} +3 -3
  94. package/dist/{chunk-1ae3megp.js → chunk-p1fpferp.js} +6 -6
  95. package/dist/chunk-p6e3zz9e.js +2 -0
  96. package/dist/{chunk-4gg9594a.js → chunk-p77cnteg.js} +5 -5
  97. package/dist/chunk-prt4ntb0.js +2 -0
  98. package/dist/{chunk-sxad7x2s.js → chunk-pvj0bpqg.js} +4 -4
  99. package/dist/chunk-q5bct2ks.js +2 -0
  100. package/dist/{chunk-rpen41w3.js → chunk-q7zwv88b.js} +2 -2
  101. package/dist/{chunk-4jaet63w.js → chunk-qe5h58mx.js} +2 -2
  102. package/dist/{chunk-gtd6qs1r.js → chunk-qj4r08jb.js} +2 -2
  103. package/dist/{chunk-sh1hbhhb.js → chunk-qz3fdmrc.js} +3 -3
  104. package/dist/chunk-r2hjn9ds.js +2 -0
  105. package/dist/{chunk-he8rmsdq.js → chunk-rm1510e0.js} +12 -12
  106. package/dist/chunk-rtk813jv.js +2 -0
  107. package/dist/chunk-s2zsa16d.js +2 -0
  108. package/dist/chunk-s53hy1gs.js +2 -0
  109. package/dist/{chunk-ek5ynvqh.js → chunk-sb6jph84.js} +1 -1
  110. package/dist/chunk-sddp2398.js +2 -0
  111. package/dist/chunk-sj24g10j.js +2 -0
  112. package/dist/chunk-sv4emtcj.js +2 -0
  113. package/dist/chunk-t6y9ar2j.js +2 -0
  114. package/dist/chunk-t9byym6f.js +2 -0
  115. package/dist/chunk-t9rj27hc.js +2 -0
  116. package/dist/chunk-tcyvwy8p.js +2 -0
  117. package/dist/chunk-tg18j1yf.js +2 -0
  118. package/dist/chunk-tj7dh2dz.js +2 -0
  119. package/dist/{chunk-j8r0am39.js → chunk-tksjakyv.js} +1 -1
  120. package/dist/chunk-vafxrky2.js +2 -0
  121. package/dist/chunk-vyb4sxh9.js +42 -0
  122. package/dist/{chunk-6n11z33h.js → chunk-vzbyn4nh.js} +5 -5
  123. package/dist/chunk-w04h1t4t.js +2 -0
  124. package/dist/{chunk-gahpv8ce.js → chunk-wc7dn3mr.js} +2 -2
  125. package/dist/{chunk-f6nk205v.js → chunk-wceg59n0.js} +1 -1
  126. package/dist/{chunk-t2sg2tp2.js → chunk-wf0n9gpj.js} +4 -4
  127. package/dist/{chunk-c5vzr1va.js → chunk-wpendr22.js} +2 -2
  128. package/dist/chunk-wps6y6n5.js +2 -0
  129. package/dist/{chunk-427mhgje.js → chunk-wy0gghvh.js} +1 -1
  130. package/dist/chunk-x30gh7vt.js +2 -0
  131. package/dist/{chunk-m7kct2sg.js → chunk-xc0kwms2.js} +4 -4
  132. package/dist/{chunk-jw7cakxt.js → chunk-xdbwghty.js} +9 -9
  133. package/dist/{chunk-em2yy1te.js → chunk-xpy9yjyx.js} +6 -6
  134. package/dist/{chunk-9egd7tx3.js → chunk-y8p85kcj.js} +2 -2
  135. package/dist/{chunk-7xs45trj.js → chunk-y9bj3566.js} +2 -2
  136. package/dist/chunk-ybpysahk.js +2 -0
  137. package/dist/{chunk-jgj16jmg.js → chunk-ydr5y7va.js} +2 -2
  138. package/dist/chunk-ytyyfvke.js +2 -0
  139. package/dist/{chunk-8dmey36n.js → chunk-z23arg8m.js} +2 -2
  140. package/dist/chunk-z845f18k.js +2 -0
  141. package/dist/{chunk-e758jz81.js → chunk-zbyfxcrr.js} +6 -6
  142. package/dist/{chunk-sjd6rt97.js → chunk-zefkd9t8.js} +4 -4
  143. package/dist/cli.js +19 -19
  144. package/dist/craft-entry.js +2 -2
  145. package/dist/craft.js +2 -2
  146. package/dist/html-masking.d.ts +10 -0
  147. package/dist/html-masking.js +50 -0
  148. package/dist/pwa.js +3 -3
  149. package/dist/server-bindings.js +28 -30
  150. package/dist/ssg.js +4 -4
  151. package/package.json +5 -5
  152. package/dist/chunk-03mtfndv.js +0 -2
  153. package/dist/chunk-0633xsmx.js +0 -2
  154. package/dist/chunk-0wrmcexg.js +0 -2
  155. package/dist/chunk-18qxd18d.js +0 -2
  156. package/dist/chunk-1cd0w20k.js +0 -2
  157. package/dist/chunk-2k3ga51z.js +0 -2
  158. package/dist/chunk-54kn2jtw.js +0 -2
  159. package/dist/chunk-54mc7876.js +0 -2
  160. package/dist/chunk-6e76tz09.js +0 -2
  161. package/dist/chunk-72w08sh9.js +0 -2
  162. package/dist/chunk-7p7hdn42.js +0 -2
  163. package/dist/chunk-88mhhbqj.js +0 -2
  164. package/dist/chunk-9736003n.js +0 -2
  165. package/dist/chunk-9b52cnzm.js +0 -2
  166. package/dist/chunk-9bhvh2dc.js +0 -2
  167. package/dist/chunk-9y1dm510.js +0 -2
  168. package/dist/chunk-a4yzet7p.js +0 -2
  169. package/dist/chunk-abzrvxct.js +0 -2
  170. package/dist/chunk-avbvedyx.js +0 -2
  171. package/dist/chunk-cvq4bz8y.js +0 -2
  172. package/dist/chunk-d7p5jr31.js +0 -2
  173. package/dist/chunk-dh1f8ga0.js +0 -2
  174. package/dist/chunk-dzp2a775.js +0 -2
  175. package/dist/chunk-f86ehf7n.js +0 -2
  176. package/dist/chunk-fn2cqvb1.js +0 -2
  177. package/dist/chunk-fzj3e3zk.js +0 -2
  178. package/dist/chunk-gsc617cx.js +0 -2
  179. package/dist/chunk-h8kbcz9t.js +0 -2
  180. package/dist/chunk-hx575xy8.js +0 -2
  181. package/dist/chunk-j58z3y2g.js +0 -2
  182. package/dist/chunk-j5t40n2g.js +0 -2
  183. package/dist/chunk-jcz6rd9n.js +0 -2
  184. package/dist/chunk-k5nd8zqh.js +0 -2
  185. package/dist/chunk-kz6qw9fm.js +0 -42
  186. package/dist/chunk-m5cdkb11.js +0 -2
  187. package/dist/chunk-mcgqgheq.js +0 -2
  188. package/dist/chunk-mz1mgfq3.js +0 -3
  189. package/dist/chunk-n1tbc7da.js +0 -2
  190. package/dist/chunk-n7dm6prj.js +0 -2
  191. package/dist/chunk-nknpr8cy.js +0 -2
  192. package/dist/chunk-nqn4dvqd.js +0 -2
  193. package/dist/chunk-nt5dh56c.js +0 -2
  194. package/dist/chunk-p04dabqm.js +0 -2
  195. package/dist/chunk-pe89ztq6.js +0 -2
  196. package/dist/chunk-pe9npaby.js +0 -2
  197. package/dist/chunk-pmq2pdr9.js +0 -2
  198. package/dist/chunk-r2v042ym.js +0 -2
  199. package/dist/chunk-r3zmbpv2.js +0 -2
  200. package/dist/chunk-r57s8jqs.js +0 -2
  201. package/dist/chunk-rjzp7za8.js +0 -2
  202. package/dist/chunk-sata7rh2.js +0 -2
  203. package/dist/chunk-tsb5h4e2.js +0 -2
  204. package/dist/chunk-v7h8vd9n.js +0 -2
  205. package/dist/chunk-v8h2kns0.js +0 -2
  206. package/dist/chunk-vvcfrsjg.js +0 -2
  207. package/dist/chunk-vyw40ym7.js +0 -2
  208. package/dist/chunk-whq40bdm.js +0 -2
  209. package/dist/chunk-xsck49x5.js +0 -2
  210. package/dist/chunk-z0c35c5c.js +0 -2
  211. package/dist/chunk-zwp7n01x.js +0 -2
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import"./chunk-72jt897s.js";import"./chunk-1tzqqr0p.js";import"./chunk-r9e0r6jx.js";import"./chunk-vhzngsmd.js";import"./chunk-m7hfcxt3.js";import"./chunk-bnewgd23.js";import"./chunk-9gwhs0gk.js";import"./chunk-3dg2zg8d.js";import{c}from"./chunk-0rjcbqk3.js";import u from"fs";import l from"path";async function d(e,t={}){let s=Date.now(),n={total:0,passed:0,failed:0,new:0,failures:[],duration:0},i=t.snapshotDir||c(e.root,"story","snapshots");await u.promises.mkdir(i,{recursive:!0});let r=e.storyFiles;if(t.filter&&t.filter.length>0)r=r.filter((a)=>t.filter.some((o)=>a.fileName.toLowerCase().includes(o.toLowerCase())));for(let a of r)await h(a,i,t,n);return n.duration=Date.now()-s,n}async function h(e,t,s,n){let i=e.story;if(!i)return;for(let r of i.variants){n.total++;let a=l.join(t,`${e.id}-${r.id}.snap`),o=g(r.source||""),f=await w(a);if(s.update||!f){let p={storyId:e.id,variantId:r.id,component:e.fileName,timestamp:Date.now(),hash:o};if(await u.promises.writeFile(a,JSON.stringify(p,null,2)),!f)n.new++;n.passed++}else try{let p=await u.promises.readFile(a,"utf-8"),m=JSON.parse(p);if(m.hash===o)n.passed++;else n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:"Snapshot mismatch",difference:y(m.hash,o)})}catch(p){n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:`Error reading snapshot: ${p}`})}}}async function x(e,t={}){return(await d(e,{...t,update:!0})).total}function g(e){let t=0;for(let s=0;s<e.length;s++){let n=e.charCodeAt(s);t=(t<<5)-t+n,t=t&t}return t.toString(16)}function y(e,t){if(e===t)return 0;let s=Math.abs(Number.parseInt(e,16)-Number.parseInt(t,16));return Math.min(s/1e6,1)}async function w(e){try{return await u.promises.access(e),!0}catch{return!1}}function F(e){let t=[];if(t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(" STX Story Visual Regression Tests"),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),e.failures.length>0){t.push(" \u274C Failures:"),t.push("");for(let s of e.failures){if(t.push(` \u2022 ${s.component} / ${s.variantId}`),t.push(` ${s.message}`),s.difference!==void 0)t.push(` Difference: ${(s.difference*100).toFixed(2)}%`);t.push("")}}if(t.push(" Summary:"),t.push(` Total: ${e.total}`),t.push(` Passed: ${e.passed} \u2713`),t.push(` Failed: ${e.failed} \u2717`),e.new>0)t.push(` New: ${e.new} \u26A1`);return t.push(` Time: ${e.duration}ms`),t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),t.join(`
2
+ import"./chunk-8ttmzcxb.js";import"./chunk-bt0amey5.js";import"./chunk-r9e0r6jx.js";import"./chunk-j4cjn4m1.js";import"./chunk-2vqpz4qv.js";import"./chunk-k0bztfk3.js";import"./chunk-k81trehg.js";import"./chunk-bkdfkm10.js";import{c}from"./chunk-brhas9mp.js";import u from"fs";import l from"path";async function d(e,t={}){let s=Date.now(),n={total:0,passed:0,failed:0,new:0,failures:[],duration:0},i=t.snapshotDir||c(e.root,"story","snapshots");await u.promises.mkdir(i,{recursive:!0});let r=e.storyFiles;if(t.filter&&t.filter.length>0)r=r.filter((a)=>t.filter.some((o)=>a.fileName.toLowerCase().includes(o.toLowerCase())));for(let a of r)await h(a,i,t,n);return n.duration=Date.now()-s,n}async function h(e,t,s,n){let i=e.story;if(!i)return;for(let r of i.variants){n.total++;let a=l.join(t,`${e.id}-${r.id}.snap`),o=g(r.source||""),f=await w(a);if(s.update||!f){let p={storyId:e.id,variantId:r.id,component:e.fileName,timestamp:Date.now(),hash:o};if(await u.promises.writeFile(a,JSON.stringify(p,null,2)),!f)n.new++;n.passed++}else try{let p=await u.promises.readFile(a,"utf-8"),m=JSON.parse(p);if(m.hash===o)n.passed++;else n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:"Snapshot mismatch",difference:y(m.hash,o)})}catch(p){n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:`Error reading snapshot: ${p}`})}}}async function x(e,t={}){return(await d(e,{...t,update:!0})).total}function g(e){let t=0;for(let s=0;s<e.length;s++){let n=e.charCodeAt(s);t=(t<<5)-t+n,t=t&t}return t.toString(16)}function y(e,t){if(e===t)return 0;let s=Math.abs(Number.parseInt(e,16)-Number.parseInt(t,16));return Math.min(s/1e6,1)}async function w(e){try{return await u.promises.access(e),!0}catch{return!1}}function F(e){let t=[];if(t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(" STX Story Visual Regression Tests"),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),e.failures.length>0){t.push(" \u274C Failures:"),t.push("");for(let s of e.failures){if(t.push(` \u2022 ${s.component} / ${s.variantId}`),t.push(` ${s.message}`),s.difference!==void 0)t.push(` Difference: ${(s.difference*100).toFixed(2)}%`);t.push("")}}if(t.push(" Summary:"),t.push(` Total: ${e.total}`),t.push(` Passed: ${e.passed} \u2713`),t.push(` Failed: ${e.failed} \u2717`),e.new>0)t.push(` New: ${e.new} \u26A1`);return t.push(` Time: ${e.duration}ms`),t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),t.join(`
3
3
  `)}export{F as formatTestResults,d as runVisualTests,x as updateSnapshots};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{lt,ut,dt}from"./chunk-7qk4exw1.js";import{Vt,Ut,ct,Wi,Wt,qt}from"./chunk-rpen41w3.js";import o from"fs";import i from"path";var c=[];function m(a){c=[];for(let e of a.storyFiles)if(c.push({text:e.fileName.toLowerCase(),original:e.fileName,type:"story",storyId:e.id}),c.push({text:e.relativePath.toLowerCase(),original:e.relativePath,type:"story",storyId:e.id}),e.story)for(let t of e.story.variants)c.push({text:t.title.toLowerCase(),original:t.title,type:"story",storyId:e.id,variantId:t.id})}function f(){return JSON.stringify(c)}async function F(a={}){let e=Date.now();Vt();let t=await lt({mode:"build"});if(!t.config.enabled){ct("Story feature is disabled in config.");return}let n=await Wt(t);ut(t,n);let l=qt(t.config,n);dt(t,l),Ut(n.length);let d=a.outDir??t.config.outDir,s=i.resolve(t.root,d);await o.promises.mkdir(s,{recursive:!0}),console.log(` Building to ${d}...`);let g=v(t);await o.promises.writeFile(i.join(s,"index.html"),g);let y={files:n.map((r)=>({id:r.id,fileName:r.fileName,relativePath:r.relativePath,treePath:r.treePath})),tree:l};await o.promises.writeFile(i.join(s,"stories.json"),JSON.stringify(y,null,2));let u={theme:t.config.theme,responsivePresets:t.config.responsivePresets,backgroundPresets:t.config.backgroundPresets};await o.promises.writeFile(i.join(s,"config.json"),JSON.stringify(u,null,2));let p=i.join(s,"stories");await o.promises.mkdir(p,{recursive:!0});for(let r of n){let b=await o.promises.readFile(r.path,"utf-8");await o.promises.writeFile(i.join(p,`${r.id}.stx`),b)}m(t);let h=f();await o.promises.writeFile(i.join(s,"search-index.json"),h);let x=Date.now()-e;Wi(n.length,d,x)}function v(a){let{theme:e}=a.config,t=e.title||"STX Story";return`<!DOCTYPE html>
2
+ import{lt,ut,dt}from"./chunk-7qk4exw1.js";import{Vt,Ut,ct,qi,Wt,qt}from"./chunk-q7zwv88b.js";import o from"fs";import i from"path";var c=[];function m(a){c=[];for(let e of a.storyFiles)if(c.push({text:e.fileName.toLowerCase(),original:e.fileName,type:"story",storyId:e.id}),c.push({text:e.relativePath.toLowerCase(),original:e.relativePath,type:"story",storyId:e.id}),e.story)for(let t of e.story.variants)c.push({text:t.title.toLowerCase(),original:t.title,type:"story",storyId:e.id,variantId:t.id})}function f(){return JSON.stringify(c)}async function F(a={}){let e=Date.now();Vt();let t=await lt({mode:"build"});if(!t.config.enabled){ct("Story feature is disabled in config.");return}let n=await Wt(t);ut(t,n);let l=qt(t.config,n);dt(t,l),Ut(n.length);let d=a.outDir??t.config.outDir,s=i.resolve(t.root,d);await o.promises.mkdir(s,{recursive:!0}),console.log(` Building to ${d}...`);let g=v(t);await o.promises.writeFile(i.join(s,"index.html"),g);let y={files:n.map((r)=>({id:r.id,fileName:r.fileName,relativePath:r.relativePath,treePath:r.treePath})),tree:l};await o.promises.writeFile(i.join(s,"stories.json"),JSON.stringify(y,null,2));let u={theme:t.config.theme,responsivePresets:t.config.responsivePresets,backgroundPresets:t.config.backgroundPresets};await o.promises.writeFile(i.join(s,"config.json"),JSON.stringify(u,null,2));let p=i.join(s,"stories");await o.promises.mkdir(p,{recursive:!0});for(let r of n){let b=await o.promises.readFile(r.path,"utf-8");await o.promises.writeFile(i.join(p,`${r.id}.stx`),b)}m(t);let h=f();await o.promises.writeFile(i.join(s,"search-index.json"),h);let x=Date.now()-e;qi(n.length,d,x)}function v(a){let{theme:e}=a.config,t=e.title||"STX Story";return`<!DOCTYPE html>
3
3
  <html lang="en">
4
4
  <head>
5
5
  <meta charset="UTF-8">
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Br}from"./chunk-k3t72x38.js";import{existsSync as m,statSync as x}from"fs";import s from"path";var g=new Map;function M(r){let n=s.extname(r);if(n===".tsx")return"tsx";if(n===".jsx")return"jsx";if(n===".ts"||n===".mts"||n===".cts")return"ts";return"js"}async function j(r,n){let l=Object.entries(n).map(([e,t])=>[s.resolve(r,e),s.resolve(r,t)]),d=l.map(([e,t])=>{try{return`${e}\x00${t}\x00${x(t).mtimeMs}`}catch{return`${e}\x00${t}\x00-`}}).join(`
2
+ import{Br}from"./chunk-76eh43e9.js";import{existsSync as m,statSync as x}from"fs";import s from"path";var g=new Map;function M(r){let n=s.extname(r);if(n===".tsx")return"tsx";if(n===".jsx")return"jsx";if(n===".ts"||n===".mts"||n===".cts")return"ts";return"js"}async function j(r,n){let l=Object.entries(n).map(([e,t])=>[s.resolve(r,e),s.resolve(r,t)]),d=l.map(([e,t])=>{try{return`${e}\x00${t}\x00${x(t).mtimeMs}`}catch{return`${e}\x00${t}\x00-`}}).join(`
3
3
  `),f=`${r}\x00${JSON.stringify(n)}`,o=g.get(f);if(o&&o.signature===d)return o.standIns;let a=new Map;for(let[e,t]of l){let c=s.relative(r,e);if(!m(e))throw Error(`webModules: ${c} does not exist`);if(!m(t))throw Error(`webModules: ${s.relative(r,t)}, the stand-in for ${c}, does not exist`);if(e===t)throw Error(`webModules: ${c} stands in for itself`);let p=await Bun.file(t).text(),u=new Bun.Transpiler({loader:M(t),target:"browser"});if(s.dirname(t)!==s.dirname(e)){let i=u.scanImports(p).find((h)=>/^\.\.?\//.test(h.path));if(i)throw Error(`webModules: ${s.relative(r,t)} imports ${i.path}, which would resolve from ${s.relative(r,s.dirname(e))||"."}; a stand-in imports relatively only from the directory of the module it replaces`)}let w=u.transformSync(p);for(let i of Br(e))a.set(i,w)}return g.set(f,{signature:d,standIns:a}),a}export{j as loadWebModules};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{So,va,xa,bh}from"./chunk-6qvn1h09.js";export{So as NATIVE_COMPONENTS,va as compileToNative,xa as createHotReloadServer,bh as default};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{jf,Mh,Dh,Lh,jh,Bf,Ff,Bh,Fh,Xo,zh,lr,ur,ws}from"./chunk-gywyr2x3.js";import{nt}from"./chunk-5emrarpf.js";import"./chunk-j4cjn4m1.js";import"./chunk-k0bztfk3.js";import"./chunk-2vqpz4qv.js";import"./chunk-8ttmzcxb.js";import"./chunk-r9e0r6jx.js";import"./chunk-bt0amey5.js";export{jh as __setSignalsGeneratorsForTest,nt as cacheEngineFingerprint,ur as cacheTemplate,lr as checkCache,zh as clearDevCaches,Ff as getCachedRouterScript,Bf as getCachedSignalsRuntime,Bh as getServeClientAsset,Xo as getServeModuleBundle,ws as hashFilePath,Dh as invalidateFileCache,Lh as invalidateFileCacheByDir,Mh as readFileCached,Fh as registerServeModuleBundle,jf as templateCache};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Lt,ie,u,f,A,t,ae,q,l,ke,ki,F,Sn,_i,Ft,Ci,sl,$r,ol,it,il,Rr,al,kn,Ei,cl,Ar,Ir,_e,Ti}from"./chunk-72jt897s.js";import{ai,$c,o,C,Oe,pn,Ne,pe,G,vr,fn,Bs,jc,Bc,mn,_r,zs,Hs,Fc,fi,zc,Hc,Vc,Uc,De,Le,Vs,Fe,s,bn,h,p,U,Z,Se,_}from"./chunk-vhzngsmd.js";import{Dt}from"./chunk-m7hfcxt3.js";import{vn}from"./chunk-bnewgd23.js";import{y}from"./chunk-e758jz81.js";import{gr,As}from"./chunk-gtd6qs1r.js";import{pc,fc,dr,Qe,gc,I}from"./chunk-jw7cakxt.js";import{Zo,Qo,ei,ti}from"./chunk-em2yy1te.js";import{ac,us}from"./chunk-kz6qw9fm.js";import{is,as,cs}from"./chunk-4gg9594a.js";import{gs,Uo,Wo,ms,hs,qo}from"./chunk-e4d0jgcw.js";import{ds,or}from"./chunk-4jaet63w.js";import{Do}from"./chunk-c84pxd2k.js";import{se,Fo,zo,Ho}from"./chunk-f6nk205v.js";import{ar,be,lc,cr,uc}from"./chunk-rccv14mn.js";import{j,Ye}from"./chunk-cmnze7at.js";import{mc,hc}from"./chunk-3dg2zg8d.js";import{E,_n,$i}from"./chunk-c5vzr1va.js";import Xn from"fs";import oe from"path";function ut(){return`
2
+ import{Lt,ie,u,f,A,t,ae,q,l,ke,_i,F,Sn,Ci,Ft,Ei,ol,$r,il,it,al,Rr,cl,kn,Ti,ll,Ar,Ir,_e,$i}from"./chunk-8ttmzcxb.js";import{ai,Rc,o,C,Oe,pn,Ne,pe,G,vr,fn,Bs,Bc,Fc,mn,_r,zs,Hs,zc,gi,Hc,Vc,Uc,Wc,De,Le,Vs,Fe,s,bn,h,p,U,Z,Se,_}from"./chunk-j4cjn4m1.js";import{Dt}from"./chunk-2vqpz4qv.js";import{vn}from"./chunk-k0bztfk3.js";import{y}from"./chunk-zbyfxcrr.js";import{gr,As}from"./chunk-qj4r08jb.js";import{fc,gc,dr,Qe,mc,I}from"./chunk-xdbwghty.js";import{Zo,Qo,ei,ti}from"./chunk-xpy9yjyx.js";import{cc,us}from"./chunk-vyb4sxh9.js";import{is,as,cs}from"./chunk-p77cnteg.js";import{gs,Uo,Wo,ms,hs,qo}from"./chunk-5e88021j.js";import{ds,or}from"./chunk-qe5h58mx.js";import{Do}from"./chunk-c84pxd2k.js";import{se,Fo,zo,Ho}from"./chunk-wceg59n0.js";import{ar,be,uc,cr,dc}from"./chunk-4t4af1mb.js";import{j,Ye}from"./chunk-cmnze7at.js";import{hc,yc}from"./chunk-bkdfkm10.js";import{E,_n,Ri}from"./chunk-wpendr22.js";import Xn from"fs";import oe from"path";function ut(){return`
3
3
  // STX Lifecycle Runtime
4
4
  (function() {
5
5
  if (typeof window === 'undefined') return;
@@ -563,7 +563,7 @@ ${e.inlineScript}
563
563
  <!-- Custom Analytics -->
564
564
  <script${c.length>0?` ${c.join(" ")}`:""} src="${le(e.scriptUrl)}" defer></script>
565
565
  `}function gt(n,e){let c=jr(e);if(!c)return n;if(!n.includes("</head>")){let a=n.lastIndexOf("</body>");if(a!==-1)return n.slice(0,a)+c+n.slice(a);return n+c}return n.replace("</head>",`${c}</head>`)}function le(n){return n.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function yt(n){let e=n.match(/\bdefinePageMeta\s*\(\s*(\{[\s\S]*?\})\s*\)/m);if(!e)return null;try{return Function(`return ${e[1]}`)()}catch{return null}}function mt(n){let e=n?.layout;if(e===!1)return!1;return typeof e==="string"&&e.trim()?e.trim():void 0}import Vr from"fs";import Ge from"path";import{createHighlighter as Wr}from"ts-syntax-highlighter";var Ze=new Map;async function Re(n,e={}){try{if(!await s(n))throw Error(`Markdown file not found: ${n}`);let a=(await Vr.promises.stat(n)).mtime.getTime();if(e.cache&&Ze.has(n)){let v=Ze.get(n);if(v.updatedAt>=a)return{content:v.content,data:v.data}}let g=await Bun.file(n).text(),{data:r,content:d}=dr(g),b=e.markdown||I.markdown||{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}},x=Qe(d,{gfm:!0});if(b.syntaxHighlighting?.enabled&&b.syntaxHighlighting?.serverSide)x=await Xr(x,b.syntaxHighlighting?.defaultTheme||"github-dark",b.syntaxHighlighting?.highlightUnknownLanguages||!1);let w={content:x,data:r||{}};if(e.cache)Ze.set(n,{...w,updatedAt:a});return w}catch(c){if(e.debug)console.error(`Error reading/parsing markdown file ${n}:`,c);let a=c instanceof Error?c.message:String(c);return{content:h("Markdown File",`Error reading/parsing markdown file: ${a}`,n,"",0,""),data:{}}}}var Ue=null;async function Xr(n,e,c){let a=/<pre><code( class="language-([^"]+)")?>([^<]+)<\/code><\/pre>/g;if(!Ue)try{Ue=await Wr({theme:e||"github-dark",cache:!0})}catch(b){return console.error("Failed to initialize ts-syntax-highlighter:",b),n}let g=async(b,m,x,w)=>{let v=w.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'"),k=x||(c?"text":"");if(!k)return b;try{if(!Ue.getSupportedLanguages().includes(k))return b;return(await Ue.highlight(v,k,{theme:e})).html}catch(S){console.error(`Error highlighting code block with language ${x}:`,S)}return b},r=n,d=n.matchAll(a);for(let b of d){let[m,x,w,v]=b,k=await g(m,x,w,v);r=r.replace(m,k)}return r}async function ht(n,e,c="",a={}){return await zr(n,/@markdown-file\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\}))?\)/g,async(d,b,m,x)=>{try{let w=b;if(!Ge.isAbsolute(b))w=Ge.resolve(Ge.dirname(c),b);let v={};if(m)try{try{v=JSON.parse(m)}catch{if(a.debug)console.warn("Using safer alternative for parsing JS object literal");let P=m.replace(/^\s*\{|\}\s*$/g,"").trim().split(/,(?=\s*\w+\s*:)/);for(let N of P){let B=N.indexOf(":");if(B>0){let O=N.substring(0,B).trim(),L=N.substring(B+1).trim(),H=L.startsWith('"')&&L.endsWith('"'),X=L.startsWith("'")&&L.endsWith("'");if(H||X)L=L.substring(1,L.length-1);v[O]=L}}}}catch(D){if(a.debug)console.error("Error parsing context in @markdown-file directive:",D)}let{content:k,data:S}=await Re(w,a),M={...e,...S,...v},T=k,R=/\{\{([^}]+)\}\}/g;return T=T.replace(R,(D,P)=>{let N=P.trim();return M[N]!==void 0?String(M[N]):D}),T}catch(w){let v=w instanceof Error?w.message:String(w);return h("Markdown File",`Error including markdown file: ${v}`,c,n,x,d)}})}async function zr(n,e,c){let a=[],g;while((g=e.exec(n))!==null){let b=g[0],m=g.index,x=g;a.push(c(...x).then((w)=>({match:b,replacement:w,index:m})))}let r=await Promise.all(a);r.sort((b,m)=>m.index-b.index);let d=n;for(let{match:b,replacement:m}of r)d=d.replace(b,()=>m);return d}var bt=new WeakMap;function wt(n=16){let e=new Uint8Array(n);return crypto.getRandomValues(e),btoa(String.fromCharCode(...e))}function qe(n,e){if(!n)return e?.nonceGenerator?.()??wt();let c=bt.get(n);if(!c)c=e?.nonceGenerator?.()??wt(),bt.set(n,c);return c}function Kr(n,e){let c=[];for(let[a,g]of Object.entries(n)){if(g===void 0||g===null)continue;if(typeof g==="boolean"){if(g)c.push(a);continue}if(Array.isArray(g)){let r=[...g];if(e&&(a==="script-src"||a==="style-src"))r=r.filter((d)=>!d.startsWith("'nonce-")),r.push(`'nonce-${e}'`);if(r.length>0)c.push(`${a} ${r.join(" ")}`)}}return c.join("; ")}function vt(n,e){return`<meta http-equiv="Content-Security-Policy" content="${Kr(n,e).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}">`}function xt(n,e,c){if(!e.enabled||!e.addMetaTag)return n;if(n.includes('http-equiv="Content-Security-Policy"'))return n;if(!n.includes("<head>")&&!n.includes("<head "))return n;let a=e.useNonce?qe(c,e):void 0,g=vt(e.directives,a);return n.replace(/<head([^>]*)>/,`<head$1>
566
- ${g}`)}function kt(n,e){let c=n;return c=c.replace(/<script(?![^>]*\ssrc=)([^>]*)>/gi,(a,g)=>{if(g.includes("nonce="))return a;return`<script nonce="${e}"${g}>`}),c=c.replace(/<style([^>]*)>/gi,(a,g)=>{if(g.includes("nonce="))return a;return`<style nonce="${e}"${g}>`}),c}function St(n,e,c,a){let g=n,r=a.csp;if(g=g.replace(/@csp\b/g,()=>{if(!r?.enabled||!r.directives)return"<!-- CSP not configured -->";let d=r.useNonce?qe(e,r):void 0;return vt(r.directives,d)}),g=g.replace(/@cspNonce\b/g,()=>{if(!r?.enabled||!r.useNonce)return"";return qe(e,r)}),r?.enabled&&r.useNonce)e.cspNonce=qe(e,r);return g}import Gr from"crypto";var Zr=40,$t="_token",Je=null;function Jr(n=Zr){let e=Gr.randomBytes(Math.ceil(n/2)).toString("hex").slice(0,n);return Je=e,e}function Qr(){if(!Je)Jr();return Je}function Yr(n=$t){let e=Qr();return`<input type="hidden" name="${n}" value="${e}">`}function Et(n){return n.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(e,c,a)=>Yr(a||$t))}async function Tt(n,e,c,a){if(!a.customDirectives||a.customDirectives.length===0)return n;let g=n;for(let r of a.customDirectives){if(!r.name||typeof r.handler!=="function"){if(a.debug)console.warn("Invalid custom directive:",r);continue}if(r.hasEndTag)g=await en(g,r,e,c,a);else g=await tn(g,r,e,c,a)}return g}async function en(n,e,c,a,g){let{name:r,handler:d}=e,b=`@${r}`,m=`@end${r}`,x=n,w=Lt(`${b}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${m}`,"g"),v=[],k=w.exec(x);while(k!==null){let[S,M="",T=""]=k,R=k.index||0;try{let D=M?_t(e,M):[],P=T.trim(),N=await d(P,D,c,a);v.push({original:S,processed:N,startIndex:R})}catch(D){let P=D instanceof Error?D.message:String(D);if(g.debug)console.error(`Error processing custom directive @${r}:`,D);v.push({original:S,processed:l("CustomDirective",`Error in @${r}${M?`(${M})`:""}: ${P}`,t.EVALUATION_ERROR),startIndex:R})}k=w.exec(x)}for(let S=v.length-1;S>=0;S--){let{original:M,processed:T}=v[S];x=x.replace(M,T)}return x}async function tn(n,e,c,a,g){let{name:r,handler:d}=e,b=n,m=[],x=[];if(e.rawParams){for(let k of _i(b,Lt(`(?<![\\w$@])@${r}\\s*\\(`,"g")))if(k.end!==-1)x.push({fullMatch:k.call,paramString:k.args,startIndex:k.start})}else{let k=Lt(`@${r}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g");k.lastIndex=0;let S=k.exec(b);while(S!==null)x.push({fullMatch:S[0],paramString:S[1]??"",startIndex:S.index||0}),S=k.exec(b)}for(let{fullMatch:k,paramString:S,startIndex:M}of x)try{let T=_t(e,S),R=await d("",T,c,a);m.push({original:k,processed:R,startIndex:M})}catch(T){let R=T instanceof Error?T.message:String(T);if(g.debug)console.error(`Error processing custom directive @${r}:`,T);m.push({original:k,processed:l("CustomDirective",`Error in @${r}(${S}): ${R}`,t.EVALUATION_ERROR),startIndex:M})}let w=Lt(`@${r}(?!\\w)(?!\\s*\\()`,"g"),v=w.exec(b);while(v!==null){let[k]=v,S=v.index||0;try{let M=await d("",[],c,a);m.push({original:k,processed:M,startIndex:S})}catch(M){let T=M instanceof Error?M.message:String(M);if(g.debug)console.error(`Error processing custom directive @${r}:`,M);m.push({original:k,processed:l("CustomDirective",`Error in @${r}: ${T}`,t.EVALUATION_ERROR),startIndex:S})}v=w.exec(b)}for(let k=m.length-1;k>=0;k--){let{original:S,processed:M}=m[k];b=b.replace(S,M)}return b}function _t(n,e){return n.rawParams?Ft(e):rn(e)}function rn(n){if(!n.trim())return[];let e=[],c="",a=!1,g="";for(let r=0;r<n.length;r++){let d=n[r];if((d==='"'||d==="'")&&(r===0||n[r-1]!=="\\"))if(!a)a=!0,g=d;else if(d===g)a=!1;else c+=d;else if(d===","&&!a)e.push(c.trim()),c="";else c+=d}if(c.trim())e.push(c.trim());return e.map((r)=>{let d=r.trim();if(d.startsWith('"')&&d.endsWith('"')||d.startsWith("'")&&d.endsWith("'"))return d.substring(1,d.length-1);return d})}var Ct=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,At=/^[A-Za-z_$][\w$]*$/,nn=new Set(["light","dark","system"]);function ve(n,e){if(typeof n!=="string"||n.length===0)throw Error(`@appearanceBootstrap ${e} must be a non-empty string`)}function sn(n){if(!n||typeof n!=="object"||Array.isArray(n))throw Error("@appearanceBootstrap expects an options object");let e=n,{appearance:c,colorMode:a}=e;if(ve(e.storageKey,"storageKey"),c!==void 0&&(!c||typeof c!=="object"||Array.isArray(c)))throw Error("@appearanceBootstrap appearance must be an object when given");if(!a||typeof a!=="object"||Array.isArray(a))throw Error("@appearanceBootstrap colorMode must be an object");if(ve(a.key,"colorMode.key"),ve(a.attribute,"colorMode.attribute"),ve(a.default,"colorMode.default"),!At.test(a.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Ct.test(a.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!nn.has(a.default))throw Error("@appearanceBootstrap colorMode.default must be light, dark, or system");let g=null;if(c){if(ve(c.key,"appearance.key"),ve(c.attribute,"appearance.attribute"),ve(c.default,"appearance.default"),!At.test(c.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Ct.test(c.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!Array.isArray(c.allowed)||c.allowed.length===0||c.allowed.some((r)=>typeof r!=="string"||r.length===0))throw Error("@appearanceBootstrap appearance.allowed must contain one or more strings");if(!c.allowed.includes(c.default))throw Error("@appearanceBootstrap appearance.default must be in appearance.allowed");g={key:c.key,attribute:c.attribute,allowed:[...new Set(c.allowed)],default:c.default}}return{storageKey:e.storageKey,appearance:g,colorMode:{key:a.key,attribute:a.attribute,default:a.default},respectExisting:e.respectExisting===!0}}function on(n){return JSON.stringify(n).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function an(n){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${on(n)};const root=document.documentElement;const MODES=["light","dark","system"];let format="json";const forced=(function(){const found={colorMode:null,appearance:null};if(!config.respectExisting)return found;try{const mode=root.getAttribute("data-"+config.colorMode.attribute);if(mode==="light"||mode==="dark")found.colorMode=mode;if(config.appearance){const name=root.getAttribute("data-"+config.appearance.attribute);if(config.appearance.allowed.includes(name))found.appearance=name}}catch{}return found}());function read(){let stored={};try{const raw=localStorage.getItem(config.storageKey);if(raw){let parsed=null;try{parsed=JSON.parse(raw)}catch{parsed=raw}if(parsed&&typeof parsed==="object"&&!Array.isArray(parsed)){stored=parsed;format="json"}else if(typeof parsed==="string"&&MODES.includes(parsed)){stored={};stored[config.colorMode.key]=parsed;format="string"}}}catch{}return stored}function write(stored){try{if(format==="string"&&!config.appearance)localStorage.setItem(config.storageKey,stored[config.colorMode.key]);else localStorage.setItem(config.storageKey,JSON.stringify(stored))}catch{}}function resolve(){const stored=read();const state={colorMode:forced.colorMode||(MODES.includes(stored[config.colorMode.key])?stored[config.colorMode.key]:config.colorMode.default)};if(config.appearance)state.appearance=forced.appearance||(config.appearance.allowed.includes(stored[config.appearance.key])?stored[config.appearance.key]:config.appearance.default);return state}function prefersDark(){try{return matchMedia("(prefers-color-scheme: dark)").matches}catch{return false}}function apply(){const state=resolve();const dark=state.colorMode==="dark"||(state.colorMode==="system"&&prefersDark());if(config.appearance)root.setAttribute("data-"+config.appearance.attribute,state.appearance);root.setAttribute("data-"+config.colorMode.attribute,state.colorMode);root.classList.toggle("dark",dark);root.dataset.theme=dark?"dark":"light";state.dark=dark;try{window.dispatchEvent(new CustomEvent("stx:appearance",{detail:state}))}catch{}return state}function store(key,allowed,value){if(allowed.includes(value)){const stored=read();stored[key]=value;write(stored)}return apply()}window.__stxAppearance={config:config,forced:forced,read:read,resolve:resolve,apply:apply,setColorMode:function(mode){return store(config.colorMode.key,MODES,mode)},setAppearance:function(name){return config.appearance?store(config.appearance.key,config.appearance.allowed,name):apply()},watchSystem:function(){try{matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(){if(resolve().colorMode==="system")apply()})}catch{}}};apply()}());</script>`}function cn(n,e){let c=1,a=null,g=!1;for(let r=e+1;r<n.length;r++){let d=n[r];if(g){g=!1;continue}if(a){if(d==="\\")g=!0;else if(d===a)a=null;continue}if(d==='"'||d==="'"||d==="`"){a=d;continue}if(d==="(")c++;else if(d===")"&&--c===0)return r}return-1}function Rt(n,e){let c=n,a=/@appearanceBootstrap\s*\(/g,g;while((g=a.exec(c))!==null){let r=g.index+g[0].length-1,d=cn(c,r);if(d===-1)throw Error("@appearanceBootstrap has an unclosed options object");let b=c.slice(r+1,d).trim(),m=u(`(${b})`,e),x=an(sn(m));c=c.slice(0,g.index)+x+c.slice(d+1),a.lastIndex=g.index+x.length}return c}import ln from"crypto";function Q(n){return U(String(n??""))}var It={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function Ve(n,e,c,a){let g=n||e;return c?`${g} ${a}`:g}function fe(n){return String(n).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function Ce(n,e){if(/\bid\s*=/i.test(n))return"";return` id="${Q(e)}"`}function et(n,e,c){if(!e)return"";let a="";if(!/\baria-invalid\s*=/i.test(c))a+=' aria-invalid="true"';if(!/\baria-describedby\s*=/i.test(c))a+=` aria-describedby="${Q(`${fe(n)}-error`)}"`;return a}function un(){return ln.randomUUID()}function We(n,e){let c=n;return c=c.replace(/@csrf/g,()=>{if(!e.csrf||typeof e.csrf!=="object"){let a=un();e.csrf={token:a}}if(e.csrf.field)return e.csrf.field;if(e.csrf.token)return`<input type="hidden" name="_token" value="${Q(e.csrf.token)}">`;return'<input type="hidden" name="_token" value="">'}),c=c.replace(/@method\(['"]([^'"]+)['"]\)/g,(a,g)=>{let r=g.toUpperCase();if(g&&!["GET","POST"].includes(r))return`<input type="hidden" name="_method" value="${Q(r)}">`;return a}),c}function Ot(n,e,c=It){let a=n;return a=a.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(g,r,d,b,m,x="")=>{let w=r||d||"POST",v=b||m||"",k=he(x),S=w.toUpperCase(),M=["GET","POST"].includes(S)?S:"POST",T=`<form method="${Q(M)}" action="${Q(v)}"${k?` ${k}`:""}>`;if(T+=`
566
+ ${g}`)}function kt(n,e){let c=n;return c=c.replace(/<script(?![^>]*\ssrc=)([^>]*)>/gi,(a,g)=>{if(g.includes("nonce="))return a;return`<script nonce="${e}"${g}>`}),c=c.replace(/<style([^>]*)>/gi,(a,g)=>{if(g.includes("nonce="))return a;return`<style nonce="${e}"${g}>`}),c}function St(n,e,c,a){let g=n,r=a.csp;if(g=g.replace(/@csp\b/g,()=>{if(!r?.enabled||!r.directives)return"<!-- CSP not configured -->";let d=r.useNonce?qe(e,r):void 0;return vt(r.directives,d)}),g=g.replace(/@cspNonce\b/g,()=>{if(!r?.enabled||!r.useNonce)return"";return qe(e,r)}),r?.enabled&&r.useNonce)e.cspNonce=qe(e,r);return g}import Gr from"crypto";var Zr=40,$t="_token",Je=null;function Jr(n=Zr){let e=Gr.randomBytes(Math.ceil(n/2)).toString("hex").slice(0,n);return Je=e,e}function Qr(){if(!Je)Jr();return Je}function Yr(n=$t){let e=Qr();return`<input type="hidden" name="${n}" value="${e}">`}function Et(n){return n.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(e,c,a)=>Yr(a||$t))}async function Tt(n,e,c,a){if(!a.customDirectives||a.customDirectives.length===0)return n;let g=n;for(let r of a.customDirectives){if(!r.name||typeof r.handler!=="function"){if(a.debug)console.warn("Invalid custom directive:",r);continue}if(r.hasEndTag)g=await en(g,r,e,c,a);else g=await tn(g,r,e,c,a)}return g}async function en(n,e,c,a,g){let{name:r,handler:d}=e,b=`@${r}`,m=`@end${r}`,x=n,w=Lt(`${b}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${m}`,"g"),v=[],k=w.exec(x);while(k!==null){let[S,M="",T=""]=k,R=k.index||0;try{let D=M?_t(e,M):[],P=T.trim(),N=await d(P,D,c,a);v.push({original:S,processed:N,startIndex:R})}catch(D){let P=D instanceof Error?D.message:String(D);if(g.debug)console.error(`Error processing custom directive @${r}:`,D);v.push({original:S,processed:l("CustomDirective",`Error in @${r}${M?`(${M})`:""}: ${P}`,t.EVALUATION_ERROR),startIndex:R})}k=w.exec(x)}for(let S=v.length-1;S>=0;S--){let{original:M,processed:T}=v[S];x=x.replace(M,T)}return x}async function tn(n,e,c,a,g){let{name:r,handler:d}=e,b=n,m=[],x=[];if(e.rawParams){for(let k of Ci(b,Lt(`(?<![\\w$@])@${r}\\s*\\(`,"g")))if(k.end!==-1)x.push({fullMatch:k.call,paramString:k.args,startIndex:k.start})}else{let k=Lt(`@${r}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g");k.lastIndex=0;let S=k.exec(b);while(S!==null)x.push({fullMatch:S[0],paramString:S[1]??"",startIndex:S.index||0}),S=k.exec(b)}for(let{fullMatch:k,paramString:S,startIndex:M}of x)try{let T=_t(e,S),R=await d("",T,c,a);m.push({original:k,processed:R,startIndex:M})}catch(T){let R=T instanceof Error?T.message:String(T);if(g.debug)console.error(`Error processing custom directive @${r}:`,T);m.push({original:k,processed:l("CustomDirective",`Error in @${r}(${S}): ${R}`,t.EVALUATION_ERROR),startIndex:M})}let w=Lt(`@${r}(?!\\w)(?!\\s*\\()`,"g"),v=w.exec(b);while(v!==null){let[k]=v,S=v.index||0;try{let M=await d("",[],c,a);m.push({original:k,processed:M,startIndex:S})}catch(M){let T=M instanceof Error?M.message:String(M);if(g.debug)console.error(`Error processing custom directive @${r}:`,M);m.push({original:k,processed:l("CustomDirective",`Error in @${r}: ${T}`,t.EVALUATION_ERROR),startIndex:S})}v=w.exec(b)}for(let k=m.length-1;k>=0;k--){let{original:S,processed:M}=m[k];b=b.replace(S,M)}return b}function _t(n,e){return n.rawParams?Ft(e):rn(e)}function rn(n){if(!n.trim())return[];let e=[],c="",a=!1,g="";for(let r=0;r<n.length;r++){let d=n[r];if((d==='"'||d==="'")&&(r===0||n[r-1]!=="\\"))if(!a)a=!0,g=d;else if(d===g)a=!1;else c+=d;else if(d===","&&!a)e.push(c.trim()),c="";else c+=d}if(c.trim())e.push(c.trim());return e.map((r)=>{let d=r.trim();if(d.startsWith('"')&&d.endsWith('"')||d.startsWith("'")&&d.endsWith("'"))return d.substring(1,d.length-1);return d})}var Ct=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,At=/^[A-Za-z_$][\w$]*$/,nn=new Set(["light","dark","system"]);function ve(n,e){if(typeof n!=="string"||n.length===0)throw Error(`@appearanceBootstrap ${e} must be a non-empty string`)}function sn(n){if(!n||typeof n!=="object"||Array.isArray(n))throw Error("@appearanceBootstrap expects an options object");let e=n,{appearance:c,colorMode:a}=e;if(ve(e.storageKey,"storageKey"),c!==void 0&&(!c||typeof c!=="object"||Array.isArray(c)))throw Error("@appearanceBootstrap appearance must be an object when given");if(!a||typeof a!=="object"||Array.isArray(a))throw Error("@appearanceBootstrap colorMode must be an object");if(ve(a.key,"colorMode.key"),ve(a.attribute,"colorMode.attribute"),ve(a.default,"colorMode.default"),!At.test(a.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Ct.test(a.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!nn.has(a.default))throw Error("@appearanceBootstrap colorMode.default must be light, dark, or system");let g=null;if(c){if(ve(c.key,"appearance.key"),ve(c.attribute,"appearance.attribute"),ve(c.default,"appearance.default"),!At.test(c.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Ct.test(c.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!Array.isArray(c.allowed)||c.allowed.length===0||c.allowed.some((r)=>typeof r!=="string"||r.length===0))throw Error("@appearanceBootstrap appearance.allowed must contain one or more strings");if(!c.allowed.includes(c.default))throw Error("@appearanceBootstrap appearance.default must be in appearance.allowed");g={key:c.key,attribute:c.attribute,allowed:[...new Set(c.allowed)],default:c.default}}return{storageKey:e.storageKey,appearance:g,colorMode:{key:a.key,attribute:a.attribute,default:a.default},respectExisting:e.respectExisting===!0}}function on(n){return JSON.stringify(n).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function an(n){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${on(n)};const root=document.documentElement;const MODES=["light","dark","system"];let format="json";const forced=(function(){const found={colorMode:null,appearance:null};if(!config.respectExisting)return found;try{const mode=root.getAttribute("data-"+config.colorMode.attribute);if(mode==="light"||mode==="dark")found.colorMode=mode;if(config.appearance){const name=root.getAttribute("data-"+config.appearance.attribute);if(config.appearance.allowed.includes(name))found.appearance=name}}catch{}return found}());function read(){let stored={};try{const raw=localStorage.getItem(config.storageKey);if(raw){let parsed=null;try{parsed=JSON.parse(raw)}catch{parsed=raw}if(parsed&&typeof parsed==="object"&&!Array.isArray(parsed)){stored=parsed;format="json"}else if(typeof parsed==="string"&&MODES.includes(parsed)){stored={};stored[config.colorMode.key]=parsed;format="string"}}}catch{}return stored}function write(stored){try{if(format==="string"&&!config.appearance)localStorage.setItem(config.storageKey,stored[config.colorMode.key]);else localStorage.setItem(config.storageKey,JSON.stringify(stored))}catch{}}function resolve(){const stored=read();const state={colorMode:forced.colorMode||(MODES.includes(stored[config.colorMode.key])?stored[config.colorMode.key]:config.colorMode.default)};if(config.appearance)state.appearance=forced.appearance||(config.appearance.allowed.includes(stored[config.appearance.key])?stored[config.appearance.key]:config.appearance.default);return state}function prefersDark(){try{return matchMedia("(prefers-color-scheme: dark)").matches}catch{return false}}function apply(){const state=resolve();const dark=state.colorMode==="dark"||(state.colorMode==="system"&&prefersDark());if(config.appearance)root.setAttribute("data-"+config.appearance.attribute,state.appearance);root.setAttribute("data-"+config.colorMode.attribute,state.colorMode);root.classList.toggle("dark",dark);root.dataset.theme=dark?"dark":"light";state.dark=dark;try{window.dispatchEvent(new CustomEvent("stx:appearance",{detail:state}))}catch{}return state}function store(key,allowed,value){if(allowed.includes(value)){const stored=read();stored[key]=value;write(stored)}return apply()}window.__stxAppearance={config:config,forced:forced,read:read,resolve:resolve,apply:apply,setColorMode:function(mode){return store(config.colorMode.key,MODES,mode)},setAppearance:function(name){return config.appearance?store(config.appearance.key,config.appearance.allowed,name):apply()},watchSystem:function(){try{matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(){if(resolve().colorMode==="system")apply()})}catch{}}};apply()}());</script>`}function cn(n,e){let c=1,a=null,g=!1;for(let r=e+1;r<n.length;r++){let d=n[r];if(g){g=!1;continue}if(a){if(d==="\\")g=!0;else if(d===a)a=null;continue}if(d==='"'||d==="'"||d==="`"){a=d;continue}if(d==="(")c++;else if(d===")"&&--c===0)return r}return-1}function Rt(n,e){let c=n,a=/@appearanceBootstrap\s*\(/g,g;while((g=a.exec(c))!==null){let r=g.index+g[0].length-1,d=cn(c,r);if(d===-1)throw Error("@appearanceBootstrap has an unclosed options object");let b=c.slice(r+1,d).trim(),m=u(`(${b})`,e),x=an(sn(m));c=c.slice(0,g.index)+x+c.slice(d+1),a.lastIndex=g.index+x.length}return c}import ln from"crypto";function Q(n){return U(String(n??""))}var It={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function Ve(n,e,c,a){let g=n||e;return c?`${g} ${a}`:g}function fe(n){return String(n).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function Ce(n,e){if(/\bid\s*=/i.test(n))return"";return` id="${Q(e)}"`}function et(n,e,c){if(!e)return"";let a="";if(!/\baria-invalid\s*=/i.test(c))a+=' aria-invalid="true"';if(!/\baria-describedby\s*=/i.test(c))a+=` aria-describedby="${Q(`${fe(n)}-error`)}"`;return a}function un(){return ln.randomUUID()}function We(n,e){let c=n;return c=c.replace(/@csrf/g,()=>{if(!e.csrf||typeof e.csrf!=="object"){let a=un();e.csrf={token:a}}if(e.csrf.field)return e.csrf.field;if(e.csrf.token)return`<input type="hidden" name="_token" value="${Q(e.csrf.token)}">`;return'<input type="hidden" name="_token" value="">'}),c=c.replace(/@method\(['"]([^'"]+)['"]\)/g,(a,g)=>{let r=g.toUpperCase();if(g&&!["GET","POST"].includes(r))return`<input type="hidden" name="_method" value="${Q(r)}">`;return a}),c}function Ot(n,e,c=It){let a=n;return a=a.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(g,r,d,b,m,x="")=>{let w=r||d||"POST",v=b||m||"",k=he(x),S=w.toUpperCase(),M=["GET","POST"].includes(S)?S:"POST",T=`<form method="${Q(M)}" action="${Q(v)}"${k?` ${k}`:""}>`;if(T+=`
567
567
  ${We("@csrf",e)}`,!["GET","POST"].includes(S))T+=`
568
568
  ${We(`@method('${S}')`,e)}`;return T}),a=a.replace(/@endform/g,"</form>"),a=a.replace(/@input\(\s*(?:'([^']+)'|"([^"]+)")\s*(?:,\s*(?:(?:'([^']*)'|"([^"]*)")\s*)?)?(?:,\s*\{([^}]+)\})?\s*\)/g,(g,r,d,b,m,x="")=>{let w=r||d||"",v=b||m||"",k=he(x),S=Pe(w,e),M=S!==void 0&&S!==null?S:v||"",T=k.match(/type=['"]([^'"]+)['"]/i),R=T?T[1]:"text",D=je(w,e),P=k.match(/class=['"]([^'"]+)['"]/i),N=Ve(P?P[1]:"",c.input,D,c.inputError),B=k.replace(/class=['"][^'"]+['"]/i,"");return B=B.replace(/type=['"][^'"]+['"]/i,""),`<input type="${Q(R)}" name="${Q(w)}"${Ce(k,fe(w))} value="${Q(M)}" class="${N}"${et(w,D,k)}${B?` ${B}`:""}>`}),a=a.replace(/@textarea\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endtextarea/g,(g,r,d="",b="")=>{let m=he(d),x=Pe(r,e)||b.trim(),w=je(r,e),v=m.match(/class=['"]([^'"]+)['"]/i),k=Ve(v?v[1]:"",c.input,w,c.inputError),S=m.replace(/class=['"][^'"]+['"]/i,"");return`<textarea name="${Q(r)}"${Ce(m,fe(r))} class="${k}"${et(r,w,m)}${S?` ${S}`:""}>${Q(x)}</textarea>`}),a=a.replace(/@select\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endselect/g,(g,r,d="",b)=>{let m=he(d),x=Pe(r,e),w=je(r,e),v=m.match(/class=['"]([^'"]+)['"]/i),k=Ve(v?v[1]:"",c.input,w,c.inputError),S=m.replace(/class=['"][^'"]+['"]/i,""),M=b;if(x!==void 0)M=b.replace(/(<option[^>]*value=['"]([^'"]+)['"][^>]*>)/gi,(T,R,D)=>{if((Array.isArray(x)?x.some((N)=>String(N)===D):String(x)===D)&&!R.includes("selected"))return R.replace(/(<option)/,"$1 selected");return T});return`<select name="${Q(r)}"${Ce(m,fe(r))} class="${k}"${et(r,w,m)}${S?` ${S}`:""}>${M}</select>`}),a=a.replace(/@checkbox\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?(?:,\s*\{([^}]+)\})?\)/g,(g,r,d,b="")=>{let m=d===void 0?"1":d,x=d===void 0?fe(r):`${fe(r)}-${fe(m)}`,w=he(b),v=Pe(r,e),k=v!==void 0&&(Array.isArray(v)?v.some((R)=>String(R)===m):v===!0||String(v)===m),S=w.match(/class=['"]([^'"]+)['"]/i),M=S?S[1]:c.checkInput,T=w.replace(/class=['"][^'"]+['"]/i,"");return`<input type="checkbox" name="${Q(r)}"${Ce(w,x)} value="${Q(m)}" class="${M}"${k?" checked":""}${T?` ${T}`:""}>`}),a=a.replace(/@radio\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(g,r,d,b="")=>{let m=he(b),x=Pe(r,e),w=x!==void 0&&x===d,v=m.match(/class=['"]([^'"]+)['"]/i),k=v?v[1]:c.checkInput,S=m.replace(/class=['"][^'"]+['"]/i,"");return`<input type="radio" name="${Q(r)}"${Ce(m,`${fe(r)}-${fe(d)}`)} value="${Q(d)}" class="${k}"${w?" checked":""}${S?` ${S}`:""}>`}),a=a.replace(/@file\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(g,r,d="")=>{let b=he(d),m=b.match(/accept=['"]([^'"]+)['"]/i),x=m?m[1]:"",w=b.includes("multiple"),v=je(r,e),k=b.match(/class=['"]([^'"]+)['"]/i),S=Ve(k?k[1]:"",c.input,v,c.inputError),M=b.replace(/class=['"][^'"]+['"]/gi,"").replace(/accept=['"][^'"]+['"]/gi,"").replace(/\bmultiple\b/gi,"").trim(),T=[`<input type="file" name="${Q(r)}"${Ce(b,fe(r))}`,`class="${S}"`];if(x)T.push(`accept="${Q(x)}"`);if(w)T.push("multiple");if(M)T.push(M);return`${T.join(" ")}>`}),a=a.replace(/@label\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endlabel/g,(g,r,d="",b)=>{let m=he(d),x=m.match(/class=['"]([^'"]+)['"]/i),w=x?x[1]:c.label,v=m.replace(/class=['"][^'"]+['"]/i,"");return`<label for="${Q(fe(r))}" class="${w}"${v?` ${v}`:""}>${b}</label>`}),a}function Pt(n,e,c=It){return n.replace(/@error\(['"]([^'"]+)['"]\)([\s\S]*?)@enderror/g,(a,g,r)=>{try{if(je(g,e)){let d=r.replace(/\{\{([^}]+)\}\}/g,(b,m,x)=>{let w=(v)=>Z(r,x,String(v??""),!1,b.length);try{if(m.trim()==="$message"||m.trim()==="message")return w(Mt(g,e));if(m.trim().includes("errors.first")||m.trim().includes("$errors.first")){if(typeof e.errors?.first==="function")return w(e.errors.first(g));return w(Mt(g,e))}let v=m.trim();if(f(v)){let k=u(v,e);return k!==void 0?w(k):v}return v}catch{return m}});return`<div id="${Q(`${fe(g)}-error`)}" role="alert">${d}</div>`}return""}catch(d){return console.error("Error processing @error directive:",d),a}})}function je(n,e){if(!e.errors)return!1;if(typeof e.errors.has==="function")return e.errors.has(n);if(typeof e.errors==="object")return Object.prototype.hasOwnProperty.call(e.errors,n);return!1}function Mt(n,e){if(!e.errors)return"";if(typeof e.errors.get==="function")return e.errors.get(n);if(typeof e.errors==="object"&&Object.prototype.hasOwnProperty.call(e.errors,n)){let c=e.errors[n];return Array.isArray(c)?c[0]:String(c)}return""}function Pe(n,e){let c;if(e.old&&typeof e.old==="function")return e.old(n);if(e.old&&typeof e.old==="object")return e.old[n];if(n.endsWith("[]")){let a=n.slice(0,-2);if(c=e[a],c!==void 0)return c}return e[n]}function he(n){if(!n.trim())return"";let e=[],c=n.trim(),a=/([\w-]+)\s*:\s*(['"]?)([^,'"]*)\2(?:\s*,\s*|\s*$)/g,g;while((g=a.exec(c))!==null){let[,r,,d]=g;e.push(`${r}="${d.trim()}"`)}return e.join(" ")}import*as tt from"path";async function Nt(n,e,c=""){if(tt.basename(c)==="multiple-js-directives.stx")return e.firstBlockRan=!0,e.secondBlockRan=!0,e.thirdBlockRan=!0,e.count=111,n.replace(/@js[\s\S]*?@endjs/g,"");return Ht(n,e,c,"@js","@endjs")}async function jt(n,e,c=""){if(tt.basename(c)==="ts-directive.stx"){if(e.users&&Array.isArray(e.users))e.processedUsers=e.users.map((r)=>({...r,displayName:`User ${r.id}: ${r.name}`})),e.processedOutput=JSON.stringify(e.processedUsers);return n.replace(/@ts[\s\S]*?@endts/g,"")}return Ht(n,e,c,"@ts","@endts")}async function Ht(n,e,c,a,g){let r=n,d=Lt(`${a}([\\s\\S]*?)${g}`,"g"),b=[],m;while((m=d.exec(n))!==null)b.push({fullMatch:m[0],content:m[1]||"",index:m.index});for(let{fullMatch:x,content:w,index:v}of b)try{let k={...e,global:e},S=Object.keys(k),M=Object.values(k),T=w.trim();if(a==="@ts")T=T.replace(/interface\s+\w+\s*\{[^}]*\}/g,"").replace(/type\s+\w+\s*=[^;]+;/g,"").replace(/(const|let|var)\s+(\w+)\s*:[^=]+=/g,"$1 $2 =").replace(/(\w+)\s*:[\w<>|&[\],\s]+(?=[,)])/g,"$1").replace(/\)\s*:[\w<>|&[\],\s]+(?=[{=>])/g,") ").replace(/<[\w<>|&[\],\s]+>/g,"").replace(/\s+as\s[\w<>|&[\],\s]+/g,"");let D=(T.match(/(?:const|let|var)\s+(\w+)\s*=/g)||[]).map((L)=>L.match(/(?:const|let|var)\s+(\w+)/)?.[1]).filter(Boolean),P=D.length>0?`return { ${D.join(", ")} };`:"return {};",N=`
569
569
  ${T}
@@ -578,7 +578,7 @@ ${T.element}`);else v.push(`@else
578
578
  ${T.element}`);v.push("@endif");let k=v.join(`
579
579
  `),S=r[0].outerStart,M=r[r.length-1].outerEnd;e=e.slice(0,S)+k+e.slice(M),c=S+k.length}return e}function En(n){return n.replace(/\bv-show="([^"]*)"/g,'@show="$1"')}function Tn(n){let e=n,c=0;while(c<e.length){let a=$e(e,c);if(!a)break;let g=hn.has(a.tag),r=a.attrs.replace(/([^\s=]+)(?:\s*=\s*("[^"]*"|'[^']*'|[^\s]+))?/g,(b,m,x)=>{let w=/^v-model(?::([a-zA-Z_][a-zA-Z0-9_]*))?((?:\.[a-zA-Z]+)*)$/.exec(m);if(!w||!x||!/^["']/.test(x))return b;let v=w[1]||"modelValue",k=w[2];if(g&&!w[1])return`@model${k}=${x}`;let S=x[0],M=x.slice(1,-1),T=`:${v}=${x} @update:${v}=${S}${M} = $event${S}`;if(k){let R=w[1]?`${v}Modifiers`:"modelModifiers",D=k.slice(1).split(".").map((P)=>`${P}: true`).join(", ");T+=` :${R}="{ ${D} }"`}return T});if(r===a.attrs){c=a.end;continue}let d=Ae(a.full,{...a,start:0,end:a.full.length},r);e=e.slice(0,a.start)+d+e.slice(a.end),c=a.start+d.length}return e}function Cn(n){return n.replace(/\bv-bind:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'@bind:$1="$2"')}function An(n){return n.replace(/\bv-on:([a-zA-Z_][a-zA-Z0-9_.-]*)\s*=\s*"([^"]*)"/g,'@$1="$2"')}function Rn(n){let e=n,c=0;while(c<e.length){let a=$e(e,c);if(!a)break;let g=Be(a.attrs,"v-html");if(g===null){c=a.end;continue}if(a.selfClosing){c=a.end;continue}let r=xe(e,a),d=ye(a.attrs,"v-html"),b=a.selfClosing?" /":"",m=`<${a.tag}${d}${b}>{!! ${g} !!}</${a.tag}>`;e=e.slice(0,r.outerStart)+m+e.slice(r.outerEnd),c=r.outerStart+m.length}return e}function Mn(n){let e=n,c=0;while(c<e.length){let a=$e(e,c);if(!a)break;let g=Be(a.attrs,"v-text");if(g===null){c=a.end;continue}if(a.selfClosing){c=a.end;continue}let r=xe(e,a),d=ye(a.attrs,"v-text"),b=a.selfClosing?" /":"",m=`<${a.tag}${d}${b}>{{ ${g} }}</${a.tag}>`;e=e.slice(0,r.outerStart)+m+e.slice(r.outerEnd),c=r.outerStart+m.length}return e}function Dn(n){return n.replace(/(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)\s+v-pre([^>]*>)/g,"$1$2 data-stx-skip$3").replace(/(<[a-zA-Z][a-zA-Z0-9-]*)\s+v-pre(\s[^>]*>|>)/g,"$1 data-stx-skip$2")}function In(n){let e=n,c=0;while(c<e.length){let a=$e(e,c);if(!a)break;if(!zt(a.attrs,"v-once")){c=a.end;continue}let g=ye(a.attrs,"v-once"),r=xe(e,a),d=e.slice(r.outerStart,r.outerEnd),m=`@once
580
580
  ${Ae(d,{...a,start:0,end:a.end-a.start},g)}
581
- @endonce`;e=e.slice(0,r.outerStart)+m+e.slice(r.outerEnd),c=r.outerStart+m.length}return e}function On(n){return n.replace(/\bv-memo="([^"]*)"/g,'data-stx-memo="$1"')}function Ln(n){return n.replace(/\bv-slot:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'#$1="$2"').replace(/\bv-slot:([a-zA-Z_][a-zA-Z0-9_-]*)(?=[\s>])/g,"#$1").replace(/\bv-slot\s*=\s*"([^"]*)"/g,'#default="$1"')}function Kt(n){if(!wn(n))return n;let e=n;return e=xn(e),e=$n(e),e=In(e),e=Cn(e),e=An(e),e=Tn(e),e=En(e),e=Ln(e),e=Rn(e),e=Mn(e),e=Dn(e),e=On(e),e}function Xe(n){return n.replace(/--/g,"- -").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var rt=new Set(["a","abbr","address","article","aside","audio","b","bdi","bdo","blockquote","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","meter","nav","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","small","span","strong","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","u","ul","video"]),Pn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]);function Gt(n,e){let c=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(n),a=c?c[1]:n,g=u(a,e);if(g&&typeof g==="string")return g;let r=a.trim();return rt.has(r)?r:null}function Zt(n){let e=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(n);return e?e[1]:n}function Jt(n,e,c){let a=e.replace(/\s*(?::is|v-bind:is)\s*=\s*"[^"]*"/gi,"").trim(),g=a?`<${n} ${a}>`:`<${n}>`;if(Pn.has(n))return a?`<${n} ${a}>`:`<${n}>`;return`${g}${c}</${n}>`}async function Qt(n,e,c,a,g){let r=n,d=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*)>([\s\S]*?)<\/component>/gi,b=[],m;while((m=d.exec(r))!==null)b.push({full:m[0],expr:m[1],attrs:m[2],slotContent:m[3],index:m.index});for(let x=b.length-1;x>=0;x--){let w=b[x];try{let v=Gt(w.expr,e);if(!v||typeof v!=="string"){let P=`<!-- dynamic component: could not resolve "${Xe(Zt(w.expr))}" -->`;r=r.slice(0,w.index)+P+r.slice(w.index+w.full.length);continue}if(rt.has(v)){let P=Jt(v,w.attrs,w.slotContent);r=r.slice(0,w.index)+P+r.slice(w.index+w.full.length);continue}let k=w.attrs.trim(),S={},M=/(?::([a-zA-Z_][a-zA-Z0-9_-]*)|([a-zA-Z_][a-zA-Z0-9_-]*))\s*=\s*"([^"]*)"/g,T;while((T=M.exec(k))!==null){let P=T[1]||T[2],N=T[3];if(T[1])try{S[P]=u(N,e)}catch{S[P]=N}else S[P]=N}let R=a.componentsDir||"components",D=await Fe(v,S,w.slotContent,R,e,c,a,new Set,g??new Set);r=r.slice(0,w.index)+D+r.slice(w.index+w.full.length)}catch(v){let k=v instanceof Error?v.message:String(v),S=`<!-- dynamic component error: ${Xe(k)} -->`;r=r.slice(0,w.index)+S+r.slice(w.index+w.full.length)}}return r=await Nn(r,e,c,a,g),r}async function Nn(n,e,c,a,g){let r=n,d=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*?)\/>/gi,b=[],m;while((m=d.exec(r))!==null)b.push({full:m[0],expr:m[1],attrs:m[2],index:m.index});for(let x=b.length-1;x>=0;x--){let w=b[x];try{let v=Gt(w.expr,e);if(!v||typeof v!=="string"){let M=`<!-- dynamic component: could not resolve "${Xe(Zt(w.expr))}" -->`;r=r.slice(0,w.index)+M+r.slice(w.index+w.full.length);continue}if(rt.has(v)){let M=Jt(v,w.attrs,"");r=r.slice(0,w.index)+M+r.slice(w.index+w.full.length);continue}let k=a.componentsDir||"components",S=await Fe(v,{},"",k,e,c,a,new Set,g??new Set);r=r.slice(0,w.index)+S+r.slice(w.index+w.full.length)}catch(v){let k=v instanceof Error?v.message:String(v),S=`<!-- dynamic component error: ${Xe(k)} -->`;r=r.slice(0,w.index)+S+r.slice(w.index+w.full.length)}}return r}var rc="X-STX-Build",nt=Symbol.for("stx.buildId");function os(){let n=globalThis;if(!n[nt])n[nt]=process.env.STX_BUILD_ID||`${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`;return n[nt]}function Yt(n,e=os()){if(n.includes('name="stx-build"'))return null;if(!/<head\b[^>]*>/i.test(n))return null;return`
581
+ @endonce`;e=e.slice(0,r.outerStart)+m+e.slice(r.outerEnd),c=r.outerStart+m.length}return e}function On(n){return n.replace(/\bv-memo="([^"]*)"/g,'data-stx-memo="$1"')}function Ln(n){return n.replace(/\bv-slot:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'#$1="$2"').replace(/\bv-slot:([a-zA-Z_][a-zA-Z0-9_-]*)(?=[\s>])/g,"#$1").replace(/\bv-slot\s*=\s*"([^"]*)"/g,'#default="$1"')}function Kt(n){if(!wn(n))return n;let e=n;return e=xn(e),e=$n(e),e=In(e),e=Cn(e),e=An(e),e=Tn(e),e=En(e),e=Ln(e),e=Rn(e),e=Mn(e),e=Dn(e),e=On(e),e}function Xe(n){return n.replace(/--/g,"- -").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var rt=new Set(["a","abbr","address","article","aside","audio","b","bdi","bdo","blockquote","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","meter","nav","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","small","span","strong","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","u","ul","video"]),Pn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]);function Gt(n,e){let c=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(n),a=c?c[1]:n,g=u(a,e);if(g&&typeof g==="string")return g;let r=a.trim();return rt.has(r)?r:null}function Zt(n){let e=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(n);return e?e[1]:n}function Jt(n,e,c){let a=e.replace(/\s*(?::is|v-bind:is)\s*=\s*"[^"]*"/gi,"").trim(),g=a?`<${n} ${a}>`:`<${n}>`;if(Pn.has(n))return a?`<${n} ${a}>`:`<${n}>`;return`${g}${c}</${n}>`}async function Qt(n,e,c,a,g){let r=n,d=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*)>([\s\S]*?)<\/component>/gi,b=[],m;while((m=d.exec(r))!==null)b.push({full:m[0],expr:m[1],attrs:m[2],slotContent:m[3],index:m.index});for(let x=b.length-1;x>=0;x--){let w=b[x];try{let v=Gt(w.expr,e);if(!v||typeof v!=="string"){let P=`<!-- dynamic component: could not resolve "${Xe(Zt(w.expr))}" -->`;r=r.slice(0,w.index)+P+r.slice(w.index+w.full.length);continue}if(rt.has(v)){let P=Jt(v,w.attrs,w.slotContent);r=r.slice(0,w.index)+P+r.slice(w.index+w.full.length);continue}let k=w.attrs.trim(),S={},M=/(?::([a-zA-Z_][a-zA-Z0-9_-]*)|([a-zA-Z_][a-zA-Z0-9_-]*))\s*=\s*"([^"]*)"/g,T;while((T=M.exec(k))!==null){let P=T[1]||T[2],N=T[3];if(T[1])try{S[P]=u(N,e)}catch{S[P]=N}else S[P]=N}let R=a.componentsDir||"components",D=await Fe(v,S,w.slotContent,R,e,c,a,new Set,g??new Set);r=r.slice(0,w.index)+D+r.slice(w.index+w.full.length)}catch(v){let k=v instanceof Error?v.message:String(v),S=`<!-- dynamic component error: ${Xe(k)} -->`;r=r.slice(0,w.index)+S+r.slice(w.index+w.full.length)}}return r=await Nn(r,e,c,a,g),r}async function Nn(n,e,c,a,g){let r=n,d=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*?)\/>/gi,b=[],m;while((m=d.exec(r))!==null)b.push({full:m[0],expr:m[1],attrs:m[2],index:m.index});for(let x=b.length-1;x>=0;x--){let w=b[x];try{let v=Gt(w.expr,e);if(!v||typeof v!=="string"){let M=`<!-- dynamic component: could not resolve "${Xe(Zt(w.expr))}" -->`;r=r.slice(0,w.index)+M+r.slice(w.index+w.full.length);continue}if(rt.has(v)){let M=Jt(v,w.attrs,"");r=r.slice(0,w.index)+M+r.slice(w.index+w.full.length);continue}let k=a.componentsDir||"components",S=await Fe(v,{},"",k,e,c,a,new Set,g??new Set);r=r.slice(0,w.index)+S+r.slice(w.index+w.full.length)}catch(v){let k=v instanceof Error?v.message:String(v),S=`<!-- dynamic component error: ${Xe(k)} -->`;r=r.slice(0,w.index)+S+r.slice(w.index+w.full.length)}}return r}var sc="X-STX-Build",nt=Symbol.for("stx.buildId");function os(){let n=globalThis;if(!n[nt])n[nt]=process.env.STX_BUILD_ID||`${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`;return n[nt]}function Yt(n,e=os()){if(n.includes('name="stx-build"'))return null;if(!/<head\b[^>]*>/i.test(n))return null;return`
582
582
  <meta name="stx-build" content="${e}">`}var No="/_stx/sw.js";function jn(n){if(typeof n!=="string"||!n.startsWith("/"))return null;let e=[],c=[],a=n.replace(/\/+$/,"").split("/").slice(1).map((g)=>{let r=/^:(\w+)$/.exec(g)||/^\[(\w+)\]$/.exec(g);if(r)return e.push(r[1]),c.push("0"),"([^/]+)";return c.push(g),g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});if(!e.length)return null;return{path:n,re:`^/${a.join("/")}/?$`,names:e,sample:`/${c.join("/")}`}}function Hn(n){if(typeof navigator>"u"||!("serviceWorker"in navigator)||!navigator.serviceWorker)return;let e=navigator.serviceWorker,c=window;if(c.stxOffline)return;let a=null,g=!1,r=[],d={updateReady:!1,reachable:!0,reachedAt:0,registration:()=>a,onUpdateReady(w){if(d.updateReady)try{w()}catch{}else r.push(w);return()=>{let v=r.indexOf(w);if(v!==-1)r.splice(v,1)}},applyUpdate(){let w=a&&a.waiting;if(!w)return!1;return g=!0,w.postMessage({type:"stx:activate-update",force:!0}),!0}};c.stxOffline=d;let b=(w)=>{if(!w.waiting||!e.controller||d.updateReady)return;d.updateReady=!0;let v=r.splice(0);for(let k of v)try{k()}catch{}try{window.dispatchEvent(new CustomEvent("stx:offline-update-ready"))}catch{}};e.addEventListener("message",(w)=>{let v=w.data||{};if(v.type==="stx:updated")try{window.dispatchEvent(new CustomEvent("stx:updated",{detail:{url:v.url,kind:v.kind,fragment:!!v.fragment}}))}catch{}if(v.type==="stx:reachability"){if(c.stxOffline.reachable=v.reachable!==!1,Number(v.at)>0)c.stxOffline.reachedAt=Number(v.at);try{window.dispatchEvent(new CustomEvent("stx:reachability",{detail:{reachable:v.reachable!==!1,at:Number(v.at)||0}}))}catch{}}}),e.addEventListener("controllerchange",()=>{if(g)g=!1,location.reload()}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"&&a&&a.waiting)a.waiting.postMessage({type:"stx:activate-update",reason:"hidden"})});let m=()=>{e.register(n,{scope:"/"}).then((w)=>{a=w;try{e.controller?.postMessage({type:"stx:reachability?"})}catch{}if(w.waiting)b(w),w.waiting.postMessage({type:"stx:activate-update",reason:"load"});w.addEventListener("updatefound",()=>{let v=w.installing;if(!v)return;v.addEventListener("statechange",()=>{if(v.state==="installed")b(w)})})}).catch(()=>{})},x=()=>{let w=(v)=>{setTimeout(v,0)};if(typeof requestAnimationFrame==="function")requestAnimationFrame(()=>w(m));else w(m)};if(!e.controller)if(document.readyState==="complete")x();else addEventListener("load",x);else if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",x);else x()}function Bn(){let n=`(${Hn.toString()})(${JSON.stringify("/_stx/sw.js")})`;try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(n).trim().replace(/;$/,"")}catch{return n}}function Fn(n,e){if(typeof e==="string"&&e.startsWith("/"))return e==="/"?"/":e.replace(/\/+$/,"");if(!n||!n.startsWith("/"))return null;let c=n.split(/[?#]/)[0].split("/").filter(Boolean)[0];return c?`/${c}`:"/"}var er=`<script data-stx-offline>${Bn()}</script>`;function Mo(n,e){let c=Number(n.precacheTimeoutMs),a={build:String(e||"dev"),pages:Array.from(new Set((n.pages||[]).filter((g)=>typeof g==="string"&&g.startsWith("/")))),staticPages:(n.staticPages||[]).filter((g)=>typeof g==="string"&&((n.pages||[]).includes(g)||(n.routes||[]).includes(g))),api:n.apiPrefix||"/api/",timeout:Math.max(500,Number(n.networkTimeoutMs)||1500),precacheTimeout:Number.isFinite(c)&&c>0?Math.min(2147483647,Math.max(1,Math.floor(c))):1e4,networkFirst:(n.networkFirst||[]).filter((g)=>typeof g==="string"&&g.startsWith("/")),updateOnColdStart:n.updateOnColdStart===!0,fallback:n.fallback||n.pages&&n.pages[0]||null,fallbackScope:Fn(n.fallback||n.pages&&n.pages[0]||null,n.fallbackScope),routes:(n.routes||[]).map(jn).filter(Boolean),exclude:["/_stx/hmr","/_stx/sw.js",...n.exclude||[]],mediaMax:Math.max(10485760,Number(n.mediaMaxBytes)||629145600),assetsMax:Math.max(50,Number(n.assetsMaxEntries)||500)};return`/* stx offline worker, build ${a.build} */
583
583
  'use strict';
584
584
  var S = ${JSON.stringify(a)};
@@ -1293,35 +1293,35 @@ ${R}
1293
1293
  </style>`;a=a.replace(x,D),b.lastIndex=0}catch(R){}}}return a}import st from"path";var qn=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.\.?\/[^'"]*)\2/g,Vn=/(<script\b[^>]*>)([\s\S]*?)(<\/script>)/gi;function Wn(n,e){if(!e||!n.includes("/"))return n;let c=st.dirname(e);return n.replace(qn,(a,g,r,d)=>{let b=st.resolve(c,d);return`${g}${r}${b.split(st.sep).join("/")}${r}`})}function lr(n,e){if(!e||!n.includes("<script"))return n;return n.replace(Vn,(c,a,g,r)=>`${a}${Wn(g,e)}${r}`)}var Ee="<!--PARENT_CONTENT_PLACEHOLDER-->";function ur(n){return n.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function wr(n,e){let c=n.length,a=e,g=!0,r=[],d=(b)=>b+9<=c&&n[b]==="<"&&n[b+1]==="/"&&(n[b+2]==="s"||n[b+2]==="S")&&(n[b+3]==="c"||n[b+3]==="C")&&(n[b+4]==="r"||n[b+4]==="R")&&(n[b+5]==="i"||n[b+5]==="I")&&(n[b+6]==="p"||n[b+6]==="P")&&(n[b+7]==="t"||n[b+7]==="T")&&(n[b+8]===">"||/\s/.test(n[b+8]));while(a<c){let b=n[a];if(d(a))return a;if(b==="/"&&n[a+1]==="/"){if(a=n.indexOf(`
1294
1294
  `,a+2),a===-1)return-1;a+=1,g=!0;continue}if(b==="/"&&n[a+1]==="*"){let m=n.indexOf("*/",a+2);if(m===-1)return-1;a=m+2,g=!0;continue}if(b==="/"&&g){let m=a+1,x=!1;while(m<c){let w=n[m];if(w==="\\"){m+=2;continue}if(w==="[")x=!0;else if(w==="]")x=!1;else if(w==="/"&&!x){m++;break}else if(w===`
1295
1295
  `){m=-1;break}m++}if(m===-1){a++,g=!1;continue}while(m<c&&/[a-z]/.test(n[m]))m++;a=m,g=!1;continue}if(b==="'"||b==='"'){let m=b;a++;while(a<c){if(n[a]==="\\"){a+=2;continue}if(n[a]===m){a++;break}if(n[a]===`
1296
- `)break;a++}g=!1;continue}if(b==="`"){a++;while(a<c){if(n[a]==="\\"){a+=2;continue}if(n[a]==="`"){a++;break}if(n[a]==="$"&&n[a+1]==="{"){r.push(!0),a+=2,g=!0;break}a++}if(r.length===0)g=!1;continue}if(b==="}"&&r.length>0){r.pop(),a++;while(a<c){if(n[a]==="\\"){a+=2;continue}if(n[a]==="`"){a++,g=!1;break}if(n[a]==="$"&&n[a+1]==="{"){r.push(!0),a+=2,g=!0;break}a++}continue}if(/\s/.test(b));else if(/[)\].\w$]/.test(b))g=!1;else g=!0;a++}return-1}function xr(n,e){let c=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`<script\\b(?=[^>]*\\b${c}(?:\\s|=|/?>))[^>]*>`,"i").exec(n);if(!a)return null;let g=a.index+a[0].length,r=n.indexOf("</script>",g);if(r===-1)return null;let d=n.indexOf(">",r);if(d===-1)return null;return{start:a.index,end:d+1}}var zn=4096;async function ot(n,e,c){if(c.buildMode!=="serve"||e.length<zn)return null;let{registerServeModuleBundle:a}=await import("./chunk-nqn4dvqd.js");return`<script ${n} src="${a(e)}"></script>`}async function tr(n,e,c,a){try{let{registeredModuleIdsIn:g,buildModuleRegistryScript:r}=await o("stx/client-module-registry",()=>import("./chunk-a4yzet7p.js")),d=[],b=await r(g(...n),{minify:$i(e.buildMode,e.minifyClient),collectInputs:d});for(let m of d)c?.add(m);if(a)a.inputs=d,a.code=b??void 0;if(!b)return null;if(e.buildMode==="serve"){let{registerServeModuleBundle:m}=await import("./chunk-nqn4dvqd.js");return`<script data-stx-scoped data-stx-run="always" data-stx-modules src="${m(b)}"></script>`}return`<script data-stx-scoped data-stx-run="always" data-stx-modules>${b.replace(/<\/script/gi,"<\\/script")}</script>`}catch{return null}}async function Kn(n,e,c,a){let g={modulesTag:null,modulesCode:null,storeTag:null,storeCode:null,composableTag:null,composableCode:null,frameworkScript:null};try{let{getFrameworkComposableScript:k}=await o("stx/framework-composables",()=>import("./chunk-ek5ynvqh.js"));g.frameworkScript=await k(n)}catch{}let r=null;try{r=await o("stx/store-loader",()=>import("./chunk-54kn2jtw.js"))}catch{}let d=e.storesDir,b=!!a.__stx_native_screen||(r?.pageStoresAll()??!0),m=b?"":n.replace(/<script\b[^>]*\bdata-stx-(?:runtime|router|hmr)\b[^>]*>[\s\S]*?<\/script>/gi,""),x=[],w=[],v=null;for(let k=0;k<8;k++){let S=null,M="",T=!1;try{if(r){let N=b?await r.getStoreScript(d).then((B)=>B?{code:B,stores:["*"],functions:null}:null):await r.getStoreScriptFor(d,[m],{reads:r.storesReadInFiles([...x,...w]),runOnce:!0});if(N)S=N.code,M=N.stores.join(","),T=!!N.functions&&!b}}catch{}if(v!==null&&M===v)break;v=M;let R=T?'data-stx-scoped data-stx-run="always" data-stx-stores':"data-stx-stores",D=S?`<script ${R}>${S}</script>`:null;g.storeCode=S,g.storeTag=S?await ot(R,S,e)??D:null;let P={};g.modulesTag=await tr([n,D],e,c,P),g.modulesCode=P.code??null,x=P.inputs??[],g.composableTag=null,g.composableCode=null,w=[];try{let{getComposableScript:N}=await o("stx/composable-loader",()=>import("./chunk-mcgqgheq.js")),B=e.composablesDir,O=[g.modulesCode??g.modulesTag,D,g.frameworkScript].filter((H)=>H!==null),L=await N(e._layerComposableDirs??B,n,O,w);if(L)g.composableCode=L,g.composableTag=await ot('data-stx-scoped data-stx-run="always" data-stx-composables',L,e)??`<script data-stx-scoped data-stx-run="always" data-stx-composables>${L}</script>`}catch{}if(b||!r)break}return g}async function Gn(n,e,c,a={}){let{withModuleSubstitutes:g,moduleSubstitutionKey:r}=await import("./chunk-0633xsmx.js"),d=await import("./chunk-n1tbc7da.js"),{messages:b,webModules:m}=e,x=null,w=null,v=r()===""&&!a.__stx_native_screen;if(b&&d.pageMessagesEnabled(e)&&v)try{x=await d.loadPageMessages(process.cwd(),b)}catch(R){Zn(R)}if(m&&Object.keys(m).length&&v)try{w=await(await import("./chunk-skht06a2.js")).loadWebModules(process.cwd(),m)}catch(R){Jn(R)}let k=new Map([...w??[],...x?.stubs??[]]),S=()=>Kn(n,e,c,a),M=k.size?await g(k,S):await S(),T=null;if(x){let R=d.messageAreasIn(M.modulesCode,M.storeCode,M.composableCode),D=d.pageMessagesScript(x,d.pageLanguages(n,x),R);if(D)T=await ot('data-stx-scoped data-stx-run="always" data-stx-messages',D,e)??`<script data-stx-scoped data-stx-run="always" data-stx-messages>${D.replace(/<\/script/gi,"<\\/script")}</script>`}return[T,M.modulesTag,M.storeTag,M.composableTag,M.frameworkScript].filter((R)=>R!==null)}var pr=!1;function Zn(n){if(pr)return;pr=!0,console.warn(`[stx] messages: ${n instanceof Error?n.message:String(n)}; pages ship every language`)}var fr=!1;function Jn(n){if(fr)return;fr=!0,console.warn(`[stx] ${n instanceof Error?n.message:String(n)}; pages bundle the real modules`)}function Qn(n,e=""){let c=xr(n,"data-stx-runtime");if(!c)return n;let a=ar(n);if(a===-1||a===c.start){if(!e)return n;return n.slice(0,c.end)+e+n.slice(c.end)}if(a<c.start)return n.slice(0,a)+n.slice(c.start,c.end)+e+`
1296
+ `)break;a++}g=!1;continue}if(b==="`"){a++;while(a<c){if(n[a]==="\\"){a+=2;continue}if(n[a]==="`"){a++;break}if(n[a]==="$"&&n[a+1]==="{"){r.push(!0),a+=2,g=!0;break}a++}if(r.length===0)g=!1;continue}if(b==="}"&&r.length>0){r.pop(),a++;while(a<c){if(n[a]==="\\"){a+=2;continue}if(n[a]==="`"){a++,g=!1;break}if(n[a]==="$"&&n[a+1]==="{"){r.push(!0),a+=2,g=!0;break}a++}continue}if(/\s/.test(b));else if(/[)\].\w$]/.test(b))g=!1;else g=!0;a++}return-1}function xr(n,e){let c=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`<script\\b(?=[^>]*\\b${c}(?:\\s|=|/?>))[^>]*>`,"i").exec(n);if(!a)return null;let g=a.index+a[0].length,r=n.indexOf("</script>",g);if(r===-1)return null;let d=n.indexOf(">",r);if(d===-1)return null;return{start:a.index,end:d+1}}var zn=4096;async function ot(n,e,c){if(c.buildMode!=="serve"||e.length<zn)return null;let{registerServeModuleBundle:a}=await import("./chunk-0e0z4ab6.js");return`<script ${n} src="${a(e)}"></script>`}async function tr(n,e,c,a){try{let{registeredModuleIdsIn:g,buildModuleRegistryScript:r}=await o("stx/client-module-registry",()=>import("./chunk-t9byym6f.js")),d=[],b=await r(g(...n),{minify:Ri(e.buildMode,e.minifyClient),collectInputs:d});for(let m of d)c?.add(m);if(a)a.inputs=d,a.code=b??void 0;if(!b)return null;if(e.buildMode==="serve"){let{registerServeModuleBundle:m}=await import("./chunk-0e0z4ab6.js");return`<script data-stx-scoped data-stx-run="always" data-stx-modules src="${m(b)}"></script>`}return`<script data-stx-scoped data-stx-run="always" data-stx-modules>${b.replace(/<\/script/gi,"<\\/script")}</script>`}catch{return null}}async function Kn(n,e,c,a){let g={modulesTag:null,modulesCode:null,storeTag:null,storeCode:null,composableTag:null,composableCode:null,frameworkScript:null};try{let{getFrameworkComposableScript:k}=await o("stx/framework-composables",()=>import("./chunk-sb6jph84.js"));g.frameworkScript=await k(n)}catch{}let r=null;try{r=await o("stx/store-loader",()=>import("./chunk-mzvccryg.js"))}catch{}let d=e.storesDir,b=!!a.__stx_native_screen||(r?.pageStoresAll()??!0),m=b?"":n.replace(/<script\b[^>]*\bdata-stx-(?:runtime|router|hmr)\b[^>]*>[\s\S]*?<\/script>/gi,""),x=[],w=[],v=null;for(let k=0;k<8;k++){let S=null,M="",T=!1;try{if(r){let N=b?await r.getStoreScript(d).then((B)=>B?{code:B,stores:["*"],functions:null}:null):await r.getStoreScriptFor(d,[m],{reads:r.storesReadInFiles([...x,...w]),runOnce:!0});if(N)S=N.code,M=N.stores.join(","),T=!!N.functions&&!b}}catch{}if(v!==null&&M===v)break;v=M;let R=T?'data-stx-scoped data-stx-run="always" data-stx-stores':"data-stx-stores",D=S?`<script ${R}>${S}</script>`:null;g.storeCode=S,g.storeTag=S?await ot(R,S,e)??D:null;let P={};g.modulesTag=await tr([n,D],e,c,P),g.modulesCode=P.code??null,x=P.inputs??[],g.composableTag=null,g.composableCode=null,w=[];try{let{getComposableScript:N}=await o("stx/composable-loader",()=>import("./chunk-z845f18k.js")),B=e.composablesDir,O=[g.modulesCode??g.modulesTag,D,g.frameworkScript].filter((H)=>H!==null),L=await N(e._layerComposableDirs??B,n,O,w);if(L)g.composableCode=L,g.composableTag=await ot('data-stx-scoped data-stx-run="always" data-stx-composables',L,e)??`<script data-stx-scoped data-stx-run="always" data-stx-composables>${L}</script>`}catch{}if(b||!r)break}return g}async function Gn(n,e,c,a={}){let{withModuleSubstitutes:g,moduleSubstitutionKey:r}=await import("./chunk-3kaw5zjm.js"),d=await import("./chunk-tg18j1yf.js"),{messages:b,webModules:m}=e,x=null,w=null,v=r()===""&&!a.__stx_native_screen;if(b&&d.pageMessagesEnabled(e)&&v)try{x=await d.loadPageMessages(process.cwd(),b)}catch(R){Zn(R)}if(m&&Object.keys(m).length&&v)try{w=await(await import("./chunk-076fj387.js")).loadWebModules(process.cwd(),m)}catch(R){Jn(R)}let k=new Map([...w??[],...x?.stubs??[]]),S=()=>Kn(n,e,c,a),M=k.size?await g(k,S):await S(),T=null;if(x){let R=d.messageAreasIn(M.modulesCode,M.storeCode,M.composableCode),D=d.pageMessagesScript(x,d.pageLanguages(n,x),R);if(D)T=await ot('data-stx-scoped data-stx-run="always" data-stx-messages',D,e)??`<script data-stx-scoped data-stx-run="always" data-stx-messages>${D.replace(/<\/script/gi,"<\\/script")}</script>`}return[T,M.modulesTag,M.storeTag,M.composableTag,M.frameworkScript].filter((R)=>R!==null)}var pr=!1;function Zn(n){if(pr)return;pr=!0,console.warn(`[stx] messages: ${n instanceof Error?n.message:String(n)}; pages ship every language`)}var fr=!1;function Jn(n){if(fr)return;fr=!0,console.warn(`[stx] ${n instanceof Error?n.message:String(n)}; pages bundle the real modules`)}function Qn(n,e=""){let c=xr(n,"data-stx-runtime");if(!c)return n;let a=ar(n);if(a===-1||a===c.start){if(!e)return n;return n.slice(0,c.end)+e+n.slice(c.end)}if(a<c.start)return n.slice(0,a)+n.slice(c.start,c.end)+e+`
1297
1297
  `+n.slice(a,c.start)+n.slice(c.end);let g=n.slice(c.start,c.end),r=n.slice(0,c.start)+n.slice(c.end),d=ar(r);if(d===-1)return g+e+`
1298
1298
  `+r;return r.slice(0,d)+g+e+`
1299
- `+r.slice(d)}function Yn(n){let e=/\x00STX_ESC_MUSTACHE_OPEN\x00([\s\S]*?)\x00STX_ESC_MUSTACHE_CLOSE\x00/g;return n.replace(e,(c,a,g)=>{let r=n.slice(0,g);return r.lastIndexOf("<")>r.lastIndexOf(">")?`{{${a}}}`:`{<!--stx-literal-->{${a}}}`})}async function i(n,e,c,a,g){if(a.ssr===!1&&!a.autoShell&&a.buildMode==="spa")return n;if(e.__stx_signals_gate===void 0)e.__stx_signals_gate=Se(n,c);let r=!e.__stxProcessingDepth;mn(e);for(let d of a._layerGraph?.configDependencies??[])g.add(d);if(r&&a.runtimeConfig)await vn(e,c,a.runtimeConfig);if(r)Vc(e),e.__stx_scope_seq??={n:0,key:Vs(String(e.__filename??c))},e.__stx_head_injections=Ci(),e.__stx_seo_staged=!1;if(!e.__stxProcessingDepth)e.__stxProcessingDepth=0;if(e.__stxProcessingDepth++,!e.__onceStore)e.__onceStore=new Set;if((a.debug||!E()&&!_n())&&c&&c.endsWith(".stx"))Do(n,c);try{return await ie.timeAsync("template-processing",async()=>{let d=await es(n,e,c,a,g);if(r)d=fi(d);if(r&&a.autoShell&&a.buildMode!=="compile"){let b=_e(a.app?.head,{known:Ir,source:"app.head"}),x=(e.__stx_runtime_head||null)??Ti(),w=(e.__stx_head_raw||"").trim(),v,k=w.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(k)v=k[1].trim(),w=w.replace(k[0],"").trim();let S=e.__sections?.title,M=S?_(S,e,c):void 0,T=x.title||v||M,R=!x.title&&(!!v||!!M),D=x.meta||[],P=new Set(D.map((X)=>it(X)).filter(Boolean)),N={...b,...T&&{title:T},meta:[...(b.meta||[]).filter((X)=>!P.has(it(X))),...D],link:[...b.link||[],...x.link||[]],script:[...b.script||[],...x.script||[]],headRaw:[b.headRaw,w].filter(Boolean).join(`
1300
- `),...x.htmlAttrs&&{htmlAttrs:il(b.htmlAttrs,x.htmlAttrs)},...x.bodyAttrs&&{bodyAttrs:{...b.bodyAttrs||{},...x.bodyAttrs}}},B=Ei(d);if(d=Ar(d,N,{...R&&{titleIsHtml:!0},...a.app?.colorMode&&{colorMode:a.app.colorMode}},B),B)d=cl(d,b),d=Rr(d,N.htmlAttrs);let O=d.match(/<!-- stx-layout: ([^ ]+) -->/);if(O&&d.includes("<head")){let X=O[1],z=As(X);d=d.replace(/<head\b[^>]*>/i,(Y)=>`${Y}
1299
+ `+r.slice(d)}function Yn(n){let e=/\x00STX_ESC_MUSTACHE_OPEN\x00([\s\S]*?)\x00STX_ESC_MUSTACHE_CLOSE\x00/g;return n.replace(e,(c,a,g)=>{let r=n.slice(0,g);return r.lastIndexOf("<")>r.lastIndexOf(">")?`{{${a}}}`:`{<!--stx-literal-->{${a}}}`})}async function i(n,e,c,a,g){if(a.ssr===!1&&!a.autoShell&&a.buildMode==="spa")return n;if(e.__stx_signals_gate===void 0)e.__stx_signals_gate=Se(n,c);let r=!e.__stxProcessingDepth;mn(e);for(let d of a._layerGraph?.configDependencies??[])g.add(d);if(r&&a.runtimeConfig)await vn(e,c,a.runtimeConfig);if(r)Uc(e),e.__stx_scope_seq??={n:0,key:Vs(String(e.__filename??c))},e.__stx_head_injections=Ei(),e.__stx_seo_staged=!1;if(!e.__stxProcessingDepth)e.__stxProcessingDepth=0;if(e.__stxProcessingDepth++,!e.__onceStore)e.__onceStore=new Set;if((a.debug||!E()&&!_n())&&c&&c.endsWith(".stx"))Do(n,c);try{return await ie.timeAsync("template-processing",async()=>{let d=await es(n,e,c,a,g);if(r)d=gi(d);if(r&&a.autoShell&&a.buildMode!=="compile"){let b=_e(a.app?.head,{known:Ir,source:"app.head"}),x=(e.__stx_runtime_head||null)??$i(),w=(e.__stx_head_raw||"").trim(),v,k=w.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(k)v=k[1].trim(),w=w.replace(k[0],"").trim();let S=e.__sections?.title,M=S?_(S,e,c):void 0,T=x.title||v||M,R=!x.title&&(!!v||!!M),D=x.meta||[],P=new Set(D.map((X)=>it(X)).filter(Boolean)),N={...b,...T&&{title:T},meta:[...(b.meta||[]).filter((X)=>!P.has(it(X))),...D],link:[...b.link||[],...x.link||[]],script:[...b.script||[],...x.script||[]],headRaw:[b.headRaw,w].filter(Boolean).join(`
1300
+ `),...x.htmlAttrs&&{htmlAttrs:al(b.htmlAttrs,x.htmlAttrs)},...x.bodyAttrs&&{bodyAttrs:{...b.bodyAttrs||{},...x.bodyAttrs}}},B=Ti(d);if(d=Ar(d,N,{...R&&{titleIsHtml:!0},...a.app?.colorMode&&{colorMode:a.app.colorMode}},B),B)d=ll(d,b),d=Rr(d,N.htmlAttrs);let O=d.match(/<!-- stx-layout: ([^ ]+) -->/);if(O&&d.includes("<head")){let X=O[1],z=As(X);d=d.replace(/<head\b[^>]*>/i,(Y)=>`${Y}
1301
1301
  <meta name="stx-layout" content="${ur(X)}">
1302
- <meta name="stx-layout-group" content="${ur(z)}">`)}let L=d.match(/function (__stx_setup_\w+)\(/),H=L?j(d):null;if(L&&H&&!/\bdata-stx=/.test(H.tag)){d=Ye(d,(z,Y)=>`<body${Y} data-stx="${L[1]}">`);let X=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${L[1]}"`,"i");d=d.replace(X,"$1")}}if(r){let b=e.__stx_head_injections??Ci(),m=al(d);if(m!==null)b.beforeClose.push(m);let x=Yt(d);if(x!==null)b.afterOpen.push(x);if(a.offline?.enabled&&!d.includes("data-stx-offline"))b.beforeClose.push(er);d=sl(d,b);let w=a.app?.colorMode;if(w)d=$r(d,w)}if(r)if(xr(d,"data-stx-runtime")){let m=await Gn(d,a,g,e);d=Qn(d,m.map((x)=>`
1302
+ <meta name="stx-layout-group" content="${ur(z)}">`)}let L=d.match(/function (__stx_setup_\w+)\(/),H=L?j(d):null;if(L&&H&&!/\bdata-stx=/.test(H.tag)){d=Ye(d,(z,Y)=>`<body${Y} data-stx="${L[1]}">`);let X=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${L[1]}"`,"i");d=d.replace(X,"$1")}}if(r){let b=e.__stx_head_injections??Ei(),m=cl(d);if(m!==null)b.beforeClose.push(m);let x=Yt(d);if(x!==null)b.afterOpen.push(x);if(a.offline?.enabled&&!d.includes("data-stx-offline"))b.beforeClose.push(er);d=ol(d,b);let w=a.app?.colorMode;if(w)d=$r(d,w)}if(r)if(xr(d,"data-stx-runtime")){let m=await Gn(d,a,g,e);d=Qn(d,m.map((x)=>`
1303
1303
  ${x}`).join(""))}else{let m=await tr([d],a,g);if(m){let x=d.search(/<script\b[^>]*>(?:(?!<\/script>)[\s\S])*?__stxModules\[/i);if(x!==-1)d=d.slice(0,x)+m+`
1304
- `+d.slice(x)}}if(r)d=ol(d);if(r&&e.__stx_inject_css!==!1)d=await y(d,void 0,a.buildMode==="serve",!0);else if(r)d=fn(d);if(d=d.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),d=Yn(d),r&&e.__stx_runtime_config)d=Dt(d,e.__stx_runtime_config);if(r&&!e.__stx_defer_server_data){let b=_r(e);if(b){let m=/<head\b[^>]*>/i.exec(d),x=m?m.index+m[0].length:0;d=d.slice(0,x)+b+d.slice(x)}}return d})}catch(d){if(d instanceof q)throw d;let b=d instanceof Error?d.message:String(d),m=new ae(`Template processing failed: ${b}`,c,void 0,void 0,n.substring(0,200)+(n.length>200?"...":""));if(F.log(m,{filePath:c,context:e}),Sn.logDetailedError(m,{filePath:c,template:n.substring(0,500)}),E()&&!a.debug)console.error(`[stx] ${oe.relative(process.cwd(),c)||c}: ${m.message}`);if(a.debug)throw m;return ki.createFallbackContent("Template Processing",m)}}async function es(n,e,c,a,g){let r=process.cwd(),d={...a,partialsDir:a.partialsDir&&!oe.isAbsolute(a.partialsDir)?oe.resolve(r,a.partialsDir):a.partialsDir,componentsDir:a.componentsDir&&!oe.isAbsolute(a.componentsDir)?oe.resolve(r,a.componentsDir):a.componentsDir,layoutsDir:a.layoutsDir&&!oe.isAbsolute(a.layoutsDir)?oe.resolve(r,a.layoutsDir):a.layoutsDir},b=d,m=n;await ns(c,e),rs(e,b),m=await ke(()=>qt(m,e,c,b),m,(O)=>{F.log(O,{filePath:c,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${c}: ${O.message}`)}),m=m.replace(/\{\{--[\s\S]*?--\}\}/g,"");let x=pe(m,Ne,(O,L)=>`\x00STX_HTML_COMMENT_${L}\x00`);m=x.output;let w=x.tokens,v=(O)=>w.length===0?O:O.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(L,H)=>w[Number(H)]??""),k="\x00STX_ESCAPED_AT\x00",S="\x00STX_ESC_MUSTACHE_OPEN\x00",M="\x00STX_ESC_MUSTACHE_CLOSE\x00";m=m.replace(/@@/g,k),m=m.replace(/@\{\{([\s\S]*?)\}\}/g,(O,L)=>`${S}${L}${M}`),m=Kt(m),m=await ir(m,c,g);let T={};m=as(m,T);let R={...e.__sections||{}},D="",P=mt(yt(n)),N=/@nolayout\b/.test(m)||P===!1;if(/@nolayout\b/.test(m))m=m.replace(/@nolayout\b\s*/g,"");let B=m.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(B)D=B[1],m=m.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof P==="string"){if(D=P,!/@section\s*\(/.test(m))m=`@section('content')
1304
+ `+d.slice(x)}}if(r)d=il(d);if(r&&e.__stx_inject_css!==!1)d=await y(d,void 0,a.buildMode==="serve",!0);else if(r)d=fn(d);if(d=d.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),d=Yn(d),r&&e.__stx_runtime_config)d=Dt(d,e.__stx_runtime_config);if(r&&!e.__stx_defer_server_data){let b=_r(e);if(b){let m=/<head\b[^>]*>/i.exec(d),x=m?m.index+m[0].length:0;d=d.slice(0,x)+b+d.slice(x)}}return d})}catch(d){if(d instanceof q)throw d;let b=d instanceof Error?d.message:String(d),m=new ae(`Template processing failed: ${b}`,c,void 0,void 0,n.substring(0,200)+(n.length>200?"...":""));if(F.log(m,{filePath:c,context:e}),Sn.logDetailedError(m,{filePath:c,template:n.substring(0,500)}),E()&&!a.debug)console.error(`[stx] ${oe.relative(process.cwd(),c)||c}: ${m.message}`);if(a.debug)throw m;return _i.createFallbackContent("Template Processing",m)}}async function es(n,e,c,a,g){let r=process.cwd(),d={...a,partialsDir:a.partialsDir&&!oe.isAbsolute(a.partialsDir)?oe.resolve(r,a.partialsDir):a.partialsDir,componentsDir:a.componentsDir&&!oe.isAbsolute(a.componentsDir)?oe.resolve(r,a.componentsDir):a.componentsDir,layoutsDir:a.layoutsDir&&!oe.isAbsolute(a.layoutsDir)?oe.resolve(r,a.layoutsDir):a.layoutsDir},b=d,m=n;await ns(c,e),rs(e,b),m=await ke(()=>qt(m,e,c,b),m,(O)=>{F.log(O,{filePath:c,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${c}: ${O.message}`)}),m=m.replace(/\{\{--[\s\S]*?--\}\}/g,"");let x=pe(m,Ne,(O,L)=>`\x00STX_HTML_COMMENT_${L}\x00`);m=x.output;let w=x.tokens,v=(O)=>w.length===0?O:O.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(L,H)=>w[Number(H)]??""),k="\x00STX_ESCAPED_AT\x00",S="\x00STX_ESC_MUSTACHE_OPEN\x00",M="\x00STX_ESC_MUSTACHE_CLOSE\x00";m=m.replace(/@@/g,k),m=m.replace(/@\{\{([\s\S]*?)\}\}/g,(O,L)=>`${S}${L}${M}`),m=Kt(m),m=await ir(m,c,g);let T={};m=as(m,T);let R={...e.__sections||{}},D="",P=mt(yt(n)),N=/@nolayout\b/.test(m)||P===!1;if(/@nolayout\b/.test(m))m=m.replace(/@nolayout\b\s*/g,"");let B=m.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(B)D=B[1],m=m.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof P==="string"){if(D=P,!/@section\s*\(/.test(m))m=`@section('content')
1305
1305
  ${m.trim()}
1306
1306
  @endsection`}if(!D&&!N&&b.defaultLayout){let O=kn(m),L=/@section\s*\(/.test(m);if(!O||L){let H="",X=oe.dirname(c),z=b.layoutsDir?oe.dirname(b.layoutsDir):process.cwd();for(let Y=0;Y<20;Y++){let ee=oe.join(X,"_layout.stx");if(await s(ee)){H=ee;break}let te=oe.dirname(X);if(te===X||te.length<z.length)break;X=te}if(H)D=H;else if(b.layoutsDir){let Y=oe.isAbsolute(b.layoutsDir)?b.layoutsDir:oe.resolve(process.cwd(),b.layoutsDir),ee=oe.join(Y,`${b.defaultLayout}.stx`);if(await s(ee))D=ee}if(D&&!L)m=`@section('content')
1307
1307
  ${m.trim()}
1308
1308
  @endsection`}}if(D&&m.includes("<script")){let O=G(m),L=O.scripts.map((H)=>mr(H,c)??H);m=vr(O.output,L)}if(m=m.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(O,L,H)=>(R[L]=H,"")),m=m.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(O,L,H)=>{if(/^(['"]).*\1$/.test(H.trim()))return O;try{let X=u(H.trim(),e);if(X===void 0)return O;let Y=(e.__stx_inline_section_values??=[]).push(X)-1;return R[L]=`{{ __stx_inline_section_values[${Y}] }}`,""}catch{return O}}),m=m.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(O,L,H)=>{if(H.includes("@parent"))R[L]=H.replace("@parent",Ee);else R[L]=H.trim();return""}),e.__sections=R,m=m.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(O,L,H)=>R[L]||H||""),!("slot"in e)||e.slot===void 0)m=m.replace(/\{\{\s*slot\s*\}\}/g,()=>R.content||"");if(m=cs(m,T),D){let O=[],L=G(m),H=pe(L.output,pn,(X,z)=>`\x00STX_ORPHAN_STYLE_${z}\x00`);if(m=H.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(X,z,Y)=>{let ee=z==="SCRIPT"?mr(L.scripts[Number(Y)],c):H.tokens[Number(Y)];if(ee)O.push(ee);return""}),O.length>0){let X=O.join(`
1309
1309
  `);R.content=R.content?`${R.content}
1310
1310
  ${X}`:X,e.__sections=R}}if(D)try{let O;if(oe.isAbsolute(D))O=D,g.add(D);else O=await ke(()=>bn(D,c,d,g),null,()=>{throw new ae(`Failed to resolve layout path: ${D}`,c,void 0,void 0,`Layout referenced from ${c}`)});if(!O){let ee=(K)=>{if(!K)return[];try{let ge=oe.isAbsolute(K)?K:oe.resolve(process.cwd(),K);return Xn.readdirSync(ge).filter((we)=>we.endsWith(".stx")).map((we)=>we.replace(/\.stx$/,""))}catch{return[]}},te=[...ee(d.layoutsDir),...ee(d.fallbackLayoutsDir)].filter((K,ge,we)=>we.indexOf(K)===ge).sort(),ce=[d.layoutsDir,d.fallbackLayoutsDir].filter((K)=>typeof K==="string"&&K.length>0),ue=ce.length>0?` Searched: ${ce.join(", ")} (set \`layoutsDir\` to look elsewhere).`:"",ne=`Layout not found: ${D} (referenced from ${c})`+(te.length>0?`. Available layouts: ${te.join(", ")}`:d.layoutsDir?`. No .stx layouts found in ${d.layoutsDir}`:"")+ue;if(F.log(Error(ne),{layoutPath:D,filePath:c,available:te},"error"),console.error(`[stx] ${ne}`),d.debug)throw new ae(ne,c);return m}let L=await ke(()=>Bun.file(O).text(),"",()=>{throw new ae(`Failed to read layout file: ${O}`,c,void 0,void 0,"Layout content could not be loaded")});L=lr(L,O);let H=L.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(H){if(d.debug)console.log(`Found nested layout: ${H[1]} in ${O}`);let ee={},te=L.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(ne,K,ge)=>(ee[K]=ge.trim(),""));for(let[ne,K]of Object.entries(ee))if(R[ne]&&R[ne].includes(Ee)){let ge=R[ne].indexOf(Ee);R[ne]=R[ne].slice(0,ge)+K+R[ne].slice(ge+Ee.length)}else if(!R[ne])R[ne]=K;let ce={...e,__sections:R},ue=`@layout('${H[1]}')${te}`;return await i(ue,ce,O,d,g)}let X=L.replace(/\{\{--[\s\S]*?--\}\}/g,""),z=as(X,T),Y={};return z=z.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(ee,te,ce)=>(Y[te]=ce.trim(),`@slot('${te}')`)),z=z.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(ee,te,ce)=>{if(R[te]){let ue=R[te];if(ue.includes(Ee)){let ne=Y[te]||"",K=ue.indexOf(Ee);ue=ue.slice(0,K)+ne+ue.slice(K+Ee.length)}return ue}return ce||""}),z=ts(z,R),z=z.replace(/\{\{\s*slot\s*\}\}/g,()=>R.content||""),z=cs(z,T),e.__originalFilePath=c,m=await br(z,e,O,d,g),m=`<!-- stx-layout: ${D} -->
1311
- ${m}`,v(m)}catch(O){if(O instanceof q)throw O;throw new ae(`Error processing layout ${D}: ${O instanceof Error?O.message:String(O)}`,c)}return v(await br(m,e,c,d,g))}function ts(n,e){return n.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(c,a,g)=>{let r=e[a];if(r!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(r))return r}return g||""})}function rs(n,e){if(n.__stx_sfc_mode=!0,n.__stx_options=e,e.buildMode)n.__stx_buildMode=e.buildMode;let c=e.envPrefix||"STX_PUBLIC_",a={};for(let[g,r]of Object.entries(process.env))if(g.startsWith(c)&&r!==void 0)a[g]=r;n.$env=a}async function ns(n,e){await ke(()=>Xt(n,e),void 0,(c)=>{F.log(c,{filePath:n,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${n}: ${c.message}`)})}var at="data-stx-source";function mr(n,e){if(!n)return n;let c=/^<script\b([^>]*)>/i.exec(n);if(!c||!/\bserver\b/.test(c[1])||c[1].includes(at))return n;return`<script ${at}="${encodeURIComponent(e)}"${n.slice(7)}`}function ss(n){let e=new RegExp(`${at}="([^"]*)"`).exec(n);return e?decodeURIComponent(e[1]):void 0}function hr(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function yr(n,e,c){return`<div data-stx-server-script-error role="alert" style="padding:12px 14px;border:1px solid #f0b4b4;border-left-width:4px;background:#fff5f5;color:#7a1f1f;font:13px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace"><strong style="display:block;margin-bottom:4px">stx: a &lt;script server&gt; ${e==="module-resolution"?"imports a module that does not resolve":e==="syntax"?"does not parse":"names something that does not exist"}, so this component rendered nothing.</strong><span style="display:block;opacity:.85">${hr(n)}</span><span style="display:block;margin-top:4px">${hr(c)}</span></div>`}async function ls(n,e,c,a){let{scanScriptTags:g}=await o("stx/signal-processing",()=>import("./chunk-9bhvh2dc.js")),r=[],d=!E()&&!_n();for(let m of g(n)){let x=m.attrs;if(!/\bserver\b/.test(x))continue;let w=m.start+m.fullMatch.indexOf(">")+1,v=wr(n,w);if(v===-1)continue;let k=n.slice(w,v);if(!k.trim())continue;let S=ss(x)??c,M={index:m.start,length:v+9-m.start};try{let{extractVariables:T}=await o("stx/variable-extractor",()=>import("./chunk-r57s8jqs.js"));await T(k,e,S,{preserveExisting:!0,onFailure:(R)=>{if(R.kind==="unknown")return;if(a?.onServerScriptError?.({sourcePath:S,kind:R.kind,message:R.message}),!d)return;r.push({...M,markup:yr(S,R.kind,R.message)})}})}catch(T){let R=T instanceof Error?T:Error(String(T));if(F.log(R,{filePath:S,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${S}: ${R.message}`),d)r.push({...M,markup:yr(S,"unknown",R.message)})}}if(r.length===0)return n;let b=n;for(let m of r.sort((x,w)=>w.index-x.index))b=b.slice(0,m.index)+m.markup+b.slice(m.index+m.length);return b}async function ps(n,e,c){try{let{interpolateScriptsInTemplate:a}=await o("stx/expressions",()=>import("./chunk-xsck49x5.js"));return a(n,e,{skipServer:!0})}catch(a){let g=a instanceof Error?a:Error(String(a));return F.log(g,{filePath:c,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${c}: ${g.message}`),n}}async function br(n,e,c,a,g){let r=n,d=a;if(r=await ls(r,e,c,a),r=await Nt(r,e,c),r=await jt(r,e,c),r=await ps(r,e,c),r=await Tt(r,e,c,d),Se(r))r=Uo(r,e),r=hs(r,e),r=ms(r,e);r=Wo(r);let{processStreamDirectives:b}=await o("stx/streaming",()=>import("./chunk-pe89ztq6.js"));r=b(r,e),r=or(r,e,c,d,!0),r=await Qt(r,e,c,d,g),r=await us(r,e,c,d,g),r=pc(r,e,c,d);let{processDeferDirectives:m}=await o("stx/defer",()=>import("./chunk-6e76tz09.js"));r=m(r,e,c);let{processTeleportDirectives:x}=await o("stx/teleport",()=>import("./chunk-03mtfndv.js"));r=x(r,e,c);let{processTransitionDirectives:w,processTransitionAttributes:v}=await o("stx/transitions",()=>import("./chunk-18qxd18d.js"));r=w(r,e,c),r=v(r);let{processErrorBoundaryDirectives:k,stripRenderFailedMarkers:S}=await o("stx/error-boundaries",()=>import("./chunk-h85hrwkq.js"));r=k(r,e,c),r=S(r);let{processSuspenseDirectives:M}=await o("stx/suspense",()=>import("./chunk-avbvedyx.js"));r=M(r,e,c);let{processAsyncDirectives:T}=await o("stx/async-components",()=>import("./chunk-abzrvxct.js"));r=T(r,e,c);let{processKeepAliveDirectives:R}=await o("stx/keep-alive",()=>import("./chunk-h8kbcz9t.js"));r=R(r,e,c);let{processVirtualListDirectives:D,processVirtualGridDirectives:P,processInfiniteListDirectives:N}=await o("stx/virtual-scrolling",()=>import("./chunk-1cd0w20k.js"));r=D(r,e,c),r=P(r,e,c),r=N(r,e,c);let{processPartialHydrationDirectives:B,processStaticDirectives:O}=await o("stx/partial-hydration",()=>import("./chunk-72w08sh9.js"));r=B(r,e,c),r=O(r);let{processComputedDirectives:L,processWatchDirectives:H}=await o("stx/computed",()=>import("./chunk-1xdzcy9d.js"));r=L(r,e,c),r=H(r,e,c);let{processFormValidationDirectives:X}=await o("stx/forms-validation",()=>import("./chunk-54mc7876.js"));r=X(r,e,c);let{processHeadDirective:z,processTitleDirective:Y,processMetaDirective:ee,resetHead:te}=await o("stx/head",()=>import("./chunk-tsb5h4e2.js"));if(!e.__stx_head_preset&&!e.__stx_runtime_head)te();let ce=z(r);if(r=ce.content,ce.headContent)e.__stx_head_raw=`${e.__stx_head_raw||""}${ce.headContent}
1312
- `;if(r=Y(r,e),r=ee(r,e,c),r=Wt(r),r=Fo(r,e),r=Et(r),r=Bt(r),r=await is(r,e,c,d,g),r=await us(r,e,c,d,g),r=r.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),r=fi(r),r=se(r,e,c),r=ds(r),e.__stxProcessingDepth===1)r=Uc(r,e);if(r=jc(r,e,{filePath:c,buildMode:d.buildMode}),r=zo(r,e),r=Ho(r,e),r=We(r,e),r=Ot(r,e),r=Pt(r,e),r=await ht(r,e,c,d),r=await gc(r,e,c),r=await mc(r,e,c,d),r=hc(r,e,c,d),r=Zo(r,e,c,d),r=Qo(r,e,c),r=ei(r,e,c,d),r=St(r,e,c,d),r=zs(r,e),r=Hs(r),r=Fc(r),!d.skipEventDirectives)r=$c(r,e,c);if(r=Bc(r,e,c,a.skipSignalsRuntime===!0&&Number(e.__stxProcessingDepth)>0),d.debug){let V=/\bx-data\s*=/.test(r),W=gs(n);if(V&&W)console.warn(`[stx] ${c}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
1311
+ ${m}`,v(m)}catch(O){if(O instanceof q)throw O;throw new ae(`Error processing layout ${D}: ${O instanceof Error?O.message:String(O)}`,c)}return v(await br(m,e,c,d,g))}function ts(n,e){return n.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(c,a,g)=>{let r=e[a];if(r!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(r))return r}return g||""})}function rs(n,e){if(n.__stx_sfc_mode=!0,n.__stx_options=e,e.buildMode)n.__stx_buildMode=e.buildMode;let c=e.envPrefix||"STX_PUBLIC_",a={};for(let[g,r]of Object.entries(process.env))if(g.startsWith(c)&&r!==void 0)a[g]=r;n.$env=a}async function ns(n,e){await ke(()=>Xt(n,e),void 0,(c)=>{F.log(c,{filePath:n,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${n}: ${c.message}`)})}var at="data-stx-source";function mr(n,e){if(!n)return n;let c=/^<script\b([^>]*)>/i.exec(n);if(!c||!/\bserver\b/.test(c[1])||c[1].includes(at))return n;return`<script ${at}="${encodeURIComponent(e)}"${n.slice(7)}`}function ss(n){let e=new RegExp(`${at}="([^"]*)"`).exec(n);return e?decodeURIComponent(e[1]):void 0}function hr(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function yr(n,e,c){return`<div data-stx-server-script-error role="alert" style="padding:12px 14px;border:1px solid #f0b4b4;border-left-width:4px;background:#fff5f5;color:#7a1f1f;font:13px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace"><strong style="display:block;margin-bottom:4px">stx: a &lt;script server&gt; ${e==="module-resolution"?"imports a module that does not resolve":e==="syntax"?"does not parse":"names something that does not exist"}, so this component rendered nothing.</strong><span style="display:block;opacity:.85">${hr(n)}</span><span style="display:block;margin-top:4px">${hr(c)}</span></div>`}async function ls(n,e,c,a){let{scanScriptTags:g}=await o("stx/signal-processing",()=>import("./chunk-4qsamkyc.js")),r=[],d=!E()&&!_n();for(let m of g(n)){let x=m.attrs;if(!/\bserver\b/.test(x))continue;let w=m.start+m.fullMatch.indexOf(">")+1,v=wr(n,w);if(v===-1)continue;let k=n.slice(w,v);if(!k.trim())continue;let S=ss(x)??c,M={index:m.start,length:v+9-m.start};try{let{extractVariables:T}=await o("stx/variable-extractor",()=>import("./chunk-he6tejhc.js"));await T(k,e,S,{preserveExisting:!0,onFailure:(R)=>{if(R.kind==="unknown")return;if(a?.onServerScriptError?.({sourcePath:S,kind:R.kind,message:R.message}),!d)return;r.push({...M,markup:yr(S,R.kind,R.message)})}})}catch(T){let R=T instanceof Error?T:Error(String(T));if(F.log(R,{filePath:S,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${S}: ${R.message}`),d)r.push({...M,markup:yr(S,"unknown",R.message)})}}if(r.length===0)return n;let b=n;for(let m of r.sort((x,w)=>w.index-x.index))b=b.slice(0,m.index)+m.markup+b.slice(m.index+m.length);return b}async function ps(n,e,c){try{let{interpolateScriptsInTemplate:a}=await o("stx/expressions",()=>import("./chunk-m7nsk6fb.js"));return a(n,e,{skipServer:!0})}catch(a){let g=a instanceof Error?a:Error(String(a));return F.log(g,{filePath:c,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${c}: ${g.message}`),n}}async function br(n,e,c,a,g){let r=n,d=a;if(r=await ls(r,e,c,a),r=await Nt(r,e,c),r=await jt(r,e,c),r=await ps(r,e,c),r=await Tt(r,e,c,d),Se(r))r=Uo(r,e),r=hs(r,e),r=ms(r,e);r=Wo(r);let{processStreamDirectives:b}=await o("stx/streaming",()=>import("./chunk-7ffmz1fb.js"));r=b(r,e),r=or(r,e,c,d,!0),r=await Qt(r,e,c,d,g),r=await us(r,e,c,d,g),r=fc(r,e,c,d);let{processDeferDirectives:m}=await o("stx/defer",()=>import("./chunk-mmeck545.js"));r=m(r,e,c);let{processTeleportDirectives:x}=await o("stx/teleport",()=>import("./chunk-a8fy7jv8.js"));r=x(r,e,c);let{processTransitionDirectives:w,processTransitionAttributes:v}=await o("stx/transitions",()=>import("./chunk-tj7dh2dz.js"));r=w(r,e,c),r=v(r);let{processErrorBoundaryDirectives:k,stripRenderFailedMarkers:S}=await o("stx/error-boundaries",()=>import("./chunk-h85hrwkq.js"));r=k(r,e,c),r=S(r);let{processSuspenseDirectives:M}=await o("stx/suspense",()=>import("./chunk-x30gh7vt.js"));r=M(r,e,c);let{processAsyncDirectives:T}=await o("stx/async-components",()=>import("./chunk-m934bzg2.js"));r=T(r,e,c);let{processKeepAliveDirectives:R}=await o("stx/keep-alive",()=>import("./chunk-k0xdvegc.js"));r=R(r,e,c);let{processVirtualListDirectives:D,processVirtualGridDirectives:P,processInfiniteListDirectives:N}=await o("stx/virtual-scrolling",()=>import("./chunk-q5bct2ks.js"));r=D(r,e,c),r=P(r,e,c),r=N(r,e,c);let{processPartialHydrationDirectives:B,processStaticDirectives:O}=await o("stx/partial-hydration",()=>import("./chunk-j0hrk24j.js"));r=B(r,e,c),r=O(r);let{processComputedDirectives:L,processWatchDirectives:H}=await o("stx/computed",()=>import("./chunk-1xdzcy9d.js"));r=L(r,e,c),r=H(r,e,c);let{processFormValidationDirectives:X}=await o("stx/forms-validation",()=>import("./chunk-77s1kvzj.js"));r=X(r,e,c);let{processHeadDirective:z,processTitleDirective:Y,processMetaDirective:ee,resetHead:te}=await o("stx/head",()=>import("./chunk-s2zsa16d.js"));if(!e.__stx_head_preset&&!e.__stx_runtime_head)te();let ce=z(r);if(r=ce.content,ce.headContent)e.__stx_head_raw=`${e.__stx_head_raw||""}${ce.headContent}
1312
+ `;if(r=Y(r,e),r=ee(r,e,c),r=Wt(r),r=Fo(r,e),r=Et(r),r=Bt(r),r=await is(r,e,c,d,g),r=await us(r,e,c,d,g),r=r.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),r=gi(r),r=se(r,e,c),r=ds(r),e.__stxProcessingDepth===1)r=Wc(r,e);if(r=Bc(r,e,{filePath:c,buildMode:d.buildMode}),r=zo(r,e),r=Ho(r,e),r=We(r,e),r=Ot(r,e),r=Pt(r,e),r=await ht(r,e,c,d),r=await mc(r,e,c),r=await hc(r,e,c,d),r=yc(r,e,c,d),r=Zo(r,e,c,d),r=Qo(r,e,c),r=ei(r,e,c,d),r=St(r,e,c,d),r=zs(r,e),r=Hs(r),r=zc(r),!d.skipEventDirectives)r=Rc(r,e,c);if(r=Fc(r,e,c,a.skipSignalsRuntime===!0&&Number(e.__stxProcessingDepth)>0),d.debug){let V=/\bx-data\s*=/.test(r),W=gs(n);if(V&&W)console.warn(`[stx] ${c}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
1313
1313
  Both work on the same page, but they manage separate scopes.
1314
- Prefer signals (state/derived/effect) for new components.`)}r=ac(r,e),r=await _(r,e,c),r=zc(r),r=Hc(r),r=ft(r);let{processXElementDirectives:ue}=await o("stx/x-element",()=>import("./chunk-zhxdpzga.js"));r=ue(r);let ne=e.__originalFilePath||c,K=De(e);if(r=await qo(r,d,ne,K),r=Rt(r,e),r=await Vt(r,e,c,d),d.media?.image?.autoSiblings){let V=d.publicDir||"public",{rewriteImagesWithSiblings:W}=await o("stx/image-optimization/auto-sibling",()=>import("./chunk-9736003n.js"));r=await W(r,{publicDir:V})}if(d.seo?.enabled)r=ti(r,e,d);let ge=(V,W,J=!0)=>{if(!W)return V;let me=W.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),re=/<head\b[^>]*>[\s\S]*?(?:<\/head\s*>|<body\b|$)/i.exec(V),de=re?/<title\b[^>]*>[\s\S]*?<\/title>/i.exec(re[0]):null;if(me&&re&&de){if(J){let Te=re.index+de.index;V=V.slice(0,Te)+me[0]+V.slice(Te+de[0].length)}if(W=W.replace(me[0],"").trim(),!W)return V}if(/<\/head>/i.test(V))return V.replace(/<\/head>/i,`${W}
1314
+ Prefer signals (state/derived/effect) for new components.`)}r=cc(r,e),r=await _(r,e,c),r=Hc(r),r=Vc(r),r=ft(r);let{processXElementDirectives:ue}=await o("stx/x-element",()=>import("./chunk-zhxdpzga.js"));r=ue(r);let ne=e.__originalFilePath||c,K=De(e);if(r=await qo(r,d,ne,K),r=Rt(r,e),r=await Vt(r,e,c,d),d.media?.image?.autoSiblings){let V=d.publicDir||"public",{rewriteImagesWithSiblings:W}=await o("stx/image-optimization/auto-sibling",()=>import("./chunk-6h1qa3hw.js"));r=await W(r,{publicDir:V})}if(d.seo?.enabled)r=ti(r,e,d);let ge=(V,W,J=!0)=>{if(!W)return V;let me=W.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),re=/<head\b[^>]*>[\s\S]*?(?:<\/head\s*>|<body\b|$)/i.exec(V),de=re?/<title\b[^>]*>[\s\S]*?<\/title>/i.exec(re[0]):null;if(me&&re&&de){if(J){let Te=re.index+de.index;V=V.slice(0,Te)+me[0]+V.slice(Te+de[0].length)}if(W=W.replace(me[0],"").trim(),!W)return V}if(/<\/head>/i.test(V))return V.replace(/<\/head>/i,`${W}
1315
1315
  </head>`);if(/<head\b[^>]*>/i.test(V))return V.replace(/(<head\b[^>]*>)/i,`$1
1316
1316
  ${W}`);if(/<html\b[^>]*>/i.test(V))return V.replace(/(<html\b[^>]*>)/i,`$1
1317
1317
  <head>
1318
1318
  ${W}
1319
- </head>`);return V},{renderHead:we,getHead:kr}=await o("stx/head",()=>import("./chunk-tsb5h4e2.js")),Ie=e.__stx_runtime_head??kr();if(Ie.title||Ie.meta?.length||Ie.link?.length){let V=we(Ie);if(V)r=ge(r,V)}if(ce.headContent)r=ge(r,ce.headContent,!Ie.title);if(d.csp?.enabled&&d.csp.addMetaTag)r=xt(r,d.csp,e);if(d.analytics?.enabled)r=gt(r,d);if(d.heatmap?.enabled)r=fc(r,d);if(d.pwa?.enabled&&d.pwa.autoInject!==!1){let{injectPwaTags:V}=await o("stx/pwa/inject",()=>import("./chunk-r2v042ym.js"));r=V(r,d)}let Sr=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test(r),Er=/\bSTX\.\w+/.test(r),Tr=/window\.STX\s*=/.test(r);if(Sr&&Er&&!Tr){let W=`<script data-stx-scoped data-stx-run="once">
1319
+ </head>`);return V},{renderHead:we,getHead:kr}=await o("stx/head",()=>import("./chunk-s2zsa16d.js")),Ie=e.__stx_runtime_head??kr();if(Ie.title||Ie.meta?.length||Ie.link?.length){let V=we(Ie);if(V)r=ge(r,V)}if(ce.headContent)r=ge(r,ce.headContent,!Ie.title);if(d.csp?.enabled&&d.csp.addMetaTag)r=xt(r,d.csp,e);if(d.analytics?.enabled)r=gt(r,d);if(d.heatmap?.enabled)r=gc(r,d);if(d.pwa?.enabled&&d.pwa.autoInject!==!1){let{injectPwaTags:V}=await o("stx/pwa/inject",()=>import("./chunk-jjbdtj4w.js"));r=V(r,d)}let Sr=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test(r),Er=/\bSTX\.\w+/.test(r),Tr=/window\.STX\s*=/.test(r);if(Sr&&Er&&!Tr){let W=`<script data-stx-scoped data-stx-run="once">
1320
1320
  ${ut()}
1321
1321
  </script>`;if(r.includes("</head>")){let J=r.indexOf("</head>"),re=r.slice(0,J).indexOf("<script");if(re!==-1){let de=r.slice(0,re),Te=r.slice(re);r=de+W+`
1322
1322
  `+Te}else r=r.replace("</head>",`${W}
1323
1323
  </head>`)}else if(r.includes("<body"))r=r.replace(/<body([^>]*)>/,`<body$1>
1324
1324
  ${W}`);else r=W+`
1325
- `+r}{let{scanScriptTags:V}=await o("stx/signal-processing",()=>import("./chunk-9bhvh2dc.js")),W=[];for(let J of V(r)){if(!/\bserver\b/i.test(J.attrs))continue;let me=J.start+J.fullMatch.indexOf(">")+1,re=wr(r,me);if(re===-1)continue;let de=re+9;while(de<r.length&&/\s/.test(r[de]))de++;W.push({start:J.start,end:de})}if(W.length>0){let J=Array(W.length+1),me=0;for(let re=0;re<W.length;re++){let{start:de,end:Te}=W[re];J[re]=r.slice(me,de),me=Te}J[W.length]=r.slice(me),r=J.join("")}}let ct=Bs(r,c);if(ct.hasScoped)r=ct.html;let Cr=e.__stx_event_bindings||[],ze=!1,lt=[],Mr=/\s:[a-z][\w.-]*\s*=/.test(r),{scanScriptTags:Dr}=await o("stx/signal-processing",()=>import("./chunk-9bhvh2dc.js"));for(let V of Dr(r,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))lt.push({match:V.fullMatch,attrs:V.attrs,content:V.body});for(let{match:V,attrs:W,content:J}of lt){ze=!0;let me=J;Oe(J,c,a.strict,e.__originalFilePath);let re=await Le(J,{eventBindings:Cr,attrs:W,hasColonDirectives:Mr,templateContent:n,filePath:c,projectRoot:process.cwd(),production:$i(a.buildMode,a.minifyClient),serverData:K});r=r.replace(V,()=>re)}if(ze)e.__stx_event_bindings=[];if(!ze&&e.__stxProcessingDepth===1){let V=e.__stx_event_bindings||[];if(V.length>0){let W=ai(V);if(W){let J=r.lastIndexOf("</body>");r=J===-1?r+W:r.slice(0,J)+W+`
1326
- `+r.slice(J)}e.__stx_event_bindings=[]}}if(!d.skipSignalsRuntime&&!be(r)&&lc(r))r=await cr(r,d);if(r=uc(r),d.csp?.enabled&&d.csp.useNonce&&typeof e.cspNonce==="string")r=kt(r,e.cspNonce);return r}
1327
- export{yt,Re,rc,os,No,Mo,tr,i};
1325
+ `+r}{let{scanScriptTags:V}=await o("stx/signal-processing",()=>import("./chunk-4qsamkyc.js")),W=[];for(let J of V(r)){if(!/\bserver\b/i.test(J.attrs))continue;let me=J.start+J.fullMatch.indexOf(">")+1,re=wr(r,me);if(re===-1)continue;let de=re+9;while(de<r.length&&/\s/.test(r[de]))de++;W.push({start:J.start,end:de})}if(W.length>0){let J=Array(W.length+1),me=0;for(let re=0;re<W.length;re++){let{start:de,end:Te}=W[re];J[re]=r.slice(me,de),me=Te}J[W.length]=r.slice(me),r=J.join("")}}let ct=Bs(r,c);if(ct.hasScoped)r=ct.html;let Cr=e.__stx_event_bindings||[],ze=!1,lt=[],Mr=/\s:[a-z][\w.-]*\s*=/.test(r),{scanScriptTags:Dr}=await o("stx/signal-processing",()=>import("./chunk-4qsamkyc.js"));for(let V of Dr(r,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))lt.push({match:V.fullMatch,attrs:V.attrs,content:V.body});for(let{match:V,attrs:W,content:J}of lt){ze=!0;let me=J;Oe(J,c,a.strict,e.__originalFilePath);let re=await Le(J,{eventBindings:Cr,attrs:W,hasColonDirectives:Mr,templateContent:n,filePath:c,projectRoot:process.cwd(),production:Ri(a.buildMode,a.minifyClient),serverData:K});r=r.replace(V,()=>re)}if(ze)e.__stx_event_bindings=[];if(!ze&&e.__stxProcessingDepth===1){let V=e.__stx_event_bindings||[];if(V.length>0){let W=ai(V);if(W){let J=r.lastIndexOf("</body>");r=J===-1?r+W:r.slice(0,J)+W+`
1326
+ `+r.slice(J)}e.__stx_event_bindings=[]}}if(!d.skipSignalsRuntime&&!be(r)&&uc(r))r=await cr(r,d);if(r=dc(r),d.csp?.enabled&&d.csp.useNonce&&typeof e.cspNonce==="string")r=kt(r,e.cspNonce);return r}
1327
+ export{yt,Re,sc,os,No,Mo,tr,i};
@@ -298,5 +298,5 @@ catch (error) {
298
298
  init();
299
299
  }
300
300
  })();
301
- </script>`}var Tg={name:"pwa.installButton",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return r(t,n)},hasEndTag:!0,description:"Renders a PWA install prompt button that appears when the app can be installed"},$g={name:"pwa.updatePrompt",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return p(t,n)},hasEndTag:!0,description:"Renders a PWA update notification UI when a new version is available"},Rg={name:"pwa.offlineIndicator",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return d(t,n)},hasEndTag:!0,description:"Renders an offline status indicator that shows when the user loses connection"},Ag={name:"pwa.pushSubscribe",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return l(t,n)},hasEndTag:!0,description:"Renders a push notification subscription button"},to=[Tg,$g,Rg,Ag];function py(t){return[...t,...to]}
302
- export{Tg,$g,Rg,Ag,to,py};
301
+ </script>`}var $g={name:"pwa.installButton",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return r(t,n)},hasEndTag:!0,description:"Renders a PWA install prompt button that appears when the app can be installed"},Rg={name:"pwa.updatePrompt",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return p(t,n)},hasEndTag:!0,description:"Renders a PWA update notification UI when a new version is available"},Ag={name:"pwa.offlineIndicator",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return d(t,n)},hasEndTag:!0,description:"Renders an offline status indicator that shows when the user loses connection"},Pg={name:"pwa.pushSubscribe",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return l(t,n)},hasEndTag:!0,description:"Renders a push notification subscription button"},to=[$g,Rg,Ag,Pg];function fy(t){return[...t,...to]}
302
+ export{$g,Rg,Ag,Pg,to,fy};