@stacksjs/stx 0.2.287 → 0.2.288

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 (179) hide show
  1. package/dist/{chunk-mf4n3x1j.js → chunk-02af607x.js} +1 -1
  2. package/dist/chunk-06706a9a.js +2 -0
  3. package/dist/chunk-0896td83.js +2 -0
  4. package/dist/chunk-08yja60e.js +2 -0
  5. package/dist/{chunk-6hmnaza7.js → chunk-13tawjw8.js} +10 -10
  6. package/dist/{chunk-71t0yan0.js → chunk-1e83cj7k.js} +1 -1
  7. package/dist/chunk-1g6pvs7k.js +11 -0
  8. package/dist/chunk-1gvebxh4.js +2 -0
  9. package/dist/{chunk-ferav3bw.js → chunk-1t9g3mhg.js} +2 -2
  10. package/dist/{chunk-ypmqf7tm.js → chunk-2e6xafcm.js} +1 -1
  11. package/dist/chunk-2rfxs7zm.js +2 -0
  12. package/dist/{chunk-qc1f74ek.js → chunk-2vza9m2x.js} +1 -1
  13. package/dist/{chunk-ccspd3mc.js → chunk-2wtn443n.js} +1 -1
  14. package/dist/{chunk-rbb7dvja.js → chunk-34qkshwh.js} +2 -2
  15. package/dist/{chunk-dgrt76d2.js → chunk-3br3pt6k.js} +1 -1
  16. package/dist/{chunk-kdh37tp8.js → chunk-3p0n9ryv.js} +1 -1
  17. package/dist/chunk-437n7hyx.js +2 -0
  18. package/dist/{chunk-de7fye10.js → chunk-461br5nn.js} +1 -1
  19. package/dist/chunk-4tr92e0v.js +2 -0
  20. package/dist/{chunk-t6nseeb9.js → chunk-4vpsvh6x.js} +1 -1
  21. package/dist/{chunk-k56rjjc0.js → chunk-5j9tvhpq.js} +2 -2
  22. package/dist/{chunk-zqqx1qaj.js → chunk-5yp3vt00.js} +1 -1
  23. package/dist/{chunk-kxzb4et3.js → chunk-5zcg61j9.js} +2 -2
  24. package/dist/{chunk-nkb3scg6.js → chunk-6085vha7.js} +1 -1
  25. package/dist/{chunk-wrzwgkbx.js → chunk-72c7gyqc.js} +3 -3
  26. package/dist/chunk-811cxzn4.js +2 -0
  27. package/dist/{chunk-g4vpzv6b.js → chunk-8883pgj8.js} +1 -1
  28. package/dist/{chunk-vqxmxgaj.js → chunk-8bxtvsgm.js} +1 -1
  29. package/dist/{chunk-fvhm8psm.js → chunk-8daczchh.js} +1 -1
  30. package/dist/chunk-91ffbzmh.js +2 -0
  31. package/dist/chunk-96cqevhm.js +2 -0
  32. package/dist/chunk-978faewt.js +2 -0
  33. package/dist/{chunk-866y9d8b.js → chunk-9veqmqb6.js} +1 -1
  34. package/dist/{chunk-7q9mwh4v.js → chunk-a668m28h.js} +1 -1
  35. package/dist/{chunk-pzm13sdc.js → chunk-a9fxxwrv.js} +2 -2
  36. package/dist/chunk-adkjxvy6.js +2 -0
  37. package/dist/{chunk-sscwkffs.js → chunk-agx0620p.js} +1 -1
  38. package/dist/chunk-ak06mywr.js +2 -0
  39. package/dist/chunk-ayaz0wcj.js +2 -0
  40. package/dist/{chunk-1kah92n2.js → chunk-bphx7ngb.js} +2 -2
  41. package/dist/chunk-bw48gj8j.js +2 -0
  42. package/dist/{chunk-csbgwaa5.js → chunk-byq2xpgb.js} +1 -1
  43. package/dist/chunk-bzsjhyet.js +2 -0
  44. package/dist/{chunk-acn1b56m.js → chunk-ch31zddx.js} +2 -2
  45. package/dist/chunk-cqzqfm7m.js +2 -0
  46. package/dist/{chunk-dhh5q7qt.js → chunk-d0f60jrg.js} +2 -2
  47. package/dist/{chunk-8mjdpr94.js → chunk-dcxtrqfy.js} +1 -1
  48. package/dist/{chunk-b6ej2fdf.js → chunk-drbbt69f.js} +35 -10
  49. package/dist/chunk-e0aybavh.js +2 -0
  50. package/dist/chunk-e63a220e.js +28 -0
  51. package/dist/chunk-e67w1bge.js +2 -0
  52. package/dist/chunk-e7kd0ny8.js +2 -0
  53. package/dist/{chunk-9wr7zcad.js → chunk-ee2tfpec.js} +2 -2
  54. package/dist/{chunk-9n0gvfrg.js → chunk-efr3ejqt.js} +1 -1
  55. package/dist/chunk-evfct6hb.js +2 -0
  56. package/dist/{chunk-5w1e3yxs.js → chunk-favq46aa.js} +1 -1
  57. package/dist/{chunk-19nfvxfw.js → chunk-fcfphfpw.js} +2 -2
  58. package/dist/{chunk-b8rrnqry.js → chunk-ffmtamm2.js} +1 -1
  59. package/dist/{chunk-5kk8gsj2.js → chunk-fv923f7g.js} +1 -1
  60. package/dist/{chunk-jr3jp3ev.js → chunk-fvh9ca47.js} +1 -1
  61. package/dist/chunk-fxk9j0rm.js +2 -0
  62. package/dist/{chunk-zg75gjns.js → chunk-gy933rct.js} +1 -1
  63. package/dist/{chunk-r3ayvdz3.js → chunk-h61qt916.js} +1 -1
  64. package/dist/{chunk-v5e1gxwm.js → chunk-h7v70dbp.js} +1 -1
  65. package/dist/{chunk-bz820epz.js → chunk-hmf9z4jx.js} +1 -1
  66. package/dist/{chunk-7b329e5v.js → chunk-hqh7x9h5.js} +2 -2
  67. package/dist/{chunk-h4xh8cms.js → chunk-hv5v6vc2.js} +2 -2
  68. package/dist/{chunk-xttsqmkm.js → chunk-jem20v5k.js} +1 -1
  69. package/dist/{chunk-pkaabd8h.js → chunk-jj6yp7gm.js} +1 -1
  70. package/dist/{chunk-1kms3b9d.js → chunk-jv91rkhx.js} +1 -1
  71. package/dist/{chunk-a0nfbmeh.js → chunk-jyc9eha6.js} +1 -1
  72. package/dist/{chunk-w3ycm4na.js → chunk-k0y7ta0d.js} +1 -1
  73. package/dist/chunk-k4jt9t4p.js +2 -0
  74. package/dist/{chunk-9y0g8kzt.js → chunk-k70fgb2f.js} +1 -1
  75. package/dist/{chunk-74cv4ta1.js → chunk-k78gvm0g.js} +1 -1
  76. package/dist/{chunk-x650vjcp.js → chunk-kb5j08tq.js} +1 -1
  77. package/dist/{chunk-qy73j6m4.js → chunk-kf8t2wq7.js} +1 -1
  78. package/dist/chunk-kfy1jh6p.js +2 -0
  79. package/dist/chunk-kws4rewx.js +17 -0
  80. package/dist/{chunk-nnd4wq8j.js → chunk-mc58fhgm.js} +1 -1
  81. package/dist/{chunk-n3ggrhb3.js → chunk-mjpqz66q.js} +1 -1
  82. package/dist/{chunk-xgnc1wy6.js → chunk-mmnqd035.js} +1 -1
  83. package/dist/{chunk-54st8g2j.js → chunk-mywp77gt.js} +1 -1
  84. package/dist/{chunk-qzkhpsam.js → chunk-n0j85038.js} +1 -1
  85. package/dist/{chunk-se0p17c2.js → chunk-n5y9gh1q.js} +1 -1
  86. package/dist/{chunk-btav940g.js → chunk-n9kk3jz1.js} +1 -1
  87. package/dist/{chunk-248e84r1.js → chunk-nmkra8q5.js} +1 -1
  88. package/dist/{chunk-1q4y74mh.js → chunk-np5dc1q1.js} +1 -1
  89. package/dist/chunk-nygtwffe.js +5 -0
  90. package/dist/{chunk-tndhnk9e.js → chunk-p0zq5ckb.js} +1 -1
  91. package/dist/chunk-pb16azfa.js +4 -0
  92. package/dist/{chunk-nx5qkm8k.js → chunk-ps20v1ah.js} +1 -1
  93. package/dist/chunk-pv9apyrr.js +2 -0
  94. package/dist/{chunk-y11cxbxd.js → chunk-qj2s3r1w.js} +154 -155
  95. package/dist/chunk-qjkzpd68.js +11 -0
  96. package/dist/chunk-qww39be9.js +2 -0
  97. package/dist/chunk-r90w3x6h.js +2 -0
  98. package/dist/chunk-rb87b7kr.js +2 -0
  99. package/dist/{chunk-qr82je1m.js → chunk-rjqfa3g8.js} +2 -2
  100. package/dist/{chunk-2tk1zkrz.js → chunk-sag55qv7.js} +1 -1
  101. package/dist/chunk-srcbkg7g.js +2 -0
  102. package/dist/chunk-sxderfaa.js +12 -0
  103. package/dist/{chunk-38ejahd9.js → chunk-t5c7rk0h.js} +1 -1
  104. package/dist/chunk-v2z3creg.js +2 -0
  105. package/dist/chunk-vtjfv7kg.js +2 -0
  106. package/dist/{chunk-mkd9kjgb.js → chunk-vvqe2gaz.js} +2 -2
  107. package/dist/{chunk-bfqfs07m.js → chunk-vwzqg4fh.js} +2 -2
  108. package/dist/{chunk-vrrax298.js → chunk-vxxxczmn.js} +1 -1
  109. package/dist/chunk-vzzkhjw7.js +2 -0
  110. package/dist/{chunk-wcm80anz.js → chunk-wvq1g6gr.js} +1 -1
  111. package/dist/{chunk-y7m2dpd3.js → chunk-wyxw61az.js} +1 -1
  112. package/dist/{chunk-rj4kajww.js → chunk-xpct12p7.js} +1 -1
  113. package/dist/chunk-xvndd7h6.js +2 -0
  114. package/dist/{chunk-dtq7y5ym.js → chunk-y5jjrnfa.js} +1 -1
  115. package/dist/{chunk-ya386h70.js → chunk-ym4ggcpy.js} +1 -1
  116. package/dist/{chunk-92mj1t26.js → chunk-ymc99r5x.js} +2 -2
  117. package/dist/{chunk-refwkt87.js → chunk-ynt7y2n5.js} +1 -1
  118. package/dist/chunk-z6azwfb4.js +2 -0
  119. package/dist/chunk-zfnabevq.js +2 -0
  120. package/dist/{chunk-y98jsjqq.js → chunk-zqwmy0av.js} +1 -1
  121. package/dist/{chunk-hcq5dw7a.js → chunk-zvw2qgwt.js} +1 -1
  122. package/dist/cli.js +14 -14
  123. package/dist/client-module-registry.d.ts +36 -0
  124. package/dist/client-module-registry.js +55 -0
  125. package/dist/client-script-bundler.d.ts +39 -0
  126. package/dist/client-script-bundler.js +89 -12
  127. package/dist/client-script.js +5 -18
  128. package/dist/craft-entry.js +1 -1
  129. package/dist/craft.js +1 -1
  130. package/dist/database.js +1 -1
  131. package/dist/process.js +24 -3
  132. package/dist/pwa.js +2 -2
  133. package/dist/signal-processing.js +5 -4
  134. package/dist/ssg.js +2 -2
  135. package/dist/store-loader.js +1 -1
  136. package/dist/strip-literals.d.ts +20 -0
  137. package/dist/strip-literals.js +16 -0
  138. package/dist/utils.js +1 -1
  139. package/dist/visual-testing.js +1 -1
  140. package/package.json +5 -5
  141. package/dist/chunk-122tyfre.js +0 -2
  142. package/dist/chunk-24ps8kft.js +0 -2
  143. package/dist/chunk-2et5hxfv.js +0 -2
  144. package/dist/chunk-2r1rd8f0.js +0 -2
  145. package/dist/chunk-3zv4wz87.js +0 -2
  146. package/dist/chunk-4122k1bh.js +0 -2
  147. package/dist/chunk-45az9zht.js +0 -2
  148. package/dist/chunk-4qr85f07.js +0 -2
  149. package/dist/chunk-4ww3znrr.js +0 -15
  150. package/dist/chunk-5a19dhx5.js +0 -2
  151. package/dist/chunk-6gdycmxr.js +0 -2
  152. package/dist/chunk-74v15e8z.js +0 -2
  153. package/dist/chunk-8fwerspy.js +0 -2
  154. package/dist/chunk-9b22663r.js +0 -2
  155. package/dist/chunk-9hjdgm4d.js +0 -2
  156. package/dist/chunk-awkq3xfx.js +0 -2
  157. package/dist/chunk-bs6kapy7.js +0 -2
  158. package/dist/chunk-d8t4sjsp.js +0 -2
  159. package/dist/chunk-dap191q2.js +0 -2
  160. package/dist/chunk-dsffsqnt.js +0 -2
  161. package/dist/chunk-g9csmj0s.js +0 -2
  162. package/dist/chunk-gtcrpmz1.js +0 -2
  163. package/dist/chunk-h8yqsz9m.js +0 -2
  164. package/dist/chunk-hm0xha6c.js +0 -12
  165. package/dist/chunk-jegt35zh.js +0 -2
  166. package/dist/chunk-mxfh1nxg.js +0 -2
  167. package/dist/chunk-nsp1cw38.js +0 -11
  168. package/dist/chunk-p3242nck.js +0 -2
  169. package/dist/chunk-p98kfh94.js +0 -2
  170. package/dist/chunk-q4p5k2p3.js +0 -2
  171. package/dist/chunk-qpyjak7z.js +0 -2
  172. package/dist/chunk-r7r66978.js +0 -2
  173. package/dist/chunk-rp4rjjmf.js +0 -2
  174. package/dist/chunk-sj9pmene.js +0 -2
  175. package/dist/chunk-svpqxn2c.js +0 -2
  176. package/dist/chunk-t8y1ggdy.js +0 -2
  177. package/dist/chunk-xpp135ad.js +0 -11
  178. package/dist/chunk-ydrz60kr.js +0 -2
  179. package/dist/chunk-z4jhj5e5.js +0 -28
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{$r as U0,Br as N2,Er as $8,Gr as Q0,Js as K7,Kr as M2,Ks as U7,Lr as Z8,Nr as o0,Or as J8,Vr as r7,Wr as e,Xr as q0,Yr as T0,Zr as U9,_r as X2,as as G9,qr as Y0,sr as Y9,ur as Q9,vs as X8,zs as Y8}from"./chunk-92mj1t26.js";import{Qs as i2}from"./chunk-8mjdpr94.js";import{Ys as x0}from"./chunk-xpp135ad.js";import{$s as G8,Zs as u1,_s as x1,at as T1,ct as V1,dt as E8,et as b8,tt as z8}from"./chunk-wrzwgkbx.js";import{ut as W7,wt as H7,xt as j7,zt as W2}from"./chunk-5kk8gsj2.js";import{At as H6}from"./chunk-38ejahd9.js";import{Dt as q8,Ht as o2,Jt as F8}from"./chunk-ypmqf7tm.js";import{Ut as K8}from"./chunk-de7fye10.js";import{Vt as G3,Wt as f8,Xt as T8,Yt as h1,au as x8,bu as p$,cu as $6,eu as q4,hu as f6}from"./chunk-v5e1gxwm.js";import{Cu as x5,Tu as Q8,Vu as QG,Wu as t9,Yu as z2,su as t5,vu as u4}from"./chunk-b6ej2fdf.js";import{bv as B7}from"./chunk-x650vjcp.js";import{gv as u}from"./chunk-qc1f74ek.js";import b1 from"path";import k2 from"fs";var m$=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","wheel","keydown","keyup","keypress","submit","reset","change","input","focus","blur","focusin","focusout","select","invalid","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","scroll","resize","load","error","abort","animationstart","animationend","animationiteration","transitionstart","transitionend","transitionrun","transitioncancel","mounted","unmounted"]),l$={enter:"Enter",tab:"Tab",delete:"Delete",backspace:"Backspace",esc:"Escape",escape:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown"},l8=new Set(["ctrl","alt","shift","meta"]),i$={left:0,middle:1,right:2};function c$($){let Z={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let J of $){let X=J.toLowerCase();if(X==="prevent")Z.prevent=!0;else if(X==="stop")Z.stop=!0;else if(X==="once")Z.once=!0;else if(X==="capture")Z.capture=!0;else if(X==="self")Z.self=!0;else if(X==="passive")Z.passive=!0;else if(l8.has(X))Z.systemKeys.push(X);else if(X in i$)Z.mouse=X;else if(X in l$||/^[a-z]$/.test(X))Z.keys.push(l$[X]||X.toUpperCase());else if(X.startsWith("debounce")){let Y=X.match(/debounce(?:\.(\d+))?/);Z.debounce=Y?.[1]?Number.parseInt(Y[1],10):300}else if(X.startsWith("throttle")){let Y=X.match(/throttle(?:\.(\d+))?/);Z.throttle=Y?.[1]?Number.parseInt(Y[1],10):300}}return Z}function n$($){let Z=[],J=0,X=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,Y;while((Y=X.exec($))!==null){let[Q,G,z]=Y,q=Y.index,K=q+Q.length,U=`__stx_evt_${J++}`,W=[],H=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,j;while((j=H.exec(z))!==null){let[,V,F]=j,O=V.split("."),_=O[0];if(!m$.has(_))continue;W.push({attribute:`@${V}`,event:_,handler:F,modifiers:c$(O.slice(1)),elementId:U})}let B=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((j=B.exec(z))!==null){let[,V,F]=j,O=V.split("."),_=O[0];if(!m$.has(_))continue;W.push({attribute:`@${V}`,event:_,handler:F,modifiers:c$(O.slice(1)),elementId:U})}if(W.length>0)Z.push({originalTag:Q,elementId:U,events:W,startIndex:q,endIndex:K})}return Z}function c8($){let Z=[],{modifiers:J}=$;if(J.self)Z.push("if ($event.target !== $el) return");for(let X of J.systemKeys)Z.push(`if (!$event.${X}Key) return`);if(J.keys.length>0){let X=J.keys.map((Y)=>`$event.key === '${Y}'`).join(" || ");Z.push(`if (!(${X})) return`)}if(J.mouse!==null){let X=i$[J.mouse];Z.push(`if ($event.button !== ${X}) return`)}if(J.prevent)Z.push("$event.preventDefault()");if(J.stop)Z.push("$event.stopPropagation()");return Z.join("; ")}function p8($,Z){let J=$;if(Z.debounce!==null)J=`__stx_debounce(() => { ${J} }, ${Z.debounce})`;else if(Z.throttle!==null)J=`__stx_throttle(() => { ${J} }, ${Z.throttle})`;return J}function P9($){let Z=$.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(Z))return $;return`if (typeof ${Z} === 'function' && !${Z}._isSignal) ${Z}($event);`}function i8($){let{modifiers:Z}=$,J=$.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),X=c8($),Y=p8(P9($.handler),Z),Q=[];if(Z.once)Q.push("once: true");if(Z.capture)Q.push("capture: true");if(Z.passive)Q.push("passive: true");let G=Q.length>0?`, { ${Q.join(", ")} }`:"",z=Y.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if($.event==="mounted")return`
2
+ import{$r as X2,As as Q8,Cr as N2,Fr as Z8,Hr as Q0,Ks as K7,Lr as M2,Ls as U7,Mr as J8,Or as o0,Pr as X8,Wr as r7,Xr as e,Yr as q0,Zr as T0,_r as U9,as as U0,bs as G9,rr as Y0,tr as Y9,vr as Q9,ws as Y8}from"./chunk-ymc99r5x.js";import{Rs as i2}from"./chunk-dcxtrqfy.js";import{Zs as x0,_s as h8}from"./chunk-qjkzpd68.js";import{$s as H6}from"./chunk-t5c7rk0h.js";import{ct as u1,dt as x1,et as z8,ft as T1,ht as V1,it as b8,jt as y8,yt as q8}from"./chunk-72c7gyqc.js";import{Bt as H7,Ct as j7,Et as W2,zt as W7}from"./chunk-fv923f7g.js";import{Ft as K8,Jt as o2,Lt as w8}from"./chunk-2e6xafcm.js";import{Vt as Z1}from"./chunk-nygtwffe.js";import{Yt as U8}from"./chunk-461br5nn.js";import{$t as E8,Zt as G3,_t as x8,au as h1,eu as g8,fu as p$,gu as $6,iu as q4,lu as f6}from"./chunk-h7v70dbp.js";import{Gu as x5,Xu as G8,Zu as zG,_u as t9,av as z2,wu as t5,zu as u4}from"./chunk-drbbt69f.js";import{fv as B7}from"./chunk-kb5j08tq.js";import{kv as u}from"./chunk-2vza9m2x.js";import b1 from"path";import k2 from"fs";var m$=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","wheel","keydown","keyup","keypress","submit","reset","change","input","focus","blur","focusin","focusout","select","invalid","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","scroll","resize","load","error","abort","animationstart","animationend","animationiteration","transitionstart","transitionend","transitionrun","transitioncancel","mounted","unmounted"]),l$={enter:"Enter",tab:"Tab",delete:"Delete",backspace:"Backspace",esc:"Escape",escape:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown"},p8=new Set(["ctrl","alt","shift","meta"]),i$={left:0,middle:1,right:2};function c$($){let Z={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let J of $){let X=J.toLowerCase();if(X==="prevent")Z.prevent=!0;else if(X==="stop")Z.stop=!0;else if(X==="once")Z.once=!0;else if(X==="capture")Z.capture=!0;else if(X==="self")Z.self=!0;else if(X==="passive")Z.passive=!0;else if(p8.has(X))Z.systemKeys.push(X);else if(X in i$)Z.mouse=X;else if(X in l$||/^[a-z]$/.test(X))Z.keys.push(l$[X]||X.toUpperCase());else if(X.startsWith("debounce")){let Y=X.match(/debounce(?:\.(\d+))?/);Z.debounce=Y?.[1]?Number.parseInt(Y[1],10):300}else if(X.startsWith("throttle")){let Y=X.match(/throttle(?:\.(\d+))?/);Z.throttle=Y?.[1]?Number.parseInt(Y[1],10):300}}return Z}function n$($){let Z=[],J=0,X=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,Y;while((Y=X.exec($))!==null){let[Q,G,z]=Y,q=Y.index,K=q+Q.length,U=`__stx_evt_${J++}`,W=[],H=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,j;while((j=H.exec(z))!==null){let[,V,F]=j,O=V.split("."),_=O[0];if(!m$.has(_))continue;W.push({attribute:`@${V}`,event:_,handler:F,modifiers:c$(O.slice(1)),elementId:U})}let B=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((j=B.exec(z))!==null){let[,V,F]=j,O=V.split("."),_=O[0];if(!m$.has(_))continue;W.push({attribute:`@${V}`,event:_,handler:F,modifiers:c$(O.slice(1)),elementId:U})}if(W.length>0)Z.push({originalTag:Q,elementId:U,events:W,startIndex:q,endIndex:K})}return Z}function i8($){let Z=[],{modifiers:J}=$;if(J.self)Z.push("if ($event.target !== $el) return");for(let X of J.systemKeys)Z.push(`if (!$event.${X}Key) return`);if(J.keys.length>0){let X=J.keys.map((Y)=>`$event.key === '${Y}'`).join(" || ");Z.push(`if (!(${X})) return`)}if(J.mouse!==null){let X=i$[J.mouse];Z.push(`if ($event.button !== ${X}) return`)}if(J.prevent)Z.push("$event.preventDefault()");if(J.stop)Z.push("$event.stopPropagation()");return Z.join("; ")}function n8($,Z){let J=$;if(Z.debounce!==null)J=`__stx_debounce(() => { ${J} }, ${Z.debounce})`;else if(Z.throttle!==null)J=`__stx_throttle(() => { ${J} }, ${Z.throttle})`;return J}function P9($){let Z=$.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(Z))return $;return`if (typeof ${Z} === 'function' && !${Z}._isSignal) ${Z}($event);`}function o8($){let{modifiers:Z}=$,J=$.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),X=i8($),Y=n8(P9($.handler),Z),Q=[];if(Z.once)Q.push("once: true");if(Z.capture)Q.push("capture: true");if(Z.passive)Q.push("passive: true");let G=Q.length>0?`, { ${Q.join(", ")} }`:"",z=Y.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if($.event==="mounted")return`
3
3
  (function() {
4
4
  var $el = document.getElementById('${J}');
5
5
  if (!$el) return;
@@ -108,13 +108,11 @@ else {
108
108
  }
109
109
 
110
110
  // Event listeners
111
- ${$.map(i8).join(`
111
+ ${$.map(o8).join(`
112
112
  `)}
113
113
  })();
114
- </script>`}function n8($){let Z=n$($);if(Z.length===0)return{template:$,bindings:[]};let J=$,X=[];for(let Y=Z.length-1;Y>=0;Y--){let Q=Z[Y],G=Q.originalTag;if(!G.includes(" id="))G=G.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${Q.elementId}"`);else{let z=G.match(/id=["']([^"']+)["']/);if(z)for(let q of Q.events)q.elementId=z[1]}for(let z of Q.events){let q=z.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),K=new RegExp(`\\s*${q}\\s*=\\s*"[^"]*"`,"g"),U=new RegExp(`\\s*${q}\\s*=\\s*'[^']*'`,"g");G=G.replace(K,""),G=G.replace(U,"")}J=J.slice(0,Q.startIndex)+G+J.slice(Q.endIndex),X.push(...Q.events)}return{template:J,bindings:X}}function o$($,Z,J){if(p$($))return $;if(Z.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test($))return $;let{template:z,bindings:q}=n8($),K=Z.__stx_event_bindings||[];return Z.__stx_event_bindings=[...K,...q],z}let X=n$($);if(X.length===0)return $;let Y=$;for(let z=X.length-1;z>=0;z--){let q=X[z],K=q.originalTag;if(!K.includes(" id="))K=K.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${q.elementId}"`);else{let U=K.match(/id=["']([^"']+)["']/);if(U)for(let W of q.events)W.elementId=U[1]}for(let U of q.events){let W=U.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),H=new RegExp(`\\s*${W}\\s*=\\s*"[^"]*"`,"g"),j=new RegExp(`\\s*${W}\\s*=\\s*'[^']*'`,"g");K=K.replace(H,""),K=K.replace(j,"")}Y=Y.slice(0,q.startIndex)+K+Y.slice(q.endIndex)}let Q=v9(X.flatMap((z)=>z.events)),G=Y.lastIndexOf("</body>");if(G!==-1)Y=Y.slice(0,G)+Q+`
115
- `+Y.slice(G);else Y+=Q;return Y}function Iz($){return/@[a-z]+(?:\.[a-z]+)*\s*=\s*["'][^"']*["']/i.test($)}function e0($){let Z=/import\s*\{([^}]+)\}\s*from\s*['"](@stores|stx\/stores)['"]\s*;?\n?/g;$=$.replace(Z,(X,Y)=>{return`const { ${Y.split(",").map((G)=>G.trim()).filter(Boolean).join(", ")} } = window.__STX_STORES__
116
- `});let J=/import\s*\{([^}]+)\}\s*from\s*['"]@composables['"]\s*;?\n?/g;return $=$.replace(J,(X,Y)=>{return`const { ${Y.split(",").map((G)=>G.trim()).filter(Boolean).join(", ")} } = window.__composables
117
- `}),$}function Ez($){return $.replace(/^import\s+[^'"]*?from\s*['"][^'"]+['"]\s*;?[ \t]*$/gm,"").replace(/^import\s+['"][^'"]+['"]\s*;?[ \t]*$/gm,"")}import cG from"fs";import h from"path";import{createHash as o8}from"crypto";var S2="__stx_component_client_factories";function P2($){let Z=$[S2];return Z instanceof Map?Z:null}function s$($){$[S2]=new Map}function f9($,Z){let J=P2($);if(!J)return null;let X=o8("sha256").update(Z).digest("hex").slice(0,16),Y=J.get(X);if(Y)Y.instances++;else J.set(X,{body:Z,instances:1});return X}function r$($,Z){let J=P2(Z);if(!J?.size)return $;let X=new Map;for(let[K,U]of J)if(U.instances===1)X.set(K,U.body);let Y=$;if(X.size>0){let K=[...X.keys()].map((W)=>JSON.stringify(W).replace(/[$()*+.?[\\\]^{|}]/g,"\\$&")).join("|"),U=new RegExp(`window\\.__stxComponentFactories\\[(${K})\\]\\(("[^"]+")\\);`,"g");Y=Y.replace(U,(W,H,j)=>{let B=X.get(JSON.parse(H));return B===void 0?W:`(${B})(${j});`})}let Q=[...J].filter(([,K])=>K.instances>1);if(Q.length===0)return Y;let z=`<script data-stx-scoped data-stx-run="always" data-stx-component-factories>
114
+ </script>`}function s8($){let Z=n$($);if(Z.length===0)return{template:$,bindings:[]};let J=$,X=[];for(let Y=Z.length-1;Y>=0;Y--){let Q=Z[Y],G=Q.originalTag;if(!G.includes(" id="))G=G.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${Q.elementId}"`);else{let z=G.match(/id=["']([^"']+)["']/);if(z)for(let q of Q.events)q.elementId=z[1]}for(let z of Q.events){let q=z.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),K=new RegExp(`\\s*${q}\\s*=\\s*"[^"]*"`,"g"),U=new RegExp(`\\s*${q}\\s*=\\s*'[^']*'`,"g");G=G.replace(K,""),G=G.replace(U,"")}J=J.slice(0,Q.startIndex)+G+J.slice(Q.endIndex),X.push(...Q.events)}return{template:J,bindings:X}}function o$($,Z,J){if(p$($))return $;if(Z.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test($))return $;let{template:z,bindings:q}=s8($),K=Z.__stx_event_bindings||[];return Z.__stx_event_bindings=[...K,...q],z}let X=n$($);if(X.length===0)return $;let Y=$;for(let z=X.length-1;z>=0;z--){let q=X[z],K=q.originalTag;if(!K.includes(" id="))K=K.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${q.elementId}"`);else{let U=K.match(/id=["']([^"']+)["']/);if(U)for(let W of q.events)W.elementId=U[1]}for(let U of q.events){let W=U.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),H=new RegExp(`\\s*${W}\\s*=\\s*"[^"]*"`,"g"),j=new RegExp(`\\s*${W}\\s*=\\s*'[^']*'`,"g");K=K.replace(H,""),K=K.replace(j,"")}Y=Y.slice(0,q.startIndex)+K+Y.slice(q.endIndex)}let Q=v9(X.flatMap((z)=>z.events)),G=Y.lastIndexOf("</body>");if(G!==-1)Y=Y.slice(0,G)+Q+`
115
+ `+Y.slice(G);else Y+=Q;return Y}function Tz($){return/@[a-z]+(?:\.[a-z]+)*\s*=\s*["'][^"']*["']/i.test($)}import iG from"fs";import h from"path";import{createHash as r8}from"crypto";var S2="__stx_component_client_factories";function P2($){let Z=$[S2];return Z instanceof Map?Z:null}function s$($){$[S2]=new Map}function f9($,Z){let J=P2($);if(!J)return null;let X=r8("sha256").update(Z).digest("hex").slice(0,16),Y=J.get(X);if(Y)Y.instances++;else J.set(X,{body:Z,instances:1});return X}function r$($,Z){let J=P2(Z);if(!J?.size)return $;let X=new Map;for(let[K,U]of J)if(U.instances===1)X.set(K,U.body);let Y=$;if(X.size>0){let K=[...X.keys()].map((W)=>JSON.stringify(W).replace(/[$()*+.?[\\\]^{|}]/g,"\\$&")).join("|"),U=new RegExp(`window\\.__stxComponentFactories\\[(${K})\\]\\(("[^"]+")\\);`,"g");Y=Y.replace(U,(W,H,j)=>{let B=X.get(JSON.parse(H));return B===void 0?W:`(${B})(${j});`})}let Q=[...J].filter(([,K])=>K.instances>1);if(Q.length===0)return Y;let z=`<script data-stx-scoped data-stx-run="always" data-stx-component-factories>
118
116
  (function() {
119
117
  const factories = window.__stxComponentFactories = window.__stxComponentFactories || {};
120
118
  ${Q.map(([K,U])=>` try { factories[${JSON.stringify(K)}] = factories[${JSON.stringify(K)}] || ${U.body}; }
@@ -123,7 +121,7 @@ ${Q.map(([K,U])=>` try { factories[${JSON.stringify(K)}] = factories[${JSON.str
123
121
  })();
124
122
  </script>`,q=Y.search(/<script\b(?=[^>]*\bdata-stx-scoped\b)/i);if(q<0)return`${z}
125
123
  ${Y}`;return`${Y.slice(0,q)}${z}
126
- ${Y.slice(q)}`}function a$($){let Z=P2($),J=new Map;if(Z)for(let[X,Y]of Z)J.set(X,Y.instances);return J}function t$($,Z){let J=P2($);if(!J)return[];let X=[];for(let[Y,Q]of J){let G=Q.instances-(Z.get(Y)??0);if(G>0)X.push({body:Q.body,count:G})}return X}function e$($,Z){for(let{body:J,count:X}of Z)for(let Y=0;Y<X;Y++)f9($,J)}var $3=0,v2=new Map;function Sz(){$3=0,v2.clear()}function f2($,Z){let J=$3++,X=`<!--__STX_${$.toUpperCase()}_${J}__-->`;return v2.set(X,{type:$,expression:Z}),X}function Pz(){let $={};for(let[Z,J]of v2)$[Z]={type:J.type,expression:J.expression};return $}function vz($){let Z={},J=/<!--__STX_(EXPR|COND|RAW)_(\d+)__-->/g,X;while((X=J.exec($))!==null){let Y=X[0],Q=X[1].toLowerCase(),G=v2.get(Y);Z[Y]={type:Q,expression:G?.expression||""}}return Z}function fz($,Z){let J=$;for(let[X,Y]of Z)J=J.split(X).join(Y);return J}function xz($){return $.includes("<!--__STX_")}var x2=/<script\b[^>]*>/iy,u9=/<\/script\s*>/ig,g2=/<style\b[^>]*>/iy,d9=/<\/style\s*>/ig;function Z3($,Z,J,X){J.lastIndex=Z;let Y=J.exec($);if(!Y||Y.index!==Z)return-1;X.lastIndex=J.lastIndex;let Q=X.exec($);if(!Q)return-1;return Q.index+Q[0].length}function Y1($,Z){return Z3($,Z,x2,u9)}function y1($,Z){return Z3($,Z,g2,d9)}function Y2($,Z){if(!$.startsWith("<!--",Z))return-1;let J=$.indexOf("-->",Z+4);if(J===-1)return-1;return J+3}function J3($,Z){if($.startsWith("<!--",Z)){let Y=Y2($,Z);return Y===-1?$.length:Y}if(x2.lastIndex=Z,x2.exec($)?.index===Z){u9.lastIndex=x2.lastIndex;let Y=u9.exec($);return Y?Y.index+Y[0].length:$.length}if(g2.lastIndex=Z,g2.exec($)?.index===Z){d9.lastIndex=g2.lastIndex;let Y=d9.exec($);return Y?Y.index+Y[0].length:$.length}return-1}function h2($,Z){let J=[],X=0,Y=$.length,Q=!1,G=null;while(X<Y){let z=$[X];if(Q){if(G){if(z===G)G=null}else if(z==='"'||z==="'")G=z;else if(z===">")Q=!1;X++;continue}if(z!=="<"){let W=$.indexOf("<",X+1);if(W===-1)break;X=W;continue}let q=Z($,X);if(q>X){J.push({start:X,end:q,token:$.slice(X,q)}),X=q;continue}let K=J3($,X);if(K>X){X=K;continue}let U=$.charCodeAt(X+1);if(U>=65&&U<=90||U>=97&&U<=122)Q=!0;X++}return J}function X3($){let Z=0,J=0,X=0,Y=!1,Q=null;while(X<$.length){if(Y){let W=$[X];if(Q){if(W===Q)Q=null}else if(W==='"'||W==="'")Q=W;else if(W===">")Y=!1;X++;continue}let G=$.indexOf("<",X),z=G===-1?$.length:G;while(X<z){let W=$[X++];if(W==="{")Z++;else if(W==="}")J++;if(Z>=2&&J>=2)return!0}if(G===-1)break;let q=J3($,G);if(q>G){X=q;continue}let K=$.charCodeAt(G+1),U=K===47?$.charCodeAt(G+2):K;if(U>=65&&U<=90||U>=97&&U<=122)Y=!0;X=G+1}return!1}function u2($,Z){while($.size>=Z){let J=$.keys().next();if(J.done)return;$.delete(J.value)}}var s8=65536,r8=12,x9=new Map;function p0($,Z,J,X){let Y=X!==void 0&&$.length>=s8,Q=Y?`${X}\x00${$}`:"";if(Y){let U=x9.get(Q);if(U)return{output:U.output,tokens:U.tokens.slice()}}let G=h2($,Z);if(G.length===0)return{output:$,tokens:[]};let z=G.map((U)=>U.token),q="",K=0;for(let U=0;U<G.length;U++){let W=G[U];q+=$.slice(K,W.start),q+=J(W.token,U),K=W.end}if(q+=$.slice(K),Y)return u2(x9,r8),x9.set(Q,{output:q,tokens:z}),{output:q,tokens:z.slice()};return{output:q,tokens:z}}var a8=65536,t8=4,g9=new Map;function h9($,Z,J){return{output:Z,scripts:J,restore:(X)=>X===Z?$:d2(X,J)}}function i0($){let Z=$.length>=a8;if(Z){let Y=g9.get($);if(Y)return h9($,Y.output,Y.scripts.slice())}let{output:J,tokens:X}=p0($,Y1,(Y,Q)=>`\x00STX_SCRIPT_${Q}\x00`);if(Z)return u2(g9,t8),g9.set($,{output:J,scripts:X}),h9($,J,X.slice());return h9($,J,X)}function d2($,Z){if(Z.length===0)return $;return $.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(J,X)=>Z[+X]??"")}var Q2={},Y3=new Map;function e8($){let Z=Y3.get($);if(!Z){let J=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");Z=new RegExp(`:${J}(?!\\w)`,"g"),Y3.set($,Z)}return Z.lastIndex=0,Z}var m2={uppercase:($,Z)=>{return $!==void 0&&$!==null?String($).toUpperCase():""},lowercase:($,Z)=>{return $!==void 0&&$!==null?String($).toLowerCase():""},capitalize:($,Z)=>{if($===void 0||$===null)return"";let J=String($);return J.charAt(0).toUpperCase()+J.slice(1)},number:($,Z,J=0)=>{if($===void 0||$===null)return"";try{let X=Number($);return Number.isNaN(X)?"":X.toFixed(Number.parseInt(String(J),10))}catch{return""}},fmt:($,Z,J="en-US")=>{if($===void 0||$===null)return"";try{let X=Number($);if(Number.isNaN(X))return String($);return X.toLocaleString(J)}catch{return String($)}},join:($,Z,J=",")=>{if(!Array.isArray($))return"";return $.join(String(J))},escape:($,Z)=>{if($===void 0||$===null)return"";return z3(String($))},translate:($,Z,J={})=>{if(!Z||!Z.__translations)return $;let X=Z.__translations,Y=Z.__i18nConfig?.fallbackToKey??!0,Q=String($).split("."),G=X;for(let q of Q){if(G===void 0||G===null)break;G=G[q]}if(G===void 0||G===null)return Y?$:"";let z=String(G);return Object.entries(J).forEach(([q,K])=>{z=z.replace(e8(q),String(K))}),z},t:($,Z,J={})=>{return m2.translate($,Z,J)},truncate:($,Z,J=50,X="...")=>{if($===void 0||$===null)return"";let Y=String($);if(Y.length<=J)return Y;if(J<=X.length)return X.substring(0,J);return Y.substring(0,J-X.length)+X},date:($,Z,J="short",X="en-US")=>{if($===void 0||$===null)return"";try{let Y=$ instanceof Date?$:new Date($);if(Number.isNaN(Y.getTime()))return String($);let Q={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"},full:{dateStyle:"full"},time:{timeStyle:"short"},datetime:{dateStyle:"short",timeStyle:"short"},iso:{}};if(J==="iso")return Y.toISOString();return new Intl.DateTimeFormat(X,Q[J]||Q.short).format(Y)}catch{return String($)}},currency:($,Z,J="USD",X="en-US")=>{if($===void 0||$===null)return"";try{let Y=Number($);if(Number.isNaN(Y))return String($);return new Intl.NumberFormat(X,{style:"currency",currency:J}).format(Y)}catch{return String($)}},pluralize:($,Z,J,X)=>{let Y=Number($);if(Number.isNaN(Y))return J;let Q=X||`${J}s`;return Y===1?J:Q},first:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return $.length===0?"":$[0];return String($).charAt(0)},last:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return $.length===0?"":$[$.length-1];let J=String($);return J.charAt(J.length-1)},length:($,Z)=>{if($===void 0||$===null)return 0;if(Array.isArray($)||typeof $==="string")return $.length;if($ instanceof Map||$ instanceof Set)return $.size;if(typeof $==="object")return Object.keys($).length;return 0},json:($,Z,J=!1)=>{if($===void 0)return"undefined";if($===null)return"null";try{return J?JSON.stringify($,null,2):JSON.stringify($)}catch{return String($)}},default:($,Z,J="")=>{return $===void 0||$===null||$===""?J:$},reverse:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return[...$].reverse();return String($).split("").reverse().join("")},slice:($,Z,J=0,X)=>{if($===void 0||$===null)return"";if(Array.isArray($)||typeof $==="string")return $.slice(J,X);return $},replace:($,Z,J,X="")=>{if($===void 0||$===null)return"";let Y=J.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String($).replace(new RegExp(Y,"g"),()=>X)},stripTags:($,Z)=>{if($===void 0||$===null)return"";return String($).replace(/<[^>]*>/g,"")},urlencode:($,Z)=>{if($===void 0||$===null)return"";return encodeURIComponent(String($))},abs:($,Z)=>{let J=Number($);return Number.isNaN(J)?0:Math.abs(J)},round:($,Z,J=0)=>{let X=Number($);if(Number.isNaN(X))return 0;let Y=10**J;return Math.round(X*Y)/Y}};function $Z($,Z){if($ in m2)console.warn(`Filter "${$}" already exists as a built-in filter. Custom filter will take precedence.`);Q2[$]=Z}function iz($){for(let[Z,J]of Object.entries($))$Z(Z,J)}function ZZ(){return{...m2,...Q2}}function nz(){for(let $ of Object.keys(Q2))delete Q2[$]}function m9($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function z3($){return m9($).replace(/\{{2,}/g,(Z)=>JZ(Z.length)).replace(/\{(?=!)/g,`&#123;${q3}`)}var q3="&#8288;";function JZ($){return Array.from({length:$},()=>"&#123;").join(q3)}function Q1($,Z){let{scripts:J}=i0($);for(let X of J){let Y=X.match(/^<script\b([^>]*)>([\s\S]*?)<\/script\s*>$/i);if(!Y||/\bserver\b|\bsrc\s*=/.test(Y[1]))continue;let Q=Y[2];if(/\b(state|derived|effect|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/.test(Q))return!0;if(G3(Q,Z))return!0}if(/@(if|for|show)\s*=\s*["'][^"']*\(\s*\)/.test($))return!0;if(/@for\s*=\s*["'][^"']*\s+(?:in|of)\s+[^"']*\(\s*\)/.test($))return!0;if(/(?:^|[\s"'])(?::|x-)(?:for|if|else-if|else|show|text|html|model|bind)\b/.test($))return!0;return!1}function Q3($,Z){let J=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined","NaN","Infinity","isNaN","isFinite","window","document","console"],X=$.replace(/'[^']*'/g,"").replace(/"[^"]*"/g,""),Y="",Q=!1,G=0;for(let K=0;K<X.length;K++){let U=X[K];if(!Q&&U==="`"){Q=!0,G=0;continue}if(Q){if(U==="`"&&G===0){Q=!1;continue}if(U==="$"&&X[K+1]==="{"){G++,K++,Y+=" ";continue}if(U==="}"&&G>0){G--;continue}if(G>0){Y+=U;continue}continue}Y+=U}X=Y;let z=/(?<![a-zA-Z0-9_$])([a-zA-Z_$][a-zA-Z0-9_$]*)/g,q;while((q=z.exec(X))!==null){let K=q[1];if(!X.substring(0,q.index).trimEnd().endsWith(".")){if(!J.includes(K)&&!(K in Z))return!1}}return!0}function XZ($,Z){let J=Z.__stx_serverDeclared;if(!J||J.size===0)return!1;let X=x0($);for(let Y of J)if(new RegExp(`(?<![.#\\w$])${Y}(?![\\w$])`).test(X))return!0;return!1}function l9($,Z){let J=$;return J=J.replace(/\{!!([\s\S]*?)!!\}/g,(X,Y)=>{try{let Q=P0(Y,Z);if(Q===void 0)return X;return Q===null?"":String(Q)}catch{return X}}),J=J.replace(/\{\{([\s\S]*?)\}\}/g,(X,Y)=>{let Q=Y.trim();if(/^__[A-Z_]+__$/.test(Q))return X;try{let G=P0(Y,Z);if(G===void 0)return X;return JSON.stringify(G).replace(/</g,"\\u003c")}catch{return X}}),J}function YZ($,Z){if(!$.includes("{"))return $;let J=$;return J=J.replace(/\{!!([\s\S]*?)!!\}/g,(X,Y)=>{try{let Q=P0(Y,Z);if(Q===void 0)return X;return Q===null?"":String(Q)}catch{return X}}),J=J.replace(/\{\{([\s\S]*?)\}\}/g,(X,Y)=>{let Q=Y.trim();if(/^__[A-Z_]+__$/.test(Q))return X;try{let G=P0(Y,Z);if(G===void 0)return X;if(G===null)return"";return String(G).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}catch{return X}}),J}function oz($,Z,J={}){let{output:X,scripts:Y}=i0($),Q=Y.map((G)=>{let z=G.match(/^<script\b([^>]*)>([\s\S]*?)<\/script\s*>$/i),q=G.match(/^<script\b[^>]*>/i),K=G.search(/<\/script\s*>$/i);if(!z||!q||K===-1)return G;let U=z[1],W=z[2];if(/\bdata-raw\b/.test(U))return G;if(J.skipServer&&/\bserver\b/.test(U))return G;let j=`<script${YZ(U,Z)}>`;if(/\bsrc\s*=/.test(U)||/\btype\s*=\s*["']application\/json["']/.test(U))return j+W+G.slice(K);return j+l9(W,Z)+G.slice(K)});return d2(X,Q)}function _1($,Z,J){let X=$,Y=(W,H)=>{let j=y1(W,H);if(j===-1)return-1;return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(W.slice(H,j))?-1:j},Q=(W,H,j,B)=>{let V=j.length,{output:F,tokens:O}=p0(W,H,(_,L)=>B(V+L));return j.push(...O),F},G=[];X=Q(X,Y,G,(W)=>`<!--__STX_STYLE_${W}__-->`);let z=[];X=Q(X,Y1,z,(W)=>`<!--__STX_SCRIPT_EXPR_${W}__-->`);let q=Z?.__stx_signals_gate===!0||Q1($),K=new Set(Array.isArray(Z?.__stx_client_signal_names)?Z.__stx_client_signal_names:[]),U=new Set(Array.isArray(Z?.__stx_preserved_client_expressions)?Z.__stx_preserved_client_expressions:[]);if(X=X.replace(/\{\{\{([\s\S]*?)\}\}\}/g,(W,H,j)=>{try{let B=P0(H,Z);return B!==void 0&&B!==null?String(B):""}catch(B){let V=B instanceof Error?B.message:String(B);return j0("Expression",`Error evaluating: {{{ ${H.trim()}}}}: ${V}`,J,$,j,W)}}),X=X.replace(/\{!!([\s\S]*?)!!\}/g,(W,H,j)=>{try{let B=P0(H,Z);if(B===void 0&&Z.__stx_buildMode==="compile")return f2("raw",H.trim());return B!==void 0&&B!==null?String(B):""}catch(B){if(Z.__stx_buildMode==="compile")return f2("raw",H.trim());let V=B instanceof Error?B.message:String(B);return j0("Expression",`Error evaluating: {!! ${H.trim()} !!}: ${V}`,J,$,j,W)}}),X=Q(X,Y1,z,(W)=>`<!--__STX_SCRIPT_EXPR_${W}__-->`),X=Q(X,Y,G,(W)=>`<!--__STX_STYLE_${W}__-->`),X=X.replace(/\{\{([\s\S]*?)\}\}/g,(W,H,j)=>{let B=H.trim();if(U.has(B))return W;let V=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined"],F=/^([a-zA-Z_$][a-zA-Z0-9_$]*)/,_=B.match(F)?.[1],L=_&&((_ in Z)||V.includes(_)),w=Boolean(_&&K.has(_)),R=/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/,D=B.match(R),M=D&&!V.includes(D[1])&&!(D[1]in Z);if(/^__[A-Z_]+__$/.test(B))return"";try{let I=P0(H,Z);if(w)return W;if(q&&!Q3(B,Z))return W;if(Z.__stx_buildMode==="compile"&&!q&&(I===void 0||XZ(B,Z)))return f2("expr",B);return I!==void 0&&I!==null?z3(String(I)):""}catch(I){if(w)return W;if(q&&!Q3(B,Z))return W;if(M)return W;let N=I instanceof Error?I.message:String(I);return j0("Expression",`Error evaluating: {{ ${B} }}: ${N}`,J,$,j,W)}}),z.length>0)X=X.replace(/<!--__STX_SCRIPT_EXPR_(\d+)__-->/g,(W,H)=>z[Number(H)]??W);if(G.length>0)X=X.replace(/<!--__STX_STYLE_(\d+)__-->/g,(W,H)=>G[Number(H)]??W);return X}function QZ($,Z,J){if(!Z.trim())return $;let X=$,Y=Z.trim();while(Y.length>0){let Q=Y.match(/^(\w+)/);if(!Q)break;let G=Q[1];Y=Y.substring(G.length).trim();let z=Q2[G]||m2[G];if(!z)throw Error(`Filter not found: ${G}. Available filters: ${Object.keys(ZZ()).join(", ")}`);let q=[];if(Y.startsWith(":")){let K=Y.match(/^:([^|\s]+)/);if(K){let U=K[1].trim();try{let W=Number(U);q=[Number.isNaN(W)?U:W]}catch{q=[U]}Y=Y.substring(K[0].length).trim()}}else if(Y.startsWith("(")){let K=1,U=1;while(K>0&&U<Y.length){if(Y[U]==="(")K++;if(Y[U]===")")K--;U++}if(K===0){let W=Y.substring(1,U-1).trim();if(W)try{if(W.startsWith("{")&&W.endsWith("}"))q=[P0(`(${W})`,J,!0)];else{let H=[],j="",B=null,V=0,F=0,O=0,_=!1;for(let L=0;L<W.length;L++){let w=W[L];if(_){j+=w,_=!1;continue}if(w==="\\"){j+=w,_=!0;continue}if(B){if(j+=w,w===B)B=null;continue}if(w==='"'||w==="'"||w==="`"){B=w,j+=w;continue}if(w==="(")V++;else if(w===")")V--;else if(w==="[")F++;else if(w==="]")F--;else if(w==="{")O++;else if(w==="}")O--;if(w===","&&V===0&&F===0&&O===0){H.push(j),j="";continue}j+=w}if(j)H.push(j);q=H.map((L)=>{let w=L.trim();return P0(w,J,!0)})}}catch{q=[W]}Y=Y.substring(U).trim()}}try{X=z(X,J,...q)}catch(K){let U=K instanceof Error?K.message:String(K);throw Error(`Error applying filter '${G}': ${U}`)}if(Y.startsWith("|"))Y=Y.substring(1).trim();else break}return X}function GZ($){let Z=!1,J="",X=0,Y=0,Q=0,G=!1;for(let z=0;z<$.length;z++){let q=$[z],K=$[z+1];if(Z&&G){G=!1;continue}if(Z&&q==="\\"){G=!0;continue}if(G=!1,(q==='"'||q==="'"||q==="`")&&!G){if(!Z)Z=!0,J=q;else if(q===J)Z=!1,J="";continue}if(Z&&J==="`"&&q==="$"&&K==="{"){let U=1;z+=2;while(z<$.length&&U>0){if($[z]==="{")U++;else if($[z]==="}")U--;if(U>0)z++}continue}if(Z)continue;if(q==="(")X++;else if(q===")")X--;else if(q==="[")Y++;else if(q==="]")Y--;else if(q==="{")Q++;else if(q==="}")Q--;if(q==="|"&&X===0&&Y===0&&Q===0){if(K==="|"){z++;continue}if(K==="="){z++;continue}return z}}return-1}function P0($,Z,J=!1){try{let X=$.trim(),Y=GZ(X);if(Y>0){let Q=X.substring(0,Y).trim(),G=X.substring(Y+1).trim(),z=P0(Q,Z,!0);return QZ(z,G,Z)}if(!q0(X)){if(!J)console.warn(`Potentially unsafe expression detected, using safe evaluator: ${X}`);return e(X,Z)}try{let Q=Object.keys(Z),G=Object.values(Z);return U0(X,Q)(...G)}catch{return e(X,Z)}}catch(X){if(X instanceof ReferenceError){let Y=/(\b\w+)\s+is not defined/.exec(X.message);if(Y){let Q=Y[1],G=zZ(Q,Object.keys(Z));if(G&&G!==Q)X.message=`${X.message} \u2014 did you mean '${G}'?`}}if(!J)console.error(`Error evaluating expression: ${$}`,X);throw X}}function zZ($,Z){let J=null;for(let Y of Z){if(Y===$)continue;let Q=qZ($,Y);if(J===null||Q<J.dist)J={key:Y,dist:Q}}if(!J)return null;let X=Math.max($.length,J.key.length);if(J.dist<=2||J.dist/X<=0.35)return J.key;return null}function qZ($,Z){if($===Z)return 0;if($.length===0)return Z.length;if(Z.length===0)return $.length;let[J,X]=$.length<Z.length?[$,Z]:[Z,$],Y=Array(J.length+1),Q=Array(J.length+1);for(let G=0;G<=J.length;G++)Y[G]=G;for(let G=1;G<=X.length;G++){Q[0]=G;for(let z=1;z<=J.length;z++){let q=J[z-1]===X[G-1]?0:1;Q[z]=Math.min(Q[z-1]+1,Y[z]+1,Y[z-1]+q)}for(let z=0;z<=J.length;z++)Y[z]=Q[z]}return Y[J.length]}function sz($){if(!$)return"";return $.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#039;/g,"'").replace(/&#39;/g,"'").replace(/&amp;/g,"&")}import GG from"fs";import M0 from"path";var c9=[{open:/<!--/g,close:/-->/g},{open:/<script\b/gi,close:/<\/script\s*>/gi},{open:/<style\b/gi,close:/<\/style\s*>/gi}],K3=/<body\b([^>]*)>/gi;function G1($){let Z=0,J,X=c9.map(()=>{return});while(Z<$.length){if(J===void 0||J!==null&&J.index<Z)K3.lastIndex=Z,J=K3.exec($);if(!J)return null;let Y=J.index,Q=-1,G=null;for(let q=0;q<c9.length;q++){let K=c9[q],U=X[q];if(U===void 0||U!==null&&U.index<Z)K.open.lastIndex=Z,U=K.open.exec($),X[q]=U;if(!U)continue;if(U.index<Y&&(Q===-1||U.index<Q))Q=U.index,G=K.close}if(Q===-1||!G)return{index:Y,tag:J[0],attrs:J[1]??""};G.lastIndex=Q;let z=G.exec($);if(!z)return null;Z=z.index+z[0].length}return null}function C1($,Z){let J=G1($);if(!J)return $;return $.slice(0,J.index)+Z(J.tag,J.attrs)+$.slice(J.index+J.tag.length)}var U3=null;function KZ($){if(!U3)return console.warn(`[stx] ${$} must be called within a component setup.`),null;return U3}function tz($){let Z=KZ("onUpdate");if(Z)Z.updateHooks.push($)}function W3(){return`
124
+ ${Y.slice(q)}`}function a$($){let Z=P2($),J=new Map;if(Z)for(let[X,Y]of Z)J.set(X,Y.instances);return J}function t$($,Z){let J=P2($);if(!J)return[];let X=[];for(let[Y,Q]of J){let G=Q.instances-(Z.get(Y)??0);if(G>0)X.push({body:Q.body,count:G})}return X}function e$($,Z){for(let{body:J,count:X}of Z)for(let Y=0;Y<X;Y++)f9($,J)}var $3=0,v2=new Map;function Cz(){$3=0,v2.clear()}function f2($,Z){let J=$3++,X=`<!--__STX_${$.toUpperCase()}_${J}__-->`;return v2.set(X,{type:$,expression:Z}),X}function Sz(){let $={};for(let[Z,J]of v2)$[Z]={type:J.type,expression:J.expression};return $}function Pz($){let Z={},J=/<!--__STX_(EXPR|COND|RAW)_(\d+)__-->/g,X;while((X=J.exec($))!==null){let Y=X[0],Q=X[1].toLowerCase(),G=v2.get(Y);Z[Y]={type:Q,expression:G?.expression||""}}return Z}function vz($,Z){let J=$;for(let[X,Y]of Z)J=J.split(X).join(Y);return J}function fz($){return $.includes("<!--__STX_")}var x2=/<script\b[^>]*>/iy,u9=/<\/script\s*>/ig,g2=/<style\b[^>]*>/iy,d9=/<\/style\s*>/ig;function Z3($,Z,J,X){J.lastIndex=Z;let Y=J.exec($);if(!Y||Y.index!==Z)return-1;X.lastIndex=J.lastIndex;let Q=X.exec($);if(!Q)return-1;return Q.index+Q[0].length}function Y1($,Z){return Z3($,Z,x2,u9)}function y1($,Z){return Z3($,Z,g2,d9)}function Y2($,Z){if(!$.startsWith("<!--",Z))return-1;let J=$.indexOf("-->",Z+4);if(J===-1)return-1;return J+3}function J3($,Z){if($.startsWith("<!--",Z)){let Y=Y2($,Z);return Y===-1?$.length:Y}if(x2.lastIndex=Z,x2.exec($)?.index===Z){u9.lastIndex=x2.lastIndex;let Y=u9.exec($);return Y?Y.index+Y[0].length:$.length}if(g2.lastIndex=Z,g2.exec($)?.index===Z){d9.lastIndex=g2.lastIndex;let Y=d9.exec($);return Y?Y.index+Y[0].length:$.length}return-1}function h2($,Z){let J=[],X=0,Y=$.length,Q=!1,G=null;while(X<Y){let z=$[X];if(Q){if(G){if(z===G)G=null}else if(z==='"'||z==="'")G=z;else if(z===">")Q=!1;X++;continue}if(z!=="<"){let W=$.indexOf("<",X+1);if(W===-1)break;X=W;continue}let q=Z($,X);if(q>X){J.push({start:X,end:q,token:$.slice(X,q)}),X=q;continue}let K=J3($,X);if(K>X){X=K;continue}let U=$.charCodeAt(X+1);if(U>=65&&U<=90||U>=97&&U<=122)Q=!0;X++}return J}function X3($){let Z=0,J=0,X=0,Y=!1,Q=null;while(X<$.length){if(Y){let W=$[X];if(Q){if(W===Q)Q=null}else if(W==='"'||W==="'")Q=W;else if(W===">")Y=!1;X++;continue}let G=$.indexOf("<",X),z=G===-1?$.length:G;while(X<z){let W=$[X++];if(W==="{")Z++;else if(W==="}")J++;if(Z>=2&&J>=2)return!0}if(G===-1)break;let q=J3($,G);if(q>G){X=q;continue}let K=$.charCodeAt(G+1),U=K===47?$.charCodeAt(G+2):K;if(U>=65&&U<=90||U>=97&&U<=122)Y=!0;X=G+1}return!1}function u2($,Z){while($.size>=Z){let J=$.keys().next();if(J.done)return;$.delete(J.value)}}var a8=65536,t8=12,x9=new Map;function p0($,Z,J,X){let Y=X!==void 0&&$.length>=a8,Q=Y?`${X}\x00${$}`:"";if(Y){let U=x9.get(Q);if(U)return{output:U.output,tokens:U.tokens.slice()}}let G=h2($,Z);if(G.length===0)return{output:$,tokens:[]};let z=G.map((U)=>U.token),q="",K=0;for(let U=0;U<G.length;U++){let W=G[U];q+=$.slice(K,W.start),q+=J(W.token,U),K=W.end}if(q+=$.slice(K),Y)return u2(x9,t8),x9.set(Q,{output:q,tokens:z}),{output:q,tokens:z.slice()};return{output:q,tokens:z}}var e8=65536,$Z=4,g9=new Map;function h9($,Z,J){return{output:Z,scripts:J,restore:(X)=>X===Z?$:d2(X,J)}}function i0($){let Z=$.length>=e8;if(Z){let Y=g9.get($);if(Y)return h9($,Y.output,Y.scripts.slice())}let{output:J,tokens:X}=p0($,Y1,(Y,Q)=>`\x00STX_SCRIPT_${Q}\x00`);if(Z)return u2(g9,$Z),g9.set($,{output:J,scripts:X}),h9($,J,X.slice());return h9($,J,X)}function d2($,Z){if(Z.length===0)return $;return $.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(J,X)=>Z[+X]??"")}var Q2={},Y3=new Map;function ZZ($){let Z=Y3.get($);if(!Z){let J=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");Z=new RegExp(`:${J}(?!\\w)`,"g"),Y3.set($,Z)}return Z.lastIndex=0,Z}var m2={uppercase:($,Z)=>{return $!==void 0&&$!==null?String($).toUpperCase():""},lowercase:($,Z)=>{return $!==void 0&&$!==null?String($).toLowerCase():""},capitalize:($,Z)=>{if($===void 0||$===null)return"";let J=String($);return J.charAt(0).toUpperCase()+J.slice(1)},number:($,Z,J=0)=>{if($===void 0||$===null)return"";try{let X=Number($);return Number.isNaN(X)?"":X.toFixed(Number.parseInt(String(J),10))}catch{return""}},fmt:($,Z,J="en-US")=>{if($===void 0||$===null)return"";try{let X=Number($);if(Number.isNaN(X))return String($);return X.toLocaleString(J)}catch{return String($)}},join:($,Z,J=",")=>{if(!Array.isArray($))return"";return $.join(String(J))},escape:($,Z)=>{if($===void 0||$===null)return"";return z3(String($))},translate:($,Z,J={})=>{if(!Z||!Z.__translations)return $;let X=Z.__translations,Y=Z.__i18nConfig?.fallbackToKey??!0,Q=String($).split("."),G=X;for(let q of Q){if(G===void 0||G===null)break;G=G[q]}if(G===void 0||G===null)return Y?$:"";let z=String(G);return Object.entries(J).forEach(([q,K])=>{z=z.replace(ZZ(q),String(K))}),z},t:($,Z,J={})=>{return m2.translate($,Z,J)},truncate:($,Z,J=50,X="...")=>{if($===void 0||$===null)return"";let Y=String($);if(Y.length<=J)return Y;if(J<=X.length)return X.substring(0,J);return Y.substring(0,J-X.length)+X},date:($,Z,J="short",X="en-US")=>{if($===void 0||$===null)return"";try{let Y=$ instanceof Date?$:new Date($);if(Number.isNaN(Y.getTime()))return String($);let Q={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"},full:{dateStyle:"full"},time:{timeStyle:"short"},datetime:{dateStyle:"short",timeStyle:"short"},iso:{}};if(J==="iso")return Y.toISOString();return new Intl.DateTimeFormat(X,Q[J]||Q.short).format(Y)}catch{return String($)}},currency:($,Z,J="USD",X="en-US")=>{if($===void 0||$===null)return"";try{let Y=Number($);if(Number.isNaN(Y))return String($);return new Intl.NumberFormat(X,{style:"currency",currency:J}).format(Y)}catch{return String($)}},pluralize:($,Z,J,X)=>{let Y=Number($);if(Number.isNaN(Y))return J;let Q=X||`${J}s`;return Y===1?J:Q},first:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return $.length===0?"":$[0];return String($).charAt(0)},last:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return $.length===0?"":$[$.length-1];let J=String($);return J.charAt(J.length-1)},length:($,Z)=>{if($===void 0||$===null)return 0;if(Array.isArray($)||typeof $==="string")return $.length;if($ instanceof Map||$ instanceof Set)return $.size;if(typeof $==="object")return Object.keys($).length;return 0},json:($,Z,J=!1)=>{if($===void 0)return"undefined";if($===null)return"null";try{return J?JSON.stringify($,null,2):JSON.stringify($)}catch{return String($)}},default:($,Z,J="")=>{return $===void 0||$===null||$===""?J:$},reverse:($,Z)=>{if($===void 0||$===null)return"";if(Array.isArray($))return[...$].reverse();return String($).split("").reverse().join("")},slice:($,Z,J=0,X)=>{if($===void 0||$===null)return"";if(Array.isArray($)||typeof $==="string")return $.slice(J,X);return $},replace:($,Z,J,X="")=>{if($===void 0||$===null)return"";let Y=J.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String($).replace(new RegExp(Y,"g"),()=>X)},stripTags:($,Z)=>{if($===void 0||$===null)return"";return String($).replace(/<[^>]*>/g,"")},urlencode:($,Z)=>{if($===void 0||$===null)return"";return encodeURIComponent(String($))},abs:($,Z)=>{let J=Number($);return Number.isNaN(J)?0:Math.abs(J)},round:($,Z,J=0)=>{let X=Number($);if(Number.isNaN(X))return 0;let Y=10**J;return Math.round(X*Y)/Y}};function JZ($,Z){if($ in m2)console.warn(`Filter "${$}" already exists as a built-in filter. Custom filter will take precedence.`);Q2[$]=Z}function pz($){for(let[Z,J]of Object.entries($))JZ(Z,J)}function XZ(){return{...m2,...Q2}}function iz(){for(let $ of Object.keys(Q2))delete Q2[$]}function m9($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function z3($){return m9($).replace(/\{{2,}/g,(Z)=>YZ(Z.length)).replace(/\{(?=!)/g,`&#123;${q3}`)}var q3="&#8288;";function YZ($){return Array.from({length:$},()=>"&#123;").join(q3)}function Q1($,Z){let{scripts:J}=i0($);for(let X of J){let Y=X.match(/^<script\b([^>]*)>([\s\S]*?)<\/script\s*>$/i);if(!Y||/\bserver\b|\bsrc\s*=/.test(Y[1]))continue;let Q=Y[2];if(/\b(state|derived|effect|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/.test(Q))return!0;if(G3(Q,Z))return!0}if(/@(if|for|show)\s*=\s*["'][^"']*\(\s*\)/.test($))return!0;if(/@for\s*=\s*["'][^"']*\s+(?:in|of)\s+[^"']*\(\s*\)/.test($))return!0;if(/(?:^|[\s"'])(?::|x-)(?:for|if|else-if|else|show|text|html|model|bind)\b/.test($))return!0;return!1}function Q3($,Z){let J=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined","NaN","Infinity","isNaN","isFinite","window","document","console"],X=$.replace(/'[^']*'/g,"").replace(/"[^"]*"/g,""),Y="",Q=!1,G=0;for(let K=0;K<X.length;K++){let U=X[K];if(!Q&&U==="`"){Q=!0,G=0;continue}if(Q){if(U==="`"&&G===0){Q=!1;continue}if(U==="$"&&X[K+1]==="{"){G++,K++,Y+=" ";continue}if(U==="}"&&G>0){G--;continue}if(G>0){Y+=U;continue}continue}Y+=U}X=Y;let z=/(?<![a-zA-Z0-9_$])([a-zA-Z_$][a-zA-Z0-9_$]*)/g,q;while((q=z.exec(X))!==null){let K=q[1];if(!X.substring(0,q.index).trimEnd().endsWith(".")){if(!J.includes(K)&&!(K in Z))return!1}}return!0}function QZ($,Z){let J=Z.__stx_serverDeclared;if(!J||J.size===0)return!1;let X=x0($);for(let Y of J)if(new RegExp(`(?<![.#\\w$])${Y}(?![\\w$])`).test(X))return!0;return!1}function l9($,Z){let J=$;return J=J.replace(/\{!!([\s\S]*?)!!\}/g,(X,Y)=>{try{let Q=P0(Y,Z);if(Q===void 0)return X;return Q===null?"":String(Q)}catch{return X}}),J=J.replace(/\{\{([\s\S]*?)\}\}/g,(X,Y)=>{let Q=Y.trim();if(/^__[A-Z_]+__$/.test(Q))return X;try{let G=P0(Y,Z);if(G===void 0)return X;return JSON.stringify(G).replace(/</g,"\\u003c")}catch{return X}}),J}function GZ($,Z){if(!$.includes("{"))return $;let J=$;return J=J.replace(/\{!!([\s\S]*?)!!\}/g,(X,Y)=>{try{let Q=P0(Y,Z);if(Q===void 0)return X;return Q===null?"":String(Q)}catch{return X}}),J=J.replace(/\{\{([\s\S]*?)\}\}/g,(X,Y)=>{let Q=Y.trim();if(/^__[A-Z_]+__$/.test(Q))return X;try{let G=P0(Y,Z);if(G===void 0)return X;if(G===null)return"";return String(G).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}catch{return X}}),J}function nz($,Z,J={}){let{output:X,scripts:Y}=i0($),Q=Y.map((G)=>{let z=G.match(/^<script\b([^>]*)>([\s\S]*?)<\/script\s*>$/i),q=G.match(/^<script\b[^>]*>/i),K=G.search(/<\/script\s*>$/i);if(!z||!q||K===-1)return G;let U=z[1],W=z[2];if(/\bdata-raw\b/.test(U))return G;if(J.skipServer&&/\bserver\b/.test(U))return G;let j=`<script${GZ(U,Z)}>`;if(/\bsrc\s*=/.test(U)||/\btype\s*=\s*["']application\/json["']/.test(U))return j+W+G.slice(K);return j+l9(W,Z)+G.slice(K)});return d2(X,Q)}function _1($,Z,J){let X=$,Y=(W,H)=>{let j=y1(W,H);if(j===-1)return-1;return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(W.slice(H,j))?-1:j},Q=(W,H,j,B)=>{let V=j.length,{output:F,tokens:O}=p0(W,H,(_,L)=>B(V+L));return j.push(...O),F},G=[];X=Q(X,Y,G,(W)=>`<!--__STX_STYLE_${W}__-->`);let z=[];X=Q(X,Y1,z,(W)=>`<!--__STX_SCRIPT_EXPR_${W}__-->`);let q=Z?.__stx_signals_gate===!0||Q1($),K=new Set(Array.isArray(Z?.__stx_client_signal_names)?Z.__stx_client_signal_names:[]),U=new Set(Array.isArray(Z?.__stx_preserved_client_expressions)?Z.__stx_preserved_client_expressions:[]);if(X=X.replace(/\{\{\{([\s\S]*?)\}\}\}/g,(W,H,j)=>{try{let B=P0(H,Z);return B!==void 0&&B!==null?String(B):""}catch(B){let V=B instanceof Error?B.message:String(B);return j0("Expression",`Error evaluating: {{{ ${H.trim()}}}}: ${V}`,J,$,j,W)}}),X=X.replace(/\{!!([\s\S]*?)!!\}/g,(W,H,j)=>{try{let B=P0(H,Z);if(B===void 0&&Z.__stx_buildMode==="compile")return f2("raw",H.trim());return B!==void 0&&B!==null?String(B):""}catch(B){if(Z.__stx_buildMode==="compile")return f2("raw",H.trim());let V=B instanceof Error?B.message:String(B);return j0("Expression",`Error evaluating: {!! ${H.trim()} !!}: ${V}`,J,$,j,W)}}),X=Q(X,Y1,z,(W)=>`<!--__STX_SCRIPT_EXPR_${W}__-->`),X=Q(X,Y,G,(W)=>`<!--__STX_STYLE_${W}__-->`),X=X.replace(/\{\{([\s\S]*?)\}\}/g,(W,H,j)=>{let B=H.trim();if(U.has(B))return W;let V=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined"],F=/^([a-zA-Z_$][a-zA-Z0-9_$]*)/,_=B.match(F)?.[1],L=_&&((_ in Z)||V.includes(_)),w=Boolean(_&&K.has(_)),R=/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/,D=B.match(R),M=D&&!V.includes(D[1])&&!(D[1]in Z);if(/^__[A-Z_]+__$/.test(B))return"";try{let I=P0(H,Z);if(w)return W;if(q&&!Q3(B,Z))return W;if(Z.__stx_buildMode==="compile"&&!q&&(I===void 0||QZ(B,Z)))return f2("expr",B);return I!==void 0&&I!==null?z3(String(I)):""}catch(I){if(w)return W;if(q&&!Q3(B,Z))return W;if(M)return W;let N=I instanceof Error?I.message:String(I);return j0("Expression",`Error evaluating: {{ ${B} }}: ${N}`,J,$,j,W)}}),z.length>0)X=X.replace(/<!--__STX_SCRIPT_EXPR_(\d+)__-->/g,(W,H)=>z[Number(H)]??W);if(G.length>0)X=X.replace(/<!--__STX_STYLE_(\d+)__-->/g,(W,H)=>G[Number(H)]??W);return X}function zZ($,Z,J){if(!Z.trim())return $;let X=$,Y=Z.trim();while(Y.length>0){let Q=Y.match(/^(\w+)/);if(!Q)break;let G=Q[1];Y=Y.substring(G.length).trim();let z=Q2[G]||m2[G];if(!z)throw Error(`Filter not found: ${G}. Available filters: ${Object.keys(XZ()).join(", ")}`);let q=[];if(Y.startsWith(":")){let K=Y.match(/^:([^|\s]+)/);if(K){let U=K[1].trim();try{let W=Number(U);q=[Number.isNaN(W)?U:W]}catch{q=[U]}Y=Y.substring(K[0].length).trim()}}else if(Y.startsWith("(")){let K=1,U=1;while(K>0&&U<Y.length){if(Y[U]==="(")K++;if(Y[U]===")")K--;U++}if(K===0){let W=Y.substring(1,U-1).trim();if(W)try{if(W.startsWith("{")&&W.endsWith("}"))q=[P0(`(${W})`,J,!0)];else{let H=[],j="",B=null,V=0,F=0,O=0,_=!1;for(let L=0;L<W.length;L++){let w=W[L];if(_){j+=w,_=!1;continue}if(w==="\\"){j+=w,_=!0;continue}if(B){if(j+=w,w===B)B=null;continue}if(w==='"'||w==="'"||w==="`"){B=w,j+=w;continue}if(w==="(")V++;else if(w===")")V--;else if(w==="[")F++;else if(w==="]")F--;else if(w==="{")O++;else if(w==="}")O--;if(w===","&&V===0&&F===0&&O===0){H.push(j),j="";continue}j+=w}if(j)H.push(j);q=H.map((L)=>{let w=L.trim();return P0(w,J,!0)})}}catch{q=[W]}Y=Y.substring(U).trim()}}try{X=z(X,J,...q)}catch(K){let U=K instanceof Error?K.message:String(K);throw Error(`Error applying filter '${G}': ${U}`)}if(Y.startsWith("|"))Y=Y.substring(1).trim();else break}return X}function qZ($){let Z=!1,J="",X=0,Y=0,Q=0,G=!1;for(let z=0;z<$.length;z++){let q=$[z],K=$[z+1];if(Z&&G){G=!1;continue}if(Z&&q==="\\"){G=!0;continue}if(G=!1,(q==='"'||q==="'"||q==="`")&&!G){if(!Z)Z=!0,J=q;else if(q===J)Z=!1,J="";continue}if(Z&&J==="`"&&q==="$"&&K==="{"){let U=1;z+=2;while(z<$.length&&U>0){if($[z]==="{")U++;else if($[z]==="}")U--;if(U>0)z++}continue}if(Z)continue;if(q==="(")X++;else if(q===")")X--;else if(q==="[")Y++;else if(q==="]")Y--;else if(q==="{")Q++;else if(q==="}")Q--;if(q==="|"&&X===0&&Y===0&&Q===0){if(K==="|"){z++;continue}if(K==="="){z++;continue}return z}}return-1}function P0($,Z,J=!1){try{let X=$.trim(),Y=qZ(X);if(Y>0){let Q=X.substring(0,Y).trim(),G=X.substring(Y+1).trim(),z=P0(Q,Z,!0);return zZ(z,G,Z)}if(!q0(X)){if(!J)console.warn(`Potentially unsafe expression detected, using safe evaluator: ${X}`);return e(X,Z)}try{let Q=Object.keys(Z),G=Object.values(Z);return U0(X,Q)(...G)}catch{return e(X,Z)}}catch(X){if(X instanceof ReferenceError){let Y=/(\b\w+)\s+is not defined/.exec(X.message);if(Y){let Q=Y[1],G=KZ(Q,Object.keys(Z));if(G&&G!==Q)X.message=`${X.message} \u2014 did you mean '${G}'?`}}if(!J)console.error(`Error evaluating expression: ${$}`,X);throw X}}function KZ($,Z){let J=null;for(let Y of Z){if(Y===$)continue;let Q=UZ($,Y);if(J===null||Q<J.dist)J={key:Y,dist:Q}}if(!J)return null;let X=Math.max($.length,J.key.length);if(J.dist<=2||J.dist/X<=0.35)return J.key;return null}function UZ($,Z){if($===Z)return 0;if($.length===0)return Z.length;if(Z.length===0)return $.length;let[J,X]=$.length<Z.length?[$,Z]:[Z,$],Y=Array(J.length+1),Q=Array(J.length+1);for(let G=0;G<=J.length;G++)Y[G]=G;for(let G=1;G<=X.length;G++){Q[0]=G;for(let z=1;z<=J.length;z++){let q=J[z-1]===X[G-1]?0:1;Q[z]=Math.min(Q[z-1]+1,Y[z]+1,Y[z-1]+q)}for(let z=0;z<=J.length;z++)Y[z]=Q[z]}return Y[J.length]}function oz($){if(!$)return"";return $.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#039;/g,"'").replace(/&#39;/g,"'").replace(/&amp;/g,"&")}import qG from"fs";import M0 from"path";var c9=[{open:/<!--/g,close:/-->/g},{open:/<script\b/gi,close:/<\/script\s*>/gi},{open:/<style\b/gi,close:/<\/style\s*>/gi}],K3=/<body\b([^>]*)>/gi;function G1($){let Z=0,J,X=c9.map(()=>{return});while(Z<$.length){if(J===void 0||J!==null&&J.index<Z)K3.lastIndex=Z,J=K3.exec($);if(!J)return null;let Y=J.index,Q=-1,G=null;for(let q=0;q<c9.length;q++){let K=c9[q],U=X[q];if(U===void 0||U!==null&&U.index<Z)K.open.lastIndex=Z,U=K.open.exec($),X[q]=U;if(!U)continue;if(U.index<Y&&(Q===-1||U.index<Q))Q=U.index,G=K.close}if(Q===-1||!G)return{index:Y,tag:J[0],attrs:J[1]??""};G.lastIndex=Q;let z=G.exec($);if(!z)return null;Z=z.index+z[0].length}return null}function C1($,Z){let J=G1($);if(!J)return $;return $.slice(0,J.index)+Z(J.tag,J.attrs)+$.slice(J.index+J.tag.length)}var U3=null;function WZ($){if(!U3)return console.warn(`[stx] ${$} must be called within a component setup.`),null;return U3}function az($){let Z=WZ("onUpdate");if(Z)Z.updateHooks.push($)}function W3(){return`
127
125
  // STX Lifecycle Runtime
128
126
  (function() {
129
127
  if (typeof window === 'undefined') return;
@@ -471,7 +469,7 @@ else {
471
469
 
472
470
  console.log('[stx] Lifecycle runtime initialized');
473
471
  })();
474
- `}function p9($){return Symbol($)}var ez=p9("theme"),$q=p9("router"),Zq=p9("i18n");import*as j3 from"crypto";function H3($){let Z=/\$(\w+)\./g,J=[],X;while((X=Z.exec($))!==null)if(!J.includes(X[1]))J.push(X[1]);return J}function UZ(){return`stx-${j3.randomBytes(4).toString("hex")}`}function WZ($){return/\$\w+\./.test($)}function HZ($){if(!$.includes("{{")||!/\$\w+\./.test($))return{html:$,bindings:[],stores:new Set};let Z=[],J=new Set,X=/<(\w+)([^>]*?)(\s*\/?>)/g,Y=$;return Y=Y.replace(X,(Q,G,z,q)=>{if(["script","style","template"].includes(G.toLowerCase()))return Q;let K=[],U=!1,W=z,H=/(\w+(?:-\w+)*)\s*=\s*"([^"]*\{\{[^}]*\$\w+[^}]*\}\}[^"]*)"/g,j=[...z.matchAll(H)];for(let F of j){let O=F[0],_=F[1],L=F[2];if(WZ(L)){U=!0;let w=L.match(/\{\{\s*([\s\S]+?)\s*\}\}/);if(w){let R=w[1];if(K.push({attr:_,expr:R,fullMatch:O,originalAttr:_}),H3(R).forEach((M)=>J.add(M)),_==="text")W=W.replace(O,"");else if(_==="class")W=W.replace(O,'class=""');else if(_==="disabled"||_==="hidden")W=W.replace(O,"");else W=W.replace(O,`${_}=""`)}}}if(!U)return Q;let B=W.match(/\bid\s*=\s*"([^"]+)"/),V;if(B)V=B[1];else V=UZ(),W=` id="${V}"${W}`;for(let F of K)Z.push({elementId:V,attribute:F.attr,expression:F.expr,stores:H3(F.expr)});return`<${G}${W}${q}`}),{html:Y,bindings:Z,stores:J}}function jZ($,Z){if($.length===0)return"";let J=Array.from(Z),X=`
472
+ `}function p9($){return Symbol($)}var tz=p9("theme"),ez=p9("router"),$q=p9("i18n");import*as j3 from"crypto";function H3($){let Z=/\$(\w+)\./g,J=[],X;while((X=Z.exec($))!==null)if(!J.includes(X[1]))J.push(X[1]);return J}function HZ(){return`stx-${j3.randomBytes(4).toString("hex")}`}function jZ($){return/\$\w+\./.test($)}function BZ($){if(!$.includes("{{")||!/\$\w+\./.test($))return{html:$,bindings:[],stores:new Set};let Z=[],J=new Set,X=/<(\w+)([^>]*?)(\s*\/?>)/g,Y=$;return Y=Y.replace(X,(Q,G,z,q)=>{if(["script","style","template"].includes(G.toLowerCase()))return Q;let K=[],U=!1,W=z,H=/(\w+(?:-\w+)*)\s*=\s*"([^"]*\{\{[^}]*\$\w+[^}]*\}\}[^"]*)"/g,j=[...z.matchAll(H)];for(let F of j){let O=F[0],_=F[1],L=F[2];if(jZ(L)){U=!0;let w=L.match(/\{\{\s*([\s\S]+?)\s*\}\}/);if(w){let R=w[1];if(K.push({attr:_,expr:R,fullMatch:O,originalAttr:_}),H3(R).forEach((M)=>J.add(M)),_==="text")W=W.replace(O,"");else if(_==="class")W=W.replace(O,'class=""');else if(_==="disabled"||_==="hidden")W=W.replace(O,"");else W=W.replace(O,`${_}=""`)}}}if(!U)return Q;let B=W.match(/\bid\s*=\s*"([^"]+)"/),V;if(B)V=B[1];else V=HZ(),W=` id="${V}"${W}`;for(let F of K)Z.push({elementId:V,attribute:F.attr,expression:F.expr,stores:H3(F.expr)});return`<${G}${W}${q}`}),{html:Y,bindings:Z,stores:J}}function VZ($,Z){if($.length===0)return"";let J=Array.from(Z),X=`
475
473
  <script>
476
474
  (function() {
477
475
  'use strict';
@@ -629,10 +627,10 @@ else {
629
627
  }
630
628
  })();
631
629
  </script>
632
- `,X}function B3($){let{html:Z,bindings:J,stores:X}=HZ($);if(J.length===0)return $;let Y=jZ(J,X),Q=Z.lastIndexOf("</body>");if(Q!==-1)return Z.slice(0,Q)+Y+Z.slice(Q);return Z+Y}function V3($){let Z=$.analytics;if(!Z?.enabled)return"";switch(Z.driver){case"fathom":return BZ(Z);case"google-analytics":return VZ(Z);case"plausible":return LZ(Z);case"self-hosted":return _Z(Z);case"custom":return OZ(Z);default:return""}}function BZ($){let Z=$.fathom;if(!Z?.siteId)return"";let J=Z.scriptUrl||"https://cdn.usefathom.com/script.js",X=Z.defer!==!1?" defer":"",Y=[`data-site="${v0(Z.siteId)}"`];if(Z.honorDnt)Y.push('data-honor-dnt="true"');if(Z.spa)Y.push('data-spa="auto"');if(Z.canonical)Y.push(`data-canonical="${v0(Z.canonical)}"`);if(Z.auto===!1)Y.push('data-auto="false"');return`
630
+ `,X}function B3($){let{html:Z,bindings:J,stores:X}=BZ($);if(J.length===0)return $;let Y=VZ(J,X),Q=Z.lastIndexOf("</body>");if(Q!==-1)return Z.slice(0,Q)+Y+Z.slice(Q);return Z+Y}function V3($){let Z=$.analytics;if(!Z?.enabled)return"";switch(Z.driver){case"fathom":return LZ(Z);case"google-analytics":return _Z(Z);case"plausible":return OZ(Z);case"self-hosted":return FZ(Z);case"custom":return wZ(Z);default:return""}}function LZ($){let Z=$.fathom;if(!Z?.siteId)return"";let J=Z.scriptUrl||"https://cdn.usefathom.com/script.js",X=Z.defer!==!1?" defer":"",Y=[`data-site="${v0(Z.siteId)}"`];if(Z.honorDnt)Y.push('data-honor-dnt="true"');if(Z.spa)Y.push('data-spa="auto"');if(Z.canonical)Y.push(`data-canonical="${v0(Z.canonical)}"`);if(Z.auto===!1)Y.push('data-auto="false"');return`
633
631
  <!-- Fathom Analytics -->
634
632
  <script src="${v0(J)}" ${Y.join(" ")}${X}></script>
635
- `}function VZ($){let Z=$.googleAnalytics;if(!Z?.measurementId)return"";let J=v0(Z.measurementId),X=Z.debug?`gtag('config', '${J}', { 'debug_mode': true });`:"";return`
633
+ `}function _Z($){let Z=$.googleAnalytics;if(!Z?.measurementId)return"";let J=v0(Z.measurementId),X=Z.debug?`gtag('config', '${J}', { 'debug_mode': true });`:"";return`
636
634
  <!-- Google Analytics -->
637
635
  <script async src="https://www.googletagmanager.com/gtag/js?id=${J}"></script>
638
636
  <script>
@@ -642,10 +640,10 @@ else {
642
640
  gtag('config', '${J}');
643
641
  ${X}
644
642
  </script>
645
- `}function LZ($){let Z=$.plausible;if(!Z?.domain)return"";let J=Z.scriptUrl||"https://plausible.io/js/script.js",X=[`data-domain="${v0(Z.domain)}"`],Y=J,Q=[];if(Z.trackLocalhost)Q.push("local");if(Z.hashMode)Q.push("hash");if(Q.length>0&&J==="https://plausible.io/js/script.js")Y=`https://plausible.io/js/script.${Q.join(".")}.js`;return`
643
+ `}function OZ($){let Z=$.plausible;if(!Z?.domain)return"";let J=Z.scriptUrl||"https://plausible.io/js/script.js",X=[`data-domain="${v0(Z.domain)}"`],Y=J,Q=[];if(Z.trackLocalhost)Q.push("local");if(Z.hashMode)Q.push("hash");if(Q.length>0&&J==="https://plausible.io/js/script.js")Y=`https://plausible.io/js/script.${Q.join(".")}.js`;return`
646
644
  <!-- Plausible Analytics -->
647
645
  <script defer data-domain="${v0(Z.domain)}" src="${v0(Y)}"></script>
648
- `}function _Z($){let Z=$.selfHosted;if(!Z?.siteId||!Z?.apiEndpoint)return"";let J=v0(Z.siteId),X=v0(Z.apiEndpoint),Y=Z.honorDnt?'if(n.doNotTrack==="1")return;':"",Q=Z.trackHashChanges?"w.addEventListener('hashchange',pv);":"",G=Z.trackOutboundLinks?`
646
+ `}function FZ($){let Z=$.selfHosted;if(!Z?.siteId||!Z?.apiEndpoint)return"";let J=v0(Z.siteId),X=v0(Z.apiEndpoint),Y=Z.honorDnt?'if(n.doNotTrack==="1")return;':"",Q=Z.trackHashChanges?"w.addEventListener('hashchange',pv);":"",G=Z.trackOutboundLinks?`
649
647
  d.addEventListener('click',function(e){
650
648
  var a=e.target.closest('a');
651
649
  if(a&&a.hostname!==location.hostname){
@@ -678,7 +676,7 @@ else {
678
676
  w.stxAnalytics={track:function(n,v){t('event',{name:n,value:v});}};
679
677
  })();
680
678
  </script>
681
- `}function OZ($){let Z=$.custom;if(!Z)return"";if(Z.inlineScript)return`
679
+ `}function wZ($){let Z=$.custom;if(!Z)return"";if(Z.inlineScript)return`
682
680
  <!-- Custom Analytics -->
683
681
  <script>
684
682
  ${Z.inlineScript}
@@ -686,7 +684,7 @@ ${Z.inlineScript}
686
684
  `;if(!Z.scriptUrl)return"";let J=[];if(Z.scriptId)J.push(`id="${v0(Z.scriptId)}"`);if(Z.attributes)for(let[Y,Q]of Object.entries(Z.attributes))J.push(`${v0(Y)}="${v0(Q)}"`);return`
687
685
  <!-- Custom Analytics -->
688
686
  <script${J.length>0?` ${J.join(" ")}`:""} src="${v0(Z.scriptUrl)}" defer></script>
689
- `}function L3($,Z){let J=V3(Z);if(!J)return $;if(!$.includes("</head>")){let X=$.lastIndexOf("</body>");if(X!==-1)return $.slice(0,X)+J+$.slice(X);return $+J}return $.replace("</head>",`${J}</head>`)}function v0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var Yq={name:"analytics",hasEndTag:!1,handler:async($,Z,J,X)=>{let Y=J.__stx_config||{};return V3(Y)}};var FZ={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 _3($){let Z=$.heatmap;if(!Z?.enabled)return"";let J={...FZ,...Z};return`
687
+ `}function L3($,Z){let J=V3(Z);if(!J)return $;if(!$.includes("</head>")){let X=$.lastIndexOf("</body>");if(X!==-1)return $.slice(0,X)+J+$.slice(X);return $+J}return $.replace("</head>",`${J}</head>`)}function v0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var Xq={name:"analytics",hasEndTag:!1,handler:async($,Z,J,X)=>{let Y=J.__stx_config||{};return V3(Y)}};var RZ={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 _3($){let Z=$.heatmap;if(!Z?.enabled)return"";let J={...RZ,...Z};return`
690
688
  <!-- stx Heatmap - Privacy-Compliant Tracking -->
691
689
  <script>
692
690
  (function() {
@@ -1069,7 +1067,7 @@ else {
1069
1067
  };
1070
1068
  })();
1071
1069
  </script>
1072
- `}function O3($,Z){let J=_3(Z);if(!J)return $;let X=$.lastIndexOf("</body>");if(X!==-1)return $.slice(0,X)+J+$.slice(X);return $+J}var F3={name:"heatmap",hasEndTag:!1,description:"Inject privacy-compliant heatmap tracking script",handler:async($,Z,J,X)=>{let Y=J.__stx_config||{};if(Z.length>0){let Q=wZ(Z.join(" "));Y.heatmap={...Y.heatmap,...Q,enabled:!0}}return _3(Y)}};function wZ($){let Z={},J=$.match(/(\w+)=["']?([^"'\s]+)["']?/g)||[];for(let X of J){let[Y,Q]=X.split("="),G=Q?.replace(/["']/g,"");switch(Y){case"endpoint":Z.endpoint=G;break;case"samplingRate":Z.samplingRate=Number.parseInt(G,10);break;case"batchSize":Z.batchSize=Number.parseInt(G,10);break;case"trackMouse":Z.trackMouse=G==="true";break;case"trackClicks":Z.trackClicks=G==="true";break;case"trackScroll":Z.trackScroll=G==="true";break;case"honorDnt":Z.honorDnt=G==="true";break;case"debugOverlay":Z.debugOverlay=G==="true";break}}return Z}class w3{sessions=new Map;addSession($){let Z=this.sessions.get($.sid);if(Z)Z.points.push(...$.points),Z.lastActivity=Math.max(Z.lastActivity,$.lastActivity);else this.sessions.set($.sid,$)}getPageData($){let Z=[];for(let J of this.sessions.values())if(J.page===$)Z.push(...J.points);return Z}getClickData($){return this.getPageData($).filter((Z)=>Z.type==="click")}getMovementData($){return this.getPageData($).filter((Z)=>Z.type==="move")}getScrollData($){let Z=this.getPageData($).filter((X)=>X.type==="scroll"),J=new Map;for(let X of Z)if(X.depth!==void 0)J.set(X.depth,(J.get(X.depth)||0)+1);return Array.from(J.entries()).map(([X,Y])=>({depth:X,count:Y})).sort((X,Y)=>X.depth-Y.depth)}getZoneStats($){let Z=new Map,J=this.getPageData($);for(let X of J)if(X.zone){let Y=Z.get(X.zone)||{clicks:0,hovers:0};if(X.type==="click")Y.clicks++;else if(X.type==="move")Y.hovers++;Z.set(X.zone,Y)}return Z}generateGridData($,Z=20){let J=this.getPageData($),X=[];for(let Q=0;Q<Z;Q++){X[Q]=[];for(let G=0;G<Z;G++)X[Q][G]=0}for(let Q of J){let G=Math.min(Math.floor(Q.x/100*Z),Z-1),z=Math.min(Math.floor(Q.y/100*Z),Z-1);X[z][G]+=Q.type==="click"?3:1}let Y=0;for(let Q of X)for(let G of Q)Y=Math.max(Y,G);return X.map((Q,G)=>Q.map((z,q)=>({x:q,y:G,intensity:Y>0?z/Y:0})))}exportJSON(){return JSON.stringify({sessions:Array.from(this.sessions.values()),exportedAt:new Date().toISOString()},null,2)}clear(){this.sessions.clear()}get sessionCount(){return this.sessions.size}get totalPoints(){let $=0;for(let Z of this.sessions.values())$+=Z.points.length;return $}}function Gq(){return new w3}var RZ;((G)=>{G.Fade="fade";G.Slide="slide";G.Scale="scale";G.Flip="flip";G.Rotate="rotate";G.Custom="custom"})(RZ||={});var DZ;((X)=>{X.In="in";X.Out="out";X.Both="both"})(DZ||={});var NZ;((G)=>{G.Linear="linear";G.Ease="ease";G.EaseIn="ease-in";G.EaseOut="ease-out";G.EaseInOut="ease-in-out";G.Spring="spring"})(NZ||={});var $1={duration:300,delay:0,ease:"ease",direction:"both"};function MZ($,Z={}){let{duration:J,delay:X,ease:Y,direction:Q,custom:G}={...$1,...Z};if($==="custom"&&G)return G;switch($){case"fade":return`${Q==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":Q==="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);"}
1070
+ `}function O3($,Z){let J=_3(Z);if(!J)return $;let X=$.lastIndexOf("</body>");if(X!==-1)return $.slice(0,X)+J+$.slice(X);return $+J}var F3={name:"heatmap",hasEndTag:!1,description:"Inject privacy-compliant heatmap tracking script",handler:async($,Z,J,X)=>{let Y=J.__stx_config||{};if(Z.length>0){let Q=DZ(Z.join(" "));Y.heatmap={...Y.heatmap,...Q,enabled:!0}}return _3(Y)}};function DZ($){let Z={},J=$.match(/(\w+)=["']?([^"'\s]+)["']?/g)||[];for(let X of J){let[Y,Q]=X.split("="),G=Q?.replace(/["']/g,"");switch(Y){case"endpoint":Z.endpoint=G;break;case"samplingRate":Z.samplingRate=Number.parseInt(G,10);break;case"batchSize":Z.batchSize=Number.parseInt(G,10);break;case"trackMouse":Z.trackMouse=G==="true";break;case"trackClicks":Z.trackClicks=G==="true";break;case"trackScroll":Z.trackScroll=G==="true";break;case"honorDnt":Z.honorDnt=G==="true";break;case"debugOverlay":Z.debugOverlay=G==="true";break}}return Z}class w3{sessions=new Map;addSession($){let Z=this.sessions.get($.sid);if(Z)Z.points.push(...$.points),Z.lastActivity=Math.max(Z.lastActivity,$.lastActivity);else this.sessions.set($.sid,$)}getPageData($){let Z=[];for(let J of this.sessions.values())if(J.page===$)Z.push(...J.points);return Z}getClickData($){return this.getPageData($).filter((Z)=>Z.type==="click")}getMovementData($){return this.getPageData($).filter((Z)=>Z.type==="move")}getScrollData($){let Z=this.getPageData($).filter((X)=>X.type==="scroll"),J=new Map;for(let X of Z)if(X.depth!==void 0)J.set(X.depth,(J.get(X.depth)||0)+1);return Array.from(J.entries()).map(([X,Y])=>({depth:X,count:Y})).sort((X,Y)=>X.depth-Y.depth)}getZoneStats($){let Z=new Map,J=this.getPageData($);for(let X of J)if(X.zone){let Y=Z.get(X.zone)||{clicks:0,hovers:0};if(X.type==="click")Y.clicks++;else if(X.type==="move")Y.hovers++;Z.set(X.zone,Y)}return Z}generateGridData($,Z=20){let J=this.getPageData($),X=[];for(let Q=0;Q<Z;Q++){X[Q]=[];for(let G=0;G<Z;G++)X[Q][G]=0}for(let Q of J){let G=Math.min(Math.floor(Q.x/100*Z),Z-1),z=Math.min(Math.floor(Q.y/100*Z),Z-1);X[z][G]+=Q.type==="click"?3:1}let Y=0;for(let Q of X)for(let G of Q)Y=Math.max(Y,G);return X.map((Q,G)=>Q.map((z,q)=>({x:q,y:G,intensity:Y>0?z/Y:0})))}exportJSON(){return JSON.stringify({sessions:Array.from(this.sessions.values()),exportedAt:new Date().toISOString()},null,2)}clear(){this.sessions.clear()}get sessionCount(){return this.sessions.size}get totalPoints(){let $=0;for(let Z of this.sessions.values())$+=Z.points.length;return $}}function Qq(){return new w3}var NZ;((G)=>{G.Fade="fade";G.Slide="slide";G.Scale="scale";G.Flip="flip";G.Rotate="rotate";G.Custom="custom"})(NZ||={});var MZ;((X)=>{X.In="in";X.Out="out";X.Both="both"})(MZ||={});var AZ;((G)=>{G.Linear="linear";G.Ease="ease";G.EaseIn="ease-in";G.EaseOut="ease-out";G.EaseInOut="ease-in-out";G.Spring="spring"})(AZ||={});var e0={duration:300,delay:0,ease:"ease",direction:"both"};function kZ($,Z={}){let{duration:J,delay:X,ease:Y,direction:Q,custom:G}={...e0,...Z};if($==="custom"&&G)return G;switch($){case"fade":return`${Q==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":Q==="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);"}
1073
1071
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
1074
1072
  @keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }`;case"slide":return`${Q==="in"?"transform: translateY(20px); opacity: 0; animation: slideIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":Q==="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);"}
1075
1073
  @keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@@ -1079,7 +1077,7 @@ else {
1079
1077
  @keyframes flipIn { from { transform: perspective(400px) rotateX(-90deg); opacity: 0; } to { transform: perspective(400px) rotateX(0); opacity: 1; } }
1080
1078
  @keyframes flipOut { from { transform: perspective(400px) rotateX(0); opacity: 1; } to { transform: perspective(400px) rotateX(90deg); opacity: 0; } }`;case"rotate":return`${Q==="in"?"transform: rotate(-90deg); opacity: 0; animation: rotateIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":Q==="out"?"transform: rotate(0); opacity: 1; animation: rotateOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: rotate(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);"}
1081
1079
  @keyframes rotateIn { from { transform: rotate(-90deg); opacity: 0; } to { transform: rotate(0); opacity: 1; } }
1082
- @keyframes rotateOut { from { transform: rotate(0); opacity: 1; } to { transform: rotate(90deg); opacity: 0; } }`;default:return""}}function AZ(){return`
1080
+ @keyframes rotateOut { from { transform: rotate(0); opacity: 1; } to { transform: rotate(90deg); opacity: 0; } }`;default:return""}}function IZ(){return`
1083
1081
  <script data-stx-scoped data-stx-run="once">
1084
1082
  // Motion preferences handling
1085
1083
  (function() {
@@ -1107,7 +1105,7 @@ else {
1107
1105
  });
1108
1106
  })();
1109
1107
  </script>
1110
- `}function kZ($){return[/@animate\b/,/@transition\b/,/@scroll(?:Animate)?\b/,/@staggered\b/,/@sequence\b/,/@motion\b/,/@animationGroup\b/,/\bstx-transition\b/,/\bstx-(?:fade|scale|flip|rotate|slide|from-|observe)\b/,/data-animate=['"](?:auto|true|false)['"]/].some((J)=>J.test($))}function IZ($=0.1,Z="0px"){return`
1108
+ `}function TZ($){return[/@animate\b/,/@transition\b/,/@scroll(?:Animate)?\b/,/@staggered\b/,/@sequence\b/,/@motion\b/,/@animationGroup\b/,/\bstx-transition\b/,/\bstx-(?:fade|scale|flip|rotate|slide|from-|observe)\b/,/data-animate=['"](?:auto|true|false)['"]/].some((J)=>J.test($))}function EZ($=0.1,Z="0px"){return`
1111
1109
  <script data-stx-scoped data-stx-run="always">
1112
1110
  // Intersection Observer for scroll animations
1113
1111
  (function() {
@@ -1150,7 +1148,7 @@ else {
1150
1148
  }
1151
1149
  })();
1152
1150
  </script>
1153
- `}function TZ(){return`
1151
+ `}function bZ(){return`
1154
1152
  <style id="stx-animation-base">
1155
1153
  :root {
1156
1154
  --stx-transition-duration: 300ms;
@@ -1265,7 +1263,7 @@ else {
1265
1263
  transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);
1266
1264
  }
1267
1265
  </style>
1268
- `}function EZ($,Z,J={}){let{staggerDelay:X=50,sequence:Y=!1}=J;return`
1266
+ `}function yZ($,Z,J={}){let{staggerDelay:X=50,sequence:Y=!1}=J;return`
1269
1267
  <script data-stx-scoped data-stx-run="always">
1270
1268
  // Animation Group: ${$}
1271
1269
  (function() {
@@ -1302,21 +1300,21 @@ else {
1302
1300
  }
1303
1301
  })();
1304
1302
  </script>
1305
- `}var i9={name:"transition",handler:($,Z,J,X)=>{if(Z.length<1)return`<div class="stx-error">@transition directive requires at least a transition type</div>${$}`;let Y=Z[0],Q=Z.length>1?Number.parseInt(Z[1],10)||$1.duration:$1.duration,G=Z.length>2?Z[2]||$1.ease:$1.ease,z=Z.length>3?Number.parseInt(Z[3],10)||$1.delay:$1.delay,q=Z.length>4?Z[4]||$1.direction:$1.direction,K=`stx-transition-${Math.random().toString(36).substr(2,9)}`,U=MZ(Y,{duration:Q,delay:z,ease:G,direction:q}),W="stx-transition",H="";if(Y==="fade")H="stx-fade";else if(Y==="slide")H="stx-slide";else if(Y==="scale")H="stx-scale";else if(Y==="flip")H="stx-flip";else if(Y==="rotate")H="stx-rotate";return`<div id="${K}" class="${W} ${H} ${q==="out"?"stx-out":""}"
1306
- style="--stx-transition-duration: ${Q}ms; --stx-transition-ease: ${G}; --stx-transition-delay: ${z}ms;">${$}</div>`},hasEndTag:!0,description:"Applies transition effects to an element"},n9={name:"scrollAnimate",handler:($,Z,J,X)=>{if(Z.length<1)return`<div class="stx-error">@scrollAnimate directive requires at least an animation type</div>${$}`;let Y=Z[0],Q=Z.length>1?Number.parseInt(Z[1],10)||300:300,G=Z.length>2?Z[2]||"ease":"ease",z=Z.length>3?Number.parseFloat(Z[3])||0.2:0.2,q=Z.length>4?Number.parseInt(Z[4],10)||0:0,K=`stx-scroll-${Math.random().toString(36).substr(2,9)}`,U=`--stx-transition-duration: ${Q}ms; --stx-transition-ease: ${G}; --stx-transition-delay: ${q}ms; will-change: opacity, transform;`,W="stx-transition stx-observe stx-out";if(Y==="fade")W+=" stx-fade";else if(Y==="slide-up"||Y==="slide")W+=" stx-from-bottom";else if(Y==="slide-down")W+=" stx-from-top";else if(Y==="slide-left")W+=" stx-from-right";else if(Y==="slide-right")W+=" stx-from-left";else if(Y==="scale")W+=" stx-scale";else if(Y.includes("-"))W+=` stx-${Y}`;else W+=` stx-${Y}`;return`<div id="${K}" class="${W}" style="${U}" data-threshold="${z}">${$}</div>`},hasEndTag:!0,description:"Applies animations that trigger when scrolled into view"},o9={name:"animationGroup",handler:($,Z,J,X)=>{if(Z.length<2)return`<div class="stx-error">@animationGroup directive requires a group name and at least one element selector</div>${$}`;let Y=Z[0],Q=Z.slice(1).map((K)=>K.startsWith("#")||K.startsWith(".")?K:`#${K}`),G=J.staggerDelay||50,z=J.sequence||!0,q=EZ(Y,Q,{staggerDelay:G,sequence:z});return`${$}
1307
- ${q}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},s9={name:"motion",handler:($,Z,J,X)=>{let Y=Z.length>0?Z[0].toLowerCase()==="true":!0,Q=AZ();return`<div data-animate="${Y?"auto":"true"}">${$}</div>${Q}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function D3($,Z,J,X){let Y=$;if(X.animation?.enabled===!1)return Y;let Q=J.includes("test")&&J.includes("animation");if(!kZ(Y)&&!Q)return Y;if(!Y.includes('<style id="stx-animation-base">')){let z=TZ();Y=Y.replace("</head>",`${z}
1308
- </head>`)}if(Y.includes("stx-observe")){if(!Y.includes("Intersection Observer for scroll animations")){let q=IZ(),K=Y.lastIndexOf("</body>");if(K!==-1)Y=Y.slice(0,K)+q+`
1309
- `+Y.slice(K)}}return Y}var R3={default:{stiffness:100,damping:10,mass:1},gentle:{stiffness:120,damping:14,mass:1},wobbly:{stiffness:180,damping:12,mass:1},stiff:{stiffness:210,damping:20,mass:1},slow:{stiffness:280,damping:60,mass:1},molasses:{stiffness:280,damping:120,mass:1}};function bZ($,Z){let J=Z.map((X)=>{let Y=X.offset!==void 0?`${X.offset*100}%`:"from",Q=Object.entries(X.properties).map(([G,z])=>`${G}: ${z}`).join("; ");return`${Y} { ${Q} }`}).join(`
1303
+ `}var i9={name:"transition",handler:($,Z,J,X)=>{if(Z.length<1)return`<div class="stx-error">@transition directive requires at least a transition type</div>${$}`;let Y=Z[0],Q=Z.length>1?Number.parseInt(Z[1],10)||e0.duration:e0.duration,G=Z.length>2?Z[2]||e0.ease:e0.ease,z=Z.length>3?Number.parseInt(Z[3],10)||e0.delay:e0.delay,q=Z.length>4?Z[4]||e0.direction:e0.direction,K=`stx-transition-${Math.random().toString(36).substr(2,9)}`,U=kZ(Y,{duration:Q,delay:z,ease:G,direction:q}),W="stx-transition",H="";if(Y==="fade")H="stx-fade";else if(Y==="slide")H="stx-slide";else if(Y==="scale")H="stx-scale";else if(Y==="flip")H="stx-flip";else if(Y==="rotate")H="stx-rotate";return`<div id="${K}" class="${W} ${H} ${q==="out"?"stx-out":""}"
1304
+ style="--stx-transition-duration: ${Q}ms; --stx-transition-ease: ${G}; --stx-transition-delay: ${z}ms;">${$}</div>`},hasEndTag:!0,description:"Applies transition effects to an element"},n9={name:"scrollAnimate",handler:($,Z,J,X)=>{if(Z.length<1)return`<div class="stx-error">@scrollAnimate directive requires at least an animation type</div>${$}`;let Y=Z[0],Q=Z.length>1?Number.parseInt(Z[1],10)||300:300,G=Z.length>2?Z[2]||"ease":"ease",z=Z.length>3?Number.parseFloat(Z[3])||0.2:0.2,q=Z.length>4?Number.parseInt(Z[4],10)||0:0,K=`stx-scroll-${Math.random().toString(36).substr(2,9)}`,U=`--stx-transition-duration: ${Q}ms; --stx-transition-ease: ${G}; --stx-transition-delay: ${q}ms; will-change: opacity, transform;`,W="stx-transition stx-observe stx-out";if(Y==="fade")W+=" stx-fade";else if(Y==="slide-up"||Y==="slide")W+=" stx-from-bottom";else if(Y==="slide-down")W+=" stx-from-top";else if(Y==="slide-left")W+=" stx-from-right";else if(Y==="slide-right")W+=" stx-from-left";else if(Y==="scale")W+=" stx-scale";else if(Y.includes("-"))W+=` stx-${Y}`;else W+=` stx-${Y}`;return`<div id="${K}" class="${W}" style="${U}" data-threshold="${z}">${$}</div>`},hasEndTag:!0,description:"Applies animations that trigger when scrolled into view"},o9={name:"animationGroup",handler:($,Z,J,X)=>{if(Z.length<2)return`<div class="stx-error">@animationGroup directive requires a group name and at least one element selector</div>${$}`;let Y=Z[0],Q=Z.slice(1).map((K)=>K.startsWith("#")||K.startsWith(".")?K:`#${K}`),G=J.staggerDelay||50,z=J.sequence||!0,q=yZ(Y,Q,{staggerDelay:G,sequence:z});return`${$}
1305
+ ${q}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},s9={name:"motion",handler:($,Z,J,X)=>{let Y=Z.length>0?Z[0].toLowerCase()==="true":!0,Q=IZ();return`<div data-animate="${Y?"auto":"true"}">${$}</div>${Q}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function D3($,Z,J,X){let Y=$;if(X.animation?.enabled===!1)return Y;let Q=J.includes("test")&&J.includes("animation");if(!TZ(Y)&&!Q)return Y;if(!Y.includes('<style id="stx-animation-base">')){let z=bZ();Y=Y.replace("</head>",`${z}
1306
+ </head>`)}if(Y.includes("stx-observe")){if(!Y.includes("Intersection Observer for scroll animations")){let q=EZ(),K=Y.lastIndexOf("</body>");if(K!==-1)Y=Y.slice(0,K)+q+`
1307
+ `+Y.slice(K)}}return Y}var R3={default:{stiffness:100,damping:10,mass:1},gentle:{stiffness:120,damping:14,mass:1},wobbly:{stiffness:180,damping:12,mass:1},stiff:{stiffness:210,damping:20,mass:1},slow:{stiffness:280,damping:60,mass:1},molasses:{stiffness:280,damping:120,mass:1}};function CZ($,Z){let J=Z.map((X)=>{let Y=X.offset!==void 0?`${X.offset*100}%`:"from",Q=Object.entries(X.properties).map(([G,z])=>`${G}: ${z}`).join("; ");return`${Y} { ${Q} }`}).join(`
1310
1308
  `);return`@keyframes ${$} {
1311
1309
  ${J}
1312
- }`}var yZ={name:"keyframe",hasEndTag:!0,handler:($,Z,J,X)=>{if(Z.length<1)return`<div class="stx-error">@keyframe requires an animation name</div>${$}`;let Y=Z[0].replace(/['"`]/g,""),Q=Z[1]?Number.parseInt(Z[1],10):1000,G=Z[2]?.replace(/['"`]/g,"")||"ease",z=Z[3]||"1",q=Z[4]?.replace(/['"`]/g,"")||"normal",K=Z[5]?.replace(/['"`]/g,"")||"forwards",U=`stx-keyframe-${Math.random().toString(36).slice(2,9)}`,W=`
1310
+ }`}var SZ={name:"keyframe",hasEndTag:!0,handler:($,Z,J,X)=>{if(Z.length<1)return`<div class="stx-error">@keyframe requires an animation name</div>${$}`;let Y=Z[0].replace(/['"`]/g,""),Q=Z[1]?Number.parseInt(Z[1],10):1000,G=Z[2]?.replace(/['"`]/g,"")||"ease",z=Z[3]||"1",q=Z[4]?.replace(/['"`]/g,"")||"normal",K=Z[5]?.replace(/['"`]/g,"")||"forwards",U=`stx-keyframe-${Math.random().toString(36).slice(2,9)}`,W=`
1313
1311
  animation-name: ${Y};
1314
1312
  animation-duration: ${Q}ms;
1315
1313
  animation-timing-function: ${G};
1316
1314
  animation-iteration-count: ${z};
1317
1315
  animation-direction: ${q};
1318
1316
  animation-fill-mode: ${K};
1319
- `.trim().replace(/\s+/g," ");return`<div id="${U}" style="${W}">${$}</div>`},description:"Applies a keyframe animation to an element"};function CZ($,Z,J,X,Y){return`
1317
+ `.trim().replace(/\s+/g," ");return`<div id="${U}" style="${W}">${$}</div>`},description:"Applies a keyframe animation to an element"};function PZ($,Z,J,X,Y){return`
1320
1318
  <script data-stx-scoped data-stx-run="always">
1321
1319
  (function() {
1322
1320
  const container = document.getElementById('${$}');
@@ -1330,7 +1328,7 @@ ${q}`},hasEndTag:!1,description:"Coordinates multiple animations together as a g
1330
1328
  child.classList.add('${Y}');
1331
1329
  });
1332
1330
  })();
1333
- </script>`}var SZ={name:"stagger",hasEndTag:!0,handler:($,Z,J,X)=>{let Y=Z[0]?.replace(/['"`]/g,"")||"> *",Q=Z[1]?Number.parseInt(Z[1],10):100,G=Z[2]?Number.parseInt(Z[2],10):0,z=Z[3]?.replace(/['"`]/g,"")||"fade",q=`stx-stagger-${Math.random().toString(36).slice(2,9)}`,K="stx-stagger-item";if(z==="fade")K+=" stx-fade";else if(z==="slide")K+=" stx-from-bottom";else if(z==="scale")K+=" stx-scale";let U=CZ(q,Y,G,Q,K);return`${`
1331
+ </script>`}var vZ={name:"stagger",hasEndTag:!0,handler:($,Z,J,X)=>{let Y=Z[0]?.replace(/['"`]/g,"")||"> *",Q=Z[1]?Number.parseInt(Z[1],10):100,G=Z[2]?Number.parseInt(Z[2],10):0,z=Z[3]?.replace(/['"`]/g,"")||"fade",q=`stx-stagger-${Math.random().toString(36).slice(2,9)}`,K="stx-stagger-item";if(z==="fade")K+=" stx-fade";else if(z==="slide")K+=" stx-from-bottom";else if(z==="scale")K+=" stx-scale";let U=PZ(q,Y,G,Q,K);return`${`
1334
1332
  <style>
1335
1333
  #${q} .stx-stagger-item {
1336
1334
  opacity: 0;
@@ -1340,12 +1338,12 @@ ${q}`},hasEndTag:!1,description:"Coordinates multiple animations together as a g
1340
1338
  from { opacity: 0; transform: translateY(10px); }
1341
1339
  to { opacity: 1; transform: translateY(0); }
1342
1340
  }
1343
- </style>`}<div id="${q}" class="stx-stagger-container">${$}</div>${U}`},description:"Applies staggered animations to child elements"};function PZ($){let{stiffness:Z,damping:J}=$,X=J/(2*Math.sqrt(Z));if(X<0.5)return"cubic-bezier(0.175, 0.885, 0.32, 1.275)";else if(X<1)return"cubic-bezier(0.34, 1.56, 0.64, 1)";else return"cubic-bezier(0.25, 0.1, 0.25, 1)"}var vZ={name:"spring",hasEndTag:!0,handler:($,Z,J,X)=>{let Y=Z[0]?.replace(/['"`]/g,"")||"default",Q;if(R3[Y])Q=R3[Y];else Q={stiffness:Number.parseInt(Y,10)||100,damping:Z[1]?Number.parseInt(Z[1],10):10,mass:Z[2]?Number.parseFloat(Z[2]):1};let G=Z[3]?Number.parseInt(Z[3],10):500,z=`stx-spring-${Math.random().toString(36).slice(2,9)}`,q=PZ(Q),K=`
1341
+ </style>`}<div id="${q}" class="stx-stagger-container">${$}</div>${U}`},description:"Applies staggered animations to child elements"};function fZ($){let{stiffness:Z,damping:J}=$,X=J/(2*Math.sqrt(Z));if(X<0.5)return"cubic-bezier(0.175, 0.885, 0.32, 1.275)";else if(X<1)return"cubic-bezier(0.34, 1.56, 0.64, 1)";else return"cubic-bezier(0.25, 0.1, 0.25, 1)"}var xZ={name:"spring",hasEndTag:!0,handler:($,Z,J,X)=>{let Y=Z[0]?.replace(/['"`]/g,"")||"default",Q;if(R3[Y])Q=R3[Y];else Q={stiffness:Number.parseInt(Y,10)||100,damping:Z[1]?Number.parseInt(Z[1],10):10,mass:Z[2]?Number.parseFloat(Z[2]):1};let G=Z[3]?Number.parseInt(Z[3],10):500,z=`stx-spring-${Math.random().toString(36).slice(2,9)}`,q=fZ(Q),K=`
1344
1342
  transition: all ${G}ms ${q};
1345
1343
  --stx-spring-stiffness: ${Q.stiffness};
1346
1344
  --stx-spring-damping: ${Q.damping};
1347
1345
  --stx-spring-mass: ${Q.mass};
1348
- `.trim().replace(/\s+/g," ");return`<div id="${z}" class="stx-spring" style="${K}">${$}</div>`},description:"Applies spring physics animations to an element"};function qq($){let Z=`stx-timeline-${Math.random().toString(36).slice(2,9)}`;return`
1346
+ `.trim().replace(/\s+/g," ");return`<div id="${z}" class="stx-spring" style="${K}">${$}</div>`},description:"Applies spring physics animations to an element"};function zq($){let Z=`stx-timeline-${Math.random().toString(36).slice(2,9)}`;return`
1349
1347
  <script data-stx-scoped data-stx-run="always">
1350
1348
  (function() {
1351
1349
  const timeline = ${JSON.stringify($)};
@@ -1382,7 +1380,7 @@ else {
1382
1380
  runTimeline();
1383
1381
  }
1384
1382
  })();
1385
- </script>`}function Kq($,Z,J){let X=bZ($,Z),Y=`
1383
+ </script>`}function qq($,Z,J){let X=CZ($,Z),Y=`
1386
1384
  .${$}-animation {
1387
1385
  animation-name: ${$};
1388
1386
  animation-duration: ${J.duration}ms;
@@ -1392,7 +1390,7 @@ else {
1392
1390
  animation-direction: ${J.direction||"normal"};
1393
1391
  animation-fill-mode: ${J.fill||"forwards"};
1394
1392
  }`;return`${X}
1395
- ${Y}`}function Uq($){let Z=$.trim().split(/\s+/),J={duration:300};for(let X=0;X<Z.length;X++){let Y=Z[X];if(/^\d+(?:ms|s)?$/.test(Y)){let Q=Number.parseInt(Y,10);if(X===0)J.duration=Y.endsWith("s")&&!Y.endsWith("ms")?Q*1000:Q;else J.delay=Y.endsWith("s")&&!Y.endsWith("ms")?Q*1000:Q}else if(Y==="infinite"||/^\d+$/.test(Y))J.iterations=Y==="infinite"?"infinite":Number.parseInt(Y,10);else if(["normal","reverse","alternate","alternate-reverse"].includes(Y))J.direction=Y;else if(["none","forwards","backwards","both"].includes(Y))J.fill=Y;else J.easing=Y}return J}function Wq(){return`
1393
+ ${Y}`}function Kq($){let Z=$.trim().split(/\s+/),J={duration:300};for(let X=0;X<Z.length;X++){let Y=Z[X];if(/^\d+(?:ms|s)?$/.test(Y)){let Q=Number.parseInt(Y,10);if(X===0)J.duration=Y.endsWith("s")&&!Y.endsWith("ms")?Q*1000:Q;else J.delay=Y.endsWith("s")&&!Y.endsWith("ms")?Q*1000:Q}else if(Y==="infinite"||/^\d+$/.test(Y))J.iterations=Y==="infinite"?"infinite":Number.parseInt(Y,10);else if(["normal","reverse","alternate","alternate-reverse"].includes(Y))J.direction=Y;else if(["none","forwards","backwards","both"].includes(Y))J.fill=Y;else J.easing=Y}return J}function Uq(){return`
1396
1394
  <script data-stx-scoped data-stx-run="once">
1397
1395
  window.__stxAnimation = {
1398
1396
  // Registry of animations
@@ -1464,7 +1462,7 @@ else {
1464
1462
  );
1465
1463
  }
1466
1464
  };
1467
- </script>`}function Hq($){let Z=$.customDirectives||[];return Z.push(i9),Z.push(o9),Z.push(s9),Z.push(n9),Z.push(yZ),Z.push(SZ),Z.push(vZ),{...$,customDirectives:Z}}function N3($){let Z=$.match(/\bdefinePageMeta\s*\(\s*(\{[\s\S]*?\})\s*\)/m);if(!Z)return null;try{return Function(`return ${Z[1]}`)()}catch{return null}}function M3($){let Z=$?.layout;if(Z===!1)return!1;return typeof Z==="string"&&Z.trim()?Z.trim():void 0}var fZ=100,xZ=599,a9="__stxResponseStatus",G2="__stxResponseHeaders";function l2($){return typeof $==="number"&&Number.isInteger($)&&$>=fZ&&$<=xZ}function Lq($){for(let Z of $.matchAll(/\bdefinePageMeta\s*\(\s*\{([\s\S]*?)\}\s*\)/g)){let J=Z[1].match(/(?:^|,)\s*status\s*:\s*(\d{3})(?=\s*(?:,|$))/);if(!J)continue;let X=Number(J[1]);if(l2(X))return X}return}function r9($,Z){if(!$||typeof $!=="object")return!1;let J=typeof Z==="string"&&/^\d+$/.test(Z.trim())?Number(Z.trim()):Z;if(!l2(J))return!1;return $[a9]=J,!0}function gZ($,Z,J){if(!$||typeof $!=="object")return;let X=String(Z??"").trim();if(!X)return;$[G2]={...$[G2],[X]:String(J)}}function hZ($){let Z=$?.[a9];return l2(Z)?Z:void 0}function uZ($){let Z=$?.[G2];if(!Z||typeof Z!=="object")return;let J=Object.entries(Z).map(([X,Y])=>[X,String(Y)]);return J.length>0?Object.fromEntries(J):void 0}function _q($,Z){if(!$||!Z||$===Z||typeof Z!=="object")return;let J=hZ($);if(J!==void 0)Z[a9]=J;let X=uZ($);if(X)Z[G2]={...Z[G2],...X}}function A3($){return{setResponseStatus:(Z)=>{r9($,Z)},notFound:(Z=404)=>{let J=l2(Z)&&Z>=400?Z:404;r9($,J)},setResponseHeader:(Z,J)=>{gZ($,Z,J)}}}function k3($,Z,J={}){if(!$.includes("@status"))return $;let{filePath:X,buildMode:Y}=J,Q=Y==="compile",G="",z=0,q=/@status\s*\(/g,K;while((K=q.exec($))!==null){let U=dZ($,K.index+K[0].length-1);if(U<0)break;let W=$.slice(K.index+K[0].length,U).trim(),H=/^\d+$/.test(W)?Number(W):e(W,Z),j=X?` in ${X}`:"";if(Q)console.warn(`[stx] @status(${W})${j} is skipped when precompiling: the build has no request, so the branch it sits in is not the one a visitor will get. Call notFound() or setResponseStatus(${W}) from <script server> instead \u2014 that runs per request.`);else if(!r9(Z,H))console.warn(`[stx] @status(${W})${j} is not an HTTP status (100-599) \u2014 ignoring it.`);G+=$.slice(z,K.index),z=U+1+($.slice(U+1).match(/^[^\S\n]*\n?/)?.[0].length??0),q.lastIndex=z}return z===0?$:G+$.slice(z)}function dZ($,Z){let J=1,X=null,Y=!1;for(let Q=Z+1;Q<$.length;Q++){let G=$[Q];if(Y){Y=!1;continue}if(X){if(G==="\\")Y=!0;else if(G===X)X=null;continue}if(G==='"'||G==="'"||G==="`"){X=G;continue}if(G==="(")J++;else if(G===")"&&--J===0)return Q}return-1}var mZ=0,lZ=0;function I3($,Z){let J=$.match(new RegExp(`${Z}\\s*=\\s*"([^"]*)"`,"i"));if(J)return J[1];let X=$.match(new RegExp(`${Z}\\s*=\\s*'([^']*)'`,"i"));if(X)return X[1];return null}function cZ($){let Z=[],J=/<([a-z][a-z0-9-]*)\s+([^>]*x-data\s*=\s*(?:"[^"]*"|'[^']*')[^>]*)>/gi,X;while((X=J.exec($))!==null){let[Y,Q,G]=X,z=X.index,q=I3(G,"x-data");if(!q)continue;let K=`__stx_scope_${mZ++}`,U=I3(G,"x-init"),W=pZ($,Q,z+Y.length),H=$.slice(z,W.endIndex),j=iZ(H);Z.push({id:K,selector:`[data-stx-scope="${K}"]`,stateExpr:q,initExpr:U,bindings:[],refs:j})}return Z}function pZ($,Z,J){let X=1,Y=J,Q=new RegExp(`<${Z}(?:\\s|>)`,"gi"),G=new RegExp(`</${Z}>`,"gi"),z=new RegExp(`<${Z}[^>]*/\\s*>`,"gi");while(X>0&&Y<$.length){Q.lastIndex=Y,G.lastIndex=Y,z.lastIndex=Y;let q=Q.exec($),K=G.exec($),U=z.exec($);if(U&&U.index<(q?.index??1/0)){Y=U.index+U[0].length;continue}if(!K)return{endIndex:$.length};if(q&&q.index<K.index)X++,Y=q.index+q[0].length;else{if(X--,X===0)return{endIndex:K.index+K[0].length};Y=K.index+K[0].length}}return{endIndex:$.length}}function iZ($){let Z=new Map,J=$.replace(/x-data\s*=\s*"[^"]*"/gi,'x-data="__stripped__"').replace(/x-data\s*=\s*'[^']*'/gi,"x-data='__stripped__'"),X=/<[a-z][a-z0-9-]*\s+([^>]*x-ref\s*=\s*["']([^"']*)["'][^>]*)>/gi,Y;while((Y=X.exec(J))!==null){let[,Q,G]=Y,z=nZ(Q);Z.set(G,z)}return Z}function nZ($){let Z=$.match(/\bid\s*=\s*["']([^"']*)["']/);if(Z)return Z[1];return`__stx_el_${lZ++}`}function oZ(){return`
1465
+ </script>`}function Wq($){let Z=$.customDirectives||[];return Z.push(i9),Z.push(o9),Z.push(s9),Z.push(n9),Z.push(SZ),Z.push(vZ),Z.push(xZ),{...$,customDirectives:Z}}function N3($){let Z=$.match(/\bdefinePageMeta\s*\(\s*(\{[\s\S]*?\})\s*\)/m);if(!Z)return null;try{return Function(`return ${Z[1]}`)()}catch{return null}}function M3($){let Z=$?.layout;if(Z===!1)return!1;return typeof Z==="string"&&Z.trim()?Z.trim():void 0}var gZ=100,hZ=599,a9="__stxResponseStatus",G2="__stxResponseHeaders";function l2($){return typeof $==="number"&&Number.isInteger($)&&$>=gZ&&$<=hZ}function Vq($){for(let Z of $.matchAll(/\bdefinePageMeta\s*\(\s*\{([\s\S]*?)\}\s*\)/g)){let J=Z[1].match(/(?:^|,)\s*status\s*:\s*(\d{3})(?=\s*(?:,|$))/);if(!J)continue;let X=Number(J[1]);if(l2(X))return X}return}function r9($,Z){if(!$||typeof $!=="object")return!1;let J=typeof Z==="string"&&/^\d+$/.test(Z.trim())?Number(Z.trim()):Z;if(!l2(J))return!1;return $[a9]=J,!0}function uZ($,Z,J){if(!$||typeof $!=="object")return;let X=String(Z??"").trim();if(!X)return;$[G2]={...$[G2],[X]:String(J)}}function dZ($){let Z=$?.[a9];return l2(Z)?Z:void 0}function mZ($){let Z=$?.[G2];if(!Z||typeof Z!=="object")return;let J=Object.entries(Z).map(([X,Y])=>[X,String(Y)]);return J.length>0?Object.fromEntries(J):void 0}function Lq($,Z){if(!$||!Z||$===Z||typeof Z!=="object")return;let J=dZ($);if(J!==void 0)Z[a9]=J;let X=mZ($);if(X)Z[G2]={...Z[G2],...X}}function A3($){return{setResponseStatus:(Z)=>{r9($,Z)},notFound:(Z=404)=>{let J=l2(Z)&&Z>=400?Z:404;r9($,J)},setResponseHeader:(Z,J)=>{uZ($,Z,J)}}}function k3($,Z,J={}){if(!$.includes("@status"))return $;let{filePath:X,buildMode:Y}=J,Q=Y==="compile",G="",z=0,q=/@status\s*\(/g,K;while((K=q.exec($))!==null){let U=lZ($,K.index+K[0].length-1);if(U<0)break;let W=$.slice(K.index+K[0].length,U).trim(),H=/^\d+$/.test(W)?Number(W):e(W,Z),j=X?` in ${X}`:"";if(Q)console.warn(`[stx] @status(${W})${j} is skipped when precompiling: the build has no request, so the branch it sits in is not the one a visitor will get. Call notFound() or setResponseStatus(${W}) from <script server> instead \u2014 that runs per request.`);else if(!r9(Z,H))console.warn(`[stx] @status(${W})${j} is not an HTTP status (100-599) \u2014 ignoring it.`);G+=$.slice(z,K.index),z=U+1+($.slice(U+1).match(/^[^\S\n]*\n?/)?.[0].length??0),q.lastIndex=z}return z===0?$:G+$.slice(z)}function lZ($,Z){let J=1,X=null,Y=!1;for(let Q=Z+1;Q<$.length;Q++){let G=$[Q];if(Y){Y=!1;continue}if(X){if(G==="\\")Y=!0;else if(G===X)X=null;continue}if(G==='"'||G==="'"||G==="`"){X=G;continue}if(G==="(")J++;else if(G===")"&&--J===0)return Q}return-1}var cZ=0,pZ=0;function I3($,Z){let J=$.match(new RegExp(`${Z}\\s*=\\s*"([^"]*)"`,"i"));if(J)return J[1];let X=$.match(new RegExp(`${Z}\\s*=\\s*'([^']*)'`,"i"));if(X)return X[1];return null}function iZ($){let Z=[],J=/<([a-z][a-z0-9-]*)\s+([^>]*x-data\s*=\s*(?:"[^"]*"|'[^']*')[^>]*)>/gi,X;while((X=J.exec($))!==null){let[Y,Q,G]=X,z=X.index,q=I3(G,"x-data");if(!q)continue;let K=`__stx_scope_${cZ++}`,U=I3(G,"x-init"),W=nZ($,Q,z+Y.length),H=$.slice(z,W.endIndex),j=oZ(H);Z.push({id:K,selector:`[data-stx-scope="${K}"]`,stateExpr:q,initExpr:U,bindings:[],refs:j})}return Z}function nZ($,Z,J){let X=1,Y=J,Q=new RegExp(`<${Z}(?:\\s|>)`,"gi"),G=new RegExp(`</${Z}>`,"gi"),z=new RegExp(`<${Z}[^>]*/\\s*>`,"gi");while(X>0&&Y<$.length){Q.lastIndex=Y,G.lastIndex=Y,z.lastIndex=Y;let q=Q.exec($),K=G.exec($),U=z.exec($);if(U&&U.index<(q?.index??1/0)){Y=U.index+U[0].length;continue}if(!K)return{endIndex:$.length};if(q&&q.index<K.index)X++,Y=q.index+q[0].length;else{if(X--,X===0)return{endIndex:K.index+K[0].length};Y=K.index+K[0].length}}return{endIndex:$.length}}function oZ($){let Z=new Map,J=$.replace(/x-data\s*=\s*"[^"]*"/gi,'x-data="__stripped__"').replace(/x-data\s*=\s*'[^']*'/gi,"x-data='__stripped__'"),X=/<[a-z][a-z0-9-]*\s+([^>]*x-ref\s*=\s*["']([^"']*)["'][^>]*)>/gi,Y;while((Y=X.exec(J))!==null){let[,Q,G]=Y,z=sZ(Q);Z.set(G,z)}return Z}function sZ($){let Z=$.match(/\bid\s*=\s*["']([^"']*)["']/);if(Z)return Z[1];return`__stx_el_${pZ++}`}function rZ(){return`
1468
1466
  // STX Reactive Runtime - x-cloak and transition CSS
1469
1467
  (function() {
1470
1468
  var style = document.createElement('style');
@@ -1671,7 +1669,7 @@ window.__stx_reactive = (function() {
1671
1669
 
1672
1670
  return { initScope: initScope, reactive: reactive };
1673
1671
  })();
1674
- `}function T3($,Z){let J=$.replace(/\{!!([\s\S]*?)!!\}/g,(z,q)=>{try{let K=P0(q,Z,!0);if(K===void 0)return z;return String(K)}catch{return z}}),X="",Y=0,Q=null;while(Y<J.length){let z=J[Y];if(Q&&z==="\\"){X+=z+(J[Y+1]??""),Y+=2;continue}if(z==="{"&&J[Y+1]==="{"){let q=J.indexOf("}}",Y+2);if(q!==-1){let K=J.slice(Y,q+2);X+=G(J.slice(Y+2,q),K,Q),Y=q+2;continue}}if(Q){if(z===Q)Q=null}else if(z==="'"||z==='"'||z==="`")Q=z;X+=z,Y++}return X;function G(z,q,K){let U;try{U=P0(z,Z,!0)}catch{return q}if(U===void 0)return q;if(K){let W=String(U).replace(/\\/g,"\\\\").replace(new RegExp(K==="`"?"`":K,"g"),`\\${K}`).replace(/\r/g,"\\r").replace(/\n/g,"\\n");return K==="`"?W.replace(/\$\{/g,"\\${"):W}if(typeof U==="string"){let W=U.trim();if(W.startsWith("{")&&W.endsWith("}")||W.startsWith("[")&&W.endsWith("]"))try{return JSON.parse(W),W}catch{}}return JSON.stringify(U)}}function sZ($,Z){if($.length===0)return"";let J=$.map((X)=>{let Y=JSON.stringify(Object.fromEntries(X.refs)),Q=T3(X.stateExpr,Z),G=X.initExpr?T3(X.initExpr,Z):null,z=JSON.stringify(Q),q=G?JSON.stringify(G):"null";return`
1672
+ `}function T3($,Z){let J=$.replace(/\{!!([\s\S]*?)!!\}/g,(z,q)=>{try{let K=P0(q,Z,!0);if(K===void 0)return z;return String(K)}catch{return z}}),X="",Y=0,Q=null;while(Y<J.length){let z=J[Y];if(Q&&z==="\\"){X+=z+(J[Y+1]??""),Y+=2;continue}if(z==="{"&&J[Y+1]==="{"){let q=J.indexOf("}}",Y+2);if(q!==-1){let K=J.slice(Y,q+2);X+=G(J.slice(Y+2,q),K,Q),Y=q+2;continue}}if(Q){if(z===Q)Q=null}else if(z==="'"||z==='"'||z==="`")Q=z;X+=z,Y++}return X;function G(z,q,K){let U;try{U=P0(z,Z,!0)}catch{return q}if(U===void 0)return q;if(K){let W=String(U).replace(/\\/g,"\\\\").replace(new RegExp(K==="`"?"`":K,"g"),`\\${K}`).replace(/\r/g,"\\r").replace(/\n/g,"\\n");return K==="`"?W.replace(/\$\{/g,"\\${"):W}if(typeof U==="string"){let W=U.trim();if(W.startsWith("{")&&W.endsWith("}")||W.startsWith("[")&&W.endsWith("]"))try{return JSON.parse(W),W}catch{}}return JSON.stringify(U)}}function aZ($,Z){if($.length===0)return"";let J=$.map((X)=>{let Y=JSON.stringify(Object.fromEntries(X.refs)),Q=T3(X.stateExpr,Z),G=X.initExpr?T3(X.initExpr,Z):null,z=JSON.stringify(Q),q=G?JSON.stringify(G):"null";return`
1675
1673
  (function() {
1676
1674
  var scopeEl = document.querySelector('${X.selector}');
1677
1675
  if (!scopeEl) return;
@@ -1680,10 +1678,10 @@ window.__stx_reactive = (function() {
1680
1678
  })();`}).join(`
1681
1679
  `);return`
1682
1680
  <script data-stx-scoped data-stx-reactive data-stx-run="always">
1683
- ${oZ()}
1681
+ ${rZ()}
1684
1682
  ${J}
1685
- </script>`}function E3($,Z,J){if(!aZ($))return $;let X=cZ($);if(X.length===0)return $;let Y=rZ($,X),Q=sZ(X,Z),G=Y.lastIndexOf("</body>");if(G!==-1)Y=Y.slice(0,G)+Q+`
1686
- `+Y.slice(G);else Y+=Q;return Y}function rZ($,Z){let J=0,X=$.replace(/<([a-z][a-z0-9-]*)(\s+[^>]*x-data\s*=\s*(?:"[^"]*"|'[^']*')[^>]*)>/gi,(Y,Q,G)=>{let z=Z[J++];if(!z)return Y;let q=/data-stx-scope="([^"]*)"/.exec(G);if(q)return z.id=q[1],z.selector=`[data-stx-scope="${z.id}"]`,Y;return`<${Q} data-stx-scope="${z.id}"${G}>`});return X=X.replace(/\s*x-data\s*=\s*"([^"]*)"/g,' data-stx-xdata="$1"'),X=X.replace(/\s*x-data\s*=\s*'([^']*)'/g," data-stx-xdata='$1'"),X=X.replace(/\s*x-init\s*=\s*"([^"]*)"/g,' data-stx-xinit="$1"'),X=X.replace(/\s*x-init\s*=\s*'([^']*)'/g," data-stx-xinit='$1'"),X}function aZ($){return/x-data\s*=\s*["']/.test($)}import mJ from"fs";import L5 from"path";import{createHighlighter as lJ}from"ts-syntax-highlighter";import r2 from"fs";import E0 from"path";import{loadConfigWithResult as vJ}from"bunfig";z2();async function tZ($,Z,J,X){let Y=Z[0]?.replace(/['"]/g,"")||"main",Q=t9();if(Y!=="main")Q=Q.replace("container:'main'",`container:'${Y}'`);return`<script data-stx-router>${Q}</script>`}var b3={name:"stxRouter",handler:tZ,hasEndTag:!1,description:"Inject the STX SPA router script for client-side navigation"};function z1($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function y3($){let Z=$.trim().toLowerCase();return!Z.startsWith("javascript:")&&!Z.startsWith("vbscript:")&&!Z.startsWith("data:text/html")}function C3($){let Z=/^---\r?\n([\s\S]*?)\r?\n---\r?\n/,J=$.match(Z);if(!J)return{data:{},content:$.trim()};let X=J[1],Y=$.slice(J[0].length),Q={};for(let G of X.split(`
1683
+ </script>`}function E3($,Z,J){if(!eZ($))return $;let X=iZ($);if(X.length===0)return $;let Y=tZ($,X),Q=aZ(X,Z),G=Y.lastIndexOf("</body>");if(G!==-1)Y=Y.slice(0,G)+Q+`
1684
+ `+Y.slice(G);else Y+=Q;return Y}function tZ($,Z){let J=0,X=$.replace(/<([a-z][a-z0-9-]*)(\s+[^>]*x-data\s*=\s*(?:"[^"]*"|'[^']*')[^>]*)>/gi,(Y,Q,G)=>{let z=Z[J++];if(!z)return Y;let q=/data-stx-scope="([^"]*)"/.exec(G);if(q)return z.id=q[1],z.selector=`[data-stx-scope="${z.id}"]`,Y;return`<${Q} data-stx-scope="${z.id}"${G}>`});return X=X.replace(/\s*x-data\s*=\s*"([^"]*)"/g,' data-stx-xdata="$1"'),X=X.replace(/\s*x-data\s*=\s*'([^']*)'/g," data-stx-xdata='$1'"),X=X.replace(/\s*x-init\s*=\s*"([^"]*)"/g,' data-stx-xinit="$1"'),X=X.replace(/\s*x-init\s*=\s*'([^']*)'/g," data-stx-xinit='$1'"),X}function eZ($){return/x-data\s*=\s*["']/.test($)}import cJ from"fs";import L5 from"path";import{createHighlighter as pJ}from"ts-syntax-highlighter";import r2 from"fs";import E0 from"path";import{loadConfigWithResult as xJ}from"bunfig";z2();async function $J($,Z,J,X){let Y=Z[0]?.replace(/['"]/g,"")||"main",Q=t9();if(Y!=="main")Q=Q.replace("container:'main'",`container:'${Y}'`);return`<script data-stx-router>${Q}</script>`}var b3={name:"stxRouter",handler:$J,hasEndTag:!1,description:"Inject the STX SPA router script for client-side navigation"};function z1($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function y3($){let Z=$.trim().toLowerCase();return!Z.startsWith("javascript:")&&!Z.startsWith("vbscript:")&&!Z.startsWith("data:text/html")}function C3($){let Z=/^---\r?\n([\s\S]*?)\r?\n---\r?\n/,J=$.match(Z);if(!J)return{data:{},content:$.trim()};let X=J[1],Y=$.slice(J[0].length),Q={};for(let G of X.split(`
1687
1685
  `)){let z=G.trim();if(!z||z.startsWith("#"))continue;let q=z.indexOf(":");if(q===-1)continue;let K=z.slice(0,q).trim(),U=z.slice(q+1).trim();if(typeof U==="string"){if(U.startsWith('"')&&U.endsWith('"')||U.startsWith("'")&&U.endsWith("'"))U=U.slice(1,-1);else if(U.startsWith("[")&&U.endsWith("]"))try{U=JSON.parse(U)}catch{}else if(U==="true")U=!0;else if(U==="false")U=!1;else if(/^-?\d+(?:\.\d+)?$/.test(U))U=Number(U)}Q[K]=U}return{data:Q,content:Y.trim()}}function q2($,Z={}){let{gfm:J=!0,breaks:X=!1}=Z,Y=$,Q=[];if(Y=Y.replace(/```(\w*)\n([\s\S]*?)```/g,(U,W,H)=>{let j=Q.length,B=W?` class="language-${z1(W)}"`:"";return Q.push(`<pre><code${B}>${z1(H.trim())}</code></pre>`),`\x00CODEBLOCK${j}\x00`}),Y=Y.replace(/`([^`]*)`/g,(U,W)=>`<code>${z1(W)}</code>`),Y=Y.replace(/^######\s+(.*)$/gm,"<h6>$1</h6>"),Y=Y.replace(/^#####\s+(.*)$/gm,"<h5>$1</h5>"),Y=Y.replace(/^####\s+(.*)$/gm,"<h4>$1</h4>"),Y=Y.replace(/^###\s+(.*)$/gm,"<h3>$1</h3>"),Y=Y.replace(/^##\s+(.*)$/gm,"<h2>$1</h2>"),Y=Y.replace(/^#\s+(.*)$/gm,"<h1>$1</h1>"),Y=Y.replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>"),Y=Y.replace(/___(.+?)___/g,"<strong><em>$1</em></strong>"),Y=Y.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),Y=Y.replace(/__(.+?)__/g,"<strong>$1</strong>"),Y=Y.replace(/\*(.+?)\*/g,"<em>$1</em>"),Y=Y.replace(/(?<![a-zA-Z0-9])_(.+?)_(?![a-zA-Z0-9])/g,"<em>$1</em>"),J)Y=Y.replace(/~~(.+?)~~/g,"<del>$1</del>");if(Y=Y.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(U,W,H)=>{return`<img src="${y3(H)?z1(H):""}" alt="${z1(W)}" />`}),Y=Y.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(U,W,H)=>{return`<a href="${y3(H)?z1(H):""}">${W}</a>`}),Y=Y.replace(/^(?:---|\*\*\*|___)\s*$/gm,"<hr />"),Y=Y.replace(/^>\s+(.*)$/gm,"<blockquote>$1</blockquote>"),Y=Y.replace(/<\/blockquote>\n<blockquote>/g,`
1688
1686
  `),Y=Y.replace(/^[*\-+]\s+(.*)$/gm,"<li data-ul>$1</li>"),Y=Y.replace(/(<li data-ul>.*<\/li>\n?)+/g,"<ul>$&</ul>"),Y=Y.replace(/<\/ul>\n<ul>/g,""),Y=Y.replace(/^\d+\.\s+(.*)$/gm,"<li data-ol>$1</li>"),Y=Y.replace(/(<li data-ol>.*<\/li>\n?)+/g,"<ol>$&</ol>"),Y=Y.replace(/<\/ol>\n<ol>/g,""),Y=Y.replace(/<li data-ul>/g,"<li>"),Y=Y.replace(/<li data-ol>/g,"<li>"),J)Y=Y.replace(/^\|(.+)\|\s*\n\|[-:\s|]+\|\s*\n((?:\|.+\|\s*\n)*)/gm,(U,W,H)=>{let B=`<tr>${W.split("|").map((F)=>F.trim()).filter(Boolean).map((F)=>`<th>${z1(F)}</th>`).join("")}</tr>`,V=H.trim().split(`
1689
1687
  `).map((F)=>{return`<tr>${F.split("|").map((_)=>_.trim()).filter(Boolean).map((_)=>`<td>${z1(_)}</td>`).join("")}</tr>`}).join(`
@@ -1702,8 +1700,8 @@ ${V}
1702
1700
  `)}</p>`);if(Y=z.join(`
1703
1701
  `),X)Y=Y.replace(/\n/g,`<br />
1704
1702
  `);for(let U=0;U<Q.length;U++)Y=Y.replace(`\x00CODEBLOCK${U}\x00`,Q[U]);return Y=Y.replace(/<p>\s*<\/p>/g,""),Y.trim()}async function S3($,Z,J=""){let X=$,Y=[],Q=/@markdown(?:\([^)]*\))?/g,G;while((G=Q.exec($))!==null){let z=G.index,q=G[0].match(/@markdown\(([^)]*)\)/),K=q?q[1]:"",U=z+G[0].length,W=1,H=U,j=-1;while(W>0&&H<$.length){let F=$.indexOf("@markdown",H),O=$.indexOf("@endmarkdown",H);if(O===-1)break;if(F!==-1&&F<O&&F!==z){let _=$[F+9];if(_==="("||_===`
1705
- `||_==="\r"||_===" "||_===void 0)W++;H=F+9}else{if(W--,W===0){j=O;break}H=O+12}}if(j===-1)continue;let B=$.slice(U,j),V=$.slice(z,j+12);Y.push({fullMatch:V,options:K,content:B,index:z}),Q.lastIndex=j+12}for(let{fullMatch:z,options:q,content:K,index:U}of Y)try{let W={};if(q)q.split(",").forEach((B)=>{let V=B.trim();if(V)W[V]=!0});let H={gfm:W.gfm??!0,breaks:W.breaks??!1},j=q2(K.trim(),H);X=X.split(z).join(j)}catch(W){let H=W instanceof Error?W.message:String(W),j=j0("Markdown Directive",`Error processing markdown: ${H}`,J,$,U,z);X=X.split(z).join(j)}return X}async function P3($,Z,J,X){let Y={gfm:!0,breaks:!1};return Z.forEach((Q)=>{let G=Q.trim().replace(/['"]/g,"");if(G==="breaks")Y.breaks=!0;if(G==="no-gfm")Y.gfm=!1}),q2($.trim(),Y)}var O1=[320,480,640,768,1024,1280,1536,1920,2560],v3=[1,1.5,2,3],S1=["avif","webp","jpeg"],f3={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png",gif:"image/gif"},eZ={avif:"avif",webp:"webp",jpeg:"jpg",png:"png",gif:"gif"};function K2($,Z=O1,J={},X){return Z.sort((Y,Q)=>Y-Q).map((Y)=>{return`${q1($,{...J,w:Y,fm:X})} ${Y}w`}).join(", ")}function bq($,Z=320,J=2560,X=0.08,Y={},Q){let G=$J(Z,J,X);return K2($,G,Y,Q)}function $J($,Z,J=0.08){let X=[],Y=$;while(Y<Z)X.push(Math.round(Y)),Y*=1+J*2;if(X[X.length-1]!==Z)X.push(Z);return X}function e9($,Z,J=v3,X={},Y){return J.sort((Q,G)=>Q-G).map((Q)=>{let G=Math.round(Z*Q);return`${q1($,{...X,w:G,dpr:Q,fm:Y})} ${Q}x`}).join(", ")}function yq($,Z,J=v3,X=80,Y={},Q){let G={1:X,1.5:Math.round(X*0.9),2:Math.round(X*0.8),3:Math.round(X*0.7),4:Math.round(X*0.6),5:Math.round(X*0.5)};return J.sort((z,q)=>z-q).map((z)=>{let q=Math.round(Z*z),K=G[z]||Math.round(X*Math.max(0.5,1-z*0.1));return`${q1($,{...Y,w:q,q:K,dpr:z,fm:Q})} ${z}x`}).join(", ")}function $5($,Z="100vw"){if(!$||Object.keys($).length===0)return Z;let X=Object.entries($).map(([Y,Q])=>{let G=/^\d+$/.test(Y)?`${Y}px`:Y;return{bp:G,size:Q,numericBp:Number.parseInt(G)||0}}).sort((Y,Q)=>Y.numericBp-Q.numericBp).map(({bp:Y,size:Q})=>`(max-width: ${Y}) ${Q}`);return X.push(Z),X.join(", ")}function Cq($,Z="100vw"){if(!$||$.length===0)return Z;let X=[...$].sort((Y,Q)=>(Y.maxWidth||0)-(Q.maxWidth||0)).filter((Y)=>Y.maxWidth).map((Y)=>`(max-width: ${Y.maxWidth}px) ${Y.imageWidth}`);return X.push(Z),X.join(", ")}var Sq={fullWidth:"100vw",halfDesktop:"(max-width: 768px) 100vw, 50vw",thirdDesktop:"(max-width: 768px) 100vw, 33.33vw",quarterDesktop:"(max-width: 480px) 100vw, (max-width: 768px) 50vw, 25vw",contentWidth:"(max-width: 768px) 100vw, (max-width: 1200px) 80vw, 960px"};function q1($,Z={}){let J=Object.entries(Z).filter(([,Q])=>Q!==void 0&&Q!==null).map(([Q,G])=>{if(Array.isArray(G))return[Q,G.join(",")];return[Q,String(G)]});if(J.length===0)return $;let X=J.map(([Q,G])=>`${Q}=${encodeURIComponent(G)}`).join("&"),Y=$.includes("?")?"&":"?";return`${$}${Y}${X}`}function Pq($){let[Z,J]=$.split("?"),X={};if(J)new URLSearchParams(J).forEach((Q,G)=>{if(/^\d+$/.test(Q))X[G]=Number.parseInt(Q,10);else if(/^\d+\.\d+$/.test(Q))X[G]=Number.parseFloat(Q);else if(Q==="true")X[G]=!0;else if(Q==="false")X[G]=!1;else X[G]=Q});return{src:Z,params:X}}function vq($){let{src:Z,widths:J,dprValues:X,fixedWidth:Y,formats:Q=S1,baseUrl:G="",params:z={}}=$,q=[];for(let K of Q){let U,W;if(Y!==void 0&&X)U=e9(Z,Y,X,z,K),W=X.map((H)=>({path:"",url:q1(Z,{...z,w:Math.round(Y*H),fm:K}),width:Math.round(Y*H),height:0,format:K,size:0,dpr:H}));else{let H=J||O1;U=K2(Z,H,z,K),W=H.map((j)=>({path:"",url:q1(Z,{...z,w:j,fm:K}),width:j,height:0,format:K,size:0}))}q.push({srcset:U,format:K,mimeType:f3[K],variants:W})}return q}function fq($,Z="100vw"){return $.map(({srcset:J,mimeType:X})=>`<source type="${X}" srcset="${J}" sizes="${Z}" />`).join(`
1706
- `)}function xq($,Z){if($.length===0)return;let J=[...$].sort((Y,Q)=>Y.width-Q.width),X=J.find((Y)=>Y.width>=Z);if(X)return X;return J[J.length-1]}function Z5($){return f3[$]||"application/octet-stream"}function gq($){return eZ[$]||$}function hq($){switch($.split(".").pop()?.toLowerCase()){case"jpg":case"jpeg":return"jpeg";case"png":return"png";case"webp":return"webp";case"avif":return"avif";case"gif":return"gif";default:return}}var ZJ={strategy:"thumbhash",width:20,quality:50,blurLevel:40,transitionDuration:300,easing:"ease-out"},J5=`
1703
+ `||_==="\r"||_===" "||_===void 0)W++;H=F+9}else{if(W--,W===0){j=O;break}H=O+12}}if(j===-1)continue;let B=$.slice(U,j),V=$.slice(z,j+12);Y.push({fullMatch:V,options:K,content:B,index:z}),Q.lastIndex=j+12}for(let{fullMatch:z,options:q,content:K,index:U}of Y)try{let W={};if(q)q.split(",").forEach((B)=>{let V=B.trim();if(V)W[V]=!0});let H={gfm:W.gfm??!0,breaks:W.breaks??!1},j=q2(K.trim(),H);X=X.split(z).join(j)}catch(W){let H=W instanceof Error?W.message:String(W),j=j0("Markdown Directive",`Error processing markdown: ${H}`,J,$,U,z);X=X.split(z).join(j)}return X}async function P3($,Z,J,X){let Y={gfm:!0,breaks:!1};return Z.forEach((Q)=>{let G=Q.trim().replace(/['"]/g,"");if(G==="breaks")Y.breaks=!0;if(G==="no-gfm")Y.gfm=!1}),q2($.trim(),Y)}var O1=[320,480,640,768,1024,1280,1536,1920,2560],v3=[1,1.5,2,3],S1=["avif","webp","jpeg"],f3={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png",gif:"image/gif"},ZJ={avif:"avif",webp:"webp",jpeg:"jpg",png:"png",gif:"gif"};function K2($,Z=O1,J={},X){return Z.sort((Y,Q)=>Y-Q).map((Y)=>{return`${q1($,{...J,w:Y,fm:X})} ${Y}w`}).join(", ")}function Eq($,Z=320,J=2560,X=0.08,Y={},Q){let G=JJ(Z,J,X);return K2($,G,Y,Q)}function JJ($,Z,J=0.08){let X=[],Y=$;while(Y<Z)X.push(Math.round(Y)),Y*=1+J*2;if(X[X.length-1]!==Z)X.push(Z);return X}function e9($,Z,J=v3,X={},Y){return J.sort((Q,G)=>Q-G).map((Q)=>{let G=Math.round(Z*Q);return`${q1($,{...X,w:G,dpr:Q,fm:Y})} ${Q}x`}).join(", ")}function bq($,Z,J=v3,X=80,Y={},Q){let G={1:X,1.5:Math.round(X*0.9),2:Math.round(X*0.8),3:Math.round(X*0.7),4:Math.round(X*0.6),5:Math.round(X*0.5)};return J.sort((z,q)=>z-q).map((z)=>{let q=Math.round(Z*z),K=G[z]||Math.round(X*Math.max(0.5,1-z*0.1));return`${q1($,{...Y,w:q,q:K,dpr:z,fm:Q})} ${z}x`}).join(", ")}function $5($,Z="100vw"){if(!$||Object.keys($).length===0)return Z;let X=Object.entries($).map(([Y,Q])=>{let G=/^\d+$/.test(Y)?`${Y}px`:Y;return{bp:G,size:Q,numericBp:Number.parseInt(G)||0}}).sort((Y,Q)=>Y.numericBp-Q.numericBp).map(({bp:Y,size:Q})=>`(max-width: ${Y}) ${Q}`);return X.push(Z),X.join(", ")}function yq($,Z="100vw"){if(!$||$.length===0)return Z;let X=[...$].sort((Y,Q)=>(Y.maxWidth||0)-(Q.maxWidth||0)).filter((Y)=>Y.maxWidth).map((Y)=>`(max-width: ${Y.maxWidth}px) ${Y.imageWidth}`);return X.push(Z),X.join(", ")}var Cq={fullWidth:"100vw",halfDesktop:"(max-width: 768px) 100vw, 50vw",thirdDesktop:"(max-width: 768px) 100vw, 33.33vw",quarterDesktop:"(max-width: 480px) 100vw, (max-width: 768px) 50vw, 25vw",contentWidth:"(max-width: 768px) 100vw, (max-width: 1200px) 80vw, 960px"};function q1($,Z={}){let J=Object.entries(Z).filter(([,Q])=>Q!==void 0&&Q!==null).map(([Q,G])=>{if(Array.isArray(G))return[Q,G.join(",")];return[Q,String(G)]});if(J.length===0)return $;let X=J.map(([Q,G])=>`${Q}=${encodeURIComponent(G)}`).join("&"),Y=$.includes("?")?"&":"?";return`${$}${Y}${X}`}function Sq($){let[Z,J]=$.split("?"),X={};if(J)new URLSearchParams(J).forEach((Q,G)=>{if(/^\d+$/.test(Q))X[G]=Number.parseInt(Q,10);else if(/^\d+\.\d+$/.test(Q))X[G]=Number.parseFloat(Q);else if(Q==="true")X[G]=!0;else if(Q==="false")X[G]=!1;else X[G]=Q});return{src:Z,params:X}}function Pq($){let{src:Z,widths:J,dprValues:X,fixedWidth:Y,formats:Q=S1,baseUrl:G="",params:z={}}=$,q=[];for(let K of Q){let U,W;if(Y!==void 0&&X)U=e9(Z,Y,X,z,K),W=X.map((H)=>({path:"",url:q1(Z,{...z,w:Math.round(Y*H),fm:K}),width:Math.round(Y*H),height:0,format:K,size:0,dpr:H}));else{let H=J||O1;U=K2(Z,H,z,K),W=H.map((j)=>({path:"",url:q1(Z,{...z,w:j,fm:K}),width:j,height:0,format:K,size:0}))}q.push({srcset:U,format:K,mimeType:f3[K],variants:W})}return q}function vq($,Z="100vw"){return $.map(({srcset:J,mimeType:X})=>`<source type="${X}" srcset="${J}" sizes="${Z}" />`).join(`
1704
+ `)}function fq($,Z){if($.length===0)return;let J=[...$].sort((Y,Q)=>Y.width-Q.width),X=J.find((Y)=>Y.width>=Z);if(X)return X;return J[J.length-1]}function Z5($){return f3[$]||"application/octet-stream"}function xq($){return ZJ[$]||$}function gq($){switch($.split(".").pop()?.toLowerCase()){case"jpg":case"jpeg":return"jpeg";case"png":return"png";case"webp":return"webp";case"avif":return"avif";case"gif":return"gif";default:return}}var XJ={strategy:"thumbhash",width:20,quality:50,blurLevel:40,transitionDuration:300,easing:"ease-out"},J5=`
1707
1705
  .stx-img-placeholder {
1708
1706
  position: relative;
1709
1707
  overflow: hidden;
@@ -1732,9 +1730,9 @@ ${V}
1732
1730
  filter: blur(0);
1733
1731
  transform: scale(1);
1734
1732
  }
1735
- `.trim();async function X5(){try{return await import("ts-images")}catch{return null}}async function x3($,Z={}){let J={...ZJ,...Z},X=await X5();if(X)try{return await JJ($,J,X)}catch(Y){console.warn(`[stx-media] ts-images placeholder generation failed, using fallback: ${Y}`)}return g3($,J)}async function JJ($,Z,J){let{generatePlaceholder:X,generateThumbHash:Y}=J,G={blur:"blur",thumbhash:"thumbhash",blurhash:"thumbhash",pixelate:"pixelate","dominant-color":"dominant-color",none:"blur"}[Z.strategy]||"blur";if(Z.strategy==="thumbhash")return{dataURL:(await Y($)).dataUrl,width:32,height:32,aspectRatio:1,originalWidth:0,originalHeight:0,strategy:"thumbhash"};let z=await X($,{width:Z.width,height:Z.height,quality:Z.quality,blurLevel:Z.blurLevel,strategy:G,base64Encode:!0});return{dataURL:z.dataURL,width:z.width,height:z.height,aspectRatio:z.aspectRatio,originalWidth:z.originalWidth,originalHeight:z.originalHeight,strategy:Z.strategy,dominantColor:z.dominantColor,css:z.css}}function g3($,Z){let J=Z.width||20,X=Z.height||J,Y="#e5e7eb",Q=`<svg xmlns="http://www.w3.org/2000/svg" width="${J}" height="${X}" viewBox="0 0 ${J} ${X}"><rect fill="#e5e7eb" width="${J}" height="${X}"/></svg>`;return{dataURL:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(Q)}`,width:J,height:X,aspectRatio:J/X,originalWidth:0,originalHeight:0,strategy:Z.strategy,dominantColor:"#e5e7eb"}}async function dq($){let Z=await X5();if(Z)try{return(await Z.generateThumbHash($)).dataUrl}catch{}return(await g3($,{strategy:"thumbhash",width:32,height:32})).dataURL}function mq($){let Z=$[0]|$[1]<<8|$[2]<<16,J=(Z&63)/63,X=(Z>>6&63)/31.5-1,Y=(Z>>12&63)/31.5-1,Q=(Z>>18&31)/31,G=Z>>23!==0,z=$[3]|$[4]<<8,q=(z>>3&63)/63,K=(z>>9&63)/63,U=z>>15!==0,W=Math.max(3,U?G?5:7:G?5:7),H=Math.max(3,U?G?5:7:G?5:7),j=32,B=32,V=Math.max(0,Math.min(255,Math.round((J+X)*255))),F=Math.max(0,Math.min(255,Math.round(J*255))),O=Math.max(0,Math.min(255,Math.round((J-X)*255))),_=`<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32">
1733
+ `.trim();async function X5(){try{return await import("ts-images")}catch{return null}}async function x3($,Z={}){let J={...XJ,...Z},X=await X5();if(X)try{return await YJ($,J,X)}catch(Y){console.warn(`[stx-media] ts-images placeholder generation failed, using fallback: ${Y}`)}return g3($,J)}async function YJ($,Z,J){let{generatePlaceholder:X,generateThumbHash:Y}=J,G={blur:"blur",thumbhash:"thumbhash",blurhash:"thumbhash",pixelate:"pixelate","dominant-color":"dominant-color",none:"blur"}[Z.strategy]||"blur";if(Z.strategy==="thumbhash")return{dataURL:(await Y($)).dataUrl,width:32,height:32,aspectRatio:1,originalWidth:0,originalHeight:0,strategy:"thumbhash"};let z=await X($,{width:Z.width,height:Z.height,quality:Z.quality,blurLevel:Z.blurLevel,strategy:G,base64Encode:!0});return{dataURL:z.dataURL,width:z.width,height:z.height,aspectRatio:z.aspectRatio,originalWidth:z.originalWidth,originalHeight:z.originalHeight,strategy:Z.strategy,dominantColor:z.dominantColor,css:z.css}}function g3($,Z){let J=Z.width||20,X=Z.height||J,Y="#e5e7eb",Q=`<svg xmlns="http://www.w3.org/2000/svg" width="${J}" height="${X}" viewBox="0 0 ${J} ${X}"><rect fill="#e5e7eb" width="${J}" height="${X}"/></svg>`;return{dataURL:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(Q)}`,width:J,height:X,aspectRatio:J/X,originalWidth:0,originalHeight:0,strategy:Z.strategy,dominantColor:"#e5e7eb"}}async function uq($){let Z=await X5();if(Z)try{return(await Z.generateThumbHash($)).dataUrl}catch{}return(await g3($,{strategy:"thumbhash",width:32,height:32})).dataURL}function dq($){let Z=$[0]|$[1]<<8|$[2]<<16,J=(Z&63)/63,X=(Z>>6&63)/31.5-1,Y=(Z>>12&63)/31.5-1,Q=(Z>>18&31)/31,G=Z>>23!==0,z=$[3]|$[4]<<8,q=(z>>3&63)/63,K=(z>>9&63)/63,U=z>>15!==0,W=Math.max(3,U?G?5:7:G?5:7),H=Math.max(3,U?G?5:7:G?5:7),j=32,B=32,V=Math.max(0,Math.min(255,Math.round((J+X)*255))),F=Math.max(0,Math.min(255,Math.round(J*255))),O=Math.max(0,Math.min(255,Math.round((J-X)*255))),_=`<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32">
1736
1734
  <rect fill="rgb(${V},${F},${O})" width="32" height="32"/>
1737
- </svg>`;return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(_)}`}async function lq($,Z=20,J=50){return x3($,{strategy:"blur",width:Z,quality:J,blurLevel:40})}async function cq($){let Z=await X5();if(Z)try{return(await Z.generatePlaceholder($,{strategy:"dominant-color"})).dominantColor||"#e5e7eb"}catch{}return"#e5e7eb"}function pq($,Z=1,J=1){let X=`<svg xmlns="http://www.w3.org/2000/svg" width="${Z}" height="${J}"><rect fill="${$}" width="${Z}" height="${J}"/></svg>`;return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(X)}`}function h3($,Z,J={}){let X=J.transitionDuration||300,Y=J.easing||"ease-out";return`
1735
+ </svg>`;return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(_)}`}async function mq($,Z=20,J=50){return x3($,{strategy:"blur",width:Z,quality:J,blurLevel:40})}async function lq($){let Z=await X5();if(Z)try{return(await Z.generatePlaceholder($,{strategy:"dominant-color"})).dominantColor||"#e5e7eb"}catch{}return"#e5e7eb"}function cq($,Z=1,J=1){let X=`<svg xmlns="http://www.w3.org/2000/svg" width="${Z}" height="${J}"><rect fill="${$}" width="${Z}" height="${J}"/></svg>`;return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(X)}`}function h3($,Z,J={}){let X=J.transitionDuration||300,Y=J.easing||"ease-out";return`
1738
1736
  #${$} {
1739
1737
  --stx-img-transition-duration: ${X}ms;
1740
1738
  --stx-img-transition-easing: ${Y};
@@ -1751,8 +1749,8 @@ ${V}
1751
1749
  #${$}.stx-img-loaded img {
1752
1750
  opacity: 1;
1753
1751
  }
1754
- `.trim()}function iq($){return`background-image: url('${$.dataURL}'); background-size: cover; background-position: center;`}var P1=new Map;async function u3($,Z={}){let J=`${$}:${JSON.stringify(Z)}`;if(P1.has(J))return P1.get(J);let X=await x3($,Z);return P1.set(J,X),X}function nq(){P1.clear()}function oq(){return{size:P1.size,keys:Array.from(P1.keys())}}async function XJ(){try{return await import("./chunk-r3ayvdz3.js")}catch($){if(!d3)console.warn("[stx-media] Image processor not available, some features disabled:",$),d3=!0;return null}}var d3=!1,Y5=80,c2="async",p2="lazy",m3=!1;async function U2($,Z={}){let J=Z,X=$;if(X.process&&!X.skipOptimization){if(J.tsImagesConfig?.enabled&&!J.isDev)return qJ(X,J)}if(J.processedResult?.processed)return z5($,J.processedResult,Z);if(J.responsiveVariants)return p3($,J.responsiveVariants,Z);let{src:Y,alt:Q,width:G,height:z,sizes:q,widths:K=O1,dpr:U,formats:W=S1,quality:H=Y5,params:j={},placeholder:B="none",placeholderOptions:V={},lazy:F=!0,priority:O=!1,loading:_=O?"eager":p2,decoding:L=c2,fetchpriority:w,objectFit:R,objectPosition:D,crossorigin:M,referrerpolicy:I}=$,N=$.class,A=$.style,T=$.id,k=$.data||{},{isDev:y=!1,baseUrl:E=""}=Z;if(y&&!Z.optimize)return GJ($);let b,C,v=T||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(B!=="none"&&!O)try{b=await u3(Y,{strategy:B,...V}),C=h3(v,b,V)}catch{}let P=U!==void 0&&G!==void 0,g;if(P)g=QJ($,v,b,Z);else g=await YJ($,v,b,Z);let x;if(O){let A0=W.includes("webp")?"webp":W[0],C0=K2(Y,K,{...j,q:H},A0),Z0=typeof q==="object"?$5(q):q||"100vw";x=`<link rel="preload" as="image" imagesrcset="${C0}" imagesizes="${Z0}" />`}let $0=[];if(!m3&&B!=="none")$0.push(J5),m3=!0;if(C)$0.push(C);let r0=F?c3(v):void 0;return{html:g,preloadLink:x,css:$0.length>0?$0.join(`
1755
- `):void 0,script:r0}}async function YJ($,Z,J,X){let{src:Y,alt:Q,width:G,height:z,sizes:q,widths:K=O1,formats:U=S1,quality:W=Y5,params:H={},lazy:j=!0,priority:B=!1,loading:V=B?"eager":p2,decoding:F=c2,fetchpriority:O,objectFit:_,objectPosition:L,crossorigin:w,referrerpolicy:R}=$,D=$.class,M=$.style,I=$.data||{},N=typeof q==="object"?$5(q):q||"100vw",A=[];for(let y of U){let E=K2(Y,K,{...H,q:W},y),b=Z5(y);if(j&&!B)A.push(` <source type="${b}" data-srcset="${E}" data-sizes="${N}" />`);else A.push(` <source type="${b}" srcset="${E}" sizes="${N}" />`)}let T=Q5({src:q1(Y,{...H,q:W}),alt:Q,width:G,height:z,loading:B?void 0:V,decoding:F,fetchpriority:B?"high":O,objectFit:_,objectPosition:L,crossorigin:w,referrerpolicy:R,className:l3(D,J),style:G5(M,_,L,J),lazy:j&&!B,data:I}),k;if(J){let y=`background-image: url('${J.dataURL}'); background-size: cover; background-position: center;`;k=`<div id="${Z}" class="stx-img-placeholder" style="${y}">
1752
+ `.trim()}function pq($){return`background-image: url('${$.dataURL}'); background-size: cover; background-position: center;`}var P1=new Map;async function u3($,Z={}){let J=`${$}:${JSON.stringify(Z)}`;if(P1.has(J))return P1.get(J);let X=await x3($,Z);return P1.set(J,X),X}function iq(){P1.clear()}function nq(){return{size:P1.size,keys:Array.from(P1.keys())}}async function QJ(){try{return await import("./chunk-h61qt916.js")}catch($){if(!d3)console.warn("[stx-media] Image processor not available, some features disabled:",$),d3=!0;return null}}var d3=!1,Y5=80,c2="async",p2="lazy",m3=!1;async function U2($,Z={}){let J=Z,X=$;if(X.process&&!X.skipOptimization){if(J.tsImagesConfig?.enabled&&!J.isDev)return UJ(X,J)}if(J.processedResult?.processed)return z5($,J.processedResult,Z);if(J.responsiveVariants)return p3($,J.responsiveVariants,Z);let{src:Y,alt:Q,width:G,height:z,sizes:q,widths:K=O1,dpr:U,formats:W=S1,quality:H=Y5,params:j={},placeholder:B="none",placeholderOptions:V={},lazy:F=!0,priority:O=!1,loading:_=O?"eager":p2,decoding:L=c2,fetchpriority:w,objectFit:R,objectPosition:D,crossorigin:M,referrerpolicy:I}=$,N=$.class,A=$.style,T=$.id,k=$.data||{},{isDev:y=!1,baseUrl:E=""}=Z;if(y&&!Z.optimize)return qJ($);let b,C,v=T||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(B!=="none"&&!O)try{b=await u3(Y,{strategy:B,...V}),C=h3(v,b,V)}catch{}let P=U!==void 0&&G!==void 0,g;if(P)g=zJ($,v,b,Z);else g=await GJ($,v,b,Z);let x;if(O){let A0=W.includes("webp")?"webp":W[0],C0=K2(Y,K,{...j,q:H},A0),Z0=typeof q==="object"?$5(q):q||"100vw";x=`<link rel="preload" as="image" imagesrcset="${C0}" imagesizes="${Z0}" />`}let $0=[];if(!m3&&B!=="none")$0.push(J5),m3=!0;if(C)$0.push(C);let r0=F?c3(v):void 0;return{html:g,preloadLink:x,css:$0.length>0?$0.join(`
1753
+ `):void 0,script:r0}}async function GJ($,Z,J,X){let{src:Y,alt:Q,width:G,height:z,sizes:q,widths:K=O1,formats:U=S1,quality:W=Y5,params:H={},lazy:j=!0,priority:B=!1,loading:V=B?"eager":p2,decoding:F=c2,fetchpriority:O,objectFit:_,objectPosition:L,crossorigin:w,referrerpolicy:R}=$,D=$.class,M=$.style,I=$.data||{},N=typeof q==="object"?$5(q):q||"100vw",A=[];for(let y of U){let E=K2(Y,K,{...H,q:W},y),b=Z5(y);if(j&&!B)A.push(` <source type="${b}" data-srcset="${E}" data-sizes="${N}" />`);else A.push(` <source type="${b}" srcset="${E}" sizes="${N}" />`)}let T=Q5({src:q1(Y,{...H,q:W}),alt:Q,width:G,height:z,loading:B?void 0:V,decoding:F,fetchpriority:B?"high":O,objectFit:_,objectPosition:L,crossorigin:w,referrerpolicy:R,className:l3(D,J),style:G5(M,_,L,J),lazy:j&&!B,data:I}),k;if(J){let y=`background-image: url('${J.dataURL}'); background-size: cover; background-position: center;`;k=`<div id="${Z}" class="stx-img-placeholder" style="${y}">
1756
1754
  <picture>
1757
1755
  ${A.join(`
1758
1756
  `)}
@@ -1762,9 +1760,9 @@ ${A.join(`
1762
1760
  ${A.join(`
1763
1761
  `)}
1764
1762
  <img ${T} />
1765
- </picture>`;return k}function QJ($,Z,J,X){let{src:Y,alt:Q,width:G,height:z,dpr:q=[1,2,3],quality:K=Y5,params:U={},lazy:W=!0,priority:H=!1,loading:j=H?"eager":p2,decoding:B=c2,fetchpriority:V,objectFit:F,objectPosition:O,crossorigin:_,referrerpolicy:L}=$,w=$.class,R=$.style,D=$.data||{},M=typeof G==="number"?G:Number.parseInt(String(G),10),I=e9(Y,M,q,{...U,q:K}),N=Q5({src:q1(Y,{...U,w:M,q:K}),alt:Q,width:G,height:z,loading:H?void 0:j,decoding:B,fetchpriority:H?"high":V,objectFit:F,objectPosition:O,crossorigin:_,referrerpolicy:L,className:l3(w,J),style:G5(R,F,O,J),lazy:W&&!H,data:D}),A=W&&!H?`data-srcset="${I}"`:`srcset="${I}"`;if(J){let T=`background-image: url('${J.dataURL}'); background-size: cover; background-position: center;`;return`<div id="${Z}" class="stx-img-placeholder" style="${T}">
1763
+ </picture>`;return k}function zJ($,Z,J,X){let{src:Y,alt:Q,width:G,height:z,dpr:q=[1,2,3],quality:K=Y5,params:U={},lazy:W=!0,priority:H=!1,loading:j=H?"eager":p2,decoding:B=c2,fetchpriority:V,objectFit:F,objectPosition:O,crossorigin:_,referrerpolicy:L}=$,w=$.class,R=$.style,D=$.data||{},M=typeof G==="number"?G:Number.parseInt(String(G),10),I=e9(Y,M,q,{...U,q:K}),N=Q5({src:q1(Y,{...U,w:M,q:K}),alt:Q,width:G,height:z,loading:H?void 0:j,decoding:B,fetchpriority:H?"high":V,objectFit:F,objectPosition:O,crossorigin:_,referrerpolicy:L,className:l3(w,J),style:G5(R,F,O,J),lazy:W&&!H,data:D}),A=W&&!H?`data-srcset="${I}"`:`srcset="${I}"`;if(J){let T=`background-image: url('${J.dataURL}'); background-size: cover; background-position: center;`;return`<div id="${Z}" class="stx-img-placeholder" style="${T}">
1766
1764
  <img ${N} ${A} />
1767
- </div>`}return`<img ${Z?`id="${Z}" `:""}${N} ${A} />`}function GJ($){let{src:Z,alt:J,width:X,height:Y,loading:Q=p2,decoding:G=c2,fetchpriority:z,objectFit:q,objectPosition:K,crossorigin:U,referrerpolicy:W,priority:H=!1}=$,j=$.class,B=$.style,V=$.id,F=$.data||{};return{html:`<img ${Q5({src:Z,alt:J,width:X,height:Y,loading:H?"eager":Q,decoding:G,fetchpriority:H?"high":z,objectFit:q,objectPosition:K,crossorigin:U,referrerpolicy:W,className:j,style:G5(B,q,K),id:V,data:F})} />`}}function Q5($){let Z=[];if($.lazy)Z.push(`data-src="${m0($.src)}"`),Z.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"');else Z.push(`src="${m0($.src)}"`);if(Z.push(`alt="${m0($.alt)}"`),$.width)Z.push(`width="${$.width}"`);if($.height)Z.push(`height="${$.height}"`);if($.loading)Z.push(`loading="${$.loading}"`);if($.decoding)Z.push(`decoding="${$.decoding}"`);if($.fetchpriority)Z.push(`fetchpriority="${$.fetchpriority}"`);if($.crossorigin)Z.push(`crossorigin="${$.crossorigin}"`);if($.referrerpolicy)Z.push(`referrerpolicy="${$.referrerpolicy}"`);if($.className)Z.push(`class="${m0($.className)}"`);if($.style)Z.push(`style="${m0($.style)}"`);if($.id)Z.push(`id="${m0($.id)}"`);if($.data)for(let[J,X]of Object.entries($.data))Z.push(`data-${J}="${m0(X)}"`);if($.lazy)Z.push("data-stx-lazy");return Z.join(" ")}function l3($,Z){let J=[];if($)J.push($);if(Z)J.push("stx-img-blur");return J.join(" ")||""}function G5($,Z,J,X){let Y=[];if(Z)Y.push(`object-fit: ${Z}`);if(J)Y.push(`object-position: ${J}`);if(X)Y.push("opacity: 0; transition: opacity 300ms ease-out");if($)Y.push($);return Y.join("; ")}function m0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function c3($){return`
1765
+ </div>`}return`<img ${Z?`id="${Z}" `:""}${N} ${A} />`}function qJ($){let{src:Z,alt:J,width:X,height:Y,loading:Q=p2,decoding:G=c2,fetchpriority:z,objectFit:q,objectPosition:K,crossorigin:U,referrerpolicy:W,priority:H=!1}=$,j=$.class,B=$.style,V=$.id,F=$.data||{};return{html:`<img ${Q5({src:Z,alt:J,width:X,height:Y,loading:H?"eager":Q,decoding:G,fetchpriority:H?"high":z,objectFit:q,objectPosition:K,crossorigin:U,referrerpolicy:W,className:j,style:G5(B,q,K),id:V,data:F})} />`}}function Q5($){let Z=[];if($.lazy)Z.push(`data-src="${m0($.src)}"`),Z.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"');else Z.push(`src="${m0($.src)}"`);if(Z.push(`alt="${m0($.alt)}"`),$.width)Z.push(`width="${$.width}"`);if($.height)Z.push(`height="${$.height}"`);if($.loading)Z.push(`loading="${$.loading}"`);if($.decoding)Z.push(`decoding="${$.decoding}"`);if($.fetchpriority)Z.push(`fetchpriority="${$.fetchpriority}"`);if($.crossorigin)Z.push(`crossorigin="${$.crossorigin}"`);if($.referrerpolicy)Z.push(`referrerpolicy="${$.referrerpolicy}"`);if($.className)Z.push(`class="${m0($.className)}"`);if($.style)Z.push(`style="${m0($.style)}"`);if($.id)Z.push(`id="${m0($.id)}"`);if($.data)for(let[J,X]of Object.entries($.data))Z.push(`data-${J}="${m0(X)}"`);if($.lazy)Z.push("data-stx-lazy");return Z.join(" ")}function l3($,Z){let J=[];if($)J.push($);if(Z)J.push("stx-img-blur");return J.join(" ")||""}function G5($,Z,J,X){let Y=[];if(Z)Y.push(`object-fit: ${Z}`);if(J)Y.push(`object-position: ${J}`);if(X)Y.push("opacity: 0; transition: opacity 300ms ease-out");if($)Y.push($);return Y.join("; ")}function m0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function c3($){return`
1768
1766
  (function() {
1769
1767
  const container = document.getElementById('${$}');
1770
1768
  if (!container) return;
@@ -1801,7 +1799,7 @@ ${A.join(`
1801
1799
 
1802
1800
  observer.observe(container);
1803
1801
  })();
1804
- `.trim()}function zJ($){let Z=$.match(/<Img\s+([^>]*?)\/?>/);if(!Z)return null;let J=Z[1],X={},Y=/(:?)(\w+)(?:=(?:"([^"]*)"|'([^']*)'|\{([^}]+)\}))?/g,Q;while((Q=Y.exec(J))!==null){let[,G,z,q,K,U]=Q,W=q??K??U??!0;if(G===":"&&typeof W==="string")try{X[z]=JSON.parse(W)}catch{X[z]=W}else switch(z){case"src":X.src=String(W);break;case"alt":X.alt=String(W);break;case"width":X.width=Number(W)||W;break;case"height":X.height=Number(W)||W;break;case"sizes":X.sizes=String(W);break;case"quality":X.quality=Number(W);break;case"placeholder":X.placeholder=W;break;case"lazy":X.lazy=W===!0||W==="true";break;case"priority":X.priority=W===!0||W==="true";break;case"class":X.class=String(W);break;case"style":X.style=String(W);break;case"id":X.id=String(W);break;case"loading":X.loading=W;break;case"decoding":X.decoding=W;break;case"fetchpriority":X.fetchpriority=W;break;case"objectFit":X.objectFit=W;break;case"objectPosition":X.objectPosition=String(W);break;case"crossorigin":X.crossorigin=W;break}}if(!X.src||!X.alt)return null;return X}async function tq($,Z={}){let J=/<Img\s+[^>]*?\/?>/g,X=[],Y=[],Q=[],G=$,z=[],q;while((q=J.exec($))!==null)z.push({match:q[0],index:q.index});for(let K=z.length-1;K>=0;K--){let{match:U}=z[K],W=zJ(U);if(W){let H=await U2(W,Z);if(G=G.replace(U,H.html),H.preloadLink)X.push(H.preloadLink);if(H.css)Y.push(H.css);if(H.script)Q.push(H.script)}}return{html:G,preloadLinks:X,styles:Y,scripts:Q}}async function qJ($,Z){let J=await XJ();if(!J)return U2({...$,process:!1},Z);let X=Z.tsImagesConfig;if($.responsiveWidths&&$.responsiveWidths.length>0||$.widths&&$.widths.length>0||!$.width&&!$.dpr){let Q=await J.generateResponsiveVariants($.src,$,X);if(Q)return p3($,Q,Z)}else{let Q=await J.processImage($.src,$,X);if(Q.processed)return z5($,Q,Z)}return U2({...$,process:!1},Z)}async function z5($,Z,J){let{alt:X,width:Y,height:Q,lazy:G=!0,priority:z=!1,objectFit:q,objectPosition:K,crossorigin:U,referrerpolicy:W}=$,H=$.class,j=$.style,B=$.id||`stx-img-${Math.random().toString(36).slice(2,8)}`,V=$.data||{},F=Z.variants||[],O=F.find((C)=>C.format==="jpeg")||F.find((C)=>C.format==="webp")||F[0],_=O?.url||$.src,L=F.filter((C)=>C.format===(O?.format||"jpeg")).map((C)=>`${C.url} ${C.width}w`).join(", "),w=new Map;for(let C of F){if(!w.has(C.format))w.set(C.format,[]);w.get(C.format).push(C)}let R=[],D=["avif","webp","jpeg","png"];for(let C of D){let v=w.get(C);if(v&&v.length>0){let P=v.map((x)=>`${x.url} ${x.width}w`).join(", "),g=Z5(C);if(G&&!z)R.push(` <source type="${g}" data-srcset="${P}" />`);else R.push(` <source type="${g}" srcset="${P}" />`)}}let M=[];if(G&&!z){if(M.push(`data-src="${m0(_)}"`),M.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"'),L)M.push(`data-srcset="${L}"`)}else if(M.push(`src="${m0(_)}"`),L)M.push(`srcset="${L}"`);M.push(`alt="${m0(X)}"`);let I=Y||Z.originalWidth,N=Q||Z.originalHeight;if(I)M.push(`width="${I}"`);if(N)M.push(`height="${N}"`);if(!z)M.push(`loading="${G?"lazy":"eager"}"`);if(M.push('decoding="async"'),z)M.push('fetchpriority="high"');if(U)M.push(`crossorigin="${U}"`);if(W)M.push(`referrerpolicy="${W}"`);let A=[];if(q)A.push(`object-fit: ${q}`);if(K)A.push(`object-position: ${K}`);if(Z.placeholder&&G)A.push("opacity: 0; transition: opacity 300ms ease-out");if(j)A.push(j);if(A.length>0)M.push(`style="${A.join("; ")}"`);let T=[];if(H)T.push(H);if(Z.placeholder)T.push("stx-img-blur");if(T.length>0)M.push(`class="${T.join(" ")}"`);if(G&&!z)M.push("data-stx-lazy");for(let[C,v]of Object.entries(V))M.push(`data-${C}="${m0(v)}"`);let k;if(Z.placeholder||Z.dominantColor&&$.useDominantColor){let C=Z.placeholder?`background-image: url('${Z.placeholder}'); background-size: cover; background-position: center;`:`background-color: ${Z.dominantColor};`;k=`<div id="${B}" class="stx-img-placeholder" style="${C}">
1802
+ `.trim()}function KJ($){let Z=$.match(/<Img\s+([^>]*?)\/?>/);if(!Z)return null;let J=Z[1],X={},Y=/(:?)(\w+)(?:=(?:"([^"]*)"|'([^']*)'|\{([^}]+)\}))?/g,Q;while((Q=Y.exec(J))!==null){let[,G,z,q,K,U]=Q,W=q??K??U??!0;if(G===":"&&typeof W==="string")try{X[z]=JSON.parse(W)}catch{X[z]=W}else switch(z){case"src":X.src=String(W);break;case"alt":X.alt=String(W);break;case"width":X.width=Number(W)||W;break;case"height":X.height=Number(W)||W;break;case"sizes":X.sizes=String(W);break;case"quality":X.quality=Number(W);break;case"placeholder":X.placeholder=W;break;case"lazy":X.lazy=W===!0||W==="true";break;case"priority":X.priority=W===!0||W==="true";break;case"class":X.class=String(W);break;case"style":X.style=String(W);break;case"id":X.id=String(W);break;case"loading":X.loading=W;break;case"decoding":X.decoding=W;break;case"fetchpriority":X.fetchpriority=W;break;case"objectFit":X.objectFit=W;break;case"objectPosition":X.objectPosition=String(W);break;case"crossorigin":X.crossorigin=W;break}}if(!X.src||!X.alt)return null;return X}async function aq($,Z={}){let J=/<Img\s+[^>]*?\/?>/g,X=[],Y=[],Q=[],G=$,z=[],q;while((q=J.exec($))!==null)z.push({match:q[0],index:q.index});for(let K=z.length-1;K>=0;K--){let{match:U}=z[K],W=KJ(U);if(W){let H=await U2(W,Z);if(G=G.replace(U,H.html),H.preloadLink)X.push(H.preloadLink);if(H.css)Y.push(H.css);if(H.script)Q.push(H.script)}}return{html:G,preloadLinks:X,styles:Y,scripts:Q}}async function UJ($,Z){let J=await QJ();if(!J)return U2({...$,process:!1},Z);let X=Z.tsImagesConfig;if($.responsiveWidths&&$.responsiveWidths.length>0||$.widths&&$.widths.length>0||!$.width&&!$.dpr){let Q=await J.generateResponsiveVariants($.src,$,X);if(Q)return p3($,Q,Z)}else{let Q=await J.processImage($.src,$,X);if(Q.processed)return z5($,Q,Z)}return U2({...$,process:!1},Z)}async function z5($,Z,J){let{alt:X,width:Y,height:Q,lazy:G=!0,priority:z=!1,objectFit:q,objectPosition:K,crossorigin:U,referrerpolicy:W}=$,H=$.class,j=$.style,B=$.id||`stx-img-${Math.random().toString(36).slice(2,8)}`,V=$.data||{},F=Z.variants||[],O=F.find((C)=>C.format==="jpeg")||F.find((C)=>C.format==="webp")||F[0],_=O?.url||$.src,L=F.filter((C)=>C.format===(O?.format||"jpeg")).map((C)=>`${C.url} ${C.width}w`).join(", "),w=new Map;for(let C of F){if(!w.has(C.format))w.set(C.format,[]);w.get(C.format).push(C)}let R=[],D=["avif","webp","jpeg","png"];for(let C of D){let v=w.get(C);if(v&&v.length>0){let P=v.map((x)=>`${x.url} ${x.width}w`).join(", "),g=Z5(C);if(G&&!z)R.push(` <source type="${g}" data-srcset="${P}" />`);else R.push(` <source type="${g}" srcset="${P}" />`)}}let M=[];if(G&&!z){if(M.push(`data-src="${m0(_)}"`),M.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"'),L)M.push(`data-srcset="${L}"`)}else if(M.push(`src="${m0(_)}"`),L)M.push(`srcset="${L}"`);M.push(`alt="${m0(X)}"`);let I=Y||Z.originalWidth,N=Q||Z.originalHeight;if(I)M.push(`width="${I}"`);if(N)M.push(`height="${N}"`);if(!z)M.push(`loading="${G?"lazy":"eager"}"`);if(M.push('decoding="async"'),z)M.push('fetchpriority="high"');if(U)M.push(`crossorigin="${U}"`);if(W)M.push(`referrerpolicy="${W}"`);let A=[];if(q)A.push(`object-fit: ${q}`);if(K)A.push(`object-position: ${K}`);if(Z.placeholder&&G)A.push("opacity: 0; transition: opacity 300ms ease-out");if(j)A.push(j);if(A.length>0)M.push(`style="${A.join("; ")}"`);let T=[];if(H)T.push(H);if(Z.placeholder)T.push("stx-img-blur");if(T.length>0)M.push(`class="${T.join(" ")}"`);if(G&&!z)M.push("data-stx-lazy");for(let[C,v]of Object.entries(V))M.push(`data-${C}="${m0(v)}"`);let k;if(Z.placeholder||Z.dominantColor&&$.useDominantColor){let C=Z.placeholder?`background-image: url('${Z.placeholder}'); background-size: cover; background-position: center;`:`background-color: ${Z.dominantColor};`;k=`<div id="${B}" class="stx-img-placeholder" style="${C}">
1805
1803
  <picture>
1806
1804
  ${R.join(`
1807
1805
  `)}
@@ -1812,10 +1810,10 @@ ${R.join(`
1812
1810
  `)}
1813
1811
  <img ${M.join(" ")} />
1814
1812
  </picture>`;let y=[];if(Z.placeholder)y.push(J5);let E=G?c3(B):void 0,b;if(z&&L)b=`<link rel="preload" as="image" imagesrcset="${L}" />`;return{html:k,preloadLink:b,css:y.length>0?y.join(`
1815
- `):void 0,script:E}}async function p3($,Z,J){let X={src:Z.src,processed:!0,variants:[],placeholder:Z.placeholder?.dataURL,originalWidth:Z.placeholder?.width,originalHeight:Z.placeholder?.height};for(let[Y,Q]of Object.entries(Z.byFormat))if(Q)X.variants.push(...Q);return z5($,X,J)}function KJ(){return i2({name:"img",hasEndTag:!1,description:"Render an optimized responsive image with srcset and lazy loading",transform:async($,Z,J,X)=>{let{src:Y,alt:Q,options:G}=UJ($,Z,J);if(!Y)return console.warn("@img directive: missing src argument"),"<!-- @img: missing src -->";let z={src:Y,alt:Q||"",widths:G.widths||O1,formats:G.formats||S1,quality:G.quality,sizes:G.sizes,dpr:G.dpr,params:G.params,placeholder:G.placeholder,placeholderOptions:G.placeholderOptions,lazy:G.lazy!==!1,priority:G.priority||!1,loading:G.loading,decoding:G.decoding,fetchpriority:G.fetchpriority,objectFit:G.objectFit,objectPosition:G.objectPosition,class:G.class,style:G.style,id:G.id,width:G.width,height:G.height},q=J.__isDev||!1,K=await U2(z,{isDev:q}),U=K.html;if(K.preloadLink)U=K.preloadLink+`
1813
+ `):void 0,script:E}}async function p3($,Z,J){let X={src:Z.src,processed:!0,variants:[],placeholder:Z.placeholder?.dataURL,originalWidth:Z.placeholder?.width,originalHeight:Z.placeholder?.height};for(let[Y,Q]of Object.entries(Z.byFormat))if(Q)X.variants.push(...Q);return z5($,X,J)}function WJ(){return i2({name:"img",hasEndTag:!1,description:"Render an optimized responsive image with srcset and lazy loading",transform:async($,Z,J,X)=>{let{src:Y,alt:Q,options:G}=HJ($,Z,J);if(!Y)return console.warn("@img directive: missing src argument"),"<!-- @img: missing src -->";let z={src:Y,alt:Q||"",widths:G.widths||O1,formats:G.formats||S1,quality:G.quality,sizes:G.sizes,dpr:G.dpr,params:G.params,placeholder:G.placeholder,placeholderOptions:G.placeholderOptions,lazy:G.lazy!==!1,priority:G.priority||!1,loading:G.loading,decoding:G.decoding,fetchpriority:G.fetchpriority,objectFit:G.objectFit,objectPosition:G.objectPosition,class:G.class,style:G.style,id:G.id,width:G.width,height:G.height},q=J.__isDev||!1,K=await U2(z,{isDev:q}),U=K.html;if(K.preloadLink)U=K.preloadLink+`
1816
1814
  `+U;if(K.css)U+=`
1817
1815
  <style>${K.css}</style>`;if(K.script)U+=`
1818
- <script>${K.script}</script>`;return U},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function UJ($,Z,J){if(Z.src)return{src:String(Z.src),alt:String(Z.alt||""),options:Z.options||{}};let X=$.trim();if(X.startsWith("@img(")||X.startsWith("("))X=X.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let Y=WJ(X),Q=q5(Y[0],J)||"",G=q5(Y[1],J)||"",z={};if(Y[2]){let q=q5(Y[2],J);if(typeof q==="object"&&q!==null)z=q;else if(typeof Y[2]==="string")try{z=JSON.parse(Y[2])}catch{}}return{src:Q,alt:G,options:z}}function WJ($){let Z=[],J="",X=!1,Y="",Q=0,G=0;for(let z=0;z<$.length;z++){let q=$[z],K=z>0?$[z-1]:"";if((q==='"'||q==="'"||q==="`")&&K!=="\\"){if(!X)X=!0,Y=q;else if(q===Y)X=!1,Y="";else J+=q;continue}if(!X){if(q==="{")Q++;if(q==="}")Q--;if(q==="[")G++;if(q==="]")G--;if(q===","&&Q===0&&G===0){Z.push(J.trim()),J="";continue}}J+=q}if(J.trim())Z.push(J.trim());return Z}function q5($,Z){if(typeof $!=="string")return $;let J=$.trim();if(J.startsWith('"')&&J.endsWith('"')||J.startsWith("'")&&J.endsWith("'"))return J.slice(1,-1);if(!J.startsWith("/")&&!J.startsWith(".")&&!J.startsWith("http")&&!J.startsWith("{")){let X=Z[J];if(X!==void 0)return X}if(J.startsWith("{")||J.startsWith("["))try{return JSON.parse(J)}catch{}return J}var i3=KJ();async function o3(){try{return await import("./chunk-g4vpzv6b.js")}catch($){if(!n3)console.warn("[stx-media] Video processor not available, some features disabled:",$),n3=!0;return null}}var n3=!1,s3=!0,r3="metadata",HJ="https://cdn.jsdelivr.net/npm/ts-video-player@latest/dist/index.min.js";async function n2($,Z={}){let J=Z,X=$;if(X.process&&!X.skipProcessing){if(J.tsVideosConfig?.enabled&&!J.isDev)return _J(X,J)}if(J.processedResult?.processed)return t3($,J.processedResult,Z);let Y;if(X.generatePoster&&X.src&&!$.poster)Y=await OJ(X,J);let{src:Q,sources:G=[],poster:z,posterPlaceholder:q,controls:K=s3,autoplay:U=!1,muted:W=!1,loop:H=!1,preload:j=r3,playsinline:B=!0,lazy:V=!0,player:F="native",type:O,width:_,height:L,crossorigin:w,disablePictureInPicture:R=!1,disableRemotePlayback:D=!1}=$,M=Y||z,I=$.class,N=$.style,A=$.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(F==="ts-video")return BJ($,Z);if(O&&O!=="video")return jJ(Q||"",O,$);let T=G.length>0?G:Q?[{src:Q,type:a3(Q)}]:[],k=[`id="${A}"`];if(K)k.push("controls");if(U)k.push("autoplay");if(W)k.push("muted");if(H)k.push("loop");if(B)k.push("playsinline");if(R)k.push("disablepictureinpicture");if(D)k.push("disableremoteplayback");if(w)k.push(`crossorigin="${w}"`);if(V){if(k.push(`data-preload="${j}"`),k.push('preload="none"'),M)k.push(`data-poster="${D0(M)}"`);k.push("data-stx-lazy")}else if(k.push(`preload="${j}"`),M)k.push(`poster="${D0(M)}"`);if(_)k.push(`width="${_}"`);if(L)k.push(`height="${L}"`);if(I)k.push(`class="${D0(I)}"`);if(N)k.push(`style="${D0(N)}"`);let y=T.map((C)=>{return` <source ${V?`data-src="${D0(C.src)}"`:`src="${D0(C.src)}"`} type="${C.type}"${C.media?` media="${C.media}"`:""} />`}).join(`
1816
+ <script>${K.script}</script>`;return U},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function HJ($,Z,J){if(Z.src)return{src:String(Z.src),alt:String(Z.alt||""),options:Z.options||{}};let X=$.trim();if(X.startsWith("@img(")||X.startsWith("("))X=X.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let Y=jJ(X),Q=q5(Y[0],J)||"",G=q5(Y[1],J)||"",z={};if(Y[2]){let q=q5(Y[2],J);if(typeof q==="object"&&q!==null)z=q;else if(typeof Y[2]==="string")try{z=JSON.parse(Y[2])}catch{}}return{src:Q,alt:G,options:z}}function jJ($){let Z=[],J="",X=!1,Y="",Q=0,G=0;for(let z=0;z<$.length;z++){let q=$[z],K=z>0?$[z-1]:"";if((q==='"'||q==="'"||q==="`")&&K!=="\\"){if(!X)X=!0,Y=q;else if(q===Y)X=!1,Y="";else J+=q;continue}if(!X){if(q==="{")Q++;if(q==="}")Q--;if(q==="[")G++;if(q==="]")G--;if(q===","&&Q===0&&G===0){Z.push(J.trim()),J="";continue}}J+=q}if(J.trim())Z.push(J.trim());return Z}function q5($,Z){if(typeof $!=="string")return $;let J=$.trim();if(J.startsWith('"')&&J.endsWith('"')||J.startsWith("'")&&J.endsWith("'"))return J.slice(1,-1);if(!J.startsWith("/")&&!J.startsWith(".")&&!J.startsWith("http")&&!J.startsWith("{")){let X=Z[J];if(X!==void 0)return X}if(J.startsWith("{")||J.startsWith("["))try{return JSON.parse(J)}catch{}return J}var i3=WJ();async function o3(){try{return await import("./chunk-8883pgj8.js")}catch($){if(!n3)console.warn("[stx-media] Video processor not available, some features disabled:",$),n3=!0;return null}}var n3=!1,s3=!0,r3="metadata",BJ="https://cdn.jsdelivr.net/npm/ts-video-player@latest/dist/index.min.js";async function n2($,Z={}){let J=Z,X=$;if(X.process&&!X.skipProcessing){if(J.tsVideosConfig?.enabled&&!J.isDev)return FJ(X,J)}if(J.processedResult?.processed)return t3($,J.processedResult,Z);let Y;if(X.generatePoster&&X.src&&!$.poster)Y=await wJ(X,J);let{src:Q,sources:G=[],poster:z,posterPlaceholder:q,controls:K=s3,autoplay:U=!1,muted:W=!1,loop:H=!1,preload:j=r3,playsinline:B=!0,lazy:V=!0,player:F="native",type:O,width:_,height:L,crossorigin:w,disablePictureInPicture:R=!1,disableRemotePlayback:D=!1}=$,M=Y||z,I=$.class,N=$.style,A=$.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(F==="ts-video")return LJ($,Z);if(O&&O!=="video")return VJ(Q||"",O,$);let T=G.length>0?G:Q?[{src:Q,type:a3(Q)}]:[],k=[`id="${A}"`];if(K)k.push("controls");if(U)k.push("autoplay");if(W)k.push("muted");if(H)k.push("loop");if(B)k.push("playsinline");if(R)k.push("disablepictureinpicture");if(D)k.push("disableremoteplayback");if(w)k.push(`crossorigin="${w}"`);if(V){if(k.push(`data-preload="${j}"`),k.push('preload="none"'),M)k.push(`data-poster="${D0(M)}"`);k.push("data-stx-lazy")}else if(k.push(`preload="${j}"`),M)k.push(`poster="${D0(M)}"`);if(_)k.push(`width="${_}"`);if(L)k.push(`height="${L}"`);if(I)k.push(`class="${D0(I)}"`);if(N)k.push(`style="${D0(N)}"`);let y=T.map((C)=>{return` <source ${V?`data-src="${D0(C.src)}"`:`src="${D0(C.src)}"`} type="${C.type}"${C.media?` media="${C.media}"`:""} />`}).join(`
1819
1817
  `),E=`<video ${k.join(" ")}>
1820
1818
  ${y}
1821
1819
  Your browser does not support the video tag.
@@ -1854,9 +1852,9 @@ ${y}
1854
1852
 
1855
1853
  observer.observe(video);
1856
1854
  })();
1857
- `.trim();return{html:E,script:b}}function jJ($,Z,J){let{width:X=640,height:Y=360}=J,Q=J.class,G=J.style,z=J.id||`stx-embed-${Math.random().toString(36).slice(2,8)}`,q,K=null;switch(Z){case"youtube":K=VJ($),q=K?`https://www.youtube-nocookie.com/embed/${K}`:$;break;case"vimeo":K=LJ($),q=K?`https://player.vimeo.com/video/${K}`:$;break;case"dailymotion":K=$.split("/").pop()||"",q=`https://www.dailymotion.com/embed/video/${K}`;break;case"twitch":K=$.split("/").pop()||"",q=`https://player.twitch.tv/?video=${K}&parent=${typeof window<"u"?window.location.hostname:"localhost"}`;break;default:q=$}let U=[`id="${z}"`,`src="${D0(q)}"`,`width="${X}"`,`height="${Y}"`,'frameborder="0"',"allowfullscreen",'allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"'];if(Q)U.push(`class="${D0(Q)}"`);if(G)U.push(`style="${D0(G)}"`);if(J.lazy)U.push('loading="lazy"');return{html:`<div class="stx-video-embed" style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;">
1855
+ `.trim();return{html:E,script:b}}function VJ($,Z,J){let{width:X=640,height:Y=360}=J,Q=J.class,G=J.style,z=J.id||`stx-embed-${Math.random().toString(36).slice(2,8)}`,q,K=null;switch(Z){case"youtube":K=_J($),q=K?`https://www.youtube-nocookie.com/embed/${K}`:$;break;case"vimeo":K=OJ($),q=K?`https://player.vimeo.com/video/${K}`:$;break;case"dailymotion":K=$.split("/").pop()||"",q=`https://www.dailymotion.com/embed/video/${K}`;break;case"twitch":K=$.split("/").pop()||"",q=`https://player.twitch.tv/?video=${K}&parent=${typeof window<"u"?window.location.hostname:"localhost"}`;break;default:q=$}let U=[`id="${z}"`,`src="${D0(q)}"`,`width="${X}"`,`height="${Y}"`,'frameborder="0"',"allowfullscreen",'allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"'];if(Q)U.push(`class="${D0(Q)}"`);if(G)U.push(`style="${D0(G)}"`);if(J.lazy)U.push('loading="lazy"');return{html:`<div class="stx-video-embed" style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;">
1858
1856
  <iframe ${U.join(" ")} style="position:absolute;top:0;left:0;width:100%;height:100%;"></iframe>
1859
- </div>`}}function BJ($,Z={}){let{src:J,sources:X=[],poster:Y,controls:Q=!0,autoplay:G=!1,muted:z=!1,loop:q=!1,preload:K="metadata",playsinline:U=!0,lazy:W=!0,width:H,height:j}=$,B=$.class,V=$.style,F=$.id||`ts-video-${Math.random().toString(36).slice(2,8)}`,O={src:X.length>0?X:J,autoplay:G,loop:q,muted:z,playsinline:U,preload:K,poster:Y,controls:Q,title:$.title},_=["position: relative",H?`width: ${typeof H==="number"?H+"px":H}`:"width: 100%",j?`height: ${typeof j==="number"?j+"px":j}`:"",V||""].filter(Boolean).join("; "),L=`
1857
+ </div>`}}function LJ($,Z={}){let{src:J,sources:X=[],poster:Y,controls:Q=!0,autoplay:G=!1,muted:z=!1,loop:q=!1,preload:K="metadata",playsinline:U=!0,lazy:W=!0,width:H,height:j}=$,B=$.class,V=$.style,F=$.id||`ts-video-${Math.random().toString(36).slice(2,8)}`,O={src:X.length>0?X:J,autoplay:G,loop:q,muted:z,playsinline:U,preload:K,poster:Y,controls:Q,title:$.title},_=["position: relative",H?`width: ${typeof H==="number"?H+"px":H}`:"width: 100%",j?`height: ${typeof j==="number"?j+"px":j}`:"",V||""].filter(Boolean).join("; "),L=`
1860
1858
  <div
1861
1859
  id="${F}"
1862
1860
  class="ts-video-player${B?" "+D0(B):""}"
@@ -1893,7 +1891,7 @@ ${y}
1893
1891
 
1894
1892
  // Load ts-video-player from CDN
1895
1893
  var script = document.createElement('script');
1896
- script.src = '${HJ}';
1894
+ script.src = '${BJ}';
1897
1895
  script.onload = initPlayer;
1898
1896
  script.onerror = function() {
1899
1897
  console.error('[stx] Failed to load ts-video-player');
@@ -2023,7 +2021,7 @@ else {
2023
2021
  .ts-video-player__play-button svg {
2024
2022
  margin-left: 4px;
2025
2023
  }
2026
- `.trim();return{html:L,script:w,css:R}}function a3($){switch($.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 VJ($){let Z=[/youtube\.com\/watch\?v=([^&]+)/,/youtube\.com\/embed\/([^?]+)/,/youtu\.be\/([^?]+)/,/youtube\.com\/v\/([^?]+)/];for(let J of Z){let X=$.match(J);if(X)return X[1]}return null}function LJ($){let Z=$.match(/vimeo\.com\/(\d+)/);return Z?Z[1]:null}function D0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function YK($,Z,J){if(Z.src)return{src:String(Z.src),...Z};let X=$.trim();if(X.startsWith("@video(")||X.startsWith("("))X=X.replace(/^@video\(/,"").replace(/^\(/,"").replace(/\)$/,"");let Y=X.indexOf(",");if(Y===-1)return{src:X.replace(/^['"]|['"]$/g,"")};let Q=X.slice(0,Y).trim().replace(/^['"]|['"]$/g,""),G=X.slice(Y+1).trim();try{let z=JSON.parse(G);return{src:Q,...z}}catch{return{src:Q}}}async function _J($,Z){let J=await o3();if(!J)return n2({...$,process:!1},Z);let X=Z.tsVideosConfig,Y=await J.processVideo($.src,$,X,$.onProcessProgress);if(Y.processed)return t3($,Y,Z);return n2({...$,process:!1},Z)}async function OJ($,Z){let J=await o3();if(!J||!$.src)return;let X=typeof $.generatePoster==="object"?$.generatePoster:{timestamp:0},Y=Z.tsVideosConfig||{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos"};return(await J.generatePoster($.src,X,Y.outputDir,Y.baseUrl||"/videos"))?.url}function t3($,Z,J){let{controls:X=s3,autoplay:Y=!1,muted:Q=!1,loop:G=!1,preload:z=r3,playsinline:q=!0,lazy:K=!0,width:U,height:W,crossorigin:H,disablePictureInPicture:j=!1,disableRemotePlayback:B=!1}=$,V=$.class,F=$.style,O=$.id||`stx-video-${Math.random().toString(36).slice(2,8)}`,_=$.src,L=a3(_);if(Z.transcoded)_=Z.transcoded.url,L="video/mp4";let w=Z.streaming?.hls||Z.streaming?.dash;if(w){if(Z.streaming?.hls)_=Z.streaming.hls.manifestUrl,L="application/x-mpegURL";else if(Z.streaming?.dash)_=Z.streaming.dash.manifestUrl,L="application/dash+xml"}let R=Z.poster?.url||$.poster,D=[`id="${O}"`];if(X)D.push("controls");if(Y)D.push("autoplay");if(Q)D.push("muted");if(G)D.push("loop");if(q)D.push("playsinline");if(j)D.push("disablepictureinpicture");if(B)D.push("disableremoteplayback");if(H)D.push(`crossorigin="${H}"`);if(K){if(D.push(`data-preload="${z}"`),D.push('preload="none"'),R)D.push(`data-poster="${D0(R)}"`);D.push("data-stx-lazy")}else if(D.push(`preload="${z}"`),R)D.push(`poster="${D0(R)}"`);let M=U||Z.metadata?.width,I=W||Z.metadata?.height;if(M)D.push(`width="${M}"`);if(I)D.push(`height="${I}"`);if(V)D.push(`class="${D0(V)}"`);if(F)D.push(`style="${D0(F)}"`);let A=` <source ${K?`data-src="${D0(_)}"`:`src="${D0(_)}"`} type="${L}" />`,T=`<video ${D.join(" ")}>
2024
+ `.trim();return{html:L,script:w,css:R}}function a3($){switch($.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 _J($){let Z=[/youtube\.com\/watch\?v=([^&]+)/,/youtube\.com\/embed\/([^?]+)/,/youtu\.be\/([^?]+)/,/youtube\.com\/v\/([^?]+)/];for(let J of Z){let X=$.match(J);if(X)return X[1]}return null}function OJ($){let Z=$.match(/vimeo\.com\/(\d+)/);return Z?Z[1]:null}function D0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function XK($,Z,J){if(Z.src)return{src:String(Z.src),...Z};let X=$.trim();if(X.startsWith("@video(")||X.startsWith("("))X=X.replace(/^@video\(/,"").replace(/^\(/,"").replace(/\)$/,"");let Y=X.indexOf(",");if(Y===-1)return{src:X.replace(/^['"]|['"]$/g,"")};let Q=X.slice(0,Y).trim().replace(/^['"]|['"]$/g,""),G=X.slice(Y+1).trim();try{let z=JSON.parse(G);return{src:Q,...z}}catch{return{src:Q}}}async function FJ($,Z){let J=await o3();if(!J)return n2({...$,process:!1},Z);let X=Z.tsVideosConfig,Y=await J.processVideo($.src,$,X,$.onProcessProgress);if(Y.processed)return t3($,Y,Z);return n2({...$,process:!1},Z)}async function wJ($,Z){let J=await o3();if(!J||!$.src)return;let X=typeof $.generatePoster==="object"?$.generatePoster:{timestamp:0},Y=Z.tsVideosConfig||{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos"};return(await J.generatePoster($.src,X,Y.outputDir,Y.baseUrl||"/videos"))?.url}function t3($,Z,J){let{controls:X=s3,autoplay:Y=!1,muted:Q=!1,loop:G=!1,preload:z=r3,playsinline:q=!0,lazy:K=!0,width:U,height:W,crossorigin:H,disablePictureInPicture:j=!1,disableRemotePlayback:B=!1}=$,V=$.class,F=$.style,O=$.id||`stx-video-${Math.random().toString(36).slice(2,8)}`,_=$.src,L=a3(_);if(Z.transcoded)_=Z.transcoded.url,L="video/mp4";let w=Z.streaming?.hls||Z.streaming?.dash;if(w){if(Z.streaming?.hls)_=Z.streaming.hls.manifestUrl,L="application/x-mpegURL";else if(Z.streaming?.dash)_=Z.streaming.dash.manifestUrl,L="application/dash+xml"}let R=Z.poster?.url||$.poster,D=[`id="${O}"`];if(X)D.push("controls");if(Y)D.push("autoplay");if(Q)D.push("muted");if(G)D.push("loop");if(q)D.push("playsinline");if(j)D.push("disablepictureinpicture");if(B)D.push("disableremoteplayback");if(H)D.push(`crossorigin="${H}"`);if(K){if(D.push(`data-preload="${z}"`),D.push('preload="none"'),R)D.push(`data-poster="${D0(R)}"`);D.push("data-stx-lazy")}else if(D.push(`preload="${z}"`),R)D.push(`poster="${D0(R)}"`);let M=U||Z.metadata?.width,I=W||Z.metadata?.height;if(M)D.push(`width="${M}"`);if(I)D.push(`height="${I}"`);if(V)D.push(`class="${D0(V)}"`);if(F)D.push(`style="${D0(F)}"`);let A=` <source ${K?`data-src="${D0(_)}"`:`src="${D0(_)}"`} type="${L}" />`,T=`<video ${D.join(" ")}>
2027
2025
  ${A}
2028
2026
  Your browser does not support the video tag.
2029
2027
  </video>`;if(Z.spriteSheet)T=`<div class="stx-video-wrapper" data-sprite-sheet="${D0(Z.spriteSheet.url)}" data-sprite-cols="${Z.spriteSheet.columns}" data-sprite-interval="${Z.spriteSheet.interval}">
@@ -2072,9 +2070,9 @@ ${T}
2072
2070
  width: 100%;
2073
2071
  height: auto;
2074
2072
  }
2075
- `.trim();return{html:T,script:k,css:y}}function e3(){return i2({name:"video",hasEndTag:!1,description:"Render a video with optional ts-videos processing, streaming, and poster generation",transform:async($,Z,J,X)=>{let{src:Y,options:Q}=FJ($,Z,J);if(!Y)return console.warn("@video directive: missing src argument"),"<!-- @video: missing src -->";let G={src:Y,poster:Q.poster,controls:Q.controls!==!1,autoplay:Q.autoplay||!1,muted:Q.muted||!1,loop:Q.loop||!1,preload:Q.preload||"metadata",playsinline:Q.playsinline!==!1,lazy:Q.lazy!==!1,player:Q.player||"native",type:Q.type,width:Q.width,height:Q.height,class:Q.class,style:Q.style,id:Q.id,crossorigin:Q.crossorigin,disablePictureInPicture:Q.disablePictureInPicture,disableRemotePlayback:Q.disableRemotePlayback,title:Q.title,quality:Q.quality,platform:Q.platform,process:Q.process,generatePoster:Q.generatePoster,streaming:Q.streaming,transcode:Q.transcode,spriteSheet:Q.spriteSheet,waveform:Q.waveform},q={isDev:J.__isDev||!1,tsVideosConfig:J.__tsVideosConfig},K=await n2(G,q),U=K.html;if(K.css)U+=`
2073
+ `.trim();return{html:T,script:k,css:y}}function e3(){return i2({name:"video",hasEndTag:!1,description:"Render a video with optional ts-videos processing, streaming, and poster generation",transform:async($,Z,J,X)=>{let{src:Y,options:Q}=RJ($,Z,J);if(!Y)return console.warn("@video directive: missing src argument"),"<!-- @video: missing src -->";let G={src:Y,poster:Q.poster,controls:Q.controls!==!1,autoplay:Q.autoplay||!1,muted:Q.muted||!1,loop:Q.loop||!1,preload:Q.preload||"metadata",playsinline:Q.playsinline!==!1,lazy:Q.lazy!==!1,player:Q.player||"native",type:Q.type,width:Q.width,height:Q.height,class:Q.class,style:Q.style,id:Q.id,crossorigin:Q.crossorigin,disablePictureInPicture:Q.disablePictureInPicture,disableRemotePlayback:Q.disableRemotePlayback,title:Q.title,quality:Q.quality,platform:Q.platform,process:Q.process,generatePoster:Q.generatePoster,streaming:Q.streaming,transcode:Q.transcode,spriteSheet:Q.spriteSheet,waveform:Q.waveform},q={isDev:J.__isDev||!1,tsVideosConfig:J.__tsVideosConfig},K=await n2(G,q),U=K.html;if(K.css)U+=`
2076
2074
  <style>${K.css}</style>`;if(K.script)U+=`
2077
- <script>${K.script}</script>`;return U},defaults:{src:"",options:{controls:!0,lazy:!0,preload:"metadata"}}})}function FJ($,Z,J){if(Z.src)return{src:String(Z.src),options:Z.options||{}};let X=$.trim();if(X.startsWith("@video(")||X.startsWith("("))X=X.replace(/^@video\(/,"").replace(/^\(/,"").replace(/\)$/,"");let Y=wJ(X),Q=$7(Y[0],J)||"",G={};if(Y[1]){let z=$7(Y[1],J);if(typeof z==="object"&&z!==null)G=z;else if(typeof Y[1]==="string")try{G=JSON.parse(Y[1])}catch{}}return{src:Q,options:G}}function wJ($){let Z=[],J="",X=!1,Y="",Q=0,G=0;for(let z=0;z<$.length;z++){let q=$[z],K=z>0?$[z-1]:"";if((q==='"'||q==="'"||q==="`")&&K!=="\\"){if(!X)X=!0,Y=q;else if(q===Y)X=!1,Y="";else J+=q;continue}if(!X){if(q==="{")Q++;if(q==="}")Q--;if(q==="[")G++;if(q==="]")G--;if(q===","&&Q===0&&G===0){Z.push(J.trim()),J="";continue}}J+=q}if(J.trim())Z.push(J.trim());return Z}function $7($,Z){if(typeof $!=="string")return $;let J=$.trim();if(J.startsWith('"')&&J.endsWith('"')||J.startsWith("'")&&J.endsWith("'"))return J.slice(1,-1);if(!J.startsWith("/")&&!J.startsWith(".")&&!J.startsWith("http")&&!J.startsWith("{")){let X=Z[J];if(X!==void 0)return X}if(J.startsWith("{")||J.startsWith("["))try{return JSON.parse(J)}catch{}return J}var K5=e3();function J7($,Z,J,X){let Y=$;Y=Y.replace(/@meta\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(z,q,K)=>{if(!K&&q.includes(":")){let U=q.split(":"),W=q,H=U.length>1?U[1]:"";if(H&&Z[H])K=Z[H];else if(W.startsWith("og:")&&Z.openGraph&&Z.openGraph[U[1]])K=Z.openGraph[U[1]];else K="";return K?`<meta property="${p(W)}" content="${p(K)}">`:""}return K?`<meta name="${p(q)}" content="${p(K)}">`:""});let Q=/@metaTag\s*\(/g,G;while((G=Q.exec(Y))!==null){let z=G.index,q=z+G[0].length-1,K=1,U=q+1;while(U<Y.length&&K>0){if(Y[U]==="(")K++;else if(Y[U]===")"){if(K--,K===0)break}U++}if(K!==0)break;let W=Y.substring(q+1,U).trim(),H=U+1,j=(()=>{try{let B=T0(W,Z);if(!B)return"";let V="<meta";if(B.name)V+=` name="${p(String(B.name))}"`;if(B.property)V+=` property="${p(String(B.property))}"`;if(B.httpEquiv)V+=` http-equiv="${p(String(B.httpEquiv))}"`;if(B.content)V+=` content="${p(String(B.content))}"`;return V+=">",V}catch(B){let V=B instanceof Error?B.message:String(B);return Q0("MetaTag",V,Y0.EVALUATION_ERROR)}})();Y=Y.substring(0,z)+j+Y.substring(H),Q.lastIndex=0}return Y}function X7($,Z,J){let X=$,Y=/@structuredData\s*\(/g,Q;while((Q=Y.exec(X))!==null){let G=Q.index,z=G+Q[0].length-1,q=1,K=z+1;while(K<X.length&&q>0){if(X[K]==="(")q++;else if(X[K]===")"){if(q--,q===0)break}K++}if(q!==0)break;let U=X.substring(z+1,K).trim(),W=K+1,H=(()=>{try{let j=T0(U,Z);if(!j)return"";if(!j["@context"])j["@context"]="https://schema.org";return`<script type="application/ld+json">${JSON.stringify(j).replace(/<\//g,"<\\/")}</script>`}catch(j){let B=j instanceof Error?j.message:String(j);return Q0("StructuredData",B,Y0.EVALUATION_ERROR)}})();X=X.substring(0,G)+H+X.substring(W),Y.lastIndex=0}return X}function Y7($,Z,J,X){let Y=$,Q=/@seo\s*\(\s*\{/g,G;while((G=Q.exec(Y))!==null){let z=Y.indexOf("{",G.index+4),q=1,K=z+1,U=null,W=!1;while(K<Y.length&&q>0){let O=Y[K];if(W){W=!1,K++;continue}if(O==="\\"&&U){W=!0,K++;continue}if(U){if(O===U)U=null;K++;continue}if(O==='"'||O==="'"||O==="`"){U=O,K++;continue}if(O==="{")q++;else if(O==="}")q--;K++}if(q!==0)break;let H=Y.substring(K).match(/^\s*\)/);if(!H)break;let j=K+H[0].length,B=Y.substring(z,K),V=Y.substring(G.index,j),F=((O)=>{try{let _=T0(O,Z);if(!_)return"";let L="";if(_.title)L+=`<title>${p(_.title)}</title>
2075
+ <script>${K.script}</script>`;return U},defaults:{src:"",options:{controls:!0,lazy:!0,preload:"metadata"}}})}function RJ($,Z,J){if(Z.src)return{src:String(Z.src),options:Z.options||{}};let X=$.trim();if(X.startsWith("@video(")||X.startsWith("("))X=X.replace(/^@video\(/,"").replace(/^\(/,"").replace(/\)$/,"");let Y=DJ(X),Q=$7(Y[0],J)||"",G={};if(Y[1]){let z=$7(Y[1],J);if(typeof z==="object"&&z!==null)G=z;else if(typeof Y[1]==="string")try{G=JSON.parse(Y[1])}catch{}}return{src:Q,options:G}}function DJ($){let Z=[],J="",X=!1,Y="",Q=0,G=0;for(let z=0;z<$.length;z++){let q=$[z],K=z>0?$[z-1]:"";if((q==='"'||q==="'"||q==="`")&&K!=="\\"){if(!X)X=!0,Y=q;else if(q===Y)X=!1,Y="";else J+=q;continue}if(!X){if(q==="{")Q++;if(q==="}")Q--;if(q==="[")G++;if(q==="]")G--;if(q===","&&Q===0&&G===0){Z.push(J.trim()),J="";continue}}J+=q}if(J.trim())Z.push(J.trim());return Z}function $7($,Z){if(typeof $!=="string")return $;let J=$.trim();if(J.startsWith('"')&&J.endsWith('"')||J.startsWith("'")&&J.endsWith("'"))return J.slice(1,-1);if(!J.startsWith("/")&&!J.startsWith(".")&&!J.startsWith("http")&&!J.startsWith("{")){let X=Z[J];if(X!==void 0)return X}if(J.startsWith("{")||J.startsWith("["))try{return JSON.parse(J)}catch{}return J}var K5=e3();function J7($,Z,J,X){let Y=$;Y=Y.replace(/@meta\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(z,q,K)=>{if(!K&&q.includes(":")){let U=q.split(":"),W=q,H=U.length>1?U[1]:"";if(H&&Z[H])K=Z[H];else if(W.startsWith("og:")&&Z.openGraph&&Z.openGraph[U[1]])K=Z.openGraph[U[1]];else K="";return K?`<meta property="${p(W)}" content="${p(K)}">`:""}return K?`<meta name="${p(q)}" content="${p(K)}">`:""});let Q=/@metaTag\s*\(/g,G;while((G=Q.exec(Y))!==null){let z=G.index,q=z+G[0].length-1,K=1,U=q+1;while(U<Y.length&&K>0){if(Y[U]==="(")K++;else if(Y[U]===")"){if(K--,K===0)break}U++}if(K!==0)break;let W=Y.substring(q+1,U).trim(),H=U+1,j=(()=>{try{let B=T0(W,Z);if(!B)return"";let V="<meta";if(B.name)V+=` name="${p(String(B.name))}"`;if(B.property)V+=` property="${p(String(B.property))}"`;if(B.httpEquiv)V+=` http-equiv="${p(String(B.httpEquiv))}"`;if(B.content)V+=` content="${p(String(B.content))}"`;return V+=">",V}catch(B){let V=B instanceof Error?B.message:String(B);return Q0("MetaTag",V,Y0.EVALUATION_ERROR)}})();Y=Y.substring(0,z)+j+Y.substring(H),Q.lastIndex=0}return Y}function X7($,Z,J){let X=$,Y=/@structuredData\s*\(/g,Q;while((Q=Y.exec(X))!==null){let G=Q.index,z=G+Q[0].length-1,q=1,K=z+1;while(K<X.length&&q>0){if(X[K]==="(")q++;else if(X[K]===")"){if(q--,q===0)break}K++}if(q!==0)break;let U=X.substring(z+1,K).trim(),W=K+1,H=(()=>{try{let j=T0(U,Z);if(!j)return"";if(!j["@context"])j["@context"]="https://schema.org";return`<script type="application/ld+json">${JSON.stringify(j).replace(/<\//g,"<\\/")}</script>`}catch(j){let B=j instanceof Error?j.message:String(j);return Q0("StructuredData",B,Y0.EVALUATION_ERROR)}})();X=X.substring(0,G)+H+X.substring(W),Y.lastIndex=0}return X}function Y7($,Z,J,X){let Y=$,Q=/@seo\s*\(\s*\{/g,G;while((G=Q.exec(Y))!==null){let z=Y.indexOf("{",G.index+4),q=1,K=z+1,U=null,W=!1;while(K<Y.length&&q>0){let O=Y[K];if(W){W=!1,K++;continue}if(O==="\\"&&U){W=!0,K++;continue}if(U){if(O===U)U=null;K++;continue}if(O==='"'||O==="'"||O==="`"){U=O,K++;continue}if(O==="{")q++;else if(O==="}")q--;K++}if(q!==0)break;let H=Y.substring(K).match(/^\s*\)/);if(!H)break;let j=K+H[0].length,B=Y.substring(z,K),V=Y.substring(G.index,j),F=((O)=>{try{let _=T0(O,Z);if(!_)return"";let L="";if(_.title)L+=`<title>${p(_.title)}</title>
2078
2076
  `,L+=`<meta name="title" content="${p(_.title)}">
2079
2077
  `;if(_.description)L+=`<meta name="description" content="${p(_.description)}">
2080
2078
  `;if(_.keywords){let w=Array.isArray(_.keywords)?_.keywords.join(", "):_.keywords;L+=`<meta name="keywords" content="${p(w)}">
@@ -2114,15 +2112,15 @@ ${T}
2114
2112
  ${K}
2115
2113
  `),U;return U.replace(/<head[^>]*>/,`$&
2116
2114
  ${K}
2117
- `)}function p($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var RJ=["og:","article:","book:","profile:","fb:","music:","video:"];function Z7($){let Z=$.trim(),J=Z[0];if((J==="'"||J==='"'||J==="`")&&Z.length>1&&Z.at(-1)===J)return{value:Z.slice(1,-1),quoted:!0};return{value:Z,quoted:!1}}var U5={name:"meta",handler:($,Z,J,X)=>{if(Z.length<1)return Q0("Meta","meta directive requires at least the meta name",Y0.INVALID_DIRECTIVE_SYNTAX);let Y=Z7(Z[0]).value,Q;if(Z.length>1){let q=Z7(Z[1]);Q=q.quoted?q.value:String(J?.[q.value]??q.value)}else{let q=Y.includes(":")?Y.slice(Y.indexOf(":")+1):Y,K=J?.openGraph;Q=String(J?.[q]??K?.[q]??"")}if(!Q)return"";let z=RJ.some((q)=>Y.startsWith(q))?{property:Y,content:Q}:{name:Y,content:Q};if(J)J.__stx_runtime_head=o2(J.__stx_runtime_head??{},{meta:[z]});return""},hasEndTag:!1},W5={name:"structuredData",handler:($,Z,J,X)=>{if($.trim()==="")return Q0("StructuredData","structuredData directive requires JSON-LD content",Y0.INVALID_DIRECTIVE_SYNTAX);try{let Y=JSON.parse($);if(!Y["@context"])Y["@context"]="https://schema.org";if(!Y["@type"])return Q0("StructuredData","structuredData requires @type property",Y0.INVALID_DIRECTIVE_SYNTAX);return`<script type="application/ld+json">${JSON.stringify(Y)}</script>`}catch(Y){let Q=Y instanceof Error?Y.message:String(Y);return Q0("StructuredData",Q,Y0.EVALUATION_ERROR)}},hasEndTag:!0};function jK(){return[U5,W5]}function BK($,Z){let J=Z.replace(/\/$/,""),X=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
2115
+ `)}function p($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var NJ=["og:","article:","book:","profile:","fb:","music:","video:"];function Z7($){let Z=$.trim(),J=Z[0];if((J==="'"||J==='"'||J==="`")&&Z.length>1&&Z.at(-1)===J)return{value:Z.slice(1,-1),quoted:!0};return{value:Z,quoted:!1}}var U5={name:"meta",handler:($,Z,J,X)=>{if(Z.length<1)return Q0("Meta","meta directive requires at least the meta name",Y0.INVALID_DIRECTIVE_SYNTAX);let Y=Z7(Z[0]).value,Q;if(Z.length>1){let q=Z7(Z[1]);Q=q.quoted?q.value:String(J?.[q.value]??q.value)}else{let q=Y.includes(":")?Y.slice(Y.indexOf(":")+1):Y,K=J?.openGraph;Q=String(J?.[q]??K?.[q]??"")}if(!Q)return"";let z=NJ.some((q)=>Y.startsWith(q))?{property:Y,content:Q}:{name:Y,content:Q};if(J)J.__stx_runtime_head=o2(J.__stx_runtime_head??{},{meta:[z]});return""},hasEndTag:!1},W5={name:"structuredData",handler:($,Z,J,X)=>{if($.trim()==="")return Q0("StructuredData","structuredData directive requires JSON-LD content",Y0.INVALID_DIRECTIVE_SYNTAX);try{let Y=JSON.parse($);if(!Y["@context"])Y["@context"]="https://schema.org";if(!Y["@type"])return Q0("StructuredData","structuredData requires @type property",Y0.INVALID_DIRECTIVE_SYNTAX);return`<script type="application/ld+json">${JSON.stringify(Y)}</script>`}catch(Y){let Q=Y instanceof Error?Y.message:String(Y);return Q0("StructuredData",Q,Y0.EVALUATION_ERROR)}},hasEndTag:!0};function HK(){return[U5,W5]}function jK($,Z){let J=Z.replace(/\/$/,""),X=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
2118
2116
  <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
2119
2117
  ${$.map((Q)=>{let G=Q.startsWith("http")?Q:`${J}${Q.startsWith("/")?"":"/"}${Q}`;return` <sitemap>
2120
- <loc>${NJ(G)}</loc>
2118
+ <loc>${AJ(G)}</loc>
2121
2119
  <lastmod>${X}</lastmod>
2122
2120
  </sitemap>`}).join(`
2123
2121
  `)}
2124
- </sitemapindex>`}async function VK($,Z){let{extensions:J=[".stx",".html",".htm"],ignore:X=["_*",".*","node_modules","components","partials","layouts"]}=Z,Y=[],Q=J.length===1?`*${J[0]}`:`*{${J.join(",")}}`,G=new Bun.Glob(`**/${Q}`);for await(let z of G.scan($)){if(X.some((H)=>{if(H.startsWith("*"))return z.includes(H.slice(1));return z.startsWith(H)||z.includes(`/${H}`)}))continue;let K=z.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!K.startsWith("/"))K=`/${K}`;if(K!=="/"&&K.endsWith("/"))K=K.slice(0,-1);let U=`${$}/${z}`,W;try{let H=await Bun.file(U).stat();if(H)W=new Date(H.mtime).toISOString().split("T")[0]}catch{}Y.push({loc:K||"/",lastmod:W,priority:K==="/"?1:0.5})}return Y.sort((z,q)=>z.loc.localeCompare(q.loc)),Y}function DJ($){let Z=[];for(let J of $.rules){if(Z.push(`User-agent: ${J.userAgent}`),J.allow)for(let X of J.allow)Z.push(`Allow: ${X}`);if(J.disallow)for(let X of J.disallow)Z.push(`Disallow: ${X}`);if(J.crawlDelay!==void 0)Z.push(`Crawl-delay: ${J.crawlDelay}`);Z.push("")}if($.sitemap){let J=Array.isArray($.sitemap)?$.sitemap:[$.sitemap];for(let X of J)Z.push(`Sitemap: ${X}`)}if($.host)Z.push(`Host: ${$.host}`);return Z.join(`
2125
- `).trim()}function LK($){return DJ({rules:[{userAgent:"*",allow:["/"]}],sitemap:$})}function NJ($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}import MJ from"fs";import g0 from"path";async function DK($,Z){if(!$.webComponents?.enabled)return[];let J=$.webComponents.components||[],X=[];if(J.length>0){if($.debug)console.log(`Building ${J.length} web components...`);for(let Y of J)try{let Q=await AJ(Y,$,Z);if(Q)X.push(Q)}catch(Q){if(console.error(`Error building web component ${Y.name}:`,Q),$.debug)throw Q}}return X}async function AJ($,Z,J){let{name:X,file:Y,tag:Q,extends:G}=$;if(!X||!Y||!Q)return console.error("Invalid web component configuration, missing required fields:",$),null;let z=null;if(g0.isAbsolute(Y)&&await s(Y))z=Y;else if(Z.componentsDir){let V=g0.join(Z.componentsDir,Y);if(await s(V))z=V}if(!z)z=await s2(Y,process.cwd(),Z,J);if(!z)return console.error(`Web component source file not found: ${Y}`),null;let q=await Bun.file(z).text();J.add(z);let U=($.outputFormat||"js")==="ts",W=U?IJ({name:X,tag:Q,baseElement:G,source:q,shadowDOM:$.shadowDOM??!0,template:$.template??!0,styleSource:$.styleSource,attributes:$.attributes||[],attributeTypes:$.attributeTypes||{}}):kJ({name:X,tag:Q,baseElement:G,source:q,shadowDOM:$.shadowDOM??!0,template:$.template??!0,styleSource:$.styleSource,attributes:$.attributes||[]}),H=Z.webComponents?.outputDir||"dist/web-components";await MJ.promises.mkdir(H,{recursive:!0});let j=U?"ts":"js",B=g0.join(H,`${Q}.${j}`);if(await Bun.write(B,W),Z.debug)console.log(`Built web component ${X} -> ${B}`);return B}function kJ($){let{name:Z,tag:J,baseElement:X="HTMLElement",source:Y,shadowDOM:Q,template:G,styleSource:z,attributes:q=[]}=$,K=Y.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!Q)K=K.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),K=K.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),K=K.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),K=K.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");let U="";if(z)U=`<link rel="stylesheet" href="${z}">`;return`/**
2122
+ </sitemapindex>`}async function BK($,Z){let{extensions:J=[".stx",".html",".htm"],ignore:X=["_*",".*","node_modules","components","partials","layouts"]}=Z,Y=[],Q=J.length===1?`*${J[0]}`:`*{${J.join(",")}}`,G=new Bun.Glob(`**/${Q}`);for await(let z of G.scan($)){if(X.some((H)=>{if(H.startsWith("*"))return z.includes(H.slice(1));return z.startsWith(H)||z.includes(`/${H}`)}))continue;let K=z.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!K.startsWith("/"))K=`/${K}`;if(K!=="/"&&K.endsWith("/"))K=K.slice(0,-1);let U=`${$}/${z}`,W;try{let H=await Bun.file(U).stat();if(H)W=new Date(H.mtime).toISOString().split("T")[0]}catch{}Y.push({loc:K||"/",lastmod:W,priority:K==="/"?1:0.5})}return Y.sort((z,q)=>z.loc.localeCompare(q.loc)),Y}function MJ($){let Z=[];for(let J of $.rules){if(Z.push(`User-agent: ${J.userAgent}`),J.allow)for(let X of J.allow)Z.push(`Allow: ${X}`);if(J.disallow)for(let X of J.disallow)Z.push(`Disallow: ${X}`);if(J.crawlDelay!==void 0)Z.push(`Crawl-delay: ${J.crawlDelay}`);Z.push("")}if($.sitemap){let J=Array.isArray($.sitemap)?$.sitemap:[$.sitemap];for(let X of J)Z.push(`Sitemap: ${X}`)}if($.host)Z.push(`Host: ${$.host}`);return Z.join(`
2123
+ `).trim()}function VK($){return MJ({rules:[{userAgent:"*",allow:["/"]}],sitemap:$})}function AJ($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}import kJ from"fs";import g0 from"path";async function RK($,Z){if(!$.webComponents?.enabled)return[];let J=$.webComponents.components||[],X=[];if(J.length>0){if($.debug)console.log(`Building ${J.length} web components...`);for(let Y of J)try{let Q=await IJ(Y,$,Z);if(Q)X.push(Q)}catch(Q){if(console.error(`Error building web component ${Y.name}:`,Q),$.debug)throw Q}}return X}async function IJ($,Z,J){let{name:X,file:Y,tag:Q,extends:G}=$;if(!X||!Y||!Q)return console.error("Invalid web component configuration, missing required fields:",$),null;let z=null;if(g0.isAbsolute(Y)&&await s(Y))z=Y;else if(Z.componentsDir){let V=g0.join(Z.componentsDir,Y);if(await s(V))z=V}if(!z)z=await s2(Y,process.cwd(),Z,J);if(!z)return console.error(`Web component source file not found: ${Y}`),null;let q=await Bun.file(z).text();J.add(z);let U=($.outputFormat||"js")==="ts",W=U?EJ({name:X,tag:Q,baseElement:G,source:q,shadowDOM:$.shadowDOM??!0,template:$.template??!0,styleSource:$.styleSource,attributes:$.attributes||[],attributeTypes:$.attributeTypes||{}}):TJ({name:X,tag:Q,baseElement:G,source:q,shadowDOM:$.shadowDOM??!0,template:$.template??!0,styleSource:$.styleSource,attributes:$.attributes||[]}),H=Z.webComponents?.outputDir||"dist/web-components";await kJ.promises.mkdir(H,{recursive:!0});let j=U?"ts":"js",B=g0.join(H,`${Q}.${j}`);if(await Bun.write(B,W),Z.debug)console.log(`Built web component ${X} -> ${B}`);return B}function TJ($){let{name:Z,tag:J,baseElement:X="HTMLElement",source:Y,shadowDOM:Q,template:G,styleSource:z,attributes:q=[]}=$,K=Y.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!Q)K=K.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),K=K.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),K=K.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),K=K.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");let U="";if(z)U=`<link rel="stylesheet" href="${z}">`;return`/**
2126
2124
  * ${Z} Web Component
2127
2125
  * Auto-generated from stx component
2128
2126
  */
@@ -2214,7 +2212,7 @@ class ${Z.replace(/\W/g,"")} extends ${X} {
2214
2212
 
2215
2213
  // Register the web component
2216
2214
  customElements.define('${J}', ${Z.replace(/\W/g,"")})
2217
- `}function IJ($){let{name:Z,tag:J,baseElement:X="HTMLElement",source:Y,shadowDOM:Q,template:G,styleSource:z,attributes:q=[],attributeTypes:K={}}=$,U=Z.replace(/\W/g,""),W=Y.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!Q)W=W.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),W=W.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),W=W.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),W=W.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");W=W.replace(/`/g,"\\`").replace(/\$\{/g,"\\${");let H=z?`<link rel="stylesheet" href="${z}">`:"",j=(R)=>{switch(K[R]){case"number":return"number";case"boolean":return"boolean";case"object":return"Record<string, unknown>";default:return"string"}},B=(R)=>R.replace(/-([a-z])/g,(D,M)=>M.toUpperCase()),V=q.map((R)=>` private _${B(R)}: ${j(R)} | null = null;`).join(`
2215
+ `}function EJ($){let{name:Z,tag:J,baseElement:X="HTMLElement",source:Y,shadowDOM:Q,template:G,styleSource:z,attributes:q=[],attributeTypes:K={}}=$,U=Z.replace(/\W/g,""),W=Y.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!Q)W=W.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),W=W.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),W=W.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),W=W.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");W=W.replace(/`/g,"\\`").replace(/\$\{/g,"\\${");let H=z?`<link rel="stylesheet" href="${z}">`:"",j=(R)=>{switch(K[R]){case"number":return"number";case"boolean":return"boolean";case"object":return"Record<string, unknown>";default:return"string"}},B=(R)=>R.replace(/-([a-z])/g,(D,M)=>M.toUpperCase()),V=q.map((R)=>` private _${B(R)}: ${j(R)} | null = null;`).join(`
2218
2216
  `),F=q.map((R)=>{let D=j(R),M=B(R);return`
2219
2217
  get ${M}(): ${D} | null {
2220
2218
  return this._${M};
@@ -2369,9 +2367,9 @@ declare global {
2369
2367
 
2370
2368
  // Register the web component
2371
2369
  customElements.define('${J}', ${U});
2372
- `}var H5={strategy:"attribute",attributeName:"data-v",preserveOriginal:!0};function j5($){let Z=$.split("").reduce((J,X)=>(J<<5)-J+X.charCodeAt(0)|0,0);return Math.abs(Z).toString(36).slice(0,8)}function TJ($,Z,J={}){let X={...H5,...J},Y=j5(Z);switch(X.strategy){case"shadow":return $;case"prefix":return bJ($,X.prefix||Z,X.preserveOriginal);case"attribute":return EJ($,Y,X.attributeName||"data-v",X.preserveOriginal);case"bem":return yJ($,Z,X.preserveOriginal);default:return $}}function EJ($,Z,J,X){let Y=`[${J}-${Z}]`;return $.replace(/([.#]?[\w-]+|\*)\s*(\{|,)/g,(Q,G,z)=>{if(G.startsWith("@"))return Q;if(/^(?::root|:host|html|body)$/i.test(G))return Q;return`${X?`${G}${Y}`:`${G}${Y}`}${z}`})}function bJ($,Z,J){return $.replace(/\.([a-z_][\w-]*)/gi,(X,Y)=>{if(Y.startsWith(Z))return X;let Q=`${Z}__${Y}`;return J?`.${Q}`:`.${Q}`})}function yJ($,Z,J){let X=Z.replace(/[^a-z0-9]/gi,"-");return $.replace(/\.([a-z_][\w-]*)/gi,(Y,Q)=>{if(Q.includes("__")||Q.includes("--")){if(!Q.startsWith(X))return`.${X}__${Q}`;return Y}let G=`${X}__${Q}`;return J?`.${G}`:`.${G}`})}function CJ($,Z,J={}){let X={...H5,...J};if(X.strategy==="shadow")return $;if(X.strategy==="attribute"){let Y=j5(Z),G=`${X.attributeName||"data-v"}-${Y}`;return $.replace(/<([a-z][a-z0-9-]*)([^>]*)>/gi,(z,q,K)=>{if(/^(?:script|style|!--)$/i.test(q))return z;let U=K.trimEnd().endsWith("/"),W=U?K.slice(0,-1):K;return`<${q}${W} ${G}${U?"/":""}>`})}if(X.strategy==="prefix"||X.strategy==="bem"){let Y=X.strategy==="bem"?Z.replace(/[^a-z0-9]/gi,"-"):X.prefix||Z;return $.replace(/\bclass\s*=\s*["']([^"']+)["']/gi,(Q,G)=>{return`class="${G.split(/\s+/).map((q)=>{if(!q)return q;if(q.startsWith(Y))return q;return`${Y}__${q}`}).join(" ")}"`})}return $}function NK($,Z={}){let J={...H5,...Z},X=j5($);return`${J.attributeName||"data-v"}-${X}`}function MK($,Z,J={}){let X="",Y=$.replace(/<style([^>]*)>([\s\S]*?)<\/style>/gi,(G,z,q)=>{if(/\bscoped\b/i.test(z)||J.strategy!=="shadow")X+=`${TJ(q,Z,J)}
2370
+ `}var H5={strategy:"attribute",attributeName:"data-v",preserveOriginal:!0};function j5($){let Z=$.split("").reduce((J,X)=>(J<<5)-J+X.charCodeAt(0)|0,0);return Math.abs(Z).toString(36).slice(0,8)}function bJ($,Z,J={}){let X={...H5,...J},Y=j5(Z);switch(X.strategy){case"shadow":return $;case"prefix":return CJ($,X.prefix||Z,X.preserveOriginal);case"attribute":return yJ($,Y,X.attributeName||"data-v",X.preserveOriginal);case"bem":return SJ($,Z,X.preserveOriginal);default:return $}}function yJ($,Z,J,X){let Y=`[${J}-${Z}]`;return $.replace(/([.#]?[\w-]+|\*)\s*(\{|,)/g,(Q,G,z)=>{if(G.startsWith("@"))return Q;if(/^(?::root|:host|html|body)$/i.test(G))return Q;return`${X?`${G}${Y}`:`${G}${Y}`}${z}`})}function CJ($,Z,J){return $.replace(/\.([a-z_][\w-]*)/gi,(X,Y)=>{if(Y.startsWith(Z))return X;let Q=`${Z}__${Y}`;return J?`.${Q}`:`.${Q}`})}function SJ($,Z,J){let X=Z.replace(/[^a-z0-9]/gi,"-");return $.replace(/\.([a-z_][\w-]*)/gi,(Y,Q)=>{if(Q.includes("__")||Q.includes("--")){if(!Q.startsWith(X))return`.${X}__${Q}`;return Y}let G=`${X}__${Q}`;return J?`.${G}`:`.${G}`})}function PJ($,Z,J={}){let X={...H5,...J};if(X.strategy==="shadow")return $;if(X.strategy==="attribute"){let Y=j5(Z),G=`${X.attributeName||"data-v"}-${Y}`;return $.replace(/<([a-z][a-z0-9-]*)([^>]*)>/gi,(z,q,K)=>{if(/^(?:script|style|!--)$/i.test(q))return z;let U=K.trimEnd().endsWith("/"),W=U?K.slice(0,-1):K;return`<${q}${W} ${G}${U?"/":""}>`})}if(X.strategy==="prefix"||X.strategy==="bem"){let Y=X.strategy==="bem"?Z.replace(/[^a-z0-9]/gi,"-"):X.prefix||Z;return $.replace(/\bclass\s*=\s*["']([^"']+)["']/gi,(Q,G)=>{return`class="${G.split(/\s+/).map((q)=>{if(!q)return q;if(q.startsWith(Y))return q;return`${Y}__${q}`}).join(" ")}"`})}return $}function DK($,Z={}){let J={...H5,...Z},X=j5($);return`${J.attributeName||"data-v"}-${X}`}function NK($,Z,J={}){let X="",Y=$.replace(/<style([^>]*)>([\s\S]*?)<\/style>/gi,(G,z,q)=>{if(/\bscoped\b/i.test(z)||J.strategy!=="shadow")X+=`${bJ(q,Z,J)}
2373
2371
  `;else X+=`${q}
2374
- `;return""});return{html:CJ(Y,Z,J),css:X.trim()}}function v1($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function AK($){let{name:Z,tag:J,baseElement:X="HTMLElement",template:Y,styles:Q="",shadowDOM:G=!0,properties:z={},lifecycle:q={},events:K={},methods:U={},state:W={}}=$,H=Z.replace(/\W/g,""),j=Object.keys(z),B=j.filter((I)=>z[I].attribute!==!1).map((I)=>z[I].attribute||v1(I)),V=j.map((I)=>{let N=z[I],A=N.default!==void 0?JSON.stringify(N.default):N.type==="string"?'""':N.type==="number"?"0":N.type==="boolean"?"false":N.type==="array"?"[]":"{}";return` this._${I} = ${A};`}).join(`
2372
+ `;return""});return{html:PJ(Y,Z,J),css:X.trim()}}function v1($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function MK($){let{name:Z,tag:J,baseElement:X="HTMLElement",template:Y,styles:Q="",shadowDOM:G=!0,properties:z={},lifecycle:q={},events:K={},methods:U={},state:W={}}=$,H=Z.replace(/\W/g,""),j=Object.keys(z),B=j.filter((I)=>z[I].attribute!==!1).map((I)=>z[I].attribute||v1(I)),V=j.map((I)=>{let N=z[I],A=N.default!==void 0?JSON.stringify(N.default):N.type==="string"?'""':N.type==="number"?"0":N.type==="boolean"?"false":N.type==="array"?"[]":"{}";return` this._${I} = ${A};`}).join(`
2375
2373
  `),F=j.map((I)=>{let N=z[I],A=N.attribute!==!1?N.attribute||v1(I):null,T=N.reflect&&A?`
2376
2374
  if (value !== null && value !== undefined) {
2377
2375
  ${N.type==="boolean"?`if (value) { this.setAttribute('${A}', ''); }
@@ -2573,7 +2571,7 @@ customElements.define('${J}', ${H});
2573
2571
  // Export for module usage
2574
2572
  export { ${H} };
2575
2573
  export default ${H};
2576
- `}function kK($){let{name:Z,tag:J,baseElement:X="HTMLElement",template:Y,styles:Q="",shadowDOM:G=!0,properties:z={},lifecycle:q={},events:K={},methods:U={},state:W={}}=$,H=Z.replace(/\W/g,""),j=Object.keys(z),B=j.filter((N)=>z[N].attribute!==!1).map((N)=>z[N].attribute||v1(N)),V=(N)=>{switch(N){case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"object":return"Record<string, unknown>";case"array":return"unknown[]";default:return"unknown"}},F=j.length>0?`
2574
+ `}function AK($){let{name:Z,tag:J,baseElement:X="HTMLElement",template:Y,styles:Q="",shadowDOM:G=!0,properties:z={},lifecycle:q={},events:K={},methods:U={},state:W={}}=$,H=Z.replace(/\W/g,""),j=Object.keys(z),B=j.filter((N)=>z[N].attribute!==!1).map((N)=>z[N].attribute||v1(N)),V=(N)=>{switch(N){case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"object":return"Record<string, unknown>";case"array":return"unknown[]";default:return"unknown"}},F=j.length>0?`
2577
2575
  /**
2578
2576
  * Props interface for ${Z}
2579
2577
  */
@@ -2825,7 +2823,7 @@ declare global {
2825
2823
  customElements.define('${J}', ${H});
2826
2824
 
2827
2825
  export default ${H};
2828
- `}function IK(){return`/**
2826
+ `}function kK(){return`/**
2829
2827
  * ReactiveElement Mixin
2830
2828
  * Adds reactive properties and lifecycle management to web components
2831
2829
  */
@@ -2947,7 +2945,7 @@ else {
2947
2945
 
2948
2946
  export { ReactiveElement };
2949
2947
  export default ReactiveElement;
2950
- `}function TK(){return`/**
2948
+ `}function IK(){return`/**
2951
2949
  * stx Reactive Web Components Runtime
2952
2950
  * Provides base classes and utilities for reactive web components
2953
2951
  */
@@ -3164,7 +3162,7 @@ else {
3164
3162
  };
3165
3163
 
3166
3164
  })(typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : this);
3167
- `}function SJ($,Z){let J=$.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),X=J?J[1].trim():"",Y=Z,Q=[],G=!0;if(X){let W=X.match(/export\s+default\s+({[\s\S]*})/);if(W)try{let H=W[1],j=H.match(/tag\s*:\s*['"`]([^'"`]+)['"`]/);if(j)Y=j[1];let B=H.match(/props\s*:\s*\[([\s\S]*?)\]/);if(B)Q=B[1].split(",").map((F)=>F.trim().replace(/['"`]/g,"")).filter((F)=>F.length>0);let V=H.match(/shadowDOM\s*:\s*(true|false)/);if(V)G=V[1]==="true"}catch{}}let z=$.match(/<template\b(?![^>]*\bid\s*=)[^>]*>([\s\S]*?)<\/template>/i),q=z?z[1].trim():"",K=$.match(/<style\b[^>]*>([\s\S]*?)<\/style>/i),U=K?K[1].trim():"";return{tag:Y,props:Q,template:q,styles:U,script:X,shadowDOM:G}}function PJ($){let{tag:Z,props:J,template:X,styles:Y,shadowDOM:Q}=$,G=Z.split("-").map((W)=>W.charAt(0).toUpperCase()+W.slice(1)).join(""),z=X.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${"),q=Y.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),K=J.map((W)=>`'${W}'`).join(", "),U=J.map((W)=>`
3165
+ `}function vJ($,Z){let J=$.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),X=J?J[1].trim():"",Y=Z,Q=[],G=!0;if(X){let W=X.match(/export\s+default\s+({[\s\S]*})/);if(W)try{let H=W[1],j=H.match(/tag\s*:\s*['"`]([^'"`]+)['"`]/);if(j)Y=j[1];let B=H.match(/props\s*:\s*\[([\s\S]*?)\]/);if(B)Q=B[1].split(",").map((F)=>F.trim().replace(/['"`]/g,"")).filter((F)=>F.length>0);let V=H.match(/shadowDOM\s*:\s*(true|false)/);if(V)G=V[1]==="true"}catch{}}let z=$.match(/<template\b(?![^>]*\bid\s*=)[^>]*>([\s\S]*?)<\/template>/i),q=z?z[1].trim():"",K=$.match(/<style\b[^>]*>([\s\S]*?)<\/style>/i),U=K?K[1].trim():"";return{tag:Y,props:Q,template:q,styles:U,script:X,shadowDOM:G}}function fJ($){let{tag:Z,props:J,template:X,styles:Y,shadowDOM:Q}=$,G=Z.split("-").map((W)=>W.charAt(0).toUpperCase()+W.slice(1)).join(""),z=X.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${"),q=Y.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),K=J.map((W)=>`'${W}'`).join(", "),U=J.map((W)=>`
3168
3166
  get ${W}() {
3169
3167
  return this.getAttribute('${W}') || '';
3170
3168
  }
@@ -3215,14 +3213,14 @@ ${U}
3215
3213
  }
3216
3214
 
3217
3215
  customElements.define('${Z}', ${G});
3218
- `}async function G7($,Z,J,X){if(Z.length<1)return Q0("WebComponent","@webcomponent directive requires at least the tag name parameter",Y0.INVALID_DIRECTIVE_SYNTAX);let Y=Z[0].replace(/['"]/g,""),G=(J.__stx_options||{}).componentsDir||"components",z=g0.isAbsolute(G)?[g0.join(G,`${Y}.stx`),g0.join(g0.dirname(X),`${Y}.stx`)]:[g0.join(g0.dirname(X),G,`${Y}.stx`),g0.join(process.cwd(),G,`${Y}.stx`),g0.join(g0.dirname(X),`${Y}.stx`)],q=null;for(let W of z)if(await s(W)){q=await Bun.file(W).text();break}if(!q)return Q0("WebComponent",`Component file not found: ${Y}.stx`,Y0.FILE_NOT_FOUND);let K=SJ(q,Y);return`<script type="module">
3219
- ${PJ(K)}
3220
- </script>`}var V7={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:W7,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:P3,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:G7,hasEndTag:!1,description:"Include a web component in the template"},K7,U7,U5,W5,i9,o9,s9,n9,b3,F3,i3,K5,...B7],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,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 fJ($,Z,J){let X=Z||"pages";if($)return{root:$,pagesDir:X};let Y=J||process.cwd(),Q=E0.join(Y,"resources","views"),G=E0.join(Y,"resources","layouts");if(r2.existsSync(Q)&&r2.existsSync(G))return{root:"resources",pagesDir:"views"};let z=E0.join(Y,"resources","views","pages");if(r2.existsSync(z))return{root:"resources/views",pagesDir:X};return{root:".",pagesDir:X}}var z7=new Set,a2=["partialsDir","componentsDir","layoutsDir"],B5=new WeakMap;function xJ($,Z){let J=Z.replace(/[\\/]+$/,"");if(!J||J===".")return!0;let X=$.replace(/\\/g,"/"),Y=J.replace(/\\/g,"/");return X===Y||X.startsWith(`${Y}/`)}function gJ($,Z){let J=!$.root,X=fJ($.root,$.pagesDir,Z);if($.root=X.root,$.pagesDir=X.pagesDir,J&&X.root!=="."){let Y=`${Z}::${X.root}`;if(!z7.has(Y))z7.add(Y),console.warn(`[stx] No "root" in config \u2014 inferred "${X.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!B5.has($)){let Y={};for(let Q of a2){let G=$[Q];if(typeof G==="string"&&G)Y[Q]=G}B5.set($,Y)}if($.root&&$.root!=="."){let Y=$.root;for(let Q of a2){let G=$[Q];if(typeof G!=="string"||!G)continue;if(E0.isAbsolute(G)||xJ(G,Y))continue;$[Q]=E0.join(Y,G)}}for(let Y of a2){let Q=$[Y];if(typeof Q!=="string"||!Q||E0.isAbsolute(Q))continue;$[Y]=E0.resolve(Z,Q)}return $}function hJ($,Z){let J=B5.get($);for(let X of a2){let Y=$[X];if(typeof Y!=="string"||!Y)continue;let Q=E0.isAbsolute(Y)?Y:E0.join(Z,Y);if(r2.existsSync(Q))continue;let G=J?.[X]??Y,z=$.root,q=!!z&&z!==".";console.warn(`[stx] ${String(X)} resolves to "${Q}", which does not exist. Configured as "${G}"`+(q?`, resolved under root "${z}".`:"."))}}function uJ($){if($.customDirectives)$.customDirectives=[...$.customDirectives];if($.middleware)$.middleware=[...$.middleware];if($.apiRoutes)$.apiRoutes={...$.apiRoutes}}function dJ($){if(H7($.stateDir),$.stateDir=j7(),$.cachePath=W2($.cachePath),$.build)$.build.cacheDir=W2($.build.cacheDir);if($.media?.cache)$.media.cache.directory=W2($.media.cache.directory);if($.story)$.story.outDir=W2($.story.outDir)}var f1=null,q7=new Map,t2=null;async function V5($){if(!$){if(f1)return f1;if(t2)return t2}let Z=$?E0.resolve($):process.cwd(),J=q7.get(Z);if(J)return J;let X=(async()=>{let Q=(await vJ({name:"stx",alias:"ui",cwd:Z,defaultConfig:V7,verbose:!1})).config;if(uJ(Q),dJ(Q),gJ(Q,Z),hJ(Q,Z),Q.plugins&&Q.plugins.length>0){let{pluginManager:G}=await import("./chunk-rj4kajww.js"),z=[],q=[];for(let K of Q.plugins){let U=typeof K==="string"?K:K[0],W=typeof K==="string"?{}:K[1]||{};try{let H,j;try{H=await import(U),j=E0.dirname(u.resolve(U))}catch{let V=E0.resolve(process.cwd(),U);H=await import(V),j=E0.dirname(V)}let B=H.default||H;if(!G.has(B.name))await G.register(B,Q);if(B.components){let V=Array.isArray(B.components)?B.components:[B.components];for(let F of V)z.push(E0.resolve(j,F))}if(B.pages){let V=E0.resolve(j,B.pages),F=W.path||"/";q.push({dir:V,prefix:F})}if(B.setup){let V={addDirective:(F)=>{Q.customDirectives=Q.customDirectives||[],Q.customDirectives.push(F)},addRoute:(F,O)=>{Q.apiRoutes=Q.apiRoutes||{},Q.apiRoutes[F]=O},addMiddleware:(F)=>{Q.middleware=Q.middleware||[],Q.middleware.push(F)},pluginDir:j,config:Q};await B.setup(W,V)}console.log(`[stx] Plugin loaded: ${B.name||U}`)}catch(H){console.warn(`[stx] Failed to load plugin ${U}:`,H.message)}}Q._pluginComponentDirs=z,Q._pluginPageDirs=q}return Q})();if(q7.set(Z,X),!$)t2=X,X.then((Y)=>{f1=Y}).catch(()=>{});return X}var L7=new Proxy(V7,{get($,Z){if(f1&&Z in f1)return f1[Z];if(!t2)V5().catch((J)=>{console.warn("[stx] Failed to load config file:",J?.message||J)});return $[Z]}});function cK($){return $}function pK($){let Z=[],J=[];if($.partialsDir!==void 0&&typeof $.partialsDir!=="string")Z.push({path:"partialsDir",message:"partialsDir must be a string",severity:"error"});if($.componentsDir!==void 0&&typeof $.componentsDir!=="string")Z.push({path:"componentsDir",message:"componentsDir must be a string",severity:"error"});if($.cache!==void 0&&typeof $.cache!=="boolean")Z.push({path:"cache",message:"cache must be a boolean",severity:"error"});if($.debug!==void 0&&typeof $.debug!=="boolean")Z.push({path:"debug",message:"debug must be a boolean",severity:"error"});if($.streaming){if($.streaming.bufferSize!==void 0){if(typeof $.streaming.bufferSize!=="number"||$.streaming.bufferSize<=0)Z.push({path:"streaming.bufferSize",message:"streaming.bufferSize must be a positive number",severity:"error"})}if($.streaming.timeout!==void 0){if(typeof $.streaming.timeout!=="number"||$.streaming.timeout<=0)Z.push({path:"streaming.timeout",message:"streaming.timeout must be a positive number",severity:"error"})}if($.streaming.strategy!==void 0){let X=["auto","manual","sections"];if(!X.includes($.streaming.strategy))Z.push({path:"streaming.strategy",message:`streaming.strategy must be one of: ${X.join(", ")}`,severity:"error"})}}if($.i18n){if($.i18n.format!==void 0){let X=["json","yaml","yml","js"];if(!X.includes($.i18n.format))Z.push({path:"i18n.format",message:`i18n.format must be one of: ${X.join(", ")}`,severity:"error"})}}if($.animation){if($.animation.defaultDuration!==void 0){if(typeof $.animation.defaultDuration!=="number"||$.animation.defaultDuration<0)Z.push({path:"animation.defaultDuration",message:"animation.defaultDuration must be a non-negative number",severity:"error"})}if($.animation.staggerDelay!==void 0){if(typeof $.animation.staggerDelay!=="number"||$.animation.staggerDelay<0)Z.push({path:"animation.staggerDelay",message:"animation.staggerDelay must be a non-negative number",severity:"error"})}}if($.a11y){if($.a11y.level!==void 0){let X=["AA","AAA"];if(!X.includes($.a11y.level))Z.push({path:"a11y.level",message:`a11y.level must be one of: ${X.join(", ")}`,severity:"error"})}}if($.hydration){if($.hydration.mode!==void 0){let X=["progressive","islands"];if(!X.includes($.hydration.mode))Z.push({path:"hydration.mode",message:`hydration.mode must be one of: ${X.join(", ")}`,severity:"error"})}if($.hydration.preload!==void 0){let X=["none","eager","lazy"];if(!X.includes($.hydration.preload))Z.push({path:"hydration.preload",message:`hydration.preload must be one of: ${X.join(", ")}`,severity:"error"})}}if($.customDirectives)if(!Array.isArray($.customDirectives))Z.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else $.customDirectives.forEach((X,Y)=>{if(!X.name||typeof X.name!=="string")Z.push({path:`customDirectives[${Y}].name`,message:"Custom directive must have a name string",severity:"error"});if(!X.handler||typeof X.handler!=="function")Z.push({path:`customDirectives[${Y}].handler`,message:"Custom directive must have a handler function",severity:"error"})});if($.middleware)if(!Array.isArray($.middleware))Z.push({path:"middleware",message:"middleware must be an array",severity:"error"});else $.middleware.forEach((X,Y)=>{if(!X.name||typeof X.name!=="string")Z.push({path:`middleware[${Y}].name`,message:"Middleware must have a name string",severity:"error"});if(!X.handler||typeof X.handler!=="function")Z.push({path:`middleware[${Y}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!X.timing||!["before","after"].includes(X.timing))Z.push({path:`middleware[${Y}].timing`,message:'Middleware timing must be "before" or "after"',severity:"error"})});if($.debug===!0&&$.cache===!0)J.push({path:"debug+cache",message:"Debug mode with caching enabled may show stale content during development",severity:"warning"});if($.seo?.enabled===!0&&!$.seo?.defaultConfig?.title)J.push({path:"seo.defaultConfig.title",message:"SEO is enabled but no default title is set",severity:"warning"});if($.pwa){if($.pwa.enabled===!0&&!$.pwa.manifest?.name)Z.push({path:"pwa.manifest.name",message:"PWA manifest name is required when PWA is enabled",severity:"error"});if($.pwa.manifest?.display!==void 0){let X=["fullscreen","standalone","minimal-ui","browser"];if(!X.includes($.pwa.manifest.display))Z.push({path:"pwa.manifest.display",message:`PWA display must be one of: ${X.join(", ")}`,severity:"error"})}if($.pwa.manifest?.orientation!==void 0){let X=["portrait","landscape","any","portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];if(!X.includes($.pwa.manifest.orientation))Z.push({path:"pwa.manifest.orientation",message:`PWA orientation must be one of: ${X.join(", ")}`,severity:"error"})}if($.pwa.routes){let X=["cache-first","network-first","stale-while-revalidate","network-only","cache-only"];$.pwa.routes.forEach((Y,Q)=>{if(!Y.pattern||typeof Y.pattern!=="string")Z.push({path:`pwa.routes[${Q}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!X.includes(Y.strategy))Z.push({path:`pwa.routes[${Q}].strategy`,message:`PWA route strategy must be one of: ${X.join(", ")}`,severity:"error"});if(Y.maxAgeSeconds!==void 0&&(typeof Y.maxAgeSeconds!=="number"||Y.maxAgeSeconds<0))Z.push({path:`pwa.routes[${Q}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(Y.maxEntries!==void 0&&(typeof Y.maxEntries!=="number"||Y.maxEntries<1))Z.push({path:`pwa.routes[${Q}].maxEntries`,message:"PWA route maxEntries must be a positive number",severity:"error"})})}if($.pwa.icons?.sizes){if(!Array.isArray($.pwa.icons.sizes))Z.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be an array of numbers",severity:"error"});else if($.pwa.icons.sizes.filter((Y)=>typeof Y!=="number"||Y<16||Y>1024).length>0)Z.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be numbers between 16 and 1024",severity:"error"})}if($.pwa.icons?.purpose){let X=["any","maskable","monochrome"];if($.pwa.icons.purpose.filter((Q)=>!X.includes(Q)).length>0)Z.push({path:"pwa.icons.purpose",message:`PWA icon purpose must be one of: ${X.join(", ")}`,severity:"error"})}if($.pwa.enabled===!0&&!$.pwa.icons?.src)J.push({path:"pwa.icons.src",message:"PWA is enabled but no icon source specified. Provide a 512x512 PNG for best results.",severity:"warning"});if($.pwa.enabled===!0&&!$.pwa.manifest?.themeColor)J.push({path:"pwa.manifest.themeColor",message:"PWA theme color not set, defaulting to black",severity:"warning"})}return{valid:Z.length===0,errors:Z,warnings:J}}var _5=new Map;async function cJ($,Z={}){try{if(!await s($))throw Error(`Markdown file not found: ${$}`);let X=(await mJ.promises.stat($)).mtime.getTime();if(Z.cache&&_5.has($)){let W=_5.get($);if(W.updatedAt>=X)return{content:W.content,data:W.data}}let Y=await Bun.file($).text(),{data:Q,content:G}=C3(Y),z=Z.markdown||L7.markdown||{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}},K=q2(G,{gfm:!0});if(z.syntaxHighlighting?.enabled&&z.syntaxHighlighting?.serverSide)K=await pJ(K,z.syntaxHighlighting?.defaultTheme||"github-dark",z.syntaxHighlighting?.highlightUnknownLanguages||!1);let U={content:K,data:Q||{}};if(Z.cache)_5.set($,{...U,updatedAt:X});return U}catch(J){if(Z.debug)console.error(`Error reading/parsing markdown file ${$}:`,J);let X=J instanceof Error?J.message:String(J);return{content:j0("Markdown File",`Error reading/parsing markdown file: ${X}`,$,"",0,""),data:{}}}}var e2=null;async function pJ($,Z,J){let X=/<pre><code( class="language-([^"]+)")?>([^<]+)<\/code><\/pre>/g;if(!e2)try{e2=await lJ({theme:Z||"github-dark",cache:!0})}catch(z){return console.error("Failed to initialize ts-syntax-highlighter:",z),$}let Y=async(z,q,K,U)=>{let W=U.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'"),H=K||(J?"text":"");if(!H)return z;try{if(!e2.getSupportedLanguages().includes(H))return z;return(await e2.highlight(W,H,{theme:Z})).html}catch(j){console.error(`Error highlighting code block with language ${K}:`,j)}return z},Q=$,G=$.matchAll(X);for(let z of G){let[q,K,U,W]=z,H=await Y(q,K,U,W);Q=Q.replace(q,H)}return Q}async function _7($,Z,J="",X={}){return await iJ($,/@markdown-file\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\}))?\)/g,async(G,z,q,K)=>{try{let U=z;if(!L5.isAbsolute(z))U=L5.resolve(L5.dirname(J),z);let W={};if(q)try{try{W=JSON.parse(q)}catch{if(X.debug)console.warn("Using safer alternative for parsing JS object literal");let _=q.replace(/^\s*\{|\}\s*$/g,"").trim().split(/,(?=\s*\w+\s*:)/);for(let L of _){let w=L.indexOf(":");if(w>0){let R=L.substring(0,w).trim(),D=L.substring(w+1).trim(),M=D.startsWith('"')&&D.endsWith('"'),I=D.startsWith("'")&&D.endsWith("'");if(M||I)D=D.substring(1,D.length-1);W[R]=D}}}}catch(O){if(X.debug)console.error("Error parsing context in @markdown-file directive:",O)}let{content:H,data:j}=await cJ(U,X),B={...Z,...j,...W},V=H,F=/\{\{([^}]+)\}\}/g;return V=V.replace(F,(O,_)=>{let L=_.trim();return B[L]!==void 0?String(B[L]):O}),V}catch(U){let W=U instanceof Error?U.message:String(U);return j0("Markdown File",`Error including markdown file: ${W}`,J,$,K,G)}})}async function iJ($,Z,J){let X=[],Y;while((Y=Z.exec($))!==null){let z=Y[0],q=Y.index,K=Y;X.push(J(...K).then((U)=>({match:z,replacement:U,index:q})))}let Q=await Promise.all(X);Q.sort((z,q)=>q.index-z.index);let G=$;for(let{match:z,replacement:q}of Q)G=G.replace(z,()=>q);return G}function K1($,Z){try{let J=$.trim();if(q0(J))return U0(J,Object.keys(Z))(...Object.values(Z));else return e(J,Z)}catch{return!1}}class $9{source;pos=0;line=1;column=0;tokens=[];constructor($){this.source=$}tokenize(){this.tokens=[],this.pos=0,this.line=1,this.column=0;while(this.pos<this.source.length){let $=this.nextToken();if($)this.tokens.push($)}return this.tokens.push({type:"EOF",value:"",start:this.pos,end:this.pos,line:this.line,column:this.column}),this.tokens}nextToken(){if(this.pos>=this.source.length)return null;let $=this.pos,Z=this.line,J=this.column,X=this.source[this.pos];if(/\s/.test(X))return this.readWhitespace($,Z,J);if(X==="/"&&this.peek(1)==="/")return this.readLineComment($,Z,J);if(X==="/"&&this.peek(1)==="*")return this.readBlockComment($,Z,J);if(X==='"'||X==="'")return this.readString(X,$,Z,J);if(X==="`")return this.readTemplateString($,Z,J);if(/\d/.test(X)||X==="."&&/\d/.test(this.peek(1)||""))return this.readNumber($,Z,J);if(/[a-z_$]/i.test(X))return this.readIdentifier($,Z,J);if(X==="{"){if(this.peek(1)==="{"&&this.peek(2)==="{")return this.advance(3),{type:"RAW_START",value:"{{{",start:$,end:this.pos,line:Z,column:J};if(this.peek(1)==="{")return this.advance(2),{type:"EXPRESSION_START",value:"{{",start:$,end:this.pos,line:Z,column:J};if(this.peek(1)==="!"&&this.peek(2)==="!")return this.advance(3),{type:"RAW_START",value:"{!!",start:$,end:this.pos,line:Z,column:J}}if(X==="}"){if(this.peek(1)==="}"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"}}}",start:$,end:this.pos,line:Z,column:J};if(this.peek(1)==="}")return this.advance(2),{type:"EXPRESSION_END",value:"}}",start:$,end:this.pos,line:Z,column:J}}if(X==="!"&&this.peek(1)==="!"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"!!}",start:$,end:this.pos,line:Z,column:J};if(X==="@"&&/[a-z]/i.test(this.peek(1)||""))return this.readDirective($,Z,J);let Y=["===","!==","==","!=","<=",">=","&&","||","??","++","--","+=","-=","*=","/=","%=","**","=>","?.","...","<<",">>",">>>","&=","|=","^="];for(let Q of Y)if(this.source.slice(this.pos,this.pos+Q.length)===Q)return this.advance(Q.length),{type:"OPERATOR",value:Q,start:$,end:this.pos,line:Z,column:J};if(/[+\-*/%<>=!&|^~?:]/.test(X))return this.advance(),{type:"OPERATOR",value:X,start:$,end:this.pos,line:Z,column:J};if(/[()[\]{},;.]/.test(X))return this.advance(),{type:"PUNCTUATION",value:X,start:$,end:this.pos,line:Z,column:J};return this.advance(),{type:"PUNCTUATION",value:X,start:$,end:this.pos,line:Z,column:J}}readWhitespace($,Z,J){while(this.pos<this.source.length&&/\s/.test(this.source[this.pos]))this.advance();return{type:"WHITESPACE",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:J}}readLineComment($,Z,J){this.advance(2);while(this.pos<this.source.length&&this.source[this.pos]!==`
3216
+ `}async function G7($,Z,J,X){if(Z.length<1)return Q0("WebComponent","@webcomponent directive requires at least the tag name parameter",Y0.INVALID_DIRECTIVE_SYNTAX);let Y=Z[0].replace(/['"]/g,""),G=(J.__stx_options||{}).componentsDir||"components",z=g0.isAbsolute(G)?[g0.join(G,`${Y}.stx`),g0.join(g0.dirname(X),`${Y}.stx`)]:[g0.join(g0.dirname(X),G,`${Y}.stx`),g0.join(process.cwd(),G,`${Y}.stx`),g0.join(g0.dirname(X),`${Y}.stx`)],q=null;for(let W of z)if(await s(W)){q=await Bun.file(W).text();break}if(!q)return Q0("WebComponent",`Component file not found: ${Y}.stx`,Y0.FILE_NOT_FOUND);let K=vJ(q,Y);return`<script type="module">
3217
+ ${fJ(K)}
3218
+ </script>`}var V7={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:W7,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:P3,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:G7,hasEndTag:!1,description:"Include a web component in the template"},K7,U7,U5,W5,i9,o9,s9,n9,b3,F3,i3,K5,...B7],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,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 gJ($,Z,J){let X=Z||"pages";if($)return{root:$,pagesDir:X};let Y=J||process.cwd(),Q=E0.join(Y,"resources","views"),G=E0.join(Y,"resources","layouts");if(r2.existsSync(Q)&&r2.existsSync(G))return{root:"resources",pagesDir:"views"};let z=E0.join(Y,"resources","views","pages");if(r2.existsSync(z))return{root:"resources/views",pagesDir:X};return{root:".",pagesDir:X}}var z7=new Set,a2=["partialsDir","componentsDir","layoutsDir"],B5=new WeakMap;function hJ($,Z){let J=Z.replace(/[\\/]+$/,"");if(!J||J===".")return!0;let X=$.replace(/\\/g,"/"),Y=J.replace(/\\/g,"/");return X===Y||X.startsWith(`${Y}/`)}function uJ($,Z){let J=!$.root,X=gJ($.root,$.pagesDir,Z);if($.root=X.root,$.pagesDir=X.pagesDir,J&&X.root!=="."){let Y=`${Z}::${X.root}`;if(!z7.has(Y))z7.add(Y),console.warn(`[stx] No "root" in config \u2014 inferred "${X.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!B5.has($)){let Y={};for(let Q of a2){let G=$[Q];if(typeof G==="string"&&G)Y[Q]=G}B5.set($,Y)}if($.root&&$.root!=="."){let Y=$.root;for(let Q of a2){let G=$[Q];if(typeof G!=="string"||!G)continue;if(E0.isAbsolute(G)||hJ(G,Y))continue;$[Q]=E0.join(Y,G)}}for(let Y of a2){let Q=$[Y];if(typeof Q!=="string"||!Q||E0.isAbsolute(Q))continue;$[Y]=E0.resolve(Z,Q)}return $}function dJ($,Z){let J=B5.get($);for(let X of a2){let Y=$[X];if(typeof Y!=="string"||!Y)continue;let Q=E0.isAbsolute(Y)?Y:E0.join(Z,Y);if(r2.existsSync(Q))continue;let G=J?.[X]??Y,z=$.root,q=!!z&&z!==".";console.warn(`[stx] ${String(X)} resolves to "${Q}", which does not exist. Configured as "${G}"`+(q?`, resolved under root "${z}".`:"."))}}function mJ($){if($.customDirectives)$.customDirectives=[...$.customDirectives];if($.middleware)$.middleware=[...$.middleware];if($.apiRoutes)$.apiRoutes={...$.apiRoutes}}function lJ($){if(H7($.stateDir),$.stateDir=j7(),$.cachePath=W2($.cachePath),$.build)$.build.cacheDir=W2($.build.cacheDir);if($.media?.cache)$.media.cache.directory=W2($.media.cache.directory);if($.story)$.story.outDir=W2($.story.outDir)}var f1=null,q7=new Map,t2=null;async function V5($){if(!$){if(f1)return f1;if(t2)return t2}let Z=$?E0.resolve($):process.cwd(),J=q7.get(Z);if(J)return J;let X=(async()=>{let Q=(await xJ({name:"stx",alias:"ui",cwd:Z,defaultConfig:V7,verbose:!1})).config;if(mJ(Q),lJ(Q),uJ(Q,Z),dJ(Q,Z),Q.plugins&&Q.plugins.length>0){let{pluginManager:G}=await import("./chunk-xpct12p7.js"),z=[],q=[];for(let K of Q.plugins){let U=typeof K==="string"?K:K[0],W=typeof K==="string"?{}:K[1]||{};try{let H,j;try{H=await import(U),j=E0.dirname(u.resolve(U))}catch{let V=E0.resolve(process.cwd(),U);H=await import(V),j=E0.dirname(V)}let B=H.default||H;if(!G.has(B.name))await G.register(B,Q);if(B.components){let V=Array.isArray(B.components)?B.components:[B.components];for(let F of V)z.push(E0.resolve(j,F))}if(B.pages){let V=E0.resolve(j,B.pages),F=W.path||"/";q.push({dir:V,prefix:F})}if(B.setup){let V={addDirective:(F)=>{Q.customDirectives=Q.customDirectives||[],Q.customDirectives.push(F)},addRoute:(F,O)=>{Q.apiRoutes=Q.apiRoutes||{},Q.apiRoutes[F]=O},addMiddleware:(F)=>{Q.middleware=Q.middleware||[],Q.middleware.push(F)},pluginDir:j,config:Q};await B.setup(W,V)}console.log(`[stx] Plugin loaded: ${B.name||U}`)}catch(H){console.warn(`[stx] Failed to load plugin ${U}:`,H.message)}}Q._pluginComponentDirs=z,Q._pluginPageDirs=q}return Q})();if(q7.set(Z,X),!$)t2=X,X.then((Y)=>{f1=Y}).catch(()=>{});return X}var L7=new Proxy(V7,{get($,Z){if(f1&&Z in f1)return f1[Z];if(!t2)V5().catch((J)=>{console.warn("[stx] Failed to load config file:",J?.message||J)});return $[Z]}});function lK($){return $}function cK($){let Z=[],J=[];if($.partialsDir!==void 0&&typeof $.partialsDir!=="string")Z.push({path:"partialsDir",message:"partialsDir must be a string",severity:"error"});if($.componentsDir!==void 0&&typeof $.componentsDir!=="string")Z.push({path:"componentsDir",message:"componentsDir must be a string",severity:"error"});if($.cache!==void 0&&typeof $.cache!=="boolean")Z.push({path:"cache",message:"cache must be a boolean",severity:"error"});if($.debug!==void 0&&typeof $.debug!=="boolean")Z.push({path:"debug",message:"debug must be a boolean",severity:"error"});if($.streaming){if($.streaming.bufferSize!==void 0){if(typeof $.streaming.bufferSize!=="number"||$.streaming.bufferSize<=0)Z.push({path:"streaming.bufferSize",message:"streaming.bufferSize must be a positive number",severity:"error"})}if($.streaming.timeout!==void 0){if(typeof $.streaming.timeout!=="number"||$.streaming.timeout<=0)Z.push({path:"streaming.timeout",message:"streaming.timeout must be a positive number",severity:"error"})}if($.streaming.strategy!==void 0){let X=["auto","manual","sections"];if(!X.includes($.streaming.strategy))Z.push({path:"streaming.strategy",message:`streaming.strategy must be one of: ${X.join(", ")}`,severity:"error"})}}if($.i18n){if($.i18n.format!==void 0){let X=["json","yaml","yml","js"];if(!X.includes($.i18n.format))Z.push({path:"i18n.format",message:`i18n.format must be one of: ${X.join(", ")}`,severity:"error"})}}if($.animation){if($.animation.defaultDuration!==void 0){if(typeof $.animation.defaultDuration!=="number"||$.animation.defaultDuration<0)Z.push({path:"animation.defaultDuration",message:"animation.defaultDuration must be a non-negative number",severity:"error"})}if($.animation.staggerDelay!==void 0){if(typeof $.animation.staggerDelay!=="number"||$.animation.staggerDelay<0)Z.push({path:"animation.staggerDelay",message:"animation.staggerDelay must be a non-negative number",severity:"error"})}}if($.a11y){if($.a11y.level!==void 0){let X=["AA","AAA"];if(!X.includes($.a11y.level))Z.push({path:"a11y.level",message:`a11y.level must be one of: ${X.join(", ")}`,severity:"error"})}}if($.hydration){if($.hydration.mode!==void 0){let X=["progressive","islands"];if(!X.includes($.hydration.mode))Z.push({path:"hydration.mode",message:`hydration.mode must be one of: ${X.join(", ")}`,severity:"error"})}if($.hydration.preload!==void 0){let X=["none","eager","lazy"];if(!X.includes($.hydration.preload))Z.push({path:"hydration.preload",message:`hydration.preload must be one of: ${X.join(", ")}`,severity:"error"})}}if($.customDirectives)if(!Array.isArray($.customDirectives))Z.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else $.customDirectives.forEach((X,Y)=>{if(!X.name||typeof X.name!=="string")Z.push({path:`customDirectives[${Y}].name`,message:"Custom directive must have a name string",severity:"error"});if(!X.handler||typeof X.handler!=="function")Z.push({path:`customDirectives[${Y}].handler`,message:"Custom directive must have a handler function",severity:"error"})});if($.middleware)if(!Array.isArray($.middleware))Z.push({path:"middleware",message:"middleware must be an array",severity:"error"});else $.middleware.forEach((X,Y)=>{if(!X.name||typeof X.name!=="string")Z.push({path:`middleware[${Y}].name`,message:"Middleware must have a name string",severity:"error"});if(!X.handler||typeof X.handler!=="function")Z.push({path:`middleware[${Y}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!X.timing||!["before","after"].includes(X.timing))Z.push({path:`middleware[${Y}].timing`,message:'Middleware timing must be "before" or "after"',severity:"error"})});if($.debug===!0&&$.cache===!0)J.push({path:"debug+cache",message:"Debug mode with caching enabled may show stale content during development",severity:"warning"});if($.seo?.enabled===!0&&!$.seo?.defaultConfig?.title)J.push({path:"seo.defaultConfig.title",message:"SEO is enabled but no default title is set",severity:"warning"});if($.pwa){if($.pwa.enabled===!0&&!$.pwa.manifest?.name)Z.push({path:"pwa.manifest.name",message:"PWA manifest name is required when PWA is enabled",severity:"error"});if($.pwa.manifest?.display!==void 0){let X=["fullscreen","standalone","minimal-ui","browser"];if(!X.includes($.pwa.manifest.display))Z.push({path:"pwa.manifest.display",message:`PWA display must be one of: ${X.join(", ")}`,severity:"error"})}if($.pwa.manifest?.orientation!==void 0){let X=["portrait","landscape","any","portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];if(!X.includes($.pwa.manifest.orientation))Z.push({path:"pwa.manifest.orientation",message:`PWA orientation must be one of: ${X.join(", ")}`,severity:"error"})}if($.pwa.routes){let X=["cache-first","network-first","stale-while-revalidate","network-only","cache-only"];$.pwa.routes.forEach((Y,Q)=>{if(!Y.pattern||typeof Y.pattern!=="string")Z.push({path:`pwa.routes[${Q}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!X.includes(Y.strategy))Z.push({path:`pwa.routes[${Q}].strategy`,message:`PWA route strategy must be one of: ${X.join(", ")}`,severity:"error"});if(Y.maxAgeSeconds!==void 0&&(typeof Y.maxAgeSeconds!=="number"||Y.maxAgeSeconds<0))Z.push({path:`pwa.routes[${Q}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(Y.maxEntries!==void 0&&(typeof Y.maxEntries!=="number"||Y.maxEntries<1))Z.push({path:`pwa.routes[${Q}].maxEntries`,message:"PWA route maxEntries must be a positive number",severity:"error"})})}if($.pwa.icons?.sizes){if(!Array.isArray($.pwa.icons.sizes))Z.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be an array of numbers",severity:"error"});else if($.pwa.icons.sizes.filter((Y)=>typeof Y!=="number"||Y<16||Y>1024).length>0)Z.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be numbers between 16 and 1024",severity:"error"})}if($.pwa.icons?.purpose){let X=["any","maskable","monochrome"];if($.pwa.icons.purpose.filter((Q)=>!X.includes(Q)).length>0)Z.push({path:"pwa.icons.purpose",message:`PWA icon purpose must be one of: ${X.join(", ")}`,severity:"error"})}if($.pwa.enabled===!0&&!$.pwa.icons?.src)J.push({path:"pwa.icons.src",message:"PWA is enabled but no icon source specified. Provide a 512x512 PNG for best results.",severity:"warning"});if($.pwa.enabled===!0&&!$.pwa.manifest?.themeColor)J.push({path:"pwa.manifest.themeColor",message:"PWA theme color not set, defaulting to black",severity:"warning"})}return{valid:Z.length===0,errors:Z,warnings:J}}var _5=new Map;async function iJ($,Z={}){try{if(!await s($))throw Error(`Markdown file not found: ${$}`);let X=(await cJ.promises.stat($)).mtime.getTime();if(Z.cache&&_5.has($)){let W=_5.get($);if(W.updatedAt>=X)return{content:W.content,data:W.data}}let Y=await Bun.file($).text(),{data:Q,content:G}=C3(Y),z=Z.markdown||L7.markdown||{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}},K=q2(G,{gfm:!0});if(z.syntaxHighlighting?.enabled&&z.syntaxHighlighting?.serverSide)K=await nJ(K,z.syntaxHighlighting?.defaultTheme||"github-dark",z.syntaxHighlighting?.highlightUnknownLanguages||!1);let U={content:K,data:Q||{}};if(Z.cache)_5.set($,{...U,updatedAt:X});return U}catch(J){if(Z.debug)console.error(`Error reading/parsing markdown file ${$}:`,J);let X=J instanceof Error?J.message:String(J);return{content:j0("Markdown File",`Error reading/parsing markdown file: ${X}`,$,"",0,""),data:{}}}}var e2=null;async function nJ($,Z,J){let X=/<pre><code( class="language-([^"]+)")?>([^<]+)<\/code><\/pre>/g;if(!e2)try{e2=await pJ({theme:Z||"github-dark",cache:!0})}catch(z){return console.error("Failed to initialize ts-syntax-highlighter:",z),$}let Y=async(z,q,K,U)=>{let W=U.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'"),H=K||(J?"text":"");if(!H)return z;try{if(!e2.getSupportedLanguages().includes(H))return z;return(await e2.highlight(W,H,{theme:Z})).html}catch(j){console.error(`Error highlighting code block with language ${K}:`,j)}return z},Q=$,G=$.matchAll(X);for(let z of G){let[q,K,U,W]=z,H=await Y(q,K,U,W);Q=Q.replace(q,H)}return Q}async function _7($,Z,J="",X={}){return await oJ($,/@markdown-file\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\}))?\)/g,async(G,z,q,K)=>{try{let U=z;if(!L5.isAbsolute(z))U=L5.resolve(L5.dirname(J),z);let W={};if(q)try{try{W=JSON.parse(q)}catch{if(X.debug)console.warn("Using safer alternative for parsing JS object literal");let _=q.replace(/^\s*\{|\}\s*$/g,"").trim().split(/,(?=\s*\w+\s*:)/);for(let L of _){let w=L.indexOf(":");if(w>0){let R=L.substring(0,w).trim(),D=L.substring(w+1).trim(),M=D.startsWith('"')&&D.endsWith('"'),I=D.startsWith("'")&&D.endsWith("'");if(M||I)D=D.substring(1,D.length-1);W[R]=D}}}}catch(O){if(X.debug)console.error("Error parsing context in @markdown-file directive:",O)}let{content:H,data:j}=await iJ(U,X),B={...Z,...j,...W},V=H,F=/\{\{([^}]+)\}\}/g;return V=V.replace(F,(O,_)=>{let L=_.trim();return B[L]!==void 0?String(B[L]):O}),V}catch(U){let W=U instanceof Error?U.message:String(U);return j0("Markdown File",`Error including markdown file: ${W}`,J,$,K,G)}})}async function oJ($,Z,J){let X=[],Y;while((Y=Z.exec($))!==null){let z=Y[0],q=Y.index,K=Y;X.push(J(...K).then((U)=>({match:z,replacement:U,index:q})))}let Q=await Promise.all(X);Q.sort((z,q)=>q.index-z.index);let G=$;for(let{match:z,replacement:q}of Q)G=G.replace(z,()=>q);return G}function K1($,Z){try{let J=$.trim();if(q0(J))return U0(J,Object.keys(Z))(...Object.values(Z));else return e(J,Z)}catch{return!1}}class $9{source;pos=0;line=1;column=0;tokens=[];constructor($){this.source=$}tokenize(){this.tokens=[],this.pos=0,this.line=1,this.column=0;while(this.pos<this.source.length){let $=this.nextToken();if($)this.tokens.push($)}return this.tokens.push({type:"EOF",value:"",start:this.pos,end:this.pos,line:this.line,column:this.column}),this.tokens}nextToken(){if(this.pos>=this.source.length)return null;let $=this.pos,Z=this.line,J=this.column,X=this.source[this.pos];if(/\s/.test(X))return this.readWhitespace($,Z,J);if(X==="/"&&this.peek(1)==="/")return this.readLineComment($,Z,J);if(X==="/"&&this.peek(1)==="*")return this.readBlockComment($,Z,J);if(X==='"'||X==="'")return this.readString(X,$,Z,J);if(X==="`")return this.readTemplateString($,Z,J);if(/\d/.test(X)||X==="."&&/\d/.test(this.peek(1)||""))return this.readNumber($,Z,J);if(/[a-z_$]/i.test(X))return this.readIdentifier($,Z,J);if(X==="{"){if(this.peek(1)==="{"&&this.peek(2)==="{")return this.advance(3),{type:"RAW_START",value:"{{{",start:$,end:this.pos,line:Z,column:J};if(this.peek(1)==="{")return this.advance(2),{type:"EXPRESSION_START",value:"{{",start:$,end:this.pos,line:Z,column:J};if(this.peek(1)==="!"&&this.peek(2)==="!")return this.advance(3),{type:"RAW_START",value:"{!!",start:$,end:this.pos,line:Z,column:J}}if(X==="}"){if(this.peek(1)==="}"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"}}}",start:$,end:this.pos,line:Z,column:J};if(this.peek(1)==="}")return this.advance(2),{type:"EXPRESSION_END",value:"}}",start:$,end:this.pos,line:Z,column:J}}if(X==="!"&&this.peek(1)==="!"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"!!}",start:$,end:this.pos,line:Z,column:J};if(X==="@"&&/[a-z]/i.test(this.peek(1)||""))return this.readDirective($,Z,J);let Y=["===","!==","==","!=","<=",">=","&&","||","??","++","--","+=","-=","*=","/=","%=","**","=>","?.","...","<<",">>",">>>","&=","|=","^="];for(let Q of Y)if(this.source.slice(this.pos,this.pos+Q.length)===Q)return this.advance(Q.length),{type:"OPERATOR",value:Q,start:$,end:this.pos,line:Z,column:J};if(/[+\-*/%<>=!&|^~?:]/.test(X))return this.advance(),{type:"OPERATOR",value:X,start:$,end:this.pos,line:Z,column:J};if(/[()[\]{},;.]/.test(X))return this.advance(),{type:"PUNCTUATION",value:X,start:$,end:this.pos,line:Z,column:J};return this.advance(),{type:"PUNCTUATION",value:X,start:$,end:this.pos,line:Z,column:J}}readWhitespace($,Z,J){while(this.pos<this.source.length&&/\s/.test(this.source[this.pos]))this.advance();return{type:"WHITESPACE",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:J}}readLineComment($,Z,J){this.advance(2);while(this.pos<this.source.length&&this.source[this.pos]!==`
3221
3219
  `)this.advance();return{type:"COMMENT",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:J}}readBlockComment($,Z,J){this.advance(2);while(this.pos<this.source.length-1){if(this.source[this.pos]==="*"&&this.source[this.pos+1]==="/"){this.advance(2);break}this.advance()}return{type:"COMMENT",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:J}}readString($,Z,J,X){this.advance();while(this.pos<this.source.length){let Y=this.source[this.pos];if(Y==="\\"){this.advance(2);continue}if(Y===$){this.advance();break}this.advance()}return{type:"STRING",value:this.source.slice(Z,this.pos),start:Z,end:this.pos,line:J,column:X}}readTemplateString($,Z,J){this.advance();let X=0,Y=256;while(this.pos<this.source.length){let Q=this.source[this.pos];if(Q==="\\"){this.advance(2);continue}if(Q==="$"&&this.peek(1)==="{"){if(X>=Y){this.pos=this.source.length;break}this.advance(2),X++;continue}if(Q==="{"&&X>0){X++,this.advance();continue}if(Q==="}"&&X>0){X--,this.advance();continue}if(Q==="`"&&X===0){this.advance();break}this.advance()}return{type:"TEMPLATE_STRING",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:J}}readNumber($,Z,J){if(this.source[this.pos]==="0"){let X=this.peek(1)?.toLowerCase();if(X==="x"||X==="o"||X==="b"){this.advance(2);while(this.pos<this.source.length&&/[\da-f_]/i.test(this.source[this.pos]))this.advance();return{type:"NUMBER",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:J}}}while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance();if(this.source[this.pos]==="."&&/\d/.test(this.peek(1)||"")){this.advance();while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance()}if(/e/i.test(this.source[this.pos]||"")){if(this.advance(),/[+-]/.test(this.source[this.pos]||""))this.advance();while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance()}if(this.source[this.pos]==="n")this.advance();return{type:"NUMBER",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:J}}readIdentifier($,Z,J){while(this.pos<this.source.length&&/[\w$]/.test(this.source[this.pos]))this.advance();return{type:"IDENTIFIER",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:J}}readDirective($,Z,J){this.advance();while(this.pos<this.source.length&&/[a-z]/i.test(this.source[this.pos]))this.advance();return{type:"DIRECTIVE",value:this.source.slice($,this.pos),start:$,end:this.pos,line:Z,column:J}}advance($=1){for(let Z=0;Z<$&&this.pos<this.source.length;Z++){if(this.source[this.pos]===`
3222
- `)this.line++,this.column=0;else this.column++;this.pos++}}peek($){return this.source[this.pos+$]}saveState(){return{pos:this.pos,line:this.line,column:this.column}}restoreState($){this.pos=$.pos,this.line=$.line,this.column=$.column}}function _0($,Z,J,X=0){let Y=0,Q=X,G=null,z=0,q=!1;while(Q<$.length){let K=$[Q];if(G&&q){q=!1,Q++;continue}if(G&&K==="\\"){q=!0,Q++;continue}if(q=!1,(K==='"'||K==="'"||K==="`")&&!G){G=K,Q++;continue}if(K===G&&G!=="`"){G=null,Q++;continue}if(G==="`"&&K==="$"&&$[Q+1]==="{"){z++,Q+=2;continue}if(z>0&&K==="}"){z--,Q++;continue}if(K==="`"&&G==="`"&&z===0){G=null,Q++;continue}if(G){Q++;continue}if(K===Z)Y++;else if(K===J){if(Y--,Y===0)return Q}Q++}return-1}function O7($,Z){let J=Z,X={paren:0,bracket:0,brace:0},Y=null,Q=0;while(J<$.length){let G=$[J];if((J>0?$[J-1]:"")==="\\"&&Y){J++;continue}if((G==='"'||G==="'")&&!Y){Y=G,J++;continue}if(G===Y&&Y!=="`"){Y=null,J++;continue}if(G==="`"&&!Y){Y="`",J++;continue}if(G==="`"&&Y==="`"&&Q===0){Y=null,J++;continue}if(Y==="`"&&G==="$"&&$[J+1]==="{"){Q++,J+=2;continue}if(Q>0){if(G==="{")Q++;else if(G==="}")Q--;J++;continue}if(Y){J++;continue}if(X.paren===0&&X.bracket===0&&X.brace===0){if($.slice(J,J+2)==="}}"||$.slice(J,J+3)==="!!}")break;if(G===","||G===";")break}if(G==="(")X.paren++;else if(G===")"){if(X.paren--,X.paren<0)break}else if(G==="[")X.bracket++;else if(G==="]"){if(X.bracket--,X.bracket<0)break}else if(G==="{")X.brace++;else if(G==="}"){if(X.brace--,X.brace<0)break}J++}return{expression:$.slice(Z,J),endPos:J}}function O5($){let Z=[],J="",X={paren:0,bracket:0,brace:0},Y=null,Q=0;for(let G=0;G<$.length;G++){let z=$[G];if((G>0?$[G-1]:"")==="\\"&&Y){J+=z;continue}if((z==='"'||z==="'")&&!Y){Y=z,J+=z;continue}if(z===Y&&Y!=="`"){Y=null,J+=z;continue}if(z==="`"&&!Y){Y="`",J+=z;continue}if(z==="`"&&Y==="`"&&Q===0){Y=null,J+=z;continue}if(Y==="`"&&z==="$"&&$[G+1]==="{"){Q++,J+=z+$[G+1],G++;continue}if(Q>0&&z==="{"){Q++,J+=z;continue}if(Q>0&&z==="}"){Q--,J+=z;continue}if(Y){J+=z;continue}if(z==="(")X.paren++;else if(z===")")X.paren--;else if(z==="[")X.bracket++;else if(z==="]")X.bracket--;else if(z==="{")X.brace++;else if(z==="}")X.brace--;if(z==="|"&&$[G+1]!=="|"&&(G===0||$[G-1]!=="|")&&$[G-1]!=="\\"&&X.paren===0&&X.bracket===0&&X.brace===0){Z.push(J.trim()),J="";continue}if(z==="|"&&$[G-1]==="\\"&&!Y){J=J.slice(0,-1)+z;continue}J+=z}if(J.trim())Z.push(J.trim());return Z}function U1($,Z){let J=nJ($,Z);return J.ok?{expression:J.expression,endPos:J.endPos}:null}function nJ($,Z){let J=Z;while(J<$.length&&/\s/.test($[J]))J++;if($[J]!=="(")return{ok:!1,reason:"missing-open-paren",pos:J};let X=_0($,"(",")",J);if(X===-1)return{ok:!1,reason:"unclosed-paren",pos:J};return{ok:!0,expression:$.slice(J+1,X),endPos:X+1}}function oJ($,Z){let J=$.lastIndexOf("<",Z);if(J===-1)return!1;return J>$.lastIndexOf(">",Z)}function F1($,Z,J,X){let Y=1,Q=X,G=new RegExp(`@${Z}\\s*\\(`,"g"),z=new RegExp(`@${J}(?![a-z])`,"g");while(Q<$.length&&Y>0){G.lastIndex=Q,z.lastIndex=Q;let q=G.exec($),K=z.exec($),U=q?q.index:1/0,W=K?K.index:1/0;if(U<W)Y++,Q=U+q[0].length;else if(W<1/0){if(Y--,Y===0)return W;Q=W+K[0].length}else break}return-1}function F7($,Z){let J=$.slice(Z).match(/^@if\s*/);if(!J)return null;let X=Z+J[0].length,Y=U1($,X);if(!Y)return null;let Q=Y.endPos,G=F1($,"if","endif",Q);if(G===-1)return null;let z=$.slice(Q,G),q=[],K=0,U="if",W=Y.expression,H=0,j=0;while(K<z.length){let B=z.indexOf("@",K);if(B===-1)break;K=B;let V=z.substring(B);if(oJ(z,B)){K++;continue}if(/^@if\s*\(/.test(V)){j++,K++;continue}if(/^@endif(?![a-z])/.test(V)){j--,K+=6;continue}if(j===0){let F=V.match(/^@elseif\s*/);if(F){q.push({type:U,condition:W,content:z.substring(H,K),start:Q+H,end:Q+K});let O=K+F[0].length,_=U1(z,O);if(!_){K++;continue}U="elseif",W=_.expression,K=_.endPos,H=K;continue}else if(/^@else(?![a-z])/.test(V)){q.push({type:U,condition:W,content:z.substring(H,K),start:Q+H,end:Q+K}),U="else",W=void 0,K+=5,H=K;continue}}K++}return q.push({type:U,condition:W,content:z.slice(H),start:Q+H,end:Q+z.length}),{fullMatch:$.slice(Z,G+6),branches:q,start:Z,end:G+6}}function H2($){let Z=[],J=/@if\s*\(/g,X=J.exec($);while(X!==null){if(Z.some((G)=>X.index>G.start&&X.index<G.end)){X=J.exec($);continue}let Q=F7($,X.index);if(Q)Z.push(Q),J.lastIndex=Q.end;X=J.exec($)}return Z}function Z9($,Z,J){let X=[],Y=new RegExp(`@${Z}\\s*\\(`,"g"),Q=Y.exec($);while(Q!==null){if(X.some((V)=>Q.index>V.start&&Q.index<V.end)){Q=Y.exec($);continue}let z=Q.index,q=z+Q[0].length-1,K=_0($,"(",")",q);if(K===-1){Q=Y.exec($);continue}let U=$.slice(q+1,K),W=K+1,H=F1($,Z,J,W);if(H===-1){Q=Y.exec($);continue}let j=$.slice(W,H),B=H+`@${J}`.length;X.push({fullMatch:$.slice(z,B),name:Z,params:U,content:j,start:z,end:B}),Y.lastIndex=B,Q=Y.exec($)}return X}function F5($,Z){let J=$.slice(Z).match(/^@switch\s*/);if(!J)return null;let X=Z+J[0].length,Y=U1($,X);if(!Y)return null;let Q=Y.endPos,G=F1($,"switch","endswitch",Q);if(G===-1)return null;let z=$.slice(Q,G),q=[],K=0,U=null,W=0;while(K<z.length){let H=z.slice(K),j=H.match(/^@switch\s*\(/),B=H.match(/^@endswitch(?![a-z])/);if(j){if(W++,U)U.content+=j[0];K+=j[0].length;continue}if(B){if(W--,U)U.content+=B[0];K+=B[0].length;continue}if(W>0){if(U)U.content+=z[K];K++;continue}let V=H.match(/^@case\s*/),F=H.match(/^@default(?![a-z])/),O=H.match(/^@break(?![a-z])/);if(V&&H.startsWith("@case")){if(U)q.push(U);let _=K+V[0].length,L=U1(z,_);if(!L){K++;continue}U={type:"case",value:L.expression,content:""},K=L.endPos}else if(F&&H.startsWith("@default")){if(U)q.push(U);U={type:"default",content:""},K+=F[0].length}else if(O&&H.startsWith("@break"))K+=O[0].length;else{if(U)U.content+=z[K];K++}}if(U)q.push(U);return{fullMatch:$.slice(Z,G+10),expression:Y.expression,cases:q,start:Z,end:G+10}}function sJ($){let Z=[],J=0;while(J<$.length){let X=$.indexOf("{{",J),Y=$.indexOf("{!!",J),Q=!1,G;if(X===-1&&Y===-1)break;else if(X===-1)G=Y,Q=!0;else if(Y===-1)G=X,Q=!1;else if(Y<X)G=Y,Q=!0;else G=X,Q=!1;if(!Q&&$.slice(G,G+3)==="{{{")Q=!0;let z=Q?$.slice(G,G+3)==="{{{"?"{{{":"{!!":"{{",q=Q?z==="{{{"?"}}}":"!!}":"}}",K=G+z.length,U=rJ($,K,q);if(U===-1){J=G+1;continue}let W=$.slice(K,U).trim(),H=U+q.length;Z.push({fullMatch:$.slice(G,H),expression:W,start:G,end:H,isRaw:Q}),J=H}return Z}function rJ($,Z,J){let X=Z,Y=null,Q={paren:0,bracket:0,brace:0},G=0;while(X<$.length){let z=$[X];if((X>0?$[X-1]:"")==="\\"&&Y){X++;continue}if((z==='"'||z==="'")&&!Y){Y=z,X++;continue}if(z===Y&&Y!=="`"){Y=null,X++;continue}if(z==="`"&&!Y){Y="`",X++;continue}if(z==="`"&&Y==="`"&&G===0){Y=null,X++;continue}if(Y==="`"&&z==="$"&&$[X+1]==="{"){G++,X+=2;continue}if(G>0){if(z==="{")G++;else if(z==="}")G--;X++;continue}if(Y){X++;continue}if(z==="(")Q.paren++;else if(z===")")Q.paren--;else if(z==="[")Q.bracket++;else if(z==="]")Q.bracket--;else if(z==="{")Q.brace++;else if(z==="}")Q.brace--;if(Q.paren===0&&Q.bracket===0&&Q.brace<=0){if($.slice(X,X+J.length)===J)return X}X++}return-1}function aJ($){let Z=O5($);if(Z.length===0)return{baseExpression:"",filters:[]};let J=Z[0],X=[];for(let Y=1;Y<Z.length;Y++){let Q=tJ(Z[Y]);if(Q)X.push(Q)}return{baseExpression:J,filters:X}}function tJ($){let Z=$.trim();if(!Z)return null;let J=Z.indexOf("(");if(J===-1)return{name:Z,args:[]};let X=Z.slice(0,J).trim(),Y=J+1,Q=_0(Z,"(",")",J);if(Q===-1)return{name:X,args:[]};let G=Z.slice(Y,Q),z=D7(G);return{name:X,args:z}}function D7($){let Z=[],J="",X={paren:0,bracket:0,brace:0},Y=null,Q=0;for(let G=0;G<$.length;G++){let z=$[G];if((G>0?$[G-1]:"")==="\\"&&Y){J+=z;continue}if((z==='"'||z==="'")&&!Y){Y=z,J+=z;continue}if(z===Y&&Y!=="`"){Y=null,J+=z;continue}if(z==="`"&&!Y){Y="`",J+=z;continue}if(z==="`"&&Y==="`"&&Q===0){Y=null,J+=z;continue}if(Y==="`"&&z==="$"&&$[G+1]==="{"){Q++,J+="${",G++;continue}if(Q>0&&z==="{"){Q++,J+=z;continue}if(Q>0&&z==="}"){Q--,J+=z;continue}if(Y){J+=z;continue}if(z==="(")X.paren++;else if(z===")")X.paren--;else if(z==="[")X.bracket++;else if(z==="]")X.bracket--;else if(z==="{")X.brace++;else if(z==="}")X.brace--;if(z===","&&X.paren===0&&X.bracket===0&&X.brace===0){Z.push(J.trim()),J="";continue}J+=z}if(J.trim())Z.push(J.trim());return Z}function eJ($,Z){let J=Z;while(J<$.length&&/\s/.test($[J]))J++;if($[J]!=="(")return null;let X=_0($,"(",")",J);if(X===-1)return null;return{params:$.slice(J+1,X),endPos:X+1}}function $X($){let Z=[],X=new $9($).tokenize().filter((Q)=>Q.type!=="WHITESPACE"&&Q.type!=="COMMENT"),Y=0;while(Y<X.length){let Q=X[Y],G=!1;if(Q.type==="IDENTIFIER"&&Q.value==="export"){if(G=!0,Y++,Y>=X.length)break}let z=X[Y];if(z.type==="IDENTIFIER"&&(z.value==="const"||z.value==="let"||z.value==="var")){let q=z.value;if(Y++,Y>=X.length)break;let K=X[Y];if(K.type==="IDENTIFIER"){let U=K.value;if(Y++,Y<X.length&&X[Y].type==="OPERATOR"&&X[Y].value==="="){Y++;let W=Y<X.length?X[Y].start:$.length,H=w7(X,Y,$);Y=H.nextIndex,Z.push({type:"variable",name:U,value:$.slice(W,H.endPos),exported:G,start:z.start,end:H.endPos})}}else if(K.type==="PUNCTUATION"&&(K.value==="{"||K.value==="[")){let U=K.start,W=K.value==="{"?"}":"]",H=_0($,K.value,W,U);if(H!==-1){let j=$.slice(U,H+1);if(Y=R7(X,H+1),Y<X.length&&X[Y].type==="OPERATOR"&&X[Y].value==="="){Y++;let B=Y<X.length?X[Y].start:$.length,V=w7(X,Y,$);Y=V.nextIndex;let F=`__stx_destructured_${Z.length}`;Z.push({type:"variable",name:F,value:`${$.slice(B,V.endPos)}; ${q} ${j} = ${F}`,exported:G,start:z.start,end:V.endPos})}}}}else if(z.type==="IDENTIFIER"&&z.value==="function"){let q=G?X[Y-1].start:z.start;if(Y++,Y>=X.length)break;let K=X[Y];if(K.type==="IDENTIFIER"){let U=K.value;Y++;let W=-1;while(Y<X.length){if(X[Y].type==="PUNCTUATION"&&X[Y].value==="{"){W=X[Y].start;break}Y++}if(W!==-1){let H=_0($,"{","}",W);if(H!==-1)Z.push({type:"function",name:U,value:$.slice(q,H+1).replace(/^export\s+/,""),exported:G,start:q,end:H+1}),Y=R7(X,H+1)}}}else Y++}return Z}function w7($,Z,J){let X=Z,Y={paren:0,bracket:0,brace:0},Q=Z<$.length?$[Z].start:J.length;while(X<$.length){let G=$[X];if(G.type==="PUNCTUATION"){if(G.value==="(")Y.paren++;else if(G.value===")")Y.paren--;else if(G.value==="[")Y.bracket++;else if(G.value==="]")Y.bracket--;else if(G.value==="{")Y.brace++;else if(G.value==="}")Y.brace--;if(G.value===";"&&Y.paren===0&&Y.bracket===0&&Y.brace===0){Q=G.start,X++;break}}if(G.type==="IDENTIFIER"&&(G.value==="const"||G.value==="let"||G.value==="var"||G.value==="function"||G.value==="export")){if(Y.paren===0&&Y.bracket===0&&Y.brace===0){Q=$[X-1]?.end??G.start;break}}Q=G.end,X++}return{nextIndex:X,endPos:Q}}function R7($,Z){for(let J=0;J<$.length;J++)if($[J].start>=Z)return J;return $.length}function ZX($,Z,J){let X=$,Y=!0;while(Y){Y=!1;let Q=X.match(/@switch\s*\(/);if(!Q||Q.index===void 0)break;let G=Q.index,z=F5(X,G);if(!z)break;try{let q;if(q0(z.expression))q=U0(z.expression,Object.keys(Z))(...Object.values(Z));else q=e(z.expression,Z);let K="",U=!1;for(let W of z.cases)if(W.type==="default"){if(!U)K=W.content.trim()}else try{let H;if(W.value&&q0(W.value))H=U0(W.value,Object.keys(Z))(...Object.values(Z));else if(W.value)H=e(W.value,Z);if(q===H){K=W.content.trim(),U=!0;break}}catch{continue}X=X.substring(0,G)+K+X.substring(z.end),Y=!0}catch(q){let K=q instanceof Error?q.message:String(q),U=Q0("Switch",`Error evaluating @switch expression: ${K}`,Y0.EVALUATION_ERROR);X=X.substring(0,G)+U+X.substring(z.end);break}}return X}function JX($){let Z=[];return{masked:$.replace(/<script\b[\s\S]*?<\/script\s*>/gi,(X)=>{return Z.push(X),`\x00stx-script-${Z.length-1}\x00`}),scripts:Z}}function XX($,Z){if(Z.length===0)return $;return $.replace(/\u0000stx-script-(\d+)\u0000/g,(J,X)=>Z[Number(X)]??J)}function Z1($,Z,J){let{masked:X,scripts:Y}=JX($);return XX(YX(X,Z,J),Y)}function YX($,Z,J){let X=$;X=ZX(X,Z,J);{let Q=!0;while(Q){Q=!1;let G=X.match(/@unless\s*\(/);if(!G||G.index===void 0)break;let z=G.index,q=U1(X,z+7);if(!q)break;let K=q.endPos,U=F1(X,"unless","endunless",K);if(U===-1){console.warn(`[stx] @unless directive at position ${z} has no matching @endunless \u2014 the block was skipped. Check for typos or missing closers.`);break}let W=X.slice(K,U),H=q.expression,j=-1;{let V=0,F=/@(?:if|unless)\s*\(/g,O=/@(?:endif|endunless)(?![a-z])/g,_=/@else(?![a-z])/g,L=[],w;while((w=F.exec(W))!==null)L.push({pos:w.index,type:"open"});while((w=O.exec(W))!==null)L.push({pos:w.index,type:"close"});while((w=_.exec(W))!==null)L.push({pos:w.index,type:"else"});L.sort((R,D)=>R.pos-D.pos);for(let R of L)if(R.type==="open")V++;else if(R.type==="close")V--;else if(R.type==="else"&&V===0){j=R.pos;break}}let B;if(j!==-1){let V=W.slice(0,j),F=W.slice(j+5);B=`@if (${H})${F}@else ${V}@endif`}else B=`@if (!(${H}))${W}@endif`;X=X.substring(0,z)+B+X.substring(U+10),Q=!0}}X=R5(X,Z,J),X=D5(X,Z,J),X=w5(X,Z);let Y=()=>{let Q=H2(X);if(Q.length===0)return!1;let G=Array(Q.length);for(let K=Q.length-1;K>=0;K--){let U=Q[K];try{let W="",H=!1;for(let j of U.branches){if(H)break;if(j.type==="else")W=j.content,H=!0;else try{let B;if(j.condition&&q0(j.condition))B=U0(j.condition,Object.keys(Z))(...Object.values(Z));else if(j.condition)B=e(j.condition,Z);if(B)W=j.content,H=!0}catch(B){W=Q0(j.type==="if"?"If":"Elseif",`Error in @${j.type}(${j.condition}): ${B instanceof Error?B.message:String(B)}`,Y0.EVALUATION_ERROR),H=!0}}G[K]=W}catch(W){let H=W instanceof Error?W.message:String(W);G[K]=Q0("If",`Error processing @if block: ${H}`,Y0.EVALUATION_ERROR)}}let z=Array(Q.length*2+1),q=0;for(let K=0;K<Q.length;K++){let U=Q[K];z[K*2]=X.slice(q,U.start),z[K*2+1]=G[K],q=U.end}return z[Q.length*2]=X.slice(q),X=z.join(""),!0};while(!0){let Q=X;if(!Y())break;if(X===Q)break}return X}function N7($){let Z=0;while(Z<$.length&&/\s/.test($[Z]))Z++;if($[Z]!=="(")return null;Z++;while(Z<$.length&&/\s/.test($[Z]))Z++;let J=$[Z];if(J!=="'"&&J!=='"')return null;Z++;let X=[];while(Z<$.length){let Y=$[Z];if(Y==="\\"&&Z+1<$.length){X.push($[Z+1]),Z+=2;continue}if(Y===J){Z++;break}X.push(Y),Z++}while(Z<$.length&&/\s/.test($[Z]))Z++;if($[Z]!==")")return null;return Z++,{value:X.join(""),consumed:Z}}function w5($,Z){let J=$;function X(z,q,K,U){let W=1,H=U,j=new RegExp(`@${q}(?:\\s*\\(|\\s|$)`,"g"),B=new RegExp(`@${K}(?![a-z])`,"g");while(H<z.length&&W>0){j.lastIndex=H,B.lastIndex=H;let V=j.exec(z),F=B.exec(z),O=V?V.index:1/0,_=F?F.index:1/0;if(O<_)W++,H=O+V[0].length;else if(_<1/0){if(W--,W===0)return _;H=_+F[0].length}else break}return-1}function Y(z,q,K){let U=0,W=new RegExp(`@${q}(?:\\s*\\(|\\s|$)`,"g"),H=new RegExp(`@${K}(?![a-z])`,"g"),j=/@else(?![a-z])/g,B=[],V;while((V=W.exec(z))!==null)B.push({pos:V.index,type:"open"});while((V=H.exec(z))!==null)B.push({pos:V.index,type:"close"});while((V=j.exec(z))!==null)B.push({pos:V.index,type:"else"});B.sort((F,O)=>F.pos-O.pos);for(let F of B)if(F.type==="open")U++;else if(F.type==="close")U--;else if(F.type==="else"&&U===0)return F.pos;return-1}{let z=!0;while(z){z=!1;let q=J.match(/@auth(?:\s*\(|\s|(?=\n))/);if(!q||q.index===void 0)break;let K=q.index,U,W,H=J.slice(K+5),j=N7(H);if(j)U=j.value,W=K+5+j.consumed;else W=K+5;let B=X(J,"auth","endauth",W);if(B===-1){console.warn(`[stx] @auth directive at position ${K} has no matching @endauth \u2014 the block was skipped.`);break}let V=J.slice(W,B),F=Y(V,"auth","endauth"),O;if(!Z.auth)O=!1;else O=U?K1(`auth?.check && auth?.user?.[${U}]`,Z):K1("auth?.check",Z);let _;if(F!==-1){let L=V.slice(0,F),w=V.slice(F+5);_=O?L:w}else _=O?V:"";J=J.substring(0,K)+_+J.substring(B+8),z=!0}}{let z=!0;while(z){z=!1;let q=J.match(/@guest(?:\s*\(|\s|(?=\n))/);if(!q||q.index===void 0)break;let K=q.index,U,W,H=J.slice(K+6),j=N7(H);if(j)U=j.value,W=K+6+j.consumed;else W=K+6;let B=X(J,"guest","endguest",W);if(B===-1){console.warn(`[stx] @guest directive at position ${K} has no matching @endguest \u2014 the block was skipped.`);break}let V=J.slice(W,B),F=Y(V,"guest","endguest"),O;if(!Z.auth)O=!0;else O=U?K1(`!auth?.check || !auth?.user?.[${U}]`,Z):K1("!auth?.check",Z);let _;if(F!==-1){let L=V.slice(0,F),w=V.slice(F+5);_=O?L:w}else _=O?V:"";J=J.substring(0,K)+_+J.substring(B+9),z=!0}}function Q(z,q,K){if(Z.userCan&&typeof Z.userCan[z]==="boolean")return Z.userCan[z];if(Z.permissions?.check&&typeof Z.permissions.check==="function")try{let U=[z];if(q)U.push(q);if(K){let W=K1(K,Z);U.push(W)}return Z.permissions.check(...U)}catch{return!1}return!1}function G(z){let q=z.match(/^\s*\(\s*'([^']*)'(?:,\s*'([^']*)')?(?:,\s*([^)]*))?\)/);if(!q)return null;return{ability:q[1],type:q[2],id:q[3]?.trim(),paramsEnd:q[0].length}}for(let z of["can","cannot"]){let q=`end${z}`,K=z==="can"?"elsecan":"elsecannot",U=!0;while(U){U=!1;let W=J.match(new RegExp(`@${z}\\s*\\(`));if(!W||W.index===void 0)break;let H=W.index,j=J.slice(H+`@${z}`.length),B=G(j);if(!B)break;let V=H+`@${z}`.length+B.paramsEnd,F=X(J,z,q,V);if(F===-1){console.warn(`[stx] @${z} directive at position ${H} has no matching @${q} \u2014 the block was skipped.`);break}let O=J.slice(V,F),_=[],L=0,w=new RegExp(`@${z}\\s*\\(`,"g"),R=new RegExp(`@${q}(?![a-z])`,"g"),D=new RegExp(`@${K}\\s*\\(`,"g"),M=/@else(?![a-z])/g,I=[],N;while((N=w.exec(O))!==null)I.push({pos:N.index,type:"open"});while((N=R.exec(O))!==null)I.push({pos:N.index,type:"close"});while((N=D.exec(O))!==null)I.push({pos:N.index,type:"elseDirective"});while((N=M.exec(O))!==null)I.push({pos:N.index,type:"else"});I.sort((b,C)=>b.pos-C.pos);for(let b of I){if(b.type==="open"){L++;continue}if(b.type==="close"){L--;continue}if(L===0)_.push(b)}let A=[],T=0;for(let b=0;b<_.length;b++){let C=_[b];if(A.push({content:O.slice(T,C.pos),ability:void 0}),C.type==="elseDirective"){let v=O.slice(C.pos+`@${K}`.length),P=G(v);if(P){A[A.length-1]={content:O.slice(T,C.pos)},T=C.pos+`@${K}`.length+P.paramsEnd,A.push({content:"",ability:P.ability,type:P.type,id:P.id}),A.pop();let g=_[b+1],x=g?g.pos:O.length;A.push({content:O.slice(T,x),ability:P.ability,type:P.type,id:P.id}),T=x}}else T=C.pos+5}if(T<O.length){let b=A[A.length-1];if(_.length>0&&_[_.length-1].type==="else")A.push({content:O.slice(T),isFinalElse:!0});else if(A.length===0)A.push({content:O.slice(T)})}let k=Q(B.ability,B.type,B.id),y=z==="can"?k:!k,E="";if(y)E=A[0]?.content||"";else{let b=!1;for(let C=1;C<A.length;C++){let v=A[C];if(v.isFinalElse){E=v.content,b=!0;break}if(v.ability){let P=Q(v.ability,v.type,v.id);if(z==="can"?P:!P){E=v.content,b=!0;break}}}if(!b&&A.length>0){let C=A[A.length-1];if(C.isFinalElse)E=C.content}}J=J.substring(0,H)+E+J.substring(F+`@${q}`.length),U=!0}}return J}function R5($,Z,J){let X=$;function Y(Q,G,z,q,K){let U=!0;while(U){U=!1;let W=new RegExp(`@${G}\\s*\\(`),H=Q.match(W);if(!H||H.index===void 0)break;let j=H.index,B=U1(Q,j+`@${G}`.length);if(!B)break;let V=B.endPos,F=F1(Q,G,z,V);if(F===-1){console.warn(`[stx] @${G} directive at position ${j} has no matching @${z} \u2014 the block was skipped.`);break}let O=Q.slice(V,F),_=B.expression,L=-1,w=0,R=0;while(R<O.length){let D=O.indexOf("@",R);if(D===-1)break;let M=O.substring(D);if(/^@(?:if|unless|isset|empty)\s*\(/.test(M)){w++,R=D+1;continue}if(/^@(?:endif|endunless|endisset|endempty)(?![a-z])/.test(M)){w--,R=D+1;continue}if(w===0&&/^@else(?![a-z])/.test(M)){L=D;break}R=D+1}try{let D=q(_.trim()),M;if(L!==-1){let I=O.slice(0,L),N=O.slice(L+5);M=D?I:N}else M=D?O:"";Q=Q.substring(0,j)+M+Q.substring(F+`@${z}`.length),U=!0}catch(D){let M=D instanceof Error?D.message:String(D),I=Q0(K,`Error processing @${G} directive: ${M}`,Y0.EVALUATION_ERROR);Q=Q.substring(0,j)+I+Q.substring(F+`@${z}`.length);break}}return Q}return X=Y(X,"isset","endisset",(Q)=>{let G=K1(Q,Z);return G!==void 0&&G!==null},"Isset"),X=Y(X,"empty","endempty",(Q)=>{let G=K1(Q,Z);return G===void 0||G===null||G===""||G===0||G===!1||Array.isArray(G)&&G.length===0||typeof G==="object"&&G!==null&&Object.keys(G).length===0},"Empty"),X}function D5($,Z,J){let X=$,Y="development";function Q(G,z,q,K){let U=new RegExp(`@${z}(?![a-z])`,"g"),W=new RegExp(`@${q}(?![a-z])`,"g"),H=new RegExp(`^@${z}(?![a-z])`),j=new RegExp(`^@${q}(?![a-z])`),B=G,V=!0;while(V){V=!1,U.lastIndex=0;let F=U.exec(B);if(!F)break;let O=F.index,_=O+F[0].length;if(z==="env"){let k=B.substring(_).match(/^\s*\(\s*(['"])([^'"]+)\1\s*\)/);if(!k)break;_+=k[0].length,K=Y===k[2]}let L=1,w=_,R=-1;while(L>0&&w<B.length){U.lastIndex=w,W.lastIndex=w;let k=U.exec(B),y=W.exec(B),E=k?k.index:1/0,b=y?y.index:1/0;if(E<b)L++,w=E+k[0].length;else if(b<1/0){if(L--,L===0){R=b;break}w=b+y[0].length}else break}if(R===-1){console.warn(`[stx] @${z} directive at position ${O} has no matching @${q} \u2014 the block was skipped.`);break}let D=B.substring(_,R),M=-1,I=0,N=0;while(N<D.length){let k=D.indexOf("@",N);if(k===-1)break;let y=D.substring(k);if(H.test(y)){I++,N=k+1;continue}if(j.test(y)){I--,N=k+1;continue}if(I===0&&/^@else(?![a-z])/.test(y)){M=k;break}N=k+1}let A;if(M!==-1){let k=D.slice(0,M),y=D.slice(M+5);A=K?k:y}else A=K?D:"";let T=`@${q}`.length;B=B.substring(0,O)+A+B.substring(R+T),V=!0}return B}return X=Q(X,"env","endenv",!1),X=Q(X,"production","endproduction",Y==="production"),X=Q(X,"development","enddevelopment",Y==="development"),X=Q(X,"staging","endstaging",Y==="staging"),X=Q(X,"testing","endtesting",Y==="testing"),X}var N5=new WeakMap;function M7($=16){let Z=new Uint8Array($);return crypto.getRandomValues(Z),btoa(String.fromCharCode(...Z))}function w1($,Z){if(!$)return Z?.nonceGenerator?.()??M7();let J=N5.get($);if(!J)J=Z?.nonceGenerator?.()??M7(),N5.set($,J);return J}function OU($){N5.delete($)}function A7($,Z){let J=[];for(let[X,Y]of Object.entries($)){if(Y===void 0||Y===null)continue;if(typeof Y==="boolean"){if(Y)J.push(X);continue}if(Array.isArray(Y)){let Q=[...Y];if(Z&&(X==="script-src"||X==="style-src"))Q=Q.filter((G)=>!G.startsWith("'nonce-")),Q.push(`'nonce-${Z}'`);if(Q.length>0)J.push(`${X} ${Q.join(" ")}`)}}return J.join("; ")}function A5($,Z){return`<meta http-equiv="Content-Security-Policy" content="${A7($,Z).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}">`}var QX={"default-src":["'self'"],"script-src":["'self'","'strict-dynamic'"],"style-src":["'self'"],"img-src":["'self'","data:","https:"],"font-src":["'self'","https:","data:"],"connect-src":["'self'"],"media-src":["'self'"],"object-src":["'none'"],"frame-src":["'none'"],"base-uri":["'self'"],"form-action":["'self'"],"frame-ancestors":["'self'"],"upgrade-insecure-requests":!0},M5={"default-src":["'self'"],"script-src":["'self'"],"style-src":["'self'","'unsafe-inline'"],"img-src":["'self'","data:","https:"],"font-src":["'self'","https:","data:"],"connect-src":["'self'","https:"],"media-src":["'self'"],"object-src":["'none'"],"frame-src":["'self'"],"base-uri":["'self'"],"form-action":["'self'"],"upgrade-insecure-requests":!0},GX={"default-src":["'self'"],"script-src":["'self'","'unsafe-inline'"],"style-src":["'self'","'unsafe-inline'"],"img-src":["'self'","data:","https:","http:"],"font-src":["'self'","https:","http:","data:"],"connect-src":["'self'","https:","http:","ws:","wss:"],"media-src":["'self'","https:","http:"],"object-src":["'none'"],"frame-src":["'self'","https:"],"base-uri":["'self'"]},zX={"default-src":["'none'"],"frame-ancestors":["'none'"]};function FU($){return{enabled:!0,directives:{strict:QX,moderate:M5,relaxed:GX,api:zX}[$]||M5,useNonce:$==="strict",addMetaTag:!0}}function wU($,Z){let J={...$};for(let[X,Y]of Object.entries(Z)){let Q=X,G=J[Q];if(Y===void 0||Y===null)continue;if(typeof Y==="boolean")J[Q]=G||Y;else if(Array.isArray(Y)){let z=Array.isArray(G)?G:[],q=[...new Set([...z,...Y])];J[Q]=q}}return J}function k7($,Z,J){if(!Z.enabled||!Z.addMetaTag)return $;if($.includes('http-equiv="Content-Security-Policy"'))return $;if(!$.includes("<head>")&&!$.includes("<head "))return $;let X=Z.useNonce?w1(J,Z):void 0,Y=A5(Z.directives,X);return $.replace(/<head([^>]*)>/,`<head$1>
3223
- ${Y}`)}function I7($,Z){let J=$;return J=J.replace(/<script(?![^>]*\ssrc=)([^>]*)>/gi,(X,Y)=>{if(Y.includes("nonce="))return X;return`<script nonce="${Z}"${Y}>`}),J=J.replace(/<style([^>]*)>/gi,(X,Y)=>{if(Y.includes("nonce="))return X;return`<style nonce="${Z}"${Y}>`}),J}function T7($,Z,J,X){let Y=$,Q=X.csp;if(Y=Y.replace(/@csp\b/g,()=>{if(!Q?.enabled||!Q.directives)return"<!-- CSP not configured -->";let G=Q.useNonce?w1(Z,Q):void 0;return A5(Q.directives,G)}),Y=Y.replace(/@cspNonce\b/g,()=>{if(!Q?.enabled||!Q.useNonce)return"";return w1(Z,Q)}),Q?.enabled&&Q.useNonce)Z.cspNonce=w1(Z,Q);return Y}var qX={name:"csp",handler:($,Z,J,X)=>{let Q=J.__stx_options?.csp;if(!Q?.enabled||!Q.directives)return"<!-- CSP not configured -->";let G=Q.useNonce?w1(J,Q):void 0;return A5(Q.directives,G)},hasEndTag:!1,description:"Insert Content-Security-Policy meta tag"},KX={name:"cspNonce",handler:($,Z,J,X)=>{let Q=J.__stx_options?.csp;if(!Q?.enabled||!Q.useNonce)return"";return w1(J,Q)},hasEndTag:!1,description:"Output the current CSP nonce value"};function RU(){return[qX,KX]}function DU($){let Z=[];if($["script-src"]?.includes("'unsafe-inline'"))Z.push("CSP: Using unsafe-inline in script-src significantly reduces XSS protection");if($["script-src"]?.includes("'unsafe-eval'"))Z.push("CSP: Using unsafe-eval in script-src allows eval() and related functions");if(!$["default-src"])Z.push("CSP: No default-src specified. Recommend adding default-src as a fallback");if($["default-src"]?.includes("*"))Z.push("CSP: Using * in default-src provides minimal protection");if(!$["object-src"]&&!$["default-src"]?.includes("'none'"))Z.push("CSP: Consider adding object-src: none to block plugins");if(!$["base-uri"])Z.push("CSP: Consider adding base-uri to prevent base tag injection attacks");for(let[J,X]of Object.entries($))if(Array.isArray(X)&&X.includes("http:"))Z.push(`CSP: Using http: in ${J} allows insecure resources`);return Z}function UX($=!1){return $?"Content-Security-Policy-Report-Only":"Content-Security-Policy"}function NU($,Z){if(!$.enabled)return{};let J=$.useNonce?w1(Z,$):void 0,X=A7($.directives,J);return{[UX($.reportOnly)]:X}}var MU={enabled:!1,reportOnly:!1,directives:M5,useNonce:!1,addMetaTag:!0};import WX from"crypto";var HX=40,E7="_token",k5=null;function jX($=HX){let Z=WX.randomBytes(Math.ceil($/2)).toString("hex").slice(0,$);return k5=Z,Z}function BX(){if(!k5)jX();return k5}function VX($=E7){let Z=BX();return`<input type="hidden" name="${$}" value="${Z}">`}function b7($){return $.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(Z,J,X)=>{return VX(X||E7)})}async function y7($,Z,J,X){if(!X.customDirectives||X.customDirectives.length===0)return $;let Y=$;for(let Q of X.customDirectives){if(!Q.name||typeof Q.handler!=="function"){if(X.debug)console.warn("Invalid custom directive:",Q);continue}if(Q.hasEndTag)Y=await LX(Y,Q,Z,J,X);else Y=await _X(Y,Q,Z,J,X)}return Y}async function LX($,Z,J,X,Y){let{name:Q,handler:G}=Z,z=`@${Q}`,q=`@end${Q}`,K=$,U=x1(`${z}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${q}`,"g"),W=[],H=U.exec(K);while(H!==null){let[j,B="",V=""]=H,F=H.index||0;try{let O=B?C7(B):[],_=V.trim(),L=await G(_,O,J,X);W.push({original:j,processed:L,startIndex:F})}catch(O){let _=O instanceof Error?O.message:String(O);if(Y.debug)console.error(`Error processing custom directive @${Q}:`,O);W.push({original:j,processed:Q0("CustomDirective",`Error in @${Q}${B?`(${B})`:""}: ${_}`,Y0.EVALUATION_ERROR),startIndex:F})}H=U.exec(K)}for(let j=W.length-1;j>=0;j--){let{original:B,processed:V}=W[j];K=K.replace(B,V)}return K}async function _X($,Z,J,X,Y){let{name:Q,handler:G}=Z,z=$,q=x1(`@${Q}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g"),K=[],U=q.exec(z);while(U!==null){let[j,B=""]=U,V=U.index||0;try{let F=C7(B),O=await G("",F,J,X);K.push({original:j,processed:O,startIndex:V})}catch(F){let O=F instanceof Error?F.message:String(F);if(Y.debug)console.error(`Error processing custom directive @${Q}:`,F);K.push({original:j,processed:Q0("CustomDirective",`Error in @${Q}(${B}): ${O}`,Y0.EVALUATION_ERROR),startIndex:V})}U=q.exec(z)}let W=x1(`@${Q}(?!\\w)(?!\\s*\\()`,"g"),H=W.exec(z);while(H!==null){let[j]=H,B=H.index||0;try{let V=await G("",[],J,X);K.push({original:j,processed:V,startIndex:B})}catch(V){let F=V instanceof Error?V.message:String(V);if(Y.debug)console.error(`Error processing custom directive @${Q}:`,V);K.push({original:j,processed:Q0("CustomDirective",`Error in @${Q}: ${F}`,Y0.EVALUATION_ERROR),startIndex:B})}H=W.exec(z)}for(let j=K.length-1;j>=0;j--){let{original:B,processed:V}=K[j];z=z.replace(B,V)}return z}function C7($){if(!$.trim())return[];let Z=[],J="",X=!1,Y="";for(let Q=0;Q<$.length;Q++){let G=$[Q];if((G==='"'||G==="'")&&(Q===0||$[Q-1]!=="\\"))if(!X)X=!0,Y=G;else if(G===Y)X=!1;else J+=G;else if(G===","&&!X)Z.push(J.trim()),J="";else J+=G}if(J.trim())Z.push(J.trim());return Z.map((Q)=>{let G=Q.trim();if(G.startsWith('"')&&G.endsWith('"')||G.startsWith("'")&&G.endsWith("'"))return G.substring(1,G.length-1);return G})}var S7=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,P7=/^[A-Za-z_$][\w$]*$/,OX=new Set(["light","dark","system"]);function R1($,Z){if(typeof $!=="string"||$.length===0)throw Error(`@appearanceBootstrap ${Z} must be a non-empty string`)}function FX($){if(!$||typeof $!=="object"||Array.isArray($))throw Error("@appearanceBootstrap expects an options object");let Z=$,J=Z.appearance,X=Z.colorMode;if(R1(Z.storageKey,"storageKey"),!J||typeof J!=="object"||Array.isArray(J))throw Error("@appearanceBootstrap appearance must be an object");if(!X||typeof X!=="object"||Array.isArray(X))throw Error("@appearanceBootstrap colorMode must be an object");if(R1(J.key,"appearance.key"),R1(J.attribute,"appearance.attribute"),R1(J.default,"appearance.default"),R1(X.key,"colorMode.key"),R1(X.attribute,"colorMode.attribute"),R1(X.default,"colorMode.default"),!P7.test(J.key)||!P7.test(X.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!S7.test(J.attribute)||!S7.test(X.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!Array.isArray(J.allowed)||J.allowed.length===0||J.allowed.some((Y)=>typeof Y!=="string"||Y.length===0))throw Error("@appearanceBootstrap appearance.allowed must contain one or more strings");if(!J.allowed.includes(J.default))throw Error("@appearanceBootstrap appearance.default must be in appearance.allowed");if(!OX.has(X.default))throw Error("@appearanceBootstrap colorMode.default must be light, dark, or system");return{storageKey:Z.storageKey,appearance:{key:J.key,attribute:J.attribute,allowed:[...new Set(J.allowed)],default:J.default},colorMode:{key:X.key,attribute:X.attribute,default:X.default}}}function wX($){return JSON.stringify($).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function RX($){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${wX($)};const root=document.documentElement;const MODES=["light","dark","system"];function read(){let stored={};try{const raw=localStorage.getItem(config.storageKey);const parsed=raw?JSON.parse(raw):{};if(parsed&&typeof parsed==="object"&&!Array.isArray(parsed))stored=parsed}catch{}return stored}function write(stored){try{localStorage.setItem(config.storageKey,JSON.stringify(stored))}catch{}}function resolve(){const stored=read();return{appearance:config.appearance.allowed.includes(stored[config.appearance.key])?stored[config.appearance.key]:config.appearance.default,colorMode:MODES.includes(stored[config.colorMode.key])?stored[config.colorMode.key]:config.colorMode.default}}function prefersDark(){try{return matchMedia("(prefers-color-scheme: dark)").matches}catch{return false}}function apply(){const state=resolve();const dark=state.colorMode==="dark"||(state.colorMode==="system"&&prefersDark());root.setAttribute("data-"+config.appearance.attribute,state.appearance);root.setAttribute("data-"+config.colorMode.attribute,state.colorMode);root.classList.toggle("dark",dark);root.dataset.theme=dark?"dark":"light";state.dark=dark;try{window.dispatchEvent(new CustomEvent("stx:appearance",{detail:state}))}catch{}return state}function store(key,allowed,value){if(allowed.includes(value)){const stored=read();stored[key]=value;write(stored)}return apply()}window.__stxAppearance={config:config,read:read,resolve:resolve,apply:apply,setColorMode:function(mode){return store(config.colorMode.key,MODES,mode)},setAppearance:function(name){return store(config.appearance.key,config.appearance.allowed,name)},watchSystem:function(){try{matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(){if(resolve().colorMode==="system")apply()})}catch{}}};apply()}());</script>`}function DX($,Z){let J=1,X=null,Y=!1;for(let Q=Z+1;Q<$.length;Q++){let G=$[Q];if(Y){Y=!1;continue}if(X){if(G==="\\")Y=!0;else if(G===X)X=null;continue}if(G==='"'||G==="'"||G==="`"){X=G;continue}if(G==="(")J++;else if(G===")"&&--J===0)return Q}return-1}function v7($,Z){let J=$,X=/@appearanceBootstrap\s*\(/g,Y;while((Y=X.exec(J))!==null){let Q=Y.index+Y[0].length-1,G=DX(J,Q);if(G===-1)throw Error("@appearanceBootstrap has an unclosed options object");let z=J.slice(Q+1,G).trim(),q=e(`(${z})`,Z),K=RX(FX(q));J=J.slice(0,Y.index)+K+J.slice(G+1),X.lastIndex=Y.index+K.length}return J}import NX from"crypto";function O0($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var T5={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function MX($){return{...T5,...$.forms?.classes}}function J9($,Z,J,X){let Y=$||Z;return J?`${Y} ${X}`:Y}function h0($){return String($).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function g1($,Z){if(/\bid\s*=/i.test($))return"";return` id="${O0(Z)}"`}function I5($,Z,J){if(!Z)return"";let X="";if(!/\baria-invalid\s*=/i.test(J))X+=' aria-invalid="true"';if(!/\baria-describedby\s*=/i.test(J))X+=` aria-describedby="${O0(`${h0($)}-error`)}"`;return X}function AX(){return NX.randomUUID()}function vU($,Z,J,X){let Y=MX(X),Q=$;return Q=IX(Q,Z),Q=V2(Q,Z),Q=E5(Q,Z,Y),Q=b5(Q,Z,Y),Q}function V2($,Z){let J=$;return J=J.replace(/@csrf/g,()=>{if(!Z.csrf||typeof Z.csrf!=="object"){let X=AX();Z.csrf={token:X}}if(Z.csrf.field)return Z.csrf.field;if(Z.csrf.token)return`<input type="hidden" name="_token" value="${O0(Z.csrf.token)}">`;return'<input type="hidden" name="_token" value="">'}),J=J.replace(/@method\(['"]([^'"]+)['"]\)/g,(X,Y)=>{let Q=Y.toUpperCase();if(Y&&!["GET","POST"].includes(Q))return`<input type="hidden" name="_method" value="${O0(Q)}">`;return X}),J}function E5($,Z,J=T5){let X=$;return X=X.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(Y,Q,G,z,q,K="")=>{let U=Q||G||"POST",W=z||q||"",H=W1(K),j=U.toUpperCase(),B=["GET","POST"].includes(j)?j:"POST",V=`<form method="${O0(B)}" action="${O0(W)}"${H?` ${H}`:""}>`;if(V+=`
3220
+ `)this.line++,this.column=0;else this.column++;this.pos++}}peek($){return this.source[this.pos+$]}saveState(){return{pos:this.pos,line:this.line,column:this.column}}restoreState($){this.pos=$.pos,this.line=$.line,this.column=$.column}}function _0($,Z,J,X=0){let Y=0,Q=X,G=null,z=0,q=!1;while(Q<$.length){let K=$[Q];if(G&&q){q=!1,Q++;continue}if(G&&K==="\\"){q=!0,Q++;continue}if(q=!1,(K==='"'||K==="'"||K==="`")&&!G){G=K,Q++;continue}if(K===G&&G!=="`"){G=null,Q++;continue}if(G==="`"&&K==="$"&&$[Q+1]==="{"){z++,Q+=2;continue}if(z>0&&K==="}"){z--,Q++;continue}if(K==="`"&&G==="`"&&z===0){G=null,Q++;continue}if(G){Q++;continue}if(K===Z)Y++;else if(K===J){if(Y--,Y===0)return Q}Q++}return-1}function O7($,Z){let J=Z,X={paren:0,bracket:0,brace:0},Y=null,Q=0;while(J<$.length){let G=$[J];if((J>0?$[J-1]:"")==="\\"&&Y){J++;continue}if((G==='"'||G==="'")&&!Y){Y=G,J++;continue}if(G===Y&&Y!=="`"){Y=null,J++;continue}if(G==="`"&&!Y){Y="`",J++;continue}if(G==="`"&&Y==="`"&&Q===0){Y=null,J++;continue}if(Y==="`"&&G==="$"&&$[J+1]==="{"){Q++,J+=2;continue}if(Q>0){if(G==="{")Q++;else if(G==="}")Q--;J++;continue}if(Y){J++;continue}if(X.paren===0&&X.bracket===0&&X.brace===0){if($.slice(J,J+2)==="}}"||$.slice(J,J+3)==="!!}")break;if(G===","||G===";")break}if(G==="(")X.paren++;else if(G===")"){if(X.paren--,X.paren<0)break}else if(G==="[")X.bracket++;else if(G==="]"){if(X.bracket--,X.bracket<0)break}else if(G==="{")X.brace++;else if(G==="}"){if(X.brace--,X.brace<0)break}J++}return{expression:$.slice(Z,J),endPos:J}}function O5($){let Z=[],J="",X={paren:0,bracket:0,brace:0},Y=null,Q=0;for(let G=0;G<$.length;G++){let z=$[G];if((G>0?$[G-1]:"")==="\\"&&Y){J+=z;continue}if((z==='"'||z==="'")&&!Y){Y=z,J+=z;continue}if(z===Y&&Y!=="`"){Y=null,J+=z;continue}if(z==="`"&&!Y){Y="`",J+=z;continue}if(z==="`"&&Y==="`"&&Q===0){Y=null,J+=z;continue}if(Y==="`"&&z==="$"&&$[G+1]==="{"){Q++,J+=z+$[G+1],G++;continue}if(Q>0&&z==="{"){Q++,J+=z;continue}if(Q>0&&z==="}"){Q--,J+=z;continue}if(Y){J+=z;continue}if(z==="(")X.paren++;else if(z===")")X.paren--;else if(z==="[")X.bracket++;else if(z==="]")X.bracket--;else if(z==="{")X.brace++;else if(z==="}")X.brace--;if(z==="|"&&$[G+1]!=="|"&&(G===0||$[G-1]!=="|")&&$[G-1]!=="\\"&&X.paren===0&&X.bracket===0&&X.brace===0){Z.push(J.trim()),J="";continue}if(z==="|"&&$[G-1]==="\\"&&!Y){J=J.slice(0,-1)+z;continue}J+=z}if(J.trim())Z.push(J.trim());return Z}function U1($,Z){let J=sJ($,Z);return J.ok?{expression:J.expression,endPos:J.endPos}:null}function sJ($,Z){let J=Z;while(J<$.length&&/\s/.test($[J]))J++;if($[J]!=="(")return{ok:!1,reason:"missing-open-paren",pos:J};let X=_0($,"(",")",J);if(X===-1)return{ok:!1,reason:"unclosed-paren",pos:J};return{ok:!0,expression:$.slice(J+1,X),endPos:X+1}}function rJ($,Z){let J=$.lastIndexOf("<",Z);if(J===-1)return!1;return J>$.lastIndexOf(">",Z)}function F1($,Z,J,X){let Y=1,Q=X,G=new RegExp(`@${Z}\\s*\\(`,"g"),z=new RegExp(`@${J}(?![a-z])`,"g");while(Q<$.length&&Y>0){G.lastIndex=Q,z.lastIndex=Q;let q=G.exec($),K=z.exec($),U=q?q.index:1/0,W=K?K.index:1/0;if(U<W)Y++,Q=U+q[0].length;else if(W<1/0){if(Y--,Y===0)return W;Q=W+K[0].length}else break}return-1}function F7($,Z){let J=$.slice(Z).match(/^@if\s*/);if(!J)return null;let X=Z+J[0].length,Y=U1($,X);if(!Y)return null;let Q=Y.endPos,G=F1($,"if","endif",Q);if(G===-1)return null;let z=$.slice(Q,G),q=[],K=0,U="if",W=Y.expression,H=0,j=0;while(K<z.length){let B=z.indexOf("@",K);if(B===-1)break;K=B;let V=z.substring(B);if(rJ(z,B)){K++;continue}if(/^@if\s*\(/.test(V)){j++,K++;continue}if(/^@endif(?![a-z])/.test(V)){j--,K+=6;continue}if(j===0){let F=V.match(/^@elseif\s*/);if(F){q.push({type:U,condition:W,content:z.substring(H,K),start:Q+H,end:Q+K});let O=K+F[0].length,_=U1(z,O);if(!_){K++;continue}U="elseif",W=_.expression,K=_.endPos,H=K;continue}else if(/^@else(?![a-z])/.test(V)){q.push({type:U,condition:W,content:z.substring(H,K),start:Q+H,end:Q+K}),U="else",W=void 0,K+=5,H=K;continue}}K++}return q.push({type:U,condition:W,content:z.slice(H),start:Q+H,end:Q+z.length}),{fullMatch:$.slice(Z,G+6),branches:q,start:Z,end:G+6}}function H2($){let Z=[],J=/@if\s*\(/g,X=J.exec($);while(X!==null){if(Z.some((G)=>X.index>G.start&&X.index<G.end)){X=J.exec($);continue}let Q=F7($,X.index);if(Q)Z.push(Q),J.lastIndex=Q.end;X=J.exec($)}return Z}function Z9($,Z,J){let X=[],Y=new RegExp(`@${Z}\\s*\\(`,"g"),Q=Y.exec($);while(Q!==null){if(X.some((V)=>Q.index>V.start&&Q.index<V.end)){Q=Y.exec($);continue}let z=Q.index,q=z+Q[0].length-1,K=_0($,"(",")",q);if(K===-1){Q=Y.exec($);continue}let U=$.slice(q+1,K),W=K+1,H=F1($,Z,J,W);if(H===-1){Q=Y.exec($);continue}let j=$.slice(W,H),B=H+`@${J}`.length;X.push({fullMatch:$.slice(z,B),name:Z,params:U,content:j,start:z,end:B}),Y.lastIndex=B,Q=Y.exec($)}return X}function F5($,Z){let J=$.slice(Z).match(/^@switch\s*/);if(!J)return null;let X=Z+J[0].length,Y=U1($,X);if(!Y)return null;let Q=Y.endPos,G=F1($,"switch","endswitch",Q);if(G===-1)return null;let z=$.slice(Q,G),q=[],K=0,U=null,W=0;while(K<z.length){let H=z.slice(K),j=H.match(/^@switch\s*\(/),B=H.match(/^@endswitch(?![a-z])/);if(j){if(W++,U)U.content+=j[0];K+=j[0].length;continue}if(B){if(W--,U)U.content+=B[0];K+=B[0].length;continue}if(W>0){if(U)U.content+=z[K];K++;continue}let V=H.match(/^@case\s*/),F=H.match(/^@default(?![a-z])/),O=H.match(/^@break(?![a-z])/);if(V&&H.startsWith("@case")){if(U)q.push(U);let _=K+V[0].length,L=U1(z,_);if(!L){K++;continue}U={type:"case",value:L.expression,content:""},K=L.endPos}else if(F&&H.startsWith("@default")){if(U)q.push(U);U={type:"default",content:""},K+=F[0].length}else if(O&&H.startsWith("@break"))K+=O[0].length;else{if(U)U.content+=z[K];K++}}if(U)q.push(U);return{fullMatch:$.slice(Z,G+10),expression:Y.expression,cases:q,start:Z,end:G+10}}function aJ($){let Z=[],J=0;while(J<$.length){let X=$.indexOf("{{",J),Y=$.indexOf("{!!",J),Q=!1,G;if(X===-1&&Y===-1)break;else if(X===-1)G=Y,Q=!0;else if(Y===-1)G=X,Q=!1;else if(Y<X)G=Y,Q=!0;else G=X,Q=!1;if(!Q&&$.slice(G,G+3)==="{{{")Q=!0;let z=Q?$.slice(G,G+3)==="{{{"?"{{{":"{!!":"{{",q=Q?z==="{{{"?"}}}":"!!}":"}}",K=G+z.length,U=tJ($,K,q);if(U===-1){J=G+1;continue}let W=$.slice(K,U).trim(),H=U+q.length;Z.push({fullMatch:$.slice(G,H),expression:W,start:G,end:H,isRaw:Q}),J=H}return Z}function tJ($,Z,J){let X=Z,Y=null,Q={paren:0,bracket:0,brace:0},G=0;while(X<$.length){let z=$[X];if((X>0?$[X-1]:"")==="\\"&&Y){X++;continue}if((z==='"'||z==="'")&&!Y){Y=z,X++;continue}if(z===Y&&Y!=="`"){Y=null,X++;continue}if(z==="`"&&!Y){Y="`",X++;continue}if(z==="`"&&Y==="`"&&G===0){Y=null,X++;continue}if(Y==="`"&&z==="$"&&$[X+1]==="{"){G++,X+=2;continue}if(G>0){if(z==="{")G++;else if(z==="}")G--;X++;continue}if(Y){X++;continue}if(z==="(")Q.paren++;else if(z===")")Q.paren--;else if(z==="[")Q.bracket++;else if(z==="]")Q.bracket--;else if(z==="{")Q.brace++;else if(z==="}")Q.brace--;if(Q.paren===0&&Q.bracket===0&&Q.brace<=0){if($.slice(X,X+J.length)===J)return X}X++}return-1}function eJ($){let Z=O5($);if(Z.length===0)return{baseExpression:"",filters:[]};let J=Z[0],X=[];for(let Y=1;Y<Z.length;Y++){let Q=$X(Z[Y]);if(Q)X.push(Q)}return{baseExpression:J,filters:X}}function $X($){let Z=$.trim();if(!Z)return null;let J=Z.indexOf("(");if(J===-1)return{name:Z,args:[]};let X=Z.slice(0,J).trim(),Y=J+1,Q=_0(Z,"(",")",J);if(Q===-1)return{name:X,args:[]};let G=Z.slice(Y,Q),z=D7(G);return{name:X,args:z}}function D7($){let Z=[],J="",X={paren:0,bracket:0,brace:0},Y=null,Q=0;for(let G=0;G<$.length;G++){let z=$[G];if((G>0?$[G-1]:"")==="\\"&&Y){J+=z;continue}if((z==='"'||z==="'")&&!Y){Y=z,J+=z;continue}if(z===Y&&Y!=="`"){Y=null,J+=z;continue}if(z==="`"&&!Y){Y="`",J+=z;continue}if(z==="`"&&Y==="`"&&Q===0){Y=null,J+=z;continue}if(Y==="`"&&z==="$"&&$[G+1]==="{"){Q++,J+="${",G++;continue}if(Q>0&&z==="{"){Q++,J+=z;continue}if(Q>0&&z==="}"){Q--,J+=z;continue}if(Y){J+=z;continue}if(z==="(")X.paren++;else if(z===")")X.paren--;else if(z==="[")X.bracket++;else if(z==="]")X.bracket--;else if(z==="{")X.brace++;else if(z==="}")X.brace--;if(z===","&&X.paren===0&&X.bracket===0&&X.brace===0){Z.push(J.trim()),J="";continue}J+=z}if(J.trim())Z.push(J.trim());return Z}function ZX($,Z){let J=Z;while(J<$.length&&/\s/.test($[J]))J++;if($[J]!=="(")return null;let X=_0($,"(",")",J);if(X===-1)return null;return{params:$.slice(J+1,X),endPos:X+1}}function JX($){let Z=[],X=new $9($).tokenize().filter((Q)=>Q.type!=="WHITESPACE"&&Q.type!=="COMMENT"),Y=0;while(Y<X.length){let Q=X[Y],G=!1;if(Q.type==="IDENTIFIER"&&Q.value==="export"){if(G=!0,Y++,Y>=X.length)break}let z=X[Y];if(z.type==="IDENTIFIER"&&(z.value==="const"||z.value==="let"||z.value==="var")){let q=z.value;if(Y++,Y>=X.length)break;let K=X[Y];if(K.type==="IDENTIFIER"){let U=K.value;if(Y++,Y<X.length&&X[Y].type==="OPERATOR"&&X[Y].value==="="){Y++;let W=Y<X.length?X[Y].start:$.length,H=w7(X,Y,$);Y=H.nextIndex,Z.push({type:"variable",name:U,value:$.slice(W,H.endPos),exported:G,start:z.start,end:H.endPos})}}else if(K.type==="PUNCTUATION"&&(K.value==="{"||K.value==="[")){let U=K.start,W=K.value==="{"?"}":"]",H=_0($,K.value,W,U);if(H!==-1){let j=$.slice(U,H+1);if(Y=R7(X,H+1),Y<X.length&&X[Y].type==="OPERATOR"&&X[Y].value==="="){Y++;let B=Y<X.length?X[Y].start:$.length,V=w7(X,Y,$);Y=V.nextIndex;let F=`__stx_destructured_${Z.length}`;Z.push({type:"variable",name:F,value:`${$.slice(B,V.endPos)}; ${q} ${j} = ${F}`,exported:G,start:z.start,end:V.endPos})}}}}else if(z.type==="IDENTIFIER"&&z.value==="function"){let q=G?X[Y-1].start:z.start;if(Y++,Y>=X.length)break;let K=X[Y];if(K.type==="IDENTIFIER"){let U=K.value;Y++;let W=-1;while(Y<X.length){if(X[Y].type==="PUNCTUATION"&&X[Y].value==="{"){W=X[Y].start;break}Y++}if(W!==-1){let H=_0($,"{","}",W);if(H!==-1)Z.push({type:"function",name:U,value:$.slice(q,H+1).replace(/^export\s+/,""),exported:G,start:q,end:H+1}),Y=R7(X,H+1)}}}else Y++}return Z}function w7($,Z,J){let X=Z,Y={paren:0,bracket:0,brace:0},Q=Z<$.length?$[Z].start:J.length;while(X<$.length){let G=$[X];if(G.type==="PUNCTUATION"){if(G.value==="(")Y.paren++;else if(G.value===")")Y.paren--;else if(G.value==="[")Y.bracket++;else if(G.value==="]")Y.bracket--;else if(G.value==="{")Y.brace++;else if(G.value==="}")Y.brace--;if(G.value===";"&&Y.paren===0&&Y.bracket===0&&Y.brace===0){Q=G.start,X++;break}}if(G.type==="IDENTIFIER"&&(G.value==="const"||G.value==="let"||G.value==="var"||G.value==="function"||G.value==="export")){if(Y.paren===0&&Y.bracket===0&&Y.brace===0){Q=$[X-1]?.end??G.start;break}}Q=G.end,X++}return{nextIndex:X,endPos:Q}}function R7($,Z){for(let J=0;J<$.length;J++)if($[J].start>=Z)return J;return $.length}function XX($,Z,J){let X=$,Y=!0;while(Y){Y=!1;let Q=X.match(/@switch\s*\(/);if(!Q||Q.index===void 0)break;let G=Q.index,z=F5(X,G);if(!z)break;try{let q;if(q0(z.expression))q=U0(z.expression,Object.keys(Z))(...Object.values(Z));else q=e(z.expression,Z);let K="",U=!1;for(let W of z.cases)if(W.type==="default"){if(!U)K=W.content.trim()}else try{let H;if(W.value&&q0(W.value))H=U0(W.value,Object.keys(Z))(...Object.values(Z));else if(W.value)H=e(W.value,Z);if(q===H){K=W.content.trim(),U=!0;break}}catch{continue}X=X.substring(0,G)+K+X.substring(z.end),Y=!0}catch(q){let K=q instanceof Error?q.message:String(q),U=Q0("Switch",`Error evaluating @switch expression: ${K}`,Y0.EVALUATION_ERROR);X=X.substring(0,G)+U+X.substring(z.end);break}}return X}function YX($){let Z=[];return{masked:$.replace(/<script\b[\s\S]*?<\/script\s*>/gi,(X)=>{return Z.push(X),`\x00stx-script-${Z.length-1}\x00`}),scripts:Z}}function QX($,Z){if(Z.length===0)return $;return $.replace(/\u0000stx-script-(\d+)\u0000/g,(J,X)=>Z[Number(X)]??J)}function $1($,Z,J){let{masked:X,scripts:Y}=YX($);return QX(GX(X,Z,J),Y)}function GX($,Z,J){let X=$;X=XX(X,Z,J);{let Q=!0;while(Q){Q=!1;let G=X.match(/@unless\s*\(/);if(!G||G.index===void 0)break;let z=G.index,q=U1(X,z+7);if(!q)break;let K=q.endPos,U=F1(X,"unless","endunless",K);if(U===-1){console.warn(`[stx] @unless directive at position ${z} has no matching @endunless \u2014 the block was skipped. Check for typos or missing closers.`);break}let W=X.slice(K,U),H=q.expression,j=-1;{let V=0,F=/@(?:if|unless)\s*\(/g,O=/@(?:endif|endunless)(?![a-z])/g,_=/@else(?![a-z])/g,L=[],w;while((w=F.exec(W))!==null)L.push({pos:w.index,type:"open"});while((w=O.exec(W))!==null)L.push({pos:w.index,type:"close"});while((w=_.exec(W))!==null)L.push({pos:w.index,type:"else"});L.sort((R,D)=>R.pos-D.pos);for(let R of L)if(R.type==="open")V++;else if(R.type==="close")V--;else if(R.type==="else"&&V===0){j=R.pos;break}}let B;if(j!==-1){let V=W.slice(0,j),F=W.slice(j+5);B=`@if (${H})${F}@else ${V}@endif`}else B=`@if (!(${H}))${W}@endif`;X=X.substring(0,z)+B+X.substring(U+10),Q=!0}}X=R5(X,Z,J),X=D5(X,Z,J),X=w5(X,Z);let Y=()=>{let Q=H2(X);if(Q.length===0)return!1;let G=Array(Q.length);for(let K=Q.length-1;K>=0;K--){let U=Q[K];try{let W="",H=!1;for(let j of U.branches){if(H)break;if(j.type==="else")W=j.content,H=!0;else try{let B;if(j.condition&&q0(j.condition))B=U0(j.condition,Object.keys(Z))(...Object.values(Z));else if(j.condition)B=e(j.condition,Z);if(B)W=j.content,H=!0}catch(B){W=Q0(j.type==="if"?"If":"Elseif",`Error in @${j.type}(${j.condition}): ${B instanceof Error?B.message:String(B)}`,Y0.EVALUATION_ERROR),H=!0}}G[K]=W}catch(W){let H=W instanceof Error?W.message:String(W);G[K]=Q0("If",`Error processing @if block: ${H}`,Y0.EVALUATION_ERROR)}}let z=Array(Q.length*2+1),q=0;for(let K=0;K<Q.length;K++){let U=Q[K];z[K*2]=X.slice(q,U.start),z[K*2+1]=G[K],q=U.end}return z[Q.length*2]=X.slice(q),X=z.join(""),!0};while(!0){let Q=X;if(!Y())break;if(X===Q)break}return X}function N7($){let Z=0;while(Z<$.length&&/\s/.test($[Z]))Z++;if($[Z]!=="(")return null;Z++;while(Z<$.length&&/\s/.test($[Z]))Z++;let J=$[Z];if(J!=="'"&&J!=='"')return null;Z++;let X=[];while(Z<$.length){let Y=$[Z];if(Y==="\\"&&Z+1<$.length){X.push($[Z+1]),Z+=2;continue}if(Y===J){Z++;break}X.push(Y),Z++}while(Z<$.length&&/\s/.test($[Z]))Z++;if($[Z]!==")")return null;return Z++,{value:X.join(""),consumed:Z}}function w5($,Z){let J=$;function X(z,q,K,U){let W=1,H=U,j=new RegExp(`@${q}(?:\\s*\\(|\\s|$)`,"g"),B=new RegExp(`@${K}(?![a-z])`,"g");while(H<z.length&&W>0){j.lastIndex=H,B.lastIndex=H;let V=j.exec(z),F=B.exec(z),O=V?V.index:1/0,_=F?F.index:1/0;if(O<_)W++,H=O+V[0].length;else if(_<1/0){if(W--,W===0)return _;H=_+F[0].length}else break}return-1}function Y(z,q,K){let U=0,W=new RegExp(`@${q}(?:\\s*\\(|\\s|$)`,"g"),H=new RegExp(`@${K}(?![a-z])`,"g"),j=/@else(?![a-z])/g,B=[],V;while((V=W.exec(z))!==null)B.push({pos:V.index,type:"open"});while((V=H.exec(z))!==null)B.push({pos:V.index,type:"close"});while((V=j.exec(z))!==null)B.push({pos:V.index,type:"else"});B.sort((F,O)=>F.pos-O.pos);for(let F of B)if(F.type==="open")U++;else if(F.type==="close")U--;else if(F.type==="else"&&U===0)return F.pos;return-1}{let z=!0;while(z){z=!1;let q=J.match(/@auth(?:\s*\(|\s|(?=\n))/);if(!q||q.index===void 0)break;let K=q.index,U,W,H=J.slice(K+5),j=N7(H);if(j)U=j.value,W=K+5+j.consumed;else W=K+5;let B=X(J,"auth","endauth",W);if(B===-1){console.warn(`[stx] @auth directive at position ${K} has no matching @endauth \u2014 the block was skipped.`);break}let V=J.slice(W,B),F=Y(V,"auth","endauth"),O;if(!Z.auth)O=!1;else O=U?K1(`auth?.check && auth?.user?.[${U}]`,Z):K1("auth?.check",Z);let _;if(F!==-1){let L=V.slice(0,F),w=V.slice(F+5);_=O?L:w}else _=O?V:"";J=J.substring(0,K)+_+J.substring(B+8),z=!0}}{let z=!0;while(z){z=!1;let q=J.match(/@guest(?:\s*\(|\s|(?=\n))/);if(!q||q.index===void 0)break;let K=q.index,U,W,H=J.slice(K+6),j=N7(H);if(j)U=j.value,W=K+6+j.consumed;else W=K+6;let B=X(J,"guest","endguest",W);if(B===-1){console.warn(`[stx] @guest directive at position ${K} has no matching @endguest \u2014 the block was skipped.`);break}let V=J.slice(W,B),F=Y(V,"guest","endguest"),O;if(!Z.auth)O=!0;else O=U?K1(`!auth?.check || !auth?.user?.[${U}]`,Z):K1("!auth?.check",Z);let _;if(F!==-1){let L=V.slice(0,F),w=V.slice(F+5);_=O?L:w}else _=O?V:"";J=J.substring(0,K)+_+J.substring(B+9),z=!0}}function Q(z,q,K){if(Z.userCan&&typeof Z.userCan[z]==="boolean")return Z.userCan[z];if(Z.permissions?.check&&typeof Z.permissions.check==="function")try{let U=[z];if(q)U.push(q);if(K){let W=K1(K,Z);U.push(W)}return Z.permissions.check(...U)}catch{return!1}return!1}function G(z){let q=z.match(/^\s*\(\s*'([^']*)'(?:,\s*'([^']*)')?(?:,\s*([^)]*))?\)/);if(!q)return null;return{ability:q[1],type:q[2],id:q[3]?.trim(),paramsEnd:q[0].length}}for(let z of["can","cannot"]){let q=`end${z}`,K=z==="can"?"elsecan":"elsecannot",U=!0;while(U){U=!1;let W=J.match(new RegExp(`@${z}\\s*\\(`));if(!W||W.index===void 0)break;let H=W.index,j=J.slice(H+`@${z}`.length),B=G(j);if(!B)break;let V=H+`@${z}`.length+B.paramsEnd,F=X(J,z,q,V);if(F===-1){console.warn(`[stx] @${z} directive at position ${H} has no matching @${q} \u2014 the block was skipped.`);break}let O=J.slice(V,F),_=[],L=0,w=new RegExp(`@${z}\\s*\\(`,"g"),R=new RegExp(`@${q}(?![a-z])`,"g"),D=new RegExp(`@${K}\\s*\\(`,"g"),M=/@else(?![a-z])/g,I=[],N;while((N=w.exec(O))!==null)I.push({pos:N.index,type:"open"});while((N=R.exec(O))!==null)I.push({pos:N.index,type:"close"});while((N=D.exec(O))!==null)I.push({pos:N.index,type:"elseDirective"});while((N=M.exec(O))!==null)I.push({pos:N.index,type:"else"});I.sort((b,C)=>b.pos-C.pos);for(let b of I){if(b.type==="open"){L++;continue}if(b.type==="close"){L--;continue}if(L===0)_.push(b)}let A=[],T=0;for(let b=0;b<_.length;b++){let C=_[b];if(A.push({content:O.slice(T,C.pos),ability:void 0}),C.type==="elseDirective"){let v=O.slice(C.pos+`@${K}`.length),P=G(v);if(P){A[A.length-1]={content:O.slice(T,C.pos)},T=C.pos+`@${K}`.length+P.paramsEnd,A.push({content:"",ability:P.ability,type:P.type,id:P.id}),A.pop();let g=_[b+1],x=g?g.pos:O.length;A.push({content:O.slice(T,x),ability:P.ability,type:P.type,id:P.id}),T=x}}else T=C.pos+5}if(T<O.length){let b=A[A.length-1];if(_.length>0&&_[_.length-1].type==="else")A.push({content:O.slice(T),isFinalElse:!0});else if(A.length===0)A.push({content:O.slice(T)})}let k=Q(B.ability,B.type,B.id),y=z==="can"?k:!k,E="";if(y)E=A[0]?.content||"";else{let b=!1;for(let C=1;C<A.length;C++){let v=A[C];if(v.isFinalElse){E=v.content,b=!0;break}if(v.ability){let P=Q(v.ability,v.type,v.id);if(z==="can"?P:!P){E=v.content,b=!0;break}}}if(!b&&A.length>0){let C=A[A.length-1];if(C.isFinalElse)E=C.content}}J=J.substring(0,H)+E+J.substring(F+`@${q}`.length),U=!0}}return J}function R5($,Z,J){let X=$;function Y(Q,G,z,q,K){let U=!0;while(U){U=!1;let W=new RegExp(`@${G}\\s*\\(`),H=Q.match(W);if(!H||H.index===void 0)break;let j=H.index,B=U1(Q,j+`@${G}`.length);if(!B)break;let V=B.endPos,F=F1(Q,G,z,V);if(F===-1){console.warn(`[stx] @${G} directive at position ${j} has no matching @${z} \u2014 the block was skipped.`);break}let O=Q.slice(V,F),_=B.expression,L=-1,w=0,R=0;while(R<O.length){let D=O.indexOf("@",R);if(D===-1)break;let M=O.substring(D);if(/^@(?:if|unless|isset|empty)\s*\(/.test(M)){w++,R=D+1;continue}if(/^@(?:endif|endunless|endisset|endempty)(?![a-z])/.test(M)){w--,R=D+1;continue}if(w===0&&/^@else(?![a-z])/.test(M)){L=D;break}R=D+1}try{let D=q(_.trim()),M;if(L!==-1){let I=O.slice(0,L),N=O.slice(L+5);M=D?I:N}else M=D?O:"";Q=Q.substring(0,j)+M+Q.substring(F+`@${z}`.length),U=!0}catch(D){let M=D instanceof Error?D.message:String(D),I=Q0(K,`Error processing @${G} directive: ${M}`,Y0.EVALUATION_ERROR);Q=Q.substring(0,j)+I+Q.substring(F+`@${z}`.length);break}}return Q}return X=Y(X,"isset","endisset",(Q)=>{let G=K1(Q,Z);return G!==void 0&&G!==null},"Isset"),X=Y(X,"empty","endempty",(Q)=>{let G=K1(Q,Z);return G===void 0||G===null||G===""||G===0||G===!1||Array.isArray(G)&&G.length===0||typeof G==="object"&&G!==null&&Object.keys(G).length===0},"Empty"),X}function D5($,Z,J){let X=$,Y="development";function Q(G,z,q,K){let U=new RegExp(`@${z}(?![a-z])`,"g"),W=new RegExp(`@${q}(?![a-z])`,"g"),H=new RegExp(`^@${z}(?![a-z])`),j=new RegExp(`^@${q}(?![a-z])`),B=G,V=!0;while(V){V=!1,U.lastIndex=0;let F=U.exec(B);if(!F)break;let O=F.index,_=O+F[0].length;if(z==="env"){let k=B.substring(_).match(/^\s*\(\s*(['"])([^'"]+)\1\s*\)/);if(!k)break;_+=k[0].length,K=Y===k[2]}let L=1,w=_,R=-1;while(L>0&&w<B.length){U.lastIndex=w,W.lastIndex=w;let k=U.exec(B),y=W.exec(B),E=k?k.index:1/0,b=y?y.index:1/0;if(E<b)L++,w=E+k[0].length;else if(b<1/0){if(L--,L===0){R=b;break}w=b+y[0].length}else break}if(R===-1){console.warn(`[stx] @${z} directive at position ${O} has no matching @${q} \u2014 the block was skipped.`);break}let D=B.substring(_,R),M=-1,I=0,N=0;while(N<D.length){let k=D.indexOf("@",N);if(k===-1)break;let y=D.substring(k);if(H.test(y)){I++,N=k+1;continue}if(j.test(y)){I--,N=k+1;continue}if(I===0&&/^@else(?![a-z])/.test(y)){M=k;break}N=k+1}let A;if(M!==-1){let k=D.slice(0,M),y=D.slice(M+5);A=K?k:y}else A=K?D:"";let T=`@${q}`.length;B=B.substring(0,O)+A+B.substring(R+T),V=!0}return B}return X=Q(X,"env","endenv",!1),X=Q(X,"production","endproduction",Y==="production"),X=Q(X,"development","enddevelopment",Y==="development"),X=Q(X,"staging","endstaging",Y==="staging"),X=Q(X,"testing","endtesting",Y==="testing"),X}var N5=new WeakMap;function M7($=16){let Z=new Uint8Array($);return crypto.getRandomValues(Z),btoa(String.fromCharCode(...Z))}function w1($,Z){if(!$)return Z?.nonceGenerator?.()??M7();let J=N5.get($);if(!J)J=Z?.nonceGenerator?.()??M7(),N5.set($,J);return J}function _U($){N5.delete($)}function A7($,Z){let J=[];for(let[X,Y]of Object.entries($)){if(Y===void 0||Y===null)continue;if(typeof Y==="boolean"){if(Y)J.push(X);continue}if(Array.isArray(Y)){let Q=[...Y];if(Z&&(X==="script-src"||X==="style-src"))Q=Q.filter((G)=>!G.startsWith("'nonce-")),Q.push(`'nonce-${Z}'`);if(Q.length>0)J.push(`${X} ${Q.join(" ")}`)}}return J.join("; ")}function A5($,Z){return`<meta http-equiv="Content-Security-Policy" content="${A7($,Z).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}">`}var zX={"default-src":["'self'"],"script-src":["'self'","'strict-dynamic'"],"style-src":["'self'"],"img-src":["'self'","data:","https:"],"font-src":["'self'","https:","data:"],"connect-src":["'self'"],"media-src":["'self'"],"object-src":["'none'"],"frame-src":["'none'"],"base-uri":["'self'"],"form-action":["'self'"],"frame-ancestors":["'self'"],"upgrade-insecure-requests":!0},M5={"default-src":["'self'"],"script-src":["'self'"],"style-src":["'self'","'unsafe-inline'"],"img-src":["'self'","data:","https:"],"font-src":["'self'","https:","data:"],"connect-src":["'self'","https:"],"media-src":["'self'"],"object-src":["'none'"],"frame-src":["'self'"],"base-uri":["'self'"],"form-action":["'self'"],"upgrade-insecure-requests":!0},qX={"default-src":["'self'"],"script-src":["'self'","'unsafe-inline'"],"style-src":["'self'","'unsafe-inline'"],"img-src":["'self'","data:","https:","http:"],"font-src":["'self'","https:","http:","data:"],"connect-src":["'self'","https:","http:","ws:","wss:"],"media-src":["'self'","https:","http:"],"object-src":["'none'"],"frame-src":["'self'","https:"],"base-uri":["'self'"]},KX={"default-src":["'none'"],"frame-ancestors":["'none'"]};function OU($){return{enabled:!0,directives:{strict:zX,moderate:M5,relaxed:qX,api:KX}[$]||M5,useNonce:$==="strict",addMetaTag:!0}}function FU($,Z){let J={...$};for(let[X,Y]of Object.entries(Z)){let Q=X,G=J[Q];if(Y===void 0||Y===null)continue;if(typeof Y==="boolean")J[Q]=G||Y;else if(Array.isArray(Y)){let z=Array.isArray(G)?G:[],q=[...new Set([...z,...Y])];J[Q]=q}}return J}function k7($,Z,J){if(!Z.enabled||!Z.addMetaTag)return $;if($.includes('http-equiv="Content-Security-Policy"'))return $;if(!$.includes("<head>")&&!$.includes("<head "))return $;let X=Z.useNonce?w1(J,Z):void 0,Y=A5(Z.directives,X);return $.replace(/<head([^>]*)>/,`<head$1>
3221
+ ${Y}`)}function I7($,Z){let J=$;return J=J.replace(/<script(?![^>]*\ssrc=)([^>]*)>/gi,(X,Y)=>{if(Y.includes("nonce="))return X;return`<script nonce="${Z}"${Y}>`}),J=J.replace(/<style([^>]*)>/gi,(X,Y)=>{if(Y.includes("nonce="))return X;return`<style nonce="${Z}"${Y}>`}),J}function T7($,Z,J,X){let Y=$,Q=X.csp;if(Y=Y.replace(/@csp\b/g,()=>{if(!Q?.enabled||!Q.directives)return"<!-- CSP not configured -->";let G=Q.useNonce?w1(Z,Q):void 0;return A5(Q.directives,G)}),Y=Y.replace(/@cspNonce\b/g,()=>{if(!Q?.enabled||!Q.useNonce)return"";return w1(Z,Q)}),Q?.enabled&&Q.useNonce)Z.cspNonce=w1(Z,Q);return Y}var UX={name:"csp",handler:($,Z,J,X)=>{let Q=J.__stx_options?.csp;if(!Q?.enabled||!Q.directives)return"<!-- CSP not configured -->";let G=Q.useNonce?w1(J,Q):void 0;return A5(Q.directives,G)},hasEndTag:!1,description:"Insert Content-Security-Policy meta tag"},WX={name:"cspNonce",handler:($,Z,J,X)=>{let Q=J.__stx_options?.csp;if(!Q?.enabled||!Q.useNonce)return"";return w1(J,Q)},hasEndTag:!1,description:"Output the current CSP nonce value"};function wU(){return[UX,WX]}function RU($){let Z=[];if($["script-src"]?.includes("'unsafe-inline'"))Z.push("CSP: Using unsafe-inline in script-src significantly reduces XSS protection");if($["script-src"]?.includes("'unsafe-eval'"))Z.push("CSP: Using unsafe-eval in script-src allows eval() and related functions");if(!$["default-src"])Z.push("CSP: No default-src specified. Recommend adding default-src as a fallback");if($["default-src"]?.includes("*"))Z.push("CSP: Using * in default-src provides minimal protection");if(!$["object-src"]&&!$["default-src"]?.includes("'none'"))Z.push("CSP: Consider adding object-src: none to block plugins");if(!$["base-uri"])Z.push("CSP: Consider adding base-uri to prevent base tag injection attacks");for(let[J,X]of Object.entries($))if(Array.isArray(X)&&X.includes("http:"))Z.push(`CSP: Using http: in ${J} allows insecure resources`);return Z}function HX($=!1){return $?"Content-Security-Policy-Report-Only":"Content-Security-Policy"}function DU($,Z){if(!$.enabled)return{};let J=$.useNonce?w1(Z,$):void 0,X=A7($.directives,J);return{[HX($.reportOnly)]:X}}var NU={enabled:!1,reportOnly:!1,directives:M5,useNonce:!1,addMetaTag:!0};import jX from"crypto";var BX=40,E7="_token",k5=null;function VX($=BX){let Z=jX.randomBytes(Math.ceil($/2)).toString("hex").slice(0,$);return k5=Z,Z}function LX(){if(!k5)VX();return k5}function _X($=E7){let Z=LX();return`<input type="hidden" name="${$}" value="${Z}">`}function b7($){return $.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(Z,J,X)=>{return _X(X||E7)})}async function y7($,Z,J,X){if(!X.customDirectives||X.customDirectives.length===0)return $;let Y=$;for(let Q of X.customDirectives){if(!Q.name||typeof Q.handler!=="function"){if(X.debug)console.warn("Invalid custom directive:",Q);continue}if(Q.hasEndTag)Y=await OX(Y,Q,Z,J,X);else Y=await FX(Y,Q,Z,J,X)}return Y}async function OX($,Z,J,X,Y){let{name:Q,handler:G}=Z,z=`@${Q}`,q=`@end${Q}`,K=$,U=x1(`${z}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${q}`,"g"),W=[],H=U.exec(K);while(H!==null){let[j,B="",V=""]=H,F=H.index||0;try{let O=B?C7(B):[],_=V.trim(),L=await G(_,O,J,X);W.push({original:j,processed:L,startIndex:F})}catch(O){let _=O instanceof Error?O.message:String(O);if(Y.debug)console.error(`Error processing custom directive @${Q}:`,O);W.push({original:j,processed:Q0("CustomDirective",`Error in @${Q}${B?`(${B})`:""}: ${_}`,Y0.EVALUATION_ERROR),startIndex:F})}H=U.exec(K)}for(let j=W.length-1;j>=0;j--){let{original:B,processed:V}=W[j];K=K.replace(B,V)}return K}async function FX($,Z,J,X,Y){let{name:Q,handler:G}=Z,z=$,q=x1(`@${Q}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g"),K=[],U=q.exec(z);while(U!==null){let[j,B=""]=U,V=U.index||0;try{let F=C7(B),O=await G("",F,J,X);K.push({original:j,processed:O,startIndex:V})}catch(F){let O=F instanceof Error?F.message:String(F);if(Y.debug)console.error(`Error processing custom directive @${Q}:`,F);K.push({original:j,processed:Q0("CustomDirective",`Error in @${Q}(${B}): ${O}`,Y0.EVALUATION_ERROR),startIndex:V})}U=q.exec(z)}let W=x1(`@${Q}(?!\\w)(?!\\s*\\()`,"g"),H=W.exec(z);while(H!==null){let[j]=H,B=H.index||0;try{let V=await G("",[],J,X);K.push({original:j,processed:V,startIndex:B})}catch(V){let F=V instanceof Error?V.message:String(V);if(Y.debug)console.error(`Error processing custom directive @${Q}:`,V);K.push({original:j,processed:Q0("CustomDirective",`Error in @${Q}: ${F}`,Y0.EVALUATION_ERROR),startIndex:B})}H=W.exec(z)}for(let j=K.length-1;j>=0;j--){let{original:B,processed:V}=K[j];z=z.replace(B,V)}return z}function C7($){if(!$.trim())return[];let Z=[],J="",X=!1,Y="";for(let Q=0;Q<$.length;Q++){let G=$[Q];if((G==='"'||G==="'")&&(Q===0||$[Q-1]!=="\\"))if(!X)X=!0,Y=G;else if(G===Y)X=!1;else J+=G;else if(G===","&&!X)Z.push(J.trim()),J="";else J+=G}if(J.trim())Z.push(J.trim());return Z.map((Q)=>{let G=Q.trim();if(G.startsWith('"')&&G.endsWith('"')||G.startsWith("'")&&G.endsWith("'"))return G.substring(1,G.length-1);return G})}var S7=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,P7=/^[A-Za-z_$][\w$]*$/,wX=new Set(["light","dark","system"]);function R1($,Z){if(typeof $!=="string"||$.length===0)throw Error(`@appearanceBootstrap ${Z} must be a non-empty string`)}function RX($){if(!$||typeof $!=="object"||Array.isArray($))throw Error("@appearanceBootstrap expects an options object");let Z=$,J=Z.appearance,X=Z.colorMode;if(R1(Z.storageKey,"storageKey"),!J||typeof J!=="object"||Array.isArray(J))throw Error("@appearanceBootstrap appearance must be an object");if(!X||typeof X!=="object"||Array.isArray(X))throw Error("@appearanceBootstrap colorMode must be an object");if(R1(J.key,"appearance.key"),R1(J.attribute,"appearance.attribute"),R1(J.default,"appearance.default"),R1(X.key,"colorMode.key"),R1(X.attribute,"colorMode.attribute"),R1(X.default,"colorMode.default"),!P7.test(J.key)||!P7.test(X.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!S7.test(J.attribute)||!S7.test(X.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!Array.isArray(J.allowed)||J.allowed.length===0||J.allowed.some((Y)=>typeof Y!=="string"||Y.length===0))throw Error("@appearanceBootstrap appearance.allowed must contain one or more strings");if(!J.allowed.includes(J.default))throw Error("@appearanceBootstrap appearance.default must be in appearance.allowed");if(!wX.has(X.default))throw Error("@appearanceBootstrap colorMode.default must be light, dark, or system");return{storageKey:Z.storageKey,appearance:{key:J.key,attribute:J.attribute,allowed:[...new Set(J.allowed)],default:J.default},colorMode:{key:X.key,attribute:X.attribute,default:X.default}}}function DX($){return JSON.stringify($).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function NX($){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${DX($)};const root=document.documentElement;const MODES=["light","dark","system"];function read(){let stored={};try{const raw=localStorage.getItem(config.storageKey);const parsed=raw?JSON.parse(raw):{};if(parsed&&typeof parsed==="object"&&!Array.isArray(parsed))stored=parsed}catch{}return stored}function write(stored){try{localStorage.setItem(config.storageKey,JSON.stringify(stored))}catch{}}function resolve(){const stored=read();return{appearance:config.appearance.allowed.includes(stored[config.appearance.key])?stored[config.appearance.key]:config.appearance.default,colorMode:MODES.includes(stored[config.colorMode.key])?stored[config.colorMode.key]:config.colorMode.default}}function prefersDark(){try{return matchMedia("(prefers-color-scheme: dark)").matches}catch{return false}}function apply(){const state=resolve();const dark=state.colorMode==="dark"||(state.colorMode==="system"&&prefersDark());root.setAttribute("data-"+config.appearance.attribute,state.appearance);root.setAttribute("data-"+config.colorMode.attribute,state.colorMode);root.classList.toggle("dark",dark);root.dataset.theme=dark?"dark":"light";state.dark=dark;try{window.dispatchEvent(new CustomEvent("stx:appearance",{detail:state}))}catch{}return state}function store(key,allowed,value){if(allowed.includes(value)){const stored=read();stored[key]=value;write(stored)}return apply()}window.__stxAppearance={config:config,read:read,resolve:resolve,apply:apply,setColorMode:function(mode){return store(config.colorMode.key,MODES,mode)},setAppearance:function(name){return store(config.appearance.key,config.appearance.allowed,name)},watchSystem:function(){try{matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(){if(resolve().colorMode==="system")apply()})}catch{}}};apply()}());</script>`}function MX($,Z){let J=1,X=null,Y=!1;for(let Q=Z+1;Q<$.length;Q++){let G=$[Q];if(Y){Y=!1;continue}if(X){if(G==="\\")Y=!0;else if(G===X)X=null;continue}if(G==='"'||G==="'"||G==="`"){X=G;continue}if(G==="(")J++;else if(G===")"&&--J===0)return Q}return-1}function v7($,Z){let J=$,X=/@appearanceBootstrap\s*\(/g,Y;while((Y=X.exec(J))!==null){let Q=Y.index+Y[0].length-1,G=MX(J,Q);if(G===-1)throw Error("@appearanceBootstrap has an unclosed options object");let z=J.slice(Q+1,G).trim(),q=e(`(${z})`,Z),K=NX(RX(q));J=J.slice(0,Y.index)+K+J.slice(G+1),X.lastIndex=Y.index+K.length}return J}import AX from"crypto";function O0($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var T5={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function kX($){return{...T5,...$.forms?.classes}}function J9($,Z,J,X){let Y=$||Z;return J?`${Y} ${X}`:Y}function h0($){return String($).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function g1($,Z){if(/\bid\s*=/i.test($))return"";return` id="${O0(Z)}"`}function I5($,Z,J){if(!Z)return"";let X="";if(!/\baria-invalid\s*=/i.test(J))X+=' aria-invalid="true"';if(!/\baria-describedby\s*=/i.test(J))X+=` aria-describedby="${O0(`${h0($)}-error`)}"`;return X}function IX(){return AX.randomUUID()}function PU($,Z,J,X){let Y=kX(X),Q=$;return Q=EX(Q,Z),Q=V2(Q,Z),Q=E5(Q,Z,Y),Q=b5(Q,Z,Y),Q}function V2($,Z){let J=$;return J=J.replace(/@csrf/g,()=>{if(!Z.csrf||typeof Z.csrf!=="object"){let X=IX();Z.csrf={token:X}}if(Z.csrf.field)return Z.csrf.field;if(Z.csrf.token)return`<input type="hidden" name="_token" value="${O0(Z.csrf.token)}">`;return'<input type="hidden" name="_token" value="">'}),J=J.replace(/@method\(['"]([^'"]+)['"]\)/g,(X,Y)=>{let Q=Y.toUpperCase();if(Y&&!["GET","POST"].includes(Q))return`<input type="hidden" name="_method" value="${O0(Q)}">`;return X}),J}function E5($,Z,J=T5){let X=$;return X=X.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(Y,Q,G,z,q,K="")=>{let U=Q||G||"POST",W=z||q||"",H=W1(K),j=U.toUpperCase(),B=["GET","POST"].includes(j)?j:"POST",V=`<form method="${O0(B)}" action="${O0(W)}"${H?` ${H}`:""}>`;if(V+=`
3224
3222
  ${V2("@csrf",Z)}`,!["GET","POST"].includes(j))V+=`
3225
- ${V2(`@method('${j}')`,Z)}`;return V}),X=X.replace(/@endform/g,"</form>"),X=X.replace(/@input\(\s*(?:'([^']+)'|"([^"]+)")\s*(?:,\s*(?:(?:'([^']*)'|"([^"]*)")\s*)?)?(?:,\s*\{([^}]+)\})?\s*\)/g,(Y,Q,G,z,q,K="")=>{let U=Q||G||"",W=z||q||"",H=W1(K),j=j2(U,Z),B=j!==void 0&&j!==null?j:W||"",V=H.match(/type=['"]([^'"]+)['"]/i),F=V?V[1]:"text",O=B2(U,Z),_=H.match(/class=['"]([^'"]+)['"]/i),L=J9(_?_[1]:"",J.input,O,J.inputError),w=H.replace(/class=['"][^'"]+['"]/i,"");return w=w.replace(/type=['"][^'"]+['"]/i,""),`<input type="${O0(F)}" name="${O0(U)}"${g1(H,h0(U))} value="${O0(B)}" class="${L}"${I5(U,O,H)}${w?` ${w}`:""}>`}),X=X.replace(/@textarea\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endtextarea/g,(Y,Q,G="",z="")=>{let q=W1(G),K=j2(Q,Z)||z.trim(),U=B2(Q,Z),W=q.match(/class=['"]([^'"]+)['"]/i),H=J9(W?W[1]:"",J.input,U,J.inputError),j=q.replace(/class=['"][^'"]+['"]/i,"");return`<textarea name="${O0(Q)}"${g1(q,h0(Q))} class="${H}"${I5(Q,U,q)}${j?` ${j}`:""}>${O0(K)}</textarea>`}),X=X.replace(/@select\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endselect/g,(Y,Q,G="",z)=>{let q=W1(G),K=j2(Q,Z),U=B2(Q,Z),W=q.match(/class=['"]([^'"]+)['"]/i),H=J9(W?W[1]:"",J.input,U,J.inputError),j=q.replace(/class=['"][^'"]+['"]/i,""),B=z;if(K!==void 0)B=z.replace(/(<option[^>]*value=['"]([^'"]+)['"][^>]*>)/gi,(V,F,O)=>{if((Array.isArray(K)?K.some((L)=>String(L)===O):String(K)===O)&&!F.includes("selected"))return F.replace(/(<option)/,"$1 selected");return V});return`<select name="${O0(Q)}"${g1(q,h0(Q))} class="${H}"${I5(Q,U,q)}${j?` ${j}`:""}>${B}</select>`}),X=X.replace(/@checkbox\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?(?:,\s*\{([^}]+)\})?\)/g,(Y,Q,G,z="")=>{let q=G===void 0?"1":G,K=G===void 0?h0(Q):`${h0(Q)}-${h0(q)}`,U=W1(z),W=j2(Q,Z),H=W!==void 0&&(Array.isArray(W)?W.some((F)=>String(F)===q):W===!0||String(W)===q),j=U.match(/class=['"]([^'"]+)['"]/i),B=j?j[1]:J.checkInput,V=U.replace(/class=['"][^'"]+['"]/i,"");return`<input type="checkbox" name="${O0(Q)}"${g1(U,K)} value="${O0(q)}" class="${B}"${H?" checked":""}${V?` ${V}`:""}>`}),X=X.replace(/@radio\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(Y,Q,G,z="")=>{let q=W1(z),K=j2(Q,Z),U=K!==void 0&&K===G,W=q.match(/class=['"]([^'"]+)['"]/i),H=W?W[1]:J.checkInput,j=q.replace(/class=['"][^'"]+['"]/i,"");return`<input type="radio" name="${O0(Q)}"${g1(q,`${h0(Q)}-${h0(G)}`)} value="${O0(G)}" class="${H}"${U?" checked":""}${j?` ${j}`:""}>`}),X=X.replace(/@file\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(Y,Q,G="")=>{let z=W1(G),q=z.match(/accept=['"]([^'"]+)['"]/i),K=q?q[1]:"",U=z.includes("multiple"),W=B2(Q,Z),H=z.match(/class=['"]([^'"]+)['"]/i),j=J9(H?H[1]:"",J.input,W,J.inputError),B=z.replace(/class=['"][^'"]+['"]/gi,"").replace(/accept=['"][^'"]+['"]/gi,"").replace(/\bmultiple\b/gi,"").trim(),V=[`<input type="file" name="${O0(Q)}"${g1(z,h0(Q))}`,`class="${j}"`];if(K)V.push(`accept="${O0(K)}"`);if(U)V.push("multiple");if(B)V.push(B);return`${V.join(" ")}>`}),X=X.replace(/@label\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endlabel/g,(Y,Q,G="",z)=>{let q=W1(G),K=q.match(/class=['"]([^'"]+)['"]/i),U=K?K[1]:J.label,W=q.replace(/class=['"][^'"]+['"]/i,"");return`<label for="${O0(h0(Q))}" class="${U}"${W?` ${W}`:""}>${z}</label>`}),X}function b5($,Z,J=T5){return $.replace(/@error\(['"]([^'"]+)['"]\)([\s\S]*?)@enderror/g,(X,Y,Q)=>{try{if(B2(Y,Z)){let G=Q.replace(/\{\{([^}]+)\}\}/g,(z,q)=>{try{if(q.trim()==="$message"||q.trim()==="message")return f7(Y,Z);if(q.trim().includes("errors.first")||q.trim().includes("$errors.first")){if(typeof Z.errors?.first==="function")return Z.errors.first(Y);return f7(Y,Z)}let K=q.trim();if(q0(K)){let U=e(K,Z);return U!==void 0?String(U):K}return K}catch{return q}});return`<div id="${O0(`${h0(Y)}-error`)}" role="alert">${G}</div>`}return""}catch(G){return console.error("Error processing @error directive:",G),X}})}function B2($,Z){if(!Z.errors)return!1;if(typeof Z.errors.has==="function")return Z.errors.has($);if(typeof Z.errors==="object")return Object.prototype.hasOwnProperty.call(Z.errors,$);return!1}function f7($,Z){if(!Z.errors)return"";if(typeof Z.errors.get==="function")return Z.errors.get($);if(typeof Z.errors==="object"&&Object.prototype.hasOwnProperty.call(Z.errors,$)){let J=Z.errors[$];return Array.isArray(J)?J[0]:String(J)}return""}function j2($,Z){let J;if(Z.old&&typeof Z.old==="function")return Z.old($);if(Z.old&&typeof Z.old==="object")return Z.old[$];if($.endsWith("[]")){let X=$.slice(0,-2);if(J=Z[X],J!==void 0)return J}return Z[$]}function W1($){if(!$.trim())return"";let Z=[],J=$.trim(),X=/([\w-]+)\s*:\s*(['"]?)([^,'"]*)\2(?:\s*,\s*|\s*$)/g,Y;while((Y=X.exec(J))!==null){let[,Q,,G]=Y;Z.push(`${Q}="${G.trim()}"`)}return Z.join(" ")}var x7={required:($,Z,J)=>{if($===void 0||$===null||$===""||Array.isArray($)&&$.length===0)return`The ${J} field is required.`;return null},email:($,Z,J)=>{if(!$)return null;if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String($)))return`The ${J} field must be a valid email address.`;return null},min:($,Z,J)=>{if(!$)return null;let X=Number(Z[0]);if(typeof $==="string"&&$.length<X)return`The ${J} field must be at least ${X} characters.`;if(typeof $==="number"&&$<X)return`The ${J} field must be at least ${X}.`;if(Array.isArray($)&&$.length<X)return`The ${J} field must have at least ${X} items.`;return null},max:($,Z,J)=>{if(!$)return null;let X=Number(Z[0]);if(typeof $==="string"&&$.length>X)return`The ${J} field must not exceed ${X} characters.`;if(typeof $==="number"&&$>X)return`The ${J} field must not exceed ${X}.`;if(Array.isArray($)&&$.length>X)return`The ${J} field must not have more than ${X} items.`;return null},confirmed:($,Z,J)=>{if(Z[0]!==void 0&&$!==Z[0])return`The ${J} confirmation does not match.`;return null},numeric:($,Z,J)=>{if(!$)return null;if(Number.isNaN(Number($)))return`The ${J} field must be a number.`;return null},integer:($,Z,J)=>{if(!$)return null;if(!Number.isInteger(Number($)))return`The ${J} field must be an integer.`;return null},alpha:($,Z,J)=>{if(!$)return null;if(!/^[a-z]+$/i.test(String($)))return`The ${J} field must only contain letters.`;return null},alphanumeric:($,Z,J)=>{if(!$)return null;if(!/^[a-z0-9]+$/i.test(String($)))return`The ${J} field must only contain letters and numbers.`;return null},url:($,Z,J)=>{if(!$)return null;try{return new URL(String($))?null:null}catch{return`The ${J} field must be a valid URL.`}},regex:($,Z,J)=>{if(!$)return null;try{if(!new RegExp(Z[0]).test(String($)))return`The ${J} field format is invalid.`;return null}catch{return`The ${J} field has an invalid validation pattern.`}},in:($,Z,J)=>{if(!$)return null;if(!Z.includes(String($)))return`The ${J} field must be one of: ${Z.join(", ")}.`;return null},notIn:($,Z,J)=>{if(!$)return null;if(Z.includes(String($)))return`The ${J} field must not be: ${Z.join(", ")}.`;return null},date:($,Z,J)=>{if(!$)return null;let X=new Date($);if(Number.isNaN(X.getTime()))return`The ${J} field must be a valid date.`;return null},before:($,Z,J)=>{if(!$)return null;let X=new Date($),Y=new Date(Z[0]);if(X>=Y)return`The ${J} field must be before ${Z[0]}.`;return null},after:($,Z,J)=>{if(!$)return null;let X=new Date($),Y=new Date(Z[0]);if(X<=Y)return`The ${J} field must be after ${Z[0]}.`;return null}};function fU($,Z){x7[$]=Z}function y5($){let[Z,...J]=$.split(":"),X=J.length>0?J.join(":").split(","):[];return{name:Z.trim(),params:X}}function kX($,Z,J,X={}){let Y=[],Q=J.split("|").map((G)=>G.trim()).filter(Boolean);for(let G of Q){let z=y5(G),q=x7[z.name];if(!q){console.warn(`Unknown validation rule: ${z.name}`);continue}if(z.name==="confirmed"){let U=`${$}_confirmation`;z.params=[X[U]]}let K=q(Z,z.params||[],$);if(K)Y.push(z.message||K)}return{field:$,valid:Y.length===0,errors:Y}}function xU($,Z){let J={};for(let[X,Y]of Object.entries(Z)){let Q=kX(X,$[X],Y,$);if(!Q.valid)J[X]=Q.errors}return J}function IX($,Z){return $.replace(/@validate\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]*)\})?\s*\)/g,(J,X,Y,Q)=>{let G=Y.split("|").map((q)=>q.trim()),z=[];for(let q of G){let K=y5(q);switch(K.name){case"required":z.push("required");break;case"email":z.push('type="email"');break;case"url":z.push('type="url"');break;case"numeric":case"integer":if(z.push('type="number"'),K.name==="integer")z.push('step="1"');break;case"min":if(K.params?.[0])z.push(`minlength="${K.params[0]}"`);break;case"max":if(K.params?.[0])z.push(`maxlength="${K.params[0]}"`);break;case"regex":if(K.params?.[0])z.push(`pattern="${K.params[0]}"`);break}}return`<!-- @validate:${X}:${Y} -->${z.length>0?`<!-- attrs:${z.join(" ")} -->`:""}`})}var g7={required:{name:"required",validate:($)=>{if($===null||$===void 0||$==="")return"This field is required";if(Array.isArray($)&&$.length===0)return"This field is required";return!0},toHtml5:()=>["required"],message:"This field is required"},email:{name:"email",validate:($)=>{if(!$)return!0;return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String($))||"Please enter a valid email address"},toHtml5:()=>['type="email"'],message:"Please enter a valid email address"},url:{name:"url",validate:($)=>{if(!$)return!0;try{return new URL(String($)).protocol.startsWith("http")||"Please enter a valid URL"}catch{return"Please enter a valid URL"}},toHtml5:()=>['type="url"'],message:"Please enter a valid URL"},numeric:{name:"numeric",validate:($)=>{if(!$)return!0;return!Number.isNaN(Number($))||"Please enter a number"},toHtml5:()=>['type="number"'],message:"Please enter a number"},integer:{name:"integer",validate:($)=>{if(!$)return!0;let Z=Number($);return Number.isInteger(Z)||"Please enter a whole number"},toHtml5:()=>['type="number"','step="1"'],message:"Please enter a whole number"},alpha:{name:"alpha",validate:($)=>{if(!$)return!0;return/^[a-z]+$/i.test(String($))||"Please enter only letters"},toHtml5:()=>['pattern="[a-zA-Z]+"'],message:"Please enter only letters"},alphanumeric:{name:"alphanumeric",validate:($)=>{if(!$)return!0;return/^[a-z0-9]+$/i.test(String($))||"Please enter only letters and numbers"},toHtml5:()=>['pattern="[a-zA-Z0-9]+"'],message:"Please enter only letters and numbers"},min:{name:"min",validate:($,Z)=>{if(!$)return!0;let J=Number(Z[0]);if(typeof $==="string")return $.length>=J||`Must be at least ${J} characters`;if(typeof $==="number")return $>=J||`Must be at least ${J}`;if(Array.isArray($))return $.length>=J||`Must have at least ${J} items`;return!0},toHtml5:($)=>[`minlength="${$[0]}"`,`min="${$[0]}"`],message:"Must be at least {{param}} characters"},max:{name:"max",validate:($,Z)=>{if(!$)return!0;let J=Number(Z[0]);if(typeof $==="string")return $.length<=J||`Must be no more than ${J} characters`;if(typeof $==="number")return $<=J||`Must be no more than ${J}`;if(Array.isArray($))return $.length<=J||`Must have no more than ${J} items`;return!0},toHtml5:($)=>[`maxlength="${$[0]}"`,`max="${$[0]}"`],message:"Must be no more than {{param}} characters"},between:{name:"between",validate:($,Z)=>{if(!$)return!0;let[J,X]=Z.map(Number);if(typeof $==="string")return $.length>=J&&$.length<=X||`Must be between ${J} and ${X} characters`;if(typeof $==="number")return $>=J&&$<=X||`Must be between ${J} and ${X}`;return!0},toHtml5:($)=>[`minlength="${$[0]}"`,`maxlength="${$[1]}"`],message:"Must be between {{min}} and {{max}}"},confirmed:{name:"confirmed",validate:($,Z,J)=>{let X=Object.keys(J);for(let Y of X)if(Y.endsWith("_confirmation")&&J[Y]===$)return!0;return"Confirmation does not match"},message:"Confirmation does not match"},in:{name:"in",validate:($,Z)=>{if(!$)return!0;return Z.includes(String($))||`Must be one of: ${Z.join(", ")}`},message:"Must be one of: {{values}}"},notIn:{name:"notIn",validate:($,Z)=>{if(!$)return!0;return!Z.includes(String($))||`Must not be: ${Z.join(", ")}`},message:"Must not be: {{values}}"},regex:{name:"regex",validate:($,Z)=>{if(!$)return!0;try{return new RegExp(Z[0]).test(String($))||"Invalid format"}catch{return"Invalid format"}},toHtml5:($)=>[`pattern="${$[0]}"`],message:"Invalid format"},date:{name:"date",validate:($)=>{if(!$)return!0;let Z=new Date(String($));return!Number.isNaN(Z.getTime())||"Please enter a valid date"},toHtml5:()=>['type="date"'],message:"Please enter a valid date"},before:{name:"before",validate:($,Z)=>{if(!$)return!0;let J=new Date(String($)),X=new Date(Z[0]);return J<X||`Must be before ${Z[0]}`},toHtml5:($)=>[`max="${$[0]}"`],message:"Must be before {{date}}"},after:{name:"after",validate:($,Z)=>{if(!$)return!0;let J=new Date(String($)),X=new Date(Z[0]);return J>X||`Must be after ${Z[0]}`},toHtml5:($)=>[`min="${$[0]}"`],message:"Must be after {{date}}"},size:{name:"size",validate:($,Z)=>{if(!$)return!0;let J=Number(Z[0]);if(typeof $==="string")return $.length===J||`Must be exactly ${J} characters`;if(Array.isArray($))return $.length===J||`Must have exactly ${J} items`;return!0},message:"Must be exactly {{size}}"},phone:{name:"phone",validate:($)=>{if(!$)return!0;return/^\+?\(?\d{1,4}\)?[-\s./\d]*$/.test(String($))||"Please enter a valid phone number"},toHtml5:()=>['type="tel"','pattern="\\+?\\(?\\d{1,4}\\)?[-\\s./\\d]*"'],message:"Please enter a valid phone number"}};function gU($){g7[$.name]=$}function TX($,Z,J={}){let X=[],Y=Z.split("|").map((Q)=>Q.trim());for(let Q of Y){let G=y5(Q),z=g7[G.name];if(!z){console.warn(`Unknown validation rule: ${G.name}`);continue}let q=z.validate($,G.params||[],J);if(q!==!0)X.push(q)}return{valid:X.length===0,errors:X}}function hU($,Z){let J={},X=!0;for(let[Y,Q]of Object.entries(Z)){let G=TX($[Y],Q,$);if(!G.valid)X=!1,J[Y]=G.errors}return{valid:X,errors:J}}function uU($,Z){let J=JSON.stringify(Z);return`
3223
+ ${V2(`@method('${j}')`,Z)}`;return V}),X=X.replace(/@endform/g,"</form>"),X=X.replace(/@input\(\s*(?:'([^']+)'|"([^"]+)")\s*(?:,\s*(?:(?:'([^']*)'|"([^"]*)")\s*)?)?(?:,\s*\{([^}]+)\})?\s*\)/g,(Y,Q,G,z,q,K="")=>{let U=Q||G||"",W=z||q||"",H=W1(K),j=j2(U,Z),B=j!==void 0&&j!==null?j:W||"",V=H.match(/type=['"]([^'"]+)['"]/i),F=V?V[1]:"text",O=B2(U,Z),_=H.match(/class=['"]([^'"]+)['"]/i),L=J9(_?_[1]:"",J.input,O,J.inputError),w=H.replace(/class=['"][^'"]+['"]/i,"");return w=w.replace(/type=['"][^'"]+['"]/i,""),`<input type="${O0(F)}" name="${O0(U)}"${g1(H,h0(U))} value="${O0(B)}" class="${L}"${I5(U,O,H)}${w?` ${w}`:""}>`}),X=X.replace(/@textarea\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endtextarea/g,(Y,Q,G="",z="")=>{let q=W1(G),K=j2(Q,Z)||z.trim(),U=B2(Q,Z),W=q.match(/class=['"]([^'"]+)['"]/i),H=J9(W?W[1]:"",J.input,U,J.inputError),j=q.replace(/class=['"][^'"]+['"]/i,"");return`<textarea name="${O0(Q)}"${g1(q,h0(Q))} class="${H}"${I5(Q,U,q)}${j?` ${j}`:""}>${O0(K)}</textarea>`}),X=X.replace(/@select\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endselect/g,(Y,Q,G="",z)=>{let q=W1(G),K=j2(Q,Z),U=B2(Q,Z),W=q.match(/class=['"]([^'"]+)['"]/i),H=J9(W?W[1]:"",J.input,U,J.inputError),j=q.replace(/class=['"][^'"]+['"]/i,""),B=z;if(K!==void 0)B=z.replace(/(<option[^>]*value=['"]([^'"]+)['"][^>]*>)/gi,(V,F,O)=>{if((Array.isArray(K)?K.some((L)=>String(L)===O):String(K)===O)&&!F.includes("selected"))return F.replace(/(<option)/,"$1 selected");return V});return`<select name="${O0(Q)}"${g1(q,h0(Q))} class="${H}"${I5(Q,U,q)}${j?` ${j}`:""}>${B}</select>`}),X=X.replace(/@checkbox\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?(?:,\s*\{([^}]+)\})?\)/g,(Y,Q,G,z="")=>{let q=G===void 0?"1":G,K=G===void 0?h0(Q):`${h0(Q)}-${h0(q)}`,U=W1(z),W=j2(Q,Z),H=W!==void 0&&(Array.isArray(W)?W.some((F)=>String(F)===q):W===!0||String(W)===q),j=U.match(/class=['"]([^'"]+)['"]/i),B=j?j[1]:J.checkInput,V=U.replace(/class=['"][^'"]+['"]/i,"");return`<input type="checkbox" name="${O0(Q)}"${g1(U,K)} value="${O0(q)}" class="${B}"${H?" checked":""}${V?` ${V}`:""}>`}),X=X.replace(/@radio\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(Y,Q,G,z="")=>{let q=W1(z),K=j2(Q,Z),U=K!==void 0&&K===G,W=q.match(/class=['"]([^'"]+)['"]/i),H=W?W[1]:J.checkInput,j=q.replace(/class=['"][^'"]+['"]/i,"");return`<input type="radio" name="${O0(Q)}"${g1(q,`${h0(Q)}-${h0(G)}`)} value="${O0(G)}" class="${H}"${U?" checked":""}${j?` ${j}`:""}>`}),X=X.replace(/@file\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(Y,Q,G="")=>{let z=W1(G),q=z.match(/accept=['"]([^'"]+)['"]/i),K=q?q[1]:"",U=z.includes("multiple"),W=B2(Q,Z),H=z.match(/class=['"]([^'"]+)['"]/i),j=J9(H?H[1]:"",J.input,W,J.inputError),B=z.replace(/class=['"][^'"]+['"]/gi,"").replace(/accept=['"][^'"]+['"]/gi,"").replace(/\bmultiple\b/gi,"").trim(),V=[`<input type="file" name="${O0(Q)}"${g1(z,h0(Q))}`,`class="${j}"`];if(K)V.push(`accept="${O0(K)}"`);if(U)V.push("multiple");if(B)V.push(B);return`${V.join(" ")}>`}),X=X.replace(/@label\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endlabel/g,(Y,Q,G="",z)=>{let q=W1(G),K=q.match(/class=['"]([^'"]+)['"]/i),U=K?K[1]:J.label,W=q.replace(/class=['"][^'"]+['"]/i,"");return`<label for="${O0(h0(Q))}" class="${U}"${W?` ${W}`:""}>${z}</label>`}),X}function b5($,Z,J=T5){return $.replace(/@error\(['"]([^'"]+)['"]\)([\s\S]*?)@enderror/g,(X,Y,Q)=>{try{if(B2(Y,Z)){let G=Q.replace(/\{\{([^}]+)\}\}/g,(z,q)=>{try{if(q.trim()==="$message"||q.trim()==="message")return f7(Y,Z);if(q.trim().includes("errors.first")||q.trim().includes("$errors.first")){if(typeof Z.errors?.first==="function")return Z.errors.first(Y);return f7(Y,Z)}let K=q.trim();if(q0(K)){let U=e(K,Z);return U!==void 0?String(U):K}return K}catch{return q}});return`<div id="${O0(`${h0(Y)}-error`)}" role="alert">${G}</div>`}return""}catch(G){return console.error("Error processing @error directive:",G),X}})}function B2($,Z){if(!Z.errors)return!1;if(typeof Z.errors.has==="function")return Z.errors.has($);if(typeof Z.errors==="object")return Object.prototype.hasOwnProperty.call(Z.errors,$);return!1}function f7($,Z){if(!Z.errors)return"";if(typeof Z.errors.get==="function")return Z.errors.get($);if(typeof Z.errors==="object"&&Object.prototype.hasOwnProperty.call(Z.errors,$)){let J=Z.errors[$];return Array.isArray(J)?J[0]:String(J)}return""}function j2($,Z){let J;if(Z.old&&typeof Z.old==="function")return Z.old($);if(Z.old&&typeof Z.old==="object")return Z.old[$];if($.endsWith("[]")){let X=$.slice(0,-2);if(J=Z[X],J!==void 0)return J}return Z[$]}function W1($){if(!$.trim())return"";let Z=[],J=$.trim(),X=/([\w-]+)\s*:\s*(['"]?)([^,'"]*)\2(?:\s*,\s*|\s*$)/g,Y;while((Y=X.exec(J))!==null){let[,Q,,G]=Y;Z.push(`${Q}="${G.trim()}"`)}return Z.join(" ")}var x7={required:($,Z,J)=>{if($===void 0||$===null||$===""||Array.isArray($)&&$.length===0)return`The ${J} field is required.`;return null},email:($,Z,J)=>{if(!$)return null;if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String($)))return`The ${J} field must be a valid email address.`;return null},min:($,Z,J)=>{if(!$)return null;let X=Number(Z[0]);if(typeof $==="string"&&$.length<X)return`The ${J} field must be at least ${X} characters.`;if(typeof $==="number"&&$<X)return`The ${J} field must be at least ${X}.`;if(Array.isArray($)&&$.length<X)return`The ${J} field must have at least ${X} items.`;return null},max:($,Z,J)=>{if(!$)return null;let X=Number(Z[0]);if(typeof $==="string"&&$.length>X)return`The ${J} field must not exceed ${X} characters.`;if(typeof $==="number"&&$>X)return`The ${J} field must not exceed ${X}.`;if(Array.isArray($)&&$.length>X)return`The ${J} field must not have more than ${X} items.`;return null},confirmed:($,Z,J)=>{if(Z[0]!==void 0&&$!==Z[0])return`The ${J} confirmation does not match.`;return null},numeric:($,Z,J)=>{if(!$)return null;if(Number.isNaN(Number($)))return`The ${J} field must be a number.`;return null},integer:($,Z,J)=>{if(!$)return null;if(!Number.isInteger(Number($)))return`The ${J} field must be an integer.`;return null},alpha:($,Z,J)=>{if(!$)return null;if(!/^[a-z]+$/i.test(String($)))return`The ${J} field must only contain letters.`;return null},alphanumeric:($,Z,J)=>{if(!$)return null;if(!/^[a-z0-9]+$/i.test(String($)))return`The ${J} field must only contain letters and numbers.`;return null},url:($,Z,J)=>{if(!$)return null;try{return new URL(String($))?null:null}catch{return`The ${J} field must be a valid URL.`}},regex:($,Z,J)=>{if(!$)return null;try{if(!new RegExp(Z[0]).test(String($)))return`The ${J} field format is invalid.`;return null}catch{return`The ${J} field has an invalid validation pattern.`}},in:($,Z,J)=>{if(!$)return null;if(!Z.includes(String($)))return`The ${J} field must be one of: ${Z.join(", ")}.`;return null},notIn:($,Z,J)=>{if(!$)return null;if(Z.includes(String($)))return`The ${J} field must not be: ${Z.join(", ")}.`;return null},date:($,Z,J)=>{if(!$)return null;let X=new Date($);if(Number.isNaN(X.getTime()))return`The ${J} field must be a valid date.`;return null},before:($,Z,J)=>{if(!$)return null;let X=new Date($),Y=new Date(Z[0]);if(X>=Y)return`The ${J} field must be before ${Z[0]}.`;return null},after:($,Z,J)=>{if(!$)return null;let X=new Date($),Y=new Date(Z[0]);if(X<=Y)return`The ${J} field must be after ${Z[0]}.`;return null}};function vU($,Z){x7[$]=Z}function y5($){let[Z,...J]=$.split(":"),X=J.length>0?J.join(":").split(","):[];return{name:Z.trim(),params:X}}function TX($,Z,J,X={}){let Y=[],Q=J.split("|").map((G)=>G.trim()).filter(Boolean);for(let G of Q){let z=y5(G),q=x7[z.name];if(!q){console.warn(`Unknown validation rule: ${z.name}`);continue}if(z.name==="confirmed"){let U=`${$}_confirmation`;z.params=[X[U]]}let K=q(Z,z.params||[],$);if(K)Y.push(z.message||K)}return{field:$,valid:Y.length===0,errors:Y}}function fU($,Z){let J={};for(let[X,Y]of Object.entries(Z)){let Q=TX(X,$[X],Y,$);if(!Q.valid)J[X]=Q.errors}return J}function EX($,Z){return $.replace(/@validate\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]*)\})?\s*\)/g,(J,X,Y,Q)=>{let G=Y.split("|").map((q)=>q.trim()),z=[];for(let q of G){let K=y5(q);switch(K.name){case"required":z.push("required");break;case"email":z.push('type="email"');break;case"url":z.push('type="url"');break;case"numeric":case"integer":if(z.push('type="number"'),K.name==="integer")z.push('step="1"');break;case"min":if(K.params?.[0])z.push(`minlength="${K.params[0]}"`);break;case"max":if(K.params?.[0])z.push(`maxlength="${K.params[0]}"`);break;case"regex":if(K.params?.[0])z.push(`pattern="${K.params[0]}"`);break}}return`<!-- @validate:${X}:${Y} -->${z.length>0?`<!-- attrs:${z.join(" ")} -->`:""}`})}var g7={required:{name:"required",validate:($)=>{if($===null||$===void 0||$==="")return"This field is required";if(Array.isArray($)&&$.length===0)return"This field is required";return!0},toHtml5:()=>["required"],message:"This field is required"},email:{name:"email",validate:($)=>{if(!$)return!0;return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String($))||"Please enter a valid email address"},toHtml5:()=>['type="email"'],message:"Please enter a valid email address"},url:{name:"url",validate:($)=>{if(!$)return!0;try{return new URL(String($)).protocol.startsWith("http")||"Please enter a valid URL"}catch{return"Please enter a valid URL"}},toHtml5:()=>['type="url"'],message:"Please enter a valid URL"},numeric:{name:"numeric",validate:($)=>{if(!$)return!0;return!Number.isNaN(Number($))||"Please enter a number"},toHtml5:()=>['type="number"'],message:"Please enter a number"},integer:{name:"integer",validate:($)=>{if(!$)return!0;let Z=Number($);return Number.isInteger(Z)||"Please enter a whole number"},toHtml5:()=>['type="number"','step="1"'],message:"Please enter a whole number"},alpha:{name:"alpha",validate:($)=>{if(!$)return!0;return/^[a-z]+$/i.test(String($))||"Please enter only letters"},toHtml5:()=>['pattern="[a-zA-Z]+"'],message:"Please enter only letters"},alphanumeric:{name:"alphanumeric",validate:($)=>{if(!$)return!0;return/^[a-z0-9]+$/i.test(String($))||"Please enter only letters and numbers"},toHtml5:()=>['pattern="[a-zA-Z0-9]+"'],message:"Please enter only letters and numbers"},min:{name:"min",validate:($,Z)=>{if(!$)return!0;let J=Number(Z[0]);if(typeof $==="string")return $.length>=J||`Must be at least ${J} characters`;if(typeof $==="number")return $>=J||`Must be at least ${J}`;if(Array.isArray($))return $.length>=J||`Must have at least ${J} items`;return!0},toHtml5:($)=>[`minlength="${$[0]}"`,`min="${$[0]}"`],message:"Must be at least {{param}} characters"},max:{name:"max",validate:($,Z)=>{if(!$)return!0;let J=Number(Z[0]);if(typeof $==="string")return $.length<=J||`Must be no more than ${J} characters`;if(typeof $==="number")return $<=J||`Must be no more than ${J}`;if(Array.isArray($))return $.length<=J||`Must have no more than ${J} items`;return!0},toHtml5:($)=>[`maxlength="${$[0]}"`,`max="${$[0]}"`],message:"Must be no more than {{param}} characters"},between:{name:"between",validate:($,Z)=>{if(!$)return!0;let[J,X]=Z.map(Number);if(typeof $==="string")return $.length>=J&&$.length<=X||`Must be between ${J} and ${X} characters`;if(typeof $==="number")return $>=J&&$<=X||`Must be between ${J} and ${X}`;return!0},toHtml5:($)=>[`minlength="${$[0]}"`,`maxlength="${$[1]}"`],message:"Must be between {{min}} and {{max}}"},confirmed:{name:"confirmed",validate:($,Z,J)=>{let X=Object.keys(J);for(let Y of X)if(Y.endsWith("_confirmation")&&J[Y]===$)return!0;return"Confirmation does not match"},message:"Confirmation does not match"},in:{name:"in",validate:($,Z)=>{if(!$)return!0;return Z.includes(String($))||`Must be one of: ${Z.join(", ")}`},message:"Must be one of: {{values}}"},notIn:{name:"notIn",validate:($,Z)=>{if(!$)return!0;return!Z.includes(String($))||`Must not be: ${Z.join(", ")}`},message:"Must not be: {{values}}"},regex:{name:"regex",validate:($,Z)=>{if(!$)return!0;try{return new RegExp(Z[0]).test(String($))||"Invalid format"}catch{return"Invalid format"}},toHtml5:($)=>[`pattern="${$[0]}"`],message:"Invalid format"},date:{name:"date",validate:($)=>{if(!$)return!0;let Z=new Date(String($));return!Number.isNaN(Z.getTime())||"Please enter a valid date"},toHtml5:()=>['type="date"'],message:"Please enter a valid date"},before:{name:"before",validate:($,Z)=>{if(!$)return!0;let J=new Date(String($)),X=new Date(Z[0]);return J<X||`Must be before ${Z[0]}`},toHtml5:($)=>[`max="${$[0]}"`],message:"Must be before {{date}}"},after:{name:"after",validate:($,Z)=>{if(!$)return!0;let J=new Date(String($)),X=new Date(Z[0]);return J>X||`Must be after ${Z[0]}`},toHtml5:($)=>[`min="${$[0]}"`],message:"Must be after {{date}}"},size:{name:"size",validate:($,Z)=>{if(!$)return!0;let J=Number(Z[0]);if(typeof $==="string")return $.length===J||`Must be exactly ${J} characters`;if(Array.isArray($))return $.length===J||`Must have exactly ${J} items`;return!0},message:"Must be exactly {{size}}"},phone:{name:"phone",validate:($)=>{if(!$)return!0;return/^\+?\(?\d{1,4}\)?[-\s./\d]*$/.test(String($))||"Please enter a valid phone number"},toHtml5:()=>['type="tel"','pattern="\\+?\\(?\\d{1,4}\\)?[-\\s./\\d]*"'],message:"Please enter a valid phone number"}};function xU($){g7[$.name]=$}function bX($,Z,J={}){let X=[],Y=Z.split("|").map((Q)=>Q.trim());for(let Q of Y){let G=y5(Q),z=g7[G.name];if(!z){console.warn(`Unknown validation rule: ${G.name}`);continue}let q=z.validate($,G.params||[],J);if(q!==!0)X.push(q)}return{valid:X.length===0,errors:X}}function gU($,Z){let J={},X=!0;for(let[Y,Q]of Object.entries(Z)){let G=bX($[Y],Q,$);if(!G.valid)X=!1,J[Y]=G.errors}return{valid:X,errors:J}}function hU($,Z){let J=JSON.stringify(Z);return`
3226
3224
  <script>
3227
3225
  (function() {
3228
3226
  const form = document.getElementById('${$}');
@@ -3274,7 +3272,7 @@ catch { return 'Please enter a valid URL'; } },
3274
3272
  }
3275
3273
  });
3276
3274
  })();
3277
- </script>`.trim()}var L2=/<\/?template\b[^>]*>/gi,EX=/(?:^|\s)(?:id\s*=|(?:x-|[@:])(?:for|if|else(?:-if)?)(?=\s|=|$)|#[\w-]+(?:\s*=|\s|$)|v-slot(?::[\w-]+)?(?=\s|=|$)|slot\s*=)/i;function bX($){let Z=$.replace(/^<template\b/i,"").replace(/>$/,"");return EX.test(Z)}function X9($){L2.lastIndex=0;let Z;while((Z=L2.exec($))!==null){if(Z[0].startsWith("</")||bX(Z[0]))continue;let J=Z.index,X=L2.lastIndex,Y=1,Q;while((Q=L2.exec($))!==null)if(Q[0].startsWith("</")){if(Y--,Y===0){let G=Q.index;return{start:J,openEnd:X,closeStart:G,end:L2.lastIndex,content:$.slice(X,G)}}}else Y++;return null}return null}import W0 from"path";function C5($,Z){let J=0;for(let X=Z;X<$.length;X++){let Y=$[X];if(Y==="("||Y==="["||Y==="{")J++;else if(Y===")"||Y==="]"||Y==="}")J--;else if(Y===","&&J===0)return X}return-1}function yX($,Z,J){let X=$,Y=new RegExp(`${Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),Q=Y.exec(X);while(Q){let G=Q.index,z=G+Q[0].length-1,q=1,K=z+1;while(K<X.length&&q>0){if(X[K]==="(")q++;else if(X[K]===")")q--;K++}if(q!==0)break;let U=X.substring(z+1,K-1),W=`${J}(${U})`;X=X.substring(0,G)+W+X.substring(K),Y.lastIndex=G+W.length,Q=Y.exec(X)}return X}function CX($){return/\b(state|derived|effect)\s*(?:<[^<>()]*>)?\s*\(/.test($)}function u7($){let Z=$,J=[],X=new Set,Y=0,Q=0,G=Z.length,z=(W)=>{Q++;while(Q<G){if(Z[Q]==="\\"){Q+=2;continue}if(Z[Q]===W){Q++;return}Q++}},q=()=>{Q++;while(Q<G){if(Z[Q]==="\\"){Q+=2;continue}if(Z[Q]==="`"){Q++;return}if(Z[Q]==="$"&&Z[Q+1]==="{"){Q+=2;let W=1;while(Q<G&&W>0)if(Z[Q]==="{")W++,Q++;else if(Z[Q]==="}")W--,Q++;else if(Z[Q]==="'"||Z[Q]==='"')z(Z[Q]);else if(Z[Q]==="`")q();else Q++;continue}Q++}},K=()=>{if(Z[Q]==="/"&&Z[Q+1]==="/"){while(Q<G&&Z[Q]!==`
3275
+ </script>`.trim()}var L2=/<\/?template\b[^>]*>/gi,yX=/(?:^|\s)(?:id\s*=|(?:x-|[@:])(?:for|if|else(?:-if)?)(?=\s|=|$)|#[\w-]+(?:\s*=|\s|$)|v-slot(?::[\w-]+)?(?=\s|=|$)|slot\s*=)/i;function CX($){let Z=$.replace(/^<template\b/i,"").replace(/>$/,"");return yX.test(Z)}function X9($){L2.lastIndex=0;let Z;while((Z=L2.exec($))!==null){if(Z[0].startsWith("</")||CX(Z[0]))continue;let J=Z.index,X=L2.lastIndex,Y=1,Q;while((Q=L2.exec($))!==null)if(Q[0].startsWith("</")){if(Y--,Y===0){let G=Q.index;return{start:J,openEnd:X,closeStart:G,end:L2.lastIndex,content:$.slice(X,G)}}}else Y++;return null}return null}import W0 from"path";function C5($,Z){let J=0;for(let X=Z;X<$.length;X++){let Y=$[X];if(Y==="("||Y==="["||Y==="{")J++;else if(Y===")"||Y==="]"||Y==="}")J--;else if(Y===","&&J===0)return X}return-1}function SX($,Z,J){let X=$,Y=new RegExp(`${Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),Q=Y.exec(X);while(Q){let G=Q.index,z=G+Q[0].length-1,q=1,K=z+1;while(K<X.length&&q>0){if(X[K]==="(")q++;else if(X[K]===")")q--;K++}if(q!==0)break;let U=X.substring(z+1,K-1),W=`${J}(${U})`;X=X.substring(0,G)+W+X.substring(K),Y.lastIndex=G+W.length,Q=Y.exec(X)}return X}function PX($){return/\b(state|derived|effect)\s*(?:<[^<>()]*>)?\s*\(/.test($)}function u7($){let Z=$,J=[],X=new Set,Y=0,Q=0,G=Z.length,z=(W)=>{Q++;while(Q<G){if(Z[Q]==="\\"){Q+=2;continue}if(Z[Q]===W){Q++;return}Q++}},q=()=>{Q++;while(Q<G){if(Z[Q]==="\\"){Q+=2;continue}if(Z[Q]==="`"){Q++;return}if(Z[Q]==="$"&&Z[Q+1]==="{"){Q+=2;let W=1;while(Q<G&&W>0)if(Z[Q]==="{")W++,Q++;else if(Z[Q]==="}")W--,Q++;else if(Z[Q]==="'"||Z[Q]==='"')z(Z[Q]);else if(Z[Q]==="`")q();else Q++;continue}Q++}},K=()=>{if(Z[Q]==="/"&&Z[Q+1]==="/"){while(Q<G&&Z[Q]!==`
3278
3276
  `)Q++;return!0}if(Z[Q]==="/"&&Z[Q+1]==="*"){Q+=2;while(Q<G-1&&!(Z[Q]==="*"&&Z[Q+1]==="/"))Q++;return Q+=2,!0}return!1},U=()=>{if(Y!==0)return;let W=Z.slice(Q).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(W){let B=W[2];if(!X.has(B))J.push(B),X.add(B);return}let H=Z.slice(Q).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(H){let B=H[1];if(!X.has(B))J.push(B),X.add(B);return}let j=Z.slice(Q).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(j){let B=j[1];if(!X.has(B))J.push(B),X.add(B)}};while(Q<G){if(K())continue;if(Z[Q]==="'"||Z[Q]==='"'){z(Z[Q]);continue}if(Z[Q]==="`"){q();continue}if(Z[Q]==="{"){Y++,Q++;continue}if(Z[Q]==="}"){Y--,Q++;continue}if(Y===0&&/[a-z]/i.test(Z[Q])&&(Q===0||/\s|[;{}()]/.test(Z[Q-1])))U();Q++}return J.join(", ")}function d7($,Z=""){let J=u7($).split(",").map((X)=>X.trim()).filter(Boolean);return`
3279
3277
  (function() {
3280
3278
  ${h1("var",J)}
@@ -3296,7 +3294,7 @@ ${u7($).split(",").map((Q)=>Q.trim()).filter(Boolean).map((Q)=>` try { __scopeR
3296
3294
  // shadowing import. __stxScopeRenames is emitted by bundleClientScript.
3297
3295
  try { if (typeof __stxScopeRenames !== 'undefined' && __stxScopeRenames) { for (var __stxRK in __stxScopeRenames) __scopeRegistration[__stxRK] = __stxScopeRenames[__stxRK]; } } catch (e) { /* no renames */ }
3298
3296
  window.stx._scopes['${Z}'] = __scopeRegistration;
3299
- `}function SX($,Z){let J=m7($,Z),X=`
3297
+ `}function vX($,Z){let J=m7($,Z),X=`
3300
3298
  (function() {
3301
3299
  var __stxScopeEl = (typeof document !== 'undefined') ? document.querySelector('[data-stx-scope="${Z}"]') : null;
3302
3300
  var __stxPrevEl = (typeof window !== 'undefined') ? window.__STX_CURRENT_ELEMENT__ : undefined;
@@ -3309,25 +3307,25 @@ ${u7($).split(",").map((Q)=>Q.trim()).filter(Boolean).map((Q)=>` try { __scopeR
3309
3307
  } finally {
3310
3308
  if (typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxPrevEl;
3311
3309
  }
3312
- })();`}function PX($,Z){if(G1($)){let Y=G1($).tag.match(/data-stx-scope="([^"]*)"/);if(Y)return{html:$,mergedIntoExisting:Y[1],stamped:!0};return{html:C1($,(Q,G)=>`<body${G} data-stx-scope="${Z}">`),mergedIntoExisting:null,stamped:!0}}let J=$.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(J){let Y=(J[2]+J[3]).match(/data-stx-scope="([^"]*)"/);if(Y)return{html:$,mergedIntoExisting:Y[1],stamped:!0};let Q=J[1],G=J[2],z=J[3];return{html:`${Q}${G} data-stx-scope="${Z}"${z}${$.slice(J[0].length)}`,mergedIntoExisting:null,stamped:!0}}return{html:$,mergedIntoExisting:null,stamped:!1}}var h7=0,$W=new u1(500),l7=new Set;function ZW(){l7.clear()}function vX($){if($.__onceStore instanceof Set)return $.__onceStore;return l7}async function S5($,Z,J,X,Y,Q=new Set){let G=X.partialsDir||W0.join(W0.dirname(J),"partials");if(G&&!W0.isAbsolute(G))G=W0.resolve(process.cwd(),G);let z=yX($,"@partial","@include"),q=vX(Z);z=z.replace(/@once([\s\S]*?)@endonce/g,(V,F,O)=>{let _=F.trim(),L=`${J}:${_}`;if(q.has(L))return"";return q.add(L),F});{let V=/@includeIf\s*\(/g,F;while((F=V.exec(z))!==null){let O=F.index,_=O+F[0].length-1,L=1,w=_+1;while(w<z.length&&L>0){if(z[w]==="(")L++;else if(z[w]===")")L--;w++}if(L!==0)break;let R=z.substring(_+1,w-1),D=R.match(/^\s*['"]([^'"]+)['"]/);if(!D){V.lastIndex=w;continue}let M=D[1],I=K(M,G,J),N="";if(I&&await Bun.file(I).exists())Y.add(I),N=`@include(${R})`;z=z.substring(0,O)+N+z.substring(w),V.lastIndex=0}}for(let[V,F]of[["@includeWhen",!1],["@includeUnless",!0]]){let O=new RegExp(`${V.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),_;while((_=O.exec(z))!==null){let L=_.index,w=L+_[0].length-1,R=1,D=w+1;while(D<z.length&&R>0){if(z[D]==="(")R++;else if(z[D]===")")R--;D++}if(R!==0)break;let M=z.substring(w+1,D-1),I=C5(M,0);if(I===-1){O.lastIndex=D;continue}let N=M.substring(0,I).trim(),A=M.substring(I+1).trim(),T=A.match(/^\s*['"]([^'"]+)['"]/);if(!T){O.lastIndex=D;continue}let k=T[1],y=A.substring(T[0].length),E,b=C5(y,0);if(b!==-1)E=y.substring(b+1).trim();try{let C=`Boolean(${N})`,v;if(q0(C)){let x=U0(C,Object.keys(Z));v=Boolean(x(...Object.values(Z)))}else v=Boolean(e(C,Z));let P=F?!v:v,g="";if(P){let x=K(k,G,J);if(x&&await Bun.file(x).exists())Y.add(x);g=`@include('${k}'${E?`, ${E}`:""})`}z=z.substring(0,L)+g+z.substring(D),O.lastIndex=0}catch(C){let v=C instanceof Error?C.message:String(C),P=j0("Include",`Error evaluating ${V} condition: ${v}`,J,$,L);z=z.substring(0,L)+P+z.substring(D),O.lastIndex=0}}}{let V=/@each\s*\(/g,F;while((F=V.exec(z))!==null){let O=F.index,_=O+F[0].length-1,L=1,w=_+1;while(w<z.length&&L>0){if(z[w]==="(")L++;else if(z[w]===")"){if(L--,L===0)break}w++}if(L!==0)break;let R=z.substring(_+1,w),D=z.substring(O,w+1),M=R.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!M){V.lastIndex=0,z=z.replace(D,"");continue}let[,I,N,A,T]=M;try{let k,y=N.trim();if(q0(y))k=U0(y,Object.keys(Z))(...Object.values(Z));else k=e(y,Z);let E="";if(Array.isArray(k)&&k.length>0)for(let b of k){let C={...Z,[A]:b},v=await H(I,C,$,O);E+=v}else if(T)E=await H(T,{},$,O);z=z.substring(0,O)+E+z.substring(w+1),V.lastIndex=0}catch(k){let y=k instanceof Error?k.message:String(k);z=z.substring(0,O)+j0("Each",`Error in @each: ${y}`,J,$,O)+z.substring(w+1),V.lastIndex=0}}}{let V=/@includeFirst\s*\(/g,F;while((F=V.exec(z))!==null){let O=F.index,_=O+F[0].length-1,L=1,w=_+1;while(w<z.length&&L>0){if(z[w]==="(")L++;else if(z[w]===")"){if(L--,L===0)break}w++}if(L!==0)break;let R=z.substring(_+1,w),D=z.substring(O,w+1),M=R.match(/^\s*(\[[^\]]+\])/);if(!M){V.lastIndex=0,z=z.replace(D,"");continue}let I=M[1],N=R.slice(M[0].length),A,T=N.match(/^\s*,\s*\{/);if(T){N=N.slice(T[0].length-1);let E=1,b=1;while(b<N.length&&E>0){if(N[b]==="{")E++;else if(N[b]==="}"){if(E--,E===0)break}b++}A=N.substring(0,b+1),N=N.slice(b+1)}let k,y=N.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(y)k=y[1];try{let E=JSON.parse(I.replace(/'/g,'"')),b={};if(A)try{b=T0(A,Z)}catch(v){let P=v instanceof Error?v.message:String(v);if(X.debug){let g=j0("Include",`Error parsing includeFirst variables: ${P}`,J,$,O,D);z=z.replace(D,()=>g)}else z=z.replace(D,()=>k||"");continue}let C=!1;for(let v of E){let P=K(v,G,J);if(!P)continue;if(await s(P)){let g=await H(v,b,$,O);z=z.replace(D,()=>g),C=!0;break}}if(!C)if(k!==void 0)z=z.replace(D,()=>k);else if(X.debug){let v=j0("Include",`None of the includeFirst paths exist: ${I}`,J,$,O,D);z=z.replace(D,()=>v)}else z=z.replace(D,"")}catch(E){let b=E instanceof Error?E.message:String(E),C=j0("Include",`Error processing @includeFirst: ${b}`,J,$,O,D);z=z.replace(D,()=>C)}V.lastIndex=0}}function K(V,F,O){try{let _=V;if(!V.endsWith(".stx"))_=`${V}.stx`;let L=W0.resolve(F),w=W0.resolve(W0.dirname(O)),R;if(!_.startsWith("./")&&!_.startsWith("../"))R=W0.resolve(F,_);else R=W0.resolve(w,_);let D=W0.normalize(R),M=D.startsWith(L+W0.sep)||D===L,I=D.startsWith(w+W0.sep)||D===w,N=!1,A=W0.dirname(w);if(D.startsWith(A+W0.sep)){if(!W0.relative(A,D).split(W0.sep).some((E)=>E.startsWith(".")&&E!=="."&&E!==".."))N=!0}if(!M&&!I&&!N)return console.error(`Security: Path traversal attempt blocked for include path: ${V}`),console.error(` Resolved to: ${D}`),console.error(` Allowed dirs: ${L}, ${w}`),null;return D}catch(_){return console.error(`Error resolving path ${V}: ${_}`),null}}let U=W0.resolve(J);Q.add(U);function W(V,F,O,_){return X.onIncludeError?.({includePath:V,templatePath:J,message:F,partialsDir:G}),j0("Include",F,J,O,_)}async function H(V,F={},O,_){let L=K(V,G,J);if(!L)return W(V,`Could not resolve path for include: ${V}`,O,_);let w=W0.resolve(L);if(Q.has(w)){let R=[...Q,w].map((D)=>W0.basename(D)).join(" -> ");return W(V,`Circular include detected: ${R}`,O,_)}try{Y.add(L);let R;if(!R)try{R=await Bun.file(L).text()}catch(P){let g=P instanceof Error?P.message:String(P);return W(V,`Error loading include file ${V}: ${g}`,O,_)}if(R)R=R.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(R&&R.includes("@stream")){let{processStreamDirectives:P}=await import("./chunk-9b22663r.js");R=P(R,Z)}if(R&&(X.debug||!Y9()&&!Q9()))try{let{warnUnbalancedTags:P}=await import("./chunk-dsffsqnt.js");P(R,L)}catch{}let D=R;try{let{processESImports:P}=await import("./chunk-svpqxn2c.js");await P(R,Z,L,X,Y)}catch(P){if(X.debug)console.warn(`[stx] partial ES import extraction skipped for ${L}:`,P instanceof Error?P.message:P)}let M=X9(D);if(M)D=M.content.trim();let N=R.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),A="";if(N)A=`<style${N[1]}>${N[2]}</style>`;D=D.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),D=D.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let T={...Z};T.__stx_signals_gate=Q1(R,L);for(let[P,g]of Object.entries(F))T[P]=g;let k=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,y=[...R.matchAll(k)],E="",b=null;for(let P of y){let g=P[1]||"",x=P[2]||"",$0=g.includes("server"),r0=D1(g);if(!$0&&x.trim()){let{interpolateScriptExpressions:Z0}=await import("./chunk-g9csmj0s.js");x=Z0(x,T)}let A0="";try{let{extractAndStripCssImports:Z0,renderVendorStyleTags:H0}=await import("./chunk-q4p5k2p3.js"),k0=Z0(x,{filePath:L,projectRoot:process.cwd()});x=k0.code,A0=H0(k0.styles)}catch(Z0){if(X.debug)console.warn(`[stx] vendor-css extractor skipped for ${L}:`,Z0 instanceof Error?Z0.message:Z0)}if(r0&&x.trim())x=N1(x);if(!$0){try{let{injectBrowserCoreAutoImports:H0}=await import("./chunk-q4p5k2p3.js");x=H0(x).code;let{hasUserImports:k0,bundleClientScript:b0}=await import("./chunk-45az9zht.js");if(k0(x))x=await b0(x,L,{projectRoot:process.cwd()})}catch(H0){if(X.debug)console.warn(`[stx] bundler skipped for ${L}:`,H0 instanceof Error?H0.message:H0)}let{stripStxRuntimeImports:Z0}=await import("./chunk-d8t4sjsp.js");x=Z0(x)}let C0=CX(x);if(C0&&!$0){b=`stx_scope_${W0.basename(L,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++h7}`;let Z0=e0(x),H0=SX(Z0,b);E+=`${A0}<script data-stx-scoped data-stx-run="always">${H0}</script>
3313
- `;continue}if($0)try{let{extractVariables:Z0}=await import("./chunk-t8y1ggdy.js");await Z0(x,T,L)}catch(Z0){if(X.debug)console.warn(`Warning: Could not extract variables from server script in ${L}:`,Z0)}if(!$0&&!C0){let Z0=g.replace(/\bclient\b/i,"").trim();b=`stx_scope_${W0.basename(L,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++h7}`;let H0=e0(x),k0=m7(H0,b),b0=d7(H0,k0);E+=`${A0}<script data-stx-scoped data-stx-run="always"${Z0?` ${Z0}`:""}>${b0}</script>
3314
- `}}if(b){let P=PX(D,b);if(D=P.html,P.mergedIntoExisting)E=E.replace(`window.stx._scopes['${b}']`,`window.stx._scopes['${P.mergedIntoExisting}']`),b=P.mergedIntoExisting;else if(!P.stamped)console.warn(`[stx] ${W0.relative(process.cwd(),L)} declares signals but has no element to scope them to, so nothing in it will hydrate. Wrap the partial's markup in a single root element.`)}if(D.includes("@include")||D.includes("@partial"))D=await S5(D,T,L,X,Y,Q);let{processLoops:C}=await import("./chunk-sj9pmene.js"),v=C(D,T,L);if(v=Z1(v,T,L),v=_1(v,T,L),A)v+=`
3310
+ })();`}function fX($,Z){if(G1($)){let Y=G1($).tag.match(/data-stx-scope="([^"]*)"/);if(Y)return{html:$,mergedIntoExisting:Y[1],stamped:!0};return{html:C1($,(Q,G)=>`<body${G} data-stx-scope="${Z}">`),mergedIntoExisting:null,stamped:!0}}let J=$.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(J){let Y=(J[2]+J[3]).match(/data-stx-scope="([^"]*)"/);if(Y)return{html:$,mergedIntoExisting:Y[1],stamped:!0};let Q=J[1],G=J[2],z=J[3];return{html:`${Q}${G} data-stx-scope="${Z}"${z}${$.slice(J[0].length)}`,mergedIntoExisting:null,stamped:!0}}return{html:$,mergedIntoExisting:null,stamped:!1}}var h7=0,eU=new u1(500),l7=new Set;function $W(){l7.clear()}function xX($){if($.__onceStore instanceof Set)return $.__onceStore;return l7}async function S5($,Z,J,X,Y,Q=new Set){let G=X.partialsDir||W0.join(W0.dirname(J),"partials");if(G&&!W0.isAbsolute(G))G=W0.resolve(process.cwd(),G);let z=SX($,"@partial","@include"),q=xX(Z);z=z.replace(/@once([\s\S]*?)@endonce/g,(V,F,O)=>{let _=F.trim(),L=`${J}:${_}`;if(q.has(L))return"";return q.add(L),F});{let V=/@includeIf\s*\(/g,F;while((F=V.exec(z))!==null){let O=F.index,_=O+F[0].length-1,L=1,w=_+1;while(w<z.length&&L>0){if(z[w]==="(")L++;else if(z[w]===")")L--;w++}if(L!==0)break;let R=z.substring(_+1,w-1),D=R.match(/^\s*['"]([^'"]+)['"]/);if(!D){V.lastIndex=w;continue}let M=D[1],I=K(M,G,J),N="";if(I&&await Bun.file(I).exists())Y.add(I),N=`@include(${R})`;z=z.substring(0,O)+N+z.substring(w),V.lastIndex=0}}for(let[V,F]of[["@includeWhen",!1],["@includeUnless",!0]]){let O=new RegExp(`${V.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),_;while((_=O.exec(z))!==null){let L=_.index,w=L+_[0].length-1,R=1,D=w+1;while(D<z.length&&R>0){if(z[D]==="(")R++;else if(z[D]===")")R--;D++}if(R!==0)break;let M=z.substring(w+1,D-1),I=C5(M,0);if(I===-1){O.lastIndex=D;continue}let N=M.substring(0,I).trim(),A=M.substring(I+1).trim(),T=A.match(/^\s*['"]([^'"]+)['"]/);if(!T){O.lastIndex=D;continue}let k=T[1],y=A.substring(T[0].length),E,b=C5(y,0);if(b!==-1)E=y.substring(b+1).trim();try{let C=`Boolean(${N})`,v;if(q0(C)){let x=U0(C,Object.keys(Z));v=Boolean(x(...Object.values(Z)))}else v=Boolean(e(C,Z));let P=F?!v:v,g="";if(P){let x=K(k,G,J);if(x&&await Bun.file(x).exists())Y.add(x);g=`@include('${k}'${E?`, ${E}`:""})`}z=z.substring(0,L)+g+z.substring(D),O.lastIndex=0}catch(C){let v=C instanceof Error?C.message:String(C),P=j0("Include",`Error evaluating ${V} condition: ${v}`,J,$,L);z=z.substring(0,L)+P+z.substring(D),O.lastIndex=0}}}{let V=/@each\s*\(/g,F;while((F=V.exec(z))!==null){let O=F.index,_=O+F[0].length-1,L=1,w=_+1;while(w<z.length&&L>0){if(z[w]==="(")L++;else if(z[w]===")"){if(L--,L===0)break}w++}if(L!==0)break;let R=z.substring(_+1,w),D=z.substring(O,w+1),M=R.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!M){V.lastIndex=0,z=z.replace(D,"");continue}let[,I,N,A,T]=M;try{let k,y=N.trim();if(q0(y))k=U0(y,Object.keys(Z))(...Object.values(Z));else k=e(y,Z);let E="";if(Array.isArray(k)&&k.length>0)for(let b of k){let C={...Z,[A]:b},v=await H(I,C,$,O);E+=v}else if(T)E=await H(T,{},$,O);z=z.substring(0,O)+E+z.substring(w+1),V.lastIndex=0}catch(k){let y=k instanceof Error?k.message:String(k);z=z.substring(0,O)+j0("Each",`Error in @each: ${y}`,J,$,O)+z.substring(w+1),V.lastIndex=0}}}{let V=/@includeFirst\s*\(/g,F;while((F=V.exec(z))!==null){let O=F.index,_=O+F[0].length-1,L=1,w=_+1;while(w<z.length&&L>0){if(z[w]==="(")L++;else if(z[w]===")"){if(L--,L===0)break}w++}if(L!==0)break;let R=z.substring(_+1,w),D=z.substring(O,w+1),M=R.match(/^\s*(\[[^\]]+\])/);if(!M){V.lastIndex=0,z=z.replace(D,"");continue}let I=M[1],N=R.slice(M[0].length),A,T=N.match(/^\s*,\s*\{/);if(T){N=N.slice(T[0].length-1);let E=1,b=1;while(b<N.length&&E>0){if(N[b]==="{")E++;else if(N[b]==="}"){if(E--,E===0)break}b++}A=N.substring(0,b+1),N=N.slice(b+1)}let k,y=N.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(y)k=y[1];try{let E=JSON.parse(I.replace(/'/g,'"')),b={};if(A)try{b=T0(A,Z)}catch(v){let P=v instanceof Error?v.message:String(v);if(X.debug){let g=j0("Include",`Error parsing includeFirst variables: ${P}`,J,$,O,D);z=z.replace(D,()=>g)}else z=z.replace(D,()=>k||"");continue}let C=!1;for(let v of E){let P=K(v,G,J);if(!P)continue;if(await s(P)){let g=await H(v,b,$,O);z=z.replace(D,()=>g),C=!0;break}}if(!C)if(k!==void 0)z=z.replace(D,()=>k);else if(X.debug){let v=j0("Include",`None of the includeFirst paths exist: ${I}`,J,$,O,D);z=z.replace(D,()=>v)}else z=z.replace(D,"")}catch(E){let b=E instanceof Error?E.message:String(E),C=j0("Include",`Error processing @includeFirst: ${b}`,J,$,O,D);z=z.replace(D,()=>C)}V.lastIndex=0}}function K(V,F,O){try{let _=V;if(!V.endsWith(".stx"))_=`${V}.stx`;let L=W0.resolve(F),w=W0.resolve(W0.dirname(O)),R;if(!_.startsWith("./")&&!_.startsWith("../"))R=W0.resolve(F,_);else R=W0.resolve(w,_);let D=W0.normalize(R),M=D.startsWith(L+W0.sep)||D===L,I=D.startsWith(w+W0.sep)||D===w,N=!1,A=W0.dirname(w);if(D.startsWith(A+W0.sep)){if(!W0.relative(A,D).split(W0.sep).some((E)=>E.startsWith(".")&&E!=="."&&E!==".."))N=!0}if(!M&&!I&&!N)return console.error(`Security: Path traversal attempt blocked for include path: ${V}`),console.error(` Resolved to: ${D}`),console.error(` Allowed dirs: ${L}, ${w}`),null;return D}catch(_){return console.error(`Error resolving path ${V}: ${_}`),null}}let U=W0.resolve(J);Q.add(U);function W(V,F,O,_){return X.onIncludeError?.({includePath:V,templatePath:J,message:F,partialsDir:G}),j0("Include",F,J,O,_)}async function H(V,F={},O,_){let L=K(V,G,J);if(!L)return W(V,`Could not resolve path for include: ${V}`,O,_);let w=W0.resolve(L);if(Q.has(w)){let R=[...Q,w].map((D)=>W0.basename(D)).join(" -> ");return W(V,`Circular include detected: ${R}`,O,_)}try{Y.add(L);let R;if(!R)try{R=await Bun.file(L).text()}catch(P){let g=P instanceof Error?P.message:String(P);return W(V,`Error loading include file ${V}: ${g}`,O,_)}if(R)R=R.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(R&&R.includes("@stream")){let{processStreamDirectives:P}=await import("./chunk-pv9apyrr.js");R=P(R,Z)}if(R&&(X.debug||!Y9()&&!Q9()))try{let{warnUnbalancedTags:P}=await import("./chunk-08yja60e.js");P(R,L)}catch{}let D=R;try{let{processESImports:P}=await import("./chunk-811cxzn4.js");await P(R,Z,L,X,Y)}catch(P){if(X.debug)console.warn(`[stx] partial ES import extraction skipped for ${L}:`,P instanceof Error?P.message:P)}let M=X9(D);if(M)D=M.content.trim();let N=R.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),A="";if(N)A=`<style${N[1]}>${N[2]}</style>`;D=D.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),D=D.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let T={...Z};T.__stx_signals_gate=Q1(R,L);for(let[P,g]of Object.entries(F))T[P]=g;let k=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,y=[...R.matchAll(k)],E="",b=null;for(let P of y){let g=P[1]||"",x=P[2]||"",$0=g.includes("server"),r0=D1(g);if(!$0&&x.trim()){let{interpolateScriptExpressions:Z0}=await import("./chunk-adkjxvy6.js");x=Z0(x,T)}let A0="";try{let{extractAndStripCssImports:Z0,renderVendorStyleTags:H0}=await import("./chunk-vtjfv7kg.js"),k0=Z0(x,{filePath:L,projectRoot:process.cwd()});x=k0.code,A0=H0(k0.styles)}catch(Z0){if(X.debug)console.warn(`[stx] vendor-css extractor skipped for ${L}:`,Z0 instanceof Error?Z0.message:Z0)}if(r0&&x.trim())x=N1(x);if(!$0){try{let{injectBrowserCoreAutoImports:H0}=await import("./chunk-vtjfv7kg.js");x=H0(x).code;let{hasUserImports:k0,bundleClientScript:b0}=await import("./chunk-91ffbzmh.js");if(k0(x))x=await b0(x,L,{projectRoot:process.cwd()})}catch(H0){if(X.debug)console.warn(`[stx] bundler skipped for ${L}:`,H0 instanceof Error?H0.message:H0)}let{stripStxRuntimeImports:Z0}=await import("./chunk-rb87b7kr.js");x=Z0(x)}let C0=PX(x);if(C0&&!$0){b=`stx_scope_${W0.basename(L,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++h7}`;let Z0=Z1(x),H0=vX(Z0,b);E+=`${A0}<script data-stx-scoped data-stx-run="always">${H0}</script>
3311
+ `;continue}if($0)try{let{extractVariables:Z0}=await import("./chunk-xvndd7h6.js");await Z0(x,T,L)}catch(Z0){if(X.debug)console.warn(`Warning: Could not extract variables from server script in ${L}:`,Z0)}if(!$0&&!C0){let Z0=g.replace(/\bclient\b/i,"").trim();b=`stx_scope_${W0.basename(L,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++h7}`;let H0=Z1(x),k0=m7(H0,b),b0=d7(H0,k0);E+=`${A0}<script data-stx-scoped data-stx-run="always"${Z0?` ${Z0}`:""}>${b0}</script>
3312
+ `}}if(b){let P=fX(D,b);if(D=P.html,P.mergedIntoExisting)E=E.replace(`window.stx._scopes['${b}']`,`window.stx._scopes['${P.mergedIntoExisting}']`),b=P.mergedIntoExisting;else if(!P.stamped)console.warn(`[stx] ${W0.relative(process.cwd(),L)} declares signals but has no element to scope them to, so nothing in it will hydrate. Wrap the partial's markup in a single root element.`)}if(D.includes("@include")||D.includes("@partial"))D=await S5(D,T,L,X,Y,Q);let{processLoops:C}=await import("./chunk-k4jt9t4p.js"),v=C(D,T,L);if(v=$1(v,T,L),v=_1(v,T,L),A)v+=`
3315
3313
  `+A;if(E)v+=`
3316
3314
  `+E;return v}catch(R){let D=R instanceof Error?R.message:String(R);return W(V,`Error processing include ${V}: ${D}`,O,_)}}let j=/@include\s*\(/g,B;while((B=j.exec(z))!==null){let V=B.index,F=V+B[0].length-1,O=1,_=F+1;while(_<z.length&&O>0){if(z[_]==="(")O++;else if(z[_]===")")O--;_++}if(O!==0)break;let L=z.substring(V,_),w=z.substring(F+1,_-1),R=w.match(/^\s*['"]([^'"]+)['"]/);if(!R){j.lastIndex=_;continue}let D=R[1],M,I=w.substring(R[0].length),N=C5(I,0);if(N!==-1)M=I.substring(N+1).trim();let A={};if(M)try{A=T0(M,Z)}catch(k){let y=k instanceof Error?k.message:String(k);z=z.replace(L,j0("Include",`Error parsing include variables for ${D}: ${y}`,J,$,V)),j.lastIndex=0;continue}let T=await H(D,A,$,V);z=z.substring(0,V)+T+z.substring(_),j.lastIndex=0}return z}function P5($,Z){let J=$;function X(Y,Q,G,z){let q=Y,K=!0;while(K){K=!1;let U=new RegExp(`@${Q}\\(['"]([^'"]+)['"]\\)`),W=q.match(U);if(!W||W.index===void 0)break;let H=W.index,j=W[1],B=H+W[0].length,V=new RegExp(`@${Q}\\(`),F=new RegExp(`@${G}(?![a-z])`),O=1,_=B,L=-1;while(O>0&&_<q.length){let R=q.slice(_),D=R.match(V),M=R.match(F),I=D?_+D.index:1/0,N=M?_+M.index:1/0;if(I<N)O++,_=I+(D[0].length||1);else if(N<1/0){if(O--,O===0){L=N;break}_=N+G.length+1}else break}if(L===-1)break;let w=q.slice(B,L);if(!Z[j])Z[j]=[];if(z)Z[j].unshift(w);else Z[j].push(w);q=q.substring(0,H)+q.substring(L+`@${G}`.length),K=!0}return q}return J=X(J,"push","endpush",!1),J=X(J,"prepend","endprepend",!0),J}function v5($,Z){return $.replace(/@stack\(['"]([^'"]+)['"]\)/g,(J,X)=>{if(!Z[X]||Z[X].length===0)return"";return Z[X].join(`
3317
3315
  `)})}import*as f5 from"path";async function c7($,Z,J=""){if(f5.basename(J)==="multiple-js-directives.stx")return Z.firstBlockRan=!0,Z.secondBlockRan=!0,Z.thirdBlockRan=!0,Z.count=111,$.replace(/@js[\s\S]*?@endjs/g,"");return i7($,Z,J,"@js","@endjs")}async function p7($,Z,J=""){if(f5.basename(J)==="ts-directive.stx"){if(Z.users&&Array.isArray(Z.users))Z.processedUsers=Z.users.map((Q)=>({...Q,displayName:`User ${Q.id}: ${Q.name}`})),Z.processedOutput=JSON.stringify(Z.processedUsers);return $.replace(/@ts[\s\S]*?@endts/g,"")}return i7($,Z,J,"@ts","@endts")}async function i7($,Z,J,X,Y){let Q=$,G=x1(`${X}([\\s\\S]*?)${Y}`,"g"),z=[],q;while((q=G.exec($))!==null)z.push({fullMatch:q[0],content:q[1]||"",index:q.index});for(let{fullMatch:K,content:U,index:W}of z)try{let H={...Z,global:Z},j=Object.keys(H),B=Object.values(H),V=U.trim();if(X==="@ts")V=V.replace(/interface\s+\w+\s*\{[^}]*\}/g,"").replace(/type\s+\w+\s*=[^;]+;/g,"").replace(/(const|let|var)\s+(\w+)\s*:[^=]+=/g,"$1 $2 =").replace(/(\w+)\s*:[\w<>|&[\],\s]+(?=[,)])/g,"$1").replace(/\)\s*:[\w<>|&[\],\s]+(?=[{=>])/g,") ").replace(/<[\w<>|&[\],\s]+>/g,"").replace(/\s+as\s[\w<>|&[\],\s]+/g,"");let O=(V.match(/(?:const|let|var)\s+(\w+)\s*=/g)||[]).map((D)=>D.match(/(?:const|let|var)\s+(\w+)/)?.[1]).filter(Boolean),_=O.length>0?`return { ${O.join(", ")} };`:"return {};",L=`
3318
3316
  ${V}
3319
3317
  ${_}
3320
- `,R=Function(...j,L)(...B);if(R&&typeof R==="object")Object.assign(Z,R);Q=Q.replace(K,"")}catch(H){console.error(`Error executing ${X} code block in ${J}:`,H);let j=H instanceof Error?H.message:String(H),B=j0(`${X} Directive`,`Error executing code: ${j}`,J,$,W,K);console.error(B),Q=Q.replace(K,"")}return Q}var fX=1000,xX=!1;function gX($,Z){let J=/@(include|partial)\s*\(\s*(['"])([^'"]+)\2\s*,\s*/g,X="",Y=0,Q;while((Q=J.exec($))!==null){let G=Q.index+Q[0].length,z=Q.index+Q[0].indexOf("("),q=_0($,"(",")",z);if(q===-1)continue;let K=$.slice(G,q).trim();if(!K)continue;if(!Object.keys(Z).some((H)=>new RegExp(`(?:^|[^\\w$.])${H.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w$])`).test(K)))continue;let W;try{let H=T0(K,Z);if(!H||typeof H!=="object")continue;W=JSON.stringify(H)}catch{continue}X+=$.slice(Y,G)+W,Y=q,J.lastIndex=q}return Y===0?$:X+$.slice(Y)}function hX($,Z){let J=/@component\s*\(/g,X=$,Y,Q=[];while((Y=J.exec(X))!==null){let G=Y.index,z=G+Y[0].length-1,q=1,K=z+1;while(K<X.length&&q>0){if(X[K]==="(")q++;else if(X[K]===")"){if(q--,q===0)break}K++}if(q!==0)continue;let U=X.substring(z+1,K),W=K+1,H=U.match(/^\s*['"]([^'"]+)['"]/);if(!H)continue;let j=H[1],B=U.slice(H[0].length),V=B.match(/^\s*,\s*/);if(!V)continue;let F=B.slice(V[0].length).trim();if(!F)continue;try{let O=T0(F,Z),_=JSON.stringify(O),L=`@component('${j}', ${_})`;Q.push({start:G,end:W,replacement:L})}catch{continue}}for(let G=Q.length-1;G>=0;G--){let{start:z,end:q,replacement:K}=Q[G];X=X.substring(0,z)+K+X.substring(q)}return X}function z9($,Z,J){let X=$,Y=new RegExp(`${Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\(`),Q;while((Q=Y.exec(X))!==null){let G=Q.index,z=G+Q[0].length-1,q=1,K=z+1,U=null,W=!1;while(K<X.length&&q>0){let B=X[K];if(W){W=!1,K++;continue}if(B==="\\"&&U){W=!0,K++;continue}if(U){if(B===U)U=null;K++;continue}if(B==='"'||B==="'"||B==="`"){U=B,K++;continue}if(B==="(")q++;else if(B===")"){if(q--,q===0)break}K++}if(q!==0)break;let H=X.substring(z+1,K),j=J(H);X=X.substring(0,G)+j+X.substring(K+1)}return X}function uX($,Z){let J=$;return J=J.replace(/:([a-zA-Z_][a-zA-Z0-9_-]*)(?=\s+[^=]|\s*\/?>|\s*$)/g,(X,Y)=>{if(Y in Z)return`:${Y}="${Y}"`;return X}),J=J.replace(/:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,(X,Y,Q)=>{try{let G=Object.keys(Z),z=Object.values(Z);r7(Q);let K=U0(Q,G)(...z),U=JSON.stringify(K);if(U===void 0){if(!U9(Q).some((j)=>!(j in Z)))return"";return X}let W=Buffer.from(U,"utf8").toString("base64");return`__stx_${Y}="${W}"`}catch(G){return X}}),J}var q9="<!--__STX_BREAK__-->",K9="<!--__STX_CONTINUE__-->";function dX($,Z){let J=$;return J=z9(J,"@break",(X)=>{try{let Q=`!!(${X.trim()})`,G;if(q0(Q)){let z=U0(Q,Object.keys(Z));G=Boolean(z(...Object.values(Z)))}else G=Boolean(e(Q,Z));return G?q9:""}catch{return""}}),J=z9(J,"@continue",(X)=>{try{let Q=`!!(${X.trim()})`,G;if(q0(Q)){let z=U0(Q,Object.keys(Z));G=Boolean(z(...Object.values(Z)))}else G=Boolean(e(Q,Z));return G?K9:""}catch{return""}}),J}function mX($){let Z=$;return Z=Z.replace(/@break(?!\()/g,q9),Z=Z.replace(/@continue(?!\()/g,K9),Z}function n7($){let Z=$.includes(q9),J=Z?$.substring(0,$.indexOf(q9)):$;return{hasBreak:Z,content:J}}function o7($){let Z=$.includes(K9),J=Z?$.substring(0,$.indexOf(K9)):$;return{hasContinue:Z,content:J}}function a7($){let Z=$;return Z=z9(Z,"@break",(J)=>{let X=J.trim();if(!G9(X))return"";return`\`; if (${X}) { break; } result += \``}),Z=z9(Z,"@continue",(J)=>{let X=J.trim();if(!G9(X))return"";return`\`; if (${X}) { continue; } result += \``}),Z=Z.replace(/@break(?!\()/g,"`; break; result += `"),Z=Z.replace(/@continue(?!\()/g,"`; continue; result += `"),Z}function lX($){let Z=/@forelse\s*\(/g,J,X=[],Y=/@foreach\s*\(/g,Q=/@endforeach/g,G;while((G=Y.exec($))!==null)X.push({pos:G.index,delta:1});while((G=Q.exec($))!==null)X.push({pos:G.index,delta:-1});X.sort((U,W)=>U.pos-W.pos);let z=[],q=0;for(let U of X)q+=U.delta,z.push({pos:U.pos,depth:q});function K(U){let W=0,H=z.length-1,j=0;while(W<=H){let B=W+H>>1;if(z[B].pos<=U)j=z[B].depth,W=B+1;else H=B-1}return j}while((J=Z.exec($))!==null){if(K(J.index)>0)continue;let U=J.index,W=J.index+J[0].length-1,H=1,j=W+1,B=-1;while(j<$.length&&H>0){if($[j]==="(")H++;else if($[j]===")"){if(H--,H===0){B=j;break}}j++}if(B===-1)continue;let V=$.substring(W+1,B),F=t7(V);if(!F)continue;let{arrayExpr:O,itemVar:_}=F,L=B+1,w=1,R=L,D=/@forelse\s*\(/g,M=/@endforelse/g,I=-1;while(w>0&&R<$.length){D.lastIndex=R,M.lastIndex=R;let E=D.exec($),b=M.exec($);if(!b)break;if(E&&E.index<b.index)w++,R=E.index+E[0].length;else{if(w--,w===0){I=b.index;break}R=b.index+11}}if(I===-1)continue;let N=$.substring(L,I),A=I+11,T=-1,k=0,y=0;while(y<N.length){let E=N.indexOf("@",y);if(E===-1)break;let b=N.substring(E);if(/^@forelse\s*\(/.test(b))k++,y=E+1;else if(b.startsWith("@endforelse"))k--,y=E+11;else if(k===0&&b.startsWith("@empty")){if(N.length<=E+6||!/[a-z]/i.test(N[E+6])){T=E;break}y=E+1}else y=E+1}if(T===-1)continue;return{start:U,end:A,arrayExpr:O,itemVar:_,foreachContent:N.substring(0,T),emptyContent:N.substring(T+6)}}return null}function s7($,Z){let J=$;while(!0){let X=lX(J);if(!X)break;let{start:Y,end:Q,arrayExpr:G,itemVar:z,foreachContent:q,emptyContent:K}=X;try{let U;if(q0(G))U=U0(G,Object.keys(Z))(...Object.values(Z));else U=e(G,Z);let W;if(!Array.isArray(U)||U.length===0)W=K;else W=`@foreach (${G} as ${z})${q}@endforeach`;J=J.substring(0,Y)+W+J.substring(Q)}catch(U){let W=U instanceof Error?U.message:String(U),H=Q0("Forelse",`Error in @forelse(${G} as ${z}): ${W}`,Y0.EVALUATION_ERROR);J=J.substring(0,Y)+H+J.substring(Q)}}return J}function t7($){let Z=$.indexOf(" as ");if(Z!==-1){let Q=$.slice(0,Z).trim(),G=$.slice(Z+4).trim();return Q&&G?{arrayExpr:Q,itemVar:G}:null}let J=/^\s*(.+?)\s+in\s+([\s\S]+)$/.exec($);if(!J)return null;let X=J[1].trim().replace(/^\(([\s\S]*)\)$/,"$1").trim(),Y=J[2].trim();return X&&Y?{arrayExpr:Y,itemVar:X}:null}function e7($,Z,J,X){let Y=$;Y=s7(Y,Z);function Q(q){let K=/@foreach\s*\(/g,U;while((U=K.exec(q))!==null){let W=U.index,H=U.index+U[0].length-1,j=1,B=H+1,V=-1;while(B<q.length&&j>0){if(q[B]==="(")j++;else if(q[B]===")"){if(j--,j===0){V=B;break}}B++}if(V===-1)continue;let F=q.substring(H+1,V),O=t7(F);if(!O)continue;let _=W,{arrayExpr:L,itemVar:w}=O,R=V+1,D=1,M=R,I=/@foreach\s*\(/g,N=/@endforeach/g;while(D>0&&M<q.length){I.lastIndex=M,N.lastIndex=M;let A=I.exec(q),T=N.exec(q);if(!T)break;if(A&&A.index<T.index)D++,M=A.index+A[0].length;else{if(D--,D===0){let k=q.substring(R,T.index),y=T.index+11;return{start:_,end:y,arrayExpr:L,itemVar:w,content:k}}M=T.index+11}}}return null}function G(q,K){let U=q;while(!0){let W=Q(U);if(!W)break;let{start:H,end:j,arrayExpr:B,itemVar:V,content:F}=W;try{let O=B.trim(),_;if(q0(O))_=U0(O,Object.keys(K))(...Object.values(K));else _=e(O,K);let L=!1;if(!Array.isArray(_))if(_ instanceof Map)_=Array.from(_),L=!0;else if(_ instanceof Set)_=Array.from(_);else if(typeof _==="string")_=Array.from(_);else if(_&&typeof _==="object"&&!(_ instanceof Date)&&!(_ instanceof RegExp))_=Object.entries(_),L=!0;else{console.warn(`[stx] @foreach(${O}) in ${J}: ${O} is not iterable server-side, so the loop rendered nothing. `+"Values a server loop reads must come from <script server> or the page context \u2014 "+"a plain <script> runs in the browser.");let T=Q0("Foreach",`Error in @foreach: ${O} is not iterable`,Y0.TYPE_ERROR);U=U.substring(0,H)+T+U.substring(j);continue}let w=X?.loops?.useAltLoopVariable??xX,R=V.trim(),D=null,M,I=!1;if(R.includes("=>")){let T=R.split("=>").map((k)=>k.trim());if(T.length===2&&T[0]&&T[1])D=T[0],M=T[1];else M=R}else if(!R.startsWith("[")&&!R.startsWith("{")&&R.includes(",")){let T=R.split(",").map((k)=>k.trim());if(T.length===2&&T[0]&&T[1])M=T[0],D=T[1],I=!0;else M=R}else M=R;let N="",A=_;for(let T=0;T<A.length;T++){let k=A[T],y={index:T,iteration:T+1,first:T===0,last:T===A.length-1,count:A.length},E={...K,loop:y,$loop:y};if(M.startsWith("[")&&M.endsWith("]")){let P=M.slice(1,-1).split(",").map((g)=>g.trim());if(Array.isArray(k))P.forEach((g,x)=>{if(g)E[g]=k[x]});else E[M]=k}else E[M]=k;if(D)if(!I&&L&&Array.isArray(k)&&k.length===2)E[D]=k[0],E[M]=k[1];else E[D]=T;let b=dX(F,E),C=o7(b);if(C.hasContinue){N+=C.content;continue}let v=n7(b);if(v.hasBreak){N+=v.content;break}if(b=s7(b,E),b=G(b,E),b=Z1(b,E,J),b=mX(b),v=n7(b),v.hasBreak){N+=v.content;break}if(C=o7(b),C.hasContinue){N+=C.content;continue}b=_1(b,E,J),b=uX(b,E),b=hX(b,E),b=gX(b,E),N+=b}U=U.substring(0,H)+N+U.substring(j)}catch(O){let _=Q0("Foreach",`Error in @foreach(${B.trim()} as ${V.trim()}): ${O instanceof Error?O.message:String(O)}`,Y0.EVALUATION_ERROR);U=U.substring(0,H)+_+U.substring(j)}}return U}Y=G(Y,Z),Y=Z4(Y,Z,J,X);let z=X?.loops?.maxWhileIterations??fX;return Y=iX(Y,Z,z),Y}function $4($){return G9($)}function Z4($,Z,J,X){let Y=$,Q=!0;while(Q){Q=!1;let G=Y.match(/@for\s*\(/);if(!G||G.index===void 0)break;let z=G.index,q=z+G[0].length-1,K=_0(Y,"(",")",q);if(K===-1)break;let U=Y.slice(q+1,K),W=K+1,H=Z9(Y.slice(z),"for","endfor");if(H.length===0)break;let j=H[0].content,B=z+H[0].end;if(!$4(U)){let V=Q0("For",`Unsafe expression in @for: ${U}`,Y0.UNSAFE_EXPRESSION);Y=Y.substring(0,z)+V+Y.substring(B),Q=!0;continue}try{let V=cX(U),F=/@(?:for|foreach|if|unless)\s*\(/.test(j);if(V.length>0&&F){let D=pX({forExpr:U,content:j,iterVarNames:V,context:Z,filePath:J,options:X});Y=Y.substring(0,z)+D+Y.substring(B),Q=!0;continue}let O=Object.keys(Z),_=Object.values(Z),L=j.replace(/`/g,"\\`").replace(/\$\{/g,"\\${").replace(/\{\{([^}]+)\}\}/g,(D,M)=>{return`\${${M}}`});L=a7(L);let R=Function(...O,`
3318
+ `,R=Function(...j,L)(...B);if(R&&typeof R==="object")Object.assign(Z,R);Q=Q.replace(K,"")}catch(H){console.error(`Error executing ${X} code block in ${J}:`,H);let j=H instanceof Error?H.message:String(H),B=j0(`${X} Directive`,`Error executing code: ${j}`,J,$,W,K);console.error(B),Q=Q.replace(K,"")}return Q}var gX=1000,hX=!1;function uX($,Z){let J=/@(include|partial)\s*\(\s*(['"])([^'"]+)\2\s*,\s*/g,X="",Y=0,Q;while((Q=J.exec($))!==null){let G=Q.index+Q[0].length,z=Q.index+Q[0].indexOf("("),q=_0($,"(",")",z);if(q===-1)continue;let K=$.slice(G,q).trim();if(!K)continue;if(!Object.keys(Z).some((H)=>new RegExp(`(?:^|[^\\w$.])${H.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w$])`).test(K)))continue;let W;try{let H=T0(K,Z);if(!H||typeof H!=="object")continue;W=JSON.stringify(H)}catch{continue}X+=$.slice(Y,G)+W,Y=q,J.lastIndex=q}return Y===0?$:X+$.slice(Y)}function dX($,Z){let J=/@component\s*\(/g,X=$,Y,Q=[];while((Y=J.exec(X))!==null){let G=Y.index,z=G+Y[0].length-1,q=1,K=z+1;while(K<X.length&&q>0){if(X[K]==="(")q++;else if(X[K]===")"){if(q--,q===0)break}K++}if(q!==0)continue;let U=X.substring(z+1,K),W=K+1,H=U.match(/^\s*['"]([^'"]+)['"]/);if(!H)continue;let j=H[1],B=U.slice(H[0].length),V=B.match(/^\s*,\s*/);if(!V)continue;let F=B.slice(V[0].length).trim();if(!F)continue;try{let O=T0(F,Z),_=JSON.stringify(O),L=`@component('${j}', ${_})`;Q.push({start:G,end:W,replacement:L})}catch{continue}}for(let G=Q.length-1;G>=0;G--){let{start:z,end:q,replacement:K}=Q[G];X=X.substring(0,z)+K+X.substring(q)}return X}function z9($,Z,J){let X=$,Y=new RegExp(`${Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\(`),Q;while((Q=Y.exec(X))!==null){let G=Q.index,z=G+Q[0].length-1,q=1,K=z+1,U=null,W=!1;while(K<X.length&&q>0){let B=X[K];if(W){W=!1,K++;continue}if(B==="\\"&&U){W=!0,K++;continue}if(U){if(B===U)U=null;K++;continue}if(B==='"'||B==="'"||B==="`"){U=B,K++;continue}if(B==="(")q++;else if(B===")"){if(q--,q===0)break}K++}if(q!==0)break;let H=X.substring(z+1,K),j=J(H);X=X.substring(0,G)+j+X.substring(K+1)}return X}function mX($,Z){let J=$;return J=J.replace(/:([a-zA-Z_][a-zA-Z0-9_-]*)(?=\s+[^=]|\s*\/?>|\s*$)/g,(X,Y)=>{if(Y in Z)return`:${Y}="${Y}"`;return X}),J=J.replace(/:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,(X,Y,Q)=>{try{let G=Object.keys(Z),z=Object.values(Z);r7(Q);let K=U0(Q,G)(...z),U=JSON.stringify(K);if(U===void 0){if(!U9(Q).some((j)=>!(j in Z)))return"";return X}let W=Buffer.from(U,"utf8").toString("base64");return`__stx_${Y}="${W}"`}catch(G){return X}}),J}var q9="<!--__STX_BREAK__-->",K9="<!--__STX_CONTINUE__-->";function lX($,Z){let J=$;return J=z9(J,"@break",(X)=>{try{let Q=`!!(${X.trim()})`,G;if(q0(Q)){let z=U0(Q,Object.keys(Z));G=Boolean(z(...Object.values(Z)))}else G=Boolean(e(Q,Z));return G?q9:""}catch{return""}}),J=z9(J,"@continue",(X)=>{try{let Q=`!!(${X.trim()})`,G;if(q0(Q)){let z=U0(Q,Object.keys(Z));G=Boolean(z(...Object.values(Z)))}else G=Boolean(e(Q,Z));return G?K9:""}catch{return""}}),J}function cX($){let Z=$;return Z=Z.replace(/@break(?!\()/g,q9),Z=Z.replace(/@continue(?!\()/g,K9),Z}function n7($){let Z=$.includes(q9),J=Z?$.substring(0,$.indexOf(q9)):$;return{hasBreak:Z,content:J}}function o7($){let Z=$.includes(K9),J=Z?$.substring(0,$.indexOf(K9)):$;return{hasContinue:Z,content:J}}function a7($){let Z=$;return Z=z9(Z,"@break",(J)=>{let X=J.trim();if(!G9(X))return"";return`\`; if (${X}) { break; } result += \``}),Z=z9(Z,"@continue",(J)=>{let X=J.trim();if(!G9(X))return"";return`\`; if (${X}) { continue; } result += \``}),Z=Z.replace(/@break(?!\()/g,"`; break; result += `"),Z=Z.replace(/@continue(?!\()/g,"`; continue; result += `"),Z}function pX($){let Z=/@forelse\s*\(/g,J,X=[],Y=/@foreach\s*\(/g,Q=/@endforeach/g,G;while((G=Y.exec($))!==null)X.push({pos:G.index,delta:1});while((G=Q.exec($))!==null)X.push({pos:G.index,delta:-1});X.sort((U,W)=>U.pos-W.pos);let z=[],q=0;for(let U of X)q+=U.delta,z.push({pos:U.pos,depth:q});function K(U){let W=0,H=z.length-1,j=0;while(W<=H){let B=W+H>>1;if(z[B].pos<=U)j=z[B].depth,W=B+1;else H=B-1}return j}while((J=Z.exec($))!==null){if(K(J.index)>0)continue;let U=J.index,W=J.index+J[0].length-1,H=1,j=W+1,B=-1;while(j<$.length&&H>0){if($[j]==="(")H++;else if($[j]===")"){if(H--,H===0){B=j;break}}j++}if(B===-1)continue;let V=$.substring(W+1,B),F=t7(V);if(!F)continue;let{arrayExpr:O,itemVar:_}=F,L=B+1,w=1,R=L,D=/@forelse\s*\(/g,M=/@endforelse/g,I=-1;while(w>0&&R<$.length){D.lastIndex=R,M.lastIndex=R;let E=D.exec($),b=M.exec($);if(!b)break;if(E&&E.index<b.index)w++,R=E.index+E[0].length;else{if(w--,w===0){I=b.index;break}R=b.index+11}}if(I===-1)continue;let N=$.substring(L,I),A=I+11,T=-1,k=0,y=0;while(y<N.length){let E=N.indexOf("@",y);if(E===-1)break;let b=N.substring(E);if(/^@forelse\s*\(/.test(b))k++,y=E+1;else if(b.startsWith("@endforelse"))k--,y=E+11;else if(k===0&&b.startsWith("@empty")){if(N.length<=E+6||!/[a-z]/i.test(N[E+6])){T=E;break}y=E+1}else y=E+1}if(T===-1)continue;return{start:U,end:A,arrayExpr:O,itemVar:_,foreachContent:N.substring(0,T),emptyContent:N.substring(T+6)}}return null}function s7($,Z){let J=$;while(!0){let X=pX(J);if(!X)break;let{start:Y,end:Q,arrayExpr:G,itemVar:z,foreachContent:q,emptyContent:K}=X;try{let U;if(q0(G))U=U0(G,Object.keys(Z))(...Object.values(Z));else U=e(G,Z);let W;if(!Array.isArray(U)||U.length===0)W=K;else W=`@foreach (${G} as ${z})${q}@endforeach`;J=J.substring(0,Y)+W+J.substring(Q)}catch(U){let W=U instanceof Error?U.message:String(U),H=Q0("Forelse",`Error in @forelse(${G} as ${z}): ${W}`,Y0.EVALUATION_ERROR);J=J.substring(0,Y)+H+J.substring(Q)}}return J}function t7($){let Z=$.indexOf(" as ");if(Z!==-1){let Q=$.slice(0,Z).trim(),G=$.slice(Z+4).trim();return Q&&G?{arrayExpr:Q,itemVar:G}:null}let J=/^\s*(.+?)\s+in\s+([\s\S]+)$/.exec($);if(!J)return null;let X=J[1].trim().replace(/^\(([\s\S]*)\)$/,"$1").trim(),Y=J[2].trim();return X&&Y?{arrayExpr:Y,itemVar:X}:null}function e7($,Z,J,X){let Y=$;Y=s7(Y,Z);function Q(q){let K=/@foreach\s*\(/g,U;while((U=K.exec(q))!==null){let W=U.index,H=U.index+U[0].length-1,j=1,B=H+1,V=-1;while(B<q.length&&j>0){if(q[B]==="(")j++;else if(q[B]===")"){if(j--,j===0){V=B;break}}B++}if(V===-1)continue;let F=q.substring(H+1,V),O=t7(F);if(!O)continue;let _=W,{arrayExpr:L,itemVar:w}=O,R=V+1,D=1,M=R,I=/@foreach\s*\(/g,N=/@endforeach/g;while(D>0&&M<q.length){I.lastIndex=M,N.lastIndex=M;let A=I.exec(q),T=N.exec(q);if(!T)break;if(A&&A.index<T.index)D++,M=A.index+A[0].length;else{if(D--,D===0){let k=q.substring(R,T.index),y=T.index+11;return{start:_,end:y,arrayExpr:L,itemVar:w,content:k}}M=T.index+11}}}return null}function G(q,K){let U=q;while(!0){let W=Q(U);if(!W)break;let{start:H,end:j,arrayExpr:B,itemVar:V,content:F}=W;try{let O=B.trim(),_;if(q0(O))_=U0(O,Object.keys(K))(...Object.values(K));else _=e(O,K);let L=!1;if(!Array.isArray(_))if(_ instanceof Map)_=Array.from(_),L=!0;else if(_ instanceof Set)_=Array.from(_);else if(typeof _==="string")_=Array.from(_);else if(_&&typeof _==="object"&&!(_ instanceof Date)&&!(_ instanceof RegExp))_=Object.entries(_),L=!0;else{console.warn(`[stx] @foreach(${O}) in ${J}: ${O} is not iterable server-side, so the loop rendered nothing. `+"Values a server loop reads must come from <script server> or the page context \u2014 "+"a plain <script> runs in the browser.");let T=Q0("Foreach",`Error in @foreach: ${O} is not iterable`,Y0.TYPE_ERROR);U=U.substring(0,H)+T+U.substring(j);continue}let w=X?.loops?.useAltLoopVariable??hX,R=V.trim(),D=null,M,I=!1;if(R.includes("=>")){let T=R.split("=>").map((k)=>k.trim());if(T.length===2&&T[0]&&T[1])D=T[0],M=T[1];else M=R}else if(!R.startsWith("[")&&!R.startsWith("{")&&R.includes(",")){let T=R.split(",").map((k)=>k.trim());if(T.length===2&&T[0]&&T[1])M=T[0],D=T[1],I=!0;else M=R}else M=R;let N="",A=_;for(let T=0;T<A.length;T++){let k=A[T],y={index:T,iteration:T+1,first:T===0,last:T===A.length-1,count:A.length},E={...K,loop:y,$loop:y};if(M.startsWith("[")&&M.endsWith("]")){let P=M.slice(1,-1).split(",").map((g)=>g.trim());if(Array.isArray(k))P.forEach((g,x)=>{if(g)E[g]=k[x]});else E[M]=k}else E[M]=k;if(D)if(!I&&L&&Array.isArray(k)&&k.length===2)E[D]=k[0],E[M]=k[1];else E[D]=T;let b=lX(F,E),C=o7(b);if(C.hasContinue){N+=C.content;continue}let v=n7(b);if(v.hasBreak){N+=v.content;break}if(b=s7(b,E),b=G(b,E),b=$1(b,E,J),b=cX(b),v=n7(b),v.hasBreak){N+=v.content;break}if(C=o7(b),C.hasContinue){N+=C.content;continue}b=_1(b,E,J),b=mX(b,E),b=dX(b,E),b=uX(b,E),N+=b}U=U.substring(0,H)+N+U.substring(j)}catch(O){let _=Q0("Foreach",`Error in @foreach(${B.trim()} as ${V.trim()}): ${O instanceof Error?O.message:String(O)}`,Y0.EVALUATION_ERROR);U=U.substring(0,H)+_+U.substring(j)}}return U}Y=G(Y,Z),Y=Z4(Y,Z,J,X);let z=X?.loops?.maxWhileIterations??gX;return Y=oX(Y,Z,z),Y}function $4($){return G9($)}function Z4($,Z,J,X){let Y=$,Q=!0;while(Q){Q=!1;let G=Y.match(/@for\s*\(/);if(!G||G.index===void 0)break;let z=G.index,q=z+G[0].length-1,K=_0(Y,"(",")",q);if(K===-1)break;let U=Y.slice(q+1,K),W=K+1,H=Z9(Y.slice(z),"for","endfor");if(H.length===0)break;let j=H[0].content,B=z+H[0].end;if(!$4(U)){let V=Q0("For",`Unsafe expression in @for: ${U}`,Y0.UNSAFE_EXPRESSION);Y=Y.substring(0,z)+V+Y.substring(B),Q=!0;continue}try{let V=iX(U),F=/@(?:for|foreach|if|unless)\s*\(/.test(j);if(V.length>0&&F){let D=nX({forExpr:U,content:j,iterVarNames:V,context:Z,filePath:J,options:X});Y=Y.substring(0,z)+D+Y.substring(B),Q=!0;continue}let O=Object.keys(Z),_=Object.values(Z),L=j.replace(/`/g,"\\`").replace(/\$\{/g,"\\${").replace(/\{\{([^}]+)\}\}/g,(D,M)=>{return`\${${M}}`});L=a7(L);let R=Function(...O,`
3321
3319
  let result = '';
3322
3320
  for (${U}) {
3323
3321
  result += \`${L}\`;
3324
3322
  }
3325
3323
  return result;
3326
- `)(..._);Y=Y.substring(0,z)+R+Y.substring(B),Q=!0}catch(V){let F=Q0("For",`Error in @for(${U}): ${V instanceof Error?V.message:String(V)}`,Y0.EVALUATION_ERROR);Y=Y.substring(0,z)+F+Y.substring(B),Q=!0}}return Y}function cX($){let Z=$.trim(),J=Z.match(/^(?:const|let|var)\s+(\[[^\]]+\]|\{[^}]+\})\s+(?:of|in)\s+/);if(J){let Q=J[1];return Q.slice(1,-1).split(",").map((z)=>{let q=z.trim();if(!q)return"";let K=q.indexOf(":");if(K>=0&&Q.startsWith("{")){let H=q.slice(K+1).trim(),j=H.indexOf("=");return(j>=0?H.slice(0,j):H).trim()}let U=q.indexOf("="),W=(U>=0?q.slice(0,U):q).trim();return/^[A-Za-z_$][\w$]*$/.test(W)?W:""}).filter(Boolean)}let X=Z.match(/^(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s+(?:of|in)\s+/);if(X)return[X[1]];let Y=Z.match(/^(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=[^;]*;/);if(Y)return[Y[1]];return[]}function pX($){let{forExpr:Z,content:J,iterVarNames:X,context:Y,filePath:Q,options:G}=$,z=Object.keys(Y),q=Object.values(Y),K=Function(...z,"__pushIter",`
3324
+ `)(..._);Y=Y.substring(0,z)+R+Y.substring(B),Q=!0}catch(V){let F=Q0("For",`Error in @for(${U}): ${V instanceof Error?V.message:String(V)}`,Y0.EVALUATION_ERROR);Y=Y.substring(0,z)+F+Y.substring(B),Q=!0}}return Y}function iX($){let Z=$.trim(),J=Z.match(/^(?:const|let|var)\s+(\[[^\]]+\]|\{[^}]+\})\s+(?:of|in)\s+/);if(J){let Q=J[1];return Q.slice(1,-1).split(",").map((z)=>{let q=z.trim();if(!q)return"";let K=q.indexOf(":");if(K>=0&&Q.startsWith("{")){let H=q.slice(K+1).trim(),j=H.indexOf("=");return(j>=0?H.slice(0,j):H).trim()}let U=q.indexOf("="),W=(U>=0?q.slice(0,U):q).trim();return/^[A-Za-z_$][\w$]*$/.test(W)?W:""}).filter(Boolean)}let X=Z.match(/^(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s+(?:of|in)\s+/);if(X)return[X[1]];let Y=Z.match(/^(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=[^;]*;/);if(Y)return[Y[1]];return[]}function nX($){let{forExpr:Z,content:J,iterVarNames:X,context:Y,filePath:Q,options:G}=$,z=Object.keys(Y),q=Object.values(Y),K=Function(...z,"__pushIter",`
3327
3325
  for (${Z}) {
3328
3326
  __pushIter([${X.join(", ")}])
3329
3327
  }
3330
- `),U=[];K(...q,(j)=>{U.push(j)});let W=Q??"inline.stx",H="";for(let j of U){let B={...Y};X.forEach((F,O)=>{B[F]=j[O]});let V=Z4(J,B,Q,G);V=Z1(V,B,W),V=_1(V,B,W),H+=V}return H}function iX($,Z,J){let X=$,Y=!0;while(Y){Y=!1;let Q=X.match(/@while\s*\(/);if(!Q||Q.index===void 0)break;let G=Q.index,z=G+Q[0].length-1,q=_0(X,"(",")",z);if(q===-1)break;let K=X.slice(z+1,q),U=Z9(X.slice(G),"while","endwhile");if(U.length===0)break;let W=U[0].content,H=G+U[0].end;if(!$4(K)){let j=Q0("While",`Unsafe expression in @while: ${K}`,Y0.UNSAFE_EXPRESSION);X=X.substring(0,G)+j+X.substring(H),Y=!0;continue}try{let j=Object.keys(Z),B=Object.values(Z),V=W.replace(/`/g,"\\`").replace(/\$\{/g,"\\${").replace(/\{\{([^}]+)\}\}/g,(_,L)=>{return`\${${L}}`});V=a7(V);let O=Function(...j,`
3328
+ `),U=[];K(...q,(j)=>{U.push(j)});let W=Q??"inline.stx",H="";for(let j of U){let B={...Y};X.forEach((F,O)=>{B[F]=j[O]});let V=Z4(J,B,Q,G);V=$1(V,B,W),V=_1(V,B,W),H+=V}return H}function oX($,Z,J){let X=$,Y=!0;while(Y){Y=!1;let Q=X.match(/@while\s*\(/);if(!Q||Q.index===void 0)break;let G=Q.index,z=G+Q[0].length-1,q=_0(X,"(",")",z);if(q===-1)break;let K=X.slice(z+1,q),U=Z9(X.slice(G),"while","endwhile");if(U.length===0)break;let W=U[0].content,H=G+U[0].end;if(!$4(K)){let j=Q0("While",`Unsafe expression in @while: ${K}`,Y0.UNSAFE_EXPRESSION);X=X.substring(0,G)+j+X.substring(H),Y=!0;continue}try{let j=Object.keys(Z),B=Object.values(Z),V=W.replace(/`/g,"\\`").replace(/\$\{/g,"\\${").replace(/\{\{([^}]+)\}\}/g,(_,L)=>{return`\${${L}}`});V=a7(V);let O=Function(...j,`
3331
3329
  let result = '';
3332
3330
  let maxIterations = ${J}; // Configurable safety limit
3333
3331
  let counter = 0;
@@ -3339,31 +3337,31 @@ ${u7($).split(",").map((Q)=>Q.trim()).filter(Boolean).map((Q)=>` try { __scopeR
3339
3337
  result += '<!-- [While Error [1104]]: Maximum iterations (${J}) exceeded in while loop. Configure via options.loops.maxWhileIterations -->';
3340
3338
  }
3341
3339
  return result;
3342
- `)(...B);X=X.substring(0,G)+O+X.substring(H),Y=!0}catch(j){let B=Q0("While",`Error in @while(${K}): ${j instanceof Error?j.message:String(j)}`,Y0.EVALUATION_ERROR);X=X.substring(0,G)+B+X.substring(H),Y=!0}}return X}function nX($,Z="_method"){let J=$.toUpperCase();if(J==="GET"||J==="POST")return"";return`<input type="hidden" name="${Z}" value="${J}">`}function J4($){return $.replace(/@method\(\s*(['"])([^'"]+)\1\s*(?:,\s*(['"])([^'"]+)\3\s*)?\)/g,(Z,J,X,Y,Q)=>{return nX(X,Q||"_method")})}async function X4($,Z,J,X,Y){if(!X.middleware||X.middleware.length===0)return $;let Q=$,G=X.middleware.filter((z)=>z.timing===Y);if(G.length===0)return Q;for(let z of G){if(!z.name||typeof z.handler!=="function"){if(X.debug)console.warn("Invalid middleware:",z);continue}try{let q=await z.handler(Q,Z,J,X);if(typeof q==="string")Q=q;else if(X.debug)console.warn(`Middleware ${z.name} did not return a string`)}catch(q){if(X.debug)console.error(`Error in middleware ${z.name}:`,q);if(X.debug){let K=j0("Middleware",`Error in middleware '${z.name}': ${q instanceof Error?q.message:String(q)}`,J,$);Q=Q.replace(/<body[^>]*>/,`$&
3340
+ `)(...B);X=X.substring(0,G)+O+X.substring(H),Y=!0}catch(j){let B=Q0("While",`Error in @while(${K}): ${j instanceof Error?j.message:String(j)}`,Y0.EVALUATION_ERROR);X=X.substring(0,G)+B+X.substring(H),Y=!0}}return X}function sX($,Z="_method"){let J=$.toUpperCase();if(J==="GET"||J==="POST")return"";return`<input type="hidden" name="${Z}" value="${J}">`}function J4($){return $.replace(/@method\(\s*(['"])([^'"]+)\1\s*(?:,\s*(['"])([^'"]+)\3\s*)?\)/g,(Z,J,X,Y,Q)=>{return sX(X,Q||"_method")})}async function X4($,Z,J,X,Y){if(!X.middleware||X.middleware.length===0)return $;let Q=$,G=X.middleware.filter((z)=>z.timing===Y);if(G.length===0)return Q;for(let z of G){if(!z.name||typeof z.handler!=="function"){if(X.debug)console.warn("Invalid middleware:",z);continue}try{let q=await z.handler(Q,Z,J,X);if(typeof q==="string")Q=q;else if(X.debug)console.warn(`Middleware ${z.name} did not return a string`)}catch(q){if(X.debug)console.error(`Error in middleware ${z.name}:`,q);if(X.debug){let K=j0("Middleware",`Error in middleware '${z.name}': ${q instanceof Error?q.message:String(q)}`,J,$);Q=Q.replace(/<body[^>]*>/,`$&
3343
3341
  <div style="color:red;background:#ffeeee;padding:10px;border:1px solid #ff0000;margin:10px 0;font-family:monospace;white-space:pre-wrap;">${m9(K)}</div>
3344
- `)}}}return Q}async function Y4($,Z,J,X){return X4($,Z,J,X,"before")}async function Q4($,Z,J,X){return X4($,Z,J,X,"after")}z2();z2();function G4($){return $.replace(/@route\(\s*(['"])([^'"]+)\1(?:\s*,\s*(\{[^}]+\}))?\s*(?:,\s*(true|false)\s*)?\)/g,(Z,J,X,Y,Q)=>{try{let G=Y?T0(Y,{}):{};return x5(X,G,Q==="true")}catch(G){return console.error(`Error processing @route directive: ${G}`),"#route-error"}})}var l0={patterns:[],exact:{}};function MW($,Z){if(!l0.exact[$])l0.exact[$]=[];l0.exact[$].push(Z)}function AW($,Z){let J=typeof $==="string"?new RegExp($):$;l0.patterns.push({pattern:J,callback:Z})}async function z4($,Z){let J=$.split("/").pop()?.split(".")[0]||"";if(l0.exact[$])for(let X of l0.exact[$])await Promise.resolve(X(Z,$));if(l0.exact[J])for(let X of l0.exact[J])await Promise.resolve(X(Z,$));for(let{pattern:X,callback:Y}of l0.patterns)if(X.test($)||X.test(J))await Promise.resolve(Y(Z,$))}function kW(){l0.patterns=[],l0.exact={}}var oX=new Set(["disabled","checked","readonly","required","autofocus","autoplay","controls","default","defer","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","reversed","selected"]),sX=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function g5($){let Z=[],J=/<([a-zA-Z][a-zA-Z0-9-]*)\b((?:[^>"']|"[^"]*"|'[^']*')*)\s*\/?>/g,X;while((X=J.exec($))!==null){let Y=X[2]||"";if(!/(?:^|\s)(?::for|x-for|v-for|@for)\s*=/.test(Y))continue;let Q=X.index,G=Q+X[0].length,z=X[1].toLowerCase();if(X[0].endsWith("/>")||sX.has(z)){Z.push([Q,G]);continue}let q=z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),K=new RegExp(`<\\/?${q}\\b(?:[^>"']|"[^"]*"|'[^']*')*>`,"gi");K.lastIndex=G;let U=1,W=G,H;while((H=K.exec($))!==null)if(H[0].startsWith("</")){if(U--,U===0){W=H.index+H[0].length;break}}else if(!H[0].endsWith("/>"))U++;Z.push([Q,W])}return Z}function K4($){if(typeof $==="string")return $;if(Array.isArray($))return $.filter(Boolean).map((Z)=>K4(Z)).join(" ");if($&&typeof $==="object")return Object.entries($).filter(([,Z])=>Z).map(([Z])=>Z).join(" ");return $?String($):""}function U4($,Z){if(!/:[\w-]+=/.test($))return $;let J=$,X=/<(script|style)\b[^>]*>[\s\S]*?<\/\1>/gi,Y=[],Q;while((Q=X.exec($))!==null)Y.push([Q.index,Q.index+Q[0].length]);Y.push(...g5($));function G(W){return Y.some(([H,j])=>W>=H&&W<j)}let z=/<([a-zA-Z][a-zA-Z0-9-]*)\b((?:[^>"']|"[^"]*"|'[^']*')*)\s*\/?>/g,q=[],K=new Map,U=256;while((Q=z.exec(J))!==null){if(G(Q.index))continue;let W=Q[0],H=Q[2];if(!H||!H.includes(":"))continue;let j=/\s:([a-zA-Z_][\w-]*)\s*=\s*"([^"]*)"/g,B,V=H,F=!1;while((B=j.exec(H))!==null){let O=B[1],_=B[2];if(q4(O))continue;if(_.includes("()")&&!_.includes(".get(")||_.includes("$store")||_.includes("$ref"))continue;try{let L=Object.keys(Z),w=Object.values(Z),R=_.match(/^([a-zA-Z_$][\w$]*)/);if(R&&!L.includes(R[1])&&!["true","false","null","undefined","Math","JSON","String","Number","Array","Object","Date","parseInt","parseFloat"].includes(R[1]))continue;let D=JSON.stringify([L,_]),M=K.get(D);if(!M){if(M=Function(...L,`return (${_})`),K.size>=U)K.clear();K.set(D,M)}let I=M(...w);if(O==="class"){let N=K4(I);if(N){let A=V.match(/\sclass="([^"]*)"/);if(A)V=V.replace(A[0],` class="${A[1]} ${N}"`);else V=V.replace(B[0],` class="${N}"`)}else V=V.replace(B[0],"");F=!0;continue}if(oX.has(O)){if(I)V=V.replace(B[0],` ${O}`);else V=V.replace(B[0],"");F=!0;continue}if(I===null||I===void 0||I===!1)V=V.replace(B[0],"");else{let N=String(I).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;");V=V.replace(B[0],` ${O}="${N}"`)}F=!0}catch{continue}}if(F){let O=W.endsWith("/>")?" /":"",L=`<${Q[1]}${V}${O}>`;q.push({start:Q.index,end:Q.index+W.length,replacement:L})}}if(q.length>0){let W=Array(q.length*2+1),H=0;for(let j=0;j<q.length;j++){let{start:B,end:V,replacement:F}=q[j];W[j*2]=J.slice(H,B),W[j*2+1]=F,H=V}W[q.length*2]=J.slice(H),J=W.join("")}return J}var rX=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),aX=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]);function M1($,Z){let J=/<([a-zA-Z][a-zA-Z0-9-]*)((?:\s+(?:[^>"']|"[^"]*"|'[^']*')*)?)(\s*\/?)>/g;J.lastIndex=Z;let X=J.exec($);if(!X)return null;let Y=/\/\s*>$/.test(X[0])||X[1]===X[1].toLowerCase()&&rX.has(X[1]),Q=Y?X[2].replace(/\/\s*$/,""):X[2];return{full:X[0],tag:X[1],attrs:Q,selfClosing:Y,start:X.index,end:X.index+X[0].length}}function tX($,Z,J){let X=1,Y=J,Q=new RegExp(`<${Z}(?:\\s(?:[^>"']|"[^"]*"|'[^']*')*)?>`,"gi"),G=new RegExp(`</${Z}\\s*>`,"gi");while(X>0&&Y<$.length){Q.lastIndex=Y,G.lastIndex=Y;let z=Q.exec($),q=G.exec($);if(!q)return-1;if(z&&z.index<q.index)X++,Y=z.index+z[0].length;else{if(X--,X===0)return q.index+q[0].length;Y=q.index+q[0].length}}return-1}function n0($,Z){if(Z.selfClosing)return{outerStart:Z.start,outerEnd:Z.end,innerHTML:""};let J=tX($,Z.tag,Z.end);if(J===-1)return{outerStart:Z.start,outerEnd:Z.end,innerHTML:""};return{outerStart:Z.start,outerEnd:J,innerHTML:$.slice(Z.end,J-`</${Z.tag}>`.length)}}function W4($,Z){return new RegExp(`(?:^|\\s)${Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?:=|\\s|$|>|/)`).test($)||$.includes(` ${Z}=`)||$.includes(` ${Z} `)||$.trimEnd().endsWith(` ${Z}`)}function d1($,Z){let J=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),X=$.match(new RegExp(`${J}="([^"]*)"`,"s"))||$.match(new RegExp(`${J}='([^']*)'`,"s"));return X?X[1]:null}function H1($,Z){let J=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return $.replace(new RegExp(`\\s*${J}="[^"]*"`,"g"),"").replace(new RegExp(`\\s*${J}='[^']*'`,"g"),"").replace(new RegExp(`\\s*${J}(?=\\s|$|>|/)`,"g"),"")}function j1($,Z,J){let X=Z.selfClosing?" /":"",Y=`<${Z.tag}${J}${X}>`;return $.slice(0,Z.start)+Y+$.slice(Z.end)}function eX($){return/\bv-(?:if|else-if|else|for|show|model|html|text|pre|once|cloak|memo|bind|on|slot)\b/.test($)}function $Y($){let Z=$,J=0;while(J<Z.length){let X=M1(Z,J);if(!X)break;let Y=d1(X.attrs,"v-for");if(Y===null){J=X.end;continue}let Q=Y.match(/^\s*\(?([^)]+)\)?\s+(?:in|of)\s+(.+)\s*$/);if(!Q){J=X.end;continue}let G=Q[1].trim(),z=Q[2].trim(),q;if(G.includes(",")){let F=G.split(",").map((L)=>L.trim()),O=F[0],_=F[1];q=`${z} as ${_} => ${O}`}else q=`${z} as ${G}`;let K=H1(X.attrs,"v-for"),U=H1(K,":key").replace(/\s*v-bind:key="[^"]*"/g,""),W=n0(Z,X),H=Z.slice(W.outerStart,W.outerEnd),j=j1(H,{...X,start:0,end:X.end-X.start},U),B=`@foreach(${q})
3342
+ `)}}}return Q}async function Y4($,Z,J,X){return X4($,Z,J,X,"before")}async function Q4($,Z,J,X){return X4($,Z,J,X,"after")}z2();z2();function G4($){return $.replace(/@route\(\s*(['"])([^'"]+)\1(?:\s*,\s*(\{[^}]+\}))?\s*(?:,\s*(true|false)\s*)?\)/g,(Z,J,X,Y,Q)=>{try{let G=Y?T0(Y,{}):{};return x5(X,G,Q==="true")}catch(G){return console.error(`Error processing @route directive: ${G}`),"#route-error"}})}var l0={patterns:[],exact:{}};function NW($,Z){if(!l0.exact[$])l0.exact[$]=[];l0.exact[$].push(Z)}function MW($,Z){let J=typeof $==="string"?new RegExp($):$;l0.patterns.push({pattern:J,callback:Z})}async function z4($,Z){let J=$.split("/").pop()?.split(".")[0]||"";if(l0.exact[$])for(let X of l0.exact[$])await Promise.resolve(X(Z,$));if(l0.exact[J])for(let X of l0.exact[J])await Promise.resolve(X(Z,$));for(let{pattern:X,callback:Y}of l0.patterns)if(X.test($)||X.test(J))await Promise.resolve(Y(Z,$))}function AW(){l0.patterns=[],l0.exact={}}var rX=new Set(["disabled","checked","readonly","required","autofocus","autoplay","controls","default","defer","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","reversed","selected"]),aX=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function g5($){let Z=[],J=/<([a-zA-Z][a-zA-Z0-9-]*)\b((?:[^>"']|"[^"]*"|'[^']*')*)\s*\/?>/g,X;while((X=J.exec($))!==null){let Y=X[2]||"";if(!/(?:^|\s)(?::for|x-for|v-for|@for)\s*=/.test(Y))continue;let Q=X.index,G=Q+X[0].length,z=X[1].toLowerCase();if(X[0].endsWith("/>")||aX.has(z)){Z.push([Q,G]);continue}let q=z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),K=new RegExp(`<\\/?${q}\\b(?:[^>"']|"[^"]*"|'[^']*')*>`,"gi");K.lastIndex=G;let U=1,W=G,H;while((H=K.exec($))!==null)if(H[0].startsWith("</")){if(U--,U===0){W=H.index+H[0].length;break}}else if(!H[0].endsWith("/>"))U++;Z.push([Q,W])}return Z}function K4($){if(typeof $==="string")return $;if(Array.isArray($))return $.filter(Boolean).map((Z)=>K4(Z)).join(" ");if($&&typeof $==="object")return Object.entries($).filter(([,Z])=>Z).map(([Z])=>Z).join(" ");return $?String($):""}function U4($,Z){if(!/:[\w-]+=/.test($))return $;let J=$,X=/<(script|style)\b[^>]*>[\s\S]*?<\/\1>/gi,Y=[],Q;while((Q=X.exec($))!==null)Y.push([Q.index,Q.index+Q[0].length]);Y.push(...g5($));function G(W){return Y.some(([H,j])=>W>=H&&W<j)}let z=/<([a-zA-Z][a-zA-Z0-9-]*)\b((?:[^>"']|"[^"]*"|'[^']*')*)\s*\/?>/g,q=[],K=new Map,U=256;while((Q=z.exec(J))!==null){if(G(Q.index))continue;let W=Q[0],H=Q[2];if(!H||!H.includes(":"))continue;let j=/\s:([a-zA-Z_][\w-]*)\s*=\s*"([^"]*)"/g,B,V=H,F=!1;while((B=j.exec(H))!==null){let O=B[1],_=B[2];if(q4(O))continue;if(_.includes("()")&&!_.includes(".get(")||_.includes("$store")||_.includes("$ref"))continue;try{let L=Object.keys(Z),w=Object.values(Z),R=_.match(/^([a-zA-Z_$][\w$]*)/);if(R&&!L.includes(R[1])&&!["true","false","null","undefined","Math","JSON","String","Number","Array","Object","Date","parseInt","parseFloat"].includes(R[1]))continue;let D=JSON.stringify([L,_]),M=K.get(D);if(!M){if(M=Function(...L,`return (${_})`),K.size>=U)K.clear();K.set(D,M)}let I=M(...w);if(O==="class"){let N=K4(I);if(N){let A=V.match(/\sclass="([^"]*)"/);if(A)V=V.replace(A[0],` class="${A[1]} ${N}"`);else V=V.replace(B[0],` class="${N}"`)}else V=V.replace(B[0],"");F=!0;continue}if(rX.has(O)){if(I)V=V.replace(B[0],` ${O}`);else V=V.replace(B[0],"");F=!0;continue}if(I===null||I===void 0||I===!1)V=V.replace(B[0],"");else{let N=String(I).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;");V=V.replace(B[0],` ${O}="${N}"`)}F=!0}catch{continue}}if(F){let O=W.endsWith("/>")?" /":"",L=`<${Q[1]}${V}${O}>`;q.push({start:Q.index,end:Q.index+W.length,replacement:L})}}if(q.length>0){let W=Array(q.length*2+1),H=0;for(let j=0;j<q.length;j++){let{start:B,end:V,replacement:F}=q[j];W[j*2]=J.slice(H,B),W[j*2+1]=F,H=V}W[q.length*2]=J.slice(H),J=W.join("")}return J}var tX=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),eX=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]);function M1($,Z){let J=/<([a-zA-Z][a-zA-Z0-9-]*)((?:\s+(?:[^>"']|"[^"]*"|'[^']*')*)?)(\s*\/?)>/g;J.lastIndex=Z;let X=J.exec($);if(!X)return null;let Y=/\/\s*>$/.test(X[0])||X[1]===X[1].toLowerCase()&&tX.has(X[1]),Q=Y?X[2].replace(/\/\s*$/,""):X[2];return{full:X[0],tag:X[1],attrs:Q,selfClosing:Y,start:X.index,end:X.index+X[0].length}}function $Y($,Z,J){let X=1,Y=J,Q=new RegExp(`<${Z}(?:\\s(?:[^>"']|"[^"]*"|'[^']*')*)?>`,"gi"),G=new RegExp(`</${Z}\\s*>`,"gi");while(X>0&&Y<$.length){Q.lastIndex=Y,G.lastIndex=Y;let z=Q.exec($),q=G.exec($);if(!q)return-1;if(z&&z.index<q.index)X++,Y=z.index+z[0].length;else{if(X--,X===0)return q.index+q[0].length;Y=q.index+q[0].length}}return-1}function n0($,Z){if(Z.selfClosing)return{outerStart:Z.start,outerEnd:Z.end,innerHTML:""};let J=$Y($,Z.tag,Z.end);if(J===-1)return{outerStart:Z.start,outerEnd:Z.end,innerHTML:""};return{outerStart:Z.start,outerEnd:J,innerHTML:$.slice(Z.end,J-`</${Z.tag}>`.length)}}function W4($,Z){return new RegExp(`(?:^|\\s)${Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?:=|\\s|$|>|/)`).test($)||$.includes(` ${Z}=`)||$.includes(` ${Z} `)||$.trimEnd().endsWith(` ${Z}`)}function d1($,Z){let J=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),X=$.match(new RegExp(`${J}="([^"]*)"`,"s"))||$.match(new RegExp(`${J}='([^']*)'`,"s"));return X?X[1]:null}function H1($,Z){let J=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return $.replace(new RegExp(`\\s*${J}="[^"]*"`,"g"),"").replace(new RegExp(`\\s*${J}='[^']*'`,"g"),"").replace(new RegExp(`\\s*${J}(?=\\s|$|>|/)`,"g"),"")}function j1($,Z,J){let X=Z.selfClosing?" /":"",Y=`<${Z.tag}${J}${X}>`;return $.slice(0,Z.start)+Y+$.slice(Z.end)}function ZY($){return/\bv-(?:if|else-if|else|for|show|model|html|text|pre|once|cloak|memo|bind|on|slot)\b/.test($)}function JY($){let Z=$,J=0;while(J<Z.length){let X=M1(Z,J);if(!X)break;let Y=d1(X.attrs,"v-for");if(Y===null){J=X.end;continue}let Q=Y.match(/^\s*\(?([^)]+)\)?\s+(?:in|of)\s+(.+)\s*$/);if(!Q){J=X.end;continue}let G=Q[1].trim(),z=Q[2].trim(),q;if(G.includes(",")){let F=G.split(",").map((L)=>L.trim()),O=F[0],_=F[1];q=`${z} as ${_} => ${O}`}else q=`${z} as ${G}`;let K=H1(X.attrs,"v-for"),U=H1(K,":key").replace(/\s*v-bind:key="[^"]*"/g,""),W=n0(Z,X),H=Z.slice(W.outerStart,W.outerEnd),j=j1(H,{...X,start:0,end:X.end-X.start},U),B=`@foreach(${q})
3345
3343
  `,V=`${B}${j}
3346
- @endforeach`;Z=Z.slice(0,W.outerStart)+V+Z.slice(W.outerEnd),J=W.outerStart+B.length}return Z}function ZY($){let Z=$,J=0;while(J<Z.length){let X=M1(Z,J);if(!X)break;let Y=d1(X.attrs,"v-if");if(Y===null){J=X.end;continue}let Q=[],G=n0(Z,X),z=H1(X.attrs,"v-if"),q=j1(Z.slice(G.outerStart,G.outerEnd),{...X,start:0,end:X.end-X.start},z);Q.push({type:"if",expr:Y,outerStart:G.outerStart,outerEnd:G.outerEnd,element:q,parsedTag:X});let K=G.outerEnd,U=!0;while(U){let V=Z.slice(K).match(/^\s*/),F=V?V[0].length:0,O=M1(Z,K+F);if(!O){U=!1;break}let _=d1(O.attrs,"v-else-if"),L=W4(O.attrs,"v-else");if(_!==null){let w=n0(Z,O),R=H1(O.attrs,"v-else-if"),D=j1(Z.slice(w.outerStart,w.outerEnd),{...O,start:0,end:O.end-O.start},R);Q.push({type:"else-if",expr:_,outerStart:K,outerEnd:w.outerEnd,element:D,parsedTag:O}),K=w.outerEnd}else if(L){let w=n0(Z,O),R=H1(O.attrs,"v-else"),D=j1(Z.slice(w.outerStart,w.outerEnd),{...O,start:0,end:O.end-O.start},R);Q.push({type:"else",outerStart:K,outerEnd:w.outerEnd,element:D,parsedTag:O}),U=!1}else U=!1}let W=[];for(let V of Q)if(V.type==="if")W.push(`@if(${V.expr})
3344
+ @endforeach`;Z=Z.slice(0,W.outerStart)+V+Z.slice(W.outerEnd),J=W.outerStart+B.length}return Z}function XY($){let Z=$,J=0;while(J<Z.length){let X=M1(Z,J);if(!X)break;let Y=d1(X.attrs,"v-if");if(Y===null){J=X.end;continue}let Q=[],G=n0(Z,X),z=H1(X.attrs,"v-if"),q=j1(Z.slice(G.outerStart,G.outerEnd),{...X,start:0,end:X.end-X.start},z);Q.push({type:"if",expr:Y,outerStart:G.outerStart,outerEnd:G.outerEnd,element:q,parsedTag:X});let K=G.outerEnd,U=!0;while(U){let V=Z.slice(K).match(/^\s*/),F=V?V[0].length:0,O=M1(Z,K+F);if(!O){U=!1;break}let _=d1(O.attrs,"v-else-if"),L=W4(O.attrs,"v-else");if(_!==null){let w=n0(Z,O),R=H1(O.attrs,"v-else-if"),D=j1(Z.slice(w.outerStart,w.outerEnd),{...O,start:0,end:O.end-O.start},R);Q.push({type:"else-if",expr:_,outerStart:K,outerEnd:w.outerEnd,element:D,parsedTag:O}),K=w.outerEnd}else if(L){let w=n0(Z,O),R=H1(O.attrs,"v-else"),D=j1(Z.slice(w.outerStart,w.outerEnd),{...O,start:0,end:O.end-O.start},R);Q.push({type:"else",outerStart:K,outerEnd:w.outerEnd,element:D,parsedTag:O}),U=!1}else U=!1}let W=[];for(let V of Q)if(V.type==="if")W.push(`@if(${V.expr})
3347
3345
  ${V.element}`);else if(V.type==="else-if")W.push(`@elseif(${V.expr})
3348
3346
  ${V.element}`);else W.push(`@else
3349
3347
  ${V.element}`);W.push("@endif");let H=W.join(`
3350
- `),j=Q[0].outerStart,B=Q[Q.length-1].outerEnd;Z=Z.slice(0,j)+H+Z.slice(B),J=j+H.length}return Z}function JY($){return $.replace(/\bv-show="([^"]*)"/g,'@show="$1"')}function XY($){let Z=$,J=0;while(J<Z.length){let X=M1(Z,J);if(!X)break;let Y=X.attrs,Q=!1,G=/v-model:([a-zA-Z_][a-zA-Z0-9_]*)(?:\.([a-zA-Z.]+))?\s*=\s*"([^"]*)"/,z=Y.match(G);while(z){Q=!0;let U=z[1],W=z[2],H=z[3];Y=Y.replace(z[0],""),Y+=` :${U}="${H}" @update:${U}="${H} = $event"`,z=Y.match(G)}if(Q){let U=n0(Z,X),W=Z.slice(U.outerStart,U.outerEnd),H=j1(W,{...X,start:0,end:X.end-X.start},Y);Z=Z.slice(0,U.outerStart)+H+Z.slice(U.outerEnd),J=U.outerStart+H.length;continue}let q=d1(X.attrs,"v-model");if(q===null){J=X.end;continue}if(aX.has(X.tag)){let U=X.attrs.replace(/\s*v-model="[^"]*"/g,"")+` @model="${q}"`,W=n0(Z,X),H=Z.slice(W.outerStart,W.outerEnd),j=j1(H,{...X,start:0,end:X.end-X.start},U);Z=Z.slice(0,W.outerStart)+j+Z.slice(W.outerEnd),J=W.outerStart+j.length}else{let U=X.attrs.replace(/\s*v-model="[^"]*"/g,"");U+=` :modelValue="${q}" @update:modelValue="${q} = $event"`;let W=n0(Z,X),H=Z.slice(W.outerStart,W.outerEnd),j=j1(H,{...X,start:0,end:X.end-X.start},U);Z=Z.slice(0,W.outerStart)+j+Z.slice(W.outerEnd),J=W.outerStart+j.length}}return Z}function YY($){return $.replace(/\bv-bind:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'@bind:$1="$2"')}function QY($){return $.replace(/\bv-on:([a-zA-Z_][a-zA-Z0-9_.-]*)\s*=\s*"([^"]*)"/g,'@$1="$2"')}function GY($){let Z=$,J=0;while(J<Z.length){let X=M1(Z,J);if(!X)break;let Y=d1(X.attrs,"v-html");if(Y===null){J=X.end;continue}if(X.selfClosing){J=X.end;continue}let Q=n0(Z,X),G=H1(X.attrs,"v-html"),z=X.selfClosing?" /":"",q=`<${X.tag}${G}${z}>{!! ${Y} !!}</${X.tag}>`;Z=Z.slice(0,Q.outerStart)+q+Z.slice(Q.outerEnd),J=Q.outerStart+q.length}return Z}function zY($){let Z=$,J=0;while(J<Z.length){let X=M1(Z,J);if(!X)break;let Y=d1(X.attrs,"v-text");if(Y===null){J=X.end;continue}if(X.selfClosing){J=X.end;continue}let Q=n0(Z,X),G=H1(X.attrs,"v-text"),z=X.selfClosing?" /":"",q=`<${X.tag}${G}${z}>{{ ${Y} }}</${X.tag}>`;Z=Z.slice(0,Q.outerStart)+q+Z.slice(Q.outerEnd),J=Q.outerStart+q.length}return Z}function qY($){return $.replace(/(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)\s+v-pre([^>]*>)/g,"$1$2 data-stx-skip$3").replace(/(<[a-zA-Z][a-zA-Z0-9-]*)\s+v-pre(\s[^>]*>|>)/g,"$1 data-stx-skip$2")}function KY($){let Z=$,J=0;while(J<Z.length){let X=M1(Z,J);if(!X)break;if(!W4(X.attrs,"v-once")){J=X.end;continue}let Y=H1(X.attrs,"v-once"),Q=n0(Z,X),G=Z.slice(Q.outerStart,Q.outerEnd),q=`@once
3348
+ `),j=Q[0].outerStart,B=Q[Q.length-1].outerEnd;Z=Z.slice(0,j)+H+Z.slice(B),J=j+H.length}return Z}function YY($){return $.replace(/\bv-show="([^"]*)"/g,'@show="$1"')}function QY($){let Z=$,J=0;while(J<Z.length){let X=M1(Z,J);if(!X)break;let Y=X.attrs,Q=!1,G=/v-model:([a-zA-Z_][a-zA-Z0-9_]*)(?:\.([a-zA-Z.]+))?\s*=\s*"([^"]*)"/,z=Y.match(G);while(z){Q=!0;let U=z[1],W=z[2],H=z[3];Y=Y.replace(z[0],""),Y+=` :${U}="${H}" @update:${U}="${H} = $event"`,z=Y.match(G)}if(Q){let U=n0(Z,X),W=Z.slice(U.outerStart,U.outerEnd),H=j1(W,{...X,start:0,end:X.end-X.start},Y);Z=Z.slice(0,U.outerStart)+H+Z.slice(U.outerEnd),J=U.outerStart+H.length;continue}let q=d1(X.attrs,"v-model");if(q===null){J=X.end;continue}if(eX.has(X.tag)){let U=X.attrs.replace(/\s*v-model="[^"]*"/g,"")+` @model="${q}"`,W=n0(Z,X),H=Z.slice(W.outerStart,W.outerEnd),j=j1(H,{...X,start:0,end:X.end-X.start},U);Z=Z.slice(0,W.outerStart)+j+Z.slice(W.outerEnd),J=W.outerStart+j.length}else{let U=X.attrs.replace(/\s*v-model="[^"]*"/g,"");U+=` :modelValue="${q}" @update:modelValue="${q} = $event"`;let W=n0(Z,X),H=Z.slice(W.outerStart,W.outerEnd),j=j1(H,{...X,start:0,end:X.end-X.start},U);Z=Z.slice(0,W.outerStart)+j+Z.slice(W.outerEnd),J=W.outerStart+j.length}}return Z}function GY($){return $.replace(/\bv-bind:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'@bind:$1="$2"')}function zY($){return $.replace(/\bv-on:([a-zA-Z_][a-zA-Z0-9_.-]*)\s*=\s*"([^"]*)"/g,'@$1="$2"')}function qY($){let Z=$,J=0;while(J<Z.length){let X=M1(Z,J);if(!X)break;let Y=d1(X.attrs,"v-html");if(Y===null){J=X.end;continue}if(X.selfClosing){J=X.end;continue}let Q=n0(Z,X),G=H1(X.attrs,"v-html"),z=X.selfClosing?" /":"",q=`<${X.tag}${G}${z}>{!! ${Y} !!}</${X.tag}>`;Z=Z.slice(0,Q.outerStart)+q+Z.slice(Q.outerEnd),J=Q.outerStart+q.length}return Z}function KY($){let Z=$,J=0;while(J<Z.length){let X=M1(Z,J);if(!X)break;let Y=d1(X.attrs,"v-text");if(Y===null){J=X.end;continue}if(X.selfClosing){J=X.end;continue}let Q=n0(Z,X),G=H1(X.attrs,"v-text"),z=X.selfClosing?" /":"",q=`<${X.tag}${G}${z}>{{ ${Y} }}</${X.tag}>`;Z=Z.slice(0,Q.outerStart)+q+Z.slice(Q.outerEnd),J=Q.outerStart+q.length}return Z}function UY($){return $.replace(/(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)\s+v-pre([^>]*>)/g,"$1$2 data-stx-skip$3").replace(/(<[a-zA-Z][a-zA-Z0-9-]*)\s+v-pre(\s[^>]*>|>)/g,"$1 data-stx-skip$2")}function WY($){let Z=$,J=0;while(J<Z.length){let X=M1(Z,J);if(!X)break;if(!W4(X.attrs,"v-once")){J=X.end;continue}let Y=H1(X.attrs,"v-once"),Q=n0(Z,X),G=Z.slice(Q.outerStart,Q.outerEnd),q=`@once
3351
3349
  ${j1(G,{...X,start:0,end:X.end-X.start},Y)}
3352
- @endonce`;Z=Z.slice(0,Q.outerStart)+q+Z.slice(Q.outerEnd),J=Q.outerStart+q.length}return Z}function UY($){return $.replace(/\bv-memo="([^"]*)"/g,'data-stx-memo="$1"')}function WY($){return $.replace(/\bv-slot:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'#$1="$2"').replace(/\bv-slot:([a-zA-Z_][a-zA-Z0-9_-]*)(?=[\s>])/g,"#$1").replace(/\bv-slot\s*=\s*"([^"]*)"/g,'#default="$1"')}function H4($){if(!eX($))return $;let Z=$;return Z=$Y(Z),Z=ZY(Z),Z=KY(Z),Z=YY(Z),Z=QY(Z),Z=XY(Z),Z=JY(Z),Z=WY(Z),Z=GY(Z),Z=zY(Z),Z=qY(Z),Z=UY(Z),Z}function W9($){return $.replace(/--/g,"- -").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var h5=new Set(["a","abbr","address","article","aside","audio","b","bdi","bdo","blockquote","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","meter","nav","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","small","span","strong","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","u","ul","video"]),HY=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]);function j4($,Z){let J=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec($),X=J?J[1]:$,Y=e(X,Z);if(Y&&typeof Y==="string")return Y;let Q=X.trim();return h5.has(Q)?Q:null}function B4($){let Z=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec($);return Z?Z[1]:$}function V4($,Z,J){let X=Z.replace(/\s*(?::is|v-bind:is)\s*=\s*"[^"]*"/gi,"").trim(),Y=X?`<${$} ${X}>`:`<${$}>`;if(HY.has($))return X?`<${$} ${X}>`:`<${$}>`;return`${Y}${J}</${$}>`}async function L4($,Z,J,X,Y){let Q=$,G=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*)>([\s\S]*?)<\/component>/gi,z=[],q;while((q=G.exec(Q))!==null)z.push({full:q[0],expr:q[1],attrs:q[2],slotContent:q[3],index:q.index});for(let K=z.length-1;K>=0;K--){let U=z[K];try{let W=j4(U.expr,Z);if(!W||typeof W!=="string"){let _=`<!-- dynamic component: could not resolve "${W9(B4(U.expr))}" -->`;Q=Q.slice(0,U.index)+_+Q.slice(U.index+U.full.length);continue}if(h5.has(W)){let _=V4(W,U.attrs,U.slotContent);Q=Q.slice(0,U.index)+_+Q.slice(U.index+U.full.length);continue}let H=U.attrs.trim(),j={},B=/(?::([a-zA-Z_][a-zA-Z0-9_-]*)|([a-zA-Z_][a-zA-Z0-9_-]*))\s*=\s*"([^"]*)"/g,V;while((V=B.exec(H))!==null){let _=V[1]||V[2],L=V[3];if(V[1])try{j[_]=e(L,Z)}catch{j[_]=L}else j[_]=L}let F=X.componentsDir||"components",O=await A1(W,j,U.slotContent,F,Z,J,X,new Set,Y??new Set);Q=Q.slice(0,U.index)+O+Q.slice(U.index+U.full.length)}catch(W){let H=W instanceof Error?W.message:String(W),j=`<!-- dynamic component error: ${W9(H)} -->`;Q=Q.slice(0,U.index)+j+Q.slice(U.index+U.full.length)}}return Q=await jY(Q,Z,J,X,Y),Q}async function jY($,Z,J,X,Y){let Q=$,G=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*?)\/>/gi,z=[],q;while((q=G.exec(Q))!==null)z.push({full:q[0],expr:q[1],attrs:q[2],index:q.index});for(let K=z.length-1;K>=0;K--){let U=z[K];try{let W=j4(U.expr,Z);if(!W||typeof W!=="string"){let B=`<!-- dynamic component: could not resolve "${W9(B4(U.expr))}" -->`;Q=Q.slice(0,U.index)+B+Q.slice(U.index+U.full.length);continue}if(h5.has(W)){let B=V4(W,U.attrs,"");Q=Q.slice(0,U.index)+B+Q.slice(U.index+U.full.length);continue}let H=X.componentsDir||"components",j=await A1(W,{},"",H,Z,J,X,new Set,Y??new Set);Q=Q.slice(0,U.index)+j+Q.slice(U.index+U.full.length)}catch(W){let H=W instanceof Error?W.message:String(W),j=`<!-- dynamic component error: ${W9(H)} -->`;Q=Q.slice(0,U.index)+j+Q.slice(U.index+U.full.length)}}return Q}function _4($,Z=""){let J=`${$}${Z}`,X=0;for(let Y=0;Y<J.length;Y++){let Q=J.charCodeAt(Y);X=(X<<5)-X+Q,X=X&X}return`stx-${Math.abs(X).toString(36)}`}function O4($,Z,J={}){let{prefix:X="",preserveHost:Y=!0,scopeKeyframes:Q=!0,scopeCustomProperties:G=!1}=J;if(!$.trim())return"";let z=u5($),q=[],K=new Map;if(Q)for(let U of z){let W=U.selector.match(/@keyframes\s+([a-z_-][a-z0-9_-]*)/i);if(W){let H=W[1],j=`${Z}_${H}`;K.set(H,j)}}for(let U of z){let W=F4(U,Z,X,Y,K,G);q.push(W)}return q.join(`
3350
+ @endonce`;Z=Z.slice(0,Q.outerStart)+q+Z.slice(Q.outerEnd),J=Q.outerStart+q.length}return Z}function HY($){return $.replace(/\bv-memo="([^"]*)"/g,'data-stx-memo="$1"')}function jY($){return $.replace(/\bv-slot:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'#$1="$2"').replace(/\bv-slot:([a-zA-Z_][a-zA-Z0-9_-]*)(?=[\s>])/g,"#$1").replace(/\bv-slot\s*=\s*"([^"]*)"/g,'#default="$1"')}function H4($){if(!ZY($))return $;let Z=$;return Z=JY(Z),Z=XY(Z),Z=WY(Z),Z=GY(Z),Z=zY(Z),Z=QY(Z),Z=YY(Z),Z=jY(Z),Z=qY(Z),Z=KY(Z),Z=UY(Z),Z=HY(Z),Z}function W9($){return $.replace(/--/g,"- -").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var h5=new Set(["a","abbr","address","article","aside","audio","b","bdi","bdo","blockquote","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","meter","nav","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","small","span","strong","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","u","ul","video"]),BY=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]);function j4($,Z){let J=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec($),X=J?J[1]:$,Y=e(X,Z);if(Y&&typeof Y==="string")return Y;let Q=X.trim();return h5.has(Q)?Q:null}function B4($){let Z=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec($);return Z?Z[1]:$}function V4($,Z,J){let X=Z.replace(/\s*(?::is|v-bind:is)\s*=\s*"[^"]*"/gi,"").trim(),Y=X?`<${$} ${X}>`:`<${$}>`;if(BY.has($))return X?`<${$} ${X}>`:`<${$}>`;return`${Y}${J}</${$}>`}async function L4($,Z,J,X,Y){let Q=$,G=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*)>([\s\S]*?)<\/component>/gi,z=[],q;while((q=G.exec(Q))!==null)z.push({full:q[0],expr:q[1],attrs:q[2],slotContent:q[3],index:q.index});for(let K=z.length-1;K>=0;K--){let U=z[K];try{let W=j4(U.expr,Z);if(!W||typeof W!=="string"){let _=`<!-- dynamic component: could not resolve "${W9(B4(U.expr))}" -->`;Q=Q.slice(0,U.index)+_+Q.slice(U.index+U.full.length);continue}if(h5.has(W)){let _=V4(W,U.attrs,U.slotContent);Q=Q.slice(0,U.index)+_+Q.slice(U.index+U.full.length);continue}let H=U.attrs.trim(),j={},B=/(?::([a-zA-Z_][a-zA-Z0-9_-]*)|([a-zA-Z_][a-zA-Z0-9_-]*))\s*=\s*"([^"]*)"/g,V;while((V=B.exec(H))!==null){let _=V[1]||V[2],L=V[3];if(V[1])try{j[_]=e(L,Z)}catch{j[_]=L}else j[_]=L}let F=X.componentsDir||"components",O=await A1(W,j,U.slotContent,F,Z,J,X,new Set,Y??new Set);Q=Q.slice(0,U.index)+O+Q.slice(U.index+U.full.length)}catch(W){let H=W instanceof Error?W.message:String(W),j=`<!-- dynamic component error: ${W9(H)} -->`;Q=Q.slice(0,U.index)+j+Q.slice(U.index+U.full.length)}}return Q=await VY(Q,Z,J,X,Y),Q}async function VY($,Z,J,X,Y){let Q=$,G=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*?)\/>/gi,z=[],q;while((q=G.exec(Q))!==null)z.push({full:q[0],expr:q[1],attrs:q[2],index:q.index});for(let K=z.length-1;K>=0;K--){let U=z[K];try{let W=j4(U.expr,Z);if(!W||typeof W!=="string"){let B=`<!-- dynamic component: could not resolve "${W9(B4(U.expr))}" -->`;Q=Q.slice(0,U.index)+B+Q.slice(U.index+U.full.length);continue}if(h5.has(W)){let B=V4(W,U.attrs,"");Q=Q.slice(0,U.index)+B+Q.slice(U.index+U.full.length);continue}let H=X.componentsDir||"components",j=await A1(W,{},"",H,Z,J,X,new Set,Y??new Set);Q=Q.slice(0,U.index)+j+Q.slice(U.index+U.full.length)}catch(W){let H=W instanceof Error?W.message:String(W),j=`<!-- dynamic component error: ${W9(H)} -->`;Q=Q.slice(0,U.index)+j+Q.slice(U.index+U.full.length)}}return Q}function _4($,Z=""){let J=`${$}${Z}`,X=0;for(let Y=0;Y<J.length;Y++){let Q=J.charCodeAt(Y);X=(X<<5)-X+Q,X=X&X}return`stx-${Math.abs(X).toString(36)}`}function O4($,Z,J={}){let{prefix:X="",preserveHost:Y=!0,scopeKeyframes:Q=!0,scopeCustomProperties:G=!1}=J;if(!$.trim())return"";let z=u5($),q=[],K=new Map;if(Q)for(let U of z){let W=U.selector.match(/@keyframes\s+([a-z_-][a-z0-9_-]*)/i);if(W){let H=W[1],j=`${Z}_${H}`;K.set(H,j)}}for(let U of z){let W=F4(U,Z,X,Y,K,G);q.push(W)}return q.join(`
3353
3351
 
3354
3352
  `)}function u5($){let Z=[],J=$.replace(/\/\*[\s\S]*?\*\//g,""),X=0,Y="",Q=!1,G="";for(let z=0;z<J.length;z++){let q=J[z];if(q==="@"&&X===0)Q=!0;if(q==="{")X++;else if(q==="}"){if(X--,X===0){if(Q){G+=q;let K=G.match(/@([a-z-]+)\s*([^{]*)\{([\s\S]*)\}/i);if(K){let[,U,W,H]=K;if(U==="keyframes")Z.push({selector:`@keyframes ${W.trim()}`,declarations:H.trim()});else if(U==="media"||U==="supports"||U==="container"){let j=u5(H);Z.push({selector:`@${U} ${W.trim()}`,declarations:j.map((B)=>`${B.selector} { ${B.declarations} }`).join(`
3355
3353
  `)})}else Z.push({selector:`@${U} ${W.trim()}`,declarations:H.trim()})}G="",Q=!1}else if(Y.trim()){Y+=q;let K=Y.match(/([^{]+)\{([^}]*)\}/);if(K)Z.push({selector:K[1].trim(),declarations:K[2].trim()});Y=""}continue}}if(Q)G+=q;else Y+=q}return Z}function F4($,Z,J,X,Y,Q){let{selector:G,declarations:z}=$;if(G.startsWith("@")){if(G.startsWith("@keyframes")){let U=G.replace("@keyframes ","").trim();return`@keyframes ${Y.get(U)||U} { ${z} }`}if(G.startsWith("@media")||G.startsWith("@supports")||G.startsWith("@container")){let W=u5(`x { ${z} }`.replace(/x \{ /,"").replace(/ \}$/,"")).map((H)=>F4(H,Z,J,X,Y,Q)).join(`
3356
3354
  `);return`${G} {
3357
3355
  ${W}
3358
- }`}return`${G} { ${z} }`}let q=BY(G,Z,J,X),K=z;for(let[U,W]of Y)K=K.replace(new RegExp(`\\b${U}\\b`,"g"),W);if(Q)K=K.replace(/--([a-z-]+)/gi,`--${Z}-$1`);return`${q} { ${K} }`}function BY($,Z,J,X){let Y=$.split(",").map((G)=>G.trim()),Q=[];for(let G of Y){if(G.startsWith(":host")){if(X)Q.push(G);else{let K=G.replace(/:host(\([^)]*\))?/,`.${Z}$1`);Q.push(K)}continue}if(G.includes("::slotted")){Q.push(G);continue}if(G===":root"){Q.push(`:root .${Z}`);continue}let z=J?`${J} .${Z}`:`.${Z}`;Q.push(`${z} ${G}`);let q=VY(G,Z);if(q)Q.push(J?`${J} ${q}`:q)}return Q.join(", ")}function VY($,Z){let J=0,X=$.length;for(let q=0;q<$.length;q++){let K=$[q];if(K==="["||K==="(")J++;else if(K==="]"||K===")")J--;else if(J===0&&(K===" "||K===">"||K==="+"||K==="~")){X=q;break}}let Y=$.slice(0,X),Q=$.slice(X);if(!Y)return"";let G=Y.length,z=0;for(let q=0;q<Y.length;q++){let K=Y[q];if(K==="["||K==="(")z++;else if(K==="]"||K===")")z--;else if(J===0&&z===0&&K===":"){G=q;break}}return`${Y.slice(0,G)}.${Z}${Y.slice(G)}${Q}`}var D4=String.raw`(?<![\w-])scoped(?![\w-])`,d5=/<style\s+([^>]*)>/gi,w4=/<style\s+([^>]*)>([\s\S]*?)<\/style>/gi,N4=new RegExp(D4,"i"),LY=new RegExp(D4,"gi");function _Y($){d5.lastIndex=0;let Z=d5.exec($);while(Z!==null){if(N4.test(Z[1]))return!0;Z=d5.exec($)}return!1}function M4($){let Z=new Set;return $.replace(/<style\b[^>]*\bdata-stx-scoped(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?[^>]*>[\s\S]*?<\/style>\s*/gi,(J)=>{let X=J.trim();if(Z.has(X))return"";return Z.add(X),J})}function H9($,Z){if(!_Y($))return{html:$,hasScoped:!1};let J=_4(Z),X=`data-v-${J}`,Y=$,Q=!1;if(w4.lastIndex=0,Y=Y.replace(w4,(G,z,q)=>{if(!N4.test(z))return G;Q=!0;let K=OY(q,X),U=z.replace(LY,"").trim(),W=U?` ${U}`:"";return`<style data-stx-scoped="${J}"${W}>${K}</style>`}),!Q)return{html:$,hasScoped:!1};return Y=wY(Y,X),{html:Y,hasScoped:!0}}function OY($,Z){return O4($,"__SCOPE_PLACEHOLDER__",{preserveHost:!1}).replace(/\.(__SCOPE_PLACEHOLDER__) /g,`[${Z}] `).replace(/\.(__SCOPE_PLACEHOLDER__)/g,`[${Z}]`)}var FY=($)=>`\x00stx-scope-mask-${$}\x00`,R4=/\u0000stx-scope-mask-(\d+)\u0000/g;function wY($,Z){let J=p0($,(Y,Q)=>{let G=Y1(Y,Q);return G>Q?G:y1(Y,Q)},(Y,Q)=>FY(Q)),X=RY(J.output,Z);return R4.lastIndex=0,X.replace(R4,(Y,Q)=>J.tokens[Number(Q)])}function RY($,Z){let J=new Set(["script","style","template","html","head","body","meta","link","title","base","!doctype","!DOCTYPE"]);return $.replace(/<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*)?\/?>/g,(X,Y,Q)=>{if(J.has(Y.toLowerCase()))return X;if(X.includes(Z))return X;if(Y.toLowerCase()==="style"||Y.toLowerCase()==="script")return X;if(Q)return X.replace(`<${Y}${Q}`,`<${Y} ${Z}${Q}`);if(X.endsWith("/>"))return`<${Y} ${Z} />`;return`<${Y} ${Z}>`})}function m5(){return{afterOpen:[],beforeClose:[]}}function DY($){return $.afterOpen.length>0||$.beforeClose.length>0}function k4($,Z){if(!DY(Z))return $;let J=Z.afterOpen.join(""),X=Z.beforeClose.join(""),Y=$.lastIndexOf("</head>"),Q=J?_2($):null,G=X&&Y!==-1?Y:null;if(Q===null&&G===null)return $;if(Q!==null&&G!==null)return`${$.slice(0,Q)}${J}${$.slice(Q,G)}${X}${$.slice(G)}`;if(Q!==null)return`${$.slice(0,Q)}${J}${$.slice(Q)}`;return`${$.slice(0,G)}${X}${$.slice(G)}`}var A4=/\s*<meta\b[^>]*\bcharset\b[^>]*>/iy;function _2($){let Z=/<head\b[^>]*>/i.exec($);if(!Z)return null;let J=Z.index+Z[0].length;A4.lastIndex=J;let X=A4.exec($);return X?J+X[0].length:J}var c5="data-stx-color-mode-boot",NY="__STX_COLOR_MODE__",MY=new Set(["light","dark","auto","system"]),AY=new Set(["auto","system"]),kY=/^[a-z][\w:-]*$/i,IY=/^[\w-]+$/;function TY($){let Z=$.storageKey??"stx-color-mode",J=$.initialMode??"auto",X=$.darkClass===void 0?"dark":$.darkClass,Y=$.attribute??null,Q=$.autoValue??null;if(typeof Z!=="string"||Z.length===0)throw Error("colorMode.storageKey must be a non-empty string");if(!MY.has(J))throw Error(`colorMode.initialMode must be one of light, dark, auto, system \u2014 got ${JSON.stringify(J)}`);if(X!==null&&(typeof X!=="string"||!IY.test(X)))throw Error(`colorMode.darkClass must be a single CSS class name, or null to opt out \u2014 got ${JSON.stringify(X)}`);if(Y!==null&&(typeof Y!=="string"||!kY.test(Y)))throw Error(`colorMode.attribute must be a valid HTML attribute name \u2014 got ${JSON.stringify(Y)}`);if(Q!==null&&!AY.has(Q))throw Error(`colorMode.autoValue must be 'auto' or 'system' \u2014 got ${JSON.stringify(Q)}`);if(X===null&&Y===null)throw Error("colorMode needs at least one of darkClass or attribute \u2014 with both null nothing would mark the mode on <html>");return{storageKey:Z,initialMode:J==="system"?"auto":J,darkClass:X,attribute:Y,autoValue:Q}}function EY($){return JSON.stringify($).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function p5($={}){let Z=TY($),X=`(function(){"use strict";var c=${EY(Z)};var p=c.initialMode;var a=c.autoValue;try{var v=localStorage.getItem(c.storageKey);if(v==="light"||v==="dark"){p=v}else if(v==="auto"||v==="system"){p="auto";if(!a)a=v}}catch(e){}var m=p;if(p==="auto"){try{m=matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){m="light"}}var r=document.documentElement;if(c.attribute)r.setAttribute(c.attribute,m);if(c.darkClass){if(m==="dark")r.classList.add(c.darkClass);else r.classList.remove(c.darkClass)}try{window.${NY}={storageKey:c.storageKey,initialMode:c.initialMode,darkClass:c.darkClass,attribute:c.attribute,autoValue:a||"auto",preference:p,mode:m}}catch(e){}}());`;return`<script ${c5}>${X}</script>`}function E4($,Z={}){if($.includes(c5))return $;let J=l5($);if(J===null)return $;let X=p5(Z);return`${$.slice(0,J)}
3359
- ${X}${$.slice(J)}`}var l5=_2,bY=new RegExp(`<script\\b[^>]*\\b${c5}\\b[^>]*>[\\s\\S]*?<\\/script>`,"i"),I4=/<meta\b[^>]*\bcharset\b[^>]*>/gi,T4=/<\/head>/gi;function yY($){let Z=/<head\b[^>]*>/i.exec($);if(!Z)return $;let J=Z.index+Z[0].length;T4.lastIndex=J;let X=T4.exec($),Y=X?X.index:$.length;I4.lastIndex=J;let Q=I4.exec($);if(!Q||Q.index>=Y)return $;if($.slice(J,Q.index).trim()==="")return $;let G=Q.index+Q[0].length;return`${$.slice(0,J)}
3360
- ${Q[0]}${$.slice(J,Q.index)}${$.slice(G,Y)}${$.slice(Y)}`}function b4($){return CY(yY($))}function CY($){let Z=bY.exec($);if(!Z)return $;let J=l5($);if(J===null)return $;if(Z.index<=J||$.slice(J,Z.index).trim()==="")return $;let X=$.slice(0,Z.index)+$.slice(Z.index+Z[0].length),Y=l5(X);if(Y===null)return $;return`${X.slice(0,Y)}
3361
- ${Z[0]}${X.slice(Y)}`}var mW="stx-build",lW="X-STX-Build",j9=null;function y4(){if(j9===null)j9=process.env.STX_BUILD_ID||`${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`;return j9}function cW($){j9=$}function pW($,Z=y4()){let J=i5($,Z);if(J===null)return $;let X=/<head\b[^>]*>/i.exec($),Y=X.index+X[0].length;return`${$.slice(0,Y)}${J}${$.slice(Y)}`}function i5($,Z=y4()){if($.includes('name="stx-build"'))return null;if(!/<head\b[^>]*>/i.test($))return null;return`
3362
- <meta name="stx-build" content="${Z}">`}var P4="<style data-stx-cloak>[x-cloak]{display:none !important}</style>",B9="data-stx-html-attrs",V9="data-stx-html-class",v4=/^[A-Za-z_:][\w:.-]*$/;function J1($){return String($).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function SY($){return String($).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function l1($){if($.name)return`name="${$.name}"`;if($.property)return`property="${$.property}"`;if($.charset!=null)return"charset=";if($["http-equiv"])return`http-equiv="${$["http-equiv"]}"`;return""}function m1($,Z){return Object.entries($).filter(([J])=>!Z?.(J)).map(([J,X])=>`${J}="${J1(String(X))}"`).join(" ")}function PY($={},Z="en"){let J=[],X=[],Y="",Q=Z;for(let[z,q]of Object.entries($||{})){if(q==null)continue;let K=z.trim();if(!v4.test(K))continue;let U=K.toLowerCase();if(U==="lang"){Q=String(q);continue}if(U==="class"){Y=String(q).trim();continue}J.push(` ${K}="${J1(String(q))}"`),X.push(K)}let G=` lang="${J1(Q)}"`;if(Y)G+=` class="${J1(Y)}"`;if(G+=J.join(""),Y)G+=` ${V9}="${J1(Y)}"`;if(X.length)G+=` ${B9}="${J1(X.join(" "))}"`;return G}function f4($={},Z={}){let J={...$,...Z};if($.class&&Z.class){let X=$.class.split(/\s+/).filter(Boolean);for(let Y of Z.class.split(/\s+/).filter(Boolean))if(!X.includes(Y))X.push(Y);J.class=X.join(" ")}return J}function x4($,Z={}){if(!Z||Object.keys(Z).length===0)return $;let J=$.match(/<html\b([^>]*)>/i);if(!J)return $;let X={},Y=[],Q=/([A-Za-z_:][\w:.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,G;while((G=Q.exec(J[1]))!==null){let U=G[1];if(!(U in X))Y.push(U);X[U]=G[2]??G[3]??G[4]??""}let z=[],q=[];for(let[U,W]of Object.entries(Z)){if(W==null)continue;let H=U.trim();if(!v4.test(H))continue;let j=H.toLowerCase();if(j==="class"){let B=(X.class||"").split(/\s+/).filter(Boolean);for(let V of String(W).split(/\s+/).filter(Boolean))if(!B.includes(V))B.push(V),z.push(V);if(!("class"in X))Y.push("class");X.class=B.join(" ");continue}if(!(H in X))Y.push(H);if(X[H]=String(W),j!=="lang")q.push(H)}if(z.length){if(!(V9 in X))Y.push(V9);X[V9]=z.join(" ")}if(q.length){if(!(B9 in X))Y.push(B9);X[B9]=q.join(" ")}let K=Y.map((U)=>` ${U}="${J1(X[U])}"`).join("");return $.replace(J[0],()=>`<html${K}>`)}function oW($){let Z=s5($);if(Z===null)return $;let J=$.lastIndexOf("</head>");return`${$.slice(0,J)}${Z}${$.slice(J)}`}function s5($){if($.includes("data-stx-cloak"))return null;if($.lastIndexOf("</head>")===-1)return null;return`${P4}
3363
- `}function vY($){let Z=[],J=0;while(J<$.length){let Q=$.slice(J),G=Q.match(/^\s+/);if(G){J+=G[0].length;continue}if(Q.startsWith("<!--")){let W=$.indexOf("-->",J);if(W===-1)break;J=W+3;continue}let z=Q.match(/^<script\b[^>]*>/i);if(z){let W=$.toLowerCase().indexOf("</script>",J+z[0].length);if(W===-1)break;J=W+9;continue}let q=Q.match(/^<link\b[^>]*>/i);if(q){Z.push(q[0]),J+=q[0].length;continue}let K=Q.match(/^<meta\b[^>]*>/i);if(K){Z.push(K[0]),J+=K[0].length;continue}let U=Q.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(U){Z.push(U[0]),J+=U[0].length;continue}break}if(Z.length===0)return{body:$,hoisted:Z};let X="",Y=0;while(Y<$.length&&Y<J){let Q=$.slice(Y),G=Q.match(/^<link\b[^>]*>/i);if(G&&Z.includes(G[0])){Y+=G[0].length;continue}let z=Q.match(/^<meta\b[^>]*>/i);if(z&&Z.includes(z[0])){Y+=z[0].length;continue}let q=Q.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(q&&Z.includes(q[0])){Y+=q[0].length;continue}X+=$[Y],Y++}return X+=$.slice(J),{body:X,hoisted:Z}}function fY($,Z={},J={}){let{title:X="stx App",lang:Y="en",meta:Q=[],link:G=[],script:z=[],headRaw:q="",htmlAttrs:K={},bodyClass:U="",bodyAttrs:W={}}=Z,H=J.title||X,j=[{charset:"UTF-8"},{name:"viewport",content:"width=device-width, initial-scale=1.0"}],B=new Set(Q.map(l1).filter(Boolean)),F=[...j.filter((A)=>!B.has(l1(A))),...Q].map((A)=>{return` <meta ${m1(A)}>`}).join(`
3356
+ }`}return`${G} { ${z} }`}let q=LY(G,Z,J,X),K=z;for(let[U,W]of Y)K=K.replace(new RegExp(`\\b${U}\\b`,"g"),W);if(Q)K=K.replace(/--([a-z-]+)/gi,`--${Z}-$1`);return`${q} { ${K} }`}function LY($,Z,J,X){let Y=$.split(",").map((G)=>G.trim()),Q=[];for(let G of Y){if(G.startsWith(":host")){if(X)Q.push(G);else{let K=G.replace(/:host(\([^)]*\))?/,`.${Z}$1`);Q.push(K)}continue}if(G.includes("::slotted")){Q.push(G);continue}if(G===":root"){Q.push(`:root .${Z}`);continue}let z=J?`${J} .${Z}`:`.${Z}`;Q.push(`${z} ${G}`);let q=_Y(G,Z);if(q)Q.push(J?`${J} ${q}`:q)}return Q.join(", ")}function _Y($,Z){let J=0,X=$.length;for(let q=0;q<$.length;q++){let K=$[q];if(K==="["||K==="(")J++;else if(K==="]"||K===")")J--;else if(J===0&&(K===" "||K===">"||K==="+"||K==="~")){X=q;break}}let Y=$.slice(0,X),Q=$.slice(X);if(!Y)return"";let G=Y.length,z=0;for(let q=0;q<Y.length;q++){let K=Y[q];if(K==="["||K==="(")z++;else if(K==="]"||K===")")z--;else if(J===0&&z===0&&K===":"){G=q;break}}return`${Y.slice(0,G)}.${Z}${Y.slice(G)}${Q}`}var D4=String.raw`(?<![\w-])scoped(?![\w-])`,d5=/<style\s+([^>]*)>/gi,w4=/<style\s+([^>]*)>([\s\S]*?)<\/style>/gi,N4=new RegExp(D4,"i"),OY=new RegExp(D4,"gi");function FY($){d5.lastIndex=0;let Z=d5.exec($);while(Z!==null){if(N4.test(Z[1]))return!0;Z=d5.exec($)}return!1}function M4($){let Z=new Set;return $.replace(/<style\b[^>]*\bdata-stx-scoped(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?[^>]*>[\s\S]*?<\/style>\s*/gi,(J)=>{let X=J.trim();if(Z.has(X))return"";return Z.add(X),J})}function H9($,Z){if(!FY($))return{html:$,hasScoped:!1};let J=_4(Z),X=`data-v-${J}`,Y=$,Q=!1;if(w4.lastIndex=0,Y=Y.replace(w4,(G,z,q)=>{if(!N4.test(z))return G;Q=!0;let K=wY(q,X),U=z.replace(OY,"").trim(),W=U?` ${U}`:"";return`<style data-stx-scoped="${J}"${W}>${K}</style>`}),!Q)return{html:$,hasScoped:!1};return Y=DY(Y,X),{html:Y,hasScoped:!0}}function wY($,Z){return O4($,"__SCOPE_PLACEHOLDER__",{preserveHost:!1}).replace(/\.(__SCOPE_PLACEHOLDER__) /g,`[${Z}] `).replace(/\.(__SCOPE_PLACEHOLDER__)/g,`[${Z}]`)}var RY=($)=>`\x00stx-scope-mask-${$}\x00`,R4=/\u0000stx-scope-mask-(\d+)\u0000/g;function DY($,Z){let J=p0($,(Y,Q)=>{let G=Y1(Y,Q);return G>Q?G:y1(Y,Q)},(Y,Q)=>RY(Q)),X=NY(J.output,Z);return R4.lastIndex=0,X.replace(R4,(Y,Q)=>J.tokens[Number(Q)])}function NY($,Z){let J=new Set(["script","style","template","html","head","body","meta","link","title","base","!doctype","!DOCTYPE"]);return $.replace(/<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*)?\/?>/g,(X,Y,Q)=>{if(J.has(Y.toLowerCase()))return X;if(X.includes(Z))return X;if(Y.toLowerCase()==="style"||Y.toLowerCase()==="script")return X;if(Q)return X.replace(`<${Y}${Q}`,`<${Y} ${Z}${Q}`);if(X.endsWith("/>"))return`<${Y} ${Z} />`;return`<${Y} ${Z}>`})}function m5(){return{afterOpen:[],beforeClose:[]}}function MY($){return $.afterOpen.length>0||$.beforeClose.length>0}function k4($,Z){if(!MY(Z))return $;let J=Z.afterOpen.join(""),X=Z.beforeClose.join(""),Y=$.lastIndexOf("</head>"),Q=J?_2($):null,G=X&&Y!==-1?Y:null;if(Q===null&&G===null)return $;if(Q!==null&&G!==null)return`${$.slice(0,Q)}${J}${$.slice(Q,G)}${X}${$.slice(G)}`;if(Q!==null)return`${$.slice(0,Q)}${J}${$.slice(Q)}`;return`${$.slice(0,G)}${X}${$.slice(G)}`}var A4=/\s*<meta\b[^>]*\bcharset\b[^>]*>/iy;function _2($){let Z=/<head\b[^>]*>/i.exec($);if(!Z)return null;let J=Z.index+Z[0].length;A4.lastIndex=J;let X=A4.exec($);return X?J+X[0].length:J}var c5="data-stx-color-mode-boot",AY="__STX_COLOR_MODE__",kY=new Set(["light","dark","auto","system"]),IY=new Set(["auto","system"]),TY=/^[a-z][\w:-]*$/i,EY=/^[\w-]+$/;function bY($){let Z=$.storageKey??"stx-color-mode",J=$.initialMode??"auto",X=$.darkClass===void 0?"dark":$.darkClass,Y=$.attribute??null,Q=$.autoValue??null;if(typeof Z!=="string"||Z.length===0)throw Error("colorMode.storageKey must be a non-empty string");if(!kY.has(J))throw Error(`colorMode.initialMode must be one of light, dark, auto, system \u2014 got ${JSON.stringify(J)}`);if(X!==null&&(typeof X!=="string"||!EY.test(X)))throw Error(`colorMode.darkClass must be a single CSS class name, or null to opt out \u2014 got ${JSON.stringify(X)}`);if(Y!==null&&(typeof Y!=="string"||!TY.test(Y)))throw Error(`colorMode.attribute must be a valid HTML attribute name \u2014 got ${JSON.stringify(Y)}`);if(Q!==null&&!IY.has(Q))throw Error(`colorMode.autoValue must be 'auto' or 'system' \u2014 got ${JSON.stringify(Q)}`);if(X===null&&Y===null)throw Error("colorMode needs at least one of darkClass or attribute \u2014 with both null nothing would mark the mode on <html>");return{storageKey:Z,initialMode:J==="system"?"auto":J,darkClass:X,attribute:Y,autoValue:Q}}function yY($){return JSON.stringify($).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function p5($={}){let Z=bY($),X=`(function(){"use strict";var c=${yY(Z)};var p=c.initialMode;var a=c.autoValue;try{var v=localStorage.getItem(c.storageKey);if(v==="light"||v==="dark"){p=v}else if(v==="auto"||v==="system"){p="auto";if(!a)a=v}}catch(e){}var m=p;if(p==="auto"){try{m=matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){m="light"}}var r=document.documentElement;if(c.attribute)r.setAttribute(c.attribute,m);if(c.darkClass){if(m==="dark")r.classList.add(c.darkClass);else r.classList.remove(c.darkClass)}try{window.${AY}={storageKey:c.storageKey,initialMode:c.initialMode,darkClass:c.darkClass,attribute:c.attribute,autoValue:a||"auto",preference:p,mode:m}}catch(e){}}());`;return`<script ${c5}>${X}</script>`}function E4($,Z={}){if($.includes(c5))return $;let J=l5($);if(J===null)return $;let X=p5(Z);return`${$.slice(0,J)}
3357
+ ${X}${$.slice(J)}`}var l5=_2,CY=new RegExp(`<script\\b[^>]*\\b${c5}\\b[^>]*>[\\s\\S]*?<\\/script>`,"i"),I4=/<meta\b[^>]*\bcharset\b[^>]*>/gi,T4=/<\/head>/gi;function SY($){let Z=/<head\b[^>]*>/i.exec($);if(!Z)return $;let J=Z.index+Z[0].length;T4.lastIndex=J;let X=T4.exec($),Y=X?X.index:$.length;I4.lastIndex=J;let Q=I4.exec($);if(!Q||Q.index>=Y)return $;if($.slice(J,Q.index).trim()==="")return $;let G=Q.index+Q[0].length;return`${$.slice(0,J)}
3358
+ ${Q[0]}${$.slice(J,Q.index)}${$.slice(G,Y)}${$.slice(Y)}`}function b4($){return PY(SY($))}function PY($){let Z=CY.exec($);if(!Z)return $;let J=l5($);if(J===null)return $;if(Z.index<=J||$.slice(J,Z.index).trim()==="")return $;let X=$.slice(0,Z.index)+$.slice(Z.index+Z[0].length),Y=l5(X);if(Y===null)return $;return`${X.slice(0,Y)}
3359
+ ${Z[0]}${X.slice(Y)}`}var dW="stx-build",mW="X-STX-Build",j9=null;function y4(){if(j9===null)j9=process.env.STX_BUILD_ID||`${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`;return j9}function lW($){j9=$}function cW($,Z=y4()){let J=i5($,Z);if(J===null)return $;let X=/<head\b[^>]*>/i.exec($),Y=X.index+X[0].length;return`${$.slice(0,Y)}${J}${$.slice(Y)}`}function i5($,Z=y4()){if($.includes('name="stx-build"'))return null;if(!/<head\b[^>]*>/i.test($))return null;return`
3360
+ <meta name="stx-build" content="${Z}">`}var P4="<style data-stx-cloak>[x-cloak]{display:none !important}</style>",B9="data-stx-html-attrs",V9="data-stx-html-class",v4=/^[A-Za-z_:][\w:.-]*$/;function J1($){return String($).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function vY($){return String($).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function l1($){if($.name)return`name="${$.name}"`;if($.property)return`property="${$.property}"`;if($.charset!=null)return"charset=";if($["http-equiv"])return`http-equiv="${$["http-equiv"]}"`;return""}function m1($,Z){return Object.entries($).filter(([J])=>!Z?.(J)).map(([J,X])=>`${J}="${J1(String(X))}"`).join(" ")}function fY($={},Z="en"){let J=[],X=[],Y="",Q=Z;for(let[z,q]of Object.entries($||{})){if(q==null)continue;let K=z.trim();if(!v4.test(K))continue;let U=K.toLowerCase();if(U==="lang"){Q=String(q);continue}if(U==="class"){Y=String(q).trim();continue}J.push(` ${K}="${J1(String(q))}"`),X.push(K)}let G=` lang="${J1(Q)}"`;if(Y)G+=` class="${J1(Y)}"`;if(G+=J.join(""),Y)G+=` ${V9}="${J1(Y)}"`;if(X.length)G+=` ${B9}="${J1(X.join(" "))}"`;return G}function f4($={},Z={}){let J={...$,...Z};if($.class&&Z.class){let X=$.class.split(/\s+/).filter(Boolean);for(let Y of Z.class.split(/\s+/).filter(Boolean))if(!X.includes(Y))X.push(Y);J.class=X.join(" ")}return J}function x4($,Z={}){if(!Z||Object.keys(Z).length===0)return $;let J=$.match(/<html\b([^>]*)>/i);if(!J)return $;let X={},Y=[],Q=/([A-Za-z_:][\w:.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,G;while((G=Q.exec(J[1]))!==null){let U=G[1];if(!(U in X))Y.push(U);X[U]=G[2]??G[3]??G[4]??""}let z=[],q=[];for(let[U,W]of Object.entries(Z)){if(W==null)continue;let H=U.trim();if(!v4.test(H))continue;let j=H.toLowerCase();if(j==="class"){let B=(X.class||"").split(/\s+/).filter(Boolean);for(let V of String(W).split(/\s+/).filter(Boolean))if(!B.includes(V))B.push(V),z.push(V);if(!("class"in X))Y.push("class");X.class=B.join(" ");continue}if(!(H in X))Y.push(H);if(X[H]=String(W),j!=="lang")q.push(H)}if(z.length){if(!(V9 in X))Y.push(V9);X[V9]=z.join(" ")}if(q.length){if(!(B9 in X))Y.push(B9);X[B9]=q.join(" ")}let K=Y.map((U)=>` ${U}="${J1(X[U])}"`).join("");return $.replace(J[0],()=>`<html${K}>`)}function nW($){let Z=s5($);if(Z===null)return $;let J=$.lastIndexOf("</head>");return`${$.slice(0,J)}${Z}${$.slice(J)}`}function s5($){if($.includes("data-stx-cloak"))return null;if($.lastIndexOf("</head>")===-1)return null;return`${P4}
3361
+ `}function xY($){let Z=[],J=0;while(J<$.length){let Q=$.slice(J),G=Q.match(/^\s+/);if(G){J+=G[0].length;continue}if(Q.startsWith("<!--")){let W=$.indexOf("-->",J);if(W===-1)break;J=W+3;continue}let z=Q.match(/^<script\b[^>]*>/i);if(z){let W=$.toLowerCase().indexOf("</script>",J+z[0].length);if(W===-1)break;J=W+9;continue}let q=Q.match(/^<link\b[^>]*>/i);if(q){Z.push(q[0]),J+=q[0].length;continue}let K=Q.match(/^<meta\b[^>]*>/i);if(K){Z.push(K[0]),J+=K[0].length;continue}let U=Q.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(U){Z.push(U[0]),J+=U[0].length;continue}break}if(Z.length===0)return{body:$,hoisted:Z};let X="",Y=0;while(Y<$.length&&Y<J){let Q=$.slice(Y),G=Q.match(/^<link\b[^>]*>/i);if(G&&Z.includes(G[0])){Y+=G[0].length;continue}let z=Q.match(/^<meta\b[^>]*>/i);if(z&&Z.includes(z[0])){Y+=z[0].length;continue}let q=Q.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(q&&Z.includes(q[0])){Y+=q[0].length;continue}X+=$[Y],Y++}return X+=$.slice(J),{body:X,hoisted:Z}}function gY($,Z={},J={}){let{title:X="stx App",lang:Y="en",meta:Q=[],link:G=[],script:z=[],headRaw:q="",htmlAttrs:K={},bodyClass:U="",bodyAttrs:W={}}=Z,H=J.title||X,j=[{charset:"UTF-8"},{name:"viewport",content:"width=device-width, initial-scale=1.0"}],B=new Set(Q.map(l1).filter(Boolean)),F=[...j.filter((A)=>!B.has(l1(A))),...Q].map((A)=>{return` <meta ${m1(A)}>`}).join(`
3364
3362
  `),O=G.map((A)=>{return` <link ${m1(A)}>`}).join(`
3365
3363
  `),_=z.map((A)=>{if(A.src)return` <script ${m1(A,(T)=>T==="content")}></script>`;if(A.content)return` <script>${A.content}</script>`;return""}).filter(Boolean).join(`
3366
- `),L=PY(K,Y),w=Object.entries(W).map(([A,T])=>` ${A}="${J1(String(T))}"`).join(""),R=U?` class="${J1(U)}"`:"",{body:D,hoisted:M}=vY($),I=[F,J.colorMode?` ${p5(J.colorMode)}`:"",` <title>${J.titleIsHtml?H:SY(H)}</title>`,` ${P4}`,O,_,q?` ${q}`:"",...(J.styles||[]).map((A)=>` ${A}`),...M.map((A)=>` ${A}`),...(J.headScripts||[]).map((A)=>` ${A}`),J.headStack||""].filter(Boolean),N=[D,...(J.bodyScripts||[]).map((A)=>A),J.bodyStack||""].filter(Boolean);return`<!DOCTYPE html>
3364
+ `),L=fY(K,Y),w=Object.entries(W).map(([A,T])=>` ${A}="${J1(String(T))}"`).join(""),R=U?` class="${J1(U)}"`:"",{body:D,hoisted:M}=xY($),I=[F,J.colorMode?` ${p5(J.colorMode)}`:"",` <title>${J.titleIsHtml?H:vY(H)}</title>`,` ${P4}`,O,_,q?` ${q}`:"",...(J.styles||[]).map((A)=>` ${A}`),...M.map((A)=>` ${A}`),...(J.headScripts||[]).map((A)=>` ${A}`),J.headStack||""].filter(Boolean),N=[D,...(J.bodyScripts||[]).map((A)=>A),J.bodyStack||""].filter(Boolean);return`<!DOCTYPE html>
3367
3365
  <html${L}>
3368
3366
  <head>
3369
3367
  ${I.join(`
@@ -3373,9 +3371,9 @@ ${I.join(`
3373
3371
  ${N.join(`
3374
3372
  `)}
3375
3373
  </body>
3376
- </html>`}var n5=/\s+/y,o5=/<(script|style)\b[^>]*>/iy,xY=/<\/script>/gi,gY=/<\/style>/gi,C4=/<!DOCTYPE\b/iy,S4=/<html[\s>]/iy;function r5($){let Z=0;while(Z<$.length){if(n5.lastIndex=Z,n5.exec($)){Z=n5.lastIndex;continue}if($.startsWith("<!--",Z)){let Y=$.indexOf("-->",Z);if(Y===-1)return!1;Z=Y+3;continue}o5.lastIndex=Z;let X=o5.exec($);if(X){let Y=X[1].toLowerCase()==="script"?xY:gY;Y.lastIndex=o5.lastIndex;let Q=Y.exec($);if(Q===null)return!1;Z=Q.index+Q[0].length;continue}if(C4.lastIndex=Z,C4.test($))return!0;return S4.lastIndex=Z,S4.test($)}return!1}function a5($){return r5($)}function g4($,Z={}){let J=$.lastIndexOf("</head>");if(J===-1)return $;let{meta:X=[],link:Y=[],script:Q=[],headRaw:G=""}=Z,z=$.slice(0,J),q=[];for(let K of X){let U=l1(K);if(U&&z.includes(U))continue;q.push(` <meta ${m1(K)}>`)}for(let K of Y){if(K.href&&z.includes(`href="${K.href}"`))continue;q.push(` <link ${m1(K)}>`)}for(let K of Q)if(K.src){if(z.includes(`src="${K.src}"`))continue;q.push(` <script ${m1(K,(U)=>U==="content")}></script>`)}else if(K.content){if(z.includes(K.content))continue;q.push(` <script>${K.content}</script>`)}if(G&&!z.includes(G))q.push(` ${G}`);if(q.length===0)return $;return`${$.slice(0,J)}${q.join(`
3374
+ </html>`}var n5=/\s+/y,o5=/<(script|style)\b[^>]*>/iy,hY=/<\/script>/gi,uY=/<\/style>/gi,C4=/<!DOCTYPE\b/iy,S4=/<html[\s>]/iy;function r5($){let Z=0;while(Z<$.length){if(n5.lastIndex=Z,n5.exec($)){Z=n5.lastIndex;continue}if($.startsWith("<!--",Z)){let Y=$.indexOf("-->",Z);if(Y===-1)return!1;Z=Y+3;continue}o5.lastIndex=Z;let X=o5.exec($);if(X){let Y=X[1].toLowerCase()==="script"?hY:uY;Y.lastIndex=o5.lastIndex;let Q=Y.exec($);if(Q===null)return!1;Z=Q.index+Q[0].length;continue}if(C4.lastIndex=Z,C4.test($))return!0;return S4.lastIndex=Z,S4.test($)}return!1}function a5($){return r5($)}function g4($,Z={}){let J=$.lastIndexOf("</head>");if(J===-1)return $;let{meta:X=[],link:Y=[],script:Q=[],headRaw:G=""}=Z,z=$.slice(0,J),q=[];for(let K of X){let U=l1(K);if(U&&z.includes(U))continue;q.push(` <meta ${m1(K)}>`)}for(let K of Y){if(K.href&&z.includes(`href="${K.href}"`))continue;q.push(` <link ${m1(K)}>`)}for(let K of Q)if(K.src){if(z.includes(`src="${K.src}"`))continue;q.push(` <script ${m1(K,(U)=>U==="content")}></script>`)}else if(K.content){if(z.includes(K.content))continue;q.push(` <script>${K.content}</script>`)}if(G&&!z.includes(G))q.push(` ${G}`);if(q.length===0)return $;return`${$.slice(0,J)}${q.join(`
3377
3375
  `)}
3378
- ${$.slice(J)}`}function h4($,Z={},J={},X){if(X??a5($))return $;return fY($,Z,J)}var hY=/<\/(script)/gi;function c1($){if(!$||$.indexOf("</")===-1)return $;return $.replace(hY,"<\\/$1")}var O2=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useDocumentVisibility","useIntervalFn","useObjectUrl","useTimeoutFn"];z2();z2();function d4($,Z={}){return new u4($,Z).routes}function XH($,Z){let J=t5($,Z);return J?J.params:null}var m4=new Map;async function l4($){let Z=$;if(!Z)try{Z=(await V5())?.pagesDir||"pages"}catch{Z="pages"}let J=Z,X=m4.get(J);if(X)return X;let Y=[];try{Y=d4(".",{pagesDir:J}).map((Q)=>Q.regex.source).filter(Boolean)}catch{Y=[]}return m4.set(J,Y),Y}function uY($){return $.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function c4($){return uY(JSON.stringify($))}function e5(){return`
3376
+ ${$.slice(J)}`}function h4($,Z={},J={},X){if(X??a5($))return $;return gY($,Z,J)}var dY=/<\/(script)/gi;function c1($){if(!$||$.indexOf("</")===-1)return $;return $.replace(dY,"<\\/$1")}var O2=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useDocumentVisibility","useIntervalFn","useObjectUrl","useTimeoutFn"];z2();z2();function d4($,Z={}){return new u4($,Z).routes}function JH($,Z){let J=t5($,Z);return J?J.params:null}var m4=new Map;async function l4($){let Z=$;if(!Z)try{Z=(await V5())?.pagesDir||"pages"}catch{Z="pages"}let J=Z,X=m4.get(J);if(X)return X;let Y=[];try{Y=d4(".",{pagesDir:J}).map((Q)=>Q.regex.source).filter(Boolean)}catch{Y=[]}return m4.set(J,Y),Y}function mY($){return $.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function c4($){return mY(JSON.stringify($))}function e5(){return`
3379
3377
  (function(){
3380
3378
  var tip=null,hideTimer=null,currentEl=null;
3381
3379
 
@@ -3483,17 +3481,17 @@ document.addEventListener("focusout",function(e){
3483
3481
  ${Z}${$.slice(Y)}`;if($.includes("</head>")){let G=$.indexOf("</head>");return $.slice(0,G)+Z+`
3484
3482
  `+$.slice(G)}if(G1($))return C1($,(G)=>`${G}
3485
3483
  ${Z}`);return`${Z}
3486
- ${$}`}async function L9($,Z){if($.includes("data-stx-runtime")||$.includes("window.stx.state")||$.includes("STX Signals Runtime"))return $;if(Z.buildMode==="serve")return $$($,'<script data-stx-runtime src="/_stx/runtime.js"></script>');if(Z.buildMode==="compile")return $$($,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:J}=await import("./chunk-dap191q2.js"),X=await J(Z.debug);return $$($,`<script data-stx-scoped data-stx-runtime>${X}</script>`)}function dY($){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test($)}function n4($){if($.includes("data-stx-tooltip-runtime")||!dY($))return $;let Z=`<script data-stx-scoped data-stx-tooltip-runtime>${e5()}</script>`,J=$.lastIndexOf("</body>");if(J===-1)return`${$}
3484
+ ${$}`}async function L9($,Z){if($.includes("data-stx-runtime")||$.includes("window.stx.state")||$.includes("STX Signals Runtime"))return $;if(Z.buildMode==="serve")return $$($,'<script data-stx-runtime src="/_stx/runtime.js"></script>');if(Z.buildMode==="compile")return $$($,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:J}=await import("./chunk-v2z3creg.js"),X=await J(Z.debug);return $$($,`<script data-stx-scoped data-stx-runtime>${X}</script>`)}function lY($){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test($)}function n4($){if($.includes("data-stx-tooltip-runtime")||!lY($))return $;let Z=`<script data-stx-scoped data-stx-tooltip-runtime>${e5()}</script>`,J=$.lastIndexOf("</body>");if(J===-1)return`${$}
3487
3485
  ${Z}`;return`${$.slice(0,J)}${Z}
3488
- ${$.slice(J)}`}var mY=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function lY($){return mY.test($)||$.includes("__stxRouter)return")||$.includes("__stxRouter=true")}async function cY($,Z){if(!$.includes("</body>"))return $;if(lY($))return $;let J=Z?.router,X="";{let z={};if(J){if(J.container)z.container=J.container;if(J.interceptAllLinks!==void 0)z.interceptAllLinks=J.interceptAllLinks;if(J.progress!==void 0)z.progress=J.progress;if(J.viewTransitions!==void 0)z.viewTransitions=J.viewTransitions;if(J.viewTransitionDuration!==void 0)z.viewTransitionDuration=J.viewTransitionDuration;if(J.viewTransitionEasing!==void 0)z.viewTransitionEasing=J.viewTransitionEasing;if(J.scrollToTop!==void 0)z.scrollToTop=J.scrollToTop;if(J.prefetch!==void 0)z.prefetch=J.prefetch;if(J.cache!==void 0)z.cache=J.cache;if(J.progressColor!==void 0)z.progressColor=J.progressColor;if(J.progressHeight!==void 0)z.progressHeight=J.progressHeight}try{let q=await l4(Z?.pagesDir);if(q.length>0)z.ownedRoutes=q}catch{}if(Object.keys(z).length>0)X=`<script>window.__stxRouterConfig=${c4(z)};</script>
3489
- `}let{getCachedRouterScript:Y}=await import("./chunk-dap191q2.js"),Q=Z?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':Z?.buildMode==="serve"?'<script data-stx-router src="/_stx/router.js"></script>':`<script data-stx-router>${await Y()}</script>`,G=$.lastIndexOf("</body>");return $.slice(0,G)+X+Q+`
3490
- </body>`+$.slice(G+7)}var o4=Symbol.for("stx.lazy-module-promises");function pY(){let $=globalThis;return $[o4]??=new Map,$[o4]}function o($,Z){let J=pY(),X=`${import.meta.url}\x00${$}`,Y=J.get(X);if(Y)return Y;let Q=Z();return J.set(X,Q),Q.catch(()=>{if(J.get(X)===Q)J.delete(X)}),Q}var J$=`(?:"[^"]*"|'[^']*'|[^>"'])*`,Z6=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s,iY=65536,nY=4,O9=new Map;function EH(){O9.clear()}function oY($){let Z=[];for(let J of h2($,Y1)){let X=J.token.match(/^<script\b([^>]*)>/i),Y=J.token.match(/<\/script\s*>$/i);if(!X||!Y)continue;let Q=X[0].length,G=J.token.length-Y[0].length;Z.push(Object.freeze({fullMatch:J.token,attrs:X[1],body:J.token.slice(Q,G),start:J.start,end:J.end}))}return Z}function sY($,Z={}){let J=$.length>=iY,X=J?O9.get($):void 0;if(X===void 0){if(X=oY($),J)u2(O9,nY),O9.set($,X)}let Y=Z.skipAttrs;if(!Y)return X.slice();let Q=[];for(let G of X)if(Y.lastIndex=0,!Y.test(G.attrs))Q.push(G);return Q}function J6($){let Z=$.trim(),J=Z.match(/^([\s\S]+?)\s+as\s+(.+)$/);if(J){let Y=J[1].trim(),Q=J[2].trim(),{itemVar:G,indexVar:z}=s4(Q);if(G)return{style:"as",iterable:Y,itemVar:G,indexVar:z}}let X=Z.match(/^(\([^)]+\)|\w+(?:\s*,\s*\w+)?)\s+(?:in|of)\s+([\s\S]+)$/);if(X){let Y=X[1].trim(),Q=X[2].trim(),{itemVar:G,indexVar:z}=s4(Y);if(G)return{style:"in",iterable:Q,itemVar:G,indexVar:z}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function s4($){let Z=$.trim(),J=Z.match(/^(\w+)\s*=>\s*(\w+)$/);if(J)return{itemVar:J[2],indexVar:J[1]};let X=Z.match(/^\(\s*(\w+)(?:\s*,\s*(\w+))?\s*\)$/);if(X)return{itemVar:X[1],indexVar:X[2]||null};let Y=Z.match(/^(\w+)\s*,\s*(\w+)$/);if(Y)return{itemVar:Y[1],indexVar:Y[2]};let Q=Z.match(/^(\w+)$/);if(Q)return{itemVar:Q[1],indexVar:null};return{itemVar:null,indexVar:null}}function Q$($,Z){return $6($,Z)}function rY($){let Z=/@(if\s*\(|endif|elseif\s*\(|else\b)/g,J=0,X;while((X=Z.exec($))!==null){let Y=X[1];if(Y.startsWith("if"))J++;else if(Y==="endif")J--;else if(J===0)return!0}return!1}function aY($){let Z=new Set,J=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,X=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal)\s*(?:<[^>]*>)?\s*\(/g,Y;while((Y=J.exec($))!==null){let Q=Y[1],G;while((G=X.exec(Q))!==null)Z.add(G[1])}return Z}function tY($){if(!/[:@]for\s*=/.test($)&&!/\bx-for\s*=/.test($))return[];let Z=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${J$})>`,"iy"),J=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,X=h2($,(Q,G)=>{Z.lastIndex=G;let z=Z.exec(Q);if(!z||z.index!==G||!J.test(z[2]))return-1;return Z.lastIndex}),Y=[];for(let Q of X){Z.lastIndex=0;let G=Z.exec(Q.token);if(!G)continue;let z=G[2].match(J),q=J6(z?.[1]??z?.[2]??""),K=[q.itemVar,q.indexVar].filter(Boolean);if(K.length===0)continue;let U=G[1],H=/\/\s*>$/.test(Q.token)||F9.has(U.toLowerCase())?Q.end:Y6($,Q.start,U,Q.end);if(H!==-1)Y.push({start:Q.start,end:H,vars:new Set(K)})}return Y}var r4=new Set(["true","false","null","undefined","NaN","Infinity","typeof","instanceof","in","of","new","void","delete","this","Math","JSON","Date","Number","String","Boolean","Array","Object","RegExp","Map","Set","Symbol","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","window","document","console"]);function eY($){return $.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function a4($,Z,J,X){if(!$)return!1;let Y=eY($),Q=!1,G=!1,z=!1,q=/([a-zA-Z_$][\w$]*)/g,K;while((K=q.exec(Y))!==null){let j=K[1];if(Y.slice(0,K.index).trimEnd().endsWith("."))continue;if(r4.has(j))continue;if(Z.has(j)||X?.has(j))Q=!0;else if(J&&j in J)G=!0}let U=/([a-zA-Z_$][\w$]*)(?:\.[a-zA-Z_$][\w$]*)*\s*\(\s*\)/g,W;while((W=U.exec(Y))!==null){let j=W[1];if(Y.slice(0,W.index).trimEnd().endsWith("."))continue;if(r4.has(j)||J&&j in J)continue;z=!0}return(Q||z)&&!G}function _9($,Z,J){let X=J===void 0?` ${Z}`:` ${Z}="${J.replace(/"/g,"&quot;")}"`,Y=$.trim(),Q=Y.match(Z6);if(Q&&$Q(Q[3],Q[1])){let[,G,z,q]=Q;return`<${G}${z}${X}>${q}</${G}>`}return`<template${X}>${Y}</template>`}function $Q($,Z){let J=new RegExp(`<(/)?${Z}(?=[\\s/>])`,"gi"),X=0,Y;while((Y=J.exec($))!==null)if(Y[1]){if(X--,X<0)return!1}else X++;return!0}function X6($,Z){let J=aY($);function X(Y){let Q=Y,G=tY(Y),z=(W)=>{let H=new Set;for(let j of G)if(W>j.start&&W<j.end)for(let B of j.vars)H.add(B);return H},q=/@if\s*\(/g,K,U=[];while((K=q.exec(Q))!==null){let W=K.index,H=W+K[0].length,j=1,B=H;while(B<Q.length&&j>0){if(Q[B]==="(")j++;else if(Q[B]===")")j--;B++}if(j!==0)continue;let V=Q.substring(H,B-1).trim(),F=B,O=1,_=F,L=/@(if\s*\(|endif)/g;L.lastIndex=F;let w;while((w=L.exec(Q))!==null)if(w[1].startsWith("if"))O++;else if(w[1]==="endif"){if(O--,O===0){_=w.index+w[0].length;break}}if(O!==0)continue;let R=Q.substring(F,_-6).trim(),D;if(rY(R)){let M=H2(Q.substring(W,_));if(M.length===0)continue;let I=M[0].branches.filter((k)=>k.type!=="else"),N=z(W);if(!(I.length>0&&I.every((k)=>a4(k.condition,J,Z,N))))continue;D=M[0].branches.map((k)=>{let y=X(k.content);if(k.type==="elseif")return _9(y,"@else-if",k.condition??"");if(k.type==="else")return _9(y,"@else");return _9(y,"@if",k.condition??"")}).join(`
3491
- `)}else{if(!a4(V,J,Z,z(W)))continue;D=_9(X(R),"@if",V)}U.push({start:W,end:_,replacement:D}),q.lastIndex=_}for(let W=U.length-1;W>=0;W--){let{start:H,end:j,replacement:B}=U[W];Q=Q.substring(0,H)+B+Q.substring(j)}return Q}return X($)}function ZQ($){let Z=$.trim();if(Z==="")return;if(Z==="true")return!0;if(Z==="false")return!1;if(Z==="null")return!1;if(Z==="undefined")return!1;if(Z==="NaN")return!1;if(/^-?\d+(?:\.\d+)?$/.test(Z)){let Y=Number(Z);return Y!==0&&!Number.isNaN(Y)}let J=Z.match(/^'((?:\\.|[^'\\])*)'$/);if(J)return J[1].length>0;let X=Z.match(/^"((?:\\.|[^"\\])*)"$/);if(X)return X[1].length>0;return}var F9=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),t4=/<(script|style)\b/iy,JQ=/<\/script/gi,XQ=/<\/style/gi;function Y6($,Z,J,X){if(F9.has(J.toLowerCase()))return X;let Y=J.toLowerCase(),Q=$.length,G=1,z=X;while(z<Q){let q=$.indexOf("<",z);if(q===-1)return-1;if(z=q,$.startsWith("<!--",z)){let H=$.indexOf("-->",z+4);if(H===-1)return-1;z=H+3;continue}t4.lastIndex=z;let K=t4.exec($);if(K){let H=$.indexOf(">",z);if(H===-1)return-1;if($[H-1]==="/"){z=H+1;continue}let j=K[1].toLowerCase()==="script"?JQ:XQ;j.lastIndex=z;let B=j.exec($);if(B===null)return-1;let V=$.indexOf(">",B.index);if(V===-1)return-1;z=V+1;continue}if($[z+1]==="/"){let H=/^<\/([a-z][\w-]*)\s*>/i.exec($.slice(z,z+64));if(!H){z++;continue}if(H[1].toLowerCase()===Y){if(G--,z+=H[0].length,G===0)return z;continue}z+=H[0].length;continue}let U=/^<([a-z][\w-]*)\b/i.exec($.slice(z,z+64));if(!U){z++;continue}let W=$.indexOf(">",z);if(W===-1)return-1;if(U[1].toLowerCase()===Y){let H=$.slice(z,W+1);if(!(/\/\s*>$/.test(H)||F9.has(Y)))G++}z=W+1}return-1}var YQ=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function QQ($,Z){let J=Z,X=$.length;for(;;){while(J<X&&$[J]!=="<")J++;if(J>=X)return!1;if($.startsWith("<!--",J)){let G=$.indexOf("-->",J+4);if(G===-1)return!1;J=G+3;continue}break}if($[J+1]==="/")return!1;let Y=$.indexOf(">",J);if(Y===-1)return!1;let Q=$.slice(J,Y+1);return YQ.test(Q)}function Q6($){if(!$.includes(":if")&&!$.includes(":show")&&!$.includes("x-if")&&!$.includes("x-show")&&!$.includes("@if=")&&!$.includes("@show="))return $;let Z=[],J=/<(script|style)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,X;while((X=J.exec($))!==null)Z.push([X.index,X.index+X[0].length]);let Y=(W)=>Z.some(([H,j])=>W>=H&&W<j),Q=/<([a-zA-Z][\w-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*?)\s+(:if|:show|x-if|x-show|@if|@show)\s*=\s*"([^"]*)"((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)(\/?)>/g,G=[],z;while((z=Q.exec($))!==null){if(Y(z.index))continue;let[W,H,j,B,V,F,O]=z,_=ZQ(V);if(_===void 0)continue;let L=z.index,w=L+W.length,M=!!O||/\/\s*>$/.test(W)||F9.has(H.toLowerCase())?w:Y6($,L,H,w);if(M===-1)continue;if((B===":if"||B==="x-if"||B==="@if")&&QQ($,M)){Q.lastIndex=w;continue}if(_===!0){let N=`<${H}${j}${F}${O}>`;G.push({start:L,end:w,replacement:N});continue}G.push({start:L,end:M,replacement:""}),Q.lastIndex=M}if(G.length===0)return $;G.sort((W,H)=>W.start-H.start);let q=[],K=-1;for(let W of G){if(W.start<K)continue;q.push(W),K=W.end}let U=$;for(let W=q.length-1;W>=0;W--){let{start:H,end:j,replacement:B}=q[W];U=U.substring(0,H)+B+U.substring(j)}return U}function G$($,Z){let J=$,X=/@(for|foreach)\s*\(/g,Y,Q=[],G=[];while((Y=X.exec(J))!==null){let z=Y[1],q=Y.index,K=q+Y[0].length,U=1,W=K;while(W<J.length&&U>0){if(J[W]==="(")U++;else if(J[W]===")")U--;W++}if(U!==0)continue;let H=J.substring(K,W-1).trim(),j=W,B=J6(H),V=z==="for"?"@endfor":"@endforeach",F=1,O=j,_=z==="for"?new RegExp("@(for(?!each)\\s*\\(|endfor(?!each))","g"):new RegExp(`@(${z}\\s*\\(|end${z})`,"g");_.lastIndex=j;let L;while((L=_.exec(J))!==null)if(L[1].startsWith(z))F++;else if(F--,F===0){O=L.index+L[0].length;break}if(F!==0)continue;let w=()=>{let A=[B.itemVar,B.indexVar].filter(Boolean);if(A.length)G.push({start:q,end:O,vars:A})};if(B.iterable){let A=B.iterable.trim();if(A.startsWith("[")||A.startsWith("{")||A.startsWith("'")||A.startsWith('"')||A.startsWith("`")||/^-?\d/.test(A)){w();continue}let T=A.split(/[.[(]/)[0].trim(),k=Z?T in Z:!1,y=G.some((E)=>q>E.start&&q<E.end&&E.vars.includes(T));if(T&&(k||y)){w();continue}}if(B.style==="as")H=B.indexVar?`(${B.itemVar}, ${B.indexVar}) in ${B.iterable}`:`${B.itemVar} in ${B.iterable}`;let R=J.substring(j,O-V.length).trim(),D=Z?{...Z}:{};if(B.itemVar)delete D[B.itemVar];if(B.indexVar)delete D[B.indexVar];let M=G$(R,D),I=M.match(Z6),N;if(I){let[,A,T,k]=I;N=`<${A}${T} @for="${H}">${k}</${A}>`}else N=`<template @for="${H}">${M}</template>`;Q.push({start:q,end:O,replacement:N}),X.lastIndex=O}for(let z=Q.length-1;z>=0;z--){let{start:q,end:K,replacement:U}=Q[z];J=J.substring(0,q)+U+J.substring(K)}return J}function GQ($){let Z=new Set,J=[],X=0,Y=0,Q=$.length,G=(U)=>{let W=X+1;while(W<Q){let H=$[W];if(H==="\\"){W+=2;continue}if(H===U)return W+1;W++}return Q},z=()=>{let U=X+2;while(U<Q&&$[U]!==`
3486
+ ${$.slice(J)}`}var cY=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function pY($){return cY.test($)||$.includes("__stxRouter)return")||$.includes("__stxRouter=true")}async function iY($,Z){if(!$.includes("</body>"))return $;if(pY($))return $;let J=Z?.router,X="";{let z={};if(J){if(J.container)z.container=J.container;if(J.interceptAllLinks!==void 0)z.interceptAllLinks=J.interceptAllLinks;if(J.progress!==void 0)z.progress=J.progress;if(J.viewTransitions!==void 0)z.viewTransitions=J.viewTransitions;if(J.viewTransitionDuration!==void 0)z.viewTransitionDuration=J.viewTransitionDuration;if(J.viewTransitionEasing!==void 0)z.viewTransitionEasing=J.viewTransitionEasing;if(J.scrollToTop!==void 0)z.scrollToTop=J.scrollToTop;if(J.prefetch!==void 0)z.prefetch=J.prefetch;if(J.cache!==void 0)z.cache=J.cache;if(J.progressColor!==void 0)z.progressColor=J.progressColor;if(J.progressHeight!==void 0)z.progressHeight=J.progressHeight}try{let q=await l4(Z?.pagesDir);if(q.length>0)z.ownedRoutes=q}catch{}if(Object.keys(z).length>0)X=`<script>window.__stxRouterConfig=${c4(z)};</script>
3487
+ `}let{getCachedRouterScript:Y}=await import("./chunk-v2z3creg.js"),Q=Z?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':Z?.buildMode==="serve"?'<script data-stx-router src="/_stx/router.js"></script>':`<script data-stx-router>${await Y()}</script>`,G=$.lastIndexOf("</body>");return $.slice(0,G)+X+Q+`
3488
+ </body>`+$.slice(G+7)}var o4=Symbol.for("stx.lazy-module-promises");function nY(){let $=globalThis;return $[o4]??=new Map,$[o4]}function n($,Z){let J=nY(),X=`${import.meta.url}\x00${$}`,Y=J.get(X);if(Y)return Y;let Q=Z();return J.set(X,Q),Q.catch(()=>{if(J.get(X)===Q)J.delete(X)}),Q}var J$=`(?:"[^"]*"|'[^']*'|[^>"'])*`,Z6=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s,oY=65536,sY=4,O9=new Map;function TH(){O9.clear()}function rY($){let Z=[];for(let J of h2($,Y1)){let X=J.token.match(/^<script\b([^>]*)>/i),Y=J.token.match(/<\/script\s*>$/i);if(!X||!Y)continue;let Q=X[0].length,G=J.token.length-Y[0].length;Z.push(Object.freeze({fullMatch:J.token,attrs:X[1],body:J.token.slice(Q,G),start:J.start,end:J.end}))}return Z}function aY($,Z={}){let J=$.length>=oY,X=J?O9.get($):void 0;if(X===void 0){if(X=rY($),J)u2(O9,sY),O9.set($,X)}let Y=Z.skipAttrs;if(!Y)return X.slice();let Q=[];for(let G of X)if(Y.lastIndex=0,!Y.test(G.attrs))Q.push(G);return Q}function J6($){let Z=$.trim(),J=Z.match(/^([\s\S]+?)\s+as\s+(.+)$/);if(J){let Y=J[1].trim(),Q=J[2].trim(),{itemVar:G,indexVar:z}=s4(Q);if(G)return{style:"as",iterable:Y,itemVar:G,indexVar:z}}let X=Z.match(/^(\([^)]+\)|\w+(?:\s*,\s*\w+)?)\s+(?:in|of)\s+([\s\S]+)$/);if(X){let Y=X[1].trim(),Q=X[2].trim(),{itemVar:G,indexVar:z}=s4(Y);if(G)return{style:"in",iterable:Q,itemVar:G,indexVar:z}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function s4($){let Z=$.trim(),J=Z.match(/^(\w+)\s*=>\s*(\w+)$/);if(J)return{itemVar:J[2],indexVar:J[1]};let X=Z.match(/^\(\s*(\w+)(?:\s*,\s*(\w+))?\s*\)$/);if(X)return{itemVar:X[1],indexVar:X[2]||null};let Y=Z.match(/^(\w+)\s*,\s*(\w+)$/);if(Y)return{itemVar:Y[1],indexVar:Y[2]};let Q=Z.match(/^(\w+)$/);if(Q)return{itemVar:Q[1],indexVar:null};return{itemVar:null,indexVar:null}}function Q$($,Z){return $6($,Z)}function tY($){let Z=/@(if\s*\(|endif|elseif\s*\(|else\b)/g,J=0,X;while((X=Z.exec($))!==null){let Y=X[1];if(Y.startsWith("if"))J++;else if(Y==="endif")J--;else if(J===0)return!0}return!1}function eY($){let Z=new Set,J=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,X=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal)\s*(?:<[^>]*>)?\s*\(/g,Y;while((Y=J.exec($))!==null){let Q=Y[1],G;while((G=X.exec(Q))!==null)Z.add(G[1])}return Z}function $Q($){if(!/[:@]for\s*=/.test($)&&!/\bx-for\s*=/.test($))return[];let Z=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${J$})>`,"iy"),J=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,X=h2($,(Q,G)=>{Z.lastIndex=G;let z=Z.exec(Q);if(!z||z.index!==G||!J.test(z[2]))return-1;return Z.lastIndex}),Y=[];for(let Q of X){Z.lastIndex=0;let G=Z.exec(Q.token);if(!G)continue;let z=G[2].match(J),q=J6(z?.[1]??z?.[2]??""),K=[q.itemVar,q.indexVar].filter(Boolean);if(K.length===0)continue;let U=G[1],H=/\/\s*>$/.test(Q.token)||F9.has(U.toLowerCase())?Q.end:Y6($,Q.start,U,Q.end);if(H!==-1)Y.push({start:Q.start,end:H,vars:new Set(K)})}return Y}var r4=new Set(["true","false","null","undefined","NaN","Infinity","typeof","instanceof","in","of","new","void","delete","this","Math","JSON","Date","Number","String","Boolean","Array","Object","RegExp","Map","Set","Symbol","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","window","document","console"]);function ZQ($){return $.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function a4($,Z,J,X){if(!$)return!1;let Y=ZQ($),Q=!1,G=!1,z=!1,q=/([a-zA-Z_$][\w$]*)/g,K;while((K=q.exec(Y))!==null){let j=K[1];if(Y.slice(0,K.index).trimEnd().endsWith("."))continue;if(r4.has(j))continue;if(Z.has(j)||X?.has(j))Q=!0;else if(J&&j in J)G=!0}let U=/([a-zA-Z_$][\w$]*)(?:\.[a-zA-Z_$][\w$]*)*\s*\(\s*\)/g,W;while((W=U.exec(Y))!==null){let j=W[1];if(Y.slice(0,W.index).trimEnd().endsWith("."))continue;if(r4.has(j)||J&&j in J)continue;z=!0}return(Q||z)&&!G}function _9($,Z,J){let X=J===void 0?` ${Z}`:` ${Z}="${J.replace(/"/g,"&quot;")}"`,Y=$.trim(),Q=Y.match(Z6);if(Q&&JQ(Q[3],Q[1])){let[,G,z,q]=Q;return`<${G}${z}${X}>${q}</${G}>`}return`<template${X}>${Y}</template>`}function JQ($,Z){let J=new RegExp(`<(/)?${Z}(?=[\\s/>])`,"gi"),X=0,Y;while((Y=J.exec($))!==null)if(Y[1]){if(X--,X<0)return!1}else X++;return!0}function X6($,Z){let J=eY($);function X(Y){let Q=Y,G=$Q(Y),z=(W)=>{let H=new Set;for(let j of G)if(W>j.start&&W<j.end)for(let B of j.vars)H.add(B);return H},q=/@if\s*\(/g,K,U=[];while((K=q.exec(Q))!==null){let W=K.index,H=W+K[0].length,j=1,B=H;while(B<Q.length&&j>0){if(Q[B]==="(")j++;else if(Q[B]===")")j--;B++}if(j!==0)continue;let V=Q.substring(H,B-1).trim(),F=B,O=1,_=F,L=/@(if\s*\(|endif)/g;L.lastIndex=F;let w;while((w=L.exec(Q))!==null)if(w[1].startsWith("if"))O++;else if(w[1]==="endif"){if(O--,O===0){_=w.index+w[0].length;break}}if(O!==0)continue;let R=Q.substring(F,_-6).trim(),D;if(tY(R)){let M=H2(Q.substring(W,_));if(M.length===0)continue;let I=M[0].branches.filter((k)=>k.type!=="else"),N=z(W);if(!(I.length>0&&I.every((k)=>a4(k.condition,J,Z,N))))continue;D=M[0].branches.map((k)=>{let y=X(k.content);if(k.type==="elseif")return _9(y,"@else-if",k.condition??"");if(k.type==="else")return _9(y,"@else");return _9(y,"@if",k.condition??"")}).join(`
3489
+ `)}else{if(!a4(V,J,Z,z(W)))continue;D=_9(X(R),"@if",V)}U.push({start:W,end:_,replacement:D}),q.lastIndex=_}for(let W=U.length-1;W>=0;W--){let{start:H,end:j,replacement:B}=U[W];Q=Q.substring(0,H)+B+Q.substring(j)}return Q}return X($)}function XQ($){let Z=$.trim();if(Z==="")return;if(Z==="true")return!0;if(Z==="false")return!1;if(Z==="null")return!1;if(Z==="undefined")return!1;if(Z==="NaN")return!1;if(/^-?\d+(?:\.\d+)?$/.test(Z)){let Y=Number(Z);return Y!==0&&!Number.isNaN(Y)}let J=Z.match(/^'((?:\\.|[^'\\])*)'$/);if(J)return J[1].length>0;let X=Z.match(/^"((?:\\.|[^"\\])*)"$/);if(X)return X[1].length>0;return}var F9=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),t4=/<(script|style)\b/iy,YQ=/<\/script/gi,QQ=/<\/style/gi;function Y6($,Z,J,X){if(F9.has(J.toLowerCase()))return X;let Y=J.toLowerCase(),Q=$.length,G=1,z=X;while(z<Q){let q=$.indexOf("<",z);if(q===-1)return-1;if(z=q,$.startsWith("<!--",z)){let H=$.indexOf("-->",z+4);if(H===-1)return-1;z=H+3;continue}t4.lastIndex=z;let K=t4.exec($);if(K){let H=$.indexOf(">",z);if(H===-1)return-1;if($[H-1]==="/"){z=H+1;continue}let j=K[1].toLowerCase()==="script"?YQ:QQ;j.lastIndex=z;let B=j.exec($);if(B===null)return-1;let V=$.indexOf(">",B.index);if(V===-1)return-1;z=V+1;continue}if($[z+1]==="/"){let H=/^<\/([a-z][\w-]*)\s*>/i.exec($.slice(z,z+64));if(!H){z++;continue}if(H[1].toLowerCase()===Y){if(G--,z+=H[0].length,G===0)return z;continue}z+=H[0].length;continue}let U=/^<([a-z][\w-]*)\b/i.exec($.slice(z,z+64));if(!U){z++;continue}let W=$.indexOf(">",z);if(W===-1)return-1;if(U[1].toLowerCase()===Y){let H=$.slice(z,W+1);if(!(/\/\s*>$/.test(H)||F9.has(Y)))G++}z=W+1}return-1}var GQ=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function zQ($,Z){let J=Z,X=$.length;for(;;){while(J<X&&$[J]!=="<")J++;if(J>=X)return!1;if($.startsWith("<!--",J)){let G=$.indexOf("-->",J+4);if(G===-1)return!1;J=G+3;continue}break}if($[J+1]==="/")return!1;let Y=$.indexOf(">",J);if(Y===-1)return!1;let Q=$.slice(J,Y+1);return GQ.test(Q)}function Q6($){if(!$.includes(":if")&&!$.includes(":show")&&!$.includes("x-if")&&!$.includes("x-show")&&!$.includes("@if=")&&!$.includes("@show="))return $;let Z=[],J=/<(script|style)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,X;while((X=J.exec($))!==null)Z.push([X.index,X.index+X[0].length]);let Y=(W)=>Z.some(([H,j])=>W>=H&&W<j),Q=/<([a-zA-Z][\w-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*?)\s+(:if|:show|x-if|x-show|@if|@show)\s*=\s*"([^"]*)"((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)(\/?)>/g,G=[],z;while((z=Q.exec($))!==null){if(Y(z.index))continue;let[W,H,j,B,V,F,O]=z,_=XQ(V);if(_===void 0)continue;let L=z.index,w=L+W.length,M=!!O||/\/\s*>$/.test(W)||F9.has(H.toLowerCase())?w:Y6($,L,H,w);if(M===-1)continue;if((B===":if"||B==="x-if"||B==="@if")&&zQ($,M)){Q.lastIndex=w;continue}if(_===!0){let N=`<${H}${j}${F}${O}>`;G.push({start:L,end:w,replacement:N});continue}G.push({start:L,end:M,replacement:""}),Q.lastIndex=M}if(G.length===0)return $;G.sort((W,H)=>W.start-H.start);let q=[],K=-1;for(let W of G){if(W.start<K)continue;q.push(W),K=W.end}let U=$;for(let W=q.length-1;W>=0;W--){let{start:H,end:j,replacement:B}=q[W];U=U.substring(0,H)+B+U.substring(j)}return U}function G$($,Z){let J=$,X=/@(for|foreach)\s*\(/g,Y,Q=[],G=[];while((Y=X.exec(J))!==null){let z=Y[1],q=Y.index,K=q+Y[0].length,U=1,W=K;while(W<J.length&&U>0){if(J[W]==="(")U++;else if(J[W]===")")U--;W++}if(U!==0)continue;let H=J.substring(K,W-1).trim(),j=W,B=J6(H),V=z==="for"?"@endfor":"@endforeach",F=1,O=j,_=z==="for"?new RegExp("@(for(?!each)\\s*\\(|endfor(?!each))","g"):new RegExp(`@(${z}\\s*\\(|end${z})`,"g");_.lastIndex=j;let L;while((L=_.exec(J))!==null)if(L[1].startsWith(z))F++;else if(F--,F===0){O=L.index+L[0].length;break}if(F!==0)continue;let w=()=>{let A=[B.itemVar,B.indexVar].filter(Boolean);if(A.length)G.push({start:q,end:O,vars:A})};if(B.iterable){let A=B.iterable.trim();if(A.startsWith("[")||A.startsWith("{")||A.startsWith("'")||A.startsWith('"')||A.startsWith("`")||/^-?\d/.test(A)){w();continue}let T=A.split(/[.[(]/)[0].trim(),k=Z?T in Z:!1,y=G.some((E)=>q>E.start&&q<E.end&&E.vars.includes(T));if(T&&(k||y)){w();continue}}if(B.style==="as")H=B.indexVar?`(${B.itemVar}, ${B.indexVar}) in ${B.iterable}`:`${B.itemVar} in ${B.iterable}`;let R=J.substring(j,O-V.length).trim(),D=Z?{...Z}:{};if(B.itemVar)delete D[B.itemVar];if(B.indexVar)delete D[B.indexVar];let M=G$(R,D),I=M.match(Z6),N;if(I){let[,A,T,k]=I;N=`<${A}${T} @for="${H}">${k}</${A}>`}else N=`<template @for="${H}">${M}</template>`;Q.push({start:q,end:O,replacement:N}),X.lastIndex=O}for(let z=Q.length-1;z>=0;z--){let{start:q,end:K,replacement:U}=Q[z];J=J.substring(0,q)+U+J.substring(K)}return J}function qQ($){let Z=new Set,J=[],X=0,Y=0,Q=$.length,G=(U)=>{let W=X+1;while(W<Q){let H=$[W];if(H==="\\"){W+=2;continue}if(H===U)return W+1;W++}return Q},z=()=>{let U=X+2;while(U<Q&&$[U]!==`
3492
3490
  `)U++;return U},q=()=>{let U=X+2;while(U<Q-1){if($[U]==="*"&&$[U+1]==="/")return U+2;U++}return Q},K=(U)=>{let W=U,H=0;while(W<Q){let j=$[W];if(j==="/"&&$[W+1]==="/"){let B=W+2;while(B<Q&&$[B]!==`
3493
- `)B++;W=B;continue}if(j==="/"&&$[W+1]==="*"){let B=W+2;while(B<Q-1&&!($[B]==="*"&&$[B+1]==="/"))B++;W=B+2;continue}if(j==='"'||j==="'"||j==="`"){let B=W+1;while(B<Q){if($[B]==="\\"){B+=2;continue}if($[B]===j){B++;break}B++}W=B;continue}if(j==="("||j==="["||j==="{"){H++,W++;continue}if(j===")"||j==="]"||j==="}"){H--,W++;continue}if(j===";"&&H===0)return W+1;W++}return Q};while(X<Q){let U=$[X];if(U==="/"&&$[X+1]==="/"){let W=z();J.push($.slice(X,W)),X=W;continue}if(U==="/"&&$[X+1]==="*"){let W=q();J.push($.slice(X,W)),X=W;continue}if(U==='"'||U==="'"||U==="`"){let W=G(U);J.push($.slice(X,W)),X=W;continue}if(U==="{"){Y++,J.push(U),X++;continue}if(U==="}"){Y--,J.push(U),X++;continue}if(Y===0){let W=X>0?$[X-1]:"";if(W===""||/\s/.test(W)||W===";"||W==="}"||W==="{"){let j=$.slice(X).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(j){let B=j[2],V=K(X+j[0].length);if(Z.has(B)){J.push(`/* stx: deduped const ${B} */`),X=V;continue}Z.add(B),J.push($.slice(X,V)),X=V;continue}}}J.push(U),X++}return J.join("")}var zQ=new Set(["script","style","html","head","meta","link","title","!doctype"]);function X$($,Z,J){for(let X of J){if(X.start>=Z)return!1;if(X.end>$)return!0}return!1}function qQ($,Z,J){let X=0;while(X<$.length){let Y=$.indexOf(Z,X);if(Y===-1)return!1;if(!X$(Y,Y+Z.length,J))return!0;X=Y+Z.length}return!1}function KQ($,Z){if(qQ($,"<body",Z)){let Y=new RegExp(`<body(${J$})>`,"g"),Q;while((Q=Y.exec($))!==null)if(!X$(Q.index,Q.index+Q[0].length,Z))return Q.index+Q[0].length-1;return null}let J=new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${J$})>`,"gi"),X;while((X=J.exec($))!==null){if(X$(X.index,X.index+X[0].length,Z))continue;if(zQ.has(X[1].toLowerCase()))continue;return X.index+X[0].length-1}return null}function UQ($,Z,J,X){let Y=[],Q=` data-stx="${X}"`,G=0,z=!1,q=(K)=>{if(J!==null&&!z&&J>=G&&J<=K)Y.push($.slice(G,J),Q,$.slice(J,K)),z=!0;else Y.push($.slice(G,K))};for(let K of Z){if(K.start<G)continue;q(K.start),G=K.end}return q($.length),Y.join("")}async function WQ($,Z,J){let X=sY($,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),Y=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|useCookie|useId|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,Q=[],{hasUserImports:G,bundleClientScript:z}=await o("stx/client-script-bundler",()=>import("./chunk-45az9zht.js"));for(let _ of X){let L=_.body;if(D1(_.attrs))L=N1(L);if(Y.test(L)){Q.push({content:L,start:_.start,end:_.end});continue}if(!G(L))continue;try{let w=await z(p1(L).code,Z||"",{projectRoot:process.cwd()});if(Y.test(w))Q.push({content:L,start:_.start,end:_.end,bundled:w})}catch{}}if(Q.length===0)return{output:$,setupCode:null};let q=`${Z??""}\x00${Q.map((_)=>_.content).join("\x00")}`,K=`__stx_setup_${Bun.hash(q).toString(36).slice(0,10)}`,U=[];for(let _=0;_<Q.length;_++){let L=Q[_].bundled??p1(Q[_].content).code;if(!Q[_].bundled&&G(L))L=await z(L,Z||"",{projectRoot:process.cwd()});L=VQ(L);let w=e0(L);U.push(`// \u2500\u2500 merged signal script #${_+1} \u2500\u2500
3491
+ `)B++;W=B;continue}if(j==="/"&&$[W+1]==="*"){let B=W+2;while(B<Q-1&&!($[B]==="*"&&$[B+1]==="/"))B++;W=B+2;continue}if(j==='"'||j==="'"||j==="`"){let B=W+1;while(B<Q){if($[B]==="\\"){B+=2;continue}if($[B]===j){B++;break}B++}W=B;continue}if(j==="("||j==="["||j==="{"){H++,W++;continue}if(j===")"||j==="]"||j==="}"){H--,W++;continue}if(j===";"&&H===0)return W+1;W++}return Q};while(X<Q){let U=$[X];if(U==="/"&&$[X+1]==="/"){let W=z();J.push($.slice(X,W)),X=W;continue}if(U==="/"&&$[X+1]==="*"){let W=q();J.push($.slice(X,W)),X=W;continue}if(U==='"'||U==="'"||U==="`"){let W=G(U);J.push($.slice(X,W)),X=W;continue}if(U==="{"){Y++,J.push(U),X++;continue}if(U==="}"){Y--,J.push(U),X++;continue}if(Y===0){let W=X>0?$[X-1]:"";if(W===""||/\s/.test(W)||W===";"||W==="}"||W==="{"){let j=$.slice(X).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(j){let B=j[2],V=K(X+j[0].length);if(Z.has(B)){J.push(`/* stx: deduped const ${B} */`),X=V;continue}Z.add(B),J.push($.slice(X,V)),X=V;continue}}}J.push(U),X++}return J.join("")}var KQ=new Set(["script","style","html","head","meta","link","title","!doctype"]);function X$($,Z,J){for(let X of J){if(X.start>=Z)return!1;if(X.end>$)return!0}return!1}function UQ($,Z,J){let X=0;while(X<$.length){let Y=$.indexOf(Z,X);if(Y===-1)return!1;if(!X$(Y,Y+Z.length,J))return!0;X=Y+Z.length}return!1}function WQ($,Z){if(UQ($,"<body",Z)){let Y=new RegExp(`<body(${J$})>`,"g"),Q;while((Q=Y.exec($))!==null)if(!X$(Q.index,Q.index+Q[0].length,Z))return Q.index+Q[0].length-1;return null}let J=new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${J$})>`,"gi"),X;while((X=J.exec($))!==null){if(X$(X.index,X.index+X[0].length,Z))continue;if(KQ.has(X[1].toLowerCase()))continue;return X.index+X[0].length-1}return null}function HQ($,Z,J,X){let Y=[],Q=` data-stx="${X}"`,G=0,z=!1,q=(K)=>{if(J!==null&&!z&&J>=G&&J<=K)Y.push($.slice(G,J),Q,$.slice(J,K)),z=!0;else Y.push($.slice(G,K))};for(let K of Z){if(K.start<G)continue;q(K.start),G=K.end}return q($.length),Y.join("")}async function jQ($,Z,J){let X=aY($,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),Y=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|useCookie|useId|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,Q=[],{hasUserImports:G,bundleClientScript:z}=await n("stx/client-script-bundler",()=>import("./chunk-91ffbzmh.js"));for(let _ of X){let L=_.body;if(D1(_.attrs))L=N1(L);if(Y.test(L)){Q.push({content:L,start:_.start,end:_.end});continue}if(!G(L))continue;try{let w=await z(p1(L).code,Z||"",{projectRoot:process.cwd(),externalizeUserModules:!1});if(Y.test(w))Q.push({content:L,start:_.start,end:_.end})}catch{}}if(Q.length===0)return{output:$,setupCode:null};let q=`${Z??""}\x00${Q.map((_)=>_.content).join("\x00")}`,K=`__stx_setup_${Bun.hash(q).toString(36).slice(0,10)}`,U=[];for(let _=0;_<Q.length;_++){let L=Q[_].bundled??p1(Q[_].content).code;if(!Q[_].bundled&&G(L))L=await z(L,Z||"",{projectRoot:process.cwd()});L=_Q(L);let w=Z1(L);U.push(`// \u2500\u2500 merged signal script #${_+1} \u2500\u2500
3494
3492
  ${w}`)}let W=U.join(`
3495
3493
 
3496
- `);W=GQ(W);let H=HQ(W),j=H.split(",").map((_)=>_.trim()).filter(Boolean),B=Y$(W,J),V=`
3494
+ `);W=qQ(W);let H=BQ(W),j=H.split(",").map((_)=>_.trim()).filter(Boolean),B=Y$(W,J),V=`
3497
3495
  <script data-stx-scoped>
3498
3496
  function ${K}() {
3499
3497
  ${h1("const",j)}
@@ -3502,24 +3500,24 @@ ${c1(`${B}${W}`)}
3502
3500
  }
3503
3501
  window.__stx_latestSetup=${K};
3504
3502
  if(window.stx)window.stx._latestSetup=${K};
3505
- </script>`,F=KQ($,Q);return{output:UQ($,Q,F,K),setupCode:V}}function HQ($){let Z=$,J=[],X=new Set,Y=0,Q=0,G=Z.length,z="",q=()=>{Q++;let B=!1;while(Q<G){let V=Z[Q];if(V==="\\"){Q+=2;continue}if(V==="["&&!B){B=!0,Q++;continue}if(V==="]"&&B){B=!1,Q++;continue}if(V==="/"&&!B){Q++;while(Q<G&&/[gimsuyd]/.test(Z[Q]))Q++;return}if(V===`
3503
+ </script>`,F=WQ($,Q);return{output:HQ($,Q,F,K),setupCode:V}}function BQ($){let Z=$,J=[],X=new Set,Y=0,Q=0,G=Z.length,z="",q=()=>{Q++;let B=!1;while(Q<G){let V=Z[Q];if(V==="\\"){Q+=2;continue}if(V==="["&&!B){B=!0,Q++;continue}if(V==="]"&&B){B=!1,Q++;continue}if(V==="/"&&!B){Q++;while(Q<G&&/[gimsuyd]/.test(Z[Q]))Q++;return}if(V===`
3506
3504
  `)return;Q++}},K=()=>{if(!z)return!0;if(/[\w)\]]/.test(z))return!1;return!0},U=(B)=>{Q++;while(Q<G){if(Z[Q]==="\\"){Q+=2;continue}if(Z[Q]===B){Q++;return}Q++}},W=()=>{Q++;while(Q<G){if(Z[Q]==="\\"){Q+=2;continue}if(Z[Q]==="`"){Q++;return}if(Z[Q]==="$"&&Z[Q+1]==="{"){Q+=2;let B=1;while(Q<G&&B>0)if(Z[Q]==="{")B++,Q++;else if(Z[Q]==="}")B--,Q++;else if(Z[Q]==="'"||Z[Q]==='"')U(Z[Q]);else if(Z[Q]==="`")W();else Q++;continue}Q++}},H=()=>{if(Z[Q]==="/"&&Z[Q+1]==="/"){while(Q<G&&Z[Q]!==`
3507
- `)Q++;return!0}if(Z[Q]==="/"&&Z[Q+1]==="*"){Q+=2;while(Q<G-1&&!(Z[Q]==="*"&&Z[Q+1]==="/"))Q++;return Q+=2,!0}return!1},j=()=>{if(Y!==0)return;let B=Z.slice(Q).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(B){let L=B[2];if(!X.has(L))J.push(L),X.add(L);return}let V=Z.slice(Q).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(V){V[1].split(",").forEach((L)=>{let w=L.trim();if(!w)return;let R=w.indexOf(":"),M=(R>=0?w.slice(R+1).trim():w).split(/[\s=]/)[0];if(M&&!X.has(M))J.push(M),X.add(M)});return}let F=Z.slice(Q).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(F){F[1].split(",").forEach((L)=>{let w=L.trim().replace(/^\.\.\./,"");if(!w)return;let R=w.split(/[\s=]/)[0];if(R&&!X.has(R))J.push(R),X.add(R)});return}let O=Z.slice(Q).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(O){let L=O[1];if(!X.has(L))J.push(L),X.add(L);return}let _=Z.slice(Q).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(_){let L=_[1];if(!X.has(L))J.push(L),X.add(L)}};while(Q<G){if(H())continue;if(Z[Q]==="'"||Z[Q]==='"'){U(Z[Q]),z=Z[Q-1];continue}if(Z[Q]==="`"){W(),z="`";continue}if(Z[Q]==="/"&&Z[Q+1]!=="/"&&Z[Q+1]!=="*"&&K()){q(),z="/";continue}if(Z[Q]==="{"){Y++,z="{",Q++;continue}if(Z[Q]==="}"){Y--,z="}",Q++;continue}if(Y===0&&/[a-z]/i.test(Z[Q])&&(Q===0||/\s|[;{}()]/.test(Z[Q-1])))j();if(!/\s/.test(Z[Q]))z=Z[Q];Q++}return J.join(", ")}async function G6($,Z,J,X){if(!Q$($,J))return $;let Y=$;if(Z.skipSignalsRuntime)return Y;let{output:Q,setupCode:G}=await WQ(Y,J,X);if(Y=Q,Y=await L9(Y,Z),G){let z=Z$(Y,/<\/head>/i),q=z===-1?Z$(Y,/<body[^>]*>/i):-1;if(z!==-1)Y=`${Y.slice(0,z)}${G}
3505
+ `)Q++;return!0}if(Z[Q]==="/"&&Z[Q+1]==="*"){Q+=2;while(Q<G-1&&!(Z[Q]==="*"&&Z[Q+1]==="/"))Q++;return Q+=2,!0}return!1},j=()=>{if(Y!==0)return;let B=Z.slice(Q).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(B){let L=B[2];if(!X.has(L))J.push(L),X.add(L);return}let V=Z.slice(Q).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(V){V[1].split(",").forEach((L)=>{let w=L.trim();if(!w)return;let R=w.indexOf(":"),M=(R>=0?w.slice(R+1).trim():w).split(/[\s=]/)[0];if(M&&!X.has(M))J.push(M),X.add(M)});return}let F=Z.slice(Q).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(F){F[1].split(",").forEach((L)=>{let w=L.trim().replace(/^\.\.\./,"");if(!w)return;let R=w.split(/[\s=]/)[0];if(R&&!X.has(R))J.push(R),X.add(R)});return}let O=Z.slice(Q).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(O){let L=O[1];if(!X.has(L))J.push(L),X.add(L);return}let _=Z.slice(Q).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(_){let L=_[1];if(!X.has(L))J.push(L),X.add(L)}};while(Q<G){if(H())continue;if(Z[Q]==="'"||Z[Q]==='"'){U(Z[Q]),z=Z[Q-1];continue}if(Z[Q]==="`"){W(),z="`";continue}if(Z[Q]==="/"&&Z[Q+1]!=="/"&&Z[Q+1]!=="*"&&K()){q(),z="/";continue}if(Z[Q]==="{"){Y++,z="{",Q++;continue}if(Z[Q]==="}"){Y--,z="}",Q++;continue}if(Y===0&&/[a-z]/i.test(Z[Q])&&(Q===0||/\s|[;{}()]/.test(Z[Q-1])))j();if(!/\s/.test(Z[Q]))z=Z[Q];Q++}return J.join(", ")}async function G6($,Z,J,X){if(!Q$($,J))return $;let Y=$;if(Z.skipSignalsRuntime)return Y;let{output:Q,setupCode:G}=await jQ(Y,J,X);if(Y=Q,Y=await L9(Y,Z),G){let z=Z$(Y,/<\/head>/i),q=z===-1?Z$(Y,/<body[^>]*>/i):-1;if(z!==-1)Y=`${Y.slice(0,z)}${G}
3508
3506
  ${Y.slice(z)}`;else if(q!==-1){let K=/<body[^>]*>/i.exec(Y.slice(q))[0],U=q+K.length;Y=`${Y.slice(0,U)}
3509
3507
  ${G}${Y.slice(U)}`}else Y=`${Y}
3510
- ${G}`}if(!G){let q=Y.replace(/<script\b[\s\S]*?<\/script>/gi,"").replace(/<style\b[\s\S]*?<\/style>/gi,"").match(/<body([^>]*)>/i);if(!(q&&/data-stx/.test(q[1]))&&q&&!/data-stx-auto/.test(q[1])){let U=/<body[^>]*>/i,W=Z$(Y,U);if(W!==-1){let H=Y.slice(0,W),j=Y.slice(W).replace(U,(B)=>B.replace(/^<body([^>]*)>$/i,"<body$1 data-stx-auto>"));Y=H+j}}}return Y}function Z$($,Z){let J=/<(script|style)\b[\s\S]*?<\/\1>/gi,X=[],Y;while((Y=J.exec($))!==null)X.push([Y.index,Y.index+Y[0].length]);let Q=new RegExp(Z.source,Z.flags.replace(/[gy]/g,"")),G=0;while(G<$.length){let z=Q.exec($.slice(G));if(!z)return-1;let q=G+z.index;if(!X.some(([U,W])=>q>=U&&q<W))return q;G=q+Math.max(z[0].length,1)}return-1}var e4="/* [stx import stripped, resolved via window.stx in __stx_setup] */";function jQ($){let Z=[];for(let J of $.split(",")){let X=J.trim();if(!X||X.startsWith("type "))continue;let Y=X.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(Y&&Y[1]!==Y[2])Z.push(`${Y[2]} = ${Y[1]}`)}if(Z.length===0)return e4;return`var ${Z.join(", ")}; ${e4}`}var BQ=/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"](?:stx|@stacksjs\/stx|@stacksjs\/browser)['"]\s*;?\s*$/gm;function VQ($){return $.replace(BQ,(Z,J)=>jQ(J))}import u0 from"path";import z$ from"fs";function z6($){return $.split("-").map((Z)=>Z.charAt(0).toUpperCase()+Z.slice(1)).join("")}function q6($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}class K6{builtins=new Map;registerBuiltin($){this.builtins.set($.name.toLowerCase(),$);for(let Z of $.aliases)this.builtins.set(Z.toLowerCase(),$)}isBuiltin($){return this.builtins.has($.toLowerCase())}getBuiltin($){return this.builtins.get($.toLowerCase())??null}async resolveFile($,Z,J,X){let Y=$.endsWith(".stx")?$.slice(0,-4):$,Q=X?.__importedComponents;if(Q){let j=[Y,Y.toLowerCase(),z6(Y),q6(Y)];for(let B of j)if(Q.has(B))return Q.get(B)}let G=[...new Set([`${Y}.stx`,`${z6(Y)}.stx`,`${q6(Y)}.stx`])];if(Y.startsWith("./")||Y.startsWith("../")){let j=u0.resolve(u0.dirname(Z),`${Y}.stx`);if(await s(j))return j;return null}let z=[],q=J.componentsDir||"",K=X?.__originalFilePath;if(K)z.push(u0.join(u0.dirname(K),"components"));if(q)z.push(q);let U=u0.join(u0.dirname(Z),"components");if(!z.includes(U))z.push(U);let W=process.cwd(),H=[u0.resolve(W,"src/components"),u0.resolve(W,"components"),u0.resolve(import.meta.dir,"components")];for(let j of H)if(!z.includes(j))z.push(j);for(let j of z){if(!j)continue;for(let B of G){let V=u0.join(j,B);if(await s(V))return V}try{if(!z$.statSync(j,{throwIfNoEntry:!1})?.isDirectory())continue;let V=z$.readdirSync(j,{withFileTypes:!0});for(let F of V)if(F.isDirectory()){let O=u0.join(j,F.name);for(let _ of G){let L=u0.join(O,_);if(await s(L))return L}}}catch{}}return null}}var i1=new K6;function R0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var k1="\x00stx-boolean-attribute";function q$($){return $.indexOf("\x00")===-1?$:$.replace(/\0/g,"")}function n1($,Z){let J=[];for(let[X,Y]of Object.entries($.static)){if(Z.has(X))continue;let Q=$.staticNames?.[X]??X;if(typeof Y==="boolean"){if(Y)J.push(R0(Q));continue}if(Y===k1){J.push(R0(Q));continue}J.push(`${R0(Q)}="${R0(q$(String(Y)))}"`)}return J}function o1($,Z){let J=[];for(let[X,Y]of Object.entries($.serverDynamic??{})){if(Z.has(X))continue;if(Y===null||Y===void 0||Y===!1)continue;let Q=$.serverDynamicNames?.[X]??X;if(Y===!0){J.push(R0(Q));continue}if(typeof Y==="object")continue;J.push(`${R0(Q)}="${R0(q$(String(Y)))}"`)}return J}function F2($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function LQ($){if($.clientReactive.to)return{value:$.clientReactive.to,reactive:!0};if($.serverDynamic.to!==void 0)return{value:String($.serverDynamic.to),reactive:!1};if(typeof $.static.to==="string")return{value:$.static.to,reactive:!1};return{value:"#",reactive:!1}}var K$={name:"StxLink",aliases:["stx-link"],render($,Z,J){let X=LQ($),Y=(typeof $.static.class==="string"?$.static.class:"")||(typeof $.static.className==="string"?$.static.className:""),Q=typeof $.static.activeClass==="string"?$.static.activeClass:"active",G=typeof $.static.exactActiveClass==="string"?$.static.exactActiveClass:"exact-active",z=$.static.prefetch===!0||$.static.prefetch==="true"||$.serverDynamic.prefetch===!0,q=[];if(X.reactive)q.push(`:href="${F2(X.value)}"`);else q.push(`href="${F2(X.value)}"`);if(Y)q.push(`class="${F2(Y)}"`);if(q.push("data-stx-link"),q.push(`data-stx-active-class="${F2(Q)}"`),q.push(`data-stx-exact-active-class="${F2(G)}"`),z)q.push("data-stx-prefetch");let K=new Set(["to","class","className","activeClass","exactActiveClass","prefetch"]);return q.push(...n1($,K)),q.push(...o1($,K)),`<a ${q.join(" ")}>${Z}</a>`}};import r1 from"fs";import U$ from"path";var _Q=new Set([".jpg",".jpeg",".png",".webp",".avif"]),B1=new Map,s1=!1;function U6($){if(!$)return;let Z=$.split("?")[0].split("#")[0];return B1.get(Z)}function cH(){return s1}function pH(){B1.clear(),s1=!1}function iH($,Z){B1.set($,Z),s1=!0}function OQ($){let Z=0,J=0,X=0,Y=0;for(let G=0;G<$.length;G+=4)Z+=$[G],J+=$[G+1],X+=$[G+2],Y++;if(Y===0)return"#e5e7eb";let Q=(G)=>Math.round(G/Y).toString(16).padStart(2,"0");return`#${Q(Z)}${Q(J)}${Q(X)}`}function FQ($,Z,J,X=4,Y=3){let Q=[];for(let G=0;G<Y;G++)for(let z=0;z<X;z++){let q=Math.floor(z*Z/X),K=Math.max(q+1,Math.floor((z+1)*Z/X)),U=Math.floor(G*J/Y),W=Math.max(U+1,Math.floor((G+1)*J/Y)),H=0,j=0,B=0,V=0;for(let O=U;O<W;O++)for(let _=q;_<K;_++){let L=(O*Z+_)*4;H+=$[L],j+=$[L+1],B+=$[L+2],V++}let F=(O)=>Math.round(O/V).toString(16).padStart(2,"0");Q.push(`<rect x="${z}" y="${G}" width="1" height="1" fill="#${F(H)}${F(j)}${F(B)}"/>`)}return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${X} ${Y}" preserveAspectRatio="none"><filter id="b"><feGaussianBlur stdDeviation=".6"/></filter><g filter="url(#b)">${Q.join("")}</g></svg>`}function wQ($){return`data:image/svg+xml;base64,${Buffer.from($,"utf8").toString("base64")}`}function RQ($){try{return JSON.parse(r1.readFileSync($,"utf8"))}catch{return{}}}function DQ($,Z){try{r1.mkdirSync(U$.dirname($),{recursive:!0}),r1.writeFileSync($,JSON.stringify(Z))}catch{}}function W6($,Z,J=[]){let X;try{X=r1.readdirSync($,{withFileTypes:!0})}catch{return J}for(let Y of X){let Q=U$.join($,Y.name);if(Y.isDirectory()){W6(Q,`${Z}/${Y.name}`,J);continue}if(!_Q.has(U$.extname(Y.name).toLowerCase()))continue;J.push([`${Z}/${Y.name}`,Q])}return J}async function nH($,Z={}){let{cachePath:J,maxBytes:X=33554432,limit:Y=2000}=Z;if(!$||!r1.existsSync($))return s1=!0,B1.size;let Q;try{Q=await import("ts-images")}catch{return s1=!0,B1.size}let G=J?RQ(J):{},z=!1,q=W6($,"").slice(0,Y),K=8,U=async([W,H])=>{let j;try{j=r1.statSync(H)}catch{return}if(j.size>X)return;let B=G[W];if(B&&B.mtimeMs===j.mtimeMs&&B.size===j.size){B1.set(W,{dataUrl:B.dataUrl,color:B.color});return}try{let{hash:V}=await Q.generateThumbHash(H);if(!V)return;let{rgba:F,w:O,h:_}=Q.thumbHashToRGBA(V),L={dataUrl:wQ(FQ(F,O,_)),color:OQ(F)};B1.set(W,L),G[W]={mtimeMs:j.mtimeMs,size:j.size,...L},z=!0}catch{}};for(let W=0;W<q.length;W+=K)await Promise.all(q.slice(W,W+K).map(U));if(J&&z)DQ(J,G);return s1=!0,B1.size}var NQ={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},W$=[320,640,768,1024,1280,1536,1920];function F0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function N0($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let J=$.static[Z];if(typeof J==="string")return J;return}function w9($,Z,J=!1){let X=$.serverDynamic[Z];if(X!==void 0)return X!==!1&&X!=="false";let Y=$.static[Z];if(Y!==void 0)return Y!=="false"&&Y!==!1;return J}function MQ($){let Z=(X)=>$.variants.filter((Y)=>Y.format===X).reduce((Y,Q)=>Y+Q.bytes,0),J=Z($.fallback.format);return["avif","webp"].map((X)=>({format:X,srcset:$.sources[X]||"",bytes:Z(X)})).filter((X)=>X.srcset&&X.bytes>0&&X.bytes<J).sort((X,Y)=>X.bytes-Y.bytes).map(({format:X,srcset:Y})=>({format:X,srcset:Y}))}function H$($){if($.includes("(")||$.includes(","))return $;let Z=$.trim().split(/\s+/),J=[];for(let X of Z)if(X.includes(":")){let[Y,Q]=X.split(":"),G=NQ[Y];if(G)J.push(`(max-width: ${G}px) ${Q}`);else{let z=Number.parseInt(Y);if(!Number.isNaN(z))J.push(`(max-width: ${z}px) ${Q}`)}}else J.push(X);return J.join(", ")}function j$($,Z,J,X){return Z.map((Y)=>`${w2($,Y,void 0,J,X)} ${Y}w`).join(", ")}function AQ($,Z,J,X,Y){return Z.map((Q)=>{let G=J?J*Q:void 0;return`${w2($,G,void 0,X,Y)} ${Q}x`}).join(", ")}function w2($,Z,J,X,Y){if(!X||X==="local"||X==="static")return $;if(X==="cloudinary"){let Q=[];if(Z)Q.push(`w_${Z}`);if(J)Q.push(`h_${J}`);if(Y)Q.push(`f_${Y}`);Q.push("q_auto");let G=Q.join(",");return $.replace("/upload/",`/upload/${G}/`)}if(X==="imgix"){let Q=new URLSearchParams;if(Z)Q.set("w",String(Z));if(J)Q.set("h",String(J));if(Y)Q.set("fm",Y);Q.set("auto","format");let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}if(X==="bunny"){let Q=new URLSearchParams;if(Z)Q.set("width",String(Z));if(J)Q.set("height",String(J));if(Y)Q.set("format",Y);let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}return $}function kQ($,Z,J="#e5e7eb"){let X=`<svg xmlns="http://www.w3.org/2000/svg" width="${$}" height="${Z}"><rect width="100%" height="100%" fill="${J}"/></svg>`;return`data:image/svg+xml;base64,${btoa(X)}`}var B$={name:"StxImage",aliases:["Image","stx-image","stx-img"],render($,Z,J){let X=N0($,"src")||"",Y=H6(X),Q=N0($,"alt")||"",G=N0($,"width")||(Y?String(Y.source.width):void 0),z=N0($,"height")||(Y?String(Y.source.height):void 0),q=N0($,"sizes"),K=N0($,"srcset"),U=N0($,"densities"),W=N0($,"format"),H=N0($,"placeholder")||(Y?"thumbhash":void 0),j=N0($,"placeholderColor")||"#e5e7eb",B=N0($,"provider"),V=N0($,"class")||N0($,"className")||"",F=N0($,"style")||"",O=N0($,"quality"),_=w9($,"lazy",!0),L=w9($,"preload",!1),w=w9($,"priority",!1),R=N0($,"loading"),D=N0($,"decoding")||"async",M=!!Y||w9($,"picture",!1)||!!W,I=G?Number.parseInt(G):void 0,N=z?Number.parseInt(z):void 0,A=K||"",T="";if(Y)A=Y.sources[Y.fallback.format]||"",T=q?H$(q):"100vw";else if(!A&&q&&B&&B!=="local"&&B!=="static")A=j$(X,W$,B,W),T=H$(q);else if(!A&&U){let g=U.split(/\s+/).map((x)=>Number.parseFloat(x.replace("x","")));A=AQ(X,g,I,B,W)}else if(q)T=H$(q);let k=[];if(F)k.push(F);if(I&&N)k.push(`aspect-ratio:${I}/${N}`);if(H==="blur"||H==="color"||H==="thumbhash"){let g=Y?.placeholder?{dataUrl:Y.placeholder.dataUrl,color:j}:U6(X);if(g&&H==="color")k.push(`background-color:${g.color}`);else if(g)k.push(`background-color:${g.color}`),k.push(`background-image:url(${g.dataUrl})`),k.push("background-size:cover"),k.push("background-repeat:no-repeat");else{let x=kQ(I||16,N||9,j);k.push(`background-image:url(${x})`),k.push("background-size:cover"),k.push("background-repeat:no-repeat")}}else if(H&&H!=="empty"&&H!=="none")k.push(`background-image:url(${F0(H)})`),k.push("background-size:cover"),k.push("background-repeat:no-repeat");let y=Y?.fallback.url||w2(X,I,N,B,W),E=[];if(E.push(`src="${F0(y)}"`),E.push(`alt="${F0(Q)}"`),G)E.push(`width="${F0(G)}"`);if(z)E.push(`height="${F0(z)}"`);let b=R||(w||L?"eager":_?"lazy":"");if(b)E.push(`loading="${F0(b)}"`);if(w)E.push('fetchpriority="high"');if(E.push(`decoding="${F0(D)}"`),V)E.push(`class="${F0(V)}"`);if(k.length>0)E.push(`style="${F0(k.join(";"))}"`);if(A)E.push(`srcset="${F0(A)}"`);if(T)E.push(`sizes="${F0(T)}"`);let C=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","format","provider","quality","densities","preload","priority","picture","loading","decoding"]);E.push(...n1($,C)),E.push(...o1($,C));let v=`<img ${E.join(" ")} />`,P="";if(L){let x=W==="webp"?"image/webp":W==="avif"?"image/avif":"";P=`<link rel="preload" as="image" href="${F0(y)}"${x?` type="${x}"`:""}${A?` imagesrcset="${F0(A)}"`:""}${T?` imagesizes="${F0(T)}"`:""} />
3511
- `}if(M){let g=[];if(Y)for(let x of MQ(Y))g.push(`<source type="image/${x.format}" srcset="${F0(x.srcset)}"${T?` sizes="${F0(T)}"`:""} />`);if(!Y&&(W==="avif"||W==="auto")){let x=w2(X,I,N,B,"avif"),$0=A?j$(X,W$,B,"avif"):`${x}`;g.push(`<source type="image/avif" srcset="${F0($0)}"${T?` sizes="${F0(T)}"`:""} />`)}if(!Y&&(W==="webp"||W==="auto")){let x=w2(X,I,N,B,"webp"),$0=A?j$(X,W$,B,"webp"):`${x}`;g.push(`<source type="image/webp" srcset="${F0($0)}"${T?` sizes="${F0(T)}"`:""} />`)}return`${P}<picture>
3508
+ ${G}`}if(!G){let q=Y.replace(/<script\b[\s\S]*?<\/script>/gi,"").replace(/<style\b[\s\S]*?<\/style>/gi,"").match(/<body([^>]*)>/i);if(!(q&&/data-stx/.test(q[1]))&&q&&!/data-stx-auto/.test(q[1])){let U=/<body[^>]*>/i,W=Z$(Y,U);if(W!==-1){let H=Y.slice(0,W),j=Y.slice(W).replace(U,(B)=>B.replace(/^<body([^>]*)>$/i,"<body$1 data-stx-auto>"));Y=H+j}}}return Y}function Z$($,Z){let J=/<(script|style)\b[\s\S]*?<\/\1>/gi,X=[],Y;while((Y=J.exec($))!==null)X.push([Y.index,Y.index+Y[0].length]);let Q=new RegExp(Z.source,Z.flags.replace(/[gy]/g,"")),G=0;while(G<$.length){let z=Q.exec($.slice(G));if(!z)return-1;let q=G+z.index;if(!X.some(([U,W])=>q>=U&&q<W))return q;G=q+Math.max(z[0].length,1)}return-1}var e4="/* [stx import stripped, resolved via window.stx in __stx_setup] */";function VQ($){let Z=[];for(let J of $.split(",")){let X=J.trim();if(!X||X.startsWith("type "))continue;let Y=X.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(Y&&Y[1]!==Y[2])Z.push(`${Y[2]} = ${Y[1]}`)}if(Z.length===0)return e4;return`var ${Z.join(", ")}; ${e4}`}var LQ=/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"](?:stx|@stacksjs\/stx|@stacksjs\/browser)['"]\s*;?\s*$/gm;function _Q($){return $.replace(LQ,(Z,J)=>VQ(J))}import u0 from"path";import z$ from"fs";function z6($){return $.split("-").map((Z)=>Z.charAt(0).toUpperCase()+Z.slice(1)).join("")}function q6($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}class K6{builtins=new Map;registerBuiltin($){this.builtins.set($.name.toLowerCase(),$);for(let Z of $.aliases)this.builtins.set(Z.toLowerCase(),$)}isBuiltin($){return this.builtins.has($.toLowerCase())}getBuiltin($){return this.builtins.get($.toLowerCase())??null}async resolveFile($,Z,J,X){let Y=$.endsWith(".stx")?$.slice(0,-4):$,Q=X?.__importedComponents;if(Q){let j=[Y,Y.toLowerCase(),z6(Y),q6(Y)];for(let B of j)if(Q.has(B))return Q.get(B)}let G=[...new Set([`${Y}.stx`,`${z6(Y)}.stx`,`${q6(Y)}.stx`])];if(Y.startsWith("./")||Y.startsWith("../")){let j=u0.resolve(u0.dirname(Z),`${Y}.stx`);if(await s(j))return j;return null}let z=[],q=J.componentsDir||"",K=X?.__originalFilePath;if(K)z.push(u0.join(u0.dirname(K),"components"));if(q)z.push(q);let U=u0.join(u0.dirname(Z),"components");if(!z.includes(U))z.push(U);let W=process.cwd(),H=[u0.resolve(W,"src/components"),u0.resolve(W,"components"),u0.resolve(import.meta.dir,"components")];for(let j of H)if(!z.includes(j))z.push(j);for(let j of z){if(!j)continue;for(let B of G){let V=u0.join(j,B);if(await s(V))return V}try{if(!z$.statSync(j,{throwIfNoEntry:!1})?.isDirectory())continue;let V=z$.readdirSync(j,{withFileTypes:!0});for(let F of V)if(F.isDirectory()){let O=u0.join(j,F.name);for(let _ of G){let L=u0.join(O,_);if(await s(L))return L}}}catch{}}return null}}var i1=new K6;function R0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var k1="\x00stx-boolean-attribute";function q$($){return $.indexOf("\x00")===-1?$:$.replace(/\0/g,"")}function n1($,Z){let J=[];for(let[X,Y]of Object.entries($.static)){if(Z.has(X))continue;let Q=$.staticNames?.[X]??X;if(typeof Y==="boolean"){if(Y)J.push(R0(Q));continue}if(Y===k1){J.push(R0(Q));continue}J.push(`${R0(Q)}="${R0(q$(String(Y)))}"`)}return J}function o1($,Z){let J=[];for(let[X,Y]of Object.entries($.serverDynamic??{})){if(Z.has(X))continue;if(Y===null||Y===void 0||Y===!1)continue;let Q=$.serverDynamicNames?.[X]??X;if(Y===!0){J.push(R0(Q));continue}if(typeof Y==="object")continue;J.push(`${R0(Q)}="${R0(q$(String(Y)))}"`)}return J}function F2($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function OQ($){if($.clientReactive.to)return{value:$.clientReactive.to,reactive:!0};if($.serverDynamic.to!==void 0)return{value:String($.serverDynamic.to),reactive:!1};if(typeof $.static.to==="string")return{value:$.static.to,reactive:!1};return{value:"#",reactive:!1}}var K$={name:"StxLink",aliases:["stx-link"],render($,Z,J){let X=OQ($),Y=(typeof $.static.class==="string"?$.static.class:"")||(typeof $.static.className==="string"?$.static.className:""),Q=typeof $.static.activeClass==="string"?$.static.activeClass:"active",G=typeof $.static.exactActiveClass==="string"?$.static.exactActiveClass:"exact-active",z=$.static.prefetch===!0||$.static.prefetch==="true"||$.serverDynamic.prefetch===!0,q=[];if(X.reactive)q.push(`:href="${F2(X.value)}"`);else q.push(`href="${F2(X.value)}"`);if(Y)q.push(`class="${F2(Y)}"`);if(q.push("data-stx-link"),q.push(`data-stx-active-class="${F2(Q)}"`),q.push(`data-stx-exact-active-class="${F2(G)}"`),z)q.push("data-stx-prefetch");let K=new Set(["to","class","className","activeClass","exactActiveClass","prefetch"]);return q.push(...n1($,K)),q.push(...o1($,K)),`<a ${q.join(" ")}>${Z}</a>`}};import r1 from"fs";import U$ from"path";var FQ=new Set([".jpg",".jpeg",".png",".webp",".avif"]),B1=new Map,s1=!1;function U6($){if(!$)return;let Z=$.split("?")[0].split("#")[0];return B1.get(Z)}function lH(){return s1}function cH(){B1.clear(),s1=!1}function pH($,Z){B1.set($,Z),s1=!0}function wQ($){let Z=0,J=0,X=0,Y=0;for(let G=0;G<$.length;G+=4)Z+=$[G],J+=$[G+1],X+=$[G+2],Y++;if(Y===0)return"#e5e7eb";let Q=(G)=>Math.round(G/Y).toString(16).padStart(2,"0");return`#${Q(Z)}${Q(J)}${Q(X)}`}function RQ($,Z,J,X=4,Y=3){let Q=[];for(let G=0;G<Y;G++)for(let z=0;z<X;z++){let q=Math.floor(z*Z/X),K=Math.max(q+1,Math.floor((z+1)*Z/X)),U=Math.floor(G*J/Y),W=Math.max(U+1,Math.floor((G+1)*J/Y)),H=0,j=0,B=0,V=0;for(let O=U;O<W;O++)for(let _=q;_<K;_++){let L=(O*Z+_)*4;H+=$[L],j+=$[L+1],B+=$[L+2],V++}let F=(O)=>Math.round(O/V).toString(16).padStart(2,"0");Q.push(`<rect x="${z}" y="${G}" width="1" height="1" fill="#${F(H)}${F(j)}${F(B)}"/>`)}return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${X} ${Y}" preserveAspectRatio="none"><filter id="b"><feGaussianBlur stdDeviation=".6"/></filter><g filter="url(#b)">${Q.join("")}</g></svg>`}function DQ($){return`data:image/svg+xml;base64,${Buffer.from($,"utf8").toString("base64")}`}function NQ($){try{return JSON.parse(r1.readFileSync($,"utf8"))}catch{return{}}}function MQ($,Z){try{r1.mkdirSync(U$.dirname($),{recursive:!0}),r1.writeFileSync($,JSON.stringify(Z))}catch{}}function W6($,Z,J=[]){let X;try{X=r1.readdirSync($,{withFileTypes:!0})}catch{return J}for(let Y of X){let Q=U$.join($,Y.name);if(Y.isDirectory()){W6(Q,`${Z}/${Y.name}`,J);continue}if(!FQ.has(U$.extname(Y.name).toLowerCase()))continue;J.push([`${Z}/${Y.name}`,Q])}return J}async function iH($,Z={}){let{cachePath:J,maxBytes:X=33554432,limit:Y=2000}=Z;if(!$||!r1.existsSync($))return s1=!0,B1.size;let Q;try{Q=await import("ts-images")}catch{return s1=!0,B1.size}let G=J?NQ(J):{},z=!1,q=W6($,"").slice(0,Y),K=8,U=async([W,H])=>{let j;try{j=r1.statSync(H)}catch{return}if(j.size>X)return;let B=G[W];if(B&&B.mtimeMs===j.mtimeMs&&B.size===j.size){B1.set(W,{dataUrl:B.dataUrl,color:B.color});return}try{let{hash:V}=await Q.generateThumbHash(H);if(!V)return;let{rgba:F,w:O,h:_}=Q.thumbHashToRGBA(V),L={dataUrl:DQ(RQ(F,O,_)),color:wQ(F)};B1.set(W,L),G[W]={mtimeMs:j.mtimeMs,size:j.size,...L},z=!0}catch{}};for(let W=0;W<q.length;W+=K)await Promise.all(q.slice(W,W+K).map(U));if(J&&z)MQ(J,G);return s1=!0,B1.size}var AQ={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},W$=[320,640,768,1024,1280,1536,1920];function F0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function N0($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let J=$.static[Z];if(typeof J==="string")return J;return}function w9($,Z,J=!1){let X=$.serverDynamic[Z];if(X!==void 0)return X!==!1&&X!=="false";let Y=$.static[Z];if(Y!==void 0)return Y!=="false"&&Y!==!1;return J}function kQ($){let Z=(X)=>$.variants.filter((Y)=>Y.format===X).reduce((Y,Q)=>Y+Q.bytes,0),J=Z($.fallback.format);return["avif","webp"].map((X)=>({format:X,srcset:$.sources[X]||"",bytes:Z(X)})).filter((X)=>X.srcset&&X.bytes>0&&X.bytes<J).sort((X,Y)=>X.bytes-Y.bytes).map(({format:X,srcset:Y})=>({format:X,srcset:Y}))}function H$($){if($.includes("(")||$.includes(","))return $;let Z=$.trim().split(/\s+/),J=[];for(let X of Z)if(X.includes(":")){let[Y,Q]=X.split(":"),G=AQ[Y];if(G)J.push(`(max-width: ${G}px) ${Q}`);else{let z=Number.parseInt(Y);if(!Number.isNaN(z))J.push(`(max-width: ${z}px) ${Q}`)}}else J.push(X);return J.join(", ")}function j$($,Z,J,X){return Z.map((Y)=>`${w2($,Y,void 0,J,X)} ${Y}w`).join(", ")}function IQ($,Z,J,X,Y){return Z.map((Q)=>{let G=J?J*Q:void 0;return`${w2($,G,void 0,X,Y)} ${Q}x`}).join(", ")}function w2($,Z,J,X,Y){if(!X||X==="local"||X==="static")return $;if(X==="cloudinary"){let Q=[];if(Z)Q.push(`w_${Z}`);if(J)Q.push(`h_${J}`);if(Y)Q.push(`f_${Y}`);Q.push("q_auto");let G=Q.join(",");return $.replace("/upload/",`/upload/${G}/`)}if(X==="imgix"){let Q=new URLSearchParams;if(Z)Q.set("w",String(Z));if(J)Q.set("h",String(J));if(Y)Q.set("fm",Y);Q.set("auto","format");let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}if(X==="bunny"){let Q=new URLSearchParams;if(Z)Q.set("width",String(Z));if(J)Q.set("height",String(J));if(Y)Q.set("format",Y);let G=$.includes("?")?"&":"?";return`${$}${G}${Q.toString()}`}return $}function TQ($,Z,J="#e5e7eb"){let X=`<svg xmlns="http://www.w3.org/2000/svg" width="${$}" height="${Z}"><rect width="100%" height="100%" fill="${J}"/></svg>`;return`data:image/svg+xml;base64,${btoa(X)}`}var B$={name:"StxImage",aliases:["Image","stx-image","stx-img"],render($,Z,J){let X=N0($,"src")||"",Y=H6(X),Q=N0($,"alt")||"",G=N0($,"width")||(Y?String(Y.source.width):void 0),z=N0($,"height")||(Y?String(Y.source.height):void 0),q=N0($,"sizes"),K=N0($,"srcset"),U=N0($,"densities"),W=N0($,"format"),H=N0($,"placeholder")||(Y?"thumbhash":void 0),j=N0($,"placeholderColor")||"#e5e7eb",B=N0($,"provider"),V=N0($,"class")||N0($,"className")||"",F=N0($,"style")||"",O=N0($,"quality"),_=w9($,"lazy",!0),L=w9($,"preload",!1),w=w9($,"priority",!1),R=N0($,"loading"),D=N0($,"decoding")||"async",M=!!Y||w9($,"picture",!1)||!!W,I=G?Number.parseInt(G):void 0,N=z?Number.parseInt(z):void 0,A=K||"",T="";if(Y)A=Y.sources[Y.fallback.format]||"",T=q?H$(q):"100vw";else if(!A&&q&&B&&B!=="local"&&B!=="static")A=j$(X,W$,B,W),T=H$(q);else if(!A&&U){let g=U.split(/\s+/).map((x)=>Number.parseFloat(x.replace("x","")));A=IQ(X,g,I,B,W)}else if(q)T=H$(q);let k=[];if(F)k.push(F);if(I&&N)k.push(`aspect-ratio:${I}/${N}`);if(H==="blur"||H==="color"||H==="thumbhash"){let g=Y?.placeholder?{dataUrl:Y.placeholder.dataUrl,color:j}:U6(X);if(g&&H==="color")k.push(`background-color:${g.color}`);else if(g)k.push(`background-color:${g.color}`),k.push(`background-image:url(${g.dataUrl})`),k.push("background-size:cover"),k.push("background-repeat:no-repeat");else{let x=TQ(I||16,N||9,j);k.push(`background-image:url(${x})`),k.push("background-size:cover"),k.push("background-repeat:no-repeat")}}else if(H&&H!=="empty"&&H!=="none")k.push(`background-image:url(${F0(H)})`),k.push("background-size:cover"),k.push("background-repeat:no-repeat");let y=Y?.fallback.url||w2(X,I,N,B,W),E=[];if(E.push(`src="${F0(y)}"`),E.push(`alt="${F0(Q)}"`),G)E.push(`width="${F0(G)}"`);if(z)E.push(`height="${F0(z)}"`);let b=R||(w||L?"eager":_?"lazy":"");if(b)E.push(`loading="${F0(b)}"`);if(w)E.push('fetchpriority="high"');if(E.push(`decoding="${F0(D)}"`),V)E.push(`class="${F0(V)}"`);if(k.length>0)E.push(`style="${F0(k.join(";"))}"`);if(A)E.push(`srcset="${F0(A)}"`);if(T)E.push(`sizes="${F0(T)}"`);let C=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","format","provider","quality","densities","preload","priority","picture","loading","decoding"]);E.push(...n1($,C)),E.push(...o1($,C));let v=`<img ${E.join(" ")} />`,P="";if(L){let x=W==="webp"?"image/webp":W==="avif"?"image/avif":"";P=`<link rel="preload" as="image" href="${F0(y)}"${x?` type="${x}"`:""}${A?` imagesrcset="${F0(A)}"`:""}${T?` imagesizes="${F0(T)}"`:""} />
3509
+ `}if(M){let g=[];if(Y)for(let x of kQ(Y))g.push(`<source type="image/${x.format}" srcset="${F0(x.srcset)}"${T?` sizes="${F0(T)}"`:""} />`);if(!Y&&(W==="avif"||W==="auto")){let x=w2(X,I,N,B,"avif"),$0=A?j$(X,W$,B,"avif"):`${x}`;g.push(`<source type="image/avif" srcset="${F0($0)}"${T?` sizes="${F0(T)}"`:""} />`)}if(!Y&&(W==="webp"||W==="auto")){let x=w2(X,I,N,B,"webp"),$0=A?j$(X,W$,B,"webp"):`${x}`;g.push(`<source type="image/webp" srcset="${F0($0)}"${T?` sizes="${F0(T)}"`:""} />`)}return`${P}<picture>
3512
3510
  ${g.join(`
3513
3511
  `)}
3514
3512
  ${v}
3515
- </picture>`}return`${P}${v}`}};var j6="/images/safe-image-default.svg";function R2($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function a1($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let J=$.static[Z];if(typeof J==="string")return J;return}var IQ=`<script>window.__stxSafeImageHandler||(window.__stxSafeImageHandler=function(i){if(i.__stx_fb)return;i.__stx_fb=1;var f=i.getAttribute('data-fallback')||'${j6}';var c=i.getAttribute('data-fallback-class');i.src=f;if(c)i.className=c;});</script>`,V$={name:"SafeImage",aliases:["safe-image","safe-img"],render($,Z,J){let X=a1($,"src")||"",Y=a1($,"alt")||"",Q=a1($,"fallback")||j6,G=a1($,"class")||a1($,"className")||"",z=a1($,"fallbackClassName")||"",q=[];if(q.push(`src="${R2(X)}"`),q.push(`alt="${R2(Y)}"`),G)q.push(`class="${R2(G)}"`);if(q.push(`data-fallback="${R2(Q)}"`),z)q.push(`data-fallback-class="${R2(z)}"`);q.push('onerror="window.__stxSafeImageHandler(this)"');let K=new Set(["src","alt","fallback","class","className","fallbackClassName"]);q.push(...n1($,K)),q.push(...o1($,K));let U=`<img ${q.join(" ")} />`,W=J.context;if(!W.__safeImageHandlerEmitted)return W.__safeImageHandlerEmitted=!0,`${IQ}${U}`;return U}};function L$($){return $.replace(/[;{}()]/g,"").replace(/url/gi,"")}function D2($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let J=$.static[Z];if(typeof J==="string")return J;return}function R9($,Z,J){let X=D2($,Z);if(X!==void 0){let Y=Number.parseInt(X,10);if(!Number.isNaN(Y))return Y}return J}var _$={name:"StxLoadingIndicator",aliases:["stx-loading-indicator"],render($,Z,J){let X=L$(D2($,"color")||"#6366f1"),Y=L$(D2($,"initialColor")||D2($,"initial-color")||""),Q=L$(D2($,"height")||"3px"),G=R9($,"duration",2000),z=R9($,"throttle",200),q=R9($,"zIndex",999999)||R9($,"z-index",999999),K=Y?`linear-gradient(to right, ${Y}, ${X})`:X;return`
3513
+ </picture>`}return`${P}${v}`}};var j6="/images/safe-image-default.svg";function R2($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function a1($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let J=$.static[Z];if(typeof J==="string")return J;return}var EQ=`<script>window.__stxSafeImageHandler||(window.__stxSafeImageHandler=function(i){if(i.__stx_fb)return;i.__stx_fb=1;var f=i.getAttribute('data-fallback')||'${j6}';var c=i.getAttribute('data-fallback-class');i.src=f;if(c)i.className=c;});</script>`,V$={name:"SafeImage",aliases:["safe-image","safe-img"],render($,Z,J){let X=a1($,"src")||"",Y=a1($,"alt")||"",Q=a1($,"fallback")||j6,G=a1($,"class")||a1($,"className")||"",z=a1($,"fallbackClassName")||"",q=[];if(q.push(`src="${R2(X)}"`),q.push(`alt="${R2(Y)}"`),G)q.push(`class="${R2(G)}"`);if(q.push(`data-fallback="${R2(Q)}"`),z)q.push(`data-fallback-class="${R2(z)}"`);q.push('onerror="window.__stxSafeImageHandler(this)"');let K=new Set(["src","alt","fallback","class","className","fallbackClassName"]);q.push(...n1($,K)),q.push(...o1($,K));let U=`<img ${q.join(" ")} />`,W=J.context;if(!W.__safeImageHandlerEmitted)return W.__safeImageHandlerEmitted=!0,`${EQ}${U}`;return U}};function L$($){return $.replace(/[;{}()]/g,"").replace(/url/gi,"")}function D2($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let J=$.static[Z];if(typeof J==="string")return J;return}function R9($,Z,J){let X=D2($,Z);if(X!==void 0){let Y=Number.parseInt(X,10);if(!Number.isNaN(Y))return Y}return J}var _$={name:"StxLoadingIndicator",aliases:["stx-loading-indicator"],render($,Z,J){let X=L$(D2($,"color")||"#6366f1"),Y=L$(D2($,"initialColor")||D2($,"initial-color")||""),Q=L$(D2($,"height")||"3px"),G=R9($,"duration",2000),z=R9($,"throttle",200),q=R9($,"zIndex",999999)||R9($,"z-index",999999),K=Y?`linear-gradient(to right, ${Y}, ${X})`:X;return`
3516
3514
  <div id="stx-loading-indicator" style="position:fixed;top:0;left:0;right:0;height:${Q};background:${K};z-index:${q};transform:scaleX(0);transform-origin:left;transition:transform 0.1s ease-out,opacity 0.3s ease;opacity:0;pointer-events:none">
3517
3515
  <div style="position:absolute;top:0;left:0;right:0;bottom:0;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,0.4) 50%,transparent 100%);animation:stx-shimmer 1.5s infinite"></div>
3518
3516
  </div>
3519
3517
  <style>@keyframes stx-shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}</style>
3520
3518
  <script>
3521
3519
  (function(){var el=document.getElementById('stx-loading-indicator'),p=0,l=!1,i=null;function u(v){p=Math.min(Math.max(v,0),100);if(el){el.style.opacity=p>0?'1':'0';el.style.transform='scaleX('+(p/100)+')'}}window.stxLoading={start:function(){l=!0;p=0;u(10);if(i)clearInterval(i);i=setInterval(function(){if(!l)return;var r=90-p,inc=Math.max(0.5,r*0.1);if(p<90)u(p+inc)},${z})},finish:function(){l=!1;if(i){clearInterval(i);i=null}u(100);setTimeout(function(){if(el)el.style.opacity='0';setTimeout(function(){p=0;if(el)el.style.transform='scaleX(0)'},300)},200)},set:function(v){u(v)},clear:function(){l=!1;p=0;if(i){clearInterval(i);i=null}if(el){el.style.opacity='0';el.style.transform='scaleX(0)'}}};document.addEventListener('click',function(e){var a=e.target.closest&&e.target.closest('a');if(!a)return;var h=a.getAttribute('href');if(!h||h.startsWith('http')||h.startsWith('#')||h.startsWith('mailto:')||h.startsWith('tel:')||a.target==='_blank')return;window.stxLoading.start()});window.addEventListener('popstate',function(){window.stxLoading.start()});window.addEventListener('load',function(){window.stxLoading.finish()})})();
3522
- </script>`}};function V6($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let J=$.static[Z];if(typeof J==="string")return J;return}function TQ($,Z,J){let X=V6($,Z);if(X!==void 0){let Y=Number.parseInt(X,10);if(!Number.isNaN(Y))return Y}return J}var B6={"top-right":"top:1rem;right:1rem","top-left":"top:1rem;left:1rem","top-center":"top:1rem;left:50%;transform:translateX(-50%)","bottom-right":"bottom:1rem;right:1rem","bottom-left":"bottom:1rem;left:1rem","bottom-center":"bottom:1rem;left:50%;transform:translateX(-50%)"},O$={name:"StxToast",aliases:["stx-toast"],render($,Z,J){let X=R0(V6($,"position")||"top-right"),Y=TQ($,"max",5),Q=B6[X]||B6["top-right"];return`<div id="stx-toast-container" data-stx-toast-position="${X}" data-stx-toast-max="${Y}" style="position:fixed;${Q};z-index:999999;display:flex;flex-direction:column;gap:0.5rem;pointer-events:none;max-width:24rem;width:100%"></div>
3520
+ </script>`}};function V6($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let J=$.static[Z];if(typeof J==="string")return J;return}function bQ($,Z,J){let X=V6($,Z);if(X!==void 0){let Y=Number.parseInt(X,10);if(!Number.isNaN(Y))return Y}return J}var B6={"top-right":"top:1rem;right:1rem","top-left":"top:1rem;left:1rem","top-center":"top:1rem;left:50%;transform:translateX(-50%)","bottom-right":"bottom:1rem;right:1rem","bottom-left":"bottom:1rem;left:1rem","bottom-center":"bottom:1rem;left:50%;transform:translateX(-50%)"},O$={name:"StxToast",aliases:["stx-toast"],render($,Z,J){let X=R0(V6($,"position")||"top-right"),Y=bQ($,"max",5),Q=B6[X]||B6["top-right"];return`<div id="stx-toast-container" data-stx-toast-position="${X}" data-stx-toast-max="${Y}" style="position:fixed;${Q};z-index:999999;display:flex;flex-direction:column;gap:0.5rem;pointer-events:none;max-width:24rem;width:100%"></div>
3523
3521
  <style>
3524
3522
  @keyframes stx-toast-in{from{opacity:0;transform:translateX(100%)}to{opacity:1;transform:translateX(0)}}
3525
3523
  @keyframes stx-toast-out{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(100%)}}
@@ -3545,14 +3543,14 @@ ${v}
3545
3543
  @media(prefers-color-scheme:dark){[data-stx-drawer]{--stx-drawer-bg:#1f2937;--stx-drawer-text:#f3f4f6}}
3546
3544
  .stx-drawer-backdrop[data-stx-drawer-open]{display:block!important;opacity:1}
3547
3545
  .stx-drawer-backdrop[data-stx-drawer-open] .stx-drawer-panel{transform:translateX(0)}
3548
- </style>`}};import{existsSync as EQ,readFileSync as bQ}from"fs";var I1=new Map,O6=new Set;function F6($){if(O6.has($))return;O6.add($),console.warn(`[stx] icon collection "${$}" is not installed, so its icons render as nothing. Install it with \`bun add -d @iconify-json/${$}\`.`)}function w6($){let Z=process.cwd();for(let J of[`${Z}/node_modules/@iconify-json/${$}/icons.json`,`${Z}/pantry/@iconify-json/${$}/icons.json`,`${Z}/node_modules/@iconify/json/json/${$}.json`,`${Z}/pantry/@iconify/json/json/${$}.json`])if(EQ(J))return J;for(let J of[`@iconify-json/${$}/icons.json`,`@iconify/json/json/${$}.json`])try{return u.resolve(J)}catch{}return null}function yQ($){if(I1.has($))return I1.get($);let Z=w6($);if(!Z)return F6($),null;try{let J=JSON.parse(bQ(Z,"utf8"));return I1.set($,J.icons),J.icons}catch{return null}}async function CQ($,Z=!1){if(I1.has($))return I1.get($);let J=w6($);if(!J){if(!Z)F6($);return null}try{let X=await Bun.file(J).json();return I1.set($,X.icons),X.icons}catch{return null}}function e1($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);if($.static[Z]!==void 0)return String($.static[Z]);if($.clientReactive[Z]!==void 0)return $.clientReactive[Z];return}var R$={name:"Icon",aliases:["icon","stx-icon"],render($,Z,J){let X=e1($,"name")??e1($,"icon");if(!X)return"<!-- Icon: missing name/icon prop -->";let Y="lucide",Q=X;if(X.includes(":")){let _=X.split(":");Y=_[0],Q=_[1]}let G=R0(e1($,"size")||"24"),z=R0(e1($,"color")||"currentColor"),q=R0(e1($,"class")||""),K=R0(e1($,"style")||""),U=I1.get(Y)??yQ(Y);if(!U)return`<!-- Icon: collection "${Y}" not loaded -->`;let W=U[Q];if(!W)return`<!-- Icon: "${Q}" not found in ${Y} -->`;let H=W.width||24,j=W.height||24,B=`0 0 ${H} ${j}`,V=W.body;if(z!=="currentColor")V=V.replace(/currentColor/g,z);let F=q?` class="${q}"`:"",O=K?` style="${K}"`:"";return`<svg xmlns="http://www.w3.org/2000/svg" width="${G}" height="${G}" viewBox="${B}" fill="none"${F}${O}>${V}</svg>`}};async function SQ($="lucide",Z={}){await CQ($,Z.speculative??!0)}function R6($,...Z){for(let J of Z){if($.serverDynamic[J]!==void 0)return String($.serverDynamic[J]);let X=$.static[J];if(typeof X==="string")return X}return}function D6($,Z){let J=new RegExp(`<(template|div|span)[^>]*\\bslot=["']${Z}["'][^>]*>([\\s\\S]*?)<\\/\\1>`,"i"),X=$.match(J);if(!X)return{region:null,rest:$};return{region:X[2],rest:$.replace(X[0],"")}}var D$={name:"Suspense",aliases:["suspense"],render($,Z,J){let X=D6(Z,"fallback"),Y=X.rest,Q=D6(Y,"error"),G=Q.rest,z=X.region??R6($,"fallback")??'<div class="stx-suspense-loading">Loading\u2026</div>',q=Q.region??R6($,"errorFallback","error-fallback")??'<div class="stx-suspense-error">Something went wrong.</div>';return`<div data-stx-suspense><div data-stx-suspense-fallback>${z}</div><div data-stx-suspense-error hidden>${q}</div><div data-stx-suspense-content hidden>${G}</div></div>`}};function N9($,...Z){for(let J of Z){if($.serverDynamic[J]!==void 0)return String($.serverDynamic[J]);let X=$.static[J];if(typeof X==="string")return X}return}var N$={name:"TransitionGroup",aliases:["transition-group"],render($,Z,J){let X=(N9($,"name")||"v").replace(/["'<>]/g,""),Y=(N9($,"tag")||"div").replace(/[^a-z0-9-]/gi,"")||"div",Q=N9($,"class"),G=N9($,"id"),z=[`data-stx-transition-group="${X}"`,Q?`class="${Q}"`:"",G?`id="${G}"`:""].filter(Boolean).join(" ");return`<${Y} ${z}>${Z}</${Y}>`}};function N6($=i1){$.registerBuiltin(K$),$.registerBuiltin(B$),$.registerBuiltin(V$),$.registerBuiltin(_$),$.registerBuiltin(O$),$.registerBuiltin(F$),$.registerBuiltin(w$),$.registerBuiltin(R$),$.registerBuiltin(D$),$.registerBuiltin(N$)}function M9($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var M6=new Map;function PQ($){let Z=M6.get($.source);if(!Z)Z=new RegExp(`(${$.source})(?![\\w.:-])`,"y"),M6.set($.source,Z);return Z}var A6=new WeakMap;function k6($){let Z=A6.get($);if(!Z)Z=new Set([...$].map((X)=>X.toLowerCase())),A6.set($,Z);let J=Z;return(X)=>!/[a-z]/.test(X)&&J.has(X.toLowerCase())}function I6($,Z,J){let X=[],Y=0,Q=typeof J==="function"?J:J?(G)=>J.has(G.toLowerCase()):void 0;while(Y<$.length){let G=$.indexOf("<",Y);if(G===-1)break;let z=PQ(Z);z.lastIndex=G+1;let q=z.exec($);if(!q){Y=G+1;continue}let K=q[1];if(Q&&Q(K)){let F=G+1+K.length;while(F<$.length&&$[F]!==">")F++;Y=F+1;continue}let U=G+1+K.length,W=null,H=U,j=-1,B=!1;while(U<$.length){let F=$[U];if(W){if(F==="\\"&&U+1<$.length){U+=2;continue}if(F===W)W=null;U++;continue}if(F==='"'||F==="'"){W=F,U++;continue}if(F==="/"&&U+1<$.length&&$[U+1]===">"){j=U+2,B=!0;break}if(F===">"){j=U+1;break}U++}if(j===-1){Y=G+1;continue}let V=$.slice(H,B?j-2:j-1).trim();if(B)X.push({fullMatch:$.slice(G,j),tagName:K,attributes:V,content:"",startIndex:G,endIndex:j,isSelfClosing:!0}),Y=j;else{let F=`<${K}`,O=`</${K}>`,_=1,L=j,w=-1;while(_>0&&L<$.length){let M=$.indexOf(F,L),I=$.indexOf(O,L);if(I===-1)break;if(M!==-1&&M<I){let N=$[M+F.length];if(N===" "||N===">"||N==="/"||N===`
3549
- `||N==="\t")_++;L=M+F.length}else{if(_--,_===0){w=I;break}L=I+O.length}}if(w===-1){Y=j;continue}let R=$.slice(j,w),D=w+O.length;X.push({fullMatch:$.slice(G,D),tagName:K,attributes:V,content:R,startIndex:G,endIndex:D,isSelfClosing:!1}),Y=D}}return X}function T6($){return $.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#0?39;/g,"'").replace(/&#x27;/gi,"'").replace(/&amp;/g,"&")}function E6($,Z){try{let J=Buffer.from($,"base64").toString("utf8");return JSON.parse(J)}catch{}try{let J=$.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&");return JSON.parse(J)}catch(J){if(Z?.debug)console.error("Error decoding __stx_ prop:",J);return $}}function M$($,Z){let J=0,X="",Y=Z;while(Y<$.length){let Q=$[Y];if(X){if(Q==="\\")Y++;else if(Q===X)X=""}else if(Q==='"'||Q==="'"||Q==="`")X=Q;else if(Q==="{")J++;else if(Q==="}"){if(J--,J===0)return $.slice(Z,Y+1)}Y++}return $.slice(Z)}function b6($){let Z=$.trim();if(!Z.startsWith("{")||!Z.endsWith("}"))return null;if(M$(Z,0).length!==Z.length)return null;return Z.slice(1,-1).trim()}import k9 from"fs";import f0 from"path";var y6=!1,C6=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","component","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","path","circle","rect","line","polygon","polyline","ellipse","text","tspan","textPath","g","defs","use","symbol","image","clipPath","mask","pattern","marker","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","foreignObject","animate","animateMotion","animateTransform","set","mpath","desc","metadata","switch","view"]);function vQ($,Z,J,X=!1){let Y={static:{},staticNames:{},serverDynamic:{},serverDynamicNames:{},clientReactive:{},events:{}},Q=new Set(Array.isArray(Z.__stx_client_signal_names)?Z.__stx_client_signal_names:[]),G=(U)=>{if(Q.size===0)return!1;let W=x0(U),H=W.match(/^\s*[!+~(-]*\s*([a-zA-Z_$][\w$]*)/)?.[1];if(H&&Q.has(H))return!0;for(let j of Q){let B=j.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`(?:^|[^\\w$.])${B}\\s*\\(`).test(W))return!0}return!1},z=new Set(f6),q=(U)=>{if(!U.includes("-")||U.startsWith("@")||U.startsWith(":")||U.startsWith("x-")||U.startsWith("__"))return U;if(U.startsWith("aria-")||U.startsWith("data-"))return U;return U.replace(/-([a-z0-9])/g,(W,H)=>H.toUpperCase())},K=(U,W)=>{let H=q(U);if(Y.static[H]=W,H!==U)Y.staticNames[H]=U};for(let[U,W]of Object.entries($)){let H=U.startsWith("x-")&&!z.has(U)&&!U.startsWith("x-bind:")&&!U.startsWith("x-on:")?`:${U.slice(2)}`:U;if(H.startsWith("@")){Y.events[H]=W;continue}if(H.startsWith("__stx_")){let j=q(H.slice(6));Y.serverDynamic[j]=E6(W,J);continue}if(H.startsWith(":")){let j=q(H.slice(1)),B=W===k1?j:W;if(j==="if"||j==="for"||j==="show"){Y.clientReactive[j]=B;continue}if(X){Y.clientReactive[j]=B;continue}if(G(B)){Y.clientReactive[j]=B;continue}try{if(!q0(B)){if(J.debug)console.error(`Unsafe expression in :${j} binding: ${B}`);Y.clientReactive[j]=B;continue}let V=Object.keys(Z),O=U0(B,V)(...Object.values(Z));if(O===void 0){let _=new Set(["true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","if","else"]);if(U9(B).some((w)=>!_.has(w)&&!V.includes(w))){Y.clientReactive[j]=B;continue}}if(Y.serverDynamic[j]=O,j!==H.slice(1)&&Y.serverDynamicNames)Y.serverDynamicNames[j]=H.slice(1)}catch{Y.clientReactive[j]=B}continue}if(typeof W==="string"&&W.includes("{{")&&W.includes("}}")){let j=W.match(/^\{\{\s*([\s\S]+?)\s*\}\}$/);if(j)try{let B=j[1];if(q0(B)){let F=U0(B,Object.keys(Z))(...Object.values(Z));K(H,F!=null?String(F):"")}else{if(J.debug)console.error(`Unsafe expression in ${H}: ${B}`);K(H,W)}}catch(B){if(J.debug)console.error(`Error evaluating expression for ${H}:`,B);K(H,W)}else{let B=W,V=/\{\{\s*([\s\S]+?)\s*\}\}/g,F;while((F=V.exec(W))!==null)try{let O=F[1];if(!q0(O)){if(J.debug)console.error(`Unsafe expression in ${H}: ${O}`);continue}let L=U0(O,Object.keys(Z))(...Object.values(Z));B=B.replace(F[0],String(L??""))}catch(O){if(J.debug)console.error(`Error evaluating expression in ${H}:`,O)}K(H,B)}continue}K(H,W===k1?"true":T6(W))}return Y}var fQ=[[/@if\s*\(/,"@endif"],[/@unless\s*\(/,"@endunless"]];function xQ($,Z,J){if(!$.includes("@"))return $;if(!fQ.some(([Y,Q])=>Y.test($)&&$.includes(Q)))return $;try{return Z1($,Z,J)}catch{return $}}function gQ($){let Z={},J=0,X=$.length;while(J<X){while(J<X&&/\s/.test($[J]))J++;if(J>=X)break;let Y="";while(J<X&&!/[\s=]/.test($[J]))Y+=$[J],J++;if(!Y)break;while(J<X&&/\s/.test($[J]))J++;if(J<X&&$[J]==="="){J++;while(J<X&&/\s/.test($[J]))J++;let Q="";if(J<X&&($[J]==='"'||$[J]==="'")){let G=$[J];J++;while(J<X){let z=$[J];if(z==="\\"&&J+1<X){J++,Q+=$[J],J++;continue}if(z===G){J++;break}Q+=z,J++}}else if($[J]==="{"){Q=M$($,J),J+=Q.length;let G=b6(Q);if(G!==null){Z[`:${Y}`]=G;continue}}else while(J<X&&!/\s/.test($[J]))Q+=$[J],J++;Z[Y]=Q}else Z[Y]=k1}return Z}function S6($){return Object.entries($).map(([Z,J])=>J===k1?Z:`${Z}="${hQ(J)}"`).join(" ")}function hQ($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function uQ($){let Z=new Set,J=/<([A-Z][A-Za-z0-9]*|stx-[a-z0-9-]+)\b[^>]*>/g,X;while((X=J.exec($))!==null){let Y=X[1];if(i1.isBuiltin(Y))Z.add(Y)}return[...Z].sort()}var P6=new Map;function dQ($){let Z=P6.get($);if(Z)return Z;let J=new Map,X=[f0.join($,"src"),f0.join($,"dist"),$];function Y(Q,G){if(G>6)return;let z;try{z=k9.readdirSync(Q,{withFileTypes:!0})}catch{return}for(let q of z){let K=f0.join(Q,q.name);if(q.isDirectory()){if(q.name==="node_modules"||q.name.startsWith("."))continue;Y(K,G+1)}else if(q.isFile()&&q.name.endsWith(".stx")){let U=q.name.slice(0,-4);if(!J.has(U))J.set(U,K);let W=U.toLowerCase();if(!J.has(W))J.set(W,K);let H=U.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();if(!J.has(H))J.set(H,K)}}}for(let Q of X)if(Y(Q,0),J.size>0)break;return P6.set($,J),J}function mQ($,Z){if($.startsWith(".")||$.startsWith("/"))return null;let J=Z;while(!0){let X=f0.join(J,"node_modules",$);try{if(k9.statSync(X).isDirectory())return X}catch{}let Y=f0.dirname(J);if(Y===J)return null;J=Y}}async function lQ($,Z,J,X,Y){if(!/import\s/.test($))return $;if(!Z.__importedComponents)Z.__importedComponents=new Map;let Q=Z.__importedComponents,G=f0.dirname(J),z=[],q=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi;for(let W of $.matchAll(q)){let[H,j,B]=W,V=/import\s+(?:(\{[^}]*\})|([A-Za-z_$][\w$]*))\s+from\s+['"]([^'"]+)['"]\s*;?\s*\n?/g,F=B,O,_=[];while((O=V.exec(B))!==null){let[L,w,R,D]=O,M=null,I=null;if(D.startsWith(".")||D.startsWith("/")){let T=f0.resolve(G,D);if(T.endsWith(".stx"))I=T;else{let k=`${T}.stx`;try{if(k9.statSync(k).isFile())I=k}catch{try{if(k9.statSync(T).isDirectory())M=T}catch{}}}}else M=mQ(D,G);if(!M&&!I)continue;let N=!1,A=(T,k)=>{Q.set(T,k),Q.set(T.toLowerCase(),k);let y=T.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();Q.set(y,k),Y.add(k)};if(R&&I)A(R,I),N=!0;else if(w){let T=w.slice(1,-1).split(",").map((y)=>y.trim()).filter(Boolean).map((y)=>{let E=y.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(E)return{source:E[1],local:E[2]};return{source:y,local:y}}),k=M?dQ(M):null;for(let{source:y,local:E}of T){let b=null;if(I)b=I;else if(k)b=k.get(y)??k.get(y.toLowerCase())??k.get(y.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase())??null;if(b)A(E,b),N=!0}}if(N)_.push({start:O.index,end:O.index+L.length})}if(_.length===0)continue;for(let L=_.length-1;L>=0;L--)F=F.slice(0,_[L].start)+F.slice(_[L].end);z.push({start:W.index,end:W.index+H.length,value:`<script${j}>${F}</script>`})}if(z.length===0)return $;let K=[],U=0;for(let W of z)K.push($.slice(U,W.start),W.value),U=W.end;return K.push($.slice(U)),K.join("")}async function cQ($,Z,J,X,Y){let Q=$;if(!Z.__importedComponents)Z.__importedComponents=new Map;let G=Z.__importedComponents,z=/@import\s*\(\s*([^)]+)\s*\)/g,q;while((q=z.exec(Q))!==null){let[K,U]=q,W=U.split(",").map((H)=>H.trim().replace(/^['"]|['"]$/g,"")).filter((H)=>H.length>0);for(let H of W){let j=H.split("/"),V=j[j.length-1].replace(/\.stx$/,""),F=V.includes("-")?V.split("-").map((L)=>L.charAt(0).toUpperCase()+L.slice(1)).join(""):V.charAt(0).toUpperCase()+V.slice(1),O=null,_=[f0.resolve(f0.dirname(J),`${H}.stx`),f0.resolve(f0.dirname(J),H),f0.resolve(X.componentsDir||"components",`${H}.stx`),f0.resolve(X.componentsDir||"components",H),H.endsWith(".stx")?H:`${H}.stx`];for(let L of _)try{if(await Bun.file(L).exists()){O=L;break}}catch{}if(O){G.set(F,O),G.set(V,O),G.set(V.toLowerCase(),O);let L=F.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();if(G.set(L,O),Y.add(O),X.debug)console.log(`Imported component: ${F} -> ${O}`)}else if(X.debug)console.warn(`Could not resolve imported component: ${H}`)}Q=Q.replace(K,""),z.lastIndex=0}return Q}async function pQ($,Z,J,X,Y){let Q=$,G=X.componentsDir||"components";if(!Z.__processedComponents)Z.__processedComponents=new Set;let z=Z.__processedComponents,q=/@component\s*\(/g,K;while((K=q.exec(Q))!==null){let U=K.index,W=U+K[0].length-1,H=1,j=W+1;while(j<Q.length&&H>0){if(Q[j]==="(")H++;else if(Q[j]===")"){if(H--,H===0)break}j++}if(H!==0)break;let B=Q.substring(W+1,j),V=j+1,F=B.match(/^\s*['"]([^'"]+)['"]/);if(!F){q.lastIndex=0;continue}let O=F[1],_,L=B.slice(F[0].length),w=L.match(/^\s*,\s*/);if(w)_=L.slice(w[0].length).trim();let R={};if(_)try{R=T0(_,Z)}catch(T){let k=T instanceof Error?T.message:String(T);Q=Q.replace(Q.substring(U,V),`[Error parsing component props: ${k}]`);continue}let D="",M=V,N=Q.substring(V).match(/^([\s\S]*?)@endcomponent/);if(N)D=N[1].trim(),M=V+N[0].length;let A=await A1(O,R,D,G,Z,J,X,z,Y);Q=Q.substring(0,U)+A+Q.substring(M),q.lastIndex=0}return Q}async function iQ($,Z,J,X,Y){if(!$)return $;let Q=$,G=X.componentsDir||"components";if(!Z.__processedComponents)Z.__processedComponents=new Set;let z=Z.__processedComponents,q=i0(Q);Q=q.output;let K=g5(Q);return Q=await j(Q,/[a-z][a-z0-9]*-[a-z0-9-]*/,!1),Q=await j(Q,/[A-Z][a-zA-Z0-9]*/,!0,k6(C6)),Q=await j(Q,/[a-z][a-z0-9]*/,!1,C6),Q=q.restore(Q),Q;async function j(B,V,F,O){if(!B)return B;let _=B,L=I6(_,V,O),w=new Map;for(let M=L.length-1;M>=0;M--){let I=L[M],N=F?M9(I.tagName):I.tagName,A=gQ(xQ(I.attributes,Z,J)),T=K.some(([P,g])=>I.startIndex>=P&&I.startIndex<g),k=vQ(A,Z,X,T),y=i1.getBuiltin(I.tagName),E=y?await A9(N,G,Z,J,X):!1;if(y&&!E){let P={context:Z,filePath:J,options:X,dependencies:Y},g=y.render(k,I.content,P);if(Object.keys(k.events).length>0){let x=S6(k.events);g=g.replace(/^(\s*<[a-zA-Z][a-zA-Z0-9-]*)/,`$1 ${x}`)}if(Object.keys(k.clientReactive).length>0)g=v6(g,k.clientReactive);w.set(M,g);continue}if(!F&&I.tagName.includes("-")&&!await A9(N,G,Z,J,X))continue;let b={};for(let[P,g]of Object.entries(k.static))b[P]=g;for(let[P,g]of Object.entries(k.serverDynamic))b[P]=g;let v=await A1(N,b,q.restore(I.content),G,Z,J,X,z,Y);if(Object.keys(k.events).length>0){let P=x6(v);if(P){let g=S6(k.events),x=Object.keys(k.events).map(($0)=>$0.replace(/^@/,"").split(".")[0]).join(" ");v=v.substring(0,P.insertPos)+` data-stx-parent-events="${x}" ${g}`+v.substring(P.insertPos)}}if(Object.keys(k.clientReactive).length>0)v=v6(v,k.clientReactive);w.set(M,v)}if(w.size===0)return _;let R="",D=0;for(let M=0;M<L.length;M++){let I=w.get(M);if(I===void 0)continue;R+=_.slice(D,L[M].startIndex),R+=I,D=L[M].endIndex}return R+=_.slice(D),R}}function v6($,Z){let J=new Set(["if","for"]),X=new Set(["show"]),Y=Object.entries(Z).filter(([U])=>!J.has(U)),Q=Y.filter(([U])=>!X.has(U)).map(([U])=>M9(U)).join(" "),G=$,z=Y.length>0?x6(G):null;if(z){let U=Y.map(([H,j])=>`:${M9(H)}="${j.replace(/"/g,"&quot;")}"`).join(" "),W=Q?` data-stx-parent-bindings="${Q}"`:"";G=G.substring(0,z.insertPos)+`${W} ${U}`+G.substring(z.insertPos)}let q=Z.if;if(q)G=`<template :if="${q.replace(/"/g,"&quot;")}">${G}</template>`;let K=Z.for;if(K)G=`<template :for="${K.replace(/"/g,"&quot;")}">${G}</template>`;return G}function x6($){let Z=/<([a-zA-Z][a-zA-Z0-9-]*)\b[^>]*\bdata-stx-scope(?:\s|=|>)/i.exec($);if(Z)return{insertPos:Z.index+1+Z[1].length};let J=0;while(J<$.length){let X=$.slice(J),Y=X.match(/^\s+/);if(Y){J+=Y[0].length;continue}if(X.startsWith("<!--")){let z=$.indexOf("-->",J+4);if(z===-1)return null;J=z+3;continue}let Q=X.match(/^<(script|style)\b[^>]*>/i);if(Q){let z=`</${Q[1].toLowerCase()}>`,q=$.toLowerCase().indexOf(z,J+Q[0].length);if(q===-1)return null;J=q+z.length;continue}let G=X.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(?:\s|>|\/)/);if(!G)return null;return{insertPos:J+1+G[1].length}}return null}async function A$($,Z,J,X,Y){if(!y6)N6(i1),y6=!0;let Q=await lQ($,Z,J,X,Y);Q=await cQ(Q,Z,J,X,Y),Q=await pQ(Q,Z,J,X,Y);let G=[];for(let z=0;z<3;z++){let q=G.length,K=p0(Q,Y2,(W,H)=>`\x00STX_COMPONENT_COMMENT_${q+H}\x00`,`STX_COMPONENT_COMMENT:${q}`);G.push(...K.tokens);let U=Q;if(Q=await iQ(K.output,Z,J,X,Y),Q===U)break}if(G.length>0)Q=Q.replace(/\x00STX_COMPONENT_COMMENT_(\d+)\x00/g,(z,q)=>G[Number(q)]??"");if(X.debug){let z=uQ(Q);if(z.length>0)console.warn(`[stx] ${J}: unresolved component tag(s) after render passes: ${z.join(", ")}. Check nested component output for malformed root tags or recursive component markup.`)}return Q}import Z2 from"path";import g6 from"process";function $2($="STX_PUBLIC_"){let Z={},J={};for(let[X,Y]of Object.entries(g6.env)){if(!X.startsWith($)||Y===void 0)continue;Z[`import.meta.env.${X}`]=JSON.stringify(Y),J[X]=Y}return Z["import.meta.env"]=JSON.stringify(J),Z}function YB($="STX_PUBLIC_"){let Z={};for(let[J,X]of Object.entries(g6.env))if(J.startsWith($)&&X!==void 0)Z[J]=X;return Z}function h6($){return $.startsWith("http://")||$.startsWith("https://")||$.startsWith("//")}async function u6($,Z,J){try{let X;if($.startsWith("/")){let Y=Z;for(let Q=0;Q<5;Q++){let G=Z2.join(Y,$);if(await Bun.file(G).exists())return G;Y=Z2.dirname(Y)}X=Z2.join(Z,$)}else if($.startsWith("./")||$.startsWith("../"))X=Z2.resolve(Z,$);else X=Z2.resolve(Z,$);if(await Bun.file(X).exists())return X;return null}catch{return null}}async function d6($,Z,J){let X=$,Y=Z2.dirname(Z),Q=/<script\b([^>]*)src=["']([^"']+)["']([^>]*)><\/script>/gi,G;while((G=Q.exec(X))!==null){let[K,U,W,H]=G;if(h6(W))continue;let j=await u6(W,Y,Z);if(j)try{let B=await Bun.file(j).text();if(J.add(j),W.endsWith(".ts")||W.endsWith(".tsx")){let F=await Bun.build({entrypoints:[j],target:"browser",minify:!0,define:$2()});if(F.outputs.length>0)B=await F.outputs[0].text()}let V=`<script>
3546
+ </style>`}};import{existsSync as yQ,readFileSync as CQ}from"fs";var I1=new Map,O6=new Set;function F6($){if(O6.has($))return;O6.add($),console.warn(`[stx] icon collection "${$}" is not installed, so its icons render as nothing. Install it with \`bun add -d @iconify-json/${$}\`.`)}function w6($){let Z=process.cwd();for(let J of[`${Z}/node_modules/@iconify-json/${$}/icons.json`,`${Z}/pantry/@iconify-json/${$}/icons.json`,`${Z}/node_modules/@iconify/json/json/${$}.json`,`${Z}/pantry/@iconify/json/json/${$}.json`])if(yQ(J))return J;for(let J of[`@iconify-json/${$}/icons.json`,`@iconify/json/json/${$}.json`])try{return u.resolve(J)}catch{}return null}function SQ($){if(I1.has($))return I1.get($);let Z=w6($);if(!Z)return F6($),null;try{let J=JSON.parse(CQ(Z,"utf8"));return I1.set($,J.icons),J.icons}catch{return null}}async function PQ($,Z=!1){if(I1.has($))return I1.get($);let J=w6($);if(!J){if(!Z)F6($);return null}try{let X=await Bun.file(J).json();return I1.set($,X.icons),X.icons}catch{return null}}function e1($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);if($.static[Z]!==void 0)return String($.static[Z]);if($.clientReactive[Z]!==void 0)return $.clientReactive[Z];return}var R$={name:"Icon",aliases:["icon","stx-icon"],render($,Z,J){let X=e1($,"name")??e1($,"icon");if(!X)return"<!-- Icon: missing name/icon prop -->";let Y="lucide",Q=X;if(X.includes(":")){let _=X.split(":");Y=_[0],Q=_[1]}let G=R0(e1($,"size")||"24"),z=R0(e1($,"color")||"currentColor"),q=R0(e1($,"class")||""),K=R0(e1($,"style")||""),U=I1.get(Y)??SQ(Y);if(!U)return`<!-- Icon: collection "${Y}" not loaded -->`;let W=U[Q];if(!W)return`<!-- Icon: "${Q}" not found in ${Y} -->`;let H=W.width||24,j=W.height||24,B=`0 0 ${H} ${j}`,V=W.body;if(z!=="currentColor")V=V.replace(/currentColor/g,z);let F=q?` class="${q}"`:"",O=K?` style="${K}"`:"";return`<svg xmlns="http://www.w3.org/2000/svg" width="${G}" height="${G}" viewBox="${B}" fill="none"${F}${O}>${V}</svg>`}};async function vQ($="lucide",Z={}){await PQ($,Z.speculative??!0)}function R6($,...Z){for(let J of Z){if($.serverDynamic[J]!==void 0)return String($.serverDynamic[J]);let X=$.static[J];if(typeof X==="string")return X}return}function D6($,Z){let J=new RegExp(`<(template|div|span)[^>]*\\bslot=["']${Z}["'][^>]*>([\\s\\S]*?)<\\/\\1>`,"i"),X=$.match(J);if(!X)return{region:null,rest:$};return{region:X[2],rest:$.replace(X[0],"")}}var D$={name:"Suspense",aliases:["suspense"],render($,Z,J){let X=D6(Z,"fallback"),Y=X.rest,Q=D6(Y,"error"),G=Q.rest,z=X.region??R6($,"fallback")??'<div class="stx-suspense-loading">Loading\u2026</div>',q=Q.region??R6($,"errorFallback","error-fallback")??'<div class="stx-suspense-error">Something went wrong.</div>';return`<div data-stx-suspense><div data-stx-suspense-fallback>${z}</div><div data-stx-suspense-error hidden>${q}</div><div data-stx-suspense-content hidden>${G}</div></div>`}};function N9($,...Z){for(let J of Z){if($.serverDynamic[J]!==void 0)return String($.serverDynamic[J]);let X=$.static[J];if(typeof X==="string")return X}return}var N$={name:"TransitionGroup",aliases:["transition-group"],render($,Z,J){let X=(N9($,"name")||"v").replace(/["'<>]/g,""),Y=(N9($,"tag")||"div").replace(/[^a-z0-9-]/gi,"")||"div",Q=N9($,"class"),G=N9($,"id"),z=[`data-stx-transition-group="${X}"`,Q?`class="${Q}"`:"",G?`id="${G}"`:""].filter(Boolean).join(" ");return`<${Y} ${z}>${Z}</${Y}>`}};function N6($=i1){$.registerBuiltin(K$),$.registerBuiltin(B$),$.registerBuiltin(V$),$.registerBuiltin(_$),$.registerBuiltin(O$),$.registerBuiltin(F$),$.registerBuiltin(w$),$.registerBuiltin(R$),$.registerBuiltin(D$),$.registerBuiltin(N$)}function M9($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var M6=new Map;function fQ($){let Z=M6.get($.source);if(!Z)Z=new RegExp(`(${$.source})(?![\\w.:-])`,"y"),M6.set($.source,Z);return Z}var A6=new WeakMap;function k6($){let Z=A6.get($);if(!Z)Z=new Set([...$].map((X)=>X.toLowerCase())),A6.set($,Z);let J=Z;return(X)=>!/[a-z]/.test(X)&&J.has(X.toLowerCase())}function I6($,Z,J){let X=[],Y=0,Q=typeof J==="function"?J:J?(G)=>J.has(G.toLowerCase()):void 0;while(Y<$.length){let G=$.indexOf("<",Y);if(G===-1)break;let z=fQ(Z);z.lastIndex=G+1;let q=z.exec($);if(!q){Y=G+1;continue}let K=q[1];if(Q&&Q(K)){let F=G+1+K.length;while(F<$.length&&$[F]!==">")F++;Y=F+1;continue}let U=G+1+K.length,W=null,H=U,j=-1,B=!1;while(U<$.length){let F=$[U];if(W){if(F==="\\"&&U+1<$.length){U+=2;continue}if(F===W)W=null;U++;continue}if(F==='"'||F==="'"){W=F,U++;continue}if(F==="/"&&U+1<$.length&&$[U+1]===">"){j=U+2,B=!0;break}if(F===">"){j=U+1;break}U++}if(j===-1){Y=G+1;continue}let V=$.slice(H,B?j-2:j-1).trim();if(B)X.push({fullMatch:$.slice(G,j),tagName:K,attributes:V,content:"",startIndex:G,endIndex:j,isSelfClosing:!0}),Y=j;else{let F=`<${K}`,O=`</${K}>`,_=1,L=j,w=-1;while(_>0&&L<$.length){let M=$.indexOf(F,L),I=$.indexOf(O,L);if(I===-1)break;if(M!==-1&&M<I){let N=$[M+F.length];if(N===" "||N===">"||N==="/"||N===`
3547
+ `||N==="\t")_++;L=M+F.length}else{if(_--,_===0){w=I;break}L=I+O.length}}if(w===-1){Y=j;continue}let R=$.slice(j,w),D=w+O.length;X.push({fullMatch:$.slice(G,D),tagName:K,attributes:V,content:R,startIndex:G,endIndex:D,isSelfClosing:!1}),Y=D}}return X}function T6($){return $.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#0?39;/g,"'").replace(/&#x27;/gi,"'").replace(/&amp;/g,"&")}function E6($,Z){try{let J=Buffer.from($,"base64").toString("utf8");return JSON.parse(J)}catch{}try{let J=$.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&");return JSON.parse(J)}catch(J){if(Z?.debug)console.error("Error decoding __stx_ prop:",J);return $}}function M$($,Z){let J=0,X="",Y=Z;while(Y<$.length){let Q=$[Y];if(X){if(Q==="\\")Y++;else if(Q===X)X=""}else if(Q==='"'||Q==="'"||Q==="`")X=Q;else if(Q==="{")J++;else if(Q==="}"){if(J--,J===0)return $.slice(Z,Y+1)}Y++}return $.slice(Z)}function b6($){let Z=$.trim();if(!Z.startsWith("{")||!Z.endsWith("}"))return null;if(M$(Z,0).length!==Z.length)return null;return Z.slice(1,-1).trim()}import k9 from"fs";import f0 from"path";var y6=!1,C6=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","component","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","path","circle","rect","line","polygon","polyline","ellipse","text","tspan","textPath","g","defs","use","symbol","image","clipPath","mask","pattern","marker","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","foreignObject","animate","animateMotion","animateTransform","set","mpath","desc","metadata","switch","view"]);function xQ($,Z,J,X=!1){let Y={static:{},staticNames:{},serverDynamic:{},serverDynamicNames:{},clientReactive:{},events:{}},Q=new Set(Array.isArray(Z.__stx_client_signal_names)?Z.__stx_client_signal_names:[]),G=(U)=>{if(Q.size===0)return!1;let W=x0(U),H=W.match(/^\s*[!+~(-]*\s*([a-zA-Z_$][\w$]*)/)?.[1];if(H&&Q.has(H))return!0;for(let j of Q){let B=j.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`(?:^|[^\\w$.])${B}\\s*\\(`).test(W))return!0}return!1},z=new Set(f6),q=(U)=>{if(!U.includes("-")||U.startsWith("@")||U.startsWith(":")||U.startsWith("x-")||U.startsWith("__"))return U;if(U.startsWith("aria-")||U.startsWith("data-"))return U;return U.replace(/-([a-z0-9])/g,(W,H)=>H.toUpperCase())},K=(U,W)=>{let H=q(U);if(Y.static[H]=W,H!==U)Y.staticNames[H]=U};for(let[U,W]of Object.entries($)){let H=U.startsWith("x-")&&!z.has(U)&&!U.startsWith("x-bind:")&&!U.startsWith("x-on:")?`:${U.slice(2)}`:U;if(H.startsWith("@")){Y.events[H]=W;continue}if(H.startsWith("__stx_")){let j=q(H.slice(6));Y.serverDynamic[j]=E6(W,J);continue}if(H.startsWith(":")){let j=q(H.slice(1)),B=W===k1?j:W;if(j==="if"||j==="for"||j==="show"){Y.clientReactive[j]=B;continue}if(X){Y.clientReactive[j]=B;continue}if(G(B)){Y.clientReactive[j]=B;continue}try{if(!q0(B)){if(J.debug)console.error(`Unsafe expression in :${j} binding: ${B}`);Y.clientReactive[j]=B;continue}let V=Object.keys(Z),O=U0(B,V)(...Object.values(Z));if(O===void 0){let _=new Set(["true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","if","else"]);if(U9(B).some((w)=>!_.has(w)&&!V.includes(w))){Y.clientReactive[j]=B;continue}}if(Y.serverDynamic[j]=O,j!==H.slice(1)&&Y.serverDynamicNames)Y.serverDynamicNames[j]=H.slice(1)}catch{Y.clientReactive[j]=B}continue}if(typeof W==="string"&&W.includes("{{")&&W.includes("}}")){let j=W.match(/^\{\{\s*([\s\S]+?)\s*\}\}$/);if(j)try{let B=j[1];if(q0(B)){let F=U0(B,Object.keys(Z))(...Object.values(Z));K(H,F!=null?String(F):"")}else{if(J.debug)console.error(`Unsafe expression in ${H}: ${B}`);K(H,W)}}catch(B){if(J.debug)console.error(`Error evaluating expression for ${H}:`,B);K(H,W)}else{let B=W,V=/\{\{\s*([\s\S]+?)\s*\}\}/g,F;while((F=V.exec(W))!==null)try{let O=F[1];if(!q0(O)){if(J.debug)console.error(`Unsafe expression in ${H}: ${O}`);continue}let L=U0(O,Object.keys(Z))(...Object.values(Z));B=B.replace(F[0],String(L??""))}catch(O){if(J.debug)console.error(`Error evaluating expression in ${H}:`,O)}K(H,B)}continue}K(H,W===k1?"true":T6(W))}return Y}var gQ=[[/@if\s*\(/,"@endif"],[/@unless\s*\(/,"@endunless"]];function hQ($,Z,J){if(!$.includes("@"))return $;if(!gQ.some(([Y,Q])=>Y.test($)&&$.includes(Q)))return $;try{return $1($,Z,J)}catch{return $}}function uQ($){let Z={},J=0,X=$.length;while(J<X){while(J<X&&/\s/.test($[J]))J++;if(J>=X)break;let Y="";while(J<X&&!/[\s=]/.test($[J]))Y+=$[J],J++;if(!Y)break;while(J<X&&/\s/.test($[J]))J++;if(J<X&&$[J]==="="){J++;while(J<X&&/\s/.test($[J]))J++;let Q="";if(J<X&&($[J]==='"'||$[J]==="'")){let G=$[J];J++;while(J<X){let z=$[J];if(z==="\\"&&J+1<X){J++,Q+=$[J],J++;continue}if(z===G){J++;break}Q+=z,J++}}else if($[J]==="{"){Q=M$($,J),J+=Q.length;let G=b6(Q);if(G!==null){Z[`:${Y}`]=G;continue}}else while(J<X&&!/\s/.test($[J]))Q+=$[J],J++;Z[Y]=Q}else Z[Y]=k1}return Z}function S6($){return Object.entries($).map(([Z,J])=>J===k1?Z:`${Z}="${dQ(J)}"`).join(" ")}function dQ($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function mQ($){let Z=new Set,J=/<([A-Z][A-Za-z0-9]*|stx-[a-z0-9-]+)\b[^>]*>/g,X;while((X=J.exec($))!==null){let Y=X[1];if(i1.isBuiltin(Y))Z.add(Y)}return[...Z].sort()}var P6=new Map;function lQ($){let Z=P6.get($);if(Z)return Z;let J=new Map,X=[f0.join($,"src"),f0.join($,"dist"),$];function Y(Q,G){if(G>6)return;let z;try{z=k9.readdirSync(Q,{withFileTypes:!0})}catch{return}for(let q of z){let K=f0.join(Q,q.name);if(q.isDirectory()){if(q.name==="node_modules"||q.name.startsWith("."))continue;Y(K,G+1)}else if(q.isFile()&&q.name.endsWith(".stx")){let U=q.name.slice(0,-4);if(!J.has(U))J.set(U,K);let W=U.toLowerCase();if(!J.has(W))J.set(W,K);let H=U.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();if(!J.has(H))J.set(H,K)}}}for(let Q of X)if(Y(Q,0),J.size>0)break;return P6.set($,J),J}function cQ($,Z){if($.startsWith(".")||$.startsWith("/"))return null;let J=Z;while(!0){let X=f0.join(J,"node_modules",$);try{if(k9.statSync(X).isDirectory())return X}catch{}let Y=f0.dirname(J);if(Y===J)return null;J=Y}}async function pQ($,Z,J,X,Y){if(!/import\s/.test($))return $;if(!Z.__importedComponents)Z.__importedComponents=new Map;let Q=Z.__importedComponents,G=f0.dirname(J),z=[],q=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi;for(let W of $.matchAll(q)){let[H,j,B]=W,V=/import\s+(?:(\{[^}]*\})|([A-Za-z_$][\w$]*))\s+from\s+['"]([^'"]+)['"]\s*;?\s*\n?/g,F=B,O,_=[];while((O=V.exec(B))!==null){let[L,w,R,D]=O,M=null,I=null;if(D.startsWith(".")||D.startsWith("/")){let T=f0.resolve(G,D);if(T.endsWith(".stx"))I=T;else{let k=`${T}.stx`;try{if(k9.statSync(k).isFile())I=k}catch{try{if(k9.statSync(T).isDirectory())M=T}catch{}}}}else M=cQ(D,G);if(!M&&!I)continue;let N=!1,A=(T,k)=>{Q.set(T,k),Q.set(T.toLowerCase(),k);let y=T.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();Q.set(y,k),Y.add(k)};if(R&&I)A(R,I),N=!0;else if(w){let T=w.slice(1,-1).split(",").map((y)=>y.trim()).filter(Boolean).map((y)=>{let E=y.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(E)return{source:E[1],local:E[2]};return{source:y,local:y}}),k=M?lQ(M):null;for(let{source:y,local:E}of T){let b=null;if(I)b=I;else if(k)b=k.get(y)??k.get(y.toLowerCase())??k.get(y.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase())??null;if(b)A(E,b),N=!0}}if(N)_.push({start:O.index,end:O.index+L.length})}if(_.length===0)continue;for(let L=_.length-1;L>=0;L--)F=F.slice(0,_[L].start)+F.slice(_[L].end);z.push({start:W.index,end:W.index+H.length,value:`<script${j}>${F}</script>`})}if(z.length===0)return $;let K=[],U=0;for(let W of z)K.push($.slice(U,W.start),W.value),U=W.end;return K.push($.slice(U)),K.join("")}async function iQ($,Z,J,X,Y){let Q=$;if(!Z.__importedComponents)Z.__importedComponents=new Map;let G=Z.__importedComponents,z=/@import\s*\(\s*([^)]+)\s*\)/g,q;while((q=z.exec(Q))!==null){let[K,U]=q,W=U.split(",").map((H)=>H.trim().replace(/^['"]|['"]$/g,"")).filter((H)=>H.length>0);for(let H of W){let j=H.split("/"),V=j[j.length-1].replace(/\.stx$/,""),F=V.includes("-")?V.split("-").map((L)=>L.charAt(0).toUpperCase()+L.slice(1)).join(""):V.charAt(0).toUpperCase()+V.slice(1),O=null,_=[f0.resolve(f0.dirname(J),`${H}.stx`),f0.resolve(f0.dirname(J),H),f0.resolve(X.componentsDir||"components",`${H}.stx`),f0.resolve(X.componentsDir||"components",H),H.endsWith(".stx")?H:`${H}.stx`];for(let L of _)try{if(await Bun.file(L).exists()){O=L;break}}catch{}if(O){G.set(F,O),G.set(V,O),G.set(V.toLowerCase(),O);let L=F.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();if(G.set(L,O),Y.add(O),X.debug)console.log(`Imported component: ${F} -> ${O}`)}else if(X.debug)console.warn(`Could not resolve imported component: ${H}`)}Q=Q.replace(K,""),z.lastIndex=0}return Q}async function nQ($,Z,J,X,Y){let Q=$,G=X.componentsDir||"components";if(!Z.__processedComponents)Z.__processedComponents=new Set;let z=Z.__processedComponents,q=/@component\s*\(/g,K;while((K=q.exec(Q))!==null){let U=K.index,W=U+K[0].length-1,H=1,j=W+1;while(j<Q.length&&H>0){if(Q[j]==="(")H++;else if(Q[j]===")"){if(H--,H===0)break}j++}if(H!==0)break;let B=Q.substring(W+1,j),V=j+1,F=B.match(/^\s*['"]([^'"]+)['"]/);if(!F){q.lastIndex=0;continue}let O=F[1],_,L=B.slice(F[0].length),w=L.match(/^\s*,\s*/);if(w)_=L.slice(w[0].length).trim();let R={};if(_)try{R=T0(_,Z)}catch(T){let k=T instanceof Error?T.message:String(T);Q=Q.replace(Q.substring(U,V),`[Error parsing component props: ${k}]`);continue}let D="",M=V,N=Q.substring(V).match(/^([\s\S]*?)@endcomponent/);if(N)D=N[1].trim(),M=V+N[0].length;let A=await A1(O,R,D,G,Z,J,X,z,Y);Q=Q.substring(0,U)+A+Q.substring(M),q.lastIndex=0}return Q}async function oQ($,Z,J,X,Y){if(!$)return $;let Q=$,G=X.componentsDir||"components";if(!Z.__processedComponents)Z.__processedComponents=new Set;let z=Z.__processedComponents,q=i0(Q);Q=q.output;let K=g5(Q);return Q=await j(Q,/[a-z][a-z0-9]*-[a-z0-9-]*/,!1),Q=await j(Q,/[A-Z][a-zA-Z0-9]*/,!0,k6(C6)),Q=await j(Q,/[a-z][a-z0-9]*/,!1,C6),Q=q.restore(Q),Q;async function j(B,V,F,O){if(!B)return B;let _=B,L=I6(_,V,O),w=new Map;for(let M=L.length-1;M>=0;M--){let I=L[M],N=F?M9(I.tagName):I.tagName,A=uQ(hQ(I.attributes,Z,J)),T=K.some(([P,g])=>I.startIndex>=P&&I.startIndex<g),k=xQ(A,Z,X,T),y=i1.getBuiltin(I.tagName),E=y?await A9(N,G,Z,J,X):!1;if(y&&!E){let P={context:Z,filePath:J,options:X,dependencies:Y},g=y.render(k,I.content,P);if(Object.keys(k.events).length>0){let x=S6(k.events);g=g.replace(/^(\s*<[a-zA-Z][a-zA-Z0-9-]*)/,`$1 ${x}`)}if(Object.keys(k.clientReactive).length>0)g=v6(g,k.clientReactive);w.set(M,g);continue}if(!F&&I.tagName.includes("-")&&!await A9(N,G,Z,J,X))continue;let b={};for(let[P,g]of Object.entries(k.static))b[P]=g;for(let[P,g]of Object.entries(k.serverDynamic))b[P]=g;let v=await A1(N,b,q.restore(I.content),G,Z,J,X,z,Y);if(Object.keys(k.events).length>0){let P=x6(v);if(P){let g=S6(k.events),x=Object.keys(k.events).map(($0)=>$0.replace(/^@/,"").split(".")[0]).join(" ");v=v.substring(0,P.insertPos)+` data-stx-parent-events="${x}" ${g}`+v.substring(P.insertPos)}}if(Object.keys(k.clientReactive).length>0)v=v6(v,k.clientReactive);w.set(M,v)}if(w.size===0)return _;let R="",D=0;for(let M=0;M<L.length;M++){let I=w.get(M);if(I===void 0)continue;R+=_.slice(D,L[M].startIndex),R+=I,D=L[M].endIndex}return R+=_.slice(D),R}}function v6($,Z){let J=new Set(["if","for"]),X=new Set(["show"]),Y=Object.entries(Z).filter(([U])=>!J.has(U)),Q=Y.filter(([U])=>!X.has(U)).map(([U])=>M9(U)).join(" "),G=$,z=Y.length>0?x6(G):null;if(z){let U=Y.map(([H,j])=>`:${M9(H)}="${j.replace(/"/g,"&quot;")}"`).join(" "),W=Q?` data-stx-parent-bindings="${Q}"`:"";G=G.substring(0,z.insertPos)+`${W} ${U}`+G.substring(z.insertPos)}let q=Z.if;if(q)G=`<template :if="${q.replace(/"/g,"&quot;")}">${G}</template>`;let K=Z.for;if(K)G=`<template :for="${K.replace(/"/g,"&quot;")}">${G}</template>`;return G}function x6($){let Z=/<([a-zA-Z][a-zA-Z0-9-]*)\b[^>]*\bdata-stx-scope(?:\s|=|>)/i.exec($);if(Z)return{insertPos:Z.index+1+Z[1].length};let J=0;while(J<$.length){let X=$.slice(J),Y=X.match(/^\s+/);if(Y){J+=Y[0].length;continue}if(X.startsWith("<!--")){let z=$.indexOf("-->",J+4);if(z===-1)return null;J=z+3;continue}let Q=X.match(/^<(script|style)\b[^>]*>/i);if(Q){let z=`</${Q[1].toLowerCase()}>`,q=$.toLowerCase().indexOf(z,J+Q[0].length);if(q===-1)return null;J=q+z.length;continue}let G=X.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(?:\s|>|\/)/);if(!G)return null;return{insertPos:J+1+G[1].length}}return null}async function A$($,Z,J,X,Y){if(!y6)N6(i1),y6=!0;let Q=await pQ($,Z,J,X,Y);Q=await iQ(Q,Z,J,X,Y),Q=await nQ(Q,Z,J,X,Y);let G=[];for(let z=0;z<3;z++){let q=G.length,K=p0(Q,Y2,(W,H)=>`\x00STX_COMPONENT_COMMENT_${q+H}\x00`,`STX_COMPONENT_COMMENT:${q}`);G.push(...K.tokens);let U=Q;if(Q=await oQ(K.output,Z,J,X,Y),Q===U)break}if(G.length>0)Q=Q.replace(/\x00STX_COMPONENT_COMMENT_(\d+)\x00/g,(z,q)=>G[Number(q)]??"");if(X.debug){let z=mQ(Q);if(z.length>0)console.warn(`[stx] ${J}: unresolved component tag(s) after render passes: ${z.join(", ")}. Check nested component output for malformed root tags or recursive component markup.`)}return Q}import Z2 from"path";import g6 from"process";function $2($="STX_PUBLIC_"){let Z={},J={};for(let[X,Y]of Object.entries(g6.env)){if(!X.startsWith($)||Y===void 0)continue;Z[`import.meta.env.${X}`]=JSON.stringify(Y),J[X]=Y}return Z["import.meta.env"]=JSON.stringify(J),Z}function XB($="STX_PUBLIC_"){let Z={};for(let[J,X]of Object.entries(g6.env))if(J.startsWith($)&&X!==void 0)Z[J]=X;return Z}function h6($){return $.startsWith("http://")||$.startsWith("https://")||$.startsWith("//")}async function u6($,Z,J){try{let X;if($.startsWith("/")){let Y=Z;for(let Q=0;Q<5;Q++){let G=Z2.join(Y,$);if(await Bun.file(G).exists())return G;Y=Z2.dirname(Y)}X=Z2.join(Z,$)}else if($.startsWith("./")||$.startsWith("../"))X=Z2.resolve(Z,$);else X=Z2.resolve(Z,$);if(await Bun.file(X).exists())return X;return null}catch{return null}}async function d6($,Z,J){let X=$,Y=Z2.dirname(Z),Q=/<script\b([^>]*)src=["']([^"']+)["']([^>]*)><\/script>/gi,G;while((G=Q.exec(X))!==null){let[K,U,W,H]=G;if(h6(W))continue;let j=await u6(W,Y,Z);if(j)try{let B=await Bun.file(j).text();if(J.add(j),W.endsWith(".ts")||W.endsWith(".tsx")){let F=await Bun.build({entrypoints:[j],target:"browser",minify:!0,define:$2()});if(F.outputs.length>0)B=await F.outputs[0].text()}let V=`<script>
3550
3548
  // Source: ${W}
3551
3549
  ${B}
3552
3550
  </script>`;X=X.replace(K,V),Q.lastIndex=0}catch(B){}}let z=/<link\b([^>]*)href=["']([^"']+)["']([^>]*)(?:\/?>)/gi,q;while((q=z.exec(X))!==null){let[K,U,W,H]=q,j=U+H;if(h6(W))continue;if(/rel=["']stylesheet["']/.test(j)||W.endsWith(".css")){let V=await u6(W,Y,Z);if(V)try{let F=await Bun.file(V).text();J.add(V);let O=`<style>
3553
3551
  /* Source: ${W} */
3554
3552
  ${F}
3555
- </style>`;X=X.replace(K,O),z.lastIndex=0}catch(F){}}}return X}function k$($,Z){let J=$,X=/@json\s*\(/g,Y;while((Y=X.exec(J))!==null){let Q=Y.index,G=Q+Y[0].length-1,z=1,q=G+1,K=null,U=!1;while(q<J.length&&z>0){let L=J[q];if(U){U=!1,q++;continue}if(L==="\\"&&K){U=!0,q++;continue}if(K){if(L===K)K=null;q++;continue}if(L==='"'||L==="'"||L==="`"){K=L,q++;continue}if(L==="(")z++;else if(L===")"){if(z--,z===0)break}q++}if(z!==0)break;let W=J.substring(G+1,q).trim(),H=J.substring(Q,q+1),j=-1,B=0,V=null,F=!1;for(let L=0;L<W.length;L++){let w=W[L];if(F){F=!1;continue}if(w==="\\"&&V){F=!0;continue}if(V){if(w===V)V=null;continue}if(w==='"'||w==="'"||w==="`"){V=w;continue}if(w==="("||w==="["||w==="{")B++;else if(w===")"||w==="]"||w==="}")B--;if(w===","&&B===0){j=L;break}}let O=j>=0?W.substring(0,j).trim():W,_=j>=0?W.substring(j+1).trim():void 0;try{let L=O.trim(),w;if(q0(L))w=U0(L,Object.keys(Z))(...Object.values(Z));else w=void 0;let R;if(_==="true")R=JSON.stringify(w,null,2);else R=JSON.stringify(w);let D=R.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");J=J.substring(0,Q)+D+J.substring(q+1),X.lastIndex=Q+D.length}catch(L){o0.log(L instanceof Error?L:Error(String(L)),{directive:"@json"},"error"),X.lastIndex=Q+H.length}}return J}function I$($){return $.replace(/@once\s*([\s\S]*?)@endonce/g,"$1")}function l6($){let Z=$,J=/@memo\s*\(/g,X,Y=[];while((X=J.exec(Z))!==null){let Q=X.index,G=Q+X[0].length,z=1,q=G;while(q<Z.length&&z>0){if(Z[q]==="(")z++;else if(Z[q]===")")z--;q++}if(z!==0)continue;let K=Z.slice(G,q-1).trim(),U=q,W=Z.slice(U),H=W.indexOf("@endmemo");if(H===-1)continue;let j=W.slice(0,H),B=U+H+8,V=j.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)/),F=V?V[0].length:0,O=j.slice(F),_=j.match(/(\s*)$/),L=_?_[0].length:0,w=O.slice(0,O.length-L),R=w.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)?(\/?)>/),D;if(R){let[M,I,N="",A]=R,T=`<${I}${N} data-stx-memo="${K}"${A}>`;D=j.slice(0,F)+T+w.slice(M.length)+j.slice(F+w.length)}else D=`${j.slice(0,F)}<div data-stx-memo="${K}">${w}</div>${j.slice(F+w.length)}`;Y.push({start:Q,end:B,replacement:D}),J.lastIndex=B}for(let Q=Y.length-1;Q>=0;Q--){let G=Y[Q];Z=Z.slice(0,G.start)+G.replacement+Z.slice(G.end)}return Z.replace(/@memo="([^"]*)"/g,'data-stx-memo="$1"')}function T$($){let Z=$.replace(/@ref="([^"]+)"/g,'data-stx-ref="$1"');return Z=Z.replace(/(<[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?)\sref="([^"]+)"/g,'$1 data-stx-ref="$2"'),Z}var nQ=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),c6=/(?:^|\s)x-no-cloak(?:=|\s|\/|>|$)/,m6=/<\/?\s*([a-z][\w-]*)/iy,oQ=/\s/;function sQ($,Z){let J=Z-1;while(J>=0&&oQ.test($[J]))J--;return J>=0&&$[J]==="/"}function rQ($,Z){let J=!1,X=!1;for(let Y=Z;Y<$.length;Y++){let Q=$[Y];if(J){if(Q==="'")J=!1}else if(X){if(Q==='"')X=!1}else if(Q==="'")J=!0;else if(Q==='"')X=!0;else if(Q===">")return Y}return-1}function aQ($,Z){if($.indexOf("{",Z)===-1||$.indexOf("}",Z)===-1)return!1;let J=0,X=Z,Y=!1,Q=!1,G=!1;while(X<$.length){let z=$.indexOf("<",X),q=z===-1?$.length:z;if(q>X){if(J===0)while(X<q){let W=$.indexOf(Q?"}":"{",X);if(W===-1||W>=q){if(Q)G=!1;else Y=!1;break}if(W>X)if(Q)G=!1;else Y=!1;if(Q){if(G)return!0;G=!0}else if(Y)Q=!0,G=!1;else Y=!0;X=W+1}X=q;continue}if($.startsWith("<!--",X)){let W=$.indexOf("-->",X);X=W===-1?$.length:W+3;continue}let K=rQ($,X);if(K===-1)break;m6.lastIndex=X;let U=m6.exec($)?.[1]?.toLowerCase()??"";if($[X+1]==="/"){if(J===0)break;J--}else if(!sQ($,K)&&!nQ.has(U))J++;X=K+1}return!1}function p6($){if($.length>=32768&&!X3($))return $;let J=new RegExp(`<(${"div|span|p|h[1-6]|td|th|li|a|button|label|section|article|header|footer|main|nav|aside|dd|dt|figcaption|summary|caption|blockquote|pre|code|em|strong|small|sub|sup|time|mark|abbr|cite|q|s|u|b|i"})\\b`,"gi"),X="",Y=0,Q;while((Q=J.exec($))!==null){let G=Q.index,z=G+Q[0].length,q=!1,K=!1,U=-1;while(z<$.length){let H=$[z];if(q){if(H==="'")q=!1}else if(K){if(H==='"')K=!1}else if(H==="'")q=!0;else if(H==='"')K=!0;else if(H===">"){U=z;break}z++}if(U===-1)continue;let W=$.slice(G,U+1);if(c6.test(W))continue;if(W.includes("x-cloak"))continue;if(aQ($,U+1))X+=$.slice(Y,U)+" x-cloak>",Y=U+1}return X+=$.slice(Y),X}var tQ=/(?:^|\s)(?::else-if|:if|:else|:show|x-else-if|x-if|x-else|x-show|@if|@show)(?:=|\s|\/|>|$)/,eQ=/<\/script>/gi,$G=/<\/style>/gi;function i6($){let Z=/<[a-z][\w-]*/gi,J="",X=0,Y;while((Y=Z.exec($))!==null){let Q=Y.index,G=Y[0].slice(1).toLowerCase();if(G==="script"||G==="style"){let B=G==="script"?eQ:$G;B.lastIndex=Q;let V=B.exec($);if(V!==null)Z.lastIndex=V.index+V[0].length;continue}let z=Q+Y[0].length,q=!1,K=!1,U=-1;while(z<$.length){let B=$[z];if(q){if(B==="'")q=!1}else if(K){if(B==='"')K=!1}else if(B==="'")q=!0;else if(B==='"')K=!0;else if(B===">"){U=z;break}z++}if(U===-1)continue;let W=$.slice(Q+Y[0].length,U);if(c6.test(W))continue;if(/(?:^|\s)x-cloak(?:=|\s|\/|>|$)/.test(W))continue;if(!tQ.test(W))continue;let H=$[U-1]==="/",j=H?U-1:U;J+=`${$.slice(X,j)} x-cloak${H?" ":""}`,X=j}return J+=$.slice(X),J}var E$=T1(256),ZG=[{pattern:/document\.getElementById\s*\(/g,message:"document.getElementById() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.querySelector\s*\(/g,message:"document.querySelector() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.querySelectorAll\s*\(/g,message:"document.querySelectorAll() is prohibited",suggestion:'Use useRef("name") and access children instead'},{pattern:/document\.getElementsBy\w+\s*\(/g,message:"document.getElementsBy*() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.createElement\s*\(/g,message:"document.createElement() is prohibited",suggestion:"Use template directives or component composition instead"},{pattern:/document\.activeElement(?![A-Za-z])/g,message:"document.activeElement is prohibited",suggestion:"Use useRef() to track focused elements"},{pattern:/document\.title\s*=/g,message:"document.title assignment is prohibited",suggestion:"Use useTitle() from composables"},{pattern:/document\.cookie(?![A-Za-z])/g,message:"document.cookie is prohibited",suggestion:"Use useCookie() from composables"},{pattern:/document\.addEventListener\s*\(/g,message:"document.addEventListener() is prohibited",suggestion:"Use useEventListener() or template @event directives"},{pattern:/window\.location(?![A-Za-z])/g,message:"window.location is prohibited",suggestion:"Use navigate() or useRoute()"},{pattern:/window\.history(?![A-Za-z])/g,message:"window.history is prohibited",suggestion:"Use navigate(), goBack(), goForward()"},{pattern:/window\.addEventListener\s*\(/g,message:"window.addEventListener() is prohibited",suggestion:"Use useEventListener() or @click directives"},{pattern:/(?:\bwindow\.)?localStorage(?![A-Za-z])/g,message:"window.localStorage is prohibited",suggestion:"Use useLocalStorage() from composables \u2014 or @appearanceBootstrap if this must run before first paint, where the runtime does not exist yet"},{pattern:/window\.sessionStorage(?![A-Za-z])/g,message:"window.sessionStorage is prohibited",suggestion:"Use useSessionStorage() from composables"},{pattern:/window\.scrollTo\s*\(/g,message:"window.scrollTo() is prohibited",suggestion:"Use useScroll().scrollTo() from composables"},{pattern:/window\.alert\s*\(/g,message:"window.alert() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/window\.confirm\s*\(/g,message:"window.confirm() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/window\.prompt\s*\(/g,message:"window.prompt() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/(?<!\w)setTimeout\s*\(/g,message:"setTimeout() is prohibited",suggestion:"Use useTimeout() or useDebounce() from composables"},{pattern:/(?<!\w)setInterval\s*\(/g,message:"setInterval() is prohibited",suggestion:"Use useInterval() from composables"},{pattern:/(?<!\w)clearTimeout\s*\(/g,message:"clearTimeout() is prohibited",suggestion:"Use useTimeout().stop() or useDebounce().cancel()"},{pattern:/(?<!\w)clearInterval\s*\(/g,message:"clearInterval() is prohibited",suggestion:"Use useInterval().pause()"},{pattern:/(?<!\w)location\.href\s*=/g,message:"location.href assignment is prohibited",suggestion:"Use navigate() instead"},{pattern:/(?<!\w)location\.assign\s*\(/g,message:"location.assign() is prohibited",suggestion:"Use navigate() instead"},{pattern:/(?<!\w)location\.replace\s*\(/g,message:"location.replace() is prohibited",suggestion:"Use navigate() instead"}];function b$($,Z,J,X){let Y=typeof J==="boolean"?{enabled:J,failOnViolation:J}:J??{enabled:!1};if(!Y.enabled)return;let Q=V1($,Z,X,JSON.stringify(Y)),G=E$.get(Q);if(G!==void 0){if(G&&Y.failOnViolation)throw Error(G);return}let z=Y.allowPatterns??[],q=[],K=x0($.replace(/\{\{--[\s\S]*?--\}\}/g,(j)=>j.replace(/[^\n]/g," ")));for(let{pattern:j,message:B,suggestion:V}of ZG){if(z.some((O)=>/\w/.test(O)&&B.includes(O)))continue;j.lastIndex=0;let F=K.match(j);if(F&&F.length>0){let O=K.split(`
3553
+ </style>`;X=X.replace(K,O),z.lastIndex=0}catch(F){}}}return X}function k$($,Z){let J=$,X=/@json\s*\(/g,Y;while((Y=X.exec(J))!==null){let Q=Y.index,G=Q+Y[0].length-1,z=1,q=G+1,K=null,U=!1;while(q<J.length&&z>0){let L=J[q];if(U){U=!1,q++;continue}if(L==="\\"&&K){U=!0,q++;continue}if(K){if(L===K)K=null;q++;continue}if(L==='"'||L==="'"||L==="`"){K=L,q++;continue}if(L==="(")z++;else if(L===")"){if(z--,z===0)break}q++}if(z!==0)break;let W=J.substring(G+1,q).trim(),H=J.substring(Q,q+1),j=-1,B=0,V=null,F=!1;for(let L=0;L<W.length;L++){let w=W[L];if(F){F=!1;continue}if(w==="\\"&&V){F=!0;continue}if(V){if(w===V)V=null;continue}if(w==='"'||w==="'"||w==="`"){V=w;continue}if(w==="("||w==="["||w==="{")B++;else if(w===")"||w==="]"||w==="}")B--;if(w===","&&B===0){j=L;break}}let O=j>=0?W.substring(0,j).trim():W,_=j>=0?W.substring(j+1).trim():void 0;try{let L=O.trim(),w;if(q0(L))w=U0(L,Object.keys(Z))(...Object.values(Z));else w=void 0;let R;if(_==="true")R=JSON.stringify(w,null,2);else R=JSON.stringify(w);let D=R.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");J=J.substring(0,Q)+D+J.substring(q+1),X.lastIndex=Q+D.length}catch(L){o0.log(L instanceof Error?L:Error(String(L)),{directive:"@json"},"error"),X.lastIndex=Q+H.length}}return J}function I$($){return $.replace(/@once\s*([\s\S]*?)@endonce/g,"$1")}function l6($){let Z=$,J=/@memo\s*\(/g,X,Y=[];while((X=J.exec(Z))!==null){let Q=X.index,G=Q+X[0].length,z=1,q=G;while(q<Z.length&&z>0){if(Z[q]==="(")z++;else if(Z[q]===")")z--;q++}if(z!==0)continue;let K=Z.slice(G,q-1).trim(),U=q,W=Z.slice(U),H=W.indexOf("@endmemo");if(H===-1)continue;let j=W.slice(0,H),B=U+H+8,V=j.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)/),F=V?V[0].length:0,O=j.slice(F),_=j.match(/(\s*)$/),L=_?_[0].length:0,w=O.slice(0,O.length-L),R=w.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)?(\/?)>/),D;if(R){let[M,I,N="",A]=R,T=`<${I}${N} data-stx-memo="${K}"${A}>`;D=j.slice(0,F)+T+w.slice(M.length)+j.slice(F+w.length)}else D=`${j.slice(0,F)}<div data-stx-memo="${K}">${w}</div>${j.slice(F+w.length)}`;Y.push({start:Q,end:B,replacement:D}),J.lastIndex=B}for(let Q=Y.length-1;Q>=0;Q--){let G=Y[Q];Z=Z.slice(0,G.start)+G.replacement+Z.slice(G.end)}return Z.replace(/@memo="([^"]*)"/g,'data-stx-memo="$1"')}function T$($){let Z=$.replace(/@ref="([^"]+)"/g,'data-stx-ref="$1"');return Z=Z.replace(/(<[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?)\sref="([^"]+)"/g,'$1 data-stx-ref="$2"'),Z}var sQ=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),c6=/(?:^|\s)x-no-cloak(?:=|\s|\/|>|$)/,m6=/<\/?\s*([a-z][\w-]*)/iy,rQ=/\s/;function aQ($,Z){let J=Z-1;while(J>=0&&rQ.test($[J]))J--;return J>=0&&$[J]==="/"}function tQ($,Z){let J=!1,X=!1;for(let Y=Z;Y<$.length;Y++){let Q=$[Y];if(J){if(Q==="'")J=!1}else if(X){if(Q==='"')X=!1}else if(Q==="'")J=!0;else if(Q==='"')X=!0;else if(Q===">")return Y}return-1}function eQ($,Z){if($.indexOf("{",Z)===-1||$.indexOf("}",Z)===-1)return!1;let J=0,X=Z,Y=!1,Q=!1,G=!1;while(X<$.length){let z=$.indexOf("<",X),q=z===-1?$.length:z;if(q>X){if(J===0)while(X<q){let W=$.indexOf(Q?"}":"{",X);if(W===-1||W>=q){if(Q)G=!1;else Y=!1;break}if(W>X)if(Q)G=!1;else Y=!1;if(Q){if(G)return!0;G=!0}else if(Y)Q=!0,G=!1;else Y=!0;X=W+1}X=q;continue}if($.startsWith("<!--",X)){let W=$.indexOf("-->",X);X=W===-1?$.length:W+3;continue}let K=tQ($,X);if(K===-1)break;m6.lastIndex=X;let U=m6.exec($)?.[1]?.toLowerCase()??"";if($[X+1]==="/"){if(J===0)break;J--}else if(!aQ($,K)&&!sQ.has(U))J++;X=K+1}return!1}function p6($){if($.length>=32768&&!X3($))return $;let J=new RegExp(`<(${"div|span|p|h[1-6]|td|th|li|a|button|label|section|article|header|footer|main|nav|aside|dd|dt|figcaption|summary|caption|blockquote|pre|code|em|strong|small|sub|sup|time|mark|abbr|cite|q|s|u|b|i"})\\b`,"gi"),X="",Y=0,Q;while((Q=J.exec($))!==null){let G=Q.index,z=G+Q[0].length,q=!1,K=!1,U=-1;while(z<$.length){let H=$[z];if(q){if(H==="'")q=!1}else if(K){if(H==='"')K=!1}else if(H==="'")q=!0;else if(H==='"')K=!0;else if(H===">"){U=z;break}z++}if(U===-1)continue;let W=$.slice(G,U+1);if(c6.test(W))continue;if(W.includes("x-cloak"))continue;if(eQ($,U+1))X+=$.slice(Y,U)+" x-cloak>",Y=U+1}return X+=$.slice(Y),X}var $G=/(?:^|\s)(?::else-if|:if|:else|:show|x-else-if|x-if|x-else|x-show|@if|@show)(?:=|\s|\/|>|$)/,ZG=/<\/script>/gi,JG=/<\/style>/gi;function i6($){let Z=/<[a-z][\w-]*/gi,J="",X=0,Y;while((Y=Z.exec($))!==null){let Q=Y.index,G=Y[0].slice(1).toLowerCase();if(G==="script"||G==="style"){let B=G==="script"?ZG:JG;B.lastIndex=Q;let V=B.exec($);if(V!==null)Z.lastIndex=V.index+V[0].length;continue}let z=Q+Y[0].length,q=!1,K=!1,U=-1;while(z<$.length){let B=$[z];if(q){if(B==="'")q=!1}else if(K){if(B==='"')K=!1}else if(B==="'")q=!0;else if(B==='"')K=!0;else if(B===">"){U=z;break}z++}if(U===-1)continue;let W=$.slice(Q+Y[0].length,U);if(c6.test(W))continue;if(/(?:^|\s)x-cloak(?:=|\s|\/|>|$)/.test(W))continue;if(!$G.test(W))continue;let H=$[U-1]==="/",j=H?U-1:U;J+=`${$.slice(X,j)} x-cloak${H?" ":""}`,X=j}return J+=$.slice(X),J}var E$=T1(256),XG=[{pattern:/document\.getElementById\s*\(/g,message:"document.getElementById() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.querySelector\s*\(/g,message:"document.querySelector() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.querySelectorAll\s*\(/g,message:"document.querySelectorAll() is prohibited",suggestion:'Use useRef("name") and access children instead'},{pattern:/document\.getElementsBy\w+\s*\(/g,message:"document.getElementsBy*() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.createElement\s*\(/g,message:"document.createElement() is prohibited",suggestion:"Use template directives or component composition instead"},{pattern:/document\.activeElement(?![A-Za-z])/g,message:"document.activeElement is prohibited",suggestion:"Use useRef() to track focused elements"},{pattern:/document\.title\s*=/g,message:"document.title assignment is prohibited",suggestion:"Use useTitle() from composables"},{pattern:/document\.cookie(?![A-Za-z])/g,message:"document.cookie is prohibited",suggestion:"Use useCookie() from composables"},{pattern:/document\.addEventListener\s*\(/g,message:"document.addEventListener() is prohibited",suggestion:"Use useEventListener() or template @event directives"},{pattern:/window\.location(?![A-Za-z])/g,message:"window.location is prohibited",suggestion:"Use navigate() or useRoute()"},{pattern:/window\.history(?![A-Za-z])/g,message:"window.history is prohibited",suggestion:"Use navigate(), goBack(), goForward()"},{pattern:/window\.addEventListener\s*\(/g,message:"window.addEventListener() is prohibited",suggestion:"Use useEventListener() or @click directives"},{pattern:/(?:\bwindow\.)?localStorage(?![A-Za-z])/g,message:"window.localStorage is prohibited",suggestion:"Use useLocalStorage() from composables \u2014 or @appearanceBootstrap if this must run before first paint, where the runtime does not exist yet"},{pattern:/window\.sessionStorage(?![A-Za-z])/g,message:"window.sessionStorage is prohibited",suggestion:"Use useSessionStorage() from composables"},{pattern:/window\.scrollTo\s*\(/g,message:"window.scrollTo() is prohibited",suggestion:"Use useScroll().scrollTo() from composables"},{pattern:/window\.alert\s*\(/g,message:"window.alert() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/window\.confirm\s*\(/g,message:"window.confirm() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/window\.prompt\s*\(/g,message:"window.prompt() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/(?<!\w)setTimeout\s*\(/g,message:"setTimeout() is prohibited",suggestion:"Use useTimeout() or useDebounce() from composables"},{pattern:/(?<!\w)setInterval\s*\(/g,message:"setInterval() is prohibited",suggestion:"Use useInterval() from composables"},{pattern:/(?<!\w)clearTimeout\s*\(/g,message:"clearTimeout() is prohibited",suggestion:"Use useTimeout().stop() or useDebounce().cancel()"},{pattern:/(?<!\w)clearInterval\s*\(/g,message:"clearInterval() is prohibited",suggestion:"Use useInterval().pause()"},{pattern:/(?<!\w)location\.href\s*=/g,message:"location.href assignment is prohibited",suggestion:"Use navigate() instead"},{pattern:/(?<!\w)location\.assign\s*\(/g,message:"location.assign() is prohibited",suggestion:"Use navigate() instead"},{pattern:/(?<!\w)location\.replace\s*\(/g,message:"location.replace() is prohibited",suggestion:"Use navigate() instead"}];function b$($,Z,J,X){let Y=typeof J==="boolean"?{enabled:J,failOnViolation:J}:J??{enabled:!1};if(!Y.enabled)return;let Q=V1($,Z,X,JSON.stringify(Y)),G=E$.get(Q);if(G!==void 0){if(G&&Y.failOnViolation)throw Error(G);return}let z=Y.allowPatterns??[],q=[],K=x0($.replace(/\{\{--[\s\S]*?--\}\}/g,(j)=>j.replace(/[^\n]/g," ")));for(let{pattern:j,message:B,suggestion:V}of XG){if(z.some((O)=>/\w/.test(O)&&B.includes(O)))continue;j.lastIndex=0;let F=K.match(j);if(F&&F.length>0){let O=K.split(`
3556
3554
  `),_=$.split(`
3557
3555
  `),L=[];O.forEach((M,I)=>{if(j.lastIndex=0,j.test(M))L.push(I+1)});let w=L.length>0?` (script line${L.length>1?"s":""} ${L.join(", ")})`:"",R=L.slice(0,3).map((M)=>` ${M} | ${(_[M-1]??"").trim().slice(0,100)}`).join(`
3558
3556
  `),D=R?`
@@ -3560,74 +3558,75 @@ ${R}`:"";q.push(` \u2717 ${B}${w}
3560
3558
  \u2192 ${V}${D}`)}}if(q.length===0){E$.set(Q,"");return}let U=(j)=>{let B=`${process.cwd()}/`;return j.startsWith(B)?j.slice(B.length):j},H=`[STX] DOM API violation in ${X&&X!==Z?`${U(X)} (composed into ${U(Z)})`:U(Z)}:
3561
3559
  ${q.join(`
3562
3560
  `)}
3563
- Tip: prefer useRef(), navigate(), and composables for component code`;if(E$.set(Q,H),Y.failOnViolation)throw Error(H);else console.warn(H)}QG();import y$ from"path";var JG=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.\.?\/[^'"]*)\2/g,XG=/(<script\b[^>]*>)([\s\S]*?)(<\/script>)/gi;function YG($,Z){if(!Z||!$.includes("/"))return $;let J=y$.dirname(Z);return $.replace(JG,(X,Y,Q,G)=>{let z=y$.resolve(J,G);return`${Y}${Q}${z.split(y$.sep).join("/")}${Q}`})}function n6($,Z){if(!Z||!$.includes("<script"))return $;return $.replace(XG,(J,X,Y,Q)=>`${X}${YG(Y,Z)}${Q}`)}var E1="<!--PARENT_CONTENT_PLACEHOLDER-->";function o6($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function zG($,Z){let J=$.length,X=Z,Y=!0,Q=[],G=(z)=>z+9<=J&&$[z]==="<"&&$[z+1]==="/"&&($[z+2]==="s"||$[z+2]==="S")&&($[z+3]==="c"||$[z+3]==="C")&&($[z+4]==="r"||$[z+4]==="R")&&($[z+5]==="i"||$[z+5]==="I")&&($[z+6]==="p"||$[z+6]==="P")&&($[z+7]==="t"||$[z+7]==="T")&&($[z+8]===">"||/\s/.test($[z+8]));while(X<J){let z=$[X];if(G(X))return X;if(z==="/"&&$[X+1]==="/"){if(X=$.indexOf(`
3561
+ Tip: prefer useRef(), navigate(), and composables for component code`;if(E$.set(Q,H),Y.failOnViolation)throw Error(H);else console.warn(H)}zG();import y$ from"path";var YG=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.\.?\/[^'"]*)\2/g,QG=/(<script\b[^>]*>)([\s\S]*?)(<\/script>)/gi;function GG($,Z){if(!Z||!$.includes("/"))return $;let J=y$.dirname(Z);return $.replace(YG,(X,Y,Q,G)=>{let z=y$.resolve(J,G);return`${Y}${Q}${z.split(y$.sep).join("/")}${Q}`})}function n6($,Z){if(!Z||!$.includes("<script"))return $;return $.replace(QG,(J,X,Y,Q)=>`${X}${GG(Y,Z)}${Q}`)}var E1="<!--PARENT_CONTENT_PLACEHOLDER-->";function o6($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function KG($,Z){let J=$.length,X=Z,Y=!0,Q=[],G=(z)=>z+9<=J&&$[z]==="<"&&$[z+1]==="/"&&($[z+2]==="s"||$[z+2]==="S")&&($[z+3]==="c"||$[z+3]==="C")&&($[z+4]==="r"||$[z+4]==="R")&&($[z+5]==="i"||$[z+5]==="I")&&($[z+6]==="p"||$[z+6]==="P")&&($[z+7]==="t"||$[z+7]==="T")&&($[z+8]===">"||/\s/.test($[z+8]));while(X<J){let z=$[X];if(G(X))return X;if(z==="/"&&$[X+1]==="/"){if(X=$.indexOf(`
3564
3562
  `,X+2),X===-1)return-1;X+=1,Y=!0;continue}if(z==="/"&&$[X+1]==="*"){let q=$.indexOf("*/",X+2);if(q===-1)return-1;X=q+2,Y=!0;continue}if(z==="/"&&Y){let q=X+1,K=!1;while(q<J){let U=$[q];if(U==="\\"){q+=2;continue}if(U==="[")K=!0;else if(U==="]")K=!1;else if(U==="/"&&!K){q++;break}else if(U===`
3565
3563
  `){q=-1;break}q++}if(q===-1){X++,Y=!1;continue}while(q<J&&/[a-z]/.test($[q]))q++;X=q,Y=!1;continue}if(z==="'"||z==='"'){let q=z;X++;while(X<J){if($[X]==="\\"){X+=2;continue}if($[X]===q){X++;break}if($[X]===`
3566
- `)break;X++}Y=!1;continue}if(z==="`"){X++;while(X<J){if($[X]==="\\"){X+=2;continue}if($[X]==="`"){X++;break}if($[X]==="$"&&$[X+1]==="{"){Q.push(!0),X+=2,Y=!0;break}X++}if(Q.length===0)Y=!1;continue}if(z==="}"&&Q.length>0){Q.pop(),X++;while(X<J){if($[X]==="\\"){X+=2;continue}if($[X]==="`"){X++,Y=!1;break}if($[X]==="$"&&$[X+1]==="{"){Q.push(!0),X+=2,Y=!0;break}X++}continue}if(/\s/.test(z));else if(/[)\].\w$]/.test(z))Y=!1;else Y=!0;X++}return-1}function U8($,Z){let J=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),X=new RegExp(`<script\\b(?=[^>]*\\b${J}(?:\\s|=|/?>))[^>]*>`,"i").exec($);if(!X)return null;let Y=X.index+X[0].length,Q=$.indexOf("</script>",Y);if(Q===-1)return null;let G=$.indexOf(">",Q);if(G===-1)return null;return{start:X.index,end:G+1}}var s6=/<style\b[^>]*>/iy,r6=/<\/style>/gi,a6=/<script\b[^>]*>/iy;function t6($){let Z=0;while(Z<$.length){let J=$.indexOf("<",Z);if(J===-1)return-1;if($.startsWith("<!--",J)){let Y=$.indexOf("-->",J+4);Z=Y===-1?$.length:Y+3;continue}s6.lastIndex=J;let X=s6.exec($);if(X){r6.lastIndex=J+X[0].length;let Y=r6.exec($);Z=Y===null?$.length:Y.index+8;continue}if(a6.lastIndex=J,a6.test($))return J;Z=J+1}return-1}function qG($){let Z=U8($,"data-stx-runtime");if(!Z)return $;let J=t6($);if(J===-1||J===Z.start)return $;if(J<Z.start)return $.slice(0,J)+$.slice(Z.start,Z.end)+`
3564
+ `)break;X++}Y=!1;continue}if(z==="`"){X++;while(X<J){if($[X]==="\\"){X+=2;continue}if($[X]==="`"){X++;break}if($[X]==="$"&&$[X+1]==="{"){Q.push(!0),X+=2,Y=!0;break}X++}if(Q.length===0)Y=!1;continue}if(z==="}"&&Q.length>0){Q.pop(),X++;while(X<J){if($[X]==="\\"){X+=2;continue}if($[X]==="`"){X++,Y=!1;break}if($[X]==="$"&&$[X+1]==="{"){Q.push(!0),X+=2,Y=!0;break}X++}continue}if(/\s/.test(z));else if(/[)\].\w$]/.test(z))Y=!1;else Y=!0;X++}return-1}function W8($,Z){let J=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),X=new RegExp(`<script\\b(?=[^>]*\\b${J}(?:\\s|=|/?>))[^>]*>`,"i").exec($);if(!X)return null;let Y=X.index+X[0].length,Q=$.indexOf("</script>",Y);if(Q===-1)return null;let G=$.indexOf(">",Q);if(G===-1)return null;return{start:X.index,end:G+1}}var s6=/<style\b[^>]*>/iy,r6=/<\/style>/gi,a6=/<script\b[^>]*>/iy;function t6($){let Z=0;while(Z<$.length){let J=$.indexOf("<",Z);if(J===-1)return-1;if($.startsWith("<!--",J)){let Y=$.indexOf("-->",J+4);Z=Y===-1?$.length:Y+3;continue}s6.lastIndex=J;let X=s6.exec($);if(X){r6.lastIndex=J+X[0].length;let Y=r6.exec($);Z=Y===null?$.length:Y.index+8;continue}if(a6.lastIndex=J,a6.test($))return J;Z=J+1}return-1}async function e6($,Z){try{let{registeredModuleIdsIn:J,buildModuleRegistryScript:X}=await n("stx/client-module-registry",()=>import("./chunk-pb16azfa.js")),Y=await X(J(...$),{minify:Z.buildMode==="compile"});if(!Y)return null;return`<script data-stx-scoped data-stx-run="always" data-stx-modules>${Y.replace(/<\/script/gi,"<\\/script")}</script>`}catch{return null}}function UG($){let Z=W8($,"data-stx-runtime");if(!Z)return $;let J=t6($);if(J===-1||J===Z.start)return $;if(J<Z.start)return $.slice(0,J)+$.slice(Z.start,Z.end)+`
3567
3565
  `+$.slice(J,Z.start)+$.slice(Z.end);let X=$.slice(Z.start,Z.end),Y=$.slice(0,Z.start)+$.slice(Z.end),Q=t6(Y);if(Q===-1)return X+`
3568
3566
  `+Y;return Y.slice(0,Q)+X+`
3569
- `+Y.slice(Q)}async function C$($,Z,J,X,Y){if(X.ssr===!1&&!X.autoShell&&X.buildMode==="spa")return $;if(Z.__stx_signals_gate===void 0)Z.__stx_signals_gate=Q1($,J);let Q=!Z.__stxProcessingDepth;if(Q)s$(Z),Z.__stx_head_injections=m5(),Z.__stx_seo_staged=!1;if(!Z.__stxProcessingDepth)Z.__stxProcessingDepth=0;if(Z.__stxProcessingDepth++,!Z.__onceStore)Z.__onceStore=new Set;if((X.debug||!Y9()&&!Q9())&&J&&J.endsWith(".stx"))K8($,J);try{return await G8.timeAsync("template-processing",async()=>{let G=await KG($,Z,J,X,Y);if(Q)G=T$(G);if(Q&&X.autoShell&&X.buildMode!=="compile"){let z=X.app?.head||{},K=(Z.__stx_runtime_head||null)??q8(),U=(Z.__stx_head_raw||"").trim(),W,H=U.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(H)W=H[1].trim(),U=U.replace(H[0],"").trim();let j=Z.__sections?.title,B=K.title||W||j,V=!K.title&&(!!W||!!j),F=K.meta||[],O=new Set(F.map((M)=>l1(M)).filter(Boolean)),_={...z,...B&&{title:B},meta:[...(z.meta||[]).filter((M)=>!O.has(l1(M))),...F],link:[...z.link||[],...K.link||[]],script:[...z.script||[],...K.script||[]],headRaw:[z.headRaw,U].filter(Boolean).join(`
3570
- `),...K.htmlAttrs&&{htmlAttrs:f4(z.htmlAttrs,K.htmlAttrs)},...K.bodyAttrs&&{bodyAttrs:{...z.bodyAttrs||{},...K.bodyAttrs}}},L=a5(G);if(G=h4(G,_,{...V&&{titleIsHtml:!0},...X.app?.colorMode&&{colorMode:X.app.colorMode}},L),L)G=g4(G,z),G=x4(G,_.htmlAttrs);let w=G.match(/<!-- stx-layout: ([^ ]+) -->/);if(w&&G.includes("<head")){let M=w[1],I=Q8(M);G=G.replace(/<head\b[^>]*>/i,(N)=>`${N}
3567
+ `+Y.slice(Q)}async function C$($,Z,J,X,Y){if(X.ssr===!1&&!X.autoShell&&X.buildMode==="spa")return $;if(Z.__stx_signals_gate===void 0)Z.__stx_signals_gate=Q1($,J);let Q=!Z.__stxProcessingDepth;if(Q)s$(Z),Z.__stx_head_injections=m5(),Z.__stx_seo_staged=!1;if(!Z.__stxProcessingDepth)Z.__stxProcessingDepth=0;if(Z.__stxProcessingDepth++,!Z.__onceStore)Z.__onceStore=new Set;if((X.debug||!Y9()&&!Q9())&&J&&J.endsWith(".stx"))U8($,J);try{return await z8.timeAsync("template-processing",async()=>{let G=await WG($,Z,J,X,Y);if(Q)G=T$(G);if(Q&&X.autoShell&&X.buildMode!=="compile"){let z=X.app?.head||{},K=(Z.__stx_runtime_head||null)??K8(),U=(Z.__stx_head_raw||"").trim(),W,H=U.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(H)W=H[1].trim(),U=U.replace(H[0],"").trim();let j=Z.__sections?.title,B=K.title||W||j,V=!K.title&&(!!W||!!j),F=K.meta||[],O=new Set(F.map((M)=>l1(M)).filter(Boolean)),_={...z,...B&&{title:B},meta:[...(z.meta||[]).filter((M)=>!O.has(l1(M))),...F],link:[...z.link||[],...K.link||[]],script:[...z.script||[],...K.script||[]],headRaw:[z.headRaw,U].filter(Boolean).join(`
3568
+ `),...K.htmlAttrs&&{htmlAttrs:f4(z.htmlAttrs,K.htmlAttrs)},...K.bodyAttrs&&{bodyAttrs:{...z.bodyAttrs||{},...K.bodyAttrs}}},L=a5(G);if(G=h4(G,_,{...V&&{titleIsHtml:!0},...X.app?.colorMode&&{colorMode:X.app.colorMode}},L),L)G=g4(G,z),G=x4(G,_.htmlAttrs);let w=G.match(/<!-- stx-layout: ([^ ]+) -->/);if(w&&G.includes("<head")){let M=w[1],I=G8(M);G=G.replace(/<head\b[^>]*>/i,(N)=>`${N}
3571
3569
  <meta name="stx-layout" content="${o6(M)}">
3572
- <meta name="stx-layout-group" content="${o6(I)}">`)}let R=G.match(/function (__stx_setup_\w+)\(/),D=R?G1(G):null;if(R&&D&&!/\bdata-stx=/.test(D.tag)){G=C1(G,(I,N)=>`<body${N} data-stx="${R[1]}">`);let M=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${R[1]}"`,"i");G=G.replace(M,"$1")}}if(Q){let z=Z.__stx_head_injections??m5(),q=s5(G);if(q!==null)z.beforeClose.push(q);let K=i5(G);if(K!==null)z.afterOpen.push(K);G=k4(G,z);let U=X.app?.colorMode;if(U)G=E4(G,U);G=qG(G)}if(Q){let z=U8(G,"data-stx-runtime");if(z){let q=null,K=null,U=null;try{let{getStoreScript:H}=await o("stx/store-loader",()=>import("./chunk-8fwerspy.js")),j=X.storesDir,B=await H(j);if(B)q=`<script data-stx-stores>${B}</script>`}catch{}try{let{getFrameworkComposableScript:H}=await o("stx/framework-composables",()=>import("./chunk-hm0xha6c.js"));U=await H(G)}catch{}try{let{getComposableScript:H}=await o("stx/composable-loader",()=>import("./chunk-9hjdgm4d.js")),j=X.composablesDir,B=[q,U].filter((F)=>F!==null),V=await H(j,G,B);if(V)K=`<script data-stx-composables>${V}</script>`}catch{}let W=[q,K,U].filter((H)=>H!==null).map((H)=>`
3573
- ${H}`).join("");if(W)G=G.slice(0,z.end)+W+G.slice(z.end)}}if(Q)G=b4(G);if(Q&&Z.__stx_inject_css!==!1)G=await z8(G,void 0,X.buildMode==="serve");if(Q)G=M4(G);return G=G.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),G})}catch(G){if(G instanceof $8)throw G;let z=G instanceof Error?G.message:String(G),q=new N2(`Template processing failed: ${z}`,J,void 0,void 0,$.substring(0,200)+($.length>200?"...":""));if(o0.log(q,{filePath:J,context:Z}),J8.logDetailedError(q,{filePath:J,template:$.substring(0,500)}),X.debug)throw q;return Z8.createFallbackContent("Template Processing",q)}}async function KG($,Z,J,X,Y){let Q=process.cwd(),G={...X,partialsDir:X.partialsDir&&!M0.isAbsolute(X.partialsDir)?M0.resolve(Q,X.partialsDir):X.partialsDir,componentsDir:X.componentsDir&&!M0.isAbsolute(X.componentsDir)?M0.resolve(Q,X.componentsDir):X.componentsDir,layoutsDir:X.layoutsDir&&!M0.isAbsolute(X.layoutsDir)?M0.resolve(Q,X.layoutsDir):X.layoutsDir},z=G,q=$;await HG(J,Z),WG(Z,z),q=await M2(()=>Y4(q,Z,J,z),q,(L)=>{o0.log(L,{filePath:J,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${J}: ${L.message}`)}),q=q.replace(/\{\{--[\s\S]*?--\}\}/g,"");let K=p0(q,Y2,(L,w)=>`\x00STX_HTML_COMMENT_${w}\x00`);q=K.output;let U=K.tokens,W=(L)=>U.length===0?L:L.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(w,R)=>U[Number(R)]??""),H="\x00STX_ESCAPED_AT\x00";q=q.replace(/@@/g,H),q=q.replace(/@\{\{([\s\S]*?)\}\}/g,(L,w)=>{return`{{ ${w} }}`}),q=H4(q),q=await d6(q,J,Y);let j={};q=P5(q,j);let B={...Z.__sections||{}},V="",F=M3(N3($)),O=/@nolayout\b/.test(q)||F===!1;if(/@nolayout\b/.test(q))q=q.replace(/@nolayout\b\s*/g,"");let _=q.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(_)V=_[1],q=q.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof F==="string"){if(V=F,!/@section\s*\(/.test(q))q=`@section('content')
3570
+ <meta name="stx-layout-group" content="${o6(I)}">`)}let R=G.match(/function (__stx_setup_\w+)\(/),D=R?G1(G):null;if(R&&D&&!/\bdata-stx=/.test(D.tag)){G=C1(G,(I,N)=>`<body${N} data-stx="${R[1]}">`);let M=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${R[1]}"`,"i");G=G.replace(M,"$1")}}if(Q){let z=Z.__stx_head_injections??m5(),q=s5(G);if(q!==null)z.beforeClose.push(q);let K=i5(G);if(K!==null)z.afterOpen.push(K);G=k4(G,z);let U=X.app?.colorMode;if(U)G=E4(G,U);G=UG(G)}if(Q){let z=W8(G,"data-stx-runtime");if(z){let q=null,K=null,U=null,W=null;try{let{getStoreScript:j}=await n("stx/store-loader",()=>import("./chunk-4tr92e0v.js")),B=X.storesDir,V=await j(B);if(V)K=`<script data-stx-stores>${V}</script>`}catch{}q=await e6([G,K],X);try{let{getFrameworkComposableScript:j}=await n("stx/framework-composables",()=>import("./chunk-sxderfaa.js"));W=await j(G)}catch{}try{let{getComposableScript:j}=await n("stx/composable-loader",()=>import("./chunk-ak06mywr.js")),B=X.composablesDir,V=[q,K,W].filter((O)=>O!==null),F=await j(B,G,V);if(F)U=`<script data-stx-composables>${F}</script>`}catch{}let H=[q,K,U,W].filter((j)=>j!==null).map((j)=>`
3571
+ ${j}`).join("");if(H)G=G.slice(0,z.end)+H+G.slice(z.end)}else{let q=await e6([G],X);if(q){let K=G.search(/<script\b[^>]*>(?:(?!<\/script>)[\s\S])*?__stxModules\[/i);if(K!==-1)G=G.slice(0,K)+q+`
3572
+ `+G.slice(K)}}}if(Q)G=b4(G);if(Q&&Z.__stx_inject_css!==!1)G=await q8(G,void 0,X.buildMode==="serve");if(Q)G=M4(G);return G=G.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),G})}catch(G){if(G instanceof Z8)throw G;let z=G instanceof Error?G.message:String(G),q=new N2(`Template processing failed: ${z}`,J,void 0,void 0,$.substring(0,200)+($.length>200?"...":""));if(o0.log(q,{filePath:J,context:Z}),X8.logDetailedError(q,{filePath:J,template:$.substring(0,500)}),X.debug)throw q;return J8.createFallbackContent("Template Processing",q)}}async function WG($,Z,J,X,Y){let Q=process.cwd(),G={...X,partialsDir:X.partialsDir&&!M0.isAbsolute(X.partialsDir)?M0.resolve(Q,X.partialsDir):X.partialsDir,componentsDir:X.componentsDir&&!M0.isAbsolute(X.componentsDir)?M0.resolve(Q,X.componentsDir):X.componentsDir,layoutsDir:X.layoutsDir&&!M0.isAbsolute(X.layoutsDir)?M0.resolve(Q,X.layoutsDir):X.layoutsDir},z=G,q=$;await BG(J,Z),jG(Z,z),q=await M2(()=>Y4(q,Z,J,z),q,(L)=>{o0.log(L,{filePath:J,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${J}: ${L.message}`)}),q=q.replace(/\{\{--[\s\S]*?--\}\}/g,"");let K=p0(q,Y2,(L,w)=>`\x00STX_HTML_COMMENT_${w}\x00`);q=K.output;let U=K.tokens,W=(L)=>U.length===0?L:L.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(w,R)=>U[Number(R)]??""),H="\x00STX_ESCAPED_AT\x00";q=q.replace(/@@/g,H),q=q.replace(/@\{\{([\s\S]*?)\}\}/g,(L,w)=>{return`{{ ${w} }}`}),q=H4(q),q=await d6(q,J,Y);let j={};q=P5(q,j);let B={...Z.__sections||{}},V="",F=M3(N3($)),O=/@nolayout\b/.test(q)||F===!1;if(/@nolayout\b/.test(q))q=q.replace(/@nolayout\b\s*/g,"");let _=q.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(_)V=_[1],q=q.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof F==="string"){if(V=F,!/@section\s*\(/.test(q))q=`@section('content')
3574
3573
  ${q.trim()}
3575
3574
  @endsection`}if(!V&&!O&&z.defaultLayout){let L=r5(q),w=/@section\s*\(/.test(q);if(!L||w){let R="",D=M0.dirname(J),M=z.layoutsDir?M0.dirname(z.layoutsDir):process.cwd();for(let I=0;I<20;I++){let N=M0.join(D,"_layout.stx");if(await s(N)){R=N;break}let A=M0.dirname(D);if(A===D||A.length<M.length)break;D=A}if(R)V=R;else if(z.layoutsDir){let I=M0.isAbsolute(z.layoutsDir)?z.layoutsDir:M0.resolve(process.cwd(),z.layoutsDir),N=M0.join(I,`${z.defaultLayout}.stx`);if(await s(N))V=N}if(V&&!w)q=`@section('content')
3576
3575
  ${q.trim()}
3577
3576
  @endsection`}}if(q=q.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(L,w,R)=>{return B[w]=R,""}),q=q.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(L,w,R)=>{if(/^(['"]).*\1$/.test(R.trim()))return L;try{let D=e(R.trim(),Z);if(D===void 0)return L;return B[w]=String(D??""),""}catch{return L}}),q=q.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(L,w,R)=>{if(R.includes("@parent"))B[w]=R.replace("@parent",E1);else B[w]=R.trim();return""}),Z.__sections=B,q=q.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(L,w,R)=>{return B[w]||R||""}),!("slot"in Z)||Z.slot===void 0)q=q.replace(/\{\{\s*slot\s*\}\}/g,()=>{return B.content||""});if(q=v5(q,j),V){let L=[],w=i0(q),R=p0(w.output,y1,(D,M)=>`\x00STX_ORPHAN_STYLE_${M}\x00`);if(q=R.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(D,M,I)=>{let N=M==="SCRIPT"?w.scripts[Number(I)]:R.tokens[Number(I)];if(N)L.push(N);return""}),L.length>0){let D=L.join(`
3578
3577
  `);B.content=B.content?`${B.content}
3579
- ${D}`:D,Z.__sections=B}}if(V)try{let L;if(M0.isAbsolute(V))L=V,Y.add(V);else L=await M2(()=>s2(V,J,G,Y),null,()=>{throw new N2(`Failed to resolve layout path: ${V}`,J,void 0,void 0,`Layout referenced from ${J}`)});if(!L){let N=(k)=>{if(!k)return[];try{let y=M0.isAbsolute(k)?k:M0.resolve(process.cwd(),k);return GG.readdirSync(y).filter((E)=>E.endsWith(".stx")).map((E)=>E.replace(/\.stx$/,""))}catch{return[]}},A=[...N(G.layoutsDir),...N(G.fallbackLayoutsDir)].filter((k,y,E)=>E.indexOf(k)===y).sort(),T=`Layout not found: ${V} (referenced from ${J})`+(A.length>0?`. Available layouts: ${A.join(", ")}`:G.layoutsDir?`. No .stx layouts found in ${G.layoutsDir}`:"");if(o0.log(Error(T),{layoutPath:V,filePath:J,available:A},"error"),console.error(`[stx] ${T}`),G.debug)throw new N2(T,J);return q}let w=await M2(()=>Bun.file(L).text(),"",()=>{throw new N2(`Failed to read layout file: ${L}`,J,void 0,void 0,"Layout content could not be loaded")});w=n6(w,L);let R=w.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(R){if(G.debug)console.log(`Found nested layout: ${R[1]} in ${L}`);let N={},A=w.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(y,E,b)=>{return N[E]=b.trim(),""});for(let[y,E]of Object.entries(N))if(B[y]&&B[y].includes(E1)){let b=B[y].indexOf(E1);B[y]=B[y].slice(0,b)+E+B[y].slice(b+E1.length)}else if(!B[y])B[y]=E;let T={...Z,__sections:B},k=`@layout('${R[1]}')${A}`;return await C$(k,T,L,G,Y)}let D=w.replace(/\{\{--[\s\S]*?--\}\}/g,""),M=P5(D,j),I={};return M=M.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(N,A,T)=>{return I[A]=T.trim(),`@slot('${A}')`}),M=M.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(N,A,T)=>{if(B[A]){let k=B[A];if(k.includes(E1)){let y=I[A]||"",E=k.indexOf(E1);k=k.slice(0,E)+y+k.slice(E+E1.length)}return k}return T||""}),M=UG(M,B),M=M.replace(/\{\{\s*slot\s*\}\}/g,()=>{return B.content||""}),M=v5(M,j),Z.__originalFilePath=J,q=await e6(M,Z,L,G,Y),q=`<!-- stx-layout: ${V} -->
3580
- ${q}`,W(q)}catch(L){return o0.log(L instanceof Error?L:Error(String(L)),{layoutPath:V,filePath:J},"error"),`[Error processing layout: ${L instanceof Error?L.message:String(L)}]`}return W(await e6(q,Z,J,G,Y))}function UG($,Z){return $.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(J,X,Y)=>{let Q=Z[X];if(Q!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${X.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(Q))return Q}return Y||""})}function WG($,Z){if($.__stx_sfc_mode=!0,$.__stx_options=Z,Z.buildMode)$.__stx_buildMode=Z.buildMode;let J=Z.envPrefix||"STX_PUBLIC_",X={};for(let[Y,Q]of Object.entries(process.env))if(Y.startsWith(J)&&Q!==void 0)X[Y]=Q;$.$env=X}async function HG($,Z){await M2(()=>z4($,Z),void 0,(J)=>{o0.log(J,{filePath:$,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${$}: ${J.message}`)})}async function jG($,Z,J){let X=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Y;while((Y=X.exec($))!==null){let Q=Y[1],G=Y[2];if(!/\bserver\b/.test(Q)||!G.trim())continue;try{let{extractVariables:q}=await o("stx/variable-extractor",()=>import("./chunk-t8y1ggdy.js"));await q(G,Z,J,{preserveExisting:!0})}catch(q){let K=q instanceof Error?q:Error(String(q));o0.log(K,{filePath:J,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${J}: ${K.message}`)}}}async function BG($,Z,J){try{let{interpolateScriptsInTemplate:X}=await o("stx/expressions",()=>import("./chunk-g9csmj0s.js"));return X($,Z,{skipServer:!0})}catch(X){let Y=X instanceof Error?X:Error(String(X));return o0.log(Y,{filePath:J,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${J}: ${Y.message}`),$}}async function e6($,Z,J,X,Y){let Q=$,G=X;if(await jG(Q,Z,J),Q=await BG(Q,Z,J),Q=await c7(Q,Z,J),Q=await p7(Q,Z,J),Q=await y7(Q,Z,J,G),Q1(Q))Q=X6(Q,Z),Q=G$(Q,Z);Q=Q6(Q);let{processStreamDirectives:z}=await o("stx/streaming",()=>import("./chunk-9b22663r.js"));Q=z(Q,Z),Q=e7(Q,Z,J,G),Q=await L4(Q,Z,J,G,Y),Q=await A$(Q,Z,J,G,Y),Q=D3(Q,Z,J,G);let{processDeferDirectives:q}=await o("stx/defer",()=>import("./chunk-4122k1bh.js"));Q=q(Q,Z,J);let{processTeleportDirectives:K}=await o("stx/teleport",()=>import("./chunk-bs6kapy7.js"));Q=K(Q,Z,J);let{processTransitionDirectives:U,processTransitionAttributes:W}=await o("stx/transitions",()=>import("./chunk-vrrax298.js"));Q=U(Q,Z,J),Q=W(Q);let{processErrorBoundaryDirectives:H}=await o("stx/error-boundaries",()=>import("./chunk-nnd4wq8j.js"));Q=H(Q,Z,J);let{processSuspenseDirectives:j}=await o("stx/suspense",()=>import("./chunk-rp4rjjmf.js"));Q=j(Q,Z,J);let{processAsyncDirectives:B}=await o("stx/async-components",()=>import("./chunk-dtq7y5ym.js"));Q=B(Q,Z,J);let{processKeepAliveDirectives:V}=await o("stx/keep-alive",()=>import("./chunk-ya386h70.js"));Q=V(Q,Z,J);let{processVirtualListDirectives:F,processVirtualGridDirectives:O,processInfiniteListDirectives:_}=await o("stx/virtual-scrolling",()=>import("./chunk-y98jsjqq.js"));Q=F(Q,Z,J),Q=O(Q,Z,J),Q=_(Q,Z,J);let{processPartialHydrationDirectives:L,processStaticDirectives:w}=await o("stx/partial-hydration",()=>import("./chunk-1kms3b9d.js"));Q=L(Q,Z,J),Q=w(Q);let{processComputedDirectives:R,processWatchDirectives:D}=await o("stx/computed",()=>import("./chunk-mf4n3x1j.js"));Q=R(Q,Z,J),Q=D(Q,Z,J);let{processFormValidationDirectives:M}=await o("stx/forms-validation",()=>import("./chunk-4qr85f07.js"));Q=M(Q,Z,J);let{processHeadDirective:I,processTitleDirective:N,processMetaDirective:A,resetHead:T}=await o("stx/head",()=>import("./chunk-hcq5dw7a.js"));if(!Z.__stx_head_preset&&!Z.__stx_runtime_head)T();let k=I(Q);if(Q=k.content,k.headContent)Z.__stx_head_raw=`${Z.__stx_head_raw||""}${k.headContent}
3581
- `;if(Q=N(Q,Z),Q=A(Q,Z),Q=G4(Q),Q=w5(Q,Z),Q=b7(Q),Q=J4(Q),Q=await S5(Q,Z,J,G,Y),Q=await A$(Q,Z,J,G,Y),Z.__stxProcessingDepth===1)Q=r$(Q,Z);if(Q=Q.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),Q=T$(Q),Q=Z1(Q,Z,J),Q=k3(Q,Z,{filePath:J,buildMode:G.buildMode}),Q=R5(Q,Z),Q=D5(Q,Z),Q=V2(Q,Z),Q=E5(Q,Z),Q=b5(Q,Z),Q=await _7(Q,Z,J,G),Q=await S3(Q,Z,J),Q=await X8(Q,Z,J,G),Q=Y8(Q,Z,J,G),Q=J7(Q,Z,J,G),Q=X7(Q,Z,J),Q=Y7(Q,Z,J,G),Q=T7(Q,Z,J,G),Q=k$(Q,Z),Q=I$(Q),Q=l6(Q),!G.skipEventDirectives)Q=o$(Q,Z,J);if(Q=E3(Q,Z,J),G.debug){let i=/\bx-data\s*=/.test(Q),l=Q$($);if(i&&l)console.warn(`[stx] ${J}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
3578
+ ${D}`:D,Z.__sections=B}}if(V)try{let L;if(M0.isAbsolute(V))L=V,Y.add(V);else L=await M2(()=>s2(V,J,G,Y),null,()=>{throw new N2(`Failed to resolve layout path: ${V}`,J,void 0,void 0,`Layout referenced from ${J}`)});if(!L){let N=(k)=>{if(!k)return[];try{let y=M0.isAbsolute(k)?k:M0.resolve(process.cwd(),k);return qG.readdirSync(y).filter((E)=>E.endsWith(".stx")).map((E)=>E.replace(/\.stx$/,""))}catch{return[]}},A=[...N(G.layoutsDir),...N(G.fallbackLayoutsDir)].filter((k,y,E)=>E.indexOf(k)===y).sort(),T=`Layout not found: ${V} (referenced from ${J})`+(A.length>0?`. Available layouts: ${A.join(", ")}`:G.layoutsDir?`. No .stx layouts found in ${G.layoutsDir}`:"");if(o0.log(Error(T),{layoutPath:V,filePath:J,available:A},"error"),console.error(`[stx] ${T}`),G.debug)throw new N2(T,J);return q}let w=await M2(()=>Bun.file(L).text(),"",()=>{throw new N2(`Failed to read layout file: ${L}`,J,void 0,void 0,"Layout content could not be loaded")});w=n6(w,L);let R=w.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(R){if(G.debug)console.log(`Found nested layout: ${R[1]} in ${L}`);let N={},A=w.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(y,E,b)=>{return N[E]=b.trim(),""});for(let[y,E]of Object.entries(N))if(B[y]&&B[y].includes(E1)){let b=B[y].indexOf(E1);B[y]=B[y].slice(0,b)+E+B[y].slice(b+E1.length)}else if(!B[y])B[y]=E;let T={...Z,__sections:B},k=`@layout('${R[1]}')${A}`;return await C$(k,T,L,G,Y)}let D=w.replace(/\{\{--[\s\S]*?--\}\}/g,""),M=P5(D,j),I={};return M=M.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(N,A,T)=>{return I[A]=T.trim(),`@slot('${A}')`}),M=M.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(N,A,T)=>{if(B[A]){let k=B[A];if(k.includes(E1)){let y=I[A]||"",E=k.indexOf(E1);k=k.slice(0,E)+y+k.slice(E+E1.length)}return k}return T||""}),M=HG(M,B),M=M.replace(/\{\{\s*slot\s*\}\}/g,()=>{return B.content||""}),M=v5(M,j),Z.__originalFilePath=J,q=await $8(M,Z,L,G,Y),q=`<!-- stx-layout: ${V} -->
3579
+ ${q}`,W(q)}catch(L){return o0.log(L instanceof Error?L:Error(String(L)),{layoutPath:V,filePath:J},"error"),`[Error processing layout: ${L instanceof Error?L.message:String(L)}]`}return W(await $8(q,Z,J,G,Y))}function HG($,Z){return $.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(J,X,Y)=>{let Q=Z[X];if(Q!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${X.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(Q))return Q}return Y||""})}function jG($,Z){if($.__stx_sfc_mode=!0,$.__stx_options=Z,Z.buildMode)$.__stx_buildMode=Z.buildMode;let J=Z.envPrefix||"STX_PUBLIC_",X={};for(let[Y,Q]of Object.entries(process.env))if(Y.startsWith(J)&&Q!==void 0)X[Y]=Q;$.$env=X}async function BG($,Z){await M2(()=>z4($,Z),void 0,(J)=>{o0.log(J,{filePath:$,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${$}: ${J.message}`)})}async function VG($,Z,J){let X=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Y;while((Y=X.exec($))!==null){let Q=Y[1],G=Y[2];if(!/\bserver\b/.test(Q)||!G.trim())continue;try{let{extractVariables:q}=await n("stx/variable-extractor",()=>import("./chunk-xvndd7h6.js"));await q(G,Z,J,{preserveExisting:!0})}catch(q){let K=q instanceof Error?q:Error(String(q));o0.log(K,{filePath:J,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${J}: ${K.message}`)}}}async function LG($,Z,J){try{let{interpolateScriptsInTemplate:X}=await n("stx/expressions",()=>import("./chunk-adkjxvy6.js"));return X($,Z,{skipServer:!0})}catch(X){let Y=X instanceof Error?X:Error(String(X));return o0.log(Y,{filePath:J,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${J}: ${Y.message}`),$}}async function $8($,Z,J,X,Y){let Q=$,G=X;if(await VG(Q,Z,J),Q=await LG(Q,Z,J),Q=await c7(Q,Z,J),Q=await p7(Q,Z,J),Q=await y7(Q,Z,J,G),Q1(Q))Q=X6(Q,Z),Q=G$(Q,Z);Q=Q6(Q);let{processStreamDirectives:z}=await n("stx/streaming",()=>import("./chunk-pv9apyrr.js"));Q=z(Q,Z),Q=e7(Q,Z,J,G),Q=await L4(Q,Z,J,G,Y),Q=await A$(Q,Z,J,G,Y),Q=D3(Q,Z,J,G);let{processDeferDirectives:q}=await n("stx/defer",()=>import("./chunk-e7kd0ny8.js"));Q=q(Q,Z,J);let{processTeleportDirectives:K}=await n("stx/teleport",()=>import("./chunk-e0aybavh.js"));Q=K(Q,Z,J);let{processTransitionDirectives:U,processTransitionAttributes:W}=await n("stx/transitions",()=>import("./chunk-vxxxczmn.js"));Q=U(Q,Z,J),Q=W(Q);let{processErrorBoundaryDirectives:H}=await n("stx/error-boundaries",()=>import("./chunk-mc58fhgm.js"));Q=H(Q,Z,J);let{processSuspenseDirectives:j}=await n("stx/suspense",()=>import("./chunk-r90w3x6h.js"));Q=j(Q,Z,J);let{processAsyncDirectives:B}=await n("stx/async-components",()=>import("./chunk-y5jjrnfa.js"));Q=B(Q,Z,J);let{processKeepAliveDirectives:V}=await n("stx/keep-alive",()=>import("./chunk-ym4ggcpy.js"));Q=V(Q,Z,J);let{processVirtualListDirectives:F,processVirtualGridDirectives:O,processInfiniteListDirectives:_}=await n("stx/virtual-scrolling",()=>import("./chunk-zqwmy0av.js"));Q=F(Q,Z,J),Q=O(Q,Z,J),Q=_(Q,Z,J);let{processPartialHydrationDirectives:L,processStaticDirectives:w}=await n("stx/partial-hydration",()=>import("./chunk-jv91rkhx.js"));Q=L(Q,Z,J),Q=w(Q);let{processComputedDirectives:R,processWatchDirectives:D}=await n("stx/computed",()=>import("./chunk-02af607x.js"));Q=R(Q,Z,J),Q=D(Q,Z,J);let{processFormValidationDirectives:M}=await n("stx/forms-validation",()=>import("./chunk-vzzkhjw7.js"));Q=M(Q,Z,J);let{processHeadDirective:I,processTitleDirective:N,processMetaDirective:A,resetHead:T}=await n("stx/head",()=>import("./chunk-zvw2qgwt.js"));if(!Z.__stx_head_preset&&!Z.__stx_runtime_head)T();let k=I(Q);if(Q=k.content,k.headContent)Z.__stx_head_raw=`${Z.__stx_head_raw||""}${k.headContent}
3580
+ `;if(Q=N(Q,Z),Q=A(Q,Z),Q=G4(Q),Q=w5(Q,Z),Q=b7(Q),Q=J4(Q),Q=await S5(Q,Z,J,G,Y),Q=await A$(Q,Z,J,G,Y),Z.__stxProcessingDepth===1)Q=r$(Q,Z);if(Q=Q.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),Q=T$(Q),Q=$1(Q,Z,J),Q=k3(Q,Z,{filePath:J,buildMode:G.buildMode}),Q=R5(Q,Z),Q=D5(Q,Z),Q=V2(Q,Z),Q=E5(Q,Z),Q=b5(Q,Z),Q=await _7(Q,Z,J,G),Q=await S3(Q,Z,J),Q=await Y8(Q,Z,J,G),Q=Q8(Q,Z,J,G),Q=J7(Q,Z,J,G),Q=X7(Q,Z,J),Q=Y7(Q,Z,J,G),Q=T7(Q,Z,J,G),Q=k$(Q,Z),Q=I$(Q),Q=l6(Q),!G.skipEventDirectives)Q=o$(Q,Z,J);if(Q=E3(Q,Z,J),G.debug){let i=/\bx-data\s*=/.test(Q),l=Q$($);if(i&&l)console.warn(`[stx] ${J}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
3582
3581
  Both work on the same page, but they manage separate scopes.
3583
- Prefer signals (state/derived/effect) for new components.`)}Q=U4(Q,Z),Q=await _1(Q,Z,J),Q=p6(Q),Q=i6(Q),Q=B3(Q);let{processXElementDirectives:y}=await o("stx/x-element",()=>import("./chunk-qy73j6m4.js"));Q=y(Q);let E=Z.__originalFilePath||J,b=I9(Z);if(Q=await G6(Q,G,E,b),Q=v7(Q,Z),Q=await Q4(Q,Z,J,G),G.media?.image?.autoSiblings){let i=G.publicDir||"public",{rewriteImagesWithSiblings:l}=await o("stx/image-optimization/auto-sibling",()=>import("./chunk-awkq3xfx.js"));Q=await l(Q,{publicDir:i})}if(G.seo?.enabled)Q=Q7(Q,Z,G);let C=(i,l,K0=!0)=>{if(!l)return i;let J0=l.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),B0=i.match(/<title\b[^>]*>[\s\S]*?<\/title>/i);if(J0&&B0){if(K0)i=i.replace(B0[0],J0[0]);if(l=l.replace(J0[0],"").trim(),!l)return i}if(/<\/head>/i.test(i))return i.replace(/<\/head>/i,`${l}
3582
+ Prefer signals (state/derived/effect) for new components.`)}Q=U4(Q,Z),Q=await _1(Q,Z,J),Q=p6(Q),Q=i6(Q),Q=B3(Q);let{processXElementDirectives:y}=await n("stx/x-element",()=>import("./chunk-kf8t2wq7.js"));Q=y(Q);let E=Z.__originalFilePath||J,b=I9(Z);if(Q=await G6(Q,G,E,b),Q=v7(Q,Z),Q=await Q4(Q,Z,J,G),G.media?.image?.autoSiblings){let i=G.publicDir||"public",{rewriteImagesWithSiblings:l}=await n("stx/image-optimization/auto-sibling",()=>import("./chunk-bw48gj8j.js"));Q=await l(Q,{publicDir:i})}if(G.seo?.enabled)Q=Q7(Q,Z,G);let C=(i,l,K0=!0)=>{if(!l)return i;let J0=l.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),B0=i.match(/<title\b[^>]*>[\s\S]*?<\/title>/i);if(J0&&B0){if(K0)i=i.replace(B0[0],J0[0]);if(l=l.replace(J0[0],"").trim(),!l)return i}if(/<\/head>/i.test(i))return i.replace(/<\/head>/i,`${l}
3584
3583
  </head>`);if(/<head\b[^>]*>/i.test(i))return i.replace(/(<head\b[^>]*>)/i,`$1
3585
3584
  ${l}`);if(/<html\b[^>]*>/i.test(i))return i.replace(/(<html\b[^>]*>)/i,`$1
3586
3585
  <head>
3587
3586
  ${l}
3588
- </head>`);return i},{renderHead:v,getHead:P}=await o("stx/head",()=>import("./chunk-hcq5dw7a.js")),x=Z.__stx_runtime_head??P();if(x.title||x.meta?.length||x.link?.length){let i=v(x);if(i)Q=C(Q,i)}if(k.headContent)Q=C(Q,k.headContent,!x.title);if(G.csp?.enabled&&G.csp.addMetaTag)Q=k7(Q,G.csp,Z);if(G.analytics?.enabled)Q=L3(Q,G);if(G.heatmap?.enabled)Q=O3(Q,G);if(G.pwa?.enabled&&G.pwa.autoInject!==!1){let{injectPwaTags:i}=await o("stx/pwa/inject",()=>import("./chunk-2r1rd8f0.js"));Q=i(Q,G)}let $0=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test(Q),r0=/\bSTX\.\w+/.test(Q),A0=/window\.STX\s*=/.test(Q);if($0&&r0&&!A0){let l=`<script data-stx-scoped data-stx-run="once">
3587
+ </head>`);return i},{renderHead:v,getHead:P}=await n("stx/head",()=>import("./chunk-zvw2qgwt.js")),x=Z.__stx_runtime_head??P();if(x.title||x.meta?.length||x.link?.length){let i=v(x);if(i)Q=C(Q,i)}if(k.headContent)Q=C(Q,k.headContent,!x.title);if(G.csp?.enabled&&G.csp.addMetaTag)Q=k7(Q,G.csp,Z);if(G.analytics?.enabled)Q=L3(Q,G);if(G.heatmap?.enabled)Q=O3(Q,G);if(G.pwa?.enabled&&G.pwa.autoInject!==!1){let{injectPwaTags:i}=await n("stx/pwa/inject",()=>import("./chunk-bzsjhyet.js"));Q=i(Q,G)}let $0=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test(Q),r0=/\bSTX\.\w+/.test(Q),A0=/window\.STX\s*=/.test(Q);if($0&&r0&&!A0){let l=`<script data-stx-scoped data-stx-run="once">
3589
3588
  ${W3()}
3590
3589
  </script>`;if(Q.includes("</head>")){let K0=Q.indexOf("</head>"),B0=Q.slice(0,K0).indexOf("<script");if(B0!==-1){let I0=Q.slice(0,B0),L1=Q.slice(B0);Q=I0+l+`
3591
3590
  `+L1}else Q=Q.replace("</head>",`${l}
3592
3591
  </head>`)}else if(Q.includes("<body"))Q=Q.replace(/<body([^>]*)>/,`<body$1>
3593
3592
  ${l}`);else Q=l+`
3594
- `+Q}{let{scanScriptTags:i}=await o("stx/signal-processing",()=>import("./chunk-d8t4sjsp.js")),l=[];for(let K0 of i(Q)){if(!/\bserver\b/i.test(K0.attrs))continue;let J0=K0.start+K0.fullMatch.indexOf(">")+1,B0=zG(Q,J0);if(B0===-1)continue;let I0=B0+9;while(I0<Q.length&&/\s/.test(Q[I0]))I0++;l.push({start:K0.start,end:I0})}if(l.length>0){let K0=Array(l.length+1),J0=0;for(let B0=0;B0<l.length;B0++){let{start:I0,end:L1}=l[B0];K0[B0]=Q.slice(J0,I0),J0=L1}K0[l.length]=Q.slice(J0),Q=K0.join("")}}let C0=H9(Q,J);if(C0.hasScoped)Q=C0.html;let Z0=Z.__stx_event_bindings||[],H0=!1,k0=[],b0=/\s:[a-z][\w.-]*\s*=/.test(Q),{scanScriptTags:d0}=await o("stx/signal-processing",()=>import("./chunk-d8t4sjsp.js"));for(let i of d0(Q,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))k0.push({match:i.fullMatch,attrs:i.attrs,content:i.body});for(let{match:i,attrs:l,content:K0}of k0){H0=!0;let J0=K0;b$(K0,J,X.strict,Z.__originalFilePath);let B0=await T9(K0,{eventBindings:Z0,attrs:l,hasColonDirectives:b0,templateContent:$,filePath:J,projectRoot:process.cwd(),production:X.buildMode==="compile",serverData:b});Q=Q.replace(i,()=>B0)}if(H0)Z.__stx_event_bindings=[];if(!H0&&Z.__stxProcessingDepth===1){let i=Z.__stx_event_bindings||[];if(i.length>0){let l=v9(i);if(l){let K0=Q.lastIndexOf("</body>");Q=K0===-1?Q+l:Q.slice(0,K0)+l+`
3595
- `+Q.slice(K0)}Z.__stx_event_bindings=[]}}if(!p4(Q)&&i4(Q))Q=await L9(Q,G);if(Q=n4(Q),G.csp?.enabled&&G.csp.useNonce&&typeof Z.cspNonce==="string")Q=I7(Q,Z.cspNonce);return Q}var VG=[{open:"@if",close:"@endif",name:"if"},{open:"@unless",close:"@endunless",name:"unless"},{open:"@foreach",close:"@endforeach",name:"foreach"},{open:"@for",close:"@endfor",name:"for"},{open:"@while",close:"@endwhile",name:"while"},{open:"@forelse",close:"@endforelse",name:"forelse"},{open:"@switch",close:"@endswitch",name:"switch"},{open:"@isset",close:"@endisset",name:"isset"},{open:"@empty",close:"@endempty",name:"empty"},{open:"@auth",close:"@endauth",name:"auth"},{open:"@guest",close:"@endguest",name:"guest"},{open:"@can",close:"@endcan",name:"can"},{open:"@cannot",close:"@endcannot",name:"cannot"},{open:"@section",close:"@endsection",name:"section",altClose:"@show"},{open:"@push",close:"@endpush",name:"push"},{open:"@prepend",close:"@endprepend",name:"prepend"},{open:"@once",close:"@endonce",name:"once"},{open:"@markdown",close:"@endmarkdown",name:"markdown"},{open:"@component",close:"@endcomponent",name:"component"}],LG=[{pattern:/@if\s*[^(]/,message:"@if directive missing parentheses",suggestion:"Use @if(condition)"},{pattern:/@foreach\s*[^(]/,message:"@foreach directive missing parentheses",suggestion:"Use @foreach(items as item)"},{pattern:/@foreach\([^)]*\)\s*[^@\n<]/,message:"@foreach may have content on same line",suggestion:"Put content on new line after @foreach()"},{pattern:/@include\s*[^(]/,message:"@include directive missing parentheses",suggestion:"Use @include('partial-name')"},{pattern:/@extends\s*[^(]/,message:"@extends directive missing parentheses",suggestion:"Use @extends('layout-name') or @layout('layout-name')"},{pattern:/@layout\s*[^(]/,message:"@layout directive missing parentheses",suggestion:"Use @layout('layout-name')"}],_G=[{pattern:/\{\{\s*constructor\s*\}\}/,message:"Attempting to access constructor property"},{pattern:/\{\{\s*__proto__\s*\}\}/,message:"Attempting to access __proto__ property"},{pattern:/\{\{\s*eval\s*\(/,message:"Attempting to use eval in expression"}];function OG($){let Z=[],J=[];return FG($,Z),wG($,Z,J),RG($,J),DG($,Z),{valid:Z.length===0,errors:Z,warnings:J}}function FG($,Z){let J=($.match(/\{\{/g)||[]).length,X=($.match(/\}\}/g)||[]).length;if(J!==X)Z.push({type:"expression",message:`Unclosed expression brackets: found ${J} opening '{{' and ${X} closing '}}'`,suggestion:"Ensure every {{ has a matching }}"})}function wG($,Z,J){for(let X of VG){let Y=new RegExp(`${X.open}(?:\\s|\\()`,"g"),Q=new RegExp(X.close,"g"),G=($.match(Y)||[]).length,z=($.match(Q)||[]).length;if(X.altClose){let q=new RegExp(X.altClose,"g");z+=($.match(q)||[]).length}if(G>z)Z.push({type:"directive",message:`Unclosed @${X.name} directive: found ${G} opening and ${z} closing`,suggestion:`Add ${G-z} missing ${X.close} tag(s)`});else if(z>G)J.push({type:"directive",message:`Extra ${X.close} found: ${z-G} more closing than opening`,suggestion:`Check for orphaned ${X.close} tags`})}}function RG($,Z){for(let J of LG)if(J.pattern.test($))Z.push({type:"syntax",message:J.message,suggestion:J.suggestion})}function DG($,Z){for(let J of _G)if(J.pattern.test($))Z.push({type:"expression",message:`Security warning: ${J.message}`,suggestion:"Remove dangerous code from template expressions"})}function NG($,Z){let J=$.slice(0,Z).split(`
3596
- `);return{line:J.length,column:J[J.length-1].length+1}}function MG($,Z,J){let X=[];switch($){case"if":case"elseif":case"unless":if(J.length===0)X.push({type:"syntax",message:`@${$} requires a condition`,suggestion:`Use @${$}(condition)`});break;case"foreach":if(J.length===0||!J[0].includes(" as "))X.push({type:"syntax",message:'@foreach requires "items as item" syntax',suggestion:"Use @foreach(items as item) or @foreach(items as key => value)"});break;case"for":if(J.length===0)X.push({type:"syntax",message:"@for requires loop parameters",suggestion:"Use @for(let i = 0; i < 10; i++)"});break;case"switch":if(J.length===0)X.push({type:"syntax",message:"@switch requires an expression",suggestion:"Use @switch(expression)"});break;case"case":if(J.length===0)X.push({type:"syntax",message:"@case requires a value",suggestion:"Use @case(value)"});break;case"include":case"extends":case"component":if(J.length===0)X.push({type:"syntax",message:`@${$} requires a path`,suggestion:`Use @${$}('path/to/template')`});break}return X}function AG($){return/@[a-z]+/i.test($)||/\{\{/.test($)}function kG($){let Z=$.matchAll(/@([a-z]+)/gi),J=new Set;for(let X of Z){let Y=X[1].toLowerCase();if(!Y.startsWith("end"))J.add(Y)}return Array.from(J)}import s0 from"path";import J2 from"process";var w8=["module","exports","require","props","$props","defineProps","withDefaults","defineClientPayload","state","derived","effect","batch","onMount","onDestroy","definePageMeta","useRoute","useRouter","useHead","useSeoMeta","setResponseStatus","setResponseHeader","notFound","ref","reactive","computed","watch","onMounted","onUnmounted","nextTick","defineEmits","defineExpose","defineSlots","provide","inject","useColorMode","useDark","useMediaQuery","useScrollLock","usePreferredDark","usePreferredLight","usePreferredReducedMotion","usePreferredContrast","window","document","console","confirm","alert","fetch","params"],W8=new Set(w8),IG=new Set(["props","$props","defineProps"]),TG=new Set(["stx","@stacksjs/stx"]),H8=T1(128),j8=T1(64);function EG($){let Z=[],J=0,X=$.split(`
3597
- `);for(let Y of X){let Q=J,G=null,z=!1;for(let q=0;q<Y.length;q++){let K=Y[q];if(z){z=!1;continue}if(K==="\\"){z=!0;continue}if(G){if(K===G)G=null;continue}if(K==="'"||K==='"'||K==="`"){G=K;continue}if(K==="/"&&q+1<Y.length&&Y[q+1]==="/")break;if(K==="{")J++;else if(K==="}")J--}if(Q===0){let q=Y.match(/(?:const|let|var)\s+(\w+)\s*=/);if(q)Z.push(q[1]);else if(/^\s*(?:const|let|var)\s+\w+\s*;?\s*$/.test(Y)){let K=Y.match(/(?:const|let|var)\s+(\w+)/);if(K)Z.push(K[1])}else{let K=Y.match(/(?:const|let|var)\s+(\{[^}]+\}|\[[^\]]+\])\s*=/);if(K){let W=K[1].slice(1,-1).split(",").map((H)=>{let j=H.split(":");return(j.length>1?j[1]:j[0]).trim()}).filter((H)=>/^\w+$/.test(H));Z.push(...W)}}}}return[...new Set(Z)]}function bG($){let Z=$;Z=Z.replace(/^\s*import\s+.*?from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),Z=Z.replace(/^\s*import\s+['"][^'"]+['"]\s*;?\s*$/gm,""),Z=Z.replace(/^\s*interface\s+\w+\s*\{[\s\S]*?\n\}\s*$/gm,""),Z=Z.replace(/^\s*type\s+\w+\s*=[\s\S]*?(?=\n(?:const|let|var|function|export|interface|type|$))/gm,""),Z=Z.replace(/^(\s*(?:export\s+)?(?:const|let|var)\s+)(\w+|\{[^}]+\}|\[[^\]]+\])\s*:\s*[^=]+(\s*=)/gm,"$1$2$3");function J(X){if(!X.includes(":"))return X;let Y=[],Q="",G=0,z=0,q=null;for(let K=0;K<X.length;K++){let U=X[K];if(q){if(Q+=U,U===q)q=null;continue}if(U==='"'||U==="'"||U==="`"){q=U,Q+=U;continue}if(U==="<")G++;else if(U===">"&&G>0)G--;else if(U==="(")z++;else if(U===")")z--;if(U===","&&G===0&&z===0){Y.push(Q),Q="";continue}Q+=U}if(Q)Y.push(Q);return Y.map((K)=>{let U=K.trim(),W=U.startsWith("..."),H=W?U.slice(3):U,j=-1,B=0;for(let R=0;R<H.length;R++)if(H[R]==="<")B++;else if(H[R]===">")B--;else if(H[R]===":"&&B===0){j=R;break}if(j===-1)return K;let F=H.substring(0,j).trim().replace(/\?$/,""),O=H.substring(j+1),_=-1,L=0;for(let R=0;R<O.length;R++)if(O[R]==="<")L++;else if(O[R]===">")L--;else if(O[R]==="="&&L===0){_=R;break}let w=W?"...":"";if(_!==-1)return`${w}${F} = ${O.substring(_+1).trim()}`;return`${w}${F}`}).join(", ")}Z=Z.replace(/\b(function\s+\w*\s*)\(([^)]*)\)/g,(X,Y,Q)=>{if(!Q.includes(":"))return X;return`${Y}(${J(Q)})`});{let X=/\b(function\s+\w*\s*)\(/g,Y,Q=[];while((Y=X.exec(Z))!==null){let G=Y.index+Y[0].length-1,z=1,q=G+1,K=0,U=null;while(q<Z.length&&z>0){let j=Z[q];if(U){if(j===U)U=null;q++;continue}if(j==='"'||j==="'"||j==="`"){U=j,q++;continue}if(j==="<")K++;else if(j===">"&&K>0)K--;else if(K===0){if(j==="(")z++;else if(j===")")z--}if(z>0)q++}if(z!==0)continue;let W=Z.substring(G+1,q);if(!W.includes(":"))continue;let H=J(W);Q.push({start:G+1,end:q,replacement:H})}for(let G=Q.length-1;G>=0;G--){let{start:z,end:q,replacement:K}=Q[G];Z=Z.substring(0,z)+K+Z.substring(q)}}return Z=Z.replace(/\(([^)]*)\)\s*(?::\s*[^=]+)?\s*=>/g,(X,Y)=>{if(!Y.includes(":"))return X;if(Y.includes("{")||Y.includes("}"))return X;return`(${Y.split(",").map((G)=>{let[z,...q]=G.split("="),K=z.split(":")[0].trim();if(q.length>0)return`${K} = ${q.join("=").trim()}`;return K}).join(", ")}) =>`}),Z=Z.replace(/(\))\s*:\s*([A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined)(?:<[^>]+>)?(?:\s*\|\s*(?:[A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined))*\s*(\{)/g,"$1$3"),Z=Z.replace(/(\b(?:function|class|interface|type|extends|implements)\s+\w+)\s*<[^<>()]*>/g,"$1"),Z=Z.replace(/(\b(?:defineProps|withDefaults|defineEmits|defineSlots|Array|Promise|Map|Set|Record|Partial|Required|Readonly|Pick|Omit|Exclude|Extract))\s*<[^<>()]*>/g,"$1"),Z=Z.replace(/(\w+)\s*<[A-Z][^<>()]*>\s*(?=\()/g,"$1"),Z=Z.replace(/\s+as\s+(?:const|[A-Za-z]\w*(?:\[\])?(?:\s*\|\s*\w+(?:\[\])?)*)/g,""),Z=Z.replace(/\s+satisfies\s+\w+(?:<[^>]*>)?/g,""),Z=Z.replace(/(\w|\)|\])\s*!(?!=)/g,"$1"),Z=Z.replace(/^\s*(?:export\s+)?(?:const\s+)?enum\s+\w+\s*\{[^}]*\}\s*$/gm,""),Z=Z.replace(/(?<=[\s=,(])<[A-Z]\w*(?:\[\])?>/g,""),Z=Z.replace(/\n\s*\n\s*\n/g,`
3593
+ `+Q}{let{scanScriptTags:i}=await n("stx/signal-processing",()=>import("./chunk-rb87b7kr.js")),l=[];for(let K0 of i(Q)){if(!/\bserver\b/i.test(K0.attrs))continue;let J0=K0.start+K0.fullMatch.indexOf(">")+1,B0=KG(Q,J0);if(B0===-1)continue;let I0=B0+9;while(I0<Q.length&&/\s/.test(Q[I0]))I0++;l.push({start:K0.start,end:I0})}if(l.length>0){let K0=Array(l.length+1),J0=0;for(let B0=0;B0<l.length;B0++){let{start:I0,end:L1}=l[B0];K0[B0]=Q.slice(J0,I0),J0=L1}K0[l.length]=Q.slice(J0),Q=K0.join("")}}let C0=H9(Q,J);if(C0.hasScoped)Q=C0.html;let Z0=Z.__stx_event_bindings||[],H0=!1,k0=[],b0=/\s:[a-z][\w.-]*\s*=/.test(Q),{scanScriptTags:d0}=await n("stx/signal-processing",()=>import("./chunk-rb87b7kr.js"));for(let i of d0(Q,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))k0.push({match:i.fullMatch,attrs:i.attrs,content:i.body});for(let{match:i,attrs:l,content:K0}of k0){H0=!0;let J0=K0;b$(K0,J,X.strict,Z.__originalFilePath);let B0=await T9(K0,{eventBindings:Z0,attrs:l,hasColonDirectives:b0,templateContent:$,filePath:J,projectRoot:process.cwd(),production:X.buildMode==="compile",serverData:b});Q=Q.replace(i,()=>B0)}if(H0)Z.__stx_event_bindings=[];if(!H0&&Z.__stxProcessingDepth===1){let i=Z.__stx_event_bindings||[];if(i.length>0){let l=v9(i);if(l){let K0=Q.lastIndexOf("</body>");Q=K0===-1?Q+l:Q.slice(0,K0)+l+`
3594
+ `+Q.slice(K0)}Z.__stx_event_bindings=[]}}if(!p4(Q)&&i4(Q))Q=await L9(Q,G);if(Q=n4(Q),G.csp?.enabled&&G.csp.useNonce&&typeof Z.cspNonce==="string")Q=I7(Q,Z.cspNonce);return Q}var _G=[{open:"@if",close:"@endif",name:"if"},{open:"@unless",close:"@endunless",name:"unless"},{open:"@foreach",close:"@endforeach",name:"foreach"},{open:"@for",close:"@endfor",name:"for"},{open:"@while",close:"@endwhile",name:"while"},{open:"@forelse",close:"@endforelse",name:"forelse"},{open:"@switch",close:"@endswitch",name:"switch"},{open:"@isset",close:"@endisset",name:"isset"},{open:"@empty",close:"@endempty",name:"empty"},{open:"@auth",close:"@endauth",name:"auth"},{open:"@guest",close:"@endguest",name:"guest"},{open:"@can",close:"@endcan",name:"can"},{open:"@cannot",close:"@endcannot",name:"cannot"},{open:"@section",close:"@endsection",name:"section",altClose:"@show"},{open:"@push",close:"@endpush",name:"push"},{open:"@prepend",close:"@endprepend",name:"prepend"},{open:"@once",close:"@endonce",name:"once"},{open:"@markdown",close:"@endmarkdown",name:"markdown"},{open:"@component",close:"@endcomponent",name:"component"}],OG=[{pattern:/@if\s*[^(]/,message:"@if directive missing parentheses",suggestion:"Use @if(condition)"},{pattern:/@foreach\s*[^(]/,message:"@foreach directive missing parentheses",suggestion:"Use @foreach(items as item)"},{pattern:/@foreach\([^)]*\)\s*[^@\n<]/,message:"@foreach may have content on same line",suggestion:"Put content on new line after @foreach()"},{pattern:/@include\s*[^(]/,message:"@include directive missing parentheses",suggestion:"Use @include('partial-name')"},{pattern:/@extends\s*[^(]/,message:"@extends directive missing parentheses",suggestion:"Use @extends('layout-name') or @layout('layout-name')"},{pattern:/@layout\s*[^(]/,message:"@layout directive missing parentheses",suggestion:"Use @layout('layout-name')"}],FG=[{pattern:/\{\{\s*constructor\s*\}\}/,message:"Attempting to access constructor property"},{pattern:/\{\{\s*__proto__\s*\}\}/,message:"Attempting to access __proto__ property"},{pattern:/\{\{\s*eval\s*\(/,message:"Attempting to use eval in expression"}];function wG($){let Z=[],J=[];return RG($,Z),DG($,Z,J),NG($,J),MG($,Z),{valid:Z.length===0,errors:Z,warnings:J}}function RG($,Z){let J=($.match(/\{\{/g)||[]).length,X=($.match(/\}\}/g)||[]).length;if(J!==X)Z.push({type:"expression",message:`Unclosed expression brackets: found ${J} opening '{{' and ${X} closing '}}'`,suggestion:"Ensure every {{ has a matching }}"})}function DG($,Z,J){for(let X of _G){let Y=new RegExp(`${X.open}(?:\\s|\\()`,"g"),Q=new RegExp(X.close,"g"),G=($.match(Y)||[]).length,z=($.match(Q)||[]).length;if(X.altClose){let q=new RegExp(X.altClose,"g");z+=($.match(q)||[]).length}if(G>z)Z.push({type:"directive",message:`Unclosed @${X.name} directive: found ${G} opening and ${z} closing`,suggestion:`Add ${G-z} missing ${X.close} tag(s)`});else if(z>G)J.push({type:"directive",message:`Extra ${X.close} found: ${z-G} more closing than opening`,suggestion:`Check for orphaned ${X.close} tags`})}}function NG($,Z){for(let J of OG)if(J.pattern.test($))Z.push({type:"syntax",message:J.message,suggestion:J.suggestion})}function MG($,Z){for(let J of FG)if(J.pattern.test($))Z.push({type:"expression",message:`Security warning: ${J.message}`,suggestion:"Remove dangerous code from template expressions"})}function AG($,Z){let J=$.slice(0,Z).split(`
3595
+ `);return{line:J.length,column:J[J.length-1].length+1}}function kG($,Z,J){let X=[];switch($){case"if":case"elseif":case"unless":if(J.length===0)X.push({type:"syntax",message:`@${$} requires a condition`,suggestion:`Use @${$}(condition)`});break;case"foreach":if(J.length===0||!J[0].includes(" as "))X.push({type:"syntax",message:'@foreach requires "items as item" syntax',suggestion:"Use @foreach(items as item) or @foreach(items as key => value)"});break;case"for":if(J.length===0)X.push({type:"syntax",message:"@for requires loop parameters",suggestion:"Use @for(let i = 0; i < 10; i++)"});break;case"switch":if(J.length===0)X.push({type:"syntax",message:"@switch requires an expression",suggestion:"Use @switch(expression)"});break;case"case":if(J.length===0)X.push({type:"syntax",message:"@case requires a value",suggestion:"Use @case(value)"});break;case"include":case"extends":case"component":if(J.length===0)X.push({type:"syntax",message:`@${$} requires a path`,suggestion:`Use @${$}('path/to/template')`});break}return X}function IG($){return/@[a-z]+/i.test($)||/\{\{/.test($)}function TG($){let Z=$.matchAll(/@([a-z]+)/gi),J=new Set;for(let X of Z){let Y=X[1].toLowerCase();if(!Y.startsWith("end"))J.add(Y)}return Array.from(J)}import s0 from"path";import J2 from"process";var R8=["module","exports","require","props","$props","defineProps","withDefaults","defineClientPayload","state","derived","effect","batch","onMount","onDestroy","definePageMeta","useRoute","useRouter","useHead","useSeoMeta","setResponseStatus","setResponseHeader","notFound","ref","reactive","computed","watch","onMounted","onUnmounted","nextTick","defineEmits","defineExpose","defineSlots","provide","inject","useColorMode","useDark","useMediaQuery","useScrollLock","usePreferredDark","usePreferredLight","usePreferredReducedMotion","usePreferredContrast","window","document","console","confirm","alert","fetch","params"],H8=new Set(R8),EG=new Set(["props","$props","defineProps"]),bG=new Set(["stx","@stacksjs/stx"]),j8=T1(128),B8=T1(64);function yG($){let Z=[],J=0,X=$.split(`
3596
+ `);for(let Y of X){let Q=J,G=null,z=!1;for(let q=0;q<Y.length;q++){let K=Y[q];if(z){z=!1;continue}if(K==="\\"){z=!0;continue}if(G){if(K===G)G=null;continue}if(K==="'"||K==='"'||K==="`"){G=K;continue}if(K==="/"&&q+1<Y.length&&Y[q+1]==="/")break;if(K==="{")J++;else if(K==="}")J--}if(Q===0){let q=Y.match(/(?:const|let|var)\s+(\w+)\s*=/);if(q)Z.push(q[1]);else if(/^\s*(?:const|let|var)\s+\w+\s*;?\s*$/.test(Y)){let K=Y.match(/(?:const|let|var)\s+(\w+)/);if(K)Z.push(K[1])}else{let K=Y.match(/(?:const|let|var)\s+(\{[^}]+\}|\[[^\]]+\])\s*=/);if(K){let W=K[1].slice(1,-1).split(",").map((H)=>{let j=H.split(":");return(j.length>1?j[1]:j[0]).trim()}).filter((H)=>/^\w+$/.test(H));Z.push(...W)}}}}return[...new Set(Z)]}function CG($){let Z=$;Z=Z.replace(/^\s*import\s+.*?from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),Z=Z.replace(/^\s*import\s+['"][^'"]+['"]\s*;?\s*$/gm,""),Z=Z.replace(/^\s*interface\s+\w+\s*\{[\s\S]*?\n\}\s*$/gm,""),Z=Z.replace(/^\s*type\s+\w+\s*=[\s\S]*?(?=\n(?:const|let|var|function|export|interface|type|$))/gm,""),Z=Z.replace(/^(\s*(?:export\s+)?(?:const|let|var)\s+)(\w+|\{[^}]+\}|\[[^\]]+\])\s*:\s*[^=]+(\s*=)/gm,"$1$2$3");function J(X){if(!X.includes(":"))return X;let Y=[],Q="",G=0,z=0,q=null;for(let K=0;K<X.length;K++){let U=X[K];if(q){if(Q+=U,U===q)q=null;continue}if(U==='"'||U==="'"||U==="`"){q=U,Q+=U;continue}if(U==="<")G++;else if(U===">"&&G>0)G--;else if(U==="(")z++;else if(U===")")z--;if(U===","&&G===0&&z===0){Y.push(Q),Q="";continue}Q+=U}if(Q)Y.push(Q);return Y.map((K)=>{let U=K.trim(),W=U.startsWith("..."),H=W?U.slice(3):U,j=-1,B=0;for(let R=0;R<H.length;R++)if(H[R]==="<")B++;else if(H[R]===">")B--;else if(H[R]===":"&&B===0){j=R;break}if(j===-1)return K;let F=H.substring(0,j).trim().replace(/\?$/,""),O=H.substring(j+1),_=-1,L=0;for(let R=0;R<O.length;R++)if(O[R]==="<")L++;else if(O[R]===">")L--;else if(O[R]==="="&&L===0){_=R;break}let w=W?"...":"";if(_!==-1)return`${w}${F} = ${O.substring(_+1).trim()}`;return`${w}${F}`}).join(", ")}Z=Z.replace(/\b(function\s+\w*\s*)\(([^)]*)\)/g,(X,Y,Q)=>{if(!Q.includes(":"))return X;return`${Y}(${J(Q)})`});{let X=/\b(function\s+\w*\s*)\(/g,Y,Q=[];while((Y=X.exec(Z))!==null){let G=Y.index+Y[0].length-1,z=1,q=G+1,K=0,U=null;while(q<Z.length&&z>0){let j=Z[q];if(U){if(j===U)U=null;q++;continue}if(j==='"'||j==="'"||j==="`"){U=j,q++;continue}if(j==="<")K++;else if(j===">"&&K>0)K--;else if(K===0){if(j==="(")z++;else if(j===")")z--}if(z>0)q++}if(z!==0)continue;let W=Z.substring(G+1,q);if(!W.includes(":"))continue;let H=J(W);Q.push({start:G+1,end:q,replacement:H})}for(let G=Q.length-1;G>=0;G--){let{start:z,end:q,replacement:K}=Q[G];Z=Z.substring(0,z)+K+Z.substring(q)}}return Z=Z.replace(/\(([^)]*)\)\s*(?::\s*[^=]+)?\s*=>/g,(X,Y)=>{if(!Y.includes(":"))return X;if(Y.includes("{")||Y.includes("}"))return X;return`(${Y.split(",").map((G)=>{let[z,...q]=G.split("="),K=z.split(":")[0].trim();if(q.length>0)return`${K} = ${q.join("=").trim()}`;return K}).join(", ")}) =>`}),Z=Z.replace(/(\))\s*:\s*([A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined)(?:<[^>]+>)?(?:\s*\|\s*(?:[A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined))*\s*(\{)/g,"$1$3"),Z=Z.replace(/(\b(?:function|class|interface|type|extends|implements)\s+\w+)\s*<[^<>()]*>/g,"$1"),Z=Z.replace(/(\b(?:defineProps|withDefaults|defineEmits|defineSlots|Array|Promise|Map|Set|Record|Partial|Required|Readonly|Pick|Omit|Exclude|Extract))\s*<[^<>()]*>/g,"$1"),Z=Z.replace(/(\w+)\s*<[A-Z][^<>()]*>\s*(?=\()/g,"$1"),Z=Z.replace(/\s+as\s+(?:const|[A-Za-z]\w*(?:\[\])?(?:\s*\|\s*\w+(?:\[\])?)*)/g,""),Z=Z.replace(/\s+satisfies\s+\w+(?:<[^>]*>)?/g,""),Z=Z.replace(/(\w|\)|\])\s*!(?!=)/g,"$1"),Z=Z.replace(/^\s*(?:export\s+)?(?:const\s+)?enum\s+\w+\s*\{[^}]*\}\s*$/gm,""),Z=Z.replace(/(?<=[\s=,(])<[A-Z]\w*(?:\[\])?>/g,""),Z=Z.replace(/\n\s*\n\s*\n/g,`
3598
3597
 
3599
- `),Z}function yG($){return/cannot find module|could not resolve|module not found|failed to resolve/i.test($)}function CG($){if(!/is not defined|can't find variable/i.test($))return!1;return!/\b(document|window|navigator|localStorage|sessionStorage|self)\b/.test($)}async function SG($,Z,J,X={}){if(!$.trim())return;let Y=$2(),Q=V1($,JSON.stringify(Y)),G=H8.get(Q);if(G===void 0){try{let S=P$({loader:"ts",target:"browser",define:Y}),f=$.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");f=f.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,""),G=S.transformSync(f)}catch{G=bG($)}H8.set(Q,G)}let z={exports:{}},q=z.exports,K=J2.cwd(),U={},W=[...G.matchAll(/require\s*\(\s*['"]([^'"]+)['"]\s*\)/g)||[]].map((S)=>S[1]).filter((S)=>!S.startsWith("node:")&&!["fs","path","os","child_process","crypto","http","https","url","util","stream","events","buffer","net","querystring","zlib","tls"].includes(S)),H=new Map;for(let S of W)try{if(S.startsWith(".")){U[S]=await import(s0.resolve(s0.dirname(J),S));continue}let f=s0.resolve(K,"node_modules",S),c=s0.join(f,"package.json"),t=JSON.parse(u("fs").readFileSync(c,"utf8")),G0=t.main||"index.js";if(t.exports){let X0=typeof t.exports==="string"?t.exports:t.exports["."];if(typeof X0==="string")G0=X0;else if(X0?.bun)G0=X0.bun;else if(X0?.import)G0=X0.import;else if(X0?.default)G0=X0.default}U[S]=await import(s0.resolve(f,G0))}catch(f){if(S.startsWith("."))H.set(S,f instanceof Error?f.message:String(f))}let j=(S)=>{if(U[S])return U[S];let f=H.get(S);if(f!==void 0)throw Error(`Cannot require '${S}' from ${J}: ${f}`);return u(S)},B=Z.props||{},V=(S)=>{if(!S)return B;let f={};for(let[c,t]of Object.entries(S)){let G0=B[c];if(G0!==void 0)f[c]=G0;else if(typeof t==="function")f[c]=t();else f[c]=t}return f};for(let[S,f]of Object.entries(B))Object.defineProperty(V,S,{value:f,enumerable:!0,configurable:!0,writable:!0});for(let S of["name","length","caller","arguments"]){if(Object.prototype.hasOwnProperty.call(B,S))continue;try{Object.defineProperty(V,S,{value:void 0,enumerable:!1,configurable:!0,writable:!0})}catch{}}let F=(S)=>{if(!S)return B;let f={...B};for(let[c,t]of Object.entries(S)){let G0=t&&typeof t==="object"&&!Array.isArray(t)?t:{type:t};if(f[c]===void 0&&G0.default!==void 0)f[c]=typeof G0.default==="function"?G0.default():G0.default}return f},O=()=>Z.slots||{},_=(S,f)=>{let c={...S};for(let[t,G0]of Object.entries(f))if(c[t]===void 0)if(typeof G0==="function")c[t]=G0();else c[t]=G0;return c},L=(S)=>{let f=()=>S;return f.set=(c)=>{},f.update=(c)=>{},f},w=(S)=>{let f,c=!1;return()=>{if(!c)try{f=S(),c=!0}catch{f=void 0}return f}},R=(S)=>{},D=(S)=>S(),M=(S)=>{},I=(S)=>{},N=A3(Z);function A(S){let f=S||{};if(f.title!==void 0||f.description!==void 0)b({title:f.title,description:f.description})}function T(S){if(!S||typeof S!=="object")return;let f=Z.__stxClientPayload??{};Object.assign(f,S),Z.__stxClientPayload=f}let k=()=>{let S=Z.__stxServeContext,f=Z.__stxServeSearch??S?.search??"",c=S?.path??"",t=Object.fromEntries(new URLSearchParams(f)),G0=Z.query,X0=Object.keys(t).length>0?t:G0??{},d=f||(Object.keys(X0).length>0?`?${new URLSearchParams(X0).toString()}`:"");return{params:Z.params??{},query:X0,path:c,name:"",fullPath:c+d,hash:"",matched:[]}},y=()=>({push:(S)=>{},replace:(S)=>{},back:()=>{},forward:()=>{},go:(S)=>{}}),E=(S)=>{let f=Z.__stx_runtime_head||{};Z.__stx_runtime_head=o2(f,S||{})},b=(S)=>{E(F8(S||{}))},C=(S)=>({value:S}),v=(S)=>S,P=(S)=>({value:typeof S==="function"?S():S}),g=(S,f)=>{},x=(S)=>{},$0=(S)=>{},r0=(S)=>S?S():Promise.resolve(),A0=(S)=>(f,...c)=>{},C0=(S)=>{},Z0=(S,f)=>{},H0=(S,f)=>f,k0=()=>({value:"light"}),b0=()=>L(!1),d0=(S)=>L(!1),i=()=>L(!1),l=()=>d0("(prefers-color-scheme: dark)"),K0=()=>d0("(prefers-color-scheme: light)"),J0=()=>d0("(prefers-reduced-motion: reduce)"),B0=()=>d0("(prefers-contrast: more)"),I0={siteId:void 0,API_ENDPOINT:"",ANALYTICS_SITE_ID:void 0,location:{href:"",pathname:"",search:"",hash:"",origin:"",host:"",hostname:"",protocol:"https:",assign:()=>{},replace:()=>{},reload:()=>{}},localStorage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{}},sessionStorage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{}},fetch:globalThis.fetch,addEventListener:()=>{},removeEventListener:()=>{},setTimeout:()=>0,clearTimeout:()=>{},setInterval:()=>0,clearInterval:()=>{},requestAnimationFrame:()=>0,cancelAnimationFrame:()=>{},alert:()=>{},confirm:()=>!1,prompt:()=>null,getComputedStyle:()=>({}),matchMedia:()=>({matches:!1,addListener:()=>{},removeListener:()=>{}}),getDateRangeParams:()=>"",stx:{}},L1=new Proxy(I0,{get(S,f){if(f in S)return S[f];return},set(S,f,c){return S[f]=c,!0}}),I2={getElementById:()=>null,querySelector:()=>null,querySelectorAll:()=>[],createElement:()=>({}),createTextNode:()=>({}),body:{},head:{},documentElement:{},addEventListener:()=>{},removeEventListener:()=>{}},T2=console;try{let S=R8(G,J),f=new Set(Object.keys(B)),c=Object.keys(Z).filter((r)=>!f.has(r)&&!IG.has(r)&&X2(r)),t=c.map((r)=>Z[r]);if(!c.includes("__stxServeContext"))c.push("__stxServeContext"),t.push(void 0);let G0=new Set(["async","module","exports","require","params","window","document","console","state","derived","effect"]),X0=[],d=[];for(let[r,t0]of Object.entries(B)){if(!X2(r))continue;if(G0.has(r))continue;if(new RegExp(`(?:^|[\\s;{])(?:const|let|var|function)\\s+${r}\\b`).test(S))continue;X0.push(r),d.push(t0)}let z0=EG(S).map((r)=>`module.exports.${r} = typeof ${r} !== 'undefined' ? ${r} : module.exports.${r};`).join(`
3600
- `),n=Z.params??{},V0=[],w0=[];for(let r=0;r<c.length;r++){if(c[r]==="params")continue;V0.push(c[r]),w0.push(t[r])}let S0=[...w8,...X0,...V0],a0=`return (async () => {
3598
+ `),Z}function SG($){return/cannot find module|could not resolve|module not found|failed to resolve/i.test($)}function PG($){if(!/is not defined|can't find variable/i.test($))return!1;return!/\b(document|window|navigator|localStorage|sessionStorage|self)\b/.test($)}async function vG($,Z,J,X={}){if(!$.trim())return;let Y=$2(),Q=V1($,JSON.stringify(Y)),G=j8.get(Q);if(G===void 0){try{let S=P$({loader:"ts",target:"browser",define:Y}),f=$.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");f=f.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,""),G=S.transformSync(f)}catch{G=CG($)}j8.set(Q,G)}let z={exports:{}},q=z.exports,K=J2.cwd(),U={},W=[...G.matchAll(/require\s*\(\s*['"]([^'"]+)['"]\s*\)/g)||[]].map((S)=>S[1]).filter((S)=>!S.startsWith("node:")&&!["fs","path","os","child_process","crypto","http","https","url","util","stream","events","buffer","net","querystring","zlib","tls"].includes(S)),H=new Map;for(let S of W)try{if(S.startsWith(".")){U[S]=await import(s0.resolve(s0.dirname(J),S));continue}let f=s0.resolve(K,"node_modules",S),c=s0.join(f,"package.json"),t=JSON.parse(u("fs").readFileSync(c,"utf8")),G0=t.main||"index.js";if(t.exports){let X0=typeof t.exports==="string"?t.exports:t.exports["."];if(typeof X0==="string")G0=X0;else if(X0?.bun)G0=X0.bun;else if(X0?.import)G0=X0.import;else if(X0?.default)G0=X0.default}U[S]=await import(s0.resolve(f,G0))}catch(f){if(S.startsWith("."))H.set(S,f instanceof Error?f.message:String(f))}let j=(S)=>{if(U[S])return U[S];let f=H.get(S);if(f!==void 0)throw Error(`Cannot require '${S}' from ${J}: ${f}`);return u(S)},B=Z.props||{},V=(S)=>{if(!S)return B;let f={};for(let[c,t]of Object.entries(S)){let G0=B[c];if(G0!==void 0)f[c]=G0;else if(typeof t==="function")f[c]=t();else f[c]=t}return f};for(let[S,f]of Object.entries(B))Object.defineProperty(V,S,{value:f,enumerable:!0,configurable:!0,writable:!0});for(let S of["name","length","caller","arguments"]){if(Object.prototype.hasOwnProperty.call(B,S))continue;try{Object.defineProperty(V,S,{value:void 0,enumerable:!1,configurable:!0,writable:!0})}catch{}}let F=(S)=>{if(!S)return B;let f={...B};for(let[c,t]of Object.entries(S)){let G0=t&&typeof t==="object"&&!Array.isArray(t)?t:{type:t};if(f[c]===void 0&&G0.default!==void 0)f[c]=typeof G0.default==="function"?G0.default():G0.default}return f},O=()=>Z.slots||{},_=(S,f)=>{let c={...S};for(let[t,G0]of Object.entries(f))if(c[t]===void 0)if(typeof G0==="function")c[t]=G0();else c[t]=G0;return c},L=(S)=>{let f=()=>S;return f.set=(c)=>{},f.update=(c)=>{},f},w=(S)=>{let f,c=!1;return()=>{if(!c)try{f=S(),c=!0}catch{f=void 0}return f}},R=(S)=>{},D=(S)=>S(),M=(S)=>{},I=(S)=>{},N=A3(Z);function A(S){let f=S||{};if(f.title!==void 0||f.description!==void 0)b({title:f.title,description:f.description})}function T(S){if(!S||typeof S!=="object")return;let f=Z.__stxClientPayload??{};Object.assign(f,S),Z.__stxClientPayload=f}let k=()=>{let S=Z.__stxServeContext,f=Z.__stxServeSearch??S?.search??"",c=S?.path??"",t=Object.fromEntries(new URLSearchParams(f)),G0=Z.query,X0=Object.keys(t).length>0?t:G0??{},d=f||(Object.keys(X0).length>0?`?${new URLSearchParams(X0).toString()}`:"");return{params:Z.params??{},query:X0,path:c,name:"",fullPath:c+d,hash:"",matched:[]}},y=()=>({push:(S)=>{},replace:(S)=>{},back:()=>{},forward:()=>{},go:(S)=>{}}),E=(S)=>{let f=Z.__stx_runtime_head||{};Z.__stx_runtime_head=o2(f,S||{})},b=(S)=>{E(w8(S||{}))},C=(S)=>({value:S}),v=(S)=>S,P=(S)=>({value:typeof S==="function"?S():S}),g=(S,f)=>{},x=(S)=>{},$0=(S)=>{},r0=(S)=>S?S():Promise.resolve(),A0=(S)=>(f,...c)=>{},C0=(S)=>{},Z0=(S,f)=>{},H0=(S,f)=>f,k0=()=>({value:"light"}),b0=()=>L(!1),d0=(S)=>L(!1),i=()=>L(!1),l=()=>d0("(prefers-color-scheme: dark)"),K0=()=>d0("(prefers-color-scheme: light)"),J0=()=>d0("(prefers-reduced-motion: reduce)"),B0=()=>d0("(prefers-contrast: more)"),I0={siteId:void 0,API_ENDPOINT:"",ANALYTICS_SITE_ID:void 0,location:{href:"",pathname:"",search:"",hash:"",origin:"",host:"",hostname:"",protocol:"https:",assign:()=>{},replace:()=>{},reload:()=>{}},localStorage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{}},sessionStorage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{}},fetch:globalThis.fetch,addEventListener:()=>{},removeEventListener:()=>{},setTimeout:()=>0,clearTimeout:()=>{},setInterval:()=>0,clearInterval:()=>{},requestAnimationFrame:()=>0,cancelAnimationFrame:()=>{},alert:()=>{},confirm:()=>!1,prompt:()=>null,getComputedStyle:()=>({}),matchMedia:()=>({matches:!1,addListener:()=>{},removeListener:()=>{}}),getDateRangeParams:()=>"",stx:{}},L1=new Proxy(I0,{get(S,f){if(f in S)return S[f];return},set(S,f,c){return S[f]=c,!0}}),I2={getElementById:()=>null,querySelector:()=>null,querySelectorAll:()=>[],createElement:()=>({}),createTextNode:()=>({}),body:{},head:{},documentElement:{},addEventListener:()=>{},removeEventListener:()=>{}},T2=console;try{let S=D8(G,J),f=new Set(Object.keys(B)),c=Object.keys(Z).filter((r)=>!f.has(r)&&!EG.has(r)&&X2(r)),t=c.map((r)=>Z[r]);if(!c.includes("__stxServeContext"))c.push("__stxServeContext"),t.push(void 0);let G0=new Set(["async","module","exports","require","params","window","document","console","state","derived","effect"]),X0=[],d=[];for(let[r,t0]of Object.entries(B)){if(!X2(r))continue;if(G0.has(r))continue;if(new RegExp(`(?:^|[\\s;{])(?:const|let|var|function)\\s+${r}\\b`).test(S))continue;X0.push(r),d.push(t0)}let z0=yG(S).map((r)=>`module.exports.${r} = typeof ${r} !== 'undefined' ? ${r} : module.exports.${r};`).join(`
3599
+ `),o=Z.params??{},V0=[],w0=[];for(let r=0;r<c.length;r++){if(c[r]==="params")continue;V0.push(c[r]),w0.push(t[r])}let S0=[...R8,...X0,...V0],a0=`return (async () => {
3601
3600
  ${S}
3602
3601
  ${z0}
3603
3602
  return module.exports
3604
- })()`,y0=V1(a0,S0.join("\x00")),c0=j8.get(y0);if(!c0)c0=Function(...S0,a0),j8.set(y0,c0);let X1=await c0(z,q,j,B,V,F,_,T,L,w,R,D,M,I,A,k,y,E,b,N.setResponseStatus,N.setResponseHeader,N.notFound,C,v,P,g,x,$0,r0,A0,C0,O,Z0,H0,k0,b0,d0,i,l,K0,J0,B0,L1,I2,T2,I0.confirm,I0.alert,I0.fetch,n,...d,...w0);if(X.preserveExisting){for(let[r,t0]of Object.entries(X1))if(!(r in Z)||Z[r]===void 0)Z[r]=t0}else Object.assign(Z,X1);for(let[r,t0]of Object.entries(B))if(!(r in Z))Z[r]=t0}catch(S){let f=S instanceof Error?S.message:String(S);if(yG(f))console.warn(`[stx] server <script> in ${J??"<unknown>"} imports a module that does not resolve, so every variable in that script is undefined. Cause: ${f}`);else if(CG(f))console.warn(`[stx] server <script> in ${J??"<unknown>"} names something that does not exist, so every variable in that script is undefined. Optional chaining does not help here: an undefined identifier throws before the chain is reached. Cause: ${f}`);else if(J2.env.STX_DEBUG)console.warn(`[stx] server <script> did not execute in ${J??"<unknown>"} \u2014 falling back to static extraction. Cause: ${f}`);try{await dG(G,Z,J)}catch(c){if(J2.env.STX_DEBUG){let t=c instanceof Error?c.message:String(c);console.warn(`[stx] fallback extraction also failed in ${J??"<unknown>"}: ${t}`)}}}}function PG($){let Z=0,J=null,X=!1,Y=!1;for(let Q=0;Q<$.length;Q++){let G=$[Q];if(J){if(G===J){if(J=null,X||Z===0)Y=!0}continue}if(G==="'"||G==='"'||G==="`"){J=G;continue}if(G==="{")Z++;else if(G==="}")Z--;else if($.startsWith("from",Q)&&Z===0)X=!0}return J===null&&Z===0&&Y}var vG=/^(?:export\s+)?(?:const|let|var)\s+[A-Za-z_$][\w$]*(?:\s*,\s*[A-Za-z_$][\w$]*)*\s*;?$/;function R8($,Z){let J=Z?s0.dirname(Z):J2.cwd(),X=J2.cwd(),Y=$.split(`
3603
+ })()`,y0=V1(a0,S0.join("\x00")),c0=B8.get(y0);if(!c0)c0=Function(...S0,a0),B8.set(y0,c0);let X1=await c0(z,q,j,B,V,F,_,T,L,w,R,D,M,I,A,k,y,E,b,N.setResponseStatus,N.setResponseHeader,N.notFound,C,v,P,g,x,$0,r0,A0,C0,O,Z0,H0,k0,b0,d0,i,l,K0,J0,B0,L1,I2,T2,I0.confirm,I0.alert,I0.fetch,o,...d,...w0);if(X.preserveExisting){for(let[r,t0]of Object.entries(X1))if(!(r in Z)||Z[r]===void 0)Z[r]=t0}else Object.assign(Z,X1);for(let[r,t0]of Object.entries(B))if(!(r in Z))Z[r]=t0}catch(S){let f=S instanceof Error?S.message:String(S);if(SG(f))console.warn(`[stx] server <script> in ${J??"<unknown>"} imports a module that does not resolve, so every variable in that script is undefined. Cause: ${f}`);else if(PG(f))console.warn(`[stx] server <script> in ${J??"<unknown>"} names something that does not exist, so every variable in that script is undefined. Optional chaining does not help here: an undefined identifier throws before the chain is reached. Cause: ${f}`);else if(J2.env.STX_DEBUG)console.warn(`[stx] server <script> did not execute in ${J??"<unknown>"} \u2014 falling back to static extraction. Cause: ${f}`);try{await lG(G,Z,J)}catch(c){if(J2.env.STX_DEBUG){let t=c instanceof Error?c.message:String(c);console.warn(`[stx] fallback extraction also failed in ${J??"<unknown>"}: ${t}`)}}}}function fG($){let Z=0,J=null,X=!1,Y=!1;for(let Q=0;Q<$.length;Q++){let G=$[Q];if(J){if(G===J){if(J=null,X||Z===0)Y=!0}continue}if(G==="'"||G==='"'||G==="`"){J=G;continue}if(G==="{")Z++;else if(G==="}")Z--;else if($.startsWith("from",Q)&&Z===0)X=!0}return J===null&&Z===0&&Y}var xG=/^(?:export\s+)?(?:const|let|var)\s+[A-Za-z_$][\w$]*(?:\s*,\s*[A-Za-z_$][\w$]*)*\s*;?$/;function D8($,Z){let J=Z?s0.dirname(Z):J2.cwd(),X=J2.cwd(),Y=$.split(`
3605
3604
  `),Q=[],G=0;while(G<Y.length){let z=Y[G].trim();if(z.startsWith("interface ")||z.startsWith("export interface ")||z.startsWith("type ")||z.startsWith("export type ")){if(z.includes("{")&&!z.includes("}")){let q=0;for(;G<Y.length;G++){for(let K of Y[G])if(K==="{")q++;else if(K==="}")q--;if(q<=0)break}}G++;continue}if(z.startsWith("definePageMeta(")){let q=0,K=!1,U=G;for(let j=G;j<Y.length&&!K;j++){let B=null,V=!1,F=Y[j];for(let O=0;O<F.length;O++){let _=F[O];if(V){V=!1;continue}if(_==="\\"){V=!0;continue}if(B){if(_===B)B=null;continue}if(_==='"'||_==="'"||_==="`"){B=_;continue}if(_==="(")q++;else if(_===")"){if(q--,q===0){G=j+1,K=!0;break}}}}if(!K)G=Y.length;let W=Y.slice(U,G).join(`
3606
- `),H=[];for(let j of["title","description"]){let B=new RegExp(`\\b${j}\\s*:\\s*(['"\`])((?:\\\\.|(?!\\1)[^\\\\])*)\\1`).exec(W);if(B)H.push(`${j}: ${JSON.stringify(B[2])}`)}if(H.length>0)Q.push(`useSeoMeta({ ${H.join(", ")} });`);continue}if(z.startsWith("import ")||z==="import"||z.startsWith("import{")){let q=z,K=0;while(!PG(q)&&G+K+1<Y.length)K++,q=`${q} ${Y[G+K].trim()}`;G+=K;let U=q.match(/^import\s+(\w+)\s+from\s+['"](.+?)['"]/),W=q.match(/^import\s+\{([^}]*)\}\s+from\s+['"](.+?)['"]/),H=q.match(/^import\s+['"](.+?)['"]/),j=q,B=(V)=>{if(V.startsWith("."))return s0.resolve(J,V);if(V.startsWith("~/")||V.startsWith("@/"))return s0.resolve(X,V.slice(2));return V};if(U){let[,V,F]=U,O=B(F);Q.push(`const ${V} = (await import('${O}')).default`),Q.push(`module.exports.${V} = ${V};`)}else if(W){let[,V,F]=W,O=B(F),_=[],L=[],w=TG.has(F);for(let R of V.split(",")){let D=R.trim();if(!D)continue;let M=D.split(/\s+as\s+/);if(M.length===2){let[I,N]=[M[0].trim(),M[1].trim()];if(w&&W8.has(I)){Q.push(`const ${N} = ${I};`);continue}_.push(`${I}: ${N}`),L.push(N)}else{if(w&&W8.has(D))continue;_.push(D),L.push(D)}}if(_.length>0)Q.push(`const { ${_.join(", ")} } = await import('${O}')`);for(let R of L)Q.push(`module.exports.${R} = ${R};`)}else if(H){let V=B(H[1]);Q.push(`await import('${V}')`)}else Q.push(j);G++;continue}if(vG.test(z))Q.push(Y[G]),G++;else if(z.startsWith("export const ")||z.startsWith("export let ")||z.startsWith("export var ")){let q=V8(Y,G),{type:K,name:U,value:W}=q;Q.push(`${K} ${U} = ${W};`),Q.push(`module.exports.${U} = ${U};`),G=q.nextIndex}else if(z.startsWith("export function ")||z.startsWith("export async function ")){let q=S$(Y,G);Q.push(q.functionCode),Q.push(`module.exports.${q.name} = ${q.name};`),G=q.nextIndex}else if(z.startsWith("const ")||z.startsWith("let ")||z.startsWith("var ")){let q=V8(Y,G),{type:K,name:U,value:W}=q;Q.push(`${K} ${U} = ${W};`),Q.push(`module.exports.${U} = ${U};`),G=q.nextIndex}else if(z.startsWith("function ")||z.startsWith("async function ")){let q=S$(Y,G);Q.push(q.functionCode),Q.push(`module.exports.${q.name} = ${q.name};`),G=q.nextIndex}else if(z.startsWith("export default function ")||z.startsWith("export default async function ")){let q=Y[G].replace(/^(\s*)export\s+default\s+/,"$1"),K=[...Y];K[G]=q;let U=S$(K,G);if(Q.push(U.functionCode),U.name)Q.push(`module.exports.default = ${U.name};`);G=U.nextIndex}else if(z.startsWith("export default ")){let q=z.replace(/^export\s+default\s+/,"").replace(/;$/,"");Q.push(`module.exports.default = ${q};`),G++}else if(z.startsWith("class ")||z.startsWith("export class ")){let q=z.match(/(?:export\s+)?class\s+(\w+)/);if(q){let K=q[1],U=Y[G].replace(/^export\s+/,""),W=0,H=G;for(;H<Y.length;H++){let j=Y[H];for(let B of j)if(B==="{")W++;else if(B==="}")W--;if(H>G)U+=`
3607
- `+j;if(W<=0&&H>=G)break}Q.push(U),Q.push(`module.exports.${K} = ${K};`),G=H+1}else Q.push(z),G++}else if(z.includes("module.exports"))Q.push(z),G++;else if(z.trim()&&!z.startsWith("//"))Q.push(z),G++;else G++}return fG(Q.join(`
3608
- `),J,X)}function fG($,Z,J){let X=$.length,Y="",Q=0,G=null,z=!1,q=!1,K=0;while(Q<X){let U=$[Q],W=$[Q+1];if(z){if(Y+=U,U===`
3609
- `)z=!1;Q++;continue}if(q){if(Y+=U,U==="*"&&W==="/"){Y+=W,Q+=2,q=!1;continue}Q++;continue}if(!G&&U==="/"&&W==="/"){z=!0,Y+=U,Q++;continue}if(!G&&U==="/"&&W==="*"){q=!0,Y+=U,Q++;continue}if(G){if(Y+=U,U==="\\"){Y+=W,Q+=2;continue}if(U===G&&G!=="`"){G=null,Q++;continue}if(G==="`"){if(U==="$"&&W==="{"){K++,Y+=W,Q+=2;continue}if(U==="`"){G=null,Q++;continue}}Q++;continue}if(K>0){if(U==="{")K++;else if(U==="}")K--}if(U==='"'||U==="'"||U==="`"){G=U,Y+=U,Q++;continue}if(U==="a"&&$.startsWith("await",Q)){let H=xG($,Q);if(H){let{quote:j,path:B,end:V}=H;if(B.startsWith(".")||B.startsWith("~/")||B.startsWith("@/")){let F=B.startsWith(".")?s0.resolve(Z,B):s0.resolve(J,B.slice(2));Y+=`await import(${j}${F}${j})`,Q=V;continue}}}Y+=U,Q++}return Y}function xG($,Z){let J=Z+5;if(J>=$.length)return null;if(!/\s/.test($[J]))return null;while(J<$.length&&/\s/.test($[J]))J++;if(!$.startsWith("import",J))return null;J+=6;while(J<$.length&&/\s/.test($[J]))J++;if($[J]!=="(")return null;J++;while(J<$.length&&/\s/.test($[J]))J++;let X=$[J];if(X!=="'"&&X!=='"')return null;J++;let Y=J;while(J<$.length&&$[J]!==X)if($[J]==="\\")J+=2;else J++;if(J>=$.length)return null;let Q=$.slice(Y,J);J++;while(J<$.length&&/\s/.test($[J]))J++;if($[J]!==")")return null;return{quote:X,path:Q,end:J+1}}function D8($,Z){let J=$[Z];if(J!=="{"&&J!=="[")return null;let Y=_0($,J,J==="{"?"}":"]",Z);if(Y===-1)return null;return{pattern:$.slice(Z,Y+1),endPos:Y+1}}function N8($){let Z=[],J=$.slice(1,-1).trim();if(!J)return Z;let X=0,Y=0,Q="";while(X<J.length){let G=J[X];if(G==="{"||G==="["){let z=Y===0?D8(J,X):null;if(z){Z.push(...N8(z.pattern)),X=z.endPos,Q="";continue}Y++}else if(G==="}"||G==="]")Y--;if(Y>0){X++;continue}if(G===","){if(Q.trim())Z.push(Q.trim());Q="",X++;continue}if(G===":"){Q="",X++;continue}if(G==="="){if(Q.trim())Z.push(Q.trim());Q="",X++;while(X<J.length&&J[X]!==","&&Y===0){if(J[X]==="{"||J[X]==="[")Y++;else if(J[X]==="}"||J[X]==="]")Y--;X++}continue}if(/[\w$]/.test(G))Q+=G;X++}if(Q.trim())Z.push(Q.trim());return Z}function gG($){let Z=/^(?:export\s+)?(const|let|var)\s+([A-Za-z_$][\w$]*)/.exec($);if(!Z)return null;let J=Z[0].length,X=(Y)=>Y===" "||Y==="\t";while(J<$.length&&X($[J]))J++;if($[J]===":"){let Y=0,Q=null;J++;for(;J<$.length;J++){let G=$[J];if(Q){if(G==="\\"){J++;continue}if(G===Q)Q=null;continue}if(G==="'"||G==='"'||G==="`"){Q=G;continue}if(G==="("||G==="["||G==="{"||G==="<"){Y++;continue}if(G===")"||G==="]"||G==="}"||G===">"){Y--;continue}if(G==="="&&Y<=0){let z=$[J+1],q=$[J-1];if(z!=="="&&z!==">"&&q!=="="&&q!=="!"&&q!=="<"&&q!==">")break}}if($[J]!=="=")return null}while(J<$.length&&X($[J]))J++;if($[J]!=="=")return null;return{type:Z[1],name:Z[2],value:$.slice(J+1).trim()}}function B8($,Z,J,X){let Y=null,Q=!1;for(let G of $){if(Q){Q=!1;continue}if(G==="\\"){Q=!0;continue}if(Y){if(G===Y)Y=null;continue}if(G==="'"||G==='"'||G==="`"){Y=G;continue}if(G===Z)X++;else if(G===J)X--}return X}function V8($,Z){let J=$[Z].trim(),X=gG(J),Y=X?[J,X.type,X.name,X.value]:null;if(!Y){let U=J.match(/^(?:export\s+)?(const|let|var)\s+/);if(U){let W=J.slice(U[0].length),H=Z;if(W.startsWith("{")||W.startsWith("[")){let B=W[0],V=B==="{"?"}":"]",F=B8(W,B,V,0),O=W;for(let _=Z+1;_<$.length&&F>0;_++)O+=` ${$[_].trim()}`,H=_,F=B8($[_],B,V,F);if(F>0)O=W,H=Z;W=O}let j=D8(W,0);if(j){let B=U[1],V=j.pattern,F=W.slice(j.endPos).trim();if(F.startsWith("=")){let O=F.slice(1).trim(),_=O,L=Math.max(H,Z);if(L8(O)){let M=_8($,L,O);_=M.value,L=M.nextIndex}else L=L+1;_=_.trim().replace(/;$/,"");let w=N8(V),R=`__stx_src_${Z}`,D=w.map((M)=>`module.exports.${M} = ${M};`).join(`
3605
+ `),H=[];for(let j of["title","description"]){let B=new RegExp(`\\b${j}\\s*:\\s*(['"\`])((?:\\\\.|(?!\\1)[^\\\\])*)\\1`).exec(W);if(B)H.push(`${j}: ${JSON.stringify(B[2])}`)}if(H.length>0)Q.push(`useSeoMeta({ ${H.join(", ")} });`);continue}if(z.startsWith("import ")||z==="import"||z.startsWith("import{")){let q=z,K=0;while(!fG(q)&&G+K+1<Y.length)K++,q=`${q} ${Y[G+K].trim()}`;G+=K;let U=q.match(/^import\s+(\w+)\s+from\s+['"](.+?)['"]/),W=q.match(/^import\s+\{([^}]*)\}\s+from\s+['"](.+?)['"]/),H=q.match(/^import\s+['"](.+?)['"]/),j=q,B=(V)=>{if(V.startsWith("."))return s0.resolve(J,V);if(V.startsWith("~/")||V.startsWith("@/"))return s0.resolve(X,V.slice(2));return V};if(U){let[,V,F]=U,O=B(F);Q.push(`const ${V} = (await import('${O}')).default`),Q.push(`module.exports.${V} = ${V};`)}else if(W){let[,V,F]=W,O=B(F),_=[],L=[],w=bG.has(F);for(let R of V.split(",")){let D=R.trim();if(!D)continue;let M=D.split(/\s+as\s+/);if(M.length===2){let[I,N]=[M[0].trim(),M[1].trim()];if(w&&H8.has(I)){Q.push(`const ${N} = ${I};`);continue}_.push(`${I}: ${N}`),L.push(N)}else{if(w&&H8.has(D))continue;_.push(D),L.push(D)}}if(_.length>0)Q.push(`const { ${_.join(", ")} } = await import('${O}')`);for(let R of L)Q.push(`module.exports.${R} = ${R};`)}else if(H){let V=B(H[1]);Q.push(`await import('${V}')`)}else Q.push(j);G++;continue}if(xG.test(z))Q.push(Y[G]),G++;else if(z.startsWith("export const ")||z.startsWith("export let ")||z.startsWith("export var ")){let q=L8(Y,G),{type:K,name:U,value:W}=q;Q.push(`${K} ${U} = ${W};`),Q.push(`module.exports.${U} = ${U};`),G=q.nextIndex}else if(z.startsWith("export function ")||z.startsWith("export async function ")){let q=S$(Y,G);Q.push(q.functionCode),Q.push(`module.exports.${q.name} = ${q.name};`),G=q.nextIndex}else if(z.startsWith("const ")||z.startsWith("let ")||z.startsWith("var ")){let q=L8(Y,G),{type:K,name:U,value:W}=q;Q.push(`${K} ${U} = ${W};`),Q.push(`module.exports.${U} = ${U};`),G=q.nextIndex}else if(z.startsWith("function ")||z.startsWith("async function ")){let q=S$(Y,G);Q.push(q.functionCode),Q.push(`module.exports.${q.name} = ${q.name};`),G=q.nextIndex}else if(z.startsWith("export default function ")||z.startsWith("export default async function ")){let q=Y[G].replace(/^(\s*)export\s+default\s+/,"$1"),K=[...Y];K[G]=q;let U=S$(K,G);if(Q.push(U.functionCode),U.name)Q.push(`module.exports.default = ${U.name};`);G=U.nextIndex}else if(z.startsWith("export default ")){let q=z.replace(/^export\s+default\s+/,"").replace(/;$/,"");Q.push(`module.exports.default = ${q};`),G++}else if(z.startsWith("class ")||z.startsWith("export class ")){let q=z.match(/(?:export\s+)?class\s+(\w+)/);if(q){let K=q[1],U=Y[G].replace(/^export\s+/,""),W=0,H=G;for(;H<Y.length;H++){let j=Y[H];for(let B of j)if(B==="{")W++;else if(B==="}")W--;if(H>G)U+=`
3606
+ `+j;if(W<=0&&H>=G)break}Q.push(U),Q.push(`module.exports.${K} = ${K};`),G=H+1}else Q.push(z),G++}else if(z.includes("module.exports"))Q.push(z),G++;else if(z.trim()&&!z.startsWith("//"))Q.push(z),G++;else G++}return gG(Q.join(`
3607
+ `),J,X)}function gG($,Z,J){let X=$.length,Y="",Q=0,G=null,z=!1,q=!1,K=0;while(Q<X){let U=$[Q],W=$[Q+1];if(z){if(Y+=U,U===`
3608
+ `)z=!1;Q++;continue}if(q){if(Y+=U,U==="*"&&W==="/"){Y+=W,Q+=2,q=!1;continue}Q++;continue}if(!G&&U==="/"&&W==="/"){z=!0,Y+=U,Q++;continue}if(!G&&U==="/"&&W==="*"){q=!0,Y+=U,Q++;continue}if(G){if(Y+=U,U==="\\"){Y+=W,Q+=2;continue}if(U===G&&G!=="`"){G=null,Q++;continue}if(G==="`"){if(U==="$"&&W==="{"){K++,Y+=W,Q+=2;continue}if(U==="`"){G=null,Q++;continue}}Q++;continue}if(K>0){if(U==="{")K++;else if(U==="}")K--}if(U==='"'||U==="'"||U==="`"){G=U,Y+=U,Q++;continue}if(U==="a"&&$.startsWith("await",Q)){let H=hG($,Q);if(H){let{quote:j,path:B,end:V}=H;if(B.startsWith(".")||B.startsWith("~/")||B.startsWith("@/")){let F=B.startsWith(".")?s0.resolve(Z,B):s0.resolve(J,B.slice(2));Y+=`await import(${j}${F}${j})`,Q=V;continue}}}Y+=U,Q++}return Y}function hG($,Z){let J=Z+5;if(J>=$.length)return null;if(!/\s/.test($[J]))return null;while(J<$.length&&/\s/.test($[J]))J++;if(!$.startsWith("import",J))return null;J+=6;while(J<$.length&&/\s/.test($[J]))J++;if($[J]!=="(")return null;J++;while(J<$.length&&/\s/.test($[J]))J++;let X=$[J];if(X!=="'"&&X!=='"')return null;J++;let Y=J;while(J<$.length&&$[J]!==X)if($[J]==="\\")J+=2;else J++;if(J>=$.length)return null;let Q=$.slice(Y,J);J++;while(J<$.length&&/\s/.test($[J]))J++;if($[J]!==")")return null;return{quote:X,path:Q,end:J+1}}function N8($,Z){let J=$[Z];if(J!=="{"&&J!=="[")return null;let Y=_0($,J,J==="{"?"}":"]",Z);if(Y===-1)return null;return{pattern:$.slice(Z,Y+1),endPos:Y+1}}function M8($){let Z=[],J=$.slice(1,-1).trim();if(!J)return Z;let X=0,Y=0,Q="";while(X<J.length){let G=J[X];if(G==="{"||G==="["){let z=Y===0?N8(J,X):null;if(z){Z.push(...M8(z.pattern)),X=z.endPos,Q="";continue}Y++}else if(G==="}"||G==="]")Y--;if(Y>0){X++;continue}if(G===","){if(Q.trim())Z.push(Q.trim());Q="",X++;continue}if(G===":"){Q="",X++;continue}if(G==="="){if(Q.trim())Z.push(Q.trim());Q="",X++;while(X<J.length&&J[X]!==","&&Y===0){if(J[X]==="{"||J[X]==="[")Y++;else if(J[X]==="}"||J[X]==="]")Y--;X++}continue}if(/[\w$]/.test(G))Q+=G;X++}if(Q.trim())Z.push(Q.trim());return Z}function uG($){let Z=/^(?:export\s+)?(const|let|var)\s+([A-Za-z_$][\w$]*)/.exec($);if(!Z)return null;let J=Z[0].length,X=(Y)=>Y===" "||Y==="\t";while(J<$.length&&X($[J]))J++;if($[J]===":"){let Y=0,Q=null;J++;for(;J<$.length;J++){let G=$[J];if(Q){if(G==="\\"){J++;continue}if(G===Q)Q=null;continue}if(G==="'"||G==='"'||G==="`"){Q=G;continue}if(G==="("||G==="["||G==="{"||G==="<"){Y++;continue}if(G===")"||G==="]"||G==="}"||G===">"){Y--;continue}if(G==="="&&Y<=0){let z=$[J+1],q=$[J-1];if(z!=="="&&z!==">"&&q!=="="&&q!=="!"&&q!=="<"&&q!==">")break}}if($[J]!=="=")return null}while(J<$.length&&X($[J]))J++;if($[J]!=="=")return null;return{type:Z[1],name:Z[2],value:$.slice(J+1).trim()}}function V8($,Z,J,X){let Y=null,Q=!1;for(let G of $){if(Q){Q=!1;continue}if(G==="\\"){Q=!0;continue}if(Y){if(G===Y)Y=null;continue}if(G==="'"||G==='"'||G==="`"){Y=G;continue}if(G===Z)X++;else if(G===J)X--}return X}function L8($,Z){let J=$[Z].trim(),X=uG(J),Y=X?[J,X.type,X.name,X.value]:null;if(!Y){let U=J.match(/^(?:export\s+)?(const|let|var)\s+/);if(U){let W=J.slice(U[0].length),H=Z;if(W.startsWith("{")||W.startsWith("[")){let B=W[0],V=B==="{"?"}":"]",F=V8(W,B,V,0),O=W;for(let _=Z+1;_<$.length&&F>0;_++)O+=` ${$[_].trim()}`,H=_,F=V8($[_],B,V,F);if(F>0)O=W,H=Z;W=O}let j=N8(W,0);if(j){let B=U[1],V=j.pattern,F=W.slice(j.endPos).trim();if(F.startsWith("=")){let O=F.slice(1).trim(),_=O,L=Math.max(H,Z);if(_8(O)){let M=O8($,L,O);_=M.value,L=M.nextIndex}else L=L+1;_=_.trim().replace(/;$/,"");let w=M8(V),R=`__stx_src_${Z}`,D=w.map((M)=>`module.exports.${M} = ${M};`).join(`
3610
3609
  `);return{type:B,name:R,value:`${_}; ${B} ${V} = ${R};
3611
- ${D}`,nextIndex:L}}}}throw Error(`Failed to parse variable declaration: ${J}`)}let[,Q,G,z]=Y,q=z,K=Z;if(L8(z)){let U=_8($,Z,z);q=U.value,K=U.nextIndex}else K=Z+1;while(K<$.length){let U=$[K].trim();if(U.startsWith(".")||U.startsWith("?."))q+=`
3612
- ${$[K]}`,K++;else break}return q=q.trim().replace(/;$/,""),{type:Q,name:G,value:q,nextIndex:K}}function S$($,Z){let J=$[Z].trim(),X=J.match(/^(?:export\s+)?(?:async\s+)?function\s+(\w+)/);if(!X)throw Error(`Failed to parse function declaration: ${J}`);let[,Y]=X,Q=J.replace(/^export\s+/,""),G=Z;if(hG(J)){let z=uG($,Z,Q);Q=z.functionCode,G=z.nextIndex}else G=Z+1;return{name:Y,functionCode:Q,nextIndex:G}}function L8($){let Z=$.trim();if(Z.startsWith("{"))return _0(Z,"{","}",0)===-1;if(Z.startsWith("["))return _0(Z,"[","]",0)===-1;return!M8(Z)}function M8($){let Z={paren:0,bracket:0,brace:0},J=null,X=0;for(let Y=0;Y<$.length;Y++){let Q=$[Y];if((Y>0?$[Y-1]:"")==="\\"&&J)continue;if((Q==='"'||Q==="'")&&!J){J=Q;continue}if(Q===J&&J!=="`"){J=null;continue}if(Q==="`"&&!J){J="`";continue}if(Q==="`"&&J==="`"&&X===0){J=null;continue}if(J==="`"&&Q==="$"&&$[Y+1]==="{"){X++,Y++;continue}if(X>0&&Q==="{"){X++;continue}if(X>0&&Q==="}"){X--;continue}if(J)continue;if(Q==="(")Z.paren++;else if(Q===")")Z.paren--;else if(Q==="[")Z.bracket++;else if(Q==="]")Z.bracket--;else if(Q==="{")Z.brace++;else if(Q==="}")Z.brace--}return Z.paren===0&&Z.bracket===0&&Z.brace===0&&J===null}function A8($){let Z=$.indexOf("(");if(Z===-1)return $.indexOf("{");let J=_0($,"(",")",Z);if(J===-1)return-1;return $.indexOf("{",J)}function hG($){let Z=A8($);if(Z===-1)return!0;return _0($,"{","}",Z)===-1}function _8($,Z,J){let X=J,Y=Z+1;while(Y<$.length&&!M8(X)){let Q=$[Y];X+=`
3610
+ ${D}`,nextIndex:L}}}}throw Error(`Failed to parse variable declaration: ${J}`)}let[,Q,G,z]=Y,q=z,K=Z;if(_8(z)){let U=O8($,Z,z);q=U.value,K=U.nextIndex}else K=Z+1;while(K<$.length){let U=$[K].trim();if(U.startsWith(".")||U.startsWith("?."))q+=`
3611
+ ${$[K]}`,K++;else break}return q=q.trim().replace(/;$/,""),{type:Q,name:G,value:q,nextIndex:K}}function S$($,Z){let J=$[Z].trim(),X=J.match(/^(?:export\s+)?(?:async\s+)?function\s+(\w+)/);if(!X)throw Error(`Failed to parse function declaration: ${J}`);let[,Y]=X,Q=J.replace(/^export\s+/,""),G=Z;if(dG(J)){let z=mG($,Z,Q);Q=z.functionCode,G=z.nextIndex}else G=Z+1;return{name:Y,functionCode:Q,nextIndex:G}}function _8($){let Z=$.trim();if(Z.startsWith("{"))return _0(Z,"{","}",0)===-1;if(Z.startsWith("["))return _0(Z,"[","]",0)===-1;return!A8(Z)}function A8($){let Z={paren:0,bracket:0,brace:0},J=null,X=0;for(let Y=0;Y<$.length;Y++){let Q=$[Y];if((Y>0?$[Y-1]:"")==="\\"&&J)continue;if((Q==='"'||Q==="'")&&!J){J=Q;continue}if(Q===J&&J!=="`"){J=null;continue}if(Q==="`"&&!J){J="`";continue}if(Q==="`"&&J==="`"&&X===0){J=null;continue}if(J==="`"&&Q==="$"&&$[Y+1]==="{"){X++,Y++;continue}if(X>0&&Q==="{"){X++;continue}if(X>0&&Q==="}"){X--;continue}if(J)continue;if(Q==="(")Z.paren++;else if(Q===")")Z.paren--;else if(Q==="[")Z.bracket++;else if(Q==="]")Z.bracket--;else if(Q==="{")Z.brace++;else if(Q==="}")Z.brace--}return Z.paren===0&&Z.bracket===0&&Z.brace===0&&J===null}function k8($){let Z=$.indexOf("(");if(Z===-1)return $.indexOf("{");let J=_0($,"(",")",Z);if(J===-1)return-1;return $.indexOf("{",J)}function dG($){let Z=k8($);if(Z===-1)return!0;return _0($,"{","}",Z)===-1}function O8($,Z,J){let X=J,Y=Z+1;while(Y<$.length&&!A8(X)){let Q=$[Y];X+=`
3613
3612
  ${Q}`,Y++}while(Y<$.length){let Q=$[Y].trim();if(Q.startsWith(".")||Q.startsWith("?."))X+=`
3614
- ${$[Y]}`,Y++;else break}return{value:X,nextIndex:Y}}function uG($,Z,J){let X=J,Y=Z+1;while(Y<$.length){let Q=A8(X);if(Q!==-1){if(_0(X,"{","}",Q)!==-1)break}let G=$[Y];X+=`
3615
- ${G}`,Y++}return{functionCode:X,nextIndex:Y}}function O8($,Z){let J=e($,Z)??e(`(${$})`,Z);if(J!==void 0)return J;if(!/\bprocess\b/.test($))return;let X={...Z,process:Object.freeze({env:{...J2.env}})},Y=Object.keys(X).filter(X2),Q=Y.map((G)=>X[G]);try{return Function(...Y,`'use strict'; return (${$});`)(...Q)}catch{try{return Function(...Y,`'use strict'; return ${$};`)(...Q)}catch{return}}}async function dG($,Z,J){let X=$.matchAll(/export\s+(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:export\s+|$))/g);for(let Q of X){let[,,G,z]=Q;try{let q=z.trim().replace(/;$/,""),K=O8(q,Z);if(K!==void 0)Z[G]=K}catch(q){console.warn(`Failed to parse export ${G} in fallback:`,q)}}let Y=$.matchAll(/(?:^|\n)\s*(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:(?:const|let|var|function|export)\s+|$))/g);for(let Q of Y){let[,,G,z]=Q;if(!(G in Z))try{let q=z.trim().replace(/;$/,""),K=O8(q,Z);if(K!==void 0)Z[G]=K}catch{}}}function mG($){let Z=$.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),J=Z?Z[1]:"",X=Z?$.replace(/<script\b[^>]*>[\s\S]*?<\/script>/i,""):$;return{scriptContent:J,templateWithoutScript:X}}function lG($){let Z=$.trim();if(!Z)return!1;return/(?:const|let|var|function)\s+\w+/.test(Z)}var A2=new u1(500),b9=new u1(1000),y8=33554432,f$=y8;function pG($){let Z=$.componentRenderCacheBytes;if(typeof Z!=="number"||Z<0||Z===f$)return;f$=Z,y9.setMaxBytes(Z)}var y9=new u1(2000,{maxBytes:y8,sizeOf:($)=>$.output.length});function iG($){let Z=new WeakSet;try{let J=(X)=>{if(X===void 0)return{__stxType:"undefined"};if(typeof X==="bigint")return{__stxType:"bigint",value:X.toString()};if(typeof X==="function"||typeof X==="symbol")throw TypeError("Non-serializable component input");if(X===null||typeof X!=="object")return X;if(Z.has(X))throw TypeError("Circular component input");if(Z.add(X),X instanceof Date)return{__stxType:"date",value:X.toISOString()};if(Array.isArray(X))return X.map(J);let Y={};for(let Q of Object.keys(X).sort())Y[Q]=J(X[Q]);return Y};return JSON.stringify(J($))}catch{return null}}function k8($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function nG($){return/\bjs\b/.test($)||/\blang\s*=\s*["']?(js|javascript)["']?/i.test($)}function D1($){return!nG($)}var E9=new Map;function P$($){let Z;try{Z=JSON.stringify($)}catch{return new Bun.Transpiler($)}let J=E9.get(Z);if(J)return J;if(E9.size>=16)E9.clear();let X=new Bun.Transpiler($);return E9.set(Z,X),X}var I8=new WeakMap,oG=256;function N1($){try{let Z=P$({loader:"ts",target:"browser",define:$2()}),J=I8.get(Z);if(!J)J=new Map,I8.set(Z,J);let X=J.get($);if(X!==void 0)return X;let Y=$.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");Y=Y.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");let Q=[];Y=Y.replace(/\{!![\s\S]*?!!\}/g,(z)=>{let q=Q.length;return Q.push(z),`"__STX_EXPR_${q}__"`}),Y=Y.replace(/\{\{\{[\s\S]*?\}\}\}/g,(z)=>{let q=Q.length;return Q.push(z),`"__STX_EXPR_${q}__"`}),Y=Y.replace(/\{\{[\s\S]*?\}\}/g,(z)=>{let q=Q.length;return Q.push(z),`"__STX_EXPR_${q}__"`});let G=Z.transformSync(Y);for(let z=0;z<Q.length;z++)G=G.replace(`"__STX_EXPR_${z}__"`,Q[z]),G=G.replace(`'__STX_EXPR_${z}__'`,Q[z]);if(J.size>=oG){let z=J.keys().next();if(!z.done)J.delete(z.value)}return J.set($,G),G}catch(Z){if(process.env.STX_DEBUG_TS)console.warn("[STX] TypeScript transpilation error:",Z);return $}}function sG($){let Z=[],J=new Set,X=0,Y=0,Q=$.length,G=(U)=>{Y++;while(Y<Q){if($[Y]==="\\"){Y+=2;continue}if($[Y]===U){Y++;return}Y++}},z=()=>{Y++;while(Y<Q){if($[Y]==="\\"){Y+=2;continue}if($[Y]==="`"){Y++;return}if($[Y]==="$"&&$[Y+1]==="{"){Y+=2;let U=1;while(Y<Q&&U>0)if($[Y]==="{")U++,Y++;else if($[Y]==="}")U--,Y++;else if($[Y]==="'"||$[Y]==='"')G($[Y]);else if($[Y]==="`")z();else Y++;continue}Y++}},q=()=>{if($[Y]==="/"&&$[Y+1]==="/"){while(Y<Q&&$[Y]!==`
3616
- `)Y++;return!0}if($[Y]==="/"&&$[Y+1]==="*"){Y+=2;while(Y<Q-1&&!($[Y]==="*"&&$[Y+1]==="/"))Y++;return Y+=2,!0}return!1},K=()=>{if(X!==0)return;let U=$.slice(Y).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(U){let B=U[2].split(",").map((V)=>{let F=V.trim().split(":");return F[F.length-1].trim()});for(let V of B)if(V&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(V)&&!J.has(V))Z.push(V),J.add(V);return}let W=$.slice(Y).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(W){let B=W[2];if(!J.has(B))Z.push(B),J.add(B);return}let H=$.slice(Y).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(H){let B=H[1];if(!J.has(B))Z.push(B),J.add(B);return}let j=$.slice(Y).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(j){let B=j[1];if(!J.has(B))Z.push(B),J.add(B)}};while(Y<Q){if(q())continue;if($[Y]==="'"||$[Y]==='"'){G($[Y]);continue}if($[Y]==="`"){z();continue}if($[Y]==="{"){X++,Y++;continue}if($[Y]==="}"){X--,Y++;continue}if(X===0&&/[a-z]/i.test($[Y])&&(Y===0||/\s|[;{}()]/.test($[Y-1])))K();Y++}return Z}function rG($){let Z=[],J=0,X=0,Y=null;for(let Q=0;Q<$.length;Q++){let G=$[Q];if(Y){if(G==="\\"){Q++;continue}if(G===Y)Y=null;continue}if(G==='"'||G==="'"||G==="`"){Y=G;continue}if(G==="("||G==="["||G==="{")J++;else if(G===")"||G==="]"||G==="}")J--;else if(G===","&&J===0)Z.push($.slice(X,Q)),X=Q+1}if(X<$.length)Z.push($.slice(X));return Z}function aG($){let Z=0,J=null;for(let X=0;X<$.length;X++){let Y=$[X];if(J){if(Y==="\\"){X++;continue}if(Y===J)J=null;continue}if(Y==='"'||Y==="'"||Y==="`"){J=Y;continue}if(Y==="("||Y==="["||Y==="{")Z++;else if(Y===")"||Y==="]"||Y==="}")Z--;else if(Y==="="&&Z===0){let Q=$[X-1],G=$[X+1];if(Q==="!"||Q==="<"||Q===">"||Q==="=")continue;if(G==="="||G===">")continue;return X}}return-1}function tG($,Z){try{let J=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec($);if(!J)return;let X=J.index-1;while(X>=0&&/\s/.test($[X]))X--;if($[X]!=="}")return;let Y=X,Q=0,G=-1;for(;X>=0;X--){let q=$[X];if(q==="}")Q++;else if(q==="{"){if(Q--,Q===0){G=X;break}}}if(G===-1)return;let z=$.slice(G+1,Y);for(let q of rG(z)){let K=q.trim();if(!K||K.startsWith("..."))continue;let U=aG(K);if(U===-1)continue;let W=K.slice(0,U).trim();if(!/^[A-Z_$][\w$]*$/i.test(W))continue;if(Z[W]!==void 0)continue;let H=K.slice(U+1).trim();if(!H)continue;try{let j=Object.keys(Z).filter(X2),B=Function(...j,`"use strict"; return (${H});`);Z[W]=B(...j.map((V)=>Z[V]))}catch{}}}catch{}}async function A9($,Z,J,X,Y){let Q=$.endsWith(".stx")?$.slice(0,-4):$,G=(F)=>F.split("-").map((O)=>O.charAt(0).toUpperCase()+O.slice(1)).join(""),z=(F)=>F.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),q=J.__importedComponents;if(q){for(let F of[Q,Q.toLowerCase(),G(Q),z(Q)])if(q.has(F))return!0}let K=[...new Set([`${Q}.stx`,`${G(Q)}.stx`,`${z(Q)}.stx`])],U=typeof Y.root==="string"?h.resolve(Y.root):void 0,W=U??h.dirname(X),H=[],j=(F)=>{if(F&&!H.includes(F))H.push(F)},B=J.__originalFilePath;if(B)j(h.join(h.dirname(B),"components"));if(j(Z),j(Y._rootComponentsDir),j(h.join(h.dirname(X),"components")),j(Y.componentsDir),U)j(h.resolve(U,"resources/views/components")),j(h.resolve(U,"resources/components")),j(h.resolve(U,"src/components")),j(h.resolve(U,"components"));let V=Y._pluginComponentDirs;if(Array.isArray(V))for(let F of V)j(typeof F==="string"?F:null);if(j(Y.fallbackComponentsDir),Q.startsWith("./")||Q.startsWith("../"))return s(h.resolve(h.dirname(X),`${Q}.stx`));for(let F of H){let O=h.isAbsolute(F)?F:h.resolve(W,F);for(let _ of K)if(await s(h.join(O,_)))return!0}return!1}function eG($){return $==="visible"||$==="idle"||$==="interaction"||$.startsWith("media:")}function $z($){if(!$)return!1;let Z=$.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(Z)}function Zz($){let Z=new Set,J=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useReactiveProp|useLocalStorage|useSessionStorage|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let X of $){let Y;while((Y=J.exec(X))!==null)Z.add(Y[1]);J.lastIndex=0}return[...Z]}async function A1($,Z,J,X,Y,Q,G,z=new Set,q){let{extractVariables:K}=await o("stx/variable-extractor",()=>import("./chunk-t8y1ggdy.js")),U=z??new Set;if(U.has($))return`[Circular component reference: ${$}]`;let W=new Set(U);W.add($);let H=typeof Z.client==="string"?Z.client.trim():"";if("client"in Z)delete Z.client;let j=H&&H!=="load"&&eG(H)?H:"";try{let B=(d)=>d.split("-").map((m)=>m.charAt(0).toUpperCase()+m.slice(1)).join(""),V=(d)=>d.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),F=$.endsWith(".stx")?$.slice(0,-4):$,O=null,_=Y.__importedComponents;if(_){let d=[F,F.toLowerCase(),B(F),V(F)];for(let m of d)if(_.has(m)){O=_.get(m);break}}let L=[];if(!O){let d=[`${F}.stx`,`${B(F)}.stx`,`${V(F)}.stx`],m=[...new Set(d)],z0=Y.__originalFilePath,n=[];if(z0){let L0=h.join(h.dirname(z0),"components");n.push(L0)}if(X)n.push(X);let V0=G._rootComponentsDir;if(typeof V0==="string"&&!n.includes(V0))n.push(V0);let w0=h.join(h.dirname(Q),"components");if(!n.includes(w0))n.push(w0);if(G.componentsDir&&G.componentsDir!==X&&!n.includes(G.componentsDir))n.push(G.componentsDir);let S0=typeof G.root==="string"?h.resolve(G.root):void 0,a0=S0??h.dirname(Q),y0=[];if(S0)y0.push(h.resolve(S0,"resources/views/components")),y0.push(h.resolve(S0,"resources/components")),y0.push(h.resolve(S0,"src/components")),y0.push(h.resolve(S0,"components"));y0.push(h.resolve(import.meta.dir,"components"));for(let L0 of y0)if(!n.includes(L0))n.push(L0);let c0=G._pluginComponentDirs;if(Array.isArray(c0)){for(let L0 of c0)if(typeof L0==="string"&&!n.includes(L0))n.push(L0)}if(G.fallbackComponentsDir&&!n.includes(G.fallbackComponentsDir))n.push(G.fallbackComponentsDir);let X1=[...new Set(n.map((L0)=>{if(!L0)return L0;return h.isAbsolute(L0)?L0:h.resolve(a0,L0)}))];n.length=0,n.push(...X1);let r=`${F}\x00${Q}\x00${X1.join("\x00")}`,t0=b9.get(r);if(t0)if(await s(t0))O=t0;else b9.delete(r);if(!O&&(F.startsWith("./")||F.startsWith("../")))O=h.resolve(h.dirname(Q),`${F}.stx`),L.push(O);else if(!O)for(let L0 of n){if(!L0)continue;for(let E2 of m){let b2=h.join(L0,E2);if(L.push(b2),await s(b2)){O=b2;break}}if(O)break;if(!O)try{let E2=await import("fs");if(!E2.statSync(L0,{throwIfNoEntry:!1})?.isDirectory())continue;let d8=8,C9=[{path:L0,depth:0}];while(C9.length>0&&!O){let y2=C9.pop();if(y2.depth>=d8)continue;let u$;try{u$=E2.readdirSync(y2.path,{withFileTypes:!0})}catch{continue}for(let C2 of u$){if(!C2.isDirectory())continue;if(C2.name==="node_modules"||C2.name.startsWith("."))continue;let d$=h.join(y2.path,C2.name);for(let m8 of m){let S9=h.join(d$,m8);if(L.push(S9),await s(S9)){O=S9;break}}if(O)break;C9.push({path:d$,depth:y2.depth+1})}}}catch{}if(O)break}if(O)b9.set(r,O)}if(!O||!await s(O)){let d=L.length>0?`
3613
+ ${$[Y]}`,Y++;else break}return{value:X,nextIndex:Y}}function mG($,Z,J){let X=J,Y=Z+1;while(Y<$.length){let Q=k8(X);if(Q!==-1){if(_0(X,"{","}",Q)!==-1)break}let G=$[Y];X+=`
3614
+ ${G}`,Y++}return{functionCode:X,nextIndex:Y}}function F8($,Z){let J=e($,Z)??e(`(${$})`,Z);if(J!==void 0)return J;if(!/\bprocess\b/.test($))return;let X={...Z,process:Object.freeze({env:{...J2.env}})},Y=Object.keys(X).filter(X2),Q=Y.map((G)=>X[G]);try{return Function(...Y,`'use strict'; return (${$});`)(...Q)}catch{try{return Function(...Y,`'use strict'; return ${$};`)(...Q)}catch{return}}}async function lG($,Z,J){let X=$.matchAll(/export\s+(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:export\s+|$))/g);for(let Q of X){let[,,G,z]=Q;try{let q=z.trim().replace(/;$/,""),K=F8(q,Z);if(K!==void 0)Z[G]=K}catch(q){console.warn(`Failed to parse export ${G} in fallback:`,q)}}let Y=$.matchAll(/(?:^|\n)\s*(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:(?:const|let|var|function|export)\s+|$))/g);for(let Q of Y){let[,,G,z]=Q;if(!(G in Z))try{let q=z.trim().replace(/;$/,""),K=F8(q,Z);if(K!==void 0)Z[G]=K}catch{}}}function cG($){let Z=$.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),J=Z?Z[1]:"",X=Z?$.replace(/<script\b[^>]*>[\s\S]*?<\/script>/i,""):$;return{scriptContent:J,templateWithoutScript:X}}function pG($){let Z=$.trim();if(!Z)return!1;return/(?:const|let|var|function)\s+\w+/.test(Z)}var A2=new u1(500),b9=new u1(1000),C8=33554432,f$=C8;function nG($){let Z=$.componentRenderCacheBytes;if(typeof Z!=="number"||Z<0||Z===f$)return;f$=Z,y9.setMaxBytes(Z)}var y9=new u1(2000,{maxBytes:C8,sizeOf:($)=>$.output.length});function oG($){let Z=new WeakSet;try{let J=(X)=>{if(X===void 0)return{__stxType:"undefined"};if(typeof X==="bigint")return{__stxType:"bigint",value:X.toString()};if(typeof X==="function"||typeof X==="symbol")throw TypeError("Non-serializable component input");if(X===null||typeof X!=="object")return X;if(Z.has(X))throw TypeError("Circular component input");if(Z.add(X),X instanceof Date)return{__stxType:"date",value:X.toISOString()};if(Array.isArray(X))return X.map(J);let Y={};for(let Q of Object.keys(X).sort())Y[Q]=J(X[Q]);return Y};return JSON.stringify(J($))}catch{return null}}function I8($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function sG($){return/\bjs\b/.test($)||/\blang\s*=\s*["']?(js|javascript)["']?/i.test($)}function D1($){return!sG($)}var E9=new Map;function P$($){let Z;try{Z=JSON.stringify($)}catch{return new Bun.Transpiler($)}let J=E9.get(Z);if(J)return J;if(E9.size>=16)E9.clear();let X=new Bun.Transpiler($);return E9.set(Z,X),X}var T8=new WeakMap,rG=256;function N1($){try{let Z=P$({loader:"ts",target:"browser",define:$2()}),J=T8.get(Z);if(!J)J=new Map,T8.set(Z,J);let X=J.get($);if(X!==void 0)return X;let Y=$.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");Y=Y.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");let Q=[];Y=Y.replace(/\{!![\s\S]*?!!\}/g,(z)=>{let q=Q.length;return Q.push(z),`"__STX_EXPR_${q}__"`}),Y=Y.replace(/\{\{\{[\s\S]*?\}\}\}/g,(z)=>{let q=Q.length;return Q.push(z),`"__STX_EXPR_${q}__"`}),Y=Y.replace(/\{\{[\s\S]*?\}\}/g,(z)=>{let q=Q.length;return Q.push(z),`"__STX_EXPR_${q}__"`});let G=Z.transformSync(Y);for(let z=0;z<Q.length;z++)G=G.replace(`"__STX_EXPR_${z}__"`,Q[z]),G=G.replace(`'__STX_EXPR_${z}__'`,Q[z]);if(J.size>=rG){let z=J.keys().next();if(!z.done)J.delete(z.value)}return J.set($,G),G}catch(Z){if(process.env.STX_DEBUG_TS)console.warn("[STX] TypeScript transpilation error:",Z);return $}}function aG($){let Z=[],J=new Set,X=0,Y=0,Q=$.length,G=(U)=>{Y++;while(Y<Q){if($[Y]==="\\"){Y+=2;continue}if($[Y]===U){Y++;return}Y++}},z=()=>{Y++;while(Y<Q){if($[Y]==="\\"){Y+=2;continue}if($[Y]==="`"){Y++;return}if($[Y]==="$"&&$[Y+1]==="{"){Y+=2;let U=1;while(Y<Q&&U>0)if($[Y]==="{")U++,Y++;else if($[Y]==="}")U--,Y++;else if($[Y]==="'"||$[Y]==='"')G($[Y]);else if($[Y]==="`")z();else Y++;continue}Y++}},q=()=>{if($[Y]==="/"&&$[Y+1]==="/"){while(Y<Q&&$[Y]!==`
3615
+ `)Y++;return!0}if($[Y]==="/"&&$[Y+1]==="*"){Y+=2;while(Y<Q-1&&!($[Y]==="*"&&$[Y+1]==="/"))Y++;return Y+=2,!0}return!1},K=()=>{if(X!==0)return;let U=$.slice(Y).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(U){let B=U[2].split(",").map((V)=>{let F=V.trim().split(":");return F[F.length-1].trim()});for(let V of B)if(V&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(V)&&!J.has(V))Z.push(V),J.add(V);return}let W=$.slice(Y).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(W){let B=W[2];if(!J.has(B))Z.push(B),J.add(B);return}let H=$.slice(Y).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(H){let B=H[1];if(!J.has(B))Z.push(B),J.add(B);return}let j=$.slice(Y).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(j){let B=j[1];if(!J.has(B))Z.push(B),J.add(B)}};while(Y<Q){if(q())continue;if($[Y]==="'"||$[Y]==='"'){G($[Y]);continue}if($[Y]==="`"){z();continue}if($[Y]==="{"){X++,Y++;continue}if($[Y]==="}"){X--,Y++;continue}if(X===0&&/[a-z]/i.test($[Y])&&(Y===0||/\s|[;{}()]/.test($[Y-1])))K();Y++}return Z}function tG($){let Z=[],J=0,X=0,Y=null;for(let Q=0;Q<$.length;Q++){let G=$[Q];if(Y){if(G==="\\"){Q++;continue}if(G===Y)Y=null;continue}if(G==='"'||G==="'"||G==="`"){Y=G;continue}if(G==="("||G==="["||G==="{")J++;else if(G===")"||G==="]"||G==="}")J--;else if(G===","&&J===0)Z.push($.slice(X,Q)),X=Q+1}if(X<$.length)Z.push($.slice(X));return Z}function eG($){let Z=0,J=null;for(let X=0;X<$.length;X++){let Y=$[X];if(J){if(Y==="\\"){X++;continue}if(Y===J)J=null;continue}if(Y==='"'||Y==="'"||Y==="`"){J=Y;continue}if(Y==="("||Y==="["||Y==="{")Z++;else if(Y===")"||Y==="]"||Y==="}")Z--;else if(Y==="="&&Z===0){let Q=$[X-1],G=$[X+1];if(Q==="!"||Q==="<"||Q===">"||Q==="=")continue;if(G==="="||G===">")continue;return X}}return-1}function $z($,Z){try{let J=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec($);if(!J)return;let X=J.index-1;while(X>=0&&/\s/.test($[X]))X--;if($[X]!=="}")return;let Y=X,Q=0,G=-1;for(;X>=0;X--){let q=$[X];if(q==="}")Q++;else if(q==="{"){if(Q--,Q===0){G=X;break}}}if(G===-1)return;let z=$.slice(G+1,Y);for(let q of tG(z)){let K=q.trim();if(!K||K.startsWith("..."))continue;let U=eG(K);if(U===-1)continue;let W=K.slice(0,U).trim();if(!/^[A-Z_$][\w$]*$/i.test(W))continue;if(Z[W]!==void 0)continue;let H=K.slice(U+1).trim();if(!H)continue;try{let j=Object.keys(Z).filter(X2),B=Function(...j,`"use strict"; return (${H});`);Z[W]=B(...j.map((V)=>Z[V]))}catch{}}}catch{}}async function A9($,Z,J,X,Y){let Q=$.endsWith(".stx")?$.slice(0,-4):$,G=(F)=>F.split("-").map((O)=>O.charAt(0).toUpperCase()+O.slice(1)).join(""),z=(F)=>F.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),q=J.__importedComponents;if(q){for(let F of[Q,Q.toLowerCase(),G(Q),z(Q)])if(q.has(F))return!0}let K=[...new Set([`${Q}.stx`,`${G(Q)}.stx`,`${z(Q)}.stx`])],U=typeof Y.root==="string"?h.resolve(Y.root):void 0,W=U??h.dirname(X),H=[],j=(F)=>{if(F&&!H.includes(F))H.push(F)},B=J.__originalFilePath;if(B)j(h.join(h.dirname(B),"components"));if(j(Z),j(Y._rootComponentsDir),j(h.join(h.dirname(X),"components")),j(Y.componentsDir),U)j(h.resolve(U,"resources/views/components")),j(h.resolve(U,"resources/components")),j(h.resolve(U,"src/components")),j(h.resolve(U,"components"));let V=Y._pluginComponentDirs;if(Array.isArray(V))for(let F of V)j(typeof F==="string"?F:null);if(j(Y.fallbackComponentsDir),Q.startsWith("./")||Q.startsWith("../"))return s(h.resolve(h.dirname(X),`${Q}.stx`));for(let F of H){let O=h.isAbsolute(F)?F:h.resolve(W,F);for(let _ of K)if(await s(h.join(O,_)))return!0}return!1}function Zz($){return $==="visible"||$==="idle"||$==="interaction"||$.startsWith("media:")}function Jz($){if(!$)return!1;let Z=$.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(Z)}function Xz($){let Z=new Set,J=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useReactiveProp|useLocalStorage|useSessionStorage|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let X of $){let Y;while((Y=J.exec(X))!==null)Z.add(Y[1]);J.lastIndex=0}return[...Z]}async function A1($,Z,J,X,Y,Q,G,z=new Set,q){let{extractVariables:K}=await n("stx/variable-extractor",()=>import("./chunk-xvndd7h6.js")),U=z??new Set;if(U.has($))return`[Circular component reference: ${$}]`;let W=new Set(U);W.add($);let H=typeof Z.client==="string"?Z.client.trim():"";if("client"in Z)delete Z.client;let j=H&&H!=="load"&&Zz(H)?H:"";try{let B=(d)=>d.split("-").map((m)=>m.charAt(0).toUpperCase()+m.slice(1)).join(""),V=(d)=>d.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),F=$.endsWith(".stx")?$.slice(0,-4):$,O=null,_=Y.__importedComponents;if(_){let d=[F,F.toLowerCase(),B(F),V(F)];for(let m of d)if(_.has(m)){O=_.get(m);break}}let L=[];if(!O){let d=[`${F}.stx`,`${B(F)}.stx`,`${V(F)}.stx`],m=[...new Set(d)],z0=Y.__originalFilePath,o=[];if(z0){let L0=h.join(h.dirname(z0),"components");o.push(L0)}if(X)o.push(X);let V0=G._rootComponentsDir;if(typeof V0==="string"&&!o.includes(V0))o.push(V0);let w0=h.join(h.dirname(Q),"components");if(!o.includes(w0))o.push(w0);if(G.componentsDir&&G.componentsDir!==X&&!o.includes(G.componentsDir))o.push(G.componentsDir);let S0=typeof G.root==="string"?h.resolve(G.root):void 0,a0=S0??h.dirname(Q),y0=[];if(S0)y0.push(h.resolve(S0,"resources/views/components")),y0.push(h.resolve(S0,"resources/components")),y0.push(h.resolve(S0,"src/components")),y0.push(h.resolve(S0,"components"));y0.push(h.resolve(import.meta.dir,"components"));for(let L0 of y0)if(!o.includes(L0))o.push(L0);let c0=G._pluginComponentDirs;if(Array.isArray(c0)){for(let L0 of c0)if(typeof L0==="string"&&!o.includes(L0))o.push(L0)}if(G.fallbackComponentsDir&&!o.includes(G.fallbackComponentsDir))o.push(G.fallbackComponentsDir);let X1=[...new Set(o.map((L0)=>{if(!L0)return L0;return h.isAbsolute(L0)?L0:h.resolve(a0,L0)}))];o.length=0,o.push(...X1);let r=`${F}\x00${Q}\x00${X1.join("\x00")}`,t0=b9.get(r);if(t0)if(await s(t0))O=t0;else b9.delete(r);if(!O&&(F.startsWith("./")||F.startsWith("../")))O=h.resolve(h.dirname(Q),`${F}.stx`),L.push(O);else if(!O)for(let L0 of o){if(!L0)continue;for(let E2 of m){let b2=h.join(L0,E2);if(L.push(b2),await s(b2)){O=b2;break}}if(O)break;if(!O)try{let E2=await import("fs");if(!E2.statSync(L0,{throwIfNoEntry:!1})?.isDirectory())continue;let l8=8,C9=[{path:L0,depth:0}];while(C9.length>0&&!O){let y2=C9.pop();if(y2.depth>=l8)continue;let u$;try{u$=E2.readdirSync(y2.path,{withFileTypes:!0})}catch{continue}for(let C2 of u$){if(!C2.isDirectory())continue;if(C2.name==="node_modules"||C2.name.startsWith("."))continue;let d$=h.join(y2.path,C2.name);for(let c8 of m){let S9=h.join(d$,c8);if(L.push(S9),await s(S9)){O=S9;break}}if(O)break;C9.push({path:d$,depth:y2.depth+1})}}}catch{}if(O)break}if(O)b9.set(r,O)}if(!O||!await s(O)){let d=L.length>0?`
3617
3616
  Searched paths:
3618
3617
  ${L.map((m)=>` - ${m}`).join(`
3619
- `)}`:"";return`[Error loading component: ENOENT: no such file or directory, open '${$}']${d}`}q.add(O);let w;if(A2.has(O))w=A2.get(O);else try{w=await Bun.file(O).text(),A2.set(O,w)}catch(d){return`[Error loading component: ${d instanceof Error?d.message:String(d)}]`}let R=new Set(["__originalFilePath","__importedComponents",S2,"__stx_client_signal_names","__stxServeContext","__stx_scope_seq"]),D={};for(let[d,m]of Object.entries(Y))if(!d.startsWith("__")||R.has(d))D[d]=m;let M=J;if(J.includes("@include")){let{processIncludes:d}=await o("stx/includes",()=>import("./chunk-6gdycmxr.js"));M=await d(J,Y,Q,G,q)}let I=i0(M),N=[],A=I.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(d,m)=>{let z0=I.scripts[Number(m)]||"",n=z0.match(/^<script\b([^>]*)>/i)?.[1]||"",V0=n.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),w0=!V0||["module","text/javascript","application/javascript"].includes(V0);if(!/\bserver\b/i.test(n)&&w0)return N.push(z0),"";return z0}),{extractSlotContent:T}=await o("stx/slots",()=>import("./chunk-5a19dhx5.js")),k=T(A),y={};if(k.defaultSlot?.trim())y.default=k.defaultSlot;for(let[d,m]of k.namedSlots)y[d]=m.content;let E=Y.__stx_scope_seq??={n:0,key:Bun.hash(String(Y.__filename??Q)).toString(36).slice(0,6)},b=`stx_${F.replace(/[^a-zA-Z0-9]/g,"_")}_${++E.n}_${E.key}`,C={...D,$uid:b,...Z,props:Z,slot:A,$slots:y,__processedComponents:W,__sections:{},__stx_signals_gate:Q1(w)||$z(J)};tG(w,C);let v=w,P=X9(v);if(P)v=P.content.trim();let g=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,x=[...w.matchAll(g)],$0=[],r0=x.some((d)=>/\bserver\b/.test(d[1]||"")&&/\bcache\b/.test(d[1]||"")),A0=null,C0=null,Z0=null,H0=0,k0=null;if(pG(G),r0&&f$>0){let d=iG({props:Z,slot:J,buildMode:G.buildMode??"",skipEventDirectives:G.skipEventDirectives===!0,uid:b});if(d!==null){A0=`${O}\x00${V1(w)}\x00${d}`;let m=y9.get(A0);if(m){for(let z0 of m.dependencies)q.add(z0);if(e$(Y,m.clientFactories),E.n+=m.uidsConsumed,m.preservedClientExpressions.length>0){let z0=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[]);for(let n of m.preservedClientExpressions)z0.add(n);Y.__stx_preserved_client_expressions=[...z0]}return m.output}C0=new Set(q),Z0=a$(Y),H0=E.n,k0=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[])}}for(let d of x){let m=d[1]||"",z0=d[2]||"",n=m.includes("server");if(D1(m)&&z0.trim())z0=N1(z0);if(n&&z0)try{await K(z0,C,O)}catch(w0){}if(!n){let w0=z0.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),S0=w0.includes("{{")&&w0.includes("}}"),a0=w0.includes("{!!")&&w0.includes("!!}");if(S0||a0)w0=l9(w0,C);let y0=m.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");$0.push(`<script${y0}>${w0}</script>`)}}let b0=w.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),d0=b0?b0[1]:"",i=b0?b0[2]:"",l="",K0=d0&&/\bscoped\b/i.test(d0);if(b0)l=`<style${d0}>${i}</style>`;let J0=v;if(J0=J0.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),b0)J0=J0.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let d=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,m=[];if(J0=J0.replace(d,(z0,n)=>{let V0=n.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(V0)m.push(`<style${V0[1]}>${V0[2]}</style>`);return""}),J0=J0.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),m.length>0)l=`${l}${m.join(`
3620
- `)}`}if(J&&J0.includes("{{ text || slot }}"))J0=J0.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>J);let{applySlots:B0}=await o("stx/slots",()=>import("./chunk-5a19dhx5.js")),{defaultSlot:I0,namedSlots:L1}=k;J0=await B0(J0,I0,L1,C);let I2=$0.some((d)=>/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useReactiveProp|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(d)),T2=Zz($0),S=Array.isArray(C.__stx_client_signal_names)?C.__stx_client_signal_names:[];if(T2.length>0||S.length>0)C.__stx_client_signal_names=[...new Set([...S,...T2])];let f={...G,_rootComponentsDir:G._rootComponentsDir||G.componentsDir,componentsDir:h.dirname(O),skipSignalsRuntime:!0,skipEventDirectives:I2||$0.length===0,defaultLayout:void 0};C.__stxProcessingDepth=(Y.__stxProcessingDepth||0)+1;let c=await C$(J0,C,O,f,q),t=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[]);for(let d of c.matchAll(/\{\{([\s\S]*?)\}\}/g))t.add(d[1].trim());if(t.size>0)Y.__stx_preserved_client_expressions=[...t];let G0=b,X0=c;if(I2){let d="";if(Object.keys(Z).length>0)try{d=` data-stx-props="${k8(JSON.stringify(Z))}"`}catch{}let m=j?` stx-hydrate="${k8(j)}"`:"";X0=`<div data-stx-scope="${G0}"${d}${m}>${c}</div>`;let z0=await Promise.all($0.map(async(n)=>{let V0=n.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!V0)return n;let[,w0,S0]=V0,{vendorStyleTags:a0,factoryBody:y0}=await Yz(S0,O,G.buildMode==="compile"),c0=j?null:f9(Y,y0),X1=c0?`window.__stxComponentFactories[${JSON.stringify(c0)}](${JSON.stringify(G0)});`:`(${y0})(${JSON.stringify(G0)});`;if(j)return`${a0}<script type="stx/island" data-stx-island="${G0}" data-stx-scoped${w0}>${X1}</script>`;return`${a0}<script data-stx-scoped data-stx-run="always"${w0}>${X1}</script>`}));if(X0=X0+`
3618
+ `)}`:"";return`[Error loading component: ENOENT: no such file or directory, open '${$}']${d}`}q.add(O);let w;if(A2.has(O))w=A2.get(O);else try{w=await Bun.file(O).text(),A2.set(O,w)}catch(d){return`[Error loading component: ${d instanceof Error?d.message:String(d)}]`}let R=new Set(["__originalFilePath","__importedComponents",S2,"__stx_client_signal_names","__stxServeContext","__stx_scope_seq"]),D={};for(let[d,m]of Object.entries(Y))if(!d.startsWith("__")||R.has(d))D[d]=m;let M=J;if(J.includes("@include")){let{processIncludes:d}=await n("stx/includes",()=>import("./chunk-qww39be9.js"));M=await d(J,Y,Q,G,q)}let I=i0(M),N=[],A=I.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(d,m)=>{let z0=I.scripts[Number(m)]||"",o=z0.match(/^<script\b([^>]*)>/i)?.[1]||"",V0=o.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),w0=!V0||["module","text/javascript","application/javascript"].includes(V0);if(!/\bserver\b/i.test(o)&&w0)return N.push(z0),"";return z0}),{extractSlotContent:T}=await n("stx/slots",()=>import("./chunk-evfct6hb.js")),k=T(A),y={};if(k.defaultSlot?.trim())y.default=k.defaultSlot;for(let[d,m]of k.namedSlots)y[d]=m.content;let E=Y.__stx_scope_seq??={n:0,key:Bun.hash(String(Y.__filename??Q)).toString(36).slice(0,6)},b=`stx_${F.replace(/[^a-zA-Z0-9]/g,"_")}_${++E.n}_${E.key}`,C={...D,$uid:b,...Z,props:Z,slot:A,$slots:y,__processedComponents:W,__sections:{},__stx_signals_gate:Q1(w)||Jz(J)};$z(w,C);let v=w,P=X9(v);if(P)v=P.content.trim();let g=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,x=[...w.matchAll(g)],$0=[],r0=x.some((d)=>/\bserver\b/.test(d[1]||"")&&/\bcache\b/.test(d[1]||"")),A0=null,C0=null,Z0=null,H0=0,k0=null;if(nG(G),r0&&f$>0){let d=oG({props:Z,slot:J,buildMode:G.buildMode??"",skipEventDirectives:G.skipEventDirectives===!0,uid:b});if(d!==null){A0=`${O}\x00${V1(w)}\x00${d}`;let m=y9.get(A0);if(m){for(let z0 of m.dependencies)q.add(z0);if(e$(Y,m.clientFactories),E.n+=m.uidsConsumed,m.preservedClientExpressions.length>0){let z0=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[]);for(let o of m.preservedClientExpressions)z0.add(o);Y.__stx_preserved_client_expressions=[...z0]}return m.output}C0=new Set(q),Z0=a$(Y),H0=E.n,k0=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[])}}for(let d of x){let m=d[1]||"",z0=d[2]||"",o=m.includes("server");if(D1(m)&&z0.trim())z0=N1(z0);if(o&&z0)try{await K(z0,C,O)}catch(w0){}if(!o){let w0=z0.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),S0=w0.includes("{{")&&w0.includes("}}"),a0=w0.includes("{!!")&&w0.includes("!!}");if(S0||a0)w0=l9(w0,C);let y0=m.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");$0.push(`<script${y0}>${w0}</script>`)}}let b0=w.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),d0=b0?b0[1]:"",i=b0?b0[2]:"",l="",K0=d0&&/\bscoped\b/i.test(d0);if(b0)l=`<style${d0}>${i}</style>`;let J0=v;if(J0=J0.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),b0)J0=J0.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let d=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,m=[];if(J0=J0.replace(d,(z0,o)=>{let V0=o.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(V0)m.push(`<style${V0[1]}>${V0[2]}</style>`);return""}),J0=J0.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),m.length>0)l=`${l}${m.join(`
3619
+ `)}`}if(J&&J0.includes("{{ text || slot }}"))J0=J0.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>J);let{applySlots:B0}=await n("stx/slots",()=>import("./chunk-evfct6hb.js")),{defaultSlot:I0,namedSlots:L1}=k;J0=await B0(J0,I0,L1,C);let I2=$0.some((d)=>/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useReactiveProp|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(d)),T2=Xz($0),S=Array.isArray(C.__stx_client_signal_names)?C.__stx_client_signal_names:[];if(T2.length>0||S.length>0)C.__stx_client_signal_names=[...new Set([...S,...T2])];let f={...G,_rootComponentsDir:G._rootComponentsDir||G.componentsDir,componentsDir:h.dirname(O),skipSignalsRuntime:!0,skipEventDirectives:I2||$0.length===0,defaultLayout:void 0};C.__stxProcessingDepth=(Y.__stxProcessingDepth||0)+1;let c=await C$(J0,C,O,f,q),t=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[]);for(let d of c.matchAll(/\{\{([\s\S]*?)\}\}/g))t.add(d[1].trim());if(t.size>0)Y.__stx_preserved_client_expressions=[...t];let G0=b,X0=c;if(I2){let d="";if(Object.keys(Z).length>0)try{d=` data-stx-props="${I8(JSON.stringify(Z))}"`}catch{}let m=j?` stx-hydrate="${I8(j)}"`:"";X0=`<div data-stx-scope="${G0}"${d}${m}>${c}</div>`;let z0=await Promise.all($0.map(async(o)=>{let V0=o.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!V0)return o;let[,w0,S0]=V0,{vendorStyleTags:a0,factoryBody:y0}=await Gz(S0,O,G.buildMode==="compile"),c0=j?null:f9(Y,y0),X1=c0?`window.__stxComponentFactories[${JSON.stringify(c0)}](${JSON.stringify(G0)});`:`(${y0})(${JSON.stringify(G0)});`;if(j)return`${a0}<script type="stx/island" data-stx-island="${G0}" data-stx-scoped${w0}>${X1}</script>`;return`${a0}<script data-stx-scoped data-stx-run="always" data-stx-owner="${G0}"${w0}>${X1}</script>`}));if(X0=X0+`
3621
3620
  `+z0.join(`
3622
3621
  `),l)X0+=`
3623
3622
  `+l}else{if(l)X0+=`
3624
- `+l;if($0.length>0){let d=C.__stx_event_bindings||[],m=I9(C),z0=await Promise.all($0.map(async(n)=>{let V0=n.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!V0)return n;return await T9(V0[1],{eventBindings:d,templateContent:X0,filePath:O,projectRoot:process.cwd(),serverData:m})}));X0+=`
3623
+ `+l;if($0.length>0){let d=C.__stx_event_bindings||[],m=I9(C),z0=await Promise.all($0.map(async(o)=>{let V0=o.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!V0)return o;return await T9(V0[1],{eventBindings:d,templateContent:X0,filePath:O,projectRoot:process.cwd(),serverData:m})}));X0+=`
3625
3624
  `+z0.join(`
3626
3625
  `),C.__stx_event_bindings=[]}}if(K0){let d=H9(X0,O);if(d.hasScoped)X0=d.html}if(A0&&C0){let d=Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[];y9.set(A0,{output:X0,dependencies:[...q].filter((m)=>!C0.has(m)),clientFactories:Z0?t$(Y,Z0):[],uidsConsumed:E.n-H0,preservedClientExpressions:k0?d.filter((m)=>!k0.has(m)):[]})}return N.length>0?`${X0}
3627
3626
  ${N.join(`
3628
- `)}`:X0}catch(B){return`[Error processing component: ${B instanceof Error?B.message:String(B)}]`}finally{U.delete($)}}async function s($){return Bun.file($).exists()}function x$($,Z){let J=h.resolve(Z),X=h.resolve($),Y=J.endsWith(h.sep)?J:J+h.sep;if(X===J||X.startsWith(Y))return X;return null}async function Jz($,Z,J,X){let Y=Z.startsWith("layouts/")?Z.slice(8):Z,Q=h.join($,Y);for(let G of Q.endsWith(".stx")?[Q]:[Q,`${Q}.stx`])if(await s(G)){if(X)console.log(`Found layout in ${$}: ${G}`);return J?.add(G),G}return null}async function s2($,Z,J,X){let Y=await Xz($,Z,J,X);if(Y===null)return null;let Q=x$(Y,process.cwd());if(Q)return Q;let G=[J.root,J.layoutsDir,J.fallbackLayoutsDir,J.componentsDir,J.partialsDir,J.pagesDir].filter((z)=>typeof z==="string"&&z.length>0);for(let z of G){let q=h.isAbsolute(z)?z:h.resolve(process.cwd(),z);if(x$(Y,q))return h.resolve(Y)}return console.warn(`[stx] rejected resolved template path that escapes project root: ${Y} (template: ${$}, from: ${Z})`),null}async function Xz($,Z,J,X){if(J.debug)console.log(`Resolving template path: ${$} from ${Z}`);let Y=h.dirname(Z),Q=process.cwd();if($.startsWith("/")){let H=h.join(Q,$),j=x$(H,Q);if(!j)return console.warn(`[stx] rejected template path that escapes project root: ${$} (from ${Z})`),null;if(J.debug)console.log(`Checking absolute path: ${j}`);if(await s(j)&&X)X.add(j);return j}let G=h.join(Y,$);if(await s(G)){if(J.debug)console.log(`Found direct path: ${G}`);if(X)X.add(G);return G}if(!$.endsWith(".stx")&&!$.endsWith(".jsx")&&!$.endsWith(".tsx"))for(let H of[".stx",".tsx",".jsx"]){let j=`${G}${H}`;if(await s(j)){if(J.debug)console.log(`Found direct path with extension: ${j}`);if(X)X.add(j);return j}}let z=[];if(J.layoutsDir)z.push(h.isAbsolute(J.layoutsDir)?J.layoutsDir:h.resolve(process.cwd(),J.layoutsDir));let q=h.resolve(Y),K=process.cwd();for(let H=0;H<10;H++){let j=h.join(q,"layouts"),B=!1;try{B=cG.statSync(j,{throwIfNoEntry:!1})?.isDirectory()??!1}catch{}if(B){z.push(j);break}let V=h.dirname(q);if(V===q||V.length<K.length)break;q=V}for(let H of z){let j=await Jz(H,$,X,J.debug);if(j)return j}if(J.fallbackLayoutsDir){let H=h.isAbsolute(J.fallbackLayoutsDir)?J.fallbackLayoutsDir:h.resolve(process.cwd(),J.fallbackLayoutsDir),j=$.startsWith("layouts/")?$.slice(8):$,B=[h.join(H,j)];if(!$.endsWith(".stx"))B.push(`${B[0]}.stx`);for(let V of B)if(await s(V)){if(J.debug)console.log(`Found in options.fallbackLayoutsDir: ${V}`);if(X)X.add(V);return V}}if($.startsWith("layouts/")||$.includes("/layouts/")){let H=$.split("layouts/"),j=h.join(J.partialsDir||Y,"layouts",H[1]);if(await s(j)){if(J.debug)console.log(`Found in layouts path: ${j}`);if(X)X.add(j);return j}if(!j.endsWith(".stx")){let B=`${j}.stx`;if(await s(B)){if(J.debug)console.log(`Found in layouts path with extension: ${B}`);if(X)X.add(B);return B}}}if(J.partialsDir){let H=h.join(J.partialsDir,"layouts");if(await s(H)){let j=h.join(H,$);if(await s(j)){if(J.debug)console.log(`Found in partials layouts dir: ${j}`);if(X)X.add(j);return j}if(!$.endsWith(".stx")){let B=`${j}.stx`;if(await s(B)){if(J.debug)console.log(`Found in partials layouts dir with extension: ${B}`);if(X)X.add(B);return B}}}}let U=J.partialsDir||h.join(process.cwd(),"views"),W=h.join(U,$);if(await s(W)){if(J.debug)console.log(`Found in views path: ${W}`);if(X)X.add(W);return W}if(!$.endsWith(".stx")){let H=`${W}.stx`;if(await s(H)){if(J.debug)console.log(`Found in views path with extension: ${H}`);if(X)X.add(H);return H}}if(Y.includes("temp")){let H=h.join(h.dirname(Y),"layouts",$);if(await s(H)){if(J.debug)console.log(`Found in temp layouts dir: ${H}`);if(X)X.add(H);return H}if(!$.endsWith(".stx")){let j=`${H}.stx`;if(await s(j)){if(J.debug)console.log(`Found in temp layouts dir with extension: ${j}`);if(X)X.add(j);return j}}}if(J.debug)console.warn(`Template not found after trying all paths: ${$} (referenced from ${Z})`);else console.warn(`Template not found: ${$} (referenced from ${Z})`);return null}function C8($,Z,J){let X=0,Y="",Q="";try{if(typeof Z==="number"&&Z>=0){let G=$.split(`
3627
+ `)}`:X0}catch(B){return`[Error processing component: ${B instanceof Error?B.message:String(B)}]`}finally{U.delete($)}}async function s($){return Bun.file($).exists()}function x$($,Z){let J=h.resolve(Z),X=h.resolve($),Y=J.endsWith(h.sep)?J:J+h.sep;if(X===J||X.startsWith(Y))return X;return null}async function Yz($,Z,J,X){let Y=Z.startsWith("layouts/")?Z.slice(8):Z,Q=h.join($,Y);for(let G of Q.endsWith(".stx")?[Q]:[Q,`${Q}.stx`])if(await s(G)){if(X)console.log(`Found layout in ${$}: ${G}`);return J?.add(G),G}return null}async function s2($,Z,J,X){let Y=await Qz($,Z,J,X);if(Y===null)return null;let Q=x$(Y,process.cwd());if(Q)return Q;let G=[J.root,J.layoutsDir,J.fallbackLayoutsDir,J.componentsDir,J.partialsDir,J.pagesDir].filter((z)=>typeof z==="string"&&z.length>0);for(let z of G){let q=h.isAbsolute(z)?z:h.resolve(process.cwd(),z);if(x$(Y,q))return h.resolve(Y)}return console.warn(`[stx] rejected resolved template path that escapes project root: ${Y} (template: ${$}, from: ${Z})`),null}async function Qz($,Z,J,X){if(J.debug)console.log(`Resolving template path: ${$} from ${Z}`);let Y=h.dirname(Z),Q=process.cwd();if($.startsWith("/")){let H=h.join(Q,$),j=x$(H,Q);if(!j)return console.warn(`[stx] rejected template path that escapes project root: ${$} (from ${Z})`),null;if(J.debug)console.log(`Checking absolute path: ${j}`);if(await s(j)&&X)X.add(j);return j}let G=h.join(Y,$);if(await s(G)){if(J.debug)console.log(`Found direct path: ${G}`);if(X)X.add(G);return G}if(!$.endsWith(".stx")&&!$.endsWith(".jsx")&&!$.endsWith(".tsx"))for(let H of[".stx",".tsx",".jsx"]){let j=`${G}${H}`;if(await s(j)){if(J.debug)console.log(`Found direct path with extension: ${j}`);if(X)X.add(j);return j}}let z=[];if(J.layoutsDir)z.push(h.isAbsolute(J.layoutsDir)?J.layoutsDir:h.resolve(process.cwd(),J.layoutsDir));let q=h.resolve(Y),K=process.cwd();for(let H=0;H<10;H++){let j=h.join(q,"layouts"),B=!1;try{B=iG.statSync(j,{throwIfNoEntry:!1})?.isDirectory()??!1}catch{}if(B){z.push(j);break}let V=h.dirname(q);if(V===q||V.length<K.length)break;q=V}for(let H of z){let j=await Yz(H,$,X,J.debug);if(j)return j}if(J.fallbackLayoutsDir){let H=h.isAbsolute(J.fallbackLayoutsDir)?J.fallbackLayoutsDir:h.resolve(process.cwd(),J.fallbackLayoutsDir),j=$.startsWith("layouts/")?$.slice(8):$,B=[h.join(H,j)];if(!$.endsWith(".stx"))B.push(`${B[0]}.stx`);for(let V of B)if(await s(V)){if(J.debug)console.log(`Found in options.fallbackLayoutsDir: ${V}`);if(X)X.add(V);return V}}if($.startsWith("layouts/")||$.includes("/layouts/")){let H=$.split("layouts/"),j=h.join(J.partialsDir||Y,"layouts",H[1]);if(await s(j)){if(J.debug)console.log(`Found in layouts path: ${j}`);if(X)X.add(j);return j}if(!j.endsWith(".stx")){let B=`${j}.stx`;if(await s(B)){if(J.debug)console.log(`Found in layouts path with extension: ${B}`);if(X)X.add(B);return B}}}if(J.partialsDir){let H=h.join(J.partialsDir,"layouts");if(await s(H)){let j=h.join(H,$);if(await s(j)){if(J.debug)console.log(`Found in partials layouts dir: ${j}`);if(X)X.add(j);return j}if(!$.endsWith(".stx")){let B=`${j}.stx`;if(await s(B)){if(J.debug)console.log(`Found in partials layouts dir with extension: ${B}`);if(X)X.add(B);return B}}}}let U=J.partialsDir||h.join(process.cwd(),"views"),W=h.join(U,$);if(await s(W)){if(J.debug)console.log(`Found in views path: ${W}`);if(X)X.add(W);return W}if(!$.endsWith(".stx")){let H=`${W}.stx`;if(await s(H)){if(J.debug)console.log(`Found in views path with extension: ${H}`);if(X)X.add(H);return H}}if(Y.includes("temp")){let H=h.join(h.dirname(Y),"layouts",$);if(await s(H)){if(J.debug)console.log(`Found in temp layouts dir: ${H}`);if(X)X.add(H);return H}if(!$.endsWith(".stx")){let j=`${H}.stx`;if(await s(j)){if(J.debug)console.log(`Found in temp layouts dir with extension: ${j}`);if(X)X.add(j);return j}}}if(J.debug)console.warn(`Template not found after trying all paths: ${$} (referenced from ${Z})`);else console.warn(`Template not found: ${$} (referenced from ${Z})`);return null}function S8($,Z,J){let X=0,Y="",Q="";try{if(typeof Z==="number"&&Z>=0){let G=$.split(`
3629
3628
  `),z=0;for(let q=0;q<G.length;q++)if(z+=G[q].length+1,z>=Z){X=q+1,Y=G[q].trim();let K=Math.max(0,q-2),U=Math.min(G.length,q+3);Q=G.slice(K,U).map((W,H)=>{let j=K+H+1;return`${j===X?"> ":" "}${j}: ${W}`}).join(`
3630
- `);break}}else if(J){let G=$.indexOf(J);if(G>=0)return C8($,G)}}catch{}return{lineNumber:X,lineContent:Y,context:Q}}var a={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",yellow:"\x1B[33m",blue:"\x1B[34m",cyan:"\x1B[36m",gray:"\x1B[90m",bgRed:"\x1B[41m",bgYellow:"\x1B[43m"};function j0($,Z,J,X,Y,Q){let{lineNumber:G,context:z}=C8(X,Y,Q),q=J.split("/").pop(),K=0;if(typeof Y==="number"&&Y>=0&&X){let W=X.lastIndexOf(`
3629
+ `);break}}else if(J){let G=$.indexOf(J);if(G>=0)return S8($,G)}}catch{}return{lineNumber:X,lineContent:Y,context:Q}}var a={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",yellow:"\x1B[33m",blue:"\x1B[34m",cyan:"\x1B[36m",gray:"\x1B[90m",bgRed:"\x1B[41m",bgYellow:"\x1B[43m"};function j0($,Z,J,X,Y,Q){let{lineNumber:G,context:z}=S8(X,Y,Q),q=J.split("/").pop(),K=0;if(typeof Y==="number"&&Y>=0&&X){let W=X.lastIndexOf(`
3631
3630
  `,Math.max(0,Y-1));K=Y-(W+1)+1}let U="";if(G>0)U+=`
3632
3631
  ${J}:${G}${K>0?`:${K}`:""}: ${$.toLowerCase()} error: ${Z}
3633
3632
  `;if(U+=`
@@ -3640,8 +3639,8 @@ ${a.yellow}${a.bold}Message:${a.reset} ${Z}
3640
3639
  `,z)U+=`
3641
3640
  ${a.blue}${a.bold}Context:${a.reset}
3642
3641
  ${a.dim}${z}${a.reset}
3643
- `;return U}function JL(){A2.clear(),b9.clear(),y9.clear()}function XL(){return{size:A2.size,maxSize:500}}var v$=T1(128);async function Yz($,Z,J){let X=V1($,Z,J),Y=v$.get(X);if(Y){if(b8(Y.deps))return Y;v$.delete(X)}let Q=g$($,{filePath:Z,projectRoot:process.cwd()}),G=Q.code,z=h$(Q.styles);G=p1(G).code;let{hasUserImports:q,bundleClientScript:K}=await o("stx/client-script-bundler",()=>import("./chunk-45az9zht.js")),U=[],W=!1;if(q(G)){let O=G;G=await K(O,Z,{projectRoot:process.cwd(),minify:J,collectInputs:U}),W=G===O}let{stripStxRuntimeImports:H}=await o("stx/signal-processing",()=>import("./chunk-d8t4sjsp.js"));G=H(G);let j=e0(G),B=sG(j),V=`function(__scopeId) {
3644
- ${h1("const",[...T8,...B],j)}
3642
+ `;return U}function ZL(){A2.clear(),b9.clear(),y9.clear()}function JL(){return{size:A2.size,maxSize:500}}var v$=T1(128);async function Gz($,Z,J){let X=V1($,Z,J),Y=v$.get(X);if(Y){if(y8(Y.deps))return Y;v$.delete(X)}let Q=g$($,{filePath:Z,projectRoot:process.cwd()}),G=Q.code,z=h$(Q.styles);G=p1(G).code;let{hasUserImports:q,bundleClientScript:K}=await n("stx/client-script-bundler",()=>import("./chunk-91ffbzmh.js")),U=[],W=!1;if(q(G)){let O=G;G=await K(O,Z,{projectRoot:process.cwd(),minify:J,collectInputs:U}),W=G===O}let{stripStxRuntimeImports:H}=await n("stx/signal-processing",()=>import("./chunk-rb87b7kr.js"));G=H(G);let j=Z1(G),B=aG(j),V=`function(__scopeId) {
3643
+ ${h1("const",[...E8,...B],j)}
3645
3644
  const __scope = window.stx._scopes = window.stx._scopes || {};
3646
3645
  const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
3647
3646
  __scopeVars.$refs = __scopeVars.$refs || {};
@@ -3669,18 +3668,18 @@ catch (e) {}
3669
3668
  finally {
3670
3669
  window.__STX_CURRENT_ELEMENT__ = __previousCurrentElement;
3671
3670
  }
3672
- }`,F={vendorStyleTags:z,factoryBody:V,deps:E8([...U,...Q.styles.map((O)=>O.resolvedPath)])};if(!W&&Q.unresolved.length===0)v$.set(X,F);return F}var Qz=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function Gz($){if($.startsWith(".")||$.startsWith("/"))return null;if($.startsWith("@")){let J=$.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!J)return null;return{pkg:J[1],subpath:J[2]||""}}let Z=$.match(/^([^/]+)(\/.*)?$/);if(!Z)return null;return{pkg:Z[1],subpath:Z[2]||""}}function zz($,Z){let J=Z;while(!0){let X=b1.join(J,"node_modules",$,"package.json");if(k2.existsSync(X))return b1.dirname(X);let Y=b1.dirname(J);if(Y===J)return null;J=Y}}function qz($,Z){if(!$||typeof $!=="object")return null;let J=(Y)=>{if(typeof Y==="string")return Y;if(Y&&typeof Y==="object"){if(typeof Y.import==="string")return Y.import;if(typeof Y.default==="string")return Y.default;if(typeof Y.import==="object")return J(Y.import);if(typeof Y.default==="object")return J(Y.default)}return null};if(Object.prototype.hasOwnProperty.call($,Z))return J($[Z]);let X=null;for(let Y of Object.keys($)){let Q=Y.indexOf("*");if(Q===-1)continue;let G=Y.slice(0,Q),z=Y.slice(Q+1);if(!Z.startsWith(G)||!Z.endsWith(z))continue;if(Z.length<G.length+z.length)continue;if(!X||G.length>X.prefix.length)X={pattern:Y,prefix:G,suffix:z}}if(X){let Y=Z.slice(X.prefix.length,Z.length-X.suffix.length),Q=J($[X.pattern]);if(Q)return Q.replace("*",Y)}return null}function Kz($,Z){let J=Gz($);if(!J||!J.subpath)return null;let X=zz(J.pkg,Z);if(!X)return null;let Y;try{Y=JSON.parse(k2.readFileSync(b1.join(X,"package.json"),"utf8"))}catch{return null}let Q=`.${J.subpath}`,G=qz(Y.exports,Q);if(!G)return null;let z=b1.resolve(X,G);return k2.existsSync(z)?z:null}function g$($,Z){let J=Z.filePath?b1.dirname(Z.filePath):Z.projectRoot||process.cwd(),X=Z.projectRoot||process.cwd(),Y=new Set,Q=[],G=[];return{code:$.replace(Qz,(q,K)=>{let U;try{if(K.startsWith("./")||K.startsWith("../")||K.startsWith("/")){if(U=K.startsWith("/")?K:b1.resolve(J,K),!k2.existsSync(U))throw Error(`file not found: ${U}`)}else{let W=null;try{W=Bun.resolveSync(K,X)}catch{W=Kz(K,X)}if(!W)throw Error(`could not resolve ${K} (Bun.resolveSync + exports fallback both failed)`);U=W}}catch(W){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(K)} (from ${Z.filePath||"<unknown>"}): ${W?.message||W}`),G.push(K),""}if(Y.has(U))return"";Y.add(U);try{let W=k2.readFileSync(U,"utf8");Q.push({source:K,resolvedPath:U,contents:W})}catch(W){console.warn(`[stx:vendor-css] could not read ${U}: ${W?.message||W}`),G.push(K)}return""}),styles:Q,unresolved:G}}function Uz($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function h$($){if($.length===0)return"";return`${$.map((Z)=>{return`<style data-stx-vendor="${Uz(Z.source)}" data-stx-layer="vendor">
3671
+ }`,F={vendorStyleTags:z,factoryBody:V,deps:b8([...U,...Q.styles.map((O)=>O.resolvedPath)])};if(!W&&Q.unresolved.length===0)v$.set(X,F);return F}var zz=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function qz($){if($.startsWith(".")||$.startsWith("/"))return null;if($.startsWith("@")){let J=$.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!J)return null;return{pkg:J[1],subpath:J[2]||""}}let Z=$.match(/^([^/]+)(\/.*)?$/);if(!Z)return null;return{pkg:Z[1],subpath:Z[2]||""}}function Kz($,Z){let J=Z;while(!0){let X=b1.join(J,"node_modules",$,"package.json");if(k2.existsSync(X))return b1.dirname(X);let Y=b1.dirname(J);if(Y===J)return null;J=Y}}function Uz($,Z){if(!$||typeof $!=="object")return null;let J=(Y)=>{if(typeof Y==="string")return Y;if(Y&&typeof Y==="object"){if(typeof Y.import==="string")return Y.import;if(typeof Y.default==="string")return Y.default;if(typeof Y.import==="object")return J(Y.import);if(typeof Y.default==="object")return J(Y.default)}return null};if(Object.prototype.hasOwnProperty.call($,Z))return J($[Z]);let X=null;for(let Y of Object.keys($)){let Q=Y.indexOf("*");if(Q===-1)continue;let G=Y.slice(0,Q),z=Y.slice(Q+1);if(!Z.startsWith(G)||!Z.endsWith(z))continue;if(Z.length<G.length+z.length)continue;if(!X||G.length>X.prefix.length)X={pattern:Y,prefix:G,suffix:z}}if(X){let Y=Z.slice(X.prefix.length,Z.length-X.suffix.length),Q=J($[X.pattern]);if(Q)return Q.replace("*",Y)}return null}function Wz($,Z){let J=qz($);if(!J||!J.subpath)return null;let X=Kz(J.pkg,Z);if(!X)return null;let Y;try{Y=JSON.parse(k2.readFileSync(b1.join(X,"package.json"),"utf8"))}catch{return null}let Q=`.${J.subpath}`,G=Uz(Y.exports,Q);if(!G)return null;let z=b1.resolve(X,G);return k2.existsSync(z)?z:null}function g$($,Z){let J=Z.filePath?b1.dirname(Z.filePath):Z.projectRoot||process.cwd(),X=Z.projectRoot||process.cwd(),Y=new Set,Q=[],G=[];return{code:$.replace(zz,(q,K)=>{let U;try{if(K.startsWith("./")||K.startsWith("../")||K.startsWith("/")){if(U=K.startsWith("/")?K:b1.resolve(J,K),!k2.existsSync(U))throw Error(`file not found: ${U}`)}else{let W=null;try{W=Bun.resolveSync(K,X)}catch{W=Wz(K,X)}if(!W)throw Error(`could not resolve ${K} (Bun.resolveSync + exports fallback both failed)`);U=W}}catch(W){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(K)} (from ${Z.filePath||"<unknown>"}): ${W?.message||W}`),G.push(K),""}if(Y.has(U))return"";Y.add(U);try{let W=k2.readFileSync(U,"utf8");Q.push({source:K,resolvedPath:U,contents:W})}catch(W){console.warn(`[stx:vendor-css] could not read ${U}: ${W?.message||W}`),G.push(K)}return""}),styles:Q,unresolved:G}}function Hz($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function h$($){if($.length===0)return"";return`${$.map((Z)=>{return`<style data-stx-vendor="${Hz(Z.source)}" data-stx-layer="vendor">
3673
3672
  @layer vendor {
3674
3673
  ${Z.contents}
3675
3674
  }
3676
3675
  </style>`}).join(`
3677
3676
  `)}
3678
- `}var Wz=f8;function p1($){let Z=x0($),J=new Set;for(let z of $.matchAll(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm))for(let q of z[1].split(",")){let K=q.trim().split(/\s+as\s+/).pop()?.replace(/^type\s+/,"").trim();if(K)J.add(K)}let X=new Set;for(let z of Z.matchAll(/\b(?:const|let|var|function|class)\s+([A-Za-z_$][\w$]*)/g))X.add(z[1]);for(let z of Z.matchAll(/\b(?:const|let|var)\s*\{([^}]*)\}/g))for(let q of z[1].split(",")){let K=q.trim().split(/[:=]/).pop()?.trim();if(K)X.add(K)}let Y=O2.filter((z)=>{if(J.has(z)||X.has(z))return!1;return new RegExp(`\\b${z}\\s*\\(`).test(Z)}),Q=g8(Z).filter((z)=>!J.has(z)&&!X.has(z));if(Y.length===0&&Q.length===0)return{code:$,imports:Y,models:Q};return{code:`${[Y.length>0?`import { ${Y.join(", ")} } from '@stacksjs/browser'`:"",Q.length>0?"import '@stacksjs/browser'":"",Q.length>0?`const { ${Q.join(", ")} } = window.StacksBrowser || {}`:""].filter(Boolean).join(`
3677
+ `}var jz=x8;function p1($){let Z=x0($),J=new Set;for(let z of $.matchAll(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm))for(let q of z[1].split(",")){let K=q.trim().split(/\s+as\s+/).pop()?.replace(/^type\s+/,"").trim();if(K)J.add(K)}let X=new Set;for(let z of Z.matchAll(/\b(?:const|let|var|function|class)\s+([A-Za-z_$][\w$]*)/g))X.add(z[1]);for(let z of Z.matchAll(/\b(?:const|let|var)\s*\{([^}]*)\}/g))for(let q of z[1].split(",")){let K=q.trim().split(/[:=]/).pop()?.trim();if(K)X.add(K)}let Y=O2.filter((z)=>{if(J.has(z)||X.has(z))return!1;return new RegExp(`\\b${z}\\s*\\(`).test(Z)}),Q=u8(Z).filter((z)=>!J.has(z)&&!X.has(z));if(Y.length===0&&Q.length===0)return{code:$,imports:Y,models:Q};return{code:`${[Y.length>0?`import { ${Y.join(", ")} } from '@stacksjs/browser'`:"",Q.length>0?"import '@stacksjs/browser'":"",Q.length>0?`const { ${Q.join(", ")} } = window.StacksBrowser || {}`:""].filter(Boolean).join(`
3679
3678
  `)}
3680
- ${$}`,imports:Y,models:Q}}var Hz=new Set(["Promise","Object","Array","Map","Set","Date","Error","JSON","Math","Number","String","RegExp","Symbol","WeakMap","WeakSet","Proxy","Reflect","Intl","URL","URLSearchParams","FormData","Headers","Request","Response","AbortController","EventTarget","Element","Document","Node","Window","Console","Storage","Navigator","Blob","File","FileReader","HTMLElement","SVGElement","Event","CustomEvent","DOMParser","XMLSerializer","WebSocket","Worker","SharedWorker","IntersectionObserver","MutationObserver","ResizeObserver","PerformanceObserver","Notification","Bun","Buffer","Process","Modal","Intl"]);function g8($){let Z=new Set,J=/\b([A-Z][a-zA-Z0-9]*)\s*\.\s*(all|find|first|get|where|orderBy|orderByDesc|limit|select|pluck|create|update|delete)\s*\(/g,X;while((X=J.exec($))!==null)if(!Hz.has(X[1]))Z.add(X[1]);return Array.from(Z)}function jz($){let Z=new Set;for(let J of $.matchAll(/\b(?:const|let|var|function|class)\s+([A-Za-z_$][\w$]*)/g))Z.add(J[1]);for(let J of $.matchAll(/\b(?:const|let|var)\s*\{([^}]*)\}/g))for(let X of J[1].split(",")){let Y=X.trim().split(/[:=]/).pop()?.trim();if(Y&&/^[A-Za-z_$][\w$]*$/.test(Y))Z.add(Y)}return Z}function h8($){let Z=new Set,J=new Set,X=$;X=X.replace(/^\s*import\s+type\s+\{[^}]*\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm,"// [type import stripped]");let Y=new Set,Q=/^\s*import\s+(?:type\s+)?{\s*([^}]+)\s*}\s+from\s+['"](@stacksjs\/browser|@stacksjs\/stx|stx)['"]\s*;?\s*$/gm,G;while((G=Q.exec($))!==null){let W=G[1],H=G[2];if(G[0].includes("import type"))continue;let j=[];for(let V of W.split(",")){let F=V.trim();if(!F||F.startsWith("type "))continue;let O=F.match(/^([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?$/);if(!O)continue;let _=O[1],L=O[2]||_;if(Y.add(_),Y.add(L),H==="stx"||H==="@stacksjs/stx")Z.add(_);else J.add(_);if(L!==_)j.push(`${L} = ${_}`)}let B=j.length>0?`var ${j.join(", ")}; /* [auto-import processed] */`:"// [auto-import processed]";X=X.replace(G[0],B)}let z=jz(X);for(let W of Wz){if(Y.has(W)||z.has(W))continue;if(new RegExp(`\\b${W}\\s*(?:<[^>]*>)?\\s*\\(`,"g").test(X))Z.add(W)}let q=x0(X),K=new Set;for(let W of X.matchAll(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm))for(let H of W[1].split(",")){let j=H.trim().replace(/^type\s+/,"").split(/\s+as\s+/);for(let B of j){let V=B.trim();if(V)K.add(V)}}for(let W of O2){if(Y.has(W)||z.has(W)||K.has(W))continue;if(new RegExp(`\\b${W}\\b`,"g").test(q))J.add(W)}let U=g8(X);for(let W of U)if(!Y.has(W)&&!z.has(W))J.add(W);return{code:X,stxImports:Array.from(Z),browserImports:Array.from(J)}}function u8($,Z){let J=[];if($.length>0)J.push(` var { ${$.join(", ")} } = window.stx || window;`);if(Z.length>0)J.push(` var { ${Z.join(", ")} } = window.StacksBrowser || {};`);if(J.length>0)return` // STX: auto-imported from stx and @stacksjs/browser
3679
+ ${$}`,imports:Y,models:Q}}var Bz=new Set(["Promise","Object","Array","Map","Set","Date","Error","JSON","Math","Number","String","RegExp","Symbol","WeakMap","WeakSet","Proxy","Reflect","Intl","URL","URLSearchParams","FormData","Headers","Request","Response","AbortController","EventTarget","Element","Document","Node","Window","Console","Storage","Navigator","Blob","File","FileReader","HTMLElement","SVGElement","Event","CustomEvent","DOMParser","XMLSerializer","WebSocket","Worker","SharedWorker","IntersectionObserver","MutationObserver","ResizeObserver","PerformanceObserver","Notification","Bun","Buffer","Process","Modal","Intl"]);function u8($){let Z=new Set,J=/\b([A-Z][a-zA-Z0-9]*)\s*\.\s*(all|find|first|get|where|orderBy|orderByDesc|limit|select|pluck|create|update|delete)\s*\(/g,X;while((X=J.exec($))!==null)if(!Bz.has(X[1]))Z.add(X[1]);return Array.from(Z)}function Vz($){let Z=new Set;for(let J of $.matchAll(/\b(?:const|let|var|function|class)\s+([A-Za-z_$][\w$]*)/g))Z.add(J[1]);for(let J of $.matchAll(/\b(?:const|let|var)\s*\{([^}]*)\}/g))for(let X of J[1].split(",")){let Y=X.trim().split(/[:=]/).pop()?.trim();if(Y&&/^[A-Za-z_$][\w$]*$/.test(Y))Z.add(Y)}return Z}function d8($){let Z=new Set,J=new Set,X=$;X=X.replace(/^\s*import\s+type\s+\{[^}]*\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm,"// [type import stripped]");let Y=new Set,Q=/^\s*import\s+(?:type\s+)?{\s*([^}]+)\s*}\s+from\s+['"](@stacksjs\/browser|@stacksjs\/stx|stx)['"]\s*;?\s*$/gm,G;while((G=Q.exec($))!==null){let W=G[1],H=G[2];if(G[0].includes("import type"))continue;let j=[];for(let V of W.split(",")){let F=V.trim();if(!F||F.startsWith("type "))continue;let O=F.match(/^([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?$/);if(!O)continue;let _=O[1],L=O[2]||_;if(Y.add(_),Y.add(L),H==="stx"||H==="@stacksjs/stx")Z.add(_);else J.add(_);if(L!==_)j.push(`${L} = ${_}`)}let B=j.length>0?`var ${j.join(", ")}; /* [auto-import processed] */`:"// [auto-import processed]";X=X.replace(G[0],B)}let z=Vz(X);for(let W of jz){if(Y.has(W)||z.has(W))continue;if(new RegExp(`\\b${W}\\s*(?:<[^>]*>)?\\s*\\(`,"g").test(X))Z.add(W)}let q=x0(X),K=new Set;for(let W of X.matchAll(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm))for(let H of W[1].split(",")){let j=H.trim().replace(/^type\s+/,"").split(/\s+as\s+/);for(let B of j){let V=B.trim();if(V)K.add(V)}}for(let W of O2){if(Y.has(W)||z.has(W)||K.has(W))continue;if(new RegExp(`\\b${W}\\b`,"g").test(q))J.add(W)}let U=u8(X);for(let W of U)if(!Y.has(W)&&!z.has(W))J.add(W);return{code:X,stxImports:Array.from(Z),browserImports:Array.from(J)}}function m8($,Z){let J=[];if($.length>0)J.push(` var { ${$.join(", ")} } = window.stx || window;`);if(Z.length>0)J.push(` var { ${Z.join(", ")} } = window.StacksBrowser || {};`);if(J.length>0)return` // STX: auto-imported from stx and @stacksjs/browser
3681
3680
  ${J.join(`
3682
3681
  `)}
3683
- ${Bz($,Z)}`;return""}function FL($,Z=[]){let{browserImports:J}=h8($),X=new Set(Z);return u8([],J.filter((Y)=>!X.has(Y)))}function Bz($,Z){let J=[...$.map((X)=>`['${X}', typeof ${X}, 'stx']`),...Z.map((X)=>`['${X}', typeof ${X}, '@stacksjs/browser']`)];if(J.length===0)return"";return` // STX: report auto-imports the client runtime did not provide
3682
+ ${Lz($,Z)}`;return""}function OL($,Z=[]){let{browserImports:J}=d8($),X=new Set(Z);return m8([],J.filter((Y)=>!X.has(Y)))}function Lz($,Z){let J=[...$.map((X)=>`['${X}', typeof ${X}, 'stx']`),...Z.map((X)=>`['${X}', typeof ${X}, '@stacksjs/browser']`)];if(J.length===0)return"";return` // STX: report auto-imports the client runtime did not provide
3684
3683
  [${J.join(", ")}].forEach(function (e) {
3685
3684
  if (e[1] !== 'undefined') return;
3686
3685
  console.error(
@@ -3689,10 +3688,10 @@ ${Bz($,Z)}`;return""}function FL($,Z=[]){let{browserImports:J}=h8($),X=new Set(Z
3689
3688
  + 'or it should be imported from a relative path so the bundler includes it.'
3690
3689
  );
3691
3690
  });
3692
- `}function I9($){let Z=$.__stxClientPayload;if(Z&&typeof Z==="object"){let X={};for(let Y in Z){let Q=Z[Y];if(typeof Q==="function")continue;X[Y]=Q}return X.__stxDeclaredPayload=!0,X}let J={};for(let X in $){if(X.startsWith("__")||X.startsWith("$"))continue;let Y=$[X];if(typeof Y==="function")continue;J[X]=Y}return J}function S8($,Z){let J=new Set;for(let X of $.split(",")){let Y=X.trim().replace(/^\.\.\./,"").trim();if(!Y)continue;if(Z){let Q=Y.lastIndexOf(":");if(Q!==-1)Y=Y.slice(Q+1).trim()}if(Y=Y.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(Y))J.add(Y)}return J}function Vz($){let Z=new Uint16Array($.length),J=0;for(let X=0;X<$.length;X++){let Y=$[X];if(Y===")"||Y==="]"||Y==="}")J=J>0?J-1:0;if(Z[X]=J,Y==="("||Y==="["||Y==="{")J++}return Z}function Lz($,Z){let J=x0($),X=Vz(J),Y=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${Z}\\b)`,"g");for(let Q of J.matchAll(Y)){let G=(Q.index??0)+Q[0].length-Q[1].length;if(X[G]===0)return!0}for(let Q of J.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(X[Q.index??0]===0&&S8(Q[1],!0).has(Z))return!0;for(let Q of J.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(X[Q.index??0]===0&&S8(Q[1],!1).has(Z))return!0;return!1}function _z($,Z){return new RegExp(`(?<![.#\\w$])${Z}(?![\\w$])`).test($)}var Oz=/token|secret|passw|apikey|api_key|privatekey|private_key|credential|webhook|bearer|jwt|signature/i,P8=new Set;function Fz($,Z){let J=Oz.test($),X=Z.length>32768;if(!J&&!X)return;if(P8.has($))return;if(P8.add($),J)console.warn(`[stx] server\u2192client bridge is publishing "${$}" into the page body. If it holds a credential, rename it with a "__" prefix (never bridged) and pass only what the template needs. See stacksjs/stx#1831.`);if(X)console.warn(`[stx] server\u2192client bridge is publishing ${(Z.length/1024).toFixed(1)}KB under "${$}". Every byte ships in the HTML on each request; prefix the binding with "__" and project just the fields the client reads.`)}function Y$($,Z){if(!Z)return"";let J=x0($),X=Z.__stxDeclaredPayload===!0,Y=[];for(let[Q,G]of Object.entries(Z)){if(!/^[A-Za-z_$][\w$]*$/.test(Q))continue;if(Q.startsWith("__")||Q.startsWith("$"))continue;if(!X&&!_z(J,Q))continue;if(Lz($,Q)){if(X)console.warn(`[stx] defineClientPayload declares "${Q}", but this client block also declares "${Q}" at the top level, so the server value is not published (emitting it would be a duplicate binding). Rename the local, or drop "${Q}" from defineClientPayload.`);continue}let z;try{z=JSON.stringify(G)}catch{continue}if(z===void 0)continue;Fz(Q,z),Y.push(` var ${Q} = ${z.replace(/</g,"\\u003c")};`)}if(Y.length===0)return"";return` // stx: server -> client data bridge (seeded from server scope)
3691
+ `}function I9($){let Z=$.__stxClientPayload;if(Z&&typeof Z==="object"){let X={};for(let Y in Z){let Q=Z[Y];if(typeof Q==="function")continue;X[Y]=Q}return X.__stxDeclaredPayload=!0,X}let J={};for(let X in $){if(X.startsWith("__")||X.startsWith("$"))continue;let Y=$[X];if(typeof Y==="function")continue;J[X]=Y}return J}function P8($,Z){let J=new Set;for(let X of $.split(",")){let Y=X.trim().replace(/^\.\.\./,"").trim();if(!Y)continue;if(Z){let Q=Y.lastIndexOf(":");if(Q!==-1)Y=Y.slice(Q+1).trim()}if(Y=Y.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(Y))J.add(Y)}return J}function _z($,Z){let J=x0($),{depths:X,balanced:Y}=h8(J),Q=(z)=>!Y||X[z]===0,G=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${Z}\\b)`,"g");for(let z of J.matchAll(G)){let q=(z.index??0)+z[0].length-z[1].length;if(Q(q))return!0}for(let z of J.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(Q(z.index??0)&&P8(z[1],!0).has(Z))return!0;for(let z of J.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(Q(z.index??0)&&P8(z[1],!1).has(Z))return!0;return!1}function Oz($,Z){return new RegExp(`(?<![.#\\w$])${Z}(?![\\w$])`).test($)}var Fz=/token|secret|passw|apikey|api_key|privatekey|private_key|credential|webhook|bearer|jwt|signature/i,v8=new Set;function wz($,Z){let J=Fz.test($),X=Z.length>32768;if(!J&&!X)return;if(v8.has($))return;if(v8.add($),J)console.warn(`[stx] server\u2192client bridge is publishing "${$}" into the page body. If it holds a credential, rename it with a "__" prefix (never bridged) and pass only what the template needs. See stacksjs/stx#1831.`);if(X)console.warn(`[stx] server\u2192client bridge is publishing ${(Z.length/1024).toFixed(1)}KB under "${$}". Every byte ships in the HTML on each request; prefix the binding with "__" and project just the fields the client reads.`)}function Y$($,Z){if(!Z)return"";let J=x0($),X=Z.__stxDeclaredPayload===!0,Y=[];for(let[Q,G]of Object.entries(Z)){if(!/^[A-Za-z_$][\w$]*$/.test(Q))continue;if(Q.startsWith("__")||Q.startsWith("$"))continue;if(!X&&!Oz(J,Q))continue;if(_z($,Q)){if(X)console.warn(`[stx] defineClientPayload declares "${Q}", but this client block also declares "${Q}" at the top level, so the server value is not published (emitting it would be a duplicate binding). Rename the local, or drop "${Q}" from defineClientPayload.`);continue}let z;try{z=JSON.stringify(G)}catch{continue}if(z===void 0)continue;wz(Q,z),Y.push(` var ${Q} = ${z.replace(/</g,"\\u003c")};`)}if(Y.length===0)return"";return` // stx: server -> client data bridge (seeded from server scope)
3693
3692
  ${Y.join(`
3694
3693
  `)}
3695
- `}var wz={left:0,middle:1,right:2};function Rz($){let Z=[];if($.self)Z.push("if ($event.target !== $el) return");for(let J of $.systemKeys)Z.push(`if (!$event.${J}Key) return`);if($.keys.length>0){let J=$.keys.map((X)=>`$event.key === '${X}'`).join(" || ");Z.push(`if (!(${J})) return`)}if($.mouse!==null){let J=wz[$.mouse];Z.push(`if ($event.button !== ${J}) return`)}if($.prevent)Z.push("$event.preventDefault()");if($.stop)Z.push("$event.stopPropagation()");return Z.join("; ")}function Dz($,Z){let{elementId:J,event:X,modifiers:Y}=$,Q=P9($.handler),G=Rz(Y),z=[];if(Y.once)z.push("once: true");if(Y.capture)z.push("capture: true");if(Y.passive)z.push("passive: true");let q=z.length>0?`, { ${z.join(", ")} }`:"",K="";if(G)K+=`${G}; `;let U=Q.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),W=`var $emit = function(name, detail) {
3694
+ `}var Rz={left:0,middle:1,right:2};function Dz($){let Z=[];if($.self)Z.push("if ($event.target !== $el) return");for(let J of $.systemKeys)Z.push(`if (!$event.${J}Key) return`);if($.keys.length>0){let J=$.keys.map((X)=>`$event.key === '${X}'`).join(" || ");Z.push(`if (!(${J})) return`)}if($.mouse!==null){let J=Rz[$.mouse];Z.push(`if ($event.button !== ${J}) return`)}if($.prevent)Z.push("$event.preventDefault()");if($.stop)Z.push("$event.stopPropagation()");return Z.join("; ")}function Nz($,Z){let{elementId:J,event:X,modifiers:Y}=$,Q=P9($.handler),G=Dz(Y),z=[];if(Y.once)z.push("once: true");if(Y.capture)z.push("capture: true");if(Y.passive)z.push("passive: true");let q=z.length>0?`, { ${z.join(", ")} }`:"",K="";if(G)K+=`${G}; `;let U=Q.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),W=`var $emit = function(name, detail) {
3696
3695
  $el.dispatchEvent(new CustomEvent(name, { detail: detail, bubbles: true, cancelable: true }))
3697
3696
  };`;function H(j){if(/\$emit\s*\(/.test(j))return`${W}
3698
3697
  ${j}`;return`var scope = $el.closest('[data-stx-scope]');
@@ -3735,23 +3734,23 @@ else {
3735
3734
  else {
3736
3735
  ${Q}
3737
3736
  }
3738
- }${q})`}function Nz($){if($.length===0)return"";return`
3737
+ }${q})`}function Mz($){if($.length===0)return"";return`
3739
3738
  // STX: auto-generated event bindings
3740
- ${$.map((J,X)=>Dz(J,X)).join(`
3741
- `)}`}function v8($){let Z=[],J=new Set,X=$.replace(/^\s*import\s+.*$/gm,""),Y=0,Q=X.length,G=0;while(G<Q){let z=X[G];if(z==="'"||z==='"'||z==="`"){let q=z;if(G++,q==="`"){let K=0;while(G<Q){if(X[G]==="\\"){G+=2;continue}if(X[G]==="`"&&K===0){G++;break}if(X[G]==="$"&&X[G+1]==="{"){K++,G+=2;continue}if(X[G]==="}"&&K>0){K--,G++;continue}G++}}else while(G<Q){if(X[G]==="\\"){G+=2;continue}if(X[G]===q){G++;break}G++}continue}if(z==="/"&&X[G+1]==="/"){while(G<Q&&X[G]!==`
3742
- `)G++;continue}if(z==="/"&&X[G+1]==="*"){G+=2;while(G<Q-1&&!(X[G]==="*"&&X[G+1]==="/"))G++;G+=2;continue}if(z==="{"){Y++,G++;continue}if(z==="}"){Y--,G++;continue}if(Y===0){let q=X.slice(G),K=q.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(K){let H=K[1];if(!H.startsWith("_")&&!J.has(H))Z.push(H),J.add(H);G+=K[0].length;continue}let U=q.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(U){U[1].split(",").forEach((H)=>{let j=H.trim(),B=j.indexOf(":"),V=B>=0?j.slice(B+1).trim().split(/[\s=]/)[0]:j.split(/[\s=]/)[0];if(V&&!V.startsWith("_")&&!J.has(V))Z.push(V),J.add(V)}),G+=U[0].length;continue}let W=q.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(W){let H=W[1];if(!H.startsWith("_")&&!J.has(H))Z.push(H),J.add(H);G+=W[0].length;continue}}G++}return Z}var Mz=new Set(["if","else","true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","switch","case","break","continue","for","while","do","try","catch","finally","const","let","var","function","class","import","export","default","async","await","yield","with","debugger","console","window","document","Math","JSON","Date","Array","Object","String","Number","Boolean","Symbol","Map","Set","Promise","Error","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","setTimeout","setInterval","clearTimeout","clearInterval","fetch","alert","confirm","prompt","event"]);function Az($){let Z=new Set,J=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function X(H){let j;while((j=J.exec(H))!==null){let B=j[0];if(!Mz.has(B))Z.add(B)}}let Y=/\{\{([\s\S]*?)\}\}/g,Q;while((Q=Y.exec($))!==null)X(Q[1]);let G=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((Q=G.exec($))!==null)X(Q[1]);let z=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((Q=z.exec($))!==null)X(Q[1]);let q=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((Q=q.exec($))!==null)X(Q[1]);let K=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((Q=K.exec($))!==null)X(Q[1]);let U=/@model\s*=\s*["']([^"']*)["']/gi;while((Q=U.exec($))!==null)X(Q[1]);let W=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((Q=W.exec($))!==null)X(Q[1]);return Z}async function T9($,Z={}){let J=$,X="",Y=!1,Q=[],G=g$(J,{filePath:Z.filePath,projectRoot:Z.projectRoot});J=G.code;let z=h$(G.styles),q=p1(J);J=q.code,Q=[...q.imports,...q.models];let{hasUserImports:K,bundleClientScript:U}=await o("stx/client-script-bundler",()=>import("./chunk-45az9zht.js"));if(K(J))J=await U(J,Z.filePath||"",{projectRoot:Z.projectRoot,minify:Z.production}),Y=!0;if(Z.autoImports!==!1){let _=h8(J);J=_.code,X=u8(_.stxImports,_.browserImports.filter((L)=>!Q.includes(L)))}if(X=`${Y$(J,Z.serverData)}${X}`,J=e0(J),!Y&&D1(Z.attrs||""))J=N1(J);let W=Nz(Z.eventBindings||[]),H=(Z.attrs||"").trim();if(/\btype\s*=\s*["']module["']/i.test(H)){let _=H.replace(/\btype\s*=\s*["']module["']/i,"").trim(),L=`type="module" data-stx-scoped${_?` ${_}`:""}`;return`${z}<script ${L}>
3739
+ ${$.map((J,X)=>Nz(J,X)).join(`
3740
+ `)}`}function f8($){let Z=[],J=new Set,X=$.replace(/^\s*import\s+.*$/gm,""),Y=0,Q=X.length,G=0;while(G<Q){let z=X[G];if(z==="'"||z==='"'||z==="`"){let q=z;if(G++,q==="`"){let K=0;while(G<Q){if(X[G]==="\\"){G+=2;continue}if(X[G]==="`"&&K===0){G++;break}if(X[G]==="$"&&X[G+1]==="{"){K++,G+=2;continue}if(X[G]==="}"&&K>0){K--,G++;continue}G++}}else while(G<Q){if(X[G]==="\\"){G+=2;continue}if(X[G]===q){G++;break}G++}continue}if(z==="/"&&X[G+1]==="/"){while(G<Q&&X[G]!==`
3741
+ `)G++;continue}if(z==="/"&&X[G+1]==="*"){G+=2;while(G<Q-1&&!(X[G]==="*"&&X[G+1]==="/"))G++;G+=2;continue}if(z==="{"){Y++,G++;continue}if(z==="}"){Y--,G++;continue}if(Y===0){let q=X.slice(G),K=q.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(K){let H=K[1];if(!H.startsWith("_")&&!J.has(H))Z.push(H),J.add(H);G+=K[0].length;continue}let U=q.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(U){U[1].split(",").forEach((H)=>{let j=H.trim(),B=j.indexOf(":"),V=B>=0?j.slice(B+1).trim().split(/[\s=]/)[0]:j.split(/[\s=]/)[0];if(V&&!V.startsWith("_")&&!J.has(V))Z.push(V),J.add(V)}),G+=U[0].length;continue}let W=q.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(W){let H=W[1];if(!H.startsWith("_")&&!J.has(H))Z.push(H),J.add(H);G+=W[0].length;continue}}G++}return Z}var Az=new Set(["if","else","true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","switch","case","break","continue","for","while","do","try","catch","finally","const","let","var","function","class","import","export","default","async","await","yield","with","debugger","console","window","document","Math","JSON","Date","Array","Object","String","Number","Boolean","Symbol","Map","Set","Promise","Error","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","setTimeout","setInterval","clearTimeout","clearInterval","fetch","alert","confirm","prompt","event"]);function kz($){let Z=new Set,J=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function X(H){let j;while((j=J.exec(H))!==null){let B=j[0];if(!Az.has(B))Z.add(B)}}let Y=/\{\{([\s\S]*?)\}\}/g,Q;while((Q=Y.exec($))!==null)X(Q[1]);let G=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((Q=G.exec($))!==null)X(Q[1]);let z=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((Q=z.exec($))!==null)X(Q[1]);let q=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((Q=q.exec($))!==null)X(Q[1]);let K=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((Q=K.exec($))!==null)X(Q[1]);let U=/@model\s*=\s*["']([^"']*)["']/gi;while((Q=U.exec($))!==null)X(Q[1]);let W=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((Q=W.exec($))!==null)X(Q[1]);return Z}async function T9($,Z={}){let J=$,X="",Y=!1,Q=[],G=g$(J,{filePath:Z.filePath,projectRoot:Z.projectRoot});J=G.code;let z=h$(G.styles),q=p1(J);J=q.code,Q=[...q.imports,...q.models];let{hasUserImports:K,bundleClientScript:U}=await n("stx/client-script-bundler",()=>import("./chunk-91ffbzmh.js"));if(K(J))J=await U(J,Z.filePath||"",{projectRoot:Z.projectRoot,minify:Z.production}),Y=!0;if(Z.autoImports!==!1){let _=d8(J);J=_.code,X=m8(_.stxImports,_.browserImports.filter((L)=>!Q.includes(L)))}if(X=`${Y$(J,Z.serverData)}${X}`,J=Z1(J),!Y&&D1(Z.attrs||""))J=N1(J);let W=Mz(Z.eventBindings||[]),H=(Z.attrs||"").trim();if(/\btype\s*=\s*["']module["']/i.test(H)){let _=H.replace(/\btype\s*=\s*["']module["']/i,"").trim(),L=`type="module" data-stx-scoped${_?` ${_}`:""}`;return`${z}<script ${L}>
3743
3742
  ${c1(`${X}${J}
3744
3743
  ${W}`)}
3745
- </script>`}let B=x8($),V=/function __stx_setup_/.test(J),F=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test($);function O(_){let L=_.length>0?`
3744
+ </script>`}let B=g8($),V=/function __stx_setup_/.test(J),F=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test($);function O(_){let L=_.length>0?`
3746
3745
  return { ${_.join(", ")} };`:"";return`${z}<script data-stx-scoped data-stx-run="always">
3747
3746
  window.stx.mount(function() {
3748
3747
  'use strict';
3749
3748
  ${c1(`${X}${J}
3750
3749
  ${W}${L}`)}
3751
- })</script>`}if(!F&&!V){if(B)return O(v8($));if(Z.templateContent){let _=v8($);if(_.length>0){let L=Az(Z.templateContent);if(_.some((R)=>L.has(R)))return O(_)}}}return`${z}<script data-stx-scoped data-stx-run="always">
3750
+ })</script>`}if(!F&&!V){if(B)return O(f8($));if(Z.templateContent){let _=f8($);if(_.length>0){let L=kz(Z.templateContent);if(_.some((R)=>L.has(R)))return O(_)}}}return`${z}<script data-stx-scoped data-stx-run="always">
3752
3751
  ;(function() {
3753
3752
  'use strict';
3754
3753
  ${c1(`${X}${J}
3755
3754
  ${W}`)}
3756
3755
  })()</script>`}
3757
- export{RZ as jl,DZ as kl,NZ as ll,$1 as ml,i9 as nl,n9 as ol,o9 as pl,s9 as ql,D3 as rl,R3 as sl,yZ as tl,SZ as ul,vZ as vl,qq as wl,Kq as xl,Uq as yl,Wq as zl,Hq as Al,FZ as Bl,_3 as Cl,O3 as Dl,F3 as El,w3 as Fl,Gq as Gl,C3 as Hl,q2 as Il,P9 as Jl,v9 as Kl,n8 as Ll,o$ as Ml,Iz as Nl,e0 as Ol,Ez as Pl,O2 as Ql,$2 as Rl,YB as Sl,g$ as Tl,h$ as Ul,Wz as Vl,p1 as Wl,h8 as Xl,u8 as Yl,FL as Zl,I9 as _l,Y$ as $l,T9 as am,Sz as bm,f2 as cm,Pz as dm,vz as em,fz as fm,xz as gm,Y1 as hm,Y2 as im,m2 as jm,$Z as km,iz as lm,ZZ as mm,nz as nm,m9 as om,z3 as pm,Q1 as qm,l9 as rm,YZ as sm,oz as tm,_1 as um,QZ as vm,P0 as wm,sz as xm,tz as ym,HZ as zm,jZ as Am,B3 as Bm,V3 as Cm,L3 as Dm,Yq as Em,N3 as Fm,a9 as Gm,G2 as Hm,l2 as Im,Lq as Jm,r9 as Km,gZ as Lm,hZ as Mm,uZ as Nm,_q as Om,A3 as Pm,k3 as Qm,K1 as Rm,$9 as Sm,_0 as Tm,O7 as Um,O5 as Vm,U1 as Wm,F1 as Xm,F7 as Ym,H2 as Zm,Z9 as _m,F5 as $m,sJ as an,aJ as bn,D7 as cn,eJ as dn,$X as en,M7 as fn,w1 as gn,OU as hn,A7 as in,A5 as jn,QX as kn,M5 as ln,GX as mn,zX as nn,FU as on,wU as pn,k7 as qn,I7 as rn,T7 as sn,qX as tn,KX as un,RU as vn,DU as wn,UX as xn,NU as yn,MU as zn,y7 as An,v7 as Bn,T5 as Cn,vU as Dn,V2 as En,E5 as Fn,b5 as Gn,fU as Hn,kX as In,xU as Jn,IX as Kn,g7 as Ln,gU as Mn,TX as Nn,hU as On,uU as Pn,X9 as Qn,U6 as Rn,cH as Sn,pH as Tn,iH as Un,nH as Vn,SQ as Wn,U4 as Xn,lQ as Yn,A$ as Zn,d4 as _n,XH as $n,p4 as ao,cY as bo,EH as co,sY as do,J6 as eo,Q$ as fo,X6 as go,Q6 as ho,G$ as io,WQ as jo,HQ as ko,G6 as lo,Z$ as mo,jQ as no,VQ as oo,w8 as po,bG as qo,yG as ro,CG as so,SG as to,PG as uo,R8 as vo,gG as wo,mG as xo,lG as yo,t7 as zo,e7 as Ao,$W as Bo,l7 as Co,ZW as Do,S5 as Eo,P5 as Fo,v5 as Go,X4 as Ho,Y4 as Io,Q4 as Jo,J7 as Ko,X7 as Lo,Y7 as Mo,Q7 as No,U5 as Oo,W5 as Po,jK as Qo,BK as Ro,VK as So,DJ as To,LK as Uo,MW as Vo,AW as Wo,z4 as Xo,kW as Yo,eX as Zo,H4 as _o,L4 as $o,M4 as ap,H9 as bp,c5 as cp,NY as dp,p5 as ep,E4 as fp,b4 as gp,CY as hp,mW as ip,lW as jp,y4 as kp,cW as lp,pW as mp,i5 as np,P4 as op,B9 as pp,V9 as qp,l1 as rp,PY as sp,f4 as tp,x4 as up,oW as vp,s5 as wp,vY as xp,fY as yp,r5 as zp,a5 as Ap,g4 as Bp,h4 as Cp,k$ as Dp,I$ as Ep,b$ as Fp,C$ as Gp,OG as Hp,NG as Ip,MG as Jp,AG as Kp,kG as Lp,nG as Mp,D1 as Np,P$ as Op,N1 as Pp,A9 as Qp,eG as Rp,$z as Sp,Zz as Tp,A1 as Up,s as Vp,s2 as Wp,C8 as Xp,j0 as Yp,JL as Zp,XL as _p,S3 as $p,P3 as aq,O1 as bq,v3 as cq,S1 as dq,f3 as eq,K2 as fq,bq as gq,$J as hq,e9 as iq,yq as jq,$5 as kq,Cq as lq,Sq as mq,q1 as nq,Pq as oq,vq as pq,fq as qq,xq as rq,gq as sq,hq as tq,ZJ as uq,J5 as vq,x3 as wq,dq as xq,mq as yq,lq as zq,cq as Aq,pq as Bq,h3 as Cq,iq as Dq,u3 as Eq,nq as Fq,oq as Gq,U2 as Hq,zJ as Iq,tq as Jq,KJ as Kq,i3 as Lq,n2 as Mq,YK as Nq,e3 as Oq,K5 as Pq,DK as Qq,j5 as Rq,TJ as Sq,CJ as Tq,NK as Uq,MK as Vq,AK as Wq,kK as Xq,IK as Yq,TK as Zq,SJ as _q,PJ as $q,G7 as ar,V7 as br,gJ as cr,V5 as dr,L7 as er,cK as fr,pK as gr,_5 as hr,cJ as ir,_7 as jr};
3756
+ export{NZ as ml,MZ as nl,AZ as ol,e0 as pl,i9 as ql,n9 as rl,o9 as sl,s9 as tl,D3 as ul,R3 as vl,SZ as wl,vZ as xl,xZ as yl,zq as zl,qq as Al,Kq as Bl,Uq as Cl,Wq as Dl,RZ as El,_3 as Fl,O3 as Gl,F3 as Hl,w3 as Il,Qq as Jl,C3 as Kl,q2 as Ll,P9 as Ml,v9 as Nl,s8 as Ol,o$ as Pl,Tz as Ql,O2 as Rl,$2 as Sl,XB as Tl,g$ as Ul,h$ as Vl,jz as Wl,p1 as Xl,d8 as Yl,m8 as Zl,OL as _l,I9 as $l,Y$ as am,T9 as bm,Cz as cm,f2 as dm,Sz as em,Pz as fm,vz as gm,fz as hm,Y1 as im,Y2 as jm,m2 as km,JZ as lm,pz as mm,XZ as nm,iz as om,m9 as pm,z3 as qm,Q1 as rm,l9 as sm,GZ as tm,nz as um,_1 as vm,zZ as wm,P0 as xm,oz as ym,az as zm,BZ as Am,VZ as Bm,B3 as Cm,V3 as Dm,L3 as Em,Xq as Fm,N3 as Gm,a9 as Hm,G2 as Im,l2 as Jm,Vq as Km,r9 as Lm,uZ as Mm,dZ as Nm,mZ as Om,Lq as Pm,A3 as Qm,k3 as Rm,K1 as Sm,$9 as Tm,_0 as Um,O7 as Vm,O5 as Wm,U1 as Xm,F1 as Ym,F7 as Zm,H2 as _m,Z9 as $m,F5 as an,aJ as bn,eJ as cn,D7 as dn,ZX as en,JX as fn,M7 as gn,w1 as hn,_U as in,A7 as jn,A5 as kn,zX as ln,M5 as mn,qX as nn,KX as on,OU as pn,FU as qn,k7 as rn,I7 as sn,T7 as tn,UX as un,WX as vn,wU as wn,RU as xn,HX as yn,DU as zn,NU as An,y7 as Bn,v7 as Cn,T5 as Dn,PU as En,V2 as Fn,E5 as Gn,b5 as Hn,vU as In,TX as Jn,fU as Kn,EX as Ln,g7 as Mn,xU as Nn,bX as On,gU as Pn,hU as Qn,X9 as Rn,U6 as Sn,lH as Tn,cH as Un,pH as Vn,iH as Wn,vQ as Xn,U4 as Yn,pQ as Zn,A$ as _n,d4 as $n,JH as ao,p4 as bo,iY as co,TH as do,aY as eo,J6 as fo,Q$ as go,X6 as ho,Q6 as io,G$ as jo,jQ as ko,BQ as lo,G6 as mo,Z$ as no,VQ as oo,_Q as po,R8 as qo,CG as ro,SG as so,PG as to,vG as uo,fG as vo,D8 as wo,uG as xo,cG as yo,pG as zo,t7 as Ao,e7 as Bo,eU as Co,l7 as Do,$W as Eo,S5 as Fo,P5 as Go,v5 as Ho,X4 as Io,Y4 as Jo,Q4 as Ko,J7 as Lo,X7 as Mo,Y7 as No,Q7 as Oo,U5 as Po,W5 as Qo,HK as Ro,jK as So,BK as To,MJ as Uo,VK as Vo,NW as Wo,MW as Xo,z4 as Yo,AW as Zo,ZY as _o,H4 as $o,L4 as ap,M4 as bp,H9 as cp,c5 as dp,AY as ep,p5 as fp,E4 as gp,b4 as hp,PY as ip,dW as jp,mW as kp,y4 as lp,lW as mp,cW as np,i5 as op,P4 as pp,B9 as qp,V9 as rp,l1 as sp,fY as tp,f4 as up,x4 as vp,nW as wp,s5 as xp,xY as yp,gY as zp,r5 as Ap,a5 as Bp,g4 as Cp,h4 as Dp,k$ as Ep,I$ as Fp,b$ as Gp,C$ as Hp,wG as Ip,AG as Jp,kG as Kp,IG as Lp,TG as Mp,sG as Np,D1 as Op,P$ as Pp,N1 as Qp,A9 as Rp,Zz as Sp,Jz as Tp,Xz as Up,A1 as Vp,s as Wp,s2 as Xp,S8 as Yp,j0 as Zp,ZL as _p,JL as $p,S3 as aq,P3 as bq,O1 as cq,v3 as dq,S1 as eq,f3 as fq,K2 as gq,Eq as hq,JJ as iq,e9 as jq,bq as kq,$5 as lq,yq as mq,Cq as nq,q1 as oq,Sq as pq,Pq as qq,vq as rq,fq as sq,xq as tq,gq as uq,XJ as vq,J5 as wq,x3 as xq,uq as yq,dq as zq,mq as Aq,lq as Bq,cq as Cq,h3 as Dq,pq as Eq,u3 as Fq,iq as Gq,nq as Hq,U2 as Iq,KJ as Jq,aq as Kq,WJ as Lq,i3 as Mq,n2 as Nq,XK as Oq,e3 as Pq,K5 as Qq,RK as Rq,j5 as Sq,bJ as Tq,PJ as Uq,DK as Vq,NK as Wq,MK as Xq,AK as Yq,kK as Zq,IK as _q,vJ as $q,fJ as ar,G7 as br,V7 as cr,uJ as dr,V5 as er,L7 as fr,lK as gr,cK as hr,_5 as ir,iJ as jr,_7 as kr};