@stacksjs/stx 0.2.567 → 0.2.570

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 (198) hide show
  1. package/dist/chunk-0mw3d5fc.js +2 -0
  2. package/dist/{chunk-fpa1nq88.js → chunk-0pzbg1bt.js} +2 -2
  3. package/dist/chunk-0zq4btre.js +3 -0
  4. package/dist/chunk-1sh80b1c.js +2 -0
  5. package/dist/chunk-1xyhdpbn.js +2 -0
  6. package/dist/chunk-20nrvpps.js +2 -0
  7. package/dist/chunk-2j7tr8wj.js +2 -0
  8. package/dist/chunk-2mxhp1yy.js +2 -0
  9. package/dist/{chunk-gjx5256r.js → chunk-2t3bhp2j.js} +5 -5
  10. package/dist/chunk-32yj7sbw.js +2 -0
  11. package/dist/{chunk-c765y72x.js → chunk-35kmebz9.js} +4 -4
  12. package/dist/{chunk-203rr1c8.js → chunk-3m01ym55.js} +2 -2
  13. package/dist/chunk-3ss3vfad.js +2 -0
  14. package/dist/{chunk-kch9a9v1.js → chunk-3tzkqf6e.js} +2 -2
  15. package/dist/{chunk-4zb2ga7p.js → chunk-3wcwtqx1.js} +2 -2
  16. package/dist/chunk-4zp2zzch.js +2 -0
  17. package/dist/chunk-503w9dn3.js +2 -0
  18. package/dist/{chunk-18270qgd.js → chunk-5hxsdkvp.js} +2 -2
  19. package/dist/{chunk-ngcjy2dj.js → chunk-6m406xsn.js} +1 -1
  20. package/dist/chunk-6yja1c8e.js +2 -0
  21. package/dist/{chunk-mb59b499.js → chunk-724zsgbk.js} +5 -5
  22. package/dist/chunk-74va4kza.js +2 -0
  23. package/dist/chunk-74w81h3v.js +2 -0
  24. package/dist/chunk-85j8cxfd.js +2 -0
  25. package/dist/chunk-8bwp2m95.js +2 -0
  26. package/dist/{chunk-z2n1rtj5.js → chunk-8rj08x1d.js} +1 -1
  27. package/dist/{chunk-90qywh24.js → chunk-8yn9wxzt.js} +4 -4
  28. package/dist/{chunk-2ernwctg.js → chunk-8zmahjqg.js} +6 -6
  29. package/dist/chunk-98xp5rfe.js +2 -0
  30. package/dist/chunk-9ah35e2w.js +2 -0
  31. package/dist/chunk-9d1bs55s.js +2 -0
  32. package/dist/{chunk-7wyyjdks.js → chunk-9d6dr0dr.js} +2 -2
  33. package/dist/{chunk-dmf1jmge.js → chunk-9k6r7f3c.js} +4 -4
  34. package/dist/chunk-9rts16ta.js +2 -0
  35. package/dist/{chunk-m6m19hwd.js → chunk-9zf49tqg.js} +4 -4
  36. package/dist/{chunk-d1mqedk0.js → chunk-a2mztbta.js} +3 -3
  37. package/dist/{chunk-k2dgwy05.js → chunk-a849hqna.js} +2 -2
  38. package/dist/chunk-ajezxt0s.js +2 -0
  39. package/dist/chunk-bf572npc.js +2 -0
  40. package/dist/{chunk-g1epk002.js → chunk-brkq2s62.js} +3 -3
  41. package/dist/{chunk-7m0r2qs2.js → chunk-c1ys37c9.js} +2 -2
  42. package/dist/{chunk-tc01jkfc.js → chunk-chythmea.js} +1 -1
  43. package/dist/chunk-cqeccn7x.js +2 -0
  44. package/dist/{chunk-g8tx0yf8.js → chunk-d8jdr1k4.js} +4 -4
  45. package/dist/{chunk-8txqk9nq.js → chunk-dajh1369.js} +2 -2
  46. package/dist/{chunk-tsmbstj6.js → chunk-dgr561sc.js} +4 -4
  47. package/dist/{chunk-39tkfkp7.js → chunk-dkyqkkpj.js} +3 -3
  48. package/dist/chunk-dsdxa5x1.js +2 -0
  49. package/dist/{chunk-ghnkphy4.js → chunk-ebg20d8s.js} +2 -2
  50. package/dist/chunk-ectcp21m.js +2 -0
  51. package/dist/chunk-ewcnyvcd.js +2 -0
  52. package/dist/chunk-ez7r18ef.js +2 -0
  53. package/dist/{chunk-wy4hfmjs.js → chunk-fas9k7sw.js} +5 -5
  54. package/dist/chunk-ffgsaf9e.js +2 -0
  55. package/dist/chunk-fnnhekdc.js +2 -0
  56. package/dist/chunk-g8b74qvn.js +2 -0
  57. package/dist/chunk-ge87hcgb.js +2 -0
  58. package/dist/chunk-gra2v7xz.js +2 -0
  59. package/dist/{chunk-8afnq4qx.js → chunk-gwabvrc3.js} +3 -3
  60. package/dist/{chunk-6sf4v894.js → chunk-he2et28k.js} +4 -4
  61. package/dist/{chunk-n6va14bt.js → chunk-hvzznc50.js} +2 -2
  62. package/dist/{chunk-m8qgr307.js → chunk-j3vwyzvb.js} +3 -3
  63. package/dist/{chunk-s1xxkzc9.js → chunk-je0jxvmj.js} +4 -4
  64. package/dist/chunk-jg9fydw8.js +2 -0
  65. package/dist/{chunk-wsdn5fxe.js → chunk-jvm6agq7.js} +3 -3
  66. package/dist/{chunk-z06npyzn.js → chunk-k0shfsfx.js} +3 -3
  67. package/dist/{chunk-f46a7pvn.js → chunk-kaaxb9c5.js} +2 -2
  68. package/dist/{chunk-jbmhdyzz.js → chunk-knpzph55.js} +2 -2
  69. package/dist/{chunk-xw8kzm6b.js → chunk-kz131809.js} +148 -148
  70. package/dist/{chunk-8nr1kras.js → chunk-mbj9dbrh.js} +6 -6
  71. package/dist/chunk-mg8yjzkr.js +2 -0
  72. package/dist/chunk-mjkw1esn.js +2 -0
  73. package/dist/{chunk-7ze47qgv.js → chunk-mw2dravv.js} +5 -5
  74. package/dist/chunk-n0ra4mv3.js +2 -0
  75. package/dist/{chunk-pzasxhwz.js → chunk-ncq5n15k.js} +1 -1
  76. package/dist/{chunk-325p135t.js → chunk-nebtks7j.js} +9 -9
  77. package/dist/{chunk-01s01ten.js → chunk-nmy7mcbd.js} +4 -4
  78. package/dist/chunk-nspfk500.js +2 -0
  79. package/dist/chunk-nwyp2xaf.js +2 -0
  80. package/dist/{chunk-125rc958.js → chunk-nz0krznq.js} +2 -2
  81. package/dist/chunk-pdk87hhe.js +2 -0
  82. package/dist/{chunk-55hfvmvv.js → chunk-q8nw82pz.js} +9 -9
  83. package/dist/{chunk-wm11csdm.js → chunk-qh0es7mk.js} +2 -2
  84. package/dist/{chunk-9tcvkbb5.js → chunk-qw4fjtt1.js} +2 -2
  85. package/dist/{chunk-5grx48s2.js → chunk-r17t24jr.js} +2 -2
  86. package/dist/{chunk-tfeenp4h.js → chunk-r8h9b3f8.js} +94 -77
  87. package/dist/chunk-re030f77.js +2 -0
  88. package/dist/{chunk-68b64sj4.js → chunk-rh606w0q.js} +1 -1
  89. package/dist/chunk-rn80ctkd.js +2 -0
  90. package/dist/{chunk-3hkv4e7t.js → chunk-rrce2fyv.js} +1 -1
  91. package/dist/{chunk-saf7kypg.js → chunk-rtc17gy5.js} +2 -2
  92. package/dist/chunk-s7dzs6yg.js +2 -0
  93. package/dist/chunk-t1tqn3xx.js +2 -0
  94. package/dist/{chunk-ss78553t.js → chunk-tc5zk2ka.js} +1 -1
  95. package/dist/{chunk-rgage0vm.js → chunk-tdv9np5t.js} +2 -2
  96. package/dist/{chunk-mm1vvk49.js → chunk-tgwdk0gt.js} +4 -4
  97. package/dist/chunk-tma2vac1.js +2 -0
  98. package/dist/chunk-v0chatw1.js +2 -0
  99. package/dist/{chunk-8cpqy9ea.js → chunk-v9gy8rda.js} +41 -41
  100. package/dist/chunk-v9mkambt.js +2 -0
  101. package/dist/chunk-vwjqbn5y.js +2 -0
  102. package/dist/{chunk-ev3qnr9q.js → chunk-w8vg3te3.js} +4 -4
  103. package/dist/{chunk-1hrj0t0j.js → chunk-wemq37qe.js} +10 -10
  104. package/dist/{chunk-9ya4tdpz.js → chunk-wjazf68a.js} +2 -2
  105. package/dist/chunk-wrvksj26.js +2 -0
  106. package/dist/{chunk-nm0y4qjg.js → chunk-wvjpvs89.js} +3 -3
  107. package/dist/{chunk-6vnnx536.js → chunk-xjr67xvb.js} +2 -2
  108. package/dist/chunk-xkxwg6d4.js +2 -0
  109. package/dist/chunk-xspkz804.js +2 -0
  110. package/dist/chunk-xwqyw7zt.js +2 -0
  111. package/dist/chunk-y3kp87w1.js +2 -0
  112. package/dist/{chunk-wwn9dh6p.js → chunk-y3mmeywt.js} +2 -2
  113. package/dist/chunk-ya39wk58.js +2 -0
  114. package/dist/chunk-ygbdfzqn.js +2 -0
  115. package/dist/chunk-ypswj8sv.js +2 -0
  116. package/dist/chunk-yqzhev40.js +2 -0
  117. package/dist/{chunk-mt8sew7a.js → chunk-ywah1c30.js} +10 -10
  118. package/dist/chunk-z1tnn2pm.js +2 -0
  119. package/dist/{chunk-n1xcmhjw.js → chunk-z3smaz4z.js} +3 -3
  120. package/dist/{chunk-jra9r8fq.js → chunk-zckbg2vb.js} +1 -1
  121. package/dist/cli.js +18 -18
  122. package/dist/client/signals-helpers-runtime.d.ts +1 -1
  123. package/dist/client/signals-helpers-runtime.js +1 -8
  124. package/dist/client/signals-notify-runtime.d.ts +2 -0
  125. package/dist/client/signals-notify-runtime.js +26 -0
  126. package/dist/client/signals-process-element-runtime.js +8 -4
  127. package/dist/client/signals-reactive-core-bootstrap-runtime.js +2 -0
  128. package/dist/client/signals-state-runtime.d.ts +1 -1
  129. package/dist/client/signals-state-runtime.js +12 -18
  130. package/dist/config.d.ts +16 -0
  131. package/dist/config.js +12 -3
  132. package/dist/craft-entry.js +2 -2
  133. package/dist/craft.js +2 -2
  134. package/dist/pwa.js +3 -3
  135. package/dist/reactive-tracking.d.ts +17 -0
  136. package/dist/reactive-tracking.js +23 -0
  137. package/dist/reactivity.js +3 -11
  138. package/dist/signals-api.js +13 -11
  139. package/dist/signals-notify-runtime.d.ts +2 -0
  140. package/dist/ssg.js +3 -3
  141. package/package.json +5 -5
  142. package/dist/chunk-04qvjcsr.js +0 -2
  143. package/dist/chunk-2xbrrc5a.js +0 -2
  144. package/dist/chunk-2yypassp.js +0 -2
  145. package/dist/chunk-375skn32.js +0 -2
  146. package/dist/chunk-3wyxe996.js +0 -2
  147. package/dist/chunk-4mmdpb46.js +0 -2
  148. package/dist/chunk-4q5d5r7s.js +0 -2
  149. package/dist/chunk-5ytg0wbc.js +0 -2
  150. package/dist/chunk-6qyters0.js +0 -2
  151. package/dist/chunk-6yn90mq9.js +0 -2
  152. package/dist/chunk-7d2vyre0.js +0 -2
  153. package/dist/chunk-7pewegtw.js +0 -2
  154. package/dist/chunk-7w0qa3n0.js +0 -2
  155. package/dist/chunk-8d788kvt.js +0 -2
  156. package/dist/chunk-bdhtq3vs.js +0 -2
  157. package/dist/chunk-brnapchc.js +0 -2
  158. package/dist/chunk-c78327kx.js +0 -2
  159. package/dist/chunk-d19w3e4x.js +0 -2
  160. package/dist/chunk-da649d3k.js +0 -2
  161. package/dist/chunk-da9avgd9.js +0 -2
  162. package/dist/chunk-e3njkecx.js +0 -2
  163. package/dist/chunk-efzc1nw8.js +0 -2
  164. package/dist/chunk-fm4w1r9e.js +0 -2
  165. package/dist/chunk-gan95hj0.js +0 -2
  166. package/dist/chunk-hg7amzgz.js +0 -2
  167. package/dist/chunk-hmk7z0z6.js +0 -2
  168. package/dist/chunk-hn105xy3.js +0 -2
  169. package/dist/chunk-jq079mrx.js +0 -2
  170. package/dist/chunk-jr149mmp.js +0 -2
  171. package/dist/chunk-kwxy0e3r.js +0 -2
  172. package/dist/chunk-kza3nxr0.js +0 -2
  173. package/dist/chunk-m9cmc6np.js +0 -2
  174. package/dist/chunk-m9r4x7e6.js +0 -2
  175. package/dist/chunk-mahv855w.js +0 -2
  176. package/dist/chunk-mbwdn96z.js +0 -2
  177. package/dist/chunk-mdxg95mq.js +0 -2
  178. package/dist/chunk-mqje968d.js +0 -2
  179. package/dist/chunk-n2g9mj2h.js +0 -2
  180. package/dist/chunk-n2nha538.js +0 -2
  181. package/dist/chunk-nebw444s.js +0 -2
  182. package/dist/chunk-nmt7kw0e.js +0 -2
  183. package/dist/chunk-pq8mz4ma.js +0 -2
  184. package/dist/chunk-pxes1ft6.js +0 -2
  185. package/dist/chunk-qajc13zq.js +0 -2
  186. package/dist/chunk-qtnqmw1n.js +0 -2
  187. package/dist/chunk-r3zdgeah.js +0 -2
  188. package/dist/chunk-r5htacg5.js +0 -2
  189. package/dist/chunk-rf2rwddd.js +0 -2
  190. package/dist/chunk-s833fbvf.js +0 -2
  191. package/dist/chunk-sgvszh9s.js +0 -2
  192. package/dist/chunk-t5r3s1wj.js +0 -2
  193. package/dist/chunk-tjprg6kq.js +0 -2
  194. package/dist/chunk-v0dzrwg8.js +0 -2
  195. package/dist/chunk-vtz9empe.js +0 -2
  196. package/dist/chunk-wa6nzq5b.js +0 -2
  197. package/dist/chunk-ymdy7b8z.js +0 -3
  198. package/dist/chunk-ytdzgctp.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{b,d,n,g,R}from"./chunk-xw8kzm6b.js";import q from"path";var M={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},C=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var O=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function z(e){let t=[],o=0,s;O.lastIndex=0;while((s=O.exec(e))!==null){if(s.index>o){let a=e.slice(o,s.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let r=s[1],i=s[2];t.push({type:"suspense",name:r,content:i}),o=s.index+s[0].length}if(o<e.length){let r=e.slice(o);if(r.trim())t.push({type:t.length===0?"shell":"content",content:r})}if(t.length===0)t.push({type:"shell",content:e});return t}async function gd(e,t={},o={}){let s={...R,...o,streaming:{...M,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:q.dirname(e)};if(m.trim())await d(m,y,e);let T=z(c),u=new Set;if(!T.some((h)=>h.type==="suspense")){let h=s.streaming?.strategy||"auto",S=new RegExp(C.source,"g");if(!(h!=="manual"&&S.test(c))){let p=await n(c,y,e,s,u);for(let x=0;x<p.length;x+=r)i.enqueue(p.slice(x,x+r)),await new Promise((f)=>setTimeout(f,0))}else{let p=[],x=new RegExp(C.source,"g"),f;while((f=x.exec(c))!==null)p.push({name:f[1],content:f[2],start:f.index,end:f.index+f[0].length});let E=0;for(let _ of p){if(_.start>E){let k=c.slice(E,_.start);if(k.trim()){let D=await n(k,y,e,s,u);i.enqueue(D),await new Promise((H)=>setTimeout(H,0))}}let I=await n(_.content,y,e,s,u);i.enqueue(I),await new Promise((k)=>setTimeout(k,0)),E=_.end}if(E<c.length){let _=c.slice(E);if(_.trim()){let I=await n(_,y,e,s,u);i.enqueue(I)}}}}else{let h=new Map;for(let l of T)if(l.type==="shell"||l.type==="content"){let p=await n(l.content,y,e,s,u);i.enqueue(p)}else if(l.type==="suspense"&&l.name){let p=`stx-suspense-${l.name}`;i.enqueue(`<div id="${p}" data-suspense="${l.name}" style="display:contents;">
2
+ import{b,d,n,g,R}from"./chunk-kz131809.js";import q from"path";var M={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},C=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var O=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function z(e){let t=[],o=0,s;O.lastIndex=0;while((s=O.exec(e))!==null){if(s.index>o){let a=e.slice(o,s.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let r=s[1],i=s[2];t.push({type:"suspense",name:r,content:i}),o=s.index+s[0].length}if(o<e.length){let r=e.slice(o);if(r.trim())t.push({type:t.length===0?"shell":"content",content:r})}if(t.length===0)t.push({type:"shell",content:e});return t}async function md(e,t={},o={}){let s={...R,...o,streaming:{...M,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:q.dirname(e)};if(m.trim())await d(m,y,e);let T=z(c),u=new Set;if(!T.some((h)=>h.type==="suspense")){let h=s.streaming?.strategy||"auto",S=new RegExp(C.source,"g");if(!(h!=="manual"&&S.test(c))){let p=await n(c,y,e,s,u);for(let x=0;x<p.length;x+=r)i.enqueue(p.slice(x,x+r)),await new Promise((f)=>setTimeout(f,0))}else{let p=[],x=new RegExp(C.source,"g"),f;while((f=x.exec(c))!==null)p.push({name:f[1],content:f[2],start:f.index,end:f.index+f[0].length});let E=0;for(let _ of p){if(_.start>E){let k=c.slice(E,_.start);if(k.trim()){let D=await n(k,y,e,s,u);i.enqueue(D),await new Promise((H)=>setTimeout(H,0))}}let I=await n(_.content,y,e,s,u);i.enqueue(I),await new Promise((k)=>setTimeout(k,0)),E=_.end}if(E<c.length){let _=c.slice(E);if(_.trim()){let I=await n(_,y,e,s,u);i.enqueue(I)}}}}else{let h=new Map;for(let l of T)if(l.type==="shell"||l.type==="content"){let p=await n(l.content,y,e,s,u);i.enqueue(p)}else if(l.type==="suspense"&&l.name){let p=`stx-suspense-${l.name}`;i.enqueue(`<div id="${p}" data-suspense="${l.name}" style="display:contents;">
3
3
  <template data-suspense-fallback>Loading...</template>
4
4
  </div>`),h.set(l.name,n(l.content,y,e,s,u))}i.enqueue(`
5
5
  <script>
@@ -23,7 +23,7 @@ window.__stxSuspense.resolve('${e}', \`${s}\`);
23
23
  </script>`}catch(o){let s=o instanceof Error?o.message:String(o);return`
24
24
  <script>
25
25
  window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading content: ${b(s)}</div>');
26
- </script>`}}var Ua=`
26
+ </script>`}}var Va=`
27
27
  <script>
28
28
  (function(){
29
29
  window.__stxSuspense = window.__stxSuspense || {
@@ -43,12 +43,12 @@ window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading conte
43
43
  }
44
44
  };
45
45
  })();
46
- </script>`;function A(e,t,o){if(!t||t<=0)return e;let s,r=new Promise((i,a)=>{s=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,r]).finally(()=>clearTimeout(s))}function md(e,t=[],o={}){let s=o.timeoutMs??0;return new ReadableStream({async start(r){try{if(r.enqueue(e),t.length>0)r.enqueue(Ua),await Promise.all(t.map(async(i)=>{let a=A(i.render(),s,i.id);r.enqueue(await Eo(i.id,a))}));r.close()}catch(i){r.error(i)}}})}var B=/@stream\s*\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)@endstream/gi;function hd(e,t){return e.replace(B,(o,s,r)=>{let i=s.trim(),a=r.split(/@fallback/i),w=a[0].trim(),m=a.length>1?a.slice(1).join("@fallback").trim():"";if(!t.__streamTemplates)t.__streamTemplates={};return t.__streamTemplates[i]=w,`<div data-suspense="${i}">${m}</div>`})}function yd(e){let t=e?.streamBoundaries;if(!t||typeof t!=="object")return;let o=Object.entries(t).filter(([,s])=>typeof s==="function");return o.length>0?o.map(([s,r])=>({id:s,render:r})):void 0}async function bd(e,t={},o={}){let s={...R,...o,streaming:{...M,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:q.dirname(e)};if(m.trim())await d(m,y,e);let T=new Set,u=s.streaming?.strategy||"auto",v=new RegExp(C.source,"g");if(!(u!=="manual"&&v.test(c))){let S=await n(c,y,e,s,T);for(let l=0;l<S.length;l+=r)i.enqueue(S.slice(l,l+r))}else{let S=[],l=new RegExp(C.source,"g"),p;while((p=l.exec(c))!==null)S.push({name:p[1],content:p[2],start:p.index,end:p.index+p[0].length});let x=0;for(let f of S){if(f.start>x){let _=c.slice(x,f.start);if(_.trim()){let I=await n(_,y,e,s,T);i.enqueue(I)}}let E=await n(f.content,y,e,s,T);i.enqueue(E),x=f.end}if(x<c.length){let f=c.slice(x);if(f.trim()){let E=await n(f,y,e,s,T);i.enqueue(E)}}}i.close()}catch(a){i.error(a)}}})}async function wd(e,t={}){let o={...R,...t,streaming:{...M,...t.streaming}},s=await Bun.file(e).text(),r=s.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),i=r?r[1]:"",a=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),w=a,m={},c;C.lastIndex=0;while((c=C.exec(a))!==null){let u=c[1],v=c[2];m[u]=v}let y=a.replace(C,"");return{renderShell:async(u={})=>{let v={...u,__filename:e,__dirname:q.dirname(e)};return await d(i,v,e),n(y,v,e,o,new Set)},renderSection:async(u,v={})=>{try{if(!m[u])return`<div class="error-message">Section "${b(u)}" not found in template "${b(e)}"</div>`;let h={...v,__filename:e,__dirname:q.dirname(e)};await d(i,h,e);let S=new Set;return await n(m[u],h,e,o,S)}catch(h){let S=h instanceof Error?h.message:String(h);return g("Expression",S,e,m[u]||"",0,m[u]||"")}},getSections:()=>Object.keys(m),getTemplate:()=>w}}var Va={name:"suspense",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Suspense directive requires a name parameter");let r=t[0].replace(/['"`]/g,"");return`<!-- @suspense:${r} -->${e}<!-- @endsuspense:${r} -->`}},Wa={name:"island",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Island directive requires a name parameter");let r=t[0].replace(/['"`]/g,""),i=t[1]?t[1].replace(/['"`]/g,""):"lazy",a=`island-${r}-${Math.random().toString(36).substring(2,9)}`,w=e.match(/<script\s+props\s*>([\s\S]*?)<\/script>/i),m=w?w[1].trim():"",c=w?e.replace(w[0],""):e;return`<div data-island="${r}" data-island-id="${a}" data-priority="${i}">
46
+ </script>`;function A(e,t,o){if(!t||t<=0)return e;let s,r=new Promise((i,a)=>{s=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,r]).finally(()=>clearTimeout(s))}function hd(e,t=[],o={}){let s=o.timeoutMs??0;return new ReadableStream({async start(r){try{if(r.enqueue(e),t.length>0)r.enqueue(Va),await Promise.all(t.map(async(i)=>{let a=A(i.render(),s,i.id);r.enqueue(await Eo(i.id,a))}));r.close()}catch(i){r.error(i)}}})}var B=/@stream\s*\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)@endstream/gi;function yd(e,t){return e.replace(B,(o,s,r)=>{let i=s.trim(),a=r.split(/@fallback/i),w=a[0].trim(),m=a.length>1?a.slice(1).join("@fallback").trim():"";if(!t.__streamTemplates)t.__streamTemplates={};return t.__streamTemplates[i]=w,`<div data-suspense="${i}">${m}</div>`})}function bd(e){let t=e?.streamBoundaries;if(!t||typeof t!=="object")return;let o=Object.entries(t).filter(([,s])=>typeof s==="function");return o.length>0?o.map(([s,r])=>({id:s,render:r})):void 0}async function wd(e,t={},o={}){let s={...R,...o,streaming:{...M,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:q.dirname(e)};if(m.trim())await d(m,y,e);let T=new Set,u=s.streaming?.strategy||"auto",v=new RegExp(C.source,"g");if(!(u!=="manual"&&v.test(c))){let S=await n(c,y,e,s,T);for(let l=0;l<S.length;l+=r)i.enqueue(S.slice(l,l+r))}else{let S=[],l=new RegExp(C.source,"g"),p;while((p=l.exec(c))!==null)S.push({name:p[1],content:p[2],start:p.index,end:p.index+p[0].length});let x=0;for(let f of S){if(f.start>x){let _=c.slice(x,f.start);if(_.trim()){let I=await n(_,y,e,s,T);i.enqueue(I)}}let E=await n(f.content,y,e,s,T);i.enqueue(E),x=f.end}if(x<c.length){let f=c.slice(x);if(f.trim()){let E=await n(f,y,e,s,T);i.enqueue(E)}}}i.close()}catch(a){i.error(a)}}})}async function vd(e,t={}){let o={...R,...t,streaming:{...M,...t.streaming}},s=await Bun.file(e).text(),r=s.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),i=r?r[1]:"",a=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),w=a,m={},c;C.lastIndex=0;while((c=C.exec(a))!==null){let u=c[1],v=c[2];m[u]=v}let y=a.replace(C,"");return{renderShell:async(u={})=>{let v={...u,__filename:e,__dirname:q.dirname(e)};return await d(i,v,e),n(y,v,e,o,new Set)},renderSection:async(u,v={})=>{try{if(!m[u])return`<div class="error-message">Section "${b(u)}" not found in template "${b(e)}"</div>`;let h={...v,__filename:e,__dirname:q.dirname(e)};await d(i,h,e);let S=new Set;return await n(m[u],h,e,o,S)}catch(h){let S=h instanceof Error?h.message:String(h);return g("Expression",S,e,m[u]||"",0,m[u]||"")}},getSections:()=>Object.keys(m),getTemplate:()=>w}}var Wa={name:"suspense",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Suspense directive requires a name parameter");let r=t[0].replace(/['"`]/g,"");return`<!-- @suspense:${r} -->${e}<!-- @endsuspense:${r} -->`}},qa={name:"island",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Island directive requires a name parameter");let r=t[0].replace(/['"`]/g,""),i=t[1]?t[1].replace(/['"`]/g,""):"lazy",a=`island-${r}-${Math.random().toString(36).substring(2,9)}`,w=e.match(/<script\s+props\s*>([\s\S]*?)<\/script>/i),m=w?w[1].trim():"",c=w?e.replace(w[0],""):e;return`<div data-island="${r}" data-island-id="${a}" data-priority="${i}">
47
47
  ${c}
48
48
  <script type="application/json" data-island-props="${a}">
49
49
  ${m?`{${m}}`:"{}"}
50
50
  </script>
51
- </div>`}};function vd(e={}){let t=[];if(e.streaming?.enabled)t.push(Va);if(e.hydration?.enabled)t.push(Wa);return t}async function xd(e,t,o,s={}){return e}function Sd(e,t={}){let o=new TextEncoder,s=e.pipeThrough(new TransformStream({transform(i,a){a.enqueue(o.encode(i))}})),r=new Headers(t.headers);if(!r.has("Content-Type"))r.set("Content-Type","text/html; charset=utf-8");if(!r.has("Transfer-Encoding"))r.set("Transfer-Encoding","chunked");if(!r.has("X-Content-Type-Options"))r.set("X-Content-Type-Options","nosniff");if(!r.has("X-Accel-Buffering"))r.set("X-Accel-Buffering","no");return new Response(s,{...t,headers:r})}function kd(e={mode:"full"}){let{mode:t,components:o={},dynamicImports:s=!0}=e,r=Object.entries(o).map(([i,a])=>`'${i}': ${s?`() => import('${a}')`:`require('${a}')`}`).join(`,
51
+ </div>`}};function xd(e={}){let t=[];if(e.streaming?.enabled)t.push(Wa);if(e.hydration?.enabled)t.push(qa);return t}async function Sd(e,t,o,s={}){return e}function kd(e,t={}){let o=new TextEncoder,s=e.pipeThrough(new TransformStream({transform(i,a){a.enqueue(o.encode(i))}})),r=new Headers(t.headers);if(!r.has("Content-Type"))r.set("Content-Type","text/html; charset=utf-8");if(!r.has("Transfer-Encoding"))r.set("Transfer-Encoding","chunked");if(!r.has("X-Content-Type-Options"))r.set("X-Content-Type-Options","nosniff");if(!r.has("X-Accel-Buffering"))r.set("X-Accel-Buffering","no");return new Response(s,{...t,headers:r})}function Cd(e={mode:"full"}){let{mode:t,components:o={},dynamicImports:s=!0}=e,r=Object.entries(o).map(([i,a])=>`'${i}': ${s?`() => import('${a}')`:`require('${a}')`}`).join(`,
52
52
  `);if(t==="loader")return`
53
53
  (function() {
54
54
  window.__stx = window.__stx || {};
@@ -191,4 +191,4 @@ else {
191
191
  stx.hydrate();
192
192
  }
193
193
  })();`}
194
- export{gd,Eo,Ua,md,hd,yd,bd,wd,Va,Wa,vd,xd,Sd,kd};
194
+ export{md,Eo,Va,hd,yd,bd,wd,vd,Wa,qa,xd,Sd,kd,Cd};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ct,bs,hi,Pc}from"./chunk-kz131809.js";import"./chunk-gwabvrc3.js";import"./chunk-3wcwtqx1.js";import"./chunk-9k6r7f3c.js";import"./chunk-dajh1369.js";import"./chunk-ebg20d8s.js";import"./chunk-ywah1c30.js";import"./chunk-wemq37qe.js";import"./chunk-j3vwyzvb.js";import"./chunk-d4ybwtqt.js";import"./chunk-c1ys37c9.js";import"./chunk-w8vg3te3.js";import"./chunk-tdv9np5t.js";export{Pc as declareBareLoopHead,Ct as parseLoopBinding,hi as processLoops,bs as reportDeferredLoopWarnings};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Vl,Wl}from"./chunk-dkyqkkpj.js";export{Wl as ensureTeleportTargets,Vl as processTeleportDirectives};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ga,Tl,ma,ha,$l,Rl}from"./chunk-5hxsdkvp.js";import"./chunk-kz131809.js";import"./chunk-gwabvrc3.js";import"./chunk-3wcwtqx1.js";import"./chunk-9k6r7f3c.js";import"./chunk-dajh1369.js";import"./chunk-ebg20d8s.js";import"./chunk-ywah1c30.js";import"./chunk-wemq37qe.js";import"./chunk-j3vwyzvb.js";import"./chunk-d4ybwtqt.js";import"./chunk-c1ys37c9.js";import"./chunk-w8vg3te3.js";import"./chunk-tdv9np5t.js";export{Rl as applySlots,$l as extractSlotContent,Tl as parseSlotElement,ga as parseSlots,ha as processSlots,ma as renderSlot};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{vo,El}from"./chunk-rrce2fyv.js";export{vo as definePlugin,El as pluginManager};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{j,B,F,Bt,Z,ie,Dn,pa,Oe,gt,Ft,zt,Ht,z,Ut,Vt,Mn}from"./chunk-wm11csdm.js";import"./chunk-saf7kypg.js";export{B as DEFAULT_FORMATS,F as DEFAULT_QUALITY,j as DEFAULT_WIDTHS,Mn as ImageProcessingError,Vt as formatSize,gt as generateSizes,Oe as generateSrcSet,Ft as getFallbackVariant,Dn as getImageMetadata,z as getMimeType,Ut as getTotalSize,zt as groupVariantsByFormat,Z as isImageBackendAvailable,Ht as isImageFile,Bt as isSharpAvailable,ie as processImage,pa as resizeAndConvert};
2
+ import{j,B,F,Bt,Z,ie,Dn,fa,Oe,gt,Ft,zt,Ht,z,Ut,Vt,Mn}from"./chunk-qh0es7mk.js";import"./chunk-rtc17gy5.js";export{B as DEFAULT_FORMATS,F as DEFAULT_QUALITY,j as DEFAULT_WIDTHS,Mn as ImageProcessingError,Vt as formatSize,gt as generateSizes,Oe as generateSrcSet,Ft as getFallbackVariant,Dn as getImageMetadata,z as getMimeType,Ut as getTotalSize,zt as groupVariantsByFormat,Z as isImageBackendAvailable,Ht as isImageFile,Bt as isSharpAvailable,ie as processImage,fa as resizeAndConvert};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Pt}from"./chunk-1hrj0t0j.js";import{Yo,rs,H,ze,Q,Et,x,Ue,Ve,Jn,d}from"./chunk-xw8kzm6b.js";import{D}from"./chunk-dkyjw3hc.js";var V=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function B(t,n,e){let r={fullTag:e,content:n,attrs:t};if(/\bserver\b/.test(t))return{...r,type:"server"};if(/\bdata-stx-scoped\b/.test(t))return{...r,type:"client"};if(V.test(n))return{...r,type:"signals"};if(/\bclient\b/.test(t)||/\btype\s*=\s*["']module["']/.test(t)||/\bsrc\s*=/.test(t))return{...r,type:"client"};return{...r,type:"server"}}var q=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function lo(t){let n=[],e=[],r=[],i=0;while(i<t.length){let s=t.indexOf("<",i);if(s===-1)break;let a=ze(t,s);if(a>s){i=a;continue}let o=H(t,s);if(o>s){let c=t.slice(s,o),u=q.exec(c);if(u){let l=B(u[1],u[2],c);switch(l.type){case"signals":n.push(l);break;case"client":e.push(l);break;case"server":r.push(l);break}}i=o;continue}i=s+(t.startsWith("<!--",s)?4:1)}return{signals:n,client:e,server:r}}var z=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function G(t){let n=[],e=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,r;while((r=e.exec(t))!==null)n.push({start:r.index,end:r.index+r[0].length});return n}function T(t,n){return n.some((e)=>t>=e.start&&t<e.end)}function U(t){let n=(t||"").trim();if(!n)return null;if(/[\s>+~,:]/.test(n))return null;let e={},r=n,i=r.match(/^[a-z][\w-]*/i);if(i)e.tag=i[0].toLowerCase(),r=r.slice(i[0].length);while(r.length>0){let s=r.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(s){if(e.attr=s[1],s[3]!==void 0&&s[3]!=="")e.attrValue=s[3];r=r.slice(s[0].length);continue}let a=r.match(/^#([\w-]+)/);if(a){e.id=a[1],r=r.slice(a[0].length);continue}let o=r.match(/^\.([\w-]+)/);if(o){e.className=o[1],r=r.slice(o[0].length);continue}return null}if(!e.tag&&!e.attr&&!e.id&&!e.className)return null;return e}function W(t,n){if(n.attr){if(!(n.attrValue===void 0?new RegExp(`\\b${n.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${n.attr}\\s*=\\s*(["'])\\s*${n.attrValue}\\s*\\1`,"i")).test(t))return!1}if(n.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${n.id}\\s*\\1`,"i").test(t))return!1}if(n.className){let e=t.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!e)return!1;if(!e[2].split(/\s+/).includes(n.className))return!1}return!0}function O(t,n="main"){let e=U(n);if(!e)return null;let r=/<([a-z][\w-]*)\b([^>]*)>/gi,i=G(t),s;while((s=r.exec(t))!==null){if(T(s.index,i))continue;let a=s[1].toLowerCase(),o=s[2]||"";if(o.trimEnd().endsWith("/")||z.has(a))continue;if(e.tag&&e.tag!==a)continue;if(!W(o,e))continue;let c=s[0],u=s.index+c.length,l=new RegExp(`<(/?)${a}\\b([^>]*)>`,"gi");l.lastIndex=u;let f=1,m;while((m=l.exec(t))!==null){if(T(m.index,i))continue;let S=m[1]==="/";if(!S&&(m[2]||"").trimEnd().endsWith("/"))continue;if(f+=S?-1:1,f===0)return{openTag:c,openIndex:s.index,start:u,end:m.index,tagName:a}}return null}return null}var Ie="private, no-store";function uo(t){return t.replace(/&#(\d+);/g,(n,e)=>M(Number(e),n)).replace(/&#x([0-9a-f]+);/gi,(n,e)=>M(Number.parseInt(e,16),n)).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&amp;/g,"&")}function M(t,n){if(!Number.isInteger(t)||t<0||t>1114111)return n;try{return String.fromCodePoint(t)}catch{return n}}function se(t){return t.headers.get("X-STX-Router")==="true"}function X(t,n){if(!t)return n;return t.split(",").some((r)=>r.trim().toLowerCase()===n.toLowerCase())?t:`${t}, ${n}`}function _(t){return{Vary:X(t,"X-STX-Router")}}import E from"path";var J="stx-page-head:",K=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,v={dev:null,prod:null};function Y(){let t=D()?"dev":"prod",n=v[t];if(n!==null)return n;try{let e=import.meta.require("./chunk-hn105xy3.js"),r=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;v[t]=`<script>${r()}</script>`}catch{v[t]=""}return v[t]}async function po(t,n){if(n===!1)return null;if(n&&typeof n==="string"){let r=E.resolve(t,n);if(await Bun.file(r).exists())return r;return null}let e=E.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function $r(t,n){try{let e=await Bun.file(t).text(),r=e,i=e.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if(i)r=i[1].trim();let s=lo(e),a=[...s.client.map((p)=>p.fullTag),...s.signals.map((p)=>p.fullTag)],o=[],c=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,u;while((u=c.exec(e))!==null)o.push(u[0]);let l=r;for(let p of s.server)l=l.replace(p.fullTag,"");for(let p of s.client)l=l.replace(p.fullTag,"");l=l.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let f="<!--__STX_PAGE_SLOT__-->";if(l=l.replace(/<slot\s*\/>/gi,f).replace(/<slot\s*>\s*<\/slot>/gi,f),!l.includes(f))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:m,extractVariables:S,defaultConfig:b,loadStxConfig:w}=await import("./chunk-8d788kvt.js"),y=await w(),g={__filename:t,__dirname:E.dirname(t)};for(let p of a){let C=p.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(C&&!p.includes("client")&&!p.includes('type="module"'))await S(C[1],g,t)}let R=await m(l,g,t,{...b,...y,...n},new Set),h=R.indexOf(f);if(h===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:R.substring(0,h),afterSlot:R.substring(h+f.length),filePath:t,shellScripts:a,shellStyles:o}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function On(t,n,e){let r,i="",s=n.match(K);if(s){n=n.replace(s[0],"");try{let l=Buffer.from(s[1],"base64").toString("utf8"),f=l.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(f)r=f[1].trim();i=l.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let a=e||r||"stx App",o=Y(),c="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
2
+ import{Pt}from"./chunk-wemq37qe.js";import{Zo,rs,H,ze,Q,_t,x,Ue,Ve,Jn,d}from"./chunk-kz131809.js";import{D}from"./chunk-dkyjw3hc.js";var V=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function B(t,n,e){let r={fullTag:e,content:n,attrs:t};if(/\bserver\b/.test(t))return{...r,type:"server"};if(/\bdata-stx-scoped\b/.test(t))return{...r,type:"client"};if(V.test(n))return{...r,type:"signals"};if(/\bclient\b/.test(t)||/\btype\s*=\s*["']module["']/.test(t)||/\bsrc\s*=/.test(t))return{...r,type:"client"};return{...r,type:"server"}}var q=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function uo(t){let n=[],e=[],r=[],i=0;while(i<t.length){let s=t.indexOf("<",i);if(s===-1)break;let a=ze(t,s);if(a>s){i=a;continue}let o=H(t,s);if(o>s){let c=t.slice(s,o),u=q.exec(c);if(u){let l=B(u[1],u[2],c);switch(l.type){case"signals":n.push(l);break;case"client":e.push(l);break;case"server":r.push(l);break}}i=o;continue}i=s+(t.startsWith("<!--",s)?4:1)}return{signals:n,client:e,server:r}}var z=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function G(t){let n=[],e=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,r;while((r=e.exec(t))!==null)n.push({start:r.index,end:r.index+r[0].length});return n}function T(t,n){return n.some((e)=>t>=e.start&&t<e.end)}function U(t){let n=(t||"").trim();if(!n)return null;if(/[\s>+~,:]/.test(n))return null;let e={},r=n,i=r.match(/^[a-z][\w-]*/i);if(i)e.tag=i[0].toLowerCase(),r=r.slice(i[0].length);while(r.length>0){let s=r.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(s){if(e.attr=s[1],s[3]!==void 0&&s[3]!=="")e.attrValue=s[3];r=r.slice(s[0].length);continue}let a=r.match(/^#([\w-]+)/);if(a){e.id=a[1],r=r.slice(a[0].length);continue}let o=r.match(/^\.([\w-]+)/);if(o){e.className=o[1],r=r.slice(o[0].length);continue}return null}if(!e.tag&&!e.attr&&!e.id&&!e.className)return null;return e}function W(t,n){if(n.attr){if(!(n.attrValue===void 0?new RegExp(`\\b${n.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${n.attr}\\s*=\\s*(["'])\\s*${n.attrValue}\\s*\\1`,"i")).test(t))return!1}if(n.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${n.id}\\s*\\1`,"i").test(t))return!1}if(n.className){let e=t.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!e)return!1;if(!e[2].split(/\s+/).includes(n.className))return!1}return!0}function O(t,n="main"){let e=U(n);if(!e)return null;let r=/<([a-z][\w-]*)\b([^>]*)>/gi,i=G(t),s;while((s=r.exec(t))!==null){if(T(s.index,i))continue;let a=s[1].toLowerCase(),o=s[2]||"";if(o.trimEnd().endsWith("/")||z.has(a))continue;if(e.tag&&e.tag!==a)continue;if(!W(o,e))continue;let c=s[0],u=s.index+c.length,l=new RegExp(`<(/?)${a}\\b([^>]*)>`,"gi");l.lastIndex=u;let f=1,m;while((m=l.exec(t))!==null){if(T(m.index,i))continue;let S=m[1]==="/";if(!S&&(m[2]||"").trimEnd().endsWith("/"))continue;if(f+=S?-1:1,f===0)return{openTag:c,openIndex:s.index,start:u,end:m.index,tagName:a}}return null}return null}var Ie="private, no-store";function po(t){return t.replace(/&#(\d+);/g,(n,e)=>M(Number(e),n)).replace(/&#x([0-9a-f]+);/gi,(n,e)=>M(Number.parseInt(e,16),n)).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&amp;/g,"&")}function M(t,n){if(!Number.isInteger(t)||t<0||t>1114111)return n;try{return String.fromCodePoint(t)}catch{return n}}function se(t){return t.headers.get("X-STX-Router")==="true"}function X(t,n){if(!t)return n;return t.split(",").some((r)=>r.trim().toLowerCase()===n.toLowerCase())?t:`${t}, ${n}`}function E(t){return{Vary:X(t,"X-STX-Router")}}import k from"path";var J="stx-page-head:",K=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,v={dev:null,prod:null};function Y(){let t=D()?"dev":"prod",n=v[t];if(n!==null)return n;try{let e=import.meta.require("./chunk-v9mkambt.js"),r=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;v[t]=`<script>${r()}</script>`}catch{v[t]=""}return v[t]}async function fo(t,n){if(n===!1)return null;if(n&&typeof n==="string"){let r=k.resolve(t,n);if(await Bun.file(r).exists())return r;return null}let e=k.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function $r(t,n){try{let e=await Bun.file(t).text(),r=e,i=e.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if(i)r=i[1].trim();let s=uo(e),a=[...s.client.map((p)=>p.fullTag),...s.signals.map((p)=>p.fullTag)],o=[],c=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,u;while((u=c.exec(e))!==null)o.push(u[0]);let l=r;for(let p of s.server)l=l.replace(p.fullTag,"");for(let p of s.client)l=l.replace(p.fullTag,"");l=l.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let f="<!--__STX_PAGE_SLOT__-->";if(l=l.replace(/<slot\s*\/>/gi,f).replace(/<slot\s*>\s*<\/slot>/gi,f),!l.includes(f))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:m,extractVariables:S,defaultConfig:b,loadStxConfig:w}=await import("./chunk-s7dzs6yg.js"),y=await w(),g={__filename:t,__dirname:k.dirname(t)};for(let p of a){let C=p.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(C&&!p.includes("client")&&!p.includes('type="module"'))await S(C[1],g,t)}let R=await m(l,g,t,{...b,...y,...n},new Set),h=R.indexOf(f);if(h===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:R.substring(0,h),afterSlot:R.substring(h+f.length),filePath:t,shellScripts:a,shellStyles:o}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function On(t,n,e){let r,i="",s=n.match(K);if(s){n=n.replace(s[0],"");try{let l=Buffer.from(s[1],"base64").toString("utf8"),f=l.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(f)r=f[1].trim();i=l.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let a=e||r||"stx App",o=Y(),c="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
3
3
  <html lang="en">
4
4
  <head>
5
5
  <meta charset="UTF-8">
@@ -22,10 +22,10 @@ ${o}
22
22
  `),"utf8").toString("base64")}-->`)}let s=e.match(/<body\b[^>]*>/i),a=e.lastIndexOf("</body>");if(s&&a!==-1){let c=s.index+s[0].length,u=e.slice(c,a).trim();if(r.length>0)return r.join(`
23
23
  `)+`
24
24
  `+u;return u}let o=e;if(o=o.replace(/<!DOCTYPE\b[^>]*>/i,""),o=o.replace(/<html\b[^>]*>/i,""),o=o.replace(/<\/html\s*>/i,""),i)o=o.replace(/<head\b[^>]*>[\s\S]*?<\/head>/i,r.join(`
25
- `));return o=o.replace(/<body\b[^>]*>/i,""),o=o.replace(/<\/body\s*>/i,""),o.trim()}var j=/^<script\b[^>]*\sdata-stx-(?:owner|instance)(?=[\s=/>])/i;function N(t,n,e,r){if(!j.test(n))return!1;let i=n.slice(0,n.indexOf(">")+1),s=/\sdata-stx-owner="([^"]+)"/i.exec(i)?.[1];if(!s)return!0;let a=`data-stx-scope="${s}"`;for(let o=t.indexOf(a);o!==-1;o=t.indexOf(a,o+a.length))if(o>=e&&o<r)return!1;return!0}function fo(t){return se(t)}function Z(t,n){let e=[],r=new Set;for(let i of Q(t,H)){if(i.start>=n.start&&i.start<n.end)continue;let s=i.token.match(/^<script\b((?:"[^"]*"|'[^']*'|[^'">])*)>/i)?.[1]??"",a=new Map;for(let u of s.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g))a.set(u[1].toLowerCase(),u[2]??u[3]??u[4]??"");let o=a.get("src")?.trim(),c=a.get("type")?.trim().toLowerCase();if(!o||a.has("server")||c&&!["module","text/javascript","application/javascript"].includes(c))continue;if(a.has("data-stx-runtime")||a.has("data-stx-router")||/^\/_stx\/(?:runtime|router)(?:\.[a-f0-9]{16})?\.js(?:[?#]|$)/i.test(o))continue;if(N(t,i.token,n.start,n.end)||r.has(i.token))continue;r.add(i.token),e.push(i.token)}return e}function oe(t,n="main"){let e=t.trim(),r=[],i=[],s=e.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(s){let g=s[1],R=/<style\b[^>]*>[\s\S]*?<\/style>/gi,h;while((h=R.exec(g))!==null)r.push(h[0]);let p=/<script\b[^>]*data-stx-(?:route-params|server-data|scoped|component-factories)[^>]*>[\s\S]*?<\/script>/gi;while((h=p.exec(g))!==null){if(j.test(h[0])||h[0].includes("__stx_early_mounts")||/^<script\b[^>]*\bdata-stx-runtime(?=[\s=>])/i.test(h[0]))continue;i.push(h[0])}}let a=O(e,n);if(!a)return ye(t);let o=Z(e,a),c=new Set(o),{tagName:u,start:l,end:f}=a,m=e.slice(l,f).trim(),S=[],b=e.match(/<body\b[^>]*>/i),w=e.lastIndexOf("</body>");if(b&&b.index!==void 0&&w!==-1){let R=[[b.index+b[0].length,a.openIndex],[f+`</${u}>`.length,w]],h=/<script\b[^>]*>[\s\S]*?<\/script>/gi;for(let[p,C]of R){if(p>=C)continue;let L=e.slice(p,C),A;h.lastIndex=0;while((A=h.exec(L))!==null){if(N(e,A[0],l,f))continue;S.push(A[0])}}}let y=[];if(r.length>0)y.push(r.join(`
25
+ `));return o=o.replace(/<body\b[^>]*>/i,""),o=o.replace(/<\/body\s*>/i,""),o.trim()}var j=/^<script\b[^>]*\sdata-stx-(?:owner|instance)(?=[\s=/>])/i;function N(t,n,e,r){if(!j.test(n))return!1;let i=n.slice(0,n.indexOf(">")+1),s=/\sdata-stx-owner="([^"]+)"/i.exec(i)?.[1];if(!s)return!0;let a=`data-stx-scope="${s}"`;for(let o=t.indexOf(a);o!==-1;o=t.indexOf(a,o+a.length))if(o>=e&&o<r)return!1;return!0}function go(t){return se(t)}function Z(t,n){let e=[],r=new Set;for(let i of Q(t,H)){if(i.start>=n.start&&i.start<n.end)continue;let s=i.token.match(/^<script\b((?:"[^"]*"|'[^']*'|[^'">])*)>/i)?.[1]??"",a=new Map;for(let u of s.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g))a.set(u[1].toLowerCase(),u[2]??u[3]??u[4]??"");let o=a.get("src")?.trim(),c=a.get("type")?.trim().toLowerCase();if(!o||a.has("server")||c&&!["module","text/javascript","application/javascript"].includes(c))continue;if(a.has("data-stx-runtime")||a.has("data-stx-router")||/^\/_stx\/(?:runtime|router)(?:\.[a-f0-9]{16})?\.js(?:[?#]|$)/i.test(o))continue;if(N(t,i.token,n.start,n.end)||r.has(i.token))continue;r.add(i.token),e.push(i.token)}return e}function oe(t,n="main"){let e=t.trim(),r=[],i=[],s=e.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(s){let g=s[1],R=/<style\b[^>]*>[\s\S]*?<\/style>/gi,h;while((h=R.exec(g))!==null)r.push(h[0]);let p=/<script\b[^>]*data-stx-(?:route-params|server-data|scoped|component-factories)[^>]*>[\s\S]*?<\/script>/gi;while((h=p.exec(g))!==null){if(j.test(h[0])||h[0].includes("__stx_early_mounts")||/^<script\b[^>]*\bdata-stx-runtime(?=[\s=>])/i.test(h[0]))continue;i.push(h[0])}}let a=O(e,n);if(!a)return ye(t);let o=Z(e,a),c=new Set(o),{tagName:u,start:l,end:f}=a,m=e.slice(l,f).trim(),S=[],b=e.match(/<body\b[^>]*>/i),w=e.lastIndexOf("</body>");if(b&&b.index!==void 0&&w!==-1){let R=[[b.index+b[0].length,a.openIndex],[f+`</${u}>`.length,w]],h=/<script\b[^>]*>[\s\S]*?<\/script>/gi;for(let[p,C]of R){if(p>=C)continue;let L=e.slice(p,C),A;h.lastIndex=0;while((A=h.exec(L))!==null){if(N(e,A[0],l,f))continue;S.push(A[0])}}}let y=[];if(r.length>0)y.push(r.join(`
26
26
  `));if(o.length>0)y.push(o.join(`
27
27
  `));if(i.length>0)y.push(i.filter((g)=>!c.has(g)).join(`
28
28
  `));if(S.length>0)y.push(S.filter((g)=>!c.has(g)).join(`
29
29
  `));return y.push(m),y.join(`
30
- `)}import k from"fs";import I from"path";function go(t,n,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:n,outputDir:e}}function mo(t,n){let e=I.join(n,"manifest.json");k.writeFileSync(e,JSON.stringify(t,null,2))}function ho(t){let n=I.join(t,"manifest.json");if(!k.existsSync(n))return null;try{let e=k.readFileSync(n,"utf-8"),r=JSON.parse(e);if(r.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${r.version}`),null;return r}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function P(t,n,e={}){let r=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`;if(e.maxAge!==void 0)r+=`; Max-Age=${e.maxAge}`;if(e.expires)r+=`; Expires=${e.expires.toUTCString()}`;if(e.path)r+=`; Path=${e.path}`;if(e.domain)r+=`; Domain=${e.domain}`;if(e.secure)r+="; Secure";if(e.httpOnly)r+="; HttpOnly";if(e.sameSite)r+=`; SameSite=${e.sameSite}`;return r}async function tt(t){let n=t.headers.get("content-type")||"",e={},r=(i,s)=>{let a=e[i];if(a===void 0)e[i]=s;else if(Array.isArray(a))a.push(s);else e[i]=[a,s]};if(n.includes("multipart/form-data")){let i=await t.formData();for(let[s,a]of i.entries())if(typeof a==="string")r(s,a);return e}if(n.includes("application/x-www-form-urlencoded")){for(let[i,s]of new URLSearchParams(await t.text()).entries())r(i,s);return e}return e}function Rr(t){if(!t)return!1;let n=t.toUpperCase();return n!=="GET"&&n!=="HEAD"}async function F(t,n={}){let e=n.request,r=n.method??e?.method;if(!e||!Rr(r))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let i={};try{i=await tt(e)}catch{}let s=await t.action({request:e,form:i,params:n.params??{},query:t.query??{},cookies:n.cookies??{}});if(s&&typeof s==="object"){let a=s,o=et(a.cookies),c=a.redirect;if(typeof c==="string"&&c)return{redirect:c,ran:!0,...o.length>0?{cookies:o}:{}};let{cookies:u,redirect:l,...f}=a;if(Object.assign(t,f),o.length>0)return{ran:!0,cookies:o}}return{ran:!0}}function et(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let n=[];for(let[e,r]of Object.entries(t)){if(!e)continue;if(typeof r==="string"){n.push(P(e,r));continue}if(r&&typeof r==="object"){let i=r;if(typeof i.value!=="string")continue;n.push(P(e,i.value,i))}}return n}function yo(t,n=[],e){let r=new Headers({Location:t,"Cache-Control":"no-store"});for(let i of n)r.append("Set-Cookie",i);for(let[i,s]of Object.entries(e??{}))if(i.toLowerCase()!=="location")r.set(i,s);return new Response(null,{status:303,headers:r})}async function Lt(t,n={}){let{html:e,context:r,redirect:i,cookies:s}=await nt(t,n),a=Ue(r),o=Ve(r);if(i)return{html:e,redirect:i,cookies:s,status:a,headers:o};let{extractStreamBoundaries:c}=await import("./chunk-04qvjcsr.js"),u=c(r),l=t.streamTemplates;if(l&&Object.keys(l).length>0){let{processDirectives:f}=await import("./chunk-7d2vyre0.js"),{defaultConfig:m}=await import("./chunk-n2g9mj2h.js"),S=r.streamBoundaries||{},b={...m,autoShell:!1},w=Object.keys(l).map((g)=>({id:g,render:async()=>{let R=typeof S[g]==="function"?await S[g]():void 0;return f(l[g],{...r,$boundary:R},t.sourceFile,b,new Set)}})),y=new Set(w.map((g)=>g.id));u=[...(u||[]).filter((g)=>!y.has(g.id)),...w]}return{html:e,boundaries:u&&u.length>0?u:void 0,cookies:s,status:a,headers:o}}async function nt(t,n){let e={__filename:t.sourceFile,__dirname:t.sourceFile.replace(/[/\\][^/\\]+$/,""),...n};if(!t.hasServerScripts&&!rs(t.html))return{html:t.html,context:e};for(let a of t.serverScriptContent)try{await d(a,e,t.sourceFile)}catch(o){if(n.__stx_strict_hydration)throw o;console.warn(`[stx] Server script error in ${t.sourceFile}:`,o)}let r=await F(e,{request:n.request,method:n.method,params:n.params??{},cookies:n.cookies??{}}),i=(a)=>{let o=a.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),c=Jn(e);if(!c)return o;let u=o.indexOf("</head>");return u<0?c+o:o.slice(0,u)+c+o.slice(u)};if(r.redirect)return{html:t.html,context:e,redirect:r.redirect,cookies:r.cookies};if(!rs(t.html))return{html:i(t.html),context:e,cookies:r.cookies};let s=new Map;for(let[a,o]of Object.entries(t.placeholders))if(o.expression)try{let c=x(o.expression,e);if(o.type==="raw")s.set(a,c!==void 0&&c!==null?String(c):"");else s.set(a,c!==void 0&&c!==null?Et(String(c)):"")}catch(c){if(n.__stx_strict_hydration)throw c;s.set(a,"")}return{html:i(Yo(t.html,s)),context:e,cookies:r.cookies}}
31
- export{lo,Ie,uo,se,_,po,$r,On,ye,fo,oe,go,mo,ho,Rr,yo,Lt};
30
+ `)}import _ from"fs";import I from"path";function mo(t,n,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:n,outputDir:e}}function ho(t,n){let e=I.join(n,"manifest.json");_.writeFileSync(e,JSON.stringify(t,null,2))}function yo(t){let n=I.join(t,"manifest.json");if(!_.existsSync(n))return null;try{let e=_.readFileSync(n,"utf-8"),r=JSON.parse(e);if(r.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${r.version}`),null;return r}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function P(t,n,e={}){let r=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`;if(e.maxAge!==void 0)r+=`; Max-Age=${e.maxAge}`;if(e.expires)r+=`; Expires=${e.expires.toUTCString()}`;if(e.path)r+=`; Path=${e.path}`;if(e.domain)r+=`; Domain=${e.domain}`;if(e.secure)r+="; Secure";if(e.httpOnly)r+="; HttpOnly";if(e.sameSite)r+=`; SameSite=${e.sameSite}`;return r}async function tt(t){let n=t.headers.get("content-type")||"",e={},r=(i,s)=>{let a=e[i];if(a===void 0)e[i]=s;else if(Array.isArray(a))a.push(s);else e[i]=[a,s]};if(n.includes("multipart/form-data")){let i=await t.formData();for(let[s,a]of i.entries())if(typeof a==="string")r(s,a);return e}if(n.includes("application/x-www-form-urlencoded")){for(let[i,s]of new URLSearchParams(await t.text()).entries())r(i,s);return e}return e}function Rr(t){if(!t)return!1;let n=t.toUpperCase();return n!=="GET"&&n!=="HEAD"}async function F(t,n={}){let e=n.request,r=n.method??e?.method;if(!e||!Rr(r))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let i={};try{i=await tt(e)}catch{}let s=await t.action({request:e,form:i,params:n.params??{},query:t.query??{},cookies:n.cookies??{}});if(s&&typeof s==="object"){let a=s,o=et(a.cookies),c=a.redirect;if(typeof c==="string"&&c)return{redirect:c,ran:!0,...o.length>0?{cookies:o}:{}};let{cookies:u,redirect:l,...f}=a;if(Object.assign(t,f),o.length>0)return{ran:!0,cookies:o}}return{ran:!0}}function et(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let n=[];for(let[e,r]of Object.entries(t)){if(!e)continue;if(typeof r==="string"){n.push(P(e,r));continue}if(r&&typeof r==="object"){let i=r;if(typeof i.value!=="string")continue;n.push(P(e,i.value,i))}}return n}function bo(t,n=[],e){let r=new Headers({Location:t,"Cache-Control":"no-store"});for(let i of n)r.append("Set-Cookie",i);for(let[i,s]of Object.entries(e??{}))if(i.toLowerCase()!=="location")r.set(i,s);return new Response(null,{status:303,headers:r})}async function Lt(t,n={}){let{html:e,context:r,redirect:i,cookies:s}=await nt(t,n),a=Ue(r),o=Ve(r);if(i)return{html:e,redirect:i,cookies:s,status:a,headers:o};let{extractStreamBoundaries:c}=await import("./chunk-1xyhdpbn.js"),u=c(r),l=t.streamTemplates;if(l&&Object.keys(l).length>0){let{processDirectives:f}=await import("./chunk-yqzhev40.js"),{defaultConfig:m}=await import("./chunk-ya39wk58.js"),S=r.streamBoundaries||{},b={...m,autoShell:!1},w=Object.keys(l).map((g)=>({id:g,render:async()=>{let R=typeof S[g]==="function"?await S[g]():void 0;return f(l[g],{...r,$boundary:R},t.sourceFile,b,new Set)}})),y=new Set(w.map((g)=>g.id));u=[...(u||[]).filter((g)=>!y.has(g.id)),...w]}return{html:e,boundaries:u&&u.length>0?u:void 0,cookies:s,status:a,headers:o}}async function nt(t,n){let e={__filename:t.sourceFile,__dirname:t.sourceFile.replace(/[/\\][^/\\]+$/,""),...n};if(!t.hasServerScripts&&!rs(t.html))return{html:t.html,context:e};for(let a of t.serverScriptContent)try{await d(a,e,t.sourceFile)}catch(o){if(n.__stx_strict_hydration)throw o;console.warn(`[stx] Server script error in ${t.sourceFile}:`,o)}let r=await F(e,{request:n.request,method:n.method,params:n.params??{},cookies:n.cookies??{}}),i=(a)=>{let o=a.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),c=Jn(e);if(!c)return o;let u=o.indexOf("</head>");return u<0?c+o:o.slice(0,u)+c+o.slice(u)};if(r.redirect)return{html:t.html,context:e,redirect:r.redirect,cookies:r.cookies};if(!rs(t.html))return{html:i(t.html),context:e,cookies:r.cookies};let s=new Map;for(let[a,o]of Object.entries(t.placeholders))if(o.expression)try{let c=x(o.expression,e);if(o.type==="raw")s.set(a,c!==void 0&&c!==null?String(c):"");else s.set(a,c!==void 0&&c!==null?_t(String(c)):"")}catch(c){if(n.__stx_strict_hydration)throw c;s.set(a,"")}return{html:i(Zo(t.html,s)),context:e,cookies:r.cookies}}
31
+ export{uo,Ie,po,se,E,fo,$r,On,ye,go,oe,mo,ho,yo,Rr,bo,Lt};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- function So(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="id",dynamicHeight:d=!1,estimatedItemHeight:g=l,direction:x="vertical"}=c,e=[...v],t=0,n=new Map;function f(){if(d)return h();let i=Math.max(0,Math.floor(t/l)-s),r=Math.ceil(u/l),m=Math.min(e.length-1,i+r+s*2);return{startIndex:i,endIndex:m}}function h(){let i=0,r=0,m=e.length-1;for(let p=0;p<e.length;p++){let M=n.get(p)||g;if(i+M>t){r=Math.max(0,p-s);break}i+=M}i=0;for(let p=0;p<e.length;p++){let M=n.get(p)||g;if(i+=M,i>t+u){m=Math.min(e.length-1,p+s);break}}return{startIndex:r,endIndex:m}}function w(){if(d){let i=0;for(let r=0;r<e.length;r++)i+=n.get(r)||g;return i}return e.length*l}function y(i){if(d){let r=0;for(let m=0;m<i;m++)r+=n.get(m)||g;return r}return i*l}function S(){let{startIndex:i,endIndex:r}=f();return{startIndex:i,endIndex:r,scrollTop:t,totalHeight:w(),visibleItems:e.slice(i,r+1),itemHeights:new Map(n)}}function L(i,r="auto"){let m=y(i);a(m,r)}function a(i,r="auto"){t=Math.max(0,Math.min(i,w()-u))}function o(){f()}function H(i){e=[...i],n.clear(),o()}function I(){e=[],n.clear()}return{scrollToIndex:L,scrollToOffset:a,getState:S,refresh:o,setItems:H,destroy:I}}function ko(v,c={},l){let u=/@virtualList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@endvirtualList/gi;return v.replace(u,(s,b,d,g)=>{let x=b.trim(),e=c[x];if(!e||!Array.isArray(e))return`<!-- virtualList: items "${x}" not found or not an array -->`;let t={itemHeight:50,containerHeight:400,overscan:3};if(d)try{let a=d.trim(),o=Function(`return ${a}`)();t={...t,...o}}catch{}let n=`vlist-${Math.random().toString(36).substring(2,9)}`,f=Math.ceil(t.containerHeight/t.itemHeight),h=t.overscan||3,w=0,y=Math.min(e.length-1,f+h),S="";for(let a=w;a<=y&&a<e.length;a++){let o=e[a],H=g.replace(/\{\{\s*item\s*\}\}/g,typeof o==="object"?JSON.stringify(o):String(o)).replace(/\{\{\s*item\.(\w+)\s*\}\}/g,(I,i)=>{if(typeof o==="object"&&o!==null)return String(o[i]??"");return""}).replace(/\{\{\s*index\s*\}\}/g,String(a));S+=`
2
+ function ko(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="id",dynamicHeight:d=!1,estimatedItemHeight:g=l,direction:x="vertical"}=c,e=[...v],t=0,n=new Map;function f(){if(d)return h();let i=Math.max(0,Math.floor(t/l)-s),r=Math.ceil(u/l),m=Math.min(e.length-1,i+r+s*2);return{startIndex:i,endIndex:m}}function h(){let i=0,r=0,m=e.length-1;for(let p=0;p<e.length;p++){let M=n.get(p)||g;if(i+M>t){r=Math.max(0,p-s);break}i+=M}i=0;for(let p=0;p<e.length;p++){let M=n.get(p)||g;if(i+=M,i>t+u){m=Math.min(e.length-1,p+s);break}}return{startIndex:r,endIndex:m}}function w(){if(d){let i=0;for(let r=0;r<e.length;r++)i+=n.get(r)||g;return i}return e.length*l}function y(i){if(d){let r=0;for(let m=0;m<i;m++)r+=n.get(m)||g;return r}return i*l}function S(){let{startIndex:i,endIndex:r}=f();return{startIndex:i,endIndex:r,scrollTop:t,totalHeight:w(),visibleItems:e.slice(i,r+1),itemHeights:new Map(n)}}function L(i,r="auto"){let m=y(i);a(m,r)}function a(i,r="auto"){t=Math.max(0,Math.min(i,w()-u))}function o(){f()}function H(i){e=[...i],n.clear(),o()}function I(){e=[],n.clear()}return{scrollToIndex:L,scrollToOffset:a,getState:S,refresh:o,setItems:H,destroy:I}}function Co(v,c={},l){let u=/@virtualList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@endvirtualList/gi;return v.replace(u,(s,b,d,g)=>{let x=b.trim(),e=c[x];if(!e||!Array.isArray(e))return`<!-- virtualList: items "${x}" not found or not an array -->`;let t={itemHeight:50,containerHeight:400,overscan:3};if(d)try{let a=d.trim(),o=Function(`return ${a}`)();t={...t,...o}}catch{}let n=`vlist-${Math.random().toString(36).substring(2,9)}`,f=Math.ceil(t.containerHeight/t.itemHeight),h=t.overscan||3,w=0,y=Math.min(e.length-1,f+h),S="";for(let a=w;a<=y&&a<e.length;a++){let o=e[a],H=g.replace(/\{\{\s*item\s*\}\}/g,typeof o==="object"?JSON.stringify(o):String(o)).replace(/\{\{\s*item\.(\w+)\s*\}\}/g,(I,i)=>{if(typeof o==="object"&&o!==null)return String(o[i]??"");return""}).replace(/\{\{\s*index\s*\}\}/g,String(a));S+=`
3
3
  <div class="virtual-item ${t.itemClass||""}"
4
4
  style="position: absolute; top: ${a*t.itemHeight}px; height: ${t.itemHeight}px; width: 100%;"
5
5
  data-index="${a}">
@@ -76,7 +76,7 @@ function So(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
76
76
  };
77
77
  })();
78
78
  </script>
79
- `})}function Ca(){return`
79
+ `})}function _a(){return`
80
80
  .virtual-list-container {
81
81
  position: relative;
82
82
  overflow-y: auto;
@@ -124,7 +124,7 @@ function So(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
124
124
  0% { background-position: 200% 0; }
125
125
  100% { background-position: -200% 0; }
126
126
  }
127
- `}function Ea(v,c){let l=null,u=()=>{if(!l)l=So(v(),c);return l};return{visibleItems:()=>u().getState().visibleItems,totalHeight:()=>u().getState().totalHeight,containerProps:()=>({style:{height:`${c.containerHeight}px`,overflow:"auto",position:"relative"},onScroll:(s)=>{let b=s.target;if(l)l.scrollToOffset(b.scrollTop)}}),itemProps:(s)=>({style:{position:"absolute",top:`${s*c.itemHeight}px`,height:`${c.itemHeight}px`,width:"100%"},"data-index":s}),scrollToIndex:(s)=>{u().scrollToIndex(s)}}}function _a(v,c={},l){let u=/@infiniteList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@loading\s*([\s\S]*?)@endinfiniteList/gi;return v.replace(u,(s,b,d,g,x)=>{let e=b.trim(),t=c[e];if(!t||!Array.isArray(t))return`<!-- infiniteList: items "${e}" not found or not an array -->`;let n={itemHeight:50,containerHeight:400,overscan:3,threshold:100,hasMore:!0};if(d)try{let w=Function(`return ${d.trim()}`)();n={...n,...w}}catch{}let f=`ilist-${Math.random().toString(36).substring(2,9)}`,h=ko(`@virtualList(${e}, ${JSON.stringify({itemHeight:n.itemHeight,containerHeight:n.containerHeight,overscan:n.overscan,containerClass:n.containerClass})})${g}@endvirtualList`,c);return h=h.replace("</script>",`
127
+ `}function Ea(v,c){let l=null,u=()=>{if(!l)l=ko(v(),c);return l};return{visibleItems:()=>u().getState().visibleItems,totalHeight:()=>u().getState().totalHeight,containerProps:()=>({style:{height:`${c.containerHeight}px`,overflow:"auto",position:"relative"},onScroll:(s)=>{let b=s.target;if(l)l.scrollToOffset(b.scrollTop)}}),itemProps:(s)=>({style:{position:"absolute",top:`${s*c.itemHeight}px`,height:`${c.itemHeight}px`,width:"100%"},"data-index":s}),scrollToIndex:(s)=>{u().scrollToIndex(s)}}}function Ta(v,c={},l){let u=/@infiniteList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@loading\s*([\s\S]*?)@endinfiniteList/gi;return v.replace(u,(s,b,d,g,x)=>{let e=b.trim(),t=c[e];if(!t||!Array.isArray(t))return`<!-- infiniteList: items "${e}" not found or not an array -->`;let n={itemHeight:50,containerHeight:400,overscan:3,threshold:100,hasMore:!0};if(d)try{let w=Function(`return ${d.trim()}`)();n={...n,...w}}catch{}let f=`ilist-${Math.random().toString(36).substring(2,9)}`,h=Co(`@virtualList(${e}, ${JSON.stringify({itemHeight:n.itemHeight,containerHeight:n.containerHeight,overscan:n.overscan,containerClass:n.containerClass})})${g}@endvirtualList`,c);return h=h.replace("</script>",`
128
128
  // Infinite scroll detection
129
129
  container.addEventListener('scroll', function() {
130
130
  const scrollBottom = container.scrollTop + container.clientHeight;
@@ -142,7 +142,7 @@ function So(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
142
142
  ${x}
143
143
  </div>
144
144
  </div>
145
- `})}function Ta(v,c={},l){let u=/@virtualGrid\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@endvirtualGrid/gi;return v.replace(u,(s,b,d,g)=>{let x=b.trim(),e=c[x];if(!e||!Array.isArray(e))return`<!-- virtualGrid: items "${x}" not found or not an array -->`;let t={columns:3,rowHeight:100,containerHeight:400,gap:10,overscan:2};if(d)try{let o=Function(`return ${d.trim()}`)();t={...t,...o}}catch{}let n=`vgrid-${Math.random().toString(36).substring(2,9)}`,f=Math.ceil(e.length/t.columns),h=f*(t.rowHeight+(t.gap||0)),w=Math.ceil(t.containerHeight/(t.rowHeight+(t.gap||0))),y=t.overscan||2,S=0,L=Math.min(f-1,w+y),a="";for(let o=S;o<=L;o++)for(let H=0;H<t.columns;H++){let I=o*t.columns+H;if(I>=e.length)break;let i=e[I],r=H*(100/t.columns),m=o*(t.rowHeight+(t.gap||0)),p=g.replace(/\{\{\s*item\s*\}\}/g,typeof i==="object"?JSON.stringify(i):String(i)).replace(/\{\{\s*item\.(\w+)\s*\}\}/g,(M,T)=>{if(typeof i==="object"&&i!==null)return String(i[T]??"");return""}).replace(/\{\{\s*index\s*\}\}/g,String(I));a+=`
145
+ `})}function $a(v,c={},l){let u=/@virtualGrid\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@endvirtualGrid/gi;return v.replace(u,(s,b,d,g)=>{let x=b.trim(),e=c[x];if(!e||!Array.isArray(e))return`<!-- virtualGrid: items "${x}" not found or not an array -->`;let t={columns:3,rowHeight:100,containerHeight:400,gap:10,overscan:2};if(d)try{let o=Function(`return ${d.trim()}`)();t={...t,...o}}catch{}let n=`vgrid-${Math.random().toString(36).substring(2,9)}`,f=Math.ceil(e.length/t.columns),h=f*(t.rowHeight+(t.gap||0)),w=Math.ceil(t.containerHeight/(t.rowHeight+(t.gap||0))),y=t.overscan||2,S=0,L=Math.min(f-1,w+y),a="";for(let o=S;o<=L;o++)for(let H=0;H<t.columns;H++){let I=o*t.columns+H;if(I>=e.length)break;let i=e[I],r=H*(100/t.columns),m=o*(t.rowHeight+(t.gap||0)),p=g.replace(/\{\{\s*item\s*\}\}/g,typeof i==="object"?JSON.stringify(i):String(i)).replace(/\{\{\s*item\.(\w+)\s*\}\}/g,(M,T)=>{if(typeof i==="object"&&i!==null)return String(i[T]??"");return""}).replace(/\{\{\s*index\s*\}\}/g,String(I));a+=`
146
146
  <div class="virtual-grid-item"
147
147
  style="position: absolute; top: ${m}px; left: ${r}%; width: calc(${100/t.columns}% - ${t.gap||0}px); height: ${t.rowHeight}px;"
148
148
  data-index="${I}">
@@ -212,5 +212,5 @@ function So(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
212
212
  });
213
213
  })();
214
214
  </script>
215
- `})}var Nl={createVirtualList:So,processVirtualListDirectives:ko,processInfiniteListDirectives:_a,processVirtualGridDirectives:Ta,generateVirtualListCSS:Ca,useVirtualList:Ea};
216
- export{So,ko,Ca,Ea,_a,Ta,Nl};
215
+ `})}var Ll={createVirtualList:ko,processVirtualListDirectives:Co,processInfiniteListDirectives:Ta,processVirtualGridDirectives:$a,generateVirtualListCSS:_a,useVirtualList:Ea};
216
+ export{ko,Co,_a,Ea,Ta,$a,Ll};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$t,Cc,_c,Ec,Tc,$c,d,Rc,ys,Ac,gi,mi}from"./chunk-kz131809.js";import"./chunk-gwabvrc3.js";import"./chunk-3wcwtqx1.js";import"./chunk-9k6r7f3c.js";import"./chunk-dajh1369.js";import"./chunk-ebg20d8s.js";import"./chunk-ywah1c30.js";import"./chunk-wemq37qe.js";import"./chunk-j3vwyzvb.js";import"./chunk-d4ybwtqt.js";import"./chunk-c1ys37c9.js";import"./chunk-w8vg3te3.js";import"./chunk-tdv9np5t.js";export{$t as STX_ENGINE_BINDING_NAMES,ys as convertToCommonJS,gi as extractScriptFromTemplate,d as extractVariables,mi as hasVariables,Rc as isCompleteImport,$c as isMissingBindingFailure,Ec as isModuleResolutionFailure,Tc as isSyntaxFailure,Ac as splitDeclaration,Cc as stripTypeScript,_c as withoutStxReferrer};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Al,Pl,Il,Ol,Dl,Ml,Nl}from"./chunk-2t3bhp2j.js";export{Pl as createKeepAliveCache,Ol as generateKeepAliveCSS,Dl as generateKeepAliveRuntime,Ml as onActivated,Nl as onDeactivated,Al as processKeepAliveDirectives,Il as shouldCacheComponent};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Po,Io,Oo,Pd}from"./chunk-q8nw82pz.js";import"./chunk-35kmebz9.js";import"./chunk-rtc17gy5.js";import"./chunk-kz131809.js";import"./chunk-gwabvrc3.js";import"./chunk-3wcwtqx1.js";import"./chunk-9k6r7f3c.js";import"./chunk-dajh1369.js";import"./chunk-ebg20d8s.js";import"./chunk-ywah1c30.js";import"./chunk-wemq37qe.js";import"./chunk-j3vwyzvb.js";import"./chunk-d4ybwtqt.js";import"./chunk-c1ys37c9.js";import"./chunk-w8vg3te3.js";import"./chunk-tdv9np5t.js";export{Po as buildNative,Pd as default,Oo as getAvailableFormats,Io as getAvailableTargets};
@@ -1,8 +1,8 @@
1
1
  // @bun
2
- import d from"fs";import l from"path";function Fo(n){let s=[],e=n.pwa;if(s.push({id:"pwa-enabled",name:"PWA Enabled",category:"required",passed:e?.enabled===!0,message:e?.enabled?"PWA is enabled":"PWA is not enabled in config"}),!e?.enabled)return s;s.push({id:"manifest-name",name:"App Name",category:"required",passed:Boolean(e.manifest?.name),message:e.manifest?.name?`App name: "${e.manifest.name}"`:"Missing required manifest name"}),s.push({id:"manifest-short-name",name:"Short Name",category:"recommended",passed:Boolean(e.manifest?.shortName),message:e.manifest?.shortName?`Short name: "${e.manifest.shortName}"`:"Short name not set (will use full name)"}),s.push({id:"manifest-description",name:"App Description",category:"recommended",passed:Boolean(e.manifest?.description),message:e.manifest?.description?"Description is set":"App description not provided"}),s.push({id:"manifest-theme-color",name:"Theme Color",category:"required",passed:Boolean(e.manifest?.themeColor),message:e.manifest?.themeColor?`Theme color: ${e.manifest.themeColor}`:"Theme color not set"}),s.push({id:"manifest-background-color",name:"Background Color",category:"required",passed:Boolean(e.manifest?.backgroundColor),message:e.manifest?.backgroundColor?`Background color: ${e.manifest.backgroundColor}`:"Background color not set"}),s.push({id:"manifest-display",name:"Display Mode",category:"required",passed:["standalone","fullscreen","minimal-ui"].includes(e.manifest?.display||""),message:e.manifest?.display?`Display mode: ${e.manifest.display}`:"Display mode should be standalone, fullscreen, or minimal-ui"}),s.push({id:"manifest-start-url",name:"Start URL",category:"required",passed:Boolean(e.manifest?.startUrl),message:e.manifest?.startUrl?`Start URL: ${e.manifest.startUrl}`:"Start URL not set"}),s.push({id:"icons-source",name:"Icon Source",category:"required",passed:Boolean(e.icons?.src),message:e.icons?.src?`Icon source: ${e.icons.src}`:"No icon source configured"});let a=e.icons?.sizes||[];s.push({id:"icons-192",name:"192x192 Icon",category:"required",passed:a.includes(192),message:a.includes(192)?"192x192 icon will be generated":"Missing 192x192 icon (required for Android)"}),s.push({id:"icons-512",name:"512x512 Icon",category:"required",passed:a.includes(512),message:a.includes(512)?"512x512 icon will be generated":"Missing 512x512 icon (required for splash screen)"}),s.push({id:"icons-maskable",name:"Maskable Icon",category:"recommended",passed:e.icons?.purpose?.includes("maskable")||!1,message:e.icons?.purpose?.includes("maskable")?"Maskable icon purpose is set":"Consider adding maskable icon purpose for adaptive icons"}),s.push({id:"sw-configured",name:"Service Worker",category:"required",passed:Boolean(e.serviceWorker),message:e.serviceWorker?"Service worker is configured":"Service worker configuration missing"}),s.push({id:"sw-cache-version",name:"Cache Version",category:"recommended",passed:Boolean(e.serviceWorker?.cacheVersion),message:e.serviceWorker?.cacheVersion?`Cache version: ${e.serviceWorker.cacheVersion}`:"Set cache version for proper cache busting"}),s.push({id:"offline-enabled",name:"Offline Support",category:"required",passed:e.offline?.enabled===!0,message:e.offline?.enabled?"Offline support is enabled":"Offline support is disabled"});let t=e.routes||[];return s.push({id:"caching-strategies",name:"Caching Strategies",category:"recommended",passed:t.length>0,message:t.length>0?`${t.length} route caching strategies configured`:"No custom caching strategies defined"}),s.push({id:"push-config",name:"Push Notifications",category:"optional",passed:!e.push?.enabled||Boolean(e.push?.vapidPublicKey),message:e.push?.enabled?e.push?.vapidPublicKey?"Push notifications configured with VAPID key":"Push enabled but missing VAPID key":"Push notifications not enabled"}),s.push({id:"share-target",name:"Share Target",category:"optional",passed:!0,message:e.shareTarget?.enabled?`Share target enabled at ${e.shareTarget.action}`:"Share target not enabled"}),s.push({id:"auto-inject",name:"Auto-injection",category:"recommended",passed:e.autoInject!==!1,message:e.autoInject!==!1?"PWA tags will be auto-injected":"Auto-injection disabled - manual tag insertion required"}),s}function zo(n){let s=[],e=l.join(n,"manifest.json"),a=d.existsSync(e);if(s.push({id:"build-manifest",name:"Manifest File",category:"required",passed:a,message:a?"manifest.json exists":"manifest.json not found in build output"}),a)try{let r=JSON.parse(d.readFileSync(e,"utf-8"));s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!0,message:"Manifest is valid JSON"}),s.push({id:"build-manifest-icons",name:"Manifest Icons",category:"required",passed:Array.isArray(r.icons)&&r.icons.length>0,message:r.icons?.length?`${r.icons.length} icons defined in manifest`:"No icons defined in manifest"})}catch{s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!1,message:"Manifest is not valid JSON"})}let t=l.join(n,"sw.js"),c=d.existsSync(t);s.push({id:"build-sw",name:"Service Worker File",category:"required",passed:c,message:c?"Service worker (sw.js) exists":"Service worker not found in build output"});let o=l.join(n,"offline.html"),u=d.existsSync(o);s.push({id:"build-offline",name:"Offline Page",category:"recommended",passed:u,message:u?"Offline page exists":"No offline.html found"});let i=l.join(n,"pwa-icons");if(d.existsSync(i)){let r=d.readdirSync(i).filter((m)=>m.endsWith(".png")||m.endsWith(".webp"));s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:r.length>0,message:r.length>0?`${r.length} icon files generated`:"No icon files found"})}else s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:!1,message:"Icons directory not found"});return s}function Ho(n){let s=n.filter((i)=>i.category==="required"),e=n.filter((i)=>i.category==="recommended"),a=s.filter((i)=>i.passed).length,t=e.filter((i)=>i.passed).length,c=s.length>0?a/s.length*70:70,o=e.length>0?t/e.length*30:30;return{score:Math.round(c+o),passed:n.filter((i)=>i.passed).length,failed:n.filter((i)=>!i.passed&&i.category==="required").length,warnings:n.filter((i)=>!i.passed&&i.category!=="required").length,checks:n}}function qa(n,s){let e=Fo(n),a=s&&d.existsSync(s)?zo(s):[];return Ho([...e,...a])}function Ga(n){let s=[];s.push(`
2
+ import d from"fs";import l from"path";function zo(n){let s=[],e=n.pwa;if(s.push({id:"pwa-enabled",name:"PWA Enabled",category:"required",passed:e?.enabled===!0,message:e?.enabled?"PWA is enabled":"PWA is not enabled in config"}),!e?.enabled)return s;s.push({id:"manifest-name",name:"App Name",category:"required",passed:Boolean(e.manifest?.name),message:e.manifest?.name?`App name: "${e.manifest.name}"`:"Missing required manifest name"}),s.push({id:"manifest-short-name",name:"Short Name",category:"recommended",passed:Boolean(e.manifest?.shortName),message:e.manifest?.shortName?`Short name: "${e.manifest.shortName}"`:"Short name not set (will use full name)"}),s.push({id:"manifest-description",name:"App Description",category:"recommended",passed:Boolean(e.manifest?.description),message:e.manifest?.description?"Description is set":"App description not provided"}),s.push({id:"manifest-theme-color",name:"Theme Color",category:"required",passed:Boolean(e.manifest?.themeColor),message:e.manifest?.themeColor?`Theme color: ${e.manifest.themeColor}`:"Theme color not set"}),s.push({id:"manifest-background-color",name:"Background Color",category:"required",passed:Boolean(e.manifest?.backgroundColor),message:e.manifest?.backgroundColor?`Background color: ${e.manifest.backgroundColor}`:"Background color not set"}),s.push({id:"manifest-display",name:"Display Mode",category:"required",passed:["standalone","fullscreen","minimal-ui"].includes(e.manifest?.display||""),message:e.manifest?.display?`Display mode: ${e.manifest.display}`:"Display mode should be standalone, fullscreen, or minimal-ui"}),s.push({id:"manifest-start-url",name:"Start URL",category:"required",passed:Boolean(e.manifest?.startUrl),message:e.manifest?.startUrl?`Start URL: ${e.manifest.startUrl}`:"Start URL not set"}),s.push({id:"icons-source",name:"Icon Source",category:"required",passed:Boolean(e.icons?.src),message:e.icons?.src?`Icon source: ${e.icons.src}`:"No icon source configured"});let a=e.icons?.sizes||[];s.push({id:"icons-192",name:"192x192 Icon",category:"required",passed:a.includes(192),message:a.includes(192)?"192x192 icon will be generated":"Missing 192x192 icon (required for Android)"}),s.push({id:"icons-512",name:"512x512 Icon",category:"required",passed:a.includes(512),message:a.includes(512)?"512x512 icon will be generated":"Missing 512x512 icon (required for splash screen)"}),s.push({id:"icons-maskable",name:"Maskable Icon",category:"recommended",passed:e.icons?.purpose?.includes("maskable")||!1,message:e.icons?.purpose?.includes("maskable")?"Maskable icon purpose is set":"Consider adding maskable icon purpose for adaptive icons"}),s.push({id:"sw-configured",name:"Service Worker",category:"required",passed:Boolean(e.serviceWorker),message:e.serviceWorker?"Service worker is configured":"Service worker configuration missing"}),s.push({id:"sw-cache-version",name:"Cache Version",category:"recommended",passed:Boolean(e.serviceWorker?.cacheVersion),message:e.serviceWorker?.cacheVersion?`Cache version: ${e.serviceWorker.cacheVersion}`:"Set cache version for proper cache busting"}),s.push({id:"offline-enabled",name:"Offline Support",category:"required",passed:e.offline?.enabled===!0,message:e.offline?.enabled?"Offline support is enabled":"Offline support is disabled"});let t=e.routes||[];return s.push({id:"caching-strategies",name:"Caching Strategies",category:"recommended",passed:t.length>0,message:t.length>0?`${t.length} route caching strategies configured`:"No custom caching strategies defined"}),s.push({id:"push-config",name:"Push Notifications",category:"optional",passed:!e.push?.enabled||Boolean(e.push?.vapidPublicKey),message:e.push?.enabled?e.push?.vapidPublicKey?"Push notifications configured with VAPID key":"Push enabled but missing VAPID key":"Push notifications not enabled"}),s.push({id:"share-target",name:"Share Target",category:"optional",passed:!0,message:e.shareTarget?.enabled?`Share target enabled at ${e.shareTarget.action}`:"Share target not enabled"}),s.push({id:"auto-inject",name:"Auto-injection",category:"recommended",passed:e.autoInject!==!1,message:e.autoInject!==!1?"PWA tags will be auto-injected":"Auto-injection disabled - manual tag insertion required"}),s}function Ho(n){let s=[],e=l.join(n,"manifest.json"),a=d.existsSync(e);if(s.push({id:"build-manifest",name:"Manifest File",category:"required",passed:a,message:a?"manifest.json exists":"manifest.json not found in build output"}),a)try{let r=JSON.parse(d.readFileSync(e,"utf-8"));s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!0,message:"Manifest is valid JSON"}),s.push({id:"build-manifest-icons",name:"Manifest Icons",category:"required",passed:Array.isArray(r.icons)&&r.icons.length>0,message:r.icons?.length?`${r.icons.length} icons defined in manifest`:"No icons defined in manifest"})}catch{s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!1,message:"Manifest is not valid JSON"})}let t=l.join(n,"sw.js"),c=d.existsSync(t);s.push({id:"build-sw",name:"Service Worker File",category:"required",passed:c,message:c?"Service worker (sw.js) exists":"Service worker not found in build output"});let o=l.join(n,"offline.html"),u=d.existsSync(o);s.push({id:"build-offline",name:"Offline Page",category:"recommended",passed:u,message:u?"Offline page exists":"No offline.html found"});let i=l.join(n,"pwa-icons");if(d.existsSync(i)){let r=d.readdirSync(i).filter((m)=>m.endsWith(".png")||m.endsWith(".webp"));s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:r.length>0,message:r.length>0?`${r.length} icon files generated`:"No icon files found"})}else s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:!1,message:"Icons directory not found"});return s}function Uo(n){let s=n.filter((i)=>i.category==="required"),e=n.filter((i)=>i.category==="recommended"),a=s.filter((i)=>i.passed).length,t=e.filter((i)=>i.passed).length,c=s.length>0?a/s.length*70:70,o=e.length>0?t/e.length*30:30;return{score:Math.round(c+o),passed:n.filter((i)=>i.passed).length,failed:n.filter((i)=>!i.passed&&i.category==="required").length,warnings:n.filter((i)=>!i.passed&&i.category!=="required").length,checks:n}}function Ga(n,s){let e=zo(n),a=s&&d.existsSync(s)?Ho(s):[];return Uo([...e,...a])}function Ka(n){let s=[];s.push(`
3
3
  === PWA Audit Report ===
4
4
  `);let e=n.score>=90?"32":n.score>=70?"33":"31";s.push(`Score: \x1B[${e}m${n.score}/100\x1B[0m`),s.push(`Passed: ${n.passed} | Failed: ${n.failed} | Warnings: ${n.warnings}
5
5
  `);let a=["required","recommended","optional"];for(let t of a){let c=n.checks.filter((o)=>o.category===t);if(c.length===0)continue;s.push(`
6
6
  ${t.toUpperCase()}:`);for(let o of c){let u=o.passed?"\x1B[32m\u2713\x1B[0m":"\x1B[31m\u2717\x1B[0m";if(s.push(` ${u} ${o.name}: ${o.message}`),o.details)s.push(` ${o.details}`)}}return s.push(""),s.join(`
7
7
  `)}
8
- export{Fo,zo,Ho,qa,Ga};
8
+ export{zo,Ho,Uo,Ga,Ka};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import c from"fs";import i from"path";import{createHash as k}from"crypto";var j=["pages","components","layouts","partials","composables"],w=new Set;function _i(e){try{return w.has(c.realpathSync(e))}catch{return w.has(i.resolve(e))}}var _=new Set(["extends","root",...j.map((e)=>`${e}Dir`),"publicDir","stateDir","cachePath"]),x=(e)=>e!==null&&typeof e==="object"&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null);function b(e,n,r=""){if(Array.isArray(n))return["middleware","plugins"].includes(r)?[...Array.isArray(e)?e:[],...n]:[...n];if(!x(n))return n;let o={...x(e)?e:{}};for(let[s,a]of Object.entries(n)){if(["__proto__","constructor","prototype"].includes(s))throw Error(`Invalid layer config key: ${s}`);o[s]=b(o[s],a,s)}return o}function v(e){for(let n of["stx.config.ts","stx.config.js","stx.config.mjs",".config/stx.config.ts",".config/stx.ts","ui.config.ts"]){let r=i.join(e,n);if(c.existsSync(r))return c.realpathSync(r)}throw Error(`Application layer has no stx.config.ts: ${e}`)}function E(e,n,r){if(typeof e!=="string"||!e||/^(?:https?:|git[+:])/.test(e))throw Error(`Invalid application layer ${JSON.stringify(e)} in ${n}; use a local path or installed package`);if(e.startsWith(".")||i.isAbsolute(e)){let s=i.resolve(n,e);return c.statSync(s).isDirectory()?v(s):c.realpathSync(s)}let o=n;while(!0){let s=i.join(o,"node_modules",e),a=i.join(s,"package.json");if(c.existsSync(a)){r.add(c.realpathSync(a));let g=JSON.parse(c.readFileSync(a,"utf8"));return g.stx?.layer?c.realpathSync(i.resolve(s,g.stx.layer)):v(s)}let p=i.dirname(o);if(p===o)break;o=p}throw Error(`Cannot resolve application layer ${JSON.stringify(e)} from ${n}`)}async function C(e,n){let r=await Bun.build({entrypoints:[e],target:"bun",format:"esm",splitting:!1,plugins:[{name:"stx-layer-config",setup(a){a.onResolve({filter:/^[^./]/},(p)=>{if(p.path.startsWith("node:"))return{path:p.path,external:!0};return{path:Bun.resolveSync(p.path,p.resolveDir),external:!0}}),a.onLoad({filter:/./},(p)=>{let g=c.realpathSync(p.path);n.add(g),w.add(g);return})}}]});if(!r.success)throw Error(`Cannot load layer ${e}: ${r.logs.join(`
3
- `)}`);let o=r.outputs.find((a)=>a.kind==="entry-point");if(!o||r.outputs.length!==1)throw Error(`Unsupported layer config output: ${e}`);let s=(await import(`data:text/javascript;base64,${Buffer.from(await o.text()).toString("base64")}`)).default;if(!x(s))throw Error(`Layer ${e} must default-export a config object`);return s}async function Ti(e,n){let r=new Set,o=[],s=[],a=new Set,p=[];async function g(t,l){if(t=c.realpathSync(t),p.includes(t))throw Error(`Application layer cycle: ${[...p,t].join(" -> ")}`);if(a.has(t))return;a.add(t),p.push(t);let d=await C(t,r);l??=i.basename(i.dirname(t))===".config"?i.dirname(i.dirname(t)):i.dirname(t),l=c.realpathSync(l);let D=i.resolve(l,d.root??"."),L=Object.fromEntries(j.map((y)=>[y,i.resolve(D,d[`${y}Dir`]??(y==="composables"?"functions":y))]));o.push({root:l,configFile:t,resources:L});let u={...d};if(u.plugins)u.plugins=u.plugins.map((y)=>{let h=typeof y==="string"?y:y[0],S=h.startsWith(".")?i.resolve(l,h):i.isAbsolute(h)?h:Bun.resolveSync(h,l);return r.add(c.realpathSync(S)),typeof y==="string"?S:[S,y[1]]});if(typeof u.css==="string")u.css=i.resolve(l,u.css);if(u.serverApi)u.serverApi={...typeof u.serverApi==="object"?u.serverApi:{},dir:i.resolve(l,typeof u.serverApi==="object"?u.serverApi.dir??"server/api":"server/api")};if(s.push(u),d.extends!==void 0&&!Array.isArray(d.extends))throw Error(`extends in ${t} must be an array`);for(let y of d.extends??[])await g(E(y,l,r));p.pop()}await g(v(e),e);for(let t of["package.json","bun.lock","package-lock.json","pnpm-lock.yaml"]){let l=i.join(e,t);if(c.existsSync(l))r.add(c.realpathSync(l))}let f=b({},n);for(let t=s.length-1;t>=0;t--){let l=t===0?s[t]:Object.fromEntries(Object.entries(s[t]).filter(([d])=>!_.has(d)));f=b(f,l)}let m={layers:o,configDependencies:[...r].sort()};return f._layerGraph=m,f._layerPageDirs=o.map((t)=>t.resources.pages),f._layerComponentDirs=o.map((t)=>t.resources.components),f._layerLayoutDirs=o.map((t)=>t.resources.layouts),f._layerPartialDirs=o.map((t)=>t.resources.partials),f._layerComposableDirs=o.map((t)=>t.resources.composables),await Ts(m,e),{config:f,graph:m}}async function Ts(e,n){let r=new Map,o=[];for(let s of e.layers)for(let[a,p]of Object.entries(s.resources)){if(!c.existsSync(p))continue;let g=new Bun.Glob(a==="composables"?"**/*.ts":"**/*.stx");for(let f of[...g.scanSync({cwd:p})].sort()){let m=`${a}/${f}`,t=i.join(p,f),l=r.get(m);if(l)o.push({resource:m,winner:l,shadowed:t});else r.set(m,t)}}Object.assign(e,{overrides:o}),await Bun.write(i.join(n,".stx/layers.json"),JSON.stringify(e,null,2))}function A(e){let n=new Set(e.configDependencies);function r(o){if(!c.existsSync(o))return;n.add(o);for(let s of c.readdirSync(o,{withFileTypes:!0}).sort((a,p)=>a.name.localeCompare(p.name))){if(s.name.startsWith(".")||s.name==="node_modules")continue;let a=i.join(o,s.name);if(s.isDirectory())r(a);else if(s.isFile())n.add(a)}}for(let o of e.layers)for(let s of Object.values(o.resources))r(s);return[...n].sort()}function er(e){return O(A(e))}function tr(e){return O(e.configDependencies)}function O(e){return e.map((n)=>{try{let r=c.statSync(n);return`${n}:${r.mtimeMs}:${r.size}`}catch{return`${n}:missing`}}).join(`
4
- `)}function $i(e){return e.layers.map((n)=>({config:i.relative(n.root,n.configFile),files:A({layers:[n],configDependencies:e.configDependencies.filter((r)=>r.startsWith(`${n.root}${i.sep}`))}).filter((r)=>c.statSync(r).isFile()).map((r)=>({path:i.relative(n.root,r).replaceAll(i.sep,"/"),sha256:k("sha256").update(c.readFileSync(r)).digest("hex")}))}))}
5
- export{_i,Ti,Ts,er,tr,$i};
2
+ import c from"fs";import i from"path";import{createHash as k}from"crypto";var j=["pages","components","layouts","partials","composables"],w=new Set;function Ti(e){try{return w.has(c.realpathSync(e))}catch{return w.has(i.resolve(e))}}var _=new Set(["extends","root",...j.map((e)=>`${e}Dir`),"publicDir","stateDir","cachePath"]),x=(e)=>e!==null&&typeof e==="object"&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null);function b(e,n,r=""){if(Array.isArray(n))return["middleware","plugins"].includes(r)?[...Array.isArray(e)?e:[],...n]:[...n];if(!x(n))return n;let o={...x(e)?e:{}};for(let[s,a]of Object.entries(n)){if(["__proto__","constructor","prototype"].includes(s))throw Error(`Invalid layer config key: ${s}`);o[s]=b(o[s],a,s)}return o}function v(e){for(let n of["stx.config.ts","stx.config.js","stx.config.mjs",".config/stx.config.ts",".config/stx.ts","ui.config.ts"]){let r=i.join(e,n);if(c.existsSync(r))return c.realpathSync(r)}throw Error(`Application layer has no stx.config.ts: ${e}`)}function E(e,n,r){if(typeof e!=="string"||!e||/^(?:https?:|git[+:])/.test(e))throw Error(`Invalid application layer ${JSON.stringify(e)} in ${n}; use a local path or installed package`);if(e.startsWith(".")||i.isAbsolute(e)){let s=i.resolve(n,e);return c.statSync(s).isDirectory()?v(s):c.realpathSync(s)}let o=n;while(!0){let s=i.join(o,"node_modules",e),a=i.join(s,"package.json");if(c.existsSync(a)){r.add(c.realpathSync(a));let g=JSON.parse(c.readFileSync(a,"utf8"));return g.stx?.layer?c.realpathSync(i.resolve(s,g.stx.layer)):v(s)}let p=i.dirname(o);if(p===o)break;o=p}throw Error(`Cannot resolve application layer ${JSON.stringify(e)} from ${n}`)}async function C(e,n){let r=await Bun.build({entrypoints:[e],target:"bun",format:"esm",splitting:!1,plugins:[{name:"stx-layer-config",setup(a){a.onResolve({filter:/^[^./]/},(p)=>{if(p.path.startsWith("node:"))return{path:p.path,external:!0};return{path:Bun.resolveSync(p.path,p.resolveDir),external:!0}}),a.onLoad({filter:/./},(p)=>{let g=c.realpathSync(p.path);n.add(g),w.add(g);return})}}]});if(!r.success)throw Error(`Cannot load layer ${e}: ${r.logs.join(`
3
+ `)}`);let o=r.outputs.find((a)=>a.kind==="entry-point");if(!o||r.outputs.length!==1)throw Error(`Unsupported layer config output: ${e}`);let s=(await import(`data:text/javascript;base64,${Buffer.from(await o.text()).toString("base64")}`)).default;if(!x(s))throw Error(`Layer ${e} must default-export a config object`);return s}async function $i(e,n){let r=new Set,o=[],s=[],a=new Set,p=[];async function g(t,l){if(t=c.realpathSync(t),p.includes(t))throw Error(`Application layer cycle: ${[...p,t].join(" -> ")}`);if(a.has(t))return;a.add(t),p.push(t);let d=await C(t,r);l??=i.basename(i.dirname(t))===".config"?i.dirname(i.dirname(t)):i.dirname(t),l=c.realpathSync(l);let D=i.resolve(l,d.root??"."),L=Object.fromEntries(j.map((y)=>[y,i.resolve(D,d[`${y}Dir`]??(y==="composables"?"functions":y))]));o.push({root:l,configFile:t,resources:L});let u={...d};if(u.plugins)u.plugins=u.plugins.map((y)=>{let h=typeof y==="string"?y:y[0],S=h.startsWith(".")?i.resolve(l,h):i.isAbsolute(h)?h:Bun.resolveSync(h,l);return r.add(c.realpathSync(S)),typeof y==="string"?S:[S,y[1]]});if(typeof u.css==="string")u.css=i.resolve(l,u.css);if(u.serverApi)u.serverApi={...typeof u.serverApi==="object"?u.serverApi:{},dir:i.resolve(l,typeof u.serverApi==="object"?u.serverApi.dir??"server/api":"server/api")};if(s.push(u),d.extends!==void 0&&!Array.isArray(d.extends))throw Error(`extends in ${t} must be an array`);for(let y of d.extends??[])await g(E(y,l,r));p.pop()}await g(v(e),e);for(let t of["package.json","bun.lock","package-lock.json","pnpm-lock.yaml"]){let l=i.join(e,t);if(c.existsSync(l))r.add(c.realpathSync(l))}let f=b({},n);for(let t=s.length-1;t>=0;t--){let l=t===0?s[t]:Object.fromEntries(Object.entries(s[t]).filter(([d])=>!_.has(d)));f=b(f,l)}let m={layers:o,configDependencies:[...r].sort()};return f._layerGraph=m,f._layerPageDirs=o.map((t)=>t.resources.pages),f._layerComponentDirs=o.map((t)=>t.resources.components),f._layerLayoutDirs=o.map((t)=>t.resources.layouts),f._layerPartialDirs=o.map((t)=>t.resources.partials),f._layerComposableDirs=o.map((t)=>t.resources.composables),await $s(m,e),{config:f,graph:m}}async function $s(e,n){let r=new Map,o=[];for(let s of e.layers)for(let[a,p]of Object.entries(s.resources)){if(!c.existsSync(p))continue;let g=new Bun.Glob(a==="composables"?"**/*.ts":"**/*.stx");for(let f of[...g.scanSync({cwd:p})].sort()){let m=`${a}/${f}`,t=i.join(p,f),l=r.get(m);if(l)o.push({resource:m,winner:l,shadowed:t});else r.set(m,t)}}Object.assign(e,{overrides:o}),await Bun.write(i.join(n,".stx/layers.json"),JSON.stringify(e,null,2))}function A(e){let n=new Set(e.configDependencies);function r(o){if(!c.existsSync(o))return;n.add(o);for(let s of c.readdirSync(o,{withFileTypes:!0}).sort((a,p)=>a.name.localeCompare(p.name))){if(s.name.startsWith(".")||s.name==="node_modules")continue;let a=i.join(o,s.name);if(s.isDirectory())r(a);else if(s.isFile())n.add(a)}}for(let o of e.layers)for(let s of Object.values(o.resources))r(s);return[...n].sort()}function er(e){return O(A(e))}function tr(e){return O(e.configDependencies)}function O(e){return e.map((n)=>{try{let r=c.statSync(n);return`${n}:${r.mtimeMs}:${r.size}`}catch{return`${n}:missing`}}).join(`
4
+ `)}function Ri(e){return e.layers.map((n)=>({config:i.relative(n.root,n.configFile),files:A({layers:[n],configDependencies:e.configDependencies.filter((r)=>r.startsWith(`${n.root}${i.sep}`))}).filter((r)=>c.statSync(r).isFile()).map((r)=>({path:i.relative(n.root,r).replaceAll(i.sep,"/"),sha256:k("sha256").update(c.readFileSync(r)).digest("hex")}))}))}
5
+ export{Ti,$i,$s,er,tr,Ri};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Dr,Mr,Nr,Sa,Lr,jr,ka,Br,Fr,So,Ca}from"./chunk-knpzph55.js";export{Dr as VideoProcessorCache,So as analyzeVideo,Sa as clearVideoCache,Fr as generateDASHManifest,Br as generateHLSManifest,Lr as generatePoster,ka as generateSpriteSheet,jr as generateThumbnails,Mr as getCachedVideoResult,Ca as processVideo,Nr as setCachedVideoResult};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- var g=0;function p(){return`async-${++g}-${Date.now().toString(36)}`}function nd(e,t={},c){let o=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@error\s*([\s\S]*?)@endasync/gi,i=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@endasync/gi,n=e;return n=n.replace(o,(r,s,a,d)=>{let l=p(),y=u(s);return m(l,y,a.trim(),d.trim())}),n=n.replace(i,(r,s,a)=>{let d=p(),l=u(s);return m(d,l,a.trim(),'<div class="stx-async-error">Failed to load component</div>')}),n}function u(e){let t={component:"",timeout:30000,delay:200,suspensible:!0,retries:0},c=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,o;while((o=c.exec(e))!==null){let i=o[1],n=o[2]||o[3],r=o[4],s=o[5];switch(i){case"component":t.component=n||s||"";break;case"timeout":t.timeout=r?parseInt(r,10):30000;break;case"delay":t.delay=r?parseInt(r,10):200;break;case"suspensible":t.suspensible=s==="true";break;case"retries":t.retries=r?parseInt(r,10):0;break;case"loadingComponent":t.loadingComponent=n||s;break;case"errorComponent":t.errorComponent=n||s;break}}return t}function m(e,t,c,o){let{component:i,timeout:n,delay:r,suspensible:s,retries:a}=t;return`
2
+ var g=0;function p(){return`async-${++g}-${Date.now().toString(36)}`}function rd(e,t={},c){let o=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@error\s*([\s\S]*?)@endasync/gi,i=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@endasync/gi,n=e;return n=n.replace(o,(r,s,a,d)=>{let l=p(),y=u(s);return m(l,y,a.trim(),d.trim())}),n=n.replace(i,(r,s,a)=>{let d=p(),l=u(s);return m(d,l,a.trim(),'<div class="stx-async-error">Failed to load component</div>')}),n}function u(e){let t={component:"",timeout:30000,delay:200,suspensible:!0,retries:0},c=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,o;while((o=c.exec(e))!==null){let i=o[1],n=o[2]||o[3],r=o[4],s=o[5];switch(i){case"component":t.component=n||s||"";break;case"timeout":t.timeout=r?parseInt(r,10):30000;break;case"delay":t.delay=r?parseInt(r,10):200;break;case"suspensible":t.suspensible=s==="true";break;case"retries":t.retries=r?parseInt(r,10):0;break;case"loadingComponent":t.loadingComponent=n||s;break;case"errorComponent":t.errorComponent=n||s;break}}return t}function m(e,t,c,o){let{component:i,timeout:n,delay:r,suspensible:s,retries:a}=t;return`
3
3
  <div class="stx-async-component" data-async-id="${e}" data-component="${i}" data-status="pending">
4
4
  <div class="stx-async-loading" data-async-loading="${e}">
5
5
  ${c}
@@ -226,7 +226,7 @@ catch (error) {
226
226
  loadComponent();
227
227
  })();
228
228
  </script>
229
- `}function rd(e){return{__asyncComponent:!0,...typeof e==="function"?{loader:e}:e}}function sd(e){return typeof e==="object"&&e!==null&&"__asyncComponent"in e&&e.__asyncComponent===!0}function od(){return`
229
+ `}function sd(e){return{__asyncComponent:!0,...typeof e==="function"?{loader:e}:e}}function od(e){return typeof e==="object"&&e!==null&&"__asyncComponent"in e&&e.__asyncComponent===!0}function id(){return`
230
230
  /* STX Async Component Styles */
231
231
  .stx-async-component {
232
232
  position: relative;
@@ -300,7 +300,7 @@ catch (error) {
300
300
  background-size: 200% 100%;
301
301
  }
302
302
  }
303
- `}function id(){return`
303
+ `}function ad(){return`
304
304
  // STX Async Component Runtime
305
305
  (function() {
306
306
  if (typeof window === 'undefined') return;
@@ -355,4 +355,4 @@ catch (error) {
355
355
  console.log('[stx] Async component runtime initialized');
356
356
  })();
357
357
  `}
358
- export{nd,rd,sd,od,id};
358
+ export{rd,sd,od,id,ad};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{y}from"./chunk-7m0r2qs2.js";import{I,Ot}from"./chunk-d4ybwtqt.js";import{qo,m,h,w,qe,L,o}from"./chunk-xw8kzm6b.js";import{ce,vt,xt}from"./chunk-mm1vvk49.js";import{De,Xt,mt,U}from"./chunk-cbyh8fhn.js";import S from"path";var C=new Map,D=new Map,k=m(64),A=new Map,X=["composables","functions"];function z(t){let n=S.basename(t,".ts");return n==="index"||n==="types"||t.endsWith(".d.ts")}async function Z(t){if(t)return S.resolve(t);let n=`<default>:${process.cwd()}`,a=A.get(n);if(a!==void 0)return a;let e=await q();if(e!==null)A.set(n,e);return e}async function q(){let t=await o(),n=t.root||process.cwd(),a=t.composablesDir;if(a)return S.resolve(n,a);for(let e of X){let s=S.resolve(n,e);try{let d=new Bun.Glob("**/*.ts");for await(let c of d.scan({cwd:s,absolute:!0}))if(!z(c))return s}catch{}}return null}async function G(t){let n=Array.isArray(t)?t:t?[S.resolve(t)]:(await o())._layerComposableDirs??[await Z()].filter((e)=>!!e),a=new Map;for(let e of n){let s=new Bun.Glob("**/*.ts");try{for await(let d of s.scan({cwd:e,absolute:!0})){let c=S.relative(e,d);if(!z(d)&&!a.has(c))a.set(c,d)}}catch{}}return{key:n.join("\x00"),files:[...a.values()].sort()}}async function zr(t){let{files:n}=await G(t),a=L({loader:"ts",target:"browser",define:w()}),e=[];for(let s of n)try{let d=await Bun.file(s).text(),c=a.scan(d).exports.filter((p)=>p!=="default");if(c.length>0)e.push({file:s,names:c})}catch{}return e}function Q(t,n){return new RegExp(`\\b${n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(t)}function J(t,n){let a=new Set(t.match(/\w+/g)),e=new Set;for(let s of n)if(/^\w+$/.test(s)?a.has(s):Q(t,s))e.add(s);return e}var T=m(64);function V(t,n){let a=h(t,n.size),e=T.get(a);if(e)return e;let s;try{s=qo(t,n)}catch{s=J(t,n)}let d=[...t.matchAll(/(?:const|let|var)\s*\{([^}]*)\}\s*=\s*window\.__composables\u0008/g),...t.matchAll(/import\s*\{([^}]*)\}\s*from\s*['"]@composables['"]/g)];for(let c of d)for(let p of c[1].split(",")){let g=p.trim().split(/\s*(?::|\u0008as\u0008)\s*/)[0];if(g&&n.has(g))s.add(g)}return T.set(a,s),s}function Y(t,n,a){let e=new Map;for(let{file:u,names:l}of t)for(let f of l)if(!e.has(f))e.set(f,u);let s=(u)=>{let l=[];for(let f of J(u,e.keys()))l.push(e.get(f));return l},d=new Set(e.keys()),c=(u)=>{let l=[];for(let f of V(u,d))l.push(e.get(f));return l},p=new Set,g=a.flatMap((u,l)=>l===0?s(u):c(u));while(g.length>0){let u=[];for(let l of g){if(p.has(l))continue;p.add(l);for(let f of c(n.get(l)??""))if(!p.has(f))u.push(f)}g=u}return p}async function Fl(t,n,a){let{key:e,files:s}=await G(t);if(!e)return null;let d=()=>[...new Set([...s,...s.flatMap((r)=>ce(r))])],c=De(d());if(s.length===0)return U(C,e,c,""),null;s.sort();let p=L({loader:"ts",target:"browser",define:w()}),g=mt(D,e,c);if(!g){let r=new Map,i=[];for(let _ of s)try{let x=await Bun.file(_).text();r.set(_,x);let b=p.scan(x).exports.filter((W)=>W!=="default");if(b.length>0)i.push({file:_,names:b})}catch{r.set(_,"")}g=U(D,e,c,{codeByFile:r,modules:i})}let{codeByFile:u,modules:l}=g,f;if(n===void 0)f=new Set(s);else{let r=a?[n,...a]:[n],i=h(r.join("\x00"),e,r.length,c),_=k.get(i);if(f=_??Y(l,u,r),!_)k.set(i,f)}if(f.size===0)return null;let E=s.filter((r)=>f.has(r)),B=`${e}\x00${E.join("\x00")}`,F=mt(C,B,c);if(F!==void 0)return F||null;let M=[],v=new Set,R=new Set;for(let r of E)try{let i=u.get(r)??await Bun.file(r).text(),_=S.basename(r,".ts");for(let b of i.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(b[1])R.add(b[1]);let x=[];try{for(let b of p.scan(i).exports)if(b!=="default")v.add(b),x.push(b)}catch{}if(i=I(i),vt(i))i=await xt(i,r,{projectRoot:process.cwd(),externalizeUserModules:!1,expose:x}),i=qe(i);i=Ot(i),i=i.replace(/^export\s+(default\s+)?/gm,""),i=p.transformSync(i),M.push(`// Composable: ${_}
2
+ import{y}from"./chunk-c1ys37c9.js";import{I,Ot}from"./chunk-d4ybwtqt.js";import{Go,m,h,w,qe,L,o}from"./chunk-kz131809.js";import{ce,vt,xt}from"./chunk-tgwdk0gt.js";import{De,Xt,mt,U}from"./chunk-cbyh8fhn.js";import S from"path";var C=new Map,D=new Map,k=m(64),A=new Map,X=["composables","functions"];function z(t){let n=S.basename(t,".ts");return n==="index"||n==="types"||t.endsWith(".d.ts")}async function Z(t){if(t)return S.resolve(t);let n=`<default>:${process.cwd()}`,a=A.get(n);if(a!==void 0)return a;let e=await q();if(e!==null)A.set(n,e);return e}async function q(){let t=await o(),n=t.root||process.cwd(),a=t.composablesDir;if(a)return S.resolve(n,a);for(let e of X){let s=S.resolve(n,e);try{let d=new Bun.Glob("**/*.ts");for await(let c of d.scan({cwd:s,absolute:!0}))if(!z(c))return s}catch{}}return null}async function G(t){let n=Array.isArray(t)?t:t?[S.resolve(t)]:(await o())._layerComposableDirs??[await Z()].filter((e)=>!!e),a=new Map;for(let e of n){let s=new Bun.Glob("**/*.ts");try{for await(let d of s.scan({cwd:e,absolute:!0})){let c=S.relative(e,d);if(!z(d)&&!a.has(c))a.set(c,d)}}catch{}}return{key:n.join("\x00"),files:[...a.values()].sort()}}async function zr(t){let{files:n}=await G(t),a=L({loader:"ts",target:"browser",define:w()}),e=[];for(let s of n)try{let d=await Bun.file(s).text(),c=a.scan(d).exports.filter((p)=>p!=="default");if(c.length>0)e.push({file:s,names:c})}catch{}return e}function Q(t,n){return new RegExp(`\\b${n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(t)}function J(t,n){let a=new Set(t.match(/\w+/g)),e=new Set;for(let s of n)if(/^\w+$/.test(s)?a.has(s):Q(t,s))e.add(s);return e}var T=m(64);function V(t,n){let a=h(t,n.size),e=T.get(a);if(e)return e;let s;try{s=Go(t,n)}catch{s=J(t,n)}let d=[...t.matchAll(/(?:const|let|var)\s*\{([^}]*)\}\s*=\s*window\.__composables\u0008/g),...t.matchAll(/import\s*\{([^}]*)\}\s*from\s*['"]@composables['"]/g)];for(let c of d)for(let p of c[1].split(",")){let g=p.trim().split(/\s*(?::|\u0008as\u0008)\s*/)[0];if(g&&n.has(g))s.add(g)}return T.set(a,s),s}function Y(t,n,a){let e=new Map;for(let{file:u,names:l}of t)for(let f of l)if(!e.has(f))e.set(f,u);let s=(u)=>{let l=[];for(let f of J(u,e.keys()))l.push(e.get(f));return l},d=new Set(e.keys()),c=(u)=>{let l=[];for(let f of V(u,d))l.push(e.get(f));return l},p=new Set,g=a.flatMap((u,l)=>l===0?s(u):c(u));while(g.length>0){let u=[];for(let l of g){if(p.has(l))continue;p.add(l);for(let f of c(n.get(l)??""))if(!p.has(f))u.push(f)}g=u}return p}async function zl(t,n,a){let{key:e,files:s}=await G(t);if(!e)return null;let d=()=>[...new Set([...s,...s.flatMap((r)=>ce(r))])],c=De(d());if(s.length===0)return U(C,e,c,""),null;s.sort();let p=L({loader:"ts",target:"browser",define:w()}),g=mt(D,e,c);if(!g){let r=new Map,i=[];for(let _ of s)try{let x=await Bun.file(_).text();r.set(_,x);let b=p.scan(x).exports.filter((W)=>W!=="default");if(b.length>0)i.push({file:_,names:b})}catch{r.set(_,"")}g=U(D,e,c,{codeByFile:r,modules:i})}let{codeByFile:u,modules:l}=g,f;if(n===void 0)f=new Set(s);else{let r=a?[n,...a]:[n],i=h(r.join("\x00"),e,r.length,c),_=k.get(i);if(f=_??Y(l,u,r),!_)k.set(i,f)}if(f.size===0)return null;let E=s.filter((r)=>f.has(r)),B=`${e}\x00${E.join("\x00")}`,F=mt(C,B,c);if(F!==void 0)return F||null;let M=[],v=new Set,R=new Set;for(let r of E)try{let i=u.get(r)??await Bun.file(r).text(),_=S.basename(r,".ts");for(let b of i.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(b[1])R.add(b[1]);let x=[];try{for(let b of p.scan(i).exports)if(b!=="default")v.add(b),x.push(b)}catch{}if(i=I(i),vt(i))i=await xt(i,r,{projectRoot:process.cwd(),externalizeUserModules:!1,expose:x}),i=qe(i);i=Ot(i),i=i.replace(/^export\s+(default\s+)?/gm,""),i=p.transformSync(i),M.push(`// Composable: ${_}
3
3
  ${i.trim()}`)}catch(i){console.warn(`[stx] Failed to load composable ${r}:`,i)}if(M.length===0||v.size===0)return U(C,B,c,""),null;let K=[...v].map((r)=>` try { if (!(${JSON.stringify(r)} in __c)) __c[${JSON.stringify(r)}] = ${r}; } catch (e) {}`).join(`
4
4
  `),j=JSON.stringify([...v]),N=M.join(`
5
5
 
@@ -29,5 +29,5 @@ ${K}
29
29
  window[__n] = __c[__n];
30
30
  __published[__n] = true;
31
31
  }
32
- })();`;return c=De(d()),U(C,B,c,O),O}function zl(){C.clear(),Xt(),D.clear(),k.clear(),A.clear()}
33
- export{zr,Fl,zl};
32
+ })();`;return c=De(d()),U(C,B,c,O),O}function Hl(){C.clear(),Xt(),D.clear(),k.clear(),A.clear()}
33
+ export{zr,zl,Hl};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import s from"path";var h=new Set([".jpg",".jpeg",".png",".gif"]),d=[{ext:".avif",mime:"image/avif"},{ext:".webp",mime:"image/webp"}];async function Ha(e,r){let a=r.formats??d;if(!r.publicDir)return e;let i=y(e),o=[],m=/<img\b[^>]*?>/gi,c=[],u;while((u=m.exec(e))!==null){let t=u[0],n=t.match(/\bsrc=["']([^"']+)["']/i);if(!n)continue;if(A(u.index,i))continue;c.push({idx:u.index,length:t.length,src:n[1],raw:t})}if(c.length===0)return e;let f=await Promise.all(c.map(async(t)=>{let n=await S(t.src,r.publicDir,a);return{match:t,sources:n}}));for(let{match:t,sources:n}of f){if(n.length===0)continue;let x=`<picture>${n.map((p)=>`<source type="${p.mime}" srcset="${P(p.url)}">`).join("")}${t.raw}</picture>`;o.push({start:t.idx,end:t.idx+t.length,replacement:x})}if(o.length===0)return e;let l="",g=0;for(let t of o)l+=e.slice(g,t.start),l+=t.replacement,g=t.end;return l+=e.slice(g),l}async function S(e,r,a){if(!w(e))return[];let i=s.extname(e).toLowerCase();if(!h.has(i))return[];if(!e.startsWith("/"))return[];let o=s.join(r,e.slice(1)),m=s.dirname(o),c=s.basename(o,i),u=s.resolve(m),f=s.resolve(r);if(!u.startsWith(f))return[];let l=s.posix.dirname(e),g=a.map(async(n)=>{let b=s.join(m,`${c}${n.ext}`);if(!await Bun.file(b).exists())return null;return{url:s.posix.join(l,`${c}${n.ext}`),mime:n.mime}});return(await Promise.all(g)).filter((n)=>n!==null)}function w(e){if(!e)return!1;if(e.startsWith("http://")||e.startsWith("https://"))return!1;if(e.startsWith("//"))return!1;if(e.startsWith("data:"))return!1;return!0}function y(e){let r=[],a=/<picture\b[^>]*>[\s\S]*?<\/picture>/gi,i;while((i=a.exec(e))!==null)r.push([i.index,i.index+i[0].length]);return r}function A(e,r){for(let[a,i]of r)if(e>=a&&e<i)return!0;return!1}function P(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;")}
3
- export{Ha};
2
+ import s from"path";var h=new Set([".jpg",".jpeg",".png",".gif"]),d=[{ext:".avif",mime:"image/avif"},{ext:".webp",mime:"image/webp"}];async function Ua(e,r){let a=r.formats??d;if(!r.publicDir)return e;let i=y(e),o=[],m=/<img\b[^>]*?>/gi,c=[],u;while((u=m.exec(e))!==null){let t=u[0],n=t.match(/\bsrc=["']([^"']+)["']/i);if(!n)continue;if(A(u.index,i))continue;c.push({idx:u.index,length:t.length,src:n[1],raw:t})}if(c.length===0)return e;let f=await Promise.all(c.map(async(t)=>{let n=await S(t.src,r.publicDir,a);return{match:t,sources:n}}));for(let{match:t,sources:n}of f){if(n.length===0)continue;let x=`<picture>${n.map((p)=>`<source type="${p.mime}" srcset="${P(p.url)}">`).join("")}${t.raw}</picture>`;o.push({start:t.idx,end:t.idx+t.length,replacement:x})}if(o.length===0)return e;let l="",g=0;for(let t of o)l+=e.slice(g,t.start),l+=t.replacement,g=t.end;return l+=e.slice(g),l}async function S(e,r,a){if(!w(e))return[];let i=s.extname(e).toLowerCase();if(!h.has(i))return[];if(!e.startsWith("/"))return[];let o=s.join(r,e.slice(1)),m=s.dirname(o),c=s.basename(o,i),u=s.resolve(m),f=s.resolve(r);if(!u.startsWith(f))return[];let l=s.posix.dirname(e),g=a.map(async(n)=>{let b=s.join(m,`${c}${n.ext}`);if(!await Bun.file(b).exists())return null;return{url:s.posix.join(l,`${c}${n.ext}`),mime:n.mime}});return(await Promise.all(g)).filter((n)=>n!==null)}function w(e){if(!e)return!1;if(e.startsWith("http://")||e.startsWith("https://"))return!1;if(e.startsWith("//"))return!1;if(e.startsWith("data:"))return!1;return!0}function y(e){let r=[],a=/<picture\b[^>]*>[\s\S]*?<\/picture>/gi,i;while((i=a.exec(e))!==null)r.push([i.index,i.index+i[0].length]);return r}function A(e,r){for(let[a,i]of r)if(e>=a&&e<i)return!0;return!1}function P(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;")}
3
+ export{Ua};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Me,Jt,dd}from"./chunk-r8h9b3f8.js";import{V,Nn,Yt,Hr,Ur,Ln,ud,pd,fd,Zt,Qt,Vr,jn,gd}from"./chunk-0zq4btre.js";import"./chunk-c1ys37c9.js";export{Hr as batch,dd as default,Nn as derived,Yt as effect,Me as generateSignalsRuntime,Jt as generateSignalsRuntimeDev,Qt as isDerived,Zt as isSignal,Ln as onDestroy,Ur as onMount,jn as peek,fd as pendingLifecycleCounts,pd as runDestroyCallbacks,ud as runMountCallbacks,V as state,Vr as untrack,gd as useOptimistic};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{js,uu,pu,Ni,me,Vc,cr,fu,gu,mu,hu,yu,bu,wu,vu,xu}from"./chunk-wemq37qe.js";import"./chunk-j3vwyzvb.js";export{bu as applyHead,fu as definePageMeta,js as getHead,uu as getPageMeta,me as mergeHeadConfigs,wu as processHeadDirective,xu as processMetaDirective,vu as processTitleDirective,yu as renderBodyAttrs,mu as renderHead,hu as renderHtmlAttrs,pu as resetHead,cr as seoMetaToHeadConfig,Ni as useHead,gu as usePageTitle,Vc as useSeoMeta,gu as useTitle};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{K,n}from"./chunk-xw8kzm6b.js";import p from"fs";import g from"path";import*as y from"readline";var e={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},u={help:{description:"Show available commands",usage:"help [command]",handler:async(t,o)=>{if(t[0]&&u[t[0]]){let r=u[t[0]];console.log(`
2
+ import{K,n}from"./chunk-kz131809.js";import p from"fs";import g from"path";import*as y from"readline";var e={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},u={help:{description:"Show available commands",usage:"help [command]",handler:async(t,o)=>{if(t[0]&&u[t[0]]){let r=u[t[0]];console.log(`
3
3
  ${e.bold}${t[0]}${e.reset} - ${r.description}`),console.log(` Usage: ${e.cyan}${r.usage}${e.reset}
4
4
  `)}else{console.log(`
5
5
  ${e.bold}Available Commands:${e.reset}
@@ -16,9 +16,9 @@ ${e.bold}Markdown:${e.reset}`),a.forEach((i)=>console.log(` ${e.blue}${i}${e.re
16
16
  ${e.bold}Other:${e.reset}`),d.forEach((i)=>console.log(` ${e.dim}${i}${e.reset}`));console.log()}},cat:{description:"Show file contents",usage:"cat <file>",handler:async(t,o)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a file${e.reset}`);return}let r=g.resolve(o.cwd,t[0]);if(!await Bun.file(r).exists()){console.log(`${e.red}Error: File not found: ${r}${e.reset}`);return}let l=(await Bun.file(r).text()).split(`
17
17
  `);console.log(),l.forEach((c,a)=>{let d=String(a+1).padStart(3," ");console.log(`${e.dim}${d}${e.reset} ${c}`)}),console.log()}},load:{description:"Load context from JSON file",usage:"load <file.json>",handler:async(t,o)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a JSON file${e.reset}`);return}let r=g.resolve(o.cwd,t[0]);if(!await Bun.file(r).exists()){console.log(`${e.red}Error: File not found: ${r}${e.reset}`);return}try{let s=await Bun.file(r).text(),l=JSON.parse(s);o.context={...o.context,...l},console.log(`${e.green}\u2713${e.reset} Loaded ${Object.keys(l).length} variables from ${t[0]}`)}catch(s){console.log(`${e.red}Error parsing JSON:${e.reset}`,s)}}},save:{description:"Save context to JSON file",usage:"save <file.json>",handler:async(t,o)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a file name${e.reset}`);return}let r=g.resolve(o.cwd,t[0]);try{await Bun.write(r,JSON.stringify(o.context,null,2)),console.log(`${e.green}\u2713${e.reset} Context saved to ${t[0]}`)}catch(s){console.log(`${e.red}Error saving file:${e.reset}`,s)}}},history:{description:"Show command history",usage:"history [count]",handler:async(t,o)=>{let r=t[0]?Number.parseInt(t[0],10):20,s=o.history.slice(-r);if(s.length===0){console.log(`${e.dim}No history${e.reset}`);return}console.log(),s.forEach((l,c)=>{let a=String(o.history.length-s.length+c+1).padStart(3," ");console.log(`${e.dim}${a}${e.reset} ${l}`)}),console.log()}},exit:{description:"Exit interactive mode",usage:"exit",handler:async(t,o)=>{o.running=!1,console.log(`
18
18
  ${e.dim}Goodbye!${e.reset}
19
- `)}},quit:{description:"Exit interactive mode (alias for exit)",usage:"quit",handler:async(t,o)=>u.exit.handler(t,o)}};function h(t,o){let r=t.split(" "),s=r[0];if(r.length===1)return Object.keys(u).filter((l)=>l.startsWith(s));if(["render","cat","load","cd"].includes(s)){let l=r.slice(1).join(" "),c=g.dirname(l)||".",a=g.basename(l),d=g.resolve(o.cwd,c);if(p.existsSync(d)&&p.statSync(d).isDirectory())try{return p.readdirSync(d).filter((f)=>f.startsWith(a)).map((f)=>`${s} ${c==="."?"":`${c}/`}${f}`)}catch{return[]}}if(["unset","eval","set"].includes(s)){let l=r[1]||"";return Object.keys(o.context).filter((c)=>c.startsWith(l)).map((c)=>`${s} ${c}`)}return[]}async function rl(t={}){let o={context:t.context||{},cwd:t.cwd||process.cwd(),history:[],running:!0,lastResult:null},r=y.createInterface({input:process.stdin,output:process.stdout,completer:(l)=>[h(l,o),l],historySize:t.maxHistory||100});console.log(`
19
+ `)}},quit:{description:"Exit interactive mode (alias for exit)",usage:"quit",handler:async(t,o)=>u.exit.handler(t,o)}};function h(t,o){let r=t.split(" "),s=r[0];if(r.length===1)return Object.keys(u).filter((l)=>l.startsWith(s));if(["render","cat","load","cd"].includes(s)){let l=r.slice(1).join(" "),c=g.dirname(l)||".",a=g.basename(l),d=g.resolve(o.cwd,c);if(p.existsSync(d)&&p.statSync(d).isDirectory())try{return p.readdirSync(d).filter((f)=>f.startsWith(a)).map((f)=>`${s} ${c==="."?"":`${c}/`}${f}`)}catch{return[]}}if(["unset","eval","set"].includes(s)){let l=r[1]||"";return Object.keys(o.context).filter((c)=>c.startsWith(l)).map((c)=>`${s} ${c}`)}return[]}async function sl(t={}){let o={context:t.context||{},cwd:t.cwd||process.cwd(),history:[],running:!0,lastResult:null},r=y.createInterface({input:process.stdin,output:process.stdout,completer:(l)=>[h(l,o),l],historySize:t.maxHistory||100});console.log(`
20
20
  ${e.bold}${e.blue}stx Interactive Mode${e.reset}
21
21
  ${e.dim}Type 'help' for available commands, 'exit' to quit${e.reset}
22
22
  `);let s=()=>{let l=o.cwd.replace(process.env.HOME||"","~");r.question(`${e.cyan}stx${e.reset} ${e.dim}${l}${e.reset} ${e.green}>${e.reset} `,async(c)=>{let a=c.trim();if(!a){if(o.running)s();return}o.history.push(a);let d=a.match(/(?:[^\s"]|"[^"]*")+/g)||[],i=d[0]?.toLowerCase(),f=d.slice(1).map((m)=>m.replace(/^"|"$/g,""));if(i&&u[i])try{await u[i].handler(f,o)}catch(m){console.log(`${e.red}Error:${e.reset}`,m)}else if(i)if(a.includes("{{")||a.includes("}}"))try{let m=await K(a,o.context,"eval");console.log(`${e.green}\u2192${e.reset} ${m}`)}catch{console.log(`${e.red}Unknown command: ${i}${e.reset}`),console.log(`${e.dim}Type 'help' for available commands${e.reset}`)}else console.log(`${e.red}Unknown command: ${i}${e.reset}`),console.log(`${e.dim}Type 'help' for available commands${e.reset}`);if(o.running)s();else r.close()})};r.on("SIGINT",()=>{console.log(`
23
23
  ${e.dim}(Use 'exit' to quit)${e.reset}`),s()}),s()}
24
- export{rl};
24
+ export{sl};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import u from"fs";import l from"path";var m=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^<>()]*>)?\s*\(/,g=/(?:^|\n)\s*(?:import|export)\s+(?:[^'"]*?\sfrom\s+)?['"](\.[^'"]*)['"]/g,b=["",".ts",".tsx",".js",".jsx",".mts",".mjs","/index.ts","/index.js"],x=3;function h(e,t){let r=l.resolve(l.dirname(t),e);for(let o of b){let s=r+o;try{if(u.statSync(s).isFile())return s}catch{}}return null}function kn(e,t,r=0,o=new Set){if(!t||r>=x)return!1;for(let s of e.matchAll(g)){let n=h(s[1],t);if(!n||o.has(n))continue;o.add(n);let i;try{i=u.readFileSync(n,"utf8")}catch{continue}if(m.test(i))return!0;if(kn(i,n,r+1,o))return!0}return!1}var y=["batch","cachedQuery","clearServerData","computed","configureFetch","defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","defineStore","derived","effect","flushKeptState","forgetKeptState","goBack","goForward","inject","invalidateRoute","isDerived","isSignal","keptState","navigate","nextTick","onBeforeMount","onBeforeUnmount","onDestroy","onMount","onMounted","onUnmounted","peek","provide","reactive","ref","refDebounced","refresh","registerStoresClient","setKeptScope","setRouteParams","state","untrack","useAsync","useClickOutside","useColorMode","useCookie","useCounter","useDark","useDebounce","useDebounceFn","useDebouncedValue","useDocumentVisibility","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","useModel","useMutation","useOptimistic","usePreferredContrast","usePreferredDark","usePreferredLight","usePreferredReducedMotion","useQuery","useReactiveProp","useRef","useRoute","useRouteParam","useRouteParams","useScrollLock","useSearchParams","useSeoMeta","useSessionStorage","useSlots","useStore","useThrottle","useThrottleFn","useTimeout","useTimeoutFn","useToggle","useWebSocket","watch","watchEffect","watchMultiple","withDefaults"],Li=["onMount","onDestroy"];function Dt(e="const",t=[],r){let o=t.length?y.filter((s)=>!t.includes(s)):y;if(r!==void 0)o=o.filter((s)=>{let n=s.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(^|[^\\w$])${n}(?![\\w$])`).test(r)});return`${e} { ${o.join(", ")} } = window.stx;`}var E=["defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","withDefaults"];var S=y.filter((e)=>!E.includes(e));function Fs(e){if(!e)return!1;return S.some((t)=>new RegExp(`\\b${t}\\s*(?:<[^>]*>)?\\s*\\(`).test(e))}var v=[/@if\s*=/,/@for\s*=/,/@show\s*=/,/@model\s*=/,/@bind:/,/@class\s*=/,/@style\s*=/,/\bx-data\s*=/,/\bstate\s*(?:<[^>]*>)?\s*\(/,/\bderived\s*(?:<[^>]*>)?\s*\(/,/\beffect\s*(?:<[^>]*>)?\s*\(/,/\bref\s*(?:<[^>]*>)?\s*\(/,/\bcomputed\s*(?:<[^>]*>)?\s*\(/,/\breactive\s*(?:<[^>]*>)?\s*\(/,/\bwatch\s*(?:<[^>]*>)?\s*\(/,/\bwatchEffect\s*(?:<[^>]*>)?\s*\(/,/\s:[a-z][\w-]*\s*=\s*["']/i,/\s:(?:if|else-if|else|for|show|text|html|model)\s*=/,/data-stx(?:-auto)?(?![-\w])/,/data-stx-scoped/],T=/\s@[a-z][\w.:-]*\s*=/i;function ji(e,t){if(!e)return!1;let r=f(e);return d(r,t)}function d(e,t){if(v.some((r)=>r.test(e)))return!0;if(Fs(e))return!0;return R(e,t)}function R(e,t){if(!t)return!1;for(let r of e.matchAll(/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script\s*>/gi))if(kn(r[1],t))return!0;return!1}function Bi(e,t){if(!e)return!1;let r=f(e);return T.test(r)||d(r,t)}var _=["if","else-if","elseif","else","for","show","key","text","html","model","ref"];function Fi(e){return _.includes(e.toLowerCase())}var pr=["x-text","x-html","x-model","x-show","x-if","x-for","x-cloak","x-ref","x-data","x-bind","x-class","x-style","x-tooltip","x-tooltip-position"],w=["x-init","x-transition","x-effect","x-on"],zi=[...pr,...w];function Hi(){return`{${pr.map((e)=>`'${e}':1`).join(",")}}`}var zs=["class","style","text","html","show","model","if","ref"];function Ui(){return`{${zs.map((e)=>e==="if"?"'if':1":`${e}:1`).join(",")}}`}var p=["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","keydown","keyup","keypress","input","change","submit","focus","blur","scroll","resize","touchstart","touchend","touchmove","contextmenu","wheel","pointerdown","pointerup","pointermove"];function Vi(){return`/^(${p.join("|")})(?:\\.|$)/`}function Wi(e){return p.some((t)=>e===t||e.startsWith(`${t}.`))}var A=65536,N=4,c=new Map;function f(e){if(!e)return e;if(!e.includes("<!--")&&!/<(?:pre|code)\b/i.test(e))return e;let t=e.length>=A;if(t){let s=c.get(e);if(s!==void 0)return s}let r=(s)=>s.replace(/(<[^>]*>)|([^<]+)/g,(n,i,a)=>i??" ".repeat(a.length)),o=e.replace(/(<pre\b[^>]*>)([\s\S]*?)(<\/pre>)/gi,(s,n,i,a)=>n+r(i)+a).replace(/(<code\b[^>]*>)([\s\S]*?)(<\/code>)/gi,(s,n,i,a)=>n+r(i)+a).replace(/<!--[\s\S]*?-->/g,(s)=>" ".repeat(s.length));if(t){while(c.size>=N){let s=c.keys().next();if(s.done)break;c.delete(s.value)}c.set(e,o)}return o}
3
- export{kn,y,Li,Dt,Fs,ji,Bi,Fi,pr,zi,Hi,zs,Ui,Vi,Wi};
2
+ import u from"fs";import l from"path";var m=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^<>()]*>)?\s*\(/,g=/(?:^|\n)\s*(?:import|export)\s+(?:[^'"]*?\sfrom\s+)?['"](\.[^'"]*)['"]/g,b=["",".ts",".tsx",".js",".jsx",".mts",".mjs","/index.ts","/index.js"],x=3;function h(e,t){let r=l.resolve(l.dirname(t),e);for(let o of b){let s=r+o;try{if(u.statSync(s).isFile())return s}catch{}}return null}function kn(e,t,r=0,o=new Set){if(!t||r>=x)return!1;for(let s of e.matchAll(g)){let n=h(s[1],t);if(!n||o.has(n))continue;o.add(n);let i;try{i=u.readFileSync(n,"utf8")}catch{continue}if(m.test(i))return!0;if(kn(i,n,r+1,o))return!0}return!1}var y=["batch","cachedQuery","clearServerData","computed","configureFetch","defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","defineStore","derived","effect","flushKeptState","forgetKeptState","goBack","goForward","inject","invalidateRoute","isDerived","isSignal","keptState","navigate","nextTick","onBeforeMount","onBeforeUnmount","onDestroy","onMount","onMounted","onUnmounted","peek","provide","reactive","ref","refDebounced","refresh","registerStoresClient","setKeptScope","setRouteParams","state","untrack","useAsync","useClickOutside","useColorMode","useCookie","useCounter","useDark","useDebounce","useDebounceFn","useDebouncedValue","useDocumentVisibility","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","useModel","useMutation","useOptimistic","usePreferredContrast","usePreferredDark","usePreferredLight","usePreferredReducedMotion","useQuery","useReactiveProp","useRef","useRoute","useRouteParam","useRouteParams","useScrollLock","useSearchParams","useSeoMeta","useSessionStorage","useSlots","useStore","useThrottle","useThrottleFn","useTimeout","useTimeoutFn","useToggle","useWebSocket","watch","watchEffect","watchMultiple","withDefaults"],ji=["onMount","onDestroy"];function Dt(e="const",t=[],r){let o=t.length?y.filter((s)=>!t.includes(s)):y;if(r!==void 0)o=o.filter((s)=>{let n=s.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(^|[^\\w$])${n}(?![\\w$])`).test(r)});return`${e} { ${o.join(", ")} } = window.stx;`}var E=["defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","withDefaults"];var S=y.filter((e)=>!E.includes(e));function zs(e){if(!e)return!1;return S.some((t)=>new RegExp(`\\b${t}\\s*(?:<[^>]*>)?\\s*\\(`).test(e))}var v=[/@if\s*=/,/@for\s*=/,/@show\s*=/,/@model\s*=/,/@bind:/,/@class\s*=/,/@style\s*=/,/\bx-data\s*=/,/\bstate\s*(?:<[^>]*>)?\s*\(/,/\bderived\s*(?:<[^>]*>)?\s*\(/,/\beffect\s*(?:<[^>]*>)?\s*\(/,/\bref\s*(?:<[^>]*>)?\s*\(/,/\bcomputed\s*(?:<[^>]*>)?\s*\(/,/\breactive\s*(?:<[^>]*>)?\s*\(/,/\bwatch\s*(?:<[^>]*>)?\s*\(/,/\bwatchEffect\s*(?:<[^>]*>)?\s*\(/,/\s:[a-z][\w-]*\s*=\s*["']/i,/\s:(?:if|else-if|else|for|show|text|html|model)\s*=/,/data-stx(?:-auto)?(?![-\w])/,/data-stx-scoped/],T=/\s@[a-z][\w.:-]*\s*=/i;function Bi(e,t){if(!e)return!1;let r=f(e);return d(r,t)}function d(e,t){if(v.some((r)=>r.test(e)))return!0;if(zs(e))return!0;return R(e,t)}function R(e,t){if(!t)return!1;for(let r of e.matchAll(/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script\s*>/gi))if(kn(r[1],t))return!0;return!1}function Fi(e,t){if(!e)return!1;let r=f(e);return T.test(r)||d(r,t)}var _=["if","else-if","elseif","else","for","show","key","text","html","model","ref"];function zi(e){return _.includes(e.toLowerCase())}var pr=["x-text","x-html","x-model","x-show","x-if","x-for","x-cloak","x-ref","x-data","x-bind","x-class","x-style","x-tooltip","x-tooltip-position"],w=["x-init","x-transition","x-effect","x-on"],Hi=[...pr,...w];function Ui(){return`{${pr.map((e)=>`'${e}':1`).join(",")}}`}var Hs=["class","style","text","html","show","model","if","ref"];function Vi(){return`{${Hs.map((e)=>e==="if"?"'if':1":`${e}:1`).join(",")}}`}var p=["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","keydown","keyup","keypress","input","change","submit","focus","blur","scroll","resize","touchstart","touchend","touchmove","contextmenu","wheel","pointerdown","pointerup","pointermove"];function Wi(){return`/^(${p.join("|")})(?:\\.|$)/`}function qi(e){return p.some((t)=>e===t||e.startsWith(`${t}.`))}var A=65536,N=4,c=new Map;function f(e){if(!e)return e;if(!e.includes("<!--")&&!/<(?:pre|code)\b/i.test(e))return e;let t=e.length>=A;if(t){let s=c.get(e);if(s!==void 0)return s}let r=(s)=>s.replace(/(<[^>]*>)|([^<]+)/g,(n,i,a)=>i??" ".repeat(a.length)),o=e.replace(/(<pre\b[^>]*>)([\s\S]*?)(<\/pre>)/gi,(s,n,i,a)=>n+r(i)+a).replace(/(<code\b[^>]*>)([\s\S]*?)(<\/code>)/gi,(s,n,i,a)=>n+r(i)+a).replace(/<!--[\s\S]*?-->/g,(s)=>" ".repeat(s.length));if(t){while(c.size>=N){let s=c.keys().next();if(s.done)break;c.delete(s.value)}c.set(e,o)}return o}
3
+ export{kn,y,ji,Dt,zs,Bi,Fi,zi,pr,Hi,Ui,Hs,Vi,Wi,qi};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import"./chunk-m8qgr307.js";import"./chunk-4zb2ga7p.js";import"./chunk-8afnq4qx.js";import{a}from"./chunk-203rr1c8.js";import f from"fs";import l from"path";async function d(e,t={}){let s=Date.now(),n={total:0,passed:0,failed:0,new:0,failures:[],duration:0},o=t.snapshotDir||a(e.root,"story","snapshots");await f.promises.mkdir(o,{recursive:!0});let r=e.storyFiles;if(t.filter&&t.filter.length>0)r=r.filter((i)=>t.filter.some((p)=>i.fileName.toLowerCase().includes(p.toLowerCase())));for(let i of r)await h(i,o,t,n);return n.duration=Date.now()-s,n}async function h(e,t,s,n){let o=e.story;if(!o)return;for(let r of o.variants){n.total++;let i=l.join(t,`${e.id}-${r.id}.snap`),p=g(r.source||""),c=await w(i);if(s.update||!c){let u={storyId:e.id,variantId:r.id,component:e.fileName,timestamp:Date.now(),hash:p};if(await f.promises.writeFile(i,JSON.stringify(u,null,2)),!c)n.new++;n.passed++}else try{let u=await f.promises.readFile(i,"utf-8"),m=JSON.parse(u);if(m.hash===p)n.passed++;else n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:"Snapshot mismatch",difference:y(m.hash,p)})}catch(u){n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:`Error reading snapshot: ${u}`})}}}async function x(e,t={}){return(await d(e,{...t,update:!0})).total}function g(e){let t=0;for(let s=0;s<e.length;s++){let n=e.charCodeAt(s);t=(t<<5)-t+n,t=t&t}return t.toString(16)}function y(e,t){if(e===t)return 0;let s=Math.abs(Number.parseInt(e,16)-Number.parseInt(t,16));return Math.min(s/1e6,1)}async function w(e){try{return await f.promises.access(e),!0}catch{return!1}}function F(e){let t=[];if(t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(" STX Story Visual Regression Tests"),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),e.failures.length>0){t.push(" \u274C Failures:"),t.push("");for(let s of e.failures){if(t.push(` \u2022 ${s.component} / ${s.variantId}`),t.push(` ${s.message}`),s.difference!==void 0)t.push(` Difference: ${(s.difference*100).toFixed(2)}%`);t.push("")}}if(t.push(" Summary:"),t.push(` Total: ${e.total}`),t.push(` Passed: ${e.passed} \u2713`),t.push(` Failed: ${e.failed} \u2717`),e.new>0)t.push(` New: ${e.new} \u26A1`);return t.push(` Time: ${e.duration}ms`),t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),t.join(`
2
+ import"./chunk-j3vwyzvb.js";import"./chunk-3wcwtqx1.js";import"./chunk-gwabvrc3.js";import{a}from"./chunk-3m01ym55.js";import f from"fs";import l from"path";async function d(e,t={}){let s=Date.now(),n={total:0,passed:0,failed:0,new:0,failures:[],duration:0},o=t.snapshotDir||a(e.root,"story","snapshots");await f.promises.mkdir(o,{recursive:!0});let r=e.storyFiles;if(t.filter&&t.filter.length>0)r=r.filter((i)=>t.filter.some((p)=>i.fileName.toLowerCase().includes(p.toLowerCase())));for(let i of r)await h(i,o,t,n);return n.duration=Date.now()-s,n}async function h(e,t,s,n){let o=e.story;if(!o)return;for(let r of o.variants){n.total++;let i=l.join(t,`${e.id}-${r.id}.snap`),p=g(r.source||""),c=await w(i);if(s.update||!c){let u={storyId:e.id,variantId:r.id,component:e.fileName,timestamp:Date.now(),hash:p};if(await f.promises.writeFile(i,JSON.stringify(u,null,2)),!c)n.new++;n.passed++}else try{let u=await f.promises.readFile(i,"utf-8"),m=JSON.parse(u);if(m.hash===p)n.passed++;else n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:"Snapshot mismatch",difference:y(m.hash,p)})}catch(u){n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:`Error reading snapshot: ${u}`})}}}async function x(e,t={}){return(await d(e,{...t,update:!0})).total}function g(e){let t=0;for(let s=0;s<e.length;s++){let n=e.charCodeAt(s);t=(t<<5)-t+n,t=t&t}return t.toString(16)}function y(e,t){if(e===t)return 0;let s=Math.abs(Number.parseInt(e,16)-Number.parseInt(t,16));return Math.min(s/1e6,1)}async function w(e){try{return await f.promises.access(e),!0}catch{return!1}}function F(e){let t=[];if(t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(" STX Story Visual Regression Tests"),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),e.failures.length>0){t.push(" \u274C Failures:"),t.push("");for(let s of e.failures){if(t.push(` \u2022 ${s.component} / ${s.variantId}`),t.push(` ${s.message}`),s.difference!==void 0)t.push(` Difference: ${(s.difference*100).toFixed(2)}%`);t.push("")}}if(t.push(" Summary:"),t.push(` Total: ${e.total}`),t.push(` Passed: ${e.passed} \u2713`),t.push(` Failed: ${e.failed} \u2717`),e.new>0)t.push(` New: ${e.new} \u26A1`);return t.push(` Time: ${e.duration}ms`),t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),t.join(`
3
3
  `)}export{F as formatTestResults,d as runVisualTests,x as updateSnapshots};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{qs}from"./chunk-tdv9np5t.js";export{qs as warnUnbalancedTags};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Le}from"./chunk-9ya4tdpz.js";function Bn(e){let n=e.pwa;if(!n?.enabled)return"";let r=n.manifest,t=n.icons?.outputDir?`/${n.icons.outputDir}`:"/pwa-icons",o=Le(e),i=`
2
+ import{Le}from"./chunk-wjazf68a.js";function Bn(e){let n=e.pwa;if(!n?.enabled)return"";let r=n.manifest,t=n.icons?.outputDir?`/${n.icons.outputDir}`:"/pwa-icons",o=Le(e),i=`
3
3
  <!-- stx PWA Meta Tags -->
4
4
  <link rel="manifest" href="/manifest.json">
5
5
  <meta name="theme-color" content="${a(r?.themeColor||"#000000")}">
@@ -45,7 +45,7 @@ if ('serviceWorker' in navigator) {
45
45
  </script>
46
46
  <!-- End stx PWA -->`,i}function Gr(e,n){let r=n.pwa;if(!r?.enabled||r.autoInject===!1)return e;if(e.includes("<!-- stx PWA Meta Tags -->"))return e;if(!e.includes("</head>")){let o=e.lastIndexOf("</body>");if(o!==-1){let i=Bn(n);return e.slice(0,o)+i+`
47
47
  `+e.slice(o)}return e+Bn(n)}let t=Bn(n);return e.replace("</head>",`${t}
48
- </head>`)}function Ka(e){if(!e.pwa?.enabled)return"";return`<script>
48
+ </head>`)}function Xa(e){if(!e.pwa?.enabled)return"";return`<script>
49
49
  if ('serviceWorker' in navigator) {
50
50
  window.addEventListener('load', function() {
51
51
  navigator.serviceWorker.register('/${Le(e)}')
@@ -57,5 +57,5 @@ if ('serviceWorker' in navigator) {
57
57
  });
58
58
  });
59
59
  }
60
- </script>`}function Xa(){return'<link rel="manifest" href="/manifest.json">'}function Ja(e){return`<meta name="theme-color" content="${a(e)}">`}function a(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}
61
- export{Bn,Gr,Ka,Xa,Ja};
60
+ </script>`}function Ja(){return'<link rel="manifest" href="/manifest.json">'}function Ya(e){return`<meta name="theme-color" content="${a(e)}">`}function a(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}
61
+ export{Bn,Gr,Xa,Ja,Ya};
@@ -1,7 +1,7 @@
1
1
  // @bun
2
- import{At,C}from"./chunk-ghnkphy4.js";import m from"fs";import e from"path";async function fn(r,o,i){if(r.__stx_runtime_config)return;let n=At();if(n||i){r.__stx_runtime_config=n??C(i);return}let t=e.dirname(e.resolve(o));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((f)=>m.existsSync(e.join(t,f)))){let{loadStxConfig:f}=await import("./chunk-n2g9mj2h.js"),c=await f(t);if(c.runtimeConfig)r.__stx_runtime_config=C(c.runtimeConfig);return}let s=e.dirname(t);if(s===t)return;t=s}}async function $s(r,o){function i(n){if(n===null)return"null";if(Array.isArray(n))return`Array<${n.length?[...new Set(n.map(i))].join(" | "):"unknown"}>`;if(typeof n==="object")return`{ ${Object.entries(n).map(([t,s])=>`readonly ${JSON.stringify(t)}: ${i(s)}`).join("; ")} }`;return typeof n}await Bun.write(e.join(r,".stx/runtime-config.d.ts"),`import '@stacksjs/stx/runtime-config'
2
+ import{At,C}from"./chunk-ebg20d8s.js";import m from"fs";import e from"path";async function fn(r,o,i){if(r.__stx_runtime_config)return;let n=At();if(n||i){r.__stx_runtime_config=n??C(i);return}let t=e.dirname(e.resolve(o));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((f)=>m.existsSync(e.join(t,f)))){let{loadStxConfig:f}=await import("./chunk-ya39wk58.js"),c=await f(t);if(c.runtimeConfig)r.__stx_runtime_config=C(c.runtimeConfig);return}let s=e.dirname(t);if(s===t)return;t=s}}async function Rs(r,o){function i(n){if(n===null)return"null";if(Array.isArray(n))return`Array<${n.length?[...new Set(n.map(i))].join(" | "):"unknown"}>`;if(typeof n==="object")return`{ ${Object.entries(n).map(([t,s])=>`readonly ${JSON.stringify(t)}: ${i(s)}`).join("; ")} }`;return typeof n}await Bun.write(e.join(r,".stx/runtime-config.d.ts"),`import '@stacksjs/stx/runtime-config'
3
3
  declare module '@stacksjs/stx/runtime-config' { interface PublicRuntimeConfig ${i(o.public??{})} }
4
4
  `),await Bun.write(e.join(r,".stx/runtime-config-server.d.ts"),`import '@stacksjs/stx/runtime-config-server'
5
5
  declare module '@stacksjs/stx/runtime-config-server' { interface PrivateRuntimeConfig ${i(o.private??{})} }
6
6
  `)}
7
- export{fn,$s};
7
+ export{fn,Rs};