@stacksjs/stx 0.2.672 → 0.2.674

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 (212) hide show
  1. package/dist/chunk-0jwdcqj8.js +2 -0
  2. package/dist/chunk-0mwdq478.js +2 -0
  3. package/dist/{chunk-npa7gze7.js → chunk-0nfqgv4n.js} +2 -2
  4. package/dist/chunk-1y6egkty.js +2 -0
  5. package/dist/{chunk-1sr6c0nk.js → chunk-25zmy8q6.js} +2 -2
  6. package/dist/chunk-2881tcqt.js +2 -0
  7. package/dist/chunk-2a775q7x.js +2 -0
  8. package/dist/chunk-2asdbd5e.js +2 -0
  9. package/dist/chunk-34yj93hh.js +2 -0
  10. package/dist/{chunk-30nes8ne.js → chunk-35ezh7de.js} +2 -2
  11. package/dist/{chunk-sjcqxfq1.js → chunk-40tswfe7.js} +8 -8
  12. package/dist/chunk-41de209e.js +2 -0
  13. package/dist/{chunk-6xe8rnfv.js → chunk-4b9s7wgy.js} +2 -2
  14. package/dist/{chunk-ttbn287w.js → chunk-4bgjrrvz.js} +1 -1
  15. package/dist/{chunk-365vg0eg.js → chunk-4s8zacxg.js} +4 -4
  16. package/dist/chunk-4w6baw62.js +3 -0
  17. package/dist/{chunk-fbtv2k1p.js → chunk-506mv7hb.js} +2 -2
  18. package/dist/{chunk-fzqj1mjz.js → chunk-5qtthtg3.js} +7 -7
  19. package/dist/chunk-5s1ay9mv.js +2 -0
  20. package/dist/{chunk-kenbxxbn.js → chunk-5vt48yce.js} +6 -6
  21. package/dist/{chunk-qv6axke4.js → chunk-5zhp87wv.js} +2 -2
  22. package/dist/{chunk-hvf2e7pr.js → chunk-6s7tvmqp.js} +1 -1
  23. package/dist/{chunk-ecqrkyg8.js → chunk-6sjtyd0k.js} +4 -4
  24. package/dist/{chunk-a3d0g4mr.js → chunk-7adznted.js} +2 -2
  25. package/dist/chunk-7j1zgrnf.js +42 -0
  26. package/dist/chunk-7kznee1g.js +2 -0
  27. package/dist/{chunk-qjtpxsyx.js → chunk-7mvz972c.js} +3 -3
  28. package/dist/chunk-80zgyaqe.js +2 -0
  29. package/dist/chunk-84tqb1rn.js +2 -0
  30. package/dist/chunk-8azm7nha.js +2 -0
  31. package/dist/chunk-902qnyg0.js +2 -0
  32. package/dist/{chunk-3y41efsf.js → chunk-9dtbvjpp.js} +8 -8
  33. package/dist/chunk-9n6jwcpb.js +2 -0
  34. package/dist/{chunk-yfvm7q6t.js → chunk-a4p18ybc.js} +3 -3
  35. package/dist/chunk-a6y8td0d.js +2 -0
  36. package/dist/chunk-a7kt1ts4.js +2 -0
  37. package/dist/chunk-a81y8g40.js +2 -0
  38. package/dist/{chunk-mjm3tyfj.js → chunk-aet1pgw7.js} +36 -36
  39. package/dist/chunk-aft1zc84.js +2 -0
  40. package/dist/{chunk-04kg16qs.js → chunk-am2w363p.js} +4 -4
  41. package/dist/{chunk-ym41ybz2.js → chunk-asezs2n3.js} +6 -6
  42. package/dist/{chunk-7kk2m44a.js → chunk-bawq4fqy.js} +4 -4
  43. package/dist/chunk-bdp2r0v4.js +2 -0
  44. package/dist/{chunk-1mj9crcg.js → chunk-bkkpq8dx.js} +9 -9
  45. package/dist/chunk-brtvm8mb.js +2 -0
  46. package/dist/{chunk-2dp7hyv7.js → chunk-bsajk82t.js} +14 -14
  47. package/dist/chunk-bvzr9zqt.js +2 -0
  48. package/dist/{chunk-t9yqq483.js → chunk-cbjabv1w.js} +4 -4
  49. package/dist/chunk-cbvgtf3m.js +2 -0
  50. package/dist/chunk-cfydbaeq.js +2 -0
  51. package/dist/{chunk-t2pzy3x1.js → chunk-ck2e3e47.js} +3 -3
  52. package/dist/{chunk-wpmrz872.js → chunk-d09q93yf.js} +2 -2
  53. package/dist/{chunk-a91atghh.js → chunk-d1a86qx8.js} +1 -1
  54. package/dist/{chunk-xqp4hstk.js → chunk-dgc1a3yt.js} +6 -6
  55. package/dist/chunk-dq8c3h4n.js +2 -0
  56. package/dist/chunk-e36pne7n.js +2 -0
  57. package/dist/chunk-e62qfexp.js +2 -0
  58. package/dist/chunk-eq5jzaj5.js +2 -0
  59. package/dist/{chunk-kwek8xdt.js → chunk-f9zyf9n6.js} +65 -65
  60. package/dist/{chunk-dgb4z4kw.js → chunk-faakv1p6.js} +2 -2
  61. package/dist/{chunk-yqz01qvy.js → chunk-fb7t1nn9.js} +3 -3
  62. package/dist/{chunk-06b8btkv.js → chunk-fbmth6xv.js} +10 -10
  63. package/dist/{chunk-7met6yva.js → chunk-fd49fahd.js} +5 -5
  64. package/dist/chunk-fr39emcz.js +2 -0
  65. package/dist/chunk-fsq13amm.js +2 -0
  66. package/dist/chunk-fw413k9q.js +3 -0
  67. package/dist/chunk-fxh12vqd.js +2 -0
  68. package/dist/chunk-gcc9fa33.js +2 -0
  69. package/dist/chunk-h6t2ney6.js +2 -0
  70. package/dist/{chunk-kgfgb971.js → chunk-ham5x7ts.js} +4 -4
  71. package/dist/{chunk-n38yb274.js → chunk-hb3edeq9.js} +6 -6
  72. package/dist/{chunk-fvtwec1r.js → chunk-hegfgw27.js} +1 -1
  73. package/dist/{chunk-p472crv1.js → chunk-hgry3mjd.js} +1 -1
  74. package/dist/{chunk-t961jbzc.js → chunk-hsmcbh0p.js} +7 -7
  75. package/dist/{chunk-wz2zb53w.js → chunk-hz4x7h0n.js} +5 -5
  76. package/dist/{chunk-jxda11cg.js → chunk-j6m8xqh3.js} +2 -2
  77. package/dist/chunk-j8g5cvvm.js +2 -0
  78. package/dist/chunk-jzjpyyw2.js +2 -0
  79. package/dist/chunk-k1b8x73j.js +2 -0
  80. package/dist/{chunk-8k3rwv8r.js → chunk-kdebh22m.js} +7 -7
  81. package/dist/{chunk-pvb48ehs.js → chunk-mwnhdsbp.js} +2 -2
  82. package/dist/{chunk-s20h5gmr.js → chunk-nj343mw2.js} +5 -5
  83. package/dist/chunk-nw9bdk2n.js +2 -0
  84. package/dist/chunk-p4jkswz8.js +2 -0
  85. package/dist/chunk-p4r90vqf.js +2 -0
  86. package/dist/{chunk-bnn7pd62.js → chunk-p6qd7ad0.js} +2 -2
  87. package/dist/chunk-p8bgy5tt.js +2 -0
  88. package/dist/{chunk-aprhqxky.js → chunk-pb6erpj3.js} +5 -5
  89. package/dist/{chunk-r3e6x87d.js → chunk-pg2v1pb5.js} +3 -3
  90. package/dist/{chunk-dw81nc5v.js → chunk-pqqe2b6m.js} +4 -4
  91. package/dist/chunk-q6nwcav4.js +2 -0
  92. package/dist/chunk-qmqavdz2.js +2 -0
  93. package/dist/chunk-qpw72bty.js +2 -0
  94. package/dist/chunk-qwnh1kj6.js +2 -0
  95. package/dist/chunk-qy9m6qdn.js +2 -0
  96. package/dist/chunk-qychcdsm.js +2 -0
  97. package/dist/{chunk-7d4z944r.js → chunk-qz5b8ed4.js} +7 -7
  98. package/dist/{chunk-6ajahb2x.js → chunk-r7fdw2v5.js} +3 -3
  99. package/dist/{chunk-mmwedr93.js → chunk-rdr09efy.js} +5 -5
  100. package/dist/chunk-rj3w1ama.js +2 -0
  101. package/dist/{chunk-prf164ct.js → chunk-rr527jt6.js} +2 -2
  102. package/dist/{chunk-x68etmdg.js → chunk-rv39s5az.js} +4 -4
  103. package/dist/{chunk-a5zqqgx2.js → chunk-rym0309c.js} +3 -3
  104. package/dist/{chunk-sqayfat9.js → chunk-s0vtjyyj.js} +1 -1
  105. package/dist/{chunk-vqc4h16r.js → chunk-s2wptfm1.js} +2 -2
  106. package/dist/chunk-sf0r963g.js +2 -0
  107. package/dist/{chunk-a3yte051.js → chunk-sqn3y9qt.js} +2 -2
  108. package/dist/{chunk-9gfffs28.js → chunk-srq9fqq8.js} +10 -10
  109. package/dist/chunk-ss820yys.js +2 -0
  110. package/dist/{chunk-pn1ehs6a.js → chunk-szevd7d5.js} +2 -2
  111. package/dist/{chunk-wbzmr6a4.js → chunk-t0k16vqv.js} +2 -2
  112. package/dist/chunk-t4j9g2vh.js +2 -0
  113. package/dist/chunk-t79jfpv6.js +3 -0
  114. package/dist/{chunk-rcadtv3x.js → chunk-t9kxhe46.js} +1 -1
  115. package/dist/{chunk-zqtbtqbq.js → chunk-tddnb5bv.js} +2 -2
  116. package/dist/{chunk-hvzzhkhr.js → chunk-thceyzj6.js} +2 -2
  117. package/dist/{chunk-n3m7fkv1.js → chunk-trh7s6k3.js} +5 -5
  118. package/dist/{chunk-3349573p.js → chunk-trz8z4j4.js} +18 -18
  119. package/dist/chunk-ttemwrbx.js +2 -0
  120. package/dist/{chunk-wankp78x.js → chunk-twqzn21x.js} +7 -7
  121. package/dist/chunk-v14rq8b4.js +3 -0
  122. package/dist/{chunk-b4pcw34n.js → chunk-v21bhhjb.js} +1 -1
  123. package/dist/{chunk-ka8befem.js → chunk-v6peecfp.js} +2 -2
  124. package/dist/{chunk-g8r0km7g.js → chunk-vayhx642.js} +2 -2
  125. package/dist/{chunk-5pgk3w2c.js → chunk-vdxg7e1y.js} +2 -2
  126. package/dist/chunk-vq513cxx.js +2 -0
  127. package/dist/chunk-vvq8xe3n.js +2 -0
  128. package/dist/{chunk-tre98h62.js → chunk-w3d98907.js} +2 -2
  129. package/dist/{chunk-p3x21vp7.js → chunk-w7t2cfgy.js} +42 -42
  130. package/dist/chunk-w8t31bn9.js +2 -0
  131. package/dist/chunk-x1kz4d7j.js +2 -0
  132. package/dist/chunk-xcsyqwxf.js +25 -0
  133. package/dist/{chunk-9p6efb17.js → chunk-xghcsg3f.js} +1 -1
  134. package/dist/chunk-xn9jrjzh.js +2 -0
  135. package/dist/{chunk-nrvwejdw.js → chunk-y1pcdeg9.js} +5 -5
  136. package/dist/{chunk-qffbkvfn.js → chunk-yx3dpdwc.js} +3 -3
  137. package/dist/{chunk-f9hrpwsw.js → chunk-z22zy22p.js} +2 -2
  138. package/dist/chunk-z97bwx8m.js +2 -0
  139. package/dist/{chunk-120ze5ms.js → chunk-zmg1peyg.js} +3 -3
  140. package/dist/{chunk-pxdww4rb.js → chunk-zp79zkkd.js} +2 -2
  141. package/dist/cli.js +20 -20
  142. package/dist/craft-entry.js +2 -2
  143. package/dist/craft.js +2 -2
  144. package/dist/loops.js +19 -3
  145. package/dist/pwa.js +3 -3
  146. package/dist/signal-processing.d.ts +12 -0
  147. package/dist/signal-processing.js +1 -1
  148. package/dist/ssg.js +6 -6
  149. package/package.json +5 -5
  150. package/dist/chunk-028ee6q5.js +0 -2
  151. package/dist/chunk-02ymqwmj.js +0 -2
  152. package/dist/chunk-0dcrd58z.js +0 -2
  153. package/dist/chunk-0f33ssaq.js +0 -2
  154. package/dist/chunk-17yfcd5s.js +0 -2
  155. package/dist/chunk-1pnp91wx.js +0 -2
  156. package/dist/chunk-23b0khvh.js +0 -3
  157. package/dist/chunk-2f17h17f.js +0 -2
  158. package/dist/chunk-4c183zem.js +0 -2
  159. package/dist/chunk-4ve8vsw5.js +0 -2
  160. package/dist/chunk-4yt8tg4j.js +0 -2
  161. package/dist/chunk-52gp2xxk.js +0 -2
  162. package/dist/chunk-5w1c7x22.js +0 -2
  163. package/dist/chunk-5zgrvj4b.js +0 -2
  164. package/dist/chunk-67kj14at.js +0 -2
  165. package/dist/chunk-6vzktvyw.js +0 -2
  166. package/dist/chunk-7a3g26kk.js +0 -2
  167. package/dist/chunk-7d2fab0z.js +0 -2
  168. package/dist/chunk-7dtpszqq.js +0 -2
  169. package/dist/chunk-7spxdz5k.js +0 -2
  170. package/dist/chunk-864qtx7y.js +0 -2
  171. package/dist/chunk-89jbdtgw.js +0 -3
  172. package/dist/chunk-96mm4q2g.js +0 -2
  173. package/dist/chunk-9szxxgv5.js +0 -2
  174. package/dist/chunk-9yxgdy4z.js +0 -42
  175. package/dist/chunk-a95r5nmq.js +0 -25
  176. package/dist/chunk-am246nf3.js +0 -2
  177. package/dist/chunk-avnhsjq0.js +0 -2
  178. package/dist/chunk-aw3meb8t.js +0 -2
  179. package/dist/chunk-b4fd2dtk.js +0 -2
  180. package/dist/chunk-b823zxq6.js +0 -3
  181. package/dist/chunk-bdg0fydw.js +0 -2
  182. package/dist/chunk-d6en3vz7.js +0 -2
  183. package/dist/chunk-dnw3knxq.js +0 -2
  184. package/dist/chunk-dpvxe52r.js +0 -2
  185. package/dist/chunk-e1fetwbr.js +0 -2
  186. package/dist/chunk-e44z03s5.js +0 -2
  187. package/dist/chunk-e4vpr36s.js +0 -2
  188. package/dist/chunk-f8dkq3ta.js +0 -2
  189. package/dist/chunk-fcn71bq1.js +0 -2
  190. package/dist/chunk-g2jmwh7p.js +0 -2
  191. package/dist/chunk-j0v970k3.js +0 -2
  192. package/dist/chunk-jk41jwsc.js +0 -2
  193. package/dist/chunk-k2pa44rf.js +0 -2
  194. package/dist/chunk-qq1k3364.js +0 -2
  195. package/dist/chunk-qxmyaajq.js +0 -2
  196. package/dist/chunk-sc7hszsx.js +0 -2
  197. package/dist/chunk-sf0wsq74.js +0 -2
  198. package/dist/chunk-shpc1ttk.js +0 -2
  199. package/dist/chunk-sj6mhjdq.js +0 -2
  200. package/dist/chunk-sqhmkvwd.js +0 -2
  201. package/dist/chunk-sw6p5176.js +0 -2
  202. package/dist/chunk-tb6vacgp.js +0 -2
  203. package/dist/chunk-we8ptx6w.js +0 -2
  204. package/dist/chunk-weqc0ssb.js +0 -2
  205. package/dist/chunk-wq712sw1.js +0 -2
  206. package/dist/chunk-wyq0c4wy.js +0 -2
  207. package/dist/chunk-wz6368p4.js +0 -2
  208. package/dist/chunk-yscr04dv.js +0 -2
  209. package/dist/chunk-z8j2sbnb.js +0 -2
  210. package/dist/chunk-z8p6tk5z.js +0 -2
  211. package/dist/chunk-zhf01af3.js +0 -3
  212. package/dist/chunk-zp9k5pha.js +0 -2
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Xu}from"./chunk-z22zy22p.js";import"./chunk-srq9fqq8.js";import"./chunk-rym0309c.js";import"./chunk-7adznted.js";import"./chunk-am2w363p.js";import"./chunk-5qtthtg3.js";import"./chunk-4s8zacxg.js";import"./chunk-f9zyf9n6.js";import"./chunk-mwnhdsbp.js";import"./chunk-25zmy8q6.js";import"./chunk-bsajk82t.js";import"./chunk-ce6zddpf.js";import"./chunk-zp79zkkd.js";export{Xu as buildApp};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{up,kl,qe,oa,dp,Mr,Lr,jr}from"./chunk-bkkpq8dx.js";import"./chunk-7j1zgrnf.js";import"./chunk-v6peecfp.js";import"./chunk-hgry3mjd.js";import"./chunk-f9zyf9n6.js";import"./chunk-mwnhdsbp.js";import"./chunk-25zmy8q6.js";import"./chunk-bsajk82t.js";import"./chunk-ce6zddpf.js";import"./chunk-zp79zkkd.js";export{dp as clearOnceStore,oa as onceStore,qe as partialsCache,Mr as processIncludes,Lr as processStackPushDirectives,jr as processStackReplacements,up as resetUnscopedSignalWarnings,kl as topLevelElements};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
2
  import a from"fs";function pt(r){return o(r)}var g=1000,i=new Map;function In(){i.clear()}function o(r){return[...r].sort().map((n)=>{try{let t=a.statSync(n);return`${n}:${t.size}:${t.mtimeMs}`}catch{return`${n}:missing`}}).join(`
3
- `)}function Wt(r,n,t){let e=r.get(n);return e!==void 0&&e.signature===t?e.value:void 0}function se(r,n,t,e){return r.set(n,{signature:t,value:e}),e}
4
- export{pt,In,Wt,se};
3
+ `)}function Wt(r,n,t){let e=r.get(n);return e!==void 0&&e.signature===t?e.value:void 0}function ie(r,n,t,e){return r.set(n,{signature:t,value:e}),e}
4
+ export{pt,In,Wt,ie};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Pl,go}from"./chunk-7adznted.js";export{Pl as looksLikeGlob,go as resolveStxTargets};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{AsyncLocalStorage as R}from"async_hooks";var b=Symbol.for("stx.runtime-config.scope"),y=globalThis,m=y[b]??=new R;function je(n,f){return m.run(n,f)}function mn(){return m.getStore()}function ys(){let n=m.getStore();if(!n)throw Error("useServerRuntimeConfig requires a server request or template render");return Object.freeze(Object.defineProperty({public:n.public},"private",{value:n.private}))}function Bo(){return ys().public}function A(n={},f=process.env){let s=new Set;function o(e,i){if(i===null)return e===null;if(Array.isArray(i))return Array.isArray(e)&&(!i.length||e.every((r)=>i.some((u)=>o(r,u))));if(typeof i==="object")return e!==null&&typeof e==="object"&&!Array.isArray(e)&&Object.entries(i).every(([r,u])=>Object.hasOwn(e,r)&&o(e[r],u));return typeof e===typeof i}function g(e,i){if(e&&typeof e==="object"&&!Array.isArray(e)){if(Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`);let t=Object.create(null);for(let[c,l]of Object.entries(e)){if(!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(c)||["constructor","prototype","__proto__"].includes(c))throw TypeError(`Invalid runtime config key: ${c}`);t[c]=g(l,[...i,c])}return Object.freeze(t)}let r=`STX_RUNTIME_${i.map((t)=>t.replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()).join("__")}`;if(s.has(r))throw TypeError(`Ambiguous runtime config environment key: ${r}`);s.add(r);let u=f[r],a=e;if(u!==void 0){try{a=typeof e==="string"?u:JSON.parse(u)}catch{throw TypeError(`Invalid runtime config override: ${r}`)}if(!o(a,e))throw TypeError(`Wrong runtime config override type: ${r}`)}function p(t){if(t===null||typeof t==="string"||typeof t==="boolean")return t;if(typeof t==="number"&&Number.isFinite(t))return t;if(Array.isArray(t))return Object.freeze(t.map(p));if(t&&typeof t==="object"&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null))return Object.freeze(Object.fromEntries(Object.entries(t).map(([c,l])=>[c,p(l)])));throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`)}return p(a)}return Object.freeze({public:g(n.public??{},["public"]),private:g(n.private??{},["private"])})}function C(n){return`<script data-stx-scoped data-stx-runtime-config type="application/json">${JSON.stringify(n.public).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function Ot(n,f){let s=n.replace(/<script\b[^>]*\bdata-stx-runtime-config\b[^>]*>[\s\S]*?<\/script>/gi,""),o=/<head\b[^>]*>/i.exec(s),g=o?o.index+o[0].length:0;return s.slice(0,g)+C(f)+s.slice(g)}
3
- export{je,mn,ys,Bo,A,Ot};
2
+ import{AsyncLocalStorage as R}from"async_hooks";var b=Symbol.for("stx.runtime-config.scope"),y=globalThis,m=y[b]??=new R;function je(n,f){return m.run(n,f)}function mn(){return m.getStore()}function bs(){let n=m.getStore();if(!n)throw Error("useServerRuntimeConfig requires a server request or template render");return Object.freeze(Object.defineProperty({public:n.public},"private",{value:n.private}))}function Fo(){return bs().public}function A(n={},f=process.env){let s=new Set;function o(e,i){if(i===null)return e===null;if(Array.isArray(i))return Array.isArray(e)&&(!i.length||e.every((r)=>i.some((u)=>o(r,u))));if(typeof i==="object")return e!==null&&typeof e==="object"&&!Array.isArray(e)&&Object.entries(i).every(([r,u])=>Object.hasOwn(e,r)&&o(e[r],u));return typeof e===typeof i}function g(e,i){if(e&&typeof e==="object"&&!Array.isArray(e)){if(Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`);let t=Object.create(null);for(let[c,l]of Object.entries(e)){if(!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(c)||["constructor","prototype","__proto__"].includes(c))throw TypeError(`Invalid runtime config key: ${c}`);t[c]=g(l,[...i,c])}return Object.freeze(t)}let r=`STX_RUNTIME_${i.map((t)=>t.replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()).join("__")}`;if(s.has(r))throw TypeError(`Ambiguous runtime config environment key: ${r}`);s.add(r);let u=f[r],a=e;if(u!==void 0){try{a=typeof e==="string"?u:JSON.parse(u)}catch{throw TypeError(`Invalid runtime config override: ${r}`)}if(!o(a,e))throw TypeError(`Wrong runtime config override type: ${r}`)}function p(t){if(t===null||typeof t==="string"||typeof t==="boolean")return t;if(typeof t==="number"&&Number.isFinite(t))return t;if(Array.isArray(t))return Object.freeze(t.map(p));if(t&&typeof t==="object"&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null))return Object.freeze(Object.fromEntries(Object.entries(t).map(([c,l])=>[c,p(l)])));throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`)}return p(a)}return Object.freeze({public:g(n.public??{},["public"]),private:g(n.private??{},["private"])})}function C(n){return`<script data-stx-scoped data-stx-runtime-config type="application/json">${JSON.stringify(n.public).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function Ot(n,f){let s=n.replace(/<script\b[^>]*\bdata-stx-runtime-config\b[^>]*>[\s\S]*?<\/script>/gi,""),o=/<head\b[^>]*>/i.exec(s),g=o?o.index+o[0].length:0;return s.slice(0,g)+C(f)+s.slice(g)}
3
+ export{je,mn,bs,Fo,A,Ot};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{N,Al,fo,o,R,Sp,kp}from"./chunk-srq9fqq8.js";import"./chunk-rym0309c.js";import"./chunk-7adznted.js";import"./chunk-am2w363p.js";import"./chunk-5qtthtg3.js";import"./chunk-4s8zacxg.js";import"./chunk-f9zyf9n6.js";import"./chunk-mwnhdsbp.js";import"./chunk-25zmy8q6.js";import"./chunk-bsajk82t.js";import"./chunk-ce6zddpf.js";import"./chunk-zp79zkkd.js";export{R as config,N as defaultConfig,Sp as defineStxConfig,fo as discoverConfig,o as loadStxConfig,Al as resolveStxDirectories,kp as validateConfig};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ul,dl,Ce,pl,ea,Gt,Kt,sp,ta,Xt,Fn,fl,gl,ml,Gs,Jt,hl,Yt,yl}from"./chunk-rv39s5az.js";import"./chunk-hz4x7h0n.js";import"./chunk-md2jn67b.js";import"./chunk-srq9fqq8.js";import"./chunk-rym0309c.js";import"./chunk-7adznted.js";import"./chunk-am2w363p.js";import"./chunk-5qtthtg3.js";import"./chunk-4s8zacxg.js";import"./chunk-f9zyf9n6.js";import"./chunk-mwnhdsbp.js";import"./chunk-25zmy8q6.js";import"./chunk-bsajk82t.js";import"./chunk-ce6zddpf.js";import"./chunk-zp79zkkd.js";export{Fn as MODULE_SPECIFIER_PREFIX,ul as bundleCacheDir,dl as bundleCacheEntryLimit,Yt as bundleClientScript,Kt as clearBundleFailures,Ce as clientBundleDependencies,Gt as getBundleFailures,Xt as hasUserImports,Jt as moduleSubstitutionKey,gl as normalizeRegistrySpecifiers,hl as queueClientBundleBuild,ea as recordBundleFailure,fl as registryIdForPath,ta as resolveBundlerFallback,ml as rewriteRegistryImports,sp as setBundlerFallbackMode,pl as shouldLogBundlerDiagnostics,yl as tempBuildName,Gs as withModuleSubstitutes};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Y,Z,Q,Cn,fe,_e,Ar,zc,dt,Ut,En,Tn,$n,ee,Rn,An,Pr}from"./chunk-t79jfpv6.js";import"./chunk-a4p18ybc.js";export{Z as DEFAULT_FORMATS,Q as DEFAULT_QUALITY,Y as DEFAULT_WIDTHS,Pr as ImageProcessingError,An as formatSize,Ut as generateSizes,dt as generateSrcSet,En as getFallbackVariant,Ar as getImageMetadata,ee as getMimeType,Rn as getTotalSize,Tn as groupVariantsByFormat,fe as isImageBackendAvailable,$n as isImageFile,Cn as isSharpAvailable,_e as processImage,zc as resizeAndConvert};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Tl,mp,hp,yp,bp,$l,Rl,vp,wp,po,xp,Jn,Yn,qr}from"./chunk-4b9s7wgy.js";import{Ze}from"./chunk-2zzc7006.js";import"./chunk-f9zyf9n6.js";import"./chunk-mwnhdsbp.js";import"./chunk-25zmy8q6.js";import"./chunk-bsajk82t.js";import"./chunk-ce6zddpf.js";import"./chunk-zp79zkkd.js";export{bp as __setSignalsGeneratorsForTest,Ze as cacheEngineFingerprint,Yn as cacheTemplate,Jn as checkCache,xp as clearDevCaches,Rl as getCachedRouterScript,$l as getCachedSignalsRuntime,vp as getServeClientAsset,po as getServeModuleBundle,qr as hashFilePath,hp as invalidateFileCache,yp as invalidateFileCacheByDir,mp as readFileCached,wp as registerServeModuleBundle,Tl as templateCache};
@@ -2,5 +2,5 @@
2
2
  import o from"fs";import u from"path";var h={".html":"includeHtml",".htm":"includeHtml",".js":"includeJs",".mjs":"includeJs",".css":"includeCss",".png":"includeImages",".jpg":"includeImages",".jpeg":"includeImages",".gif":"includeImages",".webp":"includeImages",".svg":"includeImages",".ico":"includeImages",".woff":"includeFonts",".woff2":"includeFonts",".ttf":"includeFonts",".eot":"includeFonts",".otf":"includeFonts"};function p(e){let r=0;for(let t=0;t<e.length;t++){let n=e[t];r=(r<<5)-r+n,r=r&r}return Math.abs(r).toString(16).padStart(8,"0")}function x(e,r){let t=u.basename(e);for(let n of r)if(n.startsWith("*.")){let i=n.slice(1);if(t.endsWith(i))return!0}else if(n.includes("*")){let i=new RegExp(`^${n.replace(/\*/g,".*")}$`);if(i.test(t)||i.test(e))return!0}else if(t===n||e.includes(n))return!0;return!1}function S(e,r,t){let n=u.extname(e).toLowerCase(),i=h[n],c=(t.maxFileSizeKB||500)*1024;if(r>c)return!1;if(t.exclude&&x(e,t.exclude))return!1;if(t.include&&t.include.length>0){for(let s of t.include)if(s.startsWith("*.")){if(e.endsWith(s.slice(1)))return!0}else if(e.includes(s))return!0}if(i&&t[i]===!0)return!0;if(!i)return!1;return!1}function f(e,r,t,n){let i=o.readdirSync(e,{withFileTypes:!0});for(let c of i){let s=u.join(e,c.name);if(c.isDirectory()){if(["node_modules",".git",".stx"].includes(c.name))continue;f(s,r,t,n)}else if(c.isFile()){let a=o.statSync(s),l=u.relative(r,s);if(S(l,a.size,t)){let d=o.readFileSync(s),g=p(d),m=`/${l.replace(/\\/g,"/")}`;n.push({url:m,revision:g,size:a.size})}}}}function ze(e,r){let t=r.pwa?.precache,n=[];if(!t?.enabled)return{entries:[],totalSize:0,fileCount:0};if(!o.existsSync(e))return{entries:[],totalSize:0,fileCount:0};f(e,e,t,n),n.sort((c,s)=>c.url.localeCompare(s.url));let i=n.reduce((c,s)=>c+s.size,0);return{entries:n,totalSize:i,fileCount:n.length}}function wn(e){if(e.entries.length===0)return"[]";return`[
3
3
  ${e.entries.map((t)=>` { url: '${t.url}', revision: '${t.revision}' }`).join(`,
4
4
  `)}
5
- ]`}function Jo(e){if(e<1024)return`${e} B`;if(e<1048576)return`${(e/1024).toFixed(1)} KB`;return`${(e/1048576).toFixed(2)} MB`}
6
- export{ze,wn,Jo};
5
+ ]`}function Yo(e){if(e<1024)return`${e} B`;if(e<1048576)return`${(e/1024).toFixed(1)} KB`;return`${(e/1048576).toFixed(2)} MB`}
6
+ export{ze,wn,Yo};
@@ -1,21 +1,21 @@
1
1
  // @bun
2
- import{st,cc}from"./chunk-pxdww4rb.js";import{T}from"./chunk-ce6zddpf.js";import{L,rs,r,sn,W,ce,$a,Pt,dn,De,Me}from"./chunk-kwek8xdt.js";import{Kn}from"./chunk-wankp78x.js";import{U}from"./chunk-bnn7pd62.js";import{tn}from"./chunk-p472crv1.js";var j=`(?:"[^"]*"|'[^']*'|[^>"'])*`,Q=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s,K=65536,Y=4,O=new Map;function fp(){O.clear()}function q(e){let i=[];for(let s of ce(e,W)){let t=s.token.match(/^<script\b([^>]*)>/i),n=s.token.match(/<\/script\s*>$/i);if(!t||!n)continue;let a=t[0].length,l=s.token.length-n[0].length;i.push(Object.freeze({fullMatch:s.token,attrs:t[1],body:s.token.slice(a,l),start:s.start,end:s.end}))}return i}function _l(e,i={}){let s=e.length>=K,t=s?O.get(e):void 0;if(t===void 0){if(t=q(e),s)$a(O,Y),O.set(e,t)}let n=i.skipAttrs;if(!n)return t.slice();let a=[];for(let l of t)if(n.lastIndex=0,!n.test(l.attrs))a.push(l);return a}function oo(e){let i=e.trim(),s=i.match(/^([\s\S]+?)\s+as\s+(.+)$/);if(s){let n=s[1].trim(),a=s[2].trim(),{itemVar:l,indexVar:o}=B(a);if(l)return{style:"as",iterable:n,itemVar:l,indexVar:o}}let t=i.match(/^(\([^)]+\)|\w+(?:\s*,\s*\w+)?)\s+(?:in|of)\s+([\s\S]+)$/);if(t){let n=t[1].trim(),a=t[2].trim(),{itemVar:l,indexVar:o}=B(n);if(l)return{style:"in",iterable:a,itemVar:l,indexVar:o}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function B(e){let i=e.trim(),s=i.match(/^(\w+)\s*=>\s*(\w+)$/);if(s)return{itemVar:s[2],indexVar:s[1]};let t=i.match(/^\(\s*(\w+)(?:\s*,\s*(\w+))?\s*\)$/);if(t)return{itemVar:t[1],indexVar:t[2]||null};let n=i.match(/^(\w+)\s*,\s*(\w+)$/);if(n)return{itemVar:n[1],indexVar:n[2]};let a=i.match(/^(\w+)$/);if(a)return{itemVar:a[1],indexVar:null};return{itemVar:null,indexVar:null}}function Fr(e,i){return cc(e,i)}function ee(e){let i=/@(if\s*\(|endif|elseif\s*\(|else\b)/g,s=0,t;while((t=i.exec(e))!==null){let n=t[1];if(n.startsWith("if"))s++;else if(n==="endif")s--;else if(s===0)return!0}return!1}function J(e){let i=new Set,s=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,t=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel)\s*(?:<[^>]*>)?\s*\(/g,n;while((n=s.exec(e))!==null){let a=n[1],l;while((l=t.exec(a))!==null)i.add(l[1])}return i}function te(e){if(!/[:@]for\s*=/.test(e)&&!/\bx-for\s*=/.test(e))return[];let i=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${j})>`,"iy"),s=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,t=ce(e,(a,l)=>{i.lastIndex=l;let o=i.exec(a);if(!o||o.index!==l||!s.test(o[2]))return-1;return i.lastIndex}),n=[];for(let a of t){i.lastIndex=0;let l=i.exec(a.token);if(!l)continue;let o=l[2].match(s),p=oo(o?.[1]??o?.[2]??""),h=[p.itemVar,p.indexVar].filter(Boolean);if(h.length===0)continue;let u=l[1],g=/\/\s*>$/.test(a.token)||N.has(u.toLowerCase())?a.end:z(e,a.start,u,a.end);if(g!==-1)n.push({start:a.start,end:g,vars:new Set(h)})}return n}var Z=new Set(["true","false","null","undefined","NaN","Infinity","typeof","instanceof","in","of","new","void","delete","this","Math","JSON","Date","Number","String","Boolean","Array","Object","RegExp","Map","Set","Symbol","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","window","document","console"]);function ne(e){return e.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function F(e,i,s,t){if(!e)return!1;let n=ne(e),a=!1,l=!1,o=!1,p=/([a-zA-Z_$][\w$]*)/g,h;while((h=p.exec(n))!==null){let d=h[1];if(n.slice(0,h.index).trimEnd().endsWith("."))continue;if(Z.has(d))continue;if(i.has(d)||t?.has(d))a=!0;else if(s&&d in s)l=!0}let u=/([a-zA-Z_$][\w$]*)(?:\.[a-zA-Z_$][\w$]*)*\s*\(\s*\)/g,c;while((c=u.exec(n))!==null){let d=c[1];if(n.slice(0,c.index).trimEnd().endsWith("."))continue;if(Z.has(d)||s&&d in s)continue;o=!0}return(a||o)&&!l}function M(e,i,s){let t=s===void 0?` ${i}`:` ${i}="${s.replace(/"/g,"&quot;")}"`,n=e.trim(),a=n.match(Q);if(a&&se(a[3],a[1])){let[,l,o,p]=a;return`<${l}${o}${t}>${p}</${l}>`}return`<template${t}>${n}</template>`}function se(e,i){let s=new RegExp(`<(/)?${i}(?=[\\s/>])`,"gi"),t=0,n;while((n=s.exec(e))!==null)if(n[1]){if(t--,t<0)return!1}else t++;return!0}function io(e,i){let s=J(e);function t(n){let a=n,l=te(n),o=(c)=>{let g=new Set;for(let d of l)if(c>d.start&&c<d.end)for(let f of d.vars)g.add(f);return g},p=/@if\s*\(/g,h,u=[];while((h=p.exec(a))!==null){let c=h.index,g=c+h[0].length,d=1,f=g;while(f<a.length&&d>0){if(a[f]==="(")d++;else if(a[f]===")")d--;f++}if(d!==0)continue;let b=a.substring(g,f-1).trim(),E=f,S=1,w=E,m=/@(if\s*\(|endif)/g;m.lastIndex=E;let x;while((x=m.exec(a))!==null)if(x[1].startsWith("if"))S++;else if(x[1]==="endif"){if(S--,S===0){w=x.index+x[0].length;break}}if(S!==0)continue;let C=a.substring(E,w-6).trim(),R;if(ee(C)){let _=tn(a.substring(c,w));if(_.length===0)continue;let v=_[0].branches.filter((A)=>A.type!=="else"),I=o(c);if(!(v.length>0&&v.every((A)=>F(A.condition,s,i,I))))continue;R=_[0].branches.map((A)=>{let V=t(A.content);if(A.type==="elseif")return M(V,"@else-if",A.condition??"");if(A.type==="else")return M(V,"@else");return M(V,"@if",A.condition??"")}).join(`
3
- `)}else{if(!F(b,s,i,o(c)))continue;R=M(t(C),"@if",b)}u.push({start:c,end:w,replacement:R}),p.lastIndex=w}for(let c=u.length-1;c>=0;c--){let{start:g,end:d,replacement:f}=u[c];a=a.substring(0,g)+f+a.substring(d)}return a}return t(e)}function re(e){let i=e.trim();if(i==="")return;if(i==="true")return!0;if(i==="false")return!1;if(i==="null")return!1;if(i==="undefined")return!1;if(i==="NaN")return!1;if(/^-?\d+(?:\.\d+)?$/.test(i)){let n=Number(i);return n!==0&&!Number.isNaN(n)}let s=i.match(/^'((?:\\.|[^'\\])*)'$/);if(s)return s[1].length>0;let t=i.match(/^"((?:\\.|[^"\\])*)"$/);if(t)return t[1].length>0;return}var N=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),G=/<(script|style)\b/iy,ie=/<\/script/gi,oe=/<\/style/gi;function z(e,i,s,t){if(N.has(s.toLowerCase()))return t;let n=s.toLowerCase(),a=e.length,l=1,o=t;while(o<a){let p=e.indexOf("<",o);if(p===-1)return-1;if(o=p,e.startsWith("<!--",o)){let g=e.indexOf("-->",o+4);if(g===-1)return-1;o=g+3;continue}G.lastIndex=o;let h=G.exec(e);if(h){let g=e.indexOf(">",o);if(g===-1)return-1;if(e[g-1]==="/"){o=g+1;continue}let d=h[1].toLowerCase()==="script"?ie:oe;d.lastIndex=o;let f=d.exec(e);if(f===null)return-1;let b=e.indexOf(">",f.index);if(b===-1)return-1;o=b+1;continue}if(e[o+1]==="/"){let g=/^<\/([a-z][\w-]*)\s*>/i.exec(e.slice(o,o+64));if(!g){o++;continue}if(g[1].toLowerCase()===n){if(l--,o+=g[0].length,l===0)return o;continue}o+=g[0].length;continue}let u=/^<([a-z][\w-]*)\b/i.exec(e.slice(o,o+64));if(!u){o++;continue}let c=e.indexOf(">",o);if(c===-1)return-1;if(u[1].toLowerCase()===n){let g=e.slice(o,c+1);if(!(/\/\s*>$/.test(g)||N.has(n)))l++}o=c+1}return-1}var ae=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function le(e,i){let s=i,t=e.length;for(;;){while(s<t&&e[s]!=="<")s++;if(s>=t)return!1;if(e.startsWith("<!--",s)){let l=e.indexOf("-->",s+4);if(l===-1)return!1;s=l+3;continue}break}if(e[s+1]==="/")return!1;let n=e.indexOf(">",s);if(n===-1)return!1;let a=e.slice(s,n+1);return ae.test(a)}function ao(e){if(!e.includes(":if")&&!e.includes(":show")&&!e.includes("x-if")&&!e.includes("x-show")&&!e.includes("@if=")&&!e.includes("@show="))return e;let i=[],s=/<(script|style)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,t;while((t=s.exec(e))!==null)i.push([t.index,t.index+t[0].length]);let n=(c)=>i.some(([g,d])=>c>=g&&c<d),a=/<([a-zA-Z][\w-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*?)\s+(:if|:show|x-if|x-show|@if|@show)\s*=\s*"([^"]*)"((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)(\/?)>/g,l=[],o;while((o=a.exec(e))!==null){if(n(o.index))continue;let[c,g,d,f,b,E,S]=o,w=re(b);if(w===void 0)continue;let m=o.index,x=m+c.length,_=!!S||/\/\s*>$/.test(c)||N.has(g.toLowerCase())?x:z(e,m,g,x);if(_===-1)continue;if((f===":if"||f==="x-if"||f==="@if")&&le(e,_)){a.lastIndex=x;continue}if(w===!0){let I=`<${g}${d}${E}${S}>`;l.push({start:m,end:x,replacement:I});continue}l.push({start:m,end:_,replacement:""}),a.lastIndex=_}if(l.length===0)return e;l.sort((c,g)=>c.start-g.start);let p=[],h=-1;for(let c of l){if(c.start<h)continue;p.push(c),h=c.end}let u=e;for(let c=p.length-1;c>=0;c--){let{start:g,end:d,replacement:f}=p[c];u=u.substring(0,g)+f+u.substring(d)}return u}var X=[":for","@for","x-for"];function zr(e,i){if(!i||Object.keys(i).length===0)return e;if(!X.some((o)=>e.includes(`${o}=`)))return e;let s=J(e);if(Array.isArray(i.__stx_client_signal_names)){for(let o of i.__stx_client_signal_names)if(typeof o==="string")s.add(o)}let t=e,n=[],a=/<([a-zA-Z][\w-]*)((?:[^>"']|"[^"]*"|'[^']*')*)>/g,l;while((l=a.exec(t))!==null){let[o,p,h]=l,u=l.index,c=u+o.length,g=X.map((R)=>({attr:R,m:new RegExp(`\\s${R}="([^"]*)"`).exec(h)})).find((R)=>R.m!==null);if(!g||!g.m)continue;let d=oo(g.m[1]);if(!d.iterable||!d.itemVar)continue;let f=d.iterable.trim().split(/[.[(]/)[0].trim();if(!f||s.has(f)||!(f in i))continue;let b=z(t,u,p,c);if(b===-1)continue;let E=h.replace(new RegExp(`\\s${g.attr}="[^"]*"`),"").replace(/\s:key="[^"]*"/,"").replace(/\sx-cloak(?=\s|$)/,""),S=t.slice(c,b-`</${p}>`.length),w={...i,[d.itemVar]:void 0};if(d.indexVar)w[d.indexVar]=void 0;let m=zr(S,w),x=d.indexVar?`${d.iterable} as ${d.indexVar} => ${d.itemVar}`:`${d.iterable} as ${d.itemVar}`,C=p.toLowerCase()==="template"?m:`<${p}${E}>${m}</${p}>`;n.push({start:u,end:b,replacement:`@foreach(${x})${C}@endforeach`}),a.lastIndex=b}for(let o=n.length-1;o>=0;o--){let{start:p,end:h,replacement:u}=n[o];t=t.slice(0,p)+u+t.slice(h)}return t}function Hr(e,i){let s=e,t=/@(for|foreach)\s*\(/g,n,a=[],l=[];while((n=t.exec(s))!==null){let o=n[1],p=n.index,h=p+n[0].length,u=1,c=h;while(c<s.length&&u>0){if(s[c]==="(")u++;else if(s[c]===")")u--;c++}if(u!==0)continue;let g=s.substring(h,c-1).trim(),d=c,f=oo(g),b=o==="for"?"@endfor":"@endforeach",E=1,S=d,w=o==="for"?new RegExp("@(for(?!each)\\s*\\(|endfor(?!each))","g"):new RegExp(`@(${o}\\s*\\(|end${o})`,"g");w.lastIndex=d;let m;while((m=w.exec(s))!==null)if(m[1].startsWith(o))E++;else if(E--,E===0){S=m.index+m[0].length;break}if(E!==0)continue;let x=()=>{let y=[f.itemVar,f.indexVar].filter(Boolean);if(y.length)l.push({start:p,end:S,vars:y})};if(f.iterable){let y=f.iterable.trim();if(y.startsWith("[")||y.startsWith("{")||y.startsWith("'")||y.startsWith('"')||y.startsWith("`")||/^-?\d/.test(y)){x();continue}let k=y.split(/[.[(]/)[0].trim(),A=i?k in i:!1,V=l.some((P)=>p>P.start&&p<P.end&&P.vars.includes(k));if(k&&(A||V)){x();continue}}if(f.style==="as")g=f.indexVar?`(${f.itemVar}, ${f.indexVar}) in ${f.iterable}`:`${f.itemVar} in ${f.iterable}`;let C=s.substring(d,S-b.length).trim(),R=i?{...i}:{};if(f.itemVar)delete R[f.itemVar];if(f.indexVar)delete R[f.indexVar];let _=Hr(C,R),v=_.match(Q),I;if(v){let[,y,k,A]=v;I=`<${y}${k} @for="${g}">${A}</${y}>`}else I=`<template @for="${g}">${_}</template>`;a.push({start:p,end:S,replacement:I}),t.lastIndex=S}for(let o=a.length-1;o>=0;o--){let{start:p,end:h,replacement:u}=a[o];s=s.substring(0,p)+u+s.substring(h)}return s}function ue(e){let i=new Set,s=[],t=0,n=0,a=e.length,l=(u)=>{let c=t+1;while(c<a){let g=e[c];if(g==="\\"){c+=2;continue}if(g===u)return c+1;c++}return a},o=()=>{let u=t+2;while(u<a&&e[u]!==`
2
+ import{st,lc}from"./chunk-zp79zkkd.js";import{T}from"./chunk-ce6zddpf.js";import{L,ss,r,sn,q,ue,Ra,Pt,dn,De,Me}from"./chunk-f9zyf9n6.js";import{Xn}from"./chunk-twqzn21x.js";import{W}from"./chunk-p6qd7ad0.js";import{tn}from"./chunk-hgry3mjd.js";var j=`(?:"[^"]*"|'[^']*'|[^>"'])*`,H=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s,Q=65536,J=4,O=new Map;function gp(){O.clear()}function K(e){let i=[];for(let s of ue(e,q)){let t=s.token.match(/^<script\b([^>]*)>/i),n=s.token.match(/<\/script\s*>$/i);if(!t||!n)continue;let a=t[0].length,l=s.token.length-n[0].length;i.push(Object.freeze({fullMatch:s.token,attrs:t[1],body:s.token.slice(a,l),start:s.start,end:s.end}))}return i}function Cl(e,i={}){let s=e.length>=Q,t=s?O.get(e):void 0;if(t===void 0){if(t=K(e),s)Ra(O,J),O.set(e,t)}let n=i.skipAttrs;if(!n)return t.slice();let a=[];for(let l of t)if(n.lastIndex=0,!n.test(l.attrs))a.push(l);return a}function io(e){let i=e.trim(),s=i.match(/^([\s\S]+?)\s+as\s+(.+)$/);if(s){let n=s[1].trim(),a=s[2].trim(),{itemVar:l,indexVar:o}=B(a);if(l)return{style:"as",iterable:n,itemVar:l,indexVar:o}}let t=i.match(/^(\([^)]+\)|\w+(?:\s*,\s*\w+)?)\s+(?:in|of)\s+([\s\S]+)$/);if(t){let n=t[1].trim(),a=t[2].trim(),{itemVar:l,indexVar:o}=B(n);if(l)return{style:"in",iterable:a,itemVar:l,indexVar:o}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function B(e){let i=e.trim(),s=i.match(/^(\w+)\s*=>\s*(\w+)$/);if(s)return{itemVar:s[2],indexVar:s[1]};let t=i.match(/^\(\s*(\w+)(?:\s*,\s*(\w+))?\s*\)$/);if(t)return{itemVar:t[1],indexVar:t[2]||null};let n=i.match(/^(\w+)\s*,\s*(\w+)$/);if(n)return{itemVar:n[1],indexVar:n[2]};let a=i.match(/^(\w+)$/);if(a)return{itemVar:a[1],indexVar:null};return{itemVar:null,indexVar:null}}function zr(e,i){return lc(e,i)}function Y(e){let i=/@(if\s*\(|endif|elseif\s*\(|else\b)/g,s=0,t;while((t=i.exec(e))!==null){let n=t[1];if(n.startsWith("if"))s++;else if(n==="endif")s--;else if(s===0)return!0}return!1}function Gn(e){let i=new Set,s=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,t=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel)\s*(?:<[^>]*>)?\s*\(/g,n;while((n=s.exec(e))!==null){let a=n[1],l;while((l=t.exec(a))!==null)i.add(l[1])}return i}function ee(e){if(!/[:@]for\s*=/.test(e)&&!/\bx-for\s*=/.test(e))return[];let i=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${j})>`,"iy"),s=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,t=ue(e,(a,l)=>{i.lastIndex=l;let o=i.exec(a);if(!o||o.index!==l||!s.test(o[2]))return-1;return i.lastIndex}),n=[];for(let a of t){i.lastIndex=0;let l=i.exec(a.token);if(!l)continue;let o=l[2].match(s),p=io(o?.[1]??o?.[2]??""),h=[p.itemVar,p.indexVar].filter(Boolean);if(h.length===0)continue;let u=l[1],g=/\/\s*>$/.test(a.token)||N.has(u.toLowerCase())?a.end:z(e,a.start,u,a.end);if(g!==-1)n.push({start:a.start,end:g,vars:new Set(h)})}return n}var Z=new Set(["true","false","null","undefined","NaN","Infinity","typeof","instanceof","in","of","new","void","delete","this","Math","JSON","Date","Number","String","Boolean","Array","Object","RegExp","Map","Set","Symbol","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","window","document","console"]);function te(e){return e.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function F(e,i,s,t){if(!e)return!1;let n=te(e),a=!1,l=!1,o=!1,p=/([a-zA-Z_$][\w$]*)/g,h;while((h=p.exec(n))!==null){let d=h[1];if(n.slice(0,h.index).trimEnd().endsWith("."))continue;if(Z.has(d))continue;if(i.has(d)||t?.has(d))a=!0;else if(s&&d in s)l=!0}let u=/([a-zA-Z_$][\w$]*)(?:\.[a-zA-Z_$][\w$]*)*\s*\(\s*\)/g,c;while((c=u.exec(n))!==null){let d=c[1];if(n.slice(0,c.index).trimEnd().endsWith("."))continue;if(Z.has(d)||s&&d in s)continue;o=!0}return(a||o)&&!l}function M(e,i,s){let t=s===void 0?` ${i}`:` ${i}="${s.replace(/"/g,"&quot;")}"`,n=e.trim(),a=n.match(H);if(a&&ne(a[3],a[1])){let[,l,o,p]=a;return`<${l}${o}${t}>${p}</${l}>`}return`<template${t}>${n}</template>`}function ne(e,i){let s=new RegExp(`<(/)?${i}(?=[\\s/>])`,"gi"),t=0,n;while((n=s.exec(e))!==null)if(n[1]){if(t--,t<0)return!1}else t++;return!0}function ao(e,i){let s=Gn(e);function t(n){let a=n,l=ee(n),o=(c)=>{let g=new Set;for(let d of l)if(c>d.start&&c<d.end)for(let f of d.vars)g.add(f);return g},p=/@if\s*\(/g,h,u=[];while((h=p.exec(a))!==null){let c=h.index,g=c+h[0].length,d=1,f=g;while(f<a.length&&d>0){if(a[f]==="(")d++;else if(a[f]===")")d--;f++}if(d!==0)continue;let b=a.substring(g,f-1).trim(),E=f,S=1,w=E,m=/@(if\s*\(|endif)/g;m.lastIndex=E;let x;while((x=m.exec(a))!==null)if(x[1].startsWith("if"))S++;else if(x[1]==="endif"){if(S--,S===0){w=x.index+x[0].length;break}}if(S!==0)continue;let C=a.substring(E,w-6).trim(),R;if(Y(C)){let _=tn(a.substring(c,w));if(_.length===0)continue;let v=_[0].branches.filter((A)=>A.type!=="else"),I=o(c);if(!(v.length>0&&v.every((A)=>F(A.condition,s,i,I))))continue;R=_[0].branches.map((A)=>{let V=t(A.content);if(A.type==="elseif")return M(V,"@else-if",A.condition??"");if(A.type==="else")return M(V,"@else");return M(V,"@if",A.condition??"")}).join(`
3
+ `)}else{if(!F(b,s,i,o(c)))continue;R=M(t(C),"@if",b)}u.push({start:c,end:w,replacement:R}),p.lastIndex=w}for(let c=u.length-1;c>=0;c--){let{start:g,end:d,replacement:f}=u[c];a=a.substring(0,g)+f+a.substring(d)}return a}return t(e)}function se(e){let i=e.trim();if(i==="")return;if(i==="true")return!0;if(i==="false")return!1;if(i==="null")return!1;if(i==="undefined")return!1;if(i==="NaN")return!1;if(/^-?\d+(?:\.\d+)?$/.test(i)){let n=Number(i);return n!==0&&!Number.isNaN(n)}let s=i.match(/^'((?:\\.|[^'\\])*)'$/);if(s)return s[1].length>0;let t=i.match(/^"((?:\\.|[^"\\])*)"$/);if(t)return t[1].length>0;return}var N=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),U=/<(script|style)\b/iy,re=/<\/script/gi,ie=/<\/style/gi;function z(e,i,s,t){if(N.has(s.toLowerCase()))return t;let n=s.toLowerCase(),a=e.length,l=1,o=t;while(o<a){let p=e.indexOf("<",o);if(p===-1)return-1;if(o=p,e.startsWith("<!--",o)){let g=e.indexOf("-->",o+4);if(g===-1)return-1;o=g+3;continue}U.lastIndex=o;let h=U.exec(e);if(h){let g=e.indexOf(">",o);if(g===-1)return-1;if(e[g-1]==="/"){o=g+1;continue}let d=h[1].toLowerCase()==="script"?re:ie;d.lastIndex=o;let f=d.exec(e);if(f===null)return-1;let b=e.indexOf(">",f.index);if(b===-1)return-1;o=b+1;continue}if(e[o+1]==="/"){let g=/^<\/([a-z][\w-]*)\s*>/i.exec(e.slice(o,o+64));if(!g){o++;continue}if(g[1].toLowerCase()===n){if(l--,o+=g[0].length,l===0)return o;continue}o+=g[0].length;continue}let u=/^<([a-z][\w-]*)\b/i.exec(e.slice(o,o+64));if(!u){o++;continue}let c=e.indexOf(">",o);if(c===-1)return-1;if(u[1].toLowerCase()===n){let g=e.slice(o,c+1);if(!(/\/\s*>$/.test(g)||N.has(n)))l++}o=c+1}return-1}var oe=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function ce(e,i){let s=i,t=e.length;for(;;){while(s<t&&e[s]!=="<")s++;if(s>=t)return!1;if(e.startsWith("<!--",s)){let l=e.indexOf("-->",s+4);if(l===-1)return!1;s=l+3;continue}break}if(e[s+1]==="/")return!1;let n=e.indexOf(">",s);if(n===-1)return!1;let a=e.slice(s,n+1);return oe.test(a)}function co(e){if(!e.includes(":if")&&!e.includes(":show")&&!e.includes("x-if")&&!e.includes("x-show")&&!e.includes("@if=")&&!e.includes("@show="))return e;let i=[],s=/<(script|style)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,t;while((t=s.exec(e))!==null)i.push([t.index,t.index+t[0].length]);let n=(c)=>i.some(([g,d])=>c>=g&&c<d),a=/<([a-zA-Z][\w-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*?)\s+(:if|:show|x-if|x-show|@if|@show)\s*=\s*"([^"]*)"((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)(\/?)>/g,l=[],o;while((o=a.exec(e))!==null){if(n(o.index))continue;let[c,g,d,f,b,E,S]=o,w=se(b);if(w===void 0)continue;let m=o.index,x=m+c.length,_=!!S||/\/\s*>$/.test(c)||N.has(g.toLowerCase())?x:z(e,m,g,x);if(_===-1)continue;if((f===":if"||f==="x-if"||f==="@if")&&ce(e,_)){a.lastIndex=x;continue}if(w===!0){let I=`<${g}${d}${E}${S}>`;l.push({start:m,end:x,replacement:I});continue}l.push({start:m,end:_,replacement:""}),a.lastIndex=_}if(l.length===0)return e;l.sort((c,g)=>c.start-g.start);let p=[],h=-1;for(let c of l){if(c.start<h)continue;p.push(c),h=c.end}let u=e;for(let c=p.length-1;c>=0;c--){let{start:g,end:d,replacement:f}=p[c];u=u.substring(0,g)+f+u.substring(d)}return u}var G=[":for","@for","x-for"];function Hr(e,i){if(!i||Object.keys(i).length===0)return e;if(!G.some((o)=>e.includes(`${o}=`)))return e;let s=Gn(e);if(Array.isArray(i.__stx_client_signal_names)){for(let o of i.__stx_client_signal_names)if(typeof o==="string")s.add(o)}let t=e,n=[],a=/<([a-zA-Z][\w-]*)((?:[^>"']|"[^"]*"|'[^']*')*)>/g,l;while((l=a.exec(t))!==null){let[o,p,h]=l,u=l.index,c=u+o.length,g=G.map((R)=>({attr:R,m:new RegExp(`\\s${R}="([^"]*)"`).exec(h)})).find((R)=>R.m!==null);if(!g||!g.m)continue;let d=io(g.m[1]);if(!d.iterable||!d.itemVar)continue;let f=d.iterable.trim().split(/[.[(]/)[0].trim();if(!f||s.has(f)||!(f in i))continue;let b=z(t,u,p,c);if(b===-1)continue;let E=h.replace(new RegExp(`\\s${g.attr}="[^"]*"`),"").replace(/\s:key="[^"]*"/,"").replace(/\sx-cloak(?=\s|$)/,""),S=t.slice(c,b-`</${p}>`.length),w={...i,[d.itemVar]:void 0};if(d.indexVar)w[d.indexVar]=void 0;let m=Hr(S,w),x=d.indexVar?`${d.iterable} as ${d.indexVar} => ${d.itemVar}`:`${d.iterable} as ${d.itemVar}`,C=p.toLowerCase()==="template"?m:`<${p}${E}>${m}</${p}>`;n.push({start:u,end:b,replacement:`@foreach(${x})${C}@endforeach`}),a.lastIndex=b}for(let o=n.length-1;o>=0;o--){let{start:p,end:h,replacement:u}=n[o];t=t.slice(0,p)+u+t.slice(h)}return t}function Vr(e,i){let s=e,t=/@(for|foreach)\s*\(/g,n,a=[],l=[];while((n=t.exec(s))!==null){let o=n[1],p=n.index,h=p+n[0].length,u=1,c=h;while(c<s.length&&u>0){if(s[c]==="(")u++;else if(s[c]===")")u--;c++}if(u!==0)continue;let g=s.substring(h,c-1).trim(),d=c,f=io(g),b=o==="for"?"@endfor":"@endforeach",E=1,S=d,w=o==="for"?new RegExp("@(for(?!each)\\s*\\(|endfor(?!each))","g"):new RegExp(`@(${o}\\s*\\(|end${o})`,"g");w.lastIndex=d;let m;while((m=w.exec(s))!==null)if(m[1].startsWith(o))E++;else if(E--,E===0){S=m.index+m[0].length;break}if(E!==0)continue;let x=()=>{let y=[f.itemVar,f.indexVar].filter(Boolean);if(y.length)l.push({start:p,end:S,vars:y})};if(f.iterable){let y=f.iterable.trim();if(y.startsWith("[")||y.startsWith("{")||y.startsWith("'")||y.startsWith('"')||y.startsWith("`")||/^-?\d/.test(y)){x();continue}let k=y.split(/[.[(]/)[0].trim(),A=i?k in i:!1,V=l.some((P)=>p>P.start&&p<P.end&&P.vars.includes(k));if(k&&(A||V)){x();continue}}if(f.style==="as")g=f.indexVar?`(${f.itemVar}, ${f.indexVar}) in ${f.iterable}`:`${f.itemVar} in ${f.iterable}`;let C=s.substring(d,S-b.length).trim(),R=i?{...i}:{};if(f.itemVar)delete R[f.itemVar];if(f.indexVar)delete R[f.indexVar];let _=Vr(C,R),v=_.match(H),I;if(v){let[,y,k,A]=v;I=`<${y}${k} @for="${g}">${A}</${y}>`}else I=`<template @for="${g}">${_}</template>`;a.push({start:p,end:S,replacement:I}),t.lastIndex=S}for(let o=a.length-1;o>=0;o--){let{start:p,end:h,replacement:u}=a[o];s=s.substring(0,p)+u+s.substring(h)}return s}function ae(e){let i=new Set,s=[],t=0,n=0,a=e.length,l=(u)=>{let c=t+1;while(c<a){let g=e[c];if(g==="\\"){c+=2;continue}if(g===u)return c+1;c++}return a},o=()=>{let u=t+2;while(u<a&&e[u]!==`
4
4
  `)u++;return u},p=()=>{let u=t+2;while(u<a-1){if(e[u]==="*"&&e[u+1]==="/")return u+2;u++}return a},h=(u)=>{let c=u,g=0;while(c<a){let d=e[c];if(d==="/"&&e[c+1]==="/"){let f=c+2;while(f<a&&e[f]!==`
5
- `)f++;c=f;continue}if(d==="/"&&e[c+1]==="*"){let f=c+2;while(f<a-1&&!(e[f]==="*"&&e[f+1]==="/"))f++;c=f+2;continue}if(d==='"'||d==="'"||d==="`"){let f=c+1;while(f<a){if(e[f]==="\\"){f+=2;continue}if(e[f]===d){f++;break}f++}c=f;continue}if(d==="("||d==="["||d==="{"){g++,c++;continue}if(d===")"||d==="]"||d==="}"){g--,c++;continue}if(d===";"&&g===0)return c+1;c++}return a};while(t<a){let u=e[t];if(u==="/"&&e[t+1]==="/"){let c=o();s.push(e.slice(t,c)),t=c;continue}if(u==="/"&&e[t+1]==="*"){let c=p();s.push(e.slice(t,c)),t=c;continue}if(u==='"'||u==="'"||u==="`"){let c=l(u);s.push(e.slice(t,c)),t=c;continue}if(u==="{"){n++,s.push(u),t++;continue}if(u==="}"){n--,s.push(u),t++;continue}if(n===0){let c=t>0?e[t-1]:"";if(c===""||/\s/.test(c)||c===";"||c==="}"||c==="{"){let d=e.slice(t).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(d){let f=d[2],b=h(t+d[0].length);if(i.has(f)){s.push(`/* stx: deduped const ${f} */`),t=b;continue}i.add(f),s.push(e.slice(t,b)),t=b;continue}}}s.push(u),t++}return s.join("")}var fe=new Set(["script","style","html","head","meta","link","title","!doctype"]);function D(e,i,s){for(let t of s){if(t.start>=i)return!1;if(t.end>e)return!0}return!1}function de(e,i,s){let t=0;while(t<e.length){let n=e.indexOf(i,t);if(n===-1)return!1;if(!D(n,n+i.length,s))return!0;t=n+i.length}return!1}function ge(e,i){if(de(e,"<body",i)){let n=new RegExp(`<body(${j})>`,"g"),a;while((a=n.exec(e))!==null)if(!D(a.index,a.index+a[0].length,i))return a.index+a[0].length-1;return null}let s=new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${j})>`,"gi"),t;while((t=s.exec(e))!==null){if(D(t.index,t.index+t[0].length,i))continue;if(fe.has(t[1].toLowerCase()))continue;return t.index+t[0].length-1}return null}function pe(e,i,s,t){let n=[],a=` data-stx="${t}"`,l=0,o=!1,p=(h)=>{if(s!==null&&!o&&s>=l&&s<=h)n.push(e.slice(l,s),a,e.slice(s,h)),o=!0;else n.push(e.slice(l,h))};for(let h of i){if(h.start<l)continue;p(h.start),l=h.end}return p(e.length),n.join("")}async function Vr(e,i,s,t={}){let n=_l(e,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),a=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|keptState|useCookie|useId|useModel|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,l=[],{hasUserImports:o,bundleClientScript:p}=await r("stx/client-script-bundler",()=>import("./chunk-wz6368p4.js"));for(let m of n){let x=m.body;if(De(m.attrs))x=Me(x);if(t.forceClientSetup||a.test(x)){l.push({content:x,start:m.start,end:m.end});continue}if(!o(x))continue;try{let C=await p(Pt(x).code,i||"",{projectRoot:process.cwd(),externalizeUserModules:!1});if(a.test(C))l.push({content:x,start:m.start,end:m.end})}catch{}}if(l.length===0)return{output:e,setupCode:null};let h=`${i??""}\x00${l.map((m)=>m.content).join("\x00")}`,u=`__stx_setup_${Bun.hash(h).toString(36).slice(0,10)}`,c=[];for(let m=0;m<l.length;m++){let x=l[m].bundled??Pt(l[m].content).code;if(!l[m].bundled&&o(x))x=await p(x,i||"",{projectRoot:process.cwd()});x=ht(x);let C=T(x);c.push(`// \u2500\u2500 merged signal script #${m+1} \u2500\u2500
5
+ `)f++;c=f;continue}if(d==="/"&&e[c+1]==="*"){let f=c+2;while(f<a-1&&!(e[f]==="*"&&e[f+1]==="/"))f++;c=f+2;continue}if(d==='"'||d==="'"||d==="`"){let f=c+1;while(f<a){if(e[f]==="\\"){f+=2;continue}if(e[f]===d){f++;break}f++}c=f;continue}if(d==="("||d==="["||d==="{"){g++,c++;continue}if(d===")"||d==="]"||d==="}"){g--,c++;continue}if(d===";"&&g===0)return c+1;c++}return a};while(t<a){let u=e[t];if(u==="/"&&e[t+1]==="/"){let c=o();s.push(e.slice(t,c)),t=c;continue}if(u==="/"&&e[t+1]==="*"){let c=p();s.push(e.slice(t,c)),t=c;continue}if(u==='"'||u==="'"||u==="`"){let c=l(u);s.push(e.slice(t,c)),t=c;continue}if(u==="{"){n++,s.push(u),t++;continue}if(u==="}"){n--,s.push(u),t++;continue}if(n===0){let c=t>0?e[t-1]:"";if(c===""||/\s/.test(c)||c===";"||c==="}"||c==="{"){let d=e.slice(t).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(d){let f=d[2],b=h(t+d[0].length);if(i.has(f)){s.push(`/* stx: deduped const ${f} */`),t=b;continue}i.add(f),s.push(e.slice(t,b)),t=b;continue}}}s.push(u),t++}return s.join("")}var le=new Set(["script","style","html","head","meta","link","title","!doctype"]);function D(e,i,s){for(let t of s){if(t.start>=i)return!1;if(t.end>e)return!0}return!1}function fe(e,i,s){let t=0;while(t<e.length){let n=e.indexOf(i,t);if(n===-1)return!1;if(!D(n,n+i.length,s))return!0;t=n+i.length}return!1}function de(e,i){if(fe(e,"<body",i)){let n=new RegExp(`<body(${j})>`,"g"),a;while((a=n.exec(e))!==null)if(!D(a.index,a.index+a[0].length,i))return a.index+a[0].length-1;return null}let s=new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${j})>`,"gi"),t;while((t=s.exec(e))!==null){if(D(t.index,t.index+t[0].length,i))continue;if(le.has(t[1].toLowerCase()))continue;return t.index+t[0].length-1}return null}function ge(e,i,s,t){let n=[],a=` data-stx="${t}"`,l=0,o=!1,p=(h)=>{if(s!==null&&!o&&s>=l&&s<=h)n.push(e.slice(l,s),a,e.slice(s,h)),o=!0;else n.push(e.slice(l,h))};for(let h of i){if(h.start<l)continue;p(h.start),l=h.end}return p(e.length),n.join("")}async function Ur(e,i,s,t={}){let n=Cl(e,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),a=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|keptState|useCookie|useId|useModel|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,l=[],{hasUserImports:o,bundleClientScript:p}=await r("stx/client-script-bundler",()=>import("./chunk-2a775q7x.js"));for(let m of n){let x=m.body;if(De(m.attrs))x=Me(x);if(t.forceClientSetup||a.test(x)){l.push({content:x,start:m.start,end:m.end});continue}if(!o(x))continue;try{let C=await p(Pt(x).code,i||"",{projectRoot:process.cwd(),externalizeUserModules:!1});if(a.test(C))l.push({content:x,start:m.start,end:m.end})}catch{}}if(l.length===0)return{output:e,setupCode:null};let h=`${i??""}\x00${l.map((m)=>m.content).join("\x00")}`,u=`__stx_setup_${Bun.hash(h).toString(36).slice(0,10)}`,c=[];for(let m=0;m<l.length;m++){let x=l[m].bundled??Pt(l[m].content).code;if(!l[m].bundled&&o(x))x=await p(x,i||"",{projectRoot:process.cwd()});x=ht(x);let C=T(x);c.push(`// \u2500\u2500 merged signal script #${m+1} \u2500\u2500
6
6
  ${C}`)}let g=c.join(`
7
7
 
8
- `);g=ue(g);let f=L(g).split(",").map((m)=>m.trim()).filter(Boolean),b=dn(g,s),E=`
8
+ `);g=ae(g);let f=L(g).split(",").map((m)=>m.trim()).filter(Boolean),b=dn(g,s),E=`
9
9
  <script data-stx-scoped>
10
10
  function ${u}() {
11
11
  ${st("const",f)}
12
12
  ${sn(`${b}${g}`)}
13
- return ${rs(g,f)};
13
+ return ${ss(g,f)};
14
14
  }
15
15
  window.__stx_latestSetup=${u};
16
16
  if(window.stx)window.stx._latestSetup=${u};
17
- </script>`,S=ge(e,l);return{output:pe(e,l,S,u),setupCode:E}}async function co(e,i,s,t){if(!Fr(e,s))return e;let n=e;if(i.skipSignalsRuntime)return n;let{output:a,setupCode:l}=await Vr(n,s,t);if(n=a,!l){let o=U(n);if(o&&!/data-stx/.test(o.attrs)&&!/data-stx-auto/.test(o.attrs)){let p=o.tag.replace(/^<body([^>]*)>$/i,"<body$1 data-stx-auto>");n=n.slice(0,o.index)+p+n.slice(o.index+o.tag.length)}}if(n=await Kn(n,i),l){let o=ia(n,/<\/head>/i),p=o===-1?ia(n,/<body[^>]*>/i):-1;if(o!==-1)n=`${n.slice(0,o)}${l}
17
+ </script>`,S=de(e,l);return{output:ge(e,l,S,u),setupCode:E}}async function lo(e,i,s,t){if(!zr(e,s))return e;let n=e;if(i.skipSignalsRuntime)return n;let{output:a,setupCode:l}=await Ur(n,s,t);if(n=a,!l){let o=W(n);if(o&&!/data-stx/.test(o.attrs)&&!/data-stx-auto/.test(o.attrs)){let p=o.tag.replace(/^<body([^>]*)>$/i,"<body$1 data-stx-auto>");n=n.slice(0,o.index)+p+n.slice(o.index+o.tag.length)}}if(n=await Xn(n,i),l){let o=aa(n,/<\/head>/i),p=o===-1?aa(n,/<body[^>]*>/i):-1;if(o!==-1)n=`${n.slice(0,o)}${l}
18
18
  ${n.slice(o)}`;else if(p!==-1){let h=/<body[^>]*>/i.exec(n.slice(p))[0],u=p+h.length;n=`${n.slice(0,u)}
19
19
  ${l}${n.slice(u)}`}else n=`${n}
20
- ${l}`}return n}function ia(e,i){let s=/<(script|style)\b[\s\S]*?<\/\1>/gi,t=[],n;while((n=s.exec(e))!==null)t.push([n.index,n.index+n[0].length]);let a=new RegExp(i.source,i.flags.replace(/[gy]/g,"")),l=0;while(l<e.length){let o=a.exec(e.slice(l));if(!o)return-1;let p=l+o.index;if(!t.some(([u,c])=>p>=u&&p<c))return p;l=p+Math.max(o[0].length,1)}return-1}var H="/* [stx import stripped, resolved via window.stx in __stx_setup] */";function Cl(e){let i=[];for(let s of e.split(",")){let t=s.trim();if(!t||t.startsWith("type "))continue;let n=t.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(n&&n[1]!==n[2])i.push(`${n[2]} = ${n[1]}`)}if(i.length===0)return H;return`var ${i.join(", ")}; ${H}`}var he=/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"](?:stx|@stacksjs\/stx|@stacksjs\/browser)['"]\s*;?\s*$/gm;function ht(e){return e.replace(he,(i,s)=>Cl(s))}
21
- export{fp,_l,oo,Fr,io,ao,zr,Hr,Vr,co,ia,Cl,ht};
20
+ ${l}`}return n}function aa(e,i){let s=/<(script|style)\b[\s\S]*?<\/\1>/gi,t=[],n;while((n=s.exec(e))!==null)t.push([n.index,n.index+n[0].length]);let a=new RegExp(i.source,i.flags.replace(/[gy]/g,"")),l=0;while(l<e.length){let o=a.exec(e.slice(l));if(!o)return-1;let p=l+o.index;if(!t.some(([u,c])=>p>=u&&p<c))return p;l=p+Math.max(o[0].length,1)}return-1}var X="/* [stx import stripped, resolved via window.stx in __stx_setup] */";function El(e){let i=[];for(let s of e.split(",")){let t=s.trim();if(!t||t.startsWith("type "))continue;let n=t.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(n&&n[1]!==n[2])i.push(`${n[2]} = ${n[1]}`)}if(i.length===0)return X;return`var ${i.join(", ")}; ${X}`}var pe=/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"](?:stx|@stacksjs\/stx|@stacksjs\/browser)['"]\s*;?\s*$/gm;function ht(e){return e.replace(pe,(i,s)=>El(s))}
21
+ export{gp,Cl,io,zr,Gn,ao,co,Hr,Vr,Ur,lo,aa,El,ht};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ns,vi,Er,Ds,Ms,Sn,Vt,wi,Tr,$r,Ls,js,Au,Pu,lt}from"./chunk-fd49fahd.js";export{lt as DeployError,vi as calculateSha1,Er as collectDeployFiles,$r as createDefaultNetlifyConfig,Ds as createFileManifest,Ns as createNetlifyClient,Au as deploy,Tr as detectProjectConfig,Ms as filterRequiredFiles,Sn as formatSize,wi as generateNetlifyToml,Vt as getTotalSize,js as hasNetlifyConfig,Pu as initNetlify,Ls as writeNetlifyConfig};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Ta,n,de}from"./chunk-kwek8xdt.js";import{Ze}from"./chunk-2zzc7006.js";import{c}from"./chunk-zhf01af3.js";import o from"fs";import l from"path";var El=new Map,m=new Map;async function gp(e){let r;for(let i=0;i<3;i++)try{let g=(await o.promises.stat(e)).mtime.getTime(),a=m.get(e);if(a&&a.mtime===g)return a.content;let h=await Bun.file(e).text(),w=(await o.promises.stat(e)).mtime.getTime();if(w!==g)continue;return m.set(e,{content:h,mtime:w}),h}catch(s){r=s;break}throw m.delete(e),Error(`File not found: ${e}${r?` (${r.message})`:""}`)}function mp(e){m.delete(e)}function hp(e){for(let t of m.keys())if(t.startsWith(e))m.delete(t)}var f=null,B=null,x=null;function yp(e){x=e}async function Tl(e=!1){let t=x??await import("./chunk-yscr04dv.js");if(e)return t.generateSignalsRuntimeDev();if(f===null)f=t.generateSignalsRuntime();return f}var S=null;async function $l(){if(S===null){let{getRouterScript:e}=await import("./chunk-028ee6q5.js");S=e()}return S}var y={};async function bp(e,t=!1){let r=e==="runtime"?await Tl(t):await $l(),i=e==="runtime"&&t?"runtime-debug":e,s=y[i];if(!s||s.content!==r)s={content:r,hash:Bun.hash(r).toString(16).padStart(16,"0").slice(0,16)},y[i]=s;return{content:r,hash:s.hash,url:`/_stx/${e}.${s.hash}.js`}}var E=500,T=33554432,u=new Map,p=0;function C(e){return c(process.cwd(),"module-bundles",`${e}.js`)}function vp(e){let t=Bun.hash(e).toString(16).padStart(16,"0").slice(0,16),r=u.get(t),i=r!==void 0;if(i)u.delete(t),p-=r.length*2;u.set(t,e),p+=e.length*2;while(u.size>1&&(u.size>E||p>T)){let s=u.keys().next().value;p-=u.get(s).length*2,u.delete(s)}if(!i)try{let s=C(t);if(!o.existsSync(s))o.mkdirSync(l.dirname(s),{recursive:!0}),o.writeFileSync(s,e)}catch{}return`/_stx/modules.${t}.js`}function uo(e){if(!/^[0-9a-f]{16}$/.test(e))return;let t=u.get(e);if(t!==void 0)return t;try{return o.readFileSync(C(e),"utf8")}catch{return}}function wp(){m.clear(),de(),Ta(),f=null,B=null,S=null}function v(e){let t={debug:e.debug===!0,middleware:(e.middleware??[]).map((r)=>({name:r.name,timing:r.timing,handler:String(r.handler)})),customDirectives:(e.customDirectives??[]).map((r)=>({name:r.name,hasEndTag:r.hasEndTag===!0,rawParams:r.rawParams===!0,handler:String(r.handler)}))};return new Bun.CryptoHasher("sha1").update(JSON.stringify(t)).digest("hex")}async function Xn(e,t){try{if(!t.cachePath)return null;let r=l.resolve(t.cachePath),i=l.join(r,`${Wr(e)}.html`),s=l.join(r,`${Wr(e)}.meta.json`);if(!await n(i)||!await n(s))return null;let g=await Bun.file(s).text(),a=JSON.parse(g);if(a.cacheVersion!==t.cacheVersion)return null;if(a.engine!==Ze())return null;if(a.optionsSignature!==v(t))return null;if((await o.promises.stat(e)).mtime.getTime()>a.mtime)return null;for(let d of a.dependencies)if(await n(d)){if((await o.promises.stat(d)).mtime.getTime()>a.mtime)return null}else return null;return await Bun.file(i).text()}catch(r){return console.warn(`Cache error for ${e}:`,r),null}}async function Jn(e,t,r,i){try{if(!i.cachePath)return;let s=l.resolve(i.cachePath);await o.promises.mkdir(s,{recursive:!0});let g=l.join(s,`${Wr(e)}.html`),a=l.join(s,`${Wr(e)}.meta.json`),h=await o.promises.stat(e);await Bun.write(g,t);let d={sourcePath:e,mtime:h.mtime.getTime(),dependencies:Array.from(r),cacheVersion:i.cacheVersion,engine:Ze(),optionsSignature:v(i),generatedAt:Date.now()};await Bun.write(a,JSON.stringify(d,null,2)),El.set(e,{output:t,mtime:h.mtime.getTime(),dependencies:r})}catch(s){console.warn(`Failed to cache template ${e}:`,s)}}var _=16;function Wr(e){return new Bun.CryptoHasher("sha1").update(e).digest("hex").substring(0,_)}
3
- export{El,gp,mp,hp,yp,Tl,$l,bp,vp,uo,wp,Xn,Jn,Wr};
2
+ import{$a,n,pe}from"./chunk-f9zyf9n6.js";import{Ze}from"./chunk-2zzc7006.js";import{c}from"./chunk-v14rq8b4.js";import o from"fs";import l from"path";var Tl=new Map,m=new Map;async function mp(e){let r;for(let i=0;i<3;i++)try{let g=(await o.promises.stat(e)).mtime.getTime(),a=m.get(e);if(a&&a.mtime===g)return a.content;let h=await Bun.file(e).text(),w=(await o.promises.stat(e)).mtime.getTime();if(w!==g)continue;return m.set(e,{content:h,mtime:w}),h}catch(s){r=s;break}throw m.delete(e),Error(`File not found: ${e}${r?` (${r.message})`:""}`)}function hp(e){m.delete(e)}function yp(e){for(let t of m.keys())if(t.startsWith(e))m.delete(t)}var f=null,B=null,x=null;function bp(e){x=e}async function $l(e=!1){let t=x??await import("./chunk-84tqb1rn.js");if(e)return t.generateSignalsRuntimeDev();if(f===null)f=t.generateSignalsRuntime();return f}var S=null;async function Rl(){if(S===null){let{getRouterScript:e}=await import("./chunk-a81y8g40.js");S=e()}return S}var y={};async function vp(e,t=!1){let r=e==="runtime"?await $l(t):await Rl(),i=e==="runtime"&&t?"runtime-debug":e,s=y[i];if(!s||s.content!==r)s={content:r,hash:Bun.hash(r).toString(16).padStart(16,"0").slice(0,16)},y[i]=s;return{content:r,hash:s.hash,url:`/_stx/${e}.${s.hash}.js`}}var E=500,T=33554432,u=new Map,p=0;function C(e){return c(process.cwd(),"module-bundles",`${e}.js`)}function wp(e){let t=Bun.hash(e).toString(16).padStart(16,"0").slice(0,16),r=u.get(t),i=r!==void 0;if(i)u.delete(t),p-=r.length*2;u.set(t,e),p+=e.length*2;while(u.size>1&&(u.size>E||p>T)){let s=u.keys().next().value;p-=u.get(s).length*2,u.delete(s)}if(!i)try{let s=C(t);if(!o.existsSync(s))o.mkdirSync(l.dirname(s),{recursive:!0}),o.writeFileSync(s,e)}catch{}return`/_stx/modules.${t}.js`}function po(e){if(!/^[0-9a-f]{16}$/.test(e))return;let t=u.get(e);if(t!==void 0)return t;try{return o.readFileSync(C(e),"utf8")}catch{return}}function xp(){m.clear(),pe(),$a(),f=null,B=null,S=null}function v(e){let t={debug:e.debug===!0,middleware:(e.middleware??[]).map((r)=>({name:r.name,timing:r.timing,handler:String(r.handler)})),customDirectives:(e.customDirectives??[]).map((r)=>({name:r.name,hasEndTag:r.hasEndTag===!0,rawParams:r.rawParams===!0,handler:String(r.handler)}))};return new Bun.CryptoHasher("sha1").update(JSON.stringify(t)).digest("hex")}async function Jn(e,t){try{if(!t.cachePath)return null;let r=l.resolve(t.cachePath),i=l.join(r,`${qr(e)}.html`),s=l.join(r,`${qr(e)}.meta.json`);if(!await n(i)||!await n(s))return null;let g=await Bun.file(s).text(),a=JSON.parse(g);if(a.cacheVersion!==t.cacheVersion)return null;if(a.engine!==Ze())return null;if(a.optionsSignature!==v(t))return null;if((await o.promises.stat(e)).mtime.getTime()>a.mtime)return null;for(let d of a.dependencies)if(await n(d)){if((await o.promises.stat(d)).mtime.getTime()>a.mtime)return null}else return null;return await Bun.file(i).text()}catch(r){return console.warn(`Cache error for ${e}:`,r),null}}async function Yn(e,t,r,i){try{if(!i.cachePath)return;let s=l.resolve(i.cachePath);await o.promises.mkdir(s,{recursive:!0});let g=l.join(s,`${qr(e)}.html`),a=l.join(s,`${qr(e)}.meta.json`),h=await o.promises.stat(e);await Bun.write(g,t);let d={sourcePath:e,mtime:h.mtime.getTime(),dependencies:Array.from(r),cacheVersion:i.cacheVersion,engine:Ze(),optionsSignature:v(i),generatedAt:Date.now()};await Bun.write(a,JSON.stringify(d,null,2)),Tl.set(e,{output:t,mtime:h.mtime.getTime(),dependencies:r})}catch(s){console.warn(`Failed to cache template ${e}:`,s)}}var _=16;function qr(e){return new Bun.CryptoHasher("sha1").update(e).digest("hex").substring(0,_)}
3
+ export{Tl,mp,hp,yp,bp,$l,Rl,vp,wp,po,xp,Jn,Yn,qr};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import"./chunk-2dp7hyv7.js";import"./chunk-pxdww4rb.js";import"./chunk-ce6zddpf.js";import"./chunk-kwek8xdt.js";import"./chunk-1sr6c0nk.js";import"./chunk-pvb48ehs.js";import"./chunk-a3d0g4mr.js";import"./chunk-a5zqqgx2.js";import{c}from"./chunk-zhf01af3.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-bsajk82t.js";import"./chunk-zp79zkkd.js";import"./chunk-ce6zddpf.js";import"./chunk-f9zyf9n6.js";import"./chunk-25zmy8q6.js";import"./chunk-mwnhdsbp.js";import"./chunk-7adznted.js";import"./chunk-rym0309c.js";import{c}from"./chunk-v14rq8b4.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,7 +1,7 @@
1
1
  // @bun
2
- import x from"fs";import u from"path";import p from"fs";import w from"path";var y=["components","layouts","partials","emails"];function P(e){return e.split(/[\\/]/).filter(Boolean).slice(0,-1).some((a)=>y.includes(a))}function b(e){return P(e.replace(/^\//,""))}function vo(e,t){let a=e.filter((i)=>!b(i.pattern)),r=["// Auto-generated by STX - do not edit"];if(a.length===0)r.push("// No page routes found \u2014 route paths stay typed as string.","export {}","");else{r.push("declare module '@stacksjs/stx' {"," interface KnownRoutes {");for(let i of a){let c=[];for(let l of i.params){let d=i.pattern.includes(`:${l}?`)?"?":"";c.push(`${l}${d}: string`)}let s=c.join("; ");r.push(` '${i.pattern}': { ${s} }`)}r.push(" }","}","","export {}","")}let n=r.join(`
3
- `),o=w.join(t,"route-types.d.ts");try{if(p.existsSync(o)&&p.readFileSync(o,"utf8")===n)return;p.mkdirSync(t,{recursive:!0}),p.writeFileSync(o,n)}catch{}}function wo(e,t,a){let r=process.cwd(),n=w.relative(r,a),o=e.filter((c)=>!b(c.pattern)),i=["// Auto-generated by stx \u2014 do not edit",`// Source: ${n||"pages"}/`,"","export const routes = ["];for(let c of o){let s=w.relative(r,c.filePath).replace(/\\/g,"/"),l=JSON.stringify(c.params),d=c.layout?`, layout: '${w.relative(r,c.layout).replace(/\\/g,"/")}'`:"";i.push(` { pattern: '${c.pattern}', filePath: '${s}', isDynamic: ${c.isDynamic}, params: ${l}${d} },`)}i.push("] as const",""),i.push("export type RouteName = typeof routes[number]['pattern']",""),p.mkdirSync(t,{recursive:!0}),p.writeFileSync(w.join(t,"routes.ts"),i.join(`
4
- `))}import I from"path";var N=Object.freeze(["ico","png","jpg","jpeg","gif","webp","avif","svg","bmp","tif","tiff","heic","css","js","mjs","cjs","map","wasm","webmanifest","json","xml","txt","rss","atom","woff","woff2","ttf","otf","eot","mp3","mp4","m4a","m4v","mov","webm","ogg","ogv","oga","wav","flac","avi","mkv","pdf","csv","doc","docx","xls","xlsx","ppt","pptx","rtf","odt","zip","gz","tgz","tar","rar","7z","bz2","xz","php","phtml","asp","aspx","jsp","cgi","env","ini","yml","yaml","toml","sql","bak","old","swp","log","conf","cfg","exe","dmg","pkg","apk","ipa","msi","iso","bin","dll"]),D=N.flatMap((e)=>e===e.toUpperCase()?[e]:[e,e.toUpperCase()]).join("|"),G=new RegExp(`\\.(?:${D})$`),E=`(?![^/]*\\.(?:${D})$)`;function vt(e){let t=e,a=t.search(/[?#]/);if(a!==-1)t=t.slice(0,a);let r=t.slice(t.lastIndexOf("/")+1);return r.length>0&&G.test(r)}function R(e,t){let r=I.relative(t,e).replace(/\.(stx|md)$/,"");if(r=r.split(I.sep).join("/"),r==="index")return"/";if(r.endsWith("/index"))r=r.slice(0,-6);return r=r.replace(/\[\[([^\]]+)\]\]/g,":$1?"),r=r.replace(/\[([^\]]+)\]/g,":$1"),r=r.replace(/:\.\.\.([^/]+)/g,":$1*"),`/${r}`}function ie(e,t={}){let a=t.page?E:"",r=[],n="",o=0;while(o<e.length){let i=e.slice(o),c=/^\/:([^/?*]+)\?/.exec(i);if(c){r.push(c[1]);let d=o+c[0].length===e.length;n+=`(?:/${d?a:""}([^/]+))?`,o+=c[0].length;continue}let s=/^:([^/?*]+)\*/.exec(i);if(s){r.push(s[1]),n+="(.+)",o+=s[0].length;continue}let l=/^:([^/?*]+)/.exec(i);if(l){r.push(l[1]);let d=o+l[0].length===e.length;n+=`${d?a:""}([^/]+)`,o+=l[0].length;continue}n+=e[o].replace(/[.+^${}()|[\]\\*?]/g,"\\$&"),o+=1}return{regex:new RegExp(`^${n}$`),params:r}}function Zn(e,t){let a=e===""?"/":e;for(let r of t){let n=a.match(r.regex);if(n){let o={};return r.params.forEach((i,c)=>{o[i]=n[c+1]}),{route:r,params:o}}}return null}function Zr(e,t={}){let a=e.replace(/\[\[([^\]]+)\]\]/g,":$1?").replace(/\[([^\]]+)\]/g,":$1").replace(/:\.\.\.([^/]+)/g,":$1*");return ie(a,t)}import j from"fs";import L from"path";function _(e,t){let a=[],r=L.dirname(e);while(r.startsWith(t)||r===t){let n=L.join(r,"_layout.stx");if(j.existsSync(n))a.unshift(n);if(r===t)break;r=L.dirname(r)}return a}function F(e,t){let a=[];if(!x.existsSync(e))return a;let r=x.readdirSync(e,{withFileTypes:!0});for(let n of r){let o=u.join(e,n.name);if(n.isDirectory()){if(n.name.startsWith("."))continue;if(y.includes(n.name))continue;a.push(...F(o,t))}else if(n.isFile()){let i=u.extname(n.name);if(t.includes(i)){if(n.name.startsWith("_")&&n.name!=="_layout.stx")continue;if(n.name==="_layout.stx")continue;a.push(o)}}}return a}class Qn{routes;pagesDir;pagesDirs;config;constructor(e,t={}){this.config=t;let a=t.pagesDirs&&t.pagesDirs.length>0?t.pagesDirs:[t.pagesDir||"pages"];this.pagesDirs=a.map((s)=>u.resolve(e,s)),this.pagesDir=this.pagesDirs[0];let r=t.extensions||[".stx"],n=(s)=>{let l=u.resolve(e,s);try{return x.realpathSync(l)}catch{return l}},o=(t.exclude??[]).filter((s)=>typeof s==="string"&&s.trim()!=="").map(n),i=(s)=>{if(o.length===0)return!1;let l=n(s);return o.some((d)=>l===d||l.startsWith(`${d}${u.sep}`))},c=new Set;this.routes=[];for(let s of this.pagesDirs){let l=F(s,r).filter((h)=>!i(h)),d=new Map;for(let h of l){let g=R(h,s),m=t.pagesDirs?g.replace(/:[\w]+/g,":param"):g;if(t.pagesDirs&&d.has(m))throw Error(`Conflicting layer pages for ${g}: ${d.get(m)} and ${h}`);if(d.set(m,h),c.has(m))continue;c.add(m);let{regex:H,params:M}=ie(g,{page:!0}),C=t.layouts!==!1?_(h,s):[];this.routes.push({pattern:g,regex:H,params:M,filePath:h,isDynamic:M.length>0,layout:C.length>0?C[C.length-1]:void 0})}}if(this.routes.sort((s,l)=>{if(!s.isDynamic&&l.isDynamic)return-1;if(s.isDynamic&&!l.isDynamic)return 1;let d=s.pattern.split("/").length,h=l.pattern.split("/").length;if(d!==h)return h-d;return s.pattern.localeCompare(l.pattern)}),t.emit!==!1){let s=u.resolve(e,t.stateDir||process.env.STX_DIR?.trim()||".stx");vo(this.routes,s),wo(this.routes,s,this.pagesDir)}}match(e){let t=e===""?"/":e;for(let a of this.routes){let r=t.match(a.regex);if(r){let n={};return a.params.forEach((o,i)=>{n[o]=r[i+1]}),{route:a,params:n}}}return null}resolve(e,t){let a=this.routes.find((n)=>n.pattern===e||n.filePath.includes(e));if(!a)return"#not-found";let r=a.pattern;if(t)for(let[n,o]of Object.entries(t))r=r.replace(`:${n}`,encodeURIComponent(o));return r}addRoute(e){this.routes.push(e),this.routes.sort((t,a)=>{if(!t.isDynamic&&a.isDynamic)return-1;if(t.isDynamic&&!a.isDynamic)return 1;return t.pattern.localeCompare(a.pattern)})}getLayout(e){return e.layout??null}}function Qr(e,t){let a=[`${t}.stx`,"error.stx"];for(let r of a){let n=u.join(e,r);if(x.existsSync(n))return n}return null}function es(e,t){return e.map((a)=>{let r=u.relative(t,a.filePath),n=a.isDynamic?" (dynamic)":"";return`${a.pattern} \u2192 ${r}${n}`})}var f={},k="";function Pl(e){k=e.replace(/\/$/,"")}function Il(e,t,a={}){f[e]={path:t,name:e,params:a}}function Ol(e){for(let[t,a]of Object.entries(e))if(typeof a==="string")f[t]={path:a,name:t};else f[t]={...a,name:t}}function er(e,t={},a=!1){let r=f[e];if(!r)return console.warn(`Route [${e}] not defined.`),"#undefined-route";let n={...r.params,...t},o=r.path;o=o.replace(/:(\w+)/g,(c,s)=>{let l=n[s];if(l===void 0)return console.warn(`Missing parameter [${s}] for route [${e}].`),`:${s}`;return delete n[s],encodeURIComponent(String(l))});let i=Object.entries(n);if(i.length>0){let c=i.map(([s,l])=>`${encodeURIComponent(s)}=${encodeURIComponent(String(l))}`).join("&");o+=(o.includes("?")?"&":"?")+c}return a&&k?`${k}${o}`:o}function Nl(){for(let e of Object.keys(f))delete f[e];k=""}import B from"fs";import U from"path";function Dl(e,t={}){return{type:"redirect",path:e,options:{replace:t.replace??!1,external:t.external??!1,redirectCode:t.redirectCode??302}}}function Ml(e){return{type:"abort",error:typeof e==="string"?{statusCode:500,message:e}:e}}function Ll(e,t={}){return{handler:e,mode:t.mode??"universal"}}function O(e){let t={};if(!e)return t;let a=e.split(";");for(let r of a){let[n,...o]=r.split("=");if(n){let i=n.trim(),c=o.join("=").trim();if(i)t[i]=decodeURIComponent(c)}}return t}function S(e,t,a={}){let r=`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(a.expires){let n=typeof a.expires==="number"?new Date(Date.now()+a.expires*1000):a.expires;r+=`; Expires=${n.toUTCString()}`}if(a.path)r+=`; Path=${a.path}`;if(a.domain)r+=`; Domain=${a.domain}`;if(a.secure)r+="; Secure";if(a.httpOnly)r+="; HttpOnly";if(a.sameSite)r+=`; SameSite=${a.sameSite}`;return r}function xa(e,t){let a=e.headers.get("cookie")||"",r=O(a);return{get(n){return r[n]},set(n,o,i={}){r[n]=o,t.append("Set-Cookie",S(n,o,i))},delete(n){delete r[n],t.append("Set-Cookie",S(n,"",{expires:new Date(0),path:"/"}))},getAll(){return{...r}}}}function Sa(){return{get(e){if(typeof document>"u")return;return O(document.cookie)[e]},set(e,t,a={}){if(typeof document>"u")return;document.cookie=S(e,t,a)},delete(e){if(typeof document>"u")return;document.cookie=S(e,"",{expires:new Date(0),path:"/"})},getAll(){if(typeof document>"u")return{};return O(document.cookie)}}}function ka(){let e=typeof window<"u"&&typeof window.localStorage<"u";return{get(t){if(!e)return null;try{return window.localStorage.getItem(t)}catch{return null}},set(t,a){if(!e)return;try{window.localStorage.setItem(t,a)}catch{}},remove(t){if(!e)return;try{window.localStorage.removeItem(t)}catch{}},isAvailable(){return e}}}var v=new Map;function xo(e,t){v.set(e,t)}function _a(e){return v.get(e)}function jl(e){return v.has(e)}function wt(){v.clear()}function xt(){return Array.from(v.keys())}async function St(e,t="middleware"){let a=U.resolve(e,t);if(!B.existsSync(a))return;let r=B.readdirSync(a);for(let n of r){if(!n.endsWith(".ts")&&!n.endsWith(".js"))continue;if(n.includes(".test.")||n.includes(".spec."))continue;let o=n.replace(/\.(ts|js)$/,""),i=U.join(a,n);try{let s=(await import(i)).default;if(s&&typeof s.handler==="function")xo(o,s);else if(typeof s==="function")xo(o,{handler:s,mode:"universal"})}catch(c){console.warn(`Failed to load middleware '${o}' from ${i}:`,c)}}}function K(e){let t={};if(!e)return t;let a=new URLSearchParams(e);for(let[r,n]of a)t[r]=n;return t}function kt(e,t,a,r=""){return{path:e,params:t,query:K(r),fullPath:r?`${e}?${r}`:e,meta:a}}function _t(e,t,a,r){let n=r?.isServer??typeof window>"u",o=!n,i=new Headers;return{to:e,from:t,isClient:o,isServer:n,cookies:n&&a?xa(a,i):Sa(),storage:ka(),state:{},request:a,responseHeaders:i}}async function Ct(e,t){let a=Array.isArray(e)?e:[e],r=t.isServer;for(let n of a){let o=_a(n);if(!o)return console.error(`Route middleware '${n}' is not registered \u2014 failing the guard closed.`),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:`Route middleware '${n}' is not registered`}},state:t.state,responseHeaders:t.responseHeaders};if(o.mode==="server"&&!r)continue;try{let i=await o.handler(t);if(i){if(i.type==="redirect")return{passed:!1,redirect:i,state:t.state,responseHeaders:t.responseHeaders};if(i.type==="abort")return{passed:!1,abort:i,state:t.state,responseHeaders:t.responseHeaders}}}catch(i){return console.error(`Error in middleware '${n}':`,i),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:i instanceof Error?i.message:"Middleware error"}},state:t.state,responseHeaders:t.responseHeaders}}}return{passed:!0,state:t.state,responseHeaders:t.responseHeaders}}function ts(e){let a=e.replace(/\\/g,"/").split("/").filter(Boolean),r=a.lastIndexOf("layouts"),n=r>=0?a[r+1]:a.at(-1);if(!n)return"app";return n.replace(/\.stx$/i,"")||"app"}function Je(e){let t=e.match(/<meta\b[^>]*name=["']stx-layout["'][^>]*content=["']([^"']+)["'][^>]*>/i),a=e.match(/<meta\b[^>]*name=["']stx-layout-group["'][^>]*content=["']([^"']+)["'][^>]*>/i),r=e.match(/<!--\s*stx-layout:\s*([^ ]+)\s*-->/i),n=t?.[1]||r?.[1]||"";return{layout:n,group:a?.[1]||ts(n)}}var A,T;function W(e){let t=[],a="log(",r=0;while(r<e.length){let n=e.indexOf("log(",r);if(n===-1){t.push(e.slice(r));break}let o=n>0?e[n-1]:" ",i=/\bfunction\s+$/.test(e.slice(Math.max(0,n-16),n));if(/[\w$.]/.test(o)||i){t.push(e.slice(r,n+4)),r=n+4;continue}t.push(e.slice(r,n));let c=1,s=n+4;while(s<e.length&&c>0){let l=e[s];if(l==='"'||l==="'"||l==="`"){let d=l;s++;while(s<e.length&&e[s]!==d){if(e[s]==="\\")s++;s++}s++;continue}if(l==="(")c++;else if(l===")")c--;s++}t.push("0"),r=s}return t.join("")}function q(e,t=!1){try{return new Bun.Transpiler(t?{loader:"js",minify:{whitespace:!0,identifiers:!0}}:{loader:"js",minifyWhitespace:!0}).transformSync(e).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return e}}function X(){return`
2
+ import x from"fs";import u from"path";import p from"fs";import w from"path";var y=["components","layouts","partials","emails"];function P(e){return e.split(/[\\/]/).filter(Boolean).slice(0,-1).some((a)=>y.includes(a))}function b(e){return P(e.replace(/^\//,""))}function wo(e,t){let a=e.filter((i)=>!b(i.pattern)),r=["// Auto-generated by STX - do not edit"];if(a.length===0)r.push("// No page routes found \u2014 route paths stay typed as string.","export {}","");else{r.push("declare module '@stacksjs/stx' {"," interface KnownRoutes {");for(let i of a){let c=[];for(let l of i.params){let d=i.pattern.includes(`:${l}?`)?"?":"";c.push(`${l}${d}: string`)}let s=c.join("; ");r.push(` '${i.pattern}': { ${s} }`)}r.push(" }","}","","export {}","")}let n=r.join(`
3
+ `),o=w.join(t,"route-types.d.ts");try{if(p.existsSync(o)&&p.readFileSync(o,"utf8")===n)return;p.mkdirSync(t,{recursive:!0}),p.writeFileSync(o,n)}catch{}}function xo(e,t,a){let r=process.cwd(),n=w.relative(r,a),o=e.filter((c)=>!b(c.pattern)),i=["// Auto-generated by stx \u2014 do not edit",`// Source: ${n||"pages"}/`,"","export const routes = ["];for(let c of o){let s=w.relative(r,c.filePath).replace(/\\/g,"/"),l=JSON.stringify(c.params),d=c.layout?`, layout: '${w.relative(r,c.layout).replace(/\\/g,"/")}'`:"";i.push(` { pattern: '${c.pattern}', filePath: '${s}', isDynamic: ${c.isDynamic}, params: ${l}${d} },`)}i.push("] as const",""),i.push("export type RouteName = typeof routes[number]['pattern']",""),p.mkdirSync(t,{recursive:!0}),p.writeFileSync(w.join(t,"routes.ts"),i.join(`
4
+ `))}import I from"path";var N=Object.freeze(["ico","png","jpg","jpeg","gif","webp","avif","svg","bmp","tif","tiff","heic","css","js","mjs","cjs","map","wasm","webmanifest","json","xml","txt","rss","atom","woff","woff2","ttf","otf","eot","mp3","mp4","m4a","m4v","mov","webm","ogg","ogv","oga","wav","flac","avi","mkv","pdf","csv","doc","docx","xls","xlsx","ppt","pptx","rtf","odt","zip","gz","tgz","tar","rar","7z","bz2","xz","php","phtml","asp","aspx","jsp","cgi","env","ini","yml","yaml","toml","sql","bak","old","swp","log","conf","cfg","exe","dmg","pkg","apk","ipa","msi","iso","bin","dll"]),D=N.flatMap((e)=>e===e.toUpperCase()?[e]:[e,e.toUpperCase()]).join("|"),G=new RegExp(`\\.(?:${D})$`),E=`(?![^/]*\\.(?:${D})$)`;function vt(e){let t=e,a=t.search(/[?#]/);if(a!==-1)t=t.slice(0,a);let r=t.slice(t.lastIndexOf("/")+1);return r.length>0&&G.test(r)}function R(e,t){let r=I.relative(t,e).replace(/\.(stx|md)$/,"");if(r=r.split(I.sep).join("/"),r==="index")return"/";if(r.endsWith("/index"))r=r.slice(0,-6);return r=r.replace(/\[\[([^\]]+)\]\]/g,":$1?"),r=r.replace(/\[([^\]]+)\]/g,":$1"),r=r.replace(/:\.\.\.([^/]+)/g,":$1*"),`/${r}`}function ce(e,t={}){let a=t.page?E:"",r=[],n="",o=0;while(o<e.length){let i=e.slice(o),c=/^\/:([^/?*]+)\?/.exec(i);if(c){r.push(c[1]);let d=o+c[0].length===e.length;n+=`(?:/${d?a:""}([^/]+))?`,o+=c[0].length;continue}let s=/^:([^/?*]+)\*/.exec(i);if(s){r.push(s[1]),n+="(.+)",o+=s[0].length;continue}let l=/^:([^/?*]+)/.exec(i);if(l){r.push(l[1]);let d=o+l[0].length===e.length;n+=`${d?a:""}([^/]+)`,o+=l[0].length;continue}n+=e[o].replace(/[.+^${}()|[\]\\*?]/g,"\\$&"),o+=1}return{regex:new RegExp(`^${n}$`),params:r}}function Qn(e,t){let a=e===""?"/":e;for(let r of t){let n=a.match(r.regex);if(n){let o={};return r.params.forEach((i,c)=>{o[i]=n[c+1]}),{route:r,params:o}}}return null}function Qr(e,t={}){let a=e.replace(/\[\[([^\]]+)\]\]/g,":$1?").replace(/\[([^\]]+)\]/g,":$1").replace(/:\.\.\.([^/]+)/g,":$1*");return ce(a,t)}import j from"fs";import L from"path";function _(e,t){let a=[],r=L.dirname(e);while(r.startsWith(t)||r===t){let n=L.join(r,"_layout.stx");if(j.existsSync(n))a.unshift(n);if(r===t)break;r=L.dirname(r)}return a}function F(e,t){let a=[];if(!x.existsSync(e))return a;let r=x.readdirSync(e,{withFileTypes:!0});for(let n of r){let o=u.join(e,n.name);if(n.isDirectory()){if(n.name.startsWith("."))continue;if(y.includes(n.name))continue;a.push(...F(o,t))}else if(n.isFile()){let i=u.extname(n.name);if(t.includes(i)){if(n.name.startsWith("_")&&n.name!=="_layout.stx")continue;if(n.name==="_layout.stx")continue;a.push(o)}}}return a}class er{routes;pagesDir;pagesDirs;config;constructor(e,t={}){this.config=t;let a=t.pagesDirs&&t.pagesDirs.length>0?t.pagesDirs:[t.pagesDir||"pages"];this.pagesDirs=a.map((s)=>u.resolve(e,s)),this.pagesDir=this.pagesDirs[0];let r=t.extensions||[".stx"],n=(s)=>{let l=u.resolve(e,s);try{return x.realpathSync(l)}catch{return l}},o=(t.exclude??[]).filter((s)=>typeof s==="string"&&s.trim()!=="").map(n),i=(s)=>{if(o.length===0)return!1;let l=n(s);return o.some((d)=>l===d||l.startsWith(`${d}${u.sep}`))},c=new Set;this.routes=[];for(let s of this.pagesDirs){let l=F(s,r).filter((h)=>!i(h)),d=new Map;for(let h of l){let g=R(h,s),m=t.pagesDirs?g.replace(/:[\w]+/g,":param"):g;if(t.pagesDirs&&d.has(m))throw Error(`Conflicting layer pages for ${g}: ${d.get(m)} and ${h}`);if(d.set(m,h),c.has(m))continue;c.add(m);let{regex:H,params:M}=ce(g,{page:!0}),C=t.layouts!==!1?_(h,s):[];this.routes.push({pattern:g,regex:H,params:M,filePath:h,isDynamic:M.length>0,layout:C.length>0?C[C.length-1]:void 0})}}if(this.routes.sort((s,l)=>{if(!s.isDynamic&&l.isDynamic)return-1;if(s.isDynamic&&!l.isDynamic)return 1;let d=s.pattern.split("/").length,h=l.pattern.split("/").length;if(d!==h)return h-d;return s.pattern.localeCompare(l.pattern)}),t.emit!==!1){let s=u.resolve(e,t.stateDir||process.env.STX_DIR?.trim()||".stx");wo(this.routes,s),xo(this.routes,s,this.pagesDir)}}match(e){let t=e===""?"/":e;for(let a of this.routes){let r=t.match(a.regex);if(r){let n={};return a.params.forEach((o,i)=>{n[o]=r[i+1]}),{route:a,params:n}}}return null}resolve(e,t){let a=this.routes.find((n)=>n.pattern===e||n.filePath.includes(e));if(!a)return"#not-found";let r=a.pattern;if(t)for(let[n,o]of Object.entries(t))r=r.replace(`:${n}`,encodeURIComponent(o));return r}addRoute(e){this.routes.push(e),this.routes.sort((t,a)=>{if(!t.isDynamic&&a.isDynamic)return-1;if(t.isDynamic&&!a.isDynamic)return 1;return t.pattern.localeCompare(a.pattern)})}getLayout(e){return e.layout??null}}function es(e,t){let a=[`${t}.stx`,"error.stx"];for(let r of a){let n=u.join(e,r);if(x.existsSync(n))return n}return null}function ts(e,t){return e.map((a)=>{let r=u.relative(t,a.filePath),n=a.isDynamic?" (dynamic)":"";return`${a.pattern} \u2192 ${r}${n}`})}var f={},k="";function Il(e){k=e.replace(/\/$/,"")}function Ol(e,t,a={}){f[e]={path:t,name:e,params:a}}function Nl(e){for(let[t,a]of Object.entries(e))if(typeof a==="string")f[t]={path:a,name:t};else f[t]={...a,name:t}}function tr(e,t={},a=!1){let r=f[e];if(!r)return console.warn(`Route [${e}] not defined.`),"#undefined-route";let n={...r.params,...t},o=r.path;o=o.replace(/:(\w+)/g,(c,s)=>{let l=n[s];if(l===void 0)return console.warn(`Missing parameter [${s}] for route [${e}].`),`:${s}`;return delete n[s],encodeURIComponent(String(l))});let i=Object.entries(n);if(i.length>0){let c=i.map(([s,l])=>`${encodeURIComponent(s)}=${encodeURIComponent(String(l))}`).join("&");o+=(o.includes("?")?"&":"?")+c}return a&&k?`${k}${o}`:o}function Dl(){for(let e of Object.keys(f))delete f[e];k=""}import B from"fs";import U from"path";function Ml(e,t={}){return{type:"redirect",path:e,options:{replace:t.replace??!1,external:t.external??!1,redirectCode:t.redirectCode??302}}}function Ll(e){return{type:"abort",error:typeof e==="string"?{statusCode:500,message:e}:e}}function jl(e,t={}){return{handler:e,mode:t.mode??"universal"}}function O(e){let t={};if(!e)return t;let a=e.split(";");for(let r of a){let[n,...o]=r.split("=");if(n){let i=n.trim(),c=o.join("=").trim();if(i)t[i]=decodeURIComponent(c)}}return t}function S(e,t,a={}){let r=`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(a.expires){let n=typeof a.expires==="number"?new Date(Date.now()+a.expires*1000):a.expires;r+=`; Expires=${n.toUTCString()}`}if(a.path)r+=`; Path=${a.path}`;if(a.domain)r+=`; Domain=${a.domain}`;if(a.secure)r+="; Secure";if(a.httpOnly)r+="; HttpOnly";if(a.sameSite)r+=`; SameSite=${a.sameSite}`;return r}function Sa(e,t){let a=e.headers.get("cookie")||"",r=O(a);return{get(n){return r[n]},set(n,o,i={}){r[n]=o,t.append("Set-Cookie",S(n,o,i))},delete(n){delete r[n],t.append("Set-Cookie",S(n,"",{expires:new Date(0),path:"/"}))},getAll(){return{...r}}}}function ka(){return{get(e){if(typeof document>"u")return;return O(document.cookie)[e]},set(e,t,a={}){if(typeof document>"u")return;document.cookie=S(e,t,a)},delete(e){if(typeof document>"u")return;document.cookie=S(e,"",{expires:new Date(0),path:"/"})},getAll(){if(typeof document>"u")return{};return O(document.cookie)}}}function _a(){let e=typeof window<"u"&&typeof window.localStorage<"u";return{get(t){if(!e)return null;try{return window.localStorage.getItem(t)}catch{return null}},set(t,a){if(!e)return;try{window.localStorage.setItem(t,a)}catch{}},remove(t){if(!e)return;try{window.localStorage.removeItem(t)}catch{}},isAvailable(){return e}}}var v=new Map;function So(e,t){v.set(e,t)}function Ca(e){return v.get(e)}function Bl(e){return v.has(e)}function wt(){v.clear()}function xt(){return Array.from(v.keys())}async function St(e,t="middleware"){let a=U.resolve(e,t);if(!B.existsSync(a))return;let r=B.readdirSync(a);for(let n of r){if(!n.endsWith(".ts")&&!n.endsWith(".js"))continue;if(n.includes(".test.")||n.includes(".spec."))continue;let o=n.replace(/\.(ts|js)$/,""),i=U.join(a,n);try{let s=(await import(i)).default;if(s&&typeof s.handler==="function")So(o,s);else if(typeof s==="function")So(o,{handler:s,mode:"universal"})}catch(c){console.warn(`Failed to load middleware '${o}' from ${i}:`,c)}}}function K(e){let t={};if(!e)return t;let a=new URLSearchParams(e);for(let[r,n]of a)t[r]=n;return t}function kt(e,t,a,r=""){return{path:e,params:t,query:K(r),fullPath:r?`${e}?${r}`:e,meta:a}}function _t(e,t,a,r){let n=r?.isServer??typeof window>"u",o=!n,i=new Headers;return{to:e,from:t,isClient:o,isServer:n,cookies:n&&a?Sa(a,i):ka(),storage:_a(),state:{},request:a,responseHeaders:i}}async function Ct(e,t){let a=Array.isArray(e)?e:[e],r=t.isServer;for(let n of a){let o=Ca(n);if(!o)return console.error(`Route middleware '${n}' is not registered \u2014 failing the guard closed.`),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:`Route middleware '${n}' is not registered`}},state:t.state,responseHeaders:t.responseHeaders};if(o.mode==="server"&&!r)continue;try{let i=await o.handler(t);if(i){if(i.type==="redirect")return{passed:!1,redirect:i,state:t.state,responseHeaders:t.responseHeaders};if(i.type==="abort")return{passed:!1,abort:i,state:t.state,responseHeaders:t.responseHeaders}}}catch(i){return console.error(`Error in middleware '${n}':`,i),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:i instanceof Error?i.message:"Middleware error"}},state:t.state,responseHeaders:t.responseHeaders}}}return{passed:!0,state:t.state,responseHeaders:t.responseHeaders}}function ns(e){let a=e.replace(/\\/g,"/").split("/").filter(Boolean),r=a.lastIndexOf("layouts"),n=r>=0?a[r+1]:a.at(-1);if(!n)return"app";return n.replace(/\.stx$/i,"")||"app"}function Je(e){let t=e.match(/<meta\b[^>]*name=["']stx-layout["'][^>]*content=["']([^"']+)["'][^>]*>/i),a=e.match(/<meta\b[^>]*name=["']stx-layout-group["'][^>]*content=["']([^"']+)["'][^>]*>/i),r=e.match(/<!--\s*stx-layout:\s*([^ ]+)\s*-->/i),n=t?.[1]||r?.[1]||"";return{layout:n,group:a?.[1]||ns(n)}}var A,T;function W(e){let t=[],a="log(",r=0;while(r<e.length){let n=e.indexOf("log(",r);if(n===-1){t.push(e.slice(r));break}let o=n>0?e[n-1]:" ",i=/\bfunction\s+$/.test(e.slice(Math.max(0,n-16),n));if(/[\w$.]/.test(o)||i){t.push(e.slice(r,n+4)),r=n+4;continue}t.push(e.slice(r,n));let c=1,s=n+4;while(s<e.length&&c>0){let l=e[s];if(l==='"'||l==="'"||l==="`"){let d=l;s++;while(s<e.length&&e[s]!==d){if(e[s]==="\\")s++;s++}s++;continue}if(l==="(")c++;else if(l===")")c--;s++}t.push("0"),r=s}return t.join("")}function q(e,t=!1){try{return new Bun.Transpiler(t?{loader:"js",minify:{whitespace:!0,identifiers:!0}}:{loader:"js",minifyWhitespace:!0}).transformSync(e).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return e}}function X(){return`
5
5
  ;(function(){
6
6
  'use strict';
7
7
  var ROUTER_REV=7;
@@ -3939,4 +3939,4 @@ else {
3939
3939
 
3940
3940
  if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',init);else init();
3941
3941
  })();
3942
- `}function Ye(){if(A)return A;return A=q(W(X()),!0),A}function Bl(){if(T)return T;return T=q(X()),T}export{vo,wo,vt,ie,Zn,Zr,Qn,Qr,es,Pl,Il,Ol,er,Nl,Dl,Ml,Ll,xa,Sa,ka,xo,_a,jl,wt,xt,St,kt,_t,Ct,ts,Je,Ye,Bl};
3942
+ `}function Ye(){if(A)return A;return A=q(W(X()),!0),A}function Fl(){if(T)return T;return T=q(X()),T}export{wo,xo,vt,ce,Qn,Qr,er,es,ts,Il,Ol,Nl,tr,Dl,Ml,Ll,jl,Sa,ka,_a,So,Ca,Bl,wt,xt,St,kt,_t,Ct,ns,Je,Ye,Fl};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{p,u}from"./chunk-bsajk82t.js";import{K,F,d}from"./chunk-f9zyf9n6.js";function z(t,o){let i=1,r=o,e="<template",n="</template";while(r<t.length&&i>0){let s=t.indexOf("<",r);if(s===-1)break;if(r=s,t.startsWith(e,r)&&(r+e.length>=t.length||/[\s>\/]/.test(t[r+e.length]))){i++,r+=e.length;continue}if(t.startsWith(n,r)){let a=t.indexOf(">",r+n.length);if(a!==-1){if(i--,i===0)return a+1;r=a+1;continue}}r++}return i===0?r:-1}var N=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function k(t,o){let i=null;for(let r=o;r<t.length;r++){let e=t[r];if(i){if(e==="\\"){r++;continue}if(e===i)i=null;continue}if(e==='"'||e==="'"){i=e;continue}if(e===">")return r+1}return-1}function B(t,o,i){let r=o.toLowerCase(),e=1,n=i;while(n<t.length){let s=t.indexOf("<",n);if(s===-1)return-1;if(t.startsWith("<!--",s)){let g=t.indexOf("-->",s+4);n=g===-1?t.length:g+3;continue}let a=k(t,s+1);if(a===-1)return-1;let f=t.slice(s,a),c=f.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(c&&c[2].toLowerCase()===r){if(c[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(f))e++}n=a}return-1}function Z(t){let o=[],i=[],r=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let c=f[2].toLowerCase();if(f[1]==="/"){let l=i.lastIndexOf(c);if(l!==-1)i.splice(l);e=s;continue}let g=/\/\s*>$/.test(a),m=i.length===0?a.match(r):null;if(m){let l=m[1]||m[2],h=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),S=g||N.has(c)?-1:B(t,c,s);if(S===-1)o.push({start:n,end:s,slotName:l,element:h}),e=s;else o.push({start:n,end:S,slotName:l,element:h+t.slice(s,S)}),e=S;continue}if(!g&&!N.has(c)){if(i.push(c),c==="script"||c==="style"){let l=t.toLowerCase().indexOf(`</${c}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function L(t){let o=[],i=[],r=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let c=f[1]==="/",g=f[2].toLowerCase();if(c){let l=i.lastIndexOf(g);if(l!==-1)i.splice(l);e=s;continue}if(g==="template"&&i.length===0){let l=a.match(r);if(l){let h=z(t,s);if(h!==-1){let S=l[1]||l[2]||l[3];o.push({start:n,end:h,slotName:S,content:t.slice(s,h-11).trim(),propsBinding:l[4]||void 0}),e=h;continue}}}if(!/\/\s*>$/.test(a)&&!N.has(g)){if(i.push(g),g==="script"||g==="style"){let l=t.toLowerCase().indexOf(`</${g}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function jc(t){let o={default:"",named:new Map},i=t,r=L(t);for(let n of r)o.named.set(n.slotName,{name:n.slotName,content:n.content,propsBinding:n.propsBinding});r.sort((n,s)=>s.start-n.start);for(let n of r)i=i.slice(0,n.start)+i.slice(n.end);let e=Z(i);for(let n of e){let s=o.named.get(n.slotName);if(s)s.content+=n.element;else o.named.set(n.slotName,{name:n.slotName,content:n.element})}for(let n=e.length-1;n>=0;n--){let s=e[n];i=i.slice(0,s.start)+i.slice(s.end)}return o.default=i.trim(),o}function Yu(t){let o=t.match(/name\s*=\s*["']([^"']+)["']/),i=o?o[1]:"",r={},e=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,n;while((n=e.exec(t))!==null)r[n[1]]=n[2];let s=t.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),a=s?s[1].trim():"";return{name:i,props:r,defaultContent:a}}async function Bc(t,o,i,r){if(!t)return i;let e=t.content;if(t.propsBinding&&Object.keys(o).length>0){let n=t.propsBinding.trim(),s={...r},a=new Set,f=new Set;if(n.startsWith("{")&&n.endsWith("}")){let c=n.slice(1,-1).split(",").map((g)=>g.trim()).filter(Boolean);for(let g of c){let[m,l]=g.split(":").map((S)=>S.trim()),h=l||m;if(s[h]=o[m],o[m]!==void 0)f.add(h);else a.add(h)}}else if(s[n]=o,Object.values(o).some((c)=>c===void 0))a.add(n);else f.add(n);e=j(e,s,a,f)}return e}function j(t,o,i,r){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(e,n)=>{try{let s=n.trim();if(F(s,i))return e;if(Array.isArray(o.__stx_preserved_client_expressions)&&o.__stx_preserved_client_expressions.includes(s)&&!F(s,r))return e;let a=_(s,o);if(a===void 0)return e;return d(String(a??""))}catch{return`{{ ${n} }}`}})}function _(t,o){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(t)){let r=t.split("."),e=o;for(let n of r)if(e&&typeof e==="object"&&n in e)e=e[n];else return;return e}let i=t.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(i){let[,r,e,n]=i,s=o[r],a=parseInt(n,10);if(typeof s==="number")switch(e){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":return s/a}}try{if(!p(t))return;return u(t,Object.keys(o))(...Object.values(o))}catch{return}}async function Fc(t,o,i,r){let e=t;e=await I(e,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(a,f,c,g)=>{let m=o.named.get(f),l=g?.trim()||"",h=c||"",S={},E=[],C=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,b;while((b=C.exec(h))!==null){let w=b[1],x=b[2];S[w]=_(x,i),E.push([w,x])}if(r!==void 0&&m?.propsBinding&&Object.values(S).some((w)=>w===void 0)){let w=m.propsBinding.trim(),x=K(`${w} in []`),y="__stx_slot_props";while(x.includes(y))y+="_";let M=E.map(([A,P])=>{let O=S[A],R;try{R=O===void 0?void 0:JSON.stringify(O)}catch{}return`${JSON.stringify(A)}:(${R??P})`}).join(","),v=d(JSON.stringify({binding:w,names:x,owner:r}));return`<template :for="${d(`${y} in [{${M}}]`)}" data-stx-slot-binding="${encodeURIComponent(w)}" data-stx-slot-scope="${v}">${m.content}</template>`}return await Bc(m,S,l,i)});let s=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return e=e.replace(s,(a,f,c)=>{if(/\bname\s*=/.test(f||""))return a;let g=c?.trim()||"";return o.default||g}),e}async function I(t,o,i){let r=[],e=[];t.replace(o,(a,...f)=>{let c=f[f.length-2];return e.push({match:a,index:c}),r.push(i(a,...f.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:f,index:c}=e[a];s=s.slice(0,c)+n[a]+s.slice(c+f.length)}return s}function Zu(t){let o=jc(t);return{defaultSlot:o.default,namedSlots:o.named}}async function Qu(t,o,i,r,e){return await Fc(t,{default:o,named:i},r,e)}
3
+ export{jc,Yu,Bc,Fc,Zu,Qu};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- function C(){let{NODE_ENV:n}=process.env;return n==="production"}function H(){let{STX_DEBUG:n}=process.env;return!C()||n==="true"}function bn(){let{NODE_ENV:n}=process.env;return n==="test"}function qo(n){return n==="compile"||C()}function yr(n){if(!n)return n;try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(n).trim()}catch{return n}}
3
- export{C,H,bn,qo,yr};
2
+ function C(){let{NODE_ENV:n}=process.env;return n==="production"}function V(){let{STX_DEBUG:n}=process.env;return!C()||n==="true"}function bn(){let{NODE_ENV:n}=process.env;return n==="test"}function Go(n){return n==="compile"||C()}function br(n){if(!n)return n;try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(n).trim()}catch{return n}}
3
+ export{C,V,bn,Go,br};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{t,a,Dt,Mt,Lt,Be,nt,P,xs,mr,Fe}from"./chunk-2dp7hyv7.js";var O=/(?<![\w$@])@meta\s*\(/g,I=/(?<![\w$@])@metaTag\s*\(/g,C=/(?<![\w$@])@structuredData\s*\(/g,k=/(?<![\w$@])@seo\s*\(/g;function _(e,r){return(n)=>P(e,n,"the call has no closing parenthesis",r,t.INVALID_DIRECTIVE_SYNTAX)}function N(e){return"property"in e?`<meta property="${l(e.property)}" content="${l(e.content)}">`:`<meta name="${l(e.name)}" content="${l(e.content)}">`}function mo(e,r,n,g){if(!e.includes("@meta"))return e;let i=Dt(e,O,(s,c)=>{let o=mr(Mt(s),r);if(o.kind==="tag")return N(o.tag);if(o.kind==="empty")return"";return P("Meta",c,o.message,n,o.code)},_("Meta",n));return i=Dt(i,I,(s,c)=>{let o=Lt(s,r);if(!o.ok)return P("MetaTag",c,o.message,n,o.code);if(o.value===void 0||o.value===null)return"";if(!nt(o.value))return P("MetaTag",c,`expected an object such as { name, content }, got ${Be(o.value)}`,n,t.TYPE_ERROR);let u=o.value;if(!u.name&&!u.property&&!u.httpEquiv)return P("MetaTag",c,"the tag needs a name, property or httpEquiv",n,t.INVALID_DIRECTIVE_SYNTAX);if(u.content===void 0||u.content===null||u.content===""||u.content===!1)return"";let p="<meta";if(u.name)p+=` name="${l(u.name)}"`;if(u.property)p+=` property="${l(u.property)}"`;if(u.httpEquiv)p+=` http-equiv="${l(u.httpEquiv)}"`;return p+=` content="${l(u.content)}">`,p},_("MetaTag",n)),i}function b(e){let r=(n)=>n["@context"]?{...n}:{...n,"@context":"https://schema.org"};if(nt(e))return r(e);if(Array.isArray(e)&&e.length>0&&e.every(nt))return e.map(r);return null}function E(e){return`<script type="application/ld+json">${JSON.stringify(e).replace(/<\//g,"<\\/")}</script>`}function ho(e,r,n){if(!e.includes("@structuredData"))return e;return Dt(e,C,(g,i)=>{let s=Lt(g,r);if(!s.ok)return P("StructuredData",i,s.message,n,s.code);if(s.value===void 0||s.value===null)return"";let c=b(s.value);if(!c)return P("StructuredData",i,`expected an object or an array of objects, got ${Be(s.value)}`,n,t.TYPE_ERROR);try{return E(c)}catch(o){let u=o instanceof Error?o.message:String(o);return P("StructuredData",i,`the data cannot be written as JSON: ${u}`,n,t.EVALUATION_ERROR)}},_("StructuredData",n))}var j=new Set(["title","description","keywords","robots","canonical","openGraph","twitter","structuredData"]),A={image:"openGraph.image",url:"canonical or openGraph.url",type:"openGraph.type",siteName:"openGraph.siteName",locale:"openGraph.locale",og:"openGraph",author:"@meta('author', ...)"};function yo(e,r,n,g){if(!e.includes("@seo"))return e;return Dt(e,k,(i,s)=>{if(!i.trim())return P("SEO",s,"expected an object: @seo({ title, description }) or @seo(seoVariable)",n,t.INVALID_DIRECTIVE_SYNTAX);let c=Lt(i,r);if(!c.ok)return P("SEO",s,c.message,n,c.code);if(c.value===void 0||c.value===null)return"";if(!nt(c.value))return P("SEO",s,`expected an object such as { title, description }, got ${Be(c.value)}`,n,t.TYPE_ERROR);try{return L(c.value,s,n)}catch(o){let u=o instanceof Error?o.message:String(o);return P("SEO",s,`Error processing @seo directive: ${u}`,n,t.EVALUATION_ERROR)}},_("SEO",n))}function R(e,r,n,g){let i=e[r];if(i===void 0||i===null||i===!1)return;if(nt(i))return i;xs(n,`${r} must be an object, got ${Be(i)}; its tags were left out`,g);return}function L(e,r,n){let g=Object.keys(e).filter((o)=>!j.has(o));if(g.length>0){let o=g.map((u)=>A[u]?`${u} (use ${A[u]})`:u).join(", ");xs(r,`@seo does not read ${o}; ${g.length===1?"it was":"they were"} ignored`,n)}let i="";if(e.title)i+=`<title>${l(e.title)}</title>
2
+ import{t,a,Dt,Mt,Lt,Be,nt,P,Ss,hr,Fe}from"./chunk-bsajk82t.js";var O=/(?<![\w$@])@meta\s*\(/g,I=/(?<![\w$@])@metaTag\s*\(/g,C=/(?<![\w$@])@structuredData\s*\(/g,k=/(?<![\w$@])@seo\s*\(/g;function _(e,r){return(n)=>P(e,n,"the call has no closing parenthesis",r,t.INVALID_DIRECTIVE_SYNTAX)}function N(e){return"property"in e?`<meta property="${l(e.property)}" content="${l(e.content)}">`:`<meta name="${l(e.name)}" content="${l(e.content)}">`}function ho(e,r,n,g){if(!e.includes("@meta"))return e;let i=Dt(e,O,(s,c)=>{let o=hr(Mt(s),r);if(o.kind==="tag")return N(o.tag);if(o.kind==="empty")return"";return P("Meta",c,o.message,n,o.code)},_("Meta",n));return i=Dt(i,I,(s,c)=>{let o=Lt(s,r);if(!o.ok)return P("MetaTag",c,o.message,n,o.code);if(o.value===void 0||o.value===null)return"";if(!nt(o.value))return P("MetaTag",c,`expected an object such as { name, content }, got ${Be(o.value)}`,n,t.TYPE_ERROR);let u=o.value;if(!u.name&&!u.property&&!u.httpEquiv)return P("MetaTag",c,"the tag needs a name, property or httpEquiv",n,t.INVALID_DIRECTIVE_SYNTAX);if(u.content===void 0||u.content===null||u.content===""||u.content===!1)return"";let p="<meta";if(u.name)p+=` name="${l(u.name)}"`;if(u.property)p+=` property="${l(u.property)}"`;if(u.httpEquiv)p+=` http-equiv="${l(u.httpEquiv)}"`;return p+=` content="${l(u.content)}">`,p},_("MetaTag",n)),i}function b(e){let r=(n)=>n["@context"]?{...n}:{...n,"@context":"https://schema.org"};if(nt(e))return r(e);if(Array.isArray(e)&&e.length>0&&e.every(nt))return e.map(r);return null}function E(e){return`<script type="application/ld+json">${JSON.stringify(e).replace(/<\//g,"<\\/")}</script>`}function yo(e,r,n){if(!e.includes("@structuredData"))return e;return Dt(e,C,(g,i)=>{let s=Lt(g,r);if(!s.ok)return P("StructuredData",i,s.message,n,s.code);if(s.value===void 0||s.value===null)return"";let c=b(s.value);if(!c)return P("StructuredData",i,`expected an object or an array of objects, got ${Be(s.value)}`,n,t.TYPE_ERROR);try{return E(c)}catch(o){let u=o instanceof Error?o.message:String(o);return P("StructuredData",i,`the data cannot be written as JSON: ${u}`,n,t.EVALUATION_ERROR)}},_("StructuredData",n))}var j=new Set(["title","description","keywords","robots","canonical","openGraph","twitter","structuredData"]),A={image:"openGraph.image",url:"canonical or openGraph.url",type:"openGraph.type",siteName:"openGraph.siteName",locale:"openGraph.locale",og:"openGraph",author:"@meta('author', ...)"};function bo(e,r,n,g){if(!e.includes("@seo"))return e;return Dt(e,k,(i,s)=>{if(!i.trim())return P("SEO",s,"expected an object: @seo({ title, description }) or @seo(seoVariable)",n,t.INVALID_DIRECTIVE_SYNTAX);let c=Lt(i,r);if(!c.ok)return P("SEO",s,c.message,n,c.code);if(c.value===void 0||c.value===null)return"";if(!nt(c.value))return P("SEO",s,`expected an object such as { title, description }, got ${Be(c.value)}`,n,t.TYPE_ERROR);try{return L(c.value,s,n)}catch(o){let u=o instanceof Error?o.message:String(o);return P("SEO",s,`Error processing @seo directive: ${u}`,n,t.EVALUATION_ERROR)}},_("SEO",n))}function R(e,r,n,g){let i=e[r];if(i===void 0||i===null||i===!1)return;if(nt(i))return i;Ss(n,`${r} must be an object, got ${Be(i)}; its tags were left out`,g);return}function L(e,r,n){let g=Object.keys(e).filter((o)=>!j.has(o));if(g.length>0){let o=g.map((u)=>A[u]?`${u} (use ${A[u]})`:u).join(", ");Ss(r,`@seo does not read ${o}; ${g.length===1?"it was":"they were"} ignored`,n)}let i="";if(e.title)i+=`<title>${l(e.title)}</title>
3
3
  `,i+=`<meta name="title" content="${l(e.title)}">
4
4
  `;if(e.description)i+=`<meta name="description" content="${l(e.description)}">
5
5
  `;if(e.keywords){let o=Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords;i+=`<meta name="keywords" content="${l(o)}">
@@ -25,7 +25,7 @@ import{t,a,Dt,Mt,Lt,Be,nt,P,xs,mr,Fe}from"./chunk-2dp7hyv7.js";var O=/(?<![\w$@]
25
25
  `}if(c.site)i+=`<meta name="twitter:site" content="${l(c.site)}">
26
26
  `;if(c.creator)i+=`<meta name="twitter:creator" content="${l(c.creator)}">
27
27
  `}if(e.structuredData!==void 0&&e.structuredData!==null){let o=b(e.structuredData);if(o)i+=`${E(o)}
28
- `;else xs(r,`structuredData must be an object or an array of objects, got ${Be(e.structuredData)}; it was left out`,n)}return i.trim()}function bo(e,r,n){if(n.seo?.enabled===!1)return e;if(e.includes("<!-- stx SEO Tags -->")||r.__stx_seo_staged===!0||n.skipDefaultSeoTags===!0)return e;let g=r.__stx_runtime_head;if(!!(g?.title||g?.meta?.some((S)=>S.property==="og:title"||S.name==="og:title"||S.name==="twitter:title"||S.name==="description")))return e;if(/<meta\s+(?:[^>]*\s)?property=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']twitter:title["']/i.test(e))return e;if(!e.includes("<head>")&&!e.includes("<head "))return e;let s=e.includes("<title>")||e.includes("</title>"),c=q(e),o=M(c),u=G(c),p="";if(r.title)p=r.title;else if(r.meta&&r.meta.title)p=r.meta.title;else if(o)p=o;else if(n.seo?.defaultConfig?.title)p=n.seo.defaultConfig.title;else p=n.defaultTitle||"stx Project";let m="";if(r.description)m=r.description;else if(r.meta&&r.meta.description)m=r.meta.description;else if(u)m=u;else if(n.seo?.defaultConfig?.description)m=n.seo.defaultConfig.description;else m=n.defaultDescription||"A website built with stx templating engine";let d="";if(r.image)d=r.image;else if(r.meta&&r.meta.image)d=r.meta.image;else if(r.openGraph&&r.openGraph.image)d=r.openGraph.image;else if(n.seo?.defaultImage)d=n.seo.defaultImage;else if(n.defaultImage)d=n.defaultImage;let f=s?"":`
28
+ `;else Ss(r,`structuredData must be an object or an array of objects, got ${Be(e.structuredData)}; it was left out`,n)}return i.trim()}function vo(e,r,n){if(n.seo?.enabled===!1)return e;if(e.includes("<!-- stx SEO Tags -->")||r.__stx_seo_staged===!0||n.skipDefaultSeoTags===!0)return e;let g=r.__stx_runtime_head;if(!!(g?.title||g?.meta?.some((S)=>S.property==="og:title"||S.name==="og:title"||S.name==="twitter:title"||S.name==="description")))return e;if(/<meta\s+(?:[^>]*\s)?property=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']twitter:title["']/i.test(e))return e;if(!e.includes("<head>")&&!e.includes("<head "))return e;let s=e.includes("<title>")||e.includes("</title>"),c=q(e),o=M(c),u=G(c),p="";if(r.title)p=r.title;else if(r.meta&&r.meta.title)p=r.meta.title;else if(o)p=o;else if(n.seo?.defaultConfig?.title)p=n.seo.defaultConfig.title;else p=n.defaultTitle||"stx Project";let m="";if(r.description)m=r.description;else if(r.meta&&r.meta.description)m=r.meta.description;else if(u)m=u;else if(n.seo?.defaultConfig?.description)m=n.seo.defaultConfig.description;else m=n.defaultDescription||"A website built with stx templating engine";let d="";if(r.image)d=r.image;else if(r.meta&&r.meta.image)d=r.meta.image;else if(r.openGraph&&r.openGraph.image)d=r.openGraph.image;else if(n.seo?.defaultImage)d=n.seo.defaultImage;else if(n.defaultImage)d=n.defaultImage;let f=s?"":`
29
29
  <meta name="title" content="${l(p)}">`,D=V(c)?"":`
30
30
  <meta name="description" content="${l(m)}">`,y=`
31
31
  <!-- stx SEO Tags -->${f}${D}
@@ -43,7 +43,7 @@ import{t,a,Dt,Mt,Lt,Be,nt,P,xs,mr,Fe}from"./chunk-2dp7hyv7.js";var O=/(?<![\w$@]
43
43
  ${y}
44
44
  `),h;return h.replace(/<head[^>]*>/,`$&
45
45
  ${y}
46
- `)}function q(e){let r=e.search(/<\/head\s*>/i);return r===-1?e:e.slice(0,r)}function v(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#0*39;|&apos;/g,"'").replace(/&amp;/g,"&")}function M(e){let r=e.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return r?v(r[1].trim()):""}function x(e){return(e.match(/<meta\s[^>]*>/gi)||[]).filter((r)=>/\sname\s*=\s*["']description["']/i.test(r))}function V(e){return x(e).length>0}function G(e){for(let r of x(e)){let n=r.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),g=(n?.[1]??n?.[2]??"").trim();if(g)return v(g)}return""}function l(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var Xr={name:"meta",rawParams:!0,handler:(e,r,n,g)=>{let i=mr(r,n??{});if(i.kind==="error")return P("Meta",`@meta(${r.join(", ")})`,i.message,g,i.code);if(i.kind==="empty")return"";if(n)n.__stx_runtime_head=Fe(n.__stx_runtime_head??{},{meta:[i.tag]});return""},hasEndTag:!1},Jr={name:"structuredData",handler:(e,r,n,g)=>{if(e.trim()==="")return a("StructuredData","structuredData directive requires JSON-LD content",t.INVALID_DIRECTIVE_SYNTAX);try{let i=JSON.parse(e);if(!i["@context"])i["@context"]="https://schema.org";if(!i["@type"])return a("StructuredData","structuredData requires @type property",t.INVALID_DIRECTIVE_SYNTAX);return E(i)}catch(i){let s=i instanceof Error?i.message:String(i);return a("StructuredData",s,t.EVALUATION_ERROR)}},hasEndTag:!0};function kp(){return[Xr,Jr]}function _p(e,r){let{baseUrl:n,defaultChangefreq:g="weekly",defaultPriority:i=0.5,includeLastmod:s=!0}=r,c=n.replace(/\/$/,""),o=(m)=>m.startsWith("http")?m:`${c}${m.startsWith("/")?"":"/"}${m}`,u=e.map((m)=>{let d=o(m.loc),f=m.lastmod||(s?new Date().toISOString().split("T")[0]:void 0),D=m.changefreq||g,y=m.priority??i,h=` <url>
46
+ `)}function q(e){let r=e.search(/<\/head\s*>/i);return r===-1?e:e.slice(0,r)}function v(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#0*39;|&apos;/g,"'").replace(/&amp;/g,"&")}function M(e){let r=e.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return r?v(r[1].trim()):""}function x(e){return(e.match(/<meta\s[^>]*>/gi)||[]).filter((r)=>/\sname\s*=\s*["']description["']/i.test(r))}function V(e){return x(e).length>0}function G(e){for(let r of x(e)){let n=r.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),g=(n?.[1]??n?.[2]??"").trim();if(g)return v(g)}return""}function l(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var Jr={name:"meta",rawParams:!0,handler:(e,r,n,g)=>{let i=hr(r,n??{});if(i.kind==="error")return P("Meta",`@meta(${r.join(", ")})`,i.message,g,i.code);if(i.kind==="empty")return"";if(n)n.__stx_runtime_head=Fe(n.__stx_runtime_head??{},{meta:[i.tag]});return""},hasEndTag:!1},Yr={name:"structuredData",handler:(e,r,n,g)=>{if(e.trim()==="")return a("StructuredData","structuredData directive requires JSON-LD content",t.INVALID_DIRECTIVE_SYNTAX);try{let i=JSON.parse(e);if(!i["@context"])i["@context"]="https://schema.org";if(!i["@type"])return a("StructuredData","structuredData requires @type property",t.INVALID_DIRECTIVE_SYNTAX);return E(i)}catch(i){let s=i instanceof Error?i.message:String(i);return a("StructuredData",s,t.EVALUATION_ERROR)}},hasEndTag:!0};function _p(){return[Jr,Yr]}function Cp(e,r){let{baseUrl:n,defaultChangefreq:g="weekly",defaultPriority:i=0.5,includeLastmod:s=!0}=r,c=n.replace(/\/$/,""),o=(m)=>m.startsWith("http")?m:`${c}${m.startsWith("/")?"":"/"}${m}`,u=e.map((m)=>{let d=o(m.loc),f=m.lastmod||(s?new Date().toISOString().split("T")[0]:void 0),D=m.changefreq||g,y=m.priority??i,h=` <url>
47
47
  <loc>${T(d)}</loc>`;for(let w of m.alternates??[])h+=`
48
48
  <xhtml:link rel="alternate" hreflang="${T(w.hreflang)}" href="${T(o(w.href))}"/>`;if(f)h+=`
49
49
  <lastmod>${f}</lastmod>`;return h+=`
@@ -53,13 +53,13 @@ ${y}
53
53
  <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"${e.some((m)=>m.alternates?.length)?' xmlns:xhtml="http://www.w3.org/1999/xhtml"':""}>
54
54
  ${u.join(`
55
55
  `)}
56
- </urlset>`}function Cp(e,r){let n=r.replace(/\/$/,""),g=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
56
+ </urlset>`}function Ep(e,r){let n=r.replace(/\/$/,""),g=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
57
57
  <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
58
58
  ${e.map((s)=>{let c=s.startsWith("http")?s:`${n}${s.startsWith("/")?"":"/"}${s}`;return` <sitemap>
59
59
  <loc>${T(c)}</loc>
60
60
  <lastmod>${g}</lastmod>
61
61
  </sitemap>`}).join(`
62
62
  `)}
63
- </sitemapindex>`}async function Ep(e,r){let{extensions:n=[".stx",".html",".htm"],ignore:g=["_*",".*","node_modules","components","partials","layouts"]}=r,i=[],s=n.length===1?`*${n[0]}`:`*{${n.join(",")}}`,c=new Bun.Glob(`**/${s}`);for await(let o of c.scan(e)){if(g.some((f)=>{if(f.startsWith("*"))return o.includes(f.slice(1));return o.startsWith(f)||o.includes(`/${f}`)}))continue;let p=o.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!p.startsWith("/"))p=`/${p}`;if(p!=="/"&&p.endsWith("/"))p=p.slice(0,-1);let m=`${e}/${o}`,d;try{let f=await Bun.file(m).stat();if(f)d=new Date(f.mtime).toISOString().split("T")[0]}catch{}i.push({loc:p||"/",lastmod:d,priority:p==="/"?1:0.5})}return i.sort((o,u)=>o.loc.localeCompare(u.loc)),i}function Yr(e){let r=[];for(let n of e.rules){if(r.push(`User-agent: ${n.userAgent}`),n.allow)for(let g of n.allow)r.push(`Allow: ${g}`);if(n.disallow)for(let g of n.disallow)r.push(`Disallow: ${g}`);if(n.crawlDelay!==void 0)r.push(`Crawl-delay: ${n.crawlDelay}`);r.push("")}if(e.sitemap){let n=Array.isArray(e.sitemap)?e.sitemap:[e.sitemap];for(let g of n)r.push(`Sitemap: ${g}`)}if(e.host)r.push(`Host: ${e.host}`);return r.join(`
64
- `).trim()}function Tp(e){return Yr({rules:[{userAgent:"*",allow:["/"]}],sitemap:e})}function T(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}
65
- export{mo,ho,yo,bo,Xr,Jr,kp,_p,Cp,Ep,Yr,Tp};
63
+ </sitemapindex>`}async function Tp(e,r){let{extensions:n=[".stx",".html",".htm"],ignore:g=["_*",".*","node_modules","components","partials","layouts"]}=r,i=[],s=n.length===1?`*${n[0]}`:`*{${n.join(",")}}`,c=new Bun.Glob(`**/${s}`);for await(let o of c.scan(e)){if(g.some((f)=>{if(f.startsWith("*"))return o.includes(f.slice(1));return o.startsWith(f)||o.includes(`/${f}`)}))continue;let p=o.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!p.startsWith("/"))p=`/${p}`;if(p!=="/"&&p.endsWith("/"))p=p.slice(0,-1);let m=`${e}/${o}`,d;try{let f=await Bun.file(m).stat();if(f)d=new Date(f.mtime).toISOString().split("T")[0]}catch{}i.push({loc:p||"/",lastmod:d,priority:p==="/"?1:0.5})}return i.sort((o,u)=>o.loc.localeCompare(u.loc)),i}function Zr(e){let r=[];for(let n of e.rules){if(r.push(`User-agent: ${n.userAgent}`),n.allow)for(let g of n.allow)r.push(`Allow: ${g}`);if(n.disallow)for(let g of n.disallow)r.push(`Disallow: ${g}`);if(n.crawlDelay!==void 0)r.push(`Crawl-delay: ${n.crawlDelay}`);r.push("")}if(e.sitemap){let n=Array.isArray(e.sitemap)?e.sitemap:[e.sitemap];for(let g of n)r.push(`Sitemap: ${g}`)}if(e.host)r.push(`Host: ${e.host}`);return r.join(`
64
+ `).trim()}function $p(e){return Zr({rules:[{userAgent:"*",allow:["/"]}],sitemap:e})}function T(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}
65
+ export{ho,yo,bo,vo,Jr,Yr,_p,Cp,Ep,Tp,Zr,$p};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ip,ra,ap,sa,bl,vl,en,Wn,cp,wl,xl,lp,h}from"./chunk-kdebh22m.js";import"./chunk-4b9s7wgy.js";import"./chunk-f9zyf9n6.js";import"./chunk-mwnhdsbp.js";import"./chunk-25zmy8q6.js";import"./chunk-bsajk82t.js";import"./chunk-ce6zddpf.js";import"./chunk-zp79zkkd.js";export{en as buildCss,wl as extractClassNames,vl as fingerprintConfig,xl as generateCss,cp as getCachedCSS,ip as getCssServeAsset,h as injectCss,ra as loadCssEngine,sa as loadCssEngineConfig,Wn as rebuildCss,ap as resetCssCache,bl as resolveUserCssConfig,lp as withLinkedModuleBundles};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{g,m,d}from"./chunk-kwek8xdt.js";import{N}from"./chunk-9gfffs28.js";import{s}from"./chunk-mjm3tyfj.js";import k from"path";var q={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},T=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var M=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function H(e){let t=[],o=0,n;M.lastIndex=0;while((n=M.exec(e))!==null){if(n.index>o){let a=e.slice(o,n.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let r=n[1],i=n[2];t.push({type:"suspense",name:r,content:i}),o=n.index+n[0].length}if(o<e.length){let r=e.slice(o);if(r.trim())t.push({type:t.length===0?"shell":"content",content:r})}if(t.length===0)t.push({type:"shell",content:e});return t}async function rd(e,t={},o={}){let n={...N,...o,streaming:{...q,...o.streaming}},r=n.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),S=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),f=S?S[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),h={...t,__filename:e,__dirname:k.dirname(e)};if(f.trim())await g(f,h,e);let E=H(c),u=new Set;if(!E.some((w)=>w.type==="suspense")){let w=n.streaming?.strategy||"auto",x=new RegExp(T.source,"g");if(!(w!=="manual"&&x.test(c))){let p=await s(c,h,e,n,u);for(let b=0;b<p.length;b+=r)i.enqueue(p.slice(b,b+r)),await new Promise((y)=>setTimeout(y,0))}else{let p=[],b=new RegExp(T.source,"g"),y;while((y=b.exec(c))!==null)p.push({name:y[1],content:y[2],start:y.index,end:y.index+y[0].length});let v=0;for(let _ of p){if(_.start>v){let I=c.slice(v,_.start);if(I.trim()){let O=await s(I,h,e,n,u);i.enqueue(O),await new Promise((D)=>setTimeout(D,0))}}let C=await s(_.content,h,e,n,u);i.enqueue(C),await new Promise((I)=>setTimeout(I,0)),v=_.end}if(v<c.length){let _=c.slice(v);if(_.trim()){let C=await s(_,h,e,n,u);i.enqueue(C)}}}}else{let w=new Map;for(let l of E)if(l.type==="shell"||l.type==="content"){let p=await s(l.content,h,e,n,u);i.enqueue(p)}else if(l.type==="suspense"&&l.name){let p=`stx-suspense-${l.name}`;i.enqueue(`<div id="${p}" data-suspense="${l.name}" style="display:contents;">
2
+ import{g,m,d}from"./chunk-f9zyf9n6.js";import{N}from"./chunk-srq9fqq8.js";import{s}from"./chunk-aet1pgw7.js";import k from"path";var q={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},T=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var M=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function H(e){let t=[],o=0,n;M.lastIndex=0;while((n=M.exec(e))!==null){if(n.index>o){let a=e.slice(o,n.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let r=n[1],i=n[2];t.push({type:"suspense",name:r,content:i}),o=n.index+n[0].length}if(o<e.length){let r=e.slice(o);if(r.trim())t.push({type:t.length===0?"shell":"content",content:r})}if(t.length===0)t.push({type:"shell",content:e});return t}async function sd(e,t={},o={}){let n={...N,...o,streaming:{...q,...o.streaming}},r=n.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),S=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),f=S?S[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),h={...t,__filename:e,__dirname:k.dirname(e)};if(f.trim())await g(f,h,e);let E=H(c),u=new Set;if(!E.some((w)=>w.type==="suspense")){let w=n.streaming?.strategy||"auto",x=new RegExp(T.source,"g");if(!(w!=="manual"&&x.test(c))){let p=await s(c,h,e,n,u);for(let b=0;b<p.length;b+=r)i.enqueue(p.slice(b,b+r)),await new Promise((y)=>setTimeout(y,0))}else{let p=[],b=new RegExp(T.source,"g"),y;while((y=b.exec(c))!==null)p.push({name:y[1],content:y[2],start:y.index,end:y.index+y[0].length});let v=0;for(let _ of p){if(_.start>v){let I=c.slice(v,_.start);if(I.trim()){let O=await s(I,h,e,n,u);i.enqueue(O),await new Promise((D)=>setTimeout(D,0))}}let C=await s(_.content,h,e,n,u);i.enqueue(C),await new Promise((I)=>setTimeout(I,0)),v=_.end}if(v<c.length){let _=c.slice(v);if(_.trim()){let C=await s(_,h,e,n,u);i.enqueue(C)}}}}else{let w=new Map;for(let l of E)if(l.type==="shell"||l.type==="content"){let p=await s(l.content,h,e,n,u);i.enqueue(p)}else if(l.type==="suspense"&&l.name){let p=`stx-suspense-${l.name}`;i.enqueue(`<div id="${p}" data-suspense="${l.name}" style="display:contents;">
3
3
  <template data-suspense-fallback>Loading...</template>
4
4
  </div>`),w.set(l.name,s(l.content,h,e,n,u))}i.enqueue(`
5
5
  <script>
@@ -17,13 +17,13 @@ import{g,m,d}from"./chunk-kwek8xdt.js";import{N}from"./chunk-9gfffs28.js";import
17
17
  }
18
18
  };
19
19
  })();
20
- </script>`);let x=Array.from(w.entries()).map(async([l,p])=>{i.enqueue(await Li(l,p))});await Promise.all(x)}i.close()}catch(a){i.error(a)}}})}async function Li(e,t){try{let n=(await t).replace(/`/g,"\\`").replace(/<\/script>/gi,"<\\/script>");return`
20
+ </script>`);let x=Array.from(w.entries()).map(async([l,p])=>{i.enqueue(await ji(l,p))});await Promise.all(x)}i.close()}catch(a){i.error(a)}}})}async function ji(e,t){try{let n=(await t).replace(/`/g,"\\`").replace(/<\/script>/gi,"<\\/script>");return`
21
21
  <script>
22
22
  window.__stxSuspense.resolve('${e}', \`${n}\`);
23
23
  </script>`}catch(o){let n=o instanceof Error?o.message:String(o);return`
24
24
  <script>
25
25
  window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading content: ${d(n)}</div>');
26
- </script>`}}var il=`
26
+ </script>`}}var al=`
27
27
  <script>
28
28
  (function(){
29
29
  window.__stxSuspense = window.__stxSuspense || {
@@ -43,12 +43,12 @@ window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading conte
43
43
  }
44
44
  };
45
45
  })();
46
- </script>`;function z(e,t,o){if(!t||t<=0)return e;let n,r=new Promise((i,a)=>{n=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,r]).finally(()=>clearTimeout(n))}function sd(e,t=[],o={}){let n=o.timeoutMs??0;return new ReadableStream({async start(r){try{if(r.enqueue(e),t.length>0)r.enqueue(il),await Promise.all(t.map(async(i)=>{let a=z(i.render(),n,i.id);r.enqueue(await Li(i.id,a))}));r.close()}catch(i){r.error(i)}}})}var A=/@stream\s*\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)@endstream/gi;function od(e,t){return e.replace(A,(o,n,r)=>{let i=n.trim(),a=r.split(/@fallback/i),S=a[0].trim(),f=a.length>1?a.slice(1).join("@fallback").trim():"";if(!t.__streamTemplates)t.__streamTemplates={};return t.__streamTemplates[i]=S,`<div data-suspense="${i}">${f}</div>`})}function id(e){let t=e?.streamBoundaries;if(!t||typeof t!=="object")return;let o=Object.entries(t).filter(([,n])=>typeof n==="function");return o.length>0?o.map(([n,r])=>({id:n,render:r})):void 0}async function ad(e,t={},o={}){let n={...N,...o,streaming:{...q,...o.streaming}},r=n.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),S=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),f=S?S[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),h={...t,__filename:e,__dirname:k.dirname(e)};if(f.trim())await g(f,h,e);let E=new Set,u=n.streaming?.strategy||"auto",R=new RegExp(T.source,"g");if(!(u!=="manual"&&R.test(c))){let x=await s(c,h,e,n,E);for(let l=0;l<x.length;l+=r)i.enqueue(x.slice(l,l+r))}else{let x=[],l=new RegExp(T.source,"g"),p;while((p=l.exec(c))!==null)x.push({name:p[1],content:p[2],start:p.index,end:p.index+p[0].length});let b=0;for(let y of x){if(y.start>b){let _=c.slice(b,y.start);if(_.trim()){let C=await s(_,h,e,n,E);i.enqueue(C)}}let v=await s(y.content,h,e,n,E);i.enqueue(v),b=y.end}if(b<c.length){let y=c.slice(b);if(y.trim()){let v=await s(y,h,e,n,E);i.enqueue(v)}}}i.close()}catch(a){i.error(a)}}})}async function cd(e,t={}){let o={...N,...t,streaming:{...q,...t.streaming}},n=await Bun.file(e).text(),r=n.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),i=r?r[1]:"",a=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),S=a,f={},c;T.lastIndex=0;while((c=T.exec(a))!==null){let u=c[1],R=c[2];f[u]=R}let h=a.replace(T,"");return{renderShell:async(u={})=>{let R={...u,__filename:e,__dirname:k.dirname(e)};return await g(i,R,e),s(h,R,e,o,new Set)},renderSection:async(u,R={})=>{try{if(!f[u])return`<div class="error-message">Section "${d(u)}" not found in template "${d(e)}"</div>`;let w={...R,__filename:e,__dirname:k.dirname(e)};await g(i,w,e);let x=new Set;return await s(f[u],w,e,o,x)}catch(w){let x=w instanceof Error?w.message:String(w);return m("Expression",x,e,f[u]||"",0,f[u]||"")}},getSections:()=>Object.keys(f),getTemplate:()=>S}}var al={name:"suspense",hasEndTag:!0,handler:(e,t,o,n)=>{if(!t||t.length===0)throw Error("Suspense directive requires a name parameter");let r=t[0].replace(/['"`]/g,"");return`<!-- @suspense:${r} -->${e}<!-- @endsuspense:${r} -->`}},cl={name:"island",hasEndTag:!0,handler:(e,t,o,n)=>{if(!t||t.length===0)throw Error("Island directive requires a name parameter");let r=t[0].replace(/['"`]/g,""),i=t[1]?t[1].replace(/['"`]/g,""):"lazy",a=`island-${r}-${Math.random().toString(36).substring(2,9)}`,S=e.match(/<script\s+props\s*>([\s\S]*?)<\/script>/i),f=S?S[1].trim():"",c=S?e.replace(S[0],""):e;return`<div data-island="${r}" data-island-id="${a}" data-priority="${i}">
46
+ </script>`;function z(e,t,o){if(!t||t<=0)return e;let n,r=new Promise((i,a)=>{n=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,r]).finally(()=>clearTimeout(n))}function od(e,t=[],o={}){let n=o.timeoutMs??0;return new ReadableStream({async start(r){try{if(r.enqueue(e),t.length>0)r.enqueue(al),await Promise.all(t.map(async(i)=>{let a=z(i.render(),n,i.id);r.enqueue(await ji(i.id,a))}));r.close()}catch(i){r.error(i)}}})}var A=/@stream\s*\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)@endstream/gi;function id(e,t){return e.replace(A,(o,n,r)=>{let i=n.trim(),a=r.split(/@fallback/i),S=a[0].trim(),f=a.length>1?a.slice(1).join("@fallback").trim():"";if(!t.__streamTemplates)t.__streamTemplates={};return t.__streamTemplates[i]=S,`<div data-suspense="${i}">${f}</div>`})}function ad(e){let t=e?.streamBoundaries;if(!t||typeof t!=="object")return;let o=Object.entries(t).filter(([,n])=>typeof n==="function");return o.length>0?o.map(([n,r])=>({id:n,render:r})):void 0}async function cd(e,t={},o={}){let n={...N,...o,streaming:{...q,...o.streaming}},r=n.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),S=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),f=S?S[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),h={...t,__filename:e,__dirname:k.dirname(e)};if(f.trim())await g(f,h,e);let E=new Set,u=n.streaming?.strategy||"auto",R=new RegExp(T.source,"g");if(!(u!=="manual"&&R.test(c))){let x=await s(c,h,e,n,E);for(let l=0;l<x.length;l+=r)i.enqueue(x.slice(l,l+r))}else{let x=[],l=new RegExp(T.source,"g"),p;while((p=l.exec(c))!==null)x.push({name:p[1],content:p[2],start:p.index,end:p.index+p[0].length});let b=0;for(let y of x){if(y.start>b){let _=c.slice(b,y.start);if(_.trim()){let C=await s(_,h,e,n,E);i.enqueue(C)}}let v=await s(y.content,h,e,n,E);i.enqueue(v),b=y.end}if(b<c.length){let y=c.slice(b);if(y.trim()){let v=await s(y,h,e,n,E);i.enqueue(v)}}}i.close()}catch(a){i.error(a)}}})}async function ld(e,t={}){let o={...N,...t,streaming:{...q,...t.streaming}},n=await Bun.file(e).text(),r=n.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),i=r?r[1]:"",a=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),S=a,f={},c;T.lastIndex=0;while((c=T.exec(a))!==null){let u=c[1],R=c[2];f[u]=R}let h=a.replace(T,"");return{renderShell:async(u={})=>{let R={...u,__filename:e,__dirname:k.dirname(e)};return await g(i,R,e),s(h,R,e,o,new Set)},renderSection:async(u,R={})=>{try{if(!f[u])return`<div class="error-message">Section "${d(u)}" not found in template "${d(e)}"</div>`;let w={...R,__filename:e,__dirname:k.dirname(e)};await g(i,w,e);let x=new Set;return await s(f[u],w,e,o,x)}catch(w){let x=w instanceof Error?w.message:String(w);return m("Expression",x,e,f[u]||"",0,f[u]||"")}},getSections:()=>Object.keys(f),getTemplate:()=>S}}var cl={name:"suspense",hasEndTag:!0,handler:(e,t,o,n)=>{if(!t||t.length===0)throw Error("Suspense directive requires a name parameter");let r=t[0].replace(/['"`]/g,"");return`<!-- @suspense:${r} -->${e}<!-- @endsuspense:${r} -->`}},ll={name:"island",hasEndTag:!0,handler:(e,t,o,n)=>{if(!t||t.length===0)throw Error("Island directive requires a name parameter");let r=t[0].replace(/['"`]/g,""),i=t[1]?t[1].replace(/['"`]/g,""):"lazy",a=`island-${r}-${Math.random().toString(36).substring(2,9)}`,S=e.match(/<script\s+props\s*>([\s\S]*?)<\/script>/i),f=S?S[1].trim():"",c=S?e.replace(S[0],""):e;return`<div data-island="${r}" data-island-id="${a}" data-priority="${i}">
47
47
  ${c}
48
48
  <script type="application/json" data-island-props="${a}">
49
49
  ${f?`{${f}}`:"{}"}
50
50
  </script>
51
- </div>`}};function ld(e={}){let t=[];if(e.streaming?.enabled)t.push(al);if(e.hydration?.enabled)t.push(cl);return t}async function ud(e,t,o,n={}){return e}function dd(e,t={}){let o=new TextEncoder,n=e.pipeThrough(new TransformStream({transform(i,a){a.enqueue(o.encode(i))}})),r=new Headers(t.headers);if(!r.has("Content-Type"))r.set("Content-Type","text/html; charset=utf-8");if(!r.has("Transfer-Encoding"))r.set("Transfer-Encoding","chunked");if(!r.has("X-Content-Type-Options"))r.set("X-Content-Type-Options","nosniff");if(!r.has("X-Accel-Buffering"))r.set("X-Accel-Buffering","no");return new Response(n,{...t,headers:r})}function pd(e={mode:"full"}){let{mode:t,components:o={},dynamicImports:n=!0}=e,r=Object.entries(o).map(([i,a])=>`'${i}': ${n?`() => import('${a}')`:`require('${a}')`}`).join(`,
51
+ </div>`}};function ud(e={}){let t=[];if(e.streaming?.enabled)t.push(cl);if(e.hydration?.enabled)t.push(ll);return t}async function dd(e,t,o,n={}){return e}function pd(e,t={}){let o=new TextEncoder,n=e.pipeThrough(new TransformStream({transform(i,a){a.enqueue(o.encode(i))}})),r=new Headers(t.headers);if(!r.has("Content-Type"))r.set("Content-Type","text/html; charset=utf-8");if(!r.has("Transfer-Encoding"))r.set("Transfer-Encoding","chunked");if(!r.has("X-Content-Type-Options"))r.set("X-Content-Type-Options","nosniff");if(!r.has("X-Accel-Buffering"))r.set("X-Accel-Buffering","no");return new Response(n,{...t,headers:r})}function fd(e={mode:"full"}){let{mode:t,components:o={},dynamicImports:n=!0}=e,r=Object.entries(o).map(([i,a])=>`'${i}': ${n?`() => import('${a}')`:`require('${a}')`}`).join(`,
52
52
  `);if(t==="loader")return`
53
53
  (function() {
54
54
  window.__stx = window.__stx || {};
@@ -191,4 +191,4 @@ else {
191
191
  stx.hydrate();
192
192
  }
193
193
  })();`}
194
- export{rd,Li,il,sd,od,id,ad,cd,al,cl,ld,ud,dd,pd};
194
+ export{sd,ji,al,od,id,ad,cd,ld,cl,ll,ud,dd,pd,fd};
@@ -298,5 +298,5 @@ catch (error) {
298
298
  init();
299
299
  }
300
300
  })();
301
- </script>`}var mu={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"},hu={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"},yu={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"},bu={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"},Ts=[mu,hu,yu,bu];function qp(t){return[...t,...Ts]}
302
- export{mu,hu,yu,bu,Ts,qp};
301
+ </script>`}var hu={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"},yu={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"},bu={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"},vu={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"},$s=[hu,yu,bu,vu];function Gp(t){return[...t,...$s]}
302
+ export{hu,yu,bu,vu,$s,Gp};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{C}from"./chunk-fbtv2k1p.js";import{ze,wn}from"./chunk-30nes8ne.js";function m(e){let t={"cache-first":{className:"CacheFirst",importFrom:"workbox-strategies"},"network-first":{className:"NetworkFirst",importFrom:"workbox-strategies"},"stale-while-revalidate":{className:"StaleWhileRevalidate",importFrom:"workbox-strategies"},"network-only":{className:"NetworkOnly",importFrom:"workbox-strategies"},"cache-only":{className:"CacheOnly",importFrom:"workbox-strategies"}};return t[e]||t["network-first"]}function g(e){return m(e).className}function d(e){let t=e.pwa;if(!t?.enabled)return"";let r=t.routes||[],n=t.cacheStorage,c=[];for(let a of r){let i=g(a.strategy),s=[];if(a.maxAgeSeconds||a.maxEntries||n?.maxEntries){let o=a.maxEntries||n?.maxEntries||100,u=a.maxAgeSeconds||(n?.maxAge?n.maxAge*24*60*60:void 0);s.push(`new ExpirationPlugin({
2
+ import{C}from"./chunk-506mv7hb.js";import{ze,wn}from"./chunk-35ezh7de.js";function m(e){let t={"cache-first":{className:"CacheFirst",importFrom:"workbox-strategies"},"network-first":{className:"NetworkFirst",importFrom:"workbox-strategies"},"stale-while-revalidate":{className:"StaleWhileRevalidate",importFrom:"workbox-strategies"},"network-only":{className:"NetworkOnly",importFrom:"workbox-strategies"},"cache-only":{className:"CacheOnly",importFrom:"workbox-strategies"}};return t[e]||t["network-first"]}function g(e){return m(e).className}function d(e){let t=e.pwa;if(!t?.enabled)return"";let r=t.routes||[],n=t.cacheStorage,c=[];for(let a of r){let i=g(a.strategy),s=[];if(a.maxAgeSeconds||a.maxEntries||n?.maxEntries){let o=a.maxEntries||n?.maxEntries||100,u=a.maxAgeSeconds||(n?.maxAge?n.maxAge*24*60*60:void 0);s.push(`new ExpirationPlugin({
3
3
  maxEntries: ${o},
4
4
  ${u?`maxAgeSeconds: ${u},`:""}
5
5
  purgeOnQuotaError: true,