@stacksjs/stx 0.2.402 → 0.2.404

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 (183) hide show
  1. package/dist/app-shell.d.ts +12 -0
  2. package/dist/app-shell.js +13 -1
  3. package/dist/{chunk-4bb28mz5.js → chunk-015p3jq5.js} +1 -1
  4. package/dist/{chunk-saf4xhac.js → chunk-0n054h7w.js} +1 -1
  5. package/dist/{chunk-nn42gs3q.js → chunk-0nhpymyy.js} +1 -1
  6. package/dist/{chunk-msecn1gm.js → chunk-0seyntda.js} +1 -1
  7. package/dist/{chunk-ptad3t7a.js → chunk-0svp7s94.js} +190 -116
  8. package/dist/{chunk-h7qv6sc5.js → chunk-0tnsyynz.js} +1 -1
  9. package/dist/{chunk-g64qyhhb.js → chunk-1n2ng8nx.js} +1 -1
  10. package/dist/{chunk-9rp8f7jz.js → chunk-1phxzej9.js} +2 -2
  11. package/dist/{chunk-5kzcyx1w.js → chunk-1vrk5y92.js} +1 -1
  12. package/dist/{chunk-szcxpbfn.js → chunk-1x6c4ys1.js} +2 -2
  13. package/dist/{chunk-mnk5mdwp.js → chunk-245ft0zp.js} +1 -1
  14. package/dist/{chunk-cf05s8c1.js → chunk-2ched9vj.js} +1 -1
  15. package/dist/{chunk-etah20m0.js → chunk-2q216yrr.js} +3 -3
  16. package/dist/{chunk-kdqcb0r5.js → chunk-2r399td7.js} +1 -1
  17. package/dist/chunk-31pm3z44.js +2 -0
  18. package/dist/{chunk-j665en0c.js → chunk-36rnwhn2.js} +1 -1
  19. package/dist/{chunk-ddh21d04.js → chunk-3sea73fx.js} +1 -1
  20. package/dist/{chunk-gs67nnfb.js → chunk-46zx4pt8.js} +1 -1
  21. package/dist/chunk-4j9n5z1q.js +2 -0
  22. package/dist/{chunk-683tfkz4.js → chunk-4m4n1sfc.js} +1 -1
  23. package/dist/{chunk-v54tq312.js → chunk-4md4tj27.js} +1 -1
  24. package/dist/{chunk-fj6fbqgb.js → chunk-4n6ekt06.js} +1 -1
  25. package/dist/{chunk-za3zzk6p.js → chunk-4qjfwxn2.js} +1 -1
  26. package/dist/{chunk-fpqz7msz.js → chunk-4tsjysng.js} +1 -1
  27. package/dist/{chunk-fwc5p9bn.js → chunk-503wfstj.js} +1 -1
  28. package/dist/{chunk-092qw0ps.js → chunk-55g4qm7m.js} +1 -1
  29. package/dist/{chunk-d6rkgay9.js → chunk-59pakqdv.js} +2 -2
  30. package/dist/chunk-65ddb2cs.js +2 -0
  31. package/dist/chunk-68gspceh.js +2 -0
  32. package/dist/{chunk-mwh3ymwc.js → chunk-6de3hczw.js} +1 -1
  33. package/dist/{chunk-8ghwewek.js → chunk-7ba7x6jt.js} +2 -2
  34. package/dist/{chunk-mjearf0g.js → chunk-7q06md6v.js} +1 -1
  35. package/dist/{chunk-baa5pana.js → chunk-81zw5vw5.js} +1 -1
  36. package/dist/{chunk-x1c4vcds.js → chunk-83tefmh1.js} +1 -1
  37. package/dist/{chunk-h3zqzczc.js → chunk-86evvtw4.js} +1 -1
  38. package/dist/{chunk-21adgg8e.js → chunk-8bg1qmhg.js} +1 -1
  39. package/dist/{chunk-1t5vwavd.js → chunk-8mm86z5w.js} +1 -1
  40. package/dist/{chunk-nt03zdme.js → chunk-8t3h7fsk.js} +1 -1
  41. package/dist/{chunk-b89mqprp.js → chunk-971yqxa2.js} +1 -1
  42. package/dist/{chunk-b5na4j0k.js → chunk-9hxnn16r.js} +2 -2
  43. package/dist/chunk-9vne1mm0.js +2 -0
  44. package/dist/{chunk-4m2e8w2g.js → chunk-a01sf1sc.js} +1 -1
  45. package/dist/{chunk-2n3twnde.js → chunk-aa4ss5pb.js} +1 -1
  46. package/dist/chunk-aa91fsxk.js +2 -0
  47. package/dist/{chunk-cvkty3ha.js → chunk-abs56gdt.js} +1 -1
  48. package/dist/{chunk-ht9rdkf3.js → chunk-afwbqeb2.js} +2 -2
  49. package/dist/{chunk-rk8p4b1z.js → chunk-akzmq0jr.js} +2 -2
  50. package/dist/chunk-arrjqs96.js +2 -0
  51. package/dist/{chunk-j89wctm5.js → chunk-b6ckn02j.js} +2 -2
  52. package/dist/chunk-b891w7hr.js +2 -0
  53. package/dist/{chunk-3tmnemhq.js → chunk-bds4s9d8.js} +1 -1
  54. package/dist/{chunk-pj0jjn5b.js → chunk-bssgvjge.js} +2 -2
  55. package/dist/{chunk-fpxz25xz.js → chunk-c1f1vtjt.js} +1 -1
  56. package/dist/{chunk-2g3ffsc9.js → chunk-ca57sg6v.js} +2 -2
  57. package/dist/{chunk-bdy1fpqq.js → chunk-dj658wyq.js} +1 -1
  58. package/dist/{chunk-2andsajh.js → chunk-dxjtszaa.js} +1 -1
  59. package/dist/chunk-emx4ey5d.js +2 -0
  60. package/dist/chunk-evba73dn.js +2 -0
  61. package/dist/{chunk-y9f9g2kh.js → chunk-ffdxdgep.js} +2 -2
  62. package/dist/chunk-fy5jfqwe.js +2 -0
  63. package/dist/{chunk-452k8psm.js → chunk-g0w8dyat.js} +1 -1
  64. package/dist/{chunk-xe06rkka.js → chunk-ggymyyx4.js} +3 -3
  65. package/dist/chunk-gxyvpwvn.js +2 -0
  66. package/dist/chunk-h4w5sqg0.js +2 -0
  67. package/dist/{chunk-av7a1sct.js → chunk-jpnja3jy.js} +1 -1
  68. package/dist/{chunk-j6p78bma.js → chunk-jqm6tbtb.js} +1 -1
  69. package/dist/{chunk-e5aqq9ms.js → chunk-jw6s8rkk.js} +2 -2
  70. package/dist/{chunk-st9vrfw7.js → chunk-k4x5we49.js} +2 -2
  71. package/dist/chunk-k8g5feyd.js +2 -0
  72. package/dist/chunk-kjkkh5p6.js +2 -0
  73. package/dist/{chunk-n9nb4e1v.js → chunk-kzx28zd5.js} +10 -10
  74. package/dist/chunk-m81pxs52.js +2 -0
  75. package/dist/{chunk-ah8gs0q2.js → chunk-m8bdy2wt.js} +1 -1
  76. package/dist/{chunk-6rzwef28.js → chunk-mywrb5fy.js} +1 -1
  77. package/dist/chunk-n1yz08j4.js +2 -0
  78. package/dist/{chunk-9368t9jm.js → chunk-n4197kjq.js} +1 -1
  79. package/dist/chunk-nsese4as.js +2 -0
  80. package/dist/chunk-nxbr6mr1.js +2 -0
  81. package/dist/chunk-p5cs4xsd.js +2 -0
  82. package/dist/{chunk-7vftjm43.js → chunk-pgeh4g3a.js} +1 -1
  83. package/dist/{chunk-3t953qe0.js → chunk-pqhpcxsd.js} +1 -1
  84. package/dist/{chunk-8aa32p8v.js → chunk-py49bdsq.js} +1 -1
  85. package/dist/{chunk-b1hqgm6j.js → chunk-pyyccs6a.js} +1 -1
  86. package/dist/{chunk-4yc9gx6h.js → chunk-qcpnfw0k.js} +1 -1
  87. package/dist/{chunk-bd0eyzgz.js → chunk-qem2tw9r.js} +1 -1
  88. package/dist/{chunk-ezwtd7s2.js → chunk-qnq99ej3.js} +1 -1
  89. package/dist/chunk-r7g4a7m3.js +2 -0
  90. package/dist/{chunk-vaxepwj5.js → chunk-r909bddf.js} +1 -1
  91. package/dist/chunk-rk40an2d.js +2 -0
  92. package/dist/{chunk-9r2xgf5k.js → chunk-rkzfwgr8.js} +1 -1
  93. package/dist/{chunk-7eea1cse.js → chunk-rqr735w8.js} +1 -1
  94. package/dist/{chunk-qnye902b.js → chunk-rx0cntdm.js} +1 -1
  95. package/dist/{chunk-ndydf37f.js → chunk-s6c3ymq1.js} +3 -3
  96. package/dist/{chunk-xd2bapap.js → chunk-s745a8mb.js} +1 -1
  97. package/dist/{chunk-eg30ksd8.js → chunk-s7jkyw9t.js} +8 -8
  98. package/dist/{chunk-cks5rbzt.js → chunk-seqmzr8k.js} +1 -1
  99. package/dist/chunk-sgdp78fr.js +2 -0
  100. package/dist/chunk-sgmqfphy.js +2 -0
  101. package/dist/{chunk-m3s6kzxv.js → chunk-sptvg80e.js} +1 -1
  102. package/dist/{chunk-8e287qw8.js → chunk-stdkw5st.js} +1 -1
  103. package/dist/chunk-sttpb1p4.js +2 -0
  104. package/dist/{chunk-14rh4kd0.js → chunk-t0p5yhgf.js} +2 -2
  105. package/dist/chunk-t6dhnzwf.js +2 -0
  106. package/dist/{chunk-jct6cs2k.js → chunk-tfy07tmv.js} +1 -1
  107. package/dist/{chunk-kpg48dhw.js → chunk-twg0y6ga.js} +1 -1
  108. package/dist/{chunk-jbtzq3xt.js → chunk-v1ezqvek.js} +2 -2
  109. package/dist/chunk-v3mqx1pw.js +2 -0
  110. package/dist/{chunk-9vwpf0bk.js → chunk-vtjegbgy.js} +1 -1
  111. package/dist/{chunk-mntzk6ga.js → chunk-vtmhh3dp.js} +1 -1
  112. package/dist/{chunk-hw96m872.js → chunk-vyq86x5c.js} +1 -1
  113. package/dist/chunk-w568cjw6.js +2 -0
  114. package/dist/{chunk-2m17v3yx.js → chunk-w6n5c479.js} +1 -1
  115. package/dist/{chunk-2hy87cn4.js → chunk-wa32w7h2.js} +2 -2
  116. package/dist/chunk-wawcmcyg.js +2 -0
  117. package/dist/{chunk-gv6fnbw5.js → chunk-wgxcemm2.js} +2 -2
  118. package/dist/chunk-wj66sab5.js +2 -0
  119. package/dist/{chunk-wheh08v2.js → chunk-wpsx5avz.js} +1 -1
  120. package/dist/chunk-wqgyb4zb.js +2 -0
  121. package/dist/{chunk-tev79q0a.js → chunk-wxkn47vk.js} +1 -1
  122. package/dist/chunk-wz7ca99x.js +2 -0
  123. package/dist/{chunk-cevkpyn9.js → chunk-x7qyx7vn.js} +1 -1
  124. package/dist/{chunk-b5rc4t8t.js → chunk-x8zt0b72.js} +1 -1
  125. package/dist/{chunk-m28xqhyz.js → chunk-xakdgn9h.js} +1 -1
  126. package/dist/chunk-xw23twxw.js +2 -0
  127. package/dist/chunk-y3cz15x3.js +2 -0
  128. package/dist/{chunk-chn6e3en.js → chunk-yaegs66r.js} +2 -2
  129. package/dist/{chunk-bs2a7a2b.js → chunk-ydemsmqm.js} +2 -2
  130. package/dist/chunk-yf0v44v8.js +2 -0
  131. package/dist/{chunk-111tdjzz.js → chunk-yh9apppb.js} +1 -1
  132. package/dist/{chunk-90zfg77v.js → chunk-ypw4egcv.js} +1 -1
  133. package/dist/chunk-z523bq9b.js +2 -0
  134. package/dist/{chunk-qbc0bebg.js → chunk-z8zmp74b.js} +2 -2
  135. package/dist/{chunk-4azk3jdd.js → chunk-z9a0ft6h.js} +1 -1
  136. package/dist/{chunk-db1bf5yj.js → chunk-zfh1b1py.js} +2 -2
  137. package/dist/{chunk-9a79ev5a.js → chunk-zwb8wv5p.js} +1 -1
  138. package/dist/cli.js +14 -14
  139. package/dist/craft-entry.js +1 -1
  140. package/dist/craft.js +1 -1
  141. package/dist/database.js +1 -1
  142. package/dist/offline/app-service-worker.d.ts +28 -2
  143. package/dist/offline/app-service-worker.js +100 -7
  144. package/dist/pwa.js +2 -2
  145. package/dist/ssg.js +2 -2
  146. package/dist/visual-testing.js +1 -1
  147. package/package.json +5 -5
  148. package/dist/chunk-020a4q6e.js +0 -2
  149. package/dist/chunk-0j5wwmha.js +0 -2
  150. package/dist/chunk-1a569y4r.js +0 -2
  151. package/dist/chunk-1chgn7qv.js +0 -2
  152. package/dist/chunk-1hw8p2g4.js +0 -2
  153. package/dist/chunk-42tn0t54.js +0 -2
  154. package/dist/chunk-55d66wh7.js +0 -2
  155. package/dist/chunk-6jns68ee.js +0 -2
  156. package/dist/chunk-702rda41.js +0 -2
  157. package/dist/chunk-7r7qcpw2.js +0 -2
  158. package/dist/chunk-9csrj2k2.js +0 -2
  159. package/dist/chunk-9xs1ekk3.js +0 -2
  160. package/dist/chunk-bgyh22e9.js +0 -2
  161. package/dist/chunk-cqn8qq4v.js +0 -2
  162. package/dist/chunk-crjn0b04.js +0 -2
  163. package/dist/chunk-dnew7qmv.js +0 -2
  164. package/dist/chunk-ek069b44.js +0 -2
  165. package/dist/chunk-f4f5dzfg.js +0 -2
  166. package/dist/chunk-fkht7kzs.js +0 -2
  167. package/dist/chunk-gbwqy9py.js +0 -2
  168. package/dist/chunk-h37e97qq.js +0 -2
  169. package/dist/chunk-jmek11fc.js +0 -2
  170. package/dist/chunk-kvdd2zfn.js +0 -2
  171. package/dist/chunk-mjdsjxm5.js +0 -2
  172. package/dist/chunk-n9cgqpe2.js +0 -2
  173. package/dist/chunk-n9wmhtap.js +0 -2
  174. package/dist/chunk-pp8e3t71.js +0 -2
  175. package/dist/chunk-qmr1we72.js +0 -2
  176. package/dist/chunk-s35w8xjx.js +0 -2
  177. package/dist/chunk-scak53zc.js +0 -2
  178. package/dist/chunk-scn75qrm.js +0 -2
  179. package/dist/chunk-t3pfdz1r.js +0 -2
  180. package/dist/chunk-vwe0fvez.js +0 -2
  181. package/dist/chunk-vxxj6sqn.js +0 -2
  182. package/dist/chunk-wm07h8q1.js +0 -2
  183. package/dist/chunk-xn9t0hnt.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{fs as JZ,js as XZ,ts as o4,us as r4}from"./chunk-y9f9g2kh.js";import{As as K2,zs as G0}from"./chunk-saf4xhac.js";import{Cs as $7,Ds as Z7,Es as U9,Fs as H9}from"./chunk-wheh08v2.js";import{Ls as z9}from"./chunk-jct6cs2k.js";import{$s as f2,Qs as r1,Rs as R1,Ss as GZ,Ts as b1,Vs as j1,Ws as HJ,Xs as jJ,Ys as U2,Zs as J9,_s as y9,at as g8,bt as I8,ct as V1,dt as f0,et as j2,it as zZ,jt as c9,wt as KZ}from"./chunk-ndydf37f.js";import{At as e4,Ct as w2,xt as a4,zt as t4}from"./chunk-7vftjm43.js";import{Et as C7,Ft as P7,Gt as v7,Jt as f7,Kt as g7}from"./chunk-4azk3jdd.js";import{Pt as p9}from"./chunk-jbtzq3xt.js";import{Rt as iZ,St as nZ,Tt as sZ,Ut as oZ,Vt as rZ,Xt as QZ}from"./chunk-mjearf0g.js";import{$t as BZ,Yt as UZ,Zt as HZ,_t as jZ,au as J7,bu as X7}from"./chunk-9rp8f7jz.js";import{Bu as tZ,iu as d5,ju as D0,lu as l5,mu as F7,ou as w7,vu as qZ,zu as aZ}from"./chunk-8ghwewek.js";import{Av as b9,Ru as w0,Zu as g2,av as e8,cv as R0,gv as h2,hv as $Z,jv as n0,kv as ZZ,rv as s3,sv as M6,uv as Q0,vv as B0,wv as l0,xv as E9,yv as z2,zv as H0}from"./chunk-rk8p4b1z.js";import{Bv as $1}from"./chunk-fpxz25xz.js";import{Ev as WZ}from"./chunk-nn42gs3q.js";import{Fv as o3,Gv as Q2,Hv as UJ,Iv as o1,Mv as FJ,Nv as T3,Ov as A8,Qv as X6,Tv as U6}from"./chunk-v54tq312.js";import{Iw as YZ,Kw as ez,Lw as D5,Ow as L2,hw as p$,kw as K8,rw as S$}from"./chunk-qbc0bebg.js";import{Tw as Y7}from"./chunk-4yc9gx6h.js";import{Vw as S2,Ww as n3,Xw as C2,Yw as W5}from"./chunk-d6rkgay9.js";import{ax as x}from"./chunk-cevkpyn9.js";import C1 from"path";import c2 from"fs";var IJ=new Set(["touchstart","touchmove","wheel","mousewheel"]);function X5($,Z){if(Z.passive)return!0;if(Z.prevent||Z.nonpassive)return!1;return IJ.has($.toLowerCase())}var N3=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"]),M3={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"},TJ=new Set(["ctrl","alt","shift","meta"]),k3={left:0,middle:1,right:2};function A3($){let Z={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!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(X==="nonpassive")Z.nonpassive=!0;else if(TJ.has(X))Z.systemKeys.push(X);else if(X in k3)Z.mouse=X;else if(X in M3||/^[a-z]$/.test(X))Z.keys.push(M3[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 E3($,Z=""){let J=[],X=0,Y=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,Q;while((Q=Y.exec($))!==null){let[G,z,K]=Q,q=Q.index,W=q+G.length,U=`__stx_evt_${Z}${X++}`,H=[],j=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,B;while((B=j.exec(K))!==null){let[,_,L]=B,F=_.split("."),O=F[0];if(!N3.has(O))continue;H.push({attribute:`@${_}`,event:O,handler:L,modifiers:A3(F.slice(1)),elementId:U})}let V=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((B=V.exec(K))!==null){let[,_,L]=B,F=_.split("."),O=F[0];if(!N3.has(O))continue;H.push({attribute:`@${_}`,event:O,handler:L,modifiers:A3(F.slice(1)),elementId:U})}if(H.length>0)J.push({originalTag:G,elementId:U,events:H,startIndex:q,endIndex:W})}return J}function kJ($){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=k3[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 EJ($,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 Y5($){let Z=$.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(Z))return $;return`if (typeof ${Z} === 'function' && !${Z}._isSignal) ${Z}($event);`}function yJ($){let{modifiers:Z}=$,J=$.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),X=kJ($),Y=EJ(Y5($.handler),Z),Q=[];if(Z.once)Q.push("once: true");if(Z.capture)Q.push("capture: true");if(X5($.event,Z))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{gs as JZ,ks as XZ,us as o4,vs as r4}from"./chunk-ffdxdgep.js";import{As as G0,Bs as K2}from"./chunk-0n054h7w.js";import{Ds as $7,Es as Z7,Fs as U9,Gs as H9}from"./chunk-wpsx5avz.js";import{Ms as z9}from"./chunk-tfy07tmv.js";import{$s as y9,Rs as r1,Ss as R1,Ts as GZ,Us as b1,Ws as j1,Xs as HJ,Ys as jJ,Zs as U2,_s as J9,at as f2,bt as g8,ct as I8,dt as V1,et as f0,ft as j2,jt as zZ,kt as c9,xt as KZ}from"./chunk-s6c3ymq1.js";import{At as t4,Bt as e4,Dt as w2,yt as a4}from"./chunk-pgeh4g3a.js";import{Ft as C7,Gt as P7,Ht as v7,Kt as f7,Lt as g7}from"./chunk-z9a0ft6h.js";import{Qt as p9}from"./chunk-v1ezqvek.js";import{St as iZ,Tt as nZ,Ut as sZ,Vt as oZ,Wt as rZ,Yt as QZ}from"./chunk-7q06md6v.js";import{$t as jZ,Zt as UZ,_t as HZ,au as BZ,bu as J7,cu as X7}from"./chunk-1phxzej9.js";import{Au as aZ,Cu as tZ,ju as d5,ku as D0,mu as l5,nu as F7,pu as w7,wu as qZ}from"./chunk-7ba7x6jt.js";import{Av as H0,Bv as b9,Su as w0,_u as g2,bv as e8,dv as R0,hv as h2,iv as $Z,kv as n0,lv as ZZ,sv as s3,tv as M6,vv as Q0,wv as B0,xv as l0,yv as E9,zv as z2}from"./chunk-akzmq0jr.js";import{Cv as $1}from"./chunk-c1f1vtjt.js";import{Fv as WZ}from"./chunk-0nhpymyy.js";import{Gv as o3,Hv as Q2,Iv as UJ,Jv as o1,Nv as FJ,Ov as T3,Pv as A8,Rv as X6,Uv as U6}from"./chunk-4md4tj27.js";import{Jw as YZ,Lw as $K,Mw as D5,Pw as L2,iw as p$,lw as K8,sw as S$}from"./chunk-z8zmp74b.js";import{Uw as Y7}from"./chunk-qcpnfw0k.js";import{Ww as S2,Xw as n3,Yw as C2,Zw as W5}from"./chunk-59pakqdv.js";import{bx as x}from"./chunk-x7qyx7vn.js";import C1 from"path";import c2 from"fs";var IJ=new Set(["touchstart","touchmove","wheel","mousewheel"]);function X5($,Z){if(Z.passive)return!0;if(Z.prevent||Z.nonpassive)return!1;return IJ.has($.toLowerCase())}var N3=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"]),M3={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"},TJ=new Set(["ctrl","alt","shift","meta"]),k3={left:0,middle:1,right:2};function A3($){let Z={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!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(X==="nonpassive")Z.nonpassive=!0;else if(TJ.has(X))Z.systemKeys.push(X);else if(X in k3)Z.mouse=X;else if(X in M3||/^[a-z]$/.test(X))Z.keys.push(M3[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 E3($,Z=""){let J=[],X=0,Y=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,Q;while((Q=Y.exec($))!==null){let[G,z,K]=Q,q=Q.index,W=q+G.length,U=`__stx_evt_${Z}${X++}`,H=[],j=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,B;while((B=j.exec(K))!==null){let[,_,L]=B,F=_.split("."),O=F[0];if(!N3.has(O))continue;H.push({attribute:`@${_}`,event:O,handler:L,modifiers:A3(F.slice(1)),elementId:U})}let V=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((B=V.exec(K))!==null){let[,_,L]=B,F=_.split("."),O=F[0];if(!N3.has(O))continue;H.push({attribute:`@${_}`,event:O,handler:L,modifiers:A3(F.slice(1)),elementId:U})}if(H.length>0)J.push({originalTag:G,elementId:U,events:H,startIndex:q,endIndex:W})}return J}function kJ($){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=k3[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 EJ($,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 Y5($){let Z=$.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(Z))return $;return`if (typeof ${Z} === 'function' && !${Z}._isSignal) ${Z}($event);`}function yJ($){let{modifiers:Z}=$,J=$.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),X=kJ($),Y=EJ(Y5($.handler),Z),Q=[];if(Z.once)Q.push("once: true");if(Z.capture)Q.push("capture: true");if(X5($.event,Z))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;
@@ -112,7 +112,7 @@ else {
112
112
  `)}
113
113
  })();
114
114
  </script>`}function bJ($,Z=""){let J=E3($,Z);if(J.length===0)return{template:$,bindings:[]};let X=$,Y=[];for(let Q=J.length-1;Q>=0;Q--){let G=J[Q],z=G.originalTag;if(!z.includes(" id="))z=z.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${G.elementId}"`);else{let K=z.match(/id=["']([^"']+)["']/);if(K)for(let q of G.events)q.elementId=K[1]}for(let K of G.events){let q=K.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),W=new RegExp(`\\s*${q}\\s*=\\s*"[^"]*"`,"g"),U=new RegExp(`\\s*${q}\\s*=\\s*'[^']*'`,"g");z=z.replace(W,""),z=z.replace(U,"")}X=X.slice(0,G.startIndex)+z+X.slice(G.endIndex),Y.push(...G.events)}return{template:X,bindings:Y}}function I3($){let Z=$.$uid;return typeof Z==="string"&&Z?`${Z}_`:""}function y3($,Z,J){if(T3($))return $;if(Z.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test($))return $;let{template:z,bindings:K}=bJ($,I3(Z)),q=Z.__stx_event_bindings||[];return Z.__stx_event_bindings=[...q,...K],z}let X=E3($,I3(Z));if(X.length===0)return $;let Y=$;for(let z=X.length-1;z>=0;z--){let K=X[z],q=K.originalTag;if(!q.includes(" id="))q=q.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${K.elementId}"`);else{let W=q.match(/id=["']([^"']+)["']/);if(W)for(let U of K.events)U.elementId=W[1]}for(let W of K.events){let U=W.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),H=new RegExp(`\\s*${U}\\s*=\\s*"[^"]*"`,"g"),j=new RegExp(`\\s*${U}\\s*=\\s*'[^']*'`,"g");q=q.replace(H,""),q=q.replace(j,"")}Y=Y.slice(0,K.startIndex)+q+Y.slice(K.endIndex)}let Q=Q5(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 oq($){return/@[a-z]+(?:\.[a-z]+)*\s*=\s*["'][^"']*["']/i.test($)}function b3($,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 r2($,Z){let J=G0($),{depths:X,balanced:Y}=K2(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 K=(z.index??0)+z[0].length-z[1].length;if(Q(K))return!0}for(let z of J.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(Q(z.index??0)&&b3(z[1],!0).has(Z))return!0;for(let z of J.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(Q(z.index??0)&&b3(z[1],!1).has(Z))return!0;return!1}import BJ from"fs";import f from"path";import{createHash as SJ}from"crypto";var a2="__stx_component_client_factories";function t2($){let Z=$[a2];return Z instanceof Map?Z:null}function C3($){$[a2]=new Map}function G5($,Z){let J=t2($);if(!J)return null;let X=SJ("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 P3($,Z){let J=t2(Z);if(!J?.size)return $;let X=new Map;for(let[W,U]of J)if(U.instances===1)X.set(W,U.body);let Y=[];if(X.size>0){let W=[...X.keys()].map((j)=>JSON.stringify(j).replace(/[$()*+.?[\\\]^{|}]/g,"\\$&")).join("|"),U=new RegExp(`window\\.__stxComponentFactories\\[(${W})\\]\\(("[^"]+")\\);`,"g"),H=U.exec($);while(H!==null){let j=X.get(JSON.parse(H[1]));if(j!==void 0)Y.push({start:H.index,end:H.index+H[0].length,replacement:`(${j})(${H[2]});`});H=U.exec($)}}let Q=[...J].filter(([,W])=>W.instances>1);if(Q.length===0)return S3($,Y);let z=`<script data-stx-scoped data-stx-run="always" data-stx-component-factories>
115
+ `+Y.slice(G);else Y+=Q;return Y}function rq($){return/@[a-z]+(?:\.[a-z]+)*\s*=\s*["'][^"']*["']/i.test($)}function b3($,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 r2($,Z){let J=G0($),{depths:X,balanced:Y}=K2(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 K=(z.index??0)+z[0].length-z[1].length;if(Q(K))return!0}for(let z of J.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(Q(z.index??0)&&b3(z[1],!0).has(Z))return!0;for(let z of J.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(Q(z.index??0)&&b3(z[1],!1).has(Z))return!0;return!1}import BJ from"fs";import f from"path";import{createHash as SJ}from"crypto";var a2="__stx_component_client_factories";function t2($){let Z=$[a2];return Z instanceof Map?Z:null}function C3($){$[a2]=new Map}function G5($,Z){let J=t2($);if(!J)return null;let X=SJ("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 P3($,Z){let J=t2(Z);if(!J?.size)return $;let X=new Map;for(let[W,U]of J)if(U.instances===1)X.set(W,U.body);let Y=[];if(X.size>0){let W=[...X.keys()].map((j)=>JSON.stringify(j).replace(/[$()*+.?[\\\]^{|}]/g,"\\$&")).join("|"),U=new RegExp(`window\\.__stxComponentFactories\\[(${W})\\]\\(("[^"]+")\\);`,"g"),H=U.exec($);while(H!==null){let j=X.get(JSON.parse(H[1]));if(j!==void 0)Y.push({start:H.index,end:H.index+H[0].length,replacement:`(${j})(${H[2]});`});H=U.exec($)}}let Q=[...J].filter(([,W])=>W.instances>1);if(Q.length===0)return S3($,Y);let z=`<script data-stx-scoped data-stx-run="always" data-stx-component-factories>
116
116
  (function() {
117
117
  const factories = window.__stxComponentFactories = window.__stxComponentFactories || {};
118
118
  ${Q.map(([W,U])=>` try { factories[${JSON.stringify(W)}] = factories[${JSON.stringify(W)}] || ${U.body}; }
@@ -120,8 +120,8 @@ ${Q.map(([W,U])=>` try { factories[${JSON.stringify(W)}] = factories[${JSON.str
120
120
  `)}
121
121
  })();
122
122
  </script>`,K=$.search(/<script\b(?=[^>]*\bdata-stx-scoped\b)/i),q=K<0?0:K;return Y.push({start:q,end:q,replacement:`${z}
123
- `}),S3($,Y)}function S3($,Z){if(Z.length===0)return $;Z.sort((Q,G)=>Q.start-G.start||Q.end-G.end);let J=Array(Z.length*2+1),X=0,Y=0;for(let Q of Z)J[Y++]=$.slice(X,Q.start),J[Y++]=Q.replacement,X=Q.end;return J[Y]=$.slice(X),J.join("")}function v3($){let Z=t2($),J=new Map;if(Z)for(let[X,Y]of Z)J.set(X,Y.instances);return J}function x3($,Z){let J=t2($);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 f3($,Z){for(let{body:J,count:X}of Z)for(let Y=0;Y<X;Y++)G5($,J)}W5();import m3 from"fs";var g3=0,e2=new Map;function ZW(){g3=0,e2.clear()}function $9($,Z){let J=g3++,X=`<!--__STX_${$.toUpperCase()}_${J}__-->`;return e2.set(X,{type:$,expression:Z}),X}function JW(){let $={};for(let[Z,J]of e2)$[Z]={type:J.type,expression:J.expression};return $}function XW($){let Z={},J=/<!--__STX_(EXPR|COND|RAW)_(\d+)__-->/g,X;while((X=J.exec($))!==null){let Y=X[0],Q=X[1].toLowerCase(),G=e2.get(Y);Z[Y]={type:Q,expression:G?.expression||""}}return Z}function YW($,Z){let J=$;for(let[X,Y]of Z)J=J.split(X).join(Y);return J}function QW($){return $.includes("<!--__STX_")}var CJ=/@(?=[a-zA-Z_]\w*\s*\(|end[a-zA-Z]*\b|else(?:if)?\b|empty\b|case\b|default\b|break\b|continue\b|fallback\b)/g;function PJ($){return Array.from({length:$},()=>"&#123;").join("&#8288;")}function h3($){return $.replace(/\{{2,}/g,(Z)=>PJ(Z.length)).replace(/\{(?=!)/g,"&#123;&#8288;").replace(CJ,"&#64;")}var vJ=/^(?:javascript|vbscript|livescript|mocha|view-source):/,xJ=/^data:(?:text\/html|text\/xml|application\/xhtml\+xml|application\/xml|image\/svg\+xml)/,fJ=/^data:(?:text\/html|application\/xhtml\+xml)/,gJ=new RegExp("[\\u0000-\\u0020\\u00A0\\u1680\\u2000-\\u200F\\u2028\\u2029\\u202F\\u205F\\u3000\\uFEFF]+","g");function hJ($){return $.replace(gJ,"").toLowerCase()}function uJ($){let Z=$.toLowerCase();if(new RegExp("^(?:href|xlink:href|action|formaction|ping|cite|manifest|data|to)$").test(Z))return"navigable";if(new RegExp("^(?:src|srcset|poster|background)$").test(Z))return"fetched";return null}function u3($,Z="navigable"){let J=hJ($);if(vJ.test(J))return!0;return Z==="navigable"?xJ.test(J):fJ.test(J)}function q2($,Z="navigable"){return u3($,Z)?"unsafe:"+$:$}function mJ($){let Z=$.match(/(?:^|[\s"'`/])([A-Za-z][\w:-]*)\s*=\s*(["'])([^"']*)$/);if(!Z)return null;if(Z[3].trim()!=="")return null;return uJ(Z[1])}function z5($,Z,J=256){if(Z<=J)return $.slice(0,Z);let X=$.slice(Z-J,Z),Y=X.search(/[\s"'`/]/);return Y===-1?"":X.slice(Y)}function K5($,Z,J=Z){let X=mJ($);return X&&u3(Z,X)?"unsafe:"+J:J}var H2={},d3=new Map;function dJ($){let Z=d3.get($);if(!Z){let J=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");Z=new RegExp(`:${J}(?!\\w)`,"g"),d3.set($,Z)}return Z.lastIndex=0,Z}var X9={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 H5(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 K of Q){if(G===void 0||G===null)break;G=G[K]}if(G===void 0||G===null)return Y?$:"";let z=String(G);return Object.entries(J).forEach(([K,q])=>{z=z.replace(dJ(K),String(q))}),z},t:($,Z,J={})=>{return X9.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 lJ($,Z){if($ in X9)console.warn(`Filter "${$}" already exists as a built-in filter. Custom filter will take precedence.`);H2[$]=Z}function FW($){for(let[Z,J]of Object.entries($))lJ(Z,J)}function cJ(){return{...X9,...H2}}function wW(){for(let $ of Object.keys(H2))delete H2[$]}function pJ($,Z,J=2){let X=0,Y=null;for(let Q=Z+J;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==="{"){X++;continue}if(G==="}"){if(X>0){X--;continue}let z=0;while($[Q+z]==="}")z++;if(z>=J)return Q}}return-1}function Z9($,Z,J=2){let X="{".repeat(J);if(!$.includes(X))return $;let Y="",Q=0;for(;;){let G=$.indexOf(X,Q);if(G===-1)break;let z=pJ($,G,J);if(z===-1)break;Y+=$.slice(Q,G)+Z($.slice(G,z+J),$.slice(G+J,z),G),Q=z+J}return Q===0?$:Y+$.slice(Q)}function U5($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function H5($){return h3(U5($))}function Y1($,Z){let{scripts:J}=f0($);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|useModel)\s*(?:<[^>]*>)?\s*\(/.test(Q))return!0;if(o3(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 iJ($){let Z=[],J=/<([a-zA-Z][\w-]*)\b[^>]*?\s(?::for|x-for|@for)\s*=\s*(["'])([\s\S]*?)\2[^>]*>/g;for(let X=J.exec($);X;X=J.exec($)){let Y=X[1].toLowerCase(),Q=/^\s*\(?\s*([A-Za-z_$][\w$]*)\s*(?:,\s*([A-Za-z_$][\w$]*)\s*)?\)?\s+(?:in|of)\s/.exec(X[3]);if(!Q)continue;let G=new Set([Q[1],...Q[2]?[Q[2]]:[]]),z=X.index+X[0].length;if(X[0].endsWith("/>")){Z.push({start:X.index,end:z,names:G});continue}let K=new RegExp(`<(/?)${Y}\\b[^>]*?(/?)>`,"gi");K.lastIndex=z;let q=1,W=$.length;for(let U=K.exec($);U;U=K.exec($)){if(U[2]==="/")continue;if(q+=U[1]==="/"?-1:1,q===0){W=U.index+U[0].length;break}}Z.push({start:X.index,end:W,names:G})}return Z}function nJ($,Z,J){let X=G0(J);for(let Y of $){if(Z<Y.start||Z>=Y.end)continue;for(let Q of Y.names)if(new RegExp(`(?<![.#\\w$])${Q.replace(/\$/g,"\\$")}(?![\\w$])`).test(X))return!0}return!1}function l3($,Z){let J=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","URL","URLSearchParams","Intl","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined","NaN","Infinity","isNaN","isFinite","window","document","console","new","typeof","instanceof","in","void"],X=$.replace(/'[^']*'/g,"").replace(/"[^"]*"/g,""),Y="",Q=!1,G=0;for(let q=0;q<X.length;q++){let W=X[q];if(!Q&&W==="`"){Q=!0,G=0;continue}if(Q){if(W==="`"&&G===0){Q=!1;continue}if(W==="$"&&X[q+1]==="{"){G++,q++,Y+=" ";continue}if(W==="}"&&G>0){G--;continue}if(G>0){Y+=W;continue}continue}Y+=W}X=Y;let z=/(?<![a-zA-Z0-9_$])([a-zA-Z_$][a-zA-Z0-9_$]*)/g,K;while((K=z.exec(X))!==null){let q=K[1];if(!X.substring(0,K.index).trimEnd().endsWith(".")){if(!J.includes(q)&&!(q in Z))return!1}}return!0}function sJ($,Z){let J=Z.__stx_serverDeclared;if(!J||J.size===0)return!1;let X=G0($);for(let Y of J)if(new RegExp(`(?<![.#\\w$])${Y}(?![\\w$])`).test(X))return!0;return!1}var c3=new Set;function p3($){return/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/.test($.trim())}function i3($,Z){let J=`${Z??"<unknown>"}\x00${$}`;if(process.env.STX_DEBUG||!c3.has(J))c3.add(J),console.warn(`[stx] {{ ${$} }} in a <script> in ${Z??"<unknown>"} has no server value, so it was emitted as undefined. A mustache left in JavaScript is a SyntaxError that takes the whole script down, so give the value a default in <script server>.`);return"undefined"}function j5($,Z,J){let X=$;return X=X.replace(/\{!!([\s\S]*?)!!\}/g,(Y,Q)=>{try{let G=S0(Q,Z);if(G===void 0)return p3(Q)?i3(Q.trim(),J):Y;return G===null?"":String(G)}catch{return Y}}),X=Z9(X,(Y,Q,G)=>{let z=Q.trim();if(/^__[A-Z_]+__$/.test(z))return Y;try{let K=S0(Q,Z);if(K===void 0)return p3(z)?i3(z,J):Y;return JSON.stringify(K).replace(/</g,"\\u003c")}catch{return Y}}),X}function oJ($,Z){if(!$.includes("{"))return $;let J=$;return J=J.replace(/\{!!([\s\S]*?)!!\}/g,(X,Y)=>{try{let Q=S0(Y,Z);if(Q===void 0)return X;return Q===null?"":String(Q)}catch{return X}}),J=Z9(J,(X,Y,Q)=>{let G=Y.trim();if(/^__[A-Z_]+__$/.test(G))return X;try{let z=S0(Y,Z);if(z===void 0)return X;if(z===null)return"";let K=String(z);return K5(z5(J,Q),K,H5(K))}catch{return X}}),J}function RW($,Z,J={}){let{output:X,scripts:Y}=f0($),Q=Y.map((G)=>{let z=G.match(/^<script\b([^>]*)>([\s\S]*?)<\/script\s*>$/i),K=G.match(/^<script\b[^>]*>/i),q=G.search(/<\/script\s*>$/i);if(!z||!K||q===-1)return G;let W=z[1],U=z[2];if(/\bdata-raw\b/.test(W))return G;if(J.skipServer&&/\bserver\b/.test(W))return G;let j=`<script${oJ(W,Z)}>`;if(/\bsrc\s*=/.test(W)||/\btype\s*=\s*["']application\/json["']/.test(W))return j+U+G.slice(q);return j+j5(U,Z)+G.slice(q)});return j2(X,Q)}function L1($,Z,J){let X=$,Y=(H,j)=>{let B=J9(H,j);if(B===-1)return-1;return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(H.slice(j,B))?-1:B},Q=(H,j,B,V)=>{let _=B.length,{output:L,tokens:F}=V1(H,j,(O,w)=>V(_+w));return B.push(...F),L},G=[];X=Q(X,Y,G,(H)=>`<!--__STX_STYLE_${H}__-->`);let z=[];X=Q(X,U2,z,(H)=>`<!--__STX_SCRIPT_EXPR_${H}__-->`);let K=Z?.__stx_signals_gate===!0||Y1($),q=new Set(Array.isArray(Z?.__stx_client_signal_names)?Z.__stx_client_signal_names:[]),W=new Set(Array.isArray(Z?.__stx_preserved_client_expressions)?Z.__stx_preserved_client_expressions:[]);X=Z9(X,(H,j,B)=>{try{let V=S0(j,Z,!1,(_)=>q5(_,H,J,$));return V!==void 0&&V!==null?String(V):""}catch(V){let _=V instanceof Error?V.message:String(V);return _0("Expression",`Error evaluating: {{{ ${j.trim()}}}}: ${_}`,J,$,B,H)}},3),X=X.replace(/\{!!([\s\S]*?)!!\}/g,(H,j,B)=>{try{let V=S0(j,Z,!1,(_)=>q5(_,H,J,$));if(V===void 0&&Z.__stx_buildMode==="compile")return $9("raw",j.trim());return V!==void 0&&V!==null?String(V):""}catch(V){if(Z.__stx_buildMode==="compile")return $9("raw",j.trim());let _=V instanceof Error?V.message:String(V);return _0("Expression",`Error evaluating: {!! ${j.trim()} !!}: ${_}`,J,$,B,H)}}),X=Q(X,U2,z,(H)=>`<!--__STX_SCRIPT_EXPR_${H}__-->`),X=Q(X,Y,G,(H)=>`<!--__STX_STYLE_${H}__-->`);let U=K?iJ(X):[];if(X=Z9(X,(H,j,B)=>{let V=j.trim();if(U.length>0&&nJ(U,B,V))return H;if(W.has(V))return H;let _=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined"],L=/^([a-zA-Z_$][a-zA-Z0-9_$]*)/,O=V.match(L)?.[1],w=O&&((O in Z)||_.includes(O)),R=Boolean(O&&q.has(O)),D=/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/,N=V.match(D),I=N&&!_.includes(N[1])&&!(N[1]in Z);if(/^__[A-Z_]+__$/.test(V))return"";let M;try{let T=S0(j,Z,!1,(A)=>{M=A});if(R)return H;if(K&&!l3(V,Z))return H;if(M)q5(M,H,J,$);if(Z.__stx_buildMode==="compile"&&!K&&(T===void 0||sJ(V,Z)))return $9("expr",V);if(T===void 0||T===null)return"";let k=String(T);return K5(z5(X,B),k,H5(k))}catch(T){if(R)return H;if(K&&!l3(V,Z))return H;if(I)return H;let k=T instanceof Error?T.message:String(T);return _0("Expression",`Error evaluating: {{ ${V} }}: ${k}`,J,$,B,H)}}),z.length>0)X=X.replace(/<!--__STX_SCRIPT_EXPR_(\d+)__-->/g,(H,j)=>z[Number(j)]??H);if(G.length>0)X=X.replace(/<!--__STX_STYLE_(\d+)__-->/g,(H,j)=>G[Number(j)]??H);return X}function rJ($,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=H2[G]||X9[G];if(!z)throw Error(`Filter not found: ${G}. Available filters: ${Object.keys(cJ()).join(", ")}`);let K=[];if(Y.startsWith(":")){let q=Y.match(/^:([^|\s]+)/);if(q){let W=q[1].trim();try{let U=Number(W);K=[Number.isNaN(U)?W:U]}catch{K=[W]}Y=Y.substring(q[0].length).trim()}}else if(Y.startsWith("(")){let q=1,W=1;while(q>0&&W<Y.length){if(Y[W]==="(")q++;if(Y[W]===")")q--;W++}if(q===0){let U=Y.substring(1,W-1).trim();if(U)try{if(U.startsWith("{")&&U.endsWith("}"))K=[S0(`(${U})`,J,!0)];else{let H=[],j="",B=null,V=0,_=0,L=0,F=!1;for(let O=0;O<U.length;O++){let w=U[O];if(F){j+=w,F=!1;continue}if(w==="\\"){j+=w,F=!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==="[")_++;else if(w==="]")_--;else if(w==="{")L++;else if(w==="}")L--;if(w===","&&V===0&&_===0&&L===0){H.push(j),j="";continue}j+=w}if(j)H.push(j);K=H.map((O)=>{let w=O.trim();return S0(w,J,!0)})}}catch{K=[U]}Y=Y.substring(W).trim()}}try{X=z(X,J,...K)}catch(q){let W=q instanceof Error?q.message:String(q);throw Error(`Error applying filter '${G}': ${W}`)}if(Y.startsWith("|"))Y=Y.substring(1).trim();else break}return X}function aJ($){let Z=!1,J="",X=0,Y=0,Q=0,G=!1;for(let z=0;z<$.length;z++){let K=$[z],q=$[z+1];if(Z&&G){G=!1;continue}if(Z&&K==="\\"){G=!0;continue}if(G=!1,(K==='"'||K==="'"||K==="`")&&!G){if(!Z)Z=!0,J=K;else if(K===J)Z=!1,J="";continue}if(Z&&J==="`"&&K==="$"&&q==="{"){let W=1;z+=2;while(z<$.length&&W>0){if($[z]==="{")W++;else if($[z]==="}")W--;if(W>0)z++}continue}if(Z)continue;if(K==="(")X++;else if(K===")")X--;else if(K==="[")Y++;else if(K==="]")Y--;else if(K==="{")Q++;else if(K==="}")Q--;if(K==="|"&&X===0&&Y===0&&Q===0){if(q==="|"){z++;continue}if(q==="="){z++;continue}return z}}return-1}var W2=new Set,tJ=1000;function DW(){W2.clear()}function q5($,Z,J,X){if(!n3())return;let Y=`${J}\x00${$.expression}`;if(W2.has(Y))return;if(W2.size>=tJ)W2.clear();W2.add(Y);let Q=J,G=X;try{if(J&&m3.existsSync(J))G=m3.readFileSync(J,"utf8")}catch{}let z=G.indexOf(Z);if(z>=0)Q=`${J}:${G.slice(0,z).split(`
124
- `).length}`;console.warn(`${Q}: stx warning: ${Z} rendered as an empty string. The safe evaluator rejected \`${$.expression}\` (${$.rule}). Compute the value in <script server> and interpolate the variable instead.`)}function S0($,Z,J=!1,X){try{let Y=$.trim(),Q=aJ(Y);if(Q>0){let z=Y.substring(0,Q).trim(),K=Y.substring(Q+1).trim(),q=S0(z,Z,!0,X);return rJ(q,K,Z)}let G=s3(Y);if(G!==null){X?.({expression:Y,rule:G});return}try{let z=Object.keys(Z),K=Object.values(Z);return H0(Y,z)(...K)}catch{return Q0(Y,Z)}}catch(Y){if(Y instanceof ReferenceError){let Q=/(\b\w+)\s+is not defined/.exec(Y.message);if(Q){let G=Q[1],z=eJ(G,Object.keys(Z));if(z&&z!==G)Y.message=`${Y.message} \u2014 did you mean '${z}'?`}}if(!J)console.error(`Error evaluating expression: ${$}`,Y);throw Y}}function eJ($,Z){let J=null;for(let Y of Z){if(Y===$)continue;let Q=$X($,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 $X($,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 K=J[z-1]===X[G-1]?0:1;Q[z]=Math.min(Q[z-1]+1,Y[z]+1,Y[z-1]+K)}for(let z=0;z<=J.length;z++)Y[z]=Q[z]}return Y[J.length]}function NW($){if(!$)return"";return $.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#039;/g,"'").replace(/&#39;/g,"'").replace(/&amp;/g,"&")}import $K from"fs";import b0 from"path";var B5=[{open:/<!--/g,close:/-->/g},{open:/<script\b/gi,close:/<\/script\s*>/gi},{open:/<style\b/gi,close:/<\/style\s*>/gi}],r3=/<body\b([^>]*)>/gi;function p0($){let Z=0,J,X=B5.map(()=>{return});while(Z<$.length){if(J===void 0||J!==null&&J.index<Z)r3.lastIndex=Z,J=r3.exec($);if(!J)return null;let Y=J.index,Q=-1,G=null;for(let K=0;K<B5.length;K++){let q=B5[K],W=X[K];if(W===void 0||W!==null&&W.index<Z)q.open.lastIndex=Z,W=q.open.exec($),X[K]=W;if(!W)continue;if(W.index<Y&&(Q===-1||W.index<Q))Q=W.index,G=q.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 x1($,Z){let J=p0($);if(!J)return $;return $.slice(0,J.index)+Z(J.tag,J.attrs)+$.slice(J.index+J.tag.length)}var a3=/<style\b[^>]*>/iy,t3=/<\/style>/gi,e3=/<script\b[^>]*>/iy,$4=/<template(?=[\s>/])[^>]*>/iy,Z4=/<\/template\s*>/iy;function B2($){let Z=0,J=0,X=-1;while(Z<$.length){let Y=$.indexOf("<",Z);if(Y===-1)return-1;if($.startsWith("<!--",Y)){let K=$.indexOf("-->",Y+4);Z=K===-1?$.length:K+3;continue}a3.lastIndex=Y;let Q=a3.exec($);if(Q){t3.lastIndex=Y+Q[0].length;let K=t3.exec($);Z=K===null?$.length:K.index+8;continue}$4.lastIndex=Y;let G=$4.exec($);if(G){if(J===0)X=Y;J++,Z=Y+G[0].length;continue}Z4.lastIndex=Y;let z=Z4.exec($);if(z){if(J>0)J--;Z=Y+z[0].length;continue}if(e3.lastIndex=Y,e3.test($))return J>0?X:Y;Z=Y+1}return-1}var J4=null;function ZX($){if(!J4)return console.warn(`[stx] ${$} must be called within a component setup.`),null;return J4}function TW($){let Z=ZX("onUpdate");if(Z)Z.updateHooks.push($)}function X4(){return`
123
+ `}),S3($,Y)}function S3($,Z){if(Z.length===0)return $;Z.sort((Q,G)=>Q.start-G.start||Q.end-G.end);let J=Array(Z.length*2+1),X=0,Y=0;for(let Q of Z)J[Y++]=$.slice(X,Q.start),J[Y++]=Q.replacement,X=Q.end;return J[Y]=$.slice(X),J.join("")}function v3($){let Z=t2($),J=new Map;if(Z)for(let[X,Y]of Z)J.set(X,Y.instances);return J}function x3($,Z){let J=t2($);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 f3($,Z){for(let{body:J,count:X}of Z)for(let Y=0;Y<X;Y++)G5($,J)}W5();import m3 from"fs";var g3=0,e2=new Map;function JW(){g3=0,e2.clear()}function $9($,Z){let J=g3++,X=`<!--__STX_${$.toUpperCase()}_${J}__-->`;return e2.set(X,{type:$,expression:Z}),X}function XW(){let $={};for(let[Z,J]of e2)$[Z]={type:J.type,expression:J.expression};return $}function YW($){let Z={},J=/<!--__STX_(EXPR|COND|RAW)_(\d+)__-->/g,X;while((X=J.exec($))!==null){let Y=X[0],Q=X[1].toLowerCase(),G=e2.get(Y);Z[Y]={type:Q,expression:G?.expression||""}}return Z}function QW($,Z){let J=$;for(let[X,Y]of Z)J=J.split(X).join(Y);return J}function GW($){return $.includes("<!--__STX_")}var CJ=/@(?=[a-zA-Z_]\w*\s*\(|end[a-zA-Z]*\b|else(?:if)?\b|empty\b|case\b|default\b|break\b|continue\b|fallback\b)/g;function PJ($){return Array.from({length:$},()=>"&#123;").join("&#8288;")}function h3($){return $.replace(/\{{2,}/g,(Z)=>PJ(Z.length)).replace(/\{(?=!)/g,"&#123;&#8288;").replace(CJ,"&#64;")}var vJ=/^(?:javascript|vbscript|livescript|mocha|view-source):/,xJ=/^data:(?:text\/html|text\/xml|application\/xhtml\+xml|application\/xml|image\/svg\+xml)/,fJ=/^data:(?:text\/html|application\/xhtml\+xml)/,gJ=new RegExp("[\\u0000-\\u0020\\u00A0\\u1680\\u2000-\\u200F\\u2028\\u2029\\u202F\\u205F\\u3000\\uFEFF]+","g");function hJ($){return $.replace(gJ,"").toLowerCase()}function uJ($){let Z=$.toLowerCase();if(new RegExp("^(?:href|xlink:href|action|formaction|ping|cite|manifest|data|to)$").test(Z))return"navigable";if(new RegExp("^(?:src|srcset|poster|background)$").test(Z))return"fetched";return null}function u3($,Z="navigable"){let J=hJ($);if(vJ.test(J))return!0;return Z==="navigable"?xJ.test(J):fJ.test(J)}function q2($,Z="navigable"){return u3($,Z)?"unsafe:"+$:$}function mJ($){let Z=$.match(/(?:^|[\s"'`/])([A-Za-z][\w:-]*)\s*=\s*(["'])([^"']*)$/);if(!Z)return null;if(Z[3].trim()!=="")return null;return uJ(Z[1])}function z5($,Z,J=256){if(Z<=J)return $.slice(0,Z);let X=$.slice(Z-J,Z),Y=X.search(/[\s"'`/]/);return Y===-1?"":X.slice(Y)}function K5($,Z,J=Z){let X=mJ($);return X&&u3(Z,X)?"unsafe:"+J:J}var H2={},d3=new Map;function dJ($){let Z=d3.get($);if(!Z){let J=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");Z=new RegExp(`:${J}(?!\\w)`,"g"),d3.set($,Z)}return Z.lastIndex=0,Z}var X9={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 H5(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 K of Q){if(G===void 0||G===null)break;G=G[K]}if(G===void 0||G===null)return Y?$:"";let z=String(G);return Object.entries(J).forEach(([K,q])=>{z=z.replace(dJ(K),String(q))}),z},t:($,Z,J={})=>{return X9.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 lJ($,Z){if($ in X9)console.warn(`Filter "${$}" already exists as a built-in filter. Custom filter will take precedence.`);H2[$]=Z}function wW($){for(let[Z,J]of Object.entries($))lJ(Z,J)}function cJ(){return{...X9,...H2}}function RW(){for(let $ of Object.keys(H2))delete H2[$]}function pJ($,Z,J=2){let X=0,Y=null;for(let Q=Z+J;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==="{"){X++;continue}if(G==="}"){if(X>0){X--;continue}let z=0;while($[Q+z]==="}")z++;if(z>=J)return Q}}return-1}function Z9($,Z,J=2){let X="{".repeat(J);if(!$.includes(X))return $;let Y="",Q=0;for(;;){let G=$.indexOf(X,Q);if(G===-1)break;let z=pJ($,G,J);if(z===-1)break;Y+=$.slice(Q,G)+Z($.slice(G,z+J),$.slice(G+J,z),G),Q=z+J}return Q===0?$:Y+$.slice(Q)}function U5($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function H5($){return h3(U5($))}function Y1($,Z){let{scripts:J}=f0($);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|useModel)\s*(?:<[^>]*>)?\s*\(/.test(Q))return!0;if(o3(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 iJ($){let Z=[],J=/<([a-zA-Z][\w-]*)\b[^>]*?\s(?::for|x-for|@for)\s*=\s*(["'])([\s\S]*?)\2[^>]*>/g;for(let X=J.exec($);X;X=J.exec($)){let Y=X[1].toLowerCase(),Q=/^\s*\(?\s*([A-Za-z_$][\w$]*)\s*(?:,\s*([A-Za-z_$][\w$]*)\s*)?\)?\s+(?:in|of)\s/.exec(X[3]);if(!Q)continue;let G=new Set([Q[1],...Q[2]?[Q[2]]:[]]),z=X.index+X[0].length;if(X[0].endsWith("/>")){Z.push({start:X.index,end:z,names:G});continue}let K=new RegExp(`<(/?)${Y}\\b[^>]*?(/?)>`,"gi");K.lastIndex=z;let q=1,W=$.length;for(let U=K.exec($);U;U=K.exec($)){if(U[2]==="/")continue;if(q+=U[1]==="/"?-1:1,q===0){W=U.index+U[0].length;break}}Z.push({start:X.index,end:W,names:G})}return Z}function nJ($,Z,J){let X=G0(J);for(let Y of $){if(Z<Y.start||Z>=Y.end)continue;for(let Q of Y.names)if(new RegExp(`(?<![.#\\w$])${Q.replace(/\$/g,"\\$")}(?![\\w$])`).test(X))return!0}return!1}function l3($,Z){let J=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","URL","URLSearchParams","Intl","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined","NaN","Infinity","isNaN","isFinite","window","document","console","new","typeof","instanceof","in","void"],X=$.replace(/'[^']*'/g,"").replace(/"[^"]*"/g,""),Y="",Q=!1,G=0;for(let q=0;q<X.length;q++){let W=X[q];if(!Q&&W==="`"){Q=!0,G=0;continue}if(Q){if(W==="`"&&G===0){Q=!1;continue}if(W==="$"&&X[q+1]==="{"){G++,q++,Y+=" ";continue}if(W==="}"&&G>0){G--;continue}if(G>0){Y+=W;continue}continue}Y+=W}X=Y;let z=/(?<![a-zA-Z0-9_$])([a-zA-Z_$][a-zA-Z0-9_$]*)/g,K;while((K=z.exec(X))!==null){let q=K[1];if(!X.substring(0,K.index).trimEnd().endsWith(".")){if(!J.includes(q)&&!(q in Z))return!1}}return!0}function sJ($,Z){let J=Z.__stx_serverDeclared;if(!J||J.size===0)return!1;let X=G0($);for(let Y of J)if(new RegExp(`(?<![.#\\w$])${Y}(?![\\w$])`).test(X))return!0;return!1}var c3=new Set;function p3($){return/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/.test($.trim())}function i3($,Z){let J=`${Z??"<unknown>"}\x00${$}`;if(process.env.STX_DEBUG||!c3.has(J))c3.add(J),console.warn(`[stx] {{ ${$} }} in a <script> in ${Z??"<unknown>"} has no server value, so it was emitted as undefined. A mustache left in JavaScript is a SyntaxError that takes the whole script down, so give the value a default in <script server>.`);return"undefined"}function j5($,Z,J){let X=$;return X=X.replace(/\{!!([\s\S]*?)!!\}/g,(Y,Q)=>{try{let G=S0(Q,Z);if(G===void 0)return p3(Q)?i3(Q.trim(),J):Y;return G===null?"":String(G)}catch{return Y}}),X=Z9(X,(Y,Q,G)=>{let z=Q.trim();if(/^__[A-Z_]+__$/.test(z))return Y;try{let K=S0(Q,Z);if(K===void 0)return p3(z)?i3(z,J):Y;return JSON.stringify(K).replace(/</g,"\\u003c")}catch{return Y}}),X}function oJ($,Z){if(!$.includes("{"))return $;let J=$;return J=J.replace(/\{!!([\s\S]*?)!!\}/g,(X,Y)=>{try{let Q=S0(Y,Z);if(Q===void 0)return X;return Q===null?"":String(Q)}catch{return X}}),J=Z9(J,(X,Y,Q)=>{let G=Y.trim();if(/^__[A-Z_]+__$/.test(G))return X;try{let z=S0(Y,Z);if(z===void 0)return X;if(z===null)return"";let K=String(z);return K5(z5(J,Q),K,H5(K))}catch{return X}}),J}function DW($,Z,J={}){let{output:X,scripts:Y}=f0($),Q=Y.map((G)=>{let z=G.match(/^<script\b([^>]*)>([\s\S]*?)<\/script\s*>$/i),K=G.match(/^<script\b[^>]*>/i),q=G.search(/<\/script\s*>$/i);if(!z||!K||q===-1)return G;let W=z[1],U=z[2];if(/\bdata-raw\b/.test(W))return G;if(J.skipServer&&/\bserver\b/.test(W))return G;let j=`<script${oJ(W,Z)}>`;if(/\bsrc\s*=/.test(W)||/\btype\s*=\s*["']application\/json["']/.test(W))return j+U+G.slice(q);return j+j5(U,Z)+G.slice(q)});return j2(X,Q)}function L1($,Z,J){let X=$,Y=(H,j)=>{let B=J9(H,j);if(B===-1)return-1;return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(H.slice(j,B))?-1:B},Q=(H,j,B,V)=>{let _=B.length,{output:L,tokens:F}=V1(H,j,(O,w)=>V(_+w));return B.push(...F),L},G=[];X=Q(X,Y,G,(H)=>`<!--__STX_STYLE_${H}__-->`);let z=[];X=Q(X,U2,z,(H)=>`<!--__STX_SCRIPT_EXPR_${H}__-->`);let K=Z?.__stx_signals_gate===!0||Y1($),q=new Set(Array.isArray(Z?.__stx_client_signal_names)?Z.__stx_client_signal_names:[]),W=new Set(Array.isArray(Z?.__stx_preserved_client_expressions)?Z.__stx_preserved_client_expressions:[]);X=Z9(X,(H,j,B)=>{try{let V=S0(j,Z,!1,(_)=>q5(_,H,J,$));return V!==void 0&&V!==null?String(V):""}catch(V){let _=V instanceof Error?V.message:String(V);return _0("Expression",`Error evaluating: {{{ ${j.trim()}}}}: ${_}`,J,$,B,H)}},3),X=X.replace(/\{!!([\s\S]*?)!!\}/g,(H,j,B)=>{try{let V=S0(j,Z,!1,(_)=>q5(_,H,J,$));if(V===void 0&&Z.__stx_buildMode==="compile")return $9("raw",j.trim());return V!==void 0&&V!==null?String(V):""}catch(V){if(Z.__stx_buildMode==="compile")return $9("raw",j.trim());let _=V instanceof Error?V.message:String(V);return _0("Expression",`Error evaluating: {!! ${j.trim()} !!}: ${_}`,J,$,B,H)}}),X=Q(X,U2,z,(H)=>`<!--__STX_SCRIPT_EXPR_${H}__-->`),X=Q(X,Y,G,(H)=>`<!--__STX_STYLE_${H}__-->`);let U=K?iJ(X):[];if(X=Z9(X,(H,j,B)=>{let V=j.trim();if(U.length>0&&nJ(U,B,V))return H;if(W.has(V))return H;let _=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined"],L=/^([a-zA-Z_$][a-zA-Z0-9_$]*)/,O=V.match(L)?.[1],w=O&&((O in Z)||_.includes(O)),R=Boolean(O&&q.has(O)),D=/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/,N=V.match(D),I=N&&!_.includes(N[1])&&!(N[1]in Z);if(/^__[A-Z_]+__$/.test(V))return"";let M;try{let T=S0(j,Z,!1,(A)=>{M=A});if(R)return H;if(K&&!l3(V,Z))return H;if(M)q5(M,H,J,$);if(Z.__stx_buildMode==="compile"&&!K&&(T===void 0||sJ(V,Z)))return $9("expr",V);if(T===void 0||T===null)return"";let k=String(T);return K5(z5(X,B),k,H5(k))}catch(T){if(R)return H;if(K&&!l3(V,Z))return H;if(I)return H;let k=T instanceof Error?T.message:String(T);return _0("Expression",`Error evaluating: {{ ${V} }}: ${k}`,J,$,B,H)}}),z.length>0)X=X.replace(/<!--__STX_SCRIPT_EXPR_(\d+)__-->/g,(H,j)=>z[Number(j)]??H);if(G.length>0)X=X.replace(/<!--__STX_STYLE_(\d+)__-->/g,(H,j)=>G[Number(j)]??H);return X}function rJ($,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=H2[G]||X9[G];if(!z)throw Error(`Filter not found: ${G}. Available filters: ${Object.keys(cJ()).join(", ")}`);let K=[];if(Y.startsWith(":")){let q=Y.match(/^:([^|\s]+)/);if(q){let W=q[1].trim();try{let U=Number(W);K=[Number.isNaN(U)?W:U]}catch{K=[W]}Y=Y.substring(q[0].length).trim()}}else if(Y.startsWith("(")){let q=1,W=1;while(q>0&&W<Y.length){if(Y[W]==="(")q++;if(Y[W]===")")q--;W++}if(q===0){let U=Y.substring(1,W-1).trim();if(U)try{if(U.startsWith("{")&&U.endsWith("}"))K=[S0(`(${U})`,J,!0)];else{let H=[],j="",B=null,V=0,_=0,L=0,F=!1;for(let O=0;O<U.length;O++){let w=U[O];if(F){j+=w,F=!1;continue}if(w==="\\"){j+=w,F=!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==="[")_++;else if(w==="]")_--;else if(w==="{")L++;else if(w==="}")L--;if(w===","&&V===0&&_===0&&L===0){H.push(j),j="";continue}j+=w}if(j)H.push(j);K=H.map((O)=>{let w=O.trim();return S0(w,J,!0)})}}catch{K=[U]}Y=Y.substring(W).trim()}}try{X=z(X,J,...K)}catch(q){let W=q instanceof Error?q.message:String(q);throw Error(`Error applying filter '${G}': ${W}`)}if(Y.startsWith("|"))Y=Y.substring(1).trim();else break}return X}function aJ($){let Z=!1,J="",X=0,Y=0,Q=0,G=!1;for(let z=0;z<$.length;z++){let K=$[z],q=$[z+1];if(Z&&G){G=!1;continue}if(Z&&K==="\\"){G=!0;continue}if(G=!1,(K==='"'||K==="'"||K==="`")&&!G){if(!Z)Z=!0,J=K;else if(K===J)Z=!1,J="";continue}if(Z&&J==="`"&&K==="$"&&q==="{"){let W=1;z+=2;while(z<$.length&&W>0){if($[z]==="{")W++;else if($[z]==="}")W--;if(W>0)z++}continue}if(Z)continue;if(K==="(")X++;else if(K===")")X--;else if(K==="[")Y++;else if(K==="]")Y--;else if(K==="{")Q++;else if(K==="}")Q--;if(K==="|"&&X===0&&Y===0&&Q===0){if(q==="|"){z++;continue}if(q==="="){z++;continue}return z}}return-1}var W2=new Set,tJ=1000;function NW(){W2.clear()}function q5($,Z,J,X){if(!n3())return;let Y=`${J}\x00${$.expression}`;if(W2.has(Y))return;if(W2.size>=tJ)W2.clear();W2.add(Y);let Q=J,G=X;try{if(J&&m3.existsSync(J))G=m3.readFileSync(J,"utf8")}catch{}let z=G.indexOf(Z);if(z>=0)Q=`${J}:${G.slice(0,z).split(`
124
+ `).length}`;console.warn(`${Q}: stx warning: ${Z} rendered as an empty string. The safe evaluator rejected \`${$.expression}\` (${$.rule}). Compute the value in <script server> and interpolate the variable instead.`)}function S0($,Z,J=!1,X){try{let Y=$.trim(),Q=aJ(Y);if(Q>0){let z=Y.substring(0,Q).trim(),K=Y.substring(Q+1).trim(),q=S0(z,Z,!0,X);return rJ(q,K,Z)}let G=s3(Y);if(G!==null){X?.({expression:Y,rule:G});return}try{let z=Object.keys(Z),K=Object.values(Z);return H0(Y,z)(...K)}catch{return Q0(Y,Z)}}catch(Y){if(Y instanceof ReferenceError){let Q=/(\b\w+)\s+is not defined/.exec(Y.message);if(Q){let G=Q[1],z=eJ(G,Object.keys(Z));if(z&&z!==G)Y.message=`${Y.message} \u2014 did you mean '${z}'?`}}if(!J)console.error(`Error evaluating expression: ${$}`,Y);throw Y}}function eJ($,Z){let J=null;for(let Y of Z){if(Y===$)continue;let Q=$X($,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 $X($,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 K=J[z-1]===X[G-1]?0:1;Q[z]=Math.min(Q[z-1]+1,Y[z]+1,Y[z-1]+K)}for(let z=0;z<=J.length;z++)Y[z]=Q[z]}return Y[J.length]}function MW($){if(!$)return"";return $.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#039;/g,"'").replace(/&#39;/g,"'").replace(/&amp;/g,"&")}import ZK from"fs";import b0 from"path";var B5=[{open:/<!--/g,close:/-->/g},{open:/<script\b/gi,close:/<\/script\s*>/gi},{open:/<style\b/gi,close:/<\/style\s*>/gi}],r3=/<body\b([^>]*)>/gi;function p0($){let Z=0,J,X=B5.map(()=>{return});while(Z<$.length){if(J===void 0||J!==null&&J.index<Z)r3.lastIndex=Z,J=r3.exec($);if(!J)return null;let Y=J.index,Q=-1,G=null;for(let K=0;K<B5.length;K++){let q=B5[K],W=X[K];if(W===void 0||W!==null&&W.index<Z)q.open.lastIndex=Z,W=q.open.exec($),X[K]=W;if(!W)continue;if(W.index<Y&&(Q===-1||W.index<Q))Q=W.index,G=q.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 x1($,Z){let J=p0($);if(!J)return $;return $.slice(0,J.index)+Z(J.tag,J.attrs)+$.slice(J.index+J.tag.length)}var a3=/<style\b[^>]*>/iy,t3=/<\/style>/gi,e3=/<script\b[^>]*>/iy,$4=/<template(?=[\s>/])[^>]*>/iy,Z4=/<\/template\s*>/iy;function B2($){let Z=0,J=0,X=-1;while(Z<$.length){let Y=$.indexOf("<",Z);if(Y===-1)return-1;if($.startsWith("<!--",Y)){let K=$.indexOf("-->",Y+4);Z=K===-1?$.length:K+3;continue}a3.lastIndex=Y;let Q=a3.exec($);if(Q){t3.lastIndex=Y+Q[0].length;let K=t3.exec($);Z=K===null?$.length:K.index+8;continue}$4.lastIndex=Y;let G=$4.exec($);if(G){if(J===0)X=Y;J++,Z=Y+G[0].length;continue}Z4.lastIndex=Y;let z=Z4.exec($);if(z){if(J>0)J--;Z=Y+z[0].length;continue}if(e3.lastIndex=Y,e3.test($))return J>0?X:Y;Z=Y+1}return-1}var J4=null;function ZX($){if(!J4)return console.warn(`[stx] ${$} must be called within a component setup.`),null;return J4}function kW($){let Z=ZX("onUpdate");if(Z)Z.updateHooks.push($)}function X4(){return`
125
125
  // STX Lifecycle Runtime
126
126
  (function() {
127
127
  if (typeof window === 'undefined') return;
@@ -469,7 +469,7 @@ else {
469
469
 
470
470
  console.log('[stx] Lifecycle runtime initialized');
471
471
  })();
472
- `}function V5($){return Symbol($)}var kW=V5("theme"),EW=V5("router"),yW=V5("i18n");import*as Q4 from"crypto";function Y4($){let Z=/\$(\w+)\./g,J=[],X;while((X=Z.exec($))!==null)if(!J.includes(X[1]))J.push(X[1]);return J}function JX(){return`stx-${Q4.randomBytes(4).toString("hex")}`}function XX($){return/\$\w+\./.test($)}function YX($){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,K)=>{if(["script","style","template"].includes(G.toLowerCase()))return Q;let q=[],W=!1,U=z,H=/(\w+(?:-\w+)*)\s*=\s*"([^"]*\{\{[^}]*\$\w+[^}]*\}\}[^"]*)"/g,j=[...z.matchAll(H)];for(let _ of j){let L=_[0],F=_[1],O=_[2];if(XX(O)){W=!0;let w=O.match(/\{\{\s*([\s\S]+?)\s*\}\}/);if(w){let R=w[1];if(q.push({attr:F,expr:R,fullMatch:L,originalAttr:F}),Y4(R).forEach((N)=>J.add(N)),F==="text")U=U.replace(L,"");else if(F==="class")U=U.replace(L,'class=""');else if(F==="disabled"||F==="hidden")U=U.replace(L,"");else U=U.replace(L,`${F}=""`)}}}if(!W)return Q;let B=U.match(/\bid\s*=\s*"([^"]+)"/),V;if(B)V=B[1];else V=JX(),U=` id="${V}"${U}`;for(let _ of q)Z.push({elementId:V,attribute:_.attr,expression:_.expr,stores:Y4(_.expr)});return`<${G}${U}${K}`}),{html:Y,bindings:Z,stores:J}}function QX($,Z){if($.length===0)return"";let J=Array.from(Z),X=`
472
+ `}function V5($){return Symbol($)}var EW=V5("theme"),yW=V5("router"),bW=V5("i18n");import*as Q4 from"crypto";function Y4($){let Z=/\$(\w+)\./g,J=[],X;while((X=Z.exec($))!==null)if(!J.includes(X[1]))J.push(X[1]);return J}function JX(){return`stx-${Q4.randomBytes(4).toString("hex")}`}function XX($){return/\$\w+\./.test($)}function YX($){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,K)=>{if(["script","style","template"].includes(G.toLowerCase()))return Q;let q=[],W=!1,U=z,H=/(\w+(?:-\w+)*)\s*=\s*"([^"]*\{\{[^}]*\$\w+[^}]*\}\}[^"]*)"/g,j=[...z.matchAll(H)];for(let _ of j){let L=_[0],F=_[1],O=_[2];if(XX(O)){W=!0;let w=O.match(/\{\{\s*([\s\S]+?)\s*\}\}/);if(w){let R=w[1];if(q.push({attr:F,expr:R,fullMatch:L,originalAttr:F}),Y4(R).forEach((N)=>J.add(N)),F==="text")U=U.replace(L,"");else if(F==="class")U=U.replace(L,'class=""');else if(F==="disabled"||F==="hidden")U=U.replace(L,"");else U=U.replace(L,`${F}=""`)}}}if(!W)return Q;let B=U.match(/\bid\s*=\s*"([^"]+)"/),V;if(B)V=B[1];else V=JX(),U=` id="${V}"${U}`;for(let _ of q)Z.push({elementId:V,attribute:_.attr,expression:_.expr,stores:Y4(_.expr)});return`<${G}${U}${K}`}),{html:Y,bindings:Z,stores:J}}function QX($,Z){if($.length===0)return"";let J=Array.from(Z),X=`
473
473
  <script>
474
474
  (function() {
475
475
  'use strict';
@@ -684,7 +684,7 @@ ${Z.inlineScript}
684
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`
685
685
  <!-- Custom Analytics -->
686
686
  <script${J.length>0?` ${J.join(" ")}`:""} src="${v0(Z.scriptUrl)}" defer></script>
687
- `}function K4($,Z){let J=z4(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 CW={name:"analytics",hasEndTag:!1,handler:async($,Z,J,X)=>{let Y=J.__stx_config||{};return z4(Y)}};var UX={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 q4($){let Z=$.heatmap;if(!Z?.enabled)return"";let J={...UX,...Z};return`
687
+ `}function K4($,Z){let J=z4(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 PW={name:"analytics",hasEndTag:!1,handler:async($,Z,J,X)=>{let Y=J.__stx_config||{};return z4(Y)}};var UX={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 q4($){let Z=$.heatmap;if(!Z?.enabled)return"";let J={...UX,...Z};return`
688
688
  <!-- stx Heatmap - Privacy-Compliant Tracking -->
689
689
  <script>
690
690
  (function() {
@@ -1067,7 +1067,7 @@ else {
1067
1067
  };
1068
1068
  })();
1069
1069
  </script>
1070
- `}function W4($,Z){let J=q4(Z);if(!J)return $;let X=$.lastIndexOf("</body>");if(X!==-1)return $.slice(0,X)+J+$.slice(X);return $+J}var U4={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=HX(Z.join(" "));Y.heatmap={...Y.heatmap,...Q,enabled:!0}}return q4(Y)}};function HX($){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 H4{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,K)=>({x:K,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 vW(){return new H4}var jX;((G)=>{G.Fade="fade";G.Slide="slide";G.Scale="scale";G.Flip="flip";G.Rotate="rotate";G.Custom="custom"})(jX||={});var BX;((X)=>{X.In="in";X.Out="out";X.Both="both"})(BX||={});var VX;((G)=>{G.Linear="linear";G.Ease="ease";G.EaseIn="ease-in";G.EaseOut="ease-out";G.EaseInOut="ease-in-out";G.Spring="spring"})(VX||={});var t0={duration:300,delay:0,ease:"ease",direction:"both"};function LX($,Z={}){let{duration:J,delay:X,ease:Y,direction:Q,custom:G}={...t0,...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 W4($,Z){let J=q4(Z);if(!J)return $;let X=$.lastIndexOf("</body>");if(X!==-1)return $.slice(0,X)+J+$.slice(X);return $+J}var U4={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=HX(Z.join(" "));Y.heatmap={...Y.heatmap,...Q,enabled:!0}}return q4(Y)}};function HX($){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 H4{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,K)=>({x:K,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 xW(){return new H4}var jX;((G)=>{G.Fade="fade";G.Slide="slide";G.Scale="scale";G.Flip="flip";G.Rotate="rotate";G.Custom="custom"})(jX||={});var BX;((X)=>{X.In="in";X.Out="out";X.Both="both"})(BX||={});var VX;((G)=>{G.Linear="linear";G.Ease="ease";G.EaseIn="ease-in";G.EaseOut="ease-out";G.EaseInOut="ease-in-out";G.Spring="spring"})(VX||={});var t0={duration:300,delay:0,ease:"ease",direction:"both"};function LX($,Z={}){let{duration:J,delay:X,ease:Y,direction:Q,custom:G}={...t0,...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);"}
1071
1071
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
1072
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);"}
1073
1073
  @keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@@ -1343,7 +1343,7 @@ ${K}`},hasEndTag:!1,description:"Coordinates multiple animations together as a g
1343
1343
  --stx-spring-stiffness: ${Q.stiffness};
1344
1344
  --stx-spring-damping: ${Q.damping};
1345
1345
  --stx-spring-mass: ${Q.mass};
1346
- `.trim().replace(/\s+/g," ");return`<div id="${z}" class="stx-spring" style="${q}">${$}</div>`},description:"Applies spring physics animations to an element"};function fW($){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="${q}">${$}</div>`},description:"Applies spring physics animations to an element"};function gW($){let Z=`stx-timeline-${Math.random().toString(36).slice(2,9)}`;return`
1347
1347
  <script data-stx-scoped data-stx-run="always">
1348
1348
  (function() {
1349
1349
  const timeline = ${JSON.stringify($)};
@@ -1380,7 +1380,7 @@ else {
1380
1380
  runTimeline();
1381
1381
  }
1382
1382
  })();
1383
- </script>`}function gW($,Z,J){let X=DX($,Z),Y=`
1383
+ </script>`}function hW($,Z,J){let X=DX($,Z),Y=`
1384
1384
  .${$}-animation {
1385
1385
  animation-name: ${$};
1386
1386
  animation-duration: ${J.duration}ms;
@@ -1390,7 +1390,7 @@ else {
1390
1390
  animation-direction: ${J.direction||"normal"};
1391
1391
  animation-fill-mode: ${J.fill||"forwards"};
1392
1392
  }`;return`${X}
1393
- ${Y}`}function hW($){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 uW(){return`
1393
+ ${Y}`}function uW($){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 mW(){return`
1394
1394
  <script data-stx-scoped data-stx-run="once">
1395
1395
  window.__stxAnimation = {
1396
1396
  // Registry of animations
@@ -1462,7 +1462,7 @@ else {
1462
1462
  );
1463
1463
  }
1464
1464
  };
1465
- </script>`}function mW($){let Z=$.customDirectives||[];return Z.push(L5),Z.push(O5),Z.push(F5),Z.push(_5),Z.push(NX),Z.push(AX),Z.push(TX),{...$,customDirectives:Z}}function V4($){let Z=$.match(/\bdefinePageMeta\s*\(\s*(\{[\s\S]*?\})\s*\)/m);if(!Z)return null;try{return Function(`return ${Z[1]}`)()}catch{return null}}function L4($){let Z=$?.layout;if(Z===!1)return!1;return typeof Z==="string"&&Z.trim()?Z.trim():void 0}var kX=100,EX=599,R5="__stxResponseStatus",V2="__stxResponseHeaders";function Y9($){return typeof $==="number"&&Number.isInteger($)&&$>=kX&&$<=EX}function pW($){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(Y9(X))return X}return}function w5($,Z){if(!$||typeof $!=="object")return!1;let J=typeof Z==="string"&&/^\d+$/.test(Z.trim())?Number(Z.trim()):Z;if(!Y9(J))return!1;return $[R5]=J,!0}function yX($,Z,J){if(!$||typeof $!=="object")return;let X=String(Z??"").trim();if(!X)return;$[V2]={...$[V2],[X]:String(J)}}function bX($){let Z=$?.[R5];return Y9(Z)?Z:void 0}function SX($){let Z=$?.[V2];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 iW($,Z){if(!$||!Z||$===Z||typeof Z!=="object")return;let J=bX($);if(J!==void 0)Z[R5]=J;let X=SX($);if(X)Z[V2]={...Z[V2],...X}}function _4($){return{setResponseStatus:(Z)=>{w5($,Z)},notFound:(Z=404)=>{let J=Y9(Z)&&Z>=400?Z:404;w5($,J)},setResponseHeader:(Z,J)=>{yX($,Z,J)}}}function O4($,Z,J={}){if(!$.includes("@status"))return $;let{filePath:X,buildMode:Y}=J,Q=Y==="compile",G="",z=0,K=/@status\s*\(/g,q;while((q=K.exec($))!==null){let W=CX($,q.index+q[0].length-1);if(W<0)break;let U=$.slice(q.index+q[0].length,W).trim(),H=/^\d+$/.test(U)?Number(U):Q0(U,Z),j=X?` in ${X}`:"";if(Q)console.warn(`[stx] @status(${U})${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(${U}) from <script server> instead \u2014 that runs per request.`);else if(!w5(Z,H))console.warn(`[stx] @status(${U})${j} is not an HTTP status (100-599) \u2014 ignoring it.`);G+=$.slice(z,q.index),z=W+1+($.slice(W+1).match(/^[^\S\n]*\n?/)?.[0].length??0),K.lastIndex=z}return z===0?$:G+$.slice(z)}function CX($,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 PX=0,vX=0;function F4($,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 xX($){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,K=F4(G,"x-data");if(!K)continue;let q=`__stx_scope_${PX++}`,W=F4(G,"x-init"),U=fX($,Q,z+Y.length),H=$.slice(z,U.endIndex),j=gX(H);Z.push({id:q,selector:`[data-stx-scope="${q}"]`,stateExpr:K,initExpr:W,bindings:[],refs:j})}return Z}function fX($,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 K=Q.exec($),q=G.exec($),W=z.exec($);if(W&&W.index<(K?.index??1/0)){Y=W.index+W[0].length;continue}if(!q)return{endIndex:$.length};if(K&&K.index<q.index)X++,Y=K.index+K[0].length;else{if(X--,X===0)return{endIndex:q.index+q[0].length};Y=q.index+q[0].length}}return{endIndex:$.length}}function gX($){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=hX(Q);Z.set(G,z)}return Z}function hX($){let Z=$.match(/\bid\s*=\s*["']([^"']*)["']/);if(Z)return Z[1];return`__stx_el_${vX++}`}function uX(){return`
1465
+ </script>`}function dW($){let Z=$.customDirectives||[];return Z.push(L5),Z.push(O5),Z.push(F5),Z.push(_5),Z.push(NX),Z.push(AX),Z.push(TX),{...$,customDirectives:Z}}function V4($){let Z=$.match(/\bdefinePageMeta\s*\(\s*(\{[\s\S]*?\})\s*\)/m);if(!Z)return null;try{return Function(`return ${Z[1]}`)()}catch{return null}}function L4($){let Z=$?.layout;if(Z===!1)return!1;return typeof Z==="string"&&Z.trim()?Z.trim():void 0}var kX=100,EX=599,R5="__stxResponseStatus",V2="__stxResponseHeaders";function Y9($){return typeof $==="number"&&Number.isInteger($)&&$>=kX&&$<=EX}function iW($){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(Y9(X))return X}return}function w5($,Z){if(!$||typeof $!=="object")return!1;let J=typeof Z==="string"&&/^\d+$/.test(Z.trim())?Number(Z.trim()):Z;if(!Y9(J))return!1;return $[R5]=J,!0}function yX($,Z,J){if(!$||typeof $!=="object")return;let X=String(Z??"").trim();if(!X)return;$[V2]={...$[V2],[X]:String(J)}}function bX($){let Z=$?.[R5];return Y9(Z)?Z:void 0}function SX($){let Z=$?.[V2];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 nW($,Z){if(!$||!Z||$===Z||typeof Z!=="object")return;let J=bX($);if(J!==void 0)Z[R5]=J;let X=SX($);if(X)Z[V2]={...Z[V2],...X}}function _4($){return{setResponseStatus:(Z)=>{w5($,Z)},notFound:(Z=404)=>{let J=Y9(Z)&&Z>=400?Z:404;w5($,J)},setResponseHeader:(Z,J)=>{yX($,Z,J)}}}function O4($,Z,J={}){if(!$.includes("@status"))return $;let{filePath:X,buildMode:Y}=J,Q=Y==="compile",G="",z=0,K=/@status\s*\(/g,q;while((q=K.exec($))!==null){let W=CX($,q.index+q[0].length-1);if(W<0)break;let U=$.slice(q.index+q[0].length,W).trim(),H=/^\d+$/.test(U)?Number(U):Q0(U,Z),j=X?` in ${X}`:"";if(Q)console.warn(`[stx] @status(${U})${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(${U}) from <script server> instead \u2014 that runs per request.`);else if(!w5(Z,H))console.warn(`[stx] @status(${U})${j} is not an HTTP status (100-599) \u2014 ignoring it.`);G+=$.slice(z,q.index),z=W+1+($.slice(W+1).match(/^[^\S\n]*\n?/)?.[0].length??0),K.lastIndex=z}return z===0?$:G+$.slice(z)}function CX($,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 PX=0,vX=0;function F4($,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 xX($){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,K=F4(G,"x-data");if(!K)continue;let q=`__stx_scope_${PX++}`,W=F4(G,"x-init"),U=fX($,Q,z+Y.length),H=$.slice(z,U.endIndex),j=gX(H);Z.push({id:q,selector:`[data-stx-scope="${q}"]`,stateExpr:K,initExpr:W,bindings:[],refs:j})}return Z}function fX($,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 K=Q.exec($),q=G.exec($),W=z.exec($);if(W&&W.index<(K?.index??1/0)){Y=W.index+W[0].length;continue}if(!q)return{endIndex:$.length};if(K&&K.index<q.index)X++,Y=K.index+K[0].length;else{if(X--,X===0)return{endIndex:q.index+q[0].length};Y=q.index+q[0].length}}return{endIndex:$.length}}function gX($){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=hX(Q);Z.set(G,z)}return Z}function hX($){let Z=$.match(/\bid\s*=\s*["']([^"']*)["']/);if(Z)return Z[1];return`__stx_el_${vX++}`}function uX(){return`
1466
1466
  // STX Reactive Runtime - x-cloak and transition CSS
1467
1467
  (function() {
1468
1468
  var style = document.createElement('style');
@@ -1700,8 +1700,8 @@ ${V}
1700
1700
  `)}</p>`);if(Y=z.join(`
1701
1701
  `),X)Y=Y.replace(/\n/g,`<br />
1702
1702
  `);for(let W=0;W<Q.length;W++)Y=Y.replace(`\x00CODEBLOCK${W}\x00`,Q[W]);return Y=Y.replace(/<p>\s*<\/p>/g,""),Y.trim()}async function A4($,Z,J=""){let X=$,Y=[],Q=/@markdown(?:\([^)]*\))?/g,G;while((G=Q.exec($))!==null){let z=G.index,K=G[0].match(/@markdown\(([^)]*)\)/),q=K?K[1]:"",W=z+G[0].length,U=1,H=W,j=-1;while(U>0&&H<$.length){let _=$.indexOf("@markdown",H),L=$.indexOf("@endmarkdown",H);if(L===-1)break;if(_!==-1&&_<L&&_!==z){let F=$[_+9];if(F==="("||F===`
1703
- `||F==="\r"||F===" "||F===void 0)U++;H=_+9}else{if(U--,U===0){j=L;break}H=L+12}}if(j===-1)continue;let B=$.slice(W,j),V=$.slice(z,j+12);Y.push({fullMatch:V,options:q,content:B,index:z}),Q.lastIndex=j+12}for(let{fullMatch:z,options:K,content:q,index:W}of Y)try{let U={};if(K)K.split(",").forEach((B)=>{let V=B.trim();if(V)U[V]=!0});let H={gfm:U.gfm??!0,breaks:U.breaks??!1},j=_2(q.trim(),H);X=X.split(z).join(j)}catch(U){let H=U instanceof Error?U.message:String(U),j=_0("Markdown Directive",`Error processing markdown: ${H}`,J,$,W,z);X=X.split(z).join(j)}return X}async function I4($,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}),_2($.trim(),Y)}var _1=[320,480,640,768,1024,1280,1536,1920,2560],T4=[1,1.5,2,3],f1=["avif","webp","jpeg"],k4={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png",gif:"image/gif"},pX={avif:"avif",webp:"webp",jpeg:"jpg",png:"png",gif:"gif"};function O2($,Z=_1,J={},X){return Z.sort((Y,Q)=>Y-Q).map((Y)=>{return`${G1($,{...J,w:Y,fm:X})} ${Y}w`}).join(", ")}function QU($,Z=320,J=2560,X=0.08,Y={},Q){let G=iX(Z,J,X);return O2($,G,Y,Q)}function iX($,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 N5($,Z,J=T4,X={},Y){return J.sort((Q,G)=>Q-G).map((Q)=>{let G=Math.round(Z*Q);return`${G1($,{...X,w:G,dpr:Q,fm:Y})} ${Q}x`}).join(", ")}function GU($,Z,J=T4,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,K)=>z-K).map((z)=>{let K=Math.round(Z*z),q=G[z]||Math.round(X*Math.max(0.5,1-z*0.1));return`${G1($,{...Y,w:K,q,dpr:z,fm:Q})} ${z}x`}).join(", ")}function M5($,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 zU($,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 KU={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 G1($,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 qU($){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 WU($){let{src:Z,widths:J,dprValues:X,fixedWidth:Y,formats:Q=f1,baseUrl:G="",params:z={}}=$,K=[];for(let q of Q){let W,U;if(Y!==void 0&&X)W=N5(Z,Y,X,z,q),U=X.map((H)=>({path:"",url:G1(Z,{...z,w:Math.round(Y*H),fm:q}),width:Math.round(Y*H),height:0,format:q,size:0,dpr:H}));else{let H=J||_1;W=O2(Z,H,z,q),U=H.map((j)=>({path:"",url:G1(Z,{...z,w:j,fm:q}),width:j,height:0,format:q,size:0}))}K.push({srcset:W,format:q,mimeType:k4[q],variants:U})}return K}function UU($,Z="100vw"){return $.map(({srcset:J,mimeType:X})=>`<source type="${X}" srcset="${J}" sizes="${Z}" />`).join(`
1704
- `)}function HU($,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 A5($){return k4[$]||"application/octet-stream"}function jU($){return pX[$]||$}function BU($){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 nX={strategy:"thumbhash",width:20,quality:50,blurLevel:40,transitionDuration:300,easing:"ease-out"},I5=`
1703
+ `||F==="\r"||F===" "||F===void 0)U++;H=_+9}else{if(U--,U===0){j=L;break}H=L+12}}if(j===-1)continue;let B=$.slice(W,j),V=$.slice(z,j+12);Y.push({fullMatch:V,options:q,content:B,index:z}),Q.lastIndex=j+12}for(let{fullMatch:z,options:K,content:q,index:W}of Y)try{let U={};if(K)K.split(",").forEach((B)=>{let V=B.trim();if(V)U[V]=!0});let H={gfm:U.gfm??!0,breaks:U.breaks??!1},j=_2(q.trim(),H);X=X.split(z).join(j)}catch(U){let H=U instanceof Error?U.message:String(U),j=_0("Markdown Directive",`Error processing markdown: ${H}`,J,$,W,z);X=X.split(z).join(j)}return X}async function I4($,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}),_2($.trim(),Y)}var _1=[320,480,640,768,1024,1280,1536,1920,2560],T4=[1,1.5,2,3],f1=["avif","webp","jpeg"],k4={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png",gif:"image/gif"},pX={avif:"avif",webp:"webp",jpeg:"jpg",png:"png",gif:"gif"};function O2($,Z=_1,J={},X){return Z.sort((Y,Q)=>Y-Q).map((Y)=>{return`${G1($,{...J,w:Y,fm:X})} ${Y}w`}).join(", ")}function GU($,Z=320,J=2560,X=0.08,Y={},Q){let G=iX(Z,J,X);return O2($,G,Y,Q)}function iX($,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 N5($,Z,J=T4,X={},Y){return J.sort((Q,G)=>Q-G).map((Q)=>{let G=Math.round(Z*Q);return`${G1($,{...X,w:G,dpr:Q,fm:Y})} ${Q}x`}).join(", ")}function zU($,Z,J=T4,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,K)=>z-K).map((z)=>{let K=Math.round(Z*z),q=G[z]||Math.round(X*Math.max(0.5,1-z*0.1));return`${G1($,{...Y,w:K,q,dpr:z,fm:Q})} ${z}x`}).join(", ")}function M5($,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 KU($,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 qU={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 G1($,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 WU($){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 UU($){let{src:Z,widths:J,dprValues:X,fixedWidth:Y,formats:Q=f1,baseUrl:G="",params:z={}}=$,K=[];for(let q of Q){let W,U;if(Y!==void 0&&X)W=N5(Z,Y,X,z,q),U=X.map((H)=>({path:"",url:G1(Z,{...z,w:Math.round(Y*H),fm:q}),width:Math.round(Y*H),height:0,format:q,size:0,dpr:H}));else{let H=J||_1;W=O2(Z,H,z,q),U=H.map((j)=>({path:"",url:G1(Z,{...z,w:j,fm:q}),width:j,height:0,format:q,size:0}))}K.push({srcset:W,format:q,mimeType:k4[q],variants:U})}return K}function HU($,Z="100vw"){return $.map(({srcset:J,mimeType:X})=>`<source type="${X}" srcset="${J}" sizes="${Z}" />`).join(`
1704
+ `)}function jU($,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 A5($){return k4[$]||"application/octet-stream"}function BU($){return pX[$]||$}function VU($){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 nX={strategy:"thumbhash",width:20,quality:50,blurLevel:40,transitionDuration:300,easing:"ease-out"},I5=`
1705
1705
  .stx-img-placeholder {
1706
1706
  position: relative;
1707
1707
  overflow: hidden;
@@ -1730,9 +1730,9 @@ ${V}
1730
1730
  filter: blur(0);
1731
1731
  transform: scale(1);
1732
1732
  }
1733
- `.trim();async function T5(){try{return await import("ts-images")}catch{return null}}async function E4($,Z={}){let J={...nX,...Z},X=await T5();if(X)try{return await sX($,J,X)}catch(Y){console.warn(`[stx-media] ts-images placeholder generation failed, using fallback: ${Y}`)}return y4($,J)}async function sX($,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 y4($,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 LU($){let Z=await T5();if(Z)try{return(await Z.generateThumbHash($)).dataUrl}catch{}return(await y4($,{strategy:"thumbhash",width:32,height:32})).dataURL}function _U($){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,K=(z>>3&63)/63,q=(z>>9&63)/63,W=z>>15!==0,U=Math.max(3,W?G?5:7:G?5:7),H=Math.max(3,W?G?5:7:G?5:7),j=32,B=32,V=Math.max(0,Math.min(255,Math.round((J+X)*255))),_=Math.max(0,Math.min(255,Math.round(J*255))),L=Math.max(0,Math.min(255,Math.round((J-X)*255))),F=`<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32">
1733
+ `.trim();async function T5(){try{return await import("ts-images")}catch{return null}}async function E4($,Z={}){let J={...nX,...Z},X=await T5();if(X)try{return await sX($,J,X)}catch(Y){console.warn(`[stx-media] ts-images placeholder generation failed, using fallback: ${Y}`)}return y4($,J)}async function sX($,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 y4($,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 _U($){let Z=await T5();if(Z)try{return(await Z.generateThumbHash($)).dataUrl}catch{}return(await y4($,{strategy:"thumbhash",width:32,height:32})).dataURL}function OU($){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,K=(z>>3&63)/63,q=(z>>9&63)/63,W=z>>15!==0,U=Math.max(3,W?G?5:7:G?5:7),H=Math.max(3,W?G?5:7:G?5:7),j=32,B=32,V=Math.max(0,Math.min(255,Math.round((J+X)*255))),_=Math.max(0,Math.min(255,Math.round(J*255))),L=Math.max(0,Math.min(255,Math.round((J-X)*255))),F=`<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32">
1734
1734
  <rect fill="rgb(${V},${_},${L})" width="32" height="32"/>
1735
- </svg>`;return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(F)}`}async function OU($,Z=20,J=50){return E4($,{strategy:"blur",width:Z,quality:J,blurLevel:40})}async function FU($){let Z=await T5();if(Z)try{return(await Z.generatePlaceholder($,{strategy:"dominant-color"})).dominantColor||"#e5e7eb"}catch{}return"#e5e7eb"}function wU($,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 b4($,Z,J={}){let X=J.transitionDuration||300,Y=J.easing||"ease-out";return`
1735
+ </svg>`;return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(F)}`}async function FU($,Z=20,J=50){return E4($,{strategy:"blur",width:Z,quality:J,blurLevel:40})}async function wU($){let Z=await T5();if(Z)try{return(await Z.generatePlaceholder($,{strategy:"dominant-color"})).dominantColor||"#e5e7eb"}catch{}return"#e5e7eb"}function RU($,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 b4($,Z,J={}){let X=J.transitionDuration||300,Y=J.easing||"ease-out";return`
1736
1736
  #${$} {
1737
1737
  --stx-img-transition-duration: ${X}ms;
1738
1738
  --stx-img-transition-easing: ${Y};
@@ -1749,7 +1749,7 @@ ${V}
1749
1749
  #${$}.stx-img-loaded img {
1750
1750
  opacity: 1;
1751
1751
  }
1752
- `.trim()}function RU($){return`background-image: url('${$.dataURL}'); background-size: cover; background-position: center;`}var g1=new Map;async function S4($,Z={}){let J=`${$}:${JSON.stringify(Z)}`;if(g1.has(J))return g1.get(J);let X=await E4($,Z);return g1.set(J,X),X}function DU(){g1.clear()}function NU(){return{size:g1.size,keys:Array.from(g1.keys())}}async function oX(){try{return await import("./chunk-baa5pana.js")}catch($){if(!C4)console.warn("[stx-media] Image processor not available, some features disabled:",$),C4=!0;return null}}var C4=!1,k5=80,Q9="async",G9="lazy",P4=!1;async function F2($,Z={}){let J=Z,X=$;if(X.process&&!X.skipOptimization){if(J.tsImagesConfig?.enabled&&!J.isDev)return $Y(X,J)}if(J.processedResult?.processed)return b5($,J.processedResult,Z);if(J.responsiveVariants)return f4($,J.responsiveVariants,Z);let{src:Y,alt:Q,width:G,height:z,sizes:K,widths:q=_1,dpr:W,formats:U=f1,quality:H=k5,params:j={},placeholder:B="none",placeholderOptions:V={},lazy:_=!0,priority:L=!1,loading:F=L?"eager":G9,decoding:O=Q9,fetchpriority:w,objectFit:R,objectPosition:D,crossorigin:N,referrerpolicy:I}=$,M=$.class,T=$.style,k=$.id,A=$.data||{},{isDev:E=!1,baseUrl:C=""}=Z;if(E&&!Z.optimize)return tX($);let b,y,P=k||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(B!=="none"&&!L)try{b=await S4(Y,{strategy:B,...V}),y=b4(P,b,V)}catch{}let u=W!==void 0&&G!==void 0,p;if(u)p=aX($,P,b,Z);else p=await rX($,P,b,Z);let m;if(L){let J0=U.includes("webp")?"webp":U[0],i=O2(Y,q,{...j,q:H},J0),q0=typeof K==="object"?M5(K):K||"100vw";m=`<link rel="preload" as="image" imagesrcset="${i}" imagesizes="${q0}" />`}let X0=[];if(!P4&&B!=="none")X0.push(I5),P4=!0;if(y)X0.push(y);let r=_?x4(P):void 0;return{html:p,preloadLink:m,css:X0.length>0?X0.join(`
1752
+ `.trim()}function DU($){return`background-image: url('${$.dataURL}'); background-size: cover; background-position: center;`}var g1=new Map;async function S4($,Z={}){let J=`${$}:${JSON.stringify(Z)}`;if(g1.has(J))return g1.get(J);let X=await E4($,Z);return g1.set(J,X),X}function NU(){g1.clear()}function MU(){return{size:g1.size,keys:Array.from(g1.keys())}}async function oX(){try{return await import("./chunk-81zw5vw5.js")}catch($){if(!C4)console.warn("[stx-media] Image processor not available, some features disabled:",$),C4=!0;return null}}var C4=!1,k5=80,Q9="async",G9="lazy",P4=!1;async function F2($,Z={}){let J=Z,X=$;if(X.process&&!X.skipOptimization){if(J.tsImagesConfig?.enabled&&!J.isDev)return $Y(X,J)}if(J.processedResult?.processed)return b5($,J.processedResult,Z);if(J.responsiveVariants)return f4($,J.responsiveVariants,Z);let{src:Y,alt:Q,width:G,height:z,sizes:K,widths:q=_1,dpr:W,formats:U=f1,quality:H=k5,params:j={},placeholder:B="none",placeholderOptions:V={},lazy:_=!0,priority:L=!1,loading:F=L?"eager":G9,decoding:O=Q9,fetchpriority:w,objectFit:R,objectPosition:D,crossorigin:N,referrerpolicy:I}=$,M=$.class,T=$.style,k=$.id,A=$.data||{},{isDev:E=!1,baseUrl:C=""}=Z;if(E&&!Z.optimize)return tX($);let b,y,P=k||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(B!=="none"&&!L)try{b=await S4(Y,{strategy:B,...V}),y=b4(P,b,V)}catch{}let u=W!==void 0&&G!==void 0,p;if(u)p=aX($,P,b,Z);else p=await rX($,P,b,Z);let m;if(L){let J0=U.includes("webp")?"webp":U[0],i=O2(Y,q,{...j,q:H},J0),q0=typeof K==="object"?M5(K):K||"100vw";m=`<link rel="preload" as="image" imagesrcset="${i}" imagesizes="${q0}" />`}let X0=[];if(!P4&&B!=="none")X0.push(I5),P4=!0;if(y)X0.push(y);let r=_?x4(P):void 0;return{html:p,preloadLink:m,css:X0.length>0?X0.join(`
1753
1753
  `):void 0,script:r}}async function rX($,Z,J,X){let{src:Y,alt:Q,width:G,height:z,sizes:K,widths:q=_1,formats:W=f1,quality:U=k5,params:H={},lazy:j=!0,priority:B=!1,loading:V=B?"eager":G9,decoding:_=Q9,fetchpriority:L,objectFit:F,objectPosition:O,crossorigin:w,referrerpolicy:R}=$,D=$.class,N=$.style,I=$.data||{},M=typeof K==="object"?M5(K):K||"100vw",T=[];for(let E of W){let C=O2(Y,q,{...H,q:U},E),b=A5(E);if(j&&!B)T.push(` <source type="${b}" data-srcset="${C}" data-sizes="${M}" />`);else T.push(` <source type="${b}" srcset="${C}" sizes="${M}" />`)}let k=E5({src:G1(Y,{...H,q:U}),alt:Q,width:G,height:z,loading:B?void 0:V,decoding:_,fetchpriority:B?"high":L,objectFit:F,objectPosition:O,crossorigin:w,referrerpolicy:R,className:v4(D,J),style:y5(N,F,O,J),lazy:j&&!B,data:I}),A;if(J){let E=`background-image: url('${J.dataURL}'); background-size: cover; background-position: center;`;A=`<div id="${Z}" class="stx-img-placeholder" style="${E}">
1754
1754
  <picture>
1755
1755
  ${T.join(`
@@ -1799,7 +1799,7 @@ ${T.join(`
1799
1799
 
1800
1800
  observer.observe(container);
1801
1801
  })();
1802
- `.trim()}function eX($){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,K,q,W]=Q,U=K??q??W??!0;if(G===":"&&typeof U==="string")try{X[z]=JSON.parse(U)}catch{X[z]=U}else switch(z){case"src":X.src=String(U);break;case"alt":X.alt=String(U);break;case"width":X.width=Number(U)||U;break;case"height":X.height=Number(U)||U;break;case"sizes":X.sizes=String(U);break;case"quality":X.quality=Number(U);break;case"placeholder":X.placeholder=U;break;case"lazy":X.lazy=U===!0||U==="true";break;case"priority":X.priority=U===!0||U==="true";break;case"class":X.class=String(U);break;case"style":X.style=String(U);break;case"id":X.id=String(U);break;case"loading":X.loading=U;break;case"decoding":X.decoding=U;break;case"fetchpriority":X.fetchpriority=U;break;case"objectFit":X.objectFit=U;break;case"objectPosition":X.objectPosition=String(U);break;case"crossorigin":X.crossorigin=U;break}}if(!X.src||!X.alt)return null;return X}async function TU($,Z={}){let J=/<Img\s+[^>]*?\/?>/g,X=[],Y=[],Q=[],G=$,z=[],K;while((K=J.exec($))!==null)z.push({match:K[0],index:K.index});for(let q=z.length-1;q>=0;q--){let{match:W}=z[q],U=eX(W);if(U){let H=await F2(U,Z);if(G=G.replace(W,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 $Y($,Z){let J=await oX();if(!J)return F2({...$,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 f4($,Q,Z)}else{let Q=await J.processImage($.src,$,X);if(Q.processed)return b5($,Q,Z)}return F2({...$,process:!1},Z)}async function b5($,Z,J){let{alt:X,width:Y,height:Q,lazy:G=!0,priority:z=!1,objectFit:K,objectPosition:q,crossorigin:W,referrerpolicy:U}=$,H=$.class,j=$.style,B=$.id||`stx-img-${Math.random().toString(36).slice(2,8)}`,V=$.data||{},_=Z.variants||[],L=_.find((y)=>y.format==="jpeg")||_.find((y)=>y.format==="webp")||_[0],F=L?.url||$.src,O=_.filter((y)=>y.format===(L?.format||"jpeg")).map((y)=>`${y.url} ${y.width}w`).join(", "),w=new Map;for(let y of _){if(!w.has(y.format))w.set(y.format,[]);w.get(y.format).push(y)}let R=[],D=["avif","webp","jpeg","png"];for(let y of D){let P=w.get(y);if(P&&P.length>0){let u=P.map((m)=>`${m.url} ${m.width}w`).join(", "),p=A5(y);if(G&&!z)R.push(` <source type="${p}" data-srcset="${u}" />`);else R.push(` <source type="${p}" srcset="${u}" />`)}}let N=[];if(G&&!z){if(N.push(`data-src="${d0(F)}"`),N.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"'),O)N.push(`data-srcset="${O}"`)}else if(N.push(`src="${d0(F)}"`),O)N.push(`srcset="${O}"`);N.push(`alt="${d0(X)}"`);let I=Y||Z.originalWidth,M=Q||Z.originalHeight;if(I)N.push(`width="${I}"`);if(M)N.push(`height="${M}"`);if(!z)N.push(`loading="${G?"lazy":"eager"}"`);if(N.push('decoding="async"'),z)N.push('fetchpriority="high"');if(W)N.push(`crossorigin="${W}"`);if(U)N.push(`referrerpolicy="${U}"`);let T=[];if(K)T.push(`object-fit: ${K}`);if(q)T.push(`object-position: ${q}`);if(Z.placeholder&&G)T.push("opacity: 0; transition: opacity 300ms ease-out");if(j)T.push(j);if(T.length>0)N.push(`style="${T.join("; ")}"`);let k=[];if(H)k.push(H);if(Z.placeholder)k.push("stx-img-blur");if(k.length>0)N.push(`class="${k.join(" ")}"`);if(G&&!z)N.push("data-stx-lazy");for(let[y,P]of Object.entries(V))N.push(`data-${y}="${d0(P)}"`);let A;if(Z.placeholder||Z.dominantColor&&$.useDominantColor){let y=Z.placeholder?`background-image: url('${Z.placeholder}'); background-size: cover; background-position: center;`:`background-color: ${Z.dominantColor};`;A=`<div id="${B}" class="stx-img-placeholder" style="${y}">
1802
+ `.trim()}function eX($){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,K,q,W]=Q,U=K??q??W??!0;if(G===":"&&typeof U==="string")try{X[z]=JSON.parse(U)}catch{X[z]=U}else switch(z){case"src":X.src=String(U);break;case"alt":X.alt=String(U);break;case"width":X.width=Number(U)||U;break;case"height":X.height=Number(U)||U;break;case"sizes":X.sizes=String(U);break;case"quality":X.quality=Number(U);break;case"placeholder":X.placeholder=U;break;case"lazy":X.lazy=U===!0||U==="true";break;case"priority":X.priority=U===!0||U==="true";break;case"class":X.class=String(U);break;case"style":X.style=String(U);break;case"id":X.id=String(U);break;case"loading":X.loading=U;break;case"decoding":X.decoding=U;break;case"fetchpriority":X.fetchpriority=U;break;case"objectFit":X.objectFit=U;break;case"objectPosition":X.objectPosition=String(U);break;case"crossorigin":X.crossorigin=U;break}}if(!X.src||!X.alt)return null;return X}async function kU($,Z={}){let J=/<Img\s+[^>]*?\/?>/g,X=[],Y=[],Q=[],G=$,z=[],K;while((K=J.exec($))!==null)z.push({match:K[0],index:K.index});for(let q=z.length-1;q>=0;q--){let{match:W}=z[q],U=eX(W);if(U){let H=await F2(U,Z);if(G=G.replace(W,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 $Y($,Z){let J=await oX();if(!J)return F2({...$,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 f4($,Q,Z)}else{let Q=await J.processImage($.src,$,X);if(Q.processed)return b5($,Q,Z)}return F2({...$,process:!1},Z)}async function b5($,Z,J){let{alt:X,width:Y,height:Q,lazy:G=!0,priority:z=!1,objectFit:K,objectPosition:q,crossorigin:W,referrerpolicy:U}=$,H=$.class,j=$.style,B=$.id||`stx-img-${Math.random().toString(36).slice(2,8)}`,V=$.data||{},_=Z.variants||[],L=_.find((y)=>y.format==="jpeg")||_.find((y)=>y.format==="webp")||_[0],F=L?.url||$.src,O=_.filter((y)=>y.format===(L?.format||"jpeg")).map((y)=>`${y.url} ${y.width}w`).join(", "),w=new Map;for(let y of _){if(!w.has(y.format))w.set(y.format,[]);w.get(y.format).push(y)}let R=[],D=["avif","webp","jpeg","png"];for(let y of D){let P=w.get(y);if(P&&P.length>0){let u=P.map((m)=>`${m.url} ${m.width}w`).join(", "),p=A5(y);if(G&&!z)R.push(` <source type="${p}" data-srcset="${u}" />`);else R.push(` <source type="${p}" srcset="${u}" />`)}}let N=[];if(G&&!z){if(N.push(`data-src="${d0(F)}"`),N.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"'),O)N.push(`data-srcset="${O}"`)}else if(N.push(`src="${d0(F)}"`),O)N.push(`srcset="${O}"`);N.push(`alt="${d0(X)}"`);let I=Y||Z.originalWidth,M=Q||Z.originalHeight;if(I)N.push(`width="${I}"`);if(M)N.push(`height="${M}"`);if(!z)N.push(`loading="${G?"lazy":"eager"}"`);if(N.push('decoding="async"'),z)N.push('fetchpriority="high"');if(W)N.push(`crossorigin="${W}"`);if(U)N.push(`referrerpolicy="${U}"`);let T=[];if(K)T.push(`object-fit: ${K}`);if(q)T.push(`object-position: ${q}`);if(Z.placeholder&&G)T.push("opacity: 0; transition: opacity 300ms ease-out");if(j)T.push(j);if(T.length>0)N.push(`style="${T.join("; ")}"`);let k=[];if(H)k.push(H);if(Z.placeholder)k.push("stx-img-blur");if(k.length>0)N.push(`class="${k.join(" ")}"`);if(G&&!z)N.push("data-stx-lazy");for(let[y,P]of Object.entries(V))N.push(`data-${y}="${d0(P)}"`);let A;if(Z.placeholder||Z.dominantColor&&$.useDominantColor){let y=Z.placeholder?`background-image: url('${Z.placeholder}'); background-size: cover; background-position: center;`:`background-color: ${Z.dominantColor};`;A=`<div id="${B}" class="stx-img-placeholder" style="${y}">
1803
1803
  <picture>
1804
1804
  ${R.join(`
1805
1805
  `)}
@@ -1813,7 +1813,7 @@ ${R.join(`
1813
1813
  `):void 0,script:C}}async function f4($,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 b5($,X,J)}function ZY(){return z9({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}=JY($,Z,J);if(!Y)return console.warn("@img directive: missing src argument"),"<!-- @img: missing src -->";let z={src:Y,alt:Q||"",widths:G.widths||_1,formats:G.formats||f1,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},K=J.__isDev||!1,q=await F2(z,{isDev:K}),W=q.html;if(q.preloadLink)W=q.preloadLink+`
1814
1814
  `+W;if(q.css)W+=`
1815
1815
  <style>${q.css}</style>`;if(q.script)W+=`
1816
- <script>${q.script}</script>`;return W},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function JY($,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=XY(X),Q=S5(Y[0],J)||"",G=S5(Y[1],J)||"",z={};if(Y[2]){let K=S5(Y[2],J);if(typeof K==="object"&&K!==null)z=K;else if(typeof Y[2]==="string")try{z=JSON.parse(Y[2])}catch{}}return{src:Q,alt:G,options:z}}function XY($){let Z=[],J="",X=!1,Y="",Q=0,G=0;for(let z=0;z<$.length;z++){let K=$[z],q=z>0?$[z-1]:"";if((K==='"'||K==="'"||K==="`")&&q!=="\\"){if(!X)X=!0,Y=K;else if(K===Y)X=!1,Y="";else J+=K;continue}if(!X){if(K==="{")Q++;if(K==="}")Q--;if(K==="[")G++;if(K==="]")G--;if(K===","&&Q===0&&G===0){Z.push(J.trim()),J="";continue}}J+=K}if(J.trim())Z.push(J.trim());return Z}function S5($,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 g4=ZY();async function u4(){try{return await import("./chunk-bdy1fpqq.js")}catch($){if(!h4)console.warn("[stx-media] Video processor not available, some features disabled:",$),h4=!0;return null}}var h4=!1,m4=!0,d4="metadata",YY="https://cdn.jsdelivr.net/npm/ts-video-player@latest/dist/index.min.js";async function K9($,Z={}){let J=Z,X=$;if(X.process&&!X.skipProcessing){if(J.tsVideosConfig?.enabled&&!J.isDev)return qY(X,J)}if(J.processedResult?.processed)return c4($,J.processedResult,Z);let Y;if(X.generatePoster&&X.src&&!$.poster)Y=await WY(X,J);let{src:Q,sources:G=[],poster:z,posterPlaceholder:K,controls:q=m4,autoplay:W=!1,muted:U=!1,loop:H=!1,preload:j=d4,playsinline:B=!0,lazy:V=!0,player:_="native",type:L,width:F,height:O,crossorigin:w,disablePictureInPicture:R=!1,disableRemotePlayback:D=!1}=$,N=Y||z,I=$.class,M=$.style,T=$.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(_==="ts-video")return GY($,Z);if(L&&L!=="video")return QY(Q||"",L,$);let k=G.length>0?G:Q?[{src:Q,type:l4(Q)}]:[],A=[`id="${T}"`];if(q)A.push("controls");if(W)A.push("autoplay");if(U)A.push("muted");if(H)A.push("loop");if(B)A.push("playsinline");if(R)A.push("disablepictureinpicture");if(D)A.push("disableremoteplayback");if(w)A.push(`crossorigin="${w}"`);if(V){if(A.push(`data-preload="${j}"`),A.push('preload="none"'),N)A.push(`data-poster="${I0(N)}"`);A.push("data-stx-lazy")}else if(A.push(`preload="${j}"`),N)A.push(`poster="${I0(N)}"`);if(F)A.push(`width="${F}"`);if(O)A.push(`height="${O}"`);if(I)A.push(`class="${I0(I)}"`);if(M)A.push(`style="${I0(M)}"`);let E=k.map((y)=>{return` <source ${V?`data-src="${I0(y.src)}"`:`src="${I0(y.src)}"`} type="${y.type}"${y.media?` media="${y.media}"`:""} />`}).join(`
1816
+ <script>${q.script}</script>`;return W},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function JY($,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=XY(X),Q=S5(Y[0],J)||"",G=S5(Y[1],J)||"",z={};if(Y[2]){let K=S5(Y[2],J);if(typeof K==="object"&&K!==null)z=K;else if(typeof Y[2]==="string")try{z=JSON.parse(Y[2])}catch{}}return{src:Q,alt:G,options:z}}function XY($){let Z=[],J="",X=!1,Y="",Q=0,G=0;for(let z=0;z<$.length;z++){let K=$[z],q=z>0?$[z-1]:"";if((K==='"'||K==="'"||K==="`")&&q!=="\\"){if(!X)X=!0,Y=K;else if(K===Y)X=!1,Y="";else J+=K;continue}if(!X){if(K==="{")Q++;if(K==="}")Q--;if(K==="[")G++;if(K==="]")G--;if(K===","&&Q===0&&G===0){Z.push(J.trim()),J="";continue}}J+=K}if(J.trim())Z.push(J.trim());return Z}function S5($,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 g4=ZY();async function u4(){try{return await import("./chunk-dj658wyq.js")}catch($){if(!h4)console.warn("[stx-media] Video processor not available, some features disabled:",$),h4=!0;return null}}var h4=!1,m4=!0,d4="metadata",YY="https://cdn.jsdelivr.net/npm/ts-video-player@latest/dist/index.min.js";async function K9($,Z={}){let J=Z,X=$;if(X.process&&!X.skipProcessing){if(J.tsVideosConfig?.enabled&&!J.isDev)return qY(X,J)}if(J.processedResult?.processed)return c4($,J.processedResult,Z);let Y;if(X.generatePoster&&X.src&&!$.poster)Y=await WY(X,J);let{src:Q,sources:G=[],poster:z,posterPlaceholder:K,controls:q=m4,autoplay:W=!1,muted:U=!1,loop:H=!1,preload:j=d4,playsinline:B=!0,lazy:V=!0,player:_="native",type:L,width:F,height:O,crossorigin:w,disablePictureInPicture:R=!1,disableRemotePlayback:D=!1}=$,N=Y||z,I=$.class,M=$.style,T=$.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(_==="ts-video")return GY($,Z);if(L&&L!=="video")return QY(Q||"",L,$);let k=G.length>0?G:Q?[{src:Q,type:l4(Q)}]:[],A=[`id="${T}"`];if(q)A.push("controls");if(W)A.push("autoplay");if(U)A.push("muted");if(H)A.push("loop");if(B)A.push("playsinline");if(R)A.push("disablepictureinpicture");if(D)A.push("disableremoteplayback");if(w)A.push(`crossorigin="${w}"`);if(V){if(A.push(`data-preload="${j}"`),A.push('preload="none"'),N)A.push(`data-poster="${I0(N)}"`);A.push("data-stx-lazy")}else if(A.push(`preload="${j}"`),N)A.push(`poster="${I0(N)}"`);if(F)A.push(`width="${F}"`);if(O)A.push(`height="${O}"`);if(I)A.push(`class="${I0(I)}"`);if(M)A.push(`style="${I0(M)}"`);let E=k.map((y)=>{return` <source ${V?`data-src="${I0(y.src)}"`:`src="${I0(y.src)}"`} type="${y.type}"${y.media?` media="${y.media}"`:""} />`}).join(`
1817
1817
  `),C=`<video ${A.join(" ")}>
1818
1818
  ${E}
1819
1819
  Your browser does not support the video tag.
@@ -2021,7 +2021,7 @@ else {
2021
2021
  .ts-video-player__play-button svg {
2022
2022
  margin-left: 4px;
2023
2023
  }
2024
- `.trim();return{html:O,script:w,css:R}}function l4($){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 zY($){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 KY($){let Z=$.match(/vimeo\.com\/(\d+)/);return Z?Z[1]:null}function I0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function CU($,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 qY($,Z){let J=await u4();if(!J)return K9({...$,process:!1},Z);let X=Z.tsVideosConfig,Y=await J.processVideo($.src,$,X,$.onProcessProgress);if(Y.processed)return c4($,Y,Z);return K9({...$,process:!1},Z)}async function WY($,Z){let J=await u4();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 c4($,Z,J){let{controls:X=m4,autoplay:Y=!1,muted:Q=!1,loop:G=!1,preload:z=d4,playsinline:K=!0,lazy:q=!0,width:W,height:U,crossorigin:H,disablePictureInPicture:j=!1,disableRemotePlayback:B=!1}=$,V=$.class,_=$.style,L=$.id||`stx-video-${Math.random().toString(36).slice(2,8)}`,F=$.src,O=l4(F);if(Z.transcoded)F=Z.transcoded.url,O="video/mp4";let w=Z.streaming?.hls||Z.streaming?.dash;if(w){if(Z.streaming?.hls)F=Z.streaming.hls.manifestUrl,O="application/x-mpegURL";else if(Z.streaming?.dash)F=Z.streaming.dash.manifestUrl,O="application/dash+xml"}let R=Z.poster?.url||$.poster,D=[`id="${L}"`];if(X)D.push("controls");if(Y)D.push("autoplay");if(Q)D.push("muted");if(G)D.push("loop");if(K)D.push("playsinline");if(j)D.push("disablepictureinpicture");if(B)D.push("disableremoteplayback");if(H)D.push(`crossorigin="${H}"`);if(q){if(D.push(`data-preload="${z}"`),D.push('preload="none"'),R)D.push(`data-poster="${I0(R)}"`);D.push("data-stx-lazy")}else if(D.push(`preload="${z}"`),R)D.push(`poster="${I0(R)}"`);let N=W||Z.metadata?.width,I=U||Z.metadata?.height;if(N)D.push(`width="${N}"`);if(I)D.push(`height="${I}"`);if(V)D.push(`class="${I0(V)}"`);if(_)D.push(`style="${I0(_)}"`);let T=` <source ${q?`data-src="${I0(F)}"`:`src="${I0(F)}"`} type="${O}" />`,k=`<video ${D.join(" ")}>
2024
+ `.trim();return{html:O,script:w,css:R}}function l4($){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 zY($){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 KY($){let Z=$.match(/vimeo\.com\/(\d+)/);return Z?Z[1]:null}function I0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function PU($,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 qY($,Z){let J=await u4();if(!J)return K9({...$,process:!1},Z);let X=Z.tsVideosConfig,Y=await J.processVideo($.src,$,X,$.onProcessProgress);if(Y.processed)return c4($,Y,Z);return K9({...$,process:!1},Z)}async function WY($,Z){let J=await u4();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 c4($,Z,J){let{controls:X=m4,autoplay:Y=!1,muted:Q=!1,loop:G=!1,preload:z=d4,playsinline:K=!0,lazy:q=!0,width:W,height:U,crossorigin:H,disablePictureInPicture:j=!1,disableRemotePlayback:B=!1}=$,V=$.class,_=$.style,L=$.id||`stx-video-${Math.random().toString(36).slice(2,8)}`,F=$.src,O=l4(F);if(Z.transcoded)F=Z.transcoded.url,O="video/mp4";let w=Z.streaming?.hls||Z.streaming?.dash;if(w){if(Z.streaming?.hls)F=Z.streaming.hls.manifestUrl,O="application/x-mpegURL";else if(Z.streaming?.dash)F=Z.streaming.dash.manifestUrl,O="application/dash+xml"}let R=Z.poster?.url||$.poster,D=[`id="${L}"`];if(X)D.push("controls");if(Y)D.push("autoplay");if(Q)D.push("muted");if(G)D.push("loop");if(K)D.push("playsinline");if(j)D.push("disablepictureinpicture");if(B)D.push("disableremoteplayback");if(H)D.push(`crossorigin="${H}"`);if(q){if(D.push(`data-preload="${z}"`),D.push('preload="none"'),R)D.push(`data-poster="${I0(R)}"`);D.push("data-stx-lazy")}else if(D.push(`preload="${z}"`),R)D.push(`poster="${I0(R)}"`);let N=W||Z.metadata?.width,I=U||Z.metadata?.height;if(N)D.push(`width="${N}"`);if(I)D.push(`height="${I}"`);if(V)D.push(`class="${I0(V)}"`);if(_)D.push(`style="${I0(_)}"`);let T=` <source ${q?`data-src="${I0(F)}"`:`src="${I0(F)}"`} type="${O}" />`,k=`<video ${D.join(" ")}>
2025
2025
  ${T}
2026
2026
  Your browser does not support the video tag.
2027
2027
  </video>`;if(Z.spriteSheet)k=`<div class="stx-video-wrapper" data-sprite-sheet="${I0(Z.spriteSheet.url)}" data-sprite-cols="${Z.spriteSheet.columns}" data-sprite-interval="${Z.spriteSheet.interval}">
@@ -2072,7 +2072,7 @@ ${k}
2072
2072
  }
2073
2073
  `.trim();return{html:k,script:A,css:E}}function p4(){return z9({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}=UY($,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},K={isDev:J.__isDev||!1,tsVideosConfig:J.__tsVideosConfig},q=await K9(G,K),W=q.html;if(q.css)W+=`
2074
2074
  <style>${q.css}</style>`;if(q.script)W+=`
2075
- <script>${q.script}</script>`;return W},defaults:{src:"",options:{controls:!0,lazy:!0,preload:"metadata"}}})}function UY($,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=HY(X),Q=i4(Y[0],J)||"",G={};if(Y[1]){let z=i4(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 HY($){let Z=[],J="",X=!1,Y="",Q=0,G=0;for(let z=0;z<$.length;z++){let K=$[z],q=z>0?$[z-1]:"";if((K==='"'||K==="'"||K==="`")&&q!=="\\"){if(!X)X=!0,Y=K;else if(K===Y)X=!1,Y="";else J+=K;continue}if(!X){if(K==="{")Q++;if(K==="}")Q--;if(K==="[")G++;if(K==="]")G--;if(K===","&&Q===0&&G===0){Z.push(J.trim()),J="";continue}}J+=K}if(J.trim())Z.push(J.trim());return Z}function i4($,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 C5=p4();import jY from"fs";import g0 from"path";async function lU($,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 BY(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 BY($,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 $0(Y))z=Y;else if(Z.componentsDir){let V=g0.join(Z.componentsDir,Y);if(await $0(V))z=V}if(!z)z=await q9(Y,process.cwd(),Z,J);if(!z)return console.error(`Web component source file not found: ${Y}`),null;let K=await Bun.file(z).text();J.add(z);let W=($.outputFormat||"js")==="ts",U=W?LY({name:X,tag:Q,baseElement:G,source:K,shadowDOM:$.shadowDOM??!0,template:$.template??!0,styleSource:$.styleSource,attributes:$.attributes||[],attributeTypes:$.attributeTypes||{}}):VY({name:X,tag:Q,baseElement:G,source:K,shadowDOM:$.shadowDOM??!0,template:$.template??!0,styleSource:$.styleSource,attributes:$.attributes||[]}),H=Z.webComponents?.outputDir||"dist/web-components";await jY.promises.mkdir(H,{recursive:!0});let j=W?"ts":"js",B=g0.join(H,`${Q}.${j}`);if(await Bun.write(B,U),Z.debug)console.log(`Built web component ${X} -> ${B}`);return B}function VY($){let{name:Z,tag:J,baseElement:X="HTMLElement",source:Y,shadowDOM:Q,template:G,styleSource:z,attributes:K=[]}=$,q=Y.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!Q)q=q.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),q=q.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),q=q.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),q=q.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");let W="";if(z)W=`<link rel="stylesheet" href="${z}">`;return`/**
2075
+ <script>${q.script}</script>`;return W},defaults:{src:"",options:{controls:!0,lazy:!0,preload:"metadata"}}})}function UY($,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=HY(X),Q=i4(Y[0],J)||"",G={};if(Y[1]){let z=i4(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 HY($){let Z=[],J="",X=!1,Y="",Q=0,G=0;for(let z=0;z<$.length;z++){let K=$[z],q=z>0?$[z-1]:"";if((K==='"'||K==="'"||K==="`")&&q!=="\\"){if(!X)X=!0,Y=K;else if(K===Y)X=!1,Y="";else J+=K;continue}if(!X){if(K==="{")Q++;if(K==="}")Q--;if(K==="[")G++;if(K==="]")G--;if(K===","&&Q===0&&G===0){Z.push(J.trim()),J="";continue}}J+=K}if(J.trim())Z.push(J.trim());return Z}function i4($,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 C5=p4();import jY from"fs";import g0 from"path";async function cU($,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 BY(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 BY($,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 $0(Y))z=Y;else if(Z.componentsDir){let V=g0.join(Z.componentsDir,Y);if(await $0(V))z=V}if(!z)z=await q9(Y,process.cwd(),Z,J);if(!z)return console.error(`Web component source file not found: ${Y}`),null;let K=await Bun.file(z).text();J.add(z);let W=($.outputFormat||"js")==="ts",U=W?LY({name:X,tag:Q,baseElement:G,source:K,shadowDOM:$.shadowDOM??!0,template:$.template??!0,styleSource:$.styleSource,attributes:$.attributes||[],attributeTypes:$.attributeTypes||{}}):VY({name:X,tag:Q,baseElement:G,source:K,shadowDOM:$.shadowDOM??!0,template:$.template??!0,styleSource:$.styleSource,attributes:$.attributes||[]}),H=Z.webComponents?.outputDir||"dist/web-components";await jY.promises.mkdir(H,{recursive:!0});let j=W?"ts":"js",B=g0.join(H,`${Q}.${j}`);if(await Bun.write(B,U),Z.debug)console.log(`Built web component ${X} -> ${B}`);return B}function VY($){let{name:Z,tag:J,baseElement:X="HTMLElement",source:Y,shadowDOM:Q,template:G,styleSource:z,attributes:K=[]}=$,q=Y.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!Q)q=q.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),q=q.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),q=q.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),q=q.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");let W="";if(z)W=`<link rel="stylesheet" href="${z}">`;return`/**
2076
2076
  * ${Z} Web Component
2077
2077
  * Auto-generated from stx component
2078
2078
  */
@@ -2319,9 +2319,9 @@ declare global {
2319
2319
 
2320
2320
  // Register the web component
2321
2321
  customElements.define('${J}', ${W});
2322
- `}var P5={strategy:"attribute",attributeName:"data-v",preserveOriginal:!0};function v5($){let Z=$.split("").reduce((J,X)=>(J<<5)-J+X.charCodeAt(0)|0,0);return Math.abs(Z).toString(36).slice(0,8)}function _Y($,Z,J={}){let X={...P5,...J},Y=v5(Z);switch(X.strategy){case"shadow":return $;case"prefix":return FY($,X.prefix||Z,X.preserveOriginal);case"attribute":return OY($,Y,X.attributeName||"data-v",X.preserveOriginal);case"bem":return wY($,Z,X.preserveOriginal);default:return $}}function OY($,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 FY($,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 wY($,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 RY($,Z,J={}){let X={...P5,...J};if(X.strategy==="shadow")return $;if(X.strategy==="attribute"){let Y=v5(Z),G=`${X.attributeName||"data-v"}-${Y}`;return $.replace(/<([a-z][a-z0-9-]*)([^>]*)>/gi,(z,K,q)=>{if(/^(?:script|style|!--)$/i.test(K))return z;let W=q.trimEnd().endsWith("/"),U=W?q.slice(0,-1):q;return`<${K}${U} ${G}${W?"/":""}>`})}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((K)=>{if(!K)return K;if(K.startsWith(Y))return K;return`${Y}__${K}`}).join(" ")}"`})}return $}function cU($,Z={}){let J={...P5,...Z},X=v5($);return`${J.attributeName||"data-v"}-${X}`}function pU($,Z,J={}){let X="",Y=$.replace(/<style([^>]*)>([\s\S]*?)<\/style>/gi,(G,z,K)=>{if(/\bscoped\b/i.test(z)||J.strategy!=="shadow")X+=`${_Y(K,Z,J)}
2322
+ `}var P5={strategy:"attribute",attributeName:"data-v",preserveOriginal:!0};function v5($){let Z=$.split("").reduce((J,X)=>(J<<5)-J+X.charCodeAt(0)|0,0);return Math.abs(Z).toString(36).slice(0,8)}function _Y($,Z,J={}){let X={...P5,...J},Y=v5(Z);switch(X.strategy){case"shadow":return $;case"prefix":return FY($,X.prefix||Z,X.preserveOriginal);case"attribute":return OY($,Y,X.attributeName||"data-v",X.preserveOriginal);case"bem":return wY($,Z,X.preserveOriginal);default:return $}}function OY($,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 FY($,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 wY($,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 RY($,Z,J={}){let X={...P5,...J};if(X.strategy==="shadow")return $;if(X.strategy==="attribute"){let Y=v5(Z),G=`${X.attributeName||"data-v"}-${Y}`;return $.replace(/<([a-z][a-z0-9-]*)([^>]*)>/gi,(z,K,q)=>{if(/^(?:script|style|!--)$/i.test(K))return z;let W=q.trimEnd().endsWith("/"),U=W?q.slice(0,-1):q;return`<${K}${U} ${G}${W?"/":""}>`})}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((K)=>{if(!K)return K;if(K.startsWith(Y))return K;return`${Y}__${K}`}).join(" ")}"`})}return $}function pU($,Z={}){let J={...P5,...Z},X=v5($);return`${J.attributeName||"data-v"}-${X}`}function iU($,Z,J={}){let X="",Y=$.replace(/<style([^>]*)>([\s\S]*?)<\/style>/gi,(G,z,K)=>{if(/\bscoped\b/i.test(z)||J.strategy!=="shadow")X+=`${_Y(K,Z,J)}
2323
2323
  `;else X+=`${K}
2324
- `;return""});return{html:RY(Y,Z,J),css:X.trim()}}function h1($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function iU($){let{name:Z,tag:J,baseElement:X="HTMLElement",template:Y,styles:Q="",shadowDOM:G=!0,properties:z={},lifecycle:K={},events:q={},methods:W={},state:U={}}=$,H=Z.replace(/\W/g,""),j=Object.keys(z),B=j.filter((I)=>z[I].attribute!==!1).map((I)=>z[I].attribute||h1(I)),V=j.map((I)=>{let M=z[I],T=M.default!==void 0?JSON.stringify(M.default):M.type==="string"?'""':M.type==="number"?"0":M.type==="boolean"?"false":M.type==="array"?"[]":"{}";return` this._${I} = ${T};`}).join(`
2324
+ `;return""});return{html:RY(Y,Z,J),css:X.trim()}}function h1($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function nU($){let{name:Z,tag:J,baseElement:X="HTMLElement",template:Y,styles:Q="",shadowDOM:G=!0,properties:z={},lifecycle:K={},events:q={},methods:W={},state:U={}}=$,H=Z.replace(/\W/g,""),j=Object.keys(z),B=j.filter((I)=>z[I].attribute!==!1).map((I)=>z[I].attribute||h1(I)),V=j.map((I)=>{let M=z[I],T=M.default!==void 0?JSON.stringify(M.default):M.type==="string"?'""':M.type==="number"?"0":M.type==="boolean"?"false":M.type==="array"?"[]":"{}";return` this._${I} = ${T};`}).join(`
2325
2325
  `),_=j.map((I)=>{let M=z[I],T=M.attribute!==!1?M.attribute||h1(I):null,k=M.reflect&&T?`
2326
2326
  if (value !== null && value !== undefined) {
2327
2327
  ${M.type==="boolean"?`if (value) { this.setAttribute('${T}', ''); }
@@ -2523,7 +2523,7 @@ customElements.define('${J}', ${H});
2523
2523
  // Export for module usage
2524
2524
  export { ${H} };
2525
2525
  export default ${H};
2526
- `}function nU($){let{name:Z,tag:J,baseElement:X="HTMLElement",template:Y,styles:Q="",shadowDOM:G=!0,properties:z={},lifecycle:K={},events:q={},methods:W={},state:U={}}=$,H=Z.replace(/\W/g,""),j=Object.keys(z),B=j.filter((M)=>z[M].attribute!==!1).map((M)=>z[M].attribute||h1(M)),V=(M)=>{switch(M){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"}},_=j.length>0?`
2526
+ `}function sU($){let{name:Z,tag:J,baseElement:X="HTMLElement",template:Y,styles:Q="",shadowDOM:G=!0,properties:z={},lifecycle:K={},events:q={},methods:W={},state:U={}}=$,H=Z.replace(/\W/g,""),j=Object.keys(z),B=j.filter((M)=>z[M].attribute!==!1).map((M)=>z[M].attribute||h1(M)),V=(M)=>{switch(M){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"}},_=j.length>0?`
2527
2527
  /**
2528
2528
  * Props interface for ${Z}
2529
2529
  */
@@ -2775,7 +2775,7 @@ declare global {
2775
2775
  customElements.define('${J}', ${H});
2776
2776
 
2777
2777
  export default ${H};
2778
- `}function sU(){return`/**
2778
+ `}function oU(){return`/**
2779
2779
  * ReactiveElement Mixin
2780
2780
  * Adds reactive properties and lifecycle management to web components
2781
2781
  */
@@ -2897,7 +2897,7 @@ else {
2897
2897
 
2898
2898
  export { ReactiveElement };
2899
2899
  export default ReactiveElement;
2900
- `}function oU(){return`/**
2900
+ `}function rU(){return`/**
2901
2901
  * stx Reactive Web Components Runtime
2902
2902
  * Provides base classes and utilities for reactive web components
2903
2903
  */
@@ -3167,10 +3167,10 @@ ${W}
3167
3167
  customElements.define('${Z}', ${G});
3168
3168
  `}async function n4($,Z,J,X){if(Z.length<1)return R0("WebComponent","@webcomponent directive requires at least the tag name parameter",w0.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`)],K=null;for(let U of z)if(await $0(U)){K=await Bun.file(U).text();break}if(!K)return R0("WebComponent",`Component file not found: ${Y}.stx`,w0.FILE_NOT_FOUND);let q=DY(K,Y);return`<script type="module">
3169
3169
  ${NY(q)}
3170
- </script>`}var x5={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:a4,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:I4,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:n4,hasEndTag:!1,description:"Include a web component in the template"},o4,r4,J7,X7,L5,O5,F5,_5,D4,U4,g4,C5,...Y7],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function AY($,Z,J){let X=Z||"pages";if($)return{root:$,pagesDir:X};let Y=J||process.cwd(),Q=C0.join(Y,"resources","views"),G=C0.join(Y,"resources","layouts");if(j9.existsSync(Q)&&j9.existsSync(G))return{root:"resources",pagesDir:"views"};let z=C0.join(Y,"resources","views","pages");if(j9.existsSync(z))return{root:"resources/views",pagesDir:X};return{root:".",pagesDir:X}}var s4=new Set,B9=["partialsDir","componentsDir","layoutsDir"],f5=new WeakMap;function IY($,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 TY($,Z){let J=!$.root,X=AY($.root,$.pagesDir,Z);if($.root=X.root,$.pagesDir=X.pagesDir,J&&X.root!=="."){let Y=`${Z}::${X.root}`;if(!s4.has(Y))s4.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(!f5.has($)){let Y={};for(let Q of B9){let G=$[Q];if(typeof G==="string"&&G)Y[Q]=G}f5.set($,Y)}if($.root&&$.root!=="."){let Y=$.root;for(let Q of B9){let G=$[Q];if(typeof G!=="string"||!G)continue;if(C0.isAbsolute(G)||IY(G,Y))continue;$[Q]=C0.join(Y,G)}}for(let Y of B9){let Q=$[Y];if(typeof Q!=="string"||!Q||C0.isAbsolute(Q))continue;$[Y]=C0.resolve(Z,Q)}return $}function kY($,Z){let J=f5.get($);for(let X of B9){let Y=$[X];if(typeof Y!=="string"||!Y)continue;let Q=C0.isAbsolute(Y)?Y:C0.join(Z,Y);if(j9.existsSync(Q))continue;let G=J?.[X]??Y,z=$.root,K=!!z&&z!==".";console.warn(`[stx] ${String(X)} resolves to "${Q}", which does not exist. Configured as "${G}"`+(K?`, resolved under root "${z}".`:"."))}}function EY($){if($.customDirectives)$.customDirectives=[...$.customDirectives];if($.middleware)$.middleware=[...$.middleware];if($.apiRoutes)$.apiRoutes={...$.apiRoutes}}function yY($){if(t4($.stateDir),$.stateDir=e4(),$.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 z1=null,O1=new Map,W9=new Map,R2=null;async function g5($){let Z=$?C0.resolve($):process.cwd(),J=W9.get(Z);if(J&&J.signature!==U9(J.graph)){let Q=O1.get(Z);if(O1.delete(Z),W9.delete(Z),!$)z1=null,R2=null;let{clearComponentCache:G}=await import("./chunk-s35w8xjx.js"),{partialsCache:z}=await import("./chunk-t3pfdz1r.js");if(G(),z.clear(),Q&&J.configSignature===H9(J.graph)){let K=Q.then(async(q)=>{let W={...J.graph};await Z7(W,Z),W9.set(Z,{graph:W,signature:U9(W),configSignature:H9(W)});let U={...q,_layerGraph:W};if(!$)z1=U;return U});return O1.set(Z,K),K}}if(!$){if(z1)return z1;if(R2)return R2}let X=O1.get(Z);if(X)return X;let Y=(async()=>{let G=(await MY({name:"stx",alias:"ui",cwd:Z,defaultConfig:x5,verbose:!1})).config;if(G.extends!==void 0||J){let W=await $7(Z,x5);G=W.config,W9.set(Z,{graph:W.graph,signature:U9(W.graph),configSignature:H9(W.graph)})}if(G.runtimeConfig){let{resolveRuntimeConfig:W}=await import("./chunk-msecn1gm.js");W(G.runtimeConfig,{});let{generateRuntimeConfigTypes:U}=await import("./chunk-qmr1we72.js");await U(Z,G.runtimeConfig)}EY(G),yY(G),TY(G,Z),kY(G,Z);let z=[],K=new Set((G.plugins??[]).map((W)=>typeof W==="string"?W:W[0]));for(let W of G.componentPackages??["@stacksjs/components"]){let U=`${W}/stx-plugin`;if(K.has(U)||K.has(W))continue;try{x.resolve(U,{paths:[Z]}),z.push(U)}catch{}}let q=[...G.plugins??[],...z];if(q.length>0){let{pluginManager:W}=await import("./chunk-cvkty3ha.js"),U=[],H=[];for(let j of q){let B=typeof j==="string"?j:j[0],V=typeof j==="string"?{}:j[1]||{};try{let _,L;try{let O=x.resolve(B,{paths:[Z]});_=await import(O),L=C0.dirname(O)}catch{let O=C0.resolve(Z,B);_=await import(O),L=C0.dirname(O)}let F=_.default||_;if(!W.has(F.name))await W.register(F,G);if(F.components){let O=Array.isArray(F.components)?F.components:[F.components];for(let w of O)U.push(C0.resolve(L,w))}if(F.pages){let O=C0.resolve(L,F.pages),w=V.path||"/";H.push({dir:O,prefix:w})}if(F.setup){let O={addDirective:(w)=>{G.customDirectives=G.customDirectives||[],G.customDirectives.push(w)},addRoute:(w,R)=>{G.apiRoutes=G.apiRoutes||{},G.apiRoutes[w]=R},addMiddleware:(w)=>{G.middleware=G.middleware||[],G.middleware.push(w)},pluginDir:L,config:G};await F.setup(V,O)}console.log(`[stx] Plugin loaded: ${F.name||B}`)}catch(_){console.warn(`[stx] Failed to load plugin ${B}:`,_.message)}}G._pluginComponentDirs=U,G._pluginPageDirs=H}return G})();if(O1.set(Z,Y),Y.catch(()=>{if(O1.get(Z)===Y)O1.delete(Z)}),!$)R2=Y,Y.then((Q)=>{z1=Q}).catch(()=>{});return Y}var Q7=new Proxy(x5,{get($,Z){if(z1&&Z in z1)return z1[Z];if(!R2)g5().catch((J)=>{console.warn("[stx] Failed to load config file:",J?.message||J)});return $[Z]}});function HH($){return $}function jH($){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 u5=new Map;async function CY($,Z={}){try{if(!await $0($))throw Error(`Markdown file not found: ${$}`);let X=(await bY.promises.stat($)).mtime.getTime();if(Z.cache&&u5.has($)){let U=u5.get($);if(U.updatedAt>=X)return{content:U.content,data:U.data}}let Y=await Bun.file($).text(),{data:Q,content:G}=M4(Y),z=Z.markdown||Q7.markdown||{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}},q=_2(G,{gfm:!0});if(z.syntaxHighlighting?.enabled&&z.syntaxHighlighting?.serverSide)q=await PY(q,z.syntaxHighlighting?.defaultTheme||"github-dark",z.syntaxHighlighting?.highlightUnknownLanguages||!1);let W={content:q,data:Q||{}};if(Z.cache)u5.set($,{...W,updatedAt:X});return W}catch(J){if(Z.debug)console.error(`Error reading/parsing markdown file ${$}:`,J);let X=J instanceof Error?J.message:String(J);return{content:_0("Markdown File",`Error reading/parsing markdown file: ${X}`,$,"",0,""),data:{}}}}var V9=null;async function PY($,Z,J){let X=/<pre><code( class="language-([^"]+)")?>([^<]+)<\/code><\/pre>/g;if(!V9)try{V9=await SY({theme:Z||"github-dark",cache:!0})}catch(z){return console.error("Failed to initialize ts-syntax-highlighter:",z),$}let Y=async(z,K,q,W)=>{let U=W.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'"),H=q||(J?"text":"");if(!H)return z;try{if(!V9.getSupportedLanguages().includes(H))return z;return(await V9.highlight(U,H,{theme:Z})).html}catch(j){console.error(`Error highlighting code block with language ${q}:`,j)}return z},Q=$,G=$.matchAll(X);for(let z of G){let[K,q,W,U]=z,H=await Y(K,q,W,U);Q=Q.replace(K,H)}return Q}async function G7($,Z,J="",X={}){return await vY($,/@markdown-file\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\}))?\)/g,async(G,z,K,q)=>{try{let W=z;if(!h5.isAbsolute(z))W=h5.resolve(h5.dirname(J),z);let U={};if(K)try{try{U=JSON.parse(K)}catch{if(X.debug)console.warn("Using safer alternative for parsing JS object literal");let F=K.replace(/^\s*\{|\}\s*$/g,"").trim().split(/,(?=\s*\w+\s*:)/);for(let O of F){let w=O.indexOf(":");if(w>0){let R=O.substring(0,w).trim(),D=O.substring(w+1).trim(),N=D.startsWith('"')&&D.endsWith('"'),I=D.startsWith("'")&&D.endsWith("'");if(N||I)D=D.substring(1,D.length-1);U[R]=D}}}}catch(L){if(X.debug)console.error("Error parsing context in @markdown-file directive:",L)}let{content:H,data:j}=await CY(W,X),B={...Z,...j,...U},V=H,_=/\{\{([^}]+)\}\}/g;return V=V.replace(_,(L,F)=>{let O=F.trim();return B[O]!==void 0?String(B[O]):L}),V}catch(W){let U=W instanceof Error?W.message:String(W);return _0("Markdown File",`Error including markdown file: ${U}`,J,$,q,G)}})}async function vY($,Z,J){let X=[],Y;while((Y=Z.exec($))!==null){let z=Y[0],K=Y.index,q=Y;X.push(J(...q).then((W)=>({match:z,replacement:W,index:K})))}let Q=await Promise.all(X);Q.sort((z,K)=>K.index-z.index);let G=$;for(let{match:z,replacement:K}of Q)G=G.replace(z,()=>K);return G}function K1($,Z){try{let J=$.trim();if(B0(J))return H0(J,Object.keys(Z))(...Object.values(Z));else return Q0(J,Z)}catch{return!1}}function q1($,Z){let J=xY($,Z);return J.ok?{expression:J.expression,endPos:J.endPos}:null}function xY($,Z){let J=Z;while(J<$.length&&/\s/.test($[J]))J++;if($[J]!=="(")return{ok:!1,reason:"missing-open-paren",pos:J};let X=D0($,"(",")",J);if(X===-1)return{ok:!1,reason:"unclosed-paren",pos:J};return{ok:!0,expression:$.slice(J+1,X),endPos:X+1}}function fY($,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 K=G.exec($),q=z.exec($),W=K?K.index:1/0,U=q?q.index:1/0;if(W<U)Y++,Q=W+K[0].length;else if(U<1/0){if(Y--,Y===0)return U;Q=U+q[0].length}else break}return-1}function z7($,Z){let J=$.slice(Z).match(/^@if\s*/);if(!J)return null;let X=Z+J[0].length,Y=q1($,X);if(!Y)return null;let Q=Y.endPos,G=F1($,"if","endif",Q);if(G===-1)return null;let z=$.slice(Q,G),K=[],q=0,W="if",U=Y.expression,H=0,j=0;while(q<z.length){let B=z.indexOf("@",q);if(B===-1)break;q=B;let V=z.substring(B);if(fY(z,B)){q++;continue}if(/^@if\s*\(/.test(V)){j++,q++;continue}if(/^@endif(?![a-z])/.test(V)){j--,q+=6;continue}if(j===0){let _=V.match(/^@elseif\s*/);if(_){K.push({type:W,condition:U,content:z.substring(H,q),start:Q+H,end:Q+q});let L=q+_[0].length,F=q1(z,L);if(!F){q++;continue}W="elseif",U=F.expression,q=F.endPos,H=q;continue}else if(/^@else(?![a-z])/.test(V)){K.push({type:W,condition:U,content:z.substring(H,q),start:Q+H,end:Q+q}),W="else",U=void 0,q+=5,H=q;continue}}q++}return K.push({type:W,condition:U,content:z.slice(H),start:Q+H,end:Q+z.length}),{fullMatch:$.slice(Z,G+6),branches:K,start:Z,end:G+6}}function D2($){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=z7($,X.index);if(Q)Z.push(Q),J.lastIndex=Q.end;X=J.exec($)}return Z}function L9($,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,K=z+Q[0].length-1,q=D0($,"(",")",K);if(q===-1){Q=Y.exec($);continue}let W=$.slice(K+1,q),U=q+1,H=F1($,Z,J,U);if(H===-1){Q=Y.exec($);continue}let j=$.slice(U,H),B=H+`@${J}`.length;X.push({fullMatch:$.slice(z,B),name:Z,params:W,content:j,start:z,end:B}),Y.lastIndex=B,Q=Y.exec($)}return X}function m5($,Z){let J=$.slice(Z).match(/^@switch\s*/);if(!J)return null;let X=Z+J[0].length,Y=q1($,X);if(!Y)return null;let Q=Y.endPos,G=F1($,"switch","endswitch",Q);if(G===-1)return null;let z=$.slice(Q,G),K=[],q=0,W=null,U=0;while(q<z.length){let H=z.slice(q),j=H.match(/^@switch\s*\(/),B=H.match(/^@endswitch(?![a-z])/);if(j){if(U++,W)W.content+=j[0];q+=j[0].length;continue}if(B){if(U--,W)W.content+=B[0];q+=B[0].length;continue}if(U>0){if(W)W.content+=z[q];q++;continue}let V=H.match(/^@case\s*/),_=H.match(/^@default(?![a-z])/),L=H.match(/^@break(?![a-z])/);if(V&&H.startsWith("@case")){if(W)K.push(W);let F=q+V[0].length,O=q1(z,F);if(!O){q++;continue}W={type:"case",value:O.expression,content:""},q=O.endPos}else if(_&&H.startsWith("@default")){if(W)K.push(W);W={type:"default",content:""},q+=_[0].length}else if(L&&H.startsWith("@break"))q+=L[0].length;else{if(W)W.content+=z[q];q++}}if(W)K.push(W);return{fullMatch:$.slice(Z,G+10),expression:Y.expression,cases:K,start:Z,end:G+10}}function hY($){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)==="{{{"?"{{{":"{!!":"{{",K=Q?z==="{{{"?"}}}":"!!}":"}}",q=G+z.length,W=uY($,q,K);if(W===-1){J=G+1;continue}let U=$.slice(q,W).trim(),H=W+K.length;Z.push({fullMatch:$.slice(G,H),expression:U,start:G,end:H,isRaw:Q}),J=H}return Z}function uY($,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 mY($){let Z=l5($);if(Z.length===0)return{baseExpression:"",filters:[]};let J=Z[0],X=[];for(let Y=1;Y<Z.length;Y++){let Q=dY(Z[Y]);if(Q)X.push(Q)}return{baseExpression:J,filters:X}}function dY($){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=D0(Z,"(",")",J);if(Q===-1)return{name:X,args:[]};let G=Z.slice(Y,Q),z=W7(G);return{name:X,args:z}}function W7($){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 lY($,Z){let J=Z;while(J<$.length&&/\s/.test($[J]))J++;if($[J]!=="(")return null;let X=D0($,"(",")",J);if(X===-1)return null;return{params:$.slice(J+1,X),endPos:X+1}}function cY($){let Z=[],X=new d5($).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 K=z.value;if(Y++,Y>=X.length)break;let q=X[Y];if(q.type==="IDENTIFIER"){let W=q.value;if(Y++,Y<X.length&&X[Y].type==="OPERATOR"&&X[Y].value==="="){Y++;let U=Y<X.length?X[Y].start:$.length,H=K7(X,Y,$);Y=H.nextIndex,Z.push({type:"variable",name:W,value:$.slice(U,H.endPos),exported:G,start:z.start,end:H.endPos})}}else if(q.type==="PUNCTUATION"&&(q.value==="{"||q.value==="[")){let W=q.start,U=q.value==="{"?"}":"]",H=D0($,q.value,U,W);if(H!==-1){let j=$.slice(W,H+1);if(Y=q7(X,H+1),Y<X.length&&X[Y].type==="OPERATOR"&&X[Y].value==="="){Y++;let B=Y<X.length?X[Y].start:$.length,V=K7(X,Y,$);Y=V.nextIndex;let _=`__stx_destructured_${Z.length}`;Z.push({type:"variable",name:_,value:`${$.slice(B,V.endPos)}; ${K} ${j} = ${_}`,exported:G,start:z.start,end:V.endPos})}}}}else if(z.type==="IDENTIFIER"&&z.value==="function"){let K=G?X[Y-1].start:z.start;if(Y++,Y>=X.length)break;let q=X[Y];if(q.type==="IDENTIFIER"){let W=q.value;Y++;let U=-1;while(Y<X.length){if(X[Y].type==="PUNCTUATION"&&X[Y].value==="{"){U=X[Y].start;break}Y++}if(U!==-1){let H=D0($,"{","}",U);if(H!==-1)Z.push({type:"function",name:W,value:$.slice(K,H+1).replace(/^export\s+/,""),exported:G,start:K,end:H+1}),Y=q7(X,H+1)}}}else Y++}return Z}function K7($,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 q7($,Z){for(let J=0;J<$.length;J++)if($[J].start>=Z)return J;return $.length}function pY($,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=m5(X,G);if(!z)break;try{let K;if(B0(z.expression))K=H0(z.expression,Object.keys(Z))(...Object.values(Z));else K=Q0(z.expression,Z);let q="",W=!1;for(let U of z.cases)if(U.type==="default"){if(!W)q=U.content.trim()}else try{let H;if(U.value&&B0(U.value))H=H0(U.value,Object.keys(Z))(...Object.values(Z));else if(U.value)H=Q0(U.value,Z);if(K===H){q=U.content.trim(),W=!0;break}}catch{continue}X=X.substring(0,G)+q+X.substring(z.end),Y=!0}catch(K){let q=K instanceof Error?K.message:String(K),W=R0("Switch",`Error evaluating @switch expression: ${q}`,w0.EVALUATION_ERROR);X=X.substring(0,G)+W+X.substring(z.end);break}}return X}function iY($){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 nY($,Z){if(Z.length===0)return $;return $.replace(/\u0000stx-script-(\d+)\u0000/g,(J,X)=>Z[Number(X)]??J)}function e0($,Z,J){let{masked:X,scripts:Y}=iY($);return nY(sY(X,Z,J),Y)}function sY($,Z,J){let X=$;X=pY(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,K=q1(X,z+7);if(!K)break;let q=K.endPos,W=F1(X,"unless","endunless",q);if(W===-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 U=X.slice(q,W),H=K.expression,j=-1;{let V=0,_=/@(?:if|unless)\s*\(/g,L=/@(?:endif|endunless)(?![a-z])/g,F=/@else(?![a-z])/g,O=[],w;while((w=_.exec(U))!==null)O.push({pos:w.index,type:"open"});while((w=L.exec(U))!==null)O.push({pos:w.index,type:"close"});while((w=F.exec(U))!==null)O.push({pos:w.index,type:"else"});O.sort((R,D)=>R.pos-D.pos);for(let R of O)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=U.slice(0,j),_=U.slice(j+5);B=`@if (${H})${_}@else ${V}@endif`}else B=`@if (!(${H}))${U}@endif`;X=X.substring(0,z)+B+X.substring(W+10),Q=!0}}X=p5(X,Z,J),X=i5(X,Z,J),X=c5(X,Z);let Y=()=>{let Q=D2(X);if(Q.length===0)return!1;let G=Array(Q.length);for(let q=Q.length-1;q>=0;q--){let W=Q[q];try{let U="",H=!1;for(let j of W.branches){if(H)break;if(j.type==="else")U=j.content,H=!0;else try{let B;if(j.condition&&B0(j.condition))B=H0(j.condition,Object.keys(Z))(...Object.values(Z));else if(j.condition)B=Q0(j.condition,Z);if(B)U=j.content,H=!0}catch(B){U=R0(j.type==="if"?"If":"Elseif",`Error in @${j.type}(${j.condition}): ${B instanceof Error?B.message:String(B)}`,w0.EVALUATION_ERROR),H=!0}}G[q]=U}catch(U){let H=U instanceof Error?U.message:String(U);G[q]=R0("If",`Error processing @if block: ${H}`,w0.EVALUATION_ERROR)}}let z=Array(Q.length*2+1),K=0;for(let q=0;q<Q.length;q++){let W=Q[q];z[q*2]=X.slice(K,W.start),z[q*2+1]=G[q],K=W.end}return z[Q.length*2]=X.slice(K),X=z.join(""),!0};while(!0){let Q=X;if(!Y())break;if(X===Q)break}return X}function U7($){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 c5($,Z){let J=$;function X(z,K,q,W){let U=1,H=W,j=new RegExp(`@${K}(?:\\s*\\(|\\s|$)`,"g"),B=new RegExp(`@${q}(?![a-z])`,"g");while(H<z.length&&U>0){j.lastIndex=H,B.lastIndex=H;let V=j.exec(z),_=B.exec(z),L=V?V.index:1/0,F=_?_.index:1/0;if(L<F)U++,H=L+V[0].length;else if(F<1/0){if(U--,U===0)return F;H=F+_[0].length}else break}return-1}function Y(z,K,q){let W=0,U=new RegExp(`@${K}(?:\\s*\\(|\\s|$)`,"g"),H=new RegExp(`@${q}(?![a-z])`,"g"),j=/@else(?![a-z])/g,B=[],V;while((V=U.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((_,L)=>_.pos-L.pos);for(let _ of B)if(_.type==="open")W++;else if(_.type==="close")W--;else if(_.type==="else"&&W===0)return _.pos;return-1}{let z=!0;while(z){z=!1;let K=J.match(/@auth(?:\s*\(|\s|(?=\n))/);if(!K||K.index===void 0)break;let q=K.index,W,U,H=J.slice(q+5),j=U7(H);if(j)W=j.value,U=q+5+j.consumed;else U=q+5;let B=X(J,"auth","endauth",U);if(B===-1){console.warn(`[stx] @auth directive at position ${q} has no matching @endauth \u2014 the block was skipped.`);break}let V=J.slice(U,B),_=Y(V,"auth","endauth"),L;if(!Z.auth)L=!1;else L=W?K1(`auth?.check && auth?.user?.[${W}]`,Z):K1("auth?.check",Z);let F;if(_!==-1){let O=V.slice(0,_),w=V.slice(_+5);F=L?O:w}else F=L?V:"";J=J.substring(0,q)+F+J.substring(B+8),z=!0}}{let z=!0;while(z){z=!1;let K=J.match(/@guest(?:\s*\(|\s|(?=\n))/);if(!K||K.index===void 0)break;let q=K.index,W,U,H=J.slice(q+6),j=U7(H);if(j)W=j.value,U=q+6+j.consumed;else U=q+6;let B=X(J,"guest","endguest",U);if(B===-1){console.warn(`[stx] @guest directive at position ${q} has no matching @endguest \u2014 the block was skipped.`);break}let V=J.slice(U,B),_=Y(V,"guest","endguest"),L;if(!Z.auth)L=!0;else L=W?K1(`!auth?.check || !auth?.user?.[${W}]`,Z):K1("!auth?.check",Z);let F;if(_!==-1){let O=V.slice(0,_),w=V.slice(_+5);F=L?O:w}else F=L?V:"";J=J.substring(0,q)+F+J.substring(B+9),z=!0}}function Q(z,K,q){if(Z.userCan&&typeof Z.userCan[z]==="boolean")return Z.userCan[z];if(Z.permissions?.check&&typeof Z.permissions.check==="function")try{let W=[z];if(K)W.push(K);if(q){let U=K1(q,Z);W.push(U)}return Z.permissions.check(...W)}catch{return!1}return!1}function G(z){let K=z.match(/^\s*\(\s*'([^']*)'(?:,\s*'([^']*)')?(?:,\s*([^)]*))?\)/);if(!K)return null;return{ability:K[1],type:K[2],id:K[3]?.trim(),paramsEnd:K[0].length}}for(let z of["can","cannot"]){let K=`end${z}`,q=z==="can"?"elsecan":"elsecannot",W=!0;while(W){W=!1;let U=J.match(new RegExp(`@${z}\\s*\\(`));if(!U||U.index===void 0)break;let H=U.index,j=J.slice(H+`@${z}`.length),B=G(j);if(!B)break;let V=H+`@${z}`.length+B.paramsEnd,_=X(J,z,K,V);if(_===-1){console.warn(`[stx] @${z} directive at position ${H} has no matching @${K} \u2014 the block was skipped.`);break}let L=J.slice(V,_),F=[],O=0,w=new RegExp(`@${z}\\s*\\(`,"g"),R=new RegExp(`@${K}(?![a-z])`,"g"),D=new RegExp(`@${q}\\s*\\(`,"g"),N=/@else(?![a-z])/g,I=[],M;while((M=w.exec(L))!==null)I.push({pos:M.index,type:"open"});while((M=R.exec(L))!==null)I.push({pos:M.index,type:"close"});while((M=D.exec(L))!==null)I.push({pos:M.index,type:"elseDirective"});while((M=N.exec(L))!==null)I.push({pos:M.index,type:"else"});I.sort((b,y)=>b.pos-y.pos);for(let b of I){if(b.type==="open"){O++;continue}if(b.type==="close"){O--;continue}if(O===0)F.push(b)}let T=[],k=0;for(let b=0;b<F.length;b++){let y=F[b];if(T.push({content:L.slice(k,y.pos),ability:void 0}),y.type==="elseDirective"){let P=L.slice(y.pos+`@${q}`.length),u=G(P);if(u){T[T.length-1]={content:L.slice(k,y.pos)},k=y.pos+`@${q}`.length+u.paramsEnd,T.push({content:"",ability:u.ability,type:u.type,id:u.id}),T.pop();let p=F[b+1],m=p?p.pos:L.length;T.push({content:L.slice(k,m),ability:u.ability,type:u.type,id:u.id}),k=m}}else k=y.pos+5}if(k<L.length){let b=T[T.length-1];if(F.length>0&&F[F.length-1].type==="else")T.push({content:L.slice(k),isFinalElse:!0});else if(T.length===0)T.push({content:L.slice(k)})}let A=Q(B.ability,B.type,B.id),E=z==="can"?A:!A,C="";if(E)C=T[0]?.content||"";else{let b=!1;for(let y=1;y<T.length;y++){let P=T[y];if(P.isFinalElse){C=P.content,b=!0;break}if(P.ability){let u=Q(P.ability,P.type,P.id);if(z==="can"?u:!u){C=P.content,b=!0;break}}}if(!b&&T.length>0){let y=T[T.length-1];if(y.isFinalElse)C=y.content}}J=J.substring(0,H)+C+J.substring(_+`@${K}`.length),W=!0}}return J}function p5($,Z,J){let X=$;function Y(Q,G,z,K,q){let W=!0;while(W){W=!1;let U=new RegExp(`@${G}\\s*\\(`),H=Q.match(U);if(!H||H.index===void 0)break;let j=H.index,B=q1(Q,j+`@${G}`.length);if(!B)break;let V=B.endPos,_=F1(Q,G,z,V);if(_===-1){console.warn(`[stx] @${G} directive at position ${j} has no matching @${z} \u2014 the block was skipped.`);break}let L=Q.slice(V,_),F=B.expression,O=-1,w=0,R=0;while(R<L.length){let D=L.indexOf("@",R);if(D===-1)break;let N=L.substring(D);if(/^@(?:if|unless|isset|empty)\s*\(/.test(N)){w++,R=D+1;continue}if(/^@(?:endif|endunless|endisset|endempty)(?![a-z])/.test(N)){w--,R=D+1;continue}if(w===0&&/^@else(?![a-z])/.test(N)){O=D;break}R=D+1}try{let D=K(F.trim()),N;if(O!==-1){let I=L.slice(0,O),M=L.slice(O+5);N=D?I:M}else N=D?L:"";Q=Q.substring(0,j)+N+Q.substring(_+`@${z}`.length),W=!0}catch(D){let N=D instanceof Error?D.message:String(D),I=R0(q,`Error processing @${G} directive: ${N}`,w0.EVALUATION_ERROR);Q=Q.substring(0,j)+I+Q.substring(_+`@${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 i5($,Z,J){let X=$,Y="development";function Q(G,z,K,q){let W=new RegExp(`@${z}(?![a-z])`,"g"),U=new RegExp(`@${K}(?![a-z])`,"g"),H=new RegExp(`^@${z}(?![a-z])`),j=new RegExp(`^@${K}(?![a-z])`),B=G,V=!0;while(V){V=!1,W.lastIndex=0;let _=W.exec(B);if(!_)break;let L=_.index,F=L+_[0].length;if(z==="env"){let A=B.substring(F).match(/^\s*\(\s*(['"])([^'"]+)\1\s*\)/);if(!A)break;F+=A[0].length,q=Y===A[2]}let O=1,w=F,R=-1;while(O>0&&w<B.length){W.lastIndex=w,U.lastIndex=w;let A=W.exec(B),E=U.exec(B),C=A?A.index:1/0,b=E?E.index:1/0;if(C<b)O++,w=C+A[0].length;else if(b<1/0){if(O--,O===0){R=b;break}w=b+E[0].length}else break}if(R===-1){console.warn(`[stx] @${z} directive at position ${L} has no matching @${K} \u2014 the block was skipped.`);break}let D=B.substring(F,R),N=-1,I=0,M=0;while(M<D.length){let A=D.indexOf("@",M);if(A===-1)break;let E=D.substring(A);if(H.test(E)){I++,M=A+1;continue}if(j.test(E)){I--,M=A+1;continue}if(I===0&&/^@else(?![a-z])/.test(E)){N=A;break}M=A+1}let T;if(N!==-1){let A=D.slice(0,N),E=D.slice(N+5);T=q?A:E}else T=q?D:"";let k=`@${K}`.length;B=B.substring(0,L)+T+B.substring(R+k),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 H7($=16){let Z=new Uint8Array($);return crypto.getRandomValues(Z),btoa(String.fromCharCode(...Z))}function w1($,Z){if(!$)return Z?.nonceGenerator?.()??H7();let J=n5.get($);if(!J)J=Z?.nonceGenerator?.()??H7(),n5.set($,J);return J}function hH($){n5.delete($)}function j7($,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 o5($,Z){return`<meta http-equiv="Content-Security-Policy" content="${j7($,Z).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}">`}var oY={"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},s5={"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},rY={"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'"]},aY={"default-src":["'none'"],"frame-ancestors":["'none'"]};function uH($){return{enabled:!0,directives:{strict:oY,moderate:s5,relaxed:rY,api:aY}[$]||s5,useNonce:$==="strict",addMetaTag:!0}}function mH($,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:[],K=[...new Set([...z,...Y])];J[Q]=K}}return J}function B7($,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=o5(Z.directives,X);return $.replace(/<head([^>]*)>/,`<head$1>
3171
- ${Y}`)}function V7($,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 L7($,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 o5(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 tY={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 o5(Q.directives,G)},hasEndTag:!1,description:"Insert Content-Security-Policy meta tag"},eY={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 dH(){return[tY,eY]}function lH($){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 $Q($=!1){return $?"Content-Security-Policy-Report-Only":"Content-Security-Policy"}function cH($,Z){if(!$.enabled)return{};let J=$.useNonce?w1(Z,$):void 0,X=j7($.directives,J);return{[$Q($.reportOnly)]:X}}var pH={enabled:!1,reportOnly:!1,directives:s5,useNonce:!1,addMetaTag:!0};import ZQ from"crypto";var JQ=40,_7="_token",r5=null;function XQ($=JQ){let Z=ZQ.randomBytes(Math.ceil($/2)).toString("hex").slice(0,$);return r5=Z,Z}function YQ(){if(!r5)XQ();return r5}function QQ($=_7){let Z=YQ();return`<input type="hidden" name="${$}" value="${Z}">`}function O7($){return $.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(Z,J,X)=>{return QQ(X||_7)})}async function R7($,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 GQ(Y,Q,Z,J,X);else Y=await zQ(Y,Q,Z,J,X)}return Y}async function GQ($,Z,J,X,Y){let{name:Q,handler:G}=Z,z=`@${Q}`,K=`@end${Q}`,q=$,W=R1(`${z}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${K}`,"g"),U=[],H=W.exec(q);while(H!==null){let[j,B="",V=""]=H,_=H.index||0;try{let L=B?D7(Z,B):[],F=V.trim(),O=await G(F,L,J,X);U.push({original:j,processed:O,startIndex:_})}catch(L){let F=L instanceof Error?L.message:String(L);if(Y.debug)console.error(`Error processing custom directive @${Q}:`,L);U.push({original:j,processed:R0("CustomDirective",`Error in @${Q}${B?`(${B})`:""}: ${F}`,w0.EVALUATION_ERROR),startIndex:_})}H=W.exec(q)}for(let j=U.length-1;j>=0;j--){let{original:B,processed:V}=U[j];q=q.replace(B,V)}return q}async function zQ($,Z,J,X,Y){let{name:Q,handler:G}=Z,z=$,K=[],q=[];if(Z.rawParams){for(let H of F7(z,R1(`(?<![\\w$@])@${Q}\\s*\\(`,"g")))if(H.end!==-1)q.push({fullMatch:H.call,paramString:H.args,startIndex:H.start})}else{let H=R1(`@${Q}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g");H.lastIndex=0;let j=H.exec(z);while(j!==null)q.push({fullMatch:j[0],paramString:j[1]??"",startIndex:j.index||0}),j=H.exec(z)}for(let{fullMatch:H,paramString:j,startIndex:B}of q)try{let V=D7(Z,j),_=await G("",V,J,X);K.push({original:H,processed:_,startIndex:B})}catch(V){let _=V instanceof Error?V.message:String(V);if(Y.debug)console.error(`Error processing custom directive @${Q}:`,V);K.push({original:H,processed:R0("CustomDirective",`Error in @${Q}(${j}): ${_}`,w0.EVALUATION_ERROR),startIndex:B})}let W=R1(`@${Q}(?!\\w)(?!\\s*\\()`,"g"),U=W.exec(z);while(U!==null){let[H]=U,j=U.index||0;try{let B=await G("",[],J,X);K.push({original:H,processed:B,startIndex:j})}catch(B){let V=B instanceof Error?B.message:String(B);if(Y.debug)console.error(`Error processing custom directive @${Q}:`,B);K.push({original:H,processed:R0("CustomDirective",`Error in @${Q}: ${V}`,w0.EVALUATION_ERROR),startIndex:j})}U=W.exec(z)}for(let H=K.length-1;H>=0;H--){let{original:j,processed:B}=K[H];z=z.replace(j,B)}return z}function D7($,Z){return $.rawParams?w7(Z):KQ(Z)}function KQ($){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 N7=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,M7=/^[A-Za-z_$][\w$]*$/,qQ=new Set(["light","dark","system"]);function D1($,Z){if(typeof $!=="string"||$.length===0)throw Error(`@appearanceBootstrap ${Z} must be a non-empty string`)}function WQ($){if(!$||typeof $!=="object"||Array.isArray($))throw Error("@appearanceBootstrap expects an options object");let Z=$,J=Z.appearance,X=Z.colorMode;if(D1(Z.storageKey,"storageKey"),J!==void 0&&(!J||typeof J!=="object"||Array.isArray(J)))throw Error("@appearanceBootstrap appearance must be an object when given");if(!X||typeof X!=="object"||Array.isArray(X))throw Error("@appearanceBootstrap colorMode must be an object");if(D1(X.key,"colorMode.key"),D1(X.attribute,"colorMode.attribute"),D1(X.default,"colorMode.default"),!M7.test(X.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!N7.test(X.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!qQ.has(X.default))throw Error("@appearanceBootstrap colorMode.default must be light, dark, or system");let Y=null;if(J){if(D1(J.key,"appearance.key"),D1(J.attribute,"appearance.attribute"),D1(J.default,"appearance.default"),!M7.test(J.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!N7.test(J.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!Array.isArray(J.allowed)||J.allowed.length===0||J.allowed.some((Q)=>typeof Q!=="string"||Q.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");Y={key:J.key,attribute:J.attribute,allowed:[...new Set(J.allowed)],default:J.default}}return{storageKey:Z.storageKey,appearance:Y,colorMode:{key:X.key,attribute:X.attribute,default:X.default},respectExisting:Z.respectExisting===!0}}function UQ($){return JSON.stringify($).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function HQ($){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${UQ($)};const root=document.documentElement;const MODES=["light","dark","system"];let format="json";const forced=(function(){const found={colorMode:null,appearance:null};if(!config.respectExisting)return found;try{const mode=root.getAttribute("data-"+config.colorMode.attribute);if(mode==="light"||mode==="dark")found.colorMode=mode;if(config.appearance){const name=root.getAttribute("data-"+config.appearance.attribute);if(config.appearance.allowed.includes(name))found.appearance=name}}catch{}return found}());function read(){let stored={};try{const raw=localStorage.getItem(config.storageKey);if(raw){let parsed=null;try{parsed=JSON.parse(raw)}catch{parsed=raw}if(parsed&&typeof parsed==="object"&&!Array.isArray(parsed)){stored=parsed;format="json"}else if(typeof parsed==="string"&&MODES.includes(parsed)){stored={};stored[config.colorMode.key]=parsed;format="string"}}}catch{}return stored}function write(stored){try{if(format==="string"&&!config.appearance)localStorage.setItem(config.storageKey,stored[config.colorMode.key]);else localStorage.setItem(config.storageKey,JSON.stringify(stored))}catch{}}function resolve(){const stored=read();const state={colorMode:forced.colorMode||(MODES.includes(stored[config.colorMode.key])?stored[config.colorMode.key]:config.colorMode.default)};if(config.appearance)state.appearance=forced.appearance||(config.appearance.allowed.includes(stored[config.appearance.key])?stored[config.appearance.key]:config.appearance.default);return state}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());if(config.appearance)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,forced:forced,read:read,resolve:resolve,apply:apply,setColorMode:function(mode){return store(config.colorMode.key,MODES,mode)},setAppearance:function(name){return config.appearance?store(config.appearance.key,config.appearance.allowed,name):apply()},watchSystem:function(){try{matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(){if(resolve().colorMode==="system")apply()})}catch{}}};apply()}());</script>`}function jQ($,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 A7($,Z){let J=$,X=/@appearanceBootstrap\s*\(/g,Y;while((Y=X.exec(J))!==null){let Q=Y.index+Y[0].length-1,G=jQ(J,Q);if(G===-1)throw Error("@appearanceBootstrap has an unclosed options object");let z=J.slice(Q+1,G).trim(),K=Q0(`(${z})`,Z),q=HQ(WQ(K));J=J.slice(0,Y.index)+q+J.slice(G+1),X.lastIndex=Y.index+q.length}return J}import BQ from"crypto";function N0($){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 VQ($){return{...t5,...$.forms?.classes}}function _9($,Z,J,X){let Y=$||Z;return J?`${Y} ${X}`:Y}function h0($){return String($).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function u1($,Z){if(/\bid\s*=/i.test($))return"";return` id="${N0(Z)}"`}function a5($,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="${N0(`${h0($)}-error`)}"`;return X}function LQ(){return BQ.randomUUID()}function Xj($,Z,J,X){let Y=VQ(X),Q=$;return Q=OQ(Q,Z),Q=A2(Q,Z),Q=e5(Q,Z,Y),Q=$$(Q,Z,Y),Q}function A2($,Z){let J=$;return J=J.replace(/@csrf/g,()=>{if(!Z.csrf||typeof Z.csrf!=="object"){let X=LQ();Z.csrf={token:X}}if(Z.csrf.field)return Z.csrf.field;if(Z.csrf.token)return`<input type="hidden" name="_token" value="${N0(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="${N0(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,K,q="")=>{let W=Q||G||"POST",U=z||K||"",H=W1(q),j=W.toUpperCase(),B=["GET","POST"].includes(j)?j:"POST",V=`<form method="${N0(B)}" action="${N0(U)}"${H?` ${H}`:""}>`;if(V+=`
3170
+ </script>`}var x5={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:a4,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:I4,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:n4,hasEndTag:!1,description:"Include a web component in the template"},o4,r4,J7,X7,L5,O5,F5,_5,D4,U4,g4,C5,...Y7],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function AY($,Z,J){let X=Z||"pages";if($)return{root:$,pagesDir:X};let Y=J||process.cwd(),Q=C0.join(Y,"resources","views"),G=C0.join(Y,"resources","layouts");if(j9.existsSync(Q)&&j9.existsSync(G))return{root:"resources",pagesDir:"views"};let z=C0.join(Y,"resources","views","pages");if(j9.existsSync(z))return{root:"resources/views",pagesDir:X};return{root:".",pagesDir:X}}var s4=new Set,B9=["partialsDir","componentsDir","layoutsDir"],f5=new WeakMap;function IY($,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 TY($,Z){let J=!$.root,X=AY($.root,$.pagesDir,Z);if($.root=X.root,$.pagesDir=X.pagesDir,J&&X.root!=="."){let Y=`${Z}::${X.root}`;if(!s4.has(Y))s4.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(!f5.has($)){let Y={};for(let Q of B9){let G=$[Q];if(typeof G==="string"&&G)Y[Q]=G}f5.set($,Y)}if($.root&&$.root!=="."){let Y=$.root;for(let Q of B9){let G=$[Q];if(typeof G!=="string"||!G)continue;if(C0.isAbsolute(G)||IY(G,Y))continue;$[Q]=C0.join(Y,G)}}for(let Y of B9){let Q=$[Y];if(typeof Q!=="string"||!Q||C0.isAbsolute(Q))continue;$[Y]=C0.resolve(Z,Q)}return $}function kY($,Z){let J=f5.get($);for(let X of B9){let Y=$[X];if(typeof Y!=="string"||!Y)continue;let Q=C0.isAbsolute(Y)?Y:C0.join(Z,Y);if(j9.existsSync(Q))continue;let G=J?.[X]??Y,z=$.root,K=!!z&&z!==".";console.warn(`[stx] ${String(X)} resolves to "${Q}", which does not exist. Configured as "${G}"`+(K?`, resolved under root "${z}".`:"."))}}function EY($){if($.customDirectives)$.customDirectives=[...$.customDirectives];if($.middleware)$.middleware=[...$.middleware];if($.apiRoutes)$.apiRoutes={...$.apiRoutes}}function yY($){if(t4($.stateDir),$.stateDir=e4(),$.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 z1=null,O1=new Map,W9=new Map,R2=null;async function g5($){let Z=$?C0.resolve($):process.cwd(),J=W9.get(Z);if(J&&J.signature!==U9(J.graph)){let Q=O1.get(Z);if(O1.delete(Z),W9.delete(Z),!$)z1=null,R2=null;let{clearComponentCache:G}=await import("./chunk-65ddb2cs.js"),{partialsCache:z}=await import("./chunk-p5cs4xsd.js");if(G(),z.clear(),Q&&J.configSignature===H9(J.graph)){let K=Q.then(async(q)=>{let W={...J.graph};await Z7(W,Z),W9.set(Z,{graph:W,signature:U9(W),configSignature:H9(W)});let U={...q,_layerGraph:W};if(!$)z1=U;return U});return O1.set(Z,K),K}}if(!$){if(z1)return z1;if(R2)return R2}let X=O1.get(Z);if(X)return X;let Y=(async()=>{let G=(await MY({name:"stx",alias:"ui",cwd:Z,defaultConfig:x5,verbose:!1})).config;if(G.extends!==void 0||J){let W=await $7(Z,x5);G=W.config,W9.set(Z,{graph:W.graph,signature:U9(W.graph),configSignature:H9(W.graph)})}if(G.runtimeConfig){let{resolveRuntimeConfig:W}=await import("./chunk-0seyntda.js");W(G.runtimeConfig,{});let{generateRuntimeConfigTypes:U}=await import("./chunk-v3mqx1pw.js");await U(Z,G.runtimeConfig)}EY(G),yY(G),TY(G,Z),kY(G,Z);let z=[],K=new Set((G.plugins??[]).map((W)=>typeof W==="string"?W:W[0]));for(let W of G.componentPackages??["@stacksjs/components"]){let U=`${W}/stx-plugin`;if(K.has(U)||K.has(W))continue;try{x.resolve(U,{paths:[Z]}),z.push(U)}catch{}}let q=[...G.plugins??[],...z];if(q.length>0){let{pluginManager:W}=await import("./chunk-abs56gdt.js"),U=[],H=[];for(let j of q){let B=typeof j==="string"?j:j[0],V=typeof j==="string"?{}:j[1]||{};try{let _,L;try{let O=x.resolve(B,{paths:[Z]});_=await import(O),L=C0.dirname(O)}catch{let O=C0.resolve(Z,B);_=await import(O),L=C0.dirname(O)}let F=_.default||_;if(!W.has(F.name))await W.register(F,G);if(F.components){let O=Array.isArray(F.components)?F.components:[F.components];for(let w of O)U.push(C0.resolve(L,w))}if(F.pages){let O=C0.resolve(L,F.pages),w=V.path||"/";H.push({dir:O,prefix:w})}if(F.setup){let O={addDirective:(w)=>{G.customDirectives=G.customDirectives||[],G.customDirectives.push(w)},addRoute:(w,R)=>{G.apiRoutes=G.apiRoutes||{},G.apiRoutes[w]=R},addMiddleware:(w)=>{G.middleware=G.middleware||[],G.middleware.push(w)},pluginDir:L,config:G};await F.setup(V,O)}console.log(`[stx] Plugin loaded: ${F.name||B}`)}catch(_){console.warn(`[stx] Failed to load plugin ${B}:`,_.message)}}G._pluginComponentDirs=U,G._pluginPageDirs=H}return G})();if(O1.set(Z,Y),Y.catch(()=>{if(O1.get(Z)===Y)O1.delete(Z)}),!$)R2=Y,Y.then((Q)=>{z1=Q}).catch(()=>{});return Y}var Q7=new Proxy(x5,{get($,Z){if(z1&&Z in z1)return z1[Z];if(!R2)g5().catch((J)=>{console.warn("[stx] Failed to load config file:",J?.message||J)});return $[Z]}});function jH($){return $}function BH($){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 u5=new Map;async function CY($,Z={}){try{if(!await $0($))throw Error(`Markdown file not found: ${$}`);let X=(await bY.promises.stat($)).mtime.getTime();if(Z.cache&&u5.has($)){let U=u5.get($);if(U.updatedAt>=X)return{content:U.content,data:U.data}}let Y=await Bun.file($).text(),{data:Q,content:G}=M4(Y),z=Z.markdown||Q7.markdown||{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}},q=_2(G,{gfm:!0});if(z.syntaxHighlighting?.enabled&&z.syntaxHighlighting?.serverSide)q=await PY(q,z.syntaxHighlighting?.defaultTheme||"github-dark",z.syntaxHighlighting?.highlightUnknownLanguages||!1);let W={content:q,data:Q||{}};if(Z.cache)u5.set($,{...W,updatedAt:X});return W}catch(J){if(Z.debug)console.error(`Error reading/parsing markdown file ${$}:`,J);let X=J instanceof Error?J.message:String(J);return{content:_0("Markdown File",`Error reading/parsing markdown file: ${X}`,$,"",0,""),data:{}}}}var V9=null;async function PY($,Z,J){let X=/<pre><code( class="language-([^"]+)")?>([^<]+)<\/code><\/pre>/g;if(!V9)try{V9=await SY({theme:Z||"github-dark",cache:!0})}catch(z){return console.error("Failed to initialize ts-syntax-highlighter:",z),$}let Y=async(z,K,q,W)=>{let U=W.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'"),H=q||(J?"text":"");if(!H)return z;try{if(!V9.getSupportedLanguages().includes(H))return z;return(await V9.highlight(U,H,{theme:Z})).html}catch(j){console.error(`Error highlighting code block with language ${q}:`,j)}return z},Q=$,G=$.matchAll(X);for(let z of G){let[K,q,W,U]=z,H=await Y(K,q,W,U);Q=Q.replace(K,H)}return Q}async function G7($,Z,J="",X={}){return await vY($,/@markdown-file\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\}))?\)/g,async(G,z,K,q)=>{try{let W=z;if(!h5.isAbsolute(z))W=h5.resolve(h5.dirname(J),z);let U={};if(K)try{try{U=JSON.parse(K)}catch{if(X.debug)console.warn("Using safer alternative for parsing JS object literal");let F=K.replace(/^\s*\{|\}\s*$/g,"").trim().split(/,(?=\s*\w+\s*:)/);for(let O of F){let w=O.indexOf(":");if(w>0){let R=O.substring(0,w).trim(),D=O.substring(w+1).trim(),N=D.startsWith('"')&&D.endsWith('"'),I=D.startsWith("'")&&D.endsWith("'");if(N||I)D=D.substring(1,D.length-1);U[R]=D}}}}catch(L){if(X.debug)console.error("Error parsing context in @markdown-file directive:",L)}let{content:H,data:j}=await CY(W,X),B={...Z,...j,...U},V=H,_=/\{\{([^}]+)\}\}/g;return V=V.replace(_,(L,F)=>{let O=F.trim();return B[O]!==void 0?String(B[O]):L}),V}catch(W){let U=W instanceof Error?W.message:String(W);return _0("Markdown File",`Error including markdown file: ${U}`,J,$,q,G)}})}async function vY($,Z,J){let X=[],Y;while((Y=Z.exec($))!==null){let z=Y[0],K=Y.index,q=Y;X.push(J(...q).then((W)=>({match:z,replacement:W,index:K})))}let Q=await Promise.all(X);Q.sort((z,K)=>K.index-z.index);let G=$;for(let{match:z,replacement:K}of Q)G=G.replace(z,()=>K);return G}function K1($,Z){try{let J=$.trim();if(B0(J))return H0(J,Object.keys(Z))(...Object.values(Z));else return Q0(J,Z)}catch{return!1}}function q1($,Z){let J=xY($,Z);return J.ok?{expression:J.expression,endPos:J.endPos}:null}function xY($,Z){let J=Z;while(J<$.length&&/\s/.test($[J]))J++;if($[J]!=="(")return{ok:!1,reason:"missing-open-paren",pos:J};let X=D0($,"(",")",J);if(X===-1)return{ok:!1,reason:"unclosed-paren",pos:J};return{ok:!0,expression:$.slice(J+1,X),endPos:X+1}}function fY($,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 K=G.exec($),q=z.exec($),W=K?K.index:1/0,U=q?q.index:1/0;if(W<U)Y++,Q=W+K[0].length;else if(U<1/0){if(Y--,Y===0)return U;Q=U+q[0].length}else break}return-1}function z7($,Z){let J=$.slice(Z).match(/^@if\s*/);if(!J)return null;let X=Z+J[0].length,Y=q1($,X);if(!Y)return null;let Q=Y.endPos,G=F1($,"if","endif",Q);if(G===-1)return null;let z=$.slice(Q,G),K=[],q=0,W="if",U=Y.expression,H=0,j=0;while(q<z.length){let B=z.indexOf("@",q);if(B===-1)break;q=B;let V=z.substring(B);if(fY(z,B)){q++;continue}if(/^@if\s*\(/.test(V)){j++,q++;continue}if(/^@endif(?![a-z])/.test(V)){j--,q+=6;continue}if(j===0){let _=V.match(/^@elseif\s*/);if(_){K.push({type:W,condition:U,content:z.substring(H,q),start:Q+H,end:Q+q});let L=q+_[0].length,F=q1(z,L);if(!F){q++;continue}W="elseif",U=F.expression,q=F.endPos,H=q;continue}else if(/^@else(?![a-z])/.test(V)){K.push({type:W,condition:U,content:z.substring(H,q),start:Q+H,end:Q+q}),W="else",U=void 0,q+=5,H=q;continue}}q++}return K.push({type:W,condition:U,content:z.slice(H),start:Q+H,end:Q+z.length}),{fullMatch:$.slice(Z,G+6),branches:K,start:Z,end:G+6}}function D2($){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=z7($,X.index);if(Q)Z.push(Q),J.lastIndex=Q.end;X=J.exec($)}return Z}function L9($,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,K=z+Q[0].length-1,q=D0($,"(",")",K);if(q===-1){Q=Y.exec($);continue}let W=$.slice(K+1,q),U=q+1,H=F1($,Z,J,U);if(H===-1){Q=Y.exec($);continue}let j=$.slice(U,H),B=H+`@${J}`.length;X.push({fullMatch:$.slice(z,B),name:Z,params:W,content:j,start:z,end:B}),Y.lastIndex=B,Q=Y.exec($)}return X}function m5($,Z){let J=$.slice(Z).match(/^@switch\s*/);if(!J)return null;let X=Z+J[0].length,Y=q1($,X);if(!Y)return null;let Q=Y.endPos,G=F1($,"switch","endswitch",Q);if(G===-1)return null;let z=$.slice(Q,G),K=[],q=0,W=null,U=0;while(q<z.length){let H=z.slice(q),j=H.match(/^@switch\s*\(/),B=H.match(/^@endswitch(?![a-z])/);if(j){if(U++,W)W.content+=j[0];q+=j[0].length;continue}if(B){if(U--,W)W.content+=B[0];q+=B[0].length;continue}if(U>0){if(W)W.content+=z[q];q++;continue}let V=H.match(/^@case\s*/),_=H.match(/^@default(?![a-z])/),L=H.match(/^@break(?![a-z])/);if(V&&H.startsWith("@case")){if(W)K.push(W);let F=q+V[0].length,O=q1(z,F);if(!O){q++;continue}W={type:"case",value:O.expression,content:""},q=O.endPos}else if(_&&H.startsWith("@default")){if(W)K.push(W);W={type:"default",content:""},q+=_[0].length}else if(L&&H.startsWith("@break"))q+=L[0].length;else{if(W)W.content+=z[q];q++}}if(W)K.push(W);return{fullMatch:$.slice(Z,G+10),expression:Y.expression,cases:K,start:Z,end:G+10}}function hY($){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)==="{{{"?"{{{":"{!!":"{{",K=Q?z==="{{{"?"}}}":"!!}":"}}",q=G+z.length,W=uY($,q,K);if(W===-1){J=G+1;continue}let U=$.slice(q,W).trim(),H=W+K.length;Z.push({fullMatch:$.slice(G,H),expression:U,start:G,end:H,isRaw:Q}),J=H}return Z}function uY($,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 mY($){let Z=l5($);if(Z.length===0)return{baseExpression:"",filters:[]};let J=Z[0],X=[];for(let Y=1;Y<Z.length;Y++){let Q=dY(Z[Y]);if(Q)X.push(Q)}return{baseExpression:J,filters:X}}function dY($){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=D0(Z,"(",")",J);if(Q===-1)return{name:X,args:[]};let G=Z.slice(Y,Q),z=W7(G);return{name:X,args:z}}function W7($){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 lY($,Z){let J=Z;while(J<$.length&&/\s/.test($[J]))J++;if($[J]!=="(")return null;let X=D0($,"(",")",J);if(X===-1)return null;return{params:$.slice(J+1,X),endPos:X+1}}function cY($){let Z=[],X=new d5($).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 K=z.value;if(Y++,Y>=X.length)break;let q=X[Y];if(q.type==="IDENTIFIER"){let W=q.value;if(Y++,Y<X.length&&X[Y].type==="OPERATOR"&&X[Y].value==="="){Y++;let U=Y<X.length?X[Y].start:$.length,H=K7(X,Y,$);Y=H.nextIndex,Z.push({type:"variable",name:W,value:$.slice(U,H.endPos),exported:G,start:z.start,end:H.endPos})}}else if(q.type==="PUNCTUATION"&&(q.value==="{"||q.value==="[")){let W=q.start,U=q.value==="{"?"}":"]",H=D0($,q.value,U,W);if(H!==-1){let j=$.slice(W,H+1);if(Y=q7(X,H+1),Y<X.length&&X[Y].type==="OPERATOR"&&X[Y].value==="="){Y++;let B=Y<X.length?X[Y].start:$.length,V=K7(X,Y,$);Y=V.nextIndex;let _=`__stx_destructured_${Z.length}`;Z.push({type:"variable",name:_,value:`${$.slice(B,V.endPos)}; ${K} ${j} = ${_}`,exported:G,start:z.start,end:V.endPos})}}}}else if(z.type==="IDENTIFIER"&&z.value==="function"){let K=G?X[Y-1].start:z.start;if(Y++,Y>=X.length)break;let q=X[Y];if(q.type==="IDENTIFIER"){let W=q.value;Y++;let U=-1;while(Y<X.length){if(X[Y].type==="PUNCTUATION"&&X[Y].value==="{"){U=X[Y].start;break}Y++}if(U!==-1){let H=D0($,"{","}",U);if(H!==-1)Z.push({type:"function",name:W,value:$.slice(K,H+1).replace(/^export\s+/,""),exported:G,start:K,end:H+1}),Y=q7(X,H+1)}}}else Y++}return Z}function K7($,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 q7($,Z){for(let J=0;J<$.length;J++)if($[J].start>=Z)return J;return $.length}function pY($,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=m5(X,G);if(!z)break;try{let K;if(B0(z.expression))K=H0(z.expression,Object.keys(Z))(...Object.values(Z));else K=Q0(z.expression,Z);let q="",W=!1;for(let U of z.cases)if(U.type==="default"){if(!W)q=U.content.trim()}else try{let H;if(U.value&&B0(U.value))H=H0(U.value,Object.keys(Z))(...Object.values(Z));else if(U.value)H=Q0(U.value,Z);if(K===H){q=U.content.trim(),W=!0;break}}catch{continue}X=X.substring(0,G)+q+X.substring(z.end),Y=!0}catch(K){let q=K instanceof Error?K.message:String(K),W=R0("Switch",`Error evaluating @switch expression: ${q}`,w0.EVALUATION_ERROR);X=X.substring(0,G)+W+X.substring(z.end);break}}return X}function iY($){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 nY($,Z){if(Z.length===0)return $;return $.replace(/\u0000stx-script-(\d+)\u0000/g,(J,X)=>Z[Number(X)]??J)}function e0($,Z,J){let{masked:X,scripts:Y}=iY($);return nY(sY(X,Z,J),Y)}function sY($,Z,J){let X=$;X=pY(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,K=q1(X,z+7);if(!K)break;let q=K.endPos,W=F1(X,"unless","endunless",q);if(W===-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 U=X.slice(q,W),H=K.expression,j=-1;{let V=0,_=/@(?:if|unless)\s*\(/g,L=/@(?:endif|endunless)(?![a-z])/g,F=/@else(?![a-z])/g,O=[],w;while((w=_.exec(U))!==null)O.push({pos:w.index,type:"open"});while((w=L.exec(U))!==null)O.push({pos:w.index,type:"close"});while((w=F.exec(U))!==null)O.push({pos:w.index,type:"else"});O.sort((R,D)=>R.pos-D.pos);for(let R of O)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=U.slice(0,j),_=U.slice(j+5);B=`@if (${H})${_}@else ${V}@endif`}else B=`@if (!(${H}))${U}@endif`;X=X.substring(0,z)+B+X.substring(W+10),Q=!0}}X=p5(X,Z,J),X=i5(X,Z,J),X=c5(X,Z);let Y=()=>{let Q=D2(X);if(Q.length===0)return!1;let G=Array(Q.length);for(let q=Q.length-1;q>=0;q--){let W=Q[q];try{let U="",H=!1;for(let j of W.branches){if(H)break;if(j.type==="else")U=j.content,H=!0;else try{let B;if(j.condition&&B0(j.condition))B=H0(j.condition,Object.keys(Z))(...Object.values(Z));else if(j.condition)B=Q0(j.condition,Z);if(B)U=j.content,H=!0}catch(B){U=R0(j.type==="if"?"If":"Elseif",`Error in @${j.type}(${j.condition}): ${B instanceof Error?B.message:String(B)}`,w0.EVALUATION_ERROR),H=!0}}G[q]=U}catch(U){let H=U instanceof Error?U.message:String(U);G[q]=R0("If",`Error processing @if block: ${H}`,w0.EVALUATION_ERROR)}}let z=Array(Q.length*2+1),K=0;for(let q=0;q<Q.length;q++){let W=Q[q];z[q*2]=X.slice(K,W.start),z[q*2+1]=G[q],K=W.end}return z[Q.length*2]=X.slice(K),X=z.join(""),!0};while(!0){let Q=X;if(!Y())break;if(X===Q)break}return X}function U7($){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 c5($,Z){let J=$;function X(z,K,q,W){let U=1,H=W,j=new RegExp(`@${K}(?:\\s*\\(|\\s|$)`,"g"),B=new RegExp(`@${q}(?![a-z])`,"g");while(H<z.length&&U>0){j.lastIndex=H,B.lastIndex=H;let V=j.exec(z),_=B.exec(z),L=V?V.index:1/0,F=_?_.index:1/0;if(L<F)U++,H=L+V[0].length;else if(F<1/0){if(U--,U===0)return F;H=F+_[0].length}else break}return-1}function Y(z,K,q){let W=0,U=new RegExp(`@${K}(?:\\s*\\(|\\s|$)`,"g"),H=new RegExp(`@${q}(?![a-z])`,"g"),j=/@else(?![a-z])/g,B=[],V;while((V=U.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((_,L)=>_.pos-L.pos);for(let _ of B)if(_.type==="open")W++;else if(_.type==="close")W--;else if(_.type==="else"&&W===0)return _.pos;return-1}{let z=!0;while(z){z=!1;let K=J.match(/@auth(?:\s*\(|\s|(?=\n))/);if(!K||K.index===void 0)break;let q=K.index,W,U,H=J.slice(q+5),j=U7(H);if(j)W=j.value,U=q+5+j.consumed;else U=q+5;let B=X(J,"auth","endauth",U);if(B===-1){console.warn(`[stx] @auth directive at position ${q} has no matching @endauth \u2014 the block was skipped.`);break}let V=J.slice(U,B),_=Y(V,"auth","endauth"),L;if(!Z.auth)L=!1;else L=W?K1(`auth?.check && auth?.user?.[${W}]`,Z):K1("auth?.check",Z);let F;if(_!==-1){let O=V.slice(0,_),w=V.slice(_+5);F=L?O:w}else F=L?V:"";J=J.substring(0,q)+F+J.substring(B+8),z=!0}}{let z=!0;while(z){z=!1;let K=J.match(/@guest(?:\s*\(|\s|(?=\n))/);if(!K||K.index===void 0)break;let q=K.index,W,U,H=J.slice(q+6),j=U7(H);if(j)W=j.value,U=q+6+j.consumed;else U=q+6;let B=X(J,"guest","endguest",U);if(B===-1){console.warn(`[stx] @guest directive at position ${q} has no matching @endguest \u2014 the block was skipped.`);break}let V=J.slice(U,B),_=Y(V,"guest","endguest"),L;if(!Z.auth)L=!0;else L=W?K1(`!auth?.check || !auth?.user?.[${W}]`,Z):K1("!auth?.check",Z);let F;if(_!==-1){let O=V.slice(0,_),w=V.slice(_+5);F=L?O:w}else F=L?V:"";J=J.substring(0,q)+F+J.substring(B+9),z=!0}}function Q(z,K,q){if(Z.userCan&&typeof Z.userCan[z]==="boolean")return Z.userCan[z];if(Z.permissions?.check&&typeof Z.permissions.check==="function")try{let W=[z];if(K)W.push(K);if(q){let U=K1(q,Z);W.push(U)}return Z.permissions.check(...W)}catch{return!1}return!1}function G(z){let K=z.match(/^\s*\(\s*'([^']*)'(?:,\s*'([^']*)')?(?:,\s*([^)]*))?\)/);if(!K)return null;return{ability:K[1],type:K[2],id:K[3]?.trim(),paramsEnd:K[0].length}}for(let z of["can","cannot"]){let K=`end${z}`,q=z==="can"?"elsecan":"elsecannot",W=!0;while(W){W=!1;let U=J.match(new RegExp(`@${z}\\s*\\(`));if(!U||U.index===void 0)break;let H=U.index,j=J.slice(H+`@${z}`.length),B=G(j);if(!B)break;let V=H+`@${z}`.length+B.paramsEnd,_=X(J,z,K,V);if(_===-1){console.warn(`[stx] @${z} directive at position ${H} has no matching @${K} \u2014 the block was skipped.`);break}let L=J.slice(V,_),F=[],O=0,w=new RegExp(`@${z}\\s*\\(`,"g"),R=new RegExp(`@${K}(?![a-z])`,"g"),D=new RegExp(`@${q}\\s*\\(`,"g"),N=/@else(?![a-z])/g,I=[],M;while((M=w.exec(L))!==null)I.push({pos:M.index,type:"open"});while((M=R.exec(L))!==null)I.push({pos:M.index,type:"close"});while((M=D.exec(L))!==null)I.push({pos:M.index,type:"elseDirective"});while((M=N.exec(L))!==null)I.push({pos:M.index,type:"else"});I.sort((b,y)=>b.pos-y.pos);for(let b of I){if(b.type==="open"){O++;continue}if(b.type==="close"){O--;continue}if(O===0)F.push(b)}let T=[],k=0;for(let b=0;b<F.length;b++){let y=F[b];if(T.push({content:L.slice(k,y.pos),ability:void 0}),y.type==="elseDirective"){let P=L.slice(y.pos+`@${q}`.length),u=G(P);if(u){T[T.length-1]={content:L.slice(k,y.pos)},k=y.pos+`@${q}`.length+u.paramsEnd,T.push({content:"",ability:u.ability,type:u.type,id:u.id}),T.pop();let p=F[b+1],m=p?p.pos:L.length;T.push({content:L.slice(k,m),ability:u.ability,type:u.type,id:u.id}),k=m}}else k=y.pos+5}if(k<L.length){let b=T[T.length-1];if(F.length>0&&F[F.length-1].type==="else")T.push({content:L.slice(k),isFinalElse:!0});else if(T.length===0)T.push({content:L.slice(k)})}let A=Q(B.ability,B.type,B.id),E=z==="can"?A:!A,C="";if(E)C=T[0]?.content||"";else{let b=!1;for(let y=1;y<T.length;y++){let P=T[y];if(P.isFinalElse){C=P.content,b=!0;break}if(P.ability){let u=Q(P.ability,P.type,P.id);if(z==="can"?u:!u){C=P.content,b=!0;break}}}if(!b&&T.length>0){let y=T[T.length-1];if(y.isFinalElse)C=y.content}}J=J.substring(0,H)+C+J.substring(_+`@${K}`.length),W=!0}}return J}function p5($,Z,J){let X=$;function Y(Q,G,z,K,q){let W=!0;while(W){W=!1;let U=new RegExp(`@${G}\\s*\\(`),H=Q.match(U);if(!H||H.index===void 0)break;let j=H.index,B=q1(Q,j+`@${G}`.length);if(!B)break;let V=B.endPos,_=F1(Q,G,z,V);if(_===-1){console.warn(`[stx] @${G} directive at position ${j} has no matching @${z} \u2014 the block was skipped.`);break}let L=Q.slice(V,_),F=B.expression,O=-1,w=0,R=0;while(R<L.length){let D=L.indexOf("@",R);if(D===-1)break;let N=L.substring(D);if(/^@(?:if|unless|isset|empty)\s*\(/.test(N)){w++,R=D+1;continue}if(/^@(?:endif|endunless|endisset|endempty)(?![a-z])/.test(N)){w--,R=D+1;continue}if(w===0&&/^@else(?![a-z])/.test(N)){O=D;break}R=D+1}try{let D=K(F.trim()),N;if(O!==-1){let I=L.slice(0,O),M=L.slice(O+5);N=D?I:M}else N=D?L:"";Q=Q.substring(0,j)+N+Q.substring(_+`@${z}`.length),W=!0}catch(D){let N=D instanceof Error?D.message:String(D),I=R0(q,`Error processing @${G} directive: ${N}`,w0.EVALUATION_ERROR);Q=Q.substring(0,j)+I+Q.substring(_+`@${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 i5($,Z,J){let X=$,Y="development";function Q(G,z,K,q){let W=new RegExp(`@${z}(?![a-z])`,"g"),U=new RegExp(`@${K}(?![a-z])`,"g"),H=new RegExp(`^@${z}(?![a-z])`),j=new RegExp(`^@${K}(?![a-z])`),B=G,V=!0;while(V){V=!1,W.lastIndex=0;let _=W.exec(B);if(!_)break;let L=_.index,F=L+_[0].length;if(z==="env"){let A=B.substring(F).match(/^\s*\(\s*(['"])([^'"]+)\1\s*\)/);if(!A)break;F+=A[0].length,q=Y===A[2]}let O=1,w=F,R=-1;while(O>0&&w<B.length){W.lastIndex=w,U.lastIndex=w;let A=W.exec(B),E=U.exec(B),C=A?A.index:1/0,b=E?E.index:1/0;if(C<b)O++,w=C+A[0].length;else if(b<1/0){if(O--,O===0){R=b;break}w=b+E[0].length}else break}if(R===-1){console.warn(`[stx] @${z} directive at position ${L} has no matching @${K} \u2014 the block was skipped.`);break}let D=B.substring(F,R),N=-1,I=0,M=0;while(M<D.length){let A=D.indexOf("@",M);if(A===-1)break;let E=D.substring(A);if(H.test(E)){I++,M=A+1;continue}if(j.test(E)){I--,M=A+1;continue}if(I===0&&/^@else(?![a-z])/.test(E)){N=A;break}M=A+1}let T;if(N!==-1){let A=D.slice(0,N),E=D.slice(N+5);T=q?A:E}else T=q?D:"";let k=`@${K}`.length;B=B.substring(0,L)+T+B.substring(R+k),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 H7($=16){let Z=new Uint8Array($);return crypto.getRandomValues(Z),btoa(String.fromCharCode(...Z))}function w1($,Z){if(!$)return Z?.nonceGenerator?.()??H7();let J=n5.get($);if(!J)J=Z?.nonceGenerator?.()??H7(),n5.set($,J);return J}function uH($){n5.delete($)}function j7($,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 o5($,Z){return`<meta http-equiv="Content-Security-Policy" content="${j7($,Z).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}">`}var oY={"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},s5={"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},rY={"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'"]},aY={"default-src":["'none'"],"frame-ancestors":["'none'"]};function mH($){return{enabled:!0,directives:{strict:oY,moderate:s5,relaxed:rY,api:aY}[$]||s5,useNonce:$==="strict",addMetaTag:!0}}function dH($,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:[],K=[...new Set([...z,...Y])];J[Q]=K}}return J}function B7($,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=o5(Z.directives,X);return $.replace(/<head([^>]*)>/,`<head$1>
3171
+ ${Y}`)}function V7($,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 L7($,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 o5(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 tY={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 o5(Q.directives,G)},hasEndTag:!1,description:"Insert Content-Security-Policy meta tag"},eY={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 lH(){return[tY,eY]}function cH($){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 $Q($=!1){return $?"Content-Security-Policy-Report-Only":"Content-Security-Policy"}function pH($,Z){if(!$.enabled)return{};let J=$.useNonce?w1(Z,$):void 0,X=j7($.directives,J);return{[$Q($.reportOnly)]:X}}var iH={enabled:!1,reportOnly:!1,directives:s5,useNonce:!1,addMetaTag:!0};import ZQ from"crypto";var JQ=40,_7="_token",r5=null;function XQ($=JQ){let Z=ZQ.randomBytes(Math.ceil($/2)).toString("hex").slice(0,$);return r5=Z,Z}function YQ(){if(!r5)XQ();return r5}function QQ($=_7){let Z=YQ();return`<input type="hidden" name="${$}" value="${Z}">`}function O7($){return $.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(Z,J,X)=>{return QQ(X||_7)})}async function R7($,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 GQ(Y,Q,Z,J,X);else Y=await zQ(Y,Q,Z,J,X)}return Y}async function GQ($,Z,J,X,Y){let{name:Q,handler:G}=Z,z=`@${Q}`,K=`@end${Q}`,q=$,W=R1(`${z}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${K}`,"g"),U=[],H=W.exec(q);while(H!==null){let[j,B="",V=""]=H,_=H.index||0;try{let L=B?D7(Z,B):[],F=V.trim(),O=await G(F,L,J,X);U.push({original:j,processed:O,startIndex:_})}catch(L){let F=L instanceof Error?L.message:String(L);if(Y.debug)console.error(`Error processing custom directive @${Q}:`,L);U.push({original:j,processed:R0("CustomDirective",`Error in @${Q}${B?`(${B})`:""}: ${F}`,w0.EVALUATION_ERROR),startIndex:_})}H=W.exec(q)}for(let j=U.length-1;j>=0;j--){let{original:B,processed:V}=U[j];q=q.replace(B,V)}return q}async function zQ($,Z,J,X,Y){let{name:Q,handler:G}=Z,z=$,K=[],q=[];if(Z.rawParams){for(let H of F7(z,R1(`(?<![\\w$@])@${Q}\\s*\\(`,"g")))if(H.end!==-1)q.push({fullMatch:H.call,paramString:H.args,startIndex:H.start})}else{let H=R1(`@${Q}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g");H.lastIndex=0;let j=H.exec(z);while(j!==null)q.push({fullMatch:j[0],paramString:j[1]??"",startIndex:j.index||0}),j=H.exec(z)}for(let{fullMatch:H,paramString:j,startIndex:B}of q)try{let V=D7(Z,j),_=await G("",V,J,X);K.push({original:H,processed:_,startIndex:B})}catch(V){let _=V instanceof Error?V.message:String(V);if(Y.debug)console.error(`Error processing custom directive @${Q}:`,V);K.push({original:H,processed:R0("CustomDirective",`Error in @${Q}(${j}): ${_}`,w0.EVALUATION_ERROR),startIndex:B})}let W=R1(`@${Q}(?!\\w)(?!\\s*\\()`,"g"),U=W.exec(z);while(U!==null){let[H]=U,j=U.index||0;try{let B=await G("",[],J,X);K.push({original:H,processed:B,startIndex:j})}catch(B){let V=B instanceof Error?B.message:String(B);if(Y.debug)console.error(`Error processing custom directive @${Q}:`,B);K.push({original:H,processed:R0("CustomDirective",`Error in @${Q}: ${V}`,w0.EVALUATION_ERROR),startIndex:j})}U=W.exec(z)}for(let H=K.length-1;H>=0;H--){let{original:j,processed:B}=K[H];z=z.replace(j,B)}return z}function D7($,Z){return $.rawParams?w7(Z):KQ(Z)}function KQ($){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 N7=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,M7=/^[A-Za-z_$][\w$]*$/,qQ=new Set(["light","dark","system"]);function D1($,Z){if(typeof $!=="string"||$.length===0)throw Error(`@appearanceBootstrap ${Z} must be a non-empty string`)}function WQ($){if(!$||typeof $!=="object"||Array.isArray($))throw Error("@appearanceBootstrap expects an options object");let Z=$,J=Z.appearance,X=Z.colorMode;if(D1(Z.storageKey,"storageKey"),J!==void 0&&(!J||typeof J!=="object"||Array.isArray(J)))throw Error("@appearanceBootstrap appearance must be an object when given");if(!X||typeof X!=="object"||Array.isArray(X))throw Error("@appearanceBootstrap colorMode must be an object");if(D1(X.key,"colorMode.key"),D1(X.attribute,"colorMode.attribute"),D1(X.default,"colorMode.default"),!M7.test(X.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!N7.test(X.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!qQ.has(X.default))throw Error("@appearanceBootstrap colorMode.default must be light, dark, or system");let Y=null;if(J){if(D1(J.key,"appearance.key"),D1(J.attribute,"appearance.attribute"),D1(J.default,"appearance.default"),!M7.test(J.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!N7.test(J.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!Array.isArray(J.allowed)||J.allowed.length===0||J.allowed.some((Q)=>typeof Q!=="string"||Q.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");Y={key:J.key,attribute:J.attribute,allowed:[...new Set(J.allowed)],default:J.default}}return{storageKey:Z.storageKey,appearance:Y,colorMode:{key:X.key,attribute:X.attribute,default:X.default},respectExisting:Z.respectExisting===!0}}function UQ($){return JSON.stringify($).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function HQ($){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${UQ($)};const root=document.documentElement;const MODES=["light","dark","system"];let format="json";const forced=(function(){const found={colorMode:null,appearance:null};if(!config.respectExisting)return found;try{const mode=root.getAttribute("data-"+config.colorMode.attribute);if(mode==="light"||mode==="dark")found.colorMode=mode;if(config.appearance){const name=root.getAttribute("data-"+config.appearance.attribute);if(config.appearance.allowed.includes(name))found.appearance=name}}catch{}return found}());function read(){let stored={};try{const raw=localStorage.getItem(config.storageKey);if(raw){let parsed=null;try{parsed=JSON.parse(raw)}catch{parsed=raw}if(parsed&&typeof parsed==="object"&&!Array.isArray(parsed)){stored=parsed;format="json"}else if(typeof parsed==="string"&&MODES.includes(parsed)){stored={};stored[config.colorMode.key]=parsed;format="string"}}}catch{}return stored}function write(stored){try{if(format==="string"&&!config.appearance)localStorage.setItem(config.storageKey,stored[config.colorMode.key]);else localStorage.setItem(config.storageKey,JSON.stringify(stored))}catch{}}function resolve(){const stored=read();const state={colorMode:forced.colorMode||(MODES.includes(stored[config.colorMode.key])?stored[config.colorMode.key]:config.colorMode.default)};if(config.appearance)state.appearance=forced.appearance||(config.appearance.allowed.includes(stored[config.appearance.key])?stored[config.appearance.key]:config.appearance.default);return state}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());if(config.appearance)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,forced:forced,read:read,resolve:resolve,apply:apply,setColorMode:function(mode){return store(config.colorMode.key,MODES,mode)},setAppearance:function(name){return config.appearance?store(config.appearance.key,config.appearance.allowed,name):apply()},watchSystem:function(){try{matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(){if(resolve().colorMode==="system")apply()})}catch{}}};apply()}());</script>`}function jQ($,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 A7($,Z){let J=$,X=/@appearanceBootstrap\s*\(/g,Y;while((Y=X.exec(J))!==null){let Q=Y.index+Y[0].length-1,G=jQ(J,Q);if(G===-1)throw Error("@appearanceBootstrap has an unclosed options object");let z=J.slice(Q+1,G).trim(),K=Q0(`(${z})`,Z),q=HQ(WQ(K));J=J.slice(0,Y.index)+q+J.slice(G+1),X.lastIndex=Y.index+q.length}return J}import BQ from"crypto";function N0($){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 VQ($){return{...t5,...$.forms?.classes}}function _9($,Z,J,X){let Y=$||Z;return J?`${Y} ${X}`:Y}function h0($){return String($).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function u1($,Z){if(/\bid\s*=/i.test($))return"";return` id="${N0(Z)}"`}function a5($,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="${N0(`${h0($)}-error`)}"`;return X}function LQ(){return BQ.randomUUID()}function Yj($,Z,J,X){let Y=VQ(X),Q=$;return Q=OQ(Q,Z),Q=A2(Q,Z),Q=e5(Q,Z,Y),Q=$$(Q,Z,Y),Q}function A2($,Z){let J=$;return J=J.replace(/@csrf/g,()=>{if(!Z.csrf||typeof Z.csrf!=="object"){let X=LQ();Z.csrf={token:X}}if(Z.csrf.field)return Z.csrf.field;if(Z.csrf.token)return`<input type="hidden" name="_token" value="${N0(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="${N0(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,K,q="")=>{let W=Q||G||"POST",U=z||K||"",H=W1(q),j=W.toUpperCase(),B=["GET","POST"].includes(j)?j:"POST",V=`<form method="${N0(B)}" action="${N0(U)}"${H?` ${H}`:""}>`;if(V+=`
3172
3172
  ${A2("@csrf",Z)}`,!["GET","POST"].includes(j))V+=`
3173
- ${A2(`@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,K,q="")=>{let W=Q||G||"",U=z||K||"",H=W1(q),j=N2(W,Z),B=j!==void 0&&j!==null?j:U||"",V=H.match(/type=['"]([^'"]+)['"]/i),_=V?V[1]:"text",L=M2(W,Z),F=H.match(/class=['"]([^'"]+)['"]/i),O=_9(F?F[1]:"",J.input,L,J.inputError),w=H.replace(/class=['"][^'"]+['"]/i,"");return w=w.replace(/type=['"][^'"]+['"]/i,""),`<input type="${N0(_)}" name="${N0(W)}"${u1(H,h0(W))} value="${N0(B)}" class="${O}"${a5(W,L,H)}${w?` ${w}`:""}>`}),X=X.replace(/@textarea\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endtextarea/g,(Y,Q,G="",z="")=>{let K=W1(G),q=N2(Q,Z)||z.trim(),W=M2(Q,Z),U=K.match(/class=['"]([^'"]+)['"]/i),H=_9(U?U[1]:"",J.input,W,J.inputError),j=K.replace(/class=['"][^'"]+['"]/i,"");return`<textarea name="${N0(Q)}"${u1(K,h0(Q))} class="${H}"${a5(Q,W,K)}${j?` ${j}`:""}>${N0(q)}</textarea>`}),X=X.replace(/@select\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endselect/g,(Y,Q,G="",z)=>{let K=W1(G),q=N2(Q,Z),W=M2(Q,Z),U=K.match(/class=['"]([^'"]+)['"]/i),H=_9(U?U[1]:"",J.input,W,J.inputError),j=K.replace(/class=['"][^'"]+['"]/i,""),B=z;if(q!==void 0)B=z.replace(/(<option[^>]*value=['"]([^'"]+)['"][^>]*>)/gi,(V,_,L)=>{if((Array.isArray(q)?q.some((O)=>String(O)===L):String(q)===L)&&!_.includes("selected"))return _.replace(/(<option)/,"$1 selected");return V});return`<select name="${N0(Q)}"${u1(K,h0(Q))} class="${H}"${a5(Q,W,K)}${j?` ${j}`:""}>${B}</select>`}),X=X.replace(/@checkbox\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?(?:,\s*\{([^}]+)\})?\)/g,(Y,Q,G,z="")=>{let K=G===void 0?"1":G,q=G===void 0?h0(Q):`${h0(Q)}-${h0(K)}`,W=W1(z),U=N2(Q,Z),H=U!==void 0&&(Array.isArray(U)?U.some((_)=>String(_)===K):U===!0||String(U)===K),j=W.match(/class=['"]([^'"]+)['"]/i),B=j?j[1]:J.checkInput,V=W.replace(/class=['"][^'"]+['"]/i,"");return`<input type="checkbox" name="${N0(Q)}"${u1(W,q)} value="${N0(K)}" class="${B}"${H?" checked":""}${V?` ${V}`:""}>`}),X=X.replace(/@radio\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(Y,Q,G,z="")=>{let K=W1(z),q=N2(Q,Z),W=q!==void 0&&q===G,U=K.match(/class=['"]([^'"]+)['"]/i),H=U?U[1]:J.checkInput,j=K.replace(/class=['"][^'"]+['"]/i,"");return`<input type="radio" name="${N0(Q)}"${u1(K,`${h0(Q)}-${h0(G)}`)} value="${N0(G)}" class="${H}"${W?" checked":""}${j?` ${j}`:""}>`}),X=X.replace(/@file\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(Y,Q,G="")=>{let z=W1(G),K=z.match(/accept=['"]([^'"]+)['"]/i),q=K?K[1]:"",W=z.includes("multiple"),U=M2(Q,Z),H=z.match(/class=['"]([^'"]+)['"]/i),j=_9(H?H[1]:"",J.input,U,J.inputError),B=z.replace(/class=['"][^'"]+['"]/gi,"").replace(/accept=['"][^'"]+['"]/gi,"").replace(/\bmultiple\b/gi,"").trim(),V=[`<input type="file" name="${N0(Q)}"${u1(z,h0(Q))}`,`class="${j}"`];if(q)V.push(`accept="${N0(q)}"`);if(W)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 K=W1(G),q=K.match(/class=['"]([^'"]+)['"]/i),W=q?q[1]:J.label,U=K.replace(/class=['"][^'"]+['"]/i,"");return`<label for="${N0(h0(Q))}" class="${W}"${U?` ${U}`:""}>${z}</label>`}),X}function $$($,Z,J=t5){return $.replace(/@error\(['"]([^'"]+)['"]\)([\s\S]*?)@enderror/g,(X,Y,Q)=>{try{if(M2(Y,Z)){let G=Q.replace(/\{\{([^}]+)\}\}/g,(z,K)=>{try{if(K.trim()==="$message"||K.trim()==="message")return I7(Y,Z);if(K.trim().includes("errors.first")||K.trim().includes("$errors.first")){if(typeof Z.errors?.first==="function")return Z.errors.first(Y);return I7(Y,Z)}let q=K.trim();if(B0(q)){let W=Q0(q,Z);return W!==void 0?String(W):q}return q}catch{return K}});return`<div id="${N0(`${h0(Y)}-error`)}" role="alert">${G}</div>`}return""}catch(G){return console.error("Error processing @error directive:",G),X}})}function M2($,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 I7($,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 N2($,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 T7={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 Yj($,Z){T7[$]=Z}function Z$($){let[Z,...J]=$.split(":"),X=J.length>0?J.join(":").split(","):[];return{name:Z.trim(),params:X}}function _Q($,Z,J,X={}){let Y=[],Q=J.split("|").map((G)=>G.trim()).filter(Boolean);for(let G of Q){let z=Z$(G),K=T7[z.name];if(!K){console.warn(`Unknown validation rule: ${z.name}`);continue}if(z.name==="confirmed"){let W=`${$}_confirmation`;z.params=[X[W]]}let q=K(Z,z.params||[],$);if(q)Y.push(z.message||q)}return{field:$,valid:Y.length===0,errors:Y}}function Qj($,Z){let J={};for(let[X,Y]of Object.entries(Z)){let Q=_Q(X,$[X],Y,$);if(!Q.valid)J[X]=Q.errors}return J}function OQ($,Z){return $.replace(/@validate\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]*)\})?\s*\)/g,(J,X,Y,Q)=>{let G=Y.split("|").map((K)=>K.trim()),z=[];for(let K of G){let q=Z$(K);switch(q.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"'),q.name==="integer")z.push('step="1"');break;case"min":if(q.params?.[0])z.push(`minlength="${q.params[0]}"`);break;case"max":if(q.params?.[0])z.push(`maxlength="${q.params[0]}"`);break;case"regex":if(q.params?.[0])z.push(`pattern="${q.params[0]}"`);break}}return`<!-- @validate:${X}:${Y} -->${z.length>0?`<!-- attrs:${z.join(" ")} -->`:""}`})}var k7={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 Gj($){k7[$.name]=$}function FQ($,Z,J={}){let X=[],Y=Z.split("|").map((Q)=>Q.trim());for(let Q of Y){let G=Z$(Q),z=k7[G.name];if(!z){console.warn(`Unknown validation rule: ${G.name}`);continue}let K=z.validate($,G.params||[],J);if(K!==!0)X.push(K)}return{valid:X.length===0,errors:X}}function zj($,Z){let J={},X=!0;for(let[Y,Q]of Object.entries(Z)){let G=FQ($[Y],Q,$);if(!G.valid)X=!1,J[Y]=G.errors}return{valid:X,errors:J}}function Kj($,Z){let J=JSON.stringify(Z);return`
3173
+ ${A2(`@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,K,q="")=>{let W=Q||G||"",U=z||K||"",H=W1(q),j=N2(W,Z),B=j!==void 0&&j!==null?j:U||"",V=H.match(/type=['"]([^'"]+)['"]/i),_=V?V[1]:"text",L=M2(W,Z),F=H.match(/class=['"]([^'"]+)['"]/i),O=_9(F?F[1]:"",J.input,L,J.inputError),w=H.replace(/class=['"][^'"]+['"]/i,"");return w=w.replace(/type=['"][^'"]+['"]/i,""),`<input type="${N0(_)}" name="${N0(W)}"${u1(H,h0(W))} value="${N0(B)}" class="${O}"${a5(W,L,H)}${w?` ${w}`:""}>`}),X=X.replace(/@textarea\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endtextarea/g,(Y,Q,G="",z="")=>{let K=W1(G),q=N2(Q,Z)||z.trim(),W=M2(Q,Z),U=K.match(/class=['"]([^'"]+)['"]/i),H=_9(U?U[1]:"",J.input,W,J.inputError),j=K.replace(/class=['"][^'"]+['"]/i,"");return`<textarea name="${N0(Q)}"${u1(K,h0(Q))} class="${H}"${a5(Q,W,K)}${j?` ${j}`:""}>${N0(q)}</textarea>`}),X=X.replace(/@select\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endselect/g,(Y,Q,G="",z)=>{let K=W1(G),q=N2(Q,Z),W=M2(Q,Z),U=K.match(/class=['"]([^'"]+)['"]/i),H=_9(U?U[1]:"",J.input,W,J.inputError),j=K.replace(/class=['"][^'"]+['"]/i,""),B=z;if(q!==void 0)B=z.replace(/(<option[^>]*value=['"]([^'"]+)['"][^>]*>)/gi,(V,_,L)=>{if((Array.isArray(q)?q.some((O)=>String(O)===L):String(q)===L)&&!_.includes("selected"))return _.replace(/(<option)/,"$1 selected");return V});return`<select name="${N0(Q)}"${u1(K,h0(Q))} class="${H}"${a5(Q,W,K)}${j?` ${j}`:""}>${B}</select>`}),X=X.replace(/@checkbox\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?(?:,\s*\{([^}]+)\})?\)/g,(Y,Q,G,z="")=>{let K=G===void 0?"1":G,q=G===void 0?h0(Q):`${h0(Q)}-${h0(K)}`,W=W1(z),U=N2(Q,Z),H=U!==void 0&&(Array.isArray(U)?U.some((_)=>String(_)===K):U===!0||String(U)===K),j=W.match(/class=['"]([^'"]+)['"]/i),B=j?j[1]:J.checkInput,V=W.replace(/class=['"][^'"]+['"]/i,"");return`<input type="checkbox" name="${N0(Q)}"${u1(W,q)} value="${N0(K)}" class="${B}"${H?" checked":""}${V?` ${V}`:""}>`}),X=X.replace(/@radio\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(Y,Q,G,z="")=>{let K=W1(z),q=N2(Q,Z),W=q!==void 0&&q===G,U=K.match(/class=['"]([^'"]+)['"]/i),H=U?U[1]:J.checkInput,j=K.replace(/class=['"][^'"]+['"]/i,"");return`<input type="radio" name="${N0(Q)}"${u1(K,`${h0(Q)}-${h0(G)}`)} value="${N0(G)}" class="${H}"${W?" checked":""}${j?` ${j}`:""}>`}),X=X.replace(/@file\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(Y,Q,G="")=>{let z=W1(G),K=z.match(/accept=['"]([^'"]+)['"]/i),q=K?K[1]:"",W=z.includes("multiple"),U=M2(Q,Z),H=z.match(/class=['"]([^'"]+)['"]/i),j=_9(H?H[1]:"",J.input,U,J.inputError),B=z.replace(/class=['"][^'"]+['"]/gi,"").replace(/accept=['"][^'"]+['"]/gi,"").replace(/\bmultiple\b/gi,"").trim(),V=[`<input type="file" name="${N0(Q)}"${u1(z,h0(Q))}`,`class="${j}"`];if(q)V.push(`accept="${N0(q)}"`);if(W)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 K=W1(G),q=K.match(/class=['"]([^'"]+)['"]/i),W=q?q[1]:J.label,U=K.replace(/class=['"][^'"]+['"]/i,"");return`<label for="${N0(h0(Q))}" class="${W}"${U?` ${U}`:""}>${z}</label>`}),X}function $$($,Z,J=t5){return $.replace(/@error\(['"]([^'"]+)['"]\)([\s\S]*?)@enderror/g,(X,Y,Q)=>{try{if(M2(Y,Z)){let G=Q.replace(/\{\{([^}]+)\}\}/g,(z,K)=>{try{if(K.trim()==="$message"||K.trim()==="message")return I7(Y,Z);if(K.trim().includes("errors.first")||K.trim().includes("$errors.first")){if(typeof Z.errors?.first==="function")return Z.errors.first(Y);return I7(Y,Z)}let q=K.trim();if(B0(q)){let W=Q0(q,Z);return W!==void 0?String(W):q}return q}catch{return K}});return`<div id="${N0(`${h0(Y)}-error`)}" role="alert">${G}</div>`}return""}catch(G){return console.error("Error processing @error directive:",G),X}})}function M2($,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 I7($,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 N2($,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 T7={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 Qj($,Z){T7[$]=Z}function Z$($){let[Z,...J]=$.split(":"),X=J.length>0?J.join(":").split(","):[];return{name:Z.trim(),params:X}}function _Q($,Z,J,X={}){let Y=[],Q=J.split("|").map((G)=>G.trim()).filter(Boolean);for(let G of Q){let z=Z$(G),K=T7[z.name];if(!K){console.warn(`Unknown validation rule: ${z.name}`);continue}if(z.name==="confirmed"){let W=`${$}_confirmation`;z.params=[X[W]]}let q=K(Z,z.params||[],$);if(q)Y.push(z.message||q)}return{field:$,valid:Y.length===0,errors:Y}}function Gj($,Z){let J={};for(let[X,Y]of Object.entries(Z)){let Q=_Q(X,$[X],Y,$);if(!Q.valid)J[X]=Q.errors}return J}function OQ($,Z){return $.replace(/@validate\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]*)\})?\s*\)/g,(J,X,Y,Q)=>{let G=Y.split("|").map((K)=>K.trim()),z=[];for(let K of G){let q=Z$(K);switch(q.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"'),q.name==="integer")z.push('step="1"');break;case"min":if(q.params?.[0])z.push(`minlength="${q.params[0]}"`);break;case"max":if(q.params?.[0])z.push(`maxlength="${q.params[0]}"`);break;case"regex":if(q.params?.[0])z.push(`pattern="${q.params[0]}"`);break}}return`<!-- @validate:${X}:${Y} -->${z.length>0?`<!-- attrs:${z.join(" ")} -->`:""}`})}var k7={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 zj($){k7[$.name]=$}function FQ($,Z,J={}){let X=[],Y=Z.split("|").map((Q)=>Q.trim());for(let Q of Y){let G=Z$(Q),z=k7[G.name];if(!z){console.warn(`Unknown validation rule: ${G.name}`);continue}let K=z.validate($,G.params||[],J);if(K!==!0)X.push(K)}return{valid:X.length===0,errors:X}}function Kj($,Z){let J={},X=!0;for(let[Y,Q]of Object.entries(Z)){let G=FQ($[Y],Q,$);if(!G.valid)X=!1,J[Y]=G.errors}return{valid:X,errors:J}}function qj($,Z){let J=JSON.stringify(Z);return`
3174
3174
  <script>
3175
3175
  (function() {
3176
3176
  const form = document.getElementById('${$}');
@@ -3222,7 +3222,7 @@ catch { return 'Please enter a valid URL'; } },
3222
3222
  }
3223
3223
  });
3224
3224
  })();
3225
- </script>`.trim()}var I2=/<\/?template\b[^>]*>/gi,wQ=/(?:^|\s)(?:id\s*=|(?:x-|[@:])(?:for|if|else(?:-if)?)(?=\s|=|$)|#[\w-]+(?:\s*=|\s|$)|v-slot(?::[\w-]+)?(?=\s|=|$)|slot\s*=)/i;function RQ($){let Z=$.replace(/^<template\b/i,"").replace(/>$/,"");return wQ.test(Z)}function O9($){I2.lastIndex=0;let Z;while((Z=I2.exec($))!==null){if(Z[0].startsWith("</")||RQ(Z[0]))continue;let J=Z.index,X=I2.lastIndex,Y=1,Q;while((Q=I2.exec($))!==null)if(Q[0].startsWith("</")){if(Y--,Y===0){let G=Q.index;return{start:J,openEnd:X,closeStart:G,end:I2.lastIndex,content:$.slice(X,G)}}}else Y++;return null}return null}import K0 from"path";import{existsSync as ZG}from"fs";W5();import F9 from"fs";import L0 from"path";var E7=new Map;function w9($,Z=!0){let J=E7.get($);if(Z&&J)return J;let X=new Map,Y=[L0.join($,"src"),L0.join($,"dist"),$];function Q(G,z){if(z>6)return;let K;try{K=F9.readdirSync(G,{withFileTypes:!0})}catch{return}for(let q of K){let W=L0.join(G,q.name);if(q.isDirectory()){if(q.name==="node_modules"||q.name.startsWith("."))continue;Q(W,z+1)}else if(q.isFile()&&q.name.endsWith(".stx")){let U=q.name.slice(0,-4);if(!X.has(U))X.set(U,W);let H=U.toLowerCase();if(!X.has(H))X.set(H,W);let j=U.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();if(!X.has(j))X.set(j,W)}}}for(let G of Y)if(Q(G,0),X.size>0)break;if(Z)E7.set($,X);return X}function R9($,Z){if($.startsWith(".")||$.startsWith("/"))return null;let J=Z;while(!0){let X=L0.join(J,"node_modules",$);try{if(F9.statSync(X).isDirectory())return X}catch{}let Y=L0.dirname(J);if(Y===J)return null;J=Y}}function D9($,Z,J={}){return[L0.resolve(L0.dirname(Z),`${$}.stx`),L0.resolve(L0.dirname(Z),$),L0.resolve(J.componentsDir||"components",`${$}.stx`),L0.resolve(J.componentsDir||"components",$),$.endsWith(".stx")?$:`${$}.stx`]}function y7($){let Z=$.endsWith(".stx")?$.slice(0,-4):$,J=Z.split("-").map((Y)=>Y.charAt(0).toUpperCase()+Y.slice(1)).join(""),X=Z.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return[Z,J,X]}function J$($,Z){let[J,X,Y]=y7($);for(let Q of[J,J.toLowerCase(),X,Y]){let G=Z?.__importedComponents?.get(Q);if(G!==void 0)return G}}function*X$($,Z,J={},X){let Y=y7($);if(Y[0].startsWith("./")||Y[0].startsWith("../")){yield L0.resolve(L0.dirname(Z),`${Y[0]}.stx`);return}let Q=[...new Set(Y.map((K)=>`${K}.stx`))],G=J.projectRoot||process.cwd(),z=[...X?.__originalFilePath?[L0.join(L0.dirname(X.__originalFilePath),"components")]:[],...J.componentsDir?[J.componentsDir]:[],L0.join(L0.dirname(Z),"components"),L0.resolve(G,"src/components"),L0.resolve(G,"components"),...import.meta.dir?[L0.resolve(import.meta.dir,"components")]:[]];for(let K of new Set(z)){for(let q of Q)yield L0.join(K,q);try{for(let q of F9.readdirSync(K,{withFileTypes:!0}))if(q.isDirectory())for(let W of Q)yield L0.join(K,q.name,W)}catch{}}}function b7($,Z,J={},X){let Y=J$($,X);if(Y!==void 0)return Y;for(let Q of X$($,Z,J,X))try{if(F9.statSync(Q,{throwIfNoEntry:!1})?.isFile())return Q}catch{}return null}class S7{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=J$($,X);if(Y!==void 0)return Y;for(let Q of X$($,Z,J,X))if(await $0(Q))return Q;return null}}var m1=new S7;function A0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var N1="\x00stx-boolean-attribute";function Y$($){return $.indexOf("\x00")===-1?$:$.replace(/\0/g,"")}function d1($,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(A0(Q));continue}if(Y===N1){J.push(A0(Q));continue}J.push(`${A0(Q)}="${A0(Y$(String(Y)))}"`)}return J}function l1($,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(A0(Q));continue}if(typeof Y==="object")continue;J.push(`${A0(Q)}="${A0(Y$(String(Y)))}"`)}return J}function c1($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function DQ($){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 Q$={name:"StxLink",aliases:["stx-link"],render($,Z,J){let X=DQ($),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,K=[];if(X.reactive)K.push(`:href="${c1(X.value)}"`);else K.push(`href="${c1(q2(X.value,"navigable"))}"`);if(Y)K.push(`class="${c1(Y)}"`);if(K.push("data-stx-link"),K.push(`data-stx-active-class="${c1(Q)}"`),K.push(`data-stx-exact-active-class="${c1(G)}"`),z)K.push("data-stx-prefetch");let q=typeof $.static.activeMatch==="string"?$.static.activeMatch.trim():"";if(q)K.push(`data-stx-active-match="${c1(q)}"`);let W=new Set(["to","class","className","activeClass","exactActiveClass","activeMatch","prefetch"]);return K.push(...d1($,W)),K.push(...l1($,W)),`<a ${K.join(" ")}>${Z}</a>`}};import p1 from"fs";import G$ from"path";var NQ=new Set([".jpg",".jpeg",".png",".webp",".avif"]),i0=new Map,M1=!1;function z$($){if(!$)return;let Z=$.split("?")[0].split("#")[0];return i0.get(Z)}function Ej(){return M1}function yj(){i0.clear(),M1=!1}function bj($,Z){i0.set($,Z),M1=!0}function MQ($){for(let Z=3;Z<$.length;Z+=4)if($[Z]<255)return!0;return!1}function AQ($){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 IQ($,Z,J,X=4,Y=3){let Q=[];for(let G=0;G<Y;G++)for(let z=0;z<X;z++){let K=Math.floor(z*Z/X),q=Math.max(K+1,Math.floor((z+1)*Z/X)),W=Math.floor(G*J/Y),U=Math.max(W+1,Math.floor((G+1)*J/Y)),H=0,j=0,B=0,V=0;for(let L=W;L<U;L++)for(let F=K;F<q;F++){let O=(L*Z+F)*4;H+=$[O],j+=$[O+1],B+=$[O+2],V++}let _=(L)=>Math.round(L/V).toString(16).padStart(2,"0");Q.push(`<rect x="${z}" y="${G}" width="1" height="1" fill="#${_(H)}${_(j)}${_(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 TQ($){return`data:image/svg+xml;base64,${Buffer.from($,"utf8").toString("base64")}`}function kQ($){try{return JSON.parse(p1.readFileSync($,"utf8"))}catch{return{}}}function EQ($,Z){try{p1.mkdirSync(G$.dirname($),{recursive:!0}),p1.writeFileSync($,JSON.stringify(Z))}catch{}}function x7($,Z,J=[]){let X;try{X=p1.readdirSync($,{withFileTypes:!0})}catch{return J}for(let Y of X){let Q=G$.join($,Y.name);if(Y.isDirectory()){x7(Q,`${Z}/${Y.name}`,J);continue}if(!NQ.has(G$.extname(Y.name).toLowerCase()))continue;J.push([`${Z}/${Y.name}`,Q])}return J}async function Sj($,Z={}){let{cachePath:J,maxBytes:X=33554432,limit:Y=2000,offThread:Q}=Z;if(!$||!p1.existsSync($))return M1=!0,i0.size;if(Q){let H=await v7("placeholders",{publicDir:$,options:{cachePath:J,maxBytes:X,limit:Y}});if(H!==P7){for(let[j,B]of H.placeholders)i0.set(j,B);return M1=!0,i0.size}}let G;try{G=await import("ts-images")}catch{return M1=!0,i0.size}let z=J?kQ(J):{},K=!1,q=x7($,"").slice(0,Y),W=8,U=async([H,j])=>{let B;try{B=p1.statSync(j)}catch{return}if(B.size>X)return;let V=z[H];if(V&&V.mtimeMs===B.mtimeMs&&V.size===B.size){let _=V.transparent;if(typeof _!=="boolean"&&C7(j)==="none")_=!1,z[H]={...V,transparent:_},K=!0;if(typeof _==="boolean"){i0.set(H,{dataUrl:V.dataUrl,color:V.color,transparent:_});return}}try{let{hash:_}=await G.generateThumbHash(j);if(!_)return;let{rgba:L,w:F,h:O}=G.thumbHashToRGBA(_),w={dataUrl:TQ(IQ(L,F,O)),color:AQ(L),transparent:MQ(L)};i0.set(H,w),z[H]={mtimeMs:B.mtimeMs,size:B.size,...w},K=!0}catch{}};for(let H=0;H<q.length;H+=W)await Promise.all(q.slice(H,H+W).map(U));if(J&&K)EQ(J,z);return M1=!0,i0.size}var yQ={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},K$=[320,640,768,1024,1280,1536,1920];function O0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function E0($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let J=$.static[Z];if(typeof J==="string")return J;return}function N9($,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 bQ($){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 q$($){if($.includes("(")||$.includes(","))return $;let Z=$.trim().split(/\s+/),J=[];for(let X of Z)if(X.includes(":")){let[Y,Q]=X.split(":"),G=yQ[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 W$($,Z,J,X){return Z.map((Y)=>`${T2($,Y,void 0,J,X)} ${Y}w`).join(", ")}function SQ($,Z,J,X,Y){return Z.map((Q)=>{let G=J?J*Q:void 0;return`${T2($,G,void 0,X,Y)} ${Q}x`}).join(", ")}function T2($,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 CQ($){return`var s=this.style;${$.map((Z)=>`s.${Z}=''`).join(";")}`}function PQ($,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 U$={name:"StxImage",aliases:["Image","stx-image","stx-img"],render($,Z,J){let X=E0($,"src")||"",Y=f7(X),Q=E0($,"alt")||"",G=E0($,"width")||(Y?String(Y.source.width):void 0),z=E0($,"height")||(Y?String(Y.source.height):void 0),K=E0($,"sizes"),q=E0($,"srcset"),W=E0($,"densities"),U=E0($,"format"),H=g7(X)||z$(X)?.transparent===!0,j=E0($,"placeholder")||(Y&&!H?"thumbhash":void 0),B=E0($,"placeholderColor")||"#e5e7eb",V=E0($,"provider"),_=E0($,"class")||E0($,"className")||"",L=E0($,"style")||"",F=E0($,"quality"),O=N9($,"lazy",!0),w=N9($,"preload",!1),R=N9($,"priority",!1),D=E0($,"loading"),N=E0($,"decoding")||"async",I=!!Y||N9($,"picture",!1)||!!U,M=G?Number.parseInt(G):void 0,T=z?Number.parseInt(z):void 0,k=q||"",A="";if(Y)k=Y.sources[Y.fallback.format]||"",A=K?q$(K):"100vw";else if(!k&&K&&V&&V!=="local"&&V!=="static")k=W$(X,K$,V,U),A=q$(K);else if(!k&&W){let r=W.split(/\s+/).map((J0)=>Number.parseFloat(J0.replace("x","")));k=SQ(X,r,M,V,U)}else if(K)A=q$(K);let E=[];if(L)E.push(L);if(M&&T)E.push(`aspect-ratio:${M}/${T}`);let C=[],b=j==="blur"||j==="color"||j==="thumbhash";if(b&&!H){let r=Y?.placeholder?{dataUrl:Y.placeholder.dataUrl,color:B}:z$(X);if(r&&j==="color")E.push(`background-color:${r.color}`),C.push("backgroundColor");else if(r)E.push(`background-color:${r.color}`),E.push(`background-image:url(${r.dataUrl})`),E.push("background-size:cover"),E.push("background-repeat:no-repeat"),C.push("backgroundColor","backgroundImage");else{let J0=PQ(M||16,T||9,B);E.push(`background-image:url(${J0})`),E.push("background-size:cover"),E.push("background-repeat:no-repeat"),C.push("backgroundImage")}}else if(!b&&j&&j!=="empty"&&j!=="none")E.push(`background-image:url(${O0(j)})`),E.push("background-size:cover"),E.push("background-repeat:no-repeat"),C.push("backgroundImage");let y=Y?.fallback.url||T2(X,M,T,V,U),P=[];if(P.push(`src="${O0(q2(y,"fetched"))}"`),P.push(`alt="${O0(Q)}"`),G)P.push(`width="${O0(G)}"`);if(z)P.push(`height="${O0(z)}"`);let u=D||(R||w?"eager":O?"lazy":"");if(u)P.push(`loading="${O0(u)}"`);if(R)P.push('fetchpriority="high"');if(P.push(`decoding="${O0(N)}"`),_)P.push(`class="${O0(_)}"`);if(E.length>0)P.push(`style="${O0(E.join(";"))}"`);if(k)P.push(`srcset="${O0(q2(k,"fetched"))}"`);if(A)P.push(`sizes="${O0(A)}"`);let p=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","format","provider","quality","densities","preload","priority","picture","loading","decoding"]);if(C.length>0){let r=typeof $.static.onload==="string"?$.static.onload:"",J0=CQ(C)+(r?`;${r}`:"");P.push(`onload="${O0(J0)}"`),p.add("onload")}P.push(...d1($,p)),P.push(...l1($,p));let m=`<img ${P.join(" ")} />`,X0="";if(w){let J0=U==="webp"?"image/webp":U==="avif"?"image/avif":"";X0=`<link rel="preload" as="image" href="${O0(y)}"${J0?` type="${J0}"`:""}${k?` imagesrcset="${O0(k)}"`:""}${A?` imagesizes="${O0(A)}"`:""} />
3225
+ </script>`.trim()}var I2=/<\/?template\b[^>]*>/gi,wQ=/(?:^|\s)(?:id\s*=|(?:x-|[@:])(?:for|if|else(?:-if)?)(?=\s|=|$)|#[\w-]+(?:\s*=|\s|$)|v-slot(?::[\w-]+)?(?=\s|=|$)|slot\s*=)/i;function RQ($){let Z=$.replace(/^<template\b/i,"").replace(/>$/,"");return wQ.test(Z)}function O9($){I2.lastIndex=0;let Z;while((Z=I2.exec($))!==null){if(Z[0].startsWith("</")||RQ(Z[0]))continue;let J=Z.index,X=I2.lastIndex,Y=1,Q;while((Q=I2.exec($))!==null)if(Q[0].startsWith("</")){if(Y--,Y===0){let G=Q.index;return{start:J,openEnd:X,closeStart:G,end:I2.lastIndex,content:$.slice(X,G)}}}else Y++;return null}return null}import K0 from"path";import{existsSync as ZG}from"fs";W5();import F9 from"fs";import L0 from"path";var E7=new Map;function w9($,Z=!0){let J=E7.get($);if(Z&&J)return J;let X=new Map,Y=[L0.join($,"src"),L0.join($,"dist"),$];function Q(G,z){if(z>6)return;let K;try{K=F9.readdirSync(G,{withFileTypes:!0})}catch{return}for(let q of K){let W=L0.join(G,q.name);if(q.isDirectory()){if(q.name==="node_modules"||q.name.startsWith("."))continue;Q(W,z+1)}else if(q.isFile()&&q.name.endsWith(".stx")){let U=q.name.slice(0,-4);if(!X.has(U))X.set(U,W);let H=U.toLowerCase();if(!X.has(H))X.set(H,W);let j=U.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();if(!X.has(j))X.set(j,W)}}}for(let G of Y)if(Q(G,0),X.size>0)break;if(Z)E7.set($,X);return X}function R9($,Z){if($.startsWith(".")||$.startsWith("/"))return null;let J=Z;while(!0){let X=L0.join(J,"node_modules",$);try{if(F9.statSync(X).isDirectory())return X}catch{}let Y=L0.dirname(J);if(Y===J)return null;J=Y}}function D9($,Z,J={}){return[L0.resolve(L0.dirname(Z),`${$}.stx`),L0.resolve(L0.dirname(Z),$),L0.resolve(J.componentsDir||"components",`${$}.stx`),L0.resolve(J.componentsDir||"components",$),$.endsWith(".stx")?$:`${$}.stx`]}function y7($){let Z=$.endsWith(".stx")?$.slice(0,-4):$,J=Z.split("-").map((Y)=>Y.charAt(0).toUpperCase()+Y.slice(1)).join(""),X=Z.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return[Z,J,X]}function J$($,Z){let[J,X,Y]=y7($);for(let Q of[J,J.toLowerCase(),X,Y]){let G=Z?.__importedComponents?.get(Q);if(G!==void 0)return G}}function*X$($,Z,J={},X){let Y=y7($);if(Y[0].startsWith("./")||Y[0].startsWith("../")){yield L0.resolve(L0.dirname(Z),`${Y[0]}.stx`);return}let Q=[...new Set(Y.map((K)=>`${K}.stx`))],G=J.projectRoot||process.cwd(),z=[...X?.__originalFilePath?[L0.join(L0.dirname(X.__originalFilePath),"components")]:[],...J.componentsDir?[J.componentsDir]:[],L0.join(L0.dirname(Z),"components"),L0.resolve(G,"src/components"),L0.resolve(G,"components"),...import.meta.dir?[L0.resolve(import.meta.dir,"components")]:[]];for(let K of new Set(z)){for(let q of Q)yield L0.join(K,q);try{for(let q of F9.readdirSync(K,{withFileTypes:!0}))if(q.isDirectory())for(let W of Q)yield L0.join(K,q.name,W)}catch{}}}function b7($,Z,J={},X){let Y=J$($,X);if(Y!==void 0)return Y;for(let Q of X$($,Z,J,X))try{if(F9.statSync(Q,{throwIfNoEntry:!1})?.isFile())return Q}catch{}return null}class S7{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=J$($,X);if(Y!==void 0)return Y;for(let Q of X$($,Z,J,X))if(await $0(Q))return Q;return null}}var m1=new S7;function A0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var N1="\x00stx-boolean-attribute";function Y$($){return $.indexOf("\x00")===-1?$:$.replace(/\0/g,"")}function d1($,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(A0(Q));continue}if(Y===N1){J.push(A0(Q));continue}J.push(`${A0(Q)}="${A0(Y$(String(Y)))}"`)}return J}function l1($,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(A0(Q));continue}if(typeof Y==="object")continue;J.push(`${A0(Q)}="${A0(Y$(String(Y)))}"`)}return J}function c1($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function DQ($){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 Q$={name:"StxLink",aliases:["stx-link"],render($,Z,J){let X=DQ($),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,K=[];if(X.reactive)K.push(`:href="${c1(X.value)}"`);else K.push(`href="${c1(q2(X.value,"navigable"))}"`);if(Y)K.push(`class="${c1(Y)}"`);if(K.push("data-stx-link"),K.push(`data-stx-active-class="${c1(Q)}"`),K.push(`data-stx-exact-active-class="${c1(G)}"`),z)K.push("data-stx-prefetch");let q=typeof $.static.activeMatch==="string"?$.static.activeMatch.trim():"";if(q)K.push(`data-stx-active-match="${c1(q)}"`);let W=new Set(["to","class","className","activeClass","exactActiveClass","activeMatch","prefetch"]);return K.push(...d1($,W)),K.push(...l1($,W)),`<a ${K.join(" ")}>${Z}</a>`}};import p1 from"fs";import G$ from"path";var NQ=new Set([".jpg",".jpeg",".png",".webp",".avif"]),i0=new Map,M1=!1;function z$($){if(!$)return;let Z=$.split("?")[0].split("#")[0];return i0.get(Z)}function yj(){return M1}function bj(){i0.clear(),M1=!1}function Sj($,Z){i0.set($,Z),M1=!0}function MQ($){for(let Z=3;Z<$.length;Z+=4)if($[Z]<255)return!0;return!1}function AQ($){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 IQ($,Z,J,X=4,Y=3){let Q=[];for(let G=0;G<Y;G++)for(let z=0;z<X;z++){let K=Math.floor(z*Z/X),q=Math.max(K+1,Math.floor((z+1)*Z/X)),W=Math.floor(G*J/Y),U=Math.max(W+1,Math.floor((G+1)*J/Y)),H=0,j=0,B=0,V=0;for(let L=W;L<U;L++)for(let F=K;F<q;F++){let O=(L*Z+F)*4;H+=$[O],j+=$[O+1],B+=$[O+2],V++}let _=(L)=>Math.round(L/V).toString(16).padStart(2,"0");Q.push(`<rect x="${z}" y="${G}" width="1" height="1" fill="#${_(H)}${_(j)}${_(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 TQ($){return`data:image/svg+xml;base64,${Buffer.from($,"utf8").toString("base64")}`}function kQ($){try{return JSON.parse(p1.readFileSync($,"utf8"))}catch{return{}}}function EQ($,Z){try{p1.mkdirSync(G$.dirname($),{recursive:!0}),p1.writeFileSync($,JSON.stringify(Z))}catch{}}function x7($,Z,J=[]){let X;try{X=p1.readdirSync($,{withFileTypes:!0})}catch{return J}for(let Y of X){let Q=G$.join($,Y.name);if(Y.isDirectory()){x7(Q,`${Z}/${Y.name}`,J);continue}if(!NQ.has(G$.extname(Y.name).toLowerCase()))continue;J.push([`${Z}/${Y.name}`,Q])}return J}async function Cj($,Z={}){let{cachePath:J,maxBytes:X=33554432,limit:Y=2000,offThread:Q}=Z;if(!$||!p1.existsSync($))return M1=!0,i0.size;if(Q){let H=await v7("placeholders",{publicDir:$,options:{cachePath:J,maxBytes:X,limit:Y}});if(H!==P7){for(let[j,B]of H.placeholders)i0.set(j,B);return M1=!0,i0.size}}let G;try{G=await import("ts-images")}catch{return M1=!0,i0.size}let z=J?kQ(J):{},K=!1,q=x7($,"").slice(0,Y),W=8,U=async([H,j])=>{let B;try{B=p1.statSync(j)}catch{return}if(B.size>X)return;let V=z[H];if(V&&V.mtimeMs===B.mtimeMs&&V.size===B.size){let _=V.transparent;if(typeof _!=="boolean"&&C7(j)==="none")_=!1,z[H]={...V,transparent:_},K=!0;if(typeof _==="boolean"){i0.set(H,{dataUrl:V.dataUrl,color:V.color,transparent:_});return}}try{let{hash:_}=await G.generateThumbHash(j);if(!_)return;let{rgba:L,w:F,h:O}=G.thumbHashToRGBA(_),w={dataUrl:TQ(IQ(L,F,O)),color:AQ(L),transparent:MQ(L)};i0.set(H,w),z[H]={mtimeMs:B.mtimeMs,size:B.size,...w},K=!0}catch{}};for(let H=0;H<q.length;H+=W)await Promise.all(q.slice(H,H+W).map(U));if(J&&K)EQ(J,z);return M1=!0,i0.size}var yQ={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},K$=[320,640,768,1024,1280,1536,1920];function O0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function E0($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let J=$.static[Z];if(typeof J==="string")return J;return}function N9($,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 bQ($){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 q$($){if($.includes("(")||$.includes(","))return $;let Z=$.trim().split(/\s+/),J=[];for(let X of Z)if(X.includes(":")){let[Y,Q]=X.split(":"),G=yQ[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 W$($,Z,J,X){return Z.map((Y)=>`${T2($,Y,void 0,J,X)} ${Y}w`).join(", ")}function SQ($,Z,J,X,Y){return Z.map((Q)=>{let G=J?J*Q:void 0;return`${T2($,G,void 0,X,Y)} ${Q}x`}).join(", ")}function T2($,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 CQ($){return`var s=this.style;${$.map((Z)=>`s.${Z}=''`).join(";")}`}function PQ($,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 U$={name:"StxImage",aliases:["Image","stx-image","stx-img"],render($,Z,J){let X=E0($,"src")||"",Y=f7(X),Q=E0($,"alt")||"",G=E0($,"width")||(Y?String(Y.source.width):void 0),z=E0($,"height")||(Y?String(Y.source.height):void 0),K=E0($,"sizes"),q=E0($,"srcset"),W=E0($,"densities"),U=E0($,"format"),H=g7(X)||z$(X)?.transparent===!0,j=E0($,"placeholder")||(Y&&!H?"thumbhash":void 0),B=E0($,"placeholderColor")||"#e5e7eb",V=E0($,"provider"),_=E0($,"class")||E0($,"className")||"",L=E0($,"style")||"",F=E0($,"quality"),O=N9($,"lazy",!0),w=N9($,"preload",!1),R=N9($,"priority",!1),D=E0($,"loading"),N=E0($,"decoding")||"async",I=!!Y||N9($,"picture",!1)||!!U,M=G?Number.parseInt(G):void 0,T=z?Number.parseInt(z):void 0,k=q||"",A="";if(Y)k=Y.sources[Y.fallback.format]||"",A=K?q$(K):"100vw";else if(!k&&K&&V&&V!=="local"&&V!=="static")k=W$(X,K$,V,U),A=q$(K);else if(!k&&W){let r=W.split(/\s+/).map((J0)=>Number.parseFloat(J0.replace("x","")));k=SQ(X,r,M,V,U)}else if(K)A=q$(K);let E=[];if(L)E.push(L);if(M&&T)E.push(`aspect-ratio:${M}/${T}`);let C=[],b=j==="blur"||j==="color"||j==="thumbhash";if(b&&!H){let r=Y?.placeholder?{dataUrl:Y.placeholder.dataUrl,color:B}:z$(X);if(r&&j==="color")E.push(`background-color:${r.color}`),C.push("backgroundColor");else if(r)E.push(`background-color:${r.color}`),E.push(`background-image:url(${r.dataUrl})`),E.push("background-size:cover"),E.push("background-repeat:no-repeat"),C.push("backgroundColor","backgroundImage");else{let J0=PQ(M||16,T||9,B);E.push(`background-image:url(${J0})`),E.push("background-size:cover"),E.push("background-repeat:no-repeat"),C.push("backgroundImage")}}else if(!b&&j&&j!=="empty"&&j!=="none")E.push(`background-image:url(${O0(j)})`),E.push("background-size:cover"),E.push("background-repeat:no-repeat"),C.push("backgroundImage");let y=Y?.fallback.url||T2(X,M,T,V,U),P=[];if(P.push(`src="${O0(q2(y,"fetched"))}"`),P.push(`alt="${O0(Q)}"`),G)P.push(`width="${O0(G)}"`);if(z)P.push(`height="${O0(z)}"`);let u=D||(R||w?"eager":O?"lazy":"");if(u)P.push(`loading="${O0(u)}"`);if(R)P.push('fetchpriority="high"');if(P.push(`decoding="${O0(N)}"`),_)P.push(`class="${O0(_)}"`);if(E.length>0)P.push(`style="${O0(E.join(";"))}"`);if(k)P.push(`srcset="${O0(q2(k,"fetched"))}"`);if(A)P.push(`sizes="${O0(A)}"`);let p=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","format","provider","quality","densities","preload","priority","picture","loading","decoding"]);if(C.length>0){let r=typeof $.static.onload==="string"?$.static.onload:"",J0=CQ(C)+(r?`;${r}`:"");P.push(`onload="${O0(J0)}"`),p.add("onload")}P.push(...d1($,p)),P.push(...l1($,p));let m=`<img ${P.join(" ")} />`,X0="";if(w){let J0=U==="webp"?"image/webp":U==="avif"?"image/avif":"";X0=`<link rel="preload" as="image" href="${O0(y)}"${J0?` type="${J0}"`:""}${k?` imagesrcset="${O0(k)}"`:""}${A?` imagesizes="${O0(A)}"`:""} />
3226
3226
  `}if(I){let r=[];if(Y)for(let J0 of bQ(Y))r.push(`<source type="image/${J0.format}" srcset="${O0(J0.srcset)}"${A?` sizes="${O0(A)}"`:""} />`);if(!Y&&(U==="avif"||U==="auto")){let J0=T2(X,M,T,V,"avif"),i=k?W$(X,K$,V,"avif"):`${J0}`;r.push(`<source type="image/avif" srcset="${O0(i)}"${A?` sizes="${O0(A)}"`:""} />`)}if(!Y&&(U==="webp"||U==="auto")){let J0=T2(X,M,T,V,"webp"),i=k?W$(X,K$,V,"webp"):`${J0}`;r.push(`<source type="image/webp" srcset="${O0(i)}"${A?` sizes="${O0(A)}"`:""} />`)}return`${X0}<picture>
3227
3227
  ${r.join(`
3228
3228
  `)}
@@ -3403,9 +3403,9 @@ ${Y}
3403
3403
  } finally {
3404
3404
  if (typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxPrevEl;
3405
3405
  }
3406
- })();`}function KG($,Z){if(p0($)){let Y=p0($).tag.match(/data-stx-scope="([^"]*)"/);if(Y)return{html:$,mergedIntoExisting:Y[1],stamped:!0,root:"body"};return{html:x1($,(Q,G)=>`<body${G} data-stx-scope="${Z}">`),mergedIntoExisting:null,stamped:!0,root:"body"}}let J=$.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(J){let X=J[2]+J[3],Y=J[2].slice(1),Q=X.match(/data-stx-scope="([^"]*)"/);if(Q)return{html:$,mergedIntoExisting:Q[1],stamped:!0,root:Y};let G=J[1],z=J[2],K=J[3];return{html:`${G}${z} data-stx-scope="${Z}"${K}${$.slice(J[0].length)}`,mergedIntoExisting:null,stamped:!0,root:Y}}return{html:$,mergedIntoExisting:null,stamped:!1,root:null}}var B6=0,I$=new Set;function qV(){I$.clear()}function V6($){return/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test($)}var WV=new r1(500),_6=new Set;function UV(){_6.clear()}function qG($){if($.__onceStore instanceof Set)return $.__onceStore;return _6}async function T$($,Z,J,X,Y,Q=new Set){let G=X.partialsDir||K0.join(K0.dirname(J),"partials");if(G&&!K0.isAbsolute(G))G=K0.resolve(process.cwd(),G);let z=JG($,"@partial","@include"),K=qG(Z);z=z.replace(/@once([\s\S]*?)@endonce/g,(V,_,L)=>{let F=_.trim(),O=`${J}:${F}`;if(K.has(O))return"";return K.add(O),_});{let V=/@includeIf\s*\(/g,_;while((_=V.exec(z))!==null){let L=_.index,F=L+_[0].length-1,O=1,w=F+1;while(w<z.length&&O>0){if(z[w]==="(")O++;else if(z[w]===")")O--;w++}if(O!==0)break;let R=z.substring(F+1,w-1),D=R.match(/^\s*['"]([^'"]+)['"]/);if(!D){V.lastIndex=w;continue}let N=D[1],I=q(N,G,J),M="";if(I&&await Bun.file(I).exists())Y.add(I),M=`@include(${R})`;z=z.substring(0,L)+M+z.substring(w),V.lastIndex=0}}for(let[V,_]of[["@includeWhen",!1],["@includeUnless",!0]]){let L=new RegExp(`${V.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),F;while((F=L.exec(z))!==null){let O=F.index,w=O+F[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 N=z.substring(w+1,D-1),I=A$(N,0);if(I===-1){L.lastIndex=D;continue}let M=N.substring(0,I).trim(),T=N.substring(I+1).trim(),k=T.match(/^\s*['"]([^'"]+)['"]/);if(!k){L.lastIndex=D;continue}let A=k[1],E=T.substring(k[0].length),C,b=A$(E,0);if(b!==-1)C=E.substring(b+1).trim();try{let y=`Boolean(${M})`,P;if(B0(y)){let m=H0(y,Object.keys(Z));P=Boolean(m(...Object.values(Z)))}else P=Boolean(Q0(y,Z));let u=_?!P:P,p="";if(u){let m=q(A,G,J);if(m&&await Bun.file(m).exists())Y.add(m);p=`@include('${A}'${C?`, ${C}`:""})`}z=z.substring(0,O)+p+z.substring(D),L.lastIndex=0}catch(y){let P=y instanceof Error?y.message:String(y),u=_0("Include",`Error evaluating ${V} condition: ${P}`,J,$,O);z=z.substring(0,O)+u+z.substring(D),L.lastIndex=0}}}{let V=/@each\s*\(/g,_;while((_=V.exec(z))!==null){let L=_.index,F=L+_[0].length-1,O=1,w=F+1;while(w<z.length&&O>0){if(z[w]==="(")O++;else if(z[w]===")"){if(O--,O===0)break}w++}if(O!==0)break;let R=z.substring(F+1,w),D=z.substring(L,w+1),N=R.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!N){V.lastIndex=0,z=z.replace(D,"");continue}let[,I,M,T,k]=N;try{let A,E=M.trim();if(B0(E))A=H0(E,Object.keys(Z))(...Object.values(Z));else A=Q0(E,Z);let C="";if(Array.isArray(A)&&A.length>0)for(let b of A){let y={...Z,[T]:b},P=await H(I,y,$,L);C+=P}else if(k)C=await H(k,{},$,L);z=z.substring(0,L)+C+z.substring(w+1),V.lastIndex=0}catch(A){let E=A instanceof Error?A.message:String(A);z=z.substring(0,L)+_0("Each",`Error in @each: ${E}`,J,$,L)+z.substring(w+1),V.lastIndex=0}}}{let V=/@includeFirst\s*\(/g,_;while((_=V.exec(z))!==null){let L=_.index,F=L+_[0].length-1,O=1,w=F+1;while(w<z.length&&O>0){if(z[w]==="(")O++;else if(z[w]===")"){if(O--,O===0)break}w++}if(O!==0)break;let R=z.substring(F+1,w),D=z.substring(L,w+1),N=R.match(/^\s*(\[[^\]]+\])/);if(!N){V.lastIndex=0,z=z.replace(D,"");continue}let I=N[1],M=R.slice(N[0].length),T,k=M.match(/^\s*,\s*\{/);if(k){M=M.slice(k[0].length-1);let C=1,b=1;while(b<M.length&&C>0){if(M[b]==="{")C++;else if(M[b]==="}"){if(C--,C===0)break}b++}T=M.substring(0,b+1),M=M.slice(b+1)}let A,E=M.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(E)A=E[1];try{let C=JSON.parse(I.replace(/'/g,'"')),b={};if(T)try{b=l0(T,Z)}catch(P){let u=P instanceof Error?P.message:String(P);if(X.debug){let p=_0("Include",`Error parsing includeFirst variables: ${u}`,J,$,L,D);z=z.replace(D,()=>p)}else z=z.replace(D,()=>A||"");continue}let y=!1;for(let P of C){let u=q(P,G,J);if(!u)continue;if(await $0(u)){let p=await H(P,b,$,L);z=z.replace(D,()=>p),y=!0;break}}if(!y)if(A!==void 0)z=z.replace(D,()=>A);else if(X.debug){let P=_0("Include",`None of the includeFirst paths exist: ${I}`,J,$,L,D);z=z.replace(D,()=>P)}else z=z.replace(D,"")}catch(C){let b=C instanceof Error?C.message:String(C),y=_0("Include",`Error processing @includeFirst: ${b}`,J,$,L,D);z=z.replace(D,()=>y)}V.lastIndex=0}}function q(V,_,L){try{let F=V;if(!V.endsWith(".stx"))F=`${V}.stx`;let O=K0.resolve(_),w=K0.resolve(K0.dirname(L)),R;if(!F.startsWith("./")&&!F.startsWith("../")){for(let k of X._layerPartialDirs??[]){let A=K0.resolve(k,F);if(A.startsWith(`${K0.resolve(k)}${K0.sep}`)&&ZG(A))return A}R=K0.resolve(_,F)}else R=K0.resolve(w,F);let D=K0.normalize(R),N=D.startsWith(O+K0.sep)||D===O,I=D.startsWith(w+K0.sep)||D===w,M=!1,T=K0.dirname(w);if(D.startsWith(T+K0.sep)){if(!K0.relative(T,D).split(K0.sep).some((C)=>C.startsWith(".")&&C!=="."&&C!==".."))M=!0}if(!N&&!I&&!M)return console.error(`Security: Path traversal attempt blocked for include path: ${V}`),console.error(` Resolved to: ${D}`),console.error(` Allowed dirs: ${O}, ${w}`),null;return D}catch(F){return console.error(`Error resolving path ${V}: ${F}`),null}}let W=K0.resolve(J);Q.add(W);function U(V,_,L,F){return X.onIncludeError?.({includePath:V,templatePath:J,message:_,partialsDir:G}),_0("Include",_,J,L,F)}async function H(V,_={},L,F){let O=q(V,G,J);if(!O)return U(V,`Could not resolve path for include: ${V}`,L,F);let w=K0.resolve(O);if(Q.has(w)){let R=[...Q,w].map((D)=>K0.basename(D)).join(" -> ");return U(V,`Circular include detected: ${R}`,L,F)}try{Y.add(O);let R;if(!R)try{R=await Bun.file(O).text()}catch(i){let q0=i instanceof Error?i.message:String(i);return U(V,`Error loading include file ${V}: ${q0}`,L,F)}if(R)R=R.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(R&&R.includes("@stream")){let{processStreamDirectives:i}=await import("./chunk-cqn8qq4v.js");R=i(R,Z)}if(R&&(X.debug||!S2()&&!C2()))try{let{warnUnbalancedTags:i}=await import("./chunk-55d66wh7.js");i(R,O)}catch{}let D=R;try{let{processESImports:i}=await import("./chunk-fkht7kzs.js");await i(R,Z,O,X,Y)}catch(i){if(X.debug)console.warn(`[stx] partial ES import extraction skipped for ${O}:`,i instanceof Error?i.message:i)}let N=O9(D);if(N)D=N.content.trim();let M=R.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),T="";if(M)T=`<style${M[1]}>${M[2]}</style>`;let k=[];D=D.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(i,q0,a)=>{if(!V6(q0))return"";return k.push({attrs:q0,body:a}),`__STX_DATA_BLOCK_${k.length-1}__`}),D=D.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let A={...Z};A.__stx_signals_gate=Y1(R,O);for(let[i,q0]of Object.entries(_))A[i]=q0;let E=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,C=[...R.matchAll(E)],b="",y=null,P=!1;for(let i of C){let q0=i[1]||"",a=i[2]||"";if(V6(q0))continue;let V0=q0.includes("server"),o0=T1(q0);if(!V0&&a.trim()){let{interpolateScriptExpressions:g}=await import("./chunk-scn75qrm.js");a=g(a,A,V)}let u0="";try{let{extractAndStripCssImports:g,renderVendorStyleTags:l}=await import("./chunk-jmek11fc.js"),t=g(a,{filePath:O,projectRoot:process.cwd()});a=t.code,u0=l(t.styles)}catch(g){if(X.debug)console.warn(`[stx] vendor-css extractor skipped for ${O}:`,g instanceof Error?g.message:g)}if(o0&&a.trim())a=k1(a);if(!V0){try{let{injectBrowserCoreAutoImports:l}=await import("./chunk-jmek11fc.js");a=l(a).code;let{hasUserImports:t,bundleClientScript:T0}=await import("./chunk-mjdsjxm5.js");if(t(a))a=await T0(a,O,{projectRoot:process.cwd()})}catch(l){if(X.debug)console.warn(`[stx] bundler skipped for ${O}:`,l instanceof Error?l.message:l)}let{stripStxRuntimeImports:g}=await import("./chunk-1chgn7qv.js");a=g(a)}let r0=XG(a);if(r0&&!V0){P=!0,y=`stx_scope_${K0.basename(O,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++B6}`;let g=$1(a),l=j6(g,y);b+=`${u0}<script data-stx-scoped data-stx-run="always" data-stx-owner="${y}">${l}</script>
3407
- `;continue}if(V0)try{let{extractVariables:g}=await import("./chunk-n9wmhtap.js");await g(a,A,O)}catch(g){if(X.debug)console.warn(`Warning: Could not extract variables from server script in ${O}:`,g)}if(!V0&&!r0){let g=q0.replace(/\bclient\b/i,"").trim();y=`stx_scope_${K0.basename(O,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++B6}`;let l=$1(a),t=j6(l,y);b+=`${u0}<script data-stx-scoped data-stx-run="always" data-stx-owner="${y}"${g?` ${g}`:""}>${t}</script>
3408
- `}}if(k.length>0){let{interpolateScriptExpressions:i}=await import("./chunk-scn75qrm.js");D=D.replace(/__STX_DATA_BLOCK_(\d+)__/g,(q0,a)=>{let V0=k[Number(a)];return`<script${V0.attrs}>${i(V0.body,A,V)}</script>`})}if(y){let i=KG(D,y);if(D=i.html,i.mergedIntoExisting){let a=y,V0=i.mergedIntoExisting;b=b.split(`'${a}'`).join(`'${V0}'`).split(`"${a}"`).join(`"${V0}"`),y=V0}else if(!i.stamped&&P&&!I$.has(O))I$.add(O),console.warn(`[stx] ${K0.relative(process.cwd(),O)} 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.`);let q0=i.stamped&&i.root!==null&&b2(i.root);b=GG(b,q0?y:null)}if(D.includes("@include")||D.includes("@partial"))D=await T$(D,A,O,X,Y,Q);let{processLoops:u,reportDeferredLoopWarnings:p}=await import("./chunk-bgyh22e9.js"),m=u(D,A,O,void 0,!0);m=e0(m,A,O),m=p(m);let{processMetaDirectives:X0,processSeoDirective:r,processStructuredData:J0}=await import("./chunk-3t953qe0.js");if(m=X0(m,A,O,X),m=J0(m,A,O),m=r(m,A,O,X),m=L1(m,A,O),T)m+=`
3406
+ })();`}function KG($,Z){if(p0($)){let Y=p0($).tag.match(/data-stx-scope="([^"]*)"/);if(Y)return{html:$,mergedIntoExisting:Y[1],stamped:!0,root:"body"};return{html:x1($,(Q,G)=>`<body${G} data-stx-scope="${Z}">`),mergedIntoExisting:null,stamped:!0,root:"body"}}let J=$.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(J){let X=J[2]+J[3],Y=J[2].slice(1),Q=X.match(/data-stx-scope="([^"]*)"/);if(Q)return{html:$,mergedIntoExisting:Q[1],stamped:!0,root:Y};let G=J[1],z=J[2],K=J[3];return{html:`${G}${z} data-stx-scope="${Z}"${K}${$.slice(J[0].length)}`,mergedIntoExisting:null,stamped:!0,root:Y}}return{html:$,mergedIntoExisting:null,stamped:!1,root:null}}var B6=0,I$=new Set;function WV(){I$.clear()}function V6($){return/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test($)}var UV=new r1(500),_6=new Set;function HV(){_6.clear()}function qG($){if($.__onceStore instanceof Set)return $.__onceStore;return _6}async function T$($,Z,J,X,Y,Q=new Set){let G=X.partialsDir||K0.join(K0.dirname(J),"partials");if(G&&!K0.isAbsolute(G))G=K0.resolve(process.cwd(),G);let z=JG($,"@partial","@include"),K=qG(Z);z=z.replace(/@once([\s\S]*?)@endonce/g,(V,_,L)=>{let F=_.trim(),O=`${J}:${F}`;if(K.has(O))return"";return K.add(O),_});{let V=/@includeIf\s*\(/g,_;while((_=V.exec(z))!==null){let L=_.index,F=L+_[0].length-1,O=1,w=F+1;while(w<z.length&&O>0){if(z[w]==="(")O++;else if(z[w]===")")O--;w++}if(O!==0)break;let R=z.substring(F+1,w-1),D=R.match(/^\s*['"]([^'"]+)['"]/);if(!D){V.lastIndex=w;continue}let N=D[1],I=q(N,G,J),M="";if(I&&await Bun.file(I).exists())Y.add(I),M=`@include(${R})`;z=z.substring(0,L)+M+z.substring(w),V.lastIndex=0}}for(let[V,_]of[["@includeWhen",!1],["@includeUnless",!0]]){let L=new RegExp(`${V.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),F;while((F=L.exec(z))!==null){let O=F.index,w=O+F[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 N=z.substring(w+1,D-1),I=A$(N,0);if(I===-1){L.lastIndex=D;continue}let M=N.substring(0,I).trim(),T=N.substring(I+1).trim(),k=T.match(/^\s*['"]([^'"]+)['"]/);if(!k){L.lastIndex=D;continue}let A=k[1],E=T.substring(k[0].length),C,b=A$(E,0);if(b!==-1)C=E.substring(b+1).trim();try{let y=`Boolean(${M})`,P;if(B0(y)){let m=H0(y,Object.keys(Z));P=Boolean(m(...Object.values(Z)))}else P=Boolean(Q0(y,Z));let u=_?!P:P,p="";if(u){let m=q(A,G,J);if(m&&await Bun.file(m).exists())Y.add(m);p=`@include('${A}'${C?`, ${C}`:""})`}z=z.substring(0,O)+p+z.substring(D),L.lastIndex=0}catch(y){let P=y instanceof Error?y.message:String(y),u=_0("Include",`Error evaluating ${V} condition: ${P}`,J,$,O);z=z.substring(0,O)+u+z.substring(D),L.lastIndex=0}}}{let V=/@each\s*\(/g,_;while((_=V.exec(z))!==null){let L=_.index,F=L+_[0].length-1,O=1,w=F+1;while(w<z.length&&O>0){if(z[w]==="(")O++;else if(z[w]===")"){if(O--,O===0)break}w++}if(O!==0)break;let R=z.substring(F+1,w),D=z.substring(L,w+1),N=R.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!N){V.lastIndex=0,z=z.replace(D,"");continue}let[,I,M,T,k]=N;try{let A,E=M.trim();if(B0(E))A=H0(E,Object.keys(Z))(...Object.values(Z));else A=Q0(E,Z);let C="";if(Array.isArray(A)&&A.length>0)for(let b of A){let y={...Z,[T]:b},P=await H(I,y,$,L);C+=P}else if(k)C=await H(k,{},$,L);z=z.substring(0,L)+C+z.substring(w+1),V.lastIndex=0}catch(A){let E=A instanceof Error?A.message:String(A);z=z.substring(0,L)+_0("Each",`Error in @each: ${E}`,J,$,L)+z.substring(w+1),V.lastIndex=0}}}{let V=/@includeFirst\s*\(/g,_;while((_=V.exec(z))!==null){let L=_.index,F=L+_[0].length-1,O=1,w=F+1;while(w<z.length&&O>0){if(z[w]==="(")O++;else if(z[w]===")"){if(O--,O===0)break}w++}if(O!==0)break;let R=z.substring(F+1,w),D=z.substring(L,w+1),N=R.match(/^\s*(\[[^\]]+\])/);if(!N){V.lastIndex=0,z=z.replace(D,"");continue}let I=N[1],M=R.slice(N[0].length),T,k=M.match(/^\s*,\s*\{/);if(k){M=M.slice(k[0].length-1);let C=1,b=1;while(b<M.length&&C>0){if(M[b]==="{")C++;else if(M[b]==="}"){if(C--,C===0)break}b++}T=M.substring(0,b+1),M=M.slice(b+1)}let A,E=M.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(E)A=E[1];try{let C=JSON.parse(I.replace(/'/g,'"')),b={};if(T)try{b=l0(T,Z)}catch(P){let u=P instanceof Error?P.message:String(P);if(X.debug){let p=_0("Include",`Error parsing includeFirst variables: ${u}`,J,$,L,D);z=z.replace(D,()=>p)}else z=z.replace(D,()=>A||"");continue}let y=!1;for(let P of C){let u=q(P,G,J);if(!u)continue;if(await $0(u)){let p=await H(P,b,$,L);z=z.replace(D,()=>p),y=!0;break}}if(!y)if(A!==void 0)z=z.replace(D,()=>A);else if(X.debug){let P=_0("Include",`None of the includeFirst paths exist: ${I}`,J,$,L,D);z=z.replace(D,()=>P)}else z=z.replace(D,"")}catch(C){let b=C instanceof Error?C.message:String(C),y=_0("Include",`Error processing @includeFirst: ${b}`,J,$,L,D);z=z.replace(D,()=>y)}V.lastIndex=0}}function q(V,_,L){try{let F=V;if(!V.endsWith(".stx"))F=`${V}.stx`;let O=K0.resolve(_),w=K0.resolve(K0.dirname(L)),R;if(!F.startsWith("./")&&!F.startsWith("../")){for(let k of X._layerPartialDirs??[]){let A=K0.resolve(k,F);if(A.startsWith(`${K0.resolve(k)}${K0.sep}`)&&ZG(A))return A}R=K0.resolve(_,F)}else R=K0.resolve(w,F);let D=K0.normalize(R),N=D.startsWith(O+K0.sep)||D===O,I=D.startsWith(w+K0.sep)||D===w,M=!1,T=K0.dirname(w);if(D.startsWith(T+K0.sep)){if(!K0.relative(T,D).split(K0.sep).some((C)=>C.startsWith(".")&&C!=="."&&C!==".."))M=!0}if(!N&&!I&&!M)return console.error(`Security: Path traversal attempt blocked for include path: ${V}`),console.error(` Resolved to: ${D}`),console.error(` Allowed dirs: ${O}, ${w}`),null;return D}catch(F){return console.error(`Error resolving path ${V}: ${F}`),null}}let W=K0.resolve(J);Q.add(W);function U(V,_,L,F){return X.onIncludeError?.({includePath:V,templatePath:J,message:_,partialsDir:G}),_0("Include",_,J,L,F)}async function H(V,_={},L,F){let O=q(V,G,J);if(!O)return U(V,`Could not resolve path for include: ${V}`,L,F);let w=K0.resolve(O);if(Q.has(w)){let R=[...Q,w].map((D)=>K0.basename(D)).join(" -> ");return U(V,`Circular include detected: ${R}`,L,F)}try{Y.add(O);let R;if(!R)try{R=await Bun.file(O).text()}catch(i){let q0=i instanceof Error?i.message:String(i);return U(V,`Error loading include file ${V}: ${q0}`,L,F)}if(R)R=R.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(R&&R.includes("@stream")){let{processStreamDirectives:i}=await import("./chunk-arrjqs96.js");R=i(R,Z)}if(R&&(X.debug||!S2()&&!C2()))try{let{warnUnbalancedTags:i}=await import("./chunk-n1yz08j4.js");i(R,O)}catch{}let D=R;try{let{processESImports:i}=await import("./chunk-r7g4a7m3.js");await i(R,Z,O,X,Y)}catch(i){if(X.debug)console.warn(`[stx] partial ES import extraction skipped for ${O}:`,i instanceof Error?i.message:i)}let N=O9(D);if(N)D=N.content.trim();let M=R.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),T="";if(M)T=`<style${M[1]}>${M[2]}</style>`;let k=[];D=D.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(i,q0,a)=>{if(!V6(q0))return"";return k.push({attrs:q0,body:a}),`__STX_DATA_BLOCK_${k.length-1}__`}),D=D.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let A={...Z};A.__stx_signals_gate=Y1(R,O);for(let[i,q0]of Object.entries(_))A[i]=q0;let E=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,C=[...R.matchAll(E)],b="",y=null,P=!1;for(let i of C){let q0=i[1]||"",a=i[2]||"";if(V6(q0))continue;let V0=q0.includes("server"),o0=T1(q0);if(!V0&&a.trim()){let{interpolateScriptExpressions:g}=await import("./chunk-kjkkh5p6.js");a=g(a,A,V)}let u0="";try{let{extractAndStripCssImports:g,renderVendorStyleTags:l}=await import("./chunk-aa91fsxk.js"),t=g(a,{filePath:O,projectRoot:process.cwd()});a=t.code,u0=l(t.styles)}catch(g){if(X.debug)console.warn(`[stx] vendor-css extractor skipped for ${O}:`,g instanceof Error?g.message:g)}if(o0&&a.trim())a=k1(a);if(!V0){try{let{injectBrowserCoreAutoImports:l}=await import("./chunk-aa91fsxk.js");a=l(a).code;let{hasUserImports:t,bundleClientScript:T0}=await import("./chunk-4j9n5z1q.js");if(t(a))a=await T0(a,O,{projectRoot:process.cwd()})}catch(l){if(X.debug)console.warn(`[stx] bundler skipped for ${O}:`,l instanceof Error?l.message:l)}let{stripStxRuntimeImports:g}=await import("./chunk-fy5jfqwe.js");a=g(a)}let r0=XG(a);if(r0&&!V0){P=!0,y=`stx_scope_${K0.basename(O,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++B6}`;let g=$1(a),l=j6(g,y);b+=`${u0}<script data-stx-scoped data-stx-run="always" data-stx-owner="${y}">${l}</script>
3407
+ `;continue}if(V0)try{let{extractVariables:g}=await import("./chunk-w568cjw6.js");await g(a,A,O)}catch(g){if(X.debug)console.warn(`Warning: Could not extract variables from server script in ${O}:`,g)}if(!V0&&!r0){let g=q0.replace(/\bclient\b/i,"").trim();y=`stx_scope_${K0.basename(O,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++B6}`;let l=$1(a),t=j6(l,y);b+=`${u0}<script data-stx-scoped data-stx-run="always" data-stx-owner="${y}"${g?` ${g}`:""}>${t}</script>
3408
+ `}}if(k.length>0){let{interpolateScriptExpressions:i}=await import("./chunk-kjkkh5p6.js");D=D.replace(/__STX_DATA_BLOCK_(\d+)__/g,(q0,a)=>{let V0=k[Number(a)];return`<script${V0.attrs}>${i(V0.body,A,V)}</script>`})}if(y){let i=KG(D,y);if(D=i.html,i.mergedIntoExisting){let a=y,V0=i.mergedIntoExisting;b=b.split(`'${a}'`).join(`'${V0}'`).split(`"${a}"`).join(`"${V0}"`),y=V0}else if(!i.stamped&&P&&!I$.has(O))I$.add(O),console.warn(`[stx] ${K0.relative(process.cwd(),O)} 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.`);let q0=i.stamped&&i.root!==null&&b2(i.root);b=GG(b,q0?y:null)}if(D.includes("@include")||D.includes("@partial"))D=await T$(D,A,O,X,Y,Q);let{processLoops:u,reportDeferredLoopWarnings:p}=await import("./chunk-evba73dn.js"),m=u(D,A,O,void 0,!0);m=e0(m,A,O),m=p(m);let{processMetaDirectives:X0,processSeoDirective:r,processStructuredData:J0}=await import("./chunk-pqhpcxsd.js");if(m=X0(m,A,O,X),m=J0(m,A,O),m=r(m,A,O,X),m=L1(m,A,O),T)m+=`
3409
3409
  `+T;if(b)m+=`
3410
3410
  `+b;return m}catch(R){let D=R instanceof Error?R.message:String(R);return U(V,`Error processing include ${V}: ${D}`,L,F)}}let j=/@include\s*\(/g,B;while((B=j.exec(z))!==null){let V=B.index,_=V+B[0].length-1,L=1,F=_+1;while(F<z.length&&L>0){if(z[F]==="(")L++;else if(z[F]===")")L--;F++}if(L!==0)break;let O=z.substring(V,F),w=z.substring(_+1,F-1),R=w.match(/^\s*['"]([^'"]+)['"]/);if(!R){j.lastIndex=F;continue}let D=R[1],N,I=w.substring(R[0].length),M=A$(I,0);if(M!==-1)N=I.substring(M+1).trim();let T={};if(N)try{T=l0(N,Z)}catch(A){let E=A instanceof Error?A.message:String(A);z=z.replace(O,_0("Include",`Error parsing include variables for ${D}: ${E}`,J,$,V)),j.lastIndex=0;continue}let k=await H(D,T,$,V);z=z.substring(0,V)+k+z.substring(F),j.lastIndex=0}return z}function k$($,Z){let J=$;function X(Y,Q,G,z){let K=Y,q=!0;while(q){q=!1;let W=new RegExp(`@${Q}\\(['"]([^'"]+)['"]\\)`),U=K.match(W);if(!U||U.index===void 0)break;let H=U.index,j=U[1],B=H+U[0].length,V=new RegExp(`@${Q}\\(`),_=new RegExp(`@${G}(?![a-z])`),L=1,F=B,O=-1;while(L>0&&F<K.length){let R=K.slice(F),D=R.match(V),N=R.match(_),I=D?F+D.index:1/0,M=N?F+N.index:1/0;if(I<M)L++,F=I+(D[0].length||1);else if(M<1/0){if(L--,L===0){O=M;break}F=M+G.length+1}else break}if(O===-1)break;let w=K.slice(B,O);if(!Z[j])Z[j]=[];if(z)Z[j].unshift(w);else Z[j].push(w);K=K.substring(0,H)+K.substring(O+`@${G}`.length),q=!0}return K}return J=X(J,"push","endpush",!1),J=X(J,"prepend","endprepend",!0),J}function E$($,Z){return $.replace(/@stack\(['"]([^'"]+)['"]\)/g,(J,X)=>{if(!Z[X]||Z[X].length===0)return"";return Z[X].join(`
3411
3411
  `)})}import*as y$ from"path";async function O6($,Z,J=""){if(y$.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 w6($,Z,J,"@js","@endjs")}async function F6($,Z,J=""){if(y$.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 w6($,Z,J,"@ts","@endts")}async function w6($,Z,J,X,Y){let Q=$,G=R1(`${X}([\\s\\S]*?)${Y}`,"g"),z=[],K;while((K=G.exec($))!==null)z.push({fullMatch:K[0],content:K[1]||"",index:K.index});for(let{fullMatch:q,content:W,index:U}of z)try{let H={...Z,global:Z},j=Object.keys(H),B=Object.values(H),V=W.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 L=(V.match(/(?:const|let|var)\s+(\w+)\s*=/g)||[]).map((D)=>D.match(/(?:const|let|var)\s+(\w+)/)?.[1]).filter(Boolean),F=L.length>0?`return { ${L.join(", ")} };`:"return {};",O=`
@@ -3435,7 +3435,7 @@ ${Y}
3435
3435
  return result;
3436
3436
  `)(...B);X=X.substring(0,G)+L+X.substring(H),Y=!0}catch(j){let B=R0("While",`Error in @while(${q}): ${j instanceof Error?j.message:String(j)}`,w0.EVALUATION_ERROR);X=X.substring(0,G)+B+X.substring(H),Y=!0}}return X}function AG($,Z="_method"){let J=$.toUpperCase();if(J==="GET"||J==="POST")return"";return`<input type="hidden" name="${Z}" value="${J}">`}function y6($){return $.replace(/@method\(\s*(['"])([^'"]+)\1\s*(?:,\s*(['"])([^'"]+)\3\s*)?\)/g,(Z,J,X,Y,Q)=>{return AG(X,Q||"_method")})}async function b6($,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 K=await z.handler(Q,Z,J,X);if(typeof K==="string")Q=K;else if(X.debug)console.warn(`Middleware ${z.name} did not return a string`)}catch(K){if(X.debug)console.error(`Error in middleware ${z.name}:`,K);if(X.debug){let q=_0("Middleware",`Error in middleware '${z.name}': ${K instanceof Error?K.message:String(K)}`,J,$);Q=Q.replace(/<body[^>]*>/,`$&
3437
3437
  <div style="color:red;background:#ffeeee;padding:10px;border:1px solid #ff0000;margin:10px 0;font-family:monospace;white-space:pre-wrap;">${U5(q)}</div>
3438
- `)}}}return Q}async function S6($,Z,J,X){return b6($,Z,J,X,"before")}async function C6($,Z,J,X){return b6($,Z,J,X,"after")}L2();L2();function P6($){return $.replace(/@route\(\s*(['"])([^'"]+)\1(?:\s*,\s*(\{[^}]+\}))?\s*(?:,\s*(true|false)\s*)?\)/g,(Z,J,X,Y,Q)=>{try{let G=Y?l0(Y,{}):{};return S$(X,G,Q==="true")}catch(G){return console.error(`Error processing @route directive: ${G}`),"#route-error"}})}var c0={patterns:[],exact:{}};function fV($,Z){if(!c0.exact[$])c0.exact[$]=[];c0.exact[$].push(Z)}function gV($,Z){let J=typeof $==="string"?new RegExp($):$;c0.patterns.push({pattern:J,callback:Z})}async function v6($,Z){let J=$.split("/").pop()?.split(".")[0]||"";if(c0.exact[$])for(let X of c0.exact[$])await Promise.resolve(X(Z,$));if(c0.exact[J])for(let X of c0.exact[J])await Promise.resolve(X(Z,$));for(let{pattern:X,callback:Y}of c0.patterns)if(X.test($)||X.test(J))await Promise.resolve(Y(Z,$))}function hV(){c0.patterns=[],c0.exact={}}var IG=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),TG=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 y1($,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()&&IG.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 kG($,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($),K=G.exec($);if(!K)return-1;if(z&&z.index<K.index)X++,Y=z.index+z[0].length;else{if(X--,X===0)return K.index+K[0].length;Y=K.index+K[0].length}}return-1}function E1($,Z){if(Z.selfClosing)return{outerStart:Z.start,outerEnd:Z.end,innerHTML:""};let J=kG($,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 x6($,Z){return new RegExp(`(?:^|\\s)${Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?:=|\\s|$|>|/)`).test($)||$.includes(` ${Z}=`)||$.includes(` ${Z} `)||$.trimEnd().endsWith(` ${Z}`)}function P2($,Z){let J=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),X=$.match(new RegExp(`${J}="([^"]*)"`,"s"))||$.match(new RegExp(`${J}='([^']*)'`,"s"));return X?X[1]:null}function U1($,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 t1($,Z,J){let X=Z.selfClosing?" /":"",Y=`<${Z.tag}${J}${X}>`;return $.slice(0,Z.start)+Y+$.slice(Z.end)}function EG($){return/\bv-(?:if|else-if|else|for|show|model|html|text|pre|once|cloak|memo|bind|on|slot)\b/.test($)}function yG($){let Z=$,J=0;while(J<Z.length){let X=y1(Z,J);if(!X)break;let Y=P2(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(),K;if(G.includes(",")){let _=G.split(",").map((O)=>O.trim()),L=_[0],F=_[1];K=`${z} as ${F} => ${L}`}else K=`${z} as ${G}`;let q=U1(X.attrs,"v-for"),W=U1(q,":key").replace(/\s*v-bind:key="[^"]*"/g,""),U=E1(Z,X),H=Z.slice(U.outerStart,U.outerEnd),j=t1(H,{...X,start:0,end:X.end-X.start},W),B=`@foreach(${K})
3438
+ `)}}}return Q}async function S6($,Z,J,X){return b6($,Z,J,X,"before")}async function C6($,Z,J,X){return b6($,Z,J,X,"after")}L2();L2();function P6($){return $.replace(/@route\(\s*(['"])([^'"]+)\1(?:\s*,\s*(\{[^}]+\}))?\s*(?:,\s*(true|false)\s*)?\)/g,(Z,J,X,Y,Q)=>{try{let G=Y?l0(Y,{}):{};return S$(X,G,Q==="true")}catch(G){return console.error(`Error processing @route directive: ${G}`),"#route-error"}})}var c0={patterns:[],exact:{}};function gV($,Z){if(!c0.exact[$])c0.exact[$]=[];c0.exact[$].push(Z)}function hV($,Z){let J=typeof $==="string"?new RegExp($):$;c0.patterns.push({pattern:J,callback:Z})}async function v6($,Z){let J=$.split("/").pop()?.split(".")[0]||"";if(c0.exact[$])for(let X of c0.exact[$])await Promise.resolve(X(Z,$));if(c0.exact[J])for(let X of c0.exact[J])await Promise.resolve(X(Z,$));for(let{pattern:X,callback:Y}of c0.patterns)if(X.test($)||X.test(J))await Promise.resolve(Y(Z,$))}function uV(){c0.patterns=[],c0.exact={}}var IG=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),TG=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 y1($,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()&&IG.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 kG($,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($),K=G.exec($);if(!K)return-1;if(z&&z.index<K.index)X++,Y=z.index+z[0].length;else{if(X--,X===0)return K.index+K[0].length;Y=K.index+K[0].length}}return-1}function E1($,Z){if(Z.selfClosing)return{outerStart:Z.start,outerEnd:Z.end,innerHTML:""};let J=kG($,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 x6($,Z){return new RegExp(`(?:^|\\s)${Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?:=|\\s|$|>|/)`).test($)||$.includes(` ${Z}=`)||$.includes(` ${Z} `)||$.trimEnd().endsWith(` ${Z}`)}function P2($,Z){let J=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),X=$.match(new RegExp(`${J}="([^"]*)"`,"s"))||$.match(new RegExp(`${J}='([^']*)'`,"s"));return X?X[1]:null}function U1($,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 t1($,Z,J){let X=Z.selfClosing?" /":"",Y=`<${Z.tag}${J}${X}>`;return $.slice(0,Z.start)+Y+$.slice(Z.end)}function EG($){return/\bv-(?:if|else-if|else|for|show|model|html|text|pre|once|cloak|memo|bind|on|slot)\b/.test($)}function yG($){let Z=$,J=0;while(J<Z.length){let X=y1(Z,J);if(!X)break;let Y=P2(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(),K;if(G.includes(",")){let _=G.split(",").map((O)=>O.trim()),L=_[0],F=_[1];K=`${z} as ${F} => ${L}`}else K=`${z} as ${G}`;let q=U1(X.attrs,"v-for"),W=U1(q,":key").replace(/\s*v-bind:key="[^"]*"/g,""),U=E1(Z,X),H=Z.slice(U.outerStart,U.outerEnd),j=t1(H,{...X,start:0,end:X.end-X.start},W),B=`@foreach(${K})
3439
3439
  `,V=`${B}${j}
3440
3440
  @endforeach`;Z=Z.slice(0,U.outerStart)+V+Z.slice(U.outerEnd),J=U.outerStart+B.length}return Z}function bG($){let Z=$,J=0;while(J<Z.length){let X=y1(Z,J);if(!X)break;let Y=P2(X.attrs,"v-if");if(Y===null){J=X.end;continue}let Q=[],G=E1(Z,X),z=U1(X.attrs,"v-if"),K=t1(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:K,parsedTag:X});let q=G.outerEnd,W=!0;while(W){let V=Z.slice(q).match(/^\s*/),_=V?V[0].length:0,L=y1(Z,q+_);if(!L){W=!1;break}let F=P2(L.attrs,"v-else-if"),O=x6(L.attrs,"v-else");if(F!==null){let w=E1(Z,L),R=U1(L.attrs,"v-else-if"),D=t1(Z.slice(w.outerStart,w.outerEnd),{...L,start:0,end:L.end-L.start},R);Q.push({type:"else-if",expr:F,outerStart:q,outerEnd:w.outerEnd,element:D,parsedTag:L}),q=w.outerEnd}else if(O){let w=E1(Z,L),R=U1(L.attrs,"v-else"),D=t1(Z.slice(w.outerStart,w.outerEnd),{...L,start:0,end:L.end-L.start},R);Q.push({type:"else",outerStart:q,outerEnd:w.outerEnd,element:D,parsedTag:L}),W=!1}else W=!1}let U=[];for(let V of Q)if(V.type==="if")U.push(`@if(${V.expr})
3441
3441
  ${V.element}`);else if(V.type==="else-if")U.push(`@elseif(${V.expr})
@@ -3446,8 +3446,8 @@ ${t1(G,{...X,start:0,end:X.end-X.start},Y)}
3446
3446
  @endonce`;Z=Z.slice(0,Q.outerStart)+K+Z.slice(Q.outerEnd),J=Q.outerStart+K.length}return Z}function uG($){return $.replace(/\bv-memo="([^"]*)"/g,'data-stx-memo="$1"')}function mG($){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 f6($){if(!EG($))return $;let Z=$;return Z=yG(Z),Z=bG(Z),Z=hG(Z),Z=PG(Z),Z=vG(Z),Z=CG(Z),Z=SG(Z),Z=mG(Z),Z=xG(Z),Z=fG(Z),Z=gG(Z),Z=uG(Z),Z}function v9($){return $.replace(/--/g,"- -").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var C$=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"]),dG=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]);function g6($,Z){let J=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec($),X=J?J[1]:$,Y=Q0(X,Z);if(Y&&typeof Y==="string")return Y;let Q=X.trim();return C$.has(Q)?Q:null}function h6($){let Z=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec($);return Z?Z[1]:$}function u6($,Z,J){let X=Z.replace(/\s*(?::is|v-bind:is)\s*=\s*"[^"]*"/gi,"").trim(),Y=X?`<${$} ${X}>`:`<${$}>`;if(dG.has($))return X?`<${$} ${X}>`:`<${$}>`;return`${Y}${J}</${$}>`}async function m6($,Z,J,X,Y){let Q=$,G=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*)>([\s\S]*?)<\/component>/gi,z=[],K;while((K=G.exec(Q))!==null)z.push({full:K[0],expr:K[1],attrs:K[2],slotContent:K[3],index:K.index});for(let q=z.length-1;q>=0;q--){let W=z[q];try{let U=g6(W.expr,Z);if(!U||typeof U!=="string"){let F=`<!-- dynamic component: could not resolve "${v9(h6(W.expr))}" -->`;Q=Q.slice(0,W.index)+F+Q.slice(W.index+W.full.length);continue}if(C$.has(U)){let F=u6(U,W.attrs,W.slotContent);Q=Q.slice(0,W.index)+F+Q.slice(W.index+W.full.length);continue}let H=W.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 F=V[1]||V[2],O=V[3];if(V[1])try{j[F]=Q0(O,Z)}catch{j[F]=O}else j[F]=O}let _=X.componentsDir||"components",L=await I1(U,j,W.slotContent,_,Z,J,X,new Set,Y??new Set);Q=Q.slice(0,W.index)+L+Q.slice(W.index+W.full.length)}catch(U){let H=U instanceof Error?U.message:String(U),j=`<!-- dynamic component error: ${v9(H)} -->`;Q=Q.slice(0,W.index)+j+Q.slice(W.index+W.full.length)}}return Q=await lG(Q,Z,J,X,Y),Q}async function lG($,Z,J,X,Y){let Q=$,G=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*?)\/>/gi,z=[],K;while((K=G.exec(Q))!==null)z.push({full:K[0],expr:K[1],attrs:K[2],index:K.index});for(let q=z.length-1;q>=0;q--){let W=z[q];try{let U=g6(W.expr,Z);if(!U||typeof U!=="string"){let B=`<!-- dynamic component: could not resolve "${v9(h6(W.expr))}" -->`;Q=Q.slice(0,W.index)+B+Q.slice(W.index+W.full.length);continue}if(C$.has(U)){let B=u6(U,W.attrs,"");Q=Q.slice(0,W.index)+B+Q.slice(W.index+W.full.length);continue}let H=X.componentsDir||"components",j=await I1(U,{},"",H,Z,J,X,new Set,Y??new Set);Q=Q.slice(0,W.index)+j+Q.slice(W.index+W.full.length)}catch(U){let H=U instanceof Error?U.message:String(U),j=`<!-- dynamic component error: ${v9(H)} -->`;Q=Q.slice(0,W.index)+j+Q.slice(W.index+W.full.length)}}return Q}function P$(){return{afterOpen:[],beforeClose:[]}}function cG($){return $.afterOpen.length>0||$.beforeClose.length>0}function l6($,Z){if(!cG(Z))return $;let J=Z.afterOpen.join(""),X=Z.beforeClose.join(""),Y=$.lastIndexOf("</head>"),Q=J?v2($):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 d6=/\s*<meta\b[^>]*\bcharset\b[^>]*>/iy;function v2($){let Z=/<head\b[^>]*>/i.exec($);if(!Z)return null;let J=Z.index+Z[0].length;d6.lastIndex=J;let X=d6.exec($);return X?J+X[0].length:J}var x$="data-stx-color-mode-boot",pG="__STX_COLOR_MODE__",iG=new Set(["light","dark","auto","system"]),nG=new Set(["auto","system"]),sG=/^[a-z][\w:-]*$/i,oG=/^[\w-]+$/;function rG($){let Z=$.storageKey??"stx-color-mode",J=$.initialMode??"auto",X=$.darkClass===void 0?"dark":$.darkClass,Y=$.attribute??null,Q=$.autoValue??null,G=$.respectExisting===!0;if(typeof Z!=="string"||Z.length===0)throw Error("colorMode.storageKey must be a non-empty string");if(!iG.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"||!oG.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"||!sG.test(Y)))throw Error(`colorMode.attribute must be a valid HTML attribute name \u2014 got ${JSON.stringify(Y)}`);if(Q!==null&&!nG.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>");if(G&&Y===null)throw Error("colorMode.respectExisting needs an attribute to read \u2014 the dark class alone cannot say whether a mode was chosen");return{storageKey:Z,initialMode:J==="system"?"auto":J,darkClass:X,attribute:Y,autoValue:Q,respectExisting:G}}function aG($){return JSON.stringify($).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function f$($={}){let Z=rG($),X=`(function(){"use strict";var c=${aG(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 r=document.documentElement;var f=null;if(c.respectExisting&&c.attribute){var x=r.getAttribute(c.attribute);if(x==="light"||x==="dark")f=x}var m=f;if(!m){m=p;if(p==="auto"){try{m=matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){m="light"}}}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.${pG}={storageKey:c.storageKey,initialMode:c.initialMode,darkClass:c.darkClass,attribute:c.attribute,autoValue:a||"auto",respectExisting:c.respectExisting,forced:f,preference:p,mode:m}}catch(e){}}());`;return`<script ${x$}>${X}</script>`}function i6($,Z={}){if($.includes(x$))return $;let J=v$($);if(J===null)return $;let X=f$(Z);return`${$.slice(0,J)}
3447
3447
  ${X}${$.slice(J)}`}var v$=v2,tG=new RegExp(`<script\\b[^>]*\\b${x$}\\b[^>]*>[\\s\\S]*?<\\/script>`,"i"),c6=/<meta\b[^>]*\bcharset\b[^>]*>/gi,p6=/<\/head>/gi;function eG($){let Z=/<head\b[^>]*>/i.exec($);if(!Z)return $;let J=Z.index+Z[0].length;p6.lastIndex=J;let X=p6.exec($),Y=X?X.index:$.length;c6.lastIndex=J;let Q=c6.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)}
3448
3448
  ${Q[0]}${$.slice(J,Q.index)}${$.slice(G,Y)}${$.slice(Y)}`}function n6($){return $z(eG($))}function $z($){let Z=tG.exec($);if(!Z)return $;let J=v$($);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=v$(X);if(Y===null)return $;return`${X.slice(0,Y)}
3449
- ${Z[0]}${X.slice(Y)}`}var oV="stx-build",rV="X-STX-Build",x2=Symbol.for("stx.buildId");function s6(){let $=globalThis;if(!$[x2])$[x2]=process.env.STX_BUILD_ID||`${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`;return $[x2]}function aV($){let Z=globalThis;if($===null)delete Z[x2];else Z[x2]=$}function tV($,Z=s6()){let J=g$($,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 g$($,Z=s6()){if($.includes('name="stx-build"'))return null;if(!/<head\b[^>]*>/i.test($))return null;return`
3450
- <meta name="stx-build" content="${Z}">`}var $L="/_stx/sw.js",o6="<script data-stx-offline>if('serviceWorker' in navigator){addEventListener('load',function(){navigator.serviceWorker.register('/_stx/sw.js',{scope:'/'}).catch(function(){})})}</script>";function ZL($,Z){let J={build:String(Z||"dev"),pages:Array.from(new Set(($.pages||[]).filter((X)=>typeof X==="string"&&X.startsWith("/")))),api:$.apiPrefix||"/api/",timeout:Math.max(500,Number($.networkTimeoutMs)||3500),fallback:$.fallback||$.pages&&$.pages[0]||null,exclude:["/_stx/hmr","/_stx/sw.js",...$.exclude||[]],mediaMax:Math.max(10485760,Number($.mediaMaxBytes)||629145600)};return`/* stx offline worker, build ${J.build} */
3449
+ ${Z[0]}${X.slice(Y)}`}var rV="stx-build",aV="X-STX-Build",x2=Symbol.for("stx.buildId");function s6(){let $=globalThis;if(!$[x2])$[x2]=process.env.STX_BUILD_ID||`${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`;return $[x2]}function tV($){let Z=globalThis;if($===null)delete Z[x2];else Z[x2]=$}function eV($,Z=s6()){let J=g$($,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 g$($,Z=s6()){if($.includes('name="stx-build"'))return null;if(!/<head\b[^>]*>/i.test($))return null;return`
3450
+ <meta name="stx-build" content="${Z}">`}var ZL="/_stx/sw.js";function Zz($){if(typeof $!=="string"||!$.startsWith("/"))return null;let Z=[],J=[],X=$.replace(/\/+$/,"").split("/").slice(1).map((Y)=>{let Q=/^:(\w+)$/.exec(Y)||/^\[(\w+)\]$/.exec(Y);if(Q)return Z.push(Q[1]),J.push("0"),"([^/]+)";return J.push(Y),Y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});if(!Z.length)return null;return{path:$,re:`^/${X.join("/")}/?$`,names:Z,sample:`/${J.join("/")}`}}var o6="<script data-stx-offline>if('serviceWorker' in navigator){addEventListener('load',function(){navigator.serviceWorker.register('/_stx/sw.js',{scope:'/'}).catch(function(){})})}</script>";function JL($,Z){let J={build:String(Z||"dev"),pages:Array.from(new Set(($.pages||[]).filter((X)=>typeof X==="string"&&X.startsWith("/")))),api:$.apiPrefix||"/api/",timeout:Math.max(500,Number($.networkTimeoutMs)||3500),fallback:$.fallback||$.pages&&$.pages[0]||null,routes:($.routes||[]).map(Zz).filter(Boolean),exclude:["/_stx/hmr","/_stx/sw.js",...$.exclude||[]],mediaMax:Math.max(10485760,Number($.mediaMaxBytes)||629145600)};return`/* stx offline worker, build ${J.build} */
3451
3451
  'use strict';
3452
3452
  var S = ${JSON.stringify(J)};
3453
3453
  var SHELL = 'stx-shell-' + S.build;
@@ -3482,13 +3482,79 @@ function hashOf(text) {
3482
3482
  });
3483
3483
  }
3484
3484
 
3485
+ // A dynamic route's kept page, under a key no real path has.
3486
+ function routeKey(route, fragment) {
3487
+ return variantUrl('/__stx_route__' + route.path, fragment);
3488
+ }
3489
+
3490
+ function routeOf(pathname) {
3491
+ for (var i = 0; i < S.routes.length; i++) {
3492
+ var match = new RegExp(S.routes[i].re).exec(pathname);
3493
+ if (!match) continue;
3494
+ var params = {};
3495
+ S.routes[i].names.forEach(function (name, at) {
3496
+ try { params[name] = decodeURIComponent(match[at + 1]); }
3497
+ catch (error) { params[name] = match[at + 1]; }
3498
+ });
3499
+ return { route: S.routes[i], params: params };
3500
+ }
3501
+ return null;
3502
+ }
3503
+
3504
+ // The route's kept page with the params asked for in its params script, so
3505
+ // useRoute().params reads the value that was opened, not the one kept.
3506
+ var PARAMS_SCRIPT = /(<script\\b[^>]*data-stx-route-params[^>]*>\\(function\\(\\)\\{var p=)[\\s\\S]*?(;window\\.__stx_rp)/;
3507
+ function withParams(response, params) {
3508
+ return response.text().then(function (html) {
3509
+ var json = JSON.stringify(params).replace(/</g, '\\\\u003C').replace(/\\u2028/g, '\\\\u2028').replace(/\\u2029/g, '\\\\u2029');
3510
+ var body = html.replace(PARAMS_SCRIPT, function (all, open, close) { return open + json + close; });
3511
+ var headers = new Headers(response.headers);
3512
+ headers.delete('Content-Length');
3513
+ return new Response(body, { status: 200, headers: headers });
3514
+ });
3515
+ }
3516
+
3517
+ // The stylesheets and scripts a kept page links to. Each page has its own
3518
+ // generated CSS, fetched only when the page is shown: a screen kept at
3519
+ // install but never opened online came up offline without its styles.
3520
+ var keepingAssets = {};
3521
+ var ASSET_REF = /<(?:link|script)\\b[^>]*?\\s(?:href|src)="(\\/[^"]+\\.(?:css|js))"/g;
3522
+ function keepAssetsOf(response) {
3523
+ return response.text().then(function (html) {
3524
+ var urls = [];
3525
+ var match;
3526
+ ASSET_REF.lastIndex = 0;
3527
+ while ((match = ASSET_REF.exec(html))) {
3528
+ if (urls.indexOf(match[1]) === -1) urls.push(match[1]);
3529
+ }
3530
+ return caches.open(ASSETS).then(function (cache) {
3531
+ return Promise.all(urls.map(function (url) {
3532
+ // A page and its fragment link the same files: one fetch each.
3533
+ if (!keepingAssets[url]) {
3534
+ keepingAssets[url] = cache.match(url).then(function (hit) {
3535
+ if (hit) return;
3536
+ return fetch(url, { credentials: 'same-origin' }).then(function (asset) {
3537
+ if (asset.status === 200) return cache.put(url, asset);
3538
+ });
3539
+ }).catch(function () {});
3540
+ }
3541
+ return keepingAssets[url];
3542
+ }));
3543
+ });
3544
+ }).catch(function () {});
3545
+ }
3546
+
3485
3547
  function precache() {
3548
+ var wanted = S.pages.map(function (page) { return { url: page, key: function (fragment) { return variantUrl(page, fragment); } }; })
3549
+ .concat(S.routes.map(function (route) { return { url: route.sample, key: function (fragment) { return routeKey(route, fragment); } }; }));
3486
3550
  return caches.open(SHELL).then(function (cache) {
3487
- return Promise.all(S.pages.map(function (page) {
3551
+ return Promise.all(wanted.map(function (page) {
3488
3552
  return Promise.all([false, true].map(function (fragment) {
3489
3553
  var headers = fragment ? { 'X-STX-Router': 'true', 'Accept': 'text/html' } : { 'Accept': 'text/html' };
3490
- return fetch(page, { headers: headers, credentials: 'same-origin' }).then(function (response) {
3491
- if (response.status === 200 && !response.redirected) return cache.put(variantUrl(page, fragment), response);
3554
+ return fetch(page.url, { headers: headers, credentials: 'same-origin' }).then(function (response) {
3555
+ if (response.status !== 200 || response.redirected) return;
3556
+ var copy = response.clone();
3557
+ return Promise.all([cache.put(page.key(fragment), response), keepAssetsOf(copy)]);
3492
3558
  }).catch(function () {});
3493
3559
  }));
3494
3560
  }));
@@ -3626,12 +3692,16 @@ function markFallback(response) {
3626
3692
  function pageResponse(request) {
3627
3693
  var fragment = isFragment(request);
3628
3694
  var key = variantUrl(request.url, fragment);
3695
+ var dynamic = routeOf(new URL(request.url).pathname);
3629
3696
  var network = fetch(request).then(function (response) {
3630
3697
  // Only a page that is what was asked for: a redirect (to a sign-in page)
3631
3698
  // or an error is not kept as this screen.
3632
3699
  if (response.status === 200 && !response.redirected && response.type === 'basic') {
3633
3700
  var copy = response.clone();
3634
- caches.open(SHELL).then(function (cache) { return cache.put(key, copy); }).catch(function () {});
3701
+ var routeCopy = dynamic ? response.clone() : null;
3702
+ caches.open(SHELL).then(function (cache) {
3703
+ return Promise.all([cache.put(key, copy), routeCopy && cache.put(routeKey(dynamic.route, fragment), routeCopy)]);
3704
+ }).catch(function () {});
3635
3705
  }
3636
3706
  return response;
3637
3707
  });
@@ -3641,8 +3711,12 @@ function pageResponse(request) {
3641
3711
  if (hit) return hit;
3642
3712
  // Slower than the timeout but still coming: wait for it rather than fail.
3643
3713
  return network.catch(function () {
3644
- if (!S.fallback || fragment) return Response.error();
3645
- return cache.match(variantUrl(S.fallback, false)).then(function (fallback) { return fallback ? markFallback(fallback) : Response.error(); });
3714
+ var route = dynamic ? cache.match(routeKey(dynamic.route, fragment)) : Promise.resolve(null);
3715
+ return route.then(function (kept) {
3716
+ if (kept) return withParams(kept, dynamic.params);
3717
+ if (!S.fallback || fragment) return Response.error();
3718
+ return cache.match(variantUrl(S.fallback, false)).then(function (fallback) { return fallback ? markFallback(fallback) : Response.error(); });
3719
+ });
3646
3720
  });
3647
3721
  });
3648
3722
  });
@@ -3715,11 +3789,11 @@ self.addEventListener('fetch', function (event) {
3715
3789
  event.respondWith(pageResponse(request));
3716
3790
  }
3717
3791
  });
3718
- `}import{AsyncLocalStorage as Zz}from"async_hooks";var r6=new Zz;function h$($){return $.__stx_server_data??={pending:new Map,values:new Map}}function a6($,Z){return r6.run(h$($),Z)}async function t6($,Z){let J=r6.getStore();if(!J)throw Error("useServerData must run inside a <script server> render");if(typeof $!=="string"||!$.trim())throw TypeError("useServerData requires a non-empty string key");let X=J.pending.get($);if(X)return X;let Y=Promise.resolve().then(Z).then((Q)=>{let G=JSON.stringify(Q,(K,q)=>{if(q===void 0||typeof q==="function"||typeof q==="symbol"||typeof q==="bigint"||typeof q==="number"&&!Number.isFinite(q))throw TypeError(`useServerData(${JSON.stringify($)}) requires JSON-serializable data`);if(q&&typeof q==="object"&&!Array.isArray(q)&&Object.getPrototypeOf(q)!==Object.prototype&&Object.getPrototypeOf(q)!==null)throw TypeError(`useServerData(${JSON.stringify($)}) requires JSON-serializable data`);return q}),z=JSON.parse(G);return J.values.set($,z),z}).catch((Q)=>{throw J.pending.delete($),Q});return J.pending.set($,Y),Y}function e6($){let Z=$.__stx_server_data;if(!Z?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(Z.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}var J8="<style data-stx-cloak>[x-cloak]{display:none !important}</style>",x9="data-stx-html-attrs",f9="data-stx-html-class",X8=/^[A-Za-z_:][\w:.-]*$/;function Z1($){return String($).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Jz($){return String($).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function $2($){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 e1($,Z){return Object.entries($).filter(([J])=>!Z?.(J)).map(([J,X])=>`${J}="${Z1(String(X))}"`).join(" ")}function Xz($={},Z="en"){let J=[],X=[],Y="",Q=Z;for(let[z,K]of Object.entries($||{})){if(K==null)continue;let q=z.trim();if(!X8.test(q))continue;let W=q.toLowerCase();if(W==="lang"){Q=String(K);continue}if(W==="class"){Y=String(K).trim();continue}J.push(` ${q}="${Z1(String(K))}"`),X.push(q)}let G=` lang="${Z1(Q)}"`;if(Y)G+=` class="${Z1(Y)}"`;if(G+=J.join(""),Y)G+=` ${f9}="${Z1(Y)}"`;if(X.length)G+=` ${x9}="${Z1(X.join(" "))}"`;return G}function Y8($={},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 Q8($,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 W=G[1];if(!(W in X))Y.push(W);X[W]=G[2]??G[3]??G[4]??""}let z=[],K=[];for(let[W,U]of Object.entries(Z)){if(U==null)continue;let H=W.trim();if(!X8.test(H))continue;let j=H.toLowerCase();if(j==="class"){let B=(X.class||"").split(/\s+/).filter(Boolean);for(let V of String(U).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(U),j!=="lang")K.push(H)}if(z.length){if(!(f9 in X))Y.push(f9);X[f9]=z.join(" ")}if(K.length){if(!(x9 in X))Y.push(x9);X[x9]=K.join(" ")}let q=Y.map((W)=>` ${W}="${Z1(X[W])}"`).join("");return $.replace(J[0],()=>`<html${q}>`)}function GL($){let Z=d$($);if(Z===null)return $;let J=$.lastIndexOf("</head>");return`${$.slice(0,J)}${Z}${$.slice(J)}`}function d$($){if($.includes("data-stx-cloak"))return null;if($.lastIndexOf("</head>")===-1)return null;return`${J8}
3719
- `}function Yz($){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 U=$.indexOf("-->",J);if(U===-1)break;J=U+3;continue}let z=Q.match(/^<script\b[^>]*>/i);if(z){let U=$.toLowerCase().indexOf("</script>",J+z[0].length);if(U===-1)break;J=U+9;continue}let K=Q.match(/^<link\b[^>]*>/i);if(K){Z.push(K[0]),J+=K[0].length;continue}let q=Q.match(/^<meta\b[^>]*>/i);if(q){Z.push(q[0]),J+=q[0].length;continue}let W=Q.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(W){Z.push(W[0]),J+=W[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 K=Q.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(K&&Z.includes(K[0])){Y+=K[0].length;continue}X+=$[Y],Y++}return X+=$.slice(J),{body:X,hoisted:Z}}function Qz($,Z={},J={}){let{title:X="stx App",lang:Y="en",meta:Q=[],link:G=[],script:z=[],headRaw:K="",htmlAttrs:q={},bodyClass:W="",bodyAttrs:U={}}=Z,H=J.title||X,j=[{charset:"UTF-8"},{name:"viewport",content:"width=device-width, initial-scale=1.0"}],B=new Set(Q.map($2).filter(Boolean)),_=[...j.filter((T)=>!B.has($2(T))),...Q].map((T)=>{return` <meta ${e1(T)}>`}).join(`
3792
+ `}import{AsyncLocalStorage as Jz}from"async_hooks";var r6=new Jz;function h$($){return $.__stx_server_data??={pending:new Map,values:new Map}}function a6($,Z){return r6.run(h$($),Z)}async function t6($,Z){let J=r6.getStore();if(!J)throw Error("useServerData must run inside a <script server> render");if(typeof $!=="string"||!$.trim())throw TypeError("useServerData requires a non-empty string key");let X=J.pending.get($);if(X)return X;let Y=Promise.resolve().then(Z).then((Q)=>{let G=JSON.stringify(Q,(K,q)=>{if(q===void 0||typeof q==="function"||typeof q==="symbol"||typeof q==="bigint"||typeof q==="number"&&!Number.isFinite(q))throw TypeError(`useServerData(${JSON.stringify($)}) requires JSON-serializable data`);if(q&&typeof q==="object"&&!Array.isArray(q)&&Object.getPrototypeOf(q)!==Object.prototype&&Object.getPrototypeOf(q)!==null)throw TypeError(`useServerData(${JSON.stringify($)}) requires JSON-serializable data`);return q}),z=JSON.parse(G);return J.values.set($,z),z}).catch((Q)=>{throw J.pending.delete($),Q});return J.pending.set($,Y),Y}function e6($){let Z=$.__stx_server_data;if(!Z?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(Z.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}var J8="<style data-stx-cloak>[x-cloak]{display:none !important}</style>",x9="data-stx-html-attrs",f9="data-stx-html-class",X8=/^[A-Za-z_:][\w:.-]*$/;function Z1($){return String($).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Xz($){return String($).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function $2($){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 e1($,Z){return Object.entries($).filter(([J])=>!Z?.(J)).map(([J,X])=>`${J}="${Z1(String(X))}"`).join(" ")}function Yz($={},Z="en"){let J=[],X=[],Y="",Q=Z;for(let[z,K]of Object.entries($||{})){if(K==null)continue;let q=z.trim();if(!X8.test(q))continue;let W=q.toLowerCase();if(W==="lang"){Q=String(K);continue}if(W==="class"){Y=String(K).trim();continue}J.push(` ${q}="${Z1(String(K))}"`),X.push(q)}let G=` lang="${Z1(Q)}"`;if(Y)G+=` class="${Z1(Y)}"`;if(G+=J.join(""),Y)G+=` ${f9}="${Z1(Y)}"`;if(X.length)G+=` ${x9}="${Z1(X.join(" "))}"`;return G}function Y8($={},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 Q8($,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 W=G[1];if(!(W in X))Y.push(W);X[W]=G[2]??G[3]??G[4]??""}let z=[],K=[];for(let[W,U]of Object.entries(Z)){if(U==null)continue;let H=W.trim();if(!X8.test(H))continue;let j=H.toLowerCase();if(j==="class"){let B=(X.class||"").split(/\s+/).filter(Boolean);for(let V of String(U).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(U),j!=="lang")K.push(H)}if(z.length){if(!(f9 in X))Y.push(f9);X[f9]=z.join(" ")}if(K.length){if(!(x9 in X))Y.push(x9);X[x9]=K.join(" ")}let q=Y.map((W)=>` ${W}="${Z1(X[W])}"`).join("");return $.replace(J[0],()=>`<html${q}>`)}function zL($){let Z=d$($);if(Z===null)return $;let J=$.lastIndexOf("</head>");return`${$.slice(0,J)}${Z}${$.slice(J)}`}function d$($){if($.includes("data-stx-cloak"))return null;if($.lastIndexOf("</head>")===-1)return null;return`${J8}
3793
+ `}function Qz($){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 U=$.indexOf("-->",J);if(U===-1)break;J=U+3;continue}let z=Q.match(/^<script\b[^>]*>/i);if(z){let U=$.toLowerCase().indexOf("</script>",J+z[0].length);if(U===-1)break;J=U+9;continue}let K=Q.match(/^<link\b[^>]*>/i);if(K){Z.push(K[0]),J+=K[0].length;continue}let q=Q.match(/^<meta\b[^>]*>/i);if(q){Z.push(q[0]),J+=q[0].length;continue}let W=Q.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(W){Z.push(W[0]),J+=W[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 K=Q.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(K&&Z.includes(K[0])){Y+=K[0].length;continue}X+=$[Y],Y++}return X+=$.slice(J),{body:X,hoisted:Z}}function Gz($,Z={},J={}){let{title:X="stx App",lang:Y="en",meta:Q=[],link:G=[],script:z=[],headRaw:K="",htmlAttrs:q={},bodyClass:W="",bodyAttrs:U={}}=Z,H=J.title||X,j=[{charset:"UTF-8"},{name:"viewport",content:"width=device-width, initial-scale=1.0"}],B=new Set(Q.map($2).filter(Boolean)),_=[...j.filter((T)=>!B.has($2(T))),...Q].map((T)=>{return` <meta ${e1(T)}>`}).join(`
3720
3794
  `),L=G.map((T)=>{return` <link ${e1(T)}>`}).join(`
3721
3795
  `),F=z.map((T)=>{if(T.src)return` <script ${e1(T,(k)=>k==="content")}></script>`;if(T.content)return` <script>${T.content}</script>`;return""}).filter(Boolean).join(`
3722
- `),O=Xz(q,Y),w=Object.entries(U).map(([T,k])=>` ${T}="${Z1(String(k))}"`).join(""),R=W?` class="${Z1(W)}"`:"",{body:D,hoisted:N}=Yz($),I=[_,J.colorMode?` ${f$(J.colorMode)}`:"",` <title>${J.titleIsHtml?H:Jz(H)}</title>`,` ${J8}`,L,F,K?` ${K}`:"",...(J.styles||[]).map((T)=>` ${T}`),...N.map((T)=>` ${T}`),...(J.headScripts||[]).map((T)=>` ${T}`),J.headStack||""].filter(Boolean),M=[D,...(J.bodyScripts||[]).map((T)=>T),J.bodyStack||""].filter(Boolean);return`<!DOCTYPE html>
3796
+ `),O=Yz(q,Y),w=Object.entries(U).map(([T,k])=>` ${T}="${Z1(String(k))}"`).join(""),R=W?` class="${Z1(W)}"`:"",{body:D,hoisted:N}=Qz($),I=[_,J.colorMode?` ${f$(J.colorMode)}`:"",` <title>${J.titleIsHtml?H:Xz(H)}</title>`,` ${J8}`,L,F,K?` ${K}`:"",...(J.styles||[]).map((T)=>` ${T}`),...N.map((T)=>` ${T}`),...(J.headScripts||[]).map((T)=>` ${T}`),J.headStack||""].filter(Boolean),M=[D,...(J.bodyScripts||[]).map((T)=>T),J.bodyStack||""].filter(Boolean);return`<!DOCTYPE html>
3723
3797
  <html${O}>
3724
3798
  <head>
3725
3799
  ${I.join(`
@@ -3729,24 +3803,24 @@ ${I.join(`
3729
3803
  ${M.join(`
3730
3804
  `)}
3731
3805
  </body>
3732
- </html>`}var u$=/\s+/y,m$=/<(script|style)\b[^>]*>/iy,Gz=/<\/script>/gi,zz=/<\/style>/gi,$8=/<!DOCTYPE\b/iy,Z8=/<html[\s>]/iy;function l$($){let Z=0;while(Z<$.length){if(u$.lastIndex=Z,u$.exec($)){Z=u$.lastIndex;continue}if($.startsWith("<!--",Z)){let Y=$.indexOf("-->",Z);if(Y===-1)return!1;Z=Y+3;continue}m$.lastIndex=Z;let X=m$.exec($);if(X){let Y=X[1].toLowerCase()==="script"?Gz:zz;Y.lastIndex=m$.lastIndex;let Q=Y.exec($);if(Q===null)return!1;Z=Q.index+Q[0].length;continue}if($8.lastIndex=Z,$8.test($))return!0;return Z8.lastIndex=Z,Z8.test($)}return!1}function c$($){return l$($)}function G8($,Z={}){let J=$.lastIndexOf("</head>");if(J===-1)return $;let{meta:X=[],link:Y=[],script:Q=[],headRaw:G=""}=Z,z=$.slice(0,J),K=[];for(let q of X){let W=$2(q);if(W&&z.includes(W))continue;K.push(` <meta ${e1(q)}>`)}for(let q of Y){if(q.href&&z.includes(`href="${q.href}"`))continue;K.push(` <link ${e1(q)}>`)}for(let q of Q)if(q.src){if(z.includes(`src="${q.src}"`))continue;K.push(` <script ${e1(q,(W)=>W==="content")}></script>`)}else if(q.content){if(z.includes(q.content))continue;K.push(` <script>${q.content}</script>`)}if(G&&!z.includes(G))K.push(` ${G}`);if(K.length===0)return $;return`${$.slice(0,J)}${K.join(`
3806
+ </html>`}var u$=/\s+/y,m$=/<(script|style)\b[^>]*>/iy,zz=/<\/script>/gi,Kz=/<\/style>/gi,$8=/<!DOCTYPE\b/iy,Z8=/<html[\s>]/iy;function l$($){let Z=0;while(Z<$.length){if(u$.lastIndex=Z,u$.exec($)){Z=u$.lastIndex;continue}if($.startsWith("<!--",Z)){let Y=$.indexOf("-->",Z);if(Y===-1)return!1;Z=Y+3;continue}m$.lastIndex=Z;let X=m$.exec($);if(X){let Y=X[1].toLowerCase()==="script"?zz:Kz;Y.lastIndex=m$.lastIndex;let Q=Y.exec($);if(Q===null)return!1;Z=Q.index+Q[0].length;continue}if($8.lastIndex=Z,$8.test($))return!0;return Z8.lastIndex=Z,Z8.test($)}return!1}function c$($){return l$($)}function G8($,Z={}){let J=$.lastIndexOf("</head>");if(J===-1)return $;let{meta:X=[],link:Y=[],script:Q=[],headRaw:G=""}=Z,z=$.slice(0,J),K=[];for(let q of X){let W=$2(q);if(W&&z.includes(W))continue;K.push(` <meta ${e1(q)}>`)}for(let q of Y){if(q.href&&z.includes(`href="${q.href}"`))continue;K.push(` <link ${e1(q)}>`)}for(let q of Q)if(q.src){if(z.includes(`src="${q.src}"`))continue;K.push(` <script ${e1(q,(W)=>W==="content")}></script>`)}else if(q.content){if(z.includes(q.content))continue;K.push(` <script>${q.content}</script>`)}if(G&&!z.includes(G))K.push(` ${G}`);if(K.length===0)return $;return`${$.slice(0,J)}${K.join(`
3733
3807
  `)}
3734
- ${$.slice(J)}`}function z8($,Z={},J={},X){if(X??c$($))return $;return Qz($,Z,J)}var Kz=/<\/(script)/gi;function Z2($){if(!$||$.indexOf("</")===-1)return $;return $.replace(Kz,"<\\/$1")}var H1=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useIntervalFn","useObjectUrl","useTimeoutFn"];import W8 from"path";L2();L2();function q8($,Z={}){return new K8($,Z).routes}function VL($,Z){let J=p$($,Z);return J?J.params:null}var U8=new Map;async function H8($,Z){let J=$,X=Z;if(!J||!X)try{let z=await g5();J||=z?.pagesDir||"pages",X||=z?.root||"."}catch{J||="pages",X||="."}let Y=W8.isAbsolute(J)?J:W8.join(X,J),Q=U8.get(Y);if(Q)return Q;let G=[];try{G=q8(".",{pagesDir:Y,emit:!1}).map((z)=>z.regex.source).filter(Boolean)}catch{G=[]}return U8.set(Y,G),G}function qz($){return $.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function j8($){return qz(JSON.stringify($))}function B8($){return $.includes("data-stx-runtime")}function V8($){let Z=/window\.stx\s*\.\s*[A-Za-z_$]|\}\s*=\s*window\.stx\s*;/g;for(let J=Z.exec($);J!==null;J=Z.exec($)){let X=$.slice(Math.max(0,J.index-80),J.index);if(/if\s*\(\s*window\.stx\s*\)|window\.stx\s*&&/.test(X))continue;return!0}return!1}function i$($,Z){let J=B2($),X=$.search(/<!doctype\b/i);if(J!==-1&&(X===-1||J>X))return $.slice(0,J)+Z+`
3808
+ ${$.slice(J)}`}function z8($,Z={},J={},X){if(X??c$($))return $;return Gz($,Z,J)}var qz=/<\/(script)/gi;function Z2($){if(!$||$.indexOf("</")===-1)return $;return $.replace(qz,"<\\/$1")}var H1=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useIntervalFn","useObjectUrl","useTimeoutFn"];import W8 from"path";L2();L2();function q8($,Z={}){return new K8($,Z).routes}function LL($,Z){let J=p$($,Z);return J?J.params:null}var U8=new Map;async function H8($,Z){let J=$,X=Z;if(!J||!X)try{let z=await g5();J||=z?.pagesDir||"pages",X||=z?.root||"."}catch{J||="pages",X||="."}let Y=W8.isAbsolute(J)?J:W8.join(X,J),Q=U8.get(Y);if(Q)return Q;let G=[];try{G=q8(".",{pagesDir:Y,emit:!1}).map((z)=>z.regex.source).filter(Boolean)}catch{G=[]}return U8.set(Y,G),G}function Wz($){return $.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function j8($){return Wz(JSON.stringify($))}function B8($){return $.includes("data-stx-runtime")}function V8($){let Z=/window\.stx\s*\.\s*[A-Za-z_$]|\}\s*=\s*window\.stx\s*;/g;for(let J=Z.exec($);J!==null;J=Z.exec($)){let X=$.slice(Math.max(0,J.index-80),J.index);if(/if\s*\(\s*window\.stx\s*\)|window\.stx\s*&&/.test(X))continue;return!0}return!1}function i$($,Z){let J=B2($),X=$.search(/<!doctype\b/i);if(J!==-1&&(X===-1||J>X))return $.slice(0,J)+Z+`
3735
3809
  `+$.slice(J);let Y=v2($);if(Y!==null)return`${$.slice(0,Y)}
3736
3810
  ${Z}${$.slice(Y)}`;if($.includes("</head>")){let G=$.indexOf("</head>");return $.slice(0,G)+Z+`
3737
3811
  `+$.slice(G)}if(p0($))return x1($,(G)=>`${G}
3738
3812
  ${Z}`);return`${Z}
3739
- ${$}`}async function g9($,Z){if($.includes("data-stx-runtime")||$.includes("window.stx.state")||$.includes("STX Signals Runtime"))return $;if(Z.buildMode==="serve"){let{getServeClientAsset:Y}=await import("./chunk-vxxj6sqn.js"),{url:Q}=await Y("runtime",Z.debug===!0);return i$($,`<script data-stx-runtime src="${Q}"></script>`)}if(Z.buildMode==="compile")return i$($,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:J}=await import("./chunk-vxxj6sqn.js"),X=await J(Z.debug);return i$($,`<script data-stx-scoped data-stx-runtime>${X}</script>`)}function Wz($){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test($)}function L8($){if($.includes("data-stx-tooltip-runtime")||!Wz($))return $;let Z=`<script data-stx-scoped data-stx-tooltip-runtime>${F$()}</script>`,J=$.lastIndexOf("</body>");if(J===-1)return`${$}
3813
+ ${$}`}async function g9($,Z){if($.includes("data-stx-runtime")||$.includes("window.stx.state")||$.includes("STX Signals Runtime"))return $;if(Z.buildMode==="serve"){let{getServeClientAsset:Y}=await import("./chunk-b891w7hr.js"),{url:Q}=await Y("runtime",Z.debug===!0);return i$($,`<script data-stx-runtime src="${Q}"></script>`)}if(Z.buildMode==="compile")return i$($,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:J}=await import("./chunk-b891w7hr.js"),X=await J(Z.debug);return i$($,`<script data-stx-scoped data-stx-runtime>${X}</script>`)}function Uz($){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test($)}function L8($){if($.includes("data-stx-tooltip-runtime")||!Uz($))return $;let Z=`<script data-stx-scoped data-stx-tooltip-runtime>${F$()}</script>`,J=$.lastIndexOf("</body>");if(J===-1)return`${$}
3740
3814
  ${Z}`;return`${$.slice(0,J)}${Z}
3741
- ${$.slice(J)}`}var Uz=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function Hz($){return Uz.test($)||$.includes("__stxRouter)return")||$.includes("__stxRouter=true")}async function jz($,Z){if(!$.includes("</body>"))return $;if(Hz($))return $;let J=Z?.router,X="";{let K={};if(J){if(J.container)K.container=J.container;if(J.interceptAllLinks!==void 0)K.interceptAllLinks=J.interceptAllLinks;if(J.progress!==void 0)K.progress=J.progress;if(J.viewTransitions!==void 0)K.viewTransitions=J.viewTransitions;if(J.viewTransitionDuration!==void 0)K.viewTransitionDuration=J.viewTransitionDuration;if(J.viewTransitionEasing!==void 0)K.viewTransitionEasing=J.viewTransitionEasing;if(J.scrollToTop!==void 0)K.scrollToTop=J.scrollToTop;if(J.scrollRestoration!==void 0)K.scrollRestoration=J.scrollRestoration;if(J.prefetch!==void 0)K.prefetch=J.prefetch;if(J.cache!==void 0)K.cache=J.cache;if(J.progressColor!==void 0)K.progressColor=J.progressColor;if(J.progressHeight!==void 0)K.progressHeight=J.progressHeight}try{let q=await H8(Z?.pagesDir,Z?.root);if(q.length>0)K.ownedRoutes=q}catch{}if(Object.keys(K).length>0)X=`<script>window.__stxRouterConfig=${j8(K)};</script>
3742
- `}let{getCachedRouterScript:Y,getServeClientAsset:Q}=await import("./chunk-vxxj6sqn.js"),G=Z?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':Z?.buildMode==="serve"?`<script data-stx-router src="${(await Q("router")).url}"></script>`:`<script data-stx-router>${await Y()}</script>`,z=$.lastIndexOf("</body>");return $.slice(0,z)+X+G+`
3743
- </body>`+$.slice(z+7)}var _8=Symbol.for("stx.lazy-module-promises");function Bz(){let $=globalThis;return $[_8]??=new Map,$[_8]}function s($,Z){let J=Bz(),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 n$=`(?:"[^"]*"|'[^']*'|[^>"'])*`,T8=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s,Vz=65536,Lz=4,u9=new Map;function lL(){u9.clear()}function _z($){let Z=[];for(let J of f2($,U2)){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 Oz($,Z={}){let J=$.length>=Vz,X=J?u9.get($):void 0;if(X===void 0){if(X=_z($),J)I8(u9,Lz),u9.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 r$($){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}=O8(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}=O8(Y);if(G)return{style:"in",iterable:Q,itemVar:G,indexVar:z}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function O8($){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 a$($,Z){return A8($,Z)}function Fz($){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 k8($){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|useModel)\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 wz($){if(!/[:@]for\s*=/.test($)&&!/\bx-for\s*=/.test($))return[];let Z=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${n$})>`,"iy"),J=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,X=f2($,(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),K=r$(z?.[1]??z?.[2]??""),q=[K.itemVar,K.indexVar].filter(Boolean);if(q.length===0)continue;let W=G[1],H=/\/\s*>$/.test(Q.token)||m9.has(W.toLowerCase())?Q.end:t$($,Q.start,W,Q.end);if(H!==-1)Y.push({start:Q.start,end:H,vars:new Set(q)})}return Y}var F8=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 Rz($){return $.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function w8($,Z,J,X){if(!$)return!1;let Y=Rz($),Q=!1,G=!1,z=!1,K=/([a-zA-Z_$][\w$]*)/g,q;while((q=K.exec(Y))!==null){let j=q[1];if(Y.slice(0,q.index).trimEnd().endsWith("."))continue;if(F8.has(j))continue;if(Z.has(j)||X?.has(j))Q=!0;else if(J&&j in J)G=!0}let W=/([a-zA-Z_$][\w$]*)(?:\.[a-zA-Z_$][\w$]*)*\s*\(\s*\)/g,U;while((U=W.exec(Y))!==null){let j=U[1];if(Y.slice(0,U.index).trimEnd().endsWith("."))continue;if(F8.has(j)||J&&j in J)continue;z=!0}return(Q||z)&&!G}function h9($,Z,J){let X=J===void 0?` ${Z}`:` ${Z}="${J.replace(/"/g,"&quot;")}"`,Y=$.trim(),Q=Y.match(T8);if(Q&&Dz(Q[3],Q[1])){let[,G,z,K]=Q;return`<${G}${z}${X}>${K}</${G}>`}return`<template${X}>${Y}</template>`}function Dz($,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 E8($,Z){let J=k8($);function X(Y){let Q=Y,G=wz(Y),z=(U)=>{let H=new Set;for(let j of G)if(U>j.start&&U<j.end)for(let B of j.vars)H.add(B);return H},K=/@if\s*\(/g,q,W=[];while((q=K.exec(Q))!==null){let U=q.index,H=U+q[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(),_=B,L=1,F=_,O=/@(if\s*\(|endif)/g;O.lastIndex=_;let w;while((w=O.exec(Q))!==null)if(w[1].startsWith("if"))L++;else if(w[1]==="endif"){if(L--,L===0){F=w.index+w[0].length;break}}if(L!==0)continue;let R=Q.substring(_,F-6).trim(),D;if(Fz(R)){let N=D2(Q.substring(U,F));if(N.length===0)continue;let I=N[0].branches.filter((A)=>A.type!=="else"),M=z(U);if(!(I.length>0&&I.every((A)=>w8(A.condition,J,Z,M))))continue;D=N[0].branches.map((A)=>{let E=X(A.content);if(A.type==="elseif")return h9(E,"@else-if",A.condition??"");if(A.type==="else")return h9(E,"@else");return h9(E,"@if",A.condition??"")}).join(`
3744
- `)}else{if(!w8(V,J,Z,z(U)))continue;D=h9(X(R),"@if",V)}W.push({start:U,end:F,replacement:D}),K.lastIndex=F}for(let U=W.length-1;U>=0;U--){let{start:H,end:j,replacement:B}=W[U];Q=Q.substring(0,H)+B+Q.substring(j)}return Q}return X($)}function Nz($){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 m9=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),R8=/<(script|style)\b/iy,Mz=/<\/script/gi,Az=/<\/style/gi;function t$($,Z,J,X){if(m9.has(J.toLowerCase()))return X;let Y=J.toLowerCase(),Q=$.length,G=1,z=X;while(z<Q){let K=$.indexOf("<",z);if(K===-1)return-1;if(z=K,$.startsWith("<!--",z)){let H=$.indexOf("-->",z+4);if(H===-1)return-1;z=H+3;continue}R8.lastIndex=z;let q=R8.exec($);if(q){let H=$.indexOf(">",z);if(H===-1)return-1;if($[H-1]==="/"){z=H+1;continue}let j=q[1].toLowerCase()==="script"?Mz:Az;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 W=/^<([a-z][\w-]*)\b/i.exec($.slice(z,z+64));if(!W){z++;continue}let U=$.indexOf(">",z);if(U===-1)return-1;if(W[1].toLowerCase()===Y){let H=$.slice(z,U+1);if(!(/\/\s*>$/.test(H)||m9.has(Y)))G++}z=U+1}return-1}var Iz=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function Tz($,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 Iz.test(Q)}function y8($){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=(U)=>Z.some(([H,j])=>U>=H&&U<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[U,H,j,B,V,_,L]=z,F=Nz(V);if(F===void 0)continue;let O=z.index,w=O+U.length,N=!!L||/\/\s*>$/.test(U)||m9.has(H.toLowerCase())?w:t$($,O,H,w);if(N===-1)continue;if((B===":if"||B==="x-if"||B==="@if")&&Tz($,N)){Q.lastIndex=w;continue}if(F===!0){let M=`<${H}${j}${_}${L}>`;G.push({start:O,end:w,replacement:M});continue}G.push({start:O,end:N,replacement:""}),Q.lastIndex=N}if(G.length===0)return $;G.sort((U,H)=>U.start-H.start);let K=[],q=-1;for(let U of G){if(U.start<q)continue;K.push(U),q=U.end}let W=$;for(let U=K.length-1;U>=0;U--){let{start:H,end:j,replacement:B}=K[U];W=W.substring(0,H)+B+W.substring(j)}return W}var D8=[":for","@for","x-for"];function e$($,Z){if(!Z||Object.keys(Z).length===0)return $;if(!D8.some((z)=>$.includes(`${z}=`)))return $;let J=k8($),X=$,Y=[],Q=/<([a-zA-Z][\w-]*)((?:[^>"']|"[^"]*"|'[^']*')*)>/g,G;while((G=Q.exec(X))!==null){let[z,K,q]=G,W=G.index,U=W+z.length,H=D8.map((D)=>({attr:D,m:new RegExp(`\\s${D}="([^"]*)"`).exec(q)})).find((D)=>D.m!==null);if(!H||!H.m)continue;let j=r$(H.m[1]);if(!j.iterable||!j.itemVar)continue;let B=j.iterable.trim().split(/[.[(]/)[0].trim();if(!B||J.has(B)||!(B in Z))continue;let V=t$(X,W,K,U);if(V===-1)continue;let _=q.replace(new RegExp(`\\s${H.attr}="[^"]*"`),"").replace(/\s:key="[^"]*"/,"").replace(/\sx-cloak(?=\s|$)/,""),L=X.slice(U,V-`</${K}>`.length),F={...Z,[j.itemVar]:void 0};if(j.indexVar)F[j.indexVar]=void 0;let O=e$(L,F),w=j.indexVar?`${j.iterable} as ${j.indexVar} => ${j.itemVar}`:`${j.iterable} as ${j.itemVar}`,R=K.toLowerCase()==="template"?O:`<${K}${_}>${O}</${K}>`;Y.push({start:W,end:V,replacement:`@foreach(${w})${R}@endforeach`}),Q.lastIndex=V}for(let z=Y.length-1;z>=0;z--){let{start:K,end:q,replacement:W}=Y[z];X=X.slice(0,K)+W+X.slice(q)}return X}function $3($,Z){let J=$,X=/@(for|foreach)\s*\(/g,Y,Q=[],G=[];while((Y=X.exec(J))!==null){let z=Y[1],K=Y.index,q=K+Y[0].length,W=1,U=q;while(U<J.length&&W>0){if(J[U]==="(")W++;else if(J[U]===")")W--;U++}if(W!==0)continue;let H=J.substring(q,U-1).trim(),j=U,B=r$(H),V=z==="for"?"@endfor":"@endforeach",_=1,L=j,F=z==="for"?new RegExp("@(for(?!each)\\s*\\(|endfor(?!each))","g"):new RegExp(`@(${z}\\s*\\(|end${z})`,"g");F.lastIndex=j;let O;while((O=F.exec(J))!==null)if(O[1].startsWith(z))_++;else if(_--,_===0){L=O.index+O[0].length;break}if(_!==0)continue;let w=()=>{let T=[B.itemVar,B.indexVar].filter(Boolean);if(T.length)G.push({start:K,end:L,vars:T})};if(B.iterable){let T=B.iterable.trim();if(T.startsWith("[")||T.startsWith("{")||T.startsWith("'")||T.startsWith('"')||T.startsWith("`")||/^-?\d/.test(T)){w();continue}let k=T.split(/[.[(]/)[0].trim(),A=Z?k in Z:!1,E=G.some((C)=>K>C.start&&K<C.end&&C.vars.includes(k));if(k&&(A||E)){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,L-V.length).trim(),D=Z?{...Z}:{};if(B.itemVar)delete D[B.itemVar];if(B.indexVar)delete D[B.indexVar];let N=$3(R,D),I=N.match(T8),M;if(I){let[,T,k,A]=I;M=`<${T}${k} @for="${H}">${A}</${T}>`}else M=`<template @for="${H}">${N}</template>`;Q.push({start:K,end:L,replacement:M}),X.lastIndex=L}for(let z=Q.length-1;z>=0;z--){let{start:K,end:q,replacement:W}=Q[z];J=J.substring(0,K)+W+J.substring(q)}return J}function kz($){let Z=new Set,J=[],X=0,Y=0,Q=$.length,G=(W)=>{let U=X+1;while(U<Q){let H=$[U];if(H==="\\"){U+=2;continue}if(H===W)return U+1;U++}return Q},z=()=>{let W=X+2;while(W<Q&&$[W]!==`
3815
+ ${$.slice(J)}`}var Hz=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function jz($){return Hz.test($)||$.includes("__stxRouter)return")||$.includes("__stxRouter=true")}async function Bz($,Z){if(!$.includes("</body>"))return $;if(jz($))return $;let J=Z?.router,X="";{let K={};if(J){if(J.container)K.container=J.container;if(J.interceptAllLinks!==void 0)K.interceptAllLinks=J.interceptAllLinks;if(J.progress!==void 0)K.progress=J.progress;if(J.viewTransitions!==void 0)K.viewTransitions=J.viewTransitions;if(J.viewTransitionDuration!==void 0)K.viewTransitionDuration=J.viewTransitionDuration;if(J.viewTransitionEasing!==void 0)K.viewTransitionEasing=J.viewTransitionEasing;if(J.scrollToTop!==void 0)K.scrollToTop=J.scrollToTop;if(J.scrollRestoration!==void 0)K.scrollRestoration=J.scrollRestoration;if(J.prefetch!==void 0)K.prefetch=J.prefetch;if(J.cache!==void 0)K.cache=J.cache;if(J.progressColor!==void 0)K.progressColor=J.progressColor;if(J.progressHeight!==void 0)K.progressHeight=J.progressHeight}try{let q=await H8(Z?.pagesDir,Z?.root);if(q.length>0)K.ownedRoutes=q}catch{}if(Object.keys(K).length>0)X=`<script>window.__stxRouterConfig=${j8(K)};</script>
3816
+ `}let{getCachedRouterScript:Y,getServeClientAsset:Q}=await import("./chunk-b891w7hr.js"),G=Z?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':Z?.buildMode==="serve"?`<script data-stx-router src="${(await Q("router")).url}"></script>`:`<script data-stx-router>${await Y()}</script>`,z=$.lastIndexOf("</body>");return $.slice(0,z)+X+G+`
3817
+ </body>`+$.slice(z+7)}var _8=Symbol.for("stx.lazy-module-promises");function Vz(){let $=globalThis;return $[_8]??=new Map,$[_8]}function s($,Z){let J=Vz(),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 n$=`(?:"[^"]*"|'[^']*'|[^>"'])*`,T8=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s,Lz=65536,_z=4,u9=new Map;function cL(){u9.clear()}function Oz($){let Z=[];for(let J of f2($,U2)){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 Fz($,Z={}){let J=$.length>=Lz,X=J?u9.get($):void 0;if(X===void 0){if(X=Oz($),J)I8(u9,_z),u9.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 r$($){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}=O8(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}=O8(Y);if(G)return{style:"in",iterable:Q,itemVar:G,indexVar:z}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function O8($){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 a$($,Z){return A8($,Z)}function wz($){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 k8($){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|useModel)\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 Rz($){if(!/[:@]for\s*=/.test($)&&!/\bx-for\s*=/.test($))return[];let Z=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${n$})>`,"iy"),J=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,X=f2($,(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),K=r$(z?.[1]??z?.[2]??""),q=[K.itemVar,K.indexVar].filter(Boolean);if(q.length===0)continue;let W=G[1],H=/\/\s*>$/.test(Q.token)||m9.has(W.toLowerCase())?Q.end:t$($,Q.start,W,Q.end);if(H!==-1)Y.push({start:Q.start,end:H,vars:new Set(q)})}return Y}var F8=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 Dz($){return $.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function w8($,Z,J,X){if(!$)return!1;let Y=Dz($),Q=!1,G=!1,z=!1,K=/([a-zA-Z_$][\w$]*)/g,q;while((q=K.exec(Y))!==null){let j=q[1];if(Y.slice(0,q.index).trimEnd().endsWith("."))continue;if(F8.has(j))continue;if(Z.has(j)||X?.has(j))Q=!0;else if(J&&j in J)G=!0}let W=/([a-zA-Z_$][\w$]*)(?:\.[a-zA-Z_$][\w$]*)*\s*\(\s*\)/g,U;while((U=W.exec(Y))!==null){let j=U[1];if(Y.slice(0,U.index).trimEnd().endsWith("."))continue;if(F8.has(j)||J&&j in J)continue;z=!0}return(Q||z)&&!G}function h9($,Z,J){let X=J===void 0?` ${Z}`:` ${Z}="${J.replace(/"/g,"&quot;")}"`,Y=$.trim(),Q=Y.match(T8);if(Q&&Nz(Q[3],Q[1])){let[,G,z,K]=Q;return`<${G}${z}${X}>${K}</${G}>`}return`<template${X}>${Y}</template>`}function Nz($,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 E8($,Z){let J=k8($);function X(Y){let Q=Y,G=Rz(Y),z=(U)=>{let H=new Set;for(let j of G)if(U>j.start&&U<j.end)for(let B of j.vars)H.add(B);return H},K=/@if\s*\(/g,q,W=[];while((q=K.exec(Q))!==null){let U=q.index,H=U+q[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(),_=B,L=1,F=_,O=/@(if\s*\(|endif)/g;O.lastIndex=_;let w;while((w=O.exec(Q))!==null)if(w[1].startsWith("if"))L++;else if(w[1]==="endif"){if(L--,L===0){F=w.index+w[0].length;break}}if(L!==0)continue;let R=Q.substring(_,F-6).trim(),D;if(wz(R)){let N=D2(Q.substring(U,F));if(N.length===0)continue;let I=N[0].branches.filter((A)=>A.type!=="else"),M=z(U);if(!(I.length>0&&I.every((A)=>w8(A.condition,J,Z,M))))continue;D=N[0].branches.map((A)=>{let E=X(A.content);if(A.type==="elseif")return h9(E,"@else-if",A.condition??"");if(A.type==="else")return h9(E,"@else");return h9(E,"@if",A.condition??"")}).join(`
3818
+ `)}else{if(!w8(V,J,Z,z(U)))continue;D=h9(X(R),"@if",V)}W.push({start:U,end:F,replacement:D}),K.lastIndex=F}for(let U=W.length-1;U>=0;U--){let{start:H,end:j,replacement:B}=W[U];Q=Q.substring(0,H)+B+Q.substring(j)}return Q}return X($)}function Mz($){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 m9=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),R8=/<(script|style)\b/iy,Az=/<\/script/gi,Iz=/<\/style/gi;function t$($,Z,J,X){if(m9.has(J.toLowerCase()))return X;let Y=J.toLowerCase(),Q=$.length,G=1,z=X;while(z<Q){let K=$.indexOf("<",z);if(K===-1)return-1;if(z=K,$.startsWith("<!--",z)){let H=$.indexOf("-->",z+4);if(H===-1)return-1;z=H+3;continue}R8.lastIndex=z;let q=R8.exec($);if(q){let H=$.indexOf(">",z);if(H===-1)return-1;if($[H-1]==="/"){z=H+1;continue}let j=q[1].toLowerCase()==="script"?Az:Iz;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 W=/^<([a-z][\w-]*)\b/i.exec($.slice(z,z+64));if(!W){z++;continue}let U=$.indexOf(">",z);if(U===-1)return-1;if(W[1].toLowerCase()===Y){let H=$.slice(z,U+1);if(!(/\/\s*>$/.test(H)||m9.has(Y)))G++}z=U+1}return-1}var Tz=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function kz($,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 Tz.test(Q)}function y8($){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=(U)=>Z.some(([H,j])=>U>=H&&U<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[U,H,j,B,V,_,L]=z,F=Mz(V);if(F===void 0)continue;let O=z.index,w=O+U.length,N=!!L||/\/\s*>$/.test(U)||m9.has(H.toLowerCase())?w:t$($,O,H,w);if(N===-1)continue;if((B===":if"||B==="x-if"||B==="@if")&&kz($,N)){Q.lastIndex=w;continue}if(F===!0){let M=`<${H}${j}${_}${L}>`;G.push({start:O,end:w,replacement:M});continue}G.push({start:O,end:N,replacement:""}),Q.lastIndex=N}if(G.length===0)return $;G.sort((U,H)=>U.start-H.start);let K=[],q=-1;for(let U of G){if(U.start<q)continue;K.push(U),q=U.end}let W=$;for(let U=K.length-1;U>=0;U--){let{start:H,end:j,replacement:B}=K[U];W=W.substring(0,H)+B+W.substring(j)}return W}var D8=[":for","@for","x-for"];function e$($,Z){if(!Z||Object.keys(Z).length===0)return $;if(!D8.some((z)=>$.includes(`${z}=`)))return $;let J=k8($),X=$,Y=[],Q=/<([a-zA-Z][\w-]*)((?:[^>"']|"[^"]*"|'[^']*')*)>/g,G;while((G=Q.exec(X))!==null){let[z,K,q]=G,W=G.index,U=W+z.length,H=D8.map((D)=>({attr:D,m:new RegExp(`\\s${D}="([^"]*)"`).exec(q)})).find((D)=>D.m!==null);if(!H||!H.m)continue;let j=r$(H.m[1]);if(!j.iterable||!j.itemVar)continue;let B=j.iterable.trim().split(/[.[(]/)[0].trim();if(!B||J.has(B)||!(B in Z))continue;let V=t$(X,W,K,U);if(V===-1)continue;let _=q.replace(new RegExp(`\\s${H.attr}="[^"]*"`),"").replace(/\s:key="[^"]*"/,"").replace(/\sx-cloak(?=\s|$)/,""),L=X.slice(U,V-`</${K}>`.length),F={...Z,[j.itemVar]:void 0};if(j.indexVar)F[j.indexVar]=void 0;let O=e$(L,F),w=j.indexVar?`${j.iterable} as ${j.indexVar} => ${j.itemVar}`:`${j.iterable} as ${j.itemVar}`,R=K.toLowerCase()==="template"?O:`<${K}${_}>${O}</${K}>`;Y.push({start:W,end:V,replacement:`@foreach(${w})${R}@endforeach`}),Q.lastIndex=V}for(let z=Y.length-1;z>=0;z--){let{start:K,end:q,replacement:W}=Y[z];X=X.slice(0,K)+W+X.slice(q)}return X}function $3($,Z){let J=$,X=/@(for|foreach)\s*\(/g,Y,Q=[],G=[];while((Y=X.exec(J))!==null){let z=Y[1],K=Y.index,q=K+Y[0].length,W=1,U=q;while(U<J.length&&W>0){if(J[U]==="(")W++;else if(J[U]===")")W--;U++}if(W!==0)continue;let H=J.substring(q,U-1).trim(),j=U,B=r$(H),V=z==="for"?"@endfor":"@endforeach",_=1,L=j,F=z==="for"?new RegExp("@(for(?!each)\\s*\\(|endfor(?!each))","g"):new RegExp(`@(${z}\\s*\\(|end${z})`,"g");F.lastIndex=j;let O;while((O=F.exec(J))!==null)if(O[1].startsWith(z))_++;else if(_--,_===0){L=O.index+O[0].length;break}if(_!==0)continue;let w=()=>{let T=[B.itemVar,B.indexVar].filter(Boolean);if(T.length)G.push({start:K,end:L,vars:T})};if(B.iterable){let T=B.iterable.trim();if(T.startsWith("[")||T.startsWith("{")||T.startsWith("'")||T.startsWith('"')||T.startsWith("`")||/^-?\d/.test(T)){w();continue}let k=T.split(/[.[(]/)[0].trim(),A=Z?k in Z:!1,E=G.some((C)=>K>C.start&&K<C.end&&C.vars.includes(k));if(k&&(A||E)){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,L-V.length).trim(),D=Z?{...Z}:{};if(B.itemVar)delete D[B.itemVar];if(B.indexVar)delete D[B.indexVar];let N=$3(R,D),I=N.match(T8),M;if(I){let[,T,k,A]=I;M=`<${T}${k} @for="${H}">${A}</${T}>`}else M=`<template @for="${H}">${N}</template>`;Q.push({start:K,end:L,replacement:M}),X.lastIndex=L}for(let z=Q.length-1;z>=0;z--){let{start:K,end:q,replacement:W}=Q[z];J=J.substring(0,K)+W+J.substring(q)}return J}function Ez($){let Z=new Set,J=[],X=0,Y=0,Q=$.length,G=(W)=>{let U=X+1;while(U<Q){let H=$[U];if(H==="\\"){U+=2;continue}if(H===W)return U+1;U++}return Q},z=()=>{let W=X+2;while(W<Q&&$[W]!==`
3745
3819
  `)W++;return W},K=()=>{let W=X+2;while(W<Q-1){if($[W]==="*"&&$[W+1]==="/")return W+2;W++}return Q},q=(W)=>{let U=W,H=0;while(U<Q){let j=$[U];if(j==="/"&&$[U+1]==="/"){let B=U+2;while(B<Q&&$[B]!==`
3746
- `)B++;U=B;continue}if(j==="/"&&$[U+1]==="*"){let B=U+2;while(B<Q-1&&!($[B]==="*"&&$[B+1]==="/"))B++;U=B+2;continue}if(j==='"'||j==="'"||j==="`"){let B=U+1;while(B<Q){if($[B]==="\\"){B+=2;continue}if($[B]===j){B++;break}B++}U=B;continue}if(j==="("||j==="["||j==="{"){H++,U++;continue}if(j===")"||j==="]"||j==="}"){H--,U++;continue}if(j===";"&&H===0)return U+1;U++}return Q};while(X<Q){let W=$[X];if(W==="/"&&$[X+1]==="/"){let U=z();J.push($.slice(X,U)),X=U;continue}if(W==="/"&&$[X+1]==="*"){let U=K();J.push($.slice(X,U)),X=U;continue}if(W==='"'||W==="'"||W==="`"){let U=G(W);J.push($.slice(X,U)),X=U;continue}if(W==="{"){Y++,J.push(W),X++;continue}if(W==="}"){Y--,J.push(W),X++;continue}if(Y===0){let U=X>0?$[X-1]:"";if(U===""||/\s/.test(U)||U===";"||U==="}"||U==="{"){let j=$.slice(X).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(j){let B=j[2],V=q(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(W),X++}return J.join("")}var Ez=new Set(["script","style","html","head","meta","link","title","!doctype"]);function s$($,Z,J){for(let X of J){if(X.start>=Z)return!1;if(X.end>$)return!0}return!1}function yz($,Z,J){let X=0;while(X<$.length){let Y=$.indexOf(Z,X);if(Y===-1)return!1;if(!s$(Y,Y+Z.length,J))return!0;X=Y+Z.length}return!1}function bz($,Z){if(yz($,"<body",Z)){let Y=new RegExp(`<body(${n$})>`,"g"),Q;while((Q=Y.exec($))!==null)if(!s$(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(${n$})>`,"gi"),X;while((X=J.exec($))!==null){if(s$(X.index,X.index+X[0].length,Z))continue;if(Ez.has(X[1].toLowerCase()))continue;return X.index+X[0].length-1}return null}function Sz($,Z,J,X){let Y=[],Q=` data-stx="${X}"`,G=0,z=!1,K=(q)=>{if(J!==null&&!z&&J>=G&&J<=q)Y.push($.slice(G,J),Q,$.slice(J,q)),z=!0;else Y.push($.slice(G,q))};for(let q of Z){if(q.start<G)continue;K(q.start),G=q.end}return K($.length),Y.join("")}async function Cz($,Z,J){let X=Oz($,{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|keptState|useCookie|useId|useModel|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,Q=[],{hasUserImports:G,bundleClientScript:z}=await s("stx/client-script-bundler",()=>import("./chunk-mjdsjxm5.js"));for(let F of X){let O=F.body;if(T1(F.attrs))O=k1(O);if(Y.test(O)){Q.push({content:O,start:F.start,end:F.end});continue}if(!G(O))continue;try{let w=await z(J2(O).code,Z||"",{projectRoot:process.cwd(),externalizeUserModules:!1});if(Y.test(w))Q.push({content:O,start:F.start,end:F.end})}catch{}}if(Q.length===0)return{output:$,setupCode:null};let K=`${Z??""}\x00${Q.map((F)=>F.content).join("\x00")}`,q=`__stx_setup_${Bun.hash(K).toString(36).slice(0,10)}`,W=[];for(let F=0;F<Q.length;F++){let O=Q[F].bundled??J2(Q[F].content).code;if(!Q[F].bundled&&G(O))O=await z(O,Z||"",{projectRoot:process.cwd()});O=fz(O);let w=$1(O);W.push(`// \u2500\u2500 merged signal script #${F+1} \u2500\u2500
3820
+ `)B++;U=B;continue}if(j==="/"&&$[U+1]==="*"){let B=U+2;while(B<Q-1&&!($[B]==="*"&&$[B+1]==="/"))B++;U=B+2;continue}if(j==='"'||j==="'"||j==="`"){let B=U+1;while(B<Q){if($[B]==="\\"){B+=2;continue}if($[B]===j){B++;break}B++}U=B;continue}if(j==="("||j==="["||j==="{"){H++,U++;continue}if(j===")"||j==="]"||j==="}"){H--,U++;continue}if(j===";"&&H===0)return U+1;U++}return Q};while(X<Q){let W=$[X];if(W==="/"&&$[X+1]==="/"){let U=z();J.push($.slice(X,U)),X=U;continue}if(W==="/"&&$[X+1]==="*"){let U=K();J.push($.slice(X,U)),X=U;continue}if(W==='"'||W==="'"||W==="`"){let U=G(W);J.push($.slice(X,U)),X=U;continue}if(W==="{"){Y++,J.push(W),X++;continue}if(W==="}"){Y--,J.push(W),X++;continue}if(Y===0){let U=X>0?$[X-1]:"";if(U===""||/\s/.test(U)||U===";"||U==="}"||U==="{"){let j=$.slice(X).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(j){let B=j[2],V=q(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(W),X++}return J.join("")}var yz=new Set(["script","style","html","head","meta","link","title","!doctype"]);function s$($,Z,J){for(let X of J){if(X.start>=Z)return!1;if(X.end>$)return!0}return!1}function bz($,Z,J){let X=0;while(X<$.length){let Y=$.indexOf(Z,X);if(Y===-1)return!1;if(!s$(Y,Y+Z.length,J))return!0;X=Y+Z.length}return!1}function Sz($,Z){if(bz($,"<body",Z)){let Y=new RegExp(`<body(${n$})>`,"g"),Q;while((Q=Y.exec($))!==null)if(!s$(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(${n$})>`,"gi"),X;while((X=J.exec($))!==null){if(s$(X.index,X.index+X[0].length,Z))continue;if(yz.has(X[1].toLowerCase()))continue;return X.index+X[0].length-1}return null}function Cz($,Z,J,X){let Y=[],Q=` data-stx="${X}"`,G=0,z=!1,K=(q)=>{if(J!==null&&!z&&J>=G&&J<=q)Y.push($.slice(G,J),Q,$.slice(J,q)),z=!0;else Y.push($.slice(G,q))};for(let q of Z){if(q.start<G)continue;K(q.start),G=q.end}return K($.length),Y.join("")}async function Pz($,Z,J){let X=Fz($,{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|keptState|useCookie|useId|useModel|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,Q=[],{hasUserImports:G,bundleClientScript:z}=await s("stx/client-script-bundler",()=>import("./chunk-4j9n5z1q.js"));for(let F of X){let O=F.body;if(T1(F.attrs))O=k1(O);if(Y.test(O)){Q.push({content:O,start:F.start,end:F.end});continue}if(!G(O))continue;try{let w=await z(J2(O).code,Z||"",{projectRoot:process.cwd(),externalizeUserModules:!1});if(Y.test(w))Q.push({content:O,start:F.start,end:F.end})}catch{}}if(Q.length===0)return{output:$,setupCode:null};let K=`${Z??""}\x00${Q.map((F)=>F.content).join("\x00")}`,q=`__stx_setup_${Bun.hash(K).toString(36).slice(0,10)}`,W=[];for(let F=0;F<Q.length;F++){let O=Q[F].bundled??J2(Q[F].content).code;if(!Q[F].bundled&&G(O))O=await z(O,Z||"",{projectRoot:process.cwd()});O=gz(O);let w=$1(O);W.push(`// \u2500\u2500 merged signal script #${F+1} \u2500\u2500
3747
3821
  ${w}`)}let U=W.join(`
3748
3822
 
3749
- `);U=kz(U);let H=Pz(U),j=H.split(",").map((F)=>F.trim()).filter(Boolean),B=o$(U,J),V=`
3823
+ `);U=Ez(U);let H=vz(U),j=H.split(",").map((F)=>F.trim()).filter(Boolean),B=o$(U,J),V=`
3750
3824
  <script data-stx-scoped>
3751
3825
  function ${q}() {
3752
3826
  ${o1("const",j)}
@@ -3755,65 +3829,65 @@ ${Z2(`${B}${U}`)}
3755
3829
  }
3756
3830
  window.__stx_latestSetup=${q};
3757
3831
  if(window.stx)window.stx._latestSetup=${q};
3758
- </script>`,_=bz($,Q);return{output:Sz($,Q,_,q),setupCode:V}}function Pz($){let Z=$,J=[],X=new Set,Y=0,Q=0,G=Z.length,z="",K=()=>{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===`
3832
+ </script>`,_=Sz($,Q);return{output:Cz($,Q,_,q),setupCode:V}}function vz($){let Z=$,J=[],X=new Set,Y=0,Q=0,G=Z.length,z="",K=()=>{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===`
3759
3833
  `)return;Q++}},q=()=>{if(!z)return!0;if(/[\w)\]]/.test(z))return!1;return!0},W=(B)=>{Q++;while(Q<G){if(Z[Q]==="\\"){Q+=2;continue}if(Z[Q]===B){Q++;return}Q++}},U=()=>{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]==='"')W(Z[Q]);else if(Z[Q]==="`")U();else Q++;continue}Q++}},H=()=>{if(Z[Q]==="/"&&Z[Q+1]==="/"){while(Q<G&&Z[Q]!==`
3760
- `)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 O=B[2];if(!X.has(O))J.push(O),X.add(O);return}let V=Z.slice(Q).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(V){V[1].split(",").forEach((O)=>{let w=O.trim();if(!w)return;let R=w.indexOf(":"),N=(R>=0?w.slice(R+1).trim():w).split(/[\s=]/)[0];if(N&&!X.has(N))J.push(N),X.add(N)});return}let _=Z.slice(Q).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(_){_[1].split(",").forEach((O)=>{let w=O.trim().replace(/^\.\.\./,"");if(!w)return;let R=w.split(/[\s=]/)[0];if(R&&!X.has(R))J.push(R),X.add(R)});return}let L=Z.slice(Q).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(L){let O=L[1];if(!X.has(O))J.push(O),X.add(O);return}let F=Z.slice(Q).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(F){let O=F[1];if(!X.has(O))J.push(O),X.add(O)}};while(Q<G){if(H())continue;if(Z[Q]==="'"||Z[Q]==='"'){W(Z[Q]),z=Z[Q-1];continue}if(Z[Q]==="`"){U(),z="`";continue}if(Z[Q]==="/"&&Z[Q+1]!=="/"&&Z[Q+1]!=="*"&&q()){K(),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 b8($,Z,J,X){if(!a$($,J))return $;let Y=$;if(Z.skipSignalsRuntime)return Y;let{output:Q,setupCode:G}=await Cz(Y,J,X);if(Y=Q,!G){let z=p0(Y);if(z&&!/data-stx/.test(z.attrs)&&!/data-stx-auto/.test(z.attrs)){let K=z.tag.replace(/^<body([^>]*)>$/i,"<body$1 data-stx-auto>");Y=Y.slice(0,z.index)+K+Y.slice(z.index+z.tag.length)}}if(Y=await g9(Y,Z),G){let z=N8(Y,/<\/head>/i),K=z===-1?N8(Y,/<body[^>]*>/i):-1;if(z!==-1)Y=`${Y.slice(0,z)}${G}
3834
+ `)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 O=B[2];if(!X.has(O))J.push(O),X.add(O);return}let V=Z.slice(Q).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(V){V[1].split(",").forEach((O)=>{let w=O.trim();if(!w)return;let R=w.indexOf(":"),N=(R>=0?w.slice(R+1).trim():w).split(/[\s=]/)[0];if(N&&!X.has(N))J.push(N),X.add(N)});return}let _=Z.slice(Q).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(_){_[1].split(",").forEach((O)=>{let w=O.trim().replace(/^\.\.\./,"");if(!w)return;let R=w.split(/[\s=]/)[0];if(R&&!X.has(R))J.push(R),X.add(R)});return}let L=Z.slice(Q).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(L){let O=L[1];if(!X.has(O))J.push(O),X.add(O);return}let F=Z.slice(Q).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(F){let O=F[1];if(!X.has(O))J.push(O),X.add(O)}};while(Q<G){if(H())continue;if(Z[Q]==="'"||Z[Q]==='"'){W(Z[Q]),z=Z[Q-1];continue}if(Z[Q]==="`"){U(),z="`";continue}if(Z[Q]==="/"&&Z[Q+1]!=="/"&&Z[Q+1]!=="*"&&q()){K(),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 b8($,Z,J,X){if(!a$($,J))return $;let Y=$;if(Z.skipSignalsRuntime)return Y;let{output:Q,setupCode:G}=await Pz(Y,J,X);if(Y=Q,!G){let z=p0(Y);if(z&&!/data-stx/.test(z.attrs)&&!/data-stx-auto/.test(z.attrs)){let K=z.tag.replace(/^<body([^>]*)>$/i,"<body$1 data-stx-auto>");Y=Y.slice(0,z.index)+K+Y.slice(z.index+z.tag.length)}}if(Y=await g9(Y,Z),G){let z=N8(Y,/<\/head>/i),K=z===-1?N8(Y,/<body[^>]*>/i):-1;if(z!==-1)Y=`${Y.slice(0,z)}${G}
3761
3835
  ${Y.slice(z)}`;else if(K!==-1){let q=/<body[^>]*>/i.exec(Y.slice(K))[0],W=K+q.length;Y=`${Y.slice(0,W)}
3762
3836
  ${G}${Y.slice(W)}`}else Y=`${Y}
3763
- ${G}`}return Y}function N8($,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 K=G+z.index;if(!X.some(([W,U])=>K>=W&&K<U))return K;G=K+Math.max(z[0].length,1)}return-1}var M8="/* [stx import stripped, resolved via window.stx in __stx_setup] */";function vz($){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 M8;return`var ${Z.join(", ")}; ${M8}`}var xz=/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"](?:stx|@stacksjs\/stx|@stacksjs\/browser)['"]\s*;?\s*$/gm;function fz($){return $.replace(xz,(Z,J)=>vz(J))}import Y2 from"path";import S8 from"process";function X2($="STX_PUBLIC_"){let Z={},J={};for(let[X,Y]of Object.entries(S8.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 iL($="STX_PUBLIC_"){let Z={};for(let[J,X]of Object.entries(S8.env))if(J.startsWith($)&&X!==void 0)Z[J]=X;return Z}function C8($){return $.startsWith("http://")||$.startsWith("https://")||$.startsWith("//")}async function P8($,Z,J){try{let X;if($.startsWith("/")){let Y=Z;for(let Q=0;Q<5;Q++){let G=Y2.join(Y,$);if(await Bun.file(G).exists())return G;Y=Y2.dirname(Y)}X=Y2.join(Z,$)}else if($.startsWith("./")||$.startsWith("../"))X=Y2.resolve(Z,$);else X=Y2.resolve(Z,$);if(await Bun.file(X).exists())return X;return null}catch{return null}}var v8=Symbol.for("stx.inline-assets.import-meta");function gz($,Z){if(!$.includes("import.meta"))return;let J=Error(`[stx] ${Z} still references \`import.meta\` after bundling, and it is being inlined as a classic <script> where that is a SyntaxError \u2014 the whole script fails to parse, taking every other script on the page with it.
3764
- `+" `import.meta.env.STX_PUBLIC_*` is substituted at build time and is safe; anything else is not.\n Fix it by moving the module-only code (`import.meta.glob`, `import.meta.url`) into its own module, or by resolving the value without `import.meta`.");throw J[v8]=!0,J}async function x8($,Z,J){let X=$,Y=Y2.dirname(Z),Q=/<script\b([^>]*)src=["']([^"']+)["']([^>]*)><\/script>/gi,G;while((G=Q.exec(X))!==null){let[q,W,U,H]=G;if(C8(U))continue;let j=await P8(U,Y,Z);if(j)try{let B=await Bun.file(j).text();if(J.add(j),U.endsWith(".ts")||U.endsWith(".tsx")){let _=await Bun.build({entrypoints:[j],target:"browser",minify:!0,define:X2()});if(_.outputs.length>0)B=await _.outputs[0].text(),gz(B,U)}let V=`<script>
3837
+ ${G}`}return Y}function N8($,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 K=G+z.index;if(!X.some(([W,U])=>K>=W&&K<U))return K;G=K+Math.max(z[0].length,1)}return-1}var M8="/* [stx import stripped, resolved via window.stx in __stx_setup] */";function xz($){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 M8;return`var ${Z.join(", ")}; ${M8}`}var fz=/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"](?:stx|@stacksjs\/stx|@stacksjs\/browser)['"]\s*;?\s*$/gm;function gz($){return $.replace(fz,(Z,J)=>xz(J))}import Y2 from"path";import S8 from"process";function X2($="STX_PUBLIC_"){let Z={},J={};for(let[X,Y]of Object.entries(S8.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 nL($="STX_PUBLIC_"){let Z={};for(let[J,X]of Object.entries(S8.env))if(J.startsWith($)&&X!==void 0)Z[J]=X;return Z}function C8($){return $.startsWith("http://")||$.startsWith("https://")||$.startsWith("//")}async function P8($,Z,J){try{let X;if($.startsWith("/")){let Y=Z;for(let Q=0;Q<5;Q++){let G=Y2.join(Y,$);if(await Bun.file(G).exists())return G;Y=Y2.dirname(Y)}X=Y2.join(Z,$)}else if($.startsWith("./")||$.startsWith("../"))X=Y2.resolve(Z,$);else X=Y2.resolve(Z,$);if(await Bun.file(X).exists())return X;return null}catch{return null}}var v8=Symbol.for("stx.inline-assets.import-meta");function hz($,Z){if(!$.includes("import.meta"))return;let J=Error(`[stx] ${Z} still references \`import.meta\` after bundling, and it is being inlined as a classic <script> where that is a SyntaxError \u2014 the whole script fails to parse, taking every other script on the page with it.
3838
+ `+" `import.meta.env.STX_PUBLIC_*` is substituted at build time and is safe; anything else is not.\n Fix it by moving the module-only code (`import.meta.glob`, `import.meta.url`) into its own module, or by resolving the value without `import.meta`.");throw J[v8]=!0,J}async function x8($,Z,J){let X=$,Y=Y2.dirname(Z),Q=/<script\b([^>]*)src=["']([^"']+)["']([^>]*)><\/script>/gi,G;while((G=Q.exec(X))!==null){let[q,W,U,H]=G;if(C8(U))continue;let j=await P8(U,Y,Z);if(j)try{let B=await Bun.file(j).text();if(J.add(j),U.endsWith(".ts")||U.endsWith(".tsx")){let _=await Bun.build({entrypoints:[j],target:"browser",minify:!0,define:X2()});if(_.outputs.length>0)B=await _.outputs[0].text(),hz(B,U)}let V=`<script>
3765
3839
  // Source: ${U}
3766
3840
  ${B}
3767
3841
  </script>`;X=X.replace(q,V),Q.lastIndex=0}catch(B){if(B?.[v8])throw B}}let z=/<link\b([^>]*)href=["']([^"']+)["']([^>]*)(?:\/?>)/gi,K;while((K=z.exec(X))!==null){let[q,W,U,H]=K,j=W+H;if(C8(U))continue;if(/rel=["']stylesheet["']/.test(j)||U.endsWith(".css")){let V=await P8(U,Y,Z);if(V)try{let _=await Bun.file(V).text();J.add(V);let L=`<style>
3768
3842
  /* Source: ${U} */
3769
3843
  ${_}
3770
- </style>`;X=X.replace(q,L),z.lastIndex=0}catch(_){}}}return X}function Z3($,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,K=G+1,q=null,W=!1;while(K<J.length&&z>0){let O=J[K];if(W){W=!1,K++;continue}if(O==="\\"&&q){W=!0,K++;continue}if(q){if(O===q)q=null;K++;continue}if(O==='"'||O==="'"||O==="`"){q=O,K++;continue}if(O==="(")z++;else if(O===")"){if(z--,z===0)break}K++}if(z!==0)break;let U=J.substring(G+1,K).trim(),H=J.substring(Q,K+1),j=-1,B=0,V=null,_=!1;for(let O=0;O<U.length;O++){let w=U[O];if(_){_=!1;continue}if(w==="\\"&&V){_=!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=O;break}}let L=j>=0?U.substring(0,j).trim():U,F=j>=0?U.substring(j+1).trim():void 0;try{let O=L.trim(),w;if(B0(O))w=H0(O,Object.keys(Z))(...Object.values(Z));else w=void 0;let R;if(F==="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(K+1),X.lastIndex=Q+D.length}catch(O){n0.log(O instanceof Error?O:Error(String(O)),{directive:"@json"},"error"),X.lastIndex=Q+H.length}}return J}function J3($){return $.replace(/@once\s*([\s\S]*?)@endonce/g,"$1")}function h8($){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,K=G;while(K<Z.length&&z>0){if(Z[K]==="(")z++;else if(Z[K]===")")z--;K++}if(z!==0)continue;let q=Z.slice(G,K-1).trim(),W=K,U=Z.slice(W),H=U.indexOf("@endmemo");if(H===-1)continue;let j=U.slice(0,H),B=W+H+8,V=j.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)/),_=V?V[0].length:0,L=j.slice(_),F=j.match(/(\s*)$/),O=F?F[0].length:0,w=L.slice(0,L.length-O),R=w.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)?(\/?)>/),D;if(R){let[N,I,M="",T]=R,k=`<${I}${M} data-stx-memo="${q}"${T}>`;D=j.slice(0,_)+k+w.slice(N.length)+j.slice(_+w.length)}else D=`${j.slice(0,_)}<div data-stx-memo="${q}">${w}</div>${j.slice(_+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 X3($){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}function u8($,Z){if(!/\bref\s*=/.test($))return $;let J=/<\/?([a-zA-Z][\w-]*)\b(?:"[^"]*"|'[^']*'|[^'">])*>/y,X=f2($,(K,q)=>{J.lastIndex=q;let W=J.exec(K);if(!W||/^(?:script|style)$/i.test(W[1]))return-1;return J.lastIndex}),Y=[],Q=0,G=0,z=[];for(let{start:K,end:q,token:W}of X){let U=/^<\/?([\w-]+)/.exec(W)[1].toLowerCase();if(W.startsWith("</")){let j;while(j=Y.pop()){if(j.scoped)Q--;if(j.name===U)break}continue}let H=/\sdata-stx-scope\s*=/.test(W);if(!Q&&!H&&/\s(?:ref|@ref|:ref|x-ref|data-stx-ref)\s*=/.test(W)&&!/\sdata-stx-ref-caller\s*=/.test(W))z.push($.slice(G,K),W.replace(/\s*\/?>$/,(j)=>` data-stx-ref-caller="${Z}"${j}`)),G=q;if(!m8.has(U)&&!/\/>$/.test(W)){if(Y.push({name:U,scoped:H}),H)Q++}}return z.push($.slice(G)),z.join("")}var m8=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),d8=/(?:^|\s)x-no-cloak(?:=|\s|\/|>|$)/,f8=/<\/?\s*([a-z][\w-]*)/iy,hz=/\s/;function uz($,Z){let J=Z-1;while(J>=0&&hz.test($[J]))J--;return J>=0&&$[J]==="/"}function mz($,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 dz($,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),K=z===-1?$.length:z;if(K>X){if(J===0)while(X<K){let U=$.indexOf(Q?"}":"{",X);if(U===-1||U>=K){if(Q)G=!1;else Y=!1;break}if(U>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=U+1}X=K;continue}if($.startsWith("<!--",X)){let U=$.indexOf("-->",X);X=U===-1?$.length:U+3;continue}let q=mz($,X);if(q===-1)break;f8.lastIndex=X;let W=f8.exec($)?.[1]?.toLowerCase()??"";if($[X+1]==="/"){if(J===0)break;J--}else if(!uz($,q)&&!m8.has(W))J++;X=q+1}return!1}function l8($){if($.length>=32768&&!g8($))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,K=!1,q=!1,W=-1;while(z<$.length){let H=$[z];if(K){if(H==="'")K=!1}else if(q){if(H==='"')q=!1}else if(H==="'")K=!0;else if(H==='"')q=!0;else if(H===">"){W=z;break}z++}if(W===-1)continue;let U=$.slice(G,W+1);if(d8.test(U))continue;if(U.includes("x-cloak"))continue;if(dz($,W+1))X+=$.slice(Y,W)+" x-cloak>",Y=W+1}return X+=$.slice(Y),X}var lz=/(?:^|\s)(?::else-if|:if|:else|:show|x-else-if|x-if|x-else|x-show|@if|@show)(?:=|\s|\/|>|$)/,cz=/<\/script>/gi,pz=/<\/style>/gi;function c8($){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"?cz:pz;B.lastIndex=Q;let V=B.exec($);if(V!==null)Z.lastIndex=V.index+V[0].length;continue}let z=Q+Y[0].length,K=!1,q=!1,W=-1;while(z<$.length){let B=$[z];if(K){if(B==="'")K=!1}else if(q){if(B==='"')q=!1}else if(B==="'")K=!0;else if(B==='"')q=!0;else if(B===">"){W=z;break}z++}if(W===-1)continue;let U=$.slice(Q+Y[0].length,W);if(d8.test(U))continue;if(/(?:^|\s)x-cloak(?:=|\s|\/|>|$)/.test(U))continue;if(!lz.test(U))continue;let H=$[W-1]==="/",j=H?W-1:W;J+=`${$.slice(X,j)} x-cloak${H?" ":""}`,X=j}return J+=$.slice(X),J}var Y3=b1(256),iz=[{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, where this must run before first paint and the runtime does not exist yet, the colorMode config for a light/dark theme, or @appearanceBootstrap when there is a second appearance axis"},{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"}],p8=/(?:\/\/|\/\*|\{\{--)\s*stx-strict-ignore(-next-line)?([^\n*}]*)/g;function nz($){let Z=Array.from($,(Y)=>Y===`
3844
+ </style>`;X=X.replace(q,L),z.lastIndex=0}catch(_){}}}return X}function Z3($,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,K=G+1,q=null,W=!1;while(K<J.length&&z>0){let O=J[K];if(W){W=!1,K++;continue}if(O==="\\"&&q){W=!0,K++;continue}if(q){if(O===q)q=null;K++;continue}if(O==='"'||O==="'"||O==="`"){q=O,K++;continue}if(O==="(")z++;else if(O===")"){if(z--,z===0)break}K++}if(z!==0)break;let U=J.substring(G+1,K).trim(),H=J.substring(Q,K+1),j=-1,B=0,V=null,_=!1;for(let O=0;O<U.length;O++){let w=U[O];if(_){_=!1;continue}if(w==="\\"&&V){_=!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=O;break}}let L=j>=0?U.substring(0,j).trim():U,F=j>=0?U.substring(j+1).trim():void 0;try{let O=L.trim(),w;if(B0(O))w=H0(O,Object.keys(Z))(...Object.values(Z));else w=void 0;let R;if(F==="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(K+1),X.lastIndex=Q+D.length}catch(O){n0.log(O instanceof Error?O:Error(String(O)),{directive:"@json"},"error"),X.lastIndex=Q+H.length}}return J}function J3($){return $.replace(/@once\s*([\s\S]*?)@endonce/g,"$1")}function h8($){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,K=G;while(K<Z.length&&z>0){if(Z[K]==="(")z++;else if(Z[K]===")")z--;K++}if(z!==0)continue;let q=Z.slice(G,K-1).trim(),W=K,U=Z.slice(W),H=U.indexOf("@endmemo");if(H===-1)continue;let j=U.slice(0,H),B=W+H+8,V=j.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)/),_=V?V[0].length:0,L=j.slice(_),F=j.match(/(\s*)$/),O=F?F[0].length:0,w=L.slice(0,L.length-O),R=w.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)?(\/?)>/),D;if(R){let[N,I,M="",T]=R,k=`<${I}${M} data-stx-memo="${q}"${T}>`;D=j.slice(0,_)+k+w.slice(N.length)+j.slice(_+w.length)}else D=`${j.slice(0,_)}<div data-stx-memo="${q}">${w}</div>${j.slice(_+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 X3($){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}function u8($,Z){if(!/\bref\s*=/.test($))return $;let J=/<\/?([a-zA-Z][\w-]*)\b(?:"[^"]*"|'[^']*'|[^'">])*>/y,X=f2($,(K,q)=>{J.lastIndex=q;let W=J.exec(K);if(!W||/^(?:script|style)$/i.test(W[1]))return-1;return J.lastIndex}),Y=[],Q=0,G=0,z=[];for(let{start:K,end:q,token:W}of X){let U=/^<\/?([\w-]+)/.exec(W)[1].toLowerCase();if(W.startsWith("</")){let j;while(j=Y.pop()){if(j.scoped)Q--;if(j.name===U)break}continue}let H=/\sdata-stx-scope\s*=/.test(W);if(!Q&&!H&&/\s(?:ref|@ref|:ref|x-ref|data-stx-ref)\s*=/.test(W)&&!/\sdata-stx-ref-caller\s*=/.test(W))z.push($.slice(G,K),W.replace(/\s*\/?>$/,(j)=>` data-stx-ref-caller="${Z}"${j}`)),G=q;if(!m8.has(U)&&!/\/>$/.test(W)){if(Y.push({name:U,scoped:H}),H)Q++}}return z.push($.slice(G)),z.join("")}var m8=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),d8=/(?:^|\s)x-no-cloak(?:=|\s|\/|>|$)/,f8=/<\/?\s*([a-z][\w-]*)/iy,uz=/\s/;function mz($,Z){let J=Z-1;while(J>=0&&uz.test($[J]))J--;return J>=0&&$[J]==="/"}function dz($,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 lz($,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),K=z===-1?$.length:z;if(K>X){if(J===0)while(X<K){let U=$.indexOf(Q?"}":"{",X);if(U===-1||U>=K){if(Q)G=!1;else Y=!1;break}if(U>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=U+1}X=K;continue}if($.startsWith("<!--",X)){let U=$.indexOf("-->",X);X=U===-1?$.length:U+3;continue}let q=dz($,X);if(q===-1)break;f8.lastIndex=X;let W=f8.exec($)?.[1]?.toLowerCase()??"";if($[X+1]==="/"){if(J===0)break;J--}else if(!mz($,q)&&!m8.has(W))J++;X=q+1}return!1}function l8($){if($.length>=32768&&!g8($))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,K=!1,q=!1,W=-1;while(z<$.length){let H=$[z];if(K){if(H==="'")K=!1}else if(q){if(H==='"')q=!1}else if(H==="'")K=!0;else if(H==='"')q=!0;else if(H===">"){W=z;break}z++}if(W===-1)continue;let U=$.slice(G,W+1);if(d8.test(U))continue;if(U.includes("x-cloak"))continue;if(lz($,W+1))X+=$.slice(Y,W)+" x-cloak>",Y=W+1}return X+=$.slice(Y),X}var cz=/(?:^|\s)(?::else-if|:if|:else|:show|x-else-if|x-if|x-else|x-show|@if|@show)(?:=|\s|\/|>|$)/,pz=/<\/script>/gi,iz=/<\/style>/gi;function c8($){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"?pz:iz;B.lastIndex=Q;let V=B.exec($);if(V!==null)Z.lastIndex=V.index+V[0].length;continue}let z=Q+Y[0].length,K=!1,q=!1,W=-1;while(z<$.length){let B=$[z];if(K){if(B==="'")K=!1}else if(q){if(B==='"')q=!1}else if(B==="'")K=!0;else if(B==='"')q=!0;else if(B===">"){W=z;break}z++}if(W===-1)continue;let U=$.slice(Q+Y[0].length,W);if(d8.test(U))continue;if(/(?:^|\s)x-cloak(?:=|\s|\/|>|$)/.test(U))continue;if(!cz.test(U))continue;let H=$[W-1]==="/",j=H?W-1:W;J+=`${$.slice(X,j)} x-cloak${H?" ":""}`,X=j}return J+=$.slice(X),J}var Y3=b1(256),nz=[{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, where this must run before first paint and the runtime does not exist yet, the colorMode config for a light/dark theme, or @appearanceBootstrap when there is a second appearance axis"},{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"}],p8=/(?:\/\/|\/\*|\{\{--)\s*stx-strict-ignore(-next-line)?([^\n*}]*)/g;function sz($){let Z=Array.from($,(Y)=>Y===`
3771
3845
  `?`
3772
3846
  `:" "),J=0,X="";while(J<$.length){let Y=$[J],Q=$[J+1];if(X){if(Y==="\\"){J+=2;continue}if(Y===X)X="";J++;continue}if(Y==='"'||Y==="'"||Y==="`"){X=Y,J++;continue}if(Y==="/"&&Q==="/"){while(J<$.length&&$[J]!==`
3773
- `)Z[J]=$[J],J++;continue}if(Y==="/"&&Q==="*"){let G=$.indexOf("*/",J+2),z=G===-1?$.length:G+2;for(;J<z;J++)Z[J]=$[J];continue}if(Y==="{"&&Q==="{"&&$.slice(J,J+4)==="{{--"){let G=$.indexOf("--}}",J+4),z=G===-1?$.length:G+4;for(;J<z;J++)Z[J]=$[J];continue}J++}return Z.join("")}function sz($){let Z=new Map,J=nz($).split(`
3847
+ `)Z[J]=$[J],J++;continue}if(Y==="/"&&Q==="*"){let G=$.indexOf("*/",J+2),z=G===-1?$.length:G+2;for(;J<z;J++)Z[J]=$[J];continue}if(Y==="{"&&Q==="{"&&$.slice(J,J+4)==="{{--"){let G=$.indexOf("--}}",J+4),z=G===-1?$.length:G+4;for(;J<z;J++)Z[J]=$[J];continue}J++}return Z.join("")}function oz($){let Z=new Map,J=sz($).split(`
3774
3848
  `),X=$.split(`
3775
- `);return J.forEach((Y,Q)=>{p8.lastIndex=0;for(let G of Y.matchAll(p8)){let z=G[1]==="-next-line",K=(X[Q]??"").slice(0,G.index).trim(),q=z||K===""?Q+2:Q+1,U=(G[2]??"").split("--")[0].split(/[\s,]+/).filter(Boolean),H=U.filter((B)=>/\w/.test(B));if(U.length>0&&H.length===0)continue;let j=Z.get(q);if(j&&j.size===0)continue;if(H.length===0){Z.set(q,new Set);continue}if(j)H.forEach((B)=>j.add(B));else Z.set(q,new Set(H))}}),Z}function oz($,Z,J){let X=$.get(Z);if(!X)return!1;if(X.size===0)return!0;return[...X].some((Y)=>J.includes(Y))}function Q3($,Z,J,X){let Y=typeof J==="boolean"?{enabled:J,failOnViolation:J}:J??{enabled:!1};if(!Y.enabled)return;let Q=j1($,Z,X,JSON.stringify(Y)),G=Y3.get(Q);if(G!==void 0){if(G&&Y.failOnViolation)throw Error(G);return}let z=Y.allowPatterns??[],K=sz($),q=[],W=G0($.replace(/\{\{--[\s\S]*?--\}\}/g,(B)=>B.replace(/[^\n]/g," ")));for(let{pattern:B,message:V,suggestion:_}of iz){if(z.some((F)=>/\w/.test(F)&&V.includes(F)))continue;B.lastIndex=0;let L=W.match(B);if(L&&L.length>0){let F=W.split(`
3849
+ `);return J.forEach((Y,Q)=>{p8.lastIndex=0;for(let G of Y.matchAll(p8)){let z=G[1]==="-next-line",K=(X[Q]??"").slice(0,G.index).trim(),q=z||K===""?Q+2:Q+1,U=(G[2]??"").split("--")[0].split(/[\s,]+/).filter(Boolean),H=U.filter((B)=>/\w/.test(B));if(U.length>0&&H.length===0)continue;let j=Z.get(q);if(j&&j.size===0)continue;if(H.length===0){Z.set(q,new Set);continue}if(j)H.forEach((B)=>j.add(B));else Z.set(q,new Set(H))}}),Z}function rz($,Z,J){let X=$.get(Z);if(!X)return!1;if(X.size===0)return!0;return[...X].some((Y)=>J.includes(Y))}function Q3($,Z,J,X){let Y=typeof J==="boolean"?{enabled:J,failOnViolation:J}:J??{enabled:!1};if(!Y.enabled)return;let Q=j1($,Z,X,JSON.stringify(Y)),G=Y3.get(Q);if(G!==void 0){if(G&&Y.failOnViolation)throw Error(G);return}let z=Y.allowPatterns??[],K=oz($),q=[],W=G0($.replace(/\{\{--[\s\S]*?--\}\}/g,(B)=>B.replace(/[^\n]/g," ")));for(let{pattern:B,message:V,suggestion:_}of nz){if(z.some((F)=>/\w/.test(F)&&V.includes(F)))continue;B.lastIndex=0;let L=W.match(B);if(L&&L.length>0){let F=W.split(`
3776
3850
  `),O=$.split(`
3777
- `),w=[];if(F.forEach((I,M)=>{if(B.lastIndex=0,B.test(I)&&!oz(K,M+1,V))w.push(M+1)}),w.length===0&&F.some((I)=>{return B.lastIndex=0,B.test(I)}))continue;let R=w.length>0?` (script line${w.length>1?"s":""} ${w.join(", ")})`:"",D=w.slice(0,3).map((I)=>` ${I} | ${(O[I-1]??"").trim().slice(0,100)}`).join(`
3851
+ `),w=[];if(F.forEach((I,M)=>{if(B.lastIndex=0,B.test(I)&&!rz(K,M+1,V))w.push(M+1)}),w.length===0&&F.some((I)=>{return B.lastIndex=0,B.test(I)}))continue;let R=w.length>0?` (script line${w.length>1?"s":""} ${w.join(", ")})`:"",D=w.slice(0,3).map((I)=>` ${I} | ${(O[I-1]??"").trim().slice(0,100)}`).join(`
3778
3852
  `),N=D?`
3779
3853
  ${D}`:"";q.push(` \u2717 ${V}${R}
3780
3854
  \u2192 ${_}${N}`)}}if(q.length===0){Y3.set(Q,"");return}let U=(B)=>{let V=`${process.cwd()}/`;return B.startsWith(V)?B.slice(V.length):B},j=`[STX] DOM API violation in ${X&&X!==Z?`${U(X)} (composed into ${U(Z)})`:U(Z)}:
3781
3855
  ${q.join(`
3782
3856
  `)}
3783
- Tip: prefer useRef(), navigate(), and composables for component code`;if(Y3.set(Q,j),Y.failOnViolation)throw Error(j);else console.warn(j)}W5();ez();import G3 from"path";var rz=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.\.?\/[^'"]*)\2/g,az=/(<script\b[^>]*>)([\s\S]*?)(<\/script>)/gi;function tz($,Z){if(!Z||!$.includes("/"))return $;let J=G3.dirname(Z);return $.replace(rz,(X,Y,Q,G)=>{let z=G3.resolve(J,G);return`${Y}${Q}${z.split(G3.sep).join("/")}${Q}`})}function i8($,Z){if(!Z||!$.includes("<script"))return $;return $.replace(az,(J,X,Y,Q)=>`${X}${tz(Y,Z)}${Q}`)}var S1="<!--PARENT_CONTENT_PLACEHOLDER-->";function n8($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function VZ($,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(`
3857
+ Tip: prefer useRef(), navigate(), and composables for component code`;if(Y3.set(Q,j),Y.failOnViolation)throw Error(j);else console.warn(j)}W5();$K();import G3 from"path";var az=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.\.?\/[^'"]*)\2/g,tz=/(<script\b[^>]*>)([\s\S]*?)(<\/script>)/gi;function ez($,Z){if(!Z||!$.includes("/"))return $;let J=G3.dirname(Z);return $.replace(az,(X,Y,Q,G)=>{let z=G3.resolve(J,G);return`${Y}${Q}${z.split(G3.sep).join("/")}${Q}`})}function i8($,Z){if(!Z||!$.includes("<script"))return $;return $.replace(tz,(J,X,Y,Q)=>`${X}${ez(Y,Z)}${Q}`)}var S1="<!--PARENT_CONTENT_PLACEHOLDER-->";function n8($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function VZ($,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(`
3784
3858
  `,X+2),X===-1)return-1;X+=1,Y=!0;continue}if(z==="/"&&$[X+1]==="*"){let K=$.indexOf("*/",X+2);if(K===-1)return-1;X=K+2,Y=!0;continue}if(z==="/"&&Y){let K=X+1,q=!1;while(K<J){let W=$[K];if(W==="\\"){K+=2;continue}if(W==="[")q=!0;else if(W==="]")q=!1;else if(W==="/"&&!q){K++;break}else if(W===`
3785
3859
  `){K=-1;break}K++}if(K===-1){X++,Y=!1;continue}while(K<J&&/[a-z]/.test($[K]))K++;X=K,Y=!1;continue}if(z==="'"||z==='"'){let K=z;X++;while(X<J){if($[X]==="\\"){X+=2;continue}if($[X]===K){X++;break}if($[X]===`
3786
- `)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 LZ($,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}}async function s8($,Z,J){try{let{registeredModuleIdsIn:X,buildModuleRegistryScript:Y}=await s("stx/client-module-registry",()=>import("./chunk-gv6fnbw5.js")),Q=[],G=await Y(X(...$),{minify:Z.buildMode==="compile",collectInputs:Q});for(let z of Q)J?.add(z);if(!G)return null;if(Z.buildMode==="serve"){let{registerServeModuleBundle:z}=await import("./chunk-vxxj6sqn.js");return`<script data-stx-scoped data-stx-run="always" data-stx-modules src="${z(G)}"></script>`}return`<script data-stx-scoped data-stx-run="always" data-stx-modules>${G.replace(/<\/script/gi,"<\\/script")}</script>`}catch{return null}}function ZK($,Z=""){let J=LZ($,"data-stx-runtime");if(!J)return $;let X=B2($);if(X===-1||X===J.start){if(!Z)return $;return $.slice(0,J.end)+Z+$.slice(J.end)}if(X<J.start)return $.slice(0,X)+$.slice(J.start,J.end)+Z+`
3860
+ `)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 LZ($,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}}async function s8($,Z,J){try{let{registeredModuleIdsIn:X,buildModuleRegistryScript:Y}=await s("stx/client-module-registry",()=>import("./chunk-wgxcemm2.js")),Q=[],G=await Y(X(...$),{minify:Z.buildMode==="compile",collectInputs:Q});for(let z of Q)J?.add(z);if(!G)return null;if(Z.buildMode==="serve"){let{registerServeModuleBundle:z}=await import("./chunk-b891w7hr.js");return`<script data-stx-scoped data-stx-run="always" data-stx-modules src="${z(G)}"></script>`}return`<script data-stx-scoped data-stx-run="always" data-stx-modules>${G.replace(/<\/script/gi,"<\\/script")}</script>`}catch{return null}}function JK($,Z=""){let J=LZ($,"data-stx-runtime");if(!J)return $;let X=B2($);if(X===-1||X===J.start){if(!Z)return $;return $.slice(0,J.end)+Z+$.slice(J.end)}if(X<J.start)return $.slice(0,X)+$.slice(J.start,J.end)+Z+`
3787
3861
  `+$.slice(X,J.start)+$.slice(J.end);let Y=$.slice(J.start,J.end),Q=$.slice(0,J.start)+$.slice(J.end),G=B2(Q);if(G===-1)return Y+Z+`
3788
3862
  `+Q;return Q.slice(0,G)+Y+Z+`
3789
- `+Q.slice(G)}function JK($){let Z=/\x00STX_ESC_MUSTACHE_OPEN\x00([\s\S]*?)\x00STX_ESC_MUSTACHE_CLOSE\x00/g;return $.replace(Z,(J,X,Y)=>{let Q=$.slice(0,Y);return Q.lastIndexOf("<")>Q.lastIndexOf(">")?`{{${X}}}`:`{<!--stx-literal-->{${X}}}`})}async function K3($,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=Y1($,J);let Q=!Z.__stxProcessingDepth;h$(Z);for(let G of X._layerGraph?.configDependencies??[])Y.add(G);if(Q&&X.runtimeConfig)await p9(Z,J,X.runtimeConfig);if(Q)C3(Z),Z.__stx_head_injections=P$(),Z.__stx_seo_staged=!1;if(!Z.__stxProcessingDepth)Z.__stxProcessingDepth=0;if(Z.__stxProcessingDepth++,!Z.__onceStore)Z.__onceStore=new Set;if((X.debug||!S2()&&!C2())&&J&&J.endsWith(".stx"))WZ($,J);try{return await GZ.timeAsync("template-processing",async()=>{let G=await XK($,Z,J,X,Y);if(Q)G=X3(G);if(Q&&X.autoShell&&X.buildMode!=="compile"){let z=X.app?.head||{},q=(Z.__stx_runtime_head||null)??qZ(),W=(Z.__stx_head_raw||"").trim(),U,H=W.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(H)U=H[1].trim(),W=W.replace(H[0],"").trim();let j=Z.__sections?.title,B=q.title||U||j,V=!q.title&&(!!U||!!j),_=q.meta||[],L=new Set(_.map((N)=>$2(N)).filter(Boolean)),F={...z,...B&&{title:B},meta:[...(z.meta||[]).filter((N)=>!L.has($2(N))),..._],link:[...z.link||[],...q.link||[]],script:[...z.script||[],...q.script||[]],headRaw:[z.headRaw,W].filter(Boolean).join(`
3863
+ `+Q.slice(G)}function XK($){let Z=/\x00STX_ESC_MUSTACHE_OPEN\x00([\s\S]*?)\x00STX_ESC_MUSTACHE_CLOSE\x00/g;return $.replace(Z,(J,X,Y)=>{let Q=$.slice(0,Y);return Q.lastIndexOf("<")>Q.lastIndexOf(">")?`{{${X}}}`:`{<!--stx-literal-->{${X}}}`})}async function K3($,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=Y1($,J);let Q=!Z.__stxProcessingDepth;h$(Z);for(let G of X._layerGraph?.configDependencies??[])Y.add(G);if(Q&&X.runtimeConfig)await p9(Z,J,X.runtimeConfig);if(Q)C3(Z),Z.__stx_head_injections=P$(),Z.__stx_seo_staged=!1;if(!Z.__stxProcessingDepth)Z.__stxProcessingDepth=0;if(Z.__stxProcessingDepth++,!Z.__onceStore)Z.__onceStore=new Set;if((X.debug||!S2()&&!C2())&&J&&J.endsWith(".stx"))WZ($,J);try{return await GZ.timeAsync("template-processing",async()=>{let G=await YK($,Z,J,X,Y);if(Q)G=X3(G);if(Q&&X.autoShell&&X.buildMode!=="compile"){let z=X.app?.head||{},q=(Z.__stx_runtime_head||null)??qZ(),W=(Z.__stx_head_raw||"").trim(),U,H=W.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(H)U=H[1].trim(),W=W.replace(H[0],"").trim();let j=Z.__sections?.title,B=q.title||U||j,V=!q.title&&(!!U||!!j),_=q.meta||[],L=new Set(_.map((N)=>$2(N)).filter(Boolean)),F={...z,...B&&{title:B},meta:[...(z.meta||[]).filter((N)=>!L.has($2(N))),..._],link:[...z.link||[],...q.link||[]],script:[...z.script||[],...q.script||[]],headRaw:[z.headRaw,W].filter(Boolean).join(`
3790
3864
  `),...q.htmlAttrs&&{htmlAttrs:Y8(z.htmlAttrs,q.htmlAttrs)},...q.bodyAttrs&&{bodyAttrs:{...z.bodyAttrs||{},...q.bodyAttrs}}},O=c$(G);if(G=z8(G,F,{...V&&{titleIsHtml:!0},...X.app?.colorMode&&{colorMode:X.app.colorMode}},O),O)G=G8(G,z),G=Q8(G,F.htmlAttrs);let w=G.match(/<!-- stx-layout: ([^ ]+) -->/);if(w&&G.includes("<head")){let N=w[1],I=YZ(N);G=G.replace(/<head\b[^>]*>/i,(M)=>`${M}
3791
3865
  <meta name="stx-layout" content="${n8(N)}">
3792
- <meta name="stx-layout-group" content="${n8(I)}">`)}let R=G.match(/function (__stx_setup_\w+)\(/),D=R?p0(G):null;if(R&&D&&!/\bdata-stx=/.test(D.tag)){G=x1(G,(I,M)=>`<body${M} data-stx="${R[1]}">`);let N=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${R[1]}"`,"i");G=G.replace(N,"$1")}}if(Q){let z=Z.__stx_head_injections??P$(),K=d$(G);if(K!==null)z.beforeClose.push(K);let q=g$(G);if(q!==null)z.afterOpen.push(q);if(X.offline?.enabled&&!G.includes("data-stx-offline"))z.beforeClose.push(o6);G=l6(G,z);let W=X.app?.colorMode;if(W)G=i6(G,W)}if(Q)if(LZ(G,"data-stx-runtime")){let K=null,q=null,W=null,U=null;try{let{getStoreScript:j}=await s("stx/store-loader",()=>import("./chunk-702rda41.js")),B=X.storesDir,V=await j(B);if(V)q=`<script data-stx-stores>${V}</script>`}catch{}K=await s8([G,q],X,Y);try{let{getFrameworkComposableScript:j}=await s("stx/framework-composables",()=>import("./chunk-xd2bapap.js"));U=await j(G)}catch{}try{let{getComposableScript:j}=await s("stx/composable-loader",()=>import("./chunk-n9cgqpe2.js")),B=X.composablesDir,V=[K,q,U].filter((L)=>L!==null),_=await j(X._layerComposableDirs??B,G,V);if(_)W=`<script data-stx-scoped data-stx-run="always" data-stx-composables>${_}</script>`}catch{}let H=[K,q,W,U].filter((j)=>j!==null).map((j)=>`
3793
- ${j}`).join("");G=ZK(G,H)}else{let K=await s8([G],X,Y);if(K){let q=G.search(/<script\b[^>]*>(?:(?!<\/script>)[\s\S])*?__stxModules\[/i);if(q!==-1)G=G.slice(0,q)+K+`
3794
- `+G.slice(q)}}if(Q)G=n6(G);if(Q&&Z.__stx_inject_css!==!1)G=await KZ(G,void 0,X.buildMode==="serve",!0);else if(Q)G=zZ(G);if(G=G.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),G=JK(G),Q&&Z.__stx_runtime_config)G=QZ(G,Z.__stx_runtime_config);if(Q&&!Z.__stx_defer_server_data){let z=e6(Z);if(z){let K=/<head\b[^>]*>/i.exec(G),q=K?K.index+K[0].length:0;G=G.slice(0,q)+z+G.slice(q)}}return G})}catch(G){if(G instanceof e8)throw G;let z=G instanceof Error?G.message:String(G),K=new g2(`Template processing failed: ${z}`,J,void 0,void 0,$.substring(0,200)+($.length>200?"...":""));if(n0.log(K,{filePath:J,context:Z}),ZZ.logDetailedError(K,{filePath:J,template:$.substring(0,500)}),X.debug)throw K;return $Z.createFallbackContent("Template Processing",K)}}async function XK($,Z,J,X,Y){let Q=process.cwd(),G={...X,partialsDir:X.partialsDir&&!b0.isAbsolute(X.partialsDir)?b0.resolve(Q,X.partialsDir):X.partialsDir,componentsDir:X.componentsDir&&!b0.isAbsolute(X.componentsDir)?b0.resolve(Q,X.componentsDir):X.componentsDir,layoutsDir:X.layoutsDir&&!b0.isAbsolute(X.layoutsDir)?b0.resolve(Q,X.layoutsDir):X.layoutsDir},z=G,K=$;await GK(J,Z),QK(Z,z),K=await h2(()=>S6(K,Z,J,z),K,(R)=>{n0.log(R,{filePath:J,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${J}: ${R.message}`)}),K=K.replace(/\{\{--[\s\S]*?--\}\}/g,"");let q=V1(K,y9,(R,D)=>`\x00STX_HTML_COMMENT_${D}\x00`);K=q.output;let W=q.tokens,U=(R)=>W.length===0?R:R.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(D,N)=>W[Number(N)]??""),H="\x00STX_ESCAPED_AT\x00",j="\x00STX_ESC_MUSTACHE_OPEN\x00",B="\x00STX_ESC_MUSTACHE_CLOSE\x00";K=K.replace(/@@/g,H),K=K.replace(/@\{\{([\s\S]*?)\}\}/g,(R,D)=>{return`${j}${D}${B}`}),K=f6(K),K=await x8(K,J,Y);let V={};K=k$(K,V);let _={...Z.__sections||{}},L="",F=L4(V4($)),O=/@nolayout\b/.test(K)||F===!1;if(/@nolayout\b/.test(K))K=K.replace(/@nolayout\b\s*/g,"");let w=K.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(w)L=w[1],K=K.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof F==="string"){if(L=F,!/@section\s*\(/.test(K))K=`@section('content')
3866
+ <meta name="stx-layout-group" content="${n8(I)}">`)}let R=G.match(/function (__stx_setup_\w+)\(/),D=R?p0(G):null;if(R&&D&&!/\bdata-stx=/.test(D.tag)){G=x1(G,(I,M)=>`<body${M} data-stx="${R[1]}">`);let N=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${R[1]}"`,"i");G=G.replace(N,"$1")}}if(Q){let z=Z.__stx_head_injections??P$(),K=d$(G);if(K!==null)z.beforeClose.push(K);let q=g$(G);if(q!==null)z.afterOpen.push(q);if(X.offline?.enabled&&!G.includes("data-stx-offline"))z.beforeClose.push(o6);G=l6(G,z);let W=X.app?.colorMode;if(W)G=i6(G,W)}if(Q)if(LZ(G,"data-stx-runtime")){let K=null,q=null,W=null,U=null;try{let{getStoreScript:j}=await s("stx/store-loader",()=>import("./chunk-h4w5sqg0.js")),B=X.storesDir,V=await j(B);if(V)q=`<script data-stx-stores>${V}</script>`}catch{}K=await s8([G,q],X,Y);try{let{getFrameworkComposableScript:j}=await s("stx/framework-composables",()=>import("./chunk-s745a8mb.js"));U=await j(G)}catch{}try{let{getComposableScript:j}=await s("stx/composable-loader",()=>import("./chunk-m81pxs52.js")),B=X.composablesDir,V=[K,q,U].filter((L)=>L!==null),_=await j(X._layerComposableDirs??B,G,V);if(_)W=`<script data-stx-scoped data-stx-run="always" data-stx-composables>${_}</script>`}catch{}let H=[K,q,W,U].filter((j)=>j!==null).map((j)=>`
3867
+ ${j}`).join("");G=JK(G,H)}else{let K=await s8([G],X,Y);if(K){let q=G.search(/<script\b[^>]*>(?:(?!<\/script>)[\s\S])*?__stxModules\[/i);if(q!==-1)G=G.slice(0,q)+K+`
3868
+ `+G.slice(q)}}if(Q)G=n6(G);if(Q&&Z.__stx_inject_css!==!1)G=await KZ(G,void 0,X.buildMode==="serve",!0);else if(Q)G=zZ(G);if(G=G.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),G=XK(G),Q&&Z.__stx_runtime_config)G=QZ(G,Z.__stx_runtime_config);if(Q&&!Z.__stx_defer_server_data){let z=e6(Z);if(z){let K=/<head\b[^>]*>/i.exec(G),q=K?K.index+K[0].length:0;G=G.slice(0,q)+z+G.slice(q)}}return G})}catch(G){if(G instanceof e8)throw G;let z=G instanceof Error?G.message:String(G),K=new g2(`Template processing failed: ${z}`,J,void 0,void 0,$.substring(0,200)+($.length>200?"...":""));if(n0.log(K,{filePath:J,context:Z}),ZZ.logDetailedError(K,{filePath:J,template:$.substring(0,500)}),X.debug)throw K;return $Z.createFallbackContent("Template Processing",K)}}async function YK($,Z,J,X,Y){let Q=process.cwd(),G={...X,partialsDir:X.partialsDir&&!b0.isAbsolute(X.partialsDir)?b0.resolve(Q,X.partialsDir):X.partialsDir,componentsDir:X.componentsDir&&!b0.isAbsolute(X.componentsDir)?b0.resolve(Q,X.componentsDir):X.componentsDir,layoutsDir:X.layoutsDir&&!b0.isAbsolute(X.layoutsDir)?b0.resolve(Q,X.layoutsDir):X.layoutsDir},z=G,K=$;await zK(J,Z),GK(Z,z),K=await h2(()=>S6(K,Z,J,z),K,(R)=>{n0.log(R,{filePath:J,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${J}: ${R.message}`)}),K=K.replace(/\{\{--[\s\S]*?--\}\}/g,"");let q=V1(K,y9,(R,D)=>`\x00STX_HTML_COMMENT_${D}\x00`);K=q.output;let W=q.tokens,U=(R)=>W.length===0?R:R.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(D,N)=>W[Number(N)]??""),H="\x00STX_ESCAPED_AT\x00",j="\x00STX_ESC_MUSTACHE_OPEN\x00",B="\x00STX_ESC_MUSTACHE_CLOSE\x00";K=K.replace(/@@/g,H),K=K.replace(/@\{\{([\s\S]*?)\}\}/g,(R,D)=>{return`${j}${D}${B}`}),K=f6(K),K=await x8(K,J,Y);let V={};K=k$(K,V);let _={...Z.__sections||{}},L="",F=L4(V4($)),O=/@nolayout\b/.test(K)||F===!1;if(/@nolayout\b/.test(K))K=K.replace(/@nolayout\b\s*/g,"");let w=K.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(w)L=w[1],K=K.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof F==="string"){if(L=F,!/@section\s*\(/.test(K))K=`@section('content')
3795
3869
  ${K.trim()}
3796
3870
  @endsection`}if(!L&&!O&&z.defaultLayout){let R=l$(K),D=/@section\s*\(/.test(K);if(!R||D){let N="",I=b0.dirname(J),M=z.layoutsDir?b0.dirname(z.layoutsDir):process.cwd();for(let T=0;T<20;T++){let k=b0.join(I,"_layout.stx");if(await $0(k)){N=k;break}let A=b0.dirname(I);if(A===I||A.length<M.length)break;I=A}if(N)L=N;else if(z.layoutsDir){let T=b0.isAbsolute(z.layoutsDir)?z.layoutsDir:b0.resolve(process.cwd(),z.layoutsDir),k=b0.join(T,`${z.defaultLayout}.stx`);if(await $0(k))L=k}if(L&&!D)K=`@section('content')
3797
3871
  ${K.trim()}
3798
3872
  @endsection`}}if(L&&K.includes("<script")){let R=f0(K),D=R.scripts.map((N)=>o8(N,J)??N);K=j2(R.output,D)}if(K=K.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(R,D,N)=>{return _[D]=N,""}),K=K.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(R,D,N)=>{if(/^(['"]).*\1$/.test(N.trim()))return R;try{let I=Q0(N.trim(),Z);if(I===void 0)return R;return _[D]=String(I??""),""}catch{return R}}),K=K.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(R,D,N)=>{if(N.includes("@parent"))_[D]=N.replace("@parent",S1);else _[D]=N.trim();return""}),Z.__sections=_,K=K.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(R,D,N)=>{return _[D]||N||""}),!("slot"in Z)||Z.slot===void 0)K=K.replace(/\{\{\s*slot\s*\}\}/g,()=>{return _.content||""});if(K=E$(K,V),L){let R=[],D=f0(K),N=V1(D.output,J9,(I,M)=>`\x00STX_ORPHAN_STYLE_${M}\x00`);if(K=N.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(I,M,T)=>{let k=M==="SCRIPT"?o8(D.scripts[Number(T)],J):N.tokens[Number(T)];if(k)R.push(k);return""}),R.length>0){let I=R.join(`
3799
3873
  `);_.content=_.content?`${_.content}
3800
- ${I}`:I,Z.__sections=_}}if(L)try{let R;if(b0.isAbsolute(L))R=L,Y.add(L);else R=await h2(()=>q9(L,J,G,Y),null,()=>{throw new g2(`Failed to resolve layout path: ${L}`,J,void 0,void 0,`Layout referenced from ${J}`)});if(!R){let k=(C)=>{if(!C)return[];try{let b=b0.isAbsolute(C)?C:b0.resolve(process.cwd(),C);return $K.readdirSync(b).filter((y)=>y.endsWith(".stx")).map((y)=>y.replace(/\.stx$/,""))}catch{return[]}},A=[...k(G.layoutsDir),...k(G.fallbackLayoutsDir)].filter((C,b,y)=>y.indexOf(C)===b).sort(),E=`Layout not found: ${L} (referenced from ${J})`+(A.length>0?`. Available layouts: ${A.join(", ")}`:G.layoutsDir?`. No .stx layouts found in ${G.layoutsDir}`:"");if(n0.log(Error(E),{layoutPath:L,filePath:J,available:A},"error"),console.error(`[stx] ${E}`),G.debug)throw new g2(E,J);return K}let D=await h2(()=>Bun.file(R).text(),"",()=>{throw new g2(`Failed to read layout file: ${R}`,J,void 0,void 0,"Layout content could not be loaded")});D=i8(D,R);let N=D.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(N){if(G.debug)console.log(`Found nested layout: ${N[1]} in ${R}`);let k={},A=D.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(b,y,P)=>{return k[y]=P.trim(),""});for(let[b,y]of Object.entries(k))if(_[b]&&_[b].includes(S1)){let P=_[b].indexOf(S1);_[b]=_[b].slice(0,P)+y+_[b].slice(P+S1.length)}else if(!_[b])_[b]=y;let E={...Z,__sections:_},C=`@layout('${N[1]}')${A}`;return await K3(C,E,R,G,Y)}let I=D.replace(/\{\{--[\s\S]*?--\}\}/g,""),M=k$(I,V),T={};return M=M.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(k,A,E)=>{return T[A]=E.trim(),`@slot('${A}')`}),M=M.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(k,A,E)=>{if(_[A]){let C=_[A];if(C.includes(S1)){let b=T[A]||"",y=C.indexOf(S1);C=C.slice(0,y)+b+C.slice(y+S1.length)}return C}return E||""}),M=YK(M,_),M=M.replace(/\{\{\s*slot\s*\}\}/g,()=>{return _.content||""}),M=E$(M,V),Z.__originalFilePath=J,K=await t8(M,Z,R,G,Y),K=`<!-- stx-layout: ${L} -->
3801
- ${K}`,U(K)}catch(R){return n0.log(R instanceof Error?R:Error(String(R)),{layoutPath:L,filePath:J},"error"),`[Error processing layout: ${R instanceof Error?R.message:String(R)}]`}return U(await t8(K,Z,J,G,Y))}function YK($,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 QK($,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 GK($,Z){await h2(()=>v6($,Z),void 0,(J)=>{n0.log(J,{filePath:$,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${$}: ${J.message}`)})}var z3="data-stx-source";function o8($,Z){if(!$)return $;let J=/^<script\b([^>]*)>/i.exec($);if(!J||!/\bserver\b/.test(J[1])||J[1].includes(z3))return $;return`<script ${z3}="${encodeURIComponent(Z)}"${$.slice(7)}`}function zK($){let Z=new RegExp(`${z3}="([^"]*)"`).exec($);return Z?decodeURIComponent(Z[1]):void 0}function r8($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function a8($,Z,J){return`<div data-stx-server-script-error role="alert" style="padding:12px 14px;border:1px solid #f0b4b4;border-left-width:4px;background:#fff5f5;color:#7a1f1f;font:13px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace"><strong style="display:block;margin-bottom:4px">stx: a &lt;script server&gt; ${Z==="module-resolution"?"imports a module that does not resolve":Z==="syntax"?"does not parse":"names something that does not exist"}, so this component rendered nothing.</strong><span style="display:block;opacity:.85">${r8($)}</span><span style="display:block;margin-top:4px">${r8(J)}</span></div>`}async function KK($,Z,J,X){let{scanScriptTags:Y}=await s("stx/signal-processing",()=>import("./chunk-1chgn7qv.js")),Q=[],G=!S2()&&!C2();for(let K of Y($)){let q=K.attrs;if(!/\bserver\b/.test(q))continue;let W=K.start+K.fullMatch.indexOf(">")+1,U=VZ($,W);if(U===-1)continue;let H=$.slice(W,U);if(!H.trim())continue;let j=zK(q)??J,B={index:K.start,length:U+9-K.start};try{let{extractVariables:V}=await s("stx/variable-extractor",()=>import("./chunk-n9wmhtap.js"));await V(H,Z,j,{preserveExisting:!0,onFailure:(_)=>{if(_.kind==="unknown")return;if(X?.onServerScriptError?.({sourcePath:j,kind:_.kind,message:_.message}),!G)return;Q.push({...B,markup:a8(j,_.kind,_.message)})}})}catch(V){let _=V instanceof Error?V:Error(String(V));if(n0.log(_,{filePath:j,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${j}: ${_.message}`),G)Q.push({...B,markup:a8(j,"unknown",_.message)})}}if(Q.length===0)return $;let z=$;for(let K of Q.sort((q,W)=>W.index-q.index))z=z.slice(0,K.index)+K.markup+z.slice(K.index+K.length);return z}async function qK($,Z,J){try{let{interpolateScriptsInTemplate:X}=await s("stx/expressions",()=>import("./chunk-scn75qrm.js"));return X($,Z,{skipServer:!0})}catch(X){let Y=X instanceof Error?X:Error(String(X));return n0.log(Y,{filePath:J,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${J}: ${Y.message}`),$}}async function t8($,Z,J,X,Y){let Q=$,G=X;if(Q=await KK(Q,Z,J,X),Q=await qK(Q,Z,J),Q=await O6(Q,Z,J),Q=await F6(Q,Z,J),Q=await R7(Q,Z,J,G),Y1(Q))Q=E8(Q,Z),Q=$3(Q,Z),Q=e$(Q,Z);Q=y8(Q);let{processStreamDirectives:z}=await s("stx/streaming",()=>import("./chunk-cqn8qq4v.js"));Q=z(Q,Z),Q=T6(Q,Z,J,G,!0),Q=await m6(Q,Z,J,G,Y),Q=await M$(Q,Z,J,G,Y),Q=B4(Q,Z,J,G);let{processDeferDirectives:K}=await s("stx/defer",()=>import("./chunk-pp8e3t71.js"));Q=K(Q,Z,J);let{processTeleportDirectives:q}=await s("stx/teleport",()=>import("./chunk-ek069b44.js"));Q=q(Q,Z,J);let{processTransitionDirectives:W,processTransitionAttributes:U}=await s("stx/transitions",()=>import("./chunk-b89mqprp.js"));Q=W(Q,Z,J),Q=U(Q);let{processErrorBoundaryDirectives:H,stripRenderFailedMarkers:j}=await s("stx/error-boundaries",()=>import("./chunk-4m2e8w2g.js"));Q=H(Q,Z,J),Q=j(Q);let{processSuspenseDirectives:B}=await s("stx/suspense",()=>import("./chunk-gbwqy9py.js"));Q=B(Q,Z,J);let{processAsyncDirectives:V}=await s("stx/async-components",()=>import("./chunk-3tmnemhq.js"));Q=V(Q,Z,J);let{processKeepAliveDirectives:_}=await s("stx/keep-alive",()=>import("./chunk-fpqz7msz.js"));Q=_(Q,Z,J);let{processVirtualListDirectives:L,processVirtualGridDirectives:F,processInfiniteListDirectives:O}=await s("stx/virtual-scrolling",()=>import("./chunk-fwc5p9bn.js"));Q=L(Q,Z,J),Q=F(Q,Z,J),Q=O(Q,Z,J);let{processPartialHydrationDirectives:w,processStaticDirectives:R}=await s("stx/partial-hydration",()=>import("./chunk-111tdjzz.js"));Q=w(Q,Z,J),Q=R(Q);let{processComputedDirectives:D,processWatchDirectives:N}=await s("stx/computed",()=>import("./chunk-21adgg8e.js"));Q=D(Q,Z,J),Q=N(Q,Z,J);let{processFormValidationDirectives:I}=await s("stx/forms-validation",()=>import("./chunk-wm07h8q1.js"));Q=I(Q,Z,J);let{processHeadDirective:M,processTitleDirective:T,processMetaDirective:k,resetHead:A}=await s("stx/head",()=>import("./chunk-nt03zdme.js"));if(!Z.__stx_head_preset&&!Z.__stx_runtime_head)A();let E=M(Q);if(Q=E.content,E.headContent)Z.__stx_head_raw=`${Z.__stx_head_raw||""}${E.headContent}
3874
+ ${I}`:I,Z.__sections=_}}if(L)try{let R;if(b0.isAbsolute(L))R=L,Y.add(L);else R=await h2(()=>q9(L,J,G,Y),null,()=>{throw new g2(`Failed to resolve layout path: ${L}`,J,void 0,void 0,`Layout referenced from ${J}`)});if(!R){let k=(C)=>{if(!C)return[];try{let b=b0.isAbsolute(C)?C:b0.resolve(process.cwd(),C);return ZK.readdirSync(b).filter((y)=>y.endsWith(".stx")).map((y)=>y.replace(/\.stx$/,""))}catch{return[]}},A=[...k(G.layoutsDir),...k(G.fallbackLayoutsDir)].filter((C,b,y)=>y.indexOf(C)===b).sort(),E=`Layout not found: ${L} (referenced from ${J})`+(A.length>0?`. Available layouts: ${A.join(", ")}`:G.layoutsDir?`. No .stx layouts found in ${G.layoutsDir}`:"");if(n0.log(Error(E),{layoutPath:L,filePath:J,available:A},"error"),console.error(`[stx] ${E}`),G.debug)throw new g2(E,J);return K}let D=await h2(()=>Bun.file(R).text(),"",()=>{throw new g2(`Failed to read layout file: ${R}`,J,void 0,void 0,"Layout content could not be loaded")});D=i8(D,R);let N=D.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(N){if(G.debug)console.log(`Found nested layout: ${N[1]} in ${R}`);let k={},A=D.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(b,y,P)=>{return k[y]=P.trim(),""});for(let[b,y]of Object.entries(k))if(_[b]&&_[b].includes(S1)){let P=_[b].indexOf(S1);_[b]=_[b].slice(0,P)+y+_[b].slice(P+S1.length)}else if(!_[b])_[b]=y;let E={...Z,__sections:_},C=`@layout('${N[1]}')${A}`;return await K3(C,E,R,G,Y)}let I=D.replace(/\{\{--[\s\S]*?--\}\}/g,""),M=k$(I,V),T={};return M=M.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(k,A,E)=>{return T[A]=E.trim(),`@slot('${A}')`}),M=M.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(k,A,E)=>{if(_[A]){let C=_[A];if(C.includes(S1)){let b=T[A]||"",y=C.indexOf(S1);C=C.slice(0,y)+b+C.slice(y+S1.length)}return C}return E||""}),M=QK(M,_),M=M.replace(/\{\{\s*slot\s*\}\}/g,()=>{return _.content||""}),M=E$(M,V),Z.__originalFilePath=J,K=await t8(M,Z,R,G,Y),K=`<!-- stx-layout: ${L} -->
3875
+ ${K}`,U(K)}catch(R){return n0.log(R instanceof Error?R:Error(String(R)),{layoutPath:L,filePath:J},"error"),`[Error processing layout: ${R instanceof Error?R.message:String(R)}]`}return U(await t8(K,Z,J,G,Y))}function QK($,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 GK($,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 zK($,Z){await h2(()=>v6($,Z),void 0,(J)=>{n0.log(J,{filePath:$,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${$}: ${J.message}`)})}var z3="data-stx-source";function o8($,Z){if(!$)return $;let J=/^<script\b([^>]*)>/i.exec($);if(!J||!/\bserver\b/.test(J[1])||J[1].includes(z3))return $;return`<script ${z3}="${encodeURIComponent(Z)}"${$.slice(7)}`}function KK($){let Z=new RegExp(`${z3}="([^"]*)"`).exec($);return Z?decodeURIComponent(Z[1]):void 0}function r8($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function a8($,Z,J){return`<div data-stx-server-script-error role="alert" style="padding:12px 14px;border:1px solid #f0b4b4;border-left-width:4px;background:#fff5f5;color:#7a1f1f;font:13px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace"><strong style="display:block;margin-bottom:4px">stx: a &lt;script server&gt; ${Z==="module-resolution"?"imports a module that does not resolve":Z==="syntax"?"does not parse":"names something that does not exist"}, so this component rendered nothing.</strong><span style="display:block;opacity:.85">${r8($)}</span><span style="display:block;margin-top:4px">${r8(J)}</span></div>`}async function qK($,Z,J,X){let{scanScriptTags:Y}=await s("stx/signal-processing",()=>import("./chunk-fy5jfqwe.js")),Q=[],G=!S2()&&!C2();for(let K of Y($)){let q=K.attrs;if(!/\bserver\b/.test(q))continue;let W=K.start+K.fullMatch.indexOf(">")+1,U=VZ($,W);if(U===-1)continue;let H=$.slice(W,U);if(!H.trim())continue;let j=KK(q)??J,B={index:K.start,length:U+9-K.start};try{let{extractVariables:V}=await s("stx/variable-extractor",()=>import("./chunk-w568cjw6.js"));await V(H,Z,j,{preserveExisting:!0,onFailure:(_)=>{if(_.kind==="unknown")return;if(X?.onServerScriptError?.({sourcePath:j,kind:_.kind,message:_.message}),!G)return;Q.push({...B,markup:a8(j,_.kind,_.message)})}})}catch(V){let _=V instanceof Error?V:Error(String(V));if(n0.log(_,{filePath:j,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${j}: ${_.message}`),G)Q.push({...B,markup:a8(j,"unknown",_.message)})}}if(Q.length===0)return $;let z=$;for(let K of Q.sort((q,W)=>W.index-q.index))z=z.slice(0,K.index)+K.markup+z.slice(K.index+K.length);return z}async function WK($,Z,J){try{let{interpolateScriptsInTemplate:X}=await s("stx/expressions",()=>import("./chunk-kjkkh5p6.js"));return X($,Z,{skipServer:!0})}catch(X){let Y=X instanceof Error?X:Error(String(X));return n0.log(Y,{filePath:J,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${J}: ${Y.message}`),$}}async function t8($,Z,J,X,Y){let Q=$,G=X;if(Q=await qK(Q,Z,J,X),Q=await WK(Q,Z,J),Q=await O6(Q,Z,J),Q=await F6(Q,Z,J),Q=await R7(Q,Z,J,G),Y1(Q))Q=E8(Q,Z),Q=$3(Q,Z),Q=e$(Q,Z);Q=y8(Q);let{processStreamDirectives:z}=await s("stx/streaming",()=>import("./chunk-arrjqs96.js"));Q=z(Q,Z),Q=T6(Q,Z,J,G,!0),Q=await m6(Q,Z,J,G,Y),Q=await M$(Q,Z,J,G,Y),Q=B4(Q,Z,J,G);let{processDeferDirectives:K}=await s("stx/defer",()=>import("./chunk-y3cz15x3.js"));Q=K(Q,Z,J);let{processTeleportDirectives:q}=await s("stx/teleport",()=>import("./chunk-xw23twxw.js"));Q=q(Q,Z,J);let{processTransitionDirectives:W,processTransitionAttributes:U}=await s("stx/transitions",()=>import("./chunk-971yqxa2.js"));Q=W(Q,Z,J),Q=U(Q);let{processErrorBoundaryDirectives:H,stripRenderFailedMarkers:j}=await s("stx/error-boundaries",()=>import("./chunk-a01sf1sc.js"));Q=H(Q,Z,J),Q=j(Q);let{processSuspenseDirectives:B}=await s("stx/suspense",()=>import("./chunk-nsese4as.js"));Q=B(Q,Z,J);let{processAsyncDirectives:V}=await s("stx/async-components",()=>import("./chunk-bds4s9d8.js"));Q=V(Q,Z,J);let{processKeepAliveDirectives:_}=await s("stx/keep-alive",()=>import("./chunk-4tsjysng.js"));Q=_(Q,Z,J);let{processVirtualListDirectives:L,processVirtualGridDirectives:F,processInfiniteListDirectives:O}=await s("stx/virtual-scrolling",()=>import("./chunk-503wfstj.js"));Q=L(Q,Z,J),Q=F(Q,Z,J),Q=O(Q,Z,J);let{processPartialHydrationDirectives:w,processStaticDirectives:R}=await s("stx/partial-hydration",()=>import("./chunk-yh9apppb.js"));Q=w(Q,Z,J),Q=R(Q);let{processComputedDirectives:D,processWatchDirectives:N}=await s("stx/computed",()=>import("./chunk-8bg1qmhg.js"));Q=D(Q,Z,J),Q=N(Q,Z,J);let{processFormValidationDirectives:I}=await s("stx/forms-validation",()=>import("./chunk-emx4ey5d.js"));Q=I(Q,Z,J);let{processHeadDirective:M,processTitleDirective:T,processMetaDirective:k,resetHead:A}=await s("stx/head",()=>import("./chunk-8t3h7fsk.js"));if(!Z.__stx_head_preset&&!Z.__stx_runtime_head)A();let E=M(Q);if(Q=E.content,E.headContent)Z.__stx_head_raw=`${Z.__stx_head_raw||""}${E.headContent}
3802
3876
  `;if(Q=T(Q,Z),Q=k(Q,Z,J),Q=P6(Q),Q=c5(Q,Z),Q=O7(Q),Q=y6(Q),Q=await T$(Q,Z,J,G,Y),Q=await M$(Q,Z,J,G,Y),Z.__stxProcessingDepth===1)Q=P3(Q,Z);if(Q=Q.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),Q=X3(Q),Q=e0(Q,Z,J),Q=b$(Q),Q=O4(Q,Z,{filePath:J,buildMode:G.buildMode}),Q=p5(Q,Z),Q=i5(Q,Z),Q=A2(Q,Z),Q=e5(Q,Z),Q=$$(Q,Z),Q=await G7(Q,Z,J,G),Q=await A4(Q,Z,J),Q=await JZ(Q,Z,J,G),Q=XZ(Q,Z,J,G),Q=UZ(Q,Z,J,G),Q=HZ(Q,Z,J),Q=jZ(Q,Z,J,G),Q=L7(Q,Z,J,G),Q=Z3(Q,Z),Q=J3(Q),Q=h8(Q),!G.skipEventDirectives)Q=y3(Q,Z,J);if(Q=R4(Q,Z,J),G.debug){let g=/\bx-data\s*=/.test(Q),l=a$($);if(g&&l)console.warn(`[stx] ${J}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
3803
3877
  Both work on the same page, but they manage separate scopes.
3804
- Prefer signals (state/derived/effect) for new components.`)}Q=Q6(Q,Z),Q=await L1(Q,Z,J),Q=l8(Q),Q=c8(Q),Q=G4(Q);let{processXElementDirectives:C}=await s("stx/x-element",()=>import("./chunk-8e287qw8.js"));Q=C(Q);let b=Z.__originalFilePath||J,y=d9(Z);if(Q=await b8(Q,G,b,y),Q=A7(Q,Z),Q=await C6(Q,Z,J,G),G.media?.image?.autoSiblings){let g=G.publicDir||"public",{rewriteImagesWithSiblings:l}=await s("stx/image-optimization/auto-sibling",()=>import("./chunk-0j5wwmha.js"));Q=await l(Q,{publicDir:g})}if(G.seo?.enabled)Q=BZ(Q,Z,G);let P=(g,l,t=!0)=>{if(!l)return g;let T0=l.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),W0=g.match(/<title\b[^>]*>[\s\S]*?<\/title>/i);if(T0&&W0){if(t)g=g.replace(W0[0],T0[0]);if(l=l.replace(T0[0],"").trim(),!l)return g}if(/<\/head>/i.test(g))return g.replace(/<\/head>/i,`${l}
3878
+ Prefer signals (state/derived/effect) for new components.`)}Q=Q6(Q,Z),Q=await L1(Q,Z,J),Q=l8(Q),Q=c8(Q),Q=G4(Q);let{processXElementDirectives:C}=await s("stx/x-element",()=>import("./chunk-stdkw5st.js"));Q=C(Q);let b=Z.__originalFilePath||J,y=d9(Z);if(Q=await b8(Q,G,b,y),Q=A7(Q,Z),Q=await C6(Q,Z,J,G),G.media?.image?.autoSiblings){let g=G.publicDir||"public",{rewriteImagesWithSiblings:l}=await s("stx/image-optimization/auto-sibling",()=>import("./chunk-wj66sab5.js"));Q=await l(Q,{publicDir:g})}if(G.seo?.enabled)Q=BZ(Q,Z,G);let P=(g,l,t=!0)=>{if(!l)return g;let T0=l.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),W0=g.match(/<title\b[^>]*>[\s\S]*?<\/title>/i);if(T0&&W0){if(t)g=g.replace(W0[0],T0[0]);if(l=l.replace(T0[0],"").trim(),!l)return g}if(/<\/head>/i.test(g))return g.replace(/<\/head>/i,`${l}
3805
3879
  </head>`);if(/<head\b[^>]*>/i.test(g))return g.replace(/(<head\b[^>]*>)/i,`$1
3806
3880
  ${l}`);if(/<html\b[^>]*>/i.test(g))return g.replace(/(<html\b[^>]*>)/i,`$1
3807
3881
  <head>
3808
3882
  ${l}
3809
- </head>`);return g},{renderHead:u,getHead:p}=await s("stx/head",()=>import("./chunk-nt03zdme.js")),X0=Z.__stx_runtime_head??p();if(X0.title||X0.meta?.length||X0.link?.length){let g=u(X0);if(g)Q=P(Q,g)}if(E.headContent)Q=P(Q,E.headContent,!X0.title);if(G.csp?.enabled&&G.csp.addMetaTag)Q=B7(Q,G.csp,Z);if(G.analytics?.enabled)Q=K4(Q,G);if(G.heatmap?.enabled)Q=W4(Q,G);if(G.pwa?.enabled&&G.pwa.autoInject!==!1){let{injectPwaTags:g}=await s("stx/pwa/inject",()=>import("./chunk-vaxepwj5.js"));Q=g(Q,G)}let r=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test(Q),J0=/\bSTX\.\w+/.test(Q),i=/window\.STX\s*=/.test(Q);if(r&&J0&&!i){let l=`<script data-stx-scoped data-stx-run="once">
3883
+ </head>`);return g},{renderHead:u,getHead:p}=await s("stx/head",()=>import("./chunk-8t3h7fsk.js")),X0=Z.__stx_runtime_head??p();if(X0.title||X0.meta?.length||X0.link?.length){let g=u(X0);if(g)Q=P(Q,g)}if(E.headContent)Q=P(Q,E.headContent,!X0.title);if(G.csp?.enabled&&G.csp.addMetaTag)Q=B7(Q,G.csp,Z);if(G.analytics?.enabled)Q=K4(Q,G);if(G.heatmap?.enabled)Q=W4(Q,G);if(G.pwa?.enabled&&G.pwa.autoInject!==!1){let{injectPwaTags:g}=await s("stx/pwa/inject",()=>import("./chunk-r909bddf.js"));Q=g(Q,G)}let r=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test(Q),J0=/\bSTX\.\w+/.test(Q),i=/window\.STX\s*=/.test(Q);if(r&&J0&&!i){let l=`<script data-stx-scoped data-stx-run="once">
3810
3884
  ${X4()}
3811
3885
  </script>`;if(Q.includes("</head>")){let t=Q.indexOf("</head>"),W0=Q.slice(0,t).indexOf("<script");if(W0!==-1){let x0=Q.slice(0,W0),j0=Q.slice(W0);Q=x0+l+`
3812
3886
  `+j0}else Q=Q.replace("</head>",`${l}
3813
3887
  </head>`)}else if(Q.includes("<body"))Q=Q.replace(/<body([^>]*)>/,`<body$1>
3814
3888
  ${l}`);else Q=l+`
3815
- `+Q}{let{scanScriptTags:g}=await s("stx/signal-processing",()=>import("./chunk-1chgn7qv.js")),l=[];for(let t of g(Q)){if(!/\bserver\b/i.test(t.attrs))continue;let T0=t.start+t.fullMatch.indexOf(">")+1,W0=VZ(Q,T0);if(W0===-1)continue;let x0=W0+9;while(x0<Q.length&&/\s/.test(Q[x0]))x0++;l.push({start:t.start,end:x0})}if(l.length>0){let t=Array(l.length+1),T0=0;for(let W0=0;W0<l.length;W0++){let{start:x0,end:j0}=l[W0];t[W0]=Q.slice(T0,x0),T0=j0}t[l.length]=Q.slice(T0),Q=t.join("")}}let q0=c9(Q,J);if(q0.hasScoped)Q=q0.html;let a=Z.__stx_event_bindings||[],V0=!1,o0=[],u0=/\s:[a-z][\w.-]*\s*=/.test(Q),{scanScriptTags:r0}=await s("stx/signal-processing",()=>import("./chunk-1chgn7qv.js"));for(let g of r0(Q,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))o0.push({match:g.fullMatch,attrs:g.attrs,content:g.body});for(let{match:g,attrs:l,content:t}of o0){V0=!0;let T0=t;Q3(t,J,X.strict,Z.__originalFilePath);let W0=await l9(t,{eventBindings:a,attrs:l,hasColonDirectives:u0,templateContent:$,filePath:J,projectRoot:process.cwd(),production:X.buildMode==="compile",serverData:y});Q=Q.replace(g,()=>W0)}if(V0)Z.__stx_event_bindings=[];if(!V0&&Z.__stxProcessingDepth===1){let g=Z.__stx_event_bindings||[];if(g.length>0){let l=Q5(g);if(l){let t=Q.lastIndexOf("</body>");Q=t===-1?Q+l:Q.slice(0,t)+l+`
3816
- `+Q.slice(t)}Z.__stx_event_bindings=[]}}if(!B8(Q)&&V8(Q))Q=await g9(Q,G);if(Q=L8(Q),G.csp?.enabled&&G.csp.useNonce&&typeof Z.cspNonce==="string")Q=V7(Q,Z.cspNonce);return Q}import bZ from"path";import W3 from"fs";import u2 from"path";function _Z($,Z,J,X){let Y=0;for(let Q=Z;Q<$.length;Q++)if($[Q]===J)Y++;else if($[Q]===X&&!(X===">"&&$[Q-1]==="=")){if(--Y===0)return Q}return-1}function WK($){let Z=G0($),J=0,X=0,Y=[];for(let Q=0;Q<Z.length;Q++)if("([{".includes(Z[Q]))J++;else if(")]}".includes(Z[Q]))J--;else if(Z[Q]===","&&J===0)Y.push($.slice(X,Q).trim()),X=Q+1;return Y.push($.slice(X).trim()),Y}function q3($,Z){let J=G0($),X=new RegExp(`\\b(?:${Z.map((Y)=>Y.replace(/[$]/g,"\\$&")).join("|")})\\s*(?=[<(])`,"g");for(let Y of J.matchAll(X)){let Q=Y.index+Y[0].length,G="";if(J[Q]==="<"){let K=_Z(J,Q,"<",">");if(K<0)continue;G=$.slice(Q+1,K),Q=K+1;while(/\s/.test(J[Q]||"")&&Q<J.length)Q++}if(J[Q]!=="(")continue;let z=_Z(J,Q,"(",")");if(z>=0)return{type:G,args:WK($.slice(Q+1,z))}}return null}var OZ=`
3889
+ `+Q}{let{scanScriptTags:g}=await s("stx/signal-processing",()=>import("./chunk-fy5jfqwe.js")),l=[];for(let t of g(Q)){if(!/\bserver\b/i.test(t.attrs))continue;let T0=t.start+t.fullMatch.indexOf(">")+1,W0=VZ(Q,T0);if(W0===-1)continue;let x0=W0+9;while(x0<Q.length&&/\s/.test(Q[x0]))x0++;l.push({start:t.start,end:x0})}if(l.length>0){let t=Array(l.length+1),T0=0;for(let W0=0;W0<l.length;W0++){let{start:x0,end:j0}=l[W0];t[W0]=Q.slice(T0,x0),T0=j0}t[l.length]=Q.slice(T0),Q=t.join("")}}let q0=c9(Q,J);if(q0.hasScoped)Q=q0.html;let a=Z.__stx_event_bindings||[],V0=!1,o0=[],u0=/\s:[a-z][\w.-]*\s*=/.test(Q),{scanScriptTags:r0}=await s("stx/signal-processing",()=>import("./chunk-fy5jfqwe.js"));for(let g of r0(Q,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))o0.push({match:g.fullMatch,attrs:g.attrs,content:g.body});for(let{match:g,attrs:l,content:t}of o0){V0=!0;let T0=t;Q3(t,J,X.strict,Z.__originalFilePath);let W0=await l9(t,{eventBindings:a,attrs:l,hasColonDirectives:u0,templateContent:$,filePath:J,projectRoot:process.cwd(),production:X.buildMode==="compile",serverData:y});Q=Q.replace(g,()=>W0)}if(V0)Z.__stx_event_bindings=[];if(!V0&&Z.__stxProcessingDepth===1){let g=Z.__stx_event_bindings||[];if(g.length>0){let l=Q5(g);if(l){let t=Q.lastIndexOf("</body>");Q=t===-1?Q+l:Q.slice(0,t)+l+`
3890
+ `+Q.slice(t)}Z.__stx_event_bindings=[]}}if(!B8(Q)&&V8(Q))Q=await g9(Q,G);if(Q=L8(Q),G.csp?.enabled&&G.csp.useNonce&&typeof Z.cspNonce==="string")Q=V7(Q,Z.cspNonce);return Q}import bZ from"path";import W3 from"fs";import u2 from"path";function _Z($,Z,J,X){let Y=0;for(let Q=Z;Q<$.length;Q++)if($[Q]===J)Y++;else if($[Q]===X&&!(X===">"&&$[Q-1]==="=")){if(--Y===0)return Q}return-1}function UK($){let Z=G0($),J=0,X=0,Y=[];for(let Q=0;Q<Z.length;Q++)if("([{".includes(Z[Q]))J++;else if(")]}".includes(Z[Q]))J--;else if(Z[Q]===","&&J===0)Y.push($.slice(X,Q).trim()),X=Q+1;return Y.push($.slice(X).trim()),Y}function q3($,Z){let J=G0($),X=new RegExp(`\\b(?:${Z.map((Y)=>Y.replace(/[$]/g,"\\$&")).join("|")})\\s*(?=[<(])`,"g");for(let Y of J.matchAll(X)){let Q=Y.index+Y[0].length,G="";if(J[Q]==="<"){let K=_Z(J,Q,"<",">");if(K<0)continue;G=$.slice(Q+1,K),Q=K+1;while(/\s/.test(J[Q]||"")&&Q<J.length)Q++}if(J[Q]!=="(")continue;let z=_Z(J,Q,"(",")");if(z>=0)return{type:G,args:UK($.slice(Q+1,z))}}return null}var OZ=`
3817
3891
  type __StxCtor<T> = T extends StringConstructor ? string : T extends NumberConstructor ? number : T extends BooleanConstructor ? boolean : T extends ArrayConstructor ? unknown[] : T extends ObjectConstructor ? object : T extends readonly unknown[] ? __StxCtor<T[number]> : T extends abstract new (...args: any[]) => infer V ? V : unknown;
3818
3892
  type __StxWiden<T> = T extends string ? string : T extends number ? number : T extends boolean ? boolean : T;
3819
3893
  type __StxOption<T> = T extends { type: infer C } ? __StxCtor<C> : T extends { default: infer D } ? D extends (...args: any[]) => infer V ? V : __StxWiden<D> : __StxCtor<T>;
@@ -3828,54 +3902,54 @@ namespace ${Z} {
3828
3902
  ${Q}
3829
3903
  ${q.join(`
3830
3904
  `)}
3831
- }`,props:W,events:U}}function*UK($){let Z=/<([A-Za-z][\w.-]*)(?=[\s/>])/g,J;while(J=Z.exec($)){let X=Z.lastIndex,Y=[];while(X<$.length){while(/\s/.test($[X]||""))X++;if($[X]===">"||$.slice(X,X+2)==="/>"){X+=$[X]===">"?1:2;break}let Q=/^[^\s=/>]+/.exec($.slice(X))?.[0];if(!Q){X++;continue}let G=X;X+=Q.length;while(/\s/.test($[X]||""))X++;if($[X]!=="="){Y.push({name:Q,value:!0,offset:G,braced:!1});continue}X++;while(/\s/.test($[X]||""))X++;let z=$[X],K=z==="{",q=z==='"'||z==="'";if(q||K)X++;let W=X;if(K){let U=G0($.slice(X)),H=1,j=0;for(;j<U.length;j++){if(U[j]==="{")H++;if(U[j]==="}"&&--H===0)break}X+=j}else if(q)while(X<$.length&&$[X]!==z)X++;else while(X<$.length&&!/[\s/>]/.test($[X]))X++;if(Y.push({name:Q,value:$.slice(W,X),offset:W,braced:K}),q||K)X++}Z.lastIndex=X,yield{name:J[1],offset:J.index,attributes:Y}}}function wZ($,Z,J){let X=[],Y=[OZ,"type __StxAssignedValue<T> = T extends { readonly _isSignal: true } | { readonly _isDerived: true } ? T extends () => infer V ? V : T : T;","type __StxProp<P, K> = K extends keyof P ? P[K] : unknown;",'type __StxEvent<E, K> = K extends keyof E ? E[K] extends readonly unknown[] ? Exclude<E[K]["length"], 0 | 1> extends never ? E[K][0] : E[K] : E[K] : any;'],Q=new Map,G=new Map,z=new Map,K=J.scriptCode($,J.filePath),q=G0(K);for(let B of K.matchAll(/\bimport\s+(\{[^}]+\}|[\w$]+)\s+from\s*['"]([^'"]+)['"]/g)){if(q.slice(B.index,B.index+6)!=="import")continue;let V=B[2],_=u2.isAbsolute(V)||V.startsWith(".")?u2.resolve(u2.dirname(J.filePath),V):R9(V,u2.dirname(J.filePath));if(!_)continue;let L=_.endsWith(".stx")?_:W3.existsSync(`${_}.stx`)?`${_}.stx`:void 0,F=L?null:w9(_,!1),O=B[1].startsWith("{")?B[1].slice(1,-1).split(","):[B[1]];for(let w of O){let[R,D=R]=w.trim().split(/\s+as\s+/),N=L||F?.get(R)||F?.get(R.toLowerCase());if(N)z.set(D,N),z.set(D.toLowerCase(),N),z.set(D.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),N)}}for(let B of Z.matchAll(/@import\s*\(([^)]+)\)/g))for(let V of B[1].matchAll(/['"]([^'"]+)['"]/g)){let _=D9(V[1],J.filePath,J).find((L)=>W3.statSync(L,{throwIfNoEntry:!1})?.isFile());if(_)z.set(u2.basename(V[1]).replace(/\.stx$/,""),_)}let W={__importedComponents:z},U=new Map,H=(B,V,_)=>{let L=$.slice(0,B);return{code:V,offset:B,attribute:_,anchor:!0,kind:"directive",line:L.split(`
3905
+ }`,props:W,events:U}}function*HK($){let Z=/<([A-Za-z][\w.-]*)(?=[\s/>])/g,J;while(J=Z.exec($)){let X=Z.lastIndex,Y=[];while(X<$.length){while(/\s/.test($[X]||""))X++;if($[X]===">"||$.slice(X,X+2)==="/>"){X+=$[X]===">"?1:2;break}let Q=/^[^\s=/>]+/.exec($.slice(X))?.[0];if(!Q){X++;continue}let G=X;X+=Q.length;while(/\s/.test($[X]||""))X++;if($[X]!=="="){Y.push({name:Q,value:!0,offset:G,braced:!1});continue}X++;while(/\s/.test($[X]||""))X++;let z=$[X],K=z==="{",q=z==='"'||z==="'";if(q||K)X++;let W=X;if(K){let U=G0($.slice(X)),H=1,j=0;for(;j<U.length;j++){if(U[j]==="{")H++;if(U[j]==="}"&&--H===0)break}X+=j}else if(q)while(X<$.length&&$[X]!==z)X++;else while(X<$.length&&!/[\s/>]/.test($[X]))X++;if(Y.push({name:Q,value:$.slice(W,X),offset:W,braced:K}),q||K)X++}Z.lastIndex=X,yield{name:J[1],offset:J.index,attributes:Y}}}function wZ($,Z,J){let X=[],Y=[OZ,"type __StxAssignedValue<T> = T extends { readonly _isSignal: true } | { readonly _isDerived: true } ? T extends () => infer V ? V : T : T;","type __StxProp<P, K> = K extends keyof P ? P[K] : unknown;",'type __StxEvent<E, K> = K extends keyof E ? E[K] extends readonly unknown[] ? Exclude<E[K]["length"], 0 | 1> extends never ? E[K][0] : E[K] : E[K] : any;'],Q=new Map,G=new Map,z=new Map,K=J.scriptCode($,J.filePath),q=G0(K);for(let B of K.matchAll(/\bimport\s+(\{[^}]+\}|[\w$]+)\s+from\s*['"]([^'"]+)['"]/g)){if(q.slice(B.index,B.index+6)!=="import")continue;let V=B[2],_=u2.isAbsolute(V)||V.startsWith(".")?u2.resolve(u2.dirname(J.filePath),V):R9(V,u2.dirname(J.filePath));if(!_)continue;let L=_.endsWith(".stx")?_:W3.existsSync(`${_}.stx`)?`${_}.stx`:void 0,F=L?null:w9(_,!1),O=B[1].startsWith("{")?B[1].slice(1,-1).split(","):[B[1]];for(let w of O){let[R,D=R]=w.trim().split(/\s+as\s+/),N=L||F?.get(R)||F?.get(R.toLowerCase());if(N)z.set(D,N),z.set(D.toLowerCase(),N),z.set(D.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),N)}}for(let B of Z.matchAll(/@import\s*\(([^)]+)\)/g))for(let V of B[1].matchAll(/['"]([^'"]+)['"]/g)){let _=D9(V[1],J.filePath,J).find((L)=>W3.statSync(L,{throwIfNoEntry:!1})?.isFile());if(_)z.set(u2.basename(V[1]).replace(/\.stx$/,""),_)}let W={__importedComponents:z},U=new Map,H=(B,V,_)=>{let L=$.slice(0,B);return{code:V,offset:B,attribute:_,anchor:!0,kind:"directive",line:L.split(`
3832
3906
  `).length,column:B-L.lastIndexOf(`
3833
- `)}},j=(B,V,_)=>X.push({expression:B,statement:{text:V+B.code+_,prefixLength:V.length}});for(let B of UK(Z)){if(b2(B.name)||B.name==="component")continue;let V=b7(B.name,J.filePath,J,W);if(!V)continue;let _=U.get(V);if(!_){let F;try{F=J.readComponent?J.readComponent(V):W3.readFileSync(V,"utf8")}catch{continue}if(F===void 0)continue;G.set(V,F),_=FZ(J.scriptCode(F,V),`__StxComponent${U.size}`),U.set(V,_),Y.push(_.declarations)}let L=[];for(let F of B.attributes){let{name:O,offset:w}=F,R=F.value===!0?"true":F.value;if(O.startsWith("@")||O.startsWith("v-on:")){if(_.events&&F.value!==!0)Q.set(w,`__StxEvent<${_.events}, ${JSON.stringify(O.replace(/^@|^v-on:/,"").split(".")[0])}>`);continue}let D=/^v-model(?::([\w-]+))?(?:\.[\w-]+)*$/.exec(O);if(O.startsWith("v-")&&!O.startsWith("v-bind:")&&!D)continue;if(/^(?:x-|:)(?:if|for|show|key|else)(?:$|[.:-])/.test(O))continue;let N=(D?D[1]||"modelValue":O.replace(/^:|^v-bind:/,"")).replace(/-([a-z])/g,(T,k)=>k.toUpperCase());if(L.push(N),!_.props)continue;let M=O.startsWith(":")||O.startsWith("v-bind:")||!!D||F.braced?R:F.value!==!0?JSON.stringify(R):"true";j(H(w,M,O),";void ((",`) satisfies __StxProp<${_.props}, ${JSON.stringify(N)}>);`)}if(_.props){let F=[...new Set(L)].map((w)=>`${JSON.stringify(w)}: undefined as any`).join(", "),O=H(B.offset,`<${B.name}>`);X.push({expression:O,statement:{text:`;void ({ ${F} } satisfies ${_.props} & Record<string, unknown>);`,prefixLength:0}})}}return{declarations:U.size?Y.join(`
3834
- `):"",checks:X,events:Q,dependencies:G}}var RZ=/<script(\s[^>]*)?>([\s\S]*?)<\/script>/gi;function HK($){let Z=(J)=>J.replace(/[^\n]/g," ");return $.replace(/<!--[\s\S]*?-->/g,Z).replace(/\{\{--[\s\S]*?--\}\}/g,Z)}function DZ($){let Z=[],J=HK($);RZ.lastIndex=0;let X;while((X=RZ.exec(J))!==null){let Y=(X[1]||"").trim(),Q=(X[0].match(/^<script(?:\s[^>]*)?>/i)?.[0]??"<script>").length,G=(X[0].match(/<\/script\s*>$/i)?.[0]??"</script>").length,z=X.index+Q,K=X.index+X[0].length-G,q=$.slice(z,K);if(/\bsrc\s*=/.test(Y))continue;let W=Y.match(/\btype\s*=\s*["']([^"']+)["']/i);if(W&&!/^(?:module|text\/(?:javascript|typescript))$/i.test(W[1]))continue;let U=/\bserver\b/.test(Y)?"server":/\bclient\b/.test(Y)?"client":"plain",H=m2($,z);Z.push({kind:U,code:q,startLine:H,startColumn:d2($,z),offset:z,attrs:Y})}return Z}function m2($,Z){let J=1;for(let X=0;X<Z&&X<$.length;X++)if($.charCodeAt(X)===10)J++;return J}function d2($,Z){let J=$.lastIndexOf(`
3907
+ `)}},j=(B,V,_)=>X.push({expression:B,statement:{text:V+B.code+_,prefixLength:V.length}});for(let B of HK(Z)){if(b2(B.name)||B.name==="component")continue;let V=b7(B.name,J.filePath,J,W);if(!V)continue;let _=U.get(V);if(!_){let F;try{F=J.readComponent?J.readComponent(V):W3.readFileSync(V,"utf8")}catch{continue}if(F===void 0)continue;G.set(V,F),_=FZ(J.scriptCode(F,V),`__StxComponent${U.size}`),U.set(V,_),Y.push(_.declarations)}let L=[];for(let F of B.attributes){let{name:O,offset:w}=F,R=F.value===!0?"true":F.value;if(O.startsWith("@")||O.startsWith("v-on:")){if(_.events&&F.value!==!0)Q.set(w,`__StxEvent<${_.events}, ${JSON.stringify(O.replace(/^@|^v-on:/,"").split(".")[0])}>`);continue}let D=/^v-model(?::([\w-]+))?(?:\.[\w-]+)*$/.exec(O);if(O.startsWith("v-")&&!O.startsWith("v-bind:")&&!D)continue;if(/^(?:x-|:)(?:if|for|show|key|else)(?:$|[.:-])/.test(O))continue;let N=(D?D[1]||"modelValue":O.replace(/^:|^v-bind:/,"")).replace(/-([a-z])/g,(T,k)=>k.toUpperCase());if(L.push(N),!_.props)continue;let M=O.startsWith(":")||O.startsWith("v-bind:")||!!D||F.braced?R:F.value!==!0?JSON.stringify(R):"true";j(H(w,M,O),";void ((",`) satisfies __StxProp<${_.props}, ${JSON.stringify(N)}>);`)}if(_.props){let F=[...new Set(L)].map((w)=>`${JSON.stringify(w)}: undefined as any`).join(", "),O=H(B.offset,`<${B.name}>`);X.push({expression:O,statement:{text:`;void ({ ${F} } satisfies ${_.props} & Record<string, unknown>);`,prefixLength:0}})}}return{declarations:U.size?Y.join(`
3908
+ `):"",checks:X,events:Q,dependencies:G}}var RZ=/<script(\s[^>]*)?>([\s\S]*?)<\/script>/gi;function jK($){let Z=(J)=>J.replace(/[^\n]/g," ");return $.replace(/<!--[\s\S]*?-->/g,Z).replace(/\{\{--[\s\S]*?--\}\}/g,Z)}function DZ($){let Z=[],J=jK($);RZ.lastIndex=0;let X;while((X=RZ.exec(J))!==null){let Y=(X[1]||"").trim(),Q=(X[0].match(/^<script(?:\s[^>]*)?>/i)?.[0]??"<script>").length,G=(X[0].match(/<\/script\s*>$/i)?.[0]??"</script>").length,z=X.index+Q,K=X.index+X[0].length-G,q=$.slice(z,K);if(/\bsrc\s*=/.test(Y))continue;let W=Y.match(/\btype\s*=\s*["']([^"']+)["']/i);if(W&&!/^(?:module|text\/(?:javascript|typescript))$/i.test(W[1]))continue;let U=/\bserver\b/.test(Y)?"server":/\bclient\b/.test(Y)?"client":"plain",H=m2($,z);Z.push({kind:U,code:q,startLine:H,startColumn:d2($,z),offset:z,attrs:Y})}return Z}function m2($,Z){let J=1;for(let X=0;X<Z&&X<$.length;X++)if($.charCodeAt(X)===10)J++;return J}function d2($,Z){let J=$.lastIndexOf(`
3835
3909
  `,Z-1)+1;return Z-J+1}function i9($){let Z=$.split(""),J=(Y,Q)=>{for(let G=Y;G<Q&&G<Z.length;G++)if(Z[G]!==`
3836
- `)Z[G]=" "},X=[/<script(?:\s[^>]*)?>[\s\S]*?<\/script>/gi,/<style(?:\s[^>]*)?>[\s\S]*?<\/style>/gi,/<!--[\s\S]*?-->/g,/\{\{--[\s\S]*?--\}\}/g,/@verbatim\b[\s\S]*?@endverbatim\b/g];for(let Y of X){Y.lastIndex=0;let Q;while((Q=Y.exec($))!==null)J(Q.index,Q.index+Q[0].length)}return Z.join("")}function jK($){let Z=0,J="";for(let X=0;X<$.length;X++){let Y=$[X];if(J){if(Y==="\\"){X++;continue}if(Y===J)J="";continue}if(Y==='"'||Y==="'"||Y==="`"){J=Y;continue}if(Y==="("||Y==="["||Y==="{"){Z++;continue}if(Y===")"||Y==="]"||Y==="}"){Z--;continue}if(Y==="|"&&Z===0){if($[X+1]==="|"){X++;continue}if($[X-1]==="|")continue;return $.slice(0,X)}}return $}var SZ=new Set([":for","x-for","v-for"]),n9=/(?:^|\s)((?::|x-|v-|@)[\w.:-]+)\s*=\s*(["'])([\s\S]*?)\2/g,U3="__stx_interpolated",NZ="__StxElement",CZ="__StxTemplateValue",BK=`type ${CZ}<T> = T extends { readonly _isSignal: true } | { readonly _isDerived: true } ? (T extends () => infer V ? T & V : T) : T`;function MZ($){return $.replace(/\{\{[\s\S]*?\}\}/g,U3).replace(/\{!![\s\S]*?!!\}/g,U3)}function VK($){return $.replace(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/g,(Z)=>{let J=Z.split(`
3910
+ `)Z[G]=" "},X=[/<script(?:\s[^>]*)?>[\s\S]*?<\/script>/gi,/<style(?:\s[^>]*)?>[\s\S]*?<\/style>/gi,/<!--[\s\S]*?-->/g,/\{\{--[\s\S]*?--\}\}/g,/@verbatim\b[\s\S]*?@endverbatim\b/g];for(let Y of X){Y.lastIndex=0;let Q;while((Q=Y.exec($))!==null)J(Q.index,Q.index+Q[0].length)}return Z.join("")}function BK($){let Z=0,J="";for(let X=0;X<$.length;X++){let Y=$[X];if(J){if(Y==="\\"){X++;continue}if(Y===J)J="";continue}if(Y==='"'||Y==="'"||Y==="`"){J=Y;continue}if(Y==="("||Y==="["||Y==="{"){Z++;continue}if(Y===")"||Y==="]"||Y==="}"){Z--;continue}if(Y==="|"&&Z===0){if($[X+1]==="|"){X++;continue}if($[X-1]==="|")continue;return $.slice(0,X)}}return $}var SZ=new Set([":for","x-for","v-for"]),n9=/(?:^|\s)((?::|x-|v-|@)[\w.:-]+)\s*=\s*(["'])([\s\S]*?)\2/g,U3="__stx_interpolated",NZ="__StxElement",CZ="__StxTemplateValue",VK=`type ${CZ}<T> = T extends { readonly _isSignal: true } | { readonly _isDerived: true } ? (T extends () => infer V ? T & V : T) : T`;function MZ($){return $.replace(/\{\{[\s\S]*?\}\}/g,U3).replace(/\{!![\s\S]*?!!\}/g,U3)}function LK($){return $.replace(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/g,(Z)=>{let J=Z.split(`
3837
3911
  `).length-1,X=Z.length-J;return`0${" ".repeat(Math.max(0,X-1))}${`
3838
- `.repeat(J)}`})}var LK=["foreach","endforeach","forelse","endforelse","for","endfor","while","endwhile","empty","if","elseif","else","endif","unless","endunless","isset","endisset","switch","case","default","endswitch","auth","endauth","guest","endguest","env","endenv","once","endonce","break","continue"],_K=new RegExp(String.raw`^[ \t]*@(?:${LK.join("|")})\b[ \t]*(\([^\n)]*\))?[ \t]*$`,"gm");function OK($){return $.replace(_K,(Z)=>Z.replace(/[^\n]/g," "))}var AZ=new Set(["x-cloak","x-ref","x-transition","x-teleport","v-slot","x-hydrate",":key","x-tooltip","x-tooltip-position"]);function FK($){let Z=i9($),J=[],X=/(@?)\{\{([\s\S]*?)\}\}|(@?)\{!!([\s\S]*?)!!\}/g,Y;while((Y=X.exec(Z))!==null){if(Y[1]||Y[3])continue;let z=Y[2]??Y[4]??"",K=Y[2]!==void 0?2:3,q=jK(z);if(!q.trim())continue;let W=Y.index+K+(q.length-q.trimStart().length);J.push({code:q.trim(),line:m2(Z,W),column:d2(Z,W),offset:W,kind:"interpolation"})}let Q=/@(if|elseif|else\s+if|unless)\b\s*\(/g;while((Y=Q.exec(Z))!==null){let G=Y.index+Y[0].length-1,z=0,K=G;for(;K<Z.length;K++){let H=Z[K];if(H==="(")z++;else if(H===")"){if(z--,z===0)break}}if(z!==0)continue;let q=Z.slice(G+1,K),W=q.trim();if(Q.lastIndex=K+1,!W)continue;let U=G+1+(q.length-q.trimStart().length);J.push({code:W,line:m2(Z,U),column:d2(Z,U),offset:Y.index,kind:"condition"})}n9.lastIndex=0;while((Y=n9.exec(Z))!==null){let G=Y[1],z=Y[3]??"",K=G.replace(/\..*$/,"").replace(/^([^:].*?):.*$/,"$1");if(AZ.has(K)||AZ.has(G))continue;if(!z.trim())continue;let q=Y.index+Y[0].indexOf(Y[2],Y[0].indexOf(G)+G.length)+1;if(SZ.has(K)){let U=z.match(/\s+(?:in|of)\s+/);if(!U||U.index===void 0)continue;let H=z.slice(U.index+U[0].length),j=U.index+U[0].length+(H.length-H.trimStart().length);J.push({code:MZ(H.trim()),line:m2(Z,q+j),column:d2(Z,q+j),offset:q+j,kind:"directive",attribute:K});continue}let W=z.length-z.trimStart().length;J.push({code:MZ(z.trim()),line:m2(Z,q+W),column:d2(Z,q+W),offset:q+W,kind:"directive",attribute:K})}return J.sort((G,z)=>G.line-z.line||G.column-z.column),J}var wK=2000;function RK($,Z){let J=0,X=Math.min($.length,Z+wK);for(let Y=Z;Y<X;Y++){let Q=$[Y];if(Q==="(")J++;else if(Q===")"){if(J--,J===0)return $.slice(Z+1,Y)}}return null}function DK($){let Z=new Map,J=(z,K)=>{let q=z.split(/[,[\]{}()\s]+/).filter(Boolean);for(let W of q){let U=W.replace(/^\.\.\./,"").trim();if(!/^\$?[A-Z_$][\w$]*$/i.test(U))continue;let H=q.length===1?K:void 0,j=Z.get(U);if(!j)Z.set(U,{name:U,iterable:H});else if(j.iterable!==H)j.iterable=void 0}},X=/^\$?[A-Z_$][\w$]*$/i,Y=(z)=>{let K=z.trim();return X.test(K)?K:void 0};for(let z of $.matchAll(/@for(?:each|else)\s*\(/g)){let K=RK($,z.index+z[0].length-1);if(K===null)continue;let q=a1(K);if(!q)continue;J(q.itemVar.replace(/=>/g," "),Y(q.arrayExpr))}for(let z of $.matchAll(/@for\s*\(\s*(?:(?:let|const|var)\s+)?([\w$]+|\[[^\]]*\]|\{[^}]*\})\s+(of|in)\s+([^)]*)/g))J(z[1],z[2]==="of"?Y(z[3]):void 0);for(let z of $.matchAll(/@for\s*\(\s*(?:let|const|var)\s+([\w$]+)\s*[=;]/g))J(z[1]);let Q=i9($);n9.lastIndex=0;let G;while((G=n9.exec(Q))!==null){let z=G[1].replace(/\..*$/,"");if(!SZ.has(z))continue;let K=G[3].match(/\s+(?:in|of)\s+/);if(!K||K.index===void 0)continue;J(G[3].slice(0,K.index),Y(G[3].slice(K.index+K[0].length)))}for(let z of $.matchAll(/@(?:php|js|ts)\b([\s\S]*?)@end(?:php|js|ts)\b/g))for(let K of z[1].matchAll(/\b(?:const|let|var|function|class)\s+([\w$]+)/g))J(K[1]);return[...Z.values()].sort((z,K)=>z.name.localeCompare(K.name))}function B1($){let Z=new Set;for(let J of $.matchAll(/^\s*(?:export\s+)?(?:const|let|var)\s+([\w$]+)/gm))Z.add(J[1]);for(let J of $.matchAll(/^\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*([\w$]+)/gm))Z.add(J[1]);for(let J of $.matchAll(/^\s*(?:export\s+)?class\s+([\w$]+)/gm))Z.add(J[1]);for(let J of $.matchAll(/^\s*(?:export\s+)?(?:const|let|var)\s*[[{]([^\]}]*)[\]}]/gm))for(let X of J[1].split(",")){let Y=X.split(":").pop().split("=")[0].replace(/^\.\.\./,"").trim();if(/^[A-Z_$][\w$]*$/i.test(Y))Z.add(Y)}return[...Z].sort()}var H3=["params","query","cookies","host","ip","setResponseStatus","setResponseHeader","notFound","request","url","definePageMeta","defineClientPayload","defineStore","props","$props"],NK={$bool:"declare function $bool(value: unknown, fallback?: boolean): boolean",$num:"declare function $num(value: unknown, fallback?: number): number",$uid:"declare var $uid: string"};function xO($=new Set){return[...H3.filter((Z)=>!$.has(Z)).map((Z)=>`declare var ${Z}: any`),...Object.entries(NK).filter(([Z])=>!$.has(Z)).map(([,Z])=>Z)].join(`
3839
- `)}function fO($){return new Set([...$.matchAll(/^declare (?:function|const|let|var)\s+([A-Za-z_$][\w$]*)/gm)].map((Z)=>Z[1]))}function PZ($){let Z=/\bdefineClientPayload\s*\(\s*\{([\s\S]*?)\}\s*\)/g,J,X=!1,Y=new Set,Q=G0($);while((J=Z.exec(Q))!==null){X=!0;for(let G of MK(J[1])){let z=G.split(":")[0].trim();if(/^[A-Za-z_$][\w$]*$/.test(z))Y.add(z)}}return X?[...Y]:null}function MK($){let Z=[],J=0,X="";for(let Y of $){if(Y===","&&J===0){Z.push(X),X="";continue}if(Y==="("||Y==="["||Y==="{")J++;else if(Y===")"||Y==="]"||Y==="}")J--;X+=Y}return Z.push(X),Z.filter((Y)=>Y.trim().length>0)}function AK($){let Z=/^[ \t]*import\b[\s\S]*?(?:from\s*['"][^'"]*['"]|['"][^'"]*['"])[ \t]*;?[ \t]*$/gm,J=[],X=$.replace(Z,(Y)=>{return J.push(Y.trim()),Y.split(`
3912
+ `.repeat(J)}`})}var _K=["foreach","endforeach","forelse","endforelse","for","endfor","while","endwhile","empty","if","elseif","else","endif","unless","endunless","isset","endisset","switch","case","default","endswitch","auth","endauth","guest","endguest","env","endenv","once","endonce","break","continue"],OK=new RegExp(String.raw`^[ \t]*@(?:${_K.join("|")})\b[ \t]*(\([^\n)]*\))?[ \t]*$`,"gm");function FK($){return $.replace(OK,(Z)=>Z.replace(/[^\n]/g," "))}var AZ=new Set(["x-cloak","x-ref","x-transition","x-teleport","v-slot","x-hydrate",":key","x-tooltip","x-tooltip-position"]);function wK($){let Z=i9($),J=[],X=/(@?)\{\{([\s\S]*?)\}\}|(@?)\{!!([\s\S]*?)!!\}/g,Y;while((Y=X.exec(Z))!==null){if(Y[1]||Y[3])continue;let z=Y[2]??Y[4]??"",K=Y[2]!==void 0?2:3,q=BK(z);if(!q.trim())continue;let W=Y.index+K+(q.length-q.trimStart().length);J.push({code:q.trim(),line:m2(Z,W),column:d2(Z,W),offset:W,kind:"interpolation"})}let Q=/@(if|elseif|else\s+if|unless)\b\s*\(/g;while((Y=Q.exec(Z))!==null){let G=Y.index+Y[0].length-1,z=0,K=G;for(;K<Z.length;K++){let H=Z[K];if(H==="(")z++;else if(H===")"){if(z--,z===0)break}}if(z!==0)continue;let q=Z.slice(G+1,K),W=q.trim();if(Q.lastIndex=K+1,!W)continue;let U=G+1+(q.length-q.trimStart().length);J.push({code:W,line:m2(Z,U),column:d2(Z,U),offset:Y.index,kind:"condition"})}n9.lastIndex=0;while((Y=n9.exec(Z))!==null){let G=Y[1],z=Y[3]??"",K=G.replace(/\..*$/,"").replace(/^([^:].*?):.*$/,"$1");if(AZ.has(K)||AZ.has(G))continue;if(!z.trim())continue;let q=Y.index+Y[0].indexOf(Y[2],Y[0].indexOf(G)+G.length)+1;if(SZ.has(K)){let U=z.match(/\s+(?:in|of)\s+/);if(!U||U.index===void 0)continue;let H=z.slice(U.index+U[0].length),j=U.index+U[0].length+(H.length-H.trimStart().length);J.push({code:MZ(H.trim()),line:m2(Z,q+j),column:d2(Z,q+j),offset:q+j,kind:"directive",attribute:K});continue}let W=z.length-z.trimStart().length;J.push({code:MZ(z.trim()),line:m2(Z,q+W),column:d2(Z,q+W),offset:q+W,kind:"directive",attribute:K})}return J.sort((G,z)=>G.line-z.line||G.column-z.column),J}var RK=2000;function DK($,Z){let J=0,X=Math.min($.length,Z+RK);for(let Y=Z;Y<X;Y++){let Q=$[Y];if(Q==="(")J++;else if(Q===")"){if(J--,J===0)return $.slice(Z+1,Y)}}return null}function NK($){let Z=new Map,J=(z,K)=>{let q=z.split(/[,[\]{}()\s]+/).filter(Boolean);for(let W of q){let U=W.replace(/^\.\.\./,"").trim();if(!/^\$?[A-Z_$][\w$]*$/i.test(U))continue;let H=q.length===1?K:void 0,j=Z.get(U);if(!j)Z.set(U,{name:U,iterable:H});else if(j.iterable!==H)j.iterable=void 0}},X=/^\$?[A-Z_$][\w$]*$/i,Y=(z)=>{let K=z.trim();return X.test(K)?K:void 0};for(let z of $.matchAll(/@for(?:each|else)\s*\(/g)){let K=DK($,z.index+z[0].length-1);if(K===null)continue;let q=a1(K);if(!q)continue;J(q.itemVar.replace(/=>/g," "),Y(q.arrayExpr))}for(let z of $.matchAll(/@for\s*\(\s*(?:(?:let|const|var)\s+)?([\w$]+|\[[^\]]*\]|\{[^}]*\})\s+(of|in)\s+([^)]*)/g))J(z[1],z[2]==="of"?Y(z[3]):void 0);for(let z of $.matchAll(/@for\s*\(\s*(?:let|const|var)\s+([\w$]+)\s*[=;]/g))J(z[1]);let Q=i9($);n9.lastIndex=0;let G;while((G=n9.exec(Q))!==null){let z=G[1].replace(/\..*$/,"");if(!SZ.has(z))continue;let K=G[3].match(/\s+(?:in|of)\s+/);if(!K||K.index===void 0)continue;J(G[3].slice(0,K.index),Y(G[3].slice(K.index+K[0].length)))}for(let z of $.matchAll(/@(?:php|js|ts)\b([\s\S]*?)@end(?:php|js|ts)\b/g))for(let K of z[1].matchAll(/\b(?:const|let|var|function|class)\s+([\w$]+)/g))J(K[1]);return[...Z.values()].sort((z,K)=>z.name.localeCompare(K.name))}function B1($){let Z=new Set;for(let J of $.matchAll(/^\s*(?:export\s+)?(?:const|let|var)\s+([\w$]+)/gm))Z.add(J[1]);for(let J of $.matchAll(/^\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*([\w$]+)/gm))Z.add(J[1]);for(let J of $.matchAll(/^\s*(?:export\s+)?class\s+([\w$]+)/gm))Z.add(J[1]);for(let J of $.matchAll(/^\s*(?:export\s+)?(?:const|let|var)\s*[[{]([^\]}]*)[\]}]/gm))for(let X of J[1].split(",")){let Y=X.split(":").pop().split("=")[0].replace(/^\.\.\./,"").trim();if(/^[A-Z_$][\w$]*$/i.test(Y))Z.add(Y)}return[...Z].sort()}var H3=["params","query","cookies","host","ip","setResponseStatus","setResponseHeader","notFound","request","url","definePageMeta","defineClientPayload","defineStore","props","$props"],MK={$bool:"declare function $bool(value: unknown, fallback?: boolean): boolean",$num:"declare function $num(value: unknown, fallback?: number): number",$uid:"declare var $uid: string"};function fO($=new Set){return[...H3.filter((Z)=>!$.has(Z)).map((Z)=>`declare var ${Z}: any`),...Object.entries(MK).filter(([Z])=>!$.has(Z)).map(([,Z])=>Z)].join(`
3913
+ `)}function gO($){return new Set([...$.matchAll(/^declare (?:function|const|let|var)\s+([A-Za-z_$][\w$]*)/gm)].map((Z)=>Z[1]))}function PZ($){let Z=/\bdefineClientPayload\s*\(\s*\{([\s\S]*?)\}\s*\)/g,J,X=!1,Y=new Set,Q=G0($);while((J=Z.exec(Q))!==null){X=!0;for(let G of AK(J[1])){let z=G.split(":")[0].trim();if(/^[A-Za-z_$][\w$]*$/.test(z))Y.add(z)}}return X?[...Y]:null}function AK($){let Z=[],J=0,X="";for(let Y of $){if(Y===","&&J===0){Z.push(X),X="";continue}if(Y==="("||Y==="["||Y==="{")J++;else if(Y===")"||Y==="]"||Y==="}")J--;X+=Y}return Z.push(X),Z.filter((Y)=>Y.trim().length>0)}function IK($){let Z=/^[ \t]*import\b[\s\S]*?(?:from\s*['"][^'"]*['"]|['"][^'"]*['"])[ \t]*;?[ \t]*$/gm,J=[],X=$.replace(Z,(Y)=>{return J.push(Y.trim()),Y.split(`
3840
3914
  `).map(()=>"").join(`
3841
3915
  `)});return{imports:J.join(`
3842
3916
  `),body:X}}function vZ($){let Z=G0($),J=Array(Z.length),X=0;for(let z=0;z<Z.length;z++){let K=Z[z];if(K==="}"||K===")"||K==="]")X=Math.max(0,X-1);if(J[z]=X,K==="{"||K==="("||K==="[")X++}let Y=[],Q=/^[ \t]*(?:export[ \t]+)?(interface|type)[ \t]+([A-Za-z_$][\w$]*)/gm,G;while((G=Q.exec(Z))!==null){if(J[G.index]!==0)continue;let z=G[1],K=G[2],q;if(z==="interface"){let W=Z.indexOf("{",G.index);if(W===-1)continue;let U=0;q=-1;for(let H=W;H<Z.length;H++)if(Z[H]==="{")U++;else if(Z[H]==="}"&&--U===0){q=H+1;break}if(q===-1)continue}else{let W=0;q=Z.length;for(let U=Z.indexOf("=",G.index)+1;U<Z.length;U++){let H=Z[U];if(H==="{"||H==="["||H==="("||H==="<")W++;else if(H==="}"||H==="]"||H===")"||H===">")W--;else if(W<=0&&(H===";"||H===`
3843
- `&&!/[=|&,<([{]\s*$/.test(Z.slice(Math.max(0,U-40),U)))){q=H===";"?U+1:U;break}}}Y.push({name:K,text:$.slice(G.index,q).replace(/^[ \t]*export[ \t]+/,"")}),Q.lastIndex=q}return Y}function IK($){return new Set(vZ($).map((Z)=>Z.name))}function gO($,Z=""){let J=PZ($),X=IK(Z),Y=vZ($).filter((q)=>!X.has(q.name)).map((q)=>q.text);if(!J){let q=B1($).filter((W)=>!r2(Z,W));if(q.length===0&&Y.length===0)return"";return["",`// ${kK}`,...Y,...q.map((W)=>`declare var ${W}: any`)].join(`
3917
+ `&&!/[=|&,<([{]\s*$/.test(Z.slice(Math.max(0,U-40),U)))){q=H===";"?U+1:U;break}}}Y.push({name:K,text:$.slice(G.index,q).replace(/^[ \t]*export[ \t]+/,"")}),Q.lastIndex=q}return Y}function TK($){return new Set(vZ($).map((Z)=>Z.name))}function hO($,Z=""){let J=PZ($),X=TK(Z),Y=vZ($).filter((q)=>!X.has(q.name)).map((q)=>q.text);if(!J){let q=B1($).filter((W)=>!r2(Z,W));if(q.length===0&&Y.length===0)return"";return["",`// ${EK}`,...Y,...q.map((W)=>`declare var ${W}: any`)].join(`
3844
3918
  `)}if(J.length===0)return Y.length>0?["",`// ${IZ}`,...Y].join(`
3845
- `):"";let{imports:Q,body:G}=AK($),z=G.replace(/^[ \t]*export[ \t]+(?=(?:const|let|var|function|async|class)\b)/gm,""),K=["",`// ${IZ}`];if(Q)K.push(Q);return K.push(...Y),K.push(`async function ${TZ}() {`,z,` return { ${J.join(", ")} }`,"}",`type ${kZ} = Awaited<ReturnType<typeof ${TZ}>>`,...J.map((q)=>`declare var ${q}: ${kZ}[${JSON.stringify(q)}]`)),K.join(`
3846
- `)}function TK($){let J=G0($).split(""),X=0;for(let Y=0;Y<J.length;Y++){let Q=J[Y];if(Q==="{"||Q==="("||Q==="["){X++;continue}if(Q==="}"||Q===")"||Q==="]"){X=Math.max(0,X-1);continue}if(X>0&&Q!==`
3847
- `)J[Y]=" "}return B1(J.join(""))}function hO($,Z){if(PZ($)!==null)return[];let J=G0(Z),X=new Set(Q2);return TK($).filter((Y)=>{if(X.has(Y))return!1;if(B1(Z).includes(Y))return!1;return new RegExp(`(?<![.#\\w$])${Y}(?![\\w$])`).test(J)})}var IZ="stx: types for the declared client payload (#1868)",kK="stx: untyped bridge names \u2014 declare a defineClientPayload to check these (#1868)",TZ="__stxServerScope",kZ="__StxClientPayload";var EZ=["$env","$user","$slot","$slots","$attrs","$props","$page","$route","$loop","loop","$errors","$csrf","props","slot"];var EK=/^\s*[A-Z_$][\w$]*\s*=[^=]/i;function yK($){let Z=new Map,J=/!|===|!==|==|!=|&&|\|\||<|>|\btypeof\b|\binstanceof\b|\bin\b/;for(let X of $){let Y=G0(X),{depths:Q,balanced:G}=K2(Y);if(!G)continue;let z=/^([ \t]*(?:export[ \t]+)?const[ \t]+)([A-Za-z_$][\w$]*)[ \t]*(?::[^=\n]+)?=[ \t]*([^\n]+)$/gm;for(let K of Y.matchAll(z)){let q=K.index??0;if(Q[q+K[1].length]!==0)continue;let W=K[2],U=q+K[0].length-K[3].length,H=X.slice(U,q+K[0].length).trim().replace(/;$/,"").trim(),j=K[3],B=J.test(j)&&!/\bawait\b|=>|\bfunction\b|[{}]/.test(j)&&!/[,+\-*/%&|?:=]$/.test(H)&&K2(j).balanced;Z.set(W,Z.has(W)||!B?null:H)}}return new Map([...Z].filter((X)=>X[1]!==null))}function xZ($,Z,J=0,X=new Set){if(Z.size===0||J>=5)return $;let Y=G0($),Q="",G=0;for(let z of Y.matchAll(/[A-Za-z_$][\w$]*/g)){let K=z.index??0,q=z[0],W=Z.get(q);if(!W||X.has(q))continue;let U=Y.slice(0,K).trimEnd(),H=Y.slice(K+q.length).trimStart();if(U.endsWith(".")||/^:(?!:)/.test(H)&&/[{,]$/.test(U))continue;if(K>0&&/[\w$]/.test(Y[K-1]))continue;Q+=`${$.slice(G,K)}(${xZ(W,Z,J+1,new Set([...X,q]))})`,G=K+q.length}return Q+$.slice(G)}function bK($,Z){let J=/@(if|unless|elseif|else|endif|endunless)\b\s*(\()?/g,X=[],Y;while((Y=J.exec($))!==null){if(Y.index>Z)break;let Q=Y[1];if(Y.index===Z){if(Q==="elseif"){let z=X[X.length-1];if(z?.current)z.seen.push(z.current);if(z)z.current=null}break}if(Q==="endif"||Q==="endunless"){X.pop();continue}let G="";if(Y[2]==="("){let z=0,K=Y.index+Y[0].length-1,q=K+1;for(;K<$.length;K++){let W=$[K];if(W==="(")z++;else if(W===")"){if(z--,z===0)break}}G=$.slice(q,K).trim(),J.lastIndex=K+1}if(Q==="if")X.push({seen:[],current:G});else if(Q==="unless")X.push({seen:[],current:`!(${G})`});else if(Q==="elseif"||Q==="else"){let z=X[X.length-1];if(!z)continue;if(z.current)z.seen.push(z.current);z.current=Q==="elseif"?G:null}}return X.flatMap((Q)=>[...Q.seen.map((G)=>`!(${G})`),...Q.current?[Q.current]:[]]).filter(Boolean)}function SK($){let Z=$.code.trim();if(!Z)return null;if($.attribute?.startsWith("@")){if(EK.test(Z))return null;let X=";(($event: any): void => { ";return{text:`${X}${Z} });`,prefixLength:X.length}}let J=";void ((";return{text:`${J}${Z}));`,prefixLength:J.length}}var CK=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.{1,2}\/[^'"\n]*)\2/g;function yZ($,Z){if(!Z)return $;return $.replace(CK,(J,X,Y,Q)=>{let G=bZ.resolve(Z,Q).replace(/\\/g,"/");return`${X}${Y}${G}${Y}`})}function PK($){return" ".repeat(Math.max(0,($.startColumn??1)-1))}function vK($){let Z=new Set,J=G0($);for(let X of J.matchAll(/\bimport\s+(?:type\s+)?([\w$*{}\s,]+?)\s+from\b/g)){let Y=X[1],Q=/\{([^}]*)\}/.exec(Y);for(let q of Q?.[1].split(",")??[]){let W=q.trim().replace(/^type\s+/,"").split(/\s+as\s+/).pop()?.trim();if(W&&/^[A-Z_$][\w$]*$/i.test(W))Z.add(W)}let G=Y.replace(/\{[^}]*\}/,""),z=/\*\s*as\s+([A-Z_$][\w$]*)/i.exec(G);if(z)Z.add(z[1]);let K=/^\s*([A-Z_$][\w$]*)/i.exec(G);if(K&&K[1]!=="type")Z.add(K[1])}return[...Z].sort()}function uO($,Z={}){let J=DZ($),X=$.split(`
3919
+ `):"";let{imports:Q,body:G}=IK($),z=G.replace(/^[ \t]*export[ \t]+(?=(?:const|let|var|function|async|class)\b)/gm,""),K=["",`// ${IZ}`];if(Q)K.push(Q);return K.push(...Y),K.push(`async function ${TZ}() {`,z,` return { ${J.join(", ")} }`,"}",`type ${kZ} = Awaited<ReturnType<typeof ${TZ}>>`,...J.map((q)=>`declare var ${q}: ${kZ}[${JSON.stringify(q)}]`)),K.join(`
3920
+ `)}function kK($){let J=G0($).split(""),X=0;for(let Y=0;Y<J.length;Y++){let Q=J[Y];if(Q==="{"||Q==="("||Q==="["){X++;continue}if(Q==="}"||Q===")"||Q==="]"){X=Math.max(0,X-1);continue}if(X>0&&Q!==`
3921
+ `)J[Y]=" "}return B1(J.join(""))}function uO($,Z){if(PZ($)!==null)return[];let J=G0(Z),X=new Set(Q2);return kK($).filter((Y)=>{if(X.has(Y))return!1;if(B1(Z).includes(Y))return!1;return new RegExp(`(?<![.#\\w$])${Y}(?![\\w$])`).test(J)})}var IZ="stx: types for the declared client payload (#1868)",EK="stx: untyped bridge names \u2014 declare a defineClientPayload to check these (#1868)",TZ="__stxServerScope",kZ="__StxClientPayload";var EZ=["$env","$user","$slot","$slots","$attrs","$props","$page","$route","$loop","loop","$errors","$csrf","props","slot"];var yK=/^\s*[A-Z_$][\w$]*\s*=[^=]/i;function bK($){let Z=new Map,J=/!|===|!==|==|!=|&&|\|\||<|>|\btypeof\b|\binstanceof\b|\bin\b/;for(let X of $){let Y=G0(X),{depths:Q,balanced:G}=K2(Y);if(!G)continue;let z=/^([ \t]*(?:export[ \t]+)?const[ \t]+)([A-Za-z_$][\w$]*)[ \t]*(?::[^=\n]+)?=[ \t]*([^\n]+)$/gm;for(let K of Y.matchAll(z)){let q=K.index??0;if(Q[q+K[1].length]!==0)continue;let W=K[2],U=q+K[0].length-K[3].length,H=X.slice(U,q+K[0].length).trim().replace(/;$/,"").trim(),j=K[3],B=J.test(j)&&!/\bawait\b|=>|\bfunction\b|[{}]/.test(j)&&!/[,+\-*/%&|?:=]$/.test(H)&&K2(j).balanced;Z.set(W,Z.has(W)||!B?null:H)}}return new Map([...Z].filter((X)=>X[1]!==null))}function xZ($,Z,J=0,X=new Set){if(Z.size===0||J>=5)return $;let Y=G0($),Q="",G=0;for(let z of Y.matchAll(/[A-Za-z_$][\w$]*/g)){let K=z.index??0,q=z[0],W=Z.get(q);if(!W||X.has(q))continue;let U=Y.slice(0,K).trimEnd(),H=Y.slice(K+q.length).trimStart();if(U.endsWith(".")||/^:(?!:)/.test(H)&&/[{,]$/.test(U))continue;if(K>0&&/[\w$]/.test(Y[K-1]))continue;Q+=`${$.slice(G,K)}(${xZ(W,Z,J+1,new Set([...X,q]))})`,G=K+q.length}return Q+$.slice(G)}function SK($,Z){let J=/@(if|unless|elseif|else|endif|endunless)\b\s*(\()?/g,X=[],Y;while((Y=J.exec($))!==null){if(Y.index>Z)break;let Q=Y[1];if(Y.index===Z){if(Q==="elseif"){let z=X[X.length-1];if(z?.current)z.seen.push(z.current);if(z)z.current=null}break}if(Q==="endif"||Q==="endunless"){X.pop();continue}let G="";if(Y[2]==="("){let z=0,K=Y.index+Y[0].length-1,q=K+1;for(;K<$.length;K++){let W=$[K];if(W==="(")z++;else if(W===")"){if(z--,z===0)break}}G=$.slice(q,K).trim(),J.lastIndex=K+1}if(Q==="if")X.push({seen:[],current:G});else if(Q==="unless")X.push({seen:[],current:`!(${G})`});else if(Q==="elseif"||Q==="else"){let z=X[X.length-1];if(!z)continue;if(z.current)z.seen.push(z.current);z.current=Q==="elseif"?G:null}}return X.flatMap((Q)=>[...Q.seen.map((G)=>`!(${G})`),...Q.current?[Q.current]:[]]).filter(Boolean)}function CK($){let Z=$.code.trim();if(!Z)return null;if($.attribute?.startsWith("@")){if(yK.test(Z))return null;let X=";(($event: any): void => { ";return{text:`${X}${Z} });`,prefixLength:X.length}}let J=";void ((";return{text:`${J}${Z}));`,prefixLength:J.length}}var PK=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.{1,2}\/[^'"\n]*)\2/g;function yZ($,Z){if(!Z)return $;return $.replace(PK,(J,X,Y,Q)=>{let G=bZ.resolve(Z,Q).replace(/\\/g,"/");return`${X}${Y}${G}${Y}`})}function vK($){return" ".repeat(Math.max(0,($.startColumn??1)-1))}function xK($){let Z=new Set,J=G0($);for(let X of J.matchAll(/\bimport\s+(?:type\s+)?([\w$*{}\s,]+?)\s+from\b/g)){let Y=X[1],Q=/\{([^}]*)\}/.exec(Y);for(let q of Q?.[1].split(",")??[]){let W=q.trim().replace(/^type\s+/,"").split(/\s+as\s+/).pop()?.trim();if(W&&/^[A-Z_$][\w$]*$/i.test(W))Z.add(W)}let G=Y.replace(/\{[^}]*\}/,""),z=/\*\s*as\s+([A-Z_$][\w$]*)/i.exec(G);if(z)Z.add(z[1]);let K=/^\s*([A-Z_$][\w$]*)/i.exec(G);if(K&&K[1]!=="type")Z.add(K[1])}return[...Z].sort()}function mO($,Z={}){let J=DZ($),X=$.split(`
3848
3922
  `),Y=Array.from({length:X.length},()=>""),Q=new Map,G=Z.filePath&&Z.templateExpressions!==!1?wZ($,i9($),{filePath:Z.filePath,componentsDir:Z.componentsDir,projectRoot:Z.projectRoot,readComponent:Z.readComponent,scriptCode:(U,H)=>DZ(U).map((j)=>yZ(j.code,bZ.dirname(H))).join(`
3849
- `)}):void 0,z=new Set,K=[];for(let U of J){let H=OK(VK(U.code)),j=yZ(H,Z.originDir??"").split(`
3850
- `);j.forEach((B,V)=>{let _=U.startLine-1+V;if(_<Y.length)Y[_]=V===0?PK(U)+B:B,z.add(_)}),K.push(U.startLine-1+j.length-1)}for(let U of K){let H=Y[U]?.trim()===""?U:U+1;if(H<Y.length&&Y[H].trim()===""&&(H===U||!z.has(H)))Y[H]=";"}let q=(U,H)=>{for(let[j,B]of U.split(`
3851
- `).entries())if(Y.push(B),H)Q.set(Y.length,j===0?H:{...H,line:H.line+j,column:1,prefixLength:0})};if(Z.globals!==!1){q("");let U=new Set([...J.flatMap((V)=>B1(V.code)),...J.flatMap((V)=>vK(V.code))]),H=(V)=>{if(!U.has(V))q(`declare var ${V}: any`)};if(Z.runtimeGlobals!==!1){if(!U.has("window"))q("declare var window: any");for(let V of Q2)H(V)}let j=[...new Set([...H3,...H1,...EZ])].filter((V)=>Z.runtimeGlobals!==!1||!Q2.includes(V));if(Z.contextScope==="global"){q("declare global {");for(let V of j)q(` var ${V}: any`);q("}")}else{for(let V of H3)H(V);for(let V of H1)H(V);for(let V of EZ)H(V)}q(`declare var ${U3}: any`);let B=new Set(J.flatMap((V)=>B1(V.code)));q(`type ${NZ}<T> = T extends readonly (infer E)[] ? E : T extends Iterable<infer E2> ? E2 : any`);for(let V of DK($)){if(B.has(V.name))continue;let _=V.iterable&&B.has(V.iterable)?`${NZ}<typeof ${V.iterable}>`:"any";q(`declare var ${V.name}: ${_}`)}}if(Z.templateExpressions!==!1){if(G?.declarations)for(let H of G.declarations.split(`
3852
- `))q(H);let U=FK($).map((H)=>{let j=G?.events.get(H.offset??-1);if(j){H.anchor=!0;let B=H.code.trim(),V=/^([\w$]+)\s*=\s*([^=][\s\S]*)$/.exec(B),_=V?`void ((${V[2]}) satisfies __StxAssignedValue<typeof ${V[1]}>)`:/^[\w$]+(?:\.[\w$]+)*$/.test(B)?`${B} satisfies (($event: ${j}) => unknown)`:B,L=`;(($event: ${j}): void => { `;return{expression:H,statement:{text:`${L}${_} });`,prefixLength:L.length}}}return{expression:H,statement:SK(H)}}).filter((H)=>H.statement!==null);if(U.push(...G?.checks||[]),U.length>0){let H=i9($),j=yK(J.map((L)=>L.code)),V=[...new Set(J.flatMap((L)=>B1(L.code)))].filter((L)=>/^[A-Z_$][\w$]*$/i.test(L)),_=0;if(V.length>0){q(BK);for(let L of V)q(`type __StxT_${L} = ${CZ}<typeof ${L}>`);q(`;((${V.map((L)=>`${L}: __StxT_${L}`).join(", ")}) => {`),_=1}for(let{expression:L,statement:F}of U){let O=" ".repeat(_),w=L.offset===void 0?[]:bK(H,L.offset),R=w.length>0?`${w.map((N)=>`if (${xZ(N,j)}) `).join("")}{ `:"",D=w.length>0?" }":"";q(O+R+F.text+D,{line:L.line,column:L.column,expression:L,prefixLength:F.prefixLength+O.length+R.length,guardPrefixLength:O.length+R.length})}if(_>0)q("});")}}let W=!1;if(Z.reference&&Y[0]!==void 0&&Y[0].trim()==="")Y[0]=`/// <reference path=${JSON.stringify(Z.reference.replace(/\\/g,"/"))} />`,W=!0;return q("export {}"),{text:Y.join(`
3853
- `),lineMap:Q,sourceLineCount:X.length,componentDependencies:G?.dependencies,referenced:W}}function mO($,Z){if(!$.expression)return!1;return $.inGuard===!0||Z===2774}function dO($,Z,J){let X=$.lineMap.get(Z);if(!X)return Z<=$.sourceLineCount?{line:Z,column:J}:null;let Y=X.expression?.anchor?0:Math.max(0,J-1-(X.prefixLength??0));return{line:X.line,column:X.column+Y,expression:X.expression,inGuard:J<=(X.guardPrefixLength??0)}}var xK=[{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"}],fK=[{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')"}],gK=[{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 hK($){let Z=[],J=[];return uK($,Z),mK($,Z,J),dK($,J),lK($,Z),{valid:Z.length===0,errors:Z,warnings:J}}function uK($,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 mK($,Z,J){for(let X of xK){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 K=new RegExp(X.altClose,"g");z+=($.match(K)||[]).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 dK($,Z){for(let J of fK)if(J.pattern.test($))Z.push({type:"syntax",message:J.message,suggestion:J.suggestion})}function lK($,Z){for(let J of gK)if(J.pattern.test($))Z.push({type:"expression",message:`Security warning: ${J.message}`,suggestion:"Remove dangerous code from template expressions"})}function cK($,Z){let J=$.slice(0,Z).split(`
3854
- `);return{line:J.length,column:J[J.length-1].length+1}}function pK($,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 iK($){return/@[a-z]+/i.test($)||/\{\{/.test($)}function nK($){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 G2 from"process";var j3=["module","exports","require","props","$props","$bool","$num","defineProps","withDefaults","defineClientPayload","useServerData","useRuntimeConfig","useServerRuntimeConfig","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"];var fZ=new Set(j3),sK=new Set(["props","$props","defineProps"]),oK=new Set(["stx","@stacksjs/stx"]),gZ=b1(128),hZ=b1(64);function rK($){let Z=[],J=0,X=$.split(`
3855
- `);for(let Y of X){let Q=J,G=null,z=!1;for(let K=0;K<Y.length;K++){let q=Y[K];if(z){z=!1;continue}if(q==="\\"){z=!0;continue}if(G){if(q===G)G=null;continue}if(q==="'"||q==='"'||q==="`"){G=q;continue}if(q==="/"&&K+1<Y.length&&Y[K+1]==="/")break;if(q==="{")J++;else if(q==="}")J--}if(Q===0){let K=Y.match(/(?:const|let|var)\s+(\w+)\s*=/);if(K)Z.push(K[1]);else if(/^\s*(?:const|let|var)\s+\w+\s*;?\s*$/.test(Y)){let q=Y.match(/(?:const|let|var)\s+(\w+)/);if(q)Z.push(q[1])}else{let q=Y.match(/(?:const|let|var)\s+(\{[^}]+\}|\[[^\]]+\])\s*=/);if(q){let U=q[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(...U)}}}}return[...new Set(Z)]}function aK($){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,K=null;for(let q=0;q<X.length;q++){let W=X[q];if(K){if(Q+=W,W===K)K=null;continue}if(W==='"'||W==="'"||W==="`"){K=W,Q+=W;continue}if(W==="<")G++;else if(W===">"&&G>0)G--;else if(W==="(")z++;else if(W===")")z--;if(W===","&&G===0&&z===0){Y.push(Q),Q="";continue}Q+=W}if(Q)Y.push(Q);return Y.map((q)=>{let W=q.trim(),U=W.startsWith("..."),H=U?W.slice(3):W,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 q;let _=H.substring(0,j).trim().replace(/\?$/,""),L=H.substring(j+1),F=-1,O=0;for(let R=0;R<L.length;R++)if(L[R]==="<")O++;else if(L[R]===">")O--;else if(L[R]==="="&&O===0){F=R;break}let w=U?"...":"";if(F!==-1)return`${w}${_} = ${L.substring(F+1).trim()}`;return`${w}${_}`}).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,K=G+1,q=0,W=null;while(K<Z.length&&z>0){let j=Z[K];if(W){if(j===W)W=null;K++;continue}if(j==='"'||j==="'"||j==="`"){W=j,K++;continue}if(j==="<")q++;else if(j===">"&&q>0)q--;else if(q===0){if(j==="(")z++;else if(j===")")z--}if(z>0)K++}if(z!==0)continue;let U=Z.substring(G+1,K);if(!U.includes(":"))continue;let H=J(U);Q.push({start:G+1,end:K,replacement:H})}for(let G=Q.length-1;G>=0;G--){let{start:z,end:K,replacement:q}=Q[G];Z=Z.substring(0,z)+q+Z.substring(K)}}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,...K]=G.split("="),q=z.split(":")[0].trim();if(K.length>0)return`${q} = ${K.join("=").trim()}`;return q}).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,`
3856
-
3857
- `),Z}function tK($){return $.replace(/\s*imported from \S*(?:[/\\]packages[/\\]stx[/\\]|@stacksjs[/\\]stx[/\\])\S*/g,"")}function eK($){return/cannot find module|cannot find package|could not resolve|module not found|failed to resolve/i.test($)}function $q($){if($ instanceof SyntaxError)return!0;let Z=$ instanceof Error?$.message:String($);return/SyntaxError|Unexpected (token|identifier|string|number|keyword|end of)|Unterminated|Expected .+ but found/i.test(Z)}function Zq($){if(!/is not defined|can't find variable/i.test($))return!1;return!/\b(document|window|navigator|localStorage|sessionStorage|self)\b/.test($)}var uZ=new Set;async function Jq($,Z,J,X={}){if(!$.trim())return;let Y=X2(),Q=j1($,JSON.stringify(Y)),G=gZ.get(Q);if(G===void 0){try{let S=V3({loader:"ts",target:"browser",define:Y}),v=$.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");v=v.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,""),G=S.transformSync(v)}catch{G=aK($)}gZ.set(Q,G)}let z={exports:{}},K=z.exports,q=G2.cwd(),W={},U=[...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 U)try{if(S.startsWith(".")){W[S]=await import(s0.resolve(s0.dirname(J),S));continue}let v=s0.resolve(q,"node_modules",S),d=s0.join(v,"package.json"),e=JSON.parse(x("fs").readFileSync(d,"utf8")),z0=e.main||"index.js";if(e.exports){let k0=typeof e.exports==="string"?e.exports:e.exports["."];if(typeof k0==="string")z0=k0;else if(k0?.bun)z0=k0.bun;else if(k0?.import)z0=k0.import;else if(k0?.default)z0=k0.default}W[S]=await import(s0.resolve(v,z0))}catch(v){if(S.startsWith("."))H.set(S,v instanceof Error?v.message:String(v))}let j=(S)=>{if(W[S])return W[S];let v=H.get(S);if(v!==void 0)throw Error(`Cannot require '${S}' from ${J}: ${v}`);return x(S)},B=Z.props||{},V=(S)=>{if(!S)return B;let v={};for(let[d,e]of Object.entries(S)){let z0=B[d];if(z0!==void 0)v[d]=z0;else if(typeof e==="function")v[d]=e();else v[d]=e}return v};for(let[S,v]of Object.entries(B))Object.defineProperty(V,S,{value:v,enumerable:!0,configurable:!0,writable:!0});let _=(S,v=!1)=>{if(S===void 0||S===null)return v;if(typeof S==="string"){let d=S.trim().toLowerCase();if(d===""||d==="true"||d==="1"||d==="on"||d==="yes")return!0;if(d==="false"||d==="0"||d==="off"||d==="no")return!1;return!0}return Boolean(S)},L=(S,v=0)=>{if(S===void 0||S===null)return v;if(typeof S==="string"){let e=S.trim();if(e==="")return v;let z0=Number(e);return Number.isFinite(z0)?z0:v}let d=Number(S);return Number.isFinite(d)?d:v};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 v={...B};for(let[d,e]of Object.entries(S)){let z0=e&&typeof e==="object"&&!Array.isArray(e)?e:{type:e};if(v[d]===void 0&&z0.default!==void 0)v[d]=typeof z0.default==="function"?z0.default():z0.default}return v},O=()=>Z.slots||{},w=(S,v)=>{let d={...S};for(let[e,z0]of Object.entries(v))if(d[e]===void 0)if(typeof z0==="function")d[e]=z0();else d[e]=z0;return d},R=(S)=>{let v=()=>S;return v.set=(d)=>{},v.update=(d)=>{},v},D=(S)=>{let v,d=!1;return()=>{if(!d)try{v=S(),d=!0}catch{v=void 0}return v}},N=(S)=>{},I=(S)=>S(),M=(S)=>{},T=(S)=>{},k=_4(Z);function A(S){let v=S||{};if(v.title!==void 0||v.description!==void 0)P({title:v.title,description:v.description})}function E(S){if(!S||typeof S!=="object")return;let v=Z.__stxClientPayload??{};Object.assign(v,S),Z.__stxClientPayload=v}let C=()=>{let S=Z.__stxServeContext,v=Z.__stxServeSearch??S?.search??"",d=S?.path??"",e=Object.fromEntries(new URLSearchParams(v)),z0=Z.query,k0=Object.keys(e).length>0?e:z0??{},a0=v||(Object.keys(k0).length>0?`?${new URLSearchParams(k0).toString()}`:"");return{params:Z.params??{},query:k0,path:d,name:"",fullPath:d+a0,hash:"",matched:[]}},b=()=>({push:(S)=>{},replace:(S)=>{},back:()=>{},forward:()=>{},go:(S)=>{}}),y=(S)=>{let v=Z.__stx_runtime_head||{};Z.__stx_runtime_head=aZ(v,S||{})},P=(S)=>{y(tZ(S||{}))},u=(S)=>({value:S}),p=(S)=>S,m=(S)=>({value:typeof S==="function"?S():S}),X0=(S,v)=>{},r=(S)=>{},J0=(S)=>{},i=(S)=>S?S():Promise.resolve(),q0=(S)=>(v,...d)=>{},a=(S)=>{},V0=(S,v)=>{},o0=(S,v)=>v,u0=()=>({value:"light"}),r0=()=>R(!1),g=(S)=>R(!1),l=()=>R(!1),t=()=>g("(prefers-color-scheme: dark)"),T0=()=>g("(prefers-color-scheme: light)"),W0=()=>g("(prefers-reduced-motion: reduce)"),x0=()=>g("(prefers-contrast: more)"),j0={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:{}},a9=new Proxy(j0,{get(S,v){if(v in S)return S[v];return},set(S,v,d){return S[v]=d,!0}}),t9={getElementById:()=>null,querySelector:()=>null,querySelectorAll:()=>[],createElement:()=>({}),createTextNode:()=>({}),body:{},head:{},documentElement:{},addEventListener:()=>{},removeEventListener:()=>{}},e9=console;try{let S=eZ(G,J),v=new Set(Object.keys(B)),d=Object.keys(Z).filter((n)=>!v.has(n)&&!sK.has(n)&&z2(n)),e=d.map((n)=>Z[n]);if(!d.includes("__stxServeContext"))d.push("__stxServeContext"),e.push(void 0);let z0=new Set(["async","module","exports","require","params","window","document","console","state","derived","effect"]),k0=[],a0=[];for(let[n,m0]of Object.entries(B)){if(!z2(n))continue;if(z0.has(n))continue;if(new RegExp(`(?:^|[\\s;{])(?:const|let|var|function)\\s+${n}\\b`).test(S))continue;k0.push(n),a0.push(m0)}let J1=rK(S).map((n)=>`module.exports.${n} = typeof ${n} !== 'undefined' ? ${n} : module.exports.${n};`).join(`
3923
+ `)}):void 0,z=new Set,K=[];for(let U of J){let H=FK(LK(U.code)),j=yZ(H,Z.originDir??"").split(`
3924
+ `);j.forEach((B,V)=>{let _=U.startLine-1+V;if(_<Y.length)Y[_]=V===0?vK(U)+B:B,z.add(_)}),K.push(U.startLine-1+j.length-1)}for(let U of K){let H=Y[U]?.trim()===""?U:U+1;if(H<Y.length&&Y[H].trim()===""&&(H===U||!z.has(H)))Y[H]=";"}let q=(U,H)=>{for(let[j,B]of U.split(`
3925
+ `).entries())if(Y.push(B),H)Q.set(Y.length,j===0?H:{...H,line:H.line+j,column:1,prefixLength:0})};if(Z.globals!==!1){q("");let U=new Set([...J.flatMap((V)=>B1(V.code)),...J.flatMap((V)=>xK(V.code))]),H=(V)=>{if(!U.has(V))q(`declare var ${V}: any`)};if(Z.runtimeGlobals!==!1){if(!U.has("window"))q("declare var window: any");for(let V of Q2)H(V)}let j=[...new Set([...H3,...H1,...EZ])].filter((V)=>Z.runtimeGlobals!==!1||!Q2.includes(V));if(Z.contextScope==="global"){q("declare global {");for(let V of j)q(` var ${V}: any`);q("}")}else{for(let V of H3)H(V);for(let V of H1)H(V);for(let V of EZ)H(V)}q(`declare var ${U3}: any`);let B=new Set(J.flatMap((V)=>B1(V.code)));q(`type ${NZ}<T> = T extends readonly (infer E)[] ? E : T extends Iterable<infer E2> ? E2 : any`);for(let V of NK($)){if(B.has(V.name))continue;let _=V.iterable&&B.has(V.iterable)?`${NZ}<typeof ${V.iterable}>`:"any";q(`declare var ${V.name}: ${_}`)}}if(Z.templateExpressions!==!1){if(G?.declarations)for(let H of G.declarations.split(`
3926
+ `))q(H);let U=wK($).map((H)=>{let j=G?.events.get(H.offset??-1);if(j){H.anchor=!0;let B=H.code.trim(),V=/^([\w$]+)\s*=\s*([^=][\s\S]*)$/.exec(B),_=V?`void ((${V[2]}) satisfies __StxAssignedValue<typeof ${V[1]}>)`:/^[\w$]+(?:\.[\w$]+)*$/.test(B)?`${B} satisfies (($event: ${j}) => unknown)`:B,L=`;(($event: ${j}): void => { `;return{expression:H,statement:{text:`${L}${_} });`,prefixLength:L.length}}}return{expression:H,statement:CK(H)}}).filter((H)=>H.statement!==null);if(U.push(...G?.checks||[]),U.length>0){let H=i9($),j=bK(J.map((L)=>L.code)),V=[...new Set(J.flatMap((L)=>B1(L.code)))].filter((L)=>/^[A-Z_$][\w$]*$/i.test(L)),_=0;if(V.length>0){q(VK);for(let L of V)q(`type __StxT_${L} = ${CZ}<typeof ${L}>`);q(`;((${V.map((L)=>`${L}: __StxT_${L}`).join(", ")}) => {`),_=1}for(let{expression:L,statement:F}of U){let O=" ".repeat(_),w=L.offset===void 0?[]:SK(H,L.offset),R=w.length>0?`${w.map((N)=>`if (${xZ(N,j)}) `).join("")}{ `:"",D=w.length>0?" }":"";q(O+R+F.text+D,{line:L.line,column:L.column,expression:L,prefixLength:F.prefixLength+O.length+R.length,guardPrefixLength:O.length+R.length})}if(_>0)q("});")}}let W=!1;if(Z.reference&&Y[0]!==void 0&&Y[0].trim()==="")Y[0]=`/// <reference path=${JSON.stringify(Z.reference.replace(/\\/g,"/"))} />`,W=!0;return q("export {}"),{text:Y.join(`
3927
+ `),lineMap:Q,sourceLineCount:X.length,componentDependencies:G?.dependencies,referenced:W}}function dO($,Z){if(!$.expression)return!1;return $.inGuard===!0||Z===2774}function lO($,Z,J){let X=$.lineMap.get(Z);if(!X)return Z<=$.sourceLineCount?{line:Z,column:J}:null;let Y=X.expression?.anchor?0:Math.max(0,J-1-(X.prefixLength??0));return{line:X.line,column:X.column+Y,expression:X.expression,inGuard:J<=(X.guardPrefixLength??0)}}var fK=[{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"}],gK=[{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')"}],hK=[{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 uK($){let Z=[],J=[];return mK($,Z),dK($,Z,J),lK($,J),cK($,Z),{valid:Z.length===0,errors:Z,warnings:J}}function mK($,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 dK($,Z,J){for(let X of fK){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 K=new RegExp(X.altClose,"g");z+=($.match(K)||[]).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 lK($,Z){for(let J of gK)if(J.pattern.test($))Z.push({type:"syntax",message:J.message,suggestion:J.suggestion})}function cK($,Z){for(let J of hK)if(J.pattern.test($))Z.push({type:"expression",message:`Security warning: ${J.message}`,suggestion:"Remove dangerous code from template expressions"})}function pK($,Z){let J=$.slice(0,Z).split(`
3928
+ `);return{line:J.length,column:J[J.length-1].length+1}}function iK($,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 nK($){return/@[a-z]+/i.test($)||/\{\{/.test($)}function sK($){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 G2 from"process";var j3=["module","exports","require","props","$props","$bool","$num","defineProps","withDefaults","defineClientPayload","useServerData","useRuntimeConfig","useServerRuntimeConfig","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"];var fZ=new Set(j3),oK=new Set(["props","$props","defineProps"]),rK=new Set(["stx","@stacksjs/stx"]),gZ=b1(128),hZ=b1(64);function aK($){let Z=[],J=0,X=$.split(`
3929
+ `);for(let Y of X){let Q=J,G=null,z=!1;for(let K=0;K<Y.length;K++){let q=Y[K];if(z){z=!1;continue}if(q==="\\"){z=!0;continue}if(G){if(q===G)G=null;continue}if(q==="'"||q==='"'||q==="`"){G=q;continue}if(q==="/"&&K+1<Y.length&&Y[K+1]==="/")break;if(q==="{")J++;else if(q==="}")J--}if(Q===0){let K=Y.match(/(?:const|let|var)\s+(\w+)\s*=/);if(K)Z.push(K[1]);else if(/^\s*(?:const|let|var)\s+\w+\s*;?\s*$/.test(Y)){let q=Y.match(/(?:const|let|var)\s+(\w+)/);if(q)Z.push(q[1])}else{let q=Y.match(/(?:const|let|var)\s+(\{[^}]+\}|\[[^\]]+\])\s*=/);if(q){let U=q[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(...U)}}}}return[...new Set(Z)]}function tK($){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,K=null;for(let q=0;q<X.length;q++){let W=X[q];if(K){if(Q+=W,W===K)K=null;continue}if(W==='"'||W==="'"||W==="`"){K=W,Q+=W;continue}if(W==="<")G++;else if(W===">"&&G>0)G--;else if(W==="(")z++;else if(W===")")z--;if(W===","&&G===0&&z===0){Y.push(Q),Q="";continue}Q+=W}if(Q)Y.push(Q);return Y.map((q)=>{let W=q.trim(),U=W.startsWith("..."),H=U?W.slice(3):W,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 q;let _=H.substring(0,j).trim().replace(/\?$/,""),L=H.substring(j+1),F=-1,O=0;for(let R=0;R<L.length;R++)if(L[R]==="<")O++;else if(L[R]===">")O--;else if(L[R]==="="&&O===0){F=R;break}let w=U?"...":"";if(F!==-1)return`${w}${_} = ${L.substring(F+1).trim()}`;return`${w}${_}`}).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,K=G+1,q=0,W=null;while(K<Z.length&&z>0){let j=Z[K];if(W){if(j===W)W=null;K++;continue}if(j==='"'||j==="'"||j==="`"){W=j,K++;continue}if(j==="<")q++;else if(j===">"&&q>0)q--;else if(q===0){if(j==="(")z++;else if(j===")")z--}if(z>0)K++}if(z!==0)continue;let U=Z.substring(G+1,K);if(!U.includes(":"))continue;let H=J(U);Q.push({start:G+1,end:K,replacement:H})}for(let G=Q.length-1;G>=0;G--){let{start:z,end:K,replacement:q}=Q[G];Z=Z.substring(0,z)+q+Z.substring(K)}}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,...K]=G.split("="),q=z.split(":")[0].trim();if(K.length>0)return`${q} = ${K.join("=").trim()}`;return q}).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,`
3930
+
3931
+ `),Z}function eK($){return $.replace(/\s*imported from \S*(?:[/\\]packages[/\\]stx[/\\]|@stacksjs[/\\]stx[/\\])\S*/g,"")}function $q($){return/cannot find module|cannot find package|could not resolve|module not found|failed to resolve/i.test($)}function Zq($){if($ instanceof SyntaxError)return!0;let Z=$ instanceof Error?$.message:String($);return/SyntaxError|Unexpected (token|identifier|string|number|keyword|end of)|Unterminated|Expected .+ but found/i.test(Z)}function Jq($){if(!/is not defined|can't find variable/i.test($))return!1;return!/\b(document|window|navigator|localStorage|sessionStorage|self)\b/.test($)}var uZ=new Set;async function Xq($,Z,J,X={}){if(!$.trim())return;let Y=X2(),Q=j1($,JSON.stringify(Y)),G=gZ.get(Q);if(G===void 0){try{let S=V3({loader:"ts",target:"browser",define:Y}),v=$.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");v=v.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,""),G=S.transformSync(v)}catch{G=tK($)}gZ.set(Q,G)}let z={exports:{}},K=z.exports,q=G2.cwd(),W={},U=[...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 U)try{if(S.startsWith(".")){W[S]=await import(s0.resolve(s0.dirname(J),S));continue}let v=s0.resolve(q,"node_modules",S),d=s0.join(v,"package.json"),e=JSON.parse(x("fs").readFileSync(d,"utf8")),z0=e.main||"index.js";if(e.exports){let k0=typeof e.exports==="string"?e.exports:e.exports["."];if(typeof k0==="string")z0=k0;else if(k0?.bun)z0=k0.bun;else if(k0?.import)z0=k0.import;else if(k0?.default)z0=k0.default}W[S]=await import(s0.resolve(v,z0))}catch(v){if(S.startsWith("."))H.set(S,v instanceof Error?v.message:String(v))}let j=(S)=>{if(W[S])return W[S];let v=H.get(S);if(v!==void 0)throw Error(`Cannot require '${S}' from ${J}: ${v}`);return x(S)},B=Z.props||{},V=(S)=>{if(!S)return B;let v={};for(let[d,e]of Object.entries(S)){let z0=B[d];if(z0!==void 0)v[d]=z0;else if(typeof e==="function")v[d]=e();else v[d]=e}return v};for(let[S,v]of Object.entries(B))Object.defineProperty(V,S,{value:v,enumerable:!0,configurable:!0,writable:!0});let _=(S,v=!1)=>{if(S===void 0||S===null)return v;if(typeof S==="string"){let d=S.trim().toLowerCase();if(d===""||d==="true"||d==="1"||d==="on"||d==="yes")return!0;if(d==="false"||d==="0"||d==="off"||d==="no")return!1;return!0}return Boolean(S)},L=(S,v=0)=>{if(S===void 0||S===null)return v;if(typeof S==="string"){let e=S.trim();if(e==="")return v;let z0=Number(e);return Number.isFinite(z0)?z0:v}let d=Number(S);return Number.isFinite(d)?d:v};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 v={...B};for(let[d,e]of Object.entries(S)){let z0=e&&typeof e==="object"&&!Array.isArray(e)?e:{type:e};if(v[d]===void 0&&z0.default!==void 0)v[d]=typeof z0.default==="function"?z0.default():z0.default}return v},O=()=>Z.slots||{},w=(S,v)=>{let d={...S};for(let[e,z0]of Object.entries(v))if(d[e]===void 0)if(typeof z0==="function")d[e]=z0();else d[e]=z0;return d},R=(S)=>{let v=()=>S;return v.set=(d)=>{},v.update=(d)=>{},v},D=(S)=>{let v,d=!1;return()=>{if(!d)try{v=S(),d=!0}catch{v=void 0}return v}},N=(S)=>{},I=(S)=>S(),M=(S)=>{},T=(S)=>{},k=_4(Z);function A(S){let v=S||{};if(v.title!==void 0||v.description!==void 0)P({title:v.title,description:v.description})}function E(S){if(!S||typeof S!=="object")return;let v=Z.__stxClientPayload??{};Object.assign(v,S),Z.__stxClientPayload=v}let C=()=>{let S=Z.__stxServeContext,v=Z.__stxServeSearch??S?.search??"",d=S?.path??"",e=Object.fromEntries(new URLSearchParams(v)),z0=Z.query,k0=Object.keys(e).length>0?e:z0??{},a0=v||(Object.keys(k0).length>0?`?${new URLSearchParams(k0).toString()}`:"");return{params:Z.params??{},query:k0,path:d,name:"",fullPath:d+a0,hash:"",matched:[]}},b=()=>({push:(S)=>{},replace:(S)=>{},back:()=>{},forward:()=>{},go:(S)=>{}}),y=(S)=>{let v=Z.__stx_runtime_head||{};Z.__stx_runtime_head=aZ(v,S||{})},P=(S)=>{y(tZ(S||{}))},u=(S)=>({value:S}),p=(S)=>S,m=(S)=>({value:typeof S==="function"?S():S}),X0=(S,v)=>{},r=(S)=>{},J0=(S)=>{},i=(S)=>S?S():Promise.resolve(),q0=(S)=>(v,...d)=>{},a=(S)=>{},V0=(S,v)=>{},o0=(S,v)=>v,u0=()=>({value:"light"}),r0=()=>R(!1),g=(S)=>R(!1),l=()=>R(!1),t=()=>g("(prefers-color-scheme: dark)"),T0=()=>g("(prefers-color-scheme: light)"),W0=()=>g("(prefers-reduced-motion: reduce)"),x0=()=>g("(prefers-contrast: more)"),j0={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:{}},a9=new Proxy(j0,{get(S,v){if(v in S)return S[v];return},set(S,v,d){return S[v]=d,!0}}),t9={getElementById:()=>null,querySelector:()=>null,querySelectorAll:()=>[],createElement:()=>({}),createTextNode:()=>({}),body:{},head:{},documentElement:{},addEventListener:()=>{},removeEventListener:()=>{}},e9=console;try{let S=eZ(G,J),v=new Set(Object.keys(B)),d=Object.keys(Z).filter((n)=>!v.has(n)&&!oK.has(n)&&z2(n)),e=d.map((n)=>Z[n]);if(!d.includes("__stxServeContext"))d.push("__stxServeContext"),e.push(void 0);let z0=new Set(["async","module","exports","require","params","window","document","console","state","derived","effect"]),k0=[],a0=[];for(let[n,m0]of Object.entries(B)){if(!z2(n))continue;if(z0.has(n))continue;if(new RegExp(`(?:^|[\\s;{])(?:const|let|var|function)\\s+${n}\\b`).test(S))continue;k0.push(n),a0.push(m0)}let J1=aK(S).map((n)=>`module.exports.${n} = typeof ${n} !== 'undefined' ? ${n} : module.exports.${n};`).join(`
3858
3932
  `),y0=Z.params??{},h=[],c=[];for(let n=0;n<d.length;n++){if(d[n]==="params")continue;h.push(d[n]),c.push(e[n])}let Y0=[...j3,...k0,...h],o=`return (async () => {
3859
3933
  ${S}
3860
3934
  ${J1}
3861
3935
  return module.exports
3862
- })()`,F0=j1(o,Y0.join("\x00")),U0=hZ.get(F0);if(!U0)U0=Function(...Y0,o),hZ.set(F0,U0);let P0=Z.__stx_options?.runtimeConfig;if(P0||/\buse(?:Server)?RuntimeConfig\b/.test(G))await p9(Z,J,P0);let X1=await iZ(Z.__stx_runtime_config??nZ()??rZ(),()=>a6(Z,()=>U0(z,K,j,B,V,_,L,F,w,E,t6,oZ,sZ,R,D,N,I,M,T,A,C,b,y,P,k.setResponseStatus,k.setResponseHeader,k.notFound,u,p,m,X0,r,J0,i,q0,a,O,V0,o0,u0,r0,g,l,t,T0,W0,x0,a9,t9,e9,j0.confirm,j0.alert,j0.fetch,y0,...a0,...c)));if(X.preserveExisting){for(let[n,m0]of Object.entries(X1))if(!(n in Z)||Z[n]===void 0)Z[n]=m0}else Object.assign(Z,X1);for(let[n,m0]of Object.entries(B))if(!(n in Z))Z[n]=m0}catch(S){if(Z.__stx_strict_hydration)throw S;let v=tK(S instanceof Error?S.message:String(S));if(eK(v))console.warn(`[stx] server <script> in ${J??"<unknown>"} imports a module that does not resolve, so every variable in that script is undefined. Cause: ${v}`),X.onFailure?.({kind:"module-resolution",message:v,error:S});else if($q(S))console.warn(`[stx] server <script> in ${J??"<unknown>"} does not parse, so every variable in that script is undefined. Cause: ${v}`),X.onFailure?.({kind:"syntax",message:v,error:S});else if(Zq(v))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: ${v}`),X.onFailure?.({kind:"missing-binding",message:v,error:S});else{let d=`${J??"<unknown>"}\x00${v}`;if(G2.env.STX_DEBUG||!uZ.has(d))uZ.add(d),console.warn(`[stx] server <script> in ${J??"<unknown>"} threw, so every variable in that script is undefined and anything that reads one renders empty. Cause: ${v}`);X.onFailure?.({kind:"unknown",message:v,error:S})}try{await Wq(G,Z,J)}catch(d){if(G2.env.STX_DEBUG){let e=d instanceof Error?d.message:String(d);console.warn(`[stx] fallback extraction also failed in ${J??"<unknown>"}: ${e}`)}}}}function Xq($){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 Yq=/^(?:export\s+)?(?:const|let|var)\s+[A-Za-z_$][\w$]*(?:\s*,\s*[A-Za-z_$][\w$]*)*\s*;?$/;function eZ($,Z){let J=Z?s0.dirname(Z):G2.cwd(),X=G2.cwd(),Y=$.split(`
3936
+ })()`,F0=j1(o,Y0.join("\x00")),U0=hZ.get(F0);if(!U0)U0=Function(...Y0,o),hZ.set(F0,U0);let P0=Z.__stx_options?.runtimeConfig;if(P0||/\buse(?:Server)?RuntimeConfig\b/.test(G))await p9(Z,J,P0);let X1=await iZ(Z.__stx_runtime_config??nZ()??rZ(),()=>a6(Z,()=>U0(z,K,j,B,V,_,L,F,w,E,t6,oZ,sZ,R,D,N,I,M,T,A,C,b,y,P,k.setResponseStatus,k.setResponseHeader,k.notFound,u,p,m,X0,r,J0,i,q0,a,O,V0,o0,u0,r0,g,l,t,T0,W0,x0,a9,t9,e9,j0.confirm,j0.alert,j0.fetch,y0,...a0,...c)));if(X.preserveExisting){for(let[n,m0]of Object.entries(X1))if(!(n in Z)||Z[n]===void 0)Z[n]=m0}else Object.assign(Z,X1);for(let[n,m0]of Object.entries(B))if(!(n in Z))Z[n]=m0}catch(S){if(Z.__stx_strict_hydration)throw S;let v=eK(S instanceof Error?S.message:String(S));if($q(v))console.warn(`[stx] server <script> in ${J??"<unknown>"} imports a module that does not resolve, so every variable in that script is undefined. Cause: ${v}`),X.onFailure?.({kind:"module-resolution",message:v,error:S});else if(Zq(S))console.warn(`[stx] server <script> in ${J??"<unknown>"} does not parse, so every variable in that script is undefined. Cause: ${v}`),X.onFailure?.({kind:"syntax",message:v,error:S});else if(Jq(v))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: ${v}`),X.onFailure?.({kind:"missing-binding",message:v,error:S});else{let d=`${J??"<unknown>"}\x00${v}`;if(G2.env.STX_DEBUG||!uZ.has(d))uZ.add(d),console.warn(`[stx] server <script> in ${J??"<unknown>"} threw, so every variable in that script is undefined and anything that reads one renders empty. Cause: ${v}`);X.onFailure?.({kind:"unknown",message:v,error:S})}try{await Uq(G,Z,J)}catch(d){if(G2.env.STX_DEBUG){let e=d instanceof Error?d.message:String(d);console.warn(`[stx] fallback extraction also failed in ${J??"<unknown>"}: ${e}`)}}}}function Yq($){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 Qq=/^(?:export\s+)?(?:const|let|var)\s+[A-Za-z_$][\w$]*(?:\s*,\s*[A-Za-z_$][\w$]*)*\s*;?$/;function eZ($,Z){let J=Z?s0.dirname(Z):G2.cwd(),X=G2.cwd(),Y=$.split(`
3863
3937
  `),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 K=0;for(;G<Y.length;G++){for(let q of Y[G])if(q==="{")K++;else if(q==="}")K--;if(K<=0)break}}G++;continue}if(z.startsWith("definePageMeta(")){let K=0,q=!1,W=G;for(let j=G;j<Y.length&&!q;j++){let B=null,V=!1,_=Y[j];for(let L=0;L<_.length;L++){let F=_[L];if(V){V=!1;continue}if(F==="\\"){V=!0;continue}if(B){if(F===B)B=null;continue}if(F==='"'||F==="'"||F==="`"){B=F;continue}if(F==="(")K++;else if(F===")"){if(K--,K===0){G=j+1,q=!0;break}}}}if(!q)G=Y.length;let U=Y.slice(W,G).join(`
3864
- `),H=[];for(let j of["title","description"]){let B=new RegExp(`\\b${j}\\s*:\\s*(['"\`])((?:\\\\.|(?!\\1)[^\\\\])*)\\1`).exec(U);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 K=z,q=0;while(!Xq(K)&&G+q+1<Y.length)q++,K=`${K} ${Y[G+q].trim()}`;G+=q;let W=K.match(/^import\s+(\w+)\s+from\s+['"](.+?)['"]/),U=K.match(/^import\s+\{([^}]*)\}\s+from\s+['"](.+?)['"]/),H=K.match(/^import\s+['"](.+?)['"]/),j=K,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(W){let[,V,_]=W,L=B(_);Q.push(`const ${V} = (await import('${L}')).default`),Q.push(`module.exports.${V} = ${V};`)}else if(U){let[,V,_]=U,L=B(_),F=[],O=[],w=oK.has(_);for(let R of V.split(",")){let D=R.trim();if(!D)continue;let N=D.split(/\s+as\s+/);if(N.length===2){let[I,M]=[N[0].trim(),N[1].trim()];if(w&&fZ.has(I)){Q.push(`const ${M} = ${I};`);continue}F.push(`${I}: ${M}`),O.push(M)}else{if(w&&fZ.has(D))continue;F.push(D),O.push(D)}}if(F.length>0)Q.push(`const { ${F.join(", ")} } = await import('${L}')`);for(let R of O)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(Yq.test(z))Q.push(Y[G]),G++;else if(z.startsWith("export const ")||z.startsWith("export let ")||z.startsWith("export var ")){let K=dZ(Y,G),{type:q,name:W,value:U}=K;Q.push(`${q} ${W} = ${U};`),Q.push(`module.exports.${W} = ${W};`),G=K.nextIndex}else if(z.startsWith("export function ")||z.startsWith("export async function ")){let K=B3(Y,G);Q.push(K.functionCode),Q.push(`module.exports.${K.name} = ${K.name};`),G=K.nextIndex}else if(z.startsWith("const ")||z.startsWith("let ")||z.startsWith("var ")){let K=dZ(Y,G),{type:q,name:W,value:U}=K;Q.push(`${q} ${W} = ${U};`),Q.push(`module.exports.${W} = ${W};`),G=K.nextIndex}else if(z.startsWith("function ")||z.startsWith("async function ")){let K=B3(Y,G);Q.push(K.functionCode),Q.push(`module.exports.${K.name} = ${K.name};`),G=K.nextIndex}else if(z.startsWith("export default function ")||z.startsWith("export default async function ")){let K=Y[G].replace(/^(\s*)export\s+default\s+/,"$1"),q=[...Y];q[G]=K;let W=B3(q,G);if(Q.push(W.functionCode),W.name)Q.push(`module.exports.default = ${W.name};`);G=W.nextIndex}else if(z.startsWith("export default ")){let K=z.replace(/^export\s+default\s+/,"").replace(/;$/,"");Q.push(`module.exports.default = ${K};`),G++}else if(z.startsWith("class ")||z.startsWith("export class ")){let K=z.match(/(?:export\s+)?class\s+(\w+)/);if(K){let q=K[1],W=Y[G].replace(/^export\s+/,""),U=0,H=G;for(;H<Y.length;H++){let j=Y[H];for(let B of j)if(B==="{")U++;else if(B==="}")U--;if(H>G)W+=`
3865
- `+j;if(U<=0&&H>=G)break}Q.push(W),Q.push(`module.exports.${q} = ${q};`),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 Qq(Q.join(`
3866
- `),J,X)}function Qq($,Z,J){let X=$.length,Y="",Q=0,G=null,z=!1,K=!1,q=0;while(Q<X){let W=$[Q],U=$[Q+1];if(z){if(Y+=W,W===`
3867
- `)z=!1;Q++;continue}if(K){if(Y+=W,W==="*"&&U==="/"){Y+=U,Q+=2,K=!1;continue}Q++;continue}if(!G&&W==="/"&&U==="/"){z=!0,Y+=W,Q++;continue}if(!G&&W==="/"&&U==="*"){K=!0,Y+=W,Q++;continue}if(G){if(Y+=W,W==="\\"){Y+=U,Q+=2;continue}if(W===G&&G!=="`"){G=null,Q++;continue}if(G==="`"){if(W==="$"&&U==="{"){q++,Y+=U,Q+=2;continue}if(W==="`"){G=null,Q++;continue}}Q++;continue}if(q>0){if(W==="{")q++;else if(W==="}")q--}if(W==='"'||W==="'"||W==="`"){G=W,Y+=W,Q++;continue}if(W==="a"&&$.startsWith("await",Q)){let H=Gq($,Q);if(H){let{quote:j,path:B,end:V}=H;if(B.startsWith(".")||B.startsWith("~/")||B.startsWith("@/")){let _=B.startsWith(".")?s0.resolve(Z,B):s0.resolve(J,B.slice(2));Y+=`await import(${j}${_}${j})`,Q=V;continue}}}Y+=W,Q++}return Y}function Gq($,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 $J($,Z){let J=$[Z];if(J!=="{"&&J!=="[")return null;let Y=D0($,J,J==="{"?"}":"]",Z);if(Y===-1)return null;return{pattern:$.slice(Z,Y+1),endPos:Y+1}}function ZJ($){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?$J(J,X):null;if(z){Z.push(...ZJ(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 zq($){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],K=$[J-1];if(z!=="="&&z!==">"&&K!=="="&&K!=="!"&&K!=="<"&&K!==">")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 mZ($,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 dZ($,Z){let J=$[Z].trim(),X=zq(J),Y=X?[J,X.type,X.name,X.value]:null;if(!Y){let W=J.match(/^(?:export\s+)?(const|let|var)\s+/);if(W){let U=J.slice(W[0].length),H=Z;if(U.startsWith("{")||U.startsWith("[")){let B=U[0],V=B==="{"?"}":"]",_=mZ(U,B,V,0),L=U;for(let F=Z+1;F<$.length&&_>0;F++)L+=` ${$[F].trim()}`,H=F,_=mZ($[F],B,V,_);if(_>0)L=U,H=Z;U=L}let j=$J(U,0);if(j){let B=W[1],V=j.pattern,_=U.slice(j.endPos).trim();if(_.startsWith("=")){let L=_.slice(1).trim(),F=L,O=Math.max(H,Z);if(lZ(L)){let N=cZ($,O,L);F=N.value,O=N.nextIndex}else O=O+1;F=F.trim().replace(/;$/,"");let w=ZJ(V),R=`__stx_src_${Z}`,D=w.map((N)=>`module.exports.${N} = ${N};`).join(`
3938
+ `),H=[];for(let j of["title","description"]){let B=new RegExp(`\\b${j}\\s*:\\s*(['"\`])((?:\\\\.|(?!\\1)[^\\\\])*)\\1`).exec(U);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 K=z,q=0;while(!Yq(K)&&G+q+1<Y.length)q++,K=`${K} ${Y[G+q].trim()}`;G+=q;let W=K.match(/^import\s+(\w+)\s+from\s+['"](.+?)['"]/),U=K.match(/^import\s+\{([^}]*)\}\s+from\s+['"](.+?)['"]/),H=K.match(/^import\s+['"](.+?)['"]/),j=K,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(W){let[,V,_]=W,L=B(_);Q.push(`const ${V} = (await import('${L}')).default`),Q.push(`module.exports.${V} = ${V};`)}else if(U){let[,V,_]=U,L=B(_),F=[],O=[],w=rK.has(_);for(let R of V.split(",")){let D=R.trim();if(!D)continue;let N=D.split(/\s+as\s+/);if(N.length===2){let[I,M]=[N[0].trim(),N[1].trim()];if(w&&fZ.has(I)){Q.push(`const ${M} = ${I};`);continue}F.push(`${I}: ${M}`),O.push(M)}else{if(w&&fZ.has(D))continue;F.push(D),O.push(D)}}if(F.length>0)Q.push(`const { ${F.join(", ")} } = await import('${L}')`);for(let R of O)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(Qq.test(z))Q.push(Y[G]),G++;else if(z.startsWith("export const ")||z.startsWith("export let ")||z.startsWith("export var ")){let K=dZ(Y,G),{type:q,name:W,value:U}=K;Q.push(`${q} ${W} = ${U};`),Q.push(`module.exports.${W} = ${W};`),G=K.nextIndex}else if(z.startsWith("export function ")||z.startsWith("export async function ")){let K=B3(Y,G);Q.push(K.functionCode),Q.push(`module.exports.${K.name} = ${K.name};`),G=K.nextIndex}else if(z.startsWith("const ")||z.startsWith("let ")||z.startsWith("var ")){let K=dZ(Y,G),{type:q,name:W,value:U}=K;Q.push(`${q} ${W} = ${U};`),Q.push(`module.exports.${W} = ${W};`),G=K.nextIndex}else if(z.startsWith("function ")||z.startsWith("async function ")){let K=B3(Y,G);Q.push(K.functionCode),Q.push(`module.exports.${K.name} = ${K.name};`),G=K.nextIndex}else if(z.startsWith("export default function ")||z.startsWith("export default async function ")){let K=Y[G].replace(/^(\s*)export\s+default\s+/,"$1"),q=[...Y];q[G]=K;let W=B3(q,G);if(Q.push(W.functionCode),W.name)Q.push(`module.exports.default = ${W.name};`);G=W.nextIndex}else if(z.startsWith("export default ")){let K=z.replace(/^export\s+default\s+/,"").replace(/;$/,"");Q.push(`module.exports.default = ${K};`),G++}else if(z.startsWith("class ")||z.startsWith("export class ")){let K=z.match(/(?:export\s+)?class\s+(\w+)/);if(K){let q=K[1],W=Y[G].replace(/^export\s+/,""),U=0,H=G;for(;H<Y.length;H++){let j=Y[H];for(let B of j)if(B==="{")U++;else if(B==="}")U--;if(H>G)W+=`
3939
+ `+j;if(U<=0&&H>=G)break}Q.push(W),Q.push(`module.exports.${q} = ${q};`),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 Gq(Q.join(`
3940
+ `),J,X)}function Gq($,Z,J){let X=$.length,Y="",Q=0,G=null,z=!1,K=!1,q=0;while(Q<X){let W=$[Q],U=$[Q+1];if(z){if(Y+=W,W===`
3941
+ `)z=!1;Q++;continue}if(K){if(Y+=W,W==="*"&&U==="/"){Y+=U,Q+=2,K=!1;continue}Q++;continue}if(!G&&W==="/"&&U==="/"){z=!0,Y+=W,Q++;continue}if(!G&&W==="/"&&U==="*"){K=!0,Y+=W,Q++;continue}if(G){if(Y+=W,W==="\\"){Y+=U,Q+=2;continue}if(W===G&&G!=="`"){G=null,Q++;continue}if(G==="`"){if(W==="$"&&U==="{"){q++,Y+=U,Q+=2;continue}if(W==="`"){G=null,Q++;continue}}Q++;continue}if(q>0){if(W==="{")q++;else if(W==="}")q--}if(W==='"'||W==="'"||W==="`"){G=W,Y+=W,Q++;continue}if(W==="a"&&$.startsWith("await",Q)){let H=zq($,Q);if(H){let{quote:j,path:B,end:V}=H;if(B.startsWith(".")||B.startsWith("~/")||B.startsWith("@/")){let _=B.startsWith(".")?s0.resolve(Z,B):s0.resolve(J,B.slice(2));Y+=`await import(${j}${_}${j})`,Q=V;continue}}}Y+=W,Q++}return Y}function zq($,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 $J($,Z){let J=$[Z];if(J!=="{"&&J!=="[")return null;let Y=D0($,J,J==="{"?"}":"]",Z);if(Y===-1)return null;return{pattern:$.slice(Z,Y+1),endPos:Y+1}}function ZJ($){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?$J(J,X):null;if(z){Z.push(...ZJ(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 Kq($){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],K=$[J-1];if(z!=="="&&z!==">"&&K!=="="&&K!=="!"&&K!=="<"&&K!==">")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 mZ($,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 dZ($,Z){let J=$[Z].trim(),X=Kq(J),Y=X?[J,X.type,X.name,X.value]:null;if(!Y){let W=J.match(/^(?:export\s+)?(const|let|var)\s+/);if(W){let U=J.slice(W[0].length),H=Z;if(U.startsWith("{")||U.startsWith("[")){let B=U[0],V=B==="{"?"}":"]",_=mZ(U,B,V,0),L=U;for(let F=Z+1;F<$.length&&_>0;F++)L+=` ${$[F].trim()}`,H=F,_=mZ($[F],B,V,_);if(_>0)L=U,H=Z;U=L}let j=$J(U,0);if(j){let B=W[1],V=j.pattern,_=U.slice(j.endPos).trim();if(_.startsWith("=")){let L=_.slice(1).trim(),F=L,O=Math.max(H,Z);if(lZ(L)){let N=cZ($,O,L);F=N.value,O=N.nextIndex}else O=O+1;F=F.trim().replace(/;$/,"");let w=ZJ(V),R=`__stx_src_${Z}`,D=w.map((N)=>`module.exports.${N} = ${N};`).join(`
3868
3942
  `);return{type:B,name:R,value:`${F}; ${B} ${V} = ${R};
3869
3943
  ${D}`,nextIndex:O}}}}throw Error(`Failed to parse variable declaration: ${J}`)}let[,Q,G,z]=Y,K=z,q=Z;if(lZ(z)){let W=cZ($,Z,z);K=W.value,q=W.nextIndex}else q=Z+1;while(q<$.length){let W=$[q].trim();if(W.startsWith(".")||W.startsWith("?."))K+=`
3870
- ${$[q]}`,q++;else break}return K=K.trim().replace(/;$/,""),{type:Q,name:G,value:K,nextIndex:q}}function B3($,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(Kq(J)){let z=qq($,Z,Q);Q=z.functionCode,G=z.nextIndex}else G=Z+1;return{name:Y,functionCode:Q,nextIndex:G}}function lZ($){let Z=$.trim();if(Z.startsWith("{"))return D0(Z,"{","}",0)===-1;if(Z.startsWith("["))return D0(Z,"[","]",0)===-1;return!JJ(Z)}function JJ($){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 XJ($){let Z=$.indexOf("(");if(Z===-1)return $.indexOf("{");let J=D0($,"(",")",Z);if(J===-1)return-1;return $.indexOf("{",J)}function Kq($){let Z=XJ($);if(Z===-1)return!0;return D0($,"{","}",Z)===-1}function cZ($,Z,J){let X=J,Y=Z+1;while(Y<$.length&&!JJ(X)){let Q=$[Y];X+=`
3944
+ ${$[q]}`,q++;else break}return K=K.trim().replace(/;$/,""),{type:Q,name:G,value:K,nextIndex:q}}function B3($,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(qq(J)){let z=Wq($,Z,Q);Q=z.functionCode,G=z.nextIndex}else G=Z+1;return{name:Y,functionCode:Q,nextIndex:G}}function lZ($){let Z=$.trim();if(Z.startsWith("{"))return D0(Z,"{","}",0)===-1;if(Z.startsWith("["))return D0(Z,"[","]",0)===-1;return!JJ(Z)}function JJ($){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 XJ($){let Z=$.indexOf("(");if(Z===-1)return $.indexOf("{");let J=D0($,"(",")",Z);if(J===-1)return-1;return $.indexOf("{",J)}function qq($){let Z=XJ($);if(Z===-1)return!0;return D0($,"{","}",Z)===-1}function cZ($,Z,J){let X=J,Y=Z+1;while(Y<$.length&&!JJ(X)){let Q=$[Y];X+=`
3871
3945
  ${Q}`,Y++}while(Y<$.length){let Q=$[Y].trim();if(Q.startsWith(".")||Q.startsWith("?."))X+=`
3872
- ${$[Y]}`,Y++;else break}return{value:X,nextIndex:Y}}function qq($,Z,J){let X=J,Y=Z+1;while(Y<$.length){let Q=XJ(X);if(Q!==-1){if(D0(X,"{","}",Q)!==-1)break}let G=$[Y];X+=`
3873
- ${G}`,Y++}return{functionCode:X,nextIndex:Y}}function pZ($,Z){let J=Q0($,Z)??Q0(`(${$})`,Z);if(J!==void 0)return J;if(!/\bprocess\b/.test($))return;let X={...Z,process:Object.freeze({env:{...G2.env}})},Y=Object.keys(X).filter(z2),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 Wq($,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 K=z.trim().replace(/;$/,""),q=pZ(K,Z);if(q!==void 0)Z[G]=q}catch(K){console.warn(`Failed to parse export ${G} in fallback:`,K)}}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 K=z.trim().replace(/;$/,""),q=pZ(K,Z);if(q!==void 0)Z[G]=q}catch{}}}function Uq($){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 Hq($){let Z=$.trim();if(!Z)return!1;return/(?:const|let|var|function)\s+\w+/.test(Z)}var l2=new r1(500),o9=new r1(1000),VJ=33554432,_3=VJ;function jq($){let Z=$.componentRenderCacheBytes;if(typeof Z!=="number"||Z<0||Z===_3)return;_3=Z,r9.setMaxBytes(Z)}var r9=new r1(2000,{maxBytes:VJ,sizeOf:($)=>$.output.length});function Bq($){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 YJ($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Vq($){return/\bjs\b/.test($)||/\blang\s*=\s*["']?(js|javascript)["']?/i.test($)}function T1($){return!Vq($)}var s9=new Map;function V3($){let Z;try{Z=JSON.stringify($)}catch{return new Bun.Transpiler($)}let J=s9.get(Z);if(J)return J;if(s9.size>=16)s9.clear();let X=new Bun.Transpiler($);return s9.set(Z,X),X}var QJ=new WeakMap,Lq=256;function k1($){try{let Z=V3({loader:"ts",target:"browser",define:X2()}),J=QJ.get(Z);if(!J)J=new Map,QJ.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 K=Q.length;return Q.push(z),`"__STX_EXPR_${K}__"`}),Y=Y.replace(/\{\{\{[\s\S]*?\}\}\}/g,(z)=>{let K=Q.length;return Q.push(z),`"__STX_EXPR_${K}__"`}),Y=Y.replace(/\{\{[\s\S]*?\}\}/g,(z)=>{let K=Q.length;return Q.push(z),`"__STX_EXPR_${K}__"`});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>=Lq){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 _q($){let Z=[],J=new Set,X=0,Y=0,Q=$.length,G=(W)=>{Y++;while(Y<Q){if($[Y]==="\\"){Y+=2;continue}if($[Y]===W){Y++;return}Y++}},z=()=>{Y++;while(Y<Q){if($[Y]==="\\"){Y+=2;continue}if($[Y]==="`"){Y++;return}if($[Y]==="$"&&$[Y+1]==="{"){Y+=2;let W=1;while(Y<Q&&W>0)if($[Y]==="{")W++,Y++;else if($[Y]==="}")W--,Y++;else if($[Y]==="'"||$[Y]==='"')G($[Y]);else if($[Y]==="`")z();else Y++;continue}Y++}},K=()=>{if($[Y]==="/"&&$[Y+1]==="/"){while(Y<Q&&$[Y]!==`
3874
- `)Y++;return!0}if($[Y]==="/"&&$[Y+1]==="*"){Y+=2;while(Y<Q-1&&!($[Y]==="*"&&$[Y+1]==="/"))Y++;return Y+=2,!0}return!1},q=()=>{if(X!==0)return;let W=$.slice(Y).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(W){let B=W[2].split(",").map((V)=>{let _=V.trim().split(":");return _[_.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 U=$.slice(Y).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(U){let B=U[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(K())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])))q();Y++}return Z}function Oq($){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 Fq($){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 wq($,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 K=$[X];if(K==="}")Q++;else if(K==="{"){if(Q--,Q===0){G=X;break}}}if(G===-1)return;let z=$.slice(G+1,Y);for(let K of Oq(z)){let q=K.trim();if(!q||q.startsWith("..."))continue;let W=Fq(q);if(W===-1)continue;let U=q.slice(0,W).trim();if(!/^[A-Z_$][\w$]*$/i.test(U))continue;if(Z[U]!==void 0)continue;let H=q.slice(W+1).trim();if(!H)continue;try{let j=Object.keys(Z).filter(z2),B=Function(...j,`"use strict"; return (${H});`);Z[U]=B(...j.map((V)=>Z[V]))}catch{}}}catch{}}var Rq=new Set(["tr","td","th","thead","tbody","tfoot","caption","colgroup","col","option","optgroup","li","dt","dd"]);function Dq($,Z){let J=$.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)<([a-zA-Z][a-zA-Z0-9-]*)/s);if(!J)return null;let X=J[2].toLowerCase();if(!Rq.has(X))return null;if(($.match(new RegExp(`<${X}(?=[\\s/>])`,"gi"))??[]).length!==1)return null;if(!new RegExp(`</${X}>\\s*$`,"i").test($))return null;let Q=J[0].length;return $.slice(0,Q)+Z+$.slice(Q)}async function k9($,Z,J,X,Y){let Q=$.endsWith(".stx")?$.slice(0,-4):$,G=(L)=>L.split("-").map((F)=>F.charAt(0).toUpperCase()+F.slice(1)).join(""),z=(L)=>L.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),K=J.__importedComponents;if(K){for(let L of[Q,Q.toLowerCase(),G(Q),z(Q)])if(K.has(L))return!0}let q=[...new Set([`${Q}.stx`,`${G(Q)}.stx`,`${z(Q)}.stx`])],W=typeof Y.root==="string"?f.resolve(Y.root):void 0,U=W??f.dirname(X),H=[],j=(L)=>{if(L&&!H.includes(L))H.push(L)},B=J.__originalFilePath;if(B)j(f.join(f.dirname(B),"components"));if(j(Z),j(Y._rootComponentsDir),j(f.join(f.dirname(X),"components")),j(Y.componentsDir),W)j(f.resolve(W,"resources/views/components")),j(f.resolve(W,"resources/components")),j(f.resolve(W,"src/components")),j(f.resolve(W,"components"));for(let L of Y._layerComponentDirs??[])j(L);let V=Y._pluginComponentDirs;if(Array.isArray(V))for(let L of V)j(typeof L==="string"?L:null);if(j(Y.fallbackComponentsDir),Q.startsWith("./")||Q.startsWith("../"))return $0(f.resolve(f.dirname(X),`${Q}.stx`));let _=GJ(f.resolve(import.meta.dir,"components"));for(let L of H){let F=f.isAbsolute(L)?L:f.resolve(U,L);if(GJ(F)===_)continue;for(let O of q)if(await $0(f.join(F,O)))return!0}return!1}function GJ($){try{return BJ.realpathSync($)}catch{return $}}function Nq($){return $==="visible"||$==="idle"||$==="interaction"||$.startsWith("media:")}function zJ($){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 Mq($,Z,J){if(!$.includes("{{")&&!$.includes("{!!"))return $;let X=(Y,Q)=>{let G;try{G=S0(Y,Z)}catch{return Q}if(G===void 0||G===null)return"";let z=String(G);if(/<\/style/i.test(z))return console.warn(`[stx] a <style> expression in ${J??"<unknown>"} evaluated to CSS containing a closing style tag, which would end the element early, so it was dropped rather than emitted.`),"";return z};return $.replace(/\{!!([\s\S]*?)!!\}/g,(Y,Q)=>X(Q,Y)).replace(/\{\{([\s\S]*?)\}\}/g,(Y,Q)=>X(Q,Y))}var KJ=new Set;function qJ($,Z,J,X){let Y=`${$}\x00${Z}\x00${X??""}`;if(!process.env.STX_DEBUG&&KJ.has(Y))return;KJ.add(Y);let Q=Z?` used in ${Z}`:"",G=X?` Cause: ${X}.`:"",z=J.length>0?`
3946
+ ${$[Y]}`,Y++;else break}return{value:X,nextIndex:Y}}function Wq($,Z,J){let X=J,Y=Z+1;while(Y<$.length){let Q=XJ(X);if(Q!==-1){if(D0(X,"{","}",Q)!==-1)break}let G=$[Y];X+=`
3947
+ ${G}`,Y++}return{functionCode:X,nextIndex:Y}}function pZ($,Z){let J=Q0($,Z)??Q0(`(${$})`,Z);if(J!==void 0)return J;if(!/\bprocess\b/.test($))return;let X={...Z,process:Object.freeze({env:{...G2.env}})},Y=Object.keys(X).filter(z2),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 Uq($,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 K=z.trim().replace(/;$/,""),q=pZ(K,Z);if(q!==void 0)Z[G]=q}catch(K){console.warn(`Failed to parse export ${G} in fallback:`,K)}}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 K=z.trim().replace(/;$/,""),q=pZ(K,Z);if(q!==void 0)Z[G]=q}catch{}}}function Hq($){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 jq($){let Z=$.trim();if(!Z)return!1;return/(?:const|let|var|function)\s+\w+/.test(Z)}var l2=new r1(500),o9=new r1(1000),VJ=33554432,_3=VJ;function Bq($){let Z=$.componentRenderCacheBytes;if(typeof Z!=="number"||Z<0||Z===_3)return;_3=Z,r9.setMaxBytes(Z)}var r9=new r1(2000,{maxBytes:VJ,sizeOf:($)=>$.output.length});function Vq($){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 YJ($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Lq($){return/\bjs\b/.test($)||/\blang\s*=\s*["']?(js|javascript)["']?/i.test($)}function T1($){return!Lq($)}var s9=new Map;function V3($){let Z;try{Z=JSON.stringify($)}catch{return new Bun.Transpiler($)}let J=s9.get(Z);if(J)return J;if(s9.size>=16)s9.clear();let X=new Bun.Transpiler($);return s9.set(Z,X),X}var QJ=new WeakMap,_q=256;function k1($){try{let Z=V3({loader:"ts",target:"browser",define:X2()}),J=QJ.get(Z);if(!J)J=new Map,QJ.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 K=Q.length;return Q.push(z),`"__STX_EXPR_${K}__"`}),Y=Y.replace(/\{\{\{[\s\S]*?\}\}\}/g,(z)=>{let K=Q.length;return Q.push(z),`"__STX_EXPR_${K}__"`}),Y=Y.replace(/\{\{[\s\S]*?\}\}/g,(z)=>{let K=Q.length;return Q.push(z),`"__STX_EXPR_${K}__"`});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>=_q){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 Oq($){let Z=[],J=new Set,X=0,Y=0,Q=$.length,G=(W)=>{Y++;while(Y<Q){if($[Y]==="\\"){Y+=2;continue}if($[Y]===W){Y++;return}Y++}},z=()=>{Y++;while(Y<Q){if($[Y]==="\\"){Y+=2;continue}if($[Y]==="`"){Y++;return}if($[Y]==="$"&&$[Y+1]==="{"){Y+=2;let W=1;while(Y<Q&&W>0)if($[Y]==="{")W++,Y++;else if($[Y]==="}")W--,Y++;else if($[Y]==="'"||$[Y]==='"')G($[Y]);else if($[Y]==="`")z();else Y++;continue}Y++}},K=()=>{if($[Y]==="/"&&$[Y+1]==="/"){while(Y<Q&&$[Y]!==`
3948
+ `)Y++;return!0}if($[Y]==="/"&&$[Y+1]==="*"){Y+=2;while(Y<Q-1&&!($[Y]==="*"&&$[Y+1]==="/"))Y++;return Y+=2,!0}return!1},q=()=>{if(X!==0)return;let W=$.slice(Y).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(W){let B=W[2].split(",").map((V)=>{let _=V.trim().split(":");return _[_.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 U=$.slice(Y).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(U){let B=U[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(K())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])))q();Y++}return Z}function Fq($){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 wq($){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 Rq($,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 K=$[X];if(K==="}")Q++;else if(K==="{"){if(Q--,Q===0){G=X;break}}}if(G===-1)return;let z=$.slice(G+1,Y);for(let K of Fq(z)){let q=K.trim();if(!q||q.startsWith("..."))continue;let W=wq(q);if(W===-1)continue;let U=q.slice(0,W).trim();if(!/^[A-Z_$][\w$]*$/i.test(U))continue;if(Z[U]!==void 0)continue;let H=q.slice(W+1).trim();if(!H)continue;try{let j=Object.keys(Z).filter(z2),B=Function(...j,`"use strict"; return (${H});`);Z[U]=B(...j.map((V)=>Z[V]))}catch{}}}catch{}}var Dq=new Set(["tr","td","th","thead","tbody","tfoot","caption","colgroup","col","option","optgroup","li","dt","dd"]);function Nq($,Z){let J=$.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)<([a-zA-Z][a-zA-Z0-9-]*)/s);if(!J)return null;let X=J[2].toLowerCase();if(!Dq.has(X))return null;if(($.match(new RegExp(`<${X}(?=[\\s/>])`,"gi"))??[]).length!==1)return null;if(!new RegExp(`</${X}>\\s*$`,"i").test($))return null;let Q=J[0].length;return $.slice(0,Q)+Z+$.slice(Q)}async function k9($,Z,J,X,Y){let Q=$.endsWith(".stx")?$.slice(0,-4):$,G=(L)=>L.split("-").map((F)=>F.charAt(0).toUpperCase()+F.slice(1)).join(""),z=(L)=>L.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),K=J.__importedComponents;if(K){for(let L of[Q,Q.toLowerCase(),G(Q),z(Q)])if(K.has(L))return!0}let q=[...new Set([`${Q}.stx`,`${G(Q)}.stx`,`${z(Q)}.stx`])],W=typeof Y.root==="string"?f.resolve(Y.root):void 0,U=W??f.dirname(X),H=[],j=(L)=>{if(L&&!H.includes(L))H.push(L)},B=J.__originalFilePath;if(B)j(f.join(f.dirname(B),"components"));if(j(Z),j(Y._rootComponentsDir),j(f.join(f.dirname(X),"components")),j(Y.componentsDir),W)j(f.resolve(W,"resources/views/components")),j(f.resolve(W,"resources/components")),j(f.resolve(W,"src/components")),j(f.resolve(W,"components"));for(let L of Y._layerComponentDirs??[])j(L);let V=Y._pluginComponentDirs;if(Array.isArray(V))for(let L of V)j(typeof L==="string"?L:null);if(j(Y.fallbackComponentsDir),Q.startsWith("./")||Q.startsWith("../"))return $0(f.resolve(f.dirname(X),`${Q}.stx`));let _=GJ(f.resolve(import.meta.dir,"components"));for(let L of H){let F=f.isAbsolute(L)?L:f.resolve(U,L);if(GJ(F)===_)continue;for(let O of q)if(await $0(f.join(F,O)))return!0}return!1}function GJ($){try{return BJ.realpathSync($)}catch{return $}}function Mq($){return $==="visible"||$==="idle"||$==="interaction"||$.startsWith("media:")}function zJ($){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 Aq($,Z,J){if(!$.includes("{{")&&!$.includes("{!!"))return $;let X=(Y,Q)=>{let G;try{G=S0(Y,Z)}catch{return Q}if(G===void 0||G===null)return"";let z=String(G);if(/<\/style/i.test(z))return console.warn(`[stx] a <style> expression in ${J??"<unknown>"} evaluated to CSS containing a closing style tag, which would end the element early, so it was dropped rather than emitted.`),"";return z};return $.replace(/\{!!([\s\S]*?)!!\}/g,(Y,Q)=>X(Q,Y)).replace(/\{\{([\s\S]*?)\}\}/g,(Y,Q)=>X(Q,Y))}var KJ=new Set;function qJ($,Z,J,X){let Y=`${$}\x00${Z}\x00${X??""}`;if(!process.env.STX_DEBUG&&KJ.has(Y))return;KJ.add(Y);let Q=Z?` used in ${Z}`:"",G=X?` Cause: ${X}.`:"",z=J.length>0?`
3875
3949
  searched:
3876
3950
  ${J.map((K)=>` - ${K}`).join(`
3877
- `)}`:"";console.error(`[stx] component <${$}> could not be resolved${Q}, so it rendered as nothing.${G}${z}`)}function WJ($){return`<!-- stx: component "${$.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}function Aq($){let Z=new Set,J=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|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 I1($,Z,J,X,Y,Q,G,z=new Set,K){let{extractVariables:q}=await s("stx/variable-extractor",()=>import("./chunk-n9wmhtap.js")),W=z??new Set;if(W.has($))return`[Circular component reference: ${$}]`;let U=new Set(W);U.add($);let H=typeof Z.client==="string"?Z.client.trim():"";if("client"in Z)delete Z.client;let j=H&&H!=="load"&&Nq(H)?H:"";try{let B=(h)=>h.split("-").map((c)=>c.charAt(0).toUpperCase()+c.slice(1)).join(""),V=(h)=>h.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_=$.endsWith(".stx")?$.slice(0,-4):$,L=null,F=Y.__importedComponents;if(F){let h=[_,_.toLowerCase(),B(_),V(_)];for(let c of h)if(F.has(c)){L=F.get(c);break}}let O=[];if(!L){let h=[`${_}.stx`,`${B(_)}.stx`,`${V(_)}.stx`],c=[...new Set(h)],Y0=Y.__originalFilePath,o=[];if(o.push(...G._layerComponentDirs??[]),Y0){let M0=f.join(f.dirname(Y0),"components");o.push(M0)}if(X)o.push(X);let F0=G._rootComponentsDir;if(typeof F0==="string"&&!o.includes(F0))o.push(F0);let U0=f.join(f.dirname(Q),"components");if(!o.includes(U0))o.push(U0);if(G.componentsDir&&G.componentsDir!==X&&!o.includes(G.componentsDir))o.push(G.componentsDir);let P0=typeof G.root==="string"?f.resolve(G.root):void 0,X1=P0??f.dirname(Q),n=[];if(P0)n.push(f.resolve(P0,"resources/views/components")),n.push(f.resolve(P0,"resources/components")),n.push(f.resolve(P0,"src/components")),n.push(f.resolve(P0,"components"));n.push(f.resolve(import.meta.dir,"components"));for(let M0 of n)if(!o.includes(M0))o.push(M0);let m0=G._pluginComponentDirs;if(Array.isArray(m0)){for(let M0 of m0)if(typeof M0==="string"&&!o.includes(M0))o.push(M0)}if(G.fallbackComponentsDir&&!o.includes(G.fallbackComponentsDir))o.push(G.fallbackComponentsDir);let P1=[...new Set(o.map((M0)=>{if(!M0)return M0;return f.isAbsolute(M0)?M0:f.resolve(X1,M0)}))];o.length=0,o.push(...P1);let v1=`${_}\x00${Q}\x00${P1.join("\x00")}`,$5=o9.get(v1);if($5)if(await $0($5))L=$5;else o9.delete(v1);if(!L&&(_.startsWith("./")||_.startsWith("../")))L=f.resolve(f.dirname(Q),`${_}.stx`),O.push(L);else if(!L)for(let M0 of o){if(!M0)continue;for(let i2 of c){let n2=f.join(M0,i2);if(O.push(n2),await $0(n2)){L=n2;break}}if(L)break;if(!L)try{let i2=await import("fs");if(!i2.statSync(M0,{throwIfNoEntry:!1})?.isDirectory())continue;let MJ=8,Z5=[{path:M0,depth:0}];while(Z5.length>0&&!L){let s2=Z5.pop();if(s2.depth>=MJ)continue;let R3;try{R3=i2.readdirSync(s2.path,{withFileTypes:!0})}catch{continue}for(let o2 of R3){if(!o2.isDirectory())continue;if(o2.name==="node_modules"||o2.name.startsWith("."))continue;let D3=f.join(s2.path,o2.name);for(let AJ of c){let J5=f.join(D3,AJ);if(O.push(J5),await $0(J5)){L=J5;break}}if(L)break;Z5.push({path:D3,depth:s2.depth+1})}}}catch{}if(L)break}if(L)o9.set(v1,L)}if(!L||!await $0(L))return qJ($,Q,O),WJ($);K.add(L);let w;if(l2.has(L))w=l2.get(L);else try{w=await Bun.file(L).text(),l2.set(L,w)}catch(h){let c=h instanceof Error?h.message:String(h);return qJ($,Q,[L],c),WJ($)}let R=new Set(["__originalFilePath","__importedComponents",a2,"__stx_client_signal_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),D={};for(let[h,c]of Object.entries(Y))if(!h.startsWith("__")||R.has(h))D[h]=c;let N=J;if(J.includes("@include")){let{processIncludes:h}=await s("stx/includes",()=>import("./chunk-t3pfdz1r.js"));N=await h(J,Y,Q,G,K)}if(/<[A-Z][\w.-]*[\s/>]/.test(N)){let{processComponents:h}=await s("stx/component-renderer",()=>import("./chunk-fkht7kzs.js"));N=await h(N,{...Y,__processedComponents:W},Q,G,K)}let I=[];if(zJ(N)){let{processExpressions:h}=await s("stx/expressions",()=>import("./chunk-scn75qrm.js")),c=Y.__stx_signals_gate===void 0?{...Y,__stx_signals_gate:!0}:Y;N=h(N,c,Q);for(let Y0 of N.matchAll(/\{\{([\s\S]*?)\}\}/g))I.push(Y0[1].trim())}let M=f0(N),T=[],k=M.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(h,c)=>{let Y0=M.scripts[Number(c)]||"",o=Y0.match(/^<script\b([^>]*)>/i)?.[1]||"",F0=o.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),U0=!F0||["module","text/javascript","application/javascript"].includes(F0);if(!/\bserver\b/i.test(o)&&U0)return T.push(Y0),"";return Y0}),{extractSlotContent:A}=await s("stx/slots",()=>import("./chunk-9csrj2k2.js")),E=A(k),C={};if(E.defaultSlot?.trim())C.default=E.defaultSlot;for(let[h,c]of E.namedSlots)C[h]=c.content;let b=Y.__stx_scope_seq??={n:0,key:Bun.hash(String(Y.__filename??Q)).toString(36).slice(0,6)},y=`stx_${_.replace(/[^a-zA-Z0-9]/g,"_")}_${++b.n}_${b.key}`,P={...D,$uid:y,...Z,props:Z,slot:k,$slots:C,__processedComponents:U,__sections:{},__stx_signals_gate:Y1(w)||zJ(J),__stx_preserved_client_expressions:[...Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[],...I]};wq(w,P);let u=w,p=O9(u);if(p)u=p.content.trim();let m=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,X0=[...w.matchAll(m)],r=[],J0=null,i=X0.some((h)=>/\bserver\b/.test(h[1]||"")&&/\bcache\b/.test(h[1]||"")),q0=null,a=null,V0=null,o0=0,u0=null;if(jq(G),i&&_3>0){let h=Bq({props:Z,slot:J,buildMode:G.buildMode??"",skipEventDirectives:G.skipEventDirectives===!0,layers:G._layerGraph?.layers.map((c)=>c.configFile),uid:y});if(h!==null){q0=`${L}\x00${j1(w)}\x00${h}`;let c=r9.get(q0);if(c){for(let Y0 of c.dependencies)K.add(Y0);if(f3(Y,c.clientFactories),b.n+=c.uidsConsumed,c.preservedClientExpressions.length>0){let Y0=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[]);for(let o of c.preservedClientExpressions)Y0.add(o);Y.__stx_preserved_client_expressions=[...Y0]}return c.output}a=new Set(K),V0=v3(Y),o0=b.n,u0=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[])}}let r0=new Set;for(let h of X0){let c=h[1]||"",Y0=h[2]||"",o=c.includes("server");if(T1(c)&&Y0.trim())Y0=k1(Y0);if(o&&Y0){for(let U0 of B1(Y0))r0.add(U0);try{await q(Y0,P,L,{onFailure:(U0)=>{if(U0.kind!=="unknown")J0=U0.kind}})}catch(U0){}}if(!o){let U0=Y0.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),P0=U0.includes("{{")&&U0.includes("}}"),X1=U0.includes("{!!")&&U0.includes("!!}");if(P0||X1)U0=j5(U0,P,L);let n=c.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");r.push(`<script${n}>${U0}</script>`)}}let l=f0(w).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),t=l?l[1]:"",T0=l?l[2]:"",W0="",x0=t&&/\bscoped\b/i.test(t);if(l)W0=`<style${t}>${Mq(T0,P,L)}</style>`;let j0=u;if(j0=j0.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),l)j0=j0.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let h=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,c=[];if(j0=j0.replace(h,(Y0,o)=>{let F0=o.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(F0)c.push(`<style${F0[1]}>${F0[2]}</style>`);return""}),j0=j0.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),c.length>0)W0=`${W0}${c.join(`
3878
- `)}`}if(J&&j0.includes("{{ text || slot }}"))j0=j0.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>J);let{applySlots:a9}=await s("stx/slots",()=>import("./chunk-9csrj2k2.js")),{defaultSlot:t9,namedSlots:e9}=E,S=r.some((h)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(h)),v=(h)=>S?u8(h,y):h,d=new Map([...e9].map(([h,c])=>[h,{...c,content:v(c.content)}]));j0=await a9(j0,v(t9),d,P);let e=Aq(r),z0=(Array.isArray(P.__stx_client_signal_names)?P.__stx_client_signal_names:[]).filter((h)=>!r0.has(h));if(e.length>0||z0.length>0)P.__stx_client_signal_names=[...new Set([...z0,...e])];else delete P.__stx_client_signal_names;let k0={...G,_rootComponentsDir:G._rootComponentsDir||G.componentsDir,componentsDir:f.dirname(L),skipSignalsRuntime:!0,skipEventDirectives:S||r.length===0,defaultLayout:void 0};P.__stxProcessingDepth=(Y.__stxProcessingDepth||0)+1;let a0=await K3(j0,P,L,k0,K),p2=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[]);for(let h of a0.matchAll(/\{\{([\s\S]*?)\}\}/g))p2.add(h[1].trim());if(p2.size>0)Y.__stx_preserved_client_expressions=[...p2];let J1=y,y0=a0;if(S){let h="";if(Object.keys(Z).length>0)try{h=` data-stx-props="${YJ(JSON.stringify(Z))}"`}catch{}let c=j?` stx-hydrate="${YJ(j)}"`:"",Y0=` data-stx-scope="${J1}"${h}${c}`;y0=Dq(a0,Y0)??`<div${Y0}>${a0}</div>`;let o=await Promise.all(r.map(async(F0)=>{let U0=F0.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!U0)return F0;let[,P0,X1]=U0,{vendorStyleTags:n,factoryBody:m0}=await kq(X1,L,G.buildMode==="compile"),P1=j?null:G5(Y,m0),v1=P1?`window.__stxComponentFactories[${JSON.stringify(P1)}](${JSON.stringify(J1)});`:`(${m0})(${JSON.stringify(J1)});`;if(j)return`${n}<script type="stx/island" data-stx-island="${J1}" data-stx-scoped data-stx-owner="${J1}"${P0}>${v1}</script>`;return`${n}<script data-stx-scoped data-stx-run="always" data-stx-owner="${J1}"${P0}>${v1}</script>`}));if(y0=y0+`
3951
+ `)}`:"";console.error(`[stx] component <${$}> could not be resolved${Q}, so it rendered as nothing.${G}${z}`)}function WJ($){return`<!-- stx: component "${$.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}function Iq($){let Z=new Set,J=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|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 I1($,Z,J,X,Y,Q,G,z=new Set,K){let{extractVariables:q}=await s("stx/variable-extractor",()=>import("./chunk-w568cjw6.js")),W=z??new Set;if(W.has($))return`[Circular component reference: ${$}]`;let U=new Set(W);U.add($);let H=typeof Z.client==="string"?Z.client.trim():"";if("client"in Z)delete Z.client;let j=H&&H!=="load"&&Mq(H)?H:"";try{let B=(h)=>h.split("-").map((c)=>c.charAt(0).toUpperCase()+c.slice(1)).join(""),V=(h)=>h.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_=$.endsWith(".stx")?$.slice(0,-4):$,L=null,F=Y.__importedComponents;if(F){let h=[_,_.toLowerCase(),B(_),V(_)];for(let c of h)if(F.has(c)){L=F.get(c);break}}let O=[];if(!L){let h=[`${_}.stx`,`${B(_)}.stx`,`${V(_)}.stx`],c=[...new Set(h)],Y0=Y.__originalFilePath,o=[];if(o.push(...G._layerComponentDirs??[]),Y0){let M0=f.join(f.dirname(Y0),"components");o.push(M0)}if(X)o.push(X);let F0=G._rootComponentsDir;if(typeof F0==="string"&&!o.includes(F0))o.push(F0);let U0=f.join(f.dirname(Q),"components");if(!o.includes(U0))o.push(U0);if(G.componentsDir&&G.componentsDir!==X&&!o.includes(G.componentsDir))o.push(G.componentsDir);let P0=typeof G.root==="string"?f.resolve(G.root):void 0,X1=P0??f.dirname(Q),n=[];if(P0)n.push(f.resolve(P0,"resources/views/components")),n.push(f.resolve(P0,"resources/components")),n.push(f.resolve(P0,"src/components")),n.push(f.resolve(P0,"components"));n.push(f.resolve(import.meta.dir,"components"));for(let M0 of n)if(!o.includes(M0))o.push(M0);let m0=G._pluginComponentDirs;if(Array.isArray(m0)){for(let M0 of m0)if(typeof M0==="string"&&!o.includes(M0))o.push(M0)}if(G.fallbackComponentsDir&&!o.includes(G.fallbackComponentsDir))o.push(G.fallbackComponentsDir);let P1=[...new Set(o.map((M0)=>{if(!M0)return M0;return f.isAbsolute(M0)?M0:f.resolve(X1,M0)}))];o.length=0,o.push(...P1);let v1=`${_}\x00${Q}\x00${P1.join("\x00")}`,$5=o9.get(v1);if($5)if(await $0($5))L=$5;else o9.delete(v1);if(!L&&(_.startsWith("./")||_.startsWith("../")))L=f.resolve(f.dirname(Q),`${_}.stx`),O.push(L);else if(!L)for(let M0 of o){if(!M0)continue;for(let i2 of c){let n2=f.join(M0,i2);if(O.push(n2),await $0(n2)){L=n2;break}}if(L)break;if(!L)try{let i2=await import("fs");if(!i2.statSync(M0,{throwIfNoEntry:!1})?.isDirectory())continue;let MJ=8,Z5=[{path:M0,depth:0}];while(Z5.length>0&&!L){let s2=Z5.pop();if(s2.depth>=MJ)continue;let R3;try{R3=i2.readdirSync(s2.path,{withFileTypes:!0})}catch{continue}for(let o2 of R3){if(!o2.isDirectory())continue;if(o2.name==="node_modules"||o2.name.startsWith("."))continue;let D3=f.join(s2.path,o2.name);for(let AJ of c){let J5=f.join(D3,AJ);if(O.push(J5),await $0(J5)){L=J5;break}}if(L)break;Z5.push({path:D3,depth:s2.depth+1})}}}catch{}if(L)break}if(L)o9.set(v1,L)}if(!L||!await $0(L))return qJ($,Q,O),WJ($);K.add(L);let w;if(l2.has(L))w=l2.get(L);else try{w=await Bun.file(L).text(),l2.set(L,w)}catch(h){let c=h instanceof Error?h.message:String(h);return qJ($,Q,[L],c),WJ($)}let R=new Set(["__originalFilePath","__importedComponents",a2,"__stx_client_signal_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),D={};for(let[h,c]of Object.entries(Y))if(!h.startsWith("__")||R.has(h))D[h]=c;let N=J;if(J.includes("@include")){let{processIncludes:h}=await s("stx/includes",()=>import("./chunk-p5cs4xsd.js"));N=await h(J,Y,Q,G,K)}if(/<[A-Z][\w.-]*[\s/>]/.test(N)){let{processComponents:h}=await s("stx/component-renderer",()=>import("./chunk-r7g4a7m3.js"));N=await h(N,{...Y,__processedComponents:W},Q,G,K)}let I=[];if(zJ(N)){let{processExpressions:h}=await s("stx/expressions",()=>import("./chunk-kjkkh5p6.js")),c=Y.__stx_signals_gate===void 0?{...Y,__stx_signals_gate:!0}:Y;N=h(N,c,Q);for(let Y0 of N.matchAll(/\{\{([\s\S]*?)\}\}/g))I.push(Y0[1].trim())}let M=f0(N),T=[],k=M.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(h,c)=>{let Y0=M.scripts[Number(c)]||"",o=Y0.match(/^<script\b([^>]*)>/i)?.[1]||"",F0=o.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),U0=!F0||["module","text/javascript","application/javascript"].includes(F0);if(!/\bserver\b/i.test(o)&&U0)return T.push(Y0),"";return Y0}),{extractSlotContent:A}=await s("stx/slots",()=>import("./chunk-rk40an2d.js")),E=A(k),C={};if(E.defaultSlot?.trim())C.default=E.defaultSlot;for(let[h,c]of E.namedSlots)C[h]=c.content;let b=Y.__stx_scope_seq??={n:0,key:Bun.hash(String(Y.__filename??Q)).toString(36).slice(0,6)},y=`stx_${_.replace(/[^a-zA-Z0-9]/g,"_")}_${++b.n}_${b.key}`,P={...D,$uid:y,...Z,props:Z,slot:k,$slots:C,__processedComponents:U,__sections:{},__stx_signals_gate:Y1(w)||zJ(J),__stx_preserved_client_expressions:[...Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[],...I]};Rq(w,P);let u=w,p=O9(u);if(p)u=p.content.trim();let m=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,X0=[...w.matchAll(m)],r=[],J0=null,i=X0.some((h)=>/\bserver\b/.test(h[1]||"")&&/\bcache\b/.test(h[1]||"")),q0=null,a=null,V0=null,o0=0,u0=null;if(Bq(G),i&&_3>0){let h=Vq({props:Z,slot:J,buildMode:G.buildMode??"",skipEventDirectives:G.skipEventDirectives===!0,layers:G._layerGraph?.layers.map((c)=>c.configFile),uid:y});if(h!==null){q0=`${L}\x00${j1(w)}\x00${h}`;let c=r9.get(q0);if(c){for(let Y0 of c.dependencies)K.add(Y0);if(f3(Y,c.clientFactories),b.n+=c.uidsConsumed,c.preservedClientExpressions.length>0){let Y0=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[]);for(let o of c.preservedClientExpressions)Y0.add(o);Y.__stx_preserved_client_expressions=[...Y0]}return c.output}a=new Set(K),V0=v3(Y),o0=b.n,u0=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[])}}let r0=new Set;for(let h of X0){let c=h[1]||"",Y0=h[2]||"",o=c.includes("server");if(T1(c)&&Y0.trim())Y0=k1(Y0);if(o&&Y0){for(let U0 of B1(Y0))r0.add(U0);try{await q(Y0,P,L,{onFailure:(U0)=>{if(U0.kind!=="unknown")J0=U0.kind}})}catch(U0){}}if(!o){let U0=Y0.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),P0=U0.includes("{{")&&U0.includes("}}"),X1=U0.includes("{!!")&&U0.includes("!!}");if(P0||X1)U0=j5(U0,P,L);let n=c.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");r.push(`<script${n}>${U0}</script>`)}}let l=f0(w).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),t=l?l[1]:"",T0=l?l[2]:"",W0="",x0=t&&/\bscoped\b/i.test(t);if(l)W0=`<style${t}>${Aq(T0,P,L)}</style>`;let j0=u;if(j0=j0.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),l)j0=j0.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let h=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,c=[];if(j0=j0.replace(h,(Y0,o)=>{let F0=o.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(F0)c.push(`<style${F0[1]}>${F0[2]}</style>`);return""}),j0=j0.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),c.length>0)W0=`${W0}${c.join(`
3952
+ `)}`}if(J&&j0.includes("{{ text || slot }}"))j0=j0.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>J);let{applySlots:a9}=await s("stx/slots",()=>import("./chunk-rk40an2d.js")),{defaultSlot:t9,namedSlots:e9}=E,S=r.some((h)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(h)),v=(h)=>S?u8(h,y):h,d=new Map([...e9].map(([h,c])=>[h,{...c,content:v(c.content)}]));j0=await a9(j0,v(t9),d,P);let e=Iq(r),z0=(Array.isArray(P.__stx_client_signal_names)?P.__stx_client_signal_names:[]).filter((h)=>!r0.has(h));if(e.length>0||z0.length>0)P.__stx_client_signal_names=[...new Set([...z0,...e])];else delete P.__stx_client_signal_names;let k0={...G,_rootComponentsDir:G._rootComponentsDir||G.componentsDir,componentsDir:f.dirname(L),skipSignalsRuntime:!0,skipEventDirectives:S||r.length===0,defaultLayout:void 0};P.__stxProcessingDepth=(Y.__stxProcessingDepth||0)+1;let a0=await K3(j0,P,L,k0,K),p2=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[]);for(let h of a0.matchAll(/\{\{([\s\S]*?)\}\}/g))p2.add(h[1].trim());if(p2.size>0)Y.__stx_preserved_client_expressions=[...p2];let J1=y,y0=a0;if(S){let h="";if(Object.keys(Z).length>0)try{h=` data-stx-props="${YJ(JSON.stringify(Z))}"`}catch{}let c=j?` stx-hydrate="${YJ(j)}"`:"",Y0=` data-stx-scope="${J1}"${h}${c}`;y0=Nq(a0,Y0)??`<div${Y0}>${a0}</div>`;let o=await Promise.all(r.map(async(F0)=>{let U0=F0.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!U0)return F0;let[,P0,X1]=U0,{vendorStyleTags:n,factoryBody:m0}=await Eq(X1,L,G.buildMode==="compile"),P1=j?null:G5(Y,m0),v1=P1?`window.__stxComponentFactories[${JSON.stringify(P1)}](${JSON.stringify(J1)});`:`(${m0})(${JSON.stringify(J1)});`;if(j)return`${n}<script type="stx/island" data-stx-island="${J1}" data-stx-scoped data-stx-owner="${J1}"${P0}>${v1}</script>`;return`${n}<script data-stx-scoped data-stx-run="always" data-stx-owner="${J1}"${P0}>${v1}</script>`}));if(y0=y0+`
3879
3953
  `+o.join(`
3880
3954
  `),W0)y0+=`
3881
3955
  `+W0}else{if(W0)y0+=`
@@ -3883,7 +3957,7 @@ ${J.map((K)=>` - ${K}`).join(`
3883
3957
  `+Y0.join(`
3884
3958
  `),P.__stx_event_bindings=[]}}if(x0){let h=c9(y0,L);if(h.hasScoped)y0=h.html}if(q0&&a){let h=Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[];r9.set(q0,{output:y0,dependencies:[...K].filter((c)=>!a.has(c)),clientFactories:V0?x3(Y,V0):[],uidsConsumed:b.n-o0,preservedClientExpressions:u0?h.filter((c)=>!u0.has(c)):[]})}if(J0)y0=`<!--stx-render-failed:${J0}-->${y0}`;return T.length>0?`${y0}
3885
3959
  ${T.join(`
3886
- `)}`:y0}catch(B){return`[Error processing component: ${B instanceof Error?B.message:String(B)}]`}finally{W.delete($)}}async function $0($){return Bun.file($).exists()}function O3($,Z){let J=f.resolve(Z),X=f.resolve($),Y=J.endsWith(f.sep)?J:J+f.sep;if(X===J||X.startsWith(Y))return X;return null}async function Iq($,Z,J,X){let Y=Z.startsWith("layouts/")?Z.slice(8):Z,Q=f.join($,Y);for(let G of Q.endsWith(".stx")?[Q]:[Q,`${Q}.stx`])if(await $0(G)){if(X)console.log(`Found layout in ${$}: ${G}`);return J?.add(G),G}return null}async function q9($,Z,J,X){let Y=await Tq($,Z,J,X);if(Y===null)return null;let Q=O3(Y,process.cwd());if(Q)return Q;let G=[J.root,J.layoutsDir,J.fallbackLayoutsDir,J.componentsDir,J.partialsDir,J.pagesDir,...J._layerLayoutDirs??[]].filter((z)=>typeof z==="string"&&z.length>0);for(let z of G){let K=f.isAbsolute(z)?z:f.resolve(process.cwd(),z);if(O3(Y,K))return f.resolve(Y)}return console.warn(`[stx] rejected resolved template path that escapes project root: ${Y} (template: ${$}, from: ${Z})`),null}async function Tq($,Z,J,X){if(J.debug)console.log(`Resolving template path: ${$} from ${Z}`);let Y=f.dirname(Z),Q=process.cwd();if($.startsWith("/")){let H=f.join(Q,$),j=O3(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 $0(j)&&X)X.add(j);return j}let G=f.join(Y,$);if(await $0(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 $0(j)){if(J.debug)console.log(`Found direct path with extension: ${j}`);if(X)X.add(j);return j}}let z=[];if(z.push(...J._layerLayoutDirs??[]),J.layoutsDir)z.push(f.isAbsolute(J.layoutsDir)?J.layoutsDir:f.resolve(process.cwd(),J.layoutsDir));let K=f.resolve(Y),q=process.cwd();for(let H=0;H<10;H++){let j=f.join(K,"layouts"),B=!1;try{B=BJ.statSync(j,{throwIfNoEntry:!1})?.isDirectory()??!1}catch{}if(B){z.push(j);break}let V=f.dirname(K);if(V===K||V.length<q.length)break;K=V}for(let H of z){let j=await Iq(H,$,X,J.debug);if(j)return j}if(J.fallbackLayoutsDir){let H=f.isAbsolute(J.fallbackLayoutsDir)?J.fallbackLayoutsDir:f.resolve(process.cwd(),J.fallbackLayoutsDir),j=$.startsWith("layouts/")?$.slice(8):$,B=[f.join(H,j)];if(!$.endsWith(".stx"))B.push(`${B[0]}.stx`);for(let V of B)if(await $0(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=f.join(J.partialsDir||Y,"layouts",H[1]);if(await $0(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 $0(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=f.join(J.partialsDir,"layouts");if(await $0(H)){let j=f.join(H,$);if(await $0(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 $0(B)){if(J.debug)console.log(`Found in partials layouts dir with extension: ${B}`);if(X)X.add(B);return B}}}}let W=J.partialsDir||f.join(process.cwd(),"views"),U=f.join(W,$);if(await $0(U)){if(J.debug)console.log(`Found in views path: ${U}`);if(X)X.add(U);return U}if(!$.endsWith(".stx")){let H=`${U}.stx`;if(await $0(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=f.join(f.dirname(Y),"layouts",$);if(await $0(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 $0(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 LJ($,Z,J){let X=0,Y="",Q="";try{if(typeof Z==="number"&&Z>=0){let G=$.split(`
3960
+ `)}`:y0}catch(B){return`[Error processing component: ${B instanceof Error?B.message:String(B)}]`}finally{W.delete($)}}async function $0($){return Bun.file($).exists()}function O3($,Z){let J=f.resolve(Z),X=f.resolve($),Y=J.endsWith(f.sep)?J:J+f.sep;if(X===J||X.startsWith(Y))return X;return null}async function Tq($,Z,J,X){let Y=Z.startsWith("layouts/")?Z.slice(8):Z,Q=f.join($,Y);for(let G of Q.endsWith(".stx")?[Q]:[Q,`${Q}.stx`])if(await $0(G)){if(X)console.log(`Found layout in ${$}: ${G}`);return J?.add(G),G}return null}async function q9($,Z,J,X){let Y=await kq($,Z,J,X);if(Y===null)return null;let Q=O3(Y,process.cwd());if(Q)return Q;let G=[J.root,J.layoutsDir,J.fallbackLayoutsDir,J.componentsDir,J.partialsDir,J.pagesDir,...J._layerLayoutDirs??[]].filter((z)=>typeof z==="string"&&z.length>0);for(let z of G){let K=f.isAbsolute(z)?z:f.resolve(process.cwd(),z);if(O3(Y,K))return f.resolve(Y)}return console.warn(`[stx] rejected resolved template path that escapes project root: ${Y} (template: ${$}, from: ${Z})`),null}async function kq($,Z,J,X){if(J.debug)console.log(`Resolving template path: ${$} from ${Z}`);let Y=f.dirname(Z),Q=process.cwd();if($.startsWith("/")){let H=f.join(Q,$),j=O3(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 $0(j)&&X)X.add(j);return j}let G=f.join(Y,$);if(await $0(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 $0(j)){if(J.debug)console.log(`Found direct path with extension: ${j}`);if(X)X.add(j);return j}}let z=[];if(z.push(...J._layerLayoutDirs??[]),J.layoutsDir)z.push(f.isAbsolute(J.layoutsDir)?J.layoutsDir:f.resolve(process.cwd(),J.layoutsDir));let K=f.resolve(Y),q=process.cwd();for(let H=0;H<10;H++){let j=f.join(K,"layouts"),B=!1;try{B=BJ.statSync(j,{throwIfNoEntry:!1})?.isDirectory()??!1}catch{}if(B){z.push(j);break}let V=f.dirname(K);if(V===K||V.length<q.length)break;K=V}for(let H of z){let j=await Tq(H,$,X,J.debug);if(j)return j}if(J.fallbackLayoutsDir){let H=f.isAbsolute(J.fallbackLayoutsDir)?J.fallbackLayoutsDir:f.resolve(process.cwd(),J.fallbackLayoutsDir),j=$.startsWith("layouts/")?$.slice(8):$,B=[f.join(H,j)];if(!$.endsWith(".stx"))B.push(`${B[0]}.stx`);for(let V of B)if(await $0(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=f.join(J.partialsDir||Y,"layouts",H[1]);if(await $0(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 $0(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=f.join(J.partialsDir,"layouts");if(await $0(H)){let j=f.join(H,$);if(await $0(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 $0(B)){if(J.debug)console.log(`Found in partials layouts dir with extension: ${B}`);if(X)X.add(B);return B}}}}let W=J.partialsDir||f.join(process.cwd(),"views"),U=f.join(W,$);if(await $0(U)){if(J.debug)console.log(`Found in views path: ${U}`);if(X)X.add(U);return U}if(!$.endsWith(".stx")){let H=`${U}.stx`;if(await $0(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=f.join(f.dirname(Y),"layouts",$);if(await $0(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 $0(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 LJ($,Z,J){let X=0,Y="",Q="";try{if(typeof Z==="number"&&Z>=0){let G=$.split(`
3887
3961
  `),z=0;for(let K=0;K<G.length;K++)if(z+=G[K].length+1,z>=Z){X=K+1,Y=G[K].trim();let q=Math.max(0,K-2),W=Math.min(G.length,K+3);Q=G.slice(q,W).map((U,H)=>{let j=q+H+1;return`${j===X?"> ":" "}${j}: ${U}`}).join(`
3888
3962
  `);break}}else if(J){let G=$.indexOf(J);if(G>=0)return LJ($,G)}}catch{}return{lineNumber:X,lineContent:Y,context:Q}}var Z0={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 _0($,Z,J,X,Y,Q){let{lineNumber:G,context:z}=LJ(X,Y,Q),K=J.split("/").pop(),q=0;if(typeof Y==="number"&&Y>=0&&X){let U=X.lastIndexOf(`
3889
3963
  `,Math.max(0,Y-1));q=Y-(U+1)+1}let W="";if(G>0)W+=`
@@ -3898,7 +3972,7 @@ ${Z0.yellow}${Z0.bold}Message:${Z0.reset} ${Z}
3898
3972
  `,z)W+=`
3899
3973
  ${Z0.blue}${Z0.bold}Context:${Z0.reset}
3900
3974
  ${Z0.dim}${z}${Z0.reset}
3901
- `;return W}function IF(){l2.clear(),o9.clear(),r9.clear()}function TF(){return{size:l2.size,maxSize:500}}var L3=b1(128);async function kq($,Z,J){let X=j1($,Z,J),Y=L3.get(X);if(Y){if(jJ(Y.deps))return Y;L3.delete(X)}let Q=F3($,{filePath:Z,projectRoot:process.cwd()}),G=Q.code,z=w3(Q.styles);G=J2(G).code;let{hasUserImports:K,bundleClientScript:q}=await s("stx/client-script-bundler",()=>import("./chunk-mjdsjxm5.js")),W=[],U=!1;if(K(G)){let L=G;G=await q(L,Z,{projectRoot:process.cwd(),minify:J,collectInputs:W}),U=G===L}let{stripStxRuntimeImports:H}=await s("stx/signal-processing",()=>import("./chunk-1chgn7qv.js"));G=H(G);let j=$1(G),B=_q(j),V=`function(__scopeId) {
3975
+ `;return W}function TF(){l2.clear(),o9.clear(),r9.clear()}function kF(){return{size:l2.size,maxSize:500}}var L3=b1(128);async function Eq($,Z,J){let X=j1($,Z,J),Y=L3.get(X);if(Y){if(jJ(Y.deps))return Y;L3.delete(X)}let Q=F3($,{filePath:Z,projectRoot:process.cwd()}),G=Q.code,z=w3(Q.styles);G=J2(G).code;let{hasUserImports:K,bundleClientScript:q}=await s("stx/client-script-bundler",()=>import("./chunk-4j9n5z1q.js")),W=[],U=!1;if(K(G)){let L=G;G=await q(L,Z,{projectRoot:process.cwd(),minify:J,collectInputs:W}),U=G===L}let{stripStxRuntimeImports:H}=await s("stx/signal-processing",()=>import("./chunk-fy5jfqwe.js"));G=H(G);let j=$1(G),B=Oq(j),V=`function(__scopeId) {
3902
3976
  ${o1("const",[...UJ,...B],j)}
3903
3977
  const __scope = window.stx._scopes = window.stx._scopes || {};
3904
3978
  const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
@@ -3927,18 +4001,18 @@ catch (e) {}
3927
4001
  finally {
3928
4002
  window.__STX_CURRENT_ELEMENT__ = __previousCurrentElement;
3929
4003
  }
3930
- }`,_={vendorStyleTags:z,factoryBody:V,deps:HJ([...W,...Q.styles.map((L)=>L.resolvedPath)])};if(!U&&Q.unresolved.length===0)L3.set(X,_);return _}var Eq=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function yq($){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 bq($,Z){let J=Z;while(!0){let X=C1.join(J,"node_modules",$,"package.json");if(c2.existsSync(X))return C1.dirname(X);let Y=C1.dirname(J);if(Y===J)return null;J=Y}}function Sq($,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 Cq($,Z){let J=yq($);if(!J||!J.subpath)return null;let X=bq(J.pkg,Z);if(!X)return null;let Y;try{Y=JSON.parse(c2.readFileSync(C1.join(X,"package.json"),"utf8"))}catch{return null}let Q=`.${J.subpath}`,G=Sq(Y.exports,Q);if(!G)return null;let z=C1.resolve(X,G);return c2.existsSync(z)?z:null}function F3($,Z){let J=Z.filePath?C1.dirname(Z.filePath):Z.projectRoot||process.cwd(),X=Z.projectRoot||process.cwd(),Y=new Set,Q=[],G=[];return{code:$.replace(Eq,(K,q)=>{let W;try{if(q.startsWith("./")||q.startsWith("../")||q.startsWith("/")){if(W=q.startsWith("/")?q:C1.resolve(J,q),!c2.existsSync(W))throw Error(`file not found: ${W}`)}else{let U=null;try{U=Bun.resolveSync(q,X)}catch{U=Cq(q,X)}if(!U)throw Error(`could not resolve ${q} (Bun.resolveSync + exports fallback both failed)`);W=U}}catch(U){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(q)} (from ${Z.filePath||"<unknown>"}): ${U?.message||U}`),G.push(q),""}if(Y.has(W))return"";Y.add(W);try{let U=c2.readFileSync(W,"utf8");Q.push({source:q,resolvedPath:W,contents:U})}catch(U){console.warn(`[stx:vendor-css] could not read ${W}: ${U?.message||U}`),G.push(q)}return""}),styles:Q,unresolved:G}}function Pq($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function w3($){if($.length===0)return"";return`${$.map((Z)=>{return`<style data-stx-vendor="${Pq(Z.source)}" data-stx-layer="vendor">
4004
+ }`,_={vendorStyleTags:z,factoryBody:V,deps:HJ([...W,...Q.styles.map((L)=>L.resolvedPath)])};if(!U&&Q.unresolved.length===0)L3.set(X,_);return _}var yq=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function bq($){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 Sq($,Z){let J=Z;while(!0){let X=C1.join(J,"node_modules",$,"package.json");if(c2.existsSync(X))return C1.dirname(X);let Y=C1.dirname(J);if(Y===J)return null;J=Y}}function Cq($,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 Pq($,Z){let J=bq($);if(!J||!J.subpath)return null;let X=Sq(J.pkg,Z);if(!X)return null;let Y;try{Y=JSON.parse(c2.readFileSync(C1.join(X,"package.json"),"utf8"))}catch{return null}let Q=`.${J.subpath}`,G=Cq(Y.exports,Q);if(!G)return null;let z=C1.resolve(X,G);return c2.existsSync(z)?z:null}function F3($,Z){let J=Z.filePath?C1.dirname(Z.filePath):Z.projectRoot||process.cwd(),X=Z.projectRoot||process.cwd(),Y=new Set,Q=[],G=[];return{code:$.replace(yq,(K,q)=>{let W;try{if(q.startsWith("./")||q.startsWith("../")||q.startsWith("/")){if(W=q.startsWith("/")?q:C1.resolve(J,q),!c2.existsSync(W))throw Error(`file not found: ${W}`)}else{let U=null;try{U=Bun.resolveSync(q,X)}catch{U=Pq(q,X)}if(!U)throw Error(`could not resolve ${q} (Bun.resolveSync + exports fallback both failed)`);W=U}}catch(U){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(q)} (from ${Z.filePath||"<unknown>"}): ${U?.message||U}`),G.push(q),""}if(Y.has(W))return"";Y.add(W);try{let U=c2.readFileSync(W,"utf8");Q.push({source:q,resolvedPath:W,contents:U})}catch(U){console.warn(`[stx:vendor-css] could not read ${W}: ${U?.message||U}`),G.push(q)}return""}),styles:Q,unresolved:G}}function vq($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function w3($){if($.length===0)return"";return`${$.map((Z)=>{return`<style data-stx-vendor="${vq(Z.source)}" data-stx-layer="vendor">
3931
4005
  @layer vendor {
3932
4006
  ${Z.contents}
3933
4007
  }
3934
4008
  </style>`}).join(`
3935
4009
  `)}
3936
- `}var vq=Q2;function J2($){let Z=G0($),J=new Set;for(let z of $.matchAll(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm))for(let K of z[1].split(",")){let q=K.trim().split(/\s+as\s+/).pop()?.replace(/^type\s+/,"").trim();if(q)J.add(q)}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 K of z[1].split(",")){let q=K.trim().split(/[:=]/).pop()?.trim();if(q)X.add(q)}let Y=H1.filter((z)=>{if(J.has(z)||X.has(z))return!1;return DJ(Z,z,!0)}),Q=wJ(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(`
4010
+ `}var xq=Q2;function J2($){let Z=G0($),J=new Set;for(let z of $.matchAll(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm))for(let K of z[1].split(",")){let q=K.trim().split(/\s+as\s+/).pop()?.replace(/^type\s+/,"").trim();if(q)J.add(q)}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 K of z[1].split(",")){let q=K.trim().split(/[:=]/).pop()?.trim();if(q)X.add(q)}let Y=H1.filter((z)=>{if(J.has(z)||X.has(z))return!1;return DJ(Z,z,!0)}),Q=wJ(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(`
3937
4011
  `)}
3938
- ${$}`,imports:Y,models:Q}}var xq=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 wJ($){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(!xq.has(X[1]))Z.add(X[1]);return Array.from(Z)}function fq($){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 RJ($){let Z=new Set,J=new Set,X=$;X=X.replace(/^[ \t]*import\s+type\s+\{[^}]*\}\s+from\s+['"][^'"]+['"][ \t]*;?[ \t]*$/gm,"// [type import stripped]");let Y=new Set,Q=/^[ \t]*import\s+(?:type\s+)?{\s*([^}]+)\s*}\s+from\s+['"](@stacksjs\/browser|@stacksjs\/stx|stx)['"][ \t]*;?[ \t]*$/gm,G;while((G=Q.exec($))!==null){let U=G[1],H=G[2];if(G[0].includes("import type"))continue;let j=[];for(let V of U.split(",")){let _=V.trim();if(!_||_.startsWith("type "))continue;let L=_.match(/^([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?$/);if(!L)continue;let F=L[1],O=L[2]||F;if(Y.add(F),Y.add(O),H==="stx"||H==="@stacksjs/stx")Z.add(F);else J.add(F);if(O!==F)j.push(`${O} = ${F}`)}let B=j.length>0?`var ${j.join(", ")}; /* [auto-import processed] */`:"// [auto-import processed]";X=X.replace(G[0],B)}let z=fq(X);for(let U of vq){if(Y.has(U)||z.has(U))continue;if(new RegExp(`\\b${U}\\s*(?:<[^>]*>)?\\s*\\(`,"g").test(X))Z.add(U)}let K=G0(X),q=new Set;for(let U of X.matchAll(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm))for(let H of U[1].split(",")){let j=H.trim().replace(/^type\s+/,"").split(/\s+as\s+/);for(let B of j){let V=B.trim();if(V)q.add(V)}}for(let U of H1){if(Y.has(U)||z.has(U)||q.has(U))continue;if(DJ(K,U))J.add(U)}let W=wJ(X);for(let U of W)if(!Y.has(U)&&!z.has(U))J.add(U);return{code:X,stxImports:Array.from(Z),browserImports:Array.from(J)}}function DJ($,Z,J=!1){let X=new RegExp(`\\b${Z.replace(/[$]/g,"\\$")}\\b`,"g");for(let Y of $.matchAll(X)){let Q=Y.index??0,G=Q+Z.length,z=Q-1;while(z>=0&&/\s/.test($[z]))z--;if($[z]==="."&&$.slice(Math.max(0,z-2),z+1)!=="...")continue;let K=G;while(K<$.length&&/\s/.test($[K]))K++;if($[K]===":"&&$[K+1]!==":"&&($[z]==="{"||$[z]===","))continue;if(J&&!/^\s*(?:<[^>]*>)?\s*\(/.test($.slice(G)))continue;return!0}return!1}function NJ($,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
4012
+ ${$}`,imports:Y,models:Q}}var fq=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 wJ($){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(!fq.has(X[1]))Z.add(X[1]);return Array.from(Z)}function gq($){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 RJ($){let Z=new Set,J=new Set,X=$;X=X.replace(/^[ \t]*import\s+type\s+\{[^}]*\}\s+from\s+['"][^'"]+['"][ \t]*;?[ \t]*$/gm,"// [type import stripped]");let Y=new Set,Q=/^[ \t]*import\s+(?:type\s+)?{\s*([^}]+)\s*}\s+from\s+['"](@stacksjs\/browser|@stacksjs\/stx|stx)['"][ \t]*;?[ \t]*$/gm,G;while((G=Q.exec($))!==null){let U=G[1],H=G[2];if(G[0].includes("import type"))continue;let j=[];for(let V of U.split(",")){let _=V.trim();if(!_||_.startsWith("type "))continue;let L=_.match(/^([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?$/);if(!L)continue;let F=L[1],O=L[2]||F;if(Y.add(F),Y.add(O),H==="stx"||H==="@stacksjs/stx")Z.add(F);else J.add(F);if(O!==F)j.push(`${O} = ${F}`)}let B=j.length>0?`var ${j.join(", ")}; /* [auto-import processed] */`:"// [auto-import processed]";X=X.replace(G[0],B)}let z=gq(X);for(let U of xq){if(Y.has(U)||z.has(U))continue;if(new RegExp(`\\b${U}\\s*(?:<[^>]*>)?\\s*\\(`,"g").test(X))Z.add(U)}let K=G0(X),q=new Set;for(let U of X.matchAll(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm))for(let H of U[1].split(",")){let j=H.trim().replace(/^type\s+/,"").split(/\s+as\s+/);for(let B of j){let V=B.trim();if(V)q.add(V)}}for(let U of H1){if(Y.has(U)||z.has(U)||q.has(U))continue;if(DJ(K,U))J.add(U)}let W=wJ(X);for(let U of W)if(!Y.has(U)&&!z.has(U))J.add(U);return{code:X,stxImports:Array.from(Z),browserImports:Array.from(J)}}function DJ($,Z,J=!1){let X=new RegExp(`\\b${Z.replace(/[$]/g,"\\$")}\\b`,"g");for(let Y of $.matchAll(X)){let Q=Y.index??0,G=Q+Z.length,z=Q-1;while(z>=0&&/\s/.test($[z]))z--;if($[z]==="."&&$.slice(Math.max(0,z-2),z+1)!=="...")continue;let K=G;while(K<$.length&&/\s/.test($[K]))K++;if($[K]===":"&&$[K+1]!==":"&&($[z]==="{"||$[z]===","))continue;if(J&&!/^\s*(?:<[^>]*>)?\s*\(/.test($.slice(G)))continue;return!0}return!1}function NJ($,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
3939
4013
  ${J.join(`
3940
4014
  `)}
3941
- ${gq($,Z)}`;return""}function cF($,Z=[]){let{browserImports:J}=RJ($),X=new Set(Z);return NJ([],J.filter((Y)=>!X.has(Y)))}function gq($,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
4015
+ ${hq($,Z)}`;return""}function pF($,Z=[]){let{browserImports:J}=RJ($),X=new Set(Z);return NJ([],J.filter((Y)=>!X.has(Y)))}function hq($,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
3942
4016
  [${J.join(", ")}].forEach(function (e) {
3943
4017
  if (e[1] !== 'undefined') return;
3944
4018
  console.error(
@@ -3947,10 +4021,10 @@ ${gq($,Z)}`;return""}function cF($,Z=[]){let{browserImports:J}=RJ($),X=new Set(Z
3947
4021
  + 'or it should be imported from a relative path so the bundler includes it.'
3948
4022
  );
3949
4023
  });
3950
- `}function d9($){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 hq($,Z){return new RegExp(`(?<![.#\\w$])${Z}(?![\\w$])`).test($)}var uq=/token|secret|passw|apikey|api_key|privatekey|private_key|credential|webhook|bearer|jwt|signature/i,_J=new Set;function mq($,Z){let J=uq.test($),X=Z.length>32768;if(!J&&!X)return;if(_J.has($))return;if(_J.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 o$($,Z){if(!Z)return"";let J=G0($),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&&!hq(J,Q))continue;if(r2($,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;mq(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)
4024
+ `}function d9($){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 uq($,Z){return new RegExp(`(?<![.#\\w$])${Z}(?![\\w$])`).test($)}var mq=/token|secret|passw|apikey|api_key|privatekey|private_key|credential|webhook|bearer|jwt|signature/i,_J=new Set;function dq($,Z){let J=mq.test($),X=Z.length>32768;if(!J&&!X)return;if(_J.has($))return;if(_J.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 o$($,Z){if(!Z)return"";let J=G0($),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&&!uq(J,Q))continue;if(r2($,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;dq(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)
3951
4025
  ${Y.join(`
3952
4026
  `)}
3953
- `}var dq={left:0,middle:1,right:2};function lq($){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=dq[$.mouse];Z.push(`if ($event.button !== ${J}) return`)}if($.prevent)Z.push("$event.preventDefault()");if($.stop)Z.push("$event.stopPropagation()");return Z.join("; ")}function cq($,Z){let{elementId:J,event:X,modifiers:Y}=$,Q=Y5($.handler),G=lq(Y),z=[];if(Y.once)z.push("once: true");if(Y.capture)z.push("capture: true");if(X5(X,Y))z.push("passive: true");let K=z.length>0?`, { ${z.join(", ")} }`:"",q="";if(G)q+=`${G}; `;let W=Q.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),U=`var $emit = function(name, detail) {
4027
+ `}var lq={left:0,middle:1,right:2};function cq($){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=lq[$.mouse];Z.push(`if ($event.button !== ${J}) return`)}if($.prevent)Z.push("$event.preventDefault()");if($.stop)Z.push("$event.stopPropagation()");return Z.join("; ")}function pq($,Z){let{elementId:J,event:X,modifiers:Y}=$,Q=Y5($.handler),G=cq(Y),z=[];if(Y.once)z.push("once: true");if(Y.capture)z.push("capture: true");if(X5(X,Y))z.push("passive: true");let K=z.length>0?`, { ${z.join(", ")} }`:"",q="";if(G)q+=`${G}; `;let W=Q.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),U=`var $emit = function(name, detail) {
3954
4028
  $el.dispatchEvent(new CustomEvent(name, { detail: detail, bubbles: true, cancelable: true }))
3955
4029
  };`;function H(j){if(/\$emit\s*\(/.test(j))return`${U}
3956
4030
  ${j}`;return`var scope = $el.closest('[data-stx-scope]');
@@ -3993,11 +4067,11 @@ else {
3993
4067
  else {
3994
4068
  ${Q}
3995
4069
  }
3996
- }${K})`}function pq($){if($.length===0)return"";return`
4070
+ }${K})`}function iq($){if($.length===0)return"";return`
3997
4071
  // STX: auto-generated event bindings
3998
- ${$.map((J,X)=>cq(J,X)).join(`
4072
+ ${$.map((J,X)=>pq(J,X)).join(`
3999
4073
  `)}`}function OJ($){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 K=z;if(G++,K==="`"){let q=0;while(G<Q){if(X[G]==="\\"){G+=2;continue}if(X[G]==="`"&&q===0){G++;break}if(X[G]==="$"&&X[G+1]==="{"){q++,G+=2;continue}if(X[G]==="}"&&q>0){q--,G++;continue}G++}}else while(G<Q){if(X[G]==="\\"){G+=2;continue}if(X[G]===K){G++;break}G++}continue}if(z==="/"&&X[G+1]==="/"){while(G<Q&&X[G]!==`
4000
- `)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 K=X.slice(G),q=K.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(q){let H=q[1];if(!H.startsWith("_")&&!J.has(H))Z.push(H),J.add(H);G+=q[0].length;continue}let W=K.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(W){W[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+=W[0].length;continue}let U=K.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(U){let H=U[1];if(!H.startsWith("_")&&!J.has(H))Z.push(H),J.add(H);G+=U[0].length;continue}}G++}return Z}var iq=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 nq($){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(!iq.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 K=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((Q=K.exec($))!==null)X(Q[1]);let q=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((Q=q.exec($))!==null)X(Q[1]);let W=/@model\s*=\s*["']([^"']*)["']/gi;while((Q=W.exec($))!==null)X(Q[1]);let U=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((Q=U.exec($))!==null)X(Q[1]);return Z}async function l9($,Z={}){let J=$,X="",Y=!1,Q=[],G=F3(J,{filePath:Z.filePath,projectRoot:Z.projectRoot});J=G.code;let z=w3(G.styles),K=J2(J);J=K.code,Q=[...K.imports,...K.models];let{hasUserImports:q,bundleClientScript:W}=await s("stx/client-script-bundler",()=>import("./chunk-mjdsjxm5.js"));if(q(J))J=await W(J,Z.filePath||"",{projectRoot:Z.projectRoot,minify:Z.production}),Y=!0;if(Z.autoImports!==!1){let O=RJ(J);J=O.code,X=NJ(O.stxImports,O.browserImports.filter((w)=>!Q.includes(w)))}if(X=`${o$(J,Z.serverData)}${X}`,J=$1(J),!Y&&T1(Z.attrs||""))J=k1(J);let U=pq(Z.eventBindings||[]),H=(Z.attrs||"").trim(),j=/\btype\s*=\s*["']module["']/i.test(H),B=Z.instanceId?` data-stx-instance="${Z.instanceId}"`:"";if(j){let O=H.replace(/\btype\s*=\s*["']module["']/i,"").trim(),w=`type="module" data-stx-scoped${B}${O?` ${O}`:""}`;return`${z}<script ${w}>
4074
+ `)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 K=X.slice(G),q=K.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(q){let H=q[1];if(!H.startsWith("_")&&!J.has(H))Z.push(H),J.add(H);G+=q[0].length;continue}let W=K.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(W){W[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+=W[0].length;continue}let U=K.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(U){let H=U[1];if(!H.startsWith("_")&&!J.has(H))Z.push(H),J.add(H);G+=U[0].length;continue}}G++}return Z}var nq=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 sq($){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(!nq.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 K=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((Q=K.exec($))!==null)X(Q[1]);let q=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((Q=q.exec($))!==null)X(Q[1]);let W=/@model\s*=\s*["']([^"']*)["']/gi;while((Q=W.exec($))!==null)X(Q[1]);let U=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((Q=U.exec($))!==null)X(Q[1]);return Z}async function l9($,Z={}){let J=$,X="",Y=!1,Q=[],G=F3(J,{filePath:Z.filePath,projectRoot:Z.projectRoot});J=G.code;let z=w3(G.styles),K=J2(J);J=K.code,Q=[...K.imports,...K.models];let{hasUserImports:q,bundleClientScript:W}=await s("stx/client-script-bundler",()=>import("./chunk-4j9n5z1q.js"));if(q(J))J=await W(J,Z.filePath||"",{projectRoot:Z.projectRoot,minify:Z.production}),Y=!0;if(Z.autoImports!==!1){let O=RJ(J);J=O.code,X=NJ(O.stxImports,O.browserImports.filter((w)=>!Q.includes(w)))}if(X=`${o$(J,Z.serverData)}${X}`,J=$1(J),!Y&&T1(Z.attrs||""))J=k1(J);let U=iq(Z.eventBindings||[]),H=(Z.attrs||"").trim(),j=/\btype\s*=\s*["']module["']/i.test(H),B=Z.instanceId?` data-stx-instance="${Z.instanceId}"`:"";if(j){let O=H.replace(/\btype\s*=\s*["']module["']/i,"").trim(),w=`type="module" data-stx-scoped${B}${O?` ${O}`:""}`;return`${z}<script ${w}>
4001
4075
  ${Z2(`${X}${J}
4002
4076
  ${U}`)}
4003
4077
  </script>`}let V=FJ($),_=/function __stx_setup_/.test(J),L=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test($);function F(O){let w=O.length>0?`
@@ -4006,10 +4080,10 @@ window.stx.mount(function() {
4006
4080
  'use strict';
4007
4081
  ${Z2(`${X}${J}
4008
4082
  ${U}${w}`)}
4009
- })</script>`}if(!L&&!_){if(V)return F(OJ($));if(Z.templateContent){let O=OJ($);if(O.length>0){let w=nq(Z.templateContent);if(O.some((D)=>w.has(D)))return F(O)}}}return`${z}<script data-stx-scoped data-stx-run="always"${B}>
4083
+ })</script>`}if(!L&&!_){if(V)return F(OJ($));if(Z.templateContent){let O=OJ($);if(O.length>0){let w=sq(Z.templateContent);if(O.some((D)=>w.has(D)))return F(O)}}}return`${z}<script data-stx-scoped data-stx-run="always"${B}>
4010
4084
  ;(function() {
4011
4085
  'use strict';
4012
4086
  ${Z2(`${X}${J}
4013
4087
  ${U}`)}
4014
4088
  })()</script>`}
4015
- export{jX as yl,BX as zl,VX as Al,t0 as Bl,L5 as Cl,_5 as Dl,O5 as El,F5 as Fl,B4 as Gl,j4 as Hl,NX as Il,AX as Jl,TX as Kl,fW as Ll,gW as Ml,hW as Nl,uW as Ol,mW as Pl,UX as Ql,q4 as Rl,W4 as Sl,U4 as Tl,H4 as Ul,vW as Vl,M4 as Wl,_2 as Xl,IJ as Yl,X5 as Zl,Y5 as _l,Q5 as $l,bJ as am,y3 as bm,oq as cm,H1 as dm,X2 as em,iL as fm,F3 as gm,w3 as hm,vq as im,J2 as jm,RJ as km,DJ as lm,NJ as mm,cF as nm,d9 as om,o$ as pm,l9 as qm,ZW as rm,$9 as sm,JW as tm,XW as um,YW as vm,QW as wm,X9 as xm,lJ as ym,FW as zm,cJ as Am,wW as Bm,pJ as Cm,Z9 as Dm,U5 as Em,H5 as Fm,Y1 as Gm,iJ as Hm,j5 as Im,oJ as Jm,RW as Km,L1 as Lm,rJ as Mm,DW as Nm,S0 as Om,NW as Pm,TW as Qm,YX as Rm,QX as Sm,G4 as Tm,z4 as Um,K4 as Vm,CW as Wm,V4 as Xm,R5 as Ym,V2 as Zm,Y9 as _m,pW as $m,w5 as an,yX as bn,bX as cn,SX as dn,iW as en,_4 as fn,O4 as gn,K1 as hn,q1 as in,F1 as jn,z7 as kn,D2 as ln,L9 as mn,m5 as nn,hY as on,mY as pn,W7 as qn,lY as rn,cY as sn,H7 as tn,w1 as un,hH as vn,j7 as wn,o5 as xn,oY as yn,s5 as zn,rY as An,aY as Bn,uH as Cn,mH as Dn,B7 as En,V7 as Fn,L7 as Gn,tY as Hn,eY as In,dH as Jn,lH as Kn,$Q as Ln,cH as Mn,pH as Nn,R7 as On,A7 as Pn,t5 as Qn,Xj as Rn,A2 as Sn,e5 as Tn,$$ as Un,Yj as Vn,_Q as Wn,Qj as Xn,OQ as Yn,k7 as Zn,Gj as _n,FQ as $n,zj as ao,Kj as bo,O9 as co,z$ as do,Ej as eo,yj as fo,bj as go,Sj as ho,mQ as io,Q6 as jo,b2 as ko,aQ as lo,M$ as mo,q8 as no,VL as oo,B8 as po,jz as qo,lL as ro,Oz as so,r$ as to,a$ as uo,E8 as vo,y8 as wo,e$ as xo,$3 as yo,Cz as zo,Pz as Ao,b8 as Bo,N8 as Co,vz as Do,fz as Eo,h$ as Fo,t6 as Go,e6 as Ho,j3 as Io,aK as Jo,tK as Ko,eK as Lo,$q as Mo,Zq as No,Jq as Oo,Xq as Po,eZ as Qo,zq as Ro,Uq as So,Hq as To,a1 as Uo,b$ as Vo,T6 as Wo,RG as Xo,qV as Yo,WV as Zo,_6 as _o,UV as $o,T$ as ap,k$ as bp,E$ as cp,b6 as dp,S6 as ep,C6 as fp,fV as gp,gV as hp,v6 as ip,hV as jp,EG as kp,f6 as lp,m6 as mp,x$ as np,pG as op,f$ as pp,i6 as qp,n6 as rp,$z as sp,oV as tp,rV as up,s6 as vp,aV as wp,tV as xp,g$ as yp,$L as zp,o6 as Ap,ZL as Bp,J8 as Cp,x9 as Dp,f9 as Ep,$2 as Fp,Xz as Gp,Y8 as Hp,Q8 as Ip,GL as Jp,d$ as Kp,Yz as Lp,Qz as Mp,l$ as Np,c$ as Op,G8 as Pp,z8 as Qp,Z3 as Rp,J3 as Sp,Q3 as Tp,K3 as Up,DZ as Vp,VK as Wp,OK as Xp,FK as Yp,B1 as Zp,xO as _p,fO as $p,gO as aq,hO as bq,yZ as cq,PK as dq,uO as eq,mO as fq,dO as gq,hK as hq,cK as iq,pK as jq,iK as kq,nK as lq,Vq as mq,T1 as nq,V3 as oq,k1 as pq,Dq as qq,k9 as rq,Nq as sq,zJ as tq,Aq as uq,I1 as vq,$0 as wq,q9 as xq,LJ as yq,_0 as zq,IF as Aq,TF as Bq,A4 as Cq,I4 as Dq,_1 as Eq,T4 as Fq,f1 as Gq,k4 as Hq,O2 as Iq,QU as Jq,iX as Kq,N5 as Lq,GU as Mq,M5 as Nq,zU as Oq,KU as Pq,G1 as Qq,qU as Rq,WU as Sq,UU as Tq,HU as Uq,jU as Vq,BU as Wq,nX as Xq,I5 as Yq,E4 as Zq,LU as _q,_U as $q,OU as ar,FU as br,wU as cr,b4 as dr,RU as er,S4 as fr,DU as gr,NU as hr,F2 as ir,eX as jr,TU as kr,ZY as lr,g4 as mr,K9 as nr,CU as or,p4 as pr,C5 as qr,lU as rr,v5 as sr,_Y as tr,RY as ur,cU as vr,pU as wr,iU as xr,nU as yr,sU as zr,oU as Ar,DY as Br,NY as Cr,n4 as Dr,x5 as Er,TY as Fr,g5 as Gr,Q7 as Hr,HH as Ir,jH as Jr,u5 as Kr,CY as Lr,G7 as Mr};
4089
+ export{jX as zl,BX as Al,VX as Bl,t0 as Cl,L5 as Dl,_5 as El,O5 as Fl,F5 as Gl,B4 as Hl,j4 as Il,NX as Jl,AX as Kl,TX as Ll,gW as Ml,hW as Nl,uW as Ol,mW as Pl,dW as Ql,UX as Rl,q4 as Sl,W4 as Tl,U4 as Ul,H4 as Vl,xW as Wl,M4 as Xl,_2 as Yl,IJ as Zl,X5 as _l,Y5 as $l,Q5 as am,bJ as bm,y3 as cm,rq as dm,H1 as em,X2 as fm,nL as gm,F3 as hm,w3 as im,xq as jm,J2 as km,RJ as lm,DJ as mm,NJ as nm,pF as om,d9 as pm,o$ as qm,l9 as rm,JW as sm,$9 as tm,XW as um,YW as vm,QW as wm,GW as xm,X9 as ym,lJ as zm,wW as Am,cJ as Bm,RW as Cm,pJ as Dm,Z9 as Em,U5 as Fm,H5 as Gm,Y1 as Hm,iJ as Im,j5 as Jm,oJ as Km,DW as Lm,L1 as Mm,rJ as Nm,NW as Om,S0 as Pm,MW as Qm,kW as Rm,YX as Sm,QX as Tm,G4 as Um,z4 as Vm,K4 as Wm,PW as Xm,V4 as Ym,R5 as Zm,V2 as _m,Y9 as $m,iW as an,w5 as bn,yX as cn,bX as dn,SX as en,nW as fn,_4 as gn,O4 as hn,K1 as in,q1 as jn,F1 as kn,z7 as ln,D2 as mn,L9 as nn,m5 as on,hY as pn,mY as qn,W7 as rn,lY as sn,cY as tn,H7 as un,w1 as vn,uH as wn,j7 as xn,o5 as yn,oY as zn,s5 as An,rY as Bn,aY as Cn,mH as Dn,dH as En,B7 as Fn,V7 as Gn,L7 as Hn,tY as In,eY as Jn,lH as Kn,cH as Ln,$Q as Mn,pH as Nn,iH as On,R7 as Pn,A7 as Qn,t5 as Rn,Yj as Sn,A2 as Tn,e5 as Un,$$ as Vn,Qj as Wn,_Q as Xn,Gj as Yn,OQ as Zn,k7 as _n,zj as $n,FQ as ao,Kj as bo,qj as co,O9 as do,z$ as eo,yj as fo,bj as go,Sj as ho,Cj as io,mQ as jo,Q6 as ko,b2 as lo,aQ as mo,M$ as no,q8 as oo,LL as po,B8 as qo,Bz as ro,cL as so,Fz as to,r$ as uo,a$ as vo,E8 as wo,y8 as xo,e$ as yo,$3 as zo,Pz as Ao,vz as Bo,b8 as Co,N8 as Do,xz as Eo,gz as Fo,h$ as Go,t6 as Ho,e6 as Io,j3 as Jo,tK as Ko,eK as Lo,$q as Mo,Zq as No,Jq as Oo,Xq as Po,Yq as Qo,eZ as Ro,Kq as So,Hq as To,jq as Uo,a1 as Vo,b$ as Wo,T6 as Xo,RG as Yo,WV as Zo,UV as _o,_6 as $o,HV as ap,T$ as bp,k$ as cp,E$ as dp,b6 as ep,S6 as fp,C6 as gp,gV as hp,hV as ip,v6 as jp,uV as kp,EG as lp,f6 as mp,m6 as np,x$ as op,pG as pp,f$ as qp,i6 as rp,n6 as sp,$z as tp,rV as up,aV as vp,s6 as wp,tV as xp,eV as yp,g$ as zp,ZL as Ap,o6 as Bp,JL as Cp,J8 as Dp,x9 as Ep,f9 as Fp,$2 as Gp,Yz as Hp,Y8 as Ip,Q8 as Jp,zL as Kp,d$ as Lp,Qz as Mp,Gz as Np,l$ as Op,c$ as Pp,G8 as Qp,z8 as Rp,Z3 as Sp,J3 as Tp,Q3 as Up,K3 as Vp,DZ as Wp,LK as Xp,FK as Yp,wK as Zp,B1 as _p,fO as $p,gO as aq,hO as bq,uO as cq,yZ as dq,vK as eq,mO as fq,dO as gq,lO as hq,uK as iq,pK as jq,iK as kq,nK as lq,sK as mq,Lq as nq,T1 as oq,V3 as pq,k1 as qq,Nq as rq,k9 as sq,Mq as tq,zJ as uq,Iq as vq,I1 as wq,$0 as xq,q9 as yq,LJ as zq,_0 as Aq,TF as Bq,kF as Cq,A4 as Dq,I4 as Eq,_1 as Fq,T4 as Gq,f1 as Hq,k4 as Iq,O2 as Jq,GU as Kq,iX as Lq,N5 as Mq,zU as Nq,M5 as Oq,KU as Pq,qU as Qq,G1 as Rq,WU as Sq,UU as Tq,HU as Uq,jU as Vq,BU as Wq,VU as Xq,nX as Yq,I5 as Zq,E4 as _q,_U as $q,OU as ar,FU as br,wU as cr,RU as dr,b4 as er,DU as fr,S4 as gr,NU as hr,MU as ir,F2 as jr,eX as kr,kU as lr,ZY as mr,g4 as nr,K9 as or,PU as pr,p4 as qr,C5 as rr,cU as sr,v5 as tr,_Y as ur,RY as vr,pU as wr,iU as xr,nU as yr,sU as zr,oU as Ar,rU as Br,DY as Cr,NY as Dr,n4 as Er,x5 as Fr,TY as Gr,g5 as Hr,Q7 as Ir,jH as Jr,BH as Kr,u5 as Lr,CY as Mr,G7 as Nr};