@stacksjs/stx 0.2.826 → 0.2.830

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 (237) hide show
  1. package/dist/chunk-02zvytqx.js +2 -0
  2. package/dist/{chunk-bt0amey5.js → chunk-04z1xyrb.js} +2 -2
  3. package/dist/{chunk-8ycrmsba.js → chunk-0fthaykk.js} +3 -3
  4. package/dist/chunk-0hnrc2z3.js +2 -0
  5. package/dist/chunk-0jhem1jn.js +2 -0
  6. package/dist/{chunk-f0txsdpa.js → chunk-0rvntfhj.js} +3 -3
  7. package/dist/chunk-17zrprh0.js +2 -0
  8. package/dist/chunk-1bpx9b0m.js +2 -0
  9. package/dist/{chunk-wy0gghvh.js → chunk-1vzncfka.js} +2 -2
  10. package/dist/{chunk-h864en4b.js → chunk-267rpvw5.js} +7 -7
  11. package/dist/{chunk-2vqpz4qv.js → chunk-2qngyyaz.js} +2 -2
  12. package/dist/{chunk-7yb82rm6.js → chunk-2x9zhezb.js} +2 -2
  13. package/dist/{chunk-981z8va1.js → chunk-3p7r3ajd.js} +2 -2
  14. package/dist/chunk-42c92rp3.js +2 -0
  15. package/dist/{chunk-vwtejkb5.js → chunk-47rbtjp1.js} +50 -50
  16. package/dist/chunk-48jzgbbs.js +2 -0
  17. package/dist/chunk-4a3r1kh1.js +43 -0
  18. package/dist/chunk-4hq9v6hq.js +2 -0
  19. package/dist/chunk-4z0jpzdq.js +3 -0
  20. package/dist/{chunk-6qvn1h09.js → chunk-5201w0f1.js} +3 -3
  21. package/dist/{chunk-21syn2j5.js → chunk-54anhwg5.js} +2 -2
  22. package/dist/chunk-5nwmwmjg.js +2 -0
  23. package/dist/chunk-67nq6csk.js +2 -0
  24. package/dist/chunk-6aak0b7c.js +2 -0
  25. package/dist/chunk-6fh00yz2.js +2 -0
  26. package/dist/chunk-6jpmjvbs.js +2 -0
  27. package/dist/{chunk-7sh9fa3q.js → chunk-6k26n0sj.js} +2 -2
  28. package/dist/chunk-6r4teng3.js +2 -0
  29. package/dist/{chunk-d6d2s7n6.js → chunk-6tjm38e4.js} +2 -2
  30. package/dist/{chunk-06hc6rs6.js → chunk-716jrdcg.js} +1 -1
  31. package/dist/chunk-72n804gy.js +2 -0
  32. package/dist/{chunk-3yh6y00f.js → chunk-7k9yahng.js} +6 -6
  33. package/dist/chunk-7kecdwv3.js +25 -0
  34. package/dist/{chunk-wf0n9gpj.js → chunk-7p8m82pj.js} +4 -4
  35. package/dist/{chunk-t9vwggkw.js → chunk-7zf4a66r.js} +6 -6
  36. package/dist/{chunk-x5vxkypk.js → chunk-8d7vh5kq.js} +6 -6
  37. package/dist/{chunk-e648sx8w.js → chunk-8fys3apk.js} +2 -2
  38. package/dist/chunk-8kb9t029.js +2 -0
  39. package/dist/chunk-8n8vj099.js +2 -0
  40. package/dist/{chunk-r9e0r6jx.js → chunk-8y8kgw9s.js} +3 -3
  41. package/dist/chunk-a5m09xb5.js +2 -0
  42. package/dist/{chunk-gjf8cjdt.js → chunk-ac9ncbfw.js} +3 -3
  43. package/dist/chunk-ahd8jdzx.js +2 -0
  44. package/dist/chunk-ay7ggc4k.js +2 -0
  45. package/dist/{chunk-mv3yhspn.js → chunk-b1q40vq4.js} +2 -2
  46. package/dist/{chunk-1d67wtj4.js → chunk-b5syjezp.js} +3 -3
  47. package/dist/{chunk-3axb6t08.js → chunk-b7tb00nz.js} +2 -2
  48. package/dist/chunk-bmm6vtsx.js +2 -0
  49. package/dist/{chunk-8ttmzcxb.js → chunk-c9mdvpf5.js} +29 -29
  50. package/dist/{chunk-5emrarpf.js → chunk-car6nhfe.js} +2 -2
  51. package/dist/{chunk-e4jwhmpb.js → chunk-cca18z35.js} +31 -31
  52. package/dist/{chunk-he5njpsd.js → chunk-cdm6yc10.js} +1 -1
  53. package/dist/chunk-cfrgrnej.js +2 -0
  54. package/dist/{chunk-vzbyn4nh.js → chunk-ckg6q98b.js} +5 -5
  55. package/dist/{chunk-eycaj8mk.js → chunk-ckqgk94e.js} +2 -2
  56. package/dist/{chunk-k81trehg.js → chunk-cv1zc9dg.js} +2 -2
  57. package/dist/chunk-cw8vpk41.js +2 -0
  58. package/dist/chunk-db1c0c3c.js +2 -0
  59. package/dist/{chunk-928y0wer.js → chunk-ddxbc914.js} +105 -105
  60. package/dist/chunk-dptjfnvq.js +2 -0
  61. package/dist/chunk-e240xqcn.js +2 -0
  62. package/dist/{chunk-cxz4cdcn.js → chunk-e75dntfb.js} +2 -2
  63. package/dist/{chunk-wceg59n0.js → chunk-ekh3mxyp.js} +2 -2
  64. package/dist/{chunk-4mj9dem1.js → chunk-em8tv6nz.js} +2 -2
  65. package/dist/{chunk-7qk4exw1.js → chunk-ema1c29k.js} +2 -2
  66. package/dist/{chunk-w45njn1r.js → chunk-en0xmvkx.js} +2 -2
  67. package/dist/{chunk-z23arg8m.js → chunk-f49x34sr.js} +2 -2
  68. package/dist/{chunk-8w9spdbn.js → chunk-f6b7av6b.js} +9 -9
  69. package/dist/{chunk-8p86mpfv.js → chunk-f6wwwgsf.js} +2 -2
  70. package/dist/{chunk-9gmceny5.js → chunk-f7jgda7x.js} +5 -5
  71. package/dist/chunk-fb90n0by.js +2 -0
  72. package/dist/{chunk-b4x5ndt9.js → chunk-fwktw49p.js} +4 -4
  73. package/dist/{chunk-y2bf32vg.js → chunk-fykcqp0m.js} +10 -10
  74. package/dist/chunk-g4qzy5hv.js +2 -0
  75. package/dist/chunk-g4yyfmje.js +2 -0
  76. package/dist/{chunk-tksjakyv.js → chunk-gcf97wgx.js} +1 -1
  77. package/dist/chunk-gg48cgx3.js +2 -0
  78. package/dist/chunk-gh439e80.js +2 -0
  79. package/dist/{chunk-tgk2hcxv.js → chunk-h5pmh5h3.js} +6 -6
  80. package/dist/{chunk-076fj387.js → chunk-hd378dgy.js} +1 -1
  81. package/dist/{chunk-9kj5p5jq.js → chunk-j14fd8kd.js} +8 -8
  82. package/dist/chunk-jp6sbk05.js +2 -0
  83. package/dist/chunk-k6ye0159.js +3 -0
  84. package/dist/{chunk-sk0tmtd3.js → chunk-kny4jmyq.js} +13 -13
  85. package/dist/chunk-kshem79d.js +2 -0
  86. package/dist/chunk-m3tnxk01.js +2 -0
  87. package/dist/chunk-m9bbhg46.js +3 -0
  88. package/dist/chunk-m9dj8pgb.js +2 -0
  89. package/dist/{chunk-bq7cfqk3.js → chunk-mww0j2w4.js} +2 -2
  90. package/dist/{chunk-qj4r08jb.js → chunk-mxvevxb8.js} +4 -4
  91. package/dist/{chunk-btxnrqxf.js → chunk-myje6fhm.js} +5 -5
  92. package/dist/{chunk-1f7d1c0y.js → chunk-mypygxdm.js} +2 -2
  93. package/dist/{chunk-76eh43e9.js → chunk-nfpsaaqm.js} +2 -2
  94. package/dist/chunk-pe5qqem0.js +2 -0
  95. package/dist/{chunk-rptnx3s6.js → chunk-pj2t51hn.js} +29 -29
  96. package/dist/chunk-pj49gnc8.js +2 -0
  97. package/dist/{chunk-67kbsav0.js → chunk-q5pwvr98.js} +1 -1
  98. package/dist/{chunk-2nj9aewf.js → chunk-qadce16v.js} +1 -1
  99. package/dist/chunk-qg2tpvdw.js +2 -0
  100. package/dist/{chunk-d9yjpdyn.js → chunk-qkemyc40.js} +6 -6
  101. package/dist/{chunk-q7zwv88b.js → chunk-qnrgfm9v.js} +2 -2
  102. package/dist/{chunk-b64y3yh0.js → chunk-qw780t39.js} +10 -10
  103. package/dist/{chunk-0scyzg9r.js → chunk-qy6dtm1a.js} +25 -26
  104. package/dist/{chunk-cmf6ar8v.js → chunk-r14j0fx3.js} +5 -5
  105. package/dist/{chunk-p1sfwzmb.js → chunk-r4ncb4h4.js} +1 -1
  106. package/dist/chunk-rb8rdpnt.js +2 -0
  107. package/dist/chunk-rgdyf3af.js +3 -0
  108. package/dist/{chunk-xpy9yjyx.js → chunk-rkdsgfhd.js} +13 -13
  109. package/dist/{chunk-bfbh0hfn.js → chunk-rmygv0n0.js} +6 -6
  110. package/dist/{chunk-mfy2ayv0.js → chunk-ryxkgt1j.js} +3 -3
  111. package/dist/{chunk-n7arptzc.js → chunk-s53wjw7y.js} +3 -3
  112. package/dist/chunk-s5bwrq6g.js +2 -0
  113. package/dist/{chunk-p1fpferp.js → chunk-s5dhvnnd.js} +6 -6
  114. package/dist/{chunk-q45xwvf6.js → chunk-t04jw3j4.js} +3 -3
  115. package/dist/{chunk-4qhz8q0d.js → chunk-t37tszbc.js} +22 -22
  116. package/dist/chunk-t59bc7na.js +3 -0
  117. package/dist/{chunk-f05tmz4z.js → chunk-taws6jfs.js} +9 -9
  118. package/dist/{chunk-bwsz6sv4.js → chunk-tgdswtya.js} +5 -5
  119. package/dist/chunk-tx02ffyc.js +2 -0
  120. package/dist/chunk-txzap6yn.js +2 -0
  121. package/dist/chunk-v1mwhvf8.js +2 -0
  122. package/dist/chunk-v8wtfrbr.js +2 -0
  123. package/dist/chunk-vb4xzz5c.js +2 -0
  124. package/dist/chunk-vcsvhbtj.js +2 -0
  125. package/dist/{chunk-me6kgvsm.js → chunk-vpnyqf0h.js} +1 -1
  126. package/dist/{chunk-mwxbdpb1.js → chunk-vyv76w55.js} +2 -2
  127. package/dist/chunk-w39cfxa6.js +2 -0
  128. package/dist/{chunk-tjhcrj3z.js → chunk-w80efvh7.js} +11 -11
  129. package/dist/chunk-wb6w807m.js +2 -0
  130. package/dist/chunk-webf565c.js +2 -0
  131. package/dist/chunk-wpyhavjy.js +2 -0
  132. package/dist/{chunk-j3st59hv.js → chunk-wr7bmkne.js} +2 -2
  133. package/dist/chunk-wt7qhv5b.js +2 -0
  134. package/dist/{chunk-y8p85kcj.js → chunk-wvds0s9m.js} +2 -2
  135. package/dist/chunk-wxj5srvb.js +2 -0
  136. package/dist/chunk-x6nrn79w.js +2 -0
  137. package/dist/chunk-xdwnbr9b.js +4 -0
  138. package/dist/chunk-xg4ww72k.js +2 -0
  139. package/dist/chunk-xgjr0pzy.js +2 -0
  140. package/dist/{chunk-qz3fdmrc.js → chunk-xn9jg1q5.js} +3 -3
  141. package/dist/chunk-xrspzeqx.js +2 -0
  142. package/dist/chunk-y00nqtdw.js +2 -0
  143. package/dist/{chunk-cmnze7at.js → chunk-ybq56wam.js} +2 -2
  144. package/dist/{chunk-cgtpbr01.js → chunk-yex0t4q2.js} +48 -48
  145. package/dist/chunk-yng848qe.js +2 -0
  146. package/dist/{chunk-y9bj3566.js → chunk-yrw5ensv.js} +3 -3
  147. package/dist/{chunk-pvj0bpqg.js → chunk-z25w7kmr.js} +4 -4
  148. package/dist/chunk-z77hnfkb.js +2 -0
  149. package/dist/{chunk-8qy616yt.js → chunk-zcnehb8p.js} +8 -8
  150. package/dist/{chunk-x6863pzd.js → chunk-zhjr4xvv.js} +5 -5
  151. package/dist/chunk-zj50tqxf.js +2 -0
  152. package/dist/chunk-zt74q4c8.js +2 -0
  153. package/dist/chunk-zty254tw.js +2 -0
  154. package/dist/{chunk-j737tnvt.js → chunk-zvvv6x8c.js} +4 -4
  155. package/dist/{chunk-g25rz48g.js → chunk-zxs92ebc.js} +6 -6
  156. package/dist/cli.js +23 -23
  157. package/dist/client/signals-authoring-runtime.js +6 -7
  158. package/dist/craft-entry.js +2 -2
  159. package/dist/craft.js +2 -2
  160. package/dist/loops.d.ts +2 -0
  161. package/dist/loops.js +22 -3
  162. package/dist/performance-utils.d.ts +2 -0
  163. package/dist/performance-utils.js +7 -0
  164. package/dist/process.js +16 -10
  165. package/dist/pwa.js +3 -3
  166. package/dist/ssg.js +11 -11
  167. package/package.json +5 -5
  168. package/dist/chunk-09285y4b.js +0 -2
  169. package/dist/chunk-0jvrzpfs.js +0 -2
  170. package/dist/chunk-19gk9k01.js +0 -2
  171. package/dist/chunk-2c5bwrnh.js +0 -2
  172. package/dist/chunk-2fwssv2z.js +0 -2
  173. package/dist/chunk-2v3r330m.js +0 -3
  174. package/dist/chunk-2vk7dtvs.js +0 -2
  175. package/dist/chunk-30rpspzt.js +0 -43
  176. package/dist/chunk-3bf48zrh.js +0 -2
  177. package/dist/chunk-4amybnpc.js +0 -2
  178. package/dist/chunk-4zjxj8ex.js +0 -2
  179. package/dist/chunk-58e92xts.js +0 -2
  180. package/dist/chunk-6h1qa3hw.js +0 -2
  181. package/dist/chunk-7pz76f28.js +0 -2
  182. package/dist/chunk-82v1egn6.js +0 -2
  183. package/dist/chunk-897gqcby.js +0 -2
  184. package/dist/chunk-9z9c025j.js +0 -2
  185. package/dist/chunk-a8fy7jv8.js +0 -2
  186. package/dist/chunk-akj26p4b.js +0 -3
  187. package/dist/chunk-b22yj5j5.js +0 -2
  188. package/dist/chunk-brhas9mp.js +0 -3
  189. package/dist/chunk-c1e45rtv.js +0 -2
  190. package/dist/chunk-cgamtmxv.js +0 -2
  191. package/dist/chunk-d0jcw9h6.js +0 -2
  192. package/dist/chunk-erf2g5b2.js +0 -2
  193. package/dist/chunk-exke928x.js +0 -2
  194. package/dist/chunk-fwk0gjbq.js +0 -2
  195. package/dist/chunk-g4sdthck.js +0 -2
  196. package/dist/chunk-g8nqmnb7.js +0 -2
  197. package/dist/chunk-gnt36wgk.js +0 -25
  198. package/dist/chunk-h67pm636.js +0 -2
  199. package/dist/chunk-hb8jxg45.js +0 -2
  200. package/dist/chunk-hfgzqapw.js +0 -2
  201. package/dist/chunk-hhats9b3.js +0 -2
  202. package/dist/chunk-htdbm0sd.js +0 -2
  203. package/dist/chunk-j0hrk24j.js +0 -2
  204. package/dist/chunk-jjbdtj4w.js +0 -2
  205. package/dist/chunk-jzc3rw49.js +0 -2
  206. package/dist/chunk-jzgyrxye.js +0 -2
  207. package/dist/chunk-k0xdvegc.js +0 -2
  208. package/dist/chunk-kep17bvj.js +0 -2
  209. package/dist/chunk-kfn7g24h.js +0 -2
  210. package/dist/chunk-kq5k2qbz.js +0 -2
  211. package/dist/chunk-ksxtrmy2.js +0 -2
  212. package/dist/chunk-m934bzg2.js +0 -2
  213. package/dist/chunk-mfc5d181.js +0 -2
  214. package/dist/chunk-mmeck545.js +0 -2
  215. package/dist/chunk-mz6qjee1.js +0 -2
  216. package/dist/chunk-ndjmt3vg.js +0 -3
  217. package/dist/chunk-p9dma8k0.js +0 -2
  218. package/dist/chunk-pby6dxnc.js +0 -2
  219. package/dist/chunk-prt4ntb0.js +0 -2
  220. package/dist/chunk-q2ynwst2.js +0 -2
  221. package/dist/chunk-q5bct2ks.js +0 -2
  222. package/dist/chunk-qp7dajd2.js +0 -2
  223. package/dist/chunk-r2hjn9ds.js +0 -2
  224. package/dist/chunk-s2zsa16d.js +0 -2
  225. package/dist/chunk-s8b6re34.js +0 -2
  226. package/dist/chunk-sddp2398.js +0 -2
  227. package/dist/chunk-sv4emtcj.js +0 -2
  228. package/dist/chunk-tcyvwy8p.js +0 -2
  229. package/dist/chunk-tg18j1yf.js +0 -2
  230. package/dist/chunk-tj7dh2dz.js +0 -2
  231. package/dist/chunk-tsvnhc0c.js +0 -4
  232. package/dist/chunk-v2ps4gnx.js +0 -2
  233. package/dist/chunk-vafxrky2.js +0 -2
  234. package/dist/chunk-wpendr22.js +0 -3
  235. package/dist/chunk-x30gh7vt.js +0 -2
  236. package/dist/chunk-x5r1cty7.js +0 -2
  237. package/dist/chunk-zd3dsp6p.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{t,l}from"./chunk-8ttmzcxb.js";import{s,bn,h}from"./chunk-928y0wer.js";import{tt}from"./chunk-qj4r08jb.js";import{_s,Cs}from"./chunk-xpy9yjyx.js";import{Sc,Yo,Ss,ks}from"./chunk-wf0n9gpj.js";import{wc,vc}from"./chunk-1d67wtj4.js";import{xt}from"./chunk-mv3yhspn.js";import{un,$c,mr,hr}from"./chunk-brhas9mp.js";import{g}from"./chunk-0dve54ne.js";import{to}from"./chunk-1f7d1c0y.js";import Q from"fs";import j from"path";import{loadConfigWithResult as Bt}from"bunfig";var U={duration:300,delay:0,ease:"ease",direction:"both"};function it(e,r={}){let{duration:i,delay:o,ease:n,direction:c,custom:d}={...U,...r};if(e==="custom"&&d)return d;switch(e){case"fade":return`${c==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":c==="out"?"opacity: 1; animation: fadeOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"opacity: 1; transition: opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
2
+ import{t,l}from"./chunk-c9mdvpf5.js";import{s,wn,h}from"./chunk-ddxbc914.js";import{nt}from"./chunk-mxvevxb8.js";import{_s,Cs}from"./chunk-rkdsgfhd.js";import{kc,Zo,Ss,ks}from"./chunk-7p8m82pj.js";import{vc,xc}from"./chunk-b5syjezp.js";import{St}from"./chunk-b1q40vq4.js";import{dn,Rc,mr,hr}from"./chunk-k6ye0159.js";import{g}from"./chunk-0dve54ne.js";import{to}from"./chunk-mypygxdm.js";import Q from"fs";import j from"path";import{loadConfigWithResult as Bt}from"bunfig";var B={duration:300,delay:0,ease:"ease",direction:"both"};function it(e,r={}){let{duration:i,delay:o,ease:n,direction:c,custom:d}={...B,...r};if(e==="custom"&&d)return d;switch(e){case"fade":return`${c==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":c==="out"?"opacity: 1; animation: fadeOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"opacity: 1; transition: opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
3
3
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
4
4
  @keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }`;case"slide":return`${c==="in"?"transform: translateY(20px); opacity: 0; animation: slideIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":c==="out"?"transform: translateY(0); opacity: 1; animation: slideOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: translateY(0); opacity: 1; transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms), opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
5
5
  @keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@@ -232,11 +232,11 @@ else {
232
232
  }
233
233
  })();
234
234
  </script>
235
- `}var Pe={name:"transition",handler:(e,r,i,o)=>{if(r.length<1)return`<div class="stx-error">@transition directive requires at least a transition type</div>${e}`;let n=r[0],c=r.length>1?Number.parseInt(r[1],10)||U.duration:U.duration,d=r.length>2?r[2]||U.ease:U.ease,p=r.length>3?Number.parseInt(r[3],10)||U.delay:U.delay,u=r.length>4?r[4]||U.direction:U.direction,m=`stx-transition-${Math.random().toString(36).substr(2,9)}`,y=it(n,{duration:c,delay:p,ease:d,direction:u}),f="stx-transition",v="";if(n==="fade")v="stx-fade";else if(n==="slide")v="stx-slide";else if(n==="scale")v="stx-scale";else if(n==="flip")v="stx-flip";else if(n==="rotate")v="stx-rotate";return`<div id="${m}" class="${f} ${v} ${u==="out"?"stx-out":""}"
235
+ `}var Pe={name:"transition",handler:(e,r,i,o)=>{if(r.length<1)return`<div class="stx-error">@transition directive requires at least a transition type</div>${e}`;let n=r[0],c=r.length>1?Number.parseInt(r[1],10)||B.duration:B.duration,d=r.length>2?r[2]||B.ease:B.ease,p=r.length>3?Number.parseInt(r[3],10)||B.delay:B.delay,u=r.length>4?r[4]||B.direction:B.direction,m=`stx-transition-${Math.random().toString(36).substr(2,9)}`,y=it(n,{duration:c,delay:p,ease:d,direction:u}),f="stx-transition",v="";if(n==="fade")v="stx-fade";else if(n==="slide")v="stx-slide";else if(n==="scale")v="stx-scale";else if(n==="flip")v="stx-flip";else if(n==="rotate")v="stx-rotate";return`<div id="${m}" class="${f} ${v} ${u==="out"?"stx-out":""}"
236
236
  style="--stx-transition-duration: ${c}ms; --stx-transition-ease: ${d}; --stx-transition-delay: ${p}ms;">${e}</div>`},hasEndTag:!0,description:"Applies transition effects to an element"},ke={name:"scrollAnimate",handler:(e,r,i,o)=>{if(r.length<1)return`<div class="stx-error">@scrollAnimate directive requires at least an animation type</div>${e}`;let n=r[0],c=r.length>1?Number.parseInt(r[1],10)||300:300,d=r.length>2?r[2]||"ease":"ease",p=r.length>3?Number.parseFloat(r[3])||0.2:0.2,u=r.length>4?Number.parseInt(r[4],10)||0:0,m=`stx-scroll-${Math.random().toString(36).substr(2,9)}`,y=`--stx-transition-duration: ${c}ms; --stx-transition-ease: ${d}; --stx-transition-delay: ${u}ms; will-change: opacity, transform;`,f="stx-transition stx-observe stx-out";if(n==="fade")f+=" stx-fade";else if(n==="slide-up"||n==="slide")f+=" stx-from-bottom";else if(n==="slide-down")f+=" stx-from-top";else if(n==="slide-left")f+=" stx-from-right";else if(n==="slide-right")f+=" stx-from-left";else if(n==="scale")f+=" stx-scale";else if(n.includes("-"))f+=` stx-${n}`;else f+=` stx-${n}`;return`<div id="${m}" class="${f}" style="${y}" data-threshold="${p}">${e}</div>`},hasEndTag:!0,description:"Applies animations that trigger when scrolled into view"},Ae={name:"animationGroup",handler:(e,r,i,o)=>{if(r.length<2)return`<div class="stx-error">@animationGroup directive requires a group name and at least one element selector</div>${e}`;let n=r[0],c=r.slice(1).map((m)=>m.startsWith("#")||m.startsWith(".")?m:`#${m}`),d=i.staggerDelay||50,p=i.sequence||!0,u=dt(n,c,{staggerDelay:d,sequence:p});return`${e}
237
- ${u}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},_e={name:"motion",handler:(e,r,i,o)=>{let n=r.length>0?r[0].toLowerCase()==="true":!0,c=at();return`<div data-animate="${n?"auto":"true"}">${e}</div>${c}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function fc(e,r,i,o){let n=e;if(o.animation?.enabled===!1)return n;let c=i.includes("test")&&i.includes("animation");if(!ot(n)&&!c)return n;if(!n.includes('<style id="stx-animation-base">')){let p=ct();n=n.replace("</head>",`${p}
237
+ ${u}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},_e={name:"motion",handler:(e,r,i,o)=>{let n=r.length>0?r[0].toLowerCase()==="true":!0,c=at();return`<div data-animate="${n?"auto":"true"}">${e}</div>${c}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function gc(e,r,i,o){let n=e;if(o.animation?.enabled===!1)return n;let c=i.includes("test")&&i.includes("animation");if(!ot(n)&&!c)return n;if(!n.includes('<style id="stx-animation-base">')){let p=ct();n=n.replace("</head>",`${p}
238
238
  </head>`)}if(n.includes("stx-observe")){if(!n.includes("Intersection Observer for scroll animations")){let u=lt(),m=n.lastIndexOf("</body>");if(m!==-1)n=n.slice(0,m)+u+`
239
- `+n.slice(m)}}return n}async function ut(e,r,i,o){let n=r[0]?.replace(/['"]/g,"")||"main",c=tt();if(n!=="main")c=c.replace("container:'main'",`container:'${n}'`);return`<script data-stx-router>${c}</script>`}var Re={name:"stxRouter",handler:ut,hasEndTag:!1,description:"Inject the STX SPA router script for client-side navigation"};var pt={enabled:!1,trackMouse:!0,trackClicks:!0,trackScroll:!0,samplingRate:100,honorDnt:!0,batchSize:50,maxDataPoints:1000,sessionTimeout:30,persistData:!1,storagePrefix:"stx_heatmap",captureAttributes:["data-heatmap-id","data-track"],ignoreSelectors:["[data-heatmap-ignore]",".heatmap-ignore"],debugOverlay:!1};function Oe(e){let r=e.heatmap;if(!r?.enabled)return"";let i={...pt,...r};return`
239
+ `+n.slice(m)}}return n}async function ut(e,r,i,o){let n=r[0]?.replace(/['"]/g,"")||"main",c=nt();if(n!=="main")c=c.replace("container:'main'",`container:'${n}'`);return`<script data-stx-router>${c}</script>`}var Re={name:"stxRouter",handler:ut,hasEndTag:!1,description:"Inject the STX SPA router script for client-side navigation"};var pt={enabled:!1,trackMouse:!0,trackClicks:!0,trackScroll:!0,samplingRate:100,honorDnt:!0,batchSize:50,maxDataPoints:1000,sessionTimeout:30,persistData:!1,storagePrefix:"stx_heatmap",captureAttributes:["data-heatmap-id","data-track"],ignoreSelectors:["[data-heatmap-ignore]",".heatmap-ignore"],debugOverlay:!1};function Oe(e){let r=e.heatmap;if(!r?.enabled)return"";let i={...pt,...r};return`
240
240
  <!-- stx Heatmap - Privacy-Compliant Tracking -->
241
241
  <script>
242
242
  (function() {
@@ -619,8 +619,8 @@ else {
619
619
  };
620
620
  })();
621
621
  </script>
622
- `}function gc(e,r){let i=Oe(r);if(!i)return e;let o=e.lastIndexOf("</body>");if(o!==-1)return e.slice(0,o)+i+e.slice(o);return e+i}var Ee={name:"heatmap",hasEndTag:!1,description:"Inject privacy-compliant heatmap tracking script",handler:async(e,r,i,o)=>{let n=i.__stx_config||{};if(r.length>0){let c=mt(r.join(" "));n.heatmap={...n.heatmap,...c,enabled:!0}}return Oe(n)}};function mt(e){let r={},i=e.match(/(\w+)=["']?([^"'\s]+)["']?/g)||[];for(let o of i){let[n,c]=o.split("="),d=c?.replace(/["']/g,"");switch(n){case"endpoint":r.endpoint=d;break;case"samplingRate":r.samplingRate=Number.parseInt(d,10);break;case"batchSize":r.batchSize=Number.parseInt(d,10);break;case"trackMouse":r.trackMouse=d==="true";break;case"trackClicks":r.trackClicks=d==="true";break;case"trackScroll":r.trackScroll=d==="true";break;case"honorDnt":r.honorDnt=d==="true";break;case"debugOverlay":r.debugOverlay=d==="true";break}}return r}function J(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function Ie(e){let r=e.trim().toLowerCase();return!r.startsWith("javascript:")&&!r.startsWith("vbscript:")&&!r.startsWith("data:text/html")}function dr(e){let r=/^---\r?\n([\s\S]*?)\r?\n---\r?\n/,i=e.match(r);if(!i)return{data:{},content:e.trim()};let o=i[1],n=e.slice(i[0].length),c={};for(let d of o.split(`
623
- `)){let p=d.trim();if(!p||p.startsWith("#"))continue;let u=p.indexOf(":");if(u===-1)continue;let m=p.slice(0,u).trim(),y=p.slice(u+1).trim();if(typeof y==="string"){if(y.startsWith('"')&&y.endsWith('"')||y.startsWith("'")&&y.endsWith("'"))y=y.slice(1,-1);else if(y.startsWith("[")&&y.endsWith("]"))try{y=JSON.parse(y)}catch{}else if(y==="true")y=!0;else if(y==="false")y=!1;else if(/^-?\d+(?:\.\d+)?$/.test(y))y=Number(y)}c[m]=y}return{data:c,content:n.trim()}}function Qe(e,r={}){let{gfm:i=!0,breaks:o=!1}=r,n=e,c=[];if(n=n.replace(/```(\w*)\n([\s\S]*?)```/g,(y,f,v)=>{let b=c.length,x=f?` class="language-${J(f)}"`:"";return c.push(`<pre><code${x}>${J(v.trim())}</code></pre>`),`\x00CODEBLOCK${b}\x00`}),n=n.replace(/`([^`]*)`/g,(y,f)=>`<code>${J(f)}</code>`),n=n.replace(/^######\s+(.*)$/gm,"<h6>$1</h6>"),n=n.replace(/^#####\s+(.*)$/gm,"<h5>$1</h5>"),n=n.replace(/^####\s+(.*)$/gm,"<h4>$1</h4>"),n=n.replace(/^###\s+(.*)$/gm,"<h3>$1</h3>"),n=n.replace(/^##\s+(.*)$/gm,"<h2>$1</h2>"),n=n.replace(/^#\s+(.*)$/gm,"<h1>$1</h1>"),n=n.replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>"),n=n.replace(/___(.+?)___/g,"<strong><em>$1</em></strong>"),n=n.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),n=n.replace(/__(.+?)__/g,"<strong>$1</strong>"),n=n.replace(/\*(.+?)\*/g,"<em>$1</em>"),n=n.replace(/(?<![a-zA-Z0-9])_(.+?)_(?![a-zA-Z0-9])/g,"<em>$1</em>"),i)n=n.replace(/~~(.+?)~~/g,"<del>$1</del>");if(n=n.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(y,f,v)=>`<img src="${Ie(v)?J(v):""}" alt="${J(f)}" />`),n=n.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(y,f,v)=>`<a href="${Ie(v)?J(v):""}">${f}</a>`),n=n.replace(/^(?:---|\*\*\*|___)\s*$/gm,"<hr />"),n=n.replace(/^>\s+(.*)$/gm,"<blockquote>$1</blockquote>"),n=n.replace(/<\/blockquote>\n<blockquote>/g,`
622
+ `}function mc(e,r){let i=Oe(r);if(!i)return e;let o=e.lastIndexOf("</body>");if(o!==-1)return e.slice(0,o)+i+e.slice(o);return e+i}var Ee={name:"heatmap",hasEndTag:!1,description:"Inject privacy-compliant heatmap tracking script",handler:async(e,r,i,o)=>{let n=i.__stx_config||{};if(r.length>0){let c=mt(r.join(" "));n.heatmap={...n.heatmap,...c,enabled:!0}}return Oe(n)}};function mt(e){let r={},i=e.match(/(\w+)=["']?([^"'\s]+)["']?/g)||[];for(let o of i){let[n,c]=o.split("="),d=c?.replace(/["']/g,"");switch(n){case"endpoint":r.endpoint=d;break;case"samplingRate":r.samplingRate=Number.parseInt(d,10);break;case"batchSize":r.batchSize=Number.parseInt(d,10);break;case"trackMouse":r.trackMouse=d==="true";break;case"trackClicks":r.trackClicks=d==="true";break;case"trackScroll":r.trackScroll=d==="true";break;case"honorDnt":r.honorDnt=d==="true";break;case"debugOverlay":r.debugOverlay=d==="true";break}}return r}function J(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function Ie(e){let r=e.trim().toLowerCase();return!r.startsWith("javascript:")&&!r.startsWith("vbscript:")&&!r.startsWith("data:text/html")}function dr(e){let r=/^---\r?\n([\s\S]*?)\r?\n---\r?\n/,i=e.match(r);if(!i)return{data:{},content:e.trim()};let o=i[1],n=e.slice(i[0].length),c={};for(let d of o.split(`
623
+ `)){let p=d.trim();if(!p||p.startsWith("#"))continue;let u=p.indexOf(":");if(u===-1)continue;let m=p.slice(0,u).trim(),y=p.slice(u+1).trim();if(typeof y==="string"){if(y.startsWith('"')&&y.endsWith('"')||y.startsWith("'")&&y.endsWith("'"))y=y.slice(1,-1);else if(y.startsWith("[")&&y.endsWith("]"))try{y=JSON.parse(y)}catch{}else if(y==="true")y=!0;else if(y==="false")y=!1;else if(/^-?\d+(?:\.\d+)?$/.test(y))y=Number(y)}c[m]=y}return{data:c,content:n.trim()}}function et(e,r={}){let{gfm:i=!0,breaks:o=!1}=r,n=e,c=[];if(n=n.replace(/```(\w*)\n([\s\S]*?)```/g,(y,f,v)=>{let b=c.length,x=f?` class="language-${J(f)}"`:"";return c.push(`<pre><code${x}>${J(v.trim())}</code></pre>`),`\x00CODEBLOCK${b}\x00`}),n=n.replace(/`([^`]*)`/g,(y,f)=>`<code>${J(f)}</code>`),n=n.replace(/^######\s+(.*)$/gm,"<h6>$1</h6>"),n=n.replace(/^#####\s+(.*)$/gm,"<h5>$1</h5>"),n=n.replace(/^####\s+(.*)$/gm,"<h4>$1</h4>"),n=n.replace(/^###\s+(.*)$/gm,"<h3>$1</h3>"),n=n.replace(/^##\s+(.*)$/gm,"<h2>$1</h2>"),n=n.replace(/^#\s+(.*)$/gm,"<h1>$1</h1>"),n=n.replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>"),n=n.replace(/___(.+?)___/g,"<strong><em>$1</em></strong>"),n=n.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),n=n.replace(/__(.+?)__/g,"<strong>$1</strong>"),n=n.replace(/\*(.+?)\*/g,"<em>$1</em>"),n=n.replace(/(?<![a-zA-Z0-9])_(.+?)_(?![a-zA-Z0-9])/g,"<em>$1</em>"),i)n=n.replace(/~~(.+?)~~/g,"<del>$1</del>");if(n=n.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(y,f,v)=>`<img src="${Ie(v)?J(v):""}" alt="${J(f)}" />`),n=n.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(y,f,v)=>`<a href="${Ie(v)?J(v):""}">${f}</a>`),n=n.replace(/^(?:---|\*\*\*|___)\s*$/gm,"<hr />"),n=n.replace(/^>\s+(.*)$/gm,"<blockquote>$1</blockquote>"),n=n.replace(/<\/blockquote>\n<blockquote>/g,`
624
624
  `),n=n.replace(/^[*\-+]\s+(.*)$/gm,"<li data-ul>$1</li>"),n=n.replace(/(<li data-ul>.*<\/li>\n?)+/g,"<ul>$&</ul>"),n=n.replace(/<\/ul>\n<ul>/g,""),n=n.replace(/^\d+\.\s+(.*)$/gm,"<li data-ol>$1</li>"),n=n.replace(/(<li data-ol>.*<\/li>\n?)+/g,"<ol>$&</ol>"),n=n.replace(/<\/ol>\n<ol>/g,""),n=n.replace(/<li data-ul>/g,"<li>"),n=n.replace(/<li data-ol>/g,"<li>"),i)n=n.replace(/^\|(.+)\|\s*\n\|[-:\s|]+\|\s*\n((?:\|.+\|\s*\n)*)/gm,(y,f,v)=>{let x=`<tr>${f.split("|").map((S)=>S.trim()).filter(Boolean).map((S)=>`<th>${J(S)}</th>`).join("")}</tr>`,P=v.trim().split(`
625
625
  `).map((S)=>`<tr>${S.split("|").map((k)=>k.trim()).filter(Boolean).map((k)=>`<td>${J(k)}</td>`).join("")}</tr>`).join(`
626
626
  `);return`<table>
@@ -637,8 +637,8 @@ ${P}
637
637
  `:`
638
638
  `)}</p>`);if(n=p.join(`
639
639
  `),o)n=n.replace(/\n/g,`<br />
640
- `);for(let y=0;y<c.length;y++)n=n.replace(`\x00CODEBLOCK${y}\x00`,c[y]);return n=n.replace(/<p>\s*<\/p>/g,""),n.trim()}async function mc(e,r,i=""){let o=e,n=[],c=/@markdown(?:\([^)]*\))?/g,d;while((d=c.exec(e))!==null){let p=d.index,u=d[0].match(/@markdown\(([^)]*)\)/),m=u?u[1]:"",y=p+d[0].length,f=1,v=y,b=-1;while(f>0&&v<e.length){let S=e.indexOf("@markdown",v),A=e.indexOf("@endmarkdown",v);if(A===-1)break;if(S!==-1&&S<A&&S!==p){let k=e[S+9];if(k==="("||k===`
641
- `||k==="\r"||k===" "||k===void 0)f++;v=S+9}else{if(f--,f===0){b=A;break}v=A+12}}if(b===-1)continue;let x=e.slice(y,b),P=e.slice(p,b+12);n.push({fullMatch:P,options:m,content:x,index:p}),c.lastIndex=b+12}for(let{fullMatch:p,options:u,content:m,index:y}of n)try{let f={};if(u)u.split(",").forEach((x)=>{let P=x.trim();if(P)f[P]=!0});let v={gfm:f.gfm??!0,breaks:f.breaks??!1},b=Qe(m.trim(),v);o=o.split(p).join(b)}catch(f){let v=f instanceof Error?f.message:String(f),b=h("Markdown Directive",`Error processing markdown: ${v}`,i,e,y,p);o=o.split(p).join(b)}return o}async function Te(e,r,i,o){let n={gfm:!0,breaks:!1};return r.forEach((c)=>{let d=c.trim().replace(/['"]/g,"");if(d==="breaks")n.breaks=!0;if(d==="no-gfm")n.gfm=!1}),Qe(e.trim(),n)}var Z=[320,480,640,768,1024,1280,1536,1920,2560],gt=[1,1.5,2,3],te=["avif","webp","jpeg"],ft={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png",gif:"image/gif"};function me(e,r=Z,i={},o){return r.sort((n,c)=>n-c).map((n)=>`${re(e,{...i,w:n,fm:o})} ${n}w`).join(", ")}function Me(e,r,i=gt,o={},n){return i.sort((c,d)=>c-d).map((c)=>{let d=Math.round(r*c);return`${re(e,{...o,w:d,dpr:c,fm:n})} ${c}x`}).join(", ")}function ge(e,r="100vw"){if(!e||Object.keys(e).length===0)return r;let o=Object.entries(e).map(([n,c])=>{let d=/^\d+$/.test(n)?`${n}px`:n;return{bp:d,size:c,numericBp:Number.parseInt(d)||0}}).sort((n,c)=>n.numericBp-c.numericBp).map(({bp:n,size:c})=>`(max-width: ${n}) ${c}`);return o.push(r),o.join(", ")}function re(e,r={}){let i=Object.entries(r).filter(([,c])=>c!==void 0&&c!==null).map(([c,d])=>{if(Array.isArray(d))return[c,d.join(",")];return[c,String(d)]});if(i.length===0)return e;let o=i.map(([c,d])=>`${c}=${encodeURIComponent(d)}`).join("&"),n=e.includes("?")?"&":"?";return`${e}${n}${o}`}function fe(e){return ft[e]||"application/octet-stream"}var ht={strategy:"thumbhash",width:20,quality:50,blurLevel:40,transitionDuration:300,easing:"ease-out"},ye=`
640
+ `);for(let y=0;y<c.length;y++)n=n.replace(`\x00CODEBLOCK${y}\x00`,c[y]);return n=n.replace(/<p>\s*<\/p>/g,""),n.trim()}async function hc(e,r,i=""){let o=e,n=[],c=/@markdown(?:\([^)]*\))?/g,d;while((d=c.exec(e))!==null){let p=d.index,u=d[0].match(/@markdown\(([^)]*)\)/),m=u?u[1]:"",y=p+d[0].length,f=1,v=y,b=-1;while(f>0&&v<e.length){let S=e.indexOf("@markdown",v),A=e.indexOf("@endmarkdown",v);if(A===-1)break;if(S!==-1&&S<A&&S!==p){let k=e[S+9];if(k==="("||k===`
641
+ `||k==="\r"||k===" "||k===void 0)f++;v=S+9}else{if(f--,f===0){b=A;break}v=A+12}}if(b===-1)continue;let x=e.slice(y,b),P=e.slice(p,b+12);n.push({fullMatch:P,options:m,content:x,index:p}),c.lastIndex=b+12}for(let{fullMatch:p,options:u,content:m,index:y}of n)try{let f={};if(u)u.split(",").forEach((x)=>{let P=x.trim();if(P)f[P]=!0});let v={gfm:f.gfm??!0,breaks:f.breaks??!1},b=et(m.trim(),v);o=o.split(p).join(b)}catch(f){let v=f instanceof Error?f.message:String(f),b=h("Markdown Directive",`Error processing markdown: ${v}`,i,e,y,p);o=o.split(p).join(b)}return o}async function Te(e,r,i,o){let n={gfm:!0,breaks:!1};return r.forEach((c)=>{let d=c.trim().replace(/['"]/g,"");if(d==="breaks")n.breaks=!0;if(d==="no-gfm")n.gfm=!1}),et(e.trim(),n)}var Z=[320,480,640,768,1024,1280,1536,1920,2560],gt=[1,1.5,2,3],te=["avif","webp","jpeg"],ft={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png",gif:"image/gif"};function me(e,r=Z,i={},o){return r.sort((n,c)=>n-c).map((n)=>`${re(e,{...i,w:n,fm:o})} ${n}w`).join(", ")}function Me(e,r,i=gt,o={},n){return i.sort((c,d)=>c-d).map((c)=>{let d=Math.round(r*c);return`${re(e,{...o,w:d,dpr:c,fm:n})} ${c}x`}).join(", ")}function ge(e,r="100vw"){if(!e||Object.keys(e).length===0)return r;let o=Object.entries(e).map(([n,c])=>{let d=/^\d+$/.test(n)?`${n}px`:n;return{bp:d,size:c,numericBp:Number.parseInt(d)||0}}).sort((n,c)=>n.numericBp-c.numericBp).map(({bp:n,size:c})=>`(max-width: ${n}) ${c}`);return o.push(r),o.join(", ")}function re(e,r={}){let i=Object.entries(r).filter(([,c])=>c!==void 0&&c!==null).map(([c,d])=>{if(Array.isArray(d))return[c,d.join(",")];return[c,String(d)]});if(i.length===0)return e;let o=i.map(([c,d])=>`${c}=${encodeURIComponent(d)}`).join("&"),n=e.includes("?")?"&":"?";return`${e}${n}${o}`}function fe(e){return ft[e]||"application/octet-stream"}var ht={strategy:"thumbhash",width:20,quality:50,blurLevel:40,transitionDuration:300,easing:"ease-out"},ye=`
642
642
  .stx-img-placeholder {
643
643
  position: relative;
644
644
  overflow: hidden;
@@ -667,7 +667,7 @@ ${P}
667
667
  filter: blur(0);
668
668
  transform: scale(1);
669
669
  }
670
- `.trim();async function yt(){try{return await import("ts-images")}catch{return null}}async function vt(e,r={}){let i={...ht,...r},o=await yt();if(o)try{return await bt(e,i,o)}catch(n){console.warn(`[stx-media] ts-images placeholder generation failed, using fallback: ${n}`)}return wt(e,i)}async function bt(e,r,i){let{generatePlaceholder:o,generateThumbHash:n}=i,d={blur:"blur",thumbhash:"thumbhash",blurhash:"thumbhash",pixelate:"pixelate","dominant-color":"dominant-color",none:"blur"}[r.strategy]||"blur";if(r.strategy==="thumbhash")return{dataURL:(await n(e)).dataUrl,width:32,height:32,aspectRatio:1,originalWidth:0,originalHeight:0,strategy:"thumbhash"};let p=await o(e,{width:r.width,height:r.height,quality:r.quality,blurLevel:r.blurLevel,strategy:d,base64Encode:!0});return{dataURL:p.dataURL,width:p.width,height:p.height,aspectRatio:p.aspectRatio,originalWidth:p.originalWidth,originalHeight:p.originalHeight,strategy:r.strategy,dominantColor:p.dominantColor,css:p.css}}function wt(e,r){let i=r.width||20,o=r.height||i,n="#e5e7eb",c=`<svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${o}" viewBox="0 0 ${i} ${o}"><rect fill="#e5e7eb" width="${i}" height="${o}"/></svg>`;return{dataURL:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(c)}`,width:i,height:o,aspectRatio:i/o,originalWidth:0,originalHeight:0,strategy:r.strategy,dominantColor:"#e5e7eb"}}function je(e,r,i={}){let o=i.transitionDuration||300,n=i.easing||"ease-out";return`
670
+ `.trim();async function yt(){try{return await import("ts-images")}catch{return null}}async function vt(e,r={}){let i={...ht,...r},o=await yt();if(o)try{return await bt(e,i,o)}catch(n){console.warn(`[stx-media] ts-images placeholder generation failed, using fallback: ${n}`)}return xt(e,i)}async function bt(e,r,i){let{generatePlaceholder:o,generateThumbHash:n}=i,d={blur:"blur",thumbhash:"thumbhash",blurhash:"thumbhash",pixelate:"pixelate","dominant-color":"dominant-color",none:"blur"}[r.strategy]||"blur";if(r.strategy==="thumbhash")return{dataURL:(await n(e)).dataUrl,width:32,height:32,aspectRatio:1,originalWidth:0,originalHeight:0,strategy:"thumbhash"};let p=await o(e,{width:r.width,height:r.height,quality:r.quality,blurLevel:r.blurLevel,strategy:d,base64Encode:!0});return{dataURL:p.dataURL,width:p.width,height:p.height,aspectRatio:p.aspectRatio,originalWidth:p.originalWidth,originalHeight:p.originalHeight,strategy:r.strategy,dominantColor:p.dominantColor,css:p.css}}function xt(e,r){let i=r.width||20,o=r.height||i,n="#e5e7eb",c=`<svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${o}" viewBox="0 0 ${i} ${o}"><rect fill="#e5e7eb" width="${i}" height="${o}"/></svg>`;return{dataURL:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(c)}`,width:i,height:o,aspectRatio:i/o,originalWidth:0,originalHeight:0,strategy:r.strategy,dominantColor:"#e5e7eb"}}function je(e,r,i={}){let o=i.transitionDuration||300,n=i.easing||"ease-out";return`
671
671
  #${e} {
672
672
  --stx-img-transition-duration: ${o}ms;
673
673
  --stx-img-transition-easing: ${n};
@@ -684,8 +684,8 @@ ${P}
684
684
  #${e}.stx-img-loaded img {
685
685
  opacity: 1;
686
686
  }
687
- `.trim()}var he=new Map;async function Ne(e,r={}){let i=`${e}:${JSON.stringify(r)}`;if(he.has(i))return he.get(i);let o=await vt(e,r);return he.set(i,o),o}async function $t(){try{return await import("./chunk-prt4ntb0.js")}catch(e){if(!Ve)console.warn("[stx-media] Image processor not available, some features disabled:",e),Ve=!0;return null}}var Ve=!1,ve=80,le="async",ce="lazy",ze=!1;async function oe(e,r={}){let i=r,o=e;if(o.process&&!o.skipOptimization){if(i.tsImagesConfig?.enabled&&!i.isDev)return Pt(o,i)}if(i.processedResult?.processed)return we(e,i.processedResult,r);if(i.responsiveVariants)return Fe(e,i.responsiveVariants,r);let{src:n,alt:c,width:d,height:p,sizes:u,widths:m=Z,dpr:y,formats:f=te,quality:v=ve,params:b={},placeholder:x="none",placeholderOptions:P={},lazy:S=!0,priority:A=!1,loading:k=A?"eager":ce,decoding:O=le,fetchpriority:E,objectFit:w,objectPosition:C,crossorigin:D,referrerpolicy:z}=e,{class:L,style:T,id:N}=e,_=e.data||{},{isDev:V=!1,baseUrl:G=""}=r;if(V&&!r.optimize)return Dt(e);let W,R,q=N||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(x!=="none"&&!A)try{W=await Ne(n,{strategy:x,...P}),R=je(q,W,P)}catch{}let ie=y!==void 0&&d!==void 0,X;if(ie)X=Ct(e,q,W,r);else X=await St(e,q,W,r);let ee;if(A){let De=f.includes("webp")?"webp":f[0],nt=me(n,m,{...b,q:v},De),st=typeof u==="object"?ge(u):u||"100vw";ee=`<link rel="preload" as="image" imagesrcset="${nt}" imagesizes="${st}" />`}let ae=[];if(!ze&&x!=="none")ae.push(ye),ze=!0;if(R)ae.push(R);let rt=S?We(q):void 0;return{html:X,preloadLink:ee,css:ae.length>0?ae.join(`
688
- `):void 0,script:rt}}async function St(e,r,i,o){let{src:n,alt:c,width:d,height:p,sizes:u,widths:m=Z,formats:y=te,quality:f=ve,params:v={},lazy:b=!0,priority:x=!1,loading:P=x?"eager":ce,decoding:S=le,fetchpriority:A,objectFit:k,objectPosition:O,crossorigin:E,referrerpolicy:w}=e,{class:C,style:D}=e,z=e.data||{},L=typeof u==="object"?ge(u):u||"100vw",T=[];for(let V of y){let G=me(n,m,{...v,q:f},V),W=fe(V);if(b&&!x)T.push(` <source type="${W}" data-srcset="${G}" data-sizes="${L}" />`);else T.push(` <source type="${W}" srcset="${G}" sizes="${L}" />`)}let N=be({src:re(n,{...v,q:f}),alt:c,width:d,height:p,loading:x?void 0:P,decoding:S,fetchpriority:x?"high":A,objectFit:k,objectPosition:O,crossorigin:E,referrerpolicy:w,className:Le(C,i),style:xe(D,k,O,i),lazy:b&&!x,data:z}),_;if(i){let V=`background-image: url('${i.dataURL}'); background-size: cover; background-position: center;`;_=`<div id="${r}" class="stx-img-placeholder" style="${V}">
687
+ `.trim()}var he=new Map;async function Ne(e,r={}){let i=`${e}:${JSON.stringify(r)}`;if(he.has(i))return he.get(i);let o=await vt(e,r);return he.set(i,o),o}async function wt(){try{return await import("./chunk-vb4xzz5c.js")}catch(e){if(!Ve)console.warn("[stx-media] Image processor not available, some features disabled:",e),Ve=!0;return null}}var Ve=!1,ve=80,le="async",ce="lazy",ze=!1;async function oe(e,r={}){let i=r,o=e;if(o.process&&!o.skipOptimization){if(i.tsImagesConfig?.enabled&&!i.isDev)return Pt(o,i)}if(i.processedResult?.processed)return we(e,i.processedResult,r);if(i.responsiveVariants)return Fe(e,i.responsiveVariants,r);let{src:n,alt:c,width:d,height:p,sizes:u,widths:m=Z,dpr:y,formats:f=te,quality:v=ve,params:b={},placeholder:x="none",placeholderOptions:P={},lazy:S=!0,priority:A=!1,loading:k=A?"eager":ce,decoding:E=le,fetchpriority:I,objectFit:w,objectPosition:C,crossorigin:D,referrerpolicy:z}=e,{class:L,style:T,id:N}=e,_=e.data||{},{isDev:V=!1,baseUrl:G=""}=r;if(V&&!r.optimize)return Dt(e);let W,R,H=N||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(x!=="none"&&!A)try{W=await Ne(n,{strategy:x,...P}),R=je(H,W,P)}catch{}let ie=y!==void 0&&d!==void 0,X;if(ie)X=Ct(e,H,W,r);else X=await $t(e,H,W,r);let ee;if(A){let De=f.includes("webp")?"webp":f[0],rt=me(n,m,{...b,q:v},De),st=typeof u==="object"?ge(u):u||"100vw";ee=`<link rel="preload" as="image" imagesrcset="${rt}" imagesizes="${st}" />`}let ae=[];if(!ze&&x!=="none")ae.push(ye),ze=!0;if(R)ae.push(R);let tt=S?We(H):void 0;return{html:X,preloadLink:ee,css:ae.length>0?ae.join(`
688
+ `):void 0,script:tt}}async function $t(e,r,i,o){let{src:n,alt:c,width:d,height:p,sizes:u,widths:m=Z,formats:y=te,quality:f=ve,params:v={},lazy:b=!0,priority:x=!1,loading:P=x?"eager":ce,decoding:S=le,fetchpriority:A,objectFit:k,objectPosition:E,crossorigin:I,referrerpolicy:w}=e,{class:C,style:D}=e,z=e.data||{},L=typeof u==="object"?ge(u):u||"100vw",T=[];for(let V of y){let G=me(n,m,{...v,q:f},V),W=fe(V);if(b&&!x)T.push(` <source type="${W}" data-srcset="${G}" data-sizes="${L}" />`);else T.push(` <source type="${W}" srcset="${G}" sizes="${L}" />`)}let N=be({src:re(n,{...v,q:f}),alt:c,width:d,height:p,loading:x?void 0:P,decoding:S,fetchpriority:x?"high":A,objectFit:k,objectPosition:E,crossorigin:I,referrerpolicy:w,className:Le(C,i),style:xe(D,k,E,i),lazy:b&&!x,data:z}),_;if(i){let V=`background-image: url('${i.dataURL}'); background-size: cover; background-position: center;`;_=`<div id="${r}" class="stx-img-placeholder" style="${V}">
689
689
  <picture>
690
690
  ${T.join(`
691
691
  `)}
@@ -695,9 +695,9 @@ ${T.join(`
695
695
  ${T.join(`
696
696
  `)}
697
697
  <img ${N} />
698
- </picture>`;return _}function Ct(e,r,i,o){let{src:n,alt:c,width:d,height:p,dpr:u=[1,2,3],quality:m=ve,params:y={},lazy:f=!0,priority:v=!1,loading:b=v?"eager":ce,decoding:x=le,fetchpriority:P,objectFit:S,objectPosition:A,crossorigin:k,referrerpolicy:O}=e,{class:E,style:w}=e,C=e.data||{},D=typeof d==="number"?d:Number.parseInt(String(d),10),z=Me(n,D,u,{...y,q:m}),L=be({src:re(n,{...y,w:D,q:m}),alt:c,width:d,height:p,loading:v?void 0:b,decoding:x,fetchpriority:v?"high":P,objectFit:S,objectPosition:A,crossorigin:k,referrerpolicy:O,className:Le(E,i),style:xe(w,S,A,i),lazy:f&&!v,data:C}),T=f&&!v?`data-srcset="${z}"`:`srcset="${z}"`;if(i){let N=`background-image: url('${i.dataURL}'); background-size: cover; background-position: center;`;return`<div id="${r}" class="stx-img-placeholder" style="${N}">
698
+ </picture>`;return _}function Ct(e,r,i,o){let{src:n,alt:c,width:d,height:p,dpr:u=[1,2,3],quality:m=ve,params:y={},lazy:f=!0,priority:v=!1,loading:b=v?"eager":ce,decoding:x=le,fetchpriority:P,objectFit:S,objectPosition:A,crossorigin:k,referrerpolicy:E}=e,{class:I,style:w}=e,C=e.data||{},D=typeof d==="number"?d:Number.parseInt(String(d),10),z=Me(n,D,u,{...y,q:m}),L=be({src:re(n,{...y,w:D,q:m}),alt:c,width:d,height:p,loading:v?void 0:b,decoding:x,fetchpriority:v?"high":P,objectFit:S,objectPosition:A,crossorigin:k,referrerpolicy:E,className:Le(I,i),style:xe(w,S,A,i),lazy:f&&!v,data:C}),T=f&&!v?`data-srcset="${z}"`:`srcset="${z}"`;if(i){let N=`background-image: url('${i.dataURL}'); background-size: cover; background-position: center;`;return`<div id="${r}" class="stx-img-placeholder" style="${N}">
699
699
  <img ${L} ${T} />
700
- </div>`}return`<img ${r?`id="${r}" `:""}${L} ${T} />`}function Dt(e){let{src:r,alt:i,width:o,height:n,loading:c=ce,decoding:d=le,fetchpriority:p,objectFit:u,objectPosition:m,crossorigin:y,referrerpolicy:f,priority:v=!1}=e,{class:b,style:x,id:P}=e,S=e.data||{};return{html:`<img ${be({src:r,alt:i,width:o,height:n,loading:v?"eager":c,decoding:d,fetchpriority:v?"high":p,objectFit:u,objectPosition:m,crossorigin:y,referrerpolicy:f,className:b,style:xe(x,u,m),id:P,data:S})} />`}}function be(e){let r=[];if(e.lazy)r.push(`data-src="${H(e.src)}"`),r.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"');else r.push(`src="${H(e.src)}"`);if(r.push(`alt="${H(e.alt)}"`),e.width)r.push(`width="${e.width}"`);if(e.height)r.push(`height="${e.height}"`);if(e.loading)r.push(`loading="${e.loading}"`);if(e.decoding)r.push(`decoding="${e.decoding}"`);if(e.fetchpriority)r.push(`fetchpriority="${e.fetchpriority}"`);if(e.crossorigin)r.push(`crossorigin="${e.crossorigin}"`);if(e.referrerpolicy)r.push(`referrerpolicy="${e.referrerpolicy}"`);if(e.className)r.push(`class="${H(e.className)}"`);if(e.style)r.push(`style="${H(e.style)}"`);if(e.id)r.push(`id="${H(e.id)}"`);if(e.data)for(let[i,o]of Object.entries(e.data))r.push(`data-${i}="${H(o)}"`);if(e.lazy)r.push("data-stx-lazy");return r.join(" ")}function Le(e,r){let i=[];if(e)i.push(e);if(r)i.push("stx-img-blur");return i.join(" ")||""}function xe(e,r,i,o){let n=[];if(r)n.push(`object-fit: ${r}`);if(i)n.push(`object-position: ${i}`);if(o)n.push("opacity: 0; transition: opacity 300ms ease-out");if(e)n.push(e);return n.join("; ")}function H(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function We(e){return`
700
+ </div>`}return`<img ${r?`id="${r}" `:""}${L} ${T} />`}function Dt(e){let{src:r,alt:i,width:o,height:n,loading:c=ce,decoding:d=le,fetchpriority:p,objectFit:u,objectPosition:m,crossorigin:y,referrerpolicy:f,priority:v=!1}=e,{class:b,style:x,id:P}=e,S=e.data||{};return{html:`<img ${be({src:r,alt:i,width:o,height:n,loading:v?"eager":c,decoding:d,fetchpriority:v?"high":p,objectFit:u,objectPosition:m,crossorigin:y,referrerpolicy:f,className:b,style:xe(x,u,m),id:P,data:S})} />`}}function be(e){let r=[];if(e.lazy)r.push(`data-src="${U(e.src)}"`),r.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"');else r.push(`src="${U(e.src)}"`);if(r.push(`alt="${U(e.alt)}"`),e.width)r.push(`width="${e.width}"`);if(e.height)r.push(`height="${e.height}"`);if(e.loading)r.push(`loading="${e.loading}"`);if(e.decoding)r.push(`decoding="${e.decoding}"`);if(e.fetchpriority)r.push(`fetchpriority="${e.fetchpriority}"`);if(e.crossorigin)r.push(`crossorigin="${e.crossorigin}"`);if(e.referrerpolicy)r.push(`referrerpolicy="${e.referrerpolicy}"`);if(e.className)r.push(`class="${U(e.className)}"`);if(e.style)r.push(`style="${U(e.style)}"`);if(e.id)r.push(`id="${U(e.id)}"`);if(e.data)for(let[i,o]of Object.entries(e.data))r.push(`data-${i}="${U(o)}"`);if(e.lazy)r.push("data-stx-lazy");return r.join(" ")}function Le(e,r){let i=[];if(e)i.push(e);if(r)i.push("stx-img-blur");return i.join(" ")||""}function xe(e,r,i,o){let n=[];if(r)n.push(`object-fit: ${r}`);if(i)n.push(`object-position: ${i}`);if(o)n.push("opacity: 0; transition: opacity 300ms ease-out");if(e)n.push(e);return n.join("; ")}function U(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function We(e){return`
701
701
  (function() {
702
702
  const container = document.getElementById('${e}');
703
703
  if (!container) return;
@@ -734,7 +734,7 @@ ${T.join(`
734
734
 
735
735
  observer.observe(container);
736
736
  })();
737
- `.trim()}async function Pt(e,r){let i=await $t();if(!i)return oe({...e,process:!1},r);let o=r.tsImagesConfig;if(e.responsiveWidths&&e.responsiveWidths.length>0||e.widths&&e.widths.length>0||!e.width&&!e.dpr){let c=await i.generateResponsiveVariants(e.src,e,o);if(c)return Fe(e,c,r)}else{let c=await i.processImage(e.src,e,o);if(c.processed)return we(e,c,r)}return oe({...e,process:!1},r)}async function we(e,r,i){let{alt:o,width:n,height:c,lazy:d=!0,priority:p=!1,objectFit:u,objectPosition:m,crossorigin:y,referrerpolicy:f}=e,{class:v,style:b}=e,x=e.id||`stx-img-${Math.random().toString(36).slice(2,8)}`,P=e.data||{},S=r.variants||[],A=S.find((R)=>R.format==="jpeg")||S.find((R)=>R.format==="webp")||S[0],k=A?.url||e.src,O=S.filter((R)=>R.format===(A?.format||"jpeg")).map((R)=>`${R.url} ${R.width}w`).join(", "),E=new Map;for(let R of S){if(!E.has(R.format))E.set(R.format,[]);E.get(R.format).push(R)}let w=[],C=["avif","webp","jpeg","png"];for(let R of C){let q=E.get(R);if(q&&q.length>0){let ie=q.map((ee)=>`${ee.url} ${ee.width}w`).join(", "),X=fe(R);if(d&&!p)w.push(` <source type="${X}" data-srcset="${ie}" />`);else w.push(` <source type="${X}" srcset="${ie}" />`)}}let D=[];if(d&&!p){if(D.push(`data-src="${H(k)}"`),D.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"'),O)D.push(`data-srcset="${O}"`)}else if(D.push(`src="${H(k)}"`),O)D.push(`srcset="${O}"`);D.push(`alt="${H(o)}"`);let z=n||r.originalWidth,L=c||r.originalHeight;if(z)D.push(`width="${z}"`);if(L)D.push(`height="${L}"`);if(!p)D.push(`loading="${d?"lazy":"eager"}"`);if(D.push('decoding="async"'),p)D.push('fetchpriority="high"');if(y)D.push(`crossorigin="${y}"`);if(f)D.push(`referrerpolicy="${f}"`);let T=[];if(u)T.push(`object-fit: ${u}`);if(m)T.push(`object-position: ${m}`);if(r.placeholder&&d)T.push("opacity: 0; transition: opacity 300ms ease-out");if(b)T.push(b);if(T.length>0)D.push(`style="${T.join("; ")}"`);let N=[];if(v)N.push(v);if(r.placeholder)N.push("stx-img-blur");if(N.length>0)D.push(`class="${N.join(" ")}"`);if(d&&!p)D.push("data-stx-lazy");for(let[R,q]of Object.entries(P))D.push(`data-${R}="${H(q)}"`);let _;if(r.placeholder||r.dominantColor&&e.useDominantColor){let R=r.placeholder?`background-image: url('${r.placeholder}'); background-size: cover; background-position: center;`:`background-color: ${r.dominantColor};`;_=`<div id="${x}" class="stx-img-placeholder" style="${R}">
737
+ `.trim()}async function Pt(e,r){let i=await wt();if(!i)return oe({...e,process:!1},r);let o=r.tsImagesConfig;if(e.responsiveWidths&&e.responsiveWidths.length>0||e.widths&&e.widths.length>0||!e.width&&!e.dpr){let c=await i.generateResponsiveVariants(e.src,e,o);if(c)return Fe(e,c,r)}else{let c=await i.processImage(e.src,e,o);if(c.processed)return we(e,c,r)}return oe({...e,process:!1},r)}async function we(e,r,i){let{alt:o,width:n,height:c,lazy:d=!0,priority:p=!1,objectFit:u,objectPosition:m,crossorigin:y,referrerpolicy:f}=e,{class:v,style:b}=e,x=e.id||`stx-img-${Math.random().toString(36).slice(2,8)}`,P=e.data||{},S=r.variants||[],A=S.find((R)=>R.format==="jpeg")||S.find((R)=>R.format==="webp")||S[0],k=A?.url||e.src,E=S.filter((R)=>R.format===(A?.format||"jpeg")).map((R)=>`${R.url} ${R.width}w`).join(", "),I=new Map;for(let R of S){if(!I.has(R.format))I.set(R.format,[]);I.get(R.format).push(R)}let w=[],C=["avif","webp","jpeg","png"];for(let R of C){let H=I.get(R);if(H&&H.length>0){let ie=H.map((ee)=>`${ee.url} ${ee.width}w`).join(", "),X=fe(R);if(d&&!p)w.push(` <source type="${X}" data-srcset="${ie}" />`);else w.push(` <source type="${X}" srcset="${ie}" />`)}}let D=[];if(d&&!p){if(D.push(`data-src="${U(k)}"`),D.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"'),E)D.push(`data-srcset="${E}"`)}else if(D.push(`src="${U(k)}"`),E)D.push(`srcset="${E}"`);D.push(`alt="${U(o)}"`);let z=n||r.originalWidth,L=c||r.originalHeight;if(z)D.push(`width="${z}"`);if(L)D.push(`height="${L}"`);if(!p)D.push(`loading="${d?"lazy":"eager"}"`);if(D.push('decoding="async"'),p)D.push('fetchpriority="high"');if(y)D.push(`crossorigin="${y}"`);if(f)D.push(`referrerpolicy="${f}"`);let T=[];if(u)T.push(`object-fit: ${u}`);if(m)T.push(`object-position: ${m}`);if(r.placeholder&&d)T.push("opacity: 0; transition: opacity 300ms ease-out");if(b)T.push(b);if(T.length>0)D.push(`style="${T.join("; ")}"`);let N=[];if(v)N.push(v);if(r.placeholder)N.push("stx-img-blur");if(N.length>0)D.push(`class="${N.join(" ")}"`);if(d&&!p)D.push("data-stx-lazy");for(let[R,H]of Object.entries(P))D.push(`data-${R}="${U(H)}"`);let _;if(r.placeholder||r.dominantColor&&e.useDominantColor){let R=r.placeholder?`background-image: url('${r.placeholder}'); background-size: cover; background-position: center;`:`background-color: ${r.dominantColor};`;_=`<div id="${x}" class="stx-img-placeholder" style="${R}">
738
738
  <picture>
739
739
  ${w.join(`
740
740
  `)}
@@ -744,11 +744,11 @@ ${w.join(`
744
744
  ${w.join(`
745
745
  `)}
746
746
  <img ${D.join(" ")} />
747
- </picture>`;let V=[];if(r.placeholder)V.push(ye);let G=d?We(x):void 0,W;if(p&&O)W=`<link rel="preload" as="image" imagesrcset="${O}" />`;return{html:_,preloadLink:W,css:V.length>0?V.join(`
748
- `):void 0,script:G}}async function Fe(e,r,i){let o={src:r.src,processed:!0,variants:[],placeholder:r.placeholder?.dataURL,originalWidth:r.placeholder?.width,originalHeight:r.placeholder?.height};for(let[n,c]of Object.entries(r.byFormat))if(c)o.variants.push(...c);return we(e,o,i)}function kt(){return xt({name:"img",hasEndTag:!1,description:"Render an optimized responsive image with srcset and lazy loading",transform:async(e,r,i,o)=>{let{src:n,alt:c,options:d}=At(e,r,i);if(!n)return console.warn("@img directive: missing src argument"),"<!-- @img: missing src -->";let p={src:n,alt:c||"",widths:d.widths||Z,formats:d.formats||te,quality:d.quality,sizes:d.sizes,dpr:d.dpr,params:d.params,placeholder:d.placeholder,placeholderOptions:d.placeholderOptions,lazy:d.lazy!==!1,priority:d.priority||!1,loading:d.loading,decoding:d.decoding,fetchpriority:d.fetchpriority,objectFit:d.objectFit,objectPosition:d.objectPosition,class:d.class,style:d.style,id:d.id,width:d.width,height:d.height},u=i.__isDev||!1,m=await oe(p,{isDev:u}),y=m.html;if(m.preloadLink)y=m.preloadLink+`
747
+ </picture>`;let V=[];if(r.placeholder)V.push(ye);let G=d?We(x):void 0,W;if(p&&E)W=`<link rel="preload" as="image" imagesrcset="${E}" />`;return{html:_,preloadLink:W,css:V.length>0?V.join(`
748
+ `):void 0,script:G}}async function Fe(e,r,i){let o={src:r.src,processed:!0,variants:[],placeholder:r.placeholder?.dataURL,originalWidth:r.placeholder?.width,originalHeight:r.placeholder?.height};for(let[n,c]of Object.entries(r.byFormat))if(c)o.variants.push(...c);return we(e,o,i)}function kt(){return St({name:"img",hasEndTag:!1,description:"Render an optimized responsive image with srcset and lazy loading",transform:async(e,r,i,o)=>{let{src:n,alt:c,options:d}=At(e,r,i);if(!n)return console.warn("@img directive: missing src argument"),"<!-- @img: missing src -->";let p={src:n,alt:c||"",widths:d.widths||Z,formats:d.formats||te,quality:d.quality,sizes:d.sizes,dpr:d.dpr,params:d.params,placeholder:d.placeholder,placeholderOptions:d.placeholderOptions,lazy:d.lazy!==!1,priority:d.priority||!1,loading:d.loading,decoding:d.decoding,fetchpriority:d.fetchpriority,objectFit:d.objectFit,objectPosition:d.objectPosition,class:d.class,style:d.style,id:d.id,width:d.width,height:d.height},u=i.__isDev||!1,m=await oe(p,{isDev:u}),y=m.html;if(m.preloadLink)y=m.preloadLink+`
749
749
  `+y;if(m.css)y+=`
750
750
  <style>${m.css}</style>`;if(m.script)y+=`
751
- <script>${m.script}</script>`;return y},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function At(e,r,i){if(r.src)return{src:String(r.src),alt:String(r.alt||""),options:r.options||{}};let o=e.trim();if(o.startsWith("@img(")||o.startsWith("("))o=o.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let n=_t(o),c=$e(n[0],i)||"",d=$e(n[1],i)||"",p={};if(n[2]){let u=$e(n[2],i);if(typeof u==="object"&&u!==null)p=u;else if(typeof n[2]==="string")try{p=JSON.parse(n[2])}catch{}}return{src:c,alt:d,options:p}}function _t(e){let r=[],i="",o=!1,n="",c=0,d=0;for(let p=0;p<e.length;p++){let u=e[p],m=p>0?e[p-1]:"";if((u==='"'||u==="'"||u==="`")&&m!=="\\"){if(!o)o=!0,n=u;else if(u===n)o=!1,n="";else i+=u;continue}if(!o){if(u==="{")c++;if(u==="}")c--;if(u==="[")d++;if(u==="]")d--;if(u===","&&c===0&&d===0){r.push(i.trim()),i="";continue}}i+=u}if(i.trim())r.push(i.trim());return r}function $e(e,r){if(typeof e!=="string")return e;let i=e.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return i.slice(1,-1);if(!i.startsWith("/")&&!i.startsWith(".")&&!i.startsWith("http")&&!i.startsWith("{")){let o=r[i];if(o!==void 0)return o}if(i.startsWith("{")||i.startsWith("["))try{return JSON.parse(i)}catch{}return i}var qe=kt();import{existsSync as Rt}from"fs";import ne from"path";function vs(){let e=[ne.join(import.meta.dir,"primitives"),ne.join(import.meta.dir,"..","primitives"),ne.join(import.meta.dir,"native","primitives"),ne.join(import.meta.dir,"..","native","primitives")];for(let r of e)if(Rt(ne.join(r,"View.stx")))return r;return e[0]}async function Ue(){try{return await import("./chunk-hfgzqapw.js")}catch(e){if(!He)console.warn("[stx-media] Video processor not available, some features disabled:",e),He=!0;return null}}var He=!1,Be=!0,Je="metadata",Ot="https://cdn.jsdelivr.net/npm/ts-video-player@latest/dist/index.min.js";async function de(e,r={}){let i=r,o=e;if(o.process&&!o.skipProcessing){if(i.tsVideosConfig?.enabled&&!i.isDev)return jt(o,i)}if(i.processedResult?.processed)return Ge(e,i.processedResult,r);let n;if(o.generatePoster&&o.src&&!e.poster)n=await Nt(o,i);let{src:c,sources:d=[],poster:p,posterPlaceholder:u,controls:m=Be,autoplay:y=!1,muted:f=!1,loop:v=!1,preload:b=Je,playsinline:x=!0,lazy:P=!0,player:S="native",type:A,width:k,height:O,crossorigin:E,disablePictureInPicture:w=!1,disableRemotePlayback:C=!1}=e,D=n||p,{class:z,style:L}=e,T=e.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(S==="ts-video")return It(e,r);if(A&&A!=="video")return Et(c||"",A,e);let N=d.length>0?d:c?[{src:c,type:Ke(c)}]:[],_=[`id="${T}"`];if(m)_.push("controls");if(y)_.push("autoplay");if(f)_.push("muted");if(v)_.push("loop");if(x)_.push("playsinline");if(w)_.push("disablepictureinpicture");if(C)_.push("disableremoteplayback");if(E)_.push(`crossorigin="${E}"`);if(P){if(_.push(`data-preload="${b}"`),_.push('preload="none"'),D)_.push(`data-poster="${M(D)}"`);_.push("data-stx-lazy")}else if(_.push(`preload="${b}"`),D)_.push(`poster="${M(D)}"`);if(k)_.push(`width="${k}"`);if(O)_.push(`height="${O}"`);if(z)_.push(`class="${M(z)}"`);if(L)_.push(`style="${M(L)}"`);let V=N.map((R)=>` <source ${P?`data-src="${M(R.src)}"`:`src="${M(R.src)}"`} type="${R.type}"${R.media?` media="${R.media}"`:""} />`).join(`
751
+ <script>${m.script}</script>`;return y},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function At(e,r,i){if(r.src)return{src:String(r.src),alt:String(r.alt||""),options:r.options||{}};let o=e.trim();if(o.startsWith("@img(")||o.startsWith("("))o=o.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let n=_t(o),c=$e(n[0],i)||"",d=$e(n[1],i)||"",p={};if(n[2]){let u=$e(n[2],i);if(typeof u==="object"&&u!==null)p=u;else if(typeof n[2]==="string")try{p=JSON.parse(n[2])}catch{}}return{src:c,alt:d,options:p}}function _t(e){let r=[],i="",o=!1,n="",c=0,d=0;for(let p=0;p<e.length;p++){let u=e[p],m=p>0?e[p-1]:"";if((u==='"'||u==="'"||u==="`")&&m!=="\\"){if(!o)o=!0,n=u;else if(u===n)o=!1,n="";else i+=u;continue}if(!o){if(u==="{")c++;if(u==="}")c--;if(u==="[")d++;if(u==="]")d--;if(u===","&&c===0&&d===0){r.push(i.trim()),i="";continue}}i+=u}if(i.trim())r.push(i.trim());return r}function $e(e,r){if(typeof e!=="string")return e;let i=e.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return i.slice(1,-1);if(!i.startsWith("/")&&!i.startsWith(".")&&!i.startsWith("http")&&!i.startsWith("{")){let o=r[i];if(o!==void 0)return o}if(i.startsWith("{")||i.startsWith("["))try{return JSON.parse(i)}catch{}return i}var qe=kt();import{existsSync as Rt}from"fs";import ne from"path";function vs(){let e=[ne.join(import.meta.dir,"primitives"),ne.join(import.meta.dir,"..","primitives"),ne.join(import.meta.dir,"native","primitives"),ne.join(import.meta.dir,"..","native","primitives")];for(let r of e)if(Rt(ne.join(r,"View.stx")))return r;return e[0]}async function Ue(){try{return await import("./chunk-wt7qhv5b.js")}catch(e){if(!He)console.warn("[stx-media] Video processor not available, some features disabled:",e),He=!0;return null}}var He=!1,Be=!0,Je="metadata",Ot="https://cdn.jsdelivr.net/npm/ts-video-player@latest/dist/index.min.js";async function de(e,r={}){let i=r,o=e;if(o.process&&!o.skipProcessing){if(i.tsVideosConfig?.enabled&&!i.isDev)return jt(o,i)}if(i.processedResult?.processed)return Ge(e,i.processedResult,r);let n;if(o.generatePoster&&o.src&&!e.poster)n=await Nt(o,i);let{src:c,sources:d=[],poster:p,posterPlaceholder:u,controls:m=Be,autoplay:y=!1,muted:f=!1,loop:v=!1,preload:b=Je,playsinline:x=!0,lazy:P=!0,player:S="native",type:A,width:k,height:E,crossorigin:I,disablePictureInPicture:w=!1,disableRemotePlayback:C=!1}=e,D=n||p,{class:z,style:L}=e,T=e.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(S==="ts-video")return It(e,r);if(A&&A!=="video")return Et(c||"",A,e);let N=d.length>0?d:c?[{src:c,type:Ke(c)}]:[],_=[`id="${T}"`];if(m)_.push("controls");if(y)_.push("autoplay");if(f)_.push("muted");if(v)_.push("loop");if(x)_.push("playsinline");if(w)_.push("disablepictureinpicture");if(C)_.push("disableremoteplayback");if(I)_.push(`crossorigin="${I}"`);if(P){if(_.push(`data-preload="${b}"`),_.push('preload="none"'),D)_.push(`data-poster="${M(D)}"`);_.push("data-stx-lazy")}else if(_.push(`preload="${b}"`),D)_.push(`poster="${M(D)}"`);if(k)_.push(`width="${k}"`);if(E)_.push(`height="${E}"`);if(z)_.push(`class="${M(z)}"`);if(L)_.push(`style="${M(L)}"`);let V=N.map((R)=>` <source ${P?`data-src="${M(R.src)}"`:`src="${M(R.src)}"`} type="${R.type}"${R.media?` media="${R.media}"`:""} />`).join(`
752
752
  `),G=`<video ${_.join(" ")}>
753
753
  ${V}
754
754
  Your browser does not support the video tag.
@@ -789,7 +789,7 @@ ${V}
789
789
  })();
790
790
  `.trim();return{html:G,script:W}}function Et(e,r,i){let{width:o=640,height:n=360}=i,{class:c,style:d}=i,p=i.id||`stx-embed-${Math.random().toString(36).slice(2,8)}`,u,m=null;switch(r){case"youtube":m=Tt(e),u=m?`https://www.youtube-nocookie.com/embed/${m}`:e;break;case"vimeo":m=Mt(e),u=m?`https://player.vimeo.com/video/${m}`:e;break;case"dailymotion":m=e.split("/").pop()||"",u=`https://www.dailymotion.com/embed/video/${m}`;break;case"twitch":m=e.split("/").pop()||"",u=`https://player.twitch.tv/?video=${m}&parent=${typeof window<"u"?window.location.hostname:"localhost"}`;break;default:u=e}let y=[`id="${p}"`,`src="${M(u)}"`,`width="${o}"`,`height="${n}"`,'frameborder="0"',"allowfullscreen",'allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"'];if(c)y.push(`class="${M(c)}"`);if(d)y.push(`style="${M(d)}"`);if(i.lazy)y.push('loading="lazy"');return{html:`<div class="stx-video-embed" style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;">
791
791
  <iframe ${y.join(" ")} style="position:absolute;top:0;left:0;width:100%;height:100%;"></iframe>
792
- </div>`}}function It(e,r={}){let{src:i,sources:o=[],poster:n,controls:c=!0,autoplay:d=!1,muted:p=!1,loop:u=!1,preload:m="metadata",playsinline:y=!0,lazy:f=!0,width:v,height:b}=e,{class:x,style:P}=e,S=e.id||`ts-video-${Math.random().toString(36).slice(2,8)}`,A={src:o.length>0?o:i,autoplay:d,loop:u,muted:p,playsinline:y,preload:m,poster:n,controls:c,title:e.title},k=["position: relative",v?`width: ${typeof v==="number"?v+"px":v}`:"width: 100%",b?`height: ${typeof b==="number"?b+"px":b}`:"",P||""].filter(Boolean).join("; "),O=`
792
+ </div>`}}function It(e,r={}){let{src:i,sources:o=[],poster:n,controls:c=!0,autoplay:d=!1,muted:p=!1,loop:u=!1,preload:m="metadata",playsinline:y=!0,lazy:f=!0,width:v,height:b}=e,{class:x,style:P}=e,S=e.id||`ts-video-${Math.random().toString(36).slice(2,8)}`,A={src:o.length>0?o:i,autoplay:d,loop:u,muted:p,playsinline:y,preload:m,poster:n,controls:c,title:e.title},k=["position: relative",v?`width: ${typeof v==="number"?v+"px":v}`:"width: 100%",b?`height: ${typeof b==="number"?b+"px":b}`:"",P||""].filter(Boolean).join("; "),E=`
793
793
  <div
794
794
  id="${S}"
795
795
  class="ts-video-player${x?" "+M(x):""}"
@@ -810,7 +810,7 @@ ${V}
810
810
  `:""}
811
811
  </div>
812
812
  </div>
813
- `.trim(),E=`
813
+ `.trim(),I=`
814
814
  (function() {
815
815
  var container = document.getElementById('${S}');
816
816
  if (!container) return;
@@ -956,7 +956,7 @@ else {
956
956
  .ts-video-player__play-button svg {
957
957
  margin-left: 4px;
958
958
  }
959
- `.trim();return{html:O,script:E,css:w}}function Ke(e){switch(e.split(".").pop()?.toLowerCase()){case"mp4":return"video/mp4";case"webm":return"video/webm";case"ogg":case"ogv":return"video/ogg";case"mov":return"video/quicktime";case"avi":return"video/x-msvideo";case"mkv":return"video/x-matroska";case"m3u8":return"application/x-mpegURL";default:return"video/mp4"}}function Tt(e){let r=[/youtube\.com\/watch\?v=([^&]+)/,/youtube\.com\/embed\/([^?]+)/,/youtu\.be\/([^?]+)/,/youtube\.com\/v\/([^?]+)/];for(let i of r){let o=e.match(i);if(o)return o[1]}return null}function Mt(e){let r=e.match(/vimeo\.com\/(\d+)/);return r?r[1]:null}function M(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}async function jt(e,r){let i=await Ue();if(!i)return de({...e,process:!1},r);let o=r.tsVideosConfig,n=await i.processVideo(e.src,e,o,e.onProcessProgress);if(n.processed)return Ge(e,n,r);return de({...e,process:!1},r)}async function Nt(e,r){let i=await Ue();if(!i||!e.src)return;let o=typeof e.generatePoster==="object"?e.generatePoster:{timestamp:0},n=r.tsVideosConfig||{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos"};return(await i.generatePoster(e.src,o,n.outputDir,n.baseUrl||"/videos"))?.url}function Ge(e,r,i){let{controls:o=Be,autoplay:n=!1,muted:c=!1,loop:d=!1,preload:p=Je,playsinline:u=!0,lazy:m=!0,width:y,height:f,crossorigin:v,disablePictureInPicture:b=!1,disableRemotePlayback:x=!1}=e,{class:P,style:S}=e,A=e.id||`stx-video-${Math.random().toString(36).slice(2,8)}`,k=e.src,O=Ke(k);if(r.transcoded)k=r.transcoded.url,O="video/mp4";let E=r.streaming?.hls||r.streaming?.dash;if(E){if(r.streaming?.hls)k=r.streaming.hls.manifestUrl,O="application/x-mpegURL";else if(r.streaming?.dash)k=r.streaming.dash.manifestUrl,O="application/dash+xml"}let w=r.poster?.url||e.poster,C=[`id="${A}"`];if(o)C.push("controls");if(n)C.push("autoplay");if(c)C.push("muted");if(d)C.push("loop");if(u)C.push("playsinline");if(b)C.push("disablepictureinpicture");if(x)C.push("disableremoteplayback");if(v)C.push(`crossorigin="${v}"`);if(m){if(C.push(`data-preload="${p}"`),C.push('preload="none"'),w)C.push(`data-poster="${M(w)}"`);C.push("data-stx-lazy")}else if(C.push(`preload="${p}"`),w)C.push(`poster="${M(w)}"`);let D=y||r.metadata?.width,z=f||r.metadata?.height;if(D)C.push(`width="${D}"`);if(z)C.push(`height="${z}"`);if(P)C.push(`class="${M(P)}"`);if(S)C.push(`style="${M(S)}"`);let T=` <source ${m?`data-src="${M(k)}"`:`src="${M(k)}"`} type="${O}" />`,N=`<video ${C.join(" ")}>
959
+ `.trim();return{html:E,script:I,css:w}}function Ke(e){switch(e.split(".").pop()?.toLowerCase()){case"mp4":return"video/mp4";case"webm":return"video/webm";case"ogg":case"ogv":return"video/ogg";case"mov":return"video/quicktime";case"avi":return"video/x-msvideo";case"mkv":return"video/x-matroska";case"m3u8":return"application/x-mpegURL";default:return"video/mp4"}}function Tt(e){let r=[/youtube\.com\/watch\?v=([^&]+)/,/youtube\.com\/embed\/([^?]+)/,/youtu\.be\/([^?]+)/,/youtube\.com\/v\/([^?]+)/];for(let i of r){let o=e.match(i);if(o)return o[1]}return null}function Mt(e){let r=e.match(/vimeo\.com\/(\d+)/);return r?r[1]:null}function M(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}async function jt(e,r){let i=await Ue();if(!i)return de({...e,process:!1},r);let o=r.tsVideosConfig,n=await i.processVideo(e.src,e,o,e.onProcessProgress);if(n.processed)return Ge(e,n,r);return de({...e,process:!1},r)}async function Nt(e,r){let i=await Ue();if(!i||!e.src)return;let o=typeof e.generatePoster==="object"?e.generatePoster:{timestamp:0},n=r.tsVideosConfig||{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos"};return(await i.generatePoster(e.src,o,n.outputDir,n.baseUrl||"/videos"))?.url}function Ge(e,r,i){let{controls:o=Be,autoplay:n=!1,muted:c=!1,loop:d=!1,preload:p=Je,playsinline:u=!0,lazy:m=!0,width:y,height:f,crossorigin:v,disablePictureInPicture:b=!1,disableRemotePlayback:x=!1}=e,{class:P,style:S}=e,A=e.id||`stx-video-${Math.random().toString(36).slice(2,8)}`,k=e.src,E=Ke(k);if(r.transcoded)k=r.transcoded.url,E="video/mp4";let I=r.streaming?.hls||r.streaming?.dash;if(I){if(r.streaming?.hls)k=r.streaming.hls.manifestUrl,E="application/x-mpegURL";else if(r.streaming?.dash)k=r.streaming.dash.manifestUrl,E="application/dash+xml"}let w=r.poster?.url||e.poster,C=[`id="${A}"`];if(o)C.push("controls");if(n)C.push("autoplay");if(c)C.push("muted");if(d)C.push("loop");if(u)C.push("playsinline");if(b)C.push("disablepictureinpicture");if(x)C.push("disableremoteplayback");if(v)C.push(`crossorigin="${v}"`);if(m){if(C.push(`data-preload="${p}"`),C.push('preload="none"'),w)C.push(`data-poster="${M(w)}"`);C.push("data-stx-lazy")}else if(C.push(`preload="${p}"`),w)C.push(`poster="${M(w)}"`);let D=y||r.metadata?.width,z=f||r.metadata?.height;if(D)C.push(`width="${D}"`);if(z)C.push(`height="${z}"`);if(P)C.push(`class="${M(P)}"`);if(S)C.push(`style="${M(S)}"`);let T=` <source ${m?`data-src="${M(k)}"`:`src="${M(k)}"`} type="${E}" />`,N=`<video ${C.join(" ")}>
960
960
  ${T}
961
961
  Your browser does not support the video tag.
962
962
  </video>`;if(r.spriteSheet)N=`<div class="stx-video-wrapper" data-sprite-sheet="${M(r.spriteSheet.url)}" data-sprite-cols="${r.spriteSheet.columns}" data-sprite-interval="${r.spriteSheet.interval}">
@@ -996,7 +996,7 @@ ${N}
996
996
 
997
997
  observer.observe(video);
998
998
  })();
999
- `.trim();let V;if(E)V=`
999
+ `.trim();let V;if(I)V=`
1000
1000
  .stx-video-wrapper {
1001
1001
  position: relative;
1002
1002
  width: 100%;
@@ -1005,9 +1005,9 @@ ${N}
1005
1005
  width: 100%;
1006
1006
  height: auto;
1007
1007
  }
1008
- `.trim();return{html:N,script:_,css:V}}function Ye(){return xt({name:"video",hasEndTag:!1,description:"Render a video with optional ts-videos processing, streaming, and poster generation",transform:async(e,r,i,o)=>{let{src:n,options:c}=Vt(e,r,i);if(!n)return console.warn("@video directive: missing src argument"),"<!-- @video: missing src -->";let d={src:n,poster:c.poster,controls:c.controls!==!1,autoplay:c.autoplay||!1,muted:c.muted||!1,loop:c.loop||!1,preload:c.preload||"metadata",playsinline:c.playsinline!==!1,lazy:c.lazy!==!1,player:c.player||"native",type:c.type,width:c.width,height:c.height,class:c.class,style:c.style,id:c.id,crossorigin:c.crossorigin,disablePictureInPicture:c.disablePictureInPicture,disableRemotePlayback:c.disableRemotePlayback,title:c.title,quality:c.quality,platform:c.platform,process:c.process,generatePoster:c.generatePoster,streaming:c.streaming,transcode:c.transcode,spriteSheet:c.spriteSheet,waveform:c.waveform},u={isDev:i.__isDev||!1,tsVideosConfig:i.__tsVideosConfig},m=await de(d,u),y=m.html;if(m.css)y+=`
1008
+ `.trim();return{html:N,script:_,css:V}}function Ye(){return St({name:"video",hasEndTag:!1,description:"Render a video with optional ts-videos processing, streaming, and poster generation",transform:async(e,r,i,o)=>{let{src:n,options:c}=Vt(e,r,i);if(!n)return console.warn("@video directive: missing src argument"),"<!-- @video: missing src -->";let d={src:n,poster:c.poster,controls:c.controls!==!1,autoplay:c.autoplay||!1,muted:c.muted||!1,loop:c.loop||!1,preload:c.preload||"metadata",playsinline:c.playsinline!==!1,lazy:c.lazy!==!1,player:c.player||"native",type:c.type,width:c.width,height:c.height,class:c.class,style:c.style,id:c.id,crossorigin:c.crossorigin,disablePictureInPicture:c.disablePictureInPicture,disableRemotePlayback:c.disableRemotePlayback,title:c.title,quality:c.quality,platform:c.platform,process:c.process,generatePoster:c.generatePoster,streaming:c.streaming,transcode:c.transcode,spriteSheet:c.spriteSheet,waveform:c.waveform},u={isDev:i.__isDev||!1,tsVideosConfig:i.__tsVideosConfig},m=await de(d,u),y=m.html;if(m.css)y+=`
1009
1009
  <style>${m.css}</style>`;if(m.script)y+=`
1010
- <script>${m.script}</script>`;return y},defaults:{src:"",options:{controls:!0,lazy:!0,preload:"metadata"}}})}function Vt(e,r,i){if(r.src)return{src:String(r.src),options:r.options||{}};let o=e.trim();if(o.startsWith("@video(")||o.startsWith("("))o=o.replace(/^@video\(/,"").replace(/^\(/,"").replace(/\)$/,"");let n=zt(o),c=Xe(n[0],i)||"",d={};if(n[1]){let p=Xe(n[1],i);if(typeof p==="object"&&p!==null)d=p;else if(typeof n[1]==="string")try{d=JSON.parse(n[1])}catch{}}return{src:c,options:d}}function zt(e){let r=[],i="",o=!1,n="",c=0,d=0;for(let p=0;p<e.length;p++){let u=e[p],m=p>0?e[p-1]:"";if((u==='"'||u==="'"||u==="`")&&m!=="\\"){if(!o)o=!0,n=u;else if(u===n)o=!1,n="";else i+=u;continue}if(!o){if(u==="{")c++;if(u==="}")c--;if(u==="[")d++;if(u==="]")d--;if(u===","&&c===0&&d===0){r.push(i.trim()),i="";continue}}i+=u}if(i.trim())r.push(i.trim());return r}function Xe(e,r){if(typeof e!=="string")return e;let i=e.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return i.slice(1,-1);if(!i.startsWith("/")&&!i.startsWith(".")&&!i.startsWith("http")&&!i.startsWith("{")){let o=r[i];if(o!==void 0)return o}if(i.startsWith("{")||i.startsWith("["))try{return JSON.parse(i)}catch{}return i}var Se=Ye();import Lt from"fs";import F from"path";async function xs(e,r){if(!e.webComponents?.enabled)return[];let i=e.webComponents.components||[],o=[];if(i.length>0){if(e.debug)console.log(`Building ${i.length} web components...`);for(let n of i)try{let c=await Wt(n,e,r);if(c)o.push(c)}catch(c){if(console.error(`Error building web component ${n.name}:`,c),e.debug)throw c}}return o}async function Wt(e,r,i){let{name:o,file:n,tag:c,extends:d}=e;if(!o||!n||!c)return console.error("Invalid web component configuration, missing required fields:",e),null;let p=null;if(F.isAbsolute(n)&&await s(n))p=n;else if(r.componentsDir){let P=F.join(r.componentsDir,n);if(await s(P))p=P}if(!p)p=await bn(n,process.cwd(),r,i);if(!p)return console.error(`Web component source file not found: ${n}`),null;let u=await Bun.file(p).text();i.add(p);let y=(e.outputFormat||"js")==="ts",f=y?qt({name:o,tag:c,baseElement:d,source:u,shadowDOM:e.shadowDOM??!0,template:e.template??!0,styleSource:e.styleSource,attributes:e.attributes||[],attributeTypes:e.attributeTypes||{}}):Ft({name:o,tag:c,baseElement:d,source:u,shadowDOM:e.shadowDOM??!0,template:e.template??!0,styleSource:e.styleSource,attributes:e.attributes||[]}),v=r.webComponents?.outputDir||"dist/web-components";await Lt.promises.mkdir(v,{recursive:!0});let b=y?"ts":"js",x=F.join(v,`${c}.${b}`);if(await Bun.write(x,f),r.debug)console.log(`Built web component ${o} -> ${x}`);return x}function Ft(e){let{name:r,tag:i,baseElement:o="HTMLElement",source:n,shadowDOM:c,template:d,styleSource:p,attributes:u=[]}=e,m=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!c)m=m.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),m=m.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),m=m.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),m=m.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");let y="";if(p)y=`<link rel="stylesheet" href="${p}">`;return`/**
1010
+ <script>${m.script}</script>`;return y},defaults:{src:"",options:{controls:!0,lazy:!0,preload:"metadata"}}})}function Vt(e,r,i){if(r.src)return{src:String(r.src),options:r.options||{}};let o=e.trim();if(o.startsWith("@video(")||o.startsWith("("))o=o.replace(/^@video\(/,"").replace(/^\(/,"").replace(/\)$/,"");let n=zt(o),c=Xe(n[0],i)||"",d={};if(n[1]){let p=Xe(n[1],i);if(typeof p==="object"&&p!==null)d=p;else if(typeof n[1]==="string")try{d=JSON.parse(n[1])}catch{}}return{src:c,options:d}}function zt(e){let r=[],i="",o=!1,n="",c=0,d=0;for(let p=0;p<e.length;p++){let u=e[p],m=p>0?e[p-1]:"";if((u==='"'||u==="'"||u==="`")&&m!=="\\"){if(!o)o=!0,n=u;else if(u===n)o=!1,n="";else i+=u;continue}if(!o){if(u==="{")c++;if(u==="}")c--;if(u==="[")d++;if(u==="]")d--;if(u===","&&c===0&&d===0){r.push(i.trim()),i="";continue}}i+=u}if(i.trim())r.push(i.trim());return r}function Xe(e,r){if(typeof e!=="string")return e;let i=e.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return i.slice(1,-1);if(!i.startsWith("/")&&!i.startsWith(".")&&!i.startsWith("http")&&!i.startsWith("{")){let o=r[i];if(o!==void 0)return o}if(i.startsWith("{")||i.startsWith("["))try{return JSON.parse(i)}catch{}return i}var Se=Ye();import Lt from"fs";import q from"path";async function xs(e,r){if(!e.webComponents?.enabled)return[];let i=e.webComponents.components||[],o=[];if(i.length>0){if(e.debug)console.log(`Building ${i.length} web components...`);for(let n of i)try{let c=await Wt(n,e,r);if(c)o.push(c)}catch(c){if(console.error(`Error building web component ${n.name}:`,c),e.debug)throw c}}return o}async function Wt(e,r,i){let{name:o,file:n,tag:c,extends:d}=e;if(!o||!n||!c)return console.error("Invalid web component configuration, missing required fields:",e),null;let p=null;if(q.isAbsolute(n)&&await s(n))p=n;else if(r.componentsDir){let P=q.join(r.componentsDir,n);if(await s(P))p=P}if(!p)p=await wn(n,process.cwd(),r,i);if(!p)return console.error(`Web component source file not found: ${n}`),null;let u=await Bun.file(p).text();i.add(p);let y=(e.outputFormat||"js")==="ts",f=y?qt({name:o,tag:c,baseElement:d,source:u,shadowDOM:e.shadowDOM??!0,template:e.template??!0,styleSource:e.styleSource,attributes:e.attributes||[],attributeTypes:e.attributeTypes||{}}):Ft({name:o,tag:c,baseElement:d,source:u,shadowDOM:e.shadowDOM??!0,template:e.template??!0,styleSource:e.styleSource,attributes:e.attributes||[]}),v=r.webComponents?.outputDir||"dist/web-components";await Lt.promises.mkdir(v,{recursive:!0});let b=y?"ts":"js",x=q.join(v,`${c}.${b}`);if(await Bun.write(x,f),r.debug)console.log(`Built web component ${o} -> ${x}`);return x}function Ft(e){let{name:r,tag:i,baseElement:o="HTMLElement",source:n,shadowDOM:c,template:d,styleSource:p,attributes:u=[]}=e,m=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!c)m=m.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),m=m.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),m=m.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),m=m.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");let y="";if(p)y=`<link rel="stylesheet" href="${p}">`;return`/**
1011
1011
  * ${r} Web Component
1012
1012
  * Auto-generated from stx component
1013
1013
  */
@@ -1146,7 +1146,7 @@ catch { return value; }
1146
1146
  default: return value;
1147
1147
  }
1148
1148
  }
1149
- `:"",O=d?`
1149
+ `:"",E=d?`
1150
1150
  private _createTemplate(): void {
1151
1151
  const template = document.createElement('template');
1152
1152
  template.innerHTML = \`${v}${f}\`;
@@ -1188,7 +1188,7 @@ ${P}
1188
1188
  super();
1189
1189
  ${c?'this.attachShadow({ mode: "open" });':""}
1190
1190
  }
1191
- ${O}
1191
+ ${E}
1192
1192
  ${c?`
1193
1193
  private _processSlots(): void {
1194
1194
  const slots = this.shadowRoot!.querySelectorAll('slot');
@@ -1305,8 +1305,8 @@ ${y}
1305
1305
  }
1306
1306
 
1307
1307
  customElements.define('${r}', ${d});
1308
- `}async function Ze(e,r,i,o){if(r.length<1)return l("WebComponent","@webcomponent directive requires at least the tag name parameter",t.INVALID_DIRECTIVE_SYNTAX);let n=r[0].replace(/['"]/g,""),d=(i.__stx_options||{}).componentsDir||"components",p=F.isAbsolute(d)?[F.join(d,`${n}.stx`),F.join(F.dirname(o),`${n}.stx`)]:[F.join(F.dirname(o),d,`${n}.stx`),F.join(process.cwd(),d,`${n}.stx`),F.join(F.dirname(o),`${n}.stx`)],u=null;for(let f of p)if(await s(f)){u=await Bun.file(f).text();break}if(!u)return l("WebComponent",`Component file not found: ${n}.stx`,t.FILE_NOT_FOUND);let m=Ht(u,n);return`<script type="module">
1308
+ `}async function Ze(e,r,i,o){if(r.length<1)return l("WebComponent","@webcomponent directive requires at least the tag name parameter",t.INVALID_DIRECTIVE_SYNTAX);let n=r[0].replace(/['"]/g,""),d=(i.__stx_options||{}).componentsDir||"components",p=q.isAbsolute(d)?[q.join(d,`${n}.stx`),q.join(q.dirname(o),`${n}.stx`)]:[q.join(q.dirname(o),d,`${n}.stx`),q.join(process.cwd(),d,`${n}.stx`),q.join(q.dirname(o),`${n}.stx`)],u=null;for(let f of p)if(await s(f)){u=await Bun.file(f).text();break}if(!u)return l("WebComponent",`Component file not found: ${n}.stx`,t.FILE_NOT_FOUND);let m=Ht(u,n);return`<script type="module">
1309
1309
  ${Ut(m)}
1310
- </script>`}var B={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:un,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:Te,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:Ze,hasEndTag:!1,description:"Include a web component in the template"},wc,vc,_s,Cs,Pe,Ae,_e,ke,Re,Ee,qe,Se,...to],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Jt(e,r,i){let o=r||"pages";if(e)return{root:e,pagesDir:o};let n=i||process.cwd(),c=j.join(n,"resources","views"),d=j.join(n,"resources","layouts");if(Q.existsSync(c)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let p=j.join(n,"resources","views","pages");if(Q.existsSync(p))return{root:"resources/views",pagesDir:o};return{root:".",pagesDir:o}}var et=new Set,pe=["partialsDir","componentsDir","layoutsDir"],Ce=new WeakMap;function Kt(e,r){let i=r.replace(/[\\/]+$/,"");if(!i||i===".")return!0;let o=e.replace(/\\/g,"/"),n=i.replace(/\\/g,"/");return o===n||o.startsWith(`${n}/`)}function zf(e,r){let i=!e.root,o=Jt(e.root,e.pagesDir,r);if(e.root=o.root,e.pagesDir=o.pagesDir,i&&o.root!=="."){let n=`${r}::${o.root}`;if(!et.has(n))et.add(n),console.warn(`[stx] No "root" in config \u2014 inferred "${o.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Ce.has(e)){let n={};for(let c of pe){let d=e[c];if(typeof d==="string"&&d)n[c]=d}Ce.set(e,n)}if(e.root&&e.root!=="."){let n=e.root;for(let c of pe){let d=e[c];if(typeof d!=="string"||!d)continue;if(j.isAbsolute(d)||Kt(d,n))continue;e[c]=j.join(n,d)}}for(let n of pe){let c=e[n];if(typeof c!=="string"||!c||j.isAbsolute(c))continue;e[n]=j.resolve(r,c)}return e}function Gt(e,r){let i=Ce.get(e);for(let o of pe){let n=e[o];if(typeof n!=="string"||!n)continue;let c=j.isAbsolute(n)?n:j.join(r,n);if(Q.existsSync(c))continue;let d=i?.[o]??n,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(o)} resolves to "${c}", which does not exist. Configured as "${d}"`+(u?`, resolved under root "${p}".`:"."))}}function Yt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Xt(e){if($c(e.stateDir),e.stateDir=mr(),e.cachePath=hr(e.cachePath),e.build)e.build.cacheDir=hr(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=hr(e.media.cache.directory);if(e.story)e.story.outDir=hr(e.story.outDir)}var K=null,Y=new Map,ue=new Map,se=null;async function Go(e,r=Bt){try{return await r(e)}catch(i){if(i instanceof Error&&i.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw i}}async function a(e){let r=e?j.resolve(e):process.cwd(),i=ue.get(r);if(i&&i.signature!==Ss(i.graph)){let c=Y.get(r);if(Y.delete(r),ue.delete(r),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-zd3dsp6p.js"),{partialsCache:p}=await import("./chunk-pby6dxnc.js");if(d(),p.clear(),c&&i.configSignature===ks(i.graph)){let u=c.then(async(m)=>{let y={...i.graph};await Yo(y,r),ue.set(r,{graph:y,signature:Ss(y),configSignature:ks(y)});let f={...m,_layerGraph:y};if(!e)K=f;return f});return Y.set(r,u),u}}if(!e){if(K)return K;if(se)return se}let o=Y.get(r);if(o)return o;let n=(async()=>{let c=[".ts",".js",".mjs",".cjs",".json"],d=c.some((v)=>Q.existsSync(j.join(r,`stx.config${v}`))),p=c.some((v)=>Q.existsSync(j.join(r,"config",`ui${v}`))),u;if(d&&p){let v=await Go({name:"ui",cwd:j.join(r,"config"),defaultConfig:B,errorPolicy:"throw",verbose:!1});u=(await Go({name:"stx",alias:"ui",cwd:r,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await Go({name:"stx",alias:"ui",cwd:r,defaultConfig:B,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||i){let v=await Sc(r,B);u=v.config,ue.set(r,{graph:v.graph,signature:Ss(v.graph),configSignature:ks(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-b22yj5j5.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-4amybnpc.js");await b(r,u.runtimeConfig)}Yt(u),Xt(u),zf(u,r),Gt(u,r);let m=[],y=new Set((u.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of u.componentPackages??["@stacksjs/components"]){let b=`${v}/stx-plugin`;if(y.has(b)||y.has(v))continue;try{g.resolve(b,{paths:[r]}),m.push(b)}catch{}}let f=[...u.plugins??[],...m];if(f.length>0){let{pluginManager:v}=await import("./chunk-3bf48zrh.js"),b=[],x=[];for(let P of f){let S=typeof P==="string"?P:P[0],A=typeof P==="string"?{}:P[1]||{};try{let k,O;try{let w=g.resolve(S,{paths:[r]});k=await import(w),O=j.dirname(w)}catch{let w=j.resolve(r,S);k=await import(w),O=j.dirname(w)}let E=k.default||k;if(!v.has(E.name))await v.register(E,u);if(E.components){let w=Array.isArray(E.components)?E.components:[E.components];for(let C of w)b.push(j.resolve(O,C))}if(E.pages){let w=j.resolve(O,E.pages),C=A.path||"/";x.push({dir:w,prefix:C})}if(E.setup){let w={addDirective:(C)=>{u.customDirectives=u.customDirectives||[],u.customDirectives.push(C)},addRoute:(C,D)=>{u.apiRoutes=u.apiRoutes||{},u.apiRoutes[C]=D},addMiddleware:(C)=>{u.middleware=u.middleware||[],u.middleware.push(C)},pluginDir:O,config:u};await E.setup(A,w)}process.stderr.write(`[stx] Plugin loaded: ${E.name||S}
1311
- `)}catch(k){console.warn(`[stx] Failed to load plugin ${S}:`,k.message)}}u._pluginComponentDirs=b,u._pluginPageDirs=x}if(u.nativePrimitives!==!1)u._nativePrimitivesFallback={dir:vs(),except:["Button","Checkbox","Switch","TextInput","Image","Video"]};return u})();if(Y.set(r,n),n.catch(()=>{if(Y.get(r)===n)Y.delete(r)}),!e)se=n,n.then((c)=>{K=c}).catch(()=>{});return n}var I=new Proxy(B,{get(e,r){if(K&&r in K)return K[r];if(!se)a().catch((i)=>{console.warn("[stx] Failed to load config file:",i?.message||i)});return e[r]}});function Hh(e){return e}function Vh(e){let r=[],i=[];if(e.partialsDir!==void 0&&typeof e.partialsDir!=="string")r.push({path:"partialsDir",message:"partialsDir must be a string",severity:"error"});if(e.componentsDir!==void 0&&typeof e.componentsDir!=="string")r.push({path:"componentsDir",message:"componentsDir must be a string",severity:"error"});if(e.cache!==void 0&&typeof e.cache!=="boolean")r.push({path:"cache",message:"cache must be a boolean",severity:"error"});if(e.debug!==void 0&&typeof e.debug!=="boolean")r.push({path:"debug",message:"debug must be a boolean",severity:"error"});if(e.streaming){if(e.streaming.bufferSize!==void 0){if(typeof e.streaming.bufferSize!=="number"||e.streaming.bufferSize<=0)r.push({path:"streaming.bufferSize",message:"streaming.bufferSize must be a positive number",severity:"error"})}if(e.streaming.timeout!==void 0){if(typeof e.streaming.timeout!=="number"||e.streaming.timeout<=0)r.push({path:"streaming.timeout",message:"streaming.timeout must be a positive number",severity:"error"})}if(e.streaming.strategy!==void 0){let o=["auto","manual","sections"];if(!o.includes(e.streaming.strategy))r.push({path:"streaming.strategy",message:`streaming.strategy must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.i18n){if(e.i18n.format!==void 0){let o=["json","yaml","yml","js"];if(!o.includes(e.i18n.format))r.push({path:"i18n.format",message:`i18n.format must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.animation){if(e.animation.defaultDuration!==void 0){if(typeof e.animation.defaultDuration!=="number"||e.animation.defaultDuration<0)r.push({path:"animation.defaultDuration",message:"animation.defaultDuration must be a non-negative number",severity:"error"})}if(e.animation.staggerDelay!==void 0){if(typeof e.animation.staggerDelay!=="number"||e.animation.staggerDelay<0)r.push({path:"animation.staggerDelay",message:"animation.staggerDelay must be a non-negative number",severity:"error"})}}if(e.a11y){if(e.a11y.level!==void 0){let o=["AA","AAA"];if(!o.includes(e.a11y.level))r.push({path:"a11y.level",message:`a11y.level must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.hydration){if(e.hydration.mode!==void 0){let o=["progressive","islands"];if(!o.includes(e.hydration.mode))r.push({path:"hydration.mode",message:`hydration.mode must be one of: ${o.join(", ")}`,severity:"error"})}if(e.hydration.preload!==void 0){let o=["none","eager","lazy"];if(!o.includes(e.hydration.preload))r.push({path:"hydration.preload",message:`hydration.preload must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.customDirectives)if(!Array.isArray(e.customDirectives))r.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else e.customDirectives.forEach((o,n)=>{if(!o.name||typeof o.name!=="string")r.push({path:`customDirectives[${n}].name`,message:"Custom directive must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")r.push({path:`customDirectives[${n}].handler`,message:"Custom directive must have a handler function",severity:"error"})});if(e.middleware)if(!Array.isArray(e.middleware))r.push({path:"middleware",message:"middleware must be an array",severity:"error"});else e.middleware.forEach((o,n)=>{if(!o.name||typeof o.name!=="string")r.push({path:`middleware[${n}].name`,message:"Middleware must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")r.push({path:`middleware[${n}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!o.timing||!["before","after"].includes(o.timing))r.push({path:`middleware[${n}].timing`,message:'Middleware timing must be "before" or "after"',severity:"error"})});if(e.debug===!0&&e.cache===!0)i.push({path:"debug+cache",message:"Debug mode with caching enabled may show stale content during development",severity:"warning"});if(e.seo?.enabled===!0&&!e.seo?.defaultConfig?.title)i.push({path:"seo.defaultConfig.title",message:"SEO is enabled but no default title is set",severity:"warning"});if(e.pwa){if(e.pwa.enabled===!0&&!e.pwa.manifest?.name)r.push({path:"pwa.manifest.name",message:"PWA manifest name is required when PWA is enabled",severity:"error"});if(e.pwa.manifest?.display!==void 0){let o=["fullscreen","standalone","minimal-ui","browser"];if(!o.includes(e.pwa.manifest.display))r.push({path:"pwa.manifest.display",message:`PWA display must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.manifest?.orientation!==void 0){let o=["portrait","landscape","any","portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];if(!o.includes(e.pwa.manifest.orientation))r.push({path:"pwa.manifest.orientation",message:`PWA orientation must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.routes){let o=["cache-first","network-first","stale-while-revalidate","network-only","cache-only"];e.pwa.routes.forEach((n,c)=>{if(!n.pattern||typeof n.pattern!=="string")r.push({path:`pwa.routes[${c}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!o.includes(n.strategy))r.push({path:`pwa.routes[${c}].strategy`,message:`PWA route strategy must be one of: ${o.join(", ")}`,severity:"error"});if(n.maxAgeSeconds!==void 0&&(typeof n.maxAgeSeconds!=="number"||n.maxAgeSeconds<0))r.push({path:`pwa.routes[${c}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(n.maxEntries!==void 0&&(typeof n.maxEntries!=="number"||n.maxEntries<1))r.push({path:`pwa.routes[${c}].maxEntries`,message:"PWA route maxEntries must be a positive number",severity:"error"})})}if(e.pwa.icons?.sizes){if(!Array.isArray(e.pwa.icons.sizes))r.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be an array of numbers",severity:"error"});else if(e.pwa.icons.sizes.filter((n)=>typeof n!=="number"||n<16||n>1024).length>0)r.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be numbers between 16 and 1024",severity:"error"})}if(e.pwa.icons?.purpose){let o=["any","maskable","monochrome"];if(e.pwa.icons.purpose.filter((c)=>!o.includes(c)).length>0)r.push({path:"pwa.icons.purpose",message:`PWA icon purpose must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.enabled===!0&&!e.pwa.icons?.src)i.push({path:"pwa.icons.src",message:"PWA is enabled but no icon source specified. Provide a 512x512 PNG for best results.",severity:"warning"});if(e.pwa.enabled===!0&&!e.pwa.manifest?.themeColor)i.push({path:"pwa.manifest.themeColor",message:"PWA theme color not set, defaulting to black",severity:"warning"})}return{valid:r.length===0,errors:r,warnings:i}}
1312
- export{fc,gc,dr,Qe,mc,vs,xs,B,zf,Go,a,I,Hh,Vh};
1310
+ </script>`}var F={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:dn,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:Te,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:Ze,hasEndTag:!1,description:"Include a web component in the template"},vc,xc,_s,Cs,Pe,Ae,_e,ke,Re,Ee,qe,Se,...to],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Jt(e,r,i){let o=r||"pages";if(e)return{root:e,pagesDir:o};let n=i||process.cwd(),c=j.join(n,"resources","views"),d=j.join(n,"resources","layouts");if(Q.existsSync(c)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let p=j.join(n,"resources","views","pages");if(Q.existsSync(p))return{root:"resources/views",pagesDir:o};return{root:".",pagesDir:o}}var Qe=new Set,pe=["partialsDir","componentsDir","layoutsDir"],Ce=new WeakMap;function Kt(e,r){let i=r.replace(/[\\/]+$/,"");if(!i||i===".")return!0;let o=e.replace(/\\/g,"/"),n=i.replace(/\\/g,"/");return o===n||o.startsWith(`${n}/`)}function Vf(e,r){let i=!e.root,o=Jt(e.root,e.pagesDir,r);if(e.root=o.root,e.pagesDir=o.pagesDir,i&&o.root!=="."){let n=`${r}::${o.root}`;if(!Qe.has(n))Qe.add(n),console.warn(`[stx] No "root" in config \u2014 inferred "${o.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Ce.has(e)){let n={};for(let c of pe){let d=e[c];if(typeof d==="string"&&d)n[c]=d}Ce.set(e,n)}if(e.root&&e.root!=="."){let n=e.root;for(let c of pe){let d=e[c];if(typeof d!=="string"||!d)continue;if(j.isAbsolute(d)||Kt(d,n))continue;e[c]=j.join(n,d)}}for(let n of pe){let c=e[n];if(typeof c!=="string"||!c||j.isAbsolute(c))continue;e[n]=j.resolve(r,c)}return e}function Gt(e,r){let i=Ce.get(e);for(let o of pe){let n=e[o];if(typeof n!=="string"||!n)continue;let c=j.isAbsolute(n)?n:j.join(r,n);if(Q.existsSync(c))continue;let d=i?.[o]??n,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(o)} resolves to "${c}", which does not exist. Configured as "${d}"`+(u?`, resolved under root "${p}".`:"."))}}function Yt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Xt(e){if(Rc(e.stateDir),e.stateDir=mr(),e.cachePath=hr(e.cachePath),e.build)e.build.cacheDir=hr(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=hr(e.media.cache.directory);if(e.story)e.story.outDir=hr(e.story.outDir)}var K=null,Y=new Map,ue=new Map,se=null;async function Jo(e,r=Bt){try{return await r(e)}catch(i){if(i instanceof Error&&i.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw i}}async function a(e){let r=e?j.resolve(e):process.cwd(),i=ue.get(r);if(i&&i.signature!==Ss(i.graph)){let c=Y.get(r);if(Y.delete(r),ue.delete(r),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-tx02ffyc.js"),{partialsCache:p}=await import("./chunk-e240xqcn.js");if(d(),p.clear(),c&&i.configSignature===ks(i.graph)){let u=c.then(async(m)=>{let y={...i.graph};await Zo(y,r),ue.set(r,{graph:y,signature:Ss(y),configSignature:ks(y)});let f={...m,_layerGraph:y};if(!e)K=f;return f});return Y.set(r,u),u}}if(!e){if(K)return K;if(se)return se}let o=Y.get(r);if(o)return o;let n=(async()=>{let c=[".ts",".js",".mjs",".cjs",".json"],d=c.some((v)=>Q.existsSync(j.join(r,`stx.config${v}`))),p=c.some((v)=>Q.existsSync(j.join(r,"config",`ui${v}`))),u;if(d&&p){let v=await Jo({name:"ui",cwd:j.join(r,"config"),defaultConfig:F,errorPolicy:"throw",verbose:!1});u=(await Jo({name:"stx",alias:"ui",cwd:r,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await Jo({name:"stx",alias:"ui",cwd:r,defaultConfig:F,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||i){let v=await kc(r,F);u=v.config,ue.set(r,{graph:v.graph,signature:Ss(v.graph),configSignature:ks(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-zty254tw.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-xgjr0pzy.js");await b(r,u.runtimeConfig)}Yt(u),Xt(u),Vf(u,r),Gt(u,r);let m=[],y=new Set((u.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of u.componentPackages??["@stacksjs/components"]){let b=`${v}/stx-plugin`;if(y.has(b)||y.has(v))continue;try{g.resolve(b,{paths:[r]}),m.push(b)}catch{}}let f=[...u.plugins??[],...m];if(f.length>0){let{pluginManager:v}=await import("./chunk-cfrgrnej.js"),b=[],x=[];for(let P of f){let S=typeof P==="string"?P:P[0],A=typeof P==="string"?{}:P[1]||{};try{let k,E;try{let w=g.resolve(S,{paths:[r]});k=await import(w),E=j.dirname(w)}catch{let w=j.resolve(r,S);k=await import(w),E=j.dirname(w)}let I=k.default||k;if(!v.has(I.name))await v.register(I,u);if(I.components){let w=Array.isArray(I.components)?I.components:[I.components];for(let C of w)b.push(j.resolve(E,C))}if(I.pages){let w=j.resolve(E,I.pages),C=A.path||"/";x.push({dir:w,prefix:C})}if(I.setup){let w={addDirective:(C)=>{u.customDirectives=u.customDirectives||[],u.customDirectives.push(C)},addRoute:(C,D)=>{u.apiRoutes=u.apiRoutes||{},u.apiRoutes[C]=D},addMiddleware:(C)=>{u.middleware=u.middleware||[],u.middleware.push(C)},pluginDir:E,config:u};await I.setup(A,w)}process.stderr.write(`[stx] Plugin loaded: ${I.name||S}
1311
+ `)}catch(k){console.warn(`[stx] Failed to load plugin ${S}:`,k.message)}}u._pluginComponentDirs=b,u._pluginPageDirs=x}if(u.nativePrimitives!==!1)u._nativePrimitivesFallback={dir:vs(),except:["Button","Checkbox","Switch","TextInput","Image","Video"]};return u})();if(Y.set(r,n),n.catch(()=>{if(Y.get(r)===n)Y.delete(r)}),!e)se=n,n.then((c)=>{K=c}).catch(()=>{});return n}var O=new Proxy(F,{get(e,r){if(K&&r in K)return K[r];if(!se)a().catch((i)=>{console.warn("[stx] Failed to load config file:",i?.message||i)});return e[r]}});function Uh(e){return e}function Wh(e){let r=[],i=[];if(e.partialsDir!==void 0&&typeof e.partialsDir!=="string")r.push({path:"partialsDir",message:"partialsDir must be a string",severity:"error"});if(e.componentsDir!==void 0&&typeof e.componentsDir!=="string")r.push({path:"componentsDir",message:"componentsDir must be a string",severity:"error"});if(e.cache!==void 0&&typeof e.cache!=="boolean")r.push({path:"cache",message:"cache must be a boolean",severity:"error"});if(e.debug!==void 0&&typeof e.debug!=="boolean")r.push({path:"debug",message:"debug must be a boolean",severity:"error"});if(e.streaming){if(e.streaming.bufferSize!==void 0){if(typeof e.streaming.bufferSize!=="number"||e.streaming.bufferSize<=0)r.push({path:"streaming.bufferSize",message:"streaming.bufferSize must be a positive number",severity:"error"})}if(e.streaming.timeout!==void 0){if(typeof e.streaming.timeout!=="number"||e.streaming.timeout<=0)r.push({path:"streaming.timeout",message:"streaming.timeout must be a positive number",severity:"error"})}if(e.streaming.strategy!==void 0){let o=["auto","manual","sections"];if(!o.includes(e.streaming.strategy))r.push({path:"streaming.strategy",message:`streaming.strategy must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.i18n){if(e.i18n.format!==void 0){let o=["json","yaml","yml","js"];if(!o.includes(e.i18n.format))r.push({path:"i18n.format",message:`i18n.format must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.animation){if(e.animation.defaultDuration!==void 0){if(typeof e.animation.defaultDuration!=="number"||e.animation.defaultDuration<0)r.push({path:"animation.defaultDuration",message:"animation.defaultDuration must be a non-negative number",severity:"error"})}if(e.animation.staggerDelay!==void 0){if(typeof e.animation.staggerDelay!=="number"||e.animation.staggerDelay<0)r.push({path:"animation.staggerDelay",message:"animation.staggerDelay must be a non-negative number",severity:"error"})}}if(e.a11y){if(e.a11y.level!==void 0){let o=["AA","AAA"];if(!o.includes(e.a11y.level))r.push({path:"a11y.level",message:`a11y.level must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.hydration){if(e.hydration.mode!==void 0){let o=["progressive","islands"];if(!o.includes(e.hydration.mode))r.push({path:"hydration.mode",message:`hydration.mode must be one of: ${o.join(", ")}`,severity:"error"})}if(e.hydration.preload!==void 0){let o=["none","eager","lazy"];if(!o.includes(e.hydration.preload))r.push({path:"hydration.preload",message:`hydration.preload must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.customDirectives)if(!Array.isArray(e.customDirectives))r.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else e.customDirectives.forEach((o,n)=>{if(!o.name||typeof o.name!=="string")r.push({path:`customDirectives[${n}].name`,message:"Custom directive must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")r.push({path:`customDirectives[${n}].handler`,message:"Custom directive must have a handler function",severity:"error"})});if(e.middleware)if(!Array.isArray(e.middleware))r.push({path:"middleware",message:"middleware must be an array",severity:"error"});else e.middleware.forEach((o,n)=>{if(!o.name||typeof o.name!=="string")r.push({path:`middleware[${n}].name`,message:"Middleware must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")r.push({path:`middleware[${n}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!o.timing||!["before","after"].includes(o.timing))r.push({path:`middleware[${n}].timing`,message:'Middleware timing must be "before" or "after"',severity:"error"})});if(e.debug===!0&&e.cache===!0)i.push({path:"debug+cache",message:"Debug mode with caching enabled may show stale content during development",severity:"warning"});if(e.seo?.enabled===!0&&!e.seo?.defaultConfig?.title)i.push({path:"seo.defaultConfig.title",message:"SEO is enabled but no default title is set",severity:"warning"});if(e.pwa){if(e.pwa.enabled===!0&&!e.pwa.manifest?.name)r.push({path:"pwa.manifest.name",message:"PWA manifest name is required when PWA is enabled",severity:"error"});if(e.pwa.manifest?.display!==void 0){let o=["fullscreen","standalone","minimal-ui","browser"];if(!o.includes(e.pwa.manifest.display))r.push({path:"pwa.manifest.display",message:`PWA display must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.manifest?.orientation!==void 0){let o=["portrait","landscape","any","portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];if(!o.includes(e.pwa.manifest.orientation))r.push({path:"pwa.manifest.orientation",message:`PWA orientation must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.routes){let o=["cache-first","network-first","stale-while-revalidate","network-only","cache-only"];e.pwa.routes.forEach((n,c)=>{if(!n.pattern||typeof n.pattern!=="string")r.push({path:`pwa.routes[${c}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!o.includes(n.strategy))r.push({path:`pwa.routes[${c}].strategy`,message:`PWA route strategy must be one of: ${o.join(", ")}`,severity:"error"});if(n.maxAgeSeconds!==void 0&&(typeof n.maxAgeSeconds!=="number"||n.maxAgeSeconds<0))r.push({path:`pwa.routes[${c}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(n.maxEntries!==void 0&&(typeof n.maxEntries!=="number"||n.maxEntries<1))r.push({path:`pwa.routes[${c}].maxEntries`,message:"PWA route maxEntries must be a positive number",severity:"error"})})}if(e.pwa.icons?.sizes){if(!Array.isArray(e.pwa.icons.sizes))r.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be an array of numbers",severity:"error"});else if(e.pwa.icons.sizes.filter((n)=>typeof n!=="number"||n<16||n>1024).length>0)r.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be numbers between 16 and 1024",severity:"error"})}if(e.pwa.icons?.purpose){let o=["any","maskable","monochrome"];if(e.pwa.icons.purpose.filter((c)=>!o.includes(c)).length>0)r.push({path:"pwa.icons.purpose",message:`PWA icon purpose must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.enabled===!0&&!e.pwa.icons?.src)i.push({path:"pwa.icons.src",message:"PWA is enabled but no icon source specified. Provide a 512x512 PNG for best results.",severity:"warning"});if(e.pwa.enabled===!0&&!e.pwa.manifest?.themeColor)i.push({path:"pwa.manifest.themeColor",message:"PWA theme color not set, defaulting to black",severity:"warning"})}return{valid:r.length===0,errors:r,warnings:i}}
1312
+ export{gc,mc,dr,et,hc,vs,xs,F,Vf,Jo,a,O,Uh,Wh};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Lo,jo,Bo,Nh,ls,Mh}from"./chunk-zcnehb8p.js";export{ls as clearImageDeliveryCatalog,Nh as deliveredImage,Bo as efficientDeliverySources,Lo as getImageDelivery,jo as isTransparentImage,Mh as prepareImageDelivery};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- function ma(e){return e}class a{plugins=new Map;sortedPlugins=[];initialized=!1;async register(e,t){if(this.plugins.has(e.name))throw Error(`Plugin "${e.name}" is already registered`);if(e.dependencies){for(let r of e.dependencies)if(!this.plugins.has(r))throw Error(`Plugin "${e.name}" depends on "${r}" which is not registered`)}if(this.plugins.set(e.name,e),e.onRegister)await e.onRegister(t);this.sortPlugins()}async unregister(e){let t=this.plugins.get(e);if(!t)return!1;for(let[r,i]of this.plugins)if(i.dependencies?.includes(e))throw Error(`Cannot unregister "${e}" because "${r}" depends on it`);if(t.onUnregister)await t.onUnregister();return this.plugins.delete(e),this.sortPlugins(),!0}get(e){return this.plugins.get(e)}has(e){return this.plugins.has(e)}getAll(){return[...this.sortedPlugins]}getAllDirectives(){let e=[];for(let t of this.sortedPlugins)if(t.registerDirectives)e.push(...t.registerDirectives());return e}getAllFilters(){let e={};for(let t of this.sortedPlugins)if(t.registerFilters)Object.assign(e,t.registerFilters());return e}async runBeforeProcess(e){return this.runHooks("beforeProcess",e)}async runAfterParse(e){return this.runHooks("afterParse",e)}async runBeforeDirective(e,t){return this.runDirectiveHooks("beforeDirective",e,t)}async runAfterDirective(e,t){return this.runDirectiveHooks("afterDirective",e,t)}async runBeforeRender(e){return this.runHooks("beforeRender",e)}async runAfterRender(e){return this.runHooks("afterRender",e)}async runOnError(e){for(let t of this.sortedPlugins)if(t.onError)try{let r=await t.onError(e);if(r){if(r.template!==void 0)e.template=r.template;if(r.context)e.context={...e.context,...r.context};if(r.metadata)e.metadata={...e.metadata,...r.metadata};if(r.skip)return e}}catch(r){console.error(`Error in plugin "${t.name}" onError hook:`,r)}return null}sortPlugins(){this.sortedPlugins=Array.from(this.plugins.values()).sort((e,t)=>(e.priority??100)-(t.priority??100))}async runHooks(e,t){let r={...t};for(let i of this.sortedPlugins){let s=i[e];if(s)try{let n=await s(r);if(n){if(n.template!==void 0)r.template=n.template;if(n.context)r.context={...r.context,...n.context};if(n.metadata)r.metadata={...r.metadata,...n.metadata};if(n.skip)break}}catch(n){console.error(`Error in plugin "${i.name}" ${e} hook:`,n)}}return r}async runDirectiveHooks(e,t,r){let i={...r};for(let s of this.sortedPlugins){let n=s[e];if(n)try{let o=await n(t,i);if(o){if(o.template!==void 0)i.template=o.template;if(o.context)i.context={...i.context,...o.context};if(o.metadata)i.metadata={...i.metadata,...o.metadata};if(o.skip)break}}catch(o){console.error(`Error in plugin "${s.name}" ${e} hook:`,o)}}return i}}var mm=new a;var u=ma({name:"stx-debug",version:"1.0.0",description:"Logs all plugin lifecycle events for debugging",priority:0,beforeProcess(e){console.log("[stx-debug] beforeProcess:",e.filePath)},afterParse(e){console.log("[stx-debug] afterParse:",e.template.length,"chars")},beforeDirective(e,t){console.log("[stx-debug] beforeDirective:",e)},afterDirective(e,t){console.log("[stx-debug] afterDirective:",e)},beforeRender(e){console.log("[stx-debug] beforeRender")},afterRender(e){console.log("[stx-debug] afterRender:",e.template.length,"chars")},onError(e){console.error("[stx-debug] onError:",e.error.message,"in phase:",e.phase)}}),l=ma({name:"stx-timing",version:"1.0.0",description:"Measures template processing time",priority:1,beforeProcess(e){e.metadata.startTime=performance.now()},afterRender(e){let t=e.metadata.startTime;if(t){let r=performance.now()-t;console.log(`[stx-timing] Processing took ${r.toFixed(2)}ms`)}}});export{ma,mm};
2
+ function ha(e){return e}class a{plugins=new Map;sortedPlugins=[];initialized=!1;async register(e,t){if(this.plugins.has(e.name))throw Error(`Plugin "${e.name}" is already registered`);if(e.dependencies){for(let r of e.dependencies)if(!this.plugins.has(r))throw Error(`Plugin "${e.name}" depends on "${r}" which is not registered`)}if(this.plugins.set(e.name,e),e.onRegister)await e.onRegister(t);this.sortPlugins()}async unregister(e){let t=this.plugins.get(e);if(!t)return!1;for(let[r,i]of this.plugins)if(i.dependencies?.includes(e))throw Error(`Cannot unregister "${e}" because "${r}" depends on it`);if(t.onUnregister)await t.onUnregister();return this.plugins.delete(e),this.sortPlugins(),!0}get(e){return this.plugins.get(e)}has(e){return this.plugins.has(e)}getAll(){return[...this.sortedPlugins]}getAllDirectives(){let e=[];for(let t of this.sortedPlugins)if(t.registerDirectives)e.push(...t.registerDirectives());return e}getAllFilters(){let e={};for(let t of this.sortedPlugins)if(t.registerFilters)Object.assign(e,t.registerFilters());return e}async runBeforeProcess(e){return this.runHooks("beforeProcess",e)}async runAfterParse(e){return this.runHooks("afterParse",e)}async runBeforeDirective(e,t){return this.runDirectiveHooks("beforeDirective",e,t)}async runAfterDirective(e,t){return this.runDirectiveHooks("afterDirective",e,t)}async runBeforeRender(e){return this.runHooks("beforeRender",e)}async runAfterRender(e){return this.runHooks("afterRender",e)}async runOnError(e){for(let t of this.sortedPlugins)if(t.onError)try{let r=await t.onError(e);if(r){if(r.template!==void 0)e.template=r.template;if(r.context)e.context={...e.context,...r.context};if(r.metadata)e.metadata={...e.metadata,...r.metadata};if(r.skip)return e}}catch(r){console.error(`Error in plugin "${t.name}" onError hook:`,r)}return null}sortPlugins(){this.sortedPlugins=Array.from(this.plugins.values()).sort((e,t)=>(e.priority??100)-(t.priority??100))}async runHooks(e,t){let r={...t};for(let i of this.sortedPlugins){let s=i[e];if(s)try{let n=await s(r);if(n){if(n.template!==void 0)r.template=n.template;if(n.context)r.context={...r.context,...n.context};if(n.metadata)r.metadata={...r.metadata,...n.metadata};if(n.skip)break}}catch(n){console.error(`Error in plugin "${i.name}" ${e} hook:`,n)}}return r}async runDirectiveHooks(e,t,r){let i={...r};for(let s of this.sortedPlugins){let n=s[e];if(n)try{let o=await n(t,i);if(o){if(o.template!==void 0)i.template=o.template;if(o.context)i.context={...i.context,...o.context};if(o.metadata)i.metadata={...i.metadata,...o.metadata};if(o.skip)break}}catch(o){console.error(`Error in plugin "${s.name}" ${e} hook:`,o)}}return i}}var ym=new a;var u=ha({name:"stx-debug",version:"1.0.0",description:"Logs all plugin lifecycle events for debugging",priority:0,beforeProcess(e){console.log("[stx-debug] beforeProcess:",e.filePath)},afterParse(e){console.log("[stx-debug] afterParse:",e.template.length,"chars")},beforeDirective(e,t){console.log("[stx-debug] beforeDirective:",e)},afterDirective(e,t){console.log("[stx-debug] afterDirective:",e)},beforeRender(e){console.log("[stx-debug] beforeRender")},afterRender(e){console.log("[stx-debug] afterRender:",e.template.length,"chars")},onError(e){console.error("[stx-debug] onError:",e.error.message,"in phase:",e.phase)}}),l=ha({name:"stx-timing",version:"1.0.0",description:"Measures template processing time",priority:1,beforeProcess(e){e.metadata.startTime=performance.now()},afterRender(e){let t=e.metadata.startTime;if(t){let r=performance.now()-t;console.log(`[stx-timing] Processing took ${r.toFixed(2)}ms`)}}});export{ha,ym};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{x}from"./chunk-8ttmzcxb.js";function Ze(e,r){let n=y(e,r);return n.ok?{expression:n.expression,endPos:n.endPos}:null}function y(e,r){let n=r;while(n<e.length&&/\s/.test(e[n]))n++;if(e[n]!=="(")return{ok:!1,reason:"missing-open-paren",pos:n};let c=x(e,"(",")",n);if(c===-1)return{ok:!1,reason:"unclosed-paren",pos:n};return{ok:!0,expression:e.slice(n+1,c),endPos:c+1}}function k(e,r){let n=e.lastIndexOf("<",r);if(n===-1)return!1;return n>e.lastIndexOf(">",r)}function vt(e,r,n,c){let o=1,i=c,u=new RegExp(`@${r}\\s*\\(`,"g"),a=new RegExp(`@${n}(?![a-z])`,"g");while(i<e.length&&o>0){u.lastIndex=i,a.lastIndex=i;let p=u.exec(e),t=a.exec(e),s=p?p.index:1/0,f=t?t.index:1/0;if(s<f)o++,i=s+p[0].length;else if(f<1/0){if(o--,o===0)return f;i=f+t[0].length}else break}return-1}function v(e,r){let n=e.slice(r).match(/^@if\s*/);if(!n)return null;let c=r+n[0].length,o=Ze(e,c);if(!o)return null;let i=o.endPos,u=vt(e,"if","endif",i);if(u===-1)return null;let a=e.slice(i,u),p=[],t=0,s="if",f=o.expression,l=0,g=0;while(t<a.length){let h=a.indexOf("@",t);if(h===-1)break;t=h;let d=a.substring(h);if(k(a,h)){t++;continue}if(/^@if\s*\(/.test(d)){g++,t++;continue}if(/^@endif(?![a-z])/.test(d)){g--,t+=6;continue}if(g===0){let b=d.match(/^@elseif\s*/);if(b){p.push({type:s,condition:f,content:a.substring(l,t),start:i+l,end:i+t});let E=t+b[0].length,m=Ze(a,E);if(!m){t++;continue}s="elseif",f=m.expression,t=m.endPos,l=t;continue}else if(/^@else(?![a-z])/.test(d)){p.push({type:s,condition:f,content:a.substring(l,t),start:i+l,end:i+t}),s="else",f=void 0,t+=5,l=t;continue}}t++}return p.push({type:s,condition:f,content:a.slice(l),start:i+l,end:i+a.length}),{fullMatch:e.slice(r,u+6),branches:p,start:r,end:u+6}}function ln(e){let r=[],n=/@if\s*\(/g,c=n.exec(e);while(c!==null){if(r.some((u)=>c.index>u.start&&c.index<u.end)){c=n.exec(e);continue}let i=v(e,c.index);if(i)r.push(i),n.lastIndex=i.end;c=n.exec(e)}return r}function bs(e,r,n){let c=[],o=new RegExp(`@${r}\\s*\\(`,"g"),i=o.exec(e);while(i!==null){if(c.some((d)=>i.index>d.start&&i.index<d.end)){i=o.exec(e);continue}let a=i.index,p=a+i[0].length-1,t=x(e,"(",")",p);if(t===-1){i=o.exec(e);continue}let s=e.slice(p+1,t),f=t+1,l=vt(e,r,n,f);if(l===-1){i=o.exec(e);continue}let g=e.slice(f,l),h=l+`@${n}`.length;c.push({fullMatch:e.slice(a,h),name:r,params:s,content:g,start:a,end:h}),o.lastIndex=h,i=o.exec(e)}return c}function Ko(e,r){let n=e.slice(r).match(/^@switch\s*/);if(!n)return null;let c=r+n[0].length,o=Ze(e,c);if(!o)return null;let i=o.endPos,u=vt(e,"switch","endswitch",i);if(u===-1)return null;let a=e.slice(i,u),p=[],t=0,s=null,f=0;while(t<a.length){let l=a.slice(t),g=l.match(/^@switch\s*\(/),h=l.match(/^@endswitch(?![a-z])/);if(g){if(f++,s)s.content+=g[0];t+=g[0].length;continue}if(h){if(f--,s)s.content+=h[0];t+=h[0].length;continue}if(f>0){if(s)s.content+=a[t];t++;continue}let d=l.match(/^@case\s*/),b=l.match(/^@default(?![a-z])/),E=l.match(/^@break(?![a-z])/);if(d&&l.startsWith("@case")){if(s)p.push(s);let m=t+d[0].length,P=Ze(a,m);if(!P){t++;continue}s={type:"case",value:P.expression,content:""},t=P.endPos}else if(b&&l.startsWith("@default")){if(s)p.push(s);s={type:"default",content:""},t+=b[0].length}else if(E&&l.startsWith("@break"))t+=E[0].length;else{if(s)s.content+=a[t];t++}}if(s)p.push(s);return{fullMatch:e.slice(r,u+10),expression:o.expression,cases:p,start:r,end:u+10}}export{Ze,vt,ln,bs,Ko};
2
+ import{x}from"./chunk-c9mdvpf5.js";function Qe(e,r){let n=y(e,r);return n.ok?{expression:n.expression,endPos:n.endPos}:null}function y(e,r){let n=r;while(n<e.length&&/\s/.test(e[n]))n++;if(e[n]!=="(")return{ok:!1,reason:"missing-open-paren",pos:n};let c=x(e,"(",")",n);if(c===-1)return{ok:!1,reason:"unclosed-paren",pos:n};return{ok:!0,expression:e.slice(n+1,c),endPos:c+1}}function k(e,r){let n=e.lastIndexOf("<",r);if(n===-1)return!1;return n>e.lastIndexOf(">",r)}function xt(e,r,n,c){let o=1,i=c,u=new RegExp(`@${r}\\s*\\(`,"g"),a=new RegExp(`@${n}(?![a-z])`,"g");while(i<e.length&&o>0){u.lastIndex=i,a.lastIndex=i;let p=u.exec(e),t=a.exec(e),s=p?p.index:1/0,f=t?t.index:1/0;if(s<f)o++,i=s+p[0].length;else if(f<1/0){if(o--,o===0)return f;i=f+t[0].length}else break}return-1}function v(e,r){let n=e.slice(r).match(/^@if\s*/);if(!n)return null;let c=r+n[0].length,o=Qe(e,c);if(!o)return null;let i=o.endPos,u=xt(e,"if","endif",i);if(u===-1)return null;let a=e.slice(i,u),p=[],t=0,s="if",f=o.expression,l=0,g=0;while(t<a.length){let h=a.indexOf("@",t);if(h===-1)break;t=h;let d=a.substring(h);if(k(a,h)){t++;continue}if(/^@if\s*\(/.test(d)){g++,t++;continue}if(/^@endif(?![a-z])/.test(d)){g--,t+=6;continue}if(g===0){let b=d.match(/^@elseif\s*/);if(b){p.push({type:s,condition:f,content:a.substring(l,t),start:i+l,end:i+t});let E=t+b[0].length,m=Qe(a,E);if(!m){t++;continue}s="elseif",f=m.expression,t=m.endPos,l=t;continue}else if(/^@else(?![a-z])/.test(d)){p.push({type:s,condition:f,content:a.substring(l,t),start:i+l,end:i+t}),s="else",f=void 0,t+=5,l=t;continue}}t++}return p.push({type:s,condition:f,content:a.slice(l),start:i+l,end:i+a.length}),{fullMatch:e.slice(r,u+6),branches:p,start:r,end:u+6}}function un(e){let r=[],n=/@if\s*\(/g,c=n.exec(e);while(c!==null){if(r.some((u)=>c.index>u.start&&c.index<u.end)){c=n.exec(e);continue}let i=v(e,c.index);if(i)r.push(i),n.lastIndex=i.end;c=n.exec(e)}return r}function bs(e,r,n){let c=[],o=new RegExp(`@${r}\\s*\\(`,"g"),i=o.exec(e);while(i!==null){if(c.some((d)=>i.index>d.start&&i.index<d.end)){i=o.exec(e);continue}let a=i.index,p=a+i[0].length-1,t=x(e,"(",")",p);if(t===-1){i=o.exec(e);continue}let s=e.slice(p+1,t),f=t+1,l=xt(e,r,n,f);if(l===-1){i=o.exec(e);continue}let g=e.slice(f,l),h=l+`@${n}`.length;c.push({fullMatch:e.slice(a,h),name:r,params:s,content:g,start:a,end:h}),o.lastIndex=h,i=o.exec(e)}return c}function Xo(e,r){let n=e.slice(r).match(/^@switch\s*/);if(!n)return null;let c=r+n[0].length,o=Qe(e,c);if(!o)return null;let i=o.endPos,u=xt(e,"switch","endswitch",i);if(u===-1)return null;let a=e.slice(i,u),p=[],t=0,s=null,f=0;while(t<a.length){let l=a.slice(t),g=l.match(/^@switch\s*\(/),h=l.match(/^@endswitch(?![a-z])/);if(g){if(f++,s)s.content+=g[0];t+=g[0].length;continue}if(h){if(f--,s)s.content+=h[0];t+=h[0].length;continue}if(f>0){if(s)s.content+=a[t];t++;continue}let d=l.match(/^@case\s*/),b=l.match(/^@default(?![a-z])/),E=l.match(/^@break(?![a-z])/);if(d&&l.startsWith("@case")){if(s)p.push(s);let m=t+d[0].length,P=Qe(a,m);if(!P){t++;continue}s={type:"case",value:P.expression,content:""},t=P.endPos}else if(b&&l.startsWith("@default")){if(s)p.push(s);s={type:"default",content:""},t+=b[0].length}else if(E&&l.startsWith("@break"))t+=E[0].length;else{if(s)s.content+=a[t];t++}}if(s)p.push(s);return{fullMatch:e.slice(r,u+10),expression:o.expression,cases:p,start:r,end:u+10}}export{Qe,xt,un,bs,Xo};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ee,te,ne,Mn,he,$e,Kr,ql,mt,Gt,Dn,Ln,jn,re,Bn,Fn,Xr}from"./chunk-m9bbhg46.js";import"./chunk-s53wjw7y.js";export{te as DEFAULT_FORMATS,ne as DEFAULT_QUALITY,ee as DEFAULT_WIDTHS,Xr as ImageProcessingError,Fn as formatSize,Gt as generateSizes,mt as generateSrcSet,Dn as getFallbackVariant,Kr as getImageMetadata,re as getMimeType,Bn as getTotalSize,Ln as groupVariantsByFormat,he as isImageBackendAvailable,jn as isImageFile,Mn as isSharpAvailable,$e as processImage,ql as resizeAndConvert};
@@ -1,14 +1,14 @@
1
1
  // @bun
2
- import{fr}from"./chunk-qj4r08jb.js";import{Tr}from"./chunk-8ttmzcxb.js";import{a}from"./chunk-rptnx3s6.js";import{j,Ye}from"./chunk-cmnze7at.js";import{pc}from"./chunk-7yb82rm6.js";var p=/<style\b[^>]*>/iy,x=/<\/style>/gi,R=/<script\b[^>]*>/iy,b=/<template(?=[\s>/])[^>]*>/iy,S=/<\/template\s*>/iy;function ar(e){let r=0,t=0,s=-1;while(r<e.length){let n=e.indexOf("<",r);if(n===-1)return-1;if(e.startsWith("<!--",n)){let d=e.indexOf("-->",n+4);r=d===-1?e.length:d+3;continue}p.lastIndex=n;let c=p.exec(e);if(c){x.lastIndex=n+c[0].length;let d=x.exec(e);r=d===null?e.length:d.index+8;continue}b.lastIndex=n;let o=b.exec(e);if(o){if(t===0)s=n;t++,r=n+o[0].length;continue}S.lastIndex=n;let u=S.exec(e);if(u){if(t>0)t--;r=n+u[0].length;continue}if(R.lastIndex=n,R.test(e))return t>0?s:n;r=n+1}return-1}function X(e,r={}){return new fr(e,r).routes}import w from"path";var y=new Map;async function h(e,r){let t=e,s=r;if(!t||!s)try{let u=await a();t||=u?.pagesDir||"pages",s||=u?.root||"."}catch{t||="pages",s||="."}let n=w.isAbsolute(t)?t:w.join(s,t),c=y.get(n);if(c)return c;let o=[];try{o=X(".",{pagesDir:n,emit:!1}).map((u)=>u.regex.source).filter(Boolean)}catch{o=[]}return y.set(n,o),o}function O(e){return e.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function g(e){return O(JSON.stringify(e))}function be(e){return e.includes("data-stx-runtime")}function uc(e){let r=/window\.stx\s*\.\s*[A-Za-z_$]|\}\s*=\s*window\.stx\s*;/g;for(let t=r.exec(e);t!==null;t=r.exec(e)){let s=e.slice(Math.max(0,t.index-80),t.index);if(/if\s*\(\s*window\.stx\s*\)|window\.stx\s*&&/.test(s))continue;return!0}return!1}function l(e,r){let t=ar(e),s=e.search(/<!doctype\b/i);if(t!==-1&&(s===-1||t>s))return e.slice(0,t)+r+`
2
+ import{fr}from"./chunk-mxvevxb8.js";import{Tr}from"./chunk-c9mdvpf5.js";import{a}from"./chunk-pj2t51hn.js";import{B,Ze}from"./chunk-ybq56wam.js";import{fc}from"./chunk-2x9zhezb.js";var p=/<style\b[^>]*>/iy,x=/<\/style>/gi,R=/<script\b[^>]*>/iy,b=/<template(?=[\s>/])[^>]*>/iy,S=/<\/template\s*>/iy;function ar(e){let r=0,t=0,s=-1;while(r<e.length){let n=e.indexOf("<",r);if(n===-1)return-1;if(e.startsWith("<!--",n)){let d=e.indexOf("-->",n+4);r=d===-1?e.length:d+3;continue}p.lastIndex=n;let c=p.exec(e);if(c){x.lastIndex=n+c[0].length;let d=x.exec(e);r=d===null?e.length:d.index+8;continue}b.lastIndex=n;let o=b.exec(e);if(o){if(t===0)s=n;t++,r=n+o[0].length;continue}S.lastIndex=n;let u=S.exec(e);if(u){if(t>0)t--;r=n+u[0].length;continue}if(R.lastIndex=n,R.test(e))return t>0?s:n;r=n+1}return-1}function G(e,r={}){return new fr(e,r).routes}import w from"path";var y=new Map;async function h(e,r){let t=e,s=r;if(!t||!s)try{let u=await a();t||=u?.pagesDir||"pages",s||=u?.root||"."}catch{t||="pages",s||="."}let n=w.isAbsolute(t)?t:w.join(s,t),c=y.get(n);if(c)return c;let o=[];try{o=G(".",{pagesDir:n,emit:!1}).map((u)=>u.regex.source).filter(Boolean)}catch{o=[]}return y.set(n,o),o}function O(e){return e.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function g(e){return O(JSON.stringify(e))}function we(e){return e.includes("data-stx-runtime")}function dc(e){let r=/window\.stx\s*\.\s*[A-Za-z_$]|\}\s*=\s*window\.stx\s*;/g;for(let t=r.exec(e);t!==null;t=r.exec(e)){let s=e.slice(Math.max(0,t.index-80),t.index);if(/if\s*\(\s*window\.stx\s*\)|window\.stx\s*&&/.test(s))continue;return!0}return!1}function l(e,r){let t=ar(e),s=e.search(/<!doctype\b/i);if(t!==-1&&(s===-1||t>s))return e.slice(0,t)+r+`
3
3
  `+e.slice(t);let n=Tr(e);if(n!==null)return`${e.slice(0,n)}
4
4
  ${r}${e.slice(n)}`;if(e.includes("</head>")){let o=e.indexOf("</head>");return e.slice(0,o)+r+`
5
- `+e.slice(o)}if(j(e))return Ye(e,(o)=>`${o}
5
+ `+e.slice(o)}if(B(e))return Ze(e,(o)=>`${o}
6
6
  ${r}`);return`${r}
7
- ${e}`}async function cr(e,r){if(e.includes("data-stx-runtime")||e.includes("window.stx.state")||e.includes("STX Signals Runtime"))return e;if(r.buildMode==="serve"){let{getServeClientAsset:n}=await import("./chunk-4zjxj8ex.js"),{url:c}=await n("runtime",r.debug===!0);return l(e,`<script data-stx-runtime src="${c}"></script>`)}if(r.buildMode==="compile")return l(e,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:t}=await import("./chunk-4zjxj8ex.js"),s=await t(r.debug);return l(e,`<script data-stx-scoped data-stx-runtime>${s}</script>`)}function m(e){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test(e)}function dc(e){if(e.includes("data-stx-tooltip-runtime")||!m(e))return e;let r=`<script data-stx-scoped data-stx-tooltip-runtime>${pc()}</script>`,t=e.lastIndexOf("</body>");if(t===-1)return`${e}
7
+ ${e}`}async function cr(e,r){if(e.includes("data-stx-runtime")||e.includes("window.stx.state")||e.includes("STX Signals Runtime"))return e;if(r.buildMode==="serve"){let{getServeClientAsset:n}=await import("./chunk-s5bwrq6g.js"),{url:c}=await n("runtime",r.debug===!0);return l(e,`<script data-stx-runtime src="${c}"></script>`)}if(r.buildMode==="compile")return l(e,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:t}=await import("./chunk-s5bwrq6g.js"),s=await t(r.debug);return l(e,`<script data-stx-scoped data-stx-runtime>${s}</script>`)}function m(e){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test(e)}function pc(e){if(e.includes("data-stx-tooltip-runtime")||!m(e))return e;let r=`<script data-stx-scoped data-stx-tooltip-runtime>${fc()}</script>`,t=e.lastIndexOf("</body>");if(t===-1)return`${e}
8
8
  ${r}`;return`${e.slice(0,t)}${r}
9
- ${e.slice(t)}`}var E=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function C(e){return E.test(e)||e.includes("__stxRouter)return")||e.includes("__stxRouter=true")}async function we(e,r){if(!e.includes("</body>"))return e;if(C(e))return e;let t=r?.router,s="",n="";{let i={};if(t){if(t.container)i.container=t.container;if(t.interceptAllLinks!==void 0)i.interceptAllLinks=t.interceptAllLinks;if(t.progress!==void 0)i.progress=t.progress;if(t.viewTransitions!==void 0)i.viewTransitions=t.viewTransitions;if(t.viewTransitionDuration!==void 0)i.viewTransitionDuration=t.viewTransitionDuration;if(t.viewTransitionEasing!==void 0)i.viewTransitionEasing=t.viewTransitionEasing;if(t.scrollToTop!==void 0)i.scrollToTop=t.scrollToTop;if(t.scrollRestoration!==void 0)i.scrollRestoration=t.scrollRestoration;if(t.prefetch!==void 0)i.prefetch=t.prefetch;if(t.cache!==void 0)i.cache=t.cache;if(t.progressColor!==void 0)i.progressColor=t.progressColor;if(t.progressHeight!==void 0)i.progressHeight=t.progressHeight;if(t.prefetchVisible!==void 0)i.prefetchVisible=t.prefetchVisible;if(t.prefetchVisibleMax!==void 0)i.prefetchVisibleMax=t.prefetchVisibleMax;if(t.prefetchBudgetBytes!==void 0)i.prefetchBudgetBytes=t.prefetchBudgetBytes;if(t.keepOpening!==void 0)i.keepOpening=t.keepOpening}try{let f=await h(r?.pagesDir,r?.root);if(f.length>0)if(r?.buildMode==="serve"){let{registerServeModuleBundle:T}=await import("./chunk-4zjxj8ex.js");n=`<script data-stx-owned-routes src="${T(`(window.__stxRouterConfig=window.__stxRouterConfig||{}).ownedRoutes=${g(f)};
9
+ ${e.slice(t)}`}var E=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function C(e){return E.test(e)||e.includes("__stxRouter)return")||e.includes("__stxRouter=true")}async function ve(e,r){if(!e.includes("</body>"))return e;if(C(e))return e;let t=r?.router,s="",n="";{let i={};if(t){if(t.container)i.container=t.container;if(t.interceptAllLinks!==void 0)i.interceptAllLinks=t.interceptAllLinks;if(t.progress!==void 0)i.progress=t.progress;if(t.viewTransitions!==void 0)i.viewTransitions=t.viewTransitions;if(t.viewTransitionDuration!==void 0)i.viewTransitionDuration=t.viewTransitionDuration;if(t.viewTransitionEasing!==void 0)i.viewTransitionEasing=t.viewTransitionEasing;if(t.scrollToTop!==void 0)i.scrollToTop=t.scrollToTop;if(t.scrollRestoration!==void 0)i.scrollRestoration=t.scrollRestoration;if(t.prefetch!==void 0)i.prefetch=t.prefetch;if(t.cache!==void 0)i.cache=t.cache;if(t.progressColor!==void 0)i.progressColor=t.progressColor;if(t.progressHeight!==void 0)i.progressHeight=t.progressHeight;if(t.prefetchVisible!==void 0)i.prefetchVisible=t.prefetchVisible;if(t.prefetchVisibleMax!==void 0)i.prefetchVisibleMax=t.prefetchVisibleMax;if(t.prefetchBudgetBytes!==void 0)i.prefetchBudgetBytes=t.prefetchBudgetBytes;if(t.keepOpening!==void 0)i.keepOpening=t.keepOpening}try{let f=await h(r?.pagesDir,r?.root);if(f.length>0)if(r?.buildMode==="serve"){let{registerServeModuleBundle:T}=await import("./chunk-s5bwrq6g.js");n=`<script data-stx-owned-routes src="${T(`(window.__stxRouterConfig=window.__stxRouterConfig||{}).ownedRoutes=${g(f)};
10
10
  `)}"></script>
11
11
  `}else i.ownedRoutes=f}catch{}if(Object.keys(i).length>0)s=`<script>window.__stxRouterConfig=${g(i)};</script>
12
- `}let{getCachedRouterScript:c,getServeClientAsset:o}=await import("./chunk-4zjxj8ex.js"),u=r?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':r?.buildMode==="serve"?`<script data-stx-router src="${(await o("router")).url}"></script>`:`<script data-stx-router>${await c()}</script>`,d=e.lastIndexOf("</body>");return e.slice(0,d)+s+n+u+`
12
+ `}let{getCachedRouterScript:c,getServeClientAsset:o}=await import("./chunk-s5bwrq6g.js"),u=r?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':r?.buildMode==="serve"?`<script data-stx-router src="${(await o("router")).url}"></script>`:`<script data-stx-router>${await c()}</script>`,d=e.lastIndexOf("</body>");return e.slice(0,d)+s+n+u+`
13
13
  </body>`+e.slice(d+7)}
14
- export{ar,X,be,uc,cr,dc,we};
14
+ export{ar,G,we,dc,cr,pc,ve};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- var w={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",brightRed:"\x1B[91m",brightGreen:"\x1B[92m",brightYellow:"\x1B[93m",brightBlue:"\x1B[94m",brightMagenta:"\x1B[95m",brightCyan:"\x1B[96m",brightWhite:"\x1B[97m"},R={bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",inverse:"\x1B[7m",strikethrough:"\x1B[9m"};function p(e,t){return`${w[t]}${e}\x1B[0m`}function C(e,t){return`${R[t]}${e}\x1B[0m`}var b=(e)=>p(e,"red"),S=(e)=>p(e,"green"),y=(e)=>p(e,"yellow"),O=(e)=>p(e,"blue");var c=(e)=>p(e,"cyan");var a=(e)=>C(e,"bold"),m=(e)=>C(e,"dim");function Vt(){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" \uD83D\uDCD6 STX Story ")+c("\u2551")),console.log(c(" \u2551")+m(" Component Showcase & Testing ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log("")}function no(e,t){if(console.log(a(" Server running at:")),console.log(""),console.log(` ${m("\u279C")} ${a("Local:")} ${c(e)}`),t)console.log(` ${m("\u279C")} ${a("Network:")} ${c(t)}`);console.log("")}function Ut(e){let t=e>0?"\u2713":"\u25CB",r=e>0?S:y;console.log(` ${r(t)} Found ${a(String(e))} story ${e===1?"file":"files"}`)}function Ui(e,t){if(console.log(""),console.log(` ${b("\u2717")} ${a(b("Error:"))} ${e}`),t)console.log(` ${m(t)}`);console.log("")}function ct(e){console.log(` ${y("\u26A0")} ${y("Warning:")} ${e}`)}function Wi(e){console.log(` ${O("\u2139")} ${e}`)}function qi(e,t,r){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" Build Complete ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log(""),console.log(` ${S("\u2713")} Stories: ${a(String(e))}`),console.log(` ${S("\u2713")} Output: ${a(t)}`),console.log(` ${S("\u2713")} Time: ${a(`${r}ms`)}`),console.log("")}function ro(){console.log(""),console.log(a(" Keyboard Shortcuts:")),console.log(""),console.log(` ${c("h")} Show this help`),console.log(` ${c("o")} Open in browser`),console.log(` ${c("r")} Restart server`),console.log(` ${c("c")} Clear console`),console.log(` ${c("q")} Quit`),console.log("")}import h from"fs";import d from"path";async function Wt(e){let{root:t,config:r}=e,o=[],i=await P(t,r.storyMatch,r.storyIgnored);for(let s of i){let n=d.resolve(t,s),l=v(s,n);o.push(l)}return o}async function P(e,t,r){let o=[];async function i(s,n){let l=await h.promises.readdir(s,{withFileTypes:!0});for(let g of l){let f=d.join(s,g.name),u=d.relative(n,f);if(T(u,r))continue;if(g.isDirectory())await i(f,n);else if(g.isFile()){if(F(u,t))o.push(u)}}}return await i(e,e),o}function T(e,t){for(let r of t)if(E(e,r))return!0;return!1}function F(e,t){for(let r of t)if(E(e,r))return!0;return!1}function E(e,t){let r=e.replace(/\\/g,"/"),i=t.replace(/\\/g,"/").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"{{GLOBSTAR}}").replace(/\*/g,"[^/]*").replace(/\?/g,".").replace(/\{\{GLOBSTAR\}\}/g,".*");return i=`^${i}$`,new RegExp(i).test(r)}function v(e,t){let r=d.basename(e,".story.stx");return{id:e.toLowerCase().replace(/\.story\.stx$/,"").replace(/[/\\]/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),path:t,relativePath:e,fileName:r,treeFile:{title:r,path:e}}}function Ki(e,t){let{root:r,config:o}=e,i=[],s=h.watch(r,{recursive:!0},async(n,l)=>{if(!l)return;let g=l.replace(/\\/g,"/");if(!F(g,o.storyMatch))return;if(T(g,o.storyIgnored))return;let f=d.resolve(r,g);try{await h.promises.access(f);let u=v(g,f);t(n==="rename"?"add":"change",u)}catch{let u=v(g,f);t("unlink",u)}});return i.push(s),()=>{for(let n of i)n.close()}}function N(e,t){let r=t.treeFile||{title:t.fileName,path:t.relativePath};if(e.tree.file==="title")return r.title.split("/");if(e.tree.file==="path")return[...t.relativePath.split("/").slice(0,-1),r.title];if(typeof e.tree.file==="function")return e.tree.file(r);return[r.title]}function qt(e,t){for(let n of t)n.treePath=N(e,n);let r=(e.tree.groups||[]).map((n)=>({groupConfig:{id:n.id||n.title,title:n.title,include:n.include},treeObject:{}})),o={treeObject:{}};r.push(o);for(let n=0;n<t.length;n++){let l=t[n],g=j(l,r,o);k(l.treePath,n,g.treeObject)}let i=e.tree.order==="asc"?(n,l)=>n.localeCompare(l):e.tree.order,s=[];for(let n of r)if(n===o)s.push(...x(n.treeObject,i));else if(n.groupConfig&&Object.keys(n.treeObject).length>0)s.push({group:!0,id:n.groupConfig.id,title:n.groupConfig.title,children:x(n.treeObject,i)});return s}function j(e,t,r){let o=e.treeFile||{title:e.fileName,path:e.relativePath};for(let i of t)if(i.groupConfig?.include&&i.groupConfig.include(o))return i;return r}function k(e,t,r){let o=r;for(let i=0;i<e.length;i++){let s=e[i];if(i===e.length-1)if(o[s]!==void 0){let l=1;while(o[`${s}-${l}`]!==void 0)l++;o[`${s}-${l}`]=t}else o[s]=t;else{if(o[s]===void 0)o[s]={};else if(typeof o[s]==="number"){let l=o[s];o[s]={"":l}}o=o[s]}}}function x(e,t){let r=[];for(let[o,i]of Object.entries(e))if(typeof i==="number")r.push({title:o,index:i});else r.push({title:o,children:x(i,t)});return r.sort((o,i)=>t(o.title,i.title)),r}
3
- export{Vt,no,Ut,Ui,ct,Wi,qi,ro,Wt,Ki,qt};
2
+ var w={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",brightRed:"\x1B[91m",brightGreen:"\x1B[92m",brightYellow:"\x1B[93m",brightBlue:"\x1B[94m",brightMagenta:"\x1B[95m",brightCyan:"\x1B[96m",brightWhite:"\x1B[97m"},R={bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",inverse:"\x1B[7m",strikethrough:"\x1B[9m"};function p(e,t){return`${w[t]}${e}\x1B[0m`}function C(e,t){return`${R[t]}${e}\x1B[0m`}var b=(e)=>p(e,"red"),S=(e)=>p(e,"green"),y=(e)=>p(e,"yellow"),O=(e)=>p(e,"blue");var c=(e)=>p(e,"cyan");var a=(e)=>C(e,"bold"),m=(e)=>C(e,"dim");function Ut(){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" \uD83D\uDCD6 STX Story ")+c("\u2551")),console.log(c(" \u2551")+m(" Component Showcase & Testing ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log("")}function no(e,t){if(console.log(a(" Server running at:")),console.log(""),console.log(` ${m("\u279C")} ${a("Local:")} ${c(e)}`),t)console.log(` ${m("\u279C")} ${a("Network:")} ${c(t)}`);console.log("")}function Wt(e){let t=e>0?"\u2713":"\u25CB",r=e>0?S:y;console.log(` ${r(t)} Found ${a(String(e))} story ${e===1?"file":"files"}`)}function Wi(e,t){if(console.log(""),console.log(` ${b("\u2717")} ${a(b("Error:"))} ${e}`),t)console.log(` ${m(t)}`);console.log("")}function lt(e){console.log(` ${y("\u26A0")} ${y("Warning:")} ${e}`)}function qi(e){console.log(` ${O("\u2139")} ${e}`)}function Ki(e,t,r){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" Build Complete ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log(""),console.log(` ${S("\u2713")} Stories: ${a(String(e))}`),console.log(` ${S("\u2713")} Output: ${a(t)}`),console.log(` ${S("\u2713")} Time: ${a(`${r}ms`)}`),console.log("")}function ro(){console.log(""),console.log(a(" Keyboard Shortcuts:")),console.log(""),console.log(` ${c("h")} Show this help`),console.log(` ${c("o")} Open in browser`),console.log(` ${c("r")} Restart server`),console.log(` ${c("c")} Clear console`),console.log(` ${c("q")} Quit`),console.log("")}import h from"fs";import d from"path";async function qt(e){let{root:t,config:r}=e,o=[],i=await P(t,r.storyMatch,r.storyIgnored);for(let s of i){let n=d.resolve(t,s),l=v(s,n);o.push(l)}return o}async function P(e,t,r){let o=[];async function i(s,n){let l=await h.promises.readdir(s,{withFileTypes:!0});for(let g of l){let f=d.join(s,g.name),u=d.relative(n,f);if(T(u,r))continue;if(g.isDirectory())await i(f,n);else if(g.isFile()){if(F(u,t))o.push(u)}}}return await i(e,e),o}function T(e,t){for(let r of t)if(E(e,r))return!0;return!1}function F(e,t){for(let r of t)if(E(e,r))return!0;return!1}function E(e,t){let r=e.replace(/\\/g,"/"),i=t.replace(/\\/g,"/").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"{{GLOBSTAR}}").replace(/\*/g,"[^/]*").replace(/\?/g,".").replace(/\{\{GLOBSTAR\}\}/g,".*");return i=`^${i}$`,new RegExp(i).test(r)}function v(e,t){let r=d.basename(e,".story.stx");return{id:e.toLowerCase().replace(/\.story\.stx$/,"").replace(/[/\\]/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),path:t,relativePath:e,fileName:r,treeFile:{title:r,path:e}}}function Xi(e,t){let{root:r,config:o}=e,i=[],s=h.watch(r,{recursive:!0},async(n,l)=>{if(!l)return;let g=l.replace(/\\/g,"/");if(!F(g,o.storyMatch))return;if(T(g,o.storyIgnored))return;let f=d.resolve(r,g);try{await h.promises.access(f);let u=v(g,f);t(n==="rename"?"add":"change",u)}catch{let u=v(g,f);t("unlink",u)}});return i.push(s),()=>{for(let n of i)n.close()}}function N(e,t){let r=t.treeFile||{title:t.fileName,path:t.relativePath};if(e.tree.file==="title")return r.title.split("/");if(e.tree.file==="path")return[...t.relativePath.split("/").slice(0,-1),r.title];if(typeof e.tree.file==="function")return e.tree.file(r);return[r.title]}function Kt(e,t){for(let n of t)n.treePath=N(e,n);let r=(e.tree.groups||[]).map((n)=>({groupConfig:{id:n.id||n.title,title:n.title,include:n.include},treeObject:{}})),o={treeObject:{}};r.push(o);for(let n=0;n<t.length;n++){let l=t[n],g=j(l,r,o);k(l.treePath,n,g.treeObject)}let i=e.tree.order==="asc"?(n,l)=>n.localeCompare(l):e.tree.order,s=[];for(let n of r)if(n===o)s.push(...x(n.treeObject,i));else if(n.groupConfig&&Object.keys(n.treeObject).length>0)s.push({group:!0,id:n.groupConfig.id,title:n.groupConfig.title,children:x(n.treeObject,i)});return s}function j(e,t,r){let o=e.treeFile||{title:e.fileName,path:e.relativePath};for(let i of t)if(i.groupConfig?.include&&i.groupConfig.include(o))return i;return r}function k(e,t,r){let o=r;for(let i=0;i<e.length;i++){let s=e[i];if(i===e.length-1)if(o[s]!==void 0){let l=1;while(o[`${s}-${l}`]!==void 0)l++;o[`${s}-${l}`]=t}else o[s]=t;else{if(o[s]===void 0)o[s]={};else if(typeof o[s]==="number"){let l=o[s];o[s]={"":l}}o=o[s]}}}function x(e,t){let r=[];for(let[o,i]of Object.entries(e))if(typeof i==="number")r.push({title:o,index:i});else r.push({title:o,children:x(i,t)});return r.sort((o,i)=>t(o.title,i.title)),r}
3
+ export{Ut,no,Wt,Wi,lt,qi,Ki,ro,qt,Xi,Kt};