@stacksjs/stx 0.2.294 → 0.2.296

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 (143) hide show
  1. package/dist/{chunk-h1tkqfym.js → chunk-03mc9wc9.js} +1 -1
  2. package/dist/{chunk-zgevnvfs.js → chunk-0xtnepfj.js} +1 -1
  3. package/dist/{chunk-dd7f8yxx.js → chunk-1ge7rfg4.js} +1 -1
  4. package/dist/chunk-224m1jrf.js +17 -0
  5. package/dist/{chunk-p9wkzh0k.js → chunk-24pgjzmy.js} +1 -1
  6. package/dist/{chunk-8553dwfj.js → chunk-29hfy1xw.js} +1 -1
  7. package/dist/chunk-2a8q7c9z.js +2 -0
  8. package/dist/{chunk-txjckheb.js → chunk-2b9r38hs.js} +1 -1
  9. package/dist/chunk-2enzjhrh.js +2 -0
  10. package/dist/{chunk-n0hgshd5.js → chunk-2v69c72j.js} +1 -1
  11. package/dist/chunk-31e2jrb4.js +2 -0
  12. package/dist/chunk-3fv1agwg.js +2 -0
  13. package/dist/{chunk-2bpa6n7s.js → chunk-3jxt0y11.js} +1 -1
  14. package/dist/{chunk-5g1amf33.js → chunk-3mbkn6vk.js} +2 -2
  15. package/dist/chunk-3nmkjd4b.js +2 -0
  16. package/dist/{chunk-9s0ax53m.js → chunk-3npkbgfm.js} +1 -1
  17. package/dist/{chunk-nk11g9k5.js → chunk-3rjeare9.js} +1 -1
  18. package/dist/{chunk-dfcsn711.js → chunk-44gm42cq.js} +1 -1
  19. package/dist/{chunk-mdfyv4hb.js → chunk-4yqnabzy.js} +1 -1
  20. package/dist/{chunk-18cn95p7.js → chunk-5ey1fdjf.js} +1 -1
  21. package/dist/{chunk-prt5da17.js → chunk-5t50pdtm.js} +1 -1
  22. package/dist/{chunk-359ps7j5.js → chunk-6kdb8j9d.js} +1 -1
  23. package/dist/{chunk-w1h2g1ej.js → chunk-6sy85s25.js} +1 -1
  24. package/dist/{chunk-bh4aq0dx.js → chunk-6tqbgd20.js} +1 -1
  25. package/dist/{chunk-9mzj4q5k.js → chunk-6tzzh1dg.js} +1 -1
  26. package/dist/{chunk-wvn4gc66.js → chunk-6xsxkzhy.js} +1 -1
  27. package/dist/{chunk-tjverybm.js → chunk-6z04mpxz.js} +22 -22
  28. package/dist/chunk-76p7bnw1.js +2 -0
  29. package/dist/chunk-7mem81az.js +2 -0
  30. package/dist/{chunk-h06cjhqg.js → chunk-7ncfmg13.js} +1 -1
  31. package/dist/{chunk-hx6y0qqy.js → chunk-85mzetge.js} +1 -1
  32. package/dist/chunk-86cmtck2.js +2 -0
  33. package/dist/{chunk-t5d0pm2c.js → chunk-8h9xqc3p.js} +1 -1
  34. package/dist/chunk-8tdj5zep.js +2 -0
  35. package/dist/{chunk-dxevp6w7.js → chunk-8zyv8jf3.js} +1 -1
  36. package/dist/{chunk-p7b34wcs.js → chunk-9616c6wn.js} +1 -1
  37. package/dist/{chunk-m8nswk6n.js → chunk-a84j7v61.js} +1 -1
  38. package/dist/chunk-a9c8w6fq.js +2 -0
  39. package/dist/{chunk-55rgvjvd.js → chunk-ahdzc50z.js} +1 -1
  40. package/dist/{chunk-cvw9brjj.js → chunk-asn02v4q.js} +1 -1
  41. package/dist/chunk-b24chdr8.js +2 -0
  42. package/dist/{chunk-bcgywywg.js → chunk-bax52sn4.js} +1 -1
  43. package/dist/{chunk-gw4hwf49.js → chunk-bc7emj22.js} +1 -1
  44. package/dist/{chunk-7sdvaras.js → chunk-c5rehxqy.js} +1 -1
  45. package/dist/chunk-cfx3vjh6.js +2 -0
  46. package/dist/{chunk-vkc53tv3.js → chunk-d3kac3mv.js} +1 -1
  47. package/dist/{chunk-0btmm4m2.js → chunk-dn8006f7.js} +1 -1
  48. package/dist/chunk-e17ys98t.js +2 -0
  49. package/dist/{chunk-hh1knan6.js → chunk-e2ymkgjk.js} +10 -10
  50. package/dist/{chunk-6x87aw24.js → chunk-e3ta86aa.js} +1 -1
  51. package/dist/chunk-f57xky9r.js +2 -0
  52. package/dist/chunk-f76qk302.js +2 -0
  53. package/dist/{chunk-38nfzyxc.js → chunk-fdnbqt4r.js} +1 -1
  54. package/dist/chunk-fqggvrwy.js +2 -0
  55. package/dist/chunk-fz52r2f7.js +2 -0
  56. package/dist/{chunk-h5898m09.js → chunk-fz91fd99.js} +1 -1
  57. package/dist/{chunk-y6x6pbw0.js → chunk-gbewds58.js} +1 -1
  58. package/dist/chunk-gw431w90.js +2 -0
  59. package/dist/{chunk-mfwass3b.js → chunk-h625b8k6.js} +2 -2
  60. package/dist/{chunk-0dk4qvb6.js → chunk-hfjhybrn.js} +1 -1
  61. package/dist/{chunk-rbg1m54v.js → chunk-hvqae2g1.js} +1 -1
  62. package/dist/{chunk-64d20kkv.js → chunk-jmh31a2a.js} +2 -2
  63. package/dist/{chunk-5wfgvwzg.js → chunk-k2f4jwez.js} +1 -1
  64. package/dist/{chunk-kxjh5mc2.js → chunk-k7mewajj.js} +1 -1
  65. package/dist/{chunk-ja39jznm.js → chunk-kgxkrnyt.js} +1 -1
  66. package/dist/{chunk-h61mtxjp.js → chunk-knz3zy2t.js} +1 -1
  67. package/dist/{chunk-85xj7cgm.js → chunk-kp8ec2f4.js} +1 -1
  68. package/dist/chunk-m38tpeke.js +2 -0
  69. package/dist/{chunk-map1tr8n.js → chunk-maq28582.js} +1 -1
  70. package/dist/{chunk-ym0dqh13.js → chunk-mdd9yk4f.js} +1 -1
  71. package/dist/{chunk-gjjvjzm2.js → chunk-mx93vwmq.js} +1 -1
  72. package/dist/chunk-my8x4p73.js +2 -0
  73. package/dist/{chunk-x6ehvkry.js → chunk-nnkz36zg.js} +1 -1
  74. package/dist/{chunk-b16crvqg.js → chunk-nqwjb8k7.js} +1 -1
  75. package/dist/{chunk-wxgkq79w.js → chunk-nx96x8sh.js} +1 -1
  76. package/dist/{chunk-tweb2f3m.js → chunk-pb4jjbpq.js} +2 -2
  77. package/dist/{chunk-7s1kdzcr.js → chunk-pb5s3vwg.js} +1 -1
  78. package/dist/{chunk-8cdfsgjb.js → chunk-pfwhd5xs.js} +1 -1
  79. package/dist/{chunk-zg2kxgd4.js → chunk-phrd5kxe.js} +1 -1
  80. package/dist/chunk-psbfqbkt.js +2 -0
  81. package/dist/{chunk-dd5jk2w3.js → chunk-psraz70k.js} +1 -1
  82. package/dist/chunk-pwyjrwrc.js +2 -0
  83. package/dist/{chunk-6dkpsw29.js → chunk-q2dmpbqf.js} +1 -1
  84. package/dist/{chunk-br48y7q9.js → chunk-qfec1s34.js} +3 -3
  85. package/dist/{chunk-rbabq8ds.js → chunk-qxmywwq5.js} +1 -1
  86. package/dist/{chunk-7wnbgnxj.js → chunk-qzbwa5xe.js} +1 -1
  87. package/dist/{chunk-7rkxdbzr.js → chunk-sptmr6wf.js} +1 -1
  88. package/dist/chunk-sq24kkns.js +2 -0
  89. package/dist/chunk-tqtcs1wb.js +2 -0
  90. package/dist/{chunk-d2rhtvxx.js → chunk-tt50t72e.js} +1 -1
  91. package/dist/{chunk-6w76w8tt.js → chunk-vg8yh8te.js} +1 -1
  92. package/dist/{chunk-8r7r92n4.js → chunk-vqtbc3q4.js} +2 -2
  93. package/dist/{chunk-s30wc9qn.js → chunk-vqxpsd6r.js} +1 -1
  94. package/dist/{chunk-j83cstqe.js → chunk-vrhp2xnm.js} +1 -1
  95. package/dist/chunk-vt31an48.js +2 -0
  96. package/dist/{chunk-24j0qx2z.js → chunk-vwqv8f0y.js} +1 -1
  97. package/dist/{chunk-regxa2tq.js → chunk-wb00aqm7.js} +1 -1
  98. package/dist/chunk-wrm7300v.js +2 -0
  99. package/dist/{chunk-cjhwpp4c.js → chunk-wvxce7p4.js} +1 -1
  100. package/dist/{chunk-vpbtp5ws.js → chunk-xc4b1ngp.js} +1 -1
  101. package/dist/{chunk-caf2cj4f.js → chunk-xtwybxtw.js} +1 -1
  102. package/dist/chunk-yzb748mw.js +2 -0
  103. package/dist/chunk-zafnsr0w.js +2 -0
  104. package/dist/{chunk-weny2sns.js → chunk-zwknasm0.js} +1 -1
  105. package/dist/cli.js +14 -14
  106. package/dist/client-script-bundler.d.ts +19 -0
  107. package/dist/client-script-bundler.js +22 -10
  108. package/dist/craft-entry.js +1 -1
  109. package/dist/craft.js +1 -1
  110. package/dist/database.js +1 -1
  111. package/dist/pwa.js +2 -2
  112. package/dist/ssg.js +2 -2
  113. package/dist/visual-testing.js +1 -1
  114. package/package.json +5 -5
  115. package/dist/chunk-11az7s55.js +0 -2
  116. package/dist/chunk-1jxhfa9g.js +0 -2
  117. package/dist/chunk-1pwcgb1t.js +0 -2
  118. package/dist/chunk-1xrc4jg5.js +0 -2
  119. package/dist/chunk-295qskae.js +0 -2
  120. package/dist/chunk-2cm2j31x.js +0 -2
  121. package/dist/chunk-3geahqf7.js +0 -2
  122. package/dist/chunk-4y5q9hhx.js +0 -2
  123. package/dist/chunk-68z2ga8f.js +0 -2
  124. package/dist/chunk-9rgwpt1m.js +0 -17
  125. package/dist/chunk-arb8nckf.js +0 -2
  126. package/dist/chunk-bm8mgc3b.js +0 -2
  127. package/dist/chunk-bnw4dyp3.js +0 -2
  128. package/dist/chunk-ccmr3ksw.js +0 -2
  129. package/dist/chunk-cemkg4m3.js +0 -2
  130. package/dist/chunk-ez6x07ts.js +0 -2
  131. package/dist/chunk-gxm3awwv.js +0 -2
  132. package/dist/chunk-hwn896re.js +0 -2
  133. package/dist/chunk-jzhk9rg5.js +0 -2
  134. package/dist/chunk-kagw0ckh.js +0 -2
  135. package/dist/chunk-mg0adds2.js +0 -2
  136. package/dist/chunk-qfrz7b04.js +0 -2
  137. package/dist/chunk-t9489pxe.js +0 -2
  138. package/dist/chunk-v9p2r2dv.js +0 -2
  139. package/dist/chunk-vgcpawx1.js +0 -2
  140. package/dist/chunk-w2j5ze75.js +0 -2
  141. package/dist/chunk-ygy2r4a8.js +0 -2
  142. package/dist/chunk-yshwe3ny.js +0 -2
  143. package/dist/chunk-zkfxz3fj.js +0 -2
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Do as a,Eo as b}from"./chunk-6z04mpxz.js";import"./chunk-3mbkn6vk.js";import"./chunk-dn8006f7.js";import"./chunk-vg8yh8te.js";import"./chunk-c5rehxqy.js";import"./chunk-xtwybxtw.js";import"./chunk-qfec1s34.js";import"./chunk-kgxkrnyt.js";import"./chunk-3npkbgfm.js";import"./chunk-nqwjb8k7.js";import"./chunk-nx96x8sh.js";import"./chunk-6kdb8j9d.js";import"./chunk-jmh31a2a.js";import"./chunk-d3kac3mv.js";import"./chunk-vwqv8f0y.js";export{b as processLoops,a as parseLoopBinding};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$l as i,Tl as c,Wl as d,Xl as e,Yl as f,Zl as g,_l as h,am as j,bm as k,cm as l,dm as m}from"./chunk-6z04mpxz.js";import"./chunk-3mbkn6vk.js";import"./chunk-dn8006f7.js";import"./chunk-vg8yh8te.js";import{$s as a,at as b}from"./chunk-c5rehxqy.js";import"./chunk-xtwybxtw.js";import"./chunk-qfec1s34.js";import"./chunk-kgxkrnyt.js";import"./chunk-3npkbgfm.js";import"./chunk-nqwjb8k7.js";import"./chunk-nx96x8sh.js";import"./chunk-6kdb8j9d.js";import"./chunk-jmh31a2a.js";import"./chunk-d3kac3mv.js";import"./chunk-vwqv8f0y.js";export{h as transformAutoImports,b as stripCommentsAndLiterals,e as renderVendorStyleTags,m as processClientScript,g as injectBrowserCoreAutoImports,l as generateServerDataBridge,j as generateBrowserAutoImportDestructuring,i as generateAutoImportDestructuring,a as findInterpolationEnd,k as extractBridgeData,d as extractAndStripCssImports,f as STX_AUTO_IMPORTS,c as BROWSER_CORE_IMPORTS};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{ej as a,fj as b,gj as c,hj as d,ij as e,jj as f,kj as g,lj as h,mj as i,nj as j,oj as k,pj as l,qj as m,rj as n}from"./chunk-hx6y0qqy.js";import"./chunk-tjverybm.js";import"./chunk-5g1amf33.js";import"./chunk-0btmm4m2.js";import"./chunk-6w76w8tt.js";import"./chunk-7sdvaras.js";import"./chunk-caf2cj4f.js";import"./chunk-br48y7q9.js";import"./chunk-ja39jznm.js";import"./chunk-9s0ax53m.js";import"./chunk-b16crvqg.js";import"./chunk-wxgkq79w.js";import"./chunk-359ps7j5.js";import"./chunk-64d20kkv.js";import"./chunk-vkc53tv3.js";import"./chunk-24j0qx2z.js";export{i as streamingSuspenseDirective,m as streamToResponse,g as streamTemplateSimple,a as streamTemplate,d as renderStreamingPage,k as registerStreamingDirectives,e as processStreamDirectives,l as processSectionDirectives,j as islandDirective,n as generateHydrationRuntime,f as extractStreamBoundaries,h as createStreamRenderer,b as buildSuspenseResolveScript,c as SUSPENSE_RESOLVER_RUNTIME};
2
+ import{ej as a,fj as b,gj as c,hj as d,ij as e,jj as f,kj as g,lj as h,mj as i,nj as j,oj as k,pj as l,qj as m,rj as n}from"./chunk-85mzetge.js";import"./chunk-6z04mpxz.js";import"./chunk-3mbkn6vk.js";import"./chunk-dn8006f7.js";import"./chunk-vg8yh8te.js";import"./chunk-c5rehxqy.js";import"./chunk-xtwybxtw.js";import"./chunk-qfec1s34.js";import"./chunk-kgxkrnyt.js";import"./chunk-3npkbgfm.js";import"./chunk-nqwjb8k7.js";import"./chunk-nx96x8sh.js";import"./chunk-6kdb8j9d.js";import"./chunk-jmh31a2a.js";import"./chunk-d3kac3mv.js";import"./chunk-vwqv8f0y.js";export{i as streamingSuspenseDirective,m as streamToResponse,g as streamTemplateSimple,a as streamTemplate,d as renderStreamingPage,k as registerStreamingDirectives,e as processStreamDirectives,l as processSectionDirectives,j as islandDirective,n as generateHydrationRuntime,f as extractStreamBoundaries,h as createStreamRenderer,b as buildSuspenseResolveScript,c as SUSPENSE_RESOLVER_RUNTIME};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{$p as x,Jp as H,er as g,qm as O,wo as R}from"./chunk-tjverybm.js";import b from"path";var v={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},M=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var T=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function f(q){let B=[],Q=0,G;T.lastIndex=0;while((G=T.exec(q))!==null){if(G.index>Q){let X=q.slice(Q,G.index);if(X.trim())B.push({type:B.length===0?"shell":"content",content:X})}let J=G[1],K=G[2];B.push({type:"suspense",name:J,content:K}),Q=G.index+G[0].length}if(Q<q.length){let J=q.slice(Q);if(J.trim())B.push({type:B.length===0?"shell":"content",content:J})}if(B.length===0)B.push({type:"shell",content:q});return B}async function r(q,B={},Q={}){let G={...g,...Q,streaming:{...v,...Q.streaming}},J=G.streaming?.bufferSize||16384;return new ReadableStream({async start(K){try{let X=await Bun.file(q).text(),z=X.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),L=z?z[1]:"",Y=X.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),j={...B,__filename:q,__dirname:b.dirname(q)};if(L.trim())await R(L,j,q);let D=f(Y),$=new Set;if(!D.some((w)=>w.type==="suspense")){let w=G.streaming?.strategy||"auto",U=new RegExp(M.source,"g");if(!(w!=="manual"&&U.test(Y))){let F=await H(Y,j,q,G,$);for(let V=0;V<F.length;V+=J)K.enqueue(F.slice(V,V+J)),await new Promise((W)=>setTimeout(W,0))}else{let F=[],V=new RegExp(M.source,"g"),W;while((W=V.exec(Y))!==null)F.push({name:W[1],content:W[2],start:W.index,end:W.index+W[0].length});let y=0;for(let A of F){if(A.start>y){let k=Y.slice(y,A.start);if(k.trim()){let E=await H(k,j,q,G,$);K.enqueue(E),await new Promise((S)=>setTimeout(S,0))}}let I=await H(A.content,j,q,G,$);K.enqueue(I),await new Promise((k)=>setTimeout(k,0)),y=A.end}if(y<Y.length){let A=Y.slice(y);if(A.trim()){let I=await H(A,j,q,G,$);K.enqueue(I)}}}}else{let w=new Map;for(let Z of D)if(Z.type==="shell"||Z.type==="content"){let F=await H(Z.content,j,q,G,$);K.enqueue(F)}else if(Z.type==="suspense"&&Z.name){let F=`stx-suspense-${Z.name}`;K.enqueue(`<div id="${F}" data-suspense="${Z.name}" style="display:contents;">
2
+ import{Kp as H,aq as x,fr as g,rm as O,xo as R}from"./chunk-6z04mpxz.js";import b from"path";var v={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},M=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var T=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function f(q){let B=[],Q=0,G;T.lastIndex=0;while((G=T.exec(q))!==null){if(G.index>Q){let X=q.slice(Q,G.index);if(X.trim())B.push({type:B.length===0?"shell":"content",content:X})}let J=G[1],K=G[2];B.push({type:"suspense",name:J,content:K}),Q=G.index+G[0].length}if(Q<q.length){let J=q.slice(Q);if(J.trim())B.push({type:B.length===0?"shell":"content",content:J})}if(B.length===0)B.push({type:"shell",content:q});return B}async function r(q,B={},Q={}){let G={...g,...Q,streaming:{...v,...Q.streaming}},J=G.streaming?.bufferSize||16384;return new ReadableStream({async start(K){try{let X=await Bun.file(q).text(),z=X.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),L=z?z[1]:"",Y=X.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),j={...B,__filename:q,__dirname:b.dirname(q)};if(L.trim())await R(L,j,q);let D=f(Y),$=new Set;if(!D.some((w)=>w.type==="suspense")){let w=G.streaming?.strategy||"auto",U=new RegExp(M.source,"g");if(!(w!=="manual"&&U.test(Y))){let F=await H(Y,j,q,G,$);for(let V=0;V<F.length;V+=J)K.enqueue(F.slice(V,V+J)),await new Promise((W)=>setTimeout(W,0))}else{let F=[],V=new RegExp(M.source,"g"),W;while((W=V.exec(Y))!==null)F.push({name:W[1],content:W[2],start:W.index,end:W.index+W[0].length});let y=0;for(let A of F){if(A.start>y){let k=Y.slice(y,A.start);if(k.trim()){let E=await H(k,j,q,G,$);K.enqueue(E),await new Promise((S)=>setTimeout(S,0))}}let I=await H(A.content,j,q,G,$);K.enqueue(I),await new Promise((k)=>setTimeout(k,0)),y=A.end}if(y<Y.length){let A=Y.slice(y);if(A.trim()){let I=await H(A,j,q,G,$);K.enqueue(I)}}}}else{let w=new Map;for(let Z of D)if(Z.type==="shell"||Z.type==="content"){let F=await H(Z.content,j,q,G,$);K.enqueue(F)}else if(Z.type==="suspense"&&Z.name){let F=`stx-suspense-${Z.name}`;K.enqueue(`<div id="${F}" data-suspense="${Z.name}" style="display:contents;">
3
3
  <template data-suspense-fallback>Loading...</template>
4
4
  </div>`),w.set(Z.name,H(Z.content,j,q,G,$))}K.enqueue(`
5
5
  <script>
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Xe as a}from"./chunk-zwknasm0.js";import"./chunk-6z04mpxz.js";import"./chunk-3mbkn6vk.js";import"./chunk-dn8006f7.js";import"./chunk-vg8yh8te.js";import"./chunk-c5rehxqy.js";import"./chunk-xtwybxtw.js";import"./chunk-qfec1s34.js";import"./chunk-kgxkrnyt.js";import"./chunk-3npkbgfm.js";import"./chunk-nqwjb8k7.js";import"./chunk-nx96x8sh.js";import"./chunk-6kdb8j9d.js";import"./chunk-jmh31a2a.js";import"./chunk-d3kac3mv.js";import"./chunk-vwqv8f0y.js";export{a as startInteractive};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{mv as Y}from"./chunk-24j0qx2z.js";import{mkdir as O,writeFile as q}from"fs/promises";import{join as X}from"path";var T="https://api.iconify.design";async function k(){let E=await fetch(`${T}/collections`);if(!E.ok)throw Error(`Failed to fetch collections: ${E.statusText}`);return await E.json()}async function P(E,z){try{let U=Y.resolve("@iconify/json"),S=`${`${U.substring(0,U.lastIndexOf("/node_modules/@iconify/json/"))}/node_modules/@iconify/json`}/json/${E}.json`,M=Bun.file(S);if(await M.exists()){let V=await M.json();if(z&&z.length>0){let Z={};for(let L of z)if(V.icons[L])Z[L]=V.icons[L];return{...V,icons:Z}}return V}}catch{}let K=z&&z.length>0?`${T}/${E}.json?icons=${z.join(",")}`:`${T}/${E}.json`,Q=await fetch(K);if(!Q.ok)throw Error(`Failed to fetch icons for ${E}: ${Q.statusText}`);return await Q.json()}function j(E,z=24,K=24){return{body:E.body,width:E.width||z,height:E.height||K,viewBox:`0 0 ${E.width||z} ${E.height||K}`}}function F(E,z){let K=B(E);return`import type { IconData } from '@stacksjs/iconify-core'
2
+ import{nv as Y}from"./chunk-vwqv8f0y.js";import{mkdir as O,writeFile as q}from"fs/promises";import{join as X}from"path";var T="https://api.iconify.design";async function k(){let E=await fetch(`${T}/collections`);if(!E.ok)throw Error(`Failed to fetch collections: ${E.statusText}`);return await E.json()}async function P(E,z){try{let U=Y.resolve("@iconify/json"),S=`${`${U.substring(0,U.lastIndexOf("/node_modules/@iconify/json/"))}/node_modules/@iconify/json`}/json/${E}.json`,M=Bun.file(S);if(await M.exists()){let V=await M.json();if(z&&z.length>0){let Z={};for(let L of z)if(V.icons[L])Z[L]=V.icons[L];return{...V,icons:Z}}return V}}catch{}let K=z&&z.length>0?`${T}/${E}.json?icons=${z.join(",")}`:`${T}/${E}.json`,Q=await fetch(K);if(!Q.ok)throw Error(`Failed to fetch icons for ${E}: ${Q.statusText}`);return await Q.json()}function j(E,z=24,K=24){return{body:E.body,width:E.width||z,height:E.height||K,viewBox:`0 0 ${E.width||z} ${E.height||K}`}}function F(E,z){let K=B(E);return`import type { IconData } from '@stacksjs/iconify-core'
3
3
 
4
4
  export const ${K}: IconData = ${JSON.stringify(z,null,2)}
5
5
 
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Oj as a,Pj as b,Qj as c,Rj as d,Sj as e,Tj as f,Uj as g,Vj as h,Wj as i,Xj as j,Yj as k,Zj as l}from"./chunk-03mc9wc9.js";import"./chunk-6z04mpxz.js";import"./chunk-3mbkn6vk.js";import"./chunk-dn8006f7.js";import"./chunk-vg8yh8te.js";import"./chunk-c5rehxqy.js";import"./chunk-xtwybxtw.js";import"./chunk-qfec1s34.js";import"./chunk-kgxkrnyt.js";import"./chunk-3npkbgfm.js";import"./chunk-nqwjb8k7.js";import"./chunk-nx96x8sh.js";import"./chunk-6kdb8j9d.js";import"./chunk-jmh31a2a.js";import"./chunk-d3kac3mv.js";import"./chunk-vwqv8f0y.js";export{a as templateCache,b as readFileCached,d as invalidateFileCacheByDir,c as invalidateFileCache,l as hashFilePath,h as getServeClientAsset,f as getCachedSignalsRuntime,g as getCachedRouterScript,i as clearDevCaches,j as checkCache,k as cacheTemplate,e as __setSignalsGeneratorsForTest};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ag as c,Bg as d,Cg as e,Dg as f,Eg as g,Fg as h,Gg as i,Hg as j,Ig as k,Jg as l,yg as a,zg as b}from"./chunk-8bxtvsgm.js";import"./chunk-24j0qx2z.js";export{g as toUsers,f as toUser,c as stopBroadcasting,b as startBroadcasting,d as loadChannels,a as getBroadcastServer,j as channel,h as broadcastPrivate,i as broadcastPresence,e as broadcast,l as BroadcastServer,k as Broadcast};
2
+ import{Ag as c,Bg as d,Cg as e,Dg as f,Eg as g,Fg as h,Gg as i,Hg as j,Ig as k,Jg as l,yg as a,zg as b}from"./chunk-8bxtvsgm.js";import"./chunk-vwqv8f0y.js";export{g as toUsers,f as toUser,c as stopBroadcasting,b as startBroadcasting,d as loadChannels,a as getBroadcastServer,j as channel,h as broadcastPrivate,i as broadcastPresence,e as broadcast,l as BroadcastServer,k as Broadcast};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ah as e,Bh as f,Ch as g,Dh as h,wh as a,xh as b,yh as c,zh as d}from"./chunk-hmf9z4jx.js";import"./chunk-24j0qx2z.js";export{g as timingPlugin,c as pluginManager,a as definePlugin,f as debugPlugin,h as createVariablesPlugin,e as createFilterPlugin,d as createDirectivePlugin,b as PluginManager};
2
+ import{Ah as e,Bh as f,Ch as g,Dh as h,wh as a,xh as b,yh as c,zh as d}from"./chunk-hmf9z4jx.js";import"./chunk-vwqv8f0y.js";export{g as timingPlugin,c as pluginManager,a as definePlugin,f as debugPlugin,h as createVariablesPlugin,e as createFilterPlugin,d as createDirectivePlugin,b as PluginManager};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{$s as _}from"./chunk-7sdvaras.js";import"./chunk-24j0qx2z.js";function W(j,G,H=240){return j.slice(G,G+H)}var v=[{rule:"route-params",pattern:/\blocation\s*\.\s*pathname\s*\.\s*(?:match|split)\s*\(/g,primitive:"useRoute() / useRouteParams() / useRouteParam(name)",why:"parsing the URL by hand re-implements the router and does not update on SPA navigation"},{rule:"alert",pattern:/(?<![.#\w$])(?:(?:window|globalThis)\s*\.\s*)?alert\s*\(/g,primitive:"stxAlert(message)",why:"themed, focus-trapped and non-blocking \u2014 but `await` it if the code after it "+"depended on the native dialog blocking until dismissal",reject:(j)=>/\b(?:async\s+)?function\s+alert\s*\(/.test(j)||/\b(?:const|let|var)\s+alert\s*=/.test(j)},{rule:"search-params",pattern:/new\s+URLSearchParams\s*\(/g,primitive:"useSearchParams()",why:"reactive, and writes back through the router instead of history.replaceState",reject:(j,G)=>{let H=j.indexOf("(",G);if(H===-1)return!0;let Q=j.slice(H+1,j.indexOf(")",H)+1);return!/\b(?:location|search|href|url)\b/i.test(Q)}},{rule:"navigate",pattern:/\blocation\s*\.\s*(?:assign|replace)\s*\(|\blocation\s*\.\s*href\s*=/g,primitive:"navigate(path) / goBack()",why:"a full document load throws away every store and the scroll position; navigate() is an SPA transition",reject:(j,G)=>/^[^\n]*?(?:['"`]\s*)?(?:mailto:|tel:|sms:|https?:\/\/|\/\/)/.test(W(j,G,160))},{rule:"fetch",pattern:/new\s+AbortController\s*\(/g,primitive:"useFetch(url) / useAsyncData(key, fn)",why:"cancellation, loading and error state are already wired; hand-rolling them is where the races live"},{rule:"polling",pattern:/setInterval\s*\(/g,primitive:"useEventSource() / useSSE() / useWebSocket() / useChannel()",why:"polling burns requests and lags; the push primitives are delivered",reject:(j,G)=>!/\bfetch\s*\(|\$fetch\b|useFetch\b|\.get\s*\(|axios\b/.test(W(j,G))},{rule:"debounce",pattern:/\bclearTimeout\s*\(/g,primitive:"useDebounce(fn, ms) / useThrottle(fn, ms)",why:"a hand-held timer handle per call site is the usual source of stale-result bugs",requires:(j)=>/setTimeout\s*\(/.test(j)},{rule:"click-outside",pattern:/document\s*\.\s*addEventListener\s*\(\s*['"](?:click|mousedown|pointerdown)['"]/g,primitive:"useClickOutside(ref, fn)",why:"the document-level listener plus the blur race is exactly what this composable exists to remove"},{rule:"focus",pattern:/\.\s*(?:getElementById|querySelector)\s*\([^)]*\)\s*(?:\?\.)?\s*\.?focus\s*\(/g,primitive:"useFocus(ref) with x-ref",why:"a query by id breaks under nested scopes and SPA navigation; a ref does not"},{rule:"clipboard",pattern:/navigator\s*\.\s*(?:clipboard|share)\b/g,primitive:"useClipboard() / useShare()",why:"permission state, the copied flag and the unsupported-browser fallback are already handled"},{rule:"watch",pattern:/\beffect\s*\(\s*\(\s*\)\s*=>\s*\{[^}]*\bvoid\s+\w+\s*\(\s*\)/g,primitive:"watch(source, cb) / watchMultiple([...], cb)",why:"the `void a(); void b()` dance is a manual dependency list; watch takes one directly"}],U=["confirm","tooltip",...v.map((j)=>j.rule)];function N(j,G){let H=1;for(let Q=0;Q<G;Q++)if(j[Q]===`
2
+ import{at as _}from"./chunk-c5rehxqy.js";import"./chunk-vwqv8f0y.js";function W(j,G,H=240){return j.slice(G,G+H)}var v=[{rule:"route-params",pattern:/\blocation\s*\.\s*pathname\s*\.\s*(?:match|split)\s*\(/g,primitive:"useRoute() / useRouteParams() / useRouteParam(name)",why:"parsing the URL by hand re-implements the router and does not update on SPA navigation"},{rule:"alert",pattern:/(?<![.#\w$])(?:(?:window|globalThis)\s*\.\s*)?alert\s*\(/g,primitive:"stxAlert(message)",why:"themed, focus-trapped and non-blocking \u2014 but `await` it if the code after it "+"depended on the native dialog blocking until dismissal",reject:(j)=>/\b(?:async\s+)?function\s+alert\s*\(/.test(j)||/\b(?:const|let|var)\s+alert\s*=/.test(j)},{rule:"search-params",pattern:/new\s+URLSearchParams\s*\(/g,primitive:"useSearchParams()",why:"reactive, and writes back through the router instead of history.replaceState",reject:(j,G)=>{let H=j.indexOf("(",G);if(H===-1)return!0;let Q=j.slice(H+1,j.indexOf(")",H)+1);return!/\b(?:location|search|href|url)\b/i.test(Q)}},{rule:"navigate",pattern:/\blocation\s*\.\s*(?:assign|replace)\s*\(|\blocation\s*\.\s*href\s*=/g,primitive:"navigate(path) / goBack()",why:"a full document load throws away every store and the scroll position; navigate() is an SPA transition",reject:(j,G)=>/^[^\n]*?(?:['"`]\s*)?(?:mailto:|tel:|sms:|https?:\/\/|\/\/)/.test(W(j,G,160))},{rule:"fetch",pattern:/new\s+AbortController\s*\(/g,primitive:"useFetch(url) / useAsyncData(key, fn)",why:"cancellation, loading and error state are already wired; hand-rolling them is where the races live"},{rule:"polling",pattern:/setInterval\s*\(/g,primitive:"useEventSource() / useSSE() / useWebSocket() / useChannel()",why:"polling burns requests and lags; the push primitives are delivered",reject:(j,G)=>!/\bfetch\s*\(|\$fetch\b|useFetch\b|\.get\s*\(|axios\b/.test(W(j,G))},{rule:"debounce",pattern:/\bclearTimeout\s*\(/g,primitive:"useDebounce(fn, ms) / useThrottle(fn, ms)",why:"a hand-held timer handle per call site is the usual source of stale-result bugs",requires:(j)=>/setTimeout\s*\(/.test(j)},{rule:"click-outside",pattern:/document\s*\.\s*addEventListener\s*\(\s*['"](?:click|mousedown|pointerdown)['"]/g,primitive:"useClickOutside(ref, fn)",why:"the document-level listener plus the blur race is exactly what this composable exists to remove"},{rule:"focus",pattern:/\.\s*(?:getElementById|querySelector)\s*\([^)]*\)\s*(?:\?\.)?\s*\.?focus\s*\(/g,primitive:"useFocus(ref) with x-ref",why:"a query by id breaks under nested scopes and SPA navigation; a ref does not"},{rule:"clipboard",pattern:/navigator\s*\.\s*(?:clipboard|share)\b/g,primitive:"useClipboard() / useShare()",why:"permission state, the copied flag and the unsupported-browser fallback are already handled"},{rule:"watch",pattern:/\beffect\s*\(\s*\(\s*\)\s*=>\s*\{[^}]*\bvoid\s+\w+\s*\(\s*\)/g,primitive:"watch(source, cb) / watchMultiple([...], cb)",why:"the `void a(); void b()` dance is a manual dependency list; watch takes one directly"}],U=["confirm","tooltip",...v.map((j)=>j.rule)];function N(j,G){let H=1;for(let Q=0;Q<G;Q++)if(j[Q]===`
3
3
  `)H++;return H}function P(j,G){let H=j.lastIndexOf(`
4
4
  `,G)+1,Q=j.indexOf(`
5
5
  `,G);return j.slice(H,Q===-1?j.length:Q).trim().slice(0,120)}function q(j,G){let H=j.slice(0,G),Q=H.lastIndexOf("function"),X=H.lastIndexOf("=>"),M=Math.max(Q,X);if(M===-1)return!1;let z=j.slice(Math.max(0,M-120),M);return/\basync\b[^;{}]*$/.test(z)}function L(j){return/\b(?:async\s+)?function\s+confirm\s*\(/.test(j)||/\b(?:const|let|var)\s+confirm\s*=/.test(j)||/\bimport\s*\{[^}]*\bconfirm\b[^}]*\}/.test(j)}function O(j,G,H){if(L(j))return j;let Q=/(^|[^\w$.])(?:(?:window|globalThis)\s*\.\s*)?confirm\s*\(/g,X=F(j),M="",z=0,Y;while((Y=Q.exec(X))!==null){let Z=Y.index+Y[1].length,$=N(j,Z),J=P(j,Z);if(/stxConfirm\s*\($/.test(j.slice(0,Z+8)))continue;let D=q(j,Z);if(H.push({file:G,line:$,rule:"confirm",applied:D,snippet:J,reason:D?void 0:"stxConfirm() returns a Promise and native confirm() is synchronous, so this needs `await` inside an async function. Rewriting it here would make the condition always true."}),D)M+=j.slice(z,Z)+"await stxConfirm(",z=Z+(Y[0].length-Y[1].length)}return M+j.slice(z)}function w(j,G,H){let Q=/(<[a-z][\w-]*\b[^>]*?)\stitle=(["'])(.*?)\2/gis,X=C(j),M="",z=0,Y;while((Y=Q.exec(X))!==null){let[Z,$,J,D]=Y,K=N(j,Y.index),B=P(j,Y.index),V=$.match(/^<([A-Za-z][\w-]*)/)?.[1]??"";if(/^[A-Z]/.test(V)){H.push({file:G,line:K,rule:"tooltip",applied:!1,snippet:B,reason:`\`title\` on <${V}> is a component prop, not an HTML attribute \u2014 `+"adding x-tooltip here would put a tooltip on a component and may duplicate text it already renders."});continue}if(/\bx-tooltip[=\s]/.test($)||D.trim()===""){H.push({file:G,line:K,rule:"tooltip",applied:!1,snippet:B,reason:/\bx-tooltip[=\s]/.test($)?"already has x-tooltip":"empty title"});continue}H.push({file:G,line:K,rule:"tooltip",applied:!0,snippet:B}),M+=j.slice(z,Y.index)+`${$} x-tooltip=${J}${D}${J} title=${J}${D}${J}`,z=Y.index+Z.length}return M+j.slice(z)}function C(j){return j.replace(/<!--[\s\S]*?-->/g,(G)=>G.replace(/[^\n]/g," ")).replace(/\{\{--[\s\S]*?--\}\}/g,(G)=>G.replace(/[^\n]/g," "))}function E(j){let G=(H)=>H.replace(/[^\n]/g," ");return j.replace(/\/\*[\s\S]*?\*\//g,G).replace(/\/\/[^\n]*/g,G)}function F(j,G=!1){let H=C(j);return(G?E(H):_(H)).replace(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi,(X,M)=>/\bclient\b/i.test(M)?X:X.replace(/[^\n]/g," "))}function S(j,G,H,Q){let X=F(j),M=F(j,!0);for(let z of v){if(!H.includes(z.rule))continue;if(z.requires&&!z.requires(j))continue;z.pattern.lastIndex=0;let Y,Z=/['"]/.test(z.pattern.source)?M:X;z.pattern.lastIndex=0;while((Y=z.pattern.exec(Z))!==null){if(z.reject?.(j,Y.index))continue;Q.push({file:G,line:N(j,Y.index),rule:z.rule,applied:!1,snippet:P(j,Y.index),reason:`${z.primitive} \u2014 ${z.why}`})}}}function k(j,G={}){let H=G.rules??U,Q=G.file??"<source>",X=[];S(j,Q,H,X);let M=j;if(H.includes("confirm"))M=O(M,Q,X);if(H.includes("tooltip"))M=w(M,Q,X);X.sort((Z,$)=>Z.line-$.line);let z=new Set,Y=X.filter((Z)=>{let $=`${Z.rule}:${Z.line}`;if(z.has($))return!1;return z.add($),!0});return{code:M,findings:Y}}var I=new Set(["confirm","tooltip"]);function A(j,G){if(j.length===0)return"No hand-rolled equivalents found.";let H=j.filter((z)=>z.applied),Q=j.filter((z)=>!z.applied&&I.has(z.rule)),X=j.filter((z)=>!z.applied&&!I.has(z.rule)),M=[];if(H.length>0){M.push(G?`Rewrote ${H.length} site(s):`:`Would rewrite ${H.length} site(s) (pass --fix):`);for(let z of H)M.push(` ${z.file}:${z.line} [${z.rule}] ${z.snippet}`)}if(Q.length>0){M.push("",`Needs a human \u2014 ${Q.length} site(s):`);for(let z of Q)M.push(` ${z.file}:${z.line} [${z.rule}] ${z.snippet}
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Yi as a,Zi as b}from"./chunk-qxmywwq5.js";import"./chunk-efr3ejqt.js";import"./chunk-224m1jrf.js";import"./chunk-6z04mpxz.js";import"./chunk-3mbkn6vk.js";import"./chunk-dn8006f7.js";import"./chunk-vg8yh8te.js";import"./chunk-c5rehxqy.js";import"./chunk-xtwybxtw.js";import"./chunk-qfec1s34.js";import"./chunk-kgxkrnyt.js";import"./chunk-3npkbgfm.js";import"./chunk-nqwjb8k7.js";import"./chunk-nx96x8sh.js";import"./chunk-6kdb8j9d.js";import"./chunk-jmh31a2a.js";import"./chunk-d3kac3mv.js";import"./chunk-vwqv8f0y.js";export{a as getStoreScript,b as clearStoreCache};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-24j0qx2z.js";var N=0;function P(){return`eb-${++N}-${Date.now().toString(36)}`}function W(q,z={},A){let j=/@errorBoundary(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@fallback\s*([\s\S]*?)@enderrorBoundary/gi;return q.replace(j,(D,F,J,K)=>{let L=P(),M=Q(F||"");return T(L,J.trim(),K.trim(),M)})}function Q(q){let z={},A=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\w+))/g,j;while((j=A.exec(q))!==null){let D=j[1],F=j[2]||j[3]||j[4];switch(D){case"id":z.id=F;break;case"logErrors":z.logErrors=F==="true";break}}return z}function T(q,z,A,j){let D=j.logErrors!==!1;return`
2
+ import"./chunk-vwqv8f0y.js";var N=0;function P(){return`eb-${++N}-${Date.now().toString(36)}`}function W(q,z={},A){let j=/@errorBoundary(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@fallback\s*([\s\S]*?)@enderrorBoundary/gi;return q.replace(j,(D,F,J,K)=>{let L=P(),M=Q(F||"");return T(L,J.trim(),K.trim(),M)})}function Q(q){let z={},A=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\w+))/g,j;while((j=A.exec(q))!==null){let D=j[1],F=j[2]||j[3]||j[4];switch(D){case"id":z.id=F;break;case"logErrors":z.logErrors=F==="true";break}}return z}function T(q,z,A,j){let D=j.logErrors!==!1;return`
3
3
  <div class="stx-error-boundary" data-boundary-id="${q}" data-has-error="false">
4
4
  <div class="stx-error-boundary-content" data-boundary-content="${q}">
5
5
  ${z}
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{qm as I}from"./chunk-tjverybm.js";import{_r as F,cs as V}from"./chunk-5g1amf33.js";function R(j,W){let U=1,z=W,G="<template",X="</template";while(z<j.length&&U>0){let J=j.indexOf("<",z);if(J===-1)break;if(z=J,j.startsWith(G,z)&&(z+G.length>=j.length||/[\s>\/]/.test(j[z+G.length]))){U++,z+=G.length;continue}if(j.startsWith(X,z)){let Y=j.indexOf(">",z+X.length);if(Y!==-1){if(U--,U===0)return Y+1;z=Y+1;continue}}z++}return U===0?z:-1}var P=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function D(j,W){let U=null;for(let z=W;z<j.length;z++){let G=j[z];if(U){if(G==="\\"){z++;continue}if(G===U)U=null;continue}if(G==='"'||G==="'"){U=G;continue}if(G===">")return z+1}return-1}function b(j){let W=[],U=[],z=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,G=0;while(G<j.length){let X=j.indexOf("<",G);if(X===-1)break;if(j.startsWith("<!--",X)){let $=j.indexOf("-->",X+4);G=$===-1?j.length:$+3;continue}let J=D(j,X+1);if(J===-1)break;let Y=j.slice(X,J),Q=Y.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!Q){G=J;continue}let Z=Q[1]==="/",H=Q[2].toLowerCase();if(Z){let $=U.lastIndexOf(H);if($!==-1)U.splice($);G=J;continue}if(H==="template"&&U.length===0){let $=Y.match(z);if($){let K=R(j,J);if(K!==-1){let O=$[1]||$[2]||$[3];W.push({start:X,end:K,slotName:O,content:j.slice(J,K-11).trim(),propsBinding:$[4]||void 0}),G=K;continue}}}if(!/\/\s*>$/.test(Y)&&!P.has(H)){if(U.push(H),H==="script"||H==="style"){let $=j.toLowerCase().indexOf(`</${H}>`,J);if($!==-1){G=$;continue}}}G=J}return W}function w(j){let W={default:"",named:new Map},U=j,z=b(j);for(let Q of z)W.named.set(Q.slotName,{name:Q.slotName,content:Q.content,propsBinding:Q.propsBinding});z.sort((Q,Z)=>Z.start-Q.start);for(let Q of z)U=U.slice(0,Q.start)+U.slice(Q.end);let G=[],X=/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*?)\bslot="([^"]+)"([^>]*)>([\s\S]*?)<\/\1>/gi,J;while((J=X.exec(U))!==null){let[Q,Z,H,_,$,K]=J,O=H.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),B=$.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),L=(O+B).trim(),q=`<${Z}${L?" "+L:""}>${K}</${Z}>`;G.push({start:J.index,end:J.index+Q.length,slotName:_,element:q})}let Y=/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*?)\bslot="([^"]+)"([^>]*?)\/>/gi;while((J=Y.exec(U))!==null){let[Q,Z,H,_,$]=J,K=H.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),O=$.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),B=(K+O).trim(),L=`<${Z}${B?" "+B:""} />`;G.push({start:J.index,end:J.index+Q.length,slotName:_,element:L})}G.sort((Q,Z)=>Z.start-Q.start);for(let Q of G){let Z=W.named.get(Q.slotName);if(Z)Z.content+=Q.element;else W.named.set(Q.slotName,{name:Q.slotName,content:Q.element});U=U.slice(0,Q.start)+U.slice(Q.end)}return W.default=U.trim(),W}function C(j){let W=j.match(/name\s*=\s*["']([^"']+)["']/),U=W?W[1]:"",z={},G=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,X;while((X=G.exec(j))!==null)z[X[1]]=X[2];let J=j.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),Y=J?J[1].trim():"";return{name:U,props:z,defaultContent:Y}}async function N(j,W,U,z){if(!j)return U;let G=j.content;if(j.propsBinding&&Object.keys(W).length>0){let X=j.propsBinding.trim(),J={...z};if(X.startsWith("{")&&X.endsWith("}")){let Y=X.slice(1,-1).split(",").map((Q)=>Q.trim()).filter(Boolean);for(let Q of Y){let[Z,H]=Q.split(":").map(($)=>$.trim()),_=H||Z;if(W[Z]!==void 0)J[_]=W[Z]}}else J[X]=W;G=k(G,J)}return G}function k(j,W){return j.replace(/\{\{\s*([^}]+)\s*\}\}/g,(U,z)=>{try{let G=z.trim(),X=y(G,W);return I(String(X??""))}catch{return`{{ ${z} }}`}})}function y(j,W){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(j)){let z=j.split("."),G=W;for(let X of z)if(G&&typeof G==="object"&&X in G)G=G[X];else return;return G}let U=j.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(U){let[,z,G,X]=U,J=W[z],Y=parseInt(X,10);if(typeof J==="number")switch(G){case"+":return J+Y;case"-":return J-Y;case"*":return J*Y;case"/":return J/Y}}try{if(!F(j))return;return V(j,Object.keys(W))(...Object.values(W))}catch{return}}async function A(j,W,U){let z=j;z=await v(z,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(J,Y,Q,Z)=>{let H=W.named.get(Y),_=Z?.trim()||"",$=Q||"",K={},O=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,B;while((B=O.exec($))!==null){let L=B[1],q=B[2];K[L]=y(q,U)}return await N(H,K,_,U)});let X=/<slot\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return z=z.replace(X,(J,Y)=>{if(J.includes("name="))return J;let Q=Y?.trim()||"";return W.default||Q}),z}async function v(j,W,U){let z=[],G=[];j.replace(W,(Y,...Q)=>{let Z=Q[Q.length-2];return G.push({match:Y,index:Z}),z.push(U(Y,...Q.slice(0,-2))),Y});let X=await Promise.all(z),J=j;for(let Y=G.length-1;Y>=0;Y--){let{match:Q,index:Z}=G[Y];J=J.slice(0,Z)+X[Y]+J.slice(Z+Q.length)}return J}function E(j){let W=w(j);return{defaultSlot:W.default,namedSlots:W.named}}async function M(j,W,U,z){return await A(j,{default:W,named:U},z)}
2
+ import{rm as I}from"./chunk-6z04mpxz.js";import{$r as F,ds as V}from"./chunk-3mbkn6vk.js";function R(j,W){let U=1,z=W,G="<template",X="</template";while(z<j.length&&U>0){let J=j.indexOf("<",z);if(J===-1)break;if(z=J,j.startsWith(G,z)&&(z+G.length>=j.length||/[\s>\/]/.test(j[z+G.length]))){U++,z+=G.length;continue}if(j.startsWith(X,z)){let Y=j.indexOf(">",z+X.length);if(Y!==-1){if(U--,U===0)return Y+1;z=Y+1;continue}}z++}return U===0?z:-1}var P=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function D(j,W){let U=null;for(let z=W;z<j.length;z++){let G=j[z];if(U){if(G==="\\"){z++;continue}if(G===U)U=null;continue}if(G==='"'||G==="'"){U=G;continue}if(G===">")return z+1}return-1}function b(j){let W=[],U=[],z=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,G=0;while(G<j.length){let X=j.indexOf("<",G);if(X===-1)break;if(j.startsWith("<!--",X)){let $=j.indexOf("-->",X+4);G=$===-1?j.length:$+3;continue}let J=D(j,X+1);if(J===-1)break;let Y=j.slice(X,J),Q=Y.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!Q){G=J;continue}let Z=Q[1]==="/",H=Q[2].toLowerCase();if(Z){let $=U.lastIndexOf(H);if($!==-1)U.splice($);G=J;continue}if(H==="template"&&U.length===0){let $=Y.match(z);if($){let K=R(j,J);if(K!==-1){let O=$[1]||$[2]||$[3];W.push({start:X,end:K,slotName:O,content:j.slice(J,K-11).trim(),propsBinding:$[4]||void 0}),G=K;continue}}}if(!/\/\s*>$/.test(Y)&&!P.has(H)){if(U.push(H),H==="script"||H==="style"){let $=j.toLowerCase().indexOf(`</${H}>`,J);if($!==-1){G=$;continue}}}G=J}return W}function w(j){let W={default:"",named:new Map},U=j,z=b(j);for(let Q of z)W.named.set(Q.slotName,{name:Q.slotName,content:Q.content,propsBinding:Q.propsBinding});z.sort((Q,Z)=>Z.start-Q.start);for(let Q of z)U=U.slice(0,Q.start)+U.slice(Q.end);let G=[],X=/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*?)\bslot="([^"]+)"([^>]*)>([\s\S]*?)<\/\1>/gi,J;while((J=X.exec(U))!==null){let[Q,Z,H,_,$,K]=J,O=H.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),B=$.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),L=(O+B).trim(),q=`<${Z}${L?" "+L:""}>${K}</${Z}>`;G.push({start:J.index,end:J.index+Q.length,slotName:_,element:q})}let Y=/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*?)\bslot="([^"]+)"([^>]*?)\/>/gi;while((J=Y.exec(U))!==null){let[Q,Z,H,_,$]=J,K=H.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),O=$.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),B=(K+O).trim(),L=`<${Z}${B?" "+B:""} />`;G.push({start:J.index,end:J.index+Q.length,slotName:_,element:L})}G.sort((Q,Z)=>Z.start-Q.start);for(let Q of G){let Z=W.named.get(Q.slotName);if(Z)Z.content+=Q.element;else W.named.set(Q.slotName,{name:Q.slotName,content:Q.element});U=U.slice(0,Q.start)+U.slice(Q.end)}return W.default=U.trim(),W}function C(j){let W=j.match(/name\s*=\s*["']([^"']+)["']/),U=W?W[1]:"",z={},G=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,X;while((X=G.exec(j))!==null)z[X[1]]=X[2];let J=j.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),Y=J?J[1].trim():"";return{name:U,props:z,defaultContent:Y}}async function N(j,W,U,z){if(!j)return U;let G=j.content;if(j.propsBinding&&Object.keys(W).length>0){let X=j.propsBinding.trim(),J={...z};if(X.startsWith("{")&&X.endsWith("}")){let Y=X.slice(1,-1).split(",").map((Q)=>Q.trim()).filter(Boolean);for(let Q of Y){let[Z,H]=Q.split(":").map(($)=>$.trim()),_=H||Z;if(W[Z]!==void 0)J[_]=W[Z]}}else J[X]=W;G=k(G,J)}return G}function k(j,W){return j.replace(/\{\{\s*([^}]+)\s*\}\}/g,(U,z)=>{try{let G=z.trim(),X=y(G,W);return I(String(X??""))}catch{return`{{ ${z} }}`}})}function y(j,W){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(j)){let z=j.split("."),G=W;for(let X of z)if(G&&typeof G==="object"&&X in G)G=G[X];else return;return G}let U=j.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(U){let[,z,G,X]=U,J=W[z],Y=parseInt(X,10);if(typeof J==="number")switch(G){case"+":return J+Y;case"-":return J-Y;case"*":return J*Y;case"/":return J/Y}}try{if(!F(j))return;return V(j,Object.keys(W))(...Object.values(W))}catch{return}}async function A(j,W,U){let z=j;z=await v(z,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(J,Y,Q,Z)=>{let H=W.named.get(Y),_=Z?.trim()||"",$=Q||"",K={},O=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,B;while((B=O.exec($))!==null){let L=B[1],q=B[2];K[L]=y(q,U)}return await N(H,K,_,U)});let X=/<slot\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return z=z.replace(X,(J,Y)=>{if(J.includes("name="))return J;let Q=Y?.trim()||"";return W.default||Q}),z}async function v(j,W,U){let z=[],G=[];j.replace(W,(Y,...Q)=>{let Z=Q[Q.length-2];return G.push({match:Y,index:Z}),z.push(U(Y,...Q.slice(0,-2))),Y});let X=await Promise.all(z),J=j;for(let Y=G.length-1;Y>=0;Y--){let{match:Q,index:Z}=G[Y];J=J.slice(0,Z)+X[Y]+J.slice(Z+Q.length)}return J}function E(j){let W=w(j);return{defaultSlot:W.default,namedSlots:W.named}}async function M(j,W,U,z){return await A(j,{default:W,named:U},z)}
3
3
  export{w as Ng,C as Og,N as Pg,A as Qg,E as Rg,M as Sg};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{fr as a,gr as b,hr as c,ir as d,jr as e,kr as f}from"./chunk-6z04mpxz.js";import"./chunk-3mbkn6vk.js";import"./chunk-dn8006f7.js";import"./chunk-vg8yh8te.js";import"./chunk-c5rehxqy.js";import"./chunk-xtwybxtw.js";import"./chunk-qfec1s34.js";import"./chunk-kgxkrnyt.js";import"./chunk-3npkbgfm.js";import"./chunk-nqwjb8k7.js";import"./chunk-nx96x8sh.js";import"./chunk-6kdb8j9d.js";import"./chunk-jmh31a2a.js";import"./chunk-d3kac3mv.js";import"./chunk-vwqv8f0y.js";export{f as validateConfig,b as resolveStxDirectories,c as loadStxConfig,e as defineStxConfig,a as defaultConfig,d as config};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Sl as C}from"./chunk-tjverybm.js";import{$s as Y}from"./chunk-7sdvaras.js";import{au as D}from"./chunk-359ps7j5.js";import u from"path";var S=/<script(\s[^>]*)?>([\s\S]*?)<\/script>/gi;function h(K){let J=(Q)=>Q.replace(/[^\n]/g," ");return K.replace(/<!--[\s\S]*?-->/g,J).replace(/\{\{--[\s\S]*?--\}\}/g,J)}function m(K){let J=[],Q=h(K);S.lastIndex=0;let $;while(($=S.exec(Q))!==null){let j=($[1]||"").trim(),F=($[0].match(/^<script(?:\s[^>]*)?>/i)?.[0]??"<script>").length,z=($[0].match(/<\/script\s*>$/i)?.[0]??"</script>").length,W=$.index+F,Z=$.index+$[0].length-z,G=K.slice(W,Z);if(/\bsrc\s*=/.test(j))continue;let q=j.match(/\btype\s*=\s*["']([^"']+)["']/i);if(q&&!/^(?:module|text\/(?:javascript|typescript))$/i.test(q[1]))continue;let X=/\bserver\b/.test(j)?"server":/\bclient\b/.test(j)?"client":"plain",U=B(K,W);J.push({kind:X,code:G,startLine:U,attrs:j})}return J}function B(K,J){let Q=1;for(let $=0;$<J&&$<K.length;$++)if(K.charCodeAt($)===10)Q++;return Q}function N(K,J){let Q=K.lastIndexOf(`
2
+ import{Tl as C}from"./chunk-6z04mpxz.js";import{at as Y}from"./chunk-c5rehxqy.js";import{bu as D}from"./chunk-6kdb8j9d.js";import u from"path";var S=/<script(\s[^>]*)?>([\s\S]*?)<\/script>/gi;function h(K){let J=(Q)=>Q.replace(/[^\n]/g," ");return K.replace(/<!--[\s\S]*?-->/g,J).replace(/\{\{--[\s\S]*?--\}\}/g,J)}function m(K){let J=[],Q=h(K);S.lastIndex=0;let $;while(($=S.exec(Q))!==null){let j=($[1]||"").trim(),F=($[0].match(/^<script(?:\s[^>]*)?>/i)?.[0]??"<script>").length,z=($[0].match(/<\/script\s*>$/i)?.[0]??"</script>").length,W=$.index+F,Z=$.index+$[0].length-z,G=K.slice(W,Z);if(/\bsrc\s*=/.test(j))continue;let q=j.match(/\btype\s*=\s*["']([^"']+)["']/i);if(q&&!/^(?:module|text\/(?:javascript|typescript))$/i.test(q[1]))continue;let X=/\bserver\b/.test(j)?"server":/\bclient\b/.test(j)?"client":"plain",U=B(K,W);J.push({kind:X,code:G,startLine:U,attrs:j})}return J}function B(K,J){let Q=1;for(let $=0;$<J&&$<K.length;$++)if(K.charCodeAt($)===10)Q++;return Q}function N(K,J){let Q=K.lastIndexOf(`
3
3
  `,J-1)+1;return J-Q+1}function g(K){let J=K.split(""),Q=(j,F)=>{for(let z=j;z<F&&z<J.length;z++)if(J[z]!==`
4
4
  `)J[z]=" "},$=[/<script(?:\s[^>]*)?>[\s\S]*?<\/script>/gi,/<style(?:\s[^>]*)?>[\s\S]*?<\/style>/gi,/<!--[\s\S]*?-->/g,/\{\{--[\s\S]*?--\}\}/g,/@verbatim\b[\s\S]*?@endverbatim\b/g];for(let j of $){j.lastIndex=0;let F;while((F=j.exec(K))!==null)Q(F.index,F.index+F[0].length)}return J.join("")}function p(K){let J=0,Q="";for(let $=0;$<K.length;$++){let j=K[$];if(Q){if(j==="\\"){$++;continue}if(j===Q)Q="";continue}if(j==='"'||j==="'"||j==="`"){Q=j;continue}if(j==="("||j==="["||j==="{"){J++;continue}if(j===")"||j==="]"||j==="}"){J--;continue}if(j==="|"&&J===0){if(K[$+1]==="|"){$++;continue}if(K[$-1]==="|")continue;return K.slice(0,$)}}return K}var R=new Set([":for","x-for","v-for"]),w=/(?:^|\s)((?::|x-|v-|@)[\w.:-]+)\s*=\s*(["'])([\s\S]*?)\2/g,O="__stx_interpolated",y="__StxElement",f="__StxTemplateValue",l=`type ${f}<T> = T extends { readonly _isSignal: true } | { readonly _isDerived: true } ? (T extends () => infer V ? T & V : T) : T`;function L(K){return K.replace(/\{\{[\s\S]*?\}\}/g,O).replace(/\{!![\s\S]*?!!\}/g,O)}function Vj(K){return K.replace(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/g,(J)=>{let Q=J.split(`
5
5
  `).length-1,$=J.length-Q;return`0${" ".repeat(Math.max(0,$-1))}${`
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Pf as a,Qf as b}from"./chunk-mjpqz66q.js";import"./chunk-24j0qx2z.js";export{b as captureScreenshots,a as captureScreenshot};
2
+ import{Pf as a,Qf as b}from"./chunk-mjpqz66q.js";import"./chunk-vwqv8f0y.js";export{b as captureScreenshots,a as captureScreenshot};
@@ -8,4 +8,4 @@ function N(D,G){let j=D[G],F=G+1;while(F<D.length){if(D[F]==="\\"){F+=2;continue
8
8
  `:" ",j++}G+=" ",j++;continue}if(H==="`"){G+=" ",j++;while(j<D.length&&D[j]!=="`"){if(D[j]==="\\"){G+=" ",j+=2;continue}if(D[j]==="$"&&D[j+1]==="{"){let J=j+2,K=M(D,J);if(G+=" ",G+=R(D.slice(J,K)),K<D.length)G+=" ";j=K+1;continue}G+=D[j]===`
9
9
  `?`
10
10
  `:" ",j++}G+=" ",j++;continue}G+=H,j++}return G}function U(D){let G=new Uint16Array(D.length),j=0,F=!0;for(let H=0;H<D.length;H++){let J=D[H];if(J===")"||J==="]"||J==="}")if(j===0)F=!1;else j--;if(G[H]=j,J==="("||J==="["||J==="{")j++}return{depths:G,balanced:F&&j===0}}
11
- export{M as _s,R as $s,U as at};
11
+ export{M as $s,R as at,U as bt};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Kg as a,Lg as b}from"./chunk-vrhp2xnm.js";import"./chunk-pfwhd5xs.js";import"./chunk-vwqv8f0y.js";export{a as handleImageRequest,b as createImageHandler};
@@ -299,4 +299,4 @@ catch (error) {
299
299
  }
300
300
  })();
301
301
  </script>`}var N={name:"pwa.installButton",handler:(j,z,k,E)=>{let q=k.__stx_options||{};return H(j,q)},hasEndTag:!0,description:"Renders a PWA install prompt button that appears when the app can be installed"},Q={name:"pwa.updatePrompt",handler:(j,z,k,E)=>{let q=k.__stx_options||{};return J(j,q)},hasEndTag:!0,description:"Renders a PWA update notification UI when a new version is available"},T={name:"pwa.offlineIndicator",handler:(j,z,k,E)=>{let q=k.__stx_options||{};return L(j,q)},hasEndTag:!0,description:"Renders an offline status indicator that shows when the user loses connection"},V={name:"pwa.pushSubscribe",handler:(j,z,k,E)=>{let q=k.__stx_options||{};return M(j,q)},hasEndTag:!0,description:"Renders a push notification subscription button"},X=[N,Q,T,V];function Z(j){return[...j,...X]}
302
- export{N as dv,Q as ev,T as fv,V as gv,X as hv,Z as iv};
302
+ export{N as ev,Q as fv,T as gv,V as hv,X as iv,Z as jv};
@@ -144,4 +144,4 @@ var N=new Map,Q=new Map;function T(A){if(N.set(A.name,A),A.client)Q.set(A.name,A
144
144
  console.log('[stx] Directive runtime initialized');
145
145
  })();
146
146
  `}function $(A){let B=/v-(\w+)(?::(\w+))?(?:\.([\w.]+))?="([^"]*)"/g;return A.replace(B,(C,F,H,L,J)=>{let E=(L?L.split("."):[]).reduce((M,S)=>{return M[S]=!0,M},{});return`data-stx-directive="${F}:${J}" data-stx-directive-arg="${H||""}" data-stx-directive-modifiers='${JSON.stringify(E)}'`})}
147
- export{T as Ps,V as Qs,W as Rs,X as Ss,G as Ts,Y as Us,Z as Vs,_ as Ws,$ as Xs};
147
+ export{T as Qs,V as Rs,W as Ss,X as Ts,G as Us,Y as Vs,Z as Ws,_ as Xs,$ as Ys};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Am as o,mm as a,nm as b,om as c,pm as d,qm as e,rm as f,sm as g,tm as h,um as i,vm as j,wm as k,xm as l,ym as m,zm as n}from"./chunk-6z04mpxz.js";import"./chunk-3mbkn6vk.js";import"./chunk-dn8006f7.js";import"./chunk-vg8yh8te.js";import"./chunk-c5rehxqy.js";import"./chunk-xtwybxtw.js";import"./chunk-qfec1s34.js";import"./chunk-kgxkrnyt.js";import"./chunk-3npkbgfm.js";import"./chunk-nqwjb8k7.js";import"./chunk-nx96x8sh.js";import"./chunk-6kdb8j9d.js";import"./chunk-jmh31a2a.js";import"./chunk-d3kac3mv.js";import"./chunk-vwqv8f0y.js";export{h as usesSignalsInScript,o as unescapeHtml,c as registerFilters,b as registerFilter,l as processExpressions,k as interpolateScriptsInTemplate,i as interpolateScriptExpressions,j as interpolateScriptAttributes,d as getAllFilters,n as evaluateExpression,g as escapeHtmlValue,f as escapeHtml,a as defaultFilters,e as clearCustomFilters,m as applyFilters};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{$e as K5,_e as _$}from"./chunk-9mzj4q5k.js";import{Yf as y7,ag as U$,bg as q6,dg as Z1,eg as y6,fg as Q5,gg as B$,hg as L$,ig as v6,jg as g6}from"./chunk-d2rhtvxx.js";import{Aj as p5,Cj as c5,vj as u1,wj as O1,xj as H1,yj as m$,zj as p$}from"./chunk-fed3xsp9.js";import{Xj as Y$,Yj as J$}from"./chunk-h1tkqfym.js";import{Ak as f5,zk as g5}from"./chunk-cjhwpp4c.js";import{Gk as l7,Hk as i7}from"./chunk-xtx53xyz.js";import{$k as Q1}from"./chunk-9rgwpt1m.js";import{Eo as m0,Hm as x6,Jp as O0,Lm as Z5,Om as N1,Pm as M1,Sn as Z$,Tq as G$,Xp as Q6,Yp as E1,aq as p0,bo as X5,cm as b7,do as S6,eo as z6,er as E$,fp as g7,gr as d0,hr as M0,lr as V0,mp as P6,np as b6,qm as u0,wo as j0}from"./chunk-tjverybm.js";import{$r as X6,Er as s$,Gr as n$,Jr as l1,Nr as o$,Qr as Q$,Rr as F6,tr as c1,wr as L6}from"./chunk-5g1amf33.js";import{At as o,gt as t$,ot as B,vt as W$,wt as K$}from"./chunk-br48y7q9.js";import{Ft as S0}from"./chunk-ja39jznm.js";import{Du as V6,Eu as E6,Tu as R6,Uu as I6,Vu as D6,Wu as w6,Xu as T6,Yu as C6,_u as k6,cv as A6,yu as $5,zu as H6}from"./chunk-64d20kkv.js";import{mv as p}from"./chunk-24j0qx2z.js";var l5={read:($)=>{try{return JSON.parse($)}catch{return $}},write:($)=>{return JSON.stringify($)}};function e7($,X,Q={}){let{storage:Z="local",serializer:Y=l5,mergeDefaults:J=!1,listenToStorageChanges:G=!0}=Q,W=new Set,K=typeof window<"u",_=()=>{if(!K)return null;return Z==="session"?sessionStorage:localStorage},U=()=>{let L=_();if(!L)return X;try{let H=L.getItem($);if(H===null)return X;let q=Y.read(H);if(J&&typeof X==="object"&&X!==null)return{...X,...q};return q}catch{return X}},F=(L)=>{let H=_();if(!H)return;try{if(L===null||L===void 0)H.removeItem($);else H.setItem($,Y.write(L))}catch(q){console.warn(`[useStorage] Failed to write key "${$}":`,q)}},z=U(),j=(L,H)=>{for(let q of W)try{q(L,H)}catch(A){console.error("[useStorage] Subscriber error:",A)}};if(K&&G){let L=(q)=>{if(q.key===$&&q.storageArea===_()){let A=z;try{z=q.newValue?Y.read(q.newValue):X}catch(N){console.warn(`[useStorage] Failed to read key "${$}" from a cross-tab update:`,N);return}j(z,A)}};window.addEventListener("storage",L);let H=globalThis.onDestroy;if(typeof H==="function")H(()=>window.removeEventListener("storage",L))}let O={get value(){return z},set value(L){let H=z;z=L,F(L),j(L,H)},get:()=>z,set:(L)=>{O.value=L},remove:()=>{let L=_();if(L){L.removeItem($);let H=z;z=X,j(X,H)}},subscribe:(L)=>{return W.add(L),L(z,void 0),()=>W.delete(L)}};return O}function i5($,X,Q,Z,Y={}){let{serializer:J=l5,mergeDefaults:G=!1,listenToStorageChanges:W=!0}=Y,K=typeof window<"u",_=()=>{if(!K)return null;return $==="session"?sessionStorage:localStorage},U=(j)=>{if(j===null||j===void 0)return Z;try{let O=J.read(j);if(G&&typeof Z==="object"&&Z!==null)return{...Z,...O};return O}catch(O){return console.warn(`[${X}] Failed to read key "${Q}":`,O),Z}},z=p5((()=>{let j=_();if(!j)return Z;try{return U(j.getItem(Q))}catch(O){return console.warn(`[${X}] Cannot read "${Q}":`,O),Z}})());if(c5(()=>{let j=z(),O=_();if(!O)return;try{if(j===null||j===void 0)O.removeItem(Q);else O.setItem(Q,J.write(j))}catch(L){console.warn(`[${X}] Cannot persist "${Q}":`,L)}}),K&&W){let j=(L)=>{if(L.key!==Q)return;if(L.storageArea&&L.storageArea!==_())return;z.set(U(L.newValue))};window.addEventListener("storage",j);let O=globalThis.onDestroy;if(typeof O==="function")O(()=>window.removeEventListener("storage",j))}return z}function $3($,X,Q){return i5("local","useLocalStorage",$,X,Q)}function X3($,X,Q){return i5("session","useSessionStorage",$,X,Q)}function Q3($="local"){if(typeof window>"u")return;($==="session"?sessionStorage:localStorage).clear()}function Z3($="local"){if(typeof window>"u")return[];let X=$==="session"?sessionStorage:localStorage;return Object.keys(X)}function Y3($="local"){if(typeof window>"u")return 0;let X=$==="session"?sessionStorage:localStorage,Q=0;for(let Z in X)if(Object.prototype.hasOwnProperty.call(X,Z))Q+=(Z.length+(X.getItem(Z)?.length||0))*2;return Q}var l=null;function d1($,X,Q=new WeakSet){if(Object.is($,X))return!0;if(typeof $!=="object"||typeof X!=="object"||$===null||X===null)return!1;if(Q.has($))return!0;if(Q.add($),$ instanceof Date&&X instanceof Date)return $.getTime()===X.getTime();if($ instanceof RegExp&&X instanceof RegExp)return $.source===X.source&&$.flags===X.flags;if(Array.isArray($)){if(!Array.isArray(X)||$.length!==X.length)return!1;for(let J=0;J<$.length;J++)if(!d1($[J],X[J],Q))return!1;return!0}if(Array.isArray(X))return!1;if($ instanceof Map){if(!(X instanceof Map)||$.size!==X.size)return!1;for(let[J,G]of $)if(!X.has(J)||!d1(G,X.get(J),Q))return!1;return!0}if(X instanceof Map)return!1;if($ instanceof Set){if(!(X instanceof Set)||$.size!==X.size)return!1;for(let J of $)if(!X.has(J))return!1;return!0}if(X instanceof Set)return!1;let Z=Object.keys($),Y=Object.keys(X);if(Z.length!==Y.length)return!1;for(let J of Z){if(!Object.prototype.hasOwnProperty.call(X,J))return!1;if(!d1($[J],X[J],Q))return!1}return!0}function KJ($){l=$}function _J(){return l}function UJ(){return{isMounted:!1,isUnmounted:!1,hooks:{beforeMount:[],mounted:[],beforeUpdate:[],updated:[],beforeUnmount:[],unmounted:[]},effects:[],scope:J3()}}function J3(){return{refs:new Map,effects:new Set,cleanups:[]}}function BJ($){let X=new Set,Q=new Set,Z=$,Y=Symbol("ref"),J={get value(){let G=u1();if(G)Q.add(G);return Z},set value(G){if(!Object.is(G,Z)){let W=Z;Z=G;for(let K of X)K(G,W);for(let K of Q)if(m$())p$(K);else K()}},subscribe(G){return X.add(G),()=>{X.delete(G)}}};if(l)l.scope.refs.set(Y,J);return J}var a5=new WeakMap;function G3($){let X=a5.get($);if(X)return X;let Q=new Map,Z=(G)=>{let W=Q.get(G);if(!W)return;for(let K of[...W])if(m$())p$(K);else K()},Y=(G,W)=>{if(!Q.has(G))Q.set(G,new Set);return Q.get(G).add(W),()=>{Q.get(G)?.delete(W)}},J=new Proxy($,{get(G,W,K){let _=Reflect.get(G,W,K),U=u1();if(U)Y(W,U);if(_!==null&&typeof _==="object"&&!Array.isArray(_)){let F=Object.getPrototypeOf(_);if(F===Object.prototype||F===null)return G3(_)}return _},set(G,W,K,_){let U=Reflect.get(G,W,_),F=Reflect.set(G,W,K,_);if(!Object.is(K,U))Z(W);return F},deleteProperty(G,W){let K=Reflect.deleteProperty(G,W);return Z(W),K}});return a5.set($,J),J}function LJ($){let X,Q=!0,Z=new Set,Y=new Set,J=()=>{Q=!0,G()},G=()=>{if(Q){let K=X,_=O1(J);if(X=$(),H1(_),Q=!1,!Object.is(X,K)){for(let U of Z)U(X,K);for(let U of Y)U()}}},W=O1(J);return X=$(),Q=!1,H1(W),{get value(){let K=u1();if(K)Y.add(K);return G(),X},set value(K){console.warn("[stx] Computed properties are readonly")},subscribe(K){return Z.add(K),()=>{Z.delete(K)}}}}function W3($){if(typeof requestAnimationFrame==="function"){requestAnimationFrame(()=>{requestAnimationFrame($)});return}setTimeout($,0)}function FJ($,X,Q={}){let{immediate:Z=!1,deep:Y=!1,flush:J="post"}=Q,G,W,K=!1,_=()=>{if(K)return;let O=j();if((Y?!d1(O,G):!Object.is(O,G))||Z)if(X(O,G),Y&&O!==null&&typeof O==="object")try{G=structuredClone(O)}catch{G=O}else G=O},U=(O)=>{if(J==="sync")O();else if(J==="pre")Promise.resolve().then(O);else W3(O)},F=!1,z=()=>{if(K||F)return;F=!0,U(()=>{F=!1,_()})},j=()=>{if(typeof $==="function"){let O=O1(z);try{return $()}finally{H1(O)}}return $.value};if(typeof $!=="function"){let O=$.subscribe(()=>{U(_)});W=()=>{K=!0,O()}}else W=()=>{K=!0};if(G=j(),Z)U(_);if(l)l.scope.cleanups.push(()=>W?.());return()=>W?.()}function zJ($,X,Q={}){let Z=[],Y=$.map((J)=>J.value);for(let J of $){let G=J.subscribe(()=>{let W=$.map((K)=>K.value);X(W,Y),Y=[...W]});Z.push(G)}if(Q.immediate){let J=$.map((G)=>G.value);X(J,Y)}return()=>{for(let J of Z)J()}}function jJ($){let X,Q=!1,Z=()=>{if(Q)return;if(X)X();let Y=O1(Z);X=$(),H1(Y)};if(Z(),l)l.scope.cleanups.push(()=>{if(Q=!0,X)X()});return()=>{if(Q=!0,X)X()}}function OJ($){if(l)l.hooks.beforeMount.push($);else console.warn("[stx] onBeforeMount called outside of component setup")}function HJ($){if(l)l.hooks.mounted.push($);else console.warn("[stx] onMounted called outside of component setup")}function AJ($){if(l)l.hooks.beforeUpdate.push($);else console.warn("[stx] onBeforeUpdate called outside of component setup")}function qJ($){if(l)l.hooks.updated.push($);else console.warn("[stx] onUpdated called outside of component setup")}function NJ($){if(l)l.hooks.beforeUnmount.push($);else console.warn("[stx] onBeforeUnmount called outside of component setup")}function MJ($){if(l)l.hooks.unmounted.push($);else console.warn("[stx] onUnmounted called outside of component setup")}async function n0($,X){let Q=$.hooks[X];for(let Z of Q)await Z()}async function VJ($){await n0($,"beforeMount"),$.isMounted=!0,await n0($,"mounted")}async function EJ($){if(!$.isMounted||$.isUnmounted)return;await n0($,"beforeUpdate"),await n0($,"updated")}async function RJ($){if($.isUnmounted)return;await n0($,"beforeUnmount");for(let X of $.scope.cleanups)X();$.isUnmounted=!0,await n0($,"unmounted")}function IJ(){return`
2
+ import{$e as K5,_e as _$}from"./chunk-6tzzh1dg.js";import{Yf as y7,ag as U$,bg as q6,dg as Z1,eg as y6,fg as Q5,gg as B$,hg as L$,ig as v6,jg as g6}from"./chunk-tt50t72e.js";import{Aj as p5,Cj as c5,vj as u1,wj as O1,xj as H1,yj as m$,zj as p$}from"./chunk-fed3xsp9.js";import{Xj as Y$,Yj as J$}from"./chunk-03mc9wc9.js";import{Ak as f5,zk as g5}from"./chunk-wvxce7p4.js";import{Gk as l7,Hk as i7}from"./chunk-xtx53xyz.js";import{$k as Q1}from"./chunk-224m1jrf.js";import{Fo as m0,Im as x6,Kp as O0,Mm as Z5,Pm as N1,Qm as M1,Tn as Z$,Uq as G$,Yp as Q6,Zp as E1,bq as p0,co as X5,dm as b7,eo as S6,fo as z6,fr as E$,gp as g7,hr as d0,ir as M0,mr as V0,np as P6,op as b6,rm as u0,xo as j0}from"./chunk-6z04mpxz.js";import{Fr as s$,Hr as n$,Kr as l1,Or as o$,Rr as Q$,Sr as F6,as as X6,ur as c1,xr as L6}from"./chunk-3mbkn6vk.js";import{Bt as o,ht as t$,pt as B,wt as W$,xt as K$}from"./chunk-qfec1s34.js";import{Gt as S0}from"./chunk-kgxkrnyt.js";import{$u as k6,Au as H6,Eu as V6,Fu as E6,Uu as R6,Vu as I6,Wu as D6,Xu as w6,Yu as T6,Zu as C6,dv as A6,zu as $5}from"./chunk-jmh31a2a.js";import{nv as p}from"./chunk-vwqv8f0y.js";var l5={read:($)=>{try{return JSON.parse($)}catch{return $}},write:($)=>{return JSON.stringify($)}};function e7($,X,Q={}){let{storage:Z="local",serializer:Y=l5,mergeDefaults:J=!1,listenToStorageChanges:G=!0}=Q,W=new Set,K=typeof window<"u",_=()=>{if(!K)return null;return Z==="session"?sessionStorage:localStorage},U=()=>{let L=_();if(!L)return X;try{let H=L.getItem($);if(H===null)return X;let q=Y.read(H);if(J&&typeof X==="object"&&X!==null)return{...X,...q};return q}catch{return X}},F=(L)=>{let H=_();if(!H)return;try{if(L===null||L===void 0)H.removeItem($);else H.setItem($,Y.write(L))}catch(q){console.warn(`[useStorage] Failed to write key "${$}":`,q)}},z=U(),j=(L,H)=>{for(let q of W)try{q(L,H)}catch(A){console.error("[useStorage] Subscriber error:",A)}};if(K&&G){let L=(q)=>{if(q.key===$&&q.storageArea===_()){let A=z;try{z=q.newValue?Y.read(q.newValue):X}catch(N){console.warn(`[useStorage] Failed to read key "${$}" from a cross-tab update:`,N);return}j(z,A)}};window.addEventListener("storage",L);let H=globalThis.onDestroy;if(typeof H==="function")H(()=>window.removeEventListener("storage",L))}let O={get value(){return z},set value(L){let H=z;z=L,F(L),j(L,H)},get:()=>z,set:(L)=>{O.value=L},remove:()=>{let L=_();if(L){L.removeItem($);let H=z;z=X,j(X,H)}},subscribe:(L)=>{return W.add(L),L(z,void 0),()=>W.delete(L)}};return O}function i5($,X,Q,Z,Y={}){let{serializer:J=l5,mergeDefaults:G=!1,listenToStorageChanges:W=!0}=Y,K=typeof window<"u",_=()=>{if(!K)return null;return $==="session"?sessionStorage:localStorage},U=(j)=>{if(j===null||j===void 0)return Z;try{let O=J.read(j);if(G&&typeof Z==="object"&&Z!==null)return{...Z,...O};return O}catch(O){return console.warn(`[${X}] Failed to read key "${Q}":`,O),Z}},z=p5((()=>{let j=_();if(!j)return Z;try{return U(j.getItem(Q))}catch(O){return console.warn(`[${X}] Cannot read "${Q}":`,O),Z}})());if(c5(()=>{let j=z(),O=_();if(!O)return;try{if(j===null||j===void 0)O.removeItem(Q);else O.setItem(Q,J.write(j))}catch(L){console.warn(`[${X}] Cannot persist "${Q}":`,L)}}),K&&W){let j=(L)=>{if(L.key!==Q)return;if(L.storageArea&&L.storageArea!==_())return;z.set(U(L.newValue))};window.addEventListener("storage",j);let O=globalThis.onDestroy;if(typeof O==="function")O(()=>window.removeEventListener("storage",j))}return z}function $3($,X,Q){return i5("local","useLocalStorage",$,X,Q)}function X3($,X,Q){return i5("session","useSessionStorage",$,X,Q)}function Q3($="local"){if(typeof window>"u")return;($==="session"?sessionStorage:localStorage).clear()}function Z3($="local"){if(typeof window>"u")return[];let X=$==="session"?sessionStorage:localStorage;return Object.keys(X)}function Y3($="local"){if(typeof window>"u")return 0;let X=$==="session"?sessionStorage:localStorage,Q=0;for(let Z in X)if(Object.prototype.hasOwnProperty.call(X,Z))Q+=(Z.length+(X.getItem(Z)?.length||0))*2;return Q}var l=null;function d1($,X,Q=new WeakSet){if(Object.is($,X))return!0;if(typeof $!=="object"||typeof X!=="object"||$===null||X===null)return!1;if(Q.has($))return!0;if(Q.add($),$ instanceof Date&&X instanceof Date)return $.getTime()===X.getTime();if($ instanceof RegExp&&X instanceof RegExp)return $.source===X.source&&$.flags===X.flags;if(Array.isArray($)){if(!Array.isArray(X)||$.length!==X.length)return!1;for(let J=0;J<$.length;J++)if(!d1($[J],X[J],Q))return!1;return!0}if(Array.isArray(X))return!1;if($ instanceof Map){if(!(X instanceof Map)||$.size!==X.size)return!1;for(let[J,G]of $)if(!X.has(J)||!d1(G,X.get(J),Q))return!1;return!0}if(X instanceof Map)return!1;if($ instanceof Set){if(!(X instanceof Set)||$.size!==X.size)return!1;for(let J of $)if(!X.has(J))return!1;return!0}if(X instanceof Set)return!1;let Z=Object.keys($),Y=Object.keys(X);if(Z.length!==Y.length)return!1;for(let J of Z){if(!Object.prototype.hasOwnProperty.call(X,J))return!1;if(!d1($[J],X[J],Q))return!1}return!0}function KJ($){l=$}function _J(){return l}function UJ(){return{isMounted:!1,isUnmounted:!1,hooks:{beforeMount:[],mounted:[],beforeUpdate:[],updated:[],beforeUnmount:[],unmounted:[]},effects:[],scope:J3()}}function J3(){return{refs:new Map,effects:new Set,cleanups:[]}}function BJ($){let X=new Set,Q=new Set,Z=$,Y=Symbol("ref"),J={get value(){let G=u1();if(G)Q.add(G);return Z},set value(G){if(!Object.is(G,Z)){let W=Z;Z=G;for(let K of X)K(G,W);for(let K of Q)if(m$())p$(K);else K()}},subscribe(G){return X.add(G),()=>{X.delete(G)}}};if(l)l.scope.refs.set(Y,J);return J}var a5=new WeakMap;function G3($){let X=a5.get($);if(X)return X;let Q=new Map,Z=(G)=>{let W=Q.get(G);if(!W)return;for(let K of[...W])if(m$())p$(K);else K()},Y=(G,W)=>{if(!Q.has(G))Q.set(G,new Set);return Q.get(G).add(W),()=>{Q.get(G)?.delete(W)}},J=new Proxy($,{get(G,W,K){let _=Reflect.get(G,W,K),U=u1();if(U)Y(W,U);if(_!==null&&typeof _==="object"&&!Array.isArray(_)){let F=Object.getPrototypeOf(_);if(F===Object.prototype||F===null)return G3(_)}return _},set(G,W,K,_){let U=Reflect.get(G,W,_),F=Reflect.set(G,W,K,_);if(!Object.is(K,U))Z(W);return F},deleteProperty(G,W){let K=Reflect.deleteProperty(G,W);return Z(W),K}});return a5.set($,J),J}function LJ($){let X,Q=!0,Z=new Set,Y=new Set,J=()=>{Q=!0,G()},G=()=>{if(Q){let K=X,_=O1(J);if(X=$(),H1(_),Q=!1,!Object.is(X,K)){for(let U of Z)U(X,K);for(let U of Y)U()}}},W=O1(J);return X=$(),Q=!1,H1(W),{get value(){let K=u1();if(K)Y.add(K);return G(),X},set value(K){console.warn("[stx] Computed properties are readonly")},subscribe(K){return Z.add(K),()=>{Z.delete(K)}}}}function W3($){if(typeof requestAnimationFrame==="function"){requestAnimationFrame(()=>{requestAnimationFrame($)});return}setTimeout($,0)}function FJ($,X,Q={}){let{immediate:Z=!1,deep:Y=!1,flush:J="post"}=Q,G,W,K=!1,_=()=>{if(K)return;let O=j();if((Y?!d1(O,G):!Object.is(O,G))||Z)if(X(O,G),Y&&O!==null&&typeof O==="object")try{G=structuredClone(O)}catch{G=O}else G=O},U=(O)=>{if(J==="sync")O();else if(J==="pre")Promise.resolve().then(O);else W3(O)},F=!1,z=()=>{if(K||F)return;F=!0,U(()=>{F=!1,_()})},j=()=>{if(typeof $==="function"){let O=O1(z);try{return $()}finally{H1(O)}}return $.value};if(typeof $!=="function"){let O=$.subscribe(()=>{U(_)});W=()=>{K=!0,O()}}else W=()=>{K=!0};if(G=j(),Z)U(_);if(l)l.scope.cleanups.push(()=>W?.());return()=>W?.()}function zJ($,X,Q={}){let Z=[],Y=$.map((J)=>J.value);for(let J of $){let G=J.subscribe(()=>{let W=$.map((K)=>K.value);X(W,Y),Y=[...W]});Z.push(G)}if(Q.immediate){let J=$.map((G)=>G.value);X(J,Y)}return()=>{for(let J of Z)J()}}function jJ($){let X,Q=!1,Z=()=>{if(Q)return;if(X)X();let Y=O1(Z);X=$(),H1(Y)};if(Z(),l)l.scope.cleanups.push(()=>{if(Q=!0,X)X()});return()=>{if(Q=!0,X)X()}}function OJ($){if(l)l.hooks.beforeMount.push($);else console.warn("[stx] onBeforeMount called outside of component setup")}function HJ($){if(l)l.hooks.mounted.push($);else console.warn("[stx] onMounted called outside of component setup")}function AJ($){if(l)l.hooks.beforeUpdate.push($);else console.warn("[stx] onBeforeUpdate called outside of component setup")}function qJ($){if(l)l.hooks.updated.push($);else console.warn("[stx] onUpdated called outside of component setup")}function NJ($){if(l)l.hooks.beforeUnmount.push($);else console.warn("[stx] onBeforeUnmount called outside of component setup")}function MJ($){if(l)l.hooks.unmounted.push($);else console.warn("[stx] onUnmounted called outside of component setup")}async function n0($,X){let Q=$.hooks[X];for(let Z of Q)await Z()}async function VJ($){await n0($,"beforeMount"),$.isMounted=!0,await n0($,"mounted")}async function EJ($){if(!$.isMounted||$.isUnmounted)return;await n0($,"beforeUpdate"),await n0($,"updated")}async function RJ($){if($.isUnmounted)return;await n0($,"beforeUnmount");for(let X of $.scope.cleanups)X();$.isUnmounted=!0,await n0($,"unmounted")}function IJ(){return`
3
3
  <script data-stx-client-runtime>
4
4
  (function() {
5
5
  'use strict';
@@ -685,7 +685,7 @@ else {
685
685
  <span class="frontmatter-label">${X}:</span>
686
686
  <span>${Array.isArray(Q)?Q.join(", "):String(Q)}</span>
687
687
  </div>`).join("")}
688
- </div>`}import U6 from"net";async function J4($){return new Promise((X)=>{let Q=U6.createServer();Q.once("error",()=>X(!1)),Q.once("listening",()=>{Q.close(()=>X(!0))}),Q.listen($,"0.0.0.0")})}async function G4($){return new Promise((X)=>{let Q=U6.createServer();Q.once("error",()=>X(!1)),Q.once("listening",()=>{Q.close(()=>X(!0))}),Q.listen($,"::")})}async function W4($){if(!await J4($))return!1;return await G4($)}async function k0($,X=20){$=Number($);for(let Q=0;Q<X;Q++){let Z=$+Q;if(await W4(Z))return Z}throw Error(`Could not find an available port between ${$} and ${$+X-1}`)}var K4={title:"stx Development",width:1400,height:900,darkMode:!0,hotReload:!0,titlebarHidden:!1,nativeSidebar:!1,sidebarWidth:260,sidebarConfig:void 0};async function _4(){try{let $=await import("./chunk-n0hgshd5.js");if(typeof $.openDevWindow!=="function")return null;return $}catch{return null}}async function t0($,X={}){let Q={...K4,...X},Z=await _4();if(!Z)return console.log(`${B.yellow}\u26A0${B.reset} Native window requested, but @stacksjs/desktop is not available.`),console.log(" Install & build the desktop package to enable --native."),!1;try{let Y=await Z.openDevWindow($,{title:Q.title,width:Q.width,height:Q.height,darkMode:Q.darkMode,hotReload:Q.hotReload,titlebarHidden:Q.titlebarHidden,nativeSidebar:Q.nativeSidebar,sidebarWidth:Q.sidebarWidth,sidebarConfig:Q.sidebarConfig});if(Y&&Q.nativeSidebar)console.log(`${B.green}\u2713${B.reset} Native sidebar enabled (macOS Tahoe style)`);return Y}catch(Y){return console.log(`${B.red}\u2717${B.reset} Could not open native window:`,Y),!1}}function o1($){if($.match(/<Sidebar[\s\S]*?variant=["'](?:tahoe|vibrancy|desktop)["'][\s\S]*?\/>/i)){let Y=$.match(/<script\s+server[^>]*>([\s\S]*?)<\/script>/i);if(Y){let J=Y[1];try{let G=`
688
+ </div>`}import U6 from"net";async function J4($){return new Promise((X)=>{let Q=U6.createServer();Q.once("error",()=>X(!1)),Q.once("listening",()=>{Q.close(()=>X(!0))}),Q.listen($,"0.0.0.0")})}async function G4($){return new Promise((X)=>{let Q=U6.createServer();Q.once("error",()=>X(!1)),Q.once("listening",()=>{Q.close(()=>X(!0))}),Q.listen($,"::")})}async function W4($){if(!await J4($))return!1;return await G4($)}async function k0($,X=20){$=Number($);for(let Q=0;Q<X;Q++){let Z=$+Q;if(await W4(Z))return Z}throw Error(`Could not find an available port between ${$} and ${$+X-1}`)}var K4={title:"stx Development",width:1400,height:900,darkMode:!0,hotReload:!0,titlebarHidden:!1,nativeSidebar:!1,sidebarWidth:260,sidebarConfig:void 0};async function _4(){try{let $=await import("./chunk-2v69c72j.js");if(typeof $.openDevWindow!=="function")return null;return $}catch{return null}}async function t0($,X={}){let Q={...K4,...X},Z=await _4();if(!Z)return console.log(`${B.yellow}\u26A0${B.reset} Native window requested, but @stacksjs/desktop is not available.`),console.log(" Install & build the desktop package to enable --native."),!1;try{let Y=await Z.openDevWindow($,{title:Q.title,width:Q.width,height:Q.height,darkMode:Q.darkMode,hotReload:Q.hotReload,titlebarHidden:Q.titlebarHidden,nativeSidebar:Q.nativeSidebar,sidebarWidth:Q.sidebarWidth,sidebarConfig:Q.sidebarConfig});if(Y&&Q.nativeSidebar)console.log(`${B.green}\u2713${B.reset} Native sidebar enabled (macOS Tahoe style)`);return Y}catch(Y){return console.log(`${B.red}\u2717${B.reset} Could not open native window:`,Y),!1}}function o1($){if($.match(/<Sidebar[\s\S]*?variant=["'](?:tahoe|vibrancy|desktop)["'][\s\S]*?\/>/i)){let Y=$.match(/<script\s+server[^>]*>([\s\S]*?)<\/script>/i);if(Y){let J=Y[1];try{let G=`
689
689
  ${J}
690
690
  return typeof sidebarConfig !== 'undefined' ? sidebarConfig : null;
691
691
  `,K=Function(G)();if(K)return K}catch(G){console.warn("Invalid sidebarConfig:",G)}}return{sections:[]}}let Q=$.match(/@nativeSidebar\s*\(\s*(\{[\s\S]*?\})\s*\)/m);if(Q)try{return JSON.parse(Q[1])}catch{console.warn("Invalid @nativeSidebar configuration")}let Z=$.match(/<script\s+native-sidebar[^>]*>([\s\S]*?)<\/script>/i);if(Z)try{let Y=Z[1].match(/(?:export\s+(?:default\s+)?|const\s+\w+\s*=\s*)(\{[\s\S]*\})/m);if(Y)return Function(`return ${Y[1]}`)()}catch(Y){console.warn("Invalid native-sidebar script configuration:",Y)}return}function i$(){console.log(`
@@ -1057,7 +1057,7 @@ else {
1057
1057
  };
1058
1058
  })();
1059
1059
  </script>
1060
- `}function D0($,X,Q={}){let Z=j4(X,Q),Y=$.lastIndexOf("</body>");if(Y!==-1)return $.slice(0,Y)+Z+$.slice(Y);if($.includes("</html>"))return $.replace("</html>",`${Z}</html>`);return $+Z}function t1($){let X=$.toLowerCase();return X.endsWith(".css")||X.endsWith(".scss")||X.endsWith(".sass")||X.endsWith(".less")}function e1($){let X=$.toLowerCase();return[".stx",".html",".htm",".md",".js",".ts",".jsx",".tsx",".json"].some((Z)=>X.endsWith(Z))}function $$($){return[/^\./,/node_modules/,/\.stx\/output/,/\.stx\/cache/,/~$/,/\.swp$/,/\.swo$/].some((Q)=>Q.test($))}var $1=null;function X$($){if(!$1)$1=new B6($);return $1}function A1(){if($1)$1.stop(),$1=null}import q1 from"path";var X1={name:"bun-plugin-stx",async setup($){let Q={...await d0(),...$.config?.stx},Z=new Set,Y=Q.webComponents?.enabled?`./${q1.relative(q1.dirname($.config?.outdir||"dist"),Q.webComponents.outputDir||"dist/web-components")}`:"/web-components",J=[];if(Q.webComponents?.enabled)try{let G=await G$(Q,Z);if(J.push(...G),Q.debug&&G.length>0)console.log(`Successfully built ${G.length} web components`)}catch(G){console.error("Failed to build web components:",G)}$.onLoad({filter:/\.stx$/},async({path:G})=>{try{let W=new Set;if(Q.cache&&Q.cachePath){let L=await Y$(G,Q);if(L){if(Q.debug)console.log(`Using cached version of ${G}`);return{contents:L,loader:"html"}}}let K=await o$(()=>Bun.file(G).text(),"",(L)=>{throw new n$(`Failed to read stx file: ${G}`,G,void 0,void 0,`File read error: ${L.message}`)});if(!K)throw new n$(`stx file is empty: ${G}`,G);let{scriptContent:_,templateContent:U,allScripts:F}=t$.time("script-extraction",()=>{let L=K,H=Z$(K);if(H)L=H.content.trim();let q=K.match(/<script\b[^>]*>[\s\S]*?<\/script>/gi)||[],A="",N=[];for(let M of q){let R=M.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i)?.[1]||"",w=M.match(/<script\b([^>]*)>/i),C=w?w[1]:"";if(/\bserver\b/i.test(C))A=R;else N.push(M)}let V=L.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"");return{scriptContent:A,templateContent:V,allScripts:N}}),z={__filename:G,__dirname:q1.dirname(G),__stx:{webComponentsPath:Y,builtComponents:J}};await o$(()=>j0(_,z,G),void 0,(L)=>{let H=new s$(`Script execution failed in ${G}: ${L.message}`,G,void 0,void 0,_.substring(0,100));if(Q$.log(H,{filePath:G,scriptContent:_}),Q.debug)throw H});let O=await t$.timeAsync("directive-processing",async()=>{return await O0(U,z,G,Q,W)});if(F.length>0){let{interpolateScriptsInTemplate:L}=await import("./chunk-1pwcgb1t.js"),H=L(F.join(`
1060
+ `}function D0($,X,Q={}){let Z=j4(X,Q),Y=$.lastIndexOf("</body>");if(Y!==-1)return $.slice(0,Y)+Z+$.slice(Y);if($.includes("</html>"))return $.replace("</html>",`${Z}</html>`);return $+Z}function t1($){let X=$.toLowerCase();return X.endsWith(".css")||X.endsWith(".scss")||X.endsWith(".sass")||X.endsWith(".less")}function e1($){let X=$.toLowerCase();return[".stx",".html",".htm",".md",".js",".ts",".jsx",".tsx",".json"].some((Z)=>X.endsWith(Z))}function $$($){return[/^\./,/node_modules/,/\.stx\/output/,/\.stx\/cache/,/~$/,/\.swp$/,/\.swo$/].some((Q)=>Q.test($))}var $1=null;function X$($){if(!$1)$1=new B6($);return $1}function A1(){if($1)$1.stop(),$1=null}import q1 from"path";var X1={name:"bun-plugin-stx",async setup($){let Q={...await d0(),...$.config?.stx},Z=new Set,Y=Q.webComponents?.enabled?`./${q1.relative(q1.dirname($.config?.outdir||"dist"),Q.webComponents.outputDir||"dist/web-components")}`:"/web-components",J=[];if(Q.webComponents?.enabled)try{let G=await G$(Q,Z);if(J.push(...G),Q.debug&&G.length>0)console.log(`Successfully built ${G.length} web components`)}catch(G){console.error("Failed to build web components:",G)}$.onLoad({filter:/\.stx$/},async({path:G})=>{try{let W=new Set;if(Q.cache&&Q.cachePath){let L=await Y$(G,Q);if(L){if(Q.debug)console.log(`Using cached version of ${G}`);return{contents:L,loader:"html"}}}let K=await o$(()=>Bun.file(G).text(),"",(L)=>{throw new n$(`Failed to read stx file: ${G}`,G,void 0,void 0,`File read error: ${L.message}`)});if(!K)throw new n$(`stx file is empty: ${G}`,G);let{scriptContent:_,templateContent:U,allScripts:F}=t$.time("script-extraction",()=>{let L=K,H=Z$(K);if(H)L=H.content.trim();let q=K.match(/<script\b[^>]*>[\s\S]*?<\/script>/gi)||[],A="",N=[];for(let M of q){let R=M.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i)?.[1]||"",w=M.match(/<script\b([^>]*)>/i),C=w?w[1]:"";if(/\bserver\b/i.test(C))A=R;else N.push(M)}let V=L.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"");return{scriptContent:A,templateContent:V,allScripts:N}}),z={__filename:G,__dirname:q1.dirname(G),__stx:{webComponentsPath:Y,builtComponents:J}};await o$(()=>j0(_,z,G),void 0,(L)=>{let H=new s$(`Script execution failed in ${G}: ${L.message}`,G,void 0,void 0,_.substring(0,100));if(Q$.log(H,{filePath:G,scriptContent:_}),Q.debug)throw H});let O=await t$.timeAsync("directive-processing",async()=>{return await O0(U,z,G,Q,W)});if(F.length>0){let{interpolateScriptsInTemplate:L}=await import("./chunk-e17ys98t.js"),H=L(F.join(`
1061
1061
  `),z),q=O.search(/<\/body>/i);if(q!==-1)O=O.slice(0,q)+H+`
1062
1062
  `+O.slice(q);else O+=`
1063
1063
  ${H}`}if(O=await z6(O),W.forEach((L)=>Z.add(L)),Q.cache&&Q.cachePath){if(await J$(G,O,W,Q),Q.debug)console.log(`Cached template ${G} with ${W.size} dependencies`)}return{contents:O,loader:"html"}}catch(W){let K=W instanceof Error?W:new s$(`Plugin processing failed: ${String(W)}`,G);if(Q$.log(K,{filePath:G,buildConfig:$.config}),F6.logDetailedError(K,{filePath:G,plugin:"bun-plugin-stx"}),Q.debug)console.error("stx Plugin Error:",K);let _=K,U=_.line||null,F=_.context||null;return{contents:Q.debug||L6()?`<!DOCTYPE html>
@@ -1120,7 +1120,7 @@ ${H}`}if(O=await z6(O),W.forEach((L)=>Z.add(L)),Q.cache&&Q.cachePath){if(await J
1120
1120
  <h1>Something went wrong</h1>
1121
1121
  <p>An internal error occurred. Please try again later.</p>
1122
1122
  </body>
1123
- </html>`,loader:"html"}}})}};async function H4($,X={}){let Q=X.port||3000,Z=X.watch!==!1,Y=X.hotReload!==!1&&Z,J=null,G=X.hmrPort||Q+1,W=Y0.resolve($);if(!H0.existsSync(W))return console.error(`${B.red}Error: File not found: ${B.bright}${W}${B.reset}`),!1;if(W.endsWith(".md"))return r$(W,X);else if(!W.endsWith(".stx"))return console.error(`${B.red}Error: Unsupported file type: ${B.bright}${W}${B.reset}. Only .stx and .md files are supported.`),!1;let K=S0(process.cwd(),"output");H0.mkdirSync(K,{recursive:!0}),console.log(`${B.blue}Building ${B.bright}${$}${B.reset}...`);let _=null,U=async()=>{try{let A={name:"public-assets",setup(R){R.onResolve({filter:/^\/(images|fonts|assets|public)\//},(w)=>{return{path:w.path,external:!0}})}},N=await Bun.build({entrypoints:[W],outdir:K,plugins:[A,X1],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...X.stxOptions});if(!N.success)return console.error(`${B.red}Build failed:${B.reset}`,N.logs),!1;let V=N.outputs.find((R)=>R.path.endsWith(".html"));if(!V)return console.error(`${B.red}No HTML output found${B.reset}`),!1;return _=await Bun.file(V.path).text(),!0}catch(A){return console.error(`${B.red}Error building stx file:${B.reset}`,A),!1}};if(!await U())return!1;let z=Y0.dirname(W);await W$(z);let j=Q;try{if(j=await k0(Q),j!==Q)console.log(`${B.yellow}Port ${Q} is busy, using port ${j} instead${B.reset}`)}catch{return console.error(`${B.red}Could not find an available port${B.reset}`),!1}if(Y){let A=X.hmrPort||j+1;J=X$({wsPort:A,verbose:!1}),G=J.start(A)}let O={},L=null;try{let{loadStxConfig:A}=await import("./chunk-dfcsn711.js"),N=await A();if(N?.apiRouter)L=N?.apiRouter,console.log(`${B.blue}Using custom router for API handling${B.reset}`);if(N?.apiRoutes){O=N.apiRoutes;let V=Object.keys(O).length;if(V>0)console.log(`${B.blue}Loaded ${B.bright}${V} API route${V>1?"s":""}${B.reset}`)}if(N?.broadcasting?.enabled)try{let{startBroadcasting:V,loadChannels:M}=await import("./chunk-dxevp6w7.js"),R=N.broadcasting;await V(R);let w=R.port??6001;console.log(`${B.magenta}Broadcasting on ${B.cyan}ws://localhost:${w}/ws${B.reset}`);let C=Y0.join(process.cwd(),"channels.ts");if(H0.existsSync(C))try{let I=await M(C);console.log(`${B.blue}Loaded ${B.bright}${I} broadcast channel${I!==1?"s":""}${B.blue} from channels.ts${B.reset}`)}catch(I){console.warn(`${B.yellow}Failed to load channels.ts: ${I.message}${B.reset}`)}}catch(V){console.warn(`${B.yellow}Broadcasting failed to start: ${V.message}${B.reset}`)}}catch{}if(console.log(`${B.blue}Starting server on ${B.cyan}http://localhost:${j}/${B.reset}...`),Y)console.log(`${B.magenta}Hot reload enabled on ws://localhost:${G}${B.reset}`);let H=O4({port:j,async fetch(A){return _$(A,await(async()=>{let N=new URL(A.url);if(L)try{let C=await L.handleRequest(A);if(C.status!==404)return C}catch{}if(O[N.pathname])try{return await O[N.pathname](A)}catch(C){return new Response(JSON.stringify({error:C.message}),{status:500,headers:{"Content-Type":"application/json"}})}if(N.pathname==="/")return(async()=>{let I=await o(_||"");if(Y)I=D0(I,G);if(X.native)if(I.includes("<head>"))I=I.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else if(I.includes("<html"))I=I.replace(/(<html[^>]*>)/,"$1<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>");else I="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+I;if(X.titlebarHidden)if(I.includes("<head>"))I=I.replace("<head>","<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script>");else if(I.includes("<html"))I=I.replace(/(<html[^>]*>)/,"$1<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>");else I=`<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>${I}`;return I})().then((I)=>new Response(I,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}}));let V=Y0.join(K,N.pathname);if(H0.existsSync(V)&&H0.statSync(V).isFile()){let C=Bun.file(V),I=Y0.extname(V).toLowerCase(),E="text/plain";if(I===".ts"||I===".tsx"){let h=new Bun.Transpiler({loader:I===".tsx"?"tsx":"ts"}),u=await C.text(),t=h.transformSync(u);return new Response(t,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(I){case".html":E="text/html";break;case".css":E="text/css";break;case".js":E="text/javascript";break;case".json":E="application/json";break;case".png":E="image/png";break;case".jpg":case".jpeg":E="image/jpeg";break;case".gif":E="image/gif";break;case".woff":E="font/woff";break;case".woff2":E="font/woff2";break;case".ttf":E="font/ttf";break;case".otf":E="font/otf";break;case".eot":E="application/vnd.ms-fontobject";break}return new Response(C,{headers:{"Content-Type":E}})}let M=Y0.dirname(W),R=Y0.join(M,N.pathname);if(H0.existsSync(R)&&H0.statSync(R).isFile()){let C=Bun.file(R),I=Y0.extname(R).toLowerCase(),E="text/plain";if(I===".ts"||I===".tsx"){let h=new Bun.Transpiler({loader:I===".tsx"?"tsx":"ts"}),u=await C.text(),t=h.transformSync(u);return new Response(t,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(I){case".html":E="text/html";break;case".css":E="text/css";break;case".js":E="text/javascript";break;case".json":E="application/json";break;case".png":E="image/png";break;case".jpg":case".jpeg":E="image/jpeg";break;case".gif":E="image/gif";break;case".svg":E="image/svg+xml";break;case".ico":E="image/x-icon";break;case".woff":E="font/woff";break;case".woff2":E="font/woff2";break;case".ttf":E="font/ttf";break;case".otf":E="font/otf";break;case".eot":E="application/vnd.ms-fontobject";break}return new Response(C,{headers:{"Content-Type":E}})}let w=Y0.join(process.cwd(),"public",N.pathname);if(H0.existsSync(w)&&H0.statSync(w).isFile()){let C=Bun.file(w),I=Y0.extname(w).toLowerCase(),E="application/octet-stream";if(I===".ts"||I===".tsx"){let h=new Bun.Transpiler({loader:I===".tsx"?"tsx":"ts"}),u=await C.text(),t=h.transformSync(u);return new Response(t,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(I){case".html":E="text/html";break;case".css":E="text/css";break;case".js":E="text/javascript";break;case".json":E="application/json";break;case".png":E="image/png";break;case".jpg":case".jpeg":E="image/jpeg";break;case".gif":E="image/gif";break;case".svg":E="image/svg+xml";break;case".ico":E="image/x-icon";break;case".woff":E="font/woff";break;case".woff2":E="font/woff2";break;case".ttf":E="font/ttf";break;case".otf":E="font/otf";break;case".eot":E="application/vnd.ms-fontobject";break}return new Response(C,{headers:{"Content-Type":E}})}return new Response("Not Found",{status:404})})())},error(A){return new Response(`<pre>${A}
1123
+ </html>`,loader:"html"}}})}};async function H4($,X={}){let Q=X.port||3000,Z=X.watch!==!1,Y=X.hotReload!==!1&&Z,J=null,G=X.hmrPort||Q+1,W=Y0.resolve($);if(!H0.existsSync(W))return console.error(`${B.red}Error: File not found: ${B.bright}${W}${B.reset}`),!1;if(W.endsWith(".md"))return r$(W,X);else if(!W.endsWith(".stx"))return console.error(`${B.red}Error: Unsupported file type: ${B.bright}${W}${B.reset}. Only .stx and .md files are supported.`),!1;let K=S0(process.cwd(),"output");H0.mkdirSync(K,{recursive:!0}),console.log(`${B.blue}Building ${B.bright}${$}${B.reset}...`);let _=null,U=async()=>{try{let A={name:"public-assets",setup(R){R.onResolve({filter:/^\/(images|fonts|assets|public)\//},(w)=>{return{path:w.path,external:!0}})}},N=await Bun.build({entrypoints:[W],outdir:K,plugins:[A,X1],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...X.stxOptions});if(!N.success)return console.error(`${B.red}Build failed:${B.reset}`,N.logs),!1;let V=N.outputs.find((R)=>R.path.endsWith(".html"));if(!V)return console.error(`${B.red}No HTML output found${B.reset}`),!1;return _=await Bun.file(V.path).text(),!0}catch(A){return console.error(`${B.red}Error building stx file:${B.reset}`,A),!1}};if(!await U())return!1;let z=Y0.dirname(W);await W$(z);let j=Q;try{if(j=await k0(Q),j!==Q)console.log(`${B.yellow}Port ${Q} is busy, using port ${j} instead${B.reset}`)}catch{return console.error(`${B.red}Could not find an available port${B.reset}`),!1}if(Y){let A=X.hmrPort||j+1;J=X$({wsPort:A,verbose:!1}),G=J.start(A)}let O={},L=null;try{let{loadStxConfig:A}=await import("./chunk-44gm42cq.js"),N=await A();if(N?.apiRouter)L=N?.apiRouter,console.log(`${B.blue}Using custom router for API handling${B.reset}`);if(N?.apiRoutes){O=N.apiRoutes;let V=Object.keys(O).length;if(V>0)console.log(`${B.blue}Loaded ${B.bright}${V} API route${V>1?"s":""}${B.reset}`)}if(N?.broadcasting?.enabled)try{let{startBroadcasting:V,loadChannels:M}=await import("./chunk-8zyv8jf3.js"),R=N.broadcasting;await V(R);let w=R.port??6001;console.log(`${B.magenta}Broadcasting on ${B.cyan}ws://localhost:${w}/ws${B.reset}`);let C=Y0.join(process.cwd(),"channels.ts");if(H0.existsSync(C))try{let I=await M(C);console.log(`${B.blue}Loaded ${B.bright}${I} broadcast channel${I!==1?"s":""}${B.blue} from channels.ts${B.reset}`)}catch(I){console.warn(`${B.yellow}Failed to load channels.ts: ${I.message}${B.reset}`)}}catch(V){console.warn(`${B.yellow}Broadcasting failed to start: ${V.message}${B.reset}`)}}catch{}if(console.log(`${B.blue}Starting server on ${B.cyan}http://localhost:${j}/${B.reset}...`),Y)console.log(`${B.magenta}Hot reload enabled on ws://localhost:${G}${B.reset}`);let H=O4({port:j,async fetch(A){return _$(A,await(async()=>{let N=new URL(A.url);if(L)try{let C=await L.handleRequest(A);if(C.status!==404)return C}catch{}if(O[N.pathname])try{return await O[N.pathname](A)}catch(C){return new Response(JSON.stringify({error:C.message}),{status:500,headers:{"Content-Type":"application/json"}})}if(N.pathname==="/")return(async()=>{let I=await o(_||"");if(Y)I=D0(I,G);if(X.native)if(I.includes("<head>"))I=I.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else if(I.includes("<html"))I=I.replace(/(<html[^>]*>)/,"$1<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>");else I="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+I;if(X.titlebarHidden)if(I.includes("<head>"))I=I.replace("<head>","<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script>");else if(I.includes("<html"))I=I.replace(/(<html[^>]*>)/,"$1<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>");else I=`<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>${I}`;return I})().then((I)=>new Response(I,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}}));let V=Y0.join(K,N.pathname);if(H0.existsSync(V)&&H0.statSync(V).isFile()){let C=Bun.file(V),I=Y0.extname(V).toLowerCase(),E="text/plain";if(I===".ts"||I===".tsx"){let h=new Bun.Transpiler({loader:I===".tsx"?"tsx":"ts"}),u=await C.text(),t=h.transformSync(u);return new Response(t,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(I){case".html":E="text/html";break;case".css":E="text/css";break;case".js":E="text/javascript";break;case".json":E="application/json";break;case".png":E="image/png";break;case".jpg":case".jpeg":E="image/jpeg";break;case".gif":E="image/gif";break;case".woff":E="font/woff";break;case".woff2":E="font/woff2";break;case".ttf":E="font/ttf";break;case".otf":E="font/otf";break;case".eot":E="application/vnd.ms-fontobject";break}return new Response(C,{headers:{"Content-Type":E}})}let M=Y0.dirname(W),R=Y0.join(M,N.pathname);if(H0.existsSync(R)&&H0.statSync(R).isFile()){let C=Bun.file(R),I=Y0.extname(R).toLowerCase(),E="text/plain";if(I===".ts"||I===".tsx"){let h=new Bun.Transpiler({loader:I===".tsx"?"tsx":"ts"}),u=await C.text(),t=h.transformSync(u);return new Response(t,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(I){case".html":E="text/html";break;case".css":E="text/css";break;case".js":E="text/javascript";break;case".json":E="application/json";break;case".png":E="image/png";break;case".jpg":case".jpeg":E="image/jpeg";break;case".gif":E="image/gif";break;case".svg":E="image/svg+xml";break;case".ico":E="image/x-icon";break;case".woff":E="font/woff";break;case".woff2":E="font/woff2";break;case".ttf":E="font/ttf";break;case".otf":E="font/otf";break;case".eot":E="application/vnd.ms-fontobject";break}return new Response(C,{headers:{"Content-Type":E}})}let w=Y0.join(process.cwd(),"public",N.pathname);if(H0.existsSync(w)&&H0.statSync(w).isFile()){let C=Bun.file(w),I=Y0.extname(w).toLowerCase(),E="application/octet-stream";if(I===".ts"||I===".tsx"){let h=new Bun.Transpiler({loader:I===".tsx"?"tsx":"ts"}),u=await C.text(),t=h.transformSync(u);return new Response(t,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(I){case".html":E="text/html";break;case".css":E="text/css";break;case".js":E="text/javascript";break;case".json":E="application/json";break;case".png":E="image/png";break;case".jpg":case".jpeg":E="image/jpeg";break;case".gif":E="image/gif";break;case".svg":E="image/svg+xml";break;case".ico":E="image/x-icon";break;case".woff":E="font/woff";break;case".woff2":E="font/woff2";break;case".ttf":E="font/ttf";break;case".otf":E="font/otf";break;case".eot":E="application/vnd.ms-fontobject";break}return new Response(C,{headers:{"Content-Type":E}})}return new Response("Not Found",{status:404})})())},error(A){return new Response(`<pre>${A}
1124
1124
  ${A.stack}</pre>`,{headers:{"Content-Type":"text/html"}})}});console.clear(),console.log(`
1125
1125
  ${B.blue}stx${B.reset} ${B.green}${process.env.stx_VERSION||"v0.0.10"}${B.reset} ${B.dim}ready in ${Math.random()*10+5|0}.${Math.random()*90+10|0} ms${B.reset}`),console.log(`
1126
1126
  ${B.bright}\u2192 ${B.cyan}http://localhost:${j}/${B.reset}`),console.log(`
@@ -1607,12 +1607,12 @@ ${O.stack}</pre>`,{headers:{"Content-Type":"text/html"}})}});console.clear(),con
1607
1607
  ${B.blue}stx${B.reset} ${B.green}${process.env.stx_VERSION||"v0.0.10"}${B.reset} ${B.dim}ready in ${Math.random()*10+5|0}.${Math.random()*90+10|0} ms${B.reset}`),console.log(`
1608
1608
  ${B.bright}\u2192 ${B.cyan}http://localhost:${U}/${B.reset}`),console.log(`
1609
1609
  ${B.yellow}Routes:${B.reset}`);let z=new Set(W.map((O)=>O.routeTemplate)),j=Object.entries(G).filter(([O])=>!z.has(O)).sort(([O],[L])=>O.localeCompare(L)).map(([O,L])=>({route:O==="/"?"/":O,filePath:Q0.relative(process.cwd(),L.filePath),fileType:L.fileType}));for(let O of W){let L=O.routeTemplate.replace(/\[([^\]]+)\]/g,":$1");j.push({route:L,filePath:Q0.relative(process.cwd(),O.filePath),fileType:"stx"})}if(j.sort((O,L)=>O.route.localeCompare(L.route)),j.forEach((O,L)=>{let q=L===j.length-1?"\u2514\u2500 ":"\u251C\u2500 ",A=O.fileType==="md"?`${B.magenta}(markdown)${B.reset}`:"";console.log(` ${B.green}${q}${O.route}${B.reset} \u2192 ${B.bright}${O.filePath}${B.reset} ${A}`)}),console.log(`
1610
- Press ${B.cyan}h${B.reset} + ${B.cyan}Enter${B.reset} to show shortcuts`),x0(F.url.toString(),()=>{if(Z)P0.watch(J,{recursive:!0}).close();F.stop()}),Z){console.log(`${B.blue}Watching for changes...${B.reset}`);let O=P0.watch(J,{recursive:!0},async(L,H)=>{if(!H)return;if(H.endsWith(".stx")||H.endsWith(".js")||H.endsWith(".ts")||H.endsWith(".md"))console.log(`${B.yellow}File ${B.bright}${H}${B.yellow} changed, rebuilding...${B.reset}`),m0.clear(),p0(),await K()});process.on("SIGINT",()=>{O.close(),F.stop(),process.exit(0)})}return!0}function O6($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var{serve:N4}=globalThis.Bun;import J0 from"fs";import g from"path";async function M6($){try{return Z5(await Bun.file($).text())}catch{return}}function e$($){let X=Bun.file($),Q=g.extname($).toLowerCase(),Z={".html":"text/html",".css":"text/css",".js":"text/javascript",".json":"application/json",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".svg":"image/svg+xml",".ico":"image/x-icon",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"},J=[".js",".css",".json"].includes(Q)?{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}:{};return new Response(X,{headers:{"Content-Type":Z[Q]||"application/octet-stream",...J}})}async function M4($=".",X={}){let Q=X.port||3000,Z=X.watch!==!1,Y=X.hotReload!==!1&&Z,J=null,G=X.hmrPort||Q+1,W=g.resolve($),{loadStxConfig:K}=await import("./chunk-dfcsn711.js"),_=await K(W),U=_.root&&_.root!=="."?g.join(W,_.root):W,F=X.pagesDir||_.pagesDir||"pages",z=g.join(U,F);if(!J0.existsSync(z))return console.error(`${B.red}Error: No '${F}' directory found${B.reset}`),console.log(`${B.dim}Looked in: ${B.bright}${z}${B.reset}`),console.log(`${B.dim}Run stx dev from the app directory, pass it as an argument (stx dev <dir>),${B.reset}`),console.log(`${B.dim}point at another directory with --pages <dir>, or set pagesDir in stx.config.ts.${B.reset}`),console.log(`${B.dim}Starting fresh? Create ${F}/index.stx for the homepage.${B.reset}`),!1;let j=X5(U,{pagesDir:F});if(j.length===0)return console.error(`${B.red}Error: No page files found in ${B.bright}${z}${B.reset}`),!1;console.log(`${B.blue}Found ${B.bright}${j.length}${B.blue} routes${B.reset}`);let O=_?._pluginPageDirs||[],L=[];for(let{dir:D,prefix:T}of O)if(J0.existsSync(D)){let x=X5(g.dirname(D),{pagesDir:g.basename(D)});for(let S of x){let b=T==="/"?S.pattern:`${T}${S.pattern==="/"?"":S.pattern}`;L.push({route:{...S,pattern:b},prefix:T})}if(x.length>0)console.log(`${B.blue}Plugin pages: ${B.bright}${x.length}${B.blue} routes at ${B.cyan}${T}${B.reset}`)}let H=new Map,q=null,A=null;if(X.stxOptions?.shell!==!1){if(A=await y6(W,X.stxOptions?.shell),A){if(q=await Q5(A,X.stxOptions||{}),q)console.log(`${B.blue}Using app shell: ${B.bright}${g.relative(W,A)}${B.reset} ${B.dim}(deprecated: use layouts/default.stx instead)${B.reset}`)}}R6(),await D6(W);let N=I6();if(N.length>0)console.log(`${B.blue}Loaded ${B.bright}${N.length}${B.blue} middleware: ${B.dim}${N.join(", ")}${B.reset}`);let V={},M=null;try{let{loadStxConfig:D}=await import("./chunk-dfcsn711.js"),T=await D(W);if(T?.apiRouter)M=T?.apiRouter,console.log(`${B.blue}Using custom router for API handling${B.reset}`);if(T?.apiRoutes){V=T.apiRoutes;let x=Object.keys(V).length;if(x>0)console.log(`${B.blue}Loaded ${B.bright}${x} API route${x>1?"s":""}${B.reset}`)}if(T?.broadcasting?.enabled)try{let{startBroadcasting:x,loadChannels:S}=await import("./chunk-dxevp6w7.js"),b=T.broadcasting;await x(b);let _0=b.port??6001;console.log(`${B.magenta}Broadcasting on ${B.cyan}ws://localhost:${_0}/ws${B.reset}`);let K0=g.join(process.cwd(),"channels.ts");if(J0.existsSync(K0))try{let C0=await S(K0);console.log(`${B.blue}Loaded ${B.bright}${C0} broadcast channel${C0!==1?"s":""}${B.blue} from channels.ts${B.reset}`)}catch(C0){console.warn(`${B.yellow}Failed to load channels.ts: ${C0.message}${B.reset}`)}}catch(x){console.warn(`${B.yellow}Broadcasting failed to start: ${x.message}${B.reset}`)}}catch{}let R=S0(W,"output");J0.mkdirSync(R,{recursive:!0});let w=new Map,C=new Set,I=async(D)=>{let T=V6(z,D);if(!T)return null;try{let x=await Bun.build({entrypoints:[T],outdir:R,plugins:[X1],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...X.stxOptions});if(!x.success)return null;let S=x.outputs.find((b)=>b.path.endsWith(".html"));if(!S)return null;return await Bun.file(S.path).text()}catch{return null}},E=new Map,h=async(D,T)=>{try{let{processDirectives:x,extractVariables:S,defaultConfig:b,loadStxConfig:_0,injectRouterScript:K0}=await import("./chunk-dfcsn711.js"),{checkCache:C0,cacheTemplate:u$,readFileCached:r,templateCache:f1}=await import("./chunk-kagw0ckh.js"),h1=await _0(W),k=(d)=>{if(!d)return d;if(g.isAbsolute(d))return d;return g.resolve(W,d)},y={...b,...h1,...X.stxOptions,autoShell:!0};if(X.debugDirectives)y.debug=!0;y.partialsDir=k(y.partialsDir),y.componentsDir=k(y.componentsDir),y.layoutsDir=k(y.layoutsDir),y.storesDir=k(y.storesDir||"stores"),y.cachePath=k(y.cachePath)??S0(W,"cache");let m=!T&&!X.profile,c=y.cache!==!1;if(c&&m){let d=f1.get(D.filePath);if(d)try{if((await J0.promises.stat(D.filePath)).mtime.getTime()<=d.mtime){let z0=!0;for(let $0 of d.dependencies){if(!J0.existsSync($0)){z0=!1;break}if((await J0.promises.stat($0)).mtime.getTime()>d.mtime){z0=!1;break}}if(z0){let $0=d.output;if(q)$0=L$($0,{preserveHead:!0});let j1=E.get(D.filePath);return{route:D,content:$0,status:j1?.status??await M6(D.filePath),headers:j1?.headers}}}}catch{}let L0=await C0(D.filePath,y);if(L0){let F0=L0;if(q)F0=L$(F0,{preserveHead:!0});let z0=E.get(D.filePath);return{route:D,content:F0,status:z0?.status??await M6(D.filePath),headers:z0?.headers}}}let s=c?await r(D.filePath):await Bun.file(D.filePath).text(),v=Z5(s),{classifyAllScripts:U0}=await import("./chunk-dfcsn711.js"),B0=U0(s),a=B0.server.map((d)=>d.content),e=s;for(let d of B0.server)e=e.replace(d.fullTag,"");let n={__filename:D.filePath,__dirname:g.dirname(D.filePath),params:T??{},__stx_runtime_head:{}};for(let d of a)try{await S(d,n,D.filePath)}catch(L0){if(X.stxOptions?.debug)console.error("[stx] variable extraction error",D.filePath,L0?.message||L0)}let r0=new Set,N0;if(X.profile){let d=performance.now();N0=await x(e,n,D.filePath,y,r0);let L0=performance.now()-d,F0=g.relative(W,D.filePath)||D.filePath;console.log(`[stx:profile] ${F0} \u2192 ${L0.toFixed(2)}ms`)}else N0=await x(e,n,D.filePath,y,r0);if(!q)N0=await K0(N0,{router:y.router});{let{interpolateScriptExpressions:d}=await import("./chunk-1pwcgb1t.js");N0=N0.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/g,(L0,F0,z0)=>{if(!/function\s+__stx_setup_/.test(z0))return L0;return`<script${F0}>${d(z0,n)}</script>`})}if(q)N0=L$(N0,{preserveHead:!0});if(c&&m)await u$(D.filePath,N0,r0,y);let{extractStreamBoundaries:t7}=await import("./chunk-h06cjhqg.js"),s0=t7(n),z1=n.__streamTemplates;if(z1&&typeof z1==="object"&&Object.keys(z1).length>0){let d=n.streamBoundaries||{},L0={...y,autoShell:!1},F0=Object.keys(z1).map(($0)=>({id:$0,render:async()=>{let j1=typeof d[$0]==="function"?await d[$0]():void 0;return x(z1[$0],{...n,$boundary:j1},D.filePath,L0,new Set)}})),z0=new Set(F0.map(($0)=>$0.id));s0=[...(s0||[]).filter(($0)=>!z0.has($0.id)),...F0]}if(s0&&s0.length>0)C.add(D.pattern);else s0=void 0;let u5=N1(n),m5=M1(n);if(m)E.set(D.filePath,{status:u5,headers:m5});return{route:D,content:N0,status:u5??v,headers:m5,boundaries:s0}}catch(x){return console.error(`${B.red}Error building ${B.bright}${D.pattern}${B.reset}:`,x),null}},u=8,t=async()=>{w.clear(),H.clear();for(let D=0;D<j.length;D+=u){let T=j.slice(D,D+u),x=await Promise.all(T.map((S)=>h(S)));for(let S of x)if(S)w.set(S.route.pattern,S)}for(let D=0;D<L.length;D+=u){let T=L.slice(D,D+u),x=await Promise.all(T.map(({route:S})=>h(S)));for(let S of x)if(S)H.set(S.route.pattern,S)}return w.size>0};if(console.log(`${B.blue}Building pages...${B.reset}`),!await t())return console.error(`${B.red}No pages were successfully built${B.reset}`),!1;await W$(W);let W0=Q;try{if(W0=await k0(Q),W0!==Q)console.log(`${B.yellow}Port ${Q} is busy, using port ${W0} instead${B.reset}`)}catch{return console.error(`${B.red}Could not find an available port${B.reset}`),!1}if(Y){let D=X.hmrPort||W0+1;J=X$({wsPort:D,verbose:!1}),G=J.start(D)}let v1=(D,T)=>{let S=`<script data-stx-route-params>(function(){var p=${JSON.stringify(T).replace(/</g,"\\u003C").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")};window.__stx_rp=p;if(window.stx){window.stx._rp=p;if(window.stx.setRouteParams)window.stx.setRouteParams(p)}})()</script>`;if(D.includes("</head>"))return D.replace("</head>",`${S}</head>`);if(D.includes("<body"))return D.replace(/<body([^>]*)>/,`<body$1>${S}`);return S+D};console.log(`${B.blue}Starting server...${B.reset}`);let g1=N4({port:W0,async fetch(D){let T=new URL(D.url),x=_?.publicDir||"public",S=g.join(W,x,T.pathname),b=g.join(W,T.pathname),_0=g.join(R,T.pathname),[K0,C0,u$]=await Promise.all([J0.promises.stat(S).catch(()=>null),J0.promises.stat(b).catch(()=>null),J0.promises.stat(_0).catch(()=>null)]);if(K0?.isFile())return e$(S);if(C0?.isFile())return e$(b);if(u$?.isFile())return e$(_0);if(T.pathname.startsWith("/_stx/component/")){let k=decodeURIComponent(T.pathname.slice(16));if(k)try{let y=`<${k} />`,m={...buildConfig,autoShell:!1},c=await processDirectives(y,{},g.join(W,"components",`${k}.stx`),m,new Set);return new Response(c,{headers:{"Content-Type":"text/html"}})}catch(y){return new Response(`<div class="stx-async-error">${y.message}</div>`,{status:500,headers:{"Content-Type":"text/html"}})}}if(T.pathname==="/_stx/img"){let{handleImageRequest:k}=await import("./chunk-11az7s55.js"),y=await k(D,{publicDir:g.join(W,x),cacheDir:S0(W,"cache","img")});if(y)return y}if(M)try{let k=await M.handleRequest(D);if(k.status!==404)return k}catch{}if(V[T.pathname])try{return await V[T.pathname](D)}catch(k){return new Response(JSON.stringify({error:k.message}),{status:500,headers:{"Content-Type":"application/json"}})}let r=$5(T.pathname,j);if(r){let k=w.get(r.route.pattern),y=C.has(r.route.pattern);if(r.route.isDynamic&&Object.keys(r.params).length>0||y){let m=await h(r.route,r.params);if(m)k=m}if(k){let m=k.status??200,c=k.headers??{},s=(r.route.filePath?x6(await Bun.file(r.route.filePath).text().catch(()=>"")):null)??{};if(s.validate){if(!await s.validate({params:r.params})){let B0=await I(404);if(B0){let a=B0;if(a=await o(a,W),Y)a=D0(a,G);return new Response(a,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}}if(s.middleware){let U0=w6(T.pathname,r.params,s,T.search),B0=T6(U0,null,D,{isServer:!0}),a=await C6(s.middleware,B0);if(a.redirect){let e=a.redirect.path,n=a.redirect.options.redirectCode||302,r0=new Headers(a.responseHeaders);return r0.set("Location",e),new Response(null,{status:n,headers:r0})}if(a.abort){let{statusCode:e,message:n}=a.abort.error;return new Response(`<!DOCTYPE html><html><head><title>Error ${e}</title></head><body><h1>Error ${e}</h1><p>${n}</p></body></html>`,{status:e,headers:{"Content-Type":"text/html"}})}if(Object.keys(a.state).length>0){let e=`<script>(function(){var s=typeof stx!=='undefined'?stx:{};s._ms=${JSON.stringify(a.state)};if(s.setMiddlewareState)s.setMiddlewareState(s._ms);})()</script>`;k.content=k.content.replace("</head>",`${e}</head>`)}}let v=k.content;if(q&&v6(D)){let U0=k6(v),B0=S6(v),a=v.match(/<title[^>]*>([\s\S]*?)<\/title>/i),e=a?a[1].trim():"";if(Object.keys(r.params).length>0)v=v1(v,r.params);v=await o(v,W);let n=_?.router?.container||"main";return v=g6(v,n),new Response(v,{status:m,headers:{"Content-Type":"text/html","X-STX-Fragment":"true","X-STX-Layout":U0.layout,"X-STX-Layout-Group":U0.group,"X-STX-Runtime":B0?"true":"false",...e&&{"X-STX-Title":encodeURIComponent(e)},[P6]:b6(),...Z1(),"Cache-Control":U$}})}if(q)v=B$(q,v);if(Object.keys(r.params).length>0)v=v1(v,r.params);if(v=await o(v,W),Y)v=D0(v,G);if(X.native)if(v.includes("<head>"))v=v.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else v="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+v;if(X.titlebarHidden)if(v.includes("<head>"))v=v.replace("<head>","<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script>");else v=`<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>${v}`;if(k.boundaries&&k.boundaries.length>0){let{renderStreamingPage:U0,streamToResponse:B0}=await import("./chunk-h06cjhqg.js");return B0(U0(v,k.boundaries,{timeoutMs:30000}),{status:m,headers:{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}return new Response(v,{status:m,headers:{"Content-Type":"text/html",...Z1(),"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0",...c}})}}if(L.length>0){let k=L.map((m)=>m.route),y=$5(T.pathname,k);if(y){let m=H.get(y.route.pattern);if(m){let c=m.content;if(q)c=B$(q,c);if(Object.keys(y.params).length>0)c=v1(c,y.params);if(c=await o(c,W),Y)c=D0(c,G);return new Response(c,{status:m.status??200,headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}for(let{prefix:m}of O)if(m!=="/"&&T.pathname.startsWith(m)){let c=H.get(m)||H.get(m+"/");if(c){let s=c.content;if(q)s=B$(q,s);if(s=await o(s,W),Y)s=D0(s,G);return new Response(s,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}}let f1=w.get("/");if(f1){let k=f1.content;if(k=await o(k,W),Y)k=D0(k,G);if(X.native)if(k.includes("<head>"))k=k.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else k="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+k;return new Response(k,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}let h1=await I(404);if(h1){let k=h1;if(k=await o(k,W),Y)k=D0(k,G);return new Response(k,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})},async error(D){let T=await I(500);if(T)return new Response(T,{status:500,headers:{"Content-Type":"text/html"}});return new Response(`<pre>${D}
1610
+ Press ${B.cyan}h${B.reset} + ${B.cyan}Enter${B.reset} to show shortcuts`),x0(F.url.toString(),()=>{if(Z)P0.watch(J,{recursive:!0}).close();F.stop()}),Z){console.log(`${B.blue}Watching for changes...${B.reset}`);let O=P0.watch(J,{recursive:!0},async(L,H)=>{if(!H)return;if(H.endsWith(".stx")||H.endsWith(".js")||H.endsWith(".ts")||H.endsWith(".md"))console.log(`${B.yellow}File ${B.bright}${H}${B.yellow} changed, rebuilding...${B.reset}`),m0.clear(),p0(),await K()});process.on("SIGINT",()=>{O.close(),F.stop(),process.exit(0)})}return!0}function O6($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var{serve:N4}=globalThis.Bun;import J0 from"fs";import g from"path";async function M6($){try{return Z5(await Bun.file($).text())}catch{return}}function e$($){let X=Bun.file($),Q=g.extname($).toLowerCase(),Z={".html":"text/html",".css":"text/css",".js":"text/javascript",".json":"application/json",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".svg":"image/svg+xml",".ico":"image/x-icon",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"},J=[".js",".css",".json"].includes(Q)?{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}:{};return new Response(X,{headers:{"Content-Type":Z[Q]||"application/octet-stream",...J}})}async function M4($=".",X={}){let Q=X.port||3000,Z=X.watch!==!1,Y=X.hotReload!==!1&&Z,J=null,G=X.hmrPort||Q+1,W=g.resolve($),{loadStxConfig:K}=await import("./chunk-44gm42cq.js"),_=await K(W),U=_.root&&_.root!=="."?g.join(W,_.root):W,F=X.pagesDir||_.pagesDir||"pages",z=g.join(U,F);if(!J0.existsSync(z))return console.error(`${B.red}Error: No '${F}' directory found${B.reset}`),console.log(`${B.dim}Looked in: ${B.bright}${z}${B.reset}`),console.log(`${B.dim}Run stx dev from the app directory, pass it as an argument (stx dev <dir>),${B.reset}`),console.log(`${B.dim}point at another directory with --pages <dir>, or set pagesDir in stx.config.ts.${B.reset}`),console.log(`${B.dim}Starting fresh? Create ${F}/index.stx for the homepage.${B.reset}`),!1;let j=X5(U,{pagesDir:F});if(j.length===0)return console.error(`${B.red}Error: No page files found in ${B.bright}${z}${B.reset}`),!1;console.log(`${B.blue}Found ${B.bright}${j.length}${B.blue} routes${B.reset}`);let O=_?._pluginPageDirs||[],L=[];for(let{dir:D,prefix:T}of O)if(J0.existsSync(D)){let x=X5(g.dirname(D),{pagesDir:g.basename(D)});for(let S of x){let b=T==="/"?S.pattern:`${T}${S.pattern==="/"?"":S.pattern}`;L.push({route:{...S,pattern:b},prefix:T})}if(x.length>0)console.log(`${B.blue}Plugin pages: ${B.bright}${x.length}${B.blue} routes at ${B.cyan}${T}${B.reset}`)}let H=new Map,q=null,A=null;if(X.stxOptions?.shell!==!1){if(A=await y6(W,X.stxOptions?.shell),A){if(q=await Q5(A,X.stxOptions||{}),q)console.log(`${B.blue}Using app shell: ${B.bright}${g.relative(W,A)}${B.reset} ${B.dim}(deprecated: use layouts/default.stx instead)${B.reset}`)}}R6(),await D6(W);let N=I6();if(N.length>0)console.log(`${B.blue}Loaded ${B.bright}${N.length}${B.blue} middleware: ${B.dim}${N.join(", ")}${B.reset}`);let V={},M=null;try{let{loadStxConfig:D}=await import("./chunk-44gm42cq.js"),T=await D(W);if(T?.apiRouter)M=T?.apiRouter,console.log(`${B.blue}Using custom router for API handling${B.reset}`);if(T?.apiRoutes){V=T.apiRoutes;let x=Object.keys(V).length;if(x>0)console.log(`${B.blue}Loaded ${B.bright}${x} API route${x>1?"s":""}${B.reset}`)}if(T?.broadcasting?.enabled)try{let{startBroadcasting:x,loadChannels:S}=await import("./chunk-8zyv8jf3.js"),b=T.broadcasting;await x(b);let _0=b.port??6001;console.log(`${B.magenta}Broadcasting on ${B.cyan}ws://localhost:${_0}/ws${B.reset}`);let K0=g.join(process.cwd(),"channels.ts");if(J0.existsSync(K0))try{let C0=await S(K0);console.log(`${B.blue}Loaded ${B.bright}${C0} broadcast channel${C0!==1?"s":""}${B.blue} from channels.ts${B.reset}`)}catch(C0){console.warn(`${B.yellow}Failed to load channels.ts: ${C0.message}${B.reset}`)}}catch(x){console.warn(`${B.yellow}Broadcasting failed to start: ${x.message}${B.reset}`)}}catch{}let R=S0(W,"output");J0.mkdirSync(R,{recursive:!0});let w=new Map,C=new Set,I=async(D)=>{let T=V6(z,D);if(!T)return null;try{let x=await Bun.build({entrypoints:[T],outdir:R,plugins:[X1],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...X.stxOptions});if(!x.success)return null;let S=x.outputs.find((b)=>b.path.endsWith(".html"));if(!S)return null;return await Bun.file(S.path).text()}catch{return null}},E=new Map,h=async(D,T)=>{try{let{processDirectives:x,extractVariables:S,defaultConfig:b,loadStxConfig:_0,injectRouterScript:K0}=await import("./chunk-44gm42cq.js"),{checkCache:C0,cacheTemplate:u$,readFileCached:r,templateCache:f1}=await import("./chunk-8tdj5zep.js"),h1=await _0(W),k=(d)=>{if(!d)return d;if(g.isAbsolute(d))return d;return g.resolve(W,d)},y={...b,...h1,...X.stxOptions,autoShell:!0};if(X.debugDirectives)y.debug=!0;y.partialsDir=k(y.partialsDir),y.componentsDir=k(y.componentsDir),y.layoutsDir=k(y.layoutsDir),y.storesDir=k(y.storesDir||"stores"),y.cachePath=k(y.cachePath)??S0(W,"cache");let m=!T&&!X.profile,c=y.cache!==!1;if(c&&m){let d=f1.get(D.filePath);if(d)try{if((await J0.promises.stat(D.filePath)).mtime.getTime()<=d.mtime){let z0=!0;for(let $0 of d.dependencies){if(!J0.existsSync($0)){z0=!1;break}if((await J0.promises.stat($0)).mtime.getTime()>d.mtime){z0=!1;break}}if(z0){let $0=d.output;if(q)$0=L$($0,{preserveHead:!0});let j1=E.get(D.filePath);return{route:D,content:$0,status:j1?.status??await M6(D.filePath),headers:j1?.headers}}}}catch{}let L0=await C0(D.filePath,y);if(L0){let F0=L0;if(q)F0=L$(F0,{preserveHead:!0});let z0=E.get(D.filePath);return{route:D,content:F0,status:z0?.status??await M6(D.filePath),headers:z0?.headers}}}let s=c?await r(D.filePath):await Bun.file(D.filePath).text(),v=Z5(s),{classifyAllScripts:U0}=await import("./chunk-44gm42cq.js"),B0=U0(s),a=B0.server.map((d)=>d.content),e=s;for(let d of B0.server)e=e.replace(d.fullTag,"");let n={__filename:D.filePath,__dirname:g.dirname(D.filePath),params:T??{},__stx_runtime_head:{}};for(let d of a)try{await S(d,n,D.filePath)}catch(L0){if(X.stxOptions?.debug)console.error("[stx] variable extraction error",D.filePath,L0?.message||L0)}let r0=new Set,N0;if(X.profile){let d=performance.now();N0=await x(e,n,D.filePath,y,r0);let L0=performance.now()-d,F0=g.relative(W,D.filePath)||D.filePath;console.log(`[stx:profile] ${F0} \u2192 ${L0.toFixed(2)}ms`)}else N0=await x(e,n,D.filePath,y,r0);if(!q)N0=await K0(N0,{router:y.router});{let{interpolateScriptExpressions:d}=await import("./chunk-e17ys98t.js");N0=N0.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/g,(L0,F0,z0)=>{if(!/function\s+__stx_setup_/.test(z0))return L0;return`<script${F0}>${d(z0,n)}</script>`})}if(q)N0=L$(N0,{preserveHead:!0});if(c&&m)await u$(D.filePath,N0,r0,y);let{extractStreamBoundaries:t7}=await import("./chunk-7ncfmg13.js"),s0=t7(n),z1=n.__streamTemplates;if(z1&&typeof z1==="object"&&Object.keys(z1).length>0){let d=n.streamBoundaries||{},L0={...y,autoShell:!1},F0=Object.keys(z1).map(($0)=>({id:$0,render:async()=>{let j1=typeof d[$0]==="function"?await d[$0]():void 0;return x(z1[$0],{...n,$boundary:j1},D.filePath,L0,new Set)}})),z0=new Set(F0.map(($0)=>$0.id));s0=[...(s0||[]).filter(($0)=>!z0.has($0.id)),...F0]}if(s0&&s0.length>0)C.add(D.pattern);else s0=void 0;let u5=N1(n),m5=M1(n);if(m)E.set(D.filePath,{status:u5,headers:m5});return{route:D,content:N0,status:u5??v,headers:m5,boundaries:s0}}catch(x){return console.error(`${B.red}Error building ${B.bright}${D.pattern}${B.reset}:`,x),null}},u=8,t=async()=>{w.clear(),H.clear();for(let D=0;D<j.length;D+=u){let T=j.slice(D,D+u),x=await Promise.all(T.map((S)=>h(S)));for(let S of x)if(S)w.set(S.route.pattern,S)}for(let D=0;D<L.length;D+=u){let T=L.slice(D,D+u),x=await Promise.all(T.map(({route:S})=>h(S)));for(let S of x)if(S)H.set(S.route.pattern,S)}return w.size>0};if(console.log(`${B.blue}Building pages...${B.reset}`),!await t())return console.error(`${B.red}No pages were successfully built${B.reset}`),!1;await W$(W);let W0=Q;try{if(W0=await k0(Q),W0!==Q)console.log(`${B.yellow}Port ${Q} is busy, using port ${W0} instead${B.reset}`)}catch{return console.error(`${B.red}Could not find an available port${B.reset}`),!1}if(Y){let D=X.hmrPort||W0+1;J=X$({wsPort:D,verbose:!1}),G=J.start(D)}let v1=(D,T)=>{let S=`<script data-stx-route-params>(function(){var p=${JSON.stringify(T).replace(/</g,"\\u003C").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")};window.__stx_rp=p;if(window.stx){window.stx._rp=p;if(window.stx.setRouteParams)window.stx.setRouteParams(p)}})()</script>`;if(D.includes("</head>"))return D.replace("</head>",`${S}</head>`);if(D.includes("<body"))return D.replace(/<body([^>]*)>/,`<body$1>${S}`);return S+D};console.log(`${B.blue}Starting server...${B.reset}`);let g1=N4({port:W0,async fetch(D){let T=new URL(D.url),x=_?.publicDir||"public",S=g.join(W,x,T.pathname),b=g.join(W,T.pathname),_0=g.join(R,T.pathname),[K0,C0,u$]=await Promise.all([J0.promises.stat(S).catch(()=>null),J0.promises.stat(b).catch(()=>null),J0.promises.stat(_0).catch(()=>null)]);if(K0?.isFile())return e$(S);if(C0?.isFile())return e$(b);if(u$?.isFile())return e$(_0);if(T.pathname.startsWith("/_stx/component/")){let k=decodeURIComponent(T.pathname.slice(16));if(k)try{let y=`<${k} />`,m={...buildConfig,autoShell:!1},c=await processDirectives(y,{},g.join(W,"components",`${k}.stx`),m,new Set);return new Response(c,{headers:{"Content-Type":"text/html"}})}catch(y){return new Response(`<div class="stx-async-error">${y.message}</div>`,{status:500,headers:{"Content-Type":"text/html"}})}}if(T.pathname==="/_stx/img"){let{handleImageRequest:k}=await import("./chunk-cfx3vjh6.js"),y=await k(D,{publicDir:g.join(W,x),cacheDir:S0(W,"cache","img")});if(y)return y}if(M)try{let k=await M.handleRequest(D);if(k.status!==404)return k}catch{}if(V[T.pathname])try{return await V[T.pathname](D)}catch(k){return new Response(JSON.stringify({error:k.message}),{status:500,headers:{"Content-Type":"application/json"}})}let r=$5(T.pathname,j);if(r){let k=w.get(r.route.pattern),y=C.has(r.route.pattern);if(r.route.isDynamic&&Object.keys(r.params).length>0||y){let m=await h(r.route,r.params);if(m)k=m}if(k){let m=k.status??200,c=k.headers??{},s=(r.route.filePath?x6(await Bun.file(r.route.filePath).text().catch(()=>"")):null)??{};if(s.validate){if(!await s.validate({params:r.params})){let B0=await I(404);if(B0){let a=B0;if(a=await o(a,W),Y)a=D0(a,G);return new Response(a,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}}if(s.middleware){let U0=w6(T.pathname,r.params,s,T.search),B0=T6(U0,null,D,{isServer:!0}),a=await C6(s.middleware,B0);if(a.redirect){let e=a.redirect.path,n=a.redirect.options.redirectCode||302,r0=new Headers(a.responseHeaders);return r0.set("Location",e),new Response(null,{status:n,headers:r0})}if(a.abort){let{statusCode:e,message:n}=a.abort.error;return new Response(`<!DOCTYPE html><html><head><title>Error ${e}</title></head><body><h1>Error ${e}</h1><p>${n}</p></body></html>`,{status:e,headers:{"Content-Type":"text/html"}})}if(Object.keys(a.state).length>0){let e=`<script>(function(){var s=typeof stx!=='undefined'?stx:{};s._ms=${JSON.stringify(a.state)};if(s.setMiddlewareState)s.setMiddlewareState(s._ms);})()</script>`;k.content=k.content.replace("</head>",`${e}</head>`)}}let v=k.content;if(q&&v6(D)){let U0=k6(v),B0=S6(v),a=v.match(/<title[^>]*>([\s\S]*?)<\/title>/i),e=a?a[1].trim():"";if(Object.keys(r.params).length>0)v=v1(v,r.params);v=await o(v,W);let n=_?.router?.container||"main";return v=g6(v,n),new Response(v,{status:m,headers:{"Content-Type":"text/html","X-STX-Fragment":"true","X-STX-Layout":U0.layout,"X-STX-Layout-Group":U0.group,"X-STX-Runtime":B0?"true":"false",...e&&{"X-STX-Title":encodeURIComponent(e)},[P6]:b6(),...Z1(),"Cache-Control":U$}})}if(q)v=B$(q,v);if(Object.keys(r.params).length>0)v=v1(v,r.params);if(v=await o(v,W),Y)v=D0(v,G);if(X.native)if(v.includes("<head>"))v=v.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else v="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+v;if(X.titlebarHidden)if(v.includes("<head>"))v=v.replace("<head>","<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script>");else v=`<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>${v}`;if(k.boundaries&&k.boundaries.length>0){let{renderStreamingPage:U0,streamToResponse:B0}=await import("./chunk-7ncfmg13.js");return B0(U0(v,k.boundaries,{timeoutMs:30000}),{status:m,headers:{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}return new Response(v,{status:m,headers:{"Content-Type":"text/html",...Z1(),"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0",...c}})}}if(L.length>0){let k=L.map((m)=>m.route),y=$5(T.pathname,k);if(y){let m=H.get(y.route.pattern);if(m){let c=m.content;if(q)c=B$(q,c);if(Object.keys(y.params).length>0)c=v1(c,y.params);if(c=await o(c,W),Y)c=D0(c,G);return new Response(c,{status:m.status??200,headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}for(let{prefix:m}of O)if(m!=="/"&&T.pathname.startsWith(m)){let c=H.get(m)||H.get(m+"/");if(c){let s=c.content;if(q)s=B$(q,s);if(s=await o(s,W),Y)s=D0(s,G);return new Response(s,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}}let f1=w.get("/");if(f1){let k=f1.content;if(k=await o(k,W),Y)k=D0(k,G);if(X.native)if(k.includes("<head>"))k=k.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else k="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+k;return new Response(k,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}let h1=await I(404);if(h1){let k=h1;if(k=await o(k,W),Y)k=D0(k,G);return new Response(k,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})},async error(D){let T=await I(500);if(T)return new Response(T,{status:500,headers:{"Content-Type":"text/html"}});return new Response(`<pre>${D}
1611
1611
  ${D.stack}</pre>`,{headers:{"Content-Type":"text/html"}})}});if(console.clear(),console.log(`
1612
1612
  ${B.blue}stx${B.reset} ${B.green}${process.env.stx_VERSION||"v0.0.10"}${B.reset} ${B.dim}ready in ${Math.random()*10+5|0}.${Math.random()*90+10|0} ms${B.reset}`),console.log(`
1613
1613
  ${B.bright}\u2192 ${B.cyan}http://localhost:${W0}/${B.reset}`),Y)console.log(`${B.dim} HMR: ws://localhost:${G}${B.reset}`);console.log(`
1614
1614
  ${B.yellow}Routes:${B.reset}`);let a0=[...E6(j,W)];for(let{route:D}of L)a0.push(`${D.pattern}`);if(a0.forEach((D,T)=>{let S=T===a0.length-1?"\u2514\u2500 ":"\u251C\u2500 ";console.log(` ${B.green}${S}${B.reset}${D}`)}),console.log(`
1615
- Press ${B.cyan}h${B.reset} + ${B.cyan}Enter${B.reset} to show shortcuts`),x0(g1.url.toString(),()=>{if(J)A1();g1.stop()}),X.native){let D,T=g.join(z,"index.stx");if(J0.existsSync(T)){let S=await Bun.file(T).text();D=o1(S)}let x=_?.app?.window??{};await t0(W0,{title:_?.app?.head?.title||g.basename(W)||"stx App",width:x.width,height:x.height,darkMode:x.darkMode,hotReload:x.hotReload,titlebarHidden:x.titlebarHidden??X.titlebarHidden===!0,nativeSidebar:!!D,sidebarConfig:D})}if(Z){console.log(`${B.blue}Watching for changes...${B.reset}`);let D=(S)=>{return S.startsWith("public/")||S.startsWith("public\\")},T=(S)=>{let b=S.toLowerCase();return b.endsWith(".stx")||b.endsWith(".html")||b.endsWith(".md")},x=J0.watch(W,{recursive:!0},async(S,b)=>{if(!b||$$(b))return;if(e1(b))if(D(b)){if(console.log(`${B.cyan}${b} changed${B.reset}`),Y&&J)J.reload(b)}else if(T(b)){console.log(`${B.yellow}${b} changed, rebuilding...${B.reset}`),m0.clear(),p0();try{let{invalidateFileCache:_0,templateCache:K0}=await import("./chunk-kagw0ckh.js");_0(g.resolve(W,b)),K0.delete(g.resolve(W,b))}catch{}if(A&&b){if(g.resolve(W,b)===A||g.basename(A)===b){let K0=await Q5(A,X.stxOptions||{});if(K0)q=K0}}if(await t(),await K$(W),Y&&J)J.reload(b)}else{console.log(`${B.yellow}${b} changed, rebuilding...${B.reset}`),m0.clear(),p0();try{let{invalidateFileCache:_0,templateCache:K0}=await import("./chunk-kagw0ckh.js");_0(g.resolve(W,b)),K0.delete(g.resolve(W,b))}catch{}if(await t(),Y&&J)J.reload(b)}else if(t1(b)){if(console.log(`${B.cyan}CSS ${b} changed${B.reset}`),Y&&J)J.updateCss(b)}});process.on("SIGINT",()=>{if(x.close(),J)A1();g1.stop(),process.exit(0)})}return!0}var P={enabled:!1,components:new Map,stores:new Map,events:[],performance:[],selectedComponent:null,selectedStore:null,maxEvents:1000,maxPerformance:500};function V4($={}){if(typeof window>"u")return;P.enabled=!0,P.maxEvents=$.maxEvents||1000,P.maxPerformance=$.maxPerformance||500,window.__STX_DEVTOOLS__={getState:()=>P,getComponents:()=>Array.from(P.components.values()),getComponent:(X)=>P.components.get(X),getStores:()=>Array.from(P.stores.values()),getStore:(X)=>P.stores.get(X),getEvents:()=>P.events,getPerformance:()=>P.performance,selectComponent:(X)=>J5(X),selectStore:(X)=>R4(X),inspectElement:(X)=>I4(X),highlightComponent:(X)=>m6(X),clearHighlight:()=>p6(),logComponentTree:()=>D4(),logStoreState:(X)=>w4(X),timeTravel:(X,Q)=>T4(X,Q)},k4(),C4(),console.log("%c[STX DevTools] Enabled","color: #10b981; font-weight: bold;")}function E4(){P.enabled=!1,delete window.__STX_DEVTOOLS__;let $=document.getElementById("stx-devtools-panel");if($)$.remove();console.log("%c[STX DevTools] Disabled","color: #ef4444;")}function f6($){if(!P.enabled)return;let X=P.components.get($);if(X){if(X.parentId){let Q=P.components.get(X.parentId);if(Q)Q.children=Q.children.filter((Z)=>Z!==$)}P.components.delete($),Y5({timestamp:Date.now(),type:"component:unmounted",componentId:$,payload:{name:X.name}})}}function d6($,X,Q={},Z=[]){if(!P.enabled)return;let Y={id:$,state:X,getters:Q,actions:Z,history:[{timestamp:Date.now(),type:"state",name:"__init__",newValue:X}]};P.stores.set($,Y),Y5({timestamp:Date.now(),type:"store:registered",payload:{id:$,state:X}})}function u6($,X,Q,Z,Y="state"){if(!P.enabled)return;let J=P.stores.get($);if(J){let G={timestamp:Date.now(),type:Y,name:X,oldValue:Q,newValue:Z,stack:Error().stack};if(J.history.push(G),J.history.length>100)J.history=J.history.slice(-100);if(Y==="state")J.state={...J.state,[X]:Z};Y5({timestamp:Date.now(),type:`store:${Y}`,payload:{storeId:$,name:X,oldValue:Q,newValue:Z}})}}function Y5($){if(!P.enabled)return;if(P.events.push($),P.events.length>P.maxEvents)P.events=P.events.slice(-P.maxEvents);if(typeof window<"u")window.dispatchEvent(new CustomEvent("stx:devtools:event",{detail:$}))}function J5($){P.selectedComponent=$;let X=P.components.get($);if(X)m6($),console.log("%c[STX DevTools] Selected component:","color: #3b82f6;",X);return X}function R4($){P.selectedStore=$;let X=P.stores.get($);if(X)console.log("%c[STX DevTools] Selected store:","color: #8b5cf6;",X);return X}function I4($){let X=$;while(X){let Q=X.getAttribute("data-stx-component-id");if(Q)return J5(Q);X=X.parentElement}console.log("%c[STX DevTools] No component found for element","color: #f59e0b;");return}function m6($){p6();let X=P.components.get($);if(X?.element){let Q=document.createElement("div");Q.id="stx-devtools-highlight",Q.style.cssText=`
1615
+ Press ${B.cyan}h${B.reset} + ${B.cyan}Enter${B.reset} to show shortcuts`),x0(g1.url.toString(),()=>{if(J)A1();g1.stop()}),X.native){let D,T=g.join(z,"index.stx");if(J0.existsSync(T)){let S=await Bun.file(T).text();D=o1(S)}let x=_?.app?.window??{};await t0(W0,{title:_?.app?.head?.title||g.basename(W)||"stx App",width:x.width,height:x.height,darkMode:x.darkMode,hotReload:x.hotReload,titlebarHidden:x.titlebarHidden??X.titlebarHidden===!0,nativeSidebar:!!D,sidebarConfig:D})}if(Z){console.log(`${B.blue}Watching for changes...${B.reset}`);let D=(S)=>{return S.startsWith("public/")||S.startsWith("public\\")},T=(S)=>{let b=S.toLowerCase();return b.endsWith(".stx")||b.endsWith(".html")||b.endsWith(".md")},x=J0.watch(W,{recursive:!0},async(S,b)=>{if(!b||$$(b))return;if(e1(b))if(D(b)){if(console.log(`${B.cyan}${b} changed${B.reset}`),Y&&J)J.reload(b)}else if(T(b)){console.log(`${B.yellow}${b} changed, rebuilding...${B.reset}`),m0.clear(),p0();try{let{invalidateFileCache:_0,templateCache:K0}=await import("./chunk-8tdj5zep.js");_0(g.resolve(W,b)),K0.delete(g.resolve(W,b))}catch{}if(A&&b){if(g.resolve(W,b)===A||g.basename(A)===b){let K0=await Q5(A,X.stxOptions||{});if(K0)q=K0}}if(await t(),await K$(W),Y&&J)J.reload(b)}else{console.log(`${B.yellow}${b} changed, rebuilding...${B.reset}`),m0.clear(),p0();try{let{invalidateFileCache:_0,templateCache:K0}=await import("./chunk-8tdj5zep.js");_0(g.resolve(W,b)),K0.delete(g.resolve(W,b))}catch{}if(await t(),Y&&J)J.reload(b)}else if(t1(b)){if(console.log(`${B.cyan}CSS ${b} changed${B.reset}`),Y&&J)J.updateCss(b)}});process.on("SIGINT",()=>{if(x.close(),J)A1();g1.stop(),process.exit(0)})}return!0}var P={enabled:!1,components:new Map,stores:new Map,events:[],performance:[],selectedComponent:null,selectedStore:null,maxEvents:1000,maxPerformance:500};function V4($={}){if(typeof window>"u")return;P.enabled=!0,P.maxEvents=$.maxEvents||1000,P.maxPerformance=$.maxPerformance||500,window.__STX_DEVTOOLS__={getState:()=>P,getComponents:()=>Array.from(P.components.values()),getComponent:(X)=>P.components.get(X),getStores:()=>Array.from(P.stores.values()),getStore:(X)=>P.stores.get(X),getEvents:()=>P.events,getPerformance:()=>P.performance,selectComponent:(X)=>J5(X),selectStore:(X)=>R4(X),inspectElement:(X)=>I4(X),highlightComponent:(X)=>m6(X),clearHighlight:()=>p6(),logComponentTree:()=>D4(),logStoreState:(X)=>w4(X),timeTravel:(X,Q)=>T4(X,Q)},k4(),C4(),console.log("%c[STX DevTools] Enabled","color: #10b981; font-weight: bold;")}function E4(){P.enabled=!1,delete window.__STX_DEVTOOLS__;let $=document.getElementById("stx-devtools-panel");if($)$.remove();console.log("%c[STX DevTools] Disabled","color: #ef4444;")}function f6($){if(!P.enabled)return;let X=P.components.get($);if(X){if(X.parentId){let Q=P.components.get(X.parentId);if(Q)Q.children=Q.children.filter((Z)=>Z!==$)}P.components.delete($),Y5({timestamp:Date.now(),type:"component:unmounted",componentId:$,payload:{name:X.name}})}}function d6($,X,Q={},Z=[]){if(!P.enabled)return;let Y={id:$,state:X,getters:Q,actions:Z,history:[{timestamp:Date.now(),type:"state",name:"__init__",newValue:X}]};P.stores.set($,Y),Y5({timestamp:Date.now(),type:"store:registered",payload:{id:$,state:X}})}function u6($,X,Q,Z,Y="state"){if(!P.enabled)return;let J=P.stores.get($);if(J){let G={timestamp:Date.now(),type:Y,name:X,oldValue:Q,newValue:Z,stack:Error().stack};if(J.history.push(G),J.history.length>100)J.history=J.history.slice(-100);if(Y==="state")J.state={...J.state,[X]:Z};Y5({timestamp:Date.now(),type:`store:${Y}`,payload:{storeId:$,name:X,oldValue:Q,newValue:Z}})}}function Y5($){if(!P.enabled)return;if(P.events.push($),P.events.length>P.maxEvents)P.events=P.events.slice(-P.maxEvents);if(typeof window<"u")window.dispatchEvent(new CustomEvent("stx:devtools:event",{detail:$}))}function J5($){P.selectedComponent=$;let X=P.components.get($);if(X)m6($),console.log("%c[STX DevTools] Selected component:","color: #3b82f6;",X);return X}function R4($){P.selectedStore=$;let X=P.stores.get($);if(X)console.log("%c[STX DevTools] Selected store:","color: #8b5cf6;",X);return X}function I4($){let X=$;while(X){let Q=X.getAttribute("data-stx-component-id");if(Q)return J5(Q);X=X.parentElement}console.log("%c[STX DevTools] No component found for element","color: #f59e0b;");return}function m6($){p6();let X=P.components.get($);if(X?.element){let Q=document.createElement("div");Q.id="stx-devtools-highlight",Q.style.cssText=`
1616
1616
  position: absolute;
1617
1617
  background: rgba(59, 130, 246, 0.2);
1618
1618
  border: 2px solid #3b82f6;
@@ -2881,9 +2881,9 @@ describe('Example', () => {
2881
2881
  </footer>
2882
2882
  @yield('scripts')
2883
2883
  </body>
2884
- </html>`}function iX(){return"<!-- Hero section -->"}function aX(){return"<!-- Features -->"}function rX(){return"<!-- Pricing -->"}function sX(){return"<!-- Button -->"}function C1($){if(!T1($))L5($,{recursive:!0})}function nX(){if(T1("bun.lockb"))return"bun";if(T1("pnpm-lock.yaml"))return"pnpm";if(T1("yarn.lock"))return"yarn";return"bun"}function F5($){return $.replace(/[-_\s]+(.)?/g,(X,Q)=>Q?Q.toUpperCase():"").replace(/^./,(X)=>X.toUpperCase())}function oX($){return $.replace(/[-_\s]+(.)?/g,(X,Q)=>Q?Q.toUpperCase():"").replace(/^./,(X)=>X.toLowerCase())}function c0($){return $.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}var{serve:tX}=globalThis.Bun;import k1 from"fs";import y0 from"path";function p2($,X=200,Q={}){return new Response($,{status:X,headers:{"Content-Type":"text/html; charset=utf-8",...Q}})}async function J8($){let{loadStxConfig:X}=await import("./chunk-hwn896re.js");return{...await X($.configDir??process.cwd()).catch(()=>({})),...$.stxOptions??{}}}async function eX($={}){let{port:X=3000,root:Q=".",watch:Z=!0,onRequest:Y,routes:J={},middleware:G=[],on404:W,onError:K}=$,_=y0.resolve(Q),U=await J8($),F=new Map;async function z(A){let N=k1.statSync(A),V=`${A}:${N.mtimeMs}`,M=F.get(V);if(M)return{content:M.content,status:M.status,headers:M.headers};for(let T of F.keys())if(T.startsWith(`${A}:`)&&T!==V)F.delete(T);let R=await Bun.file(A).text(),w=R,C=Z$(R);if(C)w=C.content.trim();let I=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,E=[],h=[],u;while((u=I.exec(R))!==null){let T=u[1],x=u[2],S=u[0];if(T.includes("server"))h.push(x);else E.push(S)}let t=R.match(/<style\b[^>]*>[\s\S]*?<\/style>/gi)||[],d5=w.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,""),W0={__filename:A,__dirname:y0.dirname(A)};for(let T of h)await j0(T,W0,A);let q0=await O0(d5,W0,A,U,new Set);if(t.length>0){let T=t.join(`
2884
+ </html>`}function iX(){return"<!-- Hero section -->"}function aX(){return"<!-- Features -->"}function rX(){return"<!-- Pricing -->"}function sX(){return"<!-- Button -->"}function C1($){if(!T1($))L5($,{recursive:!0})}function nX(){if(T1("bun.lockb"))return"bun";if(T1("pnpm-lock.yaml"))return"pnpm";if(T1("yarn.lock"))return"yarn";return"bun"}function F5($){return $.replace(/[-_\s]+(.)?/g,(X,Q)=>Q?Q.toUpperCase():"").replace(/^./,(X)=>X.toUpperCase())}function oX($){return $.replace(/[-_\s]+(.)?/g,(X,Q)=>Q?Q.toUpperCase():"").replace(/^./,(X)=>X.toLowerCase())}function c0($){return $.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}var{serve:tX}=globalThis.Bun;import k1 from"fs";import y0 from"path";function p2($,X=200,Q={}){return new Response($,{status:X,headers:{"Content-Type":"text/html; charset=utf-8",...Q}})}async function J8($){let{loadStxConfig:X}=await import("./chunk-b24chdr8.js");return{...await X($.configDir??process.cwd()).catch(()=>({})),...$.stxOptions??{}}}async function eX($={}){let{port:X=3000,root:Q=".",watch:Z=!0,onRequest:Y,routes:J={},middleware:G=[],on404:W,onError:K}=$,_=y0.resolve(Q),U=await J8($),F=new Map;async function z(A){let N=k1.statSync(A),V=`${A}:${N.mtimeMs}`,M=F.get(V);if(M)return{content:M.content,status:M.status,headers:M.headers};for(let T of F.keys())if(T.startsWith(`${A}:`)&&T!==V)F.delete(T);let R=await Bun.file(A).text(),w=R,C=Z$(R);if(C)w=C.content.trim();let I=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,E=[],h=[],u;while((u=I.exec(R))!==null){let T=u[1],x=u[2],S=u[0];if(T.includes("server"))h.push(x);else E.push(S)}let t=R.match(/<style\b[^>]*>[\s\S]*?<\/style>/gi)||[],d5=w.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,""),W0={__filename:A,__dirname:y0.dirname(A)};for(let T of h)await j0(T,W0,A);let q0=await O0(d5,W0,A,U,new Set);if(t.length>0){let T=t.join(`
2885
2885
  `);if(q0.match(/(<\/head>)/i))q0=q0.replace(/(<\/head>)/i,`${T}
2886
- $1`)}if(E.length>0){let{interpolateScriptsInTemplate:T}=await import("./chunk-1pwcgb1t.js"),x=T(E.join(`
2886
+ $1`)}if(E.length>0){let{interpolateScriptsInTemplate:T}=await import("./chunk-e17ys98t.js"),x=T(E.join(`
2887
2887
  `),W0);if(q0.match(/(<\/body>)/i))q0=q0.replace(/(<\/body>)/i,`${x}
2888
2888
  $1`);else q0+=`
2889
2889
  ${x}`}let a0=N1(W0),D=M1(W0);return F.set(V,{content:q0,mtime:N.mtimeMs,status:a0,headers:D}),{content:q0,status:a0,headers:D}}async function j(A){let N=k1.statSync(A),V=`${A}:${N.mtimeMs}`,M=F.get(V);if(M)return M.content;let{content:R}=await V0(A,U);return F.set(V,{content:R,mtime:N.mtimeMs}),R}function O(A){let N=A.startsWith("/")?A.slice(1):A,V=[N,`${N}.stx`,`${N}.md`,`${N}.html`,y0.join(N,"index.stx"),y0.join(N,"index.md"),y0.join(N,"index.html")];for(let M of V){let R=y0.join(_,M);if(k1.existsSync(R)&&k1.statSync(R).isFile())return R}return null}async function L(A){let N=new URL(A.url),V=async()=>{if(J[N.pathname])return await J[N.pathname](A);if(Y){let R=await Y(A);if(R)return R}let M=O(N.pathname);if(!M){if(W)return await W(A);return new Response("Not Found",{status:404})}try{let R,w="text/html",C,I;if(M.endsWith(".stx")){let E=await z(M);R=E.content,C=E.status,I=E.headers}else if(M.endsWith(".md"))R=await j(M);else if(M.endsWith(".html"))R=await Bun.file(M).text();else if(M.endsWith(".css"))R=await Bun.file(M).text(),w="text/css";else if(M.endsWith(".js"))R=await Bun.file(M).text(),w="text/javascript";else if(M.endsWith(".json"))R=await Bun.file(M).text(),w="application/json";else return new Response(Bun.file(M));return new Response(R,{status:C??200,headers:{"Content-Type":w,...I}})}catch(R){if(K)return await K(R,A);let w=R instanceof Error?R.message:String(R),I=U?.debug===!0?`<h1>Error</h1><pre>${w}
@@ -4315,7 +4315,7 @@ else {
4315
4315
  \u26A0\uFE0F Built ${Q.views.length} views with ${Q.errors.length} errors`);return Q}function Z9($,X){let Q=V$.watch($.viewsDir,{recursive:!0},async(Z,Y)=>{if(!Y)return;if(Y.endsWith(".stx")||Y.endsWith(".ts")||Y.endsWith(".js")){if($.debug)console.log(`
4316
4316
  File changed: ${Y}, rebuilding...`);let J=await VZ($);X?.(J)}});return{close:()=>Q.close()}}async function Y9($,X={},Q={}){let Z={...Q,skipDefaultSeoTags:!0,skipSignalsRuntime:!0},Y=await V7($,X,Z);Y=await EZ(Y),Y=Y.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),Y=Y.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,""),Y=Y.replace(/<!--\s*stx SEO Tags\s*-->/gi,""),Y=Y.replace(/\n\s*\n\s*\n/g,`
4317
4317
 
4318
- `).trim();let J=IZ(Y);return{html:Y,text:J}}async function EZ($){try{let{generateCss:X,extractClassNames:Q}=await import("./chunk-dd7f8yxx.js");if(Q($).size===0)return $;let Y=await X($);if(!Y)return $;let J=RZ(Y);if(J.size===0)return $;return $.replace(/(<[a-z][a-z0-9]*)((?:\s+[a-z][a-z0-9-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s+)class\s*=\s*"([^"]*)"((?:\s+[a-z][a-z0-9-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)(\/?>)/gi,(G,W,K,_,U,F)=>{let z=_.split(/\s+/).filter(Boolean),j=[];for(let q of z){let A=J.get(q);if(A)j.push(A)}if(j.length===0)return`${W}${K}class="${_}"${U}${F}`;let O=j.join("; "),H=`${K}${U}`.match(/style\s*=\s*"([^"]*)"/);if(H){let q=`${O}; ${H[1]}`,A=K.replace(/style\s*=\s*"[^"]*"/,`style="${q}"`),N=U.replace(/style\s*=\s*"[^"]*"/,`style="${q}"`);return`${W}${A}class="${_}"${N}${F}`}return`${W}${K}class="${_}" style="${O}"${U}${F}`})}catch{return $}}function RZ($){let X=new Map,Q=/\.([a-zA-Z0-9_-]+(?:\\:[a-zA-Z0-9_-]+)*)\s*\{([^}]+)\}/g,Z=Q.exec($);while(Z!==null){let Y=Z[1].replace(/\\/g,""),J=Z[2].split(";").map((G)=>G.trim()).filter(Boolean).join("; ");if(J)X.set(Y,J);Z=Q.exec($)}return X}function IZ($){return $.replace(/<br\s*\/?>/gi,`
4318
+ `).trim();let J=IZ(Y);return{html:Y,text:J}}async function EZ($){try{let{generateCss:X,extractClassNames:Q}=await import("./chunk-1ge7rfg4.js");if(Q($).size===0)return $;let Y=await X($);if(!Y)return $;let J=RZ(Y);if(J.size===0)return $;return $.replace(/(<[a-z][a-z0-9]*)((?:\s+[a-z][a-z0-9-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s+)class\s*=\s*"([^"]*)"((?:\s+[a-z][a-z0-9-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)(\/?>)/gi,(G,W,K,_,U,F)=>{let z=_.split(/\s+/).filter(Boolean),j=[];for(let q of z){let A=J.get(q);if(A)j.push(A)}if(j.length===0)return`${W}${K}class="${_}"${U}${F}`;let O=j.join("; "),H=`${K}${U}`.match(/style\s*=\s*"([^"]*)"/);if(H){let q=`${O}; ${H[1]}`,A=K.replace(/style\s*=\s*"[^"]*"/,`style="${q}"`),N=U.replace(/style\s*=\s*"[^"]*"/,`style="${q}"`);return`${W}${A}class="${_}"${N}${F}`}return`${W}${K}class="${_}" style="${O}"${U}${F}`})}catch{return $}}function RZ($){let X=new Map,Q=/\.([a-zA-Z0-9_-]+(?:\\:[a-zA-Z0-9_-]+)*)\s*\{([^}]+)\}/g,Z=Q.exec($);while(Z!==null){let Y=Z[1].replace(/\\/g,""),J=Z[2].split(";").map((G)=>G.trim()).filter(Boolean).join("; ");if(J)X.set(Y,J);Z=Q.exec($)}return X}function IZ($){return $.replace(/<br\s*\/?>/gi,`
4319
4319
  `).replace(/<\/(p|div|h[1-6]|li|tr)>/gi,`
4320
4320
  `).replace(/<\/td>/gi,"\t").replace(/<[^>]*>/g,"").replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&copy;/g,"(c)").replace(/&middot;/g,"-").replace(/\n\s*\n\s*\n/g,`
4321
4321
 
@@ -4450,7 +4450,7 @@ ${R}`}function Z0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").repla
4450
4450
  `;let Q=$.sitemap!==!1?`Sitemap: ${$.url.replace(/\/$/,"")}/sitemap.xml
4451
4451
  `:"";if(X==="disallow")return["User-agent: *","Disallow: /","",Q].filter(Boolean).join(`
4452
4452
  `);return["User-agent: *","Allow: /","",Q].filter(Boolean).join(`
4453
- `)}var F1=null;async function JY(){if(F1!==null)return F1;try{let $=await import("./chunk-7wnbgnxj.js");if(typeof $.getRouterScript==="function")F1=$.getRouterScript();else F1=""}catch{F1=""}return F1}async function b5($,X){let Q=await JY();if(!Q)return $;let Z={interceptAllLinks:!0,container:"main",...X},J=`${`<script>window.__stxRouterConfig=${JSON.stringify(Z)};</script>
4453
+ `)}var F1=null;async function JY(){if(F1!==null)return F1;try{let $=await import("./chunk-qzbwa5xe.js");if(typeof $.getRouterScript==="function")F1=$.getRouterScript();else F1=""}catch{F1=""}return F1}async function b5($,X){let Q=await JY();if(!Q)return $;let Z={interceptAllLinks:!0,container:"main",...X},J=`${`<script>window.__stxRouterConfig=${JSON.stringify(Z)};</script>
4454
4454
  `}<script>${Q}</script>`;if(/<\/body>/i.test($))return $.replace(/<\/body>/i,`${J}
4455
4455
  </body>`);return`${$}
4456
4456
  ${J}`}var GY=`window.__stxThemeIcon=function(isDark){try{var want=isDark?'dark':'light';var pick=document.querySelector('link[rel~="icon"][media*="prefers-color-scheme: '+want+'"]');if(!pick)return;var live=document.querySelector('link[rel~="icon"]:not([media])');if(!live){live=document.createElement('link');live.setAttribute('rel','icon');document.head.appendChild(live)}if(pick.type)live.setAttribute('type',pick.type);var href=pick.getAttribute('href');if(live.getAttribute('href')!==href)live.setAttribute('href',href)}catch(e){}};`,WY=($,X,Q,Z)=>`(function(){${GY}function read(){try{var k=${JSON.stringify(X)};var t=localStorage.getItem(k);return t===null?(${JSON.stringify($)}==='dark'||(${JSON.stringify($)}==='auto'&&window.matchMedia('(prefers-color-scheme: dark)').matches)):t==='dark'}catch(e){return ${JSON.stringify($)}==='dark'}}function apply(){var isDark=read();var html=document.documentElement;html.classList[isDark?'add':'remove']('dark');var color=isDark?${JSON.stringify(Z)}:${JSON.stringify(Q)};if(!document.head)return;var tc=document.querySelector('meta[name="theme-color"]:not([media])');if(!tc){tc=document.createElement('meta');tc.setAttribute('name','theme-color');tc.setAttribute('data-stx-theme-meta','1')}tc.setAttribute('content',color);if(tc!==document.head.firstChild){document.head.insertBefore(tc,document.head.firstChild)}if(window.__stxThemeIcon)window.__stxThemeIcon(isDark)}apply();window.addEventListener('stx:navigate',apply);window.addEventListener('popstate',apply)})();`,KY=($,X,Q)=>`document.addEventListener('click',function(e){var t=e.target&&e.target.closest&&e.target.closest('#theme-toggle');if(!t)return;var html=document.documentElement;var isDark=html.classList.toggle('dark');try{localStorage.setItem(${JSON.stringify($)},isDark?'dark':'light')}catch(e){}var tc=document.querySelector('meta[name="theme-color"]:not([media])');if(tc)tc.setAttribute('content',isDark?${JSON.stringify(Q)}:${JSON.stringify(X)});if(window.__stxThemeIcon)window.__stxThemeIcon(isDark)});`;function C$($,X){if(X.theme===!1)return $;let Q=$.includes(g7),Z=typeof X.theme==="object"&&X.theme!==null?X.theme:{},Y=Z.default??"dark",J=Z.storageKey??"theme",G=Z.colors?.light??"#ffffff",W=Z.colors?.dark??"#000000";if(Y==="dark"&&!Q){if(!/<html\b[^>]*\bclass=/.test($))$=$.replace(/<html\b([^>]*)>/i,'<html$1 class="dark">');else if(!/<html\b[^>]*\bclass="[^"]*\bdark\b/.test($))$=$.replace(/<html\b([^>]*\bclass=")([^"]*)(")/i,"<html$1$2 dark$3")}if(!$.includes("data-stx-theme-meta")&&/<head\b[^>]*>/i.test($)){let K=['<meta name="color-scheme" content="dark light" data-stx-theme-meta="1">',`<meta name="theme-color" media="(prefers-color-scheme: light)" content="${G}" data-stx-theme-meta="1">`,`<meta name="theme-color" media="(prefers-color-scheme: dark)" content="${W}" data-stx-theme-meta="1">`].join(`
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{ng as v,og as i,pg as t,sg as e,tg as HH,ug as KH,vg as QH,wg as YH,xg as ZH}from"./chunk-bcgywywg.js";import{_i as s}from"./chunk-p9wkzh0k.js";import{Sl as a}from"./chunk-tjverybm.js";import{Ft as h}from"./chunk-ja39jznm.js";import{au as f}from"./chunk-359ps7j5.js";import{existsSync as $H,readFileSync as qH}from"fs";import J from"path";function GH(K,Q="",V=""){let L=K.startLine>1?`
2
+ import{ng as v,og as i,pg as t,sg as e,tg as HH,ug as KH,vg as QH,wg as YH,xg as ZH}from"./chunk-bax52sn4.js";import{_i as s}from"./chunk-24pgjzmy.js";import{Tl as a}from"./chunk-6z04mpxz.js";import{Gt as h}from"./chunk-kgxkrnyt.js";import{bu as f}from"./chunk-6kdb8j9d.js";import{existsSync as $H,readFileSync as qH}from"fs";import J from"path";function GH(K,Q="",V=""){let L=K.startLine>1?`
3
3
  `.repeat(K.startLine-1):"",N=t(i(K.code)),X=K.kind==="client"||K.kind==="plain"?HH(Q,K.code):"";return QH(`${L+N}
4
4
  ${X}
5
5
  export {}
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{qi as a}from"./chunk-k0y7ta0d.js";import"./chunk-vwqv8f0y.js";export{a as rewriteImagesWithSiblings};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$n as b,ao as c,bo as d}from"./chunk-6z04mpxz.js";import{bs as a}from"./chunk-3mbkn6vk.js";import"./chunk-dn8006f7.js";import"./chunk-vg8yh8te.js";import"./chunk-c5rehxqy.js";import"./chunk-xtwybxtw.js";import"./chunk-qfec1s34.js";import"./chunk-kgxkrnyt.js";import"./chunk-3npkbgfm.js";import"./chunk-nqwjb8k7.js";import"./chunk-nx96x8sh.js";import"./chunk-6kdb8j9d.js";import"./chunk-jmh31a2a.js";import"./chunk-d3kac3mv.js";import"./chunk-vwqv8f0y.js";export{b as rendersAsElement,c as processESImports,d as processComponents,a as freeIdentifiers};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{$h as c,Zh as a,_h as b,ai as d,bi as e,ci as f,di as g,ei as h,fi as i,gi as j,hi as k}from"./chunk-mywp77gt.js";import"./chunk-24j0qx2z.js";export{i as processStaticDirectives,b as processPartialHydrationDirectives,h as onHydrated,g as isHydrated,d as hydrateIsland,e as hydrateByStrategy,f as hydrateAll,c as generatePartialHydrationCSS,j as generateIslandManifest,k as default,a as createIslandRegistry};
2
+ import{$h as c,Zh as a,_h as b,ai as d,bi as e,ci as f,di as g,ei as h,fi as i,gi as j,hi as k}from"./chunk-mywp77gt.js";import"./chunk-vwqv8f0y.js";export{i as processStaticDirectives,b as processPartialHydrationDirectives,h as onHydrated,g as isHydrated,d as hydrateIsland,e as hydrateByStrategy,f as hydrateAll,c as generatePartialHydrationCSS,j as generateIslandManifest,k as default,a as createIslandRegistry};